![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/tags.h"
#include "common/collection.h"
#include "common/darktable.h"
#include "common/debug.h"
#include "common/grouping.h"
#include "common/selection.h"
#include "common/undo.h"
#include "control/conf.h"
#include "control/control.h"
#include <glib.h>
Data Structures | |
struct | dt_undo_tags_t |
Typedefs | |
typedef struct dt_undo_tags_t | dt_undo_tags_t |
typedef enum dt_tag_type_t | dt_tag_type_t |
typedef enum dt_tag_actions_t | dt_tag_actions_t |
Enumerations | |
enum | dt_tag_type_t { DT_TAG_TYPE_DT , DT_TAG_TYPE_USER , DT_TAG_TYPE_ALL } |
enum | dt_tag_actions_t { DT_TA_ATTACH = 0 , DT_TA_DETACH , DT_TA_SET , DT_TA_SET_ALL } |
Functions | |
static gchar * | _get_tb_removed_tag_string_values (GList *before, GList *after) |
static gchar * | _get_tb_added_tag_string_values (const int img, GList *before, GList *after) |
static void | _bulk_remove_tags (const int img, const gchar *tag_list) |
static void | _bulk_add_tags (const gchar *tag_list) |
static void | _pop_undo_execute (const int32_t imgid, GList *before, GList *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 | _undo_tags_free (gpointer data) |
static void | _tags_undo_data_free (gpointer data) |
gboolean | dt_tag_new (const char *name, guint *tagid) |
gboolean | dt_tag_new_from_gui (const char *name, guint *tagid) |
guint | dt_tag_remove (const guint tagid, gboolean final) |
void | dt_tag_delete_tag_batch (const char *flatlist) |
guint | dt_tag_remove_list (GList *tag_list) |
gchar * | dt_tag_get_name (const guint tagid) |
void | dt_tag_rename (const guint tagid, const gchar *new_tagname) |
gboolean | dt_tag_exists (const char *name, guint *tagid) |
static gboolean | _tag_add_tags_to_list (GList **list, const GList *tags) |
static gboolean | _tag_remove_tags_from_list (GList **list, const GList *tags) |
static GList * | _tag_get_tags (const int32_t imgid, const dt_tag_type_t type) |
static gboolean | _tag_execute (const GList *tags, const GList *imgs, GList **undo, const gboolean undo_on, const gint action) |
gboolean | dt_tag_attach_images (const guint tagid, const GList *img, const gboolean undo_on) |
gboolean | dt_tag_attach (const guint tagid, const int32_t imgid, const gboolean undo_on, const gboolean group_on) |
gboolean | dt_tag_set_tags (const GList *tags, const GList *img, const gboolean ignore_dt_tags, const gboolean clear_on, const gboolean undo_on) |
gboolean | dt_tag_attach_string_list (const gchar *tags, const GList *img, const gboolean undo_on) |
gboolean | dt_tag_detach_images (const guint tagid, const GList *img, const gboolean undo_on) |
gboolean | dt_tag_detach (const guint tagid, const int32_t imgid, const gboolean undo_on, const gboolean group_on) |
gboolean | dt_tag_detach_by_string (const char *name, const int32_t imgid, const gboolean undo_on, const gboolean group_on) |
void | dt_set_darktable_tags () |
uint32_t | dt_tag_get_attached (const int32_t imgid, GList **result, const gboolean ignore_dt_tags) |
static uint32_t | _tag_get_attached_export (const int32_t imgid, GList **result) |
static gint | sort_tag_by_path (gconstpointer a, gconstpointer b) |
static gint | sort_tag_by_leave (gconstpointer a, gconstpointer b) |
static gint | sort_tag_by_count (gconstpointer a, gconstpointer b) |
GList * | dt_sort_tag (GList *tags, gint sort_type) |
GList * | dt_tag_get_list (int32_t imgid) |
GList * | dt_tag_get_hierarchical (int32_t imgid) |
GList * | dt_tag_get_tags (const int32_t imgid, const gboolean ignore_dt_tags) |
static gint | _is_not_exportable_tag (gconstpointer a, gconstpointer b) |
GList * | dt_tag_get_list_export (int32_t imgid, int32_t flags) |
GList * | dt_tag_get_hierarchical_export (int32_t imgid, int32_t flags) |
gboolean | dt_is_tag_attached (const guint tagid, const int32_t imgid) |
GList * | dt_tag_get_images (const gint tagid) |
GList * | dt_tag_get_images_from_list (const GList *img, const gint tagid) |
uint32_t | dt_tag_get_suggestions (GList **result) |
void | dt_tag_count_tags_images (const gchar *keyword, int *tag_count, int *img_count) |
void | dt_tag_get_tags_images (const gchar *keyword, GList **tag_list, GList **img_list) |
uint32_t | dt_tag_images_count (gint tagid) |
uint32_t | dt_tag_get_with_usage (GList **result) |
static gchar * | dt_cleanup_synonyms (gchar *synonyms_entry) |
gchar * | dt_tag_get_synonyms (gint tagid) |
void | dt_tag_set_synonyms (gint tagid, gchar *synonyms_entry) |
gint | dt_tag_get_flags (gint tagid) |
void | dt_tag_set_flags (gint tagid, gint flags) |
void | dt_tag_add_synonym (gint tagid, gchar *synonym) |
static void | _free_result_item (gpointer data) |
void | dt_tag_free_result (GList **result) |
uint32_t | dt_tag_get_recent_used (GList **result) |
ssize_t | dt_tag_import (const char *filename) |
ssize_t | dt_tag_export (const char *filename) |
char * | dt_tag_get_subtags (const int32_t imgid, const char *category, const int level) |
gboolean | dt_tag_get_tag_order_by_id (const uint32_t tagid, uint32_t *sort, gboolean *descending) |
uint32_t | dt_tag_get_tag_id_by_name (const char *const name) |
void | dt_tag_set_tag_order_by_id (const uint32_t tagid, const uint32_t sort, const gboolean descending) |
typedef enum dt_tag_actions_t dt_tag_actions_t |
typedef enum dt_tag_type_t dt_tag_type_t |
typedef struct dt_undo_tags_t dt_undo_tags_t |
enum dt_tag_actions_t |
enum dt_tag_type_t |
|
static |
References darktable, darktable_t::db, dt_database_get(), and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by _pop_undo_execute().
|
static |
References darktable, darktable_t::db, dt_database_get(), and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by _pop_undo_execute().
|
static |
References dt_tag_t::synonym, and dt_tag_t::tag.
Referenced by dt_tag_free_result().
|
static |
References dt_util_dstrcat().
Referenced by _pop_undo_execute().
|
static |
References dt_util_dstrcat().
Referenced by _pop_undo_execute().
|
static |
References DT_TF_CATEGORY, DT_TF_PRIVATE, dt_tag_t::flags, and dt_tag_t::tag.
Referenced by dt_tag_get_list_export().
|
static |
References _pop_undo_execute(), dt_undo_tags_t::after, dt_undo_tags_t::before, darktable, DT_ACTION_UNDO, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_TAG_CHANGED, DT_UNDO_TAGS, dt_undo_tags_t::imgid, darktable_t::signals, and type.
Referenced by dt_tag_attach_images(), dt_tag_attach_string_list(), dt_tag_detach_images(), and dt_tag_set_tags().
|
static |
References _bulk_add_tags(), _bulk_remove_tags(), _get_tb_added_tag_string_values(), and _get_tb_removed_tag_string_values().
Referenced by _pop_undo(), and _tag_execute().
|
static |
Referenced by _tag_execute().
|
static |
References _pop_undo_execute(), _tag_add_tags_to_list(), _tag_get_tags(), _tag_remove_tags_from_list(), _undo_tags_free(), dt_undo_tags_t::after, dt_undo_tags_t::before, DT_TA_ATTACH, DT_TA_DETACH, DT_TA_SET, DT_TA_SET_ALL, DT_TAG_TYPE_ALL, DT_TAG_TYPE_DT, FALSE, dt_undo_tags_t::imgid, and TRUE.
Referenced by dt_tag_attach_images(), dt_tag_attach_string_list(), dt_tag_detach_images(), and dt_tag_set_tags().
|
static |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_tag_t::flags, dt_tag_t::id, dt_tag_t::leave, dt_tag_t::synonym, and dt_tag_t::tag.
Referenced by dt_tag_get_list_export().
|
static |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_PREPARE_V2, dt_selection_ids_to_string(), DT_TAG_TYPE_ALL, DT_TAG_TYPE_DT, darktable_t::selection, and type.
Referenced by _tag_execute(), and dt_tag_get_tags().
|
static |
Referenced by _tag_execute().
|
static |
References _undo_tags_free().
Referenced by dt_tag_attach_images(), dt_tag_attach_string_list(), dt_tag_detach_images(), and dt_tag_set_tags().
|
static |
References dt_undo_tags_t::after, and dt_undo_tags_t::before.
Referenced by _tag_execute(), and _tags_undo_data_free().
|
static |
References dt_util_dstrcat().
Referenced by dt_tag_set_synonyms().
gboolean dt_is_tag_attached | ( | const guint | tagid, |
const int32_t | imgid | ||
) |
check if a tag is attached to the given image
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by dt_tag_attach().
void dt_set_darktable_tags | ( | ) |
init the darktable tags table
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_EXEC, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by dt_init(), and dt_tag_delete_tag_batch().
GList * dt_sort_tag | ( | GList * | tags, |
gint | sort_type | ||
) |
References sort_tag_by_count(), sort_tag_by_leave(), and sort_tag_by_path().
Referenced by _init_treeview(), _locations_tree_update(), dt_tag_export(), and dt_tag_get_list_export().
void dt_tag_add_synonym | ( | gint | tagid, |
gchar * | synonym | ||
) |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_tag_get_synonyms(), and dt_util_dstrcat().
Referenced by dt_tag_import().
gboolean dt_tag_attach | ( | const guint | tagid, |
const int32_t | imgid, | ||
const gboolean | undo_on, | ||
const gboolean | group_on | ||
) |
attach a tag on images. tagid id of tag to attach. imgid the image id to attach tag to, if < 0 images to act on are used.
References dt_act_on_get_images(), dt_is_tag_attached(), dt_tag_attach_images(), FALSE, and UNKNOWN_IMAGE.
Referenced by _attach_selected_tag(), _exif_decode_exif_data(), _exif_decode_iptc_data(), _image_import_internal(), _lrop(), _pop_menu_attached_attach_to_all(), _print_job_run(), dt_control_export_job_run(), dt_control_local_copy_images_job_run(), dt_dev_append_changed_tag(), dt_imageio_set_hdr_tag(), dt_imageio_update_monochrome_workflow_tag(), dt_lua_tag_attach(), dt_map_location_update_images(), and dt_map_location_update_locations().
gboolean dt_tag_attach_images | ( | const guint | tagid, |
const GList * | img, | ||
const gboolean | undo_on | ||
) |
attach a tag on images list. tagid id of tag to attach. img the list of image id to attach tag to
References _pop_undo(), _tag_execute(), _tags_undo_data_free(), darktable, DT_TA_ATTACH, dt_undo_end_group(), dt_undo_record(), dt_undo_start_group(), DT_UNDO_TAGS, FALSE, and darktable_t::undo.
Referenced by _event_dnd_received(), and dt_tag_attach().
gboolean dt_tag_attach_string_list | ( | const gchar * | tags, |
const GList * | img, | ||
const gboolean | undo_on | ||
) |
attach a list of tags on list of images.
[in] | tags | a comma separated string of tags. |
[in] | img | the list of images to attach tag to. |
References _pop_undo(), _tag_execute(), _tags_undo_data_free(), darktable, DT_TA_ATTACH, dt_tag_new(), dt_undo_end_group(), dt_undo_record(), dt_undo_start_group(), DT_UNDO_TAGS, FALSE, and darktable_t::undo.
Referenced by _new_button_clicked().
void dt_tag_count_tags_images | ( | const gchar * | keyword, |
int * | tag_count, | ||
int * | img_count | ||
) |
retrieves count of tagged images.
[in] | keyword | the keyword to search |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_EXEC, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by _pop_menu_dictionary_change_path(), _pop_menu_dictionary_delete_node(), and _pop_menu_dictionary_edit_tag().
void dt_tag_delete_tag_batch | ( | const char * | flatlist | ) |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_PREPARE_V2, and dt_set_darktable_tags().
Referenced by dt_tag_remove_list().
gboolean dt_tag_detach | ( | const guint | tagid, |
const int32_t | imgid, | ||
const gboolean | undo_on, | ||
const gboolean | group_on | ||
) |
detach tag from images.
[in] | tagid | of tag to detach. |
[in] | imgid | the image id to detach tag from, if < 0 images to act on are used. |
References dt_act_on_get_images(), dt_grouping_add_grouped_images(), dt_tag_detach_images(), and UNKNOWN_IMAGE.
Referenced by dt_control_export_job_run(), dt_control_local_copy_images_job_run(), dt_lua_tag_detach(), dt_map_location_update_images(), dt_map_location_update_locations(), and dt_tag_detach_by_string().
gboolean dt_tag_detach_by_string | ( | const char * | name, |
const int32_t | imgid, | ||
const gboolean | undo_on, | ||
const gboolean | group_on | ||
) |
detach tags from images that matches name, it is valid to use % to match tag
References dt_tag_detach(), dt_tag_exists(), FALSE, and name.
Referenced by _image_duplicate_with_version(), dt_history_delete_on_image_ext(), and dt_imageio_update_monochrome_workflow_tag().
gboolean dt_tag_detach_images | ( | const guint | tagid, |
const GList * | img, | ||
const gboolean | undo_on | ||
) |
detach tag from images.
[in] | tagid | of tag to detach. |
[in] | img | the list of image id to detach tag from |
References _pop_undo(), _tag_execute(), _tags_undo_data_free(), darktable, DT_TA_DETACH, dt_undo_end_group(), dt_undo_record(), dt_undo_start_group(), DT_UNDO_TAGS, FALSE, and darktable_t::undo.
Referenced by _detach_selected_tag(), and dt_tag_detach().
gboolean dt_tag_exists | ( | const char * | name, |
guint * | tagid | ||
) |
checks if tag exists.
[in] | name | of tag to check. |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, name, and TRUE.
Referenced by _apply_rename_path(), _lrop(), _pop_menu_dictionary_create_tag(), _pop_menu_dictionary_edit_tag(), dt_map_location_name_exists(), dt_tag_detach_by_string(), dt_tag_rename(), and tag_lib_find().
ssize_t dt_tag_export | ( | const char * | filename | ) |
References dt_sort_tag(), dt_tag_free_result(), dt_tag_get_with_usage(), DT_TF_CATEGORY, and flags.
Referenced by _export_button_clicked().
void dt_tag_free_result | ( | GList ** | result | ) |
frees the memory of a result set.
References _free_result_item().
Referenced by _apply_rename_path(), _init_treeview(), _metadata_view_update_values(), _pop_menu_dictionary_delete_node(), _pop_menu_dictionary_edit_tag(), _update_sel_on_tree(), dt_tag_export(), dt_tag_get_hierarchical(), dt_tag_get_hierarchical_export(), dt_tag_get_list(), dt_tag_get_list_export(), and get_params().
uint32_t dt_tag_get_attached | ( | const int32_t | imgid, |
GList ** | result, | ||
const gboolean | ignore_dt_tags | ||
) |
retrieves a list of tags of specified imgid
[out] | result | a list of dt_tag_t, sorted by tag. |
References dt_tag_t::count, darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_PREPARE_V2, dt_selection_get_length(), dt_selection_ids_to_string(), DT_TS_ALL_IMAGES, DT_TS_NO_IMAGE, DT_TS_SOME_IMAGES, dt_tag_t::flags, dt_tag_t::id, dt_tag_t::leave, dt_tag_t::select, darktable_t::selection, dt_tag_t::synonym, and dt_tag_t::tag.
Referenced by _init_treeview(), _metadata_view_update_values(), _update_sel_on_tree(), dt_tag_get_hierarchical(), dt_tag_get_hierarchical_export(), dt_tag_get_list(), and get_params().
gint dt_tag_get_flags | ( | gint | tagid | ) |
retrieves flags of the tag
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and flags.
Referenced by _pop_menu_dictionary_edit_tag().
GList * dt_tag_get_hierarchical | ( | int32_t | imgid | ) |
get a flat list of only hierarchical tags, the difference to dt_tag_get_attached() is that this one filters out the "darktable|" tags.
References dt_tag_free_result(), dt_tag_get_attached(), dt_tag_t::tag, and TRUE.
Referenced by _exif_xmp_read_data().
GList * dt_tag_get_hierarchical_export | ( | int32_t | imgid, |
int32_t | flags | ||
) |
get a flat list of only hierarchical tags, the difference to dt_tag_get_hierarchical() is that this one checks option for exportation
References DT_META_PRIVATE_TAG, dt_tag_free_result(), dt_tag_get_attached(), DT_TF_PRIVATE, flags, dt_tag_t::flags, dt_tag_t::tag, and TRUE.
Referenced by _exif_xmp_read_data_export().
GList * dt_tag_get_images | ( | const gint | tagid | ) |
get the subset of images that have a given tag attached
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by dt_map_location_update_images().
GList * dt_tag_get_images_from_list | ( | const GList * | img, |
const gint | tagid | ||
) |
get the subset of images from the given list that have a given tag attached
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_PREPARE_V2, and dt_util_dstrcat().
Referenced by _detach_selected_tag().
GList * dt_tag_get_list | ( | int32_t | imgid | ) |
get a list of tags, the difference to dt_tag_get_attached() is that this one splits at '|' and filters out the "darktable|" tags.
References dt_conf_get_bool(), dt_tag_free_result(), dt_tag_get_attached(), dt_util_glist_uniq(), dt_tag_t::tag, and TRUE.
Referenced by _exif_xmp_read_data().
GList * dt_tag_get_list_export | ( | int32_t | imgid, |
int32_t | flags | ||
) |
get a list of tags, the difference to dt_tag_get_list() is that this one checks option for exportation
References _is_not_exportable_tag(), _tag_get_attached_export(), DT_META_OMIT_HIERARCHY, DT_META_PRIVATE_TAG, DT_META_SYNONYMS_TAG, dt_sort_tag(), dt_tag_free_result(), DT_TF_CATEGORY, DT_TF_PRIVATE, dt_util_glist_uniq(), flags, dt_tag_t::flags, dt_tag_t::leave, dt_tag_t::synonym, and dt_tag_t::tag.
Referenced by _exif_xmp_read_data_export(), _get_base_value(), and store().
gchar * dt_tag_get_name | ( | const guint | tagid | ) |
get the name of specified id
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and name.
Referenced by _attach_selected_tag(), _pop_menu_attached_attach_to_all(), dt_map_location_delete(), dt_map_location_rename(), tag_name(), and tag_tostring().
uint32_t dt_tag_get_recent_used | ( | GList ** | result | ) |
retrieves a list of recent tags used.
[out] | result | a pointer to list populated with result. |
char * dt_tag_get_subtags | ( | const int32_t | imgid, |
const char * | category, | ||
const int | level | ||
) |
retrieves the subtags of requested level for the requested category
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_util_dstrcat(), dt_util_string_count_char(), FALSE, and TRUE.
Referenced by _get_base_value().
uint32_t dt_tag_get_suggestions | ( | GList ** | result | ) |
retrieves a list of suggested tags matching keyword.
[in] | keyword | the keyword to search |
[out] | result | a pointer to list populated with result. |
References dt_tag_t::count, darktable, darktable_t::db, dt_conf_get_int(), dt_conf_get_string_const(), dt_database_get(), DT_DEBUG_SQLITE3_EXEC, DT_DEBUG_SQLITE3_PREPARE_V2, dt_selection_get_length(), DT_TS_ALL_IMAGES, DT_TS_NO_IMAGE, DT_TS_SOME_IMAGES, dt_tag_t::flags, dt_tag_t::id, dt_tag_t::leave, dt_tag_t::select, darktable_t::selection, dt_tag_t::synonym, and dt_tag_t::tag.
Referenced by _init_treeview().
gchar * dt_tag_get_synonyms | ( | gint | tagid | ) |
retrieves synonyms of the tag
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by dt_tag_add_synonym().
uint32_t dt_tag_get_tag_id_by_name | ( | const char *const | name | ) |
return the tagid of that tag - follow tag sensitivity - return 0 if not found
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, and name.
Referenced by row_activated_with_event().
gboolean dt_tag_get_tag_order_by_id | ( | const uint32_t | tagid, |
uint32_t * | sort, | ||
gboolean * | descending | ||
) |
return the images order associated to that tag
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, DT_TF_DESCENDING, DT_TF_ORDER_SET, FALSE, flags, and TRUE.
Referenced by row_activated_with_event().
GList * dt_tag_get_tags | ( | const int32_t | imgid, |
const gboolean | ignore_dt_tags | ||
) |
get a flat list of tags id attached to image id
References _tag_get_tags(), DT_TAG_TYPE_ALL, and DT_TAG_TYPE_USER.
void dt_tag_get_tags_images | ( | const gchar * | keyword, |
GList ** | tag_list, | ||
GList ** | img_list | ||
) |
retrieves list of tags and tagged images.
[in] | keyword | the keyword to search. |
[out] | result | pointers to list populated with result. |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_EXEC, DT_DEBUG_SQLITE3_PREPARE_V2, dt_tag_t::id, and dt_tag_t::tag.
Referenced by _apply_rename_path(), _pop_menu_dictionary_delete_node(), and _pop_menu_dictionary_edit_tag().
uint32_t dt_tag_get_with_usage | ( | GList ** | result | ) |
retrieves the list of tags matching keyword.
[in] | keyword | the keyword to search |
[out] | result | a pointer to list populated with result. |
References dt_tag_t::count, darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_EXEC, DT_DEBUG_SQLITE3_PREPARE_V2, dt_selection_get_length(), DT_TS_ALL_IMAGES, DT_TS_NO_IMAGE, DT_TS_SOME_IMAGES, dt_tag_t::flags, dt_tag_t::id, dt_tag_t::leave, dt_tag_t::select, darktable_t::selection, dt_tag_t::synonym, and dt_tag_t::tag.
Referenced by _init_treeview(), and dt_tag_export().
uint32_t dt_tag_images_count | ( | gint | tagid | ) |
get number of images affected with that tag
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by _attach_selected_tag(), _detach_selected_tag(), _pop_menu_attached_attach_to_all(), and _update_attached_count().
ssize_t dt_tag_import | ( | const char * | filename | ) |
References darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_TAG_CHANGED, dt_tag_add_synonym(), dt_tag_new(), dt_tag_rename(), dt_tag_set_flags(), dt_tag_set_synonyms(), DT_TF_CATEGORY, dt_util_glist_to_str(), FALSE, getline(), darktable_t::signals, and TRUE.
Referenced by _import_button_clicked().
gboolean dt_tag_new | ( | const char * | name, |
guint * | tagid | ||
) |
creates a new tag, returns tagid
[in] | name | the tag name. |
[in] | tagid | a pointer to tagid of new tag, this can be NULL |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, name, and TRUE.
Referenced by _exif_decode_exif_data(), _exif_decode_iptc_data(), _image_import_internal(), _lrop(), _pop_menu_dictionary_create_tag(), _pop_menu_dictionary_set_as_tag(), _print_job_run(), dt_control_export_job_run(), dt_control_local_copy_images_job_run(), dt_dev_append_changed_tag(), dt_imageio_set_hdr_tag(), dt_imageio_update_monochrome_workflow_tag(), dt_map_location_new(), dt_tag_attach_string_list(), dt_tag_import(), and dt_tag_new_from_gui().
gboolean dt_tag_new_from_gui | ( | const char * | name, |
guint * | tagid | ||
) |
creates a new tag, returns tagid
[in] | name | the tag name. |
[in] | tagid | a pointer to tagid of new tag, this can be NULL |
References darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_TAG_CHANGED, dt_tag_new(), name, and darktable_t::signals.
Referenced by tag_lib_create().
guint dt_tag_remove | ( | const guint | tagid, |
gboolean | final | ||
) |
removes a tag from db and from assigned images.
final | TRUE actually performs the remove |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and TRUE.
Referenced by _pop_menu_dictionary_delete_tag(), dt_map_location_delete(), and tag_delete().
guint dt_tag_remove_list | ( | GList * | tag_list | ) |
removes a list of tags from db and from assigned images.
References dt_tag_delete_tag_batch(), and dt_util_dstrcat().
Referenced by _pop_menu_dictionary_delete_node().
void dt_tag_rename | ( | const guint | tagid, |
const gchar * | new_tagname | ||
) |
set the name of specified id
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, and dt_tag_exists().
Referenced by _apply_rename_path(), _pop_menu_dictionary_edit_tag(), dt_map_location_rename(), and dt_tag_import().
void dt_tag_set_flags | ( | gint | tagid, |
gint | flags | ||
) |
sets flags of the tag
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and flags.
Referenced by _pop_menu_dictionary_create_tag(), _pop_menu_dictionary_edit_tag(), and dt_tag_import().
void dt_tag_set_synonyms | ( | gint | tagid, |
gchar * | synonyms | ||
) |
sets synonyms of the tag
References darktable, darktable_t::db, dt_cleanup_synonyms(), dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by _pop_menu_dictionary_create_tag(), _pop_menu_dictionary_edit_tag(), and dt_tag_import().
void dt_tag_set_tag_order_by_id | ( | const uint32_t | tagid, |
const uint32_t | sort, | ||
const gboolean | descending | ||
) |
save the images order on the tag
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, DT_TF_ALL, DT_TF_DESCENDING, DT_TF_ORDER_SET, and flags.
Referenced by _lib_filter_set_tag_order(), and row_activated_with_event().
gboolean dt_tag_set_tags | ( | const GList * | tags, |
const GList * | img, | ||
const gboolean | ignore_dt_tags, | ||
const gboolean | clear_on, | ||
const gboolean | undo_on | ||
) |
attach a list of tags on selected images.
[in] | tags | a list of ids of tags. |
[in] | imgid | the image id to attach tag to, if < 0 selected images are used. |
References _pop_undo(), _tag_execute(), _tags_undo_data_free(), darktable, DT_TA_ATTACH, DT_TA_SET, DT_TA_SET_ALL, dt_undo_end_group(), dt_undo_record(), dt_undo_start_group(), DT_UNDO_TAGS, FALSE, and darktable_t::undo.
Referenced by _exif_decode_xmp_data(), and set_params().
|
static |
References dt_tag_t::count.
Referenced by dt_sort_tag().
|
static |
References dt_tag_t::leave.
Referenced by dt_sort_tag().
|
static |
References dt_tag_t::tag.
Referenced by dt_sort_tag().