Add ibusversion.h.in
authorPeng Huang <shawn.p.huang@gmail.com>
Tue, 23 Jun 2009 23:34:17 +0000 (07:34 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Tue, 23 Jun 2009 23:34:17 +0000 (07:34 +0800)
configure.ac
src/Makefile.am
src/ibus.h
src/ibusversion.h.in [new file with mode: 0644]

index eae476351404b6675c5a8914cf6d107d271f1543..8595e6d6507619801399c4fc67834ff15c437d70 100644 (file)
@@ -215,7 +215,7 @@ AC_ARG_ENABLE(qt4-immodule,
 if test x"$IBUS_HAS_QT4" != x"yes"; then
     enable_qt4=no
 fi
-enable_qt4=no
+enable_qt4=no
 AM_CONDITIONAL(IBUS_BUILD_QT4, [test x"$enable_qt4" = x"yes" ])
 
 # check for dbus-python
@@ -279,6 +279,7 @@ client/x11/Makefile
 setup/Makefile
 setup/ibus-setup
 src/Makefile
+src/ibusversion.h
 bus/Makefile
 bindings/Makefile
 bindings/python/Makefile
index c52d99b10d5c2f38daf77d81c6c739f7b937b5d0..ea68d97c3df233d49470fc54d883cca1a9927bd8 100644 (file)
@@ -39,6 +39,7 @@ ibus_built_sources = \
        $(NULL)
 ibus_public_h_sources = \
        ibus.h \
+       ibusversion.h \
        ibusshare.h \
        ibusdebug.h \
        ibusobject.h \
@@ -205,6 +206,7 @@ ibusmarshalers.c: ibusmarshalers.list
        && rm -f xgen-gmc
 
 EXTRA_DIST = \
+       ibusversion.h.in \
        ibusmarshalers.list \
        ibusenumtypes.h.template \
        ibusenumtypes.c.template \
@@ -215,3 +217,7 @@ CLEANFILES = \
        stamp-ibusmarshalers.h \
        stamp-ibusenumtypes.h \
        $(NULL)
+
+DISTCLEANFILES = \
+       ibusversion.h \
+       $(NULL)
index ddfd164eb22be8acc0a0f17cde9af1a3086e2a04..ef926733b98da426ba72b38f8229d44da9bb7bc8 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef __IBUS_H_
 #define __IBUS_H_
 
+#include <ibusversion.h>
 #include <ibusmainloop.h>
 #include <ibusshare.h>
 #include <ibusobject.h>
diff --git a/src/ibusversion.h.in b/src/ibusversion.h.in
new file mode 100644 (file)
index 0000000..5b85026
--- /dev/null
@@ -0,0 +1,39 @@
+/* vim:set et sts=4: */
+/* ibus - The Input Bus
+ * Copyright (C) 2008-2009 Huang Peng <shawn.p.huang@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#ifndef __IBUS_VERSION_H_
+#define __IBUS_VERSION_H_
+
+/* compile time version
+ */
+#define IBUS_MAJOR_VERSION                             (@PACKAGE_VERSION_MAJOR@)
+#define IBUS_MINOR_VERSION                             (@PACKAGE_VERSION_MINOR@)
+#define IBUS_MICRO_VERSION                             (@PACKAGE_VERSION_MICRO@)
+
+/* check whether a Gtk+ version equal to or greater than
+ * major.minor.micro is present.
+ */
+#define        IBUS_CHECK_VERSION(major,minor,micro)   \
+    (IBUS_MAJOR_VERSION > (major) || \
+     (IBUS_MAJOR_VERSION == (major) && IBUS_MINOR_VERSION > (minor)) || \
+     (IBUS_MAJOR_VERSION == (major) && IBUS_MINOR_VERSION == (minor) && \
+      IBUS_MICRO_VERSION >= (micro)))
+
+#endif
+