Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_layout.c
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
| #include "ED_armature.h" | #include "ED_armature.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "interface_intern.h" | #include "interface_intern.h" | ||||
Severin: Merge issue, please ignore. | |||||
| #define USE_OP_BASIC_PROP_BUTS_TEST | |||||
| /************************ Structs and Defines *************************/ | /************************ Structs and Defines *************************/ | ||||
| // #define USE_OP_RESET_BUT // we may want to make this optional, disable for now. | // #define USE_OP_RESET_BUT // we may want to make this optional, disable for now. | ||||
| #define UI_OPERATOR_ERROR_RET(_ot, _opname, return_statement) \ | #define UI_OPERATOR_ERROR_RET(_ot, _opname, return_statement) \ | ||||
| if (ot == NULL) { \ | if (ot == NULL) { \ | ||||
| ui_item_disabled(layout, _opname); \ | ui_item_disabled(layout, _opname); \ | ||||
| RNA_warning("'%s' unknown operator", _opname); \ | RNA_warning("'%s' unknown operator", _opname); \ | ||||
| ▲ Show 20 Lines • Show All 3,469 Lines • ▼ Show 20 Lines | if (op->type->ui) { | ||||
| op->layout = layout; | op->layout = layout; | ||||
| op->type->ui((bContext *)C, op); | op->type->ui((bContext *)C, op); | ||||
| op->layout = NULL; | op->layout = NULL; | ||||
| /* UI_LAYOUT_OP_SHOW_EMPTY ignored */ | /* UI_LAYOUT_OP_SHOW_EMPTY ignored */ | ||||
| } | } | ||||
| else { | else { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| const char *name; | |||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| int empty; | int empty = false; | ||||
| RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); | RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); | ||||
| /* main draw call */ | /* main draw call */ | ||||
| #ifdef USE_OP_BASIC_PROP_BUTS_TEST | |||||
| RNA_STRUCT_BEGIN(&ptr, prop) | |||||
| { | |||||
| int prop_flag = RNA_property_flag(prop); | |||||
| if (!RNA_property_has_tags(&ptr, prop, OP_PROP_TAG_BASIC)) { | |||||
| continue; | |||||
| } | |||||
| if (prop_flag & PROP_HIDDEN || (check_prop && check_prop(&ptr, prop) == 0)) { | |||||
| continue; | |||||
| } | |||||
| name = RNA_property_ui_name(prop); | |||||
| uiItemFullR(layout, &ptr, prop, -1, 0, 0, name, ICON_NONE); | |||||
| empty = false; | |||||
| } | |||||
| RNA_STRUCT_END; | |||||
| UNUSED_VARS(label_align); /* Ignore for testing */ | |||||
| #else | |||||
| empty = uiDefAutoButsRNA(layout, &ptr, check_prop, label_align) == 0; | empty = uiDefAutoButsRNA(layout, &ptr, check_prop, label_align) == 0; | ||||
| #endif | |||||
| if (empty && (flag & UI_LAYOUT_OP_SHOW_EMPTY)) { | if (empty && (flag & UI_LAYOUT_OP_SHOW_EMPTY)) { | ||||
| uiItemL(layout, IFACE_("No Properties"), ICON_NONE); | uiItemL(layout, IFACE_("No Properties"), ICON_NONE); | ||||
| } | } | ||||
| } | } | ||||
| #ifdef USE_OP_RESET_BUT | #ifdef USE_OP_RESET_BUT | ||||
| /* its possible that reset can do nothing if all have PROP_SKIP_SAVE enabled | /* its possible that reset can do nothing if all have PROP_SKIP_SAVE enabled | ||||
| ▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines | |||||
Merge issue, please ignore.