]> www.fi.muni.cz Git - evince.git/blobdiff - libdocument/ev-document.c
Updated Thai translation.
[evince.git] / libdocument / ev-document.c
index c1262933268517a6eafd6be84bd5ea9390a36f5c..09f58870d363acab9b25fb3a540efa1777829149 100644 (file)
@@ -15,7 +15,7 @@
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  */
 
@@ -46,6 +46,8 @@ struct _EvDocumentPrivate
 
        gdouble         max_width;
        gdouble         max_height;
+       gdouble         min_width;
+       gdouble         min_height;
        gint            max_label;
 
        gchar         **page_labels;
@@ -141,6 +143,7 @@ ev_document_class_init (EvDocumentClass *klass)
 
        klass->get_page = ev_document_impl_get_page;
        klass->get_info = ev_document_impl_get_info;
+       klass->get_backend_info = NULL;
 
        g_object_class->finalize = ev_document_finalize;
 }
@@ -263,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)) {
@@ -286,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);
@@ -423,6 +432,18 @@ ev_document_get_info (EvDocument *document)
        return document->priv->info;
 }
 
+gboolean
+ev_document_get_backend_info (EvDocument *document, EvDocumentBackendInfo *info)
+{
+       g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
+
+       EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);
+       if (klass->get_backend_info == NULL)
+               return FALSE;
+
+       return klass->get_backend_info (document, info);
+}
+
 cairo_surface_t *
 ev_document_render (EvDocument      *document,
                    EvRenderContext *rc)
@@ -470,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)
 {