summaryrefslogtreecommitdiff
path: root/gtk/gtkinfobar.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-09-06 19:44:32 +0200
committerBenjamin Otte <otte@redhat.com>2010-09-26 15:11:37 +0200
commitf2d7e6c8d43335fd02e3111223d8026b4127d423 (patch)
treefe2e1f48e3d9543060c6bcea3241489fd2eacc20 /gtk/gtkinfobar.c
parent299d5333762efea1819418db77315ea5c756ed7a (diff)
downloadgtk+-f2d7e6c8d43335fd02e3111223d8026b4127d423.tar.gz
infobar: Port to draw vfunc
Diffstat (limited to 'gtk/gtkinfobar.c')
-rw-r--r--gtk/gtkinfobar.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index 2d1cd4780b..db96dbb219 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -159,8 +159,8 @@ static void gtk_info_bar_get_property (GObject *object,
GParamSpec *pspec);
static void gtk_info_bar_style_set (GtkWidget *widget,
GtkStyle *prev_style);
-static gboolean gtk_info_bar_expose (GtkWidget *widget,
- GdkEventExpose *event);
+static gboolean gtk_info_bar_draw (GtkWidget *widget,
+ cairo_t *cr);
static void gtk_info_bar_buildable_interface_init (GtkBuildableIface *iface);
static GObject *gtk_info_bar_buildable_get_internal_child (GtkBuildable *buildable,
GtkBuilder *builder,
@@ -296,8 +296,8 @@ gtk_info_bar_close (GtkInfoBar *info_bar)
}
static gboolean
-gtk_info_bar_expose (GtkWidget *widget,
- GdkEventExpose *event)
+gtk_info_bar_draw (GtkWidget *widget,
+ cairo_t *cr)
{
GtkInfoBarPrivate *priv = GTK_INFO_BAR (widget)->priv;
const char* type_detail[] = {
@@ -310,26 +310,23 @@ gtk_info_bar_expose (GtkWidget *widget,
if (priv->message_type != GTK_MESSAGE_OTHER)
{
- GtkAllocation allocation;
const char *detail;
detail = type_detail[priv->message_type];
- gtk_widget_get_allocation (widget, &allocation);
-
- gtk_paint_box (gtk_widget_get_style (widget),
- gtk_widget_get_window (widget),
+ gtk_cairo_paint_box (gtk_widget_get_style (widget),
+ cr,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
- NULL,
widget,
detail,
- allocation.x, allocation.y,
- allocation.width, allocation.height);
+ 0, 0,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
}
- if (GTK_WIDGET_CLASS (gtk_info_bar_parent_class)->expose_event)
- GTK_WIDGET_CLASS (gtk_info_bar_parent_class)->expose_event (widget, event);
+ if (GTK_WIDGET_CLASS (gtk_info_bar_parent_class)->draw)
+ GTK_WIDGET_CLASS (gtk_info_bar_parent_class)->draw (widget, cr);
return FALSE;
}
@@ -349,7 +346,7 @@ gtk_info_bar_class_init (GtkInfoBarClass *klass)
object_class->finalize = gtk_info_bar_finalize;
widget_class->style_set = gtk_info_bar_style_set;
- widget_class->expose_event = gtk_info_bar_expose;
+ widget_class->draw = gtk_info_bar_draw;
klass->close = gtk_info_bar_close;