Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
masks_types.h
Go to the documentation of this file.
1/*
2 This file is part of Ansel,
3 Copyright (C) 2026 Aurélien PIERRE.
4
5 Ansel is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Ansel is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Ansel. If not, see <http://www.gnu.org/licenses/>.
17*/
18
35#ifndef DT_DEVELOP_MASKS_TYPES_H
36#define DT_DEVELOP_MASKS_TYPES_H
37
38#include <glib.h>
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
46#define DT_MASKS_FORM_NAME_LEN 128
47
55
58#define DEVELOP_MASKS_NB_SHAPES 5
59
85
100
107
114
115/*
116* Type of user interaction to map with internal properties of masks.
117* Those used to be deduced implicitly by each shape from Shift/Ctrl/Shift+Ctrl + mouse
118* scroll, which is a shitty design when using Wacom tablets. No shape reads key modifiers
119* any more: the wheel is resolved once, against the user's mapping, by
120* dt_masks_scroll_get_interaction() -- see masks_gui.h -- and every entry point
121* (mouse_scroll callback, context-menu sliders) names the property it acts on.
122*/
124{
125 DT_MASKS_INTERACTION_UNDEF = 0, // no property: an unmapped wheel combination does nothing
126 DT_MASKS_INTERACTION_SIZE = 1, // property of the form (shape), explicit
127 DT_MASKS_INTERACTION_FADING = 2, // property of the form (shape), explicit
128 DT_MASKS_INTERACTION_OPACITY = 3, // property of the group in which the form is included, explicit
129 DT_MASKS_INTERACTION_ROTATION = 4, // property of the form (shape), explicit
132
141
150{
151 DT_MASKS_OK = 0, /* the model changed */
152 DT_MASKS_UNCHANGED, /* legal request, nothing to do -- caller skips the history commit */
153 DT_MASKS_NOT_FOUND, /* no such group, or no such member in it */
154 DT_MASKS_INVALID /* refused: not a group, self-inclusion, bad argument */
156
171typedef struct dt_masks_member_t
172{
174 int parentid; /* the row's AUTHORED origin; not always the group holding it */
175 guint index; /* position == compositing order == GTK row identity */
176 dt_masks_state_t state; /* tightened from the stored struct's plain int */
177 float opacity;
179
191{
195 gboolean is_group;
196 gboolean is_retouch; /* (type & DT_MASKS_IS_RETOUCHE) != 0 */
197 guint member_count; /* 0 unless is_group */
200
230
231#ifdef __cplusplus
232}
233#endif
234
235#endif // DT_DEVELOP_MASKS_TYPES_H
236
237// clang-format off
238// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
239// vim: shiftwidth=2 expandtab tabstop=2 cindent
240// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
241// clang-format on
#define DT_MASKS_FORM_NAME_LEN
Definition masks_types.h:46
dt_masks_edit_mode_t
@ DT_MASKS_EDIT_RESTRICTED
@ DT_MASKS_EDIT_OFF
@ DT_MASKS_EDIT_FULL
dt_masks_state_t
Definition masks_types.h:87
@ DT_MASKS_STATE_DIFFERENCE
Definition masks_types.h:94
@ DT_MASKS_STATE_INVERSE
Definition masks_types.h:91
@ DT_MASKS_STATE_INTERSECTION
Definition masks_types.h:93
@ DT_MASKS_STATE_IS_COMBINE_OP
Definition masks_types.h:98
@ DT_MASKS_STATE_SHOW
Definition masks_types.h:90
@ DT_MASKS_STATE_EXCLUSION
Definition masks_types.h:95
@ DT_MASKS_STATE_NONE
Definition masks_types.h:88
@ DT_MASKS_STATE_UNION
Definition masks_types.h:92
@ DT_MASKS_STATE_USE
Definition masks_types.h:89
@ DT_MASKS_STATE_NOOP
Definition masks_types.h:96
dt_masks_type_t
Definition masks_types.h:62
@ DT_MASKS_NON_CLONE
Definition masks_types.h:71
@ DT_MASKS_ALL
Definition masks_types.h:73
@ DT_MASKS_POLYGON
Definition masks_types.h:65
@ DT_MASKS_BRUSH
Definition masks_types.h:70
@ DT_MASKS_IS_PATH_SHAPE
Definition masks_types.h:81
@ DT_MASKS_IS_OPEN_SHAPE
Definition masks_types.h:77
@ DT_MASKS_ELLIPSE
Definition masks_types.h:69
@ DT_MASKS_CLONE
Definition masks_types.h:67
@ DT_MASKS_GRADIENT
Definition masks_types.h:68
@ DT_MASKS_NONE
Definition masks_types.h:63
@ DT_MASKS_CIRCLE
Definition masks_types.h:64
@ DT_MASKS_GROUP
Definition masks_types.h:66
@ DT_MASKS_IS_PRIMITIVE_SHAPE
Definition masks_types.h:82
@ DT_MASKS_IS_CLOSED_SHAPE
Definition masks_types.h:76
@ DT_MASKS_IS_RETOUCHE
Definition masks_types.h:79
dt_masks_interaction_t
@ DT_MASKS_INTERACTION_OPACITY
@ DT_MASKS_INTERACTION_SIZE
@ DT_MASKS_INTERACTION_FADING
@ DT_MASKS_INTERACTION_LAST
@ DT_MASKS_INTERACTION_UNDEF
@ DT_MASKS_INTERACTION_ROTATION
dt_masks_result_t
What a request that may change the masks model did.
@ DT_MASKS_OK
@ DT_MASKS_UNCHANGED
@ DT_MASKS_NOT_FOUND
@ DT_MASKS_INVALID
dt_masks_increment_t
@ DT_MASKS_INCREMENT_SCALE
@ DT_MASKS_INCREMENT_OFFSET
@ DT_MASKS_INCREMENT_ABSOLUTE
What a form IS, BY VALUE: identity, kind, and – for a group – how many members.
dt_masks_type_t type
One shape's membership of one group, BY VALUE.
dt_masks_state_t state
One cut in a shape's border outline: while walking the border buffer forward, on reaching index jump_...