Clutter Version 1.10.0, Updated 9 May 2012
Total Page:16
File Type:pdf, Size:1020Kb
Guile-GNOME: Clutter version 1.10.0, updated 9 May 2012 Matthew Allum and OpenedHand LTD Intel Corporation This manual is for (gnome clutter) (version 1.10.0, updated 9 May 2012) Copyright 2006,2007,2008 OpenedHand LTD Copyright 2009,2010,2011,2012 Intel Corporation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You may obtain a copy of the GNU Free Documentation License from the Free Software Foundation by visiting their Web site or by writing to: The Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA i Short Contents 1 Overview :::::::::::::::::::::::::::::::::::::::::::: 1 2 ClutterAction :::::::::::::::::::::::::::::::::::::::: 2 3 ClutterActorMeta ::::::::::::::::::::::::::::::::::::: 3 4 ClutterActor ::::::::::::::::::::::::::::::::::::::::: 5 5 ClutterAlignConstraint:::::::::::::::::::::::::::::::: 63 6 ClutterAlpha :::::::::::::::::::::::::::::::::::::::: 65 7 ClutterAnimatable ::::::::::::::::::::::::::::::::::: 68 8 Implicit Animations :::::::::::::::::::::::::::::::::: 69 9 ClutterAnimator ::::::::::::::::::::::::::::::::::::: 76 10 ClutterBackend :::::::::::::::::::::::::::::::::::::: 82 11 ClutterBinLayout :::::::::::::::::::::::::::::::::::: 84 12 ClutterBindConstraint :::::::::::::::::::::::::::::::: 87 13 Key Bindings:::::::::::::::::::::::::::::::::::::::: 90 14 ClutterBlurEffect :::::::::::::::::::::::::::::::::::: 94 15 ClutterBoxLayout :::::::::::::::::::::::::::::::::::: 95 16 ClutterBrightnessContrastEffect ::::::::::::::::::::::: 100 17 ClutterCairoTexture ::::::::::::::::::::::::::::::::: 101 18 ClutterCanvas :::::::::::::::::::::::::::::::::::::: 103 19 ClutterChildMeta ::::::::::::::::::::::::::::::::::: 104 20 ClutterClickAction :::::::::::::::::::::::::::::::::: 105 21 ClutterClone ::::::::::::::::::::::::::::::::::::::: 108 22 Colors :::::::::::::::::::::::::::::::::::::::::::: 109 23 ClutterColorizeEffect :::::::::::::::::::::::::::::::: 114 24 ClutterConstraint ::::::::::::::::::::::::::::::::::: 115 25 ClutterContainer :::::::::::::::::::::::::::::::::::: 117 26 ClutterContent ::::::::::::::::::::::::::::::::::::: 119 27 ClutterDeformEffect ::::::::::::::::::::::::::::::::: 120 28 ClutterDesaturateEffect :::::::::::::::::::::::::::::: 122 29 ClutterDeviceManager ::::::::::::::::::::::::::::::: 123 30 ClutterDragAction :::::::::::::::::::::::::::::::::: 125 31 ClutterDropAction :::::::::::::::::::::::::::::::::: 127 32 ClutterEffect ::::::::::::::::::::::::::::::::::::::: 128 33 Events :::::::::::::::::::::::::::::::::::::::::::: 132 34 Features ::::::::::::::::::::::::::::::::::::::::::: 141 35 ClutterFixedLayout ::::::::::::::::::::::::::::::::: 142 ii 36 ClutterFlowLayout :::::::::::::::::::::::::::::::::: 143 37 ClutterGestureAction :::::::::::::::::::::::::::::::: 146 38 ClutterImage ::::::::::::::::::::::::::::::::::::::: 147 39 ClutterInputDevice :::::::::::::::::::::::::::::::::: 148 40 Value intervals:::::::::::::::::::::::::::::::::::::: 152 41 ClutterLayoutManager ::::::::::::::::::::::::::::::: 155 42 ClutterLayoutMeta :::::::::::::::::::::::::::::::::: 161 43 ClutterListModel ::::::::::::::::::::::::::::::::::: 162 44 General ::::::::::::::::::::::::::::::::::::::::::: 163 45 ClutterMedia ::::::::::::::::::::::::::::::::::::::: 167 46 ClutterModelIter :::::::::::::::::::::::::::::::::::: 170 47 ClutterModel ::::::::::::::::::::::::::::::::::::::: 171 48 ClutterOffscreenEffect ::::::::::::::::::::::::::::::: 174 49 ClutterPageTurnEffect ::::::::::::::::::::::::::::::: 175 50 ClutterPaintNode ::::::::::::::::::::::::::::::::::: 177 51 Paint Nodes :::::::::::::::::::::::::::::::::::::::: 178 52 ClutterPathConstraint ::::::::::::::::::::::::::::::: 179 53 ClutterPath :::::::::::::::::::::::::::::::::::::::: 181 54 ClutterPropertyTransition :::::::::::::::::::::::::::: 188 55 ClutterScript ::::::::::::::::::::::::::::::::::::::: 189 56 ClutterScriptable:::::::::::::::::::::::::::::::::::: 196 57 ClutterSettings ::::::::::::::::::::::::::::::::::::: 197 58 ClutterShaderEffect ::::::::::::::::::::::::::::::::: 198 59 Shaders ::::::::::::::::::::::::::::::::::::::::::: 200 60 ClutterSnapConstraint ::::::::::::::::::::::::::::::: 201 61 Stage Manager ::::::::::::::::::::::::::::::::::::: 203 62 ClutterStage ::::::::::::::::::::::::::::::::::::::: 204 63 ClutterState ::::::::::::::::::::::::::::::::::::::: 211 64 ClutterSwipeAction ::::::::::::::::::::::::::::::::: 220 65 ClutterTableLayout:::::::::::::::::::::::::::::::::: 221 66 ClutterTextBuffer ::::::::::::::::::::::::::::::::::: 225 67 ClutterText :::::::::::::::::::::::::::::::::::::::: 228 68 ClutterTexture ::::::::::::::::::::::::::::::::::::: 244 69 ClutterTimeline::::::::::::::::::::::::::::::::::::: 249 70 ClutterTransition ::::::::::::::::::::::::::::::::::: 257 71 Unit conversion ::::::::::::::::::::::::::::::::::::: 259 72 Utilities ::::::::::::::::::::::::::::::::::::::::::: 263 73 Versioning Macros ::::::::::::::::::::::::::::::::::: 264 iii 74 Undocumented ::::::::::::::::::::::::::::::::::::: 265 Type Index :::::::::::::::::::::::::::::::::::::::::::: 270 Function Index ::::::::::::::::::::::::::::::::::::::::: 271 Chapter 1: Overview 1 1 Overview (gnome clutter) wraps the Clutter graphical canvas toolkit for Guile. It is a part of Guile-GNOME. See the documentation for (gnome gobject) for more information on Guile-GNOME. Chapter 2: ClutterAction 2 2 ClutterAction Abstract class for event-related logic 2.1 Overview <clutter-action> is an abstract base class for event-related actions that modify the user interaction of a <clutter-actor>, just like <clutter-constraint> is an abstract class for modifiers of an actor's position or size. Implementations of <clutter-action> are associated to an actor and can provide be- havioral changes when dealing with user input - for instance drag and drop capabilities, or scrolling, or panning - by using the various event-related signals provided by <clutter- actor> itself. <clutter-action> is available since Clutter 1.4 2.2 Usage Chapter 3: ClutterActorMeta 3 3 ClutterActorMeta Base class of actor modifiers 3.1 Overview <clutter-actor-meta> is an abstract class providing a common API for modifiers of <clutter-actor> behaviour, appearance or layout. A <clutter-actor-meta> can only be owned by a single <clutter-actor> at any time. Every sub-class of <clutter-actor-meta> should check if the <"enabled"> property is set to `#t' before applying any kind of modification. <clutter-actor-meta> is available since Clutter 1.4 3.2 Usage clutter-actor-meta-set-name (self <clutter-actor-meta>) [Function] (name mchars) set-name [Method] Sets the name of meta The name can be used to identify the <clutter-actor-meta> instance meta a <clutter-actor-meta> name the name of meta Since 1.4 clutter-actor-meta-get-name (self <clutter-actor-meta>) [Function] ) (ret mchars) get-name [Method] Retrieves the name set using clutter-actor-meta-set-name meta a <clutter-actor-meta> ret the name of the <clutter-actor-meta> instance, or `#f' if none was set. The returned string is owned by the <clutter-actor-meta> instance and it should not be modified or freed. Since 1.4 clutter-actor-meta-set-enabled (self <clutter-actor-meta>) [Function] (is enabled bool) set-enabled [Method] Sets whether meta should be enabled or not meta a <clutter-actor-meta> is-enabled whether meta is enabled Since 1.4 Chapter 3: ClutterActorMeta 4 clutter-actor-meta-get-enabled (self <clutter-actor-meta>) [Function] ) (ret bool) get-enabled [Method] Retrieves whether meta is enabled meta a <clutter-actor-meta> ret `#t' if the <clutter-actor-meta> instance is enabled Since 1.4 clutter-actor-meta-get-actor (self <clutter-actor-meta>) [Function] ) (ret <clutter-actor>) get-actor [Method] Retrieves a pointer to the <clutter-actor> that owns meta meta a <clutter-actor-meta> ret a pointer to a <clutter-actor> or `#f'. Since 1.4 Chapter 4: ClutterActor 5 4 ClutterActor The basic element of the scene graph 4.1 Overview The ClutterActor class is the basic element of the scene graph in Clutter, and it encapsulates the position, size, and transformations of a node in the graph. 4.2 Actor transformations Each actor can be transformed using methods like clutter-actor-set-scale or clutter- actor-set-rotation. The order in which the transformations are applied is decided by Clutter and it is the following: 1. 2. 3. 4. 5. 6. 7. translation by the origin of the <"allocation">; translation by the actor's <"depth">; scaling by the <"scale-x"> and <"scale-y"> factors; rotation around the <"rotation-z-angle"> and <"rotation-z-center">; rotation around the <"rotation-y-angle"> and <"rotation-y-center">; rotation around the <"rotation-x-angle"> and <"rotation-x-center">; negative translation by the <"anchor-x"> and <"anchor-y"> point. 4.3 Modifying an actor's geometry Each actor has a bounding box, called <"allocation"> which is either set by its parent or explicitly through the clutter-actor-set-position and clutter-actor-set-size meth- ods. Each actor also has an implicit preferred size. An actors preferred size can be defined by any subclass by overriding the clutter- actor-class.get-preferred-width and the clutter-actor-class.get-preferred- height virtual functions, or it can be explicitly set by using clutter-actor-set-width and clutter-actor-set-height. An actors position can be set explicitly by using