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:
authorAntony Riakiotakis <kalast@gmail.com>2014-08-11 12:39:59 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-08-11 13:02:26 +0400
commit028fd29eeb092b6ed0625ed4d59b8100ae69596f (patch)
tree0cb15b15f17e6d9f16fef74631e3838e8962fafe /source/blender/editors/include/UI_interface.h
parent5d1d23d5bdb0e5937520f16063f8d16fb049850c (diff)
Pie Menus C code backend.
This commit merges the code in the pie-menu branch. As per decisions taken the last few days, there are no pie menus included and there will be an official add-on including overrides of some keys with pie menus. However, people will now be able to use the new code in python. Full Documentation is in http://wiki.blender.org/index.php/Dev:Ref/ Thanks: Campbell Barton, Dalai Felinto and Ton Roosendaal for the code review and design comments Jonathan Williamson, Pawel Lyczkowski, Pablo Vazquez among others for suggestions during the development. Special Thanks to Sean Olson, for his support, suggestions, testing and merciless bugging so that I would finish the pie menu code. Without him we wouldn't be here. Also to the rest of the developers of the original python add-on, Patrick Moore and Dan Eicher and finally to Matt Ebb, who did the research and first implementation and whose code I used to get started.
Diffstat (limited to 'source/blender/editors/include/UI_interface.h')
-rw-r--r--source/blender/editors/include/UI_interface.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index d7b4f753810..c02ab1e4cac 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -102,6 +102,7 @@ typedef struct uiLayout uiLayout;
#define UI_EMBOSSN 1 /* Nothing, only icon and/or text */
#define UI_EMBOSSP 2 /* Pulldown menu style */
#define UI_EMBOSST 3 /* Table */
+#define UI_EMBOSSR 4 /* Pie Menu */
/* uiBlock->direction */
#define UI_DIRECTION (UI_TOP | UI_DOWN | UI_LEFT | UI_RIGHT)
@@ -137,6 +138,7 @@ typedef struct uiLayout uiLayout;
/* block->flag bits 14-17 are identical to but->drawflag bits */
#define UI_BLOCK_LIST_ITEM (1 << 19)
+#define UI_BLOCK_RADIAL (1 << 20)
/* uiPopupBlockHandle->menuretval */
#define UI_RETURN_CANCEL (1 << 0) /* cancel all menus cascading */
@@ -360,6 +362,17 @@ struct uiLayout *uiPupMenuLayout(uiPopupMenu *head);
void uiPupMenuReports(struct bContext *C, struct ReportList *reports) ATTR_NONNULL();
bool uiPupMenuInvoke(struct bContext *C, const char *idname, struct ReportList *reports) ATTR_NONNULL(1, 2);
+/* Pie menus */
+typedef struct uiPieMenu uiPieMenu;
+
+void uiPieMenuInvoke(struct bContext *C, const char *idname, const struct wmEvent *event);
+void uiPieOperatorEnumInvoke(struct bContext *C, const char *title, const char *opname,
+ const char *propname, const struct wmEvent *event);
+void uiPieEnumInvoke(struct bContext *C, const char *title, const char *path, const struct wmEvent *event);
+
+struct uiPieMenu *uiPieMenuBegin(struct bContext *C, const char *title, int icon, const struct wmEvent *event) ATTR_NONNULL();
+void uiPieMenuEnd(struct bContext *C, uiPieMenu *pie);
+struct uiLayout *uiPieMenuLayout(struct uiPieMenu *pie);
/* Popup Blocks
*
* Functions used to create popup blocks. These are like popup menus
@@ -417,7 +430,8 @@ typedef enum {
UI_BLOCK_BOUNDS_TEXT,
UI_BLOCK_BOUNDS_POPUP_MOUSE,
UI_BLOCK_BOUNDS_POPUP_MENU,
- UI_BLOCK_BOUNDS_POPUP_CENTER
+ UI_BLOCK_BOUNDS_POPUP_CENTER,
+ UI_BLOCK_BOUNDS_PIE_CENTER,
} eBlockBoundsCalc;
void uiBoundsBlock(struct uiBlock *block, int addval);
@@ -705,7 +719,7 @@ void UI_panel_category_draw_all(struct ARegion *ar, const
* as screen/ if ED_KEYMAP_UI is set, or internally in popup functions. */
void UI_add_region_handlers(struct ListBase *handlers);
-void UI_add_popup_handlers(struct bContext *C, struct ListBase *handlers, uiPopupBlockHandle *popup);
+void UI_add_popup_handlers(struct bContext *C, struct ListBase *handlers, uiPopupBlockHandle *popup, const bool accept_dbl_click);
void UI_remove_popup_handlers(struct ListBase *handlers, uiPopupBlockHandle *popup);
void UI_remove_popup_handlers_all(struct bContext *C, struct ListBase *handlers);
@@ -737,6 +751,7 @@ void UI_exit(void);
#define UI_LAYOUT_HEADER 1
#define UI_LAYOUT_MENU 2
#define UI_LAYOUT_TOOLBAR 3
+#define UI_LAYOUT_PIEMENU 4
#define UI_UNIT_X ((void)0, U.widget_unit)
#define UI_UNIT_Y ((void)0, U.widget_unit)
@@ -827,8 +842,8 @@ uiLayout *uiLayoutListBox(uiLayout *layout, struct uiList *ui_list, struct Point
uiLayout *uiLayoutAbsolute(uiLayout *layout, int align);
uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align);
uiLayout *uiLayoutOverlap(uiLayout *layout);
-
uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout);
+uiLayout *uiLayoutRadial(uiLayout *layout);
/* templates */
void uiTemplateHeader(uiLayout *layout, struct bContext *C);