]> www.fi.muni.cz Git - evince.git/commitdiff
[libdocument] Add ev_document_get_min_page_size()
authorCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 31 May 2010 15:37:49 +0000 (17:37 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 31 May 2010 16:57:59 +0000 (18:57 +0200)
libdocument/ev-document.c
libdocument/ev-document.h

index d99a5968a6856fd8ba54fb8e7e983534f3d4d5c5..09f58870d363acab9b25fb3a540efa1777829149 100644 (file)
@@ -46,6 +46,8 @@ struct _EvDocumentPrivate
 
        gdouble         max_width;
        gdouble         max_height;
+       gdouble         min_width;
+       gdouble         min_height;
        gint            max_label;
 
        gchar         **page_labels;
@@ -264,6 +266,8 @@ ev_document_load (EvDocument  *document,
                                priv->uniform_height = page_height;
                                priv->max_width = priv->uniform_width;
                                priv->max_height = priv->uniform_height;
+                               priv->min_width = priv->uniform_width;
+                               priv->min_height = priv->uniform_height;
                        } else if (priv->uniform &&
                                   (priv->uniform_width != page_width ||
                                    priv->uniform_height != page_height)) {
@@ -287,9 +291,13 @@ ev_document_load (EvDocument  *document,
 
                                if (page_width > priv->max_width)
                                        priv->max_width = page_width;
+                               if (page_width < priv->min_width)
+                                       priv->min_width = page_width;
 
                                if (page_height > priv->max_height)
                                        priv->max_height = page_height;
+                               if (page_height < priv->min_height)
+                                       priv->min_height = page_height;
                        }
 
                        page_label = _ev_document_get_page_label (document, page);
@@ -483,6 +491,19 @@ ev_document_get_max_page_size (EvDocument *document,
                *height = document->priv->max_height;
 }
 
+void
+ev_document_get_min_page_size (EvDocument *document,
+                              gdouble    *width,
+                              gdouble    *height)
+{
+       g_return_if_fail (EV_IS_DOCUMENT (document));
+
+       if (width)
+               *width = document->priv->min_width;
+       if (height)
+               *height = document->priv->min_height;
+}
+
 gboolean
 ev_document_check_dimensions (EvDocument *document)
 {
index 8993808bb2b55a6404633e9757e2d782f7fe4b8d..68b33075c261f8d5317ff6effacb68bc2a4862e5 100644 (file)
@@ -148,6 +148,9 @@ gboolean         ev_document_is_page_size_uniform (EvDocument      *document);
 void             ev_document_get_max_page_size    (EvDocument      *document,
                                                   gdouble         *width,
                                                   gdouble         *height);
+void             ev_document_get_min_page_size    (EvDocument      *document,
+                                                  gdouble         *width,
+                                                  gdouble         *height);
 gboolean         ev_document_check_dimensions     (EvDocument      *document);
 gint             ev_document_get_max_label_len    (EvDocument      *document);
 gboolean         ev_document_has_text_page_labels (EvDocument      *document);