diff options
author | Lluis Sanchez <lluis@novell.com> | 2010-02-18 16:23:55 +0300 |
---|---|---|
committer | Lluis Sanchez <lluis@novell.com> | 2010-02-18 16:23:55 +0300 |
commit | 5a4c9c40ba7e3d129bd0e4213c9e1678bb5ecd28 (patch) | |
tree | c0572591631b681debdc978166f3c4e7965fc377 /main/src/core | |
parent | 43a319b94ac6d496938ab98b88756e3f7149f916 (diff) |
* src/addins/NUnit/Gui/TestPad.cs:
* src/addins/NUnit/Gui/TestResultsPad.cs:
* src/addins/CBinding/Gui/DataProvider.cs:
* src/addins/ChangeLogAddIn/AddLogEntryDialog.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs:
* src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs:
* src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs:
* src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs:
* src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.Html/PathCompletion.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
* src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
* src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs:
* src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.Html/DocTypeCompletionData.cs:
* src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MemberCompletionData.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ConfirmProjectDeleteDialog.cs:
* src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:
* src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Completion/XmlCompletionData.cs:
* src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
* src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs:
* src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:
* src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Completion/XmlTagCompletionData.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
* src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/ProjectFileSelectorDialog.cs:
* src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs:
* src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs:
* src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs:
* src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs:
* src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
* src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs:
* src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Completion/XmlMultipleClosingTagCompletionData.cs:
* src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/NamespaceSynchronisationPanel.cs:
Track api changes.
* src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/ImageService.cs:
* src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Codons/MimeTypeNode.cs:
* src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/Command.cs:
* src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/OptionsDialog.cs:
* src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandInfo.cs:
* src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/ActionCommand.cs:
* src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Codons/OptionsDialogSection.cs:
* src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandEntrySet.cs:
* src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandMenuItem.cs:
* src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandArrayInfo.cs:
* src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/LinkCommandEntry.cs:
* src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandToolButton.cs:
* src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/LocalCommandEntry.cs:
* src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandToggleToolButton.cs:
Use the new IconId type to represent icon names.
* src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/CellRendererPixbuf.cs:
Renamed to CellRendererIcon to avoid conflicts with the Gtk class.
Added support for rendering icons specified with IconId objects.
* src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/StockIcons.cs:
Use new IconId type.
* src/core/MonoDevelop.Core/Makefile.am:
* src/core/MonoDevelop.Core/MonoDevelop.Core.csproj:
* src/core/MonoDevelop.Core/MonoDevelop.Core/IconId.cs: Implemented
new IconId class which can be used to represent icon names and
supports lazy loading of pixbufs.
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Pad.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects/Project.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomType.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomEvent.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomField.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/Namespace.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomMethod.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/IBaseMember.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomProperty.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomParameter.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeViewItem.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/LocalVariable.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/AbstractMember.cs:
* src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomMemberDecorator.cs:
* src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionData.cs:
* src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/ICompletionData.cs:
* src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionDataList.cs:
Use the new IconId type.
svn path=/trunk/monodevelop/; revision=151981
Diffstat (limited to 'main/src/core')
67 files changed, 517 insertions, 278 deletions
diff --git a/main/src/core/MonoDevelop.Components/ChangeLog b/main/src/core/MonoDevelop.Components/ChangeLog index c823f6e55e..f1f72e4be3 100644 --- a/main/src/core/MonoDevelop.Components/ChangeLog +++ b/main/src/core/MonoDevelop.Components/ChangeLog @@ -1,3 +1,17 @@ +2010-02-18 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.Components.Commands/Command.cs: + * MonoDevelop.Components.Commands/CommandInfo.cs: + * MonoDevelop.Components.Commands/ActionCommand.cs: + * MonoDevelop.Components.Commands/CommandMenuItem.cs: + * MonoDevelop.Components.Commands/CommandEntrySet.cs: + * MonoDevelop.Components.Commands/LinkCommandEntry.cs: + * MonoDevelop.Components.Commands/CommandArrayInfo.cs: + * MonoDevelop.Components.Commands/CommandToolButton.cs: + * MonoDevelop.Components.Commands/LocalCommandEntry.cs: + * MonoDevelop.Components.Commands/CommandToggleToolButton.cs: + Use the new IconId type to represent icon names. + 2010-02-17 Michael Hutchinson <mhutchinson@novell.com> * MonoDevelop.Components/FileEntry.cs: diff --git a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/ActionCommand.cs b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/ActionCommand.cs index 6b39a70b8b..cd4403b711 100644 --- a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/ActionCommand.cs +++ b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/ActionCommand.cs @@ -29,6 +29,7 @@ using System; using Mono.Addins; +using MonoDevelop.Core; namespace MonoDevelop.Components.Commands { @@ -46,12 +47,12 @@ namespace MonoDevelop.Components.Commands { } - public ActionCommand (object id, string text, string icon): base (id, text) + public ActionCommand (object id, string text, IconId icon): base (id, text) { Icon = icon; } - public ActionCommand (object id, string text, string icon, string accelKey, ActionType type): base (id, text) + public ActionCommand (object id, string text, IconId icon, string accelKey, ActionType type): base (id, text) { Icon = icon; AccelKey = accelKey; diff --git a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/Command.cs b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/Command.cs index b21d462983..bc1079bca4 100644 --- a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/Command.cs +++ b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/Command.cs @@ -27,6 +27,7 @@ // using System; +using MonoDevelop.Core; namespace MonoDevelop.Components.Commands { @@ -39,7 +40,7 @@ namespace MonoDevelop.Components.Commands object id; string text; string description; - string icon; + IconId icon; string accelKey; string category; bool disabledVisible; @@ -66,7 +67,7 @@ namespace MonoDevelop.Components.Commands set { text = value; } } - public string Icon { + public IconId Icon { get { return icon; } set { icon = value; } } diff --git a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandArrayInfo.cs b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandArrayInfo.cs index bec96d24a9..d81d07e729 100644 --- a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandArrayInfo.cs +++ b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandArrayInfo.cs @@ -58,7 +58,7 @@ namespace MonoDevelop.Components.Commands { info.DataItem = dataItem; if (info.Text == null) info.Text = defaultInfo.Text; - if (info.Icon == null) info.Icon = defaultInfo.Icon; + if (info.Icon.IsNull) info.Icon = defaultInfo.Icon; list.Insert (index, info); } @@ -78,7 +78,7 @@ namespace MonoDevelop.Components.Commands { info.DataItem = dataItem; if (info.Text == null) info.Text = defaultInfo.Text; - if (info.Icon == null) info.Icon = defaultInfo.Icon; + if (info.Icon.IsNull) info.Icon = defaultInfo.Icon; list.Add (info); } diff --git a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandEntrySet.cs b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandEntrySet.cs index 475c0257da..1d2237aae9 100644 --- a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandEntrySet.cs +++ b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandEntrySet.cs @@ -28,6 +28,7 @@ using System; using System.Collections; +using MonoDevelop.Core; namespace MonoDevelop.Components.Commands { @@ -35,14 +36,14 @@ namespace MonoDevelop.Components.Commands { ArrayList cmds = new ArrayList (); string name; - string icon; + IconId icon; bool autoHide; public CommandEntrySet (): base (null) { } - public CommandEntrySet (string name, string icon): base (null) + public CommandEntrySet (string name, IconId icon): base (null) { this.name = name; this.icon = icon; @@ -53,7 +54,7 @@ namespace MonoDevelop.Components.Commands set { name = value; } } - public string Icon { + public IconId Icon { get { return icon; } set { icon = value; } } @@ -85,7 +86,7 @@ namespace MonoDevelop.Components.Commands return AddItemSet (name, ""); } - public CommandEntrySet AddItemSet (string name, string icon) + public CommandEntrySet AddItemSet (string name, IconId icon) { CommandEntrySet cmdset = new CommandEntrySet (name, icon); cmds.Add (cmdset); diff --git a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandInfo.cs b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandInfo.cs index 7b50572176..a62b8bc5e5 100644 --- a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandInfo.cs +++ b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandInfo.cs @@ -27,13 +27,14 @@ // using System; +using MonoDevelop.Core; namespace MonoDevelop.Components.Commands { public class CommandInfo { string text; - string icon; + IconId icon; string accelKey; string description; bool enabled = true; @@ -73,7 +74,7 @@ namespace MonoDevelop.Components.Commands set { text = value; } } - public string Icon { + public IconId Icon { get { return icon; } set { icon = value; } } diff --git a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandMenuItem.cs b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandMenuItem.cs index a44aa4f619..131cb88243 100644 --- a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandMenuItem.cs +++ b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandMenuItem.cs @@ -28,6 +28,7 @@ using System; using System.Collections; +using MonoDevelop.Core; namespace MonoDevelop.Components.Commands { @@ -39,7 +40,7 @@ namespace MonoDevelop.Components.Commands bool isArrayItem; object arrayDataItem; ArrayList itemArray; - string lastIcon; + IconId lastIcon; string overrideLabel; bool wasButtonActivation; object initialTarget; @@ -131,10 +132,6 @@ namespace MonoDevelop.Components.Commands base.OnDeselected (); } - public delegate void RequestStockIcon (string stockId); - - public static RequestStockIcon IconRequested; - void Update (CommandInfo cmdInfo) { lastCmdInfo = cmdInfo; @@ -214,9 +211,7 @@ namespace MonoDevelop.Components.Commands this.Sensitive = cmdInfo.Enabled; this.Visible = cmdInfo.Visible && (disabledVisible || cmdInfo.Enabled); - if (cmdInfo.Icon != null && cmdInfo.Icon != "" && cmdInfo.Icon != lastIcon) { - if (IconRequested != null) - IconRequested (cmdInfo.Icon); + if (!cmdInfo.Icon.IsNull && cmdInfo.Icon != lastIcon) { Image = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu); lastIcon = cmdInfo.Icon; } diff --git a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandToggleToolButton.cs b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandToggleToolButton.cs index ac163f7c57..1f8f765f5e 100644 --- a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandToggleToolButton.cs +++ b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandToggleToolButton.cs @@ -27,6 +27,7 @@ // using System; +using MonoDevelop.Core; namespace MonoDevelop.Components.Commands { @@ -71,15 +72,14 @@ namespace MonoDevelop.Components.Commands commandManager.DispatchCommand (commandId, null, initialTarget); } - string stockId = null; + IconId stockId = null; + void Update (CommandInfo cmdInfo) { updating = true; Label = cmdInfo.Text; if (cmdInfo.Icon != stockId) { stockId = cmdInfo.Icon; - if (CommandMenuItem.IconRequested != null) - CommandMenuItem.IconRequested (cmdInfo.Icon); this.IconWidget = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu); } Sensitive = cmdInfo.Enabled; diff --git a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandToolButton.cs b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandToolButton.cs index 5aae06ba8d..7509b0b67f 100644 --- a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandToolButton.cs +++ b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandToolButton.cs @@ -27,6 +27,7 @@ // using System; +using MonoDevelop.Core; namespace MonoDevelop.Components.Commands { @@ -71,7 +72,8 @@ namespace MonoDevelop.Components.Commands commandManager.DispatchCommand (commandId, null, initialTarget); } - string stockId = null; + IconId stockId = null; + void Update (CommandInfo cmdInfo) { if (lastDesc != cmdInfo.Description) { @@ -89,15 +91,13 @@ namespace MonoDevelop.Components.Commands Label = cmdInfo.Text; if (cmdInfo.Icon != stockId) { stockId = cmdInfo.Icon; - if (CommandMenuItem.IconRequested != null) - CommandMenuItem.IconRequested (cmdInfo.Icon); this.IconWidget = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu); } if (cmdInfo.Enabled != Sensitive) Sensitive = cmdInfo.Enabled; if (cmdInfo.Visible != Visible) Visible = cmdInfo.Visible; - if (string.IsNullOrEmpty (cmdInfo.Icon)) + if (cmdInfo.Icon.IsNull) IsImportant = true; } } diff --git a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/LinkCommandEntry.cs b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/LinkCommandEntry.cs index 565b60efd7..8aa306233d 100644 --- a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/LinkCommandEntry.cs +++ b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/LinkCommandEntry.cs @@ -38,7 +38,7 @@ namespace MonoDevelop.Components.Commands static object Id = new object (); string text; string url; - string icon = Gtk.Stock.JumpTo; + IconId icon = Gtk.Stock.JumpTo; public LinkCommandEntry (string text, string url): base (Id) { @@ -46,7 +46,7 @@ namespace MonoDevelop.Components.Commands this.url = url; } - public LinkCommandEntry (string text, string url, string icon): base (Id) + public LinkCommandEntry (string text, string url, IconId icon): base (Id) { this.text = text; this.url = url; diff --git a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/LocalCommandEntry.cs b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/LocalCommandEntry.cs index d5bd47c3ba..ad92dad623 100644 --- a/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/LocalCommandEntry.cs +++ b/main/src/core/MonoDevelop.Components/MonoDevelop.Components.Commands/LocalCommandEntry.cs @@ -27,6 +27,7 @@ // using System; +using MonoDevelop.Core; namespace MonoDevelop.Components.Commands { @@ -43,7 +44,7 @@ namespace MonoDevelop.Components.Commands { } - public LocalCommandEntry (object id, string text, string icon): base (id) + public LocalCommandEntry (object id, string text, IconId icon): base (id) { cmd = new ActionCommand (); cmd.Id = id; diff --git a/main/src/core/MonoDevelop.Core.Gui/ChangeLog b/main/src/core/MonoDevelop.Core.Gui/ChangeLog index 0398926590..bd460fb887 100644 --- a/main/src/core/MonoDevelop.Core.Gui/ChangeLog +++ b/main/src/core/MonoDevelop.Core.Gui/ChangeLog @@ -1,3 +1,18 @@ +2010-02-18 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.Core.Gui/ImageService.cs: + * MonoDevelop.Core.Gui.Codons/MimeTypeNode.cs: + * MonoDevelop.Core.Gui.Dialogs/OptionsDialog.cs: + * MonoDevelop.Core.Gui.Codons/OptionsDialogSection.cs: Use the + new IconId type to represent icon names. + + * MonoDevelop.Core.Gui/CellRendererPixbuf.cs: Renamed to + CellRendererIcon to avoid conflicts with the Gtk class. + Added support for rendering icons specified with IconId + objects. + + * MonoDevelop.Core.Gui/StockIcons.cs: Use new IconId type. + 2010-02-16 Mike Krüger <mkrueger@novell.com> * MonoDevelop.Core.Gui/ImageService.cs: removed assert gui diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Codons/MimeTypeNode.cs b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Codons/MimeTypeNode.cs index b66567314a..4e88916de3 100644 --- a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Codons/MimeTypeNode.cs +++ b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Codons/MimeTypeNode.cs @@ -50,7 +50,7 @@ namespace MonoDevelop.Core.Gui.Codons Regex regex; - public string Icon { + public IconId Icon { get { return icon; } diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Codons/OptionsDialogSection.cs b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Codons/OptionsDialogSection.cs index 043222918e..8874d33a2c 100644 --- a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Codons/OptionsDialogSection.cs +++ b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Codons/OptionsDialogSection.cs @@ -46,7 +46,7 @@ namespace MonoDevelop.Core.Gui.Codons { } - public string Icon { + public IconId Icon { get { return icon; } diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/OptionsDialog.cs b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/OptionsDialog.cs index d2ee3a213b..24e49f45af 100644 --- a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/OptionsDialog.cs +++ b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/OptionsDialog.cs @@ -85,7 +85,7 @@ namespace MonoDevelop.Core.Gui.Dialogs tree.HeadersVisible = false; TreeViewColumn col = new TreeViewColumn (); - CellRendererPixbuf crp = new CellRendererPixbuf (); + CellRendererIcon crp = new CellRendererIcon (); crp.StockSize = (uint) IconSize.Menu; col.PackStart (crp, false); col.AddAttribute (crp, "stock-id", 1); @@ -214,7 +214,7 @@ namespace MonoDevelop.Core.Gui.Dialogs it = store.AppendValues (section, null, sectionLabel, false, null); } else { - string icon = string.IsNullOrEmpty (section.Icon) ? "md-empty-category" : section.Icon; + string icon = section.Icon.IsNull ? "md-empty-category" : section.Icon.ToString (); it = store.AppendValues (parentIter, section, icon, section.Label, true, null); } diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/CellRendererPixbuf.cs b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/CellRendererPixbuf.cs index 35e97111f8..3274e70741 100644 --- a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/CellRendererPixbuf.cs +++ b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/CellRendererPixbuf.cs @@ -32,9 +32,9 @@ namespace MonoDevelop.Core.Gui /// Replaces the Gtk.CellRendererPixbuf with a version that loads its stock icons from the ImageService to /// support lazy loading of images. /// </summary> - public class CellRendererPixbuf : Gtk.CellRendererPixbuf + public class CellRendererIcon : Gtk.CellRendererPixbuf { - public CellRendererPixbuf () + public CellRendererIcon () { AddNotification ("stock-id", EnsureIconLoaded); AddNotification ("stock-size", EnsureIconLoaded); @@ -44,6 +44,19 @@ namespace MonoDevelop.Core.Gui { ImageService.EnsureStockIconIsLoaded (StockId, (IconSize)StockSize); } + + IconId icon; + + [GLib.Property ("icon-id")] + public IconId IconId { + get { + return icon; + } + set { + icon = value; + StockId = IconId; + } + } } } diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/ImageService.cs b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/ImageService.cs index 1dc372ea2e..b5b1a8ee39 100644 --- a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/ImageService.cs +++ b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/ImageService.cs @@ -45,7 +45,7 @@ namespace MonoDevelop.Core.Gui static ImageService () { iconFactory.AddDefault (); - MonoDevelop.Components.Commands.CommandMenuItem.IconRequested = delegate (string stockId) { + IconId.IconNameRequestHandler = delegate (string stockId) { EnsureStockIconIsLoaded (stockId, Gtk.IconSize.Menu); }; diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/StockIcons.cs b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/StockIcons.cs index 6a458fd35d..f63122dba8 100644 --- a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/StockIcons.cs +++ b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/StockIcons.cs @@ -1,4 +1,4 @@ -// StockIcons.cs +// Stock.cs // // Author: // Lluis Sanchez Gual <lluis@novell.com> @@ -32,114 +32,114 @@ namespace MonoDevelop.Core.Gui { public class Stock { - public static readonly string AddNamespace = "md-add-namespace"; - public static readonly string BreakPoint = "md-break-point"; - public static readonly string BuildCombine = "md-build-combine"; - public static readonly string BuildCurrentSelectedProject = "md-build-current-selected-project"; - public static readonly string Class = "md-class"; - public static readonly string ClearAllBookmarks = "md-clear-all-bookmarks"; - public static readonly string CloseAllDocuments = "md-close-all-documents"; - public static readonly string CloseCombine = "md-close-combine-icon"; - public static readonly string CloseIcon = Gtk.Stock.Close; - public static readonly string ClosedFolder = "md-closed-folder"; - public static readonly string ClosedReferenceFolder = "md-closed-reference-folder"; - public static readonly string ClosedResourceFolder = "md-closed-resource-folder"; - public static readonly string Solution = "md-solution"; - public static readonly string Workspace = "md-workspace"; - public static readonly string CopyIcon = Gtk.Stock.Copy; - public static readonly string CutIcon = Gtk.Stock.Cut; - public static readonly string Delegate = "md-delegate"; - public static readonly string DeleteIcon = Gtk.Stock.Delete; - public static readonly string Empty = "md-empty"; - public static readonly string EmptyFileIcon = "md-empty-file-icon"; - public static readonly string Enum = "md-enum"; - public static readonly string Error = Gtk.Stock.DialogError; - public static readonly string Event = "md-event"; - public static readonly string ExecutionMarker = "md-execution-marker"; - public static readonly string Field = "md-field"; - public static readonly string FileXmlIcon = "md-file-xml-icon"; - public static readonly string FindIcon = Gtk.Stock.Find; - public static readonly string FindInFiles = "md-find-in-files"; - public static readonly string FindNextIcon = "md-find-next-icon"; - public static readonly string FullScreen = Gtk.Stock.Fullscreen; - public static readonly string GotoNextbookmark = "md-goto-nextbookmark"; - public static readonly string GotoPrevbookmark = "md-goto-prevbookmark"; - public static readonly string Information = Gtk.Stock.DialogInfo; - public static readonly string Interface = "md-interface"; - public static readonly string InternalClass = "md-internal-class"; - public static readonly string InternalDelegate = "md-internal-delegate"; - public static readonly string InternalEnum = "md-internal-enum"; - public static readonly string InternalEvent = "md-internal-event"; - public static readonly string InternalField = "md-internal-field"; - public static readonly string InternalInterface = "md-internal-interface"; - public static readonly string InternalMethod = "md-internal-method"; - public static readonly string InternalProperty = "md-internal-property"; - public static readonly string InternalStruct = "md-internal-struct"; - public static readonly string Literal = "md-literal"; - public static readonly string Method = "md-method"; - public static readonly string MiscFiles = "md-misc-files"; - public static readonly string NameSpace = "md-name-space"; - public static readonly string NewDocumentIcon = Gtk.Stock.New; - public static readonly string NewFolderIcon = "md-new-folder-icon"; - public static readonly string NewProjectIcon = "md-new-project-icon"; - public static readonly string NextWindowIcon = Gtk.Stock.GoForward; - public static readonly string OpenFileIcon = Gtk.Stock.Open; - public static readonly string OpenFolder = "md-open-folder"; - public static readonly string OpenProjectIcon = "md-open-project-icon"; - public static readonly string OpenReferenceFolder = "md-open-reference-folder"; - public static readonly string OpenResourceFolder = "md-open-resource-folder"; - public static readonly string Options = Gtk.Stock.Preferences; - public static readonly string OutputIcon = "md-output-icon"; - public static readonly string PasteIcon = Gtk.Stock.Paste; - public static readonly string PreView = Gtk.Stock.PrintPreview; - public static readonly string PrevWindowIcon = Gtk.Stock.GoBack; - public static readonly string Print = Gtk.Stock.Print; - public static readonly string PrivateClass = "md-private-class"; - public static readonly string PrivateDelegate = "md-private-delegate"; - public static readonly string PrivateEnum = "md-private-enum"; - public static readonly string PrivateEvent = "md-private-event"; - public static readonly string PrivateField = "md-private-field"; - public static readonly string PrivateInterface = "md-private-interface"; - public static readonly string PrivateMethod = "md-private-method"; - public static readonly string PrivateProperty = "md-private-property"; - public static readonly string PrivateStruct = "md-private-struct"; - public static readonly string PropertiesIcon = "md-properties-icon"; - public static readonly string Property = "md-property"; - public static readonly string ProtectedClass = "md-protected-class"; - public static readonly string ProtectedDelegate = "md-protected-delegate"; - public static readonly string ProtectedEnum = "md-protected-enum"; - public static readonly string ProtectedEvent = "md-protected-event"; - public static readonly string ProtectedField = "md-protected-field"; - public static readonly string ProtectedInterface = "md-protected-interface"; - public static readonly string ProtectedMethod = "md-protected-method"; - public static readonly string ProtectedProperty = "md-protected-property"; - public static readonly string ProtectedStruct = "md-protected-struct"; - public static readonly string Question = Gtk.Stock.DialogQuestion; - public static readonly string QuitIcon = Gtk.Stock.Quit; - public static readonly string RedoIcon = Gtk.Stock.Redo; - public static readonly string Reference = "md-reference"; - public static readonly string ReplaceIcon = Gtk.Stock.FindAndReplace; - public static readonly string ReplaceInFiles = "md-replace-in-files"; - public static readonly string ResourceFileIcon = "md-resource-file-icon"; - public static readonly string RunProgramIcon = Gtk.Stock.Execute; - public static readonly string SaveAllIcon = "md-save-all-icon"; - public static readonly string SaveAsIcon = Gtk.Stock.SaveAs; - public static readonly string SaveIcon = Gtk.Stock.Save; - public static readonly string MonoDevelop = "md-monodevelop"; - public static readonly string Project = "md-project"; - public static readonly string SplitWindow = "md-split-window"; - public static readonly string Struct = "md-struct"; - public static readonly string TaskListIcon = "md-task-list-icon"; - public static readonly string TextFileIcon = "md-text-file-icon"; - public static readonly string TipOfTheDay = "md-tip-of-the-day"; - public static readonly string ToggleBookmark = "md-toggle-bookmark"; - public static readonly string UndoIcon = Gtk.Stock.Undo; - public static readonly string Warning = Gtk.Stock.DialogWarning; - public static readonly string WebSearchIcon = "md-web-search-icon"; - public static readonly string XmlFileIcon = "md-xml-file-icon"; - public static readonly string Addin = "md-addin"; - public static readonly string SolutionFolderOpen = "md-solution-folder-open"; - public static readonly string SolutionFolderClosed = "md-solution-folder-closed"; + public static readonly IconId AddNamespace = "md-add-namespace"; + public static readonly IconId BreakPoint = "md-break-point"; + public static readonly IconId BuildCombine = "md-build-combine"; + public static readonly IconId BuildCurrentSelectedProject = "md-build-current-selected-project"; + public static readonly IconId Class = "md-class"; + public static readonly IconId ClearAllBookmarks = "md-clear-all-bookmarks"; + public static readonly IconId CloseAllDocuments = "md-close-all-documents"; + public static readonly IconId CloseCombine = "md-close-combine-icon"; + public static readonly IconId CloseIcon = Gtk.Stock.Close; + public static readonly IconId ClosedFolder = "md-closed-folder"; + public static readonly IconId ClosedReferenceFolder = "md-closed-reference-folder"; + public static readonly IconId ClosedResourceFolder = "md-closed-resource-folder"; + public static readonly IconId Solution = "md-solution"; + public static readonly IconId Workspace = "md-workspace"; + public static readonly IconId CopyIcon = Gtk.Stock.Copy; + public static readonly IconId CutIcon = Gtk.Stock.Cut; + public static readonly IconId Delegate = "md-delegate"; + public static readonly IconId DeleteIcon = Gtk.Stock.Delete; + public static readonly IconId Empty = "md-empty"; + public static readonly IconId EmptyFileIcon = "md-empty-file-icon"; + public static readonly IconId Enum = "md-enum"; + public static readonly IconId Error = Gtk.Stock.DialogError; + public static readonly IconId Event = "md-event"; + public static readonly IconId ExecutionMarker = "md-execution-marker"; + public static readonly IconId Field = "md-field"; + public static readonly IconId FileXmlIcon = "md-file-xml-icon"; + public static readonly IconId FindIcon = Gtk.Stock.Find; + public static readonly IconId FindInFiles = "md-find-in-files"; + public static readonly IconId FindNextIcon = "md-find-next-icon"; + public static readonly IconId FullScreen = Gtk.Stock.Fullscreen; + public static readonly IconId GotoNextbookmark = "md-goto-nextbookmark"; + public static readonly IconId GotoPrevbookmark = "md-goto-prevbookmark"; + public static readonly IconId Information = Gtk.Stock.DialogInfo; + public static readonly IconId Interface = "md-interface"; + public static readonly IconId InternalClass = "md-internal-class"; + public static readonly IconId InternalDelegate = "md-internal-delegate"; + public static readonly IconId InternalEnum = "md-internal-enum"; + public static readonly IconId InternalEvent = "md-internal-event"; + public static readonly IconId InternalField = "md-internal-field"; + public static readonly IconId InternalInterface = "md-internal-interface"; + public static readonly IconId InternalMethod = "md-internal-method"; + public static readonly IconId InternalProperty = "md-internal-property"; + public static readonly IconId InternalStruct = "md-internal-struct"; + public static readonly IconId Literal = "md-literal"; + public static readonly IconId Method = "md-method"; + public static readonly IconId MiscFiles = "md-misc-files"; + public static readonly IconId NameSpace = "md-name-space"; + public static readonly IconId NewDocumentIcon = Gtk.Stock.New; + public static readonly IconId NewFolderIcon = "md-new-folder-icon"; + public static readonly IconId NewProjectIcon = "md-new-project-icon"; + public static readonly IconId NextWindowIcon = Gtk.Stock.GoForward; + public static readonly IconId OpenFileIcon = Gtk.Stock.Open; + public static readonly IconId OpenFolder = "md-open-folder"; + public static readonly IconId OpenProjectIcon = "md-open-project-icon"; + public static readonly IconId OpenReferenceFolder = "md-open-reference-folder"; + public static readonly IconId OpenResourceFolder = "md-open-resource-folder"; + public static readonly IconId Options = Gtk.Stock.Preferences; + public static readonly IconId OutputIcon = "md-output-icon"; + public static readonly IconId PasteIcon = Gtk.Stock.Paste; + public static readonly IconId PreView = Gtk.Stock.PrintPreview; + public static readonly IconId PrevWindowIcon = Gtk.Stock.GoBack; + public static readonly IconId Print = Gtk.Stock.Print; + public static readonly IconId PrivateClass = "md-private-class"; + public static readonly IconId PrivateDelegate = "md-private-delegate"; + public static readonly IconId PrivateEnum = "md-private-enum"; + public static readonly IconId PrivateEvent = "md-private-event"; + public static readonly IconId PrivateField = "md-private-field"; + public static readonly IconId PrivateInterface = "md-private-interface"; + public static readonly IconId PrivateMethod = "md-private-method"; + public static readonly IconId PrivateProperty = "md-private-property"; + public static readonly IconId PrivateStruct = "md-private-struct"; + public static readonly IconId PropertiesIcon = "md-properties-icon"; + public static readonly IconId Property = "md-property"; + public static readonly IconId ProtectedClass = "md-protected-class"; + public static readonly IconId ProtectedDelegate = "md-protected-delegate"; + public static readonly IconId ProtectedEnum = "md-protected-enum"; + public static readonly IconId ProtectedEvent = "md-protected-event"; + public static readonly IconId ProtectedField = "md-protected-field"; + public static readonly IconId ProtectedInterface = "md-protected-interface"; + public static readonly IconId ProtectedMethod = "md-protected-method"; + public static readonly IconId ProtectedProperty = "md-protected-property"; + public static readonly IconId ProtectedStruct = "md-protected-struct"; + public static readonly IconId Question = Gtk.Stock.DialogQuestion; + public static readonly IconId QuitIcon = Gtk.Stock.Quit; + public static readonly IconId RedoIcon = Gtk.Stock.Redo; + public static readonly IconId Reference = "md-reference"; + public static readonly IconId ReplaceIcon = Gtk.Stock.FindAndReplace; + public static readonly IconId ReplaceInFiles = "md-replace-in-files"; + public static readonly IconId ResourceFileIcon = "md-resource-file-icon"; + public static readonly IconId RunProgramIcon = Gtk.Stock.Execute; + public static readonly IconId SaveAllIcon = "md-save-all-icon"; + public static readonly IconId SaveAsIcon = Gtk.Stock.SaveAs; + public static readonly IconId SaveIcon = Gtk.Stock.Save; + public static readonly IconId MonoDevelop = "md-monodevelop"; + public static readonly IconId Project = "md-project"; + public static readonly IconId SplitWindow = "md-split-window"; + public static readonly IconId Struct = "md-struct"; + public static readonly IconId TaskListIcon = "md-task-list-icon"; + public static readonly IconId TextFileIcon = "md-text-file-icon"; + public static readonly IconId TipOfTheDay = "md-tip-of-the-day"; + public static readonly IconId ToggleBookmark = "md-toggle-bookmark"; + public static readonly IconId UndoIcon = Gtk.Stock.Undo; + public static readonly IconId Warning = Gtk.Stock.DialogWarning; + public static readonly IconId WebSearchIcon = "md-web-search-icon"; + public static readonly IconId XmlFileIcon = "md-xml-file-icon"; + public static readonly IconId Addin = "md-addin"; + public static readonly IconId SolutionFolderOpen = "md-solution-folder-open"; + public static readonly IconId SolutionFolderClosed = "md-solution-folder-closed"; } } diff --git a/main/src/core/MonoDevelop.Core/ChangeLog b/main/src/core/MonoDevelop.Core/ChangeLog index 14a56da467..9f875e1667 100644 --- a/main/src/core/MonoDevelop.Core/ChangeLog +++ b/main/src/core/MonoDevelop.Core/ChangeLog @@ -1,3 +1,11 @@ +2010-02-18 Lluis Sanchez Gual <lluis@novell.com> + + * Makefile.am: + * MonoDevelop.Core.csproj: + * MonoDevelop.Core/IconId.cs: Implemented new IconId class + which can be used to represent icon names and supports lazy + loading of pixbufs. + 2010-02-16 Lluis Sanchez Gual <lluis@novell.com> * MonoDevelop.Core.AddIns/TargetFrameworkNode.cs: Allow diff --git a/main/src/core/MonoDevelop.Core/Makefile.am b/main/src/core/MonoDevelop.Core/Makefile.am index 28ebe00f1c..bb799e34c4 100644 --- a/main/src/core/MonoDevelop.Core/Makefile.am +++ b/main/src/core/MonoDevelop.Core/Makefile.am @@ -132,6 +132,7 @@ FILES = \ MonoDevelop.Core/FileService.cs \ MonoDevelop.Core/Gettext.cs \ MonoDevelop.Core/IAsyncOperation.cs \ + MonoDevelop.Core/IconId.cs \ MonoDevelop.Core/ICustomXmlSerializer.cs \ MonoDevelop.Core/IProgressMonitor.cs \ MonoDevelop.Core/LoggingService.cs \ diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj index fd96380e45..fe1369a4bb 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj @@ -70,7 +70,6 @@ <Compile Include="MonoDevelop.Core\IProgressMonitor.cs" /> <Compile Include="MonoDevelop.Core.ProgressMonitoring\LogTextWriter.cs" /> <Compile Include="MonoDevelop.Core.ProgressMonitoring\NullAsyncOperation.cs" /> - <Compile Include="MonoDevelop.Core.ProgressMonitoring\NullProgressMonitor.cs" /> <Compile Include="MonoDevelop.Core.ProgressMonitoring\ProgressTracker.cs" /> <Compile Include="MonoDevelop.Core.Execution\DefaultExecutionHandler.cs" /> <Compile Include="MonoDevelop.Core.Execution\ExternalConsoleFactory.cs" /> @@ -146,7 +145,6 @@ <Compile Include="MonoDevelop.Core.ProgressMonitoring\AsyncOperation.cs" /> <Compile Include="MonoDevelop.Core.AddIns\PackageInstalledCondition.cs" /> <Compile Include="MonoDevelop.Core\ComponentModelLocalization.cs" /> - <Compile Include="MonoDevelop.Core.ProgressMonitoring\SimpleProgressMonitor.cs" /> <Compile Include="MonoDevelop.Core.AddIns\ITargetRuntimeFactory.cs" /> <Compile Include="MonoDevelop.Core.Assemblies\SystemAssembly.cs" /> <Compile Include="MonoDevelop.Core.Assemblies\SystemPackage.cs" /> @@ -193,6 +191,9 @@ <Compile Include="MonoDevelop.Core.ProgressMonitoring\AggregatedAsyncOperation.cs" /> <Compile Include="MonoDevelop.Core.Serialization\BinaryDataSerializer.cs" /> <Compile Include="MonoDevelop.Core.Execution\LocalConsole.cs" /> + <Compile Include="MonoDevelop.Core\IconId.cs" /> + <Compile Include="MonoDevelop.Core.ProgressMonitoring\NullProgressMonitor.cs" /> + <Compile Include="MonoDevelop.Core.ProgressMonitoring\SimpleProgressMonitor.cs" /> </ItemGroup> <ItemGroup> <None Include="ChangeLog" /> diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IconId.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IconId.cs new file mode 100644 index 0000000000..8b7dbd3b09 --- /dev/null +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IconId.cs @@ -0,0 +1,118 @@ +// +// IconId.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace MonoDevelop.Core +{ + [System.Diagnostics.DebuggerDisplay ("{id}")] + public struct IconId: IEquatable<IconId> + { + string id; + + public static readonly IconId Null = new IconId (null); + + public static IconNameRequestHandler IconNameRequestHandler; + + public IconId (string id) + { + this.id = id; + } + + public bool IsNull { + get { return id == null; } + } + + public string Name { + get { + // If the icon is converted to string, fire the icon request event, to ensure that + // the icon it represents is loaded. + if (IconNameRequestHandler != null) + IconNameRequestHandler (id); + return id; + } + } + + public static implicit operator IconId (string name) + { + return new IconId (name); + } + + public static implicit operator string (IconId icon) + { + return icon.Name; + } + + public static bool operator == (IconId name1, IconId name2) + { + return name1.id == name2.id; + } + + public static bool operator != (IconId name1, IconId name2) + { + return name1.id != name2.id; + } + + public static bool operator == (IconId name1, string name2) + { + return name1.id == name2; + } + + public static bool operator != (IconId name1, string name2) + { + return name1.id != name2; + } + + public override bool Equals (object obj) + { + if (obj == null && !(obj is IconId)) + return false; + + IconId fn = (IconId) obj; + return id == fn.id; + } + + public override int GetHashCode ( ) + { + if (id == null) + return 0; + return id.GetHashCode (); + } + + public override string ToString () + { + return Name; + } + + bool IEquatable<IconId>.Equals (IconId other) + { + return this.id == other.id; + } + } + + public delegate void IconNameRequestHandler (string id); +} + diff --git a/main/src/core/MonoDevelop.Ide/ChangeLog b/main/src/core/MonoDevelop.Ide/ChangeLog index ef9a9fe968..832e64d53f 100644 --- a/main/src/core/MonoDevelop.Ide/ChangeLog +++ b/main/src/core/MonoDevelop.Ide/ChangeLog @@ -1,3 +1,34 @@ +2010-02-18 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.Ide.Gui/Workbench.cs: + * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: + * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: + * MonoDevelop.Ide.Gui/ProgressMonitors.cs: + * MonoDevelop.Ide.Commands/FileCommands.cs: + * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: + * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: + * MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs: + * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: + * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs: + * MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs: + * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: + * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs: + * MonoDevelop.Ide.Gui.Dialogs/ConfirmProjectDeleteDialog.cs: + * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs: + Track api changes. + + * MonoDevelop.Ide.Gui/Pad.cs: + * MonoDevelop.Ide.Codons/PadCodon.cs: + * MonoDevelop.Ide.Gui/IPadContainer.cs: + * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: + * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: + * MonoDevelop.Ide.Templates/FileTemplate.cs: + * MonoDevelop.Ide.Gui/AbstractPadContent.cs: + * MonoDevelop.Ide.Templates/ProjectTemplate.cs: + * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: + * MonoDevelop.Ide.Gui.Components/TreeViewItem.cs: Use the new + IconId type. + 2010-02-16 Michael Hutchinson <mhutchinson@novell.com> * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs: Avoid diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs index af050812d5..1589622a8a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs @@ -48,7 +48,7 @@ namespace MonoDevelop.Ide.CodeFormatting TreeIter iter; CodeFormatOption option; - MonoDevelop.Core.Gui.CellRendererPixbuf pixbufCellRenderer; + CellRendererPixbuf pixbufCellRenderer; public TypedCodeFormattingPolicyPanelWidget () { @@ -57,7 +57,7 @@ namespace MonoDevelop.Ide.CodeFormatting TreeViewColumn column = new TreeViewColumn (); // pixbuf column - pixbufCellRenderer = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + pixbufCellRenderer = new CellRendererPixbuf (); column.PackStart (pixbufCellRenderer, false); column.SetCellDataFunc (pixbufCellRenderer, new Gtk.TreeCellDataFunc (RenderIcon)); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs index 718c63e80f..9796191624 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs @@ -99,7 +99,7 @@ namespace MonoDevelop.Ide.CodeTemplates set; } - public string Icon { + public IconId Icon { get { return Code.Contains ("$selected$") ? "md-template-surroundwith" : "md-template"; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs index 4c3ab5f521..550613dc00 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs @@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.CodeTemplates List<CodeTemplate> templates; Gtk.TreeStore templateStore; CellRendererText templateCellRenderer; - MonoDevelop.Core.Gui.CellRendererPixbuf pixbufCellRenderer; + CellRendererPixbuf pixbufCellRenderer; Mono.TextEditor.TextEditor textEditor = new Mono.TextEditor.TextEditor (); Mono.TextEditor.TextEditorOptions options; @@ -58,7 +58,7 @@ namespace MonoDevelop.Ide.CodeTemplates TreeViewColumn column = new TreeViewColumn (); column.Title = GettextCatalog.GetString ("Key"); - pixbufCellRenderer = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + pixbufCellRenderer = new CellRendererPixbuf (); column.PackStart (pixbufCellRenderer, false); column.SetCellDataFunc (pixbufCellRenderer, new Gtk.TreeCellDataFunc (RenderIcon)); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs index 2b46f6b922..3fb3bcdbfe 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs @@ -83,7 +83,7 @@ namespace MonoDevelop.Ide.Codons get { return label; } } - public string Icon { + public IconId Icon { get { return icon; } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs index 6f7fad2a2f..bfdb67a628 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs @@ -318,7 +318,7 @@ namespace MonoDevelop.Ide.Commands int i = 0; foreach (RecentItem ri in recentOpen.RecentProjects) { //getting the icon requires probing the file, so handle IO errors - string icon; + IconId icon; try { if (!File.Exists (ri.LocalPath)) continue; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs index cf87a59746..12a5b8b9bf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs @@ -87,7 +87,7 @@ namespace MonoDevelop.Ide.FindInFiles fileNameColumn.Resizable = true; fileNameColumn.SortColumnId = 0; fileNameColumn.Title = GettextCatalog.GetString ("File"); - var fileNamePixbufRenderer = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + var fileNamePixbufRenderer = new CellRendererPixbuf (); fileNameColumn.PackStart (fileNamePixbufRenderer, false); fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, new Gtk.TreeCellDataFunc (FileIconDataFunc)); @@ -295,7 +295,7 @@ namespace MonoDevelop.Ide.FindInFiles void FileIconDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { - MonoDevelop.Core.Gui.CellRendererPixbuf fileNamePixbufRenderer = (MonoDevelop.Core.Gui.CellRendererPixbuf)cell; + CellRendererPixbuf fileNamePixbufRenderer = (CellRendererPixbuf) cell; SearchResult searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn); fileNamePixbufRenderer.Pixbuf = DesktopService.GetPixbufForFile (searchResult.FileName, Gtk.IconSize.Menu); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeViewItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeViewItem.cs index 9be720a62f..5f05e4e2e2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeViewItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeViewItem.cs @@ -27,6 +27,7 @@ using System; +using MonoDevelop.Core; namespace MonoDevelop.Ide.Gui.Components { @@ -36,7 +37,7 @@ namespace MonoDevelop.Ide.Gui.Components string label; Gdk.Pixbuf icon; - public TreeViewItem (string label, string stockIcon) + public TreeViewItem (string label, IconId stockIcon) { this.stockIcon = stockIcon; this.label = label; @@ -53,7 +54,7 @@ namespace MonoDevelop.Ide.Gui.Components this.label = label; } - public string StockIcon { + public IconId StockIcon { get { return stockIcon; } } @@ -82,7 +83,7 @@ namespace MonoDevelop.Ide.Gui.Components { TreeViewItem it = (TreeViewItem) dataObject; label = it.Label; - if (it.StockIcon != null) + if (!it.StockIcon.IsNull) icon = closedIcon = Context.GetIcon (it.StockIcon); else if (it.Icon != null) icon = closedIcon = it.Icon; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ConfirmProjectDeleteDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ConfirmProjectDeleteDialog.cs index 20c87ab9f9..e2f7adf14c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ConfirmProjectDeleteDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ConfirmProjectDeleteDialog.cs @@ -70,7 +70,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs col.PackStart (crt, false); col.AddAttribute (crt, "active", 0); - MonoDevelop.Core.Gui.CellRendererPixbuf crp = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + CellRendererPixbuf crp = new CellRendererPixbuf (); col.PackStart (crp, false); col.AddAttribute (crp, "pixbuf", 1); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs index a8f56f5f6b..ba01448482 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs @@ -70,7 +70,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs textColumn.AddAttribute (toggleRender, "active", Columns.IsToggled); textColumn.Title = "Name"; - var pixbufRenderer = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + var pixbufRenderer = new CellRendererPixbuf (); textColumn.PackStart (pixbufRenderer, false); textColumn.AddAttribute (pixbufRenderer, "pixbuf", Columns.IconOpened); textColumn.AddAttribute (pixbufRenderer, "pixbuf-expander-open", Columns.IconOpened); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs index c8c8814a71..f2c3ee7855 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs @@ -55,7 +55,6 @@ namespace MonoDevelop.Ide.Gui.Dialogs { List<TemplateItem> alltemplates = new List<TemplateItem> (); List<Category> categories = new List<Category> (); - Hashtable icons = new Hashtable (); Dictionary<string, bool> activeLangs = new Dictionary<string, bool> (); PixbufList cat_imglist; @@ -148,7 +147,6 @@ namespace MonoDevelop.Ide.Gui.Dialogs alltemplates.Clear (); categories.Clear (); catStore.Clear (); - icons.Clear (); activeLangs.Clear (); } @@ -271,10 +269,6 @@ namespace MonoDevelop.Ide.Gui.Dialogs project = parentProject; foreach (FileTemplate template in FileTemplate.GetFileTemplates (project, basePath)) { - if (template.Icon != null) { - icons[template.Icon] = 0; - // "create template icon" - } List<string> langs = template.GetCompatibleLanguages (project, basePath); if (langs != null) { foreach (string language in langs) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs index ffc912897c..c7f9d86c99 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs @@ -732,7 +732,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs { Model = templateStore; TreeViewColumn col = new TreeViewColumn (); - MonoDevelop.Core.Gui.CellRendererPixbuf crp = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + CellRendererIcon crp = new CellRendererIcon (); crp.StockSize = (uint) Gtk.IconSize.Dnd; crp.Ypad = 2; col.PackStart (crp, false); @@ -772,7 +772,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs { string name = GLib.Markup.EscapeText (templateItem.Name); if (!string.IsNullOrEmpty (templateItem.Template.LanguageName)) name += "\n<span foreground='darkgrey'><small>" + templateItem.Template.LanguageName + "</small></span>"; - templateStore.AppendValues (templateItem.Template.Icon ?? "md-project", name, templateItem.Template); + templateStore.AppendValues (templateItem.Template.Icon.IsNull ? "md-project" : templateItem.Template.Icon.ToString (), name, templateItem.Template); } public void Clear () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs index da9d5a6d60..9df731f4f8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs @@ -91,7 +91,7 @@ namespace MonoDevelop.Ide nameCol.PackStart (cbRenderer, false); nameCol.AddAttribute (cbRenderer, "active", colCheckedIndex); - MonoDevelop.Core.Gui.CellRendererPixbuf iconRenderer = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + CellRendererPixbuf iconRenderer = new CellRendererPixbuf (); nameCol.PackStart (iconRenderer, false); nameCol.AddAttribute (iconRenderer, "pixbuf", colIconIndex); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs index c152245bab..69709ea924 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs @@ -75,7 +75,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels TreeViewColumn col = new TreeViewColumn (); col.Title = GettextCatalog.GetString ("Command"); col.Spacing = 4; - MonoDevelop.Core.Gui.CellRendererPixbuf crp = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + CellRendererIcon crp = new CellRendererIcon (); col.PackStart (crp, false); col.AddAttribute (crp, "stock-id", iconCol); col.AddAttribute (crp, "visible", iconVisibleCol); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs index 2d54ad57b8..2000c9c0c4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using System.Text; +using MonoDevelop.Core; namespace MonoDevelop.Ide.Gui { @@ -41,9 +42,9 @@ namespace MonoDevelop.Ide.Gui { } - private string icon; + private IconId icon; private string title; - public AbstractPadContent (string title, string icon) + public AbstractPadContent (string title, IconId icon) { this.Id = GetType ().FullName; this.icon = icon; @@ -64,7 +65,7 @@ namespace MonoDevelop.Ide.Gui if (title != null) container.Title = title; - if (icon != null) + if (icon != IconId.Null) container.Icon = icon; window = container; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs index 9cdaea1857..ff847a4226 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs @@ -42,10 +42,10 @@ namespace MonoDevelop.Ide.Gui string title; MonoDevelopStatusBar.StatusIcon icon; - public BackgroundProgressMonitor (string title, string iconName) + public BackgroundProgressMonitor (string title, IconId iconName) { this.title = title; - if (!string.IsNullOrEmpty (iconName)) { + if (!iconName.IsNull) { Application.Invoke (delegate { Gdk.Pixbuf img = ImageService.GetPixbuf (iconName, Gtk.IconSize.Menu); icon = IdeApp.Workbench.StatusBar.ShowStatusIcon (img); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs index a462bf038e..48a3c21208 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs @@ -325,7 +325,7 @@ namespace MonoDevelop.Ide.Gui IPadWindow win = WorkbenchLayout.GetPadWindow (pad); if (pad.Label != null) win.Title = pad.Label; - if (pad.Icon != null) + if (!pad.Icon.IsNull) win.Icon = pad.Icon; } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs index 7950d8d0ca..51378591a7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs @@ -62,7 +62,7 @@ namespace MonoDevelop.Ide Gtk.TreeIter iter; if (treeviewPads.Selection.GetSelected (out iter)) { MonoDevelop.Ide.Gui.Pad pad = padListStore.GetValue (iter, 2) as MonoDevelop.Ide.Gui.Pad; - ShowType (ImageService.GetPixbuf (!string.IsNullOrEmpty (pad.Icon) ? pad.Icon : MonoDevelop.Core.Gui.Stock.MiscFiles, Gtk.IconSize.Dialog), + ShowType (ImageService.GetPixbuf (!pad.Icon.IsNull ? pad.Icon : MonoDevelop.Core.Gui.Stock.MiscFiles, Gtk.IconSize.Dialog), pad.Title, "", ""); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs index 212c1a801a..144f982f77 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs @@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Gui { string Id { get; } string Title { get; set; } - string Icon { get; set; } + IconId Icon { get; set; } bool Visible { get; set; } bool AutoHide { get; set; } bool ContentVisible { get; } @@ -60,7 +60,7 @@ namespace MonoDevelop.Ide.Gui internal class PadWindow: IPadWindow { string title; - string icon; + IconId icon; IPadContent content; PadCodon codon; IWorkbenchLayout layout; @@ -109,7 +109,7 @@ namespace MonoDevelop.Ide.Gui } } - public string Icon { + public IconId Icon { get { return icon; } set { icon = value; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Pad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Pad.cs index 0cc30096d4..8db2826575 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Pad.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Pad.cs @@ -33,6 +33,7 @@ using System.Collections.Generic; using System.Drawing; using MonoDevelop.Core.Gui; using MonoDevelop.Ide.Codons; +using MonoDevelop.Core; namespace MonoDevelop.Ide.Gui { @@ -62,7 +63,7 @@ namespace MonoDevelop.Ide.Gui get { return window.Title; } } - public string Icon { + public IconId Icon { get { return window.Icon; } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs index bd83d6b206..7c91fa28a3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs @@ -49,20 +49,20 @@ namespace MonoDevelop.Ide.Gui internal void Initialize () { - CreateMonitorPad (GettextCatalog.GetString ("Build Output"), MonoDevelop.Core.Gui.Stock.BuildCombine, false, true, false); + CreateMonitorPad (GettextCatalog.GetString ("Build Output"), Stock.BuildCombine, false, true, false); } public IProgressMonitor GetBuildProgressMonitor () { bool front = IdeApp.Preferences.ShowOutputPadDuringBuild == BuildResultStates.Always; - AggregatedProgressMonitor mon = new AggregatedProgressMonitor (GetOutputProgressMonitor (GettextCatalog.GetString ("Build Output"), MonoDevelop.Core.Gui.Stock.BuildCombine, front, true)); - mon.AddSlaveMonitor (GetStatusProgressMonitor (GettextCatalog.GetString ("Building..."), MonoDevelop.Core.Gui.Stock.BuildCombine, false)); + AggregatedProgressMonitor mon = new AggregatedProgressMonitor (GetOutputProgressMonitor (GettextCatalog.GetString ("Build Output"), Stock.BuildCombine, front, true)); + mon.AddSlaveMonitor (GetStatusProgressMonitor (GettextCatalog.GetString ("Building..."), Stock.BuildCombine, false)); return mon; } public IProgressMonitor GetRunProgressMonitor () { - return GetOutputProgressMonitor (GettextCatalog.GetString ("Application Output"), MonoDevelop.Core.Gui.Stock.RunProgramIcon, true, true); + return GetOutputProgressMonitor (GettextCatalog.GetString ("Application Output"), Stock.RunProgramIcon, true, true); } public IProgressMonitor GetLoadProgressMonitor (bool lockGui) @@ -77,28 +77,28 @@ namespace MonoDevelop.Ide.Gui public IConsole CreateConsole (bool closeOnDispose) { - return (IConsole) GetOutputProgressMonitor (GettextCatalog.GetString ("Application Output"), MonoDevelop.Core.Gui.Stock.RunProgramIcon, true, true); + return (IConsole) GetOutputProgressMonitor (GettextCatalog.GetString ("Application Output"), Stock.RunProgramIcon, true, true); } /******************************/ - public IProgressMonitor GetStatusProgressMonitor (string title, string icon, bool showErrorDialogs) + public IProgressMonitor GetStatusProgressMonitor (string title, IconId icon, bool showErrorDialogs) { return new StatusProgressMonitor (title, icon, showErrorDialogs, true, false); } - public IProgressMonitor GetStatusProgressMonitor (string title, string icon, bool showErrorDialogs, bool showTaskTitle, bool lockGui) + public IProgressMonitor GetStatusProgressMonitor (string title, IconId icon, bool showErrorDialogs, bool showTaskTitle, bool lockGui) { return new StatusProgressMonitor (title, icon, showErrorDialogs, showTaskTitle, lockGui); } - public IProgressMonitor GetBackgroundProgressMonitor (string title, string icon) + public IProgressMonitor GetBackgroundProgressMonitor (string title, IconId icon) { return new BackgroundProgressMonitor (title, icon); } - public IProgressMonitor GetOutputProgressMonitor (string title, string icon, bool bringToFront, bool allowMonitorReuse) + public IProgressMonitor GetOutputProgressMonitor (string title, IconId icon, bool bringToFront, bool allowMonitorReuse) { DefaultMonitorPad monitorPad = CreateMonitorPad (title, icon, bringToFront, allowMonitorReuse, true); return new OutputProgressMonitor (monitorPad, title, icon); @@ -108,7 +108,7 @@ namespace MonoDevelop.Ide.Gui { Pad pad = null; if (icon == null) - icon = MonoDevelop.Core.Gui.Stock.OutputIcon; + icon = Stock.OutputIcon; int instanceCount = -1; if (allowMonitorReuse) { @@ -205,7 +205,7 @@ namespace MonoDevelop.Ide.Gui SearchResultPad monitorPad = new SearchResultPad (instanceNum) { FocusPad = focusPad }; - pad = IdeApp.Workbench.ShowPad (monitorPad, newPadId, title, basePadId + "/Center Bottom", MonoDevelop.Core.Gui.Stock.FindIcon); + pad = IdeApp.Workbench.ShowPad (monitorPad, newPadId, title, basePadId + "/Center Bottom", Stock.FindIcon); pad.Sticky = true; searchMonitors.Add (pad); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs index 03181fc105..3254a4eea6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs @@ -704,7 +704,7 @@ namespace MonoDevelop.Ide.Gui Gtk.Image mimeimage = null; if (content.StockIconId != null ) { - mimeimage = new Gtk.Image (content.StockIconId, IconSize.Menu ); + mimeimage = new Gtk.Image ((IconId) content.StockIconId, IconSize.Menu ); } else if (content.IsUntitled && content.UntitledName == null) { mimeimage = new Gtk.Image (DesktopService.GetPixbufForType ("gnome-fs-regular", Gtk.IconSize.Menu)); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs index 4cbc71b727..846839ef12 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs @@ -589,7 +589,7 @@ namespace MonoDevelop.Ide.Gui try { if (content.StockIconId != null ) { - tabLabel.Icon = new Gtk.Image ( content.StockIconId, IconSize.Menu ); + tabLabel.Icon = new Gtk.Image ((IconId) content.StockIconId, IconSize.Menu ); } else if (content.ContentName != null && content.ContentName.IndexOfAny (new char[] { '*', '+'}) == -1) { tabLabel.Icon.Pixbuf = DesktopService.GetPixbufForFile (content.ContentName, Gtk.IconSize.Menu); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs index 588909432f..da18fd352a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs @@ -320,12 +320,12 @@ namespace MonoDevelop.Ide.Gui return WrapPad (content); } - public Pad AddPad (IPadContent padContent, string id, string label, string defaultPlacement, string icon) + public Pad AddPad (IPadContent padContent, string id, string label, string defaultPlacement, IconId icon) { return AddPad (new PadCodon (padContent, id, label, defaultPlacement, icon)); } - public Pad ShowPad (IPadContent padContent, string id, string label, string defaultPlacement, string icon) + public Pad ShowPad (IPadContent padContent, string id, string label, string defaultPlacement, IconId icon) { return ShowPad (new PadCodon (padContent, id, label, defaultPlacement, icon)); }
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs index 437c3823ed..48ebe081ba 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs @@ -75,7 +75,7 @@ namespace MonoDevelop.Ide.Templates } private string icon = String.Empty; - public string Icon + public IconId Icon { get { return icon; } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs index e0f713c60a..ca104dce73 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs @@ -84,7 +84,7 @@ namespace MonoDevelop.Ide.Templates } private string icon; - public string Icon + public IconId Icon { get { return icon; } } diff --git a/main/src/core/MonoDevelop.Projects.Gui/ChangeLog b/main/src/core/MonoDevelop.Projects.Gui/ChangeLog index 2e161d5dee..5540a476a7 100644 --- a/main/src/core/MonoDevelop.Projects.Gui/ChangeLog +++ b/main/src/core/MonoDevelop.Projects.Gui/ChangeLog @@ -1,3 +1,14 @@ +2010-02-18 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.Projects.Gui.Completion/CompletionData.cs: + * MonoDevelop.Projects.Gui.Completion/ICompletionData.cs: + * MonoDevelop.Projects.Gui.Completion/CompletionDataList.cs: + Use the new IconId type. + + * MonoDevelop.Projects.Gui.Dialogs/ProjectFileSelectorDialog.cs: + * MonoDevelop.Projects.Gui.Dialogs.OptionPanels/NamespaceSynchronisationPanel.cs: + Track api changes. + 2010-02-17 Mike Krüger <mkrueger@novell.com> * MonoDevelop.Projects.Gui.Completion/ListWidget.cs: diff --git a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionData.cs b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionData.cs index 0b9546d446..ca99e357f0 100644 --- a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionData.cs +++ b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionData.cs @@ -29,19 +29,20 @@ using System; using System.Collections.Generic; using System.Linq; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Gui.Completion { public abstract class CompletionCategory : IComparable<CompletionCategory> { public string DisplayText { get; set; } - public string Icon { get; set; } + public IconId Icon { get; set; } public CompletionCategory () { } - public CompletionCategory (string displayText, string icon) + public CompletionCategory (string displayText, IconId icon) { this.DisplayText = displayText; this.Icon = icon; @@ -54,10 +55,10 @@ namespace MonoDevelop.Projects.Gui.Completion { protected CompletionData () {} public CompletionData (string text) : this (text, null, null) {} - public CompletionData (string text, string icon) : this (text, icon, null) {} - public CompletionData (string text, string icon, string description) : this (text, icon, description, text) {} + public CompletionData (string text, IconId icon) : this (text, icon, null) {} + public CompletionData (string text, IconId icon, string description) : this (text, icon, description, text) {} - public CompletionData (string displayText, string icon, string description, string completionText) + public CompletionData (string displayText, IconId icon, string description, string completionText) { this.DisplayText = displayText; this.Icon = icon; @@ -65,7 +66,7 @@ namespace MonoDevelop.Projects.Gui.Completion this.CompletionText = completionText; } - public virtual string Icon { get; set; } + public virtual IconId Icon { get; set; } public virtual string DisplayText { get; set; } public virtual string Description { get; set; } public virtual string CompletionText { get; set; } diff --git a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionDataList.cs b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionDataList.cs index f5e7dcc5d8..9df8889fc9 100644 --- a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionDataList.cs +++ b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionDataList.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Linq; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Gui.Completion { @@ -94,21 +95,21 @@ namespace MonoDevelop.Projects.Gui.Completion return datum; } - public CompletionData Add (string text, string icon) + public CompletionData Add (string text, IconId icon) { CompletionData datum = new CompletionData (text, icon); Add (datum); return datum; } - public CompletionData Add (string text, string icon, string description) + public CompletionData Add (string text, IconId icon, string description) { CompletionData datum = new CompletionData (text, icon, description); Add (datum); return datum; } - public CompletionData Add (string displayText, string icon, string description, string completionText) + public CompletionData Add (string displayText, IconId icon, string description, string completionText) { CompletionData datum = new CompletionData (displayText, icon, description, completionText); Add (datum); diff --git a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/ICompletionData.cs b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/ICompletionData.cs index bed1200035..80b33befaf 100644 --- a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/ICompletionData.cs +++ b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/ICompletionData.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Gui.Completion { @@ -39,7 +40,7 @@ namespace MonoDevelop.Projects.Gui.Completion public interface ICompletionData { - string Icon { get; } + IconId Icon { get; } string DisplayText { get; } string Description { get; } string CompletionText { get; } diff --git a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/NamespaceSynchronisationPanel.cs b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/NamespaceSynchronisationPanel.cs index c5cfb215d3..ecb12eb86f 100644 --- a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/NamespaceSynchronisationPanel.cs +++ b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/NamespaceSynchronisationPanel.cs @@ -139,7 +139,7 @@ namespace MonoDevelop.Projects.Gui.Dialogs.OptionPanels TreeViewColumn dirCol = new TreeViewColumn (); dirCol.Title = GettextCatalog.GetString ("Directory"); - var iconRenderer = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + var iconRenderer = new CellRendererPixbuf (); CellRendererText textRenderer = new CellRendererText (); dirCol.PackStart (iconRenderer, false); dirCol.PackStart (textRenderer, false); diff --git a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/ProjectFileSelectorDialog.cs b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/ProjectFileSelectorDialog.cs index cdf4bf8099..16b1e30a9a 100644 --- a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/ProjectFileSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/ProjectFileSelectorDialog.cs @@ -67,7 +67,7 @@ namespace MonoDevelop.Projects.Gui.Dialogs TreeViewColumn projectCol = new TreeViewColumn (); projectCol.Title = GettextCatalog.GetString ("Project Folders"); - var pixRenderer = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + var pixRenderer = new CellRendererPixbuf (); CellRendererText txtRenderer = new CellRendererText (); projectCol.PackStart (pixRenderer, false); projectCol.PackStart (txtRenderer, true); @@ -84,7 +84,7 @@ namespace MonoDevelop.Projects.Gui.Dialogs projectTree.KeyPressEvent += ProjectListKeyPressEvent; TreeViewColumn fileCol = new TreeViewColumn (); - var filePixRenderer = new MonoDevelop.Core.Gui.CellRendererPixbuf (); + var filePixRenderer = new CellRendererPixbuf (); fileCol.Title = GettextCatalog.GetString ("Files"); fileCol.PackStart (filePixRenderer, false); fileCol.PackStart (txtRenderer, true); @@ -175,7 +175,7 @@ namespace MonoDevelop.Projects.Gui.Dialogs void PixDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) { - var pixRenderer = (MonoDevelop.Core.Gui.CellRendererPixbuf) cell; + var pixRenderer = (CellRendererPixbuf) cell; string dirname = (string) tree_model.GetValue (iter, 0); if (dirname.Length == 0) { diff --git a/main/src/core/MonoDevelop.Projects/ChangeLog b/main/src/core/MonoDevelop.Projects/ChangeLog index 87e13a0c2d..29cdf8ff73 100644 --- a/main/src/core/MonoDevelop.Projects/ChangeLog +++ b/main/src/core/MonoDevelop.Projects/ChangeLog @@ -1,3 +1,19 @@ +2010-02-18 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.Projects/Project.cs: + * MonoDevelop.Projects.Dom/DomType.cs: + * MonoDevelop.Projects.Dom/DomField.cs: + * MonoDevelop.Projects.Dom/DomEvent.cs: + * MonoDevelop.Projects.Dom/DomMethod.cs: + * MonoDevelop.Projects.Dom/Namespace.cs: + * MonoDevelop.Projects.Dom/DomProperty.cs: + * MonoDevelop.Projects.Dom/IBaseMember.cs: + * MonoDevelop.Projects.Dom/DomParameter.cs: + * MonoDevelop.Projects.Dom/LocalVariable.cs: + * MonoDevelop.Projects.Dom/AbstractMember.cs: + * MonoDevelop.Projects.Dom/DomMemberDecorator.cs: Use the new + IconId type. + 2010-02-16 Lluis Sanchez Gual <lluis@novell.com> * MonoDevelop.Projects/ProjectService.cs: diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/AbstractMember.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/AbstractMember.cs index 0f459fe7c7..0b0cf49b8b 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/AbstractMember.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/AbstractMember.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Linq; using MonoDevelop.Projects.Dom.Parser; using System.Collections.ObjectModel; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { @@ -209,7 +210,7 @@ namespace MonoDevelop.Projects.Dom get; } - public abstract string StockIcon { + public abstract IconId StockIcon { get; } diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomEvent.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomEvent.cs index 60dbe79dcb..8379134d53 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomEvent.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomEvent.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { @@ -94,8 +95,8 @@ namespace MonoDevelop.Projects.Dom } } - static readonly string[] iconTable = {Stock.Event, Stock.PrivateEvent, Stock.ProtectedEvent, Stock.InternalEvent}; - public override string StockIcon { + static readonly IconId[] iconTable = {Stock.Event, Stock.PrivateEvent, Stock.ProtectedEvent, Stock.InternalEvent}; + public override IconId StockIcon { get { return iconTable [ModifierToOffset (Modifiers)]; } diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomField.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomField.cs index b11257abb7..969a2e8949 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomField.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomField.cs @@ -27,6 +27,7 @@ // using System; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { @@ -44,9 +45,9 @@ namespace MonoDevelop.Projects.Dom } } - static readonly string[] iconTable = {Stock.Field, Stock.PrivateField, Stock.ProtectedField, Stock.InternalField}; + static readonly IconId[] iconTable = {Stock.Field, Stock.PrivateField, Stock.ProtectedField, Stock.InternalField}; - public override string StockIcon { + public override IconId StockIcon { get { return iconTable [ModifierToOffset (Modifiers)]; } diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomMemberDecorator.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomMemberDecorator.cs index ae9a975c2d..ab30f81972 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomMemberDecorator.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomMemberDecorator.cs @@ -30,6 +30,7 @@ using System; using System.Collections.Generic; using MonoDevelop.Projects.Dom.Parser; using System.Collections.ObjectModel; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { @@ -132,7 +133,7 @@ namespace MonoDevelop.Projects.Dom } } - public virtual string StockIcon { + public virtual IconId StockIcon { get { return member.StockIcon; } diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomMethod.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomMethod.cs index a80f66a195..84cb9971c4 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomMethod.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomMethod.cs @@ -32,6 +32,7 @@ using System.Collections.ObjectModel; using System.Text; using System.Xml; using MonoDevelop.Projects.Dom.Parser; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { @@ -143,9 +144,9 @@ namespace MonoDevelop.Projects.Dom } } - static readonly string[] iconTable = {Stock.Method, Stock.PrivateMethod, Stock.ProtectedMethod, Stock.InternalMethod}; - static readonly string[] extensionIconTable = {Stock.ExtensionMethod, Stock.PrivateExtensionMethod, Stock.ProtectedExtensionMethod, Stock.InternalExtensionMethod}; - public override string StockIcon { + static readonly IconId[] iconTable = {Stock.Method, Stock.PrivateMethod, Stock.ProtectedMethod, Stock.InternalMethod}; + static readonly IconId[] extensionIconTable = {Stock.ExtensionMethod, Stock.PrivateExtensionMethod, Stock.ProtectedExtensionMethod, Stock.InternalExtensionMethod}; + public override IconId StockIcon { get { if (WasExtended) return extensionIconTable [ModifierToOffset (Modifiers)]; diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomParameter.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomParameter.cs index 2ff1b08a90..2d0df35723 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomParameter.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomParameter.cs @@ -30,6 +30,7 @@ using System; using System.Linq; using System.CodeDom; using System.Collections.Generic; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { @@ -95,7 +96,7 @@ namespace MonoDevelop.Projects.Dom set; } - public virtual string StockIcon { + public virtual IconId StockIcon { get { return Stock.Field; } diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomProperty.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomProperty.cs index 6e77792b40..6289bb042e 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomProperty.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomProperty.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Text; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { @@ -105,9 +106,9 @@ namespace MonoDevelop.Projects.Dom } } - static readonly string[] iconTable = {Stock.Property, Stock.PrivateProperty, Stock.ProtectedProperty, Stock.InternalProperty}; + static readonly IconId[] iconTable = {Stock.Property, Stock.PrivateProperty, Stock.ProtectedProperty, Stock.InternalProperty}; - public override string StockIcon { + public override IconId StockIcon { get { return iconTable [ModifierToOffset (Modifiers)]; } diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomType.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomType.cs index 34b91cf22f..b5f8eca145 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomType.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomType.cs @@ -32,6 +32,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using MonoDevelop.Projects.Dom.Parser; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { @@ -264,7 +265,7 @@ namespace MonoDevelop.Projects.Dom } - static string[,] iconTable = new string[,] { + static IconId[,] iconTable = new IconId[,] { {Stock.Error, Stock.Error, Stock.Error, Stock.Error}, // unknown {Stock.Class, Stock.PrivateClass, Stock.ProtectedClass, Stock.InternalClass}, // class {Stock.Enum, Stock.PrivateEnum, Stock.ProtectedEnum, Stock.InternalEnum}, // enum @@ -279,7 +280,7 @@ namespace MonoDevelop.Projects.Dom } } - public override string StockIcon { + public override IconId StockIcon { get { return iconTable[(int)ClassType, ModifierToOffset (Modifiers)]; } @@ -859,51 +860,51 @@ namespace MonoDevelop.Projects.Dom internal sealed class Stock { - public static readonly string Error = "gtk-dialog-error"; - public static readonly string Class = "md-class"; - public static readonly string Enum = "md-enum"; - public static readonly string Event = "md-event"; - public static readonly string Field = "md-field"; - public static readonly string Interface = "md-interface"; - public static readonly string Method = "md-method"; - public static readonly string ExtensionMethod = "md-extensionmethod"; - public static readonly string Property = "md-property"; - public static readonly string Struct = "md-struct"; - public static readonly string Delegate = "md-delegate"; - public static readonly string Namespace = "md-name-space"; - - public static readonly string InternalClass = "md-internal-class"; - public static readonly string InternalDelegate = "md-internal-delegate"; - public static readonly string InternalEnum = "md-internal-enum"; - public static readonly string InternalEvent = "md-internal-event"; - public static readonly string InternalField = "md-internal-field"; - public static readonly string InternalInterface = "md-internal-interface"; - public static readonly string InternalMethod = "md-internal-method"; - public static readonly string InternalExtensionMethod = "md-internal-extensionmethod"; - public static readonly string InternalProperty = "md-internal-property"; - public static readonly string InternalStruct = "md-internal-struct"; - - public static readonly string PrivateClass = "md-private-class"; - public static readonly string PrivateDelegate = "md-private-delegate"; - public static readonly string PrivateEnum = "md-private-enum"; - public static readonly string PrivateEvent = "md-private-event"; - public static readonly string PrivateField = "md-private-field"; - public static readonly string PrivateInterface = "md-private-interface"; - public static readonly string PrivateMethod = "md-private-method"; - public static readonly string PrivateExtensionMethod = "md-private-extensionmethod"; - public static readonly string PrivateProperty = "md-private-property"; - public static readonly string PrivateStruct = "md-private-struct"; - - public static readonly string ProtectedClass = "md-protected-class"; - public static readonly string ProtectedDelegate = "md-protected-delegate"; - public static readonly string ProtectedEnum = "md-protected-enum"; - public static readonly string ProtectedEvent = "md-protected-event"; - public static readonly string ProtectedField = "md-protected-field"; - public static readonly string ProtectedInterface = "md-protected-interface"; - public static readonly string ProtectedMethod = "md-protected-method"; - public static readonly string ProtectedExtensionMethod = "md-protected-extensionmethod"; - public static readonly string ProtectedProperty = "md-protected-property"; - public static readonly string ProtectedStruct = "md-protected-struct"; + public static readonly IconId Error = "gtk-dialog-error"; + public static readonly IconId Class = "md-class"; + public static readonly IconId Enum = "md-enum"; + public static readonly IconId Event = "md-event"; + public static readonly IconId Field = "md-field"; + public static readonly IconId Interface = "md-interface"; + public static readonly IconId Method = "md-method"; + public static readonly IconId ExtensionMethod = "md-extensionmethod"; + public static readonly IconId Property = "md-property"; + public static readonly IconId Struct = "md-struct"; + public static readonly IconId Delegate = "md-delegate"; + public static readonly IconId Namespace = "md-name-space"; + + public static readonly IconId InternalClass = "md-internal-class"; + public static readonly IconId InternalDelegate = "md-internal-delegate"; + public static readonly IconId InternalEnum = "md-internal-enum"; + public static readonly IconId InternalEvent = "md-internal-event"; + public static readonly IconId InternalField = "md-internal-field"; + public static readonly IconId InternalInterface = "md-internal-interface"; + public static readonly IconId InternalMethod = "md-internal-method"; + public static readonly IconId InternalExtensionMethod = "md-internal-extensionmethod"; + public static readonly IconId InternalProperty = "md-internal-property"; + public static readonly IconId InternalStruct = "md-internal-struct"; + + public static readonly IconId PrivateClass = "md-private-class"; + public static readonly IconId PrivateDelegate = "md-private-delegate"; + public static readonly IconId PrivateEnum = "md-private-enum"; + public static readonly IconId PrivateEvent = "md-private-event"; + public static readonly IconId PrivateField = "md-private-field"; + public static readonly IconId PrivateInterface = "md-private-interface"; + public static readonly IconId PrivateMethod = "md-private-method"; + public static readonly IconId PrivateExtensionMethod = "md-private-extensionmethod"; + public static readonly IconId PrivateProperty = "md-private-property"; + public static readonly IconId PrivateStruct = "md-private-struct"; + + public static readonly IconId ProtectedClass = "md-protected-class"; + public static readonly IconId ProtectedDelegate = "md-protected-delegate"; + public static readonly IconId ProtectedEnum = "md-protected-enum"; + public static readonly IconId ProtectedEvent = "md-protected-event"; + public static readonly IconId ProtectedField = "md-protected-field"; + public static readonly IconId ProtectedInterface = "md-protected-interface"; + public static readonly IconId ProtectedMethod = "md-protected-method"; + public static readonly IconId ProtectedExtensionMethod = "md-protected-extensionmethod"; + public static readonly IconId ProtectedProperty = "md-protected-property"; + public static readonly IconId ProtectedStruct = "md-protected-struct"; } } diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/IBaseMember.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/IBaseMember.cs index 3b136f719f..84ae0af454 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/IBaseMember.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/IBaseMember.cs @@ -27,13 +27,14 @@ using System; using System.Collections.Generic; using MonoDevelop.Projects.Dom.Parser; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { public interface IBaseMember : INode { MemberType MemberType { get; } string Name { get; } - string StockIcon { get; } + IconId StockIcon { get; } DomLocation Location { get; } IReturnType ReturnType { get; } } diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/LocalVariable.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/LocalVariable.cs index 268a716da4..99e5d5f64c 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/LocalVariable.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/LocalVariable.cs @@ -29,6 +29,7 @@ using System; using System.Collections; using System.Collections.Specialized; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { @@ -49,7 +50,7 @@ namespace MonoDevelop.Projects.Dom set; } - public string StockIcon { + public IconId StockIcon { get { return Stock.Field; } diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/Namespace.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/Namespace.cs index fe467aeb9b..3e05da2f89 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/Namespace.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/Namespace.cs @@ -27,6 +27,7 @@ // using System; +using MonoDevelop.Core; namespace MonoDevelop.Projects.Dom { @@ -81,7 +82,7 @@ namespace MonoDevelop.Projects.Dom } } - public override string StockIcon { + public override IconId StockIcon { get { return Stock.Namespace; } diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/Project.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/Project.cs index e557025d9a..2f5239aba3 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/Project.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/Project.cs @@ -98,8 +98,8 @@ namespace MonoDevelop.Projects get; } - string stockIcon = "md-project"; - public virtual string StockIcon { + IconId stockIcon = "md-project"; + public virtual IconId StockIcon { get { return stockIcon; } set { this.stockIcon = value; } } |