42#include <glib/gstdio.h>
95 " (SELECT (IFNULL(MAX(position),0) & 0xFFFFFFFF00000000) + (1 << 32)"
96 " FROM main.tagged_images)"
220 const guint tagid = ((
dt_tag_t *)taglist->data)->id;
538 t->leave =
t->leave ?
t->leave + 1 :
t->tag;
539 const uint32_t
imgnb =
t->count;
553 if(!(imgid > 0))
return 0;
563 t->leave =
t->leave ?
t->leave + 1 :
t->tag;
604 gchar *tag = ((
dt_tag_t *)taglist->data)->tag;
611 gchar *tag = ((
dt_tag_t *)taglist->data)->tag;
632 if(count < 1)
return NULL;
674 if(count < 1)
return NULL;
731 if(count < 1)
return NULL;
750 gchar *tagname =
t->leave;
766 const gchar *tag = end ? end + 1 :
t->tag;
775 gchar *synonyms =
t->synonym;
776 if (synonyms && synonyms[0])
807 if(count < 1)
return NULL;
845 images[
strlen(images) - 1] =
'\0';
866 t->leave =
t->leave ?
t->leave + 1 :
t->tag;
901 t->leave =
t->leave ?
t->leave + 1 :
t->tag;
919 t->leave =
t->leave ?
t->leave + 1 :
t->tag;
930 gchar *synonyms =
NULL;
950 synonyms[
strlen(synonyms) - 2] =
'\0';
1005 if(result && *result)
1039 while(
getline(&line, &len, fd) != -1)
1043 while(*start ==
'\t' || *start ==
' ' || *start ==
',' || *start ==
';') start++;
1044 const int depth = start - line;
1046 char *end = line +
strlen(line) - 1;
1047 while((*end ==
'\n' || *end ==
'\r' || *end ==
',' || *end ==
';') && end >= start)
1057 gboolean synonym =
FALSE;
1058 if (*start ==
'[' && *end ==
']')
1064 else if (*start ==
'{' && *end ==
'}')
1192 for(
int j = 0;
j < tabs;
j++)
fputc(
'\t', fd);
1200 if (synonyms && synonyms[0])
1210 for(
int j = 0;
j < tabs+1;
j++)
fputc(
'\t', fd);
1241 const char *tag = (
const char *)l->data;
1247 gboolean valid =
TRUE;
1267 gboolean *descending)
1289 const gboolean descending)
GList * dt_act_on_get_images()
static const dt_adaptation_t kind
int dt_conf_get_bool(const char *name)
int dt_conf_get_int(const char *name)
Integer for name, clamped to the bounds declared in the XML.
const char * dt_conf_get_string_const(const char *name)
Borrow the stored string for name without copying it.
GHashTable * names
GtkWidget* -> the name the application knows it by.
ssize_t getline(char **lineptr, size_t *n, FILE *stream)
void dt_grouping_add_grouped_images(GList **images)
_lib_location_type_t type
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
static void dt_free_gpointer(gpointer ptr)
g_free() one pointer, with the signature GDestroyNotify wants.
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
dt_mipmap_buffer_dsc_flags flags
struct dt_selection_t * dt_selection_get_global(void)
gchar * dt_selection_ids_to_string(struct dt_selection_t *selection)
int dt_selection_get_length(struct dt_selection_t *selection)
static const dt_aligned_pixel_simd_t value
void dt_tag_repository_delete_batch(const char *id_list)
Delete every tag in id_list and its attachments.
void dt_tag_repository_rename(const guint tagid, const char *new_name)
Rename tagid. The caller checks first that the new name is free.
GList * dt_tag_repository_get_with_usage(const uint32_t nb_selected)
Every user tag with how often it is used and how much of the selection carries it.
GList * dt_tag_repository_get_collection_tags(void)
User tags attached to at least one image of the current collection, by name.
gchar * dt_tag_repository_get_name(const guint tagid)
The name of tagid, newly allocated, or NULL.
int dt_tag_repository_count_attachments(const guint tagid)
How many attachment ROWS tagid has, or -1 if the count could not be read. See dt_tag_repository_count...
GList * dt_tag_repository_get_images(const guint tagid)
Images carrying tagid, GINT_TO_POINTER. Free with g_list_free().
GList * dt_tag_repository_get_suggestions(const uint32_t nb_selected, const int confidence, const char *recent_tags, const int nb_recent)
Tags worth suggesting for the current selection.
GList * dt_tag_repository_get_ids_for_images(const char *imgid_list, const dt_tag_kind_t kind)
Ids of the tags on a set of images, optionally restricted by kind.
void dt_tag_repository_mark_internal(const guint tagid)
Record tagid as an internal tag.
void dt_tag_repository_get_similar(const char *keyword, GList **tags, GList **imgids)
The tags matching keyword and the images carrying any of them.
guint dt_tag_repository_find_by_name(const char *name)
The id of the tag named name, or 0 when there is none.
GList * dt_tag_repository_get_attached_for_export(const int32_t imgid)
Tags attached to imgid for export, plus every ancestor on their paths.
GList * dt_tag_repository_get_names_under(const int32_t imgid, const char *category)
Names of the tags on imgid that start with category.
guint dt_tag_repository_find_by_name_nocase(const char *name)
The id of the tag whose name matches name case-INSENSITIVELY, or 0.
gint dt_tag_repository_get_flags(const guint tagid)
The flags word of tagid, or 0.
void dt_tag_repository_update_flags(const guint tagid, const gint set, const gint keep_mask)
Set the bits in set and clear those absent from keep_mask: flags = (IFNULL(flags,0) & keep_mask) | se...
void dt_tag_repository_count_similar(const char *keyword, int *tag_count, int *img_count)
How many tags match keyword, and how many images carry any of them.
GList * dt_tag_repository_get_images_in_list(const guint tagid, const char *imgid_list)
Images carrying tagid, restricted to imgid_list – a comma-separated list of decimal image ids compose...
void dt_tag_repository_delete(const guint tagid)
Delete tagid, its attachments, and its memory.darktable_tags entry.
void dt_tag_repository_cleanup(void)
Finalise whatever this repository still caches – today, nothing. See dt_colorlabel_repository_cleanup...
void dt_tag_repository_attach_batch(const char *values)
Attach rows given as the VALUES clause of the insert – "(imgid,tagid,pos),…". The position expression...
gchar * dt_tag_repository_get_synonyms(const guint tagid)
The synonyms of tagid, newly allocated, or NULL.
void dt_tag_repository_set_synonyms(const guint tagid, const char *synonyms)
Replace the synonyms of tagid.
void dt_tag_repository_rebuild_internal(void)
Rebuild the whole internal-tag cache from data.tags.
uint32_t dt_tag_repository_count_distinct_images(const guint tagid)
Distinct images carrying tagid.
void dt_tag_repository_set_flags(const guint tagid, const gint flags)
Replace the flags word of tagid.
gboolean dt_tag_repository_is_attached(const guint tagid, const int32_t imgid)
TRUE when tagid is attached to imgid.
void dt_tag_repository_detach_batch(const int32_t imgid, const char *tagid_list)
Detach every tag in tagid_list from imgid.
GList * dt_tag_repository_get_attached(const int32_t imgid, const gboolean ignore_internal)
Tags attached to one image or to the current selection, ordered by name.
guint dt_tag_repository_insert(const char *name)
Insert a tag named name and return its new id, or 0 on failure.
data.tags and main.tagged_images.
void dt_undo_end_group(dt_undo_t *self)
void dt_undo_start_group(dt_undo_t *self, dt_undo_type_t type)
void dt_undo_record(dt_undo_t *self, gpointer user_data, dt_undo_type_t type, dt_undo_data_t data, void(*undo)(gpointer user_data, dt_undo_type_t type, dt_undo_data_t item, dt_undo_action_t action, GList **imgs), void(*free_data)(gpointer data))
dt_undo_t * dt_undo_get_global(void)
guint dt_util_string_count_char(const char *text, const char needle)
gchar * dt_util_glist_to_str(const gchar *separator, GList *items)
gchar * dt_util_dstrcat(gchar *str, const gchar *format,...)
GList * dt_util_glist_uniq(GList *items)