Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
gxkglobals.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __GXK_GLOBALS_H__
3 #define __GXK_GLOBALS_H__
4 
5 #include <gtk/gtk.h>
6 #include <sfi/bcore.hh>
7 
8 /* --- i18n and gettext helpers --- */
9 #ifdef GXK_COMPILATION
10 # define GXK_I18N_DOMAIN NULL
11 # define _(str) dgettext (GXK_I18N_DOMAIN, str)
12 # define T_(str) dgettext (GXK_I18N_DOMAIN, str)
13 # define N_(str) (str)
14 #endif
15 
16 
17 /* --- macros --- */
18 #define GXK_TOOLTIPS (gxk_globals->tooltips)
19 #define gxk_printout(...) Bse::printerr (__VA_ARGS__)
20 #define gxk_printerr(...) Bse::printerr (__VA_ARGS__)
21 #define gxk_warning(...) Bse::printerr ("Gxk: warning: %s\n", Bse::string_format (__VA_ARGS__))
22 
23 /* --- typedefs & structures --- */
24 typedef void (*GxkFreeFunc) (gpointer data);
25 typedef struct
26 {
27  GtkTooltips *tooltips;
28 } GxkGlobals;
29 
30 
31 /* --- spacing/padding --- */
32 #define GXK_OUTER_BORDER (5) /* outer dialog border-width */
33 #define GXK_INNER_SPACING (3) /* spacing/padding between h/v boxes */
34 #define GXK_BUTTON_PADDING (3) /* padding between adjacent buttons */
35 
36 
37 /* --- convenience --- */
38 gulong gxk_nullify_in_object (gpointer object,
39  gpointer location);
40 
41 
42 /* --- variables --- */
43 extern const GxkGlobals* gxk_globals;
44 
45 
46 /* --- functions --- */
47 void gxk_init (void);
48 
49 
50 /* --- internal --- */
51 void gxk_init_utils (void);
52 void gxk_init_params (void);
53 void gxk_init_stock (void);
54 void gxk_init_actions (void);
55 void gxk_init_assortments (void);
56 void gxk_init_radget_types (void);
57 
58 
59 // == Flags Enumeration Operators in C++ ==
60 #ifdef __cplusplus
61 constexpr GdkEventMask operator& (GdkEventMask s1, GdkEventMask s2) { return GdkEventMask (s1 & (long long unsigned) s2); }
62 inline GdkEventMask& operator&= (GdkEventMask &s1, GdkEventMask s2) { s1 = s1 & s2; return s1; }
63 constexpr GdkEventMask operator| (GdkEventMask s1, GdkEventMask s2) { return GdkEventMask (s1 | (long long unsigned) s2); }
64 inline GdkEventMask& operator|= (GdkEventMask &s1, GdkEventMask s2) { s1 = s1 | s2; return s1; }
65 constexpr GdkEventMask operator~ (GdkEventMask s1) { return GdkEventMask (~(long long unsigned) s1); }
66 constexpr GdkModifierType operator& (GdkModifierType s1, GdkModifierType s2) { return GdkModifierType (s1 & (long long unsigned) s2); }
67 inline GdkModifierType& operator&= (GdkModifierType &s1, GdkModifierType s2) { s1 = s1 & s2; return s1; }
68 constexpr GdkModifierType operator| (GdkModifierType s1, GdkModifierType s2) { return GdkModifierType (s1 | (long long unsigned) s2); }
69 inline GdkModifierType& operator|= (GdkModifierType &s1, GdkModifierType s2) { s1 = s1 | s2; return s1; }
70 constexpr GdkModifierType operator~ (GdkModifierType s1) { return GdkModifierType (~(long long unsigned) s1); }
71 constexpr GdkWindowHints operator& (GdkWindowHints s1, GdkWindowHints s2) { return GdkWindowHints (s1 & (long long unsigned) s2); }
72 inline GdkWindowHints& operator&= (GdkWindowHints &s1, GdkWindowHints s2) { s1 = s1 & s2; return s1; }
73 constexpr GdkWindowHints operator| (GdkWindowHints s1, GdkWindowHints s2) { return GdkWindowHints (s1 | (long long unsigned) s2); }
74 inline GdkWindowHints& operator|= (GdkWindowHints &s1, GdkWindowHints s2) { s1 = s1 | s2; return s1; }
75 constexpr GdkWindowHints operator~ (GdkWindowHints s1) { return GdkWindowHints (~(long long unsigned) s1); }
76 constexpr GtkAttachOptions operator& (GtkAttachOptions s1, GtkAttachOptions s2) { return GtkAttachOptions (s1 & (long long unsigned) s2); }
77 inline GtkAttachOptions& operator&= (GtkAttachOptions &s1, GtkAttachOptions s2) { s1 = s1 & s2; return s1; }
78 constexpr GtkAttachOptions operator| (GtkAttachOptions s1, GtkAttachOptions s2) { return GtkAttachOptions (s1 | (long long unsigned) s2); }
79 inline GtkAttachOptions& operator|= (GtkAttachOptions &s1, GtkAttachOptions s2) { s1 = s1 | s2; return s1; }
80 constexpr GtkAttachOptions operator~ (GtkAttachOptions s1) { return GtkAttachOptions (~(long long unsigned) s1); }
81 #endif // __cplusplus
82 #endif /* __GXK_GLOBALS_H__ */
Definition: gxkglobals.hh:25