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_lib_history_t
 

Macros

#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_lib_history_t dt_lib_history_t
 
typedef enum dt_history_view_column_t dt_history_view_column_t
 

Enumerations

enum  dt_history_view_column_t {
  DT_HISTORY_VIEW_COL_HISTORY_END = 0 ,
  DT_HISTORY_VIEW_COL_NUMBER ,
  DT_HISTORY_VIEW_COL_LABEL ,
  DT_HISTORY_VIEW_COL_ICON_NAME ,
  DT_HISTORY_VIEW_COL_ENABLED ,
  DT_HISTORY_VIEW_COL_TOOLTIP ,
  DT_HISTORY_VIEW_COL_COUNT
}
 

Functions

static gboolean _lib_history_view_button_press_callback (GtkWidget *widget, GdkEventButton *e, gpointer user_data)
 
static void _lib_history_change_callback (gpointer instance, gpointer user_data)
 
static void _lib_history_view_selection_changed (GtkTreeSelection *selection, gpointer user_data)
 
static gboolean _lib_history_view_query_tooltip (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data)
 
static void _lib_history_view_cell_set_foreground (GtkTreeViewColumn *column, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer 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 const char * _history_icon_name (const gboolean enabled, const gboolean default_enabled, const gboolean always_on, const gboolean deprecated)
 
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 _history_apply_history_end (const int history_end)
 
static void _history_show_module_for_end (const int history_end)
 
static void _history_store_add_original (dt_lib_history_t *d)
 
static gchar * _history_tooltip_with_hint (const dt_dev_history_item_t *hitem)
 
static void _history_store_prepend_item (dt_lib_history_t *d, const dt_dev_history_item_t *hitem, const int history_end)
 
static void _history_select_row_for_end (dt_lib_history_t *d, const int history_end)
 
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)); \
dt_free(full_format); \
full_format = NULL; \
}

◆ 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))); \
}
const float i
Definition colorspaces_inline_conversions.h:669
if(L< 0.5f) C
const float d
Definition colorspaces_inline_conversions.h:931
char * name
Definition common/metadata.c:61
static const dt_aligned_pixel_simd_t value
Definition darktable.h:501
const int t
Definition iop_profile.h:227
Definition blend.h:296
char name[32]
Definition blend.h:297

◆ 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)); \
dt_free(full_format); \
full_format = NULL; \
}

◆ 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)); \
}

Typedef Documentation

◆ dt_history_view_column_t

◆ dt_lib_history_t

Enumeration Type Documentation

◆ dt_history_view_column_t

Enumerator
DT_HISTORY_VIEW_COL_HISTORY_END 
DT_HISTORY_VIEW_COL_NUMBER 
DT_HISTORY_VIEW_COL_LABEL 
DT_HISTORY_VIEW_COL_ICON_NAME 
DT_HISTORY_VIEW_COL_ENABLED 
DT_HISTORY_VIEW_COL_TOOLTIP 
DT_HISTORY_VIEW_COL_COUNT 

Function Documentation

◆ _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_view_query_tooltip().

◆ _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_apply_history_end()

◆ _history_icon_name()

static const char * _history_icon_name ( const gboolean  enabled,
const gboolean  default_enabled,
const gboolean  always_on,
const gboolean  deprecated 
)
static

◆ _history_select_row_for_end()

static void _history_select_row_for_end ( dt_lib_history_t d,
const int  history_end 
)
static

◆ _history_show_module_for_end()

◆ _history_store_add_original()

◆ _history_store_prepend_item()

◆ _history_tooltip_with_hint()

static gchar * _history_tooltip_with_hint ( const dt_dev_history_item_t hitem)
static

◆ _lib_history_change_callback()

◆ _lib_history_change_text()

◆ _lib_history_view_button_press_callback()

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

◆ _lib_history_view_cell_set_foreground()

static void _lib_history_view_cell_set_foreground ( GtkTreeViewColumn *  column,
GtkCellRenderer *  renderer,
GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer  data 
)
static

References DT_HISTORY_VIEW_COL_ENABLED, FALSE, model, and TRUE.

Referenced by gui_init().

◆ _lib_history_view_query_tooltip()

static gboolean _lib_history_view_query_tooltip ( GtkWidget widget,
gint  x,
gint  y,
gboolean  keyboard_mode,
GtkTooltip *  tooltip,
gpointer  user_data 
)
static

◆ _lib_history_view_selection_changed()

static void _lib_history_view_selection_changed ( GtkTreeSelection *  selection,
gpointer  user_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)

References v.