gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r10764: Remove some unnecessary memb


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10764: Remove some unnecessary members from the DisplayObject base class.
Date: Fri, 03 Apr 2009 20:09:55 +0200
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10764
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Fri 2009-04-03 20:09:55 +0200
message:
  Remove some unnecessary members from the DisplayObject base class.
  
  Add class descriptions.
  
  Drop dynClipDepthValue constant as suggested.
modified:
  libcore/DisplayObject.cpp
  libcore/DisplayObject.h
  libcore/InteractiveDisplayObject.h
  libcore/cxform.h
  libcore/movie_root.cpp
  testsuite/DummyCharacter.h
    ------------------------------------------------------------
    revno: 10762.1.14
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Fri 2009-04-03 16:35:56 +0200
    message:
      Update class descriptions.
    modified:
      libcore/DisplayObject.h
      libcore/InteractiveDisplayObject.h
    ------------------------------------------------------------
    revno: 10762.1.15
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Fri 2009-04-03 16:54:49 +0200
    message:
      Update documentation. Remove goto_frame from DisplayObject (only makes 
sense
      for Sprite or MovieClip). Add virtual dtor to DisplayObject.
    modified:
      libcore/DisplayObject.h
      libcore/InteractiveDisplayObject.h
    ------------------------------------------------------------
    revno: 10762.1.16
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Fri 2009-04-03 17:05:07 +0200
    message:
      Minor tidying up; add operator!= to cxform for nicer syntax.
    modified:
      libcore/DisplayObject.h
      libcore/cxform.h
    ------------------------------------------------------------
    revno: 10762.1.17
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Fri 2009-04-03 17:11:14 +0200
    message:
      Indentation.
    modified:
      libcore/DisplayObject.h
    ------------------------------------------------------------
    revno: 10762.1.18
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Fri 2009-04-03 17:20:47 +0200
    message:
      Indentation.
    modified:
      libcore/DisplayObject.h
      libcore/movie_root.cpp
    ------------------------------------------------------------
    revno: 10762.1.19
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Fri 2009-04-03 17:25:52 +0200
    message:
      Drop get_movie_definition() from the base class.
    modified:
      libcore/DisplayObject.h
    ------------------------------------------------------------
    revno: 10762.1.20
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Fri 2009-04-03 17:34:59 +0200
    message:
      Fix testsuite build.
    modified:
      testsuite/DummyCharacter.h
    ------------------------------------------------------------
    revno: 10762.1.21
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Fri 2009-04-03 18:09:32 +0200
    message:
      Drop dynClipDepthValue in favour of using _maskee as suggested in 
comments.
      This is good because both "reserved" depth values are in fact legal, 
though
      unlikely depths for createEmptyMovieClip().
    modified:
      libcore/DisplayObject.cpp
      libcore/DisplayObject.h
    ------------------------------------------------------------
    revno: 10762.1.22
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Fri 2009-04-03 18:11:36 +0200
    message:
      Drop obsoleted comment.
    modified:
      libcore/DisplayObject.h
    ------------------------------------------------------------
    revno: 10762.1.23
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Fri 2009-04-03 19:25:34 +0200
    message:
      Formatting.
    modified:
      libcore/DisplayObject.cpp
=== modified file 'libcore/DisplayObject.cpp'
--- a/libcore/DisplayObject.cpp 2009-04-03 11:03:31 +0000
+++ b/libcore/DisplayObject.cpp 2009-04-03 17:25:34 +0000
@@ -64,7 +64,6 @@
 const int DisplayObject::staticDepthOffset;
 const int DisplayObject::removedDepthOffset;
 const int DisplayObject::noClipDepthValue;
-const int DisplayObject::dynClipDepthValue;
 
 // Initialize unnamed instance count
 unsigned int DisplayObject::_lastUnnamedInstanceNum = 0;
@@ -1443,11 +1442,7 @@
 
        _maskee = maskee;
 
-       if ( maskee )
-       {
-               set_clip_depth(dynClipDepthValue);
-       }
-       else
+       if (!maskee)
        {
                // TODO: should we reset any original clip depth
                //       specified by PlaceObject tag ?
@@ -1487,10 +1482,10 @@
     }      
 
     /// Don't add if it's not a real clipping depth
-    if (int cd = get_clip_depth() != noClipDepthValue )
+    if (int cd = get_clip_depth() != noClipDepthValue)
     {
                os.str("");
-               if (cd == dynClipDepthValue) os << "Dynamic mask";
+               if (_maskee) os << "Dynamic mask";
                else os << cd;
 
                tr.append_child(it, StringPair(_("Clipping depth"), os.str())); 
    

=== modified file 'libcore/DisplayObject.h'
--- a/libcore/DisplayObject.h   2009-04-03 12:16:58 +0000
+++ b/libcore/DisplayObject.h   2009-04-03 16:11:36 +0000
@@ -59,9 +59,13 @@
 
 namespace gnash {
 
-/// Character is a live, stateful instance of a character_def.
-//
-/// It represents a single active element in a movie.
+/// DisplayObject is the base class for all DisplayList objects.
+//
+/// It represents a single active element in a movie. This class does not
+/// provide any interactivity.
+//
+/// Derived classes include InteractiveDisplayObject, StaticText, Bitmap,
+/// Video, and Shape.
 class DisplayObject : public as_object
 {
 
@@ -69,6 +73,8 @@
 
     DisplayObject(DisplayObject* parent, int id);
 
+    virtual ~DisplayObject() {}
+
     /// The lowest placeable and accessible depth for a DisplayObject.
     /// Macromedia Flash help says: depth starts at -16383 (0x3FFF)
     ///
@@ -80,15 +86,14 @@
     /// which can be placed at any depth within +/- 2**31.
     static const int lowerAccessibleBound = -16384;
     
-    
     /// This is the maximum depth a MovieClip DisplayObject can be placed
     /// at (attachMovie). Kirupa (see above) says 2130690045, but this
     /// seems not to be included in the range.
     static const int upperAccessibleBound = 2130690044;
 
     /// This is the amount added to displaylist tag defined depths.
-    /// Character placed by tags (vs. DisplayObjects instantiated by 
ActionScript)
-    /// always have negative depths by effect of this offset.
+    /// DisplayObjects placed by tags (vs. DisplayObjects instantiated by
+    /// ActionScript) always have negative depths by effect of this offset.
     static const int staticDepthOffset = lowerAccessibleBound;
 
     /// This is the offset at which DisplayObject's depth is
@@ -106,8 +111,6 @@
     ///   3:  Max depth for a PlaceoObject call is 16384 (which becomes 
     ///       0 in the statics)
     /// (all of the above correct?)
-    ///
-    ///
     static const int removedDepthOffset = -32769; 
 
     /// Return true if the given depth is in the removed zone
@@ -130,14 +133,6 @@
     ///
     static const int noClipDepthValue = -1000000;
 
-    /// This value is used for m_clip_depth when 
-    /// the DisplayObject is a dynamic mask.
-    //
-    /// Depths below -16384 are illegal, so this
-    /// value should not collide with real depths.  
-    ///
-    static const int dynClipDepthValue = -2000000;
-
     /// Return a reference to the variable scope of this DisplayObject.
     //
     /// TODO: make const/return const& ?
@@ -253,7 +248,7 @@
 
     void  set_cxform(const cxform& cx) 
     {       
-        if (!(cx == m_color_transform)) {
+        if (cx != m_color_transform) {
             set_invalidated(__FILE__, __LINE__);
             m_color_transform = cx;
         }
@@ -269,13 +264,14 @@
 
     void set_ratio(int r)
     {
-      if (r!=m_ratio) set_invalidated(__FILE__, __LINE__); 
-      m_ratio = r;       
+        if (r != m_ratio) set_invalidated(__FILE__, __LINE__); 
+        m_ratio = r;       
     }
 
-    /// Returns the clipping depth (if any) of this DisplayObject. The 
parameter is 
-    /// tells us to use the DisplayObject as a mask for all the objects 
contained 
-    /// in the display list from m_depth to m_clipping_depth inclusive.
+    /// Returns the clipping depth (if any) of this DisplayObject.
+    /// The parameter tells us to use the DisplayObject as a mask for
+    /// all the objects contained in the display list from m_depth
+    /// to m_clipping_depth inclusive.
     /// 
     /// The value returned by get_clip_depth() is only valid when isMaskLayer()
     /// returns true!
@@ -297,10 +293,7 @@
     ///     
     bool isMaskLayer() const
     {
-        // TODO: is dynClipDepthValue still needed ?
-        //       since we have a _maskee member now, we may use that instead..
-        return (m_clip_depth != noClipDepthValue && 
-                m_clip_depth != dynClipDepthValue);
+        return (m_clip_depth != noClipDepthValue && !_maskee);
     }
 
     /// Returns true when the DisplayObject (and it's childs) is used as a mask
@@ -314,7 +307,7 @@
     ///     
     bool isDynamicMask() const
     {
-        return (m_clip_depth==dynClipDepthValue);
+        return _maskee;
     }
 
     DisplayObject* toDisplayObject() { return this; }
@@ -341,7 +334,8 @@
     ///
     void setMask(DisplayObject* mask);
 
-    /// Returns true if this DisplayObject is a mask (either layer or dynamic 
mask)
+    /// Returns true if this DisplayObject is a mask (either layer or
+    /// dynamic mask)
     bool isMask() const
     {
         return isDynamicMask() || isMaskLayer();
@@ -355,14 +349,6 @@
 
     const std::string& get_name() const { return _name; }
 
-    /// Return true if this DisplayObject can handle mouse events.
-    //
-    /// The default implementation returns false.
-    ///
-    virtual bool can_handle_mouse_event() const {
-        return false;
-    }
-
     /// \brief
     /// Get our concatenated SWFMatrix (all our ancestor transforms,
     /// times our SWFMatrix). 
@@ -380,15 +366,15 @@
     /// times our cxform). 
     ///
     /// Maps from our local space into normal color space.
-    virtual cxform    get_world_cxform() const;
+    virtual cxform get_world_cxform() const;
 
     /// Get the built-in function handlers code for the given event
     //
     /// NOTE: this function is only for getting statically-defined
-    ///             event handlers, which are the ones attached to a 
DisplayObject
-    ///             with a PlaceObject2. It's the DisplayObject's 
responsibility
-    ///             to properly fetch any user-defined event handler, which 
-    ///             are the ones attached to a DisplayObject with ActionScript 
code.
+    ///       event handlers, which are the ones attached to a DisplayObject
+    ///       with a PlaceObject2. It's the DisplayObject's responsibility
+    ///       to properly fetch any user-defined event handler, which 
+    ///       are the ones attached to a DisplayObject with ActionScript code.
     ///
     std::auto_ptr<ExecutableCode> get_event_handler(const event_id& id) const;
 
@@ -398,10 +384,10 @@
     /// handlers if this is the case.
     ///
     /// NOTE: this function is only for registering statically-defined
-    ///             event handlers, which are the ones attached to a 
DisplayObject
-    ///             with a PlaceObject2. It's the DisplayObject's 
responsibility
-    ///             to properly invoke any user-defined event handler, which 
-    ///             are the ones attached to a DisplayObject with ActionScript 
code.
+    ///       event handlers, which are the ones attached to a DisplayObject
+    ///       with a PlaceObject2. It's the DisplayObject's responsibility
+    ///       to properly invoke any user-defined event handler, which 
+    ///       are the ones attached to a DisplayObject with ActionScript code.
     ///
     /// @param id
     /// The event triggering the handler.
@@ -549,9 +535,6 @@
         // GNASH_REPORT_FUNCTION 
     }
 
-    // TODO: verify if this is really needed (I guess not)
-    virtual void    goto_frame(size_t /*target_frame*/) {}
-
     /// \brief
     /// Return true if PlaceObjects tag are allowed to move
     /// this DisplayObject.
@@ -614,28 +597,6 @@
     // Return true if this DisplayObject should be rendered
     bool isVisible() const { return _visible; }
 
-    /// Return mouse state in given variables
-    //
-    /// Use this to retrieve the last state of the mouse, as set via
-    /// notify_mouse_state().    Coordinates are in PIXELS, NOT TWIPS.
-    ///
-    /// The default implementation calls get_mouse_state against
-    /// the DisplayObject's parent. The final parent (a MovieClip)
-    /// will delegate the call to it's associated movie_root, which
-    /// does all the work.
-    ///
-    //virtual void get_mouse_state(int& x, int& y, int& buttons);
-
-    /// These have been moved down from movie.h to remove that file
-    /// from the inheritance chain. It is probably still a misdesign
-    /// to require these functions for all DisplayObjects.
-    /// @{
-
-    virtual movie_definition *get_movie_definition()
-    {
-        return NULL;
-    }
-
     /// ActionScript event handler.    Returns true if a handler was called.
     //
     /// Must be overridden or will always return false.
@@ -662,18 +623,13 @@
     ///
     bool hasEventHandler(const event_id& id) const;
 
-       /// DisplayObject is NEVER a mouse entity by default, so
-       /// the default implementation of this method always returns NULL.
-       /// Override it from subclasses that do can be mouse entities.
-       ///
-       /// If you need to check for a generic DisplayObject to contain a 
-       /// given point, use the pointInShape() function instead.
-       /// 
+       /// DisplayObjects are not a mouse entity by default.
+    //
+    /// Override this function for InteractiveDisplayObjects.
        virtual InteractiveDisplayObject* topmostMouseEntity(boost::int32_t, 
-            boost::int32_t)
-       {
-               return 0;
-       }
+            boost::int32_t) {
+        return 0;
+    }
        
     /// Find highest depth DisplayObject whose shape contains the given
     /// point and is not the DisplayObject being dragged or any of its childs.
@@ -893,18 +849,18 @@
             const std::string& name) const;
 #endif
 
-  /// Return true if this DisplayObject is a selectable TextField
-  //
-  /// This method is used by Gui to set up an appropriate cursor
-  /// for input textfields.
-  ///
-  virtual bool isSelectableTextField() const { return false; }
+    /// Return true if this DisplayObject is a selectable TextField
+    //
+    /// This method is used by Gui to set up an appropriate cursor
+    /// for input textfields.
+    ///
+    virtual bool isSelectableTextField() const { return false; }
 
-  /// \brief
-  /// Return true if this DisplayObject allows turning the cursor
-  /// into an hand shape when it happens to be the one receiving
-  /// mouse events.
-  virtual bool allowHandCursor() const { return true; }
+    /// \brief
+    /// Return true if this DisplayObject allows turning the cursor
+    /// into an hand shape when it happens to be the one receiving
+    /// mouse events.
+    virtual bool allowHandCursor() const { return true; }
 
 #ifdef USE_SWFTREE
     typedef std::pair<std::string, std::string> StringPair; 
@@ -955,76 +911,76 @@
     typedef std::vector<const action_buffer*> BufferList;
     typedef std::map<event_id, BufferList> Events;
 
-  /// Set the current focus to this DisplayObject.
-  //
-  /// @return false if the DisplayObject cannot receive focus, true if it can
-  ///         (and does).
-  //
-  /// Button, Textfield and MovieClip can receive focus. In SWF6 and above,
-  /// MovieClip can only receive focus if the focusEnabled property
-  /// evaluates to true.
-  virtual bool handleFocus() { 
-      return false;
-  }
-
-  /// Some DisplayObjects require actions on losing focus.
-  //
-  /// Default is a no-op. TextField implements this function.
-  virtual void killFocus() {}
-
-  /// Getter-setter for _highquality.
-  static as_value highquality(const fn_call& fn);
-
-  /// Getter-setter for _quality.
-  static as_value quality(const fn_call& fn);
-
-  /// Getter-setter for blendMode.
-  static as_value blendMode(const fn_call& fn);
-
-  /// Getter-setter for _x
-  static as_value x_getset(const fn_call& fn);
-
-  /// Getter-setter for _y
-  static as_value y_getset(const fn_call& fn);
-
-  /// Getter-setter for _xscale
-  static as_value xscale_getset(const fn_call& fn);
-
-  /// Getter-setter for _yscale
-  static as_value yscale_getset(const fn_call& fn);
-
-  /// Getter-setter for _xmouse
-  static as_value xmouse_get(const fn_call& fn);
-
-  /// Getter-setter for _ymouse
-  static as_value ymouse_get(const fn_call& fn);
-
-  /// Getter-setter for _alpha
-  static as_value alpha_getset(const fn_call& fn);
-
-  /// Getter-setter for _visible
-  static as_value visible_getset(const fn_call& fn);
-
-  /// Getter-setter for _width
-  static as_value width_getset(const fn_call& fn);
-
-  /// Getter-setter for _height
-  static as_value height_getset(const fn_call& fn);
-
-  /// Getter-setter for _rotation
-  static as_value rotation_getset(const fn_call& fn);
-
-  /// Getter-setter for _parent 
-  static as_value parent_getset(const fn_call& fn);
-
-  /// Getter-setter for _target 
-  static as_value target_getset(const fn_call& fn);
-
-  /// Getter-setter for _name
-  static as_value name_getset(const fn_call& fn);
-
-  /// @} Common ActionScript getter-setters for DisplayObjects
-
+    /// Set the current focus to this DisplayObject.
+    //
+    /// @return false if the DisplayObject cannot receive focus, true if it can
+    ///         (and does).
+    //
+    /// Button, Textfield and MovieClip can receive focus. In SWF6 and above,
+    /// MovieClip can only receive focus if the focusEnabled property
+    /// evaluates to true.
+    virtual bool handleFocus() { 
+        return false;
+    }
+
+    /// Some DisplayObjects require actions on losing focus.
+    //
+    /// Default is a no-op. TextField implements this function.
+    virtual void killFocus() {}
+  
+    /// Getter-setter for _highquality.
+    static as_value highquality(const fn_call& fn);
+  
+    /// Getter-setter for _quality.
+    static as_value quality(const fn_call& fn);
+  
+    /// Getter-setter for blendMode.
+    static as_value blendMode(const fn_call& fn);
+  
+    /// Getter-setter for _x
+    static as_value x_getset(const fn_call& fn);
+  
+    /// Getter-setter for _y
+    static as_value y_getset(const fn_call& fn);
+  
+    /// Getter-setter for _xscale
+    static as_value xscale_getset(const fn_call& fn);
+  
+    /// Getter-setter for _yscale
+    static as_value yscale_getset(const fn_call& fn);
+  
+    /// Getter-setter for _xmouse
+    static as_value xmouse_get(const fn_call& fn);
+  
+    /// Getter-setter for _ymouse
+    static as_value ymouse_get(const fn_call& fn);
+  
+    /// Getter-setter for _alpha
+    static as_value alpha_getset(const fn_call& fn);
+  
+    /// Getter-setter for _visible
+    static as_value visible_getset(const fn_call& fn);
+  
+    /// Getter-setter for _width
+    static as_value width_getset(const fn_call& fn);
+  
+    /// Getter-setter for _height
+    static as_value height_getset(const fn_call& fn);
+  
+    /// Getter-setter for _rotation
+    static as_value rotation_getset(const fn_call& fn);
+  
+    /// Getter-setter for _parent 
+    static as_value parent_getset(const fn_call& fn);
+  
+    /// Getter-setter for _target 
+    static as_value target_getset(const fn_call& fn);
+  
+    /// Getter-setter for _name
+    static as_value name_getset(const fn_call& fn);
+  
+    /// @} Common ActionScript getter-setters for DisplayObjects
+  
 protected:
 
     /// Register currently computable target as

=== modified file 'libcore/InteractiveDisplayObject.h'
--- a/libcore/InteractiveDisplayObject.h        2009-04-03 12:16:58 +0000
+++ b/libcore/InteractiveDisplayObject.h        2009-04-03 14:54:49 +0000
@@ -34,9 +34,12 @@
 
 namespace gnash {
 
-/// The base class for all rendered objects on the Stage.
-//
-/// Objects of type DisplayObject are non-interactive.
+/// The base class for interactive objects.
+//
+/// Objects of type InteractiveDisplayObject can receive focus, mouse events,
+/// and key events for user interaction.
+//
+/// Derived classes include TextField, Button, and MovieClip.
 class InteractiveDisplayObject : public DisplayObject
 {
 
@@ -50,17 +53,14 @@
 
     virtual ~InteractiveDisplayObject() {}
 
-    /// Render this DisplayObject
-    virtual void display() {}
+    /// Render this InteractiveDisplayObject
+    virtual void display() = 0;
 
     /// Whether the DisplayObject can handle a mouse event.
     //
-    /// Normal DisplayObjects apparently cannot handle
-    /// mouse events.
     /// @return     true if the DisplayObject can handle mouse
     ///             events
-       virtual bool can_handle_mouse_event() const
-    {
+       virtual bool can_handle_mouse_event() const {
                return false;
        }
 
@@ -69,25 +69,16 @@
     /// Default returns 0, implemented only for DefineText though
     /// DisplayObject.
     virtual StaticText* getStaticText(std::vector<const SWF::TextRecord*>&,
-            size_t&)
-    {
+            size_t&) {
         return 0;
     }
 
     /// Returns local, untransformed bounds of this DisplayObject in TWIPS
     //
-    /// The default implementation prints an error and returns a NULL rect.
-    ///
     /// Container DisplayObjects (sprite and buttons) return the composite
-    /// bounds of all their childrens, appropriaterly transformed with
+    /// bounds of all their children, appropriately transformed with
     /// their local SWFMatrix.
-    ///
-    virtual rect getBounds() const
-    {
-        log_error("FIXME: InteractiveDisplayObject %s did not override the "
-                "getBounds() method", typeName(*this));
-        return rect();
-    }
+    virtual rect getBounds() const = 0;
 
     /// \brief
     /// Return the topmost entity covering the given point
@@ -134,8 +125,7 @@
         log_error("Character %s did not override pointInShape() - "
                 "using pointInBounds() instead", typeid(*this).name());
         return pointInBounds(x, y);
-    }  // See dox in DisplayObject.h
-
+    }
 
        void add_invalidated_bounds(InvalidatedRanges& ranges, bool force) = 0;
 

=== modified file 'libcore/cxform.h'
--- a/libcore/cxform.h  2009-02-25 22:33:03 +0000
+++ b/libcore/cxform.h  2009-04-03 15:05:07 +0000
@@ -102,6 +102,7 @@
     void read_rgba(SWFStream& in);
 
     friend bool operator== (const cxform&, const cxform&);
+    friend bool operator!= (const cxform&, const cxform&);
        
     friend std::ostream& operator<< (std::ostream& os, const cxform& cx);
 
@@ -110,17 +111,23 @@
 };
 
 
-inline bool operator== (const cxform& a, const cxform& b)
-{
-       return  
-               a.ra == b.ra &&
-               a.rb == b.rb &&
-               a.ga == b.ga &&
-               a.gb == b.gb &&
-               a.ba == b.ba &&
-               a.bb == b.bb &&
-               a.aa == b.aa &&
-               a.ab == b.ab;
+inline bool
+operator== (const cxform& a, const cxform& b)
+{
+       return  a.ra == b.ra &&
+            a.rb == b.rb &&
+            a.ga == b.ga &&
+            a.gb == b.gb &&
+            a.ba == b.ba &&
+            a.bb == b.bb &&
+            a.aa == b.aa &&
+            a.ab == b.ab;
+}
+
+inline bool
+operator!=(const cxform& a, const cxform& b)
+{
+    return !(a == b);
 }
 
 }      // namespace gnash

=== modified file 'libcore/movie_root.cpp'
--- a/libcore/movie_root.cpp    2009-04-03 12:16:58 +0000
+++ b/libcore/movie_root.cpp    2009-04-03 15:20:47 +0000
@@ -429,8 +429,7 @@
             create_library_movie(url, _runInfo));
        if (!md)
        {
-               log_error(_("can't create movie_definition for %s"),
-                       url.str());
+               log_error(_("can't create movie_definition for %s"), url.str());
                return false;
        }
 
@@ -438,8 +437,8 @@
        extern_movie = md->create_movie_instance();
        if (extern_movie == NULL)
        {
-               log_error(_("can't create extern movie_instance "
-                       "for %s"), url.str());
+               log_error(_("can't create extern movie_instance for %s"),
+                url.str());
                return false;
        }
 
@@ -565,7 +564,7 @@
 
     m_mouse_x = x;
     m_mouse_y = y;
-    notify_mouse_listeners(event_id(event_id::MOUSE_MOVE));
+    notify_mouse_listeners(event_id::MOUSE_MOVE);
     return fire_mouse_event();
 
 }
@@ -586,11 +585,9 @@
                as_value kval;
                as_object* global = _vm.getGlobal();
 
-               if (global->get_member(NSV::CLASS_KEY, &kval) )
-               {
-                       //log_debug("Found member 'Key' in _global: %s", 
kval.to_string());
+               if (global->get_member(NSV::CLASS_KEY, &kval)) {
+
                        boost::intrusive_ptr<as_object> obj = kval.to_object();
-                       //log_debug("_global.Key to_object() : %s @ %p", 
typeid(*obj).name(), obj);
                        _keyobject = boost::dynamic_pointer_cast<Key_as>( obj );
                }
        }
@@ -619,7 +616,7 @@
 }
 
 
-Key_as *
+Key_as*
 movie_root::notify_global_key(key::code k, bool down)
 {
     // NOTE: we don't check SWF version here
@@ -707,21 +704,6 @@
        return fire_mouse_event();
 }
 
-#if 0
-void
-movie_root::notify_mouse_state(int x, int y, int buttons)
-{
-       assert(testInvariant());
-
-    m_mouse_x = x;
-    m_mouse_y = y;
-    m_mouse_buttons = buttons;
-    fire_mouse_event();
-
-       assert(testInvariant());
-}
-#endif
-
 // Return whether any action triggered by this event requires display redraw.
 // See page about events_handling (in movie_interface.h)
 //
@@ -857,16 +839,16 @@
     if ( draggingChar ) dragging = draggingChar->to_movie();
     if ( dragging )
     {
-       // TODO: optimize making findDropTarget and getTopmostMouseEntity
-       //       use a single scan.
+        // TODO: optimize making findDropTarget and getTopmostMouseEntity
+        //       use a single scan.
         const DisplayObject* dropChar = findDropTarget(x, y, dragging);
         if ( dropChar )
         {
             // Use target of closest script DisplayObject containing this
-           dropChar = dropChar->getClosestASReferenceableAncestor();
+            dropChar = dropChar->getClosestASReferenceableAncestor();
             dragging->setDropTarget(dropChar->getTargetPath());
         }
-       else dragging->setDropTarget("");
+        else dragging->setDropTarget("");
 
     }
 

=== modified file 'testsuite/DummyCharacter.h'
--- a/testsuite/DummyCharacter.h        2009-04-03 11:59:41 +0000
+++ b/testsuite/DummyCharacter.h        2009-04-03 15:34:59 +0000
@@ -51,6 +51,10 @@
        {
        }
 
+    virtual void display() {}
+
+    virtual rect getBounds() const { return rect(); }
+
     InteractiveDisplayObject* topmostMouseEntity(boost::int32_t, 
boost::int32_t)
     {
         return 0;


reply via email to

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