| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Display information retrieval methods:
Returns the name used to connect to the server, either provided when
creating the Display object, or fetched from the environmental
variable $DISPLAY.
Returns the file descriptor number of the underlying socket. This
method is provided to allow Display objects to be passed
select.select().
Close the display, freeing the resources that it holds.
Set the default error handler which will be called for all unhandled errors. handler should take two arguments as a normal request error handler, but the second argument (the request) will be None.
See section Error Handling.
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.
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.
Return the next event. If there are no events queued, it will block until the next event is fetched from the server.
Return the number of events queued, i.e. the number of times that
Display.next_event() can be called without blocking.
Check if both the server and the client library support the X extension named extension.
Create a resource object of type for the integer id. type should be one of the following strings:
resourcedrawablewindowpixmapfontablefontgccolormapcursorThis 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.
Return the information about screen number sno, or the default
screen if sno is None.
The return object has the following attributes:
rootThe screen root window.
default_colormapThe default colormap for the root window and its children.
white_pixelblack_pixelThe pixel values for white and black, respectively, in the default colormap.
current_input_maskThe event mask of the root window at the time the connection was set up.
width_in_pixelsheight_in_pixelsThe size of the root window in pixels, i.e. the size of the entire screen.
width_in_mmsheight_in_mmsThe physical size of the screen, in millimeters.
min_installed_mapsmax_installed_mapsThe minimum and maximum number of colormaps that can be installed at the same time.
root_visualThe visual type of the root window.
backing_storeWhether the screen supports backing store, one of the values
X.WhenMapped, X.NotUseful, or X.Always.
save_undersTrue if the screen supports save unders.
root_depthThe depth of the root window.
allowed_depthsA list of the pixmap and windows depths that this screen supports. The list items have the following attributes:
depthThis depth is supported by the screen.
visualsA 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:
visual_idThe ID of this visual.
visual_classOne of X.StaticGray, X.StaticColor, X.TrueColor,
X.GrayScale, X.PseudoColor, or X.DirectColor.
bits_per_rgb_valueThe number of bits used to represent an entire RGB-value, allowing a
total of 2^bits_per_rgb_value distinct colors.
colormap_entriesThe number of free entries in a newly created colormap.
red_maskblue_maskgreen_maskBitmasks selecting the three color components from the entire RGB value.
Return the total number of screens on the display.
Return the number of the default screen, extracted from the display name.
Convert a keycode to a keysym, looking in entry 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, X.NoSymbol is
returned.
Look up the primary keycode that is bound to keysym. If several keycodes are found, the one with the lowest index and lowest code is returned. If keysym is not bound to any key, 0 is returned.
Look up all the keycodes that is bound to keysym. A list of
tuples (keycode, index) is returned, sorted primarily on the
lowest index and secondarily on the lowest keycode.
This method should be called once when a MappingNotify event is
received, to update the keymap cache. evt should be the event
object.
Attempt to convert keysym into a single character or a string. If
no translation is found, None is returned.
Set the string representation of keysym to newstring, so
that it will be returned by Display.lookup_string().
X requests methods:
Intern the string name, returning its atom number. If
only_if_exists is true and the atom does not already exist,
it will not be created and X.NONE is returned.
Look up the name of atom, returning it as a string. Will raise
BadAtom if atom does not exist.
Return the window that owns selection (an atom), or X.NONE
if there is no owner for the selection. Can raise BadAtom.
Send a synthetic event to the window destination which can be a
window object, or X.PointerWindow or X.InputFocus.
event is the event object to send, instantiated from one of the
classes in protocol.events. See XSendEvent(3X11) for details.
There is also a Window.send_event() method.
Release a grabbed pointer and any queued events. See XUngrabPointer(3X11).
Change the dynamic parameters of a pointer grab. See XChangeActivePointerGrab(3X11).
Ungrab a grabbed keyboard and any queued events. See XUngrabKeyboard(3X11).
Release some queued events. mode should be one of
X.AsyncPointer, X.SyncPointer, X.AsyncKeyboard,
X.SyncKeyboard, X.ReplayPointer, X.ReplayKeyboard,
X.AsyncBoth, or X.SyncBoth. time should be a
timestamp or X.CurrentTime.
Disable processing of requests on all other client connections until the server is ungrabbed. Server grabbing should be avoided as much as possible.
Release the server if it was previously grabbed by this client.
Move the pointer relative its current position by the offsets (x, y). However, if src_window is a window the pointer is only moved if the specified rectangle in src_window contains it. If src_width is 0 it will be replaced with the width of src_window - src_x. src_height is treated in a similar way.
To move the pointer to absolute coordinates, use
Window.warp_pointer().
Set input focus to focus, which should be a window,
X.PointerRoot or X.NONE. revert_to specifies where
the focus reverts to if the focused window becomes not visible, and
should be X.RevertToParent, RevertToPointerRoot, or
RevertToNone. See XSetInputFocus(3X11) for details.
There is also a Window.set_input_focus().
Return an object with the following attributes:
focusThe window which currently holds the input focus, X.NONE or
X.PointerRoot.
revert_toWhere the focus will revert, one of X.RevertToParent,
RevertToPointerRoot, or RevertToNone.
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.
Open the font identifed by the pattern name and return its font
object. If name does not match any font, None is returned.
Return a list of font names matching pattern. No more than max_names will be returned.
Return a list of fonts matching pattern. No more than max_names will be returned. Each list item represents one font and has the following properties:
nameThe name of the font.
min_boundsmax_boundsmin_char_or_byte2max_char_or_byte2default_chardraw_directionmin_byte1max_byte1all_chars_existfont_ascentfont_descentreplies_hintSee the description of XFontStruct in XGetFontProperty(3X11) for details on these values.
propertiesA list of properties. Each entry has two attributes:
nameThe atom identifying this property.
valueA 32-bit unsigned value.
Set the font path to path, which should be a list of strings. If path is empty, the default font path of the server will be restored.
Return the current font path as a list of strings.
Ask the server if it supports the extension name. If it is supported an object with the following attributes is returned:
major_opcodeThe major opcode that the requests of this extension uses.
first_eventThe base event code if the extension have additional events, or 0.
first_errorThe base error code if the extension have additional errors, or 0.
If the extension is not supported, None is returned.
Return a list of all the extensions provided by the server.
Modify the keyboard mapping, starting with first_keycode.
keysyms is a list of tuples of keysyms. keysyms[n][i] will
be assigned to keycode first_keycode+n at index i.
Return the current keyboard mapping as a list of tuples, starting at first_keycount and no more than count.
Change the parameters provided as keyword arguments:
key_click_percentThe volume of key clicks between 0 (off) and 100 (load). -1 will restore default setting.
bell_percentThe base volume of the bell, coded as above.
bell_pitchThe pitch of the bell in Hz, -1 restores the default.
bell_durationThe duration of the bell in milliseconds, -1 restores the default.
ledled_modeled_mode should be X.LedModeOff or X.LedModeOn. If
led is provided, it should be a 32-bit mask listing the LEDs that
should change. If led is not provided, all LEDs are changed.
keyauto_repeat_modeauto_repeat_mode should be one of X.AutoRepeatModeOff,
X.AutoRepeatModeOn, or X.AutoRepeatModeDefault. If
key is provided, that key will be modified, otherwise the global
state for the entire keyboard will be modified.
Return an object with the following attributes:
global_auto_repeatX.AutoRepeatModeOn or X.AutoRepeatModeOff.
auto_repeatsA 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.
led_maskA 32-bit mask indicating which LEDs are on.
key_click_percentThe volume of key click, from 0 to 100.
bell_percentbell_pitchbell_durationThe volume, pitch and duration of the bell.
Ring the bell at the volume percent which is relative the base volume. See XBell(3X11).
To change the pointer acceleration, set accel to a tuple
(num, denum). The pointer will then move 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.
Return an object with the following attributes:
accel_numaccel_denomThe acceleration as numerator/denumerator.
thresholdThe number of pixels the pointer must move before the acceleration kicks in.
See XSetScreenSaver(3X11).
Return an object with the attributes timeout, interval,
prefer_blanking, allow_exposures. See
XGetScreenSaver(3X11) for details.
mode is either X.HostInsert or X.HostDelete.
host_family is one of X.FamilyInternet,
X.FamilyDECnet or X.FamilyChaos.
host is a list of bytes. For the Internet family, it should be the four bytes of an IPv4 address.
Return an object with the following attributes:
modeX.EnableAccess if the access control list is used,
X.DisableAccess otherwise.
hostsThe hosts on the access list. Each entry has the following attributes:
familyX.FamilyInternet, X.FamilyDECnet, or X.FamilyChaos.
nameA list of byte values, the coding depends on family. For the
Internet family, it is the 4 bytes of an IPv4 address.
Enable use of access control lists at connection setup if mode is
X.EnableAccess, disable if it is X.DisableAccess.
Control what will happen with the client’s resources at connection
close. The default is X.DestroyAll, the other values are
X.RetainPermanent and X.RetainTemporary.
If mode is X.ScreenSaverActive the screen saver is
activated. If it is X.ScreenSaverReset, the screen saver is
deactivated as if device input had been received.
Set the mapping of the pointer buttons. map is a list of logical
button numbers. map must be of the same length as the list
returned by Display.get_pointer_mapping().
map[n] sets the logical number for the physical button
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,
X.MappingBusy is returned and the mapping is not changed.
Otherwise the mapping is changed and X.MappingSuccess is returned.
Return a list of the pointer button mappings. Entry N in the list sets the logical button number for the physical button N+1.
Set the keycodes for the eight modifiers X.Shift, X.Lock,
X.Control, X.Mod1, X.Mod2, X.Mod3,
X.Mod4 and X.Mod5. 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, X.MappingBusy
is returned and the mapping is not changed. If the mapping violates
some server restriction, X.MappingFailed is returned. Otherwise
the mapping is changed and X.MappingSuccess is returned.
Return a list of eight lists, one for each modifier. The list can be
indexed using X.ShiftMapIndex, X.Mod1MapIndex, and so on.
The sublists list the keycodes bound to that modifier.
Do nothing but send a request to the server.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on September 16, 2020 using texi2html 5.0.