Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
thumbtable.c File Reference
#include "common/darktable.h"
#include "gui/gdkkeys.h"
#include "dtgtk/thumbtable.h"
#include "dtgtk/thumbtable_internal.h"
#include "dtgtk/thumbnail.h"
#include "dtgtk/thumbtable_info.h"
#include "common/collection.h"
#include "common/colorlabels.h"
#include "common/history.h"
#include "common/image_cache.h"
#include "common/grouping.h"
#include "common/ratings.h"
#include "common/selection.h"
#include "common/undo.h"
#include "control/control.h"
#include "control/jobs/import_jobs.h"
#include "gui/accelerators.h"
#include "gui/drag_and_drop.h"
#include "views/view.h"
#include "bauhaus/bauhaus.h"
#include <glib-object.h>
#include <math.h>
+ Include dependency graph for thumbtable.c:

Go to the source code of this file.

Macros

#define CLAMP_ROW(rowid)   CLAMP(rowid, 0, table->collection_count - 1)
 
#define IS_COLLECTION_EDGE(rowid)   (rowid < 0 || rowid >= table->collection_count)
 

Functions

static gboolean _thumbtable_clone_lut (dt_thumbtable_t *dst)
 
void _dt_thumbtable_empty_list (dt_thumbtable_t *table)
 
static gboolean _thumbtable_idle_update (gpointer user_data)
 
static void _thumbtable_schedule_update (dt_thumbtable_t *table)
 
static void _scrollbar_value_changed (GtkAdjustment *adjustment, gpointer user_data)
 
static void _scrollbar_page_size_notify (GObject *object, GParamSpec *pspec, gpointer user_data)
 
static void _parent_overlay_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data)
 
static void _scrollbar_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data)
 
static gint _thumb_compare_rowid_desc (gconstpointer a, gconstpointer b)
 
static int _grab_focus (dt_thumbtable_t *table)
 
void dt_thumbtable_schedule_focus (dt_thumbtable_t *table, const gint priority)
 
void dt_thumbtable_queue_update (dt_thumbtable_t *table)
 
void _mouse_over_image_callback (gpointer instance, gpointer user_data)
 
static void _rowid_to_position (dt_thumbtable_t *table, int rowid, int *x, int *y)
 
static int _position_to_rowid (dt_thumbtable_t *table, const double x, const double y)
 
static gboolean _set_thumb_position (dt_thumbtable_t *table, dt_thumbnail_t *thumb)
 
void dt_thumbtable_get_scroll_position (dt_thumbtable_t *table, double *x, double *y)
 
void dt_thumbtable_set_active_rowid (dt_thumbtable_t *table)
 Update internal active row tracking.
 
static int dt_thumbtable_scroll_to_position (dt_thumbtable_t *table, const double x, const double y)
 
static void dt_thumbtable_scroll_to_rowid (dt_thumbtable_t *table, int rowid)
 
int dt_thumbtable_find_rowid_from_imgid (dt_thumbtable_t *table, const int32_t imgid)
 
int dt_thumbtable_scroll_to_imgid (dt_thumbtable_t *table, int32_t imgid)
 Scroll the view to show a specific image.
 
int dt_thumbtable_scroll_to_active_rowid (dt_thumbtable_t *table)
 Scroll to show the active row.
 
int dt_thumbtable_scroll_to_selection (dt_thumbtable_t *table)
 Scroll to show selected content.
 
static gboolean _get_row_ids (dt_thumbtable_t *table, int *rowid_min, int *rowid_max)
 
gboolean _is_rowid_visible (dt_thumbtable_t *table, int rowid)
 
gboolean _update_row_ids (dt_thumbtable_t *table)
 
void _update_grid_area (dt_thumbtable_t *table)
 
void _grid_configure (dt_thumbtable_t *table, int width, int height, int per_row, int thumb_width, int thumb_height)
 
int dt_thumbtable_thumb_cell_decoration (void)
 
void dt_thumbtable_configure (dt_thumbtable_t *table)
 
dt_thumbnail_t_find_thumb_by_imgid (dt_thumbtable_t *table, const int32_t imgid)
 
gboolean dt_thumbtable_get_thumbnail_info (dt_thumbtable_t *table, int32_t imgid, dt_image_t *out)
 
void _add_thumbnail_group_borders (dt_thumbtable_t *table, dt_thumbnail_t *thumb)
 
void _add_thumbnail_at_rowid (dt_thumbtable_t *table, const size_t rowid, const int32_t mouse_over)
 
void _populate_thumbnails (dt_thumbtable_t *table)
 
void _resize_thumbnails (dt_thumbtable_t *table)
 
void dt_thumbtable_update (dt_thumbtable_t *table)
 
static void _dt_profile_change_callback (gpointer instance, int type, gpointer user_data)
 
static void _refresh_highlights (dt_thumbtable_t *table)
 
static void _dt_selection_changed_callback (gpointer instance, gpointer user_data)
 
static void _dt_active_images_changed_callback (gpointer instance, gpointer user_data)
 
void dt_thumbtable_set_focus_regions (dt_thumbtable_t *table, gboolean enable)
 
gboolean dt_thumbtable_get_focus_regions (dt_thumbtable_t *table)
 
void dt_thumbtable_set_focus_peaking (dt_thumbtable_t *table, gboolean enable)
 
gboolean dt_thumbtable_get_focus_peaking (dt_thumbtable_t *table)
 
void dt_thumbtable_set_draw_group_borders (dt_thumbtable_t *table, gboolean enable)
 
gboolean dt_thumbtable_get_draw_group_borders (dt_thumbtable_t *table)
 
void dt_thumbtable_refresh_thumbnail_real (dt_thumbtable_t *table, int32_t imgid, gboolean reinit)
 
static void _dt_image_info_changed_callback (gpointer instance, gpointer imgs, gpointer user_data)
 
static void _dt_collection_lut (dt_thumbtable_t *table)
 
static gboolean _dt_collection_get_hash (dt_thumbtable_t *table)
 
static void _dt_collection_changed_callback (gpointer instance, dt_collection_change_t query_change, dt_collection_properties_t changed_property, gpointer imgs, const int next, gpointer user_data)
 
static gchar * _thumbs_get_overlays_class (dt_thumbnail_overlay_t over)
 
static void _thumbs_update_overlays_mode (dt_thumbtable_t *table)
 
void dt_thumbtable_set_overlays_mode (dt_thumbtable_t *table, dt_thumbnail_overlay_t over)
 Set the overlay display mode for thumbnails.
 
static void _event_dnd_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, const guint target_type, const guint time, gpointer user_data)
 
static void _thumbtable_drag_set_icon (dt_thumbtable_t *table, GdkDragContext *context)
 
static void _event_dnd_begin (GtkWidget *widget, GdkDragContext *context, gpointer user_data)
 
GList * _thumbtable_dnd_import_check (GList *files, const char *pathname, int *elements)
 
static gboolean _thumbtable_dnd_import (GtkSelectionData *selection_data)
 
void dt_thumbtable_event_dnd_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint target_type, guint time, gpointer user_data)
 Handle drag-and-drop data received.
 
static void _event_dnd_end (GtkWidget *widget, GdkDragContext *context, gpointer user_data)
 
int _imgid_to_rowid (dt_thumbtable_t *table, int32_t imgid)
 
void dt_thumbtable_move_in_grid (dt_thumbtable_t *table, GdkEventKey *event, dt_thumbtable_direction_t direction, int origin_imgid)
 
void _alternative_mode (dt_thumbtable_t *table, gboolean enable)
 
gboolean dt_thumbtable_key_pressed_grid (GtkWidget *self, GdkEventKey *event, gpointer user_data)
 
gboolean dt_thumbtable_key_released_grid (GtkWidget *self, GdkEventKey *event, gpointer user_data)
 
static gboolean _draw_callback (GtkWidget *widget, cairo_t *cr, gpointer user_data)
 
void dt_thumbtable_reset_collection (dt_thumbtable_t *table)
 
gboolean _event_main_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
 
static const dt_thumbtable_layout_ops_t_ops_for_mode (dt_thumbtable_mode_t mode)
 
dt_thumbtable_tdt_thumbtable_new (dt_thumbtable_mode_t mode)
 Create a new thumbnail table widget.
 
void dt_thumbtable_cleanup (dt_thumbtable_t *table)
 
void dt_thumbtable_stop (dt_thumbtable_t *table)
 
void dt_thumbtable_update_parent (dt_thumbtable_t *table)
 
void dt_thumbtable_set_parent (dt_thumbtable_t *table, dt_thumbtable_mode_t mode)
 
void dt_thumbtable_select_all (dt_thumbtable_t *table)
 Select all images in the current grid.
 
void dt_thumbtable_select_range (dt_thumbtable_t *table, const int rowid)
 Select a range of images in the collection.
 
void dt_thumbtable_invert_selection (dt_thumbtable_t *table)
 Invert the current selection.
 
void dt_thumbtable_dispatch_over (dt_thumbtable_t *table, GdkEventType type, int32_t imgid)
 Update the mouse-over image ID with conflict resolution.
 

Variables

static gint64 next_over_time = 0
 

Detailed Description

We keep a double reference of thumbnail objects for the current collection:

  • as a hash table keyed by imgid, in table->list
  • as an array of fixed length, in table->lut.

The hash table is used to keep track of allocated objects to update, redraw and free. Its length is limited to 840 elements or whatever is visible inside viewport at current scroll level. It's garbage-collected.

The LUT is used to speed up lookups for thumbnails at known, bounded positions in sequential order (position in collection = (rowid - 1) in SQLite result = order in GUI = index in the LUT). This LUT prevents us from re-querying the collection in SQLite all the time using: "SELECT rowid, imgid FROM main.collected_images WHERE rowid > min_row AND rowid <= max_row ORDER BY rowid ASC". Note though that SQLite starts indexing at 1, so there is an unit offset. It also keeps a reference to the thumbnail objects, but objets should never be freed from there. Given that collections set on root folders contain all the images from their children, the number of elements in a LUT can be anything from 1 to several 100k images.

It is expected that thumbnails alloc/free always happen using table->list, and that table->lut only updates its references accordingly, because table->list gives us O(1) lookup by imgid and keeps iteration bounded to visible thumbnails.

Keep that in mind if/when extending features.

For image collections having up to 1000 items, we could just statically reset/init the list of thumbnails once when the collection changes, then only resize thumbnails at runtime. But for collections of thousands of images, while adding child widgets is fairly fast, considering, detaching those widgets from the parent takes ages (several orders of magnitude more than attaching). So we have no choice here but to attach and detach dynamically, as to keep the number of children reasonable. "Reasonable" is we populate the current viewport page (at current scrolling position), the previous and the next ones, as to ensure smooth scrolling.

The dimensions of the full collection grid are only ever virtual, but we need to make them real for the scrollbars to behave properly through dynamic loading and unloading of thumbnails. So we set the grid area to what it would be if we loaded all thumbnails.

Definition in file thumbtable.c.

Macro Definition Documentation

◆ CLAMP_ROW

#define CLAMP_ROW (   rowid)    CLAMP(rowid, 0, table->collection_count - 1)

Definition at line 622 of file thumbtable.c.

◆ IS_COLLECTION_EDGE

#define IS_COLLECTION_EDGE (   rowid)    (rowid < 0 || rowid >= table->collection_count)

Definition at line 623 of file thumbtable.c.

Function Documentation

◆ _add_thumbnail_at_rowid()

◆ _add_thumbnail_group_borders()

◆ _alternative_mode()

◆ _draw_callback()

static gboolean _draw_callback ( GtkWidget widget,
cairo_t *  cr,
gpointer  user_data 
)
static

Definition at line 1634 of file thumbtable.c.

References FALSE, IS_NULL_PTR, and TRUE.

Referenced by dt_thumbtable_new().

◆ _dt_active_images_changed_callback()

static void _dt_active_images_changed_callback ( gpointer  instance,
gpointer  user_data 
)
static

Definition at line 878 of file thumbtable.c.

References _refresh_highlights(), and IS_NULL_PTR.

Referenced by dt_thumbtable_cleanup(), and dt_thumbtable_new().

◆ _dt_collection_changed_callback()

◆ _dt_collection_get_hash()

◆ _dt_collection_lut()

◆ _dt_image_info_changed_callback()

◆ _dt_profile_change_callback()

static void _dt_profile_change_callback ( gpointer  instance,
int  type,
gpointer  user_data 
)
static

◆ _dt_selection_changed_callback()

static void _dt_selection_changed_callback ( gpointer  instance,
gpointer  user_data 
)
static

Definition at line 869 of file thumbtable.c.

References _refresh_highlights(), and IS_NULL_PTR.

Referenced by dt_thumbtable_cleanup(), and dt_thumbtable_new().

◆ _dt_thumbtable_empty_list()

◆ _event_dnd_begin()

static void _event_dnd_begin ( GtkWidget widget,
GdkDragContext *  context,
gpointer  user_data 
)
static

◆ _event_dnd_end()

static void _event_dnd_end ( GtkWidget widget,
GdkDragContext *  context,
gpointer  user_data 
)
static

◆ _event_dnd_get()

static void _event_dnd_get ( GtkWidget widget,
GdkDragContext *  context,
GtkSelectionData *  selection_data,
const guint  target_type,
const guint  time,
gpointer  user_data 
)
static

◆ _event_main_leave()

gboolean _event_main_leave ( GtkWidget widget,
GdkEventCrossing *  event,
gpointer  user_data 
)

Definition at line 1653 of file thumbtable.c.

References dt_control_set_mouse_over_id(), IS_NULL_PTR, TRUE, and UNKNOWN_IMAGE.

Referenced by dt_thumbtable_new().

◆ _find_thumb_by_imgid()

dt_thumbnail_t * _find_thumb_by_imgid ( dt_thumbtable_t table,
const int32_t  imgid 
)

Definition at line 587 of file thumbtable.c.

References IS_NULL_PTR, and dt_thumbtable_t::list.

Referenced by _add_thumbnail_at_rowid(), and _thumbtable_drag_set_icon().

◆ _get_row_ids()

static gboolean _get_row_ids ( dt_thumbtable_t table,
int *  rowid_min,
int *  rowid_max 
)
static

◆ _grab_focus()

◆ _grid_configure()

void _grid_configure ( dt_thumbtable_t table,
int  width,
int  height,
int  per_row,
int  thumb_width,
int  thumb_height 
)

◆ _imgid_to_rowid()

◆ _is_rowid_visible()

◆ _mouse_over_image_callback()

◆ _ops_for_mode()

◆ _parent_overlay_size_allocate()

static void _parent_overlay_size_allocate ( GtkWidget widget,
GtkAllocation *  allocation,
gpointer  user_data 
)
static

◆ _populate_thumbnails()

◆ _position_to_rowid()

static int _position_to_rowid ( dt_thumbtable_t table,
const double  x,
const double  y 
)
static

◆ _refresh_highlights()

◆ _resize_thumbnails()

◆ _rowid_to_position()

static void _rowid_to_position ( dt_thumbtable_t table,
int  rowid,
int *  x,
int *  y 
)
static

◆ _scrollbar_page_size_notify()

static void _scrollbar_page_size_notify ( GObject *  object,
GParamSpec *  pspec,
gpointer  user_data 
)
static

◆ _scrollbar_value_changed()

static void _scrollbar_value_changed ( GtkAdjustment *  adjustment,
gpointer  user_data 
)
static

◆ _scrollbar_widget_size_allocate()

static void _scrollbar_widget_size_allocate ( GtkWidget widget,
GtkAllocation *  allocation,
gpointer  user_data 
)
static

◆ _set_thumb_position()

static gboolean _set_thumb_position ( dt_thumbtable_t table,
dt_thumbnail_t thumb 
)
static

◆ _thumb_compare_rowid_desc()

static gint _thumb_compare_rowid_desc ( gconstpointer  a,
gconstpointer  b 
)
static

Definition at line 171 of file thumbtable.c.

References dt_thumbnail_t::rowid.

Referenced by _dt_thumbtable_empty_list(), and dt_thumbtable_stop().

◆ _thumbs_get_overlays_class()

static gchar * _thumbs_get_overlays_class ( dt_thumbnail_overlay_t  over)
static

◆ _thumbs_update_overlays_mode()

static void _thumbs_update_overlays_mode ( dt_thumbtable_t table)
static

◆ _thumbtable_clone_lut()

◆ _thumbtable_dnd_import()

static gboolean _thumbtable_dnd_import ( GtkSelectionData *  selection_data)
static

◆ _thumbtable_dnd_import_check()

GList * _thumbtable_dnd_import_check ( GList *  files,
const char *  pathname,
int *  elements 
)

Definition at line 1323 of file thumbtable.c.

References dt_control_log(), dt_supported_image(), and IS_NULL_PTR.

Referenced by _thumbtable_dnd_import().

◆ _thumbtable_drag_set_icon()

◆ _thumbtable_idle_update()

static gboolean _thumbtable_idle_update ( gpointer  user_data)
static

◆ _thumbtable_schedule_update()

◆ _update_grid_area()

◆ _update_row_ids()

gboolean _update_row_ids ( dt_thumbtable_t table)

◆ dt_thumbtable_cleanup()

◆ dt_thumbtable_configure()

◆ dt_thumbtable_dispatch_over()

void dt_thumbtable_dispatch_over ( dt_thumbtable_t table,
GdkEventType  type,
int32_t  imgid 
)

Update the mouse-over image ID with conflict resolution.

Parameters
tableThe thumbnail table
typeThe event type triggering the update
imgidImage ID the mouse is over

Updates which image is considered "under the mouse", resolving conflicts between mouse and keyboard events.

Definition at line 2143 of file thumbtable.c.

References dt_control_set_keyboard_over_id(), dt_control_set_mouse_over_id(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_thumbtable_find_rowid_from_imgid(), dt_thumbtable_get_scroll_position(), dt_thumbtable_scroll_to_position(), dt_thumbtable_t::grid, dt_thumbtable_t::lock, next_over_time, dt_thumbtable_t::rowid, dt_thumbtable_t::scroll_window, type, and x.

Referenced by _event_main_enter(), _event_main_leave(), _event_main_motion(), _event_main_press(), and dt_thumbtable_move_in_grid().

◆ dt_thumbtable_event_dnd_received()

void dt_thumbtable_event_dnd_received ( GtkWidget widget,
GdkDragContext *  context,
gint  x,
gint  y,
GtkSelectionData *  selection_data,
guint  target_type,
guint  time,
gpointer  user_data 
)

Handle drag-and-drop data received.

Parameters
widgetThe widget receiving the drop
contextThe drag context
xDrop x coordinate
yDrop y coordinate
selection_dataThe dropped data
target_typeTarget type ID
timeTimestamp
user_dataUser data (thumbtable instance)

Handles drops of files/URIs onto the thumbtable. Files are imported into the current film roll.

Definition at line 1401 of file thumbtable.c.

References _thumbtable_dnd_import(), DND_TARGET_URI, FALSE, and IS_NULL_PTR.

Referenced by dt_thumbtable_new().

◆ dt_thumbtable_find_rowid_from_imgid()

◆ dt_thumbtable_get_draw_group_borders()

gboolean dt_thumbtable_get_draw_group_borders ( dt_thumbtable_t table)

Definition at line 914 of file thumbtable.c.

References dt_thumbtable_t::draw_group_borders.

◆ dt_thumbtable_get_focus_peaking()

gboolean dt_thumbtable_get_focus_peaking ( dt_thumbtable_t table)

◆ dt_thumbtable_get_focus_regions()

gboolean dt_thumbtable_get_focus_regions ( dt_thumbtable_t table)

Definition at line 890 of file thumbtable.c.

References dt_thumbtable_t::focus_regions.

Referenced by _focus_checked(), and _focus_toggle_callback().

◆ dt_thumbtable_get_scroll_position()

void dt_thumbtable_get_scroll_position ( dt_thumbtable_t table,
double x,
double y 
)

◆ dt_thumbtable_get_thumbnail_info()

◆ dt_thumbtable_invert_selection()

void dt_thumbtable_invert_selection ( dt_thumbtable_t table)

Invert the current selection.

Parameters
tableThe thumbnail table

Inverts the selection state of all images in the current collection.

Definition at line 2126 of file thumbtable.c.

References dt_thumbtable_t::collection_count, dt_thumbtable_t::collection_inited, darktable, dt_selection_deselect_list(), dt_selection_get_list(), dt_thumbtable_select_all(), and darktable_t::selection.

Referenced by invert_selection_callback().

◆ dt_thumbtable_key_pressed_grid()

◆ dt_thumbtable_key_released_grid()

gboolean dt_thumbtable_key_released_grid ( GtkWidget self,
GdkEventKey *  event,
gpointer  user_data 
)

◆ dt_thumbtable_move_in_grid()

◆ dt_thumbtable_new()

dt_thumbtable_t * dt_thumbtable_new ( dt_thumbtable_mode_t  mode)

Create a new thumbnail table widget.

Parameters
modeThe display mode (filemanager or filmstrip)
Returns
New thumbtable instance or NULL on error

Creates and initializes a new thumbnail table widget with drag-and-drop support, keyboard navigation, and configurable overlays. The widget automatically handles thumbnail loading/unloading as the view scrolls.

Definition at line 1675 of file thumbtable.c.

References _draw_callback(), _dt_active_images_changed_callback(), _dt_collection_changed_callback(), _dt_image_info_changed_callback(), _dt_profile_change_callback(), _dt_selection_changed_callback(), _event_dnd_begin(), _event_dnd_end(), _event_dnd_get(), _event_main_leave(), _mouse_over_image_callback(), _ops_for_mode(), _scrollbar_page_size_notify(), _scrollbar_value_changed(), _scrollbar_widget_size_allocate(), _thumbs_update_overlays_mode(), dt_gui_gtk_t::accels, dt_thumbtable_t::alternate_mode, dt_thumbtable_t::collapse_groups, dt_thumbtable_t::collection_count, dt_thumbtable_t::collection_hash, dt_thumbtable_t::collection_inited, dt_thumbtable_t::configured, dt_thumbtable_layout_ops_t::create_content_widget, dt_accels_t::darkroom_accels, darktable, dt_thumbtable_t::draw_group_borders, dt_accels_build_path(), dt_accels_new_virtual_shortcut(), DT_ACCELS_WIDGET_TOOLTIP_DISABLED_KEY, dt_conf_get_bool(), DT_DEBUG_CONTROL_SIGNAL_CONNECT, dt_free, dt_get_help_url(), dt_gui_add_class(), dt_gui_add_help_link(), dt_pthread_mutex_init(), DT_SIGNAL_ACTIVE_IMAGES_CHANGE, DT_SIGNAL_COLLECTION_CHANGED, DT_SIGNAL_CONTROL_PROFILE_USER_CHANGED, DT_SIGNAL_IMAGE_INFO_CHANGED, DT_SIGNAL_MOUSE_OVER_IMAGE_CHANGE, DT_SIGNAL_SELECTION_CHANGED, dt_thumbtable_event_dnd_received(), dt_thumbtable_key_pressed_grid(), dt_thumbtable_key_released_grid(), DT_THUMBTABLE_MODE_FILEMANAGER, DT_THUMBTABLE_MODE_FILMSTRIP, dt_thumbtable_set_parent(), dummy, FALSE, dt_thumbtable_t::focus_idle_id, dt_accels_t::global_accels, dt_thumbtable_t::grid, dt_thumbtable_t::grid_cols, darktable_t::gui, dt_thumbtable_t::h_scrollbar, dt_thumbtable_t::idle_update_id, dt_thumbtable_t::last_h_scrollbar_height, dt_thumbtable_t::last_parent_height, dt_thumbtable_t::last_parent_width, dt_thumbtable_t::last_v_scrollbar_width, dt_accels_t::lighttable_accels, dt_thumbtable_t::list, dt_thumbtable_t::lock, dt_thumbtable_t::lut, dt_accels_t::map_accels, dt_thumbtable_t::max_row_id, dt_thumbtable_t::min_row_id, dt_thumbtable_t::mode, n_targets_all, dt_thumbtable_t::ops, dt_accels_t::print_accels, dt_thumbtable_t::reset_collection, dt_thumbtable_t::rowid, dt_thumbtable_t::scroll_window, darktable_t::signals, target_list_all, dt_thumbtable_t::thumb_nb, dt_thumbtable_t::thumbs_inited, TRUE, dt_thumbtable_t::v_scrollbar, dt_thumbtable_t::x_position, and dt_thumbtable_t::y_position.

Referenced by _ui_init_panel_bottom(), and dt_ui_init_main_table().

◆ dt_thumbtable_queue_update()

void dt_thumbtable_queue_update ( dt_thumbtable_t table)

◆ dt_thumbtable_refresh_thumbnail_real()

void dt_thumbtable_refresh_thumbnail_real ( dt_thumbtable_t table,
int32_t  imgid,
gboolean  reinit 
)

◆ dt_thumbtable_reset_collection()

void dt_thumbtable_reset_collection ( dt_thumbtable_t table)

Definition at line 1648 of file thumbtable.c.

References dt_thumbtable_t::reset_collection, and TRUE.

Referenced by _culling_mode().

◆ dt_thumbtable_schedule_focus()

void dt_thumbtable_schedule_focus ( dt_thumbtable_t table,
const gint  priority 
)

◆ dt_thumbtable_scroll_to_active_rowid()

int dt_thumbtable_scroll_to_active_rowid ( dt_thumbtable_t table)

Scroll to show the active row.

Parameters
tableThe thumbnail table
Returns
1 if successful, 0 if no active row

Definition at line 434 of file thumbtable.c.

References dt_thumbtable_scroll_to_rowid(), dt_thumbtable_scroll_to_selection(), dt_thumbtable_t::rowid, and UNKNOWN_IMAGE.

Referenced by configure().

◆ dt_thumbtable_scroll_to_imgid()

int dt_thumbtable_scroll_to_imgid ( dt_thumbtable_t table,
int32_t  imgid 
)

Scroll the view to show a specific image.

Parameters
tableThe thumbnail table
imgidThe image ID to scroll to
Returns
1 if successful, 0 if image not found

Definition at line 411 of file thumbtable.c.

References dt_thumbtable_t::collection_count, dt_thumbtable_t::collection_inited, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_thumbtable_find_rowid_from_imgid(), dt_thumbtable_scroll_to_rowid(), IS_NULL_PTR, dt_thumbtable_t::lock, dt_thumbtable_t::lut, dt_thumbtable_t::rowid, and UNKNOWN_IMAGE.

Referenced by dt_thumbtable_move_in_grid(), and dt_thumbtable_scroll_to_selection().

◆ dt_thumbtable_scroll_to_position()

static int dt_thumbtable_scroll_to_position ( dt_thumbtable_t table,
const double  x,
const double  y 
)
static

◆ dt_thumbtable_scroll_to_rowid()

◆ dt_thumbtable_scroll_to_selection()

int dt_thumbtable_scroll_to_selection ( dt_thumbtable_t table)

Scroll to show selected content.

Parameters
tableThe thumbnail table
Returns
1 if successful, 0 if nothing to scroll to

Scrolls to the first-selected image. If none selected, tries keyboard "over", then mouse "over", then last active image, in this order.

Definition at line 444 of file thumbtable.c.

References darktable, dt_control_get_keyboard_over_id(), dt_control_get_mouse_over_id(), dt_selection_get_first_id(), dt_thumbtable_scroll_to_imgid(), and darktable_t::selection.

Referenced by _film_strip_activated(), _grab_focus(), _view_map_button_press_callback(), _view_map_filmstrip_activate_callback(), _view_map_selection_changed(), dt_thumbtable_scroll_to_active_rowid(), dt_ui_panel_show(), enter(), and scroll_to_selection_callback().

◆ dt_thumbtable_select_all()

void dt_thumbtable_select_all ( dt_thumbtable_t table)

Select all images in the current grid.

Parameters
tableThe thumbnail table

Selects all images currently displayed in the thumbnail table through the GUI.

Definition at line 2032 of file thumbtable.c.

References dt_thumbtable_t::collapse_groups, dt_thumbtable_t::collection_count, dt_thumbtable_t::collection_inited, darktable, dt_control_log(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_selection_select_list(), i, dt_thumbtable_cache_t::imgid, dt_thumbtable_t::lock, dt_thumbtable_t::lut, and darktable_t::selection.

Referenced by dt_thumbtable_invert_selection(), and select_all_callback().

◆ dt_thumbtable_select_range()

void dt_thumbtable_select_range ( dt_thumbtable_t table,
const int  rowid 
)

Select a range of images in the collection.

Parameters
tableThe thumbnail table
rowidTarget row index to extend selection to

Selects all images between the closest current selection bound and the specified rowid. Used for shift-click selection behavior.

Definition at line 2056 of file thumbtable.c.

References dt_thumbtable_t::collapse_groups, dt_thumbtable_t::collection_count, dt_thumbtable_t::collection_inited, darktable, dt_control_log(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_selection_get_list(), dt_selection_select_list(), dt_thumbtable_find_rowid_from_imgid(), i, dt_thumbtable_cache_t::imgid, dt_thumbtable_t::lock, dt_thumbtable_t::lut, row, and darktable_t::selection.

Referenced by _event_main_release(), and _grid_handle_key().

◆ dt_thumbtable_set_active_rowid()

void dt_thumbtable_set_active_rowid ( dt_thumbtable_t table)

Update internal active row tracking.

Parameters
tableThe thumbnail table

Updates the internal first visible thumbnail index based on current scroll position.

Definition at line 368 of file thumbtable.c.

References _position_to_rowid(), dt_thumbtable_get_scroll_position(), dt_thumbtable_t::rowid, and x.

Referenced by _dt_collection_changed_callback(), configure(), dt_thumbtable_apply_grid_configuration(), and dt_thumbtable_set_zoom().

◆ dt_thumbtable_set_draw_group_borders()

void dt_thumbtable_set_draw_group_borders ( dt_thumbtable_t table,
gboolean  enable 
)

◆ dt_thumbtable_set_focus_peaking()

void dt_thumbtable_set_focus_peaking ( dt_thumbtable_t table,
gboolean  enable 
)

◆ dt_thumbtable_set_focus_regions()

void dt_thumbtable_set_focus_regions ( dt_thumbtable_t table,
gboolean  enable 
)

◆ dt_thumbtable_set_overlays_mode()

void dt_thumbtable_set_overlays_mode ( dt_thumbtable_t table,
dt_thumbnail_overlay_t  over 
)

Set the overlay display mode for thumbnails.

Parameters
tableThe thumbnail table
overNew overlay mode to use

Changes how overlays (text, icons etc) are displayed on thumbnails. Updates all visible thumbnails immediately.

Definition at line 1181 of file thumbtable.c.

References _resize_thumbnails(), _thumbs_get_overlays_class(), dt_conf_set_int(), dt_free, dt_gui_add_class(), dt_gui_remove_class(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), FALSE, dt_thumbtable_t::grid, IS_NULL_PTR, dt_thumbtable_t::lock, dt_thumbtable_t::overlays, sanitize_overlays(), and dt_thumbtable_t::thumbs_inited.

Referenced by _thumbs_update_overlays_mode(), always_hide_overlays_callback(), always_show_overlays_callback(), and hover_overlays_callback().

◆ dt_thumbtable_set_parent()

◆ dt_thumbtable_stop()

◆ dt_thumbtable_thumb_cell_decoration()

int dt_thumbtable_thumb_cell_decoration ( void  )

Definition at line 522 of file thumbtable.c.

References MAX.

Referenced by _filmstrip_configure_dims(), and _grid_configure_dims().

◆ dt_thumbtable_update()

◆ dt_thumbtable_update_parent()

void dt_thumbtable_update_parent ( dt_thumbtable_t table)

Definition at line 2014 of file thumbtable.c.

References dt_thumbtable_schedule_focus().

Referenced by dt_ui_panel_show(), and enter().

Variable Documentation

◆ next_over_time

gint64 next_over_time = 0
static

Definition at line 2141 of file thumbtable.c.

Referenced by dt_thumbtable_dispatch_over().