gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog gui/gui.cpp server/character.h ...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog gui/gui.cpp server/character.h ...
Date: Sun, 27 Apr 2008 15:39:40 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/04/27 15:39:40

Modified files:
        .              : ChangeLog 
        gui            : gui.cpp 
        server         : character.h namedStrings.cpp namedStrings.h 
                         sprite_instance.cpp sprite_instance.h 
        testsuite/actionscript.all: MovieClip.as 

Log message:
        * server/namedStrings.{cpp,h}: add PROP_USEHANDCURSOR named string.
        * server/character.h: add virtual allowHandCursor() method.
        * gui/gui.cpp (notify_mouse_moved): check if active entity under
          pointer wants to use an hand cursor or not. (getMovieInfo):
          cleanup output, add useHandCursor info for active entity.
        * server/sprite_instance.{cpp,h}: implement allowHandCursor()
          by checking the useHandCursor ActionScript property.
        * testsuite/actionscript.all/MovieClip.as: test that useHandCursor
          can take any value, and that it is a property of
          MovieClip.prototype; new successes about it..

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6418&r2=1.6419
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.163&r2=1.164
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.140&r2=1.141
http://cvs.savannah.gnu.org/viewcvs/gnash/server/namedStrings.cpp?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/server/namedStrings.h?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.516&r2=1.517
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.185&r2=1.186
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/MovieClip.as?cvsroot=gnash&r1=1.126&r2=1.127

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6418
retrieving revision 1.6419
diff -u -b -r1.6418 -r1.6419
--- ChangeLog   27 Apr 2008 14:30:58 -0000      1.6418
+++ ChangeLog   27 Apr 2008 15:39:38 -0000      1.6419
@@ -1,3 +1,16 @@
+2008-04-27 Sandro Santilli <address@hidden>
+
+       * server/namedStrings.{cpp,h}: add PROP_USEHANDCURSOR named string.
+       * server/character.h: add virtual allowHandCursor() method.
+       * gui/gui.cpp (notify_mouse_moved): check if active entity under
+         pointer wants to use an hand cursor or not. (getMovieInfo):
+         cleanup output, add useHandCursor info for active entity.
+       * server/sprite_instance.{cpp,h}: implement allowHandCursor()
+         by checking the useHandCursor ActionScript property.
+       * testsuite/actionscript.all/MovieClip.as: test that useHandCursor
+         can take any value, and that it is a property of
+         MovieClip.prototype; new successes about it..
+
 2008-04-27 Benjamin Wolsey <address@hidden>
 
        * libbase/rc.cpp: (updateFile) save to the last file specified

Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -b -r1.163 -r1.164
--- gui/gui.cpp 27 Apr 2008 13:33:59 -0000      1.163
+++ gui/gui.cpp 27 Apr 2008 15:39:39 -0000      1.164
@@ -529,10 +529,14 @@
                {
                        setCursor(CURSOR_INPUT);
                }
-               else
+               else if ( activeEntity->allowHandCursor() )
                {
                        setCursor(CURSOR_HAND);
                }
+               else
+               {
+                       setCursor(CURSOR_NORMAL);
+               }
        }
        else
        {
@@ -1074,26 +1078,30 @@
     {
            std::stringstream ss;
            ss << ch->getTarget() << " (" + typeName(*ch)
-            << " - id:" << ch->get_id() << " depth:"
-            << ch->get_depth();
-       firstLevelIter = tr->append_child(topIter, StringPair("Active mouse 
entity", ss.str()));
+            << " - id:" << ch->get_id()
+            << " - depth:" << ch->get_depth()
+            << " - useHandCursor:" << ch->allowHandCursor()
+            << ")";
+       firstLevelIter = tr->append_child(topIter, StringPair("Active entity 
under mouse pointer", ss.str()));
     }
 
     ch = stage.getEntityUnderPointer();
     if ( ch )
     {
            std::stringstream ss;
-           ss << ch->getTarget() << " (" + typeName(*ch) <<
-            " - id:" << ch->get_id() << " depth:" << ch->get_depth();
-       firstLevelIter = tr->append_child(topIter, StringPair("Topmost mouse 
entity", ss.str()));
+           ss << ch->getTarget() << " (" + typeName(*ch) 
+               << " - id:" << ch->get_id() << " - depth:" << ch->get_depth()
+               << ")";
+       firstLevelIter = tr->append_child(topIter, StringPair("Topmost entity 
under mouse pointer", ss.str()));
     }
 
     ch = stage.getDraggingCharacter();
     if ( ch ) 
     {
            std::stringstream ss;
-           ss << ch->getTarget() << " (" + typeName(*ch) <<
-            " - id:" << ch->get_id() << " depth:" << ch->get_depth();
+           ss << ch->getTarget() << " (" + typeName(*ch) 
+               << " - id:" << ch->get_id()
+               << " - depth:" << ch->get_depth() << ")";
        firstLevelIter = tr->append_child(topIter, StringPair("Dragging 
character: ", ss.str()));
     }
 

Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -b -r1.140 -r1.141
--- server/character.h  22 Apr 2008 23:54:59 -0000      1.140
+++ server/character.h  27 Apr 2008 15:39:39 -0000      1.141
@@ -1172,6 +1172,12 @@
   ///
   virtual bool isSelectableTextField() const { return false; }
 
+  /// \brief
+  /// Return true if this character 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
   /// Append character info in the tree
   //

Index: server/namedStrings.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/namedStrings.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/namedStrings.cpp     1 Apr 2008 16:55:11 -0000       1.14
+++ server/namedStrings.cpp     27 Apr 2008 15:39:39 -0000      1.15
@@ -45,6 +45,7 @@
        string_table::svt( "_currentframe", NSV::PROP_uCURRENTFRAME ),
        string_table::svt( "_droptarget", NSV::PROP_uDROPTARGET ),
        string_table::svt( "enabled", NSV::PROP_ENABLED ),
+       string_table::svt( "useHandCursor", NSV::PROP_USEHANDCURSOR ),
        string_table::svt( "_focusrect", NSV::PROP_uFOCUSRECT ),
        string_table::svt( "_framesloaded", NSV::PROP_uFRAMESLOADED ),
        string_table::svt( "_height", NSV::PROP_uHEIGHT ),

Index: server/namedStrings.h
===================================================================
RCS file: /sources/gnash/gnash/server/namedStrings.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/namedStrings.h       31 Mar 2008 23:48:32 -0000      1.14
+++ server/namedStrings.h       27 Apr 2008 15:39:39 -0000      1.15
@@ -63,6 +63,7 @@
                PROP_uCURRENTFRAME,
                PROP_uDROPTARGET,
                PROP_ENABLED,
+               PROP_USEHANDCURSOR,
                PROP_uFOCUSRECT,
                PROP_uFRAMESLOADED,
                PROP_uHEIGHT,

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.516
retrieving revision 1.517
diff -u -b -r1.516 -r1.517
--- server/sprite_instance.cpp  24 Apr 2008 10:37:29 -0000      1.516
+++ server/sprite_instance.cpp  27 Apr 2008 15:39:39 -0000      1.517
@@ -1987,6 +1987,7 @@
   o.init_member("getSWFVersion", new builtin_function(sprite_getSWFVersion));
   o.init_member("meth", new builtin_function(sprite_meth));
   o.init_member("enabled", true); // see MovieClip.as testcase
+  o.init_member("useHandCursor", true); // see MovieClip.as testcase
 
   as_c_function_ptr gettersetter = &sprite_instance::lockroot_getset;
   o.init_property("_lockroot", *gettersetter, *gettersetter); // see 
MovieClip.as testcase
@@ -4399,6 +4400,20 @@
   return enabled.to_bool();
 }
 
+bool
+sprite_instance::allowHandCursor() const
+{
+  as_value val;
+  // const_cast needed due to get_member being non-const due to the 
+  // possibility that a getter-setter would actually modify us ...
+  if ( ! 
const_cast<sprite_instance*>(this)->get_member(NSV::PROP_USEHANDCURSOR, &val) )
+  {
+     // true if not found..
+     return true;
+  }
+  return val.to_bool();
+}
+
 class EnumerateVisitor {
 
   as_environment& _env;

Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -b -r1.185 -r1.186
--- server/sprite_instance.h    24 Apr 2008 10:27:14 -0000      1.185
+++ server/sprite_instance.h    27 Apr 2008 15:39:40 -0000      1.186
@@ -813,6 +813,8 @@
        ///
        bool isEnabled() const;
 
+       // See dox in character.h
+       bool allowHandCursor() const;
 
        /// Forbid copy
        sprite_instance(const sprite_instance&);

Index: testsuite/actionscript.all/MovieClip.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/MovieClip.as,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -b -r1.126 -r1.127
--- testsuite/actionscript.all/MovieClip.as     16 Apr 2008 21:05:27 -0000      
1.126
+++ testsuite/actionscript.all/MovieClip.as     27 Apr 2008 15:39:40 -0000      
1.127
@@ -20,9 +20,9 @@
 // compile this test case with Ming makeswf, and then
 // execute it like this gnash -1 -r 0 -v out.swf
 
-rcsid="$Id: MovieClip.as,v 1.126 2008/04/16 21:05:27 bwy Exp $";
+rcsid="$Id: MovieClip.as,v 1.127 2008/04/27 15:39:40 strk Exp $";
 
-rcsid="$Id: MovieClip.as,v 1.126 2008/04/16 21:05:27 bwy Exp $";
+rcsid="$Id: MovieClip.as,v 1.127 2008/04/27 15:39:40 strk Exp $";
 #include "check.as"
 
 // To be called at end of test
@@ -33,15 +33,15 @@
 #endif
 
 #if OUTPUT_VERSION == 6
-       check_totals(624); // SWF6
+       check_totals(627); // SWF6
 #endif
 
 #if OUTPUT_VERSION == 7
-       check_totals(641); // SWF7
+       check_totals(644); // SWF7
 #endif
 
 #if OUTPUT_VERSION >= 8
-       check_totals(642); // SWF8+
+       check_totals(645); // SWF8+
 #endif
 
        play();
@@ -113,6 +113,7 @@
 check(!MovieClip.prototype.hasOwnProperty('valueOf')); 
 check(!MovieClip.prototype.hasOwnProperty('toString')); 
 check(MovieClip.prototype.hasOwnProperty('meth')); 
+xcheck(MovieClip.prototype.hasOwnProperty('useHandCursor')); 
 #endif
 check_equals(typeof(mc.valueOf), 'function');
 check_equals(typeof(mc.toString), 'function');
@@ -258,7 +259,7 @@
 check_equals(mc.tabEnabled, undefined);
 check_equals(mc.tabIndex, undefined);
 check_equals(mc.trackAsMenu, undefined);
-xcheck_equals(mc.useHandCursor, true);
+check_equals(mc.useHandCursor, true);
 mc.useHandCursor = false;
 check_equals(mc.useHandCursor, false);
 check_equals(mc._alpha, 100);
@@ -383,7 +384,8 @@
 // Test createEmptyMovieClip
 //----------------------------------------------
 
-#if OUTPUT_VERSION >= 6
+#if OUTPUT_VERSION >= 6 // {
+
 // Test movieclip creation
 var mc2 = createEmptyMovieClip("mc2_mc", 50, 0, 0, 0);
 check(mc2 != undefined);
@@ -394,30 +396,29 @@
 
 xcheck(!mc2.hasOwnProperty('_parent'));
 
-#if OUTPUT_VERSION > 6
+#if OUTPUT_VERSION > 6 // {
  check_equals(getInstanceAtDepth(50), mc2);
-#endif
+#endif // }
 
 var mc3 = createEmptyMovieClip("mc3_mc", 50);
 check(mc3 != undefined);
 check_equals(mc3.getDepth(), 50);
 
-#if OUTPUT_VERSION > 6
+#if OUTPUT_VERSION > 6 // {
 check_equals(getInstanceAtDepth(50), mc3);
-#endif
+#endif // }
 
-// By default useHandCursor is false in SWF5 and true in later versions
-#if OUTPUT_VERSION < 6
-check_equals(mc3.useHandCursor, false);
-#else
-xcheck_equals(mc3.useHandCursor, true);
-#endif
+// By default useHandCursor is true 
+check_equals(mc3.useHandCursor, true);
+check(!mc3.hasOwnProperty("useHandCursor"));
 // We add a mouse event handler, and expect this
 // to make useHandCursor true
 mc3.onMouseOver = function() { trace("over"); };
-xcheck_equals(mc3.useHandCursor, true);
+check_equals(mc3.useHandCursor, true);
 mc3.useHandCursor = false;
 check_equals(mc3.useHandCursor, false);
+mc3.useHandCursor = "string";
+check_equals(mc3.useHandCursor, "string");
 
 check_equals(mc3_mc.getBytesLoaded(), 0);
 check_equals(mc3_mc.getBytesTotal(), 0);
@@ -425,7 +426,8 @@
 check_equals(mc3.getBytesTotal(), 0);
 check_equals(mc3_mc, _level0.mc3_mc);
 check_equals(String(mc3_mc), "_level0.mc3_mc");
-#endif
+
+#endif // }
 
 
 // Test the _target property
@@ -1325,6 +1327,7 @@
     static_clip._x = 20.09;
     check(static_clip._x > 20.049999 && static_clip._x < 20.050001);
     check_equals(static_clip._x, 20.05);
+    static_clip._x = 0;
 
     // TODO: try with x/y being getter-setter of the localToGlobal and 
globalToLocal parameter
     




reply via email to

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