
    i$              	          d Z ddl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eefdZ ej                   ej                   d       ej                   d            Z G d dej                        Zd Z ej                   ej                   d       ej                   d            Z G d dej                        Zd Z G d dej                        Zd Z G d dej2                        ZdZdZ ej                   ej                   d       ej                   d            Z ej                   ej<                  de       eddd       ej>                  dej@                              Z! G d d ej                        Z"d! Z# ej                   ej                   d"       ej                   d#            Z$ ej                   ej                   d"       ej                   d#       ej                   d$       ej                   d%       ej                   d&            Z% ej                   ej<                  d'e%       ej2                  d(d       ej>                  d(e%            Z& G d) d*ej                        Z'd+ Z(d, Z)y-).aU  X-Resource extension allows a client to query the X server about its usage
of various resources.

For detailed description see any of the following documents.
Protocol specification:
    https://www.x.org/releases/current/doc/resourceproto/resproto.txt
XCB Protocol specification:
    https://cgit.freedesktop.org/xcb/proto/tree/src/res.xml
    )rq      z
X-Resource         c                      e Zd Z ej                   ej
                  d       ej                  e       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opcodeclient_majorclient_minorr   r   sequence_numberserver_majorserver_minor   N)__name__
__module____qualname__r   StructCard8OpcodeResQueryVersionRequestLengthPad_request	ReplyCodeCard16ReplyLength_reply     V/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/Xlib/ext/res.pyr
   r
   0   s    ryyBHHXBIIo&BBHH^$BHH^$BFF1IH RYYBLLNBFF1IBII'(BNNBIIn%BIIn%BFF2JFr!   r
   c                 n    t        | j                  | j                  j                  t              ||      S )z Query the protocol version supported by the X server.

    The client sends the highest supported version to the server and the
    server sends the highest version it supports, but no higher than the
    requested version.)displayr   r   r   )r
   r$   get_extension_majorextname)selfr   r   s      r"   query_versionr(   B   s0     LL<<33G<%%	' 'r!   resource_baseresource_maskc                      e Zd Z ej                   ej
                  d       ej                  e       ej                               Z	 ej                   ej                          ej                  d       ej                  d       ej                          ej                  dd       ej                  d       ej                  de            Zy)QueryClientsr   r   r   clientsr   r   N)r   r   r   r   r   r   r   ResQueryClientsr   r   r   r   r   r   LengthOfListClientr   r    r!   r"   r,   r,   U   s    ryyBHHXBIIo&B H RYYBLLNBFF1IBII'(BNNBKK	1%BFF2JBGGIv&(Fr!   r,   c                 j    t        | j                  | j                  j                  t                    S )z4Request the list of all currently connected clients.)r$   r   )r,   r$   r%   r&   )r'   s    r"   query_clientsr3   d   s(    LL<<33G<> >r!   resource_typecountc                      e Zd Z ej                   ej
                  d       ej                  e       ej                          ej                  d            Z
 ej                   ej                          ej                  d       ej                  d       ej                          ej                  dd       ej                  d       ej                   de            Zy)	QueryClientResourcesr   clientr   r   typesr   r   N)r   r   r   r   r   r   r   ResQueryClientResourcesr   Card32r   r   r   r   r   r/   r0   Typer   r    r!   r"   r7   r7   p   s    ryyBHHXBII-.BBIIh	!H
 RYYBLLNBFF1IBII'(BNNBKK#BFF2JBGGGT"$Fr!   r7   c                 l    t        | j                  | j                  j                  t              |      S )zxRequest the number of resources owned by a client.

    The server will return the counts of each type of resource.
    r$   r   r8   )r7   r$   r%   r&   r'   r8   s     r"   query_client_resourcesr@      s-    
  LL<<33G< r!   c                      e Zd Z ej                   ej
                  d       ej                  e       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            Zy)	QueryClientPixmapBytesr   r8   r   r   bytesbytes_overflow   N)r   r   r   r   r   r   r   ResQueryClientPixmapBytesr   r;   r   r   r   r   r   r   r    r!   r"   rB   rB      s    ryyBHHXBII/0BBIIh	!H
 RYYBLLNBFF1IBII'(BNNBIIgBII&'BFF2JFr!   rB   c                 l    t        | j                  | j                  j                  t              |      S )zQuery the pixmap usage of some client.

    The returned number is a sum of memory usage of each pixmap that can be
    attributed to the given client.
    r>   )rB   r$   r%   r&   r?   s     r"   query_client_pixmap_bytesrH      s-     "LL<<33G< r!   c                       e Zd ZdZd Zd Zy)SizeOfz]A SizeOf stores the size in bytes of some other Field whose size
    may vary, e.g. List
    c                 T    t         j                  j                  | ||       || _        y N)r   r/   __init__	item_size)r'   namesizerN   s       r"   rM   zSizeOf.__init__   s    
T4."r!   c                      || j                   z  S rL   )rN   )r'   lengthr$   s      r"   parse_valuezSizeOf.parse_value   s    ''r!   N)r   r   r   __doc__rM   rS   r    r!   r"   rJ   rJ      s    #(r!   rJ   r8   maskspecvaluec                      e Zd Z ej                   ej
                  d       ej                  e       ej                          ej                  dd       ej                  de            Z ej                   ej                          ej                  d       ej                  d       ej                           ej                  dd       ej                  d       ej                  de            Zy)	QueryClientIdsr   specsr   r   r   idsr   N)r   r   r   r   r   r   r   ResQueryClientIdsr   r/   r0   ClientIdSpecr   r   r   r   r   ClientIdValuer   r    r!   r"   rY   rY      s    ryyBHHXBII'(BBKK#BGGG\*,H RYYBLLNBFF1IBII'(BNNBKKq!BFF2JBGGE=)+Fr!   rY   c                 l    t        | j                  | j                  j                  t              |      S )a  Request to identify a given set of clients with some identification method.

    The request sends a list of specifiers that select clients and
    identification methods to server. The server then tries to identify the
    chosen clients using the identification methods specified for each client.
    The server returns IDs for those clients that were successfully identified.
    )r$   r   rZ   )rY   r$   r%   r&   )r'   rZ   s     r"   query_client_idsr`      s-     LL<<33G< r!   resourcetyperC   	ref_count	use_countrP   cross_referencesc                      e Zd Z ej                   ej
                  d       ej                  e       ej                          ej                  d       ej                  dd       ej                  de            Z ej                   ej                          ej                  d       ej                   d       ej"                          ej                  dd       ej                  d       ej                  de            Zy	)
QueryResourceBytesr   r8   rZ   r   r   r   sizesr   N)r   r   r   r   r   r   r   ResQueryResourceBytesr   r;   r/   r0   ResourceIdSpecr   r   r   r   r   ResourceSizeValuer   r    r!   r"   rg   rg      s    ryyBHHXBII+,BBIIhBKK#BGGG^,.H RYYBLLNBFF1IBII'(BNNBKK#BFF2JBGGG./1Fr!   rg   c                 n    t        | j                  | j                  j                  t              ||      S )a  Query the sizes of resources from X server.

    The request sends a list of specifiers that selects resources for size
    calculation. The server tries to calculate the sizes of chosen resources
    and returns an estimate for a resource only if the size could be determined
    )r$   r   r8   rZ   )rg   r$   r%   r&   )r'   r8   rZ   s      r"   query_resource_bytesrm     s0     LL<<33G<	 r!   c                    | j                  ddt               | j                  ddt               | j                  ddt               | j                  ddt               | j                  ddt
               | j                  ddt               y )Nr$   res_query_versionres_query_clientsres_query_client_resourcesres_query_client_pixmap_bytesres_query_client_idsres_query_resource_bytes)extension_add_methodr(   r3   r@   rH   r`   rm   )dispinfos     r"   initrx     s    i)<mLi)<mLi)E46i)H79i)?.0i)C24r!   N)*rT   Xlib.protocolr   RES_MAJOR_VERSIONRES_MINOR_VERSIONr&   r   r.   r:   rF   r\   ri   ReplyRequestr
   r(   r   r;   r1   r,   r3   r<   r7   r@   rB   rH   r/   rJ   ClientXIDMaskLocalClientPIDMaskr]   Objectr0   	Card32Objr^   rY   r`   rj   ResourceSizeSpecrk   rg   rm   rx   r    r!   r"   <module>r      s  ,   
     2?? $ &70' 
		/"		/"
$
(2?? (> ryy		/"		'
$2?? $ R__  		(R[[ 	(   ryy		(		&
 				&,'w1&(+R__ +" 		*		&
 299 			*		&		'		+		+   BII		&*+&*"$457 1 1$
4r!   