![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/widget_settings.h"#include "gui/develop/history_merge_gui.h"#include "common/conf.h"#include "system/macros.h"#include "system/mem_alloc.h"#include "common/logging.h"#include "develop/iop_order.h"#include "math/topological_sort.h"#include "develop/blend.h"#include "develop/dev_history.h"#include "develop/develop.h"#include "develop/imageop.h"#include "develop/masks.h"#include "gui/application.h"#include <glib.h>#include <string.h>#include "widgets/dialog.h"#include "widgets/label.h"#include "widgets/widget_style.h"
Include dependency graph for history_merge_gui.c:Go to the source code of this file.
Data Structures | |
| struct | _hm_id_info_t |
| struct | _hm_report_reorder_ctx_t |
| struct | dt_hm_drag_hint_align_t |
| struct | _hm_label_t |
Typedefs | |
| typedef enum dt_hm_report_col_t | dt_hm_report_col_t |
Functions | |
| static gchar * | _hm_clean_module_name (const dt_iop_module_t *mod) |
| static gchar * | _hm_module_label_short (const dt_iop_module_t *mod) |
| static gchar * | _hm_pretty_id (const char *id) |
| static gchar * | _hm_pretty_id_from_id_ht (const char *id, GHashTable *id_ht, const gboolean prefer_dest) |
| static gchar * | _hm_cycle_node_label (const dt_digraph_node_t *n, GHashTable *id_ht) |
| static void | _hm_append_cycle_label (GString *out, const char *s, const gboolean bold) |
| dt_hm_constraint_choice_t | _hm_ask_user_constraints_choice (GHashTable *id_ht, const char *faulty_id, const char *src_prev, const char *src_next, const char *dst_prev, const char *dst_next) |
| gboolean | _hm_warn_missing_raster_producers (const GList *mod_list) |
| void | _hm_show_toposort_cycle_popup (GList *cycle_nodes, GHashTable *id_ht) |
| static gchar * | _hm_module_row_label (const dt_iop_module_t *mod) |
| static gboolean | _hm_history_masks_match (const dt_dev_history_item_t *a, const dt_dev_history_item_t *b) |
| static gboolean | _hm_history_items_match (const dt_dev_history_item_t *a, const dt_dev_history_item_t *b) |
| static gint | _hm_label_cmp (gconstpointer a, gconstpointer b) |
| GPtrArray * | _hm_collect_labels_from_history_map (GHashTable *last_by_id, const GHashTable *mod_list_ids, GPtrArray **out_styles) |
| static dt_iop_module_t * | _hm_module_from_id (dt_develop_t *dev, const char *id) |
| static gboolean | _hm_module_visible_in_report (const dt_iop_module_t *mod, const GHashTable *mod_list_ids) |
| static gchar * | _hm_report_dest_label (const dt_iop_module_t *mod, GHashTable *dst_last_by_id, const GHashTable *orig_ids) |
| static GPtrArray * | _hm_collect_enabled_modules_gui_order (const dt_develop_t *dev, const GHashTable *mod_list_ids) |
| static void | _hm_report_resync_history_iop_order (dt_develop_t *dev) |
| static GPtrArray * | _hm_report_collect_dest_ids (GtkTreeModel *model) |
| static GPtrArray * | _hm_report_build_desired_visible_order (dt_develop_t *dev_dest, GtkTreeModel *model) |
| static GList * | _hm_report_build_ordered_modules (dt_develop_t *dev_dest, const GPtrArray *visible_order, const GHashTable *mod_list_ids) |
| static gboolean | _hm_report_apply_visible_order (dt_develop_t *dev_dest, const GPtrArray *visible_order, const GHashTable *mod_list_ids) |
| static GHashTable * | _hm_report_build_moved_set (dt_develop_t *dev_src, GtkTreeModel *model, const GHashTable *mod_list_ids) |
| static void | _hm_report_update_move_styles (GtkListStore *store, dt_develop_t *dev_src, const GHashTable *mod_list_ids) |
| static void | _hm_report_update_arrows (GtkListStore *store, GHashTable *override, GHashTable *dst_last_by_id, GHashTable *dst_last_before_by_id) |
| static void | _hm_report_keep_input_row_at_bottom (GtkListStore *store) |
| static void | _hm_report_update_dest_labels (GtkListStore *store, dt_develop_t *dev_dest, GHashTable *dst_last_by_id, const GHashTable *orig_ids, const GHashTable *override) |
| static void | _hm_report_apply_store_order (_hm_report_reorder_ctx_t *ctx) |
| static void | _hm_report_drag_begin (GtkWidget *widget, GdkDragContext *context, gpointer user_data) |
| static void | _hm_report_drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, guint info, guint time, gpointer user_data) |
| static void | _hm_report_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint info, guint time, gpointer user_data) |
| static GHashTable * | _hm_build_override_map (const dt_develop_t *dev_dest, GHashTable *src_last_by_id, GHashTable *dst_last_before_by_id) |
| static void | _hm_report_align_drag_hint (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data) |
| gboolean | _hm_show_merge_report_popup (dt_develop_t *dev_dest, dt_develop_t *dev_src, const gboolean merge_iop_order, const gboolean used_source_order, const dt_history_merge_strategy_t strategy, GHashTable *src_last_by_id, GHashTable *dst_last_before_by_id, const GHashTable *orig_ids, const GHashTable *mod_list_ids, const char *source_label, dt_hm_batch_state_t *batch) |
| gboolean | dt_gui_merge_options_dialog (const char *title, const char *mode_key, const char *iop_order_key, const char *ask_key, const gboolean iop_order_available) |
| Show a modal dialog to pick merge mode and pipeline order before a paste or style apply. | |
| void | dt_history_merge_gui_register_handlers (void) |
Variables | |
| static const char *const | HM_REPORT_DISABLED_FG = "#282828" |
| static const char *const | HM_REPORT_EXISTING_DST_FG = "#bbb" |
| typedef enum dt_hm_report_col_t dt_hm_report_col_t |
| enum dt_hm_report_col_t |
Definition at line 409 of file history_merge_gui.c.
|
static |
Definition at line 122 of file history_merge_gui.c.
Referenced by _hm_show_toposort_cycle_popup().
| dt_hm_constraint_choice_t _hm_ask_user_constraints_choice | ( | GHashTable * | id_ht, |
| const char * | faulty_id, | ||
| const char * | src_prev, | ||
| const char * | src_next, | ||
| const char * | dst_prev, | ||
| const char * | dst_next | ||
| ) |
Definition at line 130 of file history_merge_gui.c.
References _hm_pretty_id_from_id_ht(), dt_free, dt_gui_get_global(), dt_gui_main_window(), dt_gui_refocus_parent(), DT_HM_CONSTRAINTS_PREFER_DEST, DT_HM_CONSTRAINTS_PREFER_SRC, FALSE, IS_NULL_PTR, res, TRUE, and window.
Referenced by dt_history_merge_gui_register_handlers().
|
static |
Definition at line 1228 of file history_merge_gui.c.
References _hm_history_items_match(), _hm_make_node_id(), dt_dev_get_history_end_ext(), dt_dev_history_get_last_item_by_module(), dt_free, dt_free_gpointer(), dt_develop_t::history, dt_develop_t::iop, dt_iop_module_t::multi_name, and dt_iop_module_t::op.
Referenced by _hm_show_merge_report_popup().
|
static |
Definition at line 53 of file history_merge_gui.c.
References delete_underscore(), dt_capitalize_label(), and dt_iop_module_t::op.
Referenced by _hm_module_label_short(), _hm_module_row_label(), and _hm_pretty_id_from_id_ht().
|
static |
Definition at line 581 of file history_merge_gui.c.
References _hm_module_visible_in_report(), dt_develop_t::iop, and IS_NULL_PTR.
Referenced by _hm_show_merge_report_popup().
| GPtrArray * _hm_collect_labels_from_history_map | ( | GHashTable * | last_by_id, |
| const GHashTable * | mod_list_ids, | ||
| GPtrArray ** | out_styles | ||
| ) |
Definition at line 473 of file history_merge_gui.c.
References _hm_label_cmp(), _hm_module_row_label(), dt_free, dt_iop_module_needs_mask_history(), dt_dev_history_item_t::enabled, IOP_FLAGS_NO_HISTORY_STACK, dt_dev_history_item_t::iop_order, _hm_label_t::iop_order, IS_NULL_PTR, key, _hm_label_t::label, _hm_label_t::style, TRUE, and value.
Referenced by _hm_show_merge_report_popup().
|
static |
Definition at line 116 of file history_merge_gui.c.
References _hm_pretty_id_from_id_ht(), n, and TRUE.
Referenced by _hm_show_toposort_cycle_popup().
|
static |
Definition at line 380 of file history_merge_gui.c.
References _hm_history_masks_match(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _hm_build_override_map().
|
static |
Definition at line 353 of file history_merge_gui.c.
References dt_masks_get_from_id_ext(), dt_masks_group_get_hash_ext(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _hm_history_items_match(), and _hm_report_update_arrows().
|
static |
Definition at line 466 of file history_merge_gui.c.
References _hm_label_t::iop_order.
Referenced by _hm_collect_labels_from_history_map().
|
static |
Definition at line 522 of file history_merge_gui.c.
References _hm_id_to_op_name(), dt_iop_get_module_by_instance_name(), dt_iop_get_module_by_op_priority(), dt_develop_t::iop, IS_NULL_PTR, and name.
Referenced by _hm_report_build_desired_visible_order(), and _hm_report_update_dest_labels().
|
static |
Definition at line 61 of file history_merge_gui.c.
References _hm_clean_module_name(), dt_free, IS_NULL_PTR, dt_iop_module_t::multi_name, name, and out.
Referenced by _hm_warn_missing_raster_producers().
|
static |
Definition at line 338 of file history_merge_gui.c.
References _hm_clean_module_name(), dt_free, dt_iop_module_t::iop_order, dt_iop_module_t::multi_name, name, and out.
Referenced by _hm_collect_labels_from_history_map(), _hm_report_dest_label(), and _hm_show_merge_report_popup().
|
static |
Definition at line 535 of file history_merge_gui.c.
References _hm_make_node_id(), dt_free, dt_iop_module_t::enabled, FALSE, IOP_FLAGS_NO_HISTORY_STACK, IS_NULL_PTR, dt_iop_module_t::multi_name, dt_iop_module_t::op, and TRUE.
Referenced by _hm_collect_enabled_modules_gui_order(), _hm_report_build_moved_set(), and _hm_report_build_ordered_modules().
|
static |
Definition at line 74 of file history_merge_gui.c.
References _hm_id_to_op_name(), IS_NULL_PTR, and name.
Referenced by _hm_pretty_id_from_id_ht().
|
static |
Definition at line 86 of file history_merge_gui.c.
References _hm_clean_module_name(), _hm_pretty_id(), _hm_id_info_t::dst_iop, dt_free, IS_NULL_PTR, _hm_id_info_t::mod_list, dt_iop_module_t::multi_name, name, out, and _hm_id_info_t::src_iop.
Referenced by _hm_ask_user_constraints_choice(), and _hm_cycle_node_label().
|
static |
Align the drag hint with the destination column once GTK knows column widths.
The hint is packed after the legend in the same horizontal footer, so the margin is the start of the destination column minus the current legend width.
Definition at line 1266 of file history_merge_gui.c.
References dt_hm_drag_hint_align_t::arrow_column, dt_hm_drag_hint_align_t::filet_column, dt_hm_drag_hint_align_t::hint, dt_hm_drag_hint_align_t::legend, MAX, dt_hm_drag_hint_align_t::orig_column, and dt_hm_drag_hint_align_t::src_column.
Referenced by _hm_show_merge_report_popup().
|
static |
Definition at line 996 of file history_merge_gui.c.
References _hm_report_apply_visible_order(), _hm_report_build_desired_visible_order(), _hm_report_keep_input_row_at_bottom(), _hm_report_resync_history_iop_order(), _hm_report_update_arrows(), _hm_report_update_dest_labels(), _hm_report_update_move_styles(), _hm_report_reorder_ctx_t::dev_dest, _hm_report_reorder_ctx_t::dev_src, _hm_report_reorder_ctx_t::dst_last_before_by_id, _hm_report_reorder_ctx_t::dst_last_by_id, FALSE, _hm_report_reorder_ctx_t::in_reorder, _hm_report_reorder_ctx_t::mod_list_ids, _hm_report_reorder_ctx_t::orig_ids, _hm_report_reorder_ctx_t::override, _hm_report_reorder_ctx_t::store, and TRUE.
Referenced by _hm_report_drag_data_received().
|
static |
Definition at line 701 of file history_merge_gui.c.
References _hm_report_build_ordered_modules(), dt_ioppr_rebuild_iop_order_from_modules(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _hm_report_apply_store_order().
|
static |
Definition at line 630 of file history_merge_gui.c.
References _hm_module_from_id(), _hm_report_collect_dest_ids(), DT_DEBUG_HISTORY, dt_print(), i, model, and TRUE.
Referenced by _hm_report_apply_store_order().
|
static |
Definition at line 714 of file history_merge_gui.c.
References _hm_make_node_id(), _hm_module_visible_in_report(), _hm_report_collect_dest_ids(), dt_free, dt_free_gpointer(), FALSE, i, dt_develop_t::iop, IS_NULL_PTR, model, dt_iop_module_t::multi_name, dt_iop_module_t::op, and TRUE.
Referenced by _hm_report_update_move_styles().
|
static |
Definition at line 659 of file history_merge_gui.c.
References _hm_module_visible_in_report(), DT_DEBUG_HISTORY, dt_print(), dt_develop_t::iop, and IS_NULL_PTR.
Referenced by _hm_report_apply_visible_order().
|
static |
Definition at line 606 of file history_merge_gui.c.
References dt_free, FALSE, HM_REPORT_COL_DST_ID, HM_REPORT_COL_IS_INPUT, and model.
Referenced by _hm_report_build_desired_visible_order(), and _hm_report_build_moved_set().
|
static |
Definition at line 548 of file history_merge_gui.c.
References _hm_make_node_id(), _hm_module_row_label(), dt_free, dt_iop_module_needs_mask_history(), IS_NULL_PTR, dt_iop_module_t::multi_name, and dt_iop_module_t::op.
Referenced by _hm_report_update_dest_labels(), and _hm_show_merge_report_popup().
|
static |
Definition at line 1017 of file history_merge_gui.c.
References _hm_report_reorder_ctx_t::drag_path.
Referenced by _hm_show_merge_report_popup().
|
static |
Definition at line 1032 of file history_merge_gui.c.
References _hm_report_reorder_ctx_t::drag_path, dt_free, FALSE, HM_REPORT_COL_DST_ID, HM_REPORT_COL_IS_INPUT, IS_NULL_PTR, and _hm_report_reorder_ctx_t::store.
Referenced by _hm_show_merge_report_popup().
|
static |
Definition at line 1070 of file history_merge_gui.c.
References _hm_report_apply_store_order(), dt_free, FALSE, HM_REPORT_COL_DST_ID, HM_REPORT_COL_IS_INPUT, i, IS_NULL_PTR, row, _hm_report_reorder_ctx_t::store, TRUE, and x.
Referenced by _hm_show_merge_report_popup().
|
static |
Definition at line 928 of file history_merge_gui.c.
References FALSE, HM_REPORT_COL_IS_INPUT, and store.
Referenced by _hm_report_apply_store_order().
|
static |
Definition at line 595 of file history_merge_gui.c.
References dt_develop_t::history, and dt_dev_history_item_t::iop_order.
Referenced by _hm_report_apply_store_order().
|
static |
Definition at line 838 of file history_merge_gui.c.
References _hm_history_masks_match(), delta, dt_free, dt_free_gpointer(), dt_iop_module_needs_mask_history(), FALSE, HM_REPORT_COL_ARROW, HM_REPORT_COL_DST_ID, HM_REPORT_COL_IS_INPUT, HM_REPORT_COL_SRC_ID, IS_NULL_PTR, row, and store.
Referenced by _hm_report_apply_store_order(), and _hm_show_merge_report_popup().
|
static |
Definition at line 956 of file history_merge_gui.c.
References _hm_module_from_id(), _hm_report_dest_label(), dt_free, dt_iop_module_needs_mask_history(), dt_iop_module_t::enabled, FALSE, HM_REPORT_COL_DST, HM_REPORT_COL_DST_FG, HM_REPORT_COL_DST_FG_SET, HM_REPORT_COL_DST_ID, HM_REPORT_COL_DST_STYLE, HM_REPORT_COL_IS_INPUT, HM_REPORT_DISABLED_FG, HM_REPORT_EXISTING_DST_FG, IS_NULL_PTR, and store.
Referenced by _hm_report_apply_store_order().
|
static |
Definition at line 803 of file history_merge_gui.c.
References _hm_report_build_moved_set(), dt_free, FALSE, HM_REPORT_COL_DST_DISABLED, HM_REPORT_COL_DST_FG, HM_REPORT_COL_DST_FG_SET, HM_REPORT_COL_DST_ID, HM_REPORT_COL_DST_STYLE, HM_REPORT_COL_DST_WEIGHT, HM_REPORT_COL_IS_INPUT, HM_REPORT_COL_SRC_ID, HM_REPORT_COL_SRC_WEIGHT, and store.
Referenced by _hm_report_apply_store_order(), and _hm_show_merge_report_popup().
| gboolean _hm_show_merge_report_popup | ( | dt_develop_t * | dev_dest, |
| dt_develop_t * | dev_src, | ||
| const gboolean | merge_iop_order, | ||
| const gboolean | used_source_order, | ||
| const dt_history_merge_strategy_t | strategy, | ||
| GHashTable * | src_last_by_id, | ||
| GHashTable * | dst_last_before_by_id, | ||
| const GHashTable * | orig_ids, | ||
| const GHashTable * | mod_list_ids, | ||
| const char * | source_label, | ||
| dt_hm_batch_state_t * | batch | ||
| ) |
Definition at line 1281 of file history_merge_gui.c.
References _hm_build_last_history_by_id(), _hm_build_override_map(), _hm_collect_enabled_modules_gui_order(), _hm_collect_labels_from_history_map(), _hm_make_node_id(), _hm_module_row_label(), _hm_report_align_drag_hint(), _hm_report_dest_label(), _hm_report_drag_begin(), _hm_report_drag_data_get(), _hm_report_drag_data_received(), _hm_report_update_arrows(), _hm_report_update_move_styles(), dt_hm_drag_hint_align_t::arrow_column, dt_hm_batch_state_t::decision, _hm_report_reorder_ctx_t::dev_dest, _hm_report_reorder_ctx_t::dev_src, _hm_report_reorder_ctx_t::drag_path, _hm_report_reorder_ctx_t::dst_last_before_by_id, _hm_report_reorder_ctx_t::dst_last_by_id, dt_free, dt_gui_add_class(), dt_gui_get_global(), dt_gui_main_window(), dt_gui_refocus_parent(), DT_HISTORY_MERGE_APPEND, DT_HISTORY_MERGE_PREPEND, DT_HM_BATCH_ACCEPT, DT_HM_BATCH_REVERT, dt_iop_module_needs_mask_history(), DT_PIXEL_APPLY_DPI, dt_iop_module_t::enabled, FALSE, dt_image_t::filename, dt_hm_drag_hint_align_t::filet_column, dt_hm_drag_hint_align_t::hint, HM_REPORT_COL_ARROW, HM_REPORT_COL_COUNT, HM_REPORT_COL_DST, HM_REPORT_COL_DST_DISABLED, HM_REPORT_COL_DST_FG, HM_REPORT_COL_DST_FG_SET, HM_REPORT_COL_DST_ID, HM_REPORT_COL_DST_STYLE, HM_REPORT_COL_DST_WEIGHT, HM_REPORT_COL_FILET, HM_REPORT_COL_IS_INPUT, HM_REPORT_COL_ORIG, HM_REPORT_COL_ORIG_FG, HM_REPORT_COL_ORIG_FG_SET, HM_REPORT_COL_SRC, HM_REPORT_COL_SRC_FG, HM_REPORT_COL_SRC_FG_SET, HM_REPORT_COL_SRC_ID, HM_REPORT_COL_SRC_WEIGHT, HM_REPORT_DISABLED_FG, HM_REPORT_EXISTING_DST_FG, dt_image_t::id, dt_develop_t::image_storage, IS_NULL_PTR, dt_hm_drag_hint_align_t::legend, MAX, _hm_report_reorder_ctx_t::mod_list_ids, dt_iop_module_t::multi_name, dt_iop_module_t::op, dt_hm_drag_hint_align_t::orig_column, _hm_report_reorder_ctx_t::orig_ids, _hm_report_reorder_ctx_t::override, r, res, row, scrolled(), dt_hm_drag_hint_align_t::src_column, store, _hm_report_reorder_ctx_t::store, TRUE, and window.
Referenced by dt_history_merge_gui_register_handlers().
| void _hm_show_toposort_cycle_popup | ( | GList * | cycle_nodes, |
| GHashTable * | id_ht | ||
| ) |
Definition at line 268 of file history_merge_gui.c.
References _hm_append_cycle_label(), _hm_cycle_node_label(), dt_free, dt_gui_get_global(), dt_gui_main_window(), dt_gui_refocus_parent(), FALSE, i, IS_NULL_PTR, n, TRUE, and window.
Referenced by dt_history_merge_gui_register_handlers().
| gboolean _hm_warn_missing_raster_producers | ( | const GList * | mod_list | ) |
Definition at line 189 of file history_merge_gui.c.
References _hm_module_label_short(), dt_free, dt_gui_get_global(), dt_gui_main_window(), dt_gui_refocus_parent(), FALSE, IS_NULL_PTR, dt_iop_module_t::raster_mask, res, dt_iop_module_t::sink, dt_iop_module_t::source, TRUE, and window.
Referenced by dt_history_merge_gui_register_handlers().
| gboolean dt_gui_merge_options_dialog | ( | const char * | title, |
| const char * | mode_key, | ||
| const char * | iop_order_key, | ||
| const char * | ask_key, | ||
| gboolean | iop_order_available | ||
| ) |
Show a modal dialog to pick merge mode and pipeline order before a paste or style apply.
Reads the current saved settings from mode_key and iop_order_key, lets the user adjust them, and writes back on OK. Returns TRUE when the user confirmed (proceed), FALSE when they cancelled (abort the operation).
| title | Window title string (already translated). |
| mode_key | Conf key for the dt_history_merge_strategy_t value (int). |
| iop_order_key | Conf key for the "use incoming pipeline order" boolean. |
| ask_key | Conf key for the "show this dialog next time" boolean. |
| iop_order_available | Whether the source has a stored pipeline order to offer. When FALSE the pipeline-order checkbox is disabled. |
Definition at line 1659 of file history_merge_gui.c.
References dt_conf_get_bool(), dt_conf_get_int(), dt_conf_set_bool(), dt_conf_set_int(), dt_gui_get_global(), dt_gui_main_window(), dt_gui_refocus_parent(), DT_HISTORY_MERGE_APPEND, DT_HISTORY_MERGE_PREPEND, DT_HISTORY_MERGE_REPLACE, FALSE, IS_NULL_PTR, res, TRUE, and window.
Referenced by _styles_apply_callback(), paste_all_callback(), and paste_parts_callback().
Register the four handlers develop/history_merge.c asks through. Called from dt_gui_gtk_init(); without it merging simply takes its no-handler defaults.
Definition at line 1772 of file history_merge_gui.c.
References _hm_ask_user_constraints_choice(), _hm_show_merge_report_popup(), _hm_show_toposort_cycle_popup(), _hm_warn_missing_raster_producers(), dt_hm_set_constraints_choice_handler(), dt_hm_set_merge_report_handler(), dt_hm_set_missing_raster_handler(), and dt_hm_set_toposort_cycle_handler().
Referenced by dt_gui_gtk_init().
|
static |
Definition at line 432 of file history_merge_gui.c.
Referenced by _hm_report_update_dest_labels(), and _hm_show_merge_report_popup().
|
static |
Definition at line 433 of file history_merge_gui.c.
Referenced by _hm_report_update_dest_labels(), and _hm_show_merge_report_popup().