Author: everaldo
Date: 2007-06-08 21:06:21 -0400 (Fri, 08 Jun 2007)
New Revision: 79026

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/moon-plugin.cpp
   trunk/moon/plugin/moon-plugin.h
Log:
        * moon-plugin.h,
        * moon-plugin.cpp: Change demo code to class method CreateDemoControls.

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



Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2007-06-09 01:06:03 UTC (rev 79025)
+++ trunk/moon/plugin/ChangeLog 2007-06-09 01:06:21 UTC (rev 79026)
@@ -1,5 +1,10 @@
 2007-06-08  Everaldo Canuto  <[EMAIL PROTECTED]>
 
+       * moon-plugin.h,
+       * moon-plugin.cpp: Change demo code to class method CreateDemoControls.
+
+2007-06-08  Everaldo Canuto  <[EMAIL PROTECTED]>
+
        * moon-plugin.cpp: Add canvas, connect it to surface and get demo 
working
        back.
 

Modified: trunk/moon/plugin/moon-plugin.cpp
===================================================================
--- trunk/moon/plugin/moon-plugin.cpp   2007-06-09 01:06:03 UTC (rev 79025)
+++ trunk/moon/plugin/moon-plugin.cpp   2007-06-09 01:06:21 UTC (rev 79026)
@@ -15,37 +15,9 @@
 #include "npupp.h"
 #include "npruntime.h"
 
-#define SCRIPTING
-//#define DEMO
+//#define SCRIPTING
+#define DEMO
 
-static void moon_plugin_demo (Canvas *canvas)
-{
-       DEBUG ("*** moon_plugin_demo");
-
-       Rectangle *r;
-
-       r = rectangle_new ();
-       framework_element_set_width (r, 100.0);
-       framework_element_set_height (r, 100.0);
-       r->SetValue (Canvas::LeftProperty, Value (50.0));
-       r->SetValue (Canvas::TopProperty, Value (50.0));
-       Color *c = new Color (1.0, 0.0, 0.5, 0.5);
-       SolidColorBrush *scb = new SolidColorBrush ();
-       solid_color_brush_set_color (scb, c);
-       shape_set_stroke (r, scb);
-       panel_child_add (canvas, r);
-
-#if VIDEO_DEMO
-       UIElement *v, *v2;
-
-       v = video_new ("/home/everaldo/BoxerSmacksdownInhoffe.wmv", 0, 0);
-       panel_child_add (canvas, v);
-
-       v2 = video_new ("/home/everaldo/sawamu.wmv", 100, 30);
-       panel_child_add (canvas, v2);
-#endif 
-}
-
 static void moon_plugin_menu_about (PluginInstance *plugin)
 {
        DEBUG ("*** moon_plugin_menu_about Clicked!");
@@ -238,7 +210,7 @@
        surface_attach (this->surface, canvas);
        gtk_container_add (GTK_CONTAINER (container), 
this->surface->drawing_area);
 
-       moon_plugin_demo (this->canvas);
+       CreateDemoControls ();
 #else
        GtkWidget *label = gtk_label_new (PLUGIN_OURNAME" "PLUGIN_OURVERSION);
        gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
@@ -248,6 +220,35 @@
        gtk_widget_show_all (this->container);
 }
 
+void
+PluginInstance::CreateDemoControls ()
+{
+       DEBUG ("*** creating demo controls");
+
+       Rectangle *r;
+
+       r = rectangle_new ();
+       framework_element_set_width (r, 100.0);
+       framework_element_set_height (r, 100.0);
+       r->SetValue (Canvas::LeftProperty, Value (50.0));
+       r->SetValue (Canvas::TopProperty, Value (50.0));
+       Color *c = new Color (1.0, 0.0, 0.5, 0.5);
+       SolidColorBrush *scb = new SolidColorBrush ();
+       solid_color_brush_set_color (scb, c);
+       shape_set_stroke (r, scb);
+       panel_child_add (this->canvas, r);
+
+#if VIDEO_DEMO
+       UIElement *v, *v2;
+
+       v = video_new ("/home/everaldo/BoxerSmacksdownInhoffe.wmv", 0, 0);
+       panel_child_add (this->canvas, v);
+
+       v2 = video_new ("/home/everaldo/sawamu.wmv", 100, 30);
+       panel_child_add (this->canvas, v2);
+#endif 
+}
+
 NPError
 PluginInstance::NewStream (NPMIMEType type, NPStream* stream, NPBool seekable, 
uint16* stype)
 {

Modified: trunk/moon/plugin/moon-plugin.h
===================================================================
--- trunk/moon/plugin/moon-plugin.h     2007-06-09 01:06:03 UTC (rev 79025)
+++ trunk/moon/plugin/moon-plugin.h     2007-06-09 01:06:21 UTC (rev 79026)
@@ -68,6 +68,7 @@
 
        // Private methods
        void CreateWindow ();
+       void CreateDemoControls ();
 
  public:       
        PluginInstance (NPP instance, uint16 mode);

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

Reply via email to