[poppler] poppler/glib: poppler-page.cc, 1.18, 1.19 poppler-page.h, 1.13, 1.14 poppler.h, 1.8, 1.9

Kristian Hogsberg krh at freedesktop.org
Mon Jun 20 10:58:40 PDT 2005


Update of /cvs/poppler/poppler/glib
In directory gabe:/tmp/cvs-serv5233/glib

Modified Files:
	poppler-page.cc poppler-page.h poppler.h 
Log Message:
2005-06-20  Kristian Høgsberg  <krh at redhat.com>

        * glib/poppler-page.cc:
        * glib/poppler-page.h:
        * glib/poppler.h: Clean up glib rotation implementation and add a
        getter for rotation.  Patch from Marco.



Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler-page.cc,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- poppler-page.cc	20 Jun 2005 17:22:35 -0000	1.18
+++ poppler-page.cc	20 Jun 2005 17:58:38 -0000	1.19
@@ -46,27 +46,6 @@
 
 G_DEFINE_TYPE (PopplerPage, poppler_page, G_TYPE_OBJECT);
 
-PopplerPage *
-_poppler_page_new (PopplerDocument *document, Page *page, int index)
-{
-  PopplerPage *poppler_page;
-
-  g_return_val_if_fail (POPPLER_IS_DOCUMENT (document), NULL);
-
-  poppler_page = (PopplerPage *) g_object_new (POPPLER_TYPE_PAGE, NULL);
-  poppler_page->document = document;
-  poppler_page->page = page;
-  poppler_page->index = index;
-
-  return poppler_page;
-}
-
-static void
-poppler_page_finalize (GObject *object)
-{
-  /* page->page is owned by the document */
-}
-
 static PopplerOrientation
 get_document_orientation (PopplerPage *page)
 {
@@ -90,6 +69,28 @@
   return orientation;
 }
 
+PopplerPage *
+_poppler_page_new (PopplerDocument *document, Page *page, int index)
+{
+  PopplerPage *poppler_page;
+
+  g_return_val_if_fail (POPPLER_IS_DOCUMENT (document), NULL);
+
+  poppler_page = (PopplerPage *) g_object_new (POPPLER_TYPE_PAGE, NULL);
+  poppler_page->document = document;
+  poppler_page->page = page;
+  poppler_page->index = index;
+  poppler_page->orientation = get_document_orientation (poppler_page);
+
+  return poppler_page;
+}
+
+static void
+poppler_page_finalize (GObject *object)
+{
+  /* page->page is owned by the document */
+}
+
 static int
 poppler_page_get_rotate (PopplerPage *page)
 {
@@ -120,18 +121,11 @@
 		       double      *width,
 		       double      *height)
 {
-  PopplerOrientation orientation;
   double page_width, page_height;
 
   g_return_if_fail (POPPLER_IS_PAGE (page));
 
-  if (page->orientation == POPPLER_ORIENTATION_DOCUMENT) {
-    orientation = get_document_orientation (page);
-  } else {
-    orientation = page->orientation;
-  }
-
-  switch (orientation) {
+  switch (page->orientation) {
     case POPPLER_ORIENTATION_PORTRAIT:
     case POPPLER_ORIENTATION_UPSIDEDOWN:
       page_width = page->page->getWidth ();
@@ -544,7 +538,6 @@
 static void
 poppler_page_init (PopplerPage *page)
 {
-  page->orientation = POPPLER_ORIENTATION_DOCUMENT;
 }
 
 
@@ -643,6 +636,22 @@
   page->orientation = orientation;
 }
 
+/**
+ * poppler_page_get_orientation:
+ * @page: a #PopplerPage
+ * @orientation: a #PopplerOrientation
+ *
+ * Return the orientation of the specified page
+ *
+ * Return value: a #PopplerOrientation
+ **/
+PopplerOrientation
+poppler_page_get_orientation (PopplerPage *page)
+{
+  g_return_val_if_fail (POPPLER_IS_PAGE (page), POPPLER_ORIENTATION_PORTRAIT);
+
+  return page->orientation;
+}
 /* PopplerRectangle type */
 
 GType

Index: poppler-page.h
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler-page.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- poppler-page.h	4 May 2005 06:32:38 -0000	1.13
+++ poppler-page.h	20 Jun 2005 17:58:38 -0000	1.14
@@ -32,34 +32,35 @@
 #define POPPLER_IS_PAGE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_PAGE))
 
 
-GType      poppler_page_get_type         (void) G_GNUC_CONST;
-void       poppler_page_render_to_pixbuf   (PopplerPage        *page,
-					    int                 src_x,
-					    int                 src_y,
-					    int                 src_width,
-					    int                 src_height,
-					    double              scale,
-					    GdkPixbuf          *pixbuf,
-					    int                 dest_x,
-					    int                 dest_y);
-void       poppler_page_get_size           (PopplerPage        *page,
-					    double             *width,
-					    double             *height);
-void       poppler_page_set_orientation    (PopplerPage        *page,
-					    PopplerOrientation  orientation);
-int        poppler_page_get_index          (PopplerPage        *page);
-GdkPixbuf *poppler_page_get_thumbnail      (PopplerPage        *page);
-gboolean   poppler_page_get_thumbnail_size (PopplerPage        *page,
-					    int                *width,
-					    int                *height);
-GList     *poppler_page_find_text          (PopplerPage        *page,
-					    const  char        *text);
-void       poppler_page_render_to_ps       (PopplerPage        *page,
-					    PopplerPSFile      *ps_file);
-char      *poppler_page_get_text           (PopplerPage        *page,
-					    PopplerRectangle   *rect);
-GList     *poppler_page_get_link_mapping   (PopplerPage        *page);
-void       poppler_page_free_link_mapping  (GList              *list);
+GType      	    poppler_page_get_type           (void) G_GNUC_CONST;
+void		    poppler_page_render_to_pixbuf   (PopplerPage        *page,
+					             int                 src_x,
+					             int                 src_y,
+					             int                 src_width,
+					             int                 src_height,
+					             double              scale,
+					             GdkPixbuf          *pixbuf,
+					             int                 dest_x,
+					             int                 dest_y);
+void		    poppler_page_get_size           (PopplerPage        *page,
+					    	     double             *width,
+					             double             *height);
+PopplerOrientation  poppler_page_get_orientation    (PopplerPage        *page);
+void		    poppler_page_set_orientation    (PopplerPage        *page,
+					             PopplerOrientation  orientation);
+int		    poppler_page_get_index          (PopplerPage        *page);
+GdkPixbuf          *poppler_page_get_thumbnail      (PopplerPage        *page);
+gboolean   	    poppler_page_get_thumbnail_size (PopplerPage        *page,
+					    	     int                *width,
+					             int                *height);
+GList     	   *poppler_page_find_text          (PopplerPage        *page,
+					             const  char        *text);
+void                poppler_page_render_to_ps       (PopplerPage        *page,
+					             PopplerPSFile      *ps_file);
+char               *poppler_page_get_text           (PopplerPage        *page,
+					             PopplerRectangle   *rect);
+GList              *poppler_page_get_link_mapping   (PopplerPage        *page);
+void                poppler_page_free_link_mapping  (GList              *list);
 
 
 /* A rectangle on a page, with coordinates in PDF points. */

Index: poppler.h
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- poppler.h	13 Jun 2005 16:09:33 -0000	1.8
+++ poppler.h	20 Jun 2005 17:58:38 -0000	1.9
@@ -36,7 +36,6 @@
 
 typedef enum
 {
-	POPPLER_ORIENTATION_DOCUMENT,
 	POPPLER_ORIENTATION_PORTRAIT,
 	POPPLER_ORIENTATION_LANDSCAPE,
 	POPPLER_ORIENTATION_UPSIDEDOWN,



More information about the poppler mailing list