{-# 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 (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Vte.Structs.CharAttributes
    ( 

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


 -- * 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.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.GI.Base.Signals as B.Signals
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 (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 WrappedPtr CharAttributes where
    wrappedPtrCalloc :: IO (Ptr CharAttributes)
wrappedPtrCalloc = Int -> IO (Ptr CharAttributes)
forall a. Int -> IO (Ptr a)
callocBytes 40
    wrappedPtrCopy :: CharAttributes -> IO CharAttributes
wrappedPtrCopy = \p :: CharAttributes
p -> CharAttributes
-> (Ptr CharAttributes -> IO CharAttributes) -> IO CharAttributes
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr CharAttributes
p (Int -> Ptr CharAttributes -> IO (Ptr CharAttributes)
forall a. WrappedPtr 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, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr CharAttributes -> CharAttributes
CharAttributes)
    wrappedPtrFree :: Maybe (GDestroyNotify CharAttributes)
wrappedPtrFree = GDestroyNotify CharAttributes
-> Maybe (GDestroyNotify CharAttributes)
forall a. a -> Maybe a
Just GDestroyNotify CharAttributes
forall a. FunPtr (Ptr a -> IO ())
ptr_to_g_free

-- | 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. WrappedPtr a => IO (Ptr a)
wrappedPtrCalloc 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, WrappedPtr 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


-- | A convenience alias for `Nothing` :: `Maybe` `CharAttributes`.
noCharAttributes :: Maybe CharAttributes
noCharAttributes :: Maybe CharAttributes
noCharAttributes = Maybe CharAttributes
forall a. Maybe a
Nothing


#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