Skip to content

Commit 2f6f24d

Browse files
authored
Merge pull request #5800 from IllusionMan1212/xlib-IM
vendor/xlib: a few more IM-related procedures and constants
2 parents 97e423f + e4ccfd6 commit 2f6f24d

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

vendor/x11/xlib/xlib_const.odin

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#+build linux, freebsd, openbsd
22
package xlib
33

4+
XNClientWindow: cstring : "clientWindow"
5+
XNInputStyle: cstring : "inputStyle"
6+
XNFocusWindow: cstring : "focusWindow"
7+
XNSpotLocation: cstring : "spotLocation"
8+
XNPreeditAttributes: cstring : "preeditAttributes"
9+
10+
XIMPreeditNothing :: 0x0008
11+
XIMStatusNothing :: 0x0400
12+
413
/* ---- X11/extensions/XKB.h ---------------------------------------------------------*/
514

615
XkbMinLegalKeyCode :: 8
@@ -138,6 +147,14 @@ Status :: enum i32 {
138147
LastExtensionError = 255,
139148
}
140149

150+
LookupStringStatus :: enum i32 {
151+
BufferOverflow = -1,
152+
LookupNone = 1,
153+
LookupChars = 2,
154+
LookupKeySym = 3,
155+
LookupBoth = 4,
156+
}
157+
141158
ByteOrder :: enum i32 {
142159
LSBFirst = 0,
143160
MSBFirst = 1,

vendor/x11/xlib/xlib_procs.odin

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ foreign xlib {
374374
SetSelectionOwner :: proc(
375375
display: ^Display,
376376
selection: Atom,
377-
owber: Window,
377+
owner: Window,
378378
time: Time,
379379
) ---
380380
GetSelectionOwner :: proc(
@@ -1030,6 +1030,7 @@ foreign xlib {
10301030
Pending :: proc(display: ^Display) -> i32 ---
10311031
NextEvent :: proc(display: ^Display, event: ^XEvent) ---
10321032
PeekEvent :: proc(display: ^Display, event: ^XEvent) ---
1033+
FilterEvent :: proc(event: ^XEvent, window: Window) -> b32 ---
10331034
GetEventData :: proc(display: ^Display, cookie: ^XGenericEventCookie) -> b32 ---
10341035
FreeEventData :: proc(display: ^Display, cookie: ^XGenericEventCookie) ---
10351036
// Selecting events using a predicate procedure
@@ -1697,6 +1698,24 @@ foreign xlib {
16971698
res_class: cstring,
16981699
) -> XIM ---
16991700
SetLocaleModifiers :: proc(modifiers: cstring) -> cstring ---
1701+
CreateIC :: proc(
1702+
im: XIM,
1703+
#c_vararg args: ..any,
1704+
) -> XIC ---
1705+
SetICFocus :: proc(
1706+
ic: XIC,
1707+
) ---
1708+
UnsetICFocus :: proc(
1709+
ic: XIC,
1710+
) ---
1711+
SetICValues :: proc(
1712+
ic: XIC,
1713+
#c_vararg args: ..any,
1714+
) -> cstring ---
1715+
VaCreateNestedList :: proc(
1716+
unused: i32,
1717+
#c_vararg args: ..any,
1718+
) -> XVaNestedList ---
17001719
}
17011720

17021721
@(default_calling_convention="c")
@@ -2046,4 +2065,12 @@ foreign xlib {
20462065
num: u32,
20472066
xkb: XkbDescPtr,
20482067
) -> Status ---
2068+
Xutf8LookupString :: proc(
2069+
ic: XIC,
2070+
event: ^XKeyPressedEvent,
2071+
buffer_return: ^cstring,
2072+
bytes_buffer: i32,
2073+
keysym_return: ^KeySym,
2074+
status_return: ^LookupStringStatus,
2075+
) -> i32 ---
20492076
}

0 commit comments

Comments
 (0)