1 /* ATK - Accessibility Toolkit
3 * Copyright (C) 2012 Igalia, S.L.
4 * Copyright (C) 2014 Chun-wei Fan
6 * Author: Alejandro PiƱeiro Iglesias <apinheiro@igalia.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 #if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
25 #error "Only <atk/atk.h> can be included directly."
28 #ifndef __ATK_VERSION_H__
29 #define __ATK_VERSION_H__
36 * Like atk_get_major_version(), but from the headers used at
37 * application compile time, rather than from the library linked
38 * against at application run time.
42 #define ATK_MAJOR_VERSION (@ATK_MAJOR_VERSION@)
47 * Like atk_get_minor_version(), but from the headers used at
48 * application compile time, rather than from the library linked
49 * against at application run time.
53 #define ATK_MINOR_VERSION (@ATK_MINOR_VERSION@)
58 * Like atk_get_micro_version(), but from the headers used at
59 * application compile time, rather than from the library linked
60 * against at application run time.
64 #define ATK_MICRO_VERSION (@ATK_MICRO_VERSION@)
69 * Like atk_get_binary_age(), but from the headers used at
70 * application compile time, rather than from the library linked
71 * against at application run time.
75 #define ATK_BINARY_AGE (@ATK_BINARY_AGE@)
80 * Like atk_get_interface_age(), but from the headers used at
81 * application compile time, rather than from the library linked
82 * against at application run time.
86 #define ATK_INTERFACE_AGE (@ATK_INTERFACE_AGE@)
90 * @major: major version (e.g. 1 for version 1.2.5)
91 * @minor: minor version (e.g. 2 for version 1.2.5)
92 * @micro: micro version (e.g. 5 for version 1.2.5)
94 * Returns %TRUE if the version of the ATK header files is the same as
95 * or newer than the passed-in version.
99 #define ATK_CHECK_VERSION(major,minor,micro) \
100 (ATK_MAJOR_VERSION > (major) || \
101 (ATK_MAJOR_VERSION == (major) && ATK_MINOR_VERSION > (minor)) || \
102 (ATK_MAJOR_VERSION == (major) && ATK_MINOR_VERSION == (minor) && \
103 ATK_MICRO_VERSION >= (micro)))
106 #define _ATK_EXTERN extern
112 * A macro that evaluates to the 2.2 version of ATK, in a format
113 * that can be used by the C pre-processor.
117 #define ATK_VERSION_2_2 (G_ENCODE_VERSION (2, 2))
122 * A macro that evaluates to the 2.4 version of ATK, in a format
123 * that can be used by the C pre-processor.
127 #define ATK_VERSION_2_4 (G_ENCODE_VERSION (2, 4))
132 * A macro that evaluates to the 2.6 version of ATK, in a format
133 * that can be used by the C pre-processor.
137 #define ATK_VERSION_2_6 (G_ENCODE_VERSION (2, 6))
142 * A macro that evaluates to the 2.8 version of ATK, in a format
143 * that can be used by the C pre-processor.
147 #define ATK_VERSION_2_8 (G_ENCODE_VERSION (2, 8))
152 * A macro that evaluates to the 2.10 version of ATK, in a format
153 * that can be used by the C pre-processor.
158 #define ATK_VERSION_2_10 (G_ENCODE_VERSION (2, 10))
162 * A macro that evaluates to the 2.12 version of ATK, in a format
163 * that can be used by the C pre-processor.
167 #define ATK_VERSION_2_12 (G_ENCODE_VERSION (2, 12))
172 * A macro that evaluates to the 2.14 version of ATK, in a format
173 * that can be used by the C pre-processor.
177 #define ATK_VERSION_2_14 (G_ENCODE_VERSION (2, 14))
182 * A macro that evaluates to the 2.30 version of ATK, in a format
183 * that can be used by the C pre-processor.
187 #define ATK_VERSION_2_30 (G_ENCODE_VERSION (2, 30))
192 * A macro that evaluates to the 2.36 version of ATK, in a format
193 * that can be used by the C pre-processor.
197 #define ATK_VERSION_2_36 (G_ENCODE_VERSION (2, 36))
199 /* evaluates to the current stable version; for development cycles,
200 * this means the next stable target
202 #if (ATK_MINOR_VERSION % 2)
203 #define ATK_VERSION_CUR_STABLE (G_ENCODE_VERSION (ATK_MAJOR_VERSION, ATK_MINOR_VERSION + 1))
205 #define ATK_VERSION_CUR_STABLE (G_ENCODE_VERSION (ATK_MAJOR_VERSION, ATK_MINOR_VERSION))
208 /* evaluates to the previous stable version */
209 #if (ATK_MINOR_VERSION % 2)
210 #define ATK_VERSION_PREV_STABLE (G_ENCODE_VERSION (ATK_MAJOR_VERSION, ATK_MINOR_VERSION - 1))
212 #define ATK_VERSION_PREV_STABLE (G_ENCODE_VERSION (ATK_MAJOR_VERSION, ATK_MINOR_VERSION - 2))
216 * ATK_VERSION_MIN_REQUIRED:
218 * A macro that should be defined by the user prior to including
219 * the atk/atk.h header.
220 * The definition should be one of the predefined ATK version
221 * macros: %ATK_VERSION_2_12, %ATK_VERSION_2_14,...
223 * This macro defines the earliest version of ATK that the package is
224 * required to be able to compile against.
226 * If the compiler is configured to warn about the use of deprecated
227 * functions, then using functions that were deprecated in version
228 * %ATK_VERSION_MIN_REQUIRED or earlier will cause warnings (but
229 * using functions deprecated in later releases will not).
233 /* If the package sets ATK_VERSION_MIN_REQUIRED to some future
234 * ATK_VERSION_X_Y value that we don't know about, it will compare as
235 * 0 in preprocessor tests.
237 #ifndef ATK_VERSION_MIN_REQUIRED
238 # define ATK_VERSION_MIN_REQUIRED (ATK_VERSION_CUR_STABLE)
239 #elif ATK_VERSION_MIN_REQUIRED == 0
240 # undef ATK_VERSION_MIN_REQUIRED
241 # define ATK_VERSION_MIN_REQUIRED (ATK_VERSION_CUR_STABLE + 2)
245 * ATK_VERSION_MAX_ALLOWED:
247 * A macro that should be defined by the user prior to including
248 * the atk/atk.h header.
249 * The definition should be one of the predefined ATK version
250 * macros: %ATK_VERSION_2_12, %ATK_VERSION_2_14,...
252 * This macro defines the latest version of the ATK API that the
253 * package is allowed to make use of.
255 * If the compiler is configured to warn about the use of deprecated
256 * functions, then using functions added after version
257 * %ATK_VERSION_MAX_ALLOWED will cause warnings.
259 * Unless you are using ATK_CHECK_VERSION() or the like to compile
260 * different code depending on the ATK version, then this should be
261 * set to the same value as %ATK_VERSION_MIN_REQUIRED.
265 #if !defined (ATK_VERSION_MAX_ALLOWED) || (ATK_VERSION_MAX_ALLOWED == 0)
266 # undef ATK_VERSION_MAX_ALLOWED
267 # define ATK_VERSION_MAX_ALLOWED (ATK_VERSION_CUR_STABLE)
271 #if ATK_VERSION_MIN_REQUIRED > ATK_VERSION_CUR_STABLE
272 #error "ATK_VERSION_MIN_REQUIRED must be <= ATK_VERSION_CUR_STABLE"
274 #if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_MIN_REQUIRED
275 #error "ATK_VERSION_MAX_ALLOWED must be >= ATK_VERSION_MIN_REQUIRED"
277 #if ATK_VERSION_MIN_REQUIRED < ATK_VERSION_2_2
278 #error "ATK_VERSION_MIN_REQUIRED must be >= ATK_VERSION_2_2"
281 /* these macros are used to mark deprecated functions, and thus have to be
282 * exposed in a public header.
284 * do *not* use them in other libraries depending on Atk: use G_DEPRECATED
285 * and G_DEPRECATED_FOR, or use your own wrappers around them.
287 #ifdef ATK_DISABLE_DEPRECATION_WARNINGS
288 #define ATK_DEPRECATED _ATK_EXTERN
289 #define ATK_DEPRECATED_FOR(f) _ATK_EXTERN
290 #define ATK_UNAVAILABLE(maj,min) _ATK_EXTERN
292 #define ATK_DEPRECATED G_DEPRECATED _ATK_EXTERN
293 #define ATK_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _ATK_EXTERN
294 #define ATK_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _ATK_EXTERN
297 #define ATK_AVAILABLE_IN_ALL _ATK_EXTERN
299 /* XXX: Every new stable minor release should add a set of macros here */
301 #if ATK_VERSION_MIN_REQUIRED >= ATK_VERSION_2_2
302 # define ATK_DEPRECATED_IN_2_2 ATK_DEPRECATED
303 # define ATK_DEPRECATED_IN_2_2_FOR(f) ATK_DEPRECATED_FOR(f)
305 # define ATK_DEPRECATED_IN_2_2 _ATK_EXTERN
306 # define ATK_DEPRECATED_IN_2_2_FOR(f) _ATK_EXTERN
309 #if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_2_2
310 # define ATK_AVAILABLE_IN_2_2 ATK_UNAVAILABLE(2, 2)
312 # define ATK_AVAILABLE_IN_2_2 _ATK_EXTERN
315 #if ATK_VERSION_MIN_REQUIRED >= ATK_VERSION_2_4
316 # define ATK_DEPRECATED_IN_2_4 ATK_DEPRECATED
317 # define ATK_DEPRECATED_IN_2_4_FOR(f) ATK_DEPRECATED_FOR(f)
319 # define ATK_DEPRECATED_IN_2_4 _ATK_EXTERN
320 # define ATK_DEPRECATED_IN_2_4_FOR(f) _ATK_EXTERN
323 #if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_2_4
324 # define ATK_AVAILABLE_IN_2_4 ATK_UNAVAILABLE(2, 4)
326 # define ATK_AVAILABLE_IN_2_4 _ATK_EXTERN
329 #if ATK_VERSION_MIN_REQUIRED >= ATK_VERSION_2_6
330 # define ATK_DEPRECATED_IN_2_6 ATK_DEPRECATED
331 # define ATK_DEPRECATED_IN_2_6_FOR(f) ATK_DEPRECATED_FOR(f)
333 # define ATK_DEPRECATED_IN_2_6 _ATK_EXTERN
334 # define ATK_DEPRECATED_IN_2_6_FOR(f) _ATK_EXTERN
337 #if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_2_6
338 # define ATK_AVAILABLE_IN_2_6 ATK_UNAVAILABLE(2, 6)
340 # define ATK_AVAILABLE_IN_2_6 _ATK_EXTERN
343 #if ATK_VERSION_MIN_REQUIRED >= ATK_VERSION_2_8
344 # define ATK_DEPRECATED_IN_2_8 ATK_DEPRECATED
345 # define ATK_DEPRECATED_IN_2_8_FOR(f) ATK_DEPRECATED_FOR(f)
347 # define ATK_DEPRECATED_IN_2_8 _ATK_EXTERN
348 # define ATK_DEPRECATED_IN_2_8_FOR(f) _ATK_EXTERN
351 #if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_2_8
352 # define ATK_AVAILABLE_IN_2_8 ATK_UNAVAILABLE(2, 8)
354 # define ATK_AVAILABLE_IN_2_8 _ATK_EXTERN
357 #if ATK_VERSION_MIN_REQUIRED >= ATK_VERSION_2_10
358 # define ATK_DEPRECATED_IN_2_10 ATK_DEPRECATED
359 # define ATK_DEPRECATED_IN_2_10_FOR(f) ATK_DEPRECATED_FOR(f)
361 # define ATK_DEPRECATED_IN_2_10 _ATK_EXTERN
362 # define ATK_DEPRECATED_IN_2_10_FOR(f) _ATK_EXTERN
365 #if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_2_10
366 # define ATK_AVAILABLE_IN_2_10 ATK_UNAVAILABLE(2, 10)
368 # define ATK_AVAILABLE_IN_2_10 _ATK_EXTERN
371 #if ATK_VERSION_MIN_REQUIRED >= ATK_VERSION_2_12
372 # define ATK_DEPRECATED_IN_2_12 ATK_DEPRECATED
373 # define ATK_DEPRECATED_IN_2_12_FOR(f) ATK_DEPRECATED_FOR(f)
375 # define ATK_DEPRECATED_IN_2_12 _ATK_EXTERN
376 # define ATK_DEPRECATED_IN_2_12_FOR(f) _ATK_EXTERN
379 #if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_2_12
380 # define ATK_AVAILABLE_IN_2_12 ATK_UNAVAILABLE(2, 12)
382 # define ATK_AVAILABLE_IN_2_12 _ATK_EXTERN
385 #if ATK_VERSION_MIN_REQUIRED >= ATK_VERSION_2_14
386 # define ATK_DEPRECATED_IN_2_14 ATK_DEPRECATED
387 # define ATK_DEPRECATED_IN_2_14_FOR(f) ATK_DEPRECATED_FOR(f)
389 # define ATK_DEPRECATED_IN_2_14 _ATK_EXTERN
390 # define ATK_DEPRECATED_IN_2_14_FOR(f) _ATK_EXTERN
393 #if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_2_14
394 # define ATK_AVAILABLE_IN_2_14 ATK_UNAVAILABLE(2, 14)
396 # define ATK_AVAILABLE_IN_2_14 _ATK_EXTERN
399 #if ATK_VERSION_MIN_REQUIRED >= ATK_VERSION_2_30
400 # define ATK_DEPRECATED_IN_2_30 ATK_DEPRECATED
401 # define ATK_DEPRECATED_IN_2_30_FOR(f) ATK_DEPRECATED_FOR(f)
403 # define ATK_DEPRECATED_IN_2_30 _ATK_EXTERN
404 # define ATK_DEPRECATED_IN_2_30_FOR(f) _ATK_EXTERN
407 #if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_2_30
408 # define ATK_AVAILABLE_IN_2_30 ATK_UNAVAILABLE(2, 30)
410 # define ATK_AVAILABLE_IN_2_30 _ATK_EXTERN
413 #if ATK_VERSION_MIN_REQUIRED >= ATK_VERSION_2_36
414 # define ATK_DEPRECATED_IN_2_36 ATK_DEPRECATED
415 # define ATK_DEPRECATED_IN_2_36_FOR(f) ATK_DEPRECATED_FOR(f)
417 # define ATK_DEPRECATED_IN_2_36 _ATK_EXTERN
418 # define ATK_DEPRECATED_IN_2_36_FOR(f) _ATK_EXTERN
421 #if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_2_36
422 # define ATK_AVAILABLE_IN_2_36 ATK_UNAVAILABLE(2, 36)
424 # define ATK_AVAILABLE_IN_2_36 _ATK_EXTERN
428 guint atk_get_major_version (void) G_GNUC_CONST;
430 guint atk_get_minor_version (void) G_GNUC_CONST;
432 guint atk_get_micro_version (void) G_GNUC_CONST;
434 guint atk_get_binary_age (void) G_GNUC_CONST;
436 guint atk_get_interface_age (void) G_GNUC_CONST;
438 #define atk_major_version atk_get_major_version ()
439 #define atk_minor_version atk_get_minor_version ()
440 #define atk_micro_version atk_get_micro_version ()
441 #define atk_binary_age atk_get_binary_age ()
442 #define atk_interface_age atk_get_interface_age ()
444 #endif /* __ATK_VERSION_H__ */