Wp.Event

Fields

None

Methods

class

new (type, priority, properties, source, subject)

collect_hooks (dispatcher)

get_cancellable ()

get_data (key)

get_name ()

get_priority ()

get_properties ()

get_source ()

get_subject ()

new_hooks_iterator ()

ref ()

set_data (key, data)

stop_processing ()

unref ()

Details

class Wp.Event

Wp.Event describes an event, an event is an entity which can be pushed on to event stack and the event dispatcher is going to pick and dispatch it.

classmethod new(type, priority, properties, source, subject)
Parameters:
Returns:

the newly constructed event

Return type:

Wp.Event

Creates a new event.

collect_hooks(dispatcher)
Parameters:

dispatcher (Wp.EventDispatcher) – the event dispatcher

Returns:

True if at least one hook has been collected, False if no hooks run for this event or an error occurred

Return type:

bool

Collects all the hooks registered in the dispatcher that run for this self.

get_cancellable()
Returns:

the cancellable

Return type:

Gio.Cancellable

Returns the internal Gio.Cancellable that is used to track whether this event has been stopped by Wp.Event.stop_processing()

get_data(key)
Parameters:

key (str) – the key

Returns:

the data associated with key or None

Return type:

GObject.Value or None

Gets the data that was previously associated with key by Wp.Event.set_data()

get_name()
Returns:

the event name

Return type:

str

Gets the name of the event.

get_priority()
Returns:

the event priority

Return type:

int

Gets the priority of the event.

get_properties()
Returns:

the properties of the event

Return type:

Wp.Properties

Gets the properties of the Event.

get_source()
Returns:

the source of the event

Return type:

GObject.Object

Gets the Source Object of the Event.

get_subject()
Returns:

the subject of the event

Return type:

GObject.Object

Gets the Subject Object of the Event.

new_hooks_iterator()
Returns:

the new iterator

Return type:

Wp.Iterator

Returns an iterator that iterates over all the hooks that were collected by Wp.Event.collect_hooks()

ref()
Return type:

Wp.Event

set_data(key, data)
Parameters:
  • key (str) – the key to associate data with

  • data (GObject.Value or None) – the data element, or None to remove any previous data associated with this key

Stores data on the event, associated with the specified key.

This can be used to exchange arbitrary data between hooks that run for this event.

stop_processing()

Stops processing of this event; any further hooks will not be executed from this moment onwards and the event will be discarded from the stack.

unref()