Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
history_merge.h
Go to the documentation of this file.
1/*
2 This file is part of Ansel,
3 Copyright (C) 2026 Aurélien PIERRE.
4
5 Ansel is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Ansel is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Ansel. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21#include <glib.h>
22#include <inttypes.h>
23
24#ifdef __cplusplus
25extern "C"
26{
27#endif
28
29 struct dt_develop_t;
30 struct dt_iop_module_t;
31
33 {
34 DT_HISTORY_MERGE_PREPEND = 0, // source applied early in destination history (destination wins conflicts)
35 DT_HISTORY_MERGE_APPEND = 1, // source applied after destination (source wins conflicts)
36 DT_HISTORY_MERGE_REPLACE = 2 // entirely replace history and modules order
38
40 {
41 DT_HM_BATCH_UNDECIDED = 0, // show the report dialog for each image
42 DT_HM_BATCH_ACCEPT, // silently keep the merge result
43 DT_HM_BATCH_REVERT, // silently revert the merge
45
46 typedef struct dt_hm_batch_state_t
47 {
49 // Resolved destination module order (list of owned "op|multi_name" strings) captured from the first
50 // accepted image of a batch. When non-NULL, later images replay this order instead of re-solving it,
51 // so a single high-level decision (and any manual reorder done in the report) applies to the whole batch.
52 GList *order_ids;
54
59
78 int dt_history_merge(struct dt_develop_t *dev_dest, struct dt_develop_t *dev_src, const int32_t dest_imgid,
79 const GList *mod_list, const gboolean merge_iop_order,
80 const dt_history_merge_strategy_t strategy, const gboolean force_new_modules,
81 const char *source_label, dt_hm_batch_state_t *batch);
82
83#ifdef __cplusplus
84}
85#endif
86
87// clang-format off
88// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
89// vim: shiftwidth=2 expandtab tabstop=2 cindent
90// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
91// clang-format on
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...
dt_hm_batch_decision_t
@ DT_HM_BATCH_UNDECIDED
@ DT_HM_BATCH_ACCEPT
@ DT_HM_BATCH_REVERT
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.
dt_history_merge_strategy_t
@ DT_HISTORY_MERGE_REPLACE
@ DT_HISTORY_MERGE_PREPEND
@ DT_HISTORY_MERGE_APPEND
dt_hm_batch_decision_t decision