tests/interactive: Cleanup tabs

I also sneaked in some code style fixes on the lines that were
touched. Judge me freely, it's all for the greater good.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2355>
This commit is contained in:
Georges Basile Stavracas Neto 2022-03-31 11:24:52 -03:00
parent f25360677f
commit 83e0553534
11 changed files with 117 additions and 118 deletions

View File

@ -244,9 +244,7 @@ test_actors_main (int argc, char *argv[])
/* Show everying */ /* Show everying */
clutter_actor_show (oh->stage); clutter_actor_show (oh->stage);
g_signal_connect (oh->stage, "key-release-event", g_signal_connect (oh->stage, "key-release-event", G_CALLBACK (input_cb), oh);
G_CALLBACK (input_cb),
oh);
/* and start it */ /* and start it */
clutter_timeline_start (oh->timeline); clutter_timeline_start (oh->timeline);

View File

@ -90,7 +90,8 @@ draw_flower (ClutterCanvas *canvas,
idx = (rand() % (sizeof (colors) / sizeof (double) / 3)) * 3; idx = (rand() % (sizeof (colors) / sizeof (double) / 3)) * 3;
} while (idx == last_idx); } while (idx == last_idx);
cairo_set_source_rgba (cr, colors[idx], colors[idx+1], cairo_set_source_rgba (cr,
colors[idx], colors[idx+1],
colors[idx+2], 0.5); colors[idx+2], 0.5);
last_idx = idx; last_idx = idx;
@ -109,12 +110,12 @@ draw_flower (ClutterCanvas *canvas,
cairo_move_to (cr, 0, 0); cairo_move_to (cr, 0, 0);
cairo_rel_curve_to (cr, cairo_rel_curve_to (cr,
petal_size, petal_size, petal_size, petal_size,
(pm2+2)*petal_size, petal_size, (pm2 + 2) * petal_size, petal_size,
(2*petal_size) + pm1, 0); (2 * petal_size) + pm1, 0);
cairo_rel_curve_to (cr, cairo_rel_curve_to (cr,
0 + (pm2*petal_size), -petal_size, 0 + (pm2 * petal_size), -petal_size,
-petal_size, -petal_size, -petal_size, -petal_size,
-((2*petal_size) + pm1), 0); -((2 * petal_size) + pm1), 0);
cairo_close_path (cr); cairo_close_path (cr);
cairo_fill (cr); cairo_fill (cr);
cairo_restore (cr); cairo_restore (cr);
@ -233,7 +234,8 @@ test_cairo_flowers_main (int argc, char **argv)
clutter_container_add_actor (CLUTTER_CONTAINER (stage), clutter_container_add_actor (CLUTTER_CONTAINER (stage),
flowers[i]->ctex); flowers[i]->ctex);
clutter_actor_set_position (flowers[i]->ctex, clutter_actor_set_position (flowers[i]->ctex,
flowers[i]->x, flowers[i]->y); flowers[i]->x,
flowers[i]->y);
} }
/* fire a callback for frame change */ /* fire a callback for frame change */

View File

@ -40,7 +40,7 @@ test_cogl_multitexture_describe (void);
static void static void
frame_cb (ClutterTimeline *timeline, frame_cb (ClutterTimeline *timeline,
gint frame_no, int frame_no,
gpointer data) gpointer data)
{ {
TestMultiLayerPipelineState *state = data; TestMultiLayerPipelineState *state = data;
@ -142,7 +142,7 @@ test_cogl_multitexture_main (int argc, char *argv[])
state->group = clutter_actor_new (); state->group = clutter_actor_new ();
clutter_actor_set_position (state->group, stage_w / 2, stage_h / 2); clutter_actor_set_position (state->group, stage_w / 2, stage_h / 2);
g_signal_connect (state->group, "paint", g_signal_connect (state->group, "paint",
G_CALLBACK(material_rectangle_paint), state); G_CALLBACK (material_rectangle_paint), state);
files = g_new (gchar*, 4); files = g_new (gchar*, 4);
files[0] = g_build_filename (TESTS_DATADIR, "redhand_alpha.png", NULL); files[0] = g_build_filename (TESTS_DATADIR, "redhand_alpha.png", NULL);
@ -214,8 +214,7 @@ test_cogl_multitexture_main (int argc, char *argv[])
&GRAPHENE_POINT3D_INIT (0.5, 0.5, 0)); &GRAPHENE_POINT3D_INIT (0.5, 0.5, 0));
clutter_actor_set_translation (data->parent_container, -86.f, -125.f, 0.f); clutter_actor_set_translation (data->parent_container, -86.f, -125.f, 0.f);
clutter_container_add_actor (CLUTTER_CONTAINER(stage), clutter_container_add_actor (CLUTTER_CONTAINER(stage), state->group);
state->group);
state->timeline = clutter_timeline_new_for_actor (stage, 2812); state->timeline = clutter_timeline_new_for_actor (stage, 2812);

View File

@ -343,7 +343,7 @@ test_coglbox_new (void)
static void static void
frame_cb (ClutterTimeline *timeline, frame_cb (ClutterTimeline *timeline,
gint elapsed_msecs, int elapsed_msecs,
gpointer data) gpointer data)
{ {
TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (data); TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (data);

View File

@ -187,7 +187,7 @@ test_coglbox_new (void)
static void static void
frame_cb (ClutterTimeline *timeline, frame_cb (ClutterTimeline *timeline,
gint msecs, int msecs,
gpointer data) gpointer data)
{ {
TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (data); TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (data);