Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
control.h File Reference
#include "common/darktable.h"
#include "common/dtpthread.h"
#include "control/settings.h"
#include <gtk/gtk.h>
#include <inttypes.h>
#include "control/jobs.h"
#include "control/progress.h"
#include "libs/lib.h"
+ Include dependency graph for control.h:

Go to the source code of this file.

Data Structures

struct  dt_control_pointer_input_t
 
struct  dt_control_t
 

Macros

#define dt_control_change_cursor(cursor)    dt_control_change_cursor_EXT((cursor), __FILE__, __LINE__)
 
#define dt_control_queue_cursor(cursor)    dt_control_queue_cursor_EXT((cursor), __FILE__, __LINE__)
 
#define dt_control_set_cursor_visible(visible)    dt_control_set_cursor_visible_EXT((visible), __FILE__, __LINE__)
 
#define DT_CTL_LOG_SIZE   10
 
#define DT_CTL_LOG_MSG_SIZE   1000
 
#define DT_CTL_LOG_TIMEOUT   8000
 
#define DT_CTL_TOAST_SIZE   10
 
#define DT_CTL_TOAST_MSG_SIZE   300
 
#define DT_CTL_TOAST_TIMEOUT   5000
 

Typedefs

typedef GdkCursorType dt_cursor_t
 
typedef struct dt_control_pointer_input_t dt_control_pointer_input_t
 
typedef struct dt_control_t dt_control_t
 

Functions

voiddt_control_expose (void *voidptr)
 
void dt_control_button_pressed (double x, double y, double pressure, int which, int type, uint32_t state)
 
void dt_control_button_released (double x, double y, int which, uint32_t state)
 
void dt_control_mouse_moved (double x, double y, double pressure, int which)
 
void dt_control_set_pointer_input (const dt_control_pointer_input_t *input)
 
void dt_control_get_pointer_input (dt_control_pointer_input_t *input)
 
void dt_control_key_pressed (GdkEventKey *event)
 
void dt_control_mouse_leave ()
 
void dt_control_mouse_enter ()
 
gboolean dt_control_configure (GtkWidget *da, GdkEventConfigure *event, gpointer user_data)
 
void dt_control_log (const char *msg,...) __attribute__((format(printf
 
void void dt_toast_log (const char *msg,...) __attribute__((format(printf
 
void void void dt_toast_markup_log (const char *msg,...) __attribute__((format(printf
 
void void void void dt_control_log_busy_enter ()
 
void dt_control_toast_busy_enter ()
 
void dt_control_log_busy_leave ()
 
void dt_control_toast_busy_leave ()
 
void dt_control_draw_busy_msg (cairo_t *cr, int width, int height)
 
void dt_control_forbid_change_cursor ()
 
void dt_control_allow_change_cursor ()
 
void dt_control_change_cursor_EXT (dt_cursor_t cursor, const char *file, int line)
 
void dt_control_change_cursor_by_name (const char *curs_str)
 Apply a GTK named cursor immediately without replacing the queued cursor state.
 
void dt_control_change_cursor_by_name_and_flush (const char *curs_str)
 Apply a GTK named cursor immediately and flush display updates.
 
void dt_control_queue_cursor_EXT (dt_cursor_t cursor, const char *file, int line)
 
void dt_control_queue_cursor_by_name (const char *curs_str)
 Queue a GTK named cursor for the next cursor commit.
 
void dt_control_commit_cursor ()
 
void dt_control_set_cursor_visible_EXT (gboolean visible, const char *file, int line)
 Set whether the cursor should be visible or not.
 
void dt_control_write_sidecar_files ()
 
void dt_control_save_xmp (const int32_t imgid)
 
void dt_control_save_xmps (const GList *imgids, const gboolean check_history)
 
void dt_control_delete_images ()
 
void dt_control_queue_redraw ()
 request redraw of the workspace. This redraws the whole workspace within a gdk critical section to prevent several threads to carry out a redraw which will end up in crashes.
 
void dt_control_queue_redraw_center ()
 request redraw of center window. This redraws the center view within a gdk critical section to prevent several threads to carry out the redraw.
 
void dt_control_queue_redraw_widget (GtkWidget *widget)
 threadsafe request of redraw of specific widget. Use this function if you need to redraw a specific widget if your current thread context is not gtk main thread.
 
void dt_control_navigation_redraw ()
 request redraw of the navigation widget. This redraws the wiget of the navigation module.
 
void dt_control_log_redraw ()
 request redraw of the log widget. This redraws the message label.
 
void dt_control_toast_redraw ()
 request redraw of the toast widget. This redraws the message label.
 
void dt_ctl_switch_mode_to (const char *mode)
 
void dt_ctl_switch_mode_to_by_view (const dt_view_t *view)
 
void dt_ctl_reload_view (const char *mode)
 
void dt_control_hinter_message (const struct dt_control_t *s, const char *message)
 
void dt_control_init (dt_control_t *s)
 
void dt_control_shutdown (dt_control_t *s)
 
void dt_control_cleanup (dt_control_t *s)
 
void dt_control_quit ()
 
int dt_control_running ()
 
int32_t dt_control_get_mouse_over_id ()
 
void dt_control_set_mouse_over_id (int32_t value)
 
int32_t dt_control_get_keyboard_over_id ()
 
void dt_control_set_keyboard_over_id (int32_t value)
 

Macro Definition Documentation

◆ dt_control_change_cursor

#define dt_control_change_cursor (   cursor)     dt_control_change_cursor_EXT((cursor), __FILE__, __LINE__)

Definition at line 116 of file control.h.

◆ dt_control_queue_cursor

#define dt_control_queue_cursor (   cursor)     dt_control_queue_cursor_EXT((cursor), __FILE__, __LINE__)

Definition at line 135 of file control.h.

◆ dt_control_set_cursor_visible

#define dt_control_set_cursor_visible (   visible)     dt_control_set_cursor_visible_EXT((visible), __FILE__, __LINE__)

Definition at line 148 of file control.h.

◆ DT_CTL_LOG_MSG_SIZE

#define DT_CTL_LOG_MSG_SIZE   1000

Definition at line 200 of file control.h.

◆ DT_CTL_LOG_SIZE

#define DT_CTL_LOG_SIZE   10

Definition at line 199 of file control.h.

◆ DT_CTL_LOG_TIMEOUT

#define DT_CTL_LOG_TIMEOUT   8000

Definition at line 201 of file control.h.

◆ DT_CTL_TOAST_MSG_SIZE

#define DT_CTL_TOAST_MSG_SIZE   300

Definition at line 203 of file control.h.

◆ DT_CTL_TOAST_SIZE

#define DT_CTL_TOAST_SIZE   10

Definition at line 202 of file control.h.

◆ DT_CTL_TOAST_TIMEOUT

#define DT_CTL_TOAST_TIMEOUT   5000

Definition at line 204 of file control.h.

Typedef Documentation

◆ dt_control_pointer_input_t

◆ dt_control_t

typedef struct dt_control_t dt_control_t

this manages everything time-consuming. distributes the jobs on all processors, performs scheduling.

◆ dt_cursor_t

typedef GdkCursorType dt_cursor_t

Definition at line 70 of file control.h.

Function Documentation

◆ dt_control_allow_change_cursor()

void dt_control_allow_change_cursor ( )

◆ dt_control_button_pressed()

◆ dt_control_button_released()

void dt_control_button_released ( double  x,
double  y,
int  which,
uint32_t  state 
)

◆ dt_control_change_cursor_by_name()

void dt_control_change_cursor_by_name ( const char *  curs_str)

Apply a GTK named cursor immediately without replacing the queued cursor state.

This is used for temporary cursors such as "progress" while synchronous UI-thread operations are running.

Apply a GTK named cursor immediately without replacing the queued cursor state.

Named cursors report GDK_CURSOR_IS_PIXMAP as their type, which is only a marker for GTK's cursor cache. The queued cursor state is owned by dt_control_queue_cursor_by_name(), so temporary named cursors such as the busy cursor do not overwrite the cursor that should be restored later.

Definition at line 274 of file control.c.

References _control_apply_cursor(), _control_store_current_cursor(), darktable_t::control, dt_control_t::current_shape, dt_control_t::current_shape_str, dt_control_t::cursor, darktable, dt_control_queue_cursor_by_name(), DT_DEBUG_CONTROL, DT_DEBUG_VERBOSE, dt_print(), dt_control_t::hide, IS_NULL_PTR, dt_control_t::lock, and darktable_t::unmuted.

Referenced by dt_control_change_cursor_by_name_and_flush(), dt_control_commit_cursor(), and dt_control_expose().

◆ dt_control_change_cursor_by_name_and_flush()

void dt_control_change_cursor_by_name_and_flush ( const char *  curs_str)

Apply a GTK named cursor immediately and flush display updates.

This helper is intended for synchronous UI-thread work that blocks right after setting the cursor, ensuring the new shape is visible before computation starts.

Apply a GTK named cursor immediately and flush display updates.

Some synchronous UI-thread operations perform heavy work right after cursor setup. Without an explicit display flush, GTK may delay painting and the busy cursor can remain invisible until the computation already finished.

Parameters
curs_strGTK cursor name (for example "progress").

Definition at line 326 of file control.c.

References dt_control_change_cursor_by_name(), and IS_NULL_PTR.

Referenced by _cache_wait_cursor_progress(), _lib_snapshots_refresh_pipe_image(), and dt_iop_autoset_advance().

◆ dt_control_change_cursor_EXT()

◆ dt_control_cleanup()

◆ dt_control_commit_cursor()

◆ dt_control_configure()

gboolean dt_control_configure ( GtkWidget da,
GdkEventConfigure *  event,
gpointer  user_data 
)

Definition at line 490 of file control.c.

References darktable, dt_view_manager_configure(), TRUE, and darktable_t::view_manager.

Referenced by _configure().

◆ dt_control_delete_images()

◆ dt_control_draw_busy_msg()

◆ dt_control_expose()

◆ dt_control_forbid_change_cursor()

void dt_control_forbid_change_cursor ( )

◆ dt_control_get_keyboard_over_id()

◆ dt_control_get_mouse_over_id()

◆ dt_control_get_pointer_input()

void dt_control_get_pointer_input ( dt_control_pointer_input_t input)

Definition at line 89 of file control.c.

References _pointer_input, and IS_NULL_PTR.

Referenced by _build_raw_input_event(), button_pressed(), button_released(), and gui_post_expose().

◆ dt_control_hinter_message()

◆ dt_control_init()

◆ dt_control_key_pressed()

void dt_control_key_pressed ( GdkEventKey *  event)

Definition at line 619 of file control.c.

References darktable, dt_view_manager_key_pressed(), and darktable_t::view_manager.

Referenced by _key_pressed().

◆ dt_control_log()

void dt_control_log ( const char *  msg,
  ... 
)

◆ dt_control_log_busy_enter()

◆ dt_control_log_busy_leave()

◆ dt_control_log_redraw()

void dt_control_log_redraw ( )

request redraw of the log widget. This redraws the message label.

Definition at line 871 of file control.c.

References darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_CONTROL_LOG_REDRAW, and darktable_t::signals.

Referenced by _dt_ctl_log_message_timeout_callback(), and _redraw_center().

◆ dt_control_mouse_enter()

void dt_control_mouse_enter ( )

Definition at line 609 of file control.c.

References darktable, dt_view_manager_mouse_enter(), and darktable_t::view_manager.

Referenced by _center_enter().

◆ dt_control_mouse_leave()

void dt_control_mouse_leave ( )

Definition at line 604 of file control.c.

References darktable, dt_view_manager_mouse_leave(), and darktable_t::view_manager.

Referenced by _center_leave().

◆ dt_control_mouse_moved()

void dt_control_mouse_moved ( double  x,
double  y,
double  pressure,
int  which 
)

Definition at line 614 of file control.c.

References darktable, dt_view_manager_mouse_moved(), darktable_t::view_manager, and x.

Referenced by _mouse_moved().

◆ dt_control_navigation_redraw()

void dt_control_navigation_redraw ( )

request redraw of the navigation widget. This redraws the wiget of the navigation module.

Definition at line 866 of file control.c.

References darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_CONTROL_NAVIGATION_REDRAW, and darktable_t::signals.

Referenced by _enter_edit_mode(), dt_dev_pixelpipe_change_zoom_main(), and gui_changed().

◆ dt_control_queue_cursor_by_name()

void dt_control_queue_cursor_by_name ( const char *  curs_str)

Queue a GTK named cursor for the next cursor commit.

The cursor object is created only to validate the theme name. The queued ownership remains the string because GTK exposes named cursors as GDK_CURSOR_IS_PIXMAP, which cannot be passed back to gdk_cursor_new_for_display().

Definition at line 398 of file control.c.

References darktable_t::control, dt_control_t::cursor, darktable, IS_NULL_PTR, and dt_control_t::shape_str.

Referenced by _darkroom_set_default_cursor(), _switch_cursors(), _switch_preview_cursor(), dt_control_change_cursor_by_name(), gui_post_expose(), mouse_leave(), mouse_moved(), and mouse_moved().

◆ dt_control_queue_cursor_EXT()

void dt_control_queue_cursor_EXT ( dt_cursor_t  cursor,
const char *  file,
int  line 
)

◆ dt_control_queue_redraw()

void dt_control_queue_redraw ( )

request redraw of the workspace. This redraws the whole workspace within a gdk critical section to prevent several threads to carry out a redraw which will end up in crashes.

Definition at line 856 of file control.c.

References darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_CONTROL_REDRAW_ALL, and darktable_t::signals.

Referenced by _enter_edit_mode(), _export_image(), _view_print_settings(), dt_dev_configure_real(), dt_dev_darkroom_pipeline(), dt_image_import_job_run(), dt_lib_gui_set_expanded(), enter(), and process_clusters().

◆ dt_control_queue_redraw_center()

void dt_control_queue_redraw_center ( )

request redraw of center window. This redraws the center view within a gdk critical section to prevent several threads to carry out the redraw.

Definition at line 861 of file control.c.

References darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_CONTROL_REDRAW_CENTER, and darktable_t::signals.

Referenced by _add_shape(), _apply_display_brush_color(), _area_button_press_callback(), _area_motion_notify_callback(), _blendop_masks_apply_and_commit(), _cache_wait_cursor_restore(), _cacheline_ready_callback(), _channel_tabs_switch_callback(), _color_picker_callback_button_press(), _darkroom_image_loaded_callback(), _darkroom_restart_cache_wait(), _display_samples_changed(), _do_get_structure_lines(), _do_get_structure_quad(), _drag_and_drop_received(), _drag_motion_received(), _drop_move_to_folder(), _edit_masks(), _enter_edit_mode(), _event_process_after_preview_callback(), _event_process_after_ui_callback(), _event_structure_auto_clicked(), _film_import1(), _film_strip_activated(), _generic_dt_control_fileop_images_job_run(), _grid_callback(), _grid_horizontal_changed(), _grid_size_changed(), _grid_subdiv_changed(), _grid_vertical_changed(), _gui_delete_callback(), _gui_set_single_expanded(), _guides_quickbutton_clicked(), _height_changed(), _iso_12646_quickbutton_clicked(), _key_scroll(), _lib_duplicate_preview_updated_callback(), _lib_duplicate_thumb_release_callback(), _lib_masks_handler_callback(), _lib_snapshots_toggled_callback(), _live_sample_button(), _masks_shape_button_pressed(), _page_clear_area_clicked(), _page_delete_area(), _preview_cache_wait_restart(), _print_settings_activate_or_update_callback(), _publish_backend_progress(), _refresh_active_picker(), _refresh_display(), _remove_sample_cb(), _ring_tabs_switch_callback(), _sample_enter_callback(), _sample_leave_callback(), _set_orientation(), _settings_colors_changed(), _settings_contrast_changed(), _settings_flip_changed(), _settings_guides_changed(), _snap_grid_callback(), _switch_cursors(), _tree_add_brush(), _tree_add_circle(), _tree_add_ellipse(), _tree_add_gradient(), _tree_add_polygon(), _tree_difference(), _tree_exclusion(), _tree_intersection(), _tree_inverse(), _tree_selection_change(), _tree_union(), _view_surface_commit_main(), _width_changed(), _x_changed(), _y_changed(), aspect_presets_changed(), auto_advance(), button_pressed(), button_pressed(), button_pressed(), button_released(), button_released(), button_released(), checker_changed_callback(), checker_color_changed_callback(), color_picker_apply(), delete_history_callback(), display_brightness_callback(), dt_control_delete_images_job_run(), dt_control_duplicate_images_job_run(), dt_control_flip_images_job_run(), dt_control_local_copy_images_job_run(), dt_control_log_busy_enter(), dt_control_log_busy_leave(), dt_control_merge_hdr_job_run(), dt_control_monochrome_images_job_run(), dt_control_refresh_exif_run(), dt_control_remove_images_job_run(), dt_control_toast_busy_enter(), dt_control_toast_busy_leave(), dt_dev_darkroom_pipeline(), dt_dev_pixelpipe_process_rec(), dt_dev_snapshot_request(), dt_drawlayer_commit_dabs(), dt_drawlayer_runtime_manager_update(), dt_film_open(), dt_image_local_copy_reset(), dt_image_local_copy_set(), dt_iop_request_focus(), dt_masks_set_edit_mode(), entry_activated(), expose(), gui_changed(), gui_focus(), gui_reset(), gui_update(), key_swap_callback(), keystone_type_changed(), load_xmp_callback(), mouse_leave(), mouse_leave(), mouse_moved(), mouse_moved(), mouse_moved(), mouse_moved(), paste_parts_callback(), row_activated(), rt_select_algorithm_callback(), rt_show_forms_for_current_scale(), safety_changed_callback(), scrolled(), set_params(), start_profiling_callback(), sync_pipe(), and ungroup_images_callback().

◆ dt_control_queue_redraw_widget()

◆ dt_control_quit()

◆ dt_control_running()

◆ dt_control_save_xmp()

◆ dt_control_save_xmps()

◆ dt_control_set_cursor_visible_EXT()

void dt_control_set_cursor_visible_EXT ( gboolean  visible,
const char *  file,
int  line 
)

Set whether the cursor should be visible or not.

Cursor visibility changes are routed through a macro so the implementation can log the exact call site that requested the state transition.

Definition at line 416 of file control.c.

References darktable_t::control, dt_control_t::cursor, darktable, DT_DEBUG_CONTROL, DT_DEBUG_VERBOSE, dt_print(), dt_control_t::hide, and darktable_t::unmuted.

◆ dt_control_set_keyboard_over_id()

◆ dt_control_set_mouse_over_id()

◆ dt_control_set_pointer_input()

void dt_control_set_pointer_input ( const dt_control_pointer_input_t input)

Definition at line 83 of file control.c.

References _pointer_input, and IS_NULL_PTR.

Referenced by _button_pressed(), _button_released(), and _mouse_moved().

◆ dt_control_shutdown()

◆ dt_control_toast_busy_enter()

◆ dt_control_toast_busy_leave()

◆ dt_control_toast_redraw()

void dt_control_toast_redraw ( )

request redraw of the toast widget. This redraws the message label.

Definition at line 876 of file control.c.

References darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_CONTROL_TOAST_REDRAW, and darktable_t::signals.

Referenced by _dt_ctl_toast_message_timeout_callback(), and _redraw_center().

◆ dt_control_write_sidecar_files()

void dt_control_write_sidecar_files ( )

Definition at line 310 of file control_jobs.c.

References dt_act_on_get_images(), dt_control_save_xmps(), FALSE, and IS_NULL_PTR.

Referenced by append_run().

◆ dt_ctl_reload_view()

◆ dt_ctl_switch_mode_to()

◆ dt_ctl_switch_mode_to_by_view()

void dt_ctl_switch_mode_to_by_view ( const dt_view_t view)

◆ dt_toast_log()

void void dt_toast_log ( const char *  msg,
  ... 
)

◆ dt_toast_markup_log()

void void void dt_toast_markup_log ( const char *  msg,
  ... 
)