Namespace sh::scripting::pythoninterop¶
-
namespace
sh::scripting
::
pythoninterop
Interoperation layer between the Shallot core (C++) and Python plugins.
Typedefs
-
using
StringMap
= QMap<QString, V>
Functions
-
PyObject *
getPyNone
()
-
bool
isPyNone
(PyObject *o)
-
void *
getPointerFromShallotPyObject
(PyObject *o)
-
PyObject *
PyTupleGetItem
(PyObject *o, int itm)
-
PyObject *
PyListGetItem
(PyObject *o, int itm)
-
int
PyTupleCount
(PyObject *o)
-
int
PyListCount
(PyObject *o)
-
bool
PyIsTuple
(PyObject *o)
-
bool
PyIsList
(PyObject *o)
-
bool
PyIsUnicode
(PyObject *o)
-
bool
PyIsBytes
(PyObject *o)
-
bool
PyIsDict
(PyObject *o)
-
bool
PyIsBool
(PyObject *o)
-
bool
PyIsFloat
(PyObject *o)
-
bool
PyIsLong
(PyObject *o)
-
void
PyIncRef
(PyObject *o)
-
void
PyDecRef
(PyObject *o)
-
void
PyTupleSetItem
(PyObject *o, int itm, PyObject *val)
-
PyObject *
PyObjectCall
(PyObject *fct, PyObject *args)
-
PyObject *
PyTupleNew
(int cnt)
-
PyObject *
PyDictNew
()
-
PyObject *
PyDictKeys
(PyObject *o)
-
PyObject *
PyDictGetItem
(PyObject *dict, PyObject *key)
-
void
PyDictSetItem
(PyObject *dict, PyObject *key, PyObject *val)
-
bool
PythonToC_ExecuteGuarded
(std::function<void()> fct)
-
void
invokePython
(std::function<void()> fct)
-
template<int
pos
, class ...Args
>
class_PyObjectFunctionToNativeFunction_SetTupleValue
- #include <pythonscriptinterpreter.h>
-
template<int
pos
>
class_PyObjectFunctionToNativeFunction_SetTupleValue
<pos> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
void
setTupleValue
(PyObject*)
-
void
-
template<int
pos
, classArg
, class ...Args
>
class_PyObjectFunctionToNativeFunction_SetTupleValue
<pos, Arg, Args...> - #include <pythonscriptinterpreter.h>
-
template<int
pos
, class ...Args
>
class_PyObjectFunctionToNativeFunction_TupleValueSetter
- #include <pythonscriptinterpreter.h>
This class is a workaround for gcc<4.9 bug 55914. It was not able to call …::setTupleValue directly from within the invokePython lambda
Public Functions
-
_PyObjectFunctionToNativeFunction_TupleValueSetter
(Args... args)
-
void
set
(PyObject *tuple)
Private Members
-
std::function<void(PyObject*)>
_set
Private Static Functions
-
void
__set
(Args... args, PyObject *tuple)
-
-
template<typename
T
, T>
structCallNativeHelperMethodWithPyObjectArguments
- #include <pythonscriptinterpreter.h>
-
template<typename T, typename R, typename ... Args, R(*)(T *, Args...) MF> CallNativeHelperMethodWithPyObjectArguments< R(*)(T *, Args...), MF >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
call
(PyObject *a, PyObject *b)
-
PyObject *
-
template<typename T, typename ... Args, void(*)(T *, Args...) MF> CallNativeHelperMethodWithPyObjectArguments< void(*)(T *, Args...), MF >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
call
(PyObject *a, PyObject *b)
-
PyObject *
-
template<typename
T
, T>
structCallNativeMethodWithPyObjectArguments
- #include <pythonscriptinterpreter.h>
-
template<typename T, typename R, typename ... Args, R(T::*)(Args...) const MF> *)(Args...) const, MF >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
call
(PyObject *a, PyObject *b)
-
PyObject *
-
template<typename T, typename R, typename ... Args, R(T::*)(Args...) MF> *)(Args...), MF >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
call
(PyObject *a, PyObject *b)
-
PyObject *
-
template<typename T, typename ... Args, void(T::*)(Args...) const MF> *)(Args...) const, MF >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
call
(PyObject *a, PyObject *b)
-
PyObject *
-
template<typename T, typename ... Args, void(T::*)(Args...) MF> *)(Args...), MF >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
call
(PyObject *a, PyObject *b)
-
PyObject *
-
class
Converters
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
QString
getStringFromPyObject
(PyObject *o)
-
QVariant
getVariantFromPyObject
(PyObject *o)
-
int
getIntFromPyObject
(PyObject *o)
-
double
getDoubleFromPyObject
(PyObject *o)
-
qint64
getInt64FromPyObject
(PyObject *o)
-
quint64
getUint64FromPyObject
(PyObject *o)
-
bool
getBoolFromPyObject
(PyObject *o)
-
QByteArray
getByteArrayFromPyObject
(PyObject *o)
-
void *
getPointerFromPyObject
(PyObject *o)
-
PyObject *
getPyObjectFromString
(QString v)
-
PyObject *
getPyObjectFromVariant
(QVariant v)
-
PyObject *
getPyObjectFromInt
(int v)
-
PyObject *
getPyObjectFromDouble
(double v)
-
PyObject *
getPyObjectFromInt64
(qint64 v)
-
PyObject *
getPyObjectFromUint64
(quint64 v)
-
PyObject *
getPyObjectFromBool
(bool v)
-
PyObject *
getPyObjectFromByteArray
(QByteArray v)
-
QString
-
template<int
mode
, uintN
>
structFunctionBindTuple
- #include <pythonscriptinterpreter.h>
-
template<>
structFunctionBindTuple
<0, 0> - #include <pythonscriptinterpreter.h>
-
template<uint
N
>
structFunctionBindTuple
<0, N> - #include <pythonscriptinterpreter.h>
-
template<>
structFunctionBindTuple
<1, 0> - #include <pythonscriptinterpreter.h>
-
template<uint
N
>
structFunctionBindTuple
<1, N> - #include <pythonscriptinterpreter.h>
-
template<class
V
>
classNativeToPyObject
- #include <pythonscriptinterpreter.h>
Helps to return a Python object from a native c++ value (with reference ownership)
-
template<>
classNativeToPyObject
<bool> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(bool v)
-
PyObject *
-
template<>
classNativeToPyObject
<double> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(double v)
-
PyObject *
-
template<>
classNativeToPyObject
<int> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(int v)
-
PyObject *
-
template<>
classNativeToPyObject
<QByteArray> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(QByteArray v)
-
PyObject *
-
template<>
classNativeToPyObject
<qint64> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(qint64 v)
-
PyObject *
-
template<typename
V
>
classNativeToPyObject
<QList<V>> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(QList<V> v)
-
PyObject *
-
template<typename
V
>
classNativeToPyObject
<QMap<QString, V>> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(QMap<QString, V> v)
-
PyObject *
-
template<>
classNativeToPyObject
<QString> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(QString v)
-
PyObject *
-
template<>
classNativeToPyObject
<quint64> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(quint64 v)
-
PyObject *
-
template<>
classNativeToPyObject
<QVariant> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(QVariant v)
-
PyObject *
-
template<class V> shared_ptr< const V > >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
template<class V> shared_ptr< V > >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
template<class
V
>
classNativeToPyObject
<V*> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
PyObject *
toPyObject
(V *v)
-
PyObject *
-
template<class
R
, class ...Args
>
classPyObjectFunctionToNativeFunction
- #include <pythonscriptinterpreter.h>
-
template<class ...
Args
>
classPyObjectFunctionToNativeFunction
<void, Args...> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
std::function<void(Args...)>
toNativeFunction
(PyObject *self, PyObject *fct)
-
std::function<void(Args...)>
-
template<class
V
>
classPyObjectToNative
- #include <pythonscriptinterpreter.h>
Helps to return a c++ value from a Python object (borrows the reference)
-
template<>
classPyObjectToNative
<bool> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
bool
toNative
(PyObject*, PyObject *o)
-
bool
-
template<>
classPyObjectToNative
<double> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
double
toNative
(PyObject*, PyObject *o)
-
double
-
template<>
classPyObjectToNative
<int> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
int
toNative
(PyObject*, PyObject *o)
-
int
-
template<>
classPyObjectToNative
<QByteArray> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
QByteArray
toNative
(PyObject*, PyObject *o)
-
QByteArray
-
template<>
classPyObjectToNative
<qint64> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
qint64
toNative
(PyObject*, PyObject *o)
-
qint64
-
template<class
V
>
classPyObjectToNative
<QList<V>> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
QList<V>
toNative
(PyObject *a, PyObject *o)
-
QList<V>
-
template<>
classPyObjectToNative
<QString> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
QString
toNative
(PyObject*, PyObject *o)
-
QString
-
template<>
classPyObjectToNative
<quint64> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
qint64
toNative
(PyObject*, PyObject *o)
-
qint64
-
template<>
classPyObjectToNative
<QVariant> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
QVariant
toNative
(PyObject*, PyObject *o)
-
QVariant
-
template<class V, class ... Args> function< V(Args...)> >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
std::function<V(Args...)>
toNative
(PyObject *self, PyObject *io)
-
std::function<V(Args...)>
-
template<class V> shared_ptr< V > >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
std::shared_ptr<V>
toNative
(PyObject*, PyObject *o)
-
std::shared_ptr<V>
-
template<class
V
>
classPyObjectToNative
<V*> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
V *
toNative
(PyObject*, PyObject *o)
-
V *
-
template<int
pos
, typename ...Args
>
structPyObjectTupleToNativeTuple
- #include <pythonscriptinterpreter.h>
-
template<int
pos
>
structPyObjectTupleToNativeTuple
<pos> - #include <pythonscriptinterpreter.h>
Public Static Functions
-
std::tuple
toNativeTuple
(PyObject*, PyObject*)
-
std::tuple
-
template<int
pos
, classT
, class ...Args
>
structPyObjectTupleToNativeTuple
<pos, T, Args...> - #include <pythonscriptinterpreter.h>
-
template<typename
D
, typenameT
, T>
structScriptedMethodProxy
- #include <pythonscriptinterpreter.h>
-
template<typename T, typename R, typename ... Args, std::function< R(Args...)> T::* MF> *, MF >
- #include <pythonscriptinterpreter.h>
Public Static Functions
-
void
setImplementation
(T *inst, std::function<R(Args...)> vfct)
-
PyObject *
pyObjectFunctionSetImplementation
(PyObject *a, PyObject *b)
-
void
-
using