aboutsummaryrefslogtreecommitdiff
path: root/src/app-indicator-version.h.in
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2026-06-10 17:23:31 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2026-06-10 17:23:31 +0200
commit13fa5796c545355c87e19b6f2b91e4576f498b5e (patch)
tree46403e38d9f63c70354cd3ff4479e49151e63156 /src/app-indicator-version.h.in
parent0a1de62141772e44813a39a36f659d49a54c2e4b (diff)
parentbfef7f60d6af13f8ae5cd733a7d61f47766e9d27 (diff)
downloadlibayatana-appindicator-13fa5796c545355c87e19b6f2b91e4576f498b5e.tar.gz
libayatana-appindicator-13fa5796c545355c87e19b6f2b91e4576f498b5e.tar.bz2
libayatana-appindicator-13fa5796c545355c87e19b6f2b91e4576f498b5e.zip
Merge branch 'sunweaver-pr/tooltip-support'
Attributes GH PR #5: https://github.com/AyatanaIndicators/libayatana-appindicator/pull/5
Diffstat (limited to 'src/app-indicator-version.h.in')
-rw-r--r--src/app-indicator-version.h.in109
1 files changed, 109 insertions, 0 deletions
diff --git a/src/app-indicator-version.h.in b/src/app-indicator-version.h.in
new file mode 100644
index 0000000..7d99c87
--- /dev/null
+++ b/src/app-indicator-version.h.in
@@ -0,0 +1,109 @@
+/*
+Copyright (C) 2021 Guido Berhoerster <guido+ayatana@berhoerster.name>
+
+This program is free software: you can redistribute it and/or modify it
+under the terms of either or both of the following licenses:
+
+1) the GNU Lesser General Public License version 3, as published by the
+ Free Software Foundation; and/or
+2) the GNU Lesser General Public License version 2.1, as published by
+ the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranties of
+MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the applicable version of the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of both the GNU Lesser General Public
+License version 3 and version 2.1 along with this program. If not, see
+<http://www.gnu.org/licenses/>
+*/
+
+#ifndef APP_INDICATOR_VERSION_H
+#define APP_INDICATOR_VERSION_H
+
+#if !defined(APP_INDICATOR_INSIDE) && !defined(APP_INDICATOR_COMPILATION)
+#error "Only <app-indicator.h> can be included directly."
+#endif
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION:app-indicator-version
+ * @Title: Versioning
+ * @short_description: Ayatana Application Indicators version checking
+ *
+ * ayatana-appindicator provides macros for checking the version of the library
+ * an application is compiled against.
+ */
+
+/**
+ * AYATANA_APP_INDICATOR_MAJOR_VERSION:
+ *
+ * Ayatana Application Indicators major version component (e.g. 1 if
+ * %AYATANA_APP_INDICATOR_VERSION is 1.2.3)
+ */
+#define AYATANA_APP_INDICATOR_MAJOR_VERSION (@PROJECT_VERSION_MAJOR@)
+
+/**
+ * AYATANA_APP_INDICATOR_MINOR_VERSION:
+ *
+ * Ayatana Application Indicators minor version component (e.g. 2 if
+ * %AYATANA_APP_INDICATOR_VERSION is 1.2.3)
+ */
+#define AYATANA_APP_INDICATOR_MINOR_VERSION (@PROJECT_VERSION_MINOR@)
+
+/**
+ * AYATANA_APP_INDICATOR_MICRO_VERSION:
+ *
+ * Ayatana Application Indicators micro version component (e.g. 3 if
+ * %AYATANA_APP_INDICATOR_VERSION is 1.2.3)
+ */
+#define AYATANA_APP_INDICATOR_MICRO_VERSION (@PROJECT_VERSION_PATCH@)
+
+/**
+ * AYATANA_APP_INDICATOR_VERSION
+ *
+ * Ayatana Application Indicators version, e.g. 1.2.3.
+ */
+#define AYATANA_APP_INDICATOR_VERSION (@PROJECT_VERSION@)
+
+/**
+ * AYATANA_APP_INDICATOR_VERSION_S:
+ *
+ * Ayatana Application Indicators version, encoded as a string which may be
+ * concatenated, e.g. "1.2.3".
+ */
+#define AYATANA_APP_INDICATOR_VERSION_S "@PROJECT_VERSION@"
+
+#define AYATANA_APP_INDICATOR_ENCODE_VERSION(major,minor,micro) \
+ ((major) << 24 | (minor) << 16 | (micro) << 8)
+
+/**
+ * AYATANA_APP_INDICATOR_VERSION_HEX:
+ *
+ * Ayatana Application Indicators version, encoded as an hexadecimal number
+ * which may be compared to an integer number, e.g. 0x010203.
+ */
+#define AYATANA_APP_INDICATOR_VERSION_HEX \
+ (AYATANA_APP_INDICATOR_ENCODE_VERSION (AYATANA_APP_INDICATOR_MAJOR_VERSION, AYATANA_APP_INDICATOR_MINOR_VERSION, AYATANA_APP_INDICATOR_MICRO_VERSION))
+
+/**
+ * AYATANA_APP_INDICATOR_CHECK_VERSION:
+ * @major: required major version
+ * @minor: required minor version
+ * @micro: required micro version
+ *
+ * Compile-time version checking. Evaluates to %TRUE if the version of
+ * ayatana-appindicator is greater than the given @major, @minor, and @micro
+ * numbers.
+ */
+#define AYATANA_APP_INDICATOR_CHECK_VERSION(major,minor,micro) \
+ (AYATANA_APP_INDICATOR_MAJOR_VERSION > (major) || \
+ (AYATANA_APP_INDICATOR_MAJOR_VERSION == (major) && AYATANA_APP_INDICATOR_MINOR_VERSION > (minor)) || \
+ (AYATANA_APP_INDICATOR_MAJOR_VERSION == (major) && AYATANA_APP_INDICATOR_MINOR_VERSION == (minor) && AYATANA_APP_INDICATOR_MICRO_VERSION >= (micro)))
+
+G_END_DECLS
+
+#endif /* APP_INDICATOR_VERSION_H */