diff --git a/doc/python/conf.py b/doc/python/conf.py index d843b10..a73f538 100644 --- a/doc/python/conf.py +++ b/doc/python/conf.py @@ -164,6 +164,7 @@ INPUT_PAGES = [ 'pages/api-conventions.rst', 'pages/changelog.rst', 'pages/credits.rst', + 'pages/developers.rst', '../../../magnum-examples/doc/python/examples.rst' ] diff --git a/doc/python/pages/changelog.rst b/doc/python/pages/changelog.rst index 8322670..3f503da 100644 --- a/doc/python/pages/changelog.rst +++ b/doc/python/pages/changelog.rst @@ -67,7 +67,8 @@ Changelog issues with shitty IDE indexers such as Eclipse, confusing these with Python's ```` - Minor performance fixes (see :gh:`mosra/magnum-bindings#10`, - :gh:`mosra/magnum-bindings#15`) + :gh:`mosra/magnum-bindings#15`, + :gh:`mosra/magnum-bindings#16`) Travis banned everyone from using their CI and so all Linux and macOS builds were migrated from Travis to Circle CI. See also :gh:`mosra/magnum#350` and :gh:`mosra/magnum#523`. diff --git a/doc/python/pages/developers.rst b/doc/python/pages/developers.rst index 7091704..1e33f9b 100644 --- a/doc/python/pages/developers.rst +++ b/doc/python/pages/developers.rst @@ -30,7 +30,14 @@ Developers Guide corrade magnum :summary: Checklists for developing new things in Magnum Python bindings - themselves + themselves. + +.. role:: cmake(code) + :language: cmake +.. role:: cpp(code) + :language: c++ +.. role:: py(code) + :language: py `Checklist for adding / removing bindings for a library`_ ========================================================= diff --git a/src/python/magnum/gl.cpp b/src/python/magnum/gl.cpp index 47c9567..4d12838 100644 --- a/src/python/magnum/gl.cpp +++ b/src/python/magnum/gl.cpp @@ -364,10 +364,10 @@ void gl(py::module_& m) { corrade::enumOperators(contextDetectedDriver); context - .def_property_readonly_static("has_current", [](py::object) { + .def_property_readonly_static("has_current", [](const py::object&) { return GL::Context::hasCurrent(); }, "Whether there is any current context") - .def_property_readonly_static("current", [](py::object) { + .def_property_readonly_static("current", [](const py::object&) { if(!GL::Context::hasCurrent()) { PyErr_SetString(PyExc_RuntimeError, "no current context"); throw py::error_already_set{}; @@ -901,7 +901,7 @@ void gl(py::module_& m) { .def(py::init(), "Constructor", py::arg("primitive")) .def_property_readonly("id", &GL::Mesh::id, "OpenGL vertex array ID") .def_property("primitive", &GL::Mesh::primitive, - [](GL::Mesh& self, py::object primitive) { + [](GL::Mesh& self, const py::object &primitive) { if(py::isinstance(primitive)) self.setPrimitive(py::cast(primitive)); else if(py::isinstance(primitive)) @@ -1100,10 +1100,10 @@ void gl(py::module_& m) { #endif /** @todo FFS why do I have to pass the class as first argument?! */ - .def_property_static("clear_color", nullptr, [](py::object, const Color4& color) { + .def_property_static("clear_color", nullptr, [](const py::object&, const Color4& color) { GL::Renderer::setClearColor(color); }, "Set clear color") - .def_property_readonly_static("error", [](py::object) { + .def_property_readonly_static("error", [](const py::object&) { return GL::Renderer::error(); }, "Error status"); } diff --git a/src/python/magnum/platform/cgl.cpp b/src/python/magnum/platform/cgl.cpp index 3976a04..2832942 100644 --- a/src/python/magnum/platform/cgl.cpp +++ b/src/python/magnum/platform/cgl.cpp @@ -63,7 +63,7 @@ void cgl(py::module_& m) { /* The base doesn't have a virtual destructor because in C++ it's never deleted through a pointer to the base. Here we need it, though. */ - virtual ~PyWindowlessApplication() {} + virtual ~PyWindowlessApplication() = default; }; py::class_> windowlessGlxApplication{m, "WindowlessApplication", "Windowless CGL application"}; diff --git a/src/python/magnum/platform/egl.cpp b/src/python/magnum/platform/egl.cpp index f5d2afa..4f45b0a 100644 --- a/src/python/magnum/platform/egl.cpp +++ b/src/python/magnum/platform/egl.cpp @@ -63,7 +63,7 @@ void egl(py::module_& m) { /* The base doesn't have a virtual destructor because in C++ it's never deleted through a pointer to the base. Here we need it, though. */ - virtual ~PyWindowlessApplication() {} + virtual ~PyWindowlessApplication() = default; }; py::class_> windowlessEglApplication{m, "WindowlessApplication", "Windowless EGL application"}; diff --git a/src/python/magnum/platform/glfw.cpp b/src/python/magnum/platform/glfw.cpp index ecb47bc..d82d487 100644 --- a/src/python/magnum/platform/glfw.cpp +++ b/src/python/magnum/platform/glfw.cpp @@ -64,7 +64,7 @@ void glfw(py::module_& m) { /* The base doesn't have a virtual destructor because in C++ it's never deleted through a pointer to the base. Here we need it, though. */ - virtual ~PublicizedApplication() {} + virtual ~PublicizedApplication() = default; }; struct PyApplication: PublicizedApplication { diff --git a/src/python/magnum/platform/glx.cpp b/src/python/magnum/platform/glx.cpp index ba21b7b..b08ef6b 100644 --- a/src/python/magnum/platform/glx.cpp +++ b/src/python/magnum/platform/glx.cpp @@ -63,7 +63,7 @@ void glx(py::module_& m) { /* The base doesn't have a virtual destructor because in C++ it's never deleted through a pointer to the base. Here we need it, though. */ - virtual ~PyWindowlessApplication() {} + virtual ~PyWindowlessApplication() = default; }; py::class_> windowlessGlxApplication{m, "WindowlessApplication", "Windowless GLX application"}; diff --git a/src/python/magnum/platform/sdl2.cpp b/src/python/magnum/platform/sdl2.cpp index 7d3de41..218e364 100644 --- a/src/python/magnum/platform/sdl2.cpp +++ b/src/python/magnum/platform/sdl2.cpp @@ -64,7 +64,7 @@ void sdl2(py::module_& m) { /* The base doesn't have a virtual destructor because in C++ it's never deleted through a pointer to the base. Here we need it, though. */ - virtual ~PublicizedApplication() {} + virtual ~PublicizedApplication() = default; }; struct PyApplication: PublicizedApplication { diff --git a/src/python/magnum/platform/wgl.cpp b/src/python/magnum/platform/wgl.cpp index 23d3bc8..73669e4 100644 --- a/src/python/magnum/platform/wgl.cpp +++ b/src/python/magnum/platform/wgl.cpp @@ -63,7 +63,7 @@ void wgl(py::module_& m) { /* The base doesn't have a virtual destructor because in C++ it's never deleted through a pointer to the base. Here we need it, though. */ - virtual ~PyWindowlessApplication() {} + virtual ~PyWindowlessApplication() = default; }; py::class_> windowlessWglApplication{m, "WindowlessApplication", "Windowless WGL application"};