19 lines
537 B
OCaml
19 lines
537 B
OCaml
open Ctypes
|
|
open Foreign
|
|
|
|
module Atom = struct
|
|
let _xcb_intern_atom =
|
|
foreign "xcb_intern_atom"
|
|
(ptr Types.Connection.typ @-> uint8_t @-> uint16_t @-> string
|
|
@-> returning Types.Cookie.Atom.typ)
|
|
|
|
let intern conn only_if_exists name =
|
|
_xcb_intern_atom conn
|
|
(Unsigned.UInt8.of_int (if only_if_exists then 1 else 0))
|
|
(Unsigned.UInt16.of_int (String.length name))
|
|
name
|
|
|
|
let wm_protocols conn = intern conn true "WM_PROTOCOLS"
|
|
let wm_delete_window conn = intern conn false "WM_DELETE_WINDOW"
|
|
end
|