NULL =
-SUBDIRS = clutter tests doc po build
+SUBDIRS = clutter tests examples doc po build
# XXX - this is a massive hack to make autoreconf honour the ACLOCAL_FLAGS
# that jhbuild sets while still retaining build/autotools as the authoritative
* of children from a ClutterActor, use the #ClutterContainer::actor-removed
* signal.</para>
* <informalexample><programlisting>
- * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../tests/interactive/test-actor.c">
+ * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/basic-actor.c">
* <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
* </xi:include>
* </programlisting></informalexample>
* <example id="example-clutter-bin-layout">
* <title>How to pack actors inside a BinLayout</title>
* <programlisting>
- * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../tests/interactive/test-bin-layout.c">
+ * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/bin-layout.c">
* <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
* </xi:include>
* </programlisting>
* <example id="bind-constraint-example">
* <title>Animating the offset property of ClutterBindConstraint</title>
* <programlisting>
- * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../tests/interactive/test-constraints.c">
+ * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/bind-constraint.c">
* <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
* </xi:include>
* </programlisting>
*
* <informalexample id="canvas-example">
* <programlisting>
- * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../tests/interactive/test-canvas.c">
+ * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/canvas.c">
* <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
* </xi:include>
* </programlisting>
* <graphic fileref="constraints-example.png" format="PNG"/>
* </figure>
* <programlisting>
- *<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../../../tests/interactive/test-snap-constraint.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include>
+ *<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../../../examples/constraints.c" parse="text">
+ * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
+ *</xi:include>
* </programlisting>
* <para>You can try resizing interactively the #ClutterStage and verify
* that the three #ClutterActor<!-- -->s maintain the same position and
* <example id="drag-action-example">
* <title>A simple draggable actor</title>
* <programlisting>
- * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../tests/interactive/test-drag.c">
+ * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/drag-action.c">
* <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
* </xi:include>
* </programlisting>
* <example id="drop-action-example">
* <title>Drop targets</title>
* <programlisting>
- * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../tests/interactive/test-drop.c">
+ * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/drop-action.c">
* <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
* </xi:include>
* </programlisting>
* image data.
*
* <informalexample><programlisting>
- * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../tests/interactive/test-image-box.c">
+ * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/image-content.c">
* <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
* </xi:include>
* </programlisting></informalexample>
* <example id="worker-thread-example">
* <title>A worker thread example</title>
* <programlisting>
- * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../tests/interactive/test-thread.c">
+ * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/threads.c">
* <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
* </xi:include>
* </programlisting>
tests/micro-bench/Makefile
tests/performance/Makefile
+ examples/Makefile
+
doc/Makefile
doc/reference/Makefile
doc/reference/clutter/Makefile
--- /dev/null
+include $(top_srcdir)/build/autotools/Makefile.am.silent
+
+all_examples = \
+ basic-actor \
+ bind-constraint \
+ canvas \
+ constraints \
+ drag-action \
+ drop-action \
+ threads
+
+if PIXBUF_TESTS
+all_examples += \
+ bin-layout \
+ image-content
+endif
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/clutter \
+ -I$(top_builddir)/clutter
+
+LDADD = \
+ $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la \
+ $(CLUTTER_LIBS) \
+ $(GDK_PIXBUF_LIBS) \
+ -lm
+
+AM_CFLAGS = $(CLUTTER_CFLAGS) $(GDK_PIXBUF_CFLAGS)
+
+AM_CPPFLAGS = \
+ -DTESTS_DATADIR=\""$(abs_top_srcdir)/tests/data"\" \
+ -DG_DISABLE_SINGLE_INCLUDES \
+ -DGLIB_DISABLE_DEPRECATION_WARNINGS \
+ -DCLUTTER_DISABLE_DEPRECATION_WARNINGS
+
+noinst_PROGRAMS = $(all_examples)
+
+-include $(top_srcdir)/build/autotools/Makefile.am.gitignore
--- /dev/null
+The code in this directory is meant to be XIncluded into the Clutter API
+reference, and thus is to be considered part of the Clutter documentation.
+
+As such, the code MUST be:
+
+ - correct;
+ - idiomatic, i.e. show how a task is meant to be achieved using the
+ best possible practices given the current API;
+ - well documented;
+ - ready for copy and paste.
#include <stdlib.h>
-#include <gmodule.h>
#include <clutter/clutter.h>
#define SIZE 128
return CLUTTER_EVENT_STOP;
}
-G_MODULE_EXPORT int
-test_actor_main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
ClutterActor *stage, *vase;
ClutterActor *flowers[3];
return EXIT_SUCCESS;
}
-
-G_MODULE_EXPORT const char *
-test_actor_describe (void)
-{
- return "Basic example of actor usage.";
-}
#include <stdlib.h>
-#include <gmodule.h>
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <clutter/clutter.h>
clutter_actor_get_height (actor));
}
-G_MODULE_EXPORT int
-test_bin_layout_main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
ClutterActor *stage, *box, *bg, *icon, *emblem, *label;
ClutterLayoutManager *layout;
return EXIT_SUCCESS;
}
-
-G_MODULE_EXPORT const char *
-test_bin_layout_describe (void)
-{
- return "BinLayout layout manager example";
-}
#include <stdlib.h>
-#include <gmodule.h>
#include <clutter/clutter.h>
#define RECT_SIZE 128
return TRUE;
}
-G_MODULE_EXPORT int
-test_constraints_main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
ClutterActor *stage, *rect;
ClutterConstraint *constraint;
return EXIT_SUCCESS;
}
-
-G_MODULE_EXPORT const char *
-test_constraints_describe (void)
-{
- return "Visualize usage of Bind and Align constraints";
-}
return TRUE;
}
-G_MODULE_EXPORT int
-test_canvas_main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
ClutterActor *stage, *actor;
ClutterContent *canvas;
return EXIT_SUCCESS;
}
-
-G_MODULE_EXPORT const char *
-test_canvas_describe (void)
-{
- return "Simple 2D clock using the Canvas content";
-}
#include <stdlib.h>
-#include <gmodule.h>
-
#include <clutter/clutter.h>
-G_MODULE_EXPORT int
-test_snap_constraint_main (int argc,
- char *argv[])
+int
+main (int argc, char *argv[])
{
ClutterActor *stage, *layer_a, *layer_b, *layer_c;
#include <stdlib.h>
-#include <gmodule.h>
#include <clutter/clutter.h>
static gboolean
{ NULL }
};
-G_MODULE_EXPORT int
-test_drag_main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
ClutterActor *stage, *handle;
ClutterAction *action;
add_drag_object (actor);
}
-G_MODULE_EXPORT int
-test_drop_main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
ClutterActor *dummy;
return EXIT_SUCCESS;
}
-
-G_MODULE_EXPORT const char *
-test_drop_describe (void)
-{
- return "Drop action support";
-}
#include <stdlib.h>
-#include <gmodule.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <clutter/clutter.h>
cur_gravity = 0;
}
-G_MODULE_EXPORT const char *
-test_image_box_describe (void)
-{
- return "A test with image content.";
-}
-
-G_MODULE_EXPORT int
-test_image_box_main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
ClutterActor *stage, *box, *text;
ClutterContent *image;
#include <stdio.h>
#include <stdlib.h>
-#include <gmodule.h>
#include <clutter/clutter.h>
/* our thread-specific data */
return FALSE;
}
-G_MODULE_EXPORT int
-test_threads_main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
ClutterActor *stage;
ClutterActor *rect;
return EXIT_SUCCESS;
}
-
-const char *
-test_threads_describe (void)
-{
- return "Multi-threading programming with Clutter";
-}
test-scale.c \
test-actors.c \
test-shader-effects.c \
- test-depth.c \
- test-threads.c \
test-script.c \
test-grab.c \
test-cogl-shader-arbfp.c \
test-flow-layout.c \
test-box-layout.c \
test-stage-sizing.c \
- test-drag.c \
- test-constraints.c \
test-scrolling.c \
test-swipe-action.c \
test-cogl-point-sprites.c \
test-table-layout.c \
test-path-constraint.c \
- test-snap-constraint.c \
test-state-script.c \
- test-drop.c \
test-devices.c \
- test-actor.c \
test-transitions.c \
test-content.c \
- test-canvas.c \
test-keyframe-transition.c \
test-scroll-actor.c
if PIXBUF_TESTS
UNIT_TESTS += \
- test-bin-layout.c \
- test-image.c \
- test-image-box.c
+ test-image.c
endif
if OS_WIN32