forked from python-xlib/python-xlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjects.texi
More file actions
1356 lines (910 loc) · 34.5 KB
/
objects.texi
File metadata and controls
1356 lines (910 loc) · 34.5 KB
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
@node X Objects
@chapter X Objects
All X operations are performed by invoking object methods.
The objects and their methods are listed in the following nodes, however
with no detailed explanations. The reader are referred to other sources
of X documentation for details, e.g. the X protocol specification, the C
Xlib documentation or man pages. A vast collection of X documentation
links can be found at @uref{http://www.rahul.net/kenton/xsites.html}.
Methods returning a single value will return that directly. Otherwise,
an object containing attributes for each of the result values is
returned.
Methods returning some value will raise an exception on error. Methods
which does not return any value have instead an @code{on_error}
parameter, which can be used to specify an error handler.
@menu
* Display:: Methods on Display objects.
* Resource:: Methods common to all the following resource objects.
* Colormap:: Methods on Colormap objects.
* Cursor:: Methods on Cursor objects.
* Drawable:: Methods common to Window and Pixmap objects.
* Window:: Methods on Window objects.
* Pixmap:: Methods on Pixmap objects.
* Fontable:: Methods common to GC and Font objects.
* GC:: Methods on GC objects.
* Font:: Methods on Font objects.
@end menu
@node Display
@section Display
Display information retrieval methods:
@defmethod Display get_display_name ( )
Returns the name used to connect to the server, either provided when
creating the @code{Display} object, or fetched from the environmental
variable @code{$DISPLAY}.
@end defmethod
@defmethod Display fileno ( )
Returns the file descriptor number of the underlying socket. This
method is provided to allow @code{Display} objects to be passed
@code{select.select()}.
@end defmethod
@defmethod Display close ( )
Close the display, freeing the resources that it holds.
@end defmethod
@defmethod Display set_error_handler ( handler )
Set the default error handler which will be called for all unhandled
errors. @var{handler} should take two arguments as a normal request
error handler, but the second argument (the request) will be None.
@xref{Error Handling}.
@end defmethod
@defmethod Display flush ( )
Flush the request queue, building and sending the queued requests. This
can be necessary in applications that never wait for events, and in
threaded applications.
@end defmethod
@defmethod Display sync ( )
Flush the queue and wait until the server has processed all the queued
requests. Use this e.g. when it is important that errors caused by a
certain request is trapped.
@end defmethod
@defmethod Display next_event ( )
Return the next event. If there are no events queued, it will block
until the next event is fetched from the server.
@end defmethod
@defmethod Display pending_events ( )
Return the number of events queued, i.e. the number of times that
@code{Display.next_event()} can be called without blocking.
@end defmethod
@defmethod Display has_extension ( extension )
Check if both the server and the client library support the X extension
named @var{extension}.
@end defmethod
@defmethod Display create_resource_object ( type, id )
Create a resource object of @var{type} for the integer @var{id}.
@var{type} should be one of the following strings:
@table @code
@item resource
@itemx drawable
@itemx window
@itemx pixmap
@itemx fontable
@itemx font
@itemx gc
@itemx colormap
@itemx cursor
@end table
This function can be used when a resource ID has been fetched e.g. from
an resource or a command line argument. Resource objects should never
be created by instantiating the appropriate class directly, since any X
extensions dynamically added by the library will not be available.
@end defmethod
@defmethod Display screen ( sno = None )
Return the information about screen number @var{sno}, or the default
screen if @var{sno} is @code{None}.
The return object has the following attributes:
@table @code
@item root
The screen root window.
@item default_colormap
The default colormap for the root window and its children.
@item white_pixel
@itemx black_pixel
The pixel values for white and black, respectively, in the default
colormap.
@item current_input_mask
The event mask of the root window at the time the connection was set up.
@item width_in_pixels
@itemx height_in_pixels
The size of the root window in pixels, i.e. the size of the entire screen.
@item width_in_mms
@itemx height_in_mms
The physical size of the screen, in millimeters.
@item min_installed_maps
@itemx max_installed_maps
The minimum and maximum number of colormaps that can be installed at the
same time.
@item root_visual
The visual type of the root window.
@item backing_store
Whether the screen supports backing store, one of the values
@code{X.WhenMapped}, @code{X.NotUseful}, or @code{X.Always}.
@item save_unders
True if the screen supports save unders.
@item root_depth
The depth of the root window.
@item allowed_depths
A list of the pixmap and windows depths that this screen supports. The
list items have the following attributes:
@table @code
@item depth
This depth is supported by the screen.
@item visuals
A list of visual types that is valid for this depth. If this list is
empty, this depth is only valid for pixmaps and not for windows. The
list items have the following attributes:
@table @code
@item visual_id
The ID of this visual.
@item visual_class
One of @code{X.StaticGray}, @code{X.StaticColor}, @code{X.TrueColor},
@code{X.GrayScale}, @code{X.PseudoColor}, or @code{X.DirectColor}.
@item bits_per_rgb_value
The number of bits used to represent an entire RGB-value, allowing a
total of @code{2^bits_per_rgb_value} distinct colors.
@item colormap_entries
The number of free entries in a newly created colormap.
@item red_mask
@itemx blue_mask
@itemx green_mask
Bitmasks selecting the three color components from the entire RGB value.
@end table
@end table
@end table
@end defmethod
@defmethod Display screen_count ( )
Return the total number of screens on the display.
@end defmethod
@defmethod Display get_default_screen ( )
Return the number of the default screen, extracted from the display
name.
@end defmethod
@defmethod Display keycode_to_keysym ( keycode, index )
Convert a @var{keycode} to a keysym, looking in entry @var{index}.
Normally index 0 is unshifted, 1 is shifted, 2 is alt grid, and 3 is
shift+alt grid. If that key entry is not bound, @code{X.NoSymbol} is
returned.
@end defmethod
@defmethod Display keysym_to_keycode ( keysym )
Look up the primary keycode that is bound to @var{keysym}. If several
keycodes are found, the one with the lowest index and lowest code is
returned. If @var{keysym} is not bound to any key, 0 is returned.
@end defmethod
@defmethod Display keysym_to_keycodes ( keysym )
Look up all the keycodes that is bound to @code{keysym}. A list of
tuples @code{(keycode, index)} is returned, sorted primarily on the
lowest index and secondarily on the lowest keycode.
@end defmethod
@defmethod Display refresh_keyboard_mapping ( evt )
This method should be called once when a @code{MappingNotify} event is
received, to update the keymap cache. @var{evt} should be the event
object.
@end defmethod
@defmethod Display lookup_string ( keysym )
Attempt to convert @var{keysym} into a single character or a string. If
no translation is found, @code{None} is returned.
@end defmethod
@defmethod Display rebind_string ( keysym, newstring )
Set the string representation of @code{keysym} to @code{newstring}, so
that it will be returned by @code{Display.lookup_string()}.
@end defmethod
X requests methods:
@defmethod Display intern_atom ( name, only_if_exists = 0 )
Intern the string @var{name}, returning its atom number. If
@var{only_if_exists} is true and the atom does not already exist,
it will not be created and @code{X.NONE} is returned.
@end defmethod
@defmethod Display get_atom_name ( atom )
Look up the name of @var{atom}, returning it as a string. Will raise
@code{BadAtom} if @var{atom} does not exist.
@end defmethod
@defmethod Display get_selection_owner ( selection )
Return the window that owns @var{selection} (an atom), or @code{X.NONE}
if there is no owner for the selection. Can raise @code{BadAtom}.
@end defmethod
@defmethod Display send_event ( destination, event, @w{event_mask = 0,} @w{propagate = 0,} @w{onerror = None )}
Send a synthetic event to the window @code{destination} which can be a
window object, or @code{X.PointerWindow} or @code{X.InputFocus}.
@code{event} is the event object to send, instantiated from one of the
classes in @code{protocol.events}. See XSendEvent(3X11) for details.
There is also a @code{Window.send_event()} method.
@end defmethod
@defmethod Display ungrab_pointer ( time, onerror = None )
Release a grabbed pointer and any queued events. See
XUngrabPointer(3X11).
@end defmethod
@defmethod Display change_active_pointer_grab ( event_mask, cursor, time, @w{onerror = None )}
Change the dynamic parameters of a pointer grab. See
XChangeActivePointerGrab(3X11).
@end defmethod
@defmethod Display ungrab_keyboard ( time, onerror = None )
Ungrab a grabbed keyboard and any queued events. See
XUngrabKeyboard(3X11).
@end defmethod
@defmethod Display allow_events ( mode, time, @w{onerror = None )}
Release some queued events. @var{mode} should be one of
@code{X.AsyncPointer}, @code{X.SyncPointer}, @code{X.AsyncKeyboard},
@code{X.SyncKeyboard}, @code{X.ReplayPointer}, @code{X.ReplayKeyboard},
@code{X.AsyncBoth}, or @code{X.SyncBoth}. @var{time} should be a
timestamp or @code{X.CurrentTime}.
@end defmethod
@defmethod Display grab_server ( onerror = None )
Disable processing of requests on all other client connections until the
server is ungrabbed. Server grabbing should be avoided as much as
possible.
@end defmethod
@defmethod Display ungrab_server ( onerror = None )
Release the server if it was previously grabbed by this client.
@end defmethod
@defmethod Display warp_pointer ( x, y, @w{src_window = X.NONE,} @w{src_x = 0,} @w{src_y = 0,} @w{src_width = 0,} @w{src_height = 0,} @w{onerror = None )}
Move the pointer relative its current position by the offsets
(@var{x}, @var{y}). However, if @var{src_window} is a window the
pointer is only moved if the specified rectangle in @var{src_window}
contains it. If @var{src_width} is 0 it will be replaced with the width
of @var{src_window} - @var{src_x}. @var{src_height} is treated in a
similar way.
To move the pointer to absolute coordinates, use
@code{Window.warp_pointer()}.
@end defmethod
@defmethod Display set_input_focus ( focus, revert_to, time, @w{onerror = None )}
Set input focus to @var{focus}, which should be a window,
@code{X.PointerRoot} or @code{X.NONE}. @var{revert_to} specifies where
the focus reverts to if the focused window becomes not visible, and
should be @code{X.RevertToParent}, @code{RevertToPointerRoot}, or
@code{RevertToNone}. See XSetInputFocus(3X11) for details.
There is also a @code{Window.set_input_focus()}.
@end defmethod
@defmethod Display get_input_focus ( )
Return an object with the following attributes:
@table @code
@item focus
The window which currently holds the input focus, @code{X.NONE} or
@code{X.PointerRoot}.
@item revert_to
Where the focus will revert, one of @code{X.RevertToParent},
@code{RevertToPointerRoot}, or @code{RevertToNone}.
@end table
@end defmethod
@defmethod Display query_keymap ( )
Return a bit vector for the logical state of the keyboard, where each
bit set to 1 indicates that the corresponding key is currently pressed
down. The vector is represented as a list of 32 integers. List item N
contains the bits for keys 8N to 8N + 7 with the least significant bit
in the byte representing key 8N.
@end defmethod
@defmethod Display open_font ( name )
Open the font identifed by the pattern @var{name} and return its font
object. If @var{name} does not match any font, @code{None} is returned.
@end defmethod
@defmethod Display list_fonts ( pattern, max_names )
Return a list of font names matching @var{pattern}. No more than
@var{max_names} will be returned.
@end defmethod
@defmethod Display list_fonts_with_info ( pattern, max_names )
Return a list of fonts matching @var{pattern}. No more than
@var{max_names} will be returned. Each list item represents one font
and has the following properties:
@table @code
@item name
The name of the font.
@item min_bounds
@itemx max_bounds
@itemx min_char_or_byte2
@itemx max_char_or_byte2
@itemx default_char
@itemx draw_direction
@itemx min_byte1
@itemx max_byte1
@itemx all_chars_exist
@itemx font_ascent
@itemx font_descent
@itemx replies_hint
See the description of XFontStruct in XGetFontProperty(3X11) for details
on these values.
@item properties
A list of properties. Each entry has two attributes:
@table @code
@item name
The atom identifying this property.
@item value
A 32-bit unsigned value.
@end table
@end table
@end defmethod
@defmethod Display set_font_path ( path, onerror = None )
Set the font path to @var{path}, which should be a list of strings. If
@var{path} is empty, the default font path of the server will be
restored.
@end defmethod
@defmethod Display get_font_path ( )
Return the current font path as a list of strings.
@end defmethod
@defmethod Display query_extension ( name )
Ask the server if it supports the extension @var{name}. If it is
supported an object with the following attributes is returned:
@table @code
@item major_opcode
The major opcode that the requests of this extension uses.
@item first_event
The base event code if the extension have additional events, or 0.
@item first_error
The base error code if the extension have additional errors, or 0.
@end table
If the extension is not supported, @code{None} is returned.
@end defmethod
@defmethod Display list_extensions ( )
Return a list of all the extensions provided by the server.
@end defmethod
@defmethod Display change_keyboard_mapping ( first_keycode, keysyms, @w{onerror = None )}
Modify the keyboard mapping, starting with @var{first_keycode}.
@var{keysyms} is a list of tuples of keysyms. @code{keysyms[n][i]} will
be assigned to keycode @code{first_keycode+n} at index @code{i}.
@end defmethod
@defmethod Display get_keyboard_mapping ( first_keycode, count )
Return the current keyboard mapping as a list of tuples, starting at
@var{first_keycount} and no more than @var{count}.
@end defmethod
@defmethod Display change_keyboard_control ( @w{onerror = None,} **keys )
Change the parameters provided as keyword arguments:
@table @code
@item key_click_percent
The volume of key clicks between 0 (off) and 100 (load). -1 will restore
default setting.
@item bell_percent
The base volume of the bell, coded as above.
@item bell_pitch
The pitch of the bell in Hz, -1 restores the default.
@item bell_duration
The duration of the bell in milliseconds, -1 restores the default.
@item led
@itemx led_mode
@code{led_mode} should be @code{X.LedModeOff} or @code{X.LedModeOn}. If
@code{led} is provided, it should be a 32-bit mask listing the LEDs that
should change. If @code{led} is not provided, all LEDs are changed.
@item key
@itemx auto_repeat_mode
@code{auto_repeat_mode} should be one of @code{X.AutoRepeatModeOff},
@code{X.AutoRepeatModeOn}, or @code{X.AutoRepeatModeDefault}. If
@code{key} is provided, that key will be modified, otherwise the global
state for the entire keyboard will be modified.
@end table
@end defmethod
@defmethod Display get_keyboard_control ( )
Return an object with the following attributes:
@table @code
@item global_auto_repeat
@code{X.AutoRepeatModeOn} or @code{X.AutoRepeatModeOff}.
@item auto_repeats
A list of 32 integers. List item N contains the bits for keys 8N to 8N
+ 7 with the least significant bit in the byte representing key 8N. If
a bit is on, autorepeat is enabled for the corresponding key.
@item led_mask
A 32-bit mask indicating which LEDs are on.
@item key_click_percent
The volume of key click, from 0 to 100.
@item bell_percent
@itemx bell_pitch
@itemx bell_duration
The volume, pitch and duration of the bell.
@end table
@end defmethod
@defmethod Display bell ( percent = 0, onerror = None )
Ring the bell at the volume @var{percent} which is relative the base
volume. See XBell(3X11).
@end defmethod
@defmethod Display change_pointer_control ( @w{accel = None,} @w{threshold = None,} @w{onerror = None )}
To change the pointer acceleration, set @var{accel} to a tuple
@code{(num, denum)}. The pointer will then move @code{num/denum} times
the normal speed if it moves beyond the threshold number of pixels at
once. To change the threshold, set it to the number of pixels. -1
restores the default.
@end defmethod
@defmethod Display get_pointer_control ( )
Return an object with the following attributes:
@table @code
@item accel_num
@itemx accel_denom
The acceleration as numerator/denumerator.
@item threshold
The number of pixels the pointer must move before the acceleration kicks
in.
@end table
@end defmethod
@defmethod Display set_screen_saver ( timeout, interval, prefer_blank, allow_exposures, @w{onerror = None )}
See XSetScreenSaver(3X11).
@end defmethod
@defmethod Display get_screen_saver ( )
Return an object with the attributes @code{timeout}, @code{interval},
@code{prefer_blanking}, @code{allow_exposures}. See
XGetScreenSaver(3X11) for details.
@end defmethod
@defmethod Display change_hosts ( mode, host_family, host, @w{onerror = None )}
@var{mode} is either @code{X.HostInsert} or @code{X.HostDelete}.
@var{host_family} is one of @code{X.FamilyInternet},
@code{X.FamilyDECnet}, @code{X.FamilyChaos}, @code{X.FamilyServerInterpreted}
or @code{X.FamilyInternetV6}.
@var{host} is a list of bytes. For the Internet family, it should be
the four bytes of an IPv4 address.
@end defmethod
@defmethod Display list_hosts ( )
Return an object with the following attributes:
@table @code
@item mode
@code{X.EnableAccess} if the access control list is used,
@code{X.DisableAccess} otherwise.
@item hosts
The hosts on the access list. Each entry has the following attributes:
@table @code
@item family
@code{X.FamilyInternet}, @code{X.FamilyDECnet}, @code{X.FamilyChaos},
@code{X.FamilyServerInterpreted} or @code{X.FamilyInternetV6}.
@item name
A list of byte values, the coding depends on @code{family}. For the
Internet family, it is the 4 bytes of an IPv4 address.
@end table
@end table
@end defmethod
@defmethod Display set_access_control ( mode, onerror = None )
Enable use of access control lists at connection setup if @var{mode} is
@code{X.EnableAccess}, disable if it is @code{X.DisableAccess}.
@end defmethod
@defmethod Display set_close_down_mode ( mode, onerror = None )
Control what will happen with the client's resources at connection
close. The default is @code{X.DestroyAll}, the other values are
@code{X.RetainPermanent} and @code{X.RetainTemporary}.
@end defmethod
@defmethod Display force_screen_saver ( mode, onerror = None )
If @var{mode} is @code{X.ScreenSaverActive} the screen saver is
activated. If it is @code{X.ScreenSaverReset}, the screen saver is
deactivated as if device input had been received.
@end defmethod
@defmethod Display set_pointer_mapping ( map )
Set the mapping of the pointer buttons. @var{map} is a list of logical
button numbers. @var{map} must be of the same length as the list
returned by @code{Display.get_pointer_mapping()}.
@code{map[n]} sets the logical number for the physical button
@code{n+1}. Logical number 0 disables the button. Two physical buttons
cannot be mapped to the same logical number.
If one of the buttons to be altered are logically in the down state,
@code{X.MappingBusy} is returned and the mapping is not changed.
Otherwise the mapping is changed and @code{X.MappingSuccess} is returned.
@end defmethod
@defmethod Display get_pointer_mapping ( )
Return a list of the pointer button mappings. Entry N in the list sets
the logical button number for the physical button N+1.
@end defmethod
@defmethod Display set_modifier_mapping ( keycodes )
Set the keycodes for the eight modifiers @code{X.Shift}, @code{X.Lock},
@code{X.Control}, @code{X.Mod1}, @code{X.Mod2}, @code{X.Mod3},
@code{X.Mod4} and @code{X.Mod5}. @var{keycodes} should be a
eight-element list where each entry is a list of the keycodes that
should be bound to that modifier.
If any changed key is logically in the down state, @code{X.MappingBusy}
is returned and the mapping is not changed. If the mapping violates
some server restriction, @code{X.MappingFailed} is returned. Otherwise
the mapping is changed and @code{X.MappingSuccess} is returned.
@end defmethod
@defmethod Display get_modifier_mapping ( )
Return a list of eight lists, one for each modifier. The list can be
indexed using @code{X.ShiftMapIndex}, @code{X.Mod1MapIndex}, and so on.
The sublists list the keycodes bound to that modifier.
@end defmethod
@defmethod Display no_operation ( onerror = None )
Do nothing but send a request to the server.
@end defmethod
@node Resource
@section Resource
All resource objects can be compared and hashed, so they can be used as
mapping indices. They also have this method:
@defmethod Resource kill_client ( onerror = None )
@end defmethod
@node Colormap
@section Colormap
@xref{Resource}, for additional methods on @code{Colormap} objects.
@defmethod Colormap free ( onerror = None )
@end defmethod
@defmethod Colormap copy_colormap_and_free ( scr_cmap )
Returns Colormap.
@end defmethod
@defmethod Colormap install_colormap ( onerror = None )
@end defmethod
@defmethod Colormap uninstall_colormap ( onerror = None )
@end defmethod
@defmethod Colormap alloc_color ( red, green, blue )
@end defmethod
@defmethod Colormap alloc_named_color ( name )
Returns None or Card32('pixel'),
Card16('exact_red'),
Card16('exact_green'),
Card16('exact_blue'),
Card16('screen_red'),
Card16('screen_green'),
Card16('screen_blue'),
@end defmethod
@defmethod Colormap alloc_color_cells ( contiguous, colors, planes )
Returns List('pixels', Card32Obj),
List('masks', Card32Obj),
@end defmethod
@defmethod Colormap alloc_color_planes ( contiguous, colors, red, green, blue )
Returns Card32('red_mask'),
Card32('green_mask'),
Card32('blue_mask'),
List('pixels', Card32Obj),
@end defmethod
@defmethod Colormap free_colors ( pixels, plane_mask, onerror = None )
@end defmethod
@defmethod Colormap store_colors ( items, onerror = None )
@end defmethod
@defmethod Colormap store_named_color ( name, pixel, flags, onerror = None )
@end defmethod
@defmethod Colormap query_colors ( pixels )
Returns List('colors', structs.RGB),
@end defmethod
@defmethod Colormap lookup_color ( name )
Returns Card16('exact_red'),
Card16('exact_green'),
Card16('exact_blue'),
Card16('screen_red'),
Card16('screen_green'),
Card16('screen_blue'),
@end defmethod
@node Cursor
@section Cursor
@xref{Resource}, for additional methods on @code{Cursor} objects.
@defmethod Cursor free ( onerror = None )
@end defmethod
@defmethod Cursor recolor ( (fore_red, fore_green, fore_blue), (back_red, back_green, back_blue), onerror = None )
@end defmethod
@node Drawable
@section Drawable
@code{Drawable} is a base class of @code{Window} and @code{Pixmap}
objects. @xref{Window}, and @ref{Pixmap}.
@xref{Resource}, for additional methods.
@defmethod Drawable get_geometry ( )
Returns
Window('root'),
Int16('x'),
Int16('y'),
Card16('width'),
Card16('height'),
Card16('border_width'),
@end defmethod
@defmethod Drawable create_pixmap ( width, height, depth )
Returns Pixmap.
@end defmethod
@defmethod Drawable create_gc ( **keys )
Returns GC.
@end defmethod
@defmethod Drawable copy_area ( gc, src_drawable, src_x, src_y, width, height, dst_x, dst_y, onerror = None )
@end defmethod
@defmethod Drawable copy_plane ( gc, src_drawable, src_x, src_y, width, height, dst_x, dst_y, bit_plane, onerror = None )
@end defmethod
@defmethod Drawable poly_point ( gc, coord_mode, points, onerror = None )
@end defmethod
request.PolyPoint(display = self.display,
onerror = onerror,
coord_mode = coord_mode,
drawable = self.id,
gc = gc,
points = points)
@defmethod Drawable point ( gc, x, y, onerror = None )
@end defmethod
@defmethod Drawable poly_line ( gc, coord_mode, points, onerror = None )
@end defmethod
@defmethod Drawable line ( gc, x1, y1, x2, y2, onerror = None )
@end defmethod
@defmethod Drawable poly_segment ( gc, segments, onerror = None )
@end defmethod
@defmethod Drawable poly_rectangle ( gc, rectangles, onerror = None )
@end defmethod
@defmethod Drawable rectangle ( gc, x, y, width, height, onerror = None )
@end defmethod
@defmethod Drawable poly_arc ( gc, arcs, onerror = None )
@end defmethod
@defmethod Drawable arc ( gc, x, y, width, height, angle1, angle2, onerror = None )
@end defmethod
@defmethod Drawable fill_poly ( gc, shape, coord_mode, points, onerror = None )
@end defmethod
@defmethod Drawable poly_fill_rectangle ( gc, rectangles, onerror = None )
@end defmethod
@defmethod Drawable fill_rectangle ( gc, x, y, width, height, onerror = None )
@end defmethod
@defmethod Drawable poly_fill_arc ( gc, arcs, onerror = None )
@end defmethod
@defmethod Drawable fill_arc ( gc, x, y, width, height, angle1, angle2, onerror = None )
@end defmethod
@defmethod Drawable put_image ( )
Not implemented yet.
@end defmethod
@defmethod Drawable get_image ( )
Not implemented yet.
@end defmethod
@defmethod Drawable draw_text ( gc, x, y, text, onerror = None )
@end defmethod
@defmethod Drawable poly_text ( gc, x, y, items, onerror = None )
@end defmethod
@defmethod Drawable poly_text_16 ( gc, x, y, items, onerror = None )
@end defmethod
@defmethod Drawable image_text ( gc, x, y, string, onerror = None )
@end defmethod
@defmethod Drawable image_text_16 ( gc, x, y, string, onerror = None )
@end defmethod
@defmethod Drawable query_best_size ( item_class, width, height )
Returns
Card16('width'),
Card16('height'),
@end defmethod
@node Window
@section Window
@code{Window} objects have additional objects, see @ref{Resource} and @ref{Drawable}.
@defmethod Window create_window ( x, y, width, height, border_width, depth, window_class = X.CopyFromParent, visual = X.CopyFromParent, **keys )