Add automated tests on function-type FSCommand parameter passing.
[gnash.git] / testsuite / network.all / Dejagnu.c
blobb62a069840951190ec62a03f838e80270b660916
1 /*
2 * Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
21 * Generate a Dejagnu.swf file for import from self-contained
22 * SWF testcases
24 * run as ./Dejagnu <mediadir>
27 #include <stdlib.h>
28 #include <stdio.h>
29 #include <ming.h>
31 #include "ming_utils.h"
33 #define OUTPUT_VERSION 5
34 #define OUTPUT_FILENAME "Dejagnu.swf"
36 int
37 main(int argc, char** argv)
39 SWFMovie mo;
40 SWFMovieClip dejaclip;
41 const char *srcdir=".";
42 SWFFont bfont;
45 /*********************************************
47 * Initialization
49 *********************************************/
51 if ( argc>1 ) srcdir=argv[1];
52 else
54 fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]);
55 return 1;
58 puts("Setting things up");
60 Ming_init();
61 Ming_useSWFVersion (OUTPUT_VERSION);
62 Ming_setScale(20.0); /* let's talk pixels */
64 mo = newSWFMovie();
65 SWFMovie_setRate(mo, 1);
66 SWFMovie_setDimension(mo, 628, 1024);
68 bfont = get_default_font(srcdir);
70 /*********************************************
72 * Body
74 *********************************************/
76 dejaclip = get_dejagnu_clip((SWFBlock)bfont, 3000, 0, 50, 800, 800);
78 SWFMovie_add(mo, (SWFBlock)dejaclip);
79 SWFMovie_addExport(mo, (SWFBlock)dejaclip, "dejagnu");
81 SWFMovie_nextFrame(mo); /* showFrame */
84 /*****************************************************
86 * Output movie
88 *****************************************************/
90 puts("Saving " OUTPUT_FILENAME );
92 SWFMovie_save(mo, OUTPUT_FILENAME);
94 return 0;