Author: alanmc
Date: 2007-06-25 13:31:28 -0400 (Mon, 25 Jun 2007)
New Revision: 80701

Added:
   trunk/lunareclipse/AssemblyInfo.cs
   trunk/lunareclipse/Controller/
   trunk/lunareclipse/Controller/MoonlightController.cs
   trunk/lunareclipse/DesignerMoon.mdp
   trunk/lunareclipse/DesignerMoon.mds
   trunk/lunareclipse/Model/
   trunk/lunareclipse/Model/Draw/
   trunk/lunareclipse/Model/Draw/CircleDraw.cs
   trunk/lunareclipse/Model/Draw/DrawBase.cs
   trunk/lunareclipse/Model/Draw/EllipseDraw.cs
   trunk/lunareclipse/Model/Draw/LineDraw.cs
   trunk/lunareclipse/Model/Draw/PenDraw.cs
   trunk/lunareclipse/Model/Draw/RectangleDraw.cs
   trunk/lunareclipse/Model/Draw/SquareDraw.cs
   trunk/lunareclipse/Model/MouseClick/
   trunk/lunareclipse/Model/MouseClick/CanvasClick.cs
   trunk/lunareclipse/Model/MouseClick/ClickBase.cs
   trunk/lunareclipse/Model/MouseClick/ItemClick.cs
   trunk/lunareclipse/View/
   trunk/lunareclipse/View/GtkMoonlight.cs
   trunk/lunareclipse/View/Main.cs
   trunk/lunareclipse/View/MainWindow.cs
   trunk/lunareclipse/gtk-gui/
   trunk/lunareclipse/gtk-gui/DesignerMoon.View.MainWindow.cs
   trunk/lunareclipse/gtk-gui/generated.cs
   trunk/lunareclipse/gtk-gui/gui.stetic
Log:
Initial commit for the moonlight designer

Added: trunk/lunareclipse/AssemblyInfo.cs
===================================================================
--- trunk/lunareclipse/AssemblyInfo.cs  2007-06-25 17:30:13 UTC (rev 80700)
+++ trunk/lunareclipse/AssemblyInfo.cs  2007-06-25 17:31:28 UTC (rev 80701)
@@ -0,0 +1,37 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/AssemblyInfo.cs created with 
MonoDevelop
+// User: alan at 4:48 PM 6/15/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following
+// attributes.
+//
+// change them to the information which is associated with the assembly
+// you compile.
+
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// The assembly version has following format :
+//
+// Major.Minor.Build.Revision
+//
+// You can specify all values by your own or you can build default build and 
revision
+// numbers with the '*' character (the default):
+
+[assembly: AssemblyVersion("1.0.*")]
+
+// The following attributes specify the key for the sign of your assembly. See 
the
+// .NET Framework documentation for more information about signing.
+// This is not required, if you don't want signing let these attributes like 
they're.
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]


Property changes on: trunk/lunareclipse/AssemblyInfo.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Controller/MoonlightController.cs
===================================================================
--- trunk/lunareclipse/Controller/MoonlightController.cs        2007-06-25 
17:30:13 UTC (rev 80700)
+++ trunk/lunareclipse/Controller/MoonlightController.cs        2007-06-25 
17:31:28 UTC (rev 80701)
@@ -0,0 +1,93 @@
+// 
/home/alan/Projects/DesignerMoon/DesignerMoon/Controller/MoonlightController.cs 
created with MonoDevelop
+// User: alan at 10:56 AM 6/18/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Shapes;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Input;
+using DesignerMoon.View;
+using DesignerMoon.Model;
+using System.Xml;
+
+namespace DesignerMoon.Controller
+{
+    public class MoonlightController
+    {
+        private GtkSilver moonlight;
+       private DrawBase current;
+       private XmlDocument xaml;
+       
+       public DrawBase Current
+        {
+            get { return this.current; }
+            set { this.current = value; } 
+        }
+       
+        public MoonlightController(GtkSilver moonlight)
+        {
+            this.moonlight = moonlight;
+            moonlight.Canvas.MouseLeftButtonDown += new 
MouseEventHandler(MouseLeftDown);
+            moonlight.Canvas.MouseMove += new MouseEventHandler(MouseMove);
+            moonlight.Canvas.MouseLeftButtonUp += new 
MouseEventHandler(MouseLeftUp);
+        }
+        
+        public void Clear()
+        {
+            moonlight.Canvas.Children.Clear();
+            
+            // Horrible hack to make the screen redraw
+            moonlight.Canvas.Opacity = moonlight.Canvas.Opacity;
+        }
+        
+        bool active = false;
+        private void MouseLeftDown(object sender, MouseEventArgs e)
+        {
+            active = true;
+            Console.WriteLine("MouseDown");
+                
+            Point position = e.GetPosition(moonlight.Canvas);
+            
+            moonlight.Canvas.Children.Add(current.Element);
+
+            if(current is LineDraw)
+            {
+                Line l = (Line)current.Element;
+                l.X1 = position.X;
+                l.Y1 = position.Y;
+            }
+            else
+            {
+                current.Element.SetValue<double>(Canvas.TopProperty, 
position.Y);
+                current.Element.SetValue<double>(Canvas.LeftProperty, 
position.X);
+                current.Start = position;
+                current.Resize(position);
+            }
+
+        }
+        
+        private void MouseMove(object sender, MouseEventArgs e)
+        {
+            if(!active)
+                return;
+                
+            Console.WriteLine("MouseMove");
+            current.Resize(e.GetPosition(moonlight.Canvas));
+        }
+        
+        private void MouseLeftUp(object sender, MouseEventArgs e)
+        {
+            if(!active)
+                return;
+                
+            Console.WriteLine("MouseUp");
+            current.Resize(e.GetPosition(moonlight.Canvas));
+            active = false;
+        }
+    }
+}


Property changes on: trunk/lunareclipse/Controller/MoonlightController.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/DesignerMoon.mdp
===================================================================
--- trunk/lunareclipse/DesignerMoon.mdp 2007-06-25 17:30:13 UTC (rev 80700)
+++ trunk/lunareclipse/DesignerMoon.mdp 2007-06-25 17:31:28 UTC (rev 80701)
@@ -0,0 +1,52 @@
+<Project name="DesignerMoon" fileversion="2.0" language="C#" 
clr-version="Net_2_0" ctype="DotNetProject">
+  <Configurations active="Debug">
+    <Configuration name="Debug" ctype="DotNetProjectConfiguration">
+      <CustomCommands>
+        <Command type="Custom" command="export MONO_GAC_PREFIX=/usr/local" />
+      </CustomCommands>
+      <Output directory="./bin/Debug" assembly="DesignerMoon" />
+      <Build debugmode="True" target="Exe" />
+      <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" 
clr-version="Net_2_0" />
+      <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" 
unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" 
definesymbols="DEBUG" generatexmldocumentation="False" win32Icon="./" 
codepage="65001" ctype="CSharpCompilerParameters" />
+    </Configuration>
+    <Configuration name="Release" ctype="DotNetProjectConfiguration">
+      <Output directory="./bin/Release" assembly="DesignerMoon" />
+      <Build debugmode="False" target="Exe" />
+      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" 
clr-version="Net_2_0" />
+      <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" 
unsafecodeallowed="False" generateoverflowchecks="True" 
generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+    </Configuration>
+  </Configurations>
+  <Contents>
+    <File name="./gtk-gui/gui.stetic" subtype="Code" 
buildaction="EmbedAsResource" />
+    <File name="./gtk-gui/generated.cs" subtype="Code" buildaction="Compile" />
+    <File name="./Model" subtype="Directory" buildaction="Compile" />
+    <File name="./View" subtype="Directory" buildaction="Compile" />
+    <File name="./Controller" subtype="Directory" buildaction="Compile" />
+    <File name="./Model/Draw/DrawBase.cs" subtype="Code" buildaction="Compile" 
/>
+    <File name="./Model/Draw/LineDraw.cs" subtype="Code" buildaction="Compile" 
/>
+    <File name="./Model/Draw/RectangleDraw.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./Model/MouseClick/CanvasClick.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./Model/MouseClick/ClickBase.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./Model/MouseClick/ItemClick.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./View/GtkMoonlight.cs" subtype="Code" buildaction="Compile" />
+    <File name="./View/Main.cs" subtype="Code" buildaction="Compile" />
+    <File name="./View/MainWindow.cs" subtype="Code" buildaction="Compile" />
+    <File name="./AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
+    <File name="./Controller/MoonlightController.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./gtk-gui/DesignerMoon.View.MainWindow.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./Model/Draw/SquareDraw.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./Model/Draw/EllipseDraw.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./Model/Draw/CircleDraw.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./Model/Draw/PenDraw.cs" subtype="Code" buildaction="Compile" 
/>
+  </Contents>
+  <References>
+    <ProjectReference type="Gac" localcopy="True" refto="System, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Gac" localcopy="True" refto="agclr, 
Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+    <ProjectReference type="Gac" localcopy="True" refto="System.Xml, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <ProjectReference type="Gac" localcopy="True" refto="atk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
+    <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+  </References>
+  <GtkDesignInfo partialTypes="True" />
+</Project>
\ No newline at end of file


Property changes on: trunk/lunareclipse/DesignerMoon.mdp
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/DesignerMoon.mds
===================================================================
--- trunk/lunareclipse/DesignerMoon.mds 2007-06-25 17:30:13 UTC (rev 80700)
+++ trunk/lunareclipse/DesignerMoon.mds 2007-06-25 17:31:28 UTC (rev 80701)
@@ -0,0 +1,16 @@
+<Combine name="DesignerMoon" fileversion="2.0">
+  <Configurations active="Debug">
+    <Configuration name="Debug" ctype="CombineConfiguration">
+      <Entry build="True" name="DesignerMoon" configuration="Debug" />
+    </Configuration>
+    <Configuration name="Release" ctype="CombineConfiguration">
+      <Entry build="True" name="DesignerMoon" configuration="Release" />
+    </Configuration>
+  </Configurations>
+  <StartMode startupentry="DesignerMoon" single="True">
+    <Execute type="None" entry="DesignerMoon" />
+  </StartMode>
+  <Entries>
+    <Entry filename="./DesignerMoon.mdp" />
+  </Entries>
+</Combine>
\ No newline at end of file


Property changes on: trunk/lunareclipse/DesignerMoon.mds
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Model/Draw/CircleDraw.cs
===================================================================
--- trunk/lunareclipse/Model/Draw/CircleDraw.cs 2007-06-25 17:30:13 UTC (rev 
80700)
+++ trunk/lunareclipse/Model/Draw/CircleDraw.cs 2007-06-25 17:31:28 UTC (rev 
80701)
@@ -0,0 +1,32 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/Model/Draw/CircleDraw.cs 
created with MonoDevelop
+// User: alan at 3:36 PM 6/19/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+using System.Windows;
+
+namespace DesignerMoon.Model
+{
+    public class CircleDraw : DrawBase
+    {
+        public CircleDraw(Point startLocation)
+            : base(startLocation, new System.Windows.Shapes.Ellipse())
+        {
+        }
+        
+        public override void Resize (Point end)
+        {
+            double size = 0;
+            if(Math.Abs(end.X - Start.X) > Math.Abs(end.Y - Start.Y))
+                size = end.X - Start.X;
+            else
+                size = end.Y - Start.Y;
+                
+            Element.Width = size;
+            Element.Height = size;
+        }
+
+    }
+}


Property changes on: trunk/lunareclipse/Model/Draw/CircleDraw.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Model/Draw/DrawBase.cs
===================================================================
--- trunk/lunareclipse/Model/Draw/DrawBase.cs   2007-06-25 17:30:13 UTC (rev 
80700)
+++ trunk/lunareclipse/Model/Draw/DrawBase.cs   2007-06-25 17:31:28 UTC (rev 
80701)
@@ -0,0 +1,52 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/IDraw.cs created with 
MonoDevelop
+// User: alan at 6:02 PM 6/15/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Shapes;
+using System.Windows.Media;
+
+namespace DesignerMoon.Model
+{
+    public abstract class DrawBase
+    {
+        private Shape uiElement;
+        private Point endPoint;
+        private Point startPoint;
+
+        
+        public Point Start
+        {
+            get { return startPoint; }
+            set { startPoint = value; }
+        }
+        
+        public Point End
+        {
+            get { return endPoint; }
+        }
+        
+        public Shape Element
+        {
+            get { return uiElement; }
+        }
+        
+        internal DrawBase(Point startPoint, Shape element)
+        {
+            this.startPoint = startPoint;
+            uiElement = element;
+            
+            uiElement.Stroke = new SolidColorBrush(Colors.Red);
+        }
+        
+        public virtual void Resize(Point end)
+        {
+            uiElement.Width = end.X - Start.X;
+            uiElement.Height = end.Y - Start.Y;
+        }
+    }
+}


Property changes on: trunk/lunareclipse/Model/Draw/DrawBase.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Model/Draw/EllipseDraw.cs
===================================================================
--- trunk/lunareclipse/Model/Draw/EllipseDraw.cs        2007-06-25 17:30:13 UTC 
(rev 80700)
+++ trunk/lunareclipse/Model/Draw/EllipseDraw.cs        2007-06-25 17:31:28 UTC 
(rev 80701)
@@ -0,0 +1,26 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/Model/Draw/EllipseDraw.cs 
created with MonoDevelop
+// User: alan at 3:36 PM 6/19/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Shapes;
+
+
+namespace DesignerMoon.Model
+{
+    
+    
+    public class EllipseDraw : DrawBase
+    {
+        
+        public EllipseDraw(Point startLocation)
+            : base(startLocation, new Ellipse())
+        {
+        }
+
+    }
+}


Property changes on: trunk/lunareclipse/Model/Draw/EllipseDraw.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Model/Draw/LineDraw.cs
===================================================================
--- trunk/lunareclipse/Model/Draw/LineDraw.cs   2007-06-25 17:30:13 UTC (rev 
80700)
+++ trunk/lunareclipse/Model/Draw/LineDraw.cs   2007-06-25 17:31:28 UTC (rev 
80701)
@@ -0,0 +1,31 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/Draw/LineDraw.cs created with 
MonoDevelop
+// User: alan at 6:03 PM 6/15/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+using System.Windows;
+using System.Windows.Shapes;
+using System.Windows.Media;
+
+namespace DesignerMoon.Model
+{
+    public class LineDraw : DrawBase
+    {
+        
+        public LineDraw(Point startLocation)
+            : base(startLocation, new System.Windows.Shapes.Line())
+        {
+            base.Element.Fill = new SolidColorBrush(Colors.Red);
+        }
+ 
+        public override void Resize (Point end)
+        {
+            Line l = (Line)Element;
+            l.X2 = end.X;
+            l.Y2 = end.Y;
+        }
+
+    }
+}


Property changes on: trunk/lunareclipse/Model/Draw/LineDraw.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Model/Draw/PenDraw.cs
===================================================================
--- trunk/lunareclipse/Model/Draw/PenDraw.cs    2007-06-25 17:30:13 UTC (rev 
80700)
+++ trunk/lunareclipse/Model/Draw/PenDraw.cs    2007-06-25 17:31:28 UTC (rev 
80701)
@@ -0,0 +1,47 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/Model/Draw/PenDraw.cs created 
with MonoDevelop
+// User: alan at 4:11 PM 6/20/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+using System.Windows;
+using System.Windows.Shapes;
+using DesignerMoon.Model;
+using System.Windows.Media;
+namespace DesignerMoon
+{
+   
+    public class PenDraw : DrawBase
+    {
+        PathGeometry geometry;
+        PathFigure figure;
+        
+        public PenDraw(Point startPoint)
+            :base(startPoint, new System.Windows.Shapes.Path())
+        {
+            Path path = (Path)Element;
+            path.Stroke = new SolidColorBrush(Colors.Black);
+            path.StrokeThickness = 1;
+            path.Fill = new SolidColorBrush(Colors.Black);
+                                        
+            geometry = new PathGeometry();
+            figure = new PathFigure();
+            
+            path.Data = geometry;
+            geometry.Figures = new PathFigureCollection();
+            geometry.Figures.Add(figure);
+            
+            figure.Segments = new PathSegmentCollection();
+            figure.StartPoint = startPoint;
+        }
+        
+        public override void Resize (Point end)
+        {
+            Console.WriteLine("Adding pen segment");
+            LineSegment seg = new LineSegment();
+            seg.Point = end;
+            figure.Segments.Add(seg);
+        }
+    }
+}


Property changes on: trunk/lunareclipse/Model/Draw/PenDraw.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Model/Draw/RectangleDraw.cs
===================================================================
--- trunk/lunareclipse/Model/Draw/RectangleDraw.cs      2007-06-25 17:30:13 UTC 
(rev 80700)
+++ trunk/lunareclipse/Model/Draw/RectangleDraw.cs      2007-06-25 17:31:28 UTC 
(rev 80701)
@@ -0,0 +1,23 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/Draw/RectangleDraw.cs created 
with MonoDevelop
+// User: alan at 6:03 PM 6/15/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+using System.Windows;
+
+namespace DesignerMoon.Model
+{
+    public class RectangleDraw : DrawBase
+    {
+        
+        public RectangleDraw(Point startLocation)
+            : base(startLocation, new System.Windows.Shapes.Rectangle())
+        {
+        }
+        
+  
+   
+    }
+}


Property changes on: trunk/lunareclipse/Model/Draw/RectangleDraw.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Model/Draw/SquareDraw.cs
===================================================================
--- trunk/lunareclipse/Model/Draw/SquareDraw.cs 2007-06-25 17:30:13 UTC (rev 
80700)
+++ trunk/lunareclipse/Model/Draw/SquareDraw.cs 2007-06-25 17:31:28 UTC (rev 
80701)
@@ -0,0 +1,35 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/Model/Draw/SquareDraw.cs 
created with MonoDevelop
+// User: alan at 3:36 PM 6/19/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+using System.Windows;
+
+namespace DesignerMoon.Model
+{
+    
+    
+    public class SquareDraw : DrawBase
+    {
+        
+        public SquareDraw(Point startLocation)
+            : base(startLocation, new System.Windows.Shapes.Rectangle())
+        {
+        }
+        
+        public override void Resize (Point end)
+        {
+                        double size = 0;
+            if(Math.Abs(end.X - Start.X) > Math.Abs(end.Y - Start.Y))
+                size = end.X - Start.X;
+            else
+                size = end.Y - Start.Y;
+                
+            Element.Width = size;
+            Element.Height = size;
+        }
+
+    }
+}


Property changes on: trunk/lunareclipse/Model/Draw/SquareDraw.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Model/MouseClick/CanvasClick.cs
===================================================================
--- trunk/lunareclipse/Model/MouseClick/CanvasClick.cs  2007-06-25 17:30:13 UTC 
(rev 80700)
+++ trunk/lunareclipse/Model/MouseClick/CanvasClick.cs  2007-06-25 17:31:28 UTC 
(rev 80701)
@@ -0,0 +1,20 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/MouseClick/CanvasClick.cs 
created with MonoDevelop
+// User: alan at 10:23 AM 6/18/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+
+namespace DesignerMoon.Model
+{
+    
+    
+    public class CanvasClick : ClickBase
+    {
+        
+        public CanvasClick()
+        {
+        }
+    }
+}


Property changes on: trunk/lunareclipse/Model/MouseClick/CanvasClick.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Model/MouseClick/ClickBase.cs
===================================================================
--- trunk/lunareclipse/Model/MouseClick/ClickBase.cs    2007-06-25 17:30:13 UTC 
(rev 80700)
+++ trunk/lunareclipse/Model/MouseClick/ClickBase.cs    2007-06-25 17:31:28 UTC 
(rev 80701)
@@ -0,0 +1,20 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/MouseClick/ClickBase.cs 
created with MonoDevelop
+// User: alan at 10:22 AM 6/18/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+
+namespace DesignerMoon.Model
+{
+    
+    
+    public abstract class ClickBase
+    {
+        
+        public ClickBase()
+        {
+        }
+    }
+}


Property changes on: trunk/lunareclipse/Model/MouseClick/ClickBase.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/Model/MouseClick/ItemClick.cs
===================================================================
--- trunk/lunareclipse/Model/MouseClick/ItemClick.cs    2007-06-25 17:30:13 UTC 
(rev 80700)
+++ trunk/lunareclipse/Model/MouseClick/ItemClick.cs    2007-06-25 17:31:28 UTC 
(rev 80701)
@@ -0,0 +1,20 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/MouseClick/ItemClick.cs 
created with MonoDevelop
+// User: alan at 10:22 AM 6/18/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+
+namespace DesignerMoon.Model
+{
+    
+    
+    public class ItemClick : ClickBase
+    {
+        
+        public ItemClick()
+        {
+        }
+    }
+}


Property changes on: trunk/lunareclipse/Model/MouseClick/ItemClick.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/View/GtkMoonlight.cs
===================================================================
--- trunk/lunareclipse/View/GtkMoonlight.cs     2007-06-25 17:30:13 UTC (rev 
80700)
+++ trunk/lunareclipse/View/GtkMoonlight.cs     2007-06-25 17:31:28 UTC (rev 
80701)
@@ -0,0 +1,97 @@
+using System;
+using System.Runtime.InteropServices;
+using Gtk;
+using System.Windows;
+using System.Windows.Controls;
+using Mono;
+using System.Reflection;
+using System.IO;
+using System.Net;
+using System.Collections;
+using System.Threading;
+
+namespace DesignerMoon.View
+{
+    public class GtkSilver : DrawingArea {
+       [DllImport ("moon")]
+       extern static IntPtr surface_new (int w, int h);
+
+           [DllImport ("moon")]
+           extern static IntPtr surface_get_drawing_area (IntPtr surface);
+
+           [DllImport ("moon")]
+           extern static IntPtr xaml_create_from_file (string file, ref int 
kind_type);
+
+       IntPtr surface;
+        public Canvas Canvas
+        {
+            get { return c; }
+        }
+       private Canvas c;
+
+       public static readonly string filePath = System.IO.Path.Combine(
+                            
Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "file.xaml");
+                        
+                             
+                    
+       public GtkSilver (int w, int h)
+       {
+               surface = surface_new (w, h);
+               Raw = surface_get_drawing_area (surface);
+       }
+
+       public void Attach (Canvas canvas)
+       {
+               if (canvas == null)
+                       throw new ArgumentNullException ("canvas");
+
+               // Dynamically invoke our get-the-handle-code
+               MethodInfo m = typeof (Canvas).Assembly.GetType 
("Mono.Hosting").
+                       GetMethod ("SurfaceAttach", BindingFlags.Static | 
BindingFlags.NonPublic);
+               m.Invoke (null, new object [] { surface, canvas });
+            
+            this.c = canvas;
+       }
+       
+
+
+        public bool Load (string file)
+           {
+               string xaml = null;
+
+               Console.WriteLine ("Loading: {0}", file);
+               try {
+                       using (FileStream fs = File.OpenRead (file)){
+                               using (StreamReader sr = new StreamReader (fs)){
+                                       xaml = sr.ReadToEnd ();
+                               }
+                       }
+               } catch (Exception e) {
+                       Console.Error.WriteLine ("Error loading XAML file {0}: 
{1}", file, e.GetType());
+                       return false;
+               }
+               
+               if (xaml == null){
+                       Console.Error.WriteLine ("Error loading XAML file {0}", 
file);
+                       return false;
+               }
+               Console.WriteLine("XAML");
+               Console.WriteLine("XAML");
+               Console.WriteLine("XAML");
+               Console.WriteLine(xaml);
+               DependencyObject d = XamlReader.Load (xaml);
+               if (d == null){
+                       Console.Error.WriteLine ("No dependency object returned 
from XamlReader");
+                       return false;
+               }
+               
+               if (!(d is Canvas)){
+                       Console.Error.WriteLine ("No Canvas as root");
+                       return false;
+               }
+               
+               c = (Canvas)d;
+               return true;
+        }
+    }
+}


Property changes on: trunk/lunareclipse/View/GtkMoonlight.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/View/Main.cs
===================================================================
--- trunk/lunareclipse/View/Main.cs     2007-06-25 17:30:13 UTC (rev 80700)
+++ trunk/lunareclipse/View/Main.cs     2007-06-25 17:31:28 UTC (rev 80701)
@@ -0,0 +1,30 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/Main.cs created with 
MonoDevelop
+// User: alan at 4:48 PM 6/15/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+// project created on 6/15/2007 at 4:48 PM
+using System;
+using Gtk;
+
+
+using System.Windows.Controls;
+using System.Windows;
+using System.Windows.Shapes;
+using DesignerMoon.View;
+using System.Diagnostics;
+
+namespace DesignerMoon
+{
+       class MainClass
+       {       
+               public static void Main (string[] args)
+               {
+                   System.Diagnostics.Debug.Listeners.Add(new 
ConsoleTraceListener());
+                   Application.Init ();
+                       MainWindow win = new MainWindow ();
+                       win.Show ();
+                       Application.Run ();
+               }
+       }
+}
\ No newline at end of file


Property changes on: trunk/lunareclipse/View/Main.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/View/MainWindow.cs
===================================================================
--- trunk/lunareclipse/View/MainWindow.cs       2007-06-25 17:30:13 UTC (rev 
80700)
+++ trunk/lunareclipse/View/MainWindow.cs       2007-06-25 17:31:28 UTC (rev 
80701)
@@ -0,0 +1,105 @@
+// /home/alan/Projects/DesignerMoon/DesignerMoon/MainWindow.cs created with 
MonoDevelop
+// User: alan at 4:48 PM 6/15/2007
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+using System;
+using Gtk;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Shapes;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Input;
+using DesignerMoon.Controller;
+using DesignerMoon.Model;
+
+namespace DesignerMoon.View
+{
+    public partial class MainWindow: Gtk.Window
+    {
+        Box mainContainer;
+        MoonlightController controller;
+        
+        public MainWindow (): base (Gtk.WindowType.Toplevel)
+       {
+               Build ();
+               
+            Canvas c = new Canvas();
+            c.Width = 640;
+            c.Height = 480;
+               GtkSilver moonlight = new GtkSilver(640, 480);
+            moonlight.Attach(c);
+
+               mainContainer = new HBox();
+               mainContainer.Add(moonlight);
+               mainContainer.Add(InitialiseWidgets());
+               Add(mainContainer);
+               
+            controller = new MoonlightController(moonlight);
+               ShowAll();
+       }
+
+        
+       private VBox InitialiseWidgets()
+       {
+           VBox widgets = new VBox();
+           
+           Button b = new Button("Line");
+           b.Clicked += delegate {
+               controller.Current = new LineDraw(new Point());
+               Console.WriteLine("Draw is: " + 
controller.Current.GetType().Name);
+           };
+           widgets.Add(b);
+           
+           b = new Button("Pen");
+           b.Clicked += delegate {
+               controller.Current = new PenDraw(new Point());
+               Console.WriteLine("Draw is: " + 
controller.Current.GetType().Name);
+           };
+           widgets.Add(b);
+           
+           b = new Button("Rectangle");
+           b.Clicked += delegate {
+               controller.Current = new RectangleDraw(new Point());
+               Console.WriteLine("Draw is: " + 
controller.Current.GetType().Name);
+           };
+           widgets.Add(b);
+           
+           b = new Button("Square");
+           b.Clicked += delegate {
+               controller.Current = new SquareDraw(new Point());
+               Console.WriteLine("Draw is: " + 
controller.Current.GetType().Name);
+           };              
+           widgets.Add(b);
+           
+           b = new Button("Circle");
+           b.Clicked += delegate {
+               controller.Current = new CircleDraw(new Point());
+               Console.WriteLine("Draw is: " + 
controller.Current.GetType().Name);
+           };
+           widgets.Add(b);
+           
+           b = new Button("Ellipse");
+           b.Clicked += delegate {
+               controller.Current = new EllipseDraw(new Point());
+               Console.WriteLine("Draw is: " + 
controller.Current.GetType().Name);
+           };
+           widgets.Add(b);
+           
+           b = new Button("Clear");
+           b.Clicked += delegate {
+               controller.Clear();
+           };
+           widgets.Add(b);
+            
+            return widgets;
+        }
+       
+       protected void OnDeleteEvent (object sender, DeleteEventArgs a)
+       {
+               Application.Quit ();
+               a.RetVal = true;
+       }
+    }
+}


Property changes on: trunk/lunareclipse/View/MainWindow.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/gtk-gui/DesignerMoon.View.MainWindow.cs
===================================================================
--- trunk/lunareclipse/gtk-gui/DesignerMoon.View.MainWindow.cs  2007-06-25 
17:30:13 UTC (rev 80700)
+++ trunk/lunareclipse/gtk-gui/DesignerMoon.View.MainWindow.cs  2007-06-25 
17:31:28 UTC (rev 80701)
@@ -0,0 +1,31 @@
+// 
------------------------------------------------------------------------------
+//  <autogenerated>
+//      This code was generated by a tool.
+//      Mono Runtime Version: 2.0.50727.42
+// 
+//      Changes to this file may cause incorrect behavior and will be lost if 
+//      the code is regenerated.
+//  </autogenerated>
+// 
------------------------------------------------------------------------------
+
+namespace DesignerMoon.View {
+    
+    
+    public partial class MainWindow {
+        
+        protected virtual void Build() {
+            Stetic.Gui.Initialize();
+            // Widget DesignerMoon.View.MainWindow
+            this.Name = "DesignerMoon.View.MainWindow";
+            this.Title = Mono.Unix.Catalog.GetString("MainWindow");
+            this.WindowPosition = ((Gtk.WindowPosition)(4));
+            if ((this.Child != null)) {
+                this.Child.ShowAll();
+            }
+            this.DefaultWidth = 610;
+            this.DefaultHeight = 433;
+            this.Show();
+            this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent);
+        }
+    }
+}


Property changes on: trunk/lunareclipse/gtk-gui/DesignerMoon.View.MainWindow.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/gtk-gui/generated.cs
===================================================================
--- trunk/lunareclipse/gtk-gui/generated.cs     2007-06-25 17:30:13 UTC (rev 
80700)
+++ trunk/lunareclipse/gtk-gui/generated.cs     2007-06-25 17:31:28 UTC (rev 
80701)
@@ -0,0 +1,35 @@
+// 
------------------------------------------------------------------------------
+//  <autogenerated>
+//      This code was generated by a tool.
+//      Mono Runtime Version: 2.0.50727.42
+// 
+//      Changes to this file may cause incorrect behavior and will be lost if 
+//      the code is regenerated.
+//  </autogenerated>
+// 
------------------------------------------------------------------------------
+
+namespace Stetic {
+    
+    
+    internal class Gui {
+        
+        private static bool initialized;
+        
+        internal static void Initialize() {
+            if ((Stetic.Gui.initialized == false)) {
+                Stetic.Gui.initialized = true;
+            }
+        }
+    }
+    
+    internal class ActionGroups {
+        
+        public static Gtk.ActionGroup GetActionGroup(System.Type type) {
+            return Stetic.ActionGroups.GetActionGroup(type.FullName);
+        }
+        
+        public static Gtk.ActionGroup GetActionGroup(string name) {
+            return null;
+        }
+    }
+}


Property changes on: trunk/lunareclipse/gtk-gui/generated.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/lunareclipse/gtk-gui/gui.stetic
===================================================================
--- trunk/lunareclipse/gtk-gui/gui.stetic       2007-06-25 17:30:13 UTC (rev 
80700)
+++ trunk/lunareclipse/gtk-gui/gui.stetic       2007-06-25 17:31:28 UTC (rev 
80701)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<stetic-interface>
+  <configuration>
+    <images-root-path>../</images-root-path>
+  </configuration>
+  <widget class="Gtk.Window" id="DesignerMoon.View.MainWindow" 
design-size="610 433">
+    <property name="MemberName" />
+    <property name="Title" translatable="yes">MainWindow</property>
+    <property name="WindowPosition">CenterOnParent</property>
+    <signal name="DeleteEvent" handler="OnDeleteEvent" />
+    <child>
+      <placeholder />
+    </child>
+  </widget>
+</stetic-interface>
\ No newline at end of file


Property changes on: trunk/lunareclipse/gtk-gui/gui.stetic
___________________________________________________________________
Name: svn:eol-style
   + native

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

Reply via email to