
    ^h              
          S SK r SSKJrJrJr  S SKJrJrJrJ	r	  S SK
rS SKrS SKrS SKrS SKr\R                   R"                  R$                  \R                   R&                  R(                  \R                   R&                  R*                  \R                   R&                  R,                  \R                   R.                  R0                  \R                   R.                  R2                  \R                   R.                  R4                  \R                   R6                  R8                  \R                   R:                  R<                  S.	rSSSS	.r  " S
 S\RB                  5      r" " S S5      r!g)    N   )errorextX)displayrequesteventrq)	resourcedrawablewindowpixmapfontablefontgccolormapcursor)r   r   r   r   r   r   r   r   )r   r   )r   r   )r   r   r   c                   D    \ rS rSr\R                  5       rS rSS jrSr	g)_BaseDisplay7   c                 Z    [         R                  R                  " U 4U-   0 UD6  0 U l        g N)r   Display__init___atom_cache)selfargskeyss      >/var/www/html/env/lib/python3.13/site-packages/Xlib/display.pyr   _BaseDisplay.__init__=   s'      4(T/:T:    c                     XR                   ;   a  U R                   U   $ [        R                  " XUS9nUR                  [        R
                  :w  a  UR                  U R                   U'   UR                  $ )Nr   nameonly_if_exists)r   r   
InternAtomatomr   NONE)r   atomnamer%   rs       r   get_atom_BaseDisplay.get_atomA   sa    '''##H--Q_` 66QVV)*DX&vvr!   )r   Nr   )
__name__
__module____qualname____firstlineno___resource_baseclassescopyresource_classesr   r+   __static_attributes__ r!   r   r   r   7   s    ,113

r!   r   c                   (   \ rS rSrSGS jrS rS rS rS rS r	S	 r
S
 rS rS rS rS rSGS jrS rS rS rSGS jrS rS rS rS rS rS rS rS rSHS jrSHS jrS rS  r   SIS! jr!SGS" jr"SGS# jr#SGS$ jr$SGS% jr%SGS& jr&SGS' jr'\(RR                  SSSSS4S( jr*SGS) jr+S* r,S+ r-S, r.S- r/S. r0SGS/ jr1S0 r2S1 r3S2 r4SGS3 jr5S4 r6SGS5 jr7S6 r8SJS7 jr9SKS8 jr:S9 r;SGS: jr<S; r=SGS< jr>S= r?SGS> jr@SGS? jrASGS@ jrBSA rCSB rDSC rESD rFSGSE jrGSFrHg)Lr   N   Nc                 D   [        U5      U l        S/S-  U l        0 U l        U R	                  U R                  R
                  R                  U R                  R
                  R                  U R                  R
                  R                  -
  S-   5        0 U l        / U l	        0 U l
        0 U l        [        R                  " 0 5      U l        U R                  5       n[         R"                   H  u  p4X2;   d  M  [%        SU-   ['        5       SS9  [)        [         U5      nU R+                  U5      nU R                  R-                  X6R.                  5        UR1                  X5        U R                  R3                  U5        M     U R                  R5                  5        HR  u  pxU R                  R6                  U   n	[9        U	R:                  U	[<        4U5      U R                  R6                  U'   MT     U R                  R
                  R>                   H  n
U R                  R6                  S   " U R                  U
R@                  RB                  5      U
l         U R                  R6                  S   " U R                  U
RD                  RB                  5      U
l"        M     g )Nr6      r   zext.)levelr   r   )#r   r   _keymap_codes_keymap_syms_update_keymapinfomin_keycodemax_keycodekeysym_translations
extensionsclass_extension_dictsdisplay_extension_methodsr
   DictWrapperextension_eventlist_extensionsr   __extensions__
__import__globalsgetattrquery_extensionset_extension_majormajor_opcodeinitappenditemsr4   typer.   objectrootsrootiddefault_colormap)r   r   extsextnamemodnamemodr?   type_dictorigclsscreens              r   r   Display.__init__O   s   #G, !TCZDLL--99!\\..::#||00<<=?@A	C
 $&  %'")+&!~~b1##% !$ 2 2G 6G+GIA>c7+++G400:K:KL $&&w/ !3"  55;;=KEll33E:G378H8H9@&8I8<4>DLL))%0 > ll''--F,,77A$,,PVP[P[P^P^_FK&*ll&C&CJ&OPTP\P\^d^u^u^x^x&yF# .r!   c                 6    U R                   R                  5       $ )zReturns the name used to connect to the server, either
provided when creating the Display object, or fetched from the
environmental variable $DISPLAY.)r   get_display_namer   s    r   rc   Display.get_display_name   s     ||,,..r!   c                 6    U R                   R                  5       $ )zReturns the file descriptor number of the underlying socket.
This method is provided to allow Display objects to be passed
select.select().)r   filenord   s    r   rg   Display.fileno   s     ||""$$r!   c                 8    U R                   R                  5         g)z7Close the display, freeing the resources that it holds.N)r   closerd   s    r   rj   Display.close   s    r!   c                 :    U R                   R                  U5        g)zSet 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.N)r   set_error_handler)r   handlers     r   rm   Display.set_error_handler   s    
 	&&w/r!   c                 8    U R                   R                  5         g)zFlush the request queue, building and sending the queued
requests. This can be necessary in applications that never wait
for events, and in threaded applications.N)r   flushrd   s    r   rq   Display.flush   s     	r!   c                 $    U R                  5         g)zFlush 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.N)get_pointer_controlrd   s    r   syncDisplay.sync   s     	  "r!   c                 6    U R                   R                  5       $ )ztReturn the next event. If there are no events queued, it will
block until the next event is fetched from the server.)r   
next_eventrd   s    r   rx   Display.next_event   s     ||&&((r!   c                 6    U R                   R                  5       $ )zvReturn the number of events queued, i.e. the number of times
that Display.next_event() can be called without blocking.)r   pending_eventsrd   s    r   r{   Display.pending_events   s     ||**,,r!   c                     XR                   ;   $ )zXCheck if both the server and the client library support the X
extension named extension.)rC   )r   	extensions     r   has_extensionDisplay.has_extension   s     OO++r!   c                 V    U R                   R                  U   " U R                   U5      $ )a  Create a resource object of type for the integer id. type
should be one of the following strings:

resource
drawable
window
pixmap
fontable
font
gc
colormap
cursor

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.
)r   r4   )r   rS   rW   s      r   create_resource_objectDisplay.create_resource_object   s$    ( ||,,T24<<DDr!   c                      U R                   U   n[        R                  " X 5      $ ! [         a    [	        U5      ef = fr   )rE   types
MethodTypeKeyErrorAttributeError)r   attrfunctions      r   __getattr__Display.__getattr__   sB    	'55d;H##H33 	' &&	's   $' =c                     Uc7  U R                   R                  R                  U R                   R                     $ U R                   R                  R                  U   $ r   )r   r?   rU   default_screen)r   snos     r   r`   Display.screen   sG    ;<<$$**4<<+F+FGG<<$$**3//r!   c                 T    [        U R                  R                  R                  5      $ )z2Return the total number of screens on the display.)lenr   r?   rU   rd   s    r   screen_countDisplay.screen_count   s    4<<$$**++r!   c                 6    U R                   R                  5       $ )zIReturn the number of the default screen, extracted from the
display name.)r   get_default_screenrd   s    r   r   Display.get_default_screen   s     ||..00r!   c                 n   US:X  a-  [        X5      (       a  [        SU-  5      eX0R                  U'   gU4[        R	                  US5      -   nU HA  n[
        U   n[        Xb5      (       a  [        SU< SU< 35      e X0R                  U   U'   MC     g! [         a    X#0U R                  U'    Mc  f = f)a}  extension_add_method(object, name, function)

Add an X extension module method.  OBJECT is the type of
object to add the function to, a string from this list:

    display
    resource
    drawable
    window
    pixmap
    fontable
    font
    gc
    colormap
    cursor

NAME is the name of the method, a string.  FUNCTION is a
normal function whose first argument is a 'self'.
r   z(attempting to replace display method: %sr6   zattempting to replace z	 method: N)hasattrAssertionErrorrE   _resource_hierarchygetr2   rD   r   )r   rT   r$   r   r   rS   clss          r   extension_add_methodDisplay.extension_add_method   s    * Yt""$%ORV%VWW3;**40 J!4!8!8!DDE+D13%%(RVX\)]^^J=E..t4T:    J9=7ID..t4Js    BB43B4c                    [        UR                  UR                  UR                  R	                  5       5      nXl        U R                  R                  X5        Uc  UR                  n[        U R                  X15        g)aR  extension_add_event(code, evt, [name])

Add an extension event.  CODE is the numeric code, and EVT is
the event class.  EVT will be cloned, and the attribute _code
of the new event class will be set to CODE.

If NAME is omitted, it will be set to the name of EVT.  This
name is used to insert an entry in the DictWrapper
extension_event.
N)
rS   r.   	__bases____dict__r3   _coder   add_extension_eventsetattrrG   )r   codeevtr$   newevts        r   extension_add_eventDisplay.extension_add_event  s_     cllCMMll'')+((6<<<D$$d1r!   c                 :    U R                   R                  X5        g)zoadd_extension_error(code, err)

Add an extension error.  CODE is the numeric code, and ERR is
the error class.
N)r   add_extension_error)r   r   errs      r   r   Display.add_extension_error.  s     	((3r!   c                 h     U R                   U   U   $ ! [         a    [        R                  s $ f = f)zConvert 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.)r<   
IndexErrorr   NoSymbol)r   keycodeindexs      r   keycode_to_keysymDisplay.keycode_to_keysymE  s6    
	%%g.u55 	::	s    11c                 Z     U R                   U   S   S   $ ! [        [        4 a     gf = f)zLook 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.r   r   )r=   r   r   )r   keysyms     r   keysym_to_keycodeDisplay.keysym_to_keycodeO  s9    
	$$V,Q/22*% 		s    **c                      U R                   U    Vs/ s H  o"S   US   4PM     sn$ s  snf ! [         a    / s $ f = f)zLook 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.r   r   )r=   r   )r   r   xs      r   keysym_to_keycodesDisplay.keysym_to_keycodesY  sJ    	*.*;*;F*CD*CQqT1Q4L*CDDD 	I	s   . ). . ==c                     [        U[        R                  5      (       aF  UR                  [        R
                  :X  a'  U R                  UR                  UR                  5        gg[        S5      e)zThis method should be called once when a MappingNotify event
is received, to update the keymap cache. evt should be the event
object.zexpected a MappingNotify eventN)

isinstancer	   MappingNotifyr   r   MappingKeyboardr>   first_keycodecount	TypeError)r   r   s     r   refresh_keyboard_mapping Display.refresh_keyboard_mappingc  sV     c5..//{{a///##C$5$5syyA 0 <==r!   c                    X-   nU R                   R                  5        HB  u  pESnU[        U5      :  d  M  XV   S   nXq:  a  Xs:  a  XV	 OUS-   nU[        U5      :  a  M*  MD     U R                  X5      nXR                  X& UnU H~  n	Sn
U	 Hn  nU[
        R                  :w  aR  XR                   ;   a2  U R                   U   nUR                  X45        UR                  5         OX4/U R                   U'   U
S-   n
Mp     US-   nM     g)z?Internal function, called to refresh the keymap cache.
        r   r   N)	r=   rR   r   get_keyboard_mappingr<   r   r   rQ   sort)r   r   r   lastcoder   codesir   keysymssymsr   symsymcodess                r   r>   Display._update_keymapm  s    !(!..446MFAc%j.x{(T_AA c%j. 7 ++MA 6==2 DE!**$///#'#4#4S#9 6 38-))#.	  !8D r!   c                     U R                   R                  U5      nUb  U$ SSKnUR                  R	                  U5      $ )zXReturn a string corresponding to KEYSYM, or None if no
reasonable translation is found.
Nr   )rB   r   Xlib.XKXKkeysym_to_string)r   r   sXlibs       r   lookup_stringDisplay.lookup_string  s<     $$((0=Hww''//r!   c                 d    Uc   U R                   U	 gX R                   U'   g! [         a     gf = f)zdChange the translation of KEYSYM to NEWSTRING.
If NEWSTRING is None, remove old translation if any.
N)rB   r   )r   r   	newstrings      r   rebind_stringDisplay.rebind_string  sA     ,,V4 09$$V,  s   " 
//r   c                 Z    [         R                  " U R                  UUS9nUR                  $ )zIntern 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.r#   )r   r&   r   r'   )r   r$   r%   r*   s       r   intern_atomDisplay.intern_atom  s,     &*0>@ vvr!   c                 8    U R                   R                  X5      $ )z+Alias for intern_atom, using internal cache)r   r+   )r   r'   r%   s      r   r+   Display.get_atom  s    ||$$T::r!   c                 X    [         R                  " U R                  US9nUR                  $ )z^Look up the name of atom, returning it as a string. Will raise
BadAtom if atom does not exist.)r   r'   )r   GetAtomNamer   r$   )r   r'   r*   s      r   get_atom_nameDisplay.get_atom_name  s&     $,,'+-vvr!   c                 X    [         R                  " U R                  US9nUR                  $ )zuReturn the window that owns selection (an atom), or X.NONE if
there is no owner for the selection. Can raise BadAtom.)r   	selection)r   GetSelectionOwnerr   owner)r   r   r*   s      r   get_selection_ownerDisplay.get_selection_owner  s&     %%2;=wwr!   c           	      J    [         R                  " U R                  UUUUUS9  g)a  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.)r   onerror	propagatedestination
event_maskr	   N)r   	SendEventr   )r   r   r	   r   r   r   s         r   
send_eventDisplay.send_event  s'     	DLL$+&/(3'1"'	)r!   c                 D    [         R                  " U R                  UUS9  g)zIelease a grabbed pointer and any queued events. See
XUngrabPointer(3X11).r   r   timeN)r   UngrabPointerr   r   r   r   s      r   ungrab_pointerDisplay.ungrab_pointer  s     	(/%)	+r!   c                 H    [         R                  " U R                  UUUUS9  g)zTChange the dynamic parameters of a pointer grab. See
XChangeActivePointerGrab(3X11).)r   r   r   r   r   N)r   ChangeActivePointerGrabr   )r   r   r   r   r   s        r   change_active_pointer_grab"Display.change_active_pointer_grab  s%     	''$,,2917/35?		Ar!   c                 D    [         R                  " U R                  UUS9  g)zKUngrab a grabbed keyboard and any queued events. See
XUngrabKeyboard(3X11).r   N)r   UngrabKeyboardr   r   s      r   ungrab_keyboardDisplay.ungrab_keyboard  s     	)0&*	,r!   c                 F    [         R                  " U R                  UUUS9  g)zRelease 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.)r   r   moder   N)r   AllowEventsr   )r   r  r   r   s       r   allow_eventsDisplay.allow_events  s!    
 	dll&-#'#'	)r!   c                 B    [         R                  " U R                  US9  g)zDisable processing of requests on all other client connections
until the server is ungrabbed. Server grabbing should be avoided
as much as possible.r   r   N)r   
GrabServerr   r   r   s     r   grab_serverDisplay.grab_server  s     	T\\%,	.r!   c                 B    [         R                  " U R                  US9  g)z?Release the server if it was previously grabbed by this client.r
  N)r   UngrabServerr   r  s     r   ungrab_serverDisplay.ungrab_server  s    t||'.	0r!   c	                 n    [         R                  " U R                  UU[        R                  UUUUUUS9
  g)au  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().)
r   r   
src_window
dst_windowsrc_xsrc_y	src_width
src_heightdst_xdst_yN)r   WarpPointerr   r   r(   )	r   r   yr  r  r  r  r  r   s	            r   warp_pointerDisplay.warp_pointer  s7     	dll&-)3)*$)$)(1)3$%$%		'r!   c                 H    [         R                  " U R                  UUUUS9  g)a=  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().)r   r   	revert_tofocusr   N)r   SetInputFocusr   )r   r"  r!  r   r   s        r   set_input_focusDisplay.set_input_focus  s$     	(/*3&+%)		+r!   c                 >    [         R                  " U R                  S9$ )zReturn an object with the following attributes:

focus
    The window which currently holds the input
    focus, X.NONE or X.PointerRoot.
revert_to
    Where the focus will revert, one of X.RevertToParent,
    RevertToPointerRoot, or RevertToNone. r   )r   GetInputFocusr   rd   s    r   get_input_focusDisplay.get_input_focus-  s     $$t||<<r!   c                 V    [         R                  " U R                  S9nUR                  $ )a:  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.r'  )r   QueryKeymapr   mapr   r*   s     r   query_keymapDisplay.query_keymap8  s!     $,,7uur!   c                    U R                   R                  5       n[        R                  " [        R                  5      n[
        R                  " U R                   UUUS9  U R                  5         UR                  5       (       a  U R                   R                  U5        gU R                   R                  S[        R                  R                  R                  5      nU" U R                   USS9$ )zzOpen the font identifed by the pattern name and return its
font object. If name does not match any font, None is returned.)r   r   fidr$   Nr   r   )r   )r   allocate_resource_idr   
CatchErrorBadNamer   OpenFontru   	get_errorfree_resource_idget_resource_classr   xobjectr   Font)r   r$   r2  ecr   s        r   	open_fontDisplay.open_fontA  s     ll//1emm,4<<#%" $	& 			<<>>LL))#.,,11&$,,:O:O:T:TUCt||S!44r!   c                 Z    [         R                  " U R                  UUS9nUR                  $ )zVReturn a list of font names matching pattern. No more than
max_names will be returned.r   	max_namespattern)r   	ListFontsr   fonts)r   rB  rA  r*   s       r   
list_fontsDisplay.list_fontsT  s+     *3(/1 wwr!   c                 B    [         R                  " U R                  UUS9$ )a]  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:

name
    The name of the font.
min_bounds
max_bounds
min_char_or_byte2
max_char_or_byte2
default_char
draw_direction
min_byte1
max_byte1
all_chars_exist
font_ascent
font_descent
replies_hint
    See the descripton of XFontStruct in XGetFontProperty(3X11)
    for details on these values.
properties
    A list of properties. Each entry has two attributes:

    name
        The atom identifying this property.
    value
        A 32-bit unsigned value.
r@  )r   ListFontsWithInfor   )r   rB  rA  s      r   list_fonts_with_infoDisplay.list_fonts_with_info\  s#    : ((4<<5>3:< 	<r!   c                 D    [         R                  " U R                  UUS9  g)zSet 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.)r   r   pathN)r   SetFontPathr   )r   rL  r   s      r   set_font_pathDisplay.set_font_path}  s     	dll&-#'	)r!   c                 V    [         R                  " U R                  S9nUR                  $ )z2Return the current font path as a list of strings.r'  )r   GetFontPathr   pathsr.  s     r   get_font_pathDisplay.get_font_path  s    $,,7wwr!   c                 h    [         R                  " U R                  US9nUR                  (       a  U$ g)a  Ask the server if it supports the extension name. If it is
supported an object with the following attributes is returned:

major_opcode
    The major opcode that the requests of this extension uses.
first_event
    The base event code if the extension have additional events, or 0.
first_error
    The base error code if the extension have additional errors, or 0.

If the extension is not supported, None is returned.)r   r$   N)r   QueryExtensionr   present)r   r$   r*   s      r   rM   Display.query_extension  s,     ""T\\*.099Hr!   c                 V    [         R                  " U R                  S9nUR                  $ )z;Return a list of all the extensions provided by the server.r'  )r   ListExtensionsr   namesr.  s     r   rH   Display.list_extensions  s    ""T\\:wwr!   c                 F    [         R                  " U R                  UUUS9  g)zModify 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.)r   r   r   r   N)r   ChangeKeyboardMappingr   )r   r   r   r   s       r   change_keyboard_mappingDisplay.change_keyboard_mapping  s!     	%%076C07	9r!   c                 Z    [         R                  " U R                  UUS9nUR                  $ )zkReturn the current keyboard mapping as a list of tuples,
starting at first_keycount and no more than count.)r   r   r   )r   GetKeyboardMappingr   r   )r   r   r   r*   s       r   r   Display.get_keyboard_mapping  s,     &&7D/46 yyr!   c                 D    [         R                  " U R                  UUS9  g)aR  Change the parameters provided as keyword arguments:

key_click_percent
    The volume of key clicks between 0 (off) and 100 (load).
    -1 will restore default setting.
bell_percent
    The base volume of the bell, coded as above.
bell_pitch
    The pitch of the bell in Hz, -1 restores the default.
bell_duration
    The duration of the bell in milliseconds, -1 restores
    the default.
led

led_mode
    led_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.
key

auto_repeat_mode
    auto_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.)r   r   attrsN)r   ChangeKeyboardControlr   )r   r   r   s      r   change_keyboard_controlDisplay.change_keyboard_control  s    4 	%%07.2	4r!   c                 >    [         R                  " U R                  S9$ )a/  Return an object with the following attributes:

global_auto_repeat
    X.AutoRepeatModeOn or X.AutoRepeatModeOff.

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.

led_mask
    A 32-bit mask indicating which LEDs are on.

key_click_percent
    The volume of key click, from 0 to 100.

bell_percent

bell_pitch

bell_duration
    The volume, pitch and duration of the bell. r'  )r   GetKeyboardControlr   rd   s    r   get_keyboard_controlDisplay.get_keyboard_control  s    0 ))DLLAAr!   c                 D    [         R                  " U R                  UUS9  g)zWRing the bell at the volume percent which is relative the base
volume. See XBell(3X11).)r   r   percentN)r   Bellr   )r   rn  r   s      r   bellDisplay.bell  s     	t||&&	(r!   c           
      |    Uc  SnSnSnOSnUu  pVUc  SnOSn[         R                  " U R                  UUUUUUS9  g)a  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.Nr   r   )r   r   do_acceldo_thres	accel_numaccel_denum	threshold)r   ChangePointerControlr   )r   accelrw  r   rs  ru  rv  do_thresholds           r   change_pointer_controlDisplay.change_pointer_control  s[     =HIKH%*"ILL$$t||/6080<1:3>1:	<r!   c                 >    [         R                  " U R                  S9$ )zReturn an object with the following attributes:

accel_num

accel_denom
    The acceleration as numerator/denumerator.

threshold
    The number of pixels the pointer must move before the
    acceleration kicks in.r'  )r   GetPointerControlr   rd   s    r   rt   Display.get_pointer_control  s     ((4<<@@r!   c           	      J    [         R                  " U R                  UUUUUS9  g)zSee XSetScreenSaver(3X11).)r   r   timeoutintervalprefer_blankallow_exposuresN)r   SetScreenSaverr   )r   r  r  r  r  r   s         r   set_screen_saverDisplay.set_screen_saver  s&    )0)0*2.:1@	Br!   c                 >    [         R                  " U R                  S9$ )zReturn an object with the attributes timeout, interval,
prefer_blanking, allow_exposures. See XGetScreenSaver(3X11) for
details.r'  )r   GetScreenSaverr   rd   s    r   get_screen_saverDisplay.get_screen_saver#  s     %%==r!   c                 H    [         R                  " U R                  UUUUS9  g)zmode 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.)r   r   r  host_familyhostN)r   ChangeHostsr   )r   r  r  r  r   s        r   change_hostsDisplay.change_hosts)  s$     	dll&-#'*5#'		)r!   c                 >    [         R                  " U R                  S9$ )a  Return an object with the following attributes:

mode
    X.EnableAccess if the access control list is used, X.DisableAccess otherwise.
hosts
    The hosts on the access list. Each entry has the following attributes:

    family
        X.FamilyInternet, X.FamilyDECnet, or X.FamilyChaos.
    name
        A list of byte values, the coding depends on family. For the Internet family, it is the 4 bytes of an IPv4 address.

r'  )r   	ListHostsr   rd   s    r   
list_hostsDisplay.list_hosts5  s       4<<88r!   c                 D    [         R                  " U R                  UUS9  g)zsEnable use of access control lists at connection setup if mode
is X.EnableAccess, disable if it is X.DisableAccess.r   r   r  N)r   SetAccessControlr   r   r  r   s      r   set_access_controlDisplay.set_access_controlE  s     	  4<<+2(,	.r!   c                 D    [         R                  " U R                  UUS9  g)zControl 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.r  N)r   SetCloseDownModer   r  s      r   set_close_down_modeDisplay.set_close_down_modeL       	  4<<+2(,	.r!   c                 D    [         R                  " U R                  UUS9  g)zIf 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.r  N)r   ForceScreenSaverr   r  s      r   force_screen_saverDisplay.force_screen_saverT  r  r!   c                 X    [         R                  " U R                  US9nUR                  $ )a  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.)r   r-  )r   SetPointerMappingr   status)r   r-  r*   s      r   set_pointer_mappingDisplay.set_pointer_mapping\  s&     %%,/1xxr!   c                 V    [         R                  " U R                  S9nUR                  $ )z}Return a list of the pointer button mappings. Entry N in the
list sets the logical button number for the physical button N+1.r'  )r   GetPointerMappingr   r-  r.  s     r   get_pointer_mappingDisplay.get_pointer_mappingn  s!     %%=uur!   c                 X    [         R                  " U R                  US9nUR                  $ )a  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.)r   keycodes)r   SetModifierMappingr   r  )r   r  r*   s      r   set_modifier_mappingDisplay.set_modifier_mappingt  s&     &&2:<xxr!   c                 V    [         R                  " U R                  S9nUR                  $ )zReturn 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.r'  )r   GetModifierMappingr   r  r.  s     r   get_modifier_mappingDisplay.get_modifier_mapping  s"     &&>zzr!   c                 B    [         R                  " U R                  US9  g)z,Do nothing but send a request to the server.r
  N)r   NoOperationr   r  s     r   no_operationDisplay.no_operation  s    dll&-	/r!   )r<   r=   rD   r   rE   rG   rC   rB   r   r-   )r   r   N)r   N)NNN)Ir.   r/   r0   r1   r   rc   rg   rj   rm   rq   ru   rx   r{   r   r   r   r`   r   r   r   r   r   r   r   r   r   r>   r   r   r   r+   r   r   r   r   r   r  r  r  r  r   r(   r  r$  r)  r/  r=  rE  rI  rN  rS  rM   rH   r_  r   rg  rk  rp  r{  rt   r  r  r  r  r  r  r  r  r  r  r  r  r5   r6   r!   r   r   r   N   su   3zl/%0#)
-
,
E.'0,1&JP204.>$T	0
9";
 JK!)+A,).0
 /0ffa!"d'(+	=5&<B)
&
94<B4(<6AB>
)9 ...$/r!   r   )#r    r   r   r   Xlib.protocolr   r   r	   r
   Xlib.xobject.resourcer   Xlib.xobject.drawableXlib.xobject.fontableXlib.xobject.colormapXlib.xobject.cursorr:  r   Resourcer   DrawableWindowPixmapr   Fontabler;  GCr   Colormapr   Cursorr2   r   r   r   r6   r!   r   <module>r     s  (    6 5      %%..%%..ll##**ll##**%%..LL!!&&
,,


"
"%%..ll!!((
 ' % 7?? ./ /r!   