Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface.c
| Show First 20 Lines • Show All 3,971 Lines • ▼ Show 20 Lines | switch (type) { | ||||
| case UI_BTYPE_CURVE: | case UI_BTYPE_CURVE: | ||||
| alloc_size = sizeof(uiButCurveMapping); | alloc_size = sizeof(uiButCurveMapping); | ||||
| alloc_str = "uiButCurveMapping"; | alloc_str = "uiButCurveMapping"; | ||||
| break; | break; | ||||
| case UI_BTYPE_CURVEPROFILE: | case UI_BTYPE_CURVEPROFILE: | ||||
| alloc_size = sizeof(uiButCurveProfile); | alloc_size = sizeof(uiButCurveProfile); | ||||
| alloc_str = "uiButCurveProfile"; | alloc_str = "uiButCurveProfile"; | ||||
| break; | break; | ||||
| case UI_BTYPE_DATASETROW: | |||||
| alloc_size = sizeof(uiButDatasetRow); | |||||
| alloc_str = "uiButDatasetRow"; | |||||
| break; | |||||
| case UI_BTYPE_TREEROW: | case UI_BTYPE_TREEROW: | ||||
| alloc_size = sizeof(uiButTreeRow); | alloc_size = sizeof(uiButTreeRow); | ||||
| alloc_str = "uiButTreeRow"; | alloc_str = "uiButTreeRow"; | ||||
| break; | break; | ||||
| default: | default: | ||||
| alloc_size = sizeof(uiBut); | alloc_size = sizeof(uiBut); | ||||
| alloc_str = "uiBut"; | alloc_str = "uiBut"; | ||||
| has_custom_type = false; | has_custom_type = false; | ||||
| ▲ Show 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | else if (((block->flag & UI_BLOCK_LOOP) && !ui_block_is_popover(block) && | ||||
| !(block->flag & UI_BLOCK_QUICK_SETUP)) || | !(block->flag & UI_BLOCK_QUICK_SETUP)) || | ||||
| ELEM(but->type, | ELEM(but->type, | ||||
| UI_BTYPE_MENU, | UI_BTYPE_MENU, | ||||
| UI_BTYPE_TEXT, | UI_BTYPE_TEXT, | ||||
| UI_BTYPE_LABEL, | UI_BTYPE_LABEL, | ||||
| UI_BTYPE_BLOCK, | UI_BTYPE_BLOCK, | ||||
| UI_BTYPE_BUT_MENU, | UI_BTYPE_BUT_MENU, | ||||
| UI_BTYPE_SEARCH_MENU, | UI_BTYPE_SEARCH_MENU, | ||||
| UI_BTYPE_DATASETROW, | |||||
| UI_BTYPE_TREEROW, | UI_BTYPE_TREEROW, | ||||
| UI_BTYPE_POPOVER)) { | UI_BTYPE_POPOVER)) { | ||||
| but->drawflag |= (UI_BUT_TEXT_LEFT | UI_BUT_ICON_LEFT); | but->drawflag |= (UI_BUT_TEXT_LEFT | UI_BUT_ICON_LEFT); | ||||
| } | } | ||||
| #ifdef USE_NUMBUTS_LR_ALIGN | #ifdef USE_NUMBUTS_LR_ALIGN | ||||
| else if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER)) { | else if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER)) { | ||||
| if (slen != 0) { | if (slen != 0) { | ||||
| but->drawflag |= UI_BUT_TEXT_LEFT; | but->drawflag |= UI_BUT_TEXT_LEFT; | ||||
| ▲ Show 20 Lines • Show All 2,724 Lines • ▼ Show 20 Lines | if (properties) { | ||||
| PointerRNA *ptr = UI_but_operator_ptr_get(but); | PointerRNA *ptr = UI_but_operator_ptr_get(but); | ||||
| /* Copy idproperties. */ | /* Copy idproperties. */ | ||||
| ptr->data = IDP_CopyProperty(properties); | ptr->data = IDP_CopyProperty(properties); | ||||
| } | } | ||||
| return but; | return but; | ||||
| } | } | ||||
| void UI_but_datasetrow_indentation_set(uiBut *but, int indentation) | |||||
Severin: The `UI_but_datasetrow_xxx()` function declarations are still in the header. | |||||
Done Inline ActionsOops, thanks! HooglyBoogly: Oops, thanks! | |||||
| { | |||||
| uiButDatasetRow *but_dataset = (uiButDatasetRow *)but; | |||||
| BLI_assert(but->type == UI_BTYPE_DATASETROW); | |||||
| but_dataset->indentation = indentation; | |||||
| BLI_assert(indentation >= 0); | |||||
| } | |||||
| void UI_but_treerow_indentation_set(uiBut *but, int indentation) | void UI_but_treerow_indentation_set(uiBut *but, int indentation) | ||||
| { | { | ||||
| uiButTreeRow *but_row = (uiButTreeRow *)but; | uiButTreeRow *but_row = (uiButTreeRow *)but; | ||||
| BLI_assert(but->type == UI_BTYPE_TREEROW); | BLI_assert(but->type == UI_BTYPE_TREEROW); | ||||
| but_row->indentation = indentation; | but_row->indentation = indentation; | ||||
| BLI_assert(indentation >= 0); | BLI_assert(indentation >= 0); | ||||
| } | } | ||||
| /** | /** | ||||
| * Adds a hint to the button which draws right aligned, grayed out and never clipped. | * Adds a hint to the button which draws right aligned, grayed out and never clipped. | ||||
| */ | */ | ||||
| void UI_but_hint_drawstr_set(uiBut *but, const char *string) | void UI_but_hint_drawstr_set(uiBut *but, const char *string) | ||||
| { | { | ||||
| ui_but_add_shortcut(but, string, false); | ui_but_add_shortcut(but, string, false); | ||||
| } | } | ||||
| void UI_but_datasetrow_component_set(uiBut *but, uint8_t geometry_component_type) | |||||
| { | |||||
| uiButDatasetRow *but_dataset_row = (uiButDatasetRow *)but; | |||||
| BLI_assert(but->type == UI_BTYPE_DATASETROW); | |||||
| but_dataset_row->geometry_component_type = geometry_component_type; | |||||
| } | |||||
| void UI_but_datasetrow_domain_set(uiBut *but, uint8_t attribute_domain) | |||||
| { | |||||
| uiButDatasetRow *but_dataset_row = (uiButDatasetRow *)but; | |||||
| BLI_assert(but->type == UI_BTYPE_DATASETROW); | |||||
| but_dataset_row->attribute_domain = attribute_domain; | |||||
| } | |||||
| uint8_t UI_but_datasetrow_component_get(uiBut *but) | |||||
| { | |||||
| uiButDatasetRow *but_dataset_row = (uiButDatasetRow *)but; | |||||
| BLI_assert(but->type == UI_BTYPE_DATASETROW); | |||||
| return but_dataset_row->geometry_component_type; | |||||
| } | |||||
| uint8_t UI_but_datasetrow_domain_get(uiBut *but) | |||||
| { | |||||
| uiButDatasetRow *but_dataset_row = (uiButDatasetRow *)but; | |||||
| BLI_assert(but->type == UI_BTYPE_DATASETROW); | |||||
| return but_dataset_row->attribute_domain; | |||||
| } | |||||
| void UI_but_node_link_set(uiBut *but, bNodeSocket *socket, const float draw_color[4]) | void UI_but_node_link_set(uiBut *but, bNodeSocket *socket, const float draw_color[4]) | ||||
| { | { | ||||
| but->flag |= UI_BUT_NODE_LINK; | but->flag |= UI_BUT_NODE_LINK; | ||||
| but->custom_data = socket; | but->custom_data = socket; | ||||
| rgba_float_to_uchar(but->col, draw_color); | rgba_float_to_uchar(but->col, draw_color); | ||||
| } | } | ||||
| void UI_but_number_step_size_set(uiBut *but, float step_size) | void UI_but_number_step_size_set(uiBut *but, float step_size) | ||||
| ▲ Show 20 Lines • Show All 346 Lines • Show Last 20 Lines | |||||
The UI_but_datasetrow_xxx() function declarations are still in the header.