2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * Contributor(s): Blender Foundation
23 * ***** END GPL LICENSE BLOCK *****
26 /** \file DNA_screen_types.h
30 #ifndef __DNA_SCREEN_TYPES_H__
31 #define __DNA_SCREEN_TYPES_H__
33 #include "DNA_listBase.h"
34 #include "DNA_view2d_types.h"
35 #include "DNA_vec_types.h"
49 typedef struct bScreen {
52 ListBase vertbase; /* screens have vertices/edges to define areas */
55 ListBase regionbase; /* screen level regions (menus), runtime only */
58 struct Scene *newscene; /* temporary when switching */
60 int redraws_flag; /* user-setting for which editors get redrawn during anim playback (used to be time->redraws) */
63 short full; /* temp screen for image render display or fileselect */
64 short temp; /* temp screen in a temp window, don't save (like user prefs) */
65 short winid; /* winid from WM, starts with 1 */
66 short do_draw; /* notifier for drawing edges */
67 short do_refresh; /* notifier for scale screen, changed screen, etc */
68 short do_draw_gesture; /* notifier for gesture draw. */
69 short do_draw_paintcursor; /* notifier for paint cursor draw. */
70 short do_draw_drag; /* notifier for dragging draw. */
71 short swap; /* indicator to survive swap-exchange systems */
73 short mainwin; /* screensize subwindow, for screenedges and global menus */
74 short subwinactive; /* active subwindow */
78 struct wmTimer *animtimer; /* if set, screen has timer handler added in window */
79 void *context; /* context callback */
82 typedef struct ScrVert {
83 struct ScrVert *next, *prev, *newv;
85 /* first one used internally, second one for tools */
89 typedef struct ScrEdge {
90 struct ScrEdge *next, *prev;
92 short border; /* 1 when at edge of screen */
97 typedef struct Panel { /* the part from uiBlock that needs saved in file */
98 struct Panel *next, *prev;
100 struct PanelType *type; /* runtime */
101 struct uiLayout *layout; /* runtime for drawing */
103 char panelname[64], tabname[64]; /* defined as UI_MAX_NAME_STR */
104 char drawname[64]; /* panelname is identifier for restoring location */
105 int ofsx, ofsy, sizex, sizey;
107 short flag, runtime_flag;
110 int sortorder; /* panels are aligned according to increasing sortorder */
111 struct Panel *paneltab; /* this panel is tabbed in *paneltab */
112 void *activedata; /* runtime for panel manipulation */
115 typedef struct uiList { /* some list UI data need to be saved in file */
116 struct uiList *next, *prev;
118 struct uiListType *type; /* runtime */
121 char list_id[64]; /* defined as UI_MAX_NAME_STR */
123 int layout_type; /* How items are layedout in the list */
130 /* char list_search[64]; */
133 typedef struct ScrArea {
134 struct ScrArea *next, *prev;
136 ScrVert *v1, *v2, *v3, *v4; /* ordered (bl, tl, tr, br) */
137 bScreen *full; /* if area==full, this is the parent */
139 rcti totrct; /* rect bound by v1 v2 v3 v4 */
141 char spacetype, butspacetype; /* SPACE_..., butspacetype is button arg */
142 short winx, winy; /* size */
144 short headertype; /* OLD! 0=no header, 1= down, 2= up */
145 short do_refresh; /* private, for spacetype refresh callback */
147 short region_active_win; /* index of last used region of 'RGN_TYPE_WINDOW'
148 * runtuime variable, updated by executing operators */
151 struct SpaceType *type; /* callbacks for this space type */
153 ListBase spacedata; /* SpaceLink */
154 ListBase regionbase; /* ARegion */
155 ListBase handlers; /* wmEventHandler */
157 ListBase actionzones; /* AZone */
160 typedef struct ARegion {
161 struct ARegion *next, *prev;
163 View2D v2d; /* 2D-View scrolling/zoom info (most regions are 2d anyways) */
164 rcti winrct; /* coordinates of region */
165 rcti drawrct; /* runtime for partial redraw, same or smaller than winrct */
166 short winx, winy; /* size */
169 short regiontype; /* window, header, etc. identifier for drawing */
170 short alignment; /* how it should split */
171 short flag; /* hide, ... */
173 float fsize; /* current split size in float (unused) */
174 short sizex, sizey; /* current split size in pixels (if zero it uses regiontype) */
176 short do_draw; /* private, cached notifier events */
177 short do_draw_overlay; /* private, cached notifier events */
178 short swap; /* private, indicator to survive swap-exchange */
179 short overlap; /* private, set for indicate drawing overlapped */
182 struct ARegionType *type; /* callbacks for this region type */
184 ListBase uiblocks; /* uiBlock */
185 ListBase panels; /* Panel */
186 ListBase ui_lists; /* uiList */
187 ListBase handlers; /* wmEventHandler */
189 struct wmTimer *regiontimer; /* blend in/out */
191 char *headerstr; /* use this string to draw info */
192 void *regiondata; /* XXX 2.50, need spacedata equivalent? */
196 #define WIN_BACK_OK 1
197 #define WIN_FRONT_OK 2
198 // #define WIN_EQUAL 3 // UNUSED
201 #define HEADER_NO_PULLDOWN 1
202 #define AREA_FLAG_DRAWJOINTO 2
203 #define AREA_FLAG_DRAWJOINFROM 4
204 #define AREA_TEMP_INFO 8
205 #define AREA_FLAG_DRAWSPLIT_H 16
206 #define AREA_FLAG_DRAWSPLIT_V 32
212 #define AREAMINY (HEADERY+EDGEWIDTH)
218 #define SCREENNORMAL 0
222 /* Panel->snap - for snapping to screen edges */
223 #define PNL_SNAP_NONE 0
224 /* #define PNL_SNAP_TOP 1 */
225 /* #define PNL_SNAP_RIGHT 2 */
226 #define PNL_SNAP_BOTTOM 4
227 /* #define PNL_SNAP_LEFT 8 */
229 /* #define PNL_SNAP_DIST 9.0 */
232 #define PNL_DEFAULT_CLOSED 1
233 #define PNL_NO_HEADER 2
235 /* uilist layout_type */
237 UILST_LAYOUT_DEFAULT = 0,
238 UILST_LAYOUT_COMPACT = 1,
239 UILST_LAYOUT_GRID = 2,
242 /* regiontype, first two are the default set */
243 /* Do NOT change order, append on end. Types are hardcoded needed */
247 RGN_TYPE_CHANNELS = 2,
248 RGN_TYPE_TEMPORARY = 3,
251 RGN_TYPE_TOOL_PROPS = 6,
255 /* region alignment */
256 #define RGN_ALIGN_NONE 0
257 #define RGN_ALIGN_TOP 1
258 #define RGN_ALIGN_BOTTOM 2
259 #define RGN_ALIGN_LEFT 3
260 #define RGN_ALIGN_RIGHT 4
261 #define RGN_ALIGN_HSPLIT 5
262 #define RGN_ALIGN_VSPLIT 6
263 #define RGN_ALIGN_FLOAT 7
264 #define RGN_ALIGN_QSPLIT 8
266 #define RGN_SPLIT_PREV 32
269 #define RGN_FLAG_HIDDEN 1
270 #define RGN_FLAG_TOO_SMALL 2
274 #define RGN_DRAW_PARTIAL 2