Blender  V3.3
DNA_view2d_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_vec_types.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 /* ---------------------------------- */
17 
19 typedef struct View2D {
26 
28  float min[2], max[2];
30  float minzoom, maxzoom;
31 
33  short scroll;
35  short scroll_ui;
36 
38  short keeptot;
40  short keepzoom;
42  short keepofs;
43 
45  short flag;
47  short align;
48 
50  short winx, winy;
53  short oldwinx, oldwiny;
54 
56  short around;
57 
58  /* Usually set externally (as in, not in view2d files). */
61  char _pad[6];
62 
63  /* animated smooth view */
67 
68 /* ---------------------------------- */
69 
71 enum {
72  /* zoom is clamped to lie within limits set by minzoom and maxzoom */
73  V2D_LIMITZOOM = (1 << 0),
74  /* aspect ratio is maintained on view resize */
75  V2D_KEEPASPECT = (1 << 1),
76  /* zoom is kept when the window resizes */
77  V2D_KEEPZOOM = (1 << 2),
78  /* zooming on x-axis is not allowed */
79  V2D_LOCKZOOM_X = (1 << 8),
80  /* zooming on y-axis is not allowed */
81  V2D_LOCKZOOM_Y = (1 << 9),
82 };
83 
85 enum {
86  /* panning on x-axis is not allowed */
87  V2D_LOCKOFS_X = (1 << 1),
88  /* panning on y-axis is not allowed */
89  V2D_LOCKOFS_Y = (1 << 2),
90  /* on resize, keep the x offset */
91  V2D_KEEPOFS_X = (1 << 3),
92  /* on resize, keep the y offset */
93  V2D_KEEPOFS_Y = (1 << 4),
94 };
95 
97 enum {
105 };
106 
108 enum {
109  /* global view2d horizontal locking (for showing same time interval) */
110  /* TODO: this flag may be set in old files but is not accessible currently,
111  * should be exposed from RNA - Campbell */
113  /* within area (i.e. between regions) view2d vertical locking */
115  /* apply pixel offsets on x-axis when setting view matrices */
116  V2D_PIXELOFS_X = (1 << 2),
117  /* apply pixel offsets on y-axis when setting view matrices */
118  V2D_PIXELOFS_Y = (1 << 3),
119  /* zoom, pan or similar action is in progress */
120  V2D_IS_NAVIGATING = (1 << 9),
121  /* view settings need to be set still... */
122  V2D_IS_INIT = (1 << 10),
123 };
124 
126 enum {
127  /* left scrollbar */
128  V2D_SCROLL_LEFT = (1 << 0),
129  V2D_SCROLL_RIGHT = (1 << 1),
131  /* horizontal scrollbar */
132  V2D_SCROLL_TOP = (1 << 2),
133  V2D_SCROLL_BOTTOM = (1 << 3),
134  /* UNUSED = (1 << 4), */
136  /* display vertical scale handles */
138  /* display horizontal scale handles */
140  /* induce hiding of scrollbars - set by region drawing in response to size of region */
143  /* scrollbar extends beyond its available window -
144  * set when calculating scrollbars for drawing */
147 };
148 
150 enum {
153 };
154 
158 enum {
159  /* all quadrants free */
161  /* horizontal restrictions */
162  V2D_ALIGN_NO_POS_X = (1 << 0),
163  V2D_ALIGN_NO_NEG_X = (1 << 1),
164  /* vertical restrictions */
165  V2D_ALIGN_NO_POS_Y = (1 << 2),
166  V2D_ALIGN_NO_NEG_Y = (1 << 3),
167 };
168 
169 #ifdef __cplusplus
170 }
171 #endif
@ V2D_KEEPTOT_BOUNDS
@ V2D_KEEPTOT_FREE
@ V2D_KEEPTOT_STRICT
@ V2D_LOCKOFS_X
@ V2D_LOCKOFS_Y
@ V2D_KEEPOFS_Y
@ V2D_KEEPOFS_X
@ V2D_SCROLL_V_ACTIVE
@ V2D_SCROLL_H_ACTIVE
@ V2D_LIMITZOOM
@ V2D_LOCKZOOM_X
@ V2D_KEEPZOOM
@ V2D_KEEPASPECT
@ V2D_LOCKZOOM_Y
struct View2D View2D
@ V2D_VIEWSYNC_SCREEN_TIME
@ V2D_IS_NAVIGATING
@ V2D_PIXELOFS_X
@ V2D_IS_INIT
@ V2D_PIXELOFS_Y
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_SCROLL_LEFT
@ V2D_SCROLL_HORIZONTAL_FULLR
@ V2D_SCROLL_HORIZONTAL_HIDE
@ V2D_SCROLL_VERTICAL_FULLR
@ V2D_SCROLL_VERTICAL_HIDE
@ V2D_SCROLL_HORIZONTAL
@ V2D_SCROLL_TOP
@ V2D_SCROLL_VERTICAL_HANDLES
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_SCROLL_VERTICAL
@ V2D_ALIGN_NO_NEG_X
@ V2D_ALIGN_NO_NEG_Y
@ V2D_ALIGN_NO_POS_Y
@ V2D_ALIGN_NO_POS_X
@ V2D_ALIGN_FREE
short flag
char alpha_vert
short winx
float minzoom
struct SmoothView2DStore * sms
short align
short keeptot
short scroll_ui
short oldwiny
float max[2]
short keepzoom
struct wmTimer * smooth_timer
short keepofs
short winy
char alpha_hor
float min[2]
short oldwinx
short scroll
char _pad[6]
float maxzoom
short around