Hook

The glib.Hook struct represents a single hook function in a glib.HookList

final
class Hook {
protected
bool ownedRef;
}

Constructors

this
this(GHook* gHook, bool ownedRef)

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

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

compareIds
int compareIds(Hook sibling)

Compares the ids of two glib.Hook 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 glib.HookList 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 glib.Hook and initializes it.

destroy
bool destroy(HookList hookList, gulong hookId)

Destroys a glib.Hook, given its ID.

destroyLink
void destroyLink(HookList hookList, Hook hook)

Removes one glib.Hook from a glib.HookList, marking it inactive and calling Hook.unref on it.

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

Finds a glib.Hook in a glib.HookList using the given function to test for a match.

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

Finds a glib.Hook in a glib.HookList with the given data.

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

Finds a glib.Hook in a glib.HookList with the given function.

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

Finds a glib.Hook in a glib.HookList with the given function and data.

firstValid
Hook firstValid(HookList hookList, bool mayBeInCall)

Returns the first glib.Hook in a glib.HookList which has not been destroyed. The reference count for the glib.Hook is incremented, so you must call Hook.unref to restore it when no longer needed. (Or call Hook.nextValid if you are stepping through the glib.HookList)

free
void free(HookList hookList, Hook hook)

Calls the glib.HookList finalize_hook function if it exists, and frees the memory allocated for the glib.Hook

get
Hook get(HookList hookList, gulong hookId)

Returns the glib.Hook with the given id, or NULL if it is not found.

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

Inserts a glib.Hook into a glib.HookList, before a given glib.Hook

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

Inserts a glib.Hook into a glib.HookList, sorted by the given function.

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

Returns the next glib.Hook in a glib.HookList which has not been destroyed. The reference count for the glib.Hook is incremented, so you must call Hook.unref to restore it when no longer needed. (Or continue to call Hook.nextValid until NULL is returned.)

prepend
void prepend(HookList hookList, Hook hook)

Prepends a glib.Hook on the start of a glib.HookList

ref_
Hook ref_(HookList hookList, Hook hook)

Increments the reference count for a glib.Hook

unref
void unref(HookList hookList, Hook hook)

Decrements the reference count of a glib.Hook If the reference count falls to 0, the glib.Hook is removed from the glib.HookList and Hook.free is called to free it.

Variables

gHook
GHook* gHook;

the main Gtk struct