9 #include <pybind11/embed.h>
10 #include <pybind11/pybind11.h>
11 #include <pybind11/stl.h>
15 namespace py = pybind11;
42 template <
typename T> std::vector<T>
parsePayload(py::list payload);
50 template <Event event>
void processEvent(py::list payload);
57 void setRenderer(std::shared_ptr<Renderer> renderer);
std::vector< T > parsePayload(py::list payload)
Template function to parse a payload from a Python list into a C++ vector.
Definition: Events.cpp:13
Event
Enum representing different types of events that can be processed in Python.
Definition: Events.hpp:22
@ LOG_SUCCESS
Log a success message.
Definition: Events.hpp:25
@ DRAW_CLEAR
Clear the renderer.
Definition: Events.hpp:31
@ DRAW_RECTANGLE
Draw a rectangle using the renderer.
Definition: Events.hpp:30
@ DRAW_LINE
Draw a line using the renderer.
Definition: Events.hpp:28
@ LOG_INFO
Log an informational message.
Definition: Events.hpp:23
@ DRAW_CIRCLE
Draw a circle using the renderer.
Definition: Events.hpp:29
@ LOG_VERBOSE
Log a verbose message.
Definition: Events.hpp:26
@ TOTAL_EVENTS
The total number of events.
Definition: Events.hpp:33
@ LOG_ERROR
Log an error message.
Definition: Events.hpp:24
void processEvent(py::list payload)
Function to process an event of a specific type.
Definition: Events.cpp:28
void setRenderer(std::shared_ptr< Renderer > renderer)
Set the renderer to be used for drawing in Python.
Definition: Events.cpp:11