Current File : //usr/lib/python3/dist-packages/gi/__pycache__/_signalhelper.cpython-312.pyc |
�
��fW$ � �H � d dl mZ G d� de� Z G d� de� Zd� Zd� Zy) � )�_gic �v � e Zd ZdZ G d� de� Zdd�Zddej dddddfd�Z d
d�Z
d � Zd
d
�Zd� Z
y)�Signala� Object 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 �@ � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zy
)�Signal.BoundSignalz�
Temporary binding object which can be used for connecting signals
without specifying the signal name string to connect.
c �. � t j | |� S �N)�str�__new__��cls�name�args�kargss �2/usr/lib/python3/dist-packages/gi/_signalhelper.pyr zSignal.BoundSignal.__new__N s � ��;�;�s�D�)�)� c �J � t j | � || _ || _ y r )r
�__init__�signal�gobj)�selfr r s r r zSignal.BoundSignal.__init__Q s � ��L�L��� �D�K��D�Ir c � � d| z S )NzBoundSignal("%s")� �r s r �__repr__zSignal.BoundSignal.__repr__V s
� �&��-�-r c �V � | j j | j g|��i |��S )zCall the signals closure.)r �funcr �r r r s r �__call__zSignal.BoundSignal.__call__Y s'