![]() |
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/dtpthread.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/dev_history.h"#include "develop/develop.h"#include "develop/masks.h"
Include dependency graph for common/history.c:Macros | |
| #define | DT_IOP_ORDER_INFO (darktable.unmuted & DT_DEBUG_IOPORDER) |
Functions | |
| static void | _history_stmt_mutex_ensure (void) |
| 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) |
| 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) |
| gboolean | dt_history_check_module_exists (int32_t imgid, const char *operation, gboolean enabled) |
| void | dt_history_cleanup (void) |
| int32_t | dt_history_get_end (const int32_t imgid) |
| gboolean | dt_history_set_end (const int32_t imgid, const int32_t history_end) |
| int32_t | dt_history_db_get_next_history_num (const int32_t imgid) |
| gboolean | dt_history_db_delete_history (const int32_t imgid) |
| gboolean | dt_history_db_delete_masks_history (const int32_t imgid) |
| gboolean | dt_history_db_shift_history_nums (const int32_t imgid, const int delta) |
| gboolean | dt_history_db_delete_dev_history (const int32_t imgid) |
| gboolean | dt_history_db_write_history_item (const int32_t imgid, const int num, const char *operation, const void *op_params, const int op_params_size, const int module_version, const gboolean enabled, const void *blendop_params, const int blendop_params_size, const int blendop_version, const int multi_priority, const char *multi_name) |
| void | dt_history_db_foreach_history_row (const int32_t imgid, dt_history_db_row_cb cb, void *user_data) |
| void | dt_history_db_foreach_auto_preset_row (const int32_t imgid, const dt_image_t *image, const char *workflow_preset, const int iformat, const int excluded, dt_history_db_row_cb cb, void *user_data) |
| gboolean | dt_history_db_get_autoapply_ioporder_params (const int32_t imgid, const dt_image_t *image, const int iformat, const int excluded, void **params, int32_t *params_len) |
| void | dt_history_hash_set_mipmap (const int32_t imgid, const uint64_t history_hash, const dt_image_cache_write_mode_t mode) |
Variables | |
| static sqlite3_stmt * | _history_check_module_exists_stmt = NULL |
| static sqlite3_stmt * | _history_hash_set_mipmap_stmt = NULL |
| static sqlite3_stmt * | _history_get_end_stmt = NULL |
| static sqlite3_stmt * | _history_set_end_stmt = NULL |
| static sqlite3_stmt * | _history_get_next_num_stmt = NULL |
| static sqlite3_stmt * | _history_delete_history_stmt = NULL |
| static sqlite3_stmt * | _history_delete_masks_stmt = NULL |
| static sqlite3_stmt * | _history_shift_history_nums_stmt = NULL |
| static sqlite3_stmt * | _history_select_history_stmt = NULL |
| static sqlite3_stmt * | _history_select_num_stmt = NULL |
| static sqlite3_stmt * | _history_insert_num_stmt = NULL |
| static sqlite3_stmt * | _history_update_item_stmt = NULL |
| static sqlite3_stmt * | _history_auto_presets_stmt = NULL |
| static sqlite3_stmt * | _history_auto_presets_legacy_stmt = NULL |
| static sqlite3_stmt * | _history_auto_ioporder_stmt = NULL |
| static dt_pthread_mutex_t | _history_stmt_mutex |
| static gsize | _history_stmt_mutex_inited = 0 |
| #define DT_IOP_ORDER_INFO (darktable.unmuted & DT_DEBUG_IOPORDER) |
References _history_stmt_mutex, _history_stmt_mutex_inited, and dt_pthread_mutex_init().
Referenced by dt_history_check_module_exists(), dt_history_cleanup(), dt_history_db_delete_history(), dt_history_db_delete_masks_history(), dt_history_db_foreach_auto_preset_row(), dt_history_db_foreach_history_row(), dt_history_db_get_autoapply_ioporder_params(), dt_history_db_get_next_history_num(), dt_history_db_shift_history_nums(), dt_history_db_write_history_item(), dt_history_get_end(), and dt_history_set_end().
|
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 _history_check_module_exists_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), FALSE, and TRUE.
Referenced by _insert_default_modules().
cleanup cached statements
References _history_auto_ioporder_stmt, _history_auto_presets_legacy_stmt, _history_auto_presets_stmt, _history_check_module_exists_stmt, _history_delete_history_stmt, _history_delete_masks_stmt, _history_get_end_stmt, _history_get_next_num_stmt, _history_hash_set_mipmap_stmt, _history_insert_num_stmt, _history_select_history_stmt, _history_select_num_stmt, _history_set_end_stmt, _history_shift_history_nums_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), _history_update_item_stmt, dt_pthread_mutex_lock(), and dt_pthread_mutex_unlock().
Referenced by dt_cleanup().
| gboolean dt_history_db_delete_dev_history | ( | const int32_t | imgid | ) |
References dt_history_db_delete_history(), dt_history_db_delete_masks_history(), FALSE, and TRUE.
Referenced by _cleanup_history().
| gboolean dt_history_db_delete_history | ( | const int32_t | imgid | ) |
References _history_delete_history_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and FALSE.
Referenced by dt_exif_xmp_read(), and dt_history_db_delete_dev_history().
| gboolean dt_history_db_delete_masks_history | ( | const int32_t | imgid | ) |
References _history_delete_masks_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and FALSE.
Referenced by dt_exif_xmp_read(), and dt_history_db_delete_dev_history().
| void dt_history_db_foreach_auto_preset_row | ( | const int32_t | imgid, |
| const dt_image_t * | image, | ||
| const char * | workflow_preset, | ||
| const int | iformat, | ||
| const int | excluded, | ||
| dt_history_db_row_cb | cb, | ||
| void * | user_data | ||
| ) |
References _history_auto_presets_legacy_stmt, _history_auto_presets_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), dt_image_t::camera_alias, dt_image_t::camera_maker, darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_DOUBLE, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_free, DT_IMAGE_NO_LEGACY_PRESETS, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_image_t::exif_aperture, dt_image_t::exif_exposure, dt_image_t::exif_focal_length, dt_image_t::exif_iso, dt_image_t::exif_lens, dt_image_t::exif_maker, dt_image_t::exif_model, and dt_image_t::flags.
Referenced by _dev_auto_apply_presets().
| void dt_history_db_foreach_history_row | ( | const int32_t | imgid, |
| dt_history_db_row_cb | cb, | ||
| void * | user_data | ||
| ) |
| gboolean dt_history_db_get_autoapply_ioporder_params | ( | const int32_t | imgid, |
| const dt_image_t * | image, | ||
| const int | iformat, | ||
| const int | excluded, | ||
| void ** | params, | ||
| int32_t * | params_len | ||
| ) |
References _history_auto_ioporder_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), dt_image_t::camera_alias, dt_image_t::camera_maker, darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_DOUBLE, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_image_t::exif_aperture, dt_image_t::exif_exposure, dt_image_t::exif_focal_length, dt_image_t::exif_iso, dt_image_t::exif_lens, dt_image_t::exif_maker, dt_image_t::exif_model, FALSE, and TRUE.
Referenced by _dev_auto_apply_presets().
| int32_t dt_history_db_get_next_history_num | ( | const int32_t | imgid | ) |
References _history_get_next_num_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_pthread_mutex_lock(), and dt_pthread_mutex_unlock().
Referenced by dt_add_hist(), dt_dev_read_history_ext(), dt_exif_xmp_read(), and dt_image_set_flip().
| gboolean dt_history_db_shift_history_nums | ( | const int32_t | imgid, |
| const int | delta | ||
| ) |
References _history_shift_history_nums_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), darktable, darktable_t::db, delta, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and TRUE.
Referenced by dt_exif_xmp_read().
| gboolean dt_history_db_write_history_item | ( | const int32_t | imgid, |
| const int | num, | ||
| const char * | operation, | ||
| const void * | op_params, | ||
| const int | op_params_size, | ||
| const int | module_version, | ||
| const gboolean | enabled, | ||
| const void * | blendop_params, | ||
| const int | blendop_params_size, | ||
| const int | blendop_version, | ||
| const int | multi_priority, | ||
| const char * | multi_name | ||
| ) |
References _history_insert_num_stmt, _history_select_num_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), _history_update_item_stmt, darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_BLOB, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), FALSE, and TRUE.
Referenced by dt_add_hist(), dt_dev_write_history_item(), dt_exif_xmp_read(), and dt_image_set_flip().
| 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(), 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_snapshot_item_init(), dt_history_snapshot_undo_create(), dt_history_snapshot_undo_lt_history_data_free(), dt_history_snapshot_undo_pop(), 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, 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_delete_apply(), _history_snapshot_undo_restore(), dt_history_delete_on_image(), and gui_reset().
| int32_t dt_history_get_end | ( | const int32_t | imgid | ) |
read history_end from database for an image (main.images.history_end)
References _history_get_end_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_pthread_mutex_lock(), and dt_pthread_mutex_unlock().
Referenced by dt_dev_read_history_ext(), and dt_history_snapshot_undo_create().
| 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_free, 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_free, dt_free_gpointer(), dt_history_item_as_string(), dt_iop_get_localized_name(), dt_util_glist_to_str(), items, and name.
Referenced by _altered_enter(), and main().
| void dt_history_hash_set_mipmap | ( | const int32_t | imgid, |
| const uint64_t | history_hash, | ||
| const dt_image_cache_write_mode_t | mode | ||
| ) |
update mipmap hash in database from the provided image history hash
References darktable, dt_image_cache_get(), dt_image_cache_write_release(), darktable_t::image_cache, and dt_image_t::mipmap_hash.
Referenced by _generate_blocking(), dt_imageio_export_with_flags(), and dt_mipmap_cache_deallocate_dynamic().
| 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_free, dt_history_item_t::name, and dt_history_item_t::op.
Referenced by _gui_styles_dialog_run(), and dt_gui_hist_dialog_new().
| gboolean dt_history_set_end | ( | const int32_t | imgid, |
| const int32_t | history_end | ||
| ) |
write history_end to database for an image (main.images.history_end)
References _history_set_end_stmt, _history_stmt_mutex, _history_stmt_mutex_ensure(), darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and FALSE.
Referenced by _history_snapshot_undo_restore(), dt_add_hist(), dt_dev_write_history_ext(), dt_exif_xmp_read(), and dt_image_set_flip().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_get_autoapply_ioporder_params().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_foreach_auto_preset_row().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_foreach_auto_preset_row().
|
static |
Referenced by dt_history_check_module_exists(), and dt_history_cleanup().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_delete_history().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_delete_masks_history().
|
static |
Referenced by dt_history_cleanup(), and dt_history_get_end().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_get_next_history_num().
|
static |
Referenced by dt_history_cleanup().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_write_history_item().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_foreach_history_row().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_write_history_item().
|
static |
Referenced by dt_history_cleanup(), and dt_history_set_end().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_shift_history_nums().
|
static |
Referenced by _history_stmt_mutex_ensure(), dt_history_check_module_exists(), dt_history_cleanup(), dt_history_db_delete_history(), dt_history_db_delete_masks_history(), dt_history_db_foreach_auto_preset_row(), dt_history_db_foreach_history_row(), dt_history_db_get_autoapply_ioporder_params(), dt_history_db_get_next_history_num(), dt_history_db_shift_history_nums(), dt_history_db_write_history_item(), dt_history_get_end(), and dt_history_set_end().
|
static |
Referenced by _history_stmt_mutex_ensure().
|
static |
Referenced by dt_history_cleanup(), and dt_history_db_write_history_item().