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

module GI.Atk.Objects.Misc
    ( 

-- * Exported types
    Misc(..)                                ,
    MiscK                                   ,
    toMisc                                  ,
    noMisc                                  ,


 -- * Methods
-- ** miscGetInstance
    miscGetInstance                         ,


-- ** miscThreadsEnter
    miscThreadsEnter                        ,


-- ** miscThreadsLeave
    miscThreadsLeave                        ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Atk.Types
import GI.Atk.Callbacks
import qualified GI.GObject as GObject

newtype Misc = Misc (ForeignPtr Misc)
foreign import ccall "atk_misc_get_type"
    c_atk_misc_get_type :: IO GType

type instance ParentTypes Misc = MiscParentTypes
type MiscParentTypes = '[GObject.Object]

instance GObject Misc where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_atk_misc_get_type
    

class GObject o => MiscK o
instance (GObject o, IsDescendantOf Misc o) => MiscK o

toMisc :: MiscK o => o -> IO Misc
toMisc = unsafeCastTo Misc

noMisc :: Maybe Misc
noMisc = Nothing

type instance AttributeList Misc = MiscAttributeList
type MiscAttributeList = ('[ ] :: [(Symbol, *)])

type instance SignalList Misc = MiscSignalList
type MiscSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method Misc::threads_enter
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Atk" "Misc", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Atk" "Misc", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "atk_misc_threads_enter" atk_misc_threads_enter :: 
    Ptr Misc ->                             -- _obj : TInterface "Atk" "Misc"
    IO ()

{-# DEPRECATED miscThreadsEnter ["Since 2.12."]#-}
miscThreadsEnter ::
    (MonadIO m, MiscK a) =>
    a ->                                    -- _obj
    m ()
miscThreadsEnter _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    atk_misc_threads_enter _obj'
    touchManagedPtr _obj
    return ()

-- method Misc::threads_leave
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Atk" "Misc", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Atk" "Misc", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "atk_misc_threads_leave" atk_misc_threads_leave :: 
    Ptr Misc ->                             -- _obj : TInterface "Atk" "Misc"
    IO ()

{-# DEPRECATED miscThreadsLeave ["Since 2.12."]#-}
miscThreadsLeave ::
    (MonadIO m, MiscK a) =>
    a ->                                    -- _obj
    m ()
miscThreadsLeave _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    atk_misc_threads_leave _obj'
    touchManagedPtr _obj
    return ()

-- method Misc::get_instance
-- method type : MemberFunction
-- Args : []
-- Lengths : []
-- hInArgs : []
-- returnType : TInterface "Atk" "Misc"
-- throws : False
-- Skip return : False

foreign import ccall "atk_misc_get_instance" atk_misc_get_instance :: 
    IO (Ptr Misc)

{-# DEPRECATED miscGetInstance ["Since 2.12."]#-}
miscGetInstance ::
    (MonadIO m) =>
    m Misc
miscGetInstance  = liftIO $ do
    result <- atk_misc_get_instance
    checkUnexpectedReturnNULL "atk_misc_get_instance" result
    result' <- (newObject Misc) result
    return result'