]> Pileus Git - ~andy/gtk/blob - gdk/gdkversionmacros.h.in
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gdk / gdkversionmacros.h.in
1 /* gdkversionmacros.h - version boundaries checks
2  * Copyright (C) 2012 Red Hat, Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.▸ See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
21 #error "Only <gdk/gdk.h> can be included directly."
22 #endif
23
24 #ifndef __GDK_VERSION_MACROS_H__
25 #define __GDK_VERSION_MACROS_H__
26
27 #include <glib.h>
28
29 #define GDK_MAJOR_VERSION (@GTK_MAJOR_VERSION@)
30 #define GDK_MINOR_VERSION (@GTK_MINOR_VERSION@)
31 #define GDK_MICRO_VERSION (@GTK_MICRO_VERSION@)
32
33 /**
34  * GDK_DISABLE_DEPRECATION_WARNINGS:
35  *
36  * A macro that should be defined before including the gdk.h header.
37  * If it is defined, no compiler warnings will be produced for uses
38  * of deprecated GDK and GTK+ APIs.
39  */
40
41 #ifdef GDK_DISABLE_DEPRECATION_WARNINGS
42 #define GDK_DEPRECATED
43 #define GDK_DEPRECATED_FOR(f)
44 #define GDK_UNAVAILABLE(maj,min)
45 #else
46 #define GDK_DEPRECATED G_DEPRECATED
47 #define GDK_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
48 #define GDK_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min)
49 #endif
50
51 /* XXX: Every new stable minor release bump should add a macro here */
52
53 /**
54  * GDK_VERSION_3_0:
55  *
56  * A macro that evaluates to the 3.0 version of GDK, in a format
57  * that can be used by the C pre-processor.
58  *
59  * Since: 3.4
60  */
61 #define GDK_VERSION_3_0         (G_ENCODE_VERSION (3, 0))
62
63 /**
64  * GDK_VERSION_3_2:
65  *
66  * A macro that evaluates to the 3.2 version of GDK, in a format
67  * that can be used by the C pre-processor.
68  *
69  * Since: 3.4
70  */
71 #define GDK_VERSION_3_2         (G_ENCODE_VERSION (3, 2))
72
73 /**
74  * GDK_VERSION_3_4:
75  *
76  * A macro that evaluates to the 3.4 version of GDK, in a format
77  * that can be used by the C pre-processor.
78  *
79  * Since: 3.4
80  */
81 #define GDK_VERSION_3_4         (G_ENCODE_VERSION (3, 4))
82
83 /**
84  * GDK_VERSION_3_6:
85  *
86  * A macro that evaluates to the 3.6 version of GDK, in a format
87  * that can be used by the C pre-processor.
88  *
89  * Since: 3.6
90  */
91 #define GDK_VERSION_3_6         (G_ENCODE_VERSION (3, 6))
92
93 /**
94  * GDK_VERSION_3_8:
95  *
96  * A macro that evaluates to the 3.8 version of GDK, in a format
97  * that can be used by the C pre-processor.
98  *
99  * Since: 3.8
100  */
101 #define GDK_VERSION_3_8         (G_ENCODE_VERSION (3, 8))
102
103
104 /* evaluates to the current stable version; for development cycles,
105  * this means the next stable target
106  */
107 #if (GDK_MINOR_VERSION % 2)
108 #define GDK_VERSION_CUR_STABLE         (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION + 1))
109 #else
110 #define GDK_VERSION_CUR_STABLE         (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION))
111 #endif
112
113 /* evaluates to the previous stable version */
114 #if (GDK_MINOR_VERSION % 2)
115 #define GDK_VERSION_PREV_STABLE        (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 1))
116 #else
117 #define GDK_VERSION_PREV_STABLE        (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 2))
118 #endif
119
120 /**
121  * GDK_VERSION_MIN_REQUIRED:
122  *
123  * A macro that should be defined by the user prior to including
124  * the gdk.h header.
125  * The definition should be one of the predefined GDK version
126  * macros: %GDK_VERSION_3_0, %GDK_VERSION_3_2,...
127  *
128  * This macro defines the lower bound for the GDK API to use.
129  *
130  * If a function has been deprecated in a newer version of GDK,
131  * it is possible to use this symbol to avoid the compiler warnings
132  * without disabling warning for every deprecated function.
133  *
134  * Since: 3.4
135  */
136 #ifndef GDK_VERSION_MIN_REQUIRED
137 # define GDK_VERSION_MIN_REQUIRED      (GDK_VERSION_CUR_STABLE)
138 #endif
139
140 /**
141  * GDK_VERSION_MAX_ALLOWED:
142  *
143  * A macro that should be defined by the user prior to including
144  * the gdk.h header.
145  * The definition should be one of the predefined GDK version
146  * macros: %GDK_VERSION_3_0, %GDK_VERSION_3_2,...
147  *
148  * This macro defines the upper bound for the GDK API to use.
149  *
150  * If a function has been introduced in a newer version of GDK,
151  * it is possible to use this symbol to get compiler warnings when
152  * trying to use that function.
153  *
154  * Since: 3.4
155  */
156 #ifndef GDK_VERSION_MAX_ALLOWED
157 # if GDK_VERSION_MIN_REQUIRED > GDK_VERSION_PREV_STABLE
158 #  define GDK_VERSION_MAX_ALLOWED      GDK_VERSION_MIN_REQUIRED
159 # else
160 #  define GDK_VERSION_MAX_ALLOWED      GDK_VERSION_CUR_STABLE
161 # endif
162 #endif
163
164 /* sanity checks */
165 #if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_MIN_REQUIRED
166 #error "GDK_VERSION_MAX_ALLOWED must be >= GDK_VERSION_MIN_REQUIRED"
167 #endif
168 #if GDK_VERSION_MIN_REQUIRED < GDK_VERSION_3_0
169 #error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_3_0"
170 #endif
171
172 /* XXX: Every new stable minor release should add a set of macros here */
173
174 #if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_0
175 # define GDK_DEPRECATED_IN_3_0                GDK_DEPRECATED
176 # define GDK_DEPRECATED_IN_3_0_FOR(f)         GDK_DEPRECATED_FOR(f)
177 #else
178 # define GDK_DEPRECATED_IN_3_0
179 # define GDK_DEPRECATED_IN_3_0_FOR(f)
180 #endif
181
182 #if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_0
183 # define GDK_AVAILABLE_IN_3_0                 GDK_UNAVAILABLE(3, 0)
184 #else
185 # define GDK_AVAILABLE_IN_3_0
186 #endif
187
188 #if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_2
189 # define GDK_DEPRECATED_IN_3_2                GDK_DEPRECATED
190 # define GDK_DEPRECATED_IN_3_2_FOR(f)         GDK_DEPRECATED_FOR(f)
191 #else
192 # define GDK_DEPRECATED_IN_3_2
193 # define GDK_DEPRECATED_IN_3_2_FOR(f)
194 #endif
195
196 #if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_2
197 # define GDK_AVAILABLE_IN_3_2                 GDK_UNAVAILABLE(3, 2)
198 #else
199 # define GDK_AVAILABLE_IN_3_2
200 #endif
201
202 #if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_4
203 # define GDK_DEPRECATED_IN_3_4                GDK_DEPRECATED
204 # define GDK_DEPRECATED_IN_3_4_FOR(f)         GDK_DEPRECATED_FOR(f)
205 #else
206 # define GDK_DEPRECATED_IN_3_4
207 # define GDK_DEPRECATED_IN_3_4_FOR(f)
208 #endif
209
210 #if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_4
211 # define GDK_AVAILABLE_IN_3_4                 GDK_UNAVAILABLE(3, 4)
212 #else
213 # define GDK_AVAILABLE_IN_3_4
214 #endif
215
216 #if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_6
217 # define GDK_DEPRECATED_IN_3_6                GDK_DEPRECATED
218 # define GDK_DEPRECATED_IN_3_6_FOR(f)         GDK_DEPRECATED_FOR(f)
219 #else
220 # define GDK_DEPRECATED_IN_3_6
221 # define GDK_DEPRECATED_IN_3_6_FOR(f)
222 #endif
223
224 #if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_6
225 # define GDK_AVAILABLE_IN_3_6                 GDK_UNAVAILABLE(3, 6)
226 #else
227 # define GDK_AVAILABLE_IN_3_6
228 #endif
229
230 #if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_8
231 # define GDK_DEPRECATED_IN_3_8                GDK_DEPRECATED
232 # define GDK_DEPRECATED_IN_3_8_FOR(f)         GDK_DEPRECATED_FOR(f)
233 #else
234 # define GDK_DEPRECATED_IN_3_8
235 # define GDK_DEPRECATED_IN_3_8_FOR(f)
236 #endif
237
238 #if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_8
239 # define GDK_AVAILABLE_IN_3_8                 GDK_UNAVAILABLE(3, 8)
240 #else
241 # define GDK_AVAILABLE_IN_3_8
242 #endif
243
244 #endif  /* __GDK_VERSION_MACROS_H__ */