4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * Contributor(s): Blender Foundation
25 * ***** END GPL LICENSE BLOCK *****
27 #ifndef DNA_SCREEN_TYPES_H
28 #define DNA_SCREEN_TYPES_H
30 #include "DNA_listBase.h"
31 #include "DNA_view2d_types.h"
32 #include "DNA_vec_types.h"
34 #include "DNA_scriptlink_types.h"
44 typedef struct bScreen {
47 ListBase vertbase, edgebase;
49 ListBase regionbase; /* screen level regions, runtime only */
52 short scenenr, screennr; /* only for pupmenu */
54 short full, winid; /* winid from WM, starts with 1 */
55 short do_draw; /* notifier for drawing edges */
56 short do_refresh; /* notifier for scale screen, changed screen, etc */
57 short do_gesture; /* notifier for gesture draw. */
58 short swap; /* indicator to survive swap-exchange systems */
61 short mainwin; /* screensize subwindow, for screenedges and global menus */
62 short subwinactive; /* active subwindow */
64 struct wmTimer *animtimer; /* if set, screen has timer handler added in window */
65 void *context; /* context callback */
67 short handler[8]; /* similar to space handler */
70 typedef struct ScrVert {
71 struct ScrVert *next, *prev, *newv;
76 typedef struct ScrEdge {
77 struct ScrEdge *next, *prev;
79 short border; /* 1 when at edge of screen */
84 typedef struct Panel { /* the part from uiBlock that needs saved in file */
85 struct Panel *next, *prev;
87 char panelname[64], tabname[64]; /* defined as UI_MAX_NAME_STR */
88 char drawname[64]; /* panelname is identifier for restoring location */
89 short ofsx, ofsy, sizex, sizey;
90 short flag, active; /* active= used currently by a uiBlock */
93 int sortcounter, pad; /* when sorting panels, it uses this to put new ones in right place */
94 struct Panel *paneltab; /* this panel is tabbed in *paneltab */
95 void *activedata; /* runtime for panel manipulation */
98 typedef struct ScrArea {
99 struct ScrArea *next, *prev;
101 ScrVert *v1, *v2, *v3, *v4;
102 bScreen *full; /* if area==full, this is the parent */
104 rcti totrct; /* rect bound by v1 v2 v3 v4 */
106 char spacetype, butspacetype; /* SPACE_..., butspacetype is button arg */
107 short winx, winy; /* size */
109 short headertype; /* OLD! 0=no header, 1= down, 2= up */
111 short do_refresh; /* private, for spacetype refresh callback */
114 ScriptLink scriptlink;
116 struct SpaceType *type; /* callbacks for this space type */
118 ListBase spacedata; /* SpaceLink */
119 ListBase regionbase; /* ARegion */
120 ListBase handlers; /* wmEventHandler */
122 ListBase actionzones; /* AZone */
125 typedef struct ARegion {
126 struct ARegion *next, *prev;
128 View2D v2d; /* 2D-View scrolling/zoom info (most regions are 2d anyways) */
129 rcti winrct; /* coordinates of region */
130 short winx, winy; /* size */
133 short regiontype; /* window, header, etc. identifier for drawing */
134 short alignment; /* how it should split */
135 short flag; /* hide, ... */
137 float fsize; /* current split size in float */
139 short do_draw; /* private, cached notifier events */
140 short swap; /* private, indicator to survive swap-exchange */
143 struct ARegionType *type; /* callbacks for this region type */
145 ListBase uiblocks; /* uiBlock */
146 ListBase panels; /* Panel */
147 ListBase handlers; /* wmEventHandler */
149 char *headerstr; /* use this string to draw info */
150 void *regiondata; /* XXX 2.50, need spacedata equivalent? */
154 #define WIN_BACK_OK 1
155 #define WIN_FRONT_OK 2
159 #define HEADER_NO_PULLDOWN 1
160 #define AREA_FLAG_DRAWJOINTO 2
161 #define AREA_FLAG_DRAWJOINFROM 4
163 /* If you change EDGEWIDTH, also do the global arrat edcol[] */
168 #define AREAMINY (HEADERY+EDGEWIDTH)
173 #define SCREENNORMAL 0
175 #define SCREENAUTOPLAY 2
177 /* Panel->snap - for snapping to screen edges */
178 #define PNL_SNAP_NONE 0
179 #define PNL_SNAP_TOP 1
180 #define PNL_SNAP_RIGHT 2
181 #define PNL_SNAP_BOTTOM 4
182 #define PNL_SNAP_LEFT 8
184 #define PNL_SNAP_DIST 9.0
186 /* screen handlers */
187 #define SCREEN_MAXHANDLER 8
189 #define SCREEN_HANDLER_ANIM 1
190 #define SCREEN_HANDLER_PYTHON 2
191 #define SCREEN_HANDLER_VERSE 3
193 /* regiontype, first two are the default set */
194 #define RGN_TYPE_WINDOW 0
195 #define RGN_TYPE_HEADER 1
196 #define RGN_TYPE_CHANNELS 2
197 #define RGN_TYPE_TEMPORARY 3
198 #define RGN_TYPE_UI 4
200 /* region alignment */
201 #define RGN_ALIGN_NONE 0
202 #define RGN_ALIGN_TOP 1
203 #define RGN_ALIGN_BOTTOM 2
204 #define RGN_ALIGN_LEFT 3
205 #define RGN_ALIGN_RIGHT 4
206 #define RGN_ALIGN_HSPLIT 5
207 #define RGN_ALIGN_VSPLIT 6
208 #define RGN_ALIGN_FLOAT 7
211 #define RGN_FLAG_HIDDEN 1
212 #define RGN_FLAG_TOO_SMALL 2