Author: toshok
Date: 2007-07-19 17:53:49 -0400 (Thu, 19 Jul 2007)
New Revision: 82328

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/plugin.cpp
   trunk/moon/plugin/plugin.h
Log:
        * plugin.h, plugin.cpp: add getBrowserInformation call, useful for
        populating the managed BrowserInformation object.  need to flesh
        out how to get the other info.  userAgent is easy.

        also, in plugin.cpp, only invoke is onLoad handler if
        vm_loader_try doesn't return a missing file.  This fixes the
        ordering problem in the silverlight chess demo (where we were
        accessing JScriptPlayer before it was created).
        
2007-07-19  Chris Toshok  <[EMAIL PROTECTED]>



Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2007-07-19 21:46:55 UTC (rev 82327)
+++ trunk/moon/plugin/ChangeLog 2007-07-19 21:53:49 UTC (rev 82328)
@@ -1,5 +1,16 @@
 2007-07-19  Chris Toshok  <[EMAIL PROTECTED]>
 
+       * plugin.h, plugin.cpp: add getBrowserInformation call, useful for
+       populating the managed BrowserInformation object.  need to flesh
+       out how to get the other info.  userAgent is easy.
+
+       also, in plugin.cpp, only invoke is onLoad handler if
+       vm_loader_try doesn't return a missing file.  This fixes the
+       ordering problem in the silverlight chess demo (where we were
+       accessing JScriptPlayer before it was created).
+       
+2007-07-19  Chris Toshok  <[EMAIL PROTECTED]>
+
        * plugin-class.h: add some scriptable object event stuff.
 
        * plugin-class.cpp: a couple of things.

Modified: trunk/moon/plugin/plugin.cpp
===================================================================
--- trunk/moon/plugin/plugin.cpp        2007-07-19 21:46:55 UTC (rev 82327)
+++ trunk/moon/plugin/plugin.cpp        2007-07-19 21:53:49 UTC (rev 82328)
@@ -227,7 +227,7 @@
        g_signal_connect (G_OBJECT(this->container), "event", G_CALLBACK 
(plugin_event_callback), this);
 
        this->surface = new Surface (window->width, window->height);
-       this->surface->Attach (new Canvas ());
+       //this->surface->Attach (new Canvas ());
        gtk_container_add (GTK_CONTAINER (container), 
this->surface->GetDrawingArea());
        display = gdk_drawable_get_display 
(this->surface->GetDrawingArea()->window);
        gtk_widget_show_all (this->container);
@@ -376,6 +376,11 @@
        //
        // missing file was NULL, if error is set, display some message
        //
+       if (!this->isLoaded) {
+               this->isLoaded = true;
+               if (this->onLoad)
+                       JsRunOnload ();
+       }
 }
 
 void
@@ -387,12 +392,6 @@
                DEBUGMSG ("LoadFromXaml: %s", fname);
                mono_loader_object = vm_xaml_file_loader_new (this, 
this->surface, fname);
                TryLoad ();
-
-               if (!this->isLoaded) {
-                       this->isLoaded = true;
-                       if (this->onLoad)
-                               JsRunOnload ();
-               }
        }
 
        if (IS_NOTIFY_DOWNLOADER (stream->notifyData)){
@@ -530,6 +529,20 @@
        return window->width;
 }
 
+void
+PluginInstance::getBrowserInformation (char **name, char **version,
+                                      char **platform, char **userAgent,
+                                      bool *cookieEnabled)
+{
+       *userAgent = (char*)NPN_UserAgent (instance);
+       DEBUG_WARN_NOTIMPLEMENTED ();
+
+       *name = "Foo!";
+       *version = "Foo!";
+       *platform = "Foo!";
+       *cookieEnabled = true;
+}
+
 MoonlightControlObject *
 PluginInstance::getRootObject ()
 {
@@ -551,3 +564,12 @@
 {
        return instance->getActualHeight ();
 }
+
+void
+plugin_instance_get_browser_information (PluginInstance *instance,
+                                        char **name, char **version,
+                                        char **platform, char **userAgent,
+                                        bool *cookieEnabled)
+{
+       instance->getBrowserInformation (name, version, platform, userAgent, 
cookieEnabled);
+}

Modified: trunk/moon/plugin/plugin.h
===================================================================
--- trunk/moon/plugin/plugin.h  2007-07-19 21:46:55 UTC (rev 82327)
+++ trunk/moon/plugin/plugin.h  2007-07-19 21:53:49 UTC (rev 82328)
@@ -93,6 +93,10 @@
 
        int32 getActualHeight ();
        int32 getActualWidth ();
+
+       void getBrowserInformation (char **name, char **version,
+                                   char **platform, char **userAgent,
+                                   bool *cookieEnabled);
 };
 
 extern GSList *plugin_instances;
@@ -136,6 +140,11 @@
 int32 plugin_instance_get_actual_width (PluginInstance *instance);
 int32 plugin_instance_get_actual_height (PluginInstance *instance);
 
+void plugin_instance_get_browser_information (PluginInstance *instance,
+                                             char **name, char **version,
+                                             char **platform, char **userAgent,
+                                             bool *cookieEnabled);
+                                             
 G_END_DECLS
 
 #endif /* MOON_PLUGIN */

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

Reply via email to