Update to clearlooks from gtk-engines-2.16.0
[ardour.git] / libs / clearlooks / general-support.h
1 #ifndef __GENERAL_SUPPORT_H
2 #define __GENERAL_SUPPORT_H
3
4 #include <gmodule.h>
5 #include <glib.h>
6
7 /* macros to make sure that things are sane ... */
8
9 #define CHECK_DETAIL(detail, value) ((detail) && (!strcmp(value, detail)))
10
11 #define CHECK_ARGS                                      \
12   g_return_if_fail (window != NULL);                    \
13   g_return_if_fail (style != NULL);
14
15 #define SANITIZE_SIZE                                   \
16   g_return_if_fail (width  >= -1);                      \
17   g_return_if_fail (height >= -1);                      \
18                                                         \
19   if ((width == -1) && (height == -1))                  \
20     gdk_drawable_get_size (window, &width, &height);    \
21   else if (width == -1)                                 \
22     gdk_drawable_get_size (window, &width, NULL);       \
23   else if (height == -1)                                \
24     gdk_drawable_get_size (window, NULL, &height);
25
26 #define GE_EXPORT       G_MODULE_EXPORT
27 #define GE_INTERNAL     G_GNUC_INTERNAL
28
29 /* explicitly export with ggc, G_MODULE_EXPORT does not do this, this should
30  * make it possible to compile with -fvisibility=hidden */
31 #ifdef G_HAVE_GNUC_VISIBILITY
32 # undef GE_EXPORT
33 # define GE_EXPORT      __attribute__((__visibility__("default")))
34 #endif
35
36 #if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
37 # undef GE_EXPORT
38 # undef GE_INTERNAL
39 # define GE_EXPORT      __global
40 # define GE_INTERNAL    __hidden
41 #endif 
42
43 #endif /* __GENERAL_SUPPORT_H */