Blender
V3.3
|
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_brush_types.h"
#include "DNA_userdef_types.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_paint.h"
#include "BKE_screen.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_path.h"
#include "UI_interface.h"
#include "BLF_api.h"
#include "BLT_translation.h"
#include "ED_screen.h"
#include "interface_intern.h"
#include "interface_regions_intern.h"
Go to the source code of this file.
Classes | |
struct | uiTooltipFormat |
struct | uiTooltipField |
struct | uiTooltipData |
Macros | |
#define | UI_TIP_PAD_FAC 1.3f |
#define | UI_TIP_PADDING (int)(UI_TIP_PAD_FAC * UI_UNIT_Y) |
#define | UI_TIP_MAXWIDTH 600 |
#define | UI_TIP_STR_MAX 1024 |
#define | UI_TIP_LC_MAX 6 |
#define | TIP_BORDER_X (16.0f / aspect) |
#define | TIP_BORDER_Y (6.0f / aspect) |
Typedefs | |
typedef struct uiTooltipFormat | uiTooltipFormat |
typedef struct uiTooltipField | uiTooltipField |
typedef struct uiTooltipData | uiTooltipData |
ToolTip Region and Construction
Definition in file interface_region_tooltip.c.
#define TIP_BORDER_X (16.0f / aspect) |
#define TIP_BORDER_Y (6.0f / aspect) |
#define UI_TIP_LC_MAX 6 |
Definition at line 101 of file interface_region_tooltip.c.
#define UI_TIP_MAXWIDTH 600 |
Definition at line 60 of file interface_region_tooltip.c.
#define UI_TIP_PAD_FAC 1.3f |
Definition at line 58 of file interface_region_tooltip.c.
#define UI_TIP_PADDING (int)(UI_TIP_PAD_FAC * UI_UNIT_Y) |
Definition at line 59 of file interface_region_tooltip.c.
#define UI_TIP_STR_MAX 1024 |
Definition at line 62 of file interface_region_tooltip.c.
typedef struct uiTooltipData uiTooltipData |
typedef struct uiTooltipField uiTooltipField |
typedef struct uiTooltipFormat uiTooltipFormat |
BLI_STATIC_ASSERT | ( | sizeof(uiTooltipFormat)<=sizeof(int) | , |
"oversize" | |||
) |
BLI_STATIC_ASSERT | ( | UI_TIP_LC_MAX | = =UI_TIP_LC_ALERT+1 , |
"invalid lc-max" | |||
) |
Definition at line 124 of file interface_region_tooltip.c.
References col, hsv_to_rgb_v(), rgb_to_hsv_v(), and v.
Referenced by ui_tooltip_region_draw_cb().
|
static |
Definition at line 113 of file interface_region_tooltip.c.
References data, uiTooltipField::format, and text_field_add_only().
Referenced by ui_tooltip_data_from_button_or_extra_icon(), ui_tooltip_data_from_gizmo(), ui_tooltip_data_from_search_item_tooltip_data(), and ui_tooltip_data_from_tool().
|
static |
Definition at line 106 of file interface_region_tooltip.c.
References data, and MEM_recallocN.
Referenced by text_field_add().
ARegion* UI_tooltip_create_from_button | ( | struct bContext * | C, |
struct ARegion * | butregion, | ||
uiBut * | but, | ||
bool | is_label | ||
) |
is_label | When true, show a small tip that only shows the name, otherwise show the full tooltip. |
Definition at line 1462 of file interface_region_tooltip.c.
References C, NULL, and UI_tooltip_create_from_button_or_extra_icon().
Referenced by ui_search_menu_create_tooltip().
ARegion* UI_tooltip_create_from_button_or_extra_icon | ( | bContext * | C, |
ARegion * | butregion, | ||
uiBut * | but, | ||
uiButExtraOpIcon * | extra_icon, | ||
bool | is_label | ||
) |
Definition at line 1402 of file interface_region_tooltip.c.
References uiBlock::aspect, BLI_rctf_cent_x(), BLI_rctf_cent_y(), BLI_rcti_rctf_copy_round(), uiBut::block, C, CTX_wm_window(), data, uiBut::drawflag, wmWindow::eventstate, min_ff(), NULL, uiBut::rect, ui_block_to_window_fl(), ui_block_to_window_rctf(), UI_but_has_tooltip_label(), UI_but_is_tool(), UI_BUT_NO_TOOLTIP, UI_POPUP_MARGIN, ui_tooltip_create_with_data(), ui_tooltip_data_from_button_or_extra_icon(), ui_tooltip_data_from_tool(), wmEvent::xy, and rctf::ymin.
Referenced by ui_but_tooltip_init(), and UI_tooltip_create_from_button().
Definition at line 1467 of file interface_region_tooltip.c.
References bounds(), C, CTX_wm_window(), data, wmWindow::eventstate, NULL, wmGizmoType::screen_bounds_get, wmGizmo::type, ui_tooltip_create_with_data(), ui_tooltip_data_from_gizmo(), and wmEvent::xy.
Referenced by WM_gizmomap_tooltip_init().
ARegion* UI_tooltip_create_from_search_item_generic | ( | bContext * | C, |
const ARegion * | searchbox_region, | ||
const rcti * | item_rect, | ||
const uiSearchItemTooltipData * | item_tooltip_data | ||
) |
Definition at line 1534 of file interface_region_tooltip.c.
References C, CTX_wm_window(), data, wmWindow::eventstate, NULL, UI_POPUP_MARGIN, ui_tooltip_create_with_data(), ui_tooltip_data_from_search_item_tooltip_data(), ARegion::winrct, wmEvent::xy, and rcti::ymin.
|
static |
Definition at line 1150 of file interface_region_tooltip.c.
References BLF_disable(), BLF_enable(), BLF_height_max(), blf_mono_font, BLF_size(), BLF_width(), BLF_width_ex(), BLF_WORD_WRAP, BLF_wordwrap(), BLI_assert, BLI_rcti_cent_x(), BLI_rcti_cent_y(), BLI_rcti_clamp(), BLI_rcti_inside_rcti(), BLI_rcti_rctf_copy(), BLI_rcti_resize(), BLI_rcti_size_x(), BLI_rcti_size_y(), BLI_rcti_translate(), C, CTX_wm_screen(), CTX_wm_window(), data, ED_region_floating_init(), ED_region_tag_redraw(), ELEM, uiTooltipField::format, uiTooltipField::geom, if(), uiTooltipFormat::is_pad, uiTooltipField::lines, max_ff(), max_ii(), min_ii(), NULL, pad, r, ARegion::regiondata, RGN_TYPE_TEMPORARY, uiTooltipFormat::style, uiTooltipField::text, uiTooltipField::text_suffix, TIP_BORDER_X, TIP_BORDER_Y, type, ARegion::type, ui_fontscale(), UI_fontstyle_set(), UI_POPUP_MARGIN, ui_region_temp_add(), UI_style_get(), UI_TIP_MAXWIDTH, UI_TIP_PAD_FAC, UI_TIP_PADDING, UI_TIP_STR_MAX, ui_tooltip_region_draw_cb(), ui_tooltip_region_free_cb(), UI_UNIT_Y, w(), uiStyle::widget, ARegion::winrct, WM_window_pixels_x(), WM_window_pixels_y(), uiTooltipField::x_pos, rcti::xmax, rctf::xmax, rcti::xmin, rctf::xmin, rcti::ymax, rctf::ymax, rcti::ymin, and rctf::ymin.
Referenced by UI_tooltip_create_from_button_or_extra_icon(), UI_tooltip_create_from_gizmo(), and UI_tooltip_create_from_search_item_generic().
|
static |
Definition at line 755 of file interface_region_tooltip.c.
References BLI_sprintfN(), BLI_strdup(), BUT_GET_LABEL, BUT_GET_OP_KEYMAP, BUT_GET_PROP_KEYMAP, BUT_GET_RNAENUM_LABEL, BUT_GET_RNAENUM_TIP, BUT_GET_RNAPROP_IDENTIFIER, BUT_GET_RNASTRUCT_IDENTIFIER, BUT_GET_TIP, C, CTX_data_main(), CTX_wm_operator_poll_msg_clear(), CTX_wm_operator_poll_msg_get(), data, uiBut::disabled_info, uiBut::drawstr, ELEM, Library::filepath, uiBut::flag, id, ID_IS_LINKED, ID::lib, MEM_callocN, MEM_freeN, NULL, uiBut::opcontext, wmOperatorCallParams::opcontext, uiBut::optype, uiButExtraOpIcon::optype_params, PointerRNA::owner_id, PROP_ENUM_FLAG, PROP_FLOAT, PROP_PASSWORD, PROP_UNIT_ROTATION, RNA_path_full_property_py_ex(), RNA_path_full_struct_py(), RNA_property_array_check(), RNA_property_flag(), RNA_property_float_get(), RNA_property_float_get_index(), RNA_property_subtype(), RNA_property_type(), uiBut::rnaindex, uiBut::rnapoin, uiBut::rnaprop, str, uiStringInfo::strinfo, STRPREFIX, uiTooltipField::text, text_field_add(), uiTooltipField::text_suffix, TIP_, uiBut::tip_func, uiBut::type, UI_BTYPE_ROW, UI_BTYPE_SEARCH_MENU, UI_BTYPE_TEXT, ui_but_anim_expression_get(), ui_but_context_poll_operator_ex(), UI_BUT_DISABLED, UI_BUT_DRIVEN, UI_but_extra_icon_string_info_get(), UI_but_extra_operator_icon_opptr_get(), UI_but_extra_operator_icon_optype_get(), UI_but_operator_ptr_get(), ui_but_string_get(), UI_but_string_info_get(), UI_but_unit_type_get(), ui_tooltip_text_python_from_op(), USER_TOOLTIPS_PYTHON, and WM_operator_properties_sanitize().
Referenced by UI_tooltip_create_from_button_or_extra_icon().
|
static |
Definition at line 1053 of file interface_region_tooltip.c.
References ARRAY_SIZE, BLI_sprintfN(), BLI_strdup(), BLT_I18NCONTEXT_OPERATOR_DEFAULT, C, CTX_TIP_, data, PointerRNA::data, wmGizmo::drag_part, wmGizmo::highlight_part, wmOperatorType::idname, MEM_callocN, MEM_freeN, NULL, wmGizmoProperty::prop, wmGizmoOpElem::ptr, RNA_property_ui_description(), wmGizmoType::target_property_defs_len, uiTooltipField::text, text_field_add(), TIP_, wmGizmoOpElem::type, wmGizmo::type, WM_gizmo_operator_get(), WM_gizmo_target_property_array(), WM_key_event_operator_string(), WM_OP_INVOKE_DEFAULT, and WM_operatortype_description_or_name().
Referenced by UI_tooltip_create_from_gizmo().
|
static |
Definition at line 1493 of file interface_region_tooltip.c.
References BLI_strdup(), data, uiSearchItemTooltipData::description, uiSearchItemTooltipData::hint, MEM_callocN, MEM_freeN, uiSearchItemTooltipData::name, NULL, uiTooltipField::text, and text_field_add().
Referenced by UI_tooltip_create_from_search_item_generic().
|
static |
Special tool-system exception.
Definition at line 354 of file interface_region_tooltip.c.
References blender::compositor::area(), ARRAY_SIZE, BKE_paint_get_tool_enum_from_paintmode(), BKE_paint_get_tool_prop_id_from_paintmode(), BKE_paintmode_get_active_from_context(), BLI_assert, BLI_sprintfN(), BLI_strdup(), uiBut::block, BLT_I18NCONTEXT_OPERATOR_DEFAULT, BPY_run_string_as_intptr(), BPY_run_string_as_string(), BPY_run_string_as_string_and_size(), BUT_GET_OP_KEYMAP, C, uiTooltipFormat::color_id, CTX_IFACE_, CTX_wm_area(), CTX_wm_space_data(), CTX_wm_window(), data, PointerRNA::data, uiBut::drawstr, uiBlock::flag, uiTooltipField::format, wmOperatorType::idname, IFACE_, wmKeyMap::items, KM_SHIFT, LISTBASE_FOREACH, MAX_NAME, MEM_callocN, MEM_freeN, NULL, uiBut::opptr, uiBut::optype, ot, RNA_boolean_set(), RNA_enum_from_name(), RNA_enum_set(), RNA_property_enum_get(), RNA_property_is_set(), RNA_string_get(), RNA_string_set(), RNA_struct_find_property(), SNPRINTF, str, STREQ, uiStringInfo::strinfo, uiTooltipField::text, text_field_add(), TIP_, UI_BLOCK_SHOW_SHORTCUT_ALWAYS, UI_but_string_info_get(), ui_tooltip_text_python_from_op(), UNLIKELY, UNUSED_VARS, USER_TOOLTIPS_PYTHON, WM_key_event_operator_string(), WM_keymap_item_to_string(), WM_OP_INVOKE_REGION_WIN, WM_operator_properties_create_ptr(), WM_operator_properties_free(), and WM_operatortype_find().
Referenced by UI_tooltip_create_from_button_or_extra_icon().
Definition at line 1554 of file interface_region_tooltip.c.
References C, and ui_region_temp_remove().
Referenced by WM_tooltip_clear(), WM_tooltip_init(), and WM_tooltip_refresh().
Definition at line 138 of file interface_region_tooltip.c.
References uiFontStyleDraw_Params::align, BLF_disable(), blf_mono_font, BLF_size(), BLF_WORD_WRAP, BLF_wordwrap(), BLI_assert, uiTooltipFormat::color_id, copy_v3_v3(), data, uiTooltipField::format, uiTooltipField::geom, uiWidgetColors::inner, uiTooltipFormat::is_pad, uiTooltipField::lines, NULL, uiFontStyle::points, ARegion::regiondata, rgb_float_to_uchar(), rgb_tint(), rgb_to_grayscale(), rgb_uchar_to_float(), uiTooltipFormat::style, uiTooltipField::text, uiWidgetColors::text, uiTooltipField::text_suffix, ui_draw_tooltip_background(), UI_fontstyle_draw(), UI_fontstyle_set(), UI_style_get(), UI_STYLE_TEXT_LEFT, UI_TIP_LC_MAX, UI_TIP_PAD_FAC, UI_TIP_PADDING, UI_TIP_STR_MAX, ui_tooltip_get_theme(), uiFontStyle::uifont_id, wmOrtho2_region_pixelspace(), uiTooltipField::x_pos, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by ui_tooltip_create_with_data().
Definition at line 260 of file interface_region_tooltip.c.
References data, MEM_freeN, NULL, ARegion::regiondata, uiTooltipField::text, and uiTooltipField::text_suffix.
Referenced by ui_tooltip_create_with_data().
|
static |
Definition at line 282 of file interface_region_tooltip.c.
References C, NULL, ot, str, WM_operator_pystring_abbreviate(), and WM_operator_pystring_ex().
Referenced by ui_tooltip_data_from_button_or_extra_icon(), and ui_tooltip_data_from_tool().