00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GNASH_MING_UTILS_H
00021 #define GNASH_MING_UTILS_H
00022
00023 #include <ming.h>
00024
00025 #if MING_VERSION_CODE >= 00040004
00026 # define MING_SUPPORTS_INIT_ACTIONS
00027 #endif
00028
00029
00030
00031
00032
00033 void SWFMovie_writeExports(SWFMovie movie);
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #if MING_VERSION_CODE >= 00040004
00045 # define compileSWFActionCode newSWFAction
00046 #else
00047 # define newSWFAction compileSWFActionCode
00048 #endif
00049
00050
00051
00052
00053
00054
00055 #if MING_VERSION_CODE >= 00040006
00056 # define CALLFRAME "call"
00057 #else
00058 # define CALLFRAME "callFrame"
00059 #endif
00060
00061
00062
00063
00064 #ifndef SWFACTION_INIT
00065 # define SWFACTION_INIT (1<<9)
00066 #endif
00067
00068 #ifndef SWFACTION_PRESS
00069 # define SWFACTION_PRESS (1<<10)
00070 #endif
00071
00072 #ifndef SWFACTION_RELEASE
00073 # define SWFACTION_RELEASE (1<<11)
00074 #endif
00075
00076 #ifndef SWFACTION_RELEASEOUTSIDE
00077 # define SWFACTION_RELEASEOUTSIDE (1<<12)
00078 #endif
00079
00080 #ifndef SWFACTION_ROLLOVER
00081 # define SWFACTION_ROLLOVER (1<<13)
00082 #endif
00083
00084 #ifndef SWFACTION_ROLLOUT
00085 # define SWFACTION_ROLLOUT (1<<14)
00086 #endif
00087
00088 #ifndef SWFACTION_DRAGOVER
00089 # define SWFACTION_DRAGOVER (1<<15)
00090 #endif
00091
00092 #ifndef SWFACTION_DRAGOUT
00093 # define SWFACTION_DRAGOUT (1<<16)
00094 #endif
00095
00096 #ifndef SWFACTION_KEYPRESS
00097 # define SWFACTION_KEYPRESS (1<<17)
00098 #endif
00099
00100 #ifndef SWFACTION_CONSTRUCT
00101 # define SWFACTION_CONSTRUCT (1<<18)
00102 #endif
00103
00104
00112 SWFFont get_default_font(const char* mediadir);
00113
00124 void add_dejagnu_functions(SWFMovie mo, SWFBlock font, int depth, int x, int y, int width, int height);
00125
00149 SWFMovieClip get_dejagnu_clip(SWFBlock font, int depth, int x, int y, int width, int height);
00150
00161 #define check(m, expr) \
00162 SWFMovie_add(m, (SWFBlock)compile_actions("\
00163 if ( %s ) pass( \"%s [%s:%d]\"); \
00164 else fail( \"%s [%s:%d] \"); \
00165 ", expr, expr, __FILE__, __LINE__, expr, __FILE__, __LINE__));
00166
00178 #define xcheck(m, expr) \
00179 SWFMovie_add(m, (SWFBlock)compile_actions("\
00180 if ( %s ) xpass( \"%s [%s:%d]\"); \
00181 else xfail( \"%s [%s:%d] \"); \
00182 ", expr, expr, __FILE__, __LINE__, expr, __FILE__, __LINE__));
00183
00184
00200 #define check_equals(m, obt, exp) \
00201 SWFMovie_add(m, (SWFBlock)compile_actions("\
00202 if ( %s == %s ) pass( \"%s == %s [%s:%d]\"); \
00203 else fail( \"expected: %s obtained: \" + %s + \" [%s:%d] \"); \
00204 ", obt, exp, obt, exp, __FILE__, __LINE__, exp, obt, __FILE__, __LINE__));
00205
00221 #define xcheck_equals(m, obt, exp) \
00222 SWFMovie_add(m, (SWFBlock)compile_actions("\
00223 if ( %s == %s ) xpass( \"%s == %s [%s:%d]\"); \
00224 else xfail( \"expected: %s obtained: \" + %s + \" [%s:%d] \"); \
00225 ", obt, exp, obt, exp, __FILE__, __LINE__, exp, obt, __FILE__, __LINE__));
00226
00227
00228
00236 void print_tests_summary(SWFMovie mo);
00237
00241 SWFAction compile_actions(const char* fmt, ...);
00242
00252 void add_actions(SWFMovie mo, const char* code);
00253
00263 void add_clip_actions(SWFMovieClip mc, const char* code);
00264
00265
00266 #ifdef MING_SUPPORTS_INIT_ACTIONS
00267
00276 void add_clip_init_actions(SWFMovieClip mo, const char* code);
00277 #endif // MING_SUPPORTS_INIT_ACTIONS
00278
00282 SWFShape make_square(int x, int y, int width, int height, byte r, byte g, byte b);
00283
00287 SWFShape make_fill_square(int x, int y, int width, int height, byte outline_r, byte outline_g, byte outline_b, byte fill_r, byte fill_g, byte fill_b);
00288
00289 #endif // GNASH_MING_UTILS_H