Cleanup: rename wmEventHandler_* base -> head
authorCampbell Barton <ideasman42@gmail.com>
Tue, 19 Feb 2019 22:43:29 +0000 (09:43 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 19 Feb 2019 22:43:29 +0000 (09:43 +1100)
Makes it more clear it's the header/start of the struct.

source/blender/editors/interface/interface_handlers.c
source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_operator_type.c
source/blender/windowmanager/wm_event_system.h

index 64e05c0c7509e6678d0138cd644ec61d5c7ae4be..507e05810201c272962384c11208d98b4d56725c 100644 (file)
@@ -10036,9 +10036,9 @@ void UI_popup_handlers_remove(ListBase *handlers, uiPopupBlockHandle *popup)
                            handler->user_data == popup)
                        {
                                /* tag refresh parent popup */
-                               wmEventHandler_UI *handler_next = (wmEventHandler_UI *)handler->base.next;
+                               wmEventHandler_UI *handler_next = (wmEventHandler_UI *)handler->head.next;
                                if (handler_next &&
-                                   handler_next->base.type == WM_HANDLER_TYPE_UI &&
+                                   handler_next->head.type == WM_HANDLER_TYPE_UI &&
                                    handler_next->handle_fn == ui_popup_handler &&
                                    handler_next->remove_fn == ui_popup_handler_remove)
                                {
index b1e35943b6c19070f4fe623ecef031ccf5160c95..f26204996616922359ca37ab8ba4499b8ad34a5b 100644 (file)
@@ -683,7 +683,7 @@ void WM_gizmomap_add_handlers(ARegion *ar, wmGizmoMap *gzmap)
        }
 
        wmEventHandler_Gizmo *handler = MEM_callocN(sizeof(*handler), __func__);
-       handler->base.type = WM_HANDLER_TYPE_GIZMO;
+       handler->head.type = WM_HANDLER_TYPE_GIZMO;
        BLI_assert(gzmap == ar->gizmo_map);
        handler->gizmo_map = gzmap;
        BLI_addtail(&ar->handlers, handler);
index ac65bf6a888dff1142c2b229212c972a3bf14d07..2c6dcd564710960cb91b08cd4d4171a49bac543a 100644 (file)
@@ -204,7 +204,7 @@ void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot)
                                        if (handler->op && handler->op->type == ot) {
                                                /* don't run op->cancel because it needs the context,
                                                 * assume whoever unregisters the operator will cleanup */
-                                               handler->base.flag |= WM_HANDLER_DO_FREE;
+                                               handler->head.flag |= WM_HANDLER_DO_FREE;
                                                WM_operator_free(handler->op);
                                                handler->op = NULL;
                                        }
index b439d41d0638e97dab57d565797bb7914354ccaf..e1e53ed5f12d47511cffcd9cd07e96616d4a45d8 100644 (file)
@@ -554,7 +554,7 @@ static int wm_handler_ui_call(bContext *C, wmEventHandler_UI *handler, const wmE
 
        /* UI code doesn't handle return values - it just always returns break.
         * to make the DBL_CLICK conversion work, we just don't send this to UI, except mouse clicks */
-       if (((handler->base.flag & WM_HANDLER_ACCEPT_DBL_CLICK) == 0) &&
+       if (((handler->head.flag & WM_HANDLER_ACCEPT_DBL_CLICK) == 0) &&
            !ISMOUSE_BUTTON(event->type) &&
            (event->val == KM_DBL_CLICK))
        {
@@ -2051,7 +2051,7 @@ static int wm_handler_operator_call(
                                        WM_cursor_grab_disable(CTX_wm_window(C), NULL);
 
                                        BLI_remlink(handlers, handler);
-                                       wm_event_free_handler(&handler->base);
+                                       wm_event_free_handler(&handler->head);
 
                                        /* prevent silly errors from operator users */
                                        //retval &= ~OPERATOR_PASS_THROUGH;
@@ -2280,7 +2280,7 @@ static int wm_handler_fileselect_do(bContext *C, ListBase *handlers, wmEventHand
 
                        CTX_wm_area_set(C, NULL);
 
-                       wm_event_free_handler(&handler->base);
+                       wm_event_free_handler(&handler->head);
 
                        action = WM_HANDLER_BREAK;
                        break;
@@ -2909,7 +2909,7 @@ static void wm_event_temp_tool_handler_apply(
                        /* We shouldn't use keymaps from unrelated spaces. */
                        if (km != NULL) {
                                // printf("Keymap: '%s' -> '%s'\n", tref_rt->keymap, sa->runtime.tool->idname);
-                               sneaky_handler->base.type = WM_HANDLER_TYPE_KEYMAP;
+                               sneaky_handler->head.type = WM_HANDLER_TYPE_KEYMAP;
                                sneaky_handler->keymap = km;
                                sneaky_handler->keymap_tool = sa->runtime.tool;
 
@@ -3273,7 +3273,7 @@ void WM_event_add_fileselect(bContext *C, wmOperator *op)
        }
 
        wmEventHandler_Op *handler = MEM_callocN(sizeof(*handler), __func__);
-       handler->base.type = WM_HANDLER_TYPE_OP;
+       handler->head.type = WM_HANDLER_TYPE_OP;
 
        handler->is_fileselect = true;
        handler->op = op;
@@ -3302,7 +3302,7 @@ static void WM_event_set_handler_flag(wmEventHandler *handler, int flag)
 wmEventHandler_Op *WM_event_add_modal_handler(bContext *C, wmOperator *op)
 {
        wmEventHandler_Op *handler = MEM_callocN(sizeof(*handler), __func__);
-       handler->base.type = WM_HANDLER_TYPE_OP;
+       handler->head.type = WM_HANDLER_TYPE_OP;
        wmWindow *win = CTX_wm_window(C);
 
        /* operator was part of macro */
@@ -3381,7 +3381,7 @@ wmEventHandler_Keymap *WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap
        }
 
        wmEventHandler_Keymap *handler = MEM_callocN(sizeof(*handler), __func__);
-       handler->base.type = WM_HANDLER_TYPE_KEYMAP;
+       handler->head.type = WM_HANDLER_TYPE_KEYMAP;
        BLI_addtail(handlers, handler);
        handler->keymap = keymap;
 
@@ -3394,7 +3394,7 @@ wmEventHandler_Keymap *WM_event_add_keymap_handler_priority(ListBase *handlers,
        WM_event_remove_keymap_handler(handlers, keymap);
 
        wmEventHandler_Keymap *handler = MEM_callocN(sizeof(*handler), "event keymap handler");
-       handler->base.type = WM_HANDLER_TYPE_KEYMAP;
+       handler->head.type = WM_HANDLER_TYPE_KEYMAP;
 
        BLI_addhead(handlers, handler);
        handler->keymap = keymap;
@@ -3407,8 +3407,8 @@ wmEventHandler_Keymap *WM_event_add_keymap_handler_bb(ListBase *handlers, wmKeyM
        wmEventHandler_Keymap *handler = WM_event_add_keymap_handler(handlers, keymap);
 
        if (handler) {
-               handler->base.bblocal = bblocal;
-               handler->base.bbwin = bbwin;
+               handler->head.bblocal = bblocal;
+               handler->head.bbwin = bbwin;
        }
        return handler;
 }
@@ -3420,7 +3420,7 @@ void WM_event_remove_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
                        wmEventHandler_Keymap *handler = (wmEventHandler_Keymap *)handler_base;
                        if (handler->keymap == keymap) {
                                BLI_remlink(handlers, handler);
-                               wm_event_free_handler(&handler->base);
+                               wm_event_free_handler(&handler->head);
                                break;
                        }
                }
@@ -3442,7 +3442,7 @@ wmEventHandler_UI *WM_event_add_ui_handler(
         void *user_data, const char flag)
 {
        wmEventHandler_UI *handler = MEM_callocN(sizeof(*handler), __func__);
-       handler->base.type = WM_HANDLER_TYPE_UI;
+       handler->head.type = WM_HANDLER_TYPE_UI;
        handler->handle_fn = handle_fn;
        handler->remove_fn = remove_fn;
        handler->user_data = user_data;
@@ -3458,7 +3458,7 @@ wmEventHandler_UI *WM_event_add_ui_handler(
        }
 
        BLI_assert((flag & WM_HANDLER_DO_FREE) == 0);
-       handler->base.flag = flag;
+       handler->head.flag = flag;
 
        BLI_addhead(handlers, handler);
 
@@ -3480,11 +3480,11 @@ void WM_event_remove_ui_handler(
                        {
                                /* handlers will be freed in wm_handlers_do() */
                                if (postpone) {
-                                       handler->base.flag |= WM_HANDLER_DO_FREE;
+                                       handler->head.flag |= WM_HANDLER_DO_FREE;
                                }
                                else {
                                        BLI_remlink(handlers, handler);
-                                       wm_event_free_handler(&handler->base);
+                                       wm_event_free_handler(&handler->head);
                                }
                                break;
                        }
@@ -3504,7 +3504,7 @@ void WM_event_free_ui_handler_all(
                        {
                                remove_fn(C, handler->user_data);
                                BLI_remlink(handlers, handler);
-                               wm_event_free_handler(&handler->base);
+                               wm_event_free_handler(&handler->head);
                        }
                }
        }
@@ -3523,7 +3523,7 @@ wmEventHandler_Dropbox *WM_event_add_dropbox_handler(ListBase *handlers, ListBas
        }
 
        wmEventHandler_Dropbox *handler = MEM_callocN(sizeof(*handler), __func__);
-       handler->base.type = WM_HANDLER_TYPE_DROPBOX;
+       handler->head.type = WM_HANDLER_TYPE_DROPBOX;
 
        /* dropbox stored static, no free or copy */
        handler->dropboxes = dropboxes;
index 860e0bc6288a6e5165c86f455fc93e88eb05eefa..76586ee2a0bdee7ab91c8b35c7368dfc68a9ca46 100644 (file)
@@ -414,7 +414,7 @@ static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                handler = BLI_findptr(&win->modalhandlers, op, offsetof(wmEventHandler_Op, op));
                                if (handler) {
                                        BLI_remlink(&win->modalhandlers, handler);
-                                       wm_event_free_handler(&handler->base);
+                                       wm_event_free_handler(&handler->head);
                                }
 
                                /* if operator is blocking, grab cursor
index d107d009ad18d4227284a251c9f5090ece8df879..ab59f52f125e313bbc5a188c99c06cfb3cdc2994 100644 (file)
@@ -61,7 +61,7 @@ typedef struct wmEventHandler {
 
 /** #WM_HANDLER_TYPE_KEYMAP */
 typedef struct wmEventHandler_Keymap {
-       wmEventHandler base;
+       wmEventHandler head;
 
        /** Pointer to builtin/custom keymaps (never NULL). */
        wmKeyMap *keymap;
@@ -73,7 +73,7 @@ typedef struct wmEventHandler_Keymap {
 
 /** #WM_HANDLER_TYPE_GIZMO */
 typedef struct wmEventHandler_Gizmo {
-       wmEventHandler base;
+       wmEventHandler head;
 
        /** Gizmo handler (never NULL). */
        struct wmGizmoMap *gizmo_map;
@@ -81,7 +81,7 @@ typedef struct wmEventHandler_Gizmo {
 
 /** #WM_HANDLER_TYPE_UI */
 typedef struct wmEventHandler_UI {
-       wmEventHandler base;
+       wmEventHandler head;
 
        wmUIHandlerFunc handle_fn;          /* callback receiving events */
        wmUIHandlerRemoveFunc remove_fn;    /* callback when handler is removed */
@@ -97,7 +97,7 @@ typedef struct wmEventHandler_UI {
 
 /** #WM_HANDLER_TYPE_OP */
 typedef struct wmEventHandler_Op {
-       wmEventHandler base;
+       wmEventHandler head;
 
        /** Operator can be NULL. */
        wmOperator *op;
@@ -115,7 +115,7 @@ typedef struct wmEventHandler_Op {
 
 /** #WM_HANDLER_TYPE_DROPBOX */
 typedef struct wmEventHandler_Dropbox {
-       wmEventHandler base;
+       wmEventHandler head;
 
        /** Never NULL. */
        ListBase *dropboxes;