Blender V5.3
DNA_view2d_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_enum_flags.hh"
12
13#include "DNA_vec_types.h"
14
15namespace blender {
16
17namespace ui {
19}
20
22enum eView2D_KeepZoom : short {
23 /* zoom is clamped to lie within limits set by minzoom and maxzoom */
24 V2D_LIMITZOOM = (1 << 0),
25 /* aspect ratio is maintained on view resize */
26 V2D_KEEPASPECT = (1 << 1),
27 /* zoom is kept when the window resizes */
28 V2D_KEEPZOOM = (1 << 2),
29 /* zooming on x-axis is not allowed */
30 V2D_LOCKZOOM_X = (1 << 8),
31 /* zooming on y-axis is not allowed */
32 V2D_LOCKZOOM_Y = (1 << 9),
33};
35
36
37enum eView2D_KeepOfs : short {
38 /* panning on x-axis is not allowed */
39 V2D_LOCKOFS_X = (1 << 1),
40 /* panning on y-axis is not allowed */
41 V2D_LOCKOFS_Y = (1 << 2),
42 /* on resize, keep the x offset */
43 V2D_KEEPOFS_X = (1 << 3),
44 /* on resize, keep the y offset */
45 V2D_KEEPOFS_Y = (1 << 4),
46};
48
49
59
61enum eView2D_Flag : short {
62 /* global view2d horizontal locking (for showing same time interval) */
64 /* within area (i.e. between regions) view2d vertical locking */
66 /* apply pixel offsets on x-axis when setting view matrices */
67 V2D_PIXELOFS_X = (1 << 2),
68 /* apply pixel offsets on y-axis when setting view matrices */
69 V2D_PIXELOFS_Y = (1 << 3),
70 /* zoom, pan or similar action is in progress */
72 /* view settings need to be set still... */
73 V2D_IS_INIT = (1 << 10),
74 /* Ensure scrolling always snaps to multiples of #View2D.page_size_y or the #View2D.mask height
75 * if this is 0. Zooming doesn't respect this. */
77 /* Ignore keepofs flags only during zoom.
78 * Allows for different behavior between zooming and area resize. */
80};
82
83
84enum eView2D_Scroll : short {
85 /* Left scroll-bar. */
86 V2D_SCROLL_LEFT = (1 << 0),
87 V2D_SCROLL_RIGHT = (1 << 1),
89 /* Horizontal scroll-bar. */
90 V2D_SCROLL_TOP = (1 << 2),
92 /* UNUSED = (1 << 4), */
94 /* display vertical scale handles */
96 /* display horizontal scale handles */
98 /* Induce hiding of scroll-bar - set by region drawing in response to size of region. */
101 /* Scroll-bar extends beyond its available window -
102 * set when calculating scroll-bar for drawing */
105};
107
108
109enum eView2D_ScrollUI : short {
112};
114
115
118enum eView2D_Align : short {
119 /* all quadrants free */
121 /* horizontal restrictions */
124 /* vertical restrictions */
127};
129
130/* ---------------------------------- */
131
132
133struct View2D {
135 rctf tot = {};
137 rctf cur = {};
139 rcti vert = {};
141 rcti hor = {};
148 rcti mask = {};
149
151 float min[2] = {}, max[2] = {};
153 float minzoom = 0, maxzoom = 0;
154
159
166
171
173 short winx = 0, winy = 0;
178 short oldwinx = 0, oldwiny = 0;
179
181 short around = 0;
182
183 /* Usually set externally (as in, not in view2d files). */
185 char alpha_vert = 0, alpha_hor = 0;
186
187 char _pad[2] = {};
192 float page_size_y = 0;
193
194 /* animated smooth view */
196 struct wmTimer *smooth_timer = nullptr;
197};
198
199} // namespace blender
#define ENUM_OPERATORS(_enum_type)
btScalar max
BMesh Iterators.
@ V2D_VIEWSYNC_SCREEN_TIME
@ V2D_ZOOM_IGNORE_KEEPOFS
@ V2D_SNAP_TO_PAGESIZE_Y
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_SCROLL_VERTICAL_FULLR
@ V2D_SCROLL_HORIZONTAL
@ V2D_SCROLL_VERTICAL_HIDE
@ V2D_SCROLL_HORIZONTAL_HIDE
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_SCROLL_VERTICAL_HANDLES
@ V2D_SCROLL_HORIZONTAL_FULLR
ui::SmoothView2DStore * sms
eView2D_KeepTot keeptot
struct wmTimer * smooth_timer
eView2D_KeepOfs keepofs
eView2D_KeepZoom keepzoom
eView2D_Scroll scroll
eView2D_ScrollUI scroll_ui
eView2D_Align align