diff options
author | Ton Roosendaal <ton@blender.org> | 2009-02-16 15:14:04 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-02-16 15:14:04 +0300 |
commit | 4154e48c053caf947f2668a168ce38aa10b8481b (patch) | |
tree | 294c3173648572d6669a8c85e08a459ba0075ce1 /source/blender/windowmanager/wm_event_types.h | |
parent | f6df8e1860d44d6b4d2c9048b0fb0ebdbfd850d3 (diff) |
2.5
Proper integration of File-selecting in WM. The communication
flow was flawed. :) Main problem was that filewindow can change
the screen context entirely, and should not do this directly on
a call inside an operator. Another problem was that the operator
ownership was handed over to SpaceFile, which is asking for
problems if you want to execute the operator with proper context
later on.
Solution is simple; window handlers already are valid owners of
operators and can manage context, so instead of directly talking
to the 'file space', you give the operator to a new handler this
way:
WM_event_add_fileselect(C, op);
This handler then listens to events (OPEN, EXEC, CANCEL) sent
by the WM or by the filewindow itself. This way local context
operators (like "open new image in imagewindow") will survive
a full-window fileselector fine, and in future also secondary
windows browsing files.
Two bugfixes included in this commit too:
- Add sequence menus in Sequencer used wrong context.
- When handler executes operators, it sets stored context now
by first checking if this is still valid.
Diffstat (limited to 'source/blender/windowmanager/wm_event_types.h')
-rw-r--r-- | source/blender/windowmanager/wm_event_types.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h index a3bf0ca728f..275d8d99810 100644 --- a/source/blender/windowmanager/wm_event_types.h +++ b/source/blender/windowmanager/wm_event_types.h @@ -197,7 +197,7 @@ #define ISKEYBOARD(event) (event >='a' && event <=255) -/* **************** BLENDER QUEUE EVENTS ********************* */ +/* **************** XXX depricated! BLENDER QUEUE EVENTS ********************* */ #define CHANGED 0x4000 #define DRAWEDGES 0x4001 @@ -211,7 +211,6 @@ #define AUTOSAVE_FILE 0x4009 #define UNDOPUSH 0x400A -/* REDRAWVIEW3D has to be the first one (lowest number) for buttons! */ #define REDRAWVIEW3D 0x4010 #define REDRAWVIEWCAM 0x4011 #define REDRAWVIEW3D_Z 0x4012 @@ -293,5 +292,17 @@ #define EVT_GESTURE_W_S 15 #define EVT_GESTURE_W_N 16 +/* **************** OTHER BLENDER EVENTS ********************* */ + +/* event->type */ +#define EVT_FILESELECT 0x5020 + +/* event->val */ +#define EVT_FILESELECT_OPEN 1 +#define EVT_FILESELECT_FULL_OPEN 2 +#define EVT_FILESELECT_EXEC 3 +#define EVT_FILESELECT_CANCEL 4 + + #endif /* WM_EVENT_TYPES_H */ |