packages feed

gi-girepository-0.1.46.13: GI/GIRepository/Structs/AttributeIter.hs


{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

An opaque structure used to iterate over attributes
in a #GIBaseInfo struct.
-}

module GI.GIRepository.Structs.AttributeIter
    ( 

-- * Exported types
    AttributeIter(..)                       ,
    newZeroAttributeIter                    ,
    noAttributeIter                         ,


    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.GIRepository.Types
import GI.GIRepository.Callbacks

newtype AttributeIter = AttributeIter (ForeignPtr AttributeIter)
-- | Construct a `AttributeIter` struct initialized to zero.
newZeroAttributeIter :: MonadIO m => m AttributeIter
newZeroAttributeIter = liftIO $ callocBytes 32 >>= wrapPtr AttributeIter

noAttributeIter :: Maybe AttributeIter
noAttributeIter = Nothing

type family ResolveAttributeIterMethod (t :: Symbol) (o :: *) :: * where
    ResolveAttributeIterMethod l o = MethodResolutionFailed l o

instance (info ~ ResolveAttributeIterMethod t AttributeIter, MethodInfo info AttributeIter p) => IsLabelProxy t (AttributeIter -> p) where
    fromLabelProxy _ = overloadedMethod (MethodProxy :: MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAttributeIterMethod t AttributeIter, MethodInfo info AttributeIter p) => IsLabel t (AttributeIter -> p) where
    fromLabel _ = overloadedMethod (MethodProxy :: MethodProxy info)
#endif