Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
gtk.h File Reference
#include "common/darktable.h"
#include "common/dtpthread.h"
#include "dtgtk/thumbtable.h"
#include "gui/window_manager.h"
#include "gui/accelerators.h"
#include <gtk/gtk.h>
#include <stdint.h>
+ Include dependency graph for gtk.h:

Go to the source code of this file.

Data Structures

struct  dt_gui_widgets_t
 
struct  dt_gui_gtk_t
 
struct  _gui_collapsible_section_t
 
struct  dt_gui_widget_auto_height_t
 

Macros

#define DT_GUI_MOUSE_EFFECT_RADIUS   darktable.gui->mouse.effect_radius_clamped
 
#define DT_UI_SCALE_UI(value)   ((value) * darktable.gui->dpi_factor)
 
#define DT_UI_SCALE_DEVICE(value)   ((value) * darktable.gui->dpi_factor * darktable.gui->ppd)
 
#define DT_PIXEL_APPLY_DPI(value)   DT_UI_SCALE_UI(value)
 
#define DT_PIXEL_APPLY_DPI_DPP(value)   DT_UI_SCALE_DEVICE(value)
 
#define DT_GUI_EM_SIZE   ((gint)((!IS_NULL_PTR(darktable.gui) && darktable.gui->em > 0.0) ? darktable.gui->em : 16.0))
 
#define DT_GUI_BOX_SPACING_EM   0.625
 
#define DT_GUI_BOX_SPACING    ((gint)(DT_GUI_EM_SIZE * DT_GUI_BOX_SPACING_EM + 0.5))
 
#define dt_gtk_widget_queue_draw(widget)   gtk_widget_queue_draw(widget)
 
#define dt_gtk_toggle_button_set_active(toggle_button, active)   gtk_toggle_button_set_active(toggle_button, active)
 
#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)
 
#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)
 
#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)
 
#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)
 
#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)
 
#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)
 
#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)
 

Typedefs

typedef struct dt_gui_widgets_t dt_gui_widgets_t
 
typedef enum dt_gui_color_t dt_gui_color_t
 
typedef struct dt_gui_gtk_t dt_gui_gtk_t
 
typedef struct _gui_collapsible_section_t dt_gui_collapsible_section_t
 
typedef enum dt_ui_resize_mode_t dt_ui_resize_mode_t
 
typedef struct dt_gui_widget_auto_height_t dt_gui_widget_auto_height_t
 

Enumerations

enum  {
  TREE_LIST_MIN_ROWS = 3 ,
  TREE_LIST_MAX_ROWS = 11
}
 
enum  dt_gui_color_t {
  DT_GUI_COLOR_BG = 0 ,
  DT_GUI_COLOR_DARKROOM_BG ,
  DT_GUI_COLOR_DARKROOM_PREVIEW_BG ,
  DT_GUI_COLOR_LIGHTTABLE_BG ,
  DT_GUI_COLOR_LIGHTTABLE_PREVIEW_BG ,
  DT_GUI_COLOR_LIGHTTABLE_FONT ,
  DT_GUI_COLOR_PRINT_BG ,
  DT_GUI_COLOR_BRUSH_CURSOR ,
  DT_GUI_COLOR_BRUSH_TRACE ,
  DT_GUI_COLOR_BUTTON_FG ,
  DT_GUI_COLOR_THUMBNAIL_BG ,
  DT_GUI_COLOR_THUMBNAIL_SELECTED_BG ,
  DT_GUI_COLOR_THUMBNAIL_HOVER_BG ,
  DT_GUI_COLOR_THUMBNAIL_OUTLINE ,
  DT_GUI_COLOR_THUMBNAIL_SELECTED_OUTLINE ,
  DT_GUI_COLOR_THUMBNAIL_HOVER_OUTLINE ,
  DT_GUI_COLOR_THUMBNAIL_FONT ,
  DT_GUI_COLOR_THUMBNAIL_SELECTED_FONT ,
  DT_GUI_COLOR_THUMBNAIL_HOVER_FONT ,
  DT_GUI_COLOR_THUMBNAIL_BORDER ,
  DT_GUI_COLOR_THUMBNAIL_SELECTED_BORDER ,
  DT_GUI_COLOR_FILMSTRIP_BG ,
  DT_GUI_COLOR_PREVIEW_HOVER_BORDER ,
  DT_GUI_COLOR_LOG_BG ,
  DT_GUI_COLOR_LOG_FG ,
  DT_GUI_COLOR_MAP_COUNT_SAME_LOC ,
  DT_GUI_COLOR_MAP_COUNT_DIFF_LOC ,
  DT_GUI_COLOR_MAP_COUNT_BG ,
  DT_GUI_COLOR_MAP_LOC_SHAPE_HIGH ,
  DT_GUI_COLOR_MAP_LOC_SHAPE_LOW ,
  DT_GUI_COLOR_MAP_LOC_SHAPE_DEF ,
  DT_GUI_COLOR_LAST
}
 
enum  dt_ui_resize_mode_t {
  DT_UI_RESIZE_DYNAMIC = 0 ,
  DT_UI_RESIZE_STATIC
}
 

Functions

static cairo_surface_t * dt_cairo_image_surface_create (cairo_format_t format, int width, int height)
 
static cairo_surface_t * dt_cairo_image_surface_create_for_data (unsigned char *data, cairo_format_t format, int width, int height, int stride)
 
static cairo_surface_t * dt_cairo_image_surface_create_from_png (const char *filename)
 
static int dt_cairo_image_surface_get_width (cairo_surface_t *surface)
 
static int dt_cairo_image_surface_get_height (cairo_surface_t *surface)
 
static cairo_surface_t * dt_gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf, int scale, GdkWindow *for_window)
 
static GdkPixbuf * dt_gdk_pixbuf_new_from_file_at_size (const char *filename, int width, int height, GError **error)
 
void dt_gui_add_class (GtkWidget *widget, const gchar *class_name)
 
void dt_gui_remove_class (GtkWidget *widget, const gchar *class_name)
 
int dt_gui_gtk_init (dt_gui_gtk_t *gui)
 
void dt_gui_gtk_run (dt_gui_gtk_t *gui)
 
void dt_gui_gtk_quit ()
 
void dt_gui_store_last_preset (const char *name)
 
int dt_gui_gtk_write_config ()
 
void dt_gui_gtk_set_source_rgb (cairo_t *cr, dt_gui_color_t)
 
void dt_gui_gtk_set_source_rgba (cairo_t *cr, dt_gui_color_t, float opacity_coef)
 
double dt_get_system_gui_ppd (GtkWidget *widget)
 
gboolean dt_gui_get_scroll_deltas (const GdkEventScroll *event, gdouble *delta_x, gdouble *delta_y)
 
gboolean dt_gui_get_scroll_unit_deltas (const GdkEventScroll *event, int *delta_x, int *delta_y)
 
gboolean dt_gui_get_scroll_delta (const GdkEventScroll *event, gdouble *delta)
 
gboolean dt_gui_get_scroll_unit_delta (const GdkEventScroll *event, int *delta)
 
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_ui_container_foreach (dt_ui_t *ui, const dt_ui_container_t c, GtkCallback callback)
 calls a callback on all children widgets from container
 
void dt_ui_container_destroy_children (dt_ui_t *ui, const dt_ui_container_t c)
 destroy all child widgets from container
 
void dt_ui_panel_show (dt_ui_t *ui, const dt_ui_panel_t, gboolean show, gboolean write)
 shows/hide a panel
 
void dt_ui_toggle_panels_visibility (dt_ui_t *ui)
 toggle view of panels eg. collapse/expands to previous view state
 
void dt_ui_notify_user ()
 draw user's attention
 
gboolean dt_ui_panel_visible (dt_ui_t *ui, const dt_ui_panel_t)
 get visible state of panel
 
int dt_ui_panel_get_size (dt_ui_t *ui, const dt_ui_panel_t p)
 get width of right, left, or bottom panel
 
gboolean dt_ui_panel_ancestor (dt_ui_t *ui, const dt_ui_panel_t p, GtkWidget *w)
 is the panel ancestor of widget
 
GtkWidgetdt_ui_center (dt_ui_t *ui)
 get the center drawable widget
 
GtkWidgetdt_ui_center_base (dt_ui_t *ui)
 
GtkWidgetdt_ui_main_window (dt_ui_t *ui)
 get the main window widget
 
GtkWidgetdt_ui_log_msg (dt_ui_t *ui)
 get the log message widget
 
GtkWidgetdt_ui_toast_msg (dt_ui_t *ui)
 get the toast message widget
 
GtkBox * dt_ui_get_container (dt_ui_t *ui, const dt_ui_container_t c)
 
void dt_ellipsize_combo (GtkComboBox *cbox)
 
void dt_capitalize_label (gchar *text)
 
static void dt_ui_section_label_set (GtkWidget *label)
 
static GtkWidgetdt_ui_section_label_new (const gchar *str)
 
static GtkWidgetdt_ui_label_new (const gchar *str)
 
GtkNotebook * dt_ui_notebook_new ()
 
GtkWidgetdt_ui_notebook_page (GtkNotebook *notebook, const char *text, const char *tooltip)
 
gboolean dt_gui_show_standalone_yes_no_dialog (const char *title, const char *markup, const char *no_text, const char *yes_text)
 
char * dt_gui_show_standalone_string_dialog (const char *title, const char *markup, const char *placeholder, const char *no_text, const char *yes_text)
 
void dt_gui_add_help_link (GtkWidget *widget, char *link)
 
void dt_gui_load_theme (const char *theme)
 
void dt_configure_ppd_dpi (dt_gui_gtk_t *gui)
 
void dt_gui_update_em (void)
 
void dt_gui_set_pango_resolution (PangoLayout *layout)
 
void dt_gui_cairo_set_font_options (cairo_t *cr, GtkWidget *widget)
 
GdkModifierType dt_key_modifier_state ()
 
GtkWidgetdt_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.
 
GtkWidgetdt_ui_scroll_wrap_get_scrolled_window (GtkWidget *wrapper)
 Return the inner GtkScrolledWindow of a dt_ui_scroll_wrap() wrapper, or NULL.
 
GtkWidgetdt_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_textview_set_padding (GtkTextView *textview)
 Apply the standard recessed-input text padding to a GtkTextView.
 
gboolean dt_gui_container_has_children (GtkContainer *container)
 
int dt_gui_container_num_children (GtkContainer *container)
 
GtkWidgetdt_gui_container_first_child (GtkContainer *container)
 
GtkWidgetdt_gui_container_nth_child (GtkContainer *container, int which)
 
void dt_gui_container_remove_children (GtkContainer *container)
 
void dt_gui_container_destroy_children (GtkContainer *container)
 
void dt_gui_menu_popup (GtkMenu *menu, GtkWidget *button, GdkGravity widget_anchor, GdkGravity menu_anchor)
 
GtkWidgetdt_gui_get_popup_relative_widget (GtkWidget *widget, GdkRectangle *rect)
 Resolve the widget used as parent for nested popups on Wayland.
 
void dt_gui_draw_rounded_rectangle (cairo_t *cr, float width, float height, float x, float y)
 
gboolean dt_gui_search_start (GtkWidget *widget, GdkEventKey *event, GtkSearchEntry *entry)
 
void dt_gui_search_stop (GtkSearchEntry *entry, GtkWidget *widget)
 
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.
 
void dt_gui_update_collapsible_section (dt_gui_collapsible_section_t *cs)
 
void dt_gui_hide_collapsible_section (dt_gui_collapsible_section_t *cs)
 
GtkBox * attach_popover (GtkWidget *widget, const char *icon, GtkWidget *content)
 
GtkBox * attach_help_popover (GtkWidget *widget, const char *label)
 
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. This helps dealing with one-key shortcuts.
 
static GtkWindow * dt_gtk_get_window (GtkWidget *widget)
 
void dt_gui_refocus_center ()
 

Macro Definition Documentation

◆ dt_accels_new_darkroom_action

#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)

Definition at line 430 of file gtk.h.

◆ dt_accels_new_darkroom_locked_action

#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)

Definition at line 440 of file gtk.h.

◆ dt_accels_new_global_action

#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)

Definition at line 428 of file gtk.h.

◆ dt_accels_new_lighttable_action

#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)

Definition at line 432 of file gtk.h.

◆ dt_accels_new_map_action

#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)

Definition at line 434 of file gtk.h.

◆ dt_accels_new_print_action

#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)

Definition at line 436 of file gtk.h.

◆ dt_accels_new_slideshow_action

#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)

Definition at line 438 of file gtk.h.

◆ dt_gtk_toggle_button_set_active

#define dt_gtk_toggle_button_set_active (   toggle_button,
  active 
)    gtk_toggle_button_set_active(toggle_button, active)

Definition at line 312 of file gtk.h.

◆ dt_gtk_widget_queue_draw

#define dt_gtk_widget_queue_draw (   widget)    gtk_widget_queue_draw(widget)

Definition at line 311 of file gtk.h.

◆ DT_GUI_BOX_SPACING

#define DT_GUI_BOX_SPACING    ((gint)(DT_GUI_EM_SIZE * DT_GUI_BOX_SPACING_EM + 0.5))

Definition at line 109 of file gtk.h.

◆ DT_GUI_BOX_SPACING_EM

#define DT_GUI_BOX_SPACING_EM   0.625

Definition at line 108 of file gtk.h.

◆ DT_GUI_EM_SIZE

#define DT_GUI_EM_SIZE   ((gint)((!IS_NULL_PTR(darktable.gui) && darktable.gui->em > 0.0) ? darktable.gui->em : 16.0))

Definition at line 107 of file gtk.h.

◆ DT_GUI_MOUSE_EFFECT_RADIUS

#define DT_GUI_MOUSE_EFFECT_RADIUS   darktable.gui->mouse.effect_radius_clamped

Definition at line 70 of file gtk.h.

◆ DT_PIXEL_APPLY_DPI

#define DT_PIXEL_APPLY_DPI (   value)    DT_UI_SCALE_UI(value)

Definition at line 90 of file gtk.h.

◆ DT_PIXEL_APPLY_DPI_DPP

#define DT_PIXEL_APPLY_DPI_DPP (   value)    DT_UI_SCALE_DEVICE(value)

Definition at line 91 of file gtk.h.

◆ DT_UI_SCALE_DEVICE

#define DT_UI_SCALE_DEVICE (   value)    ((value) * darktable.gui->dpi_factor * darktable.gui->ppd)

Definition at line 86 of file gtk.h.

◆ DT_UI_SCALE_UI

#define DT_UI_SCALE_UI (   value)    ((value) * darktable.gui->dpi_factor)

Definition at line 85 of file gtk.h.

Typedef Documentation

◆ dt_gui_collapsible_section_t

◆ dt_gui_color_t

◆ dt_gui_gtk_t

typedef struct dt_gui_gtk_t dt_gui_gtk_t

◆ dt_gui_widget_auto_height_t

◆ dt_gui_widgets_t

◆ dt_ui_resize_mode_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TREE_LIST_MIN_ROWS 
TREE_LIST_MAX_ROWS 

Definition at line 112 of file gtk.h.

◆ dt_gui_color_t

Enumerator
DT_GUI_COLOR_BG 
DT_GUI_COLOR_DARKROOM_BG 
DT_GUI_COLOR_DARKROOM_PREVIEW_BG 
DT_GUI_COLOR_LIGHTTABLE_BG 
DT_GUI_COLOR_LIGHTTABLE_PREVIEW_BG 
DT_GUI_COLOR_LIGHTTABLE_FONT 
DT_GUI_COLOR_PRINT_BG 
DT_GUI_COLOR_BRUSH_CURSOR 
DT_GUI_COLOR_BRUSH_TRACE 
DT_GUI_COLOR_BUTTON_FG 
DT_GUI_COLOR_THUMBNAIL_BG 
DT_GUI_COLOR_THUMBNAIL_SELECTED_BG 
DT_GUI_COLOR_THUMBNAIL_HOVER_BG 
DT_GUI_COLOR_THUMBNAIL_OUTLINE 
DT_GUI_COLOR_THUMBNAIL_SELECTED_OUTLINE 
DT_GUI_COLOR_THUMBNAIL_HOVER_OUTLINE 
DT_GUI_COLOR_THUMBNAIL_FONT 
DT_GUI_COLOR_THUMBNAIL_SELECTED_FONT 
DT_GUI_COLOR_THUMBNAIL_HOVER_FONT 
DT_GUI_COLOR_THUMBNAIL_BORDER 
DT_GUI_COLOR_THUMBNAIL_SELECTED_BORDER 
DT_GUI_COLOR_FILMSTRIP_BG 
DT_GUI_COLOR_PREVIEW_HOVER_BORDER 
DT_GUI_COLOR_LOG_BG 
DT_GUI_COLOR_LOG_FG 
DT_GUI_COLOR_MAP_COUNT_SAME_LOC 
DT_GUI_COLOR_MAP_COUNT_DIFF_LOC 
DT_GUI_COLOR_MAP_COUNT_BG 
DT_GUI_COLOR_MAP_LOC_SHAPE_HIGH 
DT_GUI_COLOR_MAP_LOC_SHAPE_LOW 
DT_GUI_COLOR_MAP_LOC_SHAPE_DEF 
DT_GUI_COLOR_LAST 

Definition at line 125 of file gtk.h.

◆ dt_ui_resize_mode_t

Enumerator
DT_UI_RESIZE_DYNAMIC 
DT_UI_RESIZE_STATIC 

Definition at line 256 of file gtk.h.

Function Documentation

◆ attach_help_popover()

GtkBox * attach_help_popover ( GtkWidget widget,
const char *  label 
)

Add an help button triggering a popover label next to an arbitrary widget, to document its action. This is a better take at help tooltips that most people don't see, unless they know about them. Also tooltips window positionning is wonky (can easily overflow viewport), line breaks are added manually (ugly hack), and they appear and disappear on hover (not available on touch screens), so it's flimsy UI.

Parameters
widgetthe original widget to document. DON'T add it to a container.
labelthe in-app "docstring" for the widget
Returns
the GtkBox containing both the original widget and its popover button. That's what you will need to add it to your container.

Definition at line 3194 of file gtk.c.

References attach_popover(), and TRUE.

Referenced by gui_init().

◆ attach_popover()

GtkBox * attach_popover ( GtkWidget widget,
const char *  icon,
GtkWidget content 
)

Add an arbitrary button next to the widget that opens a popover with arbitrary content.

Parameters
widgetthe original widget next to which the popover button will be added. DON'T add it to a container.
iconthe Freedesktop icon name to put in the button
contentthe widget that will fit inside the popover
Returns
the GtkBox containing both the original widget and its popover button. That's what you will need to add it to your container.

Definition at line 3164 of file gtk.c.

References _popover_set_relative_to_topmost_parent(), DT_GUI_BOX_SPACING, DT_PIXEL_APPLY_DPI, and FALSE.

Referenced by attach_help_popover(), and gui_init().

◆ dt_accels_disconnect_on_text_input()

◆ dt_cairo_image_surface_create()

◆ dt_cairo_image_surface_create_for_data()

static cairo_surface_t * dt_cairo_image_surface_create_for_data ( unsigned char *  data,
cairo_format_t  format,
int  width,
int  height,
int  stride 
)
inlinestatic

Definition at line 322 of file gtk.h.

References darktable, darktable_t::gui, height, dt_gui_gtk_t::ppd, and width.

Referenced by _util_get_svg_img().

◆ dt_cairo_image_surface_create_from_png()

static cairo_surface_t * dt_cairo_image_surface_create_from_png ( const char *  filename)
inlinestatic

Definition at line 328 of file gtk.h.

References darktable, darktable_t::gui, and dt_gui_gtk_t::ppd.

◆ dt_cairo_image_surface_get_height()

static int dt_cairo_image_surface_get_height ( cairo_surface_t *  surface)
inlinestatic

Definition at line 338 of file gtk.h.

References darktable, darktable_t::gui, and dt_gui_gtk_t::ppd.

Referenced by _render_preview_surface(), and dt_control_expose().

◆ dt_cairo_image_surface_get_width()

static int dt_cairo_image_surface_get_width ( cairo_surface_t *  surface)
inlinestatic

Definition at line 334 of file gtk.h.

References darktable, darktable_t::gui, and dt_gui_gtk_t::ppd.

Referenced by _render_preview_surface(), and dt_control_expose().

◆ dt_capitalize_label()

◆ dt_configure_ppd_dpi()

◆ dt_ellipsize_combo()

void dt_ellipsize_combo ( GtkComboBox *  cbox)

Definition at line 1814 of file gtk.c.

◆ dt_gdk_cairo_surface_create_from_pixbuf()

static cairo_surface_t * dt_gdk_cairo_surface_create_from_pixbuf ( const GdkPixbuf *  pixbuf,
int  scale,
GdkWindow *  for_window 
)
inlinestatic

Definition at line 342 of file gtk.h.

References darktable, darktable_t::gui, and dt_gui_gtk_t::ppd.

◆ dt_gdk_pixbuf_new_from_file_at_size()

static GdkPixbuf * dt_gdk_pixbuf_new_from_file_at_size ( const char *  filename,
int  width,
int  height,
GError **  error 
)
inlinestatic

Definition at line 348 of file gtk.h.

References darktable, error(), darktable_t::gui, height, dt_gui_gtk_t::ppd, and width.

◆ dt_get_system_gui_ppd()

double dt_get_system_gui_ppd ( GtkWidget widget)

Definition at line 1331 of file gtk.c.

References DT_DEBUG_CONTROL, dt_osx_get_ppd(), and dt_print().

Referenced by dt_configure_ppd_dpi().

◆ dt_gtk_get_window()

static GtkWindow * dt_gtk_get_window ( GtkWidget widget)
inlinestatic

Definition at line 658 of file gtk.h.

References IS_NULL_PTR.

◆ dt_gui_add_class()

void dt_gui_add_class ( GtkWidget widget,
const gchar *  class_name 
)

Definition at line 133 of file gtk.c.

Referenced by _add_sample(), _add_tag_button_clicked(), _attach_grid_separator(), _bauhaus_widget_init(), _blendif_options_callback(), _collapsible_set_states(), _darkroom_autoset_button_set_running(), _darkroom_autoset_popover_rebuild(), _discarded_files_popup(), _ensure_page_widgets(), _gui_presets_popup_menu_show_internal(), _gui_set_single_expanded(), _gui_styles_dialog_run(), _hm_show_merge_report_popup(), _init_widgets(), _insert_subsection_sep(), _iop_dim_all_but(), _iop_tooltip_callback(), _ioporder_create_endpoint_node(), _ioporder_create_graph_node(), _lib_backgroundjobs_added(), _menuitem_preferences(), _modulegroups_drag_begin(), _modulegroups_drag_motion(), _mouse_over_image_callback(), _set_widget_dimmed(), _thumb_update_rating_class(), add_generic_top_menu_entry(), ask_and_delete(), dt_accels_search(), dt_accels_window(), dt_bauhaus_combobox_from_widget(), dt_bauhaus_slider_from_widget(), dt_control_crawler_show_image_list(), dt_gui_gtk_quit(), dt_gui_hist_dialog_new(), dt_gui_new_collapsible_section(), dt_guides_popover(), dt_iop_gui_init_blendif(), dt_iop_gui_init_masks(), dt_iop_gui_init_raster(), dt_iop_gui_set_enable_button(), dt_iop_gui_set_expander(), dt_iop_request_focus(), dt_lib_export_metadata_configuration_dialog(), dt_lib_gui_get_expander(), dt_lib_gui_set_expanded(), dt_lib_presets_popup_menu_show(), dt_thumbnail_create_widget(), dt_thumbnail_set_group_border(), dt_thumbtable_new(), dt_thumbtable_set_overlays_mode(), dt_ui_init_global_menu(), dt_ui_scroll_wrap(), dt_ui_section_label_set(), dtgtk_button_new(), dtgtk_gradient_slider_multivalue_new(), dtgtk_gradient_slider_multivalue_new_with_color(), dtgtk_gradient_slider_new(), dtgtk_gradient_slider_new_with_color(), dtgtk_thumbnail_btn_new(), dtgtk_togglebutton_new(), gui_init(), gui_init(), gui_init(), gui_init(), init_tab_general(), init_tab_presets(), and update_entry().

◆ dt_gui_add_help_link()

◆ dt_gui_cairo_set_font_options()

void dt_gui_cairo_set_font_options ( cairo_t *  cr,
GtkWidget widget 
)

◆ dt_gui_container_destroy_children()

void dt_gui_container_destroy_children ( GtkContainer *  container)

◆ dt_gui_container_first_child()

GtkWidget * dt_gui_container_first_child ( GtkContainer *  container)

Definition at line 2882 of file gtk.c.

References container().

Referenced by _get_container_row_heigth(), and gui_init().

◆ dt_gui_container_has_children()

gboolean dt_gui_container_has_children ( GtkContainer *  container)

Definition at line 2862 of file gtk.c.

References container(), FALSE, and IS_NULL_PTR.

Referenced by _destroyed_gui_thread().

◆ dt_gui_container_nth_child()

GtkWidget * dt_gui_container_nth_child ( GtkContainer *  container,
int  which 
)

Definition at line 2892 of file gtk.c.

References container().

Referenced by _iop_panel_label().

◆ dt_gui_container_num_children()

int dt_gui_container_num_children ( GtkContainer *  container)

Definition at line 2872 of file gtk.c.

References container(), and FALSE.

◆ dt_gui_container_remove_children()

void dt_gui_container_remove_children ( GtkContainer *  container)

Definition at line 2907 of file gtk.c.

References _remove_child(), and container().

Referenced by _on_storage_list_changed().

◆ dt_gui_draw_rounded_rectangle()

void dt_gui_draw_rounded_rectangle ( cairo_t *  cr,
float  width,
float  height,
float  x,
float  y 
)

Definition at line 2992 of file gtk.c.

References height, M_PI, width, and x.

Referenced by gui_draw_sym(), gui_post_expose(), and gui_post_expose().

◆ dt_gui_get_popup_relative_widget()

GtkWidget * dt_gui_get_popup_relative_widget ( GtkWidget widget,
GdkRectangle *  rect 
)

Resolve the widget used as parent for nested popups on Wayland.

Gtk on Wayland requires popups to use the top-most enclosing popup as parent. This helper walks the parent chain to find that anchor while keeping the caller in charge of the popup logic. When rect is not NULL, it returns the position and size of widget in the coordinate system of the returned anchor.

Parameters
widgetthe widget the popup should visually point to.
rectoptional output rectangle receiving the geometry of widget.
Returns
the widget to use as popup parent, or NULL when widget is NULL.

Definition at line 2925 of file gtk.c.

References IS_NULL_PTR, MAX, rect::width, rect::x, and rect::y.

Referenced by _completion_update(), _popover_set_relative_to_topmost_parent(), _setup_completion(), _toolbar_show_popup(), and dt_gui_menu_popup().

◆ dt_gui_get_scroll_delta()

gboolean dt_gui_get_scroll_delta ( const GdkEventScroll *  event,
gdouble *  delta 
)

Definition at line 302 of file gtk.c.

References delta, dt_gui_get_scroll_deltas(), FALSE, and TRUE.

Referenced by _area_scrolled_callback(), _scrolled(), and _scrolled().

◆ dt_gui_get_scroll_deltas()

gboolean dt_gui_get_scroll_deltas ( const GdkEventScroll *  event,
gdouble *  delta_x,
gdouble *  delta_y 
)

Definition at line 159 of file gtk.c.

References dt_conf_get_bool(), FALSE, and TRUE.

Referenced by dt_gui_get_scroll_delta().

◆ dt_gui_get_scroll_unit_delta()

gboolean dt_gui_get_scroll_unit_delta ( const GdkEventScroll *  event,
int *  delta 
)

◆ dt_gui_get_scroll_unit_deltas()

◆ dt_gui_gtk_init()

◆ dt_gui_gtk_quit()

◆ dt_gui_gtk_run()

◆ dt_gui_gtk_set_source_rgb()

void dt_gui_gtk_set_source_rgb ( cairo_t *  cr,
dt_gui_color_t  color 
)

◆ dt_gui_gtk_set_source_rgba()

void dt_gui_gtk_set_source_rgba ( cairo_t *  cr,
dt_gui_color_t  color,
float  opacity_coef 
)

Definition at line 448 of file gtk.c.

References dt_gui_gtk_t::colors, darktable, and darktable_t::gui.

Referenced by _brush_events_post_expose(), and dt_draw_get_pixbuf_from_cairo().

◆ dt_gui_gtk_write_config()

◆ dt_gui_hide_collapsible_section()

void dt_gui_hide_collapsible_section ( dt_gui_collapsible_section_t cs)

◆ dt_gui_load_theme()

◆ dt_gui_menu_popup()

◆ dt_gui_new_collapsible_section()

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.

The pack argument makes the insertion side explicit so callers control layout order without reordering children later.

Parameters
cssection storage owned by the caller.
confnameconfiguration key used to persist the expanded state.
labelUI label for the section header.
parentGtkBox that receives the section.
packeither GTK_PACK_START or GTK_PACK_END to choose insertion side.

Definition at line 3102 of file gtk.c.

References _coeffs_button_changed(), _coeffs_expander_click(), _collapsible_container_show(), _gui_collapsible_section_t::confname, _gui_collapsible_section_t::container, CPF_DIRECTION_DOWN, CPF_DIRECTION_LEFT, dt_conf_get_bool(), dt_gui_add_class(), DT_GUI_BOX_SPACING, dt_ui_section_label_new(), dtgtk_cairo_paint_solid_arrow(), DTGTK_EXPANDER, dtgtk_expander_new(), dtgtk_expander_set_expanded(), dtgtk_togglebutton_new(), _gui_collapsible_section_t::expander, FALSE, _gui_collapsible_section_t::label, _gui_collapsible_section_t::parent, _gui_collapsible_section_t::toggle, and TRUE.

Referenced by dt_iop_gui_init_masks(), and gui_init().

◆ dt_gui_refocus_center()

◆ dt_gui_remove_class()

◆ dt_gui_search_start()

gboolean dt_gui_search_start ( GtkWidget widget,
GdkEventKey *  event,
GtkSearchEntry *  entry 
)

Definition at line 3005 of file gtk.c.

References FALSE, and TRUE.

Referenced by init_tab_presets().

◆ dt_gui_search_stop()

void dt_gui_search_stop ( GtkSearchEntry *  entry,
GtkWidget widget 
)

Definition at line 3016 of file gtk.c.

Referenced by init_tab_presets().

◆ dt_gui_set_pango_resolution()

void dt_gui_set_pango_resolution ( PangoLayout *  layout)

◆ dt_gui_show_standalone_string_dialog()

char * dt_gui_show_standalone_string_dialog ( const char *  title,
const char *  markup,
const char *  placeholder,
const char *  no_text,
const char *  yes_text 
)

◆ dt_gui_show_standalone_yes_no_dialog()

gboolean dt_gui_show_standalone_yes_no_dialog ( const char *  title,
const char *  markup,
const char *  no_text,
const char *  yes_text 
)

◆ dt_gui_store_last_preset()

void dt_gui_store_last_preset ( const char *  name)

◆ dt_gui_textview_set_padding()

void dt_gui_textview_set_padding ( GtkTextView *  textview)

Apply the standard recessed-input text padding to a GtkTextView.

CSS padding on the textview "text" node is parsed but ignored for layout in GTK3, so the 2px/4px inset matching entry/treeview (see data/themes/.css) has to be set on the widget itself.

Parameters
textviewThe GtkTextView to update.

Definition at line 2687 of file gtk.c.

References DT_PIXEL_APPLY_DPI.

Referenced by _active_modules_popup(), _pop_menu_dictionary_create_tag(), _pop_menu_dictionary_edit_tag(), gui_init(), and init_tab_general().

◆ dt_gui_update_collapsible_section()

◆ dt_gui_update_em()

◆ dt_key_modifier_state()

GdkModifierType dt_key_modifier_state ( )
Todo:
double check correct way of doing this (merge conflict with Input System NG 20210319) GdkKeymap *keymap = gdk_keymap_get_for_display(gdk_display_get_default()); return gdk_keymap_get_modifier_state(keymap) & gdk_keymap_get_modifier_mask(keymap, GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK);

Definition at line 2186 of file gtk.c.

References darktable, dt_ui_main_window(), darktable_t::gui, state, and dt_gui_gtk_t::ui.

Referenced by _color_picker_callback_button_press(), and color_picker_apply().

◆ dt_ui_center()

◆ dt_ui_center_base()

GtkWidget * dt_ui_center_base ( dt_ui_t ui)

Definition at line 118 of file window_manager.c.

References dt_ui_t::center_base.

Referenced by _control_apply_cursor(), _ui_toast_redraw_callback(), enter(), and leave().

◆ dt_ui_container_destroy_children()

void dt_ui_container_destroy_children ( dt_ui_t ui,
const dt_ui_container_t  c 
)

destroy all child widgets from container

Definition at line 1739 of file gtk.c.

References dt_ui_t::containers, and dt_gui_container_destroy_children().

Referenced by dt_view_manager_switch_by_view().

◆ dt_ui_container_focus_widget()

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

Definition at line 1723 of file gtk.c.

References dt_ui_t::containers.

Referenced by _gui_set_single_expanded().

◆ dt_ui_container_foreach()

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

Definition at line 1733 of file gtk.c.

References dt_ui_t::containers.

Referenced by dt_view_manager_switch_by_view().

◆ dt_ui_get_container()

GtkBox * dt_ui_get_container ( dt_ui_t ui,
const dt_ui_container_t  c 
)

Definition at line 137 of file window_manager.c.

References dt_ui_t::containers.

Referenced by _ensure_page_widgets(), and gui_cleanup().

◆ dt_ui_label_new()

◆ dt_ui_log_msg()

GtkWidget * dt_ui_log_msg ( dt_ui_t ui)

get the log message widget

Definition at line 123 of file window_manager.c.

References dt_ui_t::log_msg.

Referenced by _init_widgets().

◆ dt_ui_main_window()

GtkWidget * dt_ui_main_window ( dt_ui_t ui)

get the main window widget

Definition at line 132 of file window_manager.c.

References dt_ui_t::main_window.

Referenced by _act_folders_relocate(), _apply_rename_path(), _ask_before_delete_style(), _ask_text(), _blendop_masks_confirm_delete(), _choose_gpx_callback(), _confirm(), _confirm_delete_layer(), _control_apply_cursor(), _datetime_key_pressed(), _delete_tagids(), _discarded_files_popup(), _dt_delete_dialog_main_thread(), _edit_preset(), _enter_key_pressed(), _export_button_clicked(), _export_button_clicked(), _gui_styles_dialog_run(), _gui_styles_edit_style_response(), _gui_styles_new_style_response(), _hm_ask_user_constraints_choice(), _hm_show_merge_report_popup(), _hm_show_toposort_cycle_popup(), _hm_warn_missing_raster_producers(), _import_button_clicked(), _init_widgets(), _ioporder_add_preset(), _ioporder_init_popup(), _ioporder_rebuild_graph(), _key_pressed(), _lib_tagging_tag_key_press(), _lib_tagging_tag_show_accel(), _main_do_event_help(), _menuitem_delete_preset(), _menuitem_preferences(), _menuitem_update_preset(), _open_uri(), _pop_menu_dictionary_change_path(), _pop_menu_dictionary_create_tag(), _pop_menu_dictionary_delete_node(), _pop_menu_dictionary_edit_tag(), _preview_gpx_file(), _prompt_layer_name_dialog(), _resizable_scroll_max_height(), _save_clut_callback(), _save_layer_clicked(), _scope_resize_handle_resize(), _show_drawlayer_modal_message(), _show_drawlayer_wait_dialog(), _styles_open_popup_callback(), _switch_preview_cursor(), _timezone_key_pressed(), _timezone_save(), ask_and_delete(), button_clicked(), button_clicked(), button_clicked(), dt_bauhaus_init(), dt_bauhaus_load_theme(), dt_bauhaus_show_popup(), dt_cleanup(), dt_control_copy_images(), dt_control_crawler_show_image_list(), dt_control_delete_image(), dt_control_delete_images(), dt_control_move_images(), dt_control_remove_images(), dt_gui_gtk_init(), dt_gui_gtk_quit(), dt_gui_gtk_write_config(), dt_gui_hist_dialog_new(), dt_gui_load_theme(), dt_gui_merge_options_dialog(), dt_gui_preferences_show(), dt_gui_refocus_center(), dt_gui_show_standalone_string_dialog(), dt_gui_show_standalone_yes_no_dialog(), dt_key_modifier_state(), dt_lib_export_metadata_configuration_dialog(), dt_masks_gui_confirm_delete_form_dialog(), dt_preview_window_spawn(), dt_ui_notify_user(), dt_view_manager_button_pressed(), dt_view_manager_switch_by_view(), edit_preset(), ensure_focus_idle(), enter(), export_clicked(), export_files_callback(), full_screen_callback(), full_screen_checked_callback(), get_stamp_params(), global_progress_end(), global_progress_set(), global_progress_start(), gui_init(), gui_init(), gui_reset(), import_clicked(), load_xmp_callback(), menuitem_delete_preset(), menuitem_update_preset(), open_chat_callback(), open_doc_callback(), open_forum_callback(), open_search_callback(), search_accels_callback(), shortcuts_callback(), and show_about_dialog().

◆ dt_ui_notebook_new()

GtkNotebook * dt_ui_notebook_new ( )

Definition at line 2254 of file gtk.c.

Referenced by gui_init(), gui_init(), and gui_init().

◆ dt_ui_notebook_page()

GtkWidget * dt_ui_notebook_page ( GtkNotebook *  notebook,
const char *  text,
const char *  tooltip 
)

◆ dt_ui_notify_user()

void dt_ui_notify_user ( )

draw user's attention

Definition at line 1744 of file gtk.c.

References darktable, dt_ui_main_window(), darktable_t::gui, TRUE, and dt_gui_gtk_t::ui.

Referenced by _pathlist_import_run(), dt_control_export_job_run(), and dt_film_import1_run().

◆ dt_ui_panel_ancestor()

gboolean dt_ui_panel_ancestor ( dt_ui_t ui,
const dt_ui_panel_t  p,
GtkWidget w 
)

is the panel ancestor of widget

Definition at line 108 of file window_manager.c.

References FALSE, p, and dt_ui_t::panels.

Referenced by _get_preferred_width().

◆ dt_ui_panel_get_size()

int dt_ui_panel_get_size ( dt_ui_t ui,
const dt_ui_panel_t  p 
)

◆ dt_ui_panel_show()

◆ dt_ui_panel_visible()

gboolean dt_ui_panel_visible ( dt_ui_t ui,
const dt_ui_panel_t  p 
)

◆ dt_ui_resizable_drawing_area()

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.

The widget is given a fixed height-request (persisted under config_str) and a drag grip floating on its bottom edge — the same grip used by panels, scroll wrappers and the histogram scope. The content is not scrolled: it keeps drawing to its live allocation, only the height-request changes. Returns a wrapper overlay to pack in place of area.

Parameters
areathe drawing widget (its callbacks/refs stay valid; pack the returned overlay instead).
config_strconf key persisting the user-chosen height (copied internally).
default_heightdefault height in device-independent px (rescaled by DT_PIXEL_APPLY_DPI).
min_heightminimum height floor in device-independent px.

Definition at line 2836 of file gtk.c.

References _resizable_area_free(), _resizable_area_get_size(), _resizable_area_resize(), _resizable_scroll_max_height(), dt_bauhaus_resize_handle_new(), dt_conf_get_int(), dt_conf_key_exists(), DT_PIXEL_APPLY_DPI, DT_UI_RESIZABLE_AREA_KEY, FALSE, height, MAX, and state.

Referenced by gui_init(), gui_init(), and gui_init().

◆ dt_ui_scroll_wrap()

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.

Compatible with GtkTreeView, GtkTextView and any other content widget. A drag grip floats on the scrolled window's bottom edge (invisible until hovered); the chosen height is persisted under config_str. Returns the wrapper overlay, not the scrolled window.

Parameters
wcontent widget.
min_sizeminimum height floor, in device-independent pixels (rescaled by DT_PIXEL_APPLY_DPI). In DT_UI_RESIZE_STATIC mode it also serves as the default height before the user drags.
config_strconf key persisting the user-chosen height (copied internally).
modeDT_UI_RESIZE_DYNAMIC to auto-fit content, or DT_UI_RESIZE_STATIC to keep a fixed height regardless of content (avoids layout shifts for hover-/selection-driven widgets).

Wrap a scrollable widget in a recessed, vertically resizable scrolled window with a drag handle.

Returns an overlay wrapping the scrolled window, with a themed drag grip floating on its bottom edge (the same grip primitive used by panels and the histogram scope). The grip takes no layout space and is invisible until hovered. Sizing follows mode: DT_UI_RESIZE_DYNAMIC auto-fits the content up to the user height, DT_UI_RESIZE_STATIC keeps a fixed height (see _resizable_scroll_apply).

The returned widget is the wrapper overlay, not the scrolled window; callers needing the inner scrolled window (e.g. to tweak its scroll policy) must use dt_ui_scroll_wrap_get_scrolled_window().

Parameters
wcontent widget (treeview, textview or any container)
min_sizeminimum height floor in device pixels (also the static default before the user drags)
config_strconf key persisting the user-chosen height (copied internally)
modeDT_UI_RESIZE_DYNAMIC (auto-fit) or DT_UI_RESIZE_STATIC (fixed height)

Definition at line 2713 of file gtk.c.

References _resizable_scroll_draw(), _resizable_scroll_handle_get_size(), _resizable_scroll_handle_resize(), _resizable_scroll_realize(), _widget_auto_connect_buffer(), _widget_auto_connect_model(), _widget_auto_height_free(), _widget_auto_on_buffer_changed(), _widget_auto_on_model_changed(), _widget_auto_update(), dt_bauhaus_resize_handle_new(), dt_gui_add_class(), DT_GUI_WIDGET_AUTO_HEIGHT_KEY, DT_PIXEL_APPLY_DPI, DT_UI_RESIZE_DYNAMIC, FALSE, MAX, and state.

Referenced by dt_iop_gui_init_masks(), and gui_init().

◆ dt_ui_scroll_wrap_get_scrolled_window()

GtkWidget * dt_ui_scroll_wrap_get_scrolled_window ( GtkWidget wrapper)

Return the inner GtkScrolledWindow of a dt_ui_scroll_wrap() wrapper, or NULL.

Return the inner GtkScrolledWindow of a dt_ui_scroll_wrap() wrapper, or NULL.

Definition at line 2775 of file gtk.c.

Referenced by gui_init().

◆ dt_ui_section_label_new()

◆ dt_ui_section_label_set()

static void dt_ui_section_label_set ( GtkWidget label)
inlinestatic

Definition at line 443 of file gtk.h.

References dt_gui_add_class().

Referenced by dt_ui_section_label_new().

◆ dt_ui_toast_msg()

GtkWidget * dt_ui_toast_msg ( dt_ui_t ui)

get the toast message widget

Definition at line 127 of file window_manager.c.

References dt_ui_t::toast_msg.

Referenced by _init_widgets().

◆ dt_ui_toggle_panels_visibility()

void dt_ui_toggle_panels_visibility ( dt_ui_t ui)

toggle view of panels eg. collapse/expands to previous view state

Definition at line 112 of file display.c.

References dt_conf_get_int(), dt_conf_set_int(), dt_free, dt_ui_restore_panels(), key, panels_get_view_path(), and state.

Referenced by _toggle_side_borders_accel_callback().