|
Blender
V2.93
|
#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "DNA_object_types.h"#include "DNA_screen_types.h"#include "BLI_alloca.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_string.h"#include "BLI_string_search.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "BKE_lib_id.h"#include "BKE_report.h"#include "MEM_guardedalloc.h"#include "RNA_access.h"#include "UI_interface.h"#include "UI_interface_icons.h"#include "UI_resources.h"#include "WM_api.h"#include "WM_types.h"#include "interface_intern.h"Go to the source code of this file.
Classes | |
| struct | CollItemSearch |
| struct | uiButStore |
| struct | uiButStoreElem |
Typedefs | |
| typedef struct CollItemSearch | CollItemSearch |
Functions | |
| uiBut * | uiDefAutoButR (uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int index, const char *name, int icon, int x, int y, int width, int height) |
| eAutoPropButsReturn | uiDefAutoButsRNA (uiLayout *layout, PointerRNA *ptr, bool(*check_prop)(PointerRNA *ptr, PropertyRNA *prop, void *user_data), void *user_data, PropertyRNA *prop_activate_init, const eButLabelAlign label_align, const bool compact) |
| static bool | add_collection_search_item (CollItemSearch *cis, const bool requires_exact_data_name, const bool has_id_icon, uiSearchItems *items) |
| void | ui_rna_collection_search_update_fn (const struct bContext *C, void *arg, const char *str, uiSearchItems *items, const bool is_first) |
| int | UI_icon_from_id (const ID *id) |
| int | UI_icon_from_report_type (int type) |
| int | UI_icon_colorid_from_report_type (int type) |
| int | UI_text_colorid_from_report_type (int type) |
| int | UI_calc_float_precision (int prec, double value) |
| bool | UI_but_online_manual_id (const uiBut *but, char *r_str, size_t maxlength) |
| bool | UI_but_online_manual_id_from_active (const struct bContext *C, char *r_str, size_t maxlength) |
Button Store | |
Modal Button Store API. Store for modal operators & handlers to register button pointers which are maintained while drawing or NULL when removed. This is needed since button pointers are continuously freed and re-allocated. | |
| uiButStore * | UI_butstore_create (uiBlock *block) |
| void | UI_butstore_free (uiBlock *block, uiButStore *bs_handle) |
| bool | UI_butstore_is_valid (uiButStore *bs) |
| bool | UI_butstore_is_registered (uiBlock *block, uiBut *but) |
| void | UI_butstore_register (uiButStore *bs_handle, uiBut **but_p) |
| void | UI_butstore_unregister (uiButStore *bs_handle, uiBut **but_p) |
| bool | UI_butstore_register_update (uiBlock *block, uiBut *but_dst, const uiBut *but_src) |
| void | UI_butstore_clear (uiBlock *block) |
| void | UI_butstore_update (uiBlock *block) |
| typedef struct CollItemSearch CollItemSearch |
|
static |
Definition at line 448 of file interface_utils.c.
References BKE_id_full_name_ui_prefix_get(), BLI_assert, CollItemSearch::data, CollItemSearch::has_sep_char, CollItemSearch::iconid, CollItemSearch::is_id, MEM_allocN_len, CollItemSearch::name, CollItemSearch::name_prefix_offset, UI_BUT_HAS_SEP_CHAR, UI_icon_from_library(), UI_MAX_DRAW_STR, UI_search_item_add(), and UI_SEP_CHAR.
Referenced by ui_rna_collection_search_update_fn().
| bool UI_but_online_manual_id | ( | const uiBut * | but, |
| char * | r_str, | ||
| size_t | maxlength | ||
| ) |
Definition at line 745 of file interface_utils.c.
References BLI_snprintf(), PointerRNA::data, wmOperatorType::idname, uiBut::optype, PointerRNA::owner_id, RNA_property_identifier(), RNA_struct_identifier(), uiBut::rnapoin, uiBut::rnaprop, PointerRNA::type, and WM_operator_py_idname().
Referenced by UI_but_online_manual_id_from_active(), and ui_popup_context_menu_for_button().
| bool UI_but_online_manual_id_from_active | ( | const struct bContext * | C, |
| char * | r_str, | ||
| size_t | maxlength | ||
| ) |
Definition at line 764 of file interface_utils.c.
References C, UI_but_online_manual_id(), and UI_context_active_but_get().
Referenced by doc_view_manual_ui_context_exec().
| void UI_butstore_clear | ( | uiBlock * | block | ) |
NULL all pointers, don't free since the owner needs to be able to inspect.
Definition at line 895 of file interface_utils.c.
References uiBlock::butstore, LISTBASE_FOREACH, and NULL.
Referenced by UI_block_free().
| uiButStore* UI_butstore_create | ( | uiBlock * | block | ) |
Create a new button store, the caller must manage and run UI_butstore_free
Definition at line 802 of file interface_utils.c.
References BLI_addtail(), uiButStore::block, uiBlock::butstore, and MEM_callocN.
Referenced by ui_but_add_search(), and ui_multibut_states_create().
| void UI_butstore_free | ( | uiBlock * | block, |
| uiButStore * | bs_handle | ||
| ) |
Definition at line 812 of file interface_utils.c.
References BLI_assert, BLI_findindex(), BLI_freelistN(), BLI_remlink(), uiButStore::block, uiBlock::butstore, uiButStore::items, MEM_freeN, and NULL.
Referenced by ui_multibut_free(), and ui_rna_collection_search_arg_free_fn().
Definition at line 839 of file interface_utils.c.
References uiBlock::butstore, and LISTBASE_FOREACH.
Referenced by ui_but_free().
| bool UI_butstore_is_valid | ( | uiButStore * | bs | ) |
Definition at line 834 of file interface_utils.c.
References uiButStore::block, and NULL.
| void UI_butstore_register | ( | uiButStore * | bs_handle, |
| uiBut ** | but_p | ||
| ) |
Definition at line 852 of file interface_utils.c.
References BLI_addtail(), BLI_assert, uiButStoreElem::but_p, uiButStore::items, and MEM_callocN.
Referenced by ui_but_add_search(), and ui_multibut_add().
Update the pointer for a registered button.
Definition at line 876 of file interface_utils.c.
References uiBlock::butstore, and LISTBASE_FOREACH.
Referenced by ui_but_update_from_old_block().
| void UI_butstore_unregister | ( | uiButStore * | bs_handle, |
| uiBut ** | but_p | ||
| ) |
Definition at line 861 of file interface_utils.c.
References BLI_assert, BLI_remlink(), uiButStoreElem::but_p, uiButStore::items, LISTBASE_FOREACH_MUTABLE, and MEM_freeN.
| void UI_butstore_update | ( | uiBlock * | block | ) |
Map freed buttons from the old block and update pointers.
Definition at line 908 of file interface_utils.c.
References BLI_assert, BLI_movelisttolist(), uiBlock::butstore, ELEM, ListBase::first, LIKELY, LISTBASE_FOREACH, NULL, uiBlock::oldblock, and ui_but_find_new().
Referenced by UI_block_update_from_old().
| int UI_calc_float_precision | ( | int | prec, |
| double | value | ||
| ) |
Returns the best "UI" precision for given floating value, so that e.g. 10.000001 rather gets drawn as '10'...
Definition at line 693 of file interface_utils.c.
References BLI_assert, CLAMP, e, fabs(), KDL::pow(), and UI_PRECISION_FLOAT_MAX.
Referenced by outputNumInput(), and ui_but_calc_float_precision().
| int UI_icon_colorid_from_report_type | ( | int | type | ) |
Definition at line 641 of file interface_utils.c.
References RPT_DEBUG_ALL, RPT_ERROR_ALL, RPT_INFO_ALL, RPT_OPERATOR, RPT_PROPERTY, RPT_WARNING_ALL, TH_INFO_DEBUG, TH_INFO_ERROR, TH_INFO_INFO, TH_INFO_OPERATOR, TH_INFO_PROPERTY, TH_INFO_WARNING, and type.
Referenced by report_line_data(), uiTemplateReportsBanner(), and update_reports_display_invoke().
| int UI_icon_from_id | ( | const ID * | id | ) |
Definition at line 593 of file interface_utils.c.
References Object::data, GS, id, ID_OB, ID::name, NULL, OB_EMPTY, ptr, RNA_id_pointer_create(), RNA_struct_ui_icon(), Object::type, and PointerRNA::type.
| int UI_icon_from_report_type | ( | int | type | ) |
Definition at line 618 of file interface_utils.c.
References RPT_DEBUG_ALL, RPT_ERROR_ALL, RPT_INFO_ALL, RPT_OPERATOR, RPT_PROPERTY, RPT_WARNING_ALL, and type.
Referenced by report_line_data(), UI_popup_menu_reports(), and uiTemplateReportsBanner().
| void ui_rna_collection_search_update_fn | ( | const struct bContext * | C, |
| void * | arg, | ||
| const char * | str, | ||
| uiSearchItems * | items, | ||
| const bool | is_first | ||
| ) |
Definition at line 475 of file interface_utils.c.
References add_collection_search_item(), BKE_id_full_name_ui_prefix_get(), BLI_addtail(), BLI_freelistN(), BLI_STATIC_ASSERT, BLI_strdup(), BLI_string_search_add(), BLI_string_search_free(), BLI_string_search_new(), BLI_string_search_query(), C, data, CollItemSearch::data, ELEM, CollItemSearch::has_sep_char, CollItemSearch::iconid, CollItemSearch::index, CollItemSearch::is_id, LISTBASE_FOREACH, MAX_ID_FULL_NAME_UI, MEM_callocN, MEM_freeN, CollItemSearch::name, CollItemSearch::name_prefix_offset, NULL, PROP_ID_SELF_CHECK, PROP_POINTER, RNA_PROP_BEGIN, RNA_PROP_END, RNA_property_flag(), RNA_property_pointer_poll(), RNA_property_type(), RNA_struct_is_ID(), RNA_struct_name_get_alloc(), str, ui_id_icon_get(), UI_MAX_DRAW_STR, and UI_SEP_CHAR.
Referenced by jump_to_target_button(), template_search_menu(), ui_but_add_search(), and ui_popup_context_menu_for_button().
| int UI_text_colorid_from_report_type | ( | int | type | ) |
Definition at line 664 of file interface_utils.c.
References RPT_DEBUG_ALL, RPT_ERROR_ALL, RPT_INFO_ALL, RPT_OPERATOR, RPT_PROPERTY, RPT_WARNING_ALL, TH_INFO_DEBUG_TEXT, TH_INFO_ERROR_TEXT, TH_INFO_INFO_TEXT, TH_INFO_OPERATOR_TEXT, TH_INFO_PROPERTY_TEXT, TH_INFO_WARNING_TEXT, and type.
Referenced by report_line_data(), and uiTemplateReportsBanner().
| uiBut* uiDefAutoButR | ( | uiBlock * | block, |
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| int | index, | ||
| const char * | name, | ||
| int | icon, | ||
| int | x, | ||
| int | y, | ||
| int | width, | ||
| int | height | ||
| ) |
Definition at line 59 of file interface_utils.c.
References BLI_snprintf(), ELEM, height, IFACE_, NULL, PROP_BOOLEAN, PROP_COLLECTION, PROP_COLOR, PROP_COLOR_GAMMA, PROP_ENUM, PROP_FACTOR, PROP_FLOAT, PROP_INT, PROP_PERCENTAGE, PROP_POINTER, PROP_STRING, PROP_TEXTEDIT_UPDATE, ptr, RNA_property_array_check(), RNA_property_collection_length(), RNA_property_flag(), RNA_property_pointer_get(), RNA_property_pointer_type(), RNA_property_subtype(), RNA_property_type(), RNA_struct_ui_icon(), PointerRNA::type, UI_BTYPE_CHECKBOX, UI_BTYPE_COLOR, UI_BTYPE_ICON_TOGGLE, UI_BTYPE_LABEL, UI_BTYPE_MENU, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_SEARCH_MENU, UI_BTYPE_TEXT, UI_BUT_DISABLED, UI_but_flag_enable(), UI_BUT_TEXTEDIT_UPDATE, UI_BUT_VALUE_CLEAR, uiDefBut(), uiDefButR_prop(), uiDefIconButR_prop(), uiDefIconTextButR_prop(), width, x, and y.
Referenced by ANIM_channel_draw_widgets(), outliner_draw_rnabuts(), template_search_add_button_name(), ui_item_array(), ui_item_with_label(), uiItemFullR(), and uiTemplateLayers().
| eAutoPropButsReturn uiDefAutoButsRNA | ( | uiLayout * | layout, |
| PointerRNA * | ptr, | ||
| bool(*)(PointerRNA *ptr, PropertyRNA *prop, void *user_data) | check_prop, | ||
| void * | user_data, | ||
| PropertyRNA * | prop_activate_init, | ||
| const eButLabelAlign | label_align, | ||
| const bool | compact | ||
| ) |
check_prop callback filters functions to avoid drawing certain properties, in cases where PROP_HIDDEN flag can't be used for a property.
| prop_activate_init | Property to activate on initial popup (UI_BUT_ACTIVATE_ON_INIT). |
Definition at line 359 of file interface_utils.c.
References BLI_assert, col, ELEM, NULL, PROP_BOOLEAN, PROP_FLOAT, PROP_HIDDEN, PROP_INT, PROP_STRING, ptr, RNA_property_array_check(), RNA_property_flag(), RNA_property_type(), RNA_property_ui_name(), RNA_STRUCT_BEGIN, RNA_STRUCT_END, type, UI_BUT_LABEL_ALIGN_COLUMN, UI_BUT_LABEL_ALIGN_NONE, UI_BUT_LABEL_ALIGN_SPLIT_COLUMN, UI_ITEM_R_COMPACT, UI_PROP_BUTS_ANY_FAILED_CHECK, UI_PROP_BUTS_NONE_ADDED, uiItemFullR(), uiItemL(), uiLayoutColumn(), uiLayoutSetActivateInit(), uiLayoutSetPropSep(), and user_data.