BsScriptOSDropTarget.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsScriptObject.h"
  4. #include "BsRect2I.h"
  5. namespace BansheeEngine
  6. {
  7. class BS_SCR_BED_EXPORT ScriptOSDropTarget : public ScriptObject <ScriptOSDropTarget>
  8. {
  9. public:
  10. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "OSDropTarget")
  11. private:
  12. ScriptEditorWindow* mParent;
  13. OSDropTarget* mDropTarget;
  14. Rect2I mParentArea;
  15. Rect2I mArea;
  16. bool mIsDestroyed;
  17. HEvent mDropTargetEnterConn;
  18. HEvent mDropTargetMoveConn;
  19. HEvent mDropTargetLeaveConn;
  20. HEvent mDropTargetDroppedConn;
  21. HEvent mWidgetParentChangedConn;
  22. HEvent mWidgetResizedConn;
  23. ScriptOSDropTarget(MonoObject* instance, ScriptEditorWindow* parent);
  24. ~ScriptOSDropTarget();
  25. void destroy();
  26. void setDropTarget(const RenderWindowPtr& parentWindow, INT32 x, INT32 y, UINT32 width, UINT32 height);
  27. void setBounds(const Rect2I& bounds);
  28. void widgetParentChanged(EditorWidgetContainer* parent);
  29. void widgetResized(UINT32 width, UINT32 height);
  30. EditorWidgetBase* getParentWidget() const;
  31. Rect2I getDropTargetArea() const;
  32. typedef void(__stdcall *OnEnterThunkDef) (MonoObject*, INT32, INT32, MonoException**);
  33. typedef void(__stdcall *OnMoveDef) (MonoObject*, INT32, INT32, MonoException**);
  34. typedef void(__stdcall *OnLeaveDef) (MonoObject*, MonoException**);
  35. typedef void(__stdcall *OnDropThunkDef) (MonoObject*, INT32, INT32, MonoException**);
  36. static void internal_CreateInstance(MonoObject* instance, ScriptEditorWindow* editorWindow);
  37. static void internal_Destroy(ScriptOSDropTarget* nativeInstance);
  38. static void internal_SetBounds(ScriptOSDropTarget* nativeInstance, Rect2I bounds);
  39. static MonoArray* internal_GetFilePaths(ScriptOSDropTarget* nativeInstance);
  40. static void dropTargetDragEnter(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
  41. static void dropTargetDragMove(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
  42. static void dropTargetDragLeave(ScriptOSDropTarget* thisPtr);
  43. static void dropTargetDragDropped(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
  44. static OnEnterThunkDef onEnterThunk;
  45. static OnMoveDef onMoveThunk;
  46. static OnLeaveDef onLeaveThunk;
  47. static OnDropThunkDef onDropThunk;
  48. };
  49. }