diff options
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index b7639889bcd..a910e1bce2e 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -378,6 +378,7 @@ struct MenuType *WM_menutype_find(const char *idname, bool quiet); bool WM_menutype_add(struct MenuType *mt); void WM_menutype_freelink(struct MenuType *mt); void WM_menutype_free(void); +bool WM_menutype_poll(struct bContext *C, struct MenuType *mt); /* wm_gesture_ops.c */ int WM_gesture_border_invoke (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index a09cc4aeb31..9e877a83b3e 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -337,6 +337,14 @@ void WM_menutype_free(void) menutypes_hash = NULL; } +bool WM_menutype_poll(bContext *C, MenuType *mt) +{ + if (mt->poll != NULL) { + return mt->poll(C, mt); + } + return true; +} + /* ****************************************** */ void WM_keymap_init(bContext *C) |