![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <glib.h>#include <inttypes.h>
Include dependency graph for history_merge.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_hm_batch_state_t |
Typedefs | |
| typedef enum dt_history_merge_strategy_t | dt_history_merge_strategy_t |
| typedef enum dt_hm_batch_decision_t | dt_hm_batch_decision_t |
| typedef struct dt_hm_batch_state_t | dt_hm_batch_state_t |
| typedef enum dt_hm_constraint_choice_t | dt_hm_constraint_choice_t |
| typedef dt_hm_constraint_choice_t(* | dt_hm_constraints_choice_handler_t) (GHashTable *id_ht, const char *faulty_id, const char *src_prev, const char *src_next, const char *dst_prev, const char *dst_next) |
| typedef gboolean(* | dt_hm_missing_raster_handler_t) (const GList *mod_list) |
| typedef void(* | dt_hm_toposort_cycle_handler_t) (GList *cycle_nodes, GHashTable *id_ht) |
| typedef gboolean(* | dt_hm_merge_report_handler_t) (struct dt_develop_t *dev_dest, struct 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) |
Enumerations | |
| enum | dt_history_merge_strategy_t { DT_HISTORY_MERGE_PREPEND = 0 , DT_HISTORY_MERGE_APPEND = 1 , DT_HISTORY_MERGE_REPLACE = 2 } |
| enum | dt_hm_batch_decision_t { DT_HM_BATCH_UNDECIDED = 0 , DT_HM_BATCH_ACCEPT , DT_HM_BATCH_REVERT } |
| enum | dt_hm_constraint_choice_t { DT_HM_CONSTRAINTS_PREFER_DEST = 0 , DT_HM_CONSTRAINTS_PREFER_SRC = 1 } |
Functions | |
| void | dt_hm_batch_state_cleanup (dt_hm_batch_state_t *batch) |
| Release resources held by a batch state (the cached order). Safe to call on a zeroed state. | |
| int | dt_history_merge (struct dt_develop_t *dev_dest, struct dt_develop_t *dev_src, const int32_t dest_imgid, const GList *mod_list, const gboolean merge_iop_order, const dt_history_merge_strategy_t strategy, const gboolean force_new_modules, const char *source_label, dt_hm_batch_state_t *batch) |
| Merge a list of modules into a destination image, solving pipeline topologies for proper insertion of source modules. | |
| char * | _hm_make_node_id (const char *op, const char *multi_name) |
| void | _hm_id_to_op_name (const char *id, char *op, char *name) |
| int | _hm_build_last_history_by_id (const struct dt_develop_t *dev, GHashTable **out_map) |
| void | dt_hm_set_constraints_choice_handler (dt_hm_constraints_choice_handler_t handler) |
| void | dt_hm_set_missing_raster_handler (dt_hm_missing_raster_handler_t handler) |
| void | dt_hm_set_toposort_cycle_handler (dt_hm_toposort_cycle_handler_t handler) |
| void | dt_hm_set_merge_report_handler (dt_hm_merge_report_handler_t handler) |
| typedef enum dt_history_merge_strategy_t dt_history_merge_strategy_t |
| typedef enum dt_hm_batch_decision_t dt_hm_batch_decision_t |
| typedef struct dt_hm_batch_state_t dt_hm_batch_state_t |
| typedef enum dt_hm_constraint_choice_t dt_hm_constraint_choice_t |
| typedef dt_hm_constraint_choice_t(* dt_hm_constraints_choice_handler_t) (GHashTable *id_ht, const char *faulty_id, const char *src_prev, const char *src_next, const char *dst_prev, const char *dst_next) |
Break an incompatible 2-cycle by keeping either the destination's or the source's adjacency constraints. With no handler: PREFER_DEST. The destination image's existing pipeline order is the thing a merge nobody is watching must not quietly rearrange.
Definition at line 117 of file history_merge.h.
| typedef gboolean(* dt_hm_merge_report_handler_t) (struct dt_develop_t *dev_dest, struct 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) |
Show what the merge did and offer to revert it; return TRUE to revert. With no handler: FALSE. A merge that completed is kept.
Definition at line 131 of file history_merge.h.
| typedef gboolean(* dt_hm_missing_raster_handler_t) (const GList *mod_list) |
Warn that pasted modules reference raster mask providers not coming with them; return FALSE to abort. With no handler: proceed. The modules land without their raster source, which is what the warning is about – not grounds to refuse work nobody can confirm.
Definition at line 124 of file history_merge.h.
| typedef void(* dt_hm_toposort_cycle_handler_t) (GList *cycle_nodes, GHashTable *id_ht) |
Report that the module graph could not be topologically sorted. Informational.
Definition at line 127 of file history_merge.h.
| Enumerator | |
|---|---|
| DT_HISTORY_MERGE_PREPEND | |
| DT_HISTORY_MERGE_APPEND | |
| DT_HISTORY_MERGE_REPLACE | |
Definition at line 33 of file history_merge.h.
| Enumerator | |
|---|---|
| DT_HM_BATCH_UNDECIDED | |
| DT_HM_BATCH_ACCEPT | |
| DT_HM_BATCH_REVERT | |
Definition at line 40 of file history_merge.h.
| Enumerator | |
|---|---|
| DT_HM_CONSTRAINTS_PREFER_DEST | |
| DT_HM_CONSTRAINTS_PREFER_SRC | |
Definition at line 97 of file history_merge.h.
| int _hm_build_last_history_by_id | ( | const struct dt_develop_t * | dev, |
| GHashTable ** | out_map | ||
| ) |
| void _hm_id_to_op_name | ( | const char * | id, |
| char * | op, | ||
| char * | name | ||
| ) |
Definition at line 209 of file history_merge.c.
References IS_NULL_PTR, MIN, and name.
Referenced by _hm_dest_module_from_id(), _hm_module_from_id(), _hm_pretty_id(), and _hm_topo_apply_solution().
| char * _hm_make_node_id | ( | const char * | op, |
| const char * | multi_name | ||
| ) |
Definition at line 156 of file history_merge.c.
Referenced by _hm_build_id_set_from_mod_list(), _hm_build_isolated_nodes_from_modules(), _hm_build_last_history_by_id(), _hm_build_last_history_by_id_from_history(), _hm_build_override_map(), _hm_build_raster_mask_nodes_from_modules(), _hm_cached_order_applicable(), _hm_capture_order_ids(), _hm_id_info_upsert(), _hm_ids_from_iop_list(), _hm_module_visible_in_report(), _hm_report_build_moved_set(), _hm_report_dest_label(), _hm_show_merge_report_popup(), and _hm_topo_build_constraint_ids().
| int dt_history_merge | ( | struct dt_develop_t * | dev_dest, |
| struct dt_develop_t * | dev_src, | ||
| const int32_t | dest_imgid, | ||
| const GList * | mod_list, | ||
| const gboolean | merge_iop_order, | ||
| const dt_history_merge_strategy_t | strategy, | ||
| const gboolean | force_new_modules, | ||
| const char * | source_label, | ||
| dt_hm_batch_state_t * | batch | ||
| ) |
Merge a list of modules into a destination image, solving pipeline topologies for proper insertion of source modules.
| dev_dest | Destination develop stack (must be initialized, history read and popped). |
| dev_src | Source develop stack (must be initialized, history read and popped). May be NULL if merge_iop_order is FALSE (masks won't be copied). |
| dest_imgid | Destination image id. |
| mod_list | List of dt_iop_module_t* to merge (usually coming from dev_src). |
| merge_iop_order | If TRUE, attempt to merge the pipeline order constraints from src and dest using a topological sort. On unsatisfiable constraints, falls back to overwriting the destination iop-order list with the source list. |
| strategy | DT_HISTORY_MERGE_APPEND or DT_HISTORY_MERGE_PREPEND. |
| force_new_modules | If TRUE, always add modules from source as new instances (when possible). |
| source_label | Optional source label for the report header (style name, for example). |
Definition at line 1739 of file history_merge.c.
References _hm_apply_cached_order(), _hm_backup_cleanup(), _hm_backup_dest(), _hm_build_id_set_from_mod_list(), _hm_build_last_history_by_id(), _hm_cached_order_applicable(), _hm_capture_order_ids(), _hm_confirm_missing_raster(), _hm_failure_message(), _hm_renumber_history(), _hm_report_merge(), _hm_restore_dest_from_backup(), _hm_truncate_dest_redo_tail(), _hm_try_merge_iop_order_topologically(), cleanup(), dt_hm_batch_state_t::decision, DT_DEBUG_HISTORY, DT_DEBUG_VERBOSE, dt_dev_get_history_end_ext(), dt_dev_get_module_instance(), dt_dev_history_get_last_item_by_module(), dt_dev_history_item_from_source_history_item(), dt_dev_set_history_end_ext(), DT_HISTORY_MERGE_APPEND, dt_history_message(), DT_HM_BATCH_ACCEPT, DT_HM_BATCH_REVERT, dt_iop_get_module_by_op_priority(), dt_ioppr_resync_pipeline(), dt_print(), FALSE, dt_develop_t::history, dt_develop_t::iop, IOP_FLAGS_ONE_INSTANCE, IS_NULL_PTR, dt_iop_module_t::multi_name, dt_iop_module_t::multi_priority, dt_iop_module_t::op, dt_hm_batch_state_t::order_ids, and _hm_dest_backup_t::orig_ids.
Referenced by dt_dev_merge_history_into_image().
| void dt_hm_batch_state_cleanup | ( | dt_hm_batch_state_t * | batch | ) |
Release resources held by a batch state (the cached order). Safe to call on a zeroed state.
Definition at line 1607 of file history_merge.c.
References dt_free_gpointer(), IS_NULL_PTR, and dt_hm_batch_state_t::order_ids.
Referenced by _import_image(), _studio_style_apply_callback(), dt_history_paste_on_list(), dt_history_paste_parts_on_list(), dt_history_style_on_image(), and dt_history_style_on_list().
| void dt_hm_set_constraints_choice_handler | ( | dt_hm_constraints_choice_handler_t | handler | ) |
Definition at line 104 of file history_merge.c.
References _constraints_choice_handler.
Referenced by dt_history_merge_gui_register_handlers().
| void dt_hm_set_merge_report_handler | ( | dt_hm_merge_report_handler_t | handler | ) |
Definition at line 119 of file history_merge.c.
References _merge_report_handler.
Referenced by dt_history_merge_gui_register_handlers().
| void dt_hm_set_missing_raster_handler | ( | dt_hm_missing_raster_handler_t | handler | ) |
Definition at line 109 of file history_merge.c.
References _missing_raster_handler.
Referenced by dt_history_merge_gui_register_handlers().
| void dt_hm_set_toposort_cycle_handler | ( | dt_hm_toposort_cycle_handler_t | handler | ) |
Definition at line 114 of file history_merge.c.
References _toposort_cycle_handler.
Referenced by dt_history_merge_gui_register_handlers().