55 #include <structmember.h> 88 #ifdef WITH_PYTHON_TRACE_CALLS 89 #define CallPythonMethod(instance, name, params, ...) \ 90 remmina_plugin_python_last_result_set(PyObject_CallMethod(instance, name, params, ##__VA_ARGS__)); \ 91 remmina_plugin_python_log_method_call(instance, name); \ 92 remmina_plugin_python_check_error() 97 #define CallPythonMethod(instance, name, params, ...) \ 98 PyObject_CallMethod(instance, name, params, ##__VA_ARGS__); \ 99 remmina_plugin_python_check_error() 100 #endif // WITH_PYTHON_TRACE_CALLS 151 #define SELF_CHECK() if (!self) { \ 152 g_printerr("[%s:%d]: self is null!\n", __FILE__, __LINE__); \ 153 PyErr_SetString(PyExc_RuntimeError, "Method is not called from an instance (self is null)!"); \
gboolean remmina_plugin_python_check_error(void)
Checks if an error has occurred and prints it.
Maps an instance of a Python plugin to a Remmina one.
RemminaSecretPlugin * secret_plugin
const char * ATTR_FEATURES
const char * ATTR_SSH_SETTING
const char * ATTR_VERSION
PyObject * remmina_plugin_python_last_result(void)
Gets the result of the last python method call.
const char * ATTR_BASIC_SETTINGS
const char * ATTR_ICON_NAME_SSH
A struct used to communicate data between Python and C without strict data type.
RemminaFilePlugin * file_plugin
GtkWidget * new_pywidget(GObject *obj)
Creates a new GtkWidget.
RemminaProtocolPlugin * protocol_plugin
RemminaToolPlugin * tool_plugin
PyRemminaProtocolWidget * gp
char * remmina_plugin_python_copy_string_from_python(PyObject *string, Py_ssize_t len)
Copies a string from a Python object to a new point in memory.
const char * ATTR_INIT_ORDER
RemminaPlugin * generic_plugin
void init_pygobject(void)
Initializes the pygobject library.
const char * ATTR_EXPORT_HINTS
void * remmina_plugin_python_malloc(int bytes)
Allocates memory and checks for errors before returning.
const char * ATTR_ICON_NAME
G_BEGIN_DECLS const char * ATTR_NAME
const char * ATTR_ADVANCED_SETTINGS
PyObject * remmina_plugin_python_last_result_set(PyObject *result)
Sets the result of the last python method call.
RemminaTypeHint type_hint
RemminaTypeHint remmina_plugin_python_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...
const char * ATTR_PREF_LABEL
void remmina_plugin_python_set_service(RemminaPluginService *service)
Sets the pointer to the plugin service of Remmina.
RemminaPrefPlugin * pref_plugin
long remmina_plugin_python_get_attribute_long(PyObject *instance, const char *attr_name, long def)
Gets the attribute as long value.
gboolean remmina_plugin_python_check_attribute(PyObject *instance, const char *attr_name)
Checks if a given attribute exists.
const char * ATTR_DESCRIPTION
PyPlugin * remmina_plugin_python_get_plugin(const char *name)
Tries to find the Python plugin matching to the given instance of RemminaPlugin.
GtkWidget * get_pywidget(PyObject *obj)
Extracts a GtkWidget from a PyObject instance.
void remmina_plugin_python_log_method_call(PyObject *instance, const char *method)
Prints a log message to inform the user a python message has been called.
PyGeneric * remmina_plugin_python_generic_new(void)
Creates a new instance of PyGeneric.
void remmina_plugin_python_add_plugin(PyPlugin *plugin)
Registers the given plugin if no other plugin with the same name has been already registered...
RemminaEntryPlugin * entry_plugin