4 * An OpenGL based 'interactive canvas' library.
6 * Copyright (C) 2012 Intel Corporation
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser 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 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
23 #error "Only <clutter/clutter.h> can be included directly."
26 #ifndef __CLUTTER_MACROS_H__
27 #define __CLUTTER_MACROS_H__
29 #include <clutter/clutter-version.h>
34 * GL Windowing system used
38 * Deprecated: 1.10: The macro evaluates to "deprecated" as Clutter can be
39 * compiled with multiple windowing system backends. Use the various
40 * CLUTTER_WINDOWING_* macros to detect the windowing system that Clutter
41 * is being compiled against, and the type check macros for the
42 * #ClutterBackend for a run-time check.
44 #define CLUTTER_FLAVOUR "deprecated"
49 * Cogl (internal GL abstraction utility library) backend. Can be "gl" or
54 * Deprecated: 1.10: The macro evaluates to "deprecated" as Cogl can be
55 * compiled against multiple GL implementations.
57 #define CLUTTER_COGL "deprecated"
62 * The default GObject type for the Clutter stage.
66 * Deprecated: 1.10: The macro evaluates to "deprecated" as Clutter can
67 * be compiled against multiple windowing systems. You can use the
68 * CLUTTER_WINDOWING_* macros for compile-time checks, and the type
69 * check macros for run-time checks.
71 #define CLUTTER_STAGE_TYPE "deprecated"
76 * Set to 1 if Clutter was built without FPU (i.e fixed math), 0 otherwise
78 * @Deprecated: 0.6: This macro is no longer defined (identical code is used
79 * regardless the presence of FPU).
81 #define CLUTTER_NO_FPU (0)
83 /* some structures are meant to be opaque and still be allocated on the stack;
84 * in order to avoid people poking at their internals, we use this macro to
85 * ensure that users don't accidentally access a struct private members.
87 * we use the CLUTTER_COMPILATION define to allow us easier access, though.
89 #ifdef CLUTTER_COMPILATION
90 #define CLUTTER_PRIVATE_FIELD(x) x
92 #define CLUTTER_PRIVATE_FIELD(x) clutter_private_ ## x
95 /* these macros are used to mark deprecated functions, and thus have to be
96 * exposed in a public header.
98 * do *not* use them in other libraries depending on Clutter: use G_DEPRECATED
99 * and G_DEPRECATED_FOR, or use your own wrappers around them.
101 #ifdef CLUTTER_DISABLE_DEPRECATION_WARNINGS
102 #define CLUTTER_DEPRECATED
103 #define CLUTTER_DEPRECATED_FOR(f)
104 #define CLUTTER_UNAVAILABLE(maj,min)
106 #define CLUTTER_DEPRECATED G_DEPRECATED
107 #define CLUTTER_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
108 #define CLUTTER_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min)
112 * CLUTTER_VERSION_MIN_REQUIRED:
114 * A macro that should be defined by the user prior to including the
117 * The definition should be one of the predefined Clutter version macros,
118 * such as: %CLUTTER_VERSION_1_0, %CLUTTER_VERSION_1_2, ...
120 * This macro defines the lower bound for the Clutter API to be used.
122 * If a function has been deprecated in a newer version of Clutter, it
123 * is possible to use this symbol to avoid the compiler warnings without
124 * disabling warnings for every deprecated function.
128 #ifndef CLUTTER_VERSION_MIN_REQUIRED
129 # define CLUTTER_VERSION_MIN_REQUIRED (CLUTTER_VERSION_PREV_STABLE)
133 * CLUTTER_VERSION_MAX_ALLOWED:
135 * A macro that should be define by the user prior to including the
138 * The definition should be one of the predefined Clutter version macros,
139 * such as: %CLUTTER_VERSION_1_0, %CLUTTER_VERSION_1_2, ...
141 * This macro defines the upper bound for the Clutter API to be used.
143 * If a function has been introduced in a newer version of Clutter, it
144 * is possible to use this symbol to get compiler warnings when trying
145 * to use that function.
149 #ifndef CLUTTER_VERSION_MAX_ALLOWED
150 # if CLUTTER_VERSION_MIN_REQUIRED > CLUTTER_VERSION_PREV_STABLE
151 # define CLUTTER_VERSION_MAX_ALLOWED CLUTTER_VERSION_MIN_REQUIRED
153 # define CLUTTER_VERSION_MAX_ALLOWED CLUTTER_VERSION_CUR_STABLE
158 #if CLUTTER_VERSION_MAX_ALLOWED < CLUTTER_VERSION_MIN_REQUIRED
159 # error "CLUTTER_VERSION_MAX_ALLOWED must be >= CLUTTER_VERSION_MIN_REQUIRED"
161 #if CLUTTER_VERSION_MIN_REQUIRED < CLUTTER_VERSION_1_0
162 # error "CLUTTER_VERSION_MIN_REQUIRED must be >= CLUTTER_VERSION_1_0"
165 /* XXX: Every new stable minor release should add a set of macros here */
167 #if CLUTTER_VERSION_MIN_REQUIRED >= CLUTTER_VERSION_1_0
168 # define CLUTTER_DEPRECATED_IN_1_0 CLUTTER_DEPRECATED
169 # define CLUTTER_DEPRECATED_IN_1_0_FOR(f) CLUTTER_DEPRECATED_FOR(f)
171 # define CLUTTER_DEPRECATED_IN_1_0
172 # define CLUTTER_DEPRECATED_IN_1_0_FOR(f)
175 #if CLUTTER_VERSION_MAX_ALLOWED < CLUTTER_VERSION_1_0
176 # define CLUTTER_AVAILABLE_IN_1_0 CLUTTER_UNAVAILABLE(1, 0)
178 # define CLUTTER_AVAILABLE_IN_1_0
181 #if CLUTTER_VERSION_MIN_REQUIRED >= CLUTTER_VERSION_1_2
182 # define CLUTTER_DEPRECATED_IN_1_2 CLUTTER_DEPRECATED
183 # define CLUTTER_DEPRECATED_IN_1_2_FOR(f) CLUTTER_DEPRECATED_FOR(f)
185 # define CLUTTER_DEPRECATED_IN_1_2
186 # define CLUTTER_DEPRECATED_IN_1_2_FOR(f)
189 #if CLUTTER_VERSION_MAX_ALLOWED < CLUTTER_VERSION_1_2
190 # define CLUTTER_AVAILABLE_IN_1_2 CLUTTER_UNAVAILABLE(1, 2)
192 # define CLUTTER_AVAILABLE_IN_1_2
195 #if CLUTTER_VERSION_MIN_REQUIRED >= CLUTTER_VERSION_1_4
196 # define CLUTTER_DEPRECATED_IN_1_4 CLUTTER_DEPRECATED
197 # define CLUTTER_DEPRECATED_IN_1_4_FOR(f) CLUTTER_DEPRECATED_FOR(f)
199 # define CLUTTER_DEPRECATED_IN_1_4
200 # define CLUTTER_DEPRECATED_IN_1_4_FOR(f)
203 #if CLUTTER_VERSION_MAX_ALLOWED < CLUTTER_VERSION_1_4
204 # define CLUTTER_AVAILABLE_IN_1_4 CLUTTER_UNAVAILABLE(1, 4)
206 # define CLUTTER_AVAILABLE_IN_1_4
209 #if CLUTTER_VERSION_MIN_REQUIRED >= CLUTTER_VERSION_1_6
210 # define CLUTTER_DEPRECATED_IN_1_6 CLUTTER_DEPRECATED
211 # define CLUTTER_DEPRECATED_IN_1_6_FOR(f) CLUTTER_DEPRECATED_FOR(f)
213 # define CLUTTER_DEPRECATED_IN_1_6
214 # define CLUTTER_DEPRECATED_IN_1_6_FOR(f)
217 #if CLUTTER_VERSION_MAX_ALLOWED < CLUTTER_VERSION_1_6
218 # define CLUTTER_AVAILABLE_IN_1_6 CLUTTER_UNAVAILABLE(1, 6)
220 # define CLUTTER_AVAILABLE_IN_1_6
223 #if CLUTTER_VERSION_MIN_REQUIRED >= CLUTTER_VERSION_1_8
224 # define CLUTTER_DEPRECATED_IN_1_8 CLUTTER_DEPRECATED
225 # define CLUTTER_DEPRECATED_IN_1_8_FOR(f) CLUTTER_DEPRECATED_FOR(f)
227 # define CLUTTER_DEPRECATED_IN_1_8
228 # define CLUTTER_DEPRECATED_IN_1_8_FOR(f)
231 #if CLUTTER_VERSION_MAX_ALLOWED < CLUTTER_VERSION_1_8
232 # define CLUTTER_AVAILABLE_IN_1_8 CLUTTER_UNAVAILABLE(1, 8)
234 # define CLUTTER_AVAILABLE_IN_1_8
237 #if CLUTTER_VERSION_MIN_REQUIRED >= CLUTTER_VERSION_1_10
238 # define CLUTTER_DEPRECATED_IN_1_10 CLUTTER_DEPRECATED
239 # define CLUTTER_DEPRECATED_IN_1_10_FOR(f) CLUTTER_DEPRECATED_FOR(f)
241 # define CLUTTER_DEPRECATED_IN_1_10
242 # define CLUTTER_DEPRECATED_IN_1_10_FOR(f)
245 #if CLUTTER_VERSION_MAX_ALLOWED < CLUTTER_VERSION_1_10
246 # define CLUTTER_AVAILABLE_IN_1_10 CLUTTER_UNAVAILABLE(1, 10)
248 # define CLUTTER_AVAILABLE_IN_1_10
252 * CLUTTER_CAIRO_FORMAT_ARGB32:
254 * The #CoglPixelFormat to be used when uploading image data from
255 * and to a Cairo image surface using %CAIRO_FORMAT_ARGB32 and
256 * %CAIRO_FORMAT_RGB24 as #cairo_format_t.
261 /* Cairo stores the data in native byte order as ARGB but Cogl's pixel
262 * formats specify the actual byte order. Therefore we need to use a
263 * different format depending on the architecture
265 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
266 #define CLUTTER_CAIRO_FORMAT_ARGB32 (COGL_PIXEL_FORMAT_BGRA_8888_PRE)
268 #define CLUTTER_CAIRO_FORMAT_ARGB32 (COGL_PIXEL_FORMAT_ARGB_8888_PRE)
271 #endif /* __CLUTTER_MACROS_H__ */