4 * An OpenGL based 'interactive canvas' library.
6 * Authored By Matthew Allum <mallum@openedhand.com>
8 * Copyright (C) 2006 OpenedHand
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
26 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
27 #error "Only <clutter/clutter.h> can be included directly."
30 #ifndef __CLUTTER_VERSION_H__
31 #define __CLUTTER_VERSION_H__
34 * SECTION:clutter-version
35 * @short_description: Versioning utility macros
37 * Clutter offers a set of macros for checking the version of the library
38 * at compile time; it also provides a function to perform the same check
41 * Clutter adds version information to both API deprecations and additions;
42 * by definining the macros %CLUTTER_VERSION_MIN_REQUIRED and
43 * %CLUTTER_VERSION_MAX_ALLOWED, you can specify the range of Clutter versions
44 * whose API you want to use. Functions that were deprecated before, or
45 * introduced after, this range will trigger compiler warnings. For instance,
46 * if we define the following symbols:
49 * CLUTTER_VERSION_MIN_REQUIRED = CLUTTER_VERSION_1_6
50 * CLUTTER_VERSION_MAX_ALLOWED = CLUTTER_VERSION_1_8
53 * and we have the following functions annotated in the Clutter headers:
56 * void clutter_function_A (void) CLUTTER_DEPRECATED_IN_1_4;
57 * void clutter_function_B (void) CLUTTER_DEPRECATED_IN_1_6;
58 * void clutter_function_C (void) CLUTTER_AVAILABLE_IN_1_8;
59 * void clutter_function_D (void) CLUTTER_AVAILABLE_IN_1_10;
62 * then any application code using the functions above will get the output:
65 * clutter_function_A: deprecation warning
66 * clutter_function_B: no warning
67 * clutter_function_C: no warning
68 * clutter_function_D: symbol not available warning
71 * It is possible to disable the compiler warnings by defining the macro
72 * %CLUTTER_DISABLE_DEPRECATION_WARNINGS before including the clutter.h
81 * CLUTTER_MAJOR_VERSION:
83 * The major version of the Clutter library (1, if %CLUTTER_VERSION is 1.2.3)
85 #define CLUTTER_MAJOR_VERSION (@CLUTTER_MAJOR_VERSION@)
88 * CLUTTER_MINOR_VERSION:
90 * The minor version of the Clutter library (2, if %CLUTTER_VERSION is 1.2.3)
92 #define CLUTTER_MINOR_VERSION (@CLUTTER_MINOR_VERSION@)
95 * CLUTTER_MICRO_VERSION:
97 * The micro version of the Clutter library (3, if %CLUTTER_VERSION is 1.2.3)
99 #define CLUTTER_MICRO_VERSION (@CLUTTER_MICRO_VERSION@)
104 * The full version of the Clutter library, like 1.2.3
106 #define CLUTTER_VERSION @CLUTTER_VERSION@
111 * The full version of the Clutter library, in string form (suited for
112 * string concatenation)
114 #define CLUTTER_VERSION_S "@CLUTTER_VERSION@"
117 * CLUTTER_VERSION_HEX:
119 * Numerically encoded version of the Clutter library, like 0x010203
121 #define CLUTTER_VERSION_HEX ((CLUTTER_MAJOR_VERSION << 24) | \
122 (CLUTTER_MINOR_VERSION << 16) | \
123 (CLUTTER_MICRO_VERSION << 8))
125 /* XXX - Every new stable minor release bump should add a macro here */
128 * CLUTTER_VERSION_1_0:
130 * A macro that evaluates to the 1.0 version of Clutter, in a format
131 * that can be used by the C pre-processor.
135 #define CLUTTER_VERSION_1_0 (G_ENCODE_VERSION (1, 0))
138 * CLUTTER_VERSION_1_2:
140 * A macro that evaluates to the 1.2 version of Clutter, in a format
141 * that can be used by the C pre-processor.
145 #define CLUTTER_VERSION_1_2 (G_ENCODE_VERSION (1, 2))
148 * CLUTTER_VERSION_1_4:
150 * A macro that evaluates to the 1.4 version of Clutter, in a format
151 * that can be used by the C pre-processor.
155 #define CLUTTER_VERSION_1_4 (G_ENCODE_VERSION (1, 4))
158 * CLUTTER_VERSION_1_6:
160 * A macro that evaluates to the 1.6 version of Clutter, in a format
161 * that can be used by the C pre-processor.
165 #define CLUTTER_VERSION_1_6 (G_ENCODE_VERSION (1, 6))
168 * CLUTTER_VERSION_1_8:
170 * A macro that evaluates to the 1.8 version of Clutter, in a format
171 * that can be used by the C pre-processor.
175 #define CLUTTER_VERSION_1_8 (G_ENCODE_VERSION (1, 8))
178 * CLUTTER_VERSION_1_10:
180 * A macro that evaluates to the 1.10 version of Clutter, in a format
181 * that can be used by the C pre-processor.
185 #define CLUTTER_VERSION_1_10 (G_ENCODE_VERSION (1, 10))
188 * CLUTTER_VERSION_1_12:
190 * A macro that evaluates to the 1.12 version of Clutter, in a format
191 * that can be used by the C pre-processor.
195 #define CLUTTER_VERSION_1_12 (G_ENCODE_VERSION (1, 12))
197 /* evaluates to the current stable version; for development cycles,
198 * this means the next stable target
200 #if (CLUTTER_MINOR_VERSION % 2)
201 # define CLUTTER_VERSION_CUR_STABLE (G_ENCODE_VERSION (CLUTTER_MAJOR_VERSION, CLUTTER_MINOR_VERSION + 1))
203 # define CLUTTER_VERSION_CUR_STABLE (G_ENCODE_VERSION (CLUTTER_MAJOR_VERSION, CLUTTER_MINOR_VERSION))
206 /* evaluates to the previous stable version */
207 #if (CLUTTER_MINOR_VERSION % 2)
208 # define CLUTTER_VERSION_PREV_STABLE (G_ENCODE_VERSION (CLUTTER_MAJOR_VERSION, CLUTTER_MINOR_VERSION - 1))
210 # define CLUTTER_VERSION_PREV_STABLE (G_ENCODE_VERSION (CLUTTER_MAJOR_VERSION, CLUTTER_MINOR_VERSION - 2))
214 * CLUTTER_CHECK_VERSION:
215 * @major: major version, like 1 in 1.2.3
216 * @minor: minor version, like 2 in 1.2.3
217 * @micro: micro version, like 3 in 1.2.3
219 * Evaluates to %TRUE if the version of the Clutter library is greater
220 * than @major, @minor and @micro
222 #define CLUTTER_CHECK_VERSION(major,minor,micro) \
223 (CLUTTER_MAJOR_VERSION > (major) || \
224 (CLUTTER_MAJOR_VERSION == (major) && CLUTTER_MINOR_VERSION > (minor)) || \
225 (CLUTTER_MAJOR_VERSION == (major) && CLUTTER_MINOR_VERSION == (minor) && CLUTTER_MICRO_VERSION >= (micro)))
227 /* annotation for exported variables
229 * XXX: this has to be defined here because clutter-macro.h imports this
233 # ifdef CLUTTER_COMPILATION
234 # define CLUTTER_VAR __declspec(dllexport)
236 # define CLUTTER_VAR extern __declspec(dllimport)
239 # define CLUTTER_VAR extern
243 * clutter_major_version:
245 * The major component of the Clutter library version, e.g. 1 if the version
248 * This value can be used for run-time version checks
250 * For a compile-time check, use %CLUTTER_MAJOR_VERSION
254 CLUTTER_VAR const guint clutter_major_version;
257 * clutter_minor_version:
259 * The minor component of the Clutter library version, e.g. 2 if the version
262 * This value can be used for run-time version checks
264 * For a compile-time check, use %CLUTTER_MINOR_VERSION
268 CLUTTER_VAR const guint clutter_minor_version;
271 * clutter_micro_version:
273 * The micro component of the Clutter library version, e.g. 3 if the version
276 * This value can be used for run-time version checks
278 * For a compile-time check, use %CLUTTER_MICRO_VERSION
282 CLUTTER_VAR const guint clutter_micro_version;
284 gboolean clutter_check_version (guint major,
288 gboolean clutter_check_windowing_backend (const char *backend_type);
292 #endif /* __CLUTTER_VERSION_H__ */