-
Notifications
You must be signed in to change notification settings - Fork 21
/
xcb-xim.el
1022 lines (857 loc) · 39.7 KB
/
xcb-xim.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; xcb-xim.el --- XIM Protocol -*- lexical-binding: t -*-
;; Copyright (C) 2015-2019 Free Software Foundation, Inc.
;; Author: Chris Feng <[email protected]>
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This library implements the X Input Method Protocol.
;; Please note that the byte order of an XIM packet can be different from that
;; of X packets. Moreover, if you are writing an XIM server, the byte order is
;; actually specified by the client. Therefore we provide a different global
;; variable `xim:lsb' to indicate the byte order of classes in this library.
;; You should let-bind it whenever creating new objects.
;; Todo:
;; + Add extension support.
;; References:
;; + XIM (http://www.x.org/releases/X11R7.7/doc/libX11/XIM/xim.txt)
;;; Code:
(require 'xcb-types)
(require 'xcb-xlib)
;;;; Protocol number
(defconst xim:opcode:connect 1)
(defconst xim:opcode:connect-reply 2)
(defconst xim:opcode:disconnect 3)
(defconst xim:opcode:disconnect-reply 4)
(defconst xim:opcode:auth-required 10)
(defconst xim:opcode:auth-reply 11)
(defconst xim:opcode:auth-next 12)
(defconst xim:opcode:auth-setup 13)
(defconst xim:opcode:auth-ng 14)
(defconst xim:opcode:error 20)
(defconst xim:opcode:open 30)
(defconst xim:opcode:open-reply 31)
(defconst xim:opcode:close 32)
(defconst xim:opcode:close-reply 33)
(defconst xim:opcode:register-triggerkeys 34)
(defconst xim:opcode:trigger-notify 35)
(defconst xim:opcode:trigger-notify-reply 36)
(defconst xim:opcode:set-event-mask 37)
(defconst xim:opcode:encoding-negotiation 38)
(defconst xim:opcode:encoding-negotiation-reply 39)
(defconst xim:opcode:query-extension 40)
(defconst xim:opcode:query-extension-reply 41)
(defconst xim:opcode:set-im-values 42)
(defconst xim:opcode:set-im-values-reply 43)
(defconst xim:opcode:get-im-values 44)
(defconst xim:opcode:get-im-values-reply 45)
(defconst xim:opcode:create-ic 50)
(defconst xim:opcode:create-ic-reply 51)
(defconst xim:opcode:destroy-ic 52)
(defconst xim:opcode:destroy-ic-reply 53)
(defconst xim:opcode:set-ic-values 54)
(defconst xim:opcode:set-ic-values-reply 55)
(defconst xim:opcode:get-ic-values 56)
(defconst xim:opcode:get-ic-values-reply 57)
(defconst xim:opcode:set-ic-focus 58)
(defconst xim:opcode:unset-ic-focus 59)
(defconst xim:opcode:forward-event 60)
(defconst xim:opcode:sync 61)
(defconst xim:opcode:sync-reply 62)
(defconst xim:opcode:commit 63)
(defconst xim:opcode:reset-ic 64)
(defconst xim:opcode:reset-ic-reply 65)
(defconst xim:opcode:geometry 70)
(defconst xim:opcode:str-conversion 71)
(defconst xim:opcode:str-conversion-reply 72)
(defconst xim:opcode:preedit-start 73)
(defconst xim:opcode:preedit-start-reply 74)
(defconst xim:opcode:preedit-draw 75)
(defconst xim:opcode:preedit-caret 76)
(defconst xim:opcode:preedit-caret-reply 77)
(defconst xim:opcode:preedit-done 78)
(defconst xim:opcode:status-start 79)
(defconst xim:opcode:status-draw 80)
(defconst xim:opcode:status-done 81)
(defconst xim:opcode:preeditstate 82)
;;;; Basic requests packet format
(eval-and-compile
(defvar xim:lsb xcb:lsb "Non-nil for LSB first, nil otherwise.
Consider let-bind it rather than change its global value."))
(defclass xim:-struct (xcb:-struct)
((~lsb :initform (symbol-value 'xim:lsb)))
:documentation "Struct type for XIM.")
(defclass xim:-request (xim:-struct)
((~major-opcode :type xcb:CARD8)
(~minor-opcode :initform 0 :type xcb:CARD8)
(~length :initform 0 :type xcb:CARD16))
:documentation "XIM request type.")
(cl-defmethod xcb:marshal ((obj xim:-request))
"Return the byte-array representation of XIM request OBJ."
(let ((result (cl-call-next-method obj)))
(vconcat (substring result 0 2)
(funcall (if (slot-value obj '~lsb)
#'xcb:-pack-u2-lsb
#'xcb:-pack-u2)
(1- (/ (length result) 4)))
(substring result 4))))
;;;; Data types
(xcb:deftypealias 'xim:BITMASK16 'xcb:CARD16)
(xcb:deftypealias 'xim:BITMASK32 'xcb:CARD32)
(defsubst xim:PADDING (N)
"Pad N to 4 bytes."
(% (- 4 (% N 4)) 4))
(xcb:deftypealias 'xim:LPCE 'xcb:char)
(defclass xim:STRING (xim:-struct)
((length :initarg :length :type xcb:-u2)
(string :initarg :string :type xcb:-ignore)
(string~ :initform '(name string type xim:LPCE size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (+ 2 (xcb:-fieldref 'length)))
:type xcb:-pad)))
(defclass xim:STR (xim:-struct)
((length :initarg :length :type xcb:-u1)
(name :initarg :name :type xcb:-ignore)
(name~ :initform '(name name type xcb:char size (xcb:-fieldref 'length))
:type xcb:-list)))
(defclass xim:XIMATTR (xim:-struct)
((id :initarg :id :type xcb:CARD16)
(type :initarg :type :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(attribute :initarg :attribute :type xcb:-ignore)
(attribute~ :initform '(name attribute type xcb:char
size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (+ 2 (xcb:-fieldref 'length)))
:type xcb:-pad)))
(defclass xim:XICATTR (xim:XIMATTR)
nil)
(defconst xim:ATTRIBUTE-VALUE-TYPE:separator-of-nestedlist 0)
(defconst xim:ATTRIBUTE-VALUE-TYPE:byte-data 1)
(defconst xim:ATTRIBUTE-VALUE-TYPE:word-data 2)
(defconst xim:ATTRIBUTE-VALUE-TYPE:long-data 3)
(defconst xim:ATTRIBUTE-VALUE-TYPE:char-data 4)
(defconst xim:ATTRIBUTE-VALUE-TYPE:window 5)
(defconst xim:ATTRIBUTE-VALUE-TYPE:xim-styles 10)
(defconst xim:ATTRIBUTE-VALUE-TYPE:x-rectangle 11)
(defconst xim:ATTRIBUTE-VALUE-TYPE:x-point 12)
(defconst xim:ATTRIBUTE-VALUE-TYPE:x-font-set 13)
(defconst xim:ATTRIBUTE-VALUE-TYPE:xim-hot-key-triggers 15)
(defconst xim:ATTRIBUTE-VALUE-TYPE:xim-string-conversion 17)
(defconst xim:ATTRIBUTE-VALUE-TYPE:xim-preedit-state 18)
(defconst xim:ATTRIBUTE-VALUE-TYPE:xim-reset-state 19)
(defconst xim:ATTRIBUTE-VALUE-TYPE:xim-nested-list #x7FFF)
(defclass xim:XIMStyles (xim:-struct)
((number :initarg :number :type xcb:-u2)
(pad~0 :initform 2 :type xcb:-pad)
(styles :initarg :styles :type xcb:-ignore)
(styles~ :initform '(name styles type xcb:CARD32
size (/ (xcb:-fieldref 'number) 4))
:type xcb:-list)))
;; Auto set the number slot
(cl-defmethod xcb:marshal ((obj xim:XIMStyles))
(setf (slot-value obj 'number) (* 4 (length (slot-value obj 'styles))))
(cl-call-next-method obj))
(defclass xim:XFontSet (xim:-struct)
((length :initarg :length :type xcb:-u2)
(base-font-name :initarg :base-font-name :type xcb:-ignore)
(base-font-name~ :initform '(name base-font-name type xim:LPCE
size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (+ 2 (xcb:-fieldref 'length)))
:type xcb:-pad)))
(defclass xim:XIMHotKeyTriggers (xim:-struct)
((number :type xcb:-u4)
(triggers :type xcb:-ignore)
(triggers~ :initform '(name triggers type xim:XIMTRIGGERKEY
size (xcb:-fieldref 'number))
:type xcb:-list)
(states :type xcb:-ignore)
(states~ :initform '(name states type xim:XIMHOTKEYSTATE
size (xcb:-fieldref 'number))
:type xcb:-list)))
(defclass xim:XIMTRIGGERKEY (xim:-struct)
((keysym :initarg :keysym :type xcb:CARD32)
(modifier :initarg :modifier :type xcb:CARD32)
(modifier-mask :initarg :modifier-mask :type xcb:CARD32)))
(defclass xim:ENCODINGINFO (xim:-struct)
((length :initarg :length :type xcb:-u2)
(encoding-info :initarg :encoding-info :type xcb:-ignore)
(encoding-info~ :initform '(name encoding-info type xcb:char
size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (+ 2 (xcb:-fieldref 'length)))
:type xcb:-pad)))
(defclass xim:EXT (xim:-struct)
((major-opcode :initarg :major-opcode :type xcb:CARD8)
(minor-opcode :initarg :minor-opcode :type xcb:CARD8)
(length :initarg :length :type xcb:-u2)
(name :initarg :name :type xcb:-ignore)
(name~ :initform '(name name type xcb:char size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (xcb:-fieldref 'length)) :type xcb:-pad)))
(defclass xim:XIMATTRIBUTE (xim:-struct)
((id :initarg :id :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(value :initarg :value :type xcb:-ignore)
(value~ :initform '(name value type xcb:void size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (xcb:-fieldref 'length)) :type xcb:-pad)))
(cl-defmethod xcb:marshal ((obj xim:XIMATTRIBUTE))
(let ((value (slot-value obj 'value)))
(when (eieio-object-p value)
(setq value (xcb:marshal value))
(setf (slot-value obj 'length) (length value)
(slot-value obj 'value) value))
(cl-call-next-method obj)))
(defclass xim:XICATTRIBUTE (xim:XIMATTRIBUTE)
nil)
(defclass xim:XIMSTRCONVTEXT (xim:-struct)
((feedback :initarg :feedback :type xcb:CARD16)
(string-length :initarg :string-length :type xcb:-u2)
(string :initarg :string :type xcb:-ignore)
(string~ :initform '(name string type xcb:char
size (xcb:-fieldref 'string-length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (xcb:-fieldref 'string-length))
:type xcb:-pad)
(feedbacks-length :initarg :feedbacks-length :type xcb:-u2)
(pad~1 :initform 2 :type xcb:-pad)
(feedbacks :initarg :feedbacks :type xcb:-ignore)
(feedbacks~ :initform '(name feedbacks type xcb:void
size (xcb:-fieldref 'feedbacks-length))
:type xcb:-list)))
(cl-defmethod xcb:marshal ((obj xim:XIMSTRCONVTEXT))
(let ((feedbacks (mapconcat 'xcb:marshal (slot-value obj 'feedbacks) [])))
(setf (slot-value obj 'feedbacks-length) (length feedbacks)
(slot-value obj 'feedbacks) feedbacks)
(cl-call-next-method obj)))
(cl-defmethod xcb:unmarshal ((obj xim:XIMSTRCONVTEXT) byte-array)
(let ((retval (cl-call-next-method obj byte-array))
(data (slot-value obj 'feedbacks))
feedback feedbacks)
(while (< 0 (length data))
(setq feedback (make-instance 'xim:XIMSTRCONVFEEDBACK)
data (substring data (xcb:unmarshal feedback data))
feedbacks (nconc feedbacks (list feedback))))
(setf (slot-value obj 'feedbacks) feedbacks)
retval))
(defconst xim:string-conversion:left-edge #x0000001)
(defconst xim:string-conversion:right-edge #x0000002)
(defconst xim:string-conversion:top-edge #x0000004)
(defconst xim:string-conversion:bottom-edge #x0000008)
(defconst xim:string-conversion:convealed #x0000010)
(defconst xim:string-conversion:wrapped #x0000020)
(xcb:deftypealias 'xim:XIMFEEDBACK 'xcb:CARD32)
;; FIXME: different from Xlib:XIM*
(defconst xim:reverse #x000001)
(defconst xim:underline #x000002)
(defconst xim:highlight #x000004)
(defconst xim:primary #x000008)
(defconst xim:secondary #x000010)
(defconst xim:tertiary #x000020)
(defconst xim:visible-to-forward #x000040)
(defconst xim:visible-to-backward #x000080)
(defconst xim:visible-center #x000100)
(xcb:deftypealias 'xim:XIMHOTKEYSTATE 'xcb:CARD32)
(defconst xim:hot-key-state:on #x0000001)
(defconst xim:hot-key-state:off #x0000002)
(xcb:deftypealias 'xim:XIMPREEDITSTATE 'xcb:CARD32)
(defconst xim:preedit:enable #x0000001)
(defconst xim:preedit:disable #x0000002)
(xcb:deftypealias 'xim:XIMRESETSTATE 'xcb:CARD32)
(defconst xim:initial-state #x0000001)
(defconst xim:preserve-state #x0000002)
;;;; Error notification
(defclass xim:error (xim:-request)
((~major-opcode :initform xim:opcode:error)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(flag :initarg :flag :type xim:BITMASK16)
(error-code :initarg :error-code :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(type :initarg :type :type xcb:CARD16)
(detail :initarg :detail :type xcb:-ignore)
(detail~ :initform '(name detail type xcb:char
size (xcb:-fieldref 'length)) :type xcb:-list)
(pad~0 :initform '(xim:PADDING (xcb:-fieldref 'length)) :type xcb:-pad)))
(defconst xim:error-flag:invalid-both 0)
(defconst xim:error-flag:invalid-im-id 1)
(defconst xim:error-flag:invalid-ic-id 2)
(defconst xim:error-code:bad-alloc 1)
(defconst xim:error-code:bad-style 2)
(defconst xim:error-code:bad-client-window 3)
(defconst xim:error-code:bad-focus-window 4)
(defconst xim:error-code:bad-area 5)
(defconst xim:error-code:bad-spot-location 6)
(defconst xim:error-code:bad-colormap 7)
(defconst xim:error-code:bad-atom 8)
(defconst xim:error-code:bad-pixel 9)
(defconst xim:error-code:bad-pixmap 10)
(defconst xim:error-code:bad-name 11)
(defconst xim:error-code:bad-cursor 12)
(defconst xim:error-code:bad-protocol 13)
(defconst xim:error-code:bad-foreground 14)
(defconst xim:error-code:bad-background 15)
(defconst xim:error-code:locale-not-supported 16)
(defconst xim:error-code:bad-something 999)
;;;; Connection establishment
(defclass xim:connect (xim:-request)
((~major-opcode :initform xim:opcode:connect)
(byte-order :initarg :byte-order :type xcb:-u1)
(pad~0 :initform 1 :type xcb:-pad)
(major-version :initarg :major-version :type xcb:CARD16)
(minor-version :initarg :minor-version :type xcb:CARD16)
(number :initarg :number :type xcb:CARD16)
(auth-names :initarg :auth-names :type xcb:-ignore)
(auth-names~ :initform '(name auth-names type xim:STRING
size (xcb:-fieldref 'number))
:type xcb:-list)))
(defconst xim:connect-byte-order:msb-first #x42)
(defconst xim:connect-byte-order:lsb-first #x6c)
(defclass xim:auth-required (xim:-request)
((~major-opcode :initform xim:opcode:auth-required)
(index :initarg :index :type xcb:CARD8)
(pad~0 :initform 3 :type xcb:-pad)
(length :initarg :length :type xcb:-u2)
(pad~1 :initform 2 :type xcb:-pad)
(data :initarg :data :type xcb:-ignore)
(data~ :initform '(name data type xcb:void size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~1 :initform '(xim:PADDING (slot-value length)) :type xcb:-pad)))
(defclass xim:auth-reply (xim:-request)
((~major-opcode :initform xim:opcode:auth-reply)
(length :initarg :length :type xcb:-u2)
(pad~0 :initform 2 :type xcb:-pad)
(data :initarg :data :type xcb:-ignore)
(data~ :initform '(name data type xcb:void size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~1 :initform '(xim:PADDING (xcb:-fieldref 'length)) :type xcb:-pad)))
(defclass xim:auth-next (xim:-request)
((~major-opcode :initform xim:opcode:auth-next)
(length :initarg :length :type xcb:-u2)
(pad~0 :initform 2 :type xcb:-pad)
(data :initarg :data :type xcb:-ignore)
(data~ :initform '(name data type xcb:void size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~1 :initform '(xim:PADDING (xcb:-fieldref 'length)) :type xcb:-pad)))
(defclass xim:auth-setup (xim:-request)
((~major-opcode :initform xim:opcode:auth-setup)
(number :initarg :number :type xcb:CARD16)
(pad~0 :initform 2 :type xcb:-pad)
(names :initarg :names :type xcb:-ignore)
(names~ :initform '(name names type xim:STRING size (xcb:-fieldref 'number))
:type xcb:-list)))
(defclass xim:auth-ng (xim:-request)
((~major-opcode :initform xim:opcode:auth-ng)))
(defclass xim:connect-reply (xim:-request)
((~major-opcode :initform xim:opcode:connect-reply)
;; Default to version 1.0
(major-version :initarg :major-version :initform 1 :type xcb:CARD16)
(minor-version :initarg :minor-version :initform 0 :type xcb:CARD16)))
(defclass xim:disconnect (xim:-request)
((~major-opcode :initform xim:opcode:disconnect)))
(defclass xim:disconnect-reply (xim:-request)
((~major-opcode :initform xim:opcode:disconnect-reply)))
(defclass xim:open (xim:-request)
((~major-opcode :initform xim:opcode:open)
(locale-name :initarg :locale-name :type xim:STR)
(pad~0 :initform '(xim:PADDING (1+ (slot-value (xcb:-fieldref 'locale-name)
'length)))
:type xcb:-pad)))
(defclass xim:open-reply (xim:-request)
((~major-opcode :initform xim:opcode:open-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(im-attrs-length :initarg :im-attrs-length :type xcb:-u2)
(im-attrs :initarg :im-attrs :type xcb:-ignore)
(im-attrs~ :initform '(name im-attrs type xcb:void
size (xcb:-fieldref 'im-attrs-length))
:type xcb:-list)
(ic-attrs-length :initarg :ic-attrs-length :type xcb:-u2)
(pad~0 :initform 2 :type xcb:-pad)
(ic-attrs :initarg :ic-attrs :type xcb:-ignore)
(ic-attrs~ :initform '(name ic-attrs type xcb:void
size (xcb:-fieldref 'ic-attrs-length))
:type xcb:-list)))
(cl-defmethod xcb:marshal ((obj xim:open-reply))
(let ((im-attrs (mapconcat #'xcb:marshal (slot-value obj 'im-attrs) []))
(ic-attrs (mapconcat #'xcb:marshal (slot-value obj 'ic-attrs) [])))
(setf (slot-value obj 'im-attrs-length) (length im-attrs)
(slot-value obj 'im-attrs) im-attrs
(slot-value obj 'ic-attrs-length) (length ic-attrs)
(slot-value obj 'ic-attrs) ic-attrs)
(cl-call-next-method obj)))
(cl-defmethod xcb:unmarshal ((obj xim:open-reply) byte-array)
(let ((retval (cl-call-next-method obj byte-array))
(im-data (slot-value obj 'im-attrs))
(ic-data (slot-value obj 'ic-attrs))
im-attr im-attrs ic-attr ic-attrs)
(while (< 0 (length im-data))
(setq im-attr (make-instance 'xim:XIMATTR)
im-data (substring im-data (xcb:unmarshal im-attr im-data))
im-attrs (nconc im-attrs (list im-attr))))
(while (< 0 (length ic-data))
(setq ic-attr (make-instance 'xim:XICATTR)
ic-data (substring ic-data (xcb:unmarshal ic-attr ic-data))
ic-attrs (nconc ic-attrs (list ic-attr))))
(setf (slot-value obj 'im-attrs) im-attrs
(slot-value obj 'ic-attrs) ic-attrs)
retval))
(defclass xim:close (xim:-request)
((~major-opcode :initform xim:opcode:close)
(im-id :initarg :im-id :type xcb:CARD16)
(pad~0 :initform 2 :type xcb:-pad)))
(defclass xim:close-reply (xim:close)
((~major-opcode :initform xim:opcode:close-reply)))
;;;; Event flow control
(defclass xim:set-event-mask (xim:-request)
((~major-opcode :initform xim:opcode:set-event-mask)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(forward-event-mask :initarg :forward-event-mask :type xcb:-u4)
(synchronous-event-mask :initarg :synchronous-event-mask :type xcb:-u4)))
(defclass xim:register-triggerkeys (xim:-request)
((~major-opcode :initform xim:opcode:register-triggerkeys)
(im-id :initarg :im-id :type xcb:CARD16)
(pad~0 :initform 2 :type xcb:-pad)
(on-keys-length :initarg :on-keys-length :type xcb:-u4)
(on-keys :initarg :on-keys :type xcb:-ignore)
(on-keys~ :initform '(name on-keys type xim:XIMTRIGGERKEY
size (/ (xcb:-fieldref 'on-keys-length) 12))
:type xcb:-list)
(off-keys-length :initarg :off-keys-length :type xcb:-u4)
(off-keys :initarg :off-keys :type xcb:-ignore)
(off-keys~ :initform '(name off-keys type xim:XIMTRIGGERKEY
size (/ (xcb:-fieldref 'off-keys-length) 12))
:type xcb:-list)))
(defclass xim:trigger-nofity (xim:-request)
((~major-opcode :initform xim:opcode:trigger-notify)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(flag :initarg :flag :type xcb:CARD32)
(index :initarg :index :type xcb:CARD32)
(client-select-event-mask :initarg :client-select-event-mask
:type xcb:-u4)))
(defconst xim:trigger-nofity-flag:on-keys 0)
(defconst xim:trigger-nofity-flag:off-keys 1)
(defclass xim:trigger-nofity-reply (xim:-request)
((~major-opcode :initform xim:opcode:trigger-notify-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
;;;; Encoding negotiation
(defclass xim:encoding-negotiation (xim:-request)
((~major-opcode :initform xim:opcode:encoding-negotiation)
(im-id :initarg :im-id :type xcb:CARD16)
(names-length :initarg :names-length :type xcb:-u2)
(names :initarg :names :type xcb:-ignore)
(names~ :initform '(name names type xcb:void
size (xcb:-fieldref 'names-length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (xcb:-fieldref 'names-length))
:type xcb:-pad)
(encodings-length :initarg :encoding-length :type xcb:-u2)
(pad~1 :initform 2 :type xcb:-pad)
(encodings :initarg :encodings :type xcb:-ignore)
(encodings~ :initform '(name encodings type xcb:void
size (xcb:-fieldref 'encodings-length))
:type xcb:-list)))
(cl-defmethod xcb:marshal ((obj xim:encoding-negotiation))
(let ((names (mapconcat #'xcb:marshal (slot-value obj 'names) []))
(encodings (mapconcat #'xcb:marshal (slot-value obj 'encodings) [])))
(setf (slot-value obj 'names-length) (length names)
(slot-value obj 'names) names
(slot-value obj 'encodings-length) (length encodings)
(slot-value obj 'encodings) encodings)
(cl-call-next-method obj)))
(cl-defmethod xcb:unmarshal ((obj xim:encoding-negotiation) byte-array)
(let ((retval (cl-call-next-method obj byte-array))
(names-data (slot-value obj 'names))
(encodings-data (slot-value obj 'encodings))
name names encoding encodings)
(while (< 0 (length names-data))
(setq name (make-instance 'xim:STR)
names-data (substring names-data (xcb:unmarshal name names-data))
names (nconc names (list name))))
(while (< 0 (length encodings-data))
(setq encoding (make-instance 'xim:ENCODINGINFO)
encodings-data
(substring encodings-data (xcb:unmarshal encoding encodings-data))
encodings (nconc encodings (list encoding))))
(setf (slot-value obj 'names) names
(slot-value obj 'encodings) encodings)
retval))
(defclass xim:encoding-negotiation-reply (xim:-request)
((~major-opcode :initform xim:opcode:encoding-negotiation-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(category :initarg :category :type xcb:CARD16)
(index :initarg :index :type xcb:INT16)
(pad~0 :initform 2 :type xcb:-pad)))
(defconst xim:encoding-negotiation-reply-category:name 0)
(defconst xim:encoding-negotiation-reply-category:data 1)
;;;; Query the supported extension protocol list
(defclass xim:query-extension (xim:-request)
((~major-opcode :initform xim:opcode:query-extension)
(im-id :initarg :im-id :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(extensions :initarg :extensions :type xcb:-ignore)
(extensions~ :initform '(name extensions type xcb:void
size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (xcb:-fieldref 'length)) :type xcb:-pad)))
(cl-defmethod xcb:marshal ((obj xim:query-extension))
(let ((extensions (mapconcat #'xcb:marshal (slot-value obj 'extensions) [])))
(setf (slot-value obj 'length) (length extensions)
(slot-value obj 'extensions) extensions)
(cl-call-next-method obj)))
(cl-defmethod xcb:unmarshal ((obj xim:query-extension) byte-array)
(let ((retval (cl-call-next-method obj byte-array))
(data (slot-value obj 'extensions))
extension extensions)
(while (< 0 (length data))
(setq extension (make-instance 'xim:STR)
data (substring data (xcb:unmarshal extension data))
extensions (nconc extensions (list extension))))
(setf (slot-value obj 'extensions) extensions)
retval))
(defclass xim:query-extension-reply (xim:-request)
((~major-opcode :initform xim:opcode:query-extension-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(extensions :initarg :extensions :type xcb:-ignore)
(extensions~ :initform '(name extensions type xcb:void
size (xcb:-fieldref 'length))
:type xcb:-list)))
(cl-defmethod xcb:marshal ((obj xim:query-extension-reply))
(let ((extensions (mapconcat 'xcb:marshal (slot-value obj 'extensions) [])))
(setf (slot-value obj 'length) (length extensions)
(slot-value obj 'extensions) extensions)
(cl-call-next-method obj)))
(cl-defmethod xcb:unmarshal ((obj xim:query-extension-reply) byte-array)
(let ((retval (cl-call-next-method obj byte-array))
(data (slot-value obj 'extensions))
extension extensions)
(while (< 0 (length data))
(setq extension (make-instance 'xim:EXT)
data (substring data (xcb:unmarshal extension data))
extensions (nconc extensions (list extension))))
(setf (slot-value obj 'extensions) extensions)
retval))
;;;; Setting IM values
(defclass xim:set-im-values (xim:-request)
((~major-opcode :initform xim:opcode:set-im-values)
(im-id :initarg :im-id :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(im-attributes :initarg :im-attributes :type xcb:-ignore)
(im-attributes~ :initform '(name im-attributes type xcb:void
size (xcb:-fieldref 'length))
:type xcb:-list)))
(cl-defmethod xcb:marshal ((obj xim:set-im-values))
(let ((im-attributes (mapconcat #'xcb:marshal
(slot-value obj 'im-attributes) [])))
(setf (slot-value obj 'length) (length im-attributes)
(slot-value obj 'im-attributes) im-attributes)
(cl-call-next-method obj)))
(defclass xim:set-im-values-reply (xim:-request)
((~major-opcode :initform xim:opcode:set-im-values-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(pad~0 :initform 2 :type xcb:-pad)))
;;;; Getting IM values
(defclass xim:get-im-values (xim:-request)
((~major-opcode :initform xim:opcode:get-im-values)
(im-id :initarg :im-id :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(im-attributes-id :initarg :im-attributes-id :type xcb:-ignore)
(im-attributes-id~ :initform '(name im-attributes-id type xcb:CARD16
size (/ (xcb:-fieldref 'length) 2))
:type xcb:-list)))
(defclass xim:get-im-values-reply (xim:set-im-values)
((~major-opcode :initform xim:opcode:get-im-values-reply)))
;;;; Creating an IC
(defclass xim:create-ic (xim:-request)
((~major-opcode :initform xim:opcode:create-ic)
(im-id :initarg :im-id :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(ic-attributes :initarg :ic-attributes :type xcb:-ignore)
(ic-attributes~ :initform '(name ic-attributes type xcb:void
size (xcb:-fieldref 'length))
:type xcb:-list)))
(cl-defmethod xcb:marshal ((obj xim:create-ic))
(let ((ic-attributes (mapconcat #'xcb:marshal
(slot-value obj 'ic-attributes) [])))
(setf (slot-value obj 'length) (length ic-attributes)
(slot-value obj 'ic-attributes) ic-attributes)
(cl-call-next-method obj)))
(cl-defmethod xcb:unmarshal ((obj xim:create-ic) byte-array)
(let ((retval (cl-call-next-method obj byte-array))
(data (slot-value obj 'ic-attributes))
ic-attribute ic-attributes)
(while (< 0 (length data))
(setq ic-attribute (make-instance 'xim:XICATTRIBUTE)
data (substring data (xcb:unmarshal ic-attribute data))
ic-attributes (nconc ic-attributes (list ic-attribute))))
(setf (slot-value obj 'ic-attributes) ic-attributes)
retval))
(defclass xim:create-ic-reply (xim:-request)
((~major-opcode :initform xim:opcode:create-ic-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
;;;; Destroy the IC
(defclass xim:destroy-ic (xim:-request)
((~major-opcode :initform xim:opcode:destroy-ic)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
(defclass xim:destroy-ic-reply (xim:-request)
((~major-opcode :initform xim:opcode:destroy-ic-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
;;;; Setting IC values
(defclass xim:set-ic-values (xim:-request)
((~major-opcode :initform xim:opcode:set-ic-values)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(pad~0 :initform 2 :type xcb:-pad)
(ic-attributes :initarg :ic-attributes :type xcb:-ignore)
(ic-attributes~ :initform '(name ic-attributes type xcb:void
size (xcb:-fieldref 'length))
:type xcb:-list)))
(cl-defmethod xcb:marshal ((obj xim:set-ic-values))
(let ((ic-attributes (mapconcat 'xcb:marshal
(slot-value obj 'ic-attributes) [])))
(setf (slot-value obj 'length) (length ic-attributes)
(slot-value obj 'ic-attributes) ic-attributes)
(cl-call-next-method obj)))
(defclass xim:set-ic-values-reply (xim:-request)
((~major-opcode :initform xim:opcode:set-ic-values-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
;;;; Getting IC values
(defclass xim:get-ic-values (xim:-request)
((~major-opcode :initform xim:opcode:get-ic-values)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(ic-attributes-id :initarg :ic-attributes-id :type xcb:-ignore)
(ic-attributes-id~ :initform '(name ic-attributes-id type xcb:CARD16
size (/ (xcb:-fieldref 'length) 2))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (+ 2 (xcb:-fieldref 'length)))
:type xcb:-pad)))
(defclass xim:get-ic-values-reply (xim:set-ic-values)
((~major-opcode :initform xim:opcode:get-ic-values-reply)))
;;;; Setting IC focus
(defclass xim:set-ic-focus (xim:-request)
((~major-opcode :initform xim:opcode:set-ic-focus)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
;;;; Unsetting IC focus
(defclass xim:unset-ic-focus (xim:-request)
((~major-opcode :initform xim:opcode:unset-ic-focus)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
;;;; Filtering events
(defclass xim:forward-event (xim:-request)
((~major-opcode :initform xim:opcode:forward-event)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(flag :initarg :flag :type xim:BITMASK16)
(serial-number :initarg :serial-number :type xcb:CARD16)
(event :initarg :event :type xcb:-ignore)
(event~ :initform '(name event type xcb:void size 32) :type xcb:-list)))
(defconst xim:forward-event-flag:synchronous 1)
(defconst xim:forward-event-flag:request-filtering 2)
(defconst xim:forward-event-flag:request-lookupstring 4)
;;;; Synchronizing with the IM server
(defclass xim:sync (xim:-request)
((~major-opcode :initform xim:opcode:sync)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
(defclass xim:sync-reply (xim:-request)
((~major-opcode :initform xim:opcode:sync-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
;;;; Sending a committed string
(defclass xim:commit (xim:-request)
((~major-opcode :initform xim:opcode:commit)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(flag :initarg :flag :type xim:BITMASK16)))
(defconst xim:commit-flag:synchronous 1)
;; FIXME: different from Xlib:XLookup*
(defconst xim:commit-flag:x-lookup-chars 2)
(defconst xim:commit-flag:x-lookup-key-sym 4)
(defconst xim:commit-flag:x-lookup-both 6)
(defclass xim:commit-x-lookup-key-sym (xim:commit)
((flag :initform xim:commit-flag:x-lookup-key-sym)
(pad~0 :initform 2 :type xcb:-pad)
(key-sym :initarg :key-sym :type xcb:KEYSYM)))
(defclass xim:commit-x-lookup-chars (xim:commit)
((flag :initform xim:commit-flag:x-lookup-chars)
(length :initarg :length :type xcb:-u2)
(string :initarg :string :type xcb:-ignore)
(string~ :initform '(name string type xcb:BYTE size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~1 :initform '(xim:PADDING (xcb:-fieldref 'length)) :type xcb:-pad)))
(defclass xim:commit-x-lookup-both (xim:commit-x-lookup-key-sym
xim:commit-x-lookup-chars)
((flag :initform xim:commit-flag:x-lookup-both)
(pad~1 :initform '(xim:PADDING (+ 2 (xcb:-fieldref 'length)))
:type xcb:-pad)))
;;;; Reset IC
(defclass xim:reset-ic (xim:-request)
((~major-opcode :initform xim:opcode:reset-ic)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
(defclass xim:reset-ic-reply (xim:-request)
((~major-opcode :initform xim:opcode:reset-ic-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(length :initarg :length :type xcb:-u2)
(string :initarg :string :type xcb:-ignore)
(string~ :initform '(name string type xcb:BYTE size (xcb:-fieldref 'length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (+ 2 (xcb:-fieldref 'length)))
:type xcb:-pad)))
;;;; Callbacks
;; Negotiating geometry
(defclass xim:geometry (xim:-request)
((~major-opcode :initform xim:opcode:geometry)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
;; Converting a string
(defclass xim:str-conversion (xim:-request)
((~major-opcode :initform xim:opcode:str-conversion)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(position :initarg :position :type xcb:CARD16)
(pad~0 :initform 2 :type xcb:-pad)
(direction :initarg :direction :type xcb:CARD32)
(factor :initarg :factor :type xcb:CARD16)
(operation :initarg :operation :type xcb:CARD16)
(length :initarg :length :type xcb:INT16)))
(defconst xim:caret-direction:forward-char 0)
(defconst xim:caret-direction:backward-char 1)
(defconst xim:caret-direction:forward-word 2)
(defconst xim:caret-direction:backward-word 3)
(defconst xim:caret-direction:caret-up 4)
(defconst xim:caret-direction:caret-down 5)
(defconst xim:caret-direction:next-line 6)
(defconst xim:caret-direction:previous-line 7)
(defconst xim:caret-direction:line-start 8)
(defconst xim:caret-direction:line-end 9)
(defconst xim:caret-direction:absolute-position 10)
(defconst xim:caret-direction:dont-change 11)
(defconst xim:string-conversion-operation:substitution 1)
(defconst xim:string-conversion-operation:retrieval 2)
(defclass xim:str-conversion-reply (xim:-request)
((~major-opcode :initform xim:opcode:str-conversion-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(feedback :initarg :feedback :type xcb:CARD32)
(text :initarg :text :type xim:XIMSTRCONVTEXT)))
;; Preedit callbacks
(defclass xim:preedit-start (xim:-request)
((~major-opcode :initform xim:opcode:preedit-start)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
(defclass xim:preedit-start-reply (xim:-request)
((~major-opcode :initform xim:opcode:preedit-start-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(return-value :initarg :return-value :type xcb:INT32)))
(defclass xim:preedit-draw (xim:-request)
((~major-opcode :initform xim:opcode:preedit-draw)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(caret :initarg :caret :type xcb:INT32)
(chg-first :initarg :chg-first :type xcb:INT32)
(chg-length :initarg :chg-length :type xcb:INT32)
(status :initarg :status :type xim:BITMASK32)
(string-length :initarg :string-length :type xcb:-u2)
(string :initarg :string :type xcb:-ignore)
(string~ :initform '(name string type xcb:char
size (xcb:-fieldref 'string-length))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (+ 2 (xcb:-fieldref 'string-length)))
:type xcb:-pad)
(feedback-length :initarg :feedback-length :type xcb:-u2)
(pad~1 :initform 2 :type xcb:-pad)
(feedback :initarg :feedback :type xcb:-ignore)
(feedback~ :initform '(name feedback type xim:XIMFEEDBACK
size (/ (xcb:-fieldref 'feedback-length) 4))
:type xcb:-list)))
(defconst xim:preedit-draw-status:no-string 1)
(defconst xim:preedit-draw-status:no-feedback 2)
(defclass xim:preedit-caret (xim:-request)
((~major-opcode :initform xim:opcode:preedit-caret)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(position :initarg :position :type xcb:INT32)
(direction :initarg :direction :type xcb:CARD32)
(style :initarg :style :type xcb:CARD32)))
(defconst xim:preedit-caret-style:invisible 0)
(defconst xim:preedit-caret-style:primary 1)
(defconst xim:preedit-caret-style:secondary 2)
(defclass xim:preedit-caret-reply (xim:-request)
((~major-opcode :initform xim:opcode:preedit-caret-reply)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(position :initarg :position :type xcb:CARD32)))
(defclass xim:preedit-done (xim:-request)
((~major-opcode :initform xim:opcode:preedit-done)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
;; Preedit state notify
(defclass xim:preeditstate (xim:-request)
((~major-opcode :initform xim:opcode:preeditstate)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(state :initarg :state :type xim:BITMASK32)))
(defconst xim:preeditstate:unknown 0)
(defconst xim:preeditstate:enable 1)
(defconst xim:preeditstate:disable 2)
;; Status callbacks
(defclass xim:status-start (xim:-request)
((~major-opcode :initform xim:opcode:status-start)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)))
(defclass xim:status-draw (xim:-request)
((~major-opcode :initform xim:opcode:status-draw)
(im-id :initarg :im-id :type xcb:CARD16)
(ic-id :initarg :ic-id :type xcb:CARD16)
(type :initarg :type :type xcb:CARD32)))
(defconst xim:status-draw-type:text 0)
(defconst xim:status-draw-type:bitmap 1)
(defclass xim:status-draw-text (xim:status-draw)
((type :initarg :type :initform xim:status-draw-type:text)
(status :initarg :status :type xim:BITMASK32)
(string-length :initarg :string-length :type xcb:-u2)
(string :initarg :string :type xcb:-ignore)
(string~ :initform '(name string type xcb:char
size (xcb:-fieldref 'string-lessp))
:type xcb:-list)
(pad~0 :initform '(xim:PADDING (+ 2 (xcb:-fieldref 'string-length)))