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) 2007 Blender Foundation.
21 * All rights reserved.
24 * Contributor(s): Blender Foundation
26 * ***** END GPL LICENSE BLOCK *****
33 struct wmWindowManager;
35 /* exported types for WM */
37 #include "wm_cursors.h"
38 #include "wm_event_types.h"
40 /* ************** wmOperatorType ************************ */
43 #define OPTYPE_REGISTER 1 /* register operators in stack after finishing */
44 #define OPTYPE_UNDO 2 /* do undo push after after */
45 #define OPTYPE_BLOCKING 4 /* let blender grab all input from the WM (X11) */
46 #define OPTYPE_MACRO 8
48 /* context to call operator in for WM_operator_name_call */
49 /* rna_ui.c contains EnumPropertyItem's of these, keep in sync */
51 /* if there's invoke, call it, otherwise exec */
53 WM_OP_INVOKE_REGION_WIN,
58 WM_OP_EXEC_REGION_WIN,
63 /* ************** wmKeyMap ************************ */
70 /* means modifier should be pressed 2nd */
76 /* type: defined in wm_event_types.c */
77 #define KM_TEXTINPUT -2
86 /* ************** UI Handler ***************** */
88 #define WM_UI_HANDLER_CONTINUE 0
89 #define WM_UI_HANDLER_BREAK 1
91 typedef int (*wmUIHandlerFunc)(struct bContext *C, struct wmEvent *event, void *userdata);
92 typedef void (*wmUIHandlerRemoveFunc)(struct bContext *C, void *userdata);
94 /* ************** Notifiers ****************** */
96 typedef struct wmNotifier {
97 struct wmNotifier *next, *prev;
99 struct wmWindowManager *wm;
100 struct wmWindow *window;
103 unsigned int category, data, subtype, action;
114 0x0000FF00; data subtype (unused?)
119 #define NOTE_CATEGORY 0xFF000000
120 #define NC_WM (1<<24)
121 #define NC_WINDOW (2<<24)
122 #define NC_SCREEN (3<<24)
123 #define NC_SCENE (4<<24)
124 #define NC_OBJECT (5<<24)
125 #define NC_MATERIAL (6<<24)
126 #define NC_TEXTURE (7<<24)
127 #define NC_LAMP (8<<24)
128 #define NC_GROUP (9<<24)
129 #define NC_IMAGE (10<<24)
130 #define NC_BRUSH (11<<24)
131 #define NC_TEXT (12<<24)
132 #define NC_WORLD (13<<24)
133 #define NC_FILE (14<<24)
134 #define NC_ANIMATION (15<<24)
135 #define NC_CONSOLE (16<<24)
136 #define NC_NODE (17<<24)
137 #define NC_INFO (18<<24)
139 /* data type, 256 entries is enough, it can overlap */
140 #define NOTE_DATA 0x00FF0000
142 /* NC_WM windowmanager */
143 #define ND_FILEREAD (1<<16)
144 #define ND_FILESAVE (2<<16)
145 #define ND_DATACHANGED (3<<16)
147 /* NC_SCREEN screen */
148 #define ND_SCREENBROWSE (1<<16)
149 #define ND_SCREENDELETE (2<<16)
150 #define ND_SCREENCAST (3<<16)
151 #define ND_ANIMPLAY (4<<16)
154 #define ND_SCENEBROWSE (1<<16)
155 #define ND_MARKERS (2<<16)
156 #define ND_FRAME (3<<16)
157 #define ND_RENDER_OPTIONS (4<<16)
158 #define ND_NODES (5<<16)
159 #define ND_SEQUENCER (6<<16)
160 #define ND_OB_ACTIVE (7<<16)
161 #define ND_OB_SELECT (8<<16)
162 #define ND_MODE (9<<16)
163 #define ND_RENDER_RESULT (10<<16)
164 #define ND_COMPO_RESULT (11<<16)
165 #define ND_KEYINGSET (12<<16)
166 #define ND_SCENEDELETE (13<<16)
168 /* NC_OBJECT Object */
169 #define ND_TRANSFORM (16<<16)
170 #define ND_OB_SHADING (17<<16)
171 #define ND_POSE (18<<16)
172 #define ND_BONE_ACTIVE (19<<16)
173 #define ND_BONE_SELECT (20<<16)
174 #define ND_GEOM_SELECT (21<<16)
175 #define ND_DRAW (22<<16)
176 #define ND_MODIFIER (23<<16)
177 #define ND_KEYS (24<<16)
178 #define ND_GEOM_DATA (25<<16)
179 #define ND_CONSTRAINT (26<<16)
180 #define ND_PARTICLE (27<<16)
182 /* NC_MATERIAL Material */
183 #define ND_SHADING (30<<16)
184 #define ND_SHADING_DRAW (31<<16)
187 #define ND_LIGHTING (44<<16)
188 #define ND_LIGHTING_DRAW (45<<16)
189 #define ND_SKY (46<<16)
192 #define ND_CURSOR (50<<16)
193 #define ND_DISPLAY (51<<16)
195 /* NC_FILE Filebrowser */
196 #define ND_PARAMS (60<<16)
197 #define ND_FILELIST (61<<16)
199 /* NC_ANIMATION Animato */
200 #define ND_KEYFRAME_SELECT (70<<16)
201 #define ND_KEYFRAME_EDIT (71<<16)
202 #define ND_KEYFRAME_PROP (72<<16)
203 #define ND_ANIMCHAN_SELECT (73<<16)
204 #define ND_ANIMCHAN_EDIT (74<<16)
205 #define ND_NLA_SELECT (75<<16)
206 #define ND_NLA_EDIT (76<<16)
207 #define ND_NLA_ACTCHANGE (77<<16)
210 #define ND_CONSOLE (78<<16) /* general redraw */
211 #define ND_CONSOLE_REPORT (79<<16) /* update for reports, could spesify type */
213 /* subtype, 256 entries too */
214 #define NOTE_SUBTYPE 0x0000FF00
216 /* subtype scene mode */
217 #define NS_MODE_OBJECT (1<<8)
219 #define NS_EDITMODE_MESH (2<<8)
220 #define NS_EDITMODE_CURVE (3<<8)
221 #define NS_EDITMODE_SURFACE (4<<8)
222 #define NS_EDITMODE_TEXT (5<<8)
223 #define NS_EDITMODE_MBALL (6<<8)
224 #define NS_EDITMODE_LATTICE (7<<8)
225 #define NS_EDITMODE_ARMATURE (8<<8)
226 #define NS_MODE_POSE (9<<8)
227 #define NS_MODE_PARTICLE (10<<8)
230 /* action classification */
231 #define NOTE_ACTION (0x000000FF)
233 #define NA_EVALUATED 2
238 /* ************** Gesture Manager data ************** */
240 /* wmGesture->type */
241 #define WM_GESTURE_TWEAK 0
242 #define WM_GESTURE_LINES 1
243 #define WM_GESTURE_RECT 2
244 #define WM_GESTURE_CROSS_RECT 3
245 #define WM_GESTURE_LASSO 4
246 #define WM_GESTURE_CIRCLE 5
248 /* wmGesture is registered to window listbase, handled by operator callbacks */
249 /* tweak gesture is builtin feature */
250 typedef struct wmGesture {
251 struct wmGesture *next, *prev;
252 int event_type; /* event->type */
253 int mode; /* for modal callback */
254 int type; /* gesture type define */
255 int swinid; /* initial subwindow id where it started */
256 int points; /* optional, amount of points stored */
259 /* customdata for border is a recti */
260 /* customdata for circle is recti, (xmin, ymin) is center, xmax radius */
261 /* customdata for lasso is short array */
264 /* ************** custom wmEvent data ************** */
269 typedef struct wmTabletData {
270 int Active; /* 0=None, 1=Stylus, 2=Eraser */
271 float Pressure; /* range 0.0 (not touching) to 1.0 (full pressure) */
272 float Xtilt; /* range 0.0 (upright) to 1.0 (tilted fully against the tablet surface) */
273 float Ytilt; /* as above */
276 typedef struct wmTimer {
277 struct wmTimer *next, *prev;
278 double timestep; /* set by timer user */
279 int event_type; /* set by timer user, goes to event system */
280 void *customdata; /* set by timer user, to allow custom values */
282 double duration; /* total running time in seconds */
283 double delta; /* time since previous step in seconds */
285 double ltime; /* internal, last time timer was activated */
286 double ntime; /* internal, next time we want to activate the timer */
287 double stime; /* internal, when the timer started */
288 int sleep; /* internal, put timers to sleep when needed */
292 /* **************** Paint Cursor ******************* */
294 typedef void (*wmPaintCursorDraw)(struct bContext *C, int, int, void *customdata);
297 /* ****************** Messages ********************* */
302 WM_LOG_WARNING = 2000,
303 WM_ERROR_UNDEFINED = 3000,
304 WM_ERROR_INVALID_INPUT = 3001,
305 WM_ERROR_INVALID_CONTEXT = 3002,
306 WM_ERROR_OUT_OF_MEMORY = 3003
309 typedef struct wmReport {
310 struct wmReport *next, *prev;
316 /* *************** migrated stuff, clean later? ******************************** */
318 typedef struct RecentFile {
319 struct RecentFile *next, *prev;
324 #endif /* WM_TYPES_H */