[Monodevelop-patches-list] r680 - in trunk/MonoDevelop: . build/AddIns src/AddIns/DisplayBindings/SourceEditor src/AddIns/DisplayBindings/SourceEditor/Gui src/Main/Core/AddIns

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Tue Jan 27 12:47:36 EST 2004


Author: benm
Date: 2004-01-27 12:47:35 -0500 (Tue, 27 Jan 2004)
New Revision: 680

Added:
   trunk/MonoDevelop/build/AddIns/MonoDevelopNewEditor.addin
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/SourceEditor.cmbx
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/SourceEditor.prjx
Modified:
   trunk/MonoDevelop/Makefile
   trunk/MonoDevelop/README
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs
   trunk/MonoDevelop/src/Main/Core/AddIns/AddInTreeSingleton.cs
Log:
get editor in the build

Modified: trunk/MonoDevelop/Makefile
===================================================================
--- trunk/MonoDevelop/Makefile	2004-01-27 16:50:27 UTC (rev 679)
+++ trunk/MonoDevelop/Makefile	2004-01-27 17:47:35 UTC (rev 680)
@@ -3,7 +3,7 @@
 GTKMOZEMBED=build/bin/gtkmozembed-sharp.dll
 QMAKE=@ $(MAKE)
 
-$(PROGRAM): $(GTKMOZEMBED) MonoDevelop.Base MonoDevelop.DefaultTexteditor CSharpBinding StartPage
+$(PROGRAM): $(GTKMOZEMBED) MonoDevelop.Base MonoDevelop.DefaultTexteditor SourceEditor CSharpBinding StartPage
 	@ echo Building $@
 	$(QMAKE) -C src/Main/StartUp
 
@@ -51,6 +51,14 @@
 	@ echo Building $@
 	$(QMAKE) -C src/Libraries/SharpAssembly
 
+SourceEditor :
+	@ pkg-config gtksourceview-1.0  --atleast-version=0.7 || \
+	 (echo "You must have GtkSourceView, version 0.7 or greater installed, as well as the c# bindings" && exit 1)
+	@ test -f `pkg-config gtk-sharp --variable=prefix`/lib/gtk-sourceview-sharp.dll || \
+	 (echo "You must have the GtkSourceView bindings installed" && exit 1)
+	@ echo Building $@
+	$(QMAKE) -C src/AddIns/DisplayBindings/SourceEditor
+
 clean:
 	find ./build/ -name '*.dll' | xargs rm -f
 	find ./build/ -name '*.exe' | xargs rm -f

Modified: trunk/MonoDevelop/README
===================================================================
--- trunk/MonoDevelop/README	2004-01-27 16:50:27 UTC (rev 679)
+++ trunk/MonoDevelop/README	2004-01-27 17:47:35 UTC (rev 680)
@@ -22,6 +22,12 @@
 
 Mono must be installed with ICU enabled.
 
+You need GtkSourceView >= .7, and the C# bindings which are in
+Mono's CVS. GtkSourceView is available on Red Carpet, on many 
+of the OpenCarpet channels.
+
+See http://lists.ximian.com/archives/public/monodevelop-list/2004-January/000129.html.
+
 References
 ----------
 SharpDevelop Tech Notes

Added: trunk/MonoDevelop/build/AddIns/MonoDevelopNewEditor.addin
===================================================================
--- trunk/MonoDevelop/build/AddIns/MonoDevelopNewEditor.addin	2004-01-27 16:50:27 UTC (rev 679)
+++ trunk/MonoDevelop/build/AddIns/MonoDevelopNewEditor.addin	2004-01-27 17:47:35 UTC (rev 680)
@@ -0,0 +1,19 @@
+<AddIn name        = "New Editor"
+       author      = "Ben Maurer"
+       copyright   = ""
+       url         = ""
+       description = ""
+       version     = "1.0.0">
+	
+	<Runtime>
+		<Import assembly="../bin/MonoDevelop.SourceEditor.dll"/>
+	</Runtime>
+
+	<Extension path = "/SharpDevelop/Workbench/DisplayBindings">
+		<DisplayBinding id    = "NewText"
+		       insertbefore = "Text"
+		       supportedformats = "Text Files,Source Files"
+		       class = "MonoDevelop.SourceEditor.Gui.SourceEditorDisplayBinding" />
+	</Extension>
+	
+</AddIn>

Added: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs	2004-01-27 16:50:27 UTC (rev 679)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs	2004-01-27 17:47:35 UTC (rev 680)
@@ -0,0 +1,45 @@
+using Gtk;
+using GtkSharp;
+
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+	
+namespace MonoDevelop.SourceEditor.Gui {
+	public class SourceEditorBuffer : SourceBuffer {
+		
+		SourceLanguagesManager slm = new SourceLanguagesManager ();
+		
+		public SourceEditorBuffer () : base (new SourceTagTable ())
+		{
+		}
+		
+		public void LoadFile (string file, string mime)
+		{
+			LoadText (File.OpenText (file).ReadToEnd (), mime);
+		}
+		
+		public void LoadFile (string file)
+		{
+			Text = File.OpenText (file).ReadToEnd ();
+		}
+		
+		public void LoadText (string text, string mime)
+		{
+			Text = text;
+			Language = slm.GetLanguageFromMimeType (mime);
+		}
+		
+		public void LoadText (string text)
+		{
+			Text = text;
+		}
+		
+		public void Save (string fileName)
+		{
+			TextWriter s = new StreamWriter (fileName, false);
+			s.Write (Text);
+			s.Close ();
+		}
+	}
+}
\ No newline at end of file

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-01-27 16:50:27 UTC (rev 679)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-01-27 17:47:35 UTC (rev 680)
@@ -99,17 +99,15 @@
 		
 		public override void Save (string fileName)
 		{
-			TextWriter s = new StreamWriter (fileName, false);
-			s.Write (se.Text);
-			s.Close ();
+			se.Buffer.Save (fileName);
 		}
 		
 		public override void Load (string fileName)
 		{
 			if (fileName.EndsWith (".cs"))
-				se.LoadFile (fileName, "text/x-csharp");
+				se.Buffer.LoadFile (fileName, "text/x-csharp");
 			else
-				se.LoadFile (fileName);
+				se.Buffer.LoadFile (fileName);
 			
 			ContentName = fileName;
 		}
@@ -117,9 +115,9 @@
 		public void LoadString (string mime, string val)
 		{
 			if (mime != null)
-				se.LoadText (val, mime);
+				se.Buffer.LoadText (val, mime);
 			else
-				se.LoadText (val);
+				se.Buffer.LoadText (val);
 		}
 		
 #region IEditable
@@ -128,18 +126,18 @@
 		}
 		
 		public string Text {
-			get { return se.Text; }
-			set { se.Text = value; }
+			get { return se.Buffer.Text; }
+			set { se.Buffer.Text = value; }
 		}
 		
 		public void Undo ()
 		{
-			se.buffer.Undo ();
+			se.Buffer.Undo ();
 		}
 		
 		public void Redo ()
 		{
-			se.buffer.Redo ();
+			se.Buffer.Redo ();
 		}
 #endregion
 #region IClipboardHandler
@@ -150,7 +148,7 @@
 		bool HasSelection {
 			get {
 				TextIter dummy, dummy2;
-				return se.buffer.GetSelectionBounds (out dummy, out dummy2);
+				return se.Buffer.GetSelectionBounds (out dummy, out dummy2);
 			}
 		}
 		
@@ -178,22 +176,22 @@
 		
 		public void Cut (object sender, EventArgs e)
 		{
-			se.buffer.CutClipboard (clipboard, true);
+			se.Buffer.CutClipboard (clipboard, true);
 		}
 		
 		public void Copy (object sender, EventArgs e)
 		{
-			se.buffer.CopyClipboard (clipboard);
+			se.Buffer.CopyClipboard (clipboard);
 		}
 		
 		public void Paste (object sender, EventArgs e)
 		{
-			se.buffer.PasteClipboard (clipboard);
+			se.Buffer.PasteClipboard (clipboard);
 		}
 		
 		public void Delete (object sender, EventArgs e)
 		{
-			se.buffer.DeleteSelection (true, true);
+			se.Buffer.DeleteSelection (true, true);
 		}
 		
 		public void SelectAll (object sender, EventArgs e)
@@ -207,11 +205,11 @@
 			//	gtk_text_buffer_move_mark_by_name (buffer, "insert", &start_iter);
 			//	gtk_text_buffer_move_mark_by_name (buffer, "selection_bound", &end_iter);
 			
-			se.buffer.MoveMark ("insert", se.buffer.StartIter);
-			se.buffer.MoveMark ("selection_bound", se.buffer.EndIter);
+			se.Buffer.MoveMark ("insert", se.Buffer.StartIter);
+			se.Buffer.MoveMark ("selection_bound", se.Buffer.EndIter);
 		}
 		
-		Gtk.Clipboard clipboard = Gtk.Clipboard.Get (Gdk.Atom.Intern("CLIPBOARD", false));
+		Gtk.Clipboard clipboard = Gtk.Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
 #endregion
 	}
 }

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs	2004-01-27 16:50:27 UTC (rev 679)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs	2004-01-27 17:47:35 UTC (rev 680)
@@ -7,48 +7,31 @@
 	
 namespace MonoDevelop.SourceEditor.Gui {
 	public class SourceEditor : ScrolledWindow {
+		
+		public readonly SourceEditorBuffer Buffer;
 		SourceView sv;
-		internal SourceBuffer buffer;
-		SourceLanguagesManager slm = new SourceLanguagesManager ();
 		
+
 		public SourceEditor ()
 		{
-			buffer = new SourceBuffer (new SourceTagTable ());
-			sv = new SourceView (buffer);
+			Buffer = new SourceEditorBuffer ();
 			
+			sv = new SourceView (Buffer);
+			
 			sv.AutoIndent = true;
 			sv.SmartHomeEnd = true;
 			sv.ShowLineNumbers = true;
 			sv.ShowLineMarkers = true;
-			buffer.Highlight = true;
+			Buffer.Highlight = true;
 			
 			Add (sv);
 		}
+
+
 		
-		public void LoadFile (string file, string mime)
-		{
-			LoadText (File.OpenText (file).ReadToEnd (), mime);
-		}
-		
-		public void LoadFile (string file)
-		{
-			buffer.Text = File.OpenText (file).ReadToEnd ();
-		}
-		
-		public void LoadText (string text, string mime)
-		{
-			buffer.Text = text;
-			buffer.Language = slm.GetLanguageFromMimeType (mime);
-		}
-		
-		public void LoadText (string text)
-		{
-			buffer.Text = text;
-		}
-		
 		public string Text {
-			get { return buffer.Text; }
-			set { buffer.Text = value; }
+			get { return Buffer.Text; }
+			set { Buffer.Text = value; }
 		}
 	}
 }
\ No newline at end of file

Added: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/SourceEditor.cmbx
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/SourceEditor.cmbx	2004-01-27 16:50:27 UTC (rev 679)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/SourceEditor.cmbx	2004-01-27 17:47:35 UTC (rev 680)
@@ -0,0 +1,16 @@
+<Combine fileversion="1.0" name="SourceEditor" description="">
+  <StartMode startupentry="SourceEditor" single="True">
+    <Execute entry="SourceEditor" type="None" />
+  </StartMode>
+  <Entries>
+    <Entry filename="./SourceEditor.prjx" />
+  </Entries>
+  <Configurations active="Debug">
+    <Configuration name="Release">
+      <Entry name="SourceEditor" configurationname="Debug" build="False" />
+    </Configuration>
+    <Configuration name="Debug">
+      <Entry name="SourceEditor" configurationname="Debug" build="False" />
+    </Configuration>
+  </Configurations>
+</Combine>
\ No newline at end of file

Added: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/SourceEditor.prjx
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/SourceEditor.prjx	2004-01-27 16:50:27 UTC (rev 679)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/SourceEditor.prjx	2004-01-27 17:47:35 UTC (rev 680)
@@ -0,0 +1,26 @@
+<Project name="SourceEditor" description="" newfilesearch="None" enableviewstate="True" version="1.1" projecttype="C#">
+  <Contents>
+    <File name="./Gui/SourceEditorDisplayBinding.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name="./Gui/SourceEditorWidget.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name="./Gui/SourceEditorBuffer.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+  </Contents>
+  <References />
+  <DeploymentInformation target="" script="" strategy="File" />
+  <Configuration runwithwarnings="False" name="Debug">
+    <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" />
+    <Execution commandlineparameters="" consolepause="False" />
+    <Output directory="./bin/Debug" assembly="SourceEditor" executeScript="" executeBeforeBuild="" executeAfterBuild="" />
+  </Configuration>
+  <Configurations active="Debug">
+    <Configuration runwithwarnings="False" name="Debug">
+      <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" />
+      <Execution commandlineparameters="" consolepause="False" />
+      <Output directory="./bin/Debug" assembly="SourceEditor" executeScript="" executeBeforeBuild="" executeAfterBuild="" />
+    </Configuration>
+    <Configuration runwithwarnings="False" name="Release">
+      <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" />
+      <Execution commandlineparameters="" consolepause="False" />
+      <Output directory="./bin/Release" assembly="SourceEditor" executeScript="" executeBeforeBuild="" executeAfterBuild="" />
+    </Configuration>
+  </Configurations>
+</Project>
\ No newline at end of file

Modified: trunk/MonoDevelop/src/Main/Core/AddIns/AddInTreeSingleton.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Core/AddIns/AddInTreeSingleton.cs	2004-01-27 16:50:27 UTC (rev 679)
+++ trunk/MonoDevelop/src/Main/Core/AddIns/AddInTreeSingleton.cs	2004-01-27 17:47:35 UTC (rev 680)
@@ -58,6 +58,9 @@
 			StringCollection retryList  = new StringCollection();
 			
 			foreach (string addInFile in addInFiles) {
+				if (Path.GetFileName (addInFile) == "MonoDevelopNewEditor.addin" && Environment.GetEnvironmentVariable ("NEW_EDITOR") == null)
+					continue;
+				
 				AddIn addIn = new AddIn();
 				try {
 					addIn.Initialize(addInFile);




More information about the Monodevelop-patches-list mailing list