gi-clutter-1.0.3: clutter GObject bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Clutter.Objects.Script

Description

The Script structure contains only private data and should be accessed using the provided API

Since: 0.6

Synopsis

Exported types

newtype Script Source #

Memory-managed wrapper type.

Constructors

Script (ManagedPtr Script) 

Instances

Instances details
Eq Script Source # 
Instance details

Defined in GI.Clutter.Objects.Script

Methods

(==) :: Script -> Script -> Bool #

(/=) :: Script -> Script -> Bool #

GObject Script Source # 
Instance details

Defined in GI.Clutter.Objects.Script

ManagedPtrNewtype Script Source # 
Instance details

Defined in GI.Clutter.Objects.Script

Methods

toManagedPtr :: Script -> ManagedPtr Script

TypedObject Script Source # 
Instance details

Defined in GI.Clutter.Objects.Script

Methods

glibType :: IO GType

HasParentTypes Script Source # 
Instance details

Defined in GI.Clutter.Objects.Script

IsGValue (Maybe Script) Source #

Convert Script to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Clutter.Objects.Script

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Script -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Script)

type ParentTypes Script Source # 
Instance details

Defined in GI.Clutter.Objects.Script

type ParentTypes Script = '[Object]

class (GObject o, IsDescendantOf Script o) => IsScript o Source #

Type class for types which can be safely cast to Script, for instance with toScript.

Instances

Instances details
(GObject o, IsDescendantOf Script o) => IsScript o Source # 
Instance details

Defined in GI.Clutter.Objects.Script

toScript :: (MonadIO m, IsScript o) => o -> m Script Source #

Cast to Script, for types for which this is known to be safe. For general casts, use castTo.

Methods

addSearchPaths

scriptAddSearchPaths Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> [Text]

paths: an array of strings containing different search paths

-> 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

scriptAddStates Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a, IsState b) 
=> a

script: a Script

-> Maybe Text

name: a name for the state, or Nothing to set the default State

-> b

state: a State

-> m () 

Deprecated: (Since version 1.12)

Associates a State to the Script instance using the given name.

The Script instance will use state to resolve target states when connecting signal handlers.

The Script instance will take a reference on the State passed to this function.

Since: 1.8

connectSignals

scriptConnectSignals Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> Ptr ()

userData: data to be passed to the signal handlers, or Nothing

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> ScriptConnectFunc

func: signal connection function

-> 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

scriptEnsureObjects Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> m () 

Ensure that every object defined inside script is correctly constructed. You should rarely need to use this function.

Since: 0.6

getObject

scriptGetObject Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> Text

name: the name of the object to retrieve

-> m Object

Returns: the named object, or Nothing if no object with the given name was available

Retrieves the object bound to name. This function does not increment the reference count of the returned object.

Since: 0.6

getStates

scriptGetStates Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> Maybe Text

name: the name of the State, or Nothing

-> m State

Returns: a pointer to the State for the given name. The State is owned by the Script instance and it should not be unreferenced

Deprecated: (Since version 1.12)

Retrieves the State for the given stateName.

If name is Nothing, this function will return the default State instance.

Since: 1.8

getTranslationDomain

scriptGetTranslationDomain Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> m Text

Returns: the translation domain, if any is set, or Nothing

Retrieves the translation domain set using scriptSetTranslationDomain.

Since: 1.10

getTypeFromName

scriptGetTypeFromName Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> Text

typeName: name of the type to look up

-> m GType

Returns: the type for the requested type name, or G_TYPE_INVALID if not corresponding type was found.

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

scriptListObjects Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> m [Object]

Returns: a list of Objects, or Nothing. The objects are owned by the Script instance. Use g_list_free() on the returned list when done.

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

scriptLoadFromData Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> Text

data: a buffer containing the definitions

-> Int64

length: the length of the buffer, or -1 if data is a NUL-terminated buffer

-> m Word32

Returns: on error, zero is returned and error is set accordingly. On success, the merge id for the UI definitions is returned. You can use the merge id with scriptUnmergeObjects. (Can throw GError)

Loads the definitions from data into script and merges with the currently loaded ones, if any.

Since: 0.6

loadFromFile

scriptLoadFromFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> Text

filename: the full path to the definition file

-> m Word32

Returns: on error, zero is returned and error is set accordingly. On success, the merge id for the UI definitions is returned. You can use the merge id with scriptUnmergeObjects. (Can throw GError)

Loads the definitions from filename into script and merges with the currently loaded ones, if any.

Since: 0.6

loadFromResource

scriptLoadFromResource Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> Text

resourcePath: the resource path of the file to parse

-> m Word32

Returns: on error, zero is returned and error is set accordingly. On success, the merge id for the UI definitions is returned. You can use the merge id with scriptUnmergeObjects. (Can throw GError)

Loads the definitions from a resource file into script and merges with the currently loaded ones, if any.

Since: 1.10

lookupFilename

scriptLookupFilename Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> Text

filename: the name of the file to lookup

-> m Text

Returns: the full path of filename or Nothing if no path was found.

Looks up filename inside the search paths of script. If filename is found, its full path will be returned .

Since: 0.8

new

scriptNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Script

Returns: the newly created Script instance. Use objectUnref when done.

Creates a new Script instance. Script can be used to load objects definitions for scenegraph elements, like actors, or behavioural elements, like behaviours and timelines. The definitions must be encoded using the JavaScript Object Notation (JSON) language.

Since: 0.6

setTranslationDomain

scriptSetTranslationDomain Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> Maybe Text

domain: the translation domain, or Nothing

-> m () 

Sets the translation domain for script.

Since: 1.10

unmergeObjects

scriptUnmergeObjects Source #

Arguments

:: (HasCallStack, MonadIO m, IsScript a) 
=> a

script: a Script

-> Word32

mergeId: merge id returned when loading a UI definition

-> 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 ]