![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <gtk/gtk.h>#include "system/dtpthread.h"#include <inttypes.h>#include "control/jobs.h"#include "control/user_message.h"#include "control/redraw.h"#include "control/progress.h"#include "libs/lib.h"#include <shobjidl.h>
Include dependency graph for control.h:
This graph shows which files directly or indirectly include this file: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 |
| #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__) |
| typedef struct dt_control_pointer_input_t dt_control_pointer_input_t |
| typedef struct dt_control_t dt_control_t |
this manages everything time-consuming. distributes the jobs on all processors, performs scheduling.
| typedef GdkCursorType dt_cursor_t |
| void dt_control_allow_change_cursor | ( | ) |
Definition at line 238 of file control.c.
References darktable_t::control, dt_control_t::cursor, darktable, FALSE, and dt_control_t::lock.
Referenced by _main_do_event_help(), and _restore_default_cursor().
| void dt_control_button_pressed | ( | double | x, |
| double | y, | ||
| double | pressure, | ||
| int | which, | ||
| int | type, | ||
| uint32_t | state | ||
| ) |
Definition at line 772 of file control.c.
References dt_control_t::button_x, dt_control_t::button_y, darktable_t::control, darktable, DT_CTL_LOG_SIZE, DT_CTL_TOAST_SIZE, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_view_manager_button_pressed(), dt_control_t::height, dt_control_t::log_ack, dt_control_t::log_message_timeout_id, dt_control_t::log_mutex, dt_control_t::log_pos, state, dt_control_t::toast_ack, dt_control_t::toast_message_timeout_id, dt_control_t::toast_mutex, dt_control_t::toast_pos, type, darktable_t::view_manager, and x.
Referenced by _button_pressed().
Definition at line 672 of file control.c.
References darktable, dt_view_manager_button_released(), state, darktable_t::view_manager, and x.
Referenced by _button_released().
| 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 283 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_get_debug_flags(), dt_print(), dt_control_t::hide, IS_NULL_PTR, and dt_control_t::lock.
Referenced by dt_control_change_cursor_by_name_and_flush(), dt_control_commit_cursor(), and dt_control_expose().
| 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.
| curs_str | GTK cursor name (for example "progress"). |
Definition at line 335 of file control.c.
References dt_control_change_cursor_by_name(), and IS_NULL_PTR.
Referenced by _cache_wait_cursor_progress(), _lib_duplicate_thumb_press_callback(), _lib_snapshot_capture_state(), _undo_announce(), and dt_iop_autoset_advance().
| void dt_control_change_cursor_EXT | ( | dt_cursor_t | cursor, |
| const char * | file, | ||
| int | line | ||
| ) |
Definition at line 354 of file control.c.
References _control_apply_cursor(), _control_store_current_cursor(), _get_cursor_name(), darktable_t::control, dt_control_t::current_shape, dt_control_t::current_shape_str, dt_control_t::cursor, darktable, dt_control_queue_cursor_EXT(), DT_DEBUG_CONTROL, DT_DEBUG_VERBOSE, dt_get_debug_flags(), dt_print(), dt_control_t::hide, IS_NULL_PTR, and dt_control_t::lock.
| void dt_control_cleanup | ( | dt_control_t * | s | ) |
Definition at line 493 of file control.c.
References dt_control_t::cond_mutex, dt_control_t::current_shape_str, dt_control_t::cursor, dt_control_jobs_cleanup(), dt_pthread_mutex_destroy(), dt_control_t::log_mutex, dt_control_t::mutex, dt_control_t::progress_system, dt_control_t::queue_mutex, dt_control_t::res_mutex, dt_control_t::run_mutex, dt_control_t::shape_str, and dt_control_t::toast_mutex.
Referenced by dt_cleanup().
| void dt_control_commit_cursor | ( | ) |
Definition at line 343 of file control.c.
References darktable_t::control, dt_control_t::cursor, darktable, dt_control_change_cursor, dt_control_change_cursor_by_name(), IS_NULL_PTR, dt_control_t::log_busy, dt_control_t::shape, and dt_control_t::shape_str.
Referenced by _cache_wait_cursor_restore(), _lib_duplicate_thumb_press_callback(), _lib_snapshot_capture_state(), _undo_announce_end(), dt_control_expose(), and mouse_moved().
| gboolean dt_control_configure | ( | GtkWidget * | da, |
| GdkEventConfigure * | event, | ||
| gpointer | user_data | ||
| ) |
Definition at line 515 of file control.c.
References darktable, dt_view_manager_configure(), TRUE, and darktable_t::view_manager.
Referenced by _configure().
| void dt_control_delete_images | ( | ) |
Definition at line 1646 of file control_jobs.c.
References dt_conf_get_bool(), dt_control_add_job(), dt_control_delete_images_job_run(), dt_control_generic_images_job_create(), dt_control_get_global(), dt_control_job_dispose(), dt_control_job_get_params(), dt_control_log(), dt_gui_main_window(), DT_JOB_QUEUE_USER_FG, dt_osx_disallow_fullscreen(), DT_VIEW_LIGHTTABLE, dt_view_manager_get_current_view(), dt_view_manager_get_global(), FALSE, dt_control_image_enumerator_t::index, PROGRESS_SIMPLE, and res.
Referenced by append_file().
| void dt_control_draw_busy_msg | ( | cairo_t * | cr, |
| int | width, | ||
| int | height | ||
| ) |
Definition at line 530 of file control.c.
References dt_bauhaus_get_global(), dt_free, dt_get_main_message_copy(), DT_GUI_COLOR_LOG_BG, DT_GUI_COLOR_LOG_FG, DT_PIXEL_APPLY_DPI, dt_widget_set_source_rgb(), height, IS_NULL_PTR, and width.
Referenced by _thumb_draw_image(), _thumb_draw_image(), dt_control_expose(), and expose().
| void dt_control_expose | ( | cairo_t * | cr, |
| int | width, | ||
| int | height | ||
| ) |
Definition at line 594 of file control.c.
References dt_develop_t::completed, darktable_t::control, darktable, darktable_t::develop, dt_control_change_cursor_by_name(), dt_control_commit_cursor(), dt_control_draw_busy_msg(), dt_gui_center_widget(), DT_PIXEL_APPLY_DPI, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_view_manager_current_flags(), dt_view_manager_expose(), height, dt_control_t::height, IS_NULL_PTR, dt_control_t::log_busy, dt_control_t::log_mutex, lookup_color(), dt_develop_t::progress, dt_develop_t::total, VIEW_FLAGS_PAINTS_WHOLE_AREA, darktable_t::view_manager, width, and dt_control_t::width.
Referenced by _draw().
| void dt_control_forbid_change_cursor | ( | ) |
Definition at line 233 of file control.c.
References darktable_t::control, dt_control_t::cursor, darktable, dt_control_t::lock, and TRUE.
Referenced by _main_do_event_help(), and contextual_help_callback().
| struct dt_control_t * dt_control_get_global | ( | void | ) |
Definition at line 651 of file darktable.c.
References darktable_t::control, and darktable.
Referenced by _act_prerender(), _blendop_masks_show_and_edit(), _cache_wait_cursor_progress(), _cache_wait_cursor_restore(), _create_background_layer_from_input(), _darkroom_edge_pan_apply(), _darkroom_edge_pan_update_state(), _enqueue_surface_fetch(), _folder_survey_scan(), _lib_backgroundjobs_cancel_callback_new(), _lib_backgroundjobs_cancellable(), _lib_backgroundjobs_message_updated(), _lib_backgroundjobs_updated(), _load_for_image(), _preload_image_cache_with_max_size(), _print_button_clicked(), _schedule_main_recompute(), _set_hinter_message(), _switch_cursors(), _switch_preview_cursor(), _thumbtable_dnd_scan_folders_and_import(), _ui_log_redraw_callback(), _ui_toast_redraw_callback(), btn_make_radio_callback(), button_released(), dt_collection_hint_message_internal(), dt_control_copy_images(), dt_control_crawler_run_in_background(), dt_control_datetime(), dt_control_delete_image(), dt_control_delete_images(), dt_control_duplicate_images(), dt_control_export(), dt_control_flip_images(), dt_control_get_selected_files(), dt_control_get_threadid(), dt_control_gpx_apply(), dt_control_import(), dt_control_job_add_progress(), dt_control_job_dispose(), dt_control_job_set_progress(), dt_control_job_set_progress_message(), dt_control_job_set_state(), dt_control_merge_hdr(), dt_control_monochrome_images(), dt_control_move_images(), dt_control_refresh_exif(), dt_control_remove_images(), dt_control_reset_local_copy_images(), dt_control_save_xmp(), dt_control_save_xmps(), dt_control_save_xmps_forced(), dt_control_set_local_copy_images(), dt_control_signal_raise(), dt_dev_start_all_pipelines(), dt_dev_write_history(), dt_film_import(), dt_gui_gtk_init(), dt_printers_discovery(), dt_thumbnail_get_image_buffer(), enter(), gui_cleanup(), gui_focus(), gui_init(), key_pressed(), mouse_moved(), mouse_moved(), and mouse_moved().
| int32_t dt_control_get_keyboard_over_id | ( | ) |
Definition at line 1012 of file control.c.
References darktable_t::control, darktable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_control_t::global_mutex, and dt_control_t::keyboard_over_id.
Referenced by dt_act_on_get_first_image(), dt_act_on_get_images(), dt_act_on_get_images_nb(), dt_thumbtable_key_pressed_grid(), and dt_thumbtable_scroll_to_selection().
| int32_t dt_control_get_mouse_over_id | ( | ) |
Definition at line 986 of file control.c.
References darktable_t::control, darktable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_control_t::global_mutex, and dt_control_t::mouse_over_id.
Referenced by _event_dnd_begin(), _get_image_datetime(), _init_treeview(), _jump_to(), _metadata_view_update_values(), _mouse_over_image_callback(), _populate_thumbnails(), _thumbtable_drag_set_icon(), _update_for_current_image(), dt_thumbtable_key_pressed_grid(), dt_thumbtable_scroll_to_selection(), mouse_moved(), and try_enter().
| void dt_control_get_pointer_input | ( | dt_control_pointer_input_t * | input | ) |
Definition at line 83 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().
| void dt_control_hinter_message | ( | const struct dt_control_t * | s, |
| const char * | message | ||
| ) |
sets the hinter message
Definition at line 981 of file control.c.
References dt_gui_get_ui(), and dt_hinter_set_message().
Referenced by _blendop_masks_show_and_edit(), _set_hinter_message(), _switch_cursors(), _switch_preview_cursor(), btn_make_radio_callback(), button_released(), dt_collection_hint_message_internal(), gui_focus(), key_pressed(), mouse_moved(), and mouse_moved().
| void dt_control_init | ( | dt_control_t * | s | ) |
Definition at line 89 of file control.c.
References dt_control_t::cond, dt_control_t::cond_mutex, dt_control_t::current_shape, dt_control_t::current_shape_str, dt_control_t::cursor, dt_control_jobs_init(), dt_pthread_mutex_init(), FALSE, dt_control_t::global_mutex, dt_control_t::gui_thread, dt_control_t::hide, dt_control_t::keyboard_over_id, dt_control_t::lock, dt_control_t::log_ack, dt_control_t::log_busy, dt_control_t::log_message_timeout_id, dt_control_t::log_mutex, dt_control_t::log_pos, dt_control_t::mouse_over_id, dt_control_t::mutex, dt_control_t::progress_system, dt_control_t::queue_mutex, dt_control_t::res_mutex, dt_control_t::run_mutex, dt_control_t::shape, dt_control_t::shape_str, dt_control_t::toast_ack, dt_control_t::toast_busy, dt_control_t::toast_message_timeout_id, dt_control_t::toast_mutex, and dt_control_t::toast_pos.
Referenced by dt_init().
| void dt_control_key_pressed | ( | GdkEventKey * | event | ) |
Definition at line 667 of file control.c.
References darktable, dt_view_manager_key_pressed(), and darktable_t::view_manager.
Referenced by _key_pressed().
| void dt_control_mouse_enter | ( | ) |
Definition at line 657 of file control.c.
References darktable, dt_view_manager_mouse_enter(), and darktable_t::view_manager.
Referenced by _center_enter().
| void dt_control_mouse_is_dragging | ( | gboolean | state | ) |
Definition at line 432 of file control.c.
References dt_gui_get_global(), dt_gui_gtk_t::is_dragging, dt_gui_gtk_t::mouse, and state.
Referenced by button_pressed(), button_pressed(), button_released(), dt_masks_gui_is_dragging(), leave(), and mouse_leave().
| void dt_control_mouse_is_painting | ( | gboolean | state | ) |
Definition at line 437 of file control.c.
References dt_gui_get_global(), dt_gui_gtk_t::is_painting, dt_gui_gtk_t::mouse, and state.
Referenced by _brush_events_button_pressed(), button_pressed(), button_pressed(), button_released(), leave(), and mouse_leave().
| void dt_control_mouse_leave | ( | ) |
Definition at line 652 of file control.c.
References darktable, dt_view_manager_mouse_leave(), and darktable_t::view_manager.
Referenced by _center_leave().
Definition at line 662 of file control.c.
References darktable, dt_view_manager_mouse_moved(), darktable_t::view_manager, and x.
Referenced by _mouse_moved().
| 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 407 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(), _set_cursor_shape(), _switch_cursors(), _switch_preview_cursor(), dt_control_change_cursor_by_name(), gui_post_expose(), mouse_leave(), and mouse_moved().
| void dt_control_queue_cursor_EXT | ( | dt_cursor_t | cursor, |
| const char * | file, | ||
| int | line | ||
| ) |
Definition at line 385 of file control.c.
References _get_cursor_name(), darktable_t::control, dt_control_t::cursor, darktable, DT_DEBUG_CONTROL, DT_DEBUG_VERBOSE, dt_get_debug_flags(), dt_print(), IS_NULL_PTR, dt_control_t::shape, and dt_control_t::shape_str.
Referenced by dt_control_change_cursor_EXT().
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.
Definition at line 969 of file control.c.
References _widget_queue_draw(), _widget_queue_draw_cleanup(), dt_control_running(), IS_NULL_PTR, and dt_control_redraw_widget_t::widget_ref.
Referenced by _blendop_blendif_polarity_callback(), _blendop_compositing_changed(), _blendop_masks_polarity_callback(), _iop_zonesystem_redraw_preview_callback(), _lib_navigation_control_redraw_callback(), _lib_navigation_history_resync_callback(), _lib_navigation_restart_cache_wait(), _raster_polarity_callback(), _refresh_module_histogram(), apply_auto_black(), apply_auto_Dmax(), apply_auto_Dmin(), apply_auto_exposure(), apply_auto_offset(), apply_auto_WB_high(), apply_auto_WB_low(), color_picker_apply(), gui_changed(), process_clusters(), update_colorchecker_color_list(), Wb_high_norm_callback(), and Wb_low_norm_callback().
| void dt_control_quit | ( | ) |
Definition at line 452 of file control.c.
References dt_control_t::cond_mutex, darktable_t::control, darktable, dt_gui_gtk_quit(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_control_t::run_mutex, and dt_control_t::running.
Referenced by _handle_method_call(), append_file(), and dt_gui_quit_callback().
| int dt_control_running | ( | ) |
get threadsafe running state.
Definition at line 442 of file control.c.
References darktable_t::control, darktable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_control_t::run_mutex, and dt_control_t::running.
Referenced by _job_cancelled(), _update_display_profile(), dt_control_crawler_run_in_background(), dt_control_queue_redraw_widget(), dt_control_signal_raise(), dt_control_work(), dt_control_work_res(), dt_control_worker_kicker(), dt_dev_darkroom_pipeline(), gui_reset(), and leave().
| void dt_control_save_xmp | ( | const int32_t | imgid | ) |
Definition at line 1514 of file control_jobs.c.
References dt_control_add_job(), dt_control_generic_image_job_create(), dt_control_get_global(), dt_control_save_xmps_job_run(), DT_JOB_QUEUE_USER_FG, and PROGRESS_NONE.
Referenced by _image_import_internal(), _lib_duplicate_caption_out_callback(), dt_image_cache_write_release(), dt_image_local_copy_reset(), and dt_image_set_flip().
| void dt_control_save_xmps | ( | const GList * | imgids, |
| const gboolean | check_history | ||
| ) |
Definition at line 1522 of file control_jobs.c.
References dt_control_add_job(), dt_control_get_global(), dt_control_image_enumerator_alloc(), dt_control_image_enumerator_cleanup(), dt_control_job_create(), dt_control_job_dispose(), dt_control_job_set_params(), dt_control_save_xmps_job_run(), DT_JOB_QUEUE_USER_FG, IS_NULL_PTR, and void().
Referenced by dt_image_synch_all_xmp(), dt_image_synch_xmp(), and dt_image_synch_xmps().
| void dt_control_save_xmps_forced | ( | const GList * | imgids | ) |
Definition at line 1544 of file control_jobs.c.
References dt_control_add_job(), dt_control_get_global(), dt_control_image_enumerator_alloc(), dt_control_image_enumerator_cleanup(), dt_control_job_create(), dt_control_job_dispose(), dt_control_job_set_params(), dt_control_save_xmps_job_run(), DT_JOB_QUEUE_USER_FG, and IS_NULL_PTR.
Referenced by dt_image_local_copy_synch().
| 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 425 of file control.c.
References darktable_t::control, dt_control_t::cursor, darktable, DT_DEBUG_CONTROL, DT_DEBUG_VERBOSE, dt_get_debug_flags(), dt_print(), and dt_control_t::hide.
| void dt_control_set_keyboard_over_id | ( | int32_t | value | ) |
Definition at line 1020 of file control.c.
References darktable_t::control, darktable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_control_t::global_mutex, dt_control_t::keyboard_over_id, and value.
Referenced by _culling_mode(), _film_strip_activated(), _studio_set_image(), _view_map_button_press_callback(), _view_map_filmstrip_drag_begin_callback(), _view_map_selection_changed(), _view_print_filmstrip_drag_begin_callback(), dt_thumbtable_dispatch_over(), dt_ui_panel_show(), and enter().
| void dt_control_set_mouse_over_id | ( | int32_t | value | ) |
Definition at line 994 of file control.c.
References darktable_t::control, darktable, dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), DT_SIGNAL_MOUSE_OVER_IMAGE_CHANGE, dt_control_t::global_mutex, dt_control_t::keyboard_over_id, dt_control_t::mouse_over_id, and value.
Referenced by _culling_mode(), _dev_change_image(), _display_next_image(), _dt_ctl_open_image_in_darkroom(), _event_main_enter(), _event_main_leave(), _event_main_leave(), _event_main_motion(), _event_main_press(), _film_import1(), _film_strip_activated(), _studio_set_image(), _view_map_button_press_callback(), _view_map_filmstrip_drag_begin_callback(), _view_map_motion_notify_callback(), _view_map_selection_changed(), _view_print_filmstrip_drag_begin_callback(), dt_collection_load_filmroll(), dt_load_from_string(), dt_thumbtable_dispatch_over(), dt_ui_panel_show(), enter(), mouse_leave(), mouse_moved(), and reset().
| void dt_control_set_pointer_input | ( | const dt_control_pointer_input_t * | input | ) |
Definition at line 77 of file control.c.
References _pointer_input, and IS_NULL_PTR.
Referenced by _button_pressed(), _button_released(), and _mouse_moved().
| void dt_control_shutdown | ( | dt_control_t * | s | ) |
Definition at line 465 of file control.c.
References dt_control_t::cond, dt_control_t::cond_mutex, dt_control_jobs_drain(), DT_CTL_WORKER_RESERVED, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), k, dt_control_t::kick_on_workers_thread, dt_control_t::num_threads, dt_control_t::run_mutex, dt_control_t::running, dt_control_t::thread, and dt_control_t::thread_res.
Referenced by dt_cleanup().
| void dt_control_write_sidecar_files | ( | ) |
Definition at line 323 of file control_jobs.c.
References dt_act_on_get_images(), dt_control_save_xmps_forced(), and IS_NULL_PTR.
Referenced by append_run().
| void dt_ctl_open_image_in_darkroom | ( | const int32_t | imgid | ) |
open one specific image in the darkroom, from any view and any thread.
The darkroom picks the image it opens from the mouse-over id, falling back on the selection. Both are volatile: a pointer motion rewrites the mouse-over id, and leaving the darkroom restores the selection to the image it was editing. A caller that knows which image it wants – an import job, a background task – must therefore not publish the target and request the view switch separately: it has to happen in one go on the GUI thread, which is what this does.
| imgid | the image to open. The caller owns this contract: an id that names no image only gets the darkroom to refuse the switch and log "No image to open". |
Definition at line 745 of file control.c.
References _dt_ctl_open_image_in_darkroom().
Referenced by _dt_collection_change_view_after_import().
| void dt_ctl_switch_mode_to | ( | const char * | mode | ) |
Definition at line 701 of file control.c.
References _dt_ctl_switch_mode_to(), darktable, dt_ctl_switch_mode_to(), dt_view_manager_get_current_view(), dt_view_t::module_name, and darktable_t::view_manager.
Referenced by _dt_collection_change_view_after_import(), _home_callback(), _view_map_button_press_callback(), dt_cleanup(), dt_ctl_switch_mode_to(), dt_init(), dt_load_from_string(), and key_pressed().
Definition at line 714 of file control.c.
References _dt_ctl_switch_mode_to_by_view(), darktable, dt_view_manager_get_current_view(), view, and darktable_t::view_manager.
| char * dt_get_main_message_copy | ( | void | ) |
Message painted over the main preview while the pipeline is working. Written by the pipeline (develop/pixelpipe_hb.c) from WORKER threads, rendered by control/control.c on the GUI thread; the storage belongs to the orchestrator and carries its own lock.
dt_set_main_message() TAKES OWNERSHIP of message and frees the previous one; pass NULL to clear. The reader gets a COPY it must free – there is no safe way to lend the pointer, since the next write frees it and the writer is on another thread.
Definition at line 583 of file darktable.c.
References _main_message_lock, copy(), darktable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, and darktable_t::main_message.
Referenced by dt_control_draw_busy_msg().
| void dt_set_main_message | ( | char * | message | ) |
Definition at line 591 of file darktable.c.
References _main_message_lock, darktable, dt_free, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and darktable_t::main_message.
Referenced by _pipeline_busy().