23#include "RConfigure.h"
43 if (!PyArg_ParseTuple(args,
"UU:RegisterConverterAlias", &
name, &target)) {
47 const char *nameStr = PyUnicode_AsUTF8AndSize(
name,
nullptr);
52 const char *targetStr = PyUnicode_AsUTF8AndSize(target,
nullptr);
67 if (!PyArg_ParseTuple(args,
"UU:RegisterExecutorAlias", &
name, &target)) {
71 const char *nameStr = PyUnicode_AsUTF8AndSize(
name,
nullptr);
76 const char *targetStr = PyUnicode_AsUTF8AndSize(target,
nullptr);
125 other.fObject =
nullptr;
131 other.fObject =
nullptr;
140 PyArg_ParseTuple(args,
"O:PyObjRefCounterAsStdAny", &
object);
158 if (PyByteArray_CheckExact(pyobject)) {
159 buf = PyByteArray_AsString(pyobject);
164 if (PyObject_CheckBuffer(pyobject)) {
166 if (PySequence_Check(pyobject) && PySequence_Size(pyobject) == 0)
170 if (PyObject_GetBuffer(pyobject, &view, PyBUF_SIMPLE) == 0) {
171 if (view.buf && view.len > 0)
173 PyBuffer_Release(&view);
185 "Add a custom pickling mechanism for Cppyy Python proxy objects"},
187 "Allow to access branches as tree attributes"},
189 "Cast the void* returned by TClass::DynamicCast to the right type"},
191 "Fully enable the use of TTree::Branch from Python"},
193 "Add pretty printing pythonization"},
195 "Initialize interactive ROOT use from Python"},
197 "Install an input hook to process GUI events"},
199 "Deserialize a pickled object"},
200 {
"JupyROOTExecutor", (PyCFunction)
JupyROOTExecutor, METH_VARARGS,
"Create JupyROOTExecutor"},
201 {
"JupyROOTDeclarer", (PyCFunction)
JupyROOTDeclarer, METH_VARARGS,
"Create JupyROOTDeclarer"},
203 "Clear JupyROOTExecutorHandler"},
205 "Create JupyROOTExecutorHandler"},
207 "Poll JupyROOTExecutorHandler"},
209 "End capture JupyROOTExecutorHandler"},
211 "Init capture JupyROOTExecutorHandler"},
213 "Get stdout JupyROOTExecutorHandler"},
215 "Get stderr JupyROOTExecutorHandler"},
217 "Destruct JupyROOTExecutorHandler"},
219 "Register a custom converter that is a reference to an existing converter"},
221 "Register a custom executor that is a reference to an existing executor"},
223 "Wrap a reference count to any Python object in a std::any for resource management in C++"},
224 {NULL, NULL, 0, NULL}};
230#define GETSTATE(m) ((struct module_state *)PyModule_GetState(m))
244static struct PyModuleDef
moduledef = {PyModuleDef_HEAD_INIT,
"libROOTPythonizations", NULL,
PyObject * JupyROOTExecutorHandler_Ctor(PyObject *, PyObject *)
PyObject * JupyROOTDeclarer(PyObject *, PyObject *args)
PyObject * JupyROOTExecutorHandler_GetStdout(PyObject *, PyObject *)
PyObject * JupyROOTExecutor(PyObject *, PyObject *args)
PyObject * JupyROOTExecutorHandler_EndCapture(PyObject *, PyObject *)
PyObject * JupyROOTExecutorHandler_Poll(PyObject *, PyObject *)
PyObject * JupyROOTExecutorHandler_Clear(PyObject *, PyObject *)
PyObject * JupyROOTExecutorHandler_GetStderr(PyObject *, PyObject *)
PyObject * JupyROOTExecutorHandler_InitCapture(PyObject *, PyObject *)
PyObject * JupyROOTExecutorHandler_Dtor(PyObject *, PyObject *)
static struct PyModuleDef moduledef
PyObject * PyInit_libROOTPythonizations()
Initialization of extension module libROOTPythonizations.
static int rootmodule_clear(PyObject *m)
static int rootmodule_traverse(PyObject *m, visitproc visit, void *arg)
static PyMethodDef gPyROOTMethods[]
PyObjRefCounter(PyObject *object)
PyObjRefCounter & operator=(PyObjRefCounter &&other)
void Reset(PyObject *object)
PyObjRefCounter(const PyObjRefCounter &other)
PyObjRefCounter(PyObjRefCounter &&other)
PyObjRefCounter & operator=(const PyObjRefCounter &other)
static PyObject * InstallGUIEventInputHook(PyObject *self, PyObject *args)
Install a method hook for sending events to the GUI.
static PyObject * InitApplication(PyObject *self, PyObject *args)
Initialize an RPyROOTApplication.
CPYCPPYY_EXTERN bool RegisterExecutorAlias(const std::string &name, const std::string &target)
CPYCPPYY_EXTERN PyObject * Instance_FromVoidPtr(void *addr, const std::string &classname, bool python_owns=false)
CPYCPPYY_EXTERN bool RegisterConverterAlias(const std::string &name, const std::string &target)
PyObject * PyObjRefCounterAsStdAny(PyObject *, PyObject *args)
PyObject * BranchPyz(PyObject *self, PyObject *args)
Add pythonization for TTree::Branch.
PyObject * AddCPPInstancePickling(PyObject *self, PyObject *args)
Set reduce attribute for CPPInstance objects.
void GetBuffer(PyObject *pyobject, void *&buf)
PyObject * CPPInstanceExpand(PyObject *self, PyObject *args)
Deserialize pickled objects.
PyObject * AddTClassDynamicCastPyz(PyObject *self, PyObject *args)
Add pythonization for TClass::DynamicCast.
PyObject * RegisterExecutorAlias(PyObject *, PyObject *args)
PyObject * GetBranchAttr(PyObject *self, PyObject *args)
PyObject * RegisterConverterAlias(PyObject *, PyObject *args)
PyObject * AddPrettyPrintingPyz(PyObject *self, PyObject *args)
Add pretty printing pythonization.