![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/undo.h"
#include "common/collection.h"
#include "common/darktable.h"
#include "common/image.h"
#include "control/control.h"
#include <glib.h>
#include <stdlib.h>
#include <sys/time.h>
Data Structures | |
struct | dt_undo_item_t |
Macros | |
#define | LOCK dt_pthread_mutex_lock(&self->mutex); self->locked = TRUE |
#define | UNLOCK self->locked = FALSE; dt_pthread_mutex_unlock(&self->mutex) |
Typedefs | |
typedef struct dt_undo_item_t | dt_undo_item_t |
Functions | |
dt_undo_t * | dt_undo_init (void) |
void | dt_undo_disable_next (dt_undo_t *self) |
void | dt_undo_cleanup (dt_undo_t *self) |
static void | _free_undo_data (void *p) |
static void | _undo_record (dt_undo_t *self, gpointer user_data, dt_undo_type_t type, dt_undo_data_t data, gboolean is_group, void(*undo)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item, dt_undo_action_t action, GList **imgs), void(*free_data)(gpointer data)) |
void | dt_undo_start_group (dt_undo_t *self, dt_undo_type_t type) |
void | dt_undo_end_group (dt_undo_t *self) |
void | dt_undo_record (dt_undo_t *self, gpointer user_data, dt_undo_type_t type, dt_undo_data_t data, void(*undo)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item, dt_undo_action_t action, GList **imgs), void(*free_data)(gpointer data)) |
gint | _images_list_cmp (gconstpointer a, gconstpointer b) |
static void | _undo_do_undo_redo (dt_undo_t *self, uint32_t filter, dt_undo_action_t action) |
void | dt_undo_do_redo (dt_undo_t *self, uint32_t filter) |
void | dt_undo_do_undo (dt_undo_t *self, uint32_t filter) |
static gboolean | _is_do_undo_list_populated (dt_undo_t *self, uint32_t filter, dt_undo_action_t action) |
gboolean | dt_is_undo_list_populated (dt_undo_t *self, uint32_t filter) |
gboolean | dt_is_redo_list_populated (dt_undo_t *self, uint32_t filter) |
static void | _undo_clear_list (GList **list, uint32_t filter) |
void | dt_undo_clear (dt_undo_t *self, uint32_t filter) |
static void | _undo_iterate (GList *list, uint32_t filter, gpointer user_data, void(*apply)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item)) |
void | dt_undo_iterate_internal (dt_undo_t *self, uint32_t filter, gpointer user_data, void(*apply)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item)) |
void | dt_undo_iterate (dt_undo_t *self, uint32_t filter, gpointer user_data, void(*apply)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item)) |
Variables | |
const double | MAX_TIME_PERIOD = 0.5 |
#define LOCK dt_pthread_mutex_lock(&self->mutex); self->locked = TRUE |
#define UNLOCK self->locked = FALSE; dt_pthread_mutex_unlock(&self->mutex) |
typedef struct dt_undo_item_t dt_undo_item_t |
References dt_undo_item_t::data, and dt_undo_item_t::free_data.
Referenced by _undo_clear_list(), and _undo_record().
gint _images_list_cmp | ( | gconstpointer | a, |
gconstpointer | b | ||
) |
Referenced by _undo_do_undo_redo().
|
static |
References dt_undo_item_t::data, DT_ACTION_UNDO, FALSE, LOCK, dt_undo_t::redo_list, TRUE, dt_undo_item_t::type, dt_undo_t::undo_list, and UNLOCK.
Referenced by dt_is_redo_list_populated(), and dt_is_undo_list_populated().
|
static |
References _free_undo_data(), dt_undo_item_t::data, DT_DEBUG_UNDO, dt_print(), and dt_undo_item_t::type.
Referenced by dt_undo_clear().
|
static |
References _images_list_cmp(), dt_undo_item_t::data, DT_ACTION_UNDO, DT_DEBUG_UNDO, dt_image_synch_xmps(), dt_print(), FALSE, dt_undo_item_t::is_group, LOCK, MAX_TIME_PERIOD, dt_undo_t::redo_list, TRUE, dt_undo_item_t::ts, dt_undo_item_t::type, dt_undo_item_t::undo, dt_undo_t::undo_list, UNLOCK, and dt_undo_item_t::user_data.
Referenced by dt_undo_do_redo(), and dt_undo_do_undo().
|
static |
References dt_undo_item_t::data, dt_undo_item_t::is_group, and dt_undo_item_t::type.
Referenced by dt_undo_iterate_internal().
|
static |
References _free_undo_data(), dt_undo_item_t::data, dt_undo_t::disable_next, DT_DEBUG_UNDO, dt_get_wtime(), dt_print(), FALSE, dt_undo_item_t::free_data, dt_undo_item_t::is_group, LOCK, dt_undo_t::locked, dt_undo_t::redo_list, dt_undo_item_t::ts, type, dt_undo_item_t::type, dt_undo_item_t::undo, dt_undo_t::undo_list, UNLOCK, and dt_undo_item_t::user_data.
Referenced by dt_undo_end_group(), dt_undo_record(), and dt_undo_start_group().
gboolean dt_is_redo_list_populated | ( | dt_undo_t * | self, |
uint32_t | filter | ||
) |
References _is_do_undo_list_populated(), and DT_ACTION_REDO.
Referenced by redo_sensitive_callback().
gboolean dt_is_undo_list_populated | ( | dt_undo_t * | self, |
uint32_t | filter | ||
) |
References _is_do_undo_list_populated(), and DT_ACTION_UNDO.
Referenced by undo_sensitive_callback().
References dt_pthread_mutex_destroy(), DT_UNDO_ALL, dt_undo_clear(), and dt_undo_t::mutex.
Referenced by dt_cleanup().
References _undo_clear_list(), dt_undo_t::disable_next, FALSE, LOCK, dt_undo_t::redo_list, dt_undo_t::undo_list, and UNLOCK.
Referenced by dt_undo_cleanup(), dt_view_manager_switch_by_view(), and enter().
References dt_undo_t::disable_next, DT_DEBUG_UNDO, dt_print(), and TRUE.
References _undo_do_undo_redo(), and DT_ACTION_REDO.
Referenced by redo_callback().
References _undo_do_undo_redo(), and DT_ACTION_UNDO.
Referenced by undo_callback().
References _undo_record(), DT_DEBUG_UNDO, dt_print(), DT_UNDO_NONE, dt_undo_t::group, dt_undo_t::group_indent, and TRUE.
Referenced by dt_colorlabels_toggle_label_on_list(), dt_control_duplicate_images_job_run(), dt_control_flip_images_job_run(), dt_control_monochrome_images_job_run(), dt_history_copy_and_paste_on_image(), dt_history_delete_on_image_ext(), dt_history_delete_on_list(), dt_history_load_and_apply(), dt_history_load_and_apply_on_list(), dt_history_paste_on_list(), dt_history_paste_parts_on_list(), dt_image_set_datetime(), dt_image_set_datetimes(), dt_image_set_images_locations(), dt_image_set_locations(), dt_metadata_clear(), dt_metadata_set(), dt_metadata_set_list(), dt_metadata_set_list_id(), dt_multiple_styles_apply_to_list(), dt_ratings_apply_on_image(), dt_ratings_apply_on_list(), dt_styles_apply_to_image(), dt_styles_apply_to_list(), dt_tag_attach_images(), dt_tag_attach_string_list(), dt_tag_detach_images(), and dt_tag_set_tags().
References dt_undo_t::disable_next, DT_DEBUG_UNDO, dt_print(), dt_pthread_mutex_init(), DT_UNDO_NONE, FALSE, dt_undo_t::group, dt_undo_t::group_indent, dt_undo_t::locked, dt_undo_t::mutex, dt_undo_t::redo_list, and dt_undo_t::undo_list.
Referenced by dt_init().
void dt_undo_iterate | ( | dt_undo_t * | self, |
uint32_t | filter, | ||
gpointer | user_data, | ||
void(*)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item) | apply | ||
) |
References dt_undo_iterate_internal(), LOCK, and UNLOCK.
Referenced by _lib_history_module_remove_callback().
void dt_undo_iterate_internal | ( | dt_undo_t * | self, |
uint32_t | filter, | ||
gpointer | user_data, | ||
void(*)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item) | apply | ||
) |
References _undo_iterate(), dt_undo_t::redo_list, and dt_undo_t::undo_list.
Referenced by _check_deleted_instances(), _create_deleted_modules(), and dt_undo_iterate().
void dt_undo_record | ( | dt_undo_t * | self, |
gpointer | user_data, | ||
dt_undo_type_t | type, | ||
dt_undo_data_t | data, | ||
void(*)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item, dt_undo_action_t action, GList **imgs) | undo, | ||
void(*)(gpointer data) | free_data | ||
) |
References _undo_record(), FALSE, and type.
Referenced by _image_duplicate_with_version(), _image_set_monochrome_flag(), _lib_history_change_callback(), dt_colorlabels_toggle_label_on_list(), dt_history_copy_and_paste_on_image(), dt_history_delete_on_image_ext(), dt_history_delete_on_list(), dt_history_load_and_apply(), dt_image_flip(), dt_image_set_datetime(), dt_image_set_datetimes(), dt_image_set_images_locations(), dt_image_set_locations(), dt_metadata_clear(), dt_metadata_set(), dt_metadata_set_list(), dt_metadata_set_list_id(), dt_ratings_apply_on_image(), dt_ratings_apply_on_list(), dt_styles_apply_to_image(), dt_tag_attach_images(), dt_tag_attach_string_list(), dt_tag_detach_images(), and dt_tag_set_tags().
void dt_undo_start_group | ( | dt_undo_t * | self, |
dt_undo_type_t | type | ||
) |
References _undo_record(), DT_DEBUG_UNDO, dt_print(), DT_UNDO_NONE, dt_undo_t::group, dt_undo_t::group_indent, TRUE, and type.
Referenced by dt_colorlabels_toggle_label_on_list(), dt_control_duplicate_images_job_run(), dt_control_flip_images_job_run(), dt_control_monochrome_images_job_run(), dt_history_copy_and_paste_on_image(), dt_history_delete_on_image_ext(), dt_history_delete_on_list(), dt_history_load_and_apply(), dt_history_load_and_apply_on_list(), dt_history_paste_on_list(), dt_history_paste_parts_on_list(), dt_image_set_datetime(), dt_image_set_datetimes(), dt_image_set_images_locations(), dt_image_set_locations(), dt_metadata_clear(), dt_metadata_set(), dt_metadata_set_list(), dt_metadata_set_list_id(), dt_multiple_styles_apply_to_list(), dt_ratings_apply_on_image(), dt_ratings_apply_on_list(), dt_styles_apply_to_image(), dt_styles_apply_to_list(), dt_tag_attach_images(), dt_tag_attach_string_list(), dt_tag_detach_images(), and dt_tag_set_tags().
const double MAX_TIME_PERIOD = 0.5 |
Referenced by _undo_do_undo_redo().