BsDropTarget.cpp 797 B

12345678910111213141516171819202122232425262728293031
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "Platform/BsDropTarget.h"
  4. namespace bs
  5. {
  6. void DropTarget::_clear()
  7. {
  8. mFileList.clear();
  9. }
  10. bool DropTarget::_isInside(const Vector2I& pos) const
  11. {
  12. return mArea.contains(pos);
  13. }
  14. void DropTarget::_setFileList(const Vector<Path>& fileList)
  15. {
  16. _clear();
  17. mDropType = DropTargetType::FileList;
  18. mFileList = fileList;
  19. }
  20. SPtr<DropTarget> DropTarget::create(const RenderWindow* window, const Rect2I& area)
  21. {
  22. DropTarget* target = new (bs_alloc<DropTarget>()) DropTarget(window, area);
  23. return bs_shared_ptr(target);
  24. }
  25. }