+
    Ki]  c                   sh    ^ RI HtHtHtHtHt ^ RIHt  ! R R4      t]! R^ 4      t	 ! R R4      t
R# )    )CallableDictListOptionalTuple)schedule_at_idlec                   sX   a  ] tR t^t o RtV 3R lR lt]R 4       tV 3R lR ltRt	V t
R# )	NotificationRegistrationzRepresents a registered callback; can be used to remove the registration. Obtain this
by calling NotificationSource.register; a null-object that represent no registration
can be obtained via EMPTY_NOTIFICATION_REGISTRATION.c                s8   < V ^8  d   QhRS[ R,          RS[RR/# )   notification_sourceNotificationSourcecallback_idreturnN)r   intZformat__classdict__   "@/usr/lib/python3.14/site-packages/lutris/gui/widgets/__init__.py__annotate__%NotificationRegistration.__annotate__   s*     ' 'H5I,J 'Y\ 'ae '    c                s    Wn         W n        R # )N)r	   r   )selfr	   r   s   &&&r   __init__Z!NotificationRegistration.__init__   s    #6 &r   c                sp    V P                   ;'       d$    V P                  V P                   P                  9   # )zhTrue if this registration is still registered; if false it has been unregistered and
won't fire anymore.)r	   r   
_callbacksr      &r   is_registeredZ&NotificationRegistration.is_registered   s/     ''ccD,<,<@X@X@c@c,ccr   c                   < V ^8  d   QhRR/# r   r   N r   r   r   r   r      s     , ,D ,r   c                s    V P                   '       d:   V P                   P                  P                  V P                  R4       RV n         R# R# )z6Unregisters a callback that register() had registered.N)r	   r   popr   r   r   r   
unregisterZ#NotificationRegistration.unregister   s=    ###$$//33D4D4DdK'+D$ $r   )r   r	   N)__name__
__module____qualname____firstlineno____doc__r   propertyr   r   __static_attributes____classdictcell__r      @r   r   r      s4     <' ' d d
, ,r   r   Nc                   s   a  ] tR t^!t o RtV 3R lR lt]V 3R lR l4       tV 3R lR ltRV 3R lR	 llt	R
 t
RtV tR# )r
   a  A class to inform interested code of changes or of an event; these are often global objects,
but occasionally are attached to another object to avoid having to unregister handlers as much.

The fire() method may be passed arguments, and these are passed on to any handlers; often there's
a single argument which is the object (like a Game) that has experienced some event or change. This
handler can't return anything, because it is called at idle time, not immediately.
c                r   r   r   r   r   r   r   NotificationSource.__annotate__*   s     K K$ Kr   c                s0    / V n         ^V n        . V n        R# )   Nr   _next_callback_id_scheduled_callbacksr   r   r   r   ZNotificationSource.__init__*   s    ;=!"HJ!r   c                s    < V ^8  d   QhRS[ /# )r   r   )boolr   r   r   r   r*   0   s     % %d %r   c                s,    \        V P                  4      # )z$True if any handlers are registered.)r/   r   r   r   r   has_handlersZNotificationSource.has_handlers/   s     DOO$$r   c                r   r   r   r   r   r   r   r*   4   s     ' 't 'r   c                s    \        V P                  P                  4       R R7      pV F"  w  rEV P                  P	                  WAV34       K$  	  \        V P                  4       R# )zSignals that the thing, whatever it is, has happened. This does not invoke the callbacks
at once, but schedules the callbacks to run at idle time. This ensures handlers always run
on the UI thread, for safety.c                 s    V ^,          # )r+   r   )Ztr   r   Z<lambda>Z)NotificationSource.fire.<locals>.<lambda>8   s    1r   )ZkeyN)Zsortedr   Zvaluesr.   Zappendr   _notify)r   argskwargsZorderedcallbackZ	_prioritys   &*,   r   fireZNotificationSource.fire4   sO     //1~F#*H%%,,hf-EF $+&r   c                s,   < V ^8  d   QhRS[ RS[RS[/# )r   r4   priorityr   )r   r   r   r   r   r   r   r*   =   s#     ; ; ;S ;AY ;r   c                s    V P                   pW3V P                  V&   V ;P                   ^,          un         \        W4      # )at  Registers a callback to be called after the thing, whatever it is, has happened;
fire() schedules callbacks to be called at idle time on the main thread. The
callbacks are called in priority order.

Note that a callback will be kept alive until unregistered, and this can keep
large objects alive until then.

Returns registration object to use to unregister the callback.)r-   r   r   )r   r4   r6   r   s   &&& r   registerZNotificationSource.register=   s<     ,,(0';$!#'::r   c                sz    V P                   '       d)   V P                   P                  ^ 4      w  rpV! V/ VB  K:  R# )r    N)r.   r   )r   r4   r2   r3   s   &   r   r1   ZNotificationSource._notifyM   s;    '''%)%>%>%B%B1%E"HFd%f% (r   r,   N)r    )r    r!   r"   r#   r$   r   r%   r0   r5   r7   r1   r&   r'   r(   r)   r   r
   r
   !   sH     K K
 % %' '; ; & &r   r
   )Ztypingr   r   r   r   r   Zlutris.util.jobsr   r   ZEMPTY_NOTIFICATION_REGISTRATIONr
   r   r   r   <module>r8      s1    8 8 -, ,0 #;4"C /& /&r   