HookList#

class HookList(*args, **kwargs)#

The HookList struct represents a list of hook functions.

Methods#

class HookList
clear() None#

Removes all the Hook elements from a HookList.

init(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(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(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(may_recurse: bool, marshaller: Callable[[Hook, Any], None], marshal_data: Any = None) 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_data – data to pass to marshaller

marshal_check(may_recurse: bool, marshaller: Callable[[Hook, Any], bool], marshal_data: Any = None) 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

  • marshal_data – data to pass to marshaller

Fields#

class HookList
dummy#

Unused

dummy3#

Unused

finalize_hook#
The function to call to finalize a Hook element.

The default behaviour is to call the hooks destroy function

hook_size#

The size of the HookList elements, in bytes

hooks#

The first Hook element in the list

is_setup#

1 if the HookList has been initialized

seq_id#

The next free Hook id