Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_intern.h
| Show First 20 Lines • Show All 420 Lines • ▼ Show 20 Lines | |||||
| * A group of button references, used by property search to keep track of sets of buttons that | * A group of button references, used by property search to keep track of sets of buttons that | ||||
| * should be searched together. For example, in property split layouts number buttons and their | * should be searched together. For example, in property split layouts number buttons and their | ||||
| * labels (and even their decorators) are separate buttons, but they must be searched and | * labels (and even their decorators) are separate buttons, but they must be searched and | ||||
| * highlighted together. | * highlighted together. | ||||
| */ | */ | ||||
| typedef struct uiButtonGroup { | typedef struct uiButtonGroup { | ||||
| void *next, *prev; | void *next, *prev; | ||||
| ListBase buttons; /* #LinkData with #uiBut data field. */ | ListBase buttons; /* #LinkData with #uiBut data field. */ | ||||
| short flag; | |||||
| } uiButtonGroup; | } uiButtonGroup; | ||||
| /* #uiButtonGroup.flag. */ | |||||
| typedef enum uiButtonGroupFlag { | |||||
| /** While this flag is set, don't create new button groups for layout item calls. */ | |||||
| UI_BUTTON_GROUP_LOCK = (1 << 0), | |||||
| /** The buttons in this group are inside a panel header. */ | |||||
| UI_BUTTON_GROUP_PANEL_HEADER = (1 << 1), | |||||
Severin: Maybe a button group should have some kind of class identifier, so this could be tagged as… | |||||
| } uiButtonGroupFlag; | |||||
| struct uiBlock { | struct uiBlock { | ||||
| uiBlock *next, *prev; | uiBlock *next, *prev; | ||||
| ListBase buttons; | ListBase buttons; | ||||
| struct Panel *panel; | struct Panel *panel; | ||||
| uiBlock *oldblock; | uiBlock *oldblock; | ||||
| ListBase butstore; /* UI_butstore_* runtime function */ | ListBase butstore; /* UI_butstore_* runtime function */ | ||||
| ▲ Show 20 Lines • Show All 579 Lines • ▼ Show 20 Lines | uiBut *ui_but_add_search(uiBut *but, | ||||
| PointerRNA *searchptr, | PointerRNA *searchptr, | ||||
| PropertyRNA *searchprop); | PropertyRNA *searchprop); | ||||
| void ui_layout_list_set_labels_active(uiLayout *layout); | void ui_layout_list_set_labels_active(uiLayout *layout); | ||||
| /* menu callback */ | /* menu callback */ | ||||
| void ui_item_menutype_func(struct bContext *C, struct uiLayout *layout, void *arg_mt); | void ui_item_menutype_func(struct bContext *C, struct uiLayout *layout, void *arg_mt); | ||||
| void ui_item_paneltype_func(struct bContext *C, struct uiLayout *layout, void *arg_pt); | void ui_item_paneltype_func(struct bContext *C, struct uiLayout *layout, void *arg_pt); | ||||
| /* interface_button_group.c */ | /* interface_button_group.c */ | ||||
| void ui_block_new_button_group(uiBlock *block); | void ui_block_new_button_group(uiBlock *block, short flag); | ||||
| void ui_button_group_add_but(uiBlock *block, uiBut *but); | void ui_button_group_add_but(uiBlock *block, uiBut *but); | ||||
| void ui_button_group_replace_but_ptr(uiBlock *block, const void *old_but_ptr, uiBut *new_but); | void ui_button_group_replace_but_ptr(uiBlock *block, const void *old_but_ptr, uiBut *new_but); | ||||
| void ui_block_free_button_groups(uiBlock *block); | void ui_block_free_button_groups(uiBlock *block); | ||||
| /* interface_align.c */ | /* interface_align.c */ | ||||
| bool ui_but_can_align(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | bool ui_but_can_align(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | ||||
| int ui_but_align_opposite_to_area_align_get(const struct ARegion *region) ATTR_WARN_UNUSED_RESULT; | int ui_but_align_opposite_to_area_align_get(const struct ARegion *region) ATTR_WARN_UNUSED_RESULT; | ||||
| void ui_block_align_calc(uiBlock *block, const struct ARegion *region); | void ui_block_align_calc(uiBlock *block, const struct ARegion *region); | ||||
| ▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines | |||||
Maybe a button group should have some kind of class identifier, so this could be tagged as "panel-header". That would seem more extendible than these specific, predefined flags.
But this is runtime data, so you can leave it as is. If there's ever a need for something more flexible the class idea is good to keep in mind.