Commit 61f733b991e6c13f14b7c9d8fcfad0b6d5a0d6ec

Authored by perry.werneck@gmail.com
1 parent b7fdaadc
Exists in master and in 1 other branch develop

Reimplementando gdk_window_create_similar_surface para versões mais antigas do G…

…TK usando o fonte do webkit como referência. Patch webkit em https://bugs.webkit.org/attachment.cgi?id=88845&action=prettypatch
Showing 2 changed files with 15 additions and 0 deletions   Show diff stats
@@ -247,6 +247,17 @@ void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 @@ -247,6 +247,17 @@ void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270
247 cairo_stroke(cr); 247 cairo_stroke(cr);
248 } 248 }
249 249
  250 +#if !GTK_CHECK_VERSION(2, 22, 0)
  251 +cairo_surface_t *gdk_window_create_similar_surface(GdkWindow *window, cairo_content_t content, int width, int height)
  252 +{
  253 + cairo_t *cairoContext = gdk_cairo_create(window);
  254 + cairo_surface_t *cairoSurface = cairo_get_target(cairoContext);
  255 + cairo_surface_t *newSurface = cairo_surface_create_similar(cairoSurface, content, width, height);
  256 + cairo_destroy(cairoContext);
  257 + return newSurface;
  258 +}
  259 +#endif // GTK_CHECK_VERSION(2, 22, 0)
  260 +
250 void v3270_reload(GtkWidget *widget) 261 void v3270_reload(GtkWidget *widget)
251 { 262 {
252 v3270 * terminal = GTK_V3270(widget); 263 v3270 * terminal = GTK_V3270(widget);
@@ -202,8 +202,12 @@ void v3270_update_mouse_pointer(GtkWidget *widget); @@ -202,8 +202,12 @@ void v3270_update_mouse_pointer(GtkWidget *widget);
202 #if ! GTK_CHECK_VERSION(2,22,0) 202 #if ! GTK_CHECK_VERSION(2,22,0)
203 #define gtk_accessible_set_widget(a,w) g_object_set_data(G_OBJECT(a),"widget",w) 203 #define gtk_accessible_set_widget(a,w) g_object_set_data(G_OBJECT(a),"widget",w)
204 #define gtk_accessible_get_widget(a) GTK_WIDGET(g_object_get_data(G_OBJECT(a),"widget")) 204 #define gtk_accessible_get_widget(a) GTK_WIDGET(g_object_get_data(G_OBJECT(a),"widget"))
  205 +
  206 + G_GNUC_INTERNAL cairo_surface_t * gdk_window_create_similar_surface(GdkWindow *window, cairo_content_t content, int width, int height);
  207 +
205 #endif // !GTK(2,22) 208 #endif // !GTK(2,22)
206 209
  210 +
207 #if ! GTK_CHECK_VERSION(3,0,0) 211 #if ! GTK_CHECK_VERSION(3,0,0)
208 gboolean v3270_expose(GtkWidget * widget, GdkEventExpose *event); 212 gboolean v3270_expose(GtkWidget * widget, GdkEventExpose *event);
209 #endif // GTK 3 213 #endif // GTK 3