diff options
author | Yury Benesh <ybxsoft@tut.by> | 2013-07-07 23:01:11 +0300 |
---|---|---|
committer | Yury Benesh <ybxsoft@tut.by> | 2013-07-07 23:01:11 +0300 |
commit | f74e296f8486fd55d97a7a89e345a783a855e19c (patch) | |
tree | 836157109ef1d672d1726fca592ddb71f1ab480a | |
parent | 127253c8d510b1594b2eb00ae4547fdc5539fdd4 (diff) | |
download | Nim-f74e296f8486fd55d97a7a89e345a783a855e19c.tar.gz |
Fixed XClientMessageEvent struct, added equals operator fot TAtom from unsigned, added xclient union field access proc to XEvent
-rw-r--r-- | lib/wrappers/x11/x.nim | 4 | ||||
-rw-r--r-- | lib/wrappers/x11/xlib.nim | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/wrappers/x11/x.nim b/lib/wrappers/x11/x.nim index 20420b114..2eefe311f 100644 --- a/lib/wrappers/x11/x.nim +++ b/lib/wrappers/x11/x.nim @@ -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 diff --git a/lib/wrappers/x11/xlib.nim b/lib/wrappers/x11/xlib.nim index 6603d1529..1f7059771 100644 --- a/lib/wrappers/x11/xlib.nim +++ b/lib/wrappers/x11/xlib.nim @@ -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 |