timeline_area.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* timeline_area.h - advanced timeline
  2. * Copyright (C) 2017 caryoscelus
  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. */
  17. #ifndef STUDIO_WIDGETS_TIMELINE_AREA_H_642C9BBC_A699_5EA7_99D3_EDF15CA95ECD
  18. #define STUDIO_WIDGETS_TIMELINE_AREA_H_642C9BBC_A699_5EA7_99D3_EDF15CA95ECD
  19. #include <QGraphicsView>
  20. #include <core/std/memory.h>
  21. #include <core/std/map.h>
  22. #include <core/std/vector.h>
  23. #include <canvas/abstract_canvas.h>
  24. #include <canvas/registry.h>
  25. class QGraphicsScene;
  26. class QMenu;
  27. namespace rainynite::studio {
  28. class TimelineEditor;
  29. class TimelineArea : public AbstractCanvas {
  30. public:
  31. explicit TimelineArea(QWidget* parent = nullptr);
  32. virtual ~TimelineArea();
  33. void contextMenuEvent(QContextMenuEvent* event) override;
  34. void zoom_time_by(double factor);
  35. void add_misc_editor(shared_ptr<AbstractCanvasEditor> editor);
  36. private:
  37. vector<shared_ptr<AbstractCanvasEditor>> misc_editors;
  38. unique_ptr<QMenu> context_menu;
  39. };
  40. REGISTER_CANVAS(TimelineArea);
  41. } // namespace rainynite::studio
  42. #endif