Wp.EventHook

g GObject.Object GObject.Object Wp.EventHook Wp.EventHook GObject.Object->Wp.EventHook

Subclasses:

Wp.InterestEventHook

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

finish (res)

get_name ()

get_runs_after_hooks ()

get_runs_before_hooks ()

run (event, cancellable, callback, *callback_data)

runs_for_event (event)

Virtual Methods

Inherited:

GObject.Object (7)

do_finish (res)

do_run (event, cancellable, callback, callback_data)

do_runs_for_event (event)

Properties

Name

Type

Flags

Short Description

dispatcher

Wp.EventDispatcher

r

The associated event dispatcher

name

str

r/w/co

The hook name

runs-after-hooks

[str]

r/w/co

runs-after-hooks

runs-before-hooks

[str]

r/w/co

runs-before-hooks

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Wp.EventHook(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Wp.EventHookClass

The event hook is a structure that describes some executable action that an event dispatcher will run when a matching event has been received.

finish(res)
Parameters:

res (Gio.AsyncResult) – the async operation result

Raises:

GLib.Error

Returns:

False if there was an error, True otherwise

Return type:

bool

Finishes the async operation that was started by Wp.EventHook.run()

get_name()
Returns:

the event hook name

Return type:

str

Returns the name of the hook.

get_runs_after_hooks()
Returns:

a None-terminated array of hook names

Return type:

[str]

Returns the names of the hooks that should run before this hook, or in other words, this hook should run after them.

get_runs_before_hooks()
Returns:

a None-terminated array of hook names

Return type:

[str]

Returns the names of the hooks that should run after this hook, or in other words, this hook should run before them.

run(event, cancellable, callback, *callback_data)
Parameters:

Runs the hook on the given event.

runs_for_event(event)
Parameters:

event (Wp.Event) – the event

Returns:

True if the hook should be executed for the given event, False otherwise

Return type:

bool

Checks if the hook should be executed for a given event.

do_finish(res) virtual
Parameters:

res (Gio.AsyncResult) – the async operation result

Returns:

False if there was an error, True otherwise

Return type:

bool

Finishes the async operation that was started by Wp.EventHook.run()

do_run(event, cancellable, callback, callback_data) virtual
Parameters:

Runs the hook on the given event.

do_runs_for_event(event) virtual
Parameters:

event (Wp.Event) – the event

Returns:

True if the hook should be executed for the given event, False otherwise

Return type:

bool

Checks if the hook should be executed for a given event.

Property Details

Wp.EventHook.props.dispatcher
Name:

dispatcher

Type:

Wp.EventDispatcher

Default Value:

None

Flags:

READABLE

The associated event dispatcher

Wp.EventHook.props.name
Name:

name

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The hook name

Wp.EventHook.props.runs_after_hooks
Name:

runs-after-hooks

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

runs-after-hooks

Wp.EventHook.props.runs_before_hooks
Name:

runs-before-hooks

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

runs-before-hooks