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. */
60 short mainwin; /* screensize subwindow, for screenedges and global menus */
61 short subwinactive; /* active subwindow */
63 struct wmTimer *animtimer; /* if set, screen has timer handler added in window */
64 void *context; /* context callback */
66 short handler[8]; /* similar to space handler */
69 typedef struct ScrVert {
70 struct ScrVert *next, *prev, *newv;
75 typedef struct ScrEdge {
76 struct ScrEdge *next, *prev;
78 short border; /* 1 when at edge of screen */
83 typedef struct Panel { /* the part from uiBlock that needs saved in file */
84 struct Panel *next, *prev;
86 char panelname[64], tabname[64]; /* defined as UI_MAX_NAME_STR */
87 char drawname[64]; /* panelname is identifier for restoring location */
88 short ofsx, ofsy, sizex, sizey;
89 short flag, active; /* active= used currently by a uiBlock */
92 int sortcounter, pad; /* when sorting panels, it uses this to put new ones in right place */
93 struct Panel *paneltab; /* this panel is tabbed in *paneltab */
94 void *activedata; /* runtime for panel manipulation */
97 typedef struct ScrArea {
98 struct ScrArea *next, *prev;
100 ScrVert *v1, *v2, *v3, *v4;
101 bScreen *full; /* if area==full, this is the parent */
103 rcti totrct; /* rect bound by v1 v2 v3 v4 */
105 char spacetype, butspacetype; /* SPACE_..., butspacetype is button arg */
106 short winx, winy; /* size */
108 short headertype; /* OLD! 0=no header, 1= down, 2= up */
110 short do_refresh; /* private, for spacetype refresh callback */
113 ScriptLink scriptlink;
115 struct SpaceType *type; /* callbacks for this space type */
117 ListBase spacedata; /* SpaceLink */
118 ListBase regionbase; /* ARegion */
119 ListBase handlers; /* wmEventHandler */
121 ListBase actionzones; /* AZone */
124 typedef struct ARegion {
125 struct ARegion *next, *prev;
127 View2D v2d; /* 2D-View scrolling/zoom info (most regions are 2d anyways) */
128 rcti winrct; /* coordinates of region */
129 short winx, winy; /* size */
132 short regiontype; /* window, header, etc. identifier for drawing */
133 short alignment; /* how it should split */
134 short flag; /* hide, ... */
136 float fsize; /* current split size in float */
138 short do_draw; /* private, cached notifier events */
142 struct ARegionType *type; /* callbacks for this region type */
144 ListBase uiblocks; /* uiBlock */
145 ListBase panels; /* Panel */
146 ListBase handlers; /* wmEventHandler */
148 char *headerstr; /* use this string to draw info */
149 void *regiondata; /* XXX 2.50, need spacedata equivalent? */
153 #define HEADER_NO_PULLDOWN 1
154 #define AREA_FLAG_DRAWJOINTO 2
155 #define AREA_FLAG_DRAWJOINFROM 4
157 /* If you change EDGEWIDTH, also do the global arrat edcol[] */
162 #define AREAMINY (HEADERY+EDGEWIDTH)
167 #define SCREENNORMAL 0
169 #define SCREENAUTOPLAY 2
172 #define WIN_FRONT_OK 1
173 #define WIN_BACK_OK 2
176 /* Panel->snap - for snapping to screen edges */
177 #define PNL_SNAP_NONE 0
178 #define PNL_SNAP_TOP 1
179 #define PNL_SNAP_RIGHT 2
180 #define PNL_SNAP_BOTTOM 4
181 #define PNL_SNAP_LEFT 8
183 #define PNL_SNAP_DIST 9.0
185 /* screen handlers */
186 #define SCREEN_MAXHANDLER 8
188 #define SCREEN_HANDLER_ANIM 1
189 #define SCREEN_HANDLER_PYTHON 2
190 #define SCREEN_HANDLER_VERSE 3
192 /* regiontype, first two are the default set */
193 #define RGN_TYPE_WINDOW 0
194 #define RGN_TYPE_HEADER 1
195 #define RGN_TYPE_CHANNELS 2
196 #define RGN_TYPE_TEMPORARY 3
197 #define RGN_TYPE_UI 4
199 /* region alignment */
200 #define RGN_ALIGN_NONE 0
201 #define RGN_ALIGN_TOP 1
202 #define RGN_ALIGN_BOTTOM 2
203 #define RGN_ALIGN_LEFT 3
204 #define RGN_ALIGN_RIGHT 4
205 #define RGN_ALIGN_HSPLIT 5
206 #define RGN_ALIGN_VSPLIT 6
207 #define RGN_ALIGN_FLOAT 7
210 #define RGN_FLAG_HIDDEN 1
211 #define RGN_FLAG_TOO_SMALL 2