From c6f964425cdec25e3d0ecd0054d398d3420fdfeb Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 2 Jan 2017 16:42:07 +0200 Subject: py: Expose MappedFramebuffer width and height properties The property getters are defined as pure virtual functions in the MappedFramebuffer class. Expose the Python properties as part of the bindings for that class to make them available for all classes inheriting from MappedFramebuffer. Signed-off-by: Laurent Pinchart --- py/pykmsbase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'py/pykmsbase.cpp') diff --git a/py/pykmsbase.cpp b/py/pykmsbase.cpp index 9f20fdb..5247158 100644 --- a/py/pykmsbase.cpp +++ b/py/pykmsbase.cpp @@ -91,6 +91,8 @@ void init_pykmsbase(py::module &m) ; py::class_(m, "MappedFramebuffer", py::base()) + .def_property_readonly("width", &MappedFramebuffer::width) + .def_property_readonly("height", &MappedFramebuffer::height) ; py::class_(m, "DumbFramebuffer", py::base()) @@ -98,8 +100,6 @@ void init_pykmsbase(py::module &m) py::keep_alive<1, 2>()) // Keep Card alive until this is destructed .def(py::init(), py::keep_alive<1, 2>()) // Keep Card alive until this is destructed - .def_property_readonly("width", &DumbFramebuffer::width) - .def_property_readonly("height", &DumbFramebuffer::height) ; py::enum_(m, "PixelFormat") -- cgit v1.2.3