59 PyObject* result = NULL;
65 result = CallPythonMethod(plugin->
instance,
"import_test_func",
"s", from_file);
68 return result == Py_None || result != Py_False;
75 PyObject* result = NULL;
83 result = CallPythonMethod(plugin->
instance,
"import_func",
"s", from_file);
85 if (result == Py_None || result == Py_False)
97 PyObject* result = NULL;
102 result = CallPythonMethod(plugin->
instance,
108 return result == Py_None || result != Py_False;
114 TRACE_CALL(__func__);
116 PyObject* result = NULL;
121 result = CallPythonMethod(plugin->
instance,
"export_func",
"s", to_file);
124 return result == Py_None || result != Py_False;
129 TRACE_CALL(__func__);
131 PyObject* instance = plugin->
instance;
136 g_printerr(
"Unable to create file plugin. Aborting!\n");
143 remmina_plugin->
domain = GETTEXT_PACKAGE;
144 remmina_plugin->
name = PyUnicode_AsUTF8(PyObject_GetAttrString(instance,
ATTR_NAME));
145 remmina_plugin->
version = PyUnicode_AsUTF8(PyObject_GetAttrString(instance,
ATTR_VERSION));
gboolean python_wrapper_file_export_test_func_wrapper(RemminaFilePlugin *instance, RemminaFile *file)
Maps an instance of a Python plugin to a Remmina one.
typedefG_BEGIN_DECLS struct _RemminaFile RemminaFile
const gchar * export_hints
gboolean python_wrapper_check_attribute(PyObject *instance, const char *attr_name)
Checks if a given attribute exists.
gboolean python_wrapper_file_import_test_func_wrapper(RemminaFilePlugin *instance, const gchar *from_file)
RemminaFile *(* import_func)(struct _RemminaFilePlugin *instance, const gchar *from_file)
const char * ATTR_VERSION
void * python_wrapper_malloc(int bytes)
Allocates memory and checks for errors before returning.
static RemminaProtocolPlugin remmina_plugin
RemminaFilePlugin * file_plugin
void python_wrapper_file_init(void)
Initializes the Python plugin specialisation for file plugins.
RemminaFile * python_wrapper_file_import_func_wrapper(RemminaFilePlugin *instance, const gchar *from_file)
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...
RemminaPlugin * python_wrapper_create_file_plugin(PyPlugin *plugin)
Creates a new instance of the RemminaPluginFile, initializes its members and references the wrapper f...
gboolean(* export_test_func)(struct _RemminaFilePlugin *instance, RemminaFile *file)
RemminaPlugin * generic_plugin
const char * ATTR_EXPORT_HINTS
const char * ATTR_DESCRIPTION
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
gboolean python_wrapper_file_export_func_wrapper(RemminaFilePlugin *instance, RemminaFile *file, const gchar *to_file)
gboolean(* export_func)(struct _RemminaFilePlugin *instance, RemminaFile *file, const gchar *to_file)
Contains the specialisation of RemminaPluginFile plugins in Python.