GLib.Hook¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
data |
r/w |
data which is passed to func when this hook is invoked |
|
destroy |
r/w |
the default finalize_hook function of a |
|
flags |
r/w |
flags which are set for this hook. See |
|
func |
r/w |
the function to call when this hook is invoked. The possible signatures for this function are |
|
hook_id |
r/w |
the id of this hook, which is unique within its list |
|
next |
r/w |
pointer to the next hook in the list |
|
prev |
r/w |
pointer to the previous hook in the list |
|
ref_count |
r/w |
the reference count of this hook |
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
Details¶
- class GLib.Hook¶
The
GLib.Hookstruct represents a single hook function in aGLib.HookList.- classmethod destroy_link(hook_list, hook)[source]¶
- Parameters:
hook_list (
GLib.HookList) – aGLib.HookList
Removes one
GLib.Hookfrom aGLib.HookList, marking it inactive and callingGLib.Hook.unref() on it.
- classmethod free(hook_list, hook)[source]¶
- Parameters:
hook_list (
GLib.HookList) – aGLib.HookList
Calls the
GLib.HookListfinalize_hook function if it exists, and frees the memory allocated for theGLib.Hook.
- classmethod insert_before(hook_list, sibling, hook)[source]¶
- Parameters:
hook_list (
GLib.HookList) – aGLib.HookListsibling (
GLib.HookorNone) – theGLib.Hookto insert the newGLib.Hookbefore
Inserts a
GLib.Hookinto aGLib.HookList, before a givenGLib.Hook.
- classmethod insert_sorted(hook_list, hook, func)[source]¶
- Parameters:
hook_list (
GLib.HookList) – aGLib.HookListfunc (
GLib.HookCompareFunc) – the comparison function used to sort theGLib.Hookelements
Inserts a
GLib.Hookinto aGLib.HookList, sorted by the given function.
- classmethod prepend(hook_list, hook)[source]¶
- Parameters:
hook_list (
GLib.HookList) – aGLib.HookListhook (
GLib.Hook) – theGLib.Hookto add to the start of hook_list
Prepends a
GLib.Hookon the start of aGLib.HookList.
- classmethod unref(hook_list, hook)[source]¶
- Parameters:
hook_list (
GLib.HookList) – aGLib.HookList
Decrements the reference count of a
GLib.Hook. If the reference count falls to 0, theGLib.Hookis removed from theGLib.HookListandGLib.Hook.free() is called to free it.