[Monodevelop-patches-list] r1136 - in trunk/MonoDevelop: . build/AddIns build/data/options src/Main/Base src/Main/Base/Gui/Pads/HelpBrowser src/Main/Base/Gui/Workbench/Layouts
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Wed Mar 10 10:13:54 EST 2004
Author: tberman
Date: 2004-03-10 10:13:54 -0500 (Wed, 10 Mar 2004)
New Revision: 1136
Added:
trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/MonodocTreePad.cs
Removed:
trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpBrowser.cs
trunk/MonoDevelop/web/
Modified:
trunk/MonoDevelop/ChangeLog
trunk/MonoDevelop/Makefile.am
trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin
trunk/MonoDevelop/build/data/options/DefaultEditingLayout.xml
trunk/MonoDevelop/configure.in
trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
trunk/MonoDevelop/src/Main/Base/Makefile.am
Log:
doc browser pad, no docs yet, later today i hope.
removing the web dir, as it lives somewhere else now.
note: monodoc 0.12 (from cvs) is required now.
Modified: trunk/MonoDevelop/ChangeLog
===================================================================
--- trunk/MonoDevelop/ChangeLog 2004-03-10 14:51:37 UTC (rev 1135)
+++ trunk/MonoDevelop/ChangeLog 2004-03-10 15:13:54 UTC (rev 1136)
@@ -1,3 +1,10 @@
+2004-03-10 Todd Berman <tberman at sevenl.net>
+
+ * web/: removed.
+ * configure.in: check for monodoc.
+ * misc files: Added a help browser pad. right now it just lists nodes,
+ no documentation is given.
+
2004-03-09 Daniel Kornhauser <dkor at alum.mit.edu>
* BIG 750 file change: Reduced the namespace by mapping
Modified: trunk/MonoDevelop/Makefile.am
===================================================================
--- trunk/MonoDevelop/Makefile.am 2004-03-10 14:51:37 UTC (rev 1135)
+++ trunk/MonoDevelop/Makefile.am 2004-03-10 15:13:54 UTC (rev 1136)
@@ -23,7 +23,7 @@
run: runmd
runmd: $(PROGRAM)
- cd build/bin && mono --debug MonoDevelop.exe
+ cd build/bin && MONO_PATH="`pkg-config --variable=libdir monodoc`/monodoc" mono --debug MonoDevelop.exe
pad: $(MONOPAD)
Modified: trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin
===================================================================
--- trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin 2004-03-10 14:51:37 UTC (rev 1135)
+++ trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin 2004-03-10 15:13:54 UTC (rev 1136)
@@ -391,6 +391,8 @@
class = "MonoDevelop.Gui.Pads.FileScout"/>
<Class id = "OpenTaskView"
class = "MonoDevelop.Gui.Pads.OpenTaskView"/>
+ <Class id = "HelpBrowser"
+ class = "MonoDevelop.Gui.Pads.HelpTree"/>
<!--
<Class id = "SideBar"
class = "MonoDevelop.Gui.Pads.SideBarView"/>
Modified: trunk/MonoDevelop/build/data/options/DefaultEditingLayout.xml
===================================================================
--- trunk/MonoDevelop/build/data/options/DefaultEditingLayout.xml 2004-03-10 14:51:37 UTC (rev 1135)
+++ trunk/MonoDevelop/build/data/options/DefaultEditingLayout.xml 2004-03-10 15:13:54 UTC (rev 1136)
@@ -1,2 +1,2 @@
<?xml version="1.0"?>
-<dock-layout><layout name="__default__"><dock name="__dock_1" floating="no" width="-1" height="-1" floatx="0" floaty="0"><paned orientation="horizontal" locked="no" position="226"><notebook orientation="vertical" locked="no" page="0"><item name="ICSharpCode.SharpDevelop.Gui.Pads.FileScout" orientation="vertical" locked="no"/><item name="ICSharpCode.SharpDevelop.Gui.Pads.ClassScout" orientation="vertical" locked="no"/><item name="ICSharpCode.SharpDevelop.Gui.Pads.ProjectBrowser.ProjectBrowserView" orientation="vertical" locked="no"/></notebook><paned orientation="vertical" locked="no" position="468"><item name="Documents" orientation="vertical" locked="yes"/><notebook orientation="vertical" locked="no" page="2"><item name="ICSharpCode.SharpDevelop.Gui.Pads.OpenTaskView" orientation="vertical" locked="no"/><item name="MonoDevelop.EditorBindings.Gui.Pads.CompilerMessageView" orientation="vertical" locked="no"/><item name="MonoDevelop.SourceEditor.Gui.DebuggerLocalsPad" orientat
ion="vertical" locked="no"/></notebook></paned></paned></dock></layout></dock-layout>
+<dock-layout><layout name="__default__"><dock name="__dock_1" floating="no" width="-1" height="-1" floatx="0" floaty="0"><paned orientation="horizontal" locked="no" position="226"><notebook orientation="vertical" locked="no" page="3"><item name="MonoDevelop.Gui.Pads.FileScout" orientation="vertical" locked="no"/><item name="MonoDevelop.Gui.Pads.ClassScout" orientation="vertical" locked="no"/><item name="MonoDevelop.Gui.Pads.ProjectBrowser.ProjectBrowserView" orientation="vertical" locked="no"/><item name="MonoDevelop.Gui.Pads.HelpTree" orientation="vertical" locked="no"/></notebook><paned orientation="vertical" locked="no" position="319"><item name="Documents" orientation="vertical" locked="yes"/><notebook orientation="vertical" locked="no" page="0"><item name="MonoDevelop.Gui.Pads.OpenTaskView" orientation="vertical" locked="no"/><item name="MonoDevelop.EditorBindings.Gui.Pads.CompilerMessageView" orientation="vertical" locked="no"/><item name="MonoDevelop.SourceEditor.Gui.
DebuggerLocalsPad" orientation="vertical" locked="no"/></notebook></paned></paned></dock></layout></dock-layout>
Modified: trunk/MonoDevelop/configure.in
===================================================================
--- trunk/MonoDevelop/configure.in 2004-03-10 14:51:37 UTC (rev 1135)
+++ trunk/MonoDevelop/configure.in 2004-03-10 15:13:54 UTC (rev 1136)
@@ -62,6 +62,12 @@
debugger_prefix=`pkg-config --variable=prefix mono-debugger`
AC_SUBST(debugger_prefix)
+dnl find monodoc
+MONODOC_REQUIRED_VERSION=0.12
+PKG_CHECK_MODULES(MONODOC, monodoc >= $MONODOC_REQUIRED_VERSION)
+monodoc_libflags=`pkg-config --libs monodoc`
+AC_SUBST(monodoc_libflags)
+
MOZILLA_HOME="`$PKG_CONFIG --variable=libdir mozilla-gtkmozembed`"
AC_SUBST(MOZILLA_HOME)
Deleted: trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpBrowser.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpBrowser.cs 2004-03-10 14:51:37 UTC (rev 1135)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpBrowser.cs 2004-03-10 15:13:54 UTC (rev 1136)
@@ -1,242 +0,0 @@
-// <file>
-// <copyright see="prj:///doc/copyright.txt"/>
-// <license see="prj:///doc/license.txt"/>
-// <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
-// <version value="$version"/>
-// </file>
-
-using System;
-using System.Drawing;
-using System.CodeDom.Compiler;
-using System.IO;
-using System.Text;
-using System.Diagnostics;
-using System.Xml;
-using System.Reflection;
-using MonoDevelop.Services;
-
-using ICSharpCode.SharpZipLib.Zip;
-using MonoDevelop.Core.Properties;
-using MonoDevelop.Core.Services;
-using MonoDevelop.BrowserDisplayBinding;
-using MonoDevelop.Gui.Widgets;
-
-namespace MonoDevelop.Gui.Pads
-{
- public class HelpBrowserWindow : BrowserPane
- {
- public HelpBrowserWindow() : base(true)
- {
- ContentName = "Help";
- }
- }
-
- class HelpLinkInformation
- {
- string link;
- bool isMSDN = false;
-
- public string Link {
- get {
- return link;
- }
- set {
- link = value;
- }
- }
- public bool IsMSDN {
- get {
- return isMSDN;
- }
- set {
- isMSDN = value;
- }
- }
-
- public HelpLinkInformation(string link, bool isMSDN)
- {
- this.link = link;
- this.isMSDN = isMSDN;
- }
-
- }
-
- public class HelpBrowser : AbstractPadContent
- {
- static readonly string helpPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) +
- Path.DirectorySeparatorChar + ".." +
- Path.DirectorySeparatorChar + "doc" +
- Path.DirectorySeparatorChar + "help" +
- Path.DirectorySeparatorChar;
-
- static readonly string helpFileName = helpPath + "SharpDevelopHelp.zip";
- static readonly string mainTOCFile = "HelpConv.xml";
-
- Gtk.Frame browserPanel = new Gtk.Frame ();
- TreeView treeView = new TreeView();
-
- HelpBrowserWindow helpBrowserWindow = null;
-
- public override Gtk.Widget Control {
- get {
- return browserPanel;
- }
- }
-
- public HelpBrowser() : base("${res:MainWindow.Windows.HelpScoutLabel}", "Icons.16x16.HelpIcon")
- {
- //treeView.Dock = DockStyle.Fill;
- //treeView.ImageList = new ImageList();
- //treeView.ImageList.ColorDepth = ColorDepth.Depth32Bit;
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
-
- //treeView.ImageList.Images.Add(resourceService.GetBitmap("Icons.16x16.HelpClosedFolder"));
- //treeView.ImageList.Images.Add(resourceService.GetBitmap("Icons.16x16.HelpOpenFolder"));
-
- //treeView.ImageList.Images.Add(resourceService.GetBitmap("Icons.16x16.HelpTopic"));
- //treeView.BeforeExpand += new TreeViewCancelEventHandler(BeforeExpand);
- //treeView.BeforeCollapse += new TreeViewCancelEventHandler(BeforeCollapse);
- //treeView.AfterSelect += new TreeViewEventHandler(SelectNode);
- browserPanel.Add (treeView);
-
- LoadHelpfile();
- }
-
- /// <remarks>
- /// Parses the xml tree and generates a TreeNode tree out of it.
- /// </remarks>
- void ParseTree(TreeNodeCollection nodeCollection, XmlNode parentNode)
- {
- foreach (XmlNode node in parentNode.ChildNodes) {
- switch (node.Name) {
- case "HelpFolder":
- TreeNode newFolderNode = new TreeNode(node.Attributes["name"].InnerText);
- //newFolderNode.ImageIndex = newFolderNode.SelectedImageIndex = 0;
- ParseTree(newFolderNode.Nodes, node);
-
- bool isMSDNLink = node.Attributes["ismsdn"] != null && node.Attributes["ismsdn"].Value.ToLower() == "true";
- newFolderNode.Tag = node.Attributes["link"] != null ? new HelpLinkInformation(node.Attributes["link"].InnerText , isMSDNLink) : null;
-
- nodeCollection.Add(newFolderNode);
- break;
- case "HelpTopic":
- TreeNode newNode = new TreeNode(node.Attributes["name"].InnerText);
- //newNode.ImageIndex = newNode.SelectedImageIndex = 2;
-
- isMSDNLink = node.Attributes["ismsdn"] != null && node.Attributes["ismsdn"].Value.ToLower() == "true";
- newNode.Tag = new HelpLinkInformation(node.Attributes["link"].InnerText, isMSDNLink);
- nodeCollection.Add(newNode);
- break;
- case "HelpReference":
- TreeNode newReferenceNode = new TreeNode("Reference");
- newReferenceNode.Tag = node.Attributes["reference"].InnerText;
- nodeCollection.Add(newReferenceNode);
- break;
- }
- }
- }
-
- XmlDocument LoadCompressedXmlDocument(string requestedFile)
- {
- ZipInputStream s = new ZipInputStream(File.OpenRead(helpFileName));
-
- ZipEntry theEntry;
- while ((theEntry = s.GetNextEntry()) != null) {
- if (theEntry.Name == requestedFile) {
-
- StringBuilder sb = new StringBuilder();
- int size = 2048;
- byte[] data = new byte[2048];
- while (true) {
- size = s.Read(data, 0, data.Length);
- if (size > 0) {
- sb.Append(Encoding.UTF8.GetString(data, 0, size));
- } else {
- break;
- }
- }
- s.Close();
- XmlDocument doc = new XmlDocument();
- doc.LoadXml(sb.ToString());
- return doc;
- }
- }
- s.Close();
- Debug.Assert(false);
- return null;
- }
-
- void LoadHelpfile()
- {
- XmlDocument doc = LoadCompressedXmlDocument(mainTOCFile);new XmlDocument();
- ParseTree(treeView.Nodes, doc.DocumentElement);
- }
-
- void HelpBrowserClose(object sender, EventArgs e)
- {
- helpBrowserWindow = null;
- }
-
- public void ShowHelpBrowser(string url)
- {
- if (helpBrowserWindow == null) {
- helpBrowserWindow = new HelpBrowserWindow();
- WorkbenchSingleton.Workbench.ShowView(helpBrowserWindow);
- helpBrowserWindow.WorkbenchWindow.CloseEvent += new EventHandler(HelpBrowserClose);
- }
- helpBrowserWindow.Load(url);
- helpBrowserWindow.WorkbenchWindow.SelectWindow();
- }
-
- void ShowHelp(TreeNode node)
- {
- if (node == null || node.Tag == null) {
- return;
- }
- string navigationName;
-
- if(((HelpLinkInformation)node.Tag).IsMSDN == true) {
- navigationName = ((HelpLinkInformation)node.Tag).Link;
- } else {
- navigationName = "mk:@MSITStore:" + helpPath + ((HelpLinkInformation)node.Tag).Link;
- }
-
- ShowHelpBrowser(navigationName);
- }
- /*
- void SelectNode(object sender, TreeViewEventArgs e)
- {
- ShowHelp(e.Node);
- }
-
- void BeforeExpand(object sender, TreeViewCancelEventArgs e)
- {
- if (e.Node.ImageIndex < 2) {
- e.Node.ImageIndex = e.Node.SelectedImageIndex = 1;
- }
-
- TreeNode[] nodes = new TreeNode[e.Node.Nodes.Count];
- e.Node.Nodes.CopyTo(nodes, 0);
- e.Node.Nodes.Clear();
-
- foreach (TreeNode node in nodes) {
- if (node.Tag is string) {
-
- XmlDocument doc = LoadCompressedXmlDocument(node.Tag.ToString());
- ParseTree(e.Node.Nodes, doc.DocumentElement);
- } else {
- e.Node.Nodes.Add(node);
- }
- }
- ShowHelp(e.Node);
- }
-
- void BeforeCollapse(object sender, TreeViewCancelEventArgs e)
- {
- if (e.Node.ImageIndex < 2) {
- e.Node.ImageIndex = e.Node.SelectedImageIndex = 0;
- }
- }
- */
- }
-}
Added: trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/MonodocTreePad.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/MonodocTreePad.cs 2004-03-10 14:51:37 UTC (rev 1135)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/MonodocTreePad.cs 2004-03-10 15:13:54 UTC (rev 1136)
@@ -0,0 +1,123 @@
+//
+// MonodocTreePad - Pad to embed the monodoc help tree.
+//
+// Author: Todd Berman <tberman at sevenl.net>
+//
+// (C) 2003 Todd Berman
+
+using System;
+using System.Collections;
+
+using Gtk;
+using Monodoc;
+
+using MonoDevelop.Gui;
+
+namespace MonoDevelop.Gui.Pads
+{
+
+ public class HelpTree : AbstractPadContent
+ {
+
+ RootTree root_tree;
+ TreeStore store;
+ TreeView tree_view;
+
+ ScrolledWindow scroller;
+
+ TreeIter root_iter;
+ Hashtable iter_to_node;
+ Hashtable node_to_iter;
+ Hashtable node_parent;
+
+ public HelpTree () : base ("Help", Gtk.Stock.Help)
+ {
+ root_tree = RootTree.LoadTree ();
+ tree_view = new TreeView ();
+
+ iter_to_node = new Hashtable ();
+ node_to_iter = new Hashtable ();
+ node_parent = new Hashtable ();
+
+ tree_view.AppendColumn ("name_col", new CellRendererText (), "text", 0);
+ tree_view.RowExpanded += new Gtk.RowExpandedHandler (RowExpanded);
+ tree_view.Selection.Changed += new EventHandler (RowActivated);
+
+ store = new TreeStore (typeof (string), typeof (Node));
+ root_iter = store.AppendValues ("Mono Documentation", root_tree);
+
+ PopulateNode (root_iter);
+
+ tree_view.Model = store;
+ tree_view.HeadersVisible = false;
+
+ scroller = new ScrolledWindow ();
+ scroller.ShadowType = Gtk.ShadowType.In;
+ scroller.Add (tree_view);
+ }
+
+ Hashtable populated = new Hashtable ();
+ void RowExpanded (object o, Gtk.RowExpandedArgs args)
+ {
+ Node node = (Node)store.GetValue (args.Iter, 1);
+ if (node == null)
+ return;
+ if (populated.ContainsKey (node))
+ return;
+ if (node.Nodes == null)
+ return;
+ TreeIter iter;
+ if (store.IterChildren (out iter, args.Iter)) {
+ do {
+ PopulateNode (iter);
+ } while (store.IterNext (out iter));
+ }
+ populated[node] = true;
+ }
+
+ void RowActivated (object o, EventArgs e)
+ {
+ Gtk.TreeIter iter;
+ Gtk.TreeModel model;
+
+ if (tree_view.Selection.GetSelected (out model, out iter)) {
+ Node n = (Node)store.GetValue (iter, 1);
+
+ string url = n.URL;
+ Node match;
+ string s;
+
+ if (n.tree.HelpSource != null) {
+ s = n.tree.HelpSource.GetText (url, out match);
+ if (s != null) {
+ //Console.WriteLine (s);
+ return;
+ }
+ }
+
+ s = root_tree.RenderUrl (url, out match);
+ if (s != null) {
+ //Console.WriteLine (s);
+ return;
+ }
+ Console.WriteLine ("Couldnt find match");
+ }
+ }
+
+ void PopulateNode (TreeIter parent)
+ {
+ Node node = (Node)store.GetValue (parent, 1);
+ if (node.Nodes == null)
+ return;
+
+ foreach (Node n in node.Nodes) {
+ store.AppendValues (parent, n.Caption, n);
+ }
+ }
+
+ public override Gtk.Widget Control {
+ get { return scroller; }
+ }
+ }
+
+}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs 2004-03-10 14:51:37 UTC (rev 1135)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs 2004-03-10 15:13:54 UTC (rev 1136)
@@ -129,6 +129,7 @@
WindowContent bottomContent = null;
string[] leftContents = new string[] {
+ "MonoDevelop.Gui.Pads.HelpTree",
"MonoDevelop.Gui.Pads.ProjectBrowser.ProjectBrowserView",
"MonoDevelop.Gui.Pads.ClassScout",
"MonoDevelop.Gui.Pads.FileScout",
Modified: trunk/MonoDevelop/src/Main/Base/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Makefile.am 2004-03-10 14:51:37 UTC (rev 1135)
+++ trunk/MonoDevelop/src/Main/Base/Makefile.am 2004-03-10 15:13:54 UTC (rev 1136)
@@ -20,7 +20,7 @@
./Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs \
./Gui/Pads/ClassScout/NodeBuilder/IClassScoutNodeBuilder.cs \
./Gui/Pads/ClassScout/BrowserNode/AbstractClassScoutNode.cs \
-./Gui/Pads/HelpBrowser/HelpBrowser.cs \
+./Gui/Pads/HelpBrowser/MonodocTreePad.cs \
./Gui/Pads/SideBarView.cs \
./Gui/AbstractPadContent.cs \
./Gui/ISecondaryViewContent.cs \
@@ -371,6 +371,7 @@
/r:glade-sharp \
/r:gnome-sharp \
/r:$(debugger_prefix)/lib/Mono.Debugger.dll \
+ $(monodoc_libflags) \
$(FILES) \
&& cp $(DLL) ../../../build/bin/.
More information about the Monodevelop-patches-list
mailing list