[evolution/gtk3] Replace obsolete Gdk API usage
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gtk3] Replace obsolete Gdk API usage
- Date: Fri, 10 Dec 2010 13:18:43 +0000 (UTC)
commit 226cc6f6ca54a515e114b05d432ddc5591e04337
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Fri Dec 10 14:18:10 2010 +0100
Replace obsolete Gdk API usage
widgets/table/e-table-field-chooser-item.c | 23 ++++++++++++++---------
widgets/table/e-table-header-item.c | 14 ++++----------
widgets/table/e-table-header-utils.h | 6 +++---
3 files changed, 21 insertions(+), 22 deletions(-)
---
diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c
index 02c86b8..bae357f 100644
--- a/widgets/table/e-table-field-chooser-item.c
+++ b/widgets/table/e-table-field-chooser-item.c
@@ -466,7 +466,7 @@ etfci_unrealize (GnomeCanvasItem *item)
static void
etfci_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
+ cairo_t *cr,
gint x,
gint y,
gint width,
@@ -505,7 +505,7 @@ etfci_draw (GnomeCanvasItem *item,
if (y2 < y)
continue;
- e_table_header_draw_button (drawable, ecol,
+ e_table_header_draw_button (cr, ecol,
style, state,
GTK_WIDGET (canvas),
-x, y1 - y,
@@ -544,9 +544,11 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo
GtkStyle *style;
GtkStateType state;
ETableCol *ecol;
- GdkPixmap *pixmap;
+ cairo_surface_t *cs;
+ cairo_t *cr;
gint drag_col;
gint button_height;
+ GdkPixbuf *pixbuf;
GtkTargetEntry etfci_drag_types[] = {
{ (gchar *) TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER },
@@ -576,26 +578,29 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo
button_height = e_table_header_compute_height (ecol, widget);
window = gtk_widget_get_window (widget);
- pixmap = gdk_pixmap_new (window, etfci->width, button_height, -1);
+ cs = gdk_window_create_similar_surface (window, CAIRO_CONTENT_COLOR, etfci->width, button_height);
style = gtk_widget_get_style (widget);
state = gtk_widget_get_state (widget);
+ cr = cairo_create (cs);
e_table_header_draw_button (
- pixmap, ecol, style,
+ cr, ecol, style,
state, widget, 0, 0,
etfci->width, button_height,
etfci->width, button_height,
E_TABLE_COL_ARROW_NONE);
- gtk_drag_set_icon_pixmap (
+ pixbuf = gdk_pixbuf_get_from_window (window, 0, 0, etfci->width, button_height);
+ gtk_drag_set_icon_pixbuf (
context,
- gdk_drawable_get_colormap (GDK_DRAWABLE (window)),
- pixmap, NULL,
+ pixbuf,
etfci->width / 2,
button_height / 2);
+ g_object_unref (pixbuf);
- g_object_unref (pixmap);
+ cairo_surface_destroy (cs);
+ cairo_destroy (cr);
etfci->maybe_drag = FALSE;
}
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index 28d53ce..44bfa8d 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -457,24 +457,18 @@ static GtkWidget *
make_shaped_window_from_xpm (const gchar **xpm)
{
GdkPixbuf *pixbuf;
- GdkPixmap *pixmap;
- GdkBitmap *bitmap;
GtkWidget *win, *pix;
pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
- gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &bitmap, 128);
- g_object_unref (pixbuf);
win = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_type_hint (GTK_WINDOW (win), GDK_WINDOW_TYPE_HINT_NOTIFICATION);
- pix = gtk_image_new_from_pixmap (pixmap, bitmap);
+ pix = gtk_image_new_from_pixbuf (pixbuf);
gtk_widget_realize (win);
gtk_container_add (GTK_CONTAINER (win), pix);
- gtk_widget_shape_combine_mask (win, bitmap, 0, 0);
- g_object_unref (pixmap);
- g_object_unref (bitmap);
+ g_object_unref (pixbuf);
return win;
}
@@ -975,7 +969,7 @@ ethi_unrealize (GnomeCanvasItem *item)
static void
ethi_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
+ cairo_t *cr,
gint x,
gint y,
gint width,
@@ -1039,7 +1033,7 @@ ethi_draw (GnomeCanvasItem *item,
state = gtk_widget_get_state (GTK_WIDGET (canvas));
e_table_header_draw_button (
- drawable, ecol,
+ cr, ecol,
style, state, GTK_WIDGET (canvas),
x1 - x, -y, width, height,
x2 - x1, ethi->height,
diff --git a/widgets/table/e-table-header-utils.h b/widgets/table/e-table-header-utils.h
index 9117262..4758353 100644
--- a/widgets/table/e-table-header-utils.h
+++ b/widgets/table/e-table-header-utils.h
@@ -31,9 +31,9 @@
G_BEGIN_DECLS
gdouble e_table_header_compute_height (ETableCol *ecol,
- GtkWidget *widget);
-gdouble e_table_header_width_extras (GtkStyle *style);
-void e_table_header_draw_button (GdkDrawable *drawable,
+ GtkWidget *widget);
+gdouble e_table_header_width_extras (GtkStyle *style);
+void e_table_header_draw_button (cairo_t *cr,
ETableCol *ecol,
GtkStyle *style,
GtkStateType state,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]