Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
history.c File Reference
#include "common/darktable.h"
#include "common/debug.h"
#include "common/styles.h"
#include "common/undo.h"
#include "control/conf.h"
#include "control/control.h"
#include "develop/develop.h"
#include "develop/masks.h"
#include "gui/gtk.h"
#include "gui/styles.h"
#include "libs/lib.h"
#include "libs/lib_api.h"
#include "common/history.h"
#include <complex.h>
+ Include dependency graph for libs/history.c:

Data Structures

struct  dt_undo_history_t
 
struct  dt_lib_history_t
 
struct  _cb_data
 

Macros

#define HIST_WIDGET_NUMBER   0
 
#define HIST_WIDGET_MODULE   1
 
#define HIST_WIDGET_STATUS   2
 
#define add_blend_history_change(field, format, label)
 
#define add_blend_history_change_enum(field, label, list)
 
#define add_history_change(field, format, label)
 
#define add_history_change_string(field, label)
 
#define add_history_change_boolean(field, label)
 

Typedefs

typedef struct dt_undo_history_t dt_undo_history_t
 
typedef struct dt_lib_history_t dt_lib_history_t
 

Functions

static void _lib_history_compress_clicked_callback (GtkButton *widget, gpointer user_data)
 
static gboolean _lib_history_compress_pressed_callback (GtkWidget *widget, GdkEventButton *e, gpointer user_data)
 
static gboolean _lib_history_button_clicked_callback (GtkWidget *widget, GdkEventButton *e, gpointer user_data)
 
static void _lib_history_create_style_button_clicked_callback (GtkWidget *widget, gpointer user_data)
 
static void _lib_history_will_change_callback (gpointer instance, GList *history, int history_end, GList *iop_order_list, gpointer user_data)
 
static void _lib_history_change_callback (gpointer instance, gpointer user_data)
 
static void _lib_history_module_remove_callback (gpointer instance, dt_iop_module_t *module, gpointer user_data)
 
const char * name (struct dt_lib_module_t *self)
 
const char ** views (dt_lib_module_t *self)
 
uint32_t container (dt_lib_module_t *self)
 
int position ()
 
void gui_init (dt_lib_module_t *self)
 
void gui_cleanup (dt_lib_module_t *self)
 
static GtkWidget * _lib_history_create_button (dt_lib_module_t *self, int num, const char *label, gboolean enabled, gboolean default_enabled, gboolean always_on, gboolean selected, gboolean deprecated)
 
static void _reset_module_instance (GList *hist, dt_iop_module_t *module, int multi_priority)
 
static void _undo_items_cb (gpointer user_data, dt_undo_type_t type, dt_undo_data_t data)
 
static void _history_invalidate_cb (gpointer user_data, dt_undo_type_t type, dt_undo_data_t item)
 
static void _add_module_expander (GList *iop_list, dt_iop_module_t *module)
 
static dt_dev_history_item_t_search_history_by_module (GList *history_list, dt_iop_module_t *module)
 
static int _check_deleted_instances (dt_develop_t *dev, GList **_iop_list, GList *history_list)
 
static void _reorder_gui_module_list (dt_develop_t *dev)
 
static int _rebuild_multi_priority (GList *history_list)
 
static int _create_deleted_modules (GList **_iop_list, GList *history_list)
 
static void _pop_undo (gpointer user_data, dt_undo_type_t type, dt_undo_data_t data, dt_undo_action_t action, GList **imgs)
 
static void _history_undo_data_free (gpointer data)
 
static gchar * _lib_history_change_text (dt_introspection_field_t *field, const char *d, gpointer params, gpointer oldpar)
 
static const dt_dev_history_item_t_find_previous_history_step (const dt_dev_history_item_t *hitem)
 
static gchar * _create_tooltip_text (const dt_dev_history_item_t *hitem)
 
static gboolean _changes_tooltip_callback (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip)
 
static void _lib_history_truncate (gboolean compress)
 
void gui_reset (dt_lib_module_t *self)
 

Macro Definition Documentation

◆ add_blend_history_change

#define add_blend_history_change (   field,
  format,
  label 
)
Value:
if((hitem->blend_params->field) != (old_blend->field)) \
{ \
gchar *full_format = g_strconcat("%s\t", format, "\t\u2192\t", format, NULL); \
change_parts[num_parts++] \
= g_strdup_printf(full_format, label, (old_blend->field), (hitem->blend_params->field)); \
g_free(full_format); \
}

◆ add_blend_history_change_enum

#define add_blend_history_change_enum (   field,
  label,
  list 
)
Value:
if((hitem->blend_params->field) != (old_blend->field)) \
{ \
const char *old_str = NULL, *new_str = NULL; \
for(const dt_develop_name_value_t *i = list; *i->name; i++) \
{ \
if(i->value == (old_blend->field)) old_str = i->name; \
if(i->value == (hitem->blend_params->field)) new_str = i->name; \
} \
\
change_parts[num_parts++] \
= (!old_str || !new_str) \
? g_strdup_printf("%s\t%d\t\u2192\t%d", label, old_blend->field, hitem->blend_params->field) \
: g_strdup_printf("%s\t%s\t\u2192\t%s", label, _(g_dpgettext2(NULL, "blendmode", old_str)), \
_(g_dpgettext2(NULL, "blendmode", new_str))); \
}
char * name
Definition common/metadata.c:41
Definition blend.h:278
char name[32]
Definition blend.h:279

◆ add_history_change

#define add_history_change (   field,
  format,
  label 
)
Value:
if((hitem->field) != (hprev->field)) \
{ \
gchar *full_format = g_strconcat("%s\t", format, "\t\u2192\t", format, NULL); \
change_parts[num_parts++] = g_strdup_printf(full_format, label, (hprev->field), (hitem->field)); \
g_free(full_format); \
}

◆ add_history_change_boolean

#define add_history_change_boolean (   field,
  label 
)
Value:
if((hitem->field) != (hprev->field)) \
{ \
change_parts[num_parts++] = g_strdup_printf("%s\t%s\t\u2192\t%s", label, (hprev->field) ? _("on") : _("off"), \
(hitem->field) ? _("on") : _("off")); \
}

◆ add_history_change_string

#define add_history_change_string (   field,
  label 
)
Value:
if(strcmp(hitem->field, hprev->field)) \
{ \
change_parts[num_parts++] \
= g_strdup_printf("%s\t\"%s\"\t\u2192\t\"%s\"", label, (hprev->field), (hitem->field)); \
}

◆ HIST_WIDGET_MODULE

#define HIST_WIDGET_MODULE   1

◆ HIST_WIDGET_NUMBER

#define HIST_WIDGET_NUMBER   0

◆ HIST_WIDGET_STATUS

#define HIST_WIDGET_STATUS   2

Typedef Documentation

◆ dt_lib_history_t

◆ dt_undo_history_t

Function Documentation

◆ _add_module_expander()

static void _add_module_expander ( GList *  iop_list,
dt_iop_module_t module 
)
static

◆ _changes_tooltip_callback()

static gboolean _changes_tooltip_callback ( GtkWidget *  widget,
gint  x,
gint  y,
gboolean  keyboard_mode,
GtkTooltip *  tooltip 
)
static
Todo:
: workaround added in order to fix #9908, probably a Gtk issue, remove when fixed upstream

References dt_gui_add_class(), FALSE, tooltip, TRUE, and view().

Referenced by _lib_history_change_callback().

◆ _check_deleted_instances()

◆ _create_deleted_modules()

◆ _create_tooltip_text()

◆ _find_previous_history_step()

static const dt_dev_history_item_t * _find_previous_history_step ( const dt_dev_history_item_t hitem)
static

◆ _history_invalidate_cb()

static void _history_invalidate_cb ( gpointer  user_data,
dt_undo_type_t  type,
dt_undo_data_t  item 
)
static

◆ _history_undo_data_free()

◆ _lib_history_button_clicked_callback()

◆ _lib_history_change_callback()

static void _lib_history_change_callback ( gpointer  instance,
gpointer  user_data 
)
static

◆ _lib_history_change_text()

◆ _lib_history_compress_clicked_callback()

static void _lib_history_compress_clicked_callback ( GtkButton *  widget,
gpointer  user_data 
)
static

References _lib_history_truncate(), and TRUE.

Referenced by gui_init().

◆ _lib_history_compress_pressed_callback()

static gboolean _lib_history_compress_pressed_callback ( GtkWidget *  widget,
GdkEventButton *  e,
gpointer  user_data 
)
static

References _lib_history_truncate(), dt_modifier_is(), and TRUE.

Referenced by gui_init().

◆ _lib_history_create_button()

static GtkWidget * _lib_history_create_button ( dt_lib_module_t self,
int  num,
const char *  label,
gboolean  enabled,
gboolean  default_enabled,
gboolean  always_on,
gboolean  selected,
gboolean  deprecated 
)
static

◆ _lib_history_create_style_button_clicked_callback()

static void _lib_history_create_style_button_clicked_callback ( GtkWidget *  widget,
gpointer  user_data 
)
static

◆ _lib_history_module_remove_callback()

static void _lib_history_module_remove_callback ( gpointer  instance,
dt_iop_module_t module,
gpointer  user_data 
)
static

◆ _lib_history_truncate()

◆ _lib_history_will_change_callback()

static void _lib_history_will_change_callback ( gpointer  instance,
GList *  history,
int  history_end,
GList *  iop_order_list,
gpointer  user_data 
)
static

◆ _pop_undo()

◆ _rebuild_multi_priority()

static int _rebuild_multi_priority ( GList *  history_list)
static

◆ _reorder_gui_module_list()

static void _reorder_gui_module_list ( dt_develop_t dev)
static

◆ _reset_module_instance()

static void _reset_module_instance ( GList *  hist,
dt_iop_module_t module,
int  multi_priority 
)
static

◆ _search_history_by_module()

static dt_dev_history_item_t * _search_history_by_module ( GList *  history_list,
dt_iop_module_t module 
)
static

◆ _undo_items_cb()

static void _undo_items_cb ( gpointer  user_data,
dt_undo_type_t  type,
dt_undo_data_t  data 
)
static

◆ container()

uint32_t container ( dt_lib_module_t self)

◆ gui_cleanup()

◆ gui_init()

◆ gui_reset()

◆ name()

const char * name ( struct dt_lib_module_t self)

◆ position()

int position ( )

◆ views()

const char ** views ( dt_lib_module_t self)