§
    bê²^S7  ã                   ó  — d dl mZ d dlmZmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ej        Zej        Zej        Zej        Zej        Zej         Z ej!        Z!ej"        Z" G d„ de#¦  «        Z$d„ Z%dS )é   )Ú_gi)Ú	TYPE_NONEÚTYPE_INTERFACEÚ	TYPE_CHARÚ
TYPE_UCHARÚTYPE_BOOLEANÚTYPE_INTÚ	TYPE_UINTÚ	TYPE_LONGÚ
TYPE_ULONGÚ
TYPE_INT64ÚTYPE_UINT64Ú	TYPE_ENUMÚ
TYPE_FLAGSÚ
TYPE_FLOATÚTYPE_DOUBLEÚTYPE_STRINGÚTYPE_POINTERÚ
TYPE_BOXEDÚ
TYPE_PARAMÚTYPE_OBJECTÚTYPE_PYOBJECTÚ
TYPE_GTYPEÚ	TYPE_STRVÚTYPE_VARIANTc                   ó>  — e Zd ZdZeeeeee	e
eeeiZedededee e	e eeeeediZeeeeededeee	eeeeeiZedededededededede	di	Z G d„ d	e ¦  «        Z!d
d
d
d
dde"j#        d
d
f	d„Z$d„ Z%d„ Z&d„ Z'd„ Z(d„ Z)d„ Z*d„ Z+d„ Z,d„ Z-d„ Z.d„ Z/d„ Z0d„ Z1d„ Z2d„ Z3d„ Z4d
S )ÚPropertyaÄ  Creates a new Property which when used in conjunction with
    GObject subclass will create a Python property accessor for the
    GObject ParamSpec.

    :param callable getter:
        getter to get the value of the property
    :param callable setter:
        setter to set the value of the property
    :param type type:
        type of property
    :param default:
        default value, must match the property type.
    :param str nick:
        short description
    :param str blurb:
        long description
    :param GObject.ParamFlags flags:
        parameter flags
    :keyword minimum:
        minimum allowed value (int, float, long only)
    :keyword maximum:
        maximum allowed value (int, float, long only)

    .. code-block:: python

         class MyObject(GObject.Object):
             prop = GObject.Property(type=str)

         obj = MyObject()
         obj.prop = 'value'

         obj.prop  # now is 'value'

    The API is similar to the builtin :py:func:`property`:

    .. code-block:: python

        class AnotherObject(GObject.Object):
            value = 0

            @GObject.Property
            def prop(self):
                'Read only property.'
                return 1

            @GObject.Property(type=int)
            def propInt(self):
                'Read-write integer property.'
                return self.value

            @propInt.setter
            def propInt(self, value):
                self.value = value
    é    lûÿÿÿ         l   ÿÿÿÿ l   ÿÿÿÿ Ú g        c                   ó   — e Zd Zd„ ZdS )úProperty.__metaclass__c                 ó   — dS )Nz<class 'GObject.Property'>© ©Úselfs    ú4/usr/lib/python3/dist-packages/gi/_propertyhelper.pyÚ__repr__zProperty.__metaclass__.__repr__Š   s   € Ø/Ð/ó    N)Ú__name__Ú
__module__Ú__qualname__r'   r#   r(   r&   Ú__metaclass__r!   ‰   s#   € € € € € ð	0ð 	0ð 	0ð 	0ð 	0r(   r,   Nc
                 óœ  — d | _         |€t          }|                      |¦  «        | _        |                      |¦  «        | _        |                      ¦   «          t          |t          ¦  «        st          d¦  «        ‚|| _
        t          |t          ¦  «        st          d¦  «        ‚|| _        || _        || _        |r
|s| j        }n|r
|s| j        }n|s|s| j        }| j        }|                      |¦  «         || _        |�D||                      ¦   «         k     r+t          d| j        |                      ¦   «         fz  ¦  «        ‚n|                      ¦   «         }|| _        |	�D|	|                      ¦   «         k    r+t          d| j        |                      ¦   «         fz  ¦  «        ‚n|                      ¦   «         }	|	| _        d | _        d S )Nznick must be a stringzblurb must be a stringz+Minimum for type %s cannot be lower than %dz,Maximum for type %s cannot be higher than %d)ÚnameÚobjectÚ_type_from_pythonÚtypeÚ_get_defaultÚdefaultÚ_check_defaultÚ
isinstanceÚstrÚ	TypeErrorÚnickÚblurbÚ__doc__ÚflagsÚ_readonly_setterÚ_writeonly_getterÚ_default_getterÚ_default_setterÚgetterÚfsetÚ_get_minimumÚminimumÚ_get_maximumÚmaximumÚ_exc)
r%   r@   Úsetterr1   r3   r8   r9   r;   rC   rE   s
             r&   Ú__init__zProperty.__init__�   s  € ð ˆŒ	àˆ<ÝˆDØ×*Ò*¨4Ñ0Ô0ˆŒ	Ø×(Ò(¨Ñ1Ô1ˆŒØ×ÒÑÔÐå˜$¥Ñ$Ô$ð 	5ÝÐ3Ñ4Ô4Ð4ØˆŒ	å˜%¥Ñ%Ô%ð 	6ÝÐ4Ñ5Ô5Ð5ØˆŒ
ð ˆŒØˆŒ
ð ð 	*˜&ð 	*ØÔ*ˆFˆFØð 	*˜Fð 	*ØÔ+ˆFˆFØð 	* ð 	*ØÔ)ˆFØÔ)ˆFØ�Š�FÑÔÐð ˆŒ	àÐØ˜×*Ò*Ñ,Ô,Ò,Ð,ÝØAØ”Y × 1Ò 1Ñ 3Ô 3Ð4ñ5ñ6ô 6ð 6ð -ð
 ×'Ò'Ñ)Ô)ˆGØˆŒØÐØ˜×*Ò*Ñ,Ô,Ò,Ð,ÝØBØ”Y × 1Ò 1Ñ 3Ô 3Ð4ñ5ñ6ô 6ð 6ð -ð
 ×'Ò'Ñ)Ô)ˆGØˆŒàˆŒ	ˆ	ˆ	r(   c                 ó6   — d| j         pd›d| j        j         ›d�S )Nz<GObject Property z(uninitialized)z (z)>)r.   r1   r$   s    r&   r'   zProperty.__repr__Å   s*   € € àŒIÐ*Ð*Ð*Ð*ØŒIŒNˆNˆNðð 	r(   c                 ót   — |€| S d | _         |                      |¦  «        }| j         r| j         }d | _         |‚|S ©N)rF   Úfget)r%   ÚinstanceÚklassÚvalueÚexcs        r&   Ú__get__zProperty.__get__Ê   sG   € ØÐØˆKàˆŒ	Ø—	’	˜(Ñ#Ô#ˆØŒ9ð 	Ø”)ˆCØˆDŒIØˆIàˆr(   c                 óŠ   — |€t           ‚d | _        |                     | j        |¦  «         | j        r| j        }d | _        |‚d S rK   )r7   rF   Úset_propertyr.   )r%   rM   rO   rP   s       r&   Ú__set__zProperty.__set__×   sS   € ØÐÝˆOàˆŒ	Ø×Ò˜dœi¨Ñ/Ô/Ð/ØŒ9ð 	Ø”)ˆCØˆDŒIØˆIð	ð 	r(   c                 ó,   — |                       |¦  «        S )z;Allows application of the getter along with init arguments.)r@   ©r%   rL   s     r&   Ú__call__zProperty.__call__â   s   € à�{Š{˜4Ñ Ô Ð r(   c                 óR   — |j         r|j         | _        |j         | _         || _        | S )z8Set the getter function to fget. For use as a decorator.)r:   r9   rL   rV   s     r&   r@   zProperty.getteræ   s*   € àŒ<ð 	(àœˆDŒJØœ<ˆDŒLØˆŒ	Øˆr(   c                 óD   — || _         | j        s| j        j        | _        | S )z8Set the setter function to fset. For use as a decorator.)rA   r.   rL   r)   )r%   rA   s     r&   rG   zProperty.setterï   s&   € àˆŒ	ð Œyð 	+Øœ	Ô*ˆDŒIØˆr(   c                 ó,  — || j         v r| j         |         S t          |t          ¦  «        rNt          |t          j        t          j        t          j        t          j        t          j	        f¦  «        r|j
        S |t          t          t          t          t          t           t"          t$          t&          t(          t*          t,          t.          t0          t2          t4          t6          t8          t:          t<          t>          t@          fv r|S tC          d|›�¦  «        ‚)NzUnsupported type: )"Ú_type_from_pytype_lookupr5   r1   Ú
issubclassr   ÚGObjectÚGEnumÚGFlagsÚGBoxedÚ
GInterfaceÚ	__gtype__r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r7   )r%   Útype_s     r&   r0   zProperty._type_from_pythonù   sÍ   € Ø�DÔ1Ð1Ð1ØÔ0°Ô7Ð7Ý˜¥Ñ%Ô%ð 	?Ý˜¥¤Ý!$¤Ý!$¤Ý!$¤Ý!$¤ð	!1ñ 2ô 2ð	?ð ”?Ð"Ø•y¥.µ)½ZÝ¥­L½)Ý!¥:­{Ý!¥;µÝ!¥:­{½KÝ$¥jµ)½\ðKð Kð Kð ˆLå�)°e°eÐ=Ñ>Ô>Ð>r(   c                 óJ   — |�|S | j                              | j        d ¦  «        S rK   )Ú_default_lookupÚgetr1   )r%   r3   s     r&   r2   zProperty._get_default  s(   € ØÐØˆNØÔ#×'Ò'¨¬	°4Ñ8Ô8Ð8r(   c                 óf  — | j         }| j        }|t          k    r|dvrt          d|›�¦  «        ‚|t          k    r|�t          d¦  «        ‚d S |t
          k    r|�t          d¦  «        ‚d S |                     t          ¦  «        rO|€t          d¦  «        ‚t          j	        |¦  «                             |¦  «        st          d|›d|›�¦  «        ‚d S |                     t          ¦  «        r>t          j	        |¦  «                             |¦  «        st          d|›d|›�¦  «        ‚d S |                     t          ¦  «        ry|�wt          |t          ¦  «        st          d	t          |¦  «        z  ¦  «        ‚|D ]>}t          |¦  «        t          t           fvrt          d
t          |¦  «        z  ¦  «        ‚Œ?d S |                     t"          ¦  «        rS|�St%          |d¦  «        r,t          j	        |¦  «                             t"          ¦  «        st          d|›d|›�¦  «        ‚d S d S d S )N)TFz#default must be True or False, not z)object types does not have default valuesz(GType types does not have default valuesz%enum properties needs a default valuezenum value z must be an instance of zflags value zStrv value %s must be a listz'Strv value %s must contain only stringsrb   zvariant value )r1   r3   r   r7   r   r   Úis_ar   r   ÚGTyper   r   r5   ÚlistÚreprr6   Úbytesr   Úhasattr)r%   Úptyper3   Úvals       r&   r4   zProperty._check_default  s–  € Ø”	ˆØ”,ˆØ•\Ò!Ð! w°mÐ'CÐ'CÝ�)Ø;B¸7ÐDñFô Fð Fà•mÒ#Ð#ØÐ"ÝÐ KÑLÔLÐLð #Ð"à•jÒ Ð ØÐ"ÝÐ JÑKÔKÐKð #Ð"à�ZŠZ�	Ñ"Ô"ð 	2ØˆÝÐ GÑHÔHÐHÝ”Y˜wÑ'Ô'×,Ò,¨UÑ3Ô3ð 2Ý�iØ!(  ¨%¨%ð!1ñ 2ô 2ð 2ð2ð 2ð �ZŠZ�
Ñ#Ô#ð 	2Ý”9˜WÑ%Ô%×*Ò*¨5Ñ1Ô1ð 2Ý�iØ!(  ¨%¨%ð!1ñ 2ô 2ð 2ð2ð 2ð �ZŠZ�	Ñ"Ô"ð 		2 wÐ':Ý˜g¥tÑ,Ô,ð PÝÐ >ÅÀgÁÄÑ NÑOÔOÐOØð ^ð ^�Ý˜‘9”9¥S­% LÐ0Ð0Ý#Ð$MÕPSÐT[ÑP\ÔP\Ñ$\Ñ]Ô]Ð]ð 1ð^ð ^ð �ZŠZ�Ñ%Ô%ð 	2¨'Ð*=Ý˜7 KÑ0Ô0ð 2½¼	À'Ñ8JÔ8J×8OÒ8OÕP\Ñ8]Ô8]ð 2Ý�iØ!(  ¨%¨%ð!1ñ 2ô 2ð 2ð	2ð 	2Ð*=Ð*=ð2ð 2r(   c                 óB   — | j                              | j        d ¦  «        S rK   )Ú_min_value_lookuprf   r1   r$   s    r&   rB   zProperty._get_minimum3  ó   € ØÔ%×)Ò)¨$¬)°TÑ:Ô:Ð:r(   c                 óB   — | j                              | j        d ¦  «        S rK   )Ú_max_value_lookuprf   r1   r$   s    r&   rD   zProperty._get_maximum6  rr   r(   c                 ó8   — t          |d| j        z   |¦  «         d S ©NÚ_property_helper_)Úsetattrr.   ©r%   rM   rO   s      r&   r?   zProperty._default_setter=  s"   € Ý�Ð-°´	Ñ9¸5ÑAÔAÐAÐAÐAr(   c                 ó>   — t          |d| j        z   | j        ¦  «        S rv   )Úgetattrr.   r3   ©r%   rM   s     r&   r>   zProperty._default_getter@  s   € Ý�xÐ!4°t´yÑ!@À$Ä,ÑOÔOÐOr(   c                 óh   — t          | j        ›dt          |¦  «        j        ›d�¦  «        | _        d S )Nú property of z is read-only©r7   r.   r1   r)   rF   ry   s      r&   r<   zProperty._readonly_setterC  ó6   € ÝØŒIˆIˆI•t˜H‘~”~Ô.Ð.Ð.ð0ñ 1ô 1ˆŒ	ˆ	ˆ	r(   c                 óh   — t          | j        ›dt          |¦  «        j        ›d�¦  «        | _        d S )Nr~   z is write-onlyr   r|   s     r&   r=   zProperty._writeonly_getterG  r€   r(   c           	      ón  — | j         }|t          t          t          t          t
          t          t          t          fv r| j	        | j
        | j        f}nÆ|t          k    sY|t          k    sN|                     t          ¦  «        s4|                     t           ¦  «        s|                     t"          ¦  «        r	| j        f}nY|t$          t&          fv rd}nF|                     t(          ¦  «        s|                     t*          ¦  «        rd}nt-          |¦  «        ‚| j         | j        | j        f|z   | j        fz   S )Nr#   )r1   r	   r
   r   r   r   r   r   r   rC   rE   r3   r   r   rh   r   r   r   r   r   r   r   ÚNotImplementedErrorr8   r9   r;   )r%   rn   Úargss      r&   Úget_pspec_argszProperty.get_pspec_argsO  s  € Ø”	ˆØ•X�y­)µZÝ¥­j½+ðGð Gð Gà”< ¤¨t¬|Ð;ˆDˆDØ•{Ò"Ð" e­|Ò&;Ð&;Ø�jŠj�Ñ#Ô#ð '<Ø',§z¢zµ*Ñ'=Ô'=ð '<à�jŠj�Ñ&Ô&ð '<ð ”L�?ˆDˆDØ•}¥jÐ1Ð1Ð1ØˆDˆDØ�ZŠZ�Ñ$Ô$ð 	-¨¯
ª
µ:Ñ(>Ô(>ð 	-ØˆDˆDå% eÑ,Ô,Ð,à”	˜4œ9 d¤jÐ1°DÑ8¸D¼J¸=ÑHÐHr(   )5r)   r*   r+   r:   Úintr	   Úboolr   Úfloatr   r6   r   r/   r   r[   r
   r   r   r   Ú
G_MAXFLOATÚG_MAXDOUBLEÚG_MININTr   Ú	G_MINLONGr   rq   Ú	G_MAXUINTÚ
G_MAXULONGÚG_MAXINTÚ	G_MAXLONGrt   re   r1   r,   r   ÚPARAM_READWRITErH   r'   rQ   rT   rW   r@   rG   r0   r2   r4   rB   rD   r?   r>   r<   r=   r…   r#   r(   r&   r   r   '   s5  € € € € € ð5ð 5ðn 	ˆXØˆlØˆ{Øˆ[Ø�ð Ðð 	�1Ø�AØ�Qà�Z�KØ�k�\Ø�(Ø�9Ø�Hð
Ðð 	�9Ø�JØ�KØ�[Ø�JØ�[Ø�(Ø�9ð	Ðð 	�!Ø�1Ø�1Ø�AØ�AØ�QØ�RØ�CØ�Sð
€Oð0ð 0ð 0ð 0ð 0˜ñ 0ô 0ð 0ð #¨4°dÀDØ ¨#Ô*=Ø tð6ð 6ð 6ð 6ðpð ð ð
ð ð ð	ð 	ð 	ð!ð !ð !ðð ð ðð ð ð?ð ?ð ?ð(9ð 9ð 9ð
2ð 2ð 2ðB;ð ;ð ;ð;ð ;ð ;ðBð Bð BðPð Pð Pð1ð 1ð 1ð1ð 1ð 1ðIð Ið Ið Ið Ir(   r   c                 ó�  ‡ — ‰ j                              di ¦  «        }g }‰ j                              ¦   «         D ]�\  }}t          |t          ¦  «        rƒ|j        s||_        |j        |v r;||j                 |                     ¦   «         k    rŒUt          d|j        z  ¦  «        ‚|                     ¦   «         ||j        <   |                     |¦  «         Œž|sdS |‰ _	        d‰ j         v s	d‰ j         v r=|D ]:}|j
        |j        k    s|j        |j        k    rt          d‰ j        ›d�¦  «        ‚Œ;d„ }|‰ _        ˆ fd	„}|‰ _        dS )
z“
    Scans the given class for instances of Property and merges them
    into the classes __gproperties__ dict if it exists or adds it if not.
    Ú__gproperties__z0Property %s was already found in __gproperties__NÚdo_get_propertyÚdo_set_propertyzGObject subclass zl defines do_get/set_property and it also uses a property with a custom setter or getter. This is not allowedc                 óZ   — |j                              dd¦  «        }t          | |d ¦  «        S ©Nú-Ú_)r.   Úreplacer{   )r%   Úpspecr.   s      r&   Úobj_get_propertyz,install_properties.<locals>.obj_get_propertyˆ  s+   € ØŒz×!Ò! # sÑ+Ô+ˆÝ�t˜T 4Ñ(Ô(Ð(r(   c                 ó”   •— |j                              dd¦  «        }t          ‰|d ¦  «        }|r|                     | |¦  «         d S d S r—   )r.   rš   r{   rA   )r%   r›   rO   r.   ÚpropÚclss        €r&   Úobj_set_propertyz,install_properties.<locals>.obj_set_property�  sW   ø€ ØŒz×!Ò! # sÑ+Ô+ˆÝ�s˜D $Ñ'Ô'ˆØð 	#Ø�IŠI�d˜EÑ"Ô"Ð"Ð"Ð"ð	#ð 	#r(   )Ú__dict__rf   Úitemsr5   r   r.   r…   Ú
ValueErrorÚappendr“   rL   r>   rA   r?   r7   r)   r”   r•   )rŸ   ÚgpropertiesÚpropsr.   rž   rœ   r    s   `      r&   Úinstall_propertiesr§   b  s¤  ø€ ð
 ”,×"Ò"Ð#4°bÑ9Ô9€Kà€EØ”l×(Ò(Ñ*Ô*ð ð ‰
ˆˆdÝ�d�HÑ%Ô%ð 	ð ”9ð !Ø �”	ð Œy˜KÐ'Ð'Ø˜tœyÔ)¨T×-@Ò-@Ñ-BÔ-BÒBÐBØÝ Ð!SÐVZÔV_Ñ!_Ñ`Ô`Ð`Ø%)×%8Ò%8Ñ%:Ô%:ˆK˜œ	Ñ"Ø�LŠL˜ÑÔÐøàð Øˆà%€CÔà˜CœLÐ(Ð(Ð,=ÀÄÐ,MÐ,MØð 	%ð 	%ˆDØŒy˜DÔ0Ò0Ð0°D´IÀÔAUÒ4UÐ4UÝ�ið ”\�\�\ð$ñ%ô %ð %ð 5Vð)ð )ð )ð +€CÔð#ð #ð #ð #ð #ð
 +€CÔÐÐr(   N)&r   r   Ú
_constantsr   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#   r(   r&   ú<module>r©      s«  ðð( Ð Ð Ð Ð Ð ð7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð Œ^€
ØŒo€ØŒ<€ØŒ<€ØŒM€	ØŒM€	ØŒM€	ØŒ^€
ðxIð xIð xIð xIð xIˆvñ xIô xIð xIðv	0+ð 0+ð 0+ð 0+ð 0+r(   