[cairo-commit] goocanvas/src demo.c, 1.4, 1.5 goocanvasview.c, 1.6,
1.7
Damon Chaplin
commit at pdx.freedesktop.org
Mon Apr 3 04:24:04 PDT 2006
Committed by: damon
Update of /cvs/cairo/goocanvas/src
In directory kemper:/tmp/cvs-serv16596/src
Modified Files:
demo.c goocanvasview.c
Log Message:
2006-04-03 Damon Chaplin <damon at gnome.org>
* src/goocanvasview.c (goo_canvas_view_style_set)
(goo_canvas_view_realize): use the base color for the background.
* src/demo.c (create_canvas_primitives): use gtk_widget_modify_base()
to test setting the background color.
Index: demo.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/demo.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- demo.c 24 Mar 2006 16:55:45 -0000 1.4
+++ demo.c 3 Apr 2006 11:24:02 -0000 1.5
@@ -394,6 +394,7 @@
GtkWidget *scrolled_win, *canvas_view;
GtkAdjustment *hadj, *vadj, *adj;
GSList *group = NULL;
+ GdkColor bg_color = { 0, 50000, 50000, 65535 };
vbox = gtk_vbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
@@ -411,6 +412,8 @@
canvas_view = goo_canvas_view_new ();
+ gtk_widget_modify_base (canvas_view, GTK_STATE_NORMAL, &bg_color);
+
g_signal_connect (canvas_view, "item_view_created",
(GtkSignalFunc) on_item_view_created,
NULL);
Index: goocanvasview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasview.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- goocanvasview.c 24 Mar 2006 17:32:22 -0000 1.6
+++ goocanvasview.c 3 Apr 2006 11:24:02 -0000 1.7
@@ -256,8 +256,10 @@
gdk_window_set_user_data (view->tmp_window, widget);
widget->style = gtk_style_attach (widget->style, widget->window);
- gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
- gtk_style_set_background (widget->style, view->canvas_window, GTK_STATE_NORMAL);
+ gdk_window_set_background (widget->window,
+ &widget->style->base[widget->state]);
+ gdk_window_set_background (view->canvas_window,
+ &widget->style->base[widget->state]);
gdk_window_set_back_pixmap (view->tmp_window, NULL, FALSE);
goo_canvas_view_update (GOO_CANVAS_VIEW (widget));
@@ -311,7 +313,10 @@
if (GTK_WIDGET_REALIZED (widget))
{
- gtk_style_set_background (widget->style, GOO_CANVAS_VIEW (widget)->canvas_window, GTK_STATE_NORMAL);
+ gdk_window_set_background (widget->window,
+ &widget->style->base[widget->state]);
+ gdk_window_set_background (GOO_CANVAS_VIEW (widget)->canvas_window,
+ &widget->style->base[widget->state]);
}
}
@@ -586,8 +591,8 @@
if (view->hadjustment != hadj)
{
view->hadjustment = hadj;
- g_object_ref (view->hadjustment);
- gtk_object_sink (GTK_OBJECT (view->hadjustment));
+ g_object_ref_sink (view->hadjustment);
+
g_signal_connect (view->hadjustment, "value_changed",
G_CALLBACK (goo_canvas_view_adjustment_value_changed),
view);
@@ -597,8 +602,8 @@
if (view->vadjustment != vadj)
{
view->vadjustment = vadj;
- g_object_ref (view->vadjustment);
- gtk_object_sink (GTK_OBJECT (view->vadjustment));
+ g_object_ref_sink (view->vadjustment);
+
g_signal_connect (view->vadjustment, "value_changed",
G_CALLBACK (goo_canvas_view_adjustment_value_changed),
view);
@@ -940,6 +945,9 @@
* @view: a #GooCanvasView.
* @cr: a cairo context.
* @bounds: the area to render, or NULL to render the entire canvas.
+ * @effective_scale: the scale to compare with each item's visibility
+ * threshold to see if they should be rendered. This only affects items that
+ * have their visibility set to %GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD.
*
* Renders all or part of a canvas to the given cairo context.
**/
More information about the cairo-commit
mailing list