EditorToyTool.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _EDITORTOYTOOL_H_
  2. #define _EDITORTOYTOOL_H_
  3. #include "sim/simBase.h"
  4. #include "2d/editorToy/EditorToySceneWindow.h"
  5. #include "collection/undo.h"
  6. #include "debug/profiler.h"
  7. #include "2d/scene/Scene.h"
  8. #include "2d/sceneobject/SceneObject.h"
  9. class EditorToyTool : public SimObject
  10. {
  11. typedef SimObject Parent;
  12. protected:
  13. EditorToySceneWindow* mEditorToy;
  14. bool mUseMouseDown;
  15. bool mUseMouseUp;
  16. bool mUseMouseMove;
  17. bool mUseRightMouseDown;
  18. bool mUseRightMouseUp;
  19. bool mUseRightMouseMove;
  20. bool mUseMiddleMouseDown;
  21. bool mUseMiddleMouseUp;
  22. bool mUseMiddleMouseMove;
  23. bool mUseKeyInput;
  24. public:
  25. EditorToyTool();
  26. ~EditorToyTool();
  27. bool onAdd();
  28. void onRemove();
  29. virtual void onActivate(EditorToySceneWindow* sceneWin);
  30. virtual void onDeactivate();
  31. virtual void onRelinquishObj(SceneObject* obj);
  32. //
  33. virtual bool onTouchMove(const GuiEvent &);
  34. virtual bool onTouchDown(const GuiEvent &);
  35. virtual bool onTouchDragged(const GuiEvent &);
  36. virtual bool onTouchUp(const GuiEvent &);
  37. //
  38. virtual bool onRightMouseDown(const GuiEvent &);
  39. virtual bool onRightMouseDragged(const GuiEvent &);
  40. virtual bool onRightMouseUp(const GuiEvent &);
  41. //
  42. virtual bool onMiddleMouseDown(const GuiEvent &);
  43. virtual bool onMiddleMouseDragged(const GuiEvent &);
  44. virtual bool onMiddleMouseUp(const GuiEvent &);
  45. virtual bool onInputEvent(const GuiEvent &);
  46. virtual void onRender() {};
  47. DECLARE_CONOBJECT(EditorToyTool);
  48. };
  49. #endif // !_EDITORTOYTOOL_H_