{-# 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.EngineLang.EngineLang' class is implemented by engines that
-- customize the rendering-system independent part of the
-- Pango pipeline for a particular script or language. For
-- instance, a custom t'GI.Pango.Objects.EngineLang.EngineLang' could be provided for
-- Thai to implement the dictionary-based word boundary
-- lookups needed for that language.

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

module GI.Pango.Objects.EngineLang
    ( 

-- * Exported types
    EngineLang(..)                          ,
    IsEngineLang                            ,
    toEngineLang                            ,
    noEngineLang                            ,


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

#if defined(ENABLE_OVERLOADING)
    ResolveEngineLangMethod                 ,
#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

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

-- | Memory-managed wrapper type.
newtype EngineLang = EngineLang (ManagedPtr EngineLang)
    deriving (EngineLang -> EngineLang -> Bool
(EngineLang -> EngineLang -> Bool)
-> (EngineLang -> EngineLang -> Bool) -> Eq EngineLang
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EngineLang -> EngineLang -> Bool
$c/= :: EngineLang -> EngineLang -> Bool
== :: EngineLang -> EngineLang -> Bool
$c== :: EngineLang -> EngineLang -> Bool
Eq)
foreign import ccall "pango_engine_lang_get_type"
    c_pango_engine_lang_get_type :: IO GType

instance GObject EngineLang where
    gobjectType :: IO GType
gobjectType = IO GType
c_pango_engine_lang_get_type
    

-- | Convert 'EngineLang' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue EngineLang where
    toGValue :: EngineLang -> IO GValue
toGValue o :: EngineLang
o = do
        GType
gtype <- IO GType
c_pango_engine_lang_get_type
        EngineLang -> (Ptr EngineLang -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr EngineLang
o (GType
-> (GValue -> Ptr EngineLang -> IO ())
-> Ptr EngineLang
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr EngineLang -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO EngineLang
fromGValue gv :: GValue
gv = do
        Ptr EngineLang
ptr <- GValue -> IO (Ptr EngineLang)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr EngineLang)
        (ManagedPtr EngineLang -> EngineLang)
-> Ptr EngineLang -> IO EngineLang
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr EngineLang -> EngineLang
EngineLang Ptr EngineLang
ptr
        
    

-- | Type class for types which can be safely cast to `EngineLang`, for instance with `toEngineLang`.
class (GObject o, O.IsDescendantOf EngineLang o) => IsEngineLang o
instance (GObject o, O.IsDescendantOf EngineLang o) => IsEngineLang o

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

-- | Cast to `EngineLang`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toEngineLang :: (MonadIO m, IsEngineLang o) => o -> m EngineLang
toEngineLang :: o -> m EngineLang
toEngineLang = IO EngineLang -> m EngineLang
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EngineLang -> m EngineLang)
-> (o -> IO EngineLang) -> o -> m EngineLang
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr EngineLang -> EngineLang) -> o -> IO EngineLang
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr EngineLang -> EngineLang
EngineLang

-- | A convenience alias for `Nothing` :: `Maybe` `EngineLang`.
noEngineLang :: Maybe EngineLang
noEngineLang :: Maybe EngineLang
noEngineLang = Maybe EngineLang
forall a. Maybe a
Nothing

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

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

#endif

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

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif