60 PyObject* result = NULL;
66 result = CallPythonMethod(plugin->
instance,
"import_test_func",
"s", from_file);
69 return result == Py_None || result != Py_False;
76 PyObject* result = NULL;
84 result = CallPythonMethod(plugin->
instance,
"import_func",
"s", from_file);
86 if (result == Py_None || result == Py_False)
98 PyObject* result = NULL;
103 result = CallPythonMethod(plugin->
instance,
109 return result == Py_None || result != Py_False;
115 TRACE_CALL(__func__);
117 PyObject* result = NULL;
122 result = CallPythonMethod(plugin->
instance,
"export_func",
"s", to_file);
125 return result == Py_None || result != Py_False;
130 TRACE_CALL(__func__);
132 PyObject* instance = plugin->
instance;
137 g_printerr(
"Unable to create file plugin. Aborting!\n");
144 remmina_plugin->
domain = GETTEXT_PACKAGE;
145 remmina_plugin->
name = PyUnicode_AsUTF8(PyObject_GetAttrString(instance,
ATTR_NAME));
146 remmina_plugin->
version = PyUnicode_AsUTF8(PyObject_GetAttrString(instance,
ATTR_VERSION));
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...
Maps an instance of a Python plugin to a Remmina one.
typedefG_BEGIN_DECLS struct _RemminaFile RemminaFile
const char * ATTR_EXPORT_HINTS
const gchar * export_hints
RemminaFile *(* import_func)(struct _RemminaFilePlugin *instance, const gchar *from_file)
static RemminaProtocolPlugin remmina_plugin
gboolean remmina_plugin_python_file_export_test_func_wrapper(RemminaFilePlugin *instance, RemminaFile *file)
RemminaFilePlugin * file_plugin
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_file_init(void)
Initializes the Python plugin specialisation for file plugins.
RemminaPlugin * remmina_plugin_python_create_file_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginFile, initializes its members and references the wrapper f...
const char * ATTR_DESCRIPTION
gboolean(* export_test_func)(struct _RemminaFilePlugin *instance, RemminaFile *file)
gboolean remmina_plugin_python_file_import_test_func_wrapper(RemminaFilePlugin *instance, const gchar *from_file)
RemminaPlugin * generic_plugin
gboolean remmina_plugin_python_file_export_func_wrapper(RemminaFilePlugin *instance, RemminaFile *file, const gchar *to_file)
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_check_attribute(PyObject *instance, const char *attr_name)
Checks if a given attribute exists.
Wrapper for a Python object that contains a pointer to an instance of RemminaFile.
gboolean(* import_test_func)(struct _RemminaFilePlugin *instance, const gchar *from_file)
const gchar * description
Contains functions and constants that are commonly used throughout the Python plugin implementation...
RemminaFile * remmina_plugin_python_file_import_func_wrapper(RemminaFilePlugin *instance, const gchar *from_file)
gboolean(* export_func)(struct _RemminaFilePlugin *instance, RemminaFile *file, const gchar *to_file)
void * remmina_plugin_python_malloc(int bytes)
Allocates memory and checks for errors before returning.
Contains the specialisation of RemminaPluginFile plugins in Python.
const char * ATTR_VERSION