editor_map_component.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Flexlay - A Generic 2D Game Editor
  2. // Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. #ifndef HEADER_FLEXLAY_EDITOR_MAP_COMPONENT_HPP
  17. #define HEADER_FLEXLAY_EDITOR_MAP_COMPONENT_HPP
  18. #include <ClanLib/GUI/component.h>
  19. #include "../workspace.hpp"
  20. class Scrollbar;
  21. class EditorMapComponentImpl;
  22. /** Object which represents a level, quirled together with the GUI
  23. stuff */
  24. class EditorMapComponent : public CL_Component
  25. {
  26. private:
  27. static EditorMapComponent* current_;
  28. protected:
  29. virtual ~EditorMapComponent();
  30. public:
  31. static EditorMapComponent* current() { return current_; }
  32. EditorMapComponent(const CL_Rect& rect, CL_Component* parent);
  33. Workspace get_workspace() const;
  34. void set_workspace(Workspace m);
  35. void set_zoom(float z);
  36. void zoom_to(CL_Rectf rect);
  37. void zoom_out(CL_Point pos);
  38. void zoom_in (CL_Point pos);
  39. void move_to(int x, int y);
  40. void move_to_x(float x);
  41. void move_to_y(float y);
  42. CL_Signal_v2<int, int>& sig_on_key(const std::string& str);
  43. CL_Pointf screen2world(const CL_Point& pos);
  44. CL_Rectf get_clip_rect();
  45. GraphicContextState& get_gc_state();
  46. private:
  47. std::shared_ptr<EditorMapComponentImpl> impl;
  48. };
  49. #endif
  50. /* EOF */