Blender  V2.93
DNA_view2d_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_vec_types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /* ---------------------------------- */
33 
34 /* View 2D data - stored per region */
35 typedef struct View2D {
42 
44  float min[2], max[2];
46  float minzoom, maxzoom;
47 
49  short scroll;
51  short scroll_ui;
52 
54  short keeptot;
56  short keepzoom;
58  short keepofs;
59 
61  short flag;
63  short align;
64 
66  short winx, winy;
69  short oldwinx, oldwiny;
70 
72  short around;
73 
74  /* Usually set externally (as in, not in view2d files). */
77  char _pad[6];
78 
79  /* animated smooth view */
83 
84 /* ---------------------------------- */
85 
86 /* view zooming restrictions, per axis (v2d->keepzoom) */
87 enum {
88  /* zoom is clamped to lie within limits set by minzoom and maxzoom */
89  V2D_LIMITZOOM = (1 << 0),
90  /* aspect ratio is maintained on view resize */
91  V2D_KEEPASPECT = (1 << 1),
92  /* zoom is kept when the window resizes */
93  V2D_KEEPZOOM = (1 << 2),
94  /* zooming on x-axis is not allowed */
95  V2D_LOCKZOOM_X = (1 << 8),
96  /* zooming on y-axis is not allowed */
97  V2D_LOCKZOOM_Y = (1 << 9),
98 };
99 
100 /* view panning restrictions, per axis (v2d->keepofs) */
101 enum {
102  /* panning on x-axis is not allowed */
103  V2D_LOCKOFS_X = (1 << 1),
104  /* panning on y-axis is not allowed */
105  V2D_LOCKOFS_Y = (1 << 2),
106  /* on resize, keep the x offset */
107  V2D_KEEPOFS_X = (1 << 3),
108  /* on resize, keep the y offset */
109  V2D_KEEPOFS_Y = (1 << 4),
110 };
111 
112 /* view extent restrictions (v2d->keeptot) */
113 enum {
121 };
122 
123 /* general refresh settings (v2d->flag) */
124 enum {
125  /* global view2d horizontal locking (for showing same time interval) */
126  /* TODO: this flag may be set in old files but is not accessible currently,
127  * should be exposed from RNA - Campbell */
129  /* within area (i.e. between regions) view2d vertical locking */
131  /* apply pixel offsets on x-axis when setting view matrices */
132  V2D_PIXELOFS_X = (1 << 2),
133  /* apply pixel offsets on y-axis when setting view matrices */
134  V2D_PIXELOFS_Y = (1 << 3),
135  /* view settings need to be set still... */
136  V2D_IS_INIT = (1 << 10),
137 };
138 
139 /* scroller flags for View2D (v2d->scroll) */
140 enum {
141  /* left scrollbar */
142  V2D_SCROLL_LEFT = (1 << 0),
143  V2D_SCROLL_RIGHT = (1 << 1),
145  /* horizontal scrollbar */
146  V2D_SCROLL_TOP = (1 << 2),
147  V2D_SCROLL_BOTTOM = (1 << 3),
148  /* UNUSED = (1 << 4), */
150  /* display vertical scale handles */
152  /* display horizontal scale handles */
154  /* induce hiding of scrollbars - set by region drawing in response to size of region */
157  /* scrollbar extends beyond its available window -
158  * set when calculating scrollbars for drawing */
161 };
162 
163 /* scroll_ui, activate flag for drawing */
164 enum {
167 };
168 
169 /* alignment flags for totrect, flags use 'shading-out' convention (v2d->align) */
170 enum {
171  /* all quadrants free */
173  /* horizontal restrictions */
174  V2D_ALIGN_NO_POS_X = (1 << 0),
175  V2D_ALIGN_NO_NEG_X = (1 << 1),
176  /* vertical restrictions */
177  V2D_ALIGN_NO_POS_Y = (1 << 2),
178  V2D_ALIGN_NO_NEG_Y = (1 << 3),
179 };
180 
181 #ifdef __cplusplus
182 }
183 #endif
@ V2D_VIEWSYNC_SCREEN_TIME
@ V2D_PIXELOFS_X
@ V2D_IS_INIT
@ V2D_PIXELOFS_Y
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_SCROLL_V_ACTIVE
@ V2D_SCROLL_H_ACTIVE
@ V2D_KEEPTOT_BOUNDS
@ V2D_KEEPTOT_FREE
@ V2D_KEEPTOT_STRICT
@ 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
@ V2D_LIMITZOOM
@ V2D_LOCKZOOM_X
@ V2D_KEEPZOOM
@ V2D_KEEPASPECT
@ V2D_LOCKZOOM_Y
@ V2D_LOCKOFS_X
@ V2D_LOCKOFS_Y
@ V2D_KEEPOFS_Y
@ V2D_KEEPOFS_X
struct View2D View2D
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