70#define DT_GUI_MOUSE_EFFECT_RADIUS darktable.gui->mouse.effect_radius_clamped
85#define DT_UI_SCALE_UI(value) ((value) * darktable.gui->dpi_factor)
86#define DT_UI_SCALE_DEVICE(value) ((value) * darktable.gui->dpi_factor * darktable.gui->ppd)
90#define DT_PIXEL_APPLY_DPI(value) DT_UI_SCALE_UI(value)
91#define DT_PIXEL_APPLY_DPI_DPP(value) DT_UI_SCALE_DEVICE(value)
107#define DT_GUI_EM_SIZE ((gint)((!IS_NULL_PTR(darktable.gui) && darktable.gui->em > 0.0) ? darktable.gui->em : 16.0))
108#define DT_GUI_BOX_SPACING_EM 0.625
109#define DT_GUI_BOX_SPACING \
110 ((gint)(DT_GUI_EM_SIZE * DT_GUI_BOX_SPACING_EM + 0.5))
293void dt_gtk_widget_queue_draw_ext(
GtkWidget *widget,
const char *
name,
const char *file,
const int line);
294#define dt_gtk_widget_queue_draw(widget) dt_gtk_widget_queue_draw_ext((GtkWidget *)(widget), #widget, __FILE__, __LINE__)
295#define gtk_widget_queue_draw(widget) dt_gtk_widget_queue_draw(widget)
303void dt_gtk_toggle_button_set_active_ext(GtkToggleButton *toggle_button,
const char *
name,
const gboolean active,
304 const char *file,
const int line);
305#define dt_gtk_toggle_button_set_active(toggle_button, active) \
306 dt_gtk_toggle_button_set_active_ext((GtkToggleButton *)(toggle_button), #toggle_button, active, __FILE__, __LINE__)
307#define gtk_toggle_button_set_active(toggle_button, active) \
308 dt_gtk_toggle_button_set_active(toggle_button, active)
311#define dt_gtk_widget_queue_draw(widget) gtk_widget_queue_draw(widget)
312#define dt_gtk_toggle_button_set_active(toggle_button, active) gtk_toggle_button_set_active(toggle_button, active)
323 cairo_surface_t *cst = cairo_image_surface_create_for_data(data, format,
width,
height, stride);
329 cairo_surface_t *cst = cairo_image_surface_create_from_png(filename);
343 cairo_surface_t *cst = gdk_cairo_surface_create_from_pixbuf(pixbuf, scale, for_window);
428#define dt_accels_new_global_action(a, b, c, d, e, f, g) dt_accels_new_action_shortcut(darktable.gui->accels, a, b, darktable.gui->accels->global_accels, c, d, e, f, FALSE, g)
430#define dt_accels_new_darkroom_action(a, b, c, d, e, f, g) dt_accels_new_action_shortcut(darktable.gui->accels, a, b, darktable.gui->accels->darkroom_accels, c, d, e, f, FALSE, g)
432#define dt_accels_new_lighttable_action(a, b, c, d, e, f, g) dt_accels_new_action_shortcut(darktable.gui->accels, a, b, darktable.gui->accels->lighttable_accels, c, d, e, f, FALSE, g)
434#define dt_accels_new_map_action(a, b, c, d, e, f, g) dt_accels_new_action_shortcut(darktable.gui->accels, a, b, darktable.gui->accels->map_accels, c, d, e, f, FALSE, g)
436#define dt_accels_new_print_action(a, b, c, d, e, f, g) dt_accels_new_action_shortcut(darktable.gui->accels, a, b, darktable.gui->accels->print_accels, c, d, e, f, FALSE, g)
438#define dt_accels_new_slideshow_action(a, b, c, d, e, f, g) dt_accels_new_action_shortcut(darktable.gui->accels, a, b, darktable.gui->accels->slideshow_accels, c, d, e, f, FALSE, g)
440#define dt_accels_new_darkroom_locked_action(a, b, c, d, e, f, g) dt_accels_new_action_shortcut(darktable.gui->accels, a, b, darktable.gui->accels->darkroom_accels, c, d, e, f, TRUE, g)
445 gtk_widget_set_halign(label, GTK_ALIGN_FILL);
446 gtk_label_set_xalign (GTK_LABEL(label), 0.5f);
447 gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END);
453 gchar *str_cpy = g_strdup(str);
455 GtkWidget *label = gtk_label_new(str_cpy);
463 gchar *str_cpy = g_strdup(str);
465 GtkWidget *label = gtk_label_new(str_cpy);
467 gtk_widget_set_halign(label, GTK_ALIGN_START);
468 gtk_label_set_xalign (GTK_LABEL(label), 0.0f);
469 gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END);
480 const char *yes_text);
484 const char *no_text,
const char *yes_text);
615 const char *confname,
const char *label,
616 GtkBox *parent, GtkPackType pack);
661 GtkWidget *toplevel = gtk_widget_get_toplevel(widget);
662 if(toplevel && gtk_widget_is_toplevel(toplevel))
return GTK_WINDOW(toplevel);
Handle default and user-set shortcuts (accelerators)
static void error(char *msg)
uint32_t container(dt_lib_module_t *self)
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
GtkWidget * dt_ui_toast_msg(dt_ui_t *ui)
get the toast message widget
gboolean dt_gui_get_scroll_deltas(const GdkEventScroll *event, gdouble *delta_x, gdouble *delta_y)
GtkWidget * dt_ui_center(dt_ui_t *ui)
get the center drawable widget
void dt_gui_gtk_set_source_rgb(cairo_t *cr, dt_gui_color_t)
GtkBox * attach_help_popover(GtkWidget *widget, const char *label)
void dt_gui_menu_popup(GtkMenu *menu, GtkWidget *button, GdkGravity widget_anchor, GdkGravity menu_anchor)
void dt_gui_cairo_set_font_options(cairo_t *cr, GtkWidget *widget)
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_get_scroll_delta(const GdkEventScroll *event, gdouble *delta)
void dt_gui_container_remove_children(GtkContainer *container)
gboolean dt_gui_get_scroll_unit_deltas(const GdkEventScroll *event, int *delta_x, int *delta_y)
static cairo_surface_t * dt_cairo_image_surface_create_from_png(const char *filename)
gboolean dt_gui_get_scroll_unit_delta(const GdkEventScroll *event, int *delta)
void dt_gui_search_stop(GtkSearchEntry *entry, GtkWidget *widget)
void dt_gui_hide_collapsible_section(dt_gui_collapsible_section_t *cs)
void dt_gui_remove_class(GtkWidget *widget, const gchar *class_name)
@ DT_GUI_COLOR_DARKROOM_PREVIEW_BG
@ DT_GUI_COLOR_LIGHTTABLE_FONT
@ DT_GUI_COLOR_MAP_LOC_SHAPE_HIGH
@ DT_GUI_COLOR_BRUSH_CURSOR
@ DT_GUI_COLOR_THUMBNAIL_FONT
@ DT_GUI_COLOR_THUMBNAIL_SELECTED_BG
@ DT_GUI_COLOR_MAP_COUNT_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_DARKROOM_BG
@ DT_GUI_COLOR_THUMBNAIL_BORDER
@ DT_GUI_COLOR_LIGHTTABLE_PREVIEW_BG
@ 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_MAP_LOC_SHAPE_DEF
@ DT_GUI_COLOR_THUMBNAIL_HOVER_FONT
@ DT_GUI_COLOR_THUMBNAIL_HOVER_OUTLINE
struct _gui_collapsible_section_t dt_gui_collapsible_section_t
GtkWidget * dt_ui_resizable_drawing_area(GtkWidget *area, char *config_str, int default_height, int min_height)
Make a self-drawing widget (typically a GtkDrawingArea graph or scope) vertically resizable.
void dt_gui_new_collapsible_section(dt_gui_collapsible_section_t *cs, const char *confname, const char *label, GtkBox *parent, GtkPackType pack)
Create a collapsible section and pack it into the parent box.
GtkWidget * dt_ui_notebook_page(GtkNotebook *notebook, const char *text, const char *tooltip)
GtkNotebook * dt_ui_notebook_new()
static GtkWindow * dt_gtk_get_window(GtkWidget *widget)
static GdkPixbuf * dt_gdk_pixbuf_new_from_file_at_size(const char *filename, int width, int height, GError **error)
static cairo_surface_t * dt_cairo_image_surface_create(cairo_format_t format, int width, int height)
void dt_ui_container_destroy_children(dt_ui_t *ui, const dt_ui_container_t c)
destroy all child widgets from container
char * dt_gui_show_standalone_string_dialog(const char *title, const char *markup, const char *placeholder, const char *no_text, const char *yes_text)
int dt_gui_container_num_children(GtkContainer *container)
int dt_ui_panel_get_size(dt_ui_t *ui, const dt_ui_panel_t p)
get width of right, left, or bottom panel
void dt_gui_draw_rounded_rectangle(cairo_t *cr, float width, float height, float x, float y)
GtkWidget * dt_gui_container_nth_child(GtkContainer *container, int which)
static cairo_surface_t * dt_gdk_cairo_surface_create_from_pixbuf(const GdkPixbuf *pixbuf, int scale, GdkWindow *for_window)
gboolean dt_ui_panel_visible(dt_ui_t *ui, const dt_ui_panel_t)
get visible state of panel
void dt_gui_update_collapsible_section(dt_gui_collapsible_section_t *cs)
gboolean dt_ui_panel_ancestor(dt_ui_t *ui, const dt_ui_panel_t p, GtkWidget *w)
is the panel ancestor of widget
void dt_gui_textview_set_padding(GtkTextView *textview)
Apply the standard recessed-input text padding to a GtkTextView.
void dt_gui_load_theme(const char *theme)
GtkWidget * dt_ui_scroll_wrap_get_scrolled_window(GtkWidget *wrapper)
Return the inner GtkScrolledWindow of a dt_ui_scroll_wrap() wrapper, or NULL.
void dt_capitalize_label(gchar *text)
int dt_gui_gtk_write_config()
void dt_gui_store_last_preset(const char *name)
void dt_ellipsize_combo(GtkComboBox *cbox)
GdkModifierType dt_key_modifier_state()
void dt_configure_ppd_dpi(dt_gui_gtk_t *gui)
void dt_ui_toggle_panels_visibility(dt_ui_t *ui)
toggle view of panels eg. collapse/expands to previous view state
gboolean dt_gui_search_start(GtkWidget *widget, GdkEventKey *event, GtkSearchEntry *entry)
double dt_get_system_gui_ppd(GtkWidget *widget)
void dt_gui_container_destroy_children(GtkContainer *container)
GtkWidget * dt_ui_log_msg(dt_ui_t *ui)
get the log message widget
void dt_gui_add_help_link(GtkWidget *widget, char *link)
void dt_ui_notify_user()
draw user's attention
gboolean dt_gui_show_standalone_yes_no_dialog(const char *title, const char *markup, const char *no_text, const char *yes_text)
GtkWidget * dt_gui_get_popup_relative_widget(GtkWidget *widget, GdkRectangle *rect)
Resolve the widget used as parent for nested popups on Wayland.
void dt_ui_panel_show(dt_ui_t *ui, const dt_ui_panel_t, gboolean show, gboolean write)
shows/hide a panel
int dt_gui_gtk_init(dt_gui_gtk_t *gui)
GtkWidget * dt_ui_main_window(dt_ui_t *ui)
get the main window widget
static GtkWidget * dt_ui_section_label_new(const gchar *str)
gboolean dt_gui_container_has_children(GtkContainer *container)
static int dt_cairo_image_surface_get_width(cairo_surface_t *surface)
void dt_gui_refocus_center()
void dt_gui_gtk_set_source_rgba(cairo_t *cr, dt_gui_color_t, float opacity_coef)
static cairo_surface_t * dt_cairo_image_surface_create_for_data(unsigned char *data, cairo_format_t format, int width, int height, int stride)
void dt_gui_set_pango_resolution(PangoLayout *layout)
GtkBox * attach_popover(GtkWidget *widget, const char *icon, GtkWidget *content)
static void dt_ui_section_label_set(GtkWidget *label)
GtkWidget * dt_ui_scroll_wrap(GtkWidget *w, gint min_size, char *config_str, dt_ui_resize_mode_t mode)
Wrap a scrollable widget in a recessed, vertically resizable scrolled window with a drag handle.
void dt_gui_gtk_run(dt_gui_gtk_t *gui)
GtkWidget * dt_gui_container_first_child(GtkContainer *container)
GtkWidget * dt_ui_center_base(dt_ui_t *ui)
void dt_accels_disconnect_on_text_input(GtkWidget *widget)
Disconnects accels when a text or search entry gets the focus, and reconnects them when it looses it....
void dt_gui_add_class(GtkWidget *widget, const gchar *class_name)
static GtkWidget * dt_ui_label_new(const gchar *str)
static int dt_cairo_image_surface_get_height(cairo_surface_t *surface)
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
void dt_gui_update_em(void)
GtkBox * dt_ui_get_container(dt_ui_t *ui, const dt_ui_container_t c)
struct _GtkWidget GtkWidget
struct dt_gui_gtk_t * gui
gboolean block_normal_pan
cairo_surface_t * surface
struct dt_gui_gtk_t::@47 mouse
GtkMenu * presets_popup_menu
GtkWidget * has_scroll_focus
float effect_radius_clamped
struct dt_gui_gtk_t::@48 export_popup
cairo_filter_t dr_filter_image
struct dt_gui_gtk_t::@49 styles_popup
GtkWidget * scroll_to_header_once
gboolean selection_stacked
cairo_filter_t filter_image
struct dt_gui_gtk_t::@46 pan_edge
GdkRGBA colors[DT_GUI_COLOR_LAST]
A widget to manage and display image thumbnails in Ansel's lighttable and filmstrip views.