{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc) A server which represents a sharing of a set of @/DbusmenuMenuitems/@ across DBus to a 'GI.Dbusmenu.Objects.Client.Client'. -} #define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \ && !defined(__HADDOCK_VERSION__)) module GI.Dbusmenu.Objects.Server ( -- * Exported types Server(..) , IsServer , toServer , noServer , -- * Methods -- ** getIconPaths #method:getIconPaths# #if ENABLE_OVERLOADING ServerGetIconPathsMethodInfo , #endif serverGetIconPaths , -- ** getStatus #method:getStatus# #if ENABLE_OVERLOADING ServerGetStatusMethodInfo , #endif serverGetStatus , -- ** getTextDirection #method:getTextDirection# #if ENABLE_OVERLOADING ServerGetTextDirectionMethodInfo , #endif serverGetTextDirection , -- ** new #method:new# serverNew , -- ** setIconPaths #method:setIconPaths# #if ENABLE_OVERLOADING ServerSetIconPathsMethodInfo , #endif serverSetIconPaths , -- ** setRoot #method:setRoot# #if ENABLE_OVERLOADING ServerSetRootMethodInfo , #endif serverSetRoot , -- ** setStatus #method:setStatus# #if ENABLE_OVERLOADING ServerSetStatusMethodInfo , #endif serverSetStatus , -- ** setTextDirection #method:setTextDirection# #if ENABLE_OVERLOADING ServerSetTextDirectionMethodInfo , #endif serverSetTextDirection , -- * Properties -- ** dbusObject #attr:dbusObject# {- | /No description available in the introspection data./ -} #if ENABLE_OVERLOADING ServerDbusObjectPropertyInfo , #endif constructServerDbusObject , getServerDbusObject , #if ENABLE_OVERLOADING serverDbusObject , #endif -- ** rootNode #attr:rootNode# {- | /No description available in the introspection data./ -} #if ENABLE_OVERLOADING ServerRootNodePropertyInfo , #endif clearServerRootNode , constructServerRootNode , getServerRootNode , #if ENABLE_OVERLOADING serverRootNode , #endif setServerRootNode , -- ** version #attr:version# {- | /No description available in the introspection data./ -} #if ENABLE_OVERLOADING ServerVersionPropertyInfo , #endif getServerVersion , #if ENABLE_OVERLOADING serverVersion , #endif -- * Signals -- ** itemActivationRequested #signal:itemActivationRequested# C_ServerItemActivationRequestedCallback , ServerItemActivationRequestedCallback , #if ENABLE_OVERLOADING ServerItemActivationRequestedSignalInfo , #endif afterServerItemActivationRequested , genClosure_ServerItemActivationRequested, mk_ServerItemActivationRequestedCallback, noServerItemActivationRequestedCallback , onServerItemActivationRequested , wrap_ServerItemActivationRequestedCallback, -- ** itemPropertyUpdated #signal:itemPropertyUpdated# C_ServerItemPropertyUpdatedCallback , ServerItemPropertyUpdatedCallback , #if ENABLE_OVERLOADING ServerItemPropertyUpdatedSignalInfo , #endif afterServerItemPropertyUpdated , genClosure_ServerItemPropertyUpdated , mk_ServerItemPropertyUpdatedCallback , noServerItemPropertyUpdatedCallback , onServerItemPropertyUpdated , wrap_ServerItemPropertyUpdatedCallback , -- ** itemUpdated #signal:itemUpdated# C_ServerItemUpdatedCallback , ServerItemUpdatedCallback , #if ENABLE_OVERLOADING ServerItemUpdatedSignalInfo , #endif afterServerItemUpdated , genClosure_ServerItemUpdated , mk_ServerItemUpdatedCallback , noServerItemUpdatedCallback , onServerItemUpdated , wrap_ServerItemUpdatedCallback , -- ** layoutUpdated #signal:layoutUpdated# C_ServerLayoutUpdatedCallback , ServerLayoutUpdatedCallback , #if ENABLE_OVERLOADING ServerLayoutUpdatedSignalInfo , #endif afterServerLayoutUpdated , genClosure_ServerLayoutUpdated , mk_ServerLayoutUpdatedCallback , noServerLayoutUpdatedCallback , onServerLayoutUpdated , wrap_ServerLayoutUpdatedCallback , ) where import Data.GI.Base.ShortPrelude import qualified Data.GI.Base.ShortPrelude as SP import qualified Data.GI.Base.Overloading as O import qualified Prelude as P import qualified Data.GI.Base.Attributes as GI.Attributes import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr import qualified Data.GI.Base.GClosure as B.GClosure import qualified Data.GI.Base.GError as B.GError import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GValue as B.GValue import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack import qualified Data.GI.Base.Properties as B.Properties import qualified Data.Text as T import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import qualified Foreign.Ptr as FP import qualified GHC.OverloadedLabels as OL import {-# SOURCE #-} qualified GI.Dbusmenu.Enums as Dbusmenu.Enums import {-# SOURCE #-} qualified GI.Dbusmenu.Objects.Menuitem as Dbusmenu.Menuitem import qualified GI.GObject.Objects.Object as GObject.Object -- | Memory-managed wrapper type. newtype Server = Server (ManagedPtr Server) foreign import ccall "dbusmenu_server_get_type" c_dbusmenu_server_get_type :: IO GType instance GObject Server where gobjectType = c_dbusmenu_server_get_type -- | Type class for types which can be safely cast to `Server`, for instance with `toServer`. class (GObject o, O.IsDescendantOf Server o) => IsServer o instance (GObject o, O.IsDescendantOf Server o) => IsServer o instance O.HasParentTypes Server type instance O.ParentTypes Server = '[GObject.Object.Object] -- | Cast to `Server`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`. toServer :: (MonadIO m, IsServer o) => o -> m Server toServer = liftIO . unsafeCastTo Server -- | A convenience alias for `Nothing` :: `Maybe` `Server`. noServer :: Maybe Server noServer = Nothing #if ENABLE_OVERLOADING type family ResolveServerMethod (t :: Symbol) (o :: *) :: * where ResolveServerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo ResolveServerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo ResolveServerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo ResolveServerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo ResolveServerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo ResolveServerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo ResolveServerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo ResolveServerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo ResolveServerMethod "ref" o = GObject.Object.ObjectRefMethodInfo ResolveServerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo ResolveServerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo ResolveServerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo ResolveServerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo ResolveServerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo ResolveServerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo ResolveServerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo ResolveServerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo ResolveServerMethod "getIconPaths" o = ServerGetIconPathsMethodInfo ResolveServerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo ResolveServerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo ResolveServerMethod "getStatus" o = ServerGetStatusMethodInfo ResolveServerMethod "getTextDirection" o = ServerGetTextDirectionMethodInfo ResolveServerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo ResolveServerMethod "setIconPaths" o = ServerSetIconPathsMethodInfo ResolveServerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo ResolveServerMethod "setRoot" o = ServerSetRootMethodInfo ResolveServerMethod "setStatus" o = ServerSetStatusMethodInfo ResolveServerMethod "setTextDirection" o = ServerSetTextDirectionMethodInfo ResolveServerMethod l o = O.MethodResolutionFailed l o instance (info ~ ResolveServerMethod t Server, O.MethodInfo info Server p) => OL.IsLabel t (Server -> p) where #if MIN_VERSION_base(4,10,0) fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #else fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #endif #endif -- signal Server::item-activation-requested {- | This is signaled when a menuitem under this server sends its activate signal. -} type ServerItemActivationRequestedCallback = Int32 {- ^ /@arg1@/: The ID of the parent for this update. -} -> Word32 {- ^ /@arg2@/: The timestamp of when the event happened -} -> IO () -- | A convenience synonym for @`Nothing` :: `Maybe` `ServerItemActivationRequestedCallback`@. noServerItemActivationRequestedCallback :: Maybe ServerItemActivationRequestedCallback noServerItemActivationRequestedCallback = Nothing -- | Type for the callback on the (unwrapped) C side. type C_ServerItemActivationRequestedCallback = Ptr () -> -- object Int32 -> Word32 -> Ptr () -> -- user_data IO () -- | Generate a function pointer callable from C code, from a `C_ServerItemActivationRequestedCallback`. foreign import ccall "wrapper" mk_ServerItemActivationRequestedCallback :: C_ServerItemActivationRequestedCallback -> IO (FunPtr C_ServerItemActivationRequestedCallback) -- | Wrap the callback into a `GClosure`. genClosure_ServerItemActivationRequested :: MonadIO m => ServerItemActivationRequestedCallback -> m (GClosure C_ServerItemActivationRequestedCallback) genClosure_ServerItemActivationRequested cb = liftIO $ do let cb' = wrap_ServerItemActivationRequestedCallback cb mk_ServerItemActivationRequestedCallback cb' >>= B.GClosure.newGClosure -- | Wrap a `ServerItemActivationRequestedCallback` into a `C_ServerItemActivationRequestedCallback`. wrap_ServerItemActivationRequestedCallback :: ServerItemActivationRequestedCallback -> C_ServerItemActivationRequestedCallback wrap_ServerItemActivationRequestedCallback _cb _ arg1 arg2 _ = do _cb arg1 arg2 {- | Connect a signal handler for the “@item-activation-requested@” signal, to be run before the default handler. When is enabled, this is equivalent to @ 'Data.GI.Base.Signals.on' server #itemActivationRequested callback @ -} onServerItemActivationRequested :: (IsServer a, MonadIO m) => a -> ServerItemActivationRequestedCallback -> m SignalHandlerId onServerItemActivationRequested obj cb = liftIO $ do let cb' = wrap_ServerItemActivationRequestedCallback cb cb'' <- mk_ServerItemActivationRequestedCallback cb' connectSignalFunPtr obj "item-activation-requested" cb'' SignalConnectBefore {- | Connect a signal handler for the “@item-activation-requested@” signal, to be run after the default handler. When is enabled, this is equivalent to @ 'Data.GI.Base.Signals.after' server #itemActivationRequested callback @ -} afterServerItemActivationRequested :: (IsServer a, MonadIO m) => a -> ServerItemActivationRequestedCallback -> m SignalHandlerId afterServerItemActivationRequested obj cb = liftIO $ do let cb' = wrap_ServerItemActivationRequestedCallback cb cb'' <- mk_ServerItemActivationRequestedCallback cb' connectSignalFunPtr obj "item-activation-requested" cb'' SignalConnectAfter -- signal Server::item-property-updated {- | /No description available in the introspection data./ -} type ServerItemPropertyUpdatedCallback = Int32 -> T.Text -> GVariant -> IO () -- | A convenience synonym for @`Nothing` :: `Maybe` `ServerItemPropertyUpdatedCallback`@. noServerItemPropertyUpdatedCallback :: Maybe ServerItemPropertyUpdatedCallback noServerItemPropertyUpdatedCallback = Nothing -- | Type for the callback on the (unwrapped) C side. type C_ServerItemPropertyUpdatedCallback = Ptr () -> -- object Int32 -> CString -> Ptr GVariant -> Ptr () -> -- user_data IO () -- | Generate a function pointer callable from C code, from a `C_ServerItemPropertyUpdatedCallback`. foreign import ccall "wrapper" mk_ServerItemPropertyUpdatedCallback :: C_ServerItemPropertyUpdatedCallback -> IO (FunPtr C_ServerItemPropertyUpdatedCallback) -- | Wrap the callback into a `GClosure`. genClosure_ServerItemPropertyUpdated :: MonadIO m => ServerItemPropertyUpdatedCallback -> m (GClosure C_ServerItemPropertyUpdatedCallback) genClosure_ServerItemPropertyUpdated cb = liftIO $ do let cb' = wrap_ServerItemPropertyUpdatedCallback cb mk_ServerItemPropertyUpdatedCallback cb' >>= B.GClosure.newGClosure -- | Wrap a `ServerItemPropertyUpdatedCallback` into a `C_ServerItemPropertyUpdatedCallback`. wrap_ServerItemPropertyUpdatedCallback :: ServerItemPropertyUpdatedCallback -> C_ServerItemPropertyUpdatedCallback wrap_ServerItemPropertyUpdatedCallback _cb _ object p0 p1 _ = do p0' <- cstringToText p0 p1' <- B.GVariant.newGVariantFromPtr p1 _cb object p0' p1' {- | Connect a signal handler for the “@item-property-updated@” signal, to be run before the default handler. When is enabled, this is equivalent to @ 'Data.GI.Base.Signals.on' server #itemPropertyUpdated callback @ -} onServerItemPropertyUpdated :: (IsServer a, MonadIO m) => a -> ServerItemPropertyUpdatedCallback -> m SignalHandlerId onServerItemPropertyUpdated obj cb = liftIO $ do let cb' = wrap_ServerItemPropertyUpdatedCallback cb cb'' <- mk_ServerItemPropertyUpdatedCallback cb' connectSignalFunPtr obj "item-property-updated" cb'' SignalConnectBefore {- | Connect a signal handler for the “@item-property-updated@” signal, to be run after the default handler. When is enabled, this is equivalent to @ 'Data.GI.Base.Signals.after' server #itemPropertyUpdated callback @ -} afterServerItemPropertyUpdated :: (IsServer a, MonadIO m) => a -> ServerItemPropertyUpdatedCallback -> m SignalHandlerId afterServerItemPropertyUpdated obj cb = liftIO $ do let cb' = wrap_ServerItemPropertyUpdatedCallback cb cb'' <- mk_ServerItemPropertyUpdatedCallback cb' connectSignalFunPtr obj "item-property-updated" cb'' SignalConnectAfter -- signal Server::item-updated {- | /No description available in the introspection data./ -} type ServerItemUpdatedCallback = Int32 -> IO () -- | A convenience synonym for @`Nothing` :: `Maybe` `ServerItemUpdatedCallback`@. noServerItemUpdatedCallback :: Maybe ServerItemUpdatedCallback noServerItemUpdatedCallback = Nothing -- | Type for the callback on the (unwrapped) C side. type C_ServerItemUpdatedCallback = Ptr () -> -- object Int32 -> Ptr () -> -- user_data IO () -- | Generate a function pointer callable from C code, from a `C_ServerItemUpdatedCallback`. foreign import ccall "wrapper" mk_ServerItemUpdatedCallback :: C_ServerItemUpdatedCallback -> IO (FunPtr C_ServerItemUpdatedCallback) -- | Wrap the callback into a `GClosure`. genClosure_ServerItemUpdated :: MonadIO m => ServerItemUpdatedCallback -> m (GClosure C_ServerItemUpdatedCallback) genClosure_ServerItemUpdated cb = liftIO $ do let cb' = wrap_ServerItemUpdatedCallback cb mk_ServerItemUpdatedCallback cb' >>= B.GClosure.newGClosure -- | Wrap a `ServerItemUpdatedCallback` into a `C_ServerItemUpdatedCallback`. wrap_ServerItemUpdatedCallback :: ServerItemUpdatedCallback -> C_ServerItemUpdatedCallback wrap_ServerItemUpdatedCallback _cb _ object _ = do _cb object {- | Connect a signal handler for the “@item-updated@” signal, to be run before the default handler. When is enabled, this is equivalent to @ 'Data.GI.Base.Signals.on' server #itemUpdated callback @ -} onServerItemUpdated :: (IsServer a, MonadIO m) => a -> ServerItemUpdatedCallback -> m SignalHandlerId onServerItemUpdated obj cb = liftIO $ do let cb' = wrap_ServerItemUpdatedCallback cb cb'' <- mk_ServerItemUpdatedCallback cb' connectSignalFunPtr obj "item-updated" cb'' SignalConnectBefore {- | Connect a signal handler for the “@item-updated@” signal, to be run after the default handler. When is enabled, this is equivalent to @ 'Data.GI.Base.Signals.after' server #itemUpdated callback @ -} afterServerItemUpdated :: (IsServer a, MonadIO m) => a -> ServerItemUpdatedCallback -> m SignalHandlerId afterServerItemUpdated obj cb = liftIO $ do let cb' = wrap_ServerItemUpdatedCallback cb cb'' <- mk_ServerItemUpdatedCallback cb' connectSignalFunPtr obj "item-updated" cb'' SignalConnectAfter -- signal Server::layout-updated {- | This signal is emitted any time the layout of the menuitems under this server is changed. -} type ServerLayoutUpdatedCallback = Word32 {- ^ /@arg1@/: A revision number representing which revision the update represents itself as. -} -> Int32 {- ^ /@arg2@/: The ID of the parent for this update. -} -> IO () -- | A convenience synonym for @`Nothing` :: `Maybe` `ServerLayoutUpdatedCallback`@. noServerLayoutUpdatedCallback :: Maybe ServerLayoutUpdatedCallback noServerLayoutUpdatedCallback = Nothing -- | Type for the callback on the (unwrapped) C side. type C_ServerLayoutUpdatedCallback = Ptr () -> -- object Word32 -> Int32 -> Ptr () -> -- user_data IO () -- | Generate a function pointer callable from C code, from a `C_ServerLayoutUpdatedCallback`. foreign import ccall "wrapper" mk_ServerLayoutUpdatedCallback :: C_ServerLayoutUpdatedCallback -> IO (FunPtr C_ServerLayoutUpdatedCallback) -- | Wrap the callback into a `GClosure`. genClosure_ServerLayoutUpdated :: MonadIO m => ServerLayoutUpdatedCallback -> m (GClosure C_ServerLayoutUpdatedCallback) genClosure_ServerLayoutUpdated cb = liftIO $ do let cb' = wrap_ServerLayoutUpdatedCallback cb mk_ServerLayoutUpdatedCallback cb' >>= B.GClosure.newGClosure -- | Wrap a `ServerLayoutUpdatedCallback` into a `C_ServerLayoutUpdatedCallback`. wrap_ServerLayoutUpdatedCallback :: ServerLayoutUpdatedCallback -> C_ServerLayoutUpdatedCallback wrap_ServerLayoutUpdatedCallback _cb _ arg1 arg2 _ = do _cb arg1 arg2 {- | Connect a signal handler for the “@layout-updated@” signal, to be run before the default handler. When is enabled, this is equivalent to @ 'Data.GI.Base.Signals.on' server #layoutUpdated callback @ -} onServerLayoutUpdated :: (IsServer a, MonadIO m) => a -> ServerLayoutUpdatedCallback -> m SignalHandlerId onServerLayoutUpdated obj cb = liftIO $ do let cb' = wrap_ServerLayoutUpdatedCallback cb cb'' <- mk_ServerLayoutUpdatedCallback cb' connectSignalFunPtr obj "layout-updated" cb'' SignalConnectBefore {- | Connect a signal handler for the “@layout-updated@” signal, to be run after the default handler. When is enabled, this is equivalent to @ 'Data.GI.Base.Signals.after' server #layoutUpdated callback @ -} afterServerLayoutUpdated :: (IsServer a, MonadIO m) => a -> ServerLayoutUpdatedCallback -> m SignalHandlerId afterServerLayoutUpdated obj cb = liftIO $ do let cb' = wrap_ServerLayoutUpdatedCallback cb cb'' <- mk_ServerLayoutUpdatedCallback cb' connectSignalFunPtr obj "layout-updated" cb'' SignalConnectAfter -- VVV Prop "dbus-object" -- Type: TBasicType TUTF8 -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly] -- Nullable: (Nothing,Nothing) {- | Get the value of the “@dbus-object@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' server #dbusObject @ -} getServerDbusObject :: (MonadIO m, IsServer o) => o -> m (Maybe T.Text) getServerDbusObject obj = liftIO $ B.Properties.getObjectPropertyString obj "dbus-object" {- | Construct a `GValueConstruct` with valid value for the “@dbus-object@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`. -} constructServerDbusObject :: (IsServer o) => T.Text -> IO (GValueConstruct o) constructServerDbusObject val = B.Properties.constructObjectPropertyString "dbus-object" (Just val) #if ENABLE_OVERLOADING data ServerDbusObjectPropertyInfo instance AttrInfo ServerDbusObjectPropertyInfo where type AttrAllowedOps ServerDbusObjectPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear] type AttrSetTypeConstraint ServerDbusObjectPropertyInfo = (~) T.Text type AttrBaseTypeConstraint ServerDbusObjectPropertyInfo = IsServer type AttrGetType ServerDbusObjectPropertyInfo = (Maybe T.Text) type AttrLabel ServerDbusObjectPropertyInfo = "dbus-object" type AttrOrigin ServerDbusObjectPropertyInfo = Server attrGet _ = getServerDbusObject attrSet _ = undefined attrConstruct _ = constructServerDbusObject attrClear _ = undefined #endif -- VVV Prop "root-node" -- Type: TInterface (Name {namespace = "Dbusmenu", name = "Menuitem"}) -- Flags: [PropertyReadable,PropertyWritable] -- Nullable: (Nothing,Nothing) {- | Get the value of the “@root-node@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' server #rootNode @ -} getServerRootNode :: (MonadIO m, IsServer o) => o -> m (Maybe Dbusmenu.Menuitem.Menuitem) getServerRootNode obj = liftIO $ B.Properties.getObjectPropertyObject obj "root-node" Dbusmenu.Menuitem.Menuitem {- | Set the value of the “@root-node@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.set' server [ #rootNode 'Data.GI.Base.Attributes.:=' value ] @ -} setServerRootNode :: (MonadIO m, IsServer o, Dbusmenu.Menuitem.IsMenuitem a) => o -> a -> m () setServerRootNode obj val = liftIO $ B.Properties.setObjectPropertyObject obj "root-node" (Just val) {- | Construct a `GValueConstruct` with valid value for the “@root-node@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`. -} constructServerRootNode :: (IsServer o, Dbusmenu.Menuitem.IsMenuitem a) => a -> IO (GValueConstruct o) constructServerRootNode val = B.Properties.constructObjectPropertyObject "root-node" (Just val) {- | Set the value of the “@root-node@” property to `Nothing`. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.clear' #rootNode @ -} clearServerRootNode :: (MonadIO m, IsServer o) => o -> m () clearServerRootNode obj = liftIO $ B.Properties.setObjectPropertyObject obj "root-node" (Nothing :: Maybe Dbusmenu.Menuitem.Menuitem) #if ENABLE_OVERLOADING data ServerRootNodePropertyInfo instance AttrInfo ServerRootNodePropertyInfo where type AttrAllowedOps ServerRootNodePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear] type AttrSetTypeConstraint ServerRootNodePropertyInfo = Dbusmenu.Menuitem.IsMenuitem type AttrBaseTypeConstraint ServerRootNodePropertyInfo = IsServer type AttrGetType ServerRootNodePropertyInfo = (Maybe Dbusmenu.Menuitem.Menuitem) type AttrLabel ServerRootNodePropertyInfo = "root-node" type AttrOrigin ServerRootNodePropertyInfo = Server attrGet _ = getServerRootNode attrSet _ = setServerRootNode attrConstruct _ = constructServerRootNode attrClear _ = clearServerRootNode #endif -- VVV Prop "version" -- Type: TBasicType TUInt -- Flags: [PropertyReadable] -- Nullable: (Nothing,Nothing) {- | Get the value of the “@version@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' server #version @ -} getServerVersion :: (MonadIO m, IsServer o) => o -> m Word32 getServerVersion obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "version" #if ENABLE_OVERLOADING data ServerVersionPropertyInfo instance AttrInfo ServerVersionPropertyInfo where type AttrAllowedOps ServerVersionPropertyInfo = '[ 'AttrGet] type AttrSetTypeConstraint ServerVersionPropertyInfo = (~) () type AttrBaseTypeConstraint ServerVersionPropertyInfo = IsServer type AttrGetType ServerVersionPropertyInfo = Word32 type AttrLabel ServerVersionPropertyInfo = "version" type AttrOrigin ServerVersionPropertyInfo = Server attrGet _ = getServerVersion attrSet _ = undefined attrConstruct _ = undefined attrClear _ = undefined #endif #if ENABLE_OVERLOADING instance O.HasAttributeList Server type instance O.AttributeList Server = ServerAttributeList type ServerAttributeList = ('[ '("dbusObject", ServerDbusObjectPropertyInfo), '("rootNode", ServerRootNodePropertyInfo), '("version", ServerVersionPropertyInfo)] :: [(Symbol, *)]) #endif #if ENABLE_OVERLOADING serverDbusObject :: AttrLabelProxy "dbusObject" serverDbusObject = AttrLabelProxy serverRootNode :: AttrLabelProxy "rootNode" serverRootNode = AttrLabelProxy serverVersion :: AttrLabelProxy "version" serverVersion = AttrLabelProxy #endif #if ENABLE_OVERLOADING data ServerItemActivationRequestedSignalInfo instance SignalInfo ServerItemActivationRequestedSignalInfo where type HaskellCallbackType ServerItemActivationRequestedSignalInfo = ServerItemActivationRequestedCallback connectSignal _ obj cb connectMode = do let cb' = wrap_ServerItemActivationRequestedCallback cb cb'' <- mk_ServerItemActivationRequestedCallback cb' connectSignalFunPtr obj "item-activation-requested" cb'' connectMode data ServerItemPropertyUpdatedSignalInfo instance SignalInfo ServerItemPropertyUpdatedSignalInfo where type HaskellCallbackType ServerItemPropertyUpdatedSignalInfo = ServerItemPropertyUpdatedCallback connectSignal _ obj cb connectMode = do let cb' = wrap_ServerItemPropertyUpdatedCallback cb cb'' <- mk_ServerItemPropertyUpdatedCallback cb' connectSignalFunPtr obj "item-property-updated" cb'' connectMode data ServerItemUpdatedSignalInfo instance SignalInfo ServerItemUpdatedSignalInfo where type HaskellCallbackType ServerItemUpdatedSignalInfo = ServerItemUpdatedCallback connectSignal _ obj cb connectMode = do let cb' = wrap_ServerItemUpdatedCallback cb cb'' <- mk_ServerItemUpdatedCallback cb' connectSignalFunPtr obj "item-updated" cb'' connectMode data ServerLayoutUpdatedSignalInfo instance SignalInfo ServerLayoutUpdatedSignalInfo where type HaskellCallbackType ServerLayoutUpdatedSignalInfo = ServerLayoutUpdatedCallback connectSignal _ obj cb connectMode = do let cb' = wrap_ServerLayoutUpdatedCallback cb cb'' <- mk_ServerLayoutUpdatedCallback cb' connectSignalFunPtr obj "layout-updated" cb'' connectMode type instance O.SignalList Server = ServerSignalList type ServerSignalList = ('[ '("itemActivationRequested", ServerItemActivationRequestedSignalInfo), '("itemPropertyUpdated", ServerItemPropertyUpdatedSignalInfo), '("itemUpdated", ServerItemUpdatedSignalInfo), '("layoutUpdated", ServerLayoutUpdatedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)]) #endif -- method Server::new -- method type : Constructor -- Args : [Arg {argCName = "object", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object name to show for this menu structure\n\t\ton DBus. May be NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Dbusmenu", name = "Server"})) -- throws : False -- Skip return : False foreign import ccall "dbusmenu_server_new" dbusmenu_server_new :: CString -> -- object : TBasicType TUTF8 IO (Ptr Server) {- | Creates a new 'GI.Dbusmenu.Objects.Server.Server' object with a specific object path on DBus. If /@object@/ is set to NULL the default object name of \"\/com\/canonical\/dbusmenu\" will be used. Return value: A brand new 'GI.Dbusmenu.Objects.Server.Server' -} serverNew :: (B.CallStack.HasCallStack, MonadIO m) => T.Text {- ^ /@object@/: The object name to show for this menu structure on DBus. May be NULL. -} -> m Server serverNew object = liftIO $ do object' <- textToCString object result <- dbusmenu_server_new object' checkUnexpectedReturnNULL "serverNew" result result' <- (wrapObject Server) result freeMem object' return result' #if ENABLE_OVERLOADING #endif -- method Server::get_icon_paths -- method type : OrdinaryMethod -- Args : [Arg {argCName = "server", argType = TInterface (Name {namespace = "Dbusmenu", name = "Server"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #DbusmenuServer to get the icon paths from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "dbusmenu_server_get_icon_paths" dbusmenu_server_get_icon_paths :: Ptr Server -> -- server : TInterface (Name {namespace = "Dbusmenu", name = "Server"}) IO (Ptr CString) {- | Gets the stored and exported icon paths from the server. -} serverGetIconPaths :: (B.CallStack.HasCallStack, MonadIO m, IsServer a) => a {- ^ /@server@/: The 'GI.Dbusmenu.Objects.Server.Server' to get the icon paths from -} -> m [T.Text] {- ^ __Returns:__ A NULL-terminated list of icon paths with memory managed by the server. Duplicate if you want to keep them. -} serverGetIconPaths server = liftIO $ do server' <- unsafeManagedPtrCastPtr server result <- dbusmenu_server_get_icon_paths server' checkUnexpectedReturnNULL "serverGetIconPaths" result result' <- unpackZeroTerminatedUTF8CArray result touchManagedPtr server return result' #if ENABLE_OVERLOADING data ServerGetIconPathsMethodInfo instance (signature ~ (m [T.Text]), MonadIO m, IsServer a) => O.MethodInfo ServerGetIconPathsMethodInfo a signature where overloadedMethod _ = serverGetIconPaths #endif -- method Server::get_status -- method type : OrdinaryMethod -- Args : [Arg {argCName = "server", argType = TInterface (Name {namespace = "Dbusmenu", name = "Server"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #DbusmenuServer to get the status from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Dbusmenu", name = "Status"})) -- throws : False -- Skip return : False foreign import ccall "dbusmenu_server_get_status" dbusmenu_server_get_status :: Ptr Server -> -- server : TInterface (Name {namespace = "Dbusmenu", name = "Server"}) IO CUInt {- | Gets the current statust hat the server is sending out over DBus. Return value: The current status the server is sending -} serverGetStatus :: (B.CallStack.HasCallStack, MonadIO m, IsServer a) => a {- ^ /@server@/: The 'GI.Dbusmenu.Objects.Server.Server' to get the status from -} -> m Dbusmenu.Enums.Status serverGetStatus server = liftIO $ do server' <- unsafeManagedPtrCastPtr server result <- dbusmenu_server_get_status server' let result' = (toEnum . fromIntegral) result touchManagedPtr server return result' #if ENABLE_OVERLOADING data ServerGetStatusMethodInfo instance (signature ~ (m Dbusmenu.Enums.Status), MonadIO m, IsServer a) => O.MethodInfo ServerGetStatusMethodInfo a signature where overloadedMethod _ = serverGetStatus #endif -- method Server::get_text_direction -- method type : OrdinaryMethod -- Args : [Arg {argCName = "server", argType = TInterface (Name {namespace = "Dbusmenu", name = "Server"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #DbusmenuServer object to get the text direction from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Dbusmenu", name = "TextDirection"})) -- throws : False -- Skip return : False foreign import ccall "dbusmenu_server_get_text_direction" dbusmenu_server_get_text_direction :: Ptr Server -> -- server : TInterface (Name {namespace = "Dbusmenu", name = "Server"}) IO CUInt {- | Returns the value of the text direction that is being exported over DBus for this server. It should relate to the direction of the labels and other text fields that are being exported by this server. Return value: Text direction exported for this server. -} serverGetTextDirection :: (B.CallStack.HasCallStack, MonadIO m, IsServer a) => a {- ^ /@server@/: The 'GI.Dbusmenu.Objects.Server.Server' object to get the text direction from -} -> m Dbusmenu.Enums.TextDirection serverGetTextDirection server = liftIO $ do server' <- unsafeManagedPtrCastPtr server result <- dbusmenu_server_get_text_direction server' let result' = (toEnum . fromIntegral) result touchManagedPtr server return result' #if ENABLE_OVERLOADING data ServerGetTextDirectionMethodInfo instance (signature ~ (m Dbusmenu.Enums.TextDirection), MonadIO m, IsServer a) => O.MethodInfo ServerGetTextDirectionMethodInfo a signature where overloadedMethod _ = serverGetTextDirection #endif -- method Server::set_icon_paths -- method type : OrdinaryMethod -- Args : [Arg {argCName = "server", argType = TInterface (Name {namespace = "Dbusmenu", name = "Server"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #DbusmenuServer to set the icon paths on", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "icon_paths", argType = TCArray True (-1) (-1) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "dbusmenu_server_set_icon_paths" dbusmenu_server_set_icon_paths :: Ptr Server -> -- server : TInterface (Name {namespace = "Dbusmenu", name = "Server"}) Ptr CString -> -- icon_paths : TCArray True (-1) (-1) (TBasicType TUTF8) IO () {- | Sets the icon paths for the server. This will replace previously set icon theme paths. -} serverSetIconPaths :: (B.CallStack.HasCallStack, MonadIO m, IsServer a) => a {- ^ /@server@/: The 'GI.Dbusmenu.Objects.Server.Server' to set the icon paths on -} -> [T.Text] -> m () serverSetIconPaths server iconPaths = liftIO $ do server' <- unsafeManagedPtrCastPtr server iconPaths' <- packZeroTerminatedUTF8CArray iconPaths dbusmenu_server_set_icon_paths server' iconPaths' touchManagedPtr server mapZeroTerminatedCArray freeMem iconPaths' freeMem iconPaths' return () #if ENABLE_OVERLOADING data ServerSetIconPathsMethodInfo instance (signature ~ ([T.Text] -> m ()), MonadIO m, IsServer a) => O.MethodInfo ServerSetIconPathsMethodInfo a signature where overloadedMethod _ = serverSetIconPaths #endif -- method Server::set_root -- method type : OrdinaryMethod -- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Dbusmenu", name = "Server"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #DbusmenuServer object to set the root on", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "root", argType = TInterface (Name {namespace = "Dbusmenu", name = "Menuitem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The new root #DbusmenuMenuitem tree", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "dbusmenu_server_set_root" dbusmenu_server_set_root :: Ptr Server -> -- self : TInterface (Name {namespace = "Dbusmenu", name = "Server"}) Ptr Dbusmenu.Menuitem.Menuitem -> -- root : TInterface (Name {namespace = "Dbusmenu", name = "Menuitem"}) IO () {- | This function contains all of the 'GI.GObject.Structs.Value.Value' wrapping required to set the property 'GI.Dbusmenu.Objects.Server.Server':@/root-node/@ on the server /@self@/. -} serverSetRoot :: (B.CallStack.HasCallStack, MonadIO m, IsServer a, Dbusmenu.Menuitem.IsMenuitem b) => a {- ^ /@self@/: The 'GI.Dbusmenu.Objects.Server.Server' object to set the root on -} -> b {- ^ /@root@/: The new root 'GI.Dbusmenu.Objects.Menuitem.Menuitem' tree -} -> m () serverSetRoot self root = liftIO $ do self' <- unsafeManagedPtrCastPtr self root' <- unsafeManagedPtrCastPtr root dbusmenu_server_set_root self' root' touchManagedPtr self touchManagedPtr root return () #if ENABLE_OVERLOADING data ServerSetRootMethodInfo instance (signature ~ (b -> m ()), MonadIO m, IsServer a, Dbusmenu.Menuitem.IsMenuitem b) => O.MethodInfo ServerSetRootMethodInfo a signature where overloadedMethod _ = serverSetRoot #endif -- method Server::set_status -- method type : OrdinaryMethod -- Args : [Arg {argCName = "server", argType = TInterface (Name {namespace = "Dbusmenu", name = "Server"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #DbusmenuServer to set the status on", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "status", argType = TInterface (Name {namespace = "Dbusmenu", name = "Status"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Status value to set on the server", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "dbusmenu_server_set_status" dbusmenu_server_set_status :: Ptr Server -> -- server : TInterface (Name {namespace = "Dbusmenu", name = "Server"}) CUInt -> -- status : TInterface (Name {namespace = "Dbusmenu", name = "Status"}) IO () {- | Changes the status of the server. -} serverSetStatus :: (B.CallStack.HasCallStack, MonadIO m, IsServer a) => a {- ^ /@server@/: The 'GI.Dbusmenu.Objects.Server.Server' to set the status on -} -> Dbusmenu.Enums.Status {- ^ /@status@/: Status value to set on the server -} -> m () serverSetStatus server status = liftIO $ do server' <- unsafeManagedPtrCastPtr server let status' = (fromIntegral . fromEnum) status dbusmenu_server_set_status server' status' touchManagedPtr server return () #if ENABLE_OVERLOADING data ServerSetStatusMethodInfo instance (signature ~ (Dbusmenu.Enums.Status -> m ()), MonadIO m, IsServer a) => O.MethodInfo ServerSetStatusMethodInfo a signature where overloadedMethod _ = serverSetStatus #endif -- method Server::set_text_direction -- method type : OrdinaryMethod -- Args : [Arg {argCName = "server", argType = TInterface (Name {namespace = "Dbusmenu", name = "Server"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #DbusmenuServer object to set the text direction on", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dir", argType = TInterface (Name {namespace = "Dbusmenu", name = "TextDirection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Direction of the text", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "dbusmenu_server_set_text_direction" dbusmenu_server_set_text_direction :: Ptr Server -> -- server : TInterface (Name {namespace = "Dbusmenu", name = "Server"}) CUInt -> -- dir : TInterface (Name {namespace = "Dbusmenu", name = "TextDirection"}) IO () {- | Sets the text direction that should be exported over DBus for this server. If the value is set to @/DBUSMENU_TEXT_DIRECTION_NONE/@ the default detection will be used for setting the value and exported over DBus. -} serverSetTextDirection :: (B.CallStack.HasCallStack, MonadIO m, IsServer a) => a {- ^ /@server@/: The 'GI.Dbusmenu.Objects.Server.Server' object to set the text direction on -} -> Dbusmenu.Enums.TextDirection {- ^ /@dir@/: Direction of the text -} -> m () serverSetTextDirection server dir = liftIO $ do server' <- unsafeManagedPtrCastPtr server let dir' = (fromIntegral . fromEnum) dir dbusmenu_server_set_text_direction server' dir' touchManagedPtr server return () #if ENABLE_OVERLOADING data ServerSetTextDirectionMethodInfo instance (signature ~ (Dbusmenu.Enums.TextDirection -> m ()), MonadIO m, IsServer a) => O.MethodInfo ServerSetTextDirectionMethodInfo a signature where overloadedMethod _ = serverSetTextDirection #endif