1 /* 2 This file is part of darktable, 3 Copyright (C) 2011-2021 darktable developers. 4 5 darktable is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 darktable is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with darktable. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #pragma once 20 21 #include <glib.h> 22 #include <inttypes.h> 23 24 struct dt_selection_t; 25 26 struct dt_selection_t *dt_selection_new(); 27 void dt_selection_free(struct dt_selection_t *selection); 28 29 /** inverts the current selection */ 30 void dt_selection_invert(struct dt_selection_t *selection); 31 /** clears the selection */ 32 void dt_selection_clear(struct dt_selection_t *selection); 33 /** adds imgid to the current selection */ 34 void dt_selection_select(struct dt_selection_t *selection, uint32_t imgid); 35 /** removes imgid from the current selection */ 36 void dt_selection_deselect(struct dt_selection_t *selection, uint32_t imgid); 37 /** clears current selection and adds imgid */ 38 void dt_selection_select_single(struct dt_selection_t *selection, uint32_t imgid); 39 /** toggles selection of image in the current selection */ 40 void dt_selection_toggle(struct dt_selection_t *selection, uint32_t imgid); 41 /** selects images range last_single_id to imgid */ 42 void dt_selection_select_range(struct dt_selection_t *selection, uint32_t imgid); 43 /** selects all images from current collection */ 44 void dt_selection_select_all(struct dt_selection_t *selection); 45 /** selects all images from filmroll of last single selected image */ 46 void dt_selection_select_filmroll(struct dt_selection_t *selection); 47 /** selects all unaltered images in the current collection */ 48 void dt_selection_select_unaltered(struct dt_selection_t *selection); 49 /** selects a set of images from a list. the list is unaltered */ 50 void dt_selection_select_list(struct dt_selection_t *selection, GList *list); 51 /** selects a set of images from a list. the list is unaltered */ 52 const struct dt_collection_t *dt_selection_get_collection(struct dt_selection_t *selection); 53 /** get the list of selected images */ 54 GList *dt_selection_get_list(struct dt_selection_t *selection, const gboolean only_visible, 55 const gboolean ordering); 56 gchar *dt_selection_get_list_query(struct dt_selection_t *selection, const gboolean only_visible, 57 const gboolean ordering); 58 // modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh 59 // vim: shiftwidth=2 expandtab tabstop=2 cindent 60 // kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified; 61