sigc_eventtraits.h
00001
00002 #ifndef _sigc_eventtraits_h_
00003 #define _sigc_eventtraits_h_
00004
00005
00006
00007
00008
00009
00010 #define MAKE_EVENTTRAIT_1_OPEN(ID,GETYPE,VCMP,GCMP) \
00011 template<>\
00012 class W2_Trait<ID>\
00013 {\
00014 public:\
00015 typedef GETYPE ge_type;\
00016 typedef VCMP T_vcmp;\
00017 typedef GCMP T_gcmp;\
00018 static const T_vcmp EN1;\
00019 static const T_gcmp GN1;\
00020 static const char* const signame;\
00021 static T_gcmp Field(GdkEvent* eve);\
00022 };
00023
00024 #define MAKE_EVENTTRAIT_2_OPEN(ID,GETYPE,VCMP,GCMP) \
00025 template<>\
00026 class W2_Trait<ID>\
00027 {\
00028 public:\
00029 typedef GETYPE ge_type;\
00030 typedef VCMP T_vcmp;\
00031 typedef GCMP T_gcmp;\
00032 static const T_vcmp EN1;\
00033 static const T_gcmp GN1;\
00034 static const T_vcmp EN2;\
00035 static const T_gcmp GN2;\
00036 static const char* const signame;\
00037 static T_gcmp Field(GdkEvent* eve);\
00038 };
00039
00040 #define MAKE_EVENTTRAIT_3_OPEN(ID,GETYPE,VCMP,GCMP) \
00041 template<>\
00042 class W2_Trait<ID>\
00043 {\
00044 public:\
00045 typedef GETYPE ge_type;\
00046 typedef VCMP T_vcmp;\
00047 typedef GCMP T_gcmp;\
00048 static const T_vcmp EN1;\
00049 static const T_gcmp GN1;\
00050 static const T_vcmp EN2;\
00051 static const T_gcmp GN2;\
00052 static const T_vcmp EN3;\
00053 static const T_gcmp GN3;\
00054 static const char* const signame;\
00055 static T_gcmp Field(GdkEvent* eve);\
00056 };
00057
00058
00059
00060
00061 #define MAKE_EVENTTRAIT_CLOSE_DEFAULT(ID) \
00062 inline \
00063 W2_Trait<ID>::T_gcmp W2_Trait<ID>::Field(GdkEvent* eve){return eve->type;}
00064
00065
00066
00067 MAKE_EVENTTRAIT_3_OPEN(BUTTON_PRESS,GdkEventButton,VDKButtonEventFilter,GdkEventType)
00068 MAKE_EVENTTRAIT_CLOSE_DEFAULT(BUTTON_PRESS)
00069
00070
00071 MAKE_EVENTTRAIT_1_OPEN(BUTTON_RELEASE,GdkEventButton,VDKButtonEventFilter,\
00072 GdkEventType)
00073 MAKE_EVENTTRAIT_CLOSE_DEFAULT(BUTTON_RELEASE)
00074
00075
00076 MAKE_EVENTTRAIT_1_OPEN(FOCUS_KEY_IN, GdkEventFocus, VDKFocusEventFilter,\
00077 int)
00078 inline
00079 int
00080 W2_Trait<FOCUS_KEY_IN>::Field(GdkEvent* eve)
00081 {return reinterpret_cast<GdkEventFocus*>(eve)->in;}
00082
00083
00084
00085 MAKE_EVENTTRAIT_1_OPEN(FOCUS_KEY_OUT, GdkEventFocus, VDKFocusEventFilter,\
00086 int)
00087 inline
00088 int
00089 W2_Trait<FOCUS_KEY_OUT>::Field(GdkEvent* eve)
00090 {return reinterpret_cast<GdkEventFocus*>(eve)->in;}
00091
00092
00093
00094 MAKE_EVENTTRAIT_1_OPEN(FOCUS_POINTER_IN,GdkEventCrossing,VDKFocusEventFilter,\
00095 GdkEventType)
00096 MAKE_EVENTTRAIT_CLOSE_DEFAULT(FOCUS_POINTER_IN)
00097
00098
00099
00100 MAKE_EVENTTRAIT_1_OPEN(FOCUS_POINTER_OUT,GdkEventCrossing,VDKFocusEventFilter,\
00101 GdkEventType)
00102 MAKE_EVENTTRAIT_CLOSE_DEFAULT(FOCUS_POINTER_OUT)
00103
00104
00105 MAKE_EVENTTRAIT_1_OPEN(GEOMETRY,GdkEventConfigure,int,int)
00106
00107
00108
00109 MAKE_EVENTTRAIT_1_OPEN(PAINT,GdkEventExpose,int,int)
00110
00111
00112
00113 MAKE_EVENTTRAIT_1_OPEN(KEY_PRESS,GdkEventKey,VDKKeyEventFilter,\
00114 GdkEventType)
00115
00116 MAKE_EVENTTRAIT_CLOSE_DEFAULT(KEY_PRESS)
00117
00118
00119 MAKE_EVENTTRAIT_1_OPEN(KEY_RELEASE,GdkEventKey,VDKKeyEventFilter,\
00120 GdkEventType)
00121
00122 MAKE_EVENTTRAIT_CLOSE_DEFAULT(KEY_RELEASE)
00123
00124
00125 MAKE_EVENTTRAIT_1_OPEN(POINTER_PRESSED,GdkEventMotion,VDKPointerEventFilter,\
00126 bool)
00127 inline
00128 bool
00129 W2_Trait<POINTER_PRESSED>::Field(GdkEvent* eve)
00130 {return (reinterpret_cast<GdkEventMotion*>(eve)->state != 0);}
00131
00132
00133 MAKE_EVENTTRAIT_1_OPEN(POINTER_MOVE,GdkEventMotion,VDKPointerEventFilter,\
00134 bool)
00135 inline
00136 bool
00137 W2_Trait<POINTER_MOVE>::Field(GdkEvent* eve)
00138 {return true;}
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 class W2_Trait<MAPEVENT>
00152 {
00153 public:
00154 typedef GdkEventVisibility ge_type;
00155 typedef VDKMapEventFilter T_vcmp;
00156 typedef int T_gcmp;
00157 static const char* const signame;
00158 static const T_vcmp EN1;
00159 static const int GN1;
00160 static const T_vcmp EN2;
00161 static const int GN2;
00162 static const T_vcmp EN3;
00163 static const int GN3;
00164 static int Field(GdkEvent* eve);
00165 };
00166
00167
00168
00169
00170 #endif
00171
Generated on Tue Aug 17 12:39:50 2004 for vdk 2.4.0 by
1.3.7