gi-dbusmenu-0.4.8: Dbusmenu bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Dbusmenu.Callbacks

Description

 
Synopsis

Signals

ClientTypeHandler

type C_ClientTypeHandler = Ptr Menuitem -> Ptr Menuitem -> Ptr Client -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type ClientTypeHandler Source #

Arguments

 = Menuitem

newitem: The Menuitem that was created

-> Menuitem

parent: The parent of newitem or NULL if none

-> Client

client: A pointer to the Client

-> IO Bool 

The type handler is called when a dbusmenu item is created with a matching type as setup in dbusmenu_client_add_type_handler

Return value: TRUE if the type has been handled. FALSE if this function was somehow unable to handle it.

type ClientTypeHandler_WithClosures Source #

Arguments

 = Menuitem

newitem: The Menuitem that was created

-> Menuitem

parent: The parent of newitem or NULL if none

-> Client

client: A pointer to the Client

-> Ptr ()

userData: The data you gave us

-> IO Bool 

The type handler is called when a dbusmenu item is created with a matching type as setup in dbusmenu_client_add_type_handler

Return value: TRUE if the type has been handled. FALSE if this function was somehow unable to handle it.

drop_closures_ClientTypeHandler :: ClientTypeHandler -> ClientTypeHandler_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_ClientTypeHandler Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b, IsClient c) 
=> FunPtr C_ClientTypeHandler 
-> a

newitem: The Menuitem that was created

-> b

parent: The parent of newitem or NULL if none

-> c

client: A pointer to the Client

-> Ptr ()

userData: The data you gave us

-> m Bool 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_ClientTypeHandler :: MonadIO m => ClientTypeHandler -> m (GClosure C_ClientTypeHandler) Source #

Wrap the callback into a GClosure.

mk_ClientTypeHandler :: C_ClientTypeHandler -> IO (FunPtr C_ClientTypeHandler) Source #

Generate a function pointer callable from C code, from a C_ClientTypeHandler.

noClientTypeHandler :: Maybe ClientTypeHandler Source #

A convenience synonym for Nothing :: Maybe ClientTypeHandler.

MenuitemAboutToShowCb

type C_MenuitemAboutToShowCb = Ptr Menuitem -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MenuitemAboutToShowCb Source #

Arguments

 = Menuitem

mi: Menu item that should be shown

-> IO () 

Callback prototype for a callback that is called when the menu should be shown.

type MenuitemAboutToShowCb_WithClosures Source #

Arguments

 = Menuitem

mi: Menu item that should be shown

-> Ptr ()

userData: Extra user data sent with the function

-> IO () 

Callback prototype for a callback that is called when the menu should be shown.

dynamic_MenuitemAboutToShowCb Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) 
=> FunPtr C_MenuitemAboutToShowCb 
-> a

mi: Menu item that should be shown

-> Ptr ()

userData: Extra user data sent with the function

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_MenuitemAboutToShowCb :: MonadIO m => MenuitemAboutToShowCb -> m (GClosure C_MenuitemAboutToShowCb) Source #

Wrap the callback into a GClosure.

mk_MenuitemAboutToShowCb :: C_MenuitemAboutToShowCb -> IO (FunPtr C_MenuitemAboutToShowCb) Source #

Generate a function pointer callable from C code, from a C_MenuitemAboutToShowCb.

noMenuitemAboutToShowCb :: Maybe MenuitemAboutToShowCb Source #

A convenience synonym for Nothing :: Maybe MenuitemAboutToShowCb.

MenuitemBuildvariantSlotT

type C_MenuitemBuildvariantSlotT = Ptr Menuitem -> CString -> IO (Ptr GVariant) Source #

Type for the callback on the (unwrapped) C side.

type MenuitemBuildvariantSlotT Source #

Arguments

 = Menuitem

mi: Menu item that should be built from

-> Maybe Text

properties: A list of properties that should be the only ones in the resulting variant structure

-> IO GVariant

Returns: A variant representing this item and its children

This is the function that is called to represent this menu item as a variant. Should call its own children.

dynamic_MenuitemBuildvariantSlotT Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) 
=> FunPtr C_MenuitemBuildvariantSlotT 
-> a

mi: Menu item that should be built from

-> Maybe Text

properties: A list of properties that should be the only ones in the resulting variant structure

-> m GVariant

Returns: A variant representing this item and its children

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_MenuitemBuildvariantSlotT :: C_MenuitemBuildvariantSlotT -> IO (FunPtr C_MenuitemBuildvariantSlotT) Source #

Generate a function pointer callable from C code, from a C_MenuitemBuildvariantSlotT.

noMenuitemBuildvariantSlotT :: Maybe MenuitemBuildvariantSlotT Source #

A convenience synonym for Nothing :: Maybe MenuitemBuildvariantSlotT.