From a5c28bcb2ead34e921617711ebf94ffcb5d72878 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 23 May 2016 09:54:08 +0300 Subject: File/dir renames --- py/CMakeLists.txt | 4 ++-- py/pykmstest.cpp | 31 ------------------------------- py/pykmsutil.cpp | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 py/pykmstest.cpp create mode 100644 py/pykmsutil.cpp (limited to 'py') diff --git a/py/CMakeLists.txt b/py/CMakeLists.txt index f48ec2c..562a3cf 100644 --- a/py/CMakeLists.txt +++ b/py/CMakeLists.txt @@ -10,8 +10,8 @@ endif() include_directories(${PROJECT_SOURCE_DIR}/ext/pybind11/include) -add_library(pykms SHARED pykms.cpp pykmsbase.cpp pykmstest.cpp) -target_link_libraries(pykms kms++ kmstest ${LIBDRM_LIBRARIES}) +add_library(pykms SHARED pykms.cpp pykmsbase.cpp pykmsutil.cpp) +target_link_libraries(pykms kms++ kms++util ${LIBDRM_LIBRARIES}) # Don't add a 'lib' prefix to the shared library set_target_properties(pykms PROPERTIES PREFIX "") diff --git a/py/pykmstest.cpp b/py/pykmstest.cpp deleted file mode 100644 index 407330d..0000000 --- a/py/pykmstest.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include -#include "kmstest.h" - -namespace py = pybind11; - -using namespace kms; -using namespace std; - -void init_pykmstest(py::module &m) -{ - py::class_(m, "RGB") - .def(py::init<>()) - .def(py::init()) - .def(py::init()) - .def_property_readonly("rgb888", &RGB::rgb888) - .def_property_readonly("argb8888", &RGB::argb8888) - .def_property_readonly("abgr8888", &RGB::abgr8888) - .def_property_readonly("rgb565", &RGB::rgb565) - ; - - // Use lambdas to handle IMappedFramebuffer - m.def("draw_test_pattern", [](DumbFramebuffer& fb) { draw_test_pattern(fb); } ); - m.def("draw_color_bar", [](DumbFramebuffer& fb, int old_xpos, int xpos, int width) { - draw_color_bar(fb, old_xpos, xpos, width); - } ); - m.def("draw_rect", [](DumbFramebuffer& fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color) { - draw_rect(fb, x, y, w, h, color); - } ); -} diff --git a/py/pykmsutil.cpp b/py/pykmsutil.cpp new file mode 100644 index 0000000..407330d --- /dev/null +++ b/py/pykmsutil.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include "kmstest.h" + +namespace py = pybind11; + +using namespace kms; +using namespace std; + +void init_pykmstest(py::module &m) +{ + py::class_(m, "RGB") + .def(py::init<>()) + .def(py::init()) + .def(py::init()) + .def_property_readonly("rgb888", &RGB::rgb888) + .def_property_readonly("argb8888", &RGB::argb8888) + .def_property_readonly("abgr8888", &RGB::abgr8888) + .def_property_readonly("rgb565", &RGB::rgb565) + ; + + // Use lambdas to handle IMappedFramebuffer + m.def("draw_test_pattern", [](DumbFramebuffer& fb) { draw_test_pattern(fb); } ); + m.def("draw_color_bar", [](DumbFramebuffer& fb, int old_xpos, int xpos, int width) { + draw_color_bar(fb, old_xpos, xpos, width); + } ); + m.def("draw_rect", [](DumbFramebuffer& fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color) { + draw_rect(fb, x, y, w, h, color); + } ); +} -- cgit v1.2.3