Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The Script
structure contains only private data
and should be accessed using the provided API
Since: 0.6
Synopsis
- newtype Script = Script (ManagedPtr Script)
- class (GObject o, IsDescendantOf Script o) => IsScript o
- toScript :: (MonadIO m, IsScript o) => o -> m Script
- scriptAddSearchPaths :: (HasCallStack, MonadIO m, IsScript a) => a -> [Text] -> m ()
- scriptAddStates :: (HasCallStack, MonadIO m, IsScript a, IsState b) => a -> Maybe Text -> b -> m ()
- scriptConnectSignals :: (HasCallStack, MonadIO m, IsScript a) => a -> Ptr () -> m ()
- scriptConnectSignalsFull :: (HasCallStack, MonadIO m, IsScript a) => a -> ScriptConnectFunc -> m ()
- scriptEnsureObjects :: (HasCallStack, MonadIO m, IsScript a) => a -> m ()
- scriptGetObject :: (HasCallStack, MonadIO m, IsScript a) => a -> Text -> m Object
- scriptGetStates :: (HasCallStack, MonadIO m, IsScript a) => a -> Maybe Text -> m State
- scriptGetTranslationDomain :: (HasCallStack, MonadIO m, IsScript a) => a -> m Text
- scriptGetTypeFromName :: (HasCallStack, MonadIO m, IsScript a) => a -> Text -> m GType
- scriptListObjects :: (HasCallStack, MonadIO m, IsScript a) => a -> m [Object]
- scriptLoadFromData :: (HasCallStack, MonadIO m, IsScript a) => a -> Text -> Int64 -> m Word32
- scriptLoadFromFile :: (HasCallStack, MonadIO m, IsScript a) => a -> Text -> m Word32
- scriptLoadFromResource :: (HasCallStack, MonadIO m, IsScript a) => a -> Text -> m Word32
- scriptLookupFilename :: (HasCallStack, MonadIO m, IsScript a) => a -> Text -> m Text
- scriptNew :: (HasCallStack, MonadIO m) => m Script
- scriptSetTranslationDomain :: (HasCallStack, MonadIO m, IsScript a) => a -> Maybe Text -> m ()
- scriptUnmergeObjects :: (HasCallStack, MonadIO m, IsScript a) => a -> Word32 -> m ()
- getScriptFilename :: (MonadIO m, IsScript o) => o -> m (Maybe Text)
- getScriptFilenameSet :: (MonadIO m, IsScript o) => o -> m Bool
- clearScriptTranslationDomain :: (MonadIO m, IsScript o) => o -> m ()
- constructScriptTranslationDomain :: (IsScript o, MonadIO m) => Text -> m (GValueConstruct o)
- getScriptTranslationDomain :: (MonadIO m, IsScript o) => o -> m Text
- setScriptTranslationDomain :: (MonadIO m, IsScript o) => o -> Text -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Script Source # | |
GObject Script Source # | |
Defined in GI.Clutter.Objects.Script | |
ManagedPtrNewtype Script Source # | |
Defined in GI.Clutter.Objects.Script toManagedPtr :: Script -> ManagedPtr Script | |
TypedObject Script Source # | |
Defined in GI.Clutter.Objects.Script | |
HasParentTypes Script Source # | |
Defined in GI.Clutter.Objects.Script | |
IsGValue (Maybe Script) Source # | Convert |
Defined in GI.Clutter.Objects.Script gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Script -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Script) | |
type ParentTypes Script Source # | |
Defined in GI.Clutter.Objects.Script type ParentTypes Script = '[Object] |
class (GObject o, IsDescendantOf Script o) => IsScript o Source #
Instances
(GObject o, IsDescendantOf Script o) => IsScript o Source # | |
Defined in GI.Clutter.Objects.Script |
Methods
Click to display all available methods, including inherited ones
Methods
addSearchPaths, addStates, bindProperty, bindPropertyFull, connectSignals, connectSignalsFull, ensureObjects, forceFloating, freezeNotify, getv, isFloating, listObjects, loadFromData, loadFromFile, loadFromResource, lookupFilename, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unmergeObjects, unref, watchClosure.
Getters
getData, getObject, getProperty, getQdata, getStates, getTranslationDomain, getTypeFromName.
Setters
addSearchPaths
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> [Text] |
|
-> m () |
Adds paths
to the list of search paths held by script
.
The search paths are used by scriptLookupFilename
, which
can be used to define search paths for the textures source file name
or other custom, file-based properties.
Since: 0.8
addStates
connectSignals
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> Ptr () |
|
-> m () |
Connects all the signals defined into a UI definition file to their handlers.
This method invokes scriptConnectSignalsFull
internally
and uses GModule
's introspective features (by opening the current
module's scope) to look at the application's symbol table.
Note that this function will not work if GModule
is not supported by
the platform Clutter is running on.
Since: 0.6
connectSignalsFull
scriptConnectSignalsFull Source #
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> ScriptConnectFunc |
|
-> m () |
Connects all the signals defined into a UI definition file to their handlers.
This function allows to control how the signal handlers are going to be connected to their respective signals. It is meant primarily for language bindings to allow resolving the function names using the native API, but it can also be used on platforms that do not support GModule.
Applications should use scriptConnectSignals
.
Since: 0.6
ensureObjects
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> m () |
Ensure that every object defined inside script
is correctly
constructed. You should rarely need to use this function.
Since: 0.6
getObject
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> Text |
|
-> m Object | Returns: the named object, or |
Retrieves the object bound to name
. This function does not increment
the reference count of the returned object.
Since: 0.6
getStates
getTranslationDomain
scriptGetTranslationDomain Source #
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> m Text | Returns: the translation domain, if any is set,
or |
Retrieves the translation domain set using
scriptSetTranslationDomain
.
Since: 1.10
getTypeFromName
scriptGetTypeFromName Source #
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> Text |
|
-> m GType | Returns: the type for the requested type name, or
|
Looks up a type by name, using the virtual function that
Script
has for that purpose. This function should
rarely be used.
Since: 0.6
listObjects
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> m [Object] | Returns: a list
of |
Retrieves all the objects created by script
.
Note: this function does not increment the reference count of the objects it returns.
Since: 0.8
loadFromData
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> Text |
|
-> Int64 |
|
-> m Word32 | Returns: on error, zero is returned and |
Loads the definitions from data
into script
and merges with
the currently loaded ones, if any.
Since: 0.6
loadFromFile
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> Text |
|
-> m Word32 | Returns: on error, zero is returned and |
Loads the definitions from filename
into script
and merges with
the currently loaded ones, if any.
Since: 0.6
loadFromResource
scriptLoadFromResource Source #
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> Text |
|
-> m Word32 | Returns: on error, zero is returned and |
Loads the definitions from a resource file into script
and merges with
the currently loaded ones, if any.
Since: 1.10
lookupFilename
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> Text |
|
-> m Text | Returns: the full path of |
Looks up filename
inside the search paths of script
. If filename
is found, its full path will be returned .
Since: 0.8
new
:: (HasCallStack, MonadIO m) | |
=> m Script | Returns: the newly created |
setTranslationDomain
scriptSetTranslationDomain Source #
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the translation domain for script
.
Since: 1.10
unmergeObjects
:: (HasCallStack, MonadIO m, IsScript a) | |
=> a |
|
-> Word32 |
|
-> m () |
Unmerges the objects identified by mergeId
.
Since: 0.6
Properties
filename
The path of the currently parsed file. If Script:filenameSet
is False
then the value of this property is undefined.
Since: 0.6
getScriptFilename :: (MonadIO m, IsScript o) => o -> m (Maybe Text) Source #
Get the value of the “filename
” property.
When overloading is enabled, this is equivalent to
get
script #filename
filenameSet
Whether the Script:filename property is set. If this property
is True
then the currently parsed data comes from a file, and the
file name is stored inside the Script:filename property.
Since: 0.6
getScriptFilenameSet :: (MonadIO m, IsScript o) => o -> m Bool Source #
Get the value of the “filename-set
” property.
When overloading is enabled, this is equivalent to
get
script #filenameSet
translationDomain
The translation domain, used to localize strings marked as translatable inside a UI definition.
If Script:translationDomain is set to Nothing
, Script
will use gettext()
, otherwise dgettext
will be used.
Since: 1.10
clearScriptTranslationDomain :: (MonadIO m, IsScript o) => o -> m () Source #
Set the value of the “translation-domain
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#translationDomain
constructScriptTranslationDomain :: (IsScript o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “translation-domain
” property. This is rarely needed directly, but it is used by new
.
getScriptTranslationDomain :: (MonadIO m, IsScript o) => o -> m Text Source #
Get the value of the “translation-domain
” property.
When overloading is enabled, this is equivalent to
get
script #translationDomain
setScriptTranslationDomain :: (MonadIO m, IsScript o) => o -> Text -> m () Source #
Set the value of the “translation-domain
” property.
When overloading is enabled, this is equivalent to
set
script [ #translationDomain:=
value ]