Commit 6d7f624c authored by Kristian Høgsberg's avatar Kristian Høgsberg

2005-05-16 Kristian Høgsberg <krh@redhat.com>

        * configure.ac: Check for glib-mkenums.

        * glib/Makefile.am (poppler-enums.h): Generate glib enums at
        compile time.

        * glib/poppler-enums.c:
        * glib/poppler-enums.h: Removed.
parent 2801b54a
2005-05-16 Kristian Høgsberg <krh@redhat.com>
* configure.ac: Check for glib-mkenums.
* glib/Makefile.am (poppler-enums.h): Generate glib enums at
compile time.
* glib/poppler-enums.c:
* glib/poppler-enums.h: Removed.
* test/gtk-cairo-test.cc: Update this test case also.
* poppler/CairoOutputDevX.cc: Track changes to cairo Xlib surface
......
......@@ -206,6 +206,9 @@ elif test x$enable_poppler_glib = xtry; then
[enable_poppler_glib="yes"],
[enable_poppler_glib="no"])
fi
if test x$enable_poppler_glib = xyes; then
AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
fi
AM_CONDITIONAL(BUILD_POPPLER_GLIB, test x$enable_poppler_glib = xyes)
AC_ARG_ENABLE(poppler-qt,
......
......@@ -5,3 +5,4 @@
Makefile
Makefile.in
test-poppler-glib
stamp-*
......@@ -17,27 +17,42 @@ INCLUDES = \
$(cairo_includes) \
-DDATADIR=\""$(datadir)"\"
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
stamp_files = stamp-poppler-enums.h
poppler-enums.h: stamp-poppler-enums.h
@true
stamp-poppler-enums.h: $(poppler_glib_public_headers)
( cd $(srcdir) && $(GLIB_MKENUMS) \
--fhead "#ifndef __POPPLER_TYPE_ENUMS_H__\n" \
--fhead "#define __POPPLER_TYPE_ENUMS_H__ 1\n\n" \
--fhead "#include <glib-object.h>\n\n" \
--fhead "G_BEGIN_DECLS\n\n" \
--ftail "G_END_DECLS\n\n" \
--ftail "#endif /* __POPPLER_TYPE_ENUMS_H__ */\n" \
--fprod "\n/* --- @filename@ --- */" \
--eprod "#define POPPLER_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
--eprod "GType @enum_name@_get_type (void) G_GNUC_CONST;\n" \
$(^F) ) > xgen-$(@F) \
&& ( cmp -s xgen-$(@F) $(@F:stamp-%=%) || cp xgen-$(@F) $(@F:stamp-%=%) ) \
&& rm -f xgen-$(@F) \
&& echo timestamp > $(@F)
poppler-enums.c: $(poppler_glib_public_headers)
( cd $(srcdir) && $(GLIB_MKENUMS) \
--fhead "#include \"poppler-enums.h\"\n\n" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n#include \"@filename@\"" \
--vhead "static const G@Type@Value _@enum_name@_values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n};\n\n" \
--vtail "GType\n@enum_name@_get_type (void)\n{\n" \
--vtail " static GType type = 0;\n\n" \
--vtail " if (G_UNLIKELY (type == 0))\n" \
--vtail " type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" \
--vtail " return type;\n}\n\n" \
$(^F) ) > xgen-$(@F) \
&& ( cmp -s xgen-$(@F) $(@F) || cp xgen-$(@F) $(@F) ) \
&& rm -f xgen-$(@F)
poppler_glib_public_headers = \
poppler-action.h \
......@@ -53,8 +68,8 @@ poppler_glib_include_HEADERS = \
lib_LTLIBRARIES = libpoppler-glib.la
libpoppler_glib_la_SOURCES = \
$(BUILT_SOURCES) \
poppler-action.cc \
poppler-enums.c \
poppler-document.cc \
poppler-page.cc \
poppler.cc \
......@@ -77,3 +92,11 @@ test_poppler_glib_LDADD = \
$(POPPLER_GLIB_LIBS) \
$(FREETYPE_LIBS) \
$(cairo_libs)
BUILT_SOURCES = \
poppler-enums.c \
poppler-enums.h
CLEANFILES = $(BUILT_SOURCES) $(stamp_files)
DISTCLEANFILES = $(BUILT_SOURCES) $(stamp_files)
MAINTAINERCLEANFILES = $(BUILT_SOURCES) $(stamp_files)
/* 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;
}
GType
poppler_permissions_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GFlagsValue values[] = {
{ POPPLER_PERMISSIONS_PRINT, "POPPLER_PERMISSIONS_PRINT", "print" },
{ POPPLER_PERMISSIONS_MODIFY, "POPPLER_PERMISSIONS_MODIFY", "modify" },
{ POPPLER_PERMISSIONS_COPY, "POPPLER_PERMISSIONS_COPY", "copy" },
{ POPPLER_PERMISSIONS_EXTRACT_TEXT, "POPPLER_PERMISSIONS_EXTRACT_TEXT", "extract-text" },
{ POPPLER_PERMISSIONS_ANNOTATIONS_AND_FORMS, "POPPLER_PERMISSIONS_ANNOTATIONS_AND_FORMS", "annotations-and-forms" },
{ POPPLER_PERMISSIONS_FORMS, "POPPLER_PERMISSIONS_FORMS", "forms" },
{ POPPLER_PERMISSIONS_PRINT_LOW_QUALITY, "POPPLER_PERMISSIONS_PRINT_LOW_QUALITY", "print-low-quality" },
{ 0, NULL, NULL }
};
etype = g_flags_register_static ("PopplerPermissions", 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;
}
GType
poppler_backend_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
{ POPPLER_BACKEND_UNKNOWN, "POPPLER_BACKEND_UNKNOWN", "unknown" },
{ POPPLER_BACKEND_SPLASH, "POPPLER_BACKEND_SPLASH", "splash" },
{ POPPLER_BACKEND_CAIRO, "POPPLER_BACKEND_CAIRO", "cairo" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static ("PopplerBackend", 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())
GType poppler_permissions_get_type (void) G_GNUC_CONST;
#define POPPLER_TYPE_PERMISSIONS (poppler_permissions_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())
GType poppler_backend_get_type (void) G_GNUC_CONST;
#define POPPLER_TYPE_BACKEND (poppler_backend_get_type())
G_END_DECLS
#endif /* __POPPLER_TYPE_ENUMS_H__ */
/* Generated data ends here */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment