+2008-03-03 Carlos Garcia Campos <carlosgc@gnome.org>
+
+ * backend/pdf/pdfdocument.evince-backend.in:
+ * libdocument/ev-backends-manager.c:
+ (ev_backends_manager_load_backend),
+ (ev_backends_manager_get_document):
+ * libdocument/ev-module.[ch]: (ev_module_load), (ev_module_new):
+
+ Allow making backend modules resident. This is needed only for
+ some backends like pdf to avoid registering glib types more than
+ once.
+
2008-03-03 Carlos Garcia Campos <carlosgc@gnome.org>
* backend/comics/comics-document.c:
[Evince Backend]
Module=pdfdocument
+Resident=true
_TypeDescription=PDF Documents
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf
struct _EvBackendInfo {
gchar *module_name;
GTypeModule *module;
+ gboolean resident;
GType type_id;
return NULL;
}
+ info->resident = g_key_file_get_boolean (backend_file, EV_BACKENDS_GROUP,
+ "Resident", NULL);
+
info->type_desc = g_key_file_get_locale_string (backend_file, EV_BACKENDS_GROUP,
"TypeDescription", NULL, NULL);
if (!info->type_desc) {
gchar *path;
path = g_module_build_path (EV_BACKENDSDIR, info->module_name);
- info->module = G_TYPE_MODULE (ev_module_new (path));
+ info->module = G_TYPE_MODULE (ev_module_new (path, info->resident));
g_free (path);
}
GTypeModule parent_instance;
GModule *library;
+ gboolean resident;
gchar *path;
GType type;
return FALSE;
}
+ if (module->resident)
+ g_module_make_resident (module->library);
+
return TRUE;
}
}
EvModule *
-ev_module_new (const gchar *path)
+ev_module_new (const gchar *path,
+ gboolean resident)
{
EvModule *result;
g_type_module_set_name (G_TYPE_MODULE (result), path);
result->path = g_strdup (path);
+ result->resident = resident;
return result;
}
GType ev_module_get_type (void) G_GNUC_CONST;
-EvModule *ev_module_new (const gchar *path);
+EvModule *ev_module_new (const gchar *path,
+ gboolean resident);
const gchar *ev_module_get_path (EvModule *module);