Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
widget_settings.h
Go to the documentation of this file.
1/*
2 * This file is part of Ansel,
3 * Copyright (C) 2026 Aurélien PIERRE.
4 * Copyright (C) 2026 Guillaume Stutin.
5 *
6 * Ansel is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Ansel is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Ansel. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef DT_WIDGETS_WIDGET_SETTINGS_H
21#define DT_WIDGETS_WIDGET_SETTINGS_H
22
23/* Only what the declarations below need: GtkWidget/GdkRGBA/cairo_t (gtk.h), pthread_t, and
24 * va_list. This header used to include gui/screen_metrics.h purely to re-export
25 * dt_cairo_image_surface_*() to ~45 consumers that never asked it for them -- a supply line
26 * nobody declared and nobody could see, which breaks somewhere unrelated the day it is
27 * tidied. Those files include screen_metrics.h themselves now. */
28#include <gtk/gtk.h>
29#include <pthread.h>
30#include <stdarg.h>
31
32G_BEGIN_DECLS
33
34/* Toolkit-wide state that widgets need and the application merely configures.
35 *
36 * These three used to be fields of dt_gui_gtk_t, which meant a widget had to reach the
37 * application global to read its own event mask. They are not application data -- a scroll
38 * mask, a "who owns scroll right now" register and a cairo filter are properties of the
39 * widget toolkit. Ownership moves here so widgets/ needs nothing from gui/.
40 *
41 * The application sets them once during GUI init; everything else reads them.
42 */
43
45GdkEventMask dt_widget_scroll_mask(void);
46void dt_widget_set_scroll_mask(GdkEventMask mask);
47
48/* Which widget currently owns scroll input.
49 *
50 * Ansel routes scroll to one widget at a time rather than letting it propagate: a slider
51 * under the pointer takes the wheel, and views clear the register when they change. */
54
56cairo_filter_t dt_widget_image_filter(void);
57void dt_widget_set_image_filter(cairo_filter_t filter);
58
59
60/* Widget-update suppression.
61 *
62 * Programmatic widget updates must not be mistaken for user input. Code wraps such updates
63 * in dt_gui_freeze_begin()/end() and every widget callback opens with
64 * `if(dt_gui_widgets_suppressed()) return;`.
65 *
66 * The depth counter used to live in dt_gui_gtk_t, which meant a widget had to reach the
67 * application global to find out whether it should ignore its own callback. */
68gboolean dt_gui_widgets_suppressed(void);
69
70/* A choice being announced.
71 *
72 * A widget offering discrete values (a combobox) brackets the announcement of the one the user
73 * chose with dt_gui_widgets_choice_begin()/end(), around its listeners. What a listener commits
74 * meanwhile is a choice between discrete states, which the history commit keeps apart from a
75 * drag (see dt_dev_add_history_item()). GUI thread only: elsewhere both are no-ops. */
79
84void dt_widget_set_gui_thread(pthread_t thread);
85
94gboolean dt_widget_on_gui_thread(void);
95void dt_gui_freeze_begin_(const char *file, int line);
96void dt_gui_freeze_end_(const char *file, int line);
97void dt_gui_freeze_reset(void); // hard-reset depth to 0 (GUI init only)
98
99/* Bracket programmatic widget updates with these so the widget's own "value-changed" handler
100 * does not mistake them for user input. The scope-guard form ends the freeze automatically on
101 * every exit path, including an early return, which the raw pair leaks. */
102#define dt_gui_freeze_begin() dt_gui_freeze_begin_(__FILE__, __LINE__)
103#define dt_gui_freeze_end() dt_gui_freeze_end_(__FILE__, __LINE__)
104
105typedef struct { const char *file; int line; } dt_gui_freeze_token_t;
107{
108 dt_gui_freeze_end_(t->file, t->line);
109}
110#define DT_FREEZE_CAT_(a, b) a##b
111#define DT_FREEZE_CAT(a, b) DT_FREEZE_CAT_(a, b)
112#define dt_gui_widget_freeze() \
113 dt_gui_freeze_token_t DT_FREEZE_CAT(_dt_freeze_guard_, __LINE__) \
114 __attribute__((cleanup(dt_gui_freeze_release_))) = { __FILE__, __LINE__ }; \
115 dt_gui_freeze_begin_(__FILE__, __LINE__)
116
117/* Scroll deltas in discrete units, accumulating smooth-scroll fractions and discarding
118 * pointer-emulated duplicates. Pure GTK event arithmetic. */
119gboolean dt_gui_get_scroll_unit_deltas(const GdkEventScroll *event, int *delta_x, int *delta_y);
120gboolean dt_gui_get_scroll_unit_delta(const GdkEventScroll *event, int *delta);
121
124void dt_widget_set_scroll_reversed(gboolean reverse_x, gboolean reverse_y);
125
126/* The host's root window, used for things that exist before any widget does: resolving theme
127 * colours at toolkit init, and parenting a popup so Wayland compositors place it correctly.
128 * Unregistered: NULL, and callers fall back to screen defaults. */
129typedef GtkWidget *(*dt_widget_root_window_handler_t)(void);
132
133/* How wide the host would like `widget` to be naturally -- it knows which panel the widget
134 * sits in and how wide that panel is. Returns -1 when the host has no opinion, which is also
135 * what an unregistered handler reports. */
139
140/* Transient user-facing message ("that widget no longer exists"). How and where it is shown
141 * is the host's decision -- a toast, a status line, or nothing at all. Unregistered, the
142 * message is dropped. */
143typedef void (*dt_widget_message_handler_t)(const char *message);
145void dt_widget_message(const char *message);
146
147/* Pointer shape during widget interaction (a panel-handle drag wants a resize cursor).
148 * The host owns the window whose cursor changes, so it supplies the setter. Unregistered,
149 * the cursor is left alone. */
150typedef void (*dt_widget_cursor_handler_t)(GdkCursorType cursor);
152void dt_widget_set_cursor(GdkCursorType cursor);
153
154/* ------------------------------------------------------------------------------------------
155 * Diagnostics.
156 *
157 * A debug build prints straight to stdout; a release build compiles the call away. widgets/
158 * deliberately does not route diagnostics through the application: a logging system means a
159 * global flags word and a global stream, and reaching for either is what this module exists to
160 * avoid. Nothing is lost by keeping it local -- these messages describe widget internals, and
161 * whoever is reading them is running a debug build anyway.
162 * ------------------------------------------------------------------------------------------ */
163#ifdef _DEBUG
164void dt_widget_log(const char *format, ...) G_GNUC_PRINTF(1, 2);
165#define dt_widget_log_enabled() TRUE
166#else
167/* Release compiles the call away, but its arguments must still count as USED. A variable
168 * computed only to be logged draws -Wunused-variable in Release only -- and the tempting fix
169 * is to delete the variable, which in two cases here would have deleted a call that must
170 * still run (_call_shortcut_cclosure() dispatches the shortcut; gtk_widget_activate()
171 * activates the widget). Referencing the arguments from an unreachable branch keeps them
172 * used, and gets Release the same format-string checking Debug has. Nothing inside is
173 * evaluated -- exactly what a compiled-away log did before. */
174static inline void G_GNUC_PRINTF(1, 2) dt_widget_log_discard(const char *format, ...)
175{
176 (void)format;
177}
178#define dt_widget_log(...) do { if(FALSE) dt_widget_log_discard(__VA_ARGS__); } while(0)
179#define dt_widget_log_enabled() FALSE
180#endif
181
184gboolean dt_widget_debug_overlays(void);
186
187/* ------------------------------------------------------------------------------------------
188 * Per-widget persistence.
189 *
190 * A resizable panel remembers the height the user dragged it to; a collapsible section
191 * remembers whether they left it open. The key is supplied by whoever built the widget --
192 * widgets/ neither invents keys nor knows where they are stored, because a configuration
193 * system is application state reached through a global, which is exactly what this module
194 * exists to keep out of the toolkit.
195 *
196 * Unregistered, nothing is stored and every read reports "not set", so a widget falls back to
197 * its default size or its collapsed state. That is also the correct behaviour for any host
198 * that has no preferences to offer.
199 * ------------------------------------------------------------------------------------------ */
200typedef gboolean (*dt_widget_stored_int_getter_t)(const char *key, int *value);
201typedef void (*dt_widget_stored_int_setter_t)(const char *key, int value);
202typedef gboolean (*dt_widget_stored_bool_getter_t)(const char *key);
203typedef void (*dt_widget_stored_bool_setter_t)(const char *key, gboolean value);
204
209
211gboolean dt_widget_stored_int(const char *key, int *value);
212void dt_widget_store_int(const char *key, int value);
213
215gboolean dt_widget_stored_bool(const char *key);
216void dt_widget_store_bool(const char *key, gboolean value);
217
218/* Has the application loaded its CSS theme yet? Dialogs that can run during startup -- before
219 * any styling exists -- pad themselves by hand when it has not. */
220gboolean dt_widget_theme_loaded(void);
221void dt_widget_set_theme_loaded(gboolean loaded);
222
223/* Return keyboard focus to the application's main working area. A widget that swallows keys
224 * (a text entry) has to hand focus back when the user presses Escape, but which widget is
225 * "the main area" is the host's business -- the image in darkroom, the grid in lighttable.
226 * Unregistered, the request is dropped. */
229void dt_widget_refocus(void);
230
231/* A GtkNotebook the host registered an owner for has switched page. The host relays this on
232 * its own signal bus; widgets/ has no bus and no idea what the owner is. */
233typedef void (*dt_widget_notebook_page_handler_t)(gpointer owner);
235void dt_widget_notebook_page_changed(gpointer owner);
236
237/* Toolkit metrics: the UI zoom factor, the integer device scale, and the resolved root font
238 * size in pixels. Widgets scale themselves by these; the application computes them from the
239 * screen and the theme and pushes them here. They lived in dt_gui_gtk_t, which meant a widget
240 * had to reach the application global to size itself. */
242double dt_widget_dpi(void);
243void dt_widget_set_dpi(double dpi);
244
249gboolean dt_widget_metrics_probed(void);
250
251double dt_widget_dpi_factor(void);
253
254double dt_widget_ppd(void);
255void dt_widget_set_ppd(double ppd);
256
262
264double dt_widget_em_size(void);
265void dt_widget_set_em_size(double em);
266
269double dt_get_system_gui_ppd(GtkWidget *widget);
270
272GdkModifierType dt_key_modifier_state(void);
273
274/* Scale a 96-DPI-baseline value. UI: logical pixels GTK will scale further. DEVICE: raw
275 * device pixels for cairo surfaces and hit-tests, which GTK does not scale for us. */
276#define DT_UI_SCALE_UI(value) ((value) * dt_widget_dpi_factor())
277#define DT_UI_SCALE_DEVICE(value) ((value) * dt_widget_dpi_factor() * dt_widget_ppd())
278#define DT_PIXEL_APPLY_DPI(value) DT_UI_SCALE_UI(value)
279#define DT_PIXEL_APPLY_DPI_DPP(value) DT_UI_SCALE_DEVICE(value)
280
281/* Gutter between children of boxes/grids/flowboxes -- settable only from code, so it is
282 * centralised here for the whole app. Expressed as a fraction of 1em so it tracks the user's
283 * font size like the em-based margins in ansel.css. 0.625em == 10px at the 16px reference.
284 * The font's pt->px conversion already folds in DPI, so this needs no DPI scaling on top. */
285#define DT_GUI_EM_SIZE ((gint)dt_widget_em_size())
286#define DT_GUI_BOX_SPACING_EM 0.625
287#define DT_GUI_BOX_SPACING ((gint)(DT_GUI_EM_SIZE * DT_GUI_BOX_SPACING_EM + 0.5))
288
289/* Colour-label slots. These mirror the application's dt_colorlabels_enum, and gui/gtk.c
290 * carries a _Static_assert that they cannot drift apart -- that is the one place both
291 * headers are visible. Declaring them here keeps widgets/ free of application headers. */
292enum
293{
300};
301
302/* The colour-label palette, as RGBA. Widgets paint colour labels; which colours those are is
303 * a theme decision the application supplies. Indices match dt_colorlabels_enum. */
304const GdkRGBA *dt_widget_colorlabel(int index);
305void dt_widget_set_colorlabels(const GdkRGBA *labels, int count);
306
307/* On the Quartz GDK backend, a physical Cmd keypress is reported through GDK_MOD2_MASK
308 * (see widgets/accelerators.h's DT_PRIMARY_MASK, which every accelerator *registration*
309 * already resolves to instead of GDK_CONTROL_MASK). Every mouse/keyboard interaction check
310 * in the codebase asks for GDK_CONTROL_MASK meaning "the platform's primary modifier", so
311 * that substitution is done once, here, rather than at each of the ~80 call sites. */
312static inline GdkModifierType dt_modifier_primary_mask(GdkModifierType desired_modifier_mask)
313{
314#ifdef GDK_WINDOWING_QUARTZ
315 if(desired_modifier_mask & GDK_CONTROL_MASK)
316 desired_modifier_mask = (GdkModifierType)((desired_modifier_mask & ~GDK_CONTROL_MASK) | GDK_MOD2_MASK);
317#endif
318 return desired_modifier_mask;
319}
320
321/* GDK_MOD2_MASK is the bit a real Cmd keypress produces, matched against for actual dispatch
322 * (dt_modifier_primary_mask() above) and the bit GTK's own gtk_accelerator_name() collapses to
323 * the portable "<Primary>" token for on Quartz (see widgets/accelerators.h's DT_PRIMARY_MASK
324 * doc comment) -- so it must stay what is stored and saved. But GTK's accelerator-label
325 * renderer (gtk_accelerator_get_label(), and anything built on it: GtkCellRendererAccel,
326 * GtkAccelLabel) only ever emits the "⌘" glyph for GDK_META_MASK, never GDK_MOD2_MASK, on any
327 * platform. This is the reverse, display-only swap: takes a mask meant for storage/matching
328 * and returns what to hand to a label/rendering function instead. Never store or match against
329 * this result -- GDK_META_MASK is not reliably present on mouse-sourced events, only real key
330 * events (see dt_modifier_is() above). */
331static inline GdkModifierType dt_accels_display_mods(GdkModifierType mods)
332{
333#ifdef GDK_WINDOWING_QUARTZ
334 if(mods & GDK_MOD2_MASK)
335 mods = (GdkModifierType)((mods & ~GDK_MOD2_MASK) | GDK_META_MASK);
336#endif
337 return mods;
338}
339
340/* Does `state` carry exactly `desired_modifier_mask`, ignoring lock/scroll bits? */
341static inline gboolean dt_modifier_is(GdkModifierType state, const GdkModifierType desired_modifier_mask)
342{
343 const GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask();
344#ifdef GDK_WINDOWING_QUARTZ
345 // A real GDK_KEY_PRESS/RELEASE's state carries both GDK_MOD2_MASK and GDK_META_MASK for a
346 // single physical Cmd press (GDK's own virtual-modifier step adds GDK_META_MASK next to the
347 // real GDK_MOD2_MASK bit for every key event -- see _accels_keys_decode() in
348 // widgets/accelerators.c for the same dedup on the accelerator-dispatch path). Mouse/scroll
349 // events never carry GDK_META_MASK, so this is a no-op for the majority of this function's
350 // callers; it only matters for the callers that read a real GdkEventKey.state directly.
351 /* Cast, not a compound assignment: this header is included from C++ translation units
352 * too (iop/lens.cc, iop/tonemap.cc, imageio/format/exr.cc, ...), and in C++ the operand
353 * `~GDK_META_MASK` is an int, which cannot be assigned back into an enum. */
354 if((state & GDK_MOD2_MASK) && (state & GDK_META_MASK))
355 state = (GdkModifierType)(state & ~GDK_META_MASK);
356#endif
357 return (state & modifiers) == dt_modifier_primary_mask(desired_modifier_mask);
358}
359
360/* Does `state` carry AT LEAST `desired_modifier_mask`? Same arithmetic, weaker test. */
361static inline gboolean dt_modifiers_include(GdkModifierType state, const GdkModifierType desired_modifier_mask)
362{
363 const GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask();
364 const GdkModifierType wanted = dt_modifier_primary_mask(desired_modifier_mask);
365#ifdef GDK_WINDOWING_QUARTZ
366 // See dt_modifier_is() just above, cast included.
367 if((state & GDK_MOD2_MASK) && (state & GDK_META_MASK))
368 state = (GdkModifierType)(state & ~GDK_META_MASK);
369#endif
370 return (state & (modifiers & wanted)) == wanted;
371}
372
373/* Scroll deltas as fractions, for consumers that want the raw smooth-scroll amount rather
374 * than the accumulated discrete units above. */
375gboolean dt_gui_get_scroll_deltas(const GdkEventScroll *event, gdouble *delta_x, gdouble *delta_y);
376gboolean dt_gui_get_scroll_delta(const GdkEventScroll *event, gdouble *delta);
377
378
379/* ------------------------------------------------------------------------------------------
380 * Theme palette.
381 *
382 * The colours widgets paint with are a theme decision the application resolves (from CSS, at
383 * dt_gui_load_theme() time) and pushes here. Widgets read them; they do not look them up.
384 * Storage lives here rather than in the application struct so that widgets/draw.h can be a
385 * leaf header -- it paints with DT_GUI_COLOR_BUTTON_FG and must not reach for gui/.
386 * ------------------------------------------------------------------------------------------ */
423
425GdkRGBA *dt_widget_colors(void);
426
429void dt_widget_set_source_rgba(cairo_t *cr, dt_gui_color_t color, float opacity_coef);
430
431/* Overlay tint for shapes drawn over the image (mask outlines, guides, crop handles). A user
432 * preference the application resolves; widgets/draw.h paints with it. */
437
439void dt_widget_set_overlay_color(double red, double green, double blue, double contrast);
440
441/* Mouse hit-test radius in device pixels: the raw value, and the one clamped to stay usable
442 * for overlay selection at any zoom. The darkroom recomputes both when the zoom changes. */
443float dt_widget_mouse_radius(void);
445void dt_widget_set_mouse_radius(float radius, float clamped);
446
448#define DT_GUI_MOUSE_EFFECT_RADIUS dt_widget_mouse_radius_clamped()
449
450
451/* ------------------------------------------------------------------------------------------
452 * Call-site diagnostics for two GTK setters.
453 *
454 * GTK reports only its own assertion site when a non-widget reaches gtk_widget_queue_draw(),
455 * which says nothing about which Ansel code owned the bad pointer. In debug-capable builds
456 * both calls are rerouted through a wrapper that names the caller's file and line, so an
457 * ownership/lifetime bug points at the source line that queued the redraw. Toggle state
458 * changes are wrapped for the same reason: they usually precede a redraw, so catching the
459 * invalid object here surfaces the first error rather than the secondary redraw assertion.
460 * ------------------------------------------------------------------------------------------ */
461#ifdef _DEBUG
462void dt_gtk_widget_queue_draw_ext(GtkWidget *widget, const char *name, const char *file, const int line);
463#define dt_gtk_widget_queue_draw(widget) dt_gtk_widget_queue_draw_ext((GtkWidget *)(widget), #widget, __FILE__, __LINE__)
464#define gtk_widget_queue_draw(widget) dt_gtk_widget_queue_draw(widget)
465
466void dt_gtk_toggle_button_set_active_ext(GtkToggleButton *toggle_button, const char *name, const gboolean active,
467 const char *file, const int line);
468#define dt_gtk_toggle_button_set_active(toggle_button, active) \
469 dt_gtk_toggle_button_set_active_ext((GtkToggleButton *)(toggle_button), #toggle_button, active, __FILE__, __LINE__)
470#define gtk_toggle_button_set_active(toggle_button, active) \
471 dt_gtk_toggle_button_set_active(toggle_button, active)
472#else
473#define dt_gtk_widget_queue_draw(widget) gtk_widget_queue_draw(widget)
474#define dt_gtk_toggle_button_set_active(toggle_button, active) gtk_toggle_button_set_active(toggle_button, active)
475#endif
476
477G_END_DECLS
478
479#endif // DT_WIDGETS_WIDGET_SETTINGS_H
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
const int t
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
const float delta
dev roi_request value
gboolean enabled
Definition geometry.h:103
GdkRGBA color[]
Definition geotagging.c:541
char * key
uint32_t width
Definition mipmap_cache.c:0
const float factor
Definition pdf.h:91
const char * name
Definition pdf.h:90
const float uint32_t state[4]
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)
void(* dt_widget_refocus_handler_t)(void)
gboolean dt_gui_get_scroll_delta(const GdkEventScroll *event, gdouble *delta)
@ DT_WIDGET_COLORLABEL_RED
@ DT_WIDGET_COLORLABEL_PURPLE
@ DT_WIDGET_COLORLABEL_COUNT
@ DT_WIDGET_COLORLABEL_YELLOW
@ DT_WIDGET_COLORLABEL_GREEN
@ DT_WIDGET_COLORLABEL_BLUE
gboolean dt_gui_get_scroll_unit_deltas(const GdkEventScroll *event, int *delta_x, int *delta_y)
void dt_widget_set_colorlabels(const GdkRGBA *labels, int count)
void dt_widget_set_cursor_handler(dt_widget_cursor_handler_t handler)
gboolean(* dt_widget_stored_int_getter_t)(const char *key, int *value)
static gboolean dt_modifier_is(GdkModifierType state, const GdkModifierType desired_modifier_mask)
gboolean dt_gui_get_scroll_unit_delta(const GdkEventScroll *event, int *delta)
static GdkModifierType dt_accels_display_mods(GdkModifierType mods)
void dt_widget_set_debug_overlays(gboolean enabled)
void dt_widget_set_dpi_factor(double factor)
gboolean(* dt_widget_stored_bool_getter_t)(const char *key)
dt_gui_color_t
@ DT_GUI_COLOR_BG
@ DT_GUI_COLOR_DARKROOM_PREVIEW_BG
@ DT_GUI_COLOR_LIGHTTABLE_FONT
@ DT_GUI_COLOR_MAP_LOC_SHAPE_HIGH
@ DT_GUI_COLOR_LOG_FG
@ DT_GUI_COLOR_BRUSH_CURSOR
@ DT_GUI_COLOR_LAST
@ DT_GUI_COLOR_THUMBNAIL_FONT
@ DT_GUI_COLOR_THUMBNAIL_SELECTED_BG
@ DT_GUI_COLOR_MAP_COUNT_BG
@ DT_GUI_COLOR_LOG_BG
@ DT_GUI_COLOR_THUMBNAIL_SELECTED_BORDER
@ DT_GUI_COLOR_THUMBNAIL_OUTLINE
@ DT_GUI_COLOR_MAP_LOC_SHAPE_LOW
@ DT_GUI_COLOR_LIGHTTABLE_BG
@ DT_GUI_COLOR_BUTTON_FG
@ DT_GUI_COLOR_DARKROOM_BG
@ DT_GUI_COLOR_THUMBNAIL_BORDER
@ DT_GUI_COLOR_LIGHTTABLE_PREVIEW_BG
@ DT_GUI_COLOR_WARNING
@ DT_GUI_COLOR_MAP_COUNT_SAME_LOC
@ DT_GUI_COLOR_MAP_COUNT_DIFF_LOC
@ DT_GUI_COLOR_THUMBNAIL_BG
@ DT_GUI_COLOR_PREVIEW_HOVER_BORDER
@ DT_GUI_COLOR_FILMSTRIP_BG
@ DT_GUI_COLOR_BRUSH_TRACE
@ DT_GUI_COLOR_THUMBNAIL_SELECTED_FONT
@ DT_GUI_COLOR_THUMBNAIL_SELECTED_OUTLINE
@ DT_GUI_COLOR_THUMBNAIL_HOVER_BG
@ DT_GUI_COLOR_PRINT_BG
@ DT_GUI_COLOR_MAP_LOC_SHAPE_DEF
@ DT_GUI_COLOR_THUMBNAIL_HOVER_FONT
@ DT_GUI_COLOR_THUMBNAIL_HOVER_OUTLINE
void dt_widget_set_image_filter(cairo_filter_t filter)
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)
void dt_widget_set_theme_loaded(gboolean loaded)
static void dt_gui_freeze_release_(dt_gui_freeze_token_t *t)
void dt_gui_widgets_choice_end(void)
gint(* dt_widget_natural_width_handler_t)(GtkWidget *widget)
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)
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)
GdkModifierType dt_key_modifier_state(void)
void dt_widget_set_dpi(double dpi)
void dt_widget_set_source_rgb(cairo_t *cr, dt_gui_color_t color)
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)
void(* dt_widget_stored_int_setter_t)(const char *key, int value)
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)
void dt_widget_set_scroll_focus(GtkWidget *widget)
static void G_GNUC_PRINTF(1, 2) dt_widget_log_discard(const char *format
double dt_get_system_gui_ppd(GtkWidget *widget)
float dt_widget_mouse_radius_clamped(void)
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)
void(* dt_widget_cursor_handler_t)(GdkCursorType cursor)
static GdkModifierType dt_modifier_primary_mask(GdkModifierType desired_modifier_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)
double dt_widget_dpi_factor(void)
void dt_widget_store_int(const char *key, int value)
G_BEGIN_DECLS GdkEventMask dt_widget_scroll_mask(void)
void dt_widget_refocus(void)
void(* dt_widget_notebook_page_handler_t)(gpointer owner)
gboolean dt_gui_widgets_suppressed(void)
cairo_filter_t dt_widget_image_filter(void)
gboolean dt_gui_widgets_choice_announced(void)
#define dt_widget_log(...)
void dt_widget_notebook_page_changed(gpointer owner)
void dt_widget_set_mouse_radius(float radius, float clamped)
GtkWidget *(* dt_widget_root_window_handler_t)(void)
const dt_widget_overlay_color_t * dt_widget_overlay_color(void)
static gboolean dt_modifiers_include(GdkModifierType state, const GdkModifierType desired_modifier_mask)
void dt_widget_set_scroll_mask(GdkEventMask mask)
gint dt_widget_natural_width(GtkWidget *widget)
double dt_widget_dpi(void)
double dt_widget_em_size(void)
void dt_widget_message(const char *message)
void(* dt_widget_stored_bool_setter_t)(const char *key, gboolean value)
void(* dt_widget_message_handler_t)(const char *message)
void dt_widget_set_cursor(GdkCursorType cursor)
void dt_gui_freeze_begin_(const char *file, int line)
gboolean dt_widget_theme_loaded(void)