module Graphics.Window.Event

import Derive.Prelude

%language ElabReflection


public export
AsyncRequestSerial : Type
AsyncRequestSerial = Int

public export
ActivationToken : Type
ActivationToken = String

public export
-- NOTE: This is generic over int type in winit, but only used with u32
record PhysicalSize where
  constructor MkPhysicalSize
  width : Bits32
  height : Bits32
%runElab derive "PhysicalSize" [Eq, Show]

namespace WindowEvent
  public export
  data T =
    -- ActivationTokenDone AsyncRequestSerial ActivationToken |
    ActivationTokenDone |
    SurfaceResized PhysicalSize |
    Moved |
    CloseRequested |
    Destroyed |
    DragEntered |
    DragMoved |
    DragDropped |
    DragLeft |
    Focused |
    KeyboardInput |
    ModifiersChanged |
    Ime |
    PointerMoved |
    PointerEntered |
    PointerLeft |
    MouseWheel |
    PointerButton |
    PinchGesture |
    PanGesture |
    DoubleTapGesture |
    RotationGesture |
    TouchpadPressure |
    ScaleFactorChanged |
    ThemeChanged |
    Occluded |
    RedrawRequested
%runElab derive "WindowEvent.T" [Eq, Show]