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

'GI.Pango.Objects.Engine.Engine' is the base class for all types of language and
script specific engines. It has no functionality by itself.
-}

module GI.Pango.Objects.Engine
    ( 

-- * Exported types
    Engine(..)                              ,
    IsEngine                                ,
    toEngine                                ,
    noEngine                                ,


    ) 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 qualified GI.GObject.Objects.Object as GObject.Object

newtype Engine = Engine (ManagedPtr Engine)
foreign import ccall "pango_engine_get_type"
    c_pango_engine_get_type :: IO GType

instance GObject Engine where
    gobjectType _ = c_pango_engine_get_type
    

class GObject o => IsEngine o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError Engine a) =>
    IsEngine a
#endif
instance IsEngine Engine
instance GObject.Object.IsObject Engine

toEngine :: IsEngine o => o -> IO Engine
toEngine = unsafeCastTo Engine

noEngine :: Maybe Engine
noEngine = Nothing

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

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

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveEngineMethod t Engine, O.MethodInfo info Engine p) => O.IsLabel t (Engine -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

instance O.HasAttributeList Engine
type instance O.AttributeList Engine = EngineAttributeList
type EngineAttributeList = ('[ ] :: [(Symbol, *)])

type instance O.SignalList Engine = EngineSignalList
type EngineSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])