|
Blender V5.0
|
#include <cstring>#include "AS_asset_representation.hh"#include "DNA_asset_types.h"#include "DNA_screen_types.h"#include "DNA_space_types.h"#include "DNA_windowmanager_types.h"#include "MEM_guardedalloc.h"#include "BLT_translation.hh"#include "BLI_listbase.h"#include "BLI_math_color.h"#include "BLI_path_utils.hh"#include "BLI_string.h"#include "BLI_string_utf8.h"#include "BIF_glutil.hh"#include "BKE_context.hh"#include "BKE_global.hh"#include "BKE_idprop.hh"#include "BKE_idtype.hh"#include "BKE_lib_id.hh"#include "BKE_main.hh"#include "BKE_preview_image.hh"#include "BKE_screen.hh"#include "BLO_readfile.hh"#include "ED_fileselect.hh"#include "ED_screen.hh"#include "GPU_shader_builtin.hh"#include "GPU_state.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "GHOST_Types.h"#include "UI_interface.hh"#include "UI_interface_icons.hh"#include "UI_resources.hh"#include "RNA_access.hh"#include "WM_api.hh"#include "WM_types.hh"#include "wm_event_system.hh"#include "wm_window.hh"#include <fmt/format.h>Go to the source code of this file.
Classes | |
| struct | wmDropBoxMap |
Variables | |
| static ListBase | dropboxes = {nullptr, nullptr} |
Our own drag-and-drop, drag state and drop boxes.
Definition in file wm_dragdrop.cc.
|
static |
Definition at line 460 of file wm_dragdrop.cc.
References C, CTX_store_set(), CTX_wm_operator_poll_msg_get(), wmDragActiveDropState::disabled_info, wmDrag::drop_state, dropbox_tooltip(), wmEventHandler_Dropbox::dropboxes, wmDragActiveDropState::free_disabled_info, LISTBASE_FOREACH, MEM_SAFE_FREE, wmDropBox::ot, wmDropBox::poll, wmDragActiveDropState::tooltip, wmDragActiveDropState::ui_context, wm_drop_operator_context_get(), WM_HANDLER_TYPE_DROPBOX, WM_operator_poll_context(), and wmEvent::xy.
Referenced by wm_dropbox_active().
|
static |
Definition at line 449 of file wm_dragdrop.cc.
References C, wmDropBox::ot, wmDropBox::ptr, wmDropBox::tooltip, WM_operatortype_name(), and xy.
Referenced by dropbox_active().
| void WM_drag_add_asset_list_item | ( | wmDrag * | drag, |
| const blender::asset_system::AssetRepresentation * | asset ) |
Free asset ID imported for canceled drop.
If the asset was imported (linked/appended) using WM_drag_get_local_ID_or_import_from_asset()` (typically via a wmDropBox.copy() callback), we want the ID to be removed again if the drop operator cancels. This is for use as wmDropBox.cancel() callback. */ void WM_drag_free_imported_drag_ID(Main *bmain, wmDrag *drag, wmDropBox *drop);
wmDragAssetCatalog *WM_drag_get_asset_catalog_data(const wmDrag *drag);
/**
Definition at line 866 of file wm_dragdrop.cc.
References wmDragAssetListItem::asset_data, ASSET_IMPORT_APPEND, wmDrag::asset_items, BLI_addtail(), BLI_assert, wmDragAssetListItem::external_info, wmDragAssetListItem::is_external, blender::asset_system::AssetRepresentation::local_id(), wmDragAssetListItem::local_id, MEM_callocN(), AssetImportSettings::method, wmDrag::type, AssetImportSettings::use_instance_collections, WM_DRAG_ASSET_LIST, and WM_drag_create_asset_data().
Referenced by WM_drag_data_create().
Definition at line 624 of file wm_dragdrop.cc.
References BLI_addtail(), BLI_assert_msg, wmDragID::from_parent, GS, wmDragID::id, wmDrag::ids, LISTBASE_FOREACH, MEM_callocN(), and ID::name.
Referenced by blender::ed::outliner::outliner_item_drag_drop_invoke(), and WM_drag_data_create().
| ID * WM_drag_asset_id_import | ( | const bContext * | C, |
| wmDragAsset * | asset_drag, | ||
| int | flag_extra ) |
| flag_extra | Additional linking flags (from eFileSel_Params_Flag). |
Definition at line 722 of file wm_dragdrop.cc.
References wmDragAsset::asset, ASSET_IMPORT_APPEND, ASSET_IMPORT_APPEND_REUSE, ASSET_IMPORT_LINK, ASSET_IMPORT_PACK, BLI_assert, BLI_assert_unreachable, BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR, BLO_LIBLINK_APPEND_LOCAL_ID_REUSE, BLO_LIBLINK_APPEND_RECURSIVE, BLO_LIBLINK_COLLECTION_INSTANCE, BLO_LIBLINK_PACK, C, blender::StringRefNull::c_str(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), FILE_ACTIVE_COLLECTION, FILE_AUTOSELECT, FILE_RELPATH, flag, blender::asset_system::AssetRepresentation::full_library_path(), G_MAIN, blender::asset_system::AssetRepresentation::get_id_type(), blender::asset_system::AssetRepresentation::get_name(), blender::asset_system::AssetRepresentation::get_use_relative_path(), wmDragAsset::import_settings, AssetImportSettings::method, name, AssetImportSettings::use_instance_collections, WM_file_append_datablock(), and WM_file_link_datablock().
Referenced by view3d_collection_drop_copy_external_asset(), view3d_ob_drop_copy_external_asset(), and WM_drag_get_local_ID_or_import_from_asset().
Definition at line 892 of file wm_dragdrop.cc.
References wmDrag::asset_items, wmDrag::type, and WM_DRAG_ASSET_LIST.
Referenced by blender::ed::asset_browser::AssetCatalogDropTarget::drop_assets_into_catalog(), and blender::ed::asset_browser::AssetCatalogDropTarget::has_droppable_asset().
| bool WM_drag_asset_will_import_linked | ( | const wmDrag * | drag | ) |
Definition at line 793 of file wm_dragdrop.cc.
References ASSET_IMPORT_LINK, wmDragAsset::import_settings, AssetImportSettings::method, wmDrag::type, WM_DRAG_ASSET, and WM_drag_get_asset_data().
Referenced by view3d_collection_drop_on_enter(), and view3d_ob_drop_on_enter().
| bool WM_drag_asset_will_import_packed | ( | const wmDrag * | drag | ) |
Definition at line 803 of file wm_dragdrop.cc.
References ASSET_IMPORT_PACK, wmDragAsset::import_settings, AssetImportSettings::method, wmDrag::type, WM_DRAG_ASSET, and WM_drag_get_asset_data().
Referenced by view3d_collection_drop_copy_external_asset(), and view3d_ob_drop_copy_external_asset().
| wmDragAsset * WM_drag_create_asset_data | ( | const blender::asset_system::AssetRepresentation * | asset, |
| const AssetImportSettings & | import_settings ) |
Definition at line 677 of file wm_dragdrop.cc.
References wmDragAsset::asset, and wmDragAsset::import_settings.
Referenced by blender::ed::asset::shelf::AssetDragController::create_drag_data(), UI_but_drag_set_asset(), and WM_drag_add_asset_list_item().
| wmDragPath * WM_drag_create_path_data | ( | blender::Span< const char * > | paths | ) |
| paths | The paths to drag. Values will be copied into the drag data so the passed strings may be destructed. |
Definition at line 901 of file wm_dragdrop.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, ED_path_extension_type(), wmDragPath::file_types, wmDragPath::file_types_bit_flag, blender::Span< T >::is_empty(), wmDragPath::paths, Vector< T, InlineBufferCapacity, Allocator >::size(), TIP_, and wmDragPath::tooltip.
Referenced by ghost_event_proc(), blender::tests::TEST(), UI_but_drag_set_path(), and WM_event_drag_path_override_poin_data_with_space_file_paths().
| wmDrag * WM_drag_data_create | ( | bContext * | C, |
| int | icon, | ||
| eWM_DragDataType | type, | ||
| void * | poin, | ||
| unsigned int | flags ) |
Create and fill the dragging data, but don't start dragging just yet (unlike WM_event_start_drag()). Must be followed up by WM_event_start_prepared_drag(), otherwise the returned pointer will leak memory.
Note that poin should be valid allocated and not on stack.
Definition at line 263 of file wm_dragdrop.cc.
References C, CTX_data_collection_get(), wmDrag::flags, wmDrag::icon, wmDrag::poin, ptr, wmDrag::type, WM_drag_add_asset_list_item(), WM_drag_add_local_ID(), WM_DRAG_ASSET, WM_DRAG_ASSET_CATALOG, WM_DRAG_ASSET_LIST, WM_DRAG_FREE_DATA, WM_DRAG_GREASE_PENCIL_LAYER, WM_DRAG_ID, and WM_DRAG_PATH.
Referenced by blender::ed::outliner::outliner_item_drag_drop_invoke(), ui_but_drag_start(), and WM_event_start_drag().
| void WM_drag_data_free | ( | eWM_DragDataType | dragtype, |
| void * | poin ) |
Definition at line 390 of file wm_dragdrop.cc.
References MEM_freeN(), str, WM_DRAG_ASSET, wm_drag_free_asset_data(), wm_drag_free_path_data(), WM_DRAG_PATH, and WM_DRAG_STRING.
Referenced by ui_but_drag_free(), UI_but_drag_set_asset(), UI_but_drag_set_id(), UI_but_drag_set_name(), UI_but_drag_set_path(), UI_but_drag_set_rna(), WM_drag_free(), and WM_event_drag_path_override_poin_data_with_space_file_paths().
Definition at line 1228 of file wm_dragdrop.cc.
References C, wmDrag::imb, wmDrag::preview_icon_id, size(), UI_ICON_SIZE, UI_SCALE_FAC, UNPACK2, wm_drag_draw_icon(), wm_drag_draw_item_name(), wm_drag_draw_tooltip(), WM_drag_get_paths(), wm_drag_imbuf_icon_height_get(), wm_drag_imbuf_icon_width_get(), wm_drag_preview_icon_size_get(), and xy.
Referenced by WM_drag_draw_default_fn(), and wm_drags_draw().
Definition at line 1259 of file wm_dragdrop.cc.
References C, wm_drag_draw_default(), and xy.
Definition at line 1082 of file wm_dragdrop.cc.
References ImBuf::byte_buffer, col, ImBufByteBuffer::data, GPU_SHADER_3D_IMAGE_COLOR, wmDrag::icon, wmDrag::imb, wmDrag::imbuf_scale, immDrawPixelsTexSetup(), immDrawPixelsTexTiled_scaling(), padding(), wmDrag::preview_icon_id, size(), state, UI_icon_draw_ex(), UI_icon_draw_preview(), UI_icon_text_overlay_init_from_count(), UI_INV_SCALE_FAC, UI_NO_ICON_OVERLAY_TEXT, UI_SCALE_FAC, WM_drag_get_paths(), wm_drag_imbuf_icon_height_get(), wm_drag_imbuf_icon_width_get(), wm_drag_preview_icon_size_get(), ImBuf::x, x, xy, ImBuf::y, and y.
Referenced by wm_drag_draw_default().
|
static |
Definition at line 1140 of file wm_dragdrop.cc.
References UI_fontstyle_draw_simple(), UI_FSTYLE_WIDGET, WM_drag_get_item_name(), x, and y.
Referenced by wm_drag_draw_default(), and WM_drag_draw_item_name_fn().
Definition at line 1147 of file wm_dragdrop.cc.
References UI_SCALE_FAC, wm_drag_draw_item_name(), wmWindowViewport_ex(), x, xy, and y.
Referenced by view3d_dropboxes().
Definition at line 1157 of file wm_dragdrop.cc.
References C, CTX_wm_region(), wmDragActiveDropState::disabled_info, wmDrag::drop_state, wmDrag::imb, blender::StringRefBase::is_empty(), padding(), wmDrag::preview_icon_id, size(), wmDragActiveDropState::tooltip, UI_ICON_SIZE, UI_SCALE_FAC, WM_drag_get_paths(), wm_drag_imbuf_icon_height_get(), wm_drag_imbuf_icon_width_get(), wm_drag_preview_icon_size_get(), wm_drop_operator_draw(), wm_drop_redalert_draw(), WM_window_native_pixel_y(), x, xy, and y.
Referenced by wm_drag_draw_default().
| void WM_drag_free | ( | wmDrag * | drag | ) |
Definition at line 420 of file wm_dragdrop.cc.
References wmDragActiveDropState::active_dropbox, wmDrag::asset_items, BLI_freelinkN(), BLI_freelistN(), wmDragActiveDropState::disabled_info, wmDrag::drop_state, wmDrag::flags, wmDragActiveDropState::free_disabled_info, wmDrag::ids, LISTBASE_FOREACH_MUTABLE, MEM_SAFE_FREE, wmDropBox::on_exit, wmDrag::poin, wmDrag::type, wmDragActiveDropState::ui_context, WM_drag_data_free(), wm_drag_free_asset_data(), and WM_DRAG_FREE_DATA.
Referenced by WM_drag_free_list().
|
static |
Definition at line 688 of file wm_dragdrop.cc.
Referenced by WM_drag_data_free(), and WM_drag_free().
Definition at line 832 of file wm_dragdrop.cc.
References wmDragAsset::asset, BKE_id_free_us(), blender::asset_system::AssetRepresentation::get_id_type(), id_us_plus(), wmDropBox::ptr, wmDrag::type, WM_DRAG_ASSET, WM_drag_get_asset_data(), and WM_operator_properties_id_lookup_from_name_or_session_uid().
Referenced by ED_dropboxes_ui(), ED_keymap_screen(), blender::ed::space_node::node_dropboxes(), and view3d_dropboxes().
| void WM_drag_free_list | ( | ListBase * | lb | ) |
Definition at line 442 of file wm_dragdrop.cc.
References BLI_pophead(), and WM_drag_free().
Referenced by wm_event_custom_free(), wm_event_drag_and_drop_test(), wm_handlers_do_intern(), and blender::bke::WindowManagerRuntime::~WindowManagerRuntime().
|
static |
Definition at line 923 of file wm_dragdrop.cc.
Referenced by WM_drag_data_free().
| wmDragAssetCatalog * WM_drag_get_asset_catalog_data | ( | const wmDrag * | drag | ) |
Definition at line 857 of file wm_dragdrop.cc.
References wmDrag::poin, wmDrag::type, and WM_DRAG_ASSET_CATALOG.
Referenced by blender::ed::asset_browser::AssetCatalogDropTarget::drop_asset_catalog_into_catalog(), and blender::ed::asset_browser::AssetCatalogDropTarget::get_drag_catalog().
| wmDragAsset * WM_drag_get_asset_data | ( | const wmDrag * | drag, |
| int | idcode ) |
Definition at line 696 of file wm_dragdrop.cc.
References wmDragAsset::asset, ELEM, blender::asset_system::AssetRepresentation::get_id_type(), wmDrag::poin, wmDrag::type, and WM_DRAG_ASSET.
Referenced by blender::ed::space_node::node_group_drop_poll(), screen_drop_scene_tooltip(), view3d_collection_drop_copy_external_asset(), view3d_collection_drop_on_enter(), view3d_drop_id_in_main_region_poll_get_id_type(), view3d_geometry_nodes_drop_poll(), view3d_ob_drop_copy_external_asset(), WM_drag_asset_will_import_linked(), WM_drag_asset_will_import_packed(), WM_drag_free_imported_drag_ID(), WM_drag_get_asset_meta_data(), WM_drag_get_item_name(), WM_drag_get_local_ID_or_import_from_asset(), and WM_drag_is_ID_type().
| AssetMetaData * WM_drag_get_asset_meta_data | ( | const wmDrag * | drag, |
| int | idcode ) |
Definition at line 707 of file wm_dragdrop.cc.
References wmDragAsset::asset, ID::asset_data, blender::asset_system::AssetRepresentation::get_metadata(), WM_drag_get_asset_data(), and WM_drag_get_local_ID().
Referenced by view3d_ob_drop_on_enter().
| const char * WM_drag_get_item_name | ( | wmDrag * | drag | ) |
Definition at line 1036 of file wm_dragdrop.cc.
References wmDragAsset::asset, BKE_idtype_idcode_to_name_plural(), BLI_listbase_is_single(), blender::StringRefNull::c_str(), blender::asset_system::AssetRepresentation::get_name(), GS, wmDrag::ids, ID::name, wmDrag::poin, wmDragPath::tooltip, wmDrag::type, WM_DRAG_ASSET, WM_drag_get_asset_data(), WM_drag_get_local_ID(), WM_DRAG_ID, WM_DRAG_NAME, and WM_DRAG_PATH.
Referenced by screen_drop_scene_tooltip(), ui_drop_material_tooltip(), view3d_mat_drop_tooltip(), and wm_drag_draw_item_name().
Definition at line 647 of file wm_dragdrop.cc.
References ListBase::first, GS, wmDragID::id, wmDrag::ids, ID::name, wmDrag::type, and WM_DRAG_ID.
Referenced by console_drop_id_copy(), console_drop_id_poll(), blender::ed::outliner::material_drop_poll(), blender::ed::space_node::node_group_drop_poll(), blender::ed::outliner::parent_clear_poll(), blender::ed::outliner::parent_drop_poll(), blender::ed::outliner::scene_drop_poll(), text_drop_id_copy(), view3d_collection_drop_copy_local_id(), view3d_drop_id_in_main_region_poll_get_id_type(), view3d_geometry_nodes_drop_poll(), view3d_ob_drop_copy_local_id(), view3d_ob_drop_on_enter(), WM_drag_get_asset_meta_data(), WM_drag_get_item_name(), WM_drag_get_local_ID_from_event(), WM_drag_get_local_ID_or_import_from_asset(), and WM_drag_is_ID_type().
Definition at line 662 of file wm_dragdrop.cc.
References wmEvent::custom, EVT_DATA_DRAGDROP, ListBase::first, and WM_drag_get_local_ID().
Referenced by blender::ed::outliner::material_drop_invoke(), blender::ed::outliner::parent_drop_invoke(), and blender::ed::outliner::scene_drop_invoke().
| ID * WM_drag_get_local_ID_or_import_from_asset | ( | const bContext * | C, |
| const wmDrag * | drag, | ||
| int | idcode ) |
When dragging a local ID, return that. Otherwise, if dragging an asset-handle, link or append that depending on what was chosen by the drag-box (currently append only in fact).
Use WM_drag_free_imported_drag_ID() as cancel callback of the drop-box, so that the asset import is rolled back if the drop operator fails.
Definition at line 813 of file wm_dragdrop.cc.
References C, ELEM, wmDrag::type, WM_DRAG_ASSET, WM_drag_asset_id_import(), WM_drag_get_asset_data(), WM_drag_get_local_ID(), and WM_DRAG_ID.
Referenced by blender::ed::vse::get_drag_path(), blender::ed::space_node::node_group_drop_copy(), blender::ed::space_node::node_id_drop_copy(), blender::ed::space_node::node_id_im_drop_copy(), screen_drop_scene_copy(), blender::ed::vse::sequencer_drop_copy(), ui_drop_material_copy(), ui_drop_name_copy(), view3d_id_drop_copy(), view3d_id_drop_copy_with_type(), and view3d_id_path_drop_copy().
| int WM_drag_get_path_file_type | ( | const wmDrag * | drag | ) |
Note that even though the enum return type uses bit-flags, this should never have multiple type-bits set, so ELEM() like comparison is possible. To check all paths or to do a bit-flag check use WM_drag_has_path_file_type(drag, file_type) instead.
Definition at line 978 of file wm_dragdrop.cc.
References wmDragPath::file_types, wmDrag::poin, wmDrag::type, and WM_DRAG_PATH.
Referenced by blend_file_drop_poll(), clip_drop_poll(), blender::ed::vse::image_drop_poll(), blender::ed::vse::image_drop_preview_poll(), blender::ed::vse::is_movie(), blender::ed::vse::is_sound(), blender::ed::vse::movie_drop_preview_poll(), blender::ed::vse::sound_drop_preview_poll(), blender::tests::TEST(), and text_drop_path_poll().
| blender::Span< std::string > WM_drag_get_paths | ( | const wmDrag * | drag | ) |
Definition at line 968 of file wm_dragdrop.cc.
References Vector< T, InlineBufferCapacity, Allocator >::as_span(), wmDragPath::paths, wmDrag::poin, wmDrag::type, and WM_DRAG_PATH.
Referenced by drop_import_file_copy(), drop_import_file_poll(), drop_import_file_tooltip(), blender::ed::space_node::node_import_file_drop_copy(), blender::ed::space_node::node_import_file_drop_poll(), blender::tests::TEST(), blender::ed::vse::test_single_file_handler_poll(), wm_drag_draw_default(), wm_drag_draw_icon(), and wm_drag_draw_tooltip().
| const char * WM_drag_get_single_path | ( | const wmDrag * | drag | ) |
If drag contains path data, returns the first path int he path list.
Definition at line 929 of file wm_dragdrop.cc.
References wmDragPath::paths, wmDrag::poin, wmDrag::type, and WM_DRAG_PATH.
Referenced by blend_file_drop_copy(), clip_drop_copy(), console_drop_path_copy(), drop_extension_path_copy(), drop_extension_path_poll(), filepath_drop_copy(), blender::ed::vse::get_drag_path(), blender::ed::vse::sequencer_drop_copy(), blender::tests::TEST(), and text_drop_path_copy().
| const char * WM_drag_get_single_path | ( | const wmDrag * | drag, |
| int | file_type ) |
If drag contains path data, returns the first path in the path list that matches a a file_type.
| drag | The drag that could contain drag path data. |
| file_type | eFileSel_File_Types bit flag. |
Definition at line 939 of file wm_dragdrop.cc.
References blender::Span< T >::begin(), blender::Span< T >::end(), wmDragPath::file_types, wmDragPath::paths, wmDrag::poin, wmDrag::type, and WM_DRAG_PATH.
| const std::string & WM_drag_get_string | ( | const wmDrag * | drag | ) |
Definition at line 988 of file wm_dragdrop.cc.
References BLI_assert, wmDrag::poin, str, wmDrag::type, and WM_DRAG_STRING.
Referenced by drop_extension_url_copy(), drop_extension_url_poll(), and text_drop_string_copy().
| std::string WM_drag_get_string_firstline | ( | const wmDrag * | drag | ) |
Definition at line 995 of file wm_dragdrop.cc.
References BLI_assert, wmDrag::poin, str, wmDrag::type, and WM_DRAG_STRING.
Referenced by console_drop_string_copy().
| bool WM_drag_has_path_file_type | ( | const wmDrag * | drag, |
| int | file_type ) |
If drag contains path data, returns if any file path match a file_type.
| drag | The drag that could contain drag path data. |
| file_type | eFileSel_File_Types bit flag. |
Definition at line 959 of file wm_dragdrop.cc.
References wmDragPath::file_types_bit_flag, wmDrag::poin, wmDrag::type, and WM_DRAG_PATH.
Referenced by blender::tests::TEST().
|
static |
Definition at line 1072 of file wm_dragdrop.cc.
References wmDrag::imb, wmDrag::imbuf_scale, round_fl_to_int(), and ImBuf::y.
Referenced by wm_drag_draw_default(), wm_drag_draw_icon(), and wm_drag_draw_tooltip().
|
static |
Definition at line 1067 of file wm_dragdrop.cc.
References wmDrag::imb, wmDrag::imbuf_scale, round_fl_to_int(), and ImBuf::x.
Referenced by wm_drag_draw_default(), wm_drag_draw_icon(), and wm_drag_draw_tooltip().
| bool WM_drag_is_ID_type | ( | const wmDrag * | drag, |
| int | idcode ) |
Check if the drag data is either a local ID or an external ID asset of type idcode.
Definition at line 672 of file wm_dragdrop.cc.
References WM_drag_get_asset_data(), and WM_drag_get_local_ID().
Referenced by blender::ed::vse::image_drop_poll(), blender::ed::vse::image_drop_preview_poll(), blender::ed::vse::is_movie(), blender::ed::vse::is_sound(), blender::ed::vse::movie_drop_preview_poll(), blender::ed::space_node::node_collection_drop_poll(), blender::ed::space_node::node_group_drop_poll(), blender::ed::space_node::node_id_im_drop_poll(), blender::ed::space_node::node_mask_drop_poll(), blender::ed::space_node::node_material_drop_poll(), blender::ed::space_node::node_object_drop_poll(), screen_drop_scene_poll(), blender::ed::vse::sound_drop_preview_poll(), ui_drop_material_poll(), view3d_drop_id_in_main_region_poll(), and view3d_ima_drop_poll().
|
static |
Definition at line 1077 of file wm_dragdrop.cc.
References PREVIEW_DRAG_DRAW_SIZE, and UI_SCALE_FAC.
Referenced by wm_drag_draw_default(), wm_drag_draw_icon(), and wm_drag_draw_tooltip().
Called in inner handler loop, region context.
Definition at line 597 of file wm_dragdrop.cc.
References wmDragActiveDropState::active_dropbox, BLI_listbase_is_empty(), C, CTX_wm_manager(), CTX_wm_window(), wmDrag::drop_state, LISTBASE_FOREACH, wmWindowManager::runtime, WM_CURSOR_DEFAULT, WM_cursor_modal_set(), WM_CURSOR_STOP, and wm_drop_update_active().
Referenced by wm_event_do_region_handlers().
Called in wm_draw_window_onscreen.
Definition at line 1264 of file wm_dragdrop.cc.
References wmDragActiveDropState::active_dropbox, wmDragActiveDropState::area_from, BKE_screen_find_area_xy(), BLI_assert, C, CTX_store_set(), CTX_wm_area(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_region_set(), CTX_wm_screen(), wmDropBox::draw_droptip, wmDropBox::draw_in_view, wmDrag::drop_state, ED_area_find_region_xy_visual(), ELEM, wmWindow::eventstate, GHOST_kGrabHide, GHOST_kGrabWrap, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, wmWindow::grabcursor, LISTBASE_FOREACH, wmDragActiveDropState::region_from, RGN_TYPE_ANY, wmWindowManager::runtime, SPACE_TYPE_ANY, wmDragActiveDropState::ui_context, ARegion::winrct, wm_cursor_position_get(), wm_drag_draw_default(), wmViewport(), wmWindowViewport(), wmWindowViewport_ex(), wmEvent::xy, and xy.
Referenced by wm_draw_window_onscreen().
| void wm_drags_exit | ( | wmWindowManager * | wm, |
| wmWindow * | win ) |
Additional work to cleanly end dragging. Additional because this doesn't actually remove the drag items. Should be called whenever dragging is stopped (successful or not, also when canceled).
Definition at line 323 of file wm_dragdrop.cc.
References bScreen::active_region, ED_region_tag_redraw_no_rebuild(), wmWindow::eventstate, LISTBASE_FOREACH, wmWindow::tag_cursor_refresh, wmWindowManager::windows, WM_cursor_modal_restore(), WM_event_add_mousemove(), WM_window_find_under_cursor(), WM_window_get_active_screen(), and wmEvent::xy.
Referenced by wm_drop_prepare(), wm_event_drag_and_drop_test(), and wm_handlers_do_intern().
Definition at line 592 of file wm_dragdrop.cc.
References C, and CTX_store_set().
Referenced by wm_handlers_do_intern().
|
static |
Definition at line 199 of file wm_dragdrop.cc.
References PointerRNA::data, wmDropBox::properties, wmDropBox::ptr, and wm_drop_item_free_data().
Referenced by wm_dropbox_item_update_ot().
|
static |
Definition at line 185 of file wm_dragdrop.cc.
References IDP_FreeProperty(), wmDropBox::properties, wmDropBox::ptr, and WM_operator_properties_free().
Referenced by wm_drop_item_clear_runtime(), and wm_dropbox_free().
| blender::wm::OpCallContext wm_drop_operator_context_get | ( | const wmDropBox * | drop | ) |
The operator of a dropbox should always be executed in the context determined by the mouse coordinates. The dropbox poll should check the context area and region as needed. So this always returns blender::wm::OpCallContext::InvokeDefault.
Definition at line 617 of file wm_dragdrop.cc.
References blender::wm::InvokeDefault.
Referenced by dropbox_active(), wm_drop_prepare(), and wm_handlers_do_intern().
|
static |
Definition at line 1008 of file wm_dragdrop.cc.
References uiWidgetColors::inner, name, rgba_uchar_to_float(), uiWidgetColors::text, bTheme::tui, UI_fontstyle_draw_simple_backdrop(), UI_FSTYLE_WIDGET, UI_GetTheme(), ThemeUI::wcol_tooltip, x, and y.
Referenced by wm_drag_draw_tooltip().
Definition at line 574 of file wm_dragdrop.cc.
References C, wmDropBox::copy, CTX_store_set(), CTX_wm_manager(), CTX_wm_window(), wmDrag::drop_state, wmDropBox::ot, wmDragActiveDropState::ui_context, wm_drags_exit(), wm_drop_operator_context_get(), and WM_operator_poll_context().
Referenced by wm_handlers_do_intern().
|
static |
Definition at line 1023 of file wm_dragdrop.cc.
References uiWidgetColors::inner, rgba_uchar_to_float(), TH_REDALERT, bTheme::tui, UI_fontstyle_draw_simple_backdrop(), UI_FSTYLE_WIDGET, UI_GetTheme(), UI_GetThemeColor4fv(), ThemeUI::wcol_tooltip, x, and y.
Referenced by wm_drag_draw_tooltip().
|
static |
Definition at line 343 of file wm_dragdrop.cc.
References C, CTX_wm_region(), UI_but_context_get(), and UI_region_active_but_get().
Referenced by wm_drop_update_active().
Update dropping information for the current mouse position in event.
Definition at line 537 of file wm_dragdrop.cc.
References wmDragActiveDropState::active_dropbox, wmDragActiveDropState::area_from, BLI_assert, C, CTX_wm_area(), CTX_wm_region(), CTX_wm_window(), wmDropBox::draw_data, wmDrag::drop_state, wmDropBox::on_enter, wmDropBox::on_exit, wmDragActiveDropState::region_from, wmDragActiveDropState::tooltip, wmDragActiveDropState::ui_context, wm_drop_ui_context_create(), wm_dropbox_active(), WM_window_native_pixel_size(), and wmEvent::xy.
Referenced by wm_drags_check_ops().
Definition at line 511 of file wm_dragdrop.cc.
References BKE_area_find_region_xy(), BKE_screen_find_area_xy(), C, CTX_wm_window(), dropbox_active(), ScrArea::handlers, wmWindow::handlers, RGN_TYPE_ANY, ARegion::runtime, SPACE_TYPE_ANY, WM_window_get_active_screen(), and wmEvent::xy.
Referenced by wm_drop_update_active().
| wmDropBox * WM_dropbox_add | ( | ListBase * | lb, |
| const char * | idname, | ||
| bool(* | poll )(bContext *C, wmDrag *drag, const wmEvent *event), | ||
| void(* | copy )(bContext *C, wmDrag *drag, wmDropBox *drop), | ||
| void(* | cancel )(Main *bmain, wmDrag *drag, wmDropBox *drop), | ||
| WMDropboxTooltipFunc | tooltip ) |
Definition at line 110 of file wm_dragdrop.cc.
References BLI_addtail(), C, wmDropBox::cancel, copy(), wmDropBox::copy, MEM_callocN(), wmDropBox::opname, ot, wmDropBox::ot, PointerRNA::owner_id, wmDropBox::poll, printf, wmDropBox::properties, wmDropBox::ptr, STRNCPY(), wmDropBox::tooltip, WM_operator_properties_alloc(), WM_operator_properties_sanitize(), and WM_operatortype_find().
Referenced by clip_dropboxes(), console_dropboxes(), ED_dropbox_drop_extension(), ED_dropbox_drop_import_file(), ED_dropboxes_ui(), ED_keymap_screen(), file_dropboxes(), blender::ed::space_node::node_dropboxes(), blender::ed::outliner::outliner_dropboxes(), blender::ed::vse::sequencer_dropboxes_add_to_lb(), blender::ed::vse::sequencer_preview_dropboxes_add_to_lb(), text_dropboxes(), and view3d_dropboxes().
| void wm_dropbox_free | ( | ) |
Definition at line 210 of file wm_dragdrop.cc.
References BLI_freelistN(), dropboxes, LISTBASE_FOREACH, and wm_drop_item_free_data().
Referenced by WM_exit_ex().
Definition at line 225 of file wm_dragdrop.cc.
References BLI_assert, C, CTX_store_set(), CTX_wm_manager(), wmDrag::drop_state, dropboxes, ED_screen_areas_iter, LISTBASE_FOREACH, wmDropBox::on_drag_start, RGN_TYPE_NUM, SPACE_TYPE_NUM, wmDragActiveDropState::ui_context, wmWindowManager::windows, and WM_window_get_active_screen().
Referenced by WM_event_start_prepared_drag().
|
static |
Definition at line 142 of file wm_dragdrop.cc.
References PointerRNA::data, wmDropBox::opname, ot, wmDropBox::ot, PointerRNA::owner_id, wmDropBox::properties, wmDropBox::ptr, PointerRNA::type, wm_drop_item_clear_runtime(), WM_operator_properties_alloc(), WM_operator_properties_create_ptr(), WM_operator_properties_sanitize(), and WM_operatortype_find().
Referenced by WM_dropbox_update_ot().
| void WM_dropbox_update_ot | ( | ) |
Ensure operator pointers & properties are valid after operators have been added/removed.
Definition at line 176 of file wm_dragdrop.cc.
References dropboxes, LISTBASE_FOREACH, and wm_dropbox_item_update_ot().
Referenced by WM_keyconfig_update_ex().
| ListBase * WM_dropboxmap_find | ( | const char * | idname, |
| int | spaceid, | ||
| int | regionid ) |
spaceid / regionid are zero for window drop maps.
Definition at line 91 of file wm_dragdrop.cc.
References BLI_addtail(), dropboxes, wmDropBoxMap::dropboxes, wmDropBoxMap::idname, KMAP_MAX_NAME, LISTBASE_FOREACH, MEM_callocN(), wmDropBoxMap::regionid, wmDropBoxMap::spaceid, STREQLEN, and STRNCPY_UTF8.
Referenced by clip_dropboxes(), clip_init(), console_dropboxes(), console_main_region_init(), ed_default_handlers(), ED_dropbox_drop_extension(), ED_dropbox_drop_import_file(), ED_dropboxes_ui(), ED_keymap_screen(), file_dropboxes(), image_init(), blender::ed::space_node::node_dropboxes(), blender::ed::space_node::node_main_region_init(), blender::ed::outliner::outliner_dropboxes(), blender::ed::outliner::outliner_main_region_init(), blender::ed::vse::sequencer_dropboxes(), blender::ed::vse::sequencer_main_region_init(), blender::ed::vse::sequencer_preview_region_init(), text_dropboxes(), text_main_region_init(), view3d_dropboxes(), view3d_main_region_init(), and wm_window_ghostwindow_ensure().
Definition at line 358 of file wm_dragdrop.cc.
References wmDrag::imb, and wmDrag::imbuf_scale.
Referenced by ui_but_drag_start().
| void WM_event_drag_path_override_poin_data_with_space_file_paths | ( | const bContext * | C, |
| wmDrag * | drag ) |
Overrides the drag.poin event to include all selected files in the space file where the event started.
Definition at line 364 of file wm_dragdrop.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, C, CTX_wm_space_file(), ED_fileselect_selected_files_full_paths(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), wmDrag::poin, wmDrag::type, WM_drag_create_path_data(), WM_drag_data_free(), and WM_DRAG_PATH.
Referenced by ui_but_drag_start().
| void WM_event_drag_preview_icon | ( | wmDrag * | drag, |
| int | icon_id ) |
Definition at line 384 of file wm_dragdrop.cc.
References BLI_assert_msg, wmDrag::imb, and wmDrag::preview_icon_id.
Referenced by ui_but_drag_start().
| void WM_event_start_drag | ( | bContext * | C, |
| int | icon, | ||
| eWM_DragDataType | type, | ||
| void * | poin, | ||
| unsigned int | flags ) |
Start dragging immediately with the given data. Note that poin should be valid allocated and not on stack.
Definition at line 317 of file wm_dragdrop.cc.
References C, WM_drag_data_create(), and WM_event_start_prepared_drag().
Referenced by ghost_event_proc(), ui_but_drag_init(), ui_but_drag_start(), and UI_view_item_drag_start().
Invoke dragging using the given drag data.
Definition at line 309 of file wm_dragdrop.cc.
References BLI_addtail(), C, CTX_wm_manager(), wmWindowManager::runtime, and wm_dropbox_invoke().
Referenced by blender::ed::outliner::outliner_item_drag_drop_invoke(), ui_but_drag_start(), and WM_event_start_drag().
Definition at line 68 of file wm_dragdrop.cc.
Referenced by ed_default_handlers(), wm_dropbox_free(), wm_dropbox_invoke(), WM_dropbox_update_ot(), WM_dropboxmap_find(), WM_event_add_dropbox_handler(), and WM_event_remove_model_handler().