    {-# LANGUAGE TypeApplications #-}

    -- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- /No description available in the introspection data./

    #if !defined(__HADDOCK_VERSION__)
    #define ENABLE_OVERLOADING
    #endif

    module GI.Vte.Structs.CharAttributes
        (

    -- * Exported types
        CharAttributes(..)                      ,
        newZeroCharAttributes                   ,

     -- * Methods
    -- ** Overloaded methods #method:Overloaded methods#

    #if defined(ENABLE_OVERLOADING)
        ResolveCharAttributesMethod             ,
    #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.BasicTypes as B.Types
    import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
    import qualified Data.GI.Base.GArray as B.GArray
    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 Control.Monad.IO.Class as MIO
    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

    -- | Memory-managed wrapper type.
    newtype CharAttributes = CharAttributes (SP.ManagedPtr CharAttributes)
        deriving (CharAttributes -> CharAttributes -> Bool
    (CharAttributes -> CharAttributes -> Bool)
    -> (CharAttributes -> CharAttributes -> Bool) -> Eq CharAttributes
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: CharAttributes -> CharAttributes -> Bool
    $c/= :: CharAttributes -> CharAttributes -> Bool
    == :: CharAttributes -> CharAttributes -> Bool
    $c== :: CharAttributes -> CharAttributes -> Bool
    Eq)

    instance SP.ManagedPtrNewtype CharAttributes where
        toManagedPtr :: CharAttributes -> ManagedPtr CharAttributes
    toManagedPtr (CharAttributes p :: ManagedPtr CharAttributes
    p) = ManagedPtr CharAttributes
    p

    instance BoxedPtr CharAttributes where
        boxedPtrCopy :: CharAttributes -> IO CharAttributes
    boxedPtrCopy = \p :: CharAttributes
    p -> CharAttributes
    -> (Ptr CharAttributes -> IO CharAttributes) -> IO CharAttributes
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    B.ManagedPtr.withManagedPtr CharAttributes
    p (Int -> Ptr CharAttributes -> IO (Ptr CharAttributes)
    forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
    copyBytes 40 (Ptr CharAttributes -> IO (Ptr CharAttributes))
    -> (Ptr CharAttributes -> IO CharAttributes)
    -> Ptr CharAttributes
    -> IO CharAttributes
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> (ManagedPtr CharAttributes -> CharAttributes)
    -> Ptr CharAttributes -> IO CharAttributes
    forall a.
    (HasCallStack, BoxedPtr a) =>
    (ManagedPtr a -> a) -> Ptr a -> IO a
    B.ManagedPtr.wrapPtr ManagedPtr CharAttributes -> CharAttributes
    CharAttributes)
        boxedPtrFree :: CharAttributes -> IO ()
    boxedPtrFree = \x :: CharAttributes
    x -> CharAttributes -> (Ptr CharAttributes -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    SP.withManagedPtr CharAttributes
    x Ptr CharAttributes -> IO ()
    forall a. Ptr a -> IO ()
    SP.freeMem
    instance CallocPtr CharAttributes where
        boxedPtrCalloc :: IO (Ptr CharAttributes)
    boxedPtrCalloc = Int -> IO (Ptr CharAttributes)
    forall a. Int -> IO (Ptr a)
    callocBytes 40

    -- | Construct a `CharAttributes` struct initialized to zero.
    newZeroCharAttributes :: MonadIO m => m CharAttributes
    newZeroCharAttributes :: m CharAttributes
    newZeroCharAttributes = IO CharAttributes -> m CharAttributes
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO CharAttributes -> m CharAttributes)
    -> IO CharAttributes -> m CharAttributes
    forall a b. (a -> b) -> a -> b
    $ IO (Ptr CharAttributes)
    forall a. CallocPtr a => IO (Ptr a)
    boxedPtrCalloc IO (Ptr CharAttributes)
    -> (Ptr CharAttributes -> IO CharAttributes) -> IO CharAttributes
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= (ManagedPtr CharAttributes -> CharAttributes)
    -> Ptr CharAttributes -> IO CharAttributes
    forall a.
    (HasCallStack, BoxedPtr a) =>
    (ManagedPtr a -> a) -> Ptr a -> IO a
    wrapPtr ManagedPtr CharAttributes -> CharAttributes
    CharAttributes

    instance tag ~ 'AttrSet => Constructible CharAttributes tag where
        new :: (ManagedPtr CharAttributes -> CharAttributes)
    -> [AttrOp CharAttributes tag] -> m CharAttributes
    new _ attrs :: [AttrOp CharAttributes tag]
    attrs = do
            CharAttributes
    o <- m CharAttributes
    forall (m :: * -> *). MonadIO m => m CharAttributes
    newZeroCharAttributes
            CharAttributes -> [AttrOp CharAttributes 'AttrSet] -> m ()
    forall o (m :: * -> *).
    MonadIO m =>
    o -> [AttrOp o 'AttrSet] -> m ()
    GI.Attributes.set CharAttributes
    o [AttrOp CharAttributes tag]
    [AttrOp CharAttributes 'AttrSet]
    attrs
            CharAttributes -> m CharAttributes
    forall (m :: * -> *) a. Monad m => a -> m a
    return CharAttributes
    o

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList CharAttributes
    type instance O.AttributeList CharAttributes = CharAttributesAttributeList
    type CharAttributesAttributeList = ('[ ] :: [(Symbol, *)])
    #endif

    #if defined(ENABLE_OVERLOADING)
    type family ResolveCharAttributesMethod (t :: Symbol) (o :: *) :: * where
        ResolveCharAttributesMethod l o = O.MethodResolutionFailed l o

    instance (info ~ ResolveCharAttributesMethod t CharAttributes, O.MethodInfo info CharAttributes p) => OL.IsLabel t (CharAttributes -> p) where
    #if MIN_VERSION_base(4,10,0)
        fromLabel = O.overloadedMethod @info
    #else
        fromLabel _ = O.overloadedMethod @info
    #endif

    #endif