[clutter/clutter-1.18] cookbook: Fix build of the examples



commit 027e1a717f2378a7a9f9b273bec6128cdb984989
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Jan 21 21:07:43 2014 +0000

    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(-)
---
diff --git a/doc/cookbook/examples/Makefile.am b/doc/cookbook/examples/Makefile.am
index 4f0af58..6752240 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 411d5b8..4c2d39f 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 e491c14..1b2c838 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 4d5168d..de06533 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 <clutter/clutter.h>
 
 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 77c209f..856955c 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 9ee340b..d1d6321 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 0000000..c07d8ac
Binary files /dev/null and b/doc/cookbook/examples/redhand.png differ
diff --git a/doc/cookbook/examples/textures-reflection.c b/doc/cookbook/examples/textures-reflection.c
index 170e701..03c970d 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));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]