From 81861656e80927483bdea464cd6caa1017823d97 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 13 Jun 2008 15:18:08 +0000 Subject: [PATCH] 2008-06-13 Emmanuele Bassi * tests/test-cogl-offscreen.c: * tests/test-cogl-primitives.c: * tests/test-cogl-tex-convert.c: * tests/test-cogl-tex-foreign.c: * tests/test-cogl-tex-getset.c: * tests/test-cogl-tex-tile.c: * tests/test-layout.c: * tests/test-pixmap.c: * tests/test-texture-quality.c: Miscellaneous fixes for distcheck to pass. --- tests/test-cogl-offscreen.c | 3 --- tests/test-cogl-primitives.c | 4 ++-- tests/test-cogl-tex-convert.c | 14 ------------- tests/test-cogl-tex-foreign.c | 3 --- tests/test-cogl-tex-getset.c | 3 --- tests/test-cogl-tex-tile.c | 2 -- tests/test-layout.c | 37 ++++++++++++++++++----------------- tests/test-pixmap.c | 10 +++++++--- tests/test-texture-quality.c | 5 +++-- 9 files changed, 31 insertions(+), 50 deletions(-) diff --git a/tests/test-cogl-offscreen.c b/tests/test-cogl-offscreen.c index a9c2c6512..821b3ab71 100644 --- a/tests/test-cogl-offscreen.c +++ b/tests/test-cogl-offscreen.c @@ -198,9 +198,6 @@ main (int argc, char *argv[]) { ClutterActor *stage; ClutterActor *coglbox; - ClutterTimeline *timeline; - ClutterBehaviour *behave; - ClutterAlpha *alpha; clutter_init(&argc, &argv); diff --git a/tests/test-cogl-primitives.c b/tests/test-cogl-primitives.c index 494df9602..fa59c9861 100644 --- a/tests/test-cogl-primitives.c +++ b/tests/test-cogl-primitives.c @@ -194,12 +194,12 @@ test_coglbox_paint(ClutterActor *self) { timer = g_timer_new (); g_timer_start (timer); - paint_index = 0; } if (g_timer_elapsed (timer, NULL) >= 1) { - paint_index = (++paint_index) % NUM_PAINT_FUNCS; + paint_index += 1; + paint_index = paint_index % NUM_PAINT_FUNCS; g_timer_start (timer); } diff --git a/tests/test-cogl-tex-convert.c b/tests/test-cogl-tex-convert.c index 20d91332c..96b2dd89a 100644 --- a/tests/test-cogl-tex-convert.c +++ b/tests/test-cogl-tex-convert.c @@ -196,25 +196,11 @@ test_coglbox_new (void) return g_object_new (TEST_TYPE_COGLBOX, NULL); } -static void -frame_cb (ClutterTimeline *timeline, - gint frame_num, - gpointer data) -{ - TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (data); - - priv->frame = frame_num; - clutter_actor_queue_redraw (CLUTTER_ACTOR (data)); -} - int main (int argc, char *argv[]) { ClutterActor *stage; ClutterActor *coglbox; - ClutterTimeline *timeline; - ClutterBehaviour *behave; - ClutterAlpha *alpha; clutter_init(&argc, &argv); diff --git a/tests/test-cogl-tex-foreign.c b/tests/test-cogl-tex-foreign.c index 36f19cbde..926fcb304 100644 --- a/tests/test-cogl-tex-foreign.c +++ b/tests/test-cogl-tex-foreign.c @@ -192,9 +192,6 @@ main (int argc, char *argv[]) { ClutterActor *stage; ClutterActor *coglbox; - ClutterTimeline *timeline; - ClutterBehaviour *behave; - ClutterAlpha *alpha; clutter_init(&argc, &argv); diff --git a/tests/test-cogl-tex-getset.c b/tests/test-cogl-tex-getset.c index c8ecf38fe..cd63ae6b7 100644 --- a/tests/test-cogl-tex-getset.c +++ b/tests/test-cogl-tex-getset.c @@ -250,9 +250,6 @@ main (int argc, char *argv[]) { ClutterActor *stage; ClutterActor *coglbox; - ClutterTimeline *timeline; - ClutterBehaviour *behave; - ClutterAlpha *alpha; clutter_init(&argc, &argv); diff --git a/tests/test-cogl-tex-tile.c b/tests/test-cogl-tex-tile.c index 05a1eb03c..8035a7557 100644 --- a/tests/test-cogl-tex-tile.c +++ b/tests/test-cogl-tex-tile.c @@ -198,8 +198,6 @@ main (int argc, char *argv[]) ClutterActor *stage; ClutterActor *coglbox; ClutterTimeline *timeline; - ClutterBehaviour *behave; - ClutterAlpha *alpha; clutter_init(&argc, &argv); diff --git a/tests/test-layout.c b/tests/test-layout.c index 9cdffce95..1b1d35f08 100644 --- a/tests/test-layout.c +++ b/tests/test-layout.c @@ -563,11 +563,10 @@ my_thing_new (gint padding, /* test code */ -static ClutterActor *stage = NULL; -static ClutterActor *box = NULL; -static ClutterActor *icon = NULL; -static ClutterTimeline *timeline = NULL; -static ClutterBehaviour *behaviour = NULL; +static ClutterActor *box = NULL; +static ClutterActor *icon = NULL; +static ClutterTimeline *main_timeline = NULL; +static ClutterBehaviour *behaviour = NULL; static ClutterColor bg_color; @@ -623,7 +622,7 @@ decrease_property_value (ClutterActor *actor, } static ClutterActor * -create_item() +create_item (void) { ClutterActor *clone = clutter_clone_texture_new (CLUTTER_TEXTURE (icon)); @@ -638,7 +637,7 @@ create_item() } static gboolean -keypress_cb (ClutterStage *stage, +keypress_cb (ClutterActor *actor, ClutterKeyEvent *event, gpointer data) { @@ -709,17 +708,19 @@ keypress_cb (ClutterStage *stage, case CLUTTER_z: { - if (clutter_timeline_is_playing (timeline)) - clutter_timeline_pause (timeline); + if (clutter_timeline_is_playing (main_timeline)) + clutter_timeline_pause (main_timeline); else - clutter_timeline_start (timeline); + clutter_timeline_start (main_timeline); break; } default: - break; - } + break; + } + + return FALSE; } static void @@ -746,7 +747,7 @@ int main (int argc, char *argv[]) { - ClutterActor *instructions; + ClutterActor *stage, *instructions; gint i; GError *error = NULL; @@ -757,13 +758,13 @@ main (int argc, clutter_color_parse ("Red", &bg_color); - timeline = clutter_timeline_new_for_duration (2000); - clutter_timeline_set_loop (timeline, TRUE); - g_signal_connect (timeline, "new-frame", + main_timeline = clutter_timeline_new_for_duration (2000); + clutter_timeline_set_loop (main_timeline, TRUE); + g_signal_connect (main_timeline, "new-frame", G_CALLBACK (relayout_on_frame), NULL); - behaviour = clutter_behaviour_scale_new (clutter_alpha_new_full (timeline, + behaviour = clutter_behaviour_scale_new (clutter_alpha_new_full (main_timeline, CLUTTER_ALPHA_SINE, NULL, NULL), 1.0, 1.0, 2.0, 2.0); @@ -810,7 +811,7 @@ main (int argc, clutter_main (); - g_object_unref (timeline); + g_object_unref (main_timeline); g_object_unref (behaviour); return EXIT_SUCCESS; diff --git a/tests/test-pixmap.c b/tests/test-pixmap.c index 14908f35a..f547a1abc 100644 --- a/tests/test-pixmap.c +++ b/tests/test-pixmap.c @@ -1,6 +1,9 @@ #include +#include +#include + #if HAVE_CLUTTER_GLX #include @@ -12,7 +15,6 @@ #include #include -#include #define IMAGE "redhand.png" @@ -35,6 +37,8 @@ stage_press_cb (ClutterActor *actor, &gc_values); XDrawLine (dpy, pxm, gc, 0, 0, 100, 100); + + return FALSE; } @@ -144,7 +148,6 @@ main (int argc, char **argv) # ifdef USE_GDKPIXBUF ClutterActor *stage, *tex; Pixmap pixmap; - guint w, h, d; const ClutterColor gry = { 0x99, 0x99, 0x99, 0xFF }; Window win_remote; @@ -201,8 +204,9 @@ main (int argc, char **argv) clutter_main (); # endif /* USE_GDKPIXBUF */ + return EXIT_SUCCESS; } #else /* HAVE_CLUTTER_GLX */ -int main(int argc, char **argv){return 0;}; +int main (int argc, char **argv) { return EXIT_SUCCESS; }; #endif /* HAVE_CLUTTER_GLX */ diff --git a/tests/test-texture-quality.c b/tests/test-texture-quality.c index 3688e9a7f..baeae2aec 100644 --- a/tests/test-texture-quality.c +++ b/tests/test-texture-quality.c @@ -62,10 +62,11 @@ main (int argc, char *argv[]) error = NULL; image = clutter_texture_new_from_file (argv[1]?argv[1]:"redhand.png", &error); if (error) - g_error ("Unable to load image.", error->message); + g_error ("Unable to load image: %s", error->message); if (!argv[1]) - g_print ("Hint: the redhand.png isn't a good test image for this, this test can take any clutter loadable image as an argument\n"); + g_print ("Hint: the redhand.png isn't a good test image for this test.\n" + "This test can take any clutter loadable image as an argument\n"); /* center the image */ clutter_actor_set_position (image,