![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/history.h"
#include "common/collection.h"
#include "common/darktable.h"
#include "common/debug.h"
#include "common/exif.h"
#include "common/history_snapshot.h"
#include "common/image_cache.h"
#include "common/imageio.h"
#include "common/mipmap_cache.h"
#include "common/tags.h"
#include "common/undo.h"
#include "common/utility.h"
#include "control/control.h"
#include "develop/blend.h"
#include "develop/develop.h"
#include "develop/masks.h"
#include "gui/hist_dialog.h"
Macros | |
#define | DT_IOP_ORDER_INFO (darktable.unmuted & DT_DEBUG_IOPORDER) |
Functions | |
void | dt_history_item_free (gpointer data) |
static void | _remove_preset_flag (const int32_t imgid) |
void | dt_history_delete_on_image_ext (int32_t imgid, gboolean undo) |
void | dt_history_delete_on_image (int32_t imgid) |
int | dt_history_load_and_apply (const int32_t imgid, gchar *filename, int history_only) |
int | dt_history_load_and_apply_on_list (gchar *filename, const GList *list) |
char * | dt_history_item_as_string (const char *name, gboolean enabled) |
GList * | dt_history_get_items (const int32_t imgid, gboolean enabled) |
char * | dt_history_get_items_as_string (const int32_t imgid) |
static int | dt_history_end_attop (const int32_t imgid) |
void | dt_history_compress_on_image (const int32_t imgid) |
void | dt_history_truncate_on_image (const int32_t imgid, const int32_t history_end) |
int | dt_history_compress_on_list (const GList *imgs) |
gboolean | dt_history_check_module_exists (int32_t imgid, const char *operation, gboolean enabled) |
static gsize | _history_hash_compute_from_db (const int32_t imgid, guint8 **hash) |
void | dt_history_hash_write_from_history (const int32_t imgid, const dt_history_hash_t type) |
void | dt_history_hash_write (const int32_t imgid, dt_history_hash_values_t *hash) |
void | dt_history_hash_read (const int32_t imgid, dt_history_hash_values_t *hash) |
gboolean | dt_history_hash_is_mipmap_synced (const int32_t imgid) |
void | dt_history_hash_set_mipmap (const int32_t imgid) |
gboolean | dt_history_copy (int32_t imgid) |
gboolean | dt_history_copy_parts (int32_t imgid) |
gboolean | dt_history_paste_on_list (const GList *list, gboolean undo) |
gboolean | dt_history_paste_parts_on_list (const GList *list, gboolean undo) |
gboolean | dt_history_delete_on_list (const GList *list, gboolean undo) |
#define DT_IOP_ORDER_INFO (darktable.unmuted & DT_DEBUG_IOPORDER) |
|
static |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, DT_IOP_ORDER_CUSTOM, FALSE, TRUE, and UNKNOWN_IMAGE.
Referenced by dt_history_hash_write_from_history().
|
static |
References darktable, dt_image_cache_get(), DT_IMAGE_CACHE_SAFE, dt_image_cache_write_release(), dt_image_t::flags, and darktable_t::image_cache.
Referenced by dt_history_delete_on_image_ext().
gboolean dt_history_check_module_exists | ( | int32_t | imgid, |
const char * | operation, | ||
gboolean | enabled | ||
) |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, and TRUE.
Referenced by _insert_default_modules().
void dt_history_compress_on_image | ( | const int32_t | imgid | ) |
References darktable, darktable_t::db, dt_database_get(), dt_database_release_transaction, dt_database_start_transaction, DT_DEBUG_HISTORY, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_history_delete_on_image(), DT_HISTORY_HASH_CURRENT, dt_history_hash_write_from_history(), dt_print(), dt_thumbtable_refresh_thumbnail, FALSE, darktable_t::gui, dt_ui_t::thumbtable_lighttable, TRUE, and dt_gui_gtk_t::ui.
Referenced by dt_history_compress_on_list().
int dt_history_compress_on_list | ( | const GList * | imgs | ) |
compress history stack
References darktable, darktable_t::db, dt_control_save_xmp(), dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_history_compress_on_image(), dt_history_end_attop(), DT_HISTORY_HASH_CURRENT, dt_history_hash_write_from_history(), and size.
Referenced by compress_history_callback().
gboolean dt_history_copy | ( | int32_t | imgid | ) |
copy history from imgid and pasts on selected images, merge or overwrite...
References dt_history_copy_item_t::copied_imageid, dt_view_manager_t::copy_paste, darktable, FALSE, dt_history_copy_item_t::full_copy, TRUE, and darktable_t::view_manager.
Referenced by copy_callback(), and dt_history_copy_parts().
gboolean dt_history_copy_parts | ( | int32_t | imgid | ) |
References dt_view_manager_t::copy_paste, darktable, dt_gui_hist_dialog_new(), dt_history_copy(), FALSE, dt_history_copy_item_t::full_copy, TRUE, and darktable_t::view_manager.
Referenced by copy_parts_callback().
void dt_history_delete_on_image | ( | int32_t | imgid | ) |
delete all history for the given image
References darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_history_delete_on_image_ext(), DT_SIGNAL_TAG_CHANGED, darktable_t::signals, and TRUE.
Referenced by dt_control_duplicate_images_job_run(), dt_history_compress_on_image(), dt_history_truncate_on_image(), and history_delete().
void dt_history_delete_on_image_ext | ( | int32_t | imgid, |
gboolean | undo | ||
) |
as above but control whether to record undo/redo
References _remove_preset_flag(), dt_undo_lt_history_t::after, dt_undo_lt_history_t::after_history_end, dt_undo_lt_history_t::before, dt_undo_lt_history_t::before_history_end, darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, DT_HISTORY_HASH_CURRENT, dt_history_hash_write_from_history(), dt_history_snapshot_item_init(), dt_history_snapshot_undo_create(), dt_history_snapshot_undo_lt_history_data_free(), dt_history_snapshot_undo_pop(), dt_image_cache_unset_change_timestamp(), dt_mipmap_cache_remove(), dt_tag_detach_by_string(), dt_thumbtable_refresh_thumbnail, dt_undo_end_group(), DT_UNDO_LT_HISTORY, dt_undo_record(), dt_undo_start_group(), FALSE, darktable_t::gui, darktable_t::image_cache, dt_undo_lt_history_t::imgid, darktable_t::mipmap_cache, dt_ui_t::thumbtable_lighttable, TRUE, dt_gui_gtk_t::ui, and darktable_t::undo.
Referenced by _history_snapshot_undo_restore(), dt_history_delete_on_image(), dt_history_delete_on_list(), and gui_reset().
gboolean dt_history_delete_on_list | ( | const GList * | list, |
gboolean | undo | ||
) |
delete historystack of selected images
References dt_undo_lt_history_t::after, dt_undo_lt_history_t::after_history_end, dt_undo_lt_history_t::before, dt_undo_lt_history_t::before_history_end, darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_history_delete_on_image_ext(), dt_history_snapshot_item_init(), dt_history_snapshot_undo_create(), dt_history_snapshot_undo_lt_history_data_free(), dt_history_snapshot_undo_pop(), DT_SIGNAL_IMAGE_INFO_CHANGED, DT_SIGNAL_TAG_CHANGED, dt_undo_end_group(), DT_UNDO_LT_HISTORY, dt_undo_record(), dt_undo_start_group(), FALSE, dt_undo_lt_history_t::imgid, darktable_t::signals, TRUE, and darktable_t::undo.
Referenced by delete_history_callback().
|
static |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and size.
Referenced by dt_history_compress_on_list().
GList * dt_history_get_items | ( | int32_t | imgid, |
gboolean | enabled | ||
) |
get list of history items for image
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_iop_get_localized_name(), dt_history_item_t::enabled, dt_history_item_t::name, name, dt_history_item_t::num, and dt_history_item_t::op.
Referenced by _gui_styles_dialog_run(), and dt_gui_hist_dialog_new().
char * dt_history_get_items_as_string | ( | int32_t | imgid | ) |
get list of history items for image as a nice string
References darktable, darktable_t::db, delete_underscore(), dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_history_item_as_string(), dt_iop_get_localized_name(), dt_util_glist_to_str(), items, and name.
Referenced by _altered_enter(), and main().
gboolean dt_history_hash_is_mipmap_synced | ( | const int32_t | imgid | ) |
return true if mipmap_hash = current_hash
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, and UNKNOWN_IMAGE.
void dt_history_hash_read | ( | const int32_t | imgid, |
dt_history_hash_values_t * | hash | ||
) |
read hash values from db
References dt_history_hash_values_t::auto_apply, dt_history_hash_values_t::auto_apply_len, dt_history_hash_values_t::basic, dt_history_hash_values_t::basic_len, dt_history_hash_values_t::current, dt_history_hash_values_t::current_len, darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by _exif_xmp_read_data().
void dt_history_hash_set_mipmap | ( | const int32_t | imgid | ) |
update mipmap hash to db (= current_hash)
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and UNKNOWN_IMAGE.
Referenced by generate_cache(), generate_thumbnail_cache(), and preload_image_cache().
void dt_history_hash_write | ( | const int32_t | imgid, |
dt_history_hash_values_t * | hash | ||
) |
write hash values to db
References dt_history_hash_values_t::auto_apply, dt_history_hash_values_t::auto_apply_len, dt_history_hash_values_t::basic, dt_history_hash_values_t::basic_len, dt_history_hash_values_t::current, dt_history_hash_values_t::current_len, darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_BLOB, DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by dt_exif_xmp_read().
void dt_history_hash_write_from_history | ( | const int32_t | imgid, |
const dt_history_hash_t | type | ||
) |
calculate history hash and save it to database
References _history_hash_compute_from_db(), darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_BLOB, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, DT_HISTORY_HASH_AUTO, DT_HISTORY_HASH_BASIC, DT_HISTORY_HASH_CURRENT, dt_util_dstrcat(), type, and UNKNOWN_IMAGE.
Referenced by _history_snapshot_undo_restore(), dt_dev_write_history_ext(), dt_exif_xmp_read(), dt_history_compress_on_image(), dt_history_compress_on_list(), dt_history_delete_on_image_ext(), dt_history_truncate_on_image(), and dt_image_set_flip().
char * dt_history_item_as_string | ( | const char * | name, |
gboolean | enabled | ||
) |
get a single history item as string with enabled status
References name.
Referenced by dt_history_get_items_as_string().
void dt_history_item_free | ( | gpointer | data | ) |
helper function to free a GList of dt_history_item_t
References dt_history_item_t::name, and dt_history_item_t::op.
Referenced by _gui_styles_dialog_run(), and dt_gui_hist_dialog_new().
int dt_history_load_and_apply | ( | int32_t | imgid, |
gchar * | filename, | ||
int | history_only | ||
) |
load a dt file and applies to specified image
References dt_undo_lt_history_t::after, dt_undo_lt_history_t::after_history_end, dt_undo_lt_history_t::before, dt_undo_lt_history_t::before_history_end, darktable, dt_exif_xmp_read(), dt_history_snapshot_item_init(), dt_history_snapshot_undo_create(), dt_history_snapshot_undo_lt_history_data_free(), dt_history_snapshot_undo_pop(), dt_image_cache_get(), DT_IMAGE_CACHE_RELAXED, DT_IMAGE_CACHE_SAFE, dt_image_cache_write_release(), dt_mipmap_cache_remove(), dt_thumbtable_refresh_thumbnail, dt_undo_end_group(), DT_UNDO_LT_HISTORY, dt_undo_record(), dt_undo_start_group(), darktable_t::gui, darktable_t::image_cache, dt_undo_lt_history_t::imgid, darktable_t::mipmap_cache, dt_ui_t::thumbtable_lighttable, TRUE, dt_gui_gtk_t::ui, and darktable_t::undo.
Referenced by dt_history_load_and_apply_on_list(), sync_newest_to_oldest(), sync_oldest_to_newest(), and sync_xmp_to_db().
int dt_history_load_and_apply_on_list | ( | gchar * | filename, |
const GList * | list | ||
) |
load a dt file and applies to selected images
References darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_history_load_and_apply(), DT_SIGNAL_IMAGE_INFO_CHANGED, dt_undo_end_group(), DT_UNDO_LT_HISTORY, dt_undo_start_group(), darktable_t::signals, and darktable_t::undo.
Referenced by load_xmp_callback().
gboolean dt_history_paste_on_list | ( | const GList * | list, |
gboolean | undo | ||
) |
References dt_history_copy_item_t::copied_imageid, dt_history_copy_item_t::copy_iop_order, dt_view_manager_t::copy_paste, darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_history_copy_and_paste_on_image(), DT_SIGNAL_IMAGE_INFO_CHANGED, dt_undo_end_group(), DT_UNDO_LT_HISTORY, dt_undo_start_group(), FALSE, dt_history_copy_item_t::full_copy, dt_history_copy_item_t::selops, darktable_t::signals, TRUE, darktable_t::undo, and darktable_t::view_manager.
Referenced by paste_all_callback().
gboolean dt_history_paste_parts_on_list | ( | const GList * | list, |
gboolean | undo | ||
) |
References dt_history_copy_item_t::copied_imageid, dt_history_copy_item_t::copy_iop_order, dt_view_manager_t::copy_paste, darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_gui_hist_dialog_new(), dt_history_copy_and_paste_on_image(), DT_SIGNAL_IMAGE_INFO_CHANGED, dt_undo_end_group(), DT_UNDO_LT_HISTORY, dt_undo_start_group(), FALSE, dt_history_copy_item_t::full_copy, dt_history_copy_item_t::selops, darktable_t::signals, TRUE, darktable_t::undo, and darktable_t::view_manager.
Referenced by paste_parts_callback().
void dt_history_truncate_on_image | ( | const int32_t | imgid, |
const int32_t | history_end | ||
) |
truncate history stack
References darktable, darktable_t::db, dt_database_get(), dt_database_release_transaction, dt_database_start_transaction, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_history_delete_on_image(), DT_HISTORY_HASH_CURRENT, dt_history_hash_write_from_history(), dt_thumbtable_refresh_thumbnail, darktable_t::gui, dt_ui_t::thumbtable_lighttable, TRUE, and dt_gui_gtk_t::ui.