85 if(imgid <= 0)
return FALSE;
91 "SELECT * FROM main.color_labels WHERE imgid=?1 AND color=?2 LIMIT 1",
113 "SELECT color FROM main.color_labels WHERE imgid IN "
114 "(SELECT imgid FROM main.selected_images)",
122 "SELECT color FROM main.color_labels WHERE imgid=?1 ORDER BY color",
gboolean dt_colorlabel_repository_has(const int32_t imgid, const int color)
TRUE when colour color is set on imgid.
void dt_colorlabel_repository_remove_all(const int32_t imgid)
Clear every colour on imgid.
void dt_colorlabel_repository_remove(const int32_t imgid, const int color)
Clear colour color on imgid. Clearing one that is not set does nothing.
void dt_colorlabel_repository_set(const int32_t imgid, const int color)
Set colour color on imgid. Setting one that is already set does nothing.
static sqlite3_stmt * _prepared(const char *query)
GList * dt_colorlabel_repository_get_list(const int32_t imgid)
The colours set on imgid, as a list rather than a bitmask.
int dt_colorlabel_repository_get(const int32_t imgid)
The colours set on imgid, as a bitmask: bit c is set when colour c is.
void dt_colorlabel_repository_foreach(const int32_t imgid, void(*cb)(void *, const int), void *user_data)
Every colour label of imgid, one call per row, in the order the rows come back.
void dt_colorlabel_repository_cleanup(void)
Finalise whatever this repository still caches – today, nothing.
main.color_labels: which of the five colour labels are set on an image.
sqlite3 * dt_database_get_sqlite3_global(void)
const dt_collection_filter_flag_t colors[6]
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
Checked wrappers around the sqlite3_* calls: trace the statement, assert the return code,...
#define DT_DEBUG_SQLITE3_PREPARE_V2(a, b, c, d, e)
#define DT_DEBUG_SQLITE3_BIND_INT(a, b, c)