UI: replace UI_ITEM_O_RETURN_PROPS /w return arg
authorCampbell Barton <ideasman42@gmail.com>
Tue, 31 Oct 2017 05:58:26 +0000 (16:58 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 31 Oct 2017 06:04:55 +0000 (17:04 +1100)
Means we can have a version of this function that returns the button
and avoids returning a struct that often isn't used.

16 files changed:
source/blender/editors/armature/pose_lib.c
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/object/object_relations.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_buttons.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/util/ed_util.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/windowmanager/intern/wm_operators.c

index 13feec2c5236ea2647466184ae4b37fe26b2e989..9cd5a0aed300f92ba7c8ab41b9312c0c8c0b0760 100644 (file)
@@ -410,11 +410,10 @@ static void poselib_add_menu_invoke__replacemenu(bContext *C, uiLayout *layout,
        /* add each marker to this menu */
        for (marker = act->markers.first; marker; marker = marker->next) {
                PointerRNA props_ptr;
-               
-               props_ptr = uiItemFullO_ptr(layout, ot,
-                                           marker->name, ICON_ARMATURE_DATA, NULL,
-                                           WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
-               
+               uiItemFullO_ptr(
+                       layout, ot,
+                       marker->name, ICON_ARMATURE_DATA, NULL,
+                       WM_OP_EXEC_DEFAULT, 0, &props_ptr);
                RNA_int_set(&props_ptr, "frame", marker->frame);
                RNA_string_set(&props_ptr, "name", marker->name);
        }
index 98e278e5570a754f4efdb36f8ff59dd30c10dec5..8b4f094cb8dde9684b1d8becfa6a3b933d4e2594 100644 (file)
@@ -819,7 +819,6 @@ void UI_exit(void);
 #define UI_LAYOUT_ALIGN_CENTER  2
 #define UI_LAYOUT_ALIGN_RIGHT   3
 
-#define UI_ITEM_O_RETURN_PROPS  (1 << 0)
 #define UI_ITEM_R_EXPAND        (1 << 1)
 #define UI_ITEM_R_SLIDER        (1 << 2)
 #define UI_ITEM_R_TOGGLE        (1 << 3)
@@ -981,8 +980,14 @@ void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname
 void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, float value);
 void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value);
 
-PointerRNA uiItemFullO_ptr(uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, struct IDProperty *properties, int context, int flag);
-PointerRNA uiItemFullO(uiLayout *layout, const char *idname, const char *name, int icon, struct IDProperty *properties, int context, int flag);
+void uiItemFullO_ptr(
+        uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon,
+        struct IDProperty *properties, int context, int flag,
+        PointerRNA *r_opptr);
+void uiItemFullO(
+        uiLayout *layout, const char *idname, const char *name, int icon,
+        struct IDProperty *properties, int context, int flag,
+        PointerRNA *r_opptr);
 
 void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon);
 void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon);
index 9e93b02a8cdba0a16d87e2d238aab581c01887b6..0dec751526aee265d206452fd6223b915685d269 100644 (file)
@@ -6738,16 +6738,15 @@ static void ui_but_menu_add_path_operators(uiLayout *layout, PointerRNA *ptr, Pr
 
        if (file[0]) {
                BLI_assert(subtype == PROP_FILEPATH);
-
-               props_ptr = uiItemFullO_ptr(
-                               layout, ot, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Open File Externally"),
-                               ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+               uiItemFullO_ptr(
+                       layout, ot, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Open File Externally"),
+                       ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &props_ptr);
                RNA_string_set(&props_ptr, "filepath", filepath);
        }
 
-       props_ptr = uiItemFullO_ptr(
-                       layout, ot, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Open Location Externally"),
-                       ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO_ptr(
+               layout, ot, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Open Location Externally"),
+               ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &props_ptr);
        RNA_string_set(&props_ptr, "filepath", dir);
 }
 
@@ -7028,21 +7027,23 @@ static bool ui_but_menu(bContext *C, uiBut *but)
 
        {   /* Docs */
                char buf[512];
-               PointerRNA ptr_props;
 
                if (UI_but_online_manual_id(but, buf, sizeof(buf))) {
+                       PointerRNA ptr_props;
                        uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Online Manual"),
                                ICON_URL, "WM_OT_doc_view_manual_ui_context");
 
-                       ptr_props = uiItemFullO(layout, "WM_OT_doc_view",
-                                                   CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Online Python Reference"),
-                                                   ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                       uiItemFullO(
+                               layout, "WM_OT_doc_view",
+                               CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Online Python Reference"),
+                               ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr_props);
                        RNA_string_set(&ptr_props, "doc_id", buf);
 
                        /* XXX inactive option, not for public! */
 #if 0
-                       ptr_props = uiItemFullO(layout, "WM_OT_doc_edit",
-                                                   "Submit Description", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                       uiItemFullO(
+                               layout, "WM_OT_doc_edit", "Submit Description", ICON_NONE,
+                               NULL, WM_OP_INVOKE_DEFAULT, 0, &ptr_props);
                        RNA_string_set(&ptr_props, "doc_id", buf);
                        RNA_string_set(&ptr_props, "doc_new", RNA_property_description(but->rnaprop));
 #endif
@@ -7056,9 +7057,9 @@ static bool ui_but_menu(bContext *C, uiBut *but)
 
        /* perhaps we should move this into (G.debug & G_DEBUG) - campbell */
        if (ui_block_is_menu(but->block) == false) {
-               uiItemFullO(layout, "UI_OT_editsource", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0);
+               uiItemFullO(layout, "UI_OT_editsource", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL);
        }
-       uiItemFullO(layout, "UI_OT_edittranslation_init", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0);
+       uiItemFullO(layout, "UI_OT_edittranslation_init", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL);
 
        mt = WM_menutype_find("WM_MT_button_context", true);
        if (mt) {
index b43892053ce42ff3b0aec568f6a673cb1fa4defe..a0840f7fb34953054ede751345d9f5618c5f0d4e 100644 (file)
@@ -790,9 +790,17 @@ static void ui_item_disabled(uiLayout *layout, const char *name)
        but->disabled_info = "";
 }
 
-/* operator items */
-PointerRNA uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *name, int icon, IDProperty *properties, int context, int flag)
+/**
+ * Operator Item
+ * \param r_opptr: Optional, initialize with operator properties when not NULL.
+ * Will always be written to even in the case of errors.
+ */
+void uiItemFullO_ptr(
+        uiLayout *layout, wmOperatorType *ot,
+        const char *name, int icon, IDProperty *properties, int context, int flag,
+        PointerRNA *r_opptr)
 {
+       /* Take care to fill 'r_opptr' whatever happens. */
        uiBlock *block = layout->root->block;
        uiBut *but;
        int w;
@@ -841,9 +849,8 @@ PointerRNA uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *nam
                UI_but_flag_enable(but, UI_BUT_REDALERT);
 
        /* assign properties */
-       if (properties || (flag & UI_ITEM_O_RETURN_PROPS)) {
+       if (properties || r_opptr) {
                PointerRNA *opptr = UI_but_operator_ptr_get(but);
-
                if (properties) {
                        opptr->data = properties;
                }
@@ -851,20 +858,28 @@ PointerRNA uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *nam
                        IDPropertyTemplate val = {0};
                        opptr->data = IDP_New(IDP_GROUP, &val, "wmOperatorProperties");
                }
-
-               return *opptr;
+               if (r_opptr) {
+                       *r_opptr = *opptr;
+               }
        }
-
-       return PointerRNA_NULL;
 }
 
-PointerRNA uiItemFullO(uiLayout *layout, const char *opname, const char *name, int icon, IDProperty *properties, int context, int flag)
+void uiItemFullO(
+        uiLayout *layout, const char *opname,
+        const char *name, int icon, IDProperty *properties, int context, int flag,
+        PointerRNA *r_opptr)
 {
        wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
 
-       UI_OPERATOR_ERROR_RET(ot, opname, return PointerRNA_NULL);
+       UI_OPERATOR_ERROR_RET(
+               ot, opname, {
+                   if (r_opptr) {
+                       *r_opptr = PointerRNA_NULL;
+                   };
+                   return;
+               });
 
-       return uiItemFullO_ptr(layout, ot, name, icon, properties, context, flag);
+       uiItemFullO_ptr(layout, ot, name, icon, properties, context, flag, r_opptr);
 }
 
 static const char *ui_menu_enumpropname(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int retval)
@@ -908,7 +923,7 @@ void uiItemEnumO_ptr(uiLayout *layout, wmOperatorType *ot, const char *name, int
        if (!name)
                name = ui_menu_enumpropname(layout, &ptr, prop, value);
 
-       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
+       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0, NULL);
 }
 void uiItemEnumO(uiLayout *layout, const char *opname, const char *name, int icon, const char *propname, int value)
 {
@@ -1002,7 +1017,7 @@ void uiItemsFullEnumO_items(
                        }
                        RNA_property_enum_set(&tptr, prop, item->value);
 
-                       uiItemFullO_ptr(target, ot, item->name, item->icon, tptr.data, context, flag);
+                       uiItemFullO_ptr(target, ot, item->name, item->icon, tptr.data, context, flag, NULL);
 
                        ui_but_tip_from_enum_item(block->buttons.last, item);
                }
@@ -1132,7 +1147,7 @@ void uiItemEnumO_value(uiLayout *layout, const char *name, int icon, const char
        if (!name)
                name = ui_menu_enumpropname(layout, &ptr, prop, value);
 
-       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
+       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0, NULL);
 }
 
 void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value_str)
@@ -1176,7 +1191,7 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char
        if (!name)
                name = ui_menu_enumpropname(layout, &ptr, prop, value);
 
-       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
+       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0, NULL);
 }
 
 void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value)
@@ -1189,7 +1204,7 @@ void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *op
        WM_operator_properties_create_ptr(&ptr, ot);
        RNA_boolean_set(&ptr, propname, value);
 
-       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
+       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0, NULL);
 }
 
 void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value)
@@ -1202,7 +1217,7 @@ void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname
        WM_operator_properties_create_ptr(&ptr, ot);
        RNA_int_set(&ptr, propname, value);
 
-       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
+       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0, NULL);
 }
 
 void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, float value)
@@ -1215,7 +1230,7 @@ void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opna
        WM_operator_properties_create_ptr(&ptr, ot);
        RNA_float_set(&ptr, propname, value);
 
-       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
+       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0, NULL);
 }
 
 void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value)
@@ -1228,12 +1243,12 @@ void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opn
        WM_operator_properties_create_ptr(&ptr, ot);
        RNA_string_set(&ptr, propname, value);
 
-       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
+       uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0, NULL);
 }
 
 void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
 {
-       uiItemFullO(layout, opname, name, icon, NULL, layout->root->opcontext, 0);
+       uiItemFullO(layout, opname, name, icon, NULL, layout->root->opcontext, 0, NULL);
 }
 
 /* RNA property items */
index 7f23f26491184bc8aeb92b91e834063f28287749..7747c1201bcbc1c551e7939e3dac208ddb8135d4 100644 (file)
@@ -3442,10 +3442,10 @@ void uiTemplateOperatorPropertyButs(
                uiItemM(row, (bContext *)C, "WM_MT_operator_presets", NULL, ICON_NONE);
 
                wmOperatorType *ot = WM_operatortype_find("WM_OT_operator_preset_add", false);
-               op_ptr = uiItemFullO_ptr(row, ot, "", ICON_ZOOMIN, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+               uiItemFullO_ptr(row, ot, "", ICON_ZOOMIN, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
                RNA_string_set(&op_ptr, "operator", op->type->idname);
 
-               op_ptr = uiItemFullO_ptr(row, ot, "", ICON_ZOOMOUT, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+               uiItemFullO_ptr(row, ot, "", ICON_ZOOMOUT, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
                RNA_string_set(&op_ptr, "operator", op->type->idname);
                RNA_boolean_set(&op_ptr, "remove_active", true);
        }
index eba01b7ec8a3a2f405926aee402c1be8250cf169..f191875dab2bdd5ca43e35afc1b5c6484ed7e078 100644 (file)
@@ -310,8 +310,9 @@ static int make_proxy_invoke(bContext *C, wmOperator *op, const wmEvent *event)
                uiLayout *layout = UI_popup_menu_layout(pup);
 
                /* create operator menu item with relevant properties filled in */
+               PointerRNA opptr_dummy;
                uiItemFullO_ptr(layout, op->type, op->type->name, ICON_NONE, NULL,
-                               WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
+                               WM_OP_EXEC_REGION_WIN, 0, &opptr_dummy);
 
                /* present the menu and be done... */
                UI_popup_menu_end(C, pup);
@@ -898,12 +899,13 @@ static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent
 #if 0
        uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_OBJECT);
 #else
-       opptr = uiItemFullO_ptr(layout, ot, IFACE_("Object"), ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO_ptr(layout, ot, IFACE_("Object"), ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &opptr);
        RNA_enum_set(&opptr, "type", PAR_OBJECT);
        RNA_boolean_set(&opptr, "keep_transform", false);
 
-       opptr = uiItemFullO_ptr(layout, ot, IFACE_("Object (Keep Transform)"), ICON_NONE, NULL, WM_OP_EXEC_DEFAULT,
-                               UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO_ptr(
+               layout, ot, IFACE_("Object (Keep Transform)"), ICON_NONE,
+               NULL, WM_OP_EXEC_DEFAULT, 0, &opptr);
        RNA_enum_set(&opptr, "type", PAR_OBJECT);
        RNA_boolean_set(&opptr, "keep_transform", true);
 #endif
index b48f5dc143233bffea74f4906a98f87a8e9347dd..2e7e1d1eebf4efcafc716e93eda9008c502b31f9 100644 (file)
@@ -2823,12 +2823,12 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, const wmEvent
        pup = UI_popup_menu_begin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE);
        layout = UI_popup_menu_layout(pup);
        
-       ptr = uiItemFullO(layout, "SCREEN_OT_area_split", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO(layout, "SCREEN_OT_area_split", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &ptr);
        /* store initial mouse cursor position */
        RNA_int_set(&ptr, "mouse_x", event->x);
        RNA_int_set(&ptr, "mouse_y", event->y);
 
-       ptr = uiItemFullO(layout, "SCREEN_OT_area_join", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO(layout, "SCREEN_OT_area_join", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &ptr);
        /* mouse cursor on edge, '4' can fail on wide edges... */
        RNA_int_set(&ptr, "min_x", event->x + 4);
        RNA_int_set(&ptr, "min_y", event->y + 4);
index 64404b38da315d7c5eba672f63650179a7d3ea3b..53d7684e331feb746a02cf1aa913295125cf5293 100644 (file)
@@ -5221,7 +5221,7 @@ static int dyntopo_warning_popup(bContext *C, wmOperatorType *ot, enum eDynTopoW
                uiItemS(layout);
        }
 
-       uiItemFullO_ptr(layout, ot, IFACE_("OK"), ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0);
+       uiItemFullO_ptr(layout, ot, IFACE_("OK"), ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, NULL);
 
        UI_popup_menu_end(C, pup);
 
index 7ef34669ee2a9790e837ac1d5b227c7ac86a68f9..944c691ee640d090f8fbc19d3db1930bc5600337 100644 (file)
@@ -1337,7 +1337,7 @@ static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, Point
        scn_ptr = RNA_pointer_get(ptr, "scene");
        RNA_string_get(&scn_ptr, "name", scene_name);
 
-       op_ptr = uiItemFullO(row, "RENDER_OT_render", "", ICON_RENDER_STILL, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO(row, "RENDER_OT_render", "", ICON_RENDER_STILL, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
        RNA_string_set(&op_ptr, "layer", layer_name);
        RNA_string_set(&op_ptr, "scene", scene_name);
 }
@@ -1828,9 +1828,9 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi
        
        col = uiLayoutColumn(row, true);
        ot = WM_operatortype_find("NODE_OT_output_file_move_active_socket", false);
-       op_ptr = uiItemFullO_ptr(col, ot, "", ICON_TRIA_UP, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO_ptr(col, ot, "", ICON_TRIA_UP, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
        RNA_enum_set(&op_ptr, "direction", 1);
-       op_ptr = uiItemFullO_ptr(col, ot, "", ICON_TRIA_DOWN, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO_ptr(col, ot, "", ICON_TRIA_DOWN, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
        RNA_enum_set(&op_ptr, "direction", 2);
        
        if (active_input_ptr.data) {
@@ -1841,7 +1841,7 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi
                        row = uiLayoutRow(col, false);
                        uiItemR(row, &active_input_ptr, "name", 0, "", ICON_NONE);
                        uiItemFullO(row, "NODE_OT_output_file_remove_active_socket", "",
-                                   ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY);
+                                   ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY, NULL);
                }
                else {
                        col = uiLayoutColumn(layout, true);
@@ -1850,7 +1850,7 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi
                        row = uiLayoutRow(col, false);
                        uiItemR(row, &active_input_ptr, "path", 0, "", ICON_NONE);
                        uiItemFullO(row, "NODE_OT_output_file_remove_active_socket", "",
-                                   ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY);
+                                   ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY, NULL);
                        
                        /* format details for individual files */
                        imfptr = RNA_pointer_get(&active_input_ptr, "format");
@@ -2162,7 +2162,9 @@ static void node_composit_buts_switch(uiLayout *layout, bContext *UNUSED(C), Poi
 
 static void node_composit_buts_switch_view_ex(uiLayout *layout, bContext *UNUSED(C), PointerRNA *UNUSED(ptr))
 {
-       uiItemFullO(layout, "NODE_OT_switch_view_update", "Update Views", ICON_FILE_REFRESH, NULL, WM_OP_INVOKE_DEFAULT, 0);
+       uiItemFullO(
+               layout, "NODE_OT_switch_view_update",
+               "Update Views", ICON_FILE_REFRESH, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL);
 }
 
 static void node_composit_buts_boxmask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
index 925298451ce9a2c49b857b18fa60b1a1f2cd2b3e..e8b4e6ec9903411692fb3dff666b8d6a70723edb 100644 (file)
@@ -151,21 +151,21 @@ static void node_tree_interface_panel(const bContext *C, Panel *pa)
        uiItemL(col, IFACE_("Inputs:"), ICON_NONE);
        uiTemplateList(col, (bContext *)C, "NODE_UL_interface_sockets", "inputs", &ptr, "inputs", &ptr, "active_input",
                       NULL, 0, 0, 0, 0);
-       opptr = uiItemFullO_ptr(col, ot, "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO_ptr(col, ot, "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, 0, &opptr);
        RNA_enum_set(&opptr, "in_out", SOCK_IN);
        
        col = uiLayoutColumn(split, true);
        uiItemL(col, IFACE_("Outputs:"), ICON_NONE);
        uiTemplateList(col, (bContext *)C, "NODE_UL_interface_sockets", "outputs", &ptr, "outputs", &ptr, "active_output",
                       NULL, 0, 0, 0, 0);
-       opptr = uiItemFullO_ptr(col, ot, "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO_ptr(col, ot, "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, 0, &opptr);
        RNA_enum_set(&opptr, "in_out", SOCK_OUT);
        
        ot = WM_operatortype_find("NODE_OT_tree_socket_move", false);
        col = uiLayoutColumn(row, true);
-       opptr = uiItemFullO_ptr(col, ot, "", ICON_TRIA_UP, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO_ptr(col, ot, "", ICON_TRIA_UP, NULL, WM_OP_EXEC_DEFAULT, 0, &opptr);
        RNA_enum_set(&opptr, "direction", 1);
-       opptr = uiItemFullO_ptr(col, ot, "", ICON_TRIA_DOWN, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO_ptr(col, ot, "", ICON_TRIA_DOWN, NULL, WM_OP_EXEC_DEFAULT, 0, &opptr);
        RNA_enum_set(&opptr, "direction", 2);
        
        if (sock) {
index fc7c70ba89e2c92e3497ae3cab8e5f40928048c6..c45d9c021404327bb2a2e2a53a4862d897c795ef 100644 (file)
@@ -2076,56 +2076,56 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
                        PointerRNA ptr;
                        
                        /* Cannot use uiItemEnumO()... have multiple properties to set. */
-                       ptr = uiItemFullO_ptr(layout, ot, IFACE_("Object"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                       uiItemFullO_ptr(layout, ot, IFACE_("Object"), 0, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr);
                        RNA_string_set(&ptr, "parent", parname);
                        RNA_string_set(&ptr, "child", childname);
                        RNA_enum_set(&ptr, "type", PAR_OBJECT);
 
                        /* par becomes parent, make the associated menus */
                        if (par->type == OB_ARMATURE) {
-                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Armature Deform"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                               uiItemFullO_ptr(layout, ot, IFACE_("Armature Deform"), 0, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_ARMATURE);
 
-                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("   With Empty Groups"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                               uiItemFullO_ptr(layout, ot, IFACE_("   With Empty Groups"), 0, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_ARMATURE_NAME);
 
-                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("   With Envelope Weights"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                               uiItemFullO_ptr(layout, ot, IFACE_("   With Envelope Weights"), 0, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_ARMATURE_ENVELOPE);
 
-                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("   With Automatic Weights"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                               uiItemFullO_ptr(layout, ot, IFACE_("   With Automatic Weights"), 0, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_ARMATURE_AUTO);
 
-                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Bone"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                               uiItemFullO_ptr(layout, ot, IFACE_("Bone"), 0, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_BONE);
                        }
                        else if (par->type == OB_CURVE) {
-                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Curve Deform"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                               uiItemFullO_ptr(layout, ot, IFACE_("Curve Deform"), 0, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_CURVE);
 
-                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Follow Path"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                               uiItemFullO_ptr(layout, ot, IFACE_("Follow Path"), 0, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_FOLLOW);
 
-                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Path Constraint"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                               uiItemFullO_ptr(layout, ot, IFACE_("Path Constraint"), 0, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_PATH_CONST);
                        }
                        else if (par->type == OB_LATTICE) {
-                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Lattice Deform"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                               uiItemFullO_ptr(layout, ot, IFACE_("Lattice Deform"), 0, NULL, WM_OP_EXEC_DEFAULT, 0, &ptr);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_LATTICE);
index 34e01405e7e9a4df94dd2a98c0241ee0550e7d30..0c67776693d894f2fd74b2ed7f21401686ea7cf2 100644 (file)
@@ -879,12 +879,12 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
 
                                        /* The weight group paste function */
                                        icon = (locked) ? ICON_BLANK1 : ICON_PASTEDOWN;
-                                       op_ptr = uiItemFullO(row, "OBJECT_OT_vertex_weight_paste", "", icon, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                                       uiItemFullO(row, "OBJECT_OT_vertex_weight_paste", "", icon, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
                                        RNA_int_set(&op_ptr, "weight_group", i);
 
                                        /* The weight entry delete function */
                                        icon = (locked) ? ICON_LOCKED : ICON_X;
-                                       op_ptr = uiItemFullO(row, "OBJECT_OT_vertex_weight_delete", "", icon, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                                       uiItemFullO(row, "OBJECT_OT_vertex_weight_delete", "", icon, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
                                        RNA_int_set(&op_ptr, "weight_group", i);
 
                                        yco -= UI_UNIT_Y;
index 1d99fcfdd3a12fd71e935602f2ce54cca726abf6..5e3c783c1b6c286af00da12aafb303dd297afa81 100644 (file)
@@ -218,7 +218,7 @@ static void view3d_panel_tool_shelf(const bContext *C, Panel *pa)
                for (ct = st->toolshelf.first; ct; ct = ct->next) {
                        if (STREQLEN(context, ct->context, OP_MAX_TYPENAME)) {
                                col = uiLayoutColumn(pa->layout, true);
-                               uiItemFullO(col, ct->opname, NULL, ICON_NONE, NULL, WM_OP_INVOKE_REGION_WIN, 0);
+                               uiItemFullO(col, ct->opname, NULL, ICON_NONE, NULL, WM_OP_INVOKE_REGION_WIN, 0, NULL);
                        }
                }
        }
index 1f1a778cac7257d2031d67dc68eb3e76ed12d518..063ceac6761590e9efb83bb0fb9f52f7af6cfed1 100644 (file)
@@ -226,8 +226,9 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
        pup = UI_popup_menu_begin(C, IFACE_("Unpack File"), ICON_NONE);
        layout = UI_popup_menu_layout(pup);
 
-       props_ptr = uiItemFullO_ptr(layout, ot, IFACE_("Remove Pack"), ICON_NONE,
-                                   NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       uiItemFullO_ptr(
+               layout, ot, IFACE_("Remove Pack"), ICON_NONE,
+               NULL, WM_OP_EXEC_DEFAULT, 0, &props_ptr);
        RNA_enum_set(&props_ptr, "method", PF_REMOVE);
        RNA_string_set(&props_ptr, "id", id_name);
 
@@ -240,7 +241,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
                        switch (checkPackedFile(local_name, pf)) {
                                case PF_NOFILE:
                                        BLI_snprintf(line, sizeof(line), IFACE_("Create %s"), local_name);
-                                       props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                                       uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &props_ptr);
                                        RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL);
                                        RNA_string_set(&props_ptr, "id", id_name);
 
@@ -248,7 +249,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
                                case PF_EQUAL:
                                        BLI_snprintf(line, sizeof(line), IFACE_("Use %s (identical)"), local_name);
                                        //uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_LOCAL);
-                                       props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                                       uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &props_ptr);
                                        RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL);
                                        RNA_string_set(&props_ptr, "id", id_name);
 
@@ -256,13 +257,13 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
                                case PF_DIFFERS:
                                        BLI_snprintf(line, sizeof(line), IFACE_("Use %s (differs)"), local_name);
                                        //uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_LOCAL);
-                                       props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                                       uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &props_ptr);
                                        RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL);
                                        RNA_string_set(&props_ptr, "id", id_name);
 
                                        BLI_snprintf(line, sizeof(line), IFACE_("Overwrite %s"), local_name);
                                        //uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_LOCAL);
-                                       props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                                       uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &props_ptr);
                                        RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL);
                                        RNA_string_set(&props_ptr, "id", id_name);
                                        break;
@@ -274,27 +275,27 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
                case PF_NOFILE:
                        BLI_snprintf(line, sizeof(line), IFACE_("Create %s"), abs_name);
                        //uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_ORIGINAL);
-                       props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                       uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &props_ptr);
                        RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL);
                        RNA_string_set(&props_ptr, "id", id_name);
                        break;
                case PF_EQUAL:
                        BLI_snprintf(line, sizeof(line), IFACE_("Use %s (identical)"), abs_name);
                        //uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_ORIGINAL);
-                       props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                       uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &props_ptr);
                        RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL);
                        RNA_string_set(&props_ptr, "id", id_name);
                        break;
                case PF_DIFFERS:
                        BLI_snprintf(line, sizeof(line), IFACE_("Use %s (differs)"), abs_name);
                        //uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_ORIGINAL);
-                       props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                       uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &props_ptr);
                        RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL);
                        RNA_string_set(&props_ptr, "id", id_name);
 
                        BLI_snprintf(line, sizeof(line), IFACE_("Overwrite %s"), abs_name);
                        //uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_ORIGINAL);
-                       props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                       uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &props_ptr);
                        RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL);
                        RNA_string_set(&props_ptr, "id", id_name);
                        break;
index be5a823034e063794f91cfbe4bf6c3a55e0514a4..c3a16c476bc48ae34b4175d746accc7e44c528f4 100644 (file)
@@ -194,10 +194,12 @@ static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *
                icon = icon_value;
        }
 
-       flag = UI_ITEM_O_RETURN_PROPS;
+       flag = 0;
        flag |= (emboss) ? 0 : UI_ITEM_R_NO_BG;
 
-       return uiItemFullO_ptr(layout, ot, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag);
+       PointerRNA opptr;
+       uiItemFullO_ptr(layout, ot, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag, &opptr);
+       return opptr;
 }
 
 static void rna_uiItemMenuEnumO(uiLayout *layout, bContext *C, const char *opname, const char *propname, const char *name,
index fbc96204a2c7b54918299d7c91b4372df57a9e0c..747ed48d3835a905a3bfa1ad8a05dc775be5551e 100644 (file)
@@ -1223,7 +1223,7 @@ int WM_operator_confirm_message_ex(bContext *C, wmOperator *op,
 
        pup = UI_popup_menu_begin(C, title, icon);
        layout = UI_popup_menu_layout(pup);
-       uiItemFullO_ptr(layout, op->type, message, ICON_NONE, properties, WM_OP_EXEC_REGION_WIN, 0);
+       uiItemFullO_ptr(layout, op->type, message, ICON_NONE, properties, WM_OP_EXEC_REGION_WIN, 0, NULL);
        UI_popup_menu_end(C, pup);
        
        return OPERATOR_INTERFACE;