diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-08-11 12:39:59 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-08-11 13:02:26 +0400 |
commit | 028fd29eeb092b6ed0625ed4d59b8100ae69596f (patch) | |
tree | 0cb15b15f17e6d9f16fef74631e3838e8962fafe /source/blender/makesrna/intern/rna_wm.c | |
parent | 5d1d23d5bdb0e5937520f16063f8d16fb049850c (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/makesrna/intern/rna_wm.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 996d2d2882d..c88fa020ed6 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -594,6 +594,17 @@ static PointerRNA rna_PopupMenu_layout_get(PointerRNA *ptr) return rptr; } +static PointerRNA rna_PieMenu_layout_get(PointerRNA *ptr) +{ + struct uiPieMenu *pie = ptr->data; + uiLayout *layout = uiPieMenuLayout(pie); + + PointerRNA rptr; + RNA_pointer_create(ptr->id.data, &RNA_UILayout, layout, &rptr); + + return rptr; +} + static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value) { wmWindow *win = (wmWindow *)ptr->data; @@ -1716,6 +1727,26 @@ static void rna_def_popupmenu(BlenderRNA *brna) RNA_define_verify_sdna(1); /* not in sdna */ } +static void rna_def_piemenu(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "UIPieMenu", NULL); + RNA_def_struct_ui_text(srna, "PieMenu", ""); + RNA_def_struct_sdna(srna, "uiPieMenu"); + + RNA_define_verify_sdna(0); /* not in sdna */ + + /* could wrap more, for now this is enough */ + prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "UILayout"); + RNA_def_property_pointer_funcs(prop, "rna_PieMenu_layout_get", + NULL, NULL, NULL); + + RNA_define_verify_sdna(1); /* not in sdna */ +} + static void rna_def_window(BlenderRNA *brna) { StructRNA *srna; @@ -2078,6 +2109,7 @@ void RNA_def_wm(BlenderRNA *brna) rna_def_event(brna); rna_def_timer(brna); rna_def_popupmenu(brna); + rna_def_piemenu(brna); rna_def_window(brna); rna_def_windowmanager(brna); rna_def_keyconfig(brna); |