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.Hookstruct 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.Hookto remove
Removes one
GLib.Hookfrom 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.Hookto free
Calls the
GLib.HookListfinalize_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.HookorNone) – theGLib.Hookto insert the newGLib.Hookbefore - hook (
GLib.Hook) – theGLib.Hookto insert
Inserts a
GLib.Hookinto 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.Hookto add to the start of hook_list
Prepends a
GLib.Hookon the start of aGLib.HookList.- hook_list (
-
classmethod
unref(hook_list, hook)[source]¶ Parameters: - hook_list (
GLib.HookList) – aGLib.HookList - hook (
GLib.Hook) – theGLib.Hookto unref
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.- hook_list (
-
classmethod