Author: jbevain
Date: 2007-12-20 15:42:53 -0500 (Thu, 20 Dec 2007)
New Revision: 91738

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/plugin-class.cpp
Log:
2007-12-20  Jb Evain  <[EMAIL PROTECTED]>

        * plugin-class.cpp (MoonId_GetStylusPoints): return an
        empty StylusPointCollection instead of doing non-sense.



Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2007-12-20 20:20:35 UTC (rev 91737)
+++ trunk/moon/plugin/ChangeLog 2007-12-20 20:42:53 UTC (rev 91738)
@@ -1,5 +1,10 @@
 2007-12-20  Jb Evain  <[EMAIL PROTECTED]>
 
+       * plugin-class.cpp (MoonId_GetStylusPoints): return an
+       empty StylusPointCollection instead of doing non-sense.
+
+2007-12-20  Jb Evain  <[EMAIL PROTECTED]>
+
        * plugin-class.cpp: throw if createObject is called
        for something else than Downloader.
 

Modified: trunk/moon/plugin/plugin-class.cpp
===================================================================
--- trunk/moon/plugin/plugin-class.cpp  2007-12-20 20:20:35 UTC (rev 91737)
+++ trunk/moon/plugin/plugin-class.cpp  2007-12-20 20:42:53 UTC (rev 91738)
@@ -955,15 +955,21 @@
                if (argCount != 1)
                        THROW_JS_EXCEPTION ("getStylusPoints");
 
-               if (NPVARIANT_IS_OBJECT (args [0])) {
-                       DependencyObject *dob = DEPENDENCY_OBJECT_FROM_VARIANT 
(args [0]);
+               if (NPVARIANT_IS_OBJECT (args [1])) {
+                       DependencyObject *dob = DEPENDENCY_OBJECT_FROM_VARIANT 
(args [1]);
                        if (!dob->Is (Type::INKPRESENTER))
                                THROW_JS_EXCEPTION ("getStylusPoints");
-                       
-                       InkPresenter *ip = (InkPresenter *) dob;
-                       OBJECT_TO_NPVARIANT (EventObjectCreateWrapper 
(instance, ink_presenter_get_strokes (ip)), *result);
+
+                       // TODO: we don't have a way right now to collect
+                       // the stylus points relative to an InkPresenter
+                       MoonlightCollectionObject *collection = 
(MoonlightCollectionObject *) NPN_CreateObject (instance, 
MoonlightCollectionClass);
+                       StylusPointCollection *points = new 
StylusPointCollection ();
+                       collection->SetDependencyObject (points);
+                       points->unref ();
+
+                       OBJECT_TO_NPVARIANT (collection, *result);
                }
-               
+
                return true;
        }
        default:

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to