![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/glib_utils.h"#include "common/hash.h"#include "common/logging.h"#include "common/times.h"#include "develop/blend.h"#include "develop/blend_gui.h"#include "develop/develop.h"#include "develop/dev_pixelpipe.h"#include "develop/imageop.h"#include "develop/supervisor.h"#include "math/math.h"#include "system/dtpthread.h"#include "widgets/gdkkeys.h"#include "widgets/accelerators.h"#include "control/control.h"#include "system/macros.h"#include "system/mem_alloc.h"#include "develop/geometry/geometry.h"#include "develop/masks.h"#include "develop/masks_debug.h"#include "develop/masks_gui.h"#include "develop/masks_group.h"#include "develop/masks/masks_distort.h"#include "develop/masks/masks_functions.h"#include "widgets/stroke_raster.h"#include "widgets/bauhaus.h"#include "common/conf.h"#include "control/signal.h"#include "develop/imageop_gui.h"#include "widgets/paint.h"#include "gui/actions/menu.h"#include "widgets/draw.h"#include "gui/application.h"#include <stdlib.h>#include "widgets/togglebutton.h"#include <glib/gstdio.h>
Include dependency graph for masks_gui.c:Go to the source code of this file.
Data Structures | |
| struct | dt_masks_shape_button_def_t |
| struct | dt_masks_shape_buttons_data_t |
| struct | dt_masks_gui_interaction_slider_t |
| struct | _session_outline_sig_t |
| struct | _canvas_frame_t |
Macros | |
| #define | DT_MASKS_SHAPE_BUTTON_COUNT 5 |
| #define | masks_gtk_menu_item_new_bold(label, selected, state, icon) |
Typedefs | |
| typedef struct dt_masks_shape_button_def_t | dt_masks_shape_button_def_t |
| typedef struct dt_masks_shape_buttons_data_t | dt_masks_shape_buttons_data_t |
| typedef struct dt_masks_gui_interaction_slider_t | dt_masks_gui_interaction_slider_t |
| typedef struct _session_outline_sig_t | _session_outline_sig_t |
| typedef struct _canvas_frame_t | _canvas_frame_t |
Functions | |
| static void | _masks_shape_buttons_deactivate (GtkWidget *active_button, dt_masks_shape_buttons_data_t *data) |
| static void | _masks_shape_buttons_deactivate_signal (gpointer instance, GtkWidget *active_button, dt_masks_shape_buttons_data_t *data) |
| void | dt_masks_shape_buttons_deactivate_all (GtkWidget *active_button) |
| static int | _masks_shape_button_index (const dt_masks_shape_buttons_data_t *data, GtkWidget *button) |
| static gboolean | _masks_shape_button_is_current_creation (dt_develop_t *dev, const dt_masks_shape_buttons_data_t *data, const int button_index) |
| static void | _masks_shape_buttons_sync (dt_masks_shape_buttons_data_t *data) |
| static void | _masks_shape_buttons_sync_signal (gpointer instance __attribute__((unused)), dt_masks_shape_buttons_data_t *data) |
| void | dt_masks_shape_buttons_sync_all (void) |
| Make every shape toolbar show the shape currently being created, if any. | |
| static const dt_masks_shape_button_def_t * | _masks_shape_button_def (const dt_masks_type_t type) |
| static gboolean | _masks_shape_icon_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) |
| GtkWidget * | dt_masks_shape_menu_item_new (GtkWidget *menu, const dt_masks_type_t type, GCallback activate_callback, gpointer user_data) |
| Append a menu entry for one shape type: its toolbar icon, then its toolbar label. | |
| static gboolean | _masks_shape_button_pressed (GtkWidget *button, GdkEventButton *event, gpointer user_data) |
| static void | _masks_shape_buttons_destroy (GtkWidget *widget, dt_masks_shape_buttons_data_t *data) |
| GtkWidget * | dt_masks_shape_buttons_create (const dt_masks_shape_buttons_config_t *config) |
| Build a synchronized toolbar for creating masks shapes. | |
| static void | _masks_gui_interaction_commit (dt_masks_gui_interaction_slider_t *data) |
| static void | _masks_gui_interaction_apply_value (dt_masks_gui_interaction_slider_t *data, float value) |
| static void | _masks_gui_menu_item_block_activate (GtkWidget *widget, gpointer user_data) |
| static gboolean | _masks_gui_menu_item_forward_event (GtkWidget *widget, GdkEvent *event, gpointer user_data) |
| static void | _masks_gui_interaction_slider_changed (GtkWidget *widget, gpointer user_data) |
| GtkWidget * | dt_masks_gui_add_interaction_slider (GtkWidget *menu, const char *label, dt_develop_t *dev, const int group_id, const int formid, dt_masks_interaction_t interaction, dt_masks_increment_t increment, float min, float max, float step, float value, int digits, const char *format, float factor, dt_masks_form_gui_t *gui, dt_iop_module_t *module) |
| Append a bauhaus-slider menu item to a mask context menu, bound to one shape interaction (size, fading, rotation, opacity). Shared by the darkroom canvas context menu (dt_masks_create_menu) and the blend module's own shape-list context menus, so both stay in sync. | |
| int | dt_masks_gui_confirm_delete_form_dialog (const char *form_name) |
| gboolean | dt_masks_gui_confirm_permanent_delete (const char *form_name) |
| Ask the user to confirm a permanent shape deletion, gated by the "ask_before_delete_mask_shape" pref. Shows a "Always ask" checkbox that writes back to the pref regardless of the response. Returns TRUE immediately without showing anything when the pref is off. | |
| static gboolean | _masks_gui_resolve_selected_shape (dt_masks_form_gui_t *gui, dt_iop_module_t **module, dt_masks_form_t **sel, int *parentid, int *formid) |
| static void | _masks_gui_remove_from_group_callback (GtkWidget *menu, gpointer user_data) |
| static void | _masks_gui_full_delete_callback (GtkWidget *menu, gpointer user_data) |
| void | _masks_gui_delete_node_callback (GtkWidget *menu, gpointer user_data) |
| static void | _masks_gui_exit_creation_callback (GtkWidget *menu, gpointer user_data) |
| static void | _masks_move_up_down_callback (gpointer user_data, const int up) |
| static void | _masks_moveup_callback (GtkWidget *menu, gpointer user_data) |
| static void | _masks_movedown_callback (GtkWidget *menu, gpointer user_data) |
| static void | _masks_operation_callback (GtkWidget *menu, gpointer user_data) |
| void | dt_masks_gui_populate_interaction_sliders (GtkWidget *menu, dt_develop_t *dev, dt_masks_form_t *form, const int group_id, dt_masks_form_gui_t *gui, dt_iop_module_t *module) |
Append the full set of shape-parameter sliders (size/fading/rotation or curvature/fade/rotation depending on shape type, plus opacity) for form/op_form to menu. op_form is the group-membership entry the sliders read/write (see dt_masks_form_group_t) and must already be a live, COW-safe pointer into the owning group's points list. | |
| GtkWidget * | dt_masks_create_menu (dt_masks_form_gui_t *gui, dt_masks_form_t *form, const dt_masks_form_group_t *formgroup, const float pzx, const float pzy) |
| gboolean | dt_masks_toggle_bezier_node_type (struct dt_iop_module_t *module, struct dt_masks_form_t *mask_form, struct dt_masks_form_gui_t *mask_gui, const int form_index, const struct dt_masks_form_gui_points_t *gui_points, const int node_index, float node[2], float ctrl1[2], float ctrl2[2], dt_masks_points_states_t *state) |
| gboolean | dt_masks_reset_bezier_ctrl_points (struct dt_iop_module_t *module, struct dt_masks_form_t *mask_form, struct dt_masks_form_gui_t *mask_gui, const int form_index, const struct dt_masks_form_gui_points_t *gui_points, const int node_index, dt_masks_points_states_t *state) |
| gboolean | dt_masks_point_is_within_radius (const float point_x, const float point_y, const float center_x, const float center_y, const float squared_radius) |
| Check whether a point lies within a squared radius of a center. | |
| int | dt_masks_find_closest_handle_common (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, int form_index, int node_count_override, dt_masks_border_handle_fn border_handle_cb, dt_masks_curve_handle_fn curve_handle_cb, dt_masks_node_position_fn node_position_cb, dt_masks_distance_fn distance_cb, dt_masks_post_select_fn post_select_cb, void *user_data) |
| Centralized hit-testing for node/handle/segment selection across shapes. | |
| dt_masks_form_group_t * | dt_masks_form_group_find_entry (dt_masks_form_t *group_form, const int form_id, int *out_index) |
Find the group-membership entry for form_id inside group_form's own points list (not recursive into subgroups) – the shared primitive behind every "find this shape's
row within its parent group" call site. | |
| int | dt_masks_group_index_from_formid (const dt_masks_form_t *group_form, int form_id) |
Find any group that currently references formid, searching every top-level group in dev->forms and their nested subgroups (first match wins – a shape used by more than one module has no single "correct" answer). Meant for UI listings that show a shape without already knowing which group (if any) it belongs to, e.g. a flat "all shapes" row. | |
| dt_masks_form_t * | dt_masks_get_visible_form (const dt_develop_t *dev) |
| Return the currently visible form used by the masks GUI. | |
| void | dt_masks_set_visible_form (dt_develop_t *dev, dt_masks_form_t *form) |
| void | dt_masks_gui_init (dt_develop_t *dev) |
| void | dt_masks_gui_cleanup (dt_develop_t *dev) |
| void | dt_masks_gui_set_dragging (dt_masks_form_gui_t *gui) |
| void | dt_masks_gui_reset_dragging (dt_masks_form_gui_t *gui) |
| gboolean | dt_masks_gui_is_dragging (const dt_masks_form_gui_t *gui) |
| dt_masks_form_group_t * | dt_masks_form_group_from_parentid (dt_develop_t *dev, int parent_id, int form_id) |
| Return the group entry for a (parent, form) pair. | |
| dt_masks_form_group_t * | dt_masks_form_get_selected_group (const dt_masks_form_t *mask_form, const dt_masks_form_gui_t *mask_gui) |
| Get the selected group entry from the GUI selection index. | |
| dt_masks_form_group_t * | dt_masks_form_get_selected_group_live (const dt_masks_form_t *mask_form, const dt_masks_form_gui_t *mask_gui) |
| Resolve a "live" selected group entry, even if GUI selection is stale. | |
| static dt_masks_form_t * | _dt_masks_events_get_dispatch_form (dt_masks_form_t *visible_form, const dt_masks_form_gui_t *mask_gui, dt_masks_form_group_t **group_entry, int *parent_id, int *form_index) |
| Resolve the concrete form that should receive an event. | |
| static gboolean | _dt_masks_events_group_update_selection (dt_masks_form_t *group_form, dt_masks_form_gui_t *mask_gui) |
| Update group selection from the current cached cursor before leaf dispatch. | |
| static gboolean | _dt_masks_events_should_update_hover_on_move (dt_masks_form_gui_t *mask_gui) |
| static int | _dt_masks_events_update_hover (dt_masks_form_t *dispatch_form, dt_masks_form_gui_t *mask_gui, const int form_index) |
| static gboolean | _dt_masks_events_cursor_over_form (const dt_masks_form_t *dispatch_form, dt_masks_form_gui_t *mask_gui, const int form_index) |
| static gboolean | _dt_masks_events_group_blocks_motion (dt_masks_form_gui_t *mask_gui) |
| Consume the initial drag motion used to disambiguate scrolling vs dragging in groups. | |
| static gboolean | _dt_masks_events_flush_rebuild_if_needed (struct dt_iop_module_t *module, dt_masks_form_t *dispatch_form, dt_masks_form_gui_t *mask_gui, const int form_index, const int button) |
| Flush a deferred throttled rebuild before drag state is reset. | |
| static gboolean | _set_hinter_message (dt_masks_form_gui_t *mask_gui, const dt_masks_form_t *mask_form) |
| Build and display the on-canvas hint message for masks interactions. | |
| void | dt_masks_init_form_gui (dt_develop_t *dev, dt_masks_form_gui_t *mask_gui) |
| void | dt_masks_soft_reset_form_gui (dt_masks_form_gui_t *mask_gui) |
| void | dt_masks_gui_set_outline_density (dt_masks_form_gui_t *mask_gui, const double image_px_per_device_px) |
| int | dt_masks_gui_outline_step (const dt_develop_t *dev) |
| The density the dev's GUI shows its outlines at, in image pixels between consecutive samples: what the view published through dt_masks_gui_set_outline_density(), 1 for a dev with no GUI state. Implemented in masks_gui.c, which owns that state; declared here because the GUI supplier below is what reads it. | |
| void | dt_masks_gui_form_create (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, int form_index, dt_iop_module_t *module) |
| gboolean | dt_masks_gui_form_create_throttled (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, int form_index, dt_iop_module_t *module, float posx, float posy) |
| void | dt_masks_remove_node (struct dt_iop_module_t *module, dt_masks_form_t *mask_form, int parent_id, dt_masks_form_gui_t *mask_gui, int form_index, int node_index) |
| static gboolean | _masks_remove_shape (struct dt_iop_module_t *module, dt_masks_form_t *mask_form, int parent_id, dt_masks_form_gui_t *mask_gui, int form_index) |
| Remove a shape from the GUI and free its resources. | |
| static int | _masks_gui_form_group_use_count (const dt_develop_t *dev, const int formid) |
| static gboolean | _masks_remove_or_delete_finish (struct dt_iop_module_t *module, dt_masks_form_t *sel, int parent_id, dt_masks_form_gui_t *mask_gui, int form_id, gboolean keep_unused) |
| gboolean | dt_masks_remove_or_delete (struct dt_iop_module_t *module, dt_masks_form_t *sel, int parent_id, dt_masks_form_gui_t *mask_gui, int form_id) |
| If the form to remove is used once, ask to the user if he wants to delete it from the list or just remove and keep for later reuse. | |
| gboolean | dt_masks_remove_shape_from_group (struct dt_iop_module_t *module, dt_masks_form_t *sel, int parent_id, dt_masks_form_gui_t *mask_gui, int form_id) |
| Remove the form from its current group only, keeping it around unused for potential reuse. Never asks for confirmation, since nothing is destroyed. | |
| gboolean | dt_masks_delete_shape (struct dt_iop_module_t *module, dt_masks_form_t *sel, int parent_id, dt_masks_form_gui_t *mask_gui, int form_id) |
| Permanently delete the form from every group and from dev->forms. Gated by dt_masks_gui_confirm_permanent_delete() (itself gated by the "ask_before_delete_mask_shape" pref). | |
| gboolean | dt_masks_form_exit_creation (dt_iop_module_t *module, dt_masks_form_gui_t *mask_gui) |
| gboolean | dt_masks_gui_remove (struct dt_iop_module_t *module, dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, const int parent_id) |
| remove a mask shape or node form from the GUI. This function is used with a popupmenu "Delete" action. | |
| static void | _gui_points_bbox_extend (float *const bbox, const float *const samples, const int count) |
| void | dt_masks_gui_points_update_bbox (dt_masks_form_gui_points_t *gp) |
| void | dt_masks_gui_form_remove (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, int form_index) |
| void | dt_masks_gui_form_test_create (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, dt_iop_module_t *module) |
| void | dt_masks_append_form (dt_develop_t *develop, dt_masks_form_t *mask_form) |
| void | dt_masks_remove_form (dt_develop_t *develop, dt_masks_form_t *mask_form) |
| void | dt_masks_gui_form_save_creation (dt_develop_t *develop, dt_iop_module_t *module, dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui) |
| Save the form creation right after a shape has been finished drawing. | |
| int | dt_masks_events_mouse_leave (struct dt_iop_module_t *module) |
| int | dt_masks_events_mouse_enter (struct dt_iop_module_t *module) |
| gboolean | dt_masks_is_anything_selected (const dt_masks_form_gui_t *mask_gui) |
| gboolean | dt_masks_is_anything_hovered (const dt_masks_form_gui_t *mask_gui) |
| static void | _set_cursor_shape (dt_masks_form_gui_t *mask_gui) |
| static void | _apply_gui_button_pressed_state (dt_masks_form_gui_t *mask_gui, const int button, const uint32_t state, const gboolean shape_was_selected) |
| static void | _dt_masks_events_set_current_pos (const double x, const double y, dt_masks_form_gui_t *mask_gui) |
| Convert the GTK/Cairo widget cursor once for the full mask event chain. | |
| static int | _dt_masks_events_mouse_moved (dt_develop_t *dev, struct dt_iop_module_t *module, double x, double y, double pressure, int which) |
| int | dt_masks_events_mouse_moved (dt_develop_t *dev, struct dt_iop_module_t *module, double x, double y, double pressure, int which) |
| int | dt_masks_events_button_released (dt_develop_t *dev, struct dt_iop_module_t *module, double x, double y, int button, uint32_t state) |
| int | dt_masks_events_button_pressed (dt_develop_t *dev, struct dt_iop_module_t *module, double x, double y, double pressure, int button, int event_type, uint32_t state) |
| int | dt_masks_events_key_pressed (dt_develop_t *dev, struct dt_iop_module_t *module, GdkEventKey *event) |
| dt_masks_interaction_t | dt_masks_scroll_mapping_get (dt_masks_scroll_modifier_t modifier) |
| void | dt_masks_scroll_mapping_set (dt_masks_scroll_modifier_t modifier, dt_masks_interaction_t interaction) |
| const char * | dt_masks_scroll_modifier_name (dt_masks_scroll_modifier_t modifier) |
| const char * | dt_masks_interaction_name (dt_masks_interaction_t interaction) |
| const char * | dt_masks_interaction_alias_name (dt_masks_interaction_t interaction) |
| The other word for a property, when a shape family spells it its own way. | |
| dt_masks_interaction_t | dt_masks_scroll_get_interaction (uint32_t key_state) |
| Resolve a wheel event's key state into the property it edits. | |
| int | dt_masks_events_mouse_scrolled (dt_develop_t *dev, struct dt_iop_module_t *module, double x, double y, int scroll_up, uint32_t key_state, int scrolling_delta) |
| gboolean | dt_masks_node_is_cusp (const dt_masks_form_gui_points_t *gui_points, const int node_index) |
| returns wether a node is a corner or not. A node is a corner if its 2 control handles are at the same position, else it's a curve. | |
| static void | _dt_masks_find_best_attachment_point (const float ray_1[2], const float ray_2[2], const float *points, const int points_count, const float zoom_scale, const int first_pt, const gboolean is_closed_shape, const float offset_factor, float result[2]) |
| Find the best attachment point on the shape contour for a ray crossing the form. | |
| void | dt_masks_draw_source (cairo_t *cr, dt_masks_form_gui_t *mask_gui, const int form_index, const int node_count, const float zoom_scale, struct dt_masks_gui_center_point_t *center_point, const shape_draw_function_t *draw_shape_func) |
| Draw the source for a correction mask. | |
| void | dt_masks_draw_path_seg_by_seg (cairo_t *cr, dt_masks_form_gui_t *mask_gui, const int form_index, const float *points, const int points_count, const int node_count, const float zoom_scale, const gboolean round_ends) |
| static void | _session_sigs_reset (void) |
| static int | _session_sigs_take (const dt_masks_form_gui_t *gui, _session_outline_sig_t *out, const int max) |
| Take the signature of every cached outline. | |
| static void | _bbox_include_array (const float *const array, const int count, double bbox[4], gboolean *any) |
| Union of the cached outlines, or FALSE when there is nothing to bound. | |
| static gboolean | _session_bbox_from_points (const dt_masks_form_gui_t *gui, double bbox[4]) |
| static gboolean | _session_clip (cairo_t *cr, const float zoom_scale) |
| Clip to the session's area, with room for the stroke's own width. | |
| static void | _session_pattern_reset (void) |
| Drop the session outlines. Safe to call when nothing is cached. | |
| static void | _session_bbox_invalidate (void) |
| static uint64_t | _session_pattern_hash (cairo_t *cr, const dt_masks_form_gui_t *creation_gui, const uint64_t generation, const int count) |
| What the cached rendering is a rendering OF. | |
| static void | _session_gui_reset (void) |
| static void | _masks_draw_creation_session_forms (dt_develop_t *develop, dt_iop_module_t *module, cairo_t *cr, const float zoom_scale, const dt_masks_form_gui_t *creation_gui) |
| void | dt_masks_events_post_expose (dt_develop_t *dev, struct dt_iop_module_t *module, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery) |
| static cairo_surface_t * | _canvas_acquire (const int width, const int height, const double device_scale) |
| static void | _canvas_clear (cairo_surface_t *canvas, const cairo_rectangle_int_t *rect) |
| static void | _rect_include (cairo_rectangle_int_t *rect, gboolean *any, const double x, const double y, const int margin) |
| static gboolean | header_reach_wanted (const int nodes, const int points_count) |
| static double | _canvas_device_scale (cairo_t *cr) |
| static void | _bound_include_points (cairo_t *canvas_cr, const float *const array, const int limit, const double scale, cairo_rectangle_int_t *rect, gboolean *any) |
| static void | _bound_include_headers (cairo_t *canvas_cr, const dt_masks_form_gui_points_t *const pts, const int nodes, const double scale, cairo_rectangle_int_t *rect, gboolean *any) |
| static double | _bound_header_reach (cairo_t *canvas_cr, const dt_masks_form_gui_points_t *const pts, const int nodes, const double scale) |
| static int | _outline_nodes (dt_develop_t *dev, const dt_masks_form_t *form, const int index) |
| static void | _canvas_cairo_bound (cairo_t *canvas_cr, const dt_masks_form_gui_t *gui, cairo_rectangle_int_t *rect, gboolean *any) |
| static void | _session_bound_include (cairo_t *canvas_cr, const float zoom_scale, cairo_rectangle_int_t *rect, gboolean *any) |
| static gboolean | _overlay_clip_to_bound (cairo_t *mask_draw, const dt_masks_form_gui_t *gui, const _canvas_frame_t *const frame, cairo_rectangle_int_t *bound, const float zoom_scale) |
| static gboolean | _canvas_begin (cairo_t *cr, const int width, const int height, _canvas_frame_t *frame) |
| static void | _canvas_composite (cairo_t *cr, const _canvas_frame_t *frame, cairo_surface_t *surface, const int x0, const int y0, const int x1, const int y1) |
| static void | _canvas_end (cairo_t *cr, const _canvas_frame_t *frame, const cairo_rectangle_int_t *dirty) |
| static uint64_t | _static_layer_hash_samples (uint64_t hash, const float *const array, const int count) |
| static uint64_t | _static_layer_key_compute (cairo_t *canvas_cr, const float zoom_scale, const dt_masks_form_t *form, const dt_masks_form_gui_t *gui) |
| static gboolean | _static_layer_ensure (const _canvas_frame_t *frame, cairo_t *canvas_cr, const float zoom_scale, dt_masks_form_t *form, dt_masks_form_gui_t *gui, gboolean *rebuilt) |
| static gboolean | _static_layer_applies (const dt_masks_form_t *form, const dt_masks_form_gui_t *gui) |
| static int | _overlay_skip_of (const dt_masks_form_gui_points_t *const pts, const int i) |
| static void | _overlay_dump_outline (const dt_masks_form_gui_points_t *const pts, const char *path) |
| static void | _overlay_dump (const _canvas_frame_t *const frame, const dt_masks_form_gui_t *const gui, const cairo_rectangle_int_t *const dirty) |
| void | dt_masks_overlay_queue_redraw (GtkWidget *widget) |
| static void | _overlay_damage_record (cairo_t *cr, const _canvas_frame_t *const frame, const cairo_rectangle_int_t *dirty) |
| static gboolean | _overlay_apply_transform (cairo_t *mask_draw, dt_develop_t *develop, const dt_masks_overlay_transform_t *transform, const int width, const int height) |
| static void | _overlay_finish (cairo_t *cr, const _canvas_frame_t *const frame, const cairo_rectangle_int_t *dirty, const gboolean darkroom_frame, const gboolean layered) |
| static void | _overlay_draw_form (cairo_t *cr, const float zoom_scale, dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, const gboolean layered) |
| static gboolean | _overlay_dirty (const _canvas_frame_t *frame, const cairo_rectangle_int_t *cairo_bound, const gboolean cairo_bounded, cairo_rectangle_int_t *dirty) |
| void | dt_masks_events_post_expose_with (dt_develop_t *dev, struct dt_iop_module_t *module, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery, const dt_masks_overlay_transform_t *transform) |
Draw the mask overlay with an explicit mapping; transform NULL means the viewport's. | |
| void | dt_masks_clear_form_gui (dt_develop_t *develop) |
| void | dt_masks_change_form_gui (dt_develop_t *dev, dt_masks_form_t *new_form) |
| void | dt_masks_reset_form_gui (dt_develop_t *dev) |
| void | dt_masks_reset_show_masks_icons (dt_develop_t *dev) |
| static void | _menu_no_masks (struct dt_iop_module_t *module) |
| static void | _menu_add_shape (struct dt_iop_module_t *module, dt_masks_type_t type) |
| static void | _menu_add_exist (dt_iop_module_t *module, int form_id) |
| void | dt_masks_group_update_name (dt_iop_module_t *module) |
| void | dt_masks_iop_combo_populate (GtkWidget *widget, void *data) |
| void | dt_masks_iop_value_changed_callback (GtkWidget *widget, struct dt_iop_module_t *module) |
| float | dt_masks_form_get_interaction_value (dt_develop_t *dev, const int group_id, const int formid, dt_masks_interaction_t interaction) |
| gboolean | dt_masks_form_get_gravity_center (dt_develop_t *dev, const dt_masks_form_t *mask_form, float center[2], float *area) |
| int | dt_masks_center_view_on_form (dt_develop_t *dev, const dt_masks_form_t *mask_form) |
| Center the darkroom ROI on a mask form gravity center. | |
| float | dt_masks_form_set_interaction_value (dt_develop_t *dev, const int group_id, const int formid, dt_masks_interaction_t interaction, float value, dt_masks_increment_t increment, int flow, dt_masks_form_gui_t *mask_gui, dt_iop_module_t *module) |
| const char * | _get_mask_plugin (dt_masks_form_t *mask_form) |
| float | dt_masks_apply_increment (float current, float amount, dt_masks_increment_t increment, int flow) |
| Apply a scroll increment to a scalar value. | |
| float | dt_masks_apply_increment_precomputed (float current, float amount, float scale_amount, float offset_amount, dt_masks_increment_t increment) |
| Apply a scroll increment using precomputed scale/offset factors. | |
| float | dt_masks_get_set_conf_value (dt_masks_form_t *mask_form, char *feature, float new_value, float value_min, float value_max, dt_masks_increment_t increment, int flow) |
| Change a numerical property of a mask shape, either by in/de-crementing the current value or setting it in an absolute fashion, then save it to configuration. | |
| float | dt_masks_get_set_conf_value_with_toast (dt_masks_form_t *mask_form, const char *feature, float amount, float value_min, float value_max, dt_masks_increment_t increment, int flow, const char *toast_fmt, float toast_scale) |
| Update a mask configuration value and emit a toast message. | |
| dt_masks_form_group_t * | dt_masks_group_add_form_with_state (dt_develop_t *dev, dt_masks_form_t *group_form, dt_masks_form_t *mask_form, const int parentid, const dt_masks_state_t state, const float opacity) |
| dt_masks_form_group_t * | dt_masks_group_add_form (dt_develop_t *dev, dt_masks_form_t *group_form, dt_masks_form_t *mask_form) |
| void | dt_masks_group_ungroup (dt_develop_t *dev, dt_masks_form_t *dest_group, dt_masks_form_t *group_form) |
| int | dt_masks_point_in_form_exact (const float *test_points, int test_point_count, const float *form_points, int form_points_start, int form_points_count, const dt_masks_skip_range_t *skips, int skip_count) |
| Check whether any 2D point in pts[] lies inside the form points[]. | |
| void | dt_masks_select_form (dt_develop_t *dev, struct dt_iop_module_t *module, dt_masks_form_t *selected_form) |
| Select or clear the current mask form, notifying the owning module if needed. | |
| void | dt_masks_set_source_pos_initial_state (dt_masks_form_gui_t *mask_gui, const uint32_t key_state) |
| Decide initial source positioning mode for clone masks. | |
| void | dt_masks_set_source_pos_initial_value (dt_masks_form_gui_t *mask_gui, dt_masks_form_t *mask_form) |
| Initialize the clone source position based on current GUI state. | |
| void | dt_masks_calculate_source_pos_origin (dt_masks_form_gui_t *mask_gui, const float initial_xpos, const float initial_ypos, const float xpos, const float ypos, float *pos_x, float *pos_y, const int adding) |
| Compute preview-space source position for drawing the clone indicator. | |
| float | dt_masks_rotate_with_anchor (dt_develop_t *develop, const float anchor[2], const float center[2], dt_masks_form_gui_t *mask_gui) |
| Compute rotation angle (degrees) around a center using an anchor point. | |
| void | dt_masks_creation_mode_quit (dt_masks_form_gui_t *mask_gui) |
| Exit mask creation mode, restoring cursor visibility and resetting GUI state. | |
| gboolean | dt_masks_creation_mode_enter (dt_develop_t *dev, dt_iop_module_t *module, const dt_masks_type_t type) |
| Enter mask creation mode for a given shape type. | |
| void | dt_masks_group_entry_apply_operation (struct dt_masks_form_group_t *group_entry, const dt_masks_state_t apply_state) |
| Apply a mask state operation on a group entry. | |
| void | dt_masks_set_edit_mode (struct dt_iop_module_t *module, dt_masks_edit_mode_t value) |
| int | dt_masks_form_change_opacity (dt_develop_t *dev, dt_masks_form_t *mask_form, int parent_id, int scroll_up, const int flow) |
| static void | _paint_mask_backdrop (cairo_t *cr, dt_develop_t *dev, dt_masks_form_t *form, const int width, const int height) |
| gboolean | dt_masks_debug_write_png (dt_develop_t *dev, dt_masks_form_t *form, const dt_masks_debug_request_t *request, const char *path) |
Render form per request and write it to path as a PNG. | |
| static void | _emit_run (cairo_t *cr, const float *const points, const int first, const int last, const double min_step2) |
Append a shape's outline to cr as the COMPLEMENT of its exclusion list. | |
| void | dt_masks_draw_outline_runs (cairo_t *cr, const float *const points, const int first, const int last, const dt_masks_skip_range_t *skips, const int skip_count) |
| int | dt_masks_preview_add_clone_source (dt_masks_form_gui_t *gui, dt_masks_preview_buffers_t *preview) |
| int | dt_masks_points_shift_to_source (dt_develop_t *dev, const dt_iop_module_t *module, float **points, int *points_count, const float xs, const float ys, const int first_shifted) |
Variables | |
| static const dt_masks_shape_button_def_t | _masks_shape_button_defs [] |
| static double | _overlay_pointer [2] = { 0.0, 0.0 } |
| static double | _overlay_pointer_delta [2] = { 0.0, 0.0 } |
| static gboolean | _overlay_pointer_valid = FALSE |
| static const char *const | _scroll_conf_keys [DT_MASKS_SCROLL_MODIFIER_LAST] |
| static const char *const | _interaction_conf_values [DT_MASKS_INTERACTION_LAST] = { "none", "size", "fading", "opacity", "rotation" } |
| static dt_masks_form_gui_t | _session_gui = { 0 } |
| Draw completed shapes from the current creation session. | |
| static gboolean | _session_gui_inited = FALSE |
| static uint64_t | _session_gui_generation = 0 |
| static int | _session_gui_count = 0 |
| static cairo_pattern_t * | _session_pattern = NULL |
| static uint64_t | _session_pattern_key = 0 |
| static gboolean | _session_bbox_valid = FALSE |
| static double | _session_bbox [4] = { 0.0, 0.0, 0.0, 0.0 } |
| static _session_outline_sig_t * | _session_sigs = NULL |
| static int | _session_sigs_count = 0 |
| static cairo_surface_t * | _canvas = NULL |
| static int | _canvas_width = 0 |
| static int | _canvas_height = 0 |
| static cairo_surface_t * | _static_layer = NULL |
| static int | _static_layer_width = 0 |
| static int | _static_layer_height = 0 |
| static uint64_t | _static_layer_key = 0 |
| static cairo_rectangle_int_t | _overlay_damage = { 0, 0, 0, 0 } |
| static gboolean | _overlay_damage_valid = FALSE |
| #define DT_MASKS_SHAPE_BUTTON_COUNT 5 |
Definition at line 58 of file masks_gui.c.
Definition at line 780 of file masks_gui.c.
| typedef struct _canvas_frame_t _canvas_frame_t |
| typedef struct _session_outline_sig_t _session_outline_sig_t |
| typedef struct dt_masks_shape_button_def_t dt_masks_shape_button_def_t |
| typedef struct dt_masks_shape_buttons_data_t dt_masks_shape_buttons_data_t |
|
static |
Definition at line 2715 of file masks_gui.c.
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::border_toggling, dt_masks_form_gui_t::creation, dt_masks_gui_set_dragging(), dt_modifier_is(), DT_PRIMARY_MASK, FALSE, dt_masks_form_gui_t::form_rotating, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::gradient_toggling, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, IS_NULL_PTR, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_selected, state, and TRUE.
Referenced by dt_masks_events_button_pressed().
|
static |
Union of the cached outlines, or FALSE when there is nothing to bound.
Definition at line 3743 of file masks_gui.c.
References bbox, i, IS_NULL_PTR, TRUE, and x.
Referenced by _session_bbox_from_points().
|
static |
Definition at line 4178 of file masks_gui.c.
References header_reach_wanted(), IS_NULL_PTR, k, MAX, dt_masks_form_gui_points_t::points, and dt_masks_form_gui_points_t::points_count.
Referenced by _canvas_cairo_bound().
|
static |
Definition at line 4162 of file masks_gui.c.
References _bound_include_points(), dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, IS_NULL_PTR, MIN, dt_masks_form_gui_points_t::points, dt_masks_form_gui_points_t::points_count, dt_masks_form_gui_points_t::source, and dt_masks_form_gui_points_t::source_count.
Referenced by _canvas_cairo_bound().
|
static |
Definition at line 4148 of file masks_gui.c.
References _rect_include(), i, and x.
Referenced by _bound_include_headers().
|
static |
Definition at line 4042 of file masks_gui.c.
References _canvas, _canvas_height, _canvas_width, height, IS_NULL_PTR, and width.
Referenced by _canvas_begin().
|
static |
Definition at line 4296 of file masks_gui.c.
References _canvas_acquire(), _canvas_frame_t::canvas, _canvas_frame_t::cr, _canvas_frame_t::device_scale, dt_stroke_raster_touched_reset(), FALSE, height, _canvas_frame_t::height, IS_NULL_PTR, matrix, MAX, MIN, TRUE, width, _canvas_frame_t::width, _canvas_frame_t::x, and _canvas_frame_t::y.
Referenced by dt_masks_events_post_expose_with().
|
static |
Definition at line 4216 of file masks_gui.c.
References _bound_header_reach(), _bound_include_headers(), _canvas_device_scale(), _outline_nodes(), dt_masks_form_gui_t::dev, DT_DRAW_RADIUS_NODE_SELECTED, DT_DRAW_SCALE_ARROW, dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, MAX, dt_masks_form_gui_t::points, dt_masks_form_t::type, rect::width, rect::x, and rect::y.
Referenced by _overlay_clip_to_bound().
|
static |
Definition at line 4067 of file masks_gui.c.
References MAX, MIN, rect::width, rect::x, and rect::y.
Referenced by _canvas_end(), and _static_layer_ensure().
|
static |
Definition at line 4353 of file masks_gui.c.
References _canvas_frame_t::device_scale, _canvas_frame_t::x, and _canvas_frame_t::y.
Referenced by _canvas_end(), and _overlay_finish().
|
static |
Definition at line 4138 of file masks_gui.c.
Referenced by _canvas_cairo_bound(), and _session_bound_include().
|
static |
Definition at line 4372 of file masks_gui.c.
References _canvas_clear(), _canvas_composite(), _canvas_frame_t::canvas, _canvas_frame_t::height, and _canvas_frame_t::width.
Referenced by _overlay_finish().
|
static |
Definition at line 1719 of file masks_gui.c.
References dist(), DT_GUI_MOUSE_EFFECT_RADIUS, FALSE, dt_masks_form_t::functions, dt_masks_functions_t::get_distance, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_gui_t::pos.
Referenced by dt_masks_events_mouse_scrolled().
|
static |
Flush a deferred throttled rebuild before drag state is reset.
Definition at line 1760 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_get_wtime(), dt_masks_gui_form_create(), dt_masks_gui_is_dragging(), FALSE, IS_NULL_PTR, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::rebuild_pending, and TRUE.
Referenced by dt_masks_events_button_released().
|
static |
Resolve the concrete form that should receive an event.
Visible groups expose one selected child to the event path. Non-group forms dispatch to themselves.
Definition at line 1568 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_masks_form_get_selected_group_live(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_form_group_t::formid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_group_t::parentid, and dt_masks_form_t::type.
Referenced by _dt_masks_events_mouse_moved(), dt_masks_events_button_pressed(), dt_masks_events_button_released(), dt_masks_events_key_pressed(), and dt_masks_events_mouse_scrolled().
|
static |
Consume the initial drag motion used to disambiguate scrolling vs dragging in groups.
Definition at line 1741 of file masks_gui.c.
References DT_GUI_MOUSE_EFFECT_RADIUS, FALSE, IS_NULL_PTR, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::scrollx, dt_masks_form_gui_t::scrolly, and TRUE.
Referenced by _dt_masks_events_mouse_moved().
|
static |
Update group selection from the current cached cursor before leaf dispatch.
If a handle on the currently selected child is already hovered, keep that child selected. Otherwise, fall back to per-shape hit testing to resolve the leaf form under the cursor.
Definition at line 1600 of file masks_gui.c.
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::dev, dist(), DT_GUI_MOUSE_EFFECT_RADIUS, dt_masks_form_get_selected_group_live(), dt_masks_form_update_gravity_center(), dt_masks_get_from_id(), dt_masks_is_anything_hovered(), DT_MASKS_IS_CLOSED_SHAPE, DT_MASKS_IS_OPEN_SHAPE, dt_masks_soft_reset_form_gui(), FALSE, dt_masks_form_group_t::formid, dt_masks_form_t::functions, dt_masks_functions_t::get_distance, dt_masks_form_t::gravity_center, dt_masks_form_t::gravity_center_valid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_t::points, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::raw_pos, TRUE, and dt_masks_form_t::type.
Referenced by dt_masks_events_button_pressed().
|
static |
Definition at line 2851 of file masks_gui.c.
References _dt_masks_events_get_dispatch_form(), _dt_masks_events_group_blocks_motion(), _dt_masks_events_set_current_pos(), _dt_masks_events_should_update_hover_on_move(), _dt_masks_events_update_hover(), _set_cursor_shape(), _set_hinter_message(), dt_develop_t::darkroom_skip_mouse_events, dt_masks_cow_touch(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_develop_t::form_gui, dt_masks_form_t::functions, IS_NULL_PTR, dt_masks_functions_t::mouse_moved, dt_masks_form_t::type, and x.
Referenced by dt_masks_events_mouse_moved().
|
static |
Convert the GTK/Cairo widget cursor once for the full mask event chain.
The event entry points are the only place where widget-space x, y are consumed. Downstream handlers reuse the cached positions:
mask_gui->rel_pos: normalized output-image coordinatesmask_gui->pos: absolute output-image coordinatesmask_gui->raw_pos: absolute raw input-image coordinates Definition at line 2796 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_dev_coordinates_image_abs_to_raw_abs(), dt_dev_coordinates_image_norm_to_image_abs(), dt_dev_coordinates_widget_to_image_norm(), IS_NULL_PTR, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::raw_pos, dt_masks_form_gui_t::rel_pos, and x.
Referenced by _dt_masks_events_mouse_moved(), dt_masks_events_button_pressed(), dt_masks_events_button_released(), and dt_masks_events_mouse_scrolled().
|
static |
Definition at line 1703 of file masks_gui.c.
References dt_masks_form_gui_t::border_toggling, dt_masks_form_gui_t::creation, dt_masks_gui_is_dragging(), dt_masks_gui_should_hit_test(), FALSE, dt_masks_form_gui_t::form_rotating, dt_masks_form_gui_t::gradient_toggling, and IS_NULL_PTR.
Referenced by _dt_masks_events_mouse_moved().
|
static |
Definition at line 1711 of file masks_gui.c.
References dt_masks_form_t::functions, IS_NULL_PTR, and dt_masks_functions_t::update_hover.
Referenced by _dt_masks_events_mouse_moved(), dt_masks_events_button_pressed(), and dt_masks_events_mouse_scrolled().
|
static |
Find the best attachment point on the shape contour for a ray crossing the form.
The best point is the one with the smallest positive projection along the ray. The result is offset from the contour by a given distance along the ray axis, oriented toward the center of the ray segment [ray_2, ray_1].
| ray_1 | First point of the ray |
| ray_2 | Second point of the ray |
| points | Array of points defining the shape contour |
| points_count | Number of points in the contour |
| first_pt | Index of the first point to consider |
| is_closed_shape | Whether the contour is closed |
| result | Array to store the resulting attachment point |
Definition at line 3307 of file masks_gui.c.
References DT_PIXEL_APPLY_DPI, f_inv_sqrtf(), and i.
Referenced by dt_masks_draw_source().
|
inlinestatic |
Append a shape's outline to cr as the COMPLEMENT of its exclusion list.
Samples [first, last) are emitted as one sub-path per run between the spans in skips, which are the places the offset curve doubles back on itself and must not be shown.
There is one implementation of this walk because there was very nearly none: the encoding it replaces blanked the excluded samples to NaN inside the point buffer, which each shape then tested for in its own copy of the loop. That is an encoding hidden in a buffer of plain floats – invisible to any consumer that does not already know, and silently wrong for one that forgets. Two consumers had forgotten: the polygon's outline drew its folds, and the brush's per-node border handle lost both its dash and its drag wherever a blanked sample was the nearest one.
Emitting runs also makes a hole a hole. Skipping excluded samples with the pen down turns the next one into a line_to, so each span comes out as a straight chord across the shape – measured on issue #1313's brush at 50 to 137 pixels, one per node. A new sub-path per run cannot do that, and stroking a path of several sub-paths costs nothing.
skips must be sorted and disjoint (dt_masks_outline_boundary_skips() guarantees it); pass NULL and 0 for a shape with nothing to exclude.
It lives here rather than in widgets/draw.h with the other drawing helpers because it needs both cairo and the masks vocabulary, and a widget header must not inherit the latter – that would invert the layering. masks_gui.c already has both. Append samples [first, last) as ONE cairo sub-path, decimated to what the context can show. A sub-path per run is what makes an excluded span absent rather than a shortcut across it: skipping samples with the pen down turns the next one into a line_to, and the span comes out as a straight chord.
Definition at line 6023 of file masks_gui.c.
Referenced by dt_masks_draw_outline_runs().
| const char * _get_mask_plugin | ( | dt_masks_form_t * | mask_form | ) |
Definition at line 5236 of file masks_gui.c.
References DT_MASKS_CLONE, DT_MASKS_NON_CLONE, and dt_masks_form_t::type.
Referenced by dt_masks_get_set_conf_value().
|
static |
Definition at line 2408 of file masks_gui.c.
Referenced by dt_masks_gui_points_update_bbox().
|
static |
Definition at line 3845 of file masks_gui.c.
References _session_bbox, _session_bbox_from_points(), _session_bbox_valid, _session_clip(), _session_gui, _session_gui_count, _session_gui_generation, _session_gui_inited, _session_gui_reset(), _session_pattern, _session_pattern_hash(), _session_pattern_key, _session_pattern_reset(), _session_sigs, _session_sigs_count, _session_sigs_take(), dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_formids, dt_masks_form_gui_t::dev, dt_alloc_align(), DT_DEBUG_MASKS, DT_DEBUG_PERF, dt_free_align, dt_geometry_chain_generation(), dt_get_debug_flags(), dt_get_wtime(), dt_masks_form_gui_points_free(), dt_masks_get_from_id(), dt_masks_gui_form_create(), dt_masks_gui_outline_step(), dt_masks_init_form_gui(), dt_print(), dt_masks_form_gui_t::edit_mode, FALSE, dt_masks_form_t::functions, dt_develop_t::geometry_chain, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, matrix, MAX, dt_masks_form_gui_t::outline_step_built, dt_masks_form_t::points, dt_masks_form_gui_t::points, dt_masks_functions_t::post_expose, TRUE, dt_masks_form_t::type, and dt_masks_form_gui_t::type.
Referenced by dt_masks_events_post_expose_with().
Definition at line 679 of file masks_gui.c.
References dt_masks_form_gui_t::creation, dt_masks_form_gui_t::dev, dt_dev_add_history_item, dt_masks_form_exit_creation(), dt_masks_form_get_selected_group(), dt_masks_get_from_id(), dt_masks_get_visible_form(), dt_masks_remove_node(), dt_masks_form_group_t::formid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_group_t::parentid, and TRUE.
Referenced by _polygon_populate_context_menu(), and dt_masks_create_menu().
Definition at line 716 of file masks_gui.c.
References dt_masks_form_exit_creation(), and IS_NULL_PTR.
Referenced by dt_masks_create_menu().
|
static |
Definition at line 2094 of file masks_gui.c.
References DT_MASKS_GROUP, dt_masks_form_group_t::formid, dt_develop_t::forms, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by dt_masks_remove_or_delete().
Definition at line 668 of file masks_gui.c.
References _masks_gui_resolve_selected_shape(), and dt_masks_delete_shape().
Referenced by dt_masks_create_menu().
|
static |
Definition at line 407 of file masks_gui.c.
References _masks_gui_interaction_commit(), delta, dt_masks_gui_interaction_slider_t::dev, dt_masks_form_set_interaction_value(), DT_MASKS_INCREMENT_ABSOLUTE, DT_MASKS_INCREMENT_SCALE, dt_masks_gui_interaction_slider_t::formid, dt_masks_gui_interaction_slider_t::group_id, dt_masks_gui_interaction_slider_t::gui, dt_masks_gui_interaction_slider_t::increment, dt_masks_gui_interaction_slider_t::interaction, IS_NULL_PTR, dt_masks_gui_interaction_slider_t::last_value, and value.
Referenced by _masks_gui_interaction_slider_changed().
|
static |
Definition at line 398 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_dev_add_history_item, DT_MASKS_EVENT_UPDATE, DT_SIGNAL_MASK_CHANGED, dt_masks_gui_interaction_slider_t::formid, dt_masks_gui_interaction_slider_t::group_id, dt_masks_gui_interaction_slider_t::gui, IS_NULL_PTR, and TRUE.
Referenced by _masks_gui_interaction_apply_value().
Definition at line 511 of file masks_gui.c.
References _masks_gui_interaction_apply_value(), dt_masks_gui_interaction_slider_t::dev, dt_bauhaus_slider_get(), and IS_NULL_PTR.
Referenced by dt_masks_gui_add_interaction_slider().
Definition at line 431 of file masks_gui.c.
Referenced by dt_masks_gui_add_interaction_slider().
|
static |
Definition at line 436 of file masks_gui.c.
References copy(), FALSE, IS_NULL_PTR, dt_masks_gui_interaction_slider_t::slider, TRUE, and x.
Referenced by dt_masks_gui_add_interaction_slider().
Definition at line 656 of file masks_gui.c.
References _masks_gui_resolve_selected_shape(), and dt_masks_remove_shape_from_group().
Referenced by dt_masks_create_menu().
|
static |
Definition at line 634 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_masks_form_get_selected_group(), dt_masks_get_from_id(), dt_masks_get_visible_form(), FALSE, dt_masks_form_group_t::formid, dt_masks_form_gui_t::group_selected, dt_develop_t::gui_module, IS_NULL_PTR, dt_masks_form_group_t::parentid, and TRUE.
Referenced by _masks_gui_full_delete_callback(), and _masks_gui_remove_from_group_callback().
|
static |
Definition at line 724 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_masks_cow_touch(), DT_MASKS_EVENT_CHANGE, dt_masks_form_get_selected_group(), dt_masks_form_move(), dt_masks_get_from_id(), dt_masks_get_visible_form(), DT_MASKS_GROUP, DT_SIGNAL_MASK_CHANGED, dt_masks_form_group_t::formid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_group_t::parentid, and dt_masks_form_t::type.
Referenced by _masks_movedown_callback(), and _masks_moveup_callback().
Definition at line 751 of file masks_gui.c.
References _masks_move_up_down_callback().
Referenced by dt_masks_create_menu().
Definition at line 746 of file masks_gui.c.
References _masks_move_up_down_callback().
Referenced by dt_masks_create_menu().
Contextual menu
Definition at line 758 of file masks_gui.c.
References dt_control_log(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_MASKS_EVENT_UPDATE, dt_masks_group_entry_apply_operation(), DT_MASKS_STATE_IS_COMBINE_OP, DT_SIGNAL_MASK_CHANGED, dt_masks_form_group_t::formid, IS_NULL_PTR, and dt_masks_form_group_t::parentid.
|
static |
Definition at line 2123 of file masks_gui.c.
References _masks_remove_shape(), dt_masks_form_gui_t::dev, dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_dev_add_history_item, dt_dev_masks_selection_change(), dt_free, dt_masks_change_form_gui(), dt_masks_clear_form_gui(), dt_masks_cow_touch(), DT_MASKS_EVENT_DELETE, DT_MASKS_EVENT_REMOVE, dt_masks_form_delete(), dt_masks_get_from_id(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_select_form(), DT_SIGNAL_MASK_CHANGED, dt_masks_form_gui_t::edit_mode, FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_t::formid, dt_masks_form_group_t::formid, g_list_shorter_than(), dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_t::points, res, TRUE, and dt_masks_form_t::type.
Referenced by dt_masks_delete_shape(), dt_masks_remove_or_delete(), and dt_masks_remove_shape_from_group().
|
static |
Remove a shape from the GUI and free its resources.
| module | The module owning the mask |
| form | The form to remove |
| parentid | The parent ID of the form |
| gui | The GUI state |
| index | The index of the form in the group |
Definition at line 2050 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_free, dt_masks_change_form_gui(), dt_masks_clear_form_gui(), dt_masks_cow_touch(), dt_masks_form_delete(), dt_masks_get_from_id(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_form_gui_t::edit_mode, dt_masks_form_t::formid, dt_masks_form_group_t::formid, g_list_shorter_than(), IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _masks_remove_or_delete_finish(), and dt_masks_gui_remove().
|
static |
Definition at line 181 of file masks_gui.c.
References _masks_shape_button_defs, i, and type.
Referenced by dt_masks_shape_menu_item_new().
|
static |
Definition at line 118 of file masks_gui.c.
References dt_masks_shape_buttons_data_t::buttons, DT_MASKS_SHAPE_BUTTON_COUNT, i, and IS_NULL_PTR.
Referenced by _masks_shape_button_pressed().
|
static |
Definition at line 129 of file masks_gui.c.
References dt_masks_shape_buttons_data_t::config, dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_module, dt_masks_shape_buttons_config_t::creation_module, dt_masks_get_visible_form(), DT_MASKS_IS_RETOUCHE, FALSE, dt_develop_t::form_gui, IS_NULL_PTR, dt_masks_form_t::type, and dt_masks_shape_buttons_data_t::types.
Referenced by _masks_shape_button_pressed(), and _masks_shape_buttons_sync().
|
static |
Definition at line 239 of file masks_gui.c.
References _masks_shape_button_index(), _masks_shape_button_is_current_creation(), dt_masks_shape_buttons_config_t::can_start, dt_masks_shape_buttons_data_t::config, dt_control_queue_redraw_center(), dt_gui_center_widget(), dt_gui_widgets_suppressed(), dt_masks_creation_mode_enter(), dt_masks_form_exit_creation(), dt_masks_shape_buttons_deactivate_all(), dt_masks_shape_buttons_config_t::exited, FALSE, dt_masks_shape_buttons_config_t::form_type, IS_NULL_PTR, dt_masks_shape_buttons_config_t::started, TRUE, type, dt_masks_shape_buttons_data_t::types, and dt_masks_shape_buttons_config_t::user_data.
Referenced by dt_masks_shape_buttons_create().
|
static |
Definition at line 94 of file masks_gui.c.
References dt_masks_shape_buttons_data_t::buttons, DT_MASKS_SHAPE_BUTTON_COUNT, FALSE, i, and IS_NULL_PTR.
Referenced by _masks_shape_buttons_deactivate_signal().
|
static |
Definition at line 107 of file masks_gui.c.
References _masks_shape_buttons_deactivate().
Referenced by _masks_shape_buttons_destroy(), and dt_masks_shape_buttons_create().
|
static |
Definition at line 293 of file masks_gui.c.
References _masks_shape_buttons_deactivate_signal(), _masks_shape_buttons_sync_signal(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, and dt_free.
Referenced by dt_masks_shape_buttons_create().
|
static |
Definition at line 151 of file masks_gui.c.
References _masks_shape_button_is_current_creation(), dt_masks_shape_buttons_data_t::buttons, dt_masks_shape_buttons_data_t::config, dt_masks_shape_buttons_config_t::creation_module, dt_iop_module_t::dev, dt_masks_shape_buttons_config_t::dev, DT_MASKS_SHAPE_BUTTON_COUNT, i, and IS_NULL_PTR.
Referenced by _masks_shape_buttons_sync_signal().
|
static |
Definition at line 170 of file masks_gui.c.
References _masks_shape_buttons_sync().
Referenced by _masks_shape_buttons_destroy(), and dt_masks_shape_buttons_create().
|
static |
Definition at line 190 of file masks_gui.c.
Referenced by dt_masks_shape_menu_item_new().
|
static |
Definition at line 4946 of file masks_gui.c.
References _group_create(), _group_from_module(), dt_iop_module_t::dev, dt_iop_gui_blend_masks_update(), dt_masks_cow_touch(), DT_MASKS_EDIT_FULL, dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_add_form(), dt_masks_set_edit_mode(), and IS_NULL_PTR.
Referenced by dt_masks_iop_value_changed_callback().
|
static |
Definition at line 4941 of file masks_gui.c.
References dt_iop_module_t::dev, dt_masks_creation_mode_enter(), and type.
Referenced by dt_masks_iop_value_changed_callback().
|
static |
Definition at line 4929 of file masks_gui.c.
References _group_from_module(), dt_iop_module_t::dev, dt_iop_gui_blend_masks_update(), DT_MASKS_EDIT_OFF, dt_masks_form_delete(), and dt_masks_set_edit_mode().
Referenced by dt_masks_iop_value_changed_callback().
|
static |
Definition at line 4201 of file masks_gui.c.
References dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _canvas_cairo_bound().
|
static |
Definition at line 4598 of file masks_gui.c.
References dt_dev_rescale_roi_to_input(), height, IS_NULL_PTR, transform(), TRUE, and width.
Referenced by dt_masks_events_post_expose_with().
|
static |
Definition at line 4269 of file masks_gui.c.
References _canvas_cairo_bound(), _session_bound_include(), dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_formids, _canvas_frame_t::device_scale, FALSE, IS_NULL_PTR, and TRUE.
Referenced by dt_masks_events_post_expose_with().
|
static |
Definition at line 4570 of file masks_gui.c.
References _overlay_damage, _overlay_damage_valid, _canvas_frame_t::device_scale, dt_gui_center_widget(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _overlay_finish().
|
static |
Definition at line 4644 of file masks_gui.c.
References _canvas_frame_t::canvas, dt_stroke_raster_touched(), MAX, MIN, and TRUE.
Referenced by dt_masks_events_post_expose_with().
|
static |
Definition at line 4621 of file masks_gui.c.
References dt_group_events_post_expose(), dt_group_events_post_expose_only(), DT_MASKS_GROUP, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, dt_masks_form_t::points, dt_masks_functions_t::post_expose, dt_masks_form_t::type, and dt_masks_form_gui_t::type.
Referenced by dt_masks_events_post_expose_with().
|
static |
Definition at line 4513 of file masks_gui.c.
References _overlay_dump_outline(), dt_masks_form_gui_points_t::border, _canvas_frame_t::canvas, _canvas_frame_t::device_scale, _canvas_frame_t::height, IS_NULL_PTR, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, _canvas_frame_t::width, _canvas_frame_t::x, and _canvas_frame_t::y.
Referenced by dt_masks_events_post_expose_with().
|
static |
Definition at line 4498 of file masks_gui.c.
References _overlay_skip_of(), dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, f, i, IS_NULL_PTR, MIN, dt_masks_form_gui_points_t::points, and dt_masks_form_gui_points_t::points_count.
Referenced by _overlay_dump().
|
static |
Definition at line 4610 of file masks_gui.c.
References _canvas_composite(), _canvas_end(), _overlay_damage_record(), _static_layer, _canvas_frame_t::height, IS_NULL_PTR, and _canvas_frame_t::width.
Referenced by dt_masks_events_post_expose_with().
|
static |
Definition at line 4490 of file masks_gui.c.
References dt_masks_form_gui_points_t::border_skip_count, dt_masks_form_gui_points_t::border_skips, i, dt_masks_skip_range_t::jump_from, and k.
Referenced by _overlay_dump_outline().
|
static |
Rasterise form and paint it under the overlay as 8-bit grey. Its own function because compositing a backdrop and drawing an overlay are two jobs, and nesting the pixel loop inside the surface bookkeeping made both harder to follow.
Definition at line 5880 of file masks_gui.c.
References CLAMPF, dt_free_align, dt_masks_debug_rasterise(), g, height, IS_NULL_PTR, row, v, width, and x.
Referenced by dt_masks_debug_write_png().
|
static |
Definition at line 4082 of file masks_gui.c.
References MAX, MIN, TRUE, rect::width, x, rect::x, and rect::y.
Referenced by _bound_include_points(), and _session_bound_include().
|
static |
Definition at line 3769 of file masks_gui.c.
References _bbox_include_array(), bbox, dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, FALSE, IS_NULL_PTR, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, and dt_masks_form_gui_points_t::points_count.
Referenced by _masks_draw_creation_session_forms().
Definition at line 3805 of file masks_gui.c.
References _session_bbox_valid, and FALSE.
Referenced by _session_gui_reset().
|
static |
Definition at line 4243 of file masks_gui.c.
References _canvas_device_scale(), _rect_include(), _session_bbox, _session_bbox_valid, and x.
Referenced by _overlay_clip_to_bound().
|
static |
Clip to the session's area, with room for the stroke's own width.
Definition at line 3783 of file masks_gui.c.
References _session_bbox, _session_bbox_valid, FALSE, and TRUE.
Referenced by _masks_draw_creation_session_forms().
Definition at line 3833 of file masks_gui.c.
References _session_bbox_invalidate(), _session_gui, _session_gui_count, _session_gui_generation, _session_gui_inited, _session_pattern_reset(), _session_sigs_reset(), dt_masks_form_gui_points_free(), and dt_masks_form_gui_t::points.
Referenced by _masks_draw_creation_session_forms().
|
static |
What the cached rendering is a rendering OF.
Definition at line 3811 of file masks_gui.c.
References dt_masks_form_gui_t::creation_formids, dt_hash(), matrix, and void().
Referenced by _masks_draw_creation_session_forms().
Drop the session outlines. Safe to call when nothing is cached.
Definition at line 3798 of file masks_gui.c.
References _session_pattern, _session_pattern_key, and IS_NULL_PTR.
Referenced by _masks_draw_creation_session_forms(), and _session_gui_reset().
Definition at line 3712 of file masks_gui.c.
References _session_sigs, _session_sigs_count, and dt_free_align.
Referenced by _session_gui_reset().
|
static |
Take the signature of every cached outline.
Definition at line 3719 of file masks_gui.c.
References IS_NULL_PTR, max, out, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, and dt_masks_form_gui_points_t::points_count.
Referenced by _masks_draw_creation_session_forms().
|
static |
Definition at line 2676 of file masks_gui.c.
References dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_closing_form, dt_masks_form_gui_t::dev, dt_control_queue_cursor, dt_control_queue_cursor_by_name(), dt_control_set_cursor_visible, DT_MASKS_BRUSH, dt_masks_get_visible_form(), dt_masks_is_anything_hovered(), dt_masks_is_anything_selected(), FALSE, IS_NULL_PTR, dt_masks_form_gui_t::pivot_selected, TRUE, and dt_masks_form_t::type.
Referenced by _dt_masks_events_mouse_moved(), dt_masks_events_button_pressed(), and dt_masks_events_button_released().
|
static |
Build and display the on-canvas hint message for masks interactions.
Pitfall: set_hint_message() may rely on gui->form_selected, so we may need a temporary override when no hint is produced.
Definition at line 1794 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_control_get_global(), dt_control_hinter_message(), DT_DEBUG_INPUT, dt_masks_form_get_selected_group_live(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_print(), FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_group_t::formid, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::seg_hovered, dt_masks_functions_t::set_hint_message, and dt_masks_form_t::type.
Referenced by _dt_masks_events_mouse_moved(), dt_masks_events_button_pressed(), dt_masks_events_button_released(), and dt_masks_events_mouse_scrolled().
|
static |
Definition at line 4484 of file masks_gui.c.
References dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_formids, DT_MASKS_GROUP, IS_NULL_PTR, and dt_masks_form_t::type.
Referenced by dt_masks_events_post_expose_with().
|
static |
Definition at line 4442 of file masks_gui.c.
References _canvas_clear(), _static_layer, _static_layer_height, _static_layer_key, _static_layer_key_compute(), _static_layer_width, _canvas_frame_t::device_scale, dt_group_events_post_expose_except(), FALSE, dt_masks_form_gui_t::group_selected, _canvas_frame_t::height, IS_NULL_PTR, key, matrix, TRUE, and _canvas_frame_t::width.
Referenced by dt_masks_events_post_expose_with().
|
static |
Definition at line 4402 of file masks_gui.c.
References dt_hash(), i, and IS_NULL_PTR.
Referenced by _static_layer_key_compute().
|
static |
Definition at line 4411 of file masks_gui.c.
References _static_layer_hash_samples(), dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, dt_masks_form_gui_points_t::border_skip_count, dt_hash(), dt_widget_overlay_color(), dt_masks_form_t::formid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, matrix, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, and dt_masks_form_gui_points_t::points_count.
Referenced by _static_layer_ensure().
| void dt_masks_append_form | ( | dt_develop_t * | develop, |
| dt_masks_form_t * | mask_form | ||
| ) |
Definition at line 2505 of file masks_gui.c.
References dt_masks_form_ref(), dt_pthread_rwlock_unlock(), dt_pthread_rwlock_wrlock(), dt_develop_t::forms, and dt_develop_t::masks_mutex.
Referenced by _blendop_masks_group_create(), _group_create(), _group_member(), _module_create_own_mask(), _tree_group(), dt_masks_form_duplicate(), and dt_masks_gui_form_save_creation().
| float dt_masks_apply_increment | ( | float | current, |
| float | amount, | ||
| dt_masks_increment_t | increment, | ||
| int | flow | ||
| ) |
Apply a scroll increment to a scalar value.
Definition at line 5246 of file masks_gui.c.
References DT_MASKS_INCREMENT_ABSOLUTE, DT_MASKS_INCREMENT_OFFSET, and DT_MASKS_INCREMENT_SCALE.
Referenced by _change_curvature(), _change_extent(), _change_fading(), _change_fading(), _change_rotation(), _change_rotation(), _change_size(), _change_size(), dt_masks_form_change_opacity(), dt_masks_form_set_interaction_value(), and dt_masks_get_set_conf_value().
| float dt_masks_apply_increment_precomputed | ( | float | current, |
| float | amount, | ||
| float | scale_amount, | ||
| float | offset_amount, | ||
| dt_masks_increment_t | increment | ||
| ) |
Apply a scroll increment using precomputed scale/offset factors.
Definition at line 5260 of file masks_gui.c.
References DT_MASKS_INCREMENT_ABSOLUTE, DT_MASKS_INCREMENT_OFFSET, and DT_MASKS_INCREMENT_SCALE.
Referenced by _change_fading(), _change_fading(), and _change_size().
| void dt_masks_calculate_source_pos_origin | ( | dt_masks_form_gui_t * | mask_gui, |
| const float | initial_xpos, | ||
| const float | initial_ypos, | ||
| const float | xpos, | ||
| const float | ypos, | ||
| float * | pos_x, | ||
| float * | pos_y, | ||
| const int | adding | ||
| ) |
Compute preview-space source position for drawing the clone indicator.
This uses the stored source positioning mode and can follow the cursor while adding.
Definition at line 5642 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_dev_geometry_snapshot(), dt_masks_get_visible_form(), DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_masks_form_t::functions, geometry, dt_masks_functions_t::initial_source_pos, IS_NULL_PTR, dt_masks_form_gui_t::pos_source, and dt_masks_form_gui_t::source_pos_type.
Referenced by dt_masks_draw_source_preview(), and dt_masks_preview_add_clone_source().
| int dt_masks_center_view_on_form | ( | dt_develop_t * | dev, |
| const dt_masks_form_t * | mask_form | ||
| ) |
Center the darkroom ROI on a mask form gravity center.
Mask forms store their gravity center in normalized RAW coordinates, while dt_dev_viewport_center_x(dev) and dt_dev_viewport_center_y(dev) address the processed image. Transforming through absolute RAW and processed-image coordinates keeps the center aligned with the final image after distortion modules, then the ROI clamp preserves the same bounds used by manual panning.
Definition at line 5177 of file masks_gui.c.
References dt_dev_clamp_viewport_center(), dt_dev_coordinates_image_abs_to_image_norm(), dt_dev_coordinates_raw_abs_to_image_abs(), dt_dev_coordinates_raw_norm_to_raw_abs(), dt_dev_pixelpipe_change_zoom_main(), dt_dev_viewport_set_center(), dt_masks_form_get_gravity_center(), and IS_NULL_PTR.
Referenced by _blendop_masks_all_selection_changed(), _blendop_masks_group_selection_changed(), and _tree_selection_change().
| void dt_masks_change_form_gui | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | newform | ||
| ) |
function used to manipulate forms for masks
Definition at line 4840 of file masks_gui.c.
References dt_develop_t::allforms, dt_masks_clear_form_gui(), dt_masks_form_unref(), dt_masks_get_visible_form(), dt_masks_set_visible_form(), dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), FALSE, dt_develop_t::forms, IS_NULL_PTR, dt_develop_t::masks_mutex, and TRUE.
Referenced by _blendop_masks_all_delete(), _blendop_masks_all_selection_changed(), _blendop_masks_group_delete(), _blendop_masks_group_move_callback(), _blendop_masks_group_unlink(), _brush_events_button_released(), _edit_masks(), _masks_remove_or_delete_finish(), _masks_remove_shape(), _reset_form_creation(), _tree_delete_shape(), _tree_movedown(), _tree_moveup(), _tree_row_action(), _tree_selection_change(), dt_masks_cleanup_unused(), dt_masks_creation_mode_enter(), dt_masks_form_exit_creation(), dt_masks_reset_form_gui(), dt_masks_set_edit_mode(), gui_focus(), rt_edit_masks_callback(), and rt_show_forms_for_current_scale().
| void dt_masks_clear_form_gui | ( | dt_develop_t * | develop | ) |
Definition at line 4777 of file masks_gui.c.
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::border_toggling, dt_masks_form_gui_t::creation_closing_form, dt_masks_form_gui_t::creation_formids, dt_masks_form_gui_t::creation_last_formid, dt_masks_form_gui_t::creation_module, dt_masks_form_gui_t::creation_type, dt_masks_form_gui_t::delta, dt_masks_creation_mode_quit(), dt_masks_dynbuf_free(), DT_MASKS_EDIT_OFF, dt_masks_form_gui_points_free(), DT_MASKS_NONE, DT_MASKS_PRESSURE_OFF, dt_masks_select_form(), dt_masks_form_gui_t::edit_mode, FALSE, dt_masks_form_gui_t::form_dragging, dt_develop_t::form_gui, dt_masks_form_gui_t::form_rotating, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::formid, dt_masks_form_gui_t::geometry_generation, dt_masks_form_gui_t::gradient_toggling, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, IS_NULL_PTR, dt_masks_form_gui_t::last_hit_test_pos, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_gui_t::pivot_selected, dt_masks_form_gui_t::points, dt_masks_form_gui_t::pressure_sensitivity, dt_masks_form_gui_t::rebuild_pending, dt_masks_form_gui_t::scrollx, dt_masks_form_gui_t::scrolly, dt_masks_form_gui_t::seg_dragging, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_dragging, and dt_masks_form_gui_t::source_selected.
Referenced by _masks_remove_or_delete_finish(), _masks_remove_shape(), dt_masks_change_form_gui(), dt_masks_gui_cleanup(), and dt_masks_gui_init().
| GtkWidget * dt_masks_create_menu | ( | dt_masks_form_gui_t * | gui, |
| dt_masks_form_t * | form, | ||
| const dt_masks_form_group_t * | formgroup, | ||
| const float | pzx, | ||
| const float | pzy | ||
| ) |
Definition at line 865 of file masks_gui.c.
References _masks_gui_delete_node_callback(), _masks_gui_exit_creation_callback(), _masks_gui_full_delete_callback(), _masks_gui_remove_from_group_callback(), _masks_movedown_callback(), _masks_moveup_callback(), dt_masks_form_gui_t::creation, ctx_gtk_menu_item_new_with_markup(), ctx_gtk_menu_item_new_with_markup_and_pixbuf(), dt_masks_form_gui_t::dev, dt_draw_get_pixbuf_from_cairo(), dt_free, DT_MASKS_BRUSH, DT_MASKS_CIRCLE, DT_MASKS_ELLIPSE, dt_masks_form_group_from_parentid(), dt_masks_get_from_id(), DT_MASKS_GRADIENT, DT_MASKS_GROUP, dt_masks_gui_populate_interaction_sliders(), DT_MASKS_IS_RETOUCHE, DT_MASKS_POLYGON, DT_MASKS_STATE_DIFFERENCE, DT_MASKS_STATE_EXCLUSION, DT_MASKS_STATE_INTERSECTION, DT_MASKS_STATE_INVERSE, DT_MASKS_STATE_IS_COMBINE_OP, DT_MASKS_STATE_UNION, DT_PIXEL_APPLY_DPI, dtgtk_cairo_paint_masks_difference(), dtgtk_cairo_paint_masks_exclusion(), dtgtk_cairo_paint_masks_intersection(), dtgtk_cairo_paint_masks_inverse(), dtgtk_cairo_paint_masks_union(), FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_t::formid, dt_masks_form_group_t::formid, dt_masks_form_t::functions, dt_develop_t::gui_module, IS_NULL_PTR, k, masks_gtk_menu_item_new_bold, MAX, menu_item_set_fake_accel, dt_masks_form_t::name, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_group_t::parentid, dt_masks_form_t::points, dt_masks_functions_t::populate_context_menu, dt_masks_form_gui_t::seg_hovered, dt_masks_form_group_t::state, state, TRUE, dt_masks_form_t::type, and width.
Referenced by dt_masks_events_button_pressed().
| gboolean dt_masks_creation_mode_enter | ( | dt_develop_t * | dev, |
| dt_iop_module_t * | module, | ||
| const dt_masks_type_t | type | ||
| ) |
Enter mask creation mode for a given shape type.
NOTE: this does quite the same as _menu_add_shape.
Definition at line 5762 of file masks_gui.c.
References dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_formids, dt_masks_form_gui_t::creation_last_formid, dt_masks_form_gui_t::creation_module, dt_masks_form_gui_t::creation_type, dt_gui_center_widget(), dt_iop_request_focus(), DT_MASKS_ALL, dt_masks_change_form_gui(), dt_masks_create(), dt_masks_shape_buttons_sync_all(), FALSE, dt_develop_t::form_gui, IS_NULL_PTR, TRUE, and type.
Referenced by _add_shape(), _masks_shape_button_pressed(), _menu_add_shape(), _tree_add_shape(), and rt_select_algorithm_callback().
| void dt_masks_creation_mode_quit | ( | dt_masks_form_gui_t * | mask_gui | ) |
Exit mask creation mode, restoring cursor visibility and resetting GUI state.
| mask_gui | The GUI state of the mask form |
Definition at line 5750 of file masks_gui.c.
References dt_masks_form_gui_t::creation, FALSE, and IS_NULL_PTR.
Referenced by dt_masks_clear_form_gui(), and dt_masks_form_exit_creation().
| gboolean dt_masks_debug_write_png | ( | struct dt_develop_t * | dev, |
| struct dt_masks_form_t * | form, | ||
| const dt_masks_debug_request_t * | request, | ||
| const char * | path | ||
| ) |
Render form per request and write it to path as a PNG.
form NULL uses the dev's currently visible form. Definition at line 5910 of file masks_gui.c.
References _paint_mask_backdrop(), dt_masks_debug_request_t::backdrop, dt_masks_form_gui_t::dev, double(), dt_masks_debug_request_t::draw_overlay, DT_DEBUG_ALWAYS, dt_dev_geometry_get_raw_size(), dt_dev_geometry_set_processed_size(), dt_dev_get_processed_size(), DT_GUI_COLOR_LAST, DT_MASKS_DEBUG_BACKDROP_RASTER, DT_MASKS_DEBUG_BACKDROP_TRANSPARENT, dt_masks_events_post_expose_with(), dt_masks_get_visible_form(), dt_masks_init_form_gui(), dt_print(), dt_widget_colors(), FALSE, dt_develop_t::form_gui, dt_masks_form_gui_t::form_visible, dt_masks_form_gui_t::formid, height, dt_masks_debug_request_t::height, i, IS_NULL_PTR, dt_masks_overlay_transform_t::scale, transform(), width, and dt_masks_debug_request_t::width.
Referenced by _judge_raster(), and _run_case_at().
| gboolean dt_masks_delete_shape | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | sel, | ||
| int | parent_id, | ||
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_id | ||
| ) |
Permanently delete the form from every group and from dev->forms. Gated by dt_masks_gui_confirm_permanent_delete() (itself gated by the "ask_before_delete_mask_shape" pref).
Definition at line 2242 of file masks_gui.c.
References _masks_remove_or_delete_finish(), dt_masks_gui_confirm_permanent_delete(), FALSE, IS_NULL_PTR, and dt_masks_form_t::name.
Referenced by _masks_gui_full_delete_callback().
| void dt_masks_draw_outline_runs | ( | cairo_t * | cr, |
| const float *const | points, | ||
| const int | first, | ||
| const int | last, | ||
| const dt_masks_skip_range_t * | skips, | ||
| const int | skip_count | ||
| ) |
Append a shape's outline to cr as the complement of its exclusion list: one cairo sub-path per run between the spans in skips, which are where the offset curve doubles back on itself and must not be drawn. Pass NULL and 0 for a shape with nothing to exclude. Implemented in masks/masks_gui.c – see there for why the excluded spans travel beside the buffer and not inside it.
Definition at line 6049 of file masks_gui.c.
References _emit_run(), dt_draw_min_emit_step(), IS_NULL_PTR, and MAX.
Referenced by _brush_draw_shape(), and _polygon_draw_shape().
| void dt_masks_draw_path_seg_by_seg | ( | cairo_t * | cr, |
| dt_masks_form_gui_t * | mask_gui, | ||
| const int | form_index, | ||
| const float * | points, | ||
| const int | points_count, | ||
| const int | node_count, | ||
| const float | zoom_scale, | ||
| const gboolean | round_ends | ||
| ) |
Definition at line 3483 of file masks_gui.c.
References dt_masks_form_gui_t::creation, dt_draw_min_emit_step(), dt_draw_stroke_line(), DT_MASKS_DASH_ROUND, dt_masks_gui_selected_segment_index(), dt_masks_is_anything_selected(), DT_MASKS_NO_DASH, FALSE, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_selected, and IS_NULL_PTR.
Referenced by _brush_events_post_expose(), and _polygon_events_post_expose().
| void dt_masks_draw_source | ( | cairo_t * | cr, |
| dt_masks_form_gui_t * | gui, | ||
| const int | index, | ||
| const int | nb, | ||
| const float | zoom_scale, | ||
| struct dt_masks_gui_center_point_t * | center_point, | ||
| const shape_draw_function_t * | draw_shape_func | ||
| ) |
Draw the source for a correction mask.
| cr | the cairo context to draw into |
| gui | the GUI state of the mask form |
| index | the index of the mask form |
| nb | the number of coord for that shape |
| zoom_scale | the current zoom scale of the image |
| shape_function | the function to draw the shape |
Definition at line 3368 of file masks_gui.c.
References _dt_masks_find_best_attachment_point(), dt_masks_form_gui_t::creation, dt_masks_form_gui_t::dev, DT_DEBUG_MASKS, dt_draw_arrow(), dt_draw_source_shape(), dt_get_debug_flags(), DT_MASKS_BRUSH, DT_MASKS_DASH_ROUND, DT_MASKS_ELLIPSE, DT_MASKS_IS_CLOSED_SHAPE, DT_MASKS_IS_OPEN_SHAPE, DT_MASKS_IS_PATH_SHAPE, dt_masks_point_in_form_exact(), DT_PIXEL_APPLY_DPI, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, M_PI, dt_masks_gui_center_point_t::main, main(), dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_points_t::points_count, selected, dt_masks_form_gui_points_t::source, dt_masks_gui_center_point_t::source, dt_masks_form_gui_points_t::source_count, dt_masks_form_gui_t::source_dragging, dt_masks_form_gui_t::source_selected, TRUE, dt_masks_form_gui_t::type, dt_masks_gui_center_point_t::x, and dt_masks_gui_center_point_t::y.
Referenced by _brush_events_post_expose(), _circle_events_post_expose(), _ellipse_events_post_expose(), and _polygon_events_post_expose().
| int dt_masks_events_button_pressed | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | button, | ||
| int | event_type, | ||
| uint32_t | state | ||
| ) |
Definition at line 2961 of file masks_gui.c.
References _apply_gui_button_pressed_state(), _dt_masks_events_get_dispatch_form(), _dt_masks_events_group_update_selection(), _dt_masks_events_set_current_pos(), _dt_masks_events_update_hover(), _set_cursor_shape(), _set_hinter_message(), dt_masks_functions_t::button_pressed, dt_masks_form_gui_t::creation, dt_develop_t::darkroom_skip_mouse_events, dt_masks_cow_touch(), dt_masks_create_menu(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_is_anything_hovered(), dt_masks_is_anything_selected(), dt_masks_select_form(), FALSE, dt_develop_t::form_gui, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_gui_t::rel_pos, state, TRUE, dt_masks_form_t::type, and x.
Referenced by button_pressed().
| int dt_masks_events_button_released | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| double | x, | ||
| double | y, | ||
| int | button, | ||
| uint32_t | state | ||
| ) |
Definition at line 2906 of file masks_gui.c.
References _dt_masks_events_flush_rebuild_if_needed(), _dt_masks_events_get_dispatch_form(), _dt_masks_events_set_current_pos(), _set_cursor_shape(), _set_hinter_message(), dt_masks_functions_t::button_released, dt_masks_form_gui_t::creation, dt_develop_t::darkroom_skip_mouse_events, dt_dev_masks_selection_change(), dt_masks_cow_touch(), dt_masks_form_get_selected_group_live(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_gui_reset_dragging(), FALSE, dt_develop_t::form_gui, dt_masks_form_group_t::formid, dt_masks_form_t::functions, IS_NULL_PTR, state, dt_masks_form_t::type, and x.
Referenced by button_released().
| int dt_masks_events_key_pressed | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| GdkEventKey * | event | ||
| ) |
Definition at line 3040 of file masks_gui.c.
References _dt_masks_events_get_dispatch_form(), dt_keys_mainpad_alternatives(), dt_masks_cow_touch(), dt_masks_form_exit_creation(), dt_masks_form_get_selected_group(), dt_masks_get_from_id(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_gui_remove(), FALSE, dt_develop_t::form_gui, dt_masks_form_group_t::formid, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, key, dt_masks_functions_t::key_pressed, dt_masks_form_group_t::parentid, and dt_masks_form_t::type.
Referenced by key_pressed().
| int dt_masks_events_mouse_enter | ( | struct dt_iop_module_t * | module | ) |
Definition at line 2653 of file masks_gui.c.
Referenced by mouse_enter().
| int dt_masks_events_mouse_leave | ( | struct dt_iop_module_t * | module | ) |
Definition at line 2648 of file masks_gui.c.
Referenced by mouse_leave().
| int dt_masks_events_mouse_moved | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
Definition at line 2824 of file masks_gui.c.
References _dt_masks_events_mouse_moved(), _overlay_pointer, _overlay_pointer_delta, _overlay_pointer_valid, DT_DEBUG_PERF, dt_get_debug_flags(), dt_get_times(), dt_show_times(), TRUE, and x.
Referenced by mouse_moved().
| int dt_masks_events_mouse_scrolled | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| double | x, | ||
| double | y, | ||
| int | scroll_up, | ||
| uint32_t | key_state, | ||
| int | scrolling_delta | ||
| ) |
Definition at line 3218 of file masks_gui.c.
References _dt_masks_events_cursor_over_form(), _dt_masks_events_get_dispatch_form(), _dt_masks_events_set_current_pos(), _dt_masks_events_update_hover(), _set_hinter_message(), dt_masks_form_gui_t::creation, dt_develop_t::darkroom_skip_mouse_events, DT_DEBUG_INPUT, dt_mask_scroll_increases(), dt_masks_cow_touch(), dt_masks_get_visible_form(), DT_MASKS_INTERACTION_UNDEF, dt_masks_is_anything_selected(), dt_masks_scroll_get_interaction(), dt_print(), dt_develop_t::form_gui, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_functions_t::mouse_scrolled, dt_masks_form_t::type, and x.
Referenced by scrolled().
| void dt_masks_events_post_expose | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| cairo_t * | cr, | ||
| int32_t | width, | ||
| int32_t | height, | ||
| int32_t | pointerx, | ||
| int32_t | pointery | ||
| ) |
Definition at line 4017 of file masks_gui.c.
References dt_masks_events_post_expose_with(), height, and width.
Referenced by expose().
| void dt_masks_events_post_expose_with | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| cairo_t * | cr, | ||
| int32_t | width, | ||
| int32_t | height, | ||
| int32_t | pointerx, | ||
| int32_t | pointery, | ||
| const dt_masks_overlay_transform_t * | transform | ||
| ) |
Draw the mask overlay with an explicit mapping; transform NULL means the viewport's.
Definition at line 4663 of file masks_gui.c.
References _canvas_begin(), _masks_draw_creation_session_forms(), _overlay_apply_transform(), _overlay_clip_to_bound(), _overlay_dirty(), _overlay_draw_form(), _overlay_dump(), _overlay_finish(), _static_layer_applies(), _static_layer_ensure(), _canvas_frame_t::cr, dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_formids, DT_DEBUG_MASKS, DT_DEBUG_PERF, dt_dev_get_processed_size(), dt_dev_get_zoom_level(), dt_draw_min_emit_step(), dt_get_debug_flags(), dt_get_times(), dt_get_wtime(), dt_masks_get_visible_form(), dt_masks_gui_form_test_create(), dt_masks_gui_set_outline_density(), DT_MASKS_IS_PRIMITIVE_SHAPE, dt_print(), dt_show_times(), FALSE, dt_develop_t::form_gui, height, _canvas_frame_t::height, IS_NULL_PTR, transform(), dt_masks_form_t::type, width, and _canvas_frame_t::width.
Referenced by _check_hidpi_placement(), _overlay_frame(), dt_masks_debug_write_png(), and dt_masks_events_post_expose().
| int dt_masks_find_closest_handle_common | ( | dt_masks_form_t * | mask_form, |
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_index, | ||
| int | node_count_override, | ||
| dt_masks_border_handle_fn | border_handle_cb, | ||
| dt_masks_curve_handle_fn | curve_handle_cb, | ||
| dt_masks_node_position_fn | node_position_cb, | ||
| dt_masks_distance_fn | distance_cb, | ||
| dt_masks_post_select_fn | post_select_cb, | ||
| void * | user_data | ||
| ) |
Centralized hit-testing for node/handle/segment selection across shapes.
Shared selection logic for node/handle/segment hit testing.
This function:
node_count_override can be used for shapes that don't expose nodes via GList (e.g. gradient/ellipse control points). Pass -1 to use g_list_length().
Callers provide shape-specific callbacks for handles and distance tests.
The cached cursor in mask_gui->pos is authoritative for hit testing.
Definition at line 1183 of file masks_gui.c.
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::creation, DT_GUI_MOUSE_EFFECT_RADIUS, dt_masks_gui_selected_node_index(), dt_masks_gui_was_anything_selected(), dt_masks_node_is_cusp(), dt_masks_point_is_within_radius(), FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_hovered, IS_NULL_PTR, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_t::points, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::seg_dragging, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::source_selected, TRUE, and dt_masks_form_t::uses_bezier_points_layout.
Referenced by _find_closest_handle(), _find_closest_handle(), _find_closest_handle(), _find_closest_handle(), and _find_closest_handle().
| int dt_masks_form_change_opacity | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | mask_form, | ||
| int | parent_id, | ||
| int | scroll_up, | ||
| const int | flow | ||
| ) |
Definition at line 5840 of file masks_gui.c.
References dt_masks_apply_increment(), dt_masks_group_get_member(), dt_masks_group_set_member_opacity(), DT_MASKS_INCREMENT_OFFSET, DT_MASKS_OK, DT_MASKS_UNCHANGED, dt_toast_log(), dt_masks_form_t::formid, IS_NULL_PTR, and dt_masks_member_t::opacity.
Referenced by _brush_events_mouse_scrolled(), _circle_events_mouse_scrolled(), _ellipse_events_mouse_scrolled(), _gradient_events_mouse_scrolled(), and _polygon_events_mouse_scrolled().
| gboolean dt_masks_form_exit_creation | ( | dt_iop_module_t * | module, |
| dt_masks_form_gui_t * | mask_gui | ||
| ) |
Definition at line 2250 of file masks_gui.c.
References dt_iop_module_gui_t::blend_data, dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_formids, dt_masks_form_gui_t::creation_last_formid, dt_masks_form_gui_t::creation_module, dt_masks_form_gui_t::creation_type, dt_masks_form_gui_t::dev, dt_dev_masks_selection_change(), dt_iop_gui_blend_masks_update(), dt_masks_change_form_gui(), dt_masks_creation_mode_quit(), dt_masks_dynbuf_free(), DT_MASKS_EDIT_FULL, dt_masks_free_form(), dt_masks_get_from_id(), dt_masks_get_visible_form(), dt_masks_group_index_from_formid(), DT_MASKS_NONE, dt_masks_set_edit_mode(), dt_masks_set_visible_form(), dt_masks_shape_buttons_deactivate_all(), dt_masks_form_gui_t::edit_mode, FALSE, dt_masks_form_gui_t::form_dragging, dt_develop_t::form_gui, dt_masks_form_gui_t::form_rotating, dt_masks_form_gui_t::form_selected, dt_masks_form_t::formid, dt_masks_form_gui_t::group_selected, dt_iop_module_t::gui, dt_masks_form_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_selected, IS_NULL_PTR, dt_iop_gui_blend_data_t::masks_edit, dt_iop_gui_blend_data_t::masks_shown, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_gui_t::pivot_selected, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_dragging, dt_masks_form_gui_t::source_selected, and TRUE.
Referenced by _group_events_key_pressed(), _masks_gui_delete_node_callback(), _masks_gui_exit_creation_callback(), _masks_shape_button_pressed(), _polygon_events_key_pressed(), dt_masks_events_key_pressed(), dt_masks_gui_cleanup(), dt_masks_gui_form_save_creation(), and dt_masks_gui_remove().
| gboolean dt_masks_form_get_gravity_center | ( | dt_develop_t * | dev, |
| const dt_masks_form_t * | mask_form, | ||
| float | center[2], | ||
| float * | area | ||
| ) |
Definition at line 5156 of file masks_gui.c.
References FALSE, dt_masks_form_t::functions, dt_masks_functions_t::get_gravity_center, and IS_NULL_PTR.
Referenced by _group_get_gravity_center(), dt_masks_center_view_on_form(), and dt_masks_form_update_gravity_center().
| float dt_masks_form_get_interaction_value | ( | dt_develop_t * | dev, |
| const int | group_id, | ||
| const int | formid, | ||
| dt_masks_interaction_t | interaction | ||
| ) |
Definition at line 5135 of file masks_gui.c.
References dt_masks_get_from_id(), dt_masks_group_get_member(), DT_MASKS_INTERACTION_OPACITY, DT_MASKS_OK, dt_masks_form_t::functions, dt_masks_functions_t::get_interaction_value, IS_NULL_PTR, and dt_masks_member_t::opacity.
Referenced by dt_masks_gui_populate_interaction_sliders().
| dt_masks_form_group_t * dt_masks_form_get_selected_group | ( | const dt_masks_form_t * | mask_form, |
| const dt_masks_form_gui_t * | mask_gui | ||
| ) |
Get the selected group entry from the GUI selection index.
Selection sequence overview:
Use dt_masks_form_get_selected_group() in tight GUI paths where the list is known stable; use dt_masks_form_get_selected_group_live() when correctness matters across potential list mutations.
Definition at line 1522 of file masks_gui.c.
References dt_masks_form_gui_t::group_selected, IS_NULL_PTR, and dt_masks_form_t::points.
Referenced by _brush_add_node_callback(), _masks_gui_delete_node_callback(), _masks_gui_resolve_selected_shape(), _masks_move_up_down_callback(), _polygon_add_node_callback(), dt_masks_events_key_pressed(), and dt_masks_form_get_selected_group_live().
| dt_masks_form_group_t * dt_masks_form_get_selected_group_live | ( | const dt_masks_form_t * | mask_form, |
| const dt_masks_form_gui_t * | mask_gui | ||
| ) |
Resolve a "live" selected group entry, even if GUI selection is stale.
Selection source:
If the GUI works on a temporary group copy, we re-resolve through parentid to get the live entry from dev->forms.
Definition at line 1539 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_masks_form_get_selected_group(), dt_masks_form_group_from_parentid(), dt_masks_form_group_t::formid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, and dt_masks_form_group_t::parentid.
Referenced by _dt_masks_events_get_dispatch_form(), _dt_masks_events_group_update_selection(), _set_hinter_message(), dt_masks_events_button_released(), and rt_get_selected_shape_id().
| dt_masks_form_group_t * dt_masks_form_group_find_entry | ( | dt_masks_form_t * | group_form, |
| const int | form_id, | ||
| int * | out_index | ||
| ) |
Find the group-membership entry for form_id inside group_form's own points list (not recursive into subgroups) – the shared primitive behind every "find this shape's
row within its parent group" call site.
Find the group-membership entry for formid inside group_form's own points list (not recursive into subgroups) – the shared primitive behind every "find this shape's row
within its parent group" call site.
Assumption: only valid for DT_MASKS_GROUP forms.
| out_index | if non-NULL, receives the entry's position in the list (-1 if not found). |
Definition at line 1368 of file masks_gui.c.
References DT_MASKS_GROUP, dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _blendop_masks_all_toggled(), _blendop_masks_group_update_row(), _blendop_masks_refresh_lists(), and dt_masks_form_group_from_parentid().
| dt_masks_form_group_t * dt_masks_form_group_from_parentid | ( | dt_develop_t * | dev, |
| int | parent_id, | ||
| int | form_id | ||
| ) |
Return the group entry for a (parent, form) pair.
Caveat: returns NULL if parent isn't a group or the entry is missing.
Definition at line 1489 of file masks_gui.c.
References dt_masks_form_group_find_entry(), dt_masks_get_from_id(), DT_MASKS_GROUP, IS_NULL_PTR, and dt_masks_form_t::type.
Referenced by dt_masks_create_menu(), and dt_masks_form_get_selected_group_live().
| float dt_masks_form_set_interaction_value | ( | dt_develop_t * | dev, |
| const int | group_id, | ||
| const int | formid, | ||
| dt_masks_interaction_t | interaction, | ||
| float | value, | ||
| dt_masks_increment_t | increment, | ||
| int | flow, | ||
| dt_masks_form_gui_t * | mask_gui, | ||
| dt_iop_module_t * | module | ||
| ) |
Definition at line 5196 of file masks_gui.c.
References dt_masks_apply_increment(), dt_masks_cow_touch(), dt_masks_form_update_gravity_center(), dt_masks_get_from_id(), dt_masks_group_get_member(), dt_masks_group_set_member_opacity(), DT_MASKS_INTERACTION_OPACITY, DT_MASKS_OK, DT_MASKS_UNCHANGED, dt_toast_log(), dt_masks_form_t::functions, IS_NULL_PTR, dt_masks_member_t::opacity, dt_masks_functions_t::set_interaction_value, and value.
Referenced by _masks_gui_interaction_apply_value().
| float dt_masks_get_set_conf_value | ( | dt_masks_form_t * | form, |
| char * | feature, | ||
| float | new_value, | ||
| float | v_min, | ||
| float | v_max, | ||
| dt_masks_increment_t | increment, | ||
| const int | flow | ||
| ) |
Change a numerical property of a mask shape, either by in/de-crementing the current value or setting it in an absolute fashion, then save it to configuration.
| form | the shape to change. We will read its type internally |
| feature | the propertie to change:Â fading, size, curvature (for gradients) |
| new_value | if increment is set to absolute, this is directly the updated value. if increment is offset, the updated value is old_value + new_value. if increment is scale, the updated value is old value * new_value. |
| v_min | minimum acceptable value of the property for sanitization |
| v_max | maximum acceptable value of the property for sanitization |
| increment | the increment type: absolute, offset or scale. |
| flow | the value of the scroll distance that can be postive or negative. |
Definition at line 5275 of file masks_gui.c.
References _get_mask_plugin(), dt_conf_get_float(), dt_conf_set_float(), dt_free, dt_masks_apply_increment(), dt_masks_type_name(), MAX, MIN, and dt_masks_form_t::type.
Referenced by _brush_events_button_pressed(), _brush_events_button_released(), _brush_events_post_expose(), _change_fading(), _change_size(), _init_fading(), _init_size(), and dt_masks_get_set_conf_value_with_toast().
| float dt_masks_get_set_conf_value_with_toast | ( | dt_masks_form_t * | form, |
| const char * | feature, | ||
| float | amount, | ||
| float | v_min, | ||
| float | v_max, | ||
| dt_masks_increment_t | increment, | ||
| int | flow, | ||
| const char * | toast_fmt, | ||
| float | toast_scale | ||
| ) |
Update a mask configuration value and emit a toast message.
This is a convenience wrapper around dt_masks_get_set_conf_value() that keeps UI feedback consistent across mask types.
Definition at line 5305 of file masks_gui.c.
References dt_masks_get_set_conf_value(), dt_toast_log(), IS_NULL_PTR, and value.
Referenced by _init_curvature(), _init_extent(), _init_fading(), _init_fading(), _init_fading(), _init_opacity(), _init_opacity(), _init_opacity(), _init_opacity(), _init_rotation(), _init_rotation(), _init_size(), and _init_size().
| dt_masks_form_t * dt_masks_get_visible_form | ( | const dt_develop_t * | dev | ) |
Return the currently visible form used by the masks GUI.
This can be a temporary group copy used for editing, not necessarily a form stored in dev->forms.
Definition at line 1408 of file masks_gui.c.
References dt_develop_t::form_gui, dt_masks_form_gui_t::form_visible, and IS_NULL_PTR.
Referenced by _blendop_masks_group_selection_changed(), _brush_add_node_callback(), _brush_events_button_released(), _brush_events_post_expose(), _canvas_cairo_bound(), _circle_events_post_expose(), _dt_masks_events_mouse_moved(), _ellipse_events_post_expose(), _masks_gui_delete_node_callback(), _masks_gui_resolve_selected_shape(), _masks_move_up_down_callback(), _masks_remove_or_delete_finish(), _masks_remove_shape(), _masks_shape_button_is_current_creation(), _polygon_add_node_callback(), _polygon_creation_closing_form_callback(), _polygon_events_post_expose(), _set_cursor_shape(), _shape_is_being_added(), button_pressed(), button_released(), dt_iop_gui_blend_masks_update(), dt_masks_calculate_source_pos_origin(), dt_masks_change_form_gui(), dt_masks_debug_write_png(), dt_masks_events_button_pressed(), dt_masks_events_button_released(), dt_masks_events_key_pressed(), dt_masks_events_mouse_scrolled(), dt_masks_events_post_expose_with(), dt_masks_form_exit_creation(), expose(), in_mask_editing(), key_pressed(), mouse_leave(), mouse_moved(), rt_get_selected_shape_id(), rt_shape_is_being_added(), scrolled(), scrolled(), and scrolled().
| dt_masks_form_group_t * dt_masks_group_add_form | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | group_form, | ||
| dt_masks_form_t * | mask_form | ||
| ) |
Definition at line 5347 of file masks_gui.c.
References dt_conf_get_float(), dt_masks_group_add_form_with_state(), DT_MASKS_STATE_SHOW, DT_MASKS_STATE_UNION, DT_MASKS_STATE_USE, dt_masks_form_t::formid, and IS_NULL_PTR.
Referenced by _blendop_masks_all_toggled(), _menu_add_exist(), _tree_add_exist(), _tree_add_to_group(), _tree_row_add_to_group(), _tree_row_assign_to_modules(), dt_masks_form_duplicate_in_group(), and dt_masks_iop_use_same_as().
| dt_masks_form_group_t * dt_masks_group_add_form_with_state | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | grp, | ||
| dt_masks_form_t * | form, | ||
| int | parentid, | ||
| dt_masks_state_t | state, | ||
| float | opacity | ||
| ) |
Add a shape to a group with an EXPLICIT combination state and opacity, rather than the defaults dt_masks_group_add_form() applies (SHOW|USE|UNION at the configured opacity).
This exists because three call sites wanted their own state and opacity and therefore built the membership row by hand – malloc, four assignments, g_list_append – which silently skipped both of the things the real adder does: the self-inclusion guard that stops a group containing itself, and the gravity-centre refresh the group needs before anything hit-tests it.
Takes the group by pointer, not by id, because the callers legitimately build into a group that is not in dev->forms yet: it is created, filled, and only then published. Copy-on-write is the caller's business here for the same reason – an unpublished group is referenced by nobody, and a published one must be touched before this is called, exactly as for dt_masks_group_add_form().
| parentid | the row's AUTHORED origin, which is NOT always the group holding it: two callers assemble a temporary group for an ungroup/regroup round trip and keep each row pointing at the group it really came from. Pass grp->formid unless you mean otherwise. |
Definition at line 5317 of file masks_gui.c.
References _find_in_group(), dt_control_log(), dt_masks_form_update_gravity_center(), DT_MASKS_GROUP, dt_masks_form_t::formid, dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_group_t::opacity, dt_masks_form_group_t::parentid, dt_masks_form_t::points, dt_masks_form_group_t::state, state, and dt_masks_form_t::type.
Referenced by _tree_group(), _tree_selection_change(), dt_masks_group_add_form(), and rt_show_forms_for_current_scale().
| void dt_masks_group_entry_apply_operation | ( | struct dt_masks_form_group_t * | group_entry, |
| const dt_masks_state_t | apply_state | ||
| ) |
Apply a mask state operation on a group entry.
Inverse toggles its flag, combine operations replace the combine bits.
Definition at line 5795 of file masks_gui.c.
References DT_MASKS_STATE_INVERSE, DT_MASKS_STATE_IS_COMBINE_OP, IS_NULL_PTR, and dt_masks_form_group_t::state.
Referenced by _masks_operation_callback().
| int dt_masks_group_index_from_formid | ( | const dt_masks_form_t * | group_form, |
| int | formid | ||
| ) |
Find any group that currently references formid, searching every top-level group in dev->forms and their nested subgroups (first match wins – a shape used by more than one module has no single "correct" answer). Meant for UI listings that show a shape without already knowing which group (if any) it belongs to, e.g. a flat "all shapes" row.
| out_parentid | if non-NULL, receives the owning group's formid (0 if none found). |
Definition at line 1388 of file masks_gui.c.
References DT_MASKS_GROUP, dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _blendop_masks_group_selection_changed(), and dt_masks_form_exit_creation().
| void dt_masks_group_ungroup | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | dest_group, | ||
| dt_masks_form_t * | group_form | ||
| ) |
Definition at line 5356 of file masks_gui.c.
References dt_masks_cow_touch(), dt_masks_form_update_gravity_center(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_ungroup(), dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_group_t::opacity, dt_masks_form_group_t::parentid, dt_masks_form_t::points, dt_masks_form_group_t::state, and dt_masks_form_t::type.
Referenced by _tree_selection_change(), dt_masks_group_ungroup(), dt_masks_set_edit_mode(), and rt_show_forms_for_current_scale().
| void dt_masks_group_update_name | ( | dt_iop_module_t * | module | ) |
Definition at line 4968 of file masks_gui.c.
References dt_iop_module_t::blend_params, dt_iop_module_t::dev, dt_iop_gui_blend_masks_update(), dt_masks_group_set_name_from_module(), DT_MASKS_OK, DT_MASKS_UNCHANGED, IS_NULL_PTR, and dt_develop_blend_params_t::mask_id.
Referenced by _rename_module_key_press().
| GtkWidget * dt_masks_gui_add_interaction_slider | ( | GtkWidget * | menu, |
| const char * | label, | ||
| dt_develop_t * | dev, | ||
| const int | group_id, | ||
| const int | formid, | ||
| dt_masks_interaction_t | interaction, | ||
| dt_masks_increment_t | increment, | ||
| float | min, | ||
| float | max, | ||
| float | step, | ||
| float | value, | ||
| int | digits, | ||
| const char * | format, | ||
| float | factor, | ||
| dt_masks_form_gui_t * | gui, | ||
| dt_iop_module_t * | module | ||
| ) |
Append a bauhaus-slider menu item to a mask context menu, bound to one shape interaction (size, fading, rotation, opacity). Shared by the darkroom canvas context menu (dt_masks_create_menu) and the blend module's own shape-list context menus, so both stay in sync.
Definition at line 519 of file masks_gui.c.
References _masks_gui_interaction_slider_changed(), _masks_gui_menu_item_block_activate(), _masks_gui_menu_item_forward_event(), dt_masks_gui_interaction_slider_t::dev, dt_bauhaus_get_global(), dt_bauhaus_slider_new_with_range(), dt_bauhaus_slider_set(), dt_bauhaus_slider_set_digits(), dt_bauhaus_slider_set_factor(), dt_bauhaus_slider_set_format(), DT_BAUHAUS_WIDGET, dt_bauhaus_widget_set_label(), DT_GUI_BOX_SPACING, DT_GUI_MODULE, DT_PIXEL_APPLY_DPI, factor, FALSE, dt_masks_gui_interaction_slider_t::formid, dt_masks_gui_interaction_slider_t::group_id, dt_masks_gui_interaction_slider_t::gui, dt_masks_gui_interaction_slider_t::increment, dt_masks_gui_interaction_slider_t::interaction, dt_masks_gui_interaction_slider_t::last_value, max, min, dt_masks_gui_interaction_slider_t::slider, TRUE, and value.
Referenced by dt_masks_gui_populate_interaction_sliders().
| void dt_masks_gui_cleanup | ( | dt_develop_t * | dev | ) |
Definition at line 1436 of file masks_gui.c.
References dt_free, dt_masks_clear_form_gui(), dt_masks_form_exit_creation(), dt_masks_set_visible_form(), dt_develop_t::form_gui, and IS_NULL_PTR.
Referenced by _studio_dev_teardown(), and leave().
| int dt_masks_gui_confirm_delete_form_dialog | ( | const char * | form_name | ) |
Definition at line 578 of file masks_gui.c.
References dt_gui_get_global(), dt_gui_get_ui(), dt_gui_main_window(), and IS_NULL_PTR.
Referenced by dt_masks_remove_or_delete().
| gboolean dt_masks_gui_confirm_permanent_delete | ( | const char * | form_name | ) |
Ask the user to confirm a permanent shape deletion, gated by the "ask_before_delete_mask_shape" pref. Shows a "Always ask" checkbox that writes back to the pref regardless of the response. Returns TRUE immediately without showing anything when the pref is off.
Definition at line 602 of file masks_gui.c.
References dt_conf_get_bool(), dt_conf_set_bool(), dt_gui_get_global(), dt_gui_get_ui(), dt_gui_main_window(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _blendop_masks_all_delete(), _blendop_masks_group_delete(), _tree_row_action(), and dt_masks_delete_shape().
| void dt_masks_gui_form_create | ( | dt_masks_form_t * | mask_form, |
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_index, | ||
| dt_iop_module_t * | module | ||
| ) |
functions used to manipulate gui data
Definition at line 1914 of file masks_gui.c.
References dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, dt_masks_form_gui_points_t::border_skip_count, dt_masks_form_gui_points_t::border_skips, dt_masks_form_gui_t::dev, DT_DEBUG_MASKS, dt_geometry_chain_generation(), dt_get_debug_flags(), DT_MASKS_CLONE, dt_masks_form_update_gravity_center(), dt_masks_get_points_border(), dt_masks_gui_form_remove(), dt_masks_gui_outline_step(), dt_masks_gui_points_update_bbox(), DT_MASKS_RASTER_ERROR, DT_MASKS_RASTER_OK, dt_print(), dt_masks_form_t::formid, dt_masks_form_gui_t::formid, dt_develop_t::geometry_chain, dt_masks_form_gui_t::geometry_generation, IS_NULL_PTR, dt_masks_form_t::name, dt_masks_form_gui_t::outline_step_built, dt_masks_form_t::points, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_points_t::points_count, dt_masks_form_gui_points_t::source, dt_masks_form_gui_points_t::source_count, TRUE, dt_masks_form_t::type, and dt_masks_form_gui_t::type.
Referenced by _add_node_to_segment(), _add_node_to_segment(), _brush_events_mouse_moved(), _change_curvature(), _change_extent(), _change_fading(), _change_fading(), _change_fading(), _change_fading(), _change_rotation(), _change_rotation(), _change_size(), _change_size(), _change_size(), _change_size(), _circle_events_mouse_moved(), _dt_masks_events_flush_rebuild_if_needed(), _ellipse_events_button_released(), _ellipse_events_mouse_moved(), _gradient_events_button_pressed(), _gradient_events_button_released(), _gradient_events_mouse_moved(), _masks_draw_creation_session_forms(), _polygon_events_button_pressed(), _polygon_events_mouse_moved(), dt_masks_gui_form_create_throttled(), dt_masks_gui_form_test_create(), dt_masks_remove_node(), dt_masks_reset_bezier_ctrl_points(), and dt_masks_toggle_bezier_node_type().
| gboolean dt_masks_gui_form_create_throttled | ( | dt_masks_form_t * | mask_form, |
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_index, | ||
| dt_iop_module_t * | module, | ||
| float | posx, | ||
| float | posy | ||
| ) |
Definition at line 1976 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_geometry_chain_generation(), dt_get_wtime(), dt_masks_gui_form_create(), FALSE, dt_develop_t::geometry_chain, dt_masks_form_gui_t::geometry_generation, IS_NULL_PTR, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::rebuild_pending, and TRUE.
Referenced by _brush_events_mouse_moved(), and _polygon_events_mouse_moved().
| void dt_masks_gui_form_remove | ( | dt_masks_form_t * | mask_form, |
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_index | ||
| ) |
Definition at line 2433 of file masks_gui.c.
References dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, dt_masks_form_gui_points_t::border_skip_count, dt_masks_form_gui_points_t::border_skips, dt_masks_gui_points_update_bbox(), dt_pixelpipe_cache_free_align, dt_masks_form_gui_t::formid, dt_masks_form_gui_t::geometry_generation, IS_NULL_PTR, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_points_t::points_count, dt_masks_form_gui_points_t::source, and dt_masks_form_gui_points_t::source_count.
Referenced by dt_masks_gui_form_create().
| void dt_masks_gui_form_save_creation | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| dt_masks_form_t * | form, | ||
| dt_masks_form_gui_t * | gui | ||
| ) |
Save the form creation right after a shape has been finished drawing.
| dev | the develop structure |
| module | the module owning the mask |
| form | the form to save |
| gui | the GUI state of the form |
Definition at line 2525 of file masks_gui.c.
References _check_id(), _group_create(), _group_from_module(), dt_masks_form_gui_t::creation_closing_form, dt_masks_form_gui_t::creation_formids, dt_masks_form_gui_t::creation_last_formid, dt_masks_form_gui_t::creation_type, dt_conf_get_float(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_dev_add_history_item, dt_iop_gui_blend_masks_update(), dt_masks_append_form(), DT_MASKS_CLONE, dt_masks_cow_touch(), dt_masks_create(), dt_masks_dynbuf_free(), DT_MASKS_EVENT_ADD, dt_masks_form_exit_creation(), dt_masks_form_gui_points_free(), dt_masks_form_update_gravity_center(), DT_MASKS_GROUP, DT_MASKS_NON_CLONE, dt_masks_set_visible_form(), dt_masks_soft_reset_form_gui(), DT_MASKS_STATE_SHOW, DT_MASKS_STATE_UNION, DT_MASKS_STATE_USE, dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), DT_SIGNAL_MASK_CHANGED, FALSE, dt_masks_form_t::formid, dt_masks_form_gui_t::formid, dt_masks_form_group_t::formid, dt_develop_t::forms, dt_masks_form_t::functions, dt_masks_form_gui_t::geometry_generation, dt_masks_form_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, IS_NULL_PTR, dt_develop_t::masks_mutex, dt_masks_form_t::name, dt_masks_form_group_t::opacity, dt_masks_form_group_t::parentid, dt_masks_form_t::points, dt_masks_form_gui_t::points, dt_masks_functions_t::set_form_name, dt_masks_form_group_t::state, TRUE, and dt_masks_form_t::type.
Referenced by _brush_events_button_released(), _circle_events_button_pressed(), _ellipse_events_button_pressed(), _gradient_events_button_pressed(), _polygon_creation_closing_form(), and legacy_params().
| void dt_masks_gui_form_test_create | ( | dt_masks_form_t * | mask_form, |
| dt_masks_form_gui_t * | mask_gui, | ||
| dt_iop_module_t * | module | ||
| ) |
Definition at line 2456 of file masks_gui.c.
References dt_masks_form_gui_t::dev, DT_DEBUG_MASKS, dt_geometry_chain_generation(), dt_get_debug_flags(), dt_masks_form_gui_points_free(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_gui_form_create(), dt_masks_gui_outline_step(), dt_print(), dt_masks_form_gui_t::formid, dt_masks_form_group_t::formid, dt_develop_t::geometry_chain, dt_masks_form_gui_t::geometry_generation, IS_NULL_PTR, dt_masks_form_gui_t::outline_step_built, dt_masks_form_t::points, dt_masks_form_gui_t::points, and dt_masks_form_t::type.
Referenced by dt_masks_events_post_expose_with().
| void dt_masks_gui_init | ( | dt_develop_t * | dev | ) |
Definition at line 1420 of file masks_gui.c.
References dt_masks_clear_form_gui(), dt_masks_init_form_gui(), dt_masks_set_visible_form(), dt_develop_t::form_gui, dt_masks_form_gui_t::formid, dt_masks_form_gui_t::geometry_generation, and IS_NULL_PTR.
Referenced by _studio_dev_setup(), and enter().
| gboolean dt_masks_gui_is_dragging | ( | const dt_masks_form_gui_t * | gui | ) |
Definition at line 1475 of file masks_gui.c.
References dt_control_mouse_is_dragging(), FALSE, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_dragging, IS_NULL_PTR, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::seg_dragging, and dt_masks_form_gui_t::source_dragging.
Referenced by _brush_events_button_released(), _delayed_history_commit(), _dt_masks_events_flush_rebuild_if_needed(), _dt_masks_events_should_update_hover_on_move(), _polygon_events_button_released(), and mouse_moved().
| int dt_masks_gui_outline_step | ( | const dt_develop_t * | dev | ) |
The density the dev's GUI shows its outlines at, in image pixels between consecutive samples: what the view published through dt_masks_gui_set_outline_density(), 1 for a dev with no GUI state. Implemented in masks_gui.c, which owns that state; declared here because the GUI supplier below is what reads it.
Definition at line 1908 of file masks_gui.c.
References dt_develop_t::form_gui, IS_NULL_PTR, MAX, and dt_masks_form_gui_t::outline_step.
Referenced by _masks_draw_creation_session_forms(), _overlay_report(), _time_hit_test(), dt_masks_distort_for_gui(), dt_masks_gui_form_create(), and dt_masks_gui_form_test_create().
| void dt_masks_gui_points_update_bbox | ( | dt_masks_form_gui_points_t * | gp | ) |
Recompute bbox from the samples gp holds.
Definition at line 2421 of file masks_gui.c.
References _gui_points_bbox_extend(), dt_masks_form_gui_points_t::bbox, dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, IS_NULL_PTR, dt_masks_form_gui_points_t::points, dt_masks_form_gui_points_t::points_count, dt_masks_form_gui_points_t::source, and dt_masks_form_gui_points_t::source_count.
Referenced by dt_masks_gui_form_create(), and dt_masks_gui_form_remove().
| void dt_masks_gui_populate_interaction_sliders | ( | GtkWidget * | menu, |
| dt_develop_t * | dev, | ||
| dt_masks_form_t * | form, | ||
| const int | group_id, | ||
| dt_masks_form_gui_t * | gui, | ||
| dt_iop_module_t * | module | ||
| ) |
Append the full set of shape-parameter sliders (size/fading/rotation or curvature/fade/rotation depending on shape type, plus opacity) for form/op_form to menu. op_form is the group-membership entry the sliders read/write (see dt_masks_form_group_t) and must already be a live, COW-safe pointer into the owning group's points list.
Definition at line 798 of file masks_gui.c.
References DT_MASKS_ELLIPSE, dt_masks_form_get_interaction_value(), DT_MASKS_GRADIENT, dt_masks_group_get_member(), dt_masks_gui_add_interaction_slider(), DT_MASKS_INCREMENT_ABSOLUTE, DT_MASKS_INCREMENT_SCALE, DT_MASKS_INTERACTION_FADING, DT_MASKS_INTERACTION_OPACITY, DT_MASKS_INTERACTION_ROTATION, DT_MASKS_INTERACTION_SIZE, DT_MASKS_OK, dt_masks_form_t::formid, IS_NULL_PTR, and dt_masks_form_t::type.
Referenced by _blendop_masks_group_ctx_menu(), _tree_context_menu(), and dt_masks_create_menu().
| gboolean dt_masks_gui_remove | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | form, | ||
| dt_masks_form_gui_t * | gui, | ||
| const int | parentid | ||
| ) |
remove a mask shape or node form from the GUI. This function is used with a popupmenu "Delete" action.
| module | The module owning the mask |
| form | The form to remove |
| gui | The GUI state of the form |
| parentid | The parent ID of the form |
Definition at line 2378 of file masks_gui.c.
References _masks_remove_shape(), DT_MASKS_EDIT_FULL, dt_masks_form_exit_creation(), DT_MASKS_IS_PATH_SHAPE, dt_masks_remove_node(), dt_masks_remove_or_delete(), dt_masks_form_gui_t::edit_mode, FALSE, dt_masks_form_t::formid, g_list_shorter_than(), dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_t::points, TRUE, and dt_masks_form_t::type.
Referenced by _group_events_key_pressed(), and dt_masks_events_key_pressed().
| void dt_masks_gui_reset_dragging | ( | dt_masks_form_gui_t * | gui | ) |
Definition at line 1463 of file masks_gui.c.
References FALSE, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_dragging, IS_NULL_PTR, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::seg_dragging, and dt_masks_form_gui_t::source_dragging.
Referenced by _time_hit_test(), and dt_masks_events_button_released().
| void dt_masks_gui_set_dragging | ( | dt_masks_form_gui_t * | gui | ) |
Definition at line 1449 of file masks_gui.c.
References dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, IS_NULL_PTR, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::seg_dragging, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_dragging, dt_masks_form_gui_t::source_selected, and TRUE.
Referenced by _apply_gui_button_pressed_state().
| void dt_masks_gui_set_outline_density | ( | dt_masks_form_gui_t * | gui, |
| double | image_px_per_device_px | ||
| ) |
Publish the density the view shows into the dev's GUI state: image_px_per_device_px is what one device pixel spans in image pixels (dt_draw_min_emit_step() on the transformed context). The outlines are sampled at whole image pixels, never finer than one. dt_masks_gui_outline_step() (masks/masks_distort.h) reads it back.
Definition at line 1901 of file masks_gui.c.
References IS_NULL_PTR, and dt_masks_form_gui_t::outline_step.
Referenced by _outline_density_apply(), and dt_masks_events_post_expose_with().
| void dt_masks_init_form_gui | ( | dt_develop_t * | dev, |
| dt_masks_form_gui_t * | gui | ||
| ) |
Reset a form GUI state and bind it to its owning develop instance (gui->dev).
Definition at line 1847 of file masks_gui.c.
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::dev, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, dt_masks_form_gui_t::last_hit_test_pos, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_gui_t::outline_step, dt_masks_form_gui_t::pivot_selected, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::pos_source, dt_masks_form_gui_t::raw_pos, dt_masks_form_gui_t::rebuild_pending, dt_masks_form_gui_t::rel_pos, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_pos_type, and dt_masks_form_gui_t::source_selected.
Referenced by _masks_draw_creation_session_forms(), _outline_density_apply(), _time_overlay_form(), dt_masks_debug_write_png(), and dt_masks_gui_init().
| const char * dt_masks_interaction_alias_name | ( | dt_masks_interaction_t | interaction | ) |
The other word for a property, when a shape family spells it its own way.
A gradient stores its fade extent in the SIZE slot and its curvature in the FADING one – same property of the interaction API, different vocabulary in front of the user, which is also why the context menu renames those two sliders for gradients. Any UI naming a property generically must show both words, or the gradient's own vocabulary has no visible home.
Definition at line 3183 of file masks_gui.c.
References DT_MASKS_INTERACTION_FADING.
Referenced by _blendop_masks_create_scroll_grid().
| const char * dt_masks_interaction_name | ( | dt_masks_interaction_t | interaction | ) |
Definition at line 3165 of file masks_gui.c.
References DT_MASKS_INTERACTION_FADING, DT_MASKS_INTERACTION_OPACITY, DT_MASKS_INTERACTION_ROTATION, DT_MASKS_INTERACTION_SIZE, and DT_MASKS_INTERACTION_UNDEF.
Referenced by _blendop_masks_create_scroll_grid().
Definition at line 4981 of file masks_gui.c.
References _group_from_module(), dt_alloc_align(), dt_bauhaus_combobox_add(), dt_bauhaus_combobox_length(), dt_bauhaus_combobox_remove_at(), dt_free, dt_free_align, dt_history_item_get_name(), dt_iop_request_focus(), DT_MASKS_CLONE, DT_MASKS_GROUP, DT_MASKS_NON_CLONE, dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), dt_masks_form_t::formid, dt_masks_form_group_t::formid, IOP_FLAGS_NO_MASKS, IOP_FLAGS_SUPPORTS_BLENDING, dt_iop_gui_blend_data_t::masks_combo, dt_iop_gui_blend_data_t::masks_combo_ids, dt_masks_form_t::name, dt_masks_form_t::points, and dt_masks_form_t::type.
| void dt_masks_iop_value_changed_callback | ( | GtkWidget * | widget, |
| struct dt_iop_module_t * | module | ||
| ) |
Definition at line 5065 of file masks_gui.c.
References _menu_add_exist(), _menu_add_shape(), _menu_no_masks(), dt_iop_module_gui_t::blend_data, dt_iop_module_t::dev, dt_bauhaus_combobox_get(), dt_dev_add_history_item, dt_iop_gui_blend_masks_update(), DT_MASKS_BRUSH, DT_MASKS_CIRCLE, DT_MASKS_EDIT_FULL, DT_MASKS_ELLIPSE, DT_MASKS_GRADIENT, dt_masks_iop_use_same_as(), DT_MASKS_POLYGON, dt_masks_set_edit_mode(), dt_iop_module_t::gui, dt_develop_t::iop, dt_iop_gui_blend_data_t::masks_combo, dt_iop_gui_blend_data_t::masks_combo_ids, and TRUE.
| gboolean dt_masks_is_anything_hovered | ( | const dt_masks_form_gui_t * | mask_gui | ) |
Returns TRUE if anything in the mask is hovered at all, regardless of what it is.
Definition at line 2668 of file masks_gui.c.
References dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::node_hovered, and dt_masks_form_gui_t::seg_hovered.
Referenced by _dt_masks_events_group_update_selection(), _set_cursor_shape(), and dt_masks_events_button_pressed().
| gboolean dt_masks_is_anything_selected | ( | const dt_masks_form_gui_t * | mask_gui | ) |
Returns TRUE if anything in the mask is selected at all, regardless of what it is.
Definition at line 2658 of file masks_gui.c.
References dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_selected, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::seg_selected, and dt_masks_form_gui_t::source_selected.
Referenced by _brush_events_mouse_scrolled(), _polygon_events_mouse_scrolled(), _set_cursor_shape(), dt_masks_draw_path_seg_by_seg(), dt_masks_events_button_pressed(), and dt_masks_events_mouse_scrolled().
| gboolean dt_masks_node_is_cusp | ( | const dt_masks_form_gui_points_t * | gui_points, |
| const int | node_index | ||
| ) |
returns wether a node is a corner or not. A node is a corner if its 2 control handles are at the same position, else it's a curve.
| gpt | the GUI points of the mask form |
| index | the index of the node to test |
| nb | the number of coord by node |
| coord_offset | the offset of the coordinates in the points array |
Definition at line 3282 of file masks_gui.c.
References FALSE, IS_NULL_PTR, dt_masks_form_gui_points_t::points, and dt_masks_form_gui_points_t::points_count.
Referenced by _brush_events_button_pressed(), _brush_events_post_expose(), _brush_populate_context_menu(), _polygon_events_button_pressed(), _polygon_events_post_expose(), _polygon_populate_context_menu(), dt_masks_find_closest_handle_common(), dt_masks_reset_bezier_ctrl_points(), and dt_masks_toggle_bezier_node_type().
Ask the centre widget for a redraw of what the last overlay frame touched, grown by the pointer's motion since, instead of the whole widget: for a motion the masks handled and nothing else did. Falls back to the whole widget when no frame has been recorded.
Definition at line 4550 of file masks_gui.c.
References _overlay_damage, _overlay_damage_valid, _overlay_pointer_delta, and IS_NULL_PTR.
Referenced by mouse_moved().
| int dt_masks_point_in_form_exact | ( | const float * | test_points, |
| int | test_point_count, | ||
| const float * | form_points, | ||
| int | form_points_start, | ||
| int | form_points_count, | ||
| const dt_masks_skip_range_t * | skips, | ||
| int | skip_count | ||
| ) |
Check whether any 2D point in pts[] lies inside the form points[].
Ray-cast point-in-polygon over a form point stream, honouring skip ranges.
We use the ray casting algorithm for each tested point.
| pts | Flat array of tested points [x0, y0, x1, y1, ...]. |
| num_pts | Number of tested points in pts. |
| points | The array of form vertices. |
| points_start | The starting index of the form vertices in the array. |
| points_count | The total number of vertices in the form. |
Definition at line 5403 of file masks_gui.c.
References DT_DEBUG_ALWAYS, dt_print(), FALSE, i, IS_NULL_PTR, dt_masks_skip_range_t::resume_at, and TRUE.
Referenced by _circle_get_distance(), _ellipse_get_distance(), _polygon_get_distance(), and dt_masks_draw_source().
| gboolean dt_masks_point_is_within_radius | ( | const float | point_x, |
| const float | point_y, | ||
| const float | center_x, | ||
| const float | center_y, | ||
| const float | squared_radius | ||
| ) |
Check whether a point lies within a squared radius of a center.
Check if a point (px,py) is inside a radius from a center point (cx,cy)
Assumptions/caveats:
Definition at line 1157 of file masks_gui.c.
Referenced by dt_masks_find_closest_handle_common().
| int dt_masks_points_shift_to_source | ( | dt_develop_t * | dev, |
| const dt_iop_module_t * | module, | ||
| float ** | points, | ||
| int * | points_count, | ||
| const float | xs, | ||
| const float | ys, | ||
| const int | first_shifted | ||
| ) |
Definition at line 6103 of file masks_gui.c.
References __OMP_PARALLEL_FOR_SIMD__, dt_dev_coordinates_raw_norm_to_raw_abs(), dt_dev_distort_transform_gui(), DT_DEV_TRANSFORM_DIR_BACK_EXCL, DT_DEV_TRANSFORM_DIR_FORW_INCL, dt_pixelpipe_cache_free_align, error(), i, and dt_iop_module_t::iop_order.
| int dt_masks_preview_add_clone_source | ( | struct dt_masks_form_gui_t * | gui, |
| struct dt_masks_preview_buffers_t * | preview | ||
| ) |
Give a creation preview its clone-source outline: the target outline, offset by the drag.
Allocates preview->source_points from preview->points, which must already be populated. Returns 0 on success, 1 on allocation failure – the caller's own error convention.
Definition at line 6083 of file masks_gui.c.
References dt_masks_calculate_source_pos_origin(), dt_pixelpipe_cache_alloc_align_float_cache, FALSE, i, IS_NULL_PTR, dt_masks_form_gui_t::pos, and preview.
Referenced by _circle_get_creation_preview(), and _ellipse_get_creation_preview().
| void dt_masks_remove_form | ( | dt_develop_t * | develop, |
| dt_masks_form_t * | mask_form | ||
| ) |
Definition at line 2515 of file masks_gui.c.
References dt_masks_form_unref(), dt_pthread_rwlock_unlock(), dt_pthread_rwlock_wrlock(), dt_develop_t::forms, and dt_develop_t::masks_mutex.
Referenced by dt_masks_form_delete().
| void dt_masks_remove_node | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | mask_form, | ||
| int | parent_id, | ||
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_index, | ||
| int | node_index | ||
| ) |
Definition at line 2020 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_free, dt_masks_cow_touch(), dt_masks_gui_form_create(), FALSE, dt_masks_form_t::functions, dt_masks_functions_t::init_ctrl_points, IS_NULL_PTR, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, and dt_masks_form_t::points.
Referenced by _masks_gui_delete_node_callback(), _polygon_events_key_pressed(), and dt_masks_gui_remove().
| gboolean dt_masks_remove_or_delete | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | sel, | ||
| int | parent_id, | ||
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_id | ||
| ) |
If the form to remove is used once, ask to the user if he wants to delete it from the list or just remove and keep for later reuse.
| module | The module owning the mask |
| sel | The form to remove |
| parent_id | The parent ID of the form |
| mask_gui | The GUI state of the form |
| form_id | The form ID of the form to remove |
Definition at line 2214 of file masks_gui.c.
References _masks_gui_form_group_use_count(), _masks_remove_or_delete_finish(), dt_masks_form_gui_t::dev, dt_masks_gui_confirm_delete_form_dialog(), FALSE, IS_NULL_PTR, and dt_masks_form_t::name.
Referenced by dt_masks_gui_remove().
| gboolean dt_masks_remove_shape_from_group | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | sel, | ||
| int | parent_id, | ||
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_id | ||
| ) |
Remove the form from its current group only, keeping it around unused for potential reuse. Never asks for confirmation, since nothing is destroyed.
Definition at line 2235 of file masks_gui.c.
References _masks_remove_or_delete_finish(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _masks_gui_remove_from_group_callback().
| gboolean dt_masks_reset_bezier_ctrl_points | ( | struct dt_iop_module_t * | module, |
| struct dt_masks_form_t * | mask_form, | ||
| struct dt_masks_form_gui_t * | mask_gui, | ||
| const int | form_index, | ||
| const struct dt_masks_form_gui_points_t * | gui_points, | ||
| const int | node_index, | ||
| dt_masks_points_states_t * | state | ||
| ) |
Definition at line 1123 of file masks_gui.c.
References dt_masks_gui_form_create(), dt_masks_node_is_cusp(), DT_MASKS_POINT_STATE_NORMAL, FALSE, dt_masks_form_t::functions, dt_masks_functions_t::init_ctrl_points, IS_NULL_PTR, state, and TRUE.
Referenced by _brush_reset_round_node_callback(), and _polygon_reset_round_node_callback().
| void dt_masks_reset_form_gui | ( | dt_develop_t * | dev | ) |
Definition at line 4894 of file masks_gui.c.
References dt_masks_change_form_gui(), DT_MASKS_EDIT_OFF, dt_masks_shape_buttons_deactivate_all(), IOP_FLAGS_NO_MASKS, IOP_FLAGS_SUPPORTS_BLENDING, IS_NULL_PTR, dt_iop_gui_blend_data_t::masks_edit, and dt_iop_gui_blend_data_t::masks_shown.
Referenced by dt_iop_request_focus(), and gui_reset().
| void dt_masks_reset_show_masks_icons | ( | dt_develop_t * | dev | ) |
Definition at line 4909 of file masks_gui.c.
References DT_MASKS_EDIT_OFF, dt_masks_shape_buttons_deactivate_all(), FALSE, dt_develop_t::iop, IOP_FLAGS_SUPPORTS_BLENDING, and IS_NULL_PTR.
Referenced by _tree_selection_change().
| float dt_masks_rotate_with_anchor | ( | dt_develop_t * | develop, |
| const float | anchor[2], | ||
| const float | center[2], | ||
| dt_masks_form_gui_t * | mask_gui | ||
| ) |
Compute rotation angle (degrees) around a center using an anchor point.
Rotate a mask shape around its center. WARNING: gui->delta will be updated with the new position after rotation.
anchor, center, and mask_gui->delta are absolute output-image coordinates. The angle accounts for possible axis inversion due to distortion transforms. Updates mask_gui->delta to store the last anchor position.
Definition at line 5706 of file masks_gui.c.
References dt_masks_form_gui_t::delta, dt_dev_coordinates_image_abs_to_raw_abs(), and M_PI.
Referenced by _ellipse_events_mouse_moved(), and _gradient_events_mouse_moved().
| dt_masks_interaction_t dt_masks_scroll_get_interaction | ( | uint32_t | key_state | ) |
Resolve a wheel event's key state into the property it edits.
Definition at line 3196 of file masks_gui.c.
References DT_MASKS_INTERACTION_UNDEF, dt_masks_scroll_mapping_get(), DT_MASKS_SCROLL_PLAIN, DT_MASKS_SCROLL_PRIMARY, DT_MASKS_SCROLL_PRIMARY_SHIFT, DT_MASKS_SCROLL_SHIFT, dt_modifier_is(), DT_PRIMARY_MASK, and state.
Referenced by dt_masks_events_mouse_scrolled().
| dt_masks_interaction_t dt_masks_scroll_mapping_get | ( | dt_masks_scroll_modifier_t | modifier | ) |
Property mapped to modifier, or DT_MASKS_INTERACTION_UNDEF when that row is unmapped.
Definition at line 3127 of file masks_gui.c.
References _interaction_conf_values, _scroll_conf_keys, dt_conf_get_string_const(), DT_MASKS_INTERACTION_LAST, DT_MASKS_INTERACTION_UNDEF, DT_MASKS_SCROLL_MODIFIER_LAST, i, IS_NULL_PTR, and value.
Referenced by _blendop_masks_create_scroll_grid(), _blendop_masks_scroll_sync(), and dt_masks_scroll_get_interaction().
| void dt_masks_scroll_mapping_set | ( | dt_masks_scroll_modifier_t | modifier, |
| dt_masks_interaction_t | interaction | ||
| ) |
Map interaction (DT_MASKS_INTERACTION_UNDEF to unmap) to modifier, persisted in conf.
Definition at line 3140 of file masks_gui.c.
References _interaction_conf_values, _scroll_conf_keys, dt_conf_set_string(), DT_MASKS_INTERACTION_LAST, DT_MASKS_INTERACTION_UNDEF, and DT_MASKS_SCROLL_MODIFIER_LAST.
Referenced by _blendop_masks_scroll_toggled().
| const char * dt_masks_scroll_modifier_name | ( | dt_masks_scroll_modifier_t | modifier | ) |
Untranslated name of a wheel row / of a property, for GUI labels. Never NULL.
Definition at line 3149 of file masks_gui.c.
References DT_MASKS_SCROLL_PLAIN, DT_MASKS_SCROLL_PRIMARY, DT_MASKS_SCROLL_PRIMARY_SHIFT, and DT_MASKS_SCROLL_SHIFT.
Referenced by _blendop_masks_create_scroll_grid().
| void dt_masks_select_form | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| dt_masks_form_t * | selected_form | ||
| ) |
Select or clear the current mask form, notifying the owning module if needed.
Passing NULL clears the selection.
Definition at line 5527 of file masks_gui.c.
References dt_masks_form_t::formid, and IS_NULL_PTR.
Referenced by _brush_events_button_released(), _masks_remove_or_delete_finish(), dt_masks_clear_form_gui(), and dt_masks_events_button_pressed().
| void dt_masks_set_edit_mode | ( | struct dt_iop_module_t * | module, |
| dt_masks_edit_mode_t | value | ||
| ) |
Definition at line 5809 of file masks_gui.c.
References dt_iop_module_t::blend_params, dt_iop_module_t::dev, dt_control_queue_redraw_center(), dt_dev_masks_selection_change(), dt_masks_change_form_gui(), dt_masks_create_ext(), DT_MASKS_EDIT_OFF, dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_ungroup(), FALSE, dt_masks_form_t::formid, IS_NULL_PTR, dt_develop_blend_params_t::mask_id, dt_iop_gui_blend_data_t::masks_edit, dt_iop_gui_blend_data_t::masks_shown, dt_iop_gui_blend_data_t::masks_support, TRUE, and value.
Referenced by _blendop_masks_all_toggled(), _blendop_masks_group_selection_changed(), _blendop_masks_show_and_edit(), _brush_events_button_released(), _edit_masks(), _menu_add_exist(), _menu_no_masks(), _pop_undo(), dt_iop_gui_blend_masks_update(), dt_iop_gui_blending_lose_focus(), dt_iop_gui_update_blending(), dt_masks_form_exit_creation(), dt_masks_iop_value_changed_callback(), and gui_focus().
| void dt_masks_set_source_pos_initial_state | ( | dt_masks_form_gui_t * | mask_gui, |
| const uint32_t | key_state | ||
| ) |
Decide initial source positioning mode for clone masks.
Uses key modifiers to choose absolute vs. relative positioning, and stores the reference position in preview coordinates. The current implementation caches that reference in absolute output-image coordinates.
Definition at line 5545 of file masks_gui.c.
References DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_modifier_is(), DT_PRIMARY_MASK, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::pos_source, and dt_masks_form_gui_t::source_pos_type.
Referenced by _brush_events_button_pressed(), _circle_events_button_pressed(), _ellipse_events_button_pressed(), and _polygon_events_button_pressed().
| void dt_masks_set_source_pos_initial_value | ( | dt_masks_form_gui_t * | mask_gui, |
| dt_masks_form_t * | mask_form | ||
| ) |
Initialize the clone source position based on current GUI state.
Handles first-time relative positioning, existing relative offsets, and absolute coordinates. Updates mask_form->source accordingly. mask_gui->rel_pos is the normalized output-image cursor, while mask_gui->pos_source stores either an absolute output-image position or an absolute output-image delta depending on the current source mode.
Definition at line 5570 of file masks_gui.c.
References dt_masks_form_gui_t::dev, dt_dev_coordinates_image_abs_to_raw_abs(), dt_dev_coordinates_image_abs_to_raw_norm(), dt_dev_coordinates_raw_abs_to_raw_norm(), dt_dev_geometry_snapshot(), DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_masks_form_t::functions, geometry, dt_masks_functions_t::initial_source_pos, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::pos_source, dt_masks_form_t::source, and dt_masks_form_gui_t::source_pos_type.
Referenced by _brush_events_button_pressed(), _circle_init_new(), _ellipse_init_new(), and _polygon_events_button_pressed().
| void dt_masks_set_visible_form | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | form | ||
| ) |
Definition at line 1414 of file masks_gui.c.
References dt_develop_t::form_gui, dt_masks_form_gui_t::form_visible, and IS_NULL_PTR.
Referenced by _shape_manager_handler_callback(), dt_masks_change_form_gui(), dt_masks_form_exit_creation(), dt_masks_gui_cleanup(), dt_masks_gui_form_save_creation(), and dt_masks_gui_init().
| GtkWidget * dt_masks_shape_buttons_create | ( | const dt_masks_shape_buttons_config_t * | config | ) |
Build a synchronized toolbar for creating masks shapes.
The buttons all use the same creation callback and listen to a process-wide deactivation signal. This keeps multiple mask toolbars, such as blending, retouch and the shape manager, from showing stale active buttons after another toolbar starts or exits a shape creation.
Definition at line 308 of file masks_gui.c.
References _masks_shape_button_defs, _masks_shape_button_pressed(), _masks_shape_buttons_deactivate_signal(), _masks_shape_buttons_destroy(), _masks_shape_buttons_sync_signal(), dt_masks_shape_buttons_config_t::action_section, dt_masks_shape_buttons_data_t::box, dt_masks_shape_buttons_data_t::buttons, dt_masks_shape_buttons_config_t::buttons, dt_masks_shape_buttons_data_t::config, dt_masks_shape_button_def_t::ctrl_label, dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_CONNECT, DT_GUI_BOX_SPACING, dt_iop_togglebutton_new(), dt_iop_togglebutton_new_no_register(), DT_SIGNAL_MASK_SHAPE_BUTTONS_DEACTIVATE, DT_SIGNAL_MASK_SHAPE_BUTTONS_SYNC, dtgtk_togglebutton_new(), FALSE, dt_masks_shape_button_def_t::flag, dt_masks_shape_buttons_config_t::flags, i, dt_masks_shape_button_def_t::index, IS_NULL_PTR, dt_masks_shape_button_def_t::label, dt_masks_shape_buttons_config_t::local, dt_masks_shape_buttons_config_t::owner_module, dt_masks_shape_button_def_t::paint, dt_masks_shape_buttons_config_t::register_flags, dt_masks_shape_button_def_t::type, dt_masks_shape_buttons_data_t::types, and dt_masks_shape_buttons_config_t::types.
Referenced by _blendop_masks_create_shape_buttons(), gui_init(), and gui_init().
Definition at line 113 of file masks_gui.c.
References dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, and DT_SIGNAL_MASK_SHAPE_BUTTONS_DEACTIVATE.
Referenced by _blendop_masks_show_and_edit(), _masks_shape_button_pressed(), _shape_manager_recreate_list(), dt_iop_gui_blending_lose_focus(), dt_iop_gui_update_blending(), dt_masks_form_exit_creation(), dt_masks_reset_form_gui(), dt_masks_reset_show_masks_icons(), gui_focus(), and rt_edit_masks_callback().
Make every shape toolbar show the shape currently being created, if any.
The pressed button is a view on the creation state, so any code arming or re-arming a creation outside a toolbar button calls this. dt_masks_creation_mode_enter() already does.
Definition at line 176 of file masks_gui.c.
References dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_RAISE, and DT_SIGNAL_MASK_SHAPE_BUTTONS_SYNC.
Referenced by dt_masks_creation_mode_enter().
| GtkWidget * dt_masks_shape_menu_item_new | ( | GtkWidget * | menu, |
| const dt_masks_type_t | type, | ||
| GCallback | activate_callback, | ||
| gpointer | user_data | ||
| ) |
Append a menu entry for one shape type: its toolbar icon, then its toolbar label.
The icon and the name both come from the same table the shape toolbars are built from, so a menu offering a shape and the button offering it cannot drift apart. Returns the entry, or NULL for a type no toolbar knows.
Definition at line 210 of file masks_gui.c.
References _masks_shape_button_def(), _masks_shape_icon_draw(), DT_GUI_BOX_SPACING, DT_PIXEL_APPLY_DPI, FALSE, IS_NULL_PTR, dt_masks_shape_button_def_t::name, dt_masks_shape_button_def_t::paint, size, and type.
Referenced by _tree_add_shape_menu_item().
| void dt_masks_soft_reset_form_gui | ( | dt_masks_form_gui_t * | mask_gui | ) |
Definition at line 1877 of file masks_gui.c.
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::delta, FALSE, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_rotating, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, dt_masks_form_gui_t::last_hit_test_pos, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_gui_t::pivot_selected, dt_masks_form_gui_t::rebuild_pending, dt_masks_form_gui_t::seg_dragging, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, and dt_masks_form_gui_t::source_selected.
Referenced by _dt_masks_events_group_update_selection(), and dt_masks_gui_form_save_creation().
| gboolean dt_masks_toggle_bezier_node_type | ( | struct dt_iop_module_t * | module, |
| struct dt_masks_form_t * | mask_form, | ||
| struct dt_masks_form_gui_t * | mask_gui, | ||
| const int | form_index, | ||
| const struct dt_masks_form_gui_points_t * | gui_points, | ||
| const int | node_index, | ||
| float | node[2], | ||
| float | ctrl1[2], | ||
| float | ctrl2[2], | ||
| dt_masks_points_states_t * | state | ||
| ) |
Definition at line 1095 of file masks_gui.c.
References dt_masks_gui_form_create(), dt_masks_node_is_cusp(), DT_MASKS_POINT_STATE_NORMAL, DT_MASKS_POINT_STATE_USER, FALSE, dt_masks_form_t::functions, dt_masks_functions_t::init_ctrl_points, IS_NULL_PTR, state, and TRUE.
Referenced by _brush_events_button_pressed(), _brush_switch_node_callback(), _polygon_events_button_pressed(), and _polygon_switch_node_callback().
|
inlinestatic |
Definition at line 4132 of file masks_gui.c.
Referenced by _bound_header_reach().
|
static |
Definition at line 4038 of file masks_gui.c.
Referenced by _canvas_acquire().
|
static |
Definition at line 4040 of file masks_gui.c.
Referenced by _canvas_acquire().
|
static |
Definition at line 4039 of file masks_gui.c.
Referenced by _canvas_acquire().
|
static |
Definition at line 3119 of file masks_gui.c.
Referenced by dt_masks_scroll_mapping_get(), and dt_masks_scroll_mapping_set().
|
static |
Definition at line 81 of file masks_gui.c.
Referenced by _masks_shape_button_def(), and dt_masks_shape_buttons_create().
|
static |
Definition at line 4547 of file masks_gui.c.
Referenced by _overlay_damage_record(), and dt_masks_overlay_queue_redraw().
|
static |
Definition at line 4548 of file masks_gui.c.
Referenced by _overlay_damage_record(), and dt_masks_overlay_queue_redraw().
|
static |
Definition at line 2820 of file masks_gui.c.
Referenced by dt_masks_events_mouse_moved().
|
static |
Definition at line 2821 of file masks_gui.c.
Referenced by dt_masks_events_mouse_moved(), and dt_masks_overlay_queue_redraw().
|
static |
Definition at line 2822 of file masks_gui.c.
Referenced by dt_masks_events_mouse_moved().
|
static |
Definition at line 3110 of file masks_gui.c.
Referenced by dt_masks_scroll_mapping_get(), and dt_masks_scroll_mapping_set().
|
static |
x0, y0, x1, y1
Definition at line 3683 of file masks_gui.c.
Referenced by _masks_draw_creation_session_forms(), _session_bound_include(), and _session_clip().
|
static |
Definition at line 3682 of file masks_gui.c.
Referenced by _masks_draw_creation_session_forms(), _session_bbox_invalidate(), _session_bound_include(), and _session_clip().
|
static |
Draw completed shapes from the current creation session.
During continuous creation, the GUI-visible form must remain the unfinished shape because creation previews and mouse handlers read it directly. The ids stored in creation_formids are therefore drawn explicitly here, so only the shapes created in this session stay visible until creation mode is exited.
Definition at line 3652 of file masks_gui.c.
Referenced by _masks_draw_creation_session_forms(), and _session_gui_reset().
|
static |
Definition at line 3655 of file masks_gui.c.
Referenced by _masks_draw_creation_session_forms(), and _session_gui_reset().
|
static |
Definition at line 3654 of file masks_gui.c.
Referenced by _masks_draw_creation_session_forms(), and _session_gui_reset().
|
static |
Definition at line 3653 of file masks_gui.c.
Referenced by _masks_draw_creation_session_forms(), and _session_gui_reset().
|
static |
Definition at line 3672 of file masks_gui.c.
Referenced by _masks_draw_creation_session_forms(), and _session_pattern_reset().
|
static |
Definition at line 3673 of file masks_gui.c.
Referenced by _masks_draw_creation_session_forms(), and _session_pattern_reset().
|
static |
Definition at line 3709 of file masks_gui.c.
Referenced by _masks_draw_creation_session_forms(), and _session_sigs_reset().
|
static |
Definition at line 3710 of file masks_gui.c.
Referenced by _masks_draw_creation_session_forms(), and _session_sigs_reset().
|
static |
Definition at line 4397 of file masks_gui.c.
Referenced by _overlay_finish(), and _static_layer_ensure().
|
static |
Definition at line 4399 of file masks_gui.c.
Referenced by _static_layer_ensure().
|
static |
Definition at line 4400 of file masks_gui.c.
Referenced by _static_layer_ensure().
|
static |
Definition at line 4398 of file masks_gui.c.
Referenced by _static_layer_ensure().