From 70592630a48509b69a0c19df6bbff02e594d2969 Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Thu, 6 Jun 2024 02:39:48 -0700 Subject: [PATCH] add support for title changes, cursor config, and dnd --- vendor/x11/xlib/xlib_const.odin | 5 +++++ vendor/x11/xlib/xlib_procs.odin | 30 ++++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/vendor/x11/xlib/xlib_const.odin b/vendor/x11/xlib/xlib_const.odin index 910940dec..0b87ab9f7 100644 --- a/vendor/x11/xlib/xlib_const.odin +++ b/vendor/x11/xlib/xlib_const.odin @@ -17,6 +17,11 @@ AllTemporary :: 0 CurrentTime :: 0 NoSymbol :: 0 +PropModeReplace :: 0 +PropModePrepend :: 1 +PropModeAppend :: 2 + +XA_ATOM :: Atom(4) XA_WM_CLASS :: Atom(67) XA_WM_CLIENT_MACHINE :: Atom(36) XA_WM_COMMAND :: Atom(34) diff --git a/vendor/x11/xlib/xlib_procs.odin b/vendor/x11/xlib/xlib_procs.odin index 735ddc9c4..20ec5bb39 100644 --- a/vendor/x11/xlib/xlib_procs.odin +++ b/vendor/x11/xlib/xlib_procs.odin @@ -6,6 +6,16 @@ foreign xlib { @(link_name="_Xdebug") _Xdebug: i32 } +foreign import xcursor "system:Xcursor" +@(default_calling_convention="c", link_prefix="X") +foreign xcursor { + cursorGetTheme :: proc(display: ^Display) -> cstring --- + cursorGetDefaultSize :: proc(display: ^Display) -> i32 --- + cursorLibraryLoadImage :: proc(name: cstring, theme: cstring, size: i32) -> rawptr --- + cursorImageLoadCursor :: proc(display: ^Display, img: rawptr) -> Cursor --- + cursorImageDestroy :: proc(img: rawptr) --- +} + /* ---- X11/Xlib.h ---------------------------------------------------------*/ @(default_calling_convention="c", link_prefix="X") @@ -20,11 +30,9 @@ foreign xlib { NoOp :: proc(display: ^Display) --- // Display macros (connection) ConnectionNumber :: proc(display: ^Display) -> i32 --- - ExtendedMaxRequestSize :: - proc(display: ^Display) -> int --- + ExtendedMaxRequestSize :: proc(display: ^Display) -> int --- MaxRequestSize :: proc(display: ^Display) -> int --- - LastKnownRequestProcessed :: - proc(display: ^Display) -> uint --- + LastKnownRequestProcessed :: proc(display: ^Display) -> uint --- NextRequest :: proc(display: ^Display) -> uint --- ProtocolVersion :: proc(display: ^Display) -> i32 --- ProtocolRevision :: proc(display: ^Display) -> i32 --- @@ -46,8 +54,7 @@ foreign xlib { DefaultRootWindow :: proc(display: ^Display) -> Window --- DefaultScreen :: proc(display: ^Display) -> i32 --- DefaultVisual :: proc(display: ^Display, screen_no: i32) -> ^Visual --- - DefaultScreenOfDisplay :: - proc(display: ^Display) -> ^Screen --- + DefaultScreenOfDisplay :: proc(display: ^Display) -> ^Screen --- // Display macros (other) RootWindow :: proc(display: ^Display, screen_no: i32) -> Window --- ScreenCount :: proc(display: ^Display) -> i32 --- @@ -1619,6 +1626,17 @@ foreign xlib { ) -> b32 --- DestroyImage :: proc(image: ^XImage) --- ResourceManagerString :: proc(display: ^Display) -> cstring --- + utf8SetWMProperties :: proc( + display: ^Display, + window: Window, + window_name: cstring, + icon_name: cstring, + argv: ^cstring, + argc: i32, + normal_hints: ^XSizeHints, + wm_hints: ^XWMHints, + class_hints: ^XClassHint, + ) --- } @(default_calling_convention="c")