diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-05-09 17:59:10 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-05-10 23:43:55 +0100 |
| commit | fc4f75abd3b062e8297990a482e77e32458cd169 (patch) | |
| tree | bb562bd9ec330f0c5973fd6e796bdd19adfd4ac1 /src | |
| parent | f9db80a8e61cedd001d10b555d0798798a773668 (diff) | |
Tidy up sized emissions from VideoView.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/film_viewer.cc | 5 | ||||
| -rw-r--r-- | src/wx/gl_video_view.cc | 1 | ||||
| -rw-r--r-- | src/wx/simple_video_view.cc | 1 | ||||
| -rw-r--r-- | src/wx/video_view.h | 3 |
4 files changed, 7 insertions, 3 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 4066710e7..c83db56de 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -106,9 +106,8 @@ FilmViewer::FilmViewer (wxWindow* p) break; } - /* XXX: maybe this should be proxied through the VideoView */ - _video_view->get()->Bind (wxEVT_SIZE, boost::bind (&FilmViewer::video_view_sized, this)); - _timer.Bind (wxEVT_TIMER, boost::bind (&FilmViewer::timer, this)); + _video_view->Sized.connect (boost::bind(&FilmViewer::video_view_sized, this)); + _timer.Bind (wxEVT_TIMER, boost::bind(&FilmViewer::timer, this)); set_film (shared_ptr<Film> ()); diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index f5b8ef68a..d1e7c7326 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -41,6 +41,7 @@ GLVideoView::GLVideoView (wxWindow *parent) _canvas = new wxGLCanvas (parent, wxID_ANY, 0, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE); _context = new wxGLContext (_canvas); _canvas->Bind (wxEVT_PAINT, boost::bind(&GLVideoView::paint, this, _1)); + _canvas->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized))); glGenTextures (1, &_id); glBindTexture (GL_TEXTURE_2D, _id); diff --git a/src/wx/simple_video_view.cc b/src/wx/simple_video_view.cc index 6435e0226..d0b18d421 100644 --- a/src/wx/simple_video_view.cc +++ b/src/wx/simple_video_view.cc @@ -40,6 +40,7 @@ SimpleVideoView::SimpleVideoView (FilmViewer* viewer, wxWindow* parent) _panel->SetBackgroundColour (*wxBLACK); _panel->Bind (wxEVT_PAINT, boost::bind (&SimpleVideoView::paint, this)); + _panel->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized))); } void diff --git a/src/wx/video_view.h b/src/wx/video_view.h index f4dec9c68..060d982f7 100644 --- a/src/wx/video_view.h +++ b/src/wx/video_view.h @@ -22,6 +22,7 @@ #define DCPOMATIC_VIDEO_VIEW_H #include <boost/shared_ptr.hpp> +#include <boost/signals2.hpp> class Image; class wxWindow; @@ -33,6 +34,8 @@ public: virtual void set_image (boost::shared_ptr<const Image> image) = 0; virtual wxWindow* get () const = 0; + + boost::signals2::signal<void()> Sized; }; #endif |
