Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
selection.c File Reference
+ Include dependency graph for selection.c:

Go to the source code of this file.

Data Structures

struct  dt_selection_t
 

Typedefs

typedef struct dt_selection_t dt_selection_t
 

Functions

struct dt_selection_tdt_selection_get_global (void)
 
void dt_selection_init_global (void)
 
void dt_selection_cleanup_global (void)
 
static void _update_gui ()
 
int32_t dt_selection_get_first_id (struct dt_selection_t *selection)
 
static void _reset_ids_list (dt_selection_t *selection)
 
static void _update_last_ids (dt_selection_t *selection)
 
static void _clean_missing_ids (dt_selection_t *selection)
 
static GList * _selection_database_to_glist (dt_selection_t *selection)
 
void dt_selection_reload_from_database_real (dt_selection_t *selection)
 
static void _selection_update_collection (gpointer instance, dt_collection_change_t query_change, dt_collection_properties_t changed_property, gpointer imgs, uint32_t next, dt_selection_t *selection)
 
static void _remove_id_link (dt_selection_t *selection, int32_t imgid)
 
static void _add_id_link (dt_selection_t *selection, int32_t imgid)
 
GList * dt_selection_get_list (struct dt_selection_t *selection)
 
int dt_selection_get_length (struct dt_selection_t *selection)
 
static void _selection_select (dt_selection_t *selection, int32_t imgid)
 
static void _selection_deselect (dt_selection_t *selection, int32_t imgid)
 
void dt_selection_push (dt_selection_t *selection)
 
void dt_selection_pop (dt_selection_t *selection)
 
dt_selection_tdt_selection_new ()
 
void dt_selection_free (dt_selection_t *selection)
 
void dt_selection_clear (dt_selection_t *selection)
 
void dt_selection_select (dt_selection_t *selection, int32_t imgid)
 
void dt_selection_deselect (dt_selection_t *selection, int32_t imgid)
 
void dt_selection_select_single (dt_selection_t *selection, int32_t imgid)
 
void dt_selection_toggle (dt_selection_t *selection, int32_t imgid)
 
static int32_t _list_iterate (struct dt_selection_t *selection, GList **list, int *count, const gboolean add)
 
void dt_selection_select_list (struct dt_selection_t *selection, const GList *const l)
 
void dt_selection_deselect_list (struct dt_selection_t *selection, const GList *const l)
 
gchar * dt_selection_ids_to_string (struct dt_selection_t *selection)
 
gboolean dt_selection_is_id_selected (struct dt_selection_t *selection, int32_t imgid)
 

Variables

static dt_selection_t_selection_global = NULL
 

Typedef Documentation

◆ dt_selection_t

Function Documentation

◆ _add_id_link()

static void _add_id_link ( dt_selection_t selection,
int32_t  imgid 
)
static

◆ _clean_missing_ids()

static void _clean_missing_ids ( dt_selection_t selection)
static

Definition at line 129 of file selection.c.

References dt_selection_repository_drop_uncollected().

Referenced by _selection_update_collection().

◆ _list_iterate()

static int32_t _list_iterate ( struct dt_selection_t selection,
GList **  list,
int *  count,
const gboolean  add 
)
static

Definition at line 316 of file selection.c.

References _add_id_link(), and _remove_id_link().

Referenced by dt_selection_deselect_list(), and dt_selection_select_list().

◆ _remove_id_link()

static void _remove_id_link ( dt_selection_t selection,
int32_t  imgid 
)
static

Definition at line 164 of file selection.c.

References _update_last_ids(), dt_selection_t::ids, and dt_selection_t::length.

Referenced by _list_iterate(), and dt_selection_deselect().

◆ _reset_ids_list()

static void _reset_ids_list ( dt_selection_t selection)
static

◆ _selection_database_to_glist()

static GList * _selection_database_to_glist ( dt_selection_t selection)
static

Definition at line 135 of file selection.c.

References dt_selection_repository_get_all().

Referenced by dt_selection_reload_from_database_real().

◆ _selection_deselect()

static void _selection_deselect ( dt_selection_t selection,
int32_t  imgid 
)
static

Definition at line 207 of file selection.c.

References dt_selection_repository_deselect().

Referenced by dt_selection_deselect().

◆ _selection_select()

static void _selection_select ( dt_selection_t selection,
int32_t  imgid 
)
static

Definition at line 200 of file selection.c.

References dt_selection_repository_select().

Referenced by dt_selection_select().

◆ _selection_update_collection()

static void _selection_update_collection ( gpointer  instance,
dt_collection_change_t  query_change,
dt_collection_properties_t  changed_property,
gpointer  imgs,
uint32_t  next,
dt_selection_t selection 
)
static

◆ _update_gui()

◆ _update_last_ids()

static void _update_last_ids ( dt_selection_t selection)
static

◆ dt_selection_cleanup_global()

void dt_selection_cleanup_global ( void  )

frees the application-wide selection.

Definition at line 90 of file selection.c.

References _selection_global, and dt_selection_free().

Referenced by dt_cleanup().

◆ dt_selection_clear()

◆ dt_selection_deselect()

void dt_selection_deselect ( struct dt_selection_t selection,
int32_t  imgid 
)

removes a single imgid from the current selection. use the optimized dt_selection_deselect_list() to process batches.

Definition at line 288 of file selection.c.

References _remove_id_link(), _selection_deselect(), _update_gui(), IS_NULL_PTR, and UNKNOWN_IMAGE.

Referenced by _collection_lut_row(), and dt_selection_toggle().

◆ dt_selection_deselect_list()

void dt_selection_deselect_list ( struct dt_selection_t selection,
const GList *  list 
)

deselects a set of images from a list in a fast, optimized fashion. the list is unaltered

Definition at line 354 of file selection.c.

References _list_iterate(), _update_gui(), dt_free, dt_selection_repository_deselect_list(), dt_util_dstrcat(), FALSE, dt_selection_t::ids, and IS_NULL_PTR.

Referenced by dt_thumbtable_invert_selection().

◆ dt_selection_free()

◆ dt_selection_get_first_id()

◆ dt_selection_get_global()

struct dt_selection_t * dt_selection_get_global ( void  )

Definition at line 80 of file selection.c.

References _selection_global.

Referenced by _act_folders_remove(), _collection_lut_row(), _concatenate_multiple_images(), _create_tag_from_entry(), _culling_mode(), _darkroom_image_loaded_callback(), _dt_ctl_open_image_in_darkroom(), _event_main_release(), _film_strip_activated(), _grid_handle_key(), _grid_is_thumb_highlighted(), _grid_on_drag_begin(), _grid_pre_activate(), _init_treeview(), _metadata_view_update_values(), _print_setup_initial_image(), _select_images(), _setup_selected_images_list(), _single_selected_imgid(), _studio_set_image(), _tag_get_tags(), _update_preview(), _view_map_button_press_callback(), _view_map_filmstrip_activate_callback(), _view_map_filmstrip_drag_begin_callback(), _view_map_selection_changed(), _view_print_filmstrip_drag_begin_callback(), clear_image_cache(), clear_selection_callback(), clear_selection_sensitive_callback(), copy_callback(), copy_parts_callback(), dt_act_on_get_first_image(), dt_act_on_get_images(), dt_act_on_get_images_nb(), dt_collection_hint_message(), dt_collection_load_filmroll(), dt_culling_mode_to_selection(), dt_image_read_duplicates(), dt_selection_to_culling_mode(), dt_tag_get_attached(), dt_tag_get_suggestions(), dt_tag_get_with_usage(), dt_thumbnail_new(), dt_thumbtable_invert_selection(), dt_thumbtable_key_pressed_grid(), dt_thumbtable_scroll_to_selection(), dt_thumbtable_select_all(), dt_thumbtable_select_range(), duplicate_callback(), enter(), export_image_list_callback(), group_images_callback(), has_selection(), leave(), new_history_callback(), paste_all_callback(), paste_parts_callback(), preload_image_cache(), select_all_sensitive_callback(), try_enter(), and ungroup_images_callback().

◆ dt_selection_get_length()

◆ dt_selection_get_list()

◆ dt_selection_ids_to_string()

gchar * dt_selection_ids_to_string ( struct dt_selection_t selection)

concatenate all image ids from the selection as a string, separated with coma, for SQL queries

Definition at line 377 of file selection.c.

References i, dt_selection_t::ids, IS_NULL_PTR, and dt_selection_t::length.

Referenced by _tag_get_tags().

◆ dt_selection_init_global()

void dt_selection_init_global ( void  )

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

Definition at line 85 of file selection.c.

References _selection_global, dt_selection_new(), and IS_NULL_PTR.

Referenced by dt_gui_gtk_init().

◆ dt_selection_is_id_selected()

gboolean dt_selection_is_id_selected ( struct dt_selection_t selection,
int32_t  imgid 
)

see if the imgid is known from the selection

Definition at line 404 of file selection.c.

References FALSE, dt_selection_t::ids, and IS_NULL_PTR.

Referenced by _grid_is_thumb_highlighted(), and dt_thumbnail_new().

◆ dt_selection_new()

◆ dt_selection_pop()

void dt_selection_pop ( struct dt_selection_t selection)

restore the previous selection from a temp memory database table

Definition at line 230 of file selection.c.

References _update_gui(), dt_selection_reload_from_database, dt_selection_repository_pop(), FALSE, IS_NULL_PTR, and dt_selection_t::stacked.

Referenced by dt_culling_mode_to_selection().

◆ dt_selection_push()

void dt_selection_push ( struct dt_selection_t selection)

backup the current selection to a temp memory database table

Definition at line 214 of file selection.c.

References _update_gui(), dt_selection_reload_from_database, dt_selection_repository_push(), IS_NULL_PTR, dt_selection_t::stacked, and TRUE.

Referenced by dt_selection_to_culling_mode().

◆ dt_selection_reload_from_database_real()

void dt_selection_reload_from_database_real ( struct dt_selection_t selection)

call this right after the selection got changed directly in memory database, to resync the GList representation of the selection

Definition at line 142 of file selection.c.

References _reset_ids_list(), _selection_database_to_glist(), _update_last_ids(), dt_selection_t::ids, IS_NULL_PTR, and dt_selection_t::length.

◆ dt_selection_select()

void dt_selection_select ( struct dt_selection_t selection,
int32_t  imgid 
)

adds a single imgid to the current selection. use the optimized dt_selection_select_list() to process batches.

Definition at line 279 of file selection.c.

References _add_id_link(), _selection_select(), _update_gui(), IS_NULL_PTR, and UNKNOWN_IMAGE.

Referenced by _grid_on_drag_begin(), dt_collection_load_filmroll(), dt_selection_select_single(), and dt_selection_toggle().

◆ dt_selection_select_list()

void dt_selection_select_list ( struct dt_selection_t selection,
const GList *  list 
)

selects a set of images from a list in a fast, optimized fashion. the list is unaltered

Definition at line 330 of file selection.c.

References _list_iterate(), _update_gui(), dt_free, dt_selection_repository_select_list(), dt_util_dstrcat(), dt_selection_t::ids, IS_NULL_PTR, and TRUE.

Referenced by _act_folders_remove(), _select_images(), dt_thumbtable_select_all(), dt_thumbtable_select_range(), and leave().

◆ dt_selection_select_single()

◆ dt_selection_toggle()

void dt_selection_toggle ( struct dt_selection_t selection,
int32_t  imgid 
)

toggles selection of a single image in the current selection

Definition at line 305 of file selection.c.

References dt_selection_deselect(), dt_selection_select(), dt_selection_t::ids, IS_NULL_PTR, and UNKNOWN_IMAGE.

Referenced by _event_main_release(), and _grid_handle_key().

Variable Documentation

◆ _selection_global

dt_selection_t* _selection_global = NULL
static