Ansel
0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
tags.h
Go to the documentation of this file.
1
/*
2
This file is part of darktable,
3
Copyright (C) 2010-2011 Henrik Andersson.
4
Copyright (C) 2010-2012 johannes hanika.
5
Copyright (C) 2010 Pascal de Bruijn.
6
Copyright (C) 2012 Ivan Tarozzi.
7
Copyright (C) 2012 José Carlos García Sogo.
8
Copyright (C) 2012 Richard Wonka.
9
Copyright (C) 2012-2013 Simon Spannagel.
10
Copyright (C) 2012, 2014, 2016-2017 Tobias Ellinghaus.
11
Copyright (C) 2013 Dennis Gnad.
12
Copyright (C) 2013 Jérémy Rosen.
13
Copyright (C) 2016 Roman Lebedev.
14
Copyright (C) 2017, 2019, 2021 luzpaz.
15
Copyright (C) 2019 Edgardo Hoszowski.
16
Copyright (C) 2019-2021 Philippe Weyland.
17
Copyright (C) 2020 Aldric Renaudin.
18
Copyright (C) 2020-2021 Pascal Obry.
19
Copyright (C) 2021 Hubert Kowalski.
20
Copyright (C) 2022 Martin Bařinka.
21
Copyright (C) 2022 Miloš Komarčević.
22
Copyright (C) 2025 Alynx Zhou.
23
Copyright (C) 2025-2026 Aurélien PIERRE.
24
25
darktable is free software: you can redistribute it and/or modify
26
it under the terms of the GNU General Public License as published by
27
the Free Software Foundation, either version 3 of the License, or
28
(at your option) any later version.
29
30
darktable is distributed in the hope that it will be useful,
31
but WITHOUT ANY WARRANTY; without even the implied warranty of
32
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33
GNU General Public License for more details.
34
35
You should have received a copy of the GNU General Public License
36
along with darktable. If not, see <http://www.gnu.org/licenses/>.
37
*/
38
39
#ifndef DT_METADATA_TAGS_H
40
#define DT_METADATA_TAGS_H
41
42
#include <glib.h>
43
#include <sqlite3.h>
44
#include <stdint.h>
45
46
#ifdef __cplusplus
47
extern
"C"
{
48
#endif
49
50
typedef
struct
dt_tag_t
51
{
52
guint
id
;
53
gchar *
tag
;
54
gchar *
leave
;
55
gchar *
synonym
;
56
guint
count
;
57
guint
select
;
58
gint
flags
;
59
}
dt_tag_t
;
60
61
typedef
enum
dt_tag_flags_t
62
{
63
DT_TF_NONE
= 0,
64
DT_TF_CATEGORY
= 1 << 0,
// this tag (or path) is not a keyword to be exported
65
DT_TF_PRIVATE
= 1 << 1,
// this tag is private. Will be exported only on demand
66
DT_TF_ORDER_SET
= 1 << 2,
// set if the tag has got an images order
67
DT_TF_DESCENDING
= 1U << 31,
68
}
dt_tag_flags_t
;
69
70
#define DT_TF_ALL (DT_TF_CATEGORY | DT_TF_PRIVATE | DT_TF_ORDER_SET)
71
72
typedef
enum
dt_tag_selection_t
73
{
74
DT_TS_NO_IMAGE
= 0,
// no selection or no tag not attached
75
DT_TS_SOME_IMAGES
,
// tag attached on some selected images
76
DT_TS_ALL_IMAGES
// tag attached on all selected images
77
}
dt_tag_selection_t
;
78
82
gboolean
dt_tag_new
(
const
char
*
name
, guint *tagid);
83
88
gboolean
dt_tag_new_from_gui
(
const
char
*
name
, guint *tagid);
89
90
// read/import tags from a txt file as written by Lightroom. returns the number of imported tags
91
// or -1 if an error occurred.
92
uint32_t
dt_tag_import
(
const
char
*filename);
93
94
// export all tags to a txt file as written by Lightroom. returns the number of exported tags
95
// or -1 if an error occurred.
96
uint32_t
dt_tag_export
(
const
char
*filename);
97
99
gchar *
dt_tag_get_name
(
const
guint tagid);
100
103
guint
dt_tag_remove
(
const
guint tagid, gboolean
final
);
104
106
guint
dt_tag_remove_list
(
GList
*
tag_list
);
107
109
void
dt_tag_rename
(
const
guint tagid,
const
gchar *
new_tagname
);
110
112
gboolean
dt_tag_exists
(
const
char
*
name
, guint *tagid);
113
116
gboolean
dt_tag_attach_images
(
const
guint tagid,
const
GList
*img,
const
gboolean
undo_on
);
119
gboolean
dt_tag_attach
(
const
guint tagid,
const
int32_t imgid,
const
gboolean
undo_on
,
const
gboolean
group_on
);
120
122
gboolean
dt_is_tag_attached
(
const
guint tagid,
const
int32_t imgid);
123
127
gboolean
dt_tag_set_tags
(
const
GList
*
tags
,
const
GList
*img,
const
gboolean
ignore_dt_tags
,
128
const
gboolean
clear_on
,
const
gboolean
undo_on
);
129
132
gboolean
dt_tag_attach_string_list
(
const
gchar *
tags
,
const
GList
*img,
const
gboolean
undo_on
);
133
136
gboolean
dt_tag_detach_images
(
const
guint tagid,
const
GList
*img,
const
gboolean
undo_on
);
139
gboolean
dt_tag_detach
(
const
guint tagid,
const
int32_t imgid,
const
gboolean
undo_on
,
const
gboolean
group_on
);
140
142
gboolean
dt_tag_detach_by_string
(
const
char
*
name
,
const
int32_t imgid,
const
gboolean
undo_on
,
143
const
gboolean
group_on
);
144
146
uint32_t
dt_tag_get_attached
(
const
int32_t imgid,
GList
**result,
const
gboolean
ignore_dt_tags
);
147
149
GList
*
dt_sort_tag
(
GList
*
tags
, gboolean
byname
);
150
154
GList
*
dt_tag_get_list
(int32_t imgid);
155
158
GList
*
dt_tag_get_list_export
(int32_t imgid, int32_t
flags
);
159
162
GList
*
dt_tag_get_hierarchical
(int32_t imgid);
163
166
GList
*
dt_tag_get_hierarchical_export
(int32_t imgid, int32_t
flags
);
167
169
GList
*
dt_tag_get_tags
(
const
int32_t imgid,
const
gboolean
ignore_dt_tags
);
170
172
GList
*
dt_tag_get_images
(
const
gint tagid);
173
175
GList
*
dt_tag_get_images_from_list
(
const
GList
*img,
const
gint tagid);
176
180
uint32_t
dt_tag_get_suggestions
(
GList
**result);
181
184
void
dt_tag_count_tags_images
(
const
gchar *keyword,
int
*
tag_count
,
int
*
img_count
);
185
188
void
dt_tag_get_tags_images
(
const
gchar *keyword,
GList
**
tag_list
,
GList
**
img_list
);
189
193
uint32_t
dt_tag_get_with_usage
(
GList
**result);
194
199
uint32_t
dt_tag_get_collection_tags
(
GList
**result);
200
202
gchar *
dt_tag_get_synonyms
(gint tagid);
203
205
void
dt_tag_set_synonyms
(gint tagid, gchar *synonyms);
206
208
gint
dt_tag_get_flags
(gint tagid);
209
211
void
dt_tag_set_flags
(gint tagid, gint
flags
);
212
215
uint32_t
dt_tag_get_recent_used
(
GList
**result);
216
218
void
dt_tag_free_result
(
GList
**result);
219
221
uint32_t
dt_tag_images_count
(gint tagid);
222
224
char
*
dt_tag_get_subtags
(
const
int32_t imgid,
const
char
*
category
,
const
int
level);
225
227
gboolean
dt_tag_get_tag_order_by_id
(
const
uint32_t tagid, uint32_t *sort,
228
gboolean *descending);
229
231
void
dt_tag_set_tag_order_by_id
(
const
uint32_t tagid,
const
uint32_t sort,
232
const
gboolean descending);
233
235
uint32_t
dt_tag_get_tag_id_by_name
(
const
char
*
const
name
);
236
238
void
dt_set_darktable_tags
();
239
241
void
dt_tags_cleanup
(
void
);
242
243
#ifdef __cplusplus
244
}
245
#endif
246
247
#endif
// DT_METADATA_TAGS_H
248
249
// clang-format off
250
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
251
// vim: shiftwidth=2 expandtab tabstop=2 cindent
252
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
253
// clang-format on
L
const float L
Definition
colorspaces_inline_conversions.h:494
flags
dt_mipmap_buffer_dsc_flags flags
Definition
mipmap_cache.c:4
name
const char * name
Definition
pdf.h:90
dt_tag_t
Definition
tags.h:51
dt_tag_t::synonym
gchar * synonym
Definition
tags.h:55
dt_tag_t::tag
gchar * tag
Definition
tags.h:53
dt_tag_t::id
guint id
Definition
tags.h:52
dt_tag_t::count
guint count
Definition
tags.h:56
dt_tag_t::leave
gchar * leave
Definition
tags.h:54
dt_tag_t::select
guint select
Definition
tags.h:57
dt_tag_t::flags
gint flags
Definition
tags.h:58
dt_tag_get_images_from_list
GList * dt_tag_get_images_from_list(const GList *img, const gint tagid)
Definition
tags.c:834
dt_tag_get_images
GList * dt_tag_get_images(const gint tagid)
Definition
tags.c:829
dt_tag_get_list_export
GList * dt_tag_get_list_export(int32_t imgid, int32_t flags)
Definition
tags.c:720
dt_tag_get_tags_images
void dt_tag_get_tags_images(const gchar *keyword, GList **tag_list, GList **img_list)
Definition
tags.c:880
dt_tag_remove_list
guint dt_tag_remove_list(GList *tag_list)
Definition
tags.c:211
dt_tag_attach
gboolean dt_tag_attach(const guint tagid, const int32_t imgid, const gboolean undo_on, const gboolean group_on)
Definition
tags.c:377
dt_tag_set_tags
gboolean dt_tag_set_tags(const GList *tags, const GList *img, const gboolean ignore_dt_tags, const gboolean clear_on, const gboolean undo_on)
Definition
tags.c:398
dt_tag_get_suggestions
uint32_t dt_tag_get_suggestions(GList **result)
Definition
tags.c:852
dt_tag_get_subtags
char * dt_tag_get_subtags(const int32_t imgid, const char *category, const int level)
Definition
tags.c:1232
dt_tag_get_attached
uint32_t dt_tag_get_attached(const int32_t imgid, GList **result, const gboolean ignore_dt_tags)
Definition
tags.c:515
dt_tag_attach_images
gboolean dt_tag_attach_images(const guint tagid, const GList *img, const gboolean undo_on)
Definition
tags.c:355
dt_set_darktable_tags
void dt_set_darktable_tags()
Definition
tags.c:510
dt_tag_get_synonyms
gchar * dt_tag_get_synonyms(gint tagid)
Definition
tags.c:956
dt_tag_detach
gboolean dt_tag_detach(const guint tagid, const int32_t imgid, const gboolean undo_on, const gboolean group_on)
Definition
tags.c:485
dt_tag_get_flags
gint dt_tag_get_flags(gint tagid)
Definition
tags.c:970
dt_tag_selection_t
dt_tag_selection_t
Definition
tags.h:73
DT_TS_ALL_IMAGES
@ DT_TS_ALL_IMAGES
Definition
tags.h:76
DT_TS_NO_IMAGE
@ DT_TS_NO_IMAGE
Definition
tags.h:74
DT_TS_SOME_IMAGES
@ DT_TS_SOME_IMAGES
Definition
tags.h:75
dt_tag_attach_string_list
gboolean dt_tag_attach_string_list(const gchar *tags, const GList *img, const gboolean undo_on)
Definition
tags.c:418
dt_tag_images_count
uint32_t dt_tag_images_count(gint tagid)
Definition
tags.c:885
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)
Definition
tags.c:500
dt_is_tag_attached
gboolean dt_is_tag_attached(const guint tagid, const int32_t imgid)
Definition
tags.c:824
dt_tag_new
gboolean dt_tag_new(const char *name, guint *tagid)
Definition
tags.c:164
dt_tag_set_tag_order_by_id
void dt_tag_set_tag_order_by_id(const uint32_t tagid, const uint32_t sort, const gboolean descending)
Definition
tags.c:1288
dt_tag_get_collection_tags
uint32_t dt_tag_get_collection_tags(GList **result)
Definition
tags.c:910
dt_tag_get_tag_order_by_id
gboolean dt_tag_get_tag_order_by_id(const uint32_t tagid, uint32_t *sort, gboolean *descending)
Definition
tags.c:1266
dt_tag_rename
void dt_tag_rename(const guint tagid, const gchar *new_tagname)
Definition
tags.c:247
dt_tag_flags_t
dt_tag_flags_t
Definition
tags.h:62
DT_TF_NONE
@ DT_TF_NONE
Definition
tags.h:63
DT_TF_ORDER_SET
@ DT_TF_ORDER_SET
Definition
tags.h:66
DT_TF_DESCENDING
@ DT_TF_DESCENDING
Definition
tags.h:67
DT_TF_CATEGORY
@ DT_TF_CATEGORY
Definition
tags.h:64
DT_TF_PRIVATE
@ DT_TF_PRIVATE
Definition
tags.h:65
dt_tag_get_name
gchar * dt_tag_get_name(const guint tagid)
Definition
tags.c:242
dt_tags_cleanup
void dt_tags_cleanup(void)
Definition
tags.c:1296
dt_tag_get_list
GList * dt_tag_get_list(int32_t imgid)
Definition
tags.c:623
dt_tag_import
uint32_t dt_tag_import(const char *filename)
Definition
tags.c:1025
dt_tag_get_hierarchical_export
GList * dt_tag_get_hierarchical_export(int32_t imgid, int32_t flags)
Definition
tags.c:800
dt_tag_set_flags
void dt_tag_set_flags(gint tagid, gint flags)
Definition
tags.c:975
dt_tag_remove
guint dt_tag_remove(const guint tagid, gboolean final)
Definition
tags.c:195
dt_tag_detach_images
gboolean dt_tag_detach_images(const guint tagid, const GList *img, const gboolean undo_on)
Definition
tags.c:462
dt_tag_get_hierarchical
GList * dt_tag_get_hierarchical(int32_t imgid)
Definition
tags.c:667
dt_tag_get_tags
GList * dt_tag_get_tags(const int32_t imgid, const gboolean ignore_dt_tags)
Definition
tags.c:707
dt_tag_free_result
void dt_tag_free_result(GList **result)
Definition
tags.c:1003
dt_tag_exists
gboolean dt_tag_exists(const char *name, guint *tagid)
Definition
tags.c:255
dt_sort_tag
GList * dt_sort_tag(GList *tags, gboolean byname)
dt_tag_set_synonyms
void dt_tag_set_synonyms(gint tagid, gchar *synonyms)
Definition
tags.c:961
dt_tag_export
uint32_t dt_tag_export(const char *filename)
Definition
tags.c:1160
dt_tag_get_tag_id_by_name
uint32_t dt_tag_get_tag_id_by_name(const char *const name)
Definition
tags.c:1282
dt_tag_new_from_gui
gboolean dt_tag_new_from_gui(const char *name, guint *tagid)
Definition
tags.c:187
dt_tag_get_recent_used
uint32_t dt_tag_get_recent_used(GList **result)
Definition
tags.c:1012
dt_tag_count_tags_images
void dt_tag_count_tags_images(const gchar *keyword, int *tag_count, int *img_count)
Definition
tags.c:875
dt_tag_get_with_usage
uint32_t dt_tag_get_with_usage(GList **result)
Definition
tags.c:890
src
metadata
tags.h
Generated by
1.9.8