GLib.Hook¶
Fields¶
Name | Type | Access | Description |
---|---|---|---|
data | object |
r/w | data which is passed to func when this hook is invoked |
destroy | GLib.DestroyNotify |
r/w | the default finalize_hook function of a GLib.HookList calls this member of the hook that is being finalized |
flags | int |
r/w | flags which are set for this hook. See GLib.HookFlagMask for predefined flags |
func | object |
r/w | the function to call when this hook is invoked. The possible signatures for this function are GLib.HookFunc and GLib.HookCheckFunc |
hook_id | int |
r/w | the id of this hook, which is unique within its list |
next | GLib.Hook |
r/w | pointer to the next hook in the list |
prev | GLib.Hook |
r/w | pointer to the previous hook in the list |
ref_count | int |
r/w | the reference count of this hook |
Methods¶
class | destroy_link (hook_list, hook) |
class | free (hook_list, hook) |
class | insert_before (hook_list, sibling, hook) |
class | prepend (hook_list, hook) |
class | unref (hook_list, hook) |
compare_ids (sibling) |
Details¶
-
class
GLib.
Hook
¶ The
GLib.Hook
struct represents a single hook function in aGLib.HookList
.-
classmethod
destroy_link
(hook_list, hook)[source]¶ Parameters: - hook_list (
GLib.HookList
) – aGLib.HookList
- hook (
GLib.Hook
) – theGLib.Hook
to remove
Removes one
GLib.Hook
from aGLib.HookList
, marking it inactive and callingGLib.Hook.unref
() on it.- hook_list (
-
classmethod
free
(hook_list, hook)[source]¶ Parameters: - hook_list (
GLib.HookList
) – aGLib.HookList
- hook (
GLib.Hook
) – theGLib.Hook
to free
Calls the
GLib.HookList
finalize_hook function if it exists, and frees the memory allocated for theGLib.Hook
.- hook_list (
-
classmethod
insert_before
(hook_list, sibling, hook)[source]¶ Parameters: - hook_list (
GLib.HookList
) – aGLib.HookList
- sibling (
GLib.Hook
orNone
) – theGLib.Hook
to insert the newGLib.Hook
before - hook (
GLib.Hook
) – theGLib.Hook
to insert
Inserts a
GLib.Hook
into aGLib.HookList
, before a givenGLib.Hook
.- hook_list (
-
classmethod
prepend
(hook_list, hook)[source]¶ Parameters: - hook_list (
GLib.HookList
) – aGLib.HookList
- hook (
GLib.Hook
) – theGLib.Hook
to add to the start of hook_list
Prepends a
GLib.Hook
on the start of aGLib.HookList
.- hook_list (
-
classmethod
unref
(hook_list, hook)[source]¶ Parameters: - hook_list (
GLib.HookList
) – aGLib.HookList
- hook (
GLib.Hook
) – theGLib.Hook
to unref
Decrements the reference count of a
GLib.Hook
. If the reference count falls to 0, theGLib.Hook
is removed from theGLib.HookList
andGLib.Hook.free
() is called to free it.- hook_list (
-
classmethod