Author: jackson
Date: 2007-08-24 12:58:27 -0400 (Fri, 24 Aug 2007)
New Revision: 84811
Modified:
trunk/moon/plugin/ChangeLog
trunk/moon/plugin/plugin-class.cpp
Log:
- Eliminate the variant_to_value so that we don't need to do a
bunch of extra casting.
Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2007-08-24 16:54:35 UTC (rev 84810)
+++ trunk/moon/plugin/ChangeLog 2007-08-24 16:58:27 UTC (rev 84811)
@@ -3,6 +3,8 @@
* plugin-class.cpp|h: Now that getPosition works as intended, we
don't need to store the position as an NPObject on the
MouseEventArgs.
+ - Eliminate the variant_to_value so that we don't need to do a
+ bunch of extra casting.
2007-08-24 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
Modified: trunk/moon/plugin/plugin-class.cpp
===================================================================
--- trunk/moon/plugin/plugin-class.cpp 2007-08-24 16:54:35 UTC (rev 84810)
+++ trunk/moon/plugin/plugin-class.cpp 2007-08-24 16:58:27 UTC (rev 84811)
@@ -776,31 +776,15 @@
// to calculate the position with respect to (or null
// for screen space)
-
- Value* varg = NULL;
- variant_to_value (&args[0], &varg);
-
double x = ea->x;
double y = ea->y;
DependencyObject *dob = NULL;
- //printf ("mouse_event_invoke (varg: %s, kind: %s)\n", varg ==
NULL ? "null" : "something", varg == NULL ? "n/a" : Type::Find (varg->GetKind
())->name);
-
- if (varg != NULL) {
- if (varg->GetKind () == Type::NPOBJ) {
- MoonlightObject *obj = (MoonlightObject*)
varg->AsNPObj ();
- if (obj != NULL && obj->moonlight_type >=
Type::DEPENDENCY_OBJECT) {
- dob =
((MoonlightDependencyObjectObject*) obj)->dob;
- }
- } else if (varg->GetKind () >= Type::DEPENDENCY_OBJECT)
{
- dob = varg->AsDependencyObject ();
- }
+ if (NPVARIANT_IS_OBJECT (args [0])) {
+ DependencyObject *dob =
((MoonlightDependencyObjectObject*) NPVARIANT_TO_OBJECT (args [0]))->dob;
+ if (dob->Is (Type::UIELEMENT))
+ uielement_transform_point ((UIElement*) dob,
&x, &y);
}
- if (dob != NULL && dob->Is (Type::UIELEMENT)) {
- uielement_transform_point ((UIElement*) dob, &x, &y);
- }
-
- delete varg;
MoonlightPoint *point = (MoonlightPoint*)NPN_CreateObject
(((MoonlightObject*)npobj)->instance, MoonlightPointClass);
point->point = Point (x, y);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches