Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 9d2e976f12e8ff1c53133a0ee8246441 > files > 18

python-xlib-doc-0.15-6.mga4.noarch.rpm

<HTML>
<HEAD>
<!-- Created by texi2html 1.56k from ../src/python-xlib.texi on 22 October 2013 -->

<TITLE>The Python X Library - Display</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="python-xlib_1.html">first</A>, <A HREF="python-xlib_15.html">previous</A>, <A HREF="python-xlib_17.html">next</A>, <A HREF="python-xlib_25.html">last</A> section, <A HREF="python-xlib_toc.html">table of contents</A>.
<P><HR><P>


<H2><A NAME="SEC15" HREF="python-xlib_toc.html#TOC15">Display</A></H2>

<P>
Display information retrieval methods:


<P>
<DL>
<DT><U>Method:</U> Display <B>get_display_name</B> <I>( )</I>
<DD><A NAME="IDX175"></A>


<P>
Returns the name used to connect to the server, either provided when
creating the <CODE>Display</CODE> object, or fetched from the environmental
variable <CODE>$DISPLAY</CODE>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>fileno</B> <I>( )</I>
<DD><A NAME="IDX176"></A>


<P>
Returns the file descriptor number of the underlying socket.  This
method is provided to allow <CODE>Display</CODE> objects to be passed
<CODE>select.select()</CODE>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>close</B> <I>( )</I>
<DD><A NAME="IDX177"></A>


<P>
Close the display, freeing the resources that it holds.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>set_error_handler</B> <I>( handler )</I>
<DD><A NAME="IDX178"></A>


<P>
Set the default error handler which will be called for all unhandled
errors.  <VAR>handler</VAR> should take two arguments as a normal request
error handler, but the second argument (the request) will be None.


<P>
See section <A HREF="python-xlib_7.html#SEC6">Error Handling</A>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>flush</B> <I>( )</I>
<DD><A NAME="IDX179"></A>


<P>
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.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>sync</B> <I>( )</I>
<DD><A NAME="IDX180"></A>


<P>
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.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>next_event</B> <I>( )</I>
<DD><A NAME="IDX181"></A>


<P>
Return the next event.  If there are no events queued, it will block
until the next event is fetched from the server.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>pending_events</B> <I>( )</I>
<DD><A NAME="IDX182"></A>


<P>
Return the number of events queued, i.e. the number of times that
<CODE>Display.next_event()</CODE> can be called without blocking.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>has_extension</B> <I>( extension )</I>
<DD><A NAME="IDX183"></A>


<P>
Check if both the server and the client library support the X extension
named <VAR>extension</VAR>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>create_resource_object</B> <I>( type, id )</I>
<DD><A NAME="IDX184"></A>


<P>
Create a resource object of <VAR>type</VAR> for the integer <VAR>id</VAR>.
<VAR>type</VAR> should be one of the following strings:


<DL COMPACT>

<DT><CODE>resource</CODE>
<DD>
<DT><CODE>drawable</CODE>
<DD>
<DT><CODE>window</CODE>
<DD>
<DT><CODE>pixmap</CODE>
<DD>
<DT><CODE>fontable</CODE>
<DD>
<DT><CODE>font</CODE>
<DD>
<DT><CODE>gc</CODE>
<DD>
<DT><CODE>colormap</CODE>
<DD>
<DT><CODE>cursor</CODE>
<DD>
</DL>

<P>
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.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>screen</B> <I>( sno = None )</I>
<DD><A NAME="IDX185"></A>


<P>
Return the information about screen number <VAR>sno</VAR>, or the default
screen if <VAR>sno</VAR> is <CODE>None</CODE>.


<P>
The return object has the following attributes:


<DL COMPACT>

<DT><CODE>root</CODE>
<DD>
The screen root window.

<DT><CODE>default_colormap</CODE>
<DD>
The default colormap for the root window and its children.

<DT><CODE>white_pixel</CODE>
<DD>
<DT><CODE>black_pixel</CODE>
<DD>
The pixel values for white and black, respectively, in the default
colormap.

<DT><CODE>current_input_mask</CODE>
<DD>
The event mask of the root window at the time the connection was set up.

<DT><CODE>width_in_pixels</CODE>
<DD>
<DT><CODE>height_in_pixels</CODE>
<DD>
The size of the root window in pixels, i.e. the size of the entire screen.

<DT><CODE>width_in_mms</CODE>
<DD>
<DT><CODE>height_in_mms</CODE>
<DD>
The physical size of the screen, in millimeters.

<DT><CODE>min_installed_maps</CODE>
<DD>
<DT><CODE>max_installed_maps</CODE>
<DD>
The minimum and maximum number of colormaps that can be installed at the
same time.

<DT><CODE>root_visual</CODE>
<DD>
The visual type of the root window.

<DT><CODE>backing_store</CODE>
<DD>
Whether the screen supports backing store, one of the values
<CODE>X.WhenMapped</CODE>, <CODE>X.NotUseful</CODE>, or <CODE>X.Always</CODE>.

<DT><CODE>save_unders</CODE>
<DD>
True if the screen supports save unders.

<DT><CODE>root_depth</CODE>
<DD>
The depth of the root window.

<DT><CODE>allowed_depths</CODE>
<DD>
A list of the pixmap and windows depths that this screen supports.  The
list items have the following attributes:

<DL COMPACT>

<DT><CODE>depth</CODE>
<DD>
This depth is supported by the screen.

<DT><CODE>visuals</CODE>
<DD>
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:

<DL COMPACT>

<DT><CODE>visual_id</CODE>
<DD>
The ID of this visual.

<DT><CODE>visual_class</CODE>
<DD>
One of <CODE>X.StaticGrey</CODE>, <CODE>X.StaticColor</CODE>, <CODE>X.TrueColor</CODE>,
<CODE>X.GrayScale</CODE>, <CODE>X.PseudoColor</CODE>, or <CODE>X.DirectColor</CODE>.

<DT><CODE>bits_per_rgb_value</CODE>
<DD>
The number of bits used to represent an entire RGB-value, allowing a
total of <CODE>2^bits_per_rgb_value</CODE> distinct colors.

<DT><CODE>colormap_entries</CODE>
<DD>
The number of free entries in a newly created colormap.

<DT><CODE>red_mask</CODE>
<DD>
<DT><CODE>blue_mask</CODE>
<DD>
<DT><CODE>green_mask</CODE>
<DD>
Bitmasks selecting the three color components from the entire RGB value.

</DL>

</DL>

</DL>

</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>screen_count</B> <I>( )</I>
<DD><A NAME="IDX186"></A>


<P>
Return the total number of screens on the display.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_default_screen</B> <I>( )</I>
<DD><A NAME="IDX187"></A>


<P>
Return the number of the default screen, extracted from the display
name.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>keycode_to_keysym</B> <I>( keycode, index )</I>
<DD><A NAME="IDX188"></A>


<P>
Convert a <VAR>keycode</VAR> to a keysym, looking in entry <VAR>index</VAR>.
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</CODE> is
returned.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>keysym_to_keycode</B> <I>( keysym )</I>
<DD><A NAME="IDX189"></A>


<P>
Look up the primary keycode that is bound to <VAR>keysym</VAR>.  If several
keycodes are found, the one with the lowest index and lowest code is
returned.  If <VAR>keysym</VAR> is not bound to any key, 0 is returned.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>keysym_to_keycodes</B> <I>( keysym )</I>
<DD><A NAME="IDX190"></A>


<P>
Look up all the keycodes that is bound to <CODE>keysym</CODE>.  A list of
tuples <CODE>(keycode, index)</CODE> is returned, sorted primarily on the
lowest index and secondarily on the lowest keycode.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>refresh_keyboard_mapping</B> <I>( evt )</I>
<DD><A NAME="IDX191"></A>


<P>
This method should be called once when a <CODE>MappingNotify</CODE> event is
received, to update the keymap cache.  <VAR>evt</VAR> should be the event
object.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>lookup_string</B> <I>( keysym )</I>
<DD><A NAME="IDX192"></A>


<P>
Attempt to convert <VAR>keysym</VAR> into a single character or a string.  If
no translation is found, <CODE>None</CODE> is returned.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>rebind_string</B> <I>( keysym, newstring )</I>
<DD><A NAME="IDX193"></A>


<P>
Set the string representation of <CODE>keysym</CODE> to <CODE>newstring</CODE>, so
that it will be returned by <CODE>Display.lookup_string()</CODE>.


</DL>

<P>
X requests methods:


<P>
<DL>
<DT><U>Method:</U> Display <B>intern_atom</B> <I>( name, only_if_exists = 0 )</I>
<DD><A NAME="IDX194"></A>


<P>
Intern the string <VAR>name</VAR>, returning its atom number.  If
<VAR>only_if_exists</VAR> is true and the atom does not already exist,
it will not be created and <CODE>X.NONE</CODE> is returned.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_atom_name</B> <I>( atom )</I>
<DD><A NAME="IDX195"></A>


<P>
Look up the name of <VAR>atom</VAR>, returning it as a string.  Will raise
<CODE>BadAtom</CODE> if <VAR>atom</VAR> does not exist.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_selection_owner</B> <I>( selection )</I>
<DD><A NAME="IDX196"></A>


<P>
Return the window that owns <VAR>selection</VAR> (an atom), or <CODE>X.NONE</CODE>
if there is no owner for the selection.  Can raise <CODE>BadAtom</CODE>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>send_event</B> <I>( destination, event, event_mask = 0, propagate = 0, onerror = None )</I>
<DD><A NAME="IDX197"></A>


<P>
Send a synthetic event to the window <CODE>destination</CODE> which can be a
window object, or <CODE>X.PointerWindow</CODE> or <CODE>X.InputFocus</CODE>.
<CODE>event</CODE> is the event object to send, instantiated from one of the
classes in <CODE>protocol.events</CODE>.  See XSendEvent(3X11) for details.


<P>
There is also a <CODE>Window.send_event()</CODE> method.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>ungrab_pointer</B> <I>( time, onerror = None )</I>
<DD><A NAME="IDX198"></A>


<P>
Release a grabbed pointer and any queued events.  See
XUngrabPointer(3X11).


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>change_active_pointer_grab</B> <I>( event_mask, cursor, time, onerror = None )</I>
<DD><A NAME="IDX199"></A>


<P>
Change the dynamic parameters of a pointer grab.  See
XChangeActivePointerGrab(3X11).


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>ungrab_keyboard</B> <I>( time, onerror = None )</I>
<DD><A NAME="IDX200"></A>


<P>
Ungrab a grabbed keyboard and any queued events.  See
XUngrabKeyboard(3X11).


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>allow_events</B> <I>( mode, time, onerror = None )</I>
<DD><A NAME="IDX201"></A>


<P>
Release some queued events.  <VAR>mode</VAR> should be one of
<CODE>X.AsyncPointer</CODE>, <CODE>X.SyncPointer</CODE>, <CODE>X.AsyncKeyboard</CODE>,
<CODE>X.SyncKeyboard</CODE>, <CODE>X.ReplayPointer</CODE>, <CODE>X.ReplayKeyboard</CODE>,
<CODE>X.AsyncBoth</CODE>, or <CODE>X.SyncBoth</CODE>.  <VAR>time</VAR> should be a
timestamp or <CODE>X.CurrentTime</CODE>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>grab_server</B> <I>( onerror = None )</I>
<DD><A NAME="IDX202"></A>


<P>
Disable processing of requests on all other client connections until the
server is ungrabbed.  Server grabbing should be avoided as much as
possible.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>ungrab_server</B> <I>( onerror = None )</I>
<DD><A NAME="IDX203"></A>


<P>
Release the server if it was previously grabbed by this client.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>warp_pointer</B> <I>( x, y, src_window = X.NONE, src_x = 0, src_y = 0, src_width = 0, src_height = 0, onerror = None )</I>
<DD><A NAME="IDX204"></A>


<P>
Move the pointer relative its current position by the offsets
(<VAR>x</VAR>, <VAR>y</VAR>).  However, if <VAR>src_window</VAR> is a window the
pointer is only moved if the specified rectangle in <VAR>src_window</VAR>
contains it.  If <VAR>src_width</VAR> is 0 it will be replaced with the width
of <VAR>src_window</VAR> - <VAR>src_x</VAR>.  <VAR>src_height</VAR> is treated in a
similar way.


<P>
To move the pointer to absolute coordinates, use
<CODE>Window.warp_pointer()</CODE>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>set_input_focus</B> <I>( focus, revert_to, time, onerror = None )</I>
<DD><A NAME="IDX205"></A>


<P>
Set input focus to <VAR>focus</VAR>, which should be a window,
<CODE>X.PointerRoot</CODE> or <CODE>X.NONE</CODE>.  <VAR>revert_to</VAR> specifies where
the focus reverts to if the focused window becomes not visible, and
should be <CODE>X.RevertToParent</CODE>, <CODE>RevertToPointerRoot</CODE>, or
<CODE>RevertToNone</CODE>.  See XSetInputFocus(3X11) for details.


<P>
There is also a <CODE>Window.set_input_focus()</CODE>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_input_focus</B> <I>( )</I>
<DD><A NAME="IDX206"></A>


<P>
Return an object with the following attributes:


<DL COMPACT>

<DT><CODE>focus</CODE>
<DD>
The window which currently holds the input focus, <CODE>X.NONE</CODE> or
<CODE>X.PointerRoot</CODE>. 

<DT><CODE>revert_to</CODE>
<DD>
Where the focus will revert, one of <CODE>X.RevertToParent</CODE>,
<CODE>RevertToPointerRoot</CODE>, or <CODE>RevertToNone</CODE>.

</DL>

</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>query_keymap</B> <I>( )</I>
<DD><A NAME="IDX207"></A>


<P>
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.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>open_font</B> <I>( name )</I>
<DD><A NAME="IDX208"></A>


<P>
Open the font identifed by the pattern <VAR>name</VAR> and return its font
object.  If <VAR>name</VAR> does not match any font, <CODE>None</CODE> is returned.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>list_fonts</B> <I>( pattern, max_names )</I>
<DD><A NAME="IDX209"></A>


<P>
Return a list of font names matching <VAR>pattern</VAR>.  No more than
<VAR>max_names</VAR> will be returned.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>list_fonts_with_info</B> <I>( pattern, max_names )</I>
<DD><A NAME="IDX210"></A>


<P>
Return a list of fonts matching <VAR>pattern</VAR>.  No more than
<VAR>max_names</VAR> will be returned.  Each list item represents one font
and has the following properties:


<DL COMPACT>

<DT><CODE>name</CODE>
<DD>
The name of the font.

<DT><CODE>min_bounds</CODE>
<DD>
<DT><CODE>max_bounds</CODE>
<DD>
<DT><CODE>min_char_or_byte2</CODE>
<DD>
<DT><CODE>max_char_or_byte2</CODE>
<DD>
<DT><CODE>default_char</CODE>
<DD>
<DT><CODE>draw_direction</CODE>
<DD>
<DT><CODE>min_byte1</CODE>
<DD>
<DT><CODE>max_byte1</CODE>
<DD>
<DT><CODE>all_chars_exist</CODE>
<DD>
<DT><CODE>font_ascent</CODE>
<DD>
<DT><CODE>font_descent</CODE>
<DD>
<DT><CODE>replies_hint</CODE>
<DD>
See the descripton of XFontStruct in XGetFontProperty(3X11) for details
on these values.

<DT><CODE>properties</CODE>
<DD>
A list of properties.  Each entry has two attributes:

<DL COMPACT>

<DT><CODE>name</CODE>
<DD>
The atom identifying this property.

<DT><CODE>value</CODE>
<DD>
A 32-bit unsigned value.

</DL>

</DL>

</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>set_font_path</B> <I>( path, onerror = None )</I>
<DD><A NAME="IDX211"></A>


<P>
Set the font path to <VAR>path</VAR>, which should be a list of strings.  If
<VAR>path</VAR> is empty, the default font path of the server will be
restored.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_font_path</B> <I>( )</I>
<DD><A NAME="IDX212"></A>


<P>
Return the current font path as a list of strings.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>query_extension</B> <I>( name )</I>
<DD><A NAME="IDX213"></A>


<P>
Ask the server if it supports the extension <VAR>name</VAR>.  If it is
supported an object with the following attributes is returned:


<DL COMPACT>

<DT><CODE>major_opcode</CODE>
<DD>
The major opcode that the requests of this extension uses.

<DT><CODE>first_event</CODE>
<DD>
The base event code if the extension have additional events, or 0.

<DT><CODE>first_error</CODE>
<DD>
The base error code if the extension have additional errors, or 0.

</DL>

<P>
If the extension is not supported, <CODE>None</CODE> is returned.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>list_extensions</B> <I>( )</I>
<DD><A NAME="IDX214"></A>


<P>
Return a list of all the extensions provided by the server.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>change_keyboard_mapping</B> <I>( first_keycode, keysyms, onerror = None )</I>
<DD><A NAME="IDX215"></A>


<P>
Modify the keyboard mapping, starting with <VAR>first_keycode</VAR>.
<VAR>keysyms</VAR> is a list of tuples of keysyms.  <CODE>keysyms[n][i]</CODE> will
be assigned to keycode <CODE>first_keycode+n</CODE> at index <CODE>i</CODE>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_keyboard_mapping</B> <I>( first_keycode, count )</I>
<DD><A NAME="IDX216"></A>


<P>
Return the current keyboard mapping as a list of tuples, starting at
<VAR>first_keycount</VAR> and no more than <VAR>count</VAR>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>change_keyboard_control</B> <I>( onerror = None, **keys )</I>
<DD><A NAME="IDX217"></A>


<P>
Change the parameters provided as keyword arguments:


<DL COMPACT>

<DT><CODE>key_click_percent</CODE>
<DD>
The volume of key clicks between 0 (off) and 100 (load).  -1 will restore
default setting.

<DT><CODE>bell_percent</CODE>
<DD>
The base volume of the bell, coded as above.

<DT><CODE>bell_pitch</CODE>
<DD>
The pitch of the bell in Hz, -1 restores the default.

<DT><CODE>bell_duration</CODE>
<DD>
The duration of the bell in milliseconds, -1 restores the default.

<DT><CODE>led</CODE>
<DD>
<DT><CODE>led_mode</CODE>
<DD>
<CODE>led_mode</CODE> should be <CODE>X.LedModeOff</CODE> or <CODE>X.LedModeOn</CODE>.  If
<CODE>led</CODE> is provided, it should be a 32-bit mask listing the LEDs that
should change.  If <CODE>led</CODE> is not provided, all LEDs are changed.

<DT><CODE>key</CODE>
<DD>
<DT><CODE>auto_repeat_mode</CODE>
<DD>
<CODE>auto_repeat_mode</CODE> should be one of <CODE>X.AutoRepeatModeOff</CODE>,
<CODE>X.AutoRepeatModeOn</CODE>, or <CODE>X.AutoRepeatModeDefault</CODE>.  If
<CODE>key</CODE> is provided, that key will be modified, otherwise the global
state for the entire keyboard will be modified.

</DL>

</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_keyboard_control</B> <I>( )</I>
<DD><A NAME="IDX218"></A>


<P>
Return an object with the following attributes:


<DL COMPACT>

<DT><CODE>global_auto_repeat</CODE>
<DD>
<CODE>X.AutoRepeatModeOn</CODE> or <CODE>X.AutoRepeatModeOff</CODE>.

<DT><CODE>auto_repeats</CODE>
<DD>
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.

<DT><CODE>led_mask</CODE>
<DD>
A 32-bit mask indicating which LEDs are on.

<DT><CODE>key_click_percent</CODE>
<DD>
The volume of key click, from 0 to 100.

<DT><CODE>bell_percent</CODE>
<DD>
<DT><CODE>bell_pitch</CODE>
<DD>
<DT><CODE>bell_duration</CODE>
<DD>
The volume, pitch and duration of the bell.

</DL>

</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>bell</B> <I>( percent = 0, onerror = None )</I>
<DD><A NAME="IDX219"></A>


<P>
Ring the bell at the volume <VAR>percent</VAR> which is relative the base
volume.  See XBell(3X11).


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>change_pointer_control</B> <I>( accel = None, threshold = None, onerror = None )</I>
<DD><A NAME="IDX220"></A>


<P>
To change the pointer acceleration, set <VAR>accel</VAR> to a tuple
<CODE>(num, denum)</CODE>.  The pointer will then move <CODE>num/denum</CODE> 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.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_pointer_control</B> <I>( )</I>
<DD><A NAME="IDX221"></A>


<P>
Return an object with the following attributes:


<DL COMPACT>

<DT><CODE>accel_num</CODE>
<DD>
<DT><CODE>accel_denom</CODE>
<DD>
The acceleration as numerator/denumerator.

<DT><CODE>threshold</CODE>
<DD>
The number of pixels the pointer must move before the acceleration kicks
in.

</DL>

</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>set_screen_saver</B> <I>( timeout, interval, prefer_blank, allow_exposures, onerror = None )</I>
<DD><A NAME="IDX222"></A>


<P>
See XSetScreenSaver(3X11).


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_screen_saver</B> <I>( )</I>
<DD><A NAME="IDX223"></A>


<P>
Return an object with the attributes <CODE>timeout</CODE>, <CODE>interval</CODE>,
<CODE>prefer_blanking</CODE>, <CODE>allow_exposures</CODE>.  See
XGetScreenSaver(3X11) for details.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>change_hosts</B> <I>( mode, host_family, host, onerror = None )</I>
<DD><A NAME="IDX224"></A>


<P>
<VAR>mode</VAR> is either <CODE>X.HostInsert</CODE> or <CODE>X.HostDelete</CODE>.
<VAR>host_family</VAR> is one of <CODE>X.FamilyInternet</CODE>,
<CODE>X.FamilyDECnet</CODE> or <CODE>X.FamilyChaos</CODE>.


<P>
<VAR>host</VAR> is a list of bytes.  For the Internet family, it should be
the four bytes of an IPv4 address.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>list_hosts</B> <I>( )</I>
<DD><A NAME="IDX225"></A>


<P>
Return an object with the following attributes:


<DL COMPACT>

<DT><CODE>mode</CODE>
<DD>
<CODE>X.EnableAccess</CODE> if the access control list is used,
<CODE>X.DisableAccess</CODE> otherwise.

<DT><CODE>hosts</CODE>
<DD>
The hosts on the access list.  Each entry has the following attributes:

<DL COMPACT>

<DT><CODE>family</CODE>
<DD>
<CODE>X.FamilyInternet</CODE>, <CODE>X.FamilyDECnet</CODE>, or <CODE>X.FamilyChaos</CODE>.

<DT><CODE>name</CODE>
<DD>
A list of byte values, the coding depends on <CODE>family</CODE>.  For the
Internet family, it is the 4 bytes of an IPv4 address. 

</DL>

</DL>

</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>set_access_control</B> <I>( mode, onerror = None )</I>
<DD><A NAME="IDX226"></A>


<P>
Enable use of access control lists at connection setup if <VAR>mode</VAR> is
<CODE>X.EnableAccess</CODE>, disable if it is <CODE>X.DisableAccess</CODE>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>set_close_down_mode</B> <I>( mode, onerror = None )</I>
<DD><A NAME="IDX227"></A>


<P>
Control what will happen with the client's resources at connection
close.  The default is <CODE>X.DestroyAll</CODE>, the other values are
<CODE>X.RetainPermanent</CODE> and <CODE>X.RetainTemporary</CODE>.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>force_screen_saver</B> <I>( mode, onerror = None )</I>
<DD><A NAME="IDX228"></A>


<P>
If <VAR>mode</VAR> is <CODE>X.ScreenSaverActive</CODE> the screen saver is
activated.  If it is <CODE>X.ScreenSaverReset</CODE>, the screen saver is
deactivated as if device input had been received.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>set_pointer_mapping</B> <I>( map )</I>
<DD><A NAME="IDX229"></A>


<P>
Set the mapping of the pointer buttons.  <VAR>map</VAR> is a list of logical
button numbers.  <VAR>map</VAR> must be of the same length as the list
returned by <CODE>Display.get_pointer_mapping()</CODE>.


<P>
<CODE>map[n]</CODE> sets the logical number for the physical button
<CODE>n+1</CODE>.  Logical number 0 disables the button.  Two physical buttons
cannot be mapped to the same logical number.


<P>
If one of the buttons to be altered are logically in the down state,
<CODE>X.MappingBusy</CODE> is returned and the mapping is not changed.
Otherwise the mapping is changed and <CODE>X.MappingSuccess</CODE> is returned.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_pointer_mapping</B> <I>( )</I>
<DD><A NAME="IDX230"></A>


<P>
Return a list of the pointer button mappings.  Entry N in the list sets
the logical button number for the physical button N+1.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>set_modifier_mapping</B> <I>( keycodes )</I>
<DD><A NAME="IDX231"></A>


<P>
Set the keycodes for the eight modifiers <CODE>X.Shift</CODE>, <CODE>X.Lock</CODE>,
<CODE>X.Control</CODE>, <CODE>X.Mod1</CODE>, <CODE>X.Mod2</CODE>, <CODE>X.Mod3</CODE>,
<CODE>X.Mod4</CODE> and <CODE>X.Mod5</CODE>.  <VAR>keycodes</VAR> should be a
eight-element list where each entry is a list of the keycodes that
should be bound to that modifier.


<P>
If any changed key is logically in the down state, <CODE>X.MappingBusy</CODE>
is returned and the mapping is not changed.  If the mapping violates
some server restriction, <CODE>X.MappingFailed</CODE> is returned.  Otherwise
the mapping is changed and <CODE>X.MappingSuccess</CODE> is returned.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>get_modifier_mapping</B> <I>( )</I>
<DD><A NAME="IDX232"></A>


<P>
Return a list of eight lists, one for each modifier.  The list can be
indexed using <CODE>X.ShiftMapIndex</CODE>, <CODE>X.Mod1MapIndex</CODE>, and so on.
The sublists list the keycodes bound to that modifier.


</DL>

<P>
<DL>
<DT><U>Method:</U> Display <B>no_operation</B> <I>( onerror = None )</I>
<DD><A NAME="IDX233"></A>


<P>
Do nothing but send a request to the server.


</DL>

<P><HR><P>
Go to the <A HREF="python-xlib_1.html">first</A>, <A HREF="python-xlib_15.html">previous</A>, <A HREF="python-xlib_17.html">next</A>, <A HREF="python-xlib_25.html">last</A> section, <A HREF="python-xlib_toc.html">table of contents</A>.
</BODY>
</HTML>