43
43
this.editor = editor;
46
public void DrawIcon (Mono.TextEditor.TextEditor editor, Gdk.Drawable win, LineSegment line, int lineNumber, int x, int y, int width, int height)
46
public void DrawIcon (Mono.TextEditor.TextEditor editor, Cairo.Context cr, LineSegment line, int lineNumber, double x, double y, double width, double height)
49
49
if (width > height) {
50
50
x += (width - height) / 2;
57
using (Cairo.Context cr = Gdk.CairoHelper.Create (win)) {
58
DrawIcon (cr, x, y, size);
57
DrawIcon (cr, x, y, size);
62
protected virtual void DrawIcon (Cairo.Context cr, int x, int y, int size)
60
protected virtual void DrawIcon (Cairo.Context cr, double x, double y, double size)
66
protected void DrawCircle (Cairo.Context cr, double x, double y, int size)
64
protected void DrawCircle (Cairo.Context cr, double x, double y, double size)
68
66
x += 0.5; y += 0.5;
107
protected void FillGradient (Cairo.Context cr, Cairo.Color color1, Cairo.Color color2, int x, int y, int size)
105
protected void FillGradient (Cairo.Context cr, Cairo.Color color1, Cairo.Color color2, double x, double y, double size)
109
Cairo.Gradient pat = new Cairo.LinearGradient (x + size / 4, y, x + size / 2, y + size - 4);
110
pat.AddColorStop (0, color1);
111
pat.AddColorStop (1, color2);
107
using (var pat = new Cairo.LinearGradient (x + size / 4, y, x + size / 2, y + size - 4)) {
108
pat.AddColorStop (0, color1);
109
pat.AddColorStop (1, color2);
116
protected void DrawBorder (Cairo.Context cr, Cairo.Color color, int x, int y, int size)
115
protected void DrawBorder (Cairo.Context cr, Cairo.Color color, double x, double y, double size)
118
Cairo.Gradient pat = new Cairo.LinearGradient (x, y + size, x + size, y);
119
pat.AddColorStop (0, color);
117
using (var pat = new Cairo.LinearGradient (x, y + size, x + size, y)) {
118
pat.AddColorStop (0, color);
125
124
public void MousePress (MarginMouseEventArgs args)
129
128
public void MouseRelease (MarginMouseEventArgs args)
132
public void MouseHover (MarginMouseEventArgs args)
134
137
public class BreakpointTextMarker : DebugTextMarker
136
public override Color BackgroundColor {
139
public override Cairo.Color BackgroundColor {
137
140
get { return editor.ColorStyle.BreakpointBg; }
140
public override Color Color {
143
public override Cairo.Color Color {
141
144
get { return editor.ColorStyle.BreakpointFg; }
150
153
IsTracepoint = isTracePoint;
153
protected override void DrawIcon (Cairo.Context cr, int x, int y, int size)
156
protected override void DrawIcon (Cairo.Context cr, double x, double y, double size)
155
Cairo.Color color1 = Style.ToCairoColor (editor.ColorStyle.BreakpointMarkerColor1);
156
Cairo.Color color2 = Style.ToCairoColor (editor.ColorStyle.BreakpointMarkerColor2);
158
Cairo.Color color1 = editor.ColorStyle.BreakpointMarkerColor1;
159
Cairo.Color color2 = editor.ColorStyle.BreakpointMarkerColor2;
157
160
if (IsTracepoint)
158
161
DrawDiamond (cr, x, y, size);
179
182
public bool IsTracepoint { get; set; }
181
protected override void DrawIcon (Cairo.Context cr, int x, int y, int size)
184
protected override void DrawIcon (Cairo.Context cr, double x, double y, double size)
183
Cairo.Color border = Style.ToCairoColor (editor.ColorStyle.InvalidBreakpointMarkerBorder);
186
Cairo.Color border = editor.ColorStyle.InvalidBreakpointMarkerBorder;
184
187
if (IsTracepoint)
185
188
DrawDiamond (cr, x, y, size);
193
196
public class CurrentDebugLineTextMarker: DebugTextMarker
195
public override Color BackgroundColor {
198
public override Cairo.Color BackgroundColor {
196
199
get { return editor.ColorStyle.CurrentDebugLineBg; }
200
public override Color Color {
203
public override Cairo.Color Color {
201
204
get { return editor.ColorStyle.CurrentDebugLineFg; }
207
210
IncludedStyles |= StyleFlag.BackgroundColor | StyleFlag.Color;
210
protected override void DrawIcon (Cairo.Context cr, int x, int y, int size)
213
protected override void DrawIcon (Cairo.Context cr, double x, double y, double size)
212
Cairo.Color color1 = Style.ToCairoColor (editor.ColorStyle.CurrentDebugLineMarkerColor1);
213
Cairo.Color color2 = Style.ToCairoColor (editor.ColorStyle.CurrentDebugLineMarkerColor2);
214
Cairo.Color border = Style.ToCairoColor (editor.ColorStyle.CurrentDebugLineMarkerBorder);
215
Cairo.Color color1 = editor.ColorStyle.CurrentDebugLineMarkerColor1;
216
Cairo.Color color2 = editor.ColorStyle.CurrentDebugLineMarkerColor2;
217
Cairo.Color border = editor.ColorStyle.CurrentDebugLineMarkerBorder;
216
219
DrawArrow (cr, x, y, size);
217
220
FillGradient (cr, color1, color2, x, y, size);
222
225
public class DebugStackLineTextMarker: DebugTextMarker
224
public override Color BackgroundColor {
227
public override Cairo.Color BackgroundColor {
225
228
get { return editor.ColorStyle.DebugStackLineBg; }
229
public override Color Color {
232
public override Cairo.Color Color {
230
233
get { return editor.ColorStyle.DebugStackLineFg; }
236
239
IncludedStyles |= StyleFlag.BackgroundColor | StyleFlag.Color;
239
protected override void DrawIcon (Cairo.Context cr, int x, int y, int size)
242
protected override void DrawIcon (Cairo.Context cr, double x, double y, double size)
241
Cairo.Color color1 = Style.ToCairoColor (editor.ColorStyle.DebugStackLineMarkerColor1);
242
Cairo.Color color2 = Style.ToCairoColor (editor.ColorStyle.DebugStackLineMarkerColor2);
243
Cairo.Color border = Style.ToCairoColor (editor.ColorStyle.DebugStackLineMarkerBorder);
244
Cairo.Color color1 = editor.ColorStyle.DebugStackLineMarkerColor1;
245
Cairo.Color color2 = editor.ColorStyle.DebugStackLineMarkerColor2;
246
Cairo.Color border = editor.ColorStyle.DebugStackLineMarkerBorder;
245
248
DrawArrow (cr, x, y, size);
246
249
FillGradient (cr, color1, color2, x, y, size);
260
263
IncludedStyles |= StyleFlag.BackgroundColor;
263
protected override void DrawIcon (Cairo.Context cr, int x, int y, int size)
266
protected override void DrawIcon (Cairo.Context cr, double x, double y, double size)
265
Cairo.Color color1 = Style.ToCairoColor (editor.ColorStyle.InvalidBreakpointMarkerColor1);
268
Cairo.Color color1 = editor.ColorStyle.InvalidBreakpointMarkerColor1;
266
269
Cairo.Color color2 = color1;
267
Cairo.Color border = Style.ToCairoColor (editor.ColorStyle.InvalidBreakpointMarkerBorder);
270
Cairo.Color border = editor.ColorStyle.InvalidBreakpointMarkerBorder;
268
271
DrawCircle (cr, x, y, size);
269
272
FillGradient (cr, color1, color2, x, y, size);
270
273
DrawBorder (cr, border, x, y, size);