gi-glib-2.0.23: GLib bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.GLib.Structs.Hook

Contents

Description

The tHook struct represents a single hook function in a tHookList.

Synopsis

Exported types

newtype Hook Source #

Memory-managed wrapper type.

Constructors

Hook (ManagedPtr Hook) 
Instances
Eq Hook Source # 
Instance details

Defined in GI.GLib.Structs.Hook

Methods

(==) :: Hook -> Hook -> Bool

(/=) :: Hook -> Hook -> Bool

WrappedPtr Hook Source # 
Instance details

Defined in GI.GLib.Structs.Hook

Methods

wrappedPtrCalloc :: IO (Ptr Hook)

wrappedPtrCopy :: Hook -> IO Hook

wrappedPtrFree :: Maybe (GDestroyNotify Hook)

tag ~ AttrSet => Constructible Hook tag Source # 
Instance details

Defined in GI.GLib.Structs.Hook

Methods

new :: MonadIO m => (ManagedPtr Hook -> Hook) -> [AttrOp Hook tag] -> m Hook

newZeroHook :: MonadIO m => m Hook Source #

Construct a Hook struct initialized to zero.

noHook :: Maybe Hook Source #

A convenience alias for Nothing :: Maybe Hook.

Methods

Overloaded methods

compareIds

hookCompareIds Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Hook

newHook: a tHook

-> Hook

sibling: a tHook to compare with newHook

-> m Int32

Returns: a value <= 0 if the id of sibling is >= the id of newHook

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

destroy

hookDestroy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HookList

hookList: a tHookList

-> CULong

hookId: a hook ID

-> m Bool

Returns: True if the tHook was found in the tHookList and destroyed

Destroys a tHook, given its ID.

destroyLink

hookDestroyLink Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HookList

hookList: a tHookList

-> Hook

hook: the tHook to remove

-> m () 

Removes one tHook from a tHookList, marking it inactive and calling hookUnref on it.

free

hookFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HookList

hookList: a tHookList

-> Hook

hook: the tHook to free

-> m () 

Calls the tHookList finalizeHook function if it exists, and frees the memory allocated for the tHook.

insertBefore

hookInsertBefore Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HookList

hookList: a tHookList

-> Maybe Hook

sibling: the tHook to insert the new tHook before

-> Hook

hook: the tHook to insert

-> m () 

Inserts a tHook into a tHookList, before a given tHook.

prepend

hookPrepend Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HookList

hookList: a tHookList

-> Hook

hook: the tHook to add to the start of hookList

-> m () 

Prepends a tHook on the start of a tHookList.

unref

hookUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HookList

hookList: a tHookList

-> Hook

hook: the tHook to unref

-> m () 

Decrements the reference count of a tHook. If the reference count falls to 0, the tHook is removed from the tHookList and hookFree is called to free it.

Properties

data

data which is passed to func when this hook is invoked

clearHookData :: MonadIO m => Hook -> m () Source #

Set the value of the “data” field to Nothing. When overloading is enabled, this is equivalent to

clear #data

getHookData :: MonadIO m => Hook -> m (Ptr ()) Source #

Get the value of the “data” field. When overloading is enabled, this is equivalent to

get hook #data

setHookData :: MonadIO m => Hook -> Ptr () -> m () Source #

Set the value of the “data” field. When overloading is enabled, this is equivalent to

set hook [ #data := value ]

destroy

the default finalizeHook function of a tHookList calls this member of the hook that is being finalized

clearHookDestroy :: MonadIO m => Hook -> m () Source #

Set the value of the “destroy” field to Nothing. When overloading is enabled, this is equivalent to

clear #destroy

getHookDestroy :: MonadIO m => Hook -> m (Maybe DestroyNotify) Source #

Get the value of the “destroy” field. When overloading is enabled, this is equivalent to

get hook #destroy

setHookDestroy :: MonadIO m => Hook -> FunPtr C_DestroyNotify -> m () Source #

Set the value of the “destroy” field. When overloading is enabled, this is equivalent to

set hook [ #destroy := value ]

flags

flags which are set for this hook. See tHookFlagMask for predefined flags

getHookFlags :: MonadIO m => Hook -> m Word32 Source #

Get the value of the “flags” field. When overloading is enabled, this is equivalent to

get hook #flags

setHookFlags :: MonadIO m => Hook -> Word32 -> m () Source #

Set the value of the “flags” field. When overloading is enabled, this is equivalent to

set hook [ #flags := value ]

func

the function to call when this hook is invoked. The possible signatures for this function are tHookFunc and tHookCheckFunc

clearHookFunc :: MonadIO m => Hook -> m () Source #

Set the value of the “func” field to Nothing. When overloading is enabled, this is equivalent to

clear #func

getHookFunc :: MonadIO m => Hook -> m (Ptr ()) Source #

Get the value of the “func” field. When overloading is enabled, this is equivalent to

get hook #func

setHookFunc :: MonadIO m => Hook -> Ptr () -> m () Source #

Set the value of the “func” field. When overloading is enabled, this is equivalent to

set hook [ #func := value ]

hookId

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

getHookHookId :: MonadIO m => Hook -> m CULong Source #

Get the value of the “hook_id” field. When overloading is enabled, this is equivalent to

get hook #hookId

setHookHookId :: MonadIO m => Hook -> CULong -> m () Source #

Set the value of the “hook_id” field. When overloading is enabled, this is equivalent to

set hook [ #hookId := value ]

next

pointer to the next hook in the list

clearHookNext :: MonadIO m => Hook -> m () Source #

Set the value of the “next” field to Nothing. When overloading is enabled, this is equivalent to

clear #next

getHookNext :: MonadIO m => Hook -> m (Maybe Hook) Source #

Get the value of the “next” field. When overloading is enabled, this is equivalent to

get hook #next

setHookNext :: MonadIO m => Hook -> Ptr Hook -> m () Source #

Set the value of the “next” field. When overloading is enabled, this is equivalent to

set hook [ #next := value ]

prev

pointer to the previous hook in the list

clearHookPrev :: MonadIO m => Hook -> m () Source #

Set the value of the “prev” field to Nothing. When overloading is enabled, this is equivalent to

clear #prev

getHookPrev :: MonadIO m => Hook -> m (Maybe Hook) Source #

Get the value of the “prev” field. When overloading is enabled, this is equivalent to

get hook #prev

setHookPrev :: MonadIO m => Hook -> Ptr Hook -> m () Source #

Set the value of the “prev” field. When overloading is enabled, this is equivalent to

set hook [ #prev := value ]

refCount

the reference count of this hook

getHookRefCount :: MonadIO m => Hook -> m Word32 Source #

Get the value of the “ref_count” field. When overloading is enabled, this is equivalent to

get hook #refCount

setHookRefCount :: MonadIO m => Hook -> Word32 -> m () Source #

Set the value of the “ref_count” field. When overloading is enabled, this is equivalent to

set hook [ #refCount := value ]