110#include <gdk/gdkkeysyms.h>
111#ifdef GDK_WINDOWING_WAYLAND
112#include <gdk/gdkwayland.h>
115#include <gdk/gdkwin32.h>
124#ifdef MAC_INTEGRATION
125#include <gtkosxapplication.h>
127#ifdef GDK_WINDOWING_QUARTZ
142 "widget colour-label indices drifted from dt_colorlabels_enum");
196 dt_control_expose(cr, gtk_widget_get_allocated_width(da), gtk_widget_get_allocated_height(da));
203 if(!gtk_window_is_active(GTK_WINDOW(
darktable.gui->ui->main_window)))
return FALSE;
210 event->state, delta_y);
221 const GdkWindowState window_state = gdk_window_get_state(gtk_widget_get_window(widget));
222 dt_conf_set_bool(
"ui_last/maximized", (window_state & GDK_WINDOW_STATE_MAXIMIZED));
224 gtk_window_get_size(GTK_WINDOW(widget), &
width, &
height);
228 gboolean save_window_position =
TRUE;
229#ifdef GDK_WINDOWING_WAYLAND
230 GdkDisplay *display = gtk_widget_get_display(widget);
231 if(GDK_IS_WAYLAND_DISPLAY(display))
232 save_window_position =
FALSE;
235 if(save_window_position)
237 GdkWindow *gdk_window = gtk_widget_get_window(widget);
238 GdkDisplay *window_display = gtk_widget_get_display(widget);
241 GdkMonitor *monitor = gdk_display_get_monitor_at_window(window_display, gdk_window);
244 const int n_monitors = gdk_display_get_n_monitors(window_display);
245 int monitor_index = -1;
246 for(
int i = 0;
i < n_monitors;
i++)
248 if(gdk_display_get_monitor(window_display,
i) == monitor)
254 if(monitor_index >= 0)
259 if(!(window_state & GDK_WINDOW_STATE_MAXIMIZED))
262 gtk_window_get_position(GTK_WINDOW(widget), &
x, &y);
278 gtk_window_set_title(GTK_WINDOW(win), _(
"Closing Ansel..."));
301#ifdef MAC_INTEGRATION
302#ifdef GTK_TYPE_OSX_APPLICATION
303static gboolean _osx_quit_callback(GtkOSXApplication *OSXapp, gpointer user_data)
305static gboolean _osx_quit_callback(GtkosxApplication *OSXapp, gpointer user_data)
309 windows = gtk_window_list_toplevels();
311 if(gtk_window_get_modal(GTK_WINDOW(
window->data)) && gtk_widget_get_visible(GTK_WIDGET(
window->data)))
314 g_list_free(windows);
319#ifdef GTK_TYPE_OSX_APPLICATION
320static gboolean _osx_openfile_callback(GtkOSXApplication *OSXapp, gchar *path, gpointer user_data)
322static gboolean _osx_openfile_callback(GtkosxApplication *OSXapp, gchar *path, gpointer user_data)
333 if(oldw != event->width || oldh != event->height)
339 oldh =
event->height;
341#ifndef GDK_WINDOWING_QUARTZ
352 if(oldx != event->configure.x || oldy != event->configure.y)
356 oldx =
event->configure.x;
357 oldy =
event->configure.y;
388 case GDK_MOTION_NOTIFY:
389 return ((
const GdkEventMotion *)event)->axes;
390 case GDK_BUTTON_PRESS:
391 case GDK_2BUTTON_PRESS:
392 case GDK_3BUTTON_PRESS:
393 case GDK_BUTTON_RELEASE:
394 return ((
const GdkEventButton *)event)->axes;
401 const GdkAxisUse axis,
double *
value, gboolean *from_source_map)
403 if(from_source_map) *from_source_map =
FALSE;
407 if(source_device && axes)
409 double source_value = 0.0;
410 if(gdk_device_get_axis(source_device, (gdouble *)axes, axis, &source_value))
412 *
value = source_value;
413 if(from_source_map) *from_source_map =
TRUE;
418 return gdk_event_get_axis((GdkEvent *)event, axis,
value);
422 const GdkAxisUse axis,
double *
value)
425 if(gdk_device_get_source(device) == GDK_SOURCE_KEYBOARD)
return FALSE;
426 if(gdk_device_get_device_type(device) == GDK_DEVICE_TYPE_SLAVE)
428 GdkDisplay *display = gdk_device_get_display(device);
429 if(!display || !gdk_display_device_is_grabbed(display, device))
return FALSE;
432 const int n_axes = gdk_device_get_n_axes(device);
433 if(n_axes <= 0)
return FALSE;
435 double *axes = g_newa(
double, n_axes);
436 memset(axes, 0,
sizeof(
double) * n_axes);
437 GdkModifierType modifiers = 0;
438 gdk_device_get_state(device,
window, axes, &modifiers);
439 return gdk_device_get_axis(device, axes, axis,
value);
443 double *pressure, gboolean *have_pressure,
444 double *tilt_x,
double *tilt_y, gboolean *have_tilt,
445 const char **picked_device_name)
447 if(pressure) *pressure = 0.0;
448 if(have_pressure) *have_pressure =
FALSE;
449 if(tilt_x) *tilt_x = 0.0;
450 if(tilt_y) *tilt_y = 0.0;
451 if(have_tilt) *have_tilt =
FALSE;
452 if(picked_device_name) *picked_device_name = NULL;
455 GdkWindow *
window = gdk_event_get_window((GdkEvent *)event);
461 gboolean best_have_p =
FALSE;
462 double best_tx = 0.0;
463 double best_ty = 0.0;
464 gboolean best_have_t =
FALSE;
465 const char *best_name = NULL;
467 GdkSeat *seat = gdk_display_get_default() ? gdk_display_get_default_seat(gdk_display_get_default()) : NULL;
468 GList *runtime_devices = seat ? gdk_seat_get_slaves(seat, GDK_SEAT_CAPABILITY_ALL_POINTING) : NULL;
470 for(GList *l = runtime_devices; l; l = g_list_next(l))
472 GdkDevice *device = (GdkDevice *)l->data;
474 const GdkInputSource source = gdk_device_get_source(device);
475 if(source == GDK_SOURCE_KEYBOARD)
continue;
476 if(gdk_device_get_device_type(device) == GDK_DEVICE_TYPE_SLAVE)
478 GdkDisplay *display = gdk_device_get_display(device);
481 if(!display || !gdk_display_device_is_grabbed(display, device))
continue;
484 const GdkAxisFlags axis_flags = gdk_device_get_axes(device);
485 const gboolean supports_pressure = (axis_flags & GDK_AXIS_FLAG_PRESSURE) != 0;
486 const gboolean supports_x_tilt = (axis_flags & GDK_AXIS_FLAG_XTILT) != 0;
487 const gboolean supports_y_tilt = (axis_flags & GDK_AXIS_FLAG_YTILT) != 0;
488 const gboolean pen_like = (source == GDK_SOURCE_PEN || source == GDK_SOURCE_ERASER || source == GDK_SOURCE_CURSOR);
489 if(!supports_pressure && !supports_x_tilt && !supports_y_tilt && !pen_like)
continue;
491 const int n_axes = gdk_device_get_n_axes(device);
492 if(n_axes <= 0)
continue;
493 double *axes = g_newa(
double, n_axes);
494 memset(axes, 0,
sizeof(
double) * n_axes);
495 GdkModifierType modifiers = 0;
496 gdk_device_get_state(device,
window, axes, &modifiers);
499 gboolean have_p =
FALSE;
502 gboolean have_tx =
FALSE;
503 gboolean have_ty =
FALSE;
505 for(
int i = 0;
i < n_axes;
i++)
507 const GdkAxisUse use = gdk_device_get_axis_use(device,
i);
508 if(use == GDK_AXIS_PRESSURE)
513 else if(use == GDK_AXIS_XTILT)
518 else if(use == GDK_AXIS_YTILT)
525 const gboolean have_t = have_tx || have_ty;
526 const int score = (have_p ? 2 : 0) + (have_t ? 2 : 0) + (
p > 1e-4 ? 4 : 0)
527 + ((hypot(tx, ty) > 1e-4) ? 3 : 0) + (pen_like ? 1 : 0);
528 if(score <= best_score)
continue;
532 best_have_p = have_p;
535 best_have_t = have_t;
536 best_name = gdk_device_get_name(device);
540 g_list_free(runtime_devices);
541 runtime_devices = NULL;
544 if(best_score < 0)
return FALSE;
545 if(pressure) *pressure = best_p;
546 if(have_pressure) *have_pressure = best_have_p;
547 if(tilt_x) *tilt_x = best_tx;
548 if(tilt_y) *tilt_y = best_ty;
549 if(have_tilt) *have_tilt = best_have_t;
550 if(picked_device_name) *picked_device_name = best_name;
555 const guint32 time_ms,
const gboolean reset_kinematics,
562 GdkDevice *source_device = gdk_event_get_source_device((GdkEvent *)event);
563 GdkDevice *event_device = gdk_event_get_device((GdkEvent *)event);
564 GdkDevice *device = source_device ? source_device : event_device;
565 const GdkInputSource source = device ? gdk_device_get_source(device) : GDK_SOURCE_MOUSE;
566 const GdkAxisFlags axis_flags = device ? gdk_device_get_axes(device) : 0;
567 const gboolean supports_pressure = (axis_flags & GDK_AXIS_FLAG_PRESSURE) != 0;
568 const gboolean supports_x_tilt = (axis_flags & GDK_AXIS_FLAG_XTILT) != 0;
569 const gboolean supports_y_tilt = (axis_flags & GDK_AXIS_FLAG_YTILT) != 0;
570 gboolean read_pressure =
FALSE;
571 gboolean read_x_tilt =
FALSE;
572 gboolean read_y_tilt =
FALSE;
573 gboolean map_pressure_source =
FALSE;
574 gboolean map_xtilt_source =
FALSE;
575 gboolean map_ytilt_source =
FALSE;
576 gboolean state_pressure_source =
FALSE;
577 gboolean state_pressure_event =
FALSE;
578 gboolean state_xtilt_source =
FALSE;
579 gboolean state_ytilt_source =
FALSE;
580 gboolean fallback_pressure =
FALSE;
581 gboolean fallback_tilt =
FALSE;
582 const char *fallback_device_name = NULL;
583 GdkDeviceTool *tool = gdk_event_get_device_tool((GdkEvent *)event);
584 const int tool_type = tool ? (int)gdk_device_tool_get_tool_type(tool) : -1;
585 const gboolean tool_is_stylus
586 = tool && (tool_type == GDK_DEVICE_TOOL_TYPE_PEN || tool_type == GDK_DEVICE_TOOL_TYPE_ERASER
587 || tool_type == GDK_DEVICE_TOOL_TYPE_BRUSH || tool_type == GDK_DEVICE_TOOL_TYPE_PENCIL
588 || tool_type == GDK_DEVICE_TOOL_TYPE_AIRBRUSH);
589 gboolean is_tablet_like = supports_pressure || supports_x_tilt || supports_y_tilt || tool_is_stylus;
590 GdkWindow *
window = gdk_event_get_window((GdkEvent *)event);
594 double pressure = 0.0;
597 read_pressure =
TRUE;
608 else if(!is_tablet_like)
616 double p_state = 0.0;
620 state_pressure_source =
TRUE;
626 state_pressure_event =
TRUE;
633 const gboolean has_x_tilt
635 const gboolean has_y_tilt
637 read_x_tilt = has_x_tilt;
638 read_y_tilt = has_y_tilt;
639 if(has_x_tilt || has_y_tilt)
641 input.
tilt_x = CLAMP(x_tilt, -1.0, 1.0);
642 input.
tilt_y = CLAMP(y_tilt, -1.0, 1.0);
654 else if(!is_tablet_like)
662 double tx_state = 0.0, ty_state = 0.0;
667 input.
tilt_x = CLAMP(tx_state, -1.0, 1.0);
668 input.
tilt_y = CLAMP(ty_state, -1.0, 1.0);
673 state_xtilt_source = has_tx;
674 state_ytilt_source = has_ty;
685 double fb_pressure = 0.0;
686 gboolean fb_have_pressure =
FALSE;
687 double fb_tilt_x = 0.0;
688 double fb_tilt_y = 0.0;
689 gboolean fb_have_tilt =
FALSE;
691 &fb_tilt_x, &fb_tilt_y, &fb_have_tilt,
692 &fallback_device_name))
698 fallback_pressure =
TRUE;
702 input.
tilt_x = CLAMP(fb_tilt_x, -1.0, 1.0);
703 input.
tilt_y = CLAMP(fb_tilt_y, -1.0, 1.0);
706 fallback_tilt =
TRUE;
729 const double speed_px_s = hypot(dx, dy) / dt_s;
748 "[tablet] %s dev='%s' src_dev='%s' evt_dev='%s' src=%d tablet=%d tool=%d supports[p=%d xt=%d yt=%d] read[p=%d xt=%d yt=%d] map_src[p=%d xt=%d yt=%d] state[p_src=%d p_evt=%d xt_src=%d yt_src=%d] fallback[p=%d t=%d dev='%s'] values[p=%.4f tx=%.4f ty=%.4f t=%.4f a=%.4f] xy=(%.1f, %.1f) t_ms=%u reset=%d\n",
750 device ? gdk_device_get_name(device) :
"<none>",
751 source_device ? gdk_device_get_name(source_device) :
"<none>",
752 event_device ? gdk_device_get_name(event_device) :
"<none>",
754 is_tablet_like ? 1 : 0,
756 supports_pressure ? 1 : 0,
757 supports_x_tilt ? 1 : 0,
758 supports_y_tilt ? 1 : 0,
759 read_pressure ? 1 : 0,
762 map_pressure_source ? 1 : 0,
763 map_xtilt_source ? 1 : 0,
764 map_ytilt_source ? 1 : 0,
765 state_pressure_source ? 1 : 0,
766 state_pressure_event ? 1 : 0,
767 state_xtilt_source ? 1 : 0,
768 state_ytilt_source ? 1 : 0,
769 fallback_pressure ? 1 : 0,
770 fallback_tilt ? 1 : 0,
771 fallback_device_name ? fallback_device_name :
"<none>",
779 reset_kinematics ? 1 : 0);
800 if(!gtk_window_is_active(GTK_WINDOW(
darktable.gui->ui->main_window)))
return FALSE;
804 gtk_widget_grab_focus(w);
807 event->time,
TRUE,
"button-press");
816 if(!gtk_window_is_active(GTK_WINDOW(
darktable.gui->ui->main_window)))
return FALSE;
818 event->time,
FALSE,
"button-release");
827 if(!gtk_window_is_active(GTK_WINDOW(
darktable.gui->ui->main_window)))
return FALSE;
830 event->time,
FALSE,
"motion");
839#define DT_WIN32_CURSOR_SUBCLASS_CENTER ((UINT_PTR)0x41534e4e)
842 UINT_PTR subclass_id, DWORD_PTR ref_data)
852 return DefSubclassProc(hwnd, message, w_param, l_param);
857 GdkWindow *center_window = gtk_widget_get_window(widget);
858 HWND center_hwnd = center_window ? (HWND)gdk_win32_window_get_handle(center_window) : NULL;
865 GdkWindow *center_window = gtk_widget_get_window(widget);
866 HWND center_hwnd = center_window ? (HWND)gdk_win32_window_get_handle(center_window) : NULL;
874 if(!gtk_window_is_active(GTK_WINDOW(
darktable.gui->ui->main_window)))
return FALSE;
887 if(!gtk_window_is_active(GTK_WINDOW(
darktable.gui->ui->main_window)))
return FALSE;
915 static GdkEventType last_type = GDK_NOTHING;
916 static guint32 last_time = 0;
917 static guint last_keyval = 0;
918 static guint last_state = 0;
919 static guint16 last_keycode = 0;
921 const GdkEventKey *
event = (
const GdkEventKey *)g_value_get_boxed(&
params[1]);
922 if(
IS_NULL_PTR(event) || (event->type != GDK_KEY_PRESS && event->type != GDK_KEY_RELEASE))
return TRUE;
924 if(event->type == last_type && event->time == last_time && event->keyval == last_keyval
925 && event->state == last_state && event->hardware_keycode == last_keycode)
928 last_type =
event->type;
929 last_time =
event->time;
930 last_keyval =
event->keyval;
931 last_state =
event->state;
932 last_keycode =
event->hardware_keycode;
938 GdkModifierType mods = (GdkModifierType)(event->state & gtk_accelerator_get_default_mod_mask());
949#ifdef GDK_WINDOWING_QUARTZ
950 primary_mod = primary_mod || (mods & GDK_META_MASK) != 0;
951 mods = (GdkModifierType)(mods & ~GDK_META_MASK);
953 const gboolean primary_key =
event->keyval == GDK_KEY_Meta_L ||
event->keyval == GDK_KEY_Meta_R;
955 const gboolean primary_key =
event->keyval == GDK_KEY_Control_L ||
event->keyval == GDK_KEY_Control_R;
961 gchar *accel = gtk_accelerator_name(event->keyval, mods);
965 const gchar *title = GTK_IS_WINDOW(widget) ? gtk_window_get_title(GTK_WINDOW(widget)) : NULL;
967 (event->type == GDK_KEY_PRESS) ?
"pressed" :
"released",
968 (primary_mod && !primary_key) ?
"<Primary>" :
"", primary_key ?
"<Primary> (" :
"",
969 IS_NULL_PTR(accel) ?
"<unnamed>" : accel, primary_key ?
")" :
"",
970 event->keyval, (
unsigned int)event->hardware_keycode, event->state,
992 static const gchar *SOURCE_NAMES[]
993 = {
"GDK_SOURCE_MOUSE",
"GDK_SOURCE_PEN",
"GDK_SOURCE_ERASER",
"GDK_SOURCE_CURSOR",
994 "GDK_SOURCE_KEYBOARD",
"GDK_SOURCE_TOUCHSCREEN",
"GDK_SOURCE_TOUCHPAD",
"GDK_SOURCE_TRACKPOINT",
995 "GDK_SOURCE_TABLET_PAD" };
996 if(pos >= G_N_ELEMENTS(SOURCE_NAMES))
return "<UNKNOWN>";
997 return SOURCE_NAMES[pos];
1002 static const gchar *MODE_NAMES[] = {
"GDK_MODE_DISABLED",
"GDK_MODE_SCREEN",
"GDK_MODE_WINDOW" };
1003 if(pos >= G_N_ELEMENTS(MODE_NAMES))
return "<UNKNOWN>";
1004 return MODE_NAMES[pos];
1009 static const gchar *AXIS_NAMES[]
1010 = {
"GDK_AXIS_IGNORE",
"GDK_AXIS_X",
"GDK_AXIS_Y",
"GDK_AXIS_PRESSURE",
1011 "GDK_AXIS_XTILT",
"GDK_AXIS_YTILT",
"GDK_AXIS_WHEEL",
"GDK_AXIS_DISTANCE",
1012 "GDK_AXIS_ROTATION",
"GDK_AXIS_SLIDER",
"GDK_AXIS_LAST" };
1013 if(pos >= G_N_ELEMENTS(AXIS_NAMES))
return "<UNKNOWN>";
1014 return AXIS_NAMES[pos];
1019#define DT_ACCEL_SEARCH_RECENT_KEY "plugins/accel_search/recent_entries"
1095 if(
IS_NULL_PTR(top_panel) || !gtk_widget_get_visible(top_panel))
return 0;
1096 return gtk_widget_get_allocated_height(top_panel);
1143 if(refresh_filmstrip)
1162 return G_SOURCE_REMOVE;
1188 request->
imgid = imgid;
1219 g_setenv(
"GTK_OVERLAY_SCROLLING",
"0", 0);
1222 g_setenv(
"LIBOVERLAY_SCROLLBAR",
"0", 0);
1232 g_strlcpy(gui->
gtkrc, css_theme,
sizeof(gui->
gtkrc));
1234 g_snprintf(gui->
gtkrc,
sizeof(gui->
gtkrc),
"ansel");
1236#ifdef MAC_INTEGRATION
1237#ifdef GTK_TYPE_OSX_APPLICATION
1238 GtkOSXApplication *OSXApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
1239 gtk_osxapplication_set_menu_bar(
1240 OSXApp, GTK_MENU_SHELL(gtk_menu_bar_new()));
1242 GtkosxApplication *OSXApp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL);
1243 gtkosx_application_set_menu_bar(
1244 OSXApp, GTK_MENU_SHELL(gtk_menu_bar_new()));
1246 g_signal_connect(G_OBJECT(OSXApp),
"NSApplicationBlockTermination", G_CALLBACK(_osx_quit_callback), NULL);
1247 g_signal_connect(G_OBJECT(OSXApp),
"NSApplicationOpenFile", G_CALLBACK(_osx_openfile_callback), NULL);
1272 gchar *keyboardrc_path = g_build_filename(configdir, keyboardrc, NULL);
1274 GtkAccelFlags
flags = 0;
1299 gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), path);
1301 gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), path);
1306 gtk_widget_set_can_focus(widget,
TRUE);
1307 gtk_widget_set_visible(widget,
TRUE);
1308 gtk_widget_grab_focus(widget);
1309 gtk_widget_add_events(widget, GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK | GDK_TABLET_PAD_MASK);
1310 g_signal_connect(G_OBJECT(widget),
"configure-event", G_CALLBACK(
_configure), gui);
1311 g_signal_connect(G_OBJECT(widget),
"draw", G_CALLBACK(
_draw), NULL);
1312 g_signal_connect(G_OBJECT(widget),
"motion-notify-event", G_CALLBACK(
_mouse_moved), NULL);
1313 g_signal_connect(G_OBJECT(widget),
"key-press-event", G_CALLBACK(
_key_pressed), NULL);
1314 g_signal_connect(G_OBJECT(widget),
"key-release-event", G_CALLBACK(
_key_released), NULL);
1315 g_signal_connect(G_OBJECT(widget),
"leave-notify-event", G_CALLBACK(
_center_leave), NULL);
1316 g_signal_connect(G_OBJECT(widget),
"enter-notify-event", G_CALLBACK(
_center_enter), NULL);
1317 g_signal_connect(G_OBJECT(widget),
"button-press-event", G_CALLBACK(
_button_pressed), NULL);
1318 g_signal_connect(G_OBJECT(widget),
"button-release-event", G_CALLBACK(
_button_released), NULL);
1319 g_signal_connect(G_OBJECT(widget),
"scroll-event", G_CALLBACK(
_scrolled), NULL);
1321 g_signal_connect(G_OBJECT(widget),
"realize", G_CALLBACK(
_center_realize), NULL);
1322 g_signal_connect(G_OBJECT(widget),
"unrealize", G_CALLBACK(
_center_unrealize), NULL);
1323 if(gtk_widget_get_realized(widget))
1332 g_signal_connect(G_OBJECT(widget),
"configure-event", G_CALLBACK(
_window_configure), NULL);
1342 GList *input_devices
1343 = gdk_seat_get_slaves(gdk_display_get_default_seat(gdk_display_get_default()), GDK_SEAT_CAPABILITY_ALL);
1344 const int manager_slave_count = 0;
1345 const int manager_floating_count = 0;
1346 GList *stylus_devices
1347 = gdk_seat_get_slaves(gdk_display_get_default_seat(gdk_display_get_default()), GDK_SEAT_CAPABILITY_TABLET_STYLUS);
1349 (
unsigned int)gdk_seat_get_capabilities(gdk_display_get_default_seat(gdk_display_get_default())));
1350 dt_print(
DT_DEBUG_INPUT,
"[input device] stylus-capable devices reported by seat: %d\n", g_list_length(stylus_devices));
1351 dt_print(
DT_DEBUG_INPUT,
"[input device] manager fallback devices: slave=%d floating=%d merged_total=%d\n",
1352 manager_slave_count, manager_floating_count, g_list_length(input_devices));
1353 for(GList *l = stylus_devices; !
IS_NULL_PTR(l); l = g_list_next(l))
1355 GdkDevice *device = (GdkDevice *)l->data;
1358 gdk_device_get_name(device),
_get_source_name(gdk_device_get_source(device)),
1359 (
unsigned int)gdk_device_get_axes(device), gdk_device_get_n_axes(device));
1363 g_list_free(stylus_devices);
1364 stylus_devices = NULL;
1366 for(GList *l = input_devices; !
IS_NULL_PTR(l); l = g_list_next(l))
1368 GdkDevice *device = (GdkDevice *)l->data;
1370 const GdkInputSource source = gdk_device_get_source(device);
1371 const gint n_axes = (source == GDK_SOURCE_KEYBOARD ? 0 : gdk_device_get_n_axes(device));
1375 gdk_device_set_mode(device, GDK_MODE_SCREEN);
1377 dt_print(
DT_DEBUG_INPUT,
"%s (%s), source: %s, mode: %s, %d axes, %d keys\n", gdk_device_get_name(device),
1378 (source != GDK_SOURCE_KEYBOARD) && gdk_device_get_has_cursor(device) ?
"with cursor" :
"no cursor",
1381 source != GDK_SOURCE_KEYBOARD ? gdk_device_get_n_keys(device) : 0);
1383 for(
int i = 0;
i < n_axes;
i++)
1391 g_list_free(input_devices);
1392 input_devices = NULL;
1400 g_signal_add_emission_hook(g_signal_lookup(
"event", GTK_TYPE_WIDGET), 0,
_log_key_event, NULL, NULL);
1450 GtkAllocation allocation;
1451 gtk_widget_get_allocation(widget, &allocation);
1466#ifdef MAC_INTEGRATION
1467#ifdef GTK_TYPE_OSX_APPLICATION
1468 gtk_osxapplication_ready(g_object_new(GTK_TYPE_OSX_APPLICATION, NULL));
1470 gtkosx_application_ready(g_object_new(GTKOSX_TYPE_APPLICATION, NULL));
1473#ifdef GDK_WINDOWING_QUARTZ
1494 if(screen_dpi_overwrite > 0.0)
1496 gui->
dpi = screen_dpi_overwrite;
1497 gdk_screen_set_resolution(gtk_widget_get_screen(widget), screen_dpi_overwrite);
1499 "the configuration file\n",
1500 screen_dpi_overwrite);
1504#ifdef GDK_WINDOWING_QUARTZ
1507 gui->
dpi = gdk_screen_get_resolution(gtk_widget_get_screen(widget));
1511 gdk_screen_set_resolution(gtk_widget_get_screen(widget), 96.0);
1542 if(gtk_box_get_spacing(GTK_BOX(w)) == c->old_s) gtk_box_set_spacing(GTK_BOX(w), c->new_s);
1544 else if(GTK_IS_FLOW_BOX(w))
1546 if((gint)gtk_flow_box_get_row_spacing(GTK_FLOW_BOX(w)) == c->old_s)
1547 gtk_flow_box_set_row_spacing(GTK_FLOW_BOX(w), c->new_s);
1548 if((gint)gtk_flow_box_get_column_spacing(GTK_FLOW_BOX(w)) == c->old_s)
1549 gtk_flow_box_set_column_spacing(GTK_FLOW_BOX(w), c->new_s);
1551 else if(GTK_IS_GRID(w))
1553 if((gint)gtk_grid_get_row_spacing(GTK_GRID(w)) == c->old_s)
1554 gtk_grid_set_row_spacing(GTK_GRID(w), c->new_s);
1555 if((gint)gtk_grid_get_column_spacing(GTK_GRID(w)) == c->old_s)
1556 gtk_grid_set_column_spacing(GTK_GRID(w), c->new_s);
1559 if(GTK_IS_CONTAINER(w))
1572 GList *toplevels = gtk_window_list_toplevels();
1573 for(GList *l = toplevels; l; l = l->next)
1575 g_list_free(toplevels);
1585 GtkStyleContext *ctx = gtk_widget_get_style_context(gui->
ui->
main_window);
1586 PangoFontDescription *desc = NULL;
1587 gtk_style_context_get(ctx, gtk_style_context_get_state(ctx), GTK_STYLE_PROPERTY_FONT, &desc, NULL);
1590 const gint
size = pango_font_description_get_size(desc);
1593 if(pango_font_description_get_size_is_absolute(desc))
1602 pango_font_description_free(desc);
1613 pango_cairo_context_set_resolution(pango_layout_get_context(layout),
darktable.gui->dpi);
1619 gtk_window_set_urgency_hint(GTK_WINDOW(widget),
FALSE);
1625 gtk_widget_hide(GTK_WIDGET(user_data));
1631 gtk_widget_hide(GTK_WIDGET(user_data));
1643 gtk_window_set_role(GTK_WINDOW(gui->
ui->
main_window ),
"main-app");
1644 gtk_window_set_icon_name(GTK_WINDOW(gui->
ui->
main_window ),
"ansel");
1645 gtk_window_set_title(GTK_WINDOW(gui->
ui->
main_window ),
"Ansel");
1657 gboolean restore_window_position =
TRUE;
1658#ifdef GDK_WINDOWING_WAYLAND
1659 GdkDisplay *display = gtk_widget_get_display(gui->
ui->
main_window);
1660 if(GDK_IS_WAYLAND_DISPLAY(display))
1661 restore_window_position =
FALSE;
1664 if(restore_window_position)
1666 GdkDisplay *window_display = gtk_widget_get_display(gui->
ui->
main_window);
1667 GdkMonitor *monitor = NULL;
1674 if(monitor_index >= 0 && monitor_index < gdk_display_get_n_monitors(window_display))
1675 monitor = gdk_display_get_monitor(window_display, monitor_index);
1684 monitor = gdk_display_get_monitor_at_point(window_display,
x, y);
1688 monitor = gdk_display_get_primary_monitor(window_display);
1689 if(
IS_NULL_PTR(monitor) && gdk_display_get_n_monitors(window_display) > 0)
1690 monitor = gdk_display_get_monitor(window_display, 0);
1695 GdkRectangle workarea = { 0 };
1696 gdk_monitor_get_workarea(monitor, &workarea);
1697 gtk_window_move(GTK_WINDOW(gui->
ui->
main_window), workarea.x, workarea.y);
1709 gboolean restore_window_position =
TRUE;
1710#ifdef GDK_WINDOWING_WAYLAND
1711 GdkDisplay *display = gtk_widget_get_display(gui->
ui->
main_window);
1712 if(GDK_IS_WAYLAND_DISPLAY(display))
1713 restore_window_position =
FALSE;
1716 if(restore_window_position
1725 GdkDisplay *window_display = gtk_widget_get_display(gui->
ui->
main_window);
1726 GdkMonitor *monitor = NULL;
1733 if(monitor_index >= 0 && monitor_index < gdk_display_get_n_monitors(window_display))
1734 monitor = gdk_display_get_monitor(window_display, monitor_index);
1738 monitor = gdk_display_get_monitor_at_point(window_display,
x +
width / 2, y +
height / 2);
1740 monitor = gdk_display_get_primary_monitor(window_display);
1741 if(
IS_NULL_PTR(monitor) && gdk_display_get_n_monitors(window_display) > 0)
1742 monitor = gdk_display_get_monitor(window_display, 0);
1747 GdkRectangle workarea = { 0 };
1748 gdk_monitor_get_workarea(monitor, &workarea);
1750 const int max_x = workarea.x +
MAX(0, workarea.width -
width);
1751 const int max_y = workarea.y +
MAX(0, workarea.height -
height);
1752 clamped_x = CLAMP(
x, workarea.x, max_x);
1753 clamped_y = CLAMP(y, workarea.y, max_y);
1756 gtk_window_move(GTK_WINDOW(gui->
ui->
main_window), clamped_x, clamped_y);
1772 gtk_container_add(GTK_CONTAINER(
container), widget);
1773 gtk_widget_show(widget);
1786 darktable.gui->ui->log_msg = gtk_label_new(
"");
1789 gtk_label_set_ellipsize(GTK_LABEL(
darktable.gui->ui->log_msg), PANGO_ELLIPSIZE_MIDDLE);
1791 gtk_container_add(GTK_CONTAINER(eb),
darktable.gui->ui->log_msg);
1792 gtk_widget_set_valign(eb, GTK_ALIGN_CENTER);
1793 gtk_widget_set_halign(eb, GTK_ALIGN_CENTER);
1794 gtk_overlay_add_overlay(GTK_OVERLAY(
darktable.gui->ui->center_base), eb);
1798 eb = gtk_event_box_new();
1799 darktable.gui->ui->toast_msg = gtk_label_new(
"");
1803 g_signal_connect(G_OBJECT(eb),
"scroll-event", G_CALLBACK(
_scrolled), NULL);
1804 gtk_label_set_ellipsize(GTK_LABEL(
darktable.gui->ui->toast_msg), PANGO_ELLIPSIZE_MIDDLE);
1806 PangoAttrList *attrlist = pango_attr_list_new();
1807 PangoAttribute *attr = pango_attr_font_features_new(
"tnum");
1808 pango_attr_list_insert(attrlist, attr);
1809 gtk_label_set_attributes(GTK_LABEL(
darktable.gui->ui->toast_msg), attrlist);
1810 pango_attr_list_unref(attrlist);
1813 gtk_container_add(GTK_CONTAINER(eb),
darktable.gui->ui->toast_msg);
1814 gtk_widget_set_valign(eb, GTK_ALIGN_START);
1815 gtk_widget_set_halign(eb, GTK_ALIGN_CENTER);
1816 gtk_overlay_add_overlay(GTK_OVERLAY(
darktable.gui->ui->center_base), eb);
1837 g_return_if_fail(GTK_IS_CONTAINER(ui->
containers[c]));
1839 if(GTK_WIDGET(ui->
containers[c]) != gtk_widget_get_parent(w))
return;
1841 gtk_container_set_focus_child(GTK_CONTAINER(ui->
containers[c]), w);
1847 g_return_if_fail(GTK_IS_CONTAINER(ui->
containers[c]));
1848 gtk_container_foreach(GTK_CONTAINER(ui->
containers[c]), callback, (gpointer)ui->
containers[c]);
1861#ifdef MAC_INTEGRATION
1862#ifdef GTK_TYPE_OSX_APPLICATION
1863 gtk_osxapplication_attention_request(g_object_new(GTK_TYPE_OSX_APPLICATION, NULL), INFO_REQUEST);
1865 gtkosx_application_attention_request(g_object_new(GTKOSX_TYPE_APPLICATION, NULL), INFO_REQUEST);
1874 gtk_widget_queue_draw(widget);
1882 if(!GTK_IS_LABEL(widget))
1891 gtk_widget_show(widget);
1895 gtk_widget_hide(widget);
1905 if(!GTK_IS_LABEL(widget))
1914 if(!gtk_widget_get_visible(widget))
1917 gtk_widget_set_margin_bottom(gtk_widget_get_parent(widget), 0.15 * h -
DT_PIXEL_APPLY_DPI(10));
1918 gtk_widget_show(widget);
1923 if(gtk_widget_get_visible(widget)) gtk_widget_hide(widget);
1941 g_object_set_data_full(G_OBJECT(widget),
"dt-help-url", link,
g_free);
1942 gtk_widget_add_events(widget, GDK_BUTTON_PRESS_MASK);
1949 g_snprintf(theme_css,
sizeof(theme_css),
"%s.css", theme);
1956 gtk_settings_reset_property(gtk_settings_get_default(),
"gtk-font-name");
1963 gchar *font_name = g_strdup_printf(_(
"Sans %s"), font_size_updated);
1964 g_object_set(gtk_settings_get_default(),
"gtk-font-name", font_name, NULL);
1970 gchar *path, *usercsspath;
1976 path = g_build_filename(configdir,
"themes", theme_css, NULL);
1977 if(!g_file_test(path, G_FILE_TEST_EXISTS))
1981 path = g_build_filename(datadir,
"themes", theme_css, NULL);
1982 if(!g_file_test(path, G_FILE_TEST_EXISTS))
1986 path = g_build_filename(datadir,
"themes",
"ansel.css", NULL);
1995 GError *
error = NULL;
1997 GtkStyleProvider *themes_style_provider = GTK_STYLE_PROVIDER(gtk_css_provider_new());
1998 gtk_style_context_add_provider_for_screen
1999 (gdk_screen_get_default(), themes_style_provider, GTK_STYLE_PROVIDER_PRIORITY_USER + 1);
2001 usercsspath = g_build_filename(configdir,
"user.css", NULL);
2003 gchar *path_uri = g_filename_to_uri(path, NULL, &
error);
2005 fprintf(stderr,
"%s: could not convert path %s to URI. Error: %s\n", G_STRFUNC, path,
error->message);
2007 gchar *usercsspath_uri = g_filename_to_uri(usercsspath, NULL, &
error);
2009 fprintf(stderr,
"%s: could not convert path %s to URI. Error: %s\n", G_STRFUNC, usercsspath,
error->message);
2011 gchar *themecss = NULL;
2012 if(
dt_conf_get_bool(
"themes/usercss") && g_file_test(usercsspath, G_FILE_TEST_EXISTS))
2014 themecss = g_strjoin(NULL,
"@import url('", path_uri,
2015 "'); @import url('", usercsspath_uri,
"');", NULL);
2019 themecss = g_strjoin(NULL,
"@import url('", path_uri,
"');", NULL);
2029 gchar *newcss = g_strjoin(NULL, themecss,
" tooltip {opacity: 0; background: transparent;}", NULL);
2034 if(!gtk_css_provider_load_from_data(GTK_CSS_PROVIDER(themes_style_provider), themecss, -1, &
error))
2036 fprintf(stderr,
"%s: error parsing combined CSS %s: %s\n", G_STRFUNC, themecss,
error->message);
2037 g_clear_error(&
error);
2042 g_object_unref(themes_style_provider);
2048 GtkStyleContext *ctx = gtk_widget_get_style_context(main_window);
2055 GdkRGBA default_col;
2093 if(!gtk_style_context_lookup_color(ctx,
init[
i].
name, &c[
i]))
2095 c[
i] =
init[
i].default_col;
2192 gtk_widget_grab_focus(
darktable.gui->ui->thumbtable_lighttable->grid);
void dt_accels_set_top_offset_handler(dt_accels_top_offset_handler_t handler)
gboolean dt_accels_dispatch(GtkWidget *w, GdkEvent *event, gpointer user_data)
Force our listener for all key strokes to bypass reserved Gtk keys.
dt_accels_t * dt_accels_init(char *config_file, GtkAccelFlags flags)
void dt_accels_set_refocus_handler(dt_accels_refocus_handler_t handler)
void dt_accels_set_recent_handlers(dt_accels_recent_get_handler_t get, dt_accels_recent_set_handler_t set)
void dt_accels_set_global(dt_accels_t *accels)
void dt_accels_load_user_config(dt_accels_t *accels)
Loads keyboardrc.lang from config dir. This needs to run after we inited the accel map from widgets c...
static void dt_accels_disable(dt_accels_t *accels, gboolean state)
void dt_gui_alert(const char *title, const char *message, const char *item, const gboolean once)
static const char * _get_source_name(int pos)
static gboolean _widget_stored_int(const char *key, int *value)
static double _clamp01d(const double value)
static void _accels_recent_set(int index, const char *value)
static gboolean _sample_tablet_state_from_devices(const GdkEvent *event, double *pressure, gboolean *have_pressure, double *tilt_x, double *tilt_y, gboolean *have_tilt, const char **picked_device_name)
static void _ui_widget_redraw_callback(gpointer instance, GtkWidget *widget)
static gint _accels_top_offset(void)
GtkWidget * dt_gui_main_window(void)
static gboolean _button_released(GtkWidget *w, GdkEventButton *event, gpointer user_data)
static dt_control_pointer_input_t _extract_pointer_input(const GdkEvent *event, const double x, const double y, const guint32 time_ms, const gboolean reset_kinematics, const char *tag)
void dt_ui_container_foreach(dt_ui_t *ui, const dt_ui_container_t c, GtkCallback callback)
calls a callback on all children widgets from container
gboolean dt_gui_quit_callback(GtkWidget *widget, GdkEvent *event, gpointer user_data)
static gboolean _center_leave(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
static gboolean _key_released(GtkWidget *w, GdkEventKey *event)
static const gdouble * _event_axes(const GdkEvent *event)
static gint _widget_natural_width(GtkWidget *widget)
static const char * _get_mode_name(int pos)
static void _center_unrealize(GtkWidget *widget, gpointer user_data)
static void _widget_store_bool(const char *key, gboolean value)
static void _widget_message(const char *message)
static gboolean _key_pressed(GtkWidget *w, GdkEventKey *event)
static gboolean _center_enter(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
struct dt_accels_t * dt_gui_get_accels(void)
static gboolean _ui_toast_button_press_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
static gboolean _button_pressed(GtkWidget *w, GdkEventButton *event, gpointer user_data)
static dt_tablet_motion_state_t _tablet_motion_state
static gchar * _accels_recent_get(int index)
static gboolean _draw(GtkWidget *da, cairo_t *cr, gpointer user_data)
static gboolean _ui_log_button_press_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
static void _notify_profile_changed(void)
void dt_ui_container_destroy_children(dt_ui_t *ui, const dt_ui_container_t c)
destroy all child widgets from container
static gboolean _log_key_event(GSignalInvocationHint *hint, guint n_params, const GValue *params, gpointer data)
struct dt_ui_t * dt_gui_get_ui(void)
static gboolean _widget_stored_bool(const char *key)
static LRESULT CALLBACK _center_win32_cursor_proc(HWND hwnd, UINT message, WPARAM w_param, LPARAM l_param, UINT_PTR subclass_id, DWORD_PTR ref_data)
static void _pixelpipe_cache_alert(const char *message, const char *item)
void dt_gui_load_theme(const char *theme)
static void _widget_cursor(GdkCursorType cursor)
int dt_gui_gtk_write_config()
void dt_gui_store_last_preset(const char *name)
void dt_configure_ppd_dpi(dt_gui_gtk_t *gui)
GtkWidget * dt_gui_center_widget(void)
static gboolean _get_axis_value_for_source(const GdkEvent *event, GdkDevice *source_device, const GdkAxisUse axis, double *value, gboolean *from_source_map)
static const char * _get_axis_name(int pos)
static gboolean _refresh_thumbnail_on_gui_thread(gpointer user_data)
static void _refresh_thumbnail_widgets(int32_t imgid, gboolean refresh_filmstrip)
static void _init_widgets(dt_gui_gtk_t *gui)
static void _update_display_profile(void)
static gboolean _mouse_moved(GtkWidget *w, GdkEventMotion *event, gpointer user_data)
#define DT_ACCEL_SEARCH_RECENT_KEY
void dt_gui_add_help_link(GtkWidget *widget, char *link)
#define DT_WIN32_CURSOR_SUBCLASS_CENTER
void dt_ui_notify_user()
draw user's attention
static void _notebook_page_changed(gpointer owner)
static gboolean _focus_in_out_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
static void _ui_log_redraw_callback(gpointer instance, GtkWidget *widget)
int dt_gui_gtk_init(dt_gui_gtk_t *gui)
static void _widget_store_int(const char *key, int value)
void dt_gui_refocus_center()
static void _gui_refresh_thumbnail(int32_t imgid, gboolean refresh_filmstrip)
static void _refresh_all_container_spacing(void)
static gint _last_box_spacing
void dt_gui_set_pango_resolution(PangoLayout *layout)
static gboolean _configure(GtkWidget *da, GdkEventConfigure *event, gpointer user_data)
static gboolean _scrolled(GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
static void _ui_toast_redraw_callback(gpointer instance, GtkWidget *widget)
void dt_gui_gtk_run(dt_gui_gtk_t *gui)
static GtkWidget * _widget_root_window(void)
static void _refresh_container_spacing(GtkWidget *w, gpointer user_data)
static gboolean _window_configure(GtkWidget *da, GdkEvent *event, gpointer user_data)
static void _center_realize(GtkWidget *widget, gpointer user_data)
static void _gui_startup_progress(const char *message)
void dt_ui_container_focus_widget(dt_ui_t *ui, const dt_ui_container_t c, GtkWidget *w)
gives a widget focus in the container
static gboolean _sample_axis_from_device_state(GdkWindow *window, GdkDevice *device, const GdkAxisUse axis, double *value)
void dt_gui_update_em(void)
static void error(char *msg)
void init(dt_imageio_module_format_t *self)
uint32_t container(dt_lib_module_t *self)
void dt_gui_closing_quit(void)
void dt_gui_closing_wait(void)
void dt_collection_init_global(void)
void dt_collection_gui_register_handlers(void)
static void _notify_profile_changed(void)
void dt_colorspaces_set_profile_changed_handler(dt_colorspaces_profile_changed_handler_t handler)
Register the one callback fired when the display profile changes.
void dt_colorspaces_set_display_profile(const dt_colorspaces_color_profile_type_t profile_type, GtkWidget *widget)
Refresh the cached display profile from the monitor showing widget (X atom, colord,...
The colour-profile module's API: which profiles exist, and how to apply one.
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
void dt_conf_set_bool(const char *name, int val)
int dt_conf_get_bool(const char *name)
int dt_conf_key_exists(const char *key)
Does key have a value?
float dt_conf_get_float(const char *name)
Float for name, clamped to its declared bounds.
gchar * dt_conf_get_string(const char *name)
Read the stored string for name as a private copy.
void dt_conf_set_int(const char *name, int val)
int dt_conf_get_int(const char *name)
Integer for name, clamped to the bounds declared in the XML.
void dt_conf_set_string(const char *name, const char *val)
const char * dt_conf_get_string_const(const char *name)
Borrow the stored string for name without copying it.
void dt_gui_container_destroy_children(GtkContainer *container)
void dt_control_set_shutdown_wait_handler(dt_control_shutdown_wait_t handler)
void dt_control_key_pressed(GdkEventKey *event)
void dt_control_button_pressed(double x, double y, double pressure, int which, int type, uint32_t state)
void dt_toast_log(const char *msg,...)
void dt_control_set_alert_handler(dt_control_alert_handler_t handler)
Install the alert handler; NULL restores the fallback to dt_control_log().
void dt_control_mouse_leave()
gboolean dt_control_configure(GtkWidget *da, GdkEventConfigure *event, gpointer user_data)
void dt_control_button_released(double x, double y, int which, uint32_t state)
void dt_control_set_pointer_input(const dt_control_pointer_input_t *input)
void dt_control_mouse_moved(double x, double y, double pressure, int which)
void dt_control_key_released(GdkEventKey *event)
void dt_control_mouse_enter()
void dt_control_expose(cairo_t *cr, const int width, const int height)
#define dt_control_change_cursor(cursor)
struct dt_control_t * dt_control_get_global(void)
int dt_load_from_string(const gchar *input, gboolean open_image_in_dr, gboolean *single_image)
struct dt_gui_gtk_t * dt_gui_get_global(void)
static int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_mutex_init(dt_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr)
Initialise a mutex. With mutexattr NULL – which is how 54 of the 56 call sites in this tree spell it ...
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
void dt_loc_get_sharedir(char *sharedir, size_t bufsize)
void dt_loc_get_datadir(char *datadir, size_t bufsize)
void dt_loc_get_user_config_dir(char *configdir, size_t bufsize)
void dt_film_gui_register_handlers(void)
void dt_folder_survey_gui_register_handlers()
int instance
One module instance's contribution, as data.
void dt_gui_presets_init()
void dt_guides_init(void)
void dt_guides_set_overlay_colors()
void dt_history_merge_gui_register_handlers(void)
void dt_gui_import_init_handlers(void)
Register the GUI-side import handlers (the discarded-files recap dialog).
const char * dt_l10n_get_current_lang(dt_l10n_t *l10n)
struct dt_l10n_t * dt_l10n_get_global(void)
static const dt_iop_drawlayer_params_t * params
int32_t dt_get_debug_flags(void)
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
Print to stdout when thread is enabled, prefixed with seconds since startup.
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
dt_mipmap_buffer_dsc_flags flags
void dt_osx_focus_window()
void dt_osx_autoset_dpi(GtkWidget *widget)
#define DT_PATH_MAX
Buffer size for a filesystem path anywhere in Ansel.
void dt_concat_path_file(char destination[4096], const char path[4096], const char *const file)
Append a constant filename to a variable, stack-based, fixed-sized, directory, and add a / in-between...
void dt_dev_pixelpipe_cache_set_alert_handler(dt_pixelpipe_cache_alert_handler_t alert)
Install the alert handler. The GUI installs it, once it exists, apart from the others: without a GUI ...
Pixelpipe cache for storing intermediate results in the pixelpipe.
@ DT_COLORSPACE_DISPLAY
The monitor profile – the one list entry that mutates after init.
void dt_screen_set_dpi(double dpi)
void dt_selection_init_global(void)
#define DT_DEBUG_CONTROL_SIGNAL_RAISE(ctlsig, signal,...)
struct dt_control_signal_t * dt_control_signal_get_global(void)
@ DT_SIGNAL_CONTROL_REDRAW_ALL
This signal is raised when dt_control_queue_redraw() is called. no param, no returned value.
@ DT_SIGNAL_CONTROL_TOAST_REDRAW
This signal is raised when dt_control_toast_redraw() is called. no param, no returned value.
@ DT_SIGNAL_CONTROL_NOTEBOOK_TAB_CHANGED
This signal is raised when a GtkNotebook created/registered via dt_ui_notebook_set_picker_owner() swi...
@ DT_SIGNAL_CONTROL_PROFILE_CHANGED
This signal is raised when the screen profile has changed no param, no returned value.
@ DT_SIGNAL_CONTROL_LOG_REDRAW
This signal is raised when dt_control_log_redraw() is called. no param, no returned value.
#define DT_DEBUG_CONTROL_SIGNAL_CONNECT(ctlsig, signal, cb, user_data)
void dt_gui_splash_init(void)
void dt_gui_splash_updatef(const char *format,...)
void dt_gui_splash_set_transient_for(GtkWidget *parent)
void dt_startup_progress_set_handler(dt_startup_progress_handler_t handler)
gboolean refresh_filmstrip
dt_pthread_mutex_t log_mutex
dt_pthread_mutex_t toast_mutex
GtkMenu * presets_popup_menu
cairo_filter_t filter_image
struct dt_gui_gtk_t::@310034163271067065001067313203076354050152156220 export_popup
struct dt_gui_gtk_t::@203355275301244245372310074133053245302222037030 styles_popup
dt_thumbtable_t * thumbtable_lighttable
GtkWidget * containers[DT_UI_CONTAINER_SIZE]
dt_thumbtable_t * thumbtable_filmstrip
GtkWidget * panels[DT_UI_PANEL_SIZE]
typedef double((*spd)(unsigned long int wavelength, double TempK))
void dt_thumbnail_notify_set_handler(dt_thumbnail_refresh_handler_t handler)
A widget to manage and display image thumbnails in Ansel's lighttable and filmstrip views.
#define dt_thumbtable_refresh_thumbnail(table, imgid, reinit)
gchar * dt_util_str_replace(const gchar *string, const gchar *pattern, const gchar *substitute)
void dt_view_manager_configure(dt_view_manager_t *vm, int width, int height)
int dt_view_manager_scrolled(dt_view_manager_t *vm, double x, double y, int up, int state, int delta_y)
const dt_view_t * dt_view_manager_get_current_view(dt_view_manager_t *vm)
GtkWidget * dt_ui_toast_msg(dt_ui_t *ui)
GtkWidget * dt_ui_center(dt_ui_t *ui)
void dt_ui_cleanup_titlebar(dt_ui_t *ui)
void dt_ui_init_titlebar(dt_ui_t *ui)
int dt_ui_panel_get_size(dt_ui_t *ui, const dt_ui_panel_t p)
gboolean dt_ui_panel_ancestor(dt_ui_t *ui, const dt_ui_panel_t p, GtkWidget *w)
GtkWidget * dt_ui_log_msg(dt_ui_t *ui)
GtkWidget * dt_ui_main_window(dt_ui_t *ui)
void dt_ui_init_main_table(GtkWidget *parent, dt_ui_t *ui)
GtkWidget * dt_ui_center_base(dt_ui_t *ui)