| 268 | } |
| 269 | |
| 270 | inline bool annotate(std::string annotation, double x, double y) |
| 271 | { |
| 272 | detail::_interpreter::get(); |
| 273 | |
| 274 | PyObject * xy = PyTuple_New(2); |
| 275 | PyObject * str = PyString_FromString(annotation.c_str()); |
| 276 | |
| 277 | PyTuple_SetItem(xy,0,PyFloat_FromDouble(x)); |
| 278 | PyTuple_SetItem(xy,1,PyFloat_FromDouble(y)); |
| 279 | |
| 280 | PyObject* kwargs = PyDict_New(); |
| 281 | PyDict_SetItemString(kwargs, "xy", xy); |
| 282 | |
| 283 | PyObject* args = PyTuple_New(1); |
| 284 | PyTuple_SetItem(args, 0, str); |
| 285 | |
| 286 | PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_annotate, args, kwargs); |
| 287 | |
| 288 | Py_DECREF(args); |
| 289 | Py_DECREF(kwargs); |
| 290 | |
| 291 | if(res) Py_DECREF(res); |
| 292 | |
| 293 | return res; |
| 294 | } |
| 295 | |
| 296 | namespace detail { |
| 297 |
nothing calls this directly
no outgoing calls
no test coverage detected