[Monodevelop-patches-list] r1943 - in branches/MonoDevelop-plan-43: . src/Plugins/Editor
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sun Aug 15 07:29:29 EDT 2004
Author: jzwart
Date: 2004-08-15 07:29:29 -0400 (Sun, 15 Aug 2004)
New Revision: 1943
Added:
branches/MonoDevelop-plan-43/src/Plugins/Editor/TextNodeViewer.cs
branches/MonoDevelop-plan-43/src/Plugins/Editor/TextNodeViewerFactory.cs
Removed:
branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewer.cs
branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewerFactory.cs
Modified:
branches/MonoDevelop-plan-43/ChangeLog
branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorManager.cs
branches/MonoDevelop-plan-43/src/Plugins/Editor/editor.plugin.in
Log:
2004-08-15 Jeroen Zwartepoorte <jeroen at xs4all.nl>
* src/Plugins/Editor/TextNodeViewer.cs: Renamed EditorNodeViewer: better
name for a generic editor viewer.
* src/Plugins/Editor/TextNodeViewerFactory.cs: idem.
* src/Plugins/Editor/editor.plugin.in: idem.
* src/Plugins/Editor/EditorManager.cs: set basic SourceView properties.
Modified: branches/MonoDevelop-plan-43/ChangeLog
===================================================================
--- branches/MonoDevelop-plan-43/ChangeLog 2004-08-15 11:01:50 UTC (rev 1942)
+++ branches/MonoDevelop-plan-43/ChangeLog 2004-08-15 11:29:29 UTC (rev 1943)
@@ -1,5 +1,13 @@
2004-08-15 Jeroen Zwartepoorte <jeroen at xs4all.nl>
+ * src/Plugins/Editor/TextNodeViewer.cs: Renamed EditorNodeViewer: better
+ name for a generic editor viewer.
+ * src/Plugins/Editor/TextNodeViewerFactory.cs: idem.
+ * src/Plugins/Editor/editor.plugin.in: idem.
+ * src/Plugins/Editor/EditorManager.cs: set basic SourceView properties.
+
+2004-08-15 Jeroen Zwartepoorte <jeroen at xs4all.nl>
+
* src/Plugins/Editor/EditorNodeViewer.cs: cleanup.
* src/Plugins/Editor/editor.build: add gtksourceview-sharp reference.
* src/Plugins/Editor/EditorManager.cs: new class that manages all the
Modified: branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorManager.cs
===================================================================
--- branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorManager.cs 2004-08-15 11:01:50 UTC (rev 1942)
+++ branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorManager.cs 2004-08-15 11:29:29 UTC (rev 1943)
@@ -17,9 +17,21 @@
}
}
- public EditorView CreateEditor ()
+ public static EditorView CreateEditor ()
{
- return new EditorView ();
+ EditorView editor = new EditorView ();
+ // FIXME: the following properties should be retrieved
+ // from the config system (GConf?).
+ editor.AutoIndent = true;
+ editor.InsertSpacesInsteadOfTabs = false;
+ editor.Margin = 80;
+ editor.ShowLineNumbers = true;
+ editor.ShowLineMarkers = true;
+ editor.ShowMargin = true;
+ editor.SmartHomeEnd = true;
+ editor.TabsWidth = 8;
+ editor.ModifyFont (Pango.FontDescription.FromString ("Monospace 8"));
+ return editor;
}
}
}
Deleted: branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewer.cs
===================================================================
--- branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewer.cs 2004-08-15 11:01:50 UTC (rev 1942)
+++ branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewer.cs 2004-08-15 11:29:29 UTC (rev 1943)
@@ -1,98 +0,0 @@
-//
-// EditorNodeViewer.cs: Node viewer for text/* mimetypes.
-//
-// Author:
-// Jeroen Zwartepoorte <jeroen at xs4all.nl>
-//
-// (C) Copyright Jeroen Zwartepoorte 2004
-//
-
-using System;
-using System.IO;
-using System.Text;
-using Gtk;
-using MonoDevelop.Content;
-using MonoDevelop.Node;
-using log4net;
-
-namespace MonoDevelop.Editor {
- public class EditorNodeViewer : AbstractNodeViewer {
- static private readonly ILog log = LogManager.GetLogger (typeof (EditorNodeViewer));
-
- private ScrolledWindow structure;
- private TreeView tree;
- private ScrolledWindow viewer;
- private TextBuffer buffer;
- private TextView editor;
- private string description;
- private string title;
- private Gdk.Pixbuf icon;
-
- public EditorNodeViewer (Context context) : base (context)
- {
- structure = new ScrolledWindow ();
- structure.ShadowType = ShadowType.In;
- tree = new TreeView ();
- structure.Add (tree);
-
- viewer = new ScrolledWindow ();
- viewer.ShadowType = ShadowType.In;
- editor = new TextView ();
- buffer = editor.Buffer;
- viewer.Add (editor);
-
- TextFileNode node = (TextFileNode)context.Node;
- LoadText (node.Buffer.Reader);
- }
-
- public override Widget StructureWidget {
- get {
- return structure;
- }
- }
-
- public override Widget ViewerWidget {
- get {
- return viewer;
- }
- }
-
- public new string ViewerDescription {
- get {
- return description;
- }
- }
-
- public new string ViewerTitle {
- get {
- return title;
- }
- }
-
- public new Gdk.Pixbuf ViewerIcon {
- get {
- return icon;
- }
- }
-
- private void LoadText (Stream reader)
- {
- StreamReader sr = new StreamReader (reader);
- string line;
- buffer.Text = "";
- while ((line = sr.ReadLine ()) != null) {
- log.Debug (line);
- buffer.Text += line + "\n";
- }
- }
-
- public static void InitializePlugin (byte major, byte minor)
- {
- ContentManager.AddNodeViewerFactory (new EditorNodeViewerFactory ());
- }
-
- public static void FinalizePlugin ()
- {
- }
- }
-}
Deleted: branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewerFactory.cs
===================================================================
--- branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewerFactory.cs 2004-08-15 11:01:50 UTC (rev 1942)
+++ branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewerFactory.cs 2004-08-15 11:29:29 UTC (rev 1943)
@@ -1,30 +0,0 @@
-//
-// EditorNodeViewerFactory.cs: Node viewer factory for text/* mimetypes.
-//
-// Author:
-// Jeroen Zwartepoorte <jeroen at xs4all.nl>
-//
-// (C) Copyright Jeroen Zwartepoorte 2004
-//
-
-using System;
-using MonoDevelop.Content;
-using MonoDevelop.Node;
-
-namespace MonoDevelop.Editor {
- public class EditorNodeViewerFactory : INodeViewerFactory {
- public EditorNodeViewerFactory ()
- {
- }
-
- public bool CanDisplayNode (Node node)
- {
- return node is TextFileNode;
- }
-
- public INodeViewer CreateNodeViewer (Context context)
- {
- return new EditorNodeViewer (context);
- }
- }
-}
Copied: branches/MonoDevelop-plan-43/src/Plugins/Editor/TextNodeViewer.cs (from rev 1942, branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewer.cs)
===================================================================
--- branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewer.cs 2004-08-15 11:01:50 UTC (rev 1942)
+++ branches/MonoDevelop-plan-43/src/Plugins/Editor/TextNodeViewer.cs 2004-08-15 11:29:29 UTC (rev 1943)
@@ -0,0 +1,98 @@
+//
+// EditorNodeViewer.cs: Node viewer for text/* mimetypes.
+//
+// Author:
+// Jeroen Zwartepoorte <jeroen at xs4all.nl>
+//
+// (C) Copyright Jeroen Zwartepoorte 2004
+//
+
+using System;
+using System.IO;
+using System.Text;
+using Gtk;
+using MonoDevelop.Content;
+using MonoDevelop.Node;
+using log4net;
+
+namespace MonoDevelop.Editor {
+ public class TextNodeViewer : AbstractNodeViewer {
+ static private readonly ILog log = LogManager.GetLogger (typeof (TextNodeViewer));
+
+ private ScrolledWindow structure;
+ private TreeView tree;
+ private ScrolledWindow viewer;
+ private TextBuffer buffer;
+ private EditorView editor;
+ private string description;
+ private string title;
+ private Gdk.Pixbuf icon;
+
+ public TextNodeViewer (Context context) : base (context)
+ {
+ structure = new ScrolledWindow ();
+ structure.ShadowType = ShadowType.In;
+ tree = new TreeView ();
+ structure.Add (tree);
+
+ viewer = new ScrolledWindow ();
+ viewer.ShadowType = ShadowType.In;
+ editor = EditorManager.CreateEditor ();
+ buffer = editor.Buffer;
+ viewer.Add (editor);
+
+ TextFileNode node = (TextFileNode)context.Node;
+ LoadText (node.Buffer.Reader);
+ }
+
+ public override Widget StructureWidget {
+ get {
+ return structure;
+ }
+ }
+
+ public override Widget ViewerWidget {
+ get {
+ return viewer;
+ }
+ }
+
+ public new string ViewerDescription {
+ get {
+ return description;
+ }
+ }
+
+ public new string ViewerTitle {
+ get {
+ return title;
+ }
+ }
+
+ public new Gdk.Pixbuf ViewerIcon {
+ get {
+ return icon;
+ }
+ }
+
+ private void LoadText (Stream reader)
+ {
+ StreamReader sr = new StreamReader (reader);
+ string line;
+ buffer.Text = "";
+ while ((line = sr.ReadLine ()) != null) {
+ log.Debug (line);
+ buffer.Text += line + "\n";
+ }
+ }
+
+ public static void InitializePlugin (byte major, byte minor)
+ {
+ ContentManager.AddNodeViewerFactory (new TextNodeViewerFactory ());
+ }
+
+ public static void FinalizePlugin ()
+ {
+ }
+ }
+}
Copied: branches/MonoDevelop-plan-43/src/Plugins/Editor/TextNodeViewerFactory.cs (from rev 1941, branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewerFactory.cs)
===================================================================
--- branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewerFactory.cs 2004-08-15 03:07:30 UTC (rev 1941)
+++ branches/MonoDevelop-plan-43/src/Plugins/Editor/TextNodeViewerFactory.cs 2004-08-15 11:29:29 UTC (rev 1943)
@@ -0,0 +1,30 @@
+//
+// EditorNodeViewerFactory.cs: Node viewer factory for text/* mimetypes.
+//
+// Author:
+// Jeroen Zwartepoorte <jeroen at xs4all.nl>
+//
+// (C) Copyright Jeroen Zwartepoorte 2004
+//
+
+using System;
+using MonoDevelop.Content;
+using MonoDevelop.Node;
+
+namespace MonoDevelop.Editor {
+ public class TextNodeViewerFactory : INodeViewerFactory {
+ public TextNodeViewerFactory ()
+ {
+ }
+
+ public bool CanDisplayNode (Node node)
+ {
+ return node is TextFileNode;
+ }
+
+ public INodeViewer CreateNodeViewer (Context context)
+ {
+ return new TextNodeViewer (context);
+ }
+ }
+}
Modified: branches/MonoDevelop-plan-43/src/Plugins/Editor/editor.plugin.in
===================================================================
--- branches/MonoDevelop-plan-43/src/Plugins/Editor/editor.plugin.in 2004-08-15 11:01:50 UTC (rev 1942)
+++ branches/MonoDevelop-plan-43/src/Plugins/Editor/editor.plugin.in 2004-08-15 11:29:29 UTC (rev 1943)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin version="1.0">
<assembly>@assembly@</assembly>
- <class name="MonoDevelop.Editor.EditorNodeViewer"/>
+ <class name="MonoDevelop.Editor.TextNodeViewer"/>
</plugin>
More information about the Monodevelop-patches-list
mailing list