comparison src/netbeans.c @ 8218:3456e2ebebd4 v7.4.1402

commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 23 17:14:37 2016 +0100 patch 7.4.1402 Problem: GTK 3 is not supported. Solution: Add GTK 3 support. (Kazunobu Kuriyama)
author Christian Brabandt <cb@256bit.org>
date Tue, 23 Feb 2016 17:15:05 +0100
parents 05b88224cea1
children 60586ce747c4
comparison
equal deleted inserted replaced
8217:c52abf35df88 8218:3456e2ebebd4
3053 netbeans_draw_multisign_indicator(int row) 3053 netbeans_draw_multisign_indicator(int row)
3054 { 3054 {
3055 int i; 3055 int i;
3056 int y; 3056 int y;
3057 int x; 3057 int x;
3058 #if GTK_CHECK_VERSION(3,0,0)
3059 cairo_t *cr = NULL;
3060 #else
3058 GdkDrawable *drawable = gui.drawarea->window; 3061 GdkDrawable *drawable = gui.drawarea->window;
3062 #endif
3059 3063
3060 if (!NETBEANS_OPEN) 3064 if (!NETBEANS_OPEN)
3061 return; 3065 return;
3062 3066
3067 #if GTK_CHECK_VERSION(3,0,0)
3068 cr = cairo_create(gui.surface);
3069 {
3070 GdkVisual *visual = NULL;
3071 guint32 r_mask, g_mask, b_mask;
3072 gint r_shift, g_shift, b_shift;
3073
3074 visual = gdk_window_get_visual(gtk_widget_get_window(gui.drawarea));
3075 if (visual != NULL)
3076 {
3077 gdk_visual_get_red_pixel_details(visual, &r_mask, &r_shift, NULL);
3078 gdk_visual_get_green_pixel_details(visual, &g_mask, &g_shift, NULL);
3079 gdk_visual_get_blue_pixel_details(visual, &b_mask, &b_shift, NULL);
3080
3081 cairo_set_source_rgb(cr,
3082 ((gui.fgcolor->red & r_mask) >> r_shift) / 255.0,
3083 ((gui.fgcolor->green & g_mask) >> g_shift) / 255.0,
3084 ((gui.fgcolor->blue & b_mask) >> b_shift) / 255.0);
3085 }
3086 }
3087 #endif
3088
3063 x = 0; 3089 x = 0;
3064 y = row * gui.char_height + 2; 3090 y = row * gui.char_height + 2;
3065 3091
3066 for (i = 0; i < gui.char_height - 3; i++) 3092 for (i = 0; i < gui.char_height - 3; i++)
3093 #if GTK_CHECK_VERSION(3,0,0)
3094 cairo_rectangle(cr, x+2, y++, 1, 1);
3095 #else
3067 gdk_draw_point(drawable, gui.text_gc, x+2, y++); 3096 gdk_draw_point(drawable, gui.text_gc, x+2, y++);
3068 3097 #endif
3098
3099 #if GTK_CHECK_VERSION(3,0,0)
3100 cairo_rectangle(cr, x+0, y, 1, 1);
3101 cairo_rectangle(cr, x+2, y, 1, 1);
3102 cairo_rectangle(cr, x+4, y++, 1, 1);
3103 cairo_rectangle(cr, x+1, y, 1, 1);
3104 cairo_rectangle(cr, x+2, y, 1, 1);
3105 cairo_rectangle(cr, x+3, y++, 1, 1);
3106 cairo_rectangle(cr, x+2, y, 1, 1);
3107 #else
3069 gdk_draw_point(drawable, gui.text_gc, x+0, y); 3108 gdk_draw_point(drawable, gui.text_gc, x+0, y);
3070 gdk_draw_point(drawable, gui.text_gc, x+2, y); 3109 gdk_draw_point(drawable, gui.text_gc, x+2, y);
3071 gdk_draw_point(drawable, gui.text_gc, x+4, y++); 3110 gdk_draw_point(drawable, gui.text_gc, x+4, y++);
3072 gdk_draw_point(drawable, gui.text_gc, x+1, y); 3111 gdk_draw_point(drawable, gui.text_gc, x+1, y);
3073 gdk_draw_point(drawable, gui.text_gc, x+2, y); 3112 gdk_draw_point(drawable, gui.text_gc, x+2, y);
3074 gdk_draw_point(drawable, gui.text_gc, x+3, y++); 3113 gdk_draw_point(drawable, gui.text_gc, x+3, y++);
3075 gdk_draw_point(drawable, gui.text_gc, x+2, y); 3114 gdk_draw_point(drawable, gui.text_gc, x+2, y);
3115 #endif
3116
3117 #if GTK_CHECK_VERSION(3,0,0)
3118 cairo_destroy(cr);
3119 #endif
3076 } 3120 }
3077 #endif /* FEAT_GUI_GTK */ 3121 #endif /* FEAT_GUI_GTK */
3078 3122
3079 /* 3123 /*
3080 * If the mouse is clicked in the gutter of a line with multiple 3124 * If the mouse is clicked in the gutter of a line with multiple