Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- gtkParseGetCachedItem :: (HasCallStack, MonadIO m, IsWidget a) => a -> m Menuitem
- gtkParseMenuStructure :: (HasCallStack, MonadIO m, IsWidget a) => a -> m Menuitem
- menuitemPropertyGetImage :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m Pixbuf
- menuitemPropertyGetShortcut :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m (Word32, [ModifierType])
- menuitemPropertySetImage :: (HasCallStack, MonadIO m, IsMenuitem a, IsPixbuf b) => a -> Text -> b -> m Bool
- menuitemPropertySetShortcut :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Word32 -> [ModifierType] -> m Bool
- menuitemPropertySetShortcutMenuitem :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuItem b) => a -> b -> m Bool
- menuitemPropertySetShortcutString :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m Bool
Methods
gtkParseGetCachedItem
gtkParseGetCachedItem Source #
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> a |
|
-> m Menuitem | Returns: A pointer to the cached item or NULL if it isn't there. |
The Dbusmenu GTK parser adds cached items on the various menu items throughout the tree. Sometimes it can be useful to get that cached item to use directly. This function will retrieve it for you.
gtkParseMenuStructure
gtkParseMenuStructure Source #
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> a | |
-> m Menuitem | Returns: A dbusmenu item representing the menu structure |
Goes through the GTK structures and turns them into the appropraite Dbusmenu structures along with setting up all the relationships between the objects. It also stores the dbusmenu items as a cache on the GTK items so that they'll be reused if necissary.
menuitemPropertyGetImage
menuitemPropertyGetImage Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> m Pixbuf | Returns: A pixbuf or |
This function looks on the menu item for a property by the
name of property
. If one exists it tries to turn it into
a Pixbuf
. It assumes that the property is a base64 encoded
PNG file like the one created by dbusmenu_menuite_property_set_image
.
menuitemPropertyGetShortcut
menuitemPropertyGetShortcut Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> m (Word32, [ModifierType]) |
This function gets a GTK shortcut as a key and a mask for use to set the accelerators.
menuitemPropertySetImage
menuitemPropertySetImage Source #
:: (HasCallStack, MonadIO m, IsMenuitem a, IsPixbuf b) | |
=> a |
|
-> Text |
|
-> b |
|
-> m Bool | Returns: Whether the function was able to set the property or not. |
This function takes the pixbuf that is stored in data
and
turns it into a base64 encoded PNG so that it can be placed
onto a standard Menuitem
property.
menuitemPropertySetShortcut
menuitemPropertySetShortcut Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Word32 |
|
-> [ModifierType] |
|
-> m Bool | Returns: Whether it was successful at setting the property. |
Takes the modifer described by key
and modifier
and places that into
the format sending across Dbus for shortcuts.
menuitemPropertySetShortcutMenuitem
menuitemPropertySetShortcutMenuitem Source #
:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuItem b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: Whether it was successful at setting the property. |
Takes the shortcut that is installed on a menu item and calls
dbusmenu_menuitem_property_set_shortcut
with it. It also sets
up listeners to watch it change.
menuitemPropertySetShortcutString
menuitemPropertySetShortcutString Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: Whether it was successful at setting the property. |
This function takes a GTK shortcut string as defined in
gtk_accelerator_parse
and turns that into the information
required to send it over DBusmenu.