Hook#
- class Hook(*args, **kwargs)#
The Hook
struct represents a single hook function in a HookList
.
Methods#
- class Hook
- compare_ids(sibling: Hook) int #
Compares the ids of two
Hook
elements, returning a negative value if the second id is greater than the first.- Parameters:
sibling – a
Hook
to compare withnew_hook
- destroy(hook_list: HookList, hook_id: int) bool #
Destroys a
Hook
, given its ID.- Parameters:
hook_list – a
HookList
hook_id – a hook ID
- destroy_link(hook_list: HookList, hook: Hook) None #
Removes one
Hook
from aHookList
, marking it inactive and callingunref()
on it.
- free(hook_list: HookList, hook: Hook) None #
Calls the
HookList
finalize_hook
function if it exists, and frees the memory allocated for theHook
.
Fields#
- class Hook
- data#
Data which is passed to func when this hook is invoked
- flags#
Flags which are set for this hook. See
GHookFlagMask
for predefined flags
- func#
The function to call when this hook is invoked. The possible signatures for this function are
GHookFunc
andGHookCheckFunc
- hook_id#
The id of this hook, which is unique within its list
- next#
Pointer to the next hook in the list
- prev#
Pointer to the previous hook in the list
- ref_count#
The reference count of this hook