{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The t'GI.Pango.Objects.EngineShape.EngineShape' class is implemented by engines that
-- customize the rendering-system dependent part of the
-- Pango pipeline for a particular script or language.
-- A t'GI.Pango.Objects.EngineShape.EngineShape' implementation is then specific to both
-- a particular rendering system or group of rendering systems
-- and to a particular script. For instance, there is one
-- t'GI.Pango.Objects.EngineShape.EngineShape' implementation to handle shaping Arabic
-- for Fontconfig-based backends.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Pango.Objects.EngineShape
    ( 

-- * Exported types
    EngineShape(..)                         ,
    IsEngineShape                           ,
    toEngineShape                           ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveEngineShapeMethod                ,
#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
import qualified GHC.Records as R

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Pango.Objects.Engine as Pango.Engine

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

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

foreign import ccall "pango_engine_shape_get_type"
    c_pango_engine_shape_get_type :: IO B.Types.GType

instance B.Types.TypedObject EngineShape where
    glibType :: IO GType
glibType = IO GType
c_pango_engine_shape_get_type

instance B.Types.GObject EngineShape

-- | Type class for types which can be safely cast to `EngineShape`, for instance with `toEngineShape`.
class (SP.GObject o, O.IsDescendantOf EngineShape o) => IsEngineShape o
instance (SP.GObject o, O.IsDescendantOf EngineShape o) => IsEngineShape o

instance O.HasParentTypes EngineShape
type instance O.ParentTypes EngineShape = '[Pango.Engine.Engine, GObject.Object.Object]

-- | Cast to `EngineShape`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toEngineShape :: (MIO.MonadIO m, IsEngineShape o) => o -> m EngineShape
toEngineShape :: forall (m :: * -> *) o.
(MonadIO m, IsEngineShape o) =>
o -> m EngineShape
toEngineShape = IO EngineShape -> m EngineShape
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO EngineShape -> m EngineShape)
-> (o -> IO EngineShape) -> o -> m EngineShape
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr EngineShape -> EngineShape) -> o -> IO EngineShape
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr EngineShape -> EngineShape
EngineShape

-- | Convert 'EngineShape' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe EngineShape) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_pango_engine_shape_get_type
    gvalueSet_ :: Ptr GValue -> Maybe EngineShape -> IO ()
gvalueSet_ Ptr GValue
gv Maybe EngineShape
P.Nothing = Ptr GValue -> Ptr EngineShape -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr EngineShape
forall a. Ptr a
FP.nullPtr :: FP.Ptr EngineShape)
    gvalueSet_ Ptr GValue
gv (P.Just EngineShape
obj) = EngineShape -> (Ptr EngineShape -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr EngineShape
obj (Ptr GValue -> Ptr EngineShape -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe EngineShape)
gvalueGet_ Ptr GValue
gv = do
        Ptr EngineShape
ptr <- Ptr GValue -> IO (Ptr EngineShape)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr EngineShape)
        if Ptr EngineShape
ptr Ptr EngineShape -> Ptr EngineShape -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr EngineShape
forall a. Ptr a
FP.nullPtr
        then EngineShape -> Maybe EngineShape
forall a. a -> Maybe a
P.Just (EngineShape -> Maybe EngineShape)
-> IO EngineShape -> IO (Maybe EngineShape)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr EngineShape -> EngineShape)
-> Ptr EngineShape -> IO EngineShape
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr EngineShape -> EngineShape
EngineShape Ptr EngineShape
ptr
        else Maybe EngineShape -> IO (Maybe EngineShape)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe EngineShape
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveEngineShapeMethod (t :: Symbol) (o :: *) :: * where
    ResolveEngineShapeMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveEngineShapeMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveEngineShapeMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveEngineShapeMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveEngineShapeMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveEngineShapeMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveEngineShapeMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveEngineShapeMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveEngineShapeMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveEngineShapeMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveEngineShapeMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveEngineShapeMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveEngineShapeMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveEngineShapeMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveEngineShapeMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveEngineShapeMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveEngineShapeMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveEngineShapeMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveEngineShapeMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveEngineShapeMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveEngineShapeMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveEngineShapeMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveEngineShapeMethod l o = O.MethodResolutionFailed l o

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

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveEngineShapeMethod t EngineShape, O.OverloadedMethod info EngineShape p, R.HasField t EngineShape p) => R.HasField t EngineShape p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveEngineShapeMethod t EngineShape, O.OverloadedMethodInfo info EngineShape) => OL.IsLabel t (O.MethodProxy info EngineShape) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

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

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList EngineShape = EngineShapeSignalList
type EngineShapeSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif