|
Blender V5.0
|
#include <cstdio>#include <cstring>#include "BLI_listbase.h"#include "DNA_space_types.h"#include "DNA_windowmanager_types.h"#include "MEM_guardedalloc.h"#include "BLI_string_utf8.h"#include "BLI_utildefines.h"#include "BLI_vector_set.hh"#include "BKE_main.hh"#include "BKE_screen.hh"#include "UI_interface_types.hh"#include "WM_api.hh"#include "WM_types.hh"Go to the source code of this file.
Functions | |
| static auto & | get_list_type_map () |
| uiListType * | WM_uilisttype_find (const StringRef idname, bool quiet) |
| bool | WM_uilisttype_add (uiListType *ult) |
| static void | wm_uilisttype_unlink_from_region (const uiListType *ult, ARegion *region) |
| static void | wm_uilisttype_unlink_from_area (const uiListType *ult, ScrArea *area) |
| static void | wm_uilisttype_unlink (Main *bmain, const uiListType *ult) |
| void | WM_uilisttype_remove_ptr (Main *bmain, uiListType *ult) |
| void | WM_uilisttype_init () |
| void | WM_uilisttype_free () |
| void | WM_uilisttype_to_full_list_id (const uiListType *ult, const char *list_id, char r_full_list_id[]) |
| const char * | WM_uilisttype_list_id_get (const uiListType *ult, uiList *list) |
UI List Registry.
Definition in file wm_uilist_type.cc.
|
static |
Definition at line 35 of file wm_uilist_type.cc.
References uiListType::idname, and operator()().
Referenced by WM_uilisttype_add(), WM_uilisttype_find(), WM_uilisttype_free(), WM_uilisttype_init(), and WM_uilisttype_remove_ptr().
| bool WM_uilisttype_add | ( | uiListType * | ult | ) |
Definition at line 62 of file wm_uilist_type.cc.
References get_list_type_map().
Referenced by blender::nodes::draw_data_blocks(), blender::nodes::socket_items::ui::draw_items_list_with_operators(), ED_uilisttypes_ui(), blender::panel_register(), and uiTemplateCollectionExporters().
| uiListType * WM_uilisttype_find | ( | const StringRef | idname, |
| bool | quiet ) |
Definition at line 47 of file wm_uilist_type.cc.
References get_list_type_map(), blender::StringRefBase::is_empty(), and printf.
Referenced by ui_template_list_data_retrieve().
| void WM_uilisttype_free | ( | ) |
Definition at line 141 of file wm_uilist_type.cc.
References get_list_type_map(), and MEM_freeN().
Referenced by WM_exit_ex().
| void WM_uilisttype_init | ( | ) |
Called on initialize WM_init()
Definition at line 136 of file wm_uilist_type.cc.
References get_list_type_map().
Referenced by WM_init().
| const char * WM_uilisttype_list_id_get | ( | const uiListType * | ult, |
| uiList * | list ) |
Get the "non-full" list-ID, see WM_uilisttype_to_full_list_id() for details.
Definition at line 161 of file wm_uilist_type.cc.
References BLI_assert, uiListType::idname, and uiList::list_id.
| void WM_uilisttype_remove_ptr | ( | Main * | bmain, |
| uiListType * | ult ) |
Definition at line 125 of file wm_uilist_type.cc.
References BLI_assert, get_list_type_map(), MEM_freeN(), UNUSED_VARS_NDEBUG, and wm_uilisttype_unlink().
| void WM_uilisttype_to_full_list_id | ( | const uiListType * | ult, |
| const char * | list_id, | ||
| char | r_full_list_id[] ) |
The "full" list-ID is an internal name used for storing and identifying a list. It is built like this: {uiListType.idname}_{list_id}, whereby list_id is an optional parameter passed to UILayout.template_list(). If it is not set, the full list-ID is just {uiListType.idname}_.
Note that whenever the Python API refers to the list-ID, it's the short, "non-full" one it passed to UILayout.template_list(). C code can query that through WM_uilisttype_list_id_get().
Definition at line 153 of file wm_uilist_type.cc.
References BLI_snprintf_utf8(), uiListType::idname, and UI_MAX_NAME_STR.
Referenced by ui_list_ensure().
|
static |
For all lists representing ult, clear their uiListType pointer. Use when a list-type is deleted, so that the UI doesn't keep references to it.
This is a common pattern for unregistering (usually .py defined) types at runtime, e.g. see WM_gizmomaptype_group_unlink(). Note that unlike in some other cases using this pattern, we don't actually free the lists with type ult, we just clear the reference to the type. That's because UI-Lists are written to files and we don't want them to get lost together with their (user visible) settings.
Definition at line 100 of file wm_uilist_type.cc.
References ListBase::first, LISTBASE_FOREACH, Main::screens, Main::wm, wm_uilisttype_unlink_from_area(), and wm_uilisttype_unlink_from_region().
Referenced by WM_uilisttype_remove_ptr().
|
static |
Definition at line 79 of file wm_uilist_type.cc.
References ListBase::first, LISTBASE_FOREACH, ScrArea::regionbase, ScrArea::spacedata, and wm_uilisttype_unlink_from_region().
Referenced by wm_uilisttype_unlink().
|
static |
Definition at line 68 of file wm_uilist_type.cc.
References LISTBASE_FOREACH, and ARegion::ui_lists.
Referenced by wm_uilisttype_unlink(), and wm_uilisttype_unlink_from_area().