Blender V5.0
UI_interface.hh File Reference
#include <functional>
#include <memory>
#include "BLI_function_ref.hh"
#include "BLI_string_ref.hh"
#include "BLI_vector.hh"
#include "UI_resources.hh"
#include "UI_interface_c.hh"

Go to the source code of this file.

Classes

struct  blender::ui::ContextPathItem
struct  blender::ui::DragInfo
class  blender::ui::DropTargetInterface
class  uiListNameFilter

Namespaces

namespace  blender
namespace  blender::nodes
namespace  blender::nodes::geo_eval_log
namespace  blender::ui

Typedefs

using uiListItemFilterFn
using uiListItemGetNameFn

Enumerations

enum class  blender::ui::DropBehavior { blender::ui::Reorder , blender::ui::Insert , blender::ui::ReorderAndInsert }
enum class  blender::ui::DropLocation { blender::ui::Into , blender::ui::Before , blender::ui::After }
enum  eUIListFilterResult { UI_LIST_ITEM_NEVER_SHOW , UI_LIST_ITEM_FILTER_MATCHES , UI_LIST_ITEM_FILTER_MISMATCHES }

Functions

void UI_but_func_set (uiBut *but, std::function< void(bContext &)> func)
void UI_but_func_pushed_state_set (uiBut *but, std::function< bool(const uiBut &)> func)
template<typename T>
void but_func_argN_free (void *argN)
template<typename T>
void * but_func_argN_copy (const void *argN)
void blender::ui::context_path_add_generic (Vector< ContextPathItem > &path, StructRNA &rna_type, void *ptr, const BIFIconID icon_override=ICON_NONE, std::function< void(bContext &)> handle_func=nullptr)
void blender::ui::attribute_search_add_items (StringRef str, bool can_create_attribute, Span< const nodes::geo_eval_log::GeometryAttributeInfo * > infos, uiSearchItems *items, bool is_first)
void blender::ui::grease_pencil_layer_search_add_items (StringRef str, Span< const std::string * > layer_names, uiSearchItems &items, bool is_first)
bool blender::ui::asset_shelf_popover_invoke (bContext &C, blender::StringRef asset_shelf_idname, ReportList &reports)
bool blender::ui::drop_target_apply_drop (bContext &C, const ARegion &region, const wmEvent &event, const DropTargetInterface &drop_target, const ListBase &drags)
std::string blender::ui::drop_target_tooltip (const ARegion &region, const DropTargetInterface &drop_target, const wmDrag &drag, const wmEvent &event)
std::unique_ptr< DropTargetInterfaceblender::ui::region_views_find_drop_target_at (const ARegion *region, const int xy[2])
void UI_list_filter_and_sort_items (uiList *ui_list, const bContext *C, uiListItemFilterFn item_filter_fn, PointerRNA *dataptr, const char *propname, uiListItemGetNameFn get_name_fn=nullptr)
blender::ui::AbstractGridViewUI_block_add_view (uiBlock &block, blender::StringRef idname, std::unique_ptr< blender::ui::AbstractGridView > grid_view)
blender::ui::AbstractTreeViewUI_block_add_view (uiBlock &block, blender::StringRef idname, std::unique_ptr< blender::ui::AbstractTreeView > tree_view)
void UI_alert (bContext *C, blender::StringRef title, blender::StringRef message, eAlertIcon icon, bool compact)
Breadcrumb Template
void blender::ui::template_breadcrumbs (uiLayout &layout, Span< ContextPathItem > context_path)

Typedef Documentation

◆ uiListItemFilterFn

◆ uiListItemGetNameFn

Initial value:
blender::FunctionRef<std::string(const PointerRNA &itemptr, int index)>

Definition at line 260 of file UI_interface.hh.

Enumeration Type Documentation

◆ eUIListFilterResult

Enumerator
UI_LIST_ITEM_NEVER_SHOW 

Never show this item, even when filter results are inverted (UILST_FLT_EXCLUDE).

UI_LIST_ITEM_FILTER_MATCHES 

Show this item, unless filter results are inverted (UILST_FLT_EXCLUDE).

UI_LIST_ITEM_FILTER_MISMATCHES 

Don't show this item, unless filter results are inverted (UILST_FLT_EXCLUDE).

Definition at line 227 of file UI_interface.hh.

Function Documentation

◆ but_func_argN_copy()

template<typename T>
void * but_func_argN_copy ( const void * argN)

◆ but_func_argN_free()

template<typename T>
void but_func_argN_free ( void * argN)

◆ UI_alert()

void UI_alert ( bContext * C,
blender::StringRef title,
blender::StringRef message,
eAlertIcon icon,
bool compact )

◆ UI_block_add_view() [1/2]

◆ UI_block_add_view() [2/2]

blender::ui::AbstractTreeView * UI_block_add_view ( uiBlock & block,
blender::StringRef idname,
std::unique_ptr< blender::ui::AbstractTreeView > tree_view )

Definition at line 74 of file interface_view.cc.

References ui_block_add_view_impl().

◆ UI_but_func_pushed_state_set()

void UI_but_func_pushed_state_set ( uiBut * but,
std::function< bool(const uiBut &)> func )

◆ UI_but_func_set()

void UI_but_func_set ( uiBut * but,
std::function< void(bContext &)> func )

Definition at line 6296 of file interface.cc.

References uiBut::apply_func.

Referenced by blender::ed::asset::shelf::add_catalog_tabs(), add_preset_button(), ANIM_channel_draw_widgets(), block_create__close_file_dialog(), block_create_autorun_warning(), blender::ed::asset::shelf::AssetCatalogSelectorTree::Item::build_row(), uiLayout::button(), colorband_buttons_layout(), colorband_tools_fn(), curve_profile_presets_fn(), curve_profile_tools_fn(), curvemap_buttons_layout(), curvemap_clipping_func(), curvemap_tools_func(), CurveProfile_buttons_layout(), uiLayout::decorator(), envelope_panel_draw(), graph_draw_driver_settings_panel(), graph_panel_key_properties(), blender::ed::space_node::node_draw_basis(), blender::ed::space_node::node_draw_collapsed(), blender::ed::space_node::node_draw_panels(), blender::ed::outliner::outliner_draw_mode_column_toggle(), blender::ed::outliner::outliner_draw_restrictbuts(), blender::ed::outliner::outliner_draw_userbuts(), save_file_overwrite_cancel_button(), save_file_overwrite_confirm_button(), save_file_overwrite_saveas_button(), template_operator_property_buts_draw_single(), ui_alert_create(), ui_block_colorpicker(), ui_colorpicker_circle(), ui_colorpicker_square(), ui_imageuser_slot_menu(), ui_item_array(), ui_item_enum_expand_elem_exec(), ui_item_with_label(), UI_popup_block_template_confirm(), ui_popup_context_menu_for_button(), ui_template_list_layout_draw(), uiTemplateKeymapItemProperties(), uiTemplateLayers(), uiTemplateTextureShow(), view3d_panel_vgroup(), wm_block_dialog_create(), wm_block_file_close_cancel_button(), wm_block_file_close_discard_button(), wm_block_file_close_save_button(), wm_block_insert_unicode_create(), and wm_block_splash_create().

◆ UI_list_filter_and_sort_items()

void UI_list_filter_and_sort_items ( uiList * ui_list,
const bContext * C,
uiListItemFilterFn item_filter_fn,
PointerRNA * dataptr,
const char * propname,
uiListItemGetNameFn get_name_fn = nullptr )

Helper to apply custom filtering to UI lists not defined in Python. Custom filtering for Python UI lists has own code. This is also used as the default filtering if no uiListType::filter_items callback is set.

Filters list items using item_filter_fn and sorts the result. Also handles alphabetical sorting (UILST_FLT_SORT_ALPHA), and result inverting (UILST_FLT_EXCLUDE) if enabled, so the callback doesn't have to do this (unlike the filter function in Python).

Call this from a uiListType::filter_items callback with any #item_filter_fn. uiListNameFilter can be used to apply the default name based filtering.

Parameters
get_name_fnIn some cases the name cannot be retrieved via RNA. This function can be set to provide the name still.

Definition at line 202 of file interface_template_list.cc.

References BLI_strdup(), cmpstringp(), uiList::dyn_data, uiList::filter_flag, uiList::filter_sort_flag, i, uiListDyn::items_filter_flags, uiListDyn::items_filter_neworder, uiListDyn::items_len, uiListDyn::items_shown, len, MEM_calloc_arrayN(), MEM_freeN(), MEM_malloc_arrayN(), name, StringCmp::org_idx, RNA_PROP_BEGIN, RNA_PROP_END, RNA_property_collection_length(), RNA_struct_find_property(), RNA_struct_name_get_alloc(), STRNCPY(), UI_LIST_ITEM_FILTER_MATCHES, UI_LIST_ITEM_NEVER_SHOW, UILST_FLT_EXCLUDE, UILST_FLT_ITEM, UILST_FLT_ITEM_NEVER_SHOW, UILST_FLT_SORT_ALPHA, and UILST_FLT_SORT_LOCK.

Referenced by uilist_filter_items_default().