Hook

The #GHook struct represents a single hook function in a #GHookList.

final
class Hook {}

Constructors

this
this(GHook* gHook, bool ownedRef)

Sets our main struct and passes it to the parent class.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

doref
alias doref = ref_
Undocumented in source.

Functions

compareIds
int compareIds(Hook sibling)

Compares the ids of two #GHook elements, returning a negative value if the second id is greater than the first.

getHookStruct
GHook* getHookStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

Properties

data
void* data [@property getter]
void* data [@property setter]

data which is passed to func when this hook is invoked

destroy
GDestroyNotify destroy [@property getter]
GDestroyNotify destroy [@property setter]

the default @finalize_hook function of a #GHookList calls this member of the hook that is being finalized

flags
uint flags [@property getter]
uint flags [@property setter]

flags which are set for this hook. See #GHookFlagMask for predefined flags

func
void* func [@property getter]
void* func [@property setter]

the function to call when this hook is invoked. The possible signatures for this function are #GHookFunc and #GHookCheckFunc

hookId
gulong hookId [@property getter]
gulong hookId [@property setter]

the id of this hook, which is unique within its list

next
Hook next [@property getter]
Hook next [@property setter]

pointer to the next hook in the list

prev
Hook prev [@property getter]
Hook prev [@property setter]

pointer to the previous hook in the list

refCount
uint refCount [@property getter]
uint refCount [@property setter]

the reference count of this hook

Static functions

alloc
Hook alloc(HookList hookList)

Allocates space for a #GHook and initializes it.

destroy
bool destroy(HookList hookList, gulong hookId)

Destroys a #GHook, given its ID.

destroyLink
void destroyLink(HookList hookList, Hook hook)

Removes one #GHook from a #GHookList, marking it inactive and calling g_hook_unref() on it.

find
Hook find(HookList hookList, bool needValids, GHookFindFunc func, void* data)

Finds a #GHook in a #GHookList using the given function to test for a match.

findData
Hook findData(HookList hookList, bool needValids, void* data)

Finds a #GHook in a #GHookList with the given data.

findFunc
Hook findFunc(HookList hookList, bool needValids, void* func)

Finds a #GHook in a #GHookList with the given function.

findFuncData
Hook findFuncData(HookList hookList, bool needValids, void* func, void* data)

Finds a #GHook in a #GHookList with the given function and data.

firstValid
Hook firstValid(HookList hookList, bool mayBeInCall)

Returns the first #GHook in a #GHookList which has not been destroyed. The reference count for the #GHook is incremented, so you must call g_hook_unref() to restore it when no longer needed. (Or call g_hook_next_valid() if you are stepping through the #GHookList.)

free
void free(HookList hookList, Hook hook)

Calls the #GHookList @finalize_hook function if it exists, and frees the memory allocated for the #GHook.

get
Hook get(HookList hookList, gulong hookId)

Returns the #GHook with the given id, or %NULL if it is not found.

insertBefore
void insertBefore(HookList hookList, Hook sibling, Hook hook)

Inserts a #GHook into a #GHookList, before a given #GHook.

insertSorted
void insertSorted(HookList hookList, Hook hook, GHookCompareFunc func)

Inserts a #GHook into a #GHookList, sorted by the given function.

nextValid
Hook nextValid(HookList hookList, Hook hook, bool mayBeInCall)

Returns the next #GHook in a #GHookList which has not been destroyed. The reference count for the #GHook is incremented, so you must call g_hook_unref() to restore it when no longer needed. (Or continue to call g_hook_next_valid() until %NULL is returned.)

prepend
void prepend(HookList hookList, Hook hook)

Prepends a #GHook on the start of a #GHookList.

ref_
Hook ref_(HookList hookList, Hook hook)

Increments the reference count for a #GHook.

unref
void unref(HookList hookList, Hook hook)

Decrements the reference count of a #GHook. If the reference count falls to 0, the #GHook is removed from the #GHookList and g_hook_free() is called to free it.

Variables

gHook
GHook* gHook;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta