diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-12-13 23:44:54 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-03-12 00:43:51 +0100 |
| commit | 5d53e906d6f73ad9f9ae85a423a18f5814904bdb (patch) | |
| tree | 368dad6e07c5d6cdb04f691f3842d1e4cccf647e /src/wx/content_timeline_view.h | |
| parent | 50931fab031d9dcdba131cb07ddd13e3528ab697 (diff) | |
Split out TimelineView from ContentTimelineView.
Diffstat (limited to 'src/wx/content_timeline_view.h')
| -rw-r--r-- | src/wx/content_timeline_view.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/wx/content_timeline_view.h b/src/wx/content_timeline_view.h index 0f6eeae51..450d19df4 100644 --- a/src/wx/content_timeline_view.h +++ b/src/wx/content_timeline_view.h @@ -23,6 +23,7 @@ #define DCPOMATIC_CONTENT_TIMELINE_VIEW_H +#include "timeline_view.h" #include "lib/rect.h" #include "lib/dcpomatic_time.h" @@ -34,30 +35,22 @@ class ContentTimeline; /** @class ContentTimelineView * @brief Parent class for components of the content timeline (e.g. a piece of content or an axis). */ -class ContentTimelineView +class ContentTimelineView : public TimelineView<ContentTimeline> { public: explicit ContentTimelineView(ContentTimeline& t); virtual ~ContentTimelineView () = default; - ContentTimelineView(ContentTimelineView const&) = delete; - ContentTimelineView& operator=(ContentTimelineView const&) = delete; - - void paint (wxGraphicsContext* g, std::list<dcpomatic::Rect<int>> overlaps); - void force_redraw (); - - virtual dcpomatic::Rect<int> bbox () const = 0; + void paint(wxGraphicsContext* gc, std::list<dcpomatic::Rect<int>> overlaps) + { + _last_paint_bbox = bbox(); + do_paint(gc, overlaps); + } protected: - virtual void do_paint (wxGraphicsContext *, std::list<dcpomatic::Rect<int>> overlaps) = 0; + virtual void do_paint(wxGraphicsContext *, std::list<dcpomatic::Rect<int>> overlaps) = 0; - int time_x (dcpomatic::DCPTime t) const; int y_pos(int t) const; - - ContentTimeline& _timeline; - -private: - dcpomatic::Rect<int> _last_paint_bbox; }; |
