G_DEFINE_TYPE (EvViewPresentation, ev_view_presentation, GTK_TYPE_WIDGET)
+static GdkRGBA black = { 0., 0., 0., 1. };
+static GdkRGBA white = { 1., 1., 1., 1. };
+
static void
ev_view_presentation_set_normal (EvViewPresentation *pview)
{
GtkWidget *widget = GTK_WIDGET (pview);
- GtkStyle *style;
if (pview->state == EV_PRESENTATION_NORMAL)
return;
pview->state = EV_PRESENTATION_NORMAL;
- style = gtk_widget_get_style (widget);
- gdk_window_set_background (gtk_widget_get_window (widget), &style->black);
+ gdk_window_set_background_rgba (gtk_widget_get_window (widget), &black);
gtk_widget_queue_draw (widget);
}
ev_view_presentation_set_black (EvViewPresentation *pview)
{
GtkWidget *widget = GTK_WIDGET (pview);
- GtkStyle *style;
if (pview->state == EV_PRESENTATION_BLACK)
return;
pview->state = EV_PRESENTATION_BLACK;
- style = gtk_widget_get_style (widget);
- gdk_window_set_background (gtk_widget_get_window (widget), &style->black);
+ gdk_window_set_background_rgba (gtk_widget_get_window (widget), &black);
gtk_widget_queue_draw (widget);
}
ev_view_presentation_set_white (EvViewPresentation *pview)
{
GtkWidget *widget = GTK_WIDGET (pview);
- GtkStyle *style;
if (pview->state == EV_PRESENTATION_WHITE)
return;
pview->state = EV_PRESENTATION_WHITE;
- style = gtk_widget_get_style (widget);
- gdk_window_set_background (gtk_widget_get_window (widget), &style->white);
+ gdk_window_set_background_rgba (gtk_widget_get_window (widget), &white);
gtk_widget_queue_draw (widget);
}
area.width = allocation.width;
area.height = allocation.height;
- gtk_paint_layout (gtk_widget_get_style (widget),
- cr,
- gtk_widget_get_state (widget),
- FALSE,
- widget,
- NULL,
- 15,
- 15,
- layout);
+ gtk_render_layout (gtk_widget_get_style_context (widget),
+ cr, 15, 15, layout);
pango_font_description_free (font_desc);
g_object_unref (layout);
static void
ev_view_presentation_realize (GtkWidget *widget)
{
- GdkWindow *window;
- GtkStyle *style;
- GdkWindowAttr attributes;
- GtkAllocation allocation;
+ GdkWindow *window;
+ GdkWindowAttr attributes;
+ GtkAllocation allocation;
gtk_widget_set_realized (widget, TRUE);
gdk_window_set_user_data (window, widget);
gtk_widget_set_window (widget, window);
- gtk_widget_style_attach (widget);
- style = gtk_widget_get_style (widget);
- gdk_window_set_background (window, &style->black);
+ gdk_window_set_background_rgba (window, &black);
g_idle_add ((GSourceFunc)init_presentation, widget);
}