{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Dbusmenu.Objects.MenuitemProxy
(
MenuitemProxy(..) ,
IsMenuitemProxy ,
toMenuitemProxy ,
noMenuitemProxy ,
#if defined(ENABLE_OVERLOADING)
ResolveMenuitemProxyMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
MenuitemProxyGetWrappedMethodInfo ,
#endif
menuitemProxyGetWrapped ,
menuitemProxyNew ,
#if defined(ENABLE_OVERLOADING)
MenuitemProxyMenuItemPropertyInfo ,
#endif
constructMenuitemProxyMenuItem ,
getMenuitemProxyMenuItem ,
#if defined(ENABLE_OVERLOADING)
menuitemProxyMenuItem ,
#endif
) 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.GI.Base.Signals as B.Signals
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.Objects.Menuitem as Dbusmenu.Menuitem
import qualified GI.GObject.Objects.Object as GObject.Object
newtype = (ManagedPtr MenuitemProxy)
deriving (MenuitemProxy -> MenuitemProxy -> Bool
(MenuitemProxy -> MenuitemProxy -> Bool)
-> (MenuitemProxy -> MenuitemProxy -> Bool) -> Eq MenuitemProxy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MenuitemProxy -> MenuitemProxy -> Bool
$c/= :: MenuitemProxy -> MenuitemProxy -> Bool
== :: MenuitemProxy -> MenuitemProxy -> Bool
$c== :: MenuitemProxy -> MenuitemProxy -> Bool
Eq)
foreign import ccall "dbusmenu_menuitem_proxy_get_type"
:: IO GType
instance GObject MenuitemProxy where
gobjectType :: IO GType
gobjectType = IO GType
c_dbusmenu_menuitem_proxy_get_type
instance B.GValue.IsGValue MenuitemProxy where
toGValue :: MenuitemProxy -> IO GValue
toGValue o :: MenuitemProxy
o = do
GType
gtype <- IO GType
c_dbusmenu_menuitem_proxy_get_type
MenuitemProxy -> (Ptr MenuitemProxy -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr MenuitemProxy
o (GType
-> (GValue -> Ptr MenuitemProxy -> IO ())
-> Ptr MenuitemProxy
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr MenuitemProxy -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO MenuitemProxy
fromGValue gv :: GValue
gv = do
Ptr MenuitemProxy
ptr <- GValue -> IO (Ptr MenuitemProxy)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr MenuitemProxy)
(ManagedPtr MenuitemProxy -> MenuitemProxy)
-> Ptr MenuitemProxy -> IO MenuitemProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr MenuitemProxy -> MenuitemProxy
MenuitemProxy Ptr MenuitemProxy
ptr
class (GObject o, O.IsDescendantOf MenuitemProxy o) => o
instance (GObject o, O.IsDescendantOf MenuitemProxy o) => IsMenuitemProxy o
instance O.HasParentTypes MenuitemProxy
type instance O.ParentTypes MenuitemProxy = '[Dbusmenu.Menuitem.Menuitem, GObject.Object.Object]
toMenuitemProxy :: (MonadIO m, IsMenuitemProxy o) => o -> m MenuitemProxy
= IO MenuitemProxy -> m MenuitemProxy
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MenuitemProxy -> m MenuitemProxy)
-> (o -> IO MenuitemProxy) -> o -> m MenuitemProxy
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr MenuitemProxy -> MenuitemProxy)
-> o -> IO MenuitemProxy
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr MenuitemProxy -> MenuitemProxy
MenuitemProxy
noMenuitemProxy :: Maybe MenuitemProxy
= Maybe MenuitemProxy
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveMenuitemProxyMethod (t :: Symbol) (o :: *) :: * where
ResolveMenuitemProxyMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveMenuitemProxyMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveMenuitemProxyMethod "childAddPosition" o = Dbusmenu.Menuitem.MenuitemChildAddPositionMethodInfo
ResolveMenuitemProxyMethod "childAppend" o = Dbusmenu.Menuitem.MenuitemChildAppendMethodInfo
ResolveMenuitemProxyMethod "childDelete" o = Dbusmenu.Menuitem.MenuitemChildDeleteMethodInfo
ResolveMenuitemProxyMethod "childFind" o = Dbusmenu.Menuitem.MenuitemChildFindMethodInfo
ResolveMenuitemProxyMethod "childPrepend" o = Dbusmenu.Menuitem.MenuitemChildPrependMethodInfo
ResolveMenuitemProxyMethod "childReorder" o = Dbusmenu.Menuitem.MenuitemChildReorderMethodInfo
ResolveMenuitemProxyMethod "findId" o = Dbusmenu.Menuitem.MenuitemFindIdMethodInfo
ResolveMenuitemProxyMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveMenuitemProxyMethod "foreach" o = Dbusmenu.Menuitem.MenuitemForeachMethodInfo
ResolveMenuitemProxyMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveMenuitemProxyMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveMenuitemProxyMethod "handleEvent" o = Dbusmenu.Menuitem.MenuitemHandleEventMethodInfo
ResolveMenuitemProxyMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveMenuitemProxyMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveMenuitemProxyMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveMenuitemProxyMethod "propertiesCopy" o = Dbusmenu.Menuitem.MenuitemPropertiesCopyMethodInfo
ResolveMenuitemProxyMethod "propertiesList" o = Dbusmenu.Menuitem.MenuitemPropertiesListMethodInfo
ResolveMenuitemProxyMethod "propertyExist" o = Dbusmenu.Menuitem.MenuitemPropertyExistMethodInfo
ResolveMenuitemProxyMethod "propertyGet" o = Dbusmenu.Menuitem.MenuitemPropertyGetMethodInfo
ResolveMenuitemProxyMethod "propertyGetBool" o = Dbusmenu.Menuitem.MenuitemPropertyGetBoolMethodInfo
ResolveMenuitemProxyMethod "propertyGetByteArray" o = Dbusmenu.Menuitem.MenuitemPropertyGetByteArrayMethodInfo
ResolveMenuitemProxyMethod "propertyGetInt" o = Dbusmenu.Menuitem.MenuitemPropertyGetIntMethodInfo
ResolveMenuitemProxyMethod "propertyGetVariant" o = Dbusmenu.Menuitem.MenuitemPropertyGetVariantMethodInfo
ResolveMenuitemProxyMethod "propertyRemove" o = Dbusmenu.Menuitem.MenuitemPropertyRemoveMethodInfo
ResolveMenuitemProxyMethod "propertySet" o = Dbusmenu.Menuitem.MenuitemPropertySetMethodInfo
ResolveMenuitemProxyMethod "propertySetBool" o = Dbusmenu.Menuitem.MenuitemPropertySetBoolMethodInfo
ResolveMenuitemProxyMethod "propertySetByteArray" o = Dbusmenu.Menuitem.MenuitemPropertySetByteArrayMethodInfo
ResolveMenuitemProxyMethod "propertySetInt" o = Dbusmenu.Menuitem.MenuitemPropertySetIntMethodInfo
ResolveMenuitemProxyMethod "propertySetVariant" o = Dbusmenu.Menuitem.MenuitemPropertySetVariantMethodInfo
ResolveMenuitemProxyMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveMenuitemProxyMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveMenuitemProxyMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveMenuitemProxyMethod "sendAboutToShow" o = Dbusmenu.Menuitem.MenuitemSendAboutToShowMethodInfo
ResolveMenuitemProxyMethod "showToUser" o = Dbusmenu.Menuitem.MenuitemShowToUserMethodInfo
ResolveMenuitemProxyMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveMenuitemProxyMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveMenuitemProxyMethod "takeChildren" o = Dbusmenu.Menuitem.MenuitemTakeChildrenMethodInfo
ResolveMenuitemProxyMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveMenuitemProxyMethod "unparent" o = Dbusmenu.Menuitem.MenuitemUnparentMethodInfo
ResolveMenuitemProxyMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveMenuitemProxyMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveMenuitemProxyMethod "getChildren" o = Dbusmenu.Menuitem.MenuitemGetChildrenMethodInfo
ResolveMenuitemProxyMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveMenuitemProxyMethod "getId" o = Dbusmenu.Menuitem.MenuitemGetIdMethodInfo
ResolveMenuitemProxyMethod "getParent" o = Dbusmenu.Menuitem.MenuitemGetParentMethodInfo
ResolveMenuitemProxyMethod "getPosition" o = Dbusmenu.Menuitem.MenuitemGetPositionMethodInfo
ResolveMenuitemProxyMethod "getPositionRealized" o = Dbusmenu.Menuitem.MenuitemGetPositionRealizedMethodInfo
ResolveMenuitemProxyMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveMenuitemProxyMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveMenuitemProxyMethod "getRoot" o = Dbusmenu.Menuitem.MenuitemGetRootMethodInfo
ResolveMenuitemProxyMethod "getWrapped" o = MenuitemProxyGetWrappedMethodInfo
ResolveMenuitemProxyMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveMenuitemProxyMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveMenuitemProxyMethod "setParent" o = Dbusmenu.Menuitem.MenuitemSetParentMethodInfo
ResolveMenuitemProxyMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveMenuitemProxyMethod "setRoot" o = Dbusmenu.Menuitem.MenuitemSetRootMethodInfo
ResolveMenuitemProxyMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMenuitemProxyMethod t MenuitemProxy, O.MethodInfo info MenuitemProxy p) => OL.IsLabel t (MenuitemProxy -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getMenuitemProxyMenuItem :: (MonadIO m, IsMenuitemProxy o) => o -> m (Maybe Dbusmenu.Menuitem.Menuitem)
obj :: o
obj = IO (Maybe Menuitem) -> m (Maybe Menuitem)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Menuitem) -> m (Maybe Menuitem))
-> IO (Maybe Menuitem) -> m (Maybe Menuitem)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr Menuitem -> Menuitem)
-> IO (Maybe Menuitem)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "menu-item" ManagedPtr Menuitem -> Menuitem
Dbusmenu.Menuitem.Menuitem
constructMenuitemProxyMenuItem :: (IsMenuitemProxy o, Dbusmenu.Menuitem.IsMenuitem a) => a -> IO (GValueConstruct o)
val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "menu-item" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data MenuitemProxyMenuItemPropertyInfo
instance AttrInfo MenuitemProxyMenuItemPropertyInfo where
type AttrAllowedOps MenuitemProxyMenuItemPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint MenuitemProxyMenuItemPropertyInfo = IsMenuitemProxy
type AttrSetTypeConstraint MenuitemProxyMenuItemPropertyInfo = Dbusmenu.Menuitem.IsMenuitem
type AttrTransferTypeConstraint MenuitemProxyMenuItemPropertyInfo = Dbusmenu.Menuitem.IsMenuitem
type AttrTransferType MenuitemProxyMenuItemPropertyInfo = Dbusmenu.Menuitem.Menuitem
type AttrGetType MenuitemProxyMenuItemPropertyInfo = (Maybe Dbusmenu.Menuitem.Menuitem)
type AttrLabel MenuitemProxyMenuItemPropertyInfo = "menu-item"
type AttrOrigin MenuitemProxyMenuItemPropertyInfo = MenuitemProxy
attrGet = getMenuitemProxyMenuItem
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Dbusmenu.Menuitem.Menuitem v
attrConstruct = constructMenuitemProxyMenuItem
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList MenuitemProxy
type instance O.AttributeList MenuitemProxy = MenuitemProxyAttributeList
type MenuitemProxyAttributeList = ('[ '("id", Dbusmenu.Menuitem.MenuitemIdPropertyInfo), '("menuItem", MenuitemProxyMenuItemPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
menuitemProxyMenuItem :: AttrLabelProxy "menuItem"
menuitemProxyMenuItem = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList MenuitemProxy = MenuitemProxySignalList
type MenuitemProxySignalList = ('[ '("aboutToShow", Dbusmenu.Menuitem.MenuitemAboutToShowSignalInfo), '("childAdded", Dbusmenu.Menuitem.MenuitemChildAddedSignalInfo), '("childMoved", Dbusmenu.Menuitem.MenuitemChildMovedSignalInfo), '("childRemoved", Dbusmenu.Menuitem.MenuitemChildRemovedSignalInfo), '("event", Dbusmenu.Menuitem.MenuitemEventSignalInfo), '("itemActivated", Dbusmenu.Menuitem.MenuitemItemActivatedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("propertyChanged", Dbusmenu.Menuitem.MenuitemPropertyChangedSignalInfo), '("realized", Dbusmenu.Menuitem.MenuitemRealizedSignalInfo), '("showToUser", Dbusmenu.Menuitem.MenuitemShowToUserSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "dbusmenu_menuitem_proxy_new" ::
Ptr Dbusmenu.Menuitem.Menuitem ->
IO (Ptr MenuitemProxy)
menuitemProxyNew ::
(B.CallStack.HasCallStack, MonadIO m, Dbusmenu.Menuitem.IsMenuitem a) =>
a
-> m MenuitemProxy
mi :: a
mi = IO MenuitemProxy -> m MenuitemProxy
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MenuitemProxy -> m MenuitemProxy)
-> IO MenuitemProxy -> m MenuitemProxy
forall a b. (a -> b) -> a -> b
$ do
Ptr Menuitem
mi' <- a -> IO (Ptr Menuitem)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mi
Ptr MenuitemProxy
result <- Ptr Menuitem -> IO (Ptr MenuitemProxy)
dbusmenu_menuitem_proxy_new Ptr Menuitem
mi'
Text -> Ptr MenuitemProxy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "menuitemProxyNew" Ptr MenuitemProxy
result
MenuitemProxy
result' <- ((ManagedPtr MenuitemProxy -> MenuitemProxy)
-> Ptr MenuitemProxy -> IO MenuitemProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr MenuitemProxy -> MenuitemProxy
MenuitemProxy) Ptr MenuitemProxy
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mi
MenuitemProxy -> IO MenuitemProxy
forall (m :: * -> *) a. Monad m => a -> m a
return MenuitemProxy
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "dbusmenu_menuitem_proxy_get_wrapped" ::
Ptr MenuitemProxy ->
IO (Ptr Dbusmenu.Menuitem.Menuitem)
menuitemProxyGetWrapped ::
(B.CallStack.HasCallStack, MonadIO m, IsMenuitemProxy a) =>
a
-> m Dbusmenu.Menuitem.Menuitem
pmi :: a
pmi = IO Menuitem -> m Menuitem
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Menuitem -> m Menuitem) -> IO Menuitem -> m Menuitem
forall a b. (a -> b) -> a -> b
$ do
Ptr MenuitemProxy
pmi' <- a -> IO (Ptr MenuitemProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pmi
Ptr Menuitem
result <- Ptr MenuitemProxy -> IO (Ptr Menuitem)
dbusmenu_menuitem_proxy_get_wrapped Ptr MenuitemProxy
pmi'
Text -> Ptr Menuitem -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "menuitemProxyGetWrapped" Ptr Menuitem
result
Menuitem
result' <- ((ManagedPtr Menuitem -> Menuitem) -> Ptr Menuitem -> IO Menuitem
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Menuitem -> Menuitem
Dbusmenu.Menuitem.Menuitem) Ptr Menuitem
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pmi
Menuitem -> IO Menuitem
forall (m :: * -> *) a. Monad m => a -> m a
return Menuitem
result'
#if defined(ENABLE_OVERLOADING)
data MenuitemProxyGetWrappedMethodInfo
instance (signature ~ (m Dbusmenu.Menuitem.Menuitem), MonadIO m, IsMenuitemProxy a) => O.MethodInfo MenuitemProxyGetWrappedMethodInfo a signature where
overloadedMethod = menuitemProxyGetWrapped
#endif