Setup proper bindings for mruby.

- and a lot more stuff.
This commit is contained in:
2026-09-09 23:39:05 +01:00
parent 93d71d820a
commit ac72396a0f
17 changed files with 494 additions and 109 deletions
+43 -8
View File
@@ -11,7 +11,7 @@ end
module Window = struct
type t = Unsigned.UInt32.t
let typ : t Ctypes.typ = Ctypes.uint32_t
let typ : t typ = uint32_t
let of_int x = Unsigned.UInt32.of_int x
end
@@ -53,9 +53,32 @@ module Event = struct
end
module Events = struct
module Map_request = struct
open Ctypes
module Key = struct
type t
let typ : t structure typ = structure "xcb_key_event_t"
let response_type = field typ "response_type" uint8_t
let detail = field typ "detail" uint8_t
let sequence = field typ "sequence" uint16_t
let time = field typ "time" uint32_t
let root = field typ "root" uint32_t
let event = field typ "event" uint32_t
let child = field typ "child" uint32_t
let root_x = field typ "root_x" int16_t
let root_y = field typ "root_y" int16_t
let event_x = field typ "event_x" int16_t
let event_y = field typ "event_y" int16_t
let state = field typ "state" uint16_t
let same_screen = field typ "same_screen" uint8_t
let pad0 = field typ "pad0" uint8_t
let () = seal typ
let from ptr = from_voidp typ (to_voidp ptr)
let detail ptr = getf !@ptr detail |> Unsigned.UInt8.to_int
let state ptr = getf !@ptr state |> Unsigned.UInt16.to_int
let window ptr = getf !@ptr event
end
module Map_request = struct
type t
let typ : t structure typ = structure "xcb_map_request_event_t"
@@ -65,13 +88,11 @@ module Events = struct
let parent = field typ "parent" uint32_t
let window = field typ "window" Window.typ
let () = seal typ
let from ptr = Ctypes.from_voidp typ (to_voidp ptr)
let from ptr = from_voidp typ (to_voidp ptr)
let window ptr = getf !@ptr window
end
module Enter = struct
open Ctypes
type t
let typ : t structure typ = structure "xcb_enter_notify_event_t"
@@ -90,9 +111,23 @@ module Events = struct
let mode = field typ "mode" uint8_t
let same_screen = field typ "same_screen_focus" uint8_t
let () = seal typ
let from ptr = Ctypes.from_voidp typ (to_voidp ptr)
let from ptr = from_voidp typ (to_voidp ptr)
let window ptr = getf !@ptr event
end
module Destroy = struct
type t
let typ : t structure typ = structure "xcb_destroy_notify_event_t"
let response_type = field typ "response_type" uint8_t
let pad0 = field typ "pad0" uint8_t
let sequence = field typ "sequence" uint16_t
let event = field typ "event" uint32_t
let window = field typ "window" Window.typ
let () = seal typ
let from ptr = from_voidp typ (to_voidp ptr)
let window ptr = getf !@ptr window
end
end
module Client_message = struct
@@ -112,7 +147,7 @@ end
module Atom = struct
type t = Unsigned.UInt32.t
let typ : t Ctypes.typ = Ctypes.uint32_t
let typ : t typ = uint32_t
end
module Reply = struct