public void Start()
            {
                allocation = mode.Allocation;
                var swapSurface = mode.swapIndicatorSurface;

                if (swapSurface != null)
                {
                    if (swapSurface.Width == allocation.Width && swapSurface.Height == allocation.Height)
                    {
                        surface = swapSurface;
                    }
                    else
                    {
                        mode.DestroyIndicatorSwapSurface();
                    }
                }

                var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor(mode) : 1.0;

                if (surface == null)
                {
                    using (var similiar = CairoHelper.Create(IdeApp.Workbench.RootWindow.GdkWindow))
                        surface = new SurfaceWrapper(similiar, (int)(allocation.Width * displayScale), (int)(allocation.Height * displayScale));
                }

                searchResults = mode.TextEditor.TextViewMargin.SearchResults.ToList().GetEnumerator();
                allUsages     = mode.AllUsages.GetEnumerator();
                allTasks      = mode.AllTasks.GetEnumerator();
                cr            = new Cairo.Context(surface.Surface);
                cr.Scale(displayScale, displayScale);
                GLib.Idle.Add(RunHandler);
            }
            public void Start()
            {
                allocation = mode.Allocation;
                var swapSurface = mode.swapIndicatorSurface;

                if (swapSurface != null)
                {
                    if (swapSurface.Width == allocation.Width && swapSurface.Height == allocation.Height)
                    {
                        surface = swapSurface;
                    }
                    else
                    {
                        mode.DestroyIndicatorSwapSurface();
                    }
                }

                if (surface == null)
                {
                    using (var similiar = CairoHelper.Create(IdeApp.Workbench.RootWindow.GdkWindow))
                        surface = new SurfaceWrapper(similiar, allocation.Width, allocation.Height);
                }

                searchResults = mode.TextEditor.TextViewMargin.SearchResults.ToList().GetEnumerator();
                allUsages     = mode.AllUsages.GetEnumerator();
                allTasks      = mode.AllTasks.GetEnumerator();
                cr            = new Cairo.Context(surface.Surface);
                GLib.Idle.Add(RunHandler);
            }
            public void Start()
            {
                allocation = mode.Allocation;
                var swapSurface = mode.swapIndicatorSurface;

                if (swapSurface != null)
                {
                    if (swapSurface.Width == allocation.Width && swapSurface.Height == allocation.Height)
                    {
                        surface = swapSurface;
                    }
                    else
                    {
                        mode.DestroyIndicatorSwapSurface();
                    }
                }

                var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor(mode) : 1.0;

                if (surface == null)
                {
                    using (var similiar = CairoHelper.Create(IdeApp.Workbench.RootWindow.GdkWindow))
                        surface = new SurfaceWrapper(similiar, (int)(allocation.Width * displayScale), (int)(allocation.Height * displayScale));
                }
                state        = IndicatorDrawingState.Create();
                state.Width  = allocation.Width;
                state.Height = allocation.Height;
                state.SearchResults.AddRange(mode.TextEditor.TextViewMargin.SearchResults);
                state.Usages.AddRange(mode.AllUsages);
                state.Tasks.AddRange(mode.AllTasks);
                state.ColorCache [IndicatorDrawingState.UsageColor]       = SyntaxHighlightingService.GetColor(mode.TextEditor.EditorTheme, EditorThemeColors.Foreground);
                state.ColorCache [IndicatorDrawingState.UsageColor].Alpha = 0.4;

                state.ColorCache [IndicatorDrawingState.FocusColor] = Styles.FocusColor.ToCairoColor();

                state.ColorCache [IndicatorDrawingState.ChangingUsagesColor] = SyntaxHighlightingService.GetColor(mode.TextEditor.EditorTheme, EditorThemeColors.ChangingUsagesRectangle);
                if (state.ColorCache [IndicatorDrawingState.ChangingUsagesColor].Alpha == 0.0)
                {
                    state.ColorCache [IndicatorDrawingState.ChangingUsagesColor] = SyntaxHighlightingService.GetColor(mode.TextEditor.EditorTheme, EditorThemeColors.UsagesRectangle);
                }

                state.ColorCache [IndicatorDrawingState.UsagesRectangleColor] = SyntaxHighlightingService.GetColor(mode.TextEditor.EditorTheme, EditorThemeColors.UsagesRectangle);
                for (int i = 0; i < 4; i++)
                {
                    state.ColorCache [i].L = 0.4;
                }

                state.ColorCache [IndicatorDrawingState.UnderlineErrorColor]      = SyntaxHighlightingService.GetColor(mode.TextEditor.EditorTheme, EditorThemeColors.UnderlineError);
                state.ColorCache [IndicatorDrawingState.UnderlineWarningColor]    = SyntaxHighlightingService.GetColor(mode.TextEditor.EditorTheme, EditorThemeColors.UnderlineWarning);
                state.ColorCache [IndicatorDrawingState.UnderlineSuggestionColor] = SyntaxHighlightingService.GetColor(mode.TextEditor.EditorTheme, EditorThemeColors.UnderlineSuggestion);
                state.ColorCache [IndicatorDrawingState.BackgroundColor]          = SyntaxHighlightingService.GetColor(mode.TextEditor.EditorTheme, EditorThemeColors.Background);

                ResetEnumerators();

                cr = new Cairo.Context(surface.Surface);
                cr.Scale(displayScale, displayScale);
                GLib.Idle.Add(RunHandler);
            }