56 PyObject* result = CallPythonMethod(plugin->
instance,
"init", NULL);
57 return result == Py_None || result != Py_False;
65 PyObject* result = CallPythonMethod(plugin->
instance,
"is_service_available", NULL);
66 return result == Py_None || result != Py_False;
75 CallPythonMethod(plugin
85 PyObject* result = CallPythonMethod(plugin
87 Py_ssize_t len = PyUnicode_GetLength(result);
102 CallPythonMethod(plugin
108 TRACE_CALL(__func__);
110 PyObject* instance = plugin->
instance;
120 remmina_plugin->
domain = GETTEXT_PACKAGE;
121 remmina_plugin->
name = PyUnicode_AsUTF8(PyObject_GetAttrString(instance,
ATTR_NAME));
122 remmina_plugin->
version = PyUnicode_AsUTF8(PyObject_GetAttrString(instance,
ATTR_VERSION));
Maps an instance of a Python plugin to a Remmina one.
typedefG_BEGIN_DECLS struct _RemminaFile RemminaFile
gboolean(* init)(struct _RemminaSecretPlugin *instance)
RemminaSecretPlugin * secret_plugin
gboolean python_wrapper_check_attribute(PyObject *instance, const char *attr_name)
Checks if a given attribute exists.
const char * ATTR_VERSION
void * python_wrapper_malloc(int bytes)
Allocates memory and checks for errors before returning.
static RemminaProtocolPlugin remmina_plugin
gboolean(* is_service_available)(struct _RemminaSecretPlugin *instance)
void(* delete_password)(struct _RemminaSecretPlugin *instance, RemminaFile *remminafile, const gchar *key)
gchar * python_wrapper_secret_get_password_wrapper(RemminaSecretPlugin *instance, RemminaFile *file, const gchar *key)
void python_wrapper_secret_store_password_wrapper(RemminaSecretPlugin *instance, RemminaFile *file, const gchar *key, const gchar *password)
const char * ATTR_INIT_ORDER
RemminaPlugin * python_wrapper_create_secret_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginSecret, initializes its members and references the wrapper...
Contains functions and constants that are commonly used throughout the Python plugin implementation...
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...
PyPlugin * python_wrapper_get_plugin(const gchar *name)
Tries to find the Python plugin matching to the given instance of RemminaPlugin.
void python_wrapper_add_plugin(PyPlugin *plugin)
Registers the given plugin if no other plugin with the same name has been already registered...
const gchar * description
void python_wrapper_secret_init(void)
Initializes the Python plugin specialisation for secret plugins.
RemminaPlugin * generic_plugin
gboolean python_wrapper_secret_init_wrapper(RemminaSecretPlugin *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.
const char * ATTR_DESCRIPTION
gboolean python_wrapper_secret_is_service_available_wrapper(RemminaSecretPlugin *instance)
gchar *(* get_password)(struct _RemminaSecretPlugin *instance, RemminaFile *remminafile, const gchar *key)
void(* store_password)(struct _RemminaSecretPlugin *instance, RemminaFile *remminafile, const gchar *key, const gchar *password)
void python_wrapper_secret_delete_password_wrapper(RemminaSecretPlugin *instance, RemminaFile *file, const gchar *key)