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.
This commit is contained in:
parent
e20c8dede6
commit
027e1a717f
@ -56,15 +56,13 @@ LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la -lm
|
|||||||
AM_CFLAGS = $(CLUTTER_CFLAGS)
|
AM_CFLAGS = $(CLUTTER_CFLAGS)
|
||||||
|
|
||||||
AM_CPPFLAGS = \
|
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_srcdir)/ \
|
||||||
-I$(top_builddir)/ \
|
-I$(top_builddir)/ \
|
||||||
-I$(top_srcdir)/clutter \
|
-I$(top_srcdir)/clutter \
|
||||||
-I$(top_builddir)/clutter \
|
-I$(top_builddir)/clutter \
|
||||||
|
-DG_DISABLE_SINGLE_INCLUDES \
|
||||||
|
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
||||||
|
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
AM_LDFLAGS = $(CLUTTER_LIBS) -export-dynamic
|
AM_LDFLAGS = $(CLUTTER_LIBS) -export-dynamic
|
||||||
@ -128,7 +126,12 @@ ui_data = \
|
|||||||
$(srcdir)/script-ui.json \
|
$(srcdir)/script-ui.json \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
img_data = \
|
||||||
|
$(srcdir)/redhand.png \
|
||||||
|
$(srcdir)/smiley.png \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
examplesdir = $(datadir)/clutter-1.0/cookbook/examples
|
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
|
-include $(top_srcdir)/build/autotools/Makefile.am.gitignore
|
||||||
|
@ -52,7 +52,7 @@ main (int argc, char *argv[])
|
|||||||
clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5));
|
clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5));
|
||||||
clutter_texture_set_sync_size (CLUTTER_TEXTURE (texture), TRUE);
|
clutter_texture_set_sync_size (CLUTTER_TEXTURE (texture), TRUE);
|
||||||
clutter_texture_set_from_file (CLUTTER_TEXTURE (texture),
|
clutter_texture_set_from_file (CLUTTER_TEXTURE (texture),
|
||||||
TESTS_DATA_DIR "/redhand.png",
|
"redhand.png",
|
||||||
&error);
|
&error);
|
||||||
|
|
||||||
if (error != NULL)
|
if (error != NULL)
|
||||||
|
@ -68,7 +68,7 @@ main (int argc, char *argv[])
|
|||||||
ClutterActor *viewport;
|
ClutterActor *viewport;
|
||||||
ClutterActor *texture;
|
ClutterActor *texture;
|
||||||
|
|
||||||
gchar *image_file_path = TESTS_DATA_DIR "/redhand.png";
|
const gchar *image_file_path = "redhand.png";
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
* Simple scribble application: move mouse over the dark yellow
|
* Simple scribble application: move mouse over the dark yellow
|
||||||
* rectangle to draw brighter yellow lines
|
* rectangle to draw brighter yellow lines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
static const ClutterColor stage_color = { 0x33, 0x33, 0x55, 0xff };
|
static const ClutterColor stage_color = { 0x33, 0x33, 0x55, 0xff };
|
||||||
|
@ -73,7 +73,7 @@ main (int argc, char *argv[])
|
|||||||
ClutterAction *click;
|
ClutterAction *click;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
gchar *filename = TESTS_DATA_DIR "/redhand.png";
|
const gchar *filename = "redhand.png";
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
filename = argv[1];
|
filename = argv[1];
|
||||||
|
@ -20,7 +20,7 @@ main (int argc, char *argv[])
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gfloat width;
|
gfloat width;
|
||||||
|
|
||||||
gchar *filename = TESTS_DATA_DIR "/redhand.png";
|
const gchar *filename = "redhand.png";
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
filename = argv[1];
|
filename = argv[1];
|
||||||
|
BIN
doc/cookbook/examples/redhand.png
Normal file
BIN
doc/cookbook/examples/redhand.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
@ -86,7 +86,7 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
texture = clutter_texture_new ();
|
texture = clutter_texture_new ();
|
||||||
clutter_texture_set_from_file (CLUTTER_TEXTURE (texture),
|
clutter_texture_set_from_file (CLUTTER_TEXTURE (texture),
|
||||||
TESTS_DATA_DIR "/redhand.png",
|
"redhand.png",
|
||||||
&error);
|
&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_X_AXIS, 0.5));
|
||||||
clutter_actor_add_constraint (texture, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.2));
|
clutter_actor_add_constraint (texture, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.2));
|
||||||
|
Loading…
Reference in New Issue
Block a user