Setup basic layout system

- add Enter event bindings
- Add some more window bindings.
This commit is contained in:
2026-09-09 14:02:54 +01:00
parent 30dbf2ed2d
commit c06bc3a933
4 changed files with 212 additions and 22 deletions
+26 -16
View File
@@ -68,6 +68,31 @@ module Events = struct
let from ptr = Ctypes.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"
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" Window.typ
let event = field typ "event" Window.typ
let child = field typ "child" Window.typ
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 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 window ptr = getf !@ptr event
end
end
module Client_message = struct
@@ -205,22 +230,7 @@ typedef struct xcb_map_notify_event_t {
/**
* @brief xcb_enter_notify_event_t
**/
typedef struct xcb_enter_notify_event_t {
uint8_t response_type;
uint8_t detail;
uint16_t sequence;
xcb_timestamp_t time;
xcb_window_t root;
xcb_window_t event;
xcb_window_t child;
int16_t root_x;
int16_t root_y;
int16_t event_x;
int16_t event_y;
uint16_t state;
uint8_t mode;
uint8_t same_screen_focus;
} xcb_enter_notify_event_t;
typedef xcb_enter_notify_event_t xcb_leave_notify_event_t;