212 {
"protocol_widget_get_profile_remote_width",
218 {
"protocol_widget_get_profile_remote_height",
221 METH_VARARGS, NULL },
224 METH_VARARGS, NULL },
251 PyModuleDef_HEAD_INIT,
253 .m_doc =
"Remmina API.",
266 TRACE_CALL(__func__);
277 self->compact = FALSE;
280 self->settingType = 0;
282 return (PyObject*)
self;
291 TRACE_CALL(__func__);
293 static gchar* kwlist[] = {
"type",
"name",
"label",
"compact",
"opt1",
"opt2", NULL };
297 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|lOOpOO", kwlist,
298 &self->settingType, &name, &label, &self->compact, &self->opt1, &self->opt2))
303 Py_ssize_t len = PyUnicode_GetLength(label);
313 g_printerr(
"Unable to extract label during initialization of Python settings module!\n");
318 len = PyUnicode_GetLength(name);
328 g_printerr(
"Unable to extract name during initialization of Python settings module!\n");
347 PyVarObject_HEAD_INIT(NULL, 0)
348 .tp_name =
"remmina.Setting",
349 .tp_doc =
"Remmina Setting information",
352 .tp_flags = Py_TPFLAGS_DEFAULT,
372 TRACE_CALL(__func__);
382 self->opt1->raw = NULL;
385 self->opt2->raw = NULL;
388 self->opt3->raw = NULL;
391 return (PyObject*)
self;
396 TRACE_CALL(__func__);
398 static char* kwlist[] = {
"type",
"id",
"opt1",
"opt2",
"opt3", NULL };
400 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|llOOO", kwlist, &self->type, &self->id, &self->opt1, &self
401 ->opt2, &self->opt3))
408 PyVarObject_HEAD_INIT(NULL, 0)
409 .tp_name =
"remmina.ProtocolFeature",
410 .tp_doc =
"Remmina Setting information",
413 .tp_flags = Py_TPFLAGS_DEFAULT,
433 Py_IncRef((PyObject*)feature);
451 TRACE_CALL(__func__);
458 self->
buffer = (PyByteArrayObject*)PyObject_New(PyByteArrayObject, &PyByteArray_Type);
461 self->bitsPerPixel = 0;
462 self->bytesPerPixel = 0;
464 return (PyObject*)
self;
469 TRACE_CALL(__func__);
471 g_printerr(
"Not to be initialized within Python!");
476 PyVarObject_HEAD_INIT(NULL, 0)
477 .tp_name =
"remmina.RemminaScreenshotData",
478 .tp_doc =
"Remmina Screenshot Data",
481 .tp_flags = Py_TPFLAGS_DEFAULT,
489 data->
buffer = PyObject_New(PyByteArrayObject, &PyByteArray_Type);
490 Py_IncRef((PyObject*)data->
buffer);
515 {
"raw", T_OBJECT, offsetof(
PyGeneric, raw), 0,
"" },
521 TRACE_CALL(__func__);
524 self = (
PyGeneric*)type->tp_alloc(type, 0);
530 return (PyObject*)
self;
535 TRACE_CALL(__func__);
537 static char* kwlist[] = {
"raw", NULL };
539 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O", kwlist, &self->raw))
546 PyVarObject_HEAD_INIT(NULL, 0)
547 .tp_name =
"remmina.Generic",
552 .tp_flags = Py_TPFLAGS_DEFAULT,
562 generic->
raw = PyLong_FromLongLong(0LL);
563 Py_IncRef((PyObject*)
generic);
571 if (self->raw == NULL)
577 return PyLong_FromLongLong((
long long)self->raw);
581 return PyLong_FromUnsignedLongLong((
unsigned long long)self->raw);
590 if (self->raw == NULL)
596 return PyBool_FromLong((
long)self->raw);
605 if (self->raw == NULL)
611 return PyUnicode_FromString((
const char*)self->raw);
623 TRACE_CALL(__func__);
659 PyModule_AddIntConstant(module,
"BUTTONS_CLOSE", (
long)GTK_BUTTONS_CLOSE);
660 PyModule_AddIntConstant(module,
"BUTTONS_NONE", (
long)GTK_BUTTONS_NONE);
661 PyModule_AddIntConstant(module,
"BUTTONS_OK", (
long)GTK_BUTTONS_OK);
662 PyModule_AddIntConstant(module,
"BUTTONS_CLOSE", (
long)GTK_BUTTONS_CLOSE);
663 PyModule_AddIntConstant(module,
"BUTTONS_CANCEL", (
long)GTK_BUTTONS_CANCEL);
664 PyModule_AddIntConstant(module,
"BUTTONS_YES_NO", (
long)GTK_BUTTONS_YES_NO);
665 PyModule_AddIntConstant(module,
"BUTTONS_OK_CANCEL", (
long)GTK_BUTTONS_OK_CANCEL);
667 PyModule_AddIntConstant(module,
"MESSAGE_INFO", (
long)GTK_MESSAGE_INFO);
668 PyModule_AddIntConstant(module,
"MESSAGE_WARNING", (
long)GTK_MESSAGE_WARNING);
669 PyModule_AddIntConstant(module,
"MESSAGE_QUESTION", (
long)GTK_MESSAGE_QUESTION);
670 PyModule_AddIntConstant(module,
"MESSAGE_ERROR", (
long)GTK_MESSAGE_ERROR);
671 PyModule_AddIntConstant(module,
"MESSAGE_OTHER", (
long)GTK_MESSAGE_OTHER);
698 PyModule_AddIntConstant(module,
"PROTOCOL_FEATURE_PREF_RADIO", (
long)REMMINA_PROTOCOL_FEATURE_PREF_RADIO);
699 PyModule_AddIntConstant(module,
"PROTOCOL_FEATURE_PREF_CHECK", (
long)REMMINA_PROTOCOL_FEATURE_PREF_CHECK);
708 Py_DECREF(&python_protocol_setting_type);
717 Py_DECREF(&python_protocol_setting_type);
718 Py_DECREF(&python_protocol_feature_type);
733 TRACE_CALL(__func__);
751 TRACE_CALL(__func__);
753 if (PyObject_HasAttrString(instance, member))
758 g_printerr(
"Missing mandatory member '%s' in Python plugin instance!\n", member);
764 TRACE_CALL(__func__);
775 const gchar* pluginType = PyUnicode_AsUTF8(PyObject_GetAttrString(plugin_instance,
"type"));
781 Py_INCREF(plugin_instance);
788 g_print(
"New Python plugin registered: %ld\n", PyObject_Hash(plugin_instance));
790 if (g_str_equal(pluginType,
"protocol"))
794 else if (g_str_equal(pluginType,
"entry"))
798 else if (g_str_equal(pluginType,
"file"))
802 else if (g_str_equal(pluginType,
"tool"))
806 else if (g_str_equal(pluginType,
"pref"))
810 else if (g_str_equal(pluginType,
"secret"))
816 g_printerr(
"Unknown plugin type: %s\n", pluginType);
835 TRACE_CALL(__func__);
837 PyObject* result = Py_None;
842 result = PyUnicode_FromFormat(
"%s", datadir);
851 TRACE_CALL(__func__);
865 TRACE_CALL(__func__);
867 static char* kwlist[] = {
"key",
"value", NULL };
870 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"ss", kwlist, &key, &value))
886 TRACE_CALL(__func__);
888 static char* kwlist[] = {
"key", NULL };
890 PyObject* result = Py_None;
892 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"s", kwlist, &key))
902 result = PyUnicode_FromFormat(
"%s", result);
912 TRACE_CALL(__func__);
921 TRACE_CALL(__func__);
930 TRACE_CALL(__func__);
939 TRACE_CALL(__func__);
948 TRACE_CALL(__func__);
950 static char* kwlist[] = {
"keymap",
"keyval", NULL };
953 PyObject* result = Py_None;
955 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"sl", kwlist, &keymap, &keyval))
957 return PyLong_FromLong(-1);
963 result = PyLong_FromUnsignedLong(value);
972 TRACE_CALL(__func__);
975 if (!PyArg_ParseTuple(args,
"s", &text) || !text)
986 TRACE_CALL(__func__);
989 if (!PyArg_ParseTuple(args,
"s", &text) || !text)
1000 TRACE_CALL(__func__);
1002 static char* kwlist[] = {
"widget", NULL };
1005 if (PyArg_ParseTupleAndKeywords(args, kwargs,
"O", kwlist, &widget) && widget)
1015 TRACE_CALL(__func__);
1017 static char* kwlist[] = {
"remminafile",
"data",
"handler", NULL };
1018 PyObject* pyremminafile;
1021 if (PyArg_ParseTupleAndKeywords(args, kwargs,
"OOO", kwlist, &pyremminafile, &data) && pyremminafile && data)
1031 TRACE_CALL(__func__);
1033 static char* kwlist[] = {
"server",
"defaultport",
"host",
"port", NULL };
1037 if (PyArg_ParseTupleAndKeywords(args, kwargs,
"slsl", kwlist, &server, &defaultport) && server)
1043 PyObject* result = PyList_New(2);
1044 PyList_Append(result, PyUnicode_FromString(host));
1045 PyList_Append(result, PyLong_FromLong(port));
1046 return PyList_AsTuple(result);
1054 TRACE_CALL(__func__);
1061 TRACE_CALL(__func__);
1069 TRACE_CALL(__func__);
1071 static char* kwlist[] = {
"widget", NULL };
1074 if (PyArg_ParseTupleAndKeywords(args, kwargs,
"O", kwlist, &plugin) && plugin && plugin->
gp)
1085 TRACE_CALL(__func__);
1087 static char* kwlist[] = {
"widget", NULL };
1090 if (PyArg_ParseTupleAndKeywords(args, kwargs,
"O", kwlist, &plugin) && plugin && plugin->
gp)
1100 TRACE_CALL(__func__);
1116 TRACE_CALL(__func__);
1132 TRACE_CALL(__func__);
1134 static char* kwlist[] = {
"type",
"buttons",
"message", NULL };
1135 GtkMessageType msgType;
1136 GtkButtonsType btnType;
1139 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"lls", kwlist, &msgType, &btnType, &message))
1141 return PyLong_FromLong(-1);
1151 TRACE_CALL(__func__);
1165 TRACE_CALL(__func__);
1167 PyObject* pygp = NULL;
1168 if (!PyArg_ParseTuple(args,
"O", &pygp) || !pygp)
1170 g_printerr(
"Please provide the Remmina protocol widget instance!");
1180 TRACE_CALL(__func__);
1182 static gchar* keyword_list[] = {
"widget",
"flags",
"title",
"default_username",
"default_password",
1183 "default_domain",
"password_prompt" };
1187 gchar* title, * default_username, * default_password, * default_domain, * password_prompt;
1189 if (PyArg_ParseTupleAndKeywords(args, kwds,
"Oisssss", keyword_list, &
self, &pflags, &title, &default_username,
1190 &default_password, &default_domain, &password_prompt))
1197 g_printerr(
"panel_auth(pflags, title, default_username, default_password, default_domain, password_prompt): " 1198 "%d is not a known value for RemminaMessagePanelFlags!\n", pflags);
1203 ->gp, pflags, title, default_username, default_password, default_domain, password_prompt));
1208 g_printerr(
"panel_auth(pflags, title, default_username, default_password, default_domain, password_prompt): Error parsing arguments!\n");
1216 PyObject* pygp = NULL;
1217 if (!PyArg_ParseTuple(args,
"O", &pygp) || !pygp)
1219 g_printerr(
"Please provide the Remmina protocol widget instance!");
void remmina_plugin_python_pref_init(void)
Initializes the Python plugin specialisation for preferences plugins.
gint remmina_pref_get_scale_quality(void)
static PyObject * remmina_pref_get_value_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
PyObject * python_screenshot_data_new(PyTypeObject *type, PyObject *kws, PyObject *args)
PyObject_HEAD RemminaProtocolFeatureType type
PyRemminaFile * remmina_plugin_python_remmina_file_to_python(RemminaFile *file)
Converts the instance of RemminaFile to a Python object that can be passed to the Python engine...
static PyObject * remmina_pref_keymap_get_keyval_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
Wrapper for a Python object that contains a pointer to an instance of RemminaProtocolFeature.
GtkWindow * remmina_main_get_window()
void remmina_plugin_python_module_init(void)
Initializes all globals and registers the 'remmina' module in the Python engine.
static PyObject * remmina_gtksocket_available_wrapper(PyObject *self, PyObject *plugin)
gint remmina_pref_get_sshtunnel_port(void)
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...
static int python_protocol_setting_init(PyRemminaProtocolSetting *self, PyObject *args, PyObject *kwargs)
Constructor of the remmina.Setting Python type.
Maps an instance of a Python plugin to a Remmina one.
typedefG_BEGIN_DECLS struct _RemminaFile RemminaFile
static PyObject * remmina_protocol_plugin_init_auth_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
PyMODINIT_FUNC remmina_plugin_python_module_initialize(void)
Is called from the Python engine when it initializes the 'remmina' module.
RemminaSecretPlugin * secret_plugin
PyObject * remmina_plugin_python_generic_type_new(PyTypeObject *type, PyObject *kws, PyObject *args)
GtkWidget * rcw_open_from_file_full(RemminaFile *remminafile, GCallback disconnect_cb, gpointer data, guint *handler)
static PyObject * remmina_plugin_python_show_dialog_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
void remmina_plugin_python_to_protocol_feature(RemminaProtocolFeature *dest, PyObject *feature)
Converts the PyObject to RemminaProtocolFeature.
static PyObject * remmina_file_get_datadir_wrapper(PyObject *self, PyObject *plugin)
void remmina_plugin_python_secret_init(void)
Initializes the Python plugin specialisation for secret plugins.
gint remmina_pref_get_ssh_loglevel(void)
static RemminaProtocolPlugin remmina_plugin
void remmina_plugin_python_remmina_init_types(void)
static PyObject * remmina_protocol_plugin_signal_connection_opened_wrapper(PyObject *self, PyObject *args)
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.
A struct used to communicate data between Python and C without strict data type.
static PyObject * remmina_protocol_widget_get_profile_remote_height_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
static PyObject * remmina_pref_get_scale_quality_wrapper(PyObject *self, PyObject *plugin)
RemminaFilePlugin * file_plugin
static PyTypeObject python_generic_type
Contains the implementation of the Python module 'remmina', provided to interface with the applicatio...
RemminaProtocolSettingType
void remmina_pref_set_value(const gchar *key, const gchar *value)
gboolean remmina_plugin_python_check_mandatory_member(PyObject *instance, const gchar *member)
Util function to check if a specific member is define in a Python object.
GtkWidget * get_pywidget(PyObject *obj)
Extracts a GtkWidget from a PyObject instance.
RemminaProtocolPlugin * protocol_plugin
void(* protocol_plugin_signal_connection_closed)(RemminaProtocolWidget *gp)
gboolean remmina_plugin_python_check_error(void)
Checks if an error has occurred and prints it.
static PyObject * remmina_protocol_widget_get_profile_remote_width_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
Contains the specialisation of RemminaPluginFile plugins in Python.
static int python_screenshot_data_init(PyRemminaPluginScreenshotData *self, PyObject *args, PyObject *kwargs)
static PyObject * remmina_plugin_python_get_mainwindow_wrapper(PyObject *self, PyObject *args)
static void remmina_plugin_python_generic_dealloc(PyObject *self)
static PyObject * remmina_pref_get_sshtunnel_port_wrapper(PyObject *self, PyObject *plugin)
static PyObject * remmina_widget_pool_register_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
RemminaToolPlugin * tool_plugin
void(* protocol_plugin_signal_connection_opened)(RemminaProtocolWidget *gp)
static PyObject * remmina_plugin_python_generic_to_bool(PyGeneric *self, PyObject *args)
gchar * remmina_pref_get_value(const gchar *key)
void remmina_plugin_python_file_init(void)
Initializes the Python plugin specialisation for file plugins.
static PyMemberDef python_protocol_feature_members[]
RemminaPlugin * remmina_plugin_python_create_file_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginFile, initializes its members and references the wrapper f...
gboolean remmina_pref_get_ssh_parseconfig(void)
PyRemminaProtocolWidget * gp
static PyObject * python_protocol_setting_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
Initializes the memory and the fields of the remmina.Setting Python type.
gboolean(* register_plugin)(RemminaPlugin *plugin)
gboolean remmina_masterthread_exec_is_main_thread()
static PyObject * rcw_open_from_file_full_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
static PyMethodDef remmina_plugin_python_generic_methods[]
RemminaPluginService remmina_plugin_manager_service
void remmina_main_show_dialog(GtkMessageType msg, GtkButtonsType buttons, const gchar *message)
static PyObject * remmina_plugin_python_debug_wrapper(PyObject *self, PyObject *msg)
static PyObject * remmina_pref_set_value_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
RemminaProtocolFeatureType type
static int remmina_plugin_python_generic_init(PyGeneric *self, PyObject *args, PyObject *kwargs)
static PyObject * remmina_protocol_plugin_signal_connection_closed_wrapper(PyObject *self, PyObject *args)
static PyTypeObject python_protocol_setting_type
void remmina_plugin_python_entry_init(void)
Initializes the Python plugin specialisation for entry plugins.
gboolean remmina_gtksocket_available()
RemminaPlugin * remmina_plugin_python_create_pref_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginPref, initializes its members and references the wrapper f...
PyObject_HEAD RemminaProtocolSettingType settingType
static PyObject * remmina_plugin_python_log_print_wrapper(PyObject *self, PyObject *arg)
RemminaTypeHint opt1_type_hint
PyRemminaPluginScreenshotData * remmina_plugin_python_screenshot_data_new(void)
static PyObject * remmina_pref_get_ssh_loglevel_wrapper(PyObject *self, PyObject *plugin)
static PyMethodDef remmina_python_module_type_methods[]
Declares functions for the Remmina module.
gchar * remmina_file_get_datadir(void)
Return datadir_path from pref or first found data dir as per XDG specs.
static PyMemberDef remmina_plugin_python_generic_members[]
static PyTypeObject python_protocol_feature_type
static PyObject * remmina_register_plugin_wrapper(PyObject *self, PyObject *plugin)
PyObject * python_protocol_feature_new(PyTypeObject *type, PyObject *kws, PyObject *args)
void remmina_plugin_python_to_protocol_setting(RemminaProtocolSetting *dest, PyObject *setting)
Converts the PyObject to RemminaProtocolSetting.
static PyMemberDef python_screenshot_data_members[]
static PyObject * remmina_pref_get_ssh_parseconfig_wrapper(PyObject *self, PyObject *plugin)
RemminaProtocolSettingType type
RemminaFile * remmina_file_new(void)
static PyObject * remmina_plugin_python_generic_to_int(PyGeneric *self, PyObject *args)
guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
PyObject_HEAD PyByteArrayObject * buffer
RemminaTypeHint type_hint
RemminaTypeHint opt2_type_hint
static PyObject * remmina_public_get_server_port_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
Contains functions and constants that are commonly used throughout the Python plugin implementation...
static int python_protocol_feature_init(PyRemminaProtocolFeature *self, PyObject *args, PyObject *kwargs)
void * remmina_plugin_python_malloc(int bytes)
Allocates memory and checks for errors before returning.
RemminaPrefPlugin * pref_plugin
Contains the specialisation of RemminaPluginEntry plugins in Python.
RemminaPlugin * remmina_plugin_python_create_protocol_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginProtocol, initializes its members and references the wrapp...
static PyModuleDef remmina_python_module_type
The definition of the Python module 'remmina'.
Contains the specialisation of RemminaPluginFile plugins in Python.
void remmina_log_print(const gchar *text)
GtkWidget * new_pywidget(GObject *obj)
Creates a new GtkWidget.
static PyObject * remmina_file_new_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
void remmina_public_get_server_port(const gchar *server, gint defaultport, gchar **host, gint *port)
RemminaPlugin * remmina_plugin_python_create_secret_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginSecret, initializes its members and references the wrapper...
PyGeneric * remmina_plugin_python_generic_new(void)
Creates a new instance of PyGeneric.
static PyTypeObject python_screenshot_data_type
void remmina_plugin_python_protocol_init(void)
Initializes the Python plugin specialisation for protocol plugins.
Adapter struct to handle Remmina protocol settings.
void(* _remmina_debug)(const gchar *func, const gchar *fmt,...)
static PyMemberDef python_protocol_setting_type_members[]
RemminaTypeHint opt3_type_hint
static PyObject * remmina_plugin_python_generic_to_string(PyGeneric *self, PyObject *args)
RemminaEntryPlugin * entry_plugin
Contains the specialisation of RemminaPluginFile plugins in Python.
static PyObject * remmina_masterthread_exec_is_main_thread_wrapper(PyObject *self, PyObject *plugin)
RemminaPlugin * remmina_plugin_python_create_entry_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginEntry, initializes its members and references the wrapper ...
PyRemminaProtocolFeature * remmina_plugin_python_protocol_feature_new(void)