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

module GI.Poppler.Structs.FontsIter
    ( 

-- * Exported types
    FontsIter(..)                           ,
    noFontsIter                             ,


 -- * Methods
-- ** copy #method:copy#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterCopyMethodInfo                 ,
#endif
    fontsIterCopy                           ,


-- ** free #method:free#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterFreeMethodInfo                 ,
#endif
    fontsIterFree                           ,


-- ** getEncoding #method:getEncoding#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterGetEncodingMethodInfo          ,
#endif
    fontsIterGetEncoding                    ,


-- ** getFileName #method:getFileName#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterGetFileNameMethodInfo          ,
#endif
    fontsIterGetFileName                    ,


-- ** getFontType #method:getFontType#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterGetFontTypeMethodInfo          ,
#endif
    fontsIterGetFontType                    ,


-- ** getFullName #method:getFullName#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterGetFullNameMethodInfo          ,
#endif
    fontsIterGetFullName                    ,


-- ** getName #method:getName#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterGetNameMethodInfo              ,
#endif
    fontsIterGetName                        ,


-- ** getSubstituteName #method:getSubstituteName#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterGetSubstituteNameMethodInfo    ,
#endif
    fontsIterGetSubstituteName              ,


-- ** isEmbedded #method:isEmbedded#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterIsEmbeddedMethodInfo           ,
#endif
    fontsIterIsEmbedded                     ,


-- ** isSubset #method:isSubset#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterIsSubsetMethodInfo             ,
#endif
    fontsIterIsSubset                       ,


-- ** next #method:next#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    FontsIterNextMethodInfo                 ,
#endif
    fontsIterNext                           ,




    ) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 {-# SOURCE #-} qualified GI.Poppler.Enums as Poppler.Enums

newtype FontsIter = FontsIter (ManagedPtr FontsIter)
foreign import ccall "poppler_fonts_iter_get_type" c_poppler_fonts_iter_get_type :: 
    IO GType

instance BoxedObject FontsIter where
    boxedType _ = c_poppler_fonts_iter_get_type

noFontsIter :: Maybe FontsIter
noFontsIter = Nothing


#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList FontsIter
type instance O.AttributeList FontsIter = FontsIterAttributeList
type FontsIterAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method FontsIter::copy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter to copy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "FontsIter"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_copy" poppler_fonts_iter_copy :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO (Ptr FontsIter)

{- |
Creates a copy of /@iter@/
-}
fontsIterCopy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' to copy -}
    -> m FontsIter
    {- ^ __Returns:__ a new allocated copy of /@iter@/ -}
fontsIterCopy iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    result <- poppler_fonts_iter_copy iter'
    checkUnexpectedReturnNULL "fontsIterCopy" result
    result' <- (wrapBoxed FontsIter) result
    touchManagedPtr iter
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterCopyMethodInfo
instance (signature ~ (m FontsIter), MonadIO m) => O.MethodInfo FontsIterCopyMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterCopy

#endif

-- method FontsIter::free
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_free" poppler_fonts_iter_free :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO ()

{- |
Frees the given 'GI.Poppler.Structs.FontsIter.FontsIter'
-}
fontsIterFree ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' -}
    -> m ()
fontsIterFree iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    poppler_fonts_iter_free iter'
    touchManagedPtr iter
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo FontsIterFreeMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterFree

#endif

-- method FontsIter::get_encoding
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_get_encoding" poppler_fonts_iter_get_encoding :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO CString

{- |
Returns the encoding of the font associated with /@iter@/

@since 0.20
-}
fontsIterGetEncoding ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' -}
    -> m T.Text
    {- ^ __Returns:__ the font encoding -}
fontsIterGetEncoding iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    result <- poppler_fonts_iter_get_encoding iter'
    checkUnexpectedReturnNULL "fontsIterGetEncoding" result
    result' <- cstringToText result
    touchManagedPtr iter
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterGetEncodingMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo FontsIterGetEncodingMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterGetEncoding

#endif

-- method FontsIter::get_file_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_get_file_name" poppler_fonts_iter_get_file_name :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO CString

{- |
The filename of the font associated with /@iter@/ or 'Nothing' if
the font is embedded
-}
fontsIterGetFileName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' -}
    -> m T.Text
    {- ^ __Returns:__ the filename of the font or 'Nothing' if font is embedded -}
fontsIterGetFileName iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    result <- poppler_fonts_iter_get_file_name iter'
    checkUnexpectedReturnNULL "fontsIterGetFileName" result
    result' <- cstringToText result
    touchManagedPtr iter
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterGetFileNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo FontsIterGetFileNameMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterGetFileName

#endif

-- method FontsIter::get_font_type
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "FontType"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_get_font_type" poppler_fonts_iter_get_font_type :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO CUInt

{- |
Returns the type of the font associated with /@iter@/
-}
fontsIterGetFontType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' -}
    -> m Poppler.Enums.FontType
    {- ^ __Returns:__ the font type -}
fontsIterGetFontType iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    result <- poppler_fonts_iter_get_font_type iter'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr iter
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterGetFontTypeMethodInfo
instance (signature ~ (m Poppler.Enums.FontType), MonadIO m) => O.MethodInfo FontsIterGetFontTypeMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterGetFontType

#endif

-- method FontsIter::get_full_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_get_full_name" poppler_fonts_iter_get_full_name :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO CString

{- |
Returns the full name of the font associated with /@iter@/
-}
fontsIterGetFullName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' -}
    -> m T.Text
    {- ^ __Returns:__ the font full name -}
fontsIterGetFullName iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    result <- poppler_fonts_iter_get_full_name iter'
    checkUnexpectedReturnNULL "fontsIterGetFullName" result
    result' <- cstringToText result
    touchManagedPtr iter
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterGetFullNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo FontsIterGetFullNameMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterGetFullName

#endif

-- method FontsIter::get_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_get_name" poppler_fonts_iter_get_name :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO CString

{- |
Returns the name of the font associated with /@iter@/
-}
fontsIterGetName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' -}
    -> m T.Text
    {- ^ __Returns:__ the font name -}
fontsIterGetName iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    result <- poppler_fonts_iter_get_name iter'
    checkUnexpectedReturnNULL "fontsIterGetName" result
    result' <- cstringToText result
    touchManagedPtr iter
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo FontsIterGetNameMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterGetName

#endif

-- method FontsIter::get_substitute_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_get_substitute_name" poppler_fonts_iter_get_substitute_name :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO CString

{- |
The name of the substitute font of the font associated with /@iter@/ or 'Nothing' if
the font is embedded

@since 0.20
-}
fontsIterGetSubstituteName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' -}
    -> m T.Text
    {- ^ __Returns:__ the name of the substitute font or 'Nothing' if font is embedded -}
fontsIterGetSubstituteName iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    result <- poppler_fonts_iter_get_substitute_name iter'
    checkUnexpectedReturnNULL "fontsIterGetSubstituteName" result
    result' <- cstringToText result
    touchManagedPtr iter
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterGetSubstituteNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo FontsIterGetSubstituteNameMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterGetSubstituteName

#endif

-- method FontsIter::is_embedded
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_is_embedded" poppler_fonts_iter_is_embedded :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO CInt

{- |
Returns whether the font associated with /@iter@/ is embedded in the document
-}
fontsIterIsEmbedded ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if font is emebdded, 'False' otherwise -}
fontsIterIsEmbedded iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    result <- poppler_fonts_iter_is_embedded iter'
    let result' = (/= 0) result
    touchManagedPtr iter
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterIsEmbeddedMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo FontsIterIsEmbeddedMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterIsEmbedded

#endif

-- method FontsIter::is_subset
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_is_subset" poppler_fonts_iter_is_subset :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO CInt

{- |
Returns whether the font associated with /@iter@/ is a subset of another font
-}
fontsIterIsSubset ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if font is a subset, 'False' otherwise -}
fontsIterIsSubset iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    result <- poppler_fonts_iter_is_subset iter'
    let result' = (/= 0) result
    touchManagedPtr iter
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterIsSubsetMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo FontsIterIsSubsetMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterIsSubset

#endif

-- method FontsIter::next
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "iter", argType = TInterface (Name {namespace = "Poppler", name = "FontsIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFontsIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_fonts_iter_next" poppler_fonts_iter_next :: 
    Ptr FontsIter ->                        -- iter : TInterface (Name {namespace = "Poppler", name = "FontsIter"})
    IO CInt

{- |
Sets /@iter@/ to point to the next font
-}
fontsIterNext ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FontsIter
    {- ^ /@iter@/: a 'GI.Poppler.Structs.FontsIter.FontsIter' -}
    -> m Bool
    {- ^ __Returns:__ 'True', if /@iter@/ was set to the next font -}
fontsIterNext iter = liftIO $ do
    iter' <- unsafeManagedPtrGetPtr iter
    result <- poppler_fonts_iter_next iter'
    let result' = (/= 0) result
    touchManagedPtr iter
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FontsIterNextMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo FontsIterNextMethodInfo FontsIter signature where
    overloadedMethod _ = fontsIterNext

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveFontsIterMethod (t :: Symbol) (o :: *) :: * where
    ResolveFontsIterMethod "copy" o = FontsIterCopyMethodInfo
    ResolveFontsIterMethod "free" o = FontsIterFreeMethodInfo
    ResolveFontsIterMethod "isEmbedded" o = FontsIterIsEmbeddedMethodInfo
    ResolveFontsIterMethod "isSubset" o = FontsIterIsSubsetMethodInfo
    ResolveFontsIterMethod "next" o = FontsIterNextMethodInfo
    ResolveFontsIterMethod "getEncoding" o = FontsIterGetEncodingMethodInfo
    ResolveFontsIterMethod "getFileName" o = FontsIterGetFileNameMethodInfo
    ResolveFontsIterMethod "getFontType" o = FontsIterGetFontTypeMethodInfo
    ResolveFontsIterMethod "getFullName" o = FontsIterGetFullNameMethodInfo
    ResolveFontsIterMethod "getName" o = FontsIterGetNameMethodInfo
    ResolveFontsIterMethod "getSubstituteName" o = FontsIterGetSubstituteNameMethodInfo
    ResolveFontsIterMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveFontsIterMethod t FontsIter, O.MethodInfo info FontsIter p) => O.IsLabelProxy t (FontsIter -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveFontsIterMethod t FontsIter, O.MethodInfo info FontsIter p) => O.IsLabel t (FontsIter -> 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

#endif