Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
history.h File Reference
#include <gtk/gtk.h>
#include <inttypes.h>
+ Include dependency graph for history.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dt_history_copy_item_t
 
struct  dt_history_item_t
 

Typedefs

typedef char dt_dev_operation_t[20]
 The string identifying an operation in the history stack ("exposure", "colorbalancergb", ...): the identity every history item, preset row and raster-mask source reference is keyed on.
 
typedef struct dt_history_copy_item_t dt_history_copy_item_t
 
typedef struct dt_history_item_t dt_history_item_t
 
typedef const char *(* dt_history_operation_name_resolver_t) (const char *operation)
 Turns an operation string ("exposure", "colorbalancergb") into the name a user should read.
 

Functions

void dt_history_item_free (gpointer data)
 
void dt_history_delete_on_image (int32_t imgid)
 
void dt_history_delete_on_image_ext (int32_t imgid, gboolean undo)
 
GList * dt_history_get_items (int32_t imgid, gboolean enabled)
 
char * dt_history_get_items_as_string (int32_t imgid)
 
char * dt_history_item_as_string (const char *name, gboolean enabled)
 
void dt_history_set_operation_name_resolver (dt_history_operation_name_resolver_t resolver)
 
const char * dt_history_operation_name (const char *operation)
 Resolve operation through the installed resolver, or return it unchanged.
 

Typedef Documentation

◆ dt_dev_operation_t

typedef char dt_dev_operation_t[20]

The string identifying an operation in the history stack ("exposure", "colorbalancergb", ...): the identity every history item, preset row and raster-mask source reference is keyed on.

Lived in control/settings.h historically, which used it for nothing — while develop/imageop.h trailed control/signal.h into all 122 of its consumers just to reach this one typedef. It keeps the dt_dev_ prefix for now; renaming a symbol this widespread is its own change, not a relocation's.

Definition at line 50 of file history.h.

◆ dt_history_copy_item_t

◆ dt_history_item_t

◆ dt_history_operation_name_resolver_t

typedef const char *(* dt_history_operation_name_resolver_t) (const char *operation)

Turns an operation string ("exposure", "colorbalancergb") into the name a user should read.

Only the side of the application that loaded the modules can answer: the mapping is built from the module list, and the names come from each module's own translation. That is dt_iop_get_localized_name(), in develop/imageop.c – layer 5, and the single reason this file reached out of layer 1 at all, for three calls that do nothing but label a history line.

With no resolver installed the answer is the operation string itself: legible, if untranslated. dt_init() installs one before anything reads history, and ansel-cli loads the module list too, so the fallback is for unit tests.

Definition at line 109 of file history.h.

Function Documentation

◆ dt_history_delete_on_image()

void dt_history_delete_on_image ( int32_t  imgid)

delete all history for the given image

Definition at line 130 of file history/history.c.

References DT_HISTORY_CHANGE_TAGS, dt_history_changed(), dt_history_delete_on_image_ext(), and TRUE.

Referenced by dt_control_duplicate_images_job_run().

◆ dt_history_delete_on_image_ext()

◆ dt_history_get_items()

GList * dt_history_get_items ( int32_t  imgid,
gboolean  enabled 
)

get list of history items for image

Definition at line 163 of file history/history.c.

References _collect_item(), dt_history_repository_foreach_last_item(), and enabled.

Referenced by _gui_styles_dialog_run(), and dt_gui_hist_dialog_new().

◆ dt_history_get_items_as_string()

char * dt_history_get_items_as_string ( int32_t  imgid)

get list of history items for image as a nice string

Definition at line 190 of file history/history.c.

References _collect_item_string(), dt_free_gpointer(), dt_history_repository_foreach_item(), dt_util_glist_to_str(), and items.

Referenced by _altered_enter(), and main().

◆ dt_history_item_as_string()

char * dt_history_item_as_string ( const char *  name,
gboolean  enabled 
)

get a single history item as string with enabled status

Definition at line 136 of file history/history.c.

References enabled, and name.

Referenced by _collect_item_string().

◆ dt_history_item_free()

void dt_history_item_free ( gpointer  data)

helper function to free a GList of dt_history_item_t

Definition at line 73 of file history/history.c.

References dt_free, dt_history_item_t::name, and dt_history_item_t::op.

Referenced by _gui_styles_dialog_run(), and dt_gui_hist_dialog_new().

◆ dt_history_operation_name()

const char * dt_history_operation_name ( const char *  operation)

Resolve operation through the installed resolver, or return it unchanged.

Definition at line 66 of file history/history.c.

References _operation_name_resolver.

Referenced by _collect_item(), and _collect_item_string().

◆ dt_history_set_operation_name_resolver()

void dt_history_set_operation_name_resolver ( dt_history_operation_name_resolver_t  resolver)

Definition at line 61 of file history/history.c.

References _operation_name_resolver.

Referenced by dt_init().