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));
gchar * remmina_plugin_python_secret_get_password_wrapper(RemminaSecretPlugin *instance, RemminaFile *file, const gchar *key)
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...
const char * ATTR_INIT_ORDER
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
void remmina_plugin_python_secret_init(void)
Initializes the Python plugin specialisation for secret plugins.
static RemminaProtocolPlugin remmina_plugin
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.
gboolean(* is_service_available)(struct _RemminaSecretPlugin *instance)
void(* delete_password)(struct _RemminaSecretPlugin *instance, RemminaFile *remminafile, const gchar *key)
PyPlugin * remmina_plugin_python_get_plugin(const char *name)
Tries to find the Python plugin matching to the given instance of RemminaPlugin.
void remmina_plugin_python_secret_delete_password_wrapper(RemminaSecretPlugin *instance, RemminaFile *file, const gchar *key)
const char * ATTR_DESCRIPTION
const gchar * description
RemminaPlugin * generic_plugin
void remmina_plugin_python_add_plugin(PyPlugin *plugin)
Registers the given plugin if no other plugin with the same name has been already registered...
gboolean remmina_plugin_python_secret_is_service_available_wrapper(RemminaSecretPlugin *instance)
gboolean remmina_plugin_python_check_attribute(PyObject *instance, const char *attr_name)
Checks if a given attribute exists.
void remmina_plugin_python_secret_store_password_wrapper(RemminaSecretPlugin *instance, RemminaFile *file, const gchar *key, const gchar *password)
Contains functions and constants that are commonly used throughout the Python plugin implementation...
gchar *(* get_password)(struct _RemminaSecretPlugin *instance, RemminaFile *remminafile, const gchar *key)
void * remmina_plugin_python_malloc(int bytes)
Allocates memory and checks for errors before returning.
void(* store_password)(struct _RemminaSecretPlugin *instance, RemminaFile *remminafile, const gchar *key, const gchar *password)
gboolean remmina_plugin_python_secret_init_wrapper(RemminaSecretPlugin *instance)
RemminaPlugin * remmina_plugin_python_create_secret_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginSecret, initializes its members and references the wrapper...
const char * ATTR_VERSION