Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
collect.c File Reference
#include "libs/collect.h"
#include "bauhaus/bauhaus.h"
#include "common/collection.h"
#include "common/darktable.h"
#include "common/datetime.h"
#include "common/debug.h"
#include "common/film.h"
#include "common/image.h"
#include "common/map_locations.h"
#include "common/metadata.h"
#include "common/mipmap_cache.h"
#include "common/selection.h"
#include "common/tags.h"
#include "common/utility.h"
#include "control/conf.h"
#include "control/control.h"
#include "control/jobs.h"
#include "control/jobs/control_jobs.h"
#include "dtgtk/button.h"
#include "dtgtk/paint.h"
#include "dtgtk/togglebutton.h"
#include "gui/drag_and_drop.h"
#include "gui/gtk.h"
#include "gui/preferences_dialogs.h"
#include "libs/lib.h"
#include "libs/lib_api.h"
#include "views/view.h"
#include <gio/gunixmounts.h>
+ Include dependency graph for collect.c:

Go to the source code of this file.

Data Structures

struct  dt_lib_collect_rule_t
 
struct  dt_lib_collect_t
 
struct  dt_lib_collect_params_rule_t
 
struct  dt_lib_collect_params_t
 
struct  _range_t
 
struct  name_key_tuple_t
 
struct  _date_range_t
 
struct  _expand_ctx_t
 
struct  collect_row_t
 
struct  collect_prerender_t
 
struct  collect_action_t
 

Macros

#define MAX_RULES   10
 
#define PARAM_STRING_SIZE   256
 
#define COLLECT_N_OPS   ((int)G_N_ELEMENTS(OP_TOKENS))
 
#define CLEAR_PARAMS(r)
 
#define ADD_COLLECT_ENTRY(value)
 

Typedefs

typedef enum dt_collect_tab_t dt_collect_tab_t
 
typedef enum dt_lib_collect_cols_t dt_lib_collect_cols_t
 
typedef struct dt_lib_collect_rule_t dt_lib_collect_rule_t
 
typedef struct dt_lib_collect_t dt_lib_collect_t
 
typedef struct dt_lib_collect_params_rule_t dt_lib_collect_params_rule_t
 
typedef struct dt_lib_collect_params_t dt_lib_collect_params_t
 
typedef struct _range_t _range_t
 
typedef struct name_key_tuple_t name_key_tuple_t
 
typedef struct _date_range_t _date_range_t
 
typedef struct _expand_ctx_t _expand_ctx_t
 
typedef struct collect_row_t collect_row_t
 
typedef struct collect_prerender_t collect_prerender_t
 
typedef struct collect_action_t collect_action_t
 

Enumerations

enum  dt_collect_tab_t {
  TAB_FOLDERS = 0 ,
  TAB_COLLECTIONS = 1 ,
  TAB_QUERIES = 2
}
 
enum  dt_lib_collect_cols_t {
  DT_LIB_COLLECT_COL_TEXT = 0 ,
  DT_LIB_COLLECT_COL_ID ,
  DT_LIB_COLLECT_COL_TOOLTIP ,
  DT_LIB_COLLECT_COL_PATH ,
  DT_LIB_COLLECT_COL_VISIBLE ,
  DT_LIB_COLLECT_COL_UNREACHABLE ,
  DT_LIB_COLLECT_COL_COUNT ,
  DT_LIB_COLLECT_COL_INDEX ,
  DT_LIB_COLLECT_COL_FONT ,
  DT_LIB_COLLECT_NUM_COLS
}
 

Functions

static void _lib_collect_gui_update (dt_lib_module_t *self)
 
static void entry_changed (GtkEntry *entry, dt_lib_collect_rule_t *dr)
 
static void combo_changed (GtkWidget *combo, dt_lib_collect_rule_t *dr)
 
static void collection_updated (gpointer instance, dt_collection_change_t query_change, dt_collection_properties_t changed_property, gpointer imgs, int next, gpointer self)
 
static void row_activated (GtkTreeView *view, GtkTreePath *path, GdkEventButton *event, dt_lib_collect_t *d)
 
static void update_view (dt_lib_collect_rule_t *dr)
 
static void _populate_collect_combo (GtkWidget *w)
 
static int _combo_get_active_collection (GtkWidget *combo)
 
static gboolean _combo_set_active_collection (GtkWidget *combo, const int property)
 
static void _op_changed (GtkWidget *w, dt_lib_collect_rule_t *dr)
 
static int is_time_property (int property)
 
static gboolean item_is_folder (int item)
 
static gboolean item_is_tag (int item)
 
static gboolean item_is_numeric (int item)
 
static gboolean item_is_tree (int item)
 
static void _split_operator (const char *text, int *op_idx, const char **value)
 
const char * name (struct dt_lib_module_t *self)
 
const char ** views (dt_lib_module_t *self)
 
uint32_t container (dt_lib_module_t *self)
 
int position ()
 
voidlegacy_params (struct dt_lib_module_t *self, const void *const old_params, const size_t old_params_size, const int old_version, int *new_version, size_t *new_size)
 
void init_presets (dt_lib_module_t *self)
 
static int _rules_count ()
 
static void _rules_set_count (int n)
 
static int _rule_get_item (int n)
 
static void _rule_set_item (int n, int item)
 
static int _rule_get_mode (int n)
 
static void _rule_set_mode (int n, int mode)
 
static gchar * _rule_get_string (int n)
 
static void _rule_set_string (int n, const char *s)
 
static void set_properties (dt_lib_collect_rule_t *dr)
 
static void get_properties (dt_lib_collect_rule_t *dr)
 
static void _commit_colllection ()
 
static void _commit_quiet ()
 
static dt_lib_collect_tget_collect (dt_lib_collect_rule_t *r)
 
static dt_lib_collect_rule_tget_active_rule (dt_lib_collect_t *d)
 
static void get_number_of_rules (dt_lib_collect_t *d)
 
static void _lib_collect_update_params (dt_lib_collect_t *d)
 
voidget_params (dt_lib_module_t *self, int *size)
 
int set_params (dt_lib_module_t *self, const void *params, int size)
 
void gui_reset (dt_lib_module_t *self)
 
static int string_array_length (char **list)
 
static char ** split_path (const char *path)
 
static void free_tuple (gpointer data)
 
static gint sort_folder_tag (gconstpointer a, gconstpointer b)
 
static char * tag_collate_key (char *tag)
 
static void tree_count_show (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
 
static gboolean list_match_string (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 
static gboolean tree_match_string (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 
static gboolean tree_reveal_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 
static void tree_set_visibility (GtkTreeModel *model, gpointer data)
 
static guint64 _date_key (const char *s, char pad)
 
static gboolean tree_range_visible (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 
static gboolean list_select (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 
static gboolean range_select (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 
static gboolean tree_expand (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 
static GtkTreePath * _folders_root_collapse_path (GtkTreeModel *model)
 
static GtkTreeModel * _create_filtered_model (GtkTreeModel *model, dt_lib_collect_rule_t *dr)
 
static void _collect_expanded_cb (GtkTreeView *view, GtkTreePath *path, gpointer data)
 
static gboolean _restore_expanded_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 
static char ** _split_tree_name (int property, const char *name)
 
static void _propagate_count_to_ancestors (GtkTreeStore *store, GtkTreeIter *leaf, int count)
 
static gboolean _maybe_file_uncategorized (GtkTreeStore *store, const char *name, const char *next_name_raw, GtkTreeIter *uncategorized, guint *index, int count)
 
static GList * _collect_sorted_tree_names (int property, int rule)
 
static void _build_tree_store (GtkTreeStore *store, int property, GList *sorted_names, gboolean no_uncategorized, const char *format_separator)
 
static void _populate_tree (dt_lib_collect_rule_t *dr)
 
static void _populate_list (dt_lib_collect_rule_t *dr)
 
static gchar * _decorate_hierarchy (gchar *text, GdkEventButton *event)
 
static gboolean _adopt_tag_order (const char *text, int *order)
 
static dt_lib_module_t_self ()
 
static void _force_refresh (dt_lib_collect_t *d)
 
static void _free_row (gpointer p)
 
static GList * _selected_rows (dt_lib_collect_t *d)
 
static GList * _rows_to_imgids (int property, GList *rows, gboolean recursive)
 
static gboolean _confirm (const char *title, const char *message)
 
static gchar * _ask_text (const char *title, const char *initial)
 
static void _act_folders_remove (dt_lib_collect_t *d, GList *rows)
 
static void _act_folders_relocate (dt_lib_collect_t *d, GList *rows)
 
static void _act_tags_remove (dt_lib_collect_t *d, GList *rows)
 
static void _act_tag_rename (dt_lib_collect_t *d, GList *rows)
 
static void _prerender_free (void *p)
 
static int32_t _prerender_job (dt_job_t *job)
 
static void _act_prerender (dt_lib_collect_t *d, GList *rows)
 
static gboolean _en_folders (int property, int n)
 
static gboolean _en_tags (int property, int n)
 
static gboolean _en_tag_single (int property, int n)
 
static gboolean _en_any (int property, int n)
 
static void _action_activate (GtkMenuItem *mi, dt_lib_collect_t *d)
 
static void _show_context_menu (dt_lib_collect_t *d, GdkEventButton *event)
 
static gboolean _drop_move_to_folder (dt_lib_collect_t *d, const char *folder, GList *imgs)
 
static gboolean _drop_attach_tag (dt_lib_collect_t *d, const char *tagpath, GList *imgs)
 
static gboolean _do_drop (dt_lib_collect_t *d, GtkTreeView *tree, gint x, gint y, GtkSelectionData *sel)
 
static void _view_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint target_type, guint time, dt_lib_collect_t *d)
 
static gboolean _view_button_pressed (GtkWidget *treeview, GdkEventButton *event, dt_lib_collect_t *d)
 
static gboolean _view_popup_menu (GtkWidget *treeview, dt_lib_collect_t *d)
 
static void _view_row_activated (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, dt_lib_collect_t *d)
 
static void _view_row_expanded (GtkTreeView *view, GtkTreeIter *iter, GtkTreePath *path, dt_lib_collect_t *d)
 
static void _set_tooltip (dt_lib_collect_rule_t *dr)
 
static void _update_op_combo (dt_lib_collect_rule_t *dr)
 
static void entry_activated (GtkWidget *entry, dt_lib_collect_rule_t *dr)
 
static gboolean _entry_focus_in (GtkWidget *w, GdkEventFocus *event, dt_lib_collect_rule_t *dr)
 
static void _recursive_toggled (GtkToggleButton *b, dt_lib_collect_t *d)
 
static void _sort_dir_toggled (GtkToggleButton *b, dt_lib_collect_t *d)
 
static void _sort_by_changed (GtkWidget *combo, dt_lib_collect_t *d)
 
static void _folder_levels_changed (GtkWidget *spin, dt_lib_collect_t *d)
 
static void _no_uncategorized_toggled (GtkToggleButton *b, dt_lib_collect_t *d)
 
static void _raw_toggled (GtkToggleButton *b, dt_lib_collect_t *d)
 
static void _raw_entry_activated (GtkWidget *entry, dt_lib_collect_t *d)
 
static void menuitem_mode (GtkMenuItem *menuitem, dt_lib_collect_rule_t *dr)
 
static void menuitem_mode_change (GtkMenuItem *menuitem, dt_lib_collect_rule_t *dr)
 
static void menuitem_clear (GtkMenuItem *menuitem, dt_lib_collect_rule_t *dr)
 
static gboolean popup_button_callback (GtkWidget *widget, GdkEventButton *event, dt_lib_collect_rule_t *dr)
 
static void _on_tab_switch (GtkNotebook *nb, GtkWidget *page, guint page_num, dt_lib_module_t *self)
 
static void _combo_as_view_toggle (GtkWidget *combo)
 
static void _combo_as_collections (GtkWidget *combo)
 
static void _combo_as_full (GtkWidget *combo)
 
static void _set_rule_button (dt_lib_collect_rule_t *dr, gboolean last, gboolean active)
 
static void _hide_all_widgets (dt_lib_collect_t *d)
 
static void _configure_tab (dt_lib_collect_t *d, dt_collect_tab_t tab)
 
static void filmrolls_updated (gpointer instance, gpointer self)
 
static void filmrolls_removed (gpointer instance, gpointer self)
 
static void preferences_changed (gpointer instance, gpointer self)
 
static void tag_changed (gpointer instance, gpointer self)
 
static void geotag_changed (gpointer instance, GList *imgs, const int locid, gpointer self)
 
static void metadata_changed (gpointer instance, int type, gpointer self)
 
static void _mount_changed (GUnixMountMonitor *monitor, dt_lib_module_t *self)
 
void gui_init (dt_lib_module_t *self)
 
void gui_cleanup (dt_lib_module_t *self)
 

Variables

static const char *const OP_TOKENS [] = { "", "<", "<=", ">", ">=", "<>" }
 
static const char *const OP_LABELS [] = { "=", "<", "≤", ">", "≥", "≠" }
 
static const char * UNCATEGORIZED_TAG = N_("uncategorized")
 
static const collect_action_t ACTIONS []
 

Macro Definition Documentation

◆ ADD_COLLECT_ENTRY

#define ADD_COLLECT_ENTRY (   value)
Value:
GUINT_TO_POINTER(value + 1), NULL, TRUE)
#define TRUE
Definition ashift_lsd.c:162
void dt_bauhaus_combobox_add_full(GtkWidget *widget, const char *text, dt_bauhaus_combobox_alignment_t align, gpointer data, void(free_func)(void *data), gboolean sensitive)
Definition bauhaus.c:2038
@ DT_BAUHAUS_COMBOBOX_ALIGN_RIGHT
Definition bauhaus.h:125
const char * dt_collection_name(dt_collection_properties_t prop)
Definition collection.c:657
static const dt_aligned_pixel_simd_t value
Definition darktable.h:577

◆ CLEAR_PARAMS

#define CLEAR_PARAMS (   r)
Value:
{ \
memset(&params, 0, sizeof(params)); \
params.rules = 1; \
params.rule[0].mode = 0; \
params.rule[0].item = r; \
}
const float r

◆ COLLECT_N_OPS

#define COLLECT_N_OPS   ((int)G_N_ELEMENTS(OP_TOKENS))

Definition at line 312 of file collect.c.

◆ MAX_RULES

#define MAX_RULES   10

Definition at line 162 of file collect.c.

◆ PARAM_STRING_SIZE

#define PARAM_STRING_SIZE   256

Definition at line 163 of file collect.c.

Typedef Documentation

◆ _date_range_t

typedef struct _date_range_t _date_range_t

◆ _expand_ctx_t

typedef struct _expand_ctx_t _expand_ctx_t

◆ _range_t

typedef struct _range_t _range_t

◆ collect_action_t

◆ collect_prerender_t

◆ collect_row_t

typedef struct collect_row_t collect_row_t

◆ dt_collect_tab_t

◆ dt_lib_collect_cols_t

◆ dt_lib_collect_params_rule_t

◆ dt_lib_collect_params_t

◆ dt_lib_collect_rule_t

◆ dt_lib_collect_t

◆ name_key_tuple_t

Enumeration Type Documentation

◆ dt_collect_tab_t

Enumerator
TAB_FOLDERS 
TAB_COLLECTIONS 
TAB_QUERIES 

Definition at line 165 of file collect.c.

◆ dt_lib_collect_cols_t

Enumerator
DT_LIB_COLLECT_COL_TEXT 
DT_LIB_COLLECT_COL_ID 
DT_LIB_COLLECT_COL_TOOLTIP 
DT_LIB_COLLECT_COL_PATH 
DT_LIB_COLLECT_COL_VISIBLE 
DT_LIB_COLLECT_COL_UNREACHABLE 
DT_LIB_COLLECT_COL_COUNT 
DT_LIB_COLLECT_COL_INDEX 
DT_LIB_COLLECT_COL_FONT 
DT_LIB_COLLECT_NUM_COLS 

Definition at line 172 of file collect.c.

Function Documentation

◆ _act_folders_relocate()

◆ _act_folders_remove()

◆ _act_prerender()

◆ _act_tag_rename()

◆ _act_tags_remove()

◆ _action_activate()

static void _action_activate ( GtkMenuItem *  mi,
dt_lib_collect_t d 
)
static

Definition at line 2009 of file collect.c.

References _free_row(), _selected_rows(), d, and collect_action_t::run.

Referenced by _show_context_menu().

◆ _adopt_tag_order()

◆ _ask_text()

static gchar * _ask_text ( const char *  title,
const char *  initial 
)
static

◆ _build_tree_store()

◆ _collect_expanded_cb()

static void _collect_expanded_cb ( GtkTreeView *  view,
GtkTreePath *  path,
gpointer  data 
)
static

Definition at line 1115 of file collect.c.

References DT_LIB_COLLECT_COL_PATH, model, p, and view().

Referenced by _populate_tree().

◆ _collect_sorted_tree_names()

◆ _combo_as_collections()

◆ _combo_as_full()

◆ _combo_as_view_toggle()

◆ _combo_get_active_collection()

◆ _combo_set_active_collection()

static gboolean _combo_set_active_collection ( GtkWidget combo,
const int  property 
)
static

◆ _commit_colllection()

◆ _commit_quiet()

◆ _configure_tab()

◆ _confirm()

static gboolean _confirm ( const char *  title,
const char *  message 
)
static

◆ _create_filtered_model()

static GtkTreeModel * _create_filtered_model ( GtkTreeModel *  model,
dt_lib_collect_rule_t dr 
)
static

◆ _date_key()

static guint64 _date_key ( const char *  s,
char  pad 
)
static

Definition at line 913 of file collect.c.

References n, and p.

Referenced by _populate_tree(), and tree_range_visible().

◆ _decorate_hierarchy()

static gchar * _decorate_hierarchy ( gchar *  text,
GdkEventButton *  event 
)
static

Definition at line 1569 of file collect.c.

References dt_free, dt_modifier_is(), and n.

Referenced by row_activated().

◆ _do_drop()

static gboolean _do_drop ( dt_lib_collect_t d,
GtkTreeView *  tree,
gint  x,
gint  y,
GtkSelectionData *  sel 
)
static

◆ _drop_attach_tag()

static gboolean _drop_attach_tag ( dt_lib_collect_t d,
const char *  tagpath,
GList *  imgs 
)
static

◆ _drop_move_to_folder()

◆ _en_any()

static gboolean _en_any ( int  property,
int  n 
)
static

Definition at line 1988 of file collect.c.

References item_is_folder(), and item_is_tag().

◆ _en_folders()

static gboolean _en_folders ( int  property,
int  n 
)
static

Definition at line 1976 of file collect.c.

References item_is_folder().

◆ _en_tag_single()

static gboolean _en_tag_single ( int  property,
int  n 
)
static

Definition at line 1984 of file collect.c.

References item_is_tag(), and n.

◆ _en_tags()

static gboolean _en_tags ( int  property,
int  n 
)
static

Definition at line 1980 of file collect.c.

References item_is_tag().

◆ _entry_focus_in()

static gboolean _entry_focus_in ( GtkWidget w,
GdkEventFocus *  event,
dt_lib_collect_rule_t dr 
)
static

Definition at line 2359 of file collect.c.

References FALSE, get_active_rule(), get_collect(), and update_view().

Referenced by gui_init().

◆ _folder_levels_changed()

static void _folder_levels_changed ( GtkWidget spin,
dt_lib_collect_t d 
)
static
Todo:
).

Definition at line 2408 of file collect.c.

References _force_refresh(), d, darktable, dt_conf_set_int(), darktable_t::gui, and dt_gui_gtk_t::reset.

Referenced by gui_init().

◆ _folders_root_collapse_path()

static GtkTreePath * _folders_root_collapse_path ( GtkTreeModel *  model)
static

Definition at line 1069 of file collect.c.

References dt_film_get_id(), dt_free, DT_LIB_COLLECT_COL_PATH, and model.

Referenced by _create_filtered_model().

◆ _force_refresh()

◆ _free_row()

static void _free_row ( gpointer  p)
static

Definition at line 1720 of file collect.c.

References dt_free, p, and r.

Referenced by _action_activate().

◆ _hide_all_widgets()

static void _hide_all_widgets ( dt_lib_collect_t d)
static

Definition at line 2602 of file collect.c.

References d, FALSE, i, MAX_RULES, and TRUE.

Referenced by _configure_tab().

◆ _lib_collect_gui_update()

◆ _lib_collect_update_params()

static void _lib_collect_update_params ( dt_lib_collect_t d)
static

Definition at line 585 of file collect.c.

References _rule_get_item(), _rule_get_mode(), _rule_get_string(), _rules_count(), d, dt_free, i, n, p, and PARAM_STRING_SIZE.

Referenced by get_params(), and set_params().

◆ _maybe_file_uncategorized()

static gboolean _maybe_file_uncategorized ( GtkTreeStore *  store,
const char *  name,
const char *  next_name_raw,
GtkTreeIter *  uncategorized,
guint *  index,
int  count 
)
static

◆ _mount_changed()

static void _mount_changed ( GUnixMountMonitor *  monitor,
dt_lib_module_t self 
)
static

◆ _no_uncategorized_toggled()

static void _no_uncategorized_toggled ( GtkToggleButton *  b,
dt_lib_collect_t d 
)
static

Definition at line 2415 of file collect.c.

References _force_refresh(), d, darktable, dt_conf_set_bool(), darktable_t::gui, and dt_gui_gtk_t::reset.

Referenced by gui_init().

◆ _on_tab_switch()

◆ _op_changed()

◆ _populate_collect_combo()

◆ _populate_list()

◆ _populate_tree()

◆ _prerender_free()

static void _prerender_free ( void p)
static

Definition at line 1923 of file collect.c.

References collect_prerender_t::imgids, and p.

Referenced by _act_prerender().

◆ _prerender_job()

◆ _propagate_count_to_ancestors()

static void _propagate_count_to_ancestors ( GtkTreeStore *  store,
GtkTreeIter *  leaf,
int  count 
)
static

Definition at line 1155 of file collect.c.

References DT_LIB_COLLECT_COL_COUNT, model, and store().

Referenced by _build_tree_store().

◆ _raw_entry_activated()

static void _raw_entry_activated ( GtkWidget entry,
dt_lib_collect_t d 
)
static

◆ _raw_toggled()

◆ _recursive_toggled()

◆ _restore_expanded_cb()

static gboolean _restore_expanded_cb ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  data 
)
static

Definition at line 1134 of file collect.c.

References dt_free, DT_LIB_COLLECT_COL_PATH, FALSE, model, and p.

Referenced by _populate_tree().

◆ _rows_to_imgids()

static GList * _rows_to_imgids ( int  property,
GList *  rows,
gboolean  recursive 
)
static

◆ _rule_get_item()

static int _rule_get_item ( int  n)
static

◆ _rule_get_mode()

static int _rule_get_mode ( int  n)
static

Definition at line 471 of file collect.c.

References dt_conf_get_int(), k, and n.

Referenced by _lib_collect_update_params(), _set_rule_button(), and menuitem_clear().

◆ _rule_get_string()

static gchar * _rule_get_string ( int  n)
static

Definition at line 485 of file collect.c.

References dt_conf_get_string(), k, and n.

Referenced by _configure_tab(), _lib_collect_update_params(), get_properties(), and menuitem_clear().

◆ _rule_set_item()

static void _rule_set_item ( int  n,
int  item 
)
static

◆ _rule_set_mode()

static void _rule_set_mode ( int  n,
int  mode 
)
static

◆ _rule_set_string()

static void _rule_set_string ( int  n,
const char *  s 
)
static

◆ _rules_count()

static int _rules_count ( )
static

◆ _rules_set_count()

static void _rules_set_count ( int  n)
static

◆ _selected_rows()

static GList * _selected_rows ( dt_lib_collect_t d)
static

Definition at line 1727 of file collect.c.

References d, DT_LIB_COLLECT_COL_ID, DT_LIB_COLLECT_COL_PATH, model, out, and r.

Referenced by _action_activate().

◆ _self()

static dt_lib_module_t * _self ( )
static

◆ _set_rule_button()

static void _set_rule_button ( dt_lib_collect_rule_t dr,
gboolean  last,
gboolean  active 
)
static

◆ _set_tooltip()

◆ _show_context_menu()

static void _show_context_menu ( dt_lib_collect_t d,
GdkEventButton *  event 
)
static

◆ _sort_by_changed()

static void _sort_by_changed ( GtkWidget combo,
dt_lib_collect_t d 
)
static

◆ _sort_dir_toggled()

◆ _split_operator()

static void _split_operator ( const char *  text,
int *  op_idx,
const char **  value 
)
static

Definition at line 315 of file collect.c.

References IS_NULL_PTR, and value.

Referenced by get_properties().

◆ _split_tree_name()

static char ** _split_tree_name ( int  property,
const char *  name 
)
static

◆ _update_op_combo()

static void _update_op_combo ( dt_lib_collect_rule_t dr)
static

◆ _view_button_pressed()

static gboolean _view_button_pressed ( GtkWidget treeview,
GdkEventButton *  event,
dt_lib_collect_t d 
)
static

Definition at line 2143 of file collect.c.

References _show_context_menu(), d, FALSE, item_is_folder(), item_is_tag(), TRUE, and view().

Referenced by gui_init().

◆ _view_drag_data_received()

static void _view_drag_data_received ( GtkWidget widget,
GdkDragContext *  context,
gint  x,
gint  y,
GtkSelectionData *  selection_data,
guint  target_type,
guint  time,
dt_lib_collect_t d 
)
static

Definition at line 2132 of file collect.c.

References _do_drop(), d, DND_TARGET_IMGID, FALSE, IS_NULL_PTR, and x.

Referenced by gui_init().

◆ _view_popup_menu()

static gboolean _view_popup_menu ( GtkWidget treeview,
dt_lib_collect_t d 
)
static

Definition at line 2172 of file collect.c.

References _show_context_menu(), d, FALSE, item_is_folder(), item_is_tag(), and TRUE.

Referenced by gui_init().

◆ _view_row_activated()

static void _view_row_activated ( GtkTreeView *  view,
GtkTreePath *  path,
GtkTreeViewColumn *  col,
dt_lib_collect_t d 
)
static

Definition at line 2179 of file collect.c.

References d, row_activated(), and view().

Referenced by gui_init().

◆ _view_row_expanded()

static void _view_row_expanded ( GtkTreeView *  view,
GtkTreeIter *  iter,
GtkTreePath *  path,
dt_lib_collect_t d 
)
static

Definition at line 2192 of file collect.c.

References d, DT_COLLECTION_PROP_FOLDERS, TRUE, and view().

Referenced by gui_init().

◆ collection_updated()

static void collection_updated ( gpointer  instance,
dt_collection_change_t  query_change,
dt_collection_properties_t  changed_property,
gpointer  imgs,
int  next,
gpointer  self 
)
static

◆ combo_changed()

◆ container()

uint32_t container ( dt_lib_module_t self)

Definition at line 368 of file collect.c.

References DT_UI_CONTAINER_PANEL_LEFT_CENTER.

◆ entry_activated()

◆ entry_changed()

◆ filmrolls_removed()

static void filmrolls_removed ( gpointer  instance,
gpointer  self 
)
static

◆ filmrolls_updated()

static void filmrolls_updated ( gpointer  instance,
gpointer  self 
)
static

Definition at line 2822 of file collect.c.

References _lib_collect_gui_update(), d, and dt_lib_collect_t::view_rule.

Referenced by gui_cleanup(), and gui_init().

◆ free_tuple()

static void free_tuple ( gpointer  data)
static

Definition at line 744 of file collect.c.

References name_key_tuple_t::collate_key, dt_free, and name_key_tuple_t::name.

Referenced by _populate_tree().

◆ geotag_changed()

◆ get_active_rule()

◆ get_collect()

◆ get_number_of_rules()

static void get_number_of_rules ( dt_lib_collect_t d)
static

Definition at line 578 of file collect.c.

References _rules_count(), and d.

Referenced by _configure_tab(), _lib_collect_gui_update(), and row_activated().

◆ get_params()

void * get_params ( dt_lib_module_t self,
int *  size 
)

Definition at line 601 of file collect.c.

References _lib_collect_update_params(), dt_lib_module_t::data, p, and size.

◆ get_properties()

◆ gui_cleanup()

◆ gui_init()

void gui_init ( dt_lib_module_t self)
Todo:
). Every collect setting it

Definition at line 2922 of file collect.c.

References _entry_focus_in(), _folder_levels_changed(), _lib_collect_gui_update(), _mount_changed(), _no_uncategorized_toggled(), _on_tab_switch(), _op_changed(), _populate_collect_combo(), _raw_entry_activated(), _raw_toggled(), _recursive_toggled(), _sort_by_changed(), _sort_dir_toggled(), _view_button_pressed(), _view_drag_data_received(), _view_popup_menu(), _view_row_activated(), _view_row_expanded(), darktable_t::bauhaus, COLLECT_N_OPS, collection_updated(), combo_changed(), CPF_DIRECTION_UP, d, darktable, dt_lib_module_t::data, dt_accels_disconnect_on_text_input(), dt_bauhaus_combobox_add(), DT_BAUHAUS_COMBOBOX_ALIGN_RIGHT, dt_bauhaus_combobox_new(), dt_bauhaus_combobox_set_selected_text_align(), dt_bauhaus_widget_set_label(), DT_DEBUG_CONTROL_SIGNAL_CONNECT, dt_gui_add_class(), DT_GUI_BOX_SPACING, DT_GUI_MODULE, DT_LIB_COLLECT_COL_FONT, DT_LIB_COLLECT_COL_UNREACHABLE, DT_LIB_COLLECT_COL_VISIBLE, DT_LIB_COLLECT_NUM_COLS, DT_SIGNAL_COLLECTION_CHANGED, DT_SIGNAL_FILMROLLS_CHANGED, DT_SIGNAL_FILMROLLS_REMOVED, DT_SIGNAL_GEOTAG_CHANGED, DT_SIGNAL_METADATA_CHANGED, DT_SIGNAL_PREFERENCES_CHANGE, DT_SIGNAL_TAG_CHANGED, dt_ui_notebook_new(), dt_ui_notebook_page(), DT_UI_RESIZE_STATIC, dt_ui_scroll_wrap(), dtgtk_cairo_paint_sortby(), dtgtk_togglebutton_new(), entry_activated(), entry_changed(), FALSE, filmrolls_removed(), filmrolls_updated(), geotag_changed(), i, MAX_RULES, metadata_changed(), dt_view_manager_t::module_collect, n_targets_internal, OP_LABELS, popup_button_callback(), preferences_changed(), dt_view_manager_t::proxy, darktable_t::signals, tag_changed(), target_list_internal, tree_count_show(), TRUE, dt_view_manager_t::update, view(), darktable_t::view_manager, and dt_lib_module_t::widget.

◆ gui_reset()

◆ init_presets()

◆ is_time_property()

◆ item_is_folder()

◆ item_is_numeric()

◆ item_is_tag()

static gboolean item_is_tag ( int  item)
static

◆ item_is_tree()

static gboolean item_is_tree ( int  item)
static

◆ legacy_params()

void * legacy_params ( struct dt_lib_module_t self,
const void *const  old_params,
const size_t  old_params_size,
const int  old_version,
int *  new_version,
size_t *  new_size 
)

Definition at line 378 of file collect.c.

◆ list_match_string()

◆ list_select()

static gboolean list_select ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  data 
)
static

Definition at line 945 of file collect.c.

References d, dt_free, DT_LIB_COLLECT_COL_PATH, FALSE, get_collect(), model, and dt_lib_collect_rule_t::text.

Referenced by _populate_list().

◆ menuitem_clear()

◆ menuitem_mode()

static void menuitem_mode ( GtkMenuItem *  menuitem,
dt_lib_collect_rule_t dr 
)
static

◆ menuitem_mode_change()

static void menuitem_mode_change ( GtkMenuItem *  menuitem,
dt_lib_collect_rule_t dr 
)
static

◆ metadata_changed()

◆ name()

const char * name ( struct dt_lib_module_t self)

Definition at line 357 of file collect.c.

◆ popup_button_callback()

static gboolean popup_button_callback ( GtkWidget widget,
GdkEventButton *  event,
dt_lib_collect_rule_t dr 
)
static

◆ position()

int position ( )

Definition at line 373 of file collect.c.

◆ preferences_changed()

static void preferences_changed ( gpointer  instance,
gpointer  self 
)
static

◆ range_select()

static gboolean range_select ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  data 
)
static

◆ row_activated()

◆ set_params()

◆ set_properties()

◆ sort_folder_tag()

static gint sort_folder_tag ( gconstpointer  a,
gconstpointer  b 
)
static

Definition at line 752 of file collect.c.

References name_key_tuple_t::collate_key.

Referenced by _collect_sorted_tree_names().

◆ split_path()

static char ** split_path ( const char *  path)
static

Definition at line 714 of file collect.c.

References dt_free, i, IS_NULL_PTR, and size.

Referenced by _split_tree_name().

◆ string_array_length()

static int string_array_length ( char **  list)
static

Definition at line 706 of file collect.c.

Referenced by _build_tree_store().

◆ tag_changed()

◆ tag_collate_key()

static char * tag_collate_key ( char *  tag)
static

Definition at line 760 of file collect.c.

Referenced by _collect_sorted_tree_names().

◆ tree_count_show()

static void tree_count_show ( GtkTreeViewColumn *  col,
GtkCellRenderer *  renderer,
GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer  data 
)
static

Definition at line 776 of file collect.c.

References dt_free, DT_LIB_COLLECT_COL_COUNT, DT_LIB_COLLECT_COL_TEXT, model, and name.

Referenced by gui_init().

◆ tree_expand()

◆ tree_match_string()

static gboolean tree_match_string ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  data 
)
static

◆ tree_range_visible()

static gboolean tree_range_visible ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  data 
)
static

Definition at line 932 of file collect.c.

References _date_key(), dt_free, DT_LIB_COLLECT_COL_PATH, DT_LIB_COLLECT_COL_VISIBLE, FALSE, model, and r.

Referenced by _populate_tree().

◆ tree_reveal_func()

static gboolean tree_reveal_func ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  data 
)
static

Definition at line 889 of file collect.c.

References DT_LIB_COLLECT_COL_VISIBLE, FALSE, model, state, and TRUE.

Referenced by _populate_tree(), and tree_set_visibility().

◆ tree_set_visibility()

static void tree_set_visibility ( GtkTreeModel *  model,
gpointer  data 
)
static

Definition at line 903 of file collect.c.

References model, tree_match_string(), and tree_reveal_func().

Referenced by _populate_tree().

◆ update_view()

◆ views()

const char ** views ( dt_lib_module_t self)

Definition at line 362 of file collect.c.

References v.

Variable Documentation

◆ ACTIONS

const collect_action_t ACTIONS[]
static
Initial value:
= {
{ N_("remove from library..."), TRUE, _en_folders, _act_folders_remove },
{ N_("relocate..."), TRUE, _en_folders, _act_folders_relocate },
{ N_("delete tag(s)..."), TRUE, _en_tags, _act_tags_remove },
{ N_("rename tag..."), FALSE, _en_tag_single, _act_tag_rename },
{ N_("pre-render thumbnails"), TRUE, _en_any, _act_prerender },
}
#define FALSE
Definition ashift_lsd.c:158
static gboolean _en_tags(int property, int n)
Definition collect.c:1980
static void _act_tags_remove(dt_lib_collect_t *d, GList *rows)
Definition collect.c:1878
static void _act_folders_remove(dt_lib_collect_t *d, GList *rows)
Definition collect.c:1819
static void _act_tag_rename(dt_lib_collect_t *d, GList *rows)
Definition collect.c:1900
static void _act_folders_relocate(dt_lib_collect_t *d, GList *rows)
Definition collect.c:1832
static gboolean _en_folders(int property, int n)
Definition collect.c:1976
static void _act_prerender(dt_lib_collect_t *d, GList *rows)
Definition collect.c:1961
static gboolean _en_any(int property, int n)
Definition collect.c:1988
static gboolean _en_tag_single(int property, int n)
Definition collect.c:1984

Definition at line 2001 of file collect.c.

Referenced by _show_context_menu().

◆ OP_LABELS

const char* const OP_LABELS[] = { "=", "<", "≤", ">", "≥", "≠" }
static

Definition at line 311 of file collect.c.

Referenced by gui_init().

◆ OP_TOKENS

const char* const OP_TOKENS[] = { "", "<", "<=", ">", ">=", "<>" }
static

Definition at line 310 of file collect.c.

Referenced by set_properties().

◆ UNCATEGORIZED_TAG

const char* UNCATEGORIZED_TAG = N_("uncategorized")
static

Definition at line 1112 of file collect.c.

Referenced by _maybe_file_uncategorized().