diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-11-11 18:18:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-11-11 18:18:21 +0300 |
commit | 4a4b0732e5d1bc71dde53934a4e74dc782beee1c (patch) | |
tree | 89731bd1e7c0a2305d947c8db1d68055c82f1f4e /source/blender/makesdna/DNA_windowmanager_types.h | |
parent | 3bb5fc9c7d10f7dec32f8d2a772fce69be468b15 (diff) |
Various changes made in the process of working on the UI code:
* Added functions to generate Timer events. There was some unfinished code to
create one timer per window, this replaces that with a way to let operators
or other handlers add/remove their own timers as needed. This is currently
delivered as an event with the timer handle, perhaps this should be a notifier
instead? Also includes some fixes in ghost for timer events that were not
delivered in time, due to passing negative timeout.
* Added a Message event, which is a generic event that can be added by any
operator. This is used in the UI code to communicate the results of opened
blocks. Again, this may be better as a notifier.
* These two events should not be blocked as they are intended for a specific
operator or handler, so there were exceptions added for this, which is one
of the reasons they might work better as notifiers, but currently these
things can't listen to notifier yet.
* Added an option to events to indicate if the customdata should be freed or
not.
* Added a free() callback for area regions, and added a free function for
area regions in blenkernel since it was already there for screens and areas.
* Added ED_screen/area/region_exit functions to clean up things like operators
and handlers when they are closed.
* Added screen level regions, these will draw over areas boundaries, with the
last created region on top. These are useful for tooltips, menus, etc, and
are not saved to file. It's using the same ARegion struct as areas to avoid
code duplication, but perhaps that should be renamed then. Note that redraws
currently go correct, because only full window redraws are used, for partial
redraws without any frontbuffer drawing, the window manager needs to get
support for compositing subwindows.
* Minor changes in the subwindow code to retrieve the matrix, and moved
setlinestyle to glutil.c.
* Reversed argument order in WM_event_add/remove_keymap_handler to be consistent
with modal_handler.
* Operators can now block events but not necessarily cancel/finish.
* Modal operators are now stored in a list in the window/area/region they were
created in. This means for example that when a transform operator is invoked
from a region but registers a handler at the window level (since mouse motion
across areas should work), it will still get removed when the region is closed
while the operator is running.
Diffstat (limited to 'source/blender/makesdna/DNA_windowmanager_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_windowmanager_types.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 99334d705dc..bb5bf6d19b3 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -78,10 +78,8 @@ typedef struct wmWindow { struct wmWindow *next, *prev; void *ghostwin; /* dont want to include ghost.h stuff */ - void *timer; - int timer_event; - int winid; /* winid also in screens, is for retrieving this window after read */ + int winid, pad; /* winid also in screens, is for retrieving this window after read */ struct bScreen *screen; /* active screen */ char screenname[32]; /* MAX_ID_NAME for matching window with active screen after file read */ @@ -96,11 +94,12 @@ typedef struct wmWindow { struct wmSubWindow *curswin; /* internal for wm_subwindow.c only */ - ListBase queue; /* all events (ghost level events were handled) */ - ListBase handlers; /* window+screen handlers, overriding all queues */ + ListBase queue; /* all events (ghost level events were handled) */ + ListBase handlers; /* window+screen handlers, overriding all queues */ + ListBase modalops; /* wmOperator, operators running modal */ ListBase subwindows; /* opengl stuff for sub windows, see notes in wm_subwindow.c */ - ListBase gesture; /* gesture stuff */ + ListBase gesture; /* gesture stuff */ } wmWindow; # @@ -169,13 +168,16 @@ typedef struct wmOperator { /* or IDproperty list */ IDProperty *properties; + /* runtime */ + ListBase *modallist; } wmOperator; -/* operator type exec(), invoke() modal(), cancel() return values */ -#define OPERATOR_PASS_THROUGH 0 +/* operator type exec(), invoke() modal(), return values */ #define OPERATOR_RUNNING_MODAL 1 #define OPERATOR_CANCELLED 2 -#define OPERATOR_FINISHED 3 +#define OPERATOR_FINISHED 4 +/* add this flag if the event should pass through */ +#define OPERATOR_PASS_THROUGH 8 #endif /* DNA_WINDOWMANAGER_TYPES_H */ |