Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- Overloaded methods
- childAddPosition
- childAppend
- childDelete
- childFind
- childPrepend
- childReorder
- findId
- foreach
- getChildren
- getId
- getParent
- getPosition
- getPositionRealized
- getRoot
- handleEvent
- new
- newWithId
- propertiesCopy
- propertiesList
- propertyExist
- propertyGet
- propertyGetBool
- propertyGetByteArray
- propertyGetInt
- propertyGetVariant
- propertyRemove
- propertySet
- propertySetBool
- propertySetByteArray
- propertySetInt
- propertySetVariant
- sendAboutToShow
- setParent
- setRoot
- showToUser
- takeChildren
- unparent
- Properties
- Signals
This is the Object
based object that represents a menu
item. It gets created the same on both the client and
the server side and libdbusmenu-glib does the work of making
this object model appear on both sides of DBus. Simple
really, though through updates and people coming on and off
the bus it can lead to lots of fun complex scenarios.
Synopsis
- newtype Menuitem = Menuitem (ManagedPtr Menuitem)
- class (GObject o, IsDescendantOf Menuitem o) => IsMenuitem o
- toMenuitem :: (MonadIO m, IsMenuitem o) => o -> m Menuitem
- noMenuitem :: Maybe Menuitem
- menuitemChildAddPosition :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> Word32 -> m Bool
- menuitemChildAppend :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Bool
- menuitemChildDelete :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Bool
- menuitemChildFind :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Int32 -> m Menuitem
- menuitemChildPrepend :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Bool
- menuitemChildReorder :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> Word32 -> m Bool
- menuitemFindId :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Int32 -> m Menuitem
- menuitemForeach :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Ptr () -> Ptr () -> m ()
- menuitemGetChildren :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m [Menuitem]
- menuitemGetId :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m Int32
- menuitemGetParent :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m Menuitem
- menuitemGetPosition :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Word32
- menuitemGetPositionRealized :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Word32
- menuitemGetRoot :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m Bool
- menuitemHandleEvent :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> GVariant -> Word32 -> m ()
- menuitemNew :: (HasCallStack, MonadIO m) => m Menuitem
- menuitemNewWithId :: (HasCallStack, MonadIO m) => Int32 -> m Menuitem
- menuitemPropertiesCopy :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m (Map (Ptr ()) (Ptr ()))
- menuitemPropertiesList :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m [Text]
- menuitemPropertyExist :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m Bool
- menuitemPropertyGet :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m Text
- menuitemPropertyGetBool :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m Bool
- menuitemPropertyGetByteArray :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m ByteString
- menuitemPropertyGetInt :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m Int32
- menuitemPropertyGetVariant :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m GVariant
- menuitemPropertyRemove :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m ()
- menuitemPropertySet :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> Text -> m Bool
- menuitemPropertySetBool :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> Bool -> m Bool
- menuitemPropertySetByteArray :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> Word8 -> Word64 -> m Bool
- menuitemPropertySetInt :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> Int32 -> m Bool
- menuitemPropertySetVariant :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> GVariant -> m Bool
- menuitemSendAboutToShow :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Ptr () -> Ptr () -> m ()
- menuitemSetParent :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Bool
- menuitemSetRoot :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Bool -> m ()
- menuitemShowToUser :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Word32 -> m ()
- menuitemTakeChildren :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m [Menuitem]
- menuitemUnparent :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m Bool
- constructMenuitemId :: IsMenuitem o => Int32 -> IO (GValueConstruct o)
- getMenuitemId :: (MonadIO m, IsMenuitem o) => o -> m Int32
- type C_MenuitemAboutToShowCallback = Ptr () -> Ptr () -> IO CInt
- type MenuitemAboutToShowCallback = IO Bool
- afterMenuitemAboutToShow :: (IsMenuitem a, MonadIO m) => a -> MenuitemAboutToShowCallback -> m SignalHandlerId
- genClosure_MenuitemAboutToShow :: MonadIO m => MenuitemAboutToShowCallback -> m (GClosure C_MenuitemAboutToShowCallback)
- mk_MenuitemAboutToShowCallback :: C_MenuitemAboutToShowCallback -> IO (FunPtr C_MenuitemAboutToShowCallback)
- noMenuitemAboutToShowCallback :: Maybe MenuitemAboutToShowCallback
- onMenuitemAboutToShow :: (IsMenuitem a, MonadIO m) => a -> MenuitemAboutToShowCallback -> m SignalHandlerId
- wrap_MenuitemAboutToShowCallback :: MenuitemAboutToShowCallback -> C_MenuitemAboutToShowCallback
- type C_MenuitemChildAddedCallback = Ptr () -> Ptr Object -> Word32 -> Ptr () -> IO ()
- type MenuitemChildAddedCallback = Object -> Word32 -> IO ()
- afterMenuitemChildAdded :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildAddedCallback -> m SignalHandlerId
- genClosure_MenuitemChildAdded :: MonadIO m => MenuitemChildAddedCallback -> m (GClosure C_MenuitemChildAddedCallback)
- mk_MenuitemChildAddedCallback :: C_MenuitemChildAddedCallback -> IO (FunPtr C_MenuitemChildAddedCallback)
- noMenuitemChildAddedCallback :: Maybe MenuitemChildAddedCallback
- onMenuitemChildAdded :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildAddedCallback -> m SignalHandlerId
- wrap_MenuitemChildAddedCallback :: MenuitemChildAddedCallback -> C_MenuitemChildAddedCallback
- type C_MenuitemChildMovedCallback = Ptr () -> Ptr Object -> Word32 -> Word32 -> Ptr () -> IO ()
- type MenuitemChildMovedCallback = Object -> Word32 -> Word32 -> IO ()
- afterMenuitemChildMoved :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildMovedCallback -> m SignalHandlerId
- genClosure_MenuitemChildMoved :: MonadIO m => MenuitemChildMovedCallback -> m (GClosure C_MenuitemChildMovedCallback)
- mk_MenuitemChildMovedCallback :: C_MenuitemChildMovedCallback -> IO (FunPtr C_MenuitemChildMovedCallback)
- noMenuitemChildMovedCallback :: Maybe MenuitemChildMovedCallback
- onMenuitemChildMoved :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildMovedCallback -> m SignalHandlerId
- wrap_MenuitemChildMovedCallback :: MenuitemChildMovedCallback -> C_MenuitemChildMovedCallback
- type C_MenuitemChildRemovedCallback = Ptr () -> Ptr Object -> Ptr () -> IO ()
- type MenuitemChildRemovedCallback = Object -> IO ()
- afterMenuitemChildRemoved :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildRemovedCallback -> m SignalHandlerId
- genClosure_MenuitemChildRemoved :: MonadIO m => MenuitemChildRemovedCallback -> m (GClosure C_MenuitemChildRemovedCallback)
- mk_MenuitemChildRemovedCallback :: C_MenuitemChildRemovedCallback -> IO (FunPtr C_MenuitemChildRemovedCallback)
- noMenuitemChildRemovedCallback :: Maybe MenuitemChildRemovedCallback
- onMenuitemChildRemoved :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildRemovedCallback -> m SignalHandlerId
- wrap_MenuitemChildRemovedCallback :: MenuitemChildRemovedCallback -> C_MenuitemChildRemovedCallback
- type C_MenuitemEventCallback = Ptr () -> CString -> Ptr GVariant -> Word32 -> Ptr () -> IO CInt
- type MenuitemEventCallback = Text -> GVariant -> Word32 -> IO Bool
- afterMenuitemEvent :: (IsMenuitem a, MonadIO m) => a -> Maybe Text -> MenuitemEventCallback -> m SignalHandlerId
- genClosure_MenuitemEvent :: MonadIO m => MenuitemEventCallback -> m (GClosure C_MenuitemEventCallback)
- mk_MenuitemEventCallback :: C_MenuitemEventCallback -> IO (FunPtr C_MenuitemEventCallback)
- noMenuitemEventCallback :: Maybe MenuitemEventCallback
- onMenuitemEvent :: (IsMenuitem a, MonadIO m) => a -> Maybe Text -> MenuitemEventCallback -> m SignalHandlerId
- wrap_MenuitemEventCallback :: MenuitemEventCallback -> C_MenuitemEventCallback
- type C_MenuitemItemActivatedCallback = Ptr () -> Word32 -> Ptr () -> IO ()
- type MenuitemItemActivatedCallback = Word32 -> IO ()
- afterMenuitemItemActivated :: (IsMenuitem a, MonadIO m) => a -> MenuitemItemActivatedCallback -> m SignalHandlerId
- genClosure_MenuitemItemActivated :: MonadIO m => MenuitemItemActivatedCallback -> m (GClosure C_MenuitemItemActivatedCallback)
- mk_MenuitemItemActivatedCallback :: C_MenuitemItemActivatedCallback -> IO (FunPtr C_MenuitemItemActivatedCallback)
- noMenuitemItemActivatedCallback :: Maybe MenuitemItemActivatedCallback
- onMenuitemItemActivated :: (IsMenuitem a, MonadIO m) => a -> MenuitemItemActivatedCallback -> m SignalHandlerId
- wrap_MenuitemItemActivatedCallback :: MenuitemItemActivatedCallback -> C_MenuitemItemActivatedCallback
- type C_MenuitemPropertyChangedCallback = Ptr () -> CString -> Ptr GVariant -> Ptr () -> IO ()
- type MenuitemPropertyChangedCallback = Text -> GVariant -> IO ()
- afterMenuitemPropertyChanged :: (IsMenuitem a, MonadIO m) => a -> MenuitemPropertyChangedCallback -> m SignalHandlerId
- genClosure_MenuitemPropertyChanged :: MonadIO m => MenuitemPropertyChangedCallback -> m (GClosure C_MenuitemPropertyChangedCallback)
- mk_MenuitemPropertyChangedCallback :: C_MenuitemPropertyChangedCallback -> IO (FunPtr C_MenuitemPropertyChangedCallback)
- noMenuitemPropertyChangedCallback :: Maybe MenuitemPropertyChangedCallback
- onMenuitemPropertyChanged :: (IsMenuitem a, MonadIO m) => a -> MenuitemPropertyChangedCallback -> m SignalHandlerId
- wrap_MenuitemPropertyChangedCallback :: MenuitemPropertyChangedCallback -> C_MenuitemPropertyChangedCallback
- type C_MenuitemRealizedCallback = Ptr () -> Ptr () -> IO ()
- type MenuitemRealizedCallback = IO ()
- afterMenuitemRealized :: (IsMenuitem a, MonadIO m) => a -> MenuitemRealizedCallback -> m SignalHandlerId
- genClosure_MenuitemRealized :: MonadIO m => MenuitemRealizedCallback -> m (GClosure C_MenuitemRealizedCallback)
- mk_MenuitemRealizedCallback :: C_MenuitemRealizedCallback -> IO (FunPtr C_MenuitemRealizedCallback)
- noMenuitemRealizedCallback :: Maybe MenuitemRealizedCallback
- onMenuitemRealized :: (IsMenuitem a, MonadIO m) => a -> MenuitemRealizedCallback -> m SignalHandlerId
- wrap_MenuitemRealizedCallback :: MenuitemRealizedCallback -> C_MenuitemRealizedCallback
- type C_MenuitemShowToUserCallback = Ptr () -> Word32 -> Ptr () -> IO ()
- type MenuitemShowToUserCallback = Word32 -> IO ()
- afterMenuitemShowToUser :: (IsMenuitem a, MonadIO m) => a -> MenuitemShowToUserCallback -> m SignalHandlerId
- genClosure_MenuitemShowToUser :: MonadIO m => MenuitemShowToUserCallback -> m (GClosure C_MenuitemShowToUserCallback)
- mk_MenuitemShowToUserCallback :: C_MenuitemShowToUserCallback -> IO (FunPtr C_MenuitemShowToUserCallback)
- noMenuitemShowToUserCallback :: Maybe MenuitemShowToUserCallback
- onMenuitemShowToUser :: (IsMenuitem a, MonadIO m) => a -> MenuitemShowToUserCallback -> m SignalHandlerId
- wrap_MenuitemShowToUserCallback :: MenuitemShowToUserCallback -> C_MenuitemShowToUserCallback
Exported types
Memory-managed wrapper type.
Instances
Eq Menuitem Source # | |
GObject Menuitem Source # | |
Defined in GI.Dbusmenu.Objects.Menuitem gobjectType :: IO GType # | |
IsGValue Menuitem Source # | Convert |
HasParentTypes Menuitem Source # | |
Defined in GI.Dbusmenu.Objects.Menuitem | |
type ParentTypes Menuitem Source # | |
Defined in GI.Dbusmenu.Objects.Menuitem |
class (GObject o, IsDescendantOf Menuitem o) => IsMenuitem o Source #
Type class for types which can be safely cast to Menuitem
, for instance with toMenuitem
.
Instances
(GObject o, IsDescendantOf Menuitem o) => IsMenuitem o Source # | |
Defined in GI.Dbusmenu.Objects.Menuitem |
toMenuitem :: (MonadIO m, IsMenuitem o) => o -> m Menuitem Source #
Methods
Overloaded methods
childAddPosition
menuitemChildAddPosition Source #
:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) | |
=> a |
|
-> b |
|
-> Word32 |
|
-> m Bool | Returns: Whether |
Puts child
in the list of children for mi
at the location
specified in position
. If there is not enough entires available
then child
will be placed at the end of the list.
childAppend
:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: Whether the child has been added successfully. |
This function adds child
to the list of children on mi
at
the end of that list.
childDelete
:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: If we were able to delete |
This function removes child
from the children list of mi
. It does
not call g_object_unref
on child
.
childFind
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Int32 |
|
-> m Menuitem | Returns: The menu item with the ID |
Search the children of mi
to find one with the ID of id
.
If it doesn't exist then we return NULL
.
childPrepend
:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: Whether the child has been added successfully. |
This function adds child
to the list of children on mi
at
the beginning of that list.
childReorder
:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) | |
=> a |
|
-> b |
|
-> Word32 |
|
-> m Bool | Returns: Whether the move was successful. |
This function moves a child on the list of children. It is for a child that is already in the list, but simply needs a new location.
findId
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Int32 |
|
-> m Menuitem | Returns: The |
This function searchs the whole tree of children that
are attached to mi
. This could be quite a few nodes, all
the way down the tree. It is a depth first search.
foreach
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Ptr () |
|
-> Ptr () |
|
-> m () |
This calls the function func
on this menu item and all
of the children of this item. And their children. And
their children. And... you get the point. It will get
called on the whole tree.
getChildren
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> m [Menuitem] |
Returns simply the list of children that this menu item has. The list is valid until another child related function is called, where it might be changed.
getId
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> m Int32 | Returns: The ID of the |
Gets the unique ID for mi
.
getParent
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> m Menuitem | Returns: The parent of this menu item |
This function looks up the parent of mi
getPosition
:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) | |
=> a |
|
-> b |
|
-> m Word32 | Returns: The position of |
This function returns the position of the menu item mi
in the children of parent
. It will return zero if the
menu item can't be found.
getPositionRealized
menuitemGetPositionRealized Source #
:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) | |
=> a |
|
-> b |
|
-> m Word32 | Returns: The position of |
This function is very similar to dbusmenu_menuitem_get_position
except that it only counts in the children that have been realized.
getRoot
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> m Bool | Returns: |
This function returns the internal value of whether this is a root node or not.
handleEvent
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> GVariant |
|
-> Word32 |
|
-> m () |
This function is called to create an event. It is likely to be overrided by subclasses. The default menu item will respond to the activate signal and do:
Emits the Menuitem
::item-activate
signal on this
menu item. Called by server objects when they get the
appropriate DBus signals from the client.
If you subclass this function you should really think about calling the parent function unless you have a good reason not to.
new
:: (HasCallStack, MonadIO m) | |
=> m Menuitem | Returns: A newly allocated |
Create a new Menuitem
with all default values.
newWithId
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> m Menuitem | Returns: A newly allocated |
This creates a blank Menuitem
with a specific ID.
propertiesCopy
menuitemPropertiesCopy Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> m (Map (Ptr ()) (Ptr ())) | Returns: A brand new |
This function takes the properties of a Menuitem
and puts them into a HashTable
that is referenced by the
key of a string and has the value of a string. The hash
table may not have any entries if there aren't any or there
is an error in processing. It is the caller's responsibility
to destroy the created HashTable
.
propertiesList
menuitemPropertiesList Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> m [Text] | Returns: A list of strings or NULL if there are none. |
This functiong gets a list of the names of all the properties
that are set on this menu item. This data on the list is owned
by the menuitem but the list is not and should be freed using
g_list_free()
when the calling function is done with it.
propertyExist
menuitemPropertyExist Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: A boolean checking to see if the property is available |
Checkes to see if a particular property exists on mi
and
returns TRUE
if so.
propertyGet
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> m Text | Returns: A string with the value of the property
that shouldn't be free'd. Or |
Look up a property on mi
and return the value of it if
it exits. NULL
will be returned if the property doesn't
exist.
propertyGetBool
menuitemPropertyGetBool Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: The value of the property or |
Look up a property on mi
and return the value of it if
it exits. Returns FALSE
if the property doesn't exist.
propertyGetByteArray
menuitemPropertyGetByteArray Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> m ByteString | Returns: A byte array with the
value of the property that shouldn't be free'd. Or |
Look up a property on mi
and return the value of it if
it exits. NULL
will be returned if the property doesn't
exist.
propertyGetInt
menuitemPropertyGetInt Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> m Int32 | Returns: The value of the property or zero. |
Look up a property on mi
and return the value of it if
it exits. Returns zero if the property doesn't exist.
propertyGetVariant
menuitemPropertyGetVariant Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> m GVariant | Returns: A GVariant for the property. |
Look up a property on mi
and return the value of it if
it exits. NULL
will be returned if the property doesn't
exist.
propertyRemove
menuitemPropertyRemove Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> m () |
Removes a property from the menuitem.
propertySet
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m Bool | Returns: A boolean representing if the property value was set. |
Takes the pair of property
and value
and places them as a
property on mi
. If a property already exists by that name,
then the value is set to the new value. If not, the property
is added. If the value is changed or the property was previously
unset then the signal Menuitem
::prop-changed
will be
emitted by this function.
propertySetBool
menuitemPropertySetBool Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> Bool |
|
-> m Bool | Returns: A boolean representing if the property value was set. |
Takes a boolean value
and sets it on property
as a
property on mi
. If a property already exists by that name,
then the value is set to the new value. If not, the property
is added. If the value is changed or the property was previously
unset then the signal Menuitem
::prop-changed
will be
emitted by this function.
propertySetByteArray
menuitemPropertySetByteArray Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> Word8 |
|
-> Word64 |
|
-> m Bool | Returns: A boolean representing if the property value was set. |
Takes a byte array value
and sets it on property
as a
property on mi
. If a property already exists by that name,
then the value is set to the new value. If not, the property
is added. If the value is changed or the property was previously
unset then the signal Menuitem
::prop-changed
will be
emitted by this function.
propertySetInt
menuitemPropertySetInt Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> m Bool | Returns: A boolean representing if the property value was set. |
Takes a boolean value
and sets it on property
as a
property on mi
. If a property already exists by that name,
then the value is set to the new value. If not, the property
is added. If the value is changed or the property was previously
unset then the signal Menuitem
::prop-changed
will be
emitted by this function.
propertySetVariant
menuitemPropertySetVariant Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Text |
|
-> GVariant |
|
-> m Bool | Returns: A boolean representing if the property value was set. |
Takes the pair of property
and value
and places them as a
property on mi
. If a property already exists by that name,
then the value is set to the new value. If not, the property
is added. If the value is changed or the property was previously
unset then the signal Menuitem
::prop-changed
will be
emitted by this function.
sendAboutToShow
menuitemSendAboutToShow Source #
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Ptr () |
|
-> Ptr () |
|
-> m () |
This function is used to send the even that the submenu of this item is about to be shown. Callers to this event should delay showing the menu until their callback is called if possible.
setParent
:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: Whether the parent was set successfully |
Sets the parent of mi
to parent
. If mi
already
has a parent, then this call will fail. The parent will
be set automatically when using the usual methods to add a
child menuitem, so this function should not normally be
called directly
setRoot
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Bool |
|
-> m () |
This function sets the internal value of whether this is a root node or not.
showToUser
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> Word32 |
|
-> m () |
Signals that this menu item should be shown to the user. If this is server side the server will then take it and send it over the bus.
takeChildren
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> m [Menuitem] |
While the name sounds devious that's exactly what this function
does. It takes the list of children from the mi
and clears the
internal list. The calling function is now in charge of the ref's
on the children it has taken. A lot of responsibility involved
in taking children.
unparent
:: (HasCallStack, MonadIO m, IsMenuitem a) | |
=> a |
|
-> m Bool | Returns: Whether the menu item was unparented successfully |
Unparents the menu item mi
. If mi
doesn't have a
parent, then this call will fail. The menuitem will
be unparented automatically when using the usual methods
to delete a child menuitem, so this function should not
normally be called directly
Properties
id
No description available in the introspection data.
constructMenuitemId :: IsMenuitem o => Int32 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “id
” property. This is rarely needed directly, but it is used by new
.
getMenuitemId :: (MonadIO m, IsMenuitem o) => o -> m Int32 Source #
Get the value of the “id
” property.
When overloading is enabled, this is equivalent to
get
menuitem #id
Signals
aboutToShow
type C_MenuitemAboutToShowCallback = Ptr () -> Ptr () -> IO CInt Source #
Type for the callback on the (unwrapped) C side.
type MenuitemAboutToShowCallback = IO Bool Source #
Emitted when the submenu for this item is about to be shown
afterMenuitemAboutToShow :: (IsMenuitem a, MonadIO m) => a -> MenuitemAboutToShowCallback -> m SignalHandlerId Source #
Connect a signal handler for the aboutToShow signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
menuitem #aboutToShow callback
genClosure_MenuitemAboutToShow :: MonadIO m => MenuitemAboutToShowCallback -> m (GClosure C_MenuitemAboutToShowCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuitemAboutToShowCallback :: C_MenuitemAboutToShowCallback -> IO (FunPtr C_MenuitemAboutToShowCallback) Source #
Generate a function pointer callable from C code, from a C_MenuitemAboutToShowCallback
.
noMenuitemAboutToShowCallback :: Maybe MenuitemAboutToShowCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuitemAboutToShowCallback
onMenuitemAboutToShow :: (IsMenuitem a, MonadIO m) => a -> MenuitemAboutToShowCallback -> m SignalHandlerId Source #
Connect a signal handler for the aboutToShow signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
menuitem #aboutToShow callback
wrap_MenuitemAboutToShowCallback :: MenuitemAboutToShowCallback -> C_MenuitemAboutToShowCallback Source #
Wrap a MenuitemAboutToShowCallback
into a C_MenuitemAboutToShowCallback
.
childAdded
type C_MenuitemChildAddedCallback = Ptr () -> Ptr Object -> Word32 -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuitemChildAddedCallback Source #
= Object |
|
-> Word32 |
|
-> IO () |
Signaled when the child menuitem has been added to the parent.
afterMenuitemChildAdded :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildAddedCallback -> m SignalHandlerId Source #
Connect a signal handler for the childAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
menuitem #childAdded callback
genClosure_MenuitemChildAdded :: MonadIO m => MenuitemChildAddedCallback -> m (GClosure C_MenuitemChildAddedCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuitemChildAddedCallback :: C_MenuitemChildAddedCallback -> IO (FunPtr C_MenuitemChildAddedCallback) Source #
Generate a function pointer callable from C code, from a C_MenuitemChildAddedCallback
.
noMenuitemChildAddedCallback :: Maybe MenuitemChildAddedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuitemChildAddedCallback
onMenuitemChildAdded :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildAddedCallback -> m SignalHandlerId Source #
Connect a signal handler for the childAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
menuitem #childAdded callback
wrap_MenuitemChildAddedCallback :: MenuitemChildAddedCallback -> C_MenuitemChildAddedCallback Source #
Wrap a MenuitemChildAddedCallback
into a C_MenuitemChildAddedCallback
.
childMoved
type C_MenuitemChildMovedCallback = Ptr () -> Ptr Object -> Word32 -> Word32 -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuitemChildMovedCallback Source #
= Object |
|
-> Word32 |
|
-> Word32 |
|
-> IO () |
Signaled when the child menuitem has had its location in the list change.
afterMenuitemChildMoved :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildMovedCallback -> m SignalHandlerId Source #
Connect a signal handler for the childMoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
menuitem #childMoved callback
genClosure_MenuitemChildMoved :: MonadIO m => MenuitemChildMovedCallback -> m (GClosure C_MenuitemChildMovedCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuitemChildMovedCallback :: C_MenuitemChildMovedCallback -> IO (FunPtr C_MenuitemChildMovedCallback) Source #
Generate a function pointer callable from C code, from a C_MenuitemChildMovedCallback
.
noMenuitemChildMovedCallback :: Maybe MenuitemChildMovedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuitemChildMovedCallback
onMenuitemChildMoved :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildMovedCallback -> m SignalHandlerId Source #
Connect a signal handler for the childMoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
menuitem #childMoved callback
wrap_MenuitemChildMovedCallback :: MenuitemChildMovedCallback -> C_MenuitemChildMovedCallback Source #
Wrap a MenuitemChildMovedCallback
into a C_MenuitemChildMovedCallback
.
childRemoved
type C_MenuitemChildRemovedCallback = Ptr () -> Ptr Object -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuitemChildRemovedCallback Source #
Signaled when the child menuitem has been requested to
be removed from the parent. This signal is called when
it has been removed from the list but not yet had
g_object_unref
called on it.
afterMenuitemChildRemoved :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildRemovedCallback -> m SignalHandlerId Source #
Connect a signal handler for the childRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
menuitem #childRemoved callback
genClosure_MenuitemChildRemoved :: MonadIO m => MenuitemChildRemovedCallback -> m (GClosure C_MenuitemChildRemovedCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuitemChildRemovedCallback :: C_MenuitemChildRemovedCallback -> IO (FunPtr C_MenuitemChildRemovedCallback) Source #
Generate a function pointer callable from C code, from a C_MenuitemChildRemovedCallback
.
noMenuitemChildRemovedCallback :: Maybe MenuitemChildRemovedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuitemChildRemovedCallback
onMenuitemChildRemoved :: (IsMenuitem a, MonadIO m) => a -> MenuitemChildRemovedCallback -> m SignalHandlerId Source #
Connect a signal handler for the childRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
menuitem #childRemoved callback
wrap_MenuitemChildRemovedCallback :: MenuitemChildRemovedCallback -> C_MenuitemChildRemovedCallback Source #
Wrap a MenuitemChildRemovedCallback
into a C_MenuitemChildRemovedCallback
.
event
type C_MenuitemEventCallback = Ptr () -> CString -> Ptr GVariant -> Word32 -> Ptr () -> IO CInt Source #
Type for the callback on the (unwrapped) C side.
type MenuitemEventCallback Source #
= Text |
|
-> GVariant |
|
-> Word32 |
|
-> IO Bool |
Emitted when an event is passed through. The event is signalled after handle_event is called.
afterMenuitemEvent :: (IsMenuitem a, MonadIO m) => a -> Maybe Text -> MenuitemEventCallback -> m SignalHandlerId Source #
Connect a signal handler for the event signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
menuitem #event callback
This signal admits a optional parameter detail
.
If it's not Nothing
, we will connect to “event::detail
” instead.
genClosure_MenuitemEvent :: MonadIO m => MenuitemEventCallback -> m (GClosure C_MenuitemEventCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuitemEventCallback :: C_MenuitemEventCallback -> IO (FunPtr C_MenuitemEventCallback) Source #
Generate a function pointer callable from C code, from a C_MenuitemEventCallback
.
noMenuitemEventCallback :: Maybe MenuitemEventCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuitemEventCallback
onMenuitemEvent :: (IsMenuitem a, MonadIO m) => a -> Maybe Text -> MenuitemEventCallback -> m SignalHandlerId Source #
Connect a signal handler for the event signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
menuitem #event callback
This signal admits a optional parameter detail
.
If it's not Nothing
, we will connect to “event::detail
” instead.
wrap_MenuitemEventCallback :: MenuitemEventCallback -> C_MenuitemEventCallback Source #
Wrap a MenuitemEventCallback
into a C_MenuitemEventCallback
.
itemActivated
type C_MenuitemItemActivatedCallback = Ptr () -> Word32 -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuitemItemActivatedCallback Source #
Emitted on the objects on the server side when they are signaled on the client side.
afterMenuitemItemActivated :: (IsMenuitem a, MonadIO m) => a -> MenuitemItemActivatedCallback -> m SignalHandlerId Source #
Connect a signal handler for the itemActivated signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
menuitem #itemActivated callback
genClosure_MenuitemItemActivated :: MonadIO m => MenuitemItemActivatedCallback -> m (GClosure C_MenuitemItemActivatedCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuitemItemActivatedCallback :: C_MenuitemItemActivatedCallback -> IO (FunPtr C_MenuitemItemActivatedCallback) Source #
Generate a function pointer callable from C code, from a C_MenuitemItemActivatedCallback
.
noMenuitemItemActivatedCallback :: Maybe MenuitemItemActivatedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuitemItemActivatedCallback
onMenuitemItemActivated :: (IsMenuitem a, MonadIO m) => a -> MenuitemItemActivatedCallback -> m SignalHandlerId Source #
Connect a signal handler for the itemActivated signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
menuitem #itemActivated callback
wrap_MenuitemItemActivatedCallback :: MenuitemItemActivatedCallback -> C_MenuitemItemActivatedCallback Source #
Wrap a MenuitemItemActivatedCallback
into a C_MenuitemItemActivatedCallback
.
propertyChanged
type C_MenuitemPropertyChangedCallback = Ptr () -> CString -> Ptr GVariant -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuitemPropertyChangedCallback Source #
= Text |
|
-> GVariant |
|
-> IO () |
Emitted everytime a property on a menuitem is either updated or added.
afterMenuitemPropertyChanged :: (IsMenuitem a, MonadIO m) => a -> MenuitemPropertyChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the propertyChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
menuitem #propertyChanged callback
genClosure_MenuitemPropertyChanged :: MonadIO m => MenuitemPropertyChangedCallback -> m (GClosure C_MenuitemPropertyChangedCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuitemPropertyChangedCallback :: C_MenuitemPropertyChangedCallback -> IO (FunPtr C_MenuitemPropertyChangedCallback) Source #
Generate a function pointer callable from C code, from a C_MenuitemPropertyChangedCallback
.
noMenuitemPropertyChangedCallback :: Maybe MenuitemPropertyChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuitemPropertyChangedCallback
onMenuitemPropertyChanged :: (IsMenuitem a, MonadIO m) => a -> MenuitemPropertyChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the propertyChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
menuitem #propertyChanged callback
wrap_MenuitemPropertyChangedCallback :: MenuitemPropertyChangedCallback -> C_MenuitemPropertyChangedCallback Source #
Wrap a MenuitemPropertyChangedCallback
into a C_MenuitemPropertyChangedCallback
.
realized
type C_MenuitemRealizedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuitemRealizedCallback = IO () Source #
Emitted when the initial request for properties is complete on the item. If there is a type handler configured for the "type" parameter that will be executed before this is signaled.
afterMenuitemRealized :: (IsMenuitem a, MonadIO m) => a -> MenuitemRealizedCallback -> m SignalHandlerId Source #
Connect a signal handler for the realized signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
menuitem #realized callback
genClosure_MenuitemRealized :: MonadIO m => MenuitemRealizedCallback -> m (GClosure C_MenuitemRealizedCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuitemRealizedCallback :: C_MenuitemRealizedCallback -> IO (FunPtr C_MenuitemRealizedCallback) Source #
Generate a function pointer callable from C code, from a C_MenuitemRealizedCallback
.
noMenuitemRealizedCallback :: Maybe MenuitemRealizedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuitemRealizedCallback
onMenuitemRealized :: (IsMenuitem a, MonadIO m) => a -> MenuitemRealizedCallback -> m SignalHandlerId Source #
Connect a signal handler for the realized signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
menuitem #realized callback
wrap_MenuitemRealizedCallback :: MenuitemRealizedCallback -> C_MenuitemRealizedCallback Source #
Wrap a MenuitemRealizedCallback
into a C_MenuitemRealizedCallback
.
showToUser
type C_MenuitemShowToUserCallback = Ptr () -> Word32 -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuitemShowToUserCallback Source #
Signaled when the application would like the visualization of this menu item shown to the user. This usually requires going over the bus to get it done.
afterMenuitemShowToUser :: (IsMenuitem a, MonadIO m) => a -> MenuitemShowToUserCallback -> m SignalHandlerId Source #
Connect a signal handler for the showToUser signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
menuitem #showToUser callback
genClosure_MenuitemShowToUser :: MonadIO m => MenuitemShowToUserCallback -> m (GClosure C_MenuitemShowToUserCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuitemShowToUserCallback :: C_MenuitemShowToUserCallback -> IO (FunPtr C_MenuitemShowToUserCallback) Source #
Generate a function pointer callable from C code, from a C_MenuitemShowToUserCallback
.
noMenuitemShowToUserCallback :: Maybe MenuitemShowToUserCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuitemShowToUserCallback
onMenuitemShowToUser :: (IsMenuitem a, MonadIO m) => a -> MenuitemShowToUserCallback -> m SignalHandlerId Source #
Connect a signal handler for the showToUser signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
menuitem #showToUser callback