gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/generic_character.cpp se... [relea


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/generic_character.cpp se... [release-0-8-0]
Date: Tue, 19 Jun 2007 10:16:03 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         release-0-8-0
Changes by:     Sandro Santilli <strk>  07/06/19 10:16:02

Modified files:
        .              : ChangeLog 
        server         : generic_character.cpp generic_character.h 

Log message:
        backported 100% CPU bug fix (final 0.8.0 is now tagged as 
release-0-8-0-final, so we can use release-0-8-0 as the 0.8 branch)
        
                * server/generic_character.{cpp,h}: generic character
                  are not mouse entities by default, so make 
get_topmost_mouse_entity
                  return NULL and can_handle_mouse_events return false. Fixes
                  bug #20102.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.3451.2.55&r2=1.3451.2.56
http://cvs.savannah.gnu.org/viewcvs/gnash/server/generic_character.cpp?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.6&r2=1.6.4.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/generic_character.h?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.23&r2=1.23.4.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3451.2.55
retrieving revision 1.3451.2.56
diff -u -b -r1.3451.2.55 -r1.3451.2.56
--- ChangeLog   9 Jun 2007 12:46:32 -0000       1.3451.2.55
+++ ChangeLog   19 Jun 2007 10:16:00 -0000      1.3451.2.56
@@ -1,3 +1,10 @@
+2007-06-19 Sandro Santilli <address@hidden>
+
+       * server/generic_character.{cpp,h}: generic character
+         are not mouse entities by default, so make get_topmost_mouse_entity
+         return NULL and can_handle_mouse_events return false. Fixes
+         bug #20102.
+
 2007-06-09 Sandro Santilli <address@hidden>
 
        * libbase/embedVideoDecoderFfmpeg.cpp (decodeFrame): do not

Index: server/generic_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/generic_character.cpp,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -u -b -r1.6 -r1.6.4.1
--- server/generic_character.cpp        18 Apr 2007 13:24:44 -0000      1.6
+++ server/generic_character.cpp        19 Jun 2007 10:16:02 -0000      1.6.4.1
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: generic_character.cpp,v 1.6 2007/04/18 13:24:44 strk Exp $ */
+/* $Id: generic_character.cpp,v 1.6.4.1 2007/06/19 10:16:02 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -58,27 +58,6 @@
        return m_def->point_test_local(lp.m_x, lp.m_y);
 }
 
-character*
-generic_character::get_topmost_mouse_entity(float x, float y)
-{
-       assert(get_visible());  // caller should check this.
-
-       // @@ is there any generic_character derivate that
-       //    can actually handle mouse events ?
-       if ( ! can_handle_mouse_event() ) return NULL;
-
-       matrix  m = get_matrix();
-       point   p;
-       m.transform_by_inverse(&p, point(x, y));
-
-       if (m_def->point_test_local(p.m_x, p.m_y))
-       {
-               // The mouse is inside the shape.
-               return this;
-       }
-       return NULL;
-}
-
 } // namespace gnash
 
 // Local Variables:

Index: server/generic_character.h
===================================================================
RCS file: /sources/gnash/gnash/server/generic_character.h,v
retrieving revision 1.23
retrieving revision 1.23.4.1
diff -u -b -r1.23 -r1.23.4.1
--- server/generic_character.h  28 May 2007 15:41:06 -0000      1.23
+++ server/generic_character.h  19 Jun 2007 10:16:02 -0000      1.23.4.1
@@ -58,9 +58,13 @@
            assert(m_def);
        }
 
+       /// generic characters can not handle mouse events, so
+       /// the default implementation returns false.
+       /// override in your subclass to change this
        virtual bool can_handle_mouse_event() const {
-               assert(m_parent != NULL);
-               return m_parent->can_handle_mouse_event();
+               return false;
+               //assert(m_parent != NULL);
+               //return m_parent->can_handle_mouse_event();
        }
 
        virtual void    display()
@@ -76,7 +80,17 @@
                return m_def->get_bound().getRange();
        }
 
-       virtual character* get_topmost_mouse_entity(float x, float y);
+       /// Generic character 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 character to contain a 
+       /// given point, use the pointInShape() function instead.
+       /// 
+       virtual character* get_topmost_mouse_entity(float /*x*/, float /*y*/)
+       {
+               return NULL;
+       }
 
        // See dox in character.h
        virtual bool pointInShape(float x, float y) const;




reply via email to

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