-typedef struct _EvDocumentType EvDocumentType;
-struct _EvDocumentType
-{
- const char *mime_type;
- GType (*document_type_factory_callback)();
-};
-
-const EvDocumentType document_types[] = {
- /* PDF: */
- {"application/pdf", pdf_document_get_type},
-
- /* Postscript: */
- {"application/postscript", ps_document_get_type},
- {"application/x-gzpostscript", ps_document_get_type},
- {"image/x-eps", ps_document_get_type},
-
-#ifdef ENABLE_TIFF
- /* Tiff: */
- {"image/tiff", tiff_document_get_type},
-#endif
-
-#ifdef ENABLE_DJVU
- /* djvu: */
- {"image/vnd.djvu", djvu_document_get_type},
-#endif
-
-#ifdef ENABLE_DVI
- /* dvi: */
- {"application/x-dvi", dvi_document_get_type},
-#endif
-};
-
-/* Would be nice to have this in gdk-pixbuf */
-static gboolean
-mime_type_supported_by_gdk_pixbuf (const gchar *mime_type)
-{
- GSList *formats, *list;
- gboolean retval = FALSE;
-
- formats = gdk_pixbuf_get_formats ();
-
- list = formats;
- while (list) {
- GdkPixbufFormat *format = list->data;
- int i;
- gchar **mime_types;
-
- if (gdk_pixbuf_format_is_disabled (format))
- continue;
-
- mime_types = gdk_pixbuf_format_get_mime_types (format);
-
- for (i = 0; mime_types[i] != NULL; i++) {
- if (strcmp (mime_types[i], mime_type) == 0) {
- retval = TRUE;
- break;
- }
- }
-
- if (retval)
- break;
-
- list = list->next;
- }
-
- g_slist_free (formats);
-
- return retval;
-}
-
-
-static GType
-ev_document_type_from_from_mime (const char *mime_type)
-{
- int i;
-
- g_return_val_if_fail (mime_type, G_TYPE_INVALID);
-
- for (i = 0; i < G_N_ELEMENTS (document_types); i++) {
- if (strcmp (mime_type, document_types[i].mime_type) == 0) {
- g_assert (document_types[i].document_type_factory_callback != NULL);
- return document_types[i].document_type_factory_callback();
- }
- }
-
- if (mime_type_supported_by_gdk_pixbuf (mime_type)) {
- return pixbuf_document_get_type ();
- }
-
- return G_TYPE_INVALID;
-}
-
-/**
- * ev_document_type_get_type:
- * @uri: String with uri
- * @slow: Do we need to check slow gnome-vfs mime type
- * @mime_type: If we've found handled type, the mime_type string is returned here.
- * @error: Information about error occured
- *
- * Return value: G_TYPE_INVALID on error, G_TYPE_NONE when we are not sure about
- * mime type, and type of EvDocument implementation when we've found document.
- **/
-static GType
-ev_document_type_get_type (const char *uri, gboolean slow, gchar **mime_type, GError **error)