
    i3                        d Z ddlmZ ddlmZmZ dZdZdZdZ	dZ
dZdZdZdZ G d dej                        Zd	 Z G d
 dej                        Zd Z G d dej(                        Zd Z G d dej(                        Zej0                  ej0                  ej0                  dfdZ G d dej(                        ZddZ G d dej8                        Zd Zy)ar  This extension allows registering the client as an X screensaver,
or query information about the current screensaver.

For detailed description see any of the following documents.
Protocol specification:
    https://www.x.org/releases/X11R7.7/doc/scrnsaverproto/saver.html
XCB Protocol specification:
    https://cgit.freedesktop.org/xcb/proto/tree/src/screensaver.xml

    )X)rqstructszMIT-SCREEN-SAVER      c                      e Zd Z ej                   ej
                  d       ej                  d       ej                          ej
                  d       ej
                  d       ej                  d            Z	 ej                   ej                          ej                  d       ej                  d       ej                          ej                  d       ej                  d       ej                  d            Zy	)
QueryVersionopcoder   major_versionminor_versionr   r   sequence_number   N)__name__
__module____qualname__r   StructCard8OpcodeRequestLengthPad_request	ReplyCodeCard16ReplyLength_reply     ^/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/Xlib/ext/screensaver.pyr	   r	   4   s    ryy		!!!q	
H RYYBLLNBFF1IBII'(BNNBIIo&BIIo&BFF2JFr   r	   c                 n    t        | j                  | j                  j                  t              dd      S )Nr   r   )displayr
   r   r   )r	   r    get_extension_majorextnameselfs    r   query_versionr%   H   s-    #||??H&'&') )r   c                   &   e Zd Z ej                   ej
                  d       ej                  d       ej                          ej                  d            Z	 ej                   ej                          ej
                  d       ej                  d       ej                          ej                  d       ej                  d       ej                  d       ej                  d	       ej
                  d
       ej                  d      
      Zy)	QueryInfor
   r   drawablestater   saver_windowtil_or_sinceidle
event_maskkind   N)r   r   r   r   r   r   r   r   Drawabler   r   r   r   WindowCard32r   r   r   r   r   r'   r'   O   s    ryy		!J	
H RYYBLLNBHHWBII'(BNNBIIn%BIIn%BIIfBIIl#BHHVBFF1IFr   r'   c                 l    t        | j                  | j                  j                  t              |       S )N)r    r
   r(   )r'   r    r!   r"   r#   s    r   
query_infor4   d   s*    T\\ LL<<WE" r   c            	           e Zd Z ej                   ej
                  d       ej                  d       ej                          ej                  d       ej                  d            Z
y)SelectInputr
   r   r(   r-   N)r   r   r   r   r   r   r   r   r0   r2   r   r   r   r   r6   r6   k   sW    ryy		!J		,
Hr   r6   c                 n    t        | j                  | j                  j                  t              | |      S )N)r    r
   r(   r-   )r6   r    r!   r"   )r$   masks     r   select_inputr9   t   s-    t||"ll>>wG $"& r   c                   ,   e Zd Z ej                   ej
                  d       ej                  d       ej                          ej                  d       ej                  d       ej                  d       ej                  d       ej                  d       ej                  d       ej                  d	d
ej                  ej                  ej                  f       ej
                  d       ej                   d       ej$                  d            Zy)SetAttributesr
      r(   xywidthheightborder_widthwindow_classr   depthvisualattrsN)r   r   r   r   r   r   r   r   r0   Int16r   Setr   CopyFromParentInputOutput	InputOnlyr2   r   WindowValuesr   r   r   r   r;   r;   |   s    ryy		!J		'		(		.!~q1#3#3Q]]AKK"PQ		(W%
Hr   r;   Nc
                     t        | j                  |	| j                  j                  t              | |||||||||
      S )N)r    onerrorr
   r(   r=   r>   r?   r@   rA   rB   rC   rD   rE   )r;   r    r!   r"   )r$   r=   r>   r?   r@   rA   rB   rC   rD   rM   keyss              r   set_attributesrO      sJ     #* $ @ @ I"&!&"((4(4!&"(!%' 'r   c                       e Zd Z ej                   ej
                  d       ej                  d       ej                          ej                  d            Z	y)UnsetAttributesr
      r(   N)
r   r   r   r   r   r   r   r   r0   r   r   r   r   rQ   rQ      sI    ryy		!J	
Hr   rQ   c                 n    t        | j                  || j                  j                  t              |       S )N)r    rM   r
   r(   )rQ   r    r!   r"   )r$   rM   s     r   unset_attributesrT      s-    4<<%,"&,,"B"B7"K$(* *r   c                   x   e Zd ZdZ ej
                   ej                  d       ej                  ddee	e
f       ej                  d       ej                  d       ej                  d       ej                  d       ej                  d	deeef       ej"                  d
       ej$                  d      	      Zy)NotifyNtyper)   r   r   	timestamprootwindowr.   forced   )r   r   r   _coder   r   r   rG   StateOffStateOn
StateCycler   r2   r1   KindBlankedKindInternalKindExternalBoolr   _fieldsr   r   r   rV   rV      s    EbiiwHgz:;		#$		+		&		(vq;lCDr


Gr   rV   c                 0   | j                  ddt               | j                  ddt               | j                  ddt               | j                  ddt               | j                  ddt
               | j                  |j                  dz   t               y )	Nr    screensaver_query_versionr(   screensaver_query_infoscreensaver_select_inputscreensaver_set_attributesscreensaver_unset_attributesr   )	extension_add_methodr%   r4   r9   rO   rT   extension_add_eventfirst_eventrV   )dispinfos     r   initrq      s}    i)DmTj*BJOj*DlSj*FWj*HJZ[T--16:r   )N)__doc__Xlibr   Xlib.protocolr   r   r"   
NotifyMask	CycleMaskr^   r_   r`   ra   rb   rc   ReplyRequestr	   r%   r'   r4   Requestr6   r9   r;   rH   rO   rQ   rT   EventrV   rq   r   r   r   <module>rz      s   ,	  %
 
	 

 2?? () *
"** 

BJJ 
$ #$"2"2++,,!	'*
bjj 
*
RXX 
;r   