diff options
author | Ton Roosendaal <ton@blender.org> | 2008-12-02 17:22:52 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-12-02 17:22:52 +0300 |
commit | 54908979c54ab332156f438e995d5dce8ee8420c (patch) | |
tree | 94558d3acad12b5c0f08e902d967ce3d6d0f0723 /source/blender/windowmanager/wm_event_system.h | |
parent | c4fe6d0f00aa2a9656445ebb53161768e0c51342 (diff) |
Lots of stuff; couldn't commit in parts because of refactor work.
* Changes in interface/ module
This commit brings back the way how buttons/menus work under control
of WM event system. The previous implementation extended usage of
handlers and operators in an interesting but confusing way. Better to
try it first according the design specs. :)
Most obviously:
- modal-handler operators are not stored anymore in regions/areas/windows.
such modal handlers own their operator, and should remove it themselves.
- removed code to move handlers from one queue to another.
(needs review with brecht!)
- WM fix: the API call to remove a modal handler got removed. This was a
dangerous thing anyway, and you should leave that to the event system.
Now, if a handler modal() call gets a cancel/finish return, it frees
itself in event system. WM_event_remove_modal_handler was a confusing
call anyway!
Todo:
- allow button-activate to refresh after using button
- re-enable arrow keys for menus
(do both after commit)
- review return values of operator callbacks in interface_ops.c
* Fixes in WM system
- Freeing areas/regions/windows, also on quit, now correctly closes
running modal handlers
- On starting a modal handler, the handler now stores previous area
and region context, so they send proper notifiers etc.
* Other fixes
- Area-split operator had bug, wrong minimal size checking. This
solves error when trying to split a very narrow area.
- removed DNA_USHORT_FIX from screen_types.h, gave warning
- operators didn't get ID name copied when activated, needed for
later re-use or saving.
Diffstat (limited to 'source/blender/windowmanager/wm_event_system.h')
-rw-r--r-- | source/blender/windowmanager/wm_event_system.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h index cbaef2a8c30..1b3b7ce8efb 100644 --- a/source/blender/windowmanager/wm_event_system.h +++ b/source/blender/windowmanager/wm_event_system.h @@ -32,6 +32,8 @@ #define WM_HANDLER_CONTINUE 0 #define WM_HANDLER_BREAK 1 +struct ScrArea; +struct ARegion; /* wmKeyMap is in DNA_windowmanager.h, it's savable */ @@ -44,7 +46,9 @@ typedef struct wmEventHandler { rctf boundbox; /* float, in bContext space (window, area, region) */ - wmOperator *op; /* for derived handlers */ + wmOperator *op; /* for derived/modal handlers */ + struct ScrArea *op_area; /* for derived/modal handlers */ + struct ARegion *op_region; /* for derived/modal handlers */ } wmEventHandler; @@ -65,7 +69,6 @@ enum { void wm_event_add(wmWindow *win, wmEvent *event_to_add); void wm_event_free_all (wmWindow *win); wmEvent *wm_event_next (wmWindow *win); -void wm_event_free_handlers (ListBase *lb); /* goes over entire hierarchy: events -> window -> screen -> area -> region */ void wm_event_do_handlers (bContext *C); |