Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
widget_settings.c
Go to the documentation of this file.
1/*
2 * This file is part of darktable,
3 * Copyright (C) 2016 johannes hanika.
4 * Copyright (C) 2016, 2020 Tobias Ellinghaus.
5 * Copyright (C) 2020 Pascal Obry.
6 * Copyright (C) 2021 Sakari Kapanen.
7 * Copyright (C) 2022 Martin Baƙinka.
8 * Copyright (C) 2026 Guillaume Stutin.
9 *
10 * darktable is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * darktable is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with darktable. If not, see <http://www.gnu.org/licenses/>.
22 */
23
25
26
27
28#include <stdint.h>
29#include <math.h>
30#include <pthread.h>
31#include <stdarg.h>
32#include <stdio.h>
33
34#ifdef GDK_WINDOWING_QUARTZ
35#include "osx/osx.h" // dt_osx_get_ppd(), the only reliable ppd source on quartz
36#endif
37
38// Toolkit state, set by the application during GUI init and read everywhere after.
39// Single-threaded by construction: all of it is touched from the GUI thread only.
40static GdkEventMask _scroll_mask = GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK;
41static GtkWidget *_scroll_focus = NULL;
42static cairo_filter_t _image_filter = CAIRO_FILTER_GOOD;
43
44GdkEventMask dt_widget_scroll_mask(void)
45{
46 return _scroll_mask;
47}
48
49void dt_widget_set_scroll_mask(GdkEventMask mask)
50{
51 _scroll_mask = mask;
52}
53
58
60{
61 _scroll_focus = widget;
62}
63
64cairo_filter_t dt_widget_image_filter(void)
65{
66 return _image_filter;
67}
68
69void dt_widget_set_image_filter(cairo_filter_t filter)
70{
71 _image_filter = filter;
72}
73
74// Widget-update suppression depth. Was a field of dt_gui_gtk_t; it is toolkit state, and a
75// widget should not need the application global to know whether to ignore its own callback.
76static int32_t _widget_suppress_depth = 0;
77
78// Depth of choice announcements in progress, see dt_gui_widgets_choice_announced().
79static int32_t _widget_choice_depth = 0;
80
81// Which thread owns widget state, and whether it has been registered at all.
82static pthread_t _gui_thread;
83static gboolean _gui_thread_set = FALSE;
84
85// Scroll axis inversion, a user preference the application supplies.
86static gboolean _reverse_x = FALSE, _reverse_y = FALSE;
87
88// Toolkit metrics. Defaults are the 96-DPI, 16px-font reference: correct for standalone
89// dialogs that run after gtk_init() but before the application has resolved the real values.
90//
91// The store is here rather than in gui/, even though the GUI is what resolves the values,
92// because every widget reads them on every draw: putting it in gui/ would make widgets/
93// depend on gui/, and that dependency direction is what makes this module portable at all.
94// gui/screen_metrics.c forwards to these under the dt_screen_* names for the handful of
95// readers below layer 4 (the crash reporter, telemetry) and for the cairo helpers.
96static double _dpi = 96.0;
97static double _dpi_factor = 1.0;
98static double _ppd = 1.0;
99static double _em = 16.0;
100static gboolean _metrics_probed = FALSE;
101
102double dt_widget_dpi(void) { return _dpi; }
103void dt_widget_set_dpi(double dpi) { if(dpi > 0.0) { _dpi = dpi; _metrics_probed = TRUE; } }
104
106
111
116
121
126
128{
130}
131
136
137void dt_widget_message(const char *message)
138{
139 if(_message_handler && message) _message_handler(message);
140}
141
146
147void dt_widget_set_cursor(GdkCursorType cursor)
148{
150}
151
152double dt_widget_dpi_factor(void) { return _dpi_factor; }
154
155double dt_widget_ppd(void) { return _ppd; }
156void dt_widget_set_ppd(double ppd) { if(ppd > 0.0) { _ppd = ppd; _metrics_probed = TRUE; } }
157
158double dt_widget_em_size(void) { return _em; }
159void dt_widget_set_em_size(double em) { if(em > 0.0) _em = em; }
160
161void dt_widget_set_gui_thread(pthread_t thread)
162{
163 _gui_thread = thread;
165}
166
167void dt_widget_set_scroll_reversed(gboolean reverse_x, gboolean reverse_y)
168{
169 _reverse_x = reverse_x;
170 _reverse_y = reverse_y;
171}
172
174{
175 return _gui_thread_set && pthread_equal(_gui_thread, pthread_self());
176}
177
178// Colour-label palette, supplied by the application's theme.
179static GdkRGBA _colorlabels[16];
180static int _colorlabels_count = 0;
181
182const GdkRGBA *dt_widget_colorlabel(int index)
183{
184 if(index < 0 || index >= _colorlabels_count) return NULL;
185 return &_colorlabels[index];
186}
187
188void dt_widget_set_colorlabels(const GdkRGBA *labels, int count)
189{
190 if(labels == NULL || count <= 0) { _colorlabels_count = 0; return; }
191 if(count > (int)(sizeof(_colorlabels) / sizeof(_colorlabels[0])))
192 count = (int)(sizeof(_colorlabels) / sizeof(_colorlabels[0]));
193 for(int i = 0; i < count; i++) _colorlabels[i] = labels[i];
194 _colorlabels_count = count;
195}
196
198{
199 return _widget_suppress_depth > 0;
200}
201
202void dt_gui_freeze_begin_(const char *file, int line)
203{
204 // Only the GUI thread owns widget state. Off-thread callers (notably worker-thread
205 // reload_defaults during thumbnail/export, which has no widgets to suppress) must not touch
206 // the shared depth, or concurrent non-atomic ++/-- drift it and break suppression for the
207 // GUI thread. For them this is a deliberate no-op.
208 if(!dt_widget_on_gui_thread()) return;
209 // MAX(.,0) heals any pre-existing negative drift so the depth is always genuinely suppressing.
211 (void)file;
212 (void)line;
213}
214
215void dt_gui_freeze_end_(const char *file, int line)
216{
217 if(!dt_widget_on_gui_thread()) return;
219 {
220 // A bare end with nothing to match: an unbalanced freeze bracket exists. Surface it (with
221 // the offending site) instead of letting the counter go negative and silently disable
222 // suppression for the rest of the session.
223 fprintf(stderr, "[dt_gui_freeze] unbalanced end at %s:%d (depth was %d); "
224 "look for a freeze begin without a matching end.\n",
225 file, line, _widget_suppress_depth);
227 return;
228 }
230}
231
233{
235}
236
238{
239 if(!dt_widget_on_gui_thread()) return;
241}
242
248
250{
251 return _widget_choice_depth > 0;
252}
253
254gboolean dt_gui_get_scroll_unit_deltas(const GdkEventScroll *event, int *delta_x, int *delta_y)
255{
256 // avoid double counting real and emulated events when receiving smooth scrolls
257 if(gdk_event_get_pointer_emulated((GdkEvent*)event)) return FALSE;
258
259 // accumulates scrolling regardless of source or the widget being scrolled
260 static gdouble acc_x = 0.0, acc_y = 0.0;
261
262 gboolean handled = FALSE;
263
264 switch(event->direction)
265 {
266 // is one-unit cardinal, e.g. from a mouse scroll wheel
267 case GDK_SCROLL_LEFT:
268 if(delta_x)
269 {
270 *delta_x = _reverse_x ? 1 : -1;
271 if(delta_y) *delta_y = 0;
272 handled = TRUE;
273 }
274 break;
275 case GDK_SCROLL_RIGHT:
276 if(delta_x)
277 {
278 *delta_x = _reverse_x ? -1 : 1;
279 if(delta_y) *delta_y = 0;
280 handled = TRUE;
281 }
282 break;
283 case GDK_SCROLL_UP:
284 if(delta_y)
285 {
286 if(delta_x) *delta_x = 0;
287 *delta_y = _reverse_y ? 1 : -1;
288 handled = TRUE;
289 }
290 break;
291 case GDK_SCROLL_DOWN:
292 if(delta_y)
293 {
294 if(delta_x) *delta_x = 0;
295 *delta_y = _reverse_y ? -1 : 1;
296 handled = TRUE;
297 }
298 break;
299 // is trackpad (or touch) scroll
300 case GDK_SCROLL_SMOOTH:
301 // stop events reset accumulated delta
302 if(event->is_stop)
303 {
304 acc_x = acc_y = 0.0;
305 break;
306 }
307 // accumulate trackpad/touch scrolls until they make a unit
308 // scroll, and only then tell caller that there is a scroll to
309 // handle
310#ifdef GDK_WINDOWING_QUARTZ // on macOS deltas need to be scaled
311 acc_x += _reverse_x ? -event->delta_x / 50. : event->delta_x / 50.;
312 acc_y += _reverse_y ? -event->delta_y / 50. : event->delta_y / 50.;
313#else
314 acc_x += _reverse_x ? -event->delta_x : event->delta_x;
315 acc_y += _reverse_y ? -event->delta_y : event->delta_y;
316#endif
317 const gdouble amt_x = trunc(acc_x);
318 const gdouble amt_y = trunc(acc_y);
319 if(amt_x != 0 || amt_y != 0)
320 {
321 acc_x -= amt_x;
322 acc_y -= amt_y;
323 if((delta_x && amt_x != 0) || (delta_y && amt_y != 0))
324 {
325 if(delta_x) *delta_x = (int)amt_x;
326 if(delta_y) *delta_y = (int)amt_y;
327 handled = TRUE;
328 }
329 }
330 break;
331 default:
332 break;
333 }
334 return handled;
335}
336
337gboolean dt_gui_get_scroll_unit_delta(const GdkEventScroll *event, int *delta)
338{
339 int delta_x, delta_y;
340 if(dt_gui_get_scroll_unit_deltas(event, &delta_x, &delta_y))
341 {
342 *delta = delta_x + delta_y;
343 return TRUE;
344 }
345 return FALSE;
346}
347#ifdef _DEBUG
348void dt_widget_log(const char *format, ...)
349{
350 va_list ap;
351 va_start(ap, format);
352 vfprintf(stdout, format, ap);
353 va_end(ap);
354 // Unflushed diagnostics are lost when the process does not exit cleanly, which is exactly
355 // the run you were debugging.
356 fflush(stdout);
357}
358#endif
359
360static gboolean _debug_overlays = FALSE;
361
363{
364 return _debug_overlays;
365}
366
371
376
387
388gboolean dt_widget_stored_int(const char *key, int *value)
389{
390 if(!key || !_stored_int_getter) return FALSE;
392}
393
394void dt_widget_store_int(const char *key, int value)
395{
397}
398
399gboolean dt_widget_stored_bool(const char *key)
400{
401 if(!key || !_stored_bool_getter) return FALSE;
402 return _stored_bool_getter(key);
403}
404
405void dt_widget_store_bool(const char *key, gboolean value)
406{
408}
409
410static gint _min_panel_width = 350;
411
413{
414 return _min_panel_width;
415}
416
421
422static gboolean _theme_loaded = FALSE;
423
425{
426 return _theme_loaded;
427}
428
429void dt_widget_set_theme_loaded(gboolean loaded)
430{
431 _theme_loaded = loaded;
432}
433
436
441
446
451
456
457
458/* ------------------------------------------------------------------------------------------
459 * Theme palette, overlay tint and mouse radius.
460 *
461 * All three used to be fields of dt_gui_gtk_t, which meant a widget had to reach the
462 * application global to find out what colour to paint with or how close a click counts as a
463 * hit. They are toolkit state: the application resolves them (from the CSS theme, from user
464 * preferences, from the darkroom zoom) and pushes them here, and widgets read them.
465 * ------------------------------------------------------------------------------------------ */
466static GdkRGBA _colors[DT_GUI_COLOR_LAST] = { { 0.0, 0.0, 0.0, 1.0 } };
467static dt_widget_overlay_color_t _overlay = { 1.0, 1.0, 1.0, 0.5 };
468static float _mouse_radius = 15.f;
469static float _mouse_radius_clamped = 15.f;
470
471GdkRGBA *dt_widget_colors(void)
472{
473 return _colors;
474}
475
477{
478 const GdkRGBA bc = _colors[color];
479 cairo_set_source_rgb(cr, bc.red, bc.green, bc.blue);
480}
481
482void dt_widget_set_source_rgba(cairo_t *cr, dt_gui_color_t color, float opacity_coef)
483{
484 const GdkRGBA bc = _colors[color];
485 cairo_set_source_rgba(cr, bc.red, bc.green, bc.blue, bc.alpha * opacity_coef);
486}
487
492
493void dt_widget_set_overlay_color(double red, double green, double blue, double contrast)
494{
495 _overlay.red = red;
496 _overlay.green = green;
497 _overlay.blue = blue;
498 _overlay.contrast = contrast;
499}
500
502{
503 return _mouse_radius;
504}
505
510
511void dt_widget_set_mouse_radius(float radius, float clamped)
512{
513 _mouse_radius = radius;
514 _mouse_radius_clamped = clamped;
515}
516
517
518/* Scroll deltas as fractions. Same event arithmetic as the discrete-unit pair below, minus
519 * the accumulation: callers of this form want the raw smooth-scroll amount. */
520gboolean dt_gui_get_scroll_deltas(const GdkEventScroll *event, gdouble *delta_x, gdouble *delta_y)
521{
522 // avoid double counting real and emulated events when receiving smooth scrolls
523 if(gdk_event_get_pointer_emulated((GdkEvent *)event)) return FALSE;
524
525 gboolean handled = FALSE;
526 switch(event->direction)
527 {
528 // is one-unit cardinal, e.g. from a mouse scroll wheel
529 case GDK_SCROLL_LEFT:
530 if(delta_x)
531 {
532 *delta_x = _reverse_x ? 1.0 : -1.0;
533 if(delta_y) *delta_y = 0.0;
534 handled = TRUE;
535 }
536 break;
537 case GDK_SCROLL_RIGHT:
538 if(delta_x)
539 {
540 *delta_x = _reverse_x ? -1.0 : 1.0;
541 if(delta_y) *delta_y = 0.0;
542 handled = TRUE;
543 }
544 break;
545 case GDK_SCROLL_UP:
546 if(delta_y)
547 {
548 if(delta_x) *delta_x = 0.0;
549 *delta_y = _reverse_y ? 1.0 : -1.0;
550 handled = TRUE;
551 }
552 break;
553 case GDK_SCROLL_DOWN:
554 if(delta_y)
555 {
556 if(delta_x) *delta_x = 0.0;
557 *delta_y = _reverse_y ? -1.0 : 1.0;
558 handled = TRUE;
559 }
560 break;
561 // is trackpad (or touch) scroll
562 case GDK_SCROLL_SMOOTH:
563 if((delta_x && event->delta_x != 0) || (delta_y && event->delta_y != 0))
564 {
565#ifdef GDK_WINDOWING_QUARTZ // on macOS deltas need to be scaled
566 if(delta_x) *delta_x = _reverse_x ? -event->delta_x / 50. : event->delta_x / 50.;
567 if(delta_y) *delta_y = _reverse_y ? -event->delta_y / 50. : event->delta_y / 50.;
568#else
569 if(delta_x) *delta_x = _reverse_x ? -event->delta_x : event->delta_x;
570 if(delta_y) *delta_y = _reverse_y ? -event->delta_y : event->delta_y;
571#endif
572 handled = TRUE;
573 }
574 break;
575 default:
576 break;
577 }
578 return handled;
579}
580
581gboolean dt_gui_get_scroll_delta(const GdkEventScroll *event, gdouble *delta)
582{
583 gdouble delta_x, delta_y;
584 if(dt_gui_get_scroll_deltas(event, &delta_x, &delta_y))
585 {
586 *delta = delta_x + delta_y;
587 return TRUE;
588 }
589 return FALSE;
590}
591
592
593#ifdef _DEBUG
594void dt_gtk_widget_queue_draw_ext(GtkWidget *widget, const char *name, const char *file, const int line)
595{
596 if(!GTK_IS_WIDGET(widget))
597 {
598 dt_widget_log("gtk_widget_queue_draw(%s) called with a non-WIDGET or NULL widget at %s:%d (widget=%p)\n",
599 name, file, line, widget);
600 return;
601 }
602 else
603 dt_widget_log("queueing redraw for `%s` (`%s`) at %s:%d\n",
604 name, gtk_widget_get_name(widget), file, line);
605
606 (gtk_widget_queue_draw)(widget);
607}
608
609void dt_gtk_toggle_button_set_active_ext(GtkToggleButton *toggle_button, const char *name, const gboolean active,
610 const char *file, const int line)
611{
612 if(!GTK_IS_TOGGLE_BUTTON(toggle_button))
613 {
614 dt_widget_log("gtk_toggle_button_set_active(%s) called with a non-TOGGLE_BUTTON or NULL widget at %s:%d (toggle_button=%p)\n",
615 name, file, line, toggle_button);
616 return;
617 }
618 else
619 dt_widget_log("setting toggle button `%s` (`%s`) to %s at %s:%d\n",
620 name, gtk_widget_get_name(GTK_WIDGET(toggle_button)), active ? "active" : "inactive", file, line);
621
622 (gtk_toggle_button_set_active)(toggle_button, active);
623}
624#endif
625
626// refactored function to read current ppd, because gtk for osx has been unreliable
627// we use the specific function here. Anyway, if nothing meaningful is found we default back to 1.0
629{
630 double res = 0.0f;
631#ifdef GDK_WINDOWING_QUARTZ
633#else
634 res = gtk_widget_get_scale_factor(widget);
635#endif
636 if((res < 1.0f) || (res > 4.0f))
637 {
638 dt_widget_log("[dt_get_system_gui_ppd] can't detect system ppd\n");
639 return 1.0f;
640 }
641 dt_widget_log("[dt_get_system_gui_ppd] system ppd is %f\n", res);
642 return res;
643}
644
645GdkModifierType dt_key_modifier_state()
646{
647 guint state = 0;
648 GdkWindow *window = gtk_widget_get_window(dt_widget_root_window());
649 gdk_device_get_state(gdk_seat_get_pointer(gdk_display_get_default_seat(gdk_window_get_display(window))), window, NULL, &state);
650 return state;
651
652/* FIXME double check correct way of doing this (merge conflict with Input System NG 20210319)
653 GdkKeymap *keymap = gdk_keymap_get_for_display(gdk_display_get_default());
654 return gdk_keymap_get_modifier_state(keymap) & gdk_keymap_get_modifier_mask(keymap, GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK);
655*/
656}
657
658// clang-format off
659// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
660// vim: shiftwidth=2 expandtab tabstop=2 cindent
661// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
662// clang-format on
static dt_accels_refocus_handler_t _refocus_handler
#define TRUE
Definition ashift_lsd.c:162
#define FALSE
Definition ashift_lsd.c:158
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
const float delta
dev roi_request value
GtkWidget * window
const int res
Definition dtpthread.h:351
gboolean enabled
Definition geometry.h:103
GdkRGBA color[]
Definition geotagging.c:541
char * key
uint32_t width
Definition mipmap_cache.c:0
float dt_osx_get_ppd()
Definition osx.mm:74
const float factor
Definition pdf.h:91
const char * name
Definition pdf.h:90
static dt_pipeline_message_handler_t _message_handler
const float uint32_t state[4]
#define MAX(a, b)
Definition thinplate.c:29
void dt_widget_set_ppd(double ppd)
gboolean dt_gui_get_scroll_deltas(const GdkEventScroll *event, gdouble *delta_x, gdouble *delta_y)
GtkWidget * dt_widget_root_window(void)
float dt_widget_mouse_radius(void)
double dt_widget_ppd(void)
static dt_widget_stored_int_setter_t _stored_int_setter
static dt_widget_stored_bool_setter_t _stored_bool_setter
gboolean dt_gui_get_scroll_delta(const GdkEventScroll *event, gdouble *delta)
gboolean dt_gui_get_scroll_unit_deltas(const GdkEventScroll *event, int *delta_x, int *delta_y)
static GtkWidget * _scroll_focus
void dt_widget_set_colorlabels(const GdkRGBA *labels, int count)
void dt_widget_set_cursor_handler(dt_widget_cursor_handler_t handler)
gboolean dt_gui_get_scroll_unit_delta(const GdkEventScroll *event, int *delta)
void dt_widget_set_debug_overlays(gboolean enabled)
void dt_widget_set_dpi_factor(double factor)
static dt_widget_message_handler_t _message_handler
void dt_widget_set_image_filter(cairo_filter_t filter)
static pthread_t _gui_thread
void dt_widget_set_scroll_reversed(gboolean reverse_x, gboolean reverse_y)
void dt_widget_set_source_rgba(cairo_t *cr, dt_gui_color_t color, float opacity_coef)
gboolean dt_widget_stored_int(const char *key, int *value)
GdkRGBA * dt_widget_colors(void)
void dt_gui_freeze_reset(void)
static GdkRGBA _colorlabels[16]
void dt_widget_set_theme_loaded(gboolean loaded)
static int32_t _widget_suppress_depth
void dt_gui_widgets_choice_end(void)
static dt_widget_stored_int_getter_t _stored_int_getter
gboolean dt_widget_metrics_probed(void)
GtkWidget * dt_widget_scroll_focus(void)
void dt_widget_set_natural_width_handler(dt_widget_natural_width_handler_t handler)
gboolean dt_widget_on_gui_thread(void)
Is the calling thread the one that owns widget state?
void dt_widget_store_bool(const char *key, gboolean value)
static double _dpi
static dt_widget_cursor_handler_t _cursor_handler
static dt_widget_stored_bool_getter_t _stored_bool_getter
void dt_gui_freeze_end_(const char *file, int line)
void dt_widget_set_root_window_handler(dt_widget_root_window_handler_t handler)
void dt_widget_set_em_size(double em)
void dt_widget_set_gui_thread(pthread_t thread)
static dt_widget_natural_width_handler_t _natural_width_handler
void dt_widget_set_dpi(double dpi)
void dt_widget_set_source_rgb(cairo_t *cr, dt_gui_color_t color)
static gint _min_panel_width
GdkModifierType dt_key_modifier_state()
static gboolean _debug_overlays
static dt_widget_root_window_handler_t _root_window_handler
static dt_widget_refocus_handler_t _refocus_handler
static float _mouse_radius_clamped
gboolean dt_widget_debug_overlays(void)
void dt_widget_set_notebook_page_handler(dt_widget_notebook_page_handler_t handler)
void dt_widget_set_overlay_color(double red, double green, double blue, double contrast)
static dt_widget_notebook_page_handler_t _notebook_page_handler
static cairo_filter_t _image_filter
gint dt_widget_min_panel_width(void)
void dt_widget_set_refocus_handler(dt_widget_refocus_handler_t handler)
const GdkRGBA * dt_widget_colorlabel(int index)
static gboolean _gui_thread_set
GdkEventMask dt_widget_scroll_mask(void)
void dt_widget_set_scroll_focus(GtkWidget *widget)
double dt_get_system_gui_ppd(GtkWidget *widget)
static dt_widget_overlay_color_t _overlay
static gboolean _metrics_probed
static GdkRGBA _colors[DT_GUI_COLOR_LAST]
float dt_widget_mouse_radius_clamped(void)
static gboolean _reverse_x
void dt_widget_set_storage_handlers(dt_widget_stored_int_getter_t get_int, dt_widget_stored_int_setter_t set_int, dt_widget_stored_bool_getter_t get_bool, dt_widget_stored_bool_setter_t set_bool)
static float _mouse_radius
static GdkEventMask _scroll_mask
gboolean dt_widget_stored_bool(const char *key)
void dt_gui_widgets_choice_begin(void)
void dt_widget_set_min_panel_width(gint width)
void dt_widget_set_message_handler(dt_widget_message_handler_t handler)
static int _colorlabels_count
double dt_widget_dpi_factor(void)
void dt_widget_store_int(const char *key, int value)
void dt_widget_refocus(void)
static double _ppd
gboolean dt_gui_widgets_suppressed(void)
cairo_filter_t dt_widget_image_filter(void)
gboolean dt_gui_widgets_choice_announced(void)
void dt_widget_notebook_page_changed(gpointer owner)
void dt_widget_set_mouse_radius(float radius, float clamped)
static double _em
const dt_widget_overlay_color_t * dt_widget_overlay_color(void)
void dt_widget_set_scroll_mask(GdkEventMask mask)
static gboolean _theme_loaded
gint dt_widget_natural_width(GtkWidget *widget)
static double _dpi_factor
double dt_widget_dpi(void)
double dt_widget_em_size(void)
void dt_widget_message(const char *message)
void dt_widget_set_cursor(GdkCursorType cursor)
void dt_gui_freeze_begin_(const char *file, int line)
static int32_t _widget_choice_depth
gboolean dt_widget_theme_loaded(void)
static gboolean _reverse_y
void(* dt_widget_refocus_handler_t)(void)
gboolean(* dt_widget_stored_int_getter_t)(const char *key, int *value)
gboolean(* dt_widget_stored_bool_getter_t)(const char *key)
dt_gui_color_t
@ DT_GUI_COLOR_LAST
gint(* dt_widget_natural_width_handler_t)(GtkWidget *widget)
void(* dt_widget_stored_int_setter_t)(const char *key, int value)
void(* dt_widget_cursor_handler_t)(GdkCursorType cursor)
void(* dt_widget_notebook_page_handler_t)(gpointer owner)
#define dt_widget_log(...)
GtkWidget *(* dt_widget_root_window_handler_t)(void)
void(* dt_widget_stored_bool_setter_t)(const char *key, gboolean value)
void(* dt_widget_message_handler_t)(const char *message)