{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The AtkObjectFactory which creates an AtkNoOpObject. An instance of
-- this is created by an AtkRegistry if no factory type has not been
-- specified to create an accessible object of a particular type.

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

module GI.Atk.Objects.NoOpObjectFactory
    ( 

-- * Exported types
    NoOpObjectFactory(..)                   ,
    IsNoOpObjectFactory                     ,
    toNoOpObjectFactory                     ,
    noNoOpObjectFactory                     ,


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

#if defined(ENABLE_OVERLOADING)
    ResolveNoOpObjectFactoryMethod          ,
#endif


-- ** new #method:new#

    noOpObjectFactoryNew                    ,




    ) 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 {-# SOURCE #-} qualified GI.Atk.Objects.ObjectFactory as Atk.ObjectFactory
import qualified GI.GObject.Objects.Object as GObject.Object

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

instance GObject NoOpObjectFactory where
    gobjectType :: IO GType
gobjectType = IO GType
c_atk_no_op_object_factory_get_type
    

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

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

instance O.HasParentTypes NoOpObjectFactory
type instance O.ParentTypes NoOpObjectFactory = '[Atk.ObjectFactory.ObjectFactory, GObject.Object.Object]

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

-- | A convenience alias for `Nothing` :: `Maybe` `NoOpObjectFactory`.
noNoOpObjectFactory :: Maybe NoOpObjectFactory
noNoOpObjectFactory :: Maybe NoOpObjectFactory
noNoOpObjectFactory = Maybe NoOpObjectFactory
forall a. Maybe a
Nothing

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

instance (info ~ ResolveNoOpObjectFactoryMethod t NoOpObjectFactory, O.MethodInfo info NoOpObjectFactory p) => OL.IsLabel t (NoOpObjectFactory -> 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 NoOpObjectFactory
type instance O.AttributeList NoOpObjectFactory = NoOpObjectFactoryAttributeList
type NoOpObjectFactoryAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif

-- method NoOpObjectFactory::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "Atk" , name = "NoOpObjectFactory" })
-- throws : False
-- Skip return : False

foreign import ccall "atk_no_op_object_factory_new" atk_no_op_object_factory_new :: 
    IO (Ptr NoOpObjectFactory)

-- | Creates an instance of an t'GI.Atk.Objects.ObjectFactory.ObjectFactory' which generates primitive
-- (non-functioning) @/AtkObjects/@.
noOpObjectFactoryNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m NoOpObjectFactory
    -- ^ __Returns:__ an instance of an t'GI.Atk.Objects.ObjectFactory.ObjectFactory'
noOpObjectFactoryNew :: m NoOpObjectFactory
noOpObjectFactoryNew  = IO NoOpObjectFactory -> m NoOpObjectFactory
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO NoOpObjectFactory -> m NoOpObjectFactory)
-> IO NoOpObjectFactory -> m NoOpObjectFactory
forall a b. (a -> b) -> a -> b
$ do
    Ptr NoOpObjectFactory
result <- IO (Ptr NoOpObjectFactory)
atk_no_op_object_factory_new
    Text -> Ptr NoOpObjectFactory -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "noOpObjectFactoryNew" Ptr NoOpObjectFactory
result
    NoOpObjectFactory
result' <- ((ManagedPtr NoOpObjectFactory -> NoOpObjectFactory)
-> Ptr NoOpObjectFactory -> IO NoOpObjectFactory
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr NoOpObjectFactory -> NoOpObjectFactory
NoOpObjectFactory) Ptr NoOpObjectFactory
result
    NoOpObjectFactory -> IO NoOpObjectFactory
forall (m :: * -> *) a. Monad m => a -> m a
return NoOpObjectFactory
result'

#if defined(ENABLE_OVERLOADING)
#endif