aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Olaechea <pirata@gmail.com>2020-08-23 16:40:51 -0500
committerJavier Olaechea <pirata@gmail.com>2020-08-23 16:40:51 -0500
commit31ba628b23a771c85c6d26ba4adaf7f90c93633a (patch)
tree81d4a60c77a6a7306fda2be001de384abbf585bd
parent6fb462b818e3aeca897f30100f3ec04c5eb845e8 (diff)
downloadcl-xcb-master.tar.gz
Add Common typesHEADmaster
These types are assumed to be always present. We still need to teach CL-XCB how to de-/serialize the types from their wire representation to Lisp values.
-rw-r--r--src/xcb/types.lisp51
1 files changed, 50 insertions, 1 deletions
diff --git a/src/xcb/types.lisp b/src/xcb/types.lisp
index 1e59363..68f9a54 100644
--- a/src/xcb/types.lisp
+++ b/src/xcb/types.lisp
@@ -59,6 +59,9 @@
(declare (ignore size kind))
`(register-type (make-instance 'type-description :name ',name ,@options)))
+
+;;; Common Types
+
(defxcbtype :card8
:kind :fixed
:size 1)
@@ -67,10 +70,54 @@
:kind :fixed
:size 2)
+(defxcbtype :card32
+ :kind :fixed
+ :size 4)
+
+(defxcbtype :card64
+ :kind :fixed
+ :size 8)
+
+(defxcbtype :int8
+ :kind :fixed
+ :size 1)
+
+(defxcbtype :int16
+ :kind :fixed
+ :size 2)
+
+(defxcbtype :int32
+ :kind :fixed
+ :size 4)
+
+(defxcbtype :int64
+ :kind :fixed
+ :size 8)
+
+(defxcbtype :char
+ :kind :fixed
+ :size 1)
+
+(defxcbtype :float
+ :kind :fixed
+ :size 4)
+
+(defxcbtype :double
+ :kind :fixed
+ :size 8)
+
(defxcbtype :bool
:kind :fixed
:size 1)
+(defxcbtype :byte
+ :kind :fixed
+ :size 1)
+
+;; XXX: It is serialized as a uint8_t
+(defxcbtype :void
+ :kind :fixed
+ :size 1)
(defun register-type-alias (alias base-name)
(setf (gethash alias *type-info*)
@@ -82,6 +129,8 @@
(define-type-alias :cookie
:card16)
-;; TODO: Check if this alias is according to the spec.
+;; XXX: This is wrong, they are the same size but they map to
+;; different C types. uint8_t and char respectively.
+;; Cf state.py in ;; xcbproto.
(define-type-alias :char
:card8)