Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_intern.h
| Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | enum { | ||||
| UI_PIE_GESTURE_END_WAIT = (1 << 6), | UI_PIE_GESTURE_END_WAIT = (1 << 6), | ||||
| }; | }; | ||||
| #define PIE_CLICK_THRESHOLD_SQ 50.0f | #define PIE_CLICK_THRESHOLD_SQ 50.0f | ||||
| /* max amount of items a radial menu (pie menu) can contain */ | /* max amount of items a radial menu (pie menu) can contain */ | ||||
| #define PIE_MAX_ITEMS 8 | #define PIE_MAX_ITEMS 8 | ||||
| struct uiButSearchData { | |||||
| uiButSearchCreateFn create_fn; | |||||
| uiButSearchUpdateFn update_fn; | |||||
| void *arg; | |||||
| uiButSearchArgFreeFn arg_free_fn; | |||||
| uiButSearchContextMenuFn context_menu_fn; | |||||
| uiButSearchTooltipFn tooltip_fn; | |||||
| const char *sep_string; | |||||
| }; | |||||
| struct uiBut { | struct uiBut { | ||||
| struct uiBut *next, *prev; | struct uiBut *next, *prev; | ||||
| /* Pointer back to the layout item holding this button. */ | |||||
| uiLayout *layout; | |||||
| int flag, drawflag; | int flag, drawflag; | ||||
| eButType type; | eButType type; | ||||
| eButPointerType pointype; | eButPointerType pointype; | ||||
| short bit, bitnr, retval, strwidth, alignnr; | short bit, bitnr, retval, strwidth, alignnr; | ||||
| short ofs, pos, selsta, selend; | short ofs, pos, selsta, selend; | ||||
| char *str; | char *str; | ||||
| char strdata[UI_MAX_NAME_STR]; | char strdata[UI_MAX_NAME_STR]; | ||||
| Show All 38 Lines | struct uiBut { | ||||
| uiButHandleNFunc funcN; | uiButHandleNFunc funcN; | ||||
| void *func_argN; | void *func_argN; | ||||
| struct bContextStore *context; | struct bContextStore *context; | ||||
| uiButCompleteFunc autocomplete_func; | uiButCompleteFunc autocomplete_func; | ||||
| void *autofunc_arg; | void *autofunc_arg; | ||||
| struct uiButSearchData *search; | |||||
| uiButHandleRenameFunc rename_func; | uiButHandleRenameFunc rename_func; | ||||
| void *rename_arg1; | void *rename_arg1; | ||||
| void *rename_orig; | void *rename_orig; | ||||
| /** Run an action when holding the button down. */ | /** Run an action when holding the button down. */ | ||||
| uiButHandleHoldFunc hold_func; | uiButHandleHoldFunc hold_func; | ||||
| void *hold_argN; | void *hold_argN; | ||||
| Show All 24 Lines | struct uiBut { | ||||
| uiMenuStepFunc menu_step_func; | uiMenuStepFunc menu_step_func; | ||||
| /* RNA data */ | /* RNA data */ | ||||
| struct PointerRNA rnapoin; | struct PointerRNA rnapoin; | ||||
| struct PropertyRNA *rnaprop; | struct PropertyRNA *rnaprop; | ||||
| int rnaindex; | int rnaindex; | ||||
| struct PointerRNA rnasearchpoin; | |||||
| struct PropertyRNA *rnasearchprop; | |||||
| /* Operator data */ | /* Operator data */ | ||||
| struct wmOperatorType *optype; | struct wmOperatorType *optype; | ||||
| struct PointerRNA *opptr; | struct PointerRNA *opptr; | ||||
| short opcontext; | short opcontext; | ||||
| uchar menu_key; /* 'a'-'z', always lower case */ | uchar menu_key; /* 'a'-'z', always lower case */ | ||||
| ListBase extra_op_icons; /* uiButExtraOpIcon */ | ListBase extra_op_icons; /* uiButExtraOpIcon */ | ||||
| Show All 19 Lines | struct uiBut { | ||||
| uiButPushedStateFunc pushed_state_func; | uiButPushedStateFunc pushed_state_func; | ||||
| void *pushed_state_arg; | void *pushed_state_arg; | ||||
| /* pointer back */ | /* pointer back */ | ||||
| uiBlock *block; | uiBlock *block; | ||||
| }; | }; | ||||
| /** Derived struct for #UI_BTYPE_TAB */ | |||||
| typedef struct uiButTab { | typedef struct uiButTab { | ||||
| uiBut but; | uiBut but; | ||||
| struct MenuType *menu; | struct MenuType *menu; | ||||
| } uiButTab; | } uiButTab; | ||||
| /** Derived struct for #UI_BTYPE_SEARCH_MENU */ | |||||
| typedef struct uiButSearch { | |||||
| uiBut but; | |||||
| uiButSearchCreateFn popup_create_fn; | |||||
| uiButSearchUpdateFn items_update_fn; | |||||
| void *item_active; | |||||
| void *arg; | |||||
| uiButSearchArgFreeFn arg_free_fn; | |||||
| uiButSearchContextMenuFn item_context_menu_fn; | |||||
| uiButSearchTooltipFn item_tooltip_fn; | |||||
| const char *item_sep_string; | |||||
| struct PointerRNA rnasearchpoin; | |||||
| struct PropertyRNA *rnasearchprop; | |||||
| } uiButSearch; | |||||
| /** Derived struct for #UI_BTYPE_DECORATOR */ | |||||
| typedef struct uiButDecorator { | |||||
| uiBut but; | |||||
| struct PointerRNA rnapoin; | |||||
| struct PropertyRNA *rnaprop; | |||||
| int rnaindex; | |||||
| } uiButDecorator; | |||||
| /** | /** | ||||
| * Additional, superimposed icon for a button, invoking an operator. | * Additional, superimposed icon for a button, invoking an operator. | ||||
| */ | */ | ||||
| typedef struct uiButExtraOpIcon { | typedef struct uiButExtraOpIcon { | ||||
| struct uiButExtraOpIcon *next, *prev; | struct uiButExtraOpIcon *next, *prev; | ||||
| BIFIconID icon; | BIFIconID icon; | ||||
| struct wmOperatorCallParams *optype_params; | struct wmOperatorCallParams *optype_params; | ||||
| ▲ Show 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | extern void ui_window_to_block_rctf(const struct ARegion *region, | ||||
| const rctf *rct_src); | const rctf *rct_src); | ||||
| extern void ui_window_to_region(const struct ARegion *region, int *x, int *y); | extern void ui_window_to_region(const struct ARegion *region, int *x, int *y); | ||||
| extern void ui_window_to_region_rcti(const struct ARegion *region, | extern void ui_window_to_region_rcti(const struct ARegion *region, | ||||
| rcti *rect_dst, | rcti *rect_dst, | ||||
| const rcti *rct_src); | const rcti *rct_src); | ||||
| extern void ui_region_to_window(const struct ARegion *region, int *x, int *y); | extern void ui_region_to_window(const struct ARegion *region, int *x, int *y); | ||||
| extern void ui_region_winrct_get_no_margin(const struct ARegion *region, struct rcti *r_rect); | extern void ui_region_winrct_get_no_margin(const struct ARegion *region, struct rcti *r_rect); | ||||
| uiBut *ui_but_change_type(uiBut *but, eButType new_type); | |||||
| extern double ui_but_value_get(uiBut *but); | extern double ui_but_value_get(uiBut *but); | ||||
| extern void ui_but_value_set(uiBut *but, double value); | extern void ui_but_value_set(uiBut *but, double value); | ||||
| extern void ui_but_hsv_set(uiBut *but); | extern void ui_but_hsv_set(uiBut *but); | ||||
| extern void ui_but_v3_get(uiBut *but, float vec[3]); | extern void ui_but_v3_get(uiBut *but, float vec[3]); | ||||
| extern void ui_but_v3_set(uiBut *but, const float vec[3]); | extern void ui_but_v3_set(uiBut *but, const float vec[3]); | ||||
| extern void ui_hsvcircle_vals_from_pos( | extern void ui_hsvcircle_vals_from_pos( | ||||
| const rcti *rect, const float mx, const float my, float *r_val_rad, float *r_val_dist); | const rcti *rect, const float mx, const float my, float *r_val_rad, float *r_val_dist); | ||||
| ▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | |||||
| uiBlock *ui_block_func_COLOR(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but); | uiBlock *ui_block_func_COLOR(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but); | ||||
| ColorPicker *ui_block_colorpicker_create(struct uiBlock *block); | ColorPicker *ui_block_colorpicker_create(struct uiBlock *block); | ||||
| /* interface_region_search.c */ | /* interface_region_search.c */ | ||||
| /* Searchbox for string button */ | /* Searchbox for string button */ | ||||
| struct ARegion *ui_searchbox_create_generic(struct bContext *C, | struct ARegion *ui_searchbox_create_generic(struct bContext *C, | ||||
| struct ARegion *butregion, | struct ARegion *butregion, | ||||
| uiBut *but); | uiButSearch *search_but); | ||||
| struct ARegion *ui_searchbox_create_operator(struct bContext *C, | struct ARegion *ui_searchbox_create_operator(struct bContext *C, | ||||
| struct ARegion *butregion, | struct ARegion *butregion, | ||||
| uiBut *but); | uiButSearch *search_but); | ||||
| struct ARegion *ui_searchbox_create_menu(struct bContext *C, | struct ARegion *ui_searchbox_create_menu(struct bContext *C, | ||||
| struct ARegion *butregion, | struct ARegion *butregion, | ||||
| uiBut *but); | uiButSearch *search_but); | ||||
| bool ui_searchbox_inside(struct ARegion *region, int x, int y); | bool ui_searchbox_inside(struct ARegion *region, int x, int y); | ||||
| int ui_searchbox_find_index(struct ARegion *region, const char *name); | int ui_searchbox_find_index(struct ARegion *region, const char *name); | ||||
| void ui_searchbox_update(struct bContext *C, struct ARegion *region, uiBut *but, const bool reset); | void ui_searchbox_update(struct bContext *C, struct ARegion *region, uiBut *but, const bool reset); | ||||
| int ui_searchbox_autocomplete(struct bContext *C, struct ARegion *region, uiBut *but, char *str); | int ui_searchbox_autocomplete(struct bContext *C, struct ARegion *region, uiBut *but, char *str); | ||||
| bool ui_searchbox_event(struct bContext *C, | bool ui_searchbox_event(struct bContext *C, | ||||
| struct ARegion *region, | struct ARegion *region, | ||||
| uiBut *but, | uiBut *but, | ||||
| struct ARegion *butregion, | struct ARegion *butregion, | ||||
| const struct wmEvent *event); | const struct wmEvent *event); | ||||
| bool ui_searchbox_apply(uiBut *but, struct ARegion *region); | bool ui_searchbox_apply(uiBut *but, struct ARegion *region); | ||||
| void ui_searchbox_free(struct bContext *C, struct ARegion *region); | void ui_searchbox_free(struct bContext *C, struct ARegion *region); | ||||
| void ui_but_search_refresh(uiBut *but); | void ui_but_search_refresh(uiButSearch *but); | ||||
| /* interface_region_menu_popup.c */ | /* interface_region_menu_popup.c */ | ||||
| int ui_but_menu_step(uiBut *but, int step); | int ui_but_menu_step(uiBut *but, int step); | ||||
| bool ui_but_menu_step_poll(const uiBut *but); | bool ui_but_menu_step_poll(const uiBut *but); | ||||
| uiBut *ui_popup_menu_memory_get(struct uiBlock *block); | uiBut *ui_popup_menu_memory_get(struct uiBlock *block); | ||||
| void ui_popup_menu_memory_set(uiBlock *block, struct uiBut *but); | void ui_popup_menu_memory_set(uiBlock *block, struct uiBut *but); | ||||
| uiBlock *ui_popup_block_refresh(struct bContext *C, | uiBlock *ui_popup_block_refresh(struct bContext *C, | ||||
| ▲ Show 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | |||||
| /* resources.c */ | /* resources.c */ | ||||
| void init_userdef_do_versions(struct Main *bmain); | void init_userdef_do_versions(struct Main *bmain); | ||||
| void ui_resources_init(void); | void ui_resources_init(void); | ||||
| void ui_resources_free(void); | void ui_resources_free(void); | ||||
| /* interface_layout.c */ | /* interface_layout.c */ | ||||
| void ui_layout_add_but(uiLayout *layout, uiBut *but); | void ui_layout_add_but(uiLayout *layout, uiBut *but); | ||||
| void ui_but_add_search(uiBut *but, | bool ui_layout_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but); | ||||
| uiBut *ui_but_add_search(uiBut *but, | |||||
| PointerRNA *ptr, | PointerRNA *ptr, | ||||
| PropertyRNA *prop, | PropertyRNA *prop, | ||||
| 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_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); | ||||
| /* interface_anim.c */ | /* interface_anim.c */ | ||||
| void ui_but_anim_flag(uiBut *but, float cfra); | void ui_but_anim_flag(uiBut *but, float cfra); | ||||
| void ui_but_anim_copy_driver(struct bContext *C); | void ui_but_anim_copy_driver(struct bContext *C); | ||||
| void ui_but_anim_paste_driver(struct bContext *C); | void ui_but_anim_paste_driver(struct bContext *C); | ||||
| bool ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen); | bool ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen); | ||||
| bool ui_but_anim_expression_set(uiBut *but, const char *str); | bool ui_but_anim_expression_set(uiBut *but, const char *str); | ||||
| bool ui_but_anim_expression_create(uiBut *but, const char *str); | bool ui_but_anim_expression_create(uiBut *but, const char *str); | ||||
| void ui_but_anim_autokey(struct bContext *C, uiBut *but, struct Scene *scene, float cfra); | void ui_but_anim_autokey(struct bContext *C, uiBut *but, struct Scene *scene, float cfra); | ||||
| void ui_but_anim_decorate_cb(struct bContext *C, void *arg_but, void *arg_dummy); | void ui_but_anim_decorate_cb(struct bContext *C, void *arg_but, void *arg_dummy); | ||||
| void ui_but_anim_decorate_update_from_flag(uiBut *but); | void ui_but_anim_decorate_update_from_flag(uiButDecorator *but); | ||||
| /* interface_query.c */ | /* interface_query.c */ | ||||
| bool ui_but_is_editable(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | bool ui_but_is_editable(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | ||||
| bool ui_but_is_editable_as_text(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | bool ui_but_is_editable_as_text(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | ||||
| bool ui_but_is_toggle(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | bool ui_but_is_toggle(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | ||||
| bool ui_but_is_interactive(const uiBut *but, const bool labeledit) ATTR_WARN_UNUSED_RESULT; | bool ui_but_is_interactive(const uiBut *but, const bool labeledit) ATTR_WARN_UNUSED_RESULT; | ||||
| bool ui_but_is_popover_once_compat(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | bool ui_but_is_popover_once_compat(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | ||||
| bool ui_but_has_array_value(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | bool ui_but_has_array_value(const uiBut *but) ATTR_WARN_UNUSED_RESULT; | ||||
| ▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines | |||||