[beast/devel: 4/7] GXK: avoid flags enum casting for GdkEventMask GdkWindowHints GtkAttachOptions



commit c4e6f0752fbed9058710746e5590157b295c6a93
Author: Tim Janik <timj gnu org>
Date:   Tue Dec 18 20:19:22 2012 +0100

    GXK: avoid flags enum casting for GdkEventMask GdkWindowHints GtkAttachOptions

 beast-gtk/gxk/gxkglobals.h |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/beast-gtk/gxk/gxkglobals.h b/beast-gtk/gxk/gxkglobals.h
index 7990990..eb9fdc0 100644
--- a/beast-gtk/gxk/gxkglobals.h
+++ b/beast-gtk/gxk/gxkglobals.h
@@ -73,4 +73,25 @@ void	gxk_init_radget_types	(void);
 
 G_END_DECLS
 
+// == Flags Enumeration Operators in C++ ==
+#ifdef __cplusplus
+inline GdkEventMask  operator&  (GdkEventMask  s1, GdkEventMask s2) { return GdkEventMask (s1 & (long long unsigned) s2); }
+inline GdkEventMask& operator&= (GdkEventMask &s1, GdkEventMask s2) { s1 = s1 & s2; return s1; }
+inline GdkEventMask  operator|  (GdkEventMask  s1, GdkEventMask s2) { return GdkEventMask (s1 | (long long unsigned) s2); }
+inline GdkEventMask& operator|= (GdkEventMask &s1, GdkEventMask s2) { s1 = s1 | s2; return s1; }
+inline GdkEventMask  operator~  (GdkEventMask  s1)                 { return GdkEventMask (~(long long unsigned) s1); }
+
+inline GdkWindowHints  operator&  (GdkWindowHints  s1, GdkWindowHints s2) { return GdkWindowHints (s1 & (long long unsigned) s2); }
+inline GdkWindowHints& operator&= (GdkWindowHints &s1, GdkWindowHints s2) { s1 = s1 & s2; return s1; }
+inline GdkWindowHints  operator|  (GdkWindowHints  s1, GdkWindowHints s2) { return GdkWindowHints (s1 | (long long unsigned) s2); }
+inline GdkWindowHints& operator|= (GdkWindowHints &s1, GdkWindowHints s2) { s1 = s1 | s2; return s1; }
+inline GdkWindowHints  operator~  (GdkWindowHints  s1)                 { return GdkWindowHints (~(long long unsigned) s1); }
+
+inline GtkAttachOptions  operator&  (GtkAttachOptions  s1, GtkAttachOptions s2) { return GtkAttachOptions (s1 & (long long unsigned) s2); }
+inline GtkAttachOptions& operator&= (GtkAttachOptions &s1, GtkAttachOptions s2) { s1 = s1 & s2; return s1; }
+inline GtkAttachOptions  operator|  (GtkAttachOptions  s1, GtkAttachOptions s2) { return GtkAttachOptions (s1 | (long long unsigned) s2); }
+inline GtkAttachOptions& operator|= (GtkAttachOptions &s1, GtkAttachOptions s2) { s1 = s1 | s2; return s1; }
+inline GtkAttachOptions  operator~  (GtkAttachOptions  s1)                 { return GtkAttachOptions (~(long long unsigned) s1); }
+#endif // __cplusplus
+
 #endif /* __GXK_GLOBALS_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]