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) 2010-2022 darktable developers.
4
5 darktable 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 darktable 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 darktable. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21#include <gtk/gtk.h>
22#include <inttypes.h>
23#include <sqlite3.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29// history hash is designed to detect any change made on the image
30// if current = basic the image has only the mandatory modules with their original settings
31// if current = auto the image has the mandatory and auto applied modules with their original settings
32// else the image has been changed in some way
33// note that if an image has no history (and no history hash) it is considered as basic
35{
36 DT_HISTORY_HASH_BASIC = 1 << 0, // only mandatory modules
37 DT_HISTORY_HASH_AUTO = 1 << 1, // mandatory modules plus the auto applied ones
38 DT_HISTORY_HASH_CURRENT = 1 << 2, // current state, with or without change
39 DT_HISTORY_HASH_MIPMAP = 1 << 3, // last mipmap hash
41
51
60
62void dt_history_item_free(gpointer data);
63
65void dt_history_delete_on_image(int32_t imgid);
66
68void dt_history_delete_on_image_ext(int32_t imgid, gboolean undo);
69
71gboolean dt_history_copy(int32_t imgid);
72gboolean dt_history_copy_parts(int32_t imgid);
73gboolean dt_history_paste_on_list(const GList *list, gboolean undo);
74gboolean dt_history_paste_parts_on_list(const GList *list, gboolean undo);
75
77int dt_history_load_and_apply_on_list(gchar *filename, const GList *list);
78
80int dt_history_load_and_apply(int32_t imgid, gchar *filename, int history_only);
81
83gboolean dt_history_delete_on_list(const GList *list, gboolean undo);
84
86int dt_history_compress_on_list(const GList *imgs);
87void dt_history_compress_on_image(const int32_t imgid);
88
90void dt_history_truncate_on_image(const int32_t imgid, const int32_t history_end);
91
92/* duplicate an history list */
93GList *dt_history_duplicate(GList *hist);
94
95
96
97typedef struct dt_history_item_t
98{
99 guint num;
100 gchar *op;
101 gchar *name;
102 gboolean enabled;
104
106GList *dt_history_get_items(int32_t imgid, gboolean enabled);
107
109char *dt_history_get_items_as_string(int32_t imgid);
110
112char *dt_history_item_as_string(const char *name, gboolean enabled);
113
114/* check if a module exists in the history of corresponding image */
115gboolean dt_history_check_module_exists(int32_t imgid, const char *operation, gboolean enabled);
116
118void dt_history_hash_write_from_history(const int32_t imgid, const dt_history_hash_t type);
119
121gboolean dt_history_hash_is_mipmap_synced(const int32_t imgid);
122
124void dt_history_hash_set_mipmap(const int32_t imgid);
125
127void dt_history_hash_write(const int32_t imgid, dt_history_hash_values_t *hash);
128
130void dt_history_hash_read(const int32_t imgid, dt_history_hash_values_t *hash);
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
int type
Definition common/metadata.c:42
char * name
Definition common/metadata.c:41
gboolean dt_history_paste_on_list(const GList *list, gboolean undo)
Definition common/history.c:942
gboolean dt_history_copy(int32_t imgid)
Definition common/history.c:912
void dt_history_hash_read(const int32_t imgid, dt_history_hash_values_t *hash)
Definition common/history.c:801
dt_history_hash_t
Definition history.h:35
@ DT_HISTORY_HASH_CURRENT
Definition history.h:38
@ DT_HISTORY_HASH_BASIC
Definition history.h:36
@ DT_HISTORY_HASH_AUTO
Definition history.h:37
@ DT_HISTORY_HASH_MIPMAP
Definition history.h:39
void dt_history_hash_set_mipmap(const int32_t imgid)
Definition common/history.c:864
void dt_history_hash_write(const int32_t imgid, dt_history_hash_values_t *hash)
Definition common/history.c:777
char * dt_history_item_as_string(const char *name, gboolean enabled)
Definition common/history.c:193
gboolean dt_history_check_module_exists(int32_t imgid, const char *operation, gboolean enabled)
Definition common/history.c:603
void dt_history_truncate_on_image(const int32_t imgid, const int32_t history_end)
Definition common/history.c:467
GList * dt_history_duplicate(GList *hist)
Definition dev_history.c:413
gboolean dt_history_delete_on_list(const GList *list, gboolean undo)
Definition common/history.c:999
int dt_history_load_and_apply(int32_t imgid, gchar *filename, int history_only)
Definition common/history.c:146
void dt_history_hash_write_from_history(const int32_t imgid, const dt_history_hash_t type)
Definition common/history.c:719
gboolean dt_history_paste_parts_on_list(const GList *list, gboolean undo)
Definition common/history.c:965
char * dt_history_get_items_as_string(int32_t imgid)
Definition common/history.c:248
void dt_history_delete_on_image_ext(int32_t imgid, gboolean undo)
Definition common/history.c:60
gboolean dt_history_hash_is_mipmap_synced(const int32_t imgid)
Definition common/history.c:841
void dt_history_delete_on_image(int32_t imgid)
Definition common/history.c:140
int dt_history_load_and_apply_on_list(gchar *filename, const GList *list)
Definition common/history.c:179
GList * dt_history_get_items(int32_t imgid, gboolean enabled)
Definition common/history.c:198
int dt_history_compress_on_list(const GList *imgs)
Definition common/history.c:522
gboolean dt_history_copy_parts(int32_t imgid)
Definition common/history.c:925
void dt_history_item_free(gpointer data)
Definition common/history.c:39
void dt_history_compress_on_image(const int32_t imgid)
Definition common/history.c:330
Definition history.h:53
GtkTreeView * items
Definition history.h:55
GList * selops
Definition history.h:54
gboolean copy_iop_order
Definition history.h:58
int copied_imageid
Definition history.h:56
gboolean full_copy
Definition history.h:57
Definition history.h:43
int auto_apply_len
Definition history.h:47
int basic_len
Definition history.h:45
guint8 * basic
Definition history.h:44
guint8 * auto_apply
Definition history.h:46
guint8 * current
Definition history.h:48
int current_len
Definition history.h:49
Definition history.h:98
guint num
Definition history.h:99
gchar * op
Definition history.h:100
gchar * name
Definition history.h:101
gboolean enabled
Definition history.h:102