![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/colorlabels.h"
#include "common/collection.h"
#include "common/darktable.h"
#include "common/debug.h"
#include "common/image_cache.h"
#include "common/undo.h"
#include "common/grouping.h"
#include "control/conf.h"
#include "control/control.h"
#include "gui/gtk.h"
#include <gdk/gdkkeysyms.h>
#include "bauhaus/bauhaus.h"
Data Structures | |
struct | dt_undo_colorlabels_t |
Typedefs | |
typedef struct dt_undo_colorlabels_t | dt_undo_colorlabels_t |
typedef enum dt_colorlabels_actions_t | dt_colorlabels_actions_t |
Enumerations | |
enum | dt_colorlabels_actions_t { DT_CA_SET = 0 , DT_CA_ADD , DT_CA_TOGGLE } |
Functions | |
char * | dt_colorlabels_get_name (const int label) |
int | dt_colorlabels_get_labels (const int32_t imgid) |
void | dt_colorlabels_set_labels (const int32_t imgid, const int colors) |
static void | _pop_undo_execute (const int32_t imgid, const int before, const int after) |
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 | _colorlabels_undo_data_free (gpointer data) |
void | dt_colorlabels_remove_labels (const int32_t imgid) |
void | dt_colorlabels_set_label (const int32_t imgid, const int color) |
void | dt_colorlabels_remove_label (const int32_t imgid, const int color) |
static void | _colorlabels_execute (GList *imgs, const int labels, GList **undo, const gboolean undo_on, int action) |
void | dt_colorlabels_toggle_label_on_list (GList *list, const int color, const gboolean undo_on) |
int | dt_colorlabels_check_label (const int32_t imgid, const int color) |
const char * | dt_colorlabels_to_string (int label) |
Variables | |
const char * | dt_colorlabels_name [] |
typedef enum dt_colorlabels_actions_t dt_colorlabels_actions_t |
typedef struct dt_undo_colorlabels_t dt_undo_colorlabels_t |
|
static |
References dt_undo_colorlabels_t::after, dt_undo_colorlabels_t::before, dt_image_t::color_labels, darktable, DT_CA_ADD, DT_CA_SET, DT_CA_TOGGLE, dt_image_cache_get(), dt_image_cache_read_release(), DT_IMAGE_CACHE_SAFE, dt_image_cache_write_release(), darktable_t::image_cache, and dt_undo_colorlabels_t::imgid.
Referenced by dt_colorlabels_toggle_label_on_list().
|
static |
Referenced by dt_colorlabels_toggle_label_on_list().
|
static |
|
static |
References dt_image_t::color_labels, darktable, dt_colorlabels_get_labels(), dt_image_cache_get(), DT_IMAGE_CACHE_SAFE, dt_image_cache_write_release(), and darktable_t::image_cache.
Referenced by _pop_undo().
int dt_colorlabels_check_label | ( | const int32_t | imgid, |
const int | color | ||
) |
check if an image has a color label
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by colorlabel_member().
int dt_colorlabels_get_labels | ( | const int32_t | imgid | ) |
get the assigned colorlabels of imgid
References colors, darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by _pop_undo_execute(), and dt_image_cache_allocate().
char * dt_colorlabels_get_name | ( | const int | label | ) |
Referenced by dt_colorlabels_toggle_label_on_list().
void dt_colorlabels_remove_label | ( | const int32_t | imgid, |
const int | color | ||
) |
remove a color label from imgid
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by colorlabel_member(), and dt_colorlabels_set_labels().
void dt_colorlabels_remove_labels | ( | const int32_t | imgid | ) |
remove labels associated to imgid
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by _exif_decode_xmp_data().
void dt_colorlabels_set_label | ( | const int32_t | imgid, |
const int | color | ||
) |
assign a color label to imgid - no undo no image group
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by _exif_decode_xmp_data(), colorlabel_member(), dt_colorlabels_set_labels(), and dt_lightroom_import().
void dt_colorlabels_set_labels | ( | const int32_t | imgid, |
const int | colors | ||
) |
save all assigned color labels from cached dt_image_t to database
References colors, dt_colorlabels_remove_label(), and dt_colorlabels_set_label().
Referenced by dt_image_cache_write_release().
const char * dt_colorlabels_to_string | ( | int | label | ) |
References DT_COLORLABELS_LAST, and dt_colorlabels_name.
Referenced by _get_base_value().
void dt_colorlabels_toggle_label_on_list | ( | GList * | list, |
const int | color, | ||
const gboolean | undo_on | ||
) |
assign a color label to the list of image
References _colorlabels_execute(), _colorlabels_undo_data_free(), _pop_undo(), darktable_t::collection, darktable, DT_CA_SET, DT_CA_TOGGLE, dt_collection_hint_message(), dt_colorlabels_get_name(), DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_IMAGE_INFO_CHANGED, dt_toast_log(), DT_UNDO_COLORLABELS, dt_undo_end_group(), dt_undo_record(), dt_undo_start_group(), darktable_t::signals, and darktable_t::undo.
Referenced by _color_label_callback(), and _colorlabels_callback().
const char* dt_colorlabels_name[] |
array with all names as strings, terminated by a NULL entry
Referenced by colorlabel_member(), dt_colorlabels_to_string(), and dt_lua_init_image().