Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules2
m---------main/external/fsharpbinding14
-rw-r--r--main/src/addins/AspNet/Execution/XspOptionsPanel.cs4
-rw-r--r--main/src/addins/CBinding/Gui/CTextEditorExtension.cs2
-rw-r--r--main/src/addins/CBinding/Gui/CodeGenerationPanel.cs2
-rw-r--r--main/src/addins/CBinding/Gui/CompilerPanel.cs3
-rw-r--r--main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs3
-rw-r--r--main/src/addins/CBinding/Gui/OutputOptionsPanel.cs3
-rw-r--r--main/src/addins/CBinding/Navigation/LanguageItemCommandHandler.cs4
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs4
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs3
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionData.cs2
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanel.cs4
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs4
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs2
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CodeGenerationPanel.cs4
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs3
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CodeGenerationService.cs2
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/LanguageItemTooltipProvider.cs2
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/DeclaredSymbolInfo.cs4
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/PathedDocumentTextEditorExtension.cs2
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/ProjectSearchCategory.cs13
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/generated.cs5
-rw-r--r--main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs2
-rw-r--r--main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs9
-rw-r--r--main/src/addins/ChangeLogAddIn/ProjectOptionPanel.cs4
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanel.cs4
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopView.cs12
-rw-r--r--main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs3
-rw-r--r--main/src/addins/MacPlatform/MacInterop/ProcessManager.cs5
-rw-r--r--main/src/addins/MacPlatform/MacPlatform.cs23
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserNavigationPoint.cs5
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs21
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DisplayBinding.cs6
-rw-r--r--main/src/addins/MonoDevelop.Autotools/MakefileOptionPanel.cs4
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs21
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs8
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs9
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs6
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs13
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs20
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs47
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs40
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs2
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs9
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs13
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs7
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs69
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OptionsPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/RulesPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogEditorView.cs20
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs4
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs5
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs14
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs7
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs77
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs4
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs31
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs6
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs4
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/Buffer.cs11
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/DisplayBinding.cs2
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs7
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs3
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesSearchCategory.cs2
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs1
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/AnalysisOptionsPanel.cs3
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs3
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs2
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs2
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/Commands.cs25
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs3
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs3
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs3
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs3
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs3
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs2
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs3
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs5
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj5
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs2
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs4
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs9
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/LanguageItemWindow.cs2
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs77
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/SmartTagMarker.cs7
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic1
-rw-r--r--main/src/addins/NUnit/Gui/TestPad.cs12
-rw-r--r--main/src/addins/NUnit/Gui/TestResultsPad.cs20
-rw-r--r--main/src/addins/VBNetBinding/Gui/ConfigurationOptionsPanel.cs3
-rw-r--r--main/src/addins/VBNetBinding/Gui/ImportsOptionsPanel.cs3
-rw-r--r--main/src/addins/VBNetBinding/Gui/ProjectOptionsPanel.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/CredentialsDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanel.cs3
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanelWidget.cs6
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs20
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/MergeDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlGeneralOptionsPanel.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlSolutionOptionsPanel.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BaseView.cs105
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameView.cs18
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs18
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs7
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DropDownBox.cs8
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs26
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs14
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeView.cs20
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs11
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs13
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/BlameCommand.cs7
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultBlameViewHandler.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultDiffViewHandler.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultLogViewHandler.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultMergeViewHandler.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DiffCommand.cs7
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IVersionControlViewHandler.cs25
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LogCommand.cs11
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/MergeCommand.cs7
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ResolveConflictsCommand.cs5
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs140
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml8
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/GdkWin32.cs6
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs2
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs5
-rw-r--r--main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs2
-rw-r--r--main/src/addins/Xml/Editor/XmlEditorOptionsPanel.cs6
-rw-r--r--main/src/addins/Xml/Editor/XmlSchemasPanel.cs4
-rw-r--r--main/src/addins/Xml/Formatting/XmlFormattingPolicyPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Core/CoreExtensions.cs (renamed from main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractAttachableViewContent.cs)43
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs115
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj1
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/MimeTypes.addin.xml3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkNotebookResult.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Axis.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs143
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Serie.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntry.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntrySet.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandFrame.cs37
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs136
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandRouterContainer.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToggleToolButton.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolbar.cs79
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/KeyBindingManager.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/LinkCommandEntry.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/MenuToolButton.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/ArrowWindow.cs136
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockGrip.cs72
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbar.cs410
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrame.cs397
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameLayout.cs42
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameStatus.cs45
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPanel.cs1034
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPosition.cs52
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarStatus.cs71
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockedPosition.cs81
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FixedPanel.cs270
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingDock.cs65
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingPosition.cs75
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/IDockBar.cs37
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/PlaceholderWindow.cs55
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroupItem.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs66
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs22
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemToolbar.cs94
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockPositionType.cs (renamed from main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IAttachableViewContent.cs)33
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/PlatformDialog.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/CommandSearchCategory.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FileSearchCategory.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ResultsDataSource.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchResult.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/Theme.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeContext.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeEngine.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ButtonEvent.cs (renamed from main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISupportsProjectReload.cs)79
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenu.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItemCollection.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs98
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Dialog.cs (renamed from main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IBaseViewContent.cs)53
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs21
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs59
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs35
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs17
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextSegmentMarker.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedTooltipProvider.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs29
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorDisplayBinding.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs253
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs13
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPathedDocument.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IOptionsPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsDialog.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsDialog.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs45
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs28
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TaskListPad.cs26
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs99
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs92
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BaseViewContent.cs167
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs82
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs82
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs86
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentView.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/FileViewer.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs24
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IDisplayBinding.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IViewContent.cs66
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IWorkbenchWindow.cs20
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs49
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadFontChanger.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs88
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs (renamed from main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractViewContent.cs)84
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs140
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchMemento.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationPoint.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanelWidget.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineBuildOptions.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineInformationPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CommonAssemblySigningPreferences.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/OutputOptionsPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RunOptionsPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RuntimeOptionsPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/StartupOptionsPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/CombineOptionsDialog.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectOptionsDialog.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ITaskListView.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/PropertyDescriptionTemplate.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TopLevelWidgetExtension.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs21
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/IWelcomePageProvider.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageOptionPanel.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj30
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs20
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic4
-rw-r--r--main/src/tools/mdmonitor/InstrumentationChartView.cs (renamed from main/src/tools/mdmonitor/InstrumenationChartView.cs)155
-rw-r--r--main/src/tools/mdmonitor/InstrumentationViewerDialog.cs16
-rw-r--r--main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs (renamed from main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumenationChartView.cs)2
-rw-r--r--main/src/tools/mdmonitor/gtk-gui/gui.stetic239
-rw-r--r--main/src/tools/mdmonitor/mdmonitor.csproj4
-rw-r--r--main/tests/MonoDevelop.CSharpBinding.Tests/Features/CodeCompletion/NR6/MiscTests.cs32
-rw-r--r--main/tests/MonoDevelop.CSharpBinding.Tests/Features/CodeCompletion/PortedRoslynTests/CompletionTestBase.cs6
-rw-r--r--main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding.Tests.csproj7
-rw-r--r--main/tests/UnitTests/MonoDevelop.CSharpBinding/TestViewContent.cs36
-rw-r--r--main/tests/UnitTests/MonoDevelop.CSharpBinding/TestWorkbenchWindow.cs18
-rw-r--r--main/tests/UnitTests/MonoDevelop.Ide.Templates/TestableWizardPage.cs2
369 files changed, 2757 insertions, 5415 deletions
diff --git a/.gitmodules b/.gitmodules
index deba29fb13..f066d8f50d 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -26,7 +26,7 @@
url = git://github.com/mono/guiunit.git
[submodule "main/external/fsharpbinding"]
path = main/external/fsharpbinding
- url = https://github.com/fsharp/xamarin-monodevelop-fsharp-addin.git
+ url = git://github.com/fsharp/xamarin-monodevelop-fsharp-addin.git
branch = master
[submodule "main/external/nuget-binary"]
path = main/external/nuget-binary
diff --git a/main/external/fsharpbinding b/main/external/fsharpbinding
-Subproject 431a89bcdc7467c6e4ba98ce04a73798ab41c4d
+Subproject 7dd3ccb3e4f4dd9932037ede8db6358742816ee
diff --git a/main/src/addins/AspNet/Execution/XspOptionsPanel.cs b/main/src/addins/AspNet/Execution/XspOptionsPanel.cs
index eea37579a5..5a97bb0c15 100644
--- a/main/src/addins/AspNet/Execution/XspOptionsPanel.cs
+++ b/main/src/addins/AspNet/Execution/XspOptionsPanel.cs
@@ -29,7 +29,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.AspNet.Projects;
@@ -39,7 +39,7 @@ namespace MonoDevelop.AspNet.Execution
{
XspOptionsPanelWidget panel;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return panel = new XspOptionsPanelWidget (ConfiguredProject.GetService<AspNetAppProjectFlavor> ());
}
diff --git a/main/src/addins/CBinding/Gui/CTextEditorExtension.cs b/main/src/addins/CBinding/Gui/CTextEditorExtension.cs
index f31b43b900..4faec18e12 100644
--- a/main/src/addins/CBinding/Gui/CTextEditorExtension.cs
+++ b/main/src/addins/CBinding/Gui/CTextEditorExtension.cs
@@ -645,7 +645,7 @@ namespace CBinding
public event EventHandler<DocumentPathChangedEventArgs> PathChanged;
- public Gtk.Widget CreatePathWidget (int index)
+ public Control CreatePathWidget (int index)
{
PathEntry[] path = CurrentPath;
if (null == path || 0 > index || path.Length <= index) {
diff --git a/main/src/addins/CBinding/Gui/CodeGenerationPanel.cs b/main/src/addins/CBinding/Gui/CodeGenerationPanel.cs
index 6740df3b2e..d67cb97309 100644
--- a/main/src/addins/CBinding/Gui/CodeGenerationPanel.cs
+++ b/main/src/addins/CBinding/Gui/CodeGenerationPanel.cs
@@ -351,7 +351,7 @@ namespace CBinding
{
private CodeGenerationPanel panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return panel = new CodeGenerationPanel ();
}
diff --git a/main/src/addins/CBinding/Gui/CompilerPanel.cs b/main/src/addins/CBinding/Gui/CompilerPanel.cs
index 4beaa0e61a..ef7c6a283c 100644
--- a/main/src/addins/CBinding/Gui/CompilerPanel.cs
+++ b/main/src/addins/CBinding/Gui/CompilerPanel.cs
@@ -32,6 +32,7 @@
using System;
using Mono.Addins;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide;
@@ -114,7 +115,7 @@ namespace CBinding
{
CompilerPanel panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return panel = new CompilerPanel ((CProject)ConfiguredProject);
}
diff --git a/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs b/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs
index 5187231f59..2547577a97 100644
--- a/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs
+++ b/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs
@@ -34,6 +34,7 @@ using System.Collections.Generic;
using Mono.Addins;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Components;
@@ -184,7 +185,7 @@ namespace CBinding
{
private GeneralOptionsPanel panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new GeneralOptionsPanel ();
return panel;
diff --git a/main/src/addins/CBinding/Gui/OutputOptionsPanel.cs b/main/src/addins/CBinding/Gui/OutputOptionsPanel.cs
index cfa9fead06..f90f629a30 100644
--- a/main/src/addins/CBinding/Gui/OutputOptionsPanel.cs
+++ b/main/src/addins/CBinding/Gui/OutputOptionsPanel.cs
@@ -33,6 +33,7 @@ using System;
using Mono.Addins;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Projects;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -93,7 +94,7 @@ namespace CBinding
{
private OutputOptionsPanel panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return panel = new OutputOptionsPanel ();
}
diff --git a/main/src/addins/CBinding/Navigation/LanguageItemCommandHandler.cs b/main/src/addins/CBinding/Navigation/LanguageItemCommandHandler.cs
index 7c25253644..f2a98b2ccd 100644
--- a/main/src/addins/CBinding/Navigation/LanguageItemCommandHandler.cs
+++ b/main/src/addins/CBinding/Navigation/LanguageItemCommandHandler.cs
@@ -39,10 +39,10 @@ namespace CBinding.Navigation
{
public class LanguageItemCommandHandler : NodeCommandHandler
{
- public override void ActivateItem ()
+ public override async void ActivateItem ()
{
LanguageItem item = (LanguageItem)CurrentNode.DataItem;
- Document doc = IdeApp.Workbench.OpenDocument (item.File);
+ Document doc = await IdeApp.Workbench.OpenDocument (item.File);
//bool isMacro = item is Macro;
doc.Editor.CaretLocation = new DocumentLocation ((int)item.Line, 1); // TODO: get column?
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs
index c6a67ccadc..600d197bab 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs
@@ -134,10 +134,10 @@ namespace MonoDevelop.CodeGeneration
GetSize (out w, out h);
int myMonitor = Screen.GetMonitorAtPoint (x, y);
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, myMonitor);
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, myMonitor);
if (x + w > geometry.Right)
- x = geometry.Right - w;
+ x = (int)geometry.Right - w;
if (y + h > geometry.Bottom)
y = y - completionContext.TriggerTextHeight - h;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs
index 201f1e6259..dd615e9c8c 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs
@@ -75,8 +75,7 @@ namespace MonoDevelop.CSharp.Completion
ISymbolCompletionData ICompletionDataFactory.CreateEnumMemberCompletionData (ICompletionDataKeyHandler keyHandler, ISymbol alias, IFieldSymbol field)
{
- var model = ext.ParsedDocument.GetAst<SemanticModel> ();
- return new RoslynSymbolCompletionData (keyHandler, this, field, RoslynCompletionData.SafeMinimalDisplayString (alias ?? field.Type, model, ext.Editor.CaretOffset, Ambience.NameFormat) + "." + field.Name);
+ return new RoslynSymbolCompletionData (keyHandler, this, field, RoslynCompletionData.SafeMinimalDisplayString (alias ?? field.Type, semanticModel, ext.Editor.CaretOffset, Ambience.NameFormat) + "." + field.Name);
}
class FormatItemCompletionData : RoslynCompletionData
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionData.cs
index 0ff1c133b9..719c867cf6 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionData.cs
@@ -77,7 +77,7 @@ namespace MonoDevelop.CSharp.Completion
return symbol.ToMinimalDisplayString (semanticModel, position, format);
} catch (ArgumentOutOfRangeException) {
try {
- return symbol.ToMinimalDisplayString (semanticModel, 0, format);
+ return symbol.ToMinimalDisplayString (semanticModel, semanticModel.SyntaxTree.Length / 2, format);
} catch (ArgumentOutOfRangeException) {
return symbol.Name;
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanel.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanel.cs
index e91a6242ba..b71b916792 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanel.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanel.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
using MonoDevelop.Ide.Gui.Dialogs;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Editor;
@@ -47,7 +47,7 @@ namespace MonoDevelop.CSharp.Diagnostics.InconsistentNaming
}
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new NameConventionPanelWidget ();
panel.PolicyChanged += delegate {
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs
index 194a3d9cd5..8cff36c94c 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs
@@ -24,7 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Editor;
@@ -41,7 +41,7 @@ namespace MonoDevelop.CSharp.Formatting
TextEditorDisplayBinding.InitSourceEditor ();
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return panel = new CSharpFormattingPolicyPanelWidget ();
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs
index e23c050f4c..7aa90ca04e 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs
@@ -37,7 +37,7 @@ using MonoDevelop.Ide.Gui.Content;
namespace MonoDevelop.CSharp.Formatting
{
- partial class CSharpFormattingProfileDialog : Dialog
+ partial class CSharpFormattingProfileDialog : Gtk.Dialog
{
readonly TextEditor texteditor = TextEditorFactory.CreateNewEditor ();
readonly CSharpFormattingPolicy profile;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CodeGenerationPanel.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CodeGenerationPanel.cs
index dfd6150b41..46f4287f6d 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CodeGenerationPanel.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CodeGenerationPanel.cs
@@ -27,8 +27,8 @@
//
using System;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
-using Gtk;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.CSharp.Project
@@ -118,7 +118,7 @@ namespace MonoDevelop.CSharp.Project
{
CodeGenerationPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new CodeGenerationPanelWidget ();
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs
index dcbddc3bf8..26ebd30cca 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs
@@ -30,6 +30,7 @@
using System;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Projects.Text;
@@ -230,7 +231,7 @@ namespace MonoDevelop.CSharp.Project
{
CompilerOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new CompilerOptionsPanelWidget ((DotNetProject) ConfiguredProject));
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CodeGenerationService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CodeGenerationService.cs
index 2485deb991..b4d271ca03 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CodeGenerationService.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CodeGenerationService.cs
@@ -157,7 +157,7 @@ namespace MonoDevelop.Refactoring
if (systemVoid != null) newMember = newMember.ReplaceNode (systemVoid, SyntaxFactory.ParseTypeName ("void"));
var newRoot = root.ReplaceNode (typeDecl, typeDecl.AddMembers ((MemberDeclarationSyntax)newMember.WithAdditionalAnnotations (Simplifier.Annotation, Formatter.Annotation, insertedMemberAnnotation)));
- var doc = IdeApp.Workbench.OpenDocument (part.SourceTree.FilePath, project, true);
+ var doc = await IdeApp.Workbench.OpenDocument (part.SourceTree.FilePath, project, true);
var policy = project.Policies.Get<CSharpFormattingPolicy> ("text/x-csharp");
var textPolicy = project.Policies.Get<TextStylePolicy> ("text/x-csharp");
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/LanguageItemTooltipProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/LanguageItemTooltipProvider.cs
index 5e79b19167..3a8919db6e 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/LanguageItemTooltipProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/LanguageItemTooltipProvider.cs
@@ -99,7 +99,7 @@ namespace MonoDevelop.SourceEditor
#endregion
- public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Gdk.ModifierType modifierState)
+ public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
{
var doc = ctx;
if (doc == null)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/DeclaredSymbolInfo.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/DeclaredSymbolInfo.cs
index a2d1795510..7f4ae78def 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/DeclaredSymbolInfo.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/DeclaredSymbolInfo.cs
@@ -526,9 +526,9 @@ namespace MonoDevelop.CSharp
}
}
- public override string GetMarkupText (Widget widget)
+ public override string GetMarkupText ()
{
- return HighlightMatch (widget, useFullName ? type.FullyQualifiedContainerName : type.Name, match);
+ return HighlightMatch (useFullName ? type.FullyQualifiedContainerName : type.Name, match);
}
public DeclaredSymbolInfoResult (string match, string matchedString, int rank, DeclaredSymbolInfo type, bool useFullName) : base (match, matchedString, rank)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/PathedDocumentTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/PathedDocumentTextEditorExtension.cs
index 33eda94c5a..4a13d0bebc 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/PathedDocumentTextEditorExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/PathedDocumentTextEditorExtension.cs
@@ -587,7 +587,7 @@ namespace MonoDevelop.CSharp
}
- public Gtk.Widget CreatePathWidget (int index)
+ public Control CreatePathWidget (int index)
{
PathEntry[] path = CurrentPath;
if (path == null || index < 0 || index >= path.Length)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ProjectSearchCategory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ProjectSearchCategory.cs
index c2fad9207e..1f9dc59005 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ProjectSearchCategory.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ProjectSearchCategory.cs
@@ -68,8 +68,7 @@ namespace MonoDevelop.CSharp
public override void Initialize (Components.PopoverWindow popupWindow)
{
- widget = popupWindow;
- lastResult = new WorkerResult (popupWindow);
+ lastResult = new WorkerResult ();
}
internal static Task<SymbolCache> SymbolInfoTask;
@@ -102,7 +101,7 @@ namespace MonoDevelop.CSharp
}
}
symbolInfoTokenSrc = new CancellationTokenSource();
- lastResult = new WorkerResult (widget);
+ lastResult = new WorkerResult ();
SymbolInfoTask = null;
}
@@ -265,7 +264,7 @@ namespace MonoDevelop.CSharp
if (searchPattern.Tag != null && !(typeTags.Contains (searchPattern.Tag) || memberTags.Contains (searchPattern.Tag)) || searchPattern.HasLineNumber)
return null;
try {
- var newResult = new WorkerResult (widget);
+ var newResult = new WorkerResult ();
newResult.pattern = searchPattern.Pattern;
newResult.Tag = searchPattern.Tag;
List<DeclaredSymbolInfo> allTypes;
@@ -278,7 +277,7 @@ namespace MonoDevelop.CSharp
newResult.FullSearch = toMatch.IndexOf ('.') > 0;
var oldLastResult = lastResult;
if (newResult.FullSearch && oldLastResult != null && !oldLastResult.FullSearch)
- oldLastResult = new WorkerResult (widget);
+ oldLastResult = new WorkerResult ();
// var now = DateTime.Now;
AllResults (searchResultCallback, oldLastResult, newResult, allTypes, token);
@@ -382,9 +381,9 @@ namespace MonoDevelop.CSharp
public bool FullSearch;
public StringMatcher matcher;
- public WorkerResult (Widget widget)
+ public WorkerResult ()
{
- results = new ResultsDataSource (widget);
+ results = new ResultsDataSource ();
}
internal SearchResult CheckType (DeclaredSymbolInfo symbol)
diff --git a/main/src/addins/CSharpBinding/gtk-gui/generated.cs b/main/src/addins/CSharpBinding/gtk-gui/generated.cs
index 3285e87c05..aec72da2fc 100644
--- a/main/src/addins/CSharpBinding/gtk-gui/generated.cs
+++ b/main/src/addins/CSharpBinding/gtk-gui/generated.cs
@@ -6,9 +6,10 @@ namespace Stetic
{
private static bool initialized;
- internal static void Initialize (Gtk.Widget iconRenderer)
+ internal static void Initialize(Gtk.Widget iconRenderer)
{
- if ((Stetic.Gui.initialized == false)) {
+ if ((Stetic.Gui.initialized == false))
+ {
Stetic.Gui.initialized = true;
}
}
diff --git a/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs b/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs
index 9b96e905d6..46985bc20e 100644
--- a/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs
+++ b/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs
@@ -35,7 +35,7 @@ using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.ChangeLogAddIn
{
- partial class AddLogEntryDialog : Dialog
+ partial class AddLogEntryDialog : Gtk.Dialog
{
readonly ListStore store;
readonly Dictionary<ChangeLogEntry, string> changes = new Dictionary<ChangeLogEntry, string> ();
diff --git a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs
index 5bfcd63773..4b6aefb313 100644
--- a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs
+++ b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs
@@ -36,6 +36,7 @@ using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Gui.Pads.ProjectPad;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
namespace MonoDevelop.ChangeLogAddIn
{
@@ -46,9 +47,9 @@ namespace MonoDevelop.ChangeLogAddIn
public class InsertEntryHandler : CommandHandler
{
- protected override void Run()
+ protected override async void Run()
{
- Document document = GetActiveChangeLogDocument();
+ Document document = await GetActiveChangeLogDocument();
if (document == null) return;
if (InsertHeader(document))
@@ -145,7 +146,7 @@ namespace MonoDevelop.ChangeLogAddIn
return text.IndexOf (eol + eol, StringComparison.Ordinal);
}
- static Document GetActiveChangeLogDocument()
+ static async Task<Document> GetActiveChangeLogDocument()
{
string file = GetSelectedFile ();
if (file == null)
@@ -160,7 +161,7 @@ namespace MonoDevelop.ChangeLogAddIn
return null;
if (File.Exists (clog))
- return IdeApp.Workbench.OpenDocument (clog, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ return await IdeApp.Workbench.OpenDocument (clog, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
Document document = IdeApp.Workbench.NewDocument (clog, "text/plain", "");
document.Save();
diff --git a/main/src/addins/ChangeLogAddIn/ProjectOptionPanel.cs b/main/src/addins/ChangeLogAddIn/ProjectOptionPanel.cs
index 12a02a3337..43acbf321f 100644
--- a/main/src/addins/ChangeLogAddIn/ProjectOptionPanel.cs
+++ b/main/src/addins/ChangeLogAddIn/ProjectOptionPanel.cs
@@ -25,7 +25,7 @@
//
//
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -36,7 +36,7 @@ namespace MonoDevelop.ChangeLogAddIn
{
ProjectOptionPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new ProjectOptionPanelWidget (this);
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanel.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanel.cs
index 6b9f1f7555..64a564bcff 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanel.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanel.cs
@@ -1,5 +1,5 @@
-
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -13,7 +13,7 @@ namespace MonoDevelop.Deployment.Linux
{
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new BasicOptionPanelWidget ((Project) ConfiguredSolutionItem, false));
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs
index 1b33518c28..c965434b68 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs
@@ -16,7 +16,7 @@ namespace MonoDevelop.Deployment.Linux
|| (mimeType != null && mimeType == "application/x-desktop");
}
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
{
return new DotDesktopView ();
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopView.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopView.cs
index 73d0cad10f..6a3e10d45d 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopView.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopView.cs
@@ -1,10 +1,12 @@
using System;
+using MonoDevelop.Components;
+using System.Threading.Tasks;
using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Deployment.Linux
{
- public class DotDesktopView: AbstractViewContent
+ public class DotDesktopView: ViewContent
{
DotDesktopViewWidget widget;
DesktopEntry entry;
@@ -25,20 +27,22 @@ namespace MonoDevelop.Deployment.Linux
}
}
- public override void Load (FileOpenInformation fileOpenInformation)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
ContentName = fileOpenInformation.FileName;
entry.Load (fileOpenInformation.FileName);
widget.DesktopEntry = entry;
+ return Task.FromResult (true);
}
- public override void Save (FileSaveInformation fileSaveInformation)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
entry.Save (fileSaveInformation.FileName);
IsDirty = false;
+ return Task.FromResult (true);
}
- public override Gtk.Widget Control {
+ public override Control Control {
get { return widget; }
}
}
diff --git a/main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs b/main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs
index 9bf943be95..e4fa67756f 100644
--- a/main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs
+++ b/main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using Gtk;
@@ -67,7 +68,7 @@ namespace ILAsmBinding
{
CompilerParametersPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new CompilerParametersPanelWidget ();
}
diff --git a/main/src/addins/MacPlatform/MacInterop/ProcessManager.cs b/main/src/addins/MacPlatform/MacInterop/ProcessManager.cs
index 2f2cb30610..1de2daa783 100644
--- a/main/src/addins/MacPlatform/MacInterop/ProcessManager.cs
+++ b/main/src/addins/MacPlatform/MacInterop/ProcessManager.cs
@@ -64,6 +64,11 @@ namespace MonoDevelop.MacInterop
return runningApp.Terminate ();
}
+ public static bool IsRunning (int pid)
+ {
+ return NSRunningApplication.GetRunningApplication (pid) != null;
+ }
+
enum OSStatus
{
Ok = 0
diff --git a/main/src/addins/MacPlatform/MacPlatform.cs b/main/src/addins/MacPlatform/MacPlatform.cs
index 94a3af42e2..1cf4ed3cdf 100644
--- a/main/src/addins/MacPlatform/MacPlatform.cs
+++ b/main/src/addins/MacPlatform/MacPlatform.cs
@@ -67,10 +67,6 @@ namespace MonoDevelop.MacIntegration
public MacPlatformService ()
{
- string safe64 = Environment.GetEnvironmentVariable ("MONODEVELOP_64BIT_SAFE");
- if (string.IsNullOrEmpty (safe64) && IntPtr.Size == 8)
- throw new Exception ("Mac integration is not yet 64-bit safe");
-
if (initedGlobal)
throw new Exception ("Only one MacPlatformService instance allowed");
initedGlobal = true;
@@ -636,11 +632,12 @@ namespace MonoDevelop.MacIntegration
}
}
- public override Gdk.Rectangle GetUsableMonitorGeometry (Gdk.Screen screen, int monitor)
+ public override Xwt.Rectangle GetUsableMonitorGeometry (int screenNumber, int monitorNumber)
{
- Gdk.Rectangle ygeometry = screen.GetMonitorGeometry (monitor);
+ var screen = Gdk.Display.Default.GetScreen (screenNumber);
+ Gdk.Rectangle ygeometry = screen.GetMonitorGeometry (monitorNumber);
Gdk.Rectangle xgeometry = screen.GetMonitorGeometry (0);
- NSScreen nss = NSScreen.Screens[monitor];
+ NSScreen nss = NSScreen.Screens[monitorNumber];
var visible = nss.VisibleFrame;
var frame = nss.Frame;
@@ -672,10 +669,10 @@ namespace MonoDevelop.MacIntegration
width = NMath.Min (visible.Width, frame.Width);
x = NMath.Max (visible.X, frame.X);
- return new Gdk.Rectangle ((int) x, (int) y, (int) width, (int) height);
+ return new Xwt.Rectangle ((int) x, (int) y, (int) width, (int) height);
}
- public override void GrabDesktopFocus (Gtk.Window window)
+ internal override void GrabDesktopFocus (Gtk.Window window)
{
window.Present ();
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
@@ -763,7 +760,7 @@ namespace MonoDevelop.MacIntegration
return new FdoRecentFiles (UserProfile.Current.LocalConfigDir.Combine ("RecentlyUsed.xml"));
}
- public override bool GetIsFullscreen (Gtk.Window window)
+ public override bool GetIsFullscreen (Window window)
{
if (MacSystemInformation.OsVersion < MacSystemInformation.Lion) {
return base.GetIsFullscreen (window);
@@ -773,7 +770,7 @@ namespace MonoDevelop.MacIntegration
return (nswin.StyleMask & NSWindowStyle.FullScreenWindow) != 0;
}
- public override void SetIsFullscreen (Gtk.Window window, bool isFullscreen)
+ public override void SetIsFullscreen (Window window, bool isFullscreen)
{
if (MacSystemInformation.OsVersion < MacSystemInformation.Lion) {
base.SetIsFullscreen (window, isFullscreen);
@@ -793,7 +790,7 @@ namespace MonoDevelop.MacIntegration
return toplevels.Any (t => (t.Value != null && t.Value.Modal && t.Value.Visible) || (t.Key.IsVisible && (t.Key is NSPanel)));
}
- public override void AddChildWindow (Gtk.Window parent, Gtk.Window child)
+ internal override void AddChildWindow (Gtk.Window parent, Gtk.Window child)
{
NSWindow w = GtkQuartz.GetWindow (parent);
child.Realize ();
@@ -802,7 +799,7 @@ namespace MonoDevelop.MacIntegration
w.AddChildWindow (overlay, NSWindowOrderingMode.Above);
}
- public override void PlaceWindow (Gtk.Window window, int x, int y, int width, int height)
+ internal override void PlaceWindow (Gtk.Window window, int x, int y, int width, int height)
{
if (window.GdkWindow == null)
return; // Not yet realized
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserNavigationPoint.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserNavigationPoint.cs
index b11548c299..f62d47d205 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserNavigationPoint.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserNavigationPoint.cs
@@ -30,6 +30,7 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Navigation;
using ICSharpCode.NRefactory.TypeSystem;
using System.Collections.Generic;
+using System.Threading.Tasks;
namespace MonoDevelop.AssemblyBrowser
{
@@ -85,9 +86,9 @@ namespace MonoDevelop.AssemblyBrowser
#region implemented abstract members of NavigationPoint
- public override Document ShowDocument ()
+ public override Task<Document> ShowDocument ()
{
- return DoShow ();
+ return Task.FromResult (DoShow ());
}
public override string DisplayName {
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs
index 177a61db98..db1d5f40fa 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs
@@ -30,6 +30,7 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Refactoring;
using System;
using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Navigation;
@@ -37,24 +38,26 @@ using MonoDevelop.Projects;
using System.Linq;
using MonoDevelop.Ide;
using System.Collections.Generic;
-
+using System.Threading.Tasks;
+using MonoDevelop.Components;
+
namespace MonoDevelop.AssemblyBrowser
{
- class AssemblyBrowserViewContent : AbstractViewContent, IOpenNamedElementHandler, INavigable
+ class AssemblyBrowserViewContent : ViewContent, IOpenNamedElementHandler, INavigable
{
readonly static string[] defaultAssemblies = new string[] { "mscorlib", "System", "System.Core", "System.Xml" };
AssemblyBrowserWidget widget;
- protected override void OnWorkbenchWindowChanged (EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- base.OnWorkbenchWindowChanged (e);
+ base.OnWorkbenchWindowChanged ();
if (WorkbenchWindow != null) {
var toolbar = WorkbenchWindow.GetToolbar (this);
widget.SetToolbar (toolbar);
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return widget;
}
@@ -73,10 +76,11 @@ namespace MonoDevelop.AssemblyBrowser
IsDisposed = false;
}
- public override void Load (FileOpenInformation fileOpenInformation)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
ContentName = GettextCatalog.GetString ("Assembly Browser");
widget.AddReferenceByFileName (fileOpenInformation.FileName);
+ return Task.FromResult (true);
}
internal void EnsureDefinitionsLoaded (List<AssemblyLoader> definitions)
@@ -100,9 +104,12 @@ namespace MonoDevelop.AssemblyBrowser
IsDisposed = true;
base.Dispose ();
widget = null;
- GC.Collect ();
+ if (Disposed != null)
+ Disposed (this, EventArgs.Empty);
}
+ internal event EventHandler Disposed;
+
#region INavigable implementation
public NavigationPoint BuildNavigationPoint ()
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DisplayBinding.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DisplayBinding.cs
index 71ded99d16..f992060d7e 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DisplayBinding.cs
@@ -53,14 +53,14 @@ namespace MonoDevelop.AssemblyBrowser
{
if (viewContent == null || viewContent.IsDisposed) {
viewContent = new AssemblyBrowserViewContent ();
- viewContent.Control.Destroyed += HandleDestroyed;
+ viewContent.Disposed += HandleDestroyed;
}
return viewContent;
}
void HandleDestroyed (object sender, EventArgs e)
{
- ((Gtk.Widget)sender).Destroyed -= HandleDestroyed;
+ ((AssemblyBrowserViewContent)sender).Disposed -= HandleDestroyed;
this.viewContent = null;
}
@@ -71,7 +71,7 @@ namespace MonoDevelop.AssemblyBrowser
|| mimeType == "application/x-msdownload";
}
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
{
return GetViewContent ();
}
diff --git a/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanel.cs b/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanel.cs
index 4ac8a3e0b1..598bcd1d1d 100644
--- a/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanel.cs
+++ b/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanel.cs
@@ -1,5 +1,5 @@
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -13,7 +13,7 @@ namespace MonoDevelop.Autotools
{
}
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
Project project = ConfiguredProject;
MakefileData data = project.GetMakefileData ();
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
index 623291d118..21036158c2 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
@@ -40,7 +40,7 @@ using MonoDevelop.Ide;
namespace MonoDevelop.Debugger
{
- public class BreakpointPad : IPadContent
+ public class BreakpointPad : PadContent
{
BreakpointStore breakpoints;
@@ -69,8 +69,9 @@ namespace MonoDevelop.Debugger
Properties
}
- public void Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
+ Id = "MonoDevelop.Debugger.BreakpointPad";
// Toolbar and menu definitions
ActionCommand gotoCmd = new ActionCommand (LocalCommands.GoToFile, GettextCatalog.GetString ("Go to File"));
@@ -168,12 +169,12 @@ namespace MonoDevelop.Debugger
tree.RowActivated += OnRowActivated;
- DockItemToolbar toolbar = window.GetToolbar (PositionType.Top);
+ DockItemToolbar toolbar = window.GetToolbar (DockPositionType.Top);
toolbar.Add (toolbarSet, sw);
toolbar.ShowAll ();
}
- public void Dispose ()
+ public override void Dispose ()
{
breakpoints.BreakpointAdded -= OnBreakpointAdded;
breakpoints.BreakpointRemoved -= OnBreakpointRemoved;
@@ -183,6 +184,7 @@ namespace MonoDevelop.Debugger
DebuggingService.PausedEvent -= OnDebuggerStatusCheck;
DebuggingService.ResumedEvent -= OnDebuggerStatusCheck;
DebuggingService.StoppedEvent -= OnDebuggerStatusCheck;
+ base.Dispose ();
}
void ShowPopup (Gdk.EventButton evt)
@@ -465,25 +467,16 @@ namespace MonoDevelop.Debugger
OnBpJumpTo ();
}
- public Gtk.Widget Control {
+ public override Control Control {
get {
return control;
}
}
- public string Id {
- get { return "MonoDevelop.Debugger.BreakpointPad"; }
- }
-
public string DefaultPlacement {
get { return "Bottom"; }
}
- public void RedrawContent ()
- {
- UpdateDisplay ();
- }
-
protected void OnDeleteClicked (object o, EventArgs args)
{
OnDeleted ();
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs
index 85c5ef476b..ec6d84fafd 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs
@@ -26,6 +26,7 @@
using System;
using Mono.Debugging.Client;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using Xwt;
using MonoDevelop.Core;
@@ -36,7 +37,7 @@ namespace MonoDevelop.Debugger
{
DebuggerOptionsPanelWidget w;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
w = new DebuggerOptionsPanelWidget ();
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
index 9991801685..f820fd2273 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
@@ -947,25 +947,25 @@ namespace MonoDevelop.Debugger
});
}
- public static void ShowCurrentExecutionLine ()
+ public static async void ShowCurrentExecutionLine ()
{
Runtime.AssertMainThread ();
if (currentBacktrace != null) {
var sf = GetCurrentVisibleFrame ();
if (sf != null && !string.IsNullOrEmpty (sf.SourceLocation.FileName) && System.IO.File.Exists (sf.SourceLocation.FileName) && sf.SourceLocation.Line != -1) {
- Document document = IdeApp.Workbench.OpenDocument (sf.SourceLocation.FileName, null, sf.SourceLocation.Line, 1, OpenDocumentOptions.Debugger);
+ Document document = await IdeApp.Workbench.OpenDocument (sf.SourceLocation.FileName, null, sf.SourceLocation.Line, 1, OpenDocumentOptions.Debugger);
OnDisableConditionalCompilation (new DocumentEventArgs (document));
}
}
}
- public static void ShowNextStatement ()
+ public static async void ShowNextStatement ()
{
Runtime.AssertMainThread ();
var location = NextStatementLocation;
if (location != null && System.IO.File.Exists (location.FileName)) {
- Document document = IdeApp.Workbench.OpenDocument (location.FileName, null, location.Line, 1, OpenDocumentOptions.Debugger);
+ Document document = await IdeApp.Workbench.OpenDocument (location.FileName, null, location.Line, 1, OpenDocumentOptions.Debugger);
OnDisableConditionalCompilation (new DocumentEventArgs (document));
} else {
ShowCurrentExecutionLine ();
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
index b91b9e29b6..0f42d6b006 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
@@ -43,10 +43,11 @@ using MonoDevelop.Ide;
using System.Security.Cryptography;
using Gdk;
using MonoDevelop.Components;
+using System.Threading.Tasks;
namespace MonoDevelop.Debugger
{
- public class DisassemblyView: AbstractViewContent, IClipboardHandler
+ public class DisassemblyView: ViewContent, IClipboardHandler
{
Gtk.ScrolledWindow sw;
TextEditor editor;
@@ -154,15 +155,11 @@ namespace MonoDevelop.Debugger
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return sw;
}
}
-
- public override void Load (FileOpenInformation fileOpenInformation)
- {
- }
public override bool IsFile {
get {
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
index d8bc6c0290..2b05939b5b 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
@@ -43,7 +43,7 @@ using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Debugger
{
- class ExceptionCaughtDialog : Dialog
+ class ExceptionCaughtDialog : Gtk.Dialog
{
static readonly Xwt.Drawing.Image WarningIconPixbuf = Xwt.Drawing.Image.FromResource ("exception-48.png");
protected ObjectValueTreeView ExceptionValueTreeView { get; private set; }
@@ -675,7 +675,7 @@ namespace MonoDevelop.Debugger
dlg.Line = Line;
}
- public override Widget CreateWidget ()
+ public override Control CreateWidget ()
{
var icon = Xwt.Drawing.Image.FromResource ("lightning-16.png");
var image = new Xwt.ImageView (icon).ToGtkWidget ();
@@ -763,7 +763,7 @@ namespace MonoDevelop.Debugger
dlg.Line = Line;
}
- public override Widget CreateWidget ()
+ public override Control CreateWidget ()
{
var box = new EventBox ();
box.VisibleWindow = false;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs
index dd5ac17ce9..1b5489e8f8 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs
@@ -37,13 +37,13 @@ using MonoDevelop.Components;
namespace MonoDevelop.Debugger
{
- public class ImmediatePad: IPadContent
+ public class ImmediatePad: PadContent
{
static readonly object mutex = new object();
DebuggerConsoleView view;
readonly List<uint> timersList = new List<uint>();
- public void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
view = new DebuggerConsoleView ();
view.ConsoleInput += OnViewConsoleInput;
@@ -263,21 +263,18 @@ namespace MonoDevelop.Debugger
});
}
- public void RedrawContent ()
- {
- }
-
- public Gtk.Widget Control {
+ public override Control Control {
get {
return view;
}
}
- public void Dispose ()
+ public override void Dispose ()
{
DebuggingService.PausedEvent -= DebuggerPaused;
DebuggingService.ResumedEvent -= DebuggerResumed;
DebuggingService.StoppedEvent -= DebuggerStopped;
+ base.Dispose ();
}
void DebuggerResumed (object sender, EventArgs e)
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs
index 1a5f3dcf5e..eb6217ecec 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs
@@ -29,20 +29,20 @@ using System;
using Gtk;
using MonoDevelop.Ide.Gui;
using Mono.Debugging.Client;
+using MonoDevelop.Components;
namespace MonoDevelop.Debugger
{
- public class ObjectValuePad: IPadContent
+ public class ObjectValuePad: PadContent
{
protected ObjectValueTreeView tree;
readonly ScrolledWindow scrolled;
bool needsUpdate;
- IPadWindow container;
bool initialResume;
StackFrame lastFrame;
PadFontChanger fontChanger;
- public Gtk.Widget Control {
+ public override Control Control {
get {
return scrolled;
}
@@ -76,7 +76,7 @@ namespace MonoDevelop.Debugger
initialResume = !DebuggingService.IsDebugging;
}
- public void Dispose ()
+ public override void Dispose ()
{
if (fontChanger == null)
return;
@@ -88,21 +88,17 @@ namespace MonoDevelop.Debugger
DebuggingService.ResumedEvent -= OnDebuggerResumed;
DebuggingService.StoppedEvent -= OnDebuggerStopped;
DebuggingService.EvaluationOptionsChanged -= OnEvaluationOptionsChanged;
+ base.Dispose ();
}
- public void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
- this.container = container;
container.PadContentShown += delegate {
if (needsUpdate)
OnUpdateList ();
};
}
- public void RedrawContent ()
- {
- }
-
public virtual void OnUpdateList ()
{
needsUpdate = false;
@@ -113,7 +109,7 @@ namespace MonoDevelop.Debugger
protected virtual void OnFrameChanged (object s, EventArgs a)
{
- if (container != null && container.ContentVisible)
+ if (Window != null && Window.ContentVisible)
OnUpdateList ();
else
needsUpdate = true;
@@ -144,7 +140,7 @@ namespace MonoDevelop.Debugger
{
if (!DebuggingService.IsRunning) {
lastFrame = null;
- if (container != null && container.ContentVisible)
+ if (Window != null && Window.ContentVisible)
OnUpdateList ();
else
needsUpdate = true;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
index 97164a0ca5..a3ecf8f8cb 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
@@ -45,7 +45,29 @@ using System.Linq;
namespace MonoDevelop.Debugger
{
- public class StackTracePad : ScrolledWindow, IPadContent
+ public class StackTracePad : PadContent
+ {
+ StackTracePadWidget control;
+
+ public StackTracePad ()
+ {
+ Id = "MonoDevelop.Debugger.StackTracePad";
+ control = new StackTracePadWidget ();
+ }
+
+ protected override void Initialize (IPadWindow window)
+ {
+ control.Initialize (window);
+ }
+
+ public override Control Control {
+ get {
+ return control;
+ }
+ }
+ }
+
+ public class StackTracePadWidget : ScrolledWindow
{
const int IconColumn = 0;
const int MethodColumn = 1;
@@ -64,7 +86,7 @@ namespace MonoDevelop.Debugger
static Xwt.Drawing.Image pointerImage = Xwt.Drawing.Image.FromResource ("stack-pointer-16.png");
- public StackTracePad ()
+ public StackTracePadWidget ()
{
this.ShadowType = ShadowType.None;
@@ -189,7 +211,7 @@ namespace MonoDevelop.Debugger
return !value.Contains (key);
}
- void IPadContent.Initialize (IPadWindow window)
+ public void Initialize (IPadWindow window)
{
this.window = window;
window.PadContentShown += delegate {
@@ -344,25 +366,6 @@ namespace MonoDevelop.Debugger
ActivateFrame ();
}
- public Widget Control {
- get {
- return this;
- }
- }
-
- public string Id {
- get { return "MonoDevelop.Debugger.StackTracePad"; }
- }
-
- public string DefaultPlacement {
- get { return "Bottom"; }
- }
-
- public void RedrawContent ()
- {
- UpdateDisplay ();
- }
-
void ShowPopup (Gdk.EventButton evt)
{
var context_menu = new ContextMenu ();
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs
index 579dec2810..9fa65e2afc 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs
@@ -41,7 +41,24 @@ using MonoDevelop.Ide;
namespace MonoDevelop.Debugger
{
- public class ThreadsPad : Gtk.ScrolledWindow, IPadContent
+ public class ThreadsPad: PadContent
+ {
+ ThreadsPadWidget control = new ThreadsPadWidget ();
+
+ protected override void Initialize (IPadWindow window)
+ {
+ Id = "MonoDevelop.Debugger.ThreadsPad";
+ control.Initialize (window);
+ }
+
+ public override Control Control {
+ get {
+ return control;
+ }
+ }
+ }
+
+ public class ThreadsPadWidget : Gtk.ScrolledWindow
{
TreeViewState treeViewState;
PadTreeView tree;
@@ -59,7 +76,7 @@ namespace MonoDevelop.Debugger
Location
}
- public ThreadsPad ()
+ public ThreadsPadWidget ()
{
this.ShadowType = ShadowType.None;
@@ -127,7 +144,7 @@ namespace MonoDevelop.Debugger
UpdateDisplay ();
}
- void IPadContent.Initialize (IPadWindow window)
+ public void Initialize (IPadWindow window)
{
this.window = window;
window.PadContentShown += delegate {
@@ -254,23 +271,6 @@ namespace MonoDevelop.Debugger
}
}
- public Widget Control {
- get { return this; }
- }
-
- public string Id {
- get { return "MonoDevelop.Debugger.ThreadsPad"; }
- }
-
- public string DefaultPlacement {
- get { return "Bottom"; }
- }
-
- public void RedrawContent ()
- {
- UpdateDisplay ();
- }
-
void OnDebuggerPaused (object s, EventArgs a)
{
UpdateDisplay ();
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs
index 23dccd0463..c26769d0bc 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs
@@ -66,7 +66,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
this.container = container;
#region Toolbar
- DockItemToolbar toolbar = container.GetToolbar (PositionType.Top);
+ DockItemToolbar toolbar = container.GetToolbar (DockPositionType.Top);
filterEntry = new SearchEntry();
filterEntry.Ready = true;
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs
index fb87b62f38..b86f6f6ac1 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs
@@ -34,12 +34,13 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide;
using System.Collections.Generic;
+using MonoDevelop.Components;
namespace MonoDevelop.DesignerSupport
{
- public class DocumentOutlinePad : AbstractPadContent
+ public class DocumentOutlinePad : PadContent
{
Alignment box;
IOutlinedDocument currentOutlineDoc;
@@ -54,12 +55,12 @@ namespace MonoDevelop.DesignerSupport
box.ShowAll ();
}
- public override void Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
base.Initialize (window);
IdeApp.Workbench.ActiveDocumentChanged += DocumentChangedHandler;
CurrentDoc = IdeApp.Workbench.ActiveDocument;
- toolbar = window.GetToolbar (PositionType.Top);
+ toolbar = window.GetToolbar (DockPositionType.Top);
toolbar.Visible = false;
Update ();
}
@@ -85,7 +86,7 @@ namespace MonoDevelop.DesignerSupport
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get { return box; }
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
index 690aa67385..9ce9320b34 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
@@ -41,11 +41,12 @@ using System.Collections.Generic;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Commands;
+using MonoDevelop.Components;
namespace MonoDevelop.DesignerSupport
{
- public class PropertyPad : AbstractPadContent, ICommandDelegator
+ public class PropertyPad : PadContent, ICommandDelegator
{
pg.PropertyGrid grid;
InvisibleFrame frame;
@@ -64,10 +65,10 @@ namespace MonoDevelop.DesignerSupport
frame.ShowAll ();
}
- public override void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
base.Initialize (container);
- toolbarProvider.Attach (container.GetToolbar (Gtk.PositionType.Top));
+ toolbarProvider.Attach (container.GetToolbar (DockPositionType.Top));
grid.SetToolbarProvider (toolbarProvider);
this.container = container;
DesignerSupport.Service.SetPad (this);
@@ -79,7 +80,7 @@ namespace MonoDevelop.DesignerSupport
#region AbstractPadContent implementations
- public override Gtk.Widget Control {
+ public override Control Control {
get { return frame; }
}
@@ -118,7 +119,7 @@ namespace MonoDevelop.DesignerSupport
customWidget = false;
frame.Remove (frame.Child);
frame.Add (grid);
- toolbarProvider.Attach (container.GetToolbar (Gtk.PositionType.Top));
+ toolbarProvider.Attach (container.GetToolbar (DockPositionType.Top));
}
return grid;
@@ -138,7 +139,7 @@ namespace MonoDevelop.DesignerSupport
void ClearToolbar ()
{
if (container != null) {
- var toolbar = container.GetToolbar (Gtk.PositionType.Top);
+ var toolbar = container.GetToolbar (DockPositionType.Top);
foreach (var w in toolbar.Children)
toolbar.Remove (w);
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs
index e6abccb836..f27049ed61 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs
@@ -35,11 +35,12 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.DesignerSupport;
using MonoDevelop.DesignerSupport.Toolbox;
+using MonoDevelop.Components;
namespace MonoDevelop.DesignerSupport
{
- public class ToolboxPad : AbstractPadContent
+ public class ToolboxPad : PadContent
{
Toolbox.Toolbox toolbox;
@@ -47,7 +48,7 @@ namespace MonoDevelop.DesignerSupport
{
}
- public override void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
base.Initialize (container);
toolbox = new Toolbox.Toolbox (DesignerSupport.Service.ToolboxService, container);
@@ -56,7 +57,7 @@ namespace MonoDevelop.DesignerSupport
#region AbstractPadContent implementations
- public override Gtk.Widget Control {
+ public override Control Control {
get { return toolbox; }
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs
index a3a743e8b0..8de2800c5f 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs
@@ -1,5 +1,5 @@
//
-// WrapperDesignView.cs: base class for wrapping an IViewContent. Heavily based on
+// WrapperDesignView.cs: base class for wrapping an ViewContent. Heavily based on
// MonoDevelop.GtkCore.GuiBuilder.CombinedDesignView
//
// Author:
@@ -31,28 +31,30 @@
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide;
+using System.Collections.Generic;
+using System.Threading.Tasks;
namespace MonoDevelop.DesignerSupport
{
- public class WrapperDesignView : AbstractViewContent
+ public class WrapperDesignView : ViewContent
{
- IViewContent content;
+ ViewContent content;
Gtk.VBox contentBox;
Gtk.Widget topBar;
- public WrapperDesignView (IViewContent content)
+ public WrapperDesignView (ViewContent content)
{
this.content = content;
this.contentBox = new Gtk.VBox ();
this.contentBox.PackEnd (content.Control, true, true, 0);
this.contentBox.ShowAll ();
- content.ContentChanged += new EventHandler (OnTextContentChanged);
content.DirtyChanged += new EventHandler (OnTextDirtyChanged);
-
+
IdeApp.Workbench.ActiveDocumentChanged += new EventHandler (OnActiveDocumentChanged);
}
@@ -76,50 +78,53 @@ namespace MonoDevelop.DesignerSupport
}
}
- protected IViewContent Content {
+ protected ViewContent Content {
get { return content; }
}
- public override MonoDevelop.Projects.Project Project {
- get { return base.Project; }
- set {
- base.Project = value;
- content.Project = value;
+ protected override void OnSetProject (MonoDevelop.Projects.Project project)
+ {
+ base.OnSetProject (project);
+ content.Project = project;
+ }
+
+ public override ProjectReloadCapability ProjectReloadCapability {
+ get {
+ return content.ProjectReloadCapability;
}
}
- protected override void OnWorkbenchWindowChanged (EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- base.OnWorkbenchWindowChanged (e);
+ base.OnWorkbenchWindowChanged ();
content.WorkbenchWindow = WorkbenchWindow;
}
public override void Dispose ()
{
- content.ContentChanged -= new EventHandler (OnTextContentChanged);
content.DirtyChanged -= new EventHandler (OnTextDirtyChanged);
IdeApp.Workbench.ActiveDocumentChanged -= new EventHandler (OnActiveDocumentChanged);
base.Dispose ();
}
- public override void Load (FileOpenInformation fileOpenInformation)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
ContentName = fileOpenInformation.FileName;
- content.Load (ContentName);
+ return content.Load (ContentName);
}
- public override void LoadNew (System.IO.Stream content, string mimeType)
+ public override Task LoadNew (System.IO.Stream content, string mimeType)
{
- this.content.LoadNew (content, mimeType);
+ return this.content.LoadNew (content, mimeType);
}
- public override Gtk.Widget Control {
+ public override Control Control {
get { return contentBox; }
}
- public override void Save (FileSaveInformation fileSaveInformation)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
- content.Save (fileSaveInformation);
+ return content.Save (fileSaveInformation);
}
public override bool IsDirty {
@@ -138,19 +143,15 @@ namespace MonoDevelop.DesignerSupport
}
}
- public override string ContentName {
- get { return content.ContentName; }
- set { content.ContentName = value; }
- }
-
- void OnTextContentChanged (object s, EventArgs args)
+ protected override void OnContentNameChanged ()
{
- OnContentChanged (args);
+ base.OnContentNameChanged ();
+ content.ContentName = ContentName;
}
-
+
void OnTextDirtyChanged (object s, EventArgs args)
{
- OnDirtyChanged (args);
+ OnDirtyChanged ();
}
void OnActiveDocumentChanged (object s, EventArgs args)
@@ -163,10 +164,10 @@ namespace MonoDevelop.DesignerSupport
protected virtual void OnDocumentActivated ()
{
}
-
- public override object GetContent (Type type)
+
+ protected override IEnumerable<object> OnGetContents (Type type)
{
- return base.GetContent (type) ?? content.GetContent (type);
+ return base.OnGetContents (type).Concat (content.GetContents (type));
}
}
}
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs
index 056df0d5fb..1e9ba38bae 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -44,7 +45,7 @@ namespace MonoDevelop.DocFood.Options
{
AcronymsPanelWidget panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new AcronymsPanelWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs
index ef67d760f9..537a6c973b 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -54,7 +55,7 @@ namespace MonoDevelop.DocFood.Options
/// <returns>
/// The panel widget.
/// </returns>
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new ExpansionsPanelWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs
index d8f9bd3f9d..e6d6613f9a 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -44,7 +45,7 @@ namespace MonoDevelop.DocFood.Options
{
NoTheReorderingWidget panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new NoTheReorderingWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs
index 7a9e9f9012..a654d53e17 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -44,7 +45,7 @@ namespace MonoDevelop.DocFood.Options
{
OfTheReorderingWidget panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new OfTheReorderingWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OptionsPanelWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OptionsPanelWidget.cs
index 8bc50381fc..4ebfbd8e80 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OptionsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OptionsPanelWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -44,7 +45,7 @@ namespace MonoDevelop.DocFood.Options
{
OptionsPanelWidget panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new OptionsPanelWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/RulesPanelWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/RulesPanelWidget.cs
index 0de058c177..7bee353ab2 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/RulesPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/RulesPanelWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -44,7 +45,7 @@ namespace MonoDevelop.DocFood.Options
{
RulesPanelWidget panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new RulesPanelWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogEditorView.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogEditorView.cs
index cc9aef04b0..d33b7ec7be 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogEditorView.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogEditorView.cs
@@ -32,13 +32,15 @@ using System;
using System.Collections.Generic;
using Gtk;
using Gdk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Content;
+using System.Threading.Tasks;
namespace MonoDevelop.Gettext.Editor
{
- class CatalogEditorView : AbstractViewContent, IUndoHandler
+ class CatalogEditorView : ViewContent, IUndoHandler
{
Catalog catalog;
POEditorWidget poEditorWidget;
@@ -52,7 +54,7 @@ namespace MonoDevelop.Gettext.Editor
};
}
- public override void Load (FileOpenInformation fileOpenInformation)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
var fileName = fileOpenInformation.FileName;
// using (IProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetLoadProgressMonitor (true)) {
@@ -64,21 +66,17 @@ namespace MonoDevelop.Gettext.Editor
this.ContentName = fileName;
this.IsDirty = false;
+ return Task.FromResult (true);
}
- public override void Save (FileSaveInformation fileSaveInformation)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
- OnBeforeSave (EventArgs.Empty);
catalog.Save (fileSaveInformation.FileName);
ContentName = fileSaveInformation.FileName;
- IsDirty = false;
+ IsDirty = false;
+ return Task.FromResult (true);
}
- public override void Save ()
- {
- Save (this.ContentName);
- }
-
#region IUndoHandler implementation
void IUndoHandler.Undo ()
{
@@ -108,7 +106,7 @@ namespace MonoDevelop.Gettext.Editor
}
#endregion
- public override Widget Control
+ public override Control Control
{
get { return poEditorWidget; }
}
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs
index a572e7b707..0f9d629cfd 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs
@@ -47,7 +47,7 @@ namespace MonoDevelop.Gettext
return filePath.IsNotNull && filePath.HasExtension (".po");
}
- public IViewContent CreateContent (FilePath filePath, string mimeType, Project project)
+ public ViewContent CreateContent (FilePath filePath, string mimeType, Project project)
{
foreach (TranslationProject tp in IdeApp.Workspace.GetAllItems<TranslationProject> ())
if (tp.BaseDirectory == Path.GetDirectoryName (filePath))
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs
index cce24542b0..41f1b27042 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs
@@ -26,7 +26,7 @@
using System;
using MonoDevelop.GtkCore.GuiBuilder;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.GtkCore.Dialogs
@@ -35,7 +35,7 @@ namespace MonoDevelop.GtkCore.Dialogs
{
GtkDesignerOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new GtkDesignerOptionsPanelWidget ();
widget.AutoSwitchLayout = GuiBuilderService.AutoSwitchGuiLayout;
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs
index 4fb717ece7..794b08476b 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs
@@ -29,7 +29,8 @@
using Gtk;
-
+
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -121,7 +122,7 @@ namespace MonoDevelop.GtkCore.Dialogs
WidgetBuilderOptionPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return (widget = new WidgetBuilderOptionPanelWidget (ConfiguredProject));
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs
index b122cf3de6..5eae8f19fd 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs
@@ -81,7 +81,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
return db != null;
}
- public IViewContent CreateContent (FilePath fileName, string mimeType, MonoDevelop.Projects.Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, MonoDevelop.Projects.Project ownerProject)
{
excludeThis = true;
var db = DisplayBindingService.GetDefaultViewBinding (fileName, mimeType, ownerProject);
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs
index 3e16e11f17..ba794c06f8 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs
@@ -37,7 +37,7 @@ using MonoDevelop.Components.Commands;
using MonoDevelop.DesignerSupport;
using Microsoft.CodeAnalysis;
using MonoDevelop.Ide;
-
+using System.Threading.Tasks;
namespace MonoDevelop.GtkCore.GuiBuilder
{
@@ -50,7 +50,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
Stetic.ActionGroupInfo groupInfo;
string groupName;
- public ActionGroupView (IViewContent content, Stetic.ActionGroupInfo group, GuiBuilderProject project): base (content)
+ public ActionGroupView (ViewContent content, Stetic.ActionGroupInfo group, GuiBuilderProject project): base (content)
{
groupName = group.Name;
this.project = project;
@@ -140,11 +140,11 @@ namespace MonoDevelop.GtkCore.GuiBuilder
codeBinder.TargetObject = designer.RootComponent;
}
- public override void Save (FileSaveInformation fileSaveInformation)
+ public override async Task Save (FileSaveInformation fileSaveInformation)
{
string oldBuildFile = GuiBuilderService.GetBuildCodeFileName (project.Project, groupInfo.Name);
- base.Save (fileSaveInformation);
+ await base.Save (fileSaveInformation);
if (designer == null)
return;
@@ -189,8 +189,6 @@ namespace MonoDevelop.GtkCore.GuiBuilder
void OnGroupModified (object s, EventArgs a)
{
- if (designer.Modified)
- OnContentChanged (a);
IsDirty = designer.Modified;
}
@@ -204,10 +202,10 @@ namespace MonoDevelop.GtkCore.GuiBuilder
codeBinder.UpdateSignal (a.OldSignal, a.Signal);
}
- void OnBindField (object s, EventArgs args)
+ async void OnBindField (object s, EventArgs args)
{
if (designer.SelectedAction != null) {
- codeBinder.BindToField (designer.SelectedAction);
+ await codeBinder.BindToField (designer.SelectedAction);
}
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs
index 6e49af37e2..3076ef4d8d 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs
@@ -47,6 +47,7 @@ using MonoDevelop.CSharp.Refactoring;
using MonoDevelop.Refactoring;
using System.Xml.XPath;
using System.IO;
+using System.Threading.Tasks;
namespace MonoDevelop.GtkCore.GuiBuilder
{
@@ -212,7 +213,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
/// Adds a field to the class
- public void BindToField (Stetic.Component obj)
+ public async Task BindToField (Stetic.Component obj)
{
if (targetObject == null)
return;
@@ -224,11 +225,11 @@ namespace MonoDevelop.GtkCore.GuiBuilder
return;
var location = GetSourceLocation(cls);
- var doc = IdeApp.Workbench.OpenDocument (location.SourceTree.FilePath, project, true);
+ var doc = await IdeApp.Workbench.OpenDocument (location.SourceTree.FilePath, project, true);
var editor = doc.Editor;
if (editor != null) {
- CodeGenerationService.AddNewMember (project, cls, cls.Locations.First (), GetFieldCode (cls, obj, name));
+ await CodeGenerationService.AddNewMember (project, cls, cls.Locations.First (), GetFieldCode (cls, obj, name));
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs
index c08d33c374..2961eb94ca 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs
@@ -30,6 +30,7 @@
using System;
using System.Linq;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Gui;
@@ -37,16 +38,17 @@ using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
using System.Collections.Generic;
using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
namespace MonoDevelop.GtkCore.GuiBuilder
{
- public class CombinedDesignView : AbstractViewContent
+ public class CombinedDesignView : ViewContent
{
- IViewContent content;
+ ViewContent content;
Gtk.Widget control;
List<TabView> tabs = new List<TabView> ();
- public CombinedDesignView (IViewContent content)
+ public CombinedDesignView (ViewContent content)
{
this.content = content;
/* This code causes that chagnes in a version control view always select the source code view.
@@ -55,7 +57,6 @@ namespace MonoDevelop.GtkCore.GuiBuilder
ShowPage (0);
};
}*/
- content.ContentChanged += new EventHandler (OnTextContentChanged);
content.DirtyChanged += new EventHandler (OnTextDirtyChanged);
CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true);
@@ -87,7 +88,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
public bool HasPage (Gtk.Widget page)
{
- return tabs.Any (p => p.Control == page);
+ return tabs.Any (p => p.Control.GetNativeWidget<Gtk.Widget> () == page);
}
public void RemoveButton (Gtk.Widget page)
@@ -108,17 +109,21 @@ namespace MonoDevelop.GtkCore.GuiBuilder
ShowPage (0);*/
}
- public override MonoDevelop.Projects.Project Project {
- get { return base.Project; }
- set {
- base.Project = value;
- content.Project = value;
+ protected override void OnSetProject (Projects.Project project)
+ {
+ base.OnSetProject (project);
+ content.Project = project;
+ }
+
+ public override ProjectReloadCapability ProjectReloadCapability {
+ get {
+ return content.ProjectReloadCapability;
}
}
- protected override void OnWorkbenchWindowChanged (EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- base.OnWorkbenchWindowChanged (e);
+ base.OnWorkbenchWindowChanged ();
content.WorkbenchWindow = WorkbenchWindow;
if (WorkbenchWindow != null) {
foreach (TabView view in tabs) {
@@ -161,7 +166,6 @@ namespace MonoDevelop.GtkCore.GuiBuilder
public override void Dispose ()
{
- content.ContentChanged -= new EventHandler (OnTextContentChanged);
content.DirtyChanged -= new EventHandler (OnTextDirtyChanged);
IdeApp.Workbench.ActiveDocumentChanged -= new EventHandler (OnActiveDocumentChanged);
content.Dispose ();
@@ -172,19 +176,19 @@ namespace MonoDevelop.GtkCore.GuiBuilder
base.Dispose ();
}
- public override void Load (FileOpenInformation fileOpenInformation)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
ContentName = fileOpenInformation.FileName;
- content.Load (ContentName);
+ return content.Load (ContentName);
}
- public override Gtk.Widget Control {
+ public override Control Control {
get { return control; }
}
- public override void Save (FileSaveInformation fileSaveInformation)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
- content.Save (fileSaveInformation);
+ return content.Save (fileSaveInformation);
}
public override bool IsDirty {
@@ -211,14 +215,9 @@ namespace MonoDevelop.GtkCore.GuiBuilder
{
}
- void OnTextContentChanged (object s, EventArgs args)
- {
- OnContentChanged (args);
- }
-
void OnTextDirtyChanged (object s, EventArgs args)
{
- OnDirtyChanged (args);
+ OnDirtyChanged ();
}
void OnActiveDocumentChanged (object s, EventArgs args)
@@ -231,7 +230,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
{
}
- public override object GetContent (Type type)
+ protected override object OnGetContent (Type type)
{
// if (type == typeof(IEditableTextBuffer)) {
// // Intercept the IPositionable interface, since we need to
@@ -242,7 +241,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
// return null;
// }
//
- return base.GetContent (type) ?? (content !=null ? content.GetContent (type) : null);
+ return base.OnGetContent (type) ?? (content !=null ? content.GetContent (type) : null);
}
public void JumpTo (int line, int column)
@@ -255,7 +254,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
}
- class TabView: AbstractBaseViewContent, IAttachableViewContent
+ class TabView: BaseViewContent
{
string label;
Gtk.Widget content;
@@ -266,32 +265,14 @@ namespace MonoDevelop.GtkCore.GuiBuilder
this.content = content;
}
- public override object GetContent (Type type)
+ protected override object OnGetContent (Type type)
{
if (type.IsInstanceOfType (Control))
return Control;
- return base.GetContent (type);
+ return base.OnGetContent (type);
}
- #region IAttachableViewContent implementation
- public virtual void Selected ()
- {
- }
-
- public virtual void Deselected ()
- {
- }
-
- public virtual void BeforeSave ()
- {
- }
-
- public virtual void BaseContentChanged ()
- {
- }
- #endregion
-
- public override Widget Control {
+ public override Control Control {
get {
return content;
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs
index 65cde80d96..c9f93016f6 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs
@@ -68,7 +68,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
return db != null;
}
- public IViewContent CreateContent (MonoDevelop.Core.FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (MonoDevelop.Core.FilePath fileName, string mimeType, Project ownerProject)
{
excludeThis = true;
var db = DisplayBindingService.GetDefaultViewBinding (fileName, mimeType, ownerProject);
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
index b511d9fd7e..c765892291 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
@@ -168,7 +168,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
}
- public static ActionGroupView OpenActionGroup (Project project, Stetic.ActionGroupInfo group)
+ public static async Task<ActionGroupView> OpenActionGroup (Project project, Stetic.ActionGroupInfo group)
{
GuiBuilderProject p = GtkDesignInfo.FromProject (project).GuiBuilderProject ;
string file = p != null ? p.GetSourceCodeFile (group) : null;
@@ -176,7 +176,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
file = ActionGroupDisplayBinding.BindToClass (project, group);
}
- Document doc = IdeApp.Workbench.OpenDocument (file, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (file, true);
if (doc != null) {
ActionGroupView view = doc.GetContent<ActionGroupView> ();
if (view != null) {
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
index a472231a22..c0ae7f6a29 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
@@ -38,17 +38,18 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Components.Commands;
using MonoDevelop.Projects;
-using MonoDevelop.DesignerSupport.Toolbox;
+using MonoDevelop.DesignerSupport.Toolbox;
using MonoDevelop.DesignerSupport;
using Gtk;
using Gdk;
using MonoDevelop.Ide;
using Microsoft.CodeAnalysis;
+using System.Threading.Tasks;
namespace MonoDevelop.GtkCore.GuiBuilder
{
- public class GuiBuilderView : CombinedDesignView, ISupportsProjectReload
+ public class GuiBuilderView : CombinedDesignView
{
Stetic.WidgetDesigner designer;
Stetic.ActionGroupDesigner actionsBox;
@@ -63,7 +64,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
string rootName;
object designerStatus;
- public GuiBuilderView (IViewContent content, GuiBuilderWindow window): base (content)
+ public GuiBuilderView (ViewContent content, GuiBuilderWindow window): base (content)
{
rootName = window.Name;
@@ -86,14 +87,16 @@ namespace MonoDevelop.GtkCore.GuiBuilder
LoadDesigner ();
}
- ProjectReloadCapability ISupportsProjectReload.ProjectReloadCapability {
+ public override ProjectReloadCapability ProjectReloadCapability {
get {
return ProjectReloadCapability.Full;
}
}
-
- void ISupportsProjectReload.Update (MonoDevelop.Projects.Project project)
+
+ protected override void OnSetProject (Projects.Project project)
{
+ base.OnSetProject (project);
+
if (gproject != null && gproject.Project == project)
return;
@@ -296,21 +299,19 @@ namespace MonoDevelop.GtkCore.GuiBuilder
void OnWindowModifiedChanged (object s, EventArgs args)
{
- if (IsDirty)
- OnContentChanged (args);
- OnDirtyChanged (args);
+ OnDirtyChanged ();
}
- void OnBindWidgetField (object o, EventArgs a)
+ async void OnBindWidgetField (object o, EventArgs a)
{
if (designer.Selection != null)
- codeBinder.BindToField (designer.Selection);
+ await codeBinder.BindToField (designer.Selection);
}
- void OnBindActionField (object o, EventArgs a)
+ async void OnBindActionField (object o, EventArgs a)
{
if (actionsBox.SelectedAction != null)
- codeBinder.BindToField (actionsBox.SelectedAction);
+ await codeBinder.BindToField (actionsBox.SelectedAction);
}
void OnSignalAdded (object sender, Stetic.ComponentSignalEventArgs args)
@@ -327,9 +328,9 @@ namespace MonoDevelop.GtkCore.GuiBuilder
codeBinder.UpdateSignal (args.OldSignal, args.Signal);
}
- public override void Save (FileSaveInformation fileSaveInformation)
+ public override async Task Save (FileSaveInformation fileSaveInformation)
{
- base.Save (fileSaveInformation);
+ await base.Save (fileSaveInformation);
if (designer == null)
return;
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs
index 5b0fd87a2f..ad6f2b722b 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs
@@ -86,14 +86,14 @@ namespace MonoDevelop.GtkCore.NodeBuilders
class ActionGroupCommandHandler: NodeCommandHandler
{
- public override void ActivateItem ()
+ public override async void ActivateItem ()
{
GuiBuilderWindow w = (GuiBuilderWindow) CurrentNode.GetParentDataItem (typeof(GuiBuilderWindow), false);
if (w != null) {
if (w.SourceCodeFile == FilePath.Null && !w.BindToClass ())
return;
- Document doc = IdeApp.Workbench.OpenDocument (w.SourceCodeFile, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (w.SourceCodeFile, true);
if (doc != null) {
GuiBuilderView view = doc.GetContent<GuiBuilderView> ();
if (view != null)
@@ -103,7 +103,7 @@ namespace MonoDevelop.GtkCore.NodeBuilders
else {
Project project = (Project) CurrentNode.GetParentDataItem (typeof(Project), false);
Stetic.ActionGroupInfo group = (Stetic.ActionGroupInfo) CurrentNode.DataItem;
- GuiBuilderService.OpenActionGroup (project, group);
+ await GuiBuilderService.OpenActionGroup (project, group);
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs
index c0d692977c..c2710e2cf2 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs
@@ -114,13 +114,13 @@ namespace MonoDevelop.GtkCore.NodeBuilders
class GladeWindowCommandHandler: NodeCommandHandler
{
- public override void ActivateItem ()
+ public override async void ActivateItem ()
{
GuiBuilderWindow w = (GuiBuilderWindow) CurrentNode.DataItem;
if (w.SourceCodeFile == FilePath.Null && !w.BindToClass ())
return;
- Document doc = IdeApp.Workbench.OpenDocument (w.SourceCodeFile, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (w.SourceCodeFile, true);
if (doc != null) {
GuiBuilderView view = doc.GetContent<GuiBuilderView> ();
if (view != null)
diff --git a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/Buffer.cs b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/Buffer.cs
index 4b5e64b651..31f8c29d7a 100644
--- a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/Buffer.cs
+++ b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/Buffer.cs
@@ -26,6 +26,7 @@
using System;
using System.IO;
+using System.Threading.Tasks;
namespace Mono.MHex.Data
{
@@ -81,6 +82,16 @@ namespace Mono.MHex.Data
return new ArrayBuffer (buf);
}
+ public static async Task<IBuffer> LoadAsync (Stream stream)
+ {
+ int count = (int) stream.Length;
+ byte[] buf = new byte[count];
+
+ await stream.ReadAsync (buf, 0, count);
+
+ return new ArrayBuffer (buf);
+ }
+
public static IBuffer Load (string fileName)
{
using (Stream stream = File.OpenRead (fileName)) {
diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/DisplayBinding.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/DisplayBinding.cs
index 12a5f4c3d2..11c6c884fc 100644
--- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/DisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/DisplayBinding.cs
@@ -39,7 +39,7 @@ namespace MonoDevelop.HexEditor
}
}
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
{
return new HexEditorView ();
diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs
index e01cddac17..f23c5fc900 100644
--- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs
+++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs
@@ -33,6 +33,7 @@ using MonoDevelop.Ide.Gui.Content;
using Xwt;
using MonoDevelop.Ide.Fonts;
using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
namespace MonoDevelop.HexEditor
{
@@ -78,18 +79,19 @@ namespace MonoDevelop.HexEditor
hexEditor.Repaint ();
}
- public override void Save (FileSaveInformation fileSaveInformation)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
File.WriteAllBytes (fileSaveInformation.FileName, hexEditor.HexEditorData.Bytes);
ContentName = fileSaveInformation.FileName;
this.IsDirty = false;
+ return Task.FromResult (true);
}
- public override void Load (FileOpenInformation fileOpenInformation)
+ public override async Task Load (FileOpenInformation fileOpenInformation)
{
var fileName = fileOpenInformation.FileName;
using (Stream stream = File.OpenRead (fileName)) {
- hexEditor.HexEditorData.Buffer = ArrayBuffer.Load (stream);
+ hexEditor.HexEditorData.Buffer = await ArrayBuffer.LoadAsync (stream);
}
ContentName = fileName;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs
index f2bf9edf09..d5eca95351 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs
@@ -27,7 +27,8 @@
//
using System;
-using MonoDevelop.PackageManagement;
+using MonoDevelop.Components;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.PackageManagement.Gui
@@ -35,8 +36,8 @@ namespace MonoDevelop.PackageManagement.Gui
public class PackageManagementOptionsPanel : OptionsPanel
{
PackageManagementOptionsViewModel optionsViewModel;
-
- public override Gtk.Widget CreatePanelWidget()
+
+ public override Control CreatePanelWidget()
{
var viewModels = new PackageManagementViewModels ();
optionsViewModel = viewModels.PackageManagementOptionsViewModel;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs
index 48ab198d78..d40d8f0e48 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs
@@ -30,6 +30,7 @@ using System;
using System.Linq;
using System.IO;
using System.Security.Cryptography;
+using MonoDevelop.Components;
using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -42,7 +43,7 @@ namespace MonoDevelop.PackageManagement.Gui
PackageManagementViewModels viewModels;
PackageSourcesWidget packageSourcesWidget;
- public override Gtk.Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
viewModels = new PackageManagementViewModels ();
viewModels.RegisteredPackageSourcesViewModel.Load ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesSearchCategory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesSearchCategory.cs
index 551205cb35..a46706c6e1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesSearchCategory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesSearchCategory.cs
@@ -72,7 +72,7 @@ namespace MonoDevelop.PackageManagement
runner.Run (pattern.UnparsedPattern);
}
- public override string GetMarkupText (Gtk.Widget widget)
+ public override string GetMarkupText ()
{
return GettextCatalog.GetString ("Search Packages...");
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs
index fdb32f6021..4bba040f78 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs
@@ -31,7 +31,6 @@ using System.Linq;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using System.Collections.Generic;
-using Gtk;
using MonoDevelop.AnalysisCore.Gui;
using MonoDevelop.AnalysisCore.Fixes;
using MonoDevelop.Ide;
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/AnalysisOptionsPanel.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/AnalysisOptionsPanel.cs
index b8ddfd008e..deeaf2b724 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/AnalysisOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/AnalysisOptionsPanel.cs
@@ -27,6 +27,7 @@
using System;
using MonoDevelop.Ide.Gui.Dialogs;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -36,7 +37,7 @@ namespace MonoDevelop.AnalysisCore.Gui
{
AnalysisOptionsWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new AnalysisOptionsWidget () {
AnalysisEnabled = AnalysisOptions.AnalysisEnabled,
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs
index 91326133d2..fe54647b2a 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs
@@ -51,7 +51,7 @@ namespace MonoDevelop.AnalysisCore.Gui
}
- public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Gdk.ModifierType modifierState)
+ public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
{
var result = item.Item as Result;
@@ -72,4 +72,3 @@ namespace MonoDevelop.AnalysisCore.Gui
}
}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
index ccd6497ea0..74d23e3a16 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
@@ -616,7 +616,7 @@ namespace MonoDevelop.CodeActions
if (insertionAction != null) {
var insertion = await insertionAction.CreateInsertion (token).ConfigureAwait (false);
- var document = IdeApp.Workbench.OpenDocument (insertion.Location.SourceTree.FilePath, documentContext.Project);
+ var document = await IdeApp.Workbench.OpenDocument (insertion.Location.SourceTree.FilePath, documentContext.Project);
var parsedDocument = await document.UpdateParseDocument ();
if (parsedDocument != null) {
var insertionPoints = InsertionPointService.GetInsertionPoints (
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionPanelWidget.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionPanelWidget.cs
index c74d775caa..7e89e64f47 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionPanelWidget.cs
@@ -26,6 +26,7 @@
using System;
using MonoDevelop.Ide.Gui.Dialogs;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using System.Linq;
using System.Text;
@@ -40,7 +41,7 @@ namespace MonoDevelop.CodeActions
{
ContextActionPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new ContextActionPanelWidget ("text/x-csharp");
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs
index 7919b5563c..4cf8446adc 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs
@@ -59,7 +59,7 @@ namespace MonoDevelop.CodeIssues
widget = new CodeIssuePanelWidget ("text/x-csharp");
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
EnsureWidget ();
return widget;
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/Commands.cs b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/Commands.cs
index 482dbcaded..93ede5928a 100644
--- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/Commands.cs
+++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/Commands.cs
@@ -27,11 +27,13 @@
//
using System;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
using Gtk;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Core;
+using System.Threading.Tasks;
namespace MonoDevelop.RegexToolkit
{
@@ -40,11 +42,11 @@ namespace MonoDevelop.RegexToolkit
ShowRegexToolkit
}
- class ViewOnlyContent : AbstractViewContent
+ class ViewOnlyContent : ViewContent
{
Widget widget;
-
- public override Widget Control {
+
+ public override Control Control {
get {
return widget;
}
@@ -54,21 +56,20 @@ namespace MonoDevelop.RegexToolkit
{
this.widget = widget;
this.ContentName = contentName;
- IsViewOnly = true;
}
-
- public override void Load (FileOpenInformation fileOpenInformation)
- {
- throw new System.NotImplementedException ();
+
+ public override bool IsViewOnly {
+ get {
+ return true;
+ }
}
-
}
- class DefaultAttachableViewContent : AbstractAttachableViewContent
+ class DefaultAttachableViewContent : BaseViewContent
{
Widget widget;
-
- public override Widget Control {
+
+ public override Control Control {
get {
return widget;
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs
index 5fc5a1c2fb..5d9067d374 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs
@@ -24,6 +24,7 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using Mono.TextEditor;
@@ -47,7 +48,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
autoInsertBraceCheckbutton.Toggled += HandleAutoInsertBraceCheckbuttonToggled;
}
- public virtual Gtk.Widget CreatePanelWidget ()
+ public virtual Control CreatePanelWidget ()
{
// this.autoInsertTemplateCheckbutton.Active = DefaultSourceEditorOptions.Options.AutoInsertTemplates;
autoInsertBraceCheckbutton.Active = DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs
index 031437a5b8..46e5157abb 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Editor.Extension;
@@ -52,7 +53,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
{
}
- Gtk.Widget IOptionsPanel.CreatePanelWidget ()
+ Control IOptionsPanel.CreatePanelWidget ()
{
filterByBrowsableCheckbutton.Active = IdeApp.Preferences.FilterCompletionListByEditorBrowsable;
normalOnlyRadiobutton.Active = !IdeApp.Preferences.IncludeEditorBrowsableAdvancedMembers;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs
index 83f4b36617..7ee88faaa1 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using Xwt;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.CodeCompletion;
@@ -87,7 +88,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
}
}
- Gtk.Widget IOptionsPanel.CreatePanelWidget ()
+ Control IOptionsPanel.CreatePanelWidget ()
{
return (Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget (this);
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs
index eff7432934..86d2a271bc 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Editor.Extension;
@@ -56,7 +57,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
{
}
- Gtk.Widget IOptionsPanel.CreatePanelWidget ()
+ Control IOptionsPanel.CreatePanelWidget ()
{
autoCodeCompletionCheckbutton.Active = DefaultSourceEditorOptions.Instance.EnableAutoCodeCompletion;
showImportsCheckbutton.Active = IdeApp.Preferences.AddImportedItemsToCompletionList;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs
index 9763ea2637..ef53e55e75 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs
@@ -25,6 +25,7 @@
using System;
using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Editor;
@@ -43,7 +44,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
this.comboboxLineEndings.Active = (int)DefaultSourceEditorOptions.Instance.LineEndingConversion;
}
- public virtual Gtk.Widget CreatePanelWidget ()
+ public virtual Control CreatePanelWidget ()
{
this.foldingCheckbutton.Active = DefaultSourceEditorOptions.Instance.ShowFoldMargin;
this.foldregionsCheckbutton.Active = DefaultSourceEditorOptions.Instance.DefaultRegionsFolding;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
index ee2c9c36a2..63219fac03 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
@@ -78,7 +78,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
return String.Format ("<b>{0}</b> - {1}", GLib.Markup.EscapeText (name), GLib.Markup.EscapeText (description));
}
- public virtual Gtk.Widget CreatePanelWidget ()
+ public virtual Control CreatePanelWidget ()
{
this.addButton.Clicked += AddColorScheme;
this.removeButton.Clicked += RemoveColorScheme;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs
index ced732ecbc..38742589e5 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs
@@ -25,6 +25,7 @@
using System;
using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Editor;
using MonoDevelop.Ide;
@@ -62,7 +63,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
this.Build();
}
- public virtual Gtk.Widget CreatePanelWidget ()
+ public virtual Control CreatePanelWidget ()
{
this.showLineNumbersCheckbutton.Active = showLineNumbers = DefaultSourceEditorOptions.Instance.ShowLineNumberMargin;
this.showLineNumbersCheckbutton.Toggled += delegate {
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs
index 2678d02fe1..148b925256 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs
@@ -28,6 +28,7 @@ using System.Threading;
using System.Threading.Tasks;
using Mono.TextEditor;
using MonoDevelop.Ide;
+using Xwt.GtkBackend;
using MonoDevelop.Core;
namespace MonoDevelop.SourceEditor.Wrappers
@@ -102,7 +103,7 @@ namespace MonoDevelop.SourceEditor.Wrappers
var wrappedEditor = WrapEditor (editor);
if (wrappedEditor == null)
return null;
- var control = provider.CreateTooltipWindow (wrappedEditor, IdeApp.Workbench.ActiveDocument, new MonoDevelop.Ide.Editor.TooltipItem (item.Item, item.ItemSegment.Offset, item.ItemSegment.Length), offset, modifierState);
+ var control = provider.CreateTooltipWindow (wrappedEditor, IdeApp.Workbench.ActiveDocument, new MonoDevelop.Ide.Editor.TooltipItem (item.Item, item.ItemSegment.Offset, item.ItemSegment.Length), offset, modifierState.ToXwtValue ());
if (control == null)
return null;
return (Gtk.Window)control;
@@ -125,7 +126,7 @@ namespace MonoDevelop.SourceEditor.Wrappers
if (wrappedEditor == null) {
return tipWindow;
}
- provider.ShowTooltipWindow (wrappedEditor, tipWindow, new MonoDevelop.Ide.Editor.TooltipItem (item.Item, item.ItemSegment.Offset, item.ItemSegment.Length), modifierState, mouseX, mouseY);
+ provider.ShowTooltipWindow (wrappedEditor, tipWindow, new MonoDevelop.Ide.Editor.TooltipItem (item.Item, item.ItemSegment.Offset, item.ItemSegment.Length), modifierState.ToXwtValue (), mouseX, mouseY);
return tipWindow;
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
index 98f8d5c09e..8d6c1b54a7 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
@@ -98,6 +98,11 @@
<Name>Mono.TextEditor</Name>
<Private>False</Private>
</ProjectReference>
+ <ProjectReference Include="..\..\..\external\xwt\Xwt.Gtk\Xwt.Gtk.csproj">
+ <Project>{C3887A93-B2BD-4097-8E2F-3A063EFF32FD}</Project>
+ <Name>Xwt.Gtk</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs
index 2a255a9644..92e1ca6b1c 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs
@@ -57,7 +57,7 @@ namespace MonoDevelop.SourceEditor
return Task.FromResult (new TooltipItem (errorInformation, editor.GetLineByOffset (offset)));
}
- public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Gdk.ModifierType modifierState)
+ public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
{
var result = new LanguageItemWindow (GetExtensibleTextEditor (editor), modifierState, null, (string)item.Item, null);
if (result.IsEmpty)
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs
index 9884a63b70..efd7a03a36 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs
@@ -131,12 +131,12 @@ namespace MonoDevelop.SourceEditor
return new TooltipItem (val, startOffset, expression.Length);
}
- public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Gdk.ModifierType modifierState)
+ public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
{
return new DebugValueWindow (editor, offset, DebuggingService.CurrentFrame, (ObjectValue) item.Item, null);
}
- public override void ShowTooltipWindow (TextEditor editor, Control tipWindow, TooltipItem item, Gdk.ModifierType modifierState, int mouseX, int mouseY)
+ public override void ShowTooltipWindow (TextEditor editor, Control tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY)
{
var location = editor.OffsetToLocation (item.Offset);
var point = editor.LocationToPoint (location);
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs
index 2670b4a4e6..a66b394315 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs
@@ -167,11 +167,12 @@ namespace MonoDevelop.SourceEditor
this.GetPosition (out x, out y);
oldY = y;
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (x, y));
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (x, y));
+ int top = (int)geometry.Top;
if (allocation.Height <= geometry.Height && y + allocation.Height >= geometry.Y + geometry.Height - edgeGap)
- y = geometry.Top + (geometry.Height - allocation.Height - edgeGap);
- if (y < geometry.Top + edgeGap)
- y = geometry.Top + edgeGap;
+ y = top + ((int)geometry.Height - allocation.Height - edgeGap);
+ if (y < top + edgeGap)
+ y = top + edgeGap;
if (y != oldY) {
Move (x, y);
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/LanguageItemWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/LanguageItemWindow.cs
index 670a320d72..252786d652 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/LanguageItemWindow.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/LanguageItemWindow.cs
@@ -43,7 +43,7 @@ namespace MonoDevelop.SourceEditor
{
public bool IsEmpty { get; set; }
- public LanguageItemWindow (ExtensibleTextEditor ed, Gdk.ModifierType modifierState, object result, string errorInformations, object unit)
+ public LanguageItemWindow (ExtensibleTextEditor ed, Xwt.ModifierKeys modifierState, object result, string errorInformations, object unit)
{
string tooltip = null;
if (result is UnknownIdentifierResolveResult) {
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
index 679471ffea..65f308d04d 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
@@ -66,10 +66,10 @@ using System.Threading;
namespace MonoDevelop.SourceEditor
{
- partial class SourceEditorView : AbstractViewContent, IBookmarkBuffer, IClipboardHandler, ITextFile,
+ partial class SourceEditorView : ViewContent, IBookmarkBuffer, IClipboardHandler, ITextFile,
ICompletionWidget, ISplittable, IFoldable, IToolboxDynamicProvider,
ICustomFilteringToolboxConsumer, IZoomable, ITextEditorResolver, ITextEditorDataProvider,
- ICodeTemplateHandler, ICodeTemplateContextProvider, ISupportsProjectReload, IPrintable,
+ ICodeTemplateHandler, ICodeTemplateContextProvider, IPrintable,
ITextEditorImpl, IEditorActionHost, ITextMarkerFactory, IUndoHandler
{
readonly SourceEditorWidget widget;
@@ -84,6 +84,12 @@ namespace MonoDevelop.SourceEditor
List<PinnedWatchInfo> pinnedWatches = new List<PinnedWatchInfo> ();
bool writeAllowed;
bool writeAccessChecked;
+
+ public ViewContent ViewContent {
+ get {
+ return this;
+ }
+ }
public TextDocument Document {
get {
@@ -115,7 +121,7 @@ namespace MonoDevelop.SourceEditor
}
}
- public override Widget Control {
+ public override Control Control {
get {
return widget != null ? widget.Vbox : null;
}
@@ -191,14 +197,6 @@ namespace MonoDevelop.SourceEditor
widget.TextEditor.Caret.PositionChanged += HandlePositionChanged;
widget.TextEditor.IconMargin.ButtonPressed += OnIconButtonPress;
- WorkbenchWindowChanged += HandleWorkbenchWindowChanged;
- ContentNameChanged += delegate {
- Document.FileName = ContentName;
- if (String.IsNullOrEmpty (ContentName) || !File.Exists (ContentName))
- return;
-
- lastSaveTimeUtc = File.GetLastWriteTimeUtc (ContentName);
- };
ClipbardRingUpdated += UpdateClipboardRing;
TextEditorService.FileExtensionAdded += HandleFileExtensionAdded;
@@ -234,6 +232,13 @@ namespace MonoDevelop.SourceEditor
FileRegistry.Add (this);
}
+ protected override void OnContentNameChanged ()
+ {
+ Document.FileName = ContentName;
+ if (!String.IsNullOrEmpty (ContentName) && File.Exists (ContentName))
+ lastSaveTimeUtc = File.GetLastWriteTimeUtc (ContentName);
+ base.OnContentNameChanged ();
+ }
void HandleLineChanged (object sender, Mono.TextEditor.LineEventArgs e)
{
@@ -321,7 +326,7 @@ namespace MonoDevelop.SourceEditor
{
if (extension is TopLevelWidgetExtension) {
var widgetExtension = (TopLevelWidgetExtension)extension;
- var w = widgetExtension.CreateWidget ();
+ Widget w = widgetExtension.CreateWidget ();
int x, y;
if (!CalcWidgetPosition (widgetExtension, w, out x, out y)) {
w.Destroy ();
@@ -467,12 +472,11 @@ namespace MonoDevelop.SourceEditor
return true;
}
- void HandleWorkbenchWindowChanged (object sender, EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- if (WorkbenchWindow != null) {
+ base.OnWorkbenchWindowChanged ();
+ if (WorkbenchWindow != null)
WorkbenchWindow.ActiveViewContentChanged += HandleActiveViewContentChanged;
- WorkbenchWindowChanged -= HandleWorkbenchWindowChanged;
- }
}
void HandleActiveViewContentChanged (object o, ActiveViewContentEventArgs e)
@@ -617,12 +621,12 @@ namespace MonoDevelop.SourceEditor
return text;
}
- public override void Save (FileSaveInformation fileSaveInformation)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
- Save (fileSaveInformation.FileName, fileSaveInformation.Encoding ?? encoding);
+ return Save (fileSaveInformation.FileName, fileSaveInformation.Encoding ?? encoding);
}
- public void Save (string fileName, Encoding encoding)
+ public async Task Save (string fileName, Encoding encoding)
{
if (widget.HasMessageBar)
return;
@@ -718,7 +722,7 @@ namespace MonoDevelop.SourceEditor
// writeBom =!Mono.TextEditor.Utils.TextFileUtility.IsASCII (writeText);
}
}
- MonoDevelop.Core.Text.TextFileUtility.WriteText (fileName, writeText, writeEncoding, writeBom);
+ await MonoDevelop.Core.Text.TextFileUtility.WriteTextAsync (fileName, writeText, writeEncoding, writeBom);
} catch (InvalidEncodingException) {
var result = MessageService.AskQuestion (GettextCatalog.GetString ("Can't save file with current codepage."),
GettextCatalog.GetString ("Some unicode characters in this file could not be saved with the current encoding.\nDo you want to resave this file as Unicode ?\nYou can choose another encoding in the 'save as' dialog."),
@@ -774,14 +778,14 @@ namespace MonoDevelop.SourceEditor
Document.InformLoadComplete ();
}
- public override void LoadNew (Stream content, string mimeType)
+ public override Task LoadNew (Stream content, string mimeType)
{
throw new NotSupportedException ("Moved to TextEditorViewContent.LoadNew.");
}
- public override void Load (FileOpenInformation fileOpenInformation)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
- Load (fileOpenInformation.FileName, fileOpenInformation.Encoding, fileOpenInformation.IsReloadOperation);
+ return Load (fileOpenInformation.FileName, fileOpenInformation.Encoding, fileOpenInformation.IsReloadOperation);
}
protected virtual string ProcessLoadText (string text)
@@ -797,7 +801,7 @@ namespace MonoDevelop.SourceEditor
}
}
- public void Load (string fileName, Encoding loadEncoding, bool reload = false)
+ public async Task Load (string fileName, Encoding loadEncoding, bool reload = false)
{
widget.TextEditor.Document.TextReplaced -= OnTextReplaced;
@@ -818,10 +822,15 @@ namespace MonoDevelop.SourceEditor
else {
inLoad = true;
if (loadEncoding == null) {
- text = MonoDevelop.Core.Text.TextFileUtility.ReadAllText (fileName, out hadBom, out encoding);
+ var res = await MonoDevelop.Core.Text.TextFileUtility.ReadAllTextAsync (fileName);
+ text = res.Text;
+ hadBom = res.HasBom;
+ encoding = res.Encoding;
} else {
encoding = loadEncoding;
- text = MonoDevelop.Core.Text.TextFileUtility.ReadAllText (fileName, loadEncoding, out hadBom);
+ var res = await MonoDevelop.Core.Text.TextFileUtility.ReadAllTextAsync (fileName, loadEncoding);
+ text = res.Text;
+ hadBom = res.HasBom;
}
text = ProcessLoadText (text);
if (reload) {
@@ -2267,17 +2276,12 @@ namespace MonoDevelop.SourceEditor
#region ISupportsProjectReload implementaion
- ProjectReloadCapability ISupportsProjectReload.ProjectReloadCapability {
+ public override ProjectReloadCapability ProjectReloadCapability {
get {
return ProjectReloadCapability.Full;
}
}
-
- void ISupportsProjectReload.Update (Project project)
- {
- // The project will be assigned to the view. Nothing else to do.
- }
-
+
#endregion
#endregion
@@ -2321,14 +2325,13 @@ namespace MonoDevelop.SourceEditor
}
}
- public override object GetContent (Type type)
+ protected override object OnGetContent (Type type)
{
if (type.Equals (typeof(TextEditorData)))
return TextEditor.GetTextEditorData ();
- return base.GetContent (type);
+ return base.OnGetContent (type);
}
-
#region widget command handlers
[CommandHandler (SearchCommands.EmacsFindNext)]
public void EmacsFindNext ()
@@ -2577,7 +2580,7 @@ namespace MonoDevelop.SourceEditor
object ITextEditorImpl.CreateNativeControl ()
{
- return Control;
+ return widget != null ? widget.Vbox : null;
}
string ITextEditorImpl.FormatString (int offset, string code)
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/SmartTagMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/SmartTagMarker.cs
index c3d828e858..78d287400a 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/SmartTagMarker.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/SmartTagMarker.cs
@@ -105,13 +105,6 @@ namespace MonoDevelop.SourceEditor
y - y2 < (editor.LineHeight / 2) * editor.Options.Zoom;
}
- bool ISmartTagMarker.IsInsideWindow (Gtk.MotionNotifyEventArgs args)
- {
- if (editor == null)
- return false;
- return args.Event.Window == editor.TextArea.GdkWindow;
- }
-
public event EventHandler<TextMarkerMouseEventArgs> MousePressed;
public event EventHandler<TextMarkerMouseEventArgs> MouseHover;
public event EventHandler ShowPopup;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
index 281ff56fc7..06344bffd5 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
@@ -2414,6 +2414,7 @@
<widget class="Gtk.Bin" id="MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel" design-size="427 423">
<property name="MemberName" />
<property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
<child>
<widget class="Gtk.VBox" id="vbox1">
<property name="MemberName" />
diff --git a/main/src/addins/NUnit/Gui/TestPad.cs b/main/src/addins/NUnit/Gui/TestPad.cs
index 4276eccf11..99643f5e34 100644
--- a/main/src/addins/NUnit/Gui/TestPad.cs
+++ b/main/src/addins/NUnit/Gui/TestPad.cs
@@ -90,7 +90,7 @@ namespace MonoDevelop.NUnit
paned = new VPaned ();
VBox vbox = new VBox ();
- DockItemToolbar topToolbar = Window.GetToolbar (PositionType.Top);
+ DockItemToolbar topToolbar = Window.GetToolbar (DockPositionType.Top);
var hbox = new HBox { Spacing = 6 };
hbox.PackStart (new ImageView (ImageService.GetIcon ("nunit-run", IconSize.Menu)), false, false, 0);
@@ -146,10 +146,12 @@ namespace MonoDevelop.NUnit
VBox boxPaned1 = new VBox ();
chart = new TestChart ();
- chart.ButtonPressEvent += OnChartButtonPress;
chart.SelectionChanged += new EventHandler (OnChartDateChanged);
- chart.HeightRequest = 50;
-
+
+ var chartWidget = chart.GetNativeWidget<Widget> ();
+ chartWidget.ButtonPressEvent += OnChartButtonPress;
+ chartWidget.HeightRequest = 50;
+
Toolbar toolbar = new Toolbar ();
toolbar.IconSize = IconSize.SmallToolbar;
toolbar.ToolbarStyle = ToolbarStyle.Icons;
@@ -382,7 +384,7 @@ namespace MonoDevelop.NUnit
return TreeView.GetNodeAtObject (t);
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return paned;
}
diff --git a/main/src/addins/NUnit/Gui/TestResultsPad.cs b/main/src/addins/NUnit/Gui/TestResultsPad.cs
index fb74b629b8..5b5ede5252 100644
--- a/main/src/addins/NUnit/Gui/TestResultsPad.cs
+++ b/main/src/addins/NUnit/Gui/TestResultsPad.cs
@@ -49,7 +49,7 @@ using MonoDevelop.NUnit.External;
namespace MonoDevelop.NUnit
{
- public class TestResultsPad: IPadContent, ITestProgressMonitor
+ public class TestResultsPad: PadContent, ITestProgressMonitor
{
NUnitService testService = NUnitService.Instance;
@@ -154,16 +154,16 @@ namespace MonoDevelop.NUnit
"/MonoDevelop/NUnit/ContextMenu/TestResultsPad");
};
- Control.ShowAll ();
+ panel.ShowAll ();
outputViewScrolled.Hide ();
}
- void IPadContent.Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
this.window = window;
- DockItemToolbar toolbar = window.GetToolbar (PositionType.Top);
+ DockItemToolbar toolbar = window.GetToolbar (DockPositionType.Top);
buttonSuccess = new ToggleButton ();
buttonSuccess.Label = GettextCatalog.GetString ("Successful Tests");
@@ -228,7 +228,7 @@ namespace MonoDevelop.NUnit
// Run panel
- DockItemToolbar runPanel = window.GetToolbar (PositionType.Bottom);
+ DockItemToolbar runPanel = window.GetToolbar (DockPositionType.Bottom);
infoSep = new VSeparator ();
@@ -257,10 +257,6 @@ namespace MonoDevelop.NUnit
UpdateCounters ();
}
- public void Dispose ()
- {
- }
-
public void OnTestSuiteChanged (object sender, EventArgs e)
{
if (rootTest != null) {
@@ -306,16 +302,12 @@ namespace MonoDevelop.NUnit
}
}
- public Gtk.Widget Control {
+ public override Control Control {
get {
return panel;
}
}
- public void RedrawContent ()
- {
- }
-
string GetResultsMarkup ()
{
return string.Format (GettextCatalog.GetString ("<b>Passed</b>: {0} <b>Failed</b>: {1} <b>Errors</b>: {2} <b>Inconclusive</b>: {3} <b>Invalid</b>: {4} <b>Ignored</b>: {5} <b>Skipped</b>: {6} <b>Time</b>: {7}"),
diff --git a/main/src/addins/VBNetBinding/Gui/ConfigurationOptionsPanel.cs b/main/src/addins/VBNetBinding/Gui/ConfigurationOptionsPanel.cs
index 71148c8a1b..80c602a526 100644
--- a/main/src/addins/VBNetBinding/Gui/ConfigurationOptionsPanel.cs
+++ b/main/src/addins/VBNetBinding/Gui/ConfigurationOptionsPanel.cs
@@ -28,6 +28,7 @@
using System;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -41,7 +42,7 @@ namespace MonoDevelop.VBNetBinding
{
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
Console.WriteLine ("ConfigurationOptionsPanel.CreatePanelWidget");
return (widget = new ConfigurationOptionsPanelWidget (ConfiguredProject));
diff --git a/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanel.cs b/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanel.cs
index 76fb8745fa..ea3eb9fe18 100644
--- a/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanel.cs
+++ b/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanel.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.VBNetBinding
@@ -36,7 +37,7 @@ namespace MonoDevelop.VBNetBinding
{
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new ImportsOptionsPanelWidget (ConfiguredProject));
}
diff --git a/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanel.cs b/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanel.cs
index a456dc913b..9217e09362 100644
--- a/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanel.cs
+++ b/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanel.cs
@@ -26,7 +26,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.VBNetBinding
@@ -39,7 +39,7 @@ namespace MonoDevelop.VBNetBinding
{
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new ProjectOptionsPanelWidget (ConfiguredProject));
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs
index 1a2b78edab..bbf092f617 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs
@@ -64,7 +64,7 @@ namespace MonoDevelop.VersionControl.Git
protected GitRepository UpdateVisibility (CommandInfo info)
{
var repo = Repository;
- info.Visible = Repository != null;
+ info.Visible = repo != null;
return repo;
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/CredentialsDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/CredentialsDialog.cs
index ab4e9ff94a..f534745e88 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/CredentialsDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/CredentialsDialog.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Components;
namespace MonoDevelop.VersionControl.Git
{
- partial class CredentialsDialog : Dialog
+ partial class CredentialsDialog : Gtk.Dialog
{
uint r;
public CredentialsDialog (string uri, SupportedCredentialTypes type, Credentials cred)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
index a41d5fc3e6..1929c1fbad 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
@@ -35,7 +35,7 @@ using System.ComponentModel;
namespace MonoDevelop.VersionControl.Git
{
- partial class EditBranchDialog : Dialog
+ partial class EditBranchDialog : Gtk.Dialog
{
readonly ListStore comboStore;
readonly string currentTracking;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
index 712073976e..63c4269f48 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
@@ -35,7 +35,7 @@ using System.ComponentModel;
namespace MonoDevelop.VersionControl.Git
{
- partial class GitConfigurationDialog : Dialog
+ partial class GitConfigurationDialog : Gtk.Dialog
{
readonly GitRepository repo;
readonly ListStore storeBranches;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanel.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanel.cs
index 5a09a60d17..640a44142c 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanel.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanel.cs
@@ -23,6 +23,7 @@
// 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 MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.VersionControl.Git
@@ -31,7 +32,7 @@ namespace MonoDevelop.VersionControl.Git
{
GitOptionsPanelWidget widget;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new GitOptionsPanelWidget ();
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanelWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanelWidget.cs
index fb2c8d024a..6dfc4554f5 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanelWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanelWidget.cs
@@ -39,9 +39,9 @@ namespace MonoDevelop.VersionControl.Git
public void ApplyChanges ()
{
- GitService.UseRebaseOptionWhenPulling = checkRebase.Active;
- GitService.StashUnstashWhenUpdating = checkStashUpdate.Active;
- GitService.StashUnstashWhenSwitchingBranches = checkStashBranch.Active;
+ GitService.UseRebaseOptionWhenPulling.Value = checkRebase.Active;
+ GitService.StashUnstashWhenUpdating.Value = checkStashUpdate.Active;
+ GitService.StashUnstashWhenSwitchingBranches.Value = checkStashBranch.Active;
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs
index 9e05055ccd..74c3028d13 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs
@@ -36,23 +36,9 @@ namespace MonoDevelop.VersionControl.Git
{
public static class GitService
{
- public static bool UseRebaseOptionWhenPulling
- {
- get { return PropertyService.Get ("MonoDevelop.VersionControl.Git.UseRebaseOptionWhenPulling", true); }
- set { PropertyService.Set ("MonoDevelop.VersionControl.Git.UseRebaseOptionWhenPulling", value); }
- }
-
- public static bool StashUnstashWhenUpdating
- {
- get { return PropertyService.Get ("MonoDevelop.VersionControl.Git.StashUnstashWhenUpdating", true); }
- set { PropertyService.Set ("MonoDevelop.VersionControl.Git.StashUnstashWhenUpdating", value); }
- }
-
- public static bool StashUnstashWhenSwitchingBranches
- {
- get { return PropertyService.Get ("MonoDevelop.VersionControl.Git.StashUnstashWhenSwitchingBranches", true); }
- set { PropertyService.Set ("MonoDevelop.VersionControl.Git.StashUnstashWhenSwitchingBranches", value); }
- }
+ public static ConfigurationProperty<bool> UseRebaseOptionWhenPulling = ConfigurationProperty.Create ("MonoDevelop.VersionControl.Git.UseRebaseOptionWhenPulling", true);
+ public static ConfigurationProperty<bool> StashUnstashWhenUpdating = ConfigurationProperty.Create ("MonoDevelop.VersionControl.Git.StashUnstashWhenUpdating", true);
+ public static ConfigurationProperty<bool> StashUnstashWhenSwitchingBranches = ConfigurationProperty.Create ("MonoDevelop.VersionControl.Git.StashUnstashWhenSwitchingBranches", true);
public static void Push (GitRepository repo)
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/MergeDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/MergeDialog.cs
index 98c2115e7a..57d82ff2d6 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/MergeDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/MergeDialog.cs
@@ -33,7 +33,7 @@ using LibGit2Sharp;
namespace MonoDevelop.VersionControl.Git
{
- partial class MergeDialog : Dialog
+ partial class MergeDialog : Gtk.Dialog
{
readonly TreeStore store;
readonly GitRepository repo;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs
index 76485e358d..92c9eb3028 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs
@@ -31,7 +31,7 @@ using LibGit2Sharp;
namespace MonoDevelop.VersionControl.Git
{
- partial class StashManagerDialog : Dialog
+ partial class StashManagerDialog : Gtk.Dialog
{
readonly GitRepository repository;
readonly ListStore store;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlGeneralOptionsPanel.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlGeneralOptionsPanel.cs
index 7fd5e9adf6..52c06c78d8 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlGeneralOptionsPanel.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlGeneralOptionsPanel.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.VersionControl
{
Xwt.CheckBox disableVersionControl;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
Xwt.VBox box = new Xwt.VBox ();
box.Spacing = 6;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs
index aeb604d3e7..3ff75dc197 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs
@@ -25,7 +25,7 @@
//
//
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -37,7 +37,7 @@ namespace MonoDevelop.VersionControl
CommitMessageStylePanelWidget widget;
CommitMessageFormat format;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
format = new CommitMessageFormat ();
widget = new CommitMessageStylePanelWidget ();
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlSolutionOptionsPanel.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlSolutionOptionsPanel.cs
index f97e1570c6..709c490693 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlSolutionOptionsPanel.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlSolutionOptionsPanel.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.VersionControl
{
Xwt.CheckBox disableVersionControl;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
Xwt.VBox box = new Xwt.VBox ();
box.Spacing = 6;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BaseView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BaseView.cs
index f9bcd2461a..bdf5f4ebcb 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BaseView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BaseView.cs
@@ -1,108 +1,31 @@
using System;
-using System.IO;
+using System.IO;
using MonoDevelop.Ide.Gui;
using System.Text;
-
+using Gtk;
+using System.Threading.Tasks;
+using MonoDevelop.Components;
+
namespace MonoDevelop.VersionControl
{
- public abstract class BaseView : AbstractBaseViewContent, IViewContent
+ public abstract class BaseView : ViewContent
{
string name;
protected BaseView (string name)
{
this.name = name;
- }
-
- protected virtual void SaveAs (FileSaveInformation fileSaveInformation)
- {
- }
-
- void IViewContent.Load (FileOpenInformation fileOpenInformation)
- {
- throw new InvalidOperationException();
- }
-
- void IViewContent.Load (string fileName)
- {
- throw new InvalidOperationException();
- }
-
- void IViewContent.LoadNew (Stream stream, string mimeType)
- {
- throw new InvalidOperationException ();
- }
-
- void IViewContent.Save ()
- {
- throw new InvalidOperationException ();
- }
-
- void IViewContent.DiscardChanges ()
- {
- }
-
- void IViewContent.Save (string fileName)
- {
- SaveAs (new FileSaveInformation (fileName));
- }
-
- void IViewContent.Save (FileSaveInformation info)
- {
- SaveAs (info);
- }
-
- string IViewContent.ContentName {
- get { return name; }
- set { }
- }
-
- bool IViewContent.IsDirty {
- get { return false; }
- set { }
- }
-
- bool IViewContent.IsReadOnly {
- get { return true; }
- }
-
- bool IViewContent.IsUntitled {
- get { return false; }
- }
-
- bool IViewContent.IsViewOnly {
- get { return false; }
}
-
- bool IViewContent.IsFile {
- get { return false; }
- }
-
- string IViewContent.PathRelativeToProject {
- get { return ""; }
- }
-
- MonoDevelop.Projects.Project IViewContent.Project {
- get { return null; }
- set { }
- }
-
+
+ public override Control Control {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
public override string TabPageLabel {
get { return name; }
}
-
- public virtual string StockIconId {
- get { return null; }
- }
-
- string IViewContent.UntitledName {
- get { return ""; }
- set { }
- }
-
- event EventHandler IViewContent.BeforeSave { add { } remove { } }
- event EventHandler IViewContent.ContentChanged { add { } remove { } }
- event EventHandler IViewContent.ContentNameChanged { add { } remove { } }
- event EventHandler IViewContent.DirtyChanged { add { } remove { } }
}
} \ No newline at end of file
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameView.cs
index ee6571fb78..2faf833e3e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameView.cs
@@ -24,13 +24,16 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using Mono.TextEditor;
+using MonoDevelop.Components;
+
namespace MonoDevelop.VersionControl.Views
{
- public interface IBlameView : IAttachableViewContent
+ public interface IBlameView
{
}
@@ -39,7 +42,7 @@ namespace MonoDevelop.VersionControl.Views
BlameWidget widget;
VersionControlDocumentInfo info;
- public override Gtk.Widget Control {
+ public override Control Control {
get {
if (widget == null)
widget = new BlameWidget (info);
@@ -53,7 +56,7 @@ namespace MonoDevelop.VersionControl.Views
}
#region IAttachableViewContent implementation
- public void Selected ()
+ protected override void OnSelected ()
{
info.Start ();
var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();
@@ -63,7 +66,7 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public void Deselected ()
+ protected override void OnDeselected ()
{
var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();
if (sourceEditor != null) {
@@ -72,13 +75,6 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public void BeforeSave ()
- {
- }
-
- public void BaseContentChanged ()
- {
- }
#endregion
#region IUndoHandler implementation
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs
index 3162f4818c..d519772c24 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs
@@ -26,12 +26,14 @@
using System;
using MonoDevelop.Ide.Gui;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Components;
namespace MonoDevelop.VersionControl.Views
{
- public interface IDiffView : IAttachableViewContent
+ public interface IDiffView
{
}
@@ -39,7 +41,7 @@ namespace MonoDevelop.VersionControl.Views
{
DiffWidget widget;
- public override Gtk.Widget Control {
+ public override Control Control {
get {
if (widget == null) {
widget = new DiffWidget (info);
@@ -89,7 +91,7 @@ namespace MonoDevelop.VersionControl.Views
return editor.YToLine (midY);
}
- public void Selected ()
+ protected override void OnSelected ()
{
info.Start ();
ComparisonWidget.UpdateLocalText ();
@@ -121,7 +123,7 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public void Deselected ()
+ protected override void OnDeselected ()
{
var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();
if (sourceEditor != null) {
@@ -133,14 +135,6 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public void BeforeSave ()
- {
- }
-
- public void BaseContentChanged ()
- {
- }
-
#endregion
#region IUndoHandler implementation
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs
index d98b37dab1..9535f73741 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs
@@ -35,8 +35,8 @@ namespace MonoDevelop.VersionControl.Views
VersionControlDocumentInfo info;
Mono.TextEditor.MonoTextEditor diffTextEditor;
ComparisonWidget comparisonWidget;
- Gtk.Button buttonNext;
- Gtk.Button buttonPrev;
+ DocumentToolButton buttonNext;
+ DocumentToolButton buttonPrev;
Gtk.Button buttonDiff;
Gtk.Label labelOverview;
@@ -114,7 +114,8 @@ namespace MonoDevelop.VersionControl.Views
void SetButtonSensitivity ()
{
- this.buttonNext.Sensitive = this.buttonPrev.Sensitive = notebook1.Page == 0 && comparisonWidget.Diff != null && comparisonWidget.Diff.Count > 0;
+ this.buttonNext.GetNativeWidget<Gtk.Widget> ().Sensitive = this.buttonPrev.GetNativeWidget<Gtk.Widget> ().Sensitive =
+ notebook1.Page == 0 && comparisonWidget.Diff != null && comparisonWidget.Diff.Count > 0;
}
void HandleButtonDiffhandleClicked (object sender, EventArgs e)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DropDownBox.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DropDownBox.cs
index 32e8313988..17cfb0693e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DropDownBox.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DropDownBox.cs
@@ -87,8 +87,8 @@ namespace MonoDevelop.VersionControl.Views
set;
}
- Window window = null;
- public Func<DropDownBox, Window> WindowRequestFunc = null;
+ Gtk.Window window = null;
+ public Func<DropDownBox, Gtk.Window> WindowRequestFunc = null;
public DropDownBox ()
@@ -110,12 +110,12 @@ namespace MonoDevelop.VersionControl.Views
window.WidthRequest = Allocation.Width;
int width, height;
window.GetSizeRequest (out width, out height);
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (dx, dy));
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (dx, dy));
if (dy + height > geometry.Bottom)
dy = oy + this.Allocation.Y - height;
if (dx + width > geometry.Right)
- dx = geometry.Right - width;
+ dx = (int)geometry.Right - width;
window.Move (dx, dy);
window.GetSizeRequest (out width, out height);
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs
index 85ddea19d3..4bd68c8f53 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs
@@ -2,18 +2,20 @@ using System;
using System.IO;
using Gtk;
using MonoDevelop.Core;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide;
using System.Linq;
+using MonoDevelop.Components;
namespace MonoDevelop.VersionControl.Views
{
- public interface ILogView : IAttachableViewContent
+ public interface ILogView
{
}
- public class LogView : BaseView, ILogView
+ class LogView : BaseView, ILogView
{
LogWidget widget;
VersionInfo vinfo;
@@ -78,7 +80,7 @@ namespace MonoDevelop.VersionControl.Views
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
if (widget == null)
CreateControlFromInfo ();
@@ -86,9 +88,9 @@ namespace MonoDevelop.VersionControl.Views
}
}
- protected override void OnWorkbenchWindowChanged (EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- base.OnWorkbenchWindowChanged (e);
+ base.OnWorkbenchWindowChanged ();
if (WorkbenchWindow != null && widget != null)
widget.SetToolbar (WorkbenchWindow.GetToolbar (this));
}
@@ -110,8 +112,7 @@ namespace MonoDevelop.VersionControl.Views
base.Dispose ();
}
- #region IAttachableViewContent implementation
- public void Selected ()
+ public void Init ()
{
if (info != null && !info.Started) {
widget.ShowLoading ();
@@ -119,17 +120,12 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public void Deselected ()
- {
- }
-
- public void BeforeSave ()
+ #region IAttachableViewContent implementation
+ protected override void OnSelected ()
{
+ Init ();
}
- public void BaseContentChanged ()
- {
- }
#endregion
[CommandHandler (MonoDevelop.Ide.Commands.EditCommands.Copy)]
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs
index b36e4d446c..f4485769ae 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs
@@ -52,7 +52,7 @@ namespace MonoDevelop.VersionControl.Views
ListStore logstore = new ListStore (typeof (Revision), typeof(string));
FileTreeView treeviewFiles;
TreeStore changedpathstore;
- Gtk.Button revertButton, revertToButton, refreshButton;
+ DocumentToolButton revertButton, revertToButton, refreshButton;
SearchEntry searchEntry;
string currentFilter;
@@ -124,11 +124,11 @@ namespace MonoDevelop.VersionControl.Views
vpaned1 = vpaned1.ReplaceWithWidget (new VPanedThin () { HandleWidget = separator }, true);
revertButton = new DocumentToolButton ("vc-revert-command", GettextCatalog.GetString ("Revert changes from this revision"));
- revertButton.Sensitive = false;
+ revertButton.GetNativeWidget<Gtk.Widget> ().Sensitive = false;
revertButton.Clicked += new EventHandler (RevertRevisionClicked);
revertToButton = new DocumentToolButton ("vc-revert-command", GettextCatalog.GetString ("Revert to this revision"));
- revertToButton.Sensitive = false;
+ revertToButton.GetNativeWidget<Gtk.Widget> ().Sensitive = false;
revertToButton.Clicked += new EventHandler (RevertToRevisionClicked);
refreshButton = new DocumentToolButton (Gtk.Stock.Refresh, GettextCatalog.GetString ("Refresh"));
@@ -315,10 +315,10 @@ namespace MonoDevelop.VersionControl.Views
{
ShowLoading ();
info.Start (true);
- revertButton.Sensitive = revertToButton.Sensitive = false;
+ revertButton.GetNativeWidget<Gtk.Widget> ().Sensitive = revertToButton.GetNativeWidget<Gtk.Widget> ().Sensitive = false;
}
- void HandleTreeviewFilesDiffLineActivated (object sender, EventArgs e)
+ async void HandleTreeviewFilesDiffLineActivated (object sender, EventArgs e)
{
TreePath[] paths = treeviewFiles.Selection.GetSelectedRows ();
@@ -332,7 +332,7 @@ namespace MonoDevelop.VersionControl.Views
int line = diffRenderer.GetSelectedLine (paths[0]);
if (line == -1)
line = 1;
- var doc = IdeApp.Workbench.OpenDocument (fileName, line, 0, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ var doc = await IdeApp.Workbench.OpenDocument (fileName, line, 0, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
int i = 1;
foreach (var content in doc.Window.SubViewContents) {
DiffView diffView = content as DiffView;
@@ -630,7 +630,7 @@ namespace MonoDevelop.VersionControl.Views
if (d == null)
return;
- revertButton.Sensitive = revertToButton.Sensitive = true;
+ revertButton.GetNativeWidget<Gtk.Widget> ().Sensitive = revertToButton.GetNativeWidget<Gtk.Widget> ().Sensitive = true;
Gtk.TreeIter selectIter = Gtk.TreeIter.Zero;
bool select = false;
foreach (RevisionPath rp in info.Repository.GetRevisionChanges (d)) {
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeView.cs
index 8cb107fa2d..5408740683 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeView.cs
@@ -24,11 +24,13 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using MonoDevelop.Ide.Gui;
+using MonoDevelop.Components;
using MonoDevelop.Core;
+using MonoDevelop.Components;
namespace MonoDevelop.VersionControl.Views
{
- public interface IMergeView : IAttachableViewContent
+ public interface IMergeView
{
}
@@ -37,7 +39,7 @@ namespace MonoDevelop.VersionControl.Views
VersionControlDocumentInfo info;
MergeWidget widget;
- public override Gtk.Widget Control {
+ public override Control Control {
get {
if (widget == null) {
widget = new MergeWidget ();
@@ -53,23 +55,11 @@ namespace MonoDevelop.VersionControl.Views
this.info = info;
}
- public void Selected ()
+ protected override void OnSelected ()
{
widget.UpdateLocalText ();
widget.info.Start ();
}
-
- public void Deselected ()
- {
- }
-
- public void BeforeSave ()
- {
- }
-
- public void BaseContentChanged ()
- {
- }
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs
index 22090f22be..9fa3c9bb52 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs
@@ -8,6 +8,7 @@ using Mono.Addins;
using Gtk;
using MonoDevelop.Core;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui.Components;
@@ -290,9 +291,9 @@ namespace MonoDevelop.VersionControl.Views
Init ();
}
- protected override void OnWorkbenchWindowChanged (EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- base.OnWorkbenchWindowChanged (e);
+ base.OnWorkbenchWindowChanged ();
if (WorkbenchWindow == null)
return;
@@ -357,10 +358,6 @@ namespace MonoDevelop.VersionControl.Views
toolbar.ShowAll ();
}
- public override string StockIconId {
- get { return "vc-status"; }
- }
-
int CompareNodes (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b)
{
int col, val=0;
@@ -436,7 +433,7 @@ namespace MonoDevelop.VersionControl.Views
base.Dispose ();
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return widget;
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
index b95b373dea..0066ea4585 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
@@ -71,10 +71,10 @@ namespace MonoDevelop.VersionControl.Views
var item = new VersionControlItem (repo, project, document.FileName, false, null);
var vcInfo = new VersionControlDocumentInfo (document.PrimaryView, item, item.Repository);
- TryAttachView <IDiffView> (document, vcInfo, DiffCommand.DiffViewHandlers);
- TryAttachView <IBlameView> (document, vcInfo, BlameCommand.BlameViewHandlers);
- TryAttachView <ILogView> (document, vcInfo, LogCommand.LogViewHandlers);
- TryAttachView <IMergeView> (document, vcInfo, MergeCommand.MergeViewHandlers);
+ TryAttachView (document, vcInfo, DiffCommand.DiffViewHandlers);
+ TryAttachView (document, vcInfo, BlameCommand.BlameViewHandlers);
+ TryAttachView (document, vcInfo, LogCommand.LogViewHandlers);
+ TryAttachView (document, vcInfo, MergeCommand.MergeViewHandlers);
} catch (Exception ex) {
// If a user is hitting this, it will show a dialog box every time they
// switch to a document or open a document, so suppress the crash dialog
@@ -83,10 +83,9 @@ namespace MonoDevelop.VersionControl.Views
}
}
- static void TryAttachView <T>(Document document, VersionControlDocumentInfo info, string type)
- where T : IAttachableViewContent
+ static void TryAttachView (Document document, VersionControlDocumentInfo info, string type)
{
- var handler = AddinManager.GetExtensionObjects<IVersionControlViewHandler<T>> (type)
+ var handler = AddinManager.GetExtensionObjects<IVersionControlViewHandler> (type)
.FirstOrDefault (h => h.CanHandle (info.Item, info.Document));
if (handler != null)
document.Window.AttachViewContent (handler.CreateView (info));
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/BlameCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/BlameCommand.cs
index 962f071d59..aaf261fb93 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/BlameCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/BlameCommand.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System.Linq;
+using System.Threading.Tasks;
using Mono.Addins;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
@@ -41,16 +42,16 @@ namespace MonoDevelop.VersionControl
return !item.IsDirectory
// FIXME: Review appending of Annotate support and use it.
&& item.VersionInfo.IsVersioned
- && AddinManager.GetExtensionObjects<IBlameViewHandler> (BlameViewHandlers).Any (h => h.CanHandle (item, null));
+ && AddinManager.GetExtensionObjects<IVersionControlViewHandler> (BlameViewHandlers).Any (h => h.CanHandle (item, null));
}
- public static bool Show (VersionControlItemList items, bool test)
+ public static async Task<bool> Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
- var document = IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ var document = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null)
document.Window.SwitchView (document.Window.FindView<IBlameView> ());
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs
index af63bcf93e..be79ed4eff 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs
@@ -243,7 +243,7 @@ namespace MonoDevelop.VersionControl
}
}
- class CurrentFileViewHandler<T> : FileVersionControlCommandHandler where T:IAttachableViewContent
+ class CurrentFileViewHandler<T> : FileVersionControlCommandHandler
{
protected override bool RunCommand (VersionControlItemList items, bool test)
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultBlameViewHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultBlameViewHandler.cs
index 1259363f52..01d1846ea1 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultBlameViewHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultBlameViewHandler.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Projects.Text;
namespace MonoDevelop.VersionControl
{
- public class DefaultBlameViewHandler : IBlameViewHandler
+ public class DefaultBlameViewHandler : IVersionControlViewHandler
{
public bool CanHandle (VersionControlItem item, DocumentView primaryView)
{
@@ -39,7 +39,7 @@ namespace MonoDevelop.VersionControl
&& item.Repository.GetFileIsText (item.Path);
}
- public IBlameView CreateView (VersionControlDocumentInfo info)
+ public BaseViewContent CreateView (VersionControlDocumentInfo info)
{
return new BlameView (info);
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultDiffViewHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultDiffViewHandler.cs
index 4a2e775386..40ac9fa5ea 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultDiffViewHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultDiffViewHandler.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Projects.Text;
namespace MonoDevelop.VersionControl
{
- public class DefaultDiffViewHandler : IDiffViewHandler
+ public class DefaultDiffViewHandler : IVersionControlViewHandler
{
public bool CanHandle (VersionControlItem item, DocumentView primaryView)
{
@@ -39,7 +39,7 @@ namespace MonoDevelop.VersionControl
&& item.Repository.GetFileIsText (item.Path);
}
- public IDiffView CreateView (VersionControlDocumentInfo info)
+ public BaseViewContent CreateView (VersionControlDocumentInfo info)
{
return new DiffView (info);
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultLogViewHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultLogViewHandler.cs
index 9537bb7dfa..51b8c6b613 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultLogViewHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultLogViewHandler.cs
@@ -29,14 +29,14 @@ using MonoDevelop.VersionControl.Views;
namespace MonoDevelop.VersionControl
{
- public class DefaultLogViewHandler : ILogViewHandler
+ public class DefaultLogViewHandler : IVersionControlViewHandler
{
public bool CanHandle (VersionControlItem item, DocumentView primaryView)
{
return true;
}
- public ILogView CreateView (VersionControlDocumentInfo info)
+ public BaseViewContent CreateView (VersionControlDocumentInfo info)
{
return new LogView (info);
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultMergeViewHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultMergeViewHandler.cs
index aba6756b08..ae646cd4b8 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultMergeViewHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultMergeViewHandler.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Projects.Text;
namespace MonoDevelop.VersionControl
{
- public class DefaultMergeViewHandler : IMergeViewHandler
+ public class DefaultMergeViewHandler : IVersionControlViewHandler
{
public bool CanHandle (VersionControlItem item, DocumentView primaryView)
{
@@ -39,7 +39,7 @@ namespace MonoDevelop.VersionControl
&& item.Repository.GetFileIsText (item.Path);
}
- public IMergeView CreateView (VersionControlDocumentInfo info)
+ public BaseViewContent CreateView (VersionControlDocumentInfo info)
{
return new MergeView (info);
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DiffCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DiffCommand.cs
index e865489318..46ee00b80d 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DiffCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DiffCommand.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System.Linq;
+using System.Threading.Tasks;
using Mono.Addins;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
@@ -40,16 +41,16 @@ namespace MonoDevelop.VersionControl
{
return !item.IsDirectory
&& item.VersionInfo.IsVersioned
- && AddinManager.GetExtensionObjects<IDiffViewHandler> (DiffViewHandlers).Any (h => h.CanHandle (item, null));
+ && AddinManager.GetExtensionObjects<IVersionControlViewHandler> (DiffViewHandlers).Any (h => h.CanHandle (item, null));
}
- public static bool Show (VersionControlItemList items, bool test)
+ public static async Task<bool> Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
- var document = IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ var document = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null)
document.Window.SwitchView (document.Window.FindView<IDiffView> ());
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IVersionControlViewHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IVersionControlViewHandler.cs
index da8611f941..2620d3c664 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IVersionControlViewHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IVersionControlViewHandler.cs
@@ -29,31 +29,10 @@ using MonoDevelop.Ide.Gui;
namespace MonoDevelop.VersionControl {
- public interface IVersionControlViewHandler<T>
- where T : IAttachableViewContent
+ public interface IVersionControlViewHandler
{
bool CanHandle (VersionControlItem item, DocumentView primaryView);
- T CreateView (VersionControlDocumentInfo info);
- }
-
- public interface IDiffViewHandler : IVersionControlViewHandler<IDiffView>
- {
-
- }
-
- public interface IBlameViewHandler : IVersionControlViewHandler<IBlameView>
- {
-
- }
-
- public interface ILogViewHandler : IVersionControlViewHandler<ILogView>
- {
-
- }
-
- public interface IMergeViewHandler : IVersionControlViewHandler<IMergeView>
- {
-
+ BaseViewContent CreateView (VersionControlDocumentInfo info);
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LogCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LogCommand.cs
index 7e44c23b1d..8cce4231fd 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LogCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LogCommand.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System.Linq;
+using System.Threading.Tasks;
using Mono.Addins;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
@@ -40,11 +41,11 @@ namespace MonoDevelop.VersionControl
{
// We want directories to be able to view the log for an entire directory
// by selecting it from the solution pane
- return item.VersionInfo.IsVersioned
- && AddinManager.GetExtensionObjects<ILogViewHandler> (LogViewHandlers).Any (h => h.CanHandle (item, null));
+ return item.VersionInfo.IsVersioned &&
+ AddinManager.GetExtensionObjects<IVersionControlViewHandler> (LogViewHandlers).Any (h => h.CanHandle (item, null));
}
- public static bool Show (VersionControlItemList items, bool test)
+ public static async Task<bool> Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
@@ -52,7 +53,7 @@ namespace MonoDevelop.VersionControl
foreach (var item in items) {
Document document = null;
if (!item.IsDirectory)
- document = IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ document = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null) {
document.Window.SwitchView (document.Window.FindView<ILogView> ());
@@ -60,7 +61,7 @@ namespace MonoDevelop.VersionControl
VersionControlDocumentInfo info = new VersionControlDocumentInfo (null, item, item.Repository);
LogView logView = new LogView (info);
info.Document = IdeApp.Workbench.OpenDocument (logView, true).PrimaryView;
- logView.Selected ();
+ logView.Init ();
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/MergeCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/MergeCommand.cs
index 840760d3f4..766a32d95a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/MergeCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/MergeCommand.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System.Linq;
+using System.Threading.Tasks;
using Mono.Addins;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
@@ -40,16 +41,16 @@ namespace MonoDevelop.VersionControl
{
return !item.IsDirectory
&& item.VersionInfo.IsVersioned
- && AddinManager.GetExtensionObjects<IMergeViewHandler> (MergeViewHandlers).Any (h => h.CanHandle (item, null));
+ && AddinManager.GetExtensionObjects<IVersionControlViewHandler> (MergeViewHandlers).Any (h => h.CanHandle (item, null));
}
- public static bool Show (VersionControlItemList items, bool test)
+ public static async Task<bool> Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
- var document = IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ var document = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null)
document.Window.SwitchView (document.Window.FindView<IMergeView> ());
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ResolveConflictsCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ResolveConflictsCommand.cs
index 0691b5a7d8..dd599cfaea 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ResolveConflictsCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ResolveConflictsCommand.cs
@@ -29,18 +29,19 @@ using MonoDevelop.Ide;
using MonoDevelop.VersionControl.Views;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
+using System.Threading.Tasks;
namespace MonoDevelop.VersionControl
{
public class ResolveConflictsCommand
{
- public static bool ResolveConflicts (VersionControlItemList list, bool test)
+ public static async Task<bool> ResolveConflicts (VersionControlItemList list, bool test)
{
if (test)
return list.All (s => (s.VersionInfo.Status & VersionStatus.Conflicted) == VersionStatus.Conflicted);
foreach (var item in list.Where (s => (s.VersionInfo.Status & VersionStatus.Conflicted) == VersionStatus.Conflicted)) {
- Document doc = IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, true);
foreach (var view in doc.Views) {
if (view.GetContent <MergeView> () != null)
view.Select ();
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs
index 6466169f67..0cb75e7881 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs
@@ -10,7 +10,7 @@ using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.VersionControl.Views;
using MonoDevelop.Ide;
-
+using System.Threading.Tasks;
namespace MonoDevelop.VersionControl
{
@@ -222,177 +222,177 @@ namespace MonoDevelop.VersionControl
{
[AllowMultiSelection]
[CommandHandler (Commands.Update)]
- protected void OnUpdate() {
- RunCommand(Commands.Update, false);
+ protected async void OnUpdate() {
+ await RunCommand(Commands.Update, false);
}
[CommandUpdateHandler (Commands.Update)]
- protected void UpdateUpdate(CommandInfo item) {
- TestCommand(Commands.Update, item);
+ protected async void UpdateUpdate(CommandInfo item) {
+ await TestCommand(Commands.Update, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Diff)]
- protected void OnDiff() {
- RunCommand(Commands.Diff, false);
+ protected async void OnDiff() {
+ await RunCommand(Commands.Diff, false);
}
[CommandUpdateHandler (Commands.Diff)]
- protected void UpdateDiff(CommandInfo item) {
- TestCommand(Commands.Diff, item);
+ protected async void UpdateDiff(CommandInfo item) {
+ await TestCommand(Commands.Diff, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Log)]
- protected void OnLog() {
- RunCommand(Commands.Log, false);
+ protected async void OnLog() {
+ await RunCommand(Commands.Log, false);
}
[CommandUpdateHandler (Commands.Log)]
- protected void UpdateLog(CommandInfo item) {
- TestCommand(Commands.Log, item);
+ protected async void UpdateLog(CommandInfo item) {
+ await TestCommand(Commands.Log, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Status)]
- protected void OnStatus() {
- RunCommand(Commands.Status, false);
+ protected async void OnStatus() {
+ await RunCommand(Commands.Status, false);
}
[CommandUpdateHandler (Commands.Status)]
- protected void UpdateStatus(CommandInfo item) {
- TestCommand(Commands.Status, item);
+ protected async void UpdateStatus(CommandInfo item) {
+ await TestCommand(Commands.Status, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Add)]
- protected void OnAdd() {
- RunCommand(Commands.Add, false);
+ protected async void OnAdd() {
+ await RunCommand(Commands.Add, false);
}
[CommandUpdateHandler (Commands.Add)]
- protected void UpdateAdd(CommandInfo item) {
- TestCommand(Commands.Add, item);
+ protected async void UpdateAdd(CommandInfo item) {
+ await TestCommand(Commands.Add, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Remove)]
- protected void OnRemove() {
- RunCommand(Commands.Remove, false);
+ protected async void OnRemove() {
+ await RunCommand(Commands.Remove, false);
}
[CommandUpdateHandler (Commands.Remove)]
- protected void UpdateRemove(CommandInfo item) {
- TestCommand(Commands.Remove, item);
+ protected async void UpdateRemove(CommandInfo item) {
+ await TestCommand(Commands.Remove, item);
}
[CommandHandler (Commands.Publish)]
- protected void OnPublish()
+ protected async void OnPublish()
{
- RunCommand(Commands.Publish, false);
+ await RunCommand(Commands.Publish, false);
}
[CommandUpdateHandler (Commands.Publish)]
- protected void UpdatePublish(CommandInfo item) {
- TestCommand(Commands.Publish, item);
+ protected async void UpdatePublish(CommandInfo item) {
+ await TestCommand(Commands.Publish, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Revert)]
- protected void OnRevert() {
- RunCommand(Commands.Revert, false, false);
+ protected async void OnRevert() {
+ await RunCommand(Commands.Revert, false, false);
}
[CommandUpdateHandler (Commands.Revert)]
- protected void UpdateRevert(CommandInfo item) {
- TestCommand(Commands.Revert, item, false);
+ protected async void UpdateRevert(CommandInfo item) {
+ await TestCommand(Commands.Revert, item, false);
}
[AllowMultiSelection]
[CommandHandler (Commands.Lock)]
- protected void OnLock() {
- RunCommand(Commands.Lock, false);
+ protected async void OnLock() {
+ await RunCommand(Commands.Lock, false);
}
[CommandUpdateHandler (Commands.Lock)]
- protected void UpdateLock(CommandInfo item) {
- TestCommand(Commands.Lock, item);
+ protected async void UpdateLock(CommandInfo item) {
+ await TestCommand(Commands.Lock, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Unlock)]
- protected void OnUnlock() {
- RunCommand(Commands.Unlock, false);
+ protected async void OnUnlock() {
+ await RunCommand(Commands.Unlock, false);
}
[CommandUpdateHandler (Commands.Unlock)]
- protected void UpdateUnlock(CommandInfo item) {
- TestCommand(Commands.Unlock, item);
+ protected async void UpdateUnlock(CommandInfo item) {
+ await TestCommand(Commands.Unlock, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Annotate)]
- protected void OnAnnotate() {
- RunCommand(Commands.Annotate, false);
+ protected async void OnAnnotate() {
+ await RunCommand(Commands.Annotate, false);
}
[CommandUpdateHandler (Commands.Annotate)]
- protected void UpdateAnnotate(CommandInfo item) {
- TestCommand(Commands.Annotate, item);
+ protected async void UpdateAnnotate(CommandInfo item) {
+ await TestCommand(Commands.Annotate, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.CreatePatch)]
- protected void OnCreatePatch() {
- RunCommand(Commands.CreatePatch, false);
+ protected async void OnCreatePatch() {
+ await RunCommand(Commands.CreatePatch, false);
}
[CommandUpdateHandler (Commands.CreatePatch)]
- protected void UpdateCreatePatch(CommandInfo item) {
- TestCommand(Commands.CreatePatch, item);
+ protected async void UpdateCreatePatch(CommandInfo item) {
+ await TestCommand(Commands.CreatePatch, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Ignore)]
- protected void OnIgnore ()
+ protected async void OnIgnore ()
{
- RunCommand(Commands.Ignore, false);
+ await RunCommand(Commands.Ignore, false);
}
[CommandUpdateHandler (Commands.Ignore)]
- protected void UpdateIgnore (CommandInfo item)
+ protected async void UpdateIgnore (CommandInfo item)
{
- TestCommand(Commands.Ignore, item);
+ await TestCommand(Commands.Ignore, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Unignore)]
- protected void OnUnignore ()
+ protected async void OnUnignore ()
{
- RunCommand(Commands.Unignore, false);
+ await RunCommand(Commands.Unignore, false);
}
[CommandUpdateHandler (Commands.Unignore)]
- protected void UpdateUnignore (CommandInfo item)
+ protected async void UpdateUnignore (CommandInfo item)
{
- TestCommand(Commands.Unignore, item);
+ await TestCommand(Commands.Unignore, item);
}
[CommandHandler (Commands.ResolveConflicts)]
- protected void OnResolveConflicts ()
+ protected async void OnResolveConflicts ()
{
- RunCommand (Commands.ResolveConflicts, false, false);
+ await RunCommand (Commands.ResolveConflicts, false, false);
}
[CommandUpdateHandler (Commands.ResolveConflicts)]
- protected void UpdateResolveConflicts (CommandInfo item)
+ protected async void UpdateResolveConflicts (CommandInfo item)
{
- TestCommand (Commands.ResolveConflicts, item, false);
+ await TestCommand (Commands.ResolveConflicts, item, false);
}
- private void TestCommand(Commands cmd, CommandInfo item, bool projRecurse = true)
+ private async Task<TestResult> TestCommand(Commands cmd, CommandInfo item, bool projRecurse = true)
{
- TestResult res = RunCommand(cmd, true, projRecurse);
+ TestResult res = await RunCommand(cmd, true, projRecurse);
if (res == TestResult.NoVersionControl && cmd == Commands.Log) {
// Use the update command to show the "not available" message
item.Icon = null;
@@ -402,10 +402,12 @@ namespace MonoDevelop.VersionControl
else
item.Text = GettextCatalog.GetString ("This project or folder is not under version control");
} else
- item.Visible = res == TestResult.Enable;
+ item.Visible = res == TestResult.Enable;
+
+ return res;
}
- private TestResult RunCommand (Commands cmd, bool test, bool projRecurse = true)
+ private async Task<TestResult> RunCommand (Commands cmd, bool test, bool projRecurse = true)
{
VersionControlItemList items = GetItems (projRecurse);
@@ -426,10 +428,10 @@ namespace MonoDevelop.VersionControl
res = UpdateCommand.Update (items, test);
break;
case Commands.Diff:
- res = DiffCommand.Show (items, test);
+ res = await DiffCommand.Show (items, test);
break;
case Commands.Log:
- res = LogCommand.Show (items, test);
+ res = await LogCommand.Show (items, test);
break;
case Commands.Status:
res = StatusView.Show (items, test, false);
@@ -455,7 +457,7 @@ namespace MonoDevelop.VersionControl
res = PublishCommand.Publish (it.WorkspaceObject, it.Path, test);
break;
case Commands.Annotate:
- res = BlameCommand.Show (items, test);
+ res = await BlameCommand.Show (items, test);
break;
case Commands.CreatePatch:
res = CreatePatchCommand.CreatePatch (items, test);
@@ -467,7 +469,7 @@ namespace MonoDevelop.VersionControl
res = UnignoreCommand.Unignore (items, test);
break;
case Commands.ResolveConflicts:
- res = ResolveConflictsCommand.ResolveConflicts (items, test);
+ res = await ResolveConflictsCommand.ResolveConflicts (items, test);
break;
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml b/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml
index 2c71417ba3..1e963be2d2 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml
@@ -27,7 +27,7 @@
<ExtensionPoint path = "/MonoDevelop/VersionControl/DiffViewHandler" name = "Diff view handler">
<Description>Handler used to create the a diff view which can display the current file.</Description>
- <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IDiffViewHandler" />
+ <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IVersionControlViewHandler" />
</ExtensionPoint>
<Extension path = "/MonoDevelop/VersionControl/DiffViewHandler">
@@ -36,7 +36,7 @@
<ExtensionPoint path = "/MonoDevelop/VersionControl/BlameViewHandler" name = "Blame view handler">
<Description>Handler used to create the a blame view which can display the current file.</Description>
- <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IBlameViewHandler" />
+ <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IVersionControlViewHandler" />
</ExtensionPoint>
<Extension path = "/MonoDevelop/VersionControl/BlameViewHandler">
@@ -45,7 +45,7 @@
<ExtensionPoint path = "/MonoDevelop/VersionControl/LogViewHandler" name = "Log view handler">
<Description>Handler used to create the a log view which can display the current file.</Description>
- <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.ILogViewHandler" />
+ <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IVersionControlViewHandler" />
</ExtensionPoint>
<Extension path = "/MonoDevelop/VersionControl/LogViewHandler">
@@ -54,7 +54,7 @@
<ExtensionPoint path = "/MonoDevelop/VersionControl/MergeViewHandler" name = "Merge view handler">
<Description>Handler used to create the a merge view which can display the current file.</Description>
- <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IMergeViewHandler" />
+ <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IVersionControlViewHandler" />
</ExtensionPoint>
<Extension path = "/MonoDevelop/VersionControl/MergeViewHandler">
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/GdkWin32.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/GdkWin32.cs
index 6c02e62578..5b595b007b 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/GdkWin32.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/GdkWin32.cs
@@ -58,6 +58,12 @@ namespace MonoDevelop.Platform
[DllImport (Win32.USER32, SetLastError=true, CharSet=CharSet.Auto)]
static extern uint RegisterWindowMessage (string lpString);
+ public static IntPtr HgdiobjGet (MonoDevelop.Components.Window window)
+ {
+ Gtk.Window gtkWindow = window;
+ return HgdiobjGet (gtkWindow.GdkWindow);
+ }
+
public static IntPtr HgdiobjGet (Gdk.Drawable drawable)
{
return gdk_win32_drawable_get_handle (drawable.Handle);
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs
index 67ec27e51e..4c907433e8 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs
@@ -76,7 +76,7 @@ namespace MonoDevelop.Platform
{
Taskbar.JumpList jumplist = Taskbar.JumpList.CreateJumpListForIndividualWindow (
MonoDevelop.Core.BrandingService.ApplicationName,
- GdkWin32.HgdiobjGet (MessageService.RootWindow.GdkWindow)
+ GdkWin32.HgdiobjGet (MessageService.RootWindow)
);
jumplist.KnownCategoryToDisplay = Taskbar.JumpListKnownCategoryType.Neither;
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
index bdd5a1b5f2..82c7eb6ac2 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
@@ -289,8 +289,9 @@ namespace MonoDevelop.Platform
[DllImport (Win32.USER32)]
extern static int GetMonitorInfoA (IntPtr hmonitor, ref MonitorInfo info);
- public override Gdk.Rectangle GetUsableMonitorGeometry (Gdk.Screen screen, int monitor_id)
+ public override Xwt.Rectangle GetUsableMonitorGeometry (int screenNumber, int monitor_id)
{
+ var screen = Gdk.Display.Default.GetScreen (screenNumber);
Gdk.Rectangle geometry = screen.GetMonitorGeometry (monitor_id);
List<MonitorInfo> screens = new List<MonitorInfo> ();
@@ -321,7 +322,7 @@ namespace MonoDevelop.Platform
int y = geometry.Y + (visible.Top - frame.Top);
int height = visible.Height;
- return new Gdk.Rectangle (x, y, width, height);
+ return new Xwt.Rectangle (x, y, width, height);
}
static ProcessStartInfo CreateConsoleStartInfo (
diff --git a/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs b/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs
index 2204f06693..70bd5e151f 100644
--- a/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs
+++ b/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs
@@ -706,7 +706,7 @@ namespace MonoDevelop.Xml.Editor
public event EventHandler<DocumentPathChangedEventArgs> PathChanged;
- public Widget CreatePathWidget (int index)
+ public Control CreatePathWidget (int index)
{
if (ownerProjects.Count > 1 && index == 0) {
var window = new DropDownBoxListWindow (new DataProvider (this));
diff --git a/main/src/addins/Xml/Editor/XmlEditorOptionsPanel.cs b/main/src/addins/Xml/Editor/XmlEditorOptionsPanel.cs
index e9e6cc337a..a1106855ec 100644
--- a/main/src/addins/Xml/Editor/XmlEditorOptionsPanel.cs
+++ b/main/src/addins/Xml/Editor/XmlEditorOptionsPanel.cs
@@ -22,8 +22,8 @@
// 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;
-using Gtk;
+using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Core;
@@ -36,7 +36,7 @@ namespace MonoDevelop.Xml.Editor
{
XmlEditorOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new XmlEditorOptionsPanelWidget();
widget.AutoCompleteElements = XmlEditorOptions.AutoCompleteElements;
diff --git a/main/src/addins/Xml/Editor/XmlSchemasPanel.cs b/main/src/addins/Xml/Editor/XmlSchemasPanel.cs
index bae0f24d56..cf0820b173 100644
--- a/main/src/addins/Xml/Editor/XmlSchemasPanel.cs
+++ b/main/src/addins/Xml/Editor/XmlSchemasPanel.cs
@@ -24,7 +24,7 @@
using System;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.Xml.Editor
@@ -36,7 +36,7 @@ namespace MonoDevelop.Xml.Editor
{
XmlSchemasPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new XmlSchemasPanelWidget ();
widget.LoadUserSchemas (XmlSchemaManager.UserSchemas);
diff --git a/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanel.cs b/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanel.cs
index 93405e5ac1..1e3ff024e8 100644
--- a/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanel.cs
+++ b/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanel.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.Xml.Formatting
@@ -34,7 +34,7 @@ namespace MonoDevelop.Xml.Formatting
{
XmlFormattingPolicyPanelWidget panel;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new XmlFormattingPolicyPanelWidget ();
return panel;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractAttachableViewContent.cs b/main/src/core/MonoDevelop.Core/CoreExtensions.cs
index 26ee6fd478..68eaceeb02 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractAttachableViewContent.cs
+++ b/main/src/core/MonoDevelop.Core/CoreExtensions.cs
@@ -1,21 +1,21 @@
-//
-// AbstractAttachableViewContent.cs
-//
+//
+// CoreExtensions.cs
+//
// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.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
@@ -23,27 +23,18 @@
// 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.Collections;
+using System.Collections.Generic;
+using System.Linq;
-using System;
-
-namespace MonoDevelop.Ide.Gui
+namespace System
{
- public abstract class AbstractAttachableViewContent : AbstractBaseViewContent, IAttachableViewContent
+ public static class CoreExtensions
{
- public virtual void Selected ()
- {
- }
-
- public virtual void Deselected ()
- {
- }
-
- public virtual void BeforeSave ()
- {
- }
-
- public virtual void BaseContentChanged ()
+ public static IEnumerable<T> Concat<T> (this IEnumerable<T> e, T item)
{
+ return e.Concat (Enumerable.Repeat (item, 1));
}
}
}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs
index b03e655350..8dec93d554 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs
@@ -28,6 +28,7 @@ using System.Linq;
using System.Collections.Generic;
using System.IO;
using System.Text;
+using System.Threading.Tasks;
namespace MonoDevelop.Core.Text
{
@@ -215,6 +216,20 @@ namespace MonoDevelop.Core.Text
}
}
+ public static async Task<TextContent> GetTextAsync (Stream inputStream)
+ {
+ if (inputStream == null)
+ throw new ArgumentNullException ("inputStream");
+ var tc = new TextContent ();
+ bool hadBom;
+ using (var stream = OpenStream (inputStream, out hadBom)) {
+ tc.Encoding = stream.CurrentEncoding;
+ tc.Text = await stream.ReadToEndAsync ();
+ tc.HasBom = hadBom;
+ }
+ return tc;
+ }
+
public static string GetText (string fileName)
{
return GetText (File.ReadAllBytes (fileName));
@@ -230,16 +245,36 @@ namespace MonoDevelop.Core.Text
#endregion
#region file methods
- public static void WriteText (string fileName, string text, Encoding encoding, bool hadBom)
+ static string WriteTextInit (string fileName, string text, Encoding encoding)
{
if (fileName == null)
- throw new ArgumentNullException ("fileName");
+ throw new ArgumentNullException ("fileName");
if (text == null)
throw new ArgumentNullException ("text");
if (encoding == null)
throw new ArgumentNullException ("encoding");
// atomic rename only works in the same directory on linux. The tmp files may be on another partition -> breaks save.
string tmpPath = Path.Combine (Path.GetDirectoryName (fileName), ".#" + Path.GetFileName (fileName));
+ return tmpPath;
+ }
+
+ static void WriteTextFinal (string tmpPath, string fileName)
+ {
+ try {
+ SystemRename (tmpPath, fileName);
+ } catch (Exception) {
+ try {
+ File.Delete (tmpPath);
+ } catch {
+ // nothing
+ }
+ throw;
+ }
+ }
+
+ public static void WriteText (string fileName, string text, Encoding encoding, bool hadBom)
+ {
+ var tmpPath = WriteTextInit (fileName, text, encoding);
using (var stream = new FileStream (tmpPath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write)) {
if (hadBom) {
var bom = encoding.GetPreamble ();
@@ -249,16 +284,22 @@ namespace MonoDevelop.Core.Text
byte[] bytes = encoding.GetBytes (text);
stream.Write (bytes, 0, bytes.Length);
}
- try {
- SystemRename (tmpPath, fileName);
- } catch (Exception) {
- try {
- File.Delete (tmpPath);
- } catch {
- // nothing
+ WriteTextFinal (tmpPath, fileName);
+ }
+
+ public static async Task WriteTextAsync (string fileName, string text, Encoding encoding, bool hadBom)
+ {
+ var tmpPath = WriteTextInit (fileName, text, encoding);
+ using (var stream = new FileStream (tmpPath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write)) {
+ if (hadBom) {
+ var bom = encoding.GetPreamble ();
+ if (bom != null && bom.Length > 0)
+ await stream.WriteAsync (bom, 0, bom.Length);
}
- throw;
+ byte[] bytes = encoding.GetBytes (text);
+ await stream.WriteAsync (bytes, 0, bytes.Length);
}
+ WriteTextFinal (tmpPath, fileName);
}
/// <summary>
@@ -331,6 +372,22 @@ namespace MonoDevelop.Core.Text
return GetText (content, out encoding, out hadBom);
}
+ public static async Task<TextContent> ReadAllTextAsync (string fileName)
+ {
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ byte[] content = await ReadAllBytesAsync (fileName);
+
+ bool hadBom;
+ Encoding encoding;
+ var txt = GetText (content, out encoding, out hadBom);
+ return new TextContent {
+ Text = txt,
+ HasBom = hadBom,
+ Encoding = encoding
+ };
+ }
+
public static string ReadAllText (string fileName, Encoding encoding, out bool hadBom)
{
if (fileName == null)
@@ -341,6 +398,37 @@ namespace MonoDevelop.Core.Text
byte[] content = File.ReadAllBytes (fileName);
return GetText (content, encoding, out hadBom);
}
+
+ public static async Task<TextContent> ReadAllTextAsync (string fileName, Encoding encoding)
+ {
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ if (encoding == null)
+ throw new ArgumentNullException ("encoding");
+
+ byte[] content = await ReadAllBytesAsync (fileName);
+
+ bool hadBom;
+ var txt = GetText (content, encoding, out hadBom);
+ return new TextContent {
+ Text = txt,
+ HasBom = hadBom,
+ Encoding = encoding
+ };
+ }
+
+ public static async Task<byte[]> ReadAllBytesAsync (string file)
+ {
+ using (var f = File.OpenRead (file)) {
+ var res = new byte [f.Length];
+ int nr = 0;
+ int c = 0;
+ while (nr < res.Length && (c = await f.ReadAsync (res, nr, res.Length - nr)) > 0)
+ nr += c;
+ return res;
+ }
+ }
+
#endregion
#region ASCII encoding check
@@ -850,4 +938,11 @@ namespace MonoDevelop.Core.Text
}
#endregion
}
+
+ public class TextContent
+ {
+ public string Text { get; internal set; }
+ public bool HasBom { get; internal set; }
+ public Encoding Encoding { get; internal set; }
+ }
} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
index 1d5ce879ae..5b7c5510db 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
@@ -554,6 +554,7 @@
<Compile Include="MonoDevelop.Projects.MSBuild\IntrinsicFunctions.cs" />
<Compile Include="MonoDevelop.Projects.MSBuild\EscapingUtilities.cs" />
<Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ConditionedPropertyCollection.cs" />
+ <Compile Include="CoreExtensions.cs" />
<Compile Include="MonoDevelop.Core\FileWriteableState.cs" />
</ItemGroup>
<ItemGroup>
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
index 705149c038..d0c2a4aba9 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
@@ -1018,7 +1018,9 @@ namespace MonoDevelop.Projects
builder.Unlock ();
if (builder != this.projectBuilder) {
// Dispose the builder after a while, so that it can be reused
+ #pragma warning disable 4014
Task.Delay (10000).ContinueWith (t => builder.Dispose ());
+ #pragma warning restore 4014
}
t1.End ();
if (t2 != null)
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/MimeTypes.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/MimeTypes.addin.xml
index b27e0cb69b..db3172ea38 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/MimeTypes.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/MimeTypes.addin.xml
@@ -25,6 +25,9 @@
<MimeType id="application/glade+xml" _description="Glade File" baseType="application/xml">
<File pattern="*.glade" />
</MimeType>
+ <MimeType id="application/manifest+xml" _description="Manifest File" baseType="application/xml">
+ <File pattern="*.manifest" />
+ </MimeType>
<MimeType id="text/x-changelog" _description="ChangeLog document" isText="true">
<File pattern="ChangeLog|Changelog|CHANGELOG|Changelog"/>
</MimeType>
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkNotebookResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkNotebookResult.cs
index 9cc11c6f03..f2ee0c1f87 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkNotebookResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkNotebookResult.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.Components.AutoTest.Results
Notebook noteBook;
int toBeSelected = -1;
- public GtkNotebookResult (Widget notebookWidget) : base (notebookWidget)
+ internal GtkNotebookResult (Widget notebookWidget) : base (notebookWidget)
{
noteBook = notebookWidget as Notebook;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs
index 3caf3c1c53..c9158a7980 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs
@@ -39,14 +39,14 @@ namespace MonoDevelop.Components.AutoTest.Results
TreeIter? resultIter;
string DesiredText;
- public GtkTreeModelResult (Widget parent, TreeModel treeModel, int column) : base (parent)
+ internal GtkTreeModelResult (Widget parent, TreeModel treeModel, int column) : base (parent)
{
ParentWidget = parent;
TModel = treeModel;
Column = column;
}
- public GtkTreeModelResult (Widget parent, TreeModel treeModel, int column, TreeIter iter) : base (parent)
+ internal GtkTreeModelResult (Widget parent, TreeModel treeModel, int column, TreeIter iter) : base (parent)
{
ParentWidget = parent;
TModel = treeModel;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs
index 99d00e3ae4..629a3e2eeb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs
@@ -37,7 +37,7 @@ namespace MonoDevelop.Components.AutoTest.Results
{
Widget resultWidget;
- public GtkWidgetResult (Widget widget)
+ internal GtkWidgetResult (Widget widget)
{
resultWidget = widget;
}
@@ -76,7 +76,7 @@ namespace MonoDevelop.Components.AutoTest.Results
return this;
}
- Window window = resultWidget as Window;
+ var window = resultWidget as Gtk.Window;
if (window != null) {
if (window.Title != null && window.Title.IndexOf (mark) > -1) {
return this;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
index d760b57158..bcd17d7f81 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Components.AutoTest.Results
{
NSObject ResultObject;
- public NSObjectResult (NSObject resultObject)
+ internal NSObjectResult (NSObject resultObject)
{
ResultObject = resultObject;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs
index 64b48200c2..0ecdb78e83 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs
@@ -197,7 +197,7 @@ namespace MonoDevelop.Components.AutoTest
public abstract void Replay (AutoTestSession testSession);
}
- public class KeyPressEvent: RecordEvent
+ internal class KeyPressEvent: RecordEvent
{
public Gdk.Key Key { get; set; }
public Gdk.ModifierType Modifiers { get; set; }
@@ -238,7 +238,7 @@ namespace MonoDevelop.Components.AutoTest
}
}
- public class StringEvent: RecordEvent
+ internal class StringEvent: RecordEvent
{
internal string Text;
internal Gdk.ModifierType Modifiers { get; set; }
@@ -278,7 +278,7 @@ namespace MonoDevelop.Components.AutoTest
}
}
- public class CommandEvent: RecordEvent
+ internal class CommandEvent: RecordEvent
{
public object CommandId { get; set; }
public int DataItemIndex { get; set; }
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Axis.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Axis.cs
index d0e5f2d008..1a3100ff3b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Axis.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Axis.cs
@@ -33,7 +33,7 @@ namespace MonoDevelop.Components.Chart
public abstract class Axis
{
int tickSize = 6;
- internal BasicChart Owner;
+ internal ChartWidget Owner;
AxisPosition position;
AxisDimension dim;
bool showLabels = true;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs
index 6ed67e3ac5..4fccab7ec0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs
@@ -33,7 +33,126 @@ using Gdk;
namespace MonoDevelop.Components.Chart
{
- public class BasicChart: DrawingArea
+ public class BasicChart: Control
+ {
+ ChartWidget widget;
+
+ public BasicChart ()
+ {
+ widget = new ChartWidget ();
+ }
+
+ protected override object CreateNativeWidget ()
+ {
+ return widget;
+ }
+
+ protected internal virtual void OnSelectionChanged ()
+ {
+ if (SelectionChanged != null)
+ SelectionChanged (this, EventArgs.Empty);
+ }
+
+ public event EventHandler SelectionChanged;
+
+ public bool AllowSelection {
+ get { return widget.AllowSelection; }
+ set { widget.AllowSelection = value; }
+ }
+
+ public ChartCursor SelectionStart {
+ get { return widget.SelectionStart; }
+ }
+
+ public ChartCursor SelectionEnd {
+ get { return widget.SelectionEnd; }
+ }
+
+ public ChartCursor ActiveCursor {
+ get { return widget.ActiveCursor; }
+ }
+ public bool ReverseXAxis {
+ get { return widget.ReverseXAxis; }
+ set { widget.ReverseXAxis = value; }
+ }
+
+ public bool ReverseYAxis {
+ get { return widget.ReverseYAxis; }
+ set { widget.ReverseYAxis = value; }
+ }
+
+ public double OriginX {
+ get { return widget.OriginX; }
+ set { widget.OriginX = value; }
+ }
+
+ public double OriginY {
+ get { return widget.OriginY; }
+ set { widget.OriginY = value; }
+ }
+
+ public double StartX {
+ get { return widget.StartX; }
+ set { widget.StartX = value; }
+ }
+
+ public double EndX {
+ get { return widget.EndX; }
+ set { widget.EndX = value; }
+ }
+
+ public double StartY {
+ get { return widget.StartY; }
+ set { widget.StartY = value; }
+ }
+
+ public double EndY {
+ get { return widget.EndY; }
+ set { widget.EndY = value; }
+ }
+
+ public void Reset ()
+ {
+ widget.Reset ();
+ }
+
+ public void AddAxis (Axis ax, AxisPosition position)
+ {
+ widget.AddAxis (ax, position);
+ }
+
+ public void AddSerie (Serie serie)
+ {
+ widget.AddSerie (serie);
+ }
+
+ public void RemoveSerie (Serie serie)
+ {
+ widget.RemoveSerie (serie);
+ }
+
+ public void AddCursor (ChartCursor cursor, AxisDimension dimension)
+ {
+ widget.AddCursor (cursor, dimension);
+ }
+
+ public void RemoveCursor (ChartCursor cursor)
+ {
+ widget.RemoveCursor (cursor);
+ }
+
+ public void SetAutoScale (AxisDimension ad, bool autoStart, bool autoEnd)
+ {
+ widget.SetAutoScale (ad, autoStart, autoEnd);
+ }
+
+ public void Clear ()
+ {
+ widget.Clear ();
+ }
+ }
+
+ class ChartWidget : DrawingArea
{
double startX, endX;
double startY, endY;
@@ -67,8 +186,9 @@ namespace MonoDevelop.Components.Chart
ChartCursor selectionStart;
ChartCursor selectionEnd;
-
- public BasicChart ()
+ BasicChart chart;
+
+ public ChartWidget ()
{
this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask;
selectionStart = new ChartCursor ();
@@ -80,9 +200,12 @@ namespace MonoDevelop.Components.Chart
selectionStart.ValueChanged += new EventHandler (OnSelectionCursorChanged);
selectionEnd.ValueChanged += new EventHandler (OnSelectionCursorChanged);
}
-
- public event EventHandler SelectionChanged;
-
+
+ internal void Initialize (BasicChart owner)
+ {
+ chart = owner;
+ }
+
public bool AllowSelection {
get {
return enableSelection;
@@ -830,7 +953,7 @@ namespace MonoDevelop.Components.Chart
selectionStart = selectionEnd;
selectionEnd = tmp;
}
- OnSelectionChanged ();
+ chart.OnSelectionChanged ();
}
}
@@ -912,12 +1035,6 @@ namespace MonoDevelop.Components.Chart
yrangeChanged = true;
base.OnSizeAllocated (rect);
}
-
- protected virtual void OnSelectionChanged ()
- {
- if (SelectionChanged != null)
- SelectionChanged (this, EventArgs.Empty);
- }
}
public enum BackgroundDisplay
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Serie.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Serie.cs
index 45475ee559..16869cfc03 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Serie.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Serie.cs
@@ -37,7 +37,7 @@ namespace MonoDevelop.Components.Chart
string title;
List<Data> dataArray = new List<Data> ();
bool visible = true;
- internal BasicChart Owner;
+ internal ChartWidget Owner;
Cairo.Color color;
bool extendBoundingValues;
DisplayMode mode;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntry.cs
index 54fc1fa284..b908b5078f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntry.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntry.cs
@@ -92,12 +92,12 @@ namespace MonoDevelop.Components.Commands
return manager.GetCommand (cmdId);
}
- internal protected virtual Gtk.MenuItem CreateMenuItem (CommandManager manager)
+ internal virtual Gtk.MenuItem CreateMenuItem (CommandManager manager)
{
return CreateMenuItem (manager, GetCommand (manager), cmdId, true, overrideLabel, disabledVisible);
}
- internal protected virtual Gtk.ToolItem CreateToolItem (CommandManager manager)
+ internal virtual Gtk.ToolItem CreateToolItem (CommandManager manager)
{
if (cmdId == CommandManager.ToCommandId (Command.Separator))
return new Gtk.SeparatorToolItem ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntrySet.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntrySet.cs
index 40647d07a6..2514b416bc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntrySet.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntrySet.cs
@@ -112,7 +112,7 @@ namespace MonoDevelop.Components.Commands
get { return cmds.Count; }
}
- internal protected override Gtk.MenuItem CreateMenuItem (CommandManager manager)
+ internal override Gtk.MenuItem CreateMenuItem (CommandManager manager)
{
Gtk.MenuItem mi;
if (autoHide)
@@ -123,7 +123,7 @@ namespace MonoDevelop.Components.Commands
return mi;
}
- internal protected override Gtk.ToolItem CreateToolItem (CommandManager manager)
+ internal override Gtk.ToolItem CreateToolItem (CommandManager manager)
{
Gtk.Menu menu = manager.CreateMenu (this);
return new MenuToolButton (menu, icon);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandFrame.cs
index 266d6f83af..d29c426593 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandFrame.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandFrame.cs
@@ -26,48 +26,15 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using Mono.Addins;
-using MonoDevelop.Components.DockToolbars;
+using Gtk;
namespace MonoDevelop.Components.Commands
{
- public class CommandFrame: DockToolbarFrame
+ class CommandFrame: EventBox
{
- CommandManager manager;
-
public CommandFrame (CommandManager manager)
{
- this.manager = manager;
manager.RegisterGlobalHandler (this);
}
-
- [CommandHandler (CommandSystemCommands.ToolbarList)]
- protected void OnViewToolbar (object ob)
- {
- IDockToolbar bar = (IDockToolbar) ob;
- bar.Visible = !bar.Visible;
- }
-
- [CommandUpdateHandler (CommandSystemCommands.ToolbarList)]
- protected void OnUpdateViewToolbar (CommandArrayInfo info)
- {
- foreach (IDockToolbar bar in Toolbars) {
- CommandInfo cmd = new CommandInfo (bar.Title);
- cmd.Checked = bar.Visible;
- cmd.Description = AddinManager.CurrentLocalizer.GetString ("Show toolbar '{0}'", bar.Title);
- info.Add (cmd, bar);
- }
- }
-
- protected override void OnPanelClick (Gdk.EventButton e, Placement placement)
- {
- if (e.TriggersContextMenu ()) {
- CommandEntrySet opset = new CommandEntrySet ();
- opset.AddItem (CommandSystemCommands.ToolbarList);
- Gtk.Menu menu = manager.CreateMenu (opset);
- menu.Popup (null, null, null, 0, e.Time);
- }
- base.OnPanelClick (e, placement);
- }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
index da77e69a41..35c6f1846f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
@@ -82,9 +82,10 @@ namespace MonoDevelop.Components.Commands
{
}
- public CommandManager (Gtk.Window root)
+ public CommandManager (Window root)
{
- rootWidget = root;
+ if (root != null)
+ rootWidget = root;
bindings = new KeyBindingManager ();
ActionCommand c = new ActionCommand (CommandSystemCommands.ToolbarList, "Toolbar List", null, null, ActionType.Check);
c.CommandArray = true;
@@ -131,38 +132,13 @@ namespace MonoDevelop.Components.Commands
/// <summary>
/// Creates a menu bar from the menu definition at the provided extension path
/// </summary>
- public Gtk.MenuBar CreateMenuBar (string addinPath)
+ internal Gtk.MenuBar CreateMenuBar (string addinPath)
{
CommandEntrySet cset = CreateCommandEntrySet (addinPath);
return CreateMenuBar (addinPath, cset);
}
/// <summary>
- /// Creates a set of toolbars from the provided extension path
- /// </summary>
- public Gtk.Toolbar[] CreateToolbarSet (string addinPath)
- {
- ArrayList bars = new ArrayList ();
-
- CommandEntrySet cset = CreateCommandEntrySet (addinPath);
- foreach (CommandEntry ce in cset) {
- CommandEntrySet ces = ce as CommandEntrySet;
- if (ces != null)
- bars.Add (CreateToolbar (addinPath + "/" + ces.CommandId, ces));
- }
- return (Gtk.Toolbar[]) bars.ToArray (typeof(Gtk.Toolbar));
- }
-
- /// <summary>
- /// Creates a toolbar from the provided extension path
- /// </summary>
- public Gtk.Toolbar CreateToolbar (string addinPath)
- {
- CommandEntrySet cset = CreateCommandEntrySet (addinPath);
- return CreateToolbar (addinPath, cset);
- }
-
- /// <summary>
/// Creates a menu from the provided extension path
/// </summary>
public Gtk.Menu CreateMenu (string addinPath)
@@ -183,7 +159,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='addinPath'>
/// Extension path to the definition of the menu
/// </param>
- public void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, string addinPath)
+ public void ShowContextMenu (Control parent, Gdk.EventButton evt, string addinPath)
{
ShowContextMenu (parent, evt, CreateCommandEntrySet (addinPath));
}
@@ -203,7 +179,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='addinPath'>
/// Extension path to the definition of the menu
/// </param>
- public void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt,
+ public void ShowContextMenu (Control parent, Gdk.EventButton evt,
ExtensionContext ctx, string addinPath)
{
ShowContextMenu (parent, evt, CreateCommandEntrySet (ctx, addinPath));
@@ -460,7 +436,7 @@ namespace MonoDevelop.Components.Commands
/// <summary>
/// Sets the root window. The manager will start the command route at this window, if no other is active.
/// </summary>
- public void SetRootWindow (Gtk.Window root)
+ public void SetRootWindow (Window root)
{
if (rootWidget != null)
rootWidget.KeyPressEvent -= OnKeyPressed;
@@ -718,7 +694,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='entrySet'>
/// Entry set with the definition of the commands to be included in the menu bar
/// </param>
- public Gtk.MenuBar CreateMenuBar (string name, CommandEntrySet entrySet)
+ internal Gtk.MenuBar CreateMenuBar (string name, CommandEntrySet entrySet)
{
Gtk.MenuBar topMenu = new CommandMenuBar (this);
foreach (CommandEntry entry in entrySet) {
@@ -749,7 +725,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='menu'>
/// The menu where to add the commands
/// </param>
- public Gtk.Menu CreateMenu (CommandEntrySet entrySet, CommandMenu menu)
+ internal Gtk.Menu CreateMenu (CommandEntrySet entrySet, CommandMenu menu)
{
foreach (CommandEntry entry in entrySet) {
Gtk.MenuItem mi = entry.CreateMenuItem (this);
@@ -902,7 +878,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='initialCommandTarget'>
/// Initial command route target. The command handler will start looking for command handlers in this object.
/// </param>
- public bool ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, CommandEntrySet entrySet,
+ public bool ShowContextMenu (Control parent, Gdk.EventButton evt, CommandEntrySet entrySet,
object initialCommandTarget = null)
{
return ShowContextMenu (parent, evt, entrySet, initialCommandTarget, null);
@@ -926,7 +902,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='closeHandler'>
/// An event handler which will be called when the menu closes
/// </param>
- public bool ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, CommandEntrySet entrySet,
+ public bool ShowContextMenu (Control parent, Gdk.EventButton evt, CommandEntrySet entrySet,
object initialCommandTarget, EventHandler closeHandler)
{
#if MAC
@@ -949,7 +925,7 @@ namespace MonoDevelop.Components.Commands
/// <param name="y">The y coordinate.</param>
/// <param name="entrySet">Entry set with the command definitions</param>
/// <param name="initialCommandTarget">Initial command target.</param>
- public bool ShowContextMenu (Gtk.Widget parent, int x, int y, CommandEntrySet entrySet,
+ public bool ShowContextMenu (Control parent, int x, int y, CommandEntrySet entrySet,
object initialCommandTarget = null)
{
#if MAC
@@ -979,7 +955,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='initialCommandTarget'>
/// Initial command route target. The command handler will start looking for command handlers in this object.
/// </param>
- public void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, Gtk.Menu menu,
+ public void ShowContextMenu (Control parent, Gdk.EventButton evt, Gtk.Menu menu,
object initialCommandTarget = null)
{
if (menu is CommandMenu) {
@@ -989,7 +965,7 @@ namespace MonoDevelop.Components.Commands
MonoDevelop.Components.GtkWorkarounds.ShowContextMenu (menu, parent, evt);
}
- public void ShowContextMenu (Gtk.Widget parent, int x, int y, Gtk.Menu menu,
+ public void ShowContextMenu (Control parent, int x, int y, Gtk.Menu menu,
object initialCommandTarget = null)
{
if (menu is CommandMenu) {
@@ -1000,86 +976,6 @@ namespace MonoDevelop.Components.Commands
}
/// <summary>
- /// Creates a toolbar.
- /// </summary>
- /// <returns>
- /// The toolbar.
- /// </returns>
- /// <param name='entrySet'>
- /// Entry with the command definitions
- /// </param>
- public Gtk.Toolbar CreateToolbar (CommandEntrySet entrySet)
- {
- return CreateToolbar ("", entrySet, null);
- }
-
- /// <summary>
- /// Creates a toolbar.
- /// </summary>
- /// <returns>
- /// The toolbar.
- /// </returns>
- /// <param name='entrySet'>
- /// Entry with the command definitions
- /// </param>
- /// <param name='initialTarget'>
- /// Initial command route target. The command handler will start looking for command handlers in this object.
- /// </param>
- public Gtk.Toolbar CreateToolbar (CommandEntrySet entrySet, object initialTarget)
- {
- return CreateToolbar ("", entrySet, initialTarget);
- }
-
- /// <summary>
- /// Creates a toolbar.
- /// </summary>
- /// <returns>
- /// The toolbar.
- /// </returns>
- /// <param name='id'>
- /// Identifier of the toolbar
- /// </param>
- /// <param name='entrySet'>
- /// Entry with the command definitions
- /// </param>
- public Gtk.Toolbar CreateToolbar (string id, CommandEntrySet entrySet)
- {
- return CreateToolbar (id, entrySet, null);
- }
-
- /// <summary>
- /// Creates a toolbar.
- /// </summary>
- /// <returns>
- /// The toolbar.
- /// </returns>
- /// <param name='id'>
- /// Identifier of the toolbar
- /// </param>
- /// <param name='entrySet'>
- /// Entry with the command definitions
- /// </param>
- /// <param name='initialTarget'>
- /// Initial command route target. The command handler will start looking for command handlers in this object.
- /// </param>
- public Gtk.Toolbar CreateToolbar (string id, CommandEntrySet entrySet, object initialTarget)
- {
- CommandToolbar toolbar = new CommandToolbar (this, id, entrySet.Name);
- toolbar.InitialCommandTarget = initialTarget;
-
- foreach (CommandEntry entry in entrySet) {
- Gtk.ToolItem ti = entry.CreateToolItem (this);
- CustomItem ci = ti.Child as CustomItem;
- if (ci != null)
- ci.SetToolbarStyle (toolbar);
- toolbar.Add (ti);
- }
- ToolbarTracker tt = new ToolbarTracker ();
- tt.Track (toolbar);
- return toolbar;
- }
-
- /// <summary>
/// Dispatches a command.
/// </summary>
/// <returns>
@@ -2187,8 +2083,8 @@ namespace MonoDevelop.Components.Commands
public class ActiveWidgetEventArgs: EventArgs
{
- public Gtk.Widget OldActiveWidget { get; internal set; }
- public Gtk.Widget NewActiveWidget { get; internal set; }
+ public Control OldActiveWidget { get; internal set; }
+ public Control NewActiveWidget { get; internal set; }
}
internal class HandlerTypeInfo
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs
index dacd57d56a..22abd3aa5f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs
@@ -30,7 +30,7 @@ using System;
namespace MonoDevelop.Components.Commands
{
- public class CommandMenu: Gtk.Menu
+ class CommandMenu: Gtk.Menu
{
CommandEntrySet commandEntrySet;
CommandManager manager;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs
index b7da31e1be..3302f8da77 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs
@@ -30,7 +30,7 @@ using Gtk;
namespace MonoDevelop.Components.Commands
{
- public class CommandMenuBar: Gtk.MenuBar
+ class CommandMenuBar: Gtk.MenuBar
{
CommandManager manager;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs
index 4f9a63b7d2..17acc8d30a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs
@@ -32,7 +32,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.Components.Commands
{
- public class CommandMenuItem: Gtk.ImageMenuItem, ICommandMenuItem
+ class CommandMenuItem: Gtk.ImageMenuItem, ICommandMenuItem
{
CommandManager commandManager;
object commandId;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandRouterContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandRouterContainer.cs
index d6693f379e..bc9b1c1d7c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandRouterContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandRouterContainer.cs
@@ -47,11 +47,13 @@ namespace MonoDevelop.Components.Commands
{
this.continueToParent = continueToParent;
}
-
- public CommandRouterContainer (Gtk.Widget child, object target, bool continueToParent) : this (continueToParent)
+
+ public CommandRouterContainer (Control child, object target, bool continueToParent) : this (continueToParent)
{
- if (child != null)
+ if (child != null) {
PackStart (child, true, true, 0);
+ child = null;
+ }
Delegated = target;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToggleToolButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToggleToolButton.cs
index f8b8ddf6a5..26cab71ae6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToggleToolButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToggleToolButton.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.Components.Commands
{
- public class CommandToggleToolButton: Gtk.ToggleToolButton, ICommandUserItem
+ class CommandToggleToolButton: Gtk.ToggleToolButton, ICommandUserItem
{
CommandManager commandManager;
object commandId;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs
index e0577f0692..4be6a173ed 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.Components.Commands
{
- public class CommandToolButton: Gtk.ToolButton, ICommandUserItem
+ class CommandToolButton: Gtk.ToolButton, ICommandUserItem
{
CommandManager commandManager;
object commandId;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolbar.cs
deleted file mode 100644
index 320ebedb6e..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolbar.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// CommandToolbar.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using MonoDevelop.Components.DockToolbars;
-
-namespace MonoDevelop.Components.Commands
-{
- public class CommandToolbar: DockToolbar, ICommandBar
- {
- object initialCommandTarget;
-
- public CommandToolbar (CommandManager manager, string id, string title): base (id, title)
- {
- manager.RegisterCommandBar (this);
- }
-
- internal object InitialCommandTarget {
- get { return initialCommandTarget; }
- set { initialCommandTarget = value; }
- }
-
- protected override void OnShown ()
- {
- base.OnShown ();
- ((ICommandBar)this).Update (null);
- }
-
- void ICommandBar.Update (object defaultTarget)
- {
- if (!Visible)
- return;
-
- if (initialCommandTarget != null)
- defaultTarget = initialCommandTarget;
-
- CommandTargetRoute targetRoute = new CommandTargetRoute (defaultTarget);
- foreach (Gtk.Widget item in Children) {
- if (item is ICommandUserItem)
- ((ICommandUserItem)item).Update (targetRoute);
- else
- item.Show ();
- }
- }
-
- public void SetEnabled (bool enabled)
- {
- foreach (Gtk.Widget item in Children) {
- if (item.GetType () == typeof(Gtk.ToolItem))
- item.Sensitive = enabled;
- }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/KeyBindingManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/KeyBindingManager.cs
index ec563318db..3b460a0198 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/KeyBindingManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/KeyBindingManager.cs
@@ -82,15 +82,15 @@ namespace MonoDevelop.Components.Commands
#region Platform-dependent selection modifiers
//FIXME: these should be named for what they do, not what they are
- public static Gdk.ModifierType SelectionModifierAlt {
+ internal static Gdk.ModifierType SelectionModifierAlt {
get; private set;
}
- public static Gdk.ModifierType SelectionModifierControl {
+ internal static Gdk.ModifierType SelectionModifierControl {
get; private set;
}
- public static Gdk.ModifierType SelectionModifierSuper {
+ internal static Gdk.ModifierType SelectionModifierSuper {
get; private set;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/LinkCommandEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/LinkCommandEntry.cs
index ec3c49e921..0e75a13fed 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/LinkCommandEntry.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/LinkCommandEntry.cs
@@ -73,7 +73,7 @@ namespace MonoDevelop.Components.Commands
}
}
- internal protected override Gtk.MenuItem CreateMenuItem (CommandManager manager)
+ internal override Gtk.MenuItem CreateMenuItem (CommandManager manager)
{
Gtk.ImageMenuItem item = new Gtk.ImageMenuItem (text != null ? text : url);
item.Image = new Gtk.Image (icon, Gtk.IconSize.Menu);
@@ -90,7 +90,7 @@ namespace MonoDevelop.Components.Commands
return item;
}
- internal protected override Gtk.ToolItem CreateToolItem (CommandManager manager)
+ internal override Gtk.ToolItem CreateToolItem (CommandManager manager)
{
Gtk.ToolButton item = new Gtk.ToolButton (text);
item.StockId = icon;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/MenuToolButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/MenuToolButton.cs
index 1524a03214..737c3694ea 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/MenuToolButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/MenuToolButton.cs
@@ -30,7 +30,7 @@ using System;
namespace MonoDevelop.Components.Commands
{
- public class MenuToolButton: Gtk.ToolButton
+ internal class MenuToolButton: Gtk.ToolButton
{
Gtk.Menu menu;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs
index 397d413170..756d2b672f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs
@@ -51,7 +51,7 @@ namespace MonoDevelop.Components.DockNotebook
var doc = IdeApp.Workbench.ActiveDocument;
if (doc == null)
return;
- var rootWindow = doc.Window.ActiveViewContent.Control.Toplevel as DockWindow;
+ var rootWindow = doc.Window.ActiveViewContent.Control.GetNativeWidget<Gtk.Widget> ().Toplevel as DockWindow;
if (rootWindow == null)
return;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/ArrowWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/ArrowWindow.cs
deleted file mode 100644
index 8d02dc185d..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/ArrowWindow.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// ArrowWindow.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- internal class ArrowWindow: Gtk.Window
- {
- const int LineWidth = 3;
- const int LineLength = 9;
- const int PointerWidth = 13;
- const int PointerLength = 6;
-
- Direction direction;
- Point[] arrow;
- int width, height;
-
- Gdk.GC redgc;
-
- // Where does the arrow point to
- public new enum Direction {
- Up, Down, Left, Right
- }
-
- public ArrowWindow (DockToolbarFrame frame, Direction dir): base (Gtk.WindowType.Popup)
- {
- SkipTaskbarHint = true;
- Decorated = false;
- TransientFor = frame.TopWindow;
-
- direction = dir;
- arrow = CreateArrow ();
- if (direction == Direction.Up || direction == Direction.Down) {
- width = PointerWidth;
- height = LineLength + PointerLength + 1;
- } else {
- height = PointerWidth;
- width = LineLength + PointerLength + 1;
- }
-
- // Create the mask for the arrow
-
- Gdk.Color black, white;
- black = new Gdk.Color (0, 0, 0);
- black.Pixel = 1;
- white = new Gdk.Color (255, 255, 255);
- white.Pixel = 0;
-
- Gdk.Pixmap pm = new Pixmap (this.GdkWindow, width, height, 1);
- Gdk.GC gc = new Gdk.GC (pm);
- gc.Background = white;
- gc.Foreground = white;
- pm.DrawRectangle (gc, true, 0, 0, width, height);
-
- gc.Foreground = black;
- pm.DrawPolygon (gc, false, arrow);
- pm.DrawPolygon (gc, true, arrow);
-
- this.ShapeCombineMask (pm, 0, 0);
-
- Realize ();
-
- redgc = new Gdk.GC (GdkWindow);
- redgc.RgbFgColor = new Gdk.Color (255, 0, 0);
-
- Resize (width, height);
- }
-
- public int Width {
- get { return width; }
- }
-
- public int Height {
- get { return height; }
- }
-
- Point[] CreateArrow ()
- {
- Point[] ps = new Point [8];
- ps [0] = GetPoint (0, (PointerWidth/2) - (LineWidth/2));
- ps [1] = GetPoint (LineLength, (PointerWidth/2) - (LineWidth/2));
- ps [2] = GetPoint (LineLength, 0);
- ps [3] = GetPoint (PointerLength + LineLength, (PointerWidth/2));
- ps [4] = GetPoint (LineLength, PointerWidth - 1);
- ps [5] = GetPoint (LineLength, (PointerWidth/2) + (LineWidth/2));
- ps [6] = GetPoint (0, (PointerWidth/2) + (LineWidth/2));
- ps [7] = ps [0];
- return ps;
- }
-
- Point GetPoint (int x, int y)
- {
- switch (direction) {
- case Direction.Right: return new Point (x, y);
- case Direction.Left: return new Point ((PointerLength + LineLength) - x, y);
- case Direction.Down: return new Point (y, x);
- default: return new Point (y, (PointerLength + LineLength) - x);
- }
- }
-
- protected override bool OnExposeEvent (Gdk.EventExpose args)
- {
- GdkWindow.DrawPolygon (redgc, false, arrow);
- GdkWindow.DrawPolygon (redgc, true, arrow);
- return true;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockGrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockGrip.cs
deleted file mode 100644
index 716763dee1..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockGrip.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// DockGrip.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- internal class DockGrip: ToolItem
- {
- static int GripSize = MonoDevelop.Core.Platform.IsWindows? 4 : 6; //wimp theme engine looks ugly with width 6
- const int MarginLeft = 1;
- const int MarginRight = 3;
-
- public DockGrip ()
- {
- }
-
- protected override void OnSizeRequested (ref Requisition req)
- {
- if (Orientation == Orientation.Horizontal) {
- req.Width = GripSize + MarginLeft + MarginRight;
- req.Height = 0;
- } else {
- req.Width = 0;
- req.Height = GripSize + MarginLeft + MarginRight;
- }
- }
-
- protected override bool OnExposeEvent (Gdk.EventExpose args)
- {
- Rectangle rect = Allocation;
- if (Orientation == Orientation.Horizontal) {
- rect.Width = GripSize;
- rect.X += MarginLeft;
- } else {
- rect.Height = GripSize;
- rect.Y += MarginLeft;
- }
-
- Gtk.Orientation or = Orientation == Gtk.Orientation.Horizontal ? Gtk.Orientation.Vertical : Gtk.Orientation.Horizontal;
- Gtk.Style.PaintHandle (this.Style, this.ParentWindow, this.State, Gtk.ShadowType.None, args.Area, this, "grip", rect.X, rect.Y, rect.Width, rect.Height, or);
- return true;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbar.cs
deleted file mode 100644
index 3e3f6a4b21..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbar.cs
+++ /dev/null
@@ -1,410 +0,0 @@
-//
-// DockToolbar.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using System.Collections.Generic;
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public class DockToolbar: Toolbar, IDockToolbar
- {
- DockGrip grip;
- DockToolbarFrame parentFrame;
- bool dragging;
- FloatingDock floatingDock;
- string id;
- string title;
-
- int row;
- int offset;
- int shiftOffset = -1;
-
- // Offset requested by the user. It is used to know where the
- // toolbar is expected to move when the window is expanded.
- int anchorOffset;
-
- Animation animation;
- DockToolbarPosition lastPosition;
- DockToolbarStatus defaultStatus;
-
- int defaultSize;
- int defaultHeight;
- bool gotSize = false;
- bool gettingSize;
- Dictionary<Gtk.Widget,int> calculatedSizes = new Dictionary<Gtk.Widget, int> ();
-
- public DockToolbar (string id, string title)
- {
- grip = new DockGrip ();
- Add (grip);
- grip.Hide ();
- this.id = id;
- this.title = title;
- ShowArrow = false;
- }
-
- internal void SetParentFrame (DockToolbarFrame frame)
- {
- parentFrame = frame;
- grip.Show ();
- }
-
- public string Id {
- get { return id; }
- }
-
- public string Title {
- get { return title; }
- }
-
- public bool Floating {
- get { return floatingDock != null; }
- }
-
- bool IDockToolbar.Visible {
- get { return Parent != null; }
- set {
- if (value == ((IDockToolbar)this).Visible)
- return;
-
- if (value) {
- if (lastPosition != null)
- lastPosition.RestorePosition (parentFrame, this);
- else
- defaultStatus.Position.RestorePosition (parentFrame, this);
- } else {
- lastPosition = DockToolbarPosition.Create (this);
- if (Floating) {
- FloatingDock win = FloatingDock;
- win.Detach ();
- win.Destroy ();
- }
- else
- DockPanel.RemoveBar (this);
- }
- }
- }
-
- internal DockToolbarPosition Position {
- get {
- if (((IDockToolbar)this).Visible) return DockToolbarPosition.Create (this);
- else if (lastPosition != null) return lastPosition;
- else return defaultStatus.Position;
- }
- }
-
- internal DockToolbarStatus Status {
- get {
- return new DockToolbarStatus (id, ((IDockToolbar)this).Visible, Position);
- }
- set {
- if (value.Visible) {
- ((IDockToolbar)this).Visible = false;
- lastPosition = value.Position;
- ((IDockToolbar)this).Visible = true;
- } else {
- ((IDockToolbar)this).Visible = false;
- lastPosition = value.Position;
- }
- }
-
- }
-
- internal DockToolbarStatus DefaultStatus {
- get { return defaultStatus; }
- set { defaultStatus = value; }
- }
-
- internal int DockRow {
- get { return row; }
- set { row = value; }
- }
-
- /// <summary>
- /// The current offset of the toolbar
- /// </summary>
- internal int DockOffset {
- get { return offset; }
- set { offset = value; }
- }
-
- internal int DockShiftOffset {
- get { return shiftOffset; }
- set { shiftOffset = value; }
- }
-
- /// <summary>
- /// The ideal offset of the toolbar. It may not be the real offset if the
- /// toolbar has been forced to move to make room for other toolbars
- /// </summary>
- internal int AnchorOffset {
- get { return anchorOffset; }
- set { anchorOffset = value; }
- }
-
- internal int DefaultSize {
- get {
- if (!gotSize) CalcSizes ();
- return defaultSize;
- }
- }
-
- public int DefaultHeight {
- get {
- if (!gotSize) CalcSizes ();
- return defaultHeight;
- }
- }
-
- internal void CalcSizes ()
- {
- // Calculates the real size of the toolbar. ShowArrow=false is
- // needed, since SizeRequest reports 0 size requested if not.
-
- gettingSize = true;
- bool olda = ShowArrow;
- int oldw = WidthRequest;
- int oldh = HeightRequest;
- WidthRequest = -1;
- HeightRequest = -1;
-
- ShowArrow = false;
- Requisition r = SizeRequest ();
- if (Orientation == Orientation.Horizontal) {
- defaultSize = r.Width;
- defaultHeight = r.Height;
- }
- else {
- defaultSize = r.Height;
- defaultHeight = r.Width;
- }
-
- calculatedSizes.Clear ();
- foreach (Widget w in Children) {
- if (!w.Visible)
- continue;
- if (Orientation == Orientation.Horizontal)
- calculatedSizes [w] = w.Allocation.Width;
- else
- calculatedSizes [w] = w.Allocation.Height;
- }
-
- WidthRequest = oldw;
- HeightRequest = oldh;
- ShowArrow = olda;
- gotSize = true;
- gettingSize = false;
- }
-
- internal bool CanDockTo (DockToolbarPanel panel)
- {
- return true;
- }
-
- internal FloatingDock FloatingDock {
- get { return floatingDock; }
- set { floatingDock = value; }
- }
-
- internal DockToolbarPanel DockPanel {
- get { return Parent as DockToolbarPanel; }
- }
-
- internal Animation Animation {
- get { return animation; }
- set { animation = value; }
- }
-
- protected override bool OnButtonPressEvent (EventButton e)
- {
- if (parentFrame != null && e.Button == 1 && !e.TriggersContextMenu ()) {
- if (Orientation == Orientation.Horizontal && e.X <= 10) {
- dragging = true;
- parentFrame.StartDragBar (this, (int)e.X, (int)e.Y, e.Time);
- return true;
- }
- else if (Orientation == Orientation.Vertical && e.Y <= 10) {
- dragging = true;
- parentFrame.StartDragBar (this, (int)e.X, (int)e.Y, e.Time);
- return true;
- }
- }
- return base.OnButtonPressEvent (e);
- }
-
- protected override bool OnButtonReleaseEvent (EventButton e)
- {
- if (e.Button == 1 && dragging) {
- dragging = false;
- parentFrame.EndDragBar (this, e.Time);
- }
- return base.OnButtonReleaseEvent (e);
- }
-
- protected override bool OnExposeEvent (EventExpose evnt)
- {
- //HACK: the WIMP theme engine's rendering is a bit off, need to force it to render wider
- if (MonoDevelop.Core.Platform.IsWindows && Orientation == Orientation.Horizontal) {
- int widen = 1;
- var shadowType = (ShadowType)StyleGetProperty ("shadow-type");
- Style.PaintBox (Style, evnt.Window, State, shadowType, evnt.Area, this, "toolbar",
- Allocation.X - widen, Allocation.Y, Allocation.Width + widen + widen, Allocation.Height);
-
- foreach (Widget child in Children) {
- PropagateExpose (child, evnt);
- }
- return true;
- }
-
- return base.OnExposeEvent (evnt);
- }
-
- bool firstRealized;
- protected override void OnRealized ()
- {
- base.OnRealized ();
- if (!firstRealized) {
- OnItemChange (null, null);
- firstRealized = true;
- }
- }
-
-
- internal void ResetSize ()
- {
- WidthRequest = -1;
- HeightRequest = -1;
- ShowArrow = false;
- }
-
- public int Size {
- set {
- if (Orientation == Orientation.Horizontal) {
- if (value >= DefaultSize)
- WidthRequest = -1;
- else
- WidthRequest = value;
- }
- else {
- if (value >= DefaultSize)
- HeightRequest = -1;
- else
- HeightRequest = value;
- HeightRequest = value;
- }
- }
- get {
- if (Orientation == Orientation.Horizontal)
- return SizeRequest ().Width;
- else
- return SizeRequest ().Height;
- }
- }
-
- public new Orientation Orientation {
- get {
- return base.Orientation;
- }
- set {
- if (value == base.Orientation)
- return;
-
- if (FloatingDock != null) {
- // I create a new dock window because resizing the
- // current one has lots of issues (mainly synchronization
- // problems between the size change of the window and
- // the toolbar).
-
- int x,y;
- FloatingDock w = FloatingDock;
- w.GetPosition (out x, out y);
- w.Detach ();
-
- base.Orientation = value;
-
- FloatingDock fdock = new FloatingDock (parentFrame);
- fdock.Move (x, y);
- fdock.Attach (this);
- w.Destroy ();
- } else
- base.Orientation = value;
- gotSize = false;
- }
- }
-
- protected override void OnAdded (Widget w)
- {
- base.OnAdded (w);
- gotSize = false;
- if (DefaultSizeChanged != null)
- DefaultSizeChanged (this, EventArgs.Empty);
- w.Shown += OnItemChange;
- w.Hidden += OnItemChange;
- w.SizeAllocated += OnItemSizeChange;
- }
-
- protected override void OnRemoved (Widget w)
- {
- base.OnRemoved (w);
- gotSize = false;
- if (DefaultSizeChanged != null)
- DefaultSizeChanged (this, EventArgs.Empty);
- w.Shown -= OnItemChange;
- w.Hidden -= OnItemChange;
- w.SizeAllocated -= OnItemSizeChange;
- }
-
- void OnItemSizeChange (object o, SizeAllocatedArgs args)
- {
- if (gettingSize || !gotSize)
- return;
- int os;
- if (calculatedSizes.TryGetValue ((Gtk.Widget) o, out os)) {
- int ns = (Orientation == Orientation.Horizontal ? args.Allocation.Width : args.Allocation.Height);
- if (os != ns) {
- Gtk.Application.Invoke (delegate {
- OnItemChange (null, null);
- });
- }
- }
- }
-
- void OnItemChange (object o, EventArgs args)
- {
- // This notifies changes in the size of the toolbar
- gotSize = false;
- if (DefaultSizeChanged != null)
- DefaultSizeChanged (this, EventArgs.Empty);
- }
-
- internal event EventHandler DefaultSizeChanged;
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrame.cs
deleted file mode 100644
index e1efdd06a6..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrame.cs
+++ /dev/null
@@ -1,397 +0,0 @@
-//
-// DockToolbarFrame.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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 Gtk;
-using Gdk;
-using System.Xml;
-using System.Xml.Serialization;
-using System.Collections.Generic;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public class DockToolbarFrame: EventBox
- {
- DockToolbarPanel[] panels;
- DockToolbarPanel targetPanel;
- VBox vbox;
- VBox contentBox;
- DockToolbar dragBar;
- int xDragDif, yDragDif;
- List<DockToolbar> bars = new List<DockToolbar> ();
-
- Dictionary<string,DockToolbarStatus[]> layouts = new Dictionary<string,DockToolbarStatus[]> ();
- string currentLayout = "";
-
- Cursor handCursor = new Cursor (CursorType.Fleur);
-
- public DockToolbarFrame ()
- {
- vbox = new VBox ();
- Add (vbox);
-
- DockToolbarPanel topPanel = new DockToolbarPanel (this, Placement.Top);
- DockToolbarPanel bottomPanel = new DockToolbarPanel (this, Placement.Bottom);
- DockToolbarPanel leftPanel = new DockToolbarPanel (this, Placement.Left);
- DockToolbarPanel rightPanel = new DockToolbarPanel (this, Placement.Right);
-
- panels = new DockToolbarPanel [4];
- panels [(int)Placement.Top] = topPanel;
- panels [(int)Placement.Bottom] = bottomPanel;
- panels [(int)Placement.Left] = leftPanel;
- panels [(int)Placement.Right] = rightPanel;
-
- vbox.PackStart (topPanel, false, false, 0);
-
- HBox hbox = new HBox ();
- contentBox = new VBox ();
-
- hbox.PackStart (leftPanel, false, false, 0);
- hbox.PackStart (contentBox, true, true, 0);
- hbox.PackStart (rightPanel, false, false, 0);
-
- vbox.PackStart (hbox, true, true, 0);
- vbox.PackStart (bottomPanel, false, false, 0);
-
- this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask;
- ShowAll ();
- }
-
- public void AddContent (Widget w)
- {
- contentBox.PackStart (w, true, true, 0);
- }
-
- public void RemoveContent (Widget w)
- {
- contentBox.Remove (w);
- }
-
- public string CurrentLayout {
- get { return currentLayout; }
- set {
- if (value != currentLayout) {
- SaveCurrentLayout ();
- RestoreLayout (value);
- }
- }
- }
-
- public DockToolbarFrameStatus GetStatus ()
- {
- SaveCurrentLayout ();
- DockToolbarFrameStatus col = new DockToolbarFrameStatus ();
- col.Version = DockToolbarFrameStatus.CurrentVersion;
-
- foreach (var layout in layouts) {
- col.Status.Add (new DockToolbarFrameLayout () {
- Id = layout.Key,
- Bars = layout.Value,
- });
- }
- return col;
- }
-
- public void SetStatus (DockToolbarFrameStatus status)
- {
- layouts.Clear ();
- if (status != null && status.Status != null) {
- foreach (DockToolbarFrameLayout c in status.Status) {
- if (status.Version < 2) {
- // Convert from old to new toolbar id
- foreach (DockToolbarStatus ts in c.Bars)
- ts.BarId = ConvertToolbarId (ts.BarId);
- }
- layouts [c.Id] = c.Bars;
- }
- }
- RestoreLayout ("");
- }
-
- public void SaveStatus (XmlWriter writer)
- {
- XmlSerializer ser = new XmlSerializer (typeof(DockToolbarFrameStatus));
- ser.Serialize (writer, GetStatus ());
- }
-
- public void LoadStatus (XmlReader reader)
- {
- layouts.Clear ();
- XmlSerializer ser = new XmlSerializer (typeof(DockToolbarFrameStatus));
- DockToolbarFrameStatus col = (DockToolbarFrameStatus) ser.Deserialize (reader);
- SetStatus (col);
- }
-
- string ConvertToolbarId (string id)
- {
- // Old MD versions include the display name of the toolbar in the id.
- // New MD versions use a different id composition.
- // This method translates the id from the old to the new format (when possible)
-
- int i = id.LastIndexOf ('/');
- if (i == -1)
- return id;
-
- string baseId = id.Substring (0, i + 1);
-
- foreach (DockToolbar t in bars) {
- if (t.Id == id)
- return id;
- if (baseId + t.Title == id)
- return t.Id;
- }
- return id;
- }
-
- public IDockToolbar AddBar (DockToolbar bar)
- {
- return AddBar (bar, Placement.Top, true);
- }
-
- public IDockToolbar AddBar (DockToolbar bar, Placement defaultPanel, bool defaultVisible)
- {
- bar.SetParentFrame (this);
- bars.Add (bar);
-
- DockToolbarPosition pos = new DockedPosition (defaultPanel);
- DockToolbarStatus s = new DockToolbarStatus (bar.Id, defaultVisible, pos);
- bar.DefaultStatus = s;
- bar.Status = s;
-
- return bar;
- }
-
- public void RemoveToolbar(DockToolbar bar)
- {
- IDockToolbar db = (IDockToolbar)bar;
- db.Visible = false;
- bar.Destroy();
- bars.Remove(bar);
- }
-
- public void ClearToolbars ()
- {
- foreach (DockToolbar bar in bars) {
- IDockToolbar db = (IDockToolbar) bar;
- db.Visible = false;
- bar.Destroy ();
- }
- bars.Clear ();
- }
-
- public IDockToolbar GetBar (string id)
- {
- foreach (DockToolbar bar in bars)
- if (bar.Id == id) return bar;
- return null;
- }
-
- public ICollection<DockToolbar> Toolbars {
- get { return bars; }
- }
-
- public void ResetToolbarPositions ()
- {
- foreach (DockToolbarPanel panel in panels)
- panel.ResetBarPositions (false);
- }
-
- void SaveCurrentLayout ()
- {
- DockToolbarStatus[] status = SaveStatus ();
- layouts [currentLayout] = status;
- }
-
- void RestoreLayout (string layout)
- {
- DockToolbarStatus[] status;
- layouts.TryGetValue (layout, out status);
- RestoreStatus (status);
- currentLayout = layout;
- }
-
- internal void DeleteLayout (string layout)
- {
- if (layouts.ContainsKey (layout))
- layouts.Remove (layout);
- }
-
- DockToolbarStatus[] SaveStatus ()
- {
- DockToolbarStatus[] status = new DockToolbarStatus [bars.Count];
- for (int n=0; n<bars.Count; n++) {
- DockToolbar bar = (DockToolbar) bars [n];
- status [n] = bar.Status;
- }
- return status;
- }
-
- void RestoreStatus (DockToolbarStatus[] status)
- {
- foreach (IDockToolbar b in bars)
- b.Visible = false;
-
- if (status == null) {
- foreach (DockToolbar bar in bars)
- bar.Status = bar.DefaultStatus;
- } else {
- foreach (DockToolbarStatus s in status) {
- DockToolbar bar = (DockToolbar) GetBar (s.BarId);
- if (bar != null)
- bar.Status = s;
- }
- }
- }
-
- internal int DockMargin {
- get { return 7; }
- }
-
- internal void DockToolbar (DockToolbar bar, Placement placement, int offset, int row)
- {
- DockToolbarPanel p = GetPanel (placement);
- if (row != -1)
- p.AddDockToolbar (bar, offset, row);
- else
- p.AddDockToolbar (bar);
- }
-
- internal void FloatBar (DockToolbar bar, Orientation orientation, int x, int y)
- {
- FloatingDock fdock = new FloatingDock (this);
- fdock.Move (x, y);
- bar.ResetSize ();
- fdock.Attach (bar);
- bar.Orientation = orientation;
- }
-
- internal Gtk.Window TopWindow {
- get {
- Widget w = Parent;
- while (w != null && !(w is Gtk.Window))
- w = w.Parent;
- return (Gtk.Window) w;
- }
- }
-
- DockToolbarPanel GetPanel (Placement o)
- {
- return panels [(int)o];
- }
-
- protected override bool OnMotionNotifyEvent (EventMotion e)
- {
- if (dragBar != null) {
- int sx,sy;
- this.GdkWindow.GetOrigin (out sx, out sy);
- int rx = (int)e.XRoot - sx;
- int ry = (int)e.YRoot - sy;
-
- if (dragBar.Floating) {
- bool foundPanel = false;
- dragBar.FloatingDock.Move ((int)e.XRoot + xDragDif, (int)e.YRoot + yDragDif);
- Rectangle barRect = new Rectangle (rx + xDragDif, ry + yDragDif, dragBar.Allocation.Width, dragBar.DefaultHeight);
- foreach (DockToolbarPanel p in panels) {
- if (p.Allocation.IntersectsWith (barRect)) {
- if (targetPanel != null && targetPanel != p)
- targetPanel.EndDragBar (dragBar);
- p.Reposition (dragBar, rx, ry, xDragDif, yDragDif);
- targetPanel = p;
- foundPanel = true;
- break;
- }
- }
- if (!foundPanel && targetPanel != null)
- targetPanel.EndDragBar (dragBar);
- } else {
- DockToolbarPanel panel = (DockToolbarPanel) dragBar.Parent;
- panel.Reposition (dragBar, rx, ry, xDragDif, yDragDif);
- }
- }
- return base.OnMotionNotifyEvent (e);
- }
-
- internal void StartDragBar (DockToolbar bar, int x, int y, uint time)
- {
- dragBar = bar;
- xDragDif = -x;
- yDragDif = -y;
- Pointer.Grab (this.GdkWindow, false, EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask, null, handCursor, time);
- if (!bar.Floating) {
- DockToolbarPanel panel = (DockToolbarPanel) dragBar.Parent;
- panel.StartDragBar (bar);
- }
- }
-
- internal void EndDragBar (DockToolbar bar, uint time)
- {
- Pointer.Ungrab (time);
- if (targetPanel != null) {
- targetPanel.DropDragBar (bar);
- targetPanel.EndDragBar (bar);
- }
- dragBar = null;
- }
-
- protected override bool OnButtonReleaseEvent (EventButton e)
- {
- if (dragBar != null)
- EndDragBar (dragBar, e.Time);
-
- return base.OnButtonReleaseEvent (e);
- }
-
- protected override bool OnButtonPressEvent (Gdk.EventButton e)
- {
- if (e.TriggersContextMenu ()) {
- int sx,sy;
- this.GdkWindow.GetOrigin (out sx, out sy);
- int rx = (int)e.XRoot - sx;
- int ry = (int)e.YRoot - sy;
-
- foreach (DockToolbarPanel p in panels) {
- if (p.Allocation.Contains (rx, ry))
- OnPanelClick (e, p.Placement);
- }
- }
- return base.OnButtonPressEvent (e);
- }
-
- protected virtual void OnPanelClick (Gdk.EventButton e, Placement placement)
- {
- }
-
- protected override void OnDestroyed ()
- {
- if (handCursor != null) {
- handCursor.Dispose ();
- handCursor = null;
- }
- base.OnDestroyed ();
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameLayout.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameLayout.cs
deleted file mode 100644
index 1330a6aa25..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameLayout.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// DockToolbarFrameLayout.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public class DockToolbarFrameLayout
- {
- [XmlAttribute ("id")]
- public string Id;
-
- [XmlElement ("dockbar")]
- public DockToolbarStatus[] Bars;
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameStatus.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameStatus.cs
deleted file mode 100644
index 95d34d70b0..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameStatus.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// DockToolbarFrameStatus.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using System.Collections;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public class DockToolbarFrameStatus
- {
- internal const int CurrentVersion = 2;
-
- [XmlElement ("version")]
- public int Version = 1;
-
- [XmlElement ("layout", typeof(DockToolbarFrameLayout))]
- public ArrayList Status = new ArrayList ();
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPanel.cs
deleted file mode 100644
index dcbec75139..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPanel.cs
+++ /dev/null
@@ -1,1034 +0,0 @@
-//
-// DockToolbarPanel.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using Gtk;
-using Gdk;
-using System.Collections;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- internal class DockToolbarPanel: FixedPanel
- {
- DockToolbarFrame parentFrame;
- ArrayList bars = new ArrayList ();
- Orientation orientation;
-
- ArrowWindow placeholderArrow1;
- ArrowWindow placeholderArrow2;
- PlaceholderWindow placeholder;
- bool currentPlaceholderHorz;
-
- int dropOffset;
- int dropRow = -1;
- bool dropNewRow;
- bool enableAnimations = true;
-
- public DockToolbarPanel (DockToolbarFrame parentFrame, Placement placement)
- {
- // ResizeMode = ResizeMode.Immediate;
- Placement = placement;
- switch (placement) {
- case Placement.Top:
- this.orientation = Orientation.Horizontal;
- break;
- case Placement.Bottom:
- this.orientation = Orientation.Horizontal;
- break;
- case Placement.Left:
- this.orientation = Orientation.Vertical;
- break;
- case Placement.Right:
- this.orientation = Orientation.Vertical;
- break;
- }
-
- this.parentFrame = parentFrame;
- }
-
- public Orientation Orientation {
- get { return orientation; }
- }
-
- public void AddDockToolbar (DockToolbar bar)
- {
- bool ea = EnableAnimation (false);
-
- Put (bar, 0, 0);
- bar.Orientation = orientation;
-
- if (bars.Count > 0 && IsRealized) {
- DockToolbar last = (DockToolbar) bars [bars.Count - 1];
- int width = bar.DefaultSize;
- int lastx = last.DockOffset + last.DefaultSize;
-
- if (lastx + width <= PanelWidth)
- MoveBar (bar, lastx, last.DockRow, false);
- else
- MoveBar (bar, 0, last.DockRow + 1, false);
- bar.AnchorOffset = bar.DockOffset;
- InternalAdd (bar);
- SortBars ();
- } else {
- MoveBar (bar, 0, 0);
- bar.AnchorOffset = bar.DockOffset;
- InternalAdd (bar);
- }
-
- EnableAnimation (ea);
- }
-
- public void AddDockToolbar (DockToolbar bar, int offset, int row)
- {
- bool ea = EnableAnimation (false);
- InternalAdd (bar);
- Put (bar, 0, 0);
- bar.Orientation = orientation;
- MoveBar (bar, offset, row, false);
- bar.AnchorOffset = offset;
- SortBars ();
- UpdateRowSizes (bar.DockRow);
- EnableAnimation (ea);
- }
-
- void InternalAdd (DockToolbar bar)
- {
- bars.Add (bar);
- bar.DefaultSizeChanged += new EventHandler (OnBarSizeChanged);
- }
-
- public void RemoveBar (DockToolbar bar)
- {
- if (IsSingleBarRow (bar))
- RemoveRow (bar.DockRow);
-
- Remove (bar);
- bars.Remove (bar);
- bar.DefaultSizeChanged -= new EventHandler (OnBarSizeChanged);
-
- UpdateRowHeight (bar.DockRow);
- PackBars ();
- }
-
- protected override void OnRealized ()
- {
- base.OnRealized ();
- ResetBarPositions (false);
- }
-
- public void ResetBarPositions (bool animate)
- {
- int x=0, row=0;
- int width = PanelWidth;
-
- bool ea = EnableAnimation (animate);
-
- foreach (DockToolbar b in bars) {
- int barw = GetChildWidth (b);
- if (x + barw < width)
- MoveBar (b, x, row);
- else {
- row++;
- x = 0;
- MoveBar (b, 0, row);
- }
- x += barw;
- }
- SortBars ();
- EnableAnimation (ea);
- }
-
- void SetPlaceholder (DockToolbar bar, int offset, int row)
- {
- if (dropRow != row && dropRow != -1)
- RestoreShiftedBars (dropRow);
-
- ShowPlaceholder (bar, false, offset, GetRowTop (row), GetChildWidth (bar), GetRowSize (row));
-
- dropOffset = offset;
- dropRow = row;
- dropNewRow = false;
- }
-
- void SetNewRowPlaceholder (DockToolbar bar, int offset, int toprow)
- {
- if (dropRow != -1)
- RestoreShiftedBars (dropRow);
-
- int y = GetRowTop (toprow) - parentFrame.DockMargin;
- int h = parentFrame.DockMargin * 2;
- ShowPlaceholder (bar, true, offset, y, GetChildWidth (bar), h);
-
- dropOffset = offset;
- dropRow = toprow;
- dropNewRow = true;
- }
-
- void ShowPlaceholder (DockToolbar bar, bool horz, int x, int y, int w, int h)
- {
- if (orientation != Orientation.Horizontal)
- horz = !horz;
-
- PanelToWindow (x, y, w, h, out x, out y, out w, out h);
-
- bool created = false;
-
- if (placeholder == null || horz != currentPlaceholderHorz) {
- HidePlaceholder ();
- placeholder = new PlaceholderWindow (parentFrame);
- placeholderArrow1 = new ArrowWindow (parentFrame, horz ? ArrowWindow.Direction.Right : ArrowWindow.Direction.Down);
- placeholderArrow2 = new ArrowWindow (parentFrame, horz ? ArrowWindow.Direction.Left : ArrowWindow.Direction.Up);
- currentPlaceholderHorz = horz;
- created = true;
- }
-
- int sx, sy;
- this.GdkWindow.GetOrigin (out sx, out sy);
- sx += x;
- sy += y;
-
- int mg = -4;
- placeholder.Move (sx - mg, sy - mg);
- placeholder.Resize (w + mg*2, h + mg * 2);
-
- if (horz) {
- placeholderArrow1.Move (sx - placeholderArrow1.Width, sy + (h/2) - placeholderArrow1.Height/2);
- placeholderArrow2.Move (sx + w, sy + (h/2) - placeholderArrow1.Height/2);
- } else {
- int px = sx + w/2 - placeholderArrow1.Width/2;
- if (px < 0) px = 0;
- placeholderArrow1.Move (px, sy - placeholderArrow1.Height);
- placeholderArrow2.Move (px, sy + h);
- }
-
- if (created) {
- placeholder.Show ();
- placeholder.Present ();
- if (bar.FloatingDock != null)
- bar.FloatingDock.Present ();
- placeholderArrow1.Present ();
- placeholderArrow2.Present ();
- }
- }
-
- void HidePlaceholder ()
- {
- if (placeholder == null) return;
- placeholder.Destroy ();
- placeholder = null;
- placeholderArrow1.Destroy ();
- placeholderArrow1 = null;
- placeholderArrow2.Destroy ();
- placeholderArrow2 = null;
-
- if (dropRow != -1 && !dropNewRow) {
- RestoreShiftedBars (dropRow);
- dropRow = -1;
- }
- }
-
- bool IsPlaceHolderVisible {
- get { return placeholder != null; }
- }
-
- public void StartDragBar (DockToolbar bar)
- {
- }
-
- public void DropDragBar (DockToolbar bar)
- {
- if (!IsPlaceHolderVisible) return;
-
- foreach (DockToolbar b in bars) {
- if (b.DockRow == dropRow && b.DockShiftOffset != -1) {
- b.DockShiftOffset = -1;
- b.AnchorOffset = b.DockRow;
- }
- }
-
- if (dropRow != -1) {
- if (dropNewRow)
- InsertRow (bar, dropOffset, dropRow);
- else {
- MoveBar (bar, dropOffset, dropRow);
- UpdateRowHeight (dropRow);
- }
- SortBars ();
- dropRow = -1;
- }
- }
-
- public void EndDragBar (DockToolbar bar)
- {
- if (IsPlaceHolderVisible) {
- HidePlaceholder ();
- }
- }
-
- void RestoreShiftedBars (int row)
- {
- foreach (DockToolbar b in bars) {
- if (b.DockRow == row && b.DockShiftOffset != -1) {
- MoveBar (b, b.DockShiftOffset, b.DockRow, false);
- b.DockShiftOffset = -1;
- }
- }
- }
-
- public void Reposition (DockToolbar bar, int xcursor, int ycursor, int difx, int dify)
- {
- if (!bar.CanDockTo (this))
- return;
-
- bar.Orientation = orientation;
-
- int x, y;
- WindowToPanel (xcursor + difx, ycursor + dify, bar.Allocation.Width, bar.Allocation.Height, out x, out y);
- WindowToPanel (xcursor, ycursor, 0, 0, out xcursor, out ycursor);
-
- RepositionInternal (bar, x, y, xcursor, ycursor);
- }
-
- void RepositionInternal (DockToolbar bar, int x, int y, int xcursor, int ycursor)
- {
- int width = GetChildWidth (bar);
-
- ycursor = y + bar.DefaultHeight / 2;
-
- if (bars.Count == 0 && bar.Floating) {
- SetNewRowPlaceholder (bar, x, 0);
- return;
- }
-
- int dx = (x + width) - PanelWidth;
- if (dx > parentFrame.DockMargin && !bar.Floating) {
- HidePlaceholder ();
- FloatBar (bar, x, y);
- return;
- }
- else if (dx > 0)
- x -= dx;
- else if (x < -parentFrame.DockMargin && !bar.Floating) {
- HidePlaceholder ();
- FloatBar (bar, x, y);
- return;
- }
- else if (x < 0)
- x = 0;
-
- int nx = x;
- int row = -1;
-
- // Get the old bar y position
-
- int panelBottom = GetPanelBottom ();
-
- if (ycursor < - parentFrame.DockMargin || ycursor > panelBottom + parentFrame.DockMargin) {
- HidePlaceholder ();
- FloatBar (bar, x, y);
- return;
- }
-
- int rtop = 0;
- int prevtop = 0;
- row = 0;
- while (ycursor >= rtop) {
- prevtop = rtop;
- row++;
- if (rtop >= panelBottom) break;
- rtop += GetRowSize (row - 1);
- }
-
- row--;
- int ry = ycursor - prevtop;
-
- if (ry <= parentFrame.DockMargin && ry >= 0) {
- SetNewRowPlaceholder (bar, x, row);
- FloatBar (bar, x, y);
- return;
- } else if (ry >= (GetRowSize(row) - parentFrame.DockMargin) || (ry < 0 && -ry < parentFrame.DockMargin)) {
- SetNewRowPlaceholder (bar, x, row + 1);
- FloatBar (bar, x, y);
- return;
- }
-
- // Can't create a new row. Try to fit the bar in the current row
- // Find the first bar in the row:
-
- int ns = -1;
- for (int n=0; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar)bars[n];
-
- // Ignore the bar being moved
- if (b == bar) continue;
-
- if (b.DockRow == row) {
- ns = n;
- break;
- }
- }
-
- if (ns == -1) {
- // There are no other bars, no problem then
- if (bar.Floating) {
- SetPlaceholder (bar, nx, row);
- return;
- }
-
- if ((nx == bar.DockOffset && row == bar.DockRow) || (row != bar.DockRow)) {
- SetPlaceholder (bar, nx, row);
- FloatBar (bar, x, y);
- return;
- }
-
- HidePlaceholder ();
- MoveBar (bar, nx, row);
- return;
- }
-
- // Compute the available space, and find the bars at the
- // left and the right of the bar being moved
-
- int gapsTotal = 0;
- int lastx = 0;
- int leftIndex=-1, rightIndex = -1;
- int gapsLeft = 0, gapsRight = 0;
-
- for (int n=ns; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar)bars[n];
-
- // Ignore the bar being moved
- if (b == bar) continue;
-
- if (b.DockRow != row) break;
- int bx = b.DockOffset;
-
- if (bx > x && (rightIndex == -1))
- rightIndex = n;
- else if (bx <= x)
- leftIndex = n;
-
- if (bx < x)
- gapsLeft += bx - lastx;
- else {
- if (lastx < x) {
- gapsLeft += x - lastx;
- gapsRight += bx - x;
- } else
- gapsRight += bx - lastx;
- }
-
- gapsTotal += bx - lastx;
- lastx = GetChildRightOffset (b);
- }
-
- if (lastx < x) {
- gapsLeft += x - lastx;
- gapsRight += PanelWidth - x;
- } else {
- gapsRight += PanelWidth - lastx;
- }
-
- gapsTotal += PanelWidth - lastx;
-
- // Is there room for the bar?
- if (gapsTotal < width) {
- HidePlaceholder ();
- FloatBar (bar, x, y);
- return;
- }
-
- // Shift the bars at the left and the right
-
- int oversizeLeft = 0;
- int oversizeRight = 0;
-
- if (leftIndex != -1) {
- int r = GetChildRightOffset ((DockToolbar) bars [leftIndex]);
- oversizeLeft = r - nx;
- }
-
- if (rightIndex != -1) {
- int r = ((DockToolbar) bars [rightIndex]).DockOffset;
- oversizeRight = (nx + width) - r;
- }
-
- if (oversizeLeft > gapsLeft)
- oversizeRight += (oversizeLeft - gapsLeft);
- else if (oversizeRight > gapsRight)
- oversizeLeft += (oversizeRight - gapsRight);
-
- if (leftIndex != -1 && oversizeLeft > 0) {
- ShiftBar (leftIndex, -oversizeLeft);
- nx = GetChildRightOffset ((DockToolbar) bars [leftIndex]);
- }
-
- if (rightIndex != -1 && oversizeRight > 0) {
- ShiftBar (rightIndex, oversizeRight);
- nx = ((DockToolbar) bars [rightIndex]).DockOffset - width;
- }
-
-
- if (bar.Floating) {
- SetPlaceholder (bar, nx, row);
- return;
- }
-
- if ((nx == bar.DockOffset && row == bar.DockRow) || (row != bar.DockRow)) {
- if (bar.Floating) {
- SetPlaceholder (bar, nx, row);
- FloatBar (bar, x, y);
- }
- return;
- }
-
- HidePlaceholder ();
- MoveBar (bar, nx, row);
- }
-
- void FloatBar (DockToolbar bar, int x, int y)
- {
- if (bar.Floating) return;
-
- int wx,wy,w,h;
- PanelToWindow (x, y, GetChildWidth (bar), bar.DefaultHeight, out x, out y, out w, out h);
-
- this.GdkWindow.GetOrigin (out wx, out wy);
- RemoveBar (bar);
- parentFrame.FloatBar (bar, orientation, wx + x, wy + y);
- }
-
- void ShiftBar (int index, int size)
- {
- DockToolbar bar = (DockToolbar) bars [index];
- if (bar.DockShiftOffset == -1)
- bar.DockShiftOffset = bar.DockOffset;
-
- if (size > 0) {
- int rp = GetChildRightOffset (bar);
- int gap = PanelWidth - rp;
- if (index + 1 < bars.Count) {
- DockToolbar obar = (DockToolbar) bars [index + 1];
- if (bar.DockRow == obar.DockRow) {
- gap = obar.DockOffset - rp;
- if (gap < size) {
- ShiftBar (index + 1, size - gap);
- gap = obar.DockOffset - rp;
- }
- }
- }
- if (gap > size)
- gap = size;
- if (gap > 0)
- MoveBar (bar, bar.DockOffset + gap, bar.DockRow, false);
- } else {
- size = -size;
- int lp = bar.DockOffset;
- int gap = lp;
- if (index > 0) {
- DockToolbar obar = (DockToolbar) bars [index - 1];
- if (bar.DockRow == obar.DockRow) {
- gap = lp - GetChildRightOffset (obar);
- if (gap < size) {
- ShiftBar (index - 1, gap - size);
- gap = lp - GetChildRightOffset (obar);
- }
- }
- }
-
- if (gap > size)
- gap = size;
- if (gap > 0)
- MoveBar (bar, bar.DockOffset - gap, bar.DockRow, false);
- }
- }
-
- void MoveBar (DockToolbar bar, int x, int row)
- {
- MoveBar (bar, x, row, true);
- }
-
- void MoveBar (DockToolbar bar, int x, int row, bool setAnchorOffset)
- {
- int rt = GetRowTop (row);
-
- bar.DockRow = row;
- bar.DockOffset = x;
-
- if (bar.Floating) {
- FloatingDock win = bar.FloatingDock;
- win.Detach ();
- win.Destroy ();
-
- InternalAdd (bar);
- Put (bar, x, rt);
- SortBars ();
- ResetAnchorOffsets (row);
-
- } else {
- if (setAnchorOffset)
- ResetAnchorOffsets (row);
-
- InternalMove (bar, x, rt, true);
- }
- }
-
- void ResetAnchorOffsets (int row)
- {
- for (int n=0; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar) bars [n];
- if (b.DockRow < row) continue;
- if (b.DockRow > row) return;
- b.AnchorOffset = b.DockOffset;
- }
- }
-
- void UpdateRowHeight (int row)
- {
- int nr = row + 1;
- bool ea = EnableAnimation (false);
- for (int n=0; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar) bars [n];
- if (b.DockRow < nr) continue;
- MoveBar (b, b.DockOffset, b.DockRow);
- }
- EnableAnimation (ea);
- }
-
- void OnBarSizeChanged (object s, EventArgs e)
- {
- if (IsRealized)
- UpdateRowSizes (((DockToolbar)s).DockRow);
- }
-
- void UpdateRowSizes (int row)
- {
- int lastx = 0;
- for (int n=0; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar) bars [n];
- if (b.DockRow < row) continue;
- if (b.DockRow > row) break;
- if (b.AnchorOffset < lastx)
- b.AnchorOffset = lastx;
- lastx = b.AnchorOffset + b.DefaultSize;
- }
- PackBars ();
- }
-
- protected override void OnSizeAllocated (Rectangle rect)
- {
- Rectangle oldRect = Allocation;
- base.OnSizeAllocated (rect);
-
- if (!rect.Equals (oldRect))
- PackBars ();
- }
-
- void PackBars ()
- {
- bool ea = EnableAnimation (false);
- int n=0;
- while (n < bars.Count)
- n = PackRow (n);
- EnableAnimation (ea);
- }
-
- int PackRow (int sn)
- {
- // The 'sn' parameter is the index if the first toolbar of the row.
- // It returns the index of the first toolbar of the next row
-
- int n = sn;
- int row = ((DockToolbar)bars[n]).DockRow;
- int lastx = 0;
- int gaps = 0;
-
- // Calculates the free space in the row
-
- while (n < bars.Count) {
- DockToolbar bar = (DockToolbar) bars [n];
- if (bar.DockRow != row) break;
-
- if (bar.AnchorOffset > lastx)
- gaps += bar.AnchorOffset - lastx;
-
- lastx = bar.AnchorOffset + bar.DefaultSize;
- n++;
- }
-
- if (lastx <= PanelWidth) {
- for (int i=sn; i<n; i++) {
- DockToolbar b = (DockToolbar) bars[i];
- if (b.AnchorOffset != b.DockOffset)
- MoveBar (b, b.AnchorOffset, b.DockRow, false);
- if (b.Size != b.DefaultSize) {
- b.ShowArrow = false;
- b.Size = b.DefaultSize;
- }
- }
- return n;
- }
-
- int barsSize = lastx - gaps;
- double gapShrink = 0;
-
- int[] sizeReduction = new int [n - sn];
-
- if (barsSize > PanelWidth) {
- int remSize = barsSize - PanelWidth;
- while (remSize > 0) {
- int oldRemSize = remSize;
- for (int k=n-1; k >= sn; k--) {
- int pos = k - sn;
- DockToolbar bar = (DockToolbar) bars [k];
- int newReduction = GetBarReduction (bar, remSize, sizeReduction [pos]);
- sizeReduction [pos] += newReduction;
- remSize -= newReduction;
- }
- if (oldRemSize == remSize)
- break;
- }
- }
- else
- gapShrink = ((double)(PanelWidth - barsSize)) / (double)gaps;
-
- lastx = 0;
- int newlastx = 0;
- for (int i=sn; i < n; i++) {
- DockToolbar bar = (DockToolbar) bars [i];
- int gap = bar.AnchorOffset - lastx;
- lastx = bar.AnchorOffset + bar.DefaultSize;
-
- int nx = (int)(newlastx + ((double)gap * gapShrink));
- if (nx != bar.DockOffset)
- MoveBar (bar, nx, bar.DockRow, false);
-
- int nw = bar.DefaultSize - sizeReduction [i - sn];
- if (nw != bar.Size) {
- bar.ShowArrow = nw != bar.DefaultSize;
- bar.Size = nw;
- }
- newlastx = bar.DockOffset + nw;
- }
-
- return n;
- }
-
- int GetBarReduction (DockToolbar bar, int sizeToReduce, int currentReduction)
- {
- Gtk.Widget[] children = bar.Children;
- int w = bar.DefaultSize;
- int arrowSize = 0;
- bar.Forall (delegate (Gtk.Widget wa) {
- if (wa is ToggleButton) {
- arrowSize = bar.Orientation == Orientation.Horizontal ? wa.SizeRequest ().Width : wa.SizeRequest ().Height;
- }
- });
- for (int n=children.Length - 1; n >= 1; n--) {
- if (!children [n].Visible)
- continue;
- int x;
- if (bar.Orientation == Orientation.Horizontal)
- x = children [n].Allocation.X - bar.Allocation.X;
- else
- x = children [n].Allocation.Y - bar.Allocation.Y;
- int rightSize = w - x - 1;
- if (rightSize > currentReduction) {
- int prevRequest = Orientation == Orientation.Horizontal ? children [n-1].SizeRequest ().Width : children [n-1].SizeRequest ().Height;
- if (prevRequest > arrowSize*2)
- continue;
- int newReduction = rightSize - currentReduction;
- if (newReduction > sizeToReduce)
- newReduction = sizeToReduce;
-
- int minSize = Orientation == Orientation.Horizontal ? children[0].SizeRequest ().Width : children[0].SizeRequest ().Height;
- minSize += arrowSize + 6;
- if (bar.DefaultSize - (currentReduction + newReduction) < minSize)
- newReduction = (bar.DefaultSize - minSize) - currentReduction;
-
- return newReduction;
- }
- }
- return 0;
- }
-
- int GetPanelBottom ()
- {
- if (bars.Count > 0) {
- DockToolbar bar = (DockToolbar) bars [bars.Count - 1];
- return GetRowTop (bar.DockRow + 1);
- }
- else
- return 0;
- }
-
- bool IsSingleBarRow (DockToolbar bar)
- {
- int row = bar.DockRow;
- foreach (DockToolbar b in bars) {
- if (bar != b && b.DockRow == row)
- return false;
- }
- return true;
- }
-
- void InsertRow (DockToolbar ibar, int offset, int row)
- {
- MoveBar (ibar, offset, row);
- foreach (DockToolbar bar in bars) {
- if (ibar != bar && bar.DockRow >= row)
- bar.DockRow++;
- }
- SortBars ();
- UpdateRowHeight (row);
- }
-
- void RemoveRow (int row)
- {
- foreach (DockToolbar bar in bars) {
- if (bar.DockRow >= row)
- MoveBar (bar, bar.DockOffset, bar.DockRow - 1, false);
- }
- }
-
- int GetChildRightOffset (DockToolbar bar)
- {
- return bar.DockOffset + bar.Size;
- }
-
- int GetRowSize (int row)
- {
- int max = 0;
- for (int n=0; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar) bars [n];
- if (b.DockRow < row) continue;
- if (b.DockRow > row) return max;
- max = Math.Max (b.DefaultHeight, max);
- }
- return max;
- }
-
- int GetRowTop (int row)
- {
- int t = 0;
- for (int n=0; n < row; n++)
- t += GetRowSize (n);
- return t;
- }
-
- int MaxRow {
- get {
- var lastBar = (DockToolbar)bars[bars.Count -1];
- return lastBar.DockRow;
- }
- }
-
- void SortBars ()
- {
- bars.Sort (DocBarComparer.Instance);
- }
-
- void InternalMove (DockToolbar bar, int x, int y, bool animate)
- {
- if (bar.Animation != null) {
- bar.Animation.Cancel ();
- bar.Animation = null;
- }
-
- if (animate && enableAnimations) {
- bar.Animation = new MoveAnimation (this, bar, x, y);
- bar.Animation.Start ();
- }
- else
- Move (bar, x, y);
- }
-
- bool EnableAnimation (bool enable)
- {
- bool r = enableAnimations;
- enableAnimations = enable;
- return r;
- }
-
- protected override bool OnExposeEvent (EventExpose evnt)
- {
- //leave this plain unless there are horizontal children, so that the panel matches the toolbars
- //see DockToolbar.OnExposeEvent
- if (bars.Count == 0 || this.Orientation != Orientation.Horizontal)
- return base.OnExposeEvent (evnt);
-
- // get a proper GTK+ toolbar style by using one of the children, i.e. a DockToolbar, a subclass of GtkToolbar
- var styleProvider = (Widget)bars[0];
- var shadowType = (ShadowType) styleProvider.StyleGetProperty ("shadow-type");
-
- //render each row separately, so the theme treats each as a row, and they match the individual toolbars' themed painting
- int row = MaxRow;
- for (int i = bars.Count - 1; i >= 0; i--) {
- var bar = (DockToolbar) bars[i];
- if (bar.DockRow == row) {
- row--;
- //HACK: On Mac, PaintBox seems to fill the whole area instead of using it for clipping
- //so we create a new area for the row, to stop it overpainting other rows
- //otoh this could improve performance when only single rows are repainted, because we can intersect with invalidated area
- var rowArea = new Rectangle (Allocation.X, bar.Allocation.Y, Allocation.Width, bar.Allocation.Height);
- var invalidated = Gdk.Rectangle.Intersect (evnt.Area, rowArea);
- Style.PaintBox (bar.Style, evnt.Window, State, shadowType, invalidated, bar, "toolbar",
- rowArea.X, rowArea.Y, rowArea.Width, rowArea.Height);
- }
- }
-
- foreach (DockToolbar bar in bars)
- this.PropagateExpose (bar, evnt);
- return true;
- }
-
- //ensures that all widgets in each row have consistent allocation
- public override Requisition GetChildRequisition (Widget w)
- {
- var r = w.ChildRequisition;
- var t = (DockToolbar) w;
- var size = GetRowSize (t.DockRow);
- if (orientation == Orientation.Horizontal) {
- r.Height = size;
- } else {
- r.Width = size;
- }
- return r;
- }
- }
-
-
- internal class DocBarComparer: IComparer
- {
- internal static DocBarComparer Instance = new DocBarComparer ();
-
- public int Compare (object a, object b)
- {
- DockToolbar b1 = (DockToolbar) a;
- DockToolbar b2 = (DockToolbar) b;
-
- if (b1.DockRow < b2.DockRow) return -1;
- else if (b1.DockRow > b2.DockRow) return 1;
- else if (b1.DockOffset < b2.DockOffset) return -1;
- else if (b1.DockOffset > b2.DockOffset) return 1;
- else return 0;
- }
- }
-
- internal abstract class AnimationManager
- {
- static ArrayList anims = new ArrayList ();
- static int s = 0;
-
- public static void Animate (Animation a)
- {
- if (anims.Count == 0)
- GLib.Timeout.Add (10, new GLib.TimeoutHandler (Animate));
- anims.Add (a);
- }
-
- public static void CancelAnimation (Animation a)
- {
- anims.Remove (a);
- }
-
- public static bool Animate ()
- {
- s++;
- ArrayList toDelete = new ArrayList ();
- foreach (Animation a in anims)
- if (!a.Run ())
- toDelete.Add (a);
-
- foreach (object ob in toDelete)
- anims.Remove (ob);
-
- return anims.Count != 0;
- }
- }
-
- internal abstract class Animation
- {
- protected Widget widget;
-
- public Animation (Widget w)
- {
- widget = w;
- }
-
- public void Start ()
- {
- AnimationManager.Animate (this);
- }
-
- public void Cancel ()
- {
- AnimationManager.CancelAnimation (this);
- }
-
- internal protected abstract bool Run ();
- }
-
- internal class MoveAnimation: Animation
- {
- FixedPanel panel;
- float destx, desty;
- float curx, cury;
-
- public MoveAnimation (FixedPanel f, Widget w, int destx, int desty): base (w)
- {
- panel = f;
- int x, y;
- f.GetPosition (w, out x, out y);
- curx = (float)x;
- cury = (float)y;
- this.destx = (float) destx;
- this.desty = (float) desty;
- }
-
- internal protected override bool Run ()
- {
- float dx = destx - curx;
- float dy = desty - cury;
-
- dx = dx / 4;
- dy = dy / 4;
-
- curx += dx;
- cury += dy;
-
- panel.Move (widget, (int)curx, (int)cury);
-
- if(Math.Abs (dx) < 0.1 && Math.Abs (dy) < 0.1) {
- panel.Move (widget, (int)destx, (int)desty);
- return false;
- } else
- return true;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPosition.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPosition.cs
deleted file mode 100644
index dbf9121040..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPosition.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// DockToolbarPosition.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using Gtk;
-using Gdk;
-using System.Collections;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- [XmlInclude (typeof(DockedPosition))]
- [XmlInclude (typeof(FloatingPosition))]
- public class DockToolbarPosition
- {
- internal virtual void RestorePosition (DockToolbarFrame frame, DockToolbar bar) {}
-
- internal static DockToolbarPosition Create (DockToolbar bar)
- {
- if (bar.Floating)
- return new FloatingPosition (bar);
- else
- return new DockedPosition (bar);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarStatus.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarStatus.cs
deleted file mode 100644
index 6db8ebd857..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarStatus.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// DockToolbarStatus.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- [XmlType ("dockBar")]
- public class DockToolbarStatus
- {
- bool visible;
- DockToolbarPosition position;
- string id;
-
- public DockToolbarStatus ()
- {
- }
-
- public DockToolbarStatus (string id, bool visible, DockToolbarPosition position)
- {
- this.visible = visible;
- this.position = position;
- this.id = id;
- }
-
- [XmlAttribute ("id")]
- public string BarId {
- get { return id; }
- set { id = value; }
- }
-
- [XmlElement ("visible")]
- public bool Visible {
- get { return visible; }
- set { visible = value; }
- }
-
- [XmlElement ("dockedPosition", typeof(DockedPosition))]
- [XmlElement ("floatingPosition", typeof(FloatingPosition))]
- public DockToolbarPosition Position {
- get { return position; }
- set { position = value; }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockedPosition.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockedPosition.cs
deleted file mode 100644
index a3b3132c22..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockedPosition.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// DockedPosition.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- [XmlType ("dockedPosition")]
- public class DockedPosition: DockToolbarPosition
- {
- Placement placement;
- int dockOffset;
- int dockRow;
-
- public DockedPosition ()
- {
- }
-
- internal DockedPosition (DockToolbar bar)
- {
- dockOffset = bar.AnchorOffset;
- dockRow = bar.DockRow;
- placement = ((DockToolbarPanel)bar.Parent).Placement;
- }
-
- internal DockedPosition (Placement placement)
- {
- this.placement = placement;
- dockRow = -1;
- }
-
- [XmlAttribute ("offset")]
- public int DockOffset {
- get { return dockOffset; }
- set { dockOffset = value; }
- }
-
- [XmlAttribute ("row")]
- public int DockRow {
- get { return dockRow; }
- set { dockRow = value; }
- }
-
- [XmlAttribute ("placement")]
- public Placement Placement {
- get { return placement; }
- set { placement = value; }
- }
-
- internal override void RestorePosition (DockToolbarFrame frame, DockToolbar bar)
- {
- frame.DockToolbar (bar, placement, dockOffset, dockRow);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FixedPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FixedPanel.cs
deleted file mode 100644
index 90ca29dfe6..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FixedPanel.cs
+++ /dev/null
@@ -1,270 +0,0 @@
-//
-// FixedPanel.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using System.Collections;
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public enum Placement
- {
- Top, Bottom, Left, Right
- }
-
- public class FixedPanel: Container
- {
- ArrayList widgets = new ArrayList ();
- Placement placement = Placement.Top;
-
- public FixedPanel ()
- {
- GtkWorkarounds.FixContainerLeak (this);
-
- WidgetFlags |= WidgetFlags.NoWindow;
- }
-
- public Placement Placement {
- get { return placement; }
- set { placement = value; }
- }
-
- public override GLib.GType ChildType ()
- {
- return Widget.GType;
- }
-
- public void Put (Widget w, int x, int y)
- {
- WidgetPosition wpos = new WidgetPosition ();
- wpos.X = x;
- wpos.Y = y;
- wpos.Widget = w;
- widgets.Add (wpos);
- w.Parent = this;
- QueueResize ();
- }
-
- public void Move (Widget w, int x, int y)
- {
- int n = GetWidgetPosition (w);
- if (n != -1) {
- WidgetPosition wpos = (WidgetPosition) widgets [n];
- if (wpos.X == x && wpos.Y == y) return;
- wpos.X = x;
- wpos.Y = y;
- QueueResize ();
- }
- }
-
- public bool GetPosition (Widget w, out int x, out int y)
- {
- int n = GetWidgetPosition (w);
- if (n != -1) {
- WidgetPosition wpos = (WidgetPosition) widgets [n];
- x = wpos.X;
- y = wpos.Y;
- return true;
- }
- x = y = 0;
- return false;
- }
-
- public virtual Requisition GetChildRequisition (Widget w)
- {
- return w.ChildRequisition;
- }
-
- public int GetChildWidth (Widget w)
- {
- // ResizeChildren ();
- if (placement == Placement.Top || placement == Placement.Bottom)
- return w.Allocation.Width;
- else
- return w.Allocation.Height;
- }
-
- public int GetChildHeight (Widget w)
- {
- if (placement == Placement.Top || placement == Placement.Bottom)
- return w.Allocation.Height;
- else
- return w.Allocation.Width;
- }
-
- public int PanelWidth {
- get {
- if (placement == Placement.Top || placement == Placement.Bottom)
- return Allocation.Width;
- else
- return Allocation.Height;
- }
- }
-
- public void WindowToPanel (int x, int y, int w, int h, out int rx, out int ry)
- {
- switch (placement) {
- case Placement.Top:
- rx = x - Allocation.X;
- ry = y - Allocation.Y;
- break;
- case Placement.Bottom:
- rx = x - Allocation.X;
- ry = Allocation.Bottom - y - h - 1;
- break;
- case Placement.Left:
- rx = y - Allocation.Y;
- ry = x - Allocation.X;
- break;
- default:
- rx = y - Allocation.Y;
- ry = Allocation.Right - x - w - 1;
- break;
- }
- }
-
- public void PanelToWindow (int x, int y, int w, int h, out int rx, out int ry, out int rw, out int rh)
- {
- switch (placement) {
- case Placement.Top:
- rx = x + Allocation.X;
- ry = y + Allocation.Y;
- rw = w;
- rh = h;
- break;
- case Placement.Bottom:
- rx = x + Allocation.X;
- ry = Allocation.Bottom - y - h - 1;
- rw = w;
- rh = h;
- break;
- case Placement.Left:
- rx = y + Allocation.X;
- ry = x + Allocation.Y;
- rw = h;
- rh = w;
- break;
- default:
- rx = Allocation.Right - y - h - 1;
- ry = x + Allocation.Y;
- rw = h;
- rh = w;
- break;
- }
- }
-
- protected override void OnAdded (Widget w)
- {
- Put (w, 0, 0);
- }
-
- protected override void OnRemoved (Widget w)
- {
- int i = GetWidgetPosition (w);
- if (i != -1) {
- widgets.RemoveAt (i);
- w.Unparent ();
- QueueResize ();
- }
- }
-
- int GetWidgetPosition (Widget w)
- {
- for (int n=0; n<widgets.Count; n++)
- if (((WidgetPosition)widgets[n]).Widget == w)
- return n;
- return -1;
- }
-
- protected override void OnSizeRequested (ref Requisition req)
- {
- req.Width = req.Height = 0;
- foreach (WidgetPosition pos in widgets) {
- Requisition wreq = pos.Widget.SizeRequest ();
- if (placement == Placement.Top || placement == Placement.Bottom) {
- if (pos.X + wreq.Width > req.Width)
- req.Width = pos.X + wreq.Width;
- if (pos.Y + wreq.Height > req.Height)
- req.Height = pos.Y + wreq.Height;
- } else {
- if (pos.Y + wreq.Width > req.Width)
- req.Width = pos.Y + wreq.Width;
- if (pos.X + wreq.Height > req.Height)
- req.Height = pos.X + wreq.Height;
- }
- }
- if (placement == Placement.Top || placement == Placement.Bottom)
- req.Width = 0;
- else
- req.Height = 0;
- }
-
- protected override void OnSizeAllocated (Gdk.Rectangle rect)
- {
- base.OnSizeAllocated (rect);
- foreach (WidgetPosition pos in widgets) {
- Requisition req = GetChildRequisition (pos.Widget);
- Rectangle crect = new Rectangle (pos.X, pos.Y, req.Width, req.Height);
- switch (placement) {
- case Placement.Top:
- break;
- case Placement.Bottom:
- crect.Y = Allocation.Height - crect.Y - crect.Height;
- break;
- case Placement.Left: {
- int t = crect.X; crect.X=crect.Y; crect.Y=t;
- break;
- }
- case Placement.Right: {
- int t = crect.X; crect.X=crect.Y; crect.Y=t;
- crect.X = Allocation.Width - crect.X - crect.Width;
- break;
- }
- }
- crect.X += Allocation.X;
- crect.Y += Allocation.Y;
- pos.Widget.SizeAllocate (crect);
- }
- }
-
- protected override void ForAll (bool include_internals, Gtk.Callback callback)
- {
- WidgetPosition[] positions = (WidgetPosition[]) widgets.ToArray (typeof (WidgetPosition));
- foreach (WidgetPosition pos in positions)
- callback (pos.Widget);
- }
- }
-
- class WidgetPosition
- {
- public int X;
- public int Y;
- public Widget Widget;
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingDock.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingDock.cs
deleted file mode 100644
index 2cf64c9985..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingDock.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// FloatingDock.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- internal class FloatingDock: Gtk.Window
- {
- DockToolbar bar;
-
- public FloatingDock (DockToolbarFrame frame): base (Gtk.WindowType.Toplevel)
- {
- SkipTaskbarHint = true;
- Decorated = false;
- TransientFor = frame.TopWindow;
- }
-
- public void Attach (DockToolbar bar)
- {
- this.bar = bar;
- bar.FloatingDock = this;
- Frame f = new Frame ();
- f.Shadow = ShadowType.Out;
- f.Add (bar);
- Add (f);
- f.Show ();
- bar.Show ();
- Show ();
- }
-
- public void Detach ()
- {
- bar.FloatingDock = null;
- ((Frame)bar.Parent).Remove (bar);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingPosition.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingPosition.cs
deleted file mode 100644
index 56261d72e8..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingPosition.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// FloatingPosition.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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;
-using Gtk;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- [XmlType ("floatingPosition")]
- public class FloatingPosition: DockToolbarPosition
- {
- Orientation orientation;
- int x;
- int y;
-
- public FloatingPosition ()
- {
- }
-
- internal FloatingPosition (DockToolbar bar)
- {
- orientation = bar.Orientation;
- bar.FloatingDock.GetPosition (out x, out y);
- }
-
- [XmlAttribute ("x")]
- public int X {
- get { return x; }
- set { x = value; }
- }
-
- [XmlAttribute ("y")]
- public int Y {
- get { return y; }
- set { y = value; }
- }
-
- [XmlAttribute ("orientation")]
- public Orientation Orientation {
- get { return orientation; }
- set { orientation = value; }
- }
-
- internal override void RestorePosition (DockToolbarFrame frame, DockToolbar bar)
- {
- frame.FloatBar (bar, orientation, x, y);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/IDockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/IDockBar.cs
deleted file mode 100644
index 121347720d..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/IDockBar.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IDockToolbar.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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.
-//
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public interface IDockToolbar
- {
- string Id { get; }
- string Title { get; }
- bool Visible { get; set; }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/PlaceholderWindow.cs
deleted file mode 100644
index 9ed4fd72de..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/PlaceholderWindow.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// PlaceholderWindow.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 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.
-//
-
-
-namespace MonoDevelop.Components.DockToolbars
-{
- internal class PlaceholderWindow: Gtk.Window
- {
- Gdk.GC redgc;
-
- public PlaceholderWindow (DockToolbarFrame frame): base (Gtk.WindowType.Toplevel)
- {
- SkipTaskbarHint = true;
- Decorated = false;
- TransientFor = frame.TopWindow;
- Realize ();
- redgc = new Gdk.GC (GdkWindow);
- redgc.RgbFgColor = new Gdk.Color (255, 0, 0);
- }
-
- protected override bool OnExposeEvent (Gdk.EventExpose args)
- {
- base.OnExposeEvent (args);
- int w, h;
- this.GetSize (out w, out h);
- this.GdkWindow.DrawRectangle (redgc, false, 0, 0, w-1, h-1);
- return true;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs
index 2466ff5e6b..c8d8f825ad 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs
@@ -35,7 +35,7 @@ using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Components.Docking
{
- public class DockBar: Gtk.EventBox
+ class DockBar: Gtk.EventBox
{
Gtk.PositionType position;
Box box;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs
index e6fc373342..a8023eb287 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs
@@ -40,7 +40,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.Components.Docking
{
- public class DockFrame: HBox, IAnimatable
+ class DockFrame: HBox, IAnimatable
{
internal const double ItemDockCenterArea = 0.4;
internal const int GroupDockSeparatorSize = 40;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroupItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroupItem.cs
index bd754980fb..00108eb7d8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroupItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroupItem.cs
@@ -260,7 +260,7 @@ namespace MonoDevelop.Components.Docking
if (floatRect.Equals (Gdk.Rectangle.Zero)) {
int x, y;
item.Widget.TranslateCoordinates (item.Widget.Toplevel, 0, 0, out x, out y);
- Gtk.Window win = Frame.Toplevel as Window;
+ Gtk.Window win = Frame.Toplevel as Gtk.Window;
if (win != null) {
int wx, wy;
win.GetPosition (out wx, out wy);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
index 25ab57cef6..d62e622aad 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
@@ -30,14 +30,14 @@
using System;
using System.Xml;
-using Gtk;
using Mono.Unix;
namespace MonoDevelop.Components.Docking
{
public class DockItem
{
- Widget content;
+ Control content;
+ Gtk.Widget gtkContent;
DockItemContainer widget;
string defaultLocation;
bool defaultVisible = true;
@@ -79,11 +79,6 @@ namespace MonoDevelop.Components.Docking
currentVisualStyle = regionStyle = frame.GetRegionStyleForItem (this);
}
- internal DockItem (DockFrame frame, Widget w, string id): this (frame, id)
- {
- content = w;
- }
-
public string Id {
get { return id; }
}
@@ -204,35 +199,36 @@ namespace MonoDevelop.Components.Docking
UpdateContentVisibleStatus ();
}
- public Widget Content {
+ public Control Content {
get {
return content;
}
set {
content = value;
+ gtkContent = content.GetNativeWidget<Gtk.Widget> ();
if (!gettingContent && widget != null)
widget.UpdateContent ();
}
}
- public DockItemToolbar GetToolbar (PositionType position)
+ public DockItemToolbar GetToolbar (DockPositionType position)
{
switch (position) {
- case PositionType.Top:
- if (toolbarTop == null)
- toolbarTop = new DockItemToolbar (this, PositionType.Top);
+ case DockPositionType.Top:
+ if (toolbarTop == null)
+ toolbarTop = new DockItemToolbar (this, DockPositionType.Top);
return toolbarTop;
- case PositionType.Bottom:
+ case DockPositionType.Bottom:
if (toolbarBottom == null)
- toolbarBottom = new DockItemToolbar (this, PositionType.Bottom);
+ toolbarBottom = new DockItemToolbar (this, DockPositionType.Bottom);
return toolbarBottom;
- case PositionType.Left:
+ case DockPositionType.Left:
if (toolbarLeft == null)
- toolbarLeft = new DockItemToolbar (this, PositionType.Left);
+ toolbarLeft = new DockItemToolbar (this, DockPositionType.Left);
return toolbarLeft;
- case PositionType.Right:
+ case DockPositionType.Right:
if (toolbarRight == null)
- toolbarRight = new DockItemToolbar (this, PositionType.Right);
+ toolbarRight = new DockItemToolbar (this, DockPositionType.Right);
return toolbarRight;
default: throw new ArgumentException ();
}
@@ -344,20 +340,20 @@ namespace MonoDevelop.Components.Docking
internal void SetFocus ()
{
- SetFocus (Content);
+ SetFocus (gtkContent);
}
- internal static void SetFocus (Widget w)
+ internal static void SetFocus (Gtk.Widget w)
{
- w.ChildFocus (DirectionType.Down);
+ w.ChildFocus (Gtk.DirectionType.Down);
- Window win = w.Toplevel as Gtk.Window;
+ Gtk.Window win = w.Toplevel as Gtk.Window;
if (win == null)
return;
// Make sure focus is not given to internal children
if (win.Focus != null) {
- Container c = win.Focus.Parent as Container;
+ Gtk.Container c = win.Focus.Parent as Gtk.Container;
if (c.Children.Length == 0)
win.Focus = c;
}
@@ -409,15 +405,15 @@ namespace MonoDevelop.Components.Docking
ResetMode ();
SetRegionStyle (frame.GetRegionStyleForItem (this));
- floatingWindow = new DockFloatingWindow ((Window)frame.Toplevel, GetWindowTitle ());
+ floatingWindow = new DockFloatingWindow ((Gtk.Window)frame.Toplevel, GetWindowTitle ());
Ide.IdeApp.CommandService.RegisterTopWindow (floatingWindow);
- VBox box = new VBox ();
+ Gtk.VBox box = new Gtk.VBox ();
box.Show ();
box.PackStart (TitleTab, false, false, 0);
box.PackStart (Widget, true, true, 0);
floatingWindow.Add (box);
- floatingWindow.DeleteEvent += delegate (object o, DeleteEventArgs a) {
+ floatingWindow.DeleteEvent += delegate (object o, Gtk.DeleteEventArgs a) {
if (behavior == DockItemBehavior.CantClose)
Status = DockItemStatus.Dockable;
else
@@ -534,34 +530,34 @@ namespace MonoDevelop.Components.Docking
internal void ShowDockPopupMenu (uint time)
{
- Menu menu = new Menu ();
+ Gtk.Menu menu = new Gtk.Menu ();
// Hide menuitem
if ((Behavior & DockItemBehavior.CantClose) == 0) {
- MenuItem mitem = new MenuItem (Catalog.GetString("Hide"));
+ Gtk.MenuItem mitem = new Gtk.MenuItem (Catalog.GetString("Hide"));
mitem.Activated += delegate { Visible = false; };
menu.Append (mitem);
}
- MenuItem citem;
+ Gtk.MenuItem citem;
// Auto Hide menuitem
if ((Behavior & DockItemBehavior.CantAutoHide) == 0 && Status != DockItemStatus.AutoHide) {
- citem = new MenuItem (Catalog.GetString("Minimize"));
+ citem = new Gtk.MenuItem (Catalog.GetString("Minimize"));
citem.Activated += delegate { Status = DockItemStatus.AutoHide; };
menu.Append (citem);
}
if (Status != DockItemStatus.Dockable) {
// Dockable menuitem
- citem = new MenuItem (Catalog.GetString("Dock"));
+ citem = new Gtk.MenuItem (Catalog.GetString("Dock"));
citem.Activated += delegate { Status = DockItemStatus.Dockable; };
menu.Append (citem);
}
// Floating menuitem
if ((Behavior & DockItemBehavior.NeverFloating) == 0 && Status != DockItemStatus.Floating) {
- citem = new MenuItem (Catalog.GetString("Undock"));
+ citem = new Gtk.MenuItem (Catalog.GetString("Undock"));
citem.Activated += delegate { Status = DockItemStatus.Floating; };
menu.Append (citem);
}
@@ -588,13 +584,13 @@ namespace MonoDevelop.Components.Docking
// See BXC9883 - Xamarin Studio hides when there is a nonmodal floating window and it loses focus
// https://bugzilla.xamarin.com/show_bug.cgi?id=9883
//
- class DockFloatingWindow : Window
+ class DockFloatingWindow : Gtk.Window
{
- public DockFloatingWindow (Window dockParent, string title) : base (title)
+ public DockFloatingWindow (Gtk.Window dockParent, string title) : base (title)
{
this.DockParent = dockParent;
}
- public Window DockParent { get; private set; }
+ public Gtk.Window DockParent { get; private set; }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs
index d6a332b165..2da0fa2a6f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs
@@ -53,21 +53,21 @@ namespace MonoDevelop.Components.Docking
ShowAll ();
- mainBox.PackStart (item.GetToolbar (PositionType.Top).Container, false, false, 0);
+ mainBox.PackStart (item.GetToolbar (DockPositionType.Top).Container, false, false, 0);
HBox hbox = new HBox ();
hbox.Show ();
- hbox.PackStart (item.GetToolbar (PositionType.Left).Container, false, false, 0);
+ hbox.PackStart (item.GetToolbar (DockPositionType.Left).Container, false, false, 0);
contentBox = new HBox ();
contentBox.Show ();
hbox.PackStart (contentBox, true, true, 0);
- hbox.PackStart (item.GetToolbar (PositionType.Right).Container, false, false, 0);
+ hbox.PackStart (item.GetToolbar (DockPositionType.Right).Container, false, false, 0);
mainBox.PackStart (hbox, true, true, 0);
- mainBox.PackStart (item.GetToolbar (PositionType.Bottom).Container, false, false, 0);
+ mainBox.PackStart (item.GetToolbar (DockPositionType.Bottom).Container, false, false, 0);
}
DockVisualStyle visualStyle;
@@ -119,10 +119,10 @@ namespace MonoDevelop.Components.Docking
if (widget != null)
SetTreeStyle (widget);
- item.GetToolbar (PositionType.Top).SetStyle (VisualStyle);
- item.GetToolbar (PositionType.Left).SetStyle (VisualStyle);
- item.GetToolbar (PositionType.Right).SetStyle (VisualStyle);
- item.GetToolbar (PositionType.Bottom).SetStyle (VisualStyle);
+ item.GetToolbar (DockPositionType.Top).SetStyle (VisualStyle);
+ item.GetToolbar (DockPositionType.Left).SetStyle (VisualStyle);
+ item.GetToolbar (DockPositionType.Right).SetStyle (VisualStyle);
+ item.GetToolbar (DockPositionType.Bottom).SetStyle (VisualStyle);
}
}
@@ -147,8 +147,8 @@ namespace MonoDevelop.Components.Docking
{
var w = (Gtk.TreeView)sender;
if (VisualStyle.TreeBackgroundColor != null) {
- w.ModifyBase (StateType.Normal, VisualStyle.TreeBackgroundColor.Value);
- w.ModifyBase (StateType.Insensitive, VisualStyle.TreeBackgroundColor.Value);
+ w.ModifyBase (StateType.Normal, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ());
+ w.ModifyBase (StateType.Insensitive, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ());
} else {
w.ModifyBase (StateType.Normal, Parent.Style.Base (StateType.Normal));
w.ModifyBase (StateType.Insensitive, Parent.Style.Base (StateType.Insensitive));
@@ -159,7 +159,7 @@ namespace MonoDevelop.Components.Docking
{
if (VisualStyle.TabStyle == DockTabStyle.Normal) {
Gdk.GC gc = new Gdk.GC (GdkWindow);
- gc.RgbFgColor = VisualStyle.PadBackgroundColor.Value;
+ gc.RgbFgColor = VisualStyle.PadBackgroundColor.Value.ToGdkColor ();
evnt.Window.DrawRectangle (gc, true, Allocation);
gc.Dispose ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
index 6cf310c218..61bf7e6e9a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
@@ -127,7 +127,7 @@ namespace MonoDevelop.Components.Docking
tabIcon.Visible = visualStyle.ShowPadTitleIcon.Value;
if (IsRealized) {
if (labelWidget != null)
- labelWidget.ModifyFg (StateType.Normal, visualStyle.PadTitleLabelColor.Value);
+ labelWidget.ModifyFg (StateType.Normal, visualStyle.PadTitleLabelColor.Value.ToGdkColor ());
}
var r = WidthRequest;
WidthRequest = -1;
@@ -419,7 +419,7 @@ namespace MonoDevelop.Components.Docking
var alloc = Allocation;
Gdk.GC bgc = new Gdk.GC (GdkWindow);
- var c = VisualStyle.PadBackgroundColor.Value.ToXwtColor ();
+ var c = VisualStyle.PadBackgroundColor.Value;
c.Light *= 0.7;
bgc.RgbFgColor = c.ToGdkColor ();
bool first = true;
@@ -435,7 +435,7 @@ namespace MonoDevelop.Components.Docking
if (Active || (first && last)) {
Gdk.GC gc = new Gdk.GC (GdkWindow);
- gc.RgbFgColor = VisualStyle.PadBackgroundColor.Value;
+ gc.RgbFgColor = VisualStyle.PadBackgroundColor.Value.ToGdkColor ();
evnt.Window.DrawRectangle (gc, true, alloc);
if (!first)
evnt.Window.DrawLine (bgc, alloc.X, alloc.Y, alloc.X, alloc.Y + alloc.Height - 1);
@@ -445,7 +445,7 @@ namespace MonoDevelop.Components.Docking
} else {
Gdk.GC gc = new Gdk.GC (GdkWindow);
- gc.RgbFgColor = tabStrip != null ? tabStrip.VisualStyle.InactivePadBackgroundColor.Value : frame.DefaultVisualStyle.InactivePadBackgroundColor.Value;
+ gc.RgbFgColor = tabStrip != null ? tabStrip.VisualStyle.InactivePadBackgroundColor.Value.ToGdkColor () : frame.DefaultVisualStyle.InactivePadBackgroundColor.Value.ToGdkColor ();
evnt.Window.DrawRectangle (gc, true, alloc);
gc.Dispose ();
evnt.Window.DrawLine (bgc, alloc.X, alloc.Y + alloc.Height - 1, alloc.X + alloc.Width - 1, alloc.Y + alloc.Height - 1);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemToolbar.cs
index aa6c502e4f..c3a32abc44 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemToolbar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemToolbar.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
+using System.Linq;
using Gtk;
namespace MonoDevelop.Components.Docking
@@ -34,11 +35,11 @@ namespace MonoDevelop.Components.Docking
DockItem parentItem;
Gtk.Widget frame;
Box box;
- PositionType position;
+ DockPositionType position;
bool empty = true;
CustomFrame topFrame;
- internal DockItemToolbar (DockItem parentItem, PositionType position)
+ internal DockItemToolbar (DockItem parentItem, DockPositionType position)
{
this.parentItem = parentItem;
@@ -65,7 +66,7 @@ namespace MonoDevelop.Components.Docking
}*/
this.position = position;
- if (position == PositionType.Top || position == PositionType.Bottom)
+ if (position == DockPositionType.Top || position == DockPositionType.Bottom)
box = new HBox (false, 3);
else
box = new VBox (false, 3);
@@ -79,7 +80,7 @@ namespace MonoDevelop.Components.Docking
internal void SetStyle (DockVisualStyle style)
{
- topFrame.BackgroundColor = style.PadBackgroundColor.Value;
+ topFrame.BackgroundColor = style.PadBackgroundColor.Value.ToGdkColor ();
}
public DockItem DockItem {
@@ -90,29 +91,30 @@ namespace MonoDevelop.Components.Docking
get { return frame; }
}
- public PositionType Position {
+ public DockPositionType Position {
get { return this.position; }
}
- public void Add (Widget widget)
+ public void Add (Control widget)
{
Add (widget, false);
}
- public void Add (Widget widget, bool fill)
+ public void Add (Control widget, bool fill)
{
Add (widget, fill, -1);
}
- public void Add (Widget widget, bool fill, int padding)
+ public void Add (Control widget, bool fill, int padding)
{
Add (widget, fill, padding, -1);
}
- void Add (Widget widget, bool fill, int padding, int index)
+ void Add (Control control, bool fill, int padding, int index)
{
int defaultPadding = 3;
-
+
+ Widget widget = control;
if (widget is Button) {
((Button)widget).Relief = ReliefStyle.None;
((Button)widget).FocusOnClick = false;
@@ -141,12 +143,12 @@ namespace MonoDevelop.Components.Docking
}
}
- public void Insert (Widget w, int index)
+ public void Insert (Control w, int index)
{
Add (w, false, 0, index);
}
- public void Remove (Widget widget)
+ public void Remove (Control widget)
{
box.Remove (widget);
}
@@ -170,24 +172,78 @@ namespace MonoDevelop.Components.Docking
frame.ShowAll ();
}
- public Widget[] Children {
- get { return box.Children; }
+ public Control[] Children {
+ get { return box.Children.Select (child => (Control)child).ToArray (); }
}
}
- public class DockToolButton: Gtk.Button
+ public class DockToolButton : Control
{
- public DockToolButton (string stockId)
+ public DockToolButtonImage Image {
+ get { return (Gtk.Image)button.Image; }
+ set { button.Image = value; }
+ }
+
+ public string TooltipText {
+ get { return button.TooltipText; }
+ set { button.TooltipText = value; }
+ }
+
+ public string Label {
+ get { return button.Label; }
+ set { button.Label = value; }
+ }
+
+ Gtk.Button button;
+
+ public DockToolButton (string stockId) : this (stockId, null)
{
- Image = new Gtk.Image (stockId, IconSize.Menu);
- Image.Show ();
}
public DockToolButton (string stockId, string label)
{
+ button = new Button ();
Label = label;
Image = new Gtk.Image (stockId, IconSize.Menu);
- Image.Show ();
+ button.Image.Show ();
+ }
+
+ protected override object CreateNativeWidget ()
+ {
+ return button;
+ }
+
+ public event EventHandler Clicked {
+ add {
+ button.Clicked += value;
+ }
+ remove {
+ button.Clicked -= value;
+ }
+ }
+
+ public class DockToolButtonImage : Control
+ {
+ Gtk.Image image;
+ internal DockToolButtonImage (Gtk.Image image)
+ {
+ this.image = image;
+ }
+
+ protected override object CreateNativeWidget ()
+ {
+ return image;
+ }
+
+ public static implicit operator Gtk.Widget (DockToolButtonImage d)
+ {
+ return d.GetNativeWidget<Gtk.Widget> ();
+ }
+
+ public static implicit operator DockToolButtonImage (Gtk.Image d)
+ {
+ return new DockToolButtonImage (d);
+ }
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IAttachableViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockPositionType.cs
index 2d24756c3b..0191134cec 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IAttachableViewContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockPositionType.cs
@@ -1,21 +1,21 @@
-//
-// IAttachableViewContent.cs
-//
+//
+// DockPositionType.cs
+//
// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.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
@@ -26,15 +26,14 @@
using System;
-namespace MonoDevelop.Ide.Gui
+namespace MonoDevelop.Components.Docking
{
- public interface IAttachableViewContent : IBaseViewContent
+ public enum DockPositionType
{
- void Selected ();
- void Deselected ();
-
- void BeforeSave();
-
- void BaseContentChanged ();
+ Left,
+ Right,
+ Top,
+ Bottom
}
}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs
index 195aea35ad..79bece8eb1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs
@@ -29,14 +29,14 @@ namespace MonoDevelop.Components.Docking
{
public sealed class DockVisualStyle
{
- public Gdk.Color? PadBackgroundColor { get; set; }
- public Gdk.Color? PadTitleLabelColor { get; set; }
+ public Xwt.Drawing.Color? PadBackgroundColor { get; set; }
+ public Xwt.Drawing.Color? PadTitleLabelColor { get; set; }
public DockTabStyle? TabStyle { get; set; }
- public Gdk.Color? TreeBackgroundColor { get; set; }
+ public Xwt.Drawing.Color? TreeBackgroundColor { get; set; }
public bool? ShowPadTitleIcon { get; set; }
public bool? UppercaseTitles { get; set; }
public bool? ExpandedTabs { get; set; }
- public Gdk.Color? InactivePadBackgroundColor { get; set; }
+ public Xwt.Drawing.Color? InactivePadBackgroundColor { get; set; }
public int? PadTitleHeight { get; set; }
// When set, pads in a region with this style can't be stacked horizontally
@@ -83,14 +83,14 @@ namespace MonoDevelop.Components.Docking
public static DockVisualStyle CreateDefaultStyle ()
{
DockVisualStyle s = new DockVisualStyle ();
- s.PadBackgroundColor = new Gdk.Color (0,0,0);
- s.PadTitleLabelColor = new Gdk.Color (0,0,0);
+ s.PadBackgroundColor = new Xwt.Drawing.Color (0,0,0);
+ s.PadTitleLabelColor = new Xwt.Drawing.Color (0,0,0);
s.TabStyle = DockTabStyle.Normal;
s.TreeBackgroundColor = null;
s.ShowPadTitleIcon = true;
s.UppercaseTitles = false;
s.ExpandedTabs = false;
- s.InactivePadBackgroundColor = new Gdk.Color (0,0,0);
+ s.InactivePadBackgroundColor = new Xwt.Drawing.Color (0,0,0);
s.PadTitleHeight = -1;
s.SingleRowMode = false;
s.SingleColumnMode = false;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs
index ab5b7f8dfd..3609358c4d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs
@@ -275,12 +275,12 @@ namespace MonoDevelop.Components.Docking
if (TabStrip.VisualStyle.TabStyle == DockTabStyle.Normal) {
var alloc = Allocation;
Gdk.GC gc = new Gdk.GC (GdkWindow);
- gc.RgbFgColor = TabStrip.VisualStyle.InactivePadBackgroundColor.Value;
+ gc.RgbFgColor = TabStrip.VisualStyle.InactivePadBackgroundColor.Value.ToGdkColor ();
evnt.Window.DrawRectangle (gc, true, alloc);
gc.Dispose ();
Gdk.GC bgc = new Gdk.GC (GdkWindow);
- var c = TabStrip.VisualStyle.PadBackgroundColor.Value.ToXwtColor ();
+ var c = TabStrip.VisualStyle.PadBackgroundColor.Value;
c.Light *= 0.7;
bgc.RgbFgColor = c.ToGdkColor ();
evnt.Window.DrawLine (bgc, alloc.X, alloc.Y + alloc.Height - 1, alloc.X + alloc.Width - 1, alloc.Y + alloc.Height - 1);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/PlatformDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/PlatformDialog.cs
index a1a9b55c2b..4b3c1fd7b4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/PlatformDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/PlatformDialog.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.Components.Extensions
public class PlatformDialogData
{
public string Title { get; set; }
- public Gtk.Window TransientFor { get; set; }
+ public Window TransientFor { get; set; }
}
public interface IDialogHandler<T> where T: PlatformDialogData
@@ -84,7 +84,7 @@ namespace MonoDevelop.Components.Extensions
/// <summary>
/// Parent window.
/// </summary>
- public Gtk.Window TransientFor {
+ public Window TransientFor {
get { return data.TransientFor; }
set { data.TransientFor = value; }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs
index 043010872f..f9fe9d90b9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs
@@ -65,9 +65,9 @@ namespace MonoDevelop.Components.Extensions
protected override bool RunDefault ()
{
- Dialog md = null;
+ Gtk.Dialog md = null;
try {
- md = new Dialog (Caption, TransientFor, DialogFlags.Modal | DialogFlags.DestroyWithParent) {
+ md = new Gtk.Dialog (Caption, TransientFor, DialogFlags.Modal | DialogFlags.DestroyWithParent) {
HasSeparator = false,
BorderWidth = 6,
};
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/CommandSearchCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/CommandSearchCategory.cs
index ab01eea88d..bd2f9c96fb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/CommandSearchCategory.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/CommandSearchCategory.cs
@@ -52,7 +52,7 @@ namespace MonoDevelop.Components.MainToolbar
).ToList();
}
- public CommandSearchCategory (Widget widget) : base (GettextCatalog.GetString("Commands"))
+ public CommandSearchCategory () : base (GettextCatalog.GetString("Commands"))
{
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FileSearchCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FileSearchCategory.cs
index eb42236909..960d80e4ba 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FileSearchCategory.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FileSearchCategory.cs
@@ -42,7 +42,7 @@ namespace MonoDevelop.Components.MainToolbar
{
class FileSearchCategory : SearchCategory
{
- public FileSearchCategory (Widget widget) : base (GettextCatalog.GetString("Files"))
+ public FileSearchCategory () : base (GettextCatalog.GetString("Files"))
{
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
index efb203ae37..711c07c15d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
@@ -264,7 +264,7 @@ namespace MonoDevelop.Components.MainToolbar
protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
{
if (evnt.Button == 1 && evnt.Window == GdkWindow) {
- var window = (Window)Toplevel;
+ var window = (Gtk.Window)Toplevel;
if (!DesktopService.GetIsFullscreen (window)) {
window.BeginMoveDrag (1, (int)evnt.XRoot, (int)evnt.YRoot, evnt.Time);
return true;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ResultsDataSource.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ResultsDataSource.cs
index 5180a7dbbf..bffa3c343e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ResultsDataSource.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ResultsDataSource.cs
@@ -45,14 +45,12 @@ namespace MonoDevelop.Components.MainToolbar
{
class ResultsDataSource: List<SearchResult>, ISearchDataSource
{
-
- Gtk.Widget widget;
+
SearchResult bestResult;
int bestRank = int.MinValue;
- public ResultsDataSource (Gtk.Widget widget)
+ public ResultsDataSource ()
{
- this.widget = widget;
}
public void SortUpToN (MonoDevelop.Components.MainToolbar.SearchCategory.DataItemComparer comparison, int n)
@@ -125,14 +123,14 @@ namespace MonoDevelop.Components.MainToolbar
{
if (isSelected)
return GLib.Markup.EscapeText (this [item].PlainText);
- return this [item].GetMarkupText (widget);
+ return this [item].GetMarkupText ();
}
string ISearchDataSource.GetDescriptionMarkup (int item, bool isSelected)
{
if (isSelected)
return GLib.Markup.EscapeText (this [item].Description);
- return this [item].GetDescriptionMarkupText (widget);
+ return this [item].GetDescriptionMarkupText ();
}
ISegment ISearchDataSource.GetRegion (int item)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
index 0c57c32c68..c882f1f992 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
@@ -93,7 +93,7 @@ namespace MonoDevelop.Components.MainToolbar
FindInFilesDialog.SearchReplace (pattern.Pattern, null, new WholeSolutionScope (), options, null);
}
- public override string GetMarkupText (Gtk.Widget widget)
+ public override string GetMarkupText ()
{
return GettextCatalog.GetString ("Search in Solution...");
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs
index f694701da4..905ae87a5b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs
@@ -124,9 +124,8 @@ namespace MonoDevelop.Components.MainToolbar
this.AllowShrink = false;
this.AllowGrow = false;
- categories.Add (new FileSearchCategory (this));
- categories.Add (new CommandSearchCategory (this));
-
+ categories.Add (new FileSearchCategory ());
+ categories.Add (new CommandSearchCategory ());
categories.Add (new SearchInSolutionSearchCategory ());
foreach (var cat in AddinManager.GetExtensionObjects<SearchCategory> ("/MonoDevelop/Ide/SearchCategories")) {
categories.Add (cat);
@@ -384,8 +383,8 @@ namespace MonoDevelop.Components.MainToolbar
Gdk.Size retVal = new Gdk.Size ();
int ox, oy;
GetPosition (out ox, out oy);
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (ox, oy));
- var maxHeight = geometry.Height * 4 / 5;
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (ox, oy));
+ int maxHeight = (int)geometry.Height * 4 / 5;
double startY = yMargin + ChildAllocation.Y;
double y = startY;
calculatedItems = 0;
@@ -404,7 +403,7 @@ namespace MonoDevelop.Components.MainToolbar
calculatedItems++;
}
}
- retVal.Width = Math.Min (geometry.Width * 4 / 5, 480);
+ retVal.Width = Math.Min ((int)geometry.Width * 4 / 5, 480);
if (Math.Abs (y - startY) < 1) {
layout.SetMarkup (GettextCatalog.GetString ("No matches"));
int w, h;
@@ -1081,8 +1080,8 @@ namespace MonoDevelop.Components.MainToolbar
string GetRowMarkup (SearchResult result)
{
- string txt = "<span foreground=\"#606060\">" + result.GetMarkupText(this) +"</span>";
- string desc = result.GetDescriptionMarkupText (this);
+ string txt = "<span foreground=\"#606060\">" + result.GetMarkupText() +"</span>";
+ string desc = result.GetDescriptionMarkupText ();
if (!string.IsNullOrEmpty (desc))
txt += "<span foreground=\"#8F8F8F\" size=\"small\">\n" + desc + "</span>";
return txt;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchResult.cs
index bcca959283..4f0b8eda81 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchResult.cs
@@ -55,12 +55,12 @@ namespace MonoDevelop.Components.MainToolbar
{
protected string match;
- public virtual string GetMarkupText (Widget widget)
+ public virtual string GetMarkupText ()
{
- return HighlightMatch (widget, PlainText, match);
+ return HighlightMatch (PlainText, match);
}
- public virtual string GetDescriptionMarkupText (Widget widget)
+ public virtual string GetDescriptionMarkupText ()
{
return Ambience.EscapeText (Description);
}
@@ -99,7 +99,7 @@ namespace MonoDevelop.Components.MainToolbar
Rank = rank;
}
- protected static string HighlightMatch (Widget widget, string text, string toMatch)
+ protected static string HighlightMatch (string text, string toMatch)
{
var lane = StringMatcher.GetMatcher (toMatch, true).GetMatch (text);
StringBuilder result = new StringBuilder ();
@@ -253,9 +253,9 @@ namespace MonoDevelop.Components.MainToolbar
}
}
- public override string GetMarkupText (Widget widget)
+ public override string GetMarkupText ()
{
- return HighlightMatch (widget, MatchedString, match);
+ return HighlightMatch (MatchedString, match);
}
public override bool CanActivate {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs
index 30ff63b038..67c56f6cf1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs
@@ -58,7 +58,7 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
s = bounds.Height;
if (s > bounds.Width)
s = bounds.Width;
- Gtk.Style.PaintCheck (Container.Style, window, state, sh, bounds, Container, "checkbutton", bounds.X + indicatorSpacing - 1, bounds.Y + (bounds.Height - s)/2, s, s);
+ Gtk.Style.PaintCheck (Container.GetNativeWidget<Gtk.Widget> ().Style, window, state, sh, bounds, Container, "checkbutton", bounds.X + indicatorSpacing - 1, bounds.Y + (bounds.Height - s)/2, s, s);
}
protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs
index 35a1754f2e..e752a17056 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs
@@ -87,13 +87,13 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
TreeIter previousIter = TreeIter.Zero;
//dialogue and buttons
- Dialog dialog = new Dialog () {
+ var dialog = new Gtk.Dialog () {
Title = displayName + " Editor",
Modal = true,
AllowGrow = true,
AllowShrink = true,
};
- var toplevel = this.Container.Toplevel as Window;
+ var toplevel = this.Container.GetNativeWidget<Gtk.Widget> ().Toplevel as Gtk.Window;
if (toplevel != null)
dialog.TransientFor = toplevel;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs
index f5242c009c..6a1b998f5e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs
@@ -63,7 +63,7 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
gc.RgbFgColor = GetColor ();
int yd = (bounds.Height - ColorBoxSize) / 2;
window.DrawRectangle (gc, true, bounds.X, bounds.Y + yd, ColorBoxSize - 1, ColorBoxSize - 1);
- window.DrawRectangle (Container.Style.BlackGC, false, bounds.X, bounds.Y + yd, ColorBoxSize - 1, ColorBoxSize - 1);
+ window.DrawRectangle (Container.GetNativeWidget<Gtk.Widget> ().Style.BlackGC, false, bounds.X, bounds.Y + yd, ColorBoxSize - 1, ColorBoxSize - 1);
bounds.X += ColorBoxSize + ColorBoxSpacing;
bounds.Width -= ColorBoxSize + ColorBoxSpacing;
base.Render (window, ctx, bounds, state);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs
index 7aa4c1407a..ba459d1be6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs
@@ -52,7 +52,7 @@ namespace MonoDevelop.Components.PropertyGrid
get { return context; }
}
- public Widget Container {
+ public Control Container {
get { return container; }
}
@@ -255,7 +255,7 @@ namespace MonoDevelop.Components.PropertyGrid
get { return context.PropertyDescriptor; }
}
- public Widget Container {
+ public Control Container {
get { return container; }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs
index 8cc8de1800..b8f578ff10 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs
@@ -43,7 +43,7 @@ namespace MonoDevelop.Components.Theming
Foreground
}
- public class GtkColors
+ class GtkColors
{
private Cairo.Color[] gtk_colors;
private Widget widget;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs
index 8dba0ef095..a59672a7cc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs
@@ -32,7 +32,7 @@ using Gtk;
namespace MonoDevelop.Components.Theming
{
- public class GtkTheme : Theme
+ class GtkTheme : Theme
{
private Cairo.Color rule_color;
private Cairo.Color border_color;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/Theme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/Theme.cs
index 9c9e23af08..123786d761 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/Theme.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/Theme.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Components.Theming
Descending
}
- public abstract class Theme
+ abstract class Theme
{
private static Cairo.Color black = new Cairo.Color (0, 0, 0);
private Stack<ThemeContext> contexts = new Stack<ThemeContext> ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeContext.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeContext.cs
index 2ab2799458..2ac3a795ec 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeContext.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeContext.cs
@@ -31,7 +31,7 @@ using Cairo;
namespace MonoDevelop.Components.Theming
{
- public class ThemeContext
+ class ThemeContext
{
private double radius = 3.0;
public double Radius {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeEngine.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeEngine.cs
index 044079e17b..d600082cd9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeEngine.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeEngine.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.Components.Theming
{
- public static class ThemeEngine
+ static class ThemeEngine
{
private static Type theme_type;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISupportsProjectReload.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ButtonEvent.cs
index c417f56dda..7896d1ec4d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISupportsProjectReload.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ButtonEvent.cs
@@ -1,21 +1,21 @@
-//
-// ISupportsProjectReload.cs
-//
+//
+// ButtonEventArgs.cs
+//
// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
+// therzok <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2015 therzok
+//
// 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
@@ -23,40 +23,41 @@
// 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;
-using MonoDevelop.Projects;
-namespace MonoDevelop.Ide.Gui.Content
+namespace MonoDevelop.Components
{
- /// <summary>
- /// To be implemented by views which can survive a project or solution reloading
- /// </summary>
- public interface ISupportsProjectReload
+ public class ButtonEvent : Xwt.ButtonEventArgs
{
- ProjectReloadCapability ProjectReloadCapability { get; }
+ public ButtonEvent ()
+ {
+ }
- /// <summary>
- /// Called to update the project bound to the view.
- /// </summary>
- /// <param name="project">
- /// New project to assign to the view. It can be null.
- /// </param>
- void Update (Project project);
- }
-
- public enum ProjectReloadCapability
- {
- None = 0,
-
- /// <summary>
- /// It can keep unsaved data. Some status (such as undo queue) may be lost.
- /// </summary>
- UnsavedData = 1,
-
- /// <summary>
- /// It can keep unsaved data and status.
- /// </summary>
- Full = 2
+ Gdk.EventButton native;
+ new bool Handled { get; set; }
+
+ public static implicit operator ButtonEvent (Gdk.EventButton args)
+ {
+ int numPress;
+ if (args.Type == Gdk.EventType.TwoButtonPress)
+ numPress = 2;
+ else if (args.Type == Gdk.EventType.ThreeButtonPress)
+ numPress = 3;
+ else
+ numPress = 1;
+ return new ButtonEvent {
+ native = args,
+ X = args.X,
+ Y = args.Y,
+ Button = (Xwt.PointerButton)args.Button,
+ MultiplePress = numPress,
+ };
+ }
+
+ public static implicit operator Gdk.EventButton (ButtonEvent args)
+ {
+ return args.native;
+ }
}
}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactDialog.cs
index ac218f22ec..1f2a461cea 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactDialog.cs
@@ -28,7 +28,7 @@ using Gtk;
namespace MonoDevelop.Components
{
- public class CompactDialog: Dialog
+ public class CompactDialog: Gtk.Dialog
{
public CompactDialog ()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenu.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenu.cs
index 2507b7dcae..2d24d52336 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenu.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenu.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.Components
public ContextMenu ()
{
- items = new ContextMenuItemCollection (this);
+ items = new ContextMenuItemCollection ();
}
public ContextMenuItemCollection Items {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItemCollection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItemCollection.cs
index 576d512b14..848b7970b1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItemCollection.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItemCollection.cs
@@ -31,7 +31,7 @@ namespace MonoDevelop.Components
{
public class ContextMenuItemCollection: Collection<ContextMenuItem>
{
- internal ContextMenuItemCollection (ContextMenu parent)
+ internal ContextMenuItemCollection ()
{
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs
index ee58994619..0396bdde91 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using System.Collections.Generic;
using MonoDevelop.Components.Commands;
#if MAC
@@ -33,19 +34,21 @@ using MonoDevelop.Components.Mac;
namespace MonoDevelop.Components
{
- public class Control: IDisposable
+ public class Control : IDisposable
{
- object nativeWidget;
+ internal static Dictionary<object, WeakReference<Control>> cache = new Dictionary<object, WeakReference<Control>> ();
+ internal object nativeWidget;
protected Control ()
{
}
- public Control (object widget)
+ Control (object widget)
{
if (widget == null)
- throw new ArgumentNullException ("widget");
+ throw new ArgumentNullException (nameof (widget));
this.nativeWidget = widget;
+ cache.Add (nativeWidget, new WeakReference<Control> (this));
}
protected virtual object CreateNativeWidget ()
@@ -56,9 +59,16 @@ namespace MonoDevelop.Components
public T GetNativeWidget<T> ()
{
if (nativeWidget == null) {
+ var toCache = this;
var w = CreateNativeWidget ();
- if (!(w is T))
- w = ConvertToType (typeof(T), w);
+ if (!(w is T)) {
+ var temp = w as Control;
+ while (temp != null) {
+ w = temp.GetNativeWidget<T> ();
+ temp = w as Control;
+ }
+ w = ConvertToType (typeof (T), w);
+ }
if (w is Gtk.Widget) {
var gtkWidget = (Gtk.Widget)w;
var c = new CommandRouterContainer (gtkWidget, this, true);
@@ -69,9 +79,17 @@ namespace MonoDevelop.Components
GC.SuppressFinalize (this);
Dispose (true);
};
- }
- else
+ toCache = c;
+ } else {
nativeWidget = w;
+ }
+ WeakReference<Control> cached;
+ Control target;
+ if (cache.TryGetValue (nativeWidget, out cached) && cached.TryGetTarget (out target)) {
+ if (target != toCache)
+ throw new Exception ();
+ } else
+ cache.Add (nativeWidget, new WeakReference<Control> (toCache));
}
if (nativeWidget is T)
return (T)nativeWidget;
@@ -84,27 +102,62 @@ namespace MonoDevelop.Components
if (t.IsInstanceOfType (w))
return w;
- #if MAC
- if (w is NSView && t == typeof(Gtk.Widget)) {
+#if MAC
+ if (w is NSView && t == typeof (Gtk.Widget)) {
var ww = GtkMacInterop.NSViewToGtkWidget ((NSView)w);
ww.Show ();
return ww;
}
- if (w is Gtk.Widget && t == typeof(NSView)) {
+ if (w is Gtk.Widget && t == typeof (NSView)) {
return new GtkEmbed ((Gtk.Widget)w);
}
- #endif
+#endif
throw new NotSupportedException ();
}
+#if MAC
+ public static implicit operator NSView (Control d)
+ {
+ return d.GetNativeWidget<NSView> ();
+ }
+
+ public static implicit operator Control (NSView d)
+ {
+ if (d == null)
+ return null;
+
+ return GetImplicit<Control, NSView> (d) ?? new Control (d);
+ }
+#endif
+
public static implicit operator Gtk.Widget (Control d)
{
- return d.GetNativeWidget<Gtk.Widget> ();
+ return d?.GetNativeWidget<Gtk.Widget> ();
}
public static implicit operator Control (Gtk.Widget d)
{
- return new Control (d);
+ if (d == null)
+ return null;
+
+ return GetImplicit<Control, Gtk.Widget>(d) ?? new Control (d);
+ }
+
+ internal static T GetImplicit<T, U> (U native) where T : Control where U : class
+ {
+ WeakReference<Control> cached;
+ Control target;
+
+ if (cache.TryGetValue (native, out cached)) {
+ if (cached.TryGetTarget (out target)) {
+ var ret = target as T;
+ if (ret != null)
+ return ret;
+ }
+
+ cache.Remove (native);
+ }
+ return null;
}
public void GrabFocus ()
@@ -112,22 +165,35 @@ namespace MonoDevelop.Components
// TODO
}
+
+ public bool HasFocus {
+ get
+ {
+ // TODO
+ if (nativeWidget is Gtk.Widget)
+ return ((Gtk.Widget)nativeWidget).HasFocus;
+ return false;
+ }
+ }
+
public void Dispose ()
{
if (nativeWidget is Gtk.Widget) {
((Gtk.Widget)nativeWidget).Destroy ();
return;
}
- #if MAC
+#if MAC
else if (nativeWidget is NSView)
((NSView)nativeWidget).Dispose ();
- #endif
+#endif
Dispose (true);
}
protected virtual void Dispose (bool disposing)
{
+ if (nativeWidget != null)
+ cache.Remove (nativeWidget);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IBaseViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Dialog.cs
index ad246af631..a412d8070b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IBaseViewContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Dialog.cs
@@ -1,9 +1,10 @@
-// IBaseViewContent.cs
+//
+// Dialog.cs
//
// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
+// therzok <marius.ungureanu@xamarin.com>
//
-// Copyright (c) 2009 RemObjects Software
+// Copyright (c) 2015 therzok
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -22,29 +23,37 @@
// 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;
-using Gtk;
-using System.Collections.Generic;
-namespace MonoDevelop.Ide.Gui
+namespace MonoDevelop.Components
{
- public interface IBaseViewContent : IDisposable
+ public class Dialog : Window
{
- IWorkbenchWindow WorkbenchWindow { get; set; }
- Widget Control { get; }
-
- /// <summary>
- /// The label used for the subview list.
- /// </summary>
- string TabPageLabel { get; }
+ protected Dialog ()
+ {
+ }
+
+ Dialog (object widget)
+ {
+ if (widget == null)
+ throw new ArgumentNullException (nameof (widget));
- object GetContent (Type type);
- IEnumerable<T> GetContents<T> () where T : class;
+ this.nativeWidget = widget;
+ cache.Add (widget, new WeakReference<Control> (this));
+ }
- bool CanReuseView (string fileName);
- void RedrawContent ();
+ public static implicit operator Gtk.Dialog (Dialog d)
+ {
+ return d?.GetNativeWidget<Gtk.Dialog> ();
+ }
+
+ public static implicit operator Dialog (Gtk.Dialog d)
+ {
+ if (d == null)
+ return null;
+
+ return GetImplicit<Dialog, Gtk.Dialog>(d) ?? new Dialog (d);
+ }
}
-} \ No newline at end of file
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs
index df6e49c424..9c950c757a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs
@@ -141,12 +141,12 @@ namespace MonoDevelop.Components
window.WidthRequest = Allocation.Width;
int width, height;
window.GetSizeRequest (out width, out height);
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (dx, dy));
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (dx, dy));
if (dy + height > geometry.Bottom)
dy = oy + this.Allocation.Y - height;
if (dx + width > geometry.Right)
- dx = geometry.Right - width;
+ dx = (int)geometry.Right - width;
window.Move (dx, dy);
window.ShowAll ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs
index f3e7ea1c89..81a0a1a6d6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs
@@ -31,7 +31,7 @@ using System.Text;
namespace MonoDevelop.Components
{
- public class DropDownBoxListWindow : Window
+ public class DropDownBoxListWindow : Gtk.Window
{
readonly ScrolledWindow vScrollbar;
internal ListWidget list;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs
index 280379a4a8..1136f7bde7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs
@@ -53,7 +53,6 @@ namespace MonoDevelop.Components
return Gtk.FileChooserAction.Save;
else
throw new NotSupportedException ();
-
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs
index dc0144ee3a..de14159fcc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs
@@ -148,14 +148,14 @@ namespace MonoDevelop.Components
const int spacing = arrowLeftPadding + arrowRightPadding + arrowSize;
const int minRegionSelectorWidth = 30;
- Func<int, Widget> createMenuForItem;
+ Func<int, Control> createMenuForItem;
Widget menuWidget;
bool pressMenuWasVisible;
int pressHoverIndex;
int menuIndex;
uint hideTimeout;
- public PathBar (Func<int, Widget> createMenuForItem)
+ public PathBar (Func<int, Control> createMenuForItem)
{
this.Events = EventMask.ExposureMask |
EventMask.EnterNotifyMask |
@@ -543,18 +543,21 @@ namespace MonoDevelop.Components
int dy = oy + this.Allocation.Bottom;
var req = widget.SizeRequest ();
-
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (dx, dy));
+
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (dx, dy));
+ int geomWidth = (int)geometry.Width;
+ int geomLeft = (int)geometry.Left;
+ int geomRight = (int)geometry.Right;
int width = System.Math.Max (req.Width, w);
- if (width >= geometry.Width - spacing * 2) {
- width = geometry.Width - spacing * 2;
- dx = geometry.Left + spacing;
+ if (width >= geomWidth - spacing * 2) {
+ width = geomWidth - spacing * 2;
+ dx = geomLeft + spacing;
}
widget.WidthRequest = width;
if (dy + req.Height > geometry.Bottom)
dy = oy + this.Allocation.Y - req.Height;
- if (dx + width > geometry.Right)
- dx = geometry.Right - width;
+ if (dx + width > geomRight)
+ dx = geomRight - width;
(widget as Gtk.Window).Move (dx, dy);
(widget as Gtk.Window).Resize (width, req.Height);
widget.GrabFocus ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs
index 597e9dc134..43b4cb2286 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs
@@ -38,9 +38,6 @@ namespace MonoDevelop.Components
public class RoundedFrame : Bin
{
private Theme theme;
- protected Theme Theme {
- get { return theme; }
- }
private int frame_width = 3;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs
index 95036e0cbe..f2cfc14f3a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs
@@ -116,19 +116,23 @@ namespace MonoDevelop.Components
// LimitWidth (fittedWidth);
// }
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (x, y));
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (x, y));
+ int left = (int)geometry.Left;
+ int top = (int)geometry.Top;
+ int width = (int)geometry.Width;
+ int height = (int)geometry.Height;
if (NudgeHorizontal) {
if (allocation.Width <= geometry.Width && x + allocation.Width >= geometry.Left + geometry.Width - edgeGap)
- x = geometry.Left + (geometry.Width - allocation.Width - edgeGap);
- if (x <= geometry.Left + edgeGap)
- x = geometry.Left + edgeGap;
+ x = left + (width - allocation.Width - edgeGap);
+ if (x <= left + edgeGap)
+ x = left + edgeGap;
}
if (NudgeVertical) {
if (allocation.Height <= geometry.Height && y + allocation.Height >= geometry.Top + geometry.Height - edgeGap)
- y = geometry.Top + (geometry.Height - allocation.Height - edgeGap);
- if (y <= geometry.Top + edgeGap)
- y = geometry.Top + edgeGap;
+ y = top + (height - allocation.Height - edgeGap);
+ if (y <= top + edgeGap)
+ y = top + edgeGap;
}
if (y != oldY || x != oldX)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs
new file mode 100644
index 0000000000..5ad8ac439f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs
@@ -0,0 +1,59 @@
+//
+// Window.cs
+//
+// Author:
+// therzok <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2015 therzok
+//
+// 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.Components
+{
+ public class Window : Control
+ {
+ protected Window ()
+ {
+ }
+
+ Window (object widget)
+ {
+ if (widget == null)
+ throw new ArgumentNullException (nameof (widget));
+
+ this.nativeWidget = widget;
+ cache.Add (widget, new WeakReference<Control> (this));
+ }
+
+ public static implicit operator Gtk.Window (Window d)
+ {
+ return d?.GetNativeWidget<Gtk.Window> ();
+ }
+
+ public static implicit operator Window (Gtk.Window d)
+ {
+ if (d == null)
+ return null;
+
+ return GetImplicit<Window, Gtk.Window>(d) ?? new Window (d);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs
index e330d8597b..f503f973a9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs
@@ -448,15 +448,15 @@ namespace MonoDevelop.Ide.CodeCompletion
return;
// Note: we add back the TextOffset here in case X and X+TextOffset are on different monitors.
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (X + TextOffset, Y));
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (X + TextOffset, Y));
previousHeight = h;
previousWidth = w;
if (X + w > geometry.Right)
- X = geometry.Right - w;
+ X = (int)geometry.Right - w;
else if (X < geometry.Left)
- X = geometry.Left;
+ X = (int)geometry.Left;
if (Y + h > geometry.Bottom || yPosition == WindowPositonY.Top) {
// Put the completion-list window *above* the cursor
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs
index 0a3fdadabc..850c09f7d2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs
@@ -218,8 +218,8 @@ namespace MonoDevelop.Ide.CodeCompletion
wasAbove = false;
var lastMethod = methods [methods.Count - 1];
int curParam = window.Ext != null ? window.Ext.GetCurrentParameterIndex (lastMethod.MethodProvider.StartOffset) : 0;
- var geometry2 = DesktopService.GetUsableMonitorGeometry (window.Screen, window.Screen.GetMonitorAtPoint (X, Y));
- window.ShowParameterInfo (lastMethod.MethodProvider, lastMethod.CurrentOverload, curParam - 1, geometry2.Width);
+ var geometry2 = DesktopService.GetUsableMonitorGeometry (window.Screen.Number, window.Screen.GetMonitorAtPoint (X, Y));
+ window.ShowParameterInfo (lastMethod.MethodProvider, lastMethod.CurrentOverload, curParam - 1, (int)geometry2.Width);
PositionParameterInfoWindow (window.Allocation);
}
@@ -255,12 +255,12 @@ namespace MonoDevelop.Ide.CodeCompletion
Y = ctx.TriggerYCoord;
}
- var geometry = DesktopService.GetUsableMonitorGeometry (window.Screen, window.Screen.GetMonitorAtPoint (X, Y));
+ var geometry = DesktopService.GetUsableMonitorGeometry (window.Screen.Number, window.Screen.GetMonitorAtPoint (X, Y));
- window.ShowParameterInfo (md.MethodProvider, md.CurrentOverload, cparam - 1, geometry.Width);
+ window.ShowParameterInfo (md.MethodProvider, md.CurrentOverload, cparam - 1, (int)geometry.Width);
if (X + allocation.Width > geometry.Right)
- X = geometry.Right - allocation.Width;
+ X = (int)geometry.Right - allocation.Width;
if (Y < geometry.Top)
Y = ctx.TriggerYCoord;
if (wasAbove || Y + allocation.Height > geometry.Bottom) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs
index 0ea1eee657..37316ca81b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs
@@ -117,8 +117,8 @@ namespace MonoDevelop.Ide.CodeCompletion
headLabel.Visible = !string.IsNullOrEmpty (o.SignatureMarkup);
int x, y;
GetPosition (out x, out y);
- var geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (x, y));
- headLabel.MaxWidth = Math.Max (geometry.Width / 5, 480);
+ var geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (x, y));
+ headLabel.MaxWidth = Math.Max ((int)geometry.Width / 5, 480);
if (Theme.DrawPager && overloads.Count > 1) {
headLabel.WidthRequest = headLabel.RealWidth + 70;
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 fde8a432b0..2a6cf53298 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs
@@ -218,12 +218,12 @@ namespace MonoDevelop.Ide.CodeTemplates
return templateStore.AppendValues (iter, template, template.Shortcut, null);
}
}
-
+
internal class CodeTemplatePane : OptionsPanel
{
CodeTemplatePanelWidget codeTemplatePanelWidget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return codeTemplatePanelWidget = new CodeTemplatePanelWidget (this.ParentDialog);
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 3b4d753ef8..738f59f7e1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs
@@ -45,7 +45,7 @@ namespace MonoDevelop.Ide.Codons
[ExtensionNode ("Pad", "Registers a pad to be shown in the workbench.")]
public class PadCodon : ExtensionNode
{
- IPadContent content;
+ PadContent content;
string id;
[NodeAttribute("_label", "Display name of the pad.", Localizable=true)]
@@ -75,20 +75,20 @@ namespace MonoDevelop.Ide.Codons
bool initializeCalled;
- public IPadContent PadContent {
+ public PadContent PadContent {
get {
return content;
}
}
- public IPadContent InitializePadContent (IPadWindow window)
+ public PadContent InitializePadContent (IPadWindow window)
{
if (content == null) {
content = CreatePad ();
- content.Initialize (window);
+ content.Init (window);
ApplyPreferences ();
} else if (!initializeCalled) {
- content.Initialize (window);
+ content.Init (window);
ApplyPreferences ();
}
initializeCalled = true;
@@ -142,12 +142,12 @@ namespace MonoDevelop.Ide.Codons
{
}
- public PadCodon (IPadContent content, string id, string label, string defaultPlacement, string icon)
+ public PadCodon (PadContent content, string id, string label, string defaultPlacement, string icon)
: this (content, id, label, defaultPlacement, DockItemStatus.Dockable, icon)
{
}
- public PadCodon (IPadContent content, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, string icon)
+ public PadCodon (PadContent content, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, string icon)
{
this.id = id;
this.content = content;
@@ -157,10 +157,10 @@ namespace MonoDevelop.Ide.Codons
this.defaultStatus = defaultStatus;
}
- protected virtual IPadContent CreatePad ()
+ protected virtual PadContent CreatePad ()
{
Counters.PadsLoaded++;
- return (IPadContent) Addin.CreateInstance (className, true);
+ return (PadContent) Addin.CreateInstance (className, true);
}
PadUserPrefs preferences = null;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs
index 634bbcc02f..4c1bd3c34a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs
@@ -73,7 +73,7 @@ namespace MonoDevelop.Ide.Codons
options = (TreePadOption[]) ops.ToArray (typeof(TreePadOption));
}
- protected override IPadContent CreatePad ()
+ protected override PadContent CreatePad ()
{
if (builders == null)
BuildChildren ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs
index 20ace23f75..ae70c81ae8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs
@@ -50,7 +50,7 @@ namespace MonoDevelop.Ide.Commands
class CloseAllHandler : CommandHandler
{
- protected virtual IViewContent GetDocumentException ()
+ protected virtual ViewContent GetDocumentException ()
{
return null;
}
@@ -86,7 +86,7 @@ namespace MonoDevelop.Ide.Commands
class CloseAllButThisHandler : CloseAllHandler
{
- protected override IViewContent GetDocumentException ()
+ protected override ViewContent GetDocumentException ()
{
var active = IdeApp.Workbench.ActiveDocument;
return active == null ? null : active.Window.ViewContent;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs
index 2e66e750f7..1a4c3e94d6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs
@@ -424,15 +424,23 @@ namespace MonoDevelop.Ide.Desktop
return new DesktopApplication[0];
}
- public virtual Gdk.Rectangle GetUsableMonitorGeometry (Gdk.Screen screen, int monitor)
+ public virtual Xwt.Rectangle GetUsableMonitorGeometry (int screenNumber, int monitorNumber)
{
- return screen.GetMonitorGeometry (monitor);
+ var screen = Gdk.Display.Default.GetScreen (screenNumber);
+ var rect = screen.GetMonitorGeometry (monitorNumber);
+
+ return new Xwt.Rectangle {
+ X = rect.X,
+ Y = rect.Y,
+ Width = rect.Width,
+ Height = rect.Height,
+ };
}
/// <summary>
/// Grab the desktop focus for the window.
/// </summary>
- public virtual void GrabDesktopFocus (Gtk.Window window)
+ internal virtual void GrabDesktopFocus (Gtk.Window window)
{
if (Platform.IsWindows && window.IsRealized) {
/* On Windows calling Present() will break out of window edge snapping mode. */
@@ -463,9 +471,9 @@ namespace MonoDevelop.Ide.Desktop
toolbarBox.PackStart ((MainToolbar)toolbar, true, true, 0);
}
- public virtual bool GetIsFullscreen (Gtk.Window window)
+ public virtual bool GetIsFullscreen (Window window)
{
- return ((bool?) window.Data ["isFullScreen"]) ?? false;
+ return ((bool?) window.GetNativeWidget <Gtk.Window> ().Data ["isFullScreen"]) ?? false;
}
public virtual bool IsModalDialogRunning ()
@@ -474,26 +482,27 @@ namespace MonoDevelop.Ide.Desktop
return windows.Any (w => w.Modal && w.Visible);
}
- public virtual void SetIsFullscreen (Gtk.Window window, bool isFullscreen)
+ public virtual void SetIsFullscreen (Window window, bool isFullscreen)
{
- window.Data ["isFullScreen"] = isFullscreen;
+ Gtk.Window windowControl = window;
+ windowControl.Data ["isFullScreen"] = isFullscreen;
if (isFullscreen) {
- window.Fullscreen ();
+ windowControl.Fullscreen ();
} else {
- window.Unfullscreen ();
- SetMainWindowDecorations (window);
+ windowControl.Unfullscreen ();
+ SetMainWindowDecorations (windowControl);
}
}
- public virtual void AddChildWindow (Gtk.Window parent, Gtk.Window child)
+ internal virtual void AddChildWindow (Gtk.Window parent, Gtk.Window child)
{
}
- public virtual void RemoveChildWindow (Gtk.Window parent, Gtk.Window child)
+ internal virtual void RemoveChildWindow (Gtk.Window parent, Gtk.Window child)
{
}
- public virtual void PlaceWindow (Gtk.Window window, int x, int y, int width, int height)
+ internal virtual void PlaceWindow (Gtk.Window window, int x, int y, int width, int height)
{
window.Move (x, y);
window.Resize (width, height);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs
index 5b3c86c311..a6b4cf594c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs
@@ -30,6 +30,8 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Editor;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.TypeSystem;
+using System.Collections;
+using System.Collections.Generic;
namespace MonoDevelop.Ide.Editor.Extension
{
@@ -97,6 +99,21 @@ namespace MonoDevelop.Ide.Editor.Extension
{
return Next;
}
+
+ internal protected virtual object OnGetContent (Type type)
+ {
+ if (type.IsInstanceOfType (this))
+ return this;
+ else
+ return null;
+ }
+
+ internal protected virtual IEnumerable<object> OnGetContents (Type type)
+ {
+ var c = OnGetContent (type);
+ if (c != null)
+ yield return c;
+ }
}
class TextEditorExtensionMarker : TextEditorExtension
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextSegmentMarker.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextSegmentMarker.cs
index 954980f1ef..1f5bf5ad11 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextSegmentMarker.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextSegmentMarker.cs
@@ -80,8 +80,6 @@ namespace MonoDevelop.Ide.Editor
{
bool IsInsideSmartTag (double x, double y);
- bool IsInsideWindow (Gtk.MotionNotifyEventArgs args);
-
event EventHandler ShowPopup;
event EventHandler CancelPopup;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs
index f99358b0f2..89d74ad7fc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs
@@ -78,8 +78,12 @@ namespace MonoDevelop.Ide.Editor
}
}
- interface ITextEditorImpl : IViewContent, IDisposable
+ interface ITextEditorImpl : IDisposable
{
+ ViewContent ViewContent { get; }
+
+ string ContentName { get; set; }
+
EditMode EditMode { get; }
ITextEditorOptions Options { get; set; }
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedTooltipProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedTooltipProvider.cs
index 15b92336f2..322f33f984 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedTooltipProvider.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedTooltipProvider.cs
@@ -35,12 +35,8 @@ namespace MonoDevelop.Ide.Editor.Projection
readonly Projection projection;
readonly TooltipProvider projectedTooltipProvider;
- public ProjectedTooltipProvider (TextEditor editor, DocumentContext ctx, Projection projection, TooltipProvider projectedTooltipProvider)
+ public ProjectedTooltipProvider (Projection projection, TooltipProvider projectedTooltipProvider)
{
- if (editor == null)
- throw new ArgumentNullException ("editor");
- if (ctx == null)
- throw new ArgumentNullException ("ctx");
if (projection == null)
throw new ArgumentNullException ("projection");
if (projectedTooltipProvider == null)
@@ -68,7 +64,7 @@ namespace MonoDevelop.Ide.Editor.Projection
return projectedTooltipProvider.IsInteractive (editor, tipWindow);
}
- public override void ShowTooltipWindow (TextEditor editor, Control tipWindow, TooltipItem item, Gdk.ModifierType modifierState, int mouseX, int mouseY)
+ public override void ShowTooltipWindow (TextEditor editor, Control tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY)
{
projectedTooltipProvider.ShowTooltipWindow (editor, tipWindow, item, modifierState, mouseX, mouseY);
}
@@ -78,7 +74,7 @@ namespace MonoDevelop.Ide.Editor.Projection
projectedTooltipProvider.GetRequiredPosition (editor, tipWindow, out requiredWidth, out xalign);
}
- public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Gdk.ModifierType modifierState)
+ public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
{
foreach (var pseg in projection.ProjectedSegments) {
if (pseg.ContainsOriginal (offset)) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
index e54d55295e..3631e25186 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
@@ -996,7 +996,7 @@ namespace MonoDevelop.Ide.Editor
}
TextEditorViewContent viewContent;
- internal IViewContent GetViewContent ()
+ internal ViewContent GetViewContent ()
{
if (viewContent == null) {
viewContent = new TextEditorViewContent (this, textEditorImpl);
@@ -1130,32 +1130,37 @@ namespace MonoDevelop.Ide.Editor
public T GetContent<T>() where T : class
{
+ return GetContents<T> ().FirstOrDefault ();
+ }
+
+ public IEnumerable<T> GetContents<T>() where T : class
+ {
T result = textEditorImpl as T;
if (result != null)
- return result;
+ yield return result;
var ext = textEditorImpl.EditorExtension;
while (ext != null) {
result = ext as T;
if (result != null)
- return result;
+ yield return result;
ext = ext.Next;
}
- return null;
}
- public IEnumerable<T> GetContents<T>() where T : class
+ public IEnumerable<object> GetContents (Type type)
{
- T result = textEditorImpl as T;
- if (result != null)
- yield return result;
+ var res = Enumerable.Empty<object> ();
+ if (type.IsInstanceOfType (textEditorImpl))
+ res = res.Concat (textEditorImpl);
+
var ext = textEditorImpl.EditorExtension;
while (ext != null) {
- result = ext as T;
- if (result != null)
- yield return result;
+ res = res.Concat (ext.OnGetContents (type));
ext = ext.Next;
}
+ return res;
}
+
#endregion
public string GetPangoMarkup (int offset, int length)
@@ -1329,7 +1334,7 @@ namespace MonoDevelop.Ide.Editor
foreach (var tp in projection.ProjectedEditor.allProviders) {
if (!tp.IsValidFor (projection.ProjectedEditor.MimeType))
continue;
- var newProvider = new ProjectedTooltipProvider (this, ctx, projection, (TooltipProvider)tp.CreateInstance ());
+ var newProvider = new ProjectedTooltipProvider (projection, (TooltipProvider)tp.CreateInstance ());
projectedProviders.Add (newProvider);
textEditorImpl.AddTooltipProvider (newProvider);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorDisplayBinding.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorDisplayBinding.cs
index 1fe76c43a0..5c626bbdab 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorDisplayBinding.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorDisplayBinding.cs
@@ -93,7 +93,7 @@ namespace MonoDevelop.Ide.Editor
return false;
}
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
{
var editor = TextEditorFactory.CreateNewEditor ();
editor.MimeType = mimeType;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs
index abbb316157..04658c3b2c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs
@@ -1,4 +1,4 @@
-//
+//
// TextEditorViewContent.cs
//
// Author:
@@ -52,10 +52,10 @@ using System.Collections.Immutable;
namespace MonoDevelop.Ide.Editor
{
/// <summary>
- /// The TextEditor object needs to be available through IBaseViewContent.GetContent therefore we need to insert a
+ /// The TextEditor object needs to be available through BaseViewContent.GetContent therefore we need to insert a
/// decorator in between.
/// </summary>
- class TextEditorViewContent : IViewContent, ICommandRouter, IQuickTaskProvider
+ class TextEditorViewContent : ViewContent, ICommandRouter, IQuickTaskProvider
{
readonly TextEditor textEditor;
readonly ITextEditorImpl textEditorImpl;
@@ -66,9 +66,9 @@ namespace MonoDevelop.Ide.Editor
public TextEditorViewContent (TextEditor textEditor, ITextEditorImpl textEditorImpl)
{
if (textEditor == null)
- throw new ArgumentNullException ("textEditor");
+ throw new ArgumentNullException (nameof (textEditor));
if (textEditorImpl == null)
- throw new ArgumentNullException ("textEditorImpl");
+ throw new ArgumentNullException (nameof (textEditorImpl));
this.textEditor = textEditor;
this.textEditorImpl = textEditorImpl;
this.textEditor.MimeTypeChanged += UpdateTextEditorOptions;
@@ -86,6 +86,7 @@ namespace MonoDevelop.Ide.Editor
void HandleDirtyChanged (object sender, EventArgs e)
{
+ IsDirty = textEditorImpl.ViewContent.IsDirty;
InformAutoSave ();
}
@@ -110,7 +111,7 @@ namespace MonoDevelop.Ide.Editor
if (autoSaveTask != null && !autoSaveTask.IsCompleted)
return false;
- autoSaveTask = AutoSave.InformAutoSaveThread (textEditor.CreateSnapshot (), textEditor.FileName, textEditorImpl.IsDirty);
+ autoSaveTask = AutoSave.InformAutoSaveThread (textEditor.CreateSnapshot (), textEditor.FileName, IsDirty);
autoSaveTimer = 0;
return false;
});
@@ -363,254 +364,112 @@ namespace MonoDevelop.Ide.Editor
}
}
-
- #region IViewFContent implementation
-
- event EventHandler IViewContent.ContentNameChanged {
- add {
- textEditorImpl.ContentNameChanged += value;
- }
- remove {
- textEditorImpl.ContentNameChanged -= value;
- }
+ protected override void OnContentNameChanged ()
+ {
+ base.OnContentNameChanged ();
+ textEditorImpl.ContentName = ContentName;
}
- event EventHandler IViewContent.ContentChanged {
- add {
- textEditorImpl.ContentChanged += value;
- }
- remove {
- textEditorImpl.ContentChanged -= value;
- }
- }
- event EventHandler IViewContent.DirtyChanged {
- add {
- textEditorImpl.DirtyChanged += value;
- }
- remove {
- textEditorImpl.DirtyChanged -= value;
- }
- }
-
- event EventHandler IViewContent.BeforeSave {
- add {
- textEditorImpl.BeforeSave += value;
- }
- remove {
- textEditorImpl.BeforeSave -= value;
- }
- }
+ #region IViewFContent implementation
- void IViewContent.Load (FileOpenInformation fileOpenInformation)
+ public override async Task Load (FileOpenInformation fileOpenInformation)
{
- this.textEditorImpl.DirtyChanged -= HandleDirtyChanged;
- this.textEditor.TextChanged -= HandleTextChanged;
- textEditorImpl.Load (fileOpenInformation);
- RunFirstTimeFoldUpdate (textEditor.Text);
- textEditorImpl.InformLoadComplete ();
- this.textEditor.TextChanged += HandleTextChanged;
- this.textEditorImpl.DirtyChanged += HandleDirtyChanged;
- }
-
- void IViewContent.Load (string fileName)
- {
- this.textEditorImpl.DirtyChanged -= HandleDirtyChanged;
- this.textEditor.TextChanged -= HandleTextChanged;
- textEditorImpl.Load (new FileOpenInformation (fileName));
+ textEditorImpl.ViewContent.DirtyChanged -= HandleDirtyChanged;
+ textEditor.TextChanged -= HandleTextChanged;
+ await textEditorImpl.ViewContent.Load (fileOpenInformation);
RunFirstTimeFoldUpdate (textEditor.Text);
textEditorImpl.InformLoadComplete ();
- this.textEditor.TextChanged += HandleTextChanged;
- this.textEditorImpl.DirtyChanged += HandleDirtyChanged;
+ textEditor.TextChanged += HandleTextChanged;
+ textEditorImpl.ViewContent.DirtyChanged += HandleDirtyChanged;
}
- void IViewContent.LoadNew (System.IO.Stream content, string mimeType)
+ public override async Task LoadNew (Stream content, string mimeType)
{
textEditor.MimeType = mimeType;
string text = null;
if (content != null) {
- Encoding encoding;
- bool hadBom;
- text = TextFileUtility.GetText (content, out encoding, out hadBom);
- textEditor.Text = text;
- textEditor.Encoding = encoding;
- textEditor.UseBOM = hadBom;
+ var res = await TextFileUtility.GetTextAsync (content);
+ text = textEditor.Text = res.Text;
+ textEditor.Encoding = res.Encoding;
+ textEditor.UseBOM = res.HasBom;
}
RunFirstTimeFoldUpdate (text);
textEditorImpl.InformLoadComplete ();
}
- void IViewContent.Save (FileSaveInformation fileSaveInformation)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
if (!string.IsNullOrEmpty (fileSaveInformation.FileName))
AutoSave.RemoveAutoSaveFile (fileSaveInformation.FileName);
- textEditorImpl.Save (fileSaveInformation);
+ return textEditorImpl.ViewContent.Save (fileSaveInformation);
}
- void IViewContent.Save (string fileName)
- {
- if (!string.IsNullOrEmpty (fileName))
- AutoSave.RemoveAutoSaveFile (fileName);
- textEditorImpl.Save (new FileSaveInformation (fileName));
- }
-
- void IViewContent.Save ()
+ public override Task Save ()
{
if (!string.IsNullOrEmpty (textEditorImpl.ContentName))
AutoSave.RemoveAutoSaveFile (textEditorImpl.ContentName);
- textEditorImpl.Save ();
+ return textEditorImpl.ViewContent.Save ();
}
- void IViewContent.DiscardChanges ()
+ public override void DiscardChanges ()
{
if (autoSaveTask != null)
autoSaveTask.Wait (TimeSpan.FromSeconds (5));
RemoveAutoSaveTimer ();
if (!string.IsNullOrEmpty (textEditorImpl.ContentName))
AutoSave.RemoveAutoSaveFile (textEditorImpl.ContentName);
- textEditorImpl.DiscardChanges ();
- }
-
- public MonoDevelop.Projects.Project Project {
- get {
- return textEditorImpl.Project;
- }
- set {
- textEditorImpl.Project = value;
- UpdateTextEditorOptions (null, null);
- }
- }
-
- string IViewContent.PathRelativeToProject {
- get {
- return textEditorImpl.PathRelativeToProject;
- }
- }
-
- string IViewContent.ContentName {
- get {
- return textEditorImpl.ContentName;
- }
- set {
- textEditorImpl.ContentName = value;
- }
- }
-
- string IViewContent.UntitledName {
- get {
- return textEditorImpl.UntitledName;
- }
- set {
- textEditorImpl.UntitledName = value;
- }
+ textEditorImpl.ViewContent.DiscardChanges ();
}
- string IViewContent.StockIconId {
- get {
- return textEditorImpl.StockIconId;
- }
- }
-
- bool IViewContent.IsUntitled {
- get {
- return textEditorImpl.IsUntitled;
- }
- }
-
- bool IViewContent.IsViewOnly {
- get {
- return textEditorImpl.IsViewOnly;
- }
- }
-
- bool IViewContent.IsFile {
- get {
- return textEditorImpl.IsFile;
- }
- }
-
- bool IViewContent.IsDirty {
- get {
- return textEditorImpl.IsDirty;
- }
- set {
- textEditorImpl.IsDirty = value;
- }
+ protected override void OnSetProject (MonoDevelop.Projects.Project project)
+ {
+ base.OnSetProject (project);
+ textEditorImpl.ViewContent.Project = project;
+ UpdateTextEditorOptions (null, null);
}
- bool IViewContent.IsReadOnly {
+ public override ProjectReloadCapability ProjectReloadCapability {
get {
- return textEditorImpl.IsReadOnly;
+ return textEditorImpl.ViewContent.ProjectReloadCapability;
}
}
#endregion
- #region IBaseViewContent implementation
- object IBaseViewContent.GetContent (Type type)
- {
- if (type.IsAssignableFrom (typeof(TextEditor)))
- return textEditor;
- var ext = textEditorImpl.EditorExtension;
- while (ext != null) {
- if (type.IsInstanceOfType (ext))
- return ext;
- ext = ext.Next;
- }
- return textEditorImpl.GetContent (type);
- }
+ #region BaseViewContent implementation
- public virtual IEnumerable<T> GetContents<T> () where T : class
+ protected override IEnumerable<object> OnGetContents (Type type)
{
- if (typeof(T) == typeof(TextEditor)) {
- yield return (T)(object)textEditor;
- yield break;
- }
- var result = this as T;
- if (result != null) {
- yield return result;
- }
+ var res = base.OnGetContents (type);
+
+ if (type == typeof (TextEditor))
+ return res.Concat (textEditor);
+
var ext = textEditorImpl.EditorExtension;
while (ext != null) {
- result = ext as T;
- if (result != null) {
- yield return result;
- }
+ res = res.Concat (ext.OnGetContents (type));
ext = ext.Next;
}
- foreach (var cnt in textEditorImpl.GetContents<T> ()) {
- yield return cnt;
- }
+ res = res.Concat (textEditorImpl.ViewContent.GetContents (type));
+ return res;
}
- bool IBaseViewContent.CanReuseView (string fileName)
+ protected override void OnWorkbenchWindowChanged ()
{
- return textEditorImpl.CanReuseView (fileName);
+ base.OnWorkbenchWindowChanged ();
+ textEditorImpl.ViewContent.WorkbenchWindow = WorkbenchWindow;
}
- void IBaseViewContent.RedrawContent ()
- {
- textEditorImpl.RedrawContent ();
- }
-
- IWorkbenchWindow IBaseViewContent.WorkbenchWindow {
- get {
- return textEditorImpl.WorkbenchWindow;
- }
- set {
- textEditorImpl.WorkbenchWindow = value;
- }
- }
-
- Gtk.Widget IBaseViewContent.Control {
+ public override Control Control {
get {
return textEditor;
}
}
- string IBaseViewContent.TabPageLabel {
+ public override string TabPageLabel {
get {
- return textEditorImpl.TabPageLabel;
+ return textEditorImpl.ViewContent.TabPageLabel;
}
}
@@ -618,13 +477,17 @@ namespace MonoDevelop.Ide.Editor
#region IDisposable implementation
bool isDisposed;
- void IDisposable.Dispose ()
+
+ public override void Dispose ()
{
if (isDisposed)
return;
+
+ base.Dispose ();
+
isDisposed = true;
CancelDocumentParsedUpdate ();
- textEditorImpl.DirtyChanged -= HandleDirtyChanged;
+ textEditorImpl.ViewContent.DirtyChanged -= HandleDirtyChanged;
textEditor.MimeTypeChanged -= UpdateTextEditorOptions;
textEditor.TextChanged -= HandleTextChanged;
textEditor.DocumentContextChanged -= HandleDocumentContextChanged;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs
index 0ab178ea0c..259bad2056 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs
@@ -100,7 +100,7 @@ namespace MonoDevelop.Ide.Editor
xalign = 0.5;
}
- public virtual Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Gdk.ModifierType modifierState)
+ public virtual Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
{
return null;
}
@@ -110,7 +110,7 @@ namespace MonoDevelop.Ide.Editor
return editor.GetContent<ITextEditorImpl> ().GetEditorAllocation ();
}
- void ShowTipInfoWindow (TextEditor editor, TooltipInformationWindow tipWindow, TooltipItem item, Gdk.ModifierType modifierState, int mouseX, int mouseY)
+ void ShowTipInfoWindow (TextEditor editor, TooltipInformationWindow tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY)
{
Gtk.Widget editorWidget = editor;
@@ -131,7 +131,7 @@ namespace MonoDevelop.Ide.Editor
tipWindow.ShowPopup (editorWidget, caret, PopupPosition.Top);
}
- public virtual void ShowTooltipWindow (TextEditor editor, Control tipWindow, TooltipItem item, Gdk.ModifierType modifierState, int mouseX, int mouseY)
+ public virtual void ShowTooltipWindow (TextEditor editor, Control tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY)
{
if (tipWindow == null)
return;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs
index 6fde8c756a..6a0ac1acfd 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs
@@ -44,7 +44,7 @@ namespace MonoDevelop.Ide.ExternalTools
{
ExternalToolPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new ExternalToolPanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs
index 57ad2848d0..91ad074358 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs
@@ -24,18 +24,19 @@
// 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.Collections.Generic;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Core;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Commands;
using System.Threading;
-
+using MonoDevelop.Components;
+
namespace MonoDevelop.Ide.FindInFiles
{
- public class SearchResultPad : AbstractPadContent
+ public class SearchResultPad : PadContent
{
readonly SearchResultWidget widget = new SearchResultWidget ();
@@ -45,7 +46,7 @@ namespace MonoDevelop.Ide.FindInFiles
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return widget;
}
@@ -95,7 +96,7 @@ namespace MonoDevelop.Ide.FindInFiles
widget.AddRange (results);
}
- public override void Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
window.Icon = Stock.FindIcon;
base.Initialize (window);
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 d6c91dd71d..ba3f8f9c5e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
@@ -44,7 +44,7 @@ using System.Threading;
using MonoDevelop.Ide.Editor;
using MonoDevelop.Core.Text;
using MonoDevelop.Ide.Editor.Highlighting;
-
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.FindInFiles
{
@@ -828,9 +828,9 @@ namespace MonoDevelop.Ide.FindInFiles
{
}
- protected override Gui.Document DoShow ()
+ protected override async Task<Gui.Document> DoShow ()
{
- var doc = base.DoShow ();
+ var doc = await base.DoShow ();
if (doc == null)
return null;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanel.cs
index 810820ff66..af8be3166b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanel.cs
@@ -24,7 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.Ide.Fonts
@@ -33,7 +33,7 @@ namespace MonoDevelop.Ide.Fonts
{
FontChooserPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new FontChooserPanelWidget ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPathedDocument.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPathedDocument.cs
index 8491b1fd68..d7df693e08 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPathedDocument.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPathedDocument.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.Ide.Gui.Content
{
PathEntry[] CurrentPath { get; }
- Gtk.Widget CreatePathWidget (int index);
+ Control CreatePathWidget (int index);
event EventHandler<DocumentPathChangedEventArgs> PathChanged;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs
index 85be8e40f3..6ebee7c490 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs
@@ -6,6 +6,7 @@ using Gtk;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Gui.Dialogs
{
@@ -35,7 +36,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
if (!doc.IsDirty)
continue;
- IViewContent viewcontent = doc.Window.ViewContent;
+ ViewContent viewcontent = doc.Window.ViewContent;
if (groupByProject && viewcontent.Project != null) {
TreeIter projIter = TreeIter.Zero;
@@ -121,19 +122,28 @@ namespace MonoDevelop.Ide.Gui.Dialogs
base.OnDestroyed ();
}
- void SaveAndQuit (object o, EventArgs e)
+ async void SaveAndQuit (object o, EventArgs e)
{
+ Sensitive = false;
+
+ List<Task> saveTasks = new List<Task> ();
tsFiles.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter) {
var window = tsFiles.GetValue (iter, 2) as SdiWorkspaceWindow;
if (window == null)
return false;
if ((bool)tsFiles.GetValue (iter, 1)) {
- window.ViewContent.Save (window.ViewContent.ContentName);
+ saveTasks.Add (window.ViewContent.Save (window.ViewContent.ContentName));
} else {
window.ViewContent.DiscardChanges ();
}
return false;
});
+
+ try {
+ await Task.WhenAll (saveTasks);
+ } finally {
+ Sensitive = true;
+ }
Respond (Gtk.ResponseType.Ok);
Hide ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs
index 79deec486f..bdac2a013f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.Ide.Gui.Dialogs
{
- public class FeedbackDialog: Gtk.Window
+ class FeedbackDialog: Gtk.Window
{
Gtk.VBox mainBox;
EntryWithEmptyMessage mailEntry;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IOptionsPanel.cs
index 1dde9bf57f..167195dde8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IOptionsPanel.cs
@@ -26,7 +26,7 @@
//
using System;
-using Gtk;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Dialogs
{
@@ -34,7 +34,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
void Initialize (OptionsDialog dialog, object dataObject);
- Widget CreatePanelWidget ();
+ Control CreatePanelWidget ();
bool IsVisible ();
bool ValidateChanges ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsDialog.cs
index e37db85cab..f7b322d16f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsDialog.cs
@@ -27,6 +27,7 @@
using System;
using Mono.Addins;
+using MonoDevelop.Components;
using MonoDevelop.Projects.Extensions;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -39,7 +40,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
}
- public ItemOptionsDialog (Gtk.Window parentWindow, object dataObject)
+ public ItemOptionsDialog (Window parentWindow, object dataObject)
: base (parentWindow, dataObject, "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels")
{
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs
index 572534d795..2ea4007ad8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs
@@ -30,6 +30,7 @@ using Gtk;
using System.Linq;
using Mono.Addins;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -86,7 +87,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
isRoot = false;
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
HBox hbox = new HBox (false, 6);
Label label = new Label ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsDialog.cs
index 4740234477..fbb3459202 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsDialog.cs
@@ -27,6 +27,7 @@
using System;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -43,7 +44,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
}
- public MultiConfigItemOptionsDialog (Gtk.Window parentWindow, object dataObject): base (parentWindow, dataObject)
+ public MultiConfigItemOptionsDialog (Window parentWindow, object dataObject): base (parentWindow, dataObject)
{
IConfigurationTarget ct = DataObject as IConfigurationTarget;
if (ct == null)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs
index a199f98283..84125c5e78 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -96,7 +97,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
}
}
- Gtk.Widget IOptionsPanel.CreatePanelWidget ()
+ Control IOptionsPanel.CreatePanelWidget ()
{
Gtk.VBox cbox = new Gtk.VBox (false, 6);
Gtk.HBox combosBox = new Gtk.HBox (false, 6);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs
index b7996ce62d..49c62300eb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs
@@ -82,10 +82,10 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
}
- public OptionsDialog (Gtk.Window parentWindow, object dataObject, string extensionPath) : this (parentWindow, dataObject, extensionPath, true)
+ public OptionsDialog (MonoDevelop.Components.Window parentWindow, object dataObject, string extensionPath) : this (parentWindow, dataObject, extensionPath, true)
{}
- public OptionsDialog (Gtk.Window parentWindow, object dataObject, string extensionPath, bool removeEmptySections)
+ public OptionsDialog (MonoDevelop.Components.Window parentWindow, object dataObject, string extensionPath, bool removeEmptySections)
{
buttonCancel = new Gtk.Button (Gtk.Stock.Cancel);
AddActionWidget (this.buttonCancel, ResponseType.Cancel);
@@ -241,7 +241,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
}
}
- protected Gtk.Widget MainBox {
+ protected Control MainBox {
get { return pageFrame; }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsPanel.cs
index 629f8e80b3..231af21a07 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsPanel.cs
@@ -26,7 +26,7 @@
//
using System;
-using Gtk;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Dialogs
{
@@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
this.dataObject = dataObject;
}
- public abstract Widget CreatePanelWidget ();
+ public abstract Control CreatePanelWidget ();
public virtual bool IsVisible ()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs
index c0f9a85b3a..3425865f84 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs
@@ -31,6 +31,7 @@ using System.Collections.Generic;
using Gtk;
using System.Linq;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -56,7 +57,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
}
- Widget IOptionsPanel.CreatePanelWidget ()
+ Control IOptionsPanel.CreatePanelWidget ()
{
HBox hbox = new HBox (false, 6);
Label label = new Label ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs
index 52d41f001d..116b2789c9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs
@@ -25,8 +25,9 @@
// THE SOFTWARE.
using System;
-using Gtk;
using System.Collections.Generic;
+using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using System.Threading;
@@ -47,7 +48,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
}
- public ProgressDialog (Window parent, bool allowCancel, bool showDetails)
+ public ProgressDialog (MonoDevelop.Components.Window parent, bool allowCancel, bool showDetails)
{
this.Build ();
this.Title = BrandingService.ApplicationName;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs
index 11909769fa..aa2cffd702 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs
@@ -32,7 +32,7 @@ using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Ide.Gui.Dialogs
{
- public partial class SelectFileFormatDialog : Gtk.Dialog
+ partial class SelectFileFormatDialog : Gtk.Dialog
{
List<MSBuildFileFormat> formats = new List<MSBuildFileFormat> ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs
index c9c80eed25..391e56cc8e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs
@@ -35,7 +35,6 @@ using MonoDevelop.Core;
using Mono.Addins;
using MonoDevelop.Projects;
-using Gtk;
using MonoDevelop.Components;
using MonoDevelop.Core.Setup;
using MonoDevelop.Ide.Updater;
@@ -51,7 +50,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
return !AddinManager.IsAddinLoaded ("MonoDevelop.Xamarin.Ide");
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new AddInsPanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs
index 33344a8e0f..3fb3386763 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs
@@ -26,7 +26,7 @@
using System;
using System.Collections.Generic;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -36,7 +36,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
AssemblyFoldersPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new AssemblyFoldersPanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs
index 5be3812412..5794110212 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs
@@ -27,6 +27,7 @@
//
using System;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Projects;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -37,8 +38,8 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
AuthorInformationPanelWidget widget;
Solution solution;
-
- public override Gtk.Widget CreatePanelWidget ()
+
+ public override Control CreatePanelWidget ()
{
return widget = new AuthorInformationPanelWidget (solution.LocalAuthorInformation);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs
index 5c4b193e2c..c833527b69 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs
@@ -25,9 +25,9 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
-using Gtk;
namespace MonoDevelop.Ide.Gui.OptionPanels
{
@@ -36,7 +36,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
BuildMessagePanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new BuildMessagePanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs
index bac0ec7fb6..0e68a80066 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs
@@ -27,7 +27,7 @@
using System;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects.MSBuild;
@@ -37,7 +37,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
BuildPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new BuildPanelWidget ());
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs
index 51c97c3afd..6f7b9c48e9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs
@@ -27,6 +27,7 @@
//
using System;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -36,8 +37,8 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
class GlobalAuthorInformationPanel : OptionsPanel
{
GlobalAuthorInformationPanelWidget widget;
-
- public override Gtk.Widget CreatePanelWidget ()
+
+ public override Control CreatePanelWidget ()
{
return widget = new GlobalAuthorInformationPanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs
index 7295a53802..560d7ef057 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs
@@ -31,11 +31,11 @@ using System;
using System.Collections;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Components.Commands;
using Mono.Addins;
-using Gtk;
using System.Linq;
namespace MonoDevelop.Ide.Gui.OptionPanels
@@ -44,7 +44,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
IDEStyleOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new IDEStyleOptionsPanelWidget ();
}
@@ -55,7 +55,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
}
}
- public partial class IDEStyleOptionsPanelWidget : Gtk.Bin
+ partial class IDEStyleOptionsPanelWidget : Gtk.Bin
{
static Lazy<List<string>> themes = new Lazy<List<string>> (() => {
var searchDirs = new List<string> ();
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 f1754c228c..38f1e0c420 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
@@ -217,7 +217,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
KeyBindingService.SaveCurrentBindings ();
}
- public Gtk.Widget CreatePanelWidget ()
+ public Control CreatePanelWidget ()
{
SortedDictionary<string, Command> commands = new SortedDictionary<string, Command> ();
string translatedOther = GettextCatalog.GetString ("Other");
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs
index 96a007e013..2266b7d19b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs
@@ -36,7 +36,6 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
-using Gtk;
using MonoDevelop.Components;
#pragma warning disable 612
@@ -54,7 +53,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
LoadSavePanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new LoadSavePanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
index ba485c2d81..b50e0ea557 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
@@ -27,6 +27,7 @@
using System;
using Gtk;
using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Core.LogReporting;
@@ -36,7 +37,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
LogAgentPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new LogAgentPanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs
index 334c99bba3..39676d4217 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs
@@ -25,8 +25,8 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
-using Gtk;
namespace MonoDevelop.Ide.Gui.OptionPanels
{
@@ -34,7 +34,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
MaintenanceOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new MaintenanceOptionsPanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs
index 3a5f86ff36..fd70f5f9b0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
MonoRuntimePanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new MonoRuntimePanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs
index 61f8b7326b..41d3d64cbc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs
@@ -39,7 +39,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
SdkLocationWidget w;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return w = new SdkLocationWidget (this);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs
index 30e9d24939..4ecc709367 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs
@@ -215,7 +215,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
TasksPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new TasksPanelWidget ();
widget.Load ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs
index 4135b233d5..d6bd13b7d2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs
@@ -25,6 +25,7 @@
//THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects.Policies;
using MonoDevelop.Ide.Projects;
@@ -38,7 +39,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
TextStylePolicyPanelWidget widget;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new TextStylePolicyPanelWidget (this);
widget.Show ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs
index cce9569a07..6c49cf3f8a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs
@@ -32,6 +32,7 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui.Components;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Pads.ClassBrowser
{
@@ -39,13 +40,13 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassBrowser
{
ClassBrowserPadWidget widget;
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return widget;
}
}
- public override void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
base.Initialize (container);
this.widget = new ClassBrowserPadWidget (base.TreeView, container);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
index 6dbdbbf110..6bcec43c58 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
@@ -191,7 +191,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (file.Project != null)
newProjectFile = file.Project.Files.GetFileWithVirtualPath (newPath.ToRelative (file.Project.BaseDirectory));
- if (!FileService.IsValidPath (newPath)) {
+ if (!FileService.IsValidPath (newPath) || ProjectFolderCommandHandler.ContainsDirectorySeparator (newName)) {
MessageService.ShowWarning (GettextCatalog.GetString ("The name you have chosen contains illegal characters. Please choose a different name."));
} else if ((newProjectFile != null && newProjectFile != file) || File.Exists (file.FilePath.ParentDirectory.Combine (newName))) {
// If there is already a file under the newPath which is *different*, then throw an exception
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs
index 89bc9dbf4b..ebe5b7fd6a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs
@@ -151,7 +151,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (oldFoldername != newFoldername) {
try {
- if (!FileService.IsValidPath (newFoldername)) {
+ if (!FileService.IsValidPath (newFoldername) || ContainsDirectorySeparator (newName)) {
MessageService.ShowWarning (GettextCatalog.GetString ("The name you have chosen contains illegal characters. Please choose a different name."));
return;
}
@@ -177,7 +177,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
}
}
-
+
public override void DeleteMultipleItems ()
{
var projects = new Set<SolutionItem> ();
@@ -370,6 +370,10 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
return true;
return false;
}
-
+
+ internal static bool ContainsDirectorySeparator (string name)
+ {
+ return name.Contains (Path.DirectorySeparatorChar) || name.Contains (Path.AltDirectorySeparatorChar);
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs
index 2188ddec1f..54834f3f25 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs
@@ -100,7 +100,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
string newname = Path.Combine (Path.GetDirectoryName (oldname), newName);
if (newname != oldname) {
try {
- if (!FileService.IsValidPath (newname)) {
+ if (!FileService.IsValidPath (newname) || ProjectFolderCommandHandler.ContainsDirectorySeparator (newName)) {
MessageService.ShowWarning (GettextCatalog.GetString ("The name you have chosen contains illegal characters. Please choose a different name."));
} else if (File.Exists (newname) || Directory.Exists (newname)) {
MessageService.ShowWarning (GettextCatalog.GetString ("File or directory name is already in use. Please choose a different one."));
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs
index bc1a5848e5..7d51b9571e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs
@@ -41,12 +41,12 @@ using Pango;
using MonoDevelop.Components.Docking;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Core.Execution;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Pads
{
- internal class DefaultMonitorPad : IPadContent
+ internal class DefaultMonitorPad : PadContent
{
- IPadWindow window;
LogView logView;
Button buttonStop;
ToggleButton buttonPin;
@@ -56,7 +56,6 @@ namespace MonoDevelop.Ide.Gui.Pads
Pad statusSourcePad;
string icon;
- string id;
int instanceNum;
string typeTag;
@@ -72,15 +71,14 @@ namespace MonoDevelop.Ide.Gui.Pads
IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed;
- Control.ShowAll ();
+ logView.ShowAll ();
}
- void IPadContent.Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
- this.window = window;
window.Icon = icon;
- DockItemToolbar toolbar = window.GetToolbar (PositionType.Right);
+ DockItemToolbar toolbar = window.GetToolbar (DockPositionType.Right);
buttonStop = new Button (new Gtk.Image (Stock.Stop, IconSize.Menu));
buttonStop.Clicked += new EventHandler (OnButtonStopClick);
@@ -105,10 +103,6 @@ namespace MonoDevelop.Ide.Gui.Pads
get { return logView; }
}
- public IPadWindow Window {
- get { return this.window; }
- }
-
public Pad StatusSourcePad {
get { return this.statusSourcePad; }
set { this.statusSourcePad = value; }
@@ -158,9 +152,9 @@ namespace MonoDevelop.Ide.Gui.Pads
monitor = (LogViewProgressMonitor) logView.GetProgressMonitor ();
Runtime.RunInMainThread (delegate {
- window.HasNewData = false;
- window.HasErrors = false;
- window.IsWorking = true;
+ Window.HasNewData = false;
+ Window.HasErrors = false;
+ Window.IsWorking = true;
buttonStop.Sensitive = true;
});
@@ -174,16 +168,16 @@ namespace MonoDevelop.Ide.Gui.Pads
public void EndProgress ()
{
Runtime.RunInMainThread (delegate {
- if (window != null) {
- window.IsWorking = false;
+ if (Window != null) {
+ Window.IsWorking = false;
if (monitor.Errors.Length > 0)
- window.HasErrors = true;
+ Window.HasErrors = true;
else
- window.HasNewData = true;
+ Window.HasNewData = true;
}
buttonStop.Sensitive = false;
progressStarted = false;
- if (window == null)
+ if (Window == null)
buttonClear.Sensitive = false;
if (monitor.Errors.Length > 0) {
@@ -199,15 +193,10 @@ namespace MonoDevelop.Ide.Gui.Pads
});
}
- public virtual Gtk.Widget Control {
+ public override Control Control {
get { return logView; }
}
- public string Id {
- get { return id; }
- set { id = value; }
- }
-
public string DefaultPlacement {
get { return "Bottom"; }
}
@@ -224,15 +213,11 @@ namespace MonoDevelop.Ide.Gui.Pads
}
}
- public virtual void Dispose ()
+ public override void Dispose ()
{
logView.Clear ();
IdeApp.Workspace.FirstWorkspaceItemOpened -= OnCombineOpen;
IdeApp.Workspace.LastWorkspaceItemClosed -= OnCombineClosed;
}
-
- public void RedrawContent()
- {
- }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs
index 4f0f62f435..b99fa3753c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs
@@ -53,7 +53,7 @@ using System.Linq;
namespace MonoDevelop.Ide.Gui.Pads
{
- class ErrorListPad : IPadContent
+ class ErrorListPad : PadContent
{
HPaned control;
ScrolledWindow sw;
@@ -70,7 +70,6 @@ namespace MonoDevelop.Ide.Gui.Pads
int warningCount;
int infoCount;
bool initialLogShow = true;
- IPadWindow window;
Menu menu;
Dictionary<ToggleAction, int> columnsActions = new Dictionary<ToggleAction, int> ();
@@ -107,7 +106,7 @@ namespace MonoDevelop.Ide.Gui.Pads
internal const int Category = 7;
}
- public Gtk.Widget Control {
+ public override Control Control {
get {
if (control == null)
CreateControl ();
@@ -115,16 +114,15 @@ namespace MonoDevelop.Ide.Gui.Pads
}
}
- public string Id {
+ public override string Id {
get { return "MonoDevelop.Ide.Gui.Pads.ErrorListPad"; }
}
- void IPadContent.Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
- this.window = window;
window.Title = GettextCatalog.GetString ("Errors");
- DockItemToolbar toolbar = window.GetToolbar (PositionType.Top);
+ DockItemToolbar toolbar = window.GetToolbar (DockPositionType.Top);
errorBtn = new ToggleButton { Name = "toggleErrors" };
errorBtn.Active = ShowErrors;
@@ -234,7 +232,7 @@ namespace MonoDevelop.Ide.Gui.Pads
outputView = new LogView { Name = "buildOutput" };
control.Add2 (outputView);
- Control.ShowAll ();
+ control.ShowAll ();
control.SizeAllocated += HandleControlSizeAllocated;
@@ -318,10 +316,6 @@ namespace MonoDevelop.Ide.Gui.Pads
{
PropertyService.Set ("Monodevelop.ErrorListColumns", string.Join (";", view.Columns.Select (c => c.Visible ? "TRUE" : "FALSE")));
}
-
- public void RedrawContent()
- {
- }
Gtk.Menu CreateMenu ()
{
@@ -727,10 +721,6 @@ namespace MonoDevelop.Ide.Gui.Pads
Clear();
}
- public void Dispose ()
- {
- }
-
void OnRowActivated (object o, RowActivatedArgs args)
{
OnTaskJumpto (null, null);
@@ -883,11 +873,11 @@ namespace MonoDevelop.Ide.Gui.Pads
void UpdatePadIcon ()
{
if (errorCount > 0)
- window.Icon = "md-errors-list-has-errors";
+ Window.Icon = "md-errors-list-has-errors";
else if (warningCount > 0)
- window.Icon = "md-errors-list-has-warnings";
+ Window.Icon = "md-errors-list-has-warnings";
else
- window.Icon = "md-errors-list";
+ Window.Icon = "md-errors-list";
}
private void ItemToggled (object o, ToggledArgs args)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs
index 0eb985da7d..07388bac91 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs
@@ -35,10 +35,11 @@ using Monodoc;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Pads
{
- internal class HelpTree : AbstractPadContent
+ internal class HelpTree : PadContent
{
TreeStore store;
MonoDevelop.Ide.Gui.Components.PadTreeView tree_view;
@@ -78,7 +79,7 @@ namespace MonoDevelop.Ide.Gui.Pads
} while (store.IterNext (ref child_iter));
}
}
- Control.ShowAll ();
+ scroller.ShowAll ();
}
Hashtable populated = new Hashtable ();
@@ -126,7 +127,7 @@ namespace MonoDevelop.Ide.Gui.Pads
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get { return scroller; }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TaskListPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TaskListPad.cs
index 4f7b747dce..1836978ab0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TaskListPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TaskListPad.cs
@@ -41,10 +41,11 @@ using MonoDevelop.Projects;
using Gtk;
using Gdk;
using MonoDevelop.Components.Docking;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Pads
{
- class TaskListPad : IPadContent
+ class TaskListPad : PadContent
{
Widget control;
ITaskListView activeView;
@@ -58,31 +59,20 @@ namespace MonoDevelop.Ide.Gui.Pads
//content view
ScrolledWindow sw;
- public Gtk.Widget Control {
+ public override Control Control {
get {
return control;
}
}
- public string Id {
- get { return "MonoDevelop.Ide.Gui.Pads.TaskListPad"; }
- }
-
public string DefaultPlacement {
get { return "Bottom"; }
}
- public void RedrawContent()
- {
- control.QueueDraw ();
- }
-
- public void Dispose ()
- {
- }
-
public TaskListPad ()
- {
+ {
+ Id = "MonoDevelop.Ide.Gui.Pads.TaskListPad";
+
VBox vbox = new VBox ();
switcherComboList = new ListStore (typeof (string), typeof (ITaskListView), typeof (string));
@@ -127,9 +117,9 @@ namespace MonoDevelop.Ide.Gui.Pads
switcherCombo.Active = pos;
}
- void IPadContent.Initialize (IPadWindow window)
+ override protected void Initialize (IPadWindow window)
{
- toolbar = window.GetToolbar (PositionType.Top);
+ toolbar = window.GetToolbar (DockPositionType.Top);
toolbar.Add (switcherCombo);
toolbar.ShowAll ();
switcherCombo.Changed += new EventHandler (OnContentSwitched);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs
index 421845feda..281911c168 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs
@@ -38,7 +38,7 @@ namespace MonoDevelop.Ide.Gui.Pads
/// <summary>
/// This class implements a project browser.
/// </summary>
- public class TreeViewPad : AbstractPadContent, IMementoCapable, ICommandDelegatorRouter
+ public class TreeViewPad : PadContent, IMementoCapable, ICommandDelegatorRouter
{
internal Action Initializer;
@@ -50,7 +50,7 @@ namespace MonoDevelop.Ide.Gui.Pads
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return treeView;
}
@@ -62,7 +62,7 @@ namespace MonoDevelop.Ide.Gui.Pads
treeView.Tree.EnableAutoTooltips ();
}
- public override void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
base.Initialize (container);
TreeView.Id = Id;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs
deleted file mode 100644
index 8c441c2e52..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-// AbstractBaseViewContent.cs
-//
-// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
-//
-// Copyright (c) 2009 RemObjects Software
-//
-// 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;
-using System.Collections.Generic;
-using System.Text;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Ide.Gui
-{
- public abstract class AbstractBaseViewContent : IBaseViewContent
- {
- IWorkbenchWindow workbenchWindow = null;
-
- #region IBaseViewContent Members
-
- public abstract Gtk.Widget Control { get; }
-
- public virtual IWorkbenchWindow WorkbenchWindow {
- get { return workbenchWindow; }
- set {
- if (workbenchWindow != value) {
- workbenchWindow = value;
- OnWorkbenchWindowChanged (EventArgs.Empty);
- }
- }
- }
-
- public virtual string TabPageLabel { get { return GettextCatalog.GetString ("Content"); } }
-
- public virtual void RedrawContent ()
- {
- }
-
- public virtual bool CanReuseView (string fileName)
- {
- return false;
- }
-
- public virtual object GetContent (Type type)
- {
- if (type.IsInstanceOfType (this))
- return this;
- else
- return null;
- }
-
- public virtual IEnumerable<T> GetContents<T> () where T : class
- {
- var t = this as T;
- if (t != null)
- yield return t;
- }
-
-
- #endregion
-
- #region IDisposable Members
-
- public virtual void Dispose ()
- {
- }
-
- #endregion
-
- public event EventHandler WorkbenchWindowChanged;
-
- protected virtual void OnWorkbenchWindowChanged (EventArgs e)
- {
- if (WorkbenchWindowChanged != null) {
- WorkbenchWindowChanged (this, e);
- }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs
deleted file mode 100644
index 2000c9c0c4..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-// AbstractPadContent.cs
-//
-// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
-//
-// Copyright (c) 2009 RemObjects Software
-//
-// 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;
-using System.Collections.Generic;
-using System.Text;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Ide.Gui
-{
- public abstract class AbstractPadContent : IPadContent
- {
- protected AbstractPadContent () : this (null, null)
- {
- }
-
- public AbstractPadContent (string title) : this (title, null)
- {
- }
-
- private IconId icon;
- private string title;
- public AbstractPadContent (string title, IconId icon)
- {
- this.Id = GetType ().FullName;
- this.icon = icon;
- this.title = title;
- }
-
- public string Id { get; set; }
-
- private IPadWindow window = null;
- public IPadWindow Window {
- get { return window; }
- }
-
- #region IPadContent Members
-
- public virtual void Initialize (IPadWindow container)
- {
- if (title != null)
- container.Title = title;
-
- if (icon != IconId.Null)
- container.Icon = icon;
-
- window = container;
- }
-
- public abstract Gtk.Widget Control {
- get;
- }
-
- public virtual void RedrawContent ()
- {
- }
-
- #endregion
-
- #region IDisposable Members
-
- public virtual void Dispose ()
- {
- }
-
- #endregion
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BaseViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BaseViewContent.cs
new file mode 100644
index 0000000000..893bf654f2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BaseViewContent.cs
@@ -0,0 +1,167 @@
+// BaseViewContent.cs
+//
+// Author:
+// Viktoria Dudka (viktoriad@remobjects.com)
+//
+// Copyright (c) 2009 RemObjects Software
+//
+// 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;
+using System.Linq;
+using System.Collections.Generic;
+using System.Text;
+using MonoDevelop.Components;
+using MonoDevelop.Core;
+using System.Collections.Immutable;
+using MonoDevelop.Projects;
+using MonoDevelop.Components;
+
+namespace MonoDevelop.Ide.Gui
+{
+ public abstract class BaseViewContent : IDisposable
+ {
+ IWorkbenchWindow workbenchWindow;
+ Project project;
+
+ public abstract Control Control { get; }
+
+ public IWorkbenchWindow WorkbenchWindow {
+ get { return workbenchWindow; }
+ set {
+ if (workbenchWindow != value) {
+ workbenchWindow = value;
+ OnWorkbenchWindowChanged ();
+ }
+ }
+ }
+
+ public virtual string TabPageLabel {
+ get {
+ return GettextCatalog.GetString ("Content");
+ }
+ }
+
+ public virtual bool CanReuseView (string fileName)
+ {
+ return false;
+ }
+
+ public object GetContent (Type type)
+ {
+ return GetContents (type).FirstOrDefault ();
+ }
+
+ public T GetContent<T> () where T : class
+ {
+ return GetContents<T> ().FirstOrDefault ();
+ }
+
+ public IEnumerable<T> GetContents<T> () where T : class
+ {
+ return OnGetContents (typeof (T)).Cast<T> ();
+ }
+
+ public IEnumerable<object> GetContents (Type type)
+ {
+ return OnGetContents (type);
+ }
+
+ protected virtual object OnGetContent (Type type)
+ {
+ if (type.IsInstanceOfType (this))
+ return this;
+ else
+ return null;
+ }
+
+ protected virtual IEnumerable<object> OnGetContents (Type type)
+ {
+ var c = OnGetContent (type);
+ if (c != null)
+ yield return c;
+ }
+
+ public virtual void Dispose ()
+ {
+ }
+
+ protected virtual void OnWorkbenchWindowChanged ()
+ {
+ }
+
+ internal protected virtual void OnSelected ()
+ {
+ }
+
+ internal protected virtual void OnDeselected ()
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets the project bound to the view
+ /// </summary>
+ public Project Project {
+ get {
+ return project;
+ }
+ set {
+ OnSetProject (value);
+ }
+ }
+
+ /// <summary>
+ /// Called to update the project bound to the view.
+ /// </summary>
+ /// <param name="project">
+ /// New project assigned to the view. It can be null.
+ /// </param>
+ protected virtual void OnSetProject (Project project)
+ {
+ this.project = project;
+ }
+
+ /// <summary>
+ /// Gets the capability of this view for being reassigned a project
+ /// </summary>
+ /// <value>The project reload capability.</value>
+ public virtual ProjectReloadCapability ProjectReloadCapability {
+ get {
+ return ProjectReloadCapability.None;
+ }
+ }
+ }
+
+ public enum ProjectReloadCapability
+ {
+ None = 0,
+
+ /// <summary>
+ /// It can keep unsaved data. Some status (such as undo queue) may be lost.
+ /// </summary>
+ UnsavedData = 1,
+
+ /// <summary>
+ /// It can keep unsaved data and status.
+ /// </summary>
+ Full = 2
+ }
+}
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 6512708c1e..718f2fb8f4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
@@ -38,7 +38,7 @@ using MonoDevelop.Ide.Codons;
using MonoDevelop.Components.Commands;
using MonoDevelop.Components.Docking;
-using MonoDevelop.Components.DockToolbars;
+using GLib;
using Gtk;
using MonoDevelop.Components;
using MonoDevelop.Ide.Extensions;
@@ -68,7 +68,7 @@ namespace MonoDevelop.Ide.Gui
List<string> layouts = new List<string> ();
List<PadCodon> padContentCollection = new List<PadCodon> ();
- List<IViewContent> viewContentCollection = new List<IViewContent> ();
+ List<ViewContent> viewContentCollection = new List<ViewContent> ();
Dictionary<PadCodon, IPadWindow> padWindows = new Dictionary<PadCodon, IPadWindow> ();
Dictionary<IPadWindow, PadCodon> padCodons = new Dictionary<IPadWindow, PadCodon> ();
@@ -80,7 +80,7 @@ namespace MonoDevelop.Ide.Gui
Rectangle normalBounds = new Rectangle(0, 0, MinimumWidth, MinimumHeight);
Gtk.Container rootWidget;
- DockToolbarFrame toolbarFrame;
+ CommandFrame toolbarFrame;
DockFrame dock;
SdiDragNotebook tabControl;
Gtk.MenuBar topMenu;
@@ -173,7 +173,7 @@ namespace MonoDevelop.Ide.Gui
var oldLayout = dock.CurrentLayout;
InitializeLayout (value);
- toolbarFrame.CurrentLayout = dock.CurrentLayout = value;
+ dock.CurrentLayout = value;
DestroyFullViewLayouts (oldLayout);
@@ -195,7 +195,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- internal List<IViewContent> InternalViewContentCollection {
+ internal List<ViewContent> InternalViewContentCollection {
get {
Debug.Assert(viewContentCollection != null);
return viewContentCollection;
@@ -311,7 +311,7 @@ namespace MonoDevelop.Ide.Gui
topMenu = null;
}
- public void CloseContent (IViewContent content)
+ public void CloseContent (ViewContent content)
{
if (viewContentCollection.Contains(content)) {
if (content.Project != null)
@@ -324,8 +324,8 @@ namespace MonoDevelop.Ide.Gui
{
try {
closeAll = true;
- List<IViewContent> fullList = new List<IViewContent>(viewContentCollection);
- foreach (IViewContent content in fullList) {
+ List<ViewContent> fullList = new List<ViewContent>(viewContentCollection);
+ foreach (ViewContent content in fullList) {
IWorkbenchWindow window = content.WorkbenchWindow;
if (window != null)
window.CloseWindow(true);
@@ -336,7 +336,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- private Xwt.Drawing.Image PrepareShowView (IViewContent content)
+ private Xwt.Drawing.Image PrepareShowView (ViewContent content)
{
viewContentCollection.Add (content);
@@ -365,7 +365,7 @@ namespace MonoDevelop.Ide.Gui
return mimeimage;
}
- public virtual void ShowView (IViewContent content, bool bringToFront, IViewDisplayBinding binding = null, DockNotebook notebook = null)
+ public virtual void ShowView (ViewContent content, bool bringToFront, IViewDisplayBinding binding = null, DockNotebook notebook = null)
{
bool isFile = content.IsFile;
if (!isFile) {
@@ -538,7 +538,7 @@ namespace MonoDevelop.Ide.Gui
try {
IWorkbenchWindow window = ActiveWorkbenchWindow;
if (window != null) {
- if (window.ActiveViewContent.Control.Toplevel == this)
+ if (window.ActiveViewContent.Control.GetNativeWidget<Gtk.Widget> ().Toplevel == this)
Title = GetTitle (window);
} else {
Title = GetDefaultTitle ();
@@ -557,7 +557,7 @@ namespace MonoDevelop.Ide.Gui
return BrandingService.ApplicationName;
}
- public Properties GetStoredMemento (IViewContent content)
+ public Properties GetStoredMemento (ViewContent content)
{
if (content != null && content.ContentName != null) {
string directory = UserProfile.Current.CacheDir.Combine ("temp");
@@ -589,7 +589,6 @@ namespace MonoDevelop.Ide.Gui
}
memento.WindowState = GdkWindow.State;
memento.FullScreen = fullscreen;
- memento.ToolbarStatus = toolbarFrame.GetStatus ();
return memento.ToProperties ();
}
set {
@@ -611,7 +610,6 @@ namespace MonoDevelop.Ide.Gui
}
//GdkWindow.State = memento.WindowState;
FullScreen = memento.FullScreen;
- toolbarFrame.SetStatus (memento.ToolbarStatus);
}
Decorated = true;
}
@@ -621,15 +619,15 @@ namespace MonoDevelop.Ide.Gui
{
foreach (FileEventInfo e in args) {
if (e.IsDirectory) {
- IViewContent[] views = new IViewContent [viewContentCollection.Count];
+ ViewContent[] views = new ViewContent [viewContentCollection.Count];
viewContentCollection.CopyTo (views, 0);
- foreach (IViewContent content in views) {
+ foreach (ViewContent content in views) {
if (content.ContentName.StartsWith (e.FileName)) {
((SdiWorkspaceWindow)content.WorkbenchWindow).CloseWindow (true, true);
}
}
} else {
- foreach (IViewContent content in viewContentCollection) {
+ foreach (ViewContent content in viewContentCollection) {
if (content.ContentName != null &&
content.ContentName == e.FileName) {
((SdiWorkspaceWindow)content.WorkbenchWindow).CloseWindow (true, true);
@@ -644,13 +642,13 @@ namespace MonoDevelop.Ide.Gui
{
foreach (FileCopyEventInfo e in args) {
if (e.IsDirectory) {
- foreach (IViewContent content in viewContentCollection) {
+ foreach (ViewContent content in viewContentCollection) {
if (content.ContentName != null && ((FilePath)content.ContentName).IsChildPathOf (e.SourceFile)) {
content.ContentName = e.TargetFile.Combine (((FilePath) content.ContentName).FileName);
}
}
} else {
- foreach (IViewContent content in viewContentCollection) {
+ foreach (ViewContent content in viewContentCollection) {
if (content.ContentName != null &&
content.ContentName == e.SourceFile) {
content.ContentName = e.TargetFile;
@@ -702,7 +700,7 @@ namespace MonoDevelop.Ide.Gui
bool showDirtyDialog = false;
- foreach (IViewContent content in viewContentCollection)
+ foreach (ViewContent content in viewContentCollection)
{
if (content.IsDirty) {
showDirtyDialog = true;
@@ -836,7 +834,7 @@ namespace MonoDevelop.Ide.Gui
toolbarFrame.AddContent (hbox);
*/
- toolbarFrame.AddContent (dock);
+ toolbarFrame.Add (dock);
// Create the notebook for the various documents.
tabControl = new SdiDragNotebook (this);
@@ -866,21 +864,21 @@ namespace MonoDevelop.Ide.Gui
documentDockItem.Content = new DockNotebookContainer (tabControl, true);
DockVisualStyle style = new DockVisualStyle ();
- style.PadTitleLabelColor = Styles.PadLabelColor;
- style.PadBackgroundColor = Styles.PadBackground;
- style.InactivePadBackgroundColor = Styles.InactivePadBackground;
+ style.PadTitleLabelColor = Styles.PadLabelColor.ToXwtColor ();
+ style.PadBackgroundColor = Styles.PadBackground.ToXwtColor ();
+ style.InactivePadBackgroundColor = Styles.InactivePadBackground.ToXwtColor ();
style.PadTitleHeight = barHeight;
dock.DefaultVisualStyle = style;
style = new DockVisualStyle ();
- style.PadTitleLabelColor = Styles.PadLabelColor;
+ style.PadTitleLabelColor = Styles.PadLabelColor.ToXwtColor ();
style.PadTitleHeight = barHeight;
style.ShowPadTitleIcon = false;
style.UppercaseTitles = false;
style.ExpandedTabs = true;
- style.PadBackgroundColor = Styles.BrowserPadBackground;
- style.InactivePadBackgroundColor = Styles.InactiveBrowserPadBackground;
- style.TreeBackgroundColor = Styles.BrowserPadBackground;
+ style.PadBackgroundColor = Styles.BrowserPadBackground.ToXwtColor ();
+ style.InactivePadBackgroundColor = Styles.InactiveBrowserPadBackground.ToXwtColor ();
+ style.TreeBackgroundColor = Styles.BrowserPadBackground.ToXwtColor ();
dock.SetDockItemStyle ("ProjectPad", style);
dock.SetDockItemStyle ("ClassPad", style);
@@ -1010,11 +1008,6 @@ namespace MonoDevelop.Ide.Gui
IdeApp.Workbench.ReorderDocuments (oldPlacement, newPlacement);
}
- public void ResetToolbars ()
- {
- toolbarFrame.ResetToolbarPositions ();
- }
-
bool IsInFullViewMode {
get {
return dock.CurrentLayout.EndsWith (fullViewModeTag);
@@ -1056,7 +1049,6 @@ namespace MonoDevelop.Ide.Gui
{
if (oldLayout != null && oldLayout.EndsWith (fullViewModeTag)) {
dock.DeleteLayout (oldLayout);
- toolbarFrame.DeleteLayout (oldLayout);
}
}
@@ -1064,19 +1056,17 @@ namespace MonoDevelop.Ide.Gui
{
if (IsInFullViewMode) {
var oldLayout = dock.CurrentLayout;
- toolbarFrame.CurrentLayout = dock.CurrentLayout = CurrentLayout;
+ dock.CurrentLayout = CurrentLayout;
DestroyFullViewLayouts (oldLayout);
} else {
string fullViewLayout = CurrentLayout + fullViewModeTag;
if (!dock.HasLayout (fullViewLayout))
dock.CreateLayout (fullViewLayout, true);
- toolbarFrame.CurrentLayout = dock.CurrentLayout = fullViewLayout;
+ dock.CurrentLayout = fullViewLayout;
foreach (DockItem it in dock.GetItems ()) {
if (it.Behavior != DockItemBehavior.Locked && it.Visible)
it.Status = DockItemStatus.AutoHide;
}
- foreach (var tb in toolbarFrame.Toolbars)
- tb.Status = new DockToolbarStatus (tb.Id, false, tb.Position);
}
}
@@ -1277,18 +1267,12 @@ namespace MonoDevelop.Ide.Gui
void CreatePadContent (bool force, PadCodon padCodon, PadWindow window, DockItem item)
{
if (force || item.Content == null) {
- IPadContent newContent = padCodon.InitializePadContent (window);
+ PadContent newContent = padCodon.InitializePadContent (window);
- Gtk.Widget pcontent;
- if (newContent is Widget) {
- pcontent = newContent.Control;
- } else {
- PadCommandRouterContainer crc = new PadCommandRouterContainer (window, newContent.Control, newContent, true);
- crc.Show ();
- pcontent = crc;
- }
-
- PadCommandRouterContainer router = new PadCommandRouterContainer (window, pcontent, toolbarFrame, false);
+ Gtk.Widget crc = new PadCommandRouterContainer (window, newContent.Control, newContent, true);
+ crc.Show ();
+
+ Gtk.Widget router = new PadCommandRouterContainer (window, crc, toolbarFrame, false);
router.Show ();
item.Content = router;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs
index 9c2a7c1f3e..527ad99970 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs
@@ -130,7 +130,7 @@ namespace MonoDevelop.Ide.Gui
//dummy binding, anchor point for extension tree
class DefaultDisplayBinding : IViewDisplayBinding
{
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
{
throw new InvalidOperationException ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs
index 05d12d1be4..734a6f870b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs
@@ -29,6 +29,7 @@ using System.Drawing;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Codons;
using MonoDevelop.Core;
+using MonoDevelop.Components;
using MonoDevelop.Components.Docking;
using MonoDevelop.Components.Commands;
using Gtk;
@@ -38,7 +39,7 @@ namespace MonoDevelop.Ide.Gui
{
public static class DockItemToolbarLoader
{
- public static void Add (this DockItemToolbar toolbar, CommandEntrySet entrySet, Gtk.Widget commandTarget)
+ public static void Add (this DockItemToolbar toolbar, CommandEntrySet entrySet, Control commandTarget)
{
CommandDockBar dockBar = new CommandDockBar (toolbar, commandTarget);
foreach (CommandEntry entry in entrySet) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
index bf96b0db03..59890fa487 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
@@ -117,7 +117,13 @@ namespace MonoDevelop.Ide.Gui
return null;
}
-
+
+ internal ProjectReloadCapability ProjectReloadCapability {
+ get {
+ return Window.ViewContent.ProjectReloadCapability;
+ }
+ }
+
public override IEnumerable<T> GetContents<T> ()
{
foreach (var cnt in window.ViewContent.GetContents<T> ()) {
@@ -307,7 +313,7 @@ namespace MonoDevelop.Ide.Gui
viewsRO = null;
}
- DocumentView WrapView (IBaseViewContent content)
+ DocumentView WrapView (BaseViewContent content)
{
if (content == null)
return null;
@@ -319,7 +325,7 @@ namespace MonoDevelop.Ide.Gui
public override string Name {
get {
- IViewContent view = Window.ViewContent;
+ ViewContent view = Window.ViewContent;
return view.IsUntitled ? view.UntitledName : view.ContentName;
}
}
@@ -333,8 +339,13 @@ namespace MonoDevelop.Ide.Gui
public bool IsViewOnly {
get { return Window.ViewContent.IsViewOnly; }
}
-
- public void Reload ()
+
+ public Task Reload ()
+ {
+ return ReloadTask ();
+ }
+
+ async Task ReloadTask ()
{
ICustomXmlSerializer memento = null;
IMementoCapable mc = GetContent<IMementoCapable> ();
@@ -342,13 +353,18 @@ namespace MonoDevelop.Ide.Gui
memento = mc.Memento;
}
window.ViewContent.DiscardChanges ();
- window.ViewContent.Load (new FileOpenInformation (window.ViewContent.ContentName) { IsReloadOperation = true });
+ await window.ViewContent.Load (new FileOpenInformation (window.ViewContent.ContentName) { IsReloadOperation = true });
if (memento != null) {
mc.Memento = memento;
}
}
-
- public void Save ()
+
+ public Task Save ()
+ {
+ return SaveTask ();
+ }
+
+ async Task SaveTask ()
{
// suspend type service "check all file loop" since we have already a parsed document.
// Or at least one that updates "soon".
@@ -358,32 +374,32 @@ namespace MonoDevelop.Ide.Gui
return;
if (!Window.ViewContent.IsFile) {
- Window.ViewContent.Save ();
+ await Window.ViewContent.Save ();
return;
}
if (Window.ViewContent.ContentName == null) {
SaveAs ();
} else {
- try {
- FileService.RequestFileEdit (Window.ViewContent.ContentName, true);
+ try {
+ FileService.RequestFileEdit ((FilePath)Window.ViewContent.ContentName, true);
} catch (Exception ex) {
MessageService.ShowError (GettextCatalog.GetString ("The file could not be saved."), ex.Message, ex);
}
FileAttributes attr = FileAttributes.ReadOnly | FileAttributes.Directory | FileAttributes.Offline | FileAttributes.System;
- if (!File.Exists (Window.ViewContent.ContentName) || (File.GetAttributes (window.ViewContent.ContentName) & attr) != 0) {
- SaveAs ();
+ if (!File.Exists ((string)Window.ViewContent.ContentName) || (File.GetAttributes ((string)window.ViewContent.ContentName) & attr) != 0) {
+ SaveAs();
} else {
string fileName = Window.ViewContent.ContentName;
// save backup first
- if (IdeApp.Preferences.CreateFileBackupCopies) {
- Window.ViewContent.Save (fileName + "~");
- FileService.NotifyFileChanged (fileName);
- }
- Window.ViewContent.Save (fileName);
- OnSaved (EventArgs.Empty);
+ if (IdeApp.Preferences.CreateFileBackupCopies) {
+ await Window.ViewContent.Save (fileName + "~");
+ FileService.NotifyFileChanged (fileName);
+ }
+ await Window.ViewContent.Save (fileName);
+ OnSaved(EventArgs.Empty);
}
}
} finally {
@@ -405,17 +421,21 @@ namespace MonoDevelop.Ide.Gui
}
}
- public void SaveAs ()
+ public Task SaveAs ()
{
- SaveAs (null);
+ return SaveAs (null);
}
-
- public void SaveAs (string filename)
+
+ public Task SaveAs (string filename)
+ {
+ return SaveAsTask (filename);
+ }
+
+ async Task SaveAsTask (string filename)
{
if (Window.ViewContent.IsViewOnly || !Window.ViewContent.IsFile)
return;
-
Encoding encoding = null;
var tbuffer = GetContent <ITextSource> ();
@@ -434,8 +454,8 @@ namespace MonoDevelop.Ide.Gui
if (Window.ViewContent.IsUntitled)
dlg.InitialFileName = Window.ViewContent.UntitledName;
else {
- dlg.CurrentFolder = Path.GetDirectoryName (Window.ViewContent.ContentName);
- dlg.InitialFileName = Path.GetFileName (Window.ViewContent.ContentName);
+ dlg.CurrentFolder = Path.GetDirectoryName ((string)Window.ViewContent.ContentName);
+ dlg.InitialFileName = Path.GetFileName ((string)Window.ViewContent.ContentName);
}
if (!dlg.Run ())
@@ -460,15 +480,15 @@ namespace MonoDevelop.Ide.Gui
if (tbuffer != null && encoding != null)
TextFileUtility.WriteText (filename + "~", tbuffer.Text, encoding, tbuffer.UseBOM);
else
- Window.ViewContent.Save (new FileSaveInformation (filename + "~", encoding));
+ await Window.ViewContent.Save (new FileSaveInformation (filename + "~", encoding));
}
TypeSystemService.RemoveSkippedfile (FileName);
// do actual save
- Window.ViewContent.Save (new FileSaveInformation (filename, encoding));
+ await Window.ViewContent.Save (new FileSaveInformation (filename, encoding));
DesktopService.RecentFiles.AddFile (filename, (Project)null);
OnSaved (EventArgs.Empty);
- UpdateParseDocument ();
+ await UpdateParseDocument ();
}
public bool Close ()
@@ -668,13 +688,11 @@ namespace MonoDevelop.Ide.Gui
UnloadAdhocProject ();
if (adhocProject == null)
analysisDocument = null;
- ISupportsProjectReload pr = GetContent<ISupportsProjectReload> ();
- if (pr != null) {
+ if (Window.ViewContent.ProjectReloadCapability != ProjectReloadCapability.None) {
// Unsubscribe project events
if (Window.ViewContent.Project != null)
Window.ViewContent.Project.Modified -= HandleProjectModified;
Window.ViewContent.Project = project;
- pr.Update (project);
}
if (project != null)
project.Modified += HandleProjectModified;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs
index 5dfd8bdaf1..d4304a7bbb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using System.Linq;
using Gtk;
using MonoDevelop.Components;
@@ -48,29 +49,30 @@ namespace MonoDevelop.Ide.Gui
frame = al;
}
- internal Widget Container {
+ internal Control Container {
get { return frame; }
}
- public void Add (Widget widget)
+ public void Add (Control widget)
{
Add (widget, false);
}
- public void Add (Widget widget, bool fill)
+ public void Add (Control widget, bool fill)
{
Add (widget, fill, -1);
}
- public void Add (Widget widget, bool fill, int padding)
+ public void Add (Control widget, bool fill, int padding)
{
Add (widget, fill, padding, -1);
}
- void Add (Widget widget, bool fill, int padding, int index)
+ void Add (Control control, bool fill, int padding, int index)
{
int defaultPadding = 3;
+ Gtk.Widget widget = control;
if (widget is Button) {
((Button)widget).Relief = ReliefStyle.None;
((Button)widget).FocusOnClick = false;
@@ -116,12 +118,12 @@ namespace MonoDevelop.Ide.Gui
}
}
- public void Insert (Widget w, int index)
+ public void Insert (Control w, int index)
{
Add (w, false, 0, index);
}
- public void Remove (Widget widget)
+ public void Remove (Control widget)
{
box.Remove (widget);
}
@@ -145,8 +147,8 @@ namespace MonoDevelop.Ide.Gui
frame.ShowAll ();
}
- public Widget[] Children {
- get { return box.Children; }
+ public Control[] Children {
+ get { return box.Children.Select (w => (Control)w).ToArray (); }
}
class ToolbarBox: Gtk.Alignment
@@ -177,19 +179,73 @@ namespace MonoDevelop.Ide.Gui
}
}
- public class DocumentToolButton: Gtk.Button
+ public class DocumentToolButton : Control
{
- public DocumentToolButton (string stockId)
+ public DocumentToolButtonImage Image {
+ get { return (Gtk.Image)button.Image; }
+ set { button.Image = value; }
+ }
+
+ public string TooltipText {
+ get { return button.TooltipText; }
+ set { button.TooltipText = value; }
+ }
+
+ public string Label {
+ get { return button.Label; }
+ set { button.Label = value; }
+ }
+
+ Gtk.Button button;
+
+ public DocumentToolButton (string stockId) : this (stockId, null)
{
- Image = new Gtk.Image (stockId, IconSize.Menu);
- Image.Show ();
}
-
+
public DocumentToolButton (string stockId, string label)
{
+ button = new Button ();
Label = label;
Image = new Gtk.Image (stockId, IconSize.Menu);
- Image.Show ();
+ button.Image.Show ();
+ }
+
+ protected override object CreateNativeWidget ()
+ {
+ return button;
+ }
+
+ public event EventHandler Clicked {
+ add {
+ button.Clicked += value;
+ }
+ remove {
+ button.Clicked -= value;
+ }
+ }
+
+ public class DocumentToolButtonImage : Control
+ {
+ Gtk.Image image;
+ internal DocumentToolButtonImage (Gtk.Image image)
+ {
+ this.image = image;
+ }
+
+ protected override object CreateNativeWidget ()
+ {
+ return image;
+ }
+
+ public static implicit operator Gtk.Widget (DocumentToolButtonImage d)
+ {
+ return d.GetNativeWidget<Gtk.Widget> ();
+ }
+
+ public static implicit operator DocumentToolButtonImage (Gtk.Image d)
+ {
+ return new DocumentToolButtonImage (d);
+ }
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentView.cs
index e92d2e985b..d190c1f258 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentView.cs
@@ -29,16 +29,16 @@ namespace MonoDevelop.Ide.Gui
{
public class DocumentView
{
- IBaseViewContent content;
+ BaseViewContent content;
Document document;
- internal DocumentView (Document doc, IBaseViewContent content)
+ internal DocumentView (Document doc, BaseViewContent content)
{
document = doc;
this.content = content;
}
- internal IBaseViewContent BaseContent {
+ internal BaseViewContent BaseContent {
get { return content; }
}
@@ -53,8 +53,8 @@ namespace MonoDevelop.Ide.Gui
public void Select ()
{
- if (content is IAttachableViewContent)
- document.Window.SwitchView ((IAttachableViewContent)content);
+ if (content is BaseViewContent)
+ document.Window.SwitchView ((BaseViewContent)content);
else
document.Window.SwitchView (0);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/FileViewer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/FileViewer.cs
index dbd798402d..a39569c75c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/FileViewer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/FileViewer.cs
@@ -30,6 +30,7 @@ using System;
using MonoDevelop.Ide.Codons;
using MonoDevelop.Ide.Desktop;
using System.Text;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Gui
{
@@ -84,18 +85,18 @@ namespace MonoDevelop.Ide.Gui
return app.GetHashCode ();
}
- public Document OpenFile (string filePath)
+ public Task<Document> OpenFile (string filePath)
{
return OpenFile (filePath, null);
}
- public Document OpenFile (string filePath, Encoding encoding)
+ public Task<Document> OpenFile (string filePath, Encoding encoding)
{
if (binding != null)
return IdeApp.Workbench.OpenDocument (filePath, null, -1, -1, OpenDocumentOptions.Default, encoding, binding);
else {
app.Launch (filePath);
- return null;
+ return Task.FromResult<Document> (null);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs
index cb55076e14..0bfd0a0563 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs
@@ -26,13 +26,15 @@
using System;
using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Editor;
using MonoDevelop.Core.Text;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Gui
{
- public class HiddenTextEditorViewContent : MonoDevelop.Ide.Gui.AbstractViewContent, IServiceProvider
+ public class HiddenTextEditorViewContent : MonoDevelop.Ide.Gui.ViewContent, IServiceProvider
{
readonly TextEditor editor;
@@ -42,7 +44,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return null;
}
@@ -60,10 +62,6 @@ namespace MonoDevelop.Ide.Gui
Name = editor.FileName;
}
- public override void Load (FileOpenInformation fileOpenInformation)
- {
- }
-
public FilePath Name {
get;
set;
@@ -227,11 +225,12 @@ namespace MonoDevelop.Ide.Gui
handler (this, e);
}
- public override object GetContent (Type type)
+ protected override object OnGetContent (Type type)
{
if (type.IsAssignableFrom (typeof(TextEditor)))
return Editor;
- return base.GetContent (type);
+ else
+ return base.OnGetContent (type);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs
index fedbecc6e8..34d6fef15f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs
@@ -61,15 +61,15 @@ namespace MonoDevelop.Ide.Gui
get { return AddinManager.AddinEngine; }
}
- MonoDevelop.Ide.Gui.IViewContent viewContent;
- public MonoDevelop.Ide.Gui.IViewContent ViewContent {
+ MonoDevelop.Ide.Gui.ViewContent viewContent;
+ public MonoDevelop.Ide.Gui.ViewContent ViewContent {
get { return viewContent; }
set { viewContent = value; }
}
- public IEnumerable<IAttachableViewContent> SubViewContents { get { return new IAttachableViewContent[0]; } }
+ public IEnumerable<BaseViewContent> SubViewContents { get { return new BaseViewContent[0]; } }
- public MonoDevelop.Ide.Gui.IBaseViewContent ActiveViewContent {
+ public MonoDevelop.Ide.Gui.BaseViewContent ActiveViewContent {
get { return ViewContent;}
set {}
}
@@ -86,7 +86,7 @@ namespace MonoDevelop.Ide.Gui
public void SwitchView (int viewNumber)
{
}
- public void SwitchView (MonoDevelop.Ide.Gui.IAttachableViewContent subViewContent)
+ public void SwitchView (MonoDevelop.Ide.Gui.BaseViewContent subViewContent)
{
}
@@ -95,26 +95,26 @@ namespace MonoDevelop.Ide.Gui
return -1;
}
- public void AttachViewContent (MonoDevelop.Ide.Gui.IAttachableViewContent subViewContent)
+ public void AttachViewContent (MonoDevelop.Ide.Gui.BaseViewContent subViewContent)
{
}
- public void InsertViewContent (int index, MonoDevelop.Ide.Gui.IAttachableViewContent subViewContent)
+ public void InsertViewContent (int index, MonoDevelop.Ide.Gui.BaseViewContent subViewContent)
{
}
- public DocumentToolbar GetToolbar (IBaseViewContent targetView)
+ public DocumentToolbar GetToolbar (BaseViewContent targetView)
{
return null;
}
public event EventHandler TitleChanged { add {} remove {} }
- public event EventHandler DocumentChanged { add {} remove {} }
- public event MonoDevelop.Ide.Gui.WorkbenchWindowEventHandler Closing { add {} remove {} }
- public event MonoDevelop.Ide.Gui.WorkbenchWindowEventHandler Closed { add {} remove {} }
- public event MonoDevelop.Ide.Gui.ActiveViewContentEventHandler ActiveViewContentChanged { add {} remove {} }
+ public event EventHandler DocumentChanged { add {} remove {} }
+ public event MonoDevelop.Ide.Gui.WorkbenchWindowEventHandler Closing { add {} remove {} }
+ public event MonoDevelop.Ide.Gui.WorkbenchWindowEventHandler Closed { add {} remove {} }
+ public event MonoDevelop.Ide.Gui.ActiveViewContentEventHandler ActiveViewContentChanged { add {} remove {} }
public event EventHandler ViewsChanged { add {} remove {} }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IDisplayBinding.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IDisplayBinding.cs
index be4b654032..1ddfa22ac5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IDisplayBinding.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IDisplayBinding.cs
@@ -53,7 +53,7 @@ namespace MonoDevelop.Ide.Gui
///<summary>A display binding that opens a new view within the workspace.</summary>
public interface IViewDisplayBinding : IDisplayBinding
{
- IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject);
+ ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject);
string Name { get; }
}
@@ -66,7 +66,7 @@ namespace MonoDevelop.Ide.Gui
///<summary>A display binding that attaches to an existing view in the workspace.</summary>
public interface IAttachableDisplayBinding
{
- bool CanAttachTo (IViewContent content);
- IAttachableViewContent CreateViewContent (IViewContent viewContent);
+ bool CanAttachTo (ViewContent content);
+ BaseViewContent CreateViewContent (ViewContent viewContent);
}
} \ No newline at end of file
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 4a28eb46bb..756be72f31 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs
@@ -92,12 +92,12 @@ namespace MonoDevelop.Ide.Gui
/// <summary>
/// Interface providing the content widget
/// </summary>
- IPadContent Content { get; }
+ PadContent Content { get; }
/// <summary>
/// Returns a toolbar for the pad.
/// </summary>
- DockItemToolbar GetToolbar (Gtk.PositionType position);
+ DockItemToolbar GetToolbar (DockPositionType position);
/// <summary>
/// Brings the pad to the front.
@@ -137,7 +137,7 @@ namespace MonoDevelop.Ide.Gui
bool isWorking;
bool hasErrors;
bool hasNewData;
- IPadContent content;
+ PadContent content;
PadCodon codon;
DefaultWorkbench workbench;
@@ -151,7 +151,7 @@ namespace MonoDevelop.Ide.Gui
this.icon = codon.Icon;
}
- public IPadContent Content {
+ public PadContent Content {
get {
CreateContent ();
return content;
@@ -253,7 +253,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- public DockItemToolbar GetToolbar (Gtk.PositionType position)
+ public DockItemToolbar GetToolbar (DockPositionType position)
{
return Item.GetToolbar (position);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IViewContent.cs
deleted file mode 100644
index 0c76d3cc02..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IViewContent.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// IViewContent.cs
-//
-// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
-//
-// Copyright (c) 2009 RemObjects Software
-//
-// 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;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.Ide.Gui
-{
- public interface IViewContent : IBaseViewContent
- {
- Project Project { get; set; }
-
- string PathRelativeToProject { get; }
- string ContentName { get; set; }
- string UntitledName { get; set; }
- string StockIconId { get; }
-
- bool IsUntitled { get; }
- bool IsViewOnly { get; }
- bool IsFile { get; }
- bool IsDirty { get; set; }
- bool IsReadOnly { get; }
-
- void Load (FileOpenInformation fileOpenInformation);
- void Load (string fileName);
- void LoadNew (System.IO.Stream content, string mimeType);
- void Save (FileSaveInformation fileSaveInformation);
- void Save (string fileName);
- void Save ();
-
- /// <summary>
- /// Discards all changes. This method is called before a dirty file is closed. It tells the view
- /// content to remove all autosave data of the file.
- /// </summary>
- void DiscardChanges ();
-
- event EventHandler ContentNameChanged;
- event EventHandler ContentChanged;
- event EventHandler DirtyChanged;
- event EventHandler BeforeSave;
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IWorkbenchWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IWorkbenchWindow.cs
index 4548bd5deb..8bcc0cde5c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IWorkbenchWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IWorkbenchWindow.cs
@@ -35,10 +35,10 @@ namespace MonoDevelop.Ide.Gui
{
public interface IWorkbenchWindow
{
- IViewContent ViewContent { get; }
- IBaseViewContent ActiveViewContent { get; set; }
+ ViewContent ViewContent { get; }
+ BaseViewContent ActiveViewContent { get; set; }
- IEnumerable<IAttachableViewContent> SubViewContents { get; }
+ IEnumerable<BaseViewContent> SubViewContents { get; }
Document Document { get; set; }
string DocumentType { get; set; }
@@ -46,11 +46,11 @@ namespace MonoDevelop.Ide.Gui
bool ShowNotification { get; set; }
ExtensionContext ExtensionContext { get; }
- void AttachViewContent (IAttachableViewContent subViewContent);
- void InsertViewContent (int index, IAttachableViewContent subViewContent);
+ void AttachViewContent (BaseViewContent subViewContent);
+ void InsertViewContent (int index, BaseViewContent subViewContent);
void SwitchView (int index);
- void SwitchView (IAttachableViewContent subViewContent);
+ void SwitchView (BaseViewContent subViewContent);
int FindView <T>();
bool CloseWindow (bool force);
@@ -59,7 +59,7 @@ namespace MonoDevelop.Ide.Gui
/// <summary>
/// Returns a toolbar for the pad.
/// </summary>
- DocumentToolbar GetToolbar (IBaseViewContent targetView);
+ DocumentToolbar GetToolbar (BaseViewContent targetView);
event EventHandler DocumentChanged;
event WorkbenchWindowEventHandler Closed;
@@ -91,12 +91,12 @@ namespace MonoDevelop.Ide.Gui
public delegate void ActiveViewContentEventHandler (object o, ActiveViewContentEventArgs e);
public class ActiveViewContentEventArgs : EventArgs
{
- private IBaseViewContent content = null;
- public IBaseViewContent Content {
+ private BaseViewContent content = null;
+ public BaseViewContent Content {
get { return content; }
}
- public ActiveViewContentEventArgs (IBaseViewContent content)
+ public ActiveViewContentEventArgs (BaseViewContent content)
{
this.content = content;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs
index ff9d31b89a..c173e1c009 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs
@@ -1,4 +1,4 @@
-// IPadContent.cs
+// IPadContent.cs
//
// Author:
// Viktoria Dudka (viktoriad@remobjects.com)
@@ -27,13 +27,54 @@
using System;
using Gtk;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui
{
- public interface IPadContent : IDisposable
+ public abstract class PadContent : IDisposable
{
- Widget Control { get; }
+ IPadWindow window;
+ string icon;
+ string title;
- void Initialize (IPadWindow window);
+ protected PadContent (string title, string icon = null): this()
+ {
+ this.icon = icon;
+ this.title = title;
+ }
+
+ protected PadContent ()
+ {
+ Id = GetType ().FullName;
+ }
+
+ public virtual string Id { get; set; }
+
+ public IPadWindow Window {
+ get { return window; }
+ }
+
+ public abstract Control Control { get; }
+
+ internal void Init (IPadWindow window)
+ {
+ this.window = window;
+
+ if (title != null)
+ window.Title = title;
+
+ if (icon != null)
+ window.Icon = icon;
+
+ Initialize (window);
+ }
+
+ protected virtual void Initialize (IPadWindow window)
+ {
+ }
+
+ public virtual void Dispose ()
+ {
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadFontChanger.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadFontChanger.cs
index 7f74c2eb22..c88b74afbc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadFontChanger.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadFontChanger.cs
@@ -26,6 +26,7 @@
using System;
using Pango;
+using MonoDevelop.Components;
using MonoDevelop.Core;
namespace MonoDevelop.Ide.Gui
@@ -38,12 +39,12 @@ namespace MonoDevelop.Ide.Gui
Action<FontDescription> updater;
Action resizer;
- public PadFontChanger (Gtk.Widget styleSource, Action<FontDescription> updater)
+ public PadFontChanger (Control styleSource, Action<FontDescription> updater)
: this (styleSource, updater, null)
{
}
- public PadFontChanger (Gtk.Widget styleSource, Action<FontDescription> updater, Action resizer)
+ public PadFontChanger (Control styleSource, Action<FontDescription> updater, Action resizer)
{
this.styleSource = styleSource;
this.updater = updater;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs
index bc19460982..acf648032b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs
@@ -29,7 +29,7 @@ using MonoDevelop.Projects.Extensions;
namespace MonoDevelop.Ide.Gui
{
- public class GtkProjectLoadProgressMonitor : ProjectLoadProgressMonitor
+ class GtkProjectLoadProgressMonitor : ProjectLoadProgressMonitor
{
MigrationType? Migration {
get; set;
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 e937b4faaf..e1fa1b3d15 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs
@@ -44,16 +44,16 @@ namespace MonoDevelop.Ide.Gui
internal class SdiWorkspaceWindow : EventBox, IWorkbenchWindow, ICommandDelegatorRouter
{
DefaultWorkbench workbench;
- IViewContent content;
+ ViewContent content;
ExtensionContext extensionContext;
FileTypeCondition fileTypeCondition = new FileTypeCondition ();
- List<IBaseViewContent> viewContents = new List<IBaseViewContent> ();
+ List<BaseViewContent> viewContents = new List<BaseViewContent> ();
Notebook subViewNotebook = null;
Tabstrip subViewToolbar = null;
PathBar pathBar = null;
HBox toolbarBox = null;
- Dictionary<IBaseViewContent,DocumentToolbar> documentToolbars = new Dictionary<IBaseViewContent, DocumentToolbar> ();
+ Dictionary<BaseViewContent,DocumentToolbar> documentToolbars = new Dictionary<BaseViewContent, DocumentToolbar> ();
VBox box;
DockNotebookTab tab;
@@ -89,7 +89,7 @@ namespace MonoDevelop.Ide.Gui
SetDockNotebookTabTitle ();
}
- public SdiWorkspaceWindow (DefaultWorkbench workbench, IViewContent content, DockNotebook tabControl, DockNotebookTab tabLabel) : base ()
+ public SdiWorkspaceWindow (DefaultWorkbench workbench, ViewContent content, DockNotebook tabControl, DockNotebookTab tabLabel) : base ()
{
this.workbench = workbench;
this.tabControl = tabControl;
@@ -115,8 +115,6 @@ namespace MonoDevelop.Ide.Gui
content.ContentNameChanged += new EventHandler(SetTitleEvent);
content.DirtyChanged += HandleDirtyChanged;
- content.BeforeSave += new EventHandler(BeforeSave);
- content.ContentChanged += new EventHandler (OnContentChanged);
box.Show ();
Add (box);
@@ -205,15 +203,15 @@ namespace MonoDevelop.Ide.Gui
}
}
- public IEnumerable<IAttachableViewContent> SubViewContents {
+ public IEnumerable<BaseViewContent> SubViewContents {
get {
- return viewContents.OfType<IAttachableViewContent> ();
+ return viewContents.OfType<BaseViewContent> ();
}
}
// caution use activeView with care !!
- IBaseViewContent activeView = null;
- public IBaseViewContent ActiveViewContent {
+ BaseViewContent activeView = null;
+ public BaseViewContent ActiveViewContent {
get {
if (activeView != null)
return activeView;
@@ -233,7 +231,7 @@ namespace MonoDevelop.Ide.Gui
ShowPage (viewNumber);
}
- public void SwitchView (IAttachableViewContent view)
+ public void SwitchView (BaseViewContent view)
{
if (subViewNotebook != null)
ShowPage (viewContents.IndexOf (view));
@@ -359,7 +357,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- public DocumentToolbar GetToolbar (IBaseViewContent targetView)
+ public DocumentToolbar GetToolbar (BaseViewContent targetView)
{
DocumentToolbar toolbar;
if (!documentToolbars.TryGetValue (targetView, out toolbar)) {
@@ -373,15 +371,7 @@ namespace MonoDevelop.Ide.Gui
return toolbar;
}
- void BeforeSave(object sender, EventArgs e)
- {
- IAttachableViewContent secondaryViewContent = ActiveViewContent as IAttachableViewContent;
- if (secondaryViewContent != null) {
- secondaryViewContent.BeforeSave ();
- }
- }
-
- public IViewContent ViewContent {
+ public ViewContent ViewContent {
get {
return content;
}
@@ -419,7 +409,7 @@ namespace MonoDevelop.Ide.Gui
myUntitledTitle = baseName + System.IO.Path.GetExtension (content.UntitledName);
while (found) {
found = false;
- foreach (IViewContent windowContent in workbench.InternalViewContentCollection) {
+ foreach (ViewContent windowContent in workbench.InternalViewContentCollection) {
string title = windowContent.WorkbenchWindow.Title;
if (title.EndsWith("+")) {
title = title.Substring(0, title.Length - 1);
@@ -449,13 +439,6 @@ namespace MonoDevelop.Ide.Gui
}
}
- public void OnContentChanged (object o, EventArgs e)
- {
- foreach (IAttachableViewContent subContent in SubViewContents) {
- subContent.BaseContentChanged ();
- }
- }
-
public bool CloseWindow (bool force)
{
return CloseWindow (force, false);
@@ -485,7 +468,7 @@ namespace MonoDevelop.Ide.Gui
}
if (viewContents != null) {
- foreach (IAttachableViewContent sv in SubViewContents) {
+ foreach (BaseViewContent sv in SubViewContents) {
sv.Dispose ();
}
viewContents = null;
@@ -494,8 +477,6 @@ namespace MonoDevelop.Ide.Gui
if (content != null) {
content.ContentNameChanged -= new EventHandler(SetTitleEvent);
content.DirtyChanged -= HandleDirtyChanged;
- content.BeforeSave -= new EventHandler(BeforeSave);
- content.ContentChanged -= new EventHandler (OnContentChanged);
content.WorkbenchWindow = null;
content.Dispose ();
content = null;
@@ -566,8 +547,9 @@ namespace MonoDevelop.Ide.Gui
// may happen before the main content is added to 'box', so we
// have to check if the content is already parented or not
- if (this.ViewContent.Control.Parent != null)
- box.Remove (this.ViewContent.Control);
+ Gtk.Widget viewWidget = ViewContent.Control;
+ if (viewWidget.Parent != null)
+ box.Remove (viewWidget);
subViewNotebook = new Notebook ();
subViewNotebook.TabPos = PositionType.Bottom;
@@ -590,12 +572,12 @@ namespace MonoDevelop.Ide.Gui
#endregion
- public void AttachViewContent (IAttachableViewContent subViewContent)
+ public void AttachViewContent (BaseViewContent subViewContent)
{
InsertViewContent (viewContents.Count, subViewContent);
}
- public void InsertViewContent (int index, IAttachableViewContent subViewContent)
+ public void InsertViewContent (int index, BaseViewContent subViewContent)
{
// need to create child Notebook when first IAttachableViewContent is added
CheckCreateSubViewContents ();
@@ -604,19 +586,17 @@ namespace MonoDevelop.Ide.Gui
subViewContent.WorkbenchWindow = this;
InsertButton (index, subViewContent.TabPageLabel, subViewContent);
- OnContentChanged (null, null);
-
if (ViewsChanged != null)
ViewsChanged (this, EventArgs.Empty);
}
- protected Tab AddButton (string label, IBaseViewContent viewContent)
+ protected Tab AddButton (string label, BaseViewContent viewContent)
{
return InsertButton (viewContents.Count, label, viewContent);
}
bool updating = false;
- protected Tab InsertButton (int index, string label, IBaseViewContent viewContent)
+ protected Tab InsertButton (int index, string label, BaseViewContent viewContent)
{
CheckCreateSubViewToolbar ();
updating = true;
@@ -642,7 +622,7 @@ namespace MonoDevelop.Ide.Gui
addedContent = true;
}
- int page = viewContents.IndexOf ((IBaseViewContent) tab.Tag);
+ int page = viewContents.IndexOf ((BaseViewContent) tab.Tag);
SetCurrentView (page);
QueueDraw ();
};
@@ -723,39 +703,39 @@ namespace MonoDevelop.Ide.Gui
void SetCurrentView (int newIndex)
{
- IAttachableViewContent subViewContent;
+ BaseViewContent subViewContent;
int oldIndex = subViewNotebook.CurrentPage;
subViewNotebook.CurrentPage = newIndex;
if (oldIndex != -1) {
- subViewContent = viewContents[oldIndex] as IAttachableViewContent;
+ subViewContent = viewContents[oldIndex] as BaseViewContent;
if (subViewContent != null)
- subViewContent.Deselected ();
+ subViewContent.OnDeselected ();
}
- subViewContent = viewContents[newIndex] as IAttachableViewContent;
+ subViewContent = viewContents[newIndex] as BaseViewContent;
DetachFromPathedDocument ();
MonoDevelop.Ide.Gui.Content.IPathedDocument pathedDocument;
- if (newIndex < 0 || newIndex == viewContents.IndexOf (ViewContent)) {
- pathedDocument = Document != null ? Document.GetContent<IPathedDocument> () : (IPathedDocument) ViewContent.GetContent (typeof(IPathedDocument));
+ if (newIndex < 0 || newIndex == viewContents.IndexOf ((BaseViewContent)ViewContent)) {
+ pathedDocument = Document != null ? Document.GetContent<IPathedDocument> () : (IPathedDocument)ViewContent.GetContent (typeof(IPathedDocument));
} else {
- pathedDocument = (IPathedDocument) viewContents[newIndex].GetContent (typeof(IPathedDocument));
+ pathedDocument = (IPathedDocument)viewContents[newIndex].GetContent (typeof(IPathedDocument));
}
var toolbarVisible = false;
foreach (var t in documentToolbars) {
toolbarVisible = ActiveViewContent == t.Key;
- t.Value.Container.Visible = toolbarVisible;
+ t.Value.Container.GetNativeWidget<Gtk.Widget> ().Visible = toolbarVisible;
}
if (pathedDocument != null && !toolbarVisible)
AttachToPathedDocument (pathedDocument);
if (subViewContent != null)
- subViewContent.Selected ();
+ subViewContent.OnSelected ();
OnActiveViewContentChanged (new ActiveViewContentEventArgs (this.ActiveViewContent));
}
@@ -775,12 +755,8 @@ namespace MonoDevelop.Ide.Gui
if (((Gtk.Window)Toplevel).HasToplevelFocus)
DockNotebook.ActiveNotebook = (SdiDragNotebook)Parent.Parent;
- Gtk.Widget w = content as Gtk.Widget;
- if (w != this.tabPage) {
- // Route commands to the view
- return ActiveViewContent;
- } else
- return null;
+ // Route commands to the view
+ return ActiveViewContent;
}
void SetDockNotebookTabTitle ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs
index 620ca00313..e7f69e98e4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractViewContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs
@@ -1,4 +1,4 @@
-// AbstractViewContent.cs
+// ViewContent.cs
//
// Author:
// Viktoria Dudka (viktoriad@remobjects.com)
@@ -28,29 +28,33 @@
using System;
using System.Collections.Generic;
using System.Text;
+using MonoDevelop.Components;
+using System.Threading.Tasks;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using Xwt;
namespace MonoDevelop.Ide.Gui
{
- public abstract class AbstractViewContent : AbstractBaseViewContent, IViewContent
+ public abstract class ViewContent : BaseViewContent
{
- #region IViewContent Members
+ #region ViewContent Members
- private string untitledName = "";
- public virtual string UntitledName {
+ string untitledName = "";
+ string contentName;
+ bool isDirty;
+
+ public string UntitledName {
get { return untitledName; }
set { untitledName = value; }
}
- private string contentName;
- public virtual string ContentName {
+ public string ContentName {
get { return contentName; }
set {
if (value != contentName) {
contentName = value;
- OnContentNameChanged (EventArgs.Empty);
+ OnContentNameChanged ();
}
}
}
@@ -59,13 +63,12 @@ namespace MonoDevelop.Ide.Gui
get { return (contentName == null); }
}
- private bool isDirty;
public virtual bool IsDirty {
get { return isDirty; }
set {
if (value != isDirty) {
isDirty = value;
- OnDirtyChanged (EventArgs.Empty);
+ OnDirtyChanged ();
}
}
}
@@ -74,12 +77,13 @@ namespace MonoDevelop.Ide.Gui
get { return false; }
}
-
public virtual bool IsHidden {
get { return false; }
}
- public virtual bool IsViewOnly { get; set; }
+ public virtual bool IsViewOnly {
+ get { return false; }
+ }
public virtual bool IsFile {
get { return true; }
@@ -89,24 +93,21 @@ namespace MonoDevelop.Ide.Gui
get { return null; }
}
- public virtual Project Project { get; set; }
-
- public string PathRelativeToProject {
+ internal string PathRelativeToProject {
get { return Project == null ? null : FileService.AbsoluteToRelativePath (Project.BaseDirectory, ContentName); }
}
- public virtual void Save ()
+ public virtual Task Save ()
{
- OnBeforeSave (EventArgs.Empty);
- this.Save (contentName);
+ return Save (contentName);
}
- public void Save (string fileName)
+ public Task Save (FilePath fileName)
{
- Save (new FileSaveInformation (fileName));
+ return Save (new FileSaveInformation (fileName));
}
- public virtual void Save (FileSaveInformation fileSaveInformation)
+ public virtual Task Save (FileSaveInformation fileSaveInformation)
{
throw new NotImplementedException ();
}
@@ -115,57 +116,44 @@ namespace MonoDevelop.Ide.Gui
{
}
- public abstract void Load (FileOpenInformation fileOpenInformation);
+ public virtual Task Load (FileOpenInformation fileOpenInformation)
+ {
+ return Task.FromResult (true);
+ }
- public void Load (string fileName)
+ public Task Load (FilePath fileName)
{
- Load (new FileOpenInformation (fileName, null));
+ return Load (new FileOpenInformation (fileName, null));
}
- public virtual void LoadNew (System.IO.Stream content, string mimeType)
+ public virtual Task LoadNew (System.IO.Stream content, string mimeType)
{
throw new NotSupportedException ();
}
- public event EventHandler ContentNameChanged;
+ internal event EventHandler ContentNameChanged;
public event EventHandler DirtyChanged;
- public event EventHandler BeforeSave;
-
- public event EventHandler ContentChanged;
-
#endregion
- public virtual void OnContentChanged (EventArgs e)
- {
- if (ContentChanged != null)
- ContentChanged (this, e);
- }
-
- public virtual void OnDirtyChanged (EventArgs e)
+ protected virtual void OnDirtyChanged ()
{
if (DirtyChanged != null)
- DirtyChanged (this, e);
- }
-
- public virtual void OnBeforeSave (EventArgs e)
- {
- if (BeforeSave != null)
- BeforeSave (this, e);
+ DirtyChanged (this, EventArgs.Empty);
}
- public virtual void OnContentNameChanged (EventArgs e)
+ protected virtual void OnContentNameChanged ()
{
if (ContentNameChanged != null)
- ContentNameChanged (this, e);
+ ContentNameChanged (this, EventArgs.Empty);
}
}
- public abstract class AbstractXwtViewContent :AbstractViewContent
+ public abstract class AbstractXwtViewContent : ViewContent
{
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return (Gtk.Widget)Toolkit.CurrentEngine.GetNativeWidget (Widget);
}
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 0975b1d62e..8b12ce0ca6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
@@ -52,6 +52,8 @@ using MonoDevelop.Components.Docking;
using MonoDevelop.Components.DockNotebook;
using System.Text;
using MonoDevelop.Ide.Editor;
+using MonoDevelop.Components;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Gui
{
@@ -62,7 +64,6 @@ namespace MonoDevelop.Ide.Gui
{
readonly ProgressMonitorManager monitors = new ProgressMonitorManager ();
readonly List<Document> documents = new List<Document> ();
- // readonly List<Split> splits = new List<Split> ();
DefaultWorkbench workbench;
PadCollection pads;
@@ -179,7 +180,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- public WorkbenchWindow RootWindow {
+ public Gtk.Window RootWindow {
get { return workbench; }
}
@@ -343,13 +344,13 @@ namespace MonoDevelop.Ide.Gui
static AlertButton PromptToSaveChanges (Document doc)
{
- return MessageService.GenericAlert (MonoDevelop.Ide.Gui.Stock.Warning,
+ return MessageService.GenericAlert (MonoDevelop.Ide.Gui.Stock.Warning,
GettextCatalog.GetString ("Save the changes to document '{0}' before creating a new solution?",
- doc.Window.ViewContent.IsUntitled
+ (object)(doc.Window.ViewContent.IsUntitled
? doc.Window.ViewContent.UntitledName
- : System.IO.Path.GetFileName (doc.Window.ViewContent.ContentName)),
+ : System.IO.Path.GetFileName (doc.Window.ViewContent.ContentName))),
"",
- AlertButton.Cancel, doc.Window.ViewContent.IsUntitled ? AlertButton.SaveAs : AlertButton.Save);
+ AlertButton.Cancel, doc.Window.ViewContent.IsUntitled ? AlertButton.SaveAs : AlertButton.Save);
}
public void CloseAllDocuments (bool leaveActiveDocumentOpen)
@@ -380,58 +381,58 @@ namespace MonoDevelop.Ide.Gui
return WrapPad (content);
}
- public Pad AddPad (IPadContent padContent, string id, string label, string defaultPlacement, IconId icon)
+ public Pad AddPad (PadContent padContent, string id, string label, string defaultPlacement, IconId icon)
{
return AddPad (new PadCodon (padContent, id, label, defaultPlacement, icon));
}
- public Pad AddPad (IPadContent padContent, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, IconId icon)
+ public Pad AddPad (PadContent padContent, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, IconId icon)
{
return AddPad (new PadCodon (padContent, id, label, defaultPlacement, defaultStatus, icon));
}
- public Pad ShowPad (IPadContent padContent, string id, string label, string defaultPlacement, IconId icon)
+ public Pad ShowPad (PadContent padContent, string id, string label, string defaultPlacement, IconId icon)
{
return ShowPad (new PadCodon (padContent, id, label, defaultPlacement, icon));
}
- public Pad ShowPad (IPadContent padContent, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, IconId icon)
+ public Pad ShowPad (PadContent padContent, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, IconId icon)
{
return ShowPad (new PadCodon (padContent, id, label, defaultPlacement, defaultStatus, icon));
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, bool bringToFront)")]
- public Document OpenDocument (FilePath fileName, bool bringToFront)
+ public Task<Document> OpenDocument (FilePath fileName, bool bringToFront)
{
return OpenDocument (fileName, bringToFront ? OpenDocumentOptions.Default : OpenDocumentOptions.Default & ~OpenDocumentOptions.BringToFront);
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, OpenDocumentOptions options = OpenDocumentOptions.Default)")]
- public Document OpenDocument (FilePath fileName, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, -1, -1, options, null, null);
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)")]
- public Document OpenDocument (FilePath fileName, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, -1, -1, options, encoding, null);
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options = OpenDocumentOptions.Default)")]
- public Document OpenDocument (FilePath fileName, int line, int column, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, int line, int column, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, line, column, options, null, null);
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, int line, int column, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)")]
- public Document OpenDocument (FilePath fileName, int line, int column, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, int line, int column, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, line, column, options, encoding, null);
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options, Encoding encoding, IViewDisplayBinding binding)")]
- internal Document OpenDocument (FilePath fileName, int line, int column, OpenDocumentOptions options, Encoding encoding, IViewDisplayBinding binding)
+ internal Task<Document> OpenDocument (FilePath fileName, int line, int column, OpenDocumentOptions options, Encoding encoding, IViewDisplayBinding binding)
{
var openFileInfo = new FileOpenInformation (fileName, null) {
Options = options,
@@ -444,32 +445,32 @@ namespace MonoDevelop.Ide.Gui
}
- public Document OpenDocument (FilePath fileName, Project project, bool bringToFront)
+ public Task<Document> OpenDocument (FilePath fileName, Project project, bool bringToFront)
{
return OpenDocument (fileName, project, bringToFront ? OpenDocumentOptions.Default : OpenDocumentOptions.Default & ~OpenDocumentOptions.BringToFront);
}
- public Document OpenDocument (FilePath fileName, Project project, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, Project project, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, project, -1, -1, options, null, null);
}
- public Document OpenDocument (FilePath fileName, Project project, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, Project project, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, project, -1, -1, options, encoding, null);
}
- public Document OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, project, line, column, options, null, null);
}
- public Document OpenDocument (FilePath fileName, Project project, int line, int column, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, Project project, int line, int column, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, project, line, column, options, encoding, null);
}
- internal Document OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options, Encoding encoding, IViewDisplayBinding binding)
+ internal Task<Document> OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options, Encoding encoding, IViewDisplayBinding binding)
{
var openFileInfo = new FileOpenInformation (fileName, project) {
Options = options,
@@ -498,7 +499,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- internal Document OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options, Encoding Encoding, IViewDisplayBinding binding, DockNotebook dockNotebook)
+ internal Task<Document> OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options, Encoding Encoding, IViewDisplayBinding binding, DockNotebook dockNotebook)
{
var openFileInfo = new FileOpenInformation (fileName, project) {
Options = options,
@@ -512,7 +513,7 @@ namespace MonoDevelop.Ide.Gui
return OpenDocument (openFileInfo);
}
- public Document OpenDocument (FileOpenInformation info)
+ public async Task<Document> OpenDocument (FileOpenInformation info)
{
if (string.IsNullOrEmpty (info.FileName))
return null;
@@ -522,7 +523,7 @@ namespace MonoDevelop.Ide.Gui
if (info.Options.HasFlag (OpenDocumentOptions.TryToReuseViewer)) {
Counters.OpenDocumentTimer.Trace ("Look for open document");
foreach (Document doc in Documents) {
- IBaseViewContent vcFound = null;
+ BaseViewContent vcFound = null;
//search all ViewContents to see if they can "re-use" this filename
if (doc.Window.ViewContent.CanReuseView (info.FileName))
@@ -557,7 +558,7 @@ namespace MonoDevelop.Ide.Gui
true
);
- RealOpenFile (pm, info);
+ await RealOpenFile (pm, info);
pm.Dispose ();
if (info.NewContent != null) {
@@ -578,7 +579,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- IViewContent BatchOpenDocument (ProgressMonitor monitor, FilePath fileName, Project project, int line, int column, DockNotebook dockNotebook)
+ async Task<ViewContent> BatchOpenDocument (ProgressMonitor monitor, FilePath fileName, Project project, int line, int column, DockNotebook dockNotebook)
{
if (string.IsNullOrEmpty (fileName))
return null;
@@ -591,13 +592,13 @@ namespace MonoDevelop.Ide.Gui
DockNotebook = dockNotebook
};
- RealOpenFile (monitor, openFileInfo);
+ await RealOpenFile (monitor, openFileInfo);
return openFileInfo.NewContent;
}
}
- public Document OpenDocument (IViewContent content, bool bringToFront)
+ public Document OpenDocument (ViewContent content, bool bringToFront)
{
workbench.ShowView (content, bringToFront);
if (bringToFront)
@@ -625,7 +626,7 @@ namespace MonoDevelop.Ide.Gui
if (binding == null)
throw new ApplicationException("Can't create display binding for mime type: " + mimeType);
- IViewContent newContent = binding.CreateContent (defaultName, mimeType, null);
+ ViewContent newContent = binding.CreateContent (defaultName, mimeType, null);
using (content) {
newContent.LoadNew (content, mimeType);
}
@@ -652,7 +653,7 @@ namespace MonoDevelop.Ide.Gui
"MonoDevelop.TextEditor.Document.Document.DefaultDocumentAggregatorProperties",
new Properties()));
- public void ShowGlobalPreferencesDialog (Gtk.Window parentWindow, string panelId, Action<OptionsDialog> configurationAction = null)
+ public void ShowGlobalPreferencesDialog (Window parentWindow, string panelId, Action<OptionsDialog> configurationAction = null)
{
if (parentWindow == null)
parentWindow = IdeApp.Workbench.RootWindow;
@@ -681,12 +682,12 @@ namespace MonoDevelop.Ide.Gui
}
}
- public void ShowDefaultPoliciesDialog (Gtk.Window parentWindow)
+ public void ShowDefaultPoliciesDialog (Window parentWindow)
{
ShowDefaultPoliciesDialog (parentWindow, null);
}
- public void ShowDefaultPoliciesDialog (Gtk.Window parentWindow, string panelId)
+ public void ShowDefaultPoliciesDialog (Window parentWindow, string panelId)
{
if (parentWindow == null)
parentWindow = IdeApp.Workbench.RootWindow;
@@ -810,6 +811,7 @@ namespace MonoDevelop.Ide.Gui
: System.IO.Path.GetFileName (viewContent.ContentName)),
GettextCatalog.GetString ("If you don't save, all changes will be permanently lost."),
AlertButton.CloseWithoutSave, AlertButton.Cancel, viewContent.IsUntitled ? AlertButton.SaveAs : AlertButton.Save);
+
if (result == AlertButton.Save || result == AlertButton.SaveAs) {
FindDocument (window).Save ();
args.Cancel = viewContent.IsDirty;
@@ -862,7 +864,7 @@ namespace MonoDevelop.Ide.Gui
return project;
}
- void RealOpenFile (ProgressMonitor monitor, FileOpenInformation openFileInfo)
+ async Task<bool> RealOpenFile (ProgressMonitor monitor, FileOpenInformation openFileInfo)
{
FilePath fileName;
@@ -872,7 +874,7 @@ namespace MonoDevelop.Ide.Gui
if (origName == null) {
monitor.ReportError (GettextCatalog.GetString ("Invalid file name"), null);
- return;
+ return false;
}
fileName = openFileInfo.FileName;
@@ -882,7 +884,7 @@ namespace MonoDevelop.Ide.Gui
//Debug.Assert(FileService.IsValidPath(fileName));
if (FileService.IsDirectory (fileName)) {
monitor.ReportError (GettextCatalog.GetString ("{0} is a directory", fileName), null);
- return;
+ return false;
}
// test, if file fileName exists
@@ -893,14 +895,14 @@ namespace MonoDevelop.Ide.Gui
if (doc.Window.ViewContent.IsUntitled && doc.Window.ViewContent.UntitledName == origName) {
doc.Select ();
openFileInfo.NewContent = doc.Window.ViewContent;
- return;
+ return true;
}
}
}
if (!File.Exists (fileName)) {
monitor.ReportError (GettextCatalog.GetString ("File not found: {0}", fileName), null);
- return;
+ return false;
}
}
@@ -933,7 +935,7 @@ namespace MonoDevelop.Ide.Gui
if (binding != null) {
if (viewBinding != null) {
var fw = new LoadFileWrapper (monitor, workbench, viewBinding, project, openFileInfo);
- fw.Invoke (fileName);
+ await fw.Invoke (fileName);
} else {
var extBinding = (IExternalDisplayBinding)binding;
var app = extBinding.GetApplication (fileName, null, project);
@@ -949,11 +951,14 @@ namespace MonoDevelop.Ide.Gui
} catch (Exception ex) {
LoggingService.LogError ("Error opening file: " + fileName, ex);
MessageService.ShowError (GettextCatalog.GetString ("File '{0}' could not be opened", fileName));
+ return false;
}
}
} catch (Exception ex) {
monitor.ReportError ("", ex);
+ return false;
}
+ return true;
}
void OnStoringWorkspaceUserPreferences (object s, UserPreferencesEventArgs args)
@@ -1035,7 +1040,7 @@ namespace MonoDevelop.Ide.Gui
return dp;
}
- void OnLoadingWorkspaceUserPreferences (object s, UserPreferencesEventArgs args)
+ async void OnLoadingWorkspaceUserPreferences (object s, UserPreferencesEventArgs args)
{
WorkbenchUserPrefs prefs = args.Properties.GetValue<WorkbenchUserPrefs> ("MonoDevelop.Ide.Workbench");
if (prefs == null)
@@ -1045,21 +1050,21 @@ namespace MonoDevelop.Ide.Gui
IdeApp.Workbench.LockActiveWindowChangeEvent ();
NavigationHistoryService.LogActiveDocument ();
- List<Tuple<IViewContent,string>> docViews = new List<Tuple<IViewContent,string>> ();
+ List<Tuple<ViewContent,string>> docViews = new List<Tuple<ViewContent,string>> ();
FilePath baseDir = args.Item.BaseDirectory;
var floatingWindows = new List<DockWindow> ();
using (ProgressMonitor pm = ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString ("Loading workspace documents"), Stock.StatusSolutionOperation, true)) {
var docList = prefs.Files.Distinct (new DocumentUserPrefsFilenameComparer ()).OrderBy (d => d.NotebookId).ToList ();
- OpenDocumentsInContainer (pm, baseDir, docViews, docList, workbench.TabControl.Container);
+ await OpenDocumentsInContainer (pm, baseDir, docViews, docList, workbench.TabControl.Container);
foreach (var fw in prefs.FloatingWindows) {
var dockWindow = new DockWindow ();
dockWindow.Move (fw.X, fw.Y);
dockWindow.Resize (fw.Width, fw.Height);
docList = fw.Files.Distinct (new DocumentUserPrefsFilenameComparer ()).OrderBy (d => d.NotebookId).ToList ();
- OpenDocumentsInContainer (pm, baseDir, docViews, docList, dockWindow.Container);
+ await OpenDocumentsInContainer (pm, baseDir, docViews, docList, dockWindow.Container);
floatingWindows.Add (dockWindow);
}
@@ -1103,7 +1108,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- void OpenDocumentsInContainer (ProgressMonitor pm, FilePath baseDir, List<Tuple<IViewContent,string>> docViews, List<DocumentUserPrefs> list, DockNotebookContainer container)
+ async Task<bool> OpenDocumentsInContainer (ProgressMonitor pm, FilePath baseDir, List<Tuple<ViewContent,string>> docViews, List<DocumentUserPrefs> list, DockNotebookContainer container)
{
int currentNotebook = -1;
DockNotebook nb = container.GetFirstNotebook ();
@@ -1117,14 +1122,15 @@ namespace MonoDevelop.Ide.Gui
currentNotebook = doc.NotebookId;
}
// TODO: Get the correct project.
- var view = IdeApp.Workbench.BatchOpenDocument (pm, fileName, null, doc.Line, doc.Column, nb);
+ var view = await IdeApp.Workbench.BatchOpenDocument (pm, fileName, null, doc.Line, doc.Column, nb);
if (view != null) {
- var t = new Tuple<IViewContent,string> (view, fileName);
+ var t = new Tuple<ViewContent,string> (view, fileName);
docViews.Add (t);
}
}
}
+ return true;
}
internal Document FindDocument (IWorkbenchWindow window)
@@ -1135,7 +1141,7 @@ namespace MonoDevelop.Ide.Gui
return null;
}
- internal Pad FindPad (IPadContent padContent)
+ internal Pad FindPad (PadContent padContent)
{
foreach (Pad pad in Pads)
if (pad.Content == padContent)
@@ -1150,7 +1156,7 @@ namespace MonoDevelop.Ide.Gui
internal void ReorderDocuments (int oldPlacement, int newPlacement)
{
- IViewContent content = workbench.InternalViewContentCollection[oldPlacement];
+ ViewContent content = workbench.InternalViewContentCollection[oldPlacement];
workbench.InternalViewContentCollection.RemoveAt (oldPlacement);
workbench.InternalViewContentCollection.Insert (newPlacement, content);
@@ -1158,12 +1164,6 @@ namespace MonoDevelop.Ide.Gui
documents.RemoveAt (oldPlacement);
documents.Insert (newPlacement, doc);
}
-
- internal void ResetToolbars ()
- {
- workbench.ResetToolbars ();
- }
-
internal void LockActiveWindowChangeEvent ()
{
@@ -1264,9 +1264,7 @@ namespace MonoDevelop.Ide.Gui
void OnDocumentOpened (DocumentEventArgs e)
{
try {
- EventHandler<DocumentEventArgs> handler = this.DocumentOpened;
- if (handler != null)
- handler (this, e);
+ DocumentOpened?.Invoke (this, e);
} catch (Exception ex) {
LoggingService.LogError ("Exception while opening documents", ex);
}
@@ -1276,9 +1274,7 @@ namespace MonoDevelop.Ide.Gui
{
try {
var e = new DocumentEventArgs (doc);
- EventHandler<DocumentEventArgs> handler = this.DocumentClosed;
- if (handler != null)
- handler (this, e);
+ DocumentClosed?.Invoke (this, e);
} catch (Exception ex) {
LoggingService.LogError ("Exception while closing documents", ex);
}
@@ -1288,9 +1284,7 @@ namespace MonoDevelop.Ide.Gui
{
try {
var e = new DocumentEventArgs (doc);
- EventHandler<DocumentEventArgs> handler = this.DocumentClosing;
- if (handler != null)
- handler (this, e);
+ DocumentClosing?.Invoke (this, e);
} catch (Exception ex) {
LoggingService.LogError ("Exception before closing documents", ex);
}
@@ -1347,6 +1341,7 @@ namespace MonoDevelop.Ide.Gui
}
public OpenDocumentOptions Options { get; set; }
+
int offset = -1;
public int Offset {
get {
@@ -1359,7 +1354,7 @@ namespace MonoDevelop.Ide.Gui
public int Line { get; set; }
public int Column { get; set; }
public IViewDisplayBinding DisplayBinding { get; set; }
- public IViewContent NewContent { get; set; }
+ public ViewContent NewContent { get; set; }
public Encoding Encoding { get; set; }
public Project Project { get; set; }
@@ -1446,7 +1441,7 @@ namespace MonoDevelop.Ide.Gui
FileOpenInformation fileInfo;
DefaultWorkbench workbench;
ProgressMonitor monitor;
- IViewContent newContent;
+ ViewContent newContent;
public LoadFileWrapper (ProgressMonitor monitor, DefaultWorkbench workbench, IViewDisplayBinding binding, FileOpenInformation fileInfo)
{
@@ -1462,7 +1457,7 @@ namespace MonoDevelop.Ide.Gui
this.project = project;
}
- public void Invoke (string fileName)
+ public async Task<bool> Invoke (string fileName)
{
try {
Counters.OpenDocumentTimer.Trace ("Creating content");
@@ -1474,7 +1469,7 @@ namespace MonoDevelop.Ide.Gui
}
if (newContent == null) {
monitor.ReportError (GettextCatalog.GetString ("The file '{0}' could not be opened.", fileName), null);
- return;
+ return false;
}
if (project != null)
@@ -1483,24 +1478,24 @@ namespace MonoDevelop.Ide.Gui
Counters.OpenDocumentTimer.Trace ("Loading file");
try {
- newContent.Load (fileInfo);
+ await newContent.Load (fileInfo);
} catch (InvalidEncodingException iex) {
monitor.ReportError (GettextCatalog.GetString ("The file '{0}' could not opened. {1}", fileName, iex.Message), null);
- return;
+ return false;
} catch (OverflowException) {
monitor.ReportError (GettextCatalog.GetString ("The file '{0}' could not opened. File too large.", fileName), null);
- return;
+ return false;
}
} catch (Exception ex) {
monitor.ReportError (GettextCatalog.GetString ("The file '{0}' could not be opened.", fileName), ex);
- return;
+ return false;
}
// content got re-used
if (newContent.WorkbenchWindow != null) {
newContent.WorkbenchWindow.SelectWindow ();
fileInfo.NewContent = newContent;
- return;
+ return true;
}
Counters.OpenDocumentTimer.Trace ("Showing view");
@@ -1517,6 +1512,7 @@ namespace MonoDevelop.Ide.Gui
}
fileInfo.NewContent = newContent;
+ return true;
}
void JumpToLine ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchMemento.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchMemento.cs
index 8203e8ef94..d70c432c54 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchMemento.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchMemento.cs
@@ -34,7 +34,6 @@ using System.Xml;
using MonoDevelop.Core;
using MonoDevelop.Core.Serialization;
-using MonoDevelop.Components.DockToolbars;
namespace MonoDevelop.Ide.Gui
{
@@ -88,15 +87,6 @@ namespace MonoDevelop.Ide.Gui
}
}
- public DockToolbarFrameStatus ToolbarStatus {
- get {
- return properties.Get ("toolbarStatus", new DockToolbarFrameStatus ());
- }
- set {
- properties.Set ("toolbarStatus", value);
- }
- }
-
/// <summary>
/// Creates a new instance of the <code>MdiWorkspaceMemento</code>.
/// </summary>
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs
index 06098c686c..92309d38ba 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs
@@ -30,7 +30,7 @@ using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui
{
- public class WorkbenchWindow: Gtk.Window
+ class WorkbenchWindow: Gtk.Window
{
List<TopLevelChild> topLevels = new List<TopLevelChild> ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs
index d0f82bfe1e..37939b918b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs
@@ -28,6 +28,7 @@
//
using System;
+using System.Threading.Tasks;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
@@ -77,12 +78,12 @@ namespace MonoDevelop.Ide.Navigation
get { return doc != null? doc.FileName : fileName; }
}
- public override Document ShowDocument ()
+ public override Task<Document> ShowDocument ()
{
return DoShow ();
}
- protected virtual Document DoShow ()
+ protected virtual async Task<Document> DoShow ()
{
if (doc != null) {
doc.Select ();
@@ -95,7 +96,7 @@ namespace MonoDevelop.Ide.Navigation
break;
}
}
- return IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName, p, true));
+ return await IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName, p, true));
}
public override string DisplayName {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs
index d9a964024c..be001978cb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs
@@ -224,10 +224,10 @@ namespace MonoDevelop.Ide.Navigation
get { return closedHistory.Count != 0; }
}
- public static void OpenLastClosedDocument () {
+ public static async void OpenLastClosedDocument () {
if (HasClosedDocuments) {
var tuple = closedHistory.Pop ();
- var doc = tuple.Item1.ShowDocument ();
+ var doc = await tuple.Item1.ShowDocument ();
IdeApp.Workbench.ReorderTab (IdeApp.Workbench.Documents.IndexOf (doc), tuple.Item2);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationPoint.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationPoint.cs
index 7455083ace..a45eb04d53 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationPoint.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationPoint.cs
@@ -26,6 +26,7 @@
// THE SOFTWARE.
using System;
+using System.Threading.Tasks;
using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Ide.Navigation
@@ -35,9 +36,9 @@ namespace MonoDevelop.Ide.Navigation
public abstract string DisplayName { get; }
//public abstract string Tooltip { get; }
- public virtual Document ShowDocument ()
+ public virtual Task<Document> ShowDocument ()
{
- return null;
+ return Task.FromResult<Document> (null);
}
// used for fuzzy matching to decide whether to replace an existing nav point
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs
index d17c03e0c9..9fc346329d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs
@@ -32,6 +32,7 @@ using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Navigation
{
@@ -78,9 +79,9 @@ namespace MonoDevelop.Ide.Navigation
}
}
- protected override Document DoShow ()
+ protected override async Task<Document> DoShow ()
{
- Document doc = base.DoShow ();
+ Document doc = await base.DoShow ();
if (doc != null) {
var buf = doc.Editor;
if (buf != null) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanel.cs
index 7b487bab59..8da492a529 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanel.cs
@@ -26,6 +26,7 @@
//
using System;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -46,7 +47,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
obj = dataObject as WorkspaceObject;
}
- public Gtk.Widget CreatePanelWidget ()
+ public Control CreatePanelWidget ()
{
widget = new BaseDirectoryPanelWidget ();
widget.BaseDirectory = System.IO.Path.GetFullPath (obj.BaseDirectory);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanelWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanelWidget.cs
index e0d65e589f..520fc66781 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanelWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanelWidget.cs
@@ -33,7 +33,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
[System.ComponentModel.Category("MonoDevelop.Projects.Gui")]
[System.ComponentModel.ToolboxItem(true)]
- public partial class BaseDirectoryPanelWidget : Gtk.Bin
+ partial class BaseDirectoryPanelWidget : Gtk.Bin
{
public BaseDirectoryPanelWidget()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs
index 1e76b57d79..d8c2ad6c9a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs
@@ -26,13 +26,14 @@
using System;
using System.Collections.Generic;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
using MonoDevelop.Core;
namespace MonoDevelop.Ide.Projects.OptionPanels
{
- public class CodeAnalysisPanel : MultiConfigItemOptionsPanel
+ class CodeAnalysisPanel : MultiConfigItemOptionsPanel
{
CodeAnalysisPanelWidget widget;
@@ -46,7 +47,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
return ConfiguredProject is DotNetProject;
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new CodeAnalysisPanelWidget ());
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs
index 97059258ac..d5a093d6ab 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs
@@ -186,7 +186,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
data.UseParentPolicy = useParentPolicy;
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new CodeFormattingPanelWidget (this, ParentDialog);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineBuildOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineBuildOptions.cs
index 9814002d5a..9cf84eca7b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineBuildOptions.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineBuildOptions.cs
@@ -24,6 +24,7 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -33,7 +34,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
CombineBuildOptionsWidget widget;
- public override Gtk.Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new CombineBuildOptionsWidget (ConfiguredSolution);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs
index c250af9a4f..646ba7b6be 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
CombineConfigurationPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new CombineConfigurationPanelWidget ((MultiConfigItemOptionsDialog) ParentDialog, ConfiguredSolution);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineInformationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineInformationPanel.cs
index 190e1740f2..766f937ea7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineInformationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineInformationPanel.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
CombineInformationWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new CombineInformationWidget (ConfiguredSolution);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs
index 3f393ce1cb..f07659dd82 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
Xwt.CheckBox checkMSBuild;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
bool byDefault, require;
MSBuildProjectService.CheckHandlerUsesMSBuildEngine (ConfiguredProject, out byDefault, out require);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CommonAssemblySigningPreferences.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CommonAssemblySigningPreferences.cs
index fa7b64f949..c0a509bfc6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CommonAssemblySigningPreferences.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CommonAssemblySigningPreferences.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
using MonoDevelop.Core;
@@ -121,7 +122,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
AllowMixedConfigurations = true;
return (widget = new CommonAssemblySigningPreferences ());
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs
index 36b031897f..dbe81867ec 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
using MonoDevelop.Core;
@@ -44,7 +45,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
this.supportedTypes = supportedTypes;
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new CustomCommandPanelWidget ());
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs
index 5176e25e51..c50c616ec6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs
@@ -26,7 +26,7 @@
using System;
using MonoDevelop.Ide.Gui.Dialogs;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Projects.SharedAssetsProjects;
@@ -36,7 +36,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
GeneralProjectOptionsWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new GeneralProjectOptionsWidget (ConfiguredProject, ParentDialog);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs
index d339d9b3d0..a8e296f91d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs
@@ -56,7 +56,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
return !(item is WorkspaceObject);
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new NamespaceSynchronisationPanelWidget (this);
widget.Show ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/OutputOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/OutputOptionsPanel.cs
index 12e9ba637f..c25deb35ef 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/OutputOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/OutputOptionsPanel.cs
@@ -27,6 +27,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -47,7 +48,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
return ConfiguredProject is DotNetProject;
}
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return (widget = new OutputOptionsPanelWidget ());
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs
index 6cc61d4878..bc2a0b85b0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs
@@ -28,6 +28,7 @@ using System.Text;
using System.Linq;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Core.Assemblies;
@@ -41,7 +42,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
PortableRuntimeOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new PortableRuntimeOptionsPanelWidget ((DotNetProject) ConfiguredProject, ItemConfigurations));
}
@@ -53,7 +54,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
}
[System.ComponentModel.ToolboxItem(true)]
- public partial class PortableRuntimeOptionsPanelWidget : Gtk.Bin
+ partial class PortableRuntimeOptionsPanelWidget : Gtk.Bin
{
readonly TargetFramework missingFramework;
readonly List<TargetFramework> targetFrameworks;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RunOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RunOptionsPanel.cs
index 67a285815a..8a79156c3b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RunOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RunOptionsPanel.cs
@@ -42,7 +42,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
RunOptionsPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return (widget = new RunOptionsPanelWidget ());
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RuntimeOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RuntimeOptionsPanel.cs
index 0aa2fdeb6d..b635d4de5b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RuntimeOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RuntimeOptionsPanel.cs
@@ -47,7 +47,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
RuntimeOptionsPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return (widget = new RuntimeOptionsPanelWidget ((DotNetProject)ConfiguredProject, ItemConfigurations));
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs
index 6ae8eb9397..8963a790dc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs
@@ -43,7 +43,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
CombineEntryConfigurationsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
MultiConfigItemOptionsDialog dlg = (MultiConfigItemOptionsDialog) ParentDialog;
return (widget = new CombineEntryConfigurationsPanelWidget (dlg));
@@ -163,7 +163,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
try {
bool done = false;
do {
- if (MessageService.RunCustomDialog (dlg, Toplevel as Window) == (int) Gtk.ResponseType.Ok) {
+ if (MessageService.RunCustomDialog (dlg, Toplevel as Gtk.Window) == (int) Gtk.ResponseType.Ok) {
configData.RenameConfiguration (cc.Id, dlg.ConfigName, dlg.RenameChildren);
store.SetValue (iter, 1, cc.Id);
done = true;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/StartupOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/StartupOptionsPanel.cs
index 8686b5be7f..aa31d91c46 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/StartupOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/StartupOptionsPanel.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
@@ -192,7 +193,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
StartupOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new StartupOptionsPanelWidget (ConfiguredSolution);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/CombineOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/CombineOptionsDialog.cs
index 9218b96190..3d68902157 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/CombineOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/CombineOptionsDialog.cs
@@ -32,6 +32,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using Mono.Addins;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -40,7 +41,7 @@ namespace MonoDevelop.Ide.Projects
{
public class CombineOptionsDialog : MultiConfigItemOptionsDialog
{
- public CombineOptionsDialog (Gtk.Window parentWindow, Solution solution) : base (parentWindow, solution)
+ public CombineOptionsDialog (Window parentWindow, Solution solution) : base (parentWindow, solution)
{
this.Title = GettextCatalog.GetString ("Solution Options") + " - " + solution.Name;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs
index 5e8db8812a..02523169e7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs
@@ -53,7 +53,7 @@ namespace MonoDevelop.Ide.Projects
PolicySet currentSet;
bool loading;
- public DefaultPolicyOptionsDialog (Gtk.Window parentWindow)
+ public DefaultPolicyOptionsDialog (MonoDevelop.Components.Window parentWindow)
: base (parentWindow, new PolicySet (),
"/MonoDevelop/ProjectModel/Gui/DefaultPolicyPanels")
{
@@ -329,9 +329,10 @@ namespace MonoDevelop.Ide.Projects
void UpdateStatus ()
{
+ Gtk.Widget mainBox = MainBox;
if (sets.Count == 0) {
deleteButton.Sensitive = exportButton.Sensitive = false;
- MainBox.Sensitive = false;
+ mainBox.Sensitive = false;
((ListStore)policiesCombo.Model).Clear ();
policiesCombo.Sensitive = false;
policiesCombo.AppendText (GettextCatalog.GetString ("No Selection"));
@@ -339,7 +340,7 @@ namespace MonoDevelop.Ide.Projects
}
else {
deleteButton.Sensitive = exportButton.Sensitive = true;
- MainBox.Sensitive = true;
+ mainBox.Sensitive = true;
policiesCombo.Sensitive = true;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs
index 447a2e822c..9c30e16114 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs
@@ -178,7 +178,7 @@ namespace MonoDevelop.Ide.Projects
if (startingFolder != null)
dialog.CurrentFolder = startingFolder;
- dialog.TransientFor = Toplevel as Window;
+ dialog.TransientFor = Toplevel as Gtk.Window;
if (dialog.Run ())
return dialog.SelectedFile;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs
index 1fb55bb7c3..6aa31e3068 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs
@@ -44,7 +44,7 @@ namespace MonoDevelop.Ide.Projects
/// <summary>
/// This class is for creating a new "empty" file
/// </summary>
- internal partial class NewFileDialog : Dialog
+ internal partial class NewFileDialog : Gtk.Dialog
{
List<TemplateItem> alltemplates = new List<TemplateItem> ();
List<Category> categories = new List<Category> ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectOptionsDialog.cs
index 9ca48b8940..56fb56a48a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectOptionsDialog.cs
@@ -33,6 +33,7 @@ using System.ComponentModel;
using Mono.Addins;
using MonoDevelop.Core;
using MonoDevelop.Projects;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -43,7 +44,7 @@ namespace MonoDevelop.Ide.Projects
/// </summary>
public class ProjectOptionsDialog : MultiConfigItemOptionsDialog
{
- public ProjectOptionsDialog (Gtk.Window parentWindow, SolutionItem project) : base (parentWindow, project)
+ public ProjectOptionsDialog (Window parentWindow, SolutionItem project) : base (parentWindow, project)
{
this.Title = GettextCatalog.GetString ("Project Options") + " - " + project.Name;
this.DefaultWidth = 960;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs
index 34967fc29f..3bcfbdb9cc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs
@@ -27,7 +27,7 @@
//
using System;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Core.Serialization;
using MonoDevelop.Projects.Policies;
@@ -45,7 +45,7 @@ namespace MonoDevelop.Ide.StandardHeader
get { return GettextCatalog.GetString ("Standard _Header"); }
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new StandardHeaderPolicyPanelWidget (this);
panel.ShowAll ();
@@ -66,7 +66,7 @@ namespace MonoDevelop.Ide.StandardHeader
partial class StandardHeaderPolicyPanelWidget : Gtk.Bin
{
StandardHeaderPolicyPanel parent;
- TreeStore store = new Gtk.TreeStore (typeof (string));
+ Gtk.TreeStore store = new Gtk.TreeStore (typeof (string));
static readonly string [] templates = {
"FileName",
@@ -92,7 +92,7 @@ namespace MonoDevelop.Ide.StandardHeader
this.Build ();
headerText.Buffer.Changed += NotifyChanged;
includeAutoCheck.Toggled += NotifyChanged;
- this.treeviewTemplates.AppendColumn (GettextCatalog.GetString ("Templates"), new CellRendererText (), "text", 0);
+ this.treeviewTemplates.AppendColumn (GettextCatalog.GetString ("Templates"), new Gtk.CellRendererText (), "text", 0);
foreach (var template in templates) {
store.AppendValues ("${"+template+"}");
}
@@ -104,9 +104,9 @@ namespace MonoDevelop.Ide.StandardHeader
treeviewTemplates.QueueResize ();
}
- void TreeviewTemplates_RowActivated (object o, RowActivatedArgs args)
+ void TreeviewTemplates_RowActivated (object o, Gtk.RowActivatedArgs args)
{
- TreeIter iter;
+ Gtk.TreeIter iter;
store.GetIter (out iter, args.Path);
headerText.Buffer.InsertAtCursor ((string)store.GetValue (iter, 0));
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs
index c2be0dc2b6..06c6ab560e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs
@@ -32,6 +32,7 @@ using System.Collections;
using System.Collections.Generic;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Ide;
@@ -539,11 +540,11 @@ namespace MonoDevelop.Ide.Tasks
OnGenTaskJumpto (null, null);
}
- void OnGenTaskDelete (object o, EventArgs args)
+ async void OnGenTaskDelete (object o, EventArgs args)
{
TaskListEntry task = SelectedTask;
if (task != null && ! String.IsNullOrEmpty (task.FileName)) {
- var doc = IdeApp.Workbench.OpenDocument (task.FileName, null, Math.Max (1, task.Line), Math.Max (1, task.Column));
+ var doc = await IdeApp.Workbench.OpenDocument (task.FileName, null, Math.Max (1, task.Line), Math.Max (1, task.Column));
if (doc != null && doc.HasProject && doc.Project is DotNetProject) {
string[] commentTags = doc.CommentTags;
if (commentTags != null && commentTags.Length == 1) {
@@ -641,14 +642,14 @@ namespace MonoDevelop.Ide.Tasks
}
#region ITaskListView members
- TreeView ITaskListView.Content {
+ Control ITaskListView.Content {
get {
CreateView ();
return view;
}
}
- Widget[] ITaskListView.ToolBarItems {
+ Control[] ITaskListView.ToolBarItems {
get { return null; }
}
#endregion
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ITaskListView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ITaskListView.cs
index 89b3fd5f1f..8506888425 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ITaskListView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ITaskListView.cs
@@ -27,13 +27,13 @@
//
using System;
-using Gtk;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Tasks
{
public interface ITaskListView
{
- TreeView Content { get; }
- Widget[] ToolBarItems { get; }
+ Control Content { get; }
+ Control[] ToolBarItems { get; }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs
index 7db2b7aef8..d2c9276df1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs
@@ -43,6 +43,7 @@ using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Navigation;
using MonoDevelop.Ide.TextEditing;
using MonoDevelop.Ide.Desktop;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Tasks
{
@@ -387,9 +388,9 @@ namespace MonoDevelop.Ide.Tasks
this.task = task;
}
- protected override Document DoShow ()
+ protected override async Task<Document> DoShow ()
{
- Document result = base.DoShow ();
+ Document result = await base.DoShow ();
TaskService.InformJumpToTask (task);
return result;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
index ba001f0f2e..73963fb385 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
@@ -350,8 +350,8 @@ namespace MonoDevelop.Ide.Tasks
}
#region ITaskListView members
- TreeView ITaskListView.Content { get { return view; } }
- Widget[] ITaskListView.ToolBarItems { get { return new Widget[] { newButton, delButton, copyButton }; } }
+ Control ITaskListView.Content { get { return view; } }
+ Control[] ITaskListView.ToolBarItems { get { return new Control[] { newButton, delButton, copyButton }; } }
#endregion
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/PropertyDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/PropertyDescriptionTemplate.cs
index 98b1079c0a..75aa833cb9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/PropertyDescriptionTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/PropertyDescriptionTemplate.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.Ide.Templates
{
- public class PropertyDescriptionTemplate : FileDescriptionTemplate
+ class PropertyDescriptionTemplate : FileDescriptionTemplate
{
XmlAttribute typeAtt;
string propertyInnerText;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TopLevelWidgetExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TopLevelWidgetExtension.cs
index 6ce7988b5b..1165bf2957 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TopLevelWidgetExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TopLevelWidgetExtension.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.TextEditing
{
@@ -36,7 +37,7 @@ namespace MonoDevelop.Ide.TextEditing
public int OffsetY { get; set; }
public bool AllowMove { get; set; }
- public abstract Gtk.Widget CreateWidget ();
+ public abstract Control CreateWidget ();
protected TopLevelWidgetExtension ()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
index 3c4cf75b5a..a8eed4fad2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
@@ -171,6 +171,7 @@ namespace MonoDevelop.Ide.TypeSystem
if (isDisposed)
return;
document.TextChanging -= HandleTextReplacing;
+ document.TextChanged -= Document_TextChanged;;
isDisposed = true;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
index cc3a1ee1e8..e6daeb6a88 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
@@ -630,11 +630,9 @@ namespace MonoDevelop.Ide.TypeSystem
return document;
}
- Dictionary<string, SourceText> changedFiles = new Dictionary<string, SourceText> ();
public override bool TryApplyChanges (Solution newSolution)
{
- changedFiles.Clear ();
return base.TryApplyChanges (newSolution);
}
@@ -703,16 +701,14 @@ namespace MonoDevelop.Ide.TypeSystem
return;
bool isOpen;
var filePath = document.FilePath;
+ var data = TextFileProvider.Instance.GetTextEditorData (filePath, out isOpen);
// Guard against already done changes in linked files.
// This shouldn't happen but the roslyn merging seems not to be working correctly in all cases :/
- SourceText formerText;
- if (changedFiles.TryGetValue (filePath, out formerText)) {
- if (formerText.Length == text.Length && formerText.ToString () == text.ToString ())
- return;
+ if (document.GetLinkedDocumentIds ().Length > 0 && isOpen && !(text.GetType ().FullName == "Microsoft.CodeAnalysis.Text.ChangedText")) {
+ return;
}
- changedFiles [filePath] = text;
-
+
Projection projection = null;
foreach (var entry in ProjectionList) {
var p = entry.Projections.FirstOrDefault (proj => FilePath.PathComparer.Equals (proj.Document.FileName, filePath));
@@ -722,11 +718,13 @@ namespace MonoDevelop.Ide.TypeSystem
break;
}
}
-
- var data = TextFileProvider.Instance.GetTextEditorData (filePath, out isOpen);
- var oldFile = isOpen ? document.GetTextAsync ().Result : new MonoDevelopSourceText (data);
+ SourceText oldFile;
+ if (!isOpen || !document.TryGetText (out oldFile)) {
+ oldFile = new MonoDevelopSourceText (data);
+ }
var changes = text.GetTextChanges (oldFile).OrderByDescending (c => c.Span.Start).ToList ();
int delta = 0;
+
if (!isOpen) {
delta = ApplyChanges (projection, data, changes);
var formatter = CodeFormatterService.GetFormatter (data.MimeType);
@@ -765,7 +763,6 @@ namespace MonoDevelop.Ide.TypeSystem
foreach (var change in changes) {
delta -= change.Span.Length - change.NewText.Length;
var startOffset = change.Span.Start - delta;
-
if (projection != null) {
int originalOffset;
if (projection.TryConvertFromProjectionToOriginal (startOffset, out originalOffset))
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs
index 7966655f10..5d37b2d7d2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs
@@ -29,7 +29,7 @@ using Gtk;
namespace MonoDevelop.Ide.WelcomePage
{
- public class DefaultWelcomePage: WelcomePageWidget
+ class DefaultWelcomePage: WelcomePageWidget
{
protected override void BuildContent (Container parent)
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/IWelcomePageProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/IWelcomePageProvider.cs
index 5ac8884424..541b690441 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/IWelcomePageProvider.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/IWelcomePageProvider.cs
@@ -25,13 +25,14 @@
// THE SOFTWARE.
using System;
using Mono.Addins;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.WelcomePage
{
[TypeExtensionPoint]
public interface IWelcomePageProvider
{
- Gtk.Widget CreateWidget ();
+ Control CreateWidget ();
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageOptionPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageOptionPanel.cs
index 26a87546f1..9640eda8d9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageOptionPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageOptionPanel.cs
@@ -27,18 +27,19 @@
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.Ide.WelcomePage
{
- public class WelcomePageOptionPanel : OptionsPanel
+ class WelcomePageOptionPanel : OptionsPanel
{
CheckButton showOnStartCheckButton = new CheckButton ();
CheckButton internetUpdateCheckButton = new CheckButton ();
CheckButton closeOnOpenSlnCheckButton = new CheckButton ();
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
VBox vbox = new VBox();
showOnStartCheckButton.Label = GettextCatalog.GetString ("Show welcome page on startup");
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
index f2c75b69b2..b7a04fe022 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
@@ -2470,12 +2470,9 @@
<Compile Include="MonoDevelop.Ide.Templates\SingleFileDescriptionTemplate.cs" />
<Compile Include="MonoDevelop.Ide.Templates\SolutionDescriptor.cs" />
<Compile Include="MonoDevelop.Ide.Templates\ResourceFileDescriptionTemplate.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\AbstractBaseViewContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\AbstractPadContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\AbstractViewContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\IBaseViewContent.cs" />
+ <Compile Include="MonoDevelop.Ide.Gui\BaseViewContent.cs" />
+ <Compile Include="MonoDevelop.Ide.Gui\ViewContent.cs" />
<Compile Include="MonoDevelop.Ide.Gui\PadContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\IViewContent.cs" />
<Compile Include="MonoDevelop.Ide.Gui\IWorkbenchWindow.cs" />
<Compile Include="MonoDevelop.Ide.Gui\ViewCommandHandlers.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Content\IBookmarkBuffer.cs" />
@@ -2639,8 +2636,6 @@
<Compile Include="MonoDevelop.Ide.FindInFiles\SearchResultWidget.cs" />
<Compile Include="MonoDevelop.Ide.FindInFiles\ISearchProgressMonitor.cs" />
<Compile Include="MonoDevelop.Ide.FindInFiles\SearchProgressMonitor.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\IAttachableViewContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\AbstractAttachableViewContent.cs" />
<Compile Include="MonoDevelop.Ide.CodeFormatting\CodeFormattingCommands.cs" />
<Compile Include="MonoDevelop.Ide.Execution\ParameterizedExecutionHandler.cs" />
<Compile Include="MonoDevelop.Ide.Execution\ExecutionModeCommandService.cs" />
@@ -2660,7 +2655,6 @@
<Compile Include="MonoDevelop.Ide.Tasks\TaskStore.cs" />
<Compile Include="MonoDevelop.Ide.Gui.OptionPanels\AssemblyFoldersPanel.cs" />
<Compile Include="gtk-gui\MonoDevelop.Ide.Gui.OptionPanels.AssemblyFoldersPanelWidget.cs" />
- <Compile Include="MonoDevelop.Ide.Gui.Content\ISupportsProjectReload.cs" />
<Compile Include="MonoDevelop.Ide.Gui.OptionPanels\BuildMessagePanel.cs" />
<Compile Include="gtk-gui\MonoDevelop.Ide.Gui.OptionPanels.BuildMessagePanelWidget.cs" />
<Compile Include="MonoDevelop.Ide.Gui\HiddenWorkbenchWindow.cs" />
@@ -2731,7 +2725,6 @@
<Compile Include="MonoDevelop.Components.Commands\CommandMenuItem.cs" />
<Compile Include="MonoDevelop.Components.Commands\CommandSystemCommands.cs" />
<Compile Include="MonoDevelop.Components.Commands\CommandToggleToolButton.cs" />
- <Compile Include="MonoDevelop.Components.Commands\CommandToolbar.cs" />
<Compile Include="MonoDevelop.Components.Commands\CommandToolButton.cs" />
<Compile Include="MonoDevelop.Components.Commands\CustomCommand.cs" />
<Compile Include="MonoDevelop.Components.Commands\CustomMenuItem.cs" />
@@ -2761,21 +2754,6 @@
<Compile Include="MonoDevelop.Components.Commands.ExtensionNodes\SeparatorItemCodon.cs" />
<Compile Include="MonoDevelop.Components.Commands.ExtensionNodes\LocalCommandItemCodon.cs" />
<Compile Include="MonoDevelop.Components.Commands.ExtensionNodes\SchemeExtensionNode.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\ArrowWindow.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockedPosition.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockGrip.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbar.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarFrame.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarFrameLayout.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarFrameStatus.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarPanel.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarPosition.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarStatus.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\FixedPanel.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\FloatingDock.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\FloatingPosition.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\IDockBar.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\PlaceholderWindow.cs" />
<Compile Include="MonoDevelop.Components.Extensions\PlatformDialog.cs" />
<Compile Include="MonoDevelop.Components.Extensions\ISelectFileDialog.cs" />
<Compile Include="MonoDevelop.Components.PropertyGrid\DefaultPropertyTab.cs" />
@@ -3409,6 +3387,10 @@
<Compile Include="MonoDevelop.Ide.Templates\PropertyDescriptionTemplate.cs" />
<Compile Include="MonoDevelop.Ide.Templates\FileTemplateTagsModifier.cs" />
<Compile Include="MonoDevelop.Ide.Templates\CombinedTagModel.cs" />
+ <Compile Include="MonoDevelop.Components.Docking\DockPositionType.cs" />
+ <Compile Include="MonoDevelop.Components\ButtonEvent.cs" />
+ <Compile Include="MonoDevelop.Components\Window.cs" />
+ <Compile Include="MonoDevelop.Components\Dialog.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs
index 8455c21735..3a48180f21 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs
@@ -246,10 +246,10 @@ namespace MonoDevelop.Ide
{
PlatformService.SetFileAttributes (fileName, attributes);
}
-
- public static Gdk.Rectangle GetUsableMonitorGeometry (Gdk.Screen screen, int monitor)
+
+ public static Xwt.Rectangle GetUsableMonitorGeometry (int screenNumber, int monitorNumber)
{
- return PlatformService.GetUsableMonitorGeometry (screen, monitor);
+ return PlatformService.GetUsableMonitorGeometry (screenNumber, monitorNumber);
}
public static bool CanOpenTerminal {
@@ -319,13 +319,13 @@ namespace MonoDevelop.Ide
PlatformService.GrabDesktopFocus (window);
}
- public static void RemoveWindowShadow (Gtk.Window window)
+ public static void RemoveWindowShadow (Window window)
{
PlatformService.RemoveWindowShadow (window);
}
- public static void SetMainWindowDecorations (Gtk.Window window)
+ public static void SetMainWindowDecorations (Window window)
{
PlatformService.SetMainWindowDecorations (window);
}
@@ -341,12 +341,12 @@ namespace MonoDevelop.Ide
toolbar.Initialize ();
}
- public static bool GetIsFullscreen (Gtk.Window window)
+ public static bool GetIsFullscreen (Window window)
{
return PlatformService.GetIsFullscreen (window);
}
- public static void SetIsFullscreen (Gtk.Window window, bool isFullscreen)
+ public static void SetIsFullscreen (Window window, bool isFullscreen)
{
PlatformService.SetIsFullscreen (window, isFullscreen);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs
index eb6e0010da..b5ce18e2e7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs
@@ -410,7 +410,6 @@ namespace MonoDevelop.Ide
static void OnInitialRun ()
{
- Workbench.ResetToolbars ();
SetInitialLayout ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs
index 2854718e17..bf32e0edb1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using MonoDevelop.Components;
-using Gtk;
using MonoDevelop.Core;
using MonoDevelop.Components.Extensions;
using MonoDevelop.Ide.Gui;
@@ -331,8 +330,9 @@ namespace MonoDevelop.Ide
return ShowCustomDialog (dialog, null);
}
- public static int ShowCustomDialog (Dialog dialog, Window parent)
+ public static int ShowCustomDialog (Dialog dlg, Window parent)
{
+ Gtk.Dialog dialog = dlg;
try {
return RunCustomDialog (dialog, parent);
} finally {
@@ -349,9 +349,10 @@ namespace MonoDevelop.Ide
/// <summary>
/// Places and runs a transient dialog. Does not destroy it, so values can be retrieved from its widgets.
/// </summary>
- public static int RunCustomDialog (Dialog dialog, Window parent)
+ public static int RunCustomDialog (Dialog dlg, Window parent)
{
// if dialog is modal, make sure it's parented on any existing modal dialog
+ Gtk.Dialog dialog = dlg;
if (dialog.Modal) {
parent = GetDefaultModalParent ();
}
@@ -404,26 +405,27 @@ namespace MonoDevelop.Ide
/// </summary>
public static Window GetDefaultModalParent ()
{
- foreach (Window w in Window.ListToplevels ())
+ foreach (Gtk.Window w in Gtk.Window.ListToplevels ())
if (w.Visible && w.HasToplevelFocus && w.Modal)
return w;
return GetFocusedToplevel ();
}
- static Window GetFocusedToplevel ()
+ static Gtk.Window GetFocusedToplevel ()
{
- return Window.ListToplevels ().FirstOrDefault (w => w.HasToplevelFocus) ?? RootWindow;
+ return Gtk.Window.ListToplevels ().FirstOrDefault (w => w.HasToplevelFocus) ?? RootWindow;
}
/// <summary>
/// Positions a dialog relative to its parent on platforms where default placement is known to be poor.
/// </summary>
- public static void PlaceDialog (Window child, Window parent)
+ public static void PlaceDialog (Window childControl, Window parent)
{
//HACK: this is a workaround for broken automatic window placement on Mac
if (!Platform.IsMac)
return;
+ Gtk.Window child = childControl;
//modal windows should always be placed o top of existing modal windows
if (child.Modal)
parent = GetDefaultModalParent ();
@@ -437,8 +439,10 @@ namespace MonoDevelop.Ide
}
/// <summary>Centers a window relative to its parent.</summary>
- static void CenterWindow (Window child, Window parent)
+ static void CenterWindow (Window childControl, Window parentControl)
{
+ Gtk.Window child = childControl;
+ Gtk.Window parent = parentControl;
child.Child.Show ();
int w, h, winw, winh, x, y, winx, winy;
child.GetSize (out w, out h);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
index dd459f6e83..a6e9e4706d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
@@ -56,7 +56,6 @@ using MonoDevelop.Projects.MSBuild;
using System.Collections.Immutable;
using MonoDevelop.Ide.Editor;
using MonoDevelop.Core.Text;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Components.Extensions;
namespace MonoDevelop.Ide
@@ -277,7 +276,7 @@ namespace MonoDevelop.Ide
}
if (fileName == null)
return;
- var doc = IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName, project));
+ var doc = await IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName, project));
if (doc != null) {
doc.RunWhenLoaded (delegate {
@@ -299,7 +298,7 @@ namespace MonoDevelop.Ide
offset = projectedOffset;
}
}
- IdeApp.Workbench.OpenDocument (new FileOpenInformation (filePath, project) {
+ await IdeApp.Workbench.OpenDocument (new FileOpenInformation (filePath, project) {
Offset = offset
});
}
@@ -340,7 +339,7 @@ namespace MonoDevelop.Ide
}
if (fileName == null || !File.Exists (fileName))
return;
- var doc = IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName));
+ var doc = await IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName));
if (doc != null) {
doc.RunWhenLoaded (delegate {
var handler = doc.PrimaryView.GetContent<MonoDevelop.Ide.Gui.Content.IOpenNamedElementHandler> ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
index c8f952933e..f9cddfacc5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
@@ -819,14 +819,9 @@ namespace MonoDevelop.Ide
hasUnsaved = true;
if (!doc.IsFile)
hasNoFiles = true;
- ISupportsProjectReload pr = doc.GetContent<ISupportsProjectReload> ();
- if (pr != null) {
- ProjectReloadCapability c = pr.ProjectReloadCapability;
- if ((int) c < (int) prc)
- prc = c;
- }
- else
- prc = ProjectReloadCapability.None;
+ var c = doc.ProjectReloadCapability;
+ if ((int) c < (int) prc)
+ prc = c;
}
string msg = null;
@@ -857,8 +852,7 @@ namespace MonoDevelop.Ide
foreach (Document doc in docs) {
if (doc.IsDirty)
hasUnsaved = true;
- ISupportsProjectReload pr = doc.GetContent<ISupportsProjectReload> ();
- if (pr != null)
+ if (doc.ProjectReloadCapability != ProjectReloadCapability.None)
doc.SetProject (null);
else {
FilePath file = doc.IsFile ? doc.FileName : FilePath.Null;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs
index 0f7f717e25..d9aca4cf16 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.Ide.Gui.Dialogs
{
- public partial class SelectFileFormatDialog
+ partial class SelectFileFormatDialog
{
private global::Gtk.HBox hbox1;
private global::Gtk.VBox vbox3;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs
index cb945ba4ae..f12e3d37b7 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.Ide.Gui.OptionPanels
{
- public partial class IDEStyleOptionsPanelWidget
+ partial class IDEStyleOptionsPanelWidget
{
private global::Gtk.VBox vbox13;
private global::Gtk.Table table1;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic b/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic
index bf5eb1fcf9..7d4dcfb933 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic
@@ -3090,6 +3090,7 @@ Diagnostic</property>
</child>
</widget>
<widget class="Gtk.Bin" id="MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget" design-size="315 285">
+ <property name="GeneratePublic">False</property>
<property name="MemberName" />
<child>
<widget class="Gtk.VBox" id="vbox13">
@@ -5877,6 +5878,7 @@ All solutions</property>
<widget class="Gtk.Dialog" id="MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog" design-size="638 246">
<property name="MemberName" />
<property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
<property name="Title" translatable="yes">Select File Format</property>
<property name="WindowPosition">CenterOnParent</property>
<property name="Buttons">2</property>
@@ -8360,6 +8362,7 @@ All solutions</property>
<widget class="Gtk.Bin" id="MonoDevelop.Ide.Projects.OptionPanels.BaseDirectoryPanelWidget" design-size="463 44">
<property name="MemberName" />
<property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
<child>
<widget class="Gtk.VBox" id="vbox2">
<property name="MemberName" />
@@ -11303,6 +11306,7 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
<widget class="Gtk.Bin" id="MonoDevelop.Ide.Projects.OptionPanels.PortableRuntimeOptionsPanelWidget" design-size="300 300">
<property name="MemberName" />
<property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
<child>
<widget class="Gtk.VBox" id="vbox1">
<property name="MemberName" />
diff --git a/main/src/tools/mdmonitor/InstrumenationChartView.cs b/main/src/tools/mdmonitor/InstrumentationChartView.cs
index 0aab4edea5..f5c2b4485b 100644
--- a/main/src/tools/mdmonitor/InstrumenationChartView.cs
+++ b/main/src/tools/mdmonitor/InstrumentationChartView.cs
@@ -1,21 +1,21 @@
-//
+//
// InstrumenationChartView.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
@@ -35,46 +35,46 @@ using System.Globalization;
namespace Mono.Instrumentation.Monitor
{
[System.ComponentModel.ToolboxItem(true)]
- internal partial class InstrumenationChartView : Gtk.Bin
+ internal partial class InstrumentationChartView : Gtk.Bin
{
InstrumentationViewerDialog parent;
ListStore seriesStore;
ChartView view = new ChartView ();
ChartView originalView;
-
+
ListStore listViewStore;
TreeView listView;
ScrolledWindow listViewScrolled;
-
+
BasicChart countChart;
BasicChart timeChart;
DateTime startTime;
DateTime endTime;
-
+
DateTimeAxis countAxisX;
IntegerAxis countAxisY;
DateTimeAxis timeAxisX;
IntegerAxis timeAxisY;
-
+
TimeSpan visibleTime = TimeSpan.FromMinutes (5);
-
+
List<Serie> currentSeries = new List<Serie> ();
-
- public InstrumenationChartView (InstrumentationViewerDialog parent)
+
+ public InstrumentationChartView (InstrumentationViewerDialog parent)
{
Build ();
-
+
this.parent = parent;
-
+
// The list for the List Mode
-
+
listViewStore = new ListStore (typeof(ListViewValueInfo), typeof(Gdk.Pixbuf), typeof (string), typeof(string), typeof(string), typeof (string), typeof (string));
listView = new TreeView ();
listView.Model = listViewStore;
-
+
CellRendererText crx = new CellRendererText ();
listView.AppendColumn ("Timestamp", crx, "text", 3);
-
+
TreeViewColumn col = new TreeViewColumn ();
col.Title = "Counter";
CellRendererPixbuf crp = new CellRendererPixbuf ();
@@ -83,13 +83,13 @@ namespace Mono.Instrumentation.Monitor
col.PackStart (crx, true);
col.AddAttribute (crx, "text", 2);
listView.AppendColumn (col);
-
+
listView.AppendColumn ("Count", crx, "text", 4);
listView.AppendColumn ("Total Count", crx, "text", 5);
listView.AppendColumn ("Time", crx, "text", 6);
-
+
listView.RowActivated += HandleListViewRowActivated;
-
+
listViewScrolled = new ScrolledWindow ();
listViewScrolled.Add (listView);
listViewScrolled.ShadowType = ShadowType.In;
@@ -97,33 +97,33 @@ namespace Mono.Instrumentation.Monitor
listViewScrolled.VscrollbarPolicy = PolicyType.Automatic;
listViewScrolled.ShowAll ();
boxCharts.PackStart (listViewScrolled, true, true, 0);
-
+
// The series list
-
+
seriesStore = new ListStore (typeof(bool), typeof(Gdk.Pixbuf), typeof (string), typeof(ChartSerieInfo), typeof(String), typeof(String), typeof (String));
listSeries.Model = seriesStore;
-
+
col = new TreeViewColumn ();
col.Title = "Counter";
CellRendererToggle crt = new CellRendererToggle ();
col.PackStart (crt, false);
col.AddAttribute (crt, "active", 0);
-
+
crp = new CellRendererPixbuf ();
col.PackStart (crp, false);
col.AddAttribute (crp, "pixbuf", 1);
-
+
crx = new CellRendererText ();
col.PackStart (crx, true);
col.AddAttribute (crx, "text", 2);
listSeries.AppendColumn (col);
-
+
listSeries.AppendColumn ("Last", crx, "text", 4);
listSeries.AppendColumn ("Sel", crx, "text", 5);
listSeries.AppendColumn ("Diff", crx, "text", 6);
-
+
crt.Toggled += SerieToggled;
-
+
countChart = new BasicChart ();
countAxisY = new IntegerAxis (true);
countAxisX = new DateTimeAxis (true);
@@ -137,7 +137,7 @@ namespace Mono.Instrumentation.Monitor
countChart.SelectionStart.LabelAxis = countAxisX;
countChart.SelectionEnd.LabelAxis = countAxisX;
countChart.SelectionChanged += CountChartSelectionChanged;
-
+
timeChart = new BasicChart ();
timeAxisY = new IntegerAxis (true);
timeAxisX = new DateTimeAxis (true);
@@ -150,11 +150,11 @@ namespace Mono.Instrumentation.Monitor
// timeChart.SetAutoScale (AxisDimension.Y, true, true);
timeChart.SelectionStart.LabelAxis = timeAxisX;
timeChart.SelectionEnd.LabelAxis = timeAxisX;
-
+
frameCharts.PackStart (countChart, true, true, 0);
frameCharts.PackStart (timeChart, true, true, 0);
frameCharts.ShowAll ();
-
+
if (App.FromFile) {
if (visibleTime > App.Service.EndTime - App.Service.StartTime)
visibleTime = App.Service.EndTime - App.Service.StartTime;
@@ -165,31 +165,31 @@ namespace Mono.Instrumentation.Monitor
endTime = DateTime.Now;
startTime = endTime - visibleTime;
}
-
+
DateTime st = App.Service.StartTime;
if (st > startTime) st = startTime;
-
+
chartScroller.Adjustment.Lower = st.Ticks;
-
+
UpdateCharts ();
chartScroller.Value = chartScroller.Adjustment.Upper;
-
+
if (!App.FromFile)
StartAutoscroll ();
-
+
toggleTimeView.Active = true;
}
-
+
public void ShowAllTimers ()
{
hboxChartBar.Visible = hboxSeriesBar.Visible = false;
-
+
view = new ChartView ();
foreach (Counter c in App.Service.GetCounters ()) {
if (c is TimerCounter)
view.Add (c);
}
-
+
FillSelectedSeries ();
toggleListView.Active = true;
}
@@ -205,12 +205,12 @@ namespace Mono.Instrumentation.Monitor
win.Show ();
}
}
-
+
void CountChartSelectionChanged (object sender, EventArgs e)
{
UpdateListValues ();
}
-
+
void FillSelectedSeries ()
{
seriesStore.Clear ();
@@ -233,34 +233,35 @@ namespace Mono.Instrumentation.Monitor
}
}
}
-
+
void UpdateButtonStatus ()
{
parent.EnableSave (view.Modified);
}
-
+
void UpdateCharts ()
{
listViewScrolled.Visible = !toggleTimeView.Active;
frameCharts.Visible = toggleTimeView.Active;
-
+
if (frameCharts.Visible) {
- timeChart.Visible = false;
- countChart.Visible = true;
-
+ var timeWidget = timeChart.GetNativeWidget<Widget> ();
+ timeWidget.Visible = false;
+ var countWidget = countChart.GetNativeWidget<Widget> ();
+ countWidget.Visible = true;
foreach (Serie s in currentSeries) {
countChart.RemoveSerie (s);
timeChart.RemoveSerie (s);
}
-
+
UpdateCharView ();
-
+
foreach (ChartSerieInfo si in view.Series) {
si.UpdateSerie ();
countChart.AddSerie (si.Serie);
currentSeries.Add (si.Serie);
}
-
+
DateTime t = DateTime.Now;
chartScroller.Adjustment.Upper = t.Ticks;
UpdatePageSize ();
@@ -269,28 +270,28 @@ namespace Mono.Instrumentation.Monitor
FillValuesList ();
}
}
-
+
void FillValuesList ()
{
listViewStore.Clear ();
List<ListViewValueInfo> values = new List<ListViewValueInfo> ();
-
+
foreach (var serie in view.Series.Where (s => s.Visible)) {
foreach (CounterValue val in serie.Counter.GetValues ())
values.Add (new ListViewValueInfo () { Serie=serie, Value=val });
}
-
+
values.Sort (delegate (ListViewValueInfo v1, ListViewValueInfo v2) {
return v1.Value.TimeStamp.CompareTo (v2.Value.TimeStamp);
});
-
+
foreach (ListViewValueInfo vinfo in values) {
CounterValue val = vinfo.Value;
string time = val.TimeStamp.ToLongTimeString ();
listViewStore.AppendValues (vinfo, vinfo.Serie.ColorIcon, vinfo.Serie.Counter.Name, time, val.Value.ToString (), val.TotalCount.ToString (), val.HasTimerTraces ? val.Duration.TotalMilliseconds.ToString () : "");
}
}
-
+
void UpdateCharView ()
{
countChart.StartX = startTime.Ticks;
@@ -300,14 +301,14 @@ namespace Mono.Instrumentation.Monitor
countChart.OriginX = countChart.StartX;
timeChart.OriginX = timeChart.StartX;
}
-
+
uint scrollFunc;
-
+
void StartAutoscroll ()
{
scrollFunc = GLib.Timeout.Add (1000, ScrollCharts);
}
-
+
void StopAutoscroll ()
{
if (scrollFunc != 0) {
@@ -315,13 +316,13 @@ namespace Mono.Instrumentation.Monitor
scrollFunc = 0;
}
}
-
+
bool IsShowingLatest {
get {
return (chartScroller.Value == chartScroller.Adjustment.Upper - chartScroller.Adjustment.PageSize);
}
}
-
+
bool ScrollCharts ()
{
double ticks = DateTime.Now.Ticks;
@@ -330,7 +331,7 @@ namespace Mono.Instrumentation.Monitor
chartScroller.Value = chartScroller.Adjustment.Upper - chartScroller.Adjustment.PageSize;
} else
chartScroller.Adjustment.Upper = ticks;
-
+
// If any of the counters has been disposed, update it
foreach (ChartSerieInfo info in view.Series) {
if (info.UpdateCounter ()) {
@@ -342,7 +343,7 @@ namespace Mono.Instrumentation.Monitor
view.UpdateSeries ();
return true;
}
-
+
void UpdateListValues ()
{
TreeIter it;
@@ -353,21 +354,21 @@ namespace Mono.Instrumentation.Monitor
continue;
CounterValue val = ci.Counter.LastValue;
seriesStore.SetValue (it, 4, val.Value.ToString ());
-
+
if (countChart.ActiveCursor != null) {
val = ci.Counter.GetValueAt (new DateTime ((long)countChart.ActiveCursor.Value));
seriesStore.SetValue (it, 5, val.Value.ToString ());
}
-
+
val = ci.Counter.GetValueAt (new DateTime ((long)countChart.SelectionStart.Value));
CounterValue val2 = ci.Counter.GetValueAt (new DateTime ((long)countChart.SelectionEnd.Value));
-
+
seriesStore.SetValue (it, 6, (val2.Value - val.Value).ToString ());
}
while (seriesStore.IterNext (ref it));
}
}
-
+
protected override void OnDestroyed ()
{
StopAutoscroll ();
@@ -391,7 +392,7 @@ namespace Mono.Instrumentation.Monitor
endTime = startTime + visibleTime;
UpdateCharView ();
}
-
+
void UpdatePageSize ()
{
chartScroller.Adjustment.PageSize = visibleTime.Ticks;
@@ -448,7 +449,7 @@ namespace Mono.Instrumentation.Monitor
{
originalView = v;
view = new ChartView ();
-
+
if (v.EditedView != null)
view = v.EditedView;
else {
@@ -461,7 +462,7 @@ namespace Mono.Instrumentation.Monitor
}
bool uppdatingToggles;
-
+
protected virtual void OnToggleListViewToggled (object sender, System.EventArgs e)
{
if (uppdatingToggles)
@@ -474,8 +475,8 @@ namespace Mono.Instrumentation.Monitor
uppdatingToggles = false;
UpdateCharts ();
}
-
-
+
+
protected virtual void OnToggleTimeViewToggled (object sender, System.EventArgs e)
{
if (uppdatingToggles)
@@ -488,7 +489,7 @@ namespace Mono.Instrumentation.Monitor
uppdatingToggles = false;
UpdateCharts ();
}
-
+
public void Save ()
{
originalView.CopyFrom (view);
@@ -522,7 +523,7 @@ namespace Mono.Instrumentation.Monitor
}
FillSelectedSeries ();
}
-
+
protected virtual void OnButtonAddCounterClicked (object sender, System.EventArgs e)
{
CounterSelectorDialog dlg = new CounterSelectorDialog ();
@@ -536,12 +537,10 @@ namespace Mono.Instrumentation.Monitor
dlg.Destroy ();
}
}
-
+
class ListViewValueInfo
{
public CounterValue Value;
public ChartSerieInfo Serie;
}
}
-
-
diff --git a/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs b/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs
index f1e16c50e5..ecf5101a59 100644
--- a/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs
+++ b/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs
@@ -47,8 +47,8 @@ namespace Mono.Instrumentation.Monitor
// TreeIter iterStart;
TreeIter iterTimers;
TreeIter iterTimerStats;
- Dictionary<ChartView,InstrumenationChartView> chartWidgets = new Dictionary<ChartView, InstrumenationChartView> ();
- InstrumenationChartView timersWidget;
+ Dictionary<ChartView,InstrumentationChartView> chartWidgets = new Dictionary<ChartView, InstrumentationChartView> ();
+ InstrumentationChartView timersWidget;
public InstrumentationViewerDialog (): base ("Instrumentation Monitor")
{
@@ -194,7 +194,7 @@ namespace Mono.Instrumentation.Monitor
if (store.GetPath (it).Equals (store.GetPath (iterTimers))) {
if (timersWidget == null) {
- timersWidget = new InstrumenationChartView (this);
+ timersWidget = new InstrumentationChartView (this);
timersWidget.ShowAllTimers ();
}
SetView (timersWidget, "Timers", false);
@@ -208,9 +208,9 @@ namespace Mono.Instrumentation.Monitor
else {
ChartView v = (ChartView) store.GetValue (it, 1);
if (v != null) {
- InstrumenationChartView cv;
+ InstrumentationChartView cv;
if (!chartWidgets.TryGetValue (v, out cv)) {
- cv = new InstrumenationChartView (this);
+ cv = new InstrumentationChartView (this);
chartWidgets [v] = cv;
cv.SetView (v);
}
@@ -258,17 +258,17 @@ namespace Mono.Instrumentation.Monitor
protected virtual void OnButtonSaveClicked (object sender, System.EventArgs e)
{
- ((InstrumenationChartView)viewBox.Child).Save ();
+ ((InstrumentationChartView)viewBox.Child).Save ();
}
protected virtual void OnButtonSaveAsClicked (object sender, System.EventArgs e)
{
- ((InstrumenationChartView)viewBox.Child).SaveAs ();
+ ((InstrumentationChartView)viewBox.Child).SaveAs ();
}
protected virtual void OnButtonDeleteClicked (object sender, System.EventArgs e)
{
- ((InstrumenationChartView)viewBox.Child).Delete ();
+ ((InstrumentationChartView)viewBox.Child).Delete ();
}
protected virtual void OnFlushMemoryActionActivated (object sender, System.EventArgs e)
diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumenationChartView.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs
index 05dd0d25aa..288c1812fa 100644
--- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumenationChartView.cs
+++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace Mono.Instrumentation.Monitor
{
- internal partial class InstrumenationChartView
+ internal partial class InstrumentationChartView
{
private global::Gtk.VBox vbox3;
private global::Gtk.HPaned hpaned2;
diff --git a/main/src/tools/mdmonitor/gtk-gui/gui.stetic b/main/src/tools/mdmonitor/gtk-gui/gui.stetic
index 3016971d49..49446c7ee4 100644
--- a/main/src/tools/mdmonitor/gtk-gui/gui.stetic
+++ b/main/src/tools/mdmonitor/gtk-gui/gui.stetic
@@ -9,7 +9,7 @@
<widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
<widget-library name="../../../../build/bin/mdmonitor.exe" internal="true" />
</import>
- <widget class="Gtk.Bin" id="Mono.Instrumentation.Monitor.InstrumenationChartView" design-size="632 482">
+ <widget class="Gtk.Bin" id="Mono.Instrumentation.Monitor.InstrumentationChartView" design-size="632 482">
<property name="MemberName" />
<property name="Visible">False</property>
<property name="GeneratePublic">False</property>
@@ -1000,4 +1000,241 @@
</widget>
</child>
</widget>
+ <widget class="Gtk.Bin" id="Mono.Instrumentation.Monitor.InstrumentationChartView" design-size="632 482">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
+ <child>
+ <widget class="Gtk.VBox" id="vbox3">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HPaned" id="hpaned2">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Position">471</property>
+ <child>
+ <widget class="Gtk.HBox" id="hbox4">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.VBox" id="boxCharts">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HBox" id="hboxChartBar">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.ToggleButton" id="toggleTimeView">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">Time View</property>
+ <property name="UseUnderline">True</property>
+ <property name="Relief">None</property>
+ <signal name="Toggled" handler="OnToggleTimeViewToggled" />
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.ToggleButton" id="toggleListView">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">List View</property>
+ <property name="UseUnderline">True</property>
+ <property name="Relief">None</property>
+ <signal name="Toggled" handler="OnToggleListViewToggled" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonZoomOut">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextAndIcon</property>
+ <property name="Icon">stock:gtk-zoom-out Menu</property>
+ <property name="Label" translatable="yes" />
+ <property name="UseUnderline">True</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="OnButtonZoomOutClicked" />
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonZoomIn">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextAndIcon</property>
+ <property name="Icon">stock:gtk-zoom-in Menu</property>
+ <property name="Label" translatable="yes" />
+ <property name="UseUnderline">True</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="OnButtonZoomInClicked" />
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">3</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="frameCharts">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <widget class="Gtk.HScrollbar" id="chartScroller">
+ <property name="MemberName" />
+ <property name="Upper">100</property>
+ <property name="PageIncrement">10</property>
+ <property name="PageSize">10</property>
+ <property name="StepIncrement">1</property>
+ <signal name="ValueChanged" handler="OnChartScrollerValueChanged" />
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Resize">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="vbox5">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HBox" id="hboxSeriesBar">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Button" id="buttonRemoveCounter">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-remove</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="OnButtonRemoveCounterClicked" />
+ <property name="label">gtk-remove</property>
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonAddCounter">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-add</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="OnButtonAddCounterClicked" />
+ <property name="label">gtk-add</property>
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow1">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TreeView" id="listSeries">
+ <property name="MemberName" />
+ <property name="WidthRequest">100</property>
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ <property name="HeadersVisible">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Resize">False</property>
+ <property name="Shrink">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</stetic-interface> \ No newline at end of file
diff --git a/main/src/tools/mdmonitor/mdmonitor.csproj b/main/src/tools/mdmonitor/mdmonitor.csproj
index ca74e1052c..586b5538fd 100644
--- a/main/src/tools/mdmonitor/mdmonitor.csproj
+++ b/main/src/tools/mdmonitor/mdmonitor.csproj
@@ -54,13 +54,11 @@
<Compile Include="Main.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="CounterSelectorDialog.cs" />
- <Compile Include="InstrumenationChartView.cs" />
<Compile Include="InstrumentationViewerDialog.cs" />
<Compile Include="TimeLineView.cs" />
<Compile Include="TimeLineViewWindow.cs" />
<Compile Include="NewProfile.cs" />
<Compile Include="gtk-gui\Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs" />
- <Compile Include="gtk-gui\Mono.Instrumentation.Monitor.InstrumenationChartView.cs" />
<Compile Include="gtk-gui\Mono.Instrumentation.Monitor.NewProfile.cs" />
<Compile Include="gtk-gui\Mono.Instrumentation.Monitor.CounterSelectorDialog.cs" />
<Compile Include="gtk-gui\Mono.Instrumentation.Monitor.TimeLineViewWindow.cs" />
@@ -81,6 +79,8 @@
<Compile Include="..\..\addins\MacPlatform\MacInterop\CoreFoundation.cs">
<Link>MacIntegration\CoreFoundation.cs</Link>
</Compile>
+ <Compile Include="InstrumentationChartView.cs" />
+ <Compile Include="gtk-gui\Mono.Instrumentation.Monitor.InstrumentationChartView.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
diff --git a/main/tests/MonoDevelop.CSharpBinding.Tests/Features/CodeCompletion/NR6/MiscTests.cs b/main/tests/MonoDevelop.CSharpBinding.Tests/Features/CodeCompletion/NR6/MiscTests.cs
index ef253271ff..67b479e03b 100644
--- a/main/tests/MonoDevelop.CSharpBinding.Tests/Features/CodeCompletion/NR6/MiscTests.cs
+++ b/main/tests/MonoDevelop.CSharpBinding.Tests/Features/CodeCompletion/NR6/MiscTests.cs
@@ -108,5 +108,37 @@ public class MyClass
Assert.IsNotNull (provider, "provider was not created.");
Assert.AreEqual (false, provider.AutoSelect);
}
+
+ /// <summary>
+ /// Bug 37573 - [roslyn] Excessive namespace prefix inserted by code completion
+ /// </summary>
+ [Test]
+ public void TestBug37573 ()
+ {
+ var provider = CreateProvider (
+ @"
+using System;
+
+namespace TestProject
+{
+ class TestClass
+ {
+ public enum FooBar { Foo, Bar }
+ }
+
+ class MainClass
+ {
+ void Test ()
+ {
+ TestClass.FooBar fb;
+ $if (fb == $
+ }
+ }
+}
+");
+ Assert.IsNotNull (provider, "provider was not created.");
+ Assert.IsNull (provider.Find ("TestProject.TestClass.FooBar.Bar"));
+ Assert.IsNotNull (provider.Find ("TestClass.FooBar.Bar"));
+ }
}
} \ No newline at end of file
diff --git a/main/tests/MonoDevelop.CSharpBinding.Tests/Features/CodeCompletion/PortedRoslynTests/CompletionTestBase.cs b/main/tests/MonoDevelop.CSharpBinding.Tests/Features/CodeCompletion/PortedRoslynTests/CompletionTestBase.cs
index 256a93dcb0..27bcb39f5b 100644
--- a/main/tests/MonoDevelop.CSharpBinding.Tests/Features/CodeCompletion/PortedRoslynTests/CompletionTestBase.cs
+++ b/main/tests/MonoDevelop.CSharpBinding.Tests/Features/CodeCompletion/PortedRoslynTests/CompletionTestBase.cs
@@ -35,6 +35,12 @@ namespace ICSharpCode.NRefactory6.CSharp.CodeCompletion.Roslyn
{
public class CompletionTestBase
{
+ [TestFixtureSetUp]
+ public void Setup ()
+ {
+ Xwt.Application.Initialize ();
+ Gtk.Application.Init ();
+ }
internal virtual CompletionContextHandler CreateContextHandler()
{
diff --git a/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding.Tests.csproj b/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding.Tests.csproj
index 8abeae4c19..cd9a23f2c3 100644
--- a/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding.Tests.csproj
+++ b/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding.Tests.csproj
@@ -58,6 +58,9 @@
<HintPath>..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
+ <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Features\CodeCompletion\NR5\BrowsableAttributeTests.cs" />
@@ -129,6 +132,10 @@
<Project>{D12F0F7B-8DE3-43EC-BA49-41052D065A9B}</Project>
<Name>GuiUnit_NET_4_5</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\external\xwt\Xwt\Xwt.csproj">
+ <Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project>
+ <Name>Xwt</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Features\IndentEngine\" />
diff --git a/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestViewContent.cs b/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestViewContent.cs
index ab82503708..3295f3e0e5 100644
--- a/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestViewContent.cs
+++ b/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestViewContent.cs
@@ -1,4 +1,4 @@
-//
+//
// TestViewContent.cs
//
// Author:
@@ -29,19 +29,20 @@
using System;
using System.Linq;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Editor;
using MonoDevelop.Core.Text;
+using System.Threading.Tasks;
namespace MonoDevelop.CSharpBinding.Tests
{
- public class TestViewContent : AbstractViewContent
+ public class TestViewContent : ViewContent
{
TextEditor data;
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return null;
}
@@ -65,19 +66,11 @@ namespace MonoDevelop.CSharpBinding.Tests
Contents.Add (data);
Name = "";
}
-
- public override void Load(FileOpenInformation fileOpenInformation)
- {
- }
- public override string ContentName {
- get {
- return base.ContentName;
- }
- set {
- base.ContentName = value;
- Name = value;
- }
+ protected override void OnContentNameChanged ()
+ {
+ base.OnContentNameChanged ();
+ Name = ContentName;
}
FilePath name;
@@ -212,14 +205,9 @@ namespace MonoDevelop.CSharpBinding.Tests
public List<object> Contents = new List<object> ();
- public override object GetContent (Type type)
- {
- return Contents.FirstOrDefault (type.IsInstanceOfType) ?? base.GetContent (type);
- }
-
- public override IEnumerable<T> GetContents<T> ()
- {
- return Contents.OfType<T> ();
+ protected override IEnumerable<object> OnGetContents (Type type)
+ {
+ return base.OnGetContents(type).Concat (Contents.Where (c => type.IsInstanceOfType (c)));
}
public IDisposable OpenUndoGroup ()
diff --git a/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestWorkbenchWindow.cs b/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestWorkbenchWindow.cs
index 720120e7f4..4758dfdfc5 100644
--- a/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestWorkbenchWindow.cs
+++ b/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestWorkbenchWindow.cs
@@ -62,8 +62,8 @@ namespace MonoDevelop.CSharpBinding
set {}
}
- IViewContent viewContent;
- public IViewContent ViewContent {
+ ViewContent viewContent;
+ public ViewContent ViewContent {
get { return viewContent; }
set { viewContent = value; }
}
@@ -72,9 +72,9 @@ namespace MonoDevelop.CSharpBinding
get { return AddinManager.AddinEngine; }
}
- public IEnumerable<IAttachableViewContent> SubViewContents { get { return new IAttachableViewContent[0]; } }
+ public IEnumerable<BaseViewContent> SubViewContents { get { return new BaseViewContent[0]; } }
- public IBaseViewContent ActiveViewContent {
+ public BaseViewContent ActiveViewContent {
get { return ViewContent;}
set {}
}
@@ -91,7 +91,7 @@ namespace MonoDevelop.CSharpBinding
public void SwitchView (int viewNumber)
{
}
- public void SwitchView (IAttachableViewContent view)
+ public void SwitchView (BaseViewContent view)
{
}
@@ -104,17 +104,17 @@ namespace MonoDevelop.CSharpBinding
return -1;
}
- public void AttachViewContent (IAttachableViewContent subViewContent)
+ public void AttachViewContent (BaseViewContent subViewContent)
{
}
- public void InsertViewContent (int index, IAttachableViewContent subViewContent)
+ public void InsertViewContent (int index, BaseViewContent subViewContent)
{
}
- public DocumentToolbar GetToolbar (IBaseViewContent targetView)
+ public DocumentToolbar GetToolbar (BaseViewContent targetView)
{
throw new NotImplementedException ();
}
@@ -125,7 +125,7 @@ namespace MonoDevelop.CSharpBinding
public event ActiveViewContentEventHandler ActiveViewContentChanged;
public event EventHandler ViewsChanged;
- DocumentToolbar IWorkbenchWindow.GetToolbar (IBaseViewContent targetView)
+ DocumentToolbar IWorkbenchWindow.GetToolbar (BaseViewContent targetView)
{
throw new System.NotImplementedException ();
}
diff --git a/main/tests/UnitTests/MonoDevelop.Ide.Templates/TestableWizardPage.cs b/main/tests/UnitTests/MonoDevelop.Ide.Templates/TestableWizardPage.cs
index ee368d6dbe..76ed0b3155 100644
--- a/main/tests/UnitTests/MonoDevelop.Ide.Templates/TestableWizardPage.cs
+++ b/main/tests/UnitTests/MonoDevelop.Ide.Templates/TestableWizardPage.cs
@@ -32,7 +32,7 @@ namespace MonoDevelop.Ide.Templates
{
protected override object CreateNativeWidget ()
{
- return new Control (new Gtk.EventBox ());
+ return new Gtk.EventBox ();
}
public int PageNumber;