Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2008-11-17 21:54:03 +0300
committerTon Roosendaal <ton@blender.org>2008-11-17 21:54:03 +0300
commit8c84a4338597b8b17bca5b1ffbe819f6d71fbf83 (patch)
tree94939c5adcfde1f3e32e661db892a9ca48520e3e /source/blender/windowmanager
parent623421d580277f6e1f5404c019d4f807cf1645e9 (diff)
2.5 getting-back-into-coding commit :)
- cleaned up join and split operations. Most noticable is operator callback design, which should make a design based on user-less exec() first, then wrap invoke() and modal() around it. The exec() should be callable with only Context and properties. - split now works again; and inversed as previously, if you drag from a triangle (action zone) inside area it subdivides area as expected. - dragging from triangle outside area, over an edge, joins areas - split has been simplified, it had too many options... it could just work simpler (now) - 'action zone' now is an operator itself, a widget sending an ACTIONZONE event, which can be handled by others (so other gestures can be added in action zone too) Still evaluating: - context gets set where? - code structure confuses... what are proper functions for operators? - what is WM... should low level screen stuff more there? - when do you send event, notifier? - files grow to large, will clean Oh yeah and docs, docs, docs. Coming! :)
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c18
-rw-r--r--source/blender/windowmanager/wm_event_types.h2
3 files changed, 19 insertions, 3 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index d19d189af82..6df1601bd98 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -77,6 +77,8 @@ void WM_event_add_notifier(wmWindowManager *wm, wmWindow *window,
int swinid, int type,
int value, void *data);
+void wm_event_add(wmWindow *win, struct wmEvent *event_to_add); /* XXX only for warning */
+
/* one-shot timer, returns wmTimerData.handle */
struct wmTimerHandle *WM_event_add_window_timer(wmWindow *win, int delay_ms, int interval_ms);
void WM_event_remove_window_timer(wmWindow *wm, struct wmTimerHandle *handle);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 700ac04603d..73186d7e41d 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -442,8 +442,8 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
for(km= handler->keymap->first; km; km= km->next) {
if(wm_eventmatch(event, km)) {
- /*if(event->type!=MOUSEMOVE)
- printf("handle evt %d win %d op %s\n", event->type, C->window->winid, km->idname);*/
+ /* if(event->type!=MOUSEMOVE)
+ printf("handle evt %d win %d op %s\n", event->type, C->window->winid, km->idname); */
event->keymap_idname= km->idname; /* weak, but allows interactive callback to not use rawkey */
@@ -470,6 +470,17 @@ static int wm_event_inside_i(wmEvent *event, rcti *rect)
return BLI_in_rcti(rect, event->x, event->y);
}
+static ScrArea *area_event_inside(bContext *C, wmEvent *event)
+{
+ ScrArea *sa;
+
+ if(C->screen)
+ for(sa= C->screen->areabase.first; sa; sa= sa->next)
+ if(wm_event_inside_i(event, &sa->totrct))
+ return sa;
+ return NULL;
+}
+
/* called in main loop */
/* goes over entire hierarchy: events -> window -> screen -> area -> region */
@@ -488,7 +499,8 @@ void wm_event_do_handlers(bContext *C)
C->window= win;
C->screen= win->screen;
-
+ C->area= area_event_inside(C, event);
+
/* MVC demands to not draw in event handlers... for now we leave it */
wm_window_make_drawable(C, win);
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index 0e2a7c3b9fb..da644d77611 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -258,7 +258,9 @@
#define REDRAWVIEW3D_IMAGE 0x4041
/* **************** BLENDER GESTURE EVENTS ********************* */
+
#define BORDERSELECT 0x5000
+#define EVT_ACTIONZONE 0x5001
#endif /* WM_EVENT_TYPES_H */