44 return gtk_fixed_new();
51 int *per_row,
int *thumb_width,
int *thumb_height)
58 gtk_widget_style_get(table->
scroll_window,
"scrollbar-spacing", &sb_spacing, NULL);
66 const int v_scroll_w = v_scroll ? gtk_widget_get_allocated_width(v_scroll) : 0;
67 if(v_scroll_w > 0)
width -= v_scroll_w + sb_spacing;
79 *thumb_width = (int)floorf((
float)(
width - deco) / (
float)
MAX(cols, 1));
80 *thumb_height = (cols == 1) ?
height : *thumb_width;
101 float page_size = gtk_adjustment_get_page_size(table->
v_scrollbar);
119 int page_size = gtk_adjustment_get_page_size(table->
v_scrollbar);
121 int page_bottom = page_size +
position;
125 return img_top >=
position && img_bottom <= page_bottom;
130 int current_w = 0, current_h = 0;
131 gtk_widget_get_size_request(table->
grid, ¤t_w, ¤t_h);
150 const int32_t rowid = thumb->
rowid;
185 gtk_fixed_put(GTK_FIXED(table->
grid), thumb->
widget, thumb->
x, thumb->
y);
190 gtk_fixed_move(GTK_FIXED(table->
grid), thumb->
widget, thumb->
x, thumb->
y);
213 if(widget != v_scroll)
return FALSE;
251 gtk_widget_set_name(table->
grid,
"thumbtable-filemanager");
253 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(table->
scroll_window), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
266 if(!
IS_NULL_PTR(toplevel) && GTK_IS_WINDOW(toplevel))
267 focused = gtk_window_get_focus(GTK_WINDOW(toplevel));
273 if(
IS_NULL_PTR(focused) || (!GTK_IS_EDITABLE(focused) && !GTK_IS_TEXT_VIEW(focused)))
274 gtk_widget_grab_focus(table->
grid);
305 case GDK_KEY_nobreakspace:
376 gpointer
value = NULL;
377 g_hash_table_iter_init(&iter, table->
list);
378 while(g_hash_table_iter_next(&iter, NULL, &
value))
381 thumb->
zoomx += delta_x;
382 thumb->
zoomy += delta_y;
383 gtk_widget_queue_draw(thumb->
w_image);
411 if(table->
thumb_nb == 0) gtk_widget_queue_draw(table->
grid);
418 return G_SOURCE_REMOVE;
Handle default and user-set shortcuts (accelerators)
int dt_conf_get_int(const char *name)
void dt_print(dt_debug_thread_t thread, const char *msg,...)
static const dt_aligned_pixel_simd_t value
static gboolean dt_modifier_is(const GdkModifierType state, const GdkModifierType desired_modifier_mask)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
static int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
void dt_thumbtable_set_zoom(dt_thumbtable_t *table, dt_thumbtable_zoom_t level)
static void _grid_place_child(dt_thumbtable_t *table, dt_thumbnail_t *thumb)
void dt_thumbtable_offset_zoom(dt_thumbtable_t *table, const double delta_x, const double delta_y)
void dt_thumbtable_apply_grid_configuration(dt_thumbtable_t *table)
Apply grid configuration changes with proper event synchronization.
static void _grid_on_drag_begin(dt_thumbtable_t *table, int32_t imgid)
static void _grid_rowid_to_position(dt_thumbtable_t *table, int rowid, int *x, int *y)
static GtkWidget * _grid_create_content_widget(void)
static gboolean _grid_wants_page_size_notify(dt_thumbtable_t *table, GObject *object)
static gboolean _grid_wants_scroll_value(dt_thumbtable_t *table, GtkAdjustment *adjustment)
static gboolean _grid_is_thumb_highlighted(dt_thumbtable_t *table, int32_t imgid)
static gboolean _grid_is_rowid_visible(dt_thumbtable_t *table, int rowid)
static void _grid_get_row_ids(dt_thumbtable_t *table, int *rowid_min, int *rowid_max)
static void _grid_group_borders(dt_thumbtable_t *table, dt_thumbnail_t *thumb, dt_thumbnail_border_t *borders)
static void _grid_setup_parent(dt_thumbtable_t *table)
static gboolean _grid_handle_key(dt_thumbtable_t *table, GdkEventKey *event, guint key, int32_t imgid)
static gboolean _thumbtable_idle_apply_grid_configuration(gpointer user_data)
Idle callback for applying grid configuration.
static void _grid_move_child(dt_thumbtable_t *table, dt_thumbnail_t *thumb)
static void _grid_update_content_size(dt_thumbtable_t *table)
static void _grid_grab_focus(dt_thumbtable_t *table)
static void _grid_on_thumbnail_added(dt_thumbtable_t *table, dt_thumbnail_t *thumb)
dt_thumbtable_zoom_t dt_thumbtable_get_zoom(dt_thumbtable_t *table)
static int _grid_position_to_rowid(dt_thumbtable_t *table, const double x, const double y)
const dt_thumbtable_layout_ops_t * dt_thumbtable_grid_ops(void)
static void _grid_pre_activate(dt_thumbtable_t *table, int32_t imgid)
static gboolean _grid_relevant_scrollbar_changed(dt_thumbtable_t *table, GtkWidget *widget, GtkAllocation *allocation)
static void _grid_configure_dims(dt_thumbtable_t *table, int *new_width, int *new_height, int *per_row, int *thumb_width, int *thumb_height)
void dt_gui_add_help_link(GtkWidget *widget, char *link)
gboolean dt_selection_is_id_selected(struct 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_toggle(dt_selection_t *selection, int32_t imgid)
struct _GtkWidget GtkWidget
struct dt_selection_t * selection
struct dt_view_manager_t * view_manager
Per-mode layout strategy. One instance per frontend, shared (const) by all tables of that mode and st...
GtkWidget *(* create_content_widget)(void)
GtkAdjustment * v_scrollbar
dt_thumbtable_zoom_t zoom
int last_v_scrollbar_width
GtkWidget * scroll_window
dt_thumbtable_cache_t * lut
GtkWidget * parent_overlay
void dt_thumbnail_update_selection(dt_thumbnail_t *thumb, gboolean selected)
@ DT_THUMBNAIL_BORDER_BOTTOM
@ DT_THUMBNAIL_BORDER_TOP
@ DT_THUMBNAIL_BORDER_RIGHT
@ DT_THUMBNAIL_BORDER_LEFT
void dt_thumbtable_update(dt_thumbtable_t *table)
void dt_thumbtable_set_active_rowid(dt_thumbtable_t *table)
Update internal active row tracking.
void dt_thumbtable_configure(dt_thumbtable_t *table)
int dt_thumbtable_thumb_cell_decoration(void)
void dt_thumbtable_schedule_focus(dt_thumbtable_t *table, const gint priority)
int dt_thumbtable_find_rowid_from_imgid(dt_thumbtable_t *table, const int32_t imgid)
#define IS_COLLECTION_EDGE(rowid)
void dt_thumbtable_move_in_grid(dt_thumbtable_t *table, GdkEventKey *event, dt_thumbtable_direction_t direction, int origin_imgid)
void dt_thumbtable_select_range(dt_thumbtable_t *table, const int rowid)
Select a range of images in the collection.
A widget to manage and display image thumbnails in Ansel's lighttable and filmstrip views.
dt_thumbtable_zoom_t
Zoom levels for thumbnail display.
#define dt_thumbtable_refresh_thumbnail(table, imgid, reinit)
Private interface shared between the thumbtable engine (thumbtable.c) and its two frontends (filemana...
char * dt_get_help_url(char *name)
const dt_view_t * dt_view_manager_get_current_view(dt_view_manager_t *vm)