diff options
-rw-r--r-- | py/pykms/pykmsbase.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp index 382ef6f..b3ada1b 100644 --- a/py/pykms/pykmsbase.cpp +++ b/py/pykms/pykmsbase.cpp @@ -148,6 +148,9 @@ void init_pykmsbase(py::module& m) .def("offset", &Framebuffer::offset) .def("fd", &Framebuffer::prime_fd) + .def("flush", (void (Framebuffer::*)(void)) & Framebuffer::flush) + .def("flush", (void (Framebuffer::*)(uint32_t x, uint32_t y, uint32_t width, uint32_t height)) & Framebuffer::flush) + // XXX pybind11 doesn't support a base object (DrmObject) with custom holder-type, // and a subclass with standard holder-type. // So we just copy the DrmObject members here. @@ -161,6 +164,7 @@ void init_pykmsbase(py::module& m) py::keep_alive<1, 2>()) // Keep Card alive until this is destructed .def(py::init<Card&, uint32_t, uint32_t, PixelFormat>(), py::keep_alive<1, 2>()) // Keep Card alive until this is destructed + .def("__repr__", [](const DumbFramebuffer& o) { return "<pykms.DumbFramebuffer " + to_string(o.id()) + ">"; }) ; py::class_<DmabufFramebuffer, Framebuffer>(m, "DmabufFramebuffer") @@ -168,6 +172,7 @@ void init_pykmsbase(py::module& m) py::keep_alive<1, 2>()) // Keep Card alive until this is destructed .def(py::init<Card&, uint32_t, uint32_t, PixelFormat, vector<int>, vector<uint32_t>, vector<uint32_t>>(), py::keep_alive<1, 2>()) // Keep Card alive until this is destructed + .def("__repr__", [](const DmabufFramebuffer& o) { return "<pykms.DmabufFramebuffer " + to_string(o.id()) + ">"; }) ; py::enum_<PixelFormat>(m, "PixelFormat") |