56 #include <structmember.h> 89 #ifdef WITH_PYTHON_TRACE_CALLS 90 #define CallPythonMethod(instance, name, params, ...) \ 91 python_wrapper_last_result_set(PyObject_CallMethod(instance, name, params, ##__VA_ARGS__)); \ 92 python_wrapper_log_method_call(instance, name); \ 93 python_wrapper_check_error() 98 #define CallPythonMethod(instance, name, params, ...) \ 99 PyObject_CallMethod(instance, name, params, ##__VA_ARGS__); \ 100 python_wrapper_check_error() 101 #endif // WITH_PYTHON_TRACE_CALLS 152 #define SELF_CHECK() if (!self) { \ 153 g_printerr("[%s:%d]: self is null!\n", __FILE__, __LINE__); \ 154 PyErr_SetString(PyExc_RuntimeError, "Method is not called from an instance (self is null)!"); \
GtkWidget * new_pywidget(GObject *obj)
Creates a new GtkWidget.
void * python_wrapper_malloc(int bytes)
Allocates memory and checks for errors before returning.
Maps an instance of a Python plugin to a Remmina one.
RemminaSecretPlugin * secret_plugin
PyObject * python_wrapper_last_result_set(PyObject *result)
Sets the result of the last python method call.
RemminaTypeHint python_wrapper_to_generic(PyObject *field, gpointer *target)
Extracts data from a PyObject instance to a generic pointer and returns a type hint if it could be de...
A struct used to communicate data between Python and C without strict data type.
RemminaFilePlugin * file_plugin
const char * ATTR_ICON_NAME_SSH
const char * ATTR_ADVANCED_SETTINGS
const char * ATTR_FEATURES
RemminaProtocolPlugin * protocol_plugin
PyPlugin * python_wrapper_get_plugin(const gchar *name)
Tries to find the Python plugin matching to the given instance of RemminaPlugin.
const char * ATTR_EXPORT_HINTS
const char * ATTR_DESCRIPTION
gboolean python_wrapper_check_error(void)
Checks if an error has occurred and prints it.
RemminaToolPlugin * tool_plugin
const char * ATTR_BASIC_SETTINGS
void python_wrapper_log_method_call(PyObject *instance, const char *method)
Prints a log message to inform the user a python message has been called.
PyRemminaProtocolWidget * gp
void init_pygobject(void)
Initializes the pygobject library.
PyObject * python_wrapper_last_result(void)
Gets the result of the last python method call.
const char * ATTR_INIT_ORDER
G_BEGIN_DECLS const char * ATTR_NAME
RemminaPlugin * generic_plugin
PyPlugin * python_wrapper_get_plugin_by_protocol_widget(RemminaProtocolWidget *gp)
Tries to find the Python plugin matching to the given instance of RemminaPlugin.
void python_wrapper_set_service(RemminaPluginService *service)
Sets the pointer to the plugin service of Remmina.
RemminaPluginService * python_wrapper_get_service(void)
Gets the pointer to the plugin service of Remmina.
GtkWidget * get_pywidget(PyObject *obj)
Extracts a GtkWidget from a PyObject instance.
char * python_wrapper_copy_string_from_python(PyObject *string, Py_ssize_t len)
Copies a string from a Python object to a new point in memory.
gboolean python_wrapper_check_attribute(PyObject *instance, const char *attr_name)
Checks if a given attribute exists.
const char * ATTR_PREF_LABEL
RemminaTypeHint type_hint
const char * ATTR_VERSION
const char * ATTR_ICON_NAME
long python_wrapper_get_attribute_long(PyObject *instance, const char *attr_name, long def)
Gets the attribute as long value.
void python_wrapper_add_plugin(PyPlugin *plugin)
Registers the given plugin if no other plugin with the same name has been already registered...
const char * ATTR_SSH_SETTING
PyGeneric * python_wrapper_generic_new(void)
Creates a new instance of PyGeneric.
RemminaPrefPlugin * pref_plugin
RemminaEntryPlugin * entry_plugin