{- | 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.GObject.Structs.ClosureNotifyData ( -- * Exported types ClosureNotifyData(..) , newZeroClosureNotifyData , noClosureNotifyData , -- * Properties -- ** data #attr:data# {- | /No description available in the introspection data./ -} clearClosureNotifyDataData , #if ENABLE_OVERLOADING closureNotifyData_data , #endif getClosureNotifyDataData , setClosureNotifyDataData , -- ** notify #attr:notify# {- | /No description available in the introspection data./ -} clearClosureNotifyDataNotify , #if ENABLE_OVERLOADING closureNotifyData_notify , #endif getClosureNotifyDataNotify , setClosureNotifyDataNotify , ) 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.Callbacks as GObject.Callbacks -- | Memory-managed wrapper type. newtype ClosureNotifyData = ClosureNotifyData (ManagedPtr ClosureNotifyData) instance WrappedPtr ClosureNotifyData where wrappedPtrCalloc = callocBytes 16 wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 16 >=> wrapPtr ClosureNotifyData) wrappedPtrFree = Just ptr_to_g_free -- | Construct a `ClosureNotifyData` struct initialized to zero. newZeroClosureNotifyData :: MonadIO m => m ClosureNotifyData newZeroClosureNotifyData = liftIO $ wrappedPtrCalloc >>= wrapPtr ClosureNotifyData instance tag ~ 'AttrSet => Constructible ClosureNotifyData tag where new _ attrs = do o <- newZeroClosureNotifyData GI.Attributes.set o attrs return o -- | A convenience alias for `Nothing` :: `Maybe` `ClosureNotifyData`. noClosureNotifyData :: Maybe ClosureNotifyData noClosureNotifyData = Nothing {- | Get the value of the “@data@” field. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' closureNotifyData #data @ -} getClosureNotifyDataData :: MonadIO m => ClosureNotifyData -> m (Ptr ()) getClosureNotifyDataData s = liftIO $ withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO (Ptr ()) return val {- | Set the value of the “@data@” field. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.set' closureNotifyData [ #data 'Data.GI.Base.Attributes.:=' value ] @ -} setClosureNotifyDataData :: MonadIO m => ClosureNotifyData -> Ptr () -> m () setClosureNotifyDataData s val = liftIO $ withManagedPtr s $ \ptr -> do poke (ptr `plusPtr` 0) (val :: Ptr ()) {- | Set the value of the “@data@” field to `Nothing`. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.clear' #data @ -} clearClosureNotifyDataData :: MonadIO m => ClosureNotifyData -> m () clearClosureNotifyDataData s = liftIO $ withManagedPtr s $ \ptr -> do poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr ()) #if ENABLE_OVERLOADING data ClosureNotifyDataDataFieldInfo instance AttrInfo ClosureNotifyDataDataFieldInfo where type AttrAllowedOps ClosureNotifyDataDataFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear] type AttrSetTypeConstraint ClosureNotifyDataDataFieldInfo = (~) (Ptr ()) type AttrBaseTypeConstraint ClosureNotifyDataDataFieldInfo = (~) ClosureNotifyData type AttrGetType ClosureNotifyDataDataFieldInfo = Ptr () type AttrLabel ClosureNotifyDataDataFieldInfo = "data" type AttrOrigin ClosureNotifyDataDataFieldInfo = ClosureNotifyData attrGet _ = getClosureNotifyDataData attrSet _ = setClosureNotifyDataData attrConstruct = undefined attrClear _ = clearClosureNotifyDataData closureNotifyData_data :: AttrLabelProxy "data" closureNotifyData_data = AttrLabelProxy #endif {- | Get the value of the “@notify@” field. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' closureNotifyData #notify @ -} getClosureNotifyDataNotify :: MonadIO m => ClosureNotifyData -> m (Maybe GObject.Callbacks.ClosureNotify) getClosureNotifyDataNotify s = liftIO $ withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 8) :: IO (FunPtr GObject.Callbacks.C_ClosureNotify) result <- SP.convertFunPtrIfNonNull val $ \val' -> do let val'' = GObject.Callbacks.dynamic_ClosureNotify val' return val'' return result {- | Set the value of the “@notify@” field. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.set' closureNotifyData [ #notify 'Data.GI.Base.Attributes.:=' value ] @ -} setClosureNotifyDataNotify :: MonadIO m => ClosureNotifyData -> FunPtr GObject.Callbacks.C_ClosureNotify -> m () setClosureNotifyDataNotify s val = liftIO $ withManagedPtr s $ \ptr -> do poke (ptr `plusPtr` 8) (val :: FunPtr GObject.Callbacks.C_ClosureNotify) {- | Set the value of the “@notify@” field to `Nothing`. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.clear' #notify @ -} clearClosureNotifyDataNotify :: MonadIO m => ClosureNotifyData -> m () clearClosureNotifyDataNotify s = liftIO $ withManagedPtr s $ \ptr -> do poke (ptr `plusPtr` 8) (FP.nullFunPtr :: FunPtr GObject.Callbacks.C_ClosureNotify) #if ENABLE_OVERLOADING data ClosureNotifyDataNotifyFieldInfo instance AttrInfo ClosureNotifyDataNotifyFieldInfo where type AttrAllowedOps ClosureNotifyDataNotifyFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear] type AttrSetTypeConstraint ClosureNotifyDataNotifyFieldInfo = (~) (FunPtr GObject.Callbacks.C_ClosureNotify) type AttrBaseTypeConstraint ClosureNotifyDataNotifyFieldInfo = (~) ClosureNotifyData type AttrGetType ClosureNotifyDataNotifyFieldInfo = Maybe GObject.Callbacks.ClosureNotify type AttrLabel ClosureNotifyDataNotifyFieldInfo = "notify" type AttrOrigin ClosureNotifyDataNotifyFieldInfo = ClosureNotifyData attrGet _ = getClosureNotifyDataNotify attrSet _ = setClosureNotifyDataNotify attrConstruct = undefined attrClear _ = clearClosureNotifyDataNotify closureNotifyData_notify :: AttrLabelProxy "notify" closureNotifyData_notify = AttrLabelProxy #endif #if ENABLE_OVERLOADING instance O.HasAttributeList ClosureNotifyData type instance O.AttributeList ClosureNotifyData = ClosureNotifyDataAttributeList type ClosureNotifyDataAttributeList = ('[ '("data", ClosureNotifyDataDataFieldInfo), '("notify", ClosureNotifyDataNotifyFieldInfo)] :: [(Symbol, *)]) #endif #if ENABLE_OVERLOADING type family ResolveClosureNotifyDataMethod (t :: Symbol) (o :: *) :: * where ResolveClosureNotifyDataMethod l o = O.MethodResolutionFailed l o instance (info ~ ResolveClosureNotifyDataMethod t ClosureNotifyData, O.MethodInfo info ClosureNotifyData p) => OL.IsLabel t (ClosureNotifyData -> 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