Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_ui_api.c
| Show First 20 Lines • Show All 429 Lines • ▼ Show 20 Lines | static void rna_uiItemPopoverPanelFromGroup(uiLayout *layout, | ||||
| int space_id, | int space_id, | ||||
| int region_id, | int region_id, | ||||
| const char *context, | const char *context, | ||||
| const char *category) | const char *category) | ||||
| { | { | ||||
| uiItemPopoverPanelFromGroup(layout, C, space_id, region_id, context, category); | uiItemPopoverPanelFromGroup(layout, C, space_id, region_id, context, category); | ||||
| } | } | ||||
| static void rna_uiTemplateID(uiLayout *layout, | |||||
| bContext *C, | |||||
| PointerRNA *ptr, | |||||
| const char *propname, | |||||
| const char *newop, | |||||
| const char *openop, | |||||
| const char *unlinkop, | |||||
| int filter, | |||||
| const bool live_icon, | |||||
| const char *name, | |||||
| const char *text_ctxt, | |||||
| bool translate) | |||||
| { | |||||
| PropertyRNA *prop = RNA_struct_find_property(ptr, propname); | |||||
| if (!prop) { | |||||
| RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname); | |||||
| return; | |||||
| } | |||||
| /* Get translated name (label). */ | |||||
| name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate); | |||||
| uiTemplateID(layout, C, ptr, propname, newop, openop, unlinkop, filter, live_icon, name); | |||||
| } | |||||
| static void rna_uiTemplateAnyID(uiLayout *layout, | static void rna_uiTemplateAnyID(uiLayout *layout, | ||||
| PointerRNA *ptr, | PointerRNA *ptr, | ||||
| const char *propname, | const char *propname, | ||||
| const char *proptypename, | const char *proptypename, | ||||
| const char *name, | const char *name, | ||||
| const char *text_ctxt, | const char *text_ctxt, | ||||
| bool translate) | bool translate) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 563 Lines • ▼ Show 20 Lines | # endif | ||||
| parm = RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context"); | parm = RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR); | ||||
| /* templates */ | /* templates */ | ||||
| func = RNA_def_function(srna, "template_header", "uiTemplateHeader"); | func = RNA_def_function(srna, "template_header", "uiTemplateHeader"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_CONTEXT); | ||||
| RNA_def_function_ui_description(func, "Inserts common Space header UI (editor type selector)"); | RNA_def_function_ui_description(func, "Inserts common Space header UI (editor type selector)"); | ||||
| func = RNA_def_function(srna, "template_ID", "uiTemplateID"); | func = RNA_def_function(srna, "template_ID", "rna_uiTemplateID"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_CONTEXT); | ||||
| api_ui_item_rna_common(func); | api_ui_item_rna_common(func); | ||||
| RNA_def_string(func, "new", NULL, 0, "", "Operator identifier to create a new ID block"); | RNA_def_string(func, "new", NULL, 0, "", "Operator identifier to create a new ID block"); | ||||
| RNA_def_string( | RNA_def_string( | ||||
| func, "open", NULL, 0, "", "Operator identifier to open a file for creating a new ID block"); | func, "open", NULL, 0, "", "Operator identifier to open a file for creating a new ID block"); | ||||
| RNA_def_string(func, "unlink", NULL, 0, "", "Operator identifier to unlink the ID block"); | RNA_def_string(func, "unlink", NULL, 0, "", "Operator identifier to unlink the ID block"); | ||||
| RNA_def_enum(func, | RNA_def_enum(func, | ||||
| "filter", | "filter", | ||||
| id_template_filter_items, | id_template_filter_items, | ||||
| UI_TEMPLATE_ID_FILTER_ALL, | UI_TEMPLATE_ID_FILTER_ALL, | ||||
| "", | "", | ||||
| "Optionally limit the items which can be selected"); | "Optionally limit the items which can be selected"); | ||||
| RNA_def_boolean(func, "live_icon", false, "", "Show preview instead of fixed icon"); | RNA_def_boolean(func, "live_icon", false, "", "Show preview instead of fixed icon"); | ||||
| api_ui_item_common_text(func); | |||||
| func = RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview"); | func = RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_CONTEXT); | ||||
| api_ui_item_rna_common(func); | api_ui_item_rna_common(func); | ||||
| RNA_def_string(func, "new", NULL, 0, "", "Operator identifier to create a new ID block"); | RNA_def_string(func, "new", NULL, 0, "", "Operator identifier to create a new ID block"); | ||||
| RNA_def_string( | RNA_def_string( | ||||
| func, "open", NULL, 0, "", "Operator identifier to open a file for creating a new ID block"); | func, "open", NULL, 0, "", "Operator identifier to open a file for creating a new ID block"); | ||||
| RNA_def_string(func, "unlink", NULL, 0, "", "Operator identifier to unlink the ID block"); | RNA_def_string(func, "unlink", NULL, 0, "", "Operator identifier to unlink the ID block"); | ||||
| ▲ Show 20 Lines • Show All 514 Lines • Show Last 20 Lines | |||||