Commit Graph

208 Commits

Author SHA1 Message Date
Emmanuele Bassi
72caef0de0 cookbooks/examples: Use g_signal_handlers_disconnect_by_func()
The disconnect_matched() function is a bit too complicated, and its
simpler wrapper disconnect_by_func() is functionally equivalent in the
cases used by the cookbook examples.
2011-09-02 12:19:30 +01:00
Emmanuele Bassi
2557370445 docs/cookbook: Update the introduction
Clean up some wording.
2011-09-01 16:06:04 +01:00
Emmanuele Bassi
b0f868edfd build: Install the cookbook examples code
Use $(datadir)/clutter-1.0/cookbook/examples as the target directory.
2011-09-01 13:51:20 +01:00
Emmanuele Bassi
e03fb1e872 docs/cookbook: Update copyright 2011-08-31 12:27:30 +01:00
Emmanuele Bassi
3bdd49dc19 docs/cookbook: Add script->state connection recipe
Script definitions can connect a signal to a State transition; this is a
useful thing to document with a recipe in the cookbook.
2011-08-31 12:25:01 +01:00
Emmanuele Bassi
a661191b4b docs/cookbook: Point out that Cogl does not do AA drawing 2011-08-22 13:15:42 +01:00
Emmanuele Bassi
010fc072f9 docs/cookbook: Update the link to the GObject reference 2011-08-22 12:33:20 +01:00
Emmanuele Bassi
2b81d90dd7 Eliminate G_CONST_RETURN
The G_CONST_RETURN define in GLib is, and has always been, a bit fuzzy.

We always used it to conform to the platform, at least for public-facing
API.

At first I assumed it has something to do with brain-damaged compilers
or with weird platforms where const was not really supported; sadly,
it's something much, much worse: it's a define that can be toggled at
compile-time to remove const from the signature of public API. This is a
truly terrifying feature that I assume was added in the past century,
and whose inception clearly had something to do with massive doses of
absynthe and opium — because any other explanation would make the
existence of such a feature even worse than assuming drugs had anything
to do with it.

Anyway, and pleasing the gods, this dubious feature is being
removed/deprecated in GLib; see bug:

  https://bugzilla.gnome.org/show_bug.cgi?id=644611

Before deprecation, though, we should just remove its usage from the
whole API. We should especially remove its usage from Cally's internals,
since there it never made sense in the first place.
2011-06-07 16:06:24 +01:00
Neil Roberts
7d233241f1 Fix include location for cogl-pango.h
In Cogl, cogl-pango.h has moved to <cogl-pango/cogl-pango.h>. When
using the experimental 2.0 API (which Clutter does) it is no longer
possible to include it under the old name of <cogl/cogl-pango.h> so we
need to update the include location.
2011-05-16 16:04:27 +01:00
Elliot Smith
57a5f2296a docs: Remove checks for whether an effect is disabled
pre_paint() and post_paint() implementations don't need
to check whether an effect is disabled: Clutter will
not apply an effect unless it is enabled.

So remove code which checks whether the effect is
enabled or disabled from the example applications and the
documentation.
2011-03-17 15:56:55 +00:00
Elliot Smith
b5af8fbfac docs: Add recipe about implementing a ClutterEffect
Add a recipe showing how to implement two simple
effects, based on ClutterEffect: an always gray background,
and a border with configurable width and color.

Also explains the necessity to queue a redraw on
the associated actor if the effect's properties change,
and shows how to implement that.

The example gives the GObject code for both effects,
as well as an example application showing how to use them.
The example also demonstrates how to disable/enable an effect,
making the border round an actor togglable.
2011-03-17 15:56:55 +00:00
Elliot Smith
5732b1184f docs: Add example of setting background color with ClutterEffect
Add example of a simple background color effect applied via
pre_paint() implementation in a ClutterEffect subclass.

This is a simple effect with an incomplete GObject
implementation (no properties, setters or getters)
to make it as easy to follow as possible.
2011-03-17 15:56:55 +00:00
Elliot Smith
a81dbcf483 docs: Add example of a border added through ClutterEffect
Add a basic example showing how to implement a ClutterEffect
post_paint() function to overlay a highlight border over a
rectangular actor.
2011-03-17 15:56:55 +00:00
nobled
aece642adb doc: fix clutter_init() usage in examples
Make sure users get the idea that clutter_init()
has a return value that needs to be checked.

These were fixed via sed magic:

sed -i -s -e "s/clutter_init (.*)/\
if (& != CLUTTER_INIT_SUCCESS)\n    return 1/"\
 doc/*/*/*.{c,xml} doc/*/*.xml

http://bugzilla.clutter-project.org/show_bug.cgi?id=2574
2011-02-28 14:10:05 +00:00
Elliot Smith
74de3cfdf3 docs: Add effects chapter, with introduction and first recipe
Add an effects chapter which gives a broad overview of
the abstract classes in the effects API, plus a short
example of how to apply one of the stock Clutter
effects (ClutterColorizeEffect).

The recipe explains how to create a custom ClutterDeformEffect
to produce a page fold (code based on ClutterPageTurnEffect).

The example code includes the effect class plus a small
application to apply it to a texture.
2011-02-21 16:44:09 +00:00
Elliot Smith
cf18836ca0 docs: Add recipe for animating an actor on a curved path
Show how to animate an actor using a ClutterPathConstraint.

This demonstrates how to get effects similar to
ClutterPathBehaviour with the modern animation APIs.

Includes 3 examples:

1) Simple ClutterPathConstraint used with implicit animations
2) ClutterPathConstraint used to simulate circular animation,
using ClutterAnimator
3) Creating simple curved path animations with non-linear
easing
2011-02-08 14:41:51 +00:00
Emmanuele Bassi
428f64212c build: Fixes to pass distcheck
Try to make the cookbook pass the distcheck phase, so that we can run
distcheck with --enable-docs, and make sure that a tarballed clutter
release can actually build the cookbook.
2011-02-01 14:39:21 +00:00
Emmanuele Bassi
c4d4a5469a build: Dist cb-button.h in the cookbook examples
The header is missing, so we have a build failure if you try to build
Clutter's cookbook from the tarball.
2011-02-01 12:45:52 +00:00
Elliot Smith
6680cebfe1 docs: Add reference to useful GObject tutorial
Add a reference to a GObject tutorial which
is a good introduction to the various macros etc.
and what they're for.
2011-01-31 13:40:10 +00:00
Elliot Smith
885664f725 docs: Explain why destroy() is implemented
As destroy() is Clutter-specific and not generic
GObject code, explain why we implement it
(rather than dispose()).
2011-01-31 13:39:11 +00:00
Elliot Smith
e69d60e8b6 docs: Implement destroy() rather than dispose()
Remove the dispose() implementation and replace
with destroy().

This should be promoted as the standard approach
for implementing a composite actor, as it emits a
signal when instances of the actor subclass are destroyed.
2011-01-31 13:36:37 +00:00
Elliot Smith
f63158c2a2 docs: Don't use clutter_stage_get_default()
clutter_stage_get_new() is the recommended way to
get a stage instance, so use that instead.
2011-01-31 12:18:58 +00:00
Elliot Smith
3f64137a79 docs: Change text on button
Modify the text shown on the button to "hello / world"
rather than "winkle / pickers". Slightly more
sensible.
2011-01-31 11:06:01 +00:00
Elliot Smith
5530c5e2ec docs: Add a note about other state variables
Explain that the private structure would be the
place to store other state variables for the instance.
2011-01-31 11:05:27 +00:00
Elliot Smith
08f5dc08d0 docs: Complete composite actor recipe
Add some extra detail to the Discussion section of the
composite actor recipe, concentrating on the pros and
cons of this approach.

Also explain more about the Clutter parts of the implementation.

Also general tidy up of language and style.
2011-01-31 10:55:07 +00:00
Elliot Smith
238fd52c4b docs: Change order of functions in example to match docs
Moved the functions around in the C code file, to match
the order Clutter uses them, and the order they are explained
in the recipe.
2011-01-31 10:38:15 +00:00
Elliot Smith
6934b36451 docs: Add more comments on how allocate() works
Add some extra description to the allocate() function,
explaining how the allocation has to be adjusted to
coordinates relative to the actor as a whole, before
applying to the single child actor it is composed from.
2011-01-31 10:08:08 +00:00
Elliot Smith
00deb59a9d docs: Include code examples in the recipe
Include all the code examples inline as part of the recipe.

Remove sections around each code example, as these are
unnecessary; leave full discussion for the Discussion section
instead of trying to cram it in around the code example.
2011-01-31 10:08:07 +00:00
Elliot Smith
5f676ce325 docs: Explain enums for properties and signals
Add some more explanatory comments about the PROP_ and
signals enums.
2011-01-31 10:08:07 +00:00
Elliot Smith
18b90f100c docs: Don't set explicit size on button
Rather than set a size on the CbButton instance, let it
size itself automatically, based on the size requisition
functions.
2011-01-31 10:08:07 +00:00
Elliot Smith
951f13bb8d docs: Add example of preferred_height() and preferred_width()
As most actor subclasses will probably want to implement
size requisition, give a simple example of how to do this
on the basis of the composed actor's size, plus some padding.
2011-01-31 10:08:07 +00:00
Elliot Smith
2adc224f0e docs: Add recipe for creating a custom ClutterActor with composition 2011-01-31 10:08:07 +00:00
Elliot Smith
7059be499a docs: Add more comments on code example for composite actor
Add more comments about the specific purpose of functions
and variables in the composite actor example, particularly
around GObject implementation.
2011-01-31 10:08:07 +00:00
Elliot Smith
b3954878c2 docs: Improve example code formatting
Improve code formatting to adhere to Clutter uncrustify rules.
2011-01-31 10:08:07 +00:00
Elliot Smith
7b9eaeeadb docs: Add some gtk-doc annotations to example
As this is a full GObject class implementation, add some
gtk-doc annotations to demonstrate how how custom actor subclasses
should be documented.
2011-01-31 10:08:07 +00:00
Elliot Smith
8a5967f0cc docs: Add custom ClutterActor example which uses composition 2011-01-31 10:08:07 +00:00
Elliot Smith
894c0527df cookbook: Proofing for "box layout" recipe
General improvements to readability, formatting, fixing
typos etc.
2010-12-17 14:41:42 +00:00
Elliot Smith
accdd92110 cookbook: Add examples and more text for "box layout" recipe
Added 3 examples for the box layout recipe:
1) Simple box layout demonstrating how to set actor properties
2) Trivial menu implementation using box layout
3) Demonstration app which enables tweaking and testing
   of layout property interactions

Also inlined example 1 in the solution section and added
more explanatory text in the discussion.
2010-12-17 14:41:42 +00:00
Elliot Smith
77aacd185d cookbook: Add initial skeleton for box layout recipe
Created recipe and first draft content for recipe
about ClutterBoxLayout.
2010-12-17 14:41:42 +00:00
Emmanuele Bassi
c444447cd3 timeline: Rename the reverse property to auto-reverse
Other frameworks expose the same functionality as "auto-reverse",
probably to match the cassette tape player. It actually makes sense
for Clutter to follow suit.
2010-12-17 12:07:52 +00:00
Elliot Smith
50849ac1fd cookbook: Use new API to reverse timeline
clutter_timeline_set_reverse() can be used to
automatically reverse a timeline's direction each time
it completes, so use that in looping animation recipe and
examples.
2010-12-02 10:56:06 +00:00
Emmanuele Bassi
038fe708f8 Merge remote branch 'elliot/cookbook-animations-scaling'
* elliot/cookbook-animations-scaling:
  cookbook: Add recipe for animated scaling of an actor
  cookbook: Add example of scaling a texture
  cookbook: Added "animated scaling" recipe skeleton
  cookbook: Added animated scaling example
2010-11-29 11:56:36 +00:00
Alexandre Quessy
01b93537ab Fixed "the the" repetitions in some doc strings
http://bugzilla.clutter-project.org/show_bug.cgi?id=2450
2010-11-25 18:18:51 +00:00
Elliot Smith
c9d0f8b26e cookbook: Add recipe for animated scaling of an actor
Recipe explains how to animate scaling a single actor.

Also covers scaling vs. resizing, scale center, and
scaling within layouts and containers.

The first example shows how animations around each scale
gravity look, as well as tracking the transformed position
and size of the actor and displaying those.

The second example is a simple image viewer with zoom in/out
using scaling.
2010-11-24 12:45:12 +00:00
Elliot Smith
ee9a4d02bb cookbook: Add example of scaling a texture
Added a simple application for scaling a
texture while keeping the mouse pointer over
the same coordinates on its surface.
2010-11-24 12:45:12 +00:00
Elliot Smith
c8f112876e cookbook: Added "animated scaling" recipe skeleton 2010-11-24 12:45:12 +00:00
Elliot Smith
b47b2f4749 cookbook: Added animated scaling example
Added an example showing scaling of an actor on
each of the scaling gravity settings (NORTH_WEST, NORTH etc.),
with a mark indicating the center being used.

Displays the transformed size and position, updated
on each paint of the actor.
2010-11-24 12:45:12 +00:00
Emmanuele Bassi
63cef64d17 docs: Fix some wrong function/signal/property names 2010-11-18 15:21:16 +00:00
Emmanuele Bassi
f3295a3f36 Merge remote branch 'elliot/cookbook-opacity-values-fix'
* elliot/cookbook-opacity-values-fix:
  cookbook: Fix opacity examples in recipe
  cookbook: Fix incorrect value for opacity
2010-11-15 15:41:46 +00:00
Emmanuele Bassi
9f2c31547c Merge remote branch 'elliot/cookbook-animations-looping'
* elliot/cookbook-animations-looping:
  cookbook: Recipe for "looping animations"
  cookbook: Clarify how signals are emitted during looped animation
  cookbook: First draft for looping animations recipe
  cookbook: Recipe skeleton for "looping animations"
  cookbook: Looping animation examples
2010-11-15 15:37:42 +00:00