Fixed XClientMessageEvent struct, added equals operator fot TAtom from unsigned, added xclient union field access proc to XEvent

This commit is contained in:
Yury Benesh
2013-07-07 23:01:11 +03:00
parent 127253c8d5
commit f74e296f84
2 changed files with 11 additions and 2 deletions

View File

@@ -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

View File

@@ -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