Blender V5.0
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 "DNA_vec_types.h"
12
13/* ---------------------------------- */
14
16typedef struct View2D {
32
34 float min[2], max[2];
37
39 short scroll;
41 short scroll_ui;
42
44 short keeptot;
46 short keepzoom;
48 short keepofs;
49
51 short flag;
53 short align;
54
56 short winx, winy;
62
64 short around;
65
66 /* Usually set externally (as in, not in view2d files). */
69
70 char _pad[2];
76
77 /* animated smooth view */
81
82/* ---------------------------------- */
83
85enum {
86 /* zoom is clamped to lie within limits set by minzoom and maxzoom */
87 V2D_LIMITZOOM = (1 << 0),
88 /* aspect ratio is maintained on view resize */
89 V2D_KEEPASPECT = (1 << 1),
90 /* zoom is kept when the window resizes */
91 V2D_KEEPZOOM = (1 << 2),
92 /* zooming on x-axis is not allowed */
93 V2D_LOCKZOOM_X = (1 << 8),
94 /* zooming on y-axis is not allowed */
95 V2D_LOCKZOOM_Y = (1 << 9),
96};
97
99enum {
100 /* panning on x-axis is not allowed */
101 V2D_LOCKOFS_X = (1 << 1),
102 /* panning on y-axis is not allowed */
103 V2D_LOCKOFS_Y = (1 << 2),
104 /* on resize, keep the x offset */
105 V2D_KEEPOFS_X = (1 << 3),
106 /* on resize, keep the y offset */
107 V2D_KEEPOFS_Y = (1 << 4),
108};
109
111enum {
119};
120
122enum {
123 /* global view2d horizontal locking (for showing same time interval) */
125 /* within area (i.e. between regions) view2d vertical locking */
127 /* apply pixel offsets on x-axis when setting view matrices */
128 V2D_PIXELOFS_X = (1 << 2),
129 /* apply pixel offsets on y-axis when setting view matrices */
130 V2D_PIXELOFS_Y = (1 << 3),
131 /* zoom, pan or similar action is in progress */
133 /* view settings need to be set still... */
134 V2D_IS_INIT = (1 << 10),
135 /* Ensure scrolling always snaps to multiples of #View2D.page_size_y or the #View2D.mask height
136 * if this is 0. Zooming doesn't respect this. */
138 /* Ignore keepofs flags only during zoom.
139 * Allows for different behavior between zooming and area resize. */
141};
142
144enum {
145 /* Left scroll-bar. */
146 V2D_SCROLL_LEFT = (1 << 0),
149 /* Horizontal scroll-bar. */
150 V2D_SCROLL_TOP = (1 << 2),
152 /* UNUSED = (1 << 4), */
154 /* display vertical scale handles */
156 /* display horizontal scale handles */
158 /* Induce hiding of scroll-bar - set by region drawing in response to size of region. */
161 /* Scroll-bar extends beyond its available window -
162 * set when calculating scroll-bar for drawing */
165};
166
168enum {
171};
172
176enum {
177 /* all quadrants free */
179 /* horizontal restrictions */
182 /* vertical restrictions */
185};
@ V2D_LOCKOFS_X
@ V2D_LOCKOFS_Y
@ V2D_KEEPOFS_Y
@ V2D_KEEPOFS_X
@ V2D_VIEWSYNC_SCREEN_TIME
@ V2D_IS_NAVIGATING
@ V2D_PIXELOFS_X
@ V2D_IS_INIT
@ V2D_ZOOM_IGNORE_KEEPOFS
@ V2D_PIXELOFS_Y
@ V2D_SNAP_TO_PAGESIZE_Y
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_KEEPTOT_BOUNDS
@ V2D_KEEPTOT_FREE
@ V2D_KEEPTOT_STRICT
@ V2D_LIMITZOOM
@ V2D_LOCKZOOM_X
@ V2D_KEEPZOOM
@ V2D_KEEPASPECT
@ V2D_LOCKZOOM_Y
@ V2D_SCROLL_V_ACTIVE
@ V2D_SCROLL_H_ACTIVE
@ 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
char alpha_vert
float minzoom
struct SmoothView2DStore * sms
short keeptot
short scroll_ui
short oldwiny
float max[2]
char _pad[2]
short keepzoom
struct wmTimer * smooth_timer
short keepofs
float min[2]
short oldwinx
float maxzoom
float page_size_y