![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/imageop_gui.h"#include "widgets/widget_settings.h"#include "develop/dev_history_gui.h"#include "develop/blend_gui.h"#include "develop/dev_history.h"#include "develop/gui_throttle.h"#include "develop/develop.h"#include "develop/imageop.h"#include "develop/pixelpipe_hb.h"#include "system/macros.h"#include <gtk/gtk.h>
Include dependency graph for dev_history_gui.c:Go to the source code of this file.
Data Structures | |
| struct | dt_dev_pending_commit_t |
Typedefs | |
| typedef struct dt_dev_pending_commit_t | dt_dev_pending_commit_t |
Functions | |
| static void | _undo_restore_gui (dt_develop_t *dev, const int mask_edit_mode, const int request_mask_display) |
| void | dt_dev_history_gui_update (dt_develop_t *dev) |
| Apply history-loaded params to module GUIs. | |
| static gboolean | _drain_pending_commits (gpointer user_data) |
| static void | _queue_pending_commit (dt_develop_t *dev, dt_iop_module_t *module, const gboolean enable) |
| void | dt_dev_history_flush_pending_commits (dt_develop_t *dev) |
Run every history commit still queued for dev, now. | |
| void | dt_dev_history_drop_pending_commits (dt_develop_t *dev) |
Discard every history commit still queued for dev, without running it. | |
| void | dt_dev_add_history_item_real (dt_develop_t *dev, dt_iop_module_t *module, gboolean enable, gboolean redraw) |
| Thread-safe wrapper around dt_dev_add_history_item_ext(). | |
| static void | _commit_gui (dt_develop_t *dev, dt_iop_module_t *module) |
| void | dt_dev_history_gui_init (void) |
| Install the history engine's GUI handlers. Called once from dt_init() beside the other handler installs – safe under ansel-cli too, because every handler fires only for a dev with a focused GUI module, which a headless dev never has. | |
Variables | |
| static GQueue | _pending_commits = G_QUEUE_INIT |
| static guint | _pending_commit_source = 0 |
|
static |
Definition at line 290 of file dev_history_gui.c.
References dt_dev_get_thumbnail_size(), dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_gui_set_enable_button(), and L.
Referenced by dt_dev_history_gui_init().
|
static |
Definition at line 160 of file dev_history_gui.c.
References _pending_commit_source, _pending_commits, dt_dev_pending_commit_t::dev, dt_dev_history_commit_item_now(), dt_free, dt_dev_pending_commit_t::enable, L, and void().
Referenced by _queue_pending_commit(), and dt_dev_history_flush_pending_commits().
|
static |
Definition at line 184 of file dev_history_gui.c.
References _drain_pending_commits(), _pending_commit_source, _pending_commits, dt_dev_pending_commit_t::dev, dt_dev_history_commit_item_now(), dt_gui_throttle_get_timeout_ms(), dt_dev_pending_commit_t::enable, enable(), IS_NULL_PTR, and L.
Referenced by dt_dev_add_history_item_real().
|
static |
Definition at line 36 of file dev_history_gui.c.
References dt_iop_module_gui_t::blend_data, DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_iop_gui_update_blendif(), dt_iop_module_t::gui, dt_develop_t::gui_module, L, and void().
Referenced by dt_dev_history_gui_init().
| void dt_dev_add_history_item_real | ( | struct dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| gboolean | enable, | ||
| gboolean | redraw | ||
| ) |
Thread-safe wrapper around dt_dev_add_history_item_ext().
Locks history mutex, invalidates pipelines, triggers recomputation and saves history. This is the typical entry point for GUI actions.
| dev | Develop context. |
| module | Module instance. |
| enable | Enable state. |
| redraw | Whether to force a GUI redraw. |
Definition at line 283 of file dev_history_gui.c.
References _queue_pending_commit(), enable(), L, and void().
| void dt_dev_history_drop_pending_commits | ( | struct dt_develop_t * | dev | ) |
Discard every history commit still queued for dev, without running it.
Last-resort counterpart to dt_dev_history_flush_pending_commits(), for a dev already too far torn down to commit to. Prefer the flush wherever the edit can still be saved.
| dev | the develop context, or NULL to drop every pending request. |
Definition at line 254 of file dev_history_gui.c.
References _pending_commit_source, _pending_commits, dt_dev_pending_commit_t::dev, dt_free, IS_NULL_PTR, and L.
Referenced by cleanup(), and dt_dev_cleanup().
| void dt_dev_history_flush_pending_commits | ( | struct dt_develop_t * | dev | ) |
Run every history commit still queued for dev, now.
dt_dev_add_history_item_real() queues its commit rather than running it, so that a slider drag or a combobox scroll does not run one per step. A queued request IS the user's last edit, so it is run here, not discarded.
Any code about to tear down dev's pipe nodes, iop list or history MUST call this while dev is still whole – it is the last moment at which committing is safe, and a request draining after teardown is the darkroom race described in CLAUDE.md, which crashes far from where it is caused.
| dev | the develop context, or NULL to flush every pending request. |
Definition at line 218 of file dev_history_gui.c.
References _drain_pending_commits(), _pending_commit_source, _pending_commits, dt_dev_pending_commit_t::dev, dt_dev_history_commit_item_now(), dt_free, dt_gui_throttle_get_timeout_ms(), dt_dev_pending_commit_t::enable, IS_NULL_PTR, and L.
Referenced by leave().
Install the history engine's GUI handlers. Called once from dt_init() beside the other handler installs – safe under ansel-cli too, because every handler fires only for a dev with a focused GUI module, which a headless dev never has.
Definition at line 304 of file dev_history_gui.c.
References _commit_gui(), _undo_restore_gui(), dt_dev_history_set_commit_gui_handler(), and dt_dev_history_set_undo_restore_gui_handler().
Referenced by dt_init().
| void dt_dev_history_gui_update | ( | struct dt_develop_t * | dev | ) |
Apply history-loaded params to module GUIs.
Ensures module instances shown in the GUI match the history state.
| dev | Develop context. |
Definition at line 50 of file dev_history_gui.c.
References dt_dev_history_refresh_nodes_ext(), dt_gui_freeze_begin, dt_iop_gui_cleanup_module(), dt_iop_gui_init(), dt_iop_gui_set_expander(), dt_iop_gui_update(), dt_iop_is_hidden(), dt_iop_request_focus(), dt_pthread_rwlock_unlock(), dt_pthread_rwlock_wrlock(), dt_develop_t::gui_attached, dt_develop_t::gui_module, dt_develop_t::history, dt_develop_t::history_mutex, dt_develop_t::iop, IS_NULL_PTR, and L.
Referenced by _darkroom_image_loaded_callback(), _history_apply_history_end(), _pop_undo(), dt_apply_dev_history_update(), dt_ioppr_migrate_iop_order(), and dt_lightroom_import().
|
static |
Definition at line 157 of file dev_history_gui.c.
Referenced by _drain_pending_commits(), _queue_pending_commit(), dt_dev_history_drop_pending_commits(), and dt_dev_history_flush_pending_commits().
|
static |
Definition at line 156 of file dev_history_gui.c.
Referenced by _drain_pending_commits(), _queue_pending_commit(), dt_dev_history_drop_pending_commits(), and dt_dev_history_flush_pending_commits().