GLib.HookList

Fields

Name

Type

Access

Description

dummy

[object]

r/w

unused

dummy3

object

r/w

unused

finalize_hook

GLib.HookFinalizeFunc

r/w

the function to call to finalize a GLib.Hook element. The default behaviour is to call the hooks destroy function

hook_size

int

r/w

the size of the GLib.HookList elements, in bytes

hooks

GLib.Hook

r/w

the first GLib.Hook element in the list

is_setup

int

r/w

1 if the GLib.HookList has been initialized

seq_id

int

r/w

the next free GLib.Hook id

Methods

clear ()

init (hook_size)

invoke (may_recurse)

invoke_check (may_recurse)

marshal (may_recurse, marshaller, *marshal_data)

marshal_check (may_recurse, marshaller, *marshal_data)

Details

class GLib.HookList

The GLib.HookList struct represents a list of hook functions.

clear()[source]

Removes all the GLib.Hook elements from a GLib.HookList.

init(hook_size)[source]
Parameters:

hook_size (int) – the size of each element in the GLib.HookList, typically sizeof (GHook).

Initializes a GLib.HookList. This must be called before the GLib.HookList is used.

invoke(may_recurse)[source]
Parameters:

may_recurse (bool) – True if functions which are already running (e.g. in another thread) can be called. If set to False, these are skipped

Calls all of the GLib.Hook functions in a GLib.HookList.

invoke_check(may_recurse)[source]
Parameters:

may_recurse (bool) – True if functions which are already running (e.g. in another thread) can be called. If set to False, these are skipped

Calls all of the GLib.Hook functions in a GLib.HookList. Any function which returns False is removed from the GLib.HookList.

marshal(may_recurse, marshaller, *marshal_data)[source]
Parameters:
  • may_recurse (bool) – True if hooks which are currently running (e.g. in another thread) are considered valid. If set to False, these are skipped

  • marshaller (GLib.HookMarshaller) – the function to call for each GLib.Hook

  • marshal_data (object or None) – data to pass to marshaller

Calls a function on each valid GLib.Hook.

marshal_check(may_recurse, marshaller, *marshal_data)[source]
Parameters:
  • may_recurse (bool) – True if hooks which are currently running (e.g. in another thread) are considered valid. If set to False, these are skipped

  • marshaller (GLib.HookCheckMarshaller) – the function to call for each GLib.Hook

  • marshal_data (object or None) – data to pass to marshaller

Calls a function on each valid GLib.Hook and destroys it if the function returns False.