From 00deb59a9daa45558753810fcc18c738f61b0a6e Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Fri, 28 Jan 2011 11:49:08 +0000 Subject: [PATCH] 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. --- doc/cookbook/actors.xml | 103 +++++++++++++--------------------------- 1 file changed, 34 insertions(+), 69 deletions(-) diff --git a/doc/cookbook/actors.xml b/doc/cookbook/actors.xml index 5d944fcae..3fd3a6a8e 100644 --- a/doc/cookbook/actors.xml +++ b/doc/cookbook/actors.xml @@ -96,92 +96,55 @@ Reference Manual before proceeding. -
- <filename>cb-button.h</filename> + + <filename>cb-button.h</filename>: header file - The header file defines the public API for the class, - including GObject type macros, class and object structures, and + This defines the public API for the class, including + GObject type macros, class and object structures, and function prototypes. - a code sample should be here... but isn't +a code sample should be here... but isn't + -
- -
- <filename>cb-button.c</filename> + + <filename>cb-button.c</filename>: <type>ClutterActor</type> + and GObject implementation This is the main C code file which implements both the GObject and Clutter parts of CbButton. The example below is commented liberally, and gives some samples of gtk-doc annotations to generate API docs for the - widget. The discussion section - comments more specifically about the Clutter-specific parts - of it. + widget. The discussion + section comments more specifically about the Clutter-specific + parts of it. - - enum for signals ???why do we need these + + +a code sample should be here... but isn't + + + - enum for properties ???why do we need these + + <filename>actors-composite-main.c</filename>: trivial + application demonstrating usage of <type>CbButton</type> - array for signals ???is it an array + Note how any of the ClutterActor + functions (like clutter_actor_set_size() + and clutter_actor_add_constraint()) can + be applied to instances of our ClutterActor + implementation. - - - - and Clutter stuff (private to the class): - - allocate (required) - paint (required) - you could get away with just these two - but if you're not composing your actor, or are creating a container, - you need to do more - - - - - then more GObject stuff (it should come after the Clutter method - implementations, i.e. allocate and paint): - - class_init - - where we wire together our functions - - we can also do things like adding properties and signals - - init - - where we create the private structure - - where we compose the actors together inside our ClutterActor - subclass - - - - - - Then normally some public API: - - typically you want a new() function - - for our class, we'll put some wrappers around functions - on the composed actors - - - -
- -
- <filename>actors-composite-main.c</filename> - - - The cb-button-main.c file shows how to use the new - actor inside a Clutter application. Note how any of the - ClutterActor functions (like set_size, - add_constraint) can be applied to instance - of our ClutterActor implementation. - - -
+ + +a code sample should be here... but isn't + + + @@ -190,6 +153,8 @@ Explain about GObject a bit??? + Note size requisition in the example application??? + The actor implemented here is put together through simple composition. This has the advantage of simplifying the code for the subclass: we can just wrap a facade round