]> www.fi.muni.cz Git - evince.git/commitdiff
More docs
authorChristian Persch <chpe@src.gnome.org>
Sun, 15 Feb 2009 13:52:19 +0000 (13:52 +0000)
committerChristian Persch <chpe@src.gnome.org>
Sun, 15 Feb 2009 13:52:19 +0000 (13:52 +0000)
svn path=/trunk/; revision=3446

libdocument/ev-document-factory.c

index 575dfb955dfe03166df34e9031ffefeb86a450f7..19a06039b3c13c67384d614409668585d72cd66c 100644 (file)
@@ -191,6 +191,17 @@ free_uncompressed_uri (gchar *uri_unc)
        g_free (uri_unc);
 }
 
+/**
+ * ev_document_factory_get_document:
+ * @uri: an URI
+ * @error: a #GError location to store an error, or %NULL
+ *
+ * Creates a #EvDocument for the document at @uri; or, if no backend handling
+ * the document's type is found, or an error occurred on opening the document,
+ * returns %NULL and fills in @error.
+ *
+ * Returns: a new #EvDocument, or %NULL.
+ */
 EvDocument *
 ev_document_factory_get_document (const char *uri, GError **error)
 {
@@ -311,7 +322,21 @@ file_filter_add_mime_types (EvTypeInfo *info, GtkFileFilter *filter)
                gtk_file_filter_add_mime_type (filter, mime_type);
 }
 
-void 
+/**
+ * ev_document_factory_add_filters:
+ * @chooser: a #GtkFileChooser
+ * @document: a #EvDocument, or %NULL
+ *
+ * Adds some file filters to @chooser.
+ * Always add a "All documents" format.
+ * 
+ * If @document is not %NULL, adds a #GtkFileFilter for @document's MIME type.
+ *
+ * If @document is %NULL, adds a #GtkFileFilter for each document type that evince
+ * can handle.
+ */
+void
 ev_document_factory_add_filters (GtkWidget *chooser, EvDocument *document)
 {
        GList         *all_types;
@@ -319,6 +344,9 @@ ev_document_factory_add_filters (GtkWidget *chooser, EvDocument *document)
        GtkFileFilter *default_filter;
        GtkFileFilter *document_filter;
 
+        g_return_if_fail (GTK_IS_FILE_CHOOSER (chooser));
+        g_return_if_fail (document == NULL || EV_IS_DOCUMENT (document));
+
        all_types = ev_backends_manager_get_all_types_info ();
        
        default_filter = document_filter = filter = gtk_file_filter_new ();