mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 18:32:11 +00:00
Fixed XClientMessageEvent struct, added equals operator fot TAtom from unsigned, added xclient union field access proc to XEvent
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
# x.h
|
||||
#
|
||||
# Pointers to basic pascal types, inserted by h2pas conversion program.
|
||||
import unsigned
|
||||
|
||||
const
|
||||
X_PROTOCOL* = 11
|
||||
@@ -47,7 +48,8 @@ type
|
||||
PKeyCode* = ptr TKeyCode
|
||||
TKeyCode* = cuchar
|
||||
|
||||
proc `==`*(a, b: TAtom): bool {.borrow.}
|
||||
proc `==`*(a, b: TAtom): bool =
|
||||
return unsigned.`==`(a,b)
|
||||
|
||||
const
|
||||
None* = 0
|
||||
|
||||
@@ -694,7 +694,7 @@ type
|
||||
window*: TWindow
|
||||
message_type*: TAtom
|
||||
format*: cint
|
||||
data*: array[0..19, char]
|
||||
data*: array[0..4, clong]
|
||||
|
||||
PXMappingEvent* = ptr TXMappingEvent
|
||||
TXMappingEvent*{.final.} = object
|
||||
@@ -766,6 +766,13 @@ type
|
||||
#
|
||||
|
||||
|
||||
proc xclient*(e: PXEvent): PXClientMessageEvent =
|
||||
## Treats XEvent as XClientMessageEvent
|
||||
return cast[PXClientMessageEvent](e)
|
||||
|
||||
proc xclient*(e: var TXEvent): PXClientMessageEvent =
|
||||
return xclient(PXEvent(e.addr))
|
||||
|
||||
type
|
||||
PXCharStruct* = ptr TXCharStruct
|
||||
TXCharStruct*{.final.} = object
|
||||
|
||||
Reference in New Issue
Block a user