§
    Ètºf®  ã                   óò   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
  eedd¦  «        � ej        ¦   «           G d	„ d
ej        ¦  «        Z G d„ dej        ¦  «        Zddedeeef         fd„ZdgZdS )aÕ  
This module provides support for Twisted to interact with the glib
mainloop via GObject Introspection.

In order to use this support, simply do the following::

    from twisted.internet import gireactor
    gireactor.install()

If you wish to use a GApplication, register it with the reactor::

    from twisted.internet import reactor
    reactor.registerGApplication(app)

Then use twisted.internet APIs as usual.

On Python 3, pygobject v3.4 or later is required.
é    )ÚUnion)ÚGLib)Ú	_glibbase)ÚReactorAlreadyRunning)ÚruntimeÚthreads_initNc                   ó$   — e Zd ZdZdZdd„Zd„ ZdS )Ú	GIReactorz¥
    GObject-introspection event loop reactor.

    @ivar _gapplication: A C{Gio.Application} instance that was registered
        with C{registerGApplication}.
    NFc                 óR   — t           j                             | t          d ¦  «         d S ©N)r   ÚGlibReactorBaseÚ__init__r   )ÚselfÚuseGtks     úY/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/internet/gireactor.pyr   zGIReactor.__init__/   s#   € ÝÔ!×*Ò*¨4µ°tÑ<Ô<Ð<Ð<Ð<ó    c                 óÜ   ‡— | j         �t          d¦  «        ‚| j        rt          d¦  «        ‚t	          ‰d¦  «        st          d¦  «        ‚‰| _         ˆfd„}|| _        ‰j        | _        dS )aƒ  
        Register a C{Gio.Application} or C{Gtk.Application}, whose main loop
        will be used instead of the default one.

        We will C{hold} the application so it doesn't exit on its own. In
        versions of C{python-gi} 3.2 and later, we exit the event loop using
        the C{app.quit} method which overrides any holds. Older versions are
        not supported.
        Nz2Can't register more than one application instance.z5Can't register application after reactor was started.ÚquitzPApplication registration is not supported in versions of PyGObject prior to 3.2.c                  óZ   •— ‰                       ¦   «          ‰                      d ¦  «         d S r   )ÚholdÚrun)Úapps   €r   r   z+GIReactor.registerGApplication.<locals>.runI   s#   ø€ Ø�HŠH‰JŒJˆJØ�GŠG�D‰MŒMˆMˆMˆMr   )Ú_gapplicationÚRuntimeErrorÚ_startedr   ÚhasattrÚ_runr   Ú_crash)r   r   r   s    ` r   ÚregisterGApplicationzGIReactor.registerGApplication2   s    ø€ ð ÔÐ)ÝÐSÑTÔTÐTØŒ=ð 	Ý'ØGñô ð õ �s˜FÑ#Ô#ð 	Ýð7ñô ð ð !ˆÔð	ð 	ð 	ð 	ð 	ð ˆŒ	à”hˆŒˆˆr   ©F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   © r   r   r
   r
   $   sH   € € € € € ðð ð €Mð=ð =ð =ð =ðð ð ð ð r   r
   c                   ó2   ‡ — e Zd ZdZdˆ fd„	Zd„ Zd	d„Zˆ xZS )
ÚPortableGIReactorz<
    Portable GObject Introspection event loop reactor.
    Fc                 óZ   •— t          ¦   «                              t          d |¬¦  «         d S )N©r   )Úsuperr   r   )r   r   Ú	__class__s     €r   r   zPortableGIReactor.__init__W   s(   ø€ Ý‰Œ×Ò�˜t¨FÐÑ3Ô3Ð3Ð3Ð3r   c                 ó    — t          d¦  «        ‚)z‡
        Register a C{Gio.Application} or C{Gtk.Application}, whose main loop
        will be used instead of the default one.
        z3GApplication is not currently supported on Windows.)ÚNotImplementedError)r   r   s     r   r   z&PortableGIReactor.registerGApplicationZ   s   € õ
 "Ð"WÑXÔXÐXr   ÚreturnNc                 ó   — dS )z5
        For compatibility only. Do nothing.
        Nr%   )r   s    r   ÚsimulatezPortableGIReactor.simulatea   s   € € € r   r    )r.   N)r!   r"   r#   r$   r   r   r0   Ú__classcell__)r+   s   @r   r'   r'   R   sm   ø€ € € € € ðð ð4ð 4ð 4ð 4ð 4ð 4ðYð Yð Yðð ð ð ð ð ð ð r   r'   Fr   r.   c                 ó®   — t           j                             ¦   «         dk    rt          | ¬¦  «        }nt	          | ¬¦  «        }ddlm}  ||¦  «         |S )zÃ
    Configure the twisted mainloop to be run inside the glib mainloop.

    @param useGtk: A hint that the Gtk GUI will or will not be used.  Currently
        does not modify any behavior.
    Úposixr)   r   )ÚinstallReactor)r   ÚplatformÚgetTyper
   r'   Útwisted.internet.mainr4   )r   Úreactorr4   s      r   Úinstallr9   g   sg   € õ Ô×ÒÑ!Ô! WÒ,Ð,Ý 6Ð*Ñ*Ô*ˆˆå#¨6Ð2Ñ2Ô2ˆà4Ð4Ð4Ð4Ð4Ð4à€N�7ÑÔÐØ€Nr   r9   r    )r$   Útypingr   Úgi.repositoryr   Útwisted.internetr   Útwisted.internet.errorr   Útwisted.pythonr   Úgetattrr   r   r
   r'   Úboolr9   Ú__all__r%   r   r   ú<module>rB      s*  ððð ð( Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð à &Ð &Ð &Ð &Ð &Ð &Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø "Ð "Ð "Ð "Ð "Ð "à
€7ˆ4� Ñ&Ô&Ð2Ø€DÔÑÔÐð+ð +ð +ð +ð +�	Ô)ñ +ô +ð +ð\ð ð ð ð ˜	Ô1ñ ô ð ð*ð �Dð  U¨9Ð6GÐ+GÔ%Hð ð ð ð ð& ˆ+€€€r   