200 {
"protocol_widget_get_profile_remote_width",
206 {
"protocol_widget_get_profile_remote_height",
209 METH_VARARGS, NULL },
212 METH_VARARGS, NULL },
239 PyModuleDef_HEAD_INIT,
241 .m_doc =
"Remmina API.",
254 TRACE_CALL(__func__);
265 self->compact = FALSE;
268 self->settingType = 0;
270 return (PyObject*)
self;
279 TRACE_CALL(__func__);
281 static gchar* kwlist[] = {
"type",
"name",
"label",
"compact",
"opt1",
"opt2", NULL };
285 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|lOOpOO", kwlist,
286 &self->settingType, &name, &label, &self->compact, &self->opt1, &self->opt2))
291 Py_ssize_t len = PyUnicode_GetLength(label);
301 g_printerr(
"Unable to extract label during initialization of Python settings module!\n");
306 len = PyUnicode_GetLength(name);
316 g_printerr(
"Unable to extract name during initialization of Python settings module!\n");
335 PyVarObject_HEAD_INIT(NULL, 0)
336 .tp_name =
"remmina.Setting",
337 .tp_doc =
"Remmina Setting information",
340 .tp_flags = Py_TPFLAGS_DEFAULT,
360 TRACE_CALL(__func__);
370 self->opt1->raw = NULL;
373 self->opt2->raw = NULL;
376 self->opt3->raw = NULL;
379 return (PyObject*)
self;
384 TRACE_CALL(__func__);
386 static char* kwlist[] = {
"type",
"id",
"opt1",
"opt2",
"opt3", NULL };
388 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|llOOO", kwlist, &self->type, &self->id, &self->opt1, &self
389 ->opt2, &self->opt3))
396 PyVarObject_HEAD_INIT(NULL, 0)
397 .tp_name =
"remmina.ProtocolFeature",
398 .tp_doc =
"Remmina Setting information",
401 .tp_flags = Py_TPFLAGS_DEFAULT,
421 Py_IncRef((PyObject*)feature);
439 TRACE_CALL(__func__);
446 self->
buffer = (PyByteArrayObject*)PyObject_New(PyByteArrayObject, &PyByteArray_Type);
449 self->bitsPerPixel = 0;
450 self->bytesPerPixel = 0;
452 return (PyObject*)
self;
457 TRACE_CALL(__func__);
459 g_printerr(
"Not to be initialized within Python!");
464 PyVarObject_HEAD_INIT(NULL, 0)
465 .tp_name =
"remmina.RemminaScreenshotData",
466 .tp_doc =
"Remmina Screenshot Data",
469 .tp_flags = Py_TPFLAGS_DEFAULT,
477 data->
buffer = PyObject_New(PyByteArrayObject, &PyByteArray_Type);
478 Py_IncRef((PyObject*)data->
buffer);
503 {
"raw", T_OBJECT, offsetof(
PyGeneric, raw), 0,
"" },
509 TRACE_CALL(__func__);
512 self = (
PyGeneric*)type->tp_alloc(type, 0);
518 return (PyObject*)
self;
523 TRACE_CALL(__func__);
525 static char* kwlist[] = {
"raw", NULL };
527 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O", kwlist, &self->raw))
534 PyVarObject_HEAD_INIT(NULL, 0)
535 .tp_name =
"remmina.Generic",
540 .tp_flags = Py_TPFLAGS_DEFAULT,
550 generic->
raw = PyLong_FromLongLong(0LL);
551 Py_IncRef((PyObject*)
generic);
559 if (self->raw == NULL)
565 return PyLong_FromLongLong((
long long)self->raw);
569 return PyLong_FromUnsignedLongLong((
unsigned long long)self->raw);
578 if (self->raw == NULL)
584 return PyBool_FromLong((
long)self->raw);
593 if (self->raw == NULL)
599 return PyUnicode_FromString((
const char*)self->raw);
611 TRACE_CALL(__func__);
647 PyModule_AddIntConstant(module,
"BUTTONS_CLOSE", (
long)GTK_BUTTONS_CLOSE);
648 PyModule_AddIntConstant(module,
"BUTTONS_NONE", (
long)GTK_BUTTONS_NONE);
649 PyModule_AddIntConstant(module,
"BUTTONS_OK", (
long)GTK_BUTTONS_OK);
650 PyModule_AddIntConstant(module,
"BUTTONS_CLOSE", (
long)GTK_BUTTONS_CLOSE);
651 PyModule_AddIntConstant(module,
"BUTTONS_CANCEL", (
long)GTK_BUTTONS_CANCEL);
652 PyModule_AddIntConstant(module,
"BUTTONS_YES_NO", (
long)GTK_BUTTONS_YES_NO);
653 PyModule_AddIntConstant(module,
"BUTTONS_OK_CANCEL", (
long)GTK_BUTTONS_OK_CANCEL);
655 PyModule_AddIntConstant(module,
"MESSAGE_INFO", (
long)GTK_MESSAGE_INFO);
656 PyModule_AddIntConstant(module,
"MESSAGE_WARNING", (
long)GTK_MESSAGE_WARNING);
657 PyModule_AddIntConstant(module,
"MESSAGE_QUESTION", (
long)GTK_MESSAGE_QUESTION);
658 PyModule_AddIntConstant(module,
"MESSAGE_ERROR", (
long)GTK_MESSAGE_ERROR);
659 PyModule_AddIntConstant(module,
"MESSAGE_OTHER", (
long)GTK_MESSAGE_OTHER);
687 PyModule_AddIntConstant(module,
"PROTOCOL_FEATURE_PREF_RADIO", (
long)REMMINA_PROTOCOL_FEATURE_PREF_RADIO);
688 PyModule_AddIntConstant(module,
"PROTOCOL_FEATURE_PREF_CHECK", (
long)REMMINA_PROTOCOL_FEATURE_PREF_CHECK);
697 Py_DECREF(&python_protocol_setting_type);
706 Py_DECREF(&python_protocol_setting_type);
707 Py_DECREF(&python_protocol_feature_type);
722 TRACE_CALL(__func__);
740 TRACE_CALL(__func__);
742 if (PyObject_HasAttrString(instance, member))
747 g_printerr(
"Missing mandatory member '%s' in Python plugin instance!\n", member);
753 TRACE_CALL(__func__);
764 const gchar* pluginType = PyUnicode_AsUTF8(PyObject_GetAttrString(plugin_instance,
"type"));
770 Py_INCREF(plugin_instance);
777 g_print(
"New Python plugin registered: %ld\n", PyObject_Hash(plugin_instance));
779 if (g_str_equal(pluginType,
"protocol"))
783 else if (g_str_equal(pluginType,
"entry"))
787 else if (g_str_equal(pluginType,
"file"))
791 else if (g_str_equal(pluginType,
"tool"))
795 else if (g_str_equal(pluginType,
"pref"))
799 else if (g_str_equal(pluginType,
"secret"))
805 g_printerr(
"Unknown plugin type: %s\n", pluginType);
816 g_print(
"%s: Successfully reigstered!\n", remmina_plugin->
name);
818 g_print(
"%s: Failed to reigster!\n", remmina_plugin->
name);
829 TRACE_CALL(__func__);
831 PyObject* result = Py_None;
836 result = PyUnicode_FromFormat(
"%s", datadir);
845 TRACE_CALL(__func__);
859 TRACE_CALL(__func__);
861 static char* kwlist[] = {
"key",
"value", NULL };
864 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"ss", kwlist, &key, &value))
880 TRACE_CALL(__func__);
882 static char* kwlist[] = {
"key", NULL };
884 PyObject* result = Py_None;
886 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"s", kwlist, &key))
896 result = PyUnicode_FromFormat(
"%s", value);
906 TRACE_CALL(__func__);
915 TRACE_CALL(__func__);
924 TRACE_CALL(__func__);
933 TRACE_CALL(__func__);
942 TRACE_CALL(__func__);
944 static char* kwlist[] = {
"keymap",
"keyval", NULL };
947 PyObject* result = Py_None;
949 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"sl", kwlist, &keymap, &keyval))
951 return PyLong_FromLong(-1);
957 result = PyLong_FromUnsignedLong(value);
966 TRACE_CALL(__func__);
969 if (!PyArg_ParseTuple(args,
"s", &text) || !text)
980 TRACE_CALL(__func__);
983 if (!PyArg_ParseTuple(args,
"s", &text) || !text)
994 TRACE_CALL(__func__);
996 static char* kwlist[] = {
"widget", NULL };
999 if (PyArg_ParseTupleAndKeywords(args, kwargs,
"O", kwlist, &widget) && widget)
1009 TRACE_CALL(__func__);
1011 static char* kwlist[] = {
"remminafile",
"data",
"handler", NULL };
1012 PyObject* pyremminafile;
1015 if (PyArg_ParseTupleAndKeywords(args, kwargs,
"OOO", kwlist, &pyremminafile, &data) && pyremminafile && data)
1025 TRACE_CALL(__func__);
1027 static char* kwlist[] = {
"server",
"defaultport", NULL };
1031 if (PyArg_ParseTupleAndKeywords(args, kwargs,
"sl", kwlist, &server, &defaultport) && server)
1037 PyObject* result = PyList_New(2);
1038 PyList_SetItem(result, 0, PyUnicode_FromString(host));
1039 PyList_SetItem(result, 1, PyLong_FromLong(port));
1041 return PyList_AsTuple(result);
1049 TRACE_CALL(__func__);
1056 TRACE_CALL(__func__);
1064 TRACE_CALL(__func__);
1066 static char* kwlist[] = {
"widget", NULL };
1069 if (PyArg_ParseTupleAndKeywords(args, kwargs,
"O", kwlist, &plugin) && plugin && plugin->
gp)
1080 TRACE_CALL(__func__);
1082 static char* kwlist[] = {
"widget", NULL };
1085 if (PyArg_ParseTupleAndKeywords(args, kwargs,
"O", kwlist, &plugin) && plugin && plugin->
gp)
1095 TRACE_CALL(__func__);
1111 TRACE_CALL(__func__);
1127 TRACE_CALL(__func__);
1129 static char* kwlist[] = {
"type",
"buttons",
"message", NULL };
1130 GtkMessageType msgType;
1131 GtkButtonsType btnType;
1134 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"lls", kwlist, &msgType, &btnType, &message))
1136 return PyLong_FromLong(-1);
1146 TRACE_CALL(__func__);
1160 TRACE_CALL(__func__);
1162 PyObject* pygp = NULL;
1163 if (!PyArg_ParseTuple(args,
"O", &pygp) || !pygp)
1165 g_printerr(
"Please provide the Remmina protocol widget instance!");
1175 TRACE_CALL(__func__);
1177 static gchar* keyword_list[] = {
"widget",
"flags",
"title",
"default_username",
"default_password",
1178 "default_domain",
"password_prompt" };
1182 gchar* title, * default_username, * default_password, * default_domain, * password_prompt;
1184 if (PyArg_ParseTupleAndKeywords(args, kwds,
"Oisssss", keyword_list, &
self, &pflags, &title, &default_username,
1185 &default_password, &default_domain, &password_prompt))
1192 g_printerr(
"panel_auth(pflags, title, default_username, default_password, default_domain, password_prompt): " 1193 "%d is not a known value for RemminaMessagePanelFlags!\n", pflags);
1198 ->gp, pflags, title, default_username, default_password, default_domain, password_prompt));
1203 g_printerr(
"panel_auth(pflags, title, default_username, default_password, default_domain, password_prompt): Error parsing arguments!\n");
1211 PyObject* pygp = NULL;
1212 if (!PyArg_ParseTuple(args,
"O", &pygp) || !pygp)
1214 g_printerr(
"Please provide the Remmina protocol widget instance!");
static PyObject * remmina_register_plugin_wrapper(PyObject *self, PyObject *plugin)
static PyObject * remmina_file_new_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
gboolean python_wrapper_check_error(void)
Checks if an error has occurred and prints it.
static PyObject * remmina_pref_get_ssh_loglevel_wrapper(PyObject *self, PyObject *plugin)
RemminaPlugin * python_wrapper_create_pref_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginPref, initializes its members and references the wrapper f...
PyObject_HEAD RemminaProtocolFeatureType type
static PyMemberDef python_protocol_feature_members[]
static PyTypeObject python_screenshot_data_type
static PyObject * remmina_pref_get_sshtunnel_port_wrapper(PyObject *self, PyObject *plugin)
Wrapper for a Python object that contains a pointer to an instance of RemminaProtocolFeature.
GtkWidget *(* rcw_open_from_file_full)(RemminaFile *remminafile, GCallback disconnect_cb, gpointer data, guint *handler)
void python_wrapper_to_protocol_setting(RemminaProtocolSetting *dest, PyObject *setting)
Converts the PyObject to RemminaProtocolSetting.
gchar *(* file_get_user_datadir)(void)
Maps an instance of a Python plugin to a Remmina one.
typedefG_BEGIN_DECLS struct _RemminaFile RemminaFile
RemminaSecretPlugin * secret_plugin
static PyObject * python_wrapper_generic_to_bool(PyGeneric *self, PyObject *args)
void python_wrapper_remmina_init_types(void)
PyMODINIT_FUNC python_wrapper_module_initialize(void)
Is called from the Python engine when it initializes the 'remmina' module.
static PyMemberDef python_screenshot_data_members[]
static PyMemberDef python_protocol_setting_type_members[]
Contains the implementation of the Python module 'remmina', provided to interface with the applicatio...
void * python_wrapper_malloc(int bytes)
Allocates memory and checks for errors before returning.
static PyMethodDef remmina_python_module_type_methods[]
Declares functions for the Remmina module.
static RemminaProtocolPlugin remmina_plugin
static PyObject * python_wrapper_generic_to_string(PyGeneric *self, PyObject *args)
static PyMemberDef python_wrapper_generic_members[]
A struct used to communicate data between Python and C without strict data type.
Contains the specialisation of RemminaPluginFile plugins in Python.
guint(* pref_keymap_get_keyval)(const gchar *keymap, guint keyval)
RemminaFilePlugin * file_plugin
RemminaProtocolSettingType
void python_wrapper_file_init(void)
Initializes the Python plugin specialisation for file plugins.
PyGeneric * python_wrapper_generic_new(void)
Creates a new instance of PyGeneric.
static int python_screenshot_data_init(PyRemminaPluginScreenshotData *self, PyObject *args, PyObject *kwargs)
GtkWidget * get_pywidget(PyObject *obj)
Extracts a GtkWidget from a PyObject instance.
RemminaProtocolPlugin * protocol_plugin
void(* protocol_plugin_signal_connection_closed)(RemminaProtocolWidget *gp)
static PyTypeObject python_protocol_setting_type
void(* log_print)(const gchar *text)
void(* get_server_port)(const gchar *server, gint defaultport, gchar **host, gint *port)
PyRemminaProtocolFeature * python_wrapper_protocol_feature_new(void)
GtkWidget * new_pywidget(GObject *obj)
Creates a new GtkWidget.
static PyObject * remmina_pref_get_value_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
RemminaPlugin * python_wrapper_create_secret_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginSecret, initializes its members and references the wrapper...
static PyObject * remmina_pref_set_value_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
RemminaToolPlugin * tool_plugin
void(* protocol_plugin_signal_connection_opened)(RemminaProtocolWidget *gp)
static int python_wrapper_generic_init(PyGeneric *self, PyObject *args, PyObject *kwargs)
static PyObject * rcw_open_from_file_full_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
void(* pref_set_value)(const gchar *key, const gchar *value)
void python_wrapper_protocol_init(void)
Initializes the Python plugin specialisation for protocol plugins.
Contains functions and constants that are commonly used throughout the Python plugin implementation...
Contains the specialisation of RemminaPluginEntry plugins in Python.
PyRemminaProtocolWidget * gp
PyRemminaFile * python_wrapper_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_gtksocket_available_wrapper(PyObject *self, PyObject *plugin)
PyObject * python_protocol_feature_new(PyTypeObject *type, PyObject *kws, PyObject *args)
RemminaPlugin * python_wrapper_create_file_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginFile, initializes its members and references the wrapper f...
static PyObject * remmina_file_get_datadir_wrapper(PyObject *self, PyObject *plugin)
static int python_protocol_feature_init(PyRemminaProtocolFeature *self, PyObject *args, PyObject *kwargs)
static PyObject * python_protocol_setting_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
Initializes the memory and the fields of the remmina.Setting Python type.
RemminaProtocolFeatureType type
void python_wrapper_secret_init(void)
Initializes the Python plugin specialisation for secret plugins.
void python_wrapper_pref_init(void)
Initializes the Python plugin specialisation for preferences plugins.
static PyObject * remmina_pref_get_ssh_parseconfig_wrapper(PyObject *self, PyObject *plugin)
GtkWindow *(* get_window)(void)
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.
static PyObject * python_wrapper_show_dialog_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
gchar *(* pref_get_value)(const gchar *key)
PyObject * python_wrapper_generic_type_new(PyTypeObject *type, PyObject *kws, PyObject *args)
static PyObject * remmina_protocol_widget_get_profile_remote_height_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
void(* show_dialog)(GtkMessageType msg, GtkButtonsType buttons, const gchar *message)
static PyObject * remmina_protocol_plugin_init_auth_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
RemminaPluginService * python_wrapper_get_service(void)
Gets the pointer to the plugin service of Remmina.
PyObject_HEAD RemminaProtocolSettingType settingType
static PyMethodDef python_wrapper_generic_methods[]
RemminaTypeHint opt1_type_hint
gint(* get_profile_remote_height)(RemminaProtocolWidget *gp)
RemminaProtocolSettingType type
Contains the specialisation of RemminaPluginFile plugins in Python.
static PyObject * remmina_protocol_plugin_signal_connection_opened_wrapper(PyObject *self, PyObject *args)
PyObject_HEAD PyByteArrayObject * buffer
RemminaTypeHint type_hint
RemminaTypeHint opt2_type_hint
gboolean python_wrapper_check_mandatory_member(PyObject *instance, const gchar *member)
Util function to check if a specific member is define in a Python object.
static PyTypeObject python_generic_type
void python_wrapper_to_protocol_feature(RemminaProtocolFeature *dest, PyObject *feature)
Converts the PyObject to RemminaProtocolFeature.
RemminaPlugin * python_wrapper_create_entry_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginEntry, initializes its members and references the wrapper ...
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...
static PyObject * remmina_public_get_server_port_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
static PyObject * remmina_protocol_widget_get_profile_remote_width_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
PyRemminaPluginScreenshotData * python_wrapper_screenshot_data_new(void)
void(* widget_pool_register)(GtkWidget *widget)
static PyModuleDef remmina_python_module_type
The definition of the Python module 'remmina'.
gint(* get_profile_remote_width)(RemminaProtocolWidget *gp)
static PyObject * python_wrapper_generic_to_int(PyGeneric *self, PyObject *args)
static PyObject * python_wrapper_get_mainwindow_wrapper(PyObject *self, PyObject *args)
void python_wrapper_entry_init(void)
Initializes the Python plugin specialisation for entry plugins.
PyObject * python_screenshot_data_new(PyTypeObject *type, PyObject *kws, PyObject *args)
RemminaPrefPlugin * pref_plugin
void python_wrapper_module_init(void)
Initializes all globals and registers the 'remmina' module in the Python engine.
static PyTypeObject python_protocol_feature_type
static PyObject * remmina_pref_keymap_get_keyval_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
static PyObject * remmina_widget_pool_register_wrapper(PyObject *self, PyObject *args, PyObject *kwargs)
static void python_wrapper_generic_dealloc(PyObject *self)
static PyObject * python_wrapper_log_print_wrapper(PyObject *self, PyObject *arg)
Contains the specialisation of RemminaPluginFile plugins in Python.
static PyObject * python_wrapper_debug_wrapper(PyObject *self, PyObject *msg)
static PyObject * remmina_masterthread_exec_is_main_thread_wrapper(PyObject *self, PyObject *plugin)
Adapter struct to handle Remmina protocol settings.
RemminaFile *(* file_new)(void)
void(* _remmina_debug)(const gchar *func, const gchar *fmt,...)
static PyObject * remmina_pref_get_scale_quality_wrapper(PyObject *self, PyObject *plugin)
RemminaTypeHint opt3_type_hint
static int python_protocol_setting_init(PyRemminaProtocolSetting *self, PyObject *args, PyObject *kwargs)
Constructor of the remmina.Setting Python type.
RemminaEntryPlugin * entry_plugin
static PyObject * remmina_protocol_plugin_signal_connection_closed_wrapper(PyObject *self, PyObject *args)
RemminaPlugin * python_wrapper_create_protocol_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginProtocol, initializes its members and references the wrapp...