Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
colorlabels.c File Reference
#include "common/colorlabels.h"
#include "common/collection.h"
#include "common/darktable.h"
#include "common/debug.h"
#include "common/image_cache.h"
#include "common/undo.h"
#include "common/grouping.h"
#include "control/conf.h"
#include "control/control.h"
#include "gui/gtk.h"
#include <gdk/gdkkeysyms.h>
#include "bauhaus/bauhaus.h"
+ Include dependency graph for colorlabels.c:

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)
 
static void _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 Documentation

◆ dt_colorlabels_actions_t

◆ dt_undo_colorlabels_t

Enumeration Type Documentation

◆ dt_colorlabels_actions_t

Enumerator
DT_CA_SET 
DT_CA_ADD 
DT_CA_TOGGLE 

Function Documentation

◆ _colorlabels_execute()

◆ _colorlabels_undo_data_free()

static void _colorlabels_undo_data_free ( gpointer  data)
static

◆ _pop_undo()

◆ _pop_undo_execute()

static void _pop_undo_execute ( const int32_t  imgid,
const int  before,
const int  after 
)
static

◆ dt_colorlabels_check_label()

int dt_colorlabels_check_label ( const int32_t  imgid,
const int  color 
)

check if an image has a color label

References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.

Referenced by colorlabel_member().

◆ dt_colorlabels_get_labels()

int dt_colorlabels_get_labels ( const int32_t  imgid)

◆ dt_colorlabels_get_name()

char * dt_colorlabels_get_name ( const int  label)

◆ dt_colorlabels_remove_label()

void dt_colorlabels_remove_label ( const int32_t  imgid,
const int  color 
)

◆ dt_colorlabels_remove_labels()

void dt_colorlabels_remove_labels ( const int32_t  imgid)

◆ dt_colorlabels_set_label()

void dt_colorlabels_set_label ( const int32_t  imgid,
const int  color 
)

◆ dt_colorlabels_set_labels()

void dt_colorlabels_set_labels ( const int32_t  imgid,
const int  colors 
)

save all assigned color labels from cached dt_image_t to database

References colors, dt_colorlabels_remove_label(), and dt_colorlabels_set_label().

Referenced by dt_image_cache_write_release().

◆ dt_colorlabels_to_string()

const char * dt_colorlabels_to_string ( int  label)
Todo:
: XMP uses Red, Green, ... while we use red, green, ... What should this function return?

References DT_COLORLABELS_LAST, and dt_colorlabels_name.

Referenced by _get_base_value().

◆ dt_colorlabels_toggle_label_on_list()

Variable Documentation

◆ dt_colorlabels_name

const char* dt_colorlabels_name[]
Initial value:
= {
"red", "yellow", "green", "blue", "purple",
NULL
}

array with all names as strings, terminated by a NULL entry

Referenced by colorlabel_member(), dt_colorlabels_to_string(), and dt_lua_init_image().