|
Blender V4.3
|
#include <algorithm>#include <cstdarg>#include <cstdlib>#include <cstring>#include <memory>#include <fmt/format.h>#include "MEM_guardedalloc.h"#include "DNA_userdef_types.h"#include "BLI_fileops.h"#include "BLI_listbase.h"#include "BLI_math_color.h"#include "BLI_math_vector.h"#include "BLI_path_utils.hh"#include "BLI_rect.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "BKE_context.hh"#include "BKE_idtype.hh"#include "BKE_image.hh"#include "BKE_paint.hh"#include "BKE_screen.hh"#include "BIF_glutil.hh"#include "DNA_vfont_types.h"#include "GPU_immediate.hh"#include "GPU_immediate_util.hh"#include "GPU_state.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "IMB_thumbs.hh"#include "WM_api.hh"#include "WM_types.hh"#include "RNA_access.hh"#include "RNA_path.hh"#include "RNA_prototypes.hh"#include "UI_interface.hh"#include "BLF_api.hh"#include "BLT_translation.hh"#include "ED_screen.hh"#include "interface_intern.hh"#include "interface_regions_intern.hh"Go to the source code of this file.
Classes | |
| struct | uiTooltipFormat |
| struct | uiTooltipField |
| struct | uiTooltipData |
Macros | |
| #define | UI_TIP_SPACER 0.3f |
| #define | UI_TIP_PADDING int(1.3f * UI_UNIT_Y) |
| #define | UI_TIP_MAXWIDTH 600 |
| #define | UI_TIP_MAXIMAGEWIDTH 500 |
| #define | UI_TIP_MAXIMAGEHEIGHT 300 |
| #define | UI_TIP_STR_MAX 1024 |
| #define | TIP_BORDER_X (16.0f) |
| #define | TIP_BORDER_Y (6.0f) |
ToolTip Region and Construction
Definition in file interface_region_tooltip.cc.
| #define TIP_BORDER_X (16.0f) |
Referenced by ui_tooltip_create_with_data().
| #define TIP_BORDER_Y (6.0f) |
Referenced by ui_tooltip_create_with_data().
| #define UI_TIP_MAXIMAGEHEIGHT 300 |
Definition at line 84 of file interface_region_tooltip.cc.
| #define UI_TIP_MAXIMAGEWIDTH 500 |
Definition at line 83 of file interface_region_tooltip.cc.
| #define UI_TIP_MAXWIDTH 600 |
Definition at line 82 of file interface_region_tooltip.cc.
Referenced by ui_tooltip_create_with_data().
Definition at line 81 of file interface_region_tooltip.cc.
Referenced by ui_tooltip_create_with_data(), and ui_tooltip_region_draw_cb().
| #define UI_TIP_SPACER 0.3f |
Definition at line 80 of file interface_region_tooltip.cc.
Referenced by ui_tooltip_create_with_data(), and ui_tooltip_region_draw_cb().
| #define UI_TIP_STR_MAX 1024 |
Definition at line 85 of file interface_region_tooltip.cc.
| BLI_STATIC_ASSERT | ( | int(UI_TIP_LC_MAX) | = =int(UI_TIP_LC_ALERT)+1, |
| "invalid lc-max" | ) |
Definition at line 148 of file interface_region_tooltip.cc.
References col, hsv_to_rgb_v(), rgb_to_hsv_v(), and v.
Referenced by ui_tooltip_region_draw_cb().
| ARegion * UI_tooltip_create_from_button | ( | bContext * | C, |
| 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 1550 of file interface_region_tooltip.cc.
References 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 1484 of file interface_region_tooltip.cc.
References BLI_rctf_cent_x(), BLI_rctf_cent_y(), BLI_rctf_size_y(), BLI_rcti_rctf_copy_round(), uiBut::block, CTX_wm_window(), uiBut::drawflag, wmWindow::eventstate, uiBut::rect, uiBut::tip_custom_func, uiBut::type, ui_block_to_window_fl(), ui_block_to_window_rctf(), UI_BTYPE_LABEL, 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_custom_func(), ui_tooltip_data_from_tool(), UI_UNIT_Y, wmEvent::xy, and rctf::ymin.
Referenced by ui_but_tooltip_init(), and UI_tooltip_create_from_button().
Definition at line 1555 of file interface_region_tooltip.cc.
References bounds(), CTX_wm_window(), wmWindow::eventstate, float, 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, | ||
| ID * | id ) |
Create a tooltip from search-item tooltip data item_tooltip data. To be called from a callback set with UI_but_func_search_set_tooltip().
| item_rect | Rectangle of the search item in search region space (ui_searchbox_butrect()) which is passed to the tooltip callback. |
Definition at line 1777 of file interface_region_tooltip.cc.
References CTX_wm_window(), wmWindow::eventstate, UI_POPUP_MARGIN, ui_tooltip_create_with_data(), ui_tooltip_data_from_search_item_tooltip_data(), ARegion::winrct, wmEvent::xy, and rcti::ymin.
Referenced by template_ID_search_menu_item_tooltip().
|
static |
Definition at line 1228 of file interface_region_tooltip.cc.
References BLF_disable(), BLF_enable(), BLF_height_max(), blf_mono_font, BLF_size(), BLF_width(), BLF_WORD_WRAP, BLF_wordwrap(), 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(), CTX_wm_screen(), CTX_wm_window(), ED_region_floating_init(), ED_region_tag_redraw(), uiTooltipData::fstyle, ResultBLF::lines, max_ff(), max_ii(), min_ii(), pad, RGN_TYPE_TEMPORARY, TIP_BORDER_X, TIP_BORDER_Y, uiStyle::tooltip, UI_fontstyle_set(), UI_POPUP_MARGIN, ui_region_temp_add(), UI_SCALE_FAC, UI_style_get(), UI_TIP_MAXWIDTH, UI_TIP_PADDING, UI_TIP_SPACER, UI_TIP_STYLE_IMAGE, UI_TIP_STYLE_MONO, UI_TIP_STYLE_SPACER, ui_tooltip_region_draw_cb(), ui_tooltip_region_free_cb(), UI_UNIT_Y, w(), ResultBLF::width, WM_window_native_pixel_size(), rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, rctf::ymax, rcti::ymax, rctf::ymin, and rcti::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 788 of file interface_region_tooltip.cc.
References uiTooltipImage::background, blf_mono_font, BLF_size(), BLF_width(), BLI_assert, uiBut::block, uiTooltipImage::border, Checkerboard_Fixed, CTX_wm_operator_poll_msg_clear(), CTX_wm_operator_poll_msg_get(), uiBut::disabled_info, uiBut::drawstr, ELEM, uiBut::flag, uiTooltipImage::height, IB_rect, uiTooltipImage::ibuf, ID_IS_LINKED, IMB_allocImBuf(), IMB_freeImBuf(), IMB_rectfill_area(), int, MEM_freeN(), None, uiBut::opcontext, wmOperatorCallParams::opcontext, uiBut::optype, wmOperatorCallParams::optype, uiButExtraOpIcon::optype_params, PointerRNA::owner_id, uiFontStyle::points, uiTooltipImage::premultiplied, PROP_ENUM_FLAG, PROP_FLOAT, PROP_PASSWORD, PROP_UNIT_ROTATION, rgb_to_hsv_v(), rgba_float_to_uchar(), RNA_path_full_property_py_ex(), RNA_path_full_struct_py(), RNA_property_array_check(), RNA_property_array_length(), RNA_property_flag(), RNA_property_float_get(), RNA_property_float_get_index(), RNA_property_subtype(), RNA_property_type(), uiBut::rnaindex, uiBut::rnapoin, uiBut::rnaprop, blender::StringRefBase::startswith(), str, TIP_, uiBut::tip_func, uiStyle::tooltip, uiBut::type, ui_block_cm_display_get(), ui_block_cm_to_display_space_v3(), ui_block_is_menu(), ui_block_is_pie_menu(), UI_BTYPE_COLOR, 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_get_label(), UI_but_extra_icon_string_get_operator_keymap(), UI_but_extra_icon_string_get_tooltip(), UI_but_extra_operator_icon_opptr_get(), UI_but_extra_operator_icon_optype_get(), ui_but_is_color_gamma(), UI_but_operator_ptr_ensure(), UI_but_rna_enum_item_get(), ui_but_string_get(), UI_but_string_get_label(), UI_but_string_get_operator_keymap(), UI_but_string_get_property_keymap(), UI_but_string_get_rna_property_identifier(), UI_but_string_get_rna_struct_identifier(), UI_but_string_get_tooltip(), UI_but_string_get_tooltip_label(), UI_but_unit_type_get(), ui_but_v3_get(), UI_SCALE_FAC, UI_style_get(), UI_TIP_LC_ALERT, UI_TIP_LC_NORMAL, UI_TIP_LC_PYTHON, UI_TIP_LC_VALUE, UI_TIP_STYLE_HEADER, UI_TIP_STYLE_MONO, UI_TIP_STYLE_NORMAL, UI_TIP_STYLE_SPACER, UI_tooltip_image_field_add(), ui_tooltip_period_needed(), UI_tooltip_text_field_add(), ui_tooltip_text_python_from_op(), USER_TOOLTIPS_PYTHON, w(), uiTooltipImage::width, and WM_operator_properties_sanitize().
Referenced by UI_tooltip_create_from_button_or_extra_icon().
|
static |
Definition at line 1217 of file interface_region_tooltip.cc.
References uiBut::tip_arg, and uiBut::tip_custom_func.
Referenced by UI_tooltip_create_from_button_or_extra_icon().
|
static |
Definition at line 1139 of file interface_region_tooltip.cc.
References ARRAY_SIZE, BLT_I18NCONTEXT_OPERATOR_DEFAULT, CTX_TIP_, PointerRNA::data, wmGizmo::drag_part, wmGizmo::highlight_part, wmOperatorType::idname, wmGizmoProperty::prop, wmGizmoOpElem::ptr, RNA_property_ui_description(), wmGizmoType::target_property_defs_len, TIP_, wmGizmo::type, wmGizmoOpElem::type, UI_TIP_LC_VALUE, UI_TIP_STYLE_HEADER, UI_TIP_STYLE_NORMAL, UI_tooltip_text_field_add(), 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 |
Additional info about the item (e.g. library name of a linked data-block).
Definition at line 1739 of file interface_region_tooltip.cc.
References BKE_idtype_idcode_to_name(), GS, ID_IM, ID_IS_LINKED, ID_MC, ID_VF, TIP_, UI_TIP_LC_MAIN, UI_TIP_LC_NORMAL, UI_TIP_STYLE_HEADER, UI_TIP_STYLE_NORMAL, ui_tooltip_from_clip(), ui_tooltip_from_image(), ui_tooltip_from_vfont(), and UI_tooltip_text_field_add().
Referenced by UI_tooltip_create_from_search_item_generic().
|
static |
Special tool-system exception.
Definition at line 448 of file interface_region_tooltip.cc.
References BLI_assert, BLI_strdup(), uiBut::block, BLT_I18NCONTEXT_OPERATOR_DEFAULT, BPY_run_string_as_intptr(), BPY_run_string_as_string(), BPY_run_string_as_string_and_len(), CTX_IFACE_, CTX_wm_area(), CTX_wm_space_data(), CTX_wm_window(), PointerRNA::data, uiBut::drawstr, uiBlock::flag, wmOperatorType::idname, IFACE_, wmKeyMap::items, KM_SHIFT, LISTBASE_FOREACH, MAX_NAME, MEM_freeN(), uiBut::opptr, uiBut::optype, RNA_boolean_set(), RNA_property_enum_get(), RNA_property_is_set(), RNA_string_get(), RNA_string_set(), RNA_struct_find_property(), SNPRINTF, str, STREQ, TIP_, UI_BLOCK_SHOW_SHORTCUT_ALWAYS, UI_but_string_get_operator_keymap(), UI_TIP_LC_ALERT, UI_TIP_LC_MAIN, UI_TIP_LC_NORMAL, UI_TIP_LC_PYTHON, UI_TIP_LC_VALUE, UI_TIP_STYLE_MONO, UI_TIP_STYLE_NORMAL, ui_tooltip_period_needed(), UI_tooltip_text_field_add(), ui_tooltip_text_python_from_op(), 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(), and WM_operator_properties_free().
Referenced by UI_tooltip_create_from_button_or_extra_icon().
Definition at line 1795 of file interface_region_tooltip.cc.
References ui_region_temp_remove().
Referenced by WM_tooltip_clear(), WM_tooltip_init(), and WM_tooltip_refresh().
|
static |
Definition at line 1648 of file interface_region_tooltip.cc.
References uiTooltipImage::background, BLI_path_split_dir_part(), uiTooltipImage::border, Box, Checkerboard_Themed, FILE_MAX, float, uiTooltipImage::height, uiTooltipImage::ibuf, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, IMB_anim_get_duration(), IMB_anim_get_image_height(), IMB_anim_get_image_width(), IMB_anim_previewframe(), IMB_freeImBuf(), IMB_rect_from_float(), IMB_scale(), IMB_TC_RECORD_RUN, int, uiTooltipImage::premultiplied, TIP_, UI_SCALE_FAC, UI_TIP_LC_NORMAL, UI_TIP_STYLE_NORMAL, UI_TIP_STYLE_SPACER, UI_tooltip_image_field_add(), UI_tooltip_text_field_add(), and uiTooltipImage::width.
Referenced by ui_tooltip_data_from_search_item_tooltip_data().
|
static |
Definition at line 1578 of file interface_region_tooltip.cc.
References Image::anims, uiTooltipImage::background, BKE_image_has_anim(), BKE_image_preview(), BLI_path_split_dir_part(), uiTooltipImage::border, Checkerboard_Themed, Image::colorspace_settings, FILE_MAX, Image::filepath, ListBase::first, uiTooltipImage::height, uiTooltipImage::ibuf, Image::id, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, IMA_SRC_TILED, IMA_SRC_VIEWER, IMB_anim_get_duration(), IMB_freeImBuf(), IMB_TC_RECORD_RUN, int, ColorManagedColorspaceSettings::name, uiTooltipImage::premultiplied, Image::source, TIP_, UI_SCALE_FAC, UI_TIP_LC_NORMAL, UI_TIP_STYLE_NORMAL, UI_TIP_STYLE_SPACER, UI_tooltip_image_field_add(), UI_tooltip_text_field_add(), ID::us, w(), uiTooltipImage::width, ImBuf::x, and ImBuf::y.
Referenced by ui_tooltip_data_from_search_item_tooltip_data().
|
static |
Definition at line 1708 of file interface_region_tooltip.cc.
References uiTooltipImage::background, BLI_exists(), uiTooltipImage::border, uiTooltipImage::height, uiTooltipImage::ibuf, IMB_font_preview(), IMB_freeImBuf(), None, uiTooltipImage::premultiplied, rgba_uchar_to_float(), uiWidgetColors::text, uiTooltipImage::text_color, TIP_, UI_SCALE_FAC, UI_TIP_LC_ALERT, UI_TIP_STYLE_NORMAL, ui_tooltip_get_theme(), UI_tooltip_image_field_add(), UI_tooltip_text_field_add(), uiTooltipImage::width, ImBuf::x, and ImBuf::y.
Referenced by ui_tooltip_data_from_search_item_tooltip_data().
| void UI_tooltip_image_field_add | ( | uiTooltipData & | data, |
| const uiTooltipImage & | image_data ) |
| image | Image buffer (duplicated, ownership is not transferred to data). |
| image_size | Display size for the image (pixels without UI scale applied). |
Definition at line 135 of file interface_region_tooltip.cc.
References uiTooltipField::format, uiTooltipImage::ibuf, IMB_dupImBuf(), uiTooltipFormat::style, and UI_TIP_STYLE_IMAGE.
Referenced by file_draw_tooltip_custom_func(), ui_tooltip_data_from_button_or_extra_icon(), ui_tooltip_from_clip(), ui_tooltip_from_image(), ui_tooltip_from_vfont(), and uiTemplateRecentFiles_tooltip_func().
|
static |
Definition at line 426 of file interface_region_tooltip.cc.
References blender::StringRefBase::back(), ELEM, blender::StringRefBase::find(), blender::StringRefBase::is_empty(), and blender::StringRefBase::not_found.
Referenced by ui_tooltip_data_from_button_or_extra_icon(), and ui_tooltip_data_from_tool().
Definition at line 162 of file interface_region_tooltip.cc.
References uiFontStyleDraw_Params::align, BLF_disable(), blf_mono_font, BLF_size(), BLF_WORD_WRAP, BLF_wordwrap(), BLI_assert, Checkerboard_Fixed, Checkerboard_Themed, copy_v3_v3(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_ALPHA_PREMULT, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_RGBA8, GPU_SHADER_3D_IMAGE_COLOR, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), imm_draw_box_checker_2d(), imm_draw_box_checker_2d_ex(), imm_draw_box_wire_2d(), immBindBuiltinProgram(), immDrawPixelsTexScaledFullSize(), immDrawPixelsTexSetup(), immUnbindProgram(), immUniformColor4fv(), immVertexFormat(), uiWidgetColors::inner, uiFontStyle::points, pos, rgb_float_to_uchar(), rgb_tint(), rgb_to_grayscale(), rgb_uchar_to_float(), state, uiWidgetColors::text, TH_BACK, UI_ALPHA_CHECKER_DARK, UI_ALPHA_CHECKER_LIGHT, ui_draw_tooltip_background(), UI_fontstyle_draw(), UI_fontstyle_set(), UI_GetThemeColor4fv(), UI_SCALE_FAC, UI_style_get(), UI_STYLE_TEXT_LEFT, UI_TIP_LC_ACTIVE, UI_TIP_LC_ALERT, UI_TIP_LC_MAIN, UI_TIP_LC_MAX, UI_TIP_LC_NORMAL, UI_TIP_LC_PYTHON, UI_TIP_LC_VALUE, UI_TIP_PADDING, UI_TIP_SPACER, UI_TIP_STYLE_HEADER, UI_TIP_STYLE_IMAGE, UI_TIP_STYLE_MONO, UI_TIP_STYLE_NORMAL, UI_TIP_STYLE_SPACER, ui_tooltip_get_theme(), uiFontStyle::uifont_id, wmOrtho2_region_pixelspace(), rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by ui_tooltip_create_with_data().
|
static |
Definition at line 352 of file interface_region_tooltip.cc.
References IMB_freeImBuf().
Referenced by ui_tooltip_create_with_data().
| void UI_tooltip_text_field_add | ( | uiTooltipData & | data, |
| std::string | text, | ||
| std::string | suffix, | ||
| const uiTooltipStyle | style, | ||
| const uiTooltipColorID | color_id, | ||
| const bool | is_pad = false ) |
| text | Allocated text (transfer ownership to data) or null. |
| suffix | Allocated text (transfer ownership to data) or null. |
Definition at line 115 of file interface_region_tooltip.cc.
References uiTooltipField::format, uiTooltipFormat::style, UI_TIP_LC_NORMAL, UI_TIP_STYLE_SPACER, and UI_tooltip_text_field_add().
Referenced by file_draw_tooltip_custom_func(), ui_block_colorpicker(), ui_tooltip_data_from_button_or_extra_icon(), ui_tooltip_data_from_gizmo(), ui_tooltip_data_from_search_item_tooltip_data(), ui_tooltip_data_from_tool(), ui_tooltip_from_clip(), ui_tooltip_from_image(), ui_tooltip_from_vfont(), UI_tooltip_text_field_add(), and uiTemplateRecentFiles_tooltip_func().
|
static |
Definition at line 370 of file interface_region_tooltip.cc.
References 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().