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...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/generic_character.cpp se...
Date: Tue, 19 Jun 2007 10:00:35 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/06/19 10:00:35

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

Log message:
                * 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&r1=1.3580&r2=1.3581
http://cvs.savannah.gnu.org/viewcvs/gnash/server/generic_character.cpp?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/generic_character.h?cvsroot=gnash&r1=1.24&r2=1.25

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3580
retrieving revision 1.3581
diff -u -b -r1.3580 -r1.3581
--- ChangeLog   19 Jun 2007 09:39:24 -0000      1.3580
+++ ChangeLog   19 Jun 2007 10:00:34 -0000      1.3581
@@ -1,5 +1,12 @@
 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-19 Sandro Santilli <address@hidden>
+
        * server/video_stream_instance.{cpp,h}: implement
          reachable resources marker.
 

Index: server/generic_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/generic_character.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/generic_character.cpp        18 Apr 2007 13:24:44 -0000      1.6
+++ server/generic_character.cpp        19 Jun 2007 10:00:34 -0000      1.7
@@ -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.7 2007/06/19 10:00:34 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.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- server/generic_character.h  16 Jun 2007 06:30:29 -0000      1.24
+++ server/generic_character.h  19 Jun 2007 10:00:35 -0000      1.25
@@ -73,9 +73,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()
@@ -91,7 +95,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]