summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-09-07 19:18:46 +0200
committerBenjamin Otte <otte@redhat.com>2010-09-26 15:11:38 +0200
commitce2d6cc015ec697a2726094eca0bcdc1a0fde810 (patch)
tree6f03a7a15a61069f82e2dbe4820dc78d2401e7b7 /gtk
parent5eabd8c6fa24003473ce0479f51454dcfc30a0d1 (diff)
downloadgtk+-ce2d6cc015ec697a2726094eca0bcdc1a0fde810.tar.gz
scrolledwindow: Port to draw vfunc
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkscrolledwindow.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index dcbd15c79c..7bd656560b 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -122,8 +122,8 @@ static void gtk_scrolled_window_get_property (GObject *objec
static void gtk_scrolled_window_screen_changed (GtkWidget *widget,
GdkScreen *previous_screen);
-static gboolean gtk_scrolled_window_expose (GtkWidget *widget,
- GdkEventExpose *event);
+static gboolean gtk_scrolled_window_draw (GtkWidget *widget,
+ cairo_t *cr);
static void gtk_scrolled_window_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gboolean gtk_scrolled_window_scroll_event (GtkWidget *widget,
@@ -225,7 +225,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
object_class->destroy = gtk_scrolled_window_destroy;
widget_class->screen_changed = gtk_scrolled_window_screen_changed;
- widget_class->expose_event = gtk_scrolled_window_expose;
+ widget_class->draw = gtk_scrolled_window_draw;
widget_class->size_allocate = gtk_scrolled_window_size_allocate;
widget_class->scroll_event = gtk_scrolled_window_scroll_event;
widget_class->focus = gtk_scrolled_window_focus;
@@ -1084,15 +1084,14 @@ gtk_scrolled_window_screen_changed (GtkWidget *widget,
}
static gboolean
-gtk_scrolled_window_expose (GtkWidget *widget,
- GdkEventExpose *event)
+gtk_scrolled_window_draw (GtkWidget *widget,
+ cairo_t *cr)
{
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (widget);
GtkScrolledWindowPrivate *priv = scrolled_window->priv;
if (priv->shadow_type != GTK_SHADOW_NONE)
{
- GtkAllocation allocation;
GtkAllocation relative_allocation;
GtkStyle *style;
gboolean scrollbars_within_bevel;
@@ -1100,8 +1099,6 @@ gtk_scrolled_window_expose (GtkWidget *widget,
style = gtk_widget_get_style (widget);
gtk_widget_style_get (widget, "scrollbars-within-bevel", &scrollbars_within_bevel, NULL);
- gtk_widget_get_allocation (widget, &allocation);
-
if (!scrollbars_within_bevel)
{
gtk_scrolled_window_relative_allocation (widget, &relative_allocation);
@@ -1120,21 +1117,21 @@ gtk_scrolled_window_expose (GtkWidget *widget,
relative_allocation.x = border_width;
relative_allocation.y = border_width;
- relative_allocation.width = allocation.width - 2 * border_width;
- relative_allocation.height = allocation.height - 2 * border_width;
+ relative_allocation.width = gtk_widget_get_allocated_width (widget) - 2 * border_width;
+ relative_allocation.height = gtk_widget_get_allocated_height (widget) - 2 * border_width;
}
- gtk_paint_shadow (style,
- gtk_widget_get_window (widget),
+ gtk_cairo_paint_shadow (style,
+ cr,
GTK_STATE_NORMAL, priv->shadow_type,
- &event->area, widget, "scrolled_window",
- allocation.x + relative_allocation.x,
- allocation.y + relative_allocation.y,
+ widget, "scrolled_window",
+ relative_allocation.x,
+ relative_allocation.y,
relative_allocation.width,
relative_allocation.height);
}
- GTK_WIDGET_CLASS (gtk_scrolled_window_parent_class)->expose_event (widget, event);
+ GTK_WIDGET_CLASS (gtk_scrolled_window_parent_class)->draw (widget, cr);
return FALSE;
}