#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.DBusMenuModel
(
DBusMenuModel(..) ,
IsDBusMenuModel ,
toDBusMenuModel ,
noDBusMenuModel ,
dBusMenuModelGet ,
) 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 qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusConnection as Gio.DBusConnection
import {-# SOURCE #-} qualified GI.Gio.Objects.MenuModel as Gio.MenuModel
newtype DBusMenuModel = DBusMenuModel (ManagedPtr DBusMenuModel)
foreign import ccall "g_dbus_menu_model_get_type"
c_g_dbus_menu_model_get_type :: IO GType
instance GObject DBusMenuModel where
gobjectType = c_g_dbus_menu_model_get_type
class (GObject o, O.IsDescendantOf DBusMenuModel o) => IsDBusMenuModel o
instance (GObject o, O.IsDescendantOf DBusMenuModel o) => IsDBusMenuModel o
instance O.HasParentTypes DBusMenuModel
type instance O.ParentTypes DBusMenuModel = '[Gio.MenuModel.MenuModel, GObject.Object.Object]
toDBusMenuModel :: (MonadIO m, IsDBusMenuModel o) => o -> m DBusMenuModel
toDBusMenuModel = liftIO . unsafeCastTo DBusMenuModel
noDBusMenuModel :: Maybe DBusMenuModel
noDBusMenuModel = Nothing
#if ENABLE_OVERLOADING
type family ResolveDBusMenuModelMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusMenuModelMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDBusMenuModelMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDBusMenuModelMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDBusMenuModelMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDBusMenuModelMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDBusMenuModelMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDBusMenuModelMethod "isMutable" o = Gio.MenuModel.MenuModelIsMutableMethodInfo
ResolveDBusMenuModelMethod "itemsChanged" o = Gio.MenuModel.MenuModelItemsChangedMethodInfo
ResolveDBusMenuModelMethod "iterateItemAttributes" o = Gio.MenuModel.MenuModelIterateItemAttributesMethodInfo
ResolveDBusMenuModelMethod "iterateItemLinks" o = Gio.MenuModel.MenuModelIterateItemLinksMethodInfo
ResolveDBusMenuModelMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDBusMenuModelMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDBusMenuModelMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDBusMenuModelMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDBusMenuModelMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDBusMenuModelMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDBusMenuModelMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDBusMenuModelMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDBusMenuModelMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDBusMenuModelMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDBusMenuModelMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDBusMenuModelMethod "getItemAttributeValue" o = Gio.MenuModel.MenuModelGetItemAttributeValueMethodInfo
ResolveDBusMenuModelMethod "getItemLink" o = Gio.MenuModel.MenuModelGetItemLinkMethodInfo
ResolveDBusMenuModelMethod "getNItems" o = Gio.MenuModel.MenuModelGetNItemsMethodInfo
ResolveDBusMenuModelMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDBusMenuModelMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDBusMenuModelMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDBusMenuModelMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDBusMenuModelMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDBusMenuModelMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusMenuModelMethod t DBusMenuModel, O.MethodInfo info DBusMenuModel p) => OL.IsLabel t (DBusMenuModel -> 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
#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusMenuModel
type instance O.AttributeList DBusMenuModel = DBusMenuModelAttributeList
type DBusMenuModelAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList DBusMenuModel = DBusMenuModelSignalList
type DBusMenuModelSignalList = ('[ '("itemsChanged", Gio.MenuModel.MenuModelItemsChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_menu_model_get" g_dbus_menu_model_get ::
Ptr Gio.DBusConnection.DBusConnection ->
CString ->
CString ->
IO (Ptr DBusMenuModel)
dBusMenuModelGet ::
(B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
a
-> Maybe (T.Text)
-> T.Text
-> m DBusMenuModel
dBusMenuModelGet connection busName objectPath = liftIO $ do
connection' <- unsafeManagedPtrCastPtr connection
maybeBusName <- case busName of
Nothing -> return nullPtr
Just jBusName -> do
jBusName' <- textToCString jBusName
return jBusName'
objectPath' <- textToCString objectPath
result <- g_dbus_menu_model_get connection' maybeBusName objectPath'
checkUnexpectedReturnNULL "dBusMenuModelGet" result
result' <- (wrapObject DBusMenuModel) result
touchManagedPtr connection
freeMem maybeBusName
freeMem objectPath'
return result'
#if ENABLE_OVERLOADING
#endif