2.5
authorTon Roosendaal <ton@blender.org>
Wed, 3 Dec 2008 13:44:16 +0000 (13:44 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 3 Dec 2008 13:44:16 +0000 (13:44 +0000)
- Made view2d manipulations redraw on area level
- simplified call to send Notifiers:

  WM_event_add_notifier(bContext *C, int type, int value, void *data)

  This brings back more control to WM, no context messing within
  operators. :) Handlers that execute operators will be responsible
  for delivering correct contextes.

  In general: should lead to making context not exposed, but only
  readable via some callbacks.

source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_time/ed_markers.c
source/blender/editors/space_time/time_ops.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c

index 2852b758c8160d68c27b415548beb5b535bb812c..70aa9b4cd2b4ba036ec943397257c498a5b0858c 100644 (file)
@@ -1183,7 +1183,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiActiva
        }
 
        if(changed || handled)
-               WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
 }
 
 static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, uiActivateBut *data, wmEvent *event)
@@ -1209,7 +1209,7 @@ static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, u
 
        if(handled) {
                ui_check_but(but);
-               WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
        }
 }
 
@@ -1265,7 +1265,7 @@ static void ui_numedit_apply(bContext *C, uiBlock *block, uiBut *but, uiActivate
        if(data->interactive) ui_apply_button(block, but, data, 1);
        else ui_check_but(but);
 
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
 }
 
 /* ****************** block opening for various types **************** */
@@ -2647,7 +2647,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiActivateButState st
        }
 
        data->state= state;
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
 }
 
 static void button_activate_init(bContext *C, ARegion *ar, wmOperator *op, uiBut *but, uiBut *lastbut)
@@ -2746,7 +2746,7 @@ static void button_activate_exit(bContext *C, uiActivateBut *data, wmOperator *o
        }
 
        /* redraw */
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
 
        /* clean up */
        button_disable_timers(C, data);
@@ -2863,7 +2863,7 @@ static int button_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
                                if(event->customdata == data->tooltiptimer) {
                                        if(!data->tooltip) {
                                                data->tooltip= ui_tooltip_create(C, data->region, but);
-                                               WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+                                               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
                                        }
 
                                        WM_event_remove_window_timer(C->window, data->tooltiptimer);
@@ -2891,14 +2891,14 @@ static int button_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
                                if(but && but->activate == data) {
                                        if(!(but->flag & UI_SELECT)) {
                                                but->flag |= UI_SELECT;
-                                               WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+                                               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
                                        }
                                }
                                else {
                                        but= ui_but_find_activated(data->region, data, &block);
                                        if(but->flag & UI_SELECT) {
                                                but->flag &= ~UI_SELECT;
-                                               WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+                                               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
                                        }
                                }
                                break;
index 8f2f933a946ecb27ebc4d4a8c256c9089e13fd9c..ba7add6c8750ac3198eace600be4365000c3d6af 100644 (file)
@@ -332,8 +332,8 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
        ar->winrct.ymax= y2;
 
        /* notify change and redraw */
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
 
        return ar;
 }
@@ -342,8 +342,8 @@ void ui_tooltip_free(bContext *C, ARegion *ar)
 {
        ui_remove_temporary_region(C, C->window->screen, ar);
 
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
 }
 
 /************************* Creating Menu Blocks **********************/
@@ -650,8 +650,8 @@ uiMenuBlockHandle *ui_menu_block_create(bContext *C, ARegion *butregion, uiBut *
        block->flag |= UI_BLOCK_LOOP|UI_BLOCK_MOVEMOUSE_QUIT;
 
        /* notify change and redraw */
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
 
        SWAP(ARegion*, C->region, ar); /* XXX 2.50 bad context swapping */
        WM_operator_invoke(C, WM_operatortype_find("ED_UI_OT_menu_block_handle"), NULL);
@@ -665,8 +665,8 @@ void ui_menu_block_free(bContext *C, uiMenuBlockHandle *handle)
        ui_remove_temporary_region(C, C->window->screen, handle->region);
        MEM_freeN(handle);
 
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
 }
 
 /***************************** Menu Button ***************************/
index 0fd01ea18ed9fed7791a5a054001855526829cb8..9a6389cadc96e3a07bbdb4243cc1eed9ab6953f7 100644 (file)
@@ -34,6 +34,8 @@
 #include "DNA_space_types.h"
 #include "DNA_view2d_types.h"
 
+#include "BLI_blenlib.h"
+
 #include "BKE_global.h"
 #include "BKE_utildefines.h"
 
@@ -157,7 +159,7 @@ static void view_pan_apply(bContext *C, wmOperator *op)
        }
        
        /* request updates to be done... */
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_AREA_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
        /* XXX: add WM_NOTE_TIME_CHANGED? */
 }
 
@@ -480,7 +482,7 @@ static void view_zoom_apply(bContext *C, wmOperator *op)
        }
        
        /* request updates to be done... */
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_AREA_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
        /* XXX: add WM_NOTE_TIME_CHANGED? */
 }
 
index ef8b47a368fb9138e21df39e0c3e48f71e5453e5..881f7719e1e23ea89fafad7320abe6b195065d84 100644 (file)
@@ -335,7 +335,7 @@ static int screen_area_rip_op(bContext *C, wmOperator *op)
        area_copy_data((ScrArea *)newsc->areabase.first, C->area, 0);
        
        /* screen, areas init */
-       WM_event_add_notifier(C->wm, win, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
        
        return OPERATOR_FINISHED;
 }
@@ -517,7 +517,7 @@ static void area_move_apply_do(bContext *C, int origval, int delta, int dir, int
                }
        }
 
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
 }
 
 static void area_move_apply(bContext *C, wmOperator *op)
@@ -766,7 +766,7 @@ static int area_split_apply(bContext *C, wmOperator *op)
                if(dir=='h') sd->origval= sd->nedge->v1->vec.y;
                else sd->origval= sd->nedge->v1->vec.x;
 
-               WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+               WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
                
                return 1;
        }               
@@ -781,7 +781,7 @@ static void area_split_exit(bContext *C, wmOperator *op)
                op->customdata = NULL;
        }
        
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
 
        /* this makes sure aligned edges will result in aligned grabbing */
        removedouble_scrverts(C->screen);
@@ -887,7 +887,7 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event)
                        sd->delta= (dir == 'v')? event->x - sd->origval: event->y - sd->origval;
                        area_move_apply_do(C, sd->origval, sd->delta, dir, sd->bigger, sd->smaller);
                        
-                       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+                       WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
                        break;
                        
                case LEFTMOUSE:
@@ -1090,7 +1090,7 @@ static int area_join_cancel(bContext *C, wmOperator *op)
                jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
        }
 
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
        
        area_join_exit(C, op);
 
@@ -1137,7 +1137,7 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event)
                                                                jd->sa2 = NULL;
                                                        }
                                                }
-                                               WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+                                               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
                                        } 
                                        else {
                                                /* we are back in the area previously selected for keeping 
@@ -1162,7 +1162,7 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event)
                                                                jd->sa2->flag |= AREA_FLAG_DRAWJOINTO;
                                                        }
                                                }
-                                               WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+                                               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
                                        }
                                }
                        }
@@ -1170,7 +1170,7 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event)
                case LEFTMOUSE:
                        if(event->val==0) {
                                area_join_apply(C, op);
-                               WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+                               WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
                                area_join_exit(C, op);
                                return OPERATOR_FINISHED;
                        }
index 1829435bf8db584fbac1e6e0745aef5108f1c0d1..0fcd9e910a74a5bad3caf3943597c1f8868e052f 100644 (file)
@@ -56,6 +56,7 @@
 #include "UI_interface_icons.h"
 #include "UI_view2d.h"
 #include "UI_resources.h"
+#include "UI_text.h"
 
 #include "ED_markers.h"
 #include "ED_screen.h"
@@ -244,7 +245,6 @@ typedef struct MarkerMove {
        ListBase *markers;
        int event_type;         /* store invoke-event, to verify */
        int *oldframe, evtx, firstx;
-       short swinid;
 } MarkerMove;
 
 /* copy selection to temp buffer */
@@ -293,7 +293,6 @@ static int ed_marker_move_invoke(bContext *C, wmOperator *op, wmEvent *evt)
                
                mm->evtx= evt->x;
                mm->firstx= evt->x;
-               mm->swinid= C->region->swinid;
                mm->event_type= evt->type;
                
                /* add temp handler */
@@ -327,13 +326,12 @@ static void ed_marker_move_apply(bContext *C, wmOperator *op)
 /* only for modal */
 static void ed_marker_move_cancel(bContext *C, wmOperator *op)
 {
-       MarkerMove *mm= op->customdata;
        
        RNA_int_set(op->ptr, "frs", 0);
        ed_marker_move_apply(C, op);
        ed_marker_move_exit(C, op);     
        
-       WM_event_add_notifier(C->wm, C->window, mm->swinid, WM_NOTE_AREA_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
 }
 
 
@@ -375,7 +373,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
                case RIGHTMOUSE:
                        if(WM_modal_tweak_check(evt, mm->event_type)) {
                                ed_marker_move_exit(C, op);
-                               WM_event_add_notifier(C->wm, C->window, mm->swinid, WM_NOTE_AREA_REDRAW, 0, NULL);
+                               WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
                                return OPERATOR_FINISHED;
                        }
                        
@@ -452,7 +450,7 @@ XXX                                 else if (mm->slink->spacetype == SPACE_ACTION) {
                                        }
                                }
                                
-                               WM_event_add_notifier(C->wm, C->window, mm->swinid, WM_NOTE_AREA_REDRAW, 0, NULL);
+                               WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
                                // headerprint(str); XXX
                        }
        }
@@ -620,7 +618,7 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend)
                select_timeline_marker_frame(cfra, 0);
        
        /* XXX notifier for markers... */
-       WM_event_add_notifier(C->wm, C->window, C->region->swinid, WM_NOTE_AREA_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
 
        return OPERATOR_PASS_THROUGH;
 }
@@ -682,7 +680,6 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
 {
        View2D *v2d= UI_view2d_fromcontext(C);
        ListBase *markers= context_get_markers(C);
-       wmGesture *gesture= op->customdata;
        TimeMarker *marker;
        float xminf, xmaxf, yminf, ymaxf;
        int event_type= RNA_int_get(op->ptr, "event_type");
@@ -714,8 +711,8 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
                }
        }
        
-       /* XXX notifier for markers..., XXX swinid??? */
-       WM_event_add_notifier(C->wm, C->window, gesture->swinid, WM_NOTE_AREA_REDRAW, 0, NULL);
+       /* XXX notifier for markers... */
+       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
 
        return 1;
 }
@@ -769,7 +766,7 @@ static int ed_marker_select_all_exec(bContext *C, wmOperator *op)
        }
        
        /* XXX notifier for markers... */
-       WM_event_add_notifier(C->wm, C->window, C->region->swinid, WM_NOTE_AREA_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
 
        return OPERATOR_FINISHED;
 }
@@ -817,7 +814,7 @@ static int ed_marker_delete_exec(bContext *C, wmOperator *op)
        
        /* XXX notifier for markers... */
        if(changed)
-               WM_event_add_notifier(C->wm, C->window, C->region->swinid, WM_NOTE_AREA_REDRAW, 0, NULL);
+               WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
 
        return OPERATOR_FINISHED;
 }
index 657cf30e17eac3aa02f2bbc5d35839e7484894f7..207804dae3e3ca69a4b9a424561e6bde13611893 100644 (file)
@@ -85,7 +85,7 @@ static void change_frame_apply(bContext *C, wmOperator *op)
        if(cfra!=CFRA)
                CFRA= cfra;
        
-       WM_event_add_notifier(C->wm, C->window, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
        /* XXX: add WM_NOTE_TIME_CHANGED? */
 }
 
index 509056bfe71405099ac1689bc7dfdafd38a6c32d..7bbb97d9c42ebd8587b1469087fc23ac1fa17033 100644 (file)
@@ -77,9 +77,7 @@ void          WM_event_add_message(wmWindowManager *wm, void *customdata,
                                  short customdatafree);
 void           WM_event_add_mousemove(bContext *C);
 
-void           WM_event_add_notifier(wmWindowManager *wm, wmWindow *window,
-                                       int swinid, int type,
-                                       int value, void *data);
+void           WM_event_add_notifier(bContext *C, int type, int value, void *data);
 
 void           wm_event_add            (wmWindow *win, struct wmEvent *event_to_add); /* XXX only for warning */
 
index 85cf07864038277eae99b6d1beabc9d86911d3fe..d4c752f5b2eec211d129231049b032ca423d8a81 100644 (file)
@@ -92,15 +92,15 @@ void wm_event_free_all(wmWindow *win)
 
 /* ********************* notifiers, listeners *************** */
 
-/* win and swinid are optional context limitors */
-void WM_event_add_notifier(wmWindowManager *wm, wmWindow *window, int swinid, int type, int value, void *data)
+/* XXX: in future, which notifiers to send to other windows? */
+void WM_event_add_notifier(bContext *C, int type, int value, void *data)
 {
        wmNotifier *note= MEM_callocN(sizeof(wmNotifier), "notifier");
        
-       BLI_addtail(&wm->queue, note);
+       BLI_addtail(&C->wm->queue, note);
        
-       note->window= window;
-       note->swinid= swinid;
+       note->window= C->window;
+       if(C->region) note->swinid= C->region->swinid;
        note->type= type;
        note->value= value;
        note->data= data;
index 7a4b30af3849b3a7a848c34381353caf5ae382e1..17b248ae9edbb72be4e0b209d8cd2db4dfc3c44d 100644 (file)
@@ -183,7 +183,7 @@ static void border_select_end(bContext *C, wmOperator *op)
        WM_gesture_end(C, gesture);     /* frees gesture itself, and unregisters from window */
        op->customdata= NULL;
 
-       WM_event_add_notifier(C->wm, C->window, gesture->swinid, WM_NOTE_AREA_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
        
 }
 
@@ -194,7 +194,7 @@ int WM_border_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
        /* add modal handler */
        WM_event_add_modal_handler(C, &C->window->handlers, op);
        
-       WM_event_add_notifier(C->wm, C->window, C->screen->subwinactive, WM_NOTE_GESTURE_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_GESTURE_REDRAW, 0, NULL);
 
        return OPERATOR_RUNNING_MODAL;
 }
@@ -219,7 +219,7 @@ int WM_border_select_modal(bContext *C, wmOperator *op, wmEvent *event)
                                rect->ymax= event->y - sy;
                        }
                        
-                       WM_event_add_notifier(C->wm, C->window, gesture->swinid, WM_NOTE_GESTURE_REDRAW, 0, NULL);
+                       WM_event_add_notifier(C, WM_NOTE_GESTURE_REDRAW, 0, NULL);
 
                        break;
                        
@@ -229,7 +229,7 @@ int WM_border_select_modal(bContext *C, wmOperator *op, wmEvent *event)
                        if(event->val==1) {
                                if(gesture->type==WM_GESTURE_CROSS_RECT && gesture->mode==0) {
                                        gesture->mode= 1;
-                                       WM_event_add_notifier(C->wm, C->window, gesture->swinid, WM_NOTE_GESTURE_REDRAW, 0, NULL);
+                                       WM_event_add_notifier(C, WM_NOTE_GESTURE_REDRAW, 0, NULL);
                                }
                        }
                        else {
@@ -254,7 +254,7 @@ static int tweak_gesture_invoke(bContext *C, wmOperator *op, wmEvent *event)
        /* add modal handler */
        WM_event_add_modal_handler(C, &C->window->handlers, op);
        
-       WM_event_add_notifier(C->wm, C->window, C->screen->subwinactive, WM_NOTE_GESTURE_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_GESTURE_REDRAW, 0, NULL);
        
        return OPERATOR_RUNNING_MODAL;
 }
@@ -266,7 +266,7 @@ static void tweak_gesture_end(bContext *C, wmOperator *op)
        WM_gesture_end(C, gesture);     /* frees gesture itself, and unregisters from window */
        op->customdata= NULL;
 
-       WM_event_add_notifier(C->wm, C->window, gesture->swinid, WM_NOTE_AREA_REDRAW, 0, NULL);
+       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
        
 }
 
@@ -302,7 +302,7 @@ static int tweak_gesture_modal(bContext *C, wmOperator *op, wmEvent *event)
                                return OPERATOR_FINISHED;
                        }
                        else
-                               WM_event_add_notifier(C->wm, C->window, gesture->swinid, WM_NOTE_GESTURE_REDRAW, 0, NULL);
+                               WM_event_add_notifier(C, WM_NOTE_GESTURE_REDRAW, 0, NULL);
                        
                        break;
                        
index 2044692c6659165c9ff1a8c0eb06e18be6a55dbc..884abc1fa256e35f9f52c146cf028b6c41534efb 100644 (file)
@@ -423,7 +423,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
                                if(G.f & G_DEBUG) printf("ghost redraw\n");
                                
                                wm_window_make_drawable(C, win);
-                               WM_event_add_notifier(C->wm, win, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+                               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
 
                                break;
                        }
@@ -468,13 +468,13 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
                                }
                                
                                wm_window_make_drawable(C, win);
-                               WM_event_add_notifier(C->wm, win, 0, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+                               WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
                                
                                break;
                        }
                        default:
                                if(type==GHOST_kEventKeyDown) // XXX debug
-                                       WM_event_add_notifier(C->wm, win, 0, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+                                       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
                                wm_event_add_ghostevent(win, type, data);
                                break;
                }