diff options
author | Jeffrey Stedfast <jeff@xamarin.com> | 2013-08-13 02:04:16 +0400 |
---|---|---|
committer | Jeffrey Stedfast <jeff@xamarin.com> | 2013-08-13 02:04:16 +0400 |
commit | 54a64a751b7070237368b7967cc4a6adff6bc468 (patch) | |
tree | ac65fc1be4ac731aeec1fe28c09d918c3a4a6473 /main/src/core/Mono.Texteditor | |
parent | d44c1229550441d9198217493b34f9eca9715557 (diff) |
Revert "Fix hundreds of warnings"
This reverts commit 1db8e4676941210b5bf7c68e01f70e1b85cd2a41.
Diffstat (limited to 'main/src/core/Mono.Texteditor')
29 files changed, 139 insertions, 96 deletions
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/HighlightingPartitioner.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/HighlightingPartitioner.cs new file mode 100644 index 0000000000..2b9b8eb581 --- /dev/null +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/HighlightingPartitioner.cs @@ -0,0 +1,47 @@ +//// HighlightingPartitioner.cs +//// +//// Author: +//// Mike Krüger <mkrueger@novell.com> +//// +//// Copyright (c) 2010 Novell, Inc (http://www.novell.com) +//// +//// Permission is hereby granted, free of charge, to any person obtaining a copy +//// of this software and associated documentation files (the "Software"), to deal +//// in the Software without restriction, including without limitation the rights +//// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +//// copies of the Software, and to permit persons to whom the Software is +//// furnished to do so, subject to the following conditions: +//// +//// The above copyright notice and this permission notice shall be included in +//// all copies or substantial portions of the Software. +//// +//// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +//// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +//// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +//// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +//// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +//// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +//// THE SOFTWARE. +// +//using System; +// +//namespace Mono.TextEditor.Highlighting +//{ +// public class HighlightingPartitioner : AbstractPartitioner +// { +// public override void TextReplaced (ReplaceEventArgs args) +// { +///* // TODO: Implement span rule based document partitioner +// var mode = Document.SyntaxMode; +// var node = GetTreeNodeAtOffset (args.Offset); +// base.ChangeLength (node.value, node.value.Length - args.Count); +// if (args.Value == null) +// return; +// +// for (int i = args.Offset; i < args.Offset + args.Value.Length; i++) { +// +// }*/ +// } +// } +//} +// diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs index fe014cdddf..4528b281cd 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs @@ -141,28 +141,28 @@ namespace Mono.TextEditor.PopupWindow layout.GetPixelSize (out width, out height); width += xBorder * 2; FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, false, 0.5, 0.5, height + yBorder * 2 + 1.5, width, height + yBorder * 2); - g.SetSourceColor (titleBgColor); + g.Color = titleBgColor; g.FillPreserve (); - g.SetSourceColor (borderColor); + g.Color = borderColor; g.Stroke (); g.Save (); - g.SetSourceColor (textColor); + g.Color = textColor; g.Translate (xBorder, yBorder); g.ShowLayout (layout); g.Restore (); FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, 0.5, height * 2 + yBorder * 2 + 0.5, height, Allocation.Width - 1, Allocation.Height - height * 2 - yBorder * 2 - 1); - g.SetSourceColor (bgColor); + g.Color = bgColor; g.FillPreserve (); - g.SetSourceColor (borderColor); + g.Color = borderColor; g.Stroke (); g.MoveTo (xSpacer + 0.5, height * 2 + yBorder * 2); g.LineTo (xSpacer + 0.5, Allocation.Height - 1); - g.SetSourceColor (gridColor); + g.Color = gridColor; g.Stroke (); int y = height + yBorder * 2; @@ -175,26 +175,26 @@ namespace Mono.TextEditor.PopupWindow if (i == 0) { FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, false, false, 0, y + 0.5, height + 1.5, Allocation.Width, height); - g.SetSourceColor (categoryBgColor); + g.Color = categoryBgColor; g.FillPreserve (); - g.SetSourceColor (borderColor); + g.Color = borderColor; g.Stroke (); g.MoveTo (xSpacer + 0.5, height + yBorder * 2 + 1); g.LineTo (xSpacer + 0.5, height * 2 + yBorder * 2 + 1); - g.SetSourceColor (gridColor); + g.Color = gridColor; g.Stroke (); } gc.RgbFgColor = (HslColor)(i == 0 ? bgColor : textColor); g.Save (); - g.SetSourceColor (textColor); + g.Color = textColor; g.Translate (xBorder, y); g.ShowLayout (layout); g.Restore (); g.Save (); - g.SetSourceColor (textColor); + g.Color = textColor; g.Translate (xSpacer + xBorder, y); layout.SetMarkup (pair.Value); g.ShowLayout (layout); @@ -204,7 +204,7 @@ namespace Mono.TextEditor.PopupWindow if (i > 0) { g.MoveTo (1, y + 0.5); g.LineTo (Allocation.Width - 1, y + 0.5); - g.SetSourceColor (gridColor); + g.Color = gridColor; g.Stroke (); } y += height; @@ -297,14 +297,14 @@ namespace Mono.TextEditor.PopupWindow } else { g.Rectangle (0, 0, Allocation.Width, height + yTitleBorder * 2); } - g.SetSourceColor (titleBgColor); + g.Color = titleBgColor; g.FillPreserve (); - g.SetSourceColor (borderColor); + g.Color = borderColor; g.Stroke (); g.MoveTo (tw + xDescriptionBorder, yTitleBorder); - g.SetSourceColor (titleTextColor); + g.Color = titleTextColor; g.ShowLayout (titleLayout); if (SupportsAlpha) { @@ -312,9 +312,9 @@ namespace Mono.TextEditor.PopupWindow } else { g.Rectangle (0, height + yTitleBorder * 2, Allocation.Width, Allocation.Height - height - yTitleBorder * 2); } - g.SetSourceColor (bgColor); + g.Color = bgColor; g.FillPreserve (); - g.SetSourceColor (borderColor); + g.Color = borderColor; g.Stroke (); if (SupportsAlpha) { @@ -325,19 +325,19 @@ namespace Mono.TextEditor.PopupWindow g.LineTo (tw + 5, Allocation.Height / 2 + th / 2); g.LineTo (tw + 5, Allocation.Height / 2 - th / 2); g.ClosePath (); - g.SetSourceColor (bgColor); + g.Color = bgColor; g.Fill (); g.MoveTo (tw, Allocation.Height / 2 - th / 2); g.LineTo (0, Allocation.Height / 2); g.LineTo (tw, Allocation.Height / 2 + th / 2); - g.SetSourceColor (borderColor); + g.Color = borderColor; g.Stroke (); } int y = height + yTitleBorder * 2 + yDescriptionBorder; g.MoveTo (tw + xDescriptionBorder, y); - g.SetSourceColor (textColor); + g.Color = textColor; g.ShowLayout (descriptionLayout); } return base.OnExposeEvent (args); diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs index bde15cf5fd..6b811236fc 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs @@ -258,7 +258,7 @@ namespace Mono.TextEditor.Theatrics cr.SharpLineY (alloc.X, alloc.Y, right, alloc.Y); cr.SharpLineY (alloc.X, bottom, right, bottom); - cr.SetSourceColor ((HslColor)Style.Dark (State)); + cr.Color = (HslColor)Style.Dark (State); cr.Stroke (); } } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs index 3911ebc364..2f4b3c1d71 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs @@ -211,9 +211,9 @@ namespace Mono.TextEditor.Utils var dataB = new DiffData<T> (changedArray); int MAX = dataA.Length + dataB.Length + 1; - // vector for the (0,0) to (x,y) search + /// vector for the (0,0) to (x,y) search int[] downVector = new int[2 * MAX + 2]; - // vector for the (u,v) to (N,M) search + /// vector for the (u,v) to (N,M) search int[] upVector = new int[2 * MAX + 2]; LCS (dataA, 0, dataA.Length, dataB, 0, dataB.Length, downVector, upVector); @@ -552,7 +552,7 @@ namespace Mono.TextEditor.Utils /// <summary> /// Initialize the Diff-Data buffer. /// </summary> - /// <param name="initData">reference to the buffer</param> + /// <param name="data">reference to the buffer</param> public DiffData (T[] initData) { Data = initData; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs index 5b9a577a2a..37fefdfc59 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs @@ -216,7 +216,7 @@ namespace Mono.TextEditor.Utils } /// <summary> - /// Returns a byte array containing the text encoded by a specified encoding & bom. + /// Returns a byte array containing the text encoded by a specified encoding & bom. /// </summary> /// <param name="text">The text to encode.</param> /// <param name="encoding">The encoding.</param> diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs index 9e96343302..a3270a48dd 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs @@ -109,7 +109,7 @@ namespace Mono.TextEditor.Vi { using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { cr.Rectangle (evnt.Region.Clipbox.X, evnt.Region.Clipbox.Y, evnt.Region.Clipbox.Width, evnt.Region.Clipbox.Height); - cr.SetSourceColor (editor.ColorStyle.PlainText.Background); + cr.Color = editor.ColorStyle.PlainText.Background; cr.Fill (); using (var layout = PangoUtil.CreateLayout (editor)) { layout.FontDescription = editor.Options.Font; @@ -135,7 +135,7 @@ namespace Mono.TextEditor.Vi statusw += 8; cr.MoveTo (Allocation.Width - statusw, 0); statusw += 8; - cr.SetSourceColor (editor.ColorStyle.PlainText.Foreground); + cr.Color = editor.ColorStyle.PlainText.Foreground; cr.ShowLayout (layout); layout.SetText (statusText ?? ""); @@ -143,7 +143,7 @@ namespace Mono.TextEditor.Vi layout.GetPixelSize (out w, out h); var x = System.Math.Min (0, -w + Allocation.Width - editor.TextViewMargin.CharWidth - statusw); cr.MoveTo (x, 0); - cr.SetSourceColor (editor.ColorStyle.PlainText.Foreground); + cr.Color = editor.ColorStyle.PlainText.Foreground; cr.ShowLayout (layout); if (ShowCaret) { if (editor.TextViewMargin.caretBlink) { diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj b/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj index d2f941586d..94be179cff 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj @@ -132,6 +132,7 @@ <Compile Include="Mono.TextEditor.PopupWindow\ModeHelpWindow.cs" /> <Compile Include="Mono.TextEditor.Highlighting\CloneableStack.cs" /> <Compile Include="Mono.TextEditor.Utils\Diff.cs" /> + <Compile Include="Mono.TextEditor.Highlighting\HighlightingPartitioner.cs" /> <Compile Include="Mono.TextEditor.Vi\ViEditorActions.cs" /> <Compile Include="Mono.TextEditor.Vi\ViBuilderContext.cs" /> <Compile Include="Mono.TextEditor.Vi\ViBuilders.cs" /> diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs index b4e2c54cd9..c6aa975d56 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs @@ -64,14 +64,14 @@ namespace Mono.TextEditor using (var pat = new Cairo.LinearGradient (x + width / 4, y, x + width / 2, y + height - 4)) { pat.AddColorStop (0, color1); pat.AddColorStop (1, color2); - cr.SetSource (pat); + cr.Pattern = pat; cr.FillPreserve (); } using (var pat = new Cairo.LinearGradient (x, y + height, x + width, y)) { pat.AddColorStop (0, color2); //pat.AddColorStop (1, color1); - cr.SetSource (pat); + cr.Pattern = pat; cr.Stroke (); } } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs index 2f73455320..8ff5bdade3 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs @@ -225,7 +225,7 @@ namespace Mono.TextEditor /// This method gets the line indentation. /// </summary> /// <param name="doc"> - /// The <see cref="TextDocument"/> the line belongs to. + /// The <see cref="Document"/> the line belongs to. /// </param> /// <returns> /// The indentation of the line (all whitespace chars up to the first non ws char). diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentRegion.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentRegion.cs index a301dd5584..31de8d1692 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentRegion.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentRegion.cs @@ -28,7 +28,7 @@ using System; namespace Mono.TextEditor { /// <summary> - /// An (Begin, End) pair representing a document span. It's a TextSegment working with lines & columns instead of offsets. + /// An (Begin, End) pair representing a document span. It's a TextSegment working with lines & columns instead of offsets. /// </summary> public struct DocumentRegion : IEquatable<DocumentRegion> { diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs index e0ac644faf..21cdfbf588 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs @@ -38,7 +38,7 @@ using System.Threading; namespace Mono.TextEditor { - public class TextDocument : ICSharpCode.NRefactory.AbstractAnnotatable, ICSharpCode.NRefactory.Editor.IDocument + public class TextDocument : AbstractAnnotatable, ICSharpCode.NRefactory.Editor.IDocument { readonly IBuffer buffer; readonly ILineSplitter splitter; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs index ba069dfc6e..336a2b251f 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs @@ -64,7 +64,7 @@ namespace Mono.TextEditor return; } cr.Rectangle (x, y, Width, lineHeight); - cr.SetSourceColor (editor.ColorStyle.LineNumbers.Background); + cr.Color = editor.ColorStyle.LineNumbers.Background; cr.Fill (); } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs index 154111bc09..52c6a37ac3 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs @@ -53,7 +53,7 @@ namespace Mono.TextEditor { cr.MoveTo (x + 0.5, y); cr.LineTo (x + 0.5, y + lineHeight); - cr.SetSourceColor (color); + cr.Color = color; cr.Stroke (); } } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs index ec7a80d2ad..69e0c568be 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs @@ -265,9 +265,9 @@ namespace Mono.TextEditor var drawArea = new Cairo.Rectangle (System.Math.Floor (x + (Width - foldSegmentSize) / 2) + 0.5, System.Math.Floor (y + (editor.LineHeight - foldSegmentSize) / 2) + 0.5, foldSegmentSize, foldSegmentSize); ctx.Rectangle (drawArea); - ctx.SetSourceColor (isOpen ? foldBgGC : foldToggleMarkerBackground); + ctx.Color = isOpen ? foldBgGC : foldToggleMarkerBackground; ctx.FillPreserve (); - ctx.SetSourceColor (isSelected ? foldLineHighlightedGC : foldLineGC); + ctx.Color = isSelected ? foldLineHighlightedGC : foldLineGC; ctx.Stroke (); ctx.DrawLine (isSelected ? foldLineHighlightedGC : foldToggleMarkerGC, @@ -353,18 +353,18 @@ namespace Mono.TextEditor } cr.Rectangle (drawArea); - cr.SetSourceColor (bgGC); + cr.Color = bgGC; cr.Fill (); } } if (editor.Options.EnableQuickDiff) { if (state == TextDocument.LineState.Changed) { - cr.SetSourceColor (lineStateChangedGC); + cr.Color = lineStateChangedGC; cr.Rectangle (x + 1, y, marginWidth / 3, lineHeight); cr.Fill (); } else if (state == TextDocument.LineState.Dirty) { - cr.SetSourceColor (lineStateDirtyGC); + cr.Color = lineStateDirtyGC; cr.Rectangle (x + 1, y, marginWidth / 3, lineHeight); cr.Fill (); } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs index 2a1422565f..81f6d8d535 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs @@ -91,7 +91,7 @@ namespace Mono.TextEditor double brightness = HslColor.Brightness (editor.ColorStyle.PlainText.Background); int colorCount = foldSegments.Count + 2; - cr.SetSourceColor (GetColor (-1, brightness, colorCount)); + cr.Color = GetColor (-1, brightness, colorCount); cr.Rectangle (area); cr.Fill (); var rectangles = new Cairo.Rectangle[foldSegments.Count]; @@ -184,7 +184,7 @@ namespace Mono.TextEditor } var bg = editor.ColorStyle.PlainText.Foreground; - cr.SetSourceRGBA (bg.R, bg.G, bg.B, alpha); + cr.Color = new Cairo.Color (bg.R, bg.G, bg.B, alpha); DrawRoundRectangle (cr, true, true, rect.X - editor.HAdjustment.Value - curPadSize , rect.Y - editor.VAdjustment.Value - curPadSize, editor.LineHeight / 2, rect.Width + curPadSize * 2, rect.Height + curPadSize * 2); cr.Fill (); @@ -192,7 +192,7 @@ namespace Mono.TextEditor var animationState = age / (double)animationLength; curPadSize = (int)(2 + System.Math.Sin (System.Math.PI * animationState) * 2); DrawRoundRectangle (cr, true, true, rect.X - editor.HAdjustment.Value - curPadSize, rect.Y - editor.VAdjustment.Value - curPadSize, editor.LineHeight / 2, rect.Width + curPadSize * 2, rect.Height + curPadSize * 2); - cr.SetSourceColor (GetColor (i, brightness, colorCount)); + cr.Color = GetColor (i, brightness, colorCount); cr.Fill (); continue; @@ -201,7 +201,7 @@ namespace Mono.TextEditor DrawRoundRectangle (cr, true, true, rect.X - editor.HAdjustment.Value, rect.Y - editor.VAdjustment.Value, editor.LineHeight / 2, rect.Width, rect.Height); - cr.SetSourceColor (GetColor (i, brightness, colorCount)); + cr.Color = GetColor (i, brightness, colorCount); cr.Fill (); } } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs index bda3a23761..ddf817821f 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs @@ -549,7 +549,7 @@ namespace Mono.TextEditor /// <summary>Map raw GTK key input to work around platform bugs and decompose accelerator keys</summary> /// <param name='evt'>The raw key event</param> /// <param name='key'>The composed key</param> - /// <param name='state'>The composed modifiers</param> + /// <param name='mod'>The composed modifiers</param> /// <param name='shortcuts'>All the key/modifier decompositions that can be used as accelerators</param> public static void MapKeys (Gdk.EventKey evt, out Gdk.Key key, out Gdk.ModifierType state, out KeyboardShortcut[] shortcuts) diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs index b4c9d22b1b..b660d68967 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs @@ -216,7 +216,7 @@ namespace Mono.TextEditor return; } cr.Rectangle (x, y, Width, lineHeight); - cr.SetSourceColor (lineNumberBgGC); + cr.Color = lineNumberBgGC; cr.Fill (); } @@ -246,7 +246,7 @@ namespace Mono.TextEditor layout.SetText (line.ToString ()); cr.Save (); cr.Translate (x + (int)Width + (editor.Options.ShowFoldMargin ? 0 : -2), y + (lineHeight - fontHeight) / 2); - cr.SetSourceColor (lineNumberGC); + cr.Color = lineNumberGC; cr.ShowLayout (layout); cr.Restore (); } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs index 3f9e4378b3..21209559c5 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs @@ -148,12 +148,12 @@ namespace Mono.TextEditor if (!backgroundIsDrawn) { ctx.Rectangle (x, y, Width, lineHeight); - ctx.SetSourceColor (backgroundColor); + ctx.Color = backgroundColor; ctx.Fill (); ctx.MoveTo (x + Width - 0.5, y); ctx.LineTo (x + Width - 0.5, y + lineHeight); - ctx.SetSourceColor (separatorColor); + ctx.Color = separatorColor; ctx.Stroke (); } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/PangoUtil.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/PangoUtil.cs index dfb3c7a5af..f6a74bd258 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/PangoUtil.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/PangoUtil.cs @@ -41,7 +41,7 @@ namespace Mono.TextEditor internal const string LIBPANGOCAIRO = "libpangocairo-1.0-0.dll"; /// <summary> - /// This doesn't leak Pango layouts, unlike some other ways to create them in GTK# <= 2.12.11 + /// This doesn't leak Pango layouts, unlike some other ways to create them in GTK# <= 2.12.11 /// </summary> public static Pango.Layout CreateLayout (Widget widget) { diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs index eca35400f2..7cafe4a333 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs @@ -2292,7 +2292,7 @@ namespace Mono.TextEditor Cairo.Color color = editor.ColorStyle.PlainText.Foreground; color.A = 0.8; cr.LineWidth = editor.Options.Zoom; - cr.SetSourceColor (color); + cr.Color = color; cr.Stroke (); cr.ResetClip (); } @@ -2356,7 +2356,7 @@ namespace Mono.TextEditor Cairo.Color color = editor.ColorStyle.PlainText.Foreground; color.A = 0.8; cr.LineWidth = editor.Options.Zoom; - cr.SetSourceColor (color); + cr.Color = color; cr.Stroke (); cr.ResetClip (); } @@ -2380,7 +2380,7 @@ namespace Mono.TextEditor /// <summary> /// Initiate a pulse at the specified document location /// </summary> - /// <param name="pulseStart"> + /// <param name="pulseLocation"> /// A <see cref="DocumentLocation"/> /// </param> public void PulseCharacter (DocumentLocation pulseStart) @@ -2542,7 +2542,7 @@ namespace Mono.TextEditor //fill in the highlight rect with solid white to prevent alpha blending artifacts on the corners FoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, 0, 0, corner, width, height); - cr.SetSourceRGB (1, 1, 1); + cr.Color = new Cairo.Color (1, 1, 1); cr.Fill (); //draw the shadow @@ -2550,7 +2550,7 @@ namespace Mono.TextEditor shadowOffset, shadowOffset, corner, width, height); var color = TextViewMargin.DimColor (Editor.ColorStyle.SearchResultMain.Color, 0.3); color.A = 0.5 * opacity * opacity; - cr.SetSourceColor (color); + cr.Color = color; cr.Fill (); //draw the highlight rectangle @@ -2566,13 +2566,13 @@ namespace Mono.TextEditor Editor.ColorStyle.SearchResultMain.Color, 1 - opacity); gradient.AddColorStop (1, color); - cr.SetSource (gradient); + cr.Pattern = gradient; cr.Fill (); } //and finally the text cr.Translate (area.X, area.Y); - cr.SetSourceRGB (0, 0, 0); + cr.Color = new Cairo.Color (0, 0, 0); cr.ShowLayout (layout); } @@ -3204,8 +3204,8 @@ namespace Mono.TextEditor var childRectangle = new Gdk.Rectangle (child.X, child.Y, req.Width, req.Height); if (!child.FixedPosition) { // double zoom = Options.Zoom; - childRectangle.X = (int)(child.X /* * zoom */- HAdjustment.Value); - childRectangle.Y = (int)(child.Y /* * zoom */- VAdjustment.Value); + childRectangle.X = (int)(child.X /** zoom */- HAdjustment.Value); + childRectangle.Y = (int)(child.Y /** zoom */- VAdjustment.Value); } // childRectangle.X += allocation.X; // childRectangle.Y += allocation.Y; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs index dc8db1fbac..a031ffde40 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs @@ -1103,7 +1103,7 @@ namespace Mono.TextEditor /// <summary> /// Initiate a pulse at the specified document location /// </summary> - /// <param name="pulseStart"> + /// <param name="pulseLocation"> /// A <see cref="DocumentLocation"/> /// </param> public void PulseCharacter (DocumentLocation pulseStart) diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs index 190a424958..df3a14e617 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs @@ -739,7 +739,7 @@ namespace Mono.TextEditor caretRectangle.Y + caretRectangle.Height); break; case CaretMode.Block: - cr.SetSourceColor (color); + cr.Color = color; cr.Rectangle (caretRectangle.X + 0.5, caretRectangle.Y + 0.5, caretRectangle.Width, caretRectangle.Height); cr.Fill (); char caretChar = GetCaretChar (); @@ -748,7 +748,7 @@ namespace Mono.TextEditor layout.FontDescription = textEditor.Options.Font; layout.SetText (caretChar.ToString ()); cr.MoveTo (caretRectangle.X, caretRectangle.Y); - cr.SetSourceColor (textEditor.ColorStyle.PlainText.Background); + cr.Color = textEditor.ColorStyle.PlainText.Background; cr.ShowLayout (layout); } } @@ -1404,7 +1404,7 @@ namespace Mono.TextEditor } else { col = selected ? SelectionColor.Foreground : col = ColorStyle.PlainText.Foreground; } - ctx.SetSourceRGBA (col.R, col.G, col.B, whitespaceMarkerAlpha); + ctx.Color = new Cairo.Color (col.R, col.G, col.B, whitespaceMarkerAlpha); if (ch == '\t') { DrawTabMarker (ctx, selected, xpos, xpos2, y); @@ -1423,10 +1423,10 @@ namespace Mono.TextEditor var bracketMatch = new Cairo.Rectangle (xPos + rect.X / Pango.Scale.PangoScale + 0.5, y + 0.5, (rect.Width / Pango.Scale.PangoScale) - 1, (rect.Height / Pango.Scale.PangoScale) - 1); if (BackgroundRenderer == null) { - ctx.SetSourceColor (ColorStyle.BraceMatchingRectangle.Color); + ctx.Color = this.ColorStyle.BraceMatchingRectangle.Color; ctx.Rectangle (bracketMatch); ctx.FillPreserve (); - ctx.SetSourceColor (ColorStyle.BraceMatchingRectangle.SecondColor); + ctx.Color = this.ColorStyle.BraceMatchingRectangle.SecondColor; ctx.Stroke (); } } @@ -1445,14 +1445,14 @@ namespace Mono.TextEditor xPos = System.Math.Floor (xPos); cr.Rectangle (xPos, y, width, lineHeight); var color = CurrentLineColor; - cr.SetSourceColor (color.Color); + cr.Color = color.Color; cr.Fill (); double halfLine = (cr.LineWidth / 2.0); cr.MoveTo (xPos, y + halfLine); cr.LineTo (xPos + width, y + halfLine); cr.MoveTo (xPos, y + lineHeight - halfLine); cr.LineTo (xPos + width, y + lineHeight - halfLine); - cr.SetSourceColor (color.SecondColor); + cr.Color = color.SecondColor; cr.Stroke (); } @@ -1483,7 +1483,7 @@ namespace Mono.TextEditor cr.MoveTo (x + 0.5, top); cr.LineTo (x + 0.5, bottom); - cr.SetSourceColor (ColorStyle.IndentationGuide.Color); + cr.Color = ColorStyle.IndentationGuide.Color; cr.Stroke (); } cr.Restore (); @@ -1552,14 +1552,12 @@ namespace Mono.TextEditor isSelectionDrawn |= (marker.Flags & TextLineMarkerFlags.DrawsSelection) == TextLineMarkerFlags.DrawsSelection; } -#pragma warning disable 618 var bgMarker = marker as IBackgroundMarker; if (bgMarker != null) { isSelectionDrawn |= (marker.Flags & TextLineMarkerFlags.DrawsSelection) == TextLineMarkerFlags.DrawsSelection; drawText &= bgMarker.DrawBackground (textEditor, cr, metrics.Layout, metrics.SelectionStart, metrics.SelectionEnd, metrics.TextStartOffset, metrics.TextEndOffset, y, metrics.TextRenderStartPosition, metrics.TextRenderEndPosition, ref drawBg); continue; } -#pragma warning restore 618 } if (DecorateLineBg != null) @@ -1607,7 +1605,7 @@ namespace Mono.TextEditor int s = (int) System.Math.Floor ((x1 + x) / Pango.Scale.PangoScale); double corner = System.Math.Min (4, width) * textEditor.Options.Zoom; - cr.SetSourceColor (MainSearchResult.IsInvalid || MainSearchResult.Offset != firstSearch.Offset ? ColorStyle.SearchResult.Color : ColorStyle.SearchResultMain.Color); + cr.Color = MainSearchResult.IsInvalid || MainSearchResult.Offset != firstSearch.Offset ? ColorStyle.SearchResult.Color : ColorStyle.SearchResultMain.Color; FoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, s, y, corner, w + 1, LineHeight); cr.Fill (); } @@ -1798,7 +1796,7 @@ namespace Mono.TextEditor } } - cr.SetSourceRGBA (col.R, col.G, col.B, whitespaceMarkerAlpha); + cr.Color = new Cairo.Color (col.R, col.G, col.B, whitespaceMarkerAlpha); cr.ShowLayout (layout); cr.Restore (); } @@ -2341,7 +2339,7 @@ namespace Mono.TextEditor bool isDefaultColor = color.R == defaultBgColor.R && color.G == defaultBgColor.G && color.B == defaultBgColor.B; if (isDefaultColor && !drawDefaultBackground) return; - cr.SetSourceColor (color); + cr.Color = color; var left = (int)(area.X); var width = (int)area.Width + 1; if (textEditor.Options.ShowRuler) { @@ -2355,7 +2353,7 @@ namespace Mono.TextEditor cr.Fill (); } cr.Rectangle (divider, area.Y, right - divider, area.Height); - cr.SetSourceColor (DimColor (color)); + cr.Color = DimColor (color); cr.Fill (); if (beforeDividerWidth > 0) { @@ -2602,15 +2600,15 @@ namespace Mono.TextEditor this.LineHeight); if (BackgroundRenderer == null && isFoldingSelected) { - cr.SetSourceColor (SelectionColor.Background); + cr.Color = SelectionColor.Background; cr.Rectangle (foldingRectangle); cr.Fill (); } if (isFoldingSelected && SelectionColor.TransparentForeground) { - cr.SetSourceColor (ColorStyle.CollapsedText.Foreground); + cr.Color = ColorStyle.CollapsedText.Foreground; } else { - cr.SetSourceColor (isFoldingSelected ? SelectionColor.Foreground : ColorStyle.CollapsedText.Foreground); + cr.Color = isFoldingSelected ? SelectionColor.Foreground : ColorStyle.CollapsedText.Foreground; } var boundingRectangleHeight = foldingRectangle.Height - 1; var boundingRectangleY = System.Math.Floor (foldingRectangle.Y + (foldingRectangle.Height - boundingRectangleHeight) / 2); @@ -2745,7 +2743,7 @@ namespace Mono.TextEditor if (textEditor.HAdjustment.Value > 0) { cr.LineWidth = textEditor.Options.Zoom; for (int i = 0; i < verticalShadowAlphaTable.Length; i++) { - cr.SetSourceRGBA (0, 0, 0, 1 - verticalShadowAlphaTable[i]); + cr.Color = new Cairo.Color (0, 0, 0, 1 - verticalShadowAlphaTable[i]); cr.MoveTo (x + i * cr.LineWidth + 0.5, y); cr.LineTo (x + i * cr.LineWidth + 0.5, y + 1 + _lineHeight); cr.Stroke (); diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs index 7fb89406fb..c1b47ad06c 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs @@ -34,7 +34,7 @@ using Gtk; namespace Mono.TextEditor { /// <summary> - /// The height tree stores the heights of lines and provides a performant conversion between y and lineNumber. + /// The height tree stores the heights of lines and provides a performant y <--> lineNumber conversion. /// It takes care of message bubble heights and the height of folded sections. /// </summary> public class HeightTree : IDisposable diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs index b44906209e..a43f25ee44 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs @@ -118,7 +118,7 @@ namespace Mono.TextEditor public static void DrawLine (this Cairo.Context cr, Cairo.Color color, double x1, double y1, double x2, double y2) { - cr.SetSourceColor (color); + cr.Color = color; cr.MoveTo (x1, y1); cr.LineTo (x2, y2); cr.Stroke (); @@ -142,9 +142,6 @@ namespace Mono.TextEditor cr.LineTo (x2, y2 + 0.5); } - public static void SetSourceColor (this Cairo.Context cr, Cairo.Color color) - { - cr.SetSourceRGBA (color.R, color.G, color.B, color.A); - } + } } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs index a992a476d8..c728f017bb 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs @@ -316,10 +316,10 @@ namespace Mono.TextEditor g.LineTo (x - arrowLength / phi, y); g.ClosePath (); - g.SetSourceRGB (1.0, 0, 0); + g.Color = new Cairo.Color (1.0, 0, 0); g.StrokePreserve (); - g.SetSourceRGBA (1.0, 0, 0, 0.1); + g.Color = new Cairo.Color (1.0, 0, 0, 0.1); g.Fill (); } @@ -365,7 +365,7 @@ namespace Mono.TextEditor cr.MoveTo (x, y); cr.LineTo (x2, y); - cr.SetSourceColor (LineColor); + cr.Color = LineColor; cr.Stroke (); // DrawArrow (cr, x - 4, y); diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs index 3fead25185..74f8582a1b 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs @@ -44,7 +44,7 @@ namespace Mono.TextEditor { if (metrics.SelectionStart > 0) return true; - cr.SetSourceColor (color); + cr.Color = color; cr.Rectangle (metrics.TextRenderStartPosition, y, metrics.TextRenderEndPosition - metrics.TextRenderStartPosition, editor.LineHeight); cr.Fill (); return true; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs index fd2e53ef29..2825c85cc0 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs @@ -628,10 +628,10 @@ namespace Mono.TextEditor cr.Rectangle (x1 + 0.5, y + 0.5, x2 - x1, editor.LineHeight - 1); - cr.SetSourceColor (fillGc); + cr.Color = fillGc; cr.FillPreserve (); - cr.SetSourceColor (rectangleGc); + cr.Color = rectangleGc; cr.Stroke (); } } @@ -656,7 +656,7 @@ namespace Mono.TextEditor cr.Rectangle (metrics.X, metrics.Y, metrics.Width, metrics.Height); var lineNumberGC = editor.ColorStyle.LineNumbers.Foreground; - cr.SetSourceColor (editor.Caret.Line == metrics.LineNumber ? editor.ColorStyle.LineMarker.Color : lineNumberGC); + cr.Color = editor.Caret.Line == metrics.LineNumber ? editor.ColorStyle.LineMarker.Color : lineNumberGC; cr.Fill (); return true; @@ -677,7 +677,7 @@ namespace Mono.TextEditor layout.SetText (metrics.LineNumber.ToString ()); cr.Save (); cr.Translate (metrics.X + (int)width + (editor.Options.ShowFoldMargin ? 0 : -2), metrics.Y); - cr.SetSourceColor (lineNumberBgGC); + cr.Color = lineNumberBgGC; cr.ShowLayout (layout); cr.Restore (); } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs index 4e2c7c5a80..7e6ba99835 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs @@ -146,9 +146,9 @@ namespace Mono.TextEditor } double height = editor.LineHeight / 5; if (selected) { - cr.SetSourceColor (editor.ColorStyle.SelectedText.Foreground); + cr.Color = editor.ColorStyle.SelectedText.Foreground; } else { - cr.SetSourceColor (ColorName == null ? Color : editor.ColorStyle.GetChunkStyle (ColorName).Foreground); + cr.Color = ColorName == null ? Color : editor.ColorStyle.GetChunkStyle (ColorName).Foreground; } if (Wave) { Pango.CairoHelper.ShowErrorUnderline (cr, @from, y + editor.LineHeight - height, to - @from, height); diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs index 0e8f4240d2..1bd3401682 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs @@ -123,9 +123,9 @@ namespace Mono.TextEditor } double height = editor.LineHeight / 5; if (selected) { - cr.SetSourceColor (editor.ColorStyle.SelectedText.Foreground); + cr.Color = editor.ColorStyle.SelectedText.Foreground; } else { - cr.SetSourceColor (ColorName == null ? Color : editor.ColorStyle.GetChunkStyle (ColorName).Foreground); + cr.Color = ColorName == null ? Color : editor.ColorStyle.GetChunkStyle (ColorName).Foreground; } if (Wave) { Pango.CairoHelper.ShowErrorUnderline (cr, @from, y + editor.LineHeight - height, to - @from, height); |