diff options
Diffstat (limited to 'lib/Wayland/Native.lean')
| -rw-r--r-- | lib/Wayland/Native.lean | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/lib/Wayland/Native.lean b/lib/Wayland/Native.lean index c529b63..d2c3e33 100644 --- a/lib/Wayland/Native.lean +++ b/lib/Wayland/Native.lean @@ -5,5 +5,34 @@ instance : Nonempty Display := DisplayP.property @[extern "waylean_display_new"] opaque Display.new : (name : @& Option String) → IO Display -@[extern "waylean_display_get_version"] -opaque Display.getVersion : (display : @& Display) → IO UInt32 +@[extern "waylean_display_roundtrip"] +opaque Display.roundtrip : (display : @& Display) → IO Unit + +private opaque EventLoopP : NonemptyType +def EventLoop : Type := EventLoopP.type +instance : Nonempty EventLoop := EventLoopP.property + +private opaque EventSourceP : NonemptyType +def EventSource : Type := EventSourceP.type +instance : Nonempty EventSource := EventSourceP.property + +@[extern "waylean_event_loop_new"] +opaque EventLoop.new : IO EventLoop + +@[extern "waylean_event_loop_add_display"] +opaque EventLoop.addDisplay : (eventLoop : @& EventLoop) → (display : @& Display) → IO EventSource + +@[extern "waylean_event_loop_add_timer"] +opaque EventLoop.addTimer : (eventLoop : @& EventLoop) → (delayMs : UInt32) → (msg : @& IO Unit) → IO EventSource + +@[extern "waylean_event_loop_add_signal"] +opaque EventLoop.addSignal : (eventLoop : @& EventLoop) → (signum : UInt32) → (msg : @& IO Unit) → IO EventSource + +@[extern "waylean_event_loop_remove"] +opaque EventLoop.remove : (eventLoop : @& EventLoop) → (source : @& EventSource) → IO Unit + +@[extern "waylean_event_loop_quit"] +opaque EventLoop.quit : (eventLoop : @& EventLoop) → IO Unit + +@[extern "waylean_event_loop_poll"] +opaque EventLoop.poll : (eventLoop : @& EventLoop) → IO (Option (IO Unit)) |
