81 return &dm->dropboxes;
102 wmDropBox *drop = MEM_cnew<wmDropBox>(__func__);
109 if (drop->
ot ==
nullptr) {
111 printf(
"Error: dropbox with unknown operator: %s\n",
idname);
151 if (region->visible) {
154 area_region_tag[
area->spacetype][region->regiontype] =
true;
161 if (!area_region_tag[dm->spaceid][dm->regionid]) {
169 if (drop->on_drag_start) {
170 drop->on_drag_start(
C, drag);
178 bContext *
C,
int icon,
int type,
void *poin,
double value,
unsigned int flags)
180 wmDrag *drag = MEM_cnew<wmDrag>(__func__);
238 bContext *
C,
int icon,
int type,
void *poin,
double value,
unsigned int flags)
246 bool any_active =
false;
248 if (drag->drop_state.active_dropbox) {
281 if (!*context_store) {
285 *context_store =
nullptr;
325 if (asset_item->is_external) {
343 char *tooltip =
nullptr;
374 if (!drop->poll(
C, drag, event)) {
389 bool free_disabled_info =
false;
429 if (event->
xy[0] < 0 || event->
xy[1] < 0 || event->
xy[0] > winsize_x ||
430 event->
xy[1] > winsize_y) {
440 if (drop != drop_prev) {
470 drop->
copy(
C, drag, drop);
485 bool any_active =
false;
489 if (drag->drop_state.active_dropbox) {
512 if (drag_id->id ==
id) {
513 if (drag_id->from_parent ==
nullptr) {
514 drag_id->from_parent = from_parent;
525 wmDragID *drag_id = MEM_cnew<wmDragID>(__func__);
542 ID *
id = drag_id->
id;
543 return (idcode == 0 ||
GS(
id->
name) == idcode) ?
id :
nullptr;
566 wmDragAsset *asset_drag = MEM_new<wmDragAsset>(__func__);
570 asset_drag->
path = path;
590 return (
ELEM(idcode, 0, asset_drag->
id_type)) ? asset_drag :
nullptr;
615 const char *name = asset_drag->
name;
629 bmain,
scene, view_layer, view3d, asset_drag->
path, idtype, name, flag);
767 float col_fg[4], col_bg[4];
780 float col_fg[4], col_bg[4];
789 switch (drag->
type) {
804 return asset_drag->
name;
839 const float col[4] = {1.0f, 1.0f, 1.0f, 0.65f};
860 const uchar text_col[] = {255, 255, 255, 255};
868 const uchar text_col[] = {255, 255, 255, 255};
892 char *tooltip =
nullptr;
899 if (!tooltip && !has_disabled_info) {
909 x =
xy[0] - (icon_width / 2);
911 if (
xy[1] + (icon_height / 2) +
padding + iconsize < winsize_y) {
921 if (
xy[1] + iconsize + iconsize < winsize_y) {
933 else if (has_disabled_info) {
990 if (drag->drop_state.active_dropbox) {
995 if (region && drag->drop_state.active_dropbox->draw_in_view) {
997 drag->drop_state.active_dropbox->draw_in_view(
C, win, drag,
xy);
1003 if (drag->drop_state.active_dropbox->draw_droptip) {
1004 drag->drop_state.active_dropbox->draw_droptip(
C, win, drag,
xy);
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin)
void immDrawPixelsTexTiled_scaling(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, void *rect, float scaleX, float scaleY, float xzoom, float yzoom, const float color[4])
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
void CTX_store_set(bContext *C, bContextStore *store)
void CTX_wm_region_set(bContext *C, struct ARegion *region)
const struct AssetLibraryReference * CTX_wm_asset_library_ref(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
bContextStore * CTX_store_copy(bContextStore *store)
void CTX_store_free(bContextStore *store)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct bScreen * CTX_wm_screen(const bContext *C)
const char * CTX_wm_operator_poll_msg_get(struct bContext *C, bool *r_free)
struct ARegion * CTX_wm_region(const bContext *C)
void CTX_wm_area_set(bContext *C, struct ScrArea *area)
ListBase CTX_data_collection_get(const bContext *C, const char *member)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
const char * BKE_idtype_idcode_to_name_plural(short idcode)
void id_us_plus(struct ID *id)
void BKE_id_free_us(struct Main *bmain, void *idv) ATTR_NONNULL()
struct ScrArea struct ScrArea * BKE_screen_find_area_xy(struct bScreen *screen, int spacetype, const int xy[2]) ATTR_NONNULL(1
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
int BLI_listbase_count_at_most(const struct ListBase *listbase, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int round_fl_to_int(float a)
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
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()
#define STREQLEN(a, b, n)
external readfile function prototypes.
@ BLO_LIBLINK_APPEND_RECURSIVE
@ BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR
@ BLO_LIBLINK_APPEND_LOCAL_ID_REUSE
@ FILE_ASSET_IMPORT_APPEND_REUSE
@ FILE_ASSET_IMPORT_APPEND
#define FILE_MAX_LIBEXTRA
struct ID * ED_asset_handle_get_local_id(const struct AssetHandle *asset)
ID_Type ED_asset_handle_get_id_type(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[])
ARegion * ED_area_find_region_xy_visual(const ScrArea *area, int regiontype, const int event_xy[2])
#define ED_screen_areas_iter(win, screen, area_name)
GHOST C-API function and type declarations.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
@ GPU_SHADER_2D_IMAGE_COLOR
void GPU_blend(eGPUBlend blend)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
void UI_fontstyle_draw_simple(const struct uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
uiBut * UI_region_active_but_get(const struct ARegion *region)
void UI_fontstyle_draw_simple_backdrop(const struct uiFontStyle *fs, float x, float y, const char *str, const float col_fg[4], const float col_bg[4])
struct bContextStore * UI_but_context_get(const uiBut *but)
void UI_icon_draw_ex(float x, float y, int icon_id, float aspect, float alpha, float desaturate, const uchar mono_color[4], bool mono_border)
struct bTheme * UI_GetTheme(void)
void UI_GetThemeColor4fv(int colorid, float col[4])
char *(* WMDropboxTooltipFunc)(struct bContext *, struct wmDrag *, const int xy[2], struct wmDropBox *drop)
#define WM_DRAG_ASSET_LIST
#define WM_DRAG_ASSET_CATALOG
void(* MEM_freeN)(void *vmemh)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
struct AssetMetaData * asset_data
uiWidgetColors wcol_tooltip
struct bContextStore * ui_context
const char * disabled_info
struct ScrArea * area_from
struct wmDropBox * active_dropbox
struct ARegion * region_from
wmDragAsset * external_info
union wmDragAssetListItem::@1219 asset_data
struct AssetMetaData * metadata
wmDragActiveDropState drop_state
struct wmDropBoxMap * next
struct wmDropBoxMap * prev
char idname[KMAP_MAX_NAME]
WMDropboxTooltipFunc tooltip
void(* draw_deactivate)(struct wmDropBox *drop, struct wmDrag *drag)
void(* copy)(struct bContext *C, struct wmDrag *drag, struct wmDropBox *drop)
bool(* poll)(struct bContext *C, struct wmDrag *drag, const wmEvent *event)
void(* draw_activate)(struct wmDropBox *drop, struct wmDrag *drag)
struct IDProperty * properties
void(* cancel)(struct Main *bmain, struct wmDrag *drag, struct wmDropBox *drop)
struct wmEvent * eventstate
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
static void wm_drop_update_active(bContext *C, wmDrag *drag, const wmEvent *event)
void wm_drop_prepare(bContext *C, wmDrag *drag, wmDropBox *drop)
const ListBase * WM_drag_asset_list_get(const wmDrag *drag)
void wm_drop_end(bContext *C, wmDrag *UNUSED(drag), wmDropBox *UNUSED(drop))
static void wm_drag_free_asset_data(wmDragAsset **asset_data)
wmDragAssetCatalog * WM_drag_get_asset_catalog_data(const wmDrag *drag)
static void wm_drop_redalert_draw(const char *redalert_str, int x, int y)
void wm_dropbox_free(void)
ID * WM_drag_get_local_ID_or_import_from_asset(const wmDrag *drag, int idcode)
static wmDropBox * wm_dropbox_active(bContext *C, wmDrag *drag, const wmEvent *event)
void WM_event_start_drag(bContext *C, int icon, int type, void *poin, double value, unsigned int flags)
void WM_drag_free_imported_drag_ID(Main *bmain, wmDrag *drag, wmDropBox *drop)
Free asset ID imported for canceled drop.
static void wm_drop_operator_draw(const char *name, int x, int y)
bool WM_drag_asset_will_import_linked(const wmDrag *drag)
static void wm_drag_draw_tooltip(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2])
static void wm_drag_draw_default(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2])
AssetMetaData * WM_drag_get_asset_meta_data(const wmDrag *drag, int idcode)
void wm_drags_draw(bContext *C, wmWindow *win)
static void wm_drop_ui_context_free(bContextStore **context_store)
void WM_event_drag_image(wmDrag *drag, ImBuf *imb, float scale)
void WM_drag_free(wmDrag *drag)
void WM_event_start_prepared_drag(bContext *C, wmDrag *drag)
ID * WM_drag_get_local_ID(const wmDrag *drag, short idcode)
static bContextStore * wm_drop_ui_context_create(const bContext *C)
wmOperatorCallContext wm_drop_operator_context_get(const wmDropBox *UNUSED(drop))
void wm_drags_check_ops(bContext *C, const wmEvent *event)
void WM_drag_draw_default_fn(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2])
bool WM_drag_is_ID_type(const wmDrag *drag, int idcode)
void WM_drag_data_free(int dragtype, void *poin)
wmDrag * WM_drag_data_create(bContext *C, int icon, int type, void *poin, double value, unsigned int flags)
static int wm_drag_imbuf_icon_height_get(const wmDrag *drag)
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
void WM_drag_add_asset_list_item(wmDrag *drag, const bContext *C, const AssetLibraryReference *asset_library_ref, const AssetHandle *asset)
wmDragAsset * WM_drag_create_asset_data(const AssetHandle *asset, AssetMetaData *metadata, const char *path, int import_type)
static void wm_drag_draw_icon(bContext *UNUSED(C), wmWindow *UNUSED(win), wmDrag *drag, const int xy[2])
void wm_drags_exit(wmWindowManager *wm, wmWindow *win)
wmDragAsset * WM_drag_get_asset_data(const wmDrag *drag, int idcode)
static void wm_dropbox_invoke(bContext *C, wmDrag *drag)
void WM_drag_free_list(ListBase *lb)
ID * WM_drag_get_local_ID_from_event(const wmEvent *event, short idcode)
static wmDropBox * dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, const wmEvent *event)
ID * WM_drag_asset_id_import(wmDragAsset *asset_drag, const int flag_extra)
const char * WM_drag_get_item_name(wmDrag *drag)
static ListBase dropboxes
void WM_drag_add_local_ID(wmDrag *drag, ID *id, ID *from_parent)
wmDropBox * WM_dropbox_add(ListBase *lb, const char *idname, bool(*poll)(bContext *, wmDrag *, const wmEvent *), void(*copy)(bContext *, wmDrag *, wmDropBox *), void(*cancel)(Main *, wmDrag *, wmDropBox *), WMDropboxTooltipFunc tooltip)
static void wm_drag_draw_item_name(wmDrag *drag, const int x, const int y)
static int wm_drag_imbuf_icon_width_get(const wmDrag *drag)
static char * dropbox_tooltip(bContext *C, wmDrag *drag, const int xy[2], wmDropBox *drop)
void WM_drag_draw_item_name_fn(bContext *UNUSED(C), wmWindow *UNUSED(win), wmDrag *drag, const int xy[2])
bool WM_operator_poll_context(bContext *C, wmOperatorType *ot, short context)
void WM_event_add_mousemove(wmWindow *win)
@ WM_HANDLER_TYPE_DROPBOX
ID * WM_file_link_datablock(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const char *filepath, const short id_code, const char *id_name, int flag)
ID * WM_file_append_datablock(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const char *filepath, const short id_code, const char *id_name, int flag)
ID * WM_operator_properties_id_lookup_from_name_or_session_uuid(Main *bmain, PointerRNA *ptr, const ID_Type type)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
const char * WM_operatortype_name(struct wmOperatorType *ot, struct PointerRNA *properties)
void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *opstring)
void WM_operator_properties_free(PointerRNA *ptr)
void wmViewport(const rcti *winrct)
void wmWindowViewport(wmWindow *win)
int WM_window_pixels_y(const wmWindow *win)
bScreen * WM_window_get_active_screen(const wmWindow *win)
int WM_window_pixels_x(const wmWindow *win)
void wm_cursor_position_get(wmWindow *win, int *r_x, int *r_y)