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:
authorCampbell Barton <ideasman42@gmail.com>2018-04-22 11:51:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-22 11:51:23 +0300
commit1de7a0c0dc011a9286f14552858f10efc64d5f91 (patch)
tree1957a7ddac128dd6c1fa88aa900ccbd5752800c8 /source/blender/makesrna/intern/rna_wm.c
parente597f7495abcb5eedf8db27b4c4a72b3a58b727e (diff)
parent420e379e99a3351b2dd2a46989aa1d50bdf8abef (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 1d4652b0212..d7718d2e0f2 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -1951,44 +1951,36 @@ static void rna_def_timer(BlenderRNA *brna)
RNA_define_verify_sdna(1); /* not in sdna */
}
-static void rna_def_popupmenu(BlenderRNA *brna)
+static void rna_def_popup_menu_wrapper(
+ BlenderRNA *brna, const char *rna_type, const char *c_type, const char *layout_get_fn)
{
StructRNA *srna;
PropertyRNA *prop;
- srna = RNA_def_struct(brna, "UIPopupMenu", NULL);
- RNA_def_struct_ui_text(srna, "PopupMenu", "");
- RNA_def_struct_sdna(srna, "uiPopupMenu");
+ srna = RNA_def_struct(brna, rna_type, NULL);
+ /* UI name isn't visible, name same as type. */
+ RNA_def_struct_ui_text(srna, rna_type, "");
+ RNA_def_struct_sdna(srna, c_type);
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_PopupMenu_layout_get",
+ RNA_def_property_pointer_funcs(prop, layout_get_fn,
NULL, NULL, NULL);
RNA_define_verify_sdna(1); /* not in sdna */
}
-static void rna_def_piemenu(BlenderRNA *brna)
+static void rna_def_popupmenu(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_def_popup_menu_wrapper(brna, "UIPopupMenu", "uiPopupMenu", "rna_PopupMenu_layout_get");
+}
- RNA_define_verify_sdna(1); /* not in sdna */
+static void rna_def_piemenu(BlenderRNA *brna)
+{
+ rna_def_popup_menu_wrapper(brna, "UIPieMenu", "uiPieMenu", "rna_PieMenu_layout_get");
}
static void rna_def_window_stereo3d(BlenderRNA *brna)