Skip to content

GLib.HookList

record (struct)

The HookList struct represents a list of hook functions.

Methods

clear

def clear(self) -> None

Removes all the Hook elements from a HookList.

init

def init(self, hook_size: int) -> None

Initializes a HookList. This must be called before the HookList is used.

Parameters:

  • hook_size — the size of each element in the HookList, typically sizeof (GHook).

invoke

def invoke(self, may_recurse: bool) -> None

Calls all of the Hook functions in a HookList.

Parameters:

  • may_recurseTrue if functions which are already running (e.g. in another thread) can be called. If set to False, these are skipped

invoke_check

def invoke_check(self, may_recurse: bool) -> None

Calls all of the Hook functions in a HookList. Any function which returns False is removed from the HookList.

Parameters:

  • may_recurseTrue if functions which are already running (e.g. in another thread) can be called. If set to False, these are skipped

marshal

def marshal(self, may_recurse: bool, marshaller: HookMarshaller) -> None

Calls a function on each valid Hook.

Parameters:

  • may_recurseTrue if hooks which are currently running (e.g. in another thread) are considered valid. If set to False, these are skipped
  • marshaller — the function to call for each Hook

marshal_check

def marshal_check(self, may_recurse: bool, marshaller: HookCheckMarshaller) -> None

Calls a function on each valid Hook and destroys it if the function returns False.

Parameters:

  • may_recurseTrue if hooks which are currently running (e.g. in another thread) are considered valid. If set to False, these are skipped
  • marshaller — the function to call for each Hook

Properties

seq_id

seq_id: int  # read/write

hook_size

hook_size: int  # read/write

is_setup

is_setup: int  # read/write

hooks

hooks: Hook  # read/write

dummy3

dummy3: int  # read/write

finalize_hook

finalize_hook: HookFinalizeFunc  # read/write

dummy

dummy: list[int]  # read/write