Sat Apr 16 14:53:15 2005 Jonathan Blandford <jrb@redhat.com>

        * glib/Makefile.am: Create poppler-enums.[ch]

        * glib/poppler.h:
        * glib/poppler-page.cc:
        * glib/poppler-page.h:
        * glib/poppler-action.h: Try to clean up the headers a bit

        * glib/poppler-document.cc:
        * glib/poppler-document.h: Add support for document data.
        Implemented as a lot of GObject properties.

        * glib/poppler-enums.c:
        * glib/poppler-enums.h: New autogenerated files.

        * glib/test-poppler-glib.c: Test the new document metadata.  Seems
        to work nicely, other than the PDF string and View Prefs.

        * poppler/Catalog.cc:
        * poppler/Catalog.h: Extend to support PageLayout.
parent f35c76cd
Sat Apr 16 14:53:15 2005 Jonathan Blandford <jrb@redhat.com>
* glib/Makefile.am: Create poppler-enums.[ch]
* glib/poppler.h:
* glib/poppler-page.cc:
* glib/poppler-page.h:
* glib/poppler-action.h: Try to clean up the headers a bit
* glib/poppler-document.cc:
* glib/poppler-document.h: Add support for document data.
Implemented as a lot of GObject properties.
* glib/poppler-enums.c:
* glib/poppler-enums.h: New autogenerated files.
* glib/test-poppler-glib.c: Test the new document metadata. Seems
to work nicely, other than the PDF string and View Prefs.
* poppler/Catalog.cc:
* poppler/Catalog.h: Extend to support PageLayout.
2005-04-14 Kristian Høgsberg <krh@redhat.com>
* glib/poppler-page.cc:
......
......@@ -17,16 +17,44 @@ INCLUDES = \
$(cairo_includes) \
-DDATADIR=\""$(datadir)"\"
poppler_glib_includedir = $(includedir)/poppler/glib
poppler_glib_include_HEADERS = \
poppler-enums.h: poppler-document.h
( cd $(srcdir) && glib-mkenums \
--fhead "#ifndef __POPPLER_TYPE_ENUMS_H__\n#define __POPPLER_TYPE_ENUMS_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--fprod "/* enumerations from \"@filename@\" */\n" \
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define POPPLER_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
--ftail "G_END_DECLS\n\n#endif /* __POPPLER_TYPE_ENUMS_H__ */" \
$(poppler_glib_public_headers) ) > poppler-enums.h
poppler-enums.c: poppler-document.h
( cd $(srcdir) && glib-mkenums \
--fhead "#include \"poppler-enums.h\"\n#include \"poppler-document.h\"\n" \
--ftail "#define __POPPLER_ENUMS_C__\n" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
$(poppler_glib_public_headers) ) > poppler-enums.c
poppler_glib_public_headers = \
poppler-action.h \
poppler-document.h \
poppler-page.h \
poppler.h
poppler_glib_includedir = $(includedir)/poppler/glib
poppler_glib_include_HEADERS = \
$(poppler_glib_public_headers) \
poppler-enums.h
lib_LTLIBRARIES = libpoppler-glib.la
libpoppler_glib_la_SOURCES = \
poppler-action.cc \
poppler-enums.c \
poppler-document.cc \
poppler-page.cc \
poppler.cc \
......
......@@ -27,13 +27,13 @@ G_BEGIN_DECLS
typedef enum
{
POPPLER_ACTION_UNKNOWN, // unknown action
POPPLER_ACTION_GOTO_DEST, // go to destination
POPPLER_ACTION_GOTO_REMOTE, // go to destination in new file
POPPLER_ACTION_LAUNCH, // launch app (or open document)
POPPLER_ACTION_URI, // URI
POPPLER_ACTION_NAMED, // named action
POPPLER_ACTION_MOVIE, // movie action
POPPLER_ACTION_UNKNOWN, /* unknown action */
POPPLER_ACTION_GOTO_DEST, /* go to destination */
POPPLER_ACTION_GOTO_REMOTE, /* go to destination in new file */
POPPLER_ACTION_LAUNCH, /* launch app (or open document) */
POPPLER_ACTION_URI, /* URI */
POPPLER_ACTION_NAMED, /* named action*/
POPPLER_ACTION_MOVIE, /* movie action */
} PopplerActionType;
typedef enum
......@@ -50,7 +50,6 @@ typedef enum
} PopplerDestType;
/* Define the PopplerAction types */
typedef union _PopplerAction PopplerAction;
typedef struct _PopplerActionAny PopplerActionAny;
typedef struct _PopplerActionGotoDest PopplerActionGotoDest;
typedef struct _PopplerActionGotoRemote PopplerActionGotoRemote;
......
......@@ -29,10 +29,18 @@
#include "poppler.h"
#include "poppler-private.h"
#include "poppler-enums.h"
enum {
PROP_0,
PROP_TITLE
PROP_TITLE,
PROP_FORMAT,
PROP_AUTHOR,
PROP_SUBJECT,
PROP_KEYWORDS,
PROP_PAGE_LAYOUT,
PROP_PAGE_MODE,
PROP_VIEWER_PREFERENCES,
};
typedef struct _PopplerDocumentClass PopplerDocumentClass;
......@@ -224,24 +232,107 @@ info_dict_get_string (Dict *info_dict, const gchar *key, GValue *value)
g_free (result);
}
static PopplerPageLayout
convert_page_layout (Catalog::PageLayout pageLayout)
{
switch (pageLayout)
{
case Catalog::pageLayoutSinglePage:
return POPPLER_PAGE_LAYOUT_SINGLE_PAGE;
case Catalog::pageLayoutOneColumn:
return POPPLER_PAGE_LAYOUT_ONE_COLUMN;
case Catalog::pageLayoutTwoColumnLeft:
return POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT;
case Catalog::pageLayoutTwoColumnRight:
return POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT;
case Catalog::pageLayoutTwoPageLeft:
return POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT;
case Catalog::pageLayoutTwoPageRight:
return POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT;
case Catalog::pageLayoutNone:
default:
return POPPLER_PAGE_LAYOUT_UNSET;
}
}
static PopplerPageMode
convert_page_mode (Catalog::PageMode pageMode)
{
switch (pageMode)
{
case Catalog::pageModeOutlines:
return POPPLER_PAGE_MODE_USE_OUTLINES;
case Catalog::pageModeThumbs:
return POPPLER_PAGE_MODE_USE_THUMBS;
case Catalog::pageModeFullScreen:
return POPPLER_PAGE_MODE_FULL_SCREEN;
case Catalog::pageModeOC:
return POPPLER_PAGE_MODE_USE_OC;
case Catalog::pageModeNone:
default:
return POPPLER_PAGE_MODE_UNSET;
}
}
static void
poppler_document_get_property (GObject *object,
guint prop_id,
GValue *value,
poppler_document_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
PopplerDocument *document = POPPLER_DOCUMENT (object);
Object info;
document->doc->getDocInfo (&info);
if (!info.isDict ())
return;
Object obj;
Catalog *catalog;
gchar *str;
switch (prop_id)
{
case PROP_TITLE:
info_dict_get_string (info.getDict(), "Title", value);
document->doc->getDocInfo (&obj);
if (obj.isDict ())
info_dict_get_string (obj.getDict(), "Title", value);
break;
case PROP_FORMAT:
str = g_strdup_printf ("PDF-%1f", document->doc->getPDFVersion ());
g_value_take_string (value, str);
break;
case PROP_AUTHOR:
document->doc->getDocInfo (&obj);
if (obj.isDict ())
info_dict_get_string (obj.getDict(), "Author", value);
break;
case PROP_SUBJECT:
document->doc->getDocInfo (&obj);
if (obj.isDict ())
info_dict_get_string (obj.getDict(), "Subject", value);
break;
case PROP_KEYWORDS:
document->doc->getDocInfo (&obj);
if (obj.isDict ())
info_dict_get_string (obj.getDict(), "Keywords", value);
break;
case PROP_PAGE_LAYOUT:
catalog = document->doc->getCatalog ();
if (catalog && catalog->isOk ())
{
PopplerPageLayout page_layout = convert_page_layout (catalog->getPageLayout ());
g_value_set_enum (value, page_layout);
}
break;
case PROP_PAGE_MODE:
catalog = document->doc->getCatalog ();
if (catalog && catalog->isOk ())
{
PopplerPageMode page_mode = convert_page_mode (catalog->getPageMode ());
g_value_set_enum (value, page_mode);
}
break;
case PROP_VIEWER_PREFERENCES:
/* FIXME: write... */
g_value_set_flags (value, POPPLER_VIEWER_PREFERENCES_UNSET);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
......@@ -249,19 +340,84 @@ static void
poppler_document_class_init (PopplerDocumentClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GParamSpec *pspec;
gobject_class->finalize = poppler_document_finalize;
gobject_class->get_property = poppler_document_get_property;
pspec = g_param_spec_string ("title",
"Document Title",
"The title of the document",
NULL,
G_PARAM_READABLE);
g_object_class_install_property (G_OBJECT_CLASS (klass),
PROP_TITLE,
pspec);
g_object_class_install_property
(G_OBJECT_CLASS (klass),
PROP_TITLE,
g_param_spec_string ("title",
"Document Title",
"The title of the document",
NULL,
G_PARAM_READABLE));
g_object_class_install_property
(G_OBJECT_CLASS (klass),
PROP_FORMAT,
g_param_spec_string ("format",
"PDF Format",
"The PDF version of the document",
NULL,
G_PARAM_READABLE));
g_object_class_install_property
(G_OBJECT_CLASS (klass),
PROP_AUTHOR,
g_param_spec_string ("author",
"Author",
"The author of the document",
NULL,
G_PARAM_READABLE));
g_object_class_install_property
(G_OBJECT_CLASS (klass),
PROP_SUBJECT,
g_param_spec_string ("subject",
"Subject",
"Subjects the document touches",
NULL,
G_PARAM_READABLE));
g_object_class_install_property
(G_OBJECT_CLASS (klass),
PROP_KEYWORDS,
g_param_spec_string ("keywords",
"Keywords",
"Keywords",
NULL,
G_PARAM_READABLE));
g_object_class_install_property
(G_OBJECT_CLASS (klass),
PROP_PAGE_LAYOUT,
g_param_spec_enum ("page-layout",
"Page Layout",
"Initial Page Layout",
POPPLER_TYPE_PAGE_LAYOUT,
POPPLER_PAGE_LAYOUT_UNSET,
G_PARAM_READABLE));
g_object_class_install_property
(G_OBJECT_CLASS (klass),
PROP_PAGE_MODE,
g_param_spec_enum ("page-mode",
"Page Mode",
"Page Mode",
POPPLER_TYPE_PAGE_MODE,
POPPLER_PAGE_MODE_UNSET,
G_PARAM_READABLE));
g_object_class_install_property
(G_OBJECT_CLASS (klass),
PROP_VIEWER_PREFERENCES,
g_param_spec_flags ("viewer-preferences",
"Viewer Preferences",
"Viewer Preferences",
POPPLER_TYPE_VIEWER_PREFERENCES,
POPPLER_VIEWER_PREFERENCES_UNSET,
G_PARAM_READABLE));
}
static void
......@@ -440,3 +596,5 @@ poppler_ps_file_free (PopplerPSFile *ps_file)
g_object_unref (ps_file->document);
g_free (ps_file);
}
......@@ -21,8 +21,8 @@
#include <glib-object.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "poppler.h"
#include "poppler-action.h"
G_BEGIN_DECLS
......@@ -30,10 +30,41 @@ G_BEGIN_DECLS
#define POPPLER_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_DOCUMENT, PopplerDocument))
#define POPPLER_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_DOCUMENT))
typedef struct _PopplerDocument PopplerDocument;
typedef struct _PopplerIndexIter PopplerIndexIter;
typedef struct _PopplerPage PopplerPage;
typedef struct _PopplerPSFile PopplerPSFile;
typedef enum
{
POPPLER_PAGE_LAYOUT_UNSET,
POPPLER_PAGE_LAYOUT_SINGLE_PAGE,
POPPLER_PAGE_LAYOUT_ONE_COLUMN,
POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT,
POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT,
POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT,
POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT,
} PopplerPageLayout;
typedef enum
{
POPPLER_PAGE_MODE_UNSET,
POPPLER_PAGE_MODE_NONE,
POPPLER_PAGE_MODE_USE_OUTLINES,
POPPLER_PAGE_MODE_USE_THUMBS,
POPPLER_PAGE_MODE_FULL_SCREEN,
POPPLER_PAGE_MODE_USE_OC,
POPPLER_PAGE_MODE_USE_ATTACHMENTS,
} PopplerPageMode;
typedef enum /*< flags >*/
{
POPPLER_VIEWER_PREFERENCES_UNSET = 0,
POPPLER_VIEWER_PREFERENCES_HIDE_TOOLBAR = 1 << 0,
POPPLER_VIEWER_PREFERENCES_HIDE_MENUBAR = 1 << 1,
POPPLER_VIEWER_PREFERENCES_HIDE_WINDOWUI = 1 << 2,
POPPLER_VIEWER_PREFERENCES_FIT_WINDOW = 1 << 3,
POPPLER_VIEWER_PREFERENCES_CENTER_WINDOW = 1 << 4,
POPPLER_VIEWER_PREFERENCES_DISPLAY_DOC_TITLE = 1 << 5,
POPPLER_VIEWER_PREFERENCES_DIRECTION_RTL = 1 << 6,
} PopplerViewerPreferences;
PopplerDocument *poppler_document_new_from_file (const char *uri,
const char *password,
......@@ -47,7 +78,7 @@ PopplerPage *poppler_document_get_page (PopplerDocument *document,
PopplerPage *poppler_document_get_page_by_label (PopplerDocument *document,
const char *label);
GType poppler_document_get_type (void) G_GNUC_CONST;
GType poppler_document_get_type (void) G_GNUC_CONST;
/* Interface for getting the Index of a poppler_document */
PopplerIndexIter *poppler_index_iter_new (PopplerDocument *document);
......
/* Generated data (by glib-mkenums) */
#include "poppler-enums.h"
#include "poppler-document.h"
/* enumerations from "poppler-action.h" */
GType
poppler_action_type_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
{ POPPLER_ACTION_UNKNOWN, "POPPLER_ACTION_UNKNOWN", "unknown" },
{ POPPLER_ACTION_GOTO_DEST, "POPPLER_ACTION_GOTO_DEST", "goto-dest" },
{ POPPLER_ACTION_GOTO_REMOTE, "POPPLER_ACTION_GOTO_REMOTE", "goto-remote" },
{ POPPLER_ACTION_LAUNCH, "POPPLER_ACTION_LAUNCH", "launch" },
{ POPPLER_ACTION_URI, "POPPLER_ACTION_URI", "uri" },
{ POPPLER_ACTION_NAMED, "POPPLER_ACTION_NAMED", "named" },
{ POPPLER_ACTION_MOVIE, "POPPLER_ACTION_MOVIE", "movie" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static ("PopplerActionType", values);
}
return etype;
}
GType
poppler_dest_type_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
{ POPPLER_DEST_UNKNOWN, "POPPLER_DEST_UNKNOWN", "unknown" },
{ POPPLER_DEST_XYZ, "POPPLER_DEST_XYZ", "xyz" },
{ POPPLER_DEST_FIT, "POPPLER_DEST_FIT", "fit" },
{ POPPLER_DEST_FITH, "POPPLER_DEST_FITH", "fith" },
{ POPPLER_DEST_FITV, "POPPLER_DEST_FITV", "fitv" },
{ POPPLER_DEST_FITR, "POPPLER_DEST_FITR", "fitr" },
{ POPPLER_DEST_FITB, "POPPLER_DEST_FITB", "fitb" },
{ POPPLER_DEST_FITBH, "POPPLER_DEST_FITBH", "fitbh" },
{ POPPLER_DEST_FITBV, "POPPLER_DEST_FITBV", "fitbv" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static ("PopplerDestType", values);
}
return etype;
}
/* enumerations from "poppler-document.h" */
GType
poppler_page_layout_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
{ POPPLER_PAGE_LAYOUT_UNSET, "POPPLER_PAGE_LAYOUT_UNSET", "unset" },
{ POPPLER_PAGE_LAYOUT_SINGLE_PAGE, "POPPLER_PAGE_LAYOUT_SINGLE_PAGE", "single-page" },
{ POPPLER_PAGE_LAYOUT_ONE_COLUMN, "POPPLER_PAGE_LAYOUT_ONE_COLUMN", "one-column" },
{ POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT, "POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT", "two-column-left" },
{ POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT, "POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT", "two-column-right" },
{ POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT, "POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT", "two-page-left" },
{ POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT, "POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT", "two-page-right" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static ("PopplerPageLayout", values);
}
return etype;
}
GType
poppler_page_mode_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
{ POPPLER_PAGE_MODE_UNSET, "POPPLER_PAGE_MODE_UNSET", "unset" },
{ POPPLER_PAGE_MODE_NONE, "POPPLER_PAGE_MODE_NONE", "none" },
{ POPPLER_PAGE_MODE_USE_OUTLINES, "POPPLER_PAGE_MODE_USE_OUTLINES", "use-outlines" },
{ POPPLER_PAGE_MODE_USE_THUMBS, "POPPLER_PAGE_MODE_USE_THUMBS", "use-thumbs" },
{ POPPLER_PAGE_MODE_FULL_SCREEN, "POPPLER_PAGE_MODE_FULL_SCREEN", "full-screen" },
{ POPPLER_PAGE_MODE_USE_OC, "POPPLER_PAGE_MODE_USE_OC", "use-oc" },
{ POPPLER_PAGE_MODE_USE_ATTACHMENTS, "POPPLER_PAGE_MODE_USE_ATTACHMENTS", "use-attachments" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static ("PopplerPageMode", values);
}
return etype;
}
GType
poppler_viewer_preferences_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GFlagsValue values[] = {
{ POPPLER_VIEWER_PREFERENCES_UNSET, "POPPLER_VIEWER_PREFERENCES_UNSET", "unset" },
{ POPPLER_VIEWER_PREFERENCES_HIDE_TOOLBAR, "POPPLER_VIEWER_PREFERENCES_HIDE_TOOLBAR", "hide-toolbar" },
{ POPPLER_VIEWER_PREFERENCES_HIDE_MENUBAR, "POPPLER_VIEWER_PREFERENCES_HIDE_MENUBAR", "hide-menubar" },
{ POPPLER_VIEWER_PREFERENCES_HIDE_WINDOWUI, "POPPLER_VIEWER_PREFERENCES_HIDE_WINDOWUI", "hide-windowui" },
{ POPPLER_VIEWER_PREFERENCES_FIT_WINDOW, "POPPLER_VIEWER_PREFERENCES_FIT_WINDOW", "fit-window" },
{ POPPLER_VIEWER_PREFERENCES_CENTER_WINDOW, "POPPLER_VIEWER_PREFERENCES_CENTER_WINDOW", "center-window" },
{ POPPLER_VIEWER_PREFERENCES_DISPLAY_DOC_TITLE, "POPPLER_VIEWER_PREFERENCES_DISPLAY_DOC_TITLE", "display-doc-title" },
{ POPPLER_VIEWER_PREFERENCES_DIRECTION_RTL, "POPPLER_VIEWER_PREFERENCES_DIRECTION_RTL", "direction-rtl" },
{ 0, NULL, NULL }
};
etype = g_flags_register_static ("PopplerViewerPreferences", values);
}
return etype;
}
/* enumerations from "poppler.h" */
GType
poppler_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
{ POPPLER_ERROR_INVALID, "POPPLER_ERROR_INVALID", "invalid" },
{ POPPLER_ERROR_ENCRYPTED, "POPPLER_ERROR_ENCRYPTED", "encrypted" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static ("PopplerError", values);
}
return etype;
}
GType
poppler_orientation_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
{ POPPLER_ORIENTATION_DOCUMENT, "POPPLER_ORIENTATION_DOCUMENT", "document" },
{ POPPLER_ORIENTATION_PORTRAIT, "POPPLER_ORIENTATION_PORTRAIT", "portrait" },
{ POPPLER_ORIENTATION_LANDSCAPE, "POPPLER_ORIENTATION_LANDSCAPE", "landscape" },
{ POPPLER_ORIENTATION_UPSIDEDOWN, "POPPLER_ORIENTATION_UPSIDEDOWN", "upsidedown" },
{ POPPLER_ORIENTATION_SEASCAPE, "POPPLER_ORIENTATION_SEASCAPE", "seascape" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static ("PopplerOrientation", values);
}
return etype;
}
#define __POPPLER_ENUMS_C__
/* Generated data ends here */
/* Generated data (by glib-mkenums) */
#ifndef __POPPLER_TYPE_ENUMS_H__
#define __POPPLER_TYPE_ENUMS_H__
#include <glib-object.h>
G_BEGIN_DECLS
/* enumerations from "poppler-action.h" */
GType poppler_action_type_get_type (void) G_GNUC_CONST;
#define POPPLER_TYPE_ACTION_TYPE (poppler_action_type_get_type())
GType poppler_dest_type_get_type (void) G_GNUC_CONST;
#define POPPLER_TYPE_DEST_TYPE (poppler_dest_type_get_type())
/* enumerations from "poppler-document.h" */
GType poppler_page_layout_get_type (void) G_GNUC_CONST;
#define POPPLER_TYPE_PAGE_LAYOUT (poppler_page_layout_get_type())
GType poppler_page_mode_get_type (void) G_GNUC_CONST;
#define POPPLER_TYPE_PAGE_MODE (poppler_page_mode_get_type())
GType poppler_viewer_preferences_get_type (void) G_GNUC_CONST;
#define POPPLER_TYPE_VIEWER_PREFERENCES (poppler_viewer_preferences_get_type())
/* enumerations from "poppler.h" */
GType poppler_error_get_type (void) G_GNUC_CONST;
#define POPPLER_TYPE_ERROR (poppler_error_get_type())
GType poppler_orientation_get_type (void) G_GNUC_CONST;
#define POPPLER_TYPE_ORIENTATION (poppler_orientation_get_type())
G_END_DECLS
#endif /* __POPPLER_TYPE_ENUMS_H__ */
/* Generated data ends here */
......@@ -243,7 +243,6 @@ splash_render_to_pixbuf (PopplerPage *page,
SplashColor white;
SplashBitmap *bitmap;
SplashColorPtr color_ptr;
SplashRGB8 *src;
int splash_width, splash_height, splash_rowstride;
int pixbuf_rowstride, pixbuf_n_channels;
guchar *pixbuf_data, *dst;
......@@ -281,7 +280,6 @@ splash_render_to_pixbuf (PopplerPage *page,
for (y = 0; y < splash_height; y++)
{
SplashRGB8 *src;
SplashRGB8 rgb;
src = (SplashRGB8 *) (color_ptr.rgb8p + y * splash_rowstride);
dst = pixbuf_data + (dest_y + y) * pixbuf_rowstride +
......@@ -427,7 +425,6 @@ poppler_page_get_text (PopplerPage *page,
TextOutputDev *output_dev;
PDFDoc *doc;
GooString *sel_text = new GooString;
PopplerRectangle text_dev_rect;
double height, y1, y2;
char *result;
......
......@@ -21,6 +21,7 @@
#include <glib-object.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "poppler.h"
G_BEGIN_DECLS
......
......@@ -43,10 +43,17 @@ typedef enum
POPPLER_ORIENTATION_SEASCAPE
} PopplerOrientation;
typedef struct _PopplerDocument PopplerDocument;
typedef struct _PopplerIndexIter PopplerIndexIter;
typedef struct _PopplerPage PopplerPage;
typedef struct _PopplerPSFile PopplerPSFile;
typedef union _PopplerAction PopplerAction;
G_END_DECLS
#include "poppler-document.h"
#include "poppler-page.h"
#include "poppler-action.h"
#include "poppler-enums.h"
#endif /* __POPPLER_GLIB_H__ */
......@@ -5,11 +5,53 @@
#define FAIL(msg) \
do { fprintf (stderr, "FAIL: %s\n", msg); exit (-1); } while (0)
static void
print_document_info (PopplerDocument *document)
{
gchar *title, *format, *author, *subject, *keywords;
PopplerPageLayout layout;
PopplerPageMode mode;
PopplerViewerPreferences view_prefs;
GEnumValue *enum_value;
g_object_get (document,
"title", &title,
"format", &format,
"author", &author,
"subject", &subject,
"keywords", &keywords,
"page-mode", &mode,
"page-layout", &layout,
"viewer-preferences", &view_prefs,