gi-dbusmenu-0.4.14: Dbusmenu bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Dbusmenu.Callbacks

Contents

- Signals
  - ClientTypeHandler
  - MenuitemAboutToShowCb
  - MenuitemBuildvariantSlotT

Description

Synopsis

- type C_ClientTypeHandler = Ptr Menuitem -> Ptr Menuitem -> Ptr Client -> Ptr () -> IO CInt
- type ClientTypeHandler = Menuitem -> Menuitem -> Client -> IO Bool
- type ClientTypeHandler_WithClosures = Menuitem -> Menuitem -> Client -> Ptr () -> IO Bool
- drop_closures_ClientTypeHandler :: ClientTypeHandler -> ClientTypeHandler_WithClosures
- dynamic_ClientTypeHandler :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b, IsClient c) => FunPtr C_ClientTypeHandler -> a -> b -> c -> Ptr () -> m Bool
- genClosure_ClientTypeHandler :: MonadIO m => ClientTypeHandler -> m (GClosure C_ClientTypeHandler)
- mk_ClientTypeHandler :: C_ClientTypeHandler -> IO (FunPtr C_ClientTypeHandler)
- noClientTypeHandler :: Maybe ClientTypeHandler
- noClientTypeHandler_WithClosures :: Maybe ClientTypeHandler_WithClosures
- wrap_ClientTypeHandler :: Maybe (Ptr (FunPtr C_ClientTypeHandler)) -> ClientTypeHandler_WithClosures -> C_ClientTypeHandler
- type C_MenuitemAboutToShowCb = Ptr Menuitem -> Ptr () -> IO ()
- type MenuitemAboutToShowCb = Menuitem -> IO ()
- type MenuitemAboutToShowCb_WithClosures = Menuitem -> Ptr () -> IO ()
- drop_closures_MenuitemAboutToShowCb :: MenuitemAboutToShowCb -> MenuitemAboutToShowCb_WithClosures
- dynamic_MenuitemAboutToShowCb :: (HasCallStack, MonadIO m, IsMenuitem a) => FunPtr C_MenuitemAboutToShowCb -> a -> Ptr () -> m ()
- genClosure_MenuitemAboutToShowCb :: MonadIO m => MenuitemAboutToShowCb -> m (GClosure C_MenuitemAboutToShowCb)
- mk_MenuitemAboutToShowCb :: C_MenuitemAboutToShowCb -> IO (FunPtr C_MenuitemAboutToShowCb)
- noMenuitemAboutToShowCb :: Maybe MenuitemAboutToShowCb
- noMenuitemAboutToShowCb_WithClosures :: Maybe MenuitemAboutToShowCb_WithClosures
- wrap_MenuitemAboutToShowCb :: Maybe (Ptr (FunPtr C_MenuitemAboutToShowCb)) -> MenuitemAboutToShowCb_WithClosures -> C_MenuitemAboutToShowCb
- type C_MenuitemBuildvariantSlotT = Ptr Menuitem -> CString -> IO (Ptr GVariant)
- type MenuitemBuildvariantSlotT = Menuitem -> Maybe Text -> IO GVariant
- dynamic_MenuitemBuildvariantSlotT :: (HasCallStack, MonadIO m, IsMenuitem a) => FunPtr C_MenuitemBuildvariantSlotT -> a -> Maybe Text -> m GVariant
- genClosure_MenuitemBuildvariantSlotT :: MonadIO m => MenuitemBuildvariantSlotT -> m (GClosure C_MenuitemBuildvariantSlotT)
- mk_MenuitemBuildvariantSlotT :: C_MenuitemBuildvariantSlotT -> IO (FunPtr C_MenuitemBuildvariantSlotT)
- noMenuitemBuildvariantSlotT :: Maybe MenuitemBuildvariantSlotT
- wrap_MenuitemBuildvariantSlotT :: Maybe (Ptr (FunPtr C_MenuitemBuildvariantSlotT)) -> MenuitemBuildvariantSlotT -> C_MenuitemBuildvariantSlotT

# 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``.

noClientTypeHandler_WithClosures :: Maybe ClientTypeHandler_WithClosures Source #

A convenience synonym for ``Nothing` :: `Maybe` `ClientTypeHandler_WithClosures``.

wrap_ClientTypeHandler :: Maybe (Ptr (FunPtr C_ClientTypeHandler)) -> ClientTypeHandler_WithClosures -> C_ClientTypeHandler Source #

Wrap a `ClientTypeHandler` into a `C_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.

drop_closures_MenuitemAboutToShowCb :: MenuitemAboutToShowCb -> MenuitemAboutToShowCb_WithClosures Source #

A simple wrapper that ignores the closure arguments.

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``.

noMenuitemAboutToShowCb_WithClosures :: Maybe MenuitemAboutToShowCb_WithClosures Source #

A convenience synonym for ``Nothing` :: `Maybe` `MenuitemAboutToShowCb_WithClosures``.

wrap_MenuitemAboutToShowCb :: Maybe (Ptr (FunPtr C_MenuitemAboutToShowCb)) -> MenuitemAboutToShowCb_WithClosures -> C_MenuitemAboutToShowCb Source #

Wrap a `MenuitemAboutToShowCb` into a `C_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.

genClosure_MenuitemBuildvariantSlotT :: MonadIO m => MenuitemBuildvariantSlotT -> m (GClosure C_MenuitemBuildvariantSlotT) Source #

Wrap the callback into a `GClosure`.

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``.

wrap_MenuitemBuildvariantSlotT :: Maybe (Ptr (FunPtr C_MenuitemBuildvariantSlotT)) -> MenuitemBuildvariantSlotT -> C_MenuitemBuildvariantSlotT Source #

Wrap a `MenuitemBuildvariantSlotT` into a `C_MenuitemBuildvariantSlotT`.