57
public class MessageBubbleTextMarker : TextMarker, IBackgroundMarker, IIconBarMarker, IExtendingTextMarker, IDisposable, IActionTextMarker
57
public class MessageBubbleTextMarker : TextLineMarker, IBackgroundMarker, IIconBarMarker, IExtendingTextLineMarker, IDisposable, IActionTextLineMarker
59
59
MessageBubbleCache cache;
180
180
this.IsVisible = true;
181
181
this.lineSegment = lineSegment;
182
182
this.initialText = editor.Document.GetTextAt (lineSegment);
183
this.Flags = TextMarkerFlags.DrawsSelection;
183
this.Flags = TextLineMarkerFlags.DrawsSelection;
184
184
AddError (isError, errorMessage);
185
185
// cache.Changed += (sender, e) => CalculateLineFit (editor, lineSegment);
331
331
public bool DrawBackground (TextEditor editor, Cairo.Context g, TextViewMargin.LayoutWrapper layout2, int selectionStart, int selectionEnd, int startOffset, int endOffset, double y, double startXPos, double endXPos, ref bool drawBg)
333
if (!IsVisible || DebuggingService.IsDebugging)
335
335
EnsureLayoutCreated (editor);
336
336
double x = editor.TextViewMargin.XOffset;
353
353
if (!fitsInSameLine) {
354
354
if (isEolSelected) {
355
355
x -= (int)editor.HAdjustment.Value;
356
editor.TextViewMargin.DrawRectangleWithRuler (g, x, new Cairo.Rectangle (x, y + editor.LineHeight, editor.TextViewMargin.TextStartPosition, editor.LineHeight), editor.ColorStyle.Default.CairoBackgroundColor, true);
357
editor.TextViewMargin.DrawRectangleWithRuler (g, x + editor.TextViewMargin.TextStartPosition, new Cairo.Rectangle (x + editor.TextViewMargin.TextStartPosition, y + editor.LineHeight, editor.Allocation.Width + (int)editor.HAdjustment.Value, editor.LineHeight), editor.ColorStyle.Selection.CairoBackgroundColor, true);
356
editor.TextViewMargin.DrawRectangleWithRuler (g, x, new Cairo.Rectangle (x, y + editor.LineHeight, editor.TextViewMargin.TextStartPosition, editor.LineHeight), editor.ColorStyle.PlainText.Background, true);
357
editor.TextViewMargin.DrawRectangleWithRuler (g, x + editor.TextViewMargin.TextStartPosition, new Cairo.Rectangle (x + editor.TextViewMargin.TextStartPosition, y + editor.LineHeight, editor.Allocation.Width + (int)editor.HAdjustment.Value, editor.LineHeight), editor.ColorStyle.SelectedText.Background, true);
358
358
x += (int)editor.HAdjustment.Value;
360
editor.TextViewMargin.DrawRectangleWithRuler (g, x, new Cairo.Rectangle (x, y + editor.LineHeight, x2, editor.LineHeight), editor.ColorStyle.Default.CairoBackgroundColor, true);
360
editor.TextViewMargin.DrawRectangleWithRuler (g, x, new Cairo.Rectangle (x, y + editor.LineHeight, x2, editor.LineHeight), editor.ColorStyle.PlainText.Background, true);
363
363
DrawRectangle (g, x, y, right, topSize);
580
580
// x2 = System.Math.Max (x2, fitsInSameLine ? editor.TextViewMargin.XOffset + editor.LineHeight / 2 : editor.TextViewMargin.XOffset);
583
editor.TextViewMargin.DrawRectangleWithRuler (g, x, new Cairo.Rectangle (x, y, right, editor.LineHeight), isEolSelected ? editor.ColorStyle.Selection.CairoBackgroundColor : editor.ColorStyle.Default.CairoBackgroundColor, true);
583
editor.TextViewMargin.DrawRectangleWithRuler (g, x, new Cairo.Rectangle (x, y, right, editor.LineHeight), isEolSelected ? editor.ColorStyle.SelectedText.Background : editor.ColorStyle.PlainText.Background, true);
584
584
g.MoveTo (new Cairo.PointD (x2 + 0.5, y));
585
585
g.LineTo (new Cairo.PointD (x2 + 0.5, y + editor.LineHeight));
586
586
g.LineTo (new Cairo.PointD (right, y + editor.LineHeight));
633
633
#region IIconBarMarker implementation
635
public void DrawIcon (Mono.TextEditor.TextEditor editor, Cairo.Context cr, DocumentLine line, int lineNumber, double x, double y, double width, double height)
635
public void DrawIcon (TextEditor editor, Cairo.Context cr, DocumentLine line, int lineNumber, double x, double y, double width, double height)
637
if (DebuggingService.IsDebugging)
639
editor.GdkWindow.DrawPixbuf (cache.editor.Style.BaseGC (Gtk.StateType.Normal),
640
errors.Any (e => e.IsError) ? cache.errorPixbuf : cache.warningPixbuf,
642
(int)(x + (width - cache.errorPixbuf.Width) / 2),
643
(int)(y + (height - cache.errorPixbuf.Height) / 2),
644
cache.errorPixbuf.Width, cache.errorPixbuf.Height,
645
Gdk.RgbDither.None, 0, 0);
637
Gdk.CairoHelper.SetSourcePixbuf (
639
errors.Any (e => e.IsError) ? cache.errorPixbuf : cache.warningPixbuf,
640
(int)(x + (width - cache.errorPixbuf.Width) / 2),
641
(int)(y + (height - cache.errorPixbuf.Height) / 2));
648
645
public void MousePress (MarginMouseEventArgs args)
671
668
int lineNumber = editor.Document.OffsetToLineNumber (lineSegment.Offset);
673
double y = editor.LineToY (lineNumber) - (int)editor.VAdjustment.Value;
670
double y = editor.Allocation.Y + editor.LineToY (lineNumber) - (int)editor.VAdjustment.Value;
674
671
double height = editor.LineHeight * errors.Count;
675
672
if (!fitsInSameLine)
676
673
y += editor.LineHeight;
768
765
bool oldIsOver = false;
770
public void MouseHover (TextEditor editor, MarginMouseEventArgs args, TextMarkerHoverResult result)
767
public void MouseHover (TextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
772
769
if (this.LineSegment == null)
779
776
int errorNumber = MouseIsOverError (editor, args);
780
777
if (errorNumber >= 0) {
781
result.Cursor = cache.arrowCursor;
778
result.Cursor = null;
783
780
// don't show tooltip when hovering over error counter layout.
784
781
result.TooltipMarkup = GLib.Markup.EscapeText (errors[errorNumber].ErrorMessage);
856
853
g.ShowLayout (layout.Layout);
859
// if (ShowIconsInBubble)
860
// win.DrawPixbuf (editor.Style.BaseGC (Gtk.StateType.Normal), errors[errorNumber].IsError ? errorPixbuf : warningPixbuf, 0, 0, x2, y + (editor.LineHeight - errorPixbuf.Height) / 2, errorPixbuf.Width, errorPixbuf.Height, Gdk.RgbDither.None, 0, 0);
856
if (ShowIconsInBubble) {
857
var pixbuf = errors [errorNumber].IsError ? cache.errorPixbuf: cache.warningPixbuf;
858
Gdk.CairoHelper.SetSourcePixbuf (g, pixbuf, x2, y + (editor.LineHeight - cache.errorPixbuf.Height) / 2);