![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "metadata/colorlabels.h"#include "metadata/notify.h"#include "common/collection.h"#include "system/macros.h"#include "database/colorlabel_repository.h"#include "caches/image_cache.h"#include "common/undo.h"
Include dependency graph for colorlabels.c:Go to the source code of this file.
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) |
| void | dt_colorlabels_cleanup (void) |
| static int | _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 |
| Enumerator | |
|---|---|
| DT_CA_SET | |
| DT_CA_ADD | |
| DT_CA_TOGGLE | |
Definition at line 161 of file colorlabels.c.
|
static |
Definition at line 171 of file colorlabels.c.
References dt_undo_colorlabels_t::after, dt_undo_colorlabels_t::before, dt_image_t::color_labels, 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(), dt_undo_colorlabels_t::imgid, and IS_NULL_PTR.
Referenced by dt_colorlabels_toggle_label_on_list().
|
static |
Definition at line 134 of file colorlabels.c.
Referenced by dt_colorlabels_toggle_label_on_list().
|
static |
Definition at line 117 of file colorlabels.c.
References _pop_undo_execute(), dt_undo_colorlabels_t::after, dt_undo_colorlabels_t::before, DT_ACTION_UNDO, dt_collection_get_global(), dt_collection_hint_message(), DT_UNDO_COLORLABELS, dt_undo_colorlabels_t::imgid, and type.
Referenced by dt_colorlabels_toggle_label_on_list().
|
static |
Definition at line 95 of file colorlabels.c.
References color, dt_image_t::color_labels, dt_colorlabels_get_labels(), dt_image_cache_get(), DT_IMAGE_CACHE_SAFE, dt_image_cache_write_release(), and IS_NULL_PTR.
Referenced by _pop_undo().
| int dt_colorlabels_check_label | ( | const int32_t | imgid, |
| const int | color | ||
| ) |
check if an image has a color label
Definition at line 274 of file colorlabels.c.
References color, and dt_colorlabel_repository_has().
cleanup cached statements
Definition at line 156 of file colorlabels.c.
References dt_colorlabel_repository_cleanup().
Referenced by dt_cleanup().
| int dt_colorlabels_get_labels | ( | const int32_t | imgid | ) |
get the assigned colorlabels of imgid
Definition at line 79 of file colorlabels.c.
References dt_colorlabel_repository_get().
Referenced by _pop_undo_execute().
| char * dt_colorlabels_get_name | ( | const int | label | ) |
Definition at line 51 of file colorlabels.c.
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
Definition at line 151 of file colorlabels.c.
References color, and dt_colorlabel_repository_remove().
Referenced by dt_colorlabels_set_labels().
| void dt_colorlabels_remove_labels | ( | const int32_t | imgid | ) |
remove labels associated to imgid
Definition at line 141 of file colorlabels.c.
References dt_colorlabel_repository_remove_all().
Referenced by dt_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
Definition at line 146 of file colorlabels.c.
References color, and dt_colorlabel_repository_set().
Referenced by dt_colorlabels_set_labels(), dt_exif_decode_xmp_data(), 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
Definition at line 84 of file colorlabels.c.
References color, colors, dt_colorlabels_remove_label(), and dt_colorlabels_set_label().
| const char * dt_colorlabels_to_string | ( | int | label | ) |
Definition at line 280 of file colorlabels.c.
References DT_COLORLABELS_LAST, and dt_colorlabels_name.
Referenced by _expand_rating_and_metadata().
| 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
Definition at line 237 of file colorlabels.c.
References _colorlabels_execute(), _colorlabels_undo_data_free(), _pop_undo(), color, DT_CA_ADD, DT_CA_SET, DT_CA_TOGGLE, dt_collection_get_global(), dt_collection_hint_message(), dt_colorlabels_get_name(), DT_METADATA_NOTICE_TOAST, dt_metadata_notify(), DT_UNDO_COLORLABELS, dt_undo_end_group(), dt_undo_get_global(), dt_undo_record(), and dt_undo_start_group().
Referenced by _color_label_callback(), and _colorlabels_callback().
| const char* dt_colorlabels_name[] |
array with all names as strings, terminated by a NULL entry
Definition at line 46 of file colorlabels.c.
Referenced by dt_colorlabels_to_string().