summaryrefslogtreecommitdiff
path: root/src/netbeans.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-23 17:14:37 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-23 17:14:37 +0100
commit9892189d2e7ab94b750f99e6da4cbfc3c8014517 (patch)
tree18634bacebb9e922feceff40c924cdc48550d7ac /src/netbeans.c
parent6bd364e08461159ad3c153ffba4def5b896486a1 (diff)
downloadvim-git-9892189d2e7ab94b750f99e6da4cbfc3c8014517.tar.gz
patch 7.4.1402v7.4.1402
Problem: GTK 3 is not supported. Solution: Add GTK 3 support. (Kazunobu Kuriyama)
Diffstat (limited to 'src/netbeans.c')
-rw-r--r--src/netbeans.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/netbeans.c b/src/netbeans.c
index ca0278eee..44a725e1e 100644
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -3055,17 +3055,56 @@ netbeans_draw_multisign_indicator(int row)
int i;
int y;
int x;
+#if GTK_CHECK_VERSION(3,0,0)
+ cairo_t *cr = NULL;
+#else
GdkDrawable *drawable = gui.drawarea->window;
+#endif
if (!NETBEANS_OPEN)
return;
+#if GTK_CHECK_VERSION(3,0,0)
+ cr = cairo_create(gui.surface);
+ {
+ GdkVisual *visual = NULL;
+ guint32 r_mask, g_mask, b_mask;
+ gint r_shift, g_shift, b_shift;
+
+ visual = gdk_window_get_visual(gtk_widget_get_window(gui.drawarea));
+ if (visual != NULL)
+ {
+ gdk_visual_get_red_pixel_details(visual, &r_mask, &r_shift, NULL);
+ gdk_visual_get_green_pixel_details(visual, &g_mask, &g_shift, NULL);
+ gdk_visual_get_blue_pixel_details(visual, &b_mask, &b_shift, NULL);
+
+ cairo_set_source_rgb(cr,
+ ((gui.fgcolor->red & r_mask) >> r_shift) / 255.0,
+ ((gui.fgcolor->green & g_mask) >> g_shift) / 255.0,
+ ((gui.fgcolor->blue & b_mask) >> b_shift) / 255.0);
+ }
+ }
+#endif
+
x = 0;
y = row * gui.char_height + 2;
for (i = 0; i < gui.char_height - 3; i++)
+#if GTK_CHECK_VERSION(3,0,0)
+ cairo_rectangle(cr, x+2, y++, 1, 1);
+#else
gdk_draw_point(drawable, gui.text_gc, x+2, y++);
+#endif
+#if GTK_CHECK_VERSION(3,0,0)
+ cairo_rectangle(cr, x+0, y, 1, 1);
+ cairo_rectangle(cr, x+2, y, 1, 1);
+ cairo_rectangle(cr, x+4, y++, 1, 1);
+ cairo_rectangle(cr, x+1, y, 1, 1);
+ cairo_rectangle(cr, x+2, y, 1, 1);
+ cairo_rectangle(cr, x+3, y++, 1, 1);
+ cairo_rectangle(cr, x+2, y, 1, 1);
+#else
gdk_draw_point(drawable, gui.text_gc, x+0, y);
gdk_draw_point(drawable, gui.text_gc, x+2, y);
gdk_draw_point(drawable, gui.text_gc, x+4, y++);
@@ -3073,6 +3112,11 @@ netbeans_draw_multisign_indicator(int row)
gdk_draw_point(drawable, gui.text_gc, x+2, y);
gdk_draw_point(drawable, gui.text_gc, x+3, y++);
gdk_draw_point(drawable, gui.text_gc, x+2, y);
+#endif
+
+#if GTK_CHECK_VERSION(3,0,0)
+ cairo_destroy(cr);
+#endif
}
#endif /* FEAT_GUI_GTK */