gi-webkit2webextension-4.0.19: GI/WebKit2WebExtension/Structs/ContextMenuItem_.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)
/No description available in the introspection data./
-}
#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.WebKit2WebExtension.Structs.ContextMenuItem_
(
-- * Exported types
ContextMenuItem_(..) ,
newZeroContextMenuItem_ ,
noContextMenuItem_ ,
-- * Properties
-- ** parent #attr:parent#
{- | /No description available in the introspection data./
-}
clearContextMenuItem_Parent ,
#if ENABLE_OVERLOADING
contextMenuItem__parent ,
#endif
getContextMenuItem_Parent ,
setContextMenuItem_Parent ,
) 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.InitiallyUnowned as GObject.InitiallyUnowned
-- | Memory-managed wrapper type.
newtype ContextMenuItem_ = ContextMenuItem_ (ManagedPtr ContextMenuItem_)
instance WrappedPtr ContextMenuItem_ where
wrappedPtrCalloc = callocBytes 32
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 32 >=> wrapPtr ContextMenuItem_)
wrappedPtrFree = Just ptr_to_g_free
-- | Construct a `ContextMenuItem_` struct initialized to zero.
newZeroContextMenuItem_ :: MonadIO m => m ContextMenuItem_
newZeroContextMenuItem_ = liftIO $ wrappedPtrCalloc >>= wrapPtr ContextMenuItem_
instance tag ~ 'AttrSet => Constructible ContextMenuItem_ tag where
new _ attrs = do
o <- newZeroContextMenuItem_
GI.Attributes.set o attrs
return o
-- | A convenience alias for `Nothing` :: `Maybe` `ContextMenuItem_`.
noContextMenuItem_ :: Maybe ContextMenuItem_
noContextMenuItem_ = Nothing
{- |
Get the value of the “@parent@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' contextMenuItem_ #parent
@
-}
getContextMenuItem_Parent :: MonadIO m => ContextMenuItem_ -> m (Maybe GObject.InitiallyUnowned.InitiallyUnowned)
getContextMenuItem_Parent s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr GObject.InitiallyUnowned.InitiallyUnowned)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newObject GObject.InitiallyUnowned.InitiallyUnowned) val'
return val''
return result
{- |
Set the value of the “@parent@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' contextMenuItem_ [ #parent 'Data.GI.Base.Attributes.:=' value ]
@
-}
setContextMenuItem_Parent :: MonadIO m => ContextMenuItem_ -> Ptr GObject.InitiallyUnowned.InitiallyUnowned -> m ()
setContextMenuItem_Parent s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Ptr GObject.InitiallyUnowned.InitiallyUnowned)
{- |
Set the value of the “@parent@” field to `Nothing`.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.clear' #parent
@
-}
clearContextMenuItem_Parent :: MonadIO m => ContextMenuItem_ -> m ()
clearContextMenuItem_Parent s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr GObject.InitiallyUnowned.InitiallyUnowned)
#if ENABLE_OVERLOADING
data ContextMenuItem_ParentFieldInfo
instance AttrInfo ContextMenuItem_ParentFieldInfo where
type AttrAllowedOps ContextMenuItem_ParentFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ContextMenuItem_ParentFieldInfo = (~) (Ptr GObject.InitiallyUnowned.InitiallyUnowned)
type AttrBaseTypeConstraint ContextMenuItem_ParentFieldInfo = (~) ContextMenuItem_
type AttrGetType ContextMenuItem_ParentFieldInfo = Maybe GObject.InitiallyUnowned.InitiallyUnowned
type AttrLabel ContextMenuItem_ParentFieldInfo = "parent"
type AttrOrigin ContextMenuItem_ParentFieldInfo = ContextMenuItem_
attrGet _ = getContextMenuItem_Parent
attrSet _ = setContextMenuItem_Parent
attrConstruct = undefined
attrClear _ = clearContextMenuItem_Parent
contextMenuItem__parent :: AttrLabelProxy "parent"
contextMenuItem__parent = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList ContextMenuItem_
type instance O.AttributeList ContextMenuItem_ = ContextMenuItem_AttributeList
type ContextMenuItem_AttributeList = ('[ '("parent", ContextMenuItem_ParentFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveContextMenuItem_Method (t :: Symbol) (o :: *) :: * where
ResolveContextMenuItem_Method l o = O.MethodResolutionFailed l o
instance (info ~ ResolveContextMenuItem_Method t ContextMenuItem_, O.MethodInfo info ContextMenuItem_ p) => OL.IsLabel t (ContextMenuItem_ -> 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