Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
history.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2009-2011 johannes hanika.
4 Copyright (C) 2010 Henrik Andersson.
5 Copyright (C) 2011, 2014-2016 Tobias Ellinghaus.
6 Copyright (C) 2012 Frédéric Grollier.
7 Copyright (C) 2012, 2019-2022 Pascal Obry.
8 Copyright (C) 2012 Richard Wonka.
9 Copyright (C) 2016 Roman Lebedev.
10 Copyright (C) 2018 Edgardo Hoszowski.
11 Copyright (C) 2019-2020 Aldric Renaudin.
12 Copyright (C) 2019, 2022 Hanno Schwalm.
13 Copyright (C) 2020 Chris Elston.
14 Copyright (C) 2020-2021 Hubert Kowalski.
15 Copyright (C) 2020 Philippe Weyland.
16 Copyright (C) 2022 Martin Bařinka.
17 Copyright (C) 2025 Alynx Zhou.
18 Copyright (C) 2025-2026 Aurélien PIERRE.
19
20 darktable is free software: you can redistribute it and/or modify
21 it under the terms of the GNU General Public License as published by
22 the Free Software Foundation, either version 3 of the License, or
23 (at your option) any later version.
24
25 darktable is distributed in the hope that it will be useful,
26 but WITHOUT ANY WARRANTY; without even the implied warranty of
27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 GNU General Public License for more details.
29
30 You should have received a copy of the GNU General Public License
31 along with darktable. If not, see <http://www.gnu.org/licenses/>.
32*/
33
34#pragma once
35
36#include <gtk/gtk.h>
37#include <inttypes.h>
38#include <sqlite3.h>
39
41#include "common/image_cache.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
53
55void dt_history_item_free(gpointer data);
56
58void dt_history_delete_on_image(int32_t imgid);
59
61void dt_history_delete_on_image_ext(int32_t imgid, gboolean undo);
62
64int32_t dt_history_get_end(const int32_t imgid);
65
67gboolean dt_history_set_end(const int32_t imgid, const int32_t history_end);
68
70typedef void (*dt_history_db_row_cb)(void *user_data,
71 const int32_t imgid,
72 const int num,
73 const int module_version,
74 const char *operation,
75 const void *op_params,
76 const int op_params_len,
77 const gboolean enabled,
78 const void *blendop_params,
79 const int blendop_params_len,
80 const int blendop_version,
81 const int multi_priority,
82 const char *multi_name,
83 const char *preset_name);
84
85void dt_history_db_foreach_history_row(const int32_t imgid, dt_history_db_row_cb cb, void *user_data);
86void dt_history_db_foreach_auto_preset_row(const int32_t imgid, const struct dt_image_t *image, const char *workflow_preset,
87 const int iformat, const int excluded, dt_history_db_row_cb cb, void *user_data);
88gboolean dt_history_db_get_autoapply_ioporder_params(const int32_t imgid, const struct dt_image_t *image,
89 const int iformat, const int excluded, void **params,
90 int32_t *params_len);
91int32_t dt_history_db_get_next_history_num(const int32_t imgid);
92gboolean dt_history_db_delete_history(const int32_t imgid);
93gboolean dt_history_db_delete_masks_history(const int32_t imgid);
94gboolean dt_history_db_delete_dev_history(const int32_t imgid);
95gboolean dt_history_db_shift_history_nums(const int32_t imgid, const int delta);
96gboolean dt_history_db_write_history_item(const int32_t imgid, const int num, const char *operation, const void *op_params,
97 const int op_params_size, const int module_version, const int enabled,
98 const void *blendop_params, const int blendop_params_size,
99 const int blendop_version, const int multi_priority, const char *multi_name);
100
101/* duplicate an history list */
102GList *dt_history_duplicate(GList *hist);
103
104
105
106typedef struct dt_history_item_t
107{
108 guint num;
109 gchar *op;
110 gchar *name;
111 gboolean enabled;
113
115GList *dt_history_get_items(int32_t imgid, gboolean enabled);
116
118char *dt_history_get_items_as_string(int32_t imgid);
119
121char *dt_history_item_as_string(const char *name, gboolean enabled);
122
123/* check if a module exists in the history of corresponding image */
124gboolean dt_history_check_module_exists(int32_t imgid, const char *operation, gboolean enabled);
126void dt_history_cleanup(void);
127
129void dt_history_hash_set_mipmap(const int32_t imgid, const uint64_t history_hash,
130 const dt_image_cache_write_mode_t mode);
131
132#ifdef __cplusplus
133}
134#endif
135
136// clang-format off
137// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
138// vim: shiftwidth=2 expandtab tabstop=2 cindent
139// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
140// clang-format on
const float delta
Definition colorspaces_inline_conversions.h:722
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
char * name
Definition common/metadata.c:61
void(* dt_history_db_row_cb)(void *user_data, const int32_t imgid, const int num, const int module_version, const char *operation, const void *op_params, const int op_params_len, const gboolean enabled, const void *blendop_params, const int blendop_params_len, const int blendop_version, const int multi_priority, const char *multi_name, const char *preset_name)
Definition history.h:70
char * dt_history_item_as_string(const char *name, gboolean enabled)
Definition common/history.c:192
gboolean dt_history_db_write_history_item(const int32_t imgid, const int num, const char *operation, const void *op_params, const int op_params_size, const int module_version, const int enabled, const void *blendop_params, const int blendop_params_size, const int blendop_version, const int multi_priority, const char *multi_name)
gboolean dt_history_check_module_exists(int32_t imgid, const char *operation, gboolean enabled)
Definition common/history.c:289
void dt_history_hash_set_mipmap(const int32_t imgid, const uint64_t history_hash, const dt_image_cache_write_mode_t mode)
Definition common/history.c:792
gboolean dt_history_set_end(const int32_t imgid, const int32_t history_end)
Definition common/history.c:423
gboolean dt_history_db_shift_history_nums(const int32_t imgid, const int delta)
Definition common/history.c:509
GList * dt_history_duplicate(GList *hist)
Deep-copy a history list.
Definition dev_history.c:450
int32_t dt_history_db_get_next_history_num(const int32_t imgid)
Definition common/history.c:445
gboolean dt_history_db_get_autoapply_ioporder_params(const int32_t imgid, const struct dt_image_t *image, const int iformat, const int excluded, void **params, int32_t *params_len)
gboolean dt_history_db_delete_masks_history(const int32_t imgid)
Definition common/history.c:490
void dt_history_cleanup(void)
Definition common/history.c:317
char * dt_history_get_items_as_string(int32_t imgid)
Definition common/history.c:247
int32_t dt_history_get_end(const int32_t imgid)
Definition common/history.c:399
void dt_history_delete_on_image_ext(int32_t imgid, gboolean undo)
Definition common/history.c:112
gboolean dt_history_db_delete_dev_history(const int32_t imgid)
Definition common/history.c:531
void dt_history_db_foreach_auto_preset_row(const int32_t imgid, const struct dt_image_t *image, const char *workflow_preset, const int iformat, const int excluded, dt_history_db_row_cb cb, void *user_data)
void dt_history_delete_on_image(int32_t imgid)
Definition common/history.c:186
GList * dt_history_get_items(int32_t imgid, gboolean enabled)
Definition common/history.c:197
void dt_history_item_free(gpointer data)
Definition common/history.c:91
gboolean dt_history_db_delete_history(const int32_t imgid)
Definition common/history.c:471
void dt_history_db_foreach_history_row(const int32_t imgid, dt_history_db_row_cb cb, void *user_data)
Definition common/history.c:603
dt_image_cache_write_mode_t
Definition image_cache.h:47
unsigned __int64 uint64_t
Definition strptime.c:74
Definition history.h:48
GtkTreeView * items
Definition history.h:50
GList * selops
Definition history.h:49
int copied_imageid
Definition history.h:51
Definition history.h:107
guint num
Definition history.h:108
gchar * op
Definition history.h:109
gchar * name
Definition history.h:110
gboolean enabled
Definition history.h:111
Definition common/image.h:247