Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_wm_api.c
| Show First 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* popup menu wrapper */ | /* popup menu wrapper */ | ||||
| static PointerRNA rna_PupMenuBegin(bContext *C, const char *title, int icon) | static PointerRNA rna_PupMenuBegin(bContext *C, const char *title, int icon) | ||||
| { | { | ||||
| PointerRNA r_ptr; | PointerRNA r_ptr; | ||||
| void *data; | void *data; | ||||
| data = (void *)uiPupMenuBegin(C, title, icon); | data = (void *)UI_popup_menu_begin(C, title, icon); | ||||
| RNA_pointer_create(NULL, &RNA_UIPopupMenu, data, &r_ptr); | RNA_pointer_create(NULL, &RNA_UIPopupMenu, data, &r_ptr); | ||||
| return r_ptr; | return r_ptr; | ||||
| } | } | ||||
| static void rna_PupMenuEnd(bContext *C, PointerRNA *handle) | static void rna_PupMenuEnd(bContext *C, PointerRNA *handle) | ||||
| { | { | ||||
| uiPupMenuEnd(C, handle->data); | UI_popup_menu_end(C, handle->data); | ||||
| } | } | ||||
| /* pie menu wrapper */ | /* pie menu wrapper */ | ||||
| static PointerRNA rna_PieMenuBegin(bContext *C, const char *title, int icon, PointerRNA *event) | static PointerRNA rna_PieMenuBegin(bContext *C, const char *title, int icon, PointerRNA *event) | ||||
| { | { | ||||
| PointerRNA r_ptr; | PointerRNA r_ptr; | ||||
| void *data; | void *data; | ||||
| data = (void *)uiPieMenuBegin(C, title, icon, event->data); | data = (void *)UI_pie_menu_begin(C, title, icon, event->data); | ||||
| RNA_pointer_create(NULL, &RNA_UIPieMenu, data, &r_ptr); | RNA_pointer_create(NULL, &RNA_UIPieMenu, data, &r_ptr); | ||||
| return r_ptr; | return r_ptr; | ||||
| } | } | ||||
| static void rna_PieMenuEnd(bContext *C, PointerRNA *handle) | static void rna_PieMenuEnd(bContext *C, PointerRNA *handle) | ||||
| { | { | ||||
| uiPieMenuEnd(C, handle->data); | UI_pie_menu_end(C, handle->data); | ||||
| } | } | ||||
| #else | #else | ||||
| #define WM_GEN_INVOKE_EVENT (1 << 0) | #define WM_GEN_INVOKE_EVENT (1 << 0) | ||||
| #define WM_GEN_INVOKE_SIZE (1 << 1) | #define WM_GEN_INVOKE_SIZE (1 << 1) | ||||
| #define WM_GEN_INVOKE_RETURN (1 << 2) | #define WM_GEN_INVOKE_RETURN (1 << 2) | ||||
| ▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | void RNA_api_wm(StructRNA *srna) | ||||
| RNA_def_function_ui_description(func, "Operator popup invoke"); | RNA_def_function_ui_description(func, "Operator popup invoke"); | ||||
| rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE | WM_GEN_INVOKE_RETURN); | rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE | WM_GEN_INVOKE_RETURN); | ||||
| func = RNA_def_function(srna, "invoke_confirm", "rna_Operator_confirm"); | func = RNA_def_function(srna, "invoke_confirm", "rna_Operator_confirm"); | ||||
| RNA_def_function_ui_description(func, "Operator confirmation"); | RNA_def_function_ui_description(func, "Operator confirmation"); | ||||
| rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT | WM_GEN_INVOKE_RETURN); | rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT | WM_GEN_INVOKE_RETURN); | ||||
| /* wrap uiPupMenuBegin */ | /* wrap UI_popup_menu_begin */ | ||||
| func = RNA_def_function(srna, "pupmenu_begin__internal", "rna_PupMenuBegin"); | func = RNA_def_function(srna, "pupmenu_begin__internal", "rna_PupMenuBegin"); | ||||
| RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT); | ||||
| parm = RNA_def_string(func, "title", NULL, 0, "", ""); | parm = RNA_def_string(func, "title", NULL, 0, "", ""); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_property_flag(parm, PROP_REQUIRED); | ||||
| parm = RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE); | parm = RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(parm, icon_items); | RNA_def_property_enum_items(parm, icon_items); | ||||
| /* return */ | /* return */ | ||||
| parm = RNA_def_pointer(func, "menu", "UIPopupMenu", "", ""); | parm = RNA_def_pointer(func, "menu", "UIPopupMenu", "", ""); | ||||
| RNA_def_property_flag(parm, PROP_RNAPTR | PROP_NEVER_NULL); | RNA_def_property_flag(parm, PROP_RNAPTR | PROP_NEVER_NULL); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| /* wrap uiPupMenuEnd */ | /* wrap UI_popup_menu_end */ | ||||
| func = RNA_def_function(srna, "pupmenu_end__internal", "rna_PupMenuEnd"); | func = RNA_def_function(srna, "pupmenu_end__internal", "rna_PupMenuEnd"); | ||||
| RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT); | ||||
| parm = RNA_def_pointer(func, "menu", "UIPopupMenu", "", ""); | parm = RNA_def_pointer(func, "menu", "UIPopupMenu", "", ""); | ||||
| RNA_def_property_flag(parm, PROP_RNAPTR | PROP_NEVER_NULL); | RNA_def_property_flag(parm, PROP_RNAPTR | PROP_NEVER_NULL); | ||||
| /* wrap uiPieMenuBegin */ | /* wrap uiPieMenuBegin */ | ||||
| func = RNA_def_function(srna, "piemenu_begin__internal", "rna_PieMenuBegin"); | func = RNA_def_function(srna, "piemenu_begin__internal", "rna_PieMenuBegin"); | ||||
| RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT); | ||||
| ▲ Show 20 Lines • Show All 280 Lines • Show Last 20 Lines | |||||