24 #include "RNA_prototypes.h"
75 const char *
UNUSED(active_propname),
89 const float size_x = (96.0f / 20.0f) *
UI_UNIT_X;
120 switch (notifier->category) {
149 const char *assets_propname)
162 RNA_warning(
"Expected a collection property for AssetHandle items");
189 const char *asset_library_propname,
191 const char *assets_propname,
193 const char *active_propname,
195 const int display_flags,
196 const char *activate_opname,
198 const char *drag_opname,
201 if (!list_id || !list_id[0]) {
202 RNA_warning(
"Asset view needs a valid identifier");
209 asset_library_propname);
217 uiItemO(row,
"", ICON_FILE_REFRESH,
"ASSET_OT_library_refresh");
226 asset_library_ref, *filter_settings, *assets_dataptr, assets_propname);
229 "AssetViewListData");
265 if (activate_opname) {
267 list, activate_opname, r_activate_op_properties !=
nullptr);
268 if (r_activate_op_properties &&
ptr) {
269 *r_activate_op_properties = *
ptr;
274 list, drag_opname, r_drag_op_properties !=
nullptr);
275 if (r_drag_op_properties &&
ptr) {
276 *r_drag_op_properties = *
ptr;
struct bScreen * CTX_wm_screen(const bContext *C)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
external readfile function prototypes.
@ UILST_LAYOUT_BIG_PREVIEW_GRID
@ FILE_ASSET_IMPORT_APPEND
#define FILE_MAX_LIBEXTRA
bool ED_asset_filter_matches_asset(const struct AssetFilterSettings *filter, const struct AssetHandle *asset)
struct ID * ED_asset_handle_get_local_id(const struct AssetHandle *asset)
const char * ED_asset_handle_get_name(const struct AssetHandle *asset)
struct AssetMetaData * ED_asset_handle_get_metadata(const struct AssetHandle *asset)
void ED_asset_handle_get_full_library_path(const struct bContext *C, const struct AssetLibraryReference *asset_library_ref, const struct AssetHandle *asset, char r_full_lib_path[])
int ED_asset_handle_get_preview_icon_id(const struct AssetHandle *asset)
AssetLibraryReference ED_asset_library_reference_from_enum_value(int value)
struct ImBuf * ED_assetlist_asset_image_get(const AssetHandle *asset_handle)
int ED_assetlist_size(const struct AssetLibraryReference *library_reference)
void ED_assetlist_storage_fetch(const struct AssetLibraryReference *library_reference, const struct bContext *C)
bool ED_assetlist_listen(const struct AssetLibraryReference *library_reference, const struct wmNotifier *notifier)
void ED_assetlist_ensure_previews_job(const struct AssetLibraryReference *library_reference, struct bContext *C)
void ED_assetlist_storage_tag_main_data_dirty(void)
void ED_assetlist_iterate(const AssetLibraryReference &library_reference, AssetListIterFn fn)
void ED_region_tag_redraw(struct ARegion *region)
Read Guarded memory(de)allocation.
#define RNA_warning(format,...)
uiBut * uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void UI_but_drag_set_id(uiBut *but, struct ID *id)
@ UI_TEMPLATE_ASSET_DRAW_NO_NAMES
@ UI_TEMPLATE_ASSET_DRAW_NO_LIBRARY
@ UI_TEMPLATE_ASSET_DRAW_NO_FILTER
struct uiList * uiTemplateList_ex(uiLayout *layout, struct bContext *C, const char *listtype_name, const char *list_id, struct PointerRNA *dataptr, const char *propname, struct PointerRNA *active_dataptr, const char *active_propname, const char *item_dyntip_propname, int rows, int maxrows, int layout_type, int columns, enum uiTemplateListFlags flags, void *customdata)
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
void uiLayoutSetContextPointer(uiLayout *layout, const char *name, struct PointerRNA *ptr)
struct PointerRNA * UI_list_custom_drag_operator_set(struct uiList *ui_list, const char *opname, bool create_properties)
void UI_but_drag_set_asset(uiBut *but, const struct AssetHandle *asset, const char *path, struct AssetMetaData *metadata, int import_type, int icon, struct ImBuf *imb, float scale)
void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon)
struct PointerRNA * UI_list_custom_activate_operator_set(struct uiList *ui_list, const char *opname, bool create_properties)
@ UI_TEMPLATE_LIST_NO_NAMES
@ UI_TEMPLATE_LIST_NO_FILTER_OPTIONS
@ UI_TEMPLATE_LIST_NO_GRIP
void ui_def_but_icon(uiBut *but, const int icon, const int flag)
static void asset_view_item_but_drag_set(uiBut *but, AssetViewListData *list_data, AssetHandle *asset_handle)
void uiTemplateAssetView(uiLayout *layout, bContext *C, const char *list_id, PointerRNA *asset_library_dataptr, const char *asset_library_propname, PointerRNA *assets_dataptr, const char *assets_propname, PointerRNA *active_dataptr, const char *active_propname, const AssetFilterSettings *filter_settings, const int display_flags, const char *activate_opname, PointerRNA *r_activate_op_properties, const char *drag_opname, PointerRNA *r_drag_op_properties)
static void asset_view_template_refresh_asset_collection(const AssetLibraryReference &asset_library_ref, const AssetFilterSettings &filter_settings, PointerRNA &assets_dataptr, const char *assets_propname)
static void asset_view_listener(uiList *ui_list, wmRegionListenerParams *params)
static void asset_view_draw_item(uiList *ui_list, bContext *UNUSED(C), uiLayout *layout, PointerRNA *UNUSED(dataptr), PointerRNA *itemptr, int UNUSED(icon), PointerRNA *UNUSED(active_dataptr), const char *UNUSED(active_propname), int UNUSED(index), int UNUSED(flt_flag))
uiListType * UI_UL_asset_view()
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value)
PropertyType RNA_property_type(PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop)
const struct FileDirEntry * file_data
AssetLibraryReference asset_library_ref
struct wmOperatorType * custom_drag_optype
char idname[BKE_ST_MAXNAME]
uiListDrawItemFunc draw_item