doc: fix clutter_init() usage in examples
Make sure users get the idea that clutter_init() has a return value that needs to be checked. These were fixed via sed magic: sed -i -s -e "s/clutter_init (.*)/\ if (& != CLUTTER_INIT_SUCCESS)\n return 1/"\ doc/*/*/*.{c,xml} doc/*/*.xml http://bugzilla.clutter-project.org/show_bug.cgi?id=2574
This commit is contained in:
parent
eb906d85ca
commit
aece642adb
@ -32,7 +32,8 @@ main (int argc,
|
||||
ClutterConstraint *align_x_constraint;
|
||||
ClutterConstraint *align_y_constraint;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -40,7 +40,8 @@ main (int argc, char *argv[])
|
||||
if (argc > 1)
|
||||
filename = argv[1];
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
script = clutter_script_new ();
|
||||
clutter_script_load_from_file (script, filename, &error);
|
||||
|
@ -26,7 +26,8 @@ main (int argc,
|
||||
ClutterTimeline *timeline;
|
||||
ClutterAnimator *animator;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 300, 200);
|
||||
|
@ -36,7 +36,8 @@ main (int argc,
|
||||
|
||||
ClutterActor *stage;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 300, 200);
|
||||
|
@ -37,7 +37,8 @@ main (int argc,
|
||||
ClutterActor *actor;
|
||||
ClutterState *transitions;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 300, 200);
|
||||
|
@ -73,7 +73,8 @@ main (int argc,
|
||||
/* seed random number generator */
|
||||
srand ((unsigned int) time (NULL));
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
state->animator = clutter_animator_new ();
|
||||
clutter_animator_set_duration (state->animator, 500);
|
||||
|
@ -44,7 +44,8 @@ main (int argc,
|
||||
AnimationSpec y_move = { "y", 400.0 };
|
||||
AnimationSpec z_move = { "depth", -1000.0 };
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 500, 500);
|
||||
|
@ -27,7 +27,8 @@ main (int argc,
|
||||
ClutterActor *green;
|
||||
ClutterState *transitions;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 650, 500);
|
||||
|
@ -70,7 +70,8 @@ main (int argc,
|
||||
ClutterActor *stage;
|
||||
ClutterActor *rectangle;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, STAGE_SIDE, STAGE_SIDE);
|
||||
|
@ -49,7 +49,8 @@ main (int argc,
|
||||
ClutterActor *stage;
|
||||
ClutterAnimator *animator;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -14,7 +14,8 @@ main (int argc,
|
||||
const ClutterColor *stage_color = clutter_color_new (51, 51, 85, 255);
|
||||
const ClutterColor *red_color = clutter_color_new (255, 0, 0, 255);
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, 360, 300);
|
||||
|
@ -82,7 +82,8 @@ main (int argc, char *argv[])
|
||||
ClutterScript *script;
|
||||
ClutterActor *stage;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
script = clutter_script_new ();
|
||||
load_script_from_file (script, UI_FILE);
|
||||
|
@ -39,7 +39,8 @@ main (int argc, char *argv[])
|
||||
GError *error = NULL;
|
||||
gfloat texture_width, texture_height;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
|
||||
|
@ -106,7 +106,8 @@ main (int argc,
|
||||
|
||||
image_path = argv[1];
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, STAGE_SIDE, STAGE_SIDE);
|
||||
|
@ -114,7 +114,8 @@ main (int argc,
|
||||
State *state = g_new0 (State, 1);
|
||||
ClutterActor *stage;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 350, 350);
|
||||
|
@ -20,7 +20,8 @@ main (int argc,
|
||||
|
||||
filename = argv[1];
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -46,7 +46,8 @@ main (int argc,
|
||||
|
||||
filename = argv[1];
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, 400, 300);
|
||||
|
@ -23,7 +23,8 @@ main (int argc,
|
||||
ClutterActor *actor1;
|
||||
ClutterActor *actor2;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -122,7 +122,8 @@ main (int argc,
|
||||
/* seed random number generator */
|
||||
srand ((unsigned int) time (NULL));
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 320, 240);
|
||||
|
@ -57,7 +57,8 @@ main (int argc,
|
||||
ClutterActor *red;
|
||||
ClutterActor *green;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -75,7 +75,8 @@ main (int argc, char *argv[])
|
||||
image_file_path = argv[1];
|
||||
}
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
|
||||
|
@ -34,7 +34,8 @@ main (int argc, char *argv[])
|
||||
ClutterActor *text;
|
||||
ClutterState *transitions;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
|
@ -107,7 +107,8 @@ main (int argc, char *argv[])
|
||||
ClutterActor *rect;
|
||||
ClutterActor *canvas;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
context->path = clutter_path_new ();
|
||||
|
||||
|
@ -50,7 +50,8 @@ main (int argc, char *argv[])
|
||||
ClutterActor *stage;
|
||||
ClutterActor *r1, *r2, *r3;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 300, 300);
|
||||
|
@ -29,7 +29,8 @@ main (int argc, char *argv[])
|
||||
ClutterActor *stage;
|
||||
ClutterActor *rectangle;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -35,7 +35,8 @@ main (int argc, char *argv[])
|
||||
ClutterActor *actor;
|
||||
ClutterActor *overlay;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -78,7 +78,8 @@ main (int argc, char *argv[])
|
||||
if (argc > 1)
|
||||
filename = argv[1];
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, STAGE_SIDE, STAGE_SIDE);
|
||||
|
@ -16,7 +16,8 @@ main (int argc, char *argv[])
|
||||
ClutterConstraint *width_binding;
|
||||
ClutterConstraint *height_binding;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -88,7 +88,8 @@ main (int argc,
|
||||
ClutterLayoutManager *menu_layout;
|
||||
ClutterActor *menu;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -314,7 +314,8 @@ main (int argc,
|
||||
|
||||
State *state = g_new0 (State, 1);
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
state->x_fill = FALSE;
|
||||
state->y_fill = FALSE;
|
||||
|
@ -18,7 +18,8 @@ main (int argc,
|
||||
ClutterActor *red;
|
||||
ClutterActor *blue;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -14,7 +14,8 @@ main (int argc, char *argv[])
|
||||
ClutterColor *color;
|
||||
ClutterActor *rect;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, 400, 400);
|
||||
|
@ -25,7 +25,8 @@ main (int argc, char *argv[])
|
||||
if (argc > 1)
|
||||
filename = argv[1];
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_set_size (stage, STAGE_SIDE, STAGE_SIDE);
|
||||
|
@ -61,7 +61,8 @@ main (int argc, char *argv[])
|
||||
gchar *filename = "script-signals.json";
|
||||
GError *error = NULL;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
ui = clutter_script_new ();
|
||||
|
||||
|
@ -10,7 +10,8 @@ main (int argc, char *argv[])
|
||||
gchar *filename = "script-ui.json";
|
||||
GError *error = NULL;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
ui = clutter_script_new ();
|
||||
|
||||
|
@ -40,7 +40,8 @@ main (int argc, char *argv[])
|
||||
ClutterActor *stage;
|
||||
ClutterActor *text;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Text shadow");
|
||||
|
@ -106,10 +106,11 @@ main (int argc, char *argv[])
|
||||
ClutterActor *texture;
|
||||
ClutterTimeline *timeline;
|
||||
|
||||
clutter_init_with_args (&argc, &argv,
|
||||
" - Crossfade", entries,
|
||||
NULL,
|
||||
NULL);
|
||||
if (clutter_init_with_args (&argc, &argv,
|
||||
" - Crossfade", entries,
|
||||
NULL,
|
||||
NULL) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
if (source == NULL || target == NULL)
|
||||
return print_usage_and_exit (argv[0], EXIT_FAILURE);
|
||||
|
@ -122,7 +122,8 @@ main (int argc, char *argv[])
|
||||
for (i = 1; i < argc; i++)
|
||||
app->image_paths = g_slist_append (app->image_paths, argv[i]);
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
|
||||
|
@ -70,10 +70,11 @@ main (int argc, char *argv[])
|
||||
ClutterActor *top, *bottom;
|
||||
ClutterState *transitions;
|
||||
|
||||
clutter_init_with_args (&argc, &argv,
|
||||
" - cross-fade", entries,
|
||||
NULL,
|
||||
NULL);
|
||||
if (clutter_init_with_args (&argc, &argv,
|
||||
" - cross-fade", entries,
|
||||
NULL,
|
||||
NULL) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
if (source == NULL || target == NULL)
|
||||
{
|
||||
@ -81,7 +82,8 @@ main (int argc, char *argv[])
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "cross-fade");
|
||||
|
@ -77,7 +77,8 @@ main (int argc, char *argv[])
|
||||
ClutterActor *clone;
|
||||
gfloat y_offset;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Reflection");
|
||||
|
@ -114,7 +114,8 @@ main (int argc,
|
||||
CoglHandle texture;
|
||||
Context context;
|
||||
|
||||
clutter_init (NULL, NULL);
|
||||
if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_actor_get_size (stage, &stage_width, &stage_height);
|
||||
|
@ -8,7 +8,8 @@ main (int argc, char **argv)
|
||||
gfloat image_width, image_height;
|
||||
|
||||
/* Initialize Clutter */
|
||||
clutter_init (NULL, NULL);
|
||||
if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
/* Get the default stage */
|
||||
stage = clutter_stage_get_default ();
|
||||
|
@ -441,7 +441,8 @@ main (int argc, char *argv[])
|
||||
/* initialize GLib's default threading implementation */
|
||||
g_thread_init (NULL);
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
/* ... get stage etc. */
|
||||
|
||||
@ -711,7 +712,8 @@ _clone_paint_cb (ClutterActor *actor)
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
/* ... get stage etc. */
|
||||
|
||||
|
@ -299,7 +299,8 @@ main (int argc, char *argv[])
|
||||
ClutterAlpha *alpha;
|
||||
ClutterActor *stage, *actor;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
|
||||
return 1;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user