Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
gtk.c File Reference
#include "common/darktable.h"
#include "common/collection.h"
#include "common/colorspaces.h"
#include "common/l10n.h"
#include "common/file_location.h"
#include "common/ratings.h"
#include "common/image.h"
#include "common/image_cache.h"
#include "gui/guides.h"
#include "bauhaus/bauhaus.h"
#include "develop/develop.h"
#include "develop/imageop.h"
#include "dtgtk/button.h"
#include "dtgtk/expander.h"
#include "dtgtk/sidepanel.h"
#include "gui/gtk.h"
#include "gui/splash.h"
#include "common/styles.h"
#include "control/conf.h"
#include "control/control.h"
#include "control/jobs.h"
#include "control/signal.h"
#include "gui/presets.h"
#include "views/view.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
+ Include dependency graph for gtk.c:

Data Structures

struct  dt_tablet_motion_state_t
 
struct  result_t
 

Typedefs

typedef struct dt_tablet_motion_state_t dt_tablet_motion_state_t
 
typedef struct result_t result_t
 

Functions

static void _ui_widget_redraw_callback (gpointer instance, GtkWidget *widget)
 
static void _ui_log_redraw_callback (gpointer instance, GtkWidget *widget)
 
static void _ui_toast_redraw_callback (gpointer instance, GtkWidget *widget)
 
void dt_gui_add_class (GtkWidget *widget, const gchar *class_name)
 
void dt_gui_remove_class (GtkWidget *widget, const gchar *class_name)
 
static void _init_widgets (dt_gui_gtk_t *gui)
 
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)
 
static gboolean _draw (GtkWidget *da, cairo_t *cr, gpointer user_data)
 
static gboolean _scrolled (GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
 
int dt_gui_gtk_write_config ()
 
void dt_gui_gtk_set_source_rgb (cairo_t *cr, dt_gui_color_t color)
 
void dt_gui_gtk_set_source_rgba (cairo_t *cr, dt_gui_color_t color, float opacity_coef)
 
void dt_gui_gtk_quit ()
 
gboolean dt_gui_quit_callback (GtkWidget *widget, GdkEvent *event, gpointer user_data)
 
void dt_gui_store_last_preset (const char *name)
 
static gboolean _configure (GtkWidget *da, GdkEventConfigure *event, gpointer user_data)
 
static gboolean _window_configure (GtkWidget *da, GdkEvent *event, gpointer user_data)
 
static double _clamp01d (const double value)
 
static const gdouble * _event_axes (const GdkEvent *event)
 
static gboolean _get_axis_value_for_source (const GdkEvent *event, GdkDevice *source_device, const GdkAxisUse axis, double *value, gboolean *from_source_map)
 
static gboolean _sample_axis_from_device_state (GdkWindow *window, GdkDevice *device, const GdkAxisUse axis, double *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 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)
 
static gboolean _button_pressed (GtkWidget *w, GdkEventButton *event, gpointer user_data)
 
static gboolean _button_released (GtkWidget *w, GdkEventButton *event, gpointer user_data)
 
static gboolean _mouse_moved (GtkWidget *w, GdkEventMotion *event, gpointer user_data)
 
static gboolean _key_pressed (GtkWidget *w, GdkEventKey *event)
 
static gboolean _center_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
 
static gboolean _center_enter (GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
 
static const char * _get_source_name (int pos)
 
static const char * _get_mode_name (int pos)
 
static const char * _get_axis_name (int pos)
 
int dt_gui_gtk_init (dt_gui_gtk_t *gui)
 
void dt_gui_gtk_run (dt_gui_gtk_t *gui)
 
double dt_get_system_gui_ppd (GtkWidget *widget)
 
void dt_configure_ppd_dpi (dt_gui_gtk_t *gui)
 
static gboolean _focus_in_out_event (GtkWidget *widget, GdkEvent *event, gpointer user_data)
 
static gboolean _ui_log_button_press_event (GtkWidget *widget, GdkEvent *event, gpointer user_data)
 
static gboolean _ui_toast_button_press_event (GtkWidget *widget, GdkEvent *event, gpointer user_data)
 
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_notify_user ()
 draw user's attention
 
void dt_ellipsize_combo (GtkComboBox *cbox)
 
static void _gtk_main_quit_safe (GtkWidget *widget, gpointer data)
 
static void _yes_no_button_handler (GtkButton *button, gpointer data)
 
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, const char *link)
 
void dt_gui_load_theme (const char *theme)
 
GdkModifierType dt_key_modifier_state ()
 
static void _notebook_size_callback (GtkNotebook *notebook, GdkRectangle *allocation, gpointer *data)
 
static gboolean _notebook_motion_notify_callback (GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
 
GtkNotebook * dt_ui_notebook_new ()
 
GtkWidgetdt_ui_notebook_page (GtkNotebook *notebook, const char *text, const char *tooltip)
 
static gint _get_container_row_heigth (GtkWidget *w)
 
static gboolean _scroll_wrap_resize (GtkWidget *w, void *cr, const char *config_str)
 
static gboolean _scroll_wrap_scroll (GtkScrolledWindow *sw, GdkEventScroll *event, const char *config_str)
 
GtkWidgetdt_ui_scroll_wrap (GtkWidget *w, gint min_size, char *config_str)
 
static GtkWidget_search_parent_scrolled_window (GtkWidget *w)
 
static void _widget_auto_ensure_scrolled_window (GtkWidget *w)
 
static int _treeview_count_visible_rows (GtkTreeView *treeview, GtkTreeModel *model, GtkTreeIter *parent)
 
static int _textview_count_visible_rows (GtkWidget *textview)
 
static void dt_gui_widget_update_list_height (GtkWidget *widget, int rows, int min_rows, int max_rows)
 
static void _widget_auto_disconnect_model (dt_gui_widget_auto_height_t *state, GtkWidget *treeview)
 
static void _widget_auto_disconnect_buffer (dt_gui_widget_auto_height_t *state)
 
static void _widget_auto_update (GtkWidget *widget)
 
static void _widget_auto_model_row_inserted (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
 
static void _widget_auto_model_row_deleted (GtkTreeModel *model, GtkTreePath *path, gpointer user_data)
 
static void _widget_auto_model_row_changed (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
 
static void _widget_auto_model_rows_reordered (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gint *new_order, gpointer user_data)
 
static void _widget_auto_model_row_expanded (GtkTreeView *tree_view, GtkTreeIter *expanded_iter, GtkTreePath *path, gpointer user_data)
 
static void _widget_auto_model_row_collapsed (GtkTreeView *tree_view, GtkTreeIter *collapsed_iter, GtkTreePath *path, gpointer user_data)
 
static void _widget_auto_text_buffer_changed (GtkTextBuffer *buffer, gpointer user_data)
 
static void _widget_auto_connect_model (GtkWidget *treeview)
 
static void _widget_auto_connect_buffer (GtkWidget *textview)
 
static void _widget_auto_on_model_changed (GObject *treeview, GParamSpec *pspec, gpointer user_data)
 
static void _widget_auto_on_buffer_changed (GObject *textview, GParamSpec *pspec, gpointer user_data)
 
static void _widget_auto_height_free (gpointer data)
 
void dt_gui_widget_init_auto_height (GtkWidget *w, const int min_rows, const int max_rows)
 Set the automatic height for a widget based on the number of rows or lines it contains.
 
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)
 
static void _remove_child (GtkWidget *widget, gpointer data)
 
void dt_gui_container_remove_children (GtkContainer *container)
 
static void _delete_child (GtkWidget *widget, gpointer data)
 
void dt_gui_container_destroy_children (GtkContainer *container)
 
GtkWidgetdt_gui_get_popup_relative_widget (GtkWidget *widget, GdkRectangle *rect)
 Resolve the widget used as parent for nested popups on Wayland.
 
void dt_gui_menu_popup (GtkMenu *menu, GtkWidget *button, GdkGravity widget_anchor, GdkGravity menu_anchor)
 
static void _popover_set_relative_to_topmost_parent (GtkPopover *popover, GtkWidget *button)
 
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)
 
static void _collapsible_set_states (dt_gui_collapsible_section_t *cs, gboolean active)
 
static void _coeffs_button_changed (GtkDarktableToggleButton *widget, gpointer user_data)
 
static void _coeffs_expander_click (GtkWidget *widget, GdkEventButton *e, gpointer user_data)
 
void dt_gui_update_collapsible_section (dt_gui_collapsible_section_t *cs)
 
void dt_gui_hide_collapsible_section (dt_gui_collapsible_section_t *cs)
 
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_capitalize_label (gchar *text)
 
GtkBox * attach_popover (GtkWidget *widget, const char *icon, GtkWidget *content)
 
GtkBox * attach_help_popover (GtkWidget *widget, const char *label)
 
static gboolean _text_entry_focus_in_event (GtkWidget *self, GdkEventFocus event, gpointer user_data)
 
static gboolean _text_entry_focus_out_event (GtkWidget *self, GdkEventFocus event, gpointer user_data)
 
static gboolean _text_entry_key_pressed (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
 
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.
 
void dt_gui_refocus_center ()
 

Variables

static dt_tablet_motion_state_t _tablet_motion_state = { 0 }
 
static const char *const DT_GUI_WIDGET_AUTO_HEIGHT_KEY = "dt-gui-widget-auto-height"
 

Typedef Documentation

◆ dt_tablet_motion_state_t

◆ result_t

typedef struct result_t result_t

Function Documentation

◆ _button_pressed()

◆ _button_released()

static gboolean _button_released ( GtkWidget w,
GdkEventButton *  event,
gpointer  user_data 
)
static

◆ _center_enter()

static gboolean _center_enter ( GtkWidget widget,
GdkEventCrossing *  event,
gpointer  user_data 
)
static

References dt_control_mouse_enter(), and TRUE.

Referenced by dt_gui_gtk_init().

◆ _center_leave()

static gboolean _center_leave ( GtkWidget widget,
GdkEventCrossing *  event,
gpointer  user_data 
)
static

References dt_control_mouse_leave(), and TRUE.

Referenced by dt_gui_gtk_init().

◆ _clamp01d()

static double _clamp01d ( const double  value)
inlinestatic

References MAX, MIN, and value.

Referenced by _extract_pointer_input().

◆ _coeffs_button_changed()

◆ _coeffs_expander_click()

static void _coeffs_expander_click ( GtkWidget widget,
GdkEventButton *  e,
gpointer  user_data 
)
static

◆ _collapsible_set_states()

◆ _configure()

static gboolean _configure ( GtkWidget da,
GdkEventConfigure *  event,
gpointer  user_data 
)
static

◆ _delete_child()

static void _delete_child ( GtkWidget widget,
gpointer  data 
)
static

References void().

Referenced by dt_gui_container_destroy_children().

◆ _draw()

static gboolean _draw ( GtkWidget da,
cairo_t *  cr,
gpointer  user_data 
)
static

◆ _event_axes()

static const gdouble * _event_axes ( const GdkEvent *  event)
static

◆ _extract_pointer_input()

◆ _focus_in_out_event()

static gboolean _focus_in_out_event ( GtkWidget widget,
GdkEvent *  event,
gpointer  user_data 
)
static

References FALSE.

Referenced by _init_widgets().

◆ _get_axis_name()

static const char * _get_axis_name ( int  pos)
static

Referenced by dt_gui_gtk_init().

◆ _get_axis_value_for_source()

static gboolean _get_axis_value_for_source ( const GdkEvent *  event,
GdkDevice *  source_device,
const GdkAxisUse  axis,
double value,
gboolean *  from_source_map 
)
static

References _event_axes(), FALSE, TRUE, and value.

Referenced by _extract_pointer_input().

◆ _get_container_row_heigth()

static gint _get_container_row_heigth ( GtkWidget w)
static

◆ _get_mode_name()

static const char * _get_mode_name ( int  pos)
static

Referenced by dt_gui_gtk_init().

◆ _get_source_name()

static const char * _get_source_name ( int  pos)
static

Referenced by dt_gui_gtk_init().

◆ _gtk_main_quit_safe()

static void _gtk_main_quit_safe ( GtkWidget widget,
gpointer  data 
)
static

◆ _init_widgets()

◆ _key_pressed()

static gboolean _key_pressed ( GtkWidget w,
GdkEventKey *  event 
)
static

◆ _mouse_moved()

◆ _notebook_motion_notify_callback()

static gboolean _notebook_motion_notify_callback ( GtkWidget widget,
GdkEventMotion *  event,
gpointer  user_data 
)
static

References FALSE, i, and n.

Referenced by dt_ui_notebook_page().

◆ _notebook_size_callback()

static void _notebook_size_callback ( GtkNotebook *  notebook,
GdkRectangle *  allocation,
gpointer *  data 
)
static

References dt_free, i, and n.

Referenced by dt_ui_notebook_page().

◆ _popover_set_relative_to_topmost_parent()

static void _popover_set_relative_to_topmost_parent ( GtkPopover *  popover,
GtkWidget button 
)
static

◆ _remove_child()

static void _remove_child ( GtkWidget widget,
gpointer  data 
)
static

◆ _sample_axis_from_device_state()

static gboolean _sample_axis_from_device_state ( GdkWindow *  window,
GdkDevice *  device,
const GdkAxisUse  axis,
double value 
)
static

References FALSE, and value.

Referenced by _extract_pointer_input().

◆ _sample_tablet_state_from_devices()

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

◆ _scroll_wrap_resize()

static gboolean _scroll_wrap_resize ( GtkWidget w,
void cr,
const char *  config_str 
)
static

◆ _scroll_wrap_scroll()

static gboolean _scroll_wrap_scroll ( GtkScrolledWindow *  sw,
GdkEventScroll *  event,
const char *  config_str 
)
static

◆ _scrolled()

static gboolean _scrolled ( GtkWidget widget,
GdkEventScroll *  event,
gpointer  user_data 
)
static

◆ _search_parent_scrolled_window()

static GtkWidget * _search_parent_scrolled_window ( GtkWidget w)
static

◆ _text_entry_focus_in_event()

static gboolean _text_entry_focus_in_event ( GtkWidget self,
GdkEventFocus  event,
gpointer  user_data 
)
static

◆ _text_entry_focus_out_event()

static gboolean _text_entry_focus_out_event ( GtkWidget self,
GdkEventFocus  event,
gpointer  user_data 
)
static

◆ _text_entry_key_pressed()

static gboolean _text_entry_key_pressed ( GtkWidget widget,
GdkEventKey *  event,
gpointer  user_data 
)
static

◆ _textview_count_visible_rows()

static int _textview_count_visible_rows ( GtkWidget textview)
static

References MAX.

Referenced by _widget_auto_update().

◆ _treeview_count_visible_rows()

static int _treeview_count_visible_rows ( GtkTreeView *  treeview,
GtkTreeModel *  model,
GtkTreeIter *  parent 
)
static

◆ _ui_log_button_press_event()

static gboolean _ui_log_button_press_event ( GtkWidget widget,
GdkEvent *  event,
gpointer  user_data 
)
static

References TRUE.

Referenced by _init_widgets().

◆ _ui_log_redraw_callback()

◆ _ui_toast_button_press_event()

static gboolean _ui_toast_button_press_event ( GtkWidget widget,
GdkEvent *  event,
gpointer  user_data 
)
static

References TRUE.

Referenced by _init_widgets().

◆ _ui_toast_redraw_callback()

◆ _ui_widget_redraw_callback()

static void _ui_widget_redraw_callback ( gpointer  instance,
GtkWidget widget 
)
static

Referenced by _init_widgets().

◆ _widget_auto_connect_buffer()

◆ _widget_auto_connect_model()

◆ _widget_auto_disconnect_buffer()

◆ _widget_auto_disconnect_model()

◆ _widget_auto_ensure_scrolled_window()

static void _widget_auto_ensure_scrolled_window ( GtkWidget w)
static

◆ _widget_auto_height_free()

static void _widget_auto_height_free ( gpointer  data)
static

◆ _widget_auto_model_row_changed()

static void _widget_auto_model_row_changed ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  user_data 
)
static

◆ _widget_auto_model_row_collapsed()

static void _widget_auto_model_row_collapsed ( GtkTreeView *  tree_view,
GtkTreeIter *  collapsed_iter,
GtkTreePath *  path,
gpointer  user_data 
)
static

◆ _widget_auto_model_row_deleted()

static void _widget_auto_model_row_deleted ( GtkTreeModel *  model,
GtkTreePath *  path,
gpointer  user_data 
)
static

◆ _widget_auto_model_row_expanded()

static void _widget_auto_model_row_expanded ( GtkTreeView *  tree_view,
GtkTreeIter *  expanded_iter,
GtkTreePath *  path,
gpointer  user_data 
)
static

◆ _widget_auto_model_row_inserted()

static void _widget_auto_model_row_inserted ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  user_data 
)
static

◆ _widget_auto_model_rows_reordered()

static void _widget_auto_model_rows_reordered ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gint *  new_order,
gpointer  user_data 
)
static

◆ _widget_auto_on_buffer_changed()

static void _widget_auto_on_buffer_changed ( GObject *  textview,
GParamSpec *  pspec,
gpointer  user_data 
)
static

◆ _widget_auto_on_model_changed()

static void _widget_auto_on_model_changed ( GObject *  treeview,
GParamSpec *  pspec,
gpointer  user_data 
)
static

◆ _widget_auto_text_buffer_changed()

static void _widget_auto_text_buffer_changed ( GtkTextBuffer *  buffer,
gpointer  user_data 
)
static

◆ _widget_auto_update()

◆ _window_configure()

static gboolean _window_configure ( GtkWidget da,
GdkEvent *  event,
gpointer  user_data 
)
static

◆ _yes_no_button_handler()

◆ 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.

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.

References _popover_set_relative_to_topmost_parent(), DT_PIXEL_APPLY_DPI, and FALSE.

Referenced by attach_help_popover(), and gui_init().

◆ dt_accels_disconnect_on_text_input()

◆ dt_capitalize_label()

◆ dt_configure_ppd_dpi()

◆ dt_ellipsize_combo()

void dt_ellipsize_combo ( GtkComboBox *  cbox)

◆ dt_get_system_gui_ppd()

double dt_get_system_gui_ppd ( GtkWidget widget)

◆ dt_gui_add_class()

◆ dt_gui_add_help_link()

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

References container().

Referenced by _get_container_row_heigth(), and gui_init().

◆ dt_gui_container_has_children()

gboolean dt_gui_container_has_children ( GtkContainer *  container)

References container(), and FALSE.

Referenced by _destroyed_gui_thread().

◆ dt_gui_container_nth_child()

GtkWidget * dt_gui_container_nth_child ( GtkContainer *  container,
int  which 
)

References container().

Referenced by _iop_panel_label().

◆ dt_gui_container_num_children()

int dt_gui_container_num_children ( GtkContainer *  container)

References container(), and FALSE.

Referenced by container_len().

◆ dt_gui_container_remove_children()

void dt_gui_container_remove_children ( GtkContainer *  container)

◆ dt_gui_draw_rounded_rectangle()

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

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.

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

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

◆ dt_gui_get_scroll_delta()

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

◆ dt_gui_get_scroll_deltas()

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

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

◆ dt_gui_gtk_set_source_rgba()

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

◆ dt_gui_gtk_write_config()

◆ dt_gui_hide_collapsible_section()

◆ 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.

References _coeffs_button_changed(), _coeffs_expander_click(), _gui_collapsible_section_t::confname, _gui_collapsible_section_t::container, CPF_DIRECTION_DOWN, CPF_DIRECTION_LEFT, DT_BAUHAUS_SPACE, dt_conf_get_bool(), dt_gui_add_class(), 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 gui_init(), and gui_init().

◆ dt_gui_quit_callback()

gboolean dt_gui_quit_callback ( GtkWidget widget,
GdkEvent *  event,
gpointer  user_data 
)

References dt_control_quit(), and TRUE.

Referenced by _init_widgets().

◆ dt_gui_refocus_center()

◆ dt_gui_remove_class()

◆ dt_gui_search_start()

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

References FALSE, and TRUE.

Referenced by init_tab_presets().

◆ dt_gui_search_stop()

void dt_gui_search_stop ( GtkSearchEntry *  entry,
GtkWidget widget 
)

Referenced by init_tab_presets().

◆ 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_update_collapsible_section()

◆ dt_gui_widget_init_auto_height()

void dt_gui_widget_init_auto_height ( GtkWidget widget,
int  min_rows,
int  max_rows 
)

Set the automatic height for a widget based on the number of rows or lines it contains.

Compatible with GtkTreeView and GtkTextView.

If the widget is already wrapped in a GtkBox, this function creates a GtkScrolledWindow to contain the widget to scroll. The widget is then wrapped into a GtkScrolledWindow while preserving box packing options. If the widget is already inside a GtkScrolledWindow, its policy is set to horizontal=never and vertical=automatic.

Parameters
widgetThe GtkWidget. It have to be already packed into a GtkBox, or already wrapped in a GtkScrolledWindow.
min_rowsThe minimum number of rows to display.
max_rowsThe maximum number of rows to display.

References _widget_auto_connect_buffer(), _widget_auto_connect_model(), _widget_auto_ensure_scrolled_window(), _widget_auto_height_free(), _widget_auto_on_buffer_changed(), _widget_auto_on_model_changed(), _widget_auto_update(), DT_GUI_WIDGET_AUTO_HEIGHT_KEY, MAX, dt_gui_widget_auto_height_t::max_rows, and dt_gui_widget_auto_height_t::min_rows.

Referenced by dt_iop_gui_init_masks(), and gui_init().

◆ dt_gui_widget_update_list_height()

static void dt_gui_widget_update_list_height ( GtkWidget widget,
int  rows,
int  min_rows,
int  max_rows 
)
static

◆ 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);

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

Referenced by _color_picker_callback_button_press(), blend_color_picker_apply(), and color_picker_apply().

◆ 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

References c, 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

References c, and 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

References c, and dt_ui_t::containers.

Referenced by dt_view_manager_switch_by_view().

◆ dt_ui_notebook_new()

GtkNotebook * dt_ui_notebook_new ( )

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

◆ dt_ui_scroll_wrap()

GtkWidget * dt_ui_scroll_wrap ( GtkWidget w,
gint  min_size,
char *  config_str 
)

Variable Documentation

◆ _tablet_motion_state

dt_tablet_motion_state_t _tablet_motion_state = { 0 }
static

Referenced by _extract_pointer_input().

◆ DT_GUI_WIDGET_AUTO_HEIGHT_KEY

const char* const DT_GUI_WIDGET_AUTO_HEIGHT_KEY = "dt-gui-widget-auto-height"
static