From 2c7cd7b91b5ab3f17ac0cf8cd42723504f2bea88 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Thu, 4 Jun 2009 22:35:40 +0200 Subject: [PATCH] Add poppler version defines and version check macro Add POPPLER_[MAJOR|MINOR|MICRO]_VERSION defines and POPPLER_CHECK_VERSION macro. FDO bug #22091. --- configure.ac | 11 ++++- glib/poppler-features.h.in | 9 +++ glib/reference/poppler-docs.sgml | 1 + glib/reference/poppler-sections.txt | 10 ++++ glib/reference/tmpl/poppler-features.sgml | 80 +++++++++++++++++++++++++++++ 5 files changed, 110 insertions(+), 1 deletions(-) create mode 100644 glib/reference/tmpl/poppler-features.sgml diff --git a/configure.ac b/configure.ac index 1eb8fd1..605251e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,10 @@ +m4_define([poppler_version_major],[0]) +m4_define([poppler_version_minor],[11]) +m4_define([poppler_version_micro],[0]) +m4_define([poppler_version],[poppler_version_major.poppler_version_minor.poppler_version_micro]) + AC_PREREQ(2.59) -AC_INIT(poppler, 0.11.0) +AC_INIT([poppler],[poppler_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=poppler]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER(config.h) @@ -496,6 +501,10 @@ esac AC_SUBST(PC_REQUIRES) AC_SUBST(PC_REQUIRES_PRIVATE) +AC_SUBST([POPPLER_MAJOR_VERSION],[poppler_version_major]) +AC_SUBST([POPPLER_MINOR_VERSION],[poppler_version_minor]) +AC_SUBST([POPPLER_MICRO_VERSION],[poppler_version_micro]) + AC_OUTPUT([ Makefile goo/Makefile diff --git a/glib/poppler-features.h.in b/glib/poppler-features.h.in index 7b72569..99c7ed8 100644 --- a/glib/poppler-features.h.in +++ b/glib/poppler-features.h.in @@ -22,4 +22,13 @@ @CAIRO_FEATURE@ @GDK_FEATURE@ +#define POPPLER_MAJOR_VERSION (@POPPLER_MAJOR_VERSION@) +#define POPPLER_MINOR_VERSION (@POPPLER_MINOR_VERSION@) +#define POPPLER_MICRO_VERSION (@POPPLER_MICRO_VERSION@) + +#define POPPLER_CHECK_VERSION(major,minor,micro) \ + (POPPLER_MAJOR_VERSION > (major) || \ + (POPPLER_MAJOR_VERSION == (major) && POPPLER_MINOR_VERSION > (minor)) || \ + (POPPLER_MAJOR_VERSION == (major) && POPPLER_MINOR_VERSION == (minor) && POPPLER_MICRO_VERSION >= (micro))) + #endif /* __POPPLER_FEATURES_H__ */ diff --git a/glib/reference/poppler-docs.sgml b/glib/reference/poppler-docs.sgml index e75d4cd..ded9a9c 100644 --- a/glib/reference/poppler-docs.sgml +++ b/glib/reference/poppler-docs.sgml @@ -17,5 +17,6 @@ + diff --git a/glib/reference/poppler-sections.txt b/glib/reference/poppler-sections.txt index 5388be0..070fdc9 100644 --- a/glib/reference/poppler-sections.txt +++ b/glib/reference/poppler-sections.txt @@ -308,3 +308,13 @@ poppler_layer_hide poppler_layer_is_parent poppler_layer_get_radio_button_group_id + +
+poppler-features +POPPLER_HAS_CAIRO +POPPLER_WITH_GDK +POPPLER_MAJOR_VERSION +POPPLER_MINOR_VERSION +POPPLER_MICRO_VERSION +POPPLER_CHECK_VERSION +
diff --git a/glib/reference/tmpl/poppler-features.sgml b/glib/reference/tmpl/poppler-features.sgml new file mode 100644 index 0000000..22f90b0 --- /dev/null +++ b/glib/reference/tmpl/poppler-features.sgml @@ -0,0 +1,80 @@ + +Version and Features Information + + +Variables and functions to check the poppler version and features + + + +Poppler provides version information, and information about features +enabled at compile time. This is primarily useful in configure checks +for builds that have a configure script, or for allowing code to optionally +depend but not require a specific poppler version. + + + + + + + + + + + + +Defined if poppler was compiled with cairo support. + + + + + + +Defined if poppler was compiled with GDK support. + + + + + + +The major version number of the poppler header files (e.g. in poppler version +0.1.2 this is 0.) + + +Since: 0.11 + + + + + + + +The major version number of the poppler header files (e.g. in poppler version +0.1.2 this is 1.) + +Since: 0.11 + + + + + +The micro version number of the poppler header files (e.g. in poppler version +0.1.2 this is 2.) + + +Since: 0.11 + + + + + +Returns %TRUE if the version of the poppler header files is the same +as or newer than the passed-in version. + + +@major: major version (e.g. 0 for version 0.1.2) +@minor: minor version (e.g. 1 for version 0.1.2) +@micro: micro version (e.g. 2 for version 0.1.2) + +Since: 0.11 + + -- 1.6.2.2.471.g6da14