summaryrefslogtreecommitdiff
path: root/gtk/gtk_plotters.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtk_plotters.c')
-rw-r--r--gtk/gtk_plotters.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/gtk/gtk_plotters.c b/gtk/gtk_plotters.c
index d782d6d13..b78bcd5e6 100644
--- a/gtk/gtk_plotters.c
+++ b/gtk/gtk_plotters.c
@@ -21,13 +21,20 @@
#include "netsurf/desktop/plotters.h"
#include "netsurf/gtk/font_pango.h"
#include "netsurf/gtk/gtk_plotters.h"
-#include "netsurf/gtk/gtk_window.h"
+#include "netsurf/gtk/gtk_scaffolding.h"
#include "netsurf/render/font.h"
#include "netsurf/utils/log.h"
#include "netsurf/desktop/options.h"
#include "netsurf/gtk/options.h"
#include "netsurf/gtk/gtk_bitmap.h"
+GtkWidget *current_widget;
+GdkDrawable *current_drawable;
+GdkGC *current_gc;
+#ifdef CAIRO_VERSION
+cairo_t *current_cr;
+#endif
+
static bool nsgtk_plot_clg(colour c);
static bool nsgtk_plot_rectangle(int x0, int y0, int width, int height,
int line_width, colour c, bool dotted, bool dashed);
@@ -436,3 +443,21 @@ float nsgtk_plot_get_scale(void)
return nsgtk_plot_scale;
}
+/** Plot a caret. It is assumed that the plotters have been set up. */
+void nsgtk_plot_caret(int x, int y, int h)
+{
+ GdkColor colour;
+
+ colour.red = 0;
+ colour.green = 0;
+ colour.blue = 0;
+ colour.pixel = 0;
+ gdk_color_alloc(gdk_colormap_get_system(),
+ &colour);
+ gdk_gc_set_foreground(current_gc, &colour);
+
+ gdk_draw_line(current_drawable, current_gc,
+ x, y,
+ x, y + h - 1);
+}
+