From 027e1a717f2378a7a9f9b273bec6128cdb984989 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 21 Jan 2014 21:07:43 +0000 Subject: [PATCH] cookbook: Fix build of the examples We don't have a tests/data directory any more since the test suites reorganization; the cookbook examples, though, rely on the existence of the redhand.png image. In order to fix them, we copy the file in the examples directory, and we reference it directly. Since we need it for the examples, and we install the example code, it's also necessary to add the image to the EXTRA_DIST rule. --- doc/cookbook/examples/Makefile.am | 15 +++++++++------ doc/cookbook/examples/animations-rotating.c | 2 +- doc/cookbook/examples/events-mouse-scroll.c | 2 +- .../examples/events-pointer-motion-scribbler.c | 1 + .../examples/layouts-bind-constraint-overlay.c | 2 +- doc/cookbook/examples/layouts-stacking.c | 2 +- doc/cookbook/examples/redhand.png | Bin 0 -> 8250 bytes doc/cookbook/examples/textures-reflection.c | 2 +- 8 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 doc/cookbook/examples/redhand.png diff --git a/doc/cookbook/examples/Makefile.am b/doc/cookbook/examples/Makefile.am index 4f0af585b..675224080 100644 --- a/doc/cookbook/examples/Makefile.am +++ b/doc/cookbook/examples/Makefile.am @@ -56,15 +56,13 @@ LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la -lm AM_CFLAGS = $(CLUTTER_CFLAGS) AM_CPPFLAGS = \ - -DG_DISABLE_SINGLE_INCLUDES \ - -DCOGL_DISABLE_DEPRECATED \ - -DCOGL_DISABLE_DEPRECATION_WARNINGS \ - -DCLUTTER_DISABLE_DEPRECATION_WARNINGS \ - -DTESTS_DATA_DIR=\""$(top_srcdir)/tests/data/"\" \ -I$(top_srcdir)/ \ -I$(top_builddir)/ \ -I$(top_srcdir)/clutter \ -I$(top_builddir)/clutter \ + -DG_DISABLE_SINGLE_INCLUDES \ + -DCOGL_DISABLE_DEPRECATION_WARNINGS \ + -DCLUTTER_DISABLE_DEPRECATION_WARNINGS \ $(NULL) AM_LDFLAGS = $(CLUTTER_LIBS) -export-dynamic @@ -128,7 +126,12 @@ ui_data = \ $(srcdir)/script-ui.json \ $(NULL) +img_data = \ + $(srcdir)/redhand.png \ + $(srcdir)/smiley.png \ + $(NULL) + examplesdir = $(datadir)/clutter-1.0/cookbook/examples -examples_DATA = $(uidata) $(srcdir)/*.c $(srcdir)/*.h +examples_DATA = $(uidata) $(img_data) $(srcdir)/*.c $(srcdir)/*.h -include $(top_srcdir)/build/autotools/Makefile.am.gitignore diff --git a/doc/cookbook/examples/animations-rotating.c b/doc/cookbook/examples/animations-rotating.c index 411d5b849..4c2d39f43 100644 --- a/doc/cookbook/examples/animations-rotating.c +++ b/doc/cookbook/examples/animations-rotating.c @@ -52,7 +52,7 @@ main (int argc, char *argv[]) clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5)); clutter_texture_set_sync_size (CLUTTER_TEXTURE (texture), TRUE); clutter_texture_set_from_file (CLUTTER_TEXTURE (texture), - TESTS_DATA_DIR "/redhand.png", + "redhand.png", &error); if (error != NULL) diff --git a/doc/cookbook/examples/events-mouse-scroll.c b/doc/cookbook/examples/events-mouse-scroll.c index e491c14de..1b2c8386b 100644 --- a/doc/cookbook/examples/events-mouse-scroll.c +++ b/doc/cookbook/examples/events-mouse-scroll.c @@ -68,7 +68,7 @@ main (int argc, char *argv[]) ClutterActor *viewport; ClutterActor *texture; - gchar *image_file_path = TESTS_DATA_DIR "/redhand.png"; + const gchar *image_file_path = "redhand.png"; if (argc > 1) { diff --git a/doc/cookbook/examples/events-pointer-motion-scribbler.c b/doc/cookbook/examples/events-pointer-motion-scribbler.c index 4d5168dc9..de065332e 100644 --- a/doc/cookbook/examples/events-pointer-motion-scribbler.c +++ b/doc/cookbook/examples/events-pointer-motion-scribbler.c @@ -2,6 +2,7 @@ * Simple scribble application: move mouse over the dark yellow * rectangle to draw brighter yellow lines */ + #include static const ClutterColor stage_color = { 0x33, 0x33, 0x55, 0xff }; diff --git a/doc/cookbook/examples/layouts-bind-constraint-overlay.c b/doc/cookbook/examples/layouts-bind-constraint-overlay.c index 77c209f7f..856955c70 100644 --- a/doc/cookbook/examples/layouts-bind-constraint-overlay.c +++ b/doc/cookbook/examples/layouts-bind-constraint-overlay.c @@ -73,7 +73,7 @@ main (int argc, char *argv[]) ClutterAction *click; GError *error = NULL; - gchar *filename = TESTS_DATA_DIR "/redhand.png"; + const gchar *filename = "redhand.png"; if (argc > 1) filename = argv[1]; diff --git a/doc/cookbook/examples/layouts-stacking.c b/doc/cookbook/examples/layouts-stacking.c index 9ee340b4c..d1d6321a5 100644 --- a/doc/cookbook/examples/layouts-stacking.c +++ b/doc/cookbook/examples/layouts-stacking.c @@ -20,7 +20,7 @@ main (int argc, char *argv[]) GError *error = NULL; gfloat width; - gchar *filename = TESTS_DATA_DIR "/redhand.png"; + const gchar *filename = "redhand.png"; if (argc > 1) filename = argv[1]; diff --git a/doc/cookbook/examples/redhand.png b/doc/cookbook/examples/redhand.png new file mode 100644 index 0000000000000000000000000000000000000000..c07d8acd33d54996512f6e2b6ca4d17b5ffc4f20 GIT binary patch literal 8250 zcmZ`;Wmr_v)*gE3p#+8+Lb^c&q=pb2x^?Iv#L#Gna z;9~}DGo8|sclaT%M4lM0sJI~^@yle1Nun*Qtas*mx9*&F^7#69TJZ3qQ-xoJo%DX| znaMt;`2V;vDHOLbxeD%3@fWQ(yl9B0{<|x|zEzBir7;y0eIx5!CM!yB=ABC^n0Zqi zULG=FeZ+x^fuZI}U%)~*L0t=1xN;I9lps7>s{tfzeLxhvh7rStBEoj>Xy*5;3&sCx z4C0EZ2}Qzg*pggWz|2@mv*DQiw{83&9ld&Dk*Q5sh^U0i+KJ$MwOg)&9U3ckTWL-! zXP$!k4!uMjM3D|cAY;jf4?$~{rG;QEuO2dZzisK(*sR7Cn5MHmV(flByu^`IbMGv; zTjwp9{^Z`Q&xp2;Sj{%~!fWmZ!zPn6SoFex&gX6qSE0uYcg?1d2*FjLyT9C`I2})u z>!QHLpuxr0fH&8KO(}L!Q8zv<%e?)KfVl5@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67_C8m9I#TvSu68Juqer~II2N*aol@-LA8 E2il-`3jhEB literal 0 HcmV?d00001 diff --git a/doc/cookbook/examples/textures-reflection.c b/doc/cookbook/examples/textures-reflection.c index 170e701c2..03c970d66 100644 --- a/doc/cookbook/examples/textures-reflection.c +++ b/doc/cookbook/examples/textures-reflection.c @@ -86,7 +86,7 @@ main (int argc, char *argv[]) texture = clutter_texture_new (); clutter_texture_set_from_file (CLUTTER_TEXTURE (texture), - TESTS_DATA_DIR "/redhand.png", + "redhand.png", &error); clutter_actor_add_constraint (texture, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5)); clutter_actor_add_constraint (texture, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.2));