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) */
47 /* context to call operator in for WM_operator_name_call */
48 /* rna_ui.c contains EnumPropertyItem's of these, keep in sync */
50 /* if there's invoke, call it, otherwise exec */
52 WM_OP_INVOKE_REGION_WIN,
57 WM_OP_EXEC_REGION_WIN,
62 /* ************** wmKeyMap ************************ */
69 /* means modifier should be pressed 2nd */
75 /* type: defined in wm_event_types.c */
76 #define KM_TEXTINPUT -2
85 /* ************** UI Handler ***************** */
87 #define WM_UI_HANDLER_CONTINUE 0
88 #define WM_UI_HANDLER_BREAK 1
90 typedef int (*wmUIHandlerFunc)(struct bContext *C, struct wmEvent *event, void *userdata);
91 typedef void (*wmUIHandlerRemoveFunc)(struct bContext *C, void *userdata);
93 /* ************** Notifiers ****************** */
95 typedef struct wmNotifier {
96 struct wmNotifier *next, *prev;
98 struct wmWindowManager *wm;
99 struct wmWindow *window;
102 unsigned int category, data, subtype, action;
113 0x0000FF00; data subtype (unused?)
118 #define NOTE_CATEGORY 0xFF000000
119 #define NC_WM (1<<24)
120 #define NC_WINDOW (2<<24)
121 #define NC_SCREEN (3<<24)
122 #define NC_SCENE (4<<24)
123 #define NC_OBJECT (5<<24)
124 #define NC_MATERIAL (6<<24)
125 #define NC_TEXTURE (7<<24)
126 #define NC_LAMP (8<<24)
127 #define NC_GROUP (9<<24)
128 #define NC_IMAGE (10<<24)
129 #define NC_BRUSH (11<<24)
130 #define NC_TEXT (12<<24)
131 #define NC_WORLD (13<<24)
132 #define NC_FILE (14<<24)
133 #define NC_ANIMATION (15<<24)
135 /* data type, 256 entries is enough, it can overlap */
136 #define NOTE_DATA 0x00FF0000
138 /* NC_WM windowmanager */
139 #define ND_FILEREAD (1<<16)
140 #define ND_FILESAVE (2<<16)
141 #define ND_DATACHANGED (3<<16)
143 /* NC_SCREEN screen */
144 #define ND_SCREENBROWSE (1<<16)
145 #define ND_SCREENCAST (2<<16)
146 #define ND_ANIMPLAY (3<<16)
149 #define ND_SCENEBROWSE (1<<16)
150 #define ND_MARKERS (2<<16)
151 #define ND_FRAME (3<<16)
152 #define ND_RENDER_OPTIONS (4<<16)
153 #define ND_NODES (5<<16)
154 #define ND_SEQUENCER (6<<16)
155 #define ND_OB_ACTIVE (7<<16)
156 #define ND_OB_SELECT (8<<16)
157 #define ND_MODE (9<<16)
158 #define ND_RENDER_RESULT (10<<16)
159 #define ND_COMPO_RESULT (11<<16)
160 #define ND_KEYINGSET (12<<16)
162 /* NC_OBJECT Object */
163 #define ND_TRANSFORM (16<<16)
164 #define ND_OB_SHADING (17<<16)
165 #define ND_POSE (18<<16)
166 #define ND_BONE_ACTIVE (19<<16)
167 #define ND_BONE_SELECT (20<<16)
168 #define ND_GEOM_SELECT (21<<16)
169 #define ND_DRAW (22<<16)
170 #define ND_MODIFIER (23<<16)
171 #define ND_KEYS (24<<16)
172 #define ND_GEOM_DATA (25<<16)
173 #define ND_CONSTRAINT (26<<16)
174 #define ND_PARTICLE (27<<16)
176 /* NC_MATERIAL Material */
177 #define ND_SHADING (30<<16)
178 #define ND_SHADING_DRAW (31<<16)
181 #define ND_LIGHTING (44<<16)
182 #define ND_LIGHTING_DRAW (45<<16)
183 #define ND_SKY (46<<16)
186 #define ND_CURSOR (50<<16)
187 #define ND_DISPLAY (51<<16)
189 /* NC_FILE Filebrowser */
190 #define ND_PARAMS (60<<16)
191 #define ND_FILELIST (61<<16)
193 /* NC_ANIMATION Animato */
194 #define ND_KEYFRAME_SELECT (70<<16)
195 #define ND_KEYFRAME_EDIT (71<<16)
196 #define ND_KEYFRAME_PROP (72<<16)
197 #define ND_ANIMCHAN_SELECT (73<<16)
198 #define ND_ANIMCHAN_EDIT (74<<16)
199 #define ND_NLA_SELECT (75<<16)
200 #define ND_NLA_EDIT (76<<16)
201 #define ND_NLA_ACTCHANGE (77<<16)
203 /* subtype, 256 entries too */
204 #define NOTE_SUBTYPE 0x0000FF00
206 /* subtype scene mode */
207 #define NS_MODE_OBJECT (1<<8)
209 #define NS_EDITMODE_MESH (2<<8)
210 #define NS_EDITMODE_CURVE (3<<8)
211 #define NS_EDITMODE_SURFACE (4<<8)
212 #define NS_EDITMODE_TEXT (5<<8)
213 #define NS_EDITMODE_MBALL (6<<8)
214 #define NS_EDITMODE_LATTICE (7<<8)
215 #define NS_EDITMODE_ARMATURE (8<<8)
216 #define NS_MODE_POSE (9<<8)
217 #define NS_MODE_PARTICLE (10<<8)
220 /* action classification */
221 #define NOTE_ACTION (0x000000FF)
223 #define NA_EVALUATED 2
228 /* ************** Gesture Manager data ************** */
230 /* wmGesture->type */
231 #define WM_GESTURE_TWEAK 0
232 #define WM_GESTURE_LINES 1
233 #define WM_GESTURE_RECT 2
234 #define WM_GESTURE_CROSS_RECT 3
235 #define WM_GESTURE_LASSO 4
236 #define WM_GESTURE_CIRCLE 5
238 /* wmGesture is registered to window listbase, handled by operator callbacks */
239 /* tweak gesture is builtin feature */
240 typedef struct wmGesture {
241 struct wmGesture *next, *prev;
242 int event_type; /* event->type */
243 int mode; /* for modal callback */
244 int type; /* gesture type define */
245 int swinid; /* initial subwindow id where it started */
246 int points; /* optional, amount of points stored */
249 /* customdata for border is a recti */
250 /* customdata for circle is recti, (xmin, ymin) is center, xmax radius */
251 /* customdata for lasso is short array */
254 /* ************** custom wmEvent data ************** */
259 typedef struct wmTabletData {
260 int Active; /* 0=None, 1=Stylus, 2=Eraser */
261 float Pressure; /* range 0.0 (not touching) to 1.0 (full pressure) */
262 float Xtilt; /* range 0.0 (upright) to 1.0 (tilted fully against the tablet surface) */
263 float Ytilt; /* as above */
266 typedef struct wmTimer {
267 struct wmTimer *next, *prev;
268 double timestep; /* set by timer user */
269 int event_type; /* set by timer user, goes to event system */
270 void *customdata; /* set by timer user, to allow custom values */
272 double duration; /* total running time in seconds */
273 double delta; /* time since previous step in seconds */
275 double ltime; /* internal, last time timer was activated */
276 int sleep; /* internal, put timers to sleep when needed */
280 /* ****************** Messages ********************* */
285 WM_LOG_WARNING = 2000,
286 WM_ERROR_UNDEFINED = 3000,
287 WM_ERROR_INVALID_INPUT = 3001,
288 WM_ERROR_INVALID_CONTEXT = 3002,
289 WM_ERROR_OUT_OF_MEMORY = 3003
292 typedef struct wmReport {
293 struct wmReport *next, *prev;
299 /* *************** migrated stuff, clean later? ******************************** */
301 typedef struct RecentFile {
302 struct RecentFile *next, *prev;
307 #endif /* WM_TYPES_H */