Author: rolf
Date: 2007-09-26 06:55:09 -0400 (Wed, 26 Sep 2007)
New Revision: 86377

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/plugin-class.cpp
   trunk/moon/plugin/plugin-class.h
   trunk/moon/plugin/plugin.cpp
   trunk/moon/plugin/plugin.h
Log:
* plugin/plugin.cpp: PluginInstance::UrlNotify: delete the StreamNotify
  when we're done with it. Added plugin_xaml_loader_from_str.
* plugin/plugin-class.cpp: moonlight_scriptable_control_invoke: unref
  the Downloader we create once the object wrapper has it. Move
  implementation of MoonlightEventObjectObject::SetEventObject here.
* plugin/plugin.h: StreamNotify: ref the DependencyObject we get, and
  unref on destruction. Added plugin_xaml_loader_from_str.
* plugin/plugin-class.h: Move implementation of
  MoonlightEventObjectObject::SetEventObject to the cpp file.

Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2007-09-26 10:08:29 UTC (rev 86376)
+++ trunk/moon/plugin/ChangeLog 2007-09-26 10:55:09 UTC (rev 86377)
@@ -1,3 +1,15 @@
+2007-09-26  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
+       * plugin.cpp: PluginInstance::UrlNotify: delete the StreamNotify when 
we're
+         done with it. Added plugin_xaml_loader_from_str.
+       * plugin-class.cpp: moonlight_scriptable_control_invoke: unref the
+         Downloader we create once the object wrapper has it. Move 
implementation
+         of MoonlightEventObjectObject::SetEventObject here.
+       * plugin.h: StreamNotify: ref the DependencyObject we get, and unref on
+         destruction. Added plugin_xaml_loader_from_str.
+       * plugin-class.h: Move implementation of
+         MoonlightEventObjectObject::SetEventObject to the cpp file.
+
 2007-09-23  Jb Evain  <[EMAIL PROTECTED]>
 
        * plugin.cpp: Pride sin, add my name to the contributors.

Modified: trunk/moon/plugin/plugin-class.cpp
===================================================================
--- trunk/moon/plugin/plugin-class.cpp  2007-09-26 10:08:29 UTC (rev 86376)
+++ trunk/moon/plugin/plugin-class.cpp  2007-09-26 10:55:09 UTC (rev 86377)
@@ -1090,6 +1090,7 @@
 
 
                        obj = EventObjectCreateWrapper 
(((MoonlightObject*)npobj)->instance, dl);
+                       dl->unref ();
 
                        OBJECT_TO_NPVARIANT (obj, *result);
                        return true;
@@ -1892,6 +1893,18 @@
        eo = NULL;
 }
 
+void 
+MoonlightEventObjectObject::SetEventObject (EventObject *eventobject)
+{
+       if (eo)
+               eo->unref ();
+
+       eo = eventobject;
+
+       if (eo)
+               eo->ref ();
+}
+
 static bool
 moonlight_event_object_has_property (NPObject *npobj, NPIdentifier name)
 {

Modified: trunk/moon/plugin/plugin-class.h
===================================================================
--- trunk/moon/plugin/plugin-class.h    2007-09-26 10:08:29 UTC (rev 86376)
+++ trunk/moon/plugin/plugin-class.h    2007-09-26 10:55:09 UTC (rev 86377)
@@ -273,16 +273,8 @@
                moonlight_type = Type::EVENTOBJECT;
        }
 
-       void SetEventObject (EventObject *eventobject)
-       {
-               if (eo)
-                       eo->unref ();
+       void SetEventObject (EventObject *eventobject);
 
-               eo = eventobject;
-               if (eo)
-                       eo->ref ();
-       }
-
        virtual void Dispose ();
 
        EventObject *eo;

Modified: trunk/moon/plugin/plugin.cpp
===================================================================
--- trunk/moon/plugin/plugin.cpp        2007-09-26 10:08:29 UTC (rev 86376)
+++ trunk/moon/plugin/plugin.cpp        2007-09-26 10:55:09 UTC (rev 86377)
@@ -570,6 +570,10 @@
 void
 PluginInstance::UrlNotify (const char* url, NPReason reason, void* notifyData)
 {
+       StreamNotify* notify = STREAM_NOTIFY (notifyData);
+
+       if (notify) 
+               delete notify;
 }
 
 void
@@ -859,3 +863,10 @@
 #endif
 }
 
+PluginXamlLoader* 
+plugin_xaml_loader_from_str (const char* str, PluginInstance* plugin, Surface* 
surface)
+{
+       return PluginXamlLoader::FromStr (str, plugin, surface);
+}
+
+

Modified: trunk/moon/plugin/plugin.h
===================================================================
--- trunk/moon/plugin/plugin.h  2007-09-26 10:08:29 UTC (rev 86376)
+++ trunk/moon/plugin/plugin.h  2007-09-26 10:55:09 UTC (rev 86377)
@@ -143,6 +143,15 @@
        StreamNotify (void* data) : type (NONE), pdata (data) {};
        StreamNotify (StreamNotifyFlags type) : type (type), pdata (NULL) {};
        StreamNotify (StreamNotifyFlags type, void* data) : type (type), pdata 
(data) {};
+       StreamNotify (StreamNotifyFlags type, DependencyObject* dob) : type 
(type), pdata (dob)
+       {
+               base_ref (dob);
+       }
+       ~StreamNotify () 
+       {
+               if (type == DOWNLOADER)
+                       base_unref ((DependencyObject*) pdata);
+       }
 
        StreamNotifyFlags type;
        void *pdata;
@@ -190,6 +199,7 @@
 void     plugin_html_timer_timeout_stop (PluginInstance *instance, uint32_t 
source_id);
 uint32_t plugin_html_timer_timeout_add (PluginInstance *instance, int32_t 
interval, GSourceFunc callback, gpointer data);
 void     plugin_set_unload_callback (PluginInstance* instance, 
plugin_unload_callback* puc);
+PluginXamlLoader* plugin_xaml_loader_from_str (const char* str, 
PluginInstance* plugin, Surface* surface);
 
 G_END_DECLS
 

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

Reply via email to