CVSROOT: /sources/gnash Module name: gnash Changes by: Zou Lunkai <zoulunkai> 07/04/24 06:54:06
Modified files: . : ChangeLog testsuite/misc-ming.all: Makefile.am key_event_test.c server/swf : PlaceObject2Tag.h PlaceObject2Tag.cpp Log message: activate testcases CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2975&r2=1.2976 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.97&r2=1.98 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/key_event_test.c?cvsroot=gnash&r1=1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.h?cvsroot=gnash&r1=1.2&r2=1.3 http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.cpp?cvsroot=gnash&r1=1.4&r2=1.5 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.2975 retrieving revision 1.2976 diff -u -b -r1.2975 -r1.2976 --- ChangeLog 23 Apr 2007 20:05:19 -0000 1.2975 +++ ChangeLog 24 Apr 2007 06:54:06 -0000 1.2976 @@ -1,3 +1,12 @@ +2007-04-24 Zou Lunkai <[EMAIL PROTECTED]> + + * testsuite/misc-ming.all/Makefile.am + activate testcases committed yestoday + * testsuite/misc-ming.all/key_event_test.c + fix a typo + * server/swf/PlaceObject2Tag.{h,cpp} + minor clean up, keep the "all_event_flags" for future use. + 2007-04-23 Sandro Santilli <[EMAIL PROTECTED]> * server/DynamicShape.{h,cpp} (lineStyle): add a line style even Index: testsuite/misc-ming.all/Makefile.am =================================================================== RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v retrieving revision 1.97 retrieving revision 1.98 diff -u -b -r1.97 -r1.98 --- testsuite/misc-ming.all/Makefile.am 23 Apr 2007 12:30:08 -0000 1.97 +++ testsuite/misc-ming.all/Makefile.am 24 Apr 2007 06:54:06 -0000 1.98 @@ -109,7 +109,10 @@ frame_label_test \ path_format_test \ duplicate_movie_clip_test \ + event_handler_scope_test \ masks_testrunner \ + key_event_test \ + key_event_testrunner \ $(NULL) if MAKESWF_SUPPORTS_PREBUILT_CLIPS @@ -148,6 +151,7 @@ frame_label_testrunner \ path_format_testrunner \ duplicate_movie_clip_testrunner \ + event_handler_scope_testrunner \ matrix_testrunner \ $(NULL) @@ -311,6 +315,32 @@ $(top_builddir)/testsuite/libtestsuite.la \ $(NULL) + +key_event_test_SOURCES = \ + key_event_test.c \ + ming_utils.h \ + ming_utils.c \ + $(NULL) +key_event_test_LDADD = $(MING_LIBS) + +key_event_test.swf: key_event_test + ./key_event_test $(top_srcdir)/testsuite/media + +key_event_testrunner_SOURCES = \ + key_event_testrunner.cpp \ + $(NULL) +key_event_testrunner_LDADD = \ + $(top_builddir)/testsuite/libtestsuite.la \ + $(NULL) +key_event_testrunner_CXXFLAGS = \ + -DSRCDIR='"$(srcdir)"' \ + -DTGTDIR='"$(abs_builddir)"' \ + $(NULL) +key_event_testrunner_DEPENDENCIES = \ + key_event_test.swf \ + $(top_builddir)/testsuite/libtestsuite.la \ + $(NULL) + place_object_test_SOURCES = \ place_object_test.c \ ming_utils.h \ @@ -475,6 +505,21 @@ sh $< -r5 $(top_builddir) duplicate_movie_clip_test.swf > $@ chmod 755 $@ + +event_handler_scope_test_SOURCES = \ + event_handler_scope_test.c \ + ming_utils.h \ + ming_utils.c \ + $(NULL) +event_handler_scope_test_LDADD = $(MING_LIBS) + +event_handler_scope_test.swf: event_handler_scope_test + ./event_handler_scope_test $(top_srcdir)/testsuite/media + +event_handler_scope_testrunner: $(srcdir)/../generic-testrunner.sh event_handler_scope_test.swf + sh $< -r5 $(top_builddir) event_handler_scope_test.swf > $@ + chmod 755 $@ + attachMovieTest_SOURCES = \ attachMovieTest.c \ ming_utils.h \ @@ -989,7 +1034,9 @@ frame_label_testrunner \ path_format_testrunner \ duplicate_movie_clip_testrunner \ + event_handler_scope_testrunner \ masks_testrunner \ + key_event_testrunner \ $(NULL) if MAKESWF_SUPPORTS_PREBUILT_CLIPS Index: testsuite/misc-ming.all/key_event_test.c =================================================================== RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/key_event_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- testsuite/misc-ming.all/key_event_test.c 23 Apr 2007 11:15:38 -0000 1.1 +++ testsuite/misc-ming.all/key_event_test.c 24 Apr 2007 06:54:06 -0000 1.2 @@ -58,7 +58,7 @@ dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 800, 600); SWFMovie_add(mo, (SWFBlock)dejagnuclip); - add_actions(mo, "x1=0; x2=0; x3=0; x=0; x5=0; x6=0; "); + add_actions(mo, "x1=0; x2=0; x3=0; x4=0; x5=0; x6=0; "); SWFMovie_nextFrame(mo); /* 1st frame */ Index: server/swf/PlaceObject2Tag.h =================================================================== RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- server/swf/PlaceObject2Tag.h 11 Apr 2007 17:54:22 -0000 1.2 +++ server/swf/PlaceObject2Tag.h 24 Apr 2007 06:54:06 -0000 1.3 @@ -18,7 +18,7 @@ // // -/* $Id: PlaceObject2Tag.h,v 1.2 2007/04/11 17:54:22 bjacques Exp $ */ +/* $Id: PlaceObject2Tag.h,v 1.3 2007/04/24 06:54:06 zoulunkai Exp $ */ #ifndef GNASH_SWF_PLACEOBJECT2TAG_H #define GNASH_SWF_PLACEOBJECT2TAG_H @@ -99,6 +99,7 @@ int m_depth; uint16_t m_character_id; int m_clip_depth; + uint32_t all_event_flags; enum place_type { Index: server/swf/PlaceObject2Tag.cpp =================================================================== RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- server/swf/PlaceObject2Tag.cpp 18 Apr 2007 14:07:33 -0000 1.4 +++ server/swf/PlaceObject2Tag.cpp 24 Apr 2007 06:54:06 -0000 1.5 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: PlaceObject2Tag.cpp,v 1.4 2007/04/18 14:07:33 jgilmore Exp $ */ +/* $Id: PlaceObject2Tag.cpp,v 1.5 2007/04/24 06:54:06 zoulunkai Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -71,13 +71,10 @@ assert(reserved == 0); // must be 0 // The logical 'or' of all the following handlers. - // I don't think we care about this... - uint32_t all_flags = (movie_version >= 6) ? - in->read_u32() : in->read_u16(); - UNUSED(all_flags); + all_event_flags = (movie_version >= 6) ? in->read_u32() : in->read_u16(); IF_VERBOSE_PARSE ( - log_parse(_(" actions: flags = 0x%X"), all_flags); + log_parse(_(" actions: flags = 0x%X"), all_event_flags); ); // Read swf_events. @@ -88,9 +85,8 @@ uint32_t flags = (movie_version >= 6) ? in->read_u32() : in->read_u16(); - if (flags == 0) + if (flags == 0) // no other events { - // Done with events. break; } @@ -109,7 +105,7 @@ uint8_t ch = key::INVALID; - if (flags & (1 << 17)) // has keypress event + if (flags & (1 << 17)) // has KeyPress event { ch = in->read_u8(); event_length--; @@ -145,7 +141,8 @@ } // 13 bits reserved, 19 bits used - static const event_id s_code_bits[19] = + const int total_known_events = 19; + static const event_id s_code_bits[total_known_events] = { event_id::LOAD, event_id::ENTER_FRAME, @@ -171,22 +168,23 @@ }; // Let's see if the event flag we received is for an event that we know of - if ((pow(2.0, int( sizeof(s_code_bits) / sizeof(s_code_bits[0]) )) - 1) < flags) + + //check if all unused bits are zero! + if( !(flags & (1 << total_known_events)) ) { IF_VERBOSE_MALFORMED_SWF( log_swferror(_("swf_event::read() -- unknown / unhandled event type received, flags = 0x%x"), flags); ); } - for (int i = 0, mask = 1; i < int(sizeof(s_code_bits)/sizeof(s_code_bits[0])); i++, mask <<= 1) + for (int i = 0, mask = 1; i < total_known_events; i++, mask <<= 1) { if (flags & mask) { std::auto_ptr<swf_event> ev ( new swf_event(s_code_bits[i], action) ); //log_action("---- actions for event %s", ev->event().get_function_name().c_str()); - // hack - if (i == 17) // has keypress event ? + if (i == 17) // has KeyPress event { ev->event().setKeyCode(ch); } @@ -194,7 +192,7 @@ m_event_handlers.push_back(ev.release()); } } - } + } //end of for(;;) } // read SWF::PLACEOBJECT2 _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit