112 g_list_free(g_steal_pointer(&selection->
ids));
113 selection->
ids = NULL;
120 GList *last = g_list_last(selection->
ids);
147 selection->
length = g_list_length(selection->
ids);
166 GList *link = g_list_find(selection->
ids, GINT_TO_POINTER(imgid));
169 selection->
ids = g_list_delete_link(selection->
ids, link);
177 if(!g_list_find(selection->
ids, GINT_TO_POINTER(imgid)))
179 selection->
ids = g_list_append(selection->
ids, GINT_TO_POINTER(imgid));
190 return g_list_copy(selection->
ids);
202 if(imgid < 0)
return;
209 if(imgid < 0)
return;
264 (gpointer)selection);
265 g_list_free(selection->
ids);
266 selection->
ids = NULL;
310 if(g_list_find(selection->
ids, GINT_TO_POINTER(imgid)))
319 int32_t imgid = GPOINTER_TO_INT((*list)->data);
326 *list = g_list_next(*list);
334 GList *list = (GList *)l;
340 gchar *
ids = g_strdup(
"");
341 while(list && count < 400)
358 GList *list = (GList *)l;
364 gchar *
ids = g_strdup(
"");
365 while(list && count < 400)
383 gchar **
ids = g_malloc0_n(selection->
length + 1, 9 *
sizeof(
char *));
387 for(GList *
id = g_list_first(selection->
ids); id;
id = g_list_next(
id))
389 ids[
i] = g_strdup_printf(
"%i", GPOINTER_TO_INT(id->data));
397 gchar *result = g_strjoinv(
",",
ids);
408 return (g_list_find(selection->
ids, GINT_TO_POINTER(imgid)) != NULL);
dt_collection_t * dt_collection_get_global(void)
void dt_collection_hint_message(const dt_collection_t *collection)
dt_collection_properties_t
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
static GList * _selection_database_to_glist(dt_selection_t *selection)
int32_t dt_selection_get_first_id(struct dt_selection_t *selection)
void dt_selection_deselect_list(struct dt_selection_t *selection, const GList *const l)
void dt_selection_cleanup_global(void)
struct dt_selection_t * dt_selection_get_global(void)
void dt_selection_reload_from_database_real(dt_selection_t *selection)
void dt_selection_push(dt_selection_t *selection)
static void _update_gui()
gchar * dt_selection_ids_to_string(struct dt_selection_t *selection)
static void _remove_id_link(dt_selection_t *selection, int32_t imgid)
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)
int dt_selection_get_length(struct dt_selection_t *selection)
static void _update_last_ids(dt_selection_t *selection)
void dt_selection_init_global(void)
static void _selection_deselect(dt_selection_t *selection, int32_t imgid)
void dt_selection_free(dt_selection_t *selection)
static int32_t _list_iterate(struct dt_selection_t *selection, GList **list, int *count, const gboolean add)
static void _selection_select(dt_selection_t *selection, int32_t imgid)
GList * dt_selection_get_list(struct dt_selection_t *selection)
gboolean dt_selection_is_id_selected(struct dt_selection_t *selection, int32_t imgid)
dt_selection_t * dt_selection_new()
void dt_selection_select_list(struct dt_selection_t *selection, const GList *const l)
static dt_selection_t * _selection_global
static void _add_id_link(dt_selection_t *selection, int32_t imgid)
static void _clean_missing_ids(dt_selection_t *selection)
static void _reset_ids_list(dt_selection_t *selection)
void dt_selection_clear(dt_selection_t *selection)
void dt_selection_deselect(dt_selection_t *selection, int32_t imgid)
void dt_selection_select(dt_selection_t *selection, int32_t imgid)
void dt_selection_select_single(dt_selection_t *selection, int32_t imgid)
void dt_selection_pop(dt_selection_t *selection)
void dt_selection_toggle(dt_selection_t *selection, int32_t imgid)
#define dt_selection_reload_from_database(selection)
void dt_selection_repository_select(const int32_t imgid)
Add imgid to the selection. Selecting an already-selected image does nothing.
void dt_selection_repository_clear(void)
Empty the selection.
void dt_selection_repository_cleanup(void)
Finalise whatever this repository still caches – today, nothing. See dt_colorlabel_repository_cleanup...
void dt_selection_repository_pop(void)
Copy memory.selected_backup back over the selection.
void dt_selection_repository_deselect_list(const char *ids)
Remove every id in ids from the selection.
void dt_selection_repository_deselect(const int32_t imgid)
Remove imgid from the selection.
void dt_selection_repository_drop_uncollected(void)
Drop selected images that are no longer in the current collection.
GList * dt_selection_repository_get_all(void)
Every selected image id, GINT_TO_POINTER, ASCENDING. Free with g_list_free().
void dt_selection_repository_push(void)
Copy the selection into memory.selected_backup, replacing what was there.
void dt_selection_repository_select_list(const char *ids)
Add every id in ids to the selection.
main.selected_images, and the memory.selected_backup it is pushed onto.
#define DT_DEBUG_CONTROL_SIGNAL_DISCONNECT(ctlsig, cb, user_data)
#define DT_DEBUG_CONTROL_SIGNAL_RAISE(ctlsig, signal,...)
struct dt_control_signal_t * dt_control_signal_get_global(void)
@ DT_SIGNAL_SELECTION_CHANGED
This signal is raised when the selection is changed no param, no returned value.
@ DT_SIGNAL_COLLECTION_CHANGED
This signal is raised when collection changed. To avoid leaking the list, dt_collection_t is connecte...
#define DT_DEBUG_CONTROL_SIGNAL_CONNECT(ctlsig, signal, cb, user_data)
gchar * dt_util_dstrcat(gchar *str, const gchar *format,...)