Shut up the type checker

This commit is contained in:
gingerBill
2023-08-24 16:49:56 +01:00
parent 1d25522a3b
commit 8f512001b6
+70 -35
View File
@@ -8,41 +8,76 @@ Event :: struct {using _: Object}
EventMask :: distinct bit_set[EventType; UInteger]
EventMaskAny :: ~EventMask{}
EventType :: enum UInteger {
LeftMouseDown = 1,
LeftMouseUp = 2,
RightMouseDown = 3,
RightMouseUp = 4,
MouseMoved = 5,
LeftMouseDragged = 6,
RightMouseDragged = 7,
MouseEntered = 8,
MouseExited = 9,
KeyDown = 10,
KeyUp = 11,
FlagsChanged = 12,
AppKitDefined = 13,
SystemDefined = 14,
ApplicationDefined = 15,
Periodic = 16,
CursorUpdate = 17,
Rotate = 18,
BeginGesture = 19,
EndGesture = 20,
ScrollWheel = 22,
TabletPoint = 23,
TabletProximity = 24,
OtherMouseDown = 25,
OtherMouseUp = 26,
OtherMouseDragged = 27,
Gesture = 29,
Magnify = 30,
Swipe = 31,
SmartMagnify = 32,
QuickLook = 33,
Pressure = 34,
DirectTouch = 37,
ChangeMode = 38,
when size_of(UInteger) == 4 {
// We don't support a 32-bit darwin system but this is mostly to shut up -vet for the time being
EventType :: enum UInteger {
LeftMouseDown = 1,
LeftMouseUp = 2,
RightMouseDown = 3,
RightMouseUp = 4,
MouseMoved = 5,
LeftMouseDragged = 6,
RightMouseDragged = 7,
MouseEntered = 8,
MouseExited = 9,
KeyDown = 10,
KeyUp = 11,
FlagsChanged = 12,
AppKitDefined = 13,
SystemDefined = 14,
ApplicationDefined = 15,
Periodic = 16,
CursorUpdate = 17,
Rotate = 18,
BeginGesture = 19,
EndGesture = 20,
ScrollWheel = 22,
TabletPoint = 23,
TabletProximity = 24,
OtherMouseDown = 25,
OtherMouseUp = 26,
OtherMouseDragged = 27,
Gesture = 29,
Magnify = 30,
Swipe = 31,
}
} else {
EventType :: enum UInteger {
LeftMouseDown = 1,
LeftMouseUp = 2,
RightMouseDown = 3,
RightMouseUp = 4,
MouseMoved = 5,
LeftMouseDragged = 6,
RightMouseDragged = 7,
MouseEntered = 8,
MouseExited = 9,
KeyDown = 10,
KeyUp = 11,
FlagsChanged = 12,
AppKitDefined = 13,
SystemDefined = 14,
ApplicationDefined = 15,
Periodic = 16,
CursorUpdate = 17,
Rotate = 18,
BeginGesture = 19,
EndGesture = 20,
ScrollWheel = 22,
TabletPoint = 23,
TabletProximity = 24,
OtherMouseDown = 25,
OtherMouseUp = 26,
OtherMouseDragged = 27,
Gesture = 29,
Magnify = 30,
Swipe = 31,
SmartMagnify = 32,
QuickLook = 33,
Pressure = 34,
DirectTouch = 37,
ChangeMode = 38,
}
}
EventPhase :: distinct bit_set[EventPhaseFlag; UInteger]