Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
filemanager.c File Reference

FILEMANAGER frontend of the thumbtable: the lighttable grid layout, its layout-ops vtable, and the grid-only public API (zoom + grid reconfiguration). The shared engine lives in thumbtable.c; see thumbtable_internal.h for the ops contract. More...

#include "common/darktable.h"
#include "common/collection.h"
#include "common/selection.h"
#include "control/control.h"
#include "dtgtk/thumbtable.h"
#include "dtgtk/thumbtable_internal.h"
#include "dtgtk/thumbnail.h"
#include "gui/accelerators.h"
#include "gui/gtk.h"
#include <math.h>
+ Include dependency graph for filemanager.c:

Go to the source code of this file.

Functions

static GtkWidget_grid_create_content_widget (void)
 
static void _grid_configure_dims (dt_thumbtable_t *table, int *new_width, int *new_height, int *per_row, int *thumb_width, int *thumb_height)
 
static void _grid_rowid_to_position (dt_thumbtable_t *table, int rowid, int *x, int *y)
 
static int _grid_position_to_rowid (dt_thumbtable_t *table, const double x, const double y)
 
static void _grid_get_row_ids (dt_thumbtable_t *table, int *rowid_min, int *rowid_max)
 
static gboolean _grid_is_rowid_visible (dt_thumbtable_t *table, int rowid)
 
static void _grid_update_content_size (dt_thumbtable_t *table)
 
static void _grid_group_borders (dt_thumbtable_t *table, dt_thumbnail_t *thumb, dt_thumbnail_border_t *borders)
 
static void _grid_place_child (dt_thumbtable_t *table, dt_thumbnail_t *thumb)
 
static void _grid_move_child (dt_thumbtable_t *table, dt_thumbnail_t *thumb)
 
static gboolean _grid_wants_scroll_value (dt_thumbtable_t *table, GtkAdjustment *adjustment)
 
static gboolean _grid_wants_page_size_notify (dt_thumbtable_t *table, GObject *object)
 
static gboolean _grid_relevant_scrollbar_changed (dt_thumbtable_t *table, GtkWidget *widget, GtkAllocation *allocation)
 
static gboolean _grid_is_thumb_highlighted (dt_thumbtable_t *table, int32_t imgid)
 
static void _grid_on_thumbnail_added (dt_thumbtable_t *table, dt_thumbnail_t *thumb)
 
static void _grid_on_drag_begin (dt_thumbtable_t *table, int32_t imgid)
 
static void _grid_setup_parent (dt_thumbtable_t *table)
 
static void _grid_grab_focus (dt_thumbtable_t *table)
 
static gboolean _grid_handle_key (dt_thumbtable_t *table, GdkEventKey *event, guint key, int32_t imgid)
 
static void _grid_pre_activate (dt_thumbtable_t *table, int32_t imgid)
 
const dt_thumbtable_layout_ops_tdt_thumbtable_grid_ops (void)
 
void dt_thumbtable_set_zoom (dt_thumbtable_t *table, dt_thumbtable_zoom_t level)
 
dt_thumbtable_zoom_t dt_thumbtable_get_zoom (dt_thumbtable_t *table)
 
void dt_thumbtable_offset_zoom (dt_thumbtable_t *table, const double delta_x, const double delta_y)
 
static gboolean _thumbtable_idle_apply_grid_configuration (gpointer user_data)
 Idle callback for applying grid configuration.
 
void dt_thumbtable_apply_grid_configuration (dt_thumbtable_t *table)
 Apply grid configuration changes with proper event synchronization.
 

Detailed Description

FILEMANAGER frontend of the thumbtable: the lighttable grid layout, its layout-ops vtable, and the grid-only public API (zoom + grid reconfiguration). The shared engine lives in thumbtable.c; see thumbtable_internal.h for the ops contract.

Definition in file filemanager.c.

Function Documentation

◆ _grid_configure_dims()

static void _grid_configure_dims ( dt_thumbtable_t table,
int *  new_width,
int *  new_height,
int *  per_row,
int *  thumb_width,
int *  thumb_height 
)
static

◆ _grid_create_content_widget()

static GtkWidget * _grid_create_content_widget ( void  )
static

Definition at line 40 of file filemanager.c.

Referenced by dt_thumbtable_grid_ops().

◆ _grid_get_row_ids()

static void _grid_get_row_ids ( dt_thumbtable_t table,
int *  rowid_min,
int *  rowid_max 
)
static

◆ _grid_grab_focus()

◆ _grid_group_borders()

◆ _grid_handle_key()

◆ _grid_is_rowid_visible()

static gboolean _grid_is_rowid_visible ( dt_thumbtable_t table,
int  rowid 
)
static

◆ _grid_is_thumb_highlighted()

static gboolean _grid_is_thumb_highlighted ( dt_thumbtable_t table,
int32_t  imgid 
)
static

◆ _grid_move_child()

static void _grid_move_child ( dt_thumbtable_t table,
dt_thumbnail_t thumb 
)
static

◆ _grid_on_drag_begin()

static void _grid_on_drag_begin ( dt_thumbtable_t table,
int32_t  imgid 
)
static

Definition at line 234 of file filemanager.c.

References darktable, dt_selection_select(), darktable_t::selection, and UNKNOWN_IMAGE.

Referenced by dt_thumbtable_grid_ops().

◆ _grid_on_thumbnail_added()

static void _grid_on_thumbnail_added ( dt_thumbtable_t table,
dt_thumbnail_t thumb 
)
static

◆ _grid_place_child()

static void _grid_place_child ( dt_thumbtable_t table,
dt_thumbnail_t thumb 
)
static

◆ _grid_position_to_rowid()

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

◆ _grid_pre_activate()

static void _grid_pre_activate ( dt_thumbtable_t table,
int32_t  imgid 
)
static

Definition at line 318 of file filemanager.c.

References darktable, dt_selection_select_single(), and darktable_t::selection.

Referenced by dt_thumbtable_grid_ops().

◆ _grid_relevant_scrollbar_changed()

static gboolean _grid_relevant_scrollbar_changed ( dt_thumbtable_t table,
GtkWidget widget,
GtkAllocation *  allocation 
)
static

◆ _grid_rowid_to_position()

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

◆ _grid_setup_parent()

static void _grid_setup_parent ( dt_thumbtable_t table)
static

◆ _grid_update_content_size()

◆ _grid_wants_page_size_notify()

static gboolean _grid_wants_page_size_notify ( dt_thumbtable_t table,
GObject *  object 
)
static

Definition at line 201 of file filemanager.c.

References dt_thumbtable_t::v_scrollbar.

Referenced by dt_thumbtable_grid_ops().

◆ _grid_wants_scroll_value()

static gboolean _grid_wants_scroll_value ( dt_thumbtable_t table,
GtkAdjustment *  adjustment 
)
static

Definition at line 196 of file filemanager.c.

References dt_thumbtable_t::v_scrollbar.

Referenced by dt_thumbtable_grid_ops().

◆ _thumbtable_idle_apply_grid_configuration()

static gboolean _thumbtable_idle_apply_grid_configuration ( gpointer  user_data)
static

Idle callback for applying grid configuration.

This handler is used when grid configuration changes (like column count). It handles the grid reconfiguration and thumbnail updates, then schedules a follow-up idle callback for scrolling to ensure proper GTK widget state.

Definition at line 395 of file filemanager.c.

References dt_thumbtable_configure(), dt_thumbtable_refresh_thumbnail, dt_thumbtable_schedule_focus(), dt_thumbtable_update(), dt_thumbtable_t::grid, dt_thumbtable_t::idle_update_id, IS_NULL_PTR, dt_thumbtable_t::thumb_nb, TRUE, and UNKNOWN_IMAGE.

Referenced by dt_thumbtable_apply_grid_configuration().

◆ dt_thumbtable_apply_grid_configuration()

void dt_thumbtable_apply_grid_configuration ( dt_thumbtable_t table)

Apply grid configuration changes with proper event synchronization.

Parameters
tableThe thumbnail table

This function should be called when grid properties like column count change. It properly coalesces and orders the necessary updates:

  1. Configures the grid based on current column settings
  2. Updates and resizes all visible thumbnails
  3. Scrolls to maintain the active selection in view

Unlike calling the functions separately, this ensures all operations happen together in the correct order within a single idle callback, preventing partial updates or out-of-sync scroll positions.

Definition at line 421 of file filemanager.c.

References _thumbtable_idle_apply_grid_configuration(), dt_thumbtable_set_active_rowid(), dt_thumbtable_t::idle_update_id, IS_NULL_PTR, and dt_thumbtable_t::scroll_window.

Referenced by _set_columns().

◆ dt_thumbtable_get_zoom()

dt_thumbtable_zoom_t dt_thumbtable_get_zoom ( dt_thumbtable_t table)

Definition at line 367 of file filemanager.c.

References dt_thumbtable_t::zoom.

Referenced by _zoom_checked().

◆ dt_thumbtable_grid_ops()

◆ dt_thumbtable_offset_zoom()

void dt_thumbtable_offset_zoom ( dt_thumbtable_t table,
const double  delta_x,
const double  delta_y 
)

◆ dt_thumbtable_set_zoom()