@@ -945,73 +945,82 @@ struct xError{
945
945
enum ELFlagFocus = 1 << 0 ;
946
946
enum ELFlagSameScreen = 1 << 1 ;
947
947
struct _xEvent {
948
- union u {
949
- struct u {
948
+ union {
949
+ struct U {
950
950
BYTE type;
951
951
BYTE detail;
952
952
CARD16 sequenceNumber;
953
- }
954
- struct keyButtonPointer {
953
+ } U u;
954
+
955
+ struct KeyButtonPointer {
955
956
CARD32 pad00;
956
957
Time time;
957
958
Window root, event, child;
958
959
INT16 rootX, rootY, eventX, eventY;
959
960
KeyButMask state;
960
961
BOOL sameScreen;
961
962
BYTE pad1;
962
- }
963
- struct enterLeave {
963
+ } KeyButtonPointer keyButtonPointer;
964
+
965
+ struct EnterLeave {
964
966
CARD32 pad00;
965
967
Time time;
966
968
Window root, event, child;
967
969
INT16 rootX, rootY, eventX, eventY;
968
970
KeyButMask state;
969
971
BYTE mode; /* really XMode */
970
972
BYTE flags; /* sameScreen and focus booleans, packed together */
971
- }
972
- struct focus {
973
+ } EnterLeave enterLeave;
974
+
975
+ struct Focus {
973
976
CARD32 pad00;
974
977
Window window;
975
978
BYTE mode; /* really XMode */
976
979
BYTE pad1, pad2, pad3;
977
- }
978
- struct expose {
980
+ } Focus focus;
981
+
982
+ struct Expose {
979
983
CARD32 pad00;
980
984
Window window;
981
985
CARD16 x, y, width, height;
982
986
CARD16 count;
983
987
CARD16 pad2;
984
- }
985
- struct graphicsExposure {
988
+ } Expose expose;
989
+
990
+ struct GraphicsExposure {
986
991
CARD32 pad00;
987
992
Drawable drawable;
988
993
CARD16 x, y, width, height;
989
994
CARD16 minorEvent;
990
995
CARD16 count;
991
996
BYTE majorEvent;
992
997
BYTE pad1, pad2, pad3;
993
- }
994
- struct noExposure {
998
+ } GraphicsExposure graphicsExposure;
999
+
1000
+ struct NoExposure {
995
1001
CARD32 pad00;
996
1002
Drawable drawable;
997
1003
CARD16 minorEvent;
998
1004
BYTE majorEvent;
999
1005
BYTE bpad;
1000
- }
1001
- struct visibility {
1006
+ } NoExposure noExposure;
1007
+
1008
+ struct Visibility {
1002
1009
CARD32 pad00;
1003
1010
Window window;
1004
1011
CARD8 state;
1005
1012
BYTE pad1, pad2, pad3;
1006
- }
1007
- struct createNotify {
1013
+ } Visibility visibility;
1014
+
1015
+ struct CreateNotify {
1008
1016
CARD32 pad00;
1009
1017
Window parent, window;
1010
1018
INT16 x, y;
1011
1019
CARD16 width, height, borderWidth;
1012
1020
BOOL c_override;
1013
1021
BYTE bpad;
1014
- }
1022
+ } CreateNotify createNotify;
1023
+
1015
1024
/*
1016
1025
* The event fields in the structures for DestroyNotify, UnmapNotify,
1017
1026
* MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
@@ -1020,123 +1029,141 @@ struct _xEvent {
1020
1029
* Also note that MapRequest, ConfigureRequest and CirculateRequest have
1021
1030
* the same offset for the event window.
1022
1031
*/
1023
- struct destroyNotify {
1032
+ struct DestroyNotify {
1024
1033
CARD32 pad00;
1025
1034
Window event, window;
1026
- }
1027
- struct unmapNotify {
1035
+ } DestroyNotify destroyNotify;
1036
+
1037
+ struct UnmapNotify {
1028
1038
CARD32 pad00;
1029
1039
Window event, window;
1030
1040
BOOL fromConfigure;
1031
1041
BYTE pad1, pad2, pad3;
1032
- }
1033
- struct mapNotify {
1042
+ } UnmapNotify unmapNotify;
1043
+
1044
+ struct MapNotify {
1034
1045
CARD32 pad00;
1035
1046
Window event, window;
1036
1047
BOOL c_override;
1037
1048
BYTE pad1, pad2, pad3;
1038
- }
1039
- struct mapRequest {
1049
+ } MapNotify mapNotify;
1050
+
1051
+ struct MapRequest {
1040
1052
CARD32 pad00;
1041
1053
Window parent, window;
1042
- }
1043
- struct reparent {
1054
+ } MapRequest mapRequest;
1055
+
1056
+ struct Reparent {
1044
1057
CARD32 pad00;
1045
1058
Window event, window, parent;
1046
1059
INT16 x, y;
1047
1060
BOOL c_override;
1048
1061
BYTE pad1, pad2, pad3;
1049
- }
1050
- struct configureNotify {
1062
+ } Reparent reparent;
1063
+
1064
+ struct ConfigureNotify {
1051
1065
CARD32 pad00;
1052
1066
Window event, window, aboveSibling;
1053
1067
INT16 x, y;
1054
1068
CARD16 width, height, borderWidth;
1055
1069
BOOL c_override;
1056
1070
BYTE bpad;
1057
- }
1058
- struct configureRequest {
1071
+ } ConfigureNotify configureNotify;
1072
+
1073
+ struct ConfigureRequest {
1059
1074
CARD32 pad00;
1060
1075
Window parent, window, sibling;
1061
1076
INT16 x, y;
1062
1077
CARD16 width, height, borderWidth;
1063
1078
CARD16 valueMask;
1064
1079
CARD32 pad1;
1065
- }
1066
- struct gravity {
1080
+ } ConfigureRequest configureRequest;
1081
+
1082
+ struct Gravity {
1067
1083
CARD32 pad00;
1068
1084
Window event, window;
1069
1085
INT16 x, y;
1070
1086
CARD32 pad1, pad2, pad3, pad4;
1071
- }
1072
- struct resizeRequest {
1087
+ } Gravity gravity;
1088
+
1089
+ struct ResizeRequest {
1073
1090
CARD32 pad00;
1074
1091
Window window;
1075
1092
CARD16 width, height;
1076
- }
1077
- struct circulate {
1093
+ } ResizeRequest resizeRequest;
1094
+
1095
+ struct Circulate {
1078
1096
/* The event field in the circulate record is really the parent when this
1079
1097
is used as a CirculateRequest instead of a CirculateNotify */
1080
1098
CARD32 pad00;
1081
1099
Window event, window, parent;
1082
1100
BYTE place; /* Top or Bottom */
1083
1101
BYTE pad1, pad2, pad3;
1084
- }
1085
- struct property {
1102
+ } Circulate circulate;
1103
+
1104
+ struct Property {
1086
1105
CARD32 pad00;
1087
1106
Window window;
1088
1107
Atom atom;
1089
1108
Time time;
1090
1109
BYTE state; /* NewValue or Deleted */
1091
1110
BYTE pad1;
1092
1111
CARD16 pad2;
1093
- }
1094
- struct selectionClear {
1112
+ } Property property;
1113
+
1114
+ struct SelectionClear {
1095
1115
CARD32 pad00;
1096
1116
Time time;
1097
1117
Window window;
1098
1118
Atom atom;
1099
- }
1100
- struct selectionRequest {
1119
+ } SelectionClear selectionClear;
1120
+
1121
+ struct SelectionRequest {
1101
1122
CARD32 pad00;
1102
1123
Time time;
1103
1124
Window owner, requestor;
1104
1125
Atom selection, target, property;
1105
- }
1106
- struct selectionNotify {
1126
+ } SelectionRequest selectionRequest;
1127
+
1128
+ struct SelectionNotify {
1107
1129
CARD32 pad00;
1108
1130
Time time;
1109
1131
Window requestor;
1110
1132
Atom selection, target, property;
1111
- }
1112
- struct colormap {
1133
+ } SelectionNotify selectionNotify;
1134
+
1135
+ struct Colormap {
1113
1136
CARD32 pad00;
1114
1137
Window window;
1115
- Colormap colormap;
1138
+ . Colormap colormap;
1116
1139
BOOL c_new;
1117
1140
BYTE state; /* Installed or UnInstalled */
1118
1141
BYTE pad1, pad2;
1119
- }
1120
- struct mappingNotify {
1142
+ } Colormap colormap;
1143
+
1144
+ struct MappingNotify {
1121
1145
CARD32 pad00;
1122
1146
CARD8 request;
1123
1147
KeyCode firstKeyCode;
1124
1148
CARD8 count;
1125
1149
BYTE pad1;
1126
- }
1127
- struct clientMessage {
1150
+ } MappingNotify mappingNotify;
1151
+
1152
+ struct ClientMessage {
1128
1153
CARD32 pad00;
1129
1154
Window window;
1130
- union u{
1131
- struct l {
1155
+ union
1156
+ {
1157
+ struct L {
1132
1158
Atom type;
1133
1159
INT32 longs0;
1134
1160
INT32 longs1;
1135
1161
INT32 longs2;
1136
1162
INT32 longs3;
1137
1163
INT32 longs4;
1138
- }
1139
- struct s {
1164
+ } L l;
1165
+
1166
+ struct S {
1140
1167
Atom type;
1141
1168
INT16 shorts0;
1142
1169
INT16 shorts1;
@@ -1148,16 +1175,18 @@ struct _xEvent {
1148
1175
INT16 shorts7;
1149
1176
INT16 shorts8;
1150
1177
INT16 shorts9;
1151
- }
1152
- struct b {
1178
+ } S s;
1179
+
1180
+ struct B {
1153
1181
Atom type;
1154
1182
INT8 [20 ] bytes;
1155
- }
1183
+ } B b;
1156
1184
}
1157
1185
}
1158
1186
}
1159
1187
}
1160
1188
alias _xEvent xEvent;
1189
+ static assert (xEvent.sizeof == sz_xEvent);
1161
1190
1162
1191
/* ********************************************************
1163
1192
*
0 commit comments