Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
collection.h File Reference
#include <glib.h>
#include <glib/gi18n.h>
#include <inttypes.h>
#include "metadata/metadata.h"
+ Include dependency graph for collection.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dt_collection_rule_t
 
struct  dt_collection_params_t
 
struct  dt_collection_t
 
struct  dt_collection_name_value_t
 

Macros

#define NUM_LAST_COLLECTIONS   10
 
#define COLLECTION_QUERY_FULL   (COLLECTION_QUERY_USE_SORT | COLLECTION_QUERY_USE_LIMIT)
 
#define DT_COLLECTION_ORDER_FLAG   0x8000
 

Typedefs

typedef void(* dt_collection_recents_handler_t) (void)
 
typedef enum dt_collection_query_flags_t dt_collection_query_flags_t
 
typedef enum dt_collection_filter_flag_t dt_collection_filter_flag_t
 
typedef enum dt_collection_sort_t dt_collection_sort_t
 
typedef enum dt_collection_properties_t dt_collection_properties_t
 
typedef enum dt_collection_change_t dt_collection_change_t
 
typedef struct dt_collection_rule_t dt_collection_rule_t
 
typedef struct dt_collection_params_t dt_collection_params_t
 
typedef struct dt_collection_t dt_collection_t
 
typedef enum dt_collection_import_view_t dt_collection_import_view_t
 
typedef struct dt_collection_name_value_t dt_collection_name_value_t
 

Enumerations

enum  dt_collection_query_flags_t {
  COLLECTION_QUERY_SIMPLE = 0 ,
  COLLECTION_QUERY_USE_SORT = 1 << 0 ,
  COLLECTION_QUERY_USE_LIMIT = 1 << 1 ,
  COLLECTION_QUERY_USE_WHERE_EXT = 1 << 2 ,
  COLLECTION_QUERY_USE_ONLY_WHERE_EXT = 1 << 3
}
 
enum  dt_collection_filter_flag_t {
  COLLECTION_FILTER_NONE = 0 ,
  COLLECTION_FILTER_ALTERED = 1 << 0 ,
  COLLECTION_FILTER_UNALTERED = 1 << 1 ,
  COLLECTION_FILTER_REJECTED = 1 << 2 ,
  COLLECTION_FILTER_0_STAR = 1 << 3 ,
  COLLECTION_FILTER_1_STAR = 1 << 4 ,
  COLLECTION_FILTER_2_STAR = 1 << 5 ,
  COLLECTION_FILTER_3_STAR = 1 << 6 ,
  COLLECTION_FILTER_4_STAR = 1 << 7 ,
  COLLECTION_FILTER_5_STAR = 1 << 8 ,
  COLLECTION_FILTER_RED = 1 << 9 ,
  COLLECTION_FILTER_YELLOW = 1 << 10 ,
  COLLECTION_FILTER_GREEN = 1 << 11 ,
  COLLECTION_FILTER_BLUE = 1 << 12 ,
  COLLECTION_FILTER_MAGENTA = 1 << 13 ,
  COLLECTION_FILTER_WHITE = 1 << 14 ,
  COLLECTION_FILTER_ALL = (1 << 15) - 1
}
 
enum  dt_collection_sort_t {
  DT_COLLECTION_SORT_NONE = -1 ,
  DT_COLLECTION_SORT_FILENAME = 0 ,
  DT_COLLECTION_SORT_DATETIME ,
  DT_COLLECTION_SORT_IMPORT_TIMESTAMP ,
  DT_COLLECTION_SORT_CHANGE_TIMESTAMP ,
  DT_COLLECTION_SORT_EXPORT_TIMESTAMP ,
  DT_COLLECTION_SORT_PRINT_TIMESTAMP ,
  DT_COLLECTION_SORT_RATING ,
  DT_COLLECTION_SORT_ID ,
  DT_COLLECTION_SORT_COLOR ,
  DT_COLLECTION_SORT_GROUP ,
  DT_COLLECTION_SORT_PATH ,
  DT_COLLECTION_SORT_TITLE
}
 
enum  dt_collection_properties_t {
  DT_COLLECTION_PROP_FILMROLL = 0 ,
  DT_COLLECTION_PROP_FOLDERS ,
  DT_COLLECTION_PROP_FILENAME ,
  DT_COLLECTION_PROP_CAMERA ,
  DT_COLLECTION_PROP_LENS ,
  DT_COLLECTION_PROP_APERTURE ,
  DT_COLLECTION_PROP_EXPOSURE ,
  DT_COLLECTION_PROP_FOCAL_LENGTH ,
  DT_COLLECTION_PROP_ISO ,
  DT_COLLECTION_PROP_DAY ,
  DT_COLLECTION_PROP_TIME ,
  DT_COLLECTION_PROP_IMPORT_TIMESTAMP ,
  DT_COLLECTION_PROP_CHANGE_TIMESTAMP ,
  DT_COLLECTION_PROP_EXPORT_TIMESTAMP ,
  DT_COLLECTION_PROP_PRINT_TIMESTAMP ,
  DT_COLLECTION_PROP_GEOTAGGING ,
  DT_COLLECTION_PROP_TAG ,
  DT_COLLECTION_PROP_COLORLABEL ,
  DT_COLLECTION_PROP_METADATA ,
  DT_COLLECTION_PROP_GROUPING = DT_COLLECTION_PROP_METADATA + DT_METADATA_NUMBER ,
  DT_COLLECTION_PROP_LOCAL_COPY ,
  DT_COLLECTION_PROP_HISTORY ,
  DT_COLLECTION_PROP_MODULE ,
  DT_COLLECTION_PROP_ORDER ,
  DT_COLLECTION_PROP_RATING ,
  DT_COLLECTION_PROP_QUERY ,
  DT_COLLECTION_PROP_LAST ,
  DT_COLLECTION_PROP_UNDEF ,
  DT_COLLECTION_PROP_SORT
}
 
enum  dt_collection_change_t {
  DT_COLLECTION_CHANGE_NONE = 0 ,
  DT_COLLECTION_CHANGE_NEW_QUERY = 1 ,
  DT_COLLECTION_CHANGE_FILTER = 2 ,
  DT_COLLECTION_CHANGE_RELOAD = 3 ,
  DT_COLLECTION_CHANGE_BACKGROUND_SYNC = 4
}
 
enum  dt_collection_import_view_t {
  DT_COLLECTION_IMPORT_VIEW_KEEP = 0 ,
  DT_COLLECTION_IMPORT_VIEW_GRID ,
  DT_COLLECTION_IMPORT_VIEW_IMAGE
}
 

Functions

void dt_collection_set_recents_handler (dt_collection_recents_handler_t handler)
 
const char * dt_collection_name (dt_collection_properties_t prop)
 
dt_collection_tdt_collection_get_global (void)
 
void dt_collection_init_global (void)
 
void dt_collection_cleanup_global (void)
 
dt_collection_tdt_collection_new ()
 
void dt_collection_free (const dt_collection_t *collection)
 
const dt_collection_params_tdt_collection_params (const dt_collection_t *collection)
 
void dt_collection_get_makermodels (const gchar *filter, GList **sanitized, GList **exif)
 
gchar * dt_collection_get_makermodel (const char *exif_maker, const char *exif_model)
 
int dt_collection_update (const dt_collection_t *collection)
 
void dt_collection_reset (const dt_collection_t *collection)
 
void dt_collection_set_rules (const dt_collection_t *collection, const dt_collection_rule_t *rules, const int n_rules)
 
dt_collection_filter_flag_t dt_collection_get_filter_flags (const dt_collection_t *collection)
 
void dt_collection_set_filter_flags (const dt_collection_t *collection, dt_collection_filter_flag_t flags)
 
dt_collection_query_flags_t dt_collection_get_query_flags (const dt_collection_t *collection)
 
void dt_collection_set_query_flags (const dt_collection_t *collection, dt_collection_query_flags_t flags)
 
char * dt_collection_get_text_filter (const dt_collection_t *collection)
 
void dt_collection_set_text_filter (const dt_collection_t *collection, char *text_filter)
 
void dt_collection_set_tag_id (dt_collection_t *collection, const uint32_t tagid)
 
void dt_collection_load_filmroll (dt_collection_t *collection, const int32_t imgid, dt_collection_import_view_t view_policy, gboolean set_mouse_over)
 
gboolean dt_collection_get_browsed_folder (gchar *folder, size_t len, gboolean *recursive)
 
void dt_collection_notify_imported (const int32_t imgid, const gchar *known_image_folder, gint64 *last_refresh_us)
 
void dt_collection_set_sort (const dt_collection_t *collection, dt_collection_sort_t sort, gint reverse)
 
dt_collection_sort_t dt_collection_get_sort_field (const dt_collection_t *collection)
 
gboolean dt_collection_get_sort_descending (const dt_collection_t *collection)
 
gchar * dt_collection_get_sort_query (const dt_collection_t *collection)
 
uint32_t dt_collection_get_count (const dt_collection_t *collection)
 
int dt_collection_get_nth (const dt_collection_t *collection, int nth)
 
GList * dt_collection_get_all (const dt_collection_t *collection, int limit)
 
GList * dt_collection_get_images_for_rule (const dt_collection_properties_t property, const char *text, gboolean recursive)
 
GList * dt_collection_get_property_values (const dt_collection_properties_t property, const int rule)
 
void dt_collection_name_value_free (gpointer value)
 
void dt_collection_update_query (const dt_collection_t *collection, dt_collection_change_t query_change, dt_collection_properties_t changed_property, GList *list)
 
void dt_collection_hint_message (const dt_collection_t *collection)
 
void dt_collection_deserialize (const char *buf)
 
int dt_collection_serialize (char *buf, int bufsize)
 
void dt_collection_split_operator_number (const gchar *input, char **number1, char **number2, char **op)
 
void dt_collection_split_operator_datetime (const gchar *input, char **number1, char **number2, char **op)
 
void dt_collection_split_operator_exposure (const gchar *input, char **number1, char **number2, char **op)
 
void dt_collection_memory_update ()
 
void dt_selection_to_culling_mode ()
 
void dt_culling_mode_to_selection ()
 

Macro Definition Documentation

◆ COLLECTION_QUERY_FULL

#define COLLECTION_QUERY_FULL   (COLLECTION_QUERY_USE_SORT | COLLECTION_QUERY_USE_LIMIT)

Definition at line 76 of file collection.h.

◆ DT_COLLECTION_ORDER_FLAG

#define DT_COLLECTION_ORDER_FLAG   0x8000

Definition at line 116 of file collection.h.

◆ NUM_LAST_COLLECTIONS

#define NUM_LAST_COLLECTIONS   10

Definition at line 54 of file collection.h.

Typedef Documentation

◆ dt_collection_change_t

◆ dt_collection_filter_flag_t

◆ dt_collection_import_view_t

What an import is allowed to do to the view the user is currently looking at.

◆ dt_collection_name_value_t

One distinct value of a collection property, for the library module's value lists.

◆ dt_collection_params_t

◆ dt_collection_properties_t

◆ dt_collection_query_flags_t

◆ dt_collection_recents_handler_t

typedef void(* dt_collection_recents_handler_t) (void)

Definition at line 63 of file collection.h.

◆ dt_collection_rule_t

One rule of a collection: "images whose <property> <mode> matches <text>".

This is what crosses into the database module. The module turns rules into SQL; reading them out of the user's configuration is common/collection.c's.

◆ dt_collection_sort_t

◆ dt_collection_t

Enumeration Type Documentation

◆ dt_collection_change_t

Enumerator
DT_COLLECTION_CHANGE_NONE 
DT_COLLECTION_CHANGE_NEW_QUERY 
DT_COLLECTION_CHANGE_FILTER 
DT_COLLECTION_CHANGE_RELOAD 
DT_COLLECTION_CHANGE_BACKGROUND_SYNC 

Definition at line 159 of file collection.h.

◆ dt_collection_filter_flag_t

Enumerator
COLLECTION_FILTER_NONE 
COLLECTION_FILTER_ALTERED 
COLLECTION_FILTER_UNALTERED 
COLLECTION_FILTER_REJECTED 
COLLECTION_FILTER_0_STAR 
COLLECTION_FILTER_1_STAR 
COLLECTION_FILTER_2_STAR 
COLLECTION_FILTER_3_STAR 
COLLECTION_FILTER_4_STAR 
COLLECTION_FILTER_5_STAR 
COLLECTION_FILTER_RED 
COLLECTION_FILTER_YELLOW 
COLLECTION_FILTER_GREEN 
COLLECTION_FILTER_BLUE 
COLLECTION_FILTER_MAGENTA 
COLLECTION_FILTER_WHITE 
COLLECTION_FILTER_ALL 

Definition at line 78 of file collection.h.

◆ dt_collection_import_view_t

What an import is allowed to do to the view the user is currently looking at.

Enumerator
DT_COLLECTION_IMPORT_VIEW_KEEP 

Never move the user. The policy of every AUTOMATIC import (Studio Capture's folder survey): the images arrive on their own schedule, so switching views on their arrival interrupts whatever the user was doing, in the darkroom or anywhere else.

DT_COLLECTION_IMPORT_VIEW_GRID 

Show the imported images in the lighttable grid.

DT_COLLECTION_IMPORT_VIEW_IMAGE 

Exactly one image was imported on the user's request: open it in the darkroom.

Definition at line 268 of file collection.h.

◆ dt_collection_properties_t

Enumerator
DT_COLLECTION_PROP_FILMROLL 
DT_COLLECTION_PROP_FOLDERS 
DT_COLLECTION_PROP_FILENAME 
DT_COLLECTION_PROP_CAMERA 
DT_COLLECTION_PROP_LENS 
DT_COLLECTION_PROP_APERTURE 
DT_COLLECTION_PROP_EXPOSURE 
DT_COLLECTION_PROP_FOCAL_LENGTH 
DT_COLLECTION_PROP_ISO 
DT_COLLECTION_PROP_DAY 
DT_COLLECTION_PROP_TIME 
DT_COLLECTION_PROP_IMPORT_TIMESTAMP 
DT_COLLECTION_PROP_CHANGE_TIMESTAMP 
DT_COLLECTION_PROP_EXPORT_TIMESTAMP 
DT_COLLECTION_PROP_PRINT_TIMESTAMP 
DT_COLLECTION_PROP_GEOTAGGING 
DT_COLLECTION_PROP_TAG 
DT_COLLECTION_PROP_COLORLABEL 
DT_COLLECTION_PROP_METADATA 
DT_COLLECTION_PROP_GROUPING 
DT_COLLECTION_PROP_LOCAL_COPY 
DT_COLLECTION_PROP_HISTORY 
DT_COLLECTION_PROP_MODULE 
DT_COLLECTION_PROP_ORDER 
DT_COLLECTION_PROP_RATING 
DT_COLLECTION_PROP_QUERY 
DT_COLLECTION_PROP_LAST 
DT_COLLECTION_PROP_UNDEF 
DT_COLLECTION_PROP_SORT 

Definition at line 119 of file collection.h.

◆ dt_collection_query_flags_t

Enumerator
COLLECTION_QUERY_SIMPLE 
COLLECTION_QUERY_USE_SORT 
COLLECTION_QUERY_USE_LIMIT 
COLLECTION_QUERY_USE_WHERE_EXT 
COLLECTION_QUERY_USE_ONLY_WHERE_EXT 

Definition at line 68 of file collection.h.

◆ dt_collection_sort_t

Enumerator
DT_COLLECTION_SORT_NONE 
DT_COLLECTION_SORT_FILENAME 
DT_COLLECTION_SORT_DATETIME 
DT_COLLECTION_SORT_IMPORT_TIMESTAMP 
DT_COLLECTION_SORT_CHANGE_TIMESTAMP 
DT_COLLECTION_SORT_EXPORT_TIMESTAMP 
DT_COLLECTION_SORT_PRINT_TIMESTAMP 
DT_COLLECTION_SORT_RATING 
DT_COLLECTION_SORT_ID 
DT_COLLECTION_SORT_COLOR 
DT_COLLECTION_SORT_GROUP 
DT_COLLECTION_SORT_PATH 
DT_COLLECTION_SORT_TITLE 

Definition at line 99 of file collection.h.

Function Documentation

◆ dt_collection_cleanup_global()

void dt_collection_cleanup_global ( void  )

frees the application-wide collection.

Definition at line 148 of file collection.c.

References _collection_global, and dt_collection_free().

Referenced by dt_cleanup().

◆ dt_collection_deserialize()

◆ dt_collection_free()

◆ dt_collection_get_all()

GList * dt_collection_get_all ( const dt_collection_t collection,
int  limit 
)

get all image ids order as current selection. no more than limit many images are returned, <0 == unlimited

Definition at line 442 of file collection.c.

References dt_collection_get().

Referenced by _jpg_combobox_changed(), _switch_to_next_picture(), and _switch_to_prev_picture().

◆ dt_collection_get_browsed_folder()

gboolean dt_collection_get_browsed_folder ( gchar *  folder,
size_t  len,
gboolean *  recursive 
)

If lighttable/Studio Capture is currently browsing a single folder or film-roll (Collect module on the "Folders" tab), copy its path into folder (up to len bytes), set *recursive to whether sub-folders are included (always FALSE for a film-roll: only the Tree/FOLDERS view supports recursion), and return TRUE. Otherwise leave both outputs untouched and return FALSE.

Definition at line 1002 of file collection.c.

References _collection_folder_ui_inactive(), DT_COLLECTION_PROP_FOLDERS, dt_conf_get_bool(), dt_conf_get_int(), dt_conf_get_string(), dt_free, dt_view_manager_get_current_view(), dt_view_manager_get_global(), FALSE, and folder.

Referenced by dt_collection_notify_imported().

◆ dt_collection_get_count()

uint32_t dt_collection_get_count ( const dt_collection_t collection)

◆ dt_collection_get_filter_flags()

◆ dt_collection_get_global()

dt_collection_t * dt_collection_get_global ( void  )

instantiates a collection context

Definition at line 138 of file collection.c.

References _collection_global.

Referenced by _adopt_tag_order(), _altered_clicked(), _colorlabel_clicked(), _commit_colllection(), _control_import_job_run(), _culling_mode(), _drop_move_to_folder(), _dt_collection_changed_callback(), _dt_collection_get_hash(), _film_import1(), _generic_dt_control_fileop_images_job_run(), _history_style_apply(), _image_duplicate_with_version(), _jpg_combobox_changed(), _lib_duplicate_delete(), _lib_filter_reverse_button_changed(), _lib_filter_set_tag_order(), _lib_filter_sort_combobox_changed(), _lib_filter_update_query(), _pop_undo(), _pop_undo(), _pop_undo(), _rating_clicked(), _refresh_collection_callback(), _reset_text_entry(), _reset_text_filter(), _select_all_callback(), _select_none_callback(), _switch_to_next_picture(), _switch_to_prev_picture(), _text_entry_changed_wait(), _unaltered_clicked(), _update_altered_filters(), _update_colors_filter(), _update_gui(), _update_rating_filter(), collapse_grouped_callback(), dt_collection_deserialize(), dt_collection_memory_update(), dt_collection_notify_imported(), dt_collection_query_refresh_memory_table(), dt_collection_update(), dt_colorlabels_toggle_label_on_list(), dt_control_delete_images_job_run(), dt_control_duplicate_images_job_run(), dt_control_local_copy_images_job_run(), dt_control_merge_hdr_job_run(), dt_control_monochrome_images_job_run(), dt_control_refresh_exif_run(), dt_control_remove_images_job_run(), dt_film_set_query(), dt_grouping_add_grouped_images(), dt_image_copy_rename(), dt_image_read_duplicates(), dt_iop_request_focus(), dt_ratings_apply_on_list(), enter(), geotag_changed(), group_images_callback(), gui_cleanup(), gui_focus(), gui_focus(), gui_init(), gui_reset(), metadata_changed(), preferences_changed(), select_all_sensitive_callback(), tag_changed(), try_enter(), and ungroup_images_callback().

◆ dt_collection_get_images_for_rule()

GList * dt_collection_get_images_for_rule ( const dt_collection_properties_t  property,
const char *  text,
gboolean  recursive 
)

get the list of image ids matching a single (property, text, recursive) rule, independently of the currently active collection. recursive only matters for DT_COLLECTION_PROP_FOLDERS. Returns a GList of imgids (GINT_TO_POINTER), caller frees with g_list_free. Used by the library module to feed batch/background operations.

Definition at line 667 of file collection.c.

References dt_collection_query_get_images_for_rule().

Referenced by _rows_to_imgids().

◆ dt_collection_get_makermodel()

gchar * dt_collection_get_makermodel ( const char *  exif_maker,
const char *  exif_model 
)

get the sanitized makermodel for exif maker/model

Definition at line 651 of file collection.c.

References dt_imageio_lookup_makermodel(), maker, and model.

Referenced by dt_collection_query_get_makermodels(), and dt_collection_query_get_property_values().

◆ dt_collection_get_makermodels()

void dt_collection_get_makermodels ( const gchar *  filter,
GList **  sanitized,
GList **  exif 
)

get the filtered map between sanitized makermodel and exif maker/model

Definition at line 646 of file collection.c.

References dt_collection_query_get_makermodels().

Referenced by get_query_string().

◆ dt_collection_get_nth()

int dt_collection_get_nth ( const dt_collection_t collection,
int  nth 
)

get the nth image in the query

Definition at line 236 of file collection.c.

References dt_collection_query_get_nth().

◆ dt_collection_get_property_values()

GList * dt_collection_get_property_values ( const dt_collection_properties_t  property,
const int  rule 
)

Enumerate the distinct values of a collection property for the library module, honouring all the other active rules through the extended-where of rule rule. The library module then turns these into a flat list or a hierarchical tree. Returns a GList of dt_collection_name_value_t*, free with g_list_free_full(list, dt_collection_name_value_free).

Definition at line 682 of file collection.c.

References DT_COLLECTION_PROP_METADATA, dt_collection_query_get_property_values(), dt_conf_get_bool(), dt_conf_get_int(), dt_conf_get_string_const(), DT_METADATA_FLAG_HIDDEN, dt_metadata_get_keyid_by_display_order(), dt_metadata_get_name(), DT_METADATA_NUMBER, FALSE, name, and dt_collection_values_request_t::property.

Referenced by _collect_sorted_tree_names(), and _populate_list().

◆ dt_collection_get_query_flags()

dt_collection_query_flags_t dt_collection_get_query_flags ( const dt_collection_t collection)

get filter flags for collection

Definition at line 324 of file collection.c.

References COLLECTION_QUERY_FULL, IS_NULL_PTR, dt_collection_t::params, and dt_collection_params_t::query_flags.

Referenced by dt_collection_update_query().

◆ dt_collection_get_sort_descending()

gboolean dt_collection_get_sort_descending ( const dt_collection_t collection)

get if the collection must be shown in descending order

Definition at line 384 of file collection.c.

References dt_collection_params_t::descending, FALSE, IS_NULL_PTR, and dt_collection_t::params.

Referenced by gui_init().

◆ dt_collection_get_sort_field()

dt_collection_sort_t dt_collection_get_sort_field ( const dt_collection_t collection)

get the sort field used

Definition at line 378 of file collection.c.

References DT_COLLECTION_SORT_NONE, IS_NULL_PTR, dt_collection_t::params, and dt_collection_params_t::sort.

Referenced by gui_init().

◆ dt_collection_get_sort_query()

gchar * dt_collection_get_sort_query ( const dt_collection_t collection)

get the part of the query for sorting the collection

◆ dt_collection_get_text_filter()

char * dt_collection_get_text_filter ( const dt_collection_t collection)

get text filter for collection

Definition at line 310 of file collection.c.

References IS_NULL_PTR, dt_collection_t::params, and dt_collection_params_t::text_filter.

Referenced by _text_entry_changed_wait(), and gui_init().

◆ dt_collection_hint_message()

◆ dt_collection_init_global()

void dt_collection_init_global ( void  )

creates the application-wide collection. Called by the GUI bootstrap only.

Definition at line 143 of file collection.c.

References _collection_global, dt_collection_new(), and IS_NULL_PTR.

Referenced by dt_gui_gtk_init().

◆ dt_collection_load_filmroll()

void dt_collection_load_filmroll ( dt_collection_t collection,
const int32_t  imgid,
dt_collection_import_view_t  view_policy,
gboolean  set_mouse_over 
)

load a filmroll-based collection from an imgid, and make that image visible to the user as far as view_policy allows.

Parameters
collectionthe collection to re-point and re-query.
imgidthe imported image the library should follow. Typically the FIRST image of an import job: its folder is the one the Collect module's rule 0 is pointed at.
view_policywhat this import may do to what the user is currently looking at. It also governs the folder-following, the hovered image and the selection: under DT_COLLECTION_IMPORT_VIEW_KEEP none of them is touched outside Studio Capture's own atelier, which tracks its captures itself.
set_mouse_overwhether dt_control_set_mouse_over_id(imgid) is (re-)applied here: pass FALSE when the caller already pointed mouse_over_id at imgid earlier and does not want it forced back onto imgid here, clobbering whatever the user may be hovering by the time this runs. Ignored under KEEP.

Definition at line 1090 of file collection.c.

References _dt_collection_change_view_after_import(), DT_COLLECTION_CHANGE_NEW_QUERY, DT_COLLECTION_IMPORT_VIEW_KEEP, DT_COLLECTION_PROP_FILMROLL, dt_collection_update_query(), dt_conf_get_int(), dt_conf_set_int(), dt_conf_set_string(), dt_control_set_mouse_over_id(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_get_dirname_from_imgid(), DT_PATH_MAX, dt_selection_get_global(), dt_selection_select(), DT_SIGNAL_TAG_CHANGED, dt_util_dir_exist(), dt_view_manager_get_current_view(), dt_view_manager_get_global(), IS_NULL_PTR, dt_view_t::module_name, and UNKNOWN_IMAGE.

Referenced by _control_import_job_run(), and _film_import1().

◆ dt_collection_memory_update()

◆ dt_collection_name()

◆ dt_collection_name_value_free()

void dt_collection_name_value_free ( gpointer  value)

Definition at line 673 of file collection.c.

References v, and value.

Referenced by _collect_sorted_tree_names(), and _populate_list().

◆ dt_collection_new()

◆ dt_collection_notify_imported()

void dt_collection_notify_imported ( const int32_t  imgid,
const gchar *  known_image_folder,
gint64 *  last_refresh_us 
)

Shared notifier for import jobs that process images one at a time, throttled to at most once every 250ms via *last_refresh_us (caller-owned state, zero-initialized before the import loop starts). Re-reads dt_collection_get_browsed_folder() itself on every throttle-admitted call (so at most 4/s, not once per whole import job) rather than trusting a snapshot the caller took before the loop started: the user can change which folder is browsed while a long import is still running, and a stale snapshot would keep comparing against wherever they were looking when the job began.

known_image_folder is an optional optimization: pass imgid's folder if the caller already has it at hand (e.g. film_jobs.c's import loop, which never copies files, already knows it from the film-roll it just inserted into) to skip re-deriving it here. Pass NULL to have it resolved fresh via dt_get_dirname_from_imgid() – necessary whenever the caller can't otherwise know the final path, e.g. import_jobs.c's copy mode, which writes to a pattern-generated destination.

If imgid's folder matches the browsed folder exactly, or falls under it and sub-folders are included, this does a real dt_collection_update_query(), so the grid gains the new image – or no folder is being browsed at all, meaning relevance can't be determined, which takes the same real-update path. Otherwise it raises DT_SIGNAL_COLLECTION_CHANGED directly, without re-querying/rebuilding memory.collected_images: listeners that keep their own counts independently of it (e.g. the Collect module's tag/camera/lens lists) still refresh, while the center view – keyed off the query generation and memory.collected_images's row count, both left untouched on this path – does not needlessly reload thumbnails.

Either way the signal is labeled DT_COLLECTION_CHANGE_BACKGROUND_SYNC: a background import heartbeat should never steal scroll/focus or reset grid/zoom preferences, whether or not it touches what's on screen. Listeners that guard exactly that off query_change (thumbtable.c's own collection-changed callback, libs/tools/lighttable.c's) recognize it as "not a real [navigational] change" and skip just that side effect, not the parts driven by their own hash/state.

Definition at line 1023 of file collection.c.

References DT_COLLECTION_CHANGE_BACKGROUND_SYNC, dt_collection_get_browsed_folder(), dt_collection_get_global(), DT_COLLECTION_PROP_UNDEF, dt_collection_update_query(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_get_dirname_from_imgid(), DT_PATH_MAX, DT_SIGNAL_COLLECTION_CHANGED, FALSE, and TRUE.

Referenced by _control_import_job_run(), and _film_import1().

◆ dt_collection_params()

const dt_collection_params_t * dt_collection_params ( const dt_collection_t collection)

fetch params for collection for storing.

Definition at line 185 of file collection.c.

References IS_NULL_PTR, and dt_collection_t::params.

◆ dt_collection_reset()

◆ dt_collection_serialize()

int dt_collection_serialize ( char *  buf,
int  bufsize 
)

◆ dt_collection_set_filter_flags()

void dt_collection_set_filter_flags ( const dt_collection_t collection,
dt_collection_filter_flag_t  flags 
)

◆ dt_collection_set_query_flags()

void dt_collection_set_query_flags ( const dt_collection_t collection,
dt_collection_query_flags_t  flags 
)

set filter flags for collection

Definition at line 330 of file collection.c.

References flags, IS_NULL_PTR, and dt_collection_t::params.

Referenced by _lib_filter_update_query(), dt_collection_update_query(), and gui_reset().

◆ dt_collection_set_recents_handler()

void dt_collection_set_recents_handler ( dt_collection_recents_handler_t  handler)

Install the handler that records the current collection as recently used. NULL removes it.

Definition at line 831 of file collection.c.

References _recents_handler.

Referenced by dt_collection_gui_register_handlers().

◆ dt_collection_set_rules()

void dt_collection_set_rules ( const dt_collection_t collection,
const dt_collection_rule_t rules,
const int  n_rules 
)

gets an extended where part sets an extended where part Replace the collection's rules and rebuild its query.

Definition at line 337 of file collection.c.

References dt_collection_update(), dt_free, i, IS_NULL_PTR, MAX, t, and dt_collection_rule_t::text.

Referenced by dt_collection_update_query().

◆ dt_collection_set_sort()

void dt_collection_set_sort ( const dt_collection_t collection,
dt_collection_sort_t  sort,
gint  reverse 
)

set the sort fields and flags used to show the collection

◆ dt_collection_set_tag_id()

void dt_collection_set_tag_id ( dt_collection_t collection,
const uint32_t  tagid 
)

set the tagid of collection

Definition at line 361 of file collection.c.

References IS_NULL_PTR, and dt_collection_t::tagid.

Referenced by _adopt_tag_order().

◆ dt_collection_set_text_filter()

void dt_collection_set_text_filter ( const dt_collection_t collection,
char *  text_filter 
)

set text filter for collection

Definition at line 316 of file collection.c.

References dt_free, IS_NULL_PTR, and dt_collection_t::params.

Referenced by _reset_text_filter(), _text_entry_changed_wait(), and gui_cleanup().

◆ dt_collection_split_operator_datetime()

void dt_collection_split_operator_datetime ( const gchar *  input,
char **  number1,
char **  number2,
char **  op 
)

Definition at line 523 of file collection.c.

References _dt_collection_compute_datetime(), dt_free, dt_util_dstrcat(), and IS_NULL_PTR.

Referenced by get_query_string().

◆ dt_collection_split_operator_exposure()

void dt_collection_split_operator_exposure ( const gchar *  input,
char **  number1,
char **  number2,
char **  op 
)

Definition at line 584 of file collection.c.

References dt_free.

Referenced by get_query_string().

◆ dt_collection_split_operator_number()

void dt_collection_split_operator_number ( const gchar *  input,
char **  number1,
char **  number2,
char **  op 
)

Definition at line 455 of file collection.c.

References dt_free.

Referenced by get_query_string(), and list_match_string().

◆ dt_collection_update()

◆ dt_collection_update_query()

void dt_collection_update_query ( const dt_collection_t collection,
dt_collection_change_t  query_change,
dt_collection_properties_t  changed_property,
GList *  list 
)

update query by conf vars

Definition at line 837 of file collection.c.

References _recents_handler, COLLECTION_QUERY_USE_WHERE_EXT, dt_collection_get_query_flags(), dt_collection_memory_update(), dt_collection_query_find_neighbour(), dt_collection_set_query_flags(), dt_collection_set_rules(), dt_collection_update(), dt_conf_get_bool(), dt_conf_get_int(), dt_conf_get_string(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_free, DT_SIGNAL_COLLECTION_CHANGED, i, IS_NULL_PTR, dt_collection_rule_t::mode, dt_collection_rule_t::property, dt_collection_rule_t::recursive, and dt_collection_rule_t::text.

Referenced by _commit_colllection(), _control_import_job_run(), _culling_mode(), _drop_move_to_folder(), _film_import1(), _generic_dt_control_fileop_images_job_run(), _history_style_apply(), _image_duplicate_with_version(), _lib_duplicate_delete(), _lib_filter_update_query(), _pop_undo(), _refresh_collection_callback(), _reset_text_entry(), collapse_grouped_callback(), dt_collection_deserialize(), dt_collection_load_filmroll(), dt_collection_notify_imported(), dt_collection_reset(), dt_control_delete_images_job_run(), dt_control_duplicate_images_job_run(), dt_control_local_copy_images_job_run(), dt_control_merge_hdr_job_run(), dt_control_monochrome_images_job_run(), dt_control_refresh_exif_run(), dt_control_remove_images_job_run(), dt_film_set_query(), dt_image_copy_rename(), dt_image_read_duplicates(), enter(), geotag_changed(), group_images_callback(), metadata_changed(), preferences_changed(), tag_changed(), and ungroup_images_callback().

◆ dt_culling_mode_to_selection()

void dt_culling_mode_to_selection ( )

restore initial collection and selection when exiting culling mode

Definition at line 897 of file collection.c.

References dt_pop_collection(), dt_selection_get_global(), and dt_selection_pop().

Referenced by _culling_mode(), dt_cleanup(), and dt_collection_memory_update().

◆ dt_selection_to_culling_mode()

void dt_selection_to_culling_mode ( )

restrict the collection to selected pictures

Definition at line 256 of file collection.c.

References dt_collection_query_restrict_to_selection(), dt_push_collection(), dt_selection_clear(), dt_selection_get_global(), and dt_selection_push().

Referenced by dt_collection_memory_update().