|
Blender V4.3
|
#include <cstdio>#include <cstring>#include "BLI_listbase.h"#include "BLI_sys_types.h"#include "DNA_space_types.h"#include "DNA_windowmanager_types.h"#include "MEM_guardedalloc.h"#include "UI_interface.hh"#include "BLI_ghash.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "BKE_main.hh"#include "BKE_screen.hh"#include "WM_api.hh"#include "WM_types.hh"Go to the source code of this file.
Functions | |
| uiListType * | WM_uilisttype_find (const char *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) |
Variables | |
| static GHash * | uilisttypes_hash = nullptr |
UI List Registry.
Definition in file wm_uilist_type.cc.
| bool WM_uilisttype_add | ( | uiListType * | ult | ) |
Definition at line 52 of file wm_uilist_type.cc.
References BLI_ghash_insert(), uiListType::idname, and uilisttypes_hash.
Referenced by blender::nodes::node_geo_bake_cc::draw_bake_items(), blender::nodes::draw_data_blocks(), blender::nodes::node_geo_simulation_cc::draw_simulation_state(), ED_uilisttypes_ui(), blender::nodes::node_geo_attribute_capture_cc::node_layout_ex(), blender::nodes::node_geo_foreach_geometry_element_cc::node_layout_ex(), blender::nodes::node_geo_menu_switch_cc::node_layout_ex(), blender::nodes::node_geo_repeat_cc::node_layout_ex(), blender::panel_register(), and uiTemplateCollectionExporters().
| uiListType * WM_uilisttype_find | ( | const char * | idname, |
| bool | quiet ) |
Definition at line 36 of file wm_uilist_type.cc.
References BLI_ghash_lookup(), printf, and uilisttypes_hash.
Referenced by ui_template_list_data_retrieve().
| void WM_uilisttype_free | ( | ) |
Definition at line 130 of file wm_uilist_type.cc.
References BLI_ghash_free(), BLI_ghashIterator_getValue(), ExtensionRNA::data, ExtensionRNA::free, GHASH_ITER, MEM_freeN(), uiListType::rna_ext, and uilisttypes_hash.
Referenced by WM_exit_ex().
| void WM_uilisttype_init | ( | ) |
Called on initialize WM_init()
Definition at line 125 of file wm_uilist_type.cc.
References BLI_ghash_str_new_ex(), and uilisttypes_hash.
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.
uiList.list_id was set using WM_uilisttype_to_full_list_id()! Definition at line 152 of file wm_uilist_type.cc.
References BLI_assert, and uiListType::idname.
| void WM_uilisttype_remove_ptr | ( | Main * | bmain, |
| uiListType * | ult ) |
Definition at line 115 of file wm_uilist_type.cc.
References BLI_assert, BLI_ghash_remove(), uiListType::idname, MEM_freeN(), uilisttypes_hash, 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 144 of file wm_uilist_type.cc.
References BLI_snprintf(), 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 90 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 69 of file wm_uilist_type.cc.
References LISTBASE_FOREACH, and wm_uilisttype_unlink_from_region().
Referenced by wm_uilisttype_unlink().
|
static |
Definition at line 58 of file wm_uilist_type.cc.
References LISTBASE_FOREACH.
Referenced by wm_uilisttype_unlink(), and wm_uilisttype_unlink_from_area().
|
static |
Definition at line 34 of file wm_uilist_type.cc.
Referenced by WM_uilisttype_add(), WM_uilisttype_find(), WM_uilisttype_free(), WM_uilisttype_init(), and WM_uilisttype_remove_ptr().