Blender V4.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
9#pragma once
10
11#include "DNA_vec_types.h"
12
13/* ---------------------------------- */
14
16typedef struct View2D {
23
25 float min[2], max[2];
28
30 short scroll;
32 short scroll_ui;
33
35 short keeptot;
37 short keepzoom;
39 short keepofs;
40
42 short flag;
44 short align;
45
47 short winx, winy;
53
55 short around;
56
57 /* Usually set externally (as in, not in view2d files). */
60
61 char _pad[2];
65
66 /* animated smooth view */
70
71/* ---------------------------------- */
72
74enum {
75 /* zoom is clamped to lie within limits set by minzoom and maxzoom */
76 V2D_LIMITZOOM = (1 << 0),
77 /* aspect ratio is maintained on view resize */
78 V2D_KEEPASPECT = (1 << 1),
79 /* zoom is kept when the window resizes */
80 V2D_KEEPZOOM = (1 << 2),
81 /* zooming on x-axis is not allowed */
82 V2D_LOCKZOOM_X = (1 << 8),
83 /* zooming on y-axis is not allowed */
84 V2D_LOCKZOOM_Y = (1 << 9),
85};
86
88enum {
89 /* panning on x-axis is not allowed */
90 V2D_LOCKOFS_X = (1 << 1),
91 /* panning on y-axis is not allowed */
92 V2D_LOCKOFS_Y = (1 << 2),
93 /* on resize, keep the x offset */
94 V2D_KEEPOFS_X = (1 << 3),
95 /* on resize, keep the y offset */
96 V2D_KEEPOFS_Y = (1 << 4),
97};
98
100enum {
108};
109
111enum {
112 /* global view2d horizontal locking (for showing same time interval) */
114 /* within area (i.e. between regions) view2d vertical locking */
116 /* apply pixel offsets on x-axis when setting view matrices */
117 V2D_PIXELOFS_X = (1 << 2),
118 /* apply pixel offsets on y-axis when setting view matrices */
119 V2D_PIXELOFS_Y = (1 << 3),
120 /* zoom, pan or similar action is in progress */
122 /* view settings need to be set still... */
123 V2D_IS_INIT = (1 << 10),
124 /* Ensure scrolling always snaps to multiples of #View2D.page_size_y or the #View2D.mask height
125 * if this is 0. Zooming doesn't respect this. */
127};
128
130enum {
131 /* Left scroll-bar. */
132 V2D_SCROLL_LEFT = (1 << 0),
135 /* Horizontal scroll-bar. */
136 V2D_SCROLL_TOP = (1 << 2),
138 /* UNUSED = (1 << 4), */
140 /* display vertical scale handles */
142 /* display horizontal scale handles */
144 /* Induce hiding of scroll-bar - set by region drawing in response to size of region. */
147 /* Scroll-bar extends beyond its available window -
148 * set when calculating scroll-bar for drawing */
151};
152
154enum {
157};
158
162enum {
163 /* all quadrants free */
165 /* horizontal restrictions */
168 /* vertical restrictions */
171};
@ V2D_ALIGN_NO_NEG_X
@ V2D_ALIGN_NO_NEG_Y
@ V2D_ALIGN_NO_POS_Y
@ V2D_ALIGN_NO_POS_X
@ V2D_ALIGN_FREE
@ V2D_VIEWSYNC_SCREEN_TIME
@ V2D_IS_NAVIGATING
@ V2D_PIXELOFS_X
@ V2D_IS_INIT
@ V2D_PIXELOFS_Y
@ V2D_SNAP_TO_PAGESIZE_Y
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_LOCKOFS_X
@ V2D_LOCKOFS_Y
@ V2D_KEEPOFS_Y
@ V2D_KEEPOFS_X
@ V2D_SCROLL_V_ACTIVE
@ V2D_SCROLL_H_ACTIVE
struct View2D View2D
@ 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_KEEPTOT_BOUNDS
@ V2D_KEEPTOT_FREE
@ V2D_KEEPTOT_STRICT
@ V2D_LIMITZOOM
@ V2D_LOCKZOOM_X
@ V2D_KEEPZOOM
@ V2D_KEEPASPECT
@ V2D_LOCKZOOM_Y
char alpha_vert
float minzoom
struct SmoothView2DStore * sms
short keeptot
short scroll_ui
short oldwiny
char _pad[2]
short keepzoom
struct wmTimer * smooth_timer
short keepofs
float min[2]
short oldwinx
float maxzoom
float page_size_y