gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. 6e8b1e6917753fa28539


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 6e8b1e6917753fa28539cfa55d5c57b47be35fe9
Date: Fri, 03 Dec 2010 18:34:03 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  6e8b1e6917753fa28539cfa55d5c57b47be35fe9 (commit)
      from  787929f2e6ef32521b195e7604132d7b3cafceb6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=6e8b1e6917753fa28539cfa55d5c57b47be35fe9


commit 6e8b1e6917753fa28539cfa55d5c57b47be35fe9
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Dec 3 19:09:29 2010 +0100

    Use ptr_container, const correct, make event_id ctor explicit.

diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index 3788cc5..0f7380d 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -461,14 +461,15 @@ DisplayObject::unload()
     const bool childHandler = unloadChildren();
 
     if (!_unloaded) {
-        queueEvent(event_id::UNLOAD, movie_root::PRIORITY_DOACTION);
+        queueEvent(event_id(event_id::UNLOAD), movie_root::PRIORITY_DOACTION);
     }
 
     // Unregister this DisplayObject as mask and/or maskee.
     if (_maskee) _maskee->setMask(0);
     if (_mask) _mask->setMaskee(0);
 
-    const bool hasEvent = hasEventHandler(event_id::UNLOAD) || childHandler;
+    const bool hasEvent =
+        hasEventHandler(event_id(event_id::UNLOAD)) || childHandler;
 
     if (!hasEvent) {
         stage().removeQueuedConstructor(this);
diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index d86a57c..98e4dcf 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -923,11 +923,10 @@ MovieClip::advance()
 #endif
 
     // I'm not sure ENTERFRAME goes in a different queue then DOACTION...
-    queueEvent(event_id::ENTER_FRAME, movie_root::PRIORITY_DOACTION);
+    queueEvent(event_id(event_id::ENTER_FRAME), movie_root::PRIORITY_DOACTION);
 
     // Update current and next frames.
-    if (_playState == PLAYSTATE_PLAY)
-    {
+    if (_playState == PLAYSTATE_PLAY) {
 #ifdef GNASH_DEBUG
         log_debug(_("MovieClip::advance_movieclip we're in PLAYSTATE_PLAY 
mode"));
 #endif
@@ -1293,11 +1292,12 @@ MovieClip::add_display_object(const 
SWF::PlaceObject2Tag* tag,
     }
 
     // Attach event handlers (if any).
-    const std::vector<swf_event*>& event_handlers = tag->getEventHandlers();
-    for (size_t i = 0, n = event_handlers.size(); i < n; i++)
-    {
-        swf_event* ev = event_handlers[i];
-        ch->add_event_handler(ev->event(), ev->action());
+    const SWF::PlaceObject2Tag::EventHandlers& event_handlers =
+        tag->getEventHandlers();
+
+    for (size_t i = 0, n = event_handlers.size(); i < n; ++i) {
+        const swf_event& ev = event_handlers[i];
+        ch->add_event_handler(ev.event(), ev.action());
     }
 
     // TODO: check if we should check those has_xxx flags first.
@@ -1600,7 +1600,7 @@ MovieClip::mouseEnabled() const
         const event_id &event = EH[i];
 
         // Check event handlers
-        if (hasEventHandler(event.id())) {
+        if (hasEventHandler(event_id(event.id()))) {
             return true;
         }
     }
@@ -1752,7 +1752,7 @@ MovieClip::constructAsScriptObject()
 
     // Send the construct event. This must be done after the __proto__ 
     // member is set. It is always done.
-    notifyEvent(event_id::CONSTRUCT);
+    notifyEvent(event_id(event_id::CONSTRUCT));
         
     if (ctor) {
         const int swfversion = getSWFVersion(*mc);
@@ -1791,15 +1791,18 @@ MovieClip::construct(as_object* initObj)
     //
     assert(!_callingFrameActions); // or will not be queuing actions
     if (!parent()) {
+
         executeFrameTags(0, _displayList, SWF::ControlTag::TAG_DLIST |
                 SWF::ControlTag::TAG_ACTION);
+
         if (getSWFVersion(*getObject(this)) > 5) {
-            queueEvent(event_id::LOAD, movie_root::PRIORITY_DOACTION);
+            queueEvent(event_id(event_id::LOAD),
+                    movie_root::PRIORITY_DOACTION);
         }
 
     }
     else {
-        queueEvent(event_id::LOAD, movie_root::PRIORITY_DOACTION);
+        queueEvent(event_id(event_id::LOAD), movie_root::PRIORITY_DOACTION);
         executeFrameTags(0, _displayList, SWF::ControlTag::TAG_DLIST |
                 SWF::ControlTag::TAG_ACTION);
     }
@@ -1846,7 +1849,7 @@ MovieClip::construct(as_object* initObj)
     // Tested in testsuite/swfdec/duplicateMovieclip-events.c and
     // testsuite/swfdec/clone-sprite-events.c not to call notifyEvent
     // immediately.
-    queueEvent(event_id::INITIALIZE, movie_root::PRIORITY_INIT);
+    queueEvent(event_id(event_id::INITIALIZE), movie_root::PRIORITY_INIT);
 
 }
 
@@ -1965,7 +1968,7 @@ 
MovieClip::processCompletedLoadVariableRequest(LoadVariablesThread& request)
     setVariables(vals);
 
     // We want to call a clip-event too if available, see bug #22116
-    notifyEvent(event_id::DATA);
+    notifyEvent(event_id(event_id::DATA));
 }
 
 void
diff --git a/libcore/event_id.h b/libcore/event_id.h
index d1b1190..aeb0d4d 100644
--- a/libcore/event_id.h
+++ b/libcore/event_id.h
@@ -96,7 +96,7 @@ public:
     /// @param id       The type of event
     /// @param c        The key associated with an event (only if this
     ///                 is a keyboard event).
-    event_id(EventCode id, key::code c = key::INVALID)
+    explicit event_id(EventCode id, key::code c = key::INVALID)
         :
         _id(id),
         _keyCode(c)
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 7255ae6..a0531bd 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -529,7 +529,7 @@ movie_root::mouseMoved(boost::int32_t x, boost::int32_t y)
 
     _mouseX = x;
     _mouseY = y;
-    return notify_mouse_listeners(event_id::MOUSE_MOVE);
+    return notify_mouse_listeners(event_id(event_id::MOUSE_MOVE));
 }
 
 
@@ -2401,7 +2401,7 @@ generate_mouse_button_events(movie_root& mr, 
MouseButtonState& ms)
 
                 // onDragOver
                 if (ms.activeEntity) {
-                    ms.activeEntity->mouseEvent(event_id::DRAG_OVER);
+                    ms.activeEntity->mouseEvent(event_id(event_id::DRAG_OVER));
                     need_redisplay=true;
                 }
                 ms.wasInsideActiveEntity = true;
@@ -2410,7 +2410,7 @@ generate_mouse_button_events(movie_root& mr, 
MouseButtonState& ms)
         else if (ms.topmostEntity != ms.activeEntity) {
             // onDragOut
             if (ms.activeEntity) {
-                ms.activeEntity->mouseEvent(event_id::DRAG_OUT);
+                ms.activeEntity->mouseEvent(event_id(event_id::DRAG_OUT));
                 need_redisplay=true;
             }
             ms.wasInsideActiveEntity = false;
@@ -2424,13 +2424,14 @@ generate_mouse_button_events(movie_root& mr, 
MouseButtonState& ms)
             if (ms.activeEntity) {
                 if (ms.wasInsideActiveEntity) {
                     // onRelease
-                    ms.activeEntity->mouseEvent(event_id::RELEASE);
+                    ms.activeEntity->mouseEvent(event_id(event_id::RELEASE));
                     need_redisplay = true;
                 }
                 else {
                     // TODO: Handle trackAsMenu 
                     // onReleaseOutside
-                    ms.activeEntity->mouseEvent(event_id::RELEASE_OUTSIDE);
+                    ms.activeEntity->mouseEvent(
+                            event_id(event_id::RELEASE_OUTSIDE));
                     // We got out of active entity
                     ms.activeEntity = 0; // so we don't get RollOut next...
                     need_redisplay = true;
@@ -2445,7 +2446,7 @@ generate_mouse_button_events(movie_root& mr, 
MouseButtonState& ms)
         if (ms.topmostEntity != ms.activeEntity) {
             // onRollOut
             if (ms.activeEntity) {
-                ms.activeEntity->mouseEvent(event_id::ROLL_OUT);
+                ms.activeEntity->mouseEvent(event_id(event_id::ROLL_OUT));
                 need_redisplay=true;
             }
 
@@ -2453,7 +2454,7 @@ generate_mouse_button_events(movie_root& mr, 
MouseButtonState& ms)
 
             // onRollOver
             if (ms.activeEntity) {
-                ms.activeEntity->mouseEvent(event_id::ROLL_OVER);
+                ms.activeEntity->mouseEvent(event_id(event_id::ROLL_OVER));
                 need_redisplay=true;
             }
 
@@ -2470,8 +2471,8 @@ generate_mouse_button_events(movie_root& mr, 
MouseButtonState& ms)
             if (ms.activeEntity) {
                 mr.setFocus(ms.activeEntity);
 
-                ms.activeEntity->mouseEvent(event_id::PRESS);
-                need_redisplay=true;
+                ms.activeEntity->mouseEvent(event_id(event_id::PRESS));
+                need_redisplay = true;
             }
 
             ms.wasInsideActiveEntity = true;
diff --git a/libcore/swf/PlaceObject2Tag.cpp b/libcore/swf/PlaceObject2Tag.cpp
index a82bf4d..731a3d1 100644
--- a/libcore/swf/PlaceObject2Tag.cpp
+++ b/libcore/swf/PlaceObject2Tag.cpp
@@ -39,6 +39,19 @@
 namespace gnash {
 namespace SWF {
 
+PlaceObject2Tag::PlaceObject2Tag(const movie_definition& def)
+    :
+    DisplayListTag(0),
+    m_has_flags2(0),
+    m_has_flags3(0),
+    _id(0),
+    _ratio(0),
+    m_clip_depth(0),
+    _blendMode(0),
+    _movie_def(def)
+{
+}
+
 void
 PlaceObject2Tag::readPlaceObject(SWFStream& in)
 {
@@ -81,13 +94,12 @@ PlaceObject2Tag::readPlaceObject(SWFStream& in)
 void
 PlaceObject2Tag::readPlaceActions(SWFStream& in)
 {
-    int movie_version = _movie_def.get_version();
+    const int movie_version = _movie_def.get_version();
 
     in.ensureBytes(2);
     boost::uint16_t reserved = in.read_u16();
-    IF_VERBOSE_MALFORMED_SWF (
-        if ( reserved != 0 ) // must be 0
-        {
+    IF_VERBOSE_MALFORMED_SWF(
+        if (reserved != 0) {
             log_swferror(_("Reserved field in PlaceObject actions == "
                     "%u (expected 0)"), reserved);
         }
@@ -96,13 +108,11 @@ PlaceObject2Tag::readPlaceActions(SWFStream& in)
     boost::uint32_t all_event_flags;
 
     // The logical 'or' of all the following handlers.
-    if (movie_version >= 6)
-    {
+    if (movie_version >= 6) {
         in.ensureBytes(4);
         all_event_flags = in.read_u32();
     }
-    else
-    {
+    else {
         in.ensureBytes(2);
         all_event_flags = in.read_u16();        
     }
@@ -112,8 +122,7 @@ PlaceObject2Tag::readPlaceActions(SWFStream& in)
     );
 
     // Read swf_events.
-    for (;;)
-    {
+    for (;;) {
         // Handle SWF malformations locally, by just prematurely interrupting
         // parsing of action events.
         // TODO: a possibly improvement would be using local code for the
@@ -121,32 +130,28 @@ PlaceObject2Tag::readPlaceActions(SWFStream& in)
         //       call for itself plus a repeated useless function call for
         //       get_end_tag_position (which could be cached).
         //       
-        try
-        {
+        try {
             // Read event.
             in.align();
     
             boost::uint32_t flags;
-            if (movie_version >= 6)
-            {
+            if (movie_version >= 6) {
                 in.ensureBytes(4);
                 flags = in.read_u32();
             }
-            else
-            {
+            else {
                 in.ensureBytes(2);
                 flags = in.read_u16();        
             }
     
-            if (flags == 0) // no other events
-            {
+            // no other events
+            if (flags == 0) {
                 break;
             }
     
             in.ensureBytes(4);
             boost::uint32_t event_length = in.read_u32();
-            if ( in.get_tag_end_position() - in.tell() <  event_length )
-            {
+            if (in.get_tag_end_position() - in.tell() <  event_length) {
                 IF_VERBOSE_MALFORMED_SWF(
                 log_swferror(_("swf_event::read(), "
                     "even_length = %u, but only %lu bytes left "
@@ -157,20 +162,20 @@ PlaceObject2Tag::readPlaceActions(SWFStream& in)
                 break;
             }
     
-            boost::uint8_t ch = key::INVALID;
-    
-            if (flags & (1 << 17))  // has KeyPress event
-            {
+            key::code ch = key::INVALID;
+            
+            // has KeyPress event
+            if (flags & (1 << 17)) {
                 in.ensureBytes(1);
-                ch = in.read_u8();
-                event_length--;
+                ch = static_cast<key::code>(in.read_u8());
+                --event_length;
             }
     
             // Read the actions for event(s)
             // auto_ptr here prevents leaks on malformed swf
             std::auto_ptr<action_buffer> action(new action_buffer(_movie_def));
-            action->read(in, in.tell()+event_length);
-            _actionBuffers.push_back(action.release()); // take ownership
+            action->read(in, in.tell() + event_length);
+            _actionBuffers.push_back(action); 
     
             // If there is no end tag, action_buffer appends a null-terminator,
             // and fails this check. As action_buffer should check bounds, we
@@ -178,9 +183,7 @@ PlaceObject2Tag::readPlaceActions(SWFStream& in)
             //assert (action->size() == event_length);
     
             // 13 bits reserved, 19 bits used
-            const int total_known_events = 19;
-            static const event_id s_code_bits[total_known_events] =
-            {
+            static const event_id::EventCode s_code_bits[] = {
                 event_id::LOAD,
                 event_id::ENTER_FRAME,
                 event_id::UNLOAD,
@@ -200,53 +203,48 @@ PlaceObject2Tag::readPlaceActions(SWFStream& in)
                 event_id::DRAG_OVER,
     
                 event_id::DRAG_OUT,
-                event_id(event_id::KEY_PRESS, key::CONTROL),
+                event_id::KEY_PRESS,
                 event_id::CONSTRUCT
             };
+            const size_t total_known_events = arraySize(s_code_bits);
     
             // Let's see if the event flag we received is for an event
             // that we know of.
     
             // Integrity check: all reserved bits should be zero
-            if( flags >> total_known_events ) 
-            {
+            if (flags >> total_known_events) {
                 IF_VERBOSE_MALFORMED_SWF(
-                log_swferror(_("swf_event::read() -- unknown / unhandled "
-                        "event type received, flags = 0x%x"), flags);
+                    log_swferror(_("swf_event::read() -- unknown / unhandled "
+                            "event type received, flags = 0x%x"), flags);
                 );
             }
     
             // Aah! same action for multiple events !
-            for (int i = 0, mask = 1; i < total_known_events; i++, mask <<= 1)
-            {
-                if (flags & mask)
-                {
+            for (size_t i = 0, mask = 1; i < total_known_events; ++i, mask <<= 
1) {
+
+                if (flags & mask) {
                     // Yes, swf_event stores a reference to an element in
                     // _actionBuffers. A case of remote ownership, but both
                     // swf_event and the actions are owned by this class,
                     // so shouldn't be a problem.
-                    action_buffer* thisAction = _actionBuffers.back();
-                    std::auto_ptr<swf_event> ev(
-                            new swf_event(s_code_bits[i], *thisAction));
+                    action_buffer& thisAction = _actionBuffers.back();
+
+                    const event_id id(s_code_bits[i], (i == 17 ? ch : 
key::INVALID));
+
+                    std::auto_ptr<swf_event> ev(new swf_event(id, thisAction));
 
-                    IF_VERBOSE_PARSE (
-                    log_parse("---- actions for event %s", ev->event());
+                    IF_VERBOSE_PARSE(
+                        log_parse("---- actions for event %s", ev->event());
                     );
     
-                    if (i == 17)    // has KeyPress event
-                    {
-                        ev->event().setKeyCode(ch);
-                    }
-    
-                    _eventHandlers.push_back(ev.release());
+                    _eventHandlers.push_back(ev);
                 }
             }
         }
-        catch (ParserException& what)
-        {
+        catch (const ParserException& what) {
             IF_VERBOSE_MALFORMED_SWF(
-            log_swferror(_("Unexpected end of tag while parsing PlaceObject "
-                    "tag events"));
+                log_swferror(_("Unexpected end of tag while parsing "
+                        "PlaceObject tag events"));
             );
             break;
         }
@@ -266,64 +264,57 @@ PlaceObject2Tag::readPlaceObject2(SWFStream& in)
 
     _depth = in.read_u16()+DisplayObject::staticDepthOffset;
 
-    if ( hasCharacter( ))
-    {
+    if (hasCharacter()) {
         in.ensureBytes(2);
         _id = in.read_u16();
     }
 
-    if ( hasMatrix() )
-    {
+    if (hasMatrix()) {
         m_matrix = readSWFMatrix(in);
     }
 
-    if ( hasCxform() )
-    {
+    if (hasCxform()) {
         m_color_transform = readCxFormRGBA(in);
     }
 
-    if ( hasRatio() )
-    {
+    if (hasRatio()) {
         in.ensureBytes(2);
         _ratio = in.read_u16();
     }
 
-    if ( hasName() ) 
-    {
+    if (hasName()) {
         in.read_string(m_name);
     }
 
-    if ( hasClipDepth() )
-    {
+    if (hasClipDepth()) {
         in.ensureBytes(2);
         m_clip_depth = in.read_u16() + DisplayObject::staticDepthOffset;
     }
-    else
-    {
+    else {
         m_clip_depth = DisplayObject::noClipDepthValue;
     }
 
-    if ( hasClipActions() )
-    {
+    if (hasClipActions()) {
         readPlaceActions(in);
     }
 
-    IF_VERBOSE_PARSE (
+    IF_VERBOSE_PARSE(
         log_parse(_("  PLACEOBJECT2: depth = %d (%d)"),
             _depth, _depth-DisplayObject::staticDepthOffset);
-        if ( hasCharacter() ) log_parse(_("  char id = %d"), _id);
-        if ( hasMatrix() )
-        {
+        if (hasCharacter()) log_parse(_("  char id = %d"), _id);
+        if (hasMatrix()) {
             log_parse(_("  SWFMatrix: %s"), m_matrix);
         }
-        if ( hasCxform() )
-        {
+        if (hasCxform()) {
             log_parse(_("  SWFCxForm: %s"), m_color_transform);
         }
-        if ( hasRatio() ) log_parse(_("  ratio: %d"), _ratio);
-        if ( hasName() ) log_parse(_("  name = %s"), m_name.c_str());
-        if ( hasClipDepth() ) log_parse(_("  clip_depth = %d (%d)"), 
m_clip_depth, m_clip_depth-DisplayObject::staticDepthOffset);
-        log_parse(_(" m_place_type: %d"), getPlaceType() );
+        if (hasRatio()) log_parse(_("  ratio: %d"), _ratio);
+        if (hasName()) log_parse(_("  name = %s"), m_name.c_str());
+        if (hasClipDepth()) {
+            log_parse(_("  clip_depth = %d (%d)"), m_clip_depth,
+                m_clip_depth-DisplayObject::staticDepthOffset);
+        }
+        log_parse(_(" m_place_type: %d"), getPlaceType());
     );
 
 }
@@ -415,7 +406,7 @@ PlaceObject2Tag::readPlaceObject3(SWFStream& in)
            LOG_ONCE(log_unimpl("Bitmap caching"));
     }
 
-    if ( hasClipActions() ) {
+    if (hasClipActions()) {
         readPlaceActions(in);
     }
 
@@ -440,9 +431,6 @@ PlaceObject2Tag::readPlaceObject3(SWFStream& in)
 void
 PlaceObject2Tag::read(SWFStream& in, TagType tag)
 {
-
-    m_TagType = tag;
-
     if (tag == SWF::PLACEOBJECT) {
         readPlaceObject(in);
     }
@@ -459,7 +447,6 @@ void
 PlaceObject2Tag::executeState(MovieClip* m, DisplayList& dlist) const
 {
     switch (getPlaceType()) {
-
       case PLACE:
           m->add_display_object(this, dlist);
           break;
@@ -481,8 +468,6 @@ PlaceObject2Tag::executeState(MovieClip* m, DisplayList& 
dlist) const
 
 PlaceObject2Tag::~PlaceObject2Tag()
 {
-    deleteChecked(_eventHandlers.begin(), _eventHandlers.end());
-    deleteChecked(_actionBuffers.begin(), _actionBuffers.end());
 }
 
 void
diff --git a/libcore/swf/PlaceObject2Tag.h b/libcore/swf/PlaceObject2Tag.h
index 10b7317..efdc142 100644
--- a/libcore/swf/PlaceObject2Tag.h
+++ b/libcore/swf/PlaceObject2Tag.h
@@ -18,12 +18,13 @@
 #ifndef GNASH_SWF_PLACEOBJECT2TAG_H
 #define GNASH_SWF_PLACEOBJECT2TAG_H
 
+#include <string>
+#include <boost/ptr_container/ptr_vector.hpp>
+
 #include "DisplayListTag.h" // for inheritance
 #include "SWF.h" // for TagType definition
 #include "SWFMatrix.h" // for composition
 #include "SWFCxForm.h" // for composition 
-#include <string>
-#include <vector>
 
 // Forward declarations
 namespace gnash {
@@ -84,22 +85,10 @@ class PlaceObject2Tag : public DisplayListTag
 {
 public:
 
-    typedef std::vector<action_buffer*> ActionBuffers;
-    typedef std::vector<swf_event*> EventHandlers;
-
-    PlaceObject2Tag(const movie_definition& def)
-        :
-        DisplayListTag(0), // why is it 0 here and -1 for RemoveObjectTag ??
-        m_TagType(0),
-        m_has_flags2(0),
-        m_has_flags3(0),
-        _id(0),
-        _ratio(0),
-        m_clip_depth(0),
-        _blendMode(0),
-        _movie_def(def)
-    {
-    }
+    typedef boost::ptr_vector<action_buffer> ActionBuffers;
+    typedef boost::ptr_vector<swf_event> EventHandlers;
+
+    PlaceObject2Tag(const movie_definition& def);
 
     ~PlaceObject2Tag();
 
@@ -116,12 +105,12 @@ public:
         return m_has_flags2 & (HAS_CHARACTER_MASK | MOVE_MASK);
     } 
 
-    int getRatio()     const { return _ratio; }
+    int getRatio() const { return _ratio; }
     int getClipDepth() const { return m_clip_depth; }
-    boost::uint16_t getID()        const { return _id; }
+    boost::uint16_t getID() const { return _id; }
     const std::string& getName() const { return m_name; }
-    const SWFMatrix& getMatrix()    const { return m_matrix; }
-    const SWFCxForm& getCxform()    const { return m_color_transform; }
+    const SWFMatrix& getMatrix() const { return m_matrix; }
+    const SWFCxForm& getCxform() const { return m_color_transform; }
     const EventHandlers& getEventHandlers() const { return _eventHandlers; }
     
     bool hasClipActions() const { return m_has_flags2 & HAS_CLIP_ACTIONS_MASK; 
}
@@ -132,7 +121,7 @@ public:
     bool hasMatrix()      const { return m_has_flags2 & HAS_MATRIX_MASK; }
     bool hasCharacter()   const { return m_has_flags2 & HAS_CHARACTER_MASK; }
 
-    bool hasImage()         const { return m_has_flags3 & HAS_IMAGE_MASK; }
+    bool hasImage() const { return m_has_flags3 & HAS_IMAGE_MASK; }
 
     bool hasClassName() const {
         return m_has_flags3 & HAS_CLASS_NAME_MASK;
@@ -159,7 +148,19 @@ public:
     }
 
 private:
-    int m_TagType;
+
+    // read SWF::PLACEOBJECT 
+    void readPlaceObject(SWFStream& in);
+
+    // read placeObject2 actions
+    void readPlaceActions(SWFStream& in);
+
+    // read SWF::PLACEOBJECT2 
+    void readPlaceObject2(SWFStream& in);
+
+    // read SWF::PLACEOBJECT3
+    void readPlaceObject3(SWFStream& in);
+
     boost::uint8_t m_has_flags2;
     boost::uint8_t m_has_flags3;
     boost::uint16_t _id;
@@ -206,19 +207,6 @@ private:
     ActionBuffers _actionBuffers;
 
     EventHandlers _eventHandlers;
-
-    // read SWF::PLACEOBJECT 
-    void readPlaceObject(SWFStream& in);
-
-    // read placeObject2 actions
-    void readPlaceActions(SWFStream& in);
-
-    // read SWF::PLACEOBJECT2 
-    void readPlaceObject2(SWFStream& in);
-
-    // read SWF::PLACEOBJECT3
-    void readPlaceObject3(SWFStream& in);
-
 };
 
 } // namespace gnash::SWF
diff --git a/libcore/swf_event.h b/libcore/swf_event.h
index 686ee71..ebbd23b 100644
--- a/libcore/swf_event.h
+++ b/libcore/swf_event.h
@@ -54,20 +54,18 @@ public:
        {
        }
 
-       const action_buffer& action()
-       {
+       const action_buffer& action() const {
                return m_action_buffer;
        }
 
-       event_id& event()
-       {
+       const event_id& event() const {
                return m_event;
        }
 
 private:
 
        /// System event id
-       event_id        m_event;
+       event_id m_event;
 
        /// Action buffer associated with this event
        //

-----------------------------------------------------------------------

Summary of changes:
 libcore/DisplayObject.cpp       |    5 +-
 libcore/MovieClip.cpp           |   31 ++++----
 libcore/event_id.h              |    2 +-
 libcore/movie_root.cpp          |   19 +++--
 libcore/swf/PlaceObject2Tag.cpp |  161 ++++++++++++++++++---------------------
 libcore/swf/PlaceObject2Tag.h   |   62 ++++++---------
 libcore/swf_event.h             |    8 +-
 7 files changed, 132 insertions(+), 156 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]