Author: everaldo
Date: 2007-06-07 18:07:49 -0400 (Thu, 07 Jun 2007)
New Revision: 78899

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/moon-plugin.cpp
Log:
        * moon-plugin.cpp: Add SCRIPTING and DEMO macros to make available only
        tested features, it mean that developers must uncomment this MACRO lines
        before work on scripting and libmoon stuff.

2007-06-07  Everaldo Canuto  <[EMAIL PROTECTED]>



Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2007-06-07 21:50:07 UTC (rev 78898)
+++ trunk/moon/plugin/ChangeLog 2007-06-07 22:07:49 UTC (rev 78899)
@@ -1,5 +1,11 @@
 2007-06-07  Everaldo Canuto  <[EMAIL PROTECTED]>
 
+       * moon-plugin.cpp: Add SCRIPTING and DEMO macros to make available only
+       tested features, it mean that developers must uncomment this MACRO lines
+       before work on scripting and libmoon stuff.
+
+2007-06-07  Everaldo Canuto  <[EMAIL PROTECTED]>
+
        * moon-plugin.cpp: Fix gtkplug creation fro 64bit systems. 
 
        * Makefile.am: Add -lavformat to link options.

Modified: trunk/moon/plugin/moon-plugin.cpp
===================================================================
--- trunk/moon/plugin/moon-plugin.cpp   2007-06-07 21:50:07 UTC (rev 78898)
+++ trunk/moon/plugin/moon-plugin.cpp   2007-06-07 22:07:49 UTC (rev 78899)
@@ -15,6 +15,9 @@
 #include "npupp.h"
 #include "npruntime.h"
 
+//#define SCRIPTING
+//#define DEMO
+
 static void moon_plugin_demo (Canvas *canvas)
 {
        DEBUG ("*** moon_plugin_demo");
@@ -119,6 +122,7 @@
 
 PluginInstance::~PluginInstance ()
 {
+#ifdef DEMO
        if (this->canvas != NULL)
                delete (this->canvas);
 
@@ -127,6 +131,7 @@
 
        //if (this->container != NULL)
        //      gtk_widget_destroy (this->container);
+#endif
 }
 
 void 
@@ -145,6 +150,7 @@
                        *((PRBool *)result) = PR_TRUE;
                        break;
 
+#ifdef SCRIPTING
                case NPPVpluginScriptableNPObject:
                        if (!this->object)
                                this->object = NPN_CreateObject 
(this->instance, this);
@@ -155,7 +161,7 @@
                                *((NPObject **) result) = NPN_RetainObject 
(this->object);
 
                        break;
-
+#endif
                default:
                        err = NPERR_INVALID_PARAM;
        }
@@ -196,12 +202,14 @@
        DEBUG ("*** creating window (%d,%d,%d,%d)", window->x, window->y, 
window->width, window->height);
 
        //  GtkPlug container and surface inside
-       //this->container = gtk_plug_new ((GdkNativeWindow) window->window);
        this->container = gtk_plug_new (reinterpret_cast <GdkNativeWindow> 
(window->window));
+
+#ifdef DEMO
        this->canvas = canvas_new ();
        this->surface = surface_new (window->width, window->height);
        surface_attach (this->surface, this->canvas);
-       //gtk_container_add (GTK_CONTAINER (container), 
this->surface->drawing_area);
+       gtk_container_add (GTK_CONTAINER (container), 
this->surface->drawing_area);
+#endif
 
        // Connect signals to container
        GTK_WIDGET_SET_FLAGS (GTK_WIDGET (this->container), GTK_CAN_FOCUS);
@@ -226,8 +234,10 @@
        // MoonLight runtime initialization
        runtime_init ();
 
+#ifdef DEMO
        // Call plugin demo
        moon_plugin_demo (this->canvas);
+#endif
 
        gtk_widget_show_all (this->container);
 }

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

Reply via email to