{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Clutter.Objects.Script
(
Script(..) ,
IsScript ,
toScript ,
#if defined(ENABLE_OVERLOADING)
ResolveScriptMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ScriptAddSearchPathsMethodInfo ,
#endif
scriptAddSearchPaths ,
#if defined(ENABLE_OVERLOADING)
ScriptAddStatesMethodInfo ,
#endif
scriptAddStates ,
#if defined(ENABLE_OVERLOADING)
ScriptConnectSignalsMethodInfo ,
#endif
scriptConnectSignals ,
#if defined(ENABLE_OVERLOADING)
ScriptConnectSignalsFullMethodInfo ,
#endif
scriptConnectSignalsFull ,
#if defined(ENABLE_OVERLOADING)
ScriptEnsureObjectsMethodInfo ,
#endif
scriptEnsureObjects ,
#if defined(ENABLE_OVERLOADING)
ScriptGetObjectMethodInfo ,
#endif
scriptGetObject ,
#if defined(ENABLE_OVERLOADING)
ScriptGetStatesMethodInfo ,
#endif
scriptGetStates ,
#if defined(ENABLE_OVERLOADING)
ScriptGetTranslationDomainMethodInfo ,
#endif
scriptGetTranslationDomain ,
#if defined(ENABLE_OVERLOADING)
ScriptGetTypeFromNameMethodInfo ,
#endif
scriptGetTypeFromName ,
#if defined(ENABLE_OVERLOADING)
ScriptListObjectsMethodInfo ,
#endif
scriptListObjects ,
#if defined(ENABLE_OVERLOADING)
ScriptLoadFromDataMethodInfo ,
#endif
scriptLoadFromData ,
#if defined(ENABLE_OVERLOADING)
ScriptLoadFromFileMethodInfo ,
#endif
scriptLoadFromFile ,
#if defined(ENABLE_OVERLOADING)
ScriptLoadFromResourceMethodInfo ,
#endif
scriptLoadFromResource ,
#if defined(ENABLE_OVERLOADING)
ScriptLookupFilenameMethodInfo ,
#endif
scriptLookupFilename ,
scriptNew ,
#if defined(ENABLE_OVERLOADING)
ScriptSetTranslationDomainMethodInfo ,
#endif
scriptSetTranslationDomain ,
#if defined(ENABLE_OVERLOADING)
ScriptUnmergeObjectsMethodInfo ,
#endif
scriptUnmergeObjects ,
#if defined(ENABLE_OVERLOADING)
ScriptFilenamePropertyInfo ,
#endif
getScriptFilename ,
#if defined(ENABLE_OVERLOADING)
scriptFilename ,
#endif
#if defined(ENABLE_OVERLOADING)
ScriptFilenameSetPropertyInfo ,
#endif
getScriptFilenameSet ,
#if defined(ENABLE_OVERLOADING)
scriptFilenameSet ,
#endif
#if defined(ENABLE_OVERLOADING)
ScriptTranslationDomainPropertyInfo ,
#endif
clearScriptTranslationDomain ,
constructScriptTranslationDomain ,
getScriptTranslationDomain ,
#if defined(ENABLE_OVERLOADING)
scriptTranslationDomain ,
#endif
setScriptTranslationDomain ,
) 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.GHashTable as B.GHT
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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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.Clutter.Callbacks as Clutter.Callbacks
import {-# SOURCE #-} qualified GI.Clutter.Objects.State as Clutter.State
import qualified GI.GObject.Objects.Object as GObject.Object
newtype Script = Script (SP.ManagedPtr Script)
deriving (Script -> Script -> Bool
(Script -> Script -> Bool)
-> (Script -> Script -> Bool) -> Eq Script
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Script -> Script -> Bool
== :: Script -> Script -> Bool
$c/= :: Script -> Script -> Bool
/= :: Script -> Script -> Bool
Eq)
instance SP.ManagedPtrNewtype Script where
toManagedPtr :: Script -> ManagedPtr Script
toManagedPtr (Script ManagedPtr Script
p) = ManagedPtr Script
p
foreign import ccall "clutter_script_get_type"
c_clutter_script_get_type :: IO B.Types.GType
instance B.Types.TypedObject Script where
glibType :: IO GType
glibType = IO GType
c_clutter_script_get_type
instance B.Types.GObject Script
class (SP.GObject o, O.IsDescendantOf Script o) => IsScript o
instance (SP.GObject o, O.IsDescendantOf Script o) => IsScript o
instance O.HasParentTypes Script
type instance O.ParentTypes Script = '[GObject.Object.Object]
toScript :: (MIO.MonadIO m, IsScript o) => o -> m Script
toScript :: forall (m :: * -> *) o. (MonadIO m, IsScript o) => o -> m Script
toScript = IO Script -> m Script
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Script -> m Script) -> (o -> IO Script) -> o -> m Script
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Script -> Script) -> o -> IO Script
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Script -> Script
Script
instance B.GValue.IsGValue (Maybe Script) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_clutter_script_get_type
gvalueSet_ :: Ptr GValue -> Maybe Script -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Script
P.Nothing = Ptr GValue -> Ptr Script -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Script
forall a. Ptr a
FP.nullPtr :: FP.Ptr Script)
gvalueSet_ Ptr GValue
gv (P.Just Script
obj) = Script -> (Ptr Script -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Script
obj (Ptr GValue -> Ptr Script -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Script)
gvalueGet_ Ptr GValue
gv = do
Ptr Script
ptr <- Ptr GValue -> IO (Ptr Script)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Script)
if Ptr Script
ptr Ptr Script -> Ptr Script -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Script
forall a. Ptr a
FP.nullPtr
then Script -> Maybe Script
forall a. a -> Maybe a
P.Just (Script -> Maybe Script) -> IO Script -> IO (Maybe Script)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Script -> Script) -> Ptr Script -> IO Script
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Script -> Script
Script Ptr Script
ptr
else Maybe Script -> IO (Maybe Script)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Script
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveScriptMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveScriptMethod "addSearchPaths" o = ScriptAddSearchPathsMethodInfo
ResolveScriptMethod "addStates" o = ScriptAddStatesMethodInfo
ResolveScriptMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveScriptMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveScriptMethod "connectSignals" o = ScriptConnectSignalsMethodInfo
ResolveScriptMethod "connectSignalsFull" o = ScriptConnectSignalsFullMethodInfo
ResolveScriptMethod "ensureObjects" o = ScriptEnsureObjectsMethodInfo
ResolveScriptMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveScriptMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveScriptMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveScriptMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveScriptMethod "listObjects" o = ScriptListObjectsMethodInfo
ResolveScriptMethod "loadFromData" o = ScriptLoadFromDataMethodInfo
ResolveScriptMethod "loadFromFile" o = ScriptLoadFromFileMethodInfo
ResolveScriptMethod "loadFromResource" o = ScriptLoadFromResourceMethodInfo
ResolveScriptMethod "lookupFilename" o = ScriptLookupFilenameMethodInfo
ResolveScriptMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveScriptMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveScriptMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveScriptMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveScriptMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveScriptMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveScriptMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveScriptMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveScriptMethod "unmergeObjects" o = ScriptUnmergeObjectsMethodInfo
ResolveScriptMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveScriptMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveScriptMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveScriptMethod "getObject" o = ScriptGetObjectMethodInfo
ResolveScriptMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveScriptMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveScriptMethod "getStates" o = ScriptGetStatesMethodInfo
ResolveScriptMethod "getTranslationDomain" o = ScriptGetTranslationDomainMethodInfo
ResolveScriptMethod "getTypeFromName" o = ScriptGetTypeFromNameMethodInfo
ResolveScriptMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveScriptMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveScriptMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveScriptMethod "setTranslationDomain" o = ScriptSetTranslationDomainMethodInfo
ResolveScriptMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveScriptMethod t Script, O.OverloadedMethod info Script p) => OL.IsLabel t (Script -> 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 ~ ResolveScriptMethod t Script, O.OverloadedMethod info Script p, R.HasField t Script p) => R.HasField t Script p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveScriptMethod t Script, O.OverloadedMethodInfo info Script) => OL.IsLabel t (O.MethodProxy info Script) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getScriptFilename :: (MonadIO m, IsScript o) => o -> m (Maybe T.Text)
getScriptFilename :: forall (m :: * -> *) o.
(MonadIO m, IsScript o) =>
o -> m (Maybe Text)
getScriptFilename o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"filename"
#if defined(ENABLE_OVERLOADING)
data ScriptFilenamePropertyInfo
instance AttrInfo ScriptFilenamePropertyInfo where
type AttrAllowedOps ScriptFilenamePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ScriptFilenamePropertyInfo = IsScript
type AttrSetTypeConstraint ScriptFilenamePropertyInfo = (~) ()
type AttrTransferTypeConstraint ScriptFilenamePropertyInfo = (~) ()
type AttrTransferType ScriptFilenamePropertyInfo = ()
type AttrGetType ScriptFilenamePropertyInfo = (Maybe T.Text)
type AttrLabel ScriptFilenamePropertyInfo = "filename"
type AttrOrigin ScriptFilenamePropertyInfo = Script
attrGet = getScriptFilename
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.filename"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#g:attr:filename"
})
#endif
getScriptFilenameSet :: (MonadIO m, IsScript o) => o -> m Bool
getScriptFilenameSet :: forall (m :: * -> *) o. (MonadIO m, IsScript o) => o -> m Bool
getScriptFilenameSet o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"filename-set"
#if defined(ENABLE_OVERLOADING)
data ScriptFilenameSetPropertyInfo
instance AttrInfo ScriptFilenameSetPropertyInfo where
type AttrAllowedOps ScriptFilenameSetPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint ScriptFilenameSetPropertyInfo = IsScript
type AttrSetTypeConstraint ScriptFilenameSetPropertyInfo = (~) ()
type AttrTransferTypeConstraint ScriptFilenameSetPropertyInfo = (~) ()
type AttrTransferType ScriptFilenameSetPropertyInfo = ()
type AttrGetType ScriptFilenameSetPropertyInfo = Bool
type AttrLabel ScriptFilenameSetPropertyInfo = "filename-set"
type AttrOrigin ScriptFilenameSetPropertyInfo = Script
attrGet = getScriptFilenameSet
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.filenameSet"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#g:attr:filenameSet"
})
#endif
getScriptTranslationDomain :: (MonadIO m, IsScript o) => o -> m T.Text
getScriptTranslationDomain :: forall (m :: * -> *) o. (MonadIO m, IsScript o) => o -> m Text
getScriptTranslationDomain o
obj = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getScriptTranslationDomain" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"translation-domain"
setScriptTranslationDomain :: (MonadIO m, IsScript o) => o -> T.Text -> m ()
setScriptTranslationDomain :: forall (m :: * -> *) o.
(MonadIO m, IsScript o) =>
o -> Text -> m ()
setScriptTranslationDomain o
obj Text
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"translation-domain" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructScriptTranslationDomain :: (IsScript o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructScriptTranslationDomain :: forall o (m :: * -> *).
(IsScript o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructScriptTranslationDomain Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"translation-domain" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
clearScriptTranslationDomain :: (MonadIO m, IsScript o) => o -> m ()
clearScriptTranslationDomain :: forall (m :: * -> *) o. (MonadIO m, IsScript o) => o -> m ()
clearScriptTranslationDomain o
obj = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"translation-domain" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)
#if defined(ENABLE_OVERLOADING)
data ScriptTranslationDomainPropertyInfo
instance AttrInfo ScriptTranslationDomainPropertyInfo where
type AttrAllowedOps ScriptTranslationDomainPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ScriptTranslationDomainPropertyInfo = IsScript
type AttrSetTypeConstraint ScriptTranslationDomainPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint ScriptTranslationDomainPropertyInfo = (~) T.Text
type AttrTransferType ScriptTranslationDomainPropertyInfo = T.Text
type AttrGetType ScriptTranslationDomainPropertyInfo = T.Text
type AttrLabel ScriptTranslationDomainPropertyInfo = "translation-domain"
type AttrOrigin ScriptTranslationDomainPropertyInfo = Script
attrGet = getScriptTranslationDomain
attrSet = setScriptTranslationDomain
attrTransfer _ v = do
return v
attrConstruct = constructScriptTranslationDomain
attrClear = clearScriptTranslationDomain
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.translationDomain"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#g:attr:translationDomain"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Script
type instance O.AttributeList Script = ScriptAttributeList
type ScriptAttributeList = ('[ '("filename", ScriptFilenamePropertyInfo), '("filenameSet", ScriptFilenameSetPropertyInfo), '("translationDomain", ScriptTranslationDomainPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
scriptFilename :: AttrLabelProxy "filename"
scriptFilename = AttrLabelProxy
scriptFilenameSet :: AttrLabelProxy "filenameSet"
scriptFilenameSet = AttrLabelProxy
scriptTranslationDomain :: AttrLabelProxy "translationDomain"
scriptTranslationDomain = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Script = ScriptSignalList
type ScriptSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "clutter_script_new" clutter_script_new ::
IO (Ptr Script)
scriptNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Script
scriptNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Script
scriptNew = IO Script -> m Script
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Script -> m Script) -> IO Script -> m Script
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
result <- IO (Ptr Script)
clutter_script_new
Text -> Ptr Script -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"scriptNew" Ptr Script
result
Script
result' <- ((ManagedPtr Script -> Script) -> Ptr Script -> IO Script
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Script -> Script
Script) Ptr Script
result
Script -> IO Script
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Script
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "clutter_script_add_search_paths" clutter_script_add_search_paths ::
Ptr Script ->
Ptr CString ->
Word64 ->
IO ()
scriptAddSearchPaths ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> [T.Text]
-> m ()
scriptAddSearchPaths :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> [Text] -> m ()
scriptAddSearchPaths a
script [Text]
paths = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
let nPaths :: Word64
nPaths = Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word64) -> Int -> Word64
forall a b. (a -> b) -> a -> b
$ [Text] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Text]
paths
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr (Ptr CChar)
paths' <- [Text] -> IO (Ptr (Ptr CChar))
packUTF8CArray [Text]
paths
Ptr Script -> Ptr (Ptr CChar) -> Word64 -> IO ()
clutter_script_add_search_paths Ptr Script
script' Ptr (Ptr CChar)
paths' Word64
nPaths
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
(Word64 -> (Ptr CChar -> IO ()) -> Ptr (Ptr CChar) -> IO ()
forall a b c.
(Storable a, Integral b) =>
b -> (a -> IO c) -> Ptr a -> IO ()
mapCArrayWithLength Word64
nPaths) Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
paths'
Ptr (Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
paths'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScriptAddSearchPathsMethodInfo
instance (signature ~ ([T.Text] -> m ()), MonadIO m, IsScript a) => O.OverloadedMethod ScriptAddSearchPathsMethodInfo a signature where
overloadedMethod = scriptAddSearchPaths
instance O.OverloadedMethodInfo ScriptAddSearchPathsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptAddSearchPaths",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptAddSearchPaths"
})
#endif
foreign import ccall "clutter_script_add_states" clutter_script_add_states ::
Ptr Script ->
CString ->
Ptr Clutter.State.State ->
IO ()
{-# DEPRECATED scriptAddStates ["(Since version 1.12)"] #-}
scriptAddStates ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a, Clutter.State.IsState b) =>
a
-> Maybe (T.Text)
-> b
-> m ()
scriptAddStates :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsScript a, IsState b) =>
a -> Maybe Text -> b -> m ()
scriptAddStates a
script Maybe Text
name b
state = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr CChar
maybeName <- case Maybe Text
name of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jName -> do
Ptr CChar
jName' <- Text -> IO (Ptr CChar)
textToCString Text
jName
Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jName'
Ptr State
state' <- b -> IO (Ptr State)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
state
Ptr Script -> Ptr CChar -> Ptr State -> IO ()
clutter_script_add_states Ptr Script
script' Ptr CChar
maybeName Ptr State
state'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
state
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeName
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScriptAddStatesMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> m ()), MonadIO m, IsScript a, Clutter.State.IsState b) => O.OverloadedMethod ScriptAddStatesMethodInfo a signature where
overloadedMethod = scriptAddStates
instance O.OverloadedMethodInfo ScriptAddStatesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptAddStates",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptAddStates"
})
#endif
foreign import ccall "clutter_script_connect_signals" clutter_script_connect_signals ::
Ptr Script ->
Ptr () ->
IO ()
scriptConnectSignals ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> Ptr ()
-> m ()
scriptConnectSignals :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> Ptr () -> m ()
scriptConnectSignals a
script Ptr ()
userData = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr Script -> Ptr () -> IO ()
clutter_script_connect_signals Ptr Script
script' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScriptConnectSignalsMethodInfo
instance (signature ~ (Ptr () -> m ()), MonadIO m, IsScript a) => O.OverloadedMethod ScriptConnectSignalsMethodInfo a signature where
overloadedMethod = scriptConnectSignals
instance O.OverloadedMethodInfo ScriptConnectSignalsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptConnectSignals",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptConnectSignals"
})
#endif
foreign import ccall "clutter_script_connect_signals_full" clutter_script_connect_signals_full ::
Ptr Script ->
FunPtr Clutter.Callbacks.C_ScriptConnectFunc ->
Ptr () ->
IO ()
scriptConnectSignalsFull ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> Clutter.Callbacks.ScriptConnectFunc
-> m ()
scriptConnectSignalsFull :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> ScriptConnectFunc -> m ()
scriptConnectSignalsFull a
script ScriptConnectFunc
func = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
FunPtr C_ScriptConnectFunc
func' <- C_ScriptConnectFunc -> IO (FunPtr C_ScriptConnectFunc)
Clutter.Callbacks.mk_ScriptConnectFunc (Maybe (Ptr (FunPtr C_ScriptConnectFunc))
-> ScriptConnectFunc_WithClosures -> C_ScriptConnectFunc
Clutter.Callbacks.wrap_ScriptConnectFunc Maybe (Ptr (FunPtr C_ScriptConnectFunc))
forall a. Maybe a
Nothing (ScriptConnectFunc -> ScriptConnectFunc_WithClosures
Clutter.Callbacks.drop_closures_ScriptConnectFunc ScriptConnectFunc
func))
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Script -> FunPtr C_ScriptConnectFunc -> Ptr () -> IO ()
clutter_script_connect_signals_full Ptr Script
script' FunPtr C_ScriptConnectFunc
func' Ptr ()
forall a. Ptr a
userData
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_ScriptConnectFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_ScriptConnectFunc
func'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScriptConnectSignalsFullMethodInfo
instance (signature ~ (Clutter.Callbacks.ScriptConnectFunc -> m ()), MonadIO m, IsScript a) => O.OverloadedMethod ScriptConnectSignalsFullMethodInfo a signature where
overloadedMethod = scriptConnectSignalsFull
instance O.OverloadedMethodInfo ScriptConnectSignalsFullMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptConnectSignalsFull",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptConnectSignalsFull"
})
#endif
foreign import ccall "clutter_script_ensure_objects" clutter_script_ensure_objects ::
Ptr Script ->
IO ()
scriptEnsureObjects ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> m ()
scriptEnsureObjects :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> m ()
scriptEnsureObjects a
script = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr Script -> IO ()
clutter_script_ensure_objects Ptr Script
script'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScriptEnsureObjectsMethodInfo
instance (signature ~ (m ()), MonadIO m, IsScript a) => O.OverloadedMethod ScriptEnsureObjectsMethodInfo a signature where
overloadedMethod = scriptEnsureObjects
instance O.OverloadedMethodInfo ScriptEnsureObjectsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptEnsureObjects",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptEnsureObjects"
})
#endif
foreign import ccall "clutter_script_get_object" clutter_script_get_object ::
Ptr Script ->
CString ->
IO (Ptr GObject.Object.Object)
scriptGetObject ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> T.Text
-> m GObject.Object.Object
scriptGetObject :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> Text -> m Object
scriptGetObject a
script Text
name = IO Object -> m Object
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Object -> m Object) -> IO Object -> m Object
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr CChar
name' <- Text -> IO (Ptr CChar)
textToCString Text
name
Ptr Object
result <- Ptr Script -> Ptr CChar -> IO (Ptr Object)
clutter_script_get_object Ptr Script
script' Ptr CChar
name'
Text -> Ptr Object -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"scriptGetObject" Ptr Object
result
Object
result' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
name'
Object -> IO Object
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result'
#if defined(ENABLE_OVERLOADING)
data ScriptGetObjectMethodInfo
instance (signature ~ (T.Text -> m GObject.Object.Object), MonadIO m, IsScript a) => O.OverloadedMethod ScriptGetObjectMethodInfo a signature where
overloadedMethod = scriptGetObject
instance O.OverloadedMethodInfo ScriptGetObjectMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptGetObject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptGetObject"
})
#endif
foreign import ccall "clutter_script_get_states" clutter_script_get_states ::
Ptr Script ->
CString ->
IO (Ptr Clutter.State.State)
{-# DEPRECATED scriptGetStates ["(Since version 1.12)"] #-}
scriptGetStates ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> Maybe (T.Text)
-> m Clutter.State.State
scriptGetStates :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> Maybe Text -> m State
scriptGetStates a
script Maybe Text
name = IO State -> m State
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO State -> m State) -> IO State -> m State
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr CChar
maybeName <- case Maybe Text
name of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jName -> do
Ptr CChar
jName' <- Text -> IO (Ptr CChar)
textToCString Text
jName
Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jName'
Ptr State
result <- Ptr Script -> Ptr CChar -> IO (Ptr State)
clutter_script_get_states Ptr Script
script' Ptr CChar
maybeName
Text -> Ptr State -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"scriptGetStates" Ptr State
result
State
result' <- ((ManagedPtr State -> State) -> Ptr State -> IO State
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr State -> State
Clutter.State.State) Ptr State
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeName
State -> IO State
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return State
result'
#if defined(ENABLE_OVERLOADING)
data ScriptGetStatesMethodInfo
instance (signature ~ (Maybe (T.Text) -> m Clutter.State.State), MonadIO m, IsScript a) => O.OverloadedMethod ScriptGetStatesMethodInfo a signature where
overloadedMethod = scriptGetStates
instance O.OverloadedMethodInfo ScriptGetStatesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptGetStates",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptGetStates"
})
#endif
foreign import ccall "clutter_script_get_translation_domain" clutter_script_get_translation_domain ::
Ptr Script ->
IO CString
scriptGetTranslationDomain ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> m T.Text
scriptGetTranslationDomain :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> m Text
scriptGetTranslationDomain a
script = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr CChar
result <- Ptr Script -> IO (Ptr CChar)
clutter_script_get_translation_domain Ptr Script
script'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"scriptGetTranslationDomain" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data ScriptGetTranslationDomainMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsScript a) => O.OverloadedMethod ScriptGetTranslationDomainMethodInfo a signature where
overloadedMethod = scriptGetTranslationDomain
instance O.OverloadedMethodInfo ScriptGetTranslationDomainMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptGetTranslationDomain",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptGetTranslationDomain"
})
#endif
foreign import ccall "clutter_script_get_type_from_name" clutter_script_get_type_from_name ::
Ptr Script ->
CString ->
IO CGType
scriptGetTypeFromName ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> T.Text
-> m GType
scriptGetTypeFromName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> Text -> m GType
scriptGetTypeFromName a
script Text
typeName = IO GType -> m GType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr CChar
typeName' <- Text -> IO (Ptr CChar)
textToCString Text
typeName
Word64
result <- Ptr Script -> Ptr CChar -> IO Word64
clutter_script_get_type_from_name Ptr Script
script' Ptr CChar
typeName'
let result' :: GType
result' = Word64 -> GType
GType Word64
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
typeName'
GType -> IO GType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'
#if defined(ENABLE_OVERLOADING)
data ScriptGetTypeFromNameMethodInfo
instance (signature ~ (T.Text -> m GType), MonadIO m, IsScript a) => O.OverloadedMethod ScriptGetTypeFromNameMethodInfo a signature where
overloadedMethod = scriptGetTypeFromName
instance O.OverloadedMethodInfo ScriptGetTypeFromNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptGetTypeFromName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptGetTypeFromName"
})
#endif
foreign import ccall "clutter_script_list_objects" clutter_script_list_objects ::
Ptr Script ->
IO (Ptr (GList (Ptr GObject.Object.Object)))
scriptListObjects ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> m [GObject.Object.Object]
scriptListObjects :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> m [Object]
scriptListObjects a
script = IO [Object] -> m [Object]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Object] -> m [Object]) -> IO [Object] -> m [Object]
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr (GList (Ptr Object))
result <- Ptr Script -> IO (Ptr (GList (Ptr Object)))
clutter_script_list_objects Ptr Script
script'
[Ptr Object]
result' <- Ptr (GList (Ptr Object)) -> IO [Ptr Object]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Object))
result
[Object]
result'' <- (Ptr Object -> IO Object) -> [Ptr Object] -> IO [Object]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) [Ptr Object]
result'
Ptr (GList (Ptr Object)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Object))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
[Object] -> IO [Object]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Object]
result''
#if defined(ENABLE_OVERLOADING)
data ScriptListObjectsMethodInfo
instance (signature ~ (m [GObject.Object.Object]), MonadIO m, IsScript a) => O.OverloadedMethod ScriptListObjectsMethodInfo a signature where
overloadedMethod = scriptListObjects
instance O.OverloadedMethodInfo ScriptListObjectsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptListObjects",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptListObjects"
})
#endif
foreign import ccall "clutter_script_load_from_data" clutter_script_load_from_data ::
Ptr Script ->
CString ->
Int64 ->
Ptr (Ptr GError) ->
IO Word32
scriptLoadFromData ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> T.Text
-> Int64
-> m Word32
scriptLoadFromData :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> Text -> Int64 -> m Word32
scriptLoadFromData a
script Text
data_ Int64
length_ = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr CChar
data_' <- Text -> IO (Ptr CChar)
textToCString Text
data_
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Script -> Ptr CChar -> Int64 -> Ptr (Ptr GError) -> IO Word32
clutter_script_load_from_data Ptr Script
script' Ptr CChar
data_' Int64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
data_'
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
data_'
)
#if defined(ENABLE_OVERLOADING)
data ScriptLoadFromDataMethodInfo
instance (signature ~ (T.Text -> Int64 -> m Word32), MonadIO m, IsScript a) => O.OverloadedMethod ScriptLoadFromDataMethodInfo a signature where
overloadedMethod = scriptLoadFromData
instance O.OverloadedMethodInfo ScriptLoadFromDataMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptLoadFromData",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptLoadFromData"
})
#endif
foreign import ccall "clutter_script_load_from_file" clutter_script_load_from_file ::
Ptr Script ->
CString ->
Ptr (Ptr GError) ->
IO Word32
scriptLoadFromFile ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> T.Text
-> m Word32
scriptLoadFromFile :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> Text -> m Word32
scriptLoadFromFile a
script Text
filename = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr CChar
filename' <- Text -> IO (Ptr CChar)
textToCString Text
filename
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Script -> Ptr CChar -> Ptr (Ptr GError) -> IO Word32
clutter_script_load_from_file Ptr Script
script' Ptr CChar
filename'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
filename'
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
filename'
)
#if defined(ENABLE_OVERLOADING)
data ScriptLoadFromFileMethodInfo
instance (signature ~ (T.Text -> m Word32), MonadIO m, IsScript a) => O.OverloadedMethod ScriptLoadFromFileMethodInfo a signature where
overloadedMethod = scriptLoadFromFile
instance O.OverloadedMethodInfo ScriptLoadFromFileMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptLoadFromFile",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptLoadFromFile"
})
#endif
foreign import ccall "clutter_script_load_from_resource" clutter_script_load_from_resource ::
Ptr Script ->
CString ->
Ptr (Ptr GError) ->
IO Word32
scriptLoadFromResource ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> T.Text
-> m Word32
scriptLoadFromResource :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> Text -> m Word32
scriptLoadFromResource a
script Text
resourcePath = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr CChar
resourcePath' <- Text -> IO (Ptr CChar)
textToCString Text
resourcePath
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Script -> Ptr CChar -> Ptr (Ptr GError) -> IO Word32
clutter_script_load_from_resource Ptr Script
script' Ptr CChar
resourcePath'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
resourcePath'
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
resourcePath'
)
#if defined(ENABLE_OVERLOADING)
data ScriptLoadFromResourceMethodInfo
instance (signature ~ (T.Text -> m Word32), MonadIO m, IsScript a) => O.OverloadedMethod ScriptLoadFromResourceMethodInfo a signature where
overloadedMethod = scriptLoadFromResource
instance O.OverloadedMethodInfo ScriptLoadFromResourceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptLoadFromResource",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptLoadFromResource"
})
#endif
foreign import ccall "clutter_script_lookup_filename" clutter_script_lookup_filename ::
Ptr Script ->
CString ->
IO CString
scriptLookupFilename ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> T.Text
-> m T.Text
scriptLookupFilename :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> Text -> m Text
scriptLookupFilename a
script Text
filename = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr CChar
filename' <- Text -> IO (Ptr CChar)
textToCString Text
filename
Ptr CChar
result <- Ptr Script -> Ptr CChar -> IO (Ptr CChar)
clutter_script_lookup_filename Ptr Script
script' Ptr CChar
filename'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"scriptLookupFilename" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
filename'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data ScriptLookupFilenameMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsScript a) => O.OverloadedMethod ScriptLookupFilenameMethodInfo a signature where
overloadedMethod = scriptLookupFilename
instance O.OverloadedMethodInfo ScriptLookupFilenameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptLookupFilename",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptLookupFilename"
})
#endif
foreign import ccall "clutter_script_set_translation_domain" clutter_script_set_translation_domain ::
Ptr Script ->
CString ->
IO ()
scriptSetTranslationDomain ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> Maybe (T.Text)
-> m ()
scriptSetTranslationDomain :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> Maybe Text -> m ()
scriptSetTranslationDomain a
script Maybe Text
domain = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr CChar
maybeDomain <- case Maybe Text
domain of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jDomain -> do
Ptr CChar
jDomain' <- Text -> IO (Ptr CChar)
textToCString Text
jDomain
Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jDomain'
Ptr Script -> Ptr CChar -> IO ()
clutter_script_set_translation_domain Ptr Script
script' Ptr CChar
maybeDomain
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeDomain
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScriptSetTranslationDomainMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsScript a) => O.OverloadedMethod ScriptSetTranslationDomainMethodInfo a signature where
overloadedMethod = scriptSetTranslationDomain
instance O.OverloadedMethodInfo ScriptSetTranslationDomainMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptSetTranslationDomain",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptSetTranslationDomain"
})
#endif
foreign import ccall "clutter_script_unmerge_objects" clutter_script_unmerge_objects ::
Ptr Script ->
Word32 ->
IO ()
scriptUnmergeObjects ::
(B.CallStack.HasCallStack, MonadIO m, IsScript a) =>
a
-> Word32
-> m ()
scriptUnmergeObjects :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsScript a) =>
a -> Word32 -> m ()
scriptUnmergeObjects a
script Word32
mergeId = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Script
script' <- a -> IO (Ptr Script)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
script
Ptr Script -> Word32 -> IO ()
clutter_script_unmerge_objects Ptr Script
script' Word32
mergeId
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
script
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScriptUnmergeObjectsMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsScript a) => O.OverloadedMethod ScriptUnmergeObjectsMethodInfo a signature where
overloadedMethod = scriptUnmergeObjects
instance O.OverloadedMethodInfo ScriptUnmergeObjectsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Objects.Script.scriptUnmergeObjects",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.5/docs/GI-Clutter-Objects-Script.html#v:scriptUnmergeObjects"
})
#endif