![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "views/dev_toolbox.h"#include "bauhaus/bauhaus.h"#include "common/colorspaces.h"#include "common/darktable.h"#include "common/file_location.h"#include "common/usermanual_url.h"#include "control/conf.h"#include "control/control.h"#include "control/signal.h"#include "develop/develop.h"#include "develop/dev_pixelpipe.h"#include "dtgtk/button.h"#include "dtgtk/paint.h"#include "dtgtk/togglebutton.h"#include "gui/accelerators.h"#include "gui/gtk.h"#include <limits.h>
Include dependency graph for dev_toolbox.c:Go to the source code of this file.
Macros | |
| #define | DT_DEV_TOOLBOX_BUTTON_TYPE_KEY "dt-dev-toolbox-button-type" |
| #define | DT_DEV_TOOLBOX_PRESHOW_FN_KEY "dt-dev-toolbox-popover-preshow-fn" |
| #define | DT_DEV_TOOLBOX_PRESHOW_DATA_KEY "dt-dev-toolbox-popover-preshow-data" |
| #define DT_DEV_TOOLBOX_BUTTON_TYPE_KEY "dt-dev-toolbox-button-type" |
Definition at line 36 of file dev_toolbox.c.
| #define DT_DEV_TOOLBOX_PRESHOW_DATA_KEY "dt-dev-toolbox-popover-preshow-data" |
Definition at line 64 of file dev_toolbox.c.
| #define DT_DEV_TOOLBOX_PRESHOW_FN_KEY "dt-dev-toolbox-popover-preshow-fn" |
Definition at line 63 of file dev_toolbox.c.
|
static |
Definition at line 557 of file dev_toolbox.c.
References _display_borders_callback(), _display_brightness_callback(), darktable_t::bauhaus, dt_develop_t::button, darktable, dt_develop_t::display, dt_bauhaus_slider_new_with_range(), dt_bauhaus_slider_set(), dt_bauhaus_slider_set_format(), dt_bauhaus_widget_set_label(), dt_conf_get_int(), dt_dev_toolbox_connect_popover(), DT_DEV_TOOLBOX_POPOVER_KEY, DT_GUI_BOX_SPACING, DT_GUI_MODULE, DT_PIXEL_APPLY_DPI, dt_develop_t::floating_window, and TRUE.
Referenced by dt_dev_toolbox_create().
|
static |
Definition at line 334 of file dev_toolbox.c.
References _overexposed_colorscheme_callback(), _overexposed_lower_callback(), _overexposed_mode_callback(), _overexposed_upper_callback(), darktable_t::bauhaus, dt_develop_t::button, dt_develop_t::colorscheme, darktable, DT_BAUHAUS_COMBOBOX_NEW_FULL, dt_bauhaus_slider_new_with_range(), dt_bauhaus_slider_set(), dt_bauhaus_slider_set_format(), dt_bauhaus_widget_set_label(), dt_dev_toolbox_connect_popover(), DT_DEV_TOOLBOX_POPOVER_KEY, dt_get_help_url(), dt_gui_add_help_link(), DT_GUI_BOX_SPACING, DT_GUI_MODULE, dt_develop_t::floating_window, dt_develop_t::lower, dt_develop_t::mode, dt_develop_t::overexposed, TRUE, and dt_develop_t::upper.
Referenced by dt_dev_toolbox_create().
|
static |
Definition at line 410 of file dev_toolbox.c.
References _rawoverexposed_colorscheme_callback(), _rawoverexposed_mode_callback(), _rawoverexposed_threshold_callback(), darktable_t::bauhaus, dt_develop_t::button, dt_develop_t::colorscheme, darktable, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_new(), DT_BAUHAUS_COMBOBOX_NEW_FULL, dt_bauhaus_combobox_set(), dt_bauhaus_slider_new_with_range(), dt_bauhaus_slider_set(), dt_bauhaus_widget_set_label(), dt_dev_toolbox_connect_popover(), DT_DEV_TOOLBOX_POPOVER_KEY, dt_get_help_url(), dt_gui_add_help_link(), DT_GUI_BOX_SPACING, DT_GUI_MODULE, dt_develop_t::floating_window, dt_develop_t::mode, dt_develop_t::rawoverexposed, threshold, dt_develop_t::threshold, and TRUE.
Referenced by dt_dev_toolbox_create().
|
static |
Definition at line 490 of file dev_toolbox.c.
References _softproof_profile_callback(), darktable_t::bauhaus, darktable_t::color_profiles, darktable, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_new(), dt_bauhaus_combobox_set(), dt_bauhaus_combobox_set_entries_ellipsis(), dt_bauhaus_widget_set_label(), DT_COLORSPACE_FILE, dt_dev_toolbox_connect_popover(), DT_DEV_TOOLBOX_POPOVER_KEY, dt_free, dt_get_help_url(), dt_gui_add_help_link(), DT_GUI_BOX_SPACING, DT_GUI_MODULE, dt_loc_get_datadir(), dt_loc_get_user_config_dir(), dt_colorspaces_color_profile_t::filename, dt_develop_t::floating_window, dt_develop_t::gamut_button, dt_colorspaces_color_profile_t::name, dt_colorspaces_color_profile_t::out_pos, PATH_MAX, dt_develop_t::profile, dt_colorspaces_t::profiles, dt_develop_t::softproof_button, dt_colorspaces_t::softproof_filename, dt_colorspaces_t::softproof_type, tooltip, TRUE, and dt_colorspaces_color_profile_t::type.
Referenced by dt_dev_toolbox_create().
Definition at line 250 of file dev_toolbox.c.
References _update_softproof_gamut_checking(), darktable_t::color_profiles, darktable, dt_control_queue_redraw_center(), dt_dev_pixelpipe_resync_history_main, dt_dev_toolbox_apply_iso_12646_size(), DT_DEV_TOOLBOX_BUTTON_TYPE_KEY, DT_DEV_TOOLBOX_DISPLAY, DT_DEV_TOOLBOX_GAMUT, DT_DEV_TOOLBOX_ISO_12646, DT_DEV_TOOLBOX_OVEREXPOSED, DT_DEV_TOOLBOX_RAWOVEREXPOSED, DT_DEV_TOOLBOX_SOFTPROOF, DT_PROFILE_GAMUTCHECK, DT_PROFILE_NORMAL, DT_PROFILE_SOFTPROOF, dt_develop_t::enabled, dt_develop_t::gui_attached, dt_develop_t::iso_12646, dt_colorspaces_t::mode, dt_develop_t::overexposed, dt_develop_t::rawoverexposed, and type.
Referenced by _create_one_button(), and _update_softproof_gamut_checking().
|
static |
Definition at line 590 of file dev_toolbox.c.
References _button_clicked(), dt_develop_t::button, darktable, dt_develop_t::display, DT_DEV_TOOLBOX_BUTTON_TYPE_KEY, DT_DEV_TOOLBOX_DISPLAY, DT_DEV_TOOLBOX_GAMUT, DT_DEV_TOOLBOX_ISO_12646, DT_DEV_TOOLBOX_OVEREXPOSED, DT_DEV_TOOLBOX_RAWOVEREXPOSED, DT_DEV_TOOLBOX_SOFTPROOF, dt_view_manager_module_toolbox_add(), dtgtk_button_new(), dtgtk_cairo_paint_bulb(), dtgtk_cairo_paint_display(), dtgtk_cairo_paint_gamut_check(), dtgtk_cairo_paint_overexposed(), dtgtk_cairo_paint_rawoverexposed(), dtgtk_cairo_paint_softproof(), dtgtk_togglebutton_new(), dt_develop_t::gamut_button, dt_develop_t::iso_12646, dt_develop_t::overexposed, dt_develop_t::profile, dt_develop_t::rawoverexposed, dt_develop_t::softproof_button, tooltip, type, darktable_t::view_manager, and views().
Referenced by dt_dev_toolbox_create().
Definition at line 548 of file dev_toolbox.c.
References darktable, dt_bauhaus_slider_get(), dt_conf_set_int(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_dev_pixelpipe_change_zoom_main(), dt_dev_toolbox_apply_iso_12646_size(), DT_SIGNAL_DARKROOM_UI_CHANGED, and darktable_t::signals.
Referenced by _build_display_popover().
Definition at line 541 of file dev_toolbox.c.
References darktable, dt_bauhaus_slider_get(), dt_conf_set_int(), dt_control_queue_redraw_center(), DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_DARKROOM_UI_CHANGED, and darktable_t::signals.
Referenced by _build_display_popover().
Definition at line 310 of file dev_toolbox.c.
References dt_develop_t::button, dt_develop_t::colorscheme, dt_bauhaus_combobox_get(), dt_dev_pixelpipe_resync_history_main, dt_develop_t::enabled, FALSE, and dt_develop_t::overexposed.
Referenced by _build_overexposed_popover().
Definition at line 318 of file dev_toolbox.c.
References dt_develop_t::button, dt_bauhaus_slider_get(), dt_dev_pixelpipe_resync_history_main, dt_develop_t::enabled, FALSE, dt_develop_t::lower, and dt_develop_t::overexposed.
Referenced by _build_overexposed_popover().
Definition at line 302 of file dev_toolbox.c.
References dt_develop_t::button, dt_bauhaus_combobox_get(), dt_dev_pixelpipe_update_history_main, dt_develop_t::enabled, FALSE, dt_develop_t::mode, and dt_develop_t::overexposed.
Referenced by _build_overexposed_popover().
Definition at line 326 of file dev_toolbox.c.
References dt_develop_t::button, dt_bauhaus_slider_get(), dt_dev_pixelpipe_resync_history_main, dt_develop_t::enabled, FALSE, dt_develop_t::overexposed, and dt_develop_t::upper.
Referenced by _build_overexposed_popover().
|
static |
Definition at line 111 of file dev_toolbox.c.
References dt_dev_toolbox_show_popup(), FALSE, and TRUE.
Referenced by dt_dev_toolbox_connect_popover().
Definition at line 394 of file dev_toolbox.c.
References dt_develop_t::button, dt_develop_t::colorscheme, dt_bauhaus_combobox_get(), dt_dev_pixelpipe_resync_history_main, dt_develop_t::enabled, FALSE, and dt_develop_t::rawoverexposed.
Referenced by _build_rawoverexposed_popover().
Definition at line 386 of file dev_toolbox.c.
References dt_develop_t::button, dt_bauhaus_combobox_get(), dt_dev_pixelpipe_resync_history_main, dt_develop_t::enabled, FALSE, dt_develop_t::mode, and dt_develop_t::rawoverexposed.
Referenced by _build_rawoverexposed_popover().
Definition at line 402 of file dev_toolbox.c.
References dt_develop_t::button, dt_bauhaus_slider_get(), dt_dev_pixelpipe_resync_history_main, dt_develop_t::enabled, FALSE, dt_develop_t::rawoverexposed, and dt_develop_t::threshold.
Referenced by _build_rawoverexposed_popover().
Definition at line 452 of file dev_toolbox.c.
References darktable_t::color_profiles, darktable, dt_bauhaus_combobox_get(), dt_bauhaus_combobox_get_text(), DT_COLORSPACE_FILE, DT_COLORSPACE_SRGB, DT_COLORSPACES_PROFILE_TYPE_SOFTPROOF, DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_dev_pixelpipe_resync_history_main, DT_SIGNAL_CONTROL_PROFILE_USER_CHANGED, FALSE, dt_colorspaces_color_profile_t::filename, dt_colorspaces_color_profile_t::out_pos, profile_changed(), dt_colorspaces_t::profiles, darktable_t::signals, dt_colorspaces_t::softproof_filename, dt_colorspaces_t::softproof_type, TRUE, and dt_colorspaces_color_profile_t::type.
Referenced by _build_softproof_gamut_popover().
|
static |
Definition at line 236 of file dev_toolbox.c.
References _button_clicked(), darktable_t::color_profiles, darktable, DT_PROFILE_GAMUTCHECK, DT_PROFILE_SOFTPROOF, dt_develop_t::gamut_button, dt_colorspaces_t::mode, dt_develop_t::profile, and dt_develop_t::softproof_button.
Referenced by _button_clicked(), and dt_dev_toolbox_create().
| gboolean dt_dev_toolbox_activate_accel | ( | GtkAccelGroup * | accel_group, |
| GObject * | accelerable, | ||
| guint | keyval, | ||
| GdkModifierType | modifier, | ||
| gpointer | data | ||
| ) |
Generic accelerator callbacks: reused by dt_dev_toolbox_add_accels(), and directly usable by any view wiring its own popover-anchored button outside this button set (darkroom's guides and auto-set buttons, for instance). "Activate" simulates a click on data (the button widget); "focus" grabs it and shows its popover (looked up via DT_DEV_TOOLBOX_POPOVER_KEY).
Definition at line 147 of file dev_toolbox.c.
References FALSE, IS_NULL_PTR, and TRUE.
Referenced by dt_dev_toolbox_add_accels(), and gui_init().
| void dt_dev_toolbox_add_accels | ( | struct dt_develop_t * | dev, |
| GtkAccelGroup * | accel_group, | ||
| const char * | category, | ||
| const dt_dev_toolbox_button_t * | buttons, | ||
| size_t | n_buttons | ||
| ) |
Add the same "activate this button" (and, for buttons with a popover, "focus its popover") keyboard accelerators for every button in buttons, on accel_group/category. The action names ("Toggle clipping
indication", "Focus softproof options"...) are the same regardless of which view/accel group they're bound to, since the buttons themselves are shared — only the accelerator group and category differ per caller (e.g. darkroom passes darktable.gui->accels->darkroom_accels and N_("Darkroom/Toolbox"); Studio Capture passes darktable.gui->accels->lighttable_accels, the group it actually connects, and its own category). Call after dt_dev_toolbox_create() so the buttons (and popovers) already exist.
Definition at line 172 of file dev_toolbox.c.
References dt_gui_gtk_t::accels, dt_develop_t::button, darktable, dt_develop_t::display, dt_accels_new_action_shortcut(), dt_dev_toolbox_activate_accel(), DT_DEV_TOOLBOX_DISPLAY, dt_dev_toolbox_focus_accel(), DT_DEV_TOOLBOX_GAMUT, DT_DEV_TOOLBOX_ISO_12646, DT_DEV_TOOLBOX_OVEREXPOSED, DT_DEV_TOOLBOX_RAWOVEREXPOSED, DT_DEV_TOOLBOX_SOFTPROOF, FALSE, dt_develop_t::gamut_button, darktable_t::gui, i, dt_develop_t::iso_12646, dt_develop_t::overexposed, dt_develop_t::profile, dt_develop_t::rawoverexposed, and dt_develop_t::softproof_button.
Referenced by gui_init().
| void dt_dev_toolbox_apply_iso_12646_size | ( | struct dt_develop_t * | dev | ) |
Re-apply dev->roi.border_size from dev->iso_12646.enabled and the "plugins/darkroom/ui/border_size" conf key, then dt_dev_configure() the result. Called by the ISO 12646 toggle, and by any view that needs to resize on iso_12646 changes from its own configure()/resize handling.
Definition at line 38 of file dev_toolbox.c.
References dt_develop_t::border_size, dt_conf_get_int(), dt_dev_configure, DT_PIXEL_APPLY_DPI, dt_develop_t::enabled, dt_develop_t::iso_12646, MIN, dt_develop_t::orig_height, dt_develop_t::orig_width, and dt_develop_t::roi.
Referenced by _button_clicked(), _display_borders_callback(), _studio_configure_dev_roi(), and configure().
Anchor popover to button: right-click, or releasing after a long press, shows it near the pointer. Generic — used for every popover built by dt_dev_toolbox_create(), and reusable for view-owned popovers outside this button set (e.g. darkroom's guides and auto-set popovers).
Definition at line 134 of file dev_toolbox.c.
References _quickbutton_press_release().
Referenced by _build_display_popover(), _build_overexposed_popover(), _build_rawoverexposed_popover(), _build_softproof_gamut_popover(), and gui_init().
| void dt_dev_toolbox_create | ( | struct dt_develop_t * | dev, |
| dt_view_type_flags_t | views, | ||
| const dt_dev_toolbox_button_t * | buttons, | ||
| size_t | n_buttons | ||
| ) |
Create every button listed in buttons for dev, register each into the module toolbox for the given view flag(s), and wire every one of them to a single shared click handler that dispatches by which button fired the event (a g_object_set_data tag, not one callback per button). Each button is stored in its matching dt_develop_t field as it always was (dev->iso_12646.button, dev->overexposed.button, dev->profile.softproof_button...).
Buttons with an options popover (everything except ISO 12646) also get one built here, anchored via dt_dev_toolbox_connect_popover() and filled with the controls generic enough to make sense for any view (thresholds, mode/colorscheme, profile picker, background brightness/margins). The popover's content box is a plain GtkBox, retrievable with gtk_bin_get_child(GTK_BIN(dev->X.floating_window)): a caller wanting extra, view-specific controls (e.g. darkroom's rendering-size and mask-preview-checkerboard additions to Picture display's popover) packs them into that same box and calls gtk_widget_show_all() itself once done — this function does not call it, so callers control when the popover is considered fully assembled. Softproof and gamut still share one popover, built only once both are present in the same call.
Accelerators are NOT wired here — see dt_dev_toolbox_add_accels() — so callers needing them call it separately, after this one.
Definition at line 641 of file dev_toolbox.c.
References _build_display_popover(), _build_overexposed_popover(), _build_rawoverexposed_popover(), _build_softproof_gamut_popover(), _create_one_button(), _update_softproof_gamut_checking(), DT_DEV_TOOLBOX_DISPLAY, DT_DEV_TOOLBOX_GAMUT, DT_DEV_TOOLBOX_ISO_12646, DT_DEV_TOOLBOX_OVEREXPOSED, DT_DEV_TOOLBOX_RAWOVEREXPOSED, DT_DEV_TOOLBOX_SOFTPROOF, FALSE, i, TRUE, and views().
Referenced by gui_init().
| gboolean dt_dev_toolbox_focus_accel | ( | GtkAccelGroup * | accel_group, |
| GObject * | accelerable, | ||
| guint | keyval, | ||
| GdkModifierType | modifier, | ||
| gpointer | data | ||
| ) |
Definition at line 157 of file dev_toolbox.c.
References DT_DEV_TOOLBOX_POPOVER_KEY, dt_dev_toolbox_show_popup(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by dt_dev_toolbox_add_accels(), and gui_init().
| void dt_dev_toolbox_popover_set_preshow | ( | GtkWidget * | popover, |
| void(*)(gpointer user_data) | preshow, | ||
| gpointer | user_data | ||
| ) |
Run preshow (with user_data) right before dt_dev_toolbox_show_popup() shows popover — e.g. to refresh the popover's content from state that changed since it was built. Optional; a popover with none just shows as-is.
Definition at line 66 of file dev_toolbox.c.
References DT_DEV_TOOLBOX_PRESHOW_DATA_KEY, and DT_DEV_TOOLBOX_PRESHOW_FN_KEY.
Referenced by gui_init().
| gboolean dt_dev_toolbox_show_popup | ( | gpointer | popover | ) |
Position and show popover (passed as a bare GtkWidget* so this can be used directly as a glib timeout/idle callback). Exposed so a caller can trigger the same show/anchor path from an accelerator (keyboard-activated "focus this popover" actions, for instance).
Definition at line 72 of file dev_toolbox.c.
References DT_DEV_TOOLBOX_PRESHOW_DATA_KEY, DT_DEV_TOOLBOX_PRESHOW_FN_KEY, dt_gui_get_popup_relative_widget(), FALSE, void(), x, rect::x, and rect::y.
Referenced by _quickbutton_press_release(), and dt_dev_toolbox_focus_accel().