mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
cookbook: Fix up the examples
This commit is contained in:
parent
534472a0d4
commit
9c11538bee
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<book lang="en">
|
<book lang="en">
|
||||||
|
|
||||||
<bookinfo> <!-- {{{ -->
|
<bookinfo>
|
||||||
|
|
||||||
<authorgroup>
|
<authorgroup>
|
||||||
|
|
||||||
@ -43,9 +43,9 @@
|
|||||||
|
|
||||||
<title>The Clutter Cookbook</title>
|
<title>The Clutter Cookbook</title>
|
||||||
<releaseinfo>for Clutter &apiversion;</releaseinfo>
|
<releaseinfo>for Clutter &apiversion;</releaseinfo>
|
||||||
</bookinfo> <!-- }}} -->
|
</bookinfo>
|
||||||
|
|
||||||
<chapter id="introduction"> <!-- {{{ -->
|
<chapter id="introduction">
|
||||||
<title>Preface</title>
|
<title>Preface</title>
|
||||||
|
|
||||||
<epigraph>
|
<epigraph>
|
||||||
@ -141,9 +141,9 @@
|
|||||||
<para>Binaries for Microsoft Windows are also available.</para>
|
<para>Binaries for Microsoft Windows are also available.</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</chapter> <!-- introduction }}} -->
|
</chapter>
|
||||||
|
|
||||||
<chapter id="actors"> <!-- actors {{{ -->
|
<chapter id="actors">
|
||||||
<title>Actors</title>
|
<title>Actors</title>
|
||||||
|
|
||||||
<epigraph>
|
<epigraph>
|
||||||
@ -179,7 +179,7 @@
|
|||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="actors-allocation-notify"> <!-- {{{ -->
|
<section id="actors-allocation-notify">
|
||||||
<title>Knowing when an actor position or size change</title>
|
<title>Knowing when an actor position or size change</title>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@ -313,9 +313,9 @@ on_allocation_changed (ClutterActor *actor,
|
|||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</section> <!-- recipe 1 }}} -->
|
</section>
|
||||||
|
|
||||||
<section id="actors-paint-wrappers"> <!-- {{{ -->
|
<section id="actors-paint-wrappers">
|
||||||
<title>Overriding the paint sequence</title>
|
<title>Overriding the paint sequence</title>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@ -334,9 +334,7 @@ on_allocation_changed (ClutterActor *actor,
|
|||||||
|
|
||||||
<informalexample>
|
<informalexample>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
g_signal_connect (actor, "paint",
|
g_signal_connect (actor, "paint", G_CALLBACK (on_paint), NULL);
|
||||||
G_CALLBACK (on_paint),
|
|
||||||
NULL);
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</informalexample>
|
</informalexample>
|
||||||
|
|
||||||
@ -346,9 +344,7 @@ g_signal_connect (actor, "paint",
|
|||||||
|
|
||||||
<informalexample>
|
<informalexample>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
g_signal_connect_after (actor, "paint",
|
g_signal_connect_after (actor, "paint", G_CALLBACK (on_paint_after), NULL);
|
||||||
G_CALLBACK (on_paint_after),
|
|
||||||
NULL);
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</informalexample>
|
</informalexample>
|
||||||
|
|
||||||
@ -356,9 +352,7 @@ g_signal_connect_after (actor, "paint",
|
|||||||
|
|
||||||
<informalexample>
|
<informalexample>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void
|
void on_paint (ClutterActor *actor, gpointer user_data);
|
||||||
on_paint (ClutterActor *actor,
|
|
||||||
gpointer user_data);
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</informalexample>
|
</informalexample>
|
||||||
|
|
||||||
@ -402,9 +396,9 @@ on_paint (ClutterActor *actor)
|
|||||||
the actor from running.</para>
|
the actor from running.</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</section> <!-- }}} -->
|
</section>
|
||||||
|
|
||||||
</chapter> <!-- actors }}} -->
|
</chapter>
|
||||||
|
|
||||||
<chapter id="events">
|
<chapter id="events">
|
||||||
<title>Events</title>
|
<title>Events</title>
|
||||||
@ -494,10 +488,7 @@ on_paint (ClutterActor *actor)
|
|||||||
|
|
||||||
<informalexample>
|
<informalexample>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
g_signal_connect (actor,
|
g_signal_connect (actor, "key-press-event", G_CALLBACK (_key_press_cb), NULL);
|
||||||
"key-press-event",
|
|
||||||
G_CALLBACK (_key_press_cb),
|
|
||||||
NULL);
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</informalexample>
|
</informalexample>
|
||||||
|
|
||||||
@ -508,7 +499,7 @@ g_signal_connect (actor,
|
|||||||
|
|
||||||
<informalexample>
|
<informalexample>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
static void
|
static gboolean
|
||||||
_key_press_cb (ClutterActor *actor,
|
_key_press_cb (ClutterActor *actor,
|
||||||
ClutterEvent *event,
|
ClutterEvent *event,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
@ -533,7 +524,13 @@ _key_press_cb (ClutterActor *actor,
|
|||||||
g_debug ("Up pressed");
|
g_debug ("Up pressed");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The event was handled, and the emission should stop */
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The event was not handled, and the emission should continue */
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</informalexample>
|
</informalexample>
|
||||||
@ -570,7 +567,10 @@ _key_press_cb (ClutterActor *actor,
|
|||||||
<informalexample>
|
<informalexample>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
ClutterBindingPool *binding_pool;
|
ClutterBindingPool *binding_pool;
|
||||||
binding_pool = clutter_binding_pool_get_for_class (CLUTTER_STAGE_GET_CLASS (stage));
|
GObjectClass *stage_class;
|
||||||
|
|
||||||
|
stage_class = CLUTTER_STAGE_GET_CLASS (stage);
|
||||||
|
binding_pool = clutter_binding_pool_get_for_class (stage_class);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</informalexample>
|
</informalexample>
|
||||||
|
|
||||||
@ -1214,7 +1214,7 @@ main (int argc, char *argv[])
|
|||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</chapter> <!-- textures }}} -->
|
</chapter>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<chapter id="animations">
|
<chapter id="animations">
|
||||||
@ -1258,13 +1258,13 @@ main (int argc, char *argv[])
|
|||||||
</chapter>
|
</chapter>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<appendix id="contributing"> <!-- contributing {{{ -->
|
<appendix id="contributing">
|
||||||
<title>Contributing to this document</title>
|
<title>Contributing to this document</title>
|
||||||
|
|
||||||
<para>This document is written in Docbook XML. The source file for this
|
<para>This document is written in Docbook XML. The source file for this
|
||||||
document is located in the subdirectory "doc/cookbook" of the source
|
document is located in the subdirectory "doc/cookbook" of the source
|
||||||
directory of Clutter.</para>
|
directory of Clutter.</para>
|
||||||
</appendix> <!-- contributing }}} -->
|
</appendix>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<section id="recipe">
|
<section id="recipe">
|
||||||
|
Loading…
Reference in New Issue
Block a user