
    i<                         d Z ddlmZ dZdZdZdZej                  Z G d dej                        Z
d Z G d d	ej                        Z	 	 ddZ G d dej                        Zd Zd Zy
)z}
A partial implementation of the SECURITY extension.  Support for the
SecurityAuthorizationRevoked event is not implemented.
    )rqSECURITY   c                      e Zd Z ej                   ej
                  d       ej                  d       ej                          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   sequence_number   N)__name__
__module____qualname__r   StructCard8OpcodeRequestLengthCard16_request	ReplyCodePadReplyLength_reply     [/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/Xlib/ext/security.pyr   r   +   s    ryy(+"1)))+"?3"?3	H RYY|r||~rvvay ryy!23%r~~' ryy1 ryy1rvvbz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"   <   s-    #||??H&'&') )r   c                      e Zd Z ej                   ej
                  d       ej                  d       ej                          ej                  dd       ej                  dd       ej                  d       ej                  d       ej                  d       ej                  dej                        	      Z ej                   ej                          ej                   d       ej"                  d       ej$                          ed	       ej                  d
d       ej                   d       ej                  d
            Zy)SecurityGenerateAuthorizationr   r   
auth_proto   	auth_data
value_maskvaluesr   authidauth_data_return   N)r   r   r   r   r   r   r   r   LengthOfCard32String8BinaryList	Card32Objr   r   r   r   r   AUTHIDr   r   r   r   r$   r$   C   s    ryy(+"1)))+$\15$[!4"<0#L1";/ 2<<8	H RYY|r||~rvvay ryy!23%r~~'h'"r{{#5q9rvvbz ryy!34Fr   r$   Nc                 :   d}g }||dz  }|j                  |       ||dz  }|j                  |       ||dz  }|j                  |       ||dz  }|j                  |       t        | j                  | j                  j                  t              ||||      S )Nr   r   r&         )r   r   r(   r%   r'   r)   )appendr$   r   r   r    )	r!   r%   r'   timeouttrust_levelgroup
event_maskr(   r)   s	            r   generate_authorizationr<   \   s    JFa
ga
k"a
ea
j!(040P0PQX0Y4>4>3<068 8r   c                       e Zd Z ej                   ej
                  d       ej                  d       ej                          ed            Z	y)SecurityRevokeAuthorizationr   r&   r*   N)
r   r   r   r   r   r   r   r   r3   r   r   r   r   r>   r>   t   sB    ryy(+"1)))+)Hr   r>   c                 l    t        | j                  | j                  j                  t              |      S )N)r   r   r*   )r>   r   r   r    )r!   r*   s     r   revoke_authorizationr@   |   s*    &t||.2ll.N.Nw.W.46 6r   c                     | j                  ddt               | j                  ddt               | j                  ddt               y )Nr   security_query_versionsecurity_generate_authorizationsecurity_revoke_authorization)extension_add_methodr"   r<   r@   )dispinfos     r   initrH      sH    i6+- 	i?46 	i=24r   )r   NNNN)__doc__Xlib.protocolr   r    SecurityClientTrustedSecurityClientUntrusted SecurityAuthorizationRevokedMaskr.   r3   ReplyRequestr   r"   r$   r<   Requestr>   r@   rH   r   r   r   <module>rP      s   .
     #$   
2?? ")BOO 2 EIDH80"** 6	4r   