fW$HddlmZGddeZGddeZdZdZy) )_gicveZdZdZGddeZd dZddejdddddfdZ d dZ d Z d d Z d Z y)SignalaObject which gives a nice API for creating and binding signals. :param name: Name of signal or callable closure when used as a decorator. :type name: str or callable :param callable func: Callable closure method. :param GObject.SignalFlags flags: Flags specifying when to run closure. :param type return_type: Return type of the Signal. :param list arg_types: List of argument types specifying the signals function signature :param str doc: Documentation of signal object. :param callable accumulator: Accumulator method with the signature: func(ihint, return_accu, handler_return, accu_data) -> boolean :param object accu_data: User data passed to the accumulator. :Example: .. code-block:: python class Spam(GObject.Object): velocity = 0 @GObject.Signal def pushed(self): self.velocity += 1 @GObject.Signal(flags=GObject.SignalFlags.RUN_LAST) def pulled(self): self.velocity -= 1 stomped = GObject.Signal('stomped', arg_types=(int,)) @GObject.Signal def annotated_signal(self, a:int, b:str): "Python3 annotation support for parameter types. def on_pushed(obj): print(obj) spam = Spam() spam.pushed.connect(on_pushed) spam.pushed.emit() c@eZdZdZdZdZdZdZdZdZ dZ d Z y ) Signal.BoundSignalz Temporary binding object which can be used for connecting signals without specifying the signal name string to connect. c.tj||SN)str__new__clsnameargskargss 2/usr/lib/python3/dist-packages/gi/_signalhelper.pyr zSignal.BoundSignal.__new__Ns;;sD) )cJtj|||_||_yr )r __init__signalgobj)selfrrs rrzSignal.BoundSignal.__init__Qs LL  DKDIrc d|zS)NzBoundSignal("%s")rs r__repr__zSignal.BoundSignal.__repr__Vs &- -rcV|jj|jg|i|S)zCall the signals closure.)rfuncrrrrs r__call__zSignal.BoundSignal.__call__Ys'#4;;##DII>>> >rcD|jj||g|i|S)z^Same as GObject.Object.connect except there is no need to specify the signal name.rconnect)rcallbackrrs rr"zSignal.BoundSignal.connect]s'%499$$T8DdDeD DrcP|jj|dz|z|g|i|S)a Same as GObject.Object.connect except there is no need to specify the signal name. In addition concats "::" to the signal name when connecting; for use with notifications like "notify" when a property changes. z::r!)rr#detailrrs rconnect_detailedz#Signal.BoundSignal.connect_detailedbs0 %499$$TD[6%98TdTeT Trc:|jj|y)z"Same as GObject.Object.disconnect.N)r disconnect)r handler_ids rr(zSignal.BoundSignal.disconnectjs II  ,rcT|jjt|g|i|S)z[Same as GObject.Object.emit except there is no need to specify the signal name.)remitr rs rr+zSignal.BoundSignal.emitns'"499>>#d)==D{{3%%rNc | t|r|}|r|s |j}tj||r|s|st |\}}| t }||_||_||_||_ ||_||_ ||_ yr ) r3r/r rget_signal_annotationstuplerflags return_type arg_types accumulator accu_data) rrrr7r8r9docr:r;s rrzSignal.__init__xs N>NPTP^P^__r)r1r )r,r-r.r/r r0r rSIGNAL_RUN_FIRSTrr@rrIrKrrrrrsQ0b(=c(=T& T1E1E!TrtW[#.0 h(d`rrceZdZdZdZy)SignalOverridea&Specialized sub-class of Signal which can be used as a decorator for overriding existing signals on GObjects. :Example: .. code-block:: python class MyWidget(Gtk.Widget): @GObject.SignalOverride def configure_event(self): pass cy)zReturns the string 'override'.overriderrs rrKzSignalOverride.get_signal_argssrN)r,r-r.r/rKrrrrNrNs  rrNct}d}t|drPddl}|j|tfdjD}dj vrj d}||fS)aAttempt pulling python 3 function annotations off of 'func' for use as a signals type information. Returns an ordered nested tuple of (return_type, (arg_type1, arg_type2, ...)). If the given function does not have annotations then (None, tuple()) is returned. N__annotations__c3XK|]!}|jvrj|#ywr ) annotations).0argspecs r z)get_signal_annotations..s16C D$4$44**3/6s'*return)r6hasattrinspectgetfullargspecrrU)rr9r8r\rXs @rr5r5sr IKt&'%%d+649966 t'' '**84K  !!rc|jjdi}i}|jjD]m\}}t|tst |}|s |}|j |}t|||||vrtd|z|||<|j||<o||_ |jD]K\}}|jd|jddz}t||r5t|||jMy)zAdds Signal instances on a GObject derived class into the '__gsignals__' dictionary to be picked up and registered as real GObject signals. __gsignals__z(Signal "%s" has already been registered.Ndo_-_)__dict__getitemsrCrr rIsetattr ValueErrorrKr_rreplacer[)r gsignals newsignalsrr signalNamefuncNames rinstall_signalsrms ||3HJ **, < f ff %VJ! T*T6*X% !Kd!RSS%+Jz "#)#9#9#;HZ  < C#((*4 f ;; "t||C55H3)Xv{{3 4rN)r1rr rrNr5rmrrrrns1([`S[`|V$"*4r