gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/Makefile.am server/gener...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/Makefile.am server/gener...
Date: Tue, 24 Oct 2006 10:14:35 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/10/24 10:14:35

Modified files:
        .              : ChangeLog 
        server         : Makefile.am generic_character.h 
Added files:
        server         : generic_character.cpp 

Log message:
                * server/: Makefile.am, generic_character.cpp, 
generic_character.h:
                  added a new implementation file for generic_character, fixed
                  can_handle_mouse_events to delegate to parent,                
                  had get_topmost_mouse_entity check for can_handle_mouse_events
                  to completely skip hit test if that returns false (fixes 
#17935)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1376&r2=1.1377
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Makefile.am?cvsroot=gnash&r1=1.75&r2=1.76
http://cvs.savannah.gnu.org/viewcvs/gnash/server/generic_character.h?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/server/generic_character.cpp?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1376
retrieving revision 1.1377
diff -u -b -r1.1376 -r1.1377
--- ChangeLog   24 Oct 2006 09:36:05 -0000      1.1376
+++ ChangeLog   24 Oct 2006 10:14:35 -0000      1.1377
@@ -1,5 +1,10 @@
 2006-10-24 Sandro Santilli <address@hidden>
 
+       * server/: Makefile.am, generic_character.cpp, generic_character.h:
+         added a new implementation file for generic_character, fixed
+         can_handle_mouse_events to delegate to parent,
+         had get_topmost_mouse_entity check for can_handle_mouse_events
+         to completely skip hit test if that returns false (fixes #17935)
        * server/movie_root.{h,cpp}: moved isMouseOverActiveEntity() from
          header to implementation file.
        * server/smart_ptr.h: made conversion from weak_ptr to smart_ptr

Index: server/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/Makefile.am,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -b -r1.75 -r1.76
--- server/Makefile.am  17 Oct 2006 15:32:48 -0000      1.75
+++ server/Makefile.am  24 Oct 2006 10:14:35 -0000      1.76
@@ -36,7 +36,7 @@
 # 
 #
 
-# $Id: Makefile.am,v 1.75 2006/10/17 15:32:48 strk Exp $
+# $Id: Makefile.am,v 1.76 2006/10/24 10:14:35 strk Exp $
 
 AUTOMAKE_OPTIONS = 
 
@@ -77,6 +77,7 @@
        as_function.cpp         \
        swf_function.cpp        \
        character.cpp \
+       generic_character.cpp \
         textformat.cpp \
         timers.cpp \
         xml.cpp \

Index: server/generic_character.h
===================================================================
RCS file: /sources/gnash/gnash/server/generic_character.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- server/generic_character.h  18 Oct 2006 18:16:01 -0000      1.12
+++ server/generic_character.h  24 Oct 2006 10:14:35 -0000      1.13
@@ -55,6 +55,9 @@
 class character_def;
 
 /// For characters that don't store unusual state in their instances.
+//
+/// @@AFAICT this is only used for shape characters
+///
 class generic_character : public character
 {
 
@@ -72,12 +75,14 @@
            assert(m_def);
        }
 
-       virtual bool can_handle_mouse_event()   { return false; }
+       virtual bool can_handle_mouse_event()   {
+               assert(m_parent);
+               return m_parent->can_handle_mouse_event();
+       }
 
     virtual void       display()
        {
 //                     GNASH_REPORT_FUNCTION;
-               
            m_def->display(this);       // pass in transform info
            clear_invalidated();
            do_display_callback();
@@ -99,39 +104,16 @@
                return m_def->get_width_local();
        }
 
-    // new, from Vitaly.
-    virtual movie*     get_topmost_mouse_entity(float x, float y)
-       {
-           assert(get_visible());      // caller should check this.
-
-           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;
-       }
+       virtual movie* get_topmost_mouse_entity(float x, float y);
 
+       /// \brief
        /// Return the character definition from which this
        /// instance derive. 
     character_def* get_character_def() { return m_def; }
     
+       void enclose_own_bounds(rect *) const;
   
-  void enclose_own_bounds(rect *) const {
-    assert(0); // TO BE IMPLEMENTED!!!!!
-  }
-    
-       void get_invalidated_bounds(rect* bounds, bool force) {
-         bounds->expand_to_rect(m_old_invalidated_bounds);
-    if (m_visible && (m_invalidated||force)) {
-      bounds->expand_to_transformed_rect(get_world_matrix(), 
-        m_def->get_bound());            
-    }    
-  }
+       void get_invalidated_bounds(rect* bounds, bool force);
     
 
 };

Index: server/generic_character.cpp
===================================================================
RCS file: server/generic_character.cpp
diff -N server/generic_character.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ server/generic_character.cpp        24 Oct 2006 10:14:35 -0000      1.1
@@ -0,0 +1,94 @@
+// 
+//   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+// Linking Gnash statically or dynamically with other modules is making a
+// combined work based on Gnash. Thus, the terms and conditions of the GNU
+// General Public License cover the whole combination.
+//
+// As a special exception, the copyright holders of Gnash give you
+// permission to combine Gnash with free software programs or libraries
+// that are released under the GNU LGPL and with code included in any
+// release of Talkback distributed by the Mozilla Foundation. You may
+// copy and distribute such a system following the terms of the GNU GPL
+// for all but the LGPL-covered parts and Talkback, and following the
+// LGPL for the LGPL-covered parts.
+//
+// Note that people who make modified versions of Gnash are not obligated
+// to grant this special exception for their modified versions; it is their
+// choice whether to do so. The GNU General Public License gives permission
+// to release a modified version without this exception; this exception
+// also makes it possible to release a modified version which carries
+// forward this exception.
+// 
+//
+//
+
+/* $Id: generic_character.cpp,v 1.1 2006/10/24 10:14:35 strk Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "generic_character.h"
+
+namespace gnash
+{
+
+void
+generic_character::get_invalidated_bounds(rect* bounds, bool force)
+{
+       bounds->expand_to_rect(m_old_invalidated_bounds);
+       if (m_visible && (m_invalidated||force))
+       {
+               bounds->expand_to_transformed_rect(get_world_matrix(), 
+                       m_def->get_bound());            
+       }    
+}
+
+void
+generic_character::enclose_own_bounds(rect *) const
+{
+       log_error("generic_character::enclose_own_bounds unimplemented");
+       assert(0); // TO BE IMPLEMENTED!!!!!
+}
+
+movie*
+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:
+// mode: C++
+// indent-tabs-mode: t
+// End:




reply via email to

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