diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-01-31 00:32:55 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-01-31 00:33:28 +0800 |
commit | 0109aa3a92b484ebb85c6481e5a8e39819b1f011 (patch) | |
tree | e7837b0a50517fc160a7b4d6d47f5c78a5505523 /libgnomecanvas | |
parent | f25d21294158625477c529a679fd2f27fffb562c (diff) | |
download | gsoc2013-evolution-0109aa3a92b484ebb85c6481e5a8e39819b1f011.tar gsoc2013-evolution-0109aa3a92b484ebb85c6481e5a8e39819b1f011.tar.gz gsoc2013-evolution-0109aa3a92b484ebb85c6481e5a8e39819b1f011.tar.bz2 gsoc2013-evolution-0109aa3a92b484ebb85c6481e5a8e39819b1f011.tar.lz gsoc2013-evolution-0109aa3a92b484ebb85c6481e5a8e39819b1f011.tar.xz gsoc2013-evolution-0109aa3a92b484ebb85c6481e5a8e39819b1f011.tar.zst gsoc2013-evolution-0109aa3a92b484ebb85c6481e5a8e39819b1f011.zip |
More whitespace cleanup.
Diffstat (limited to 'libgnomecanvas')
-rw-r--r-- | libgnomecanvas/gailcanvas.c | 28 | ||||
-rw-r--r-- | libgnomecanvas/gailcanvasgroupfactory.c | 2 | ||||
-rw-r--r-- | libgnomecanvas/gailcanvasitem.c | 64 | ||||
-rw-r--r-- | libgnomecanvas/gailcanvastext.c | 18 | ||||
-rw-r--r-- | libgnomecanvas/gnome-canvas-pixbuf.c | 48 | ||||
-rw-r--r-- | libgnomecanvas/gnome-canvas-rich-text.c | 8 | ||||
-rw-r--r-- | libgnomecanvas/gnome-canvas-text.c | 172 | ||||
-rw-r--r-- | libgnomecanvas/gnome-canvas-util.c | 76 | ||||
-rw-r--r-- | libgnomecanvas/gnome-canvas-widget.c | 42 | ||||
-rw-r--r-- | libgnomecanvas/gnome-canvas.c | 142 |
10 files changed, 300 insertions, 300 deletions
diff --git a/libgnomecanvas/gailcanvas.c b/libgnomecanvas/gailcanvas.c index 881916ac5a..41e8852d83 100644 --- a/libgnomecanvas/gailcanvas.c +++ b/libgnomecanvas/gailcanvas.c @@ -90,16 +90,16 @@ gail_canvas_get_type (void) GTypeQuery query; static GTypeInfo tinfo = { - 0, /* class size */ - (GBaseInitFunc) NULL, /* base init */ - (GBaseFinalizeFunc) NULL, /* base finalize */ - (GClassInitFunc) gail_canvas_class_init, /* class init */ - (GClassFinalizeFunc) NULL, /* class finalize */ - NULL, /* class data */ - 0, /* instance size */ - 0, /* nb preallocs */ - (GInstanceInitFunc) NULL, /* instance init */ - NULL /* value table */ + 0, /* class size */ + (GBaseInitFunc) NULL, /* base init */ + (GBaseFinalizeFunc) NULL, /* base finalize */ + (GClassInitFunc) gail_canvas_class_init, /* class init */ + (GClassFinalizeFunc) NULL, /* class finalize */ + NULL, /* class data */ + 0, /* instance size */ + 0, /* nb preallocs */ + (GInstanceInitFunc) NULL, /* instance init */ + NULL /* value table */ }; g_type_query (atkobject_parent_type, &query); tinfo.class_size = query.class_size; @@ -182,14 +182,14 @@ gail_canvas_real_initialize (AtkObject *obj, adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas)); g_signal_connect (adj, "value_changed", - G_CALLBACK (adjustment_changed), - canvas); + G_CALLBACK (adjustment_changed), + canvas); adj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas)); g_signal_connect (adj, "value_changed", - G_CALLBACK (adjustment_changed), - canvas); + G_CALLBACK (adjustment_changed), + canvas); obj->role = ATK_ROLE_LAYERED_PANE; } diff --git a/libgnomecanvas/gailcanvasgroupfactory.c b/libgnomecanvas/gailcanvasgroupfactory.c index 79b687584f..612dccfd54 100644 --- a/libgnomecanvas/gailcanvasgroupfactory.c +++ b/libgnomecanvas/gailcanvasgroupfactory.c @@ -48,7 +48,7 @@ gail_canvas_group_factory_get_type (void) NULL /* value table */ }; type = g_type_register_static ( - ATK_TYPE_OBJECT_FACTORY, + ATK_TYPE_OBJECT_FACTORY, "GailCanvasGroupFactory" , &tinfo, 0); } diff --git a/libgnomecanvas/gailcanvasitem.c b/libgnomecanvas/gailcanvasitem.c index 4527191991..e676447693 100644 --- a/libgnomecanvas/gailcanvasitem.c +++ b/libgnomecanvas/gailcanvasitem.c @@ -84,7 +84,7 @@ gail_canvas_item_initialize (AtkObject *obj, ATK_OBJECT_CLASS (parent_class)->initialize (obj, data); g_object_set_data (G_OBJECT (obj), "atk-component-layer", - GINT_TO_POINTER (ATK_LAYER_MDI)); + GINT_TO_POINTER (ATK_LAYER_MDI)); } static void @@ -138,17 +138,17 @@ gail_canvas_item_get_index_in_parent (AtkObject *obj) n_children = atk_object_get_n_accessible_children (obj->accessible_parent); for (i = 0; i < n_children; i++) - { - AtkObject *child; + { + AtkObject *child; - child = atk_object_ref_accessible_child (obj->accessible_parent, i); - if (child == obj) - found = TRUE; + child = atk_object_ref_accessible_child (obj->accessible_parent, i); + if (child == obj) + found = TRUE; - g_object_unref (child); - if (found) - return i; - } + g_object_unref (child); + if (found) + return i; + } return -1; } @@ -194,22 +194,22 @@ gail_canvas_item_ref_state_set (AtkObject *obj) item = GNOME_CANVAS_ITEM (g_obj); if (item->flags & GNOME_CANVAS_ITEM_VISIBLE) - { - atk_state_set_add_state (state_set, ATK_STATE_VISIBLE); - if (is_item_on_screen (item)) - { - atk_state_set_add_state (state_set, ATK_STATE_SHOWING); - } - } + { + atk_state_set_add_state (state_set, ATK_STATE_VISIBLE); + if (is_item_on_screen (item)) + { + atk_state_set_add_state (state_set, ATK_STATE_SHOWING); + } + } if (gtk_widget_get_can_focus (GTK_WIDGET (item->canvas))) - { - atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE); - - if (item->canvas->focused_item == item) - { - atk_state_set_add_state (state_set, ATK_STATE_FOCUSED); - } - } + { + atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE); + + if (item->canvas->focused_item == item) + { + atk_state_set_add_state (state_set, ATK_STATE_FOCUSED); + } + } } return state_set; @@ -239,15 +239,15 @@ gail_canvas_item_add_focus_handler (AtkComponent *component, signal_id = g_signal_lookup ("focus-event", ATK_TYPE_OBJECT); ret = g_signal_handler_find (component, match_type, signal_id, 0, NULL, - (gpointer) handler, NULL); + (gpointer) handler, NULL); if (!ret) { return g_signal_connect_closure_by_id (component, - signal_id, 0, - g_cclosure_new ( - G_CALLBACK (handler), NULL, - (GClosureNotify) NULL), - FALSE); + signal_id, 0, + g_cclosure_new ( + G_CALLBACK (handler), NULL, + (GClosureNotify) NULL), + FALSE); } else { @@ -295,7 +295,7 @@ gail_canvas_item_get_extents (AtkComponent *component, } gail_misc_get_origins (GTK_WIDGET (item->canvas), &window_x, &window_y, - &toplevel_x, &toplevel_y); + &toplevel_x, &toplevel_y); *x = extents.x + window_x - toplevel_x; *y = extents.y + window_y - toplevel_y; diff --git a/libgnomecanvas/gailcanvastext.c b/libgnomecanvas/gailcanvastext.c index bffc806c8a..0cbecac010 100644 --- a/libgnomecanvas/gailcanvastext.c +++ b/libgnomecanvas/gailcanvastext.c @@ -195,8 +195,8 @@ gail_canvas_text_get_text_after_offset (AtkText *text, gint *end_offset) { return get_text_near_offset (text, GAIL_AFTER_OFFSET, - boundary_type, offset, - start_offset, end_offset); + boundary_type, offset, + start_offset, end_offset); } static gchar * @@ -207,8 +207,8 @@ gail_canvas_text_get_text_at_offset (AtkText *text, gint *end_offset) { return get_text_near_offset (text, GAIL_AT_OFFSET, - boundary_type, offset, - start_offset, end_offset); + boundary_type, offset, + start_offset, end_offset); } static gchar * @@ -219,8 +219,8 @@ gail_canvas_text_get_text_before_offset (AtkText *text, gint *end_offset) { return get_text_near_offset (text, GAIL_BEFORE_OFFSET, - boundary_type, offset, - start_offset, end_offset); + boundary_type, offset, + start_offset, end_offset); } static gunichar @@ -331,7 +331,7 @@ gail_canvas_text_get_run_attributes (AtkText *text, g_return_val_if_fail (gail_text->textutil, NULL); return gail_misc_buffer_get_run_attributes (gail_text->textutil->buffer, - offset, start_offset, end_offset); + offset, start_offset, end_offset); } static AtkAttributeSet* @@ -515,6 +515,6 @@ get_text_near_offset (AtkText *text, gint *end_offset) { return gail_text_util_get_text (GAIL_CANVAS_TEXT (text)->textutil, NULL, - function, boundary_type, offset, - start_offset, end_offset); + function, boundary_type, offset, + start_offset, end_offset); } diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 82152bd629..3565610b47 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -70,21 +70,21 @@ G_DEFINE_TYPE (GnomeCanvasPixbuf, gnome_canvas_pixbuf, GNOME_TYPE_CANVAS_ITEM) static void gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class) { - GObjectClass *gobject_class; + GObjectClass *gobject_class; GnomeCanvasItemClass *item_class; - gobject_class = (GObjectClass *) class; + gobject_class = (GObjectClass *) class; item_class = (GnomeCanvasItemClass *) class; gobject_class->set_property = gnome_canvas_pixbuf_set_property; gobject_class->get_property = gnome_canvas_pixbuf_get_property; - g_object_class_install_property - (gobject_class, - PROP_PIXBUF, + g_object_class_install_property + (gobject_class, + PROP_PIXBUF, g_param_spec_object ("pixbuf", NULL, NULL, - GDK_TYPE_PIXBUF, - (G_PARAM_READABLE | G_PARAM_WRITABLE))); + GDK_TYPE_PIXBUF, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); item_class->dispose = gnome_canvas_pixbuf_dispose; item_class->update = gnome_canvas_pixbuf_update; @@ -92,7 +92,7 @@ gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class) item_class->point = gnome_canvas_pixbuf_point; item_class->bounds = gnome_canvas_pixbuf_bounds; - g_type_class_add_private (class, sizeof (GnomeCanvasPixbufPrivate)); + g_type_class_add_private (class, sizeof (GnomeCanvasPixbufPrivate)); } /* Object initialization function for the pixbuf canvas item */ @@ -102,8 +102,8 @@ gnome_canvas_pixbuf_init (GnomeCanvasPixbuf *gcp) GnomeCanvasPixbufPrivate *priv; priv = gcp->priv = G_TYPE_INSTANCE_GET_PRIVATE (gcp, - GNOME_TYPE_CANVAS_PIXBUF, - GnomeCanvasPixbufPrivate); + GNOME_TYPE_CANVAS_PIXBUF, + GnomeCanvasPixbufPrivate); } /* Dispose handler for the pixbuf canvas item */ @@ -211,7 +211,7 @@ recompute_bounding_box (GnomeCanvasPixbuf *gcp) GnomeCanvasItem *item; GnomeCanvasPixbufPrivate *priv; cairo_matrix_t i2c; - double x1, x2, y1, y2; + double x1, x2, y1, y2; item = GNOME_CANVAS_ITEM (gcp); priv = gcp->priv; @@ -256,10 +256,10 @@ gnome_canvas_pixbuf_update (GnomeCanvasItem *item, update (item, i2c, flags); /* ordinary update logic */ - gnome_canvas_request_redraw ( + gnome_canvas_request_redraw ( item->canvas, item->x1, item->y1, item->x2, item->y2); - recompute_bounding_box (gcp); - gnome_canvas_request_redraw ( + recompute_bounding_box (gcp); + gnome_canvas_request_redraw ( item->canvas, item->x1, item->y1, item->x2, item->y2); } @@ -272,7 +272,7 @@ gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr, { GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; - cairo_matrix_t matrix; + cairo_matrix_t matrix; gcp = GNOME_CANVAS_PIXBUF (item); priv = gcp->priv; @@ -280,13 +280,13 @@ gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr, if (!priv->pixbuf) return; - gnome_canvas_item_i2c_matrix (item, &matrix); + gnome_canvas_item_i2c_matrix (item, &matrix); cairo_save (cr); - cairo_transform (cr, &matrix); + cairo_transform (cr, &matrix); - gdk_cairo_set_source_pixbuf (cr, priv->pixbuf, 0, 0); - cairo_paint (cr); + gdk_cairo_set_source_pixbuf (cr, priv->pixbuf, 0, 0); + cairo_paint (cr); cairo_restore (cr); } @@ -302,9 +302,9 @@ gnome_canvas_pixbuf_point (GnomeCanvasItem *item, { GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; - GdkPixbuf *pixbuf; - gint px, py; - guchar *src; + GdkPixbuf *pixbuf; + gint px, py; + guchar *src; gcp = GNOME_CANVAS_PIXBUF (item); priv = gcp->priv; @@ -313,8 +313,8 @@ gnome_canvas_pixbuf_point (GnomeCanvasItem *item, if (!priv->pixbuf) return NULL; - px = x; - py = y; + px = x; + py = y; if (px < 0 || px >= gdk_pixbuf_get_width (pixbuf) || py < 0 || py >= gdk_pixbuf_get_height (pixbuf)) diff --git a/libgnomecanvas/gnome-canvas-rich-text.c b/libgnomecanvas/gnome-canvas-rich-text.c index f252266980..f836c12f1c 100644 --- a/libgnomecanvas/gnome-canvas-rich-text.c +++ b/libgnomecanvas/gnome-canvas-rich-text.c @@ -1832,9 +1832,9 @@ gnome_canvas_rich_text_get_iter_at_location (GnomeCanvasRichText *text, g_return_if_fail (text->_priv->layout != NULL); gtk_text_layout_get_iter_at_pixel (text->_priv->layout, - iter, - x, - y); + iter, + x, + y); } static void @@ -2016,7 +2016,7 @@ gnome_canvas_rich_text_point (GnomeCanvasItem *item, gdouble x, gdouble y, if ((x > x1) && (y > y1) && (x < x2) && (y < y2)) return item; - return NULL; + return NULL; } /* gnome_canvas_rich_text_point */ static void diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c index a9e546a883..d21c9b9c97 100644 --- a/libgnomecanvas/gnome-canvas-text.c +++ b/libgnomecanvas/gnome-canvas-text.c @@ -185,50 +185,50 @@ gnome_canvas_text_class_init (GnomeCanvasTextClass *class) gobject_class->get_property = gnome_canvas_text_get_property; /* Text */ - g_object_class_install_property - (gobject_class, - PROP_TEXT, + g_object_class_install_property + (gobject_class, + PROP_TEXT, g_param_spec_string ("text", "Text", "Text to render", - NULL, - (G_PARAM_READABLE | G_PARAM_WRITABLE))); + NULL, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_MARKUP, + g_object_class_install_property + (gobject_class, + PROP_MARKUP, g_param_spec_string ("markup", "Markup", "Marked up text to render", NULL, - (G_PARAM_WRITABLE))); + (G_PARAM_WRITABLE))); /* Position */ - g_object_class_install_property - (gobject_class, - PROP_X, + g_object_class_install_property + (gobject_class, + PROP_X, g_param_spec_double ("x", NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_Y, + g_object_class_install_property + (gobject_class, + PROP_Y, g_param_spec_double ("y", NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); /* Font */ g_object_class_install_property - (gobject_class, - PROP_FONT, + (gobject_class, + PROP_FONT, g_param_spec_string ("font", "Font", "Font description as a string", - NULL, - (G_PARAM_READABLE | G_PARAM_WRITABLE))); + NULL, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property + g_object_class_install_property (gobject_class, PROP_FONT_DESC, g_param_spec_boxed ("font_desc", @@ -247,9 +247,9 @@ gnome_canvas_text_class_init (GnomeCanvasTextClass *class) (G_PARAM_READABLE | G_PARAM_WRITABLE))); /* Style */ - g_object_class_install_property - (gobject_class, - PROP_ATTRIBUTES, + g_object_class_install_property + (gobject_class, + PROP_ATTRIBUTES, g_param_spec_boxed ("attributes", NULL, NULL, PANGO_TYPE_ATTR_LIST, (G_PARAM_READABLE | G_PARAM_WRITABLE))); @@ -359,78 +359,78 @@ gnome_canvas_text_class_init (GnomeCanvasTextClass *class) 1.0, G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_object_class_install_property - (gobject_class, - PROP_JUSTIFICATION, + g_object_class_install_property + (gobject_class, + PROP_JUSTIFICATION, g_param_spec_enum ("justification", NULL, NULL, - GTK_TYPE_JUSTIFICATION, - GTK_JUSTIFY_LEFT, - (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_CLIP_WIDTH, + GTK_TYPE_JUSTIFICATION, + GTK_JUSTIFY_LEFT, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + g_object_class_install_property + (gobject_class, + PROP_CLIP_WIDTH, g_param_spec_double ("clip_width", NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_CLIP_HEIGHT, + g_object_class_install_property + (gobject_class, + PROP_CLIP_HEIGHT, g_param_spec_double ("clip_height", NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_CLIP, + g_object_class_install_property + (gobject_class, + PROP_CLIP, g_param_spec_boolean ("clip", NULL, NULL, FALSE, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_X_OFFSET, + g_object_class_install_property + (gobject_class, + PROP_X_OFFSET, g_param_spec_double ("x_offset", NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_Y_OFFSET, + g_object_class_install_property + (gobject_class, + PROP_Y_OFFSET, g_param_spec_double ("y_offset", NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_FILL_COLOR, + g_object_class_install_property + (gobject_class, + PROP_FILL_COLOR, g_param_spec_string ("fill_color", "Color", "Text color, as string", - NULL, - G_PARAM_WRITABLE)); - g_object_class_install_property - (gobject_class, - PROP_FILL_COLOR_GDK, + NULL, + G_PARAM_WRITABLE)); + g_object_class_install_property + (gobject_class, + PROP_FILL_COLOR_GDK, g_param_spec_boxed ("fill_color_gdk", "Color", "Text color, as a GdkColor", GDK_TYPE_COLOR, G_PARAM_WRITABLE)); - g_object_class_install_property - (gobject_class, - PROP_FILL_COLOR_RGBA, + g_object_class_install_property + (gobject_class, + PROP_FILL_COLOR_RGBA, g_param_spec_uint ("fill_color_rgba", "Color", "Text color, as an R/G/B/A combined integer", 0, G_MAXUINT, 0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_TEXT_WIDTH, + g_object_class_install_property + (gobject_class, + PROP_TEXT_WIDTH, g_param_spec_double ("text_width", "Text width", "Width of the rendered text", 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READABLE)); - g_object_class_install_property - (gobject_class, - PROP_TEXT_HEIGHT, + g_object_class_install_property + (gobject_class, + PROP_TEXT_HEIGHT, g_param_spec_double ("text_height", "Text height", "Height of the rendered text", @@ -637,7 +637,7 @@ gnome_canvas_text_set_property (GObject *object, text = GNOME_CANVAS_TEXT (object); if (!text->layout) - text->layout = pango_layout_new ( + text->layout = pango_layout_new ( gtk_widget_get_pango_context ( GTK_WIDGET (item->canvas))); @@ -842,12 +842,12 @@ gnome_canvas_text_set_property (GObject *object, text->yofs = g_value_get_double (value); break; - case PROP_FILL_COLOR: { + case PROP_FILL_COLOR: { const gchar *color_name; color_name = g_value_get_string (value); if (color_name) { - GdkColor color; + GdkColor color; gdk_color_parse (color_name, &color); text->rgba = ((color.red & 0xff00) << 16 | @@ -861,16 +861,16 @@ gnome_canvas_text_set_property (GObject *object, case PROP_FILL_COLOR_GDK: pcolor = g_value_get_boxed (value); if (pcolor) { - text->rgba = ((pcolor->red & 0xff00) << 16 | - (pcolor->green & 0xff00) << 8| - (pcolor->blue & 0xff00) | - 0xff); - } else { - text->rgba = 0; - } + text->rgba = ((pcolor->red & 0xff00) << 16 | + (pcolor->green & 0xff00) << 8| + (pcolor->blue & 0xff00) | + 0xff); + } else { + text->rgba = 0; + } break; - case PROP_FILL_COLOR_RGBA: + case PROP_FILL_COLOR_RGBA: text->rgba = g_value_get_uint (value); break; @@ -1203,23 +1203,23 @@ gnome_canvas_text_draw (GnomeCanvasItem *item, cairo_t *cr, cairo_save (cr); - if (text->clip) { - cairo_rectangle (cr, - text->clip_cx - x, - text->clip_cy - y, - text->clip_cwidth, - text->clip_cheight); - cairo_clip (cr); + if (text->clip) { + cairo_rectangle (cr, + text->clip_cx - x, + text->clip_cy - y, + text->clip_cwidth, + text->clip_cheight); + cairo_clip (cr); } - cairo_set_source_rgba (cr, - ((text->rgba >> 24) & 0xff) / 255.0, - ((text->rgba >> 16) & 0xff) / 255.0, - ((text->rgba >> 8) & 0xff) / 255.0, - ( text->rgba & 0xff) / 255.0); + cairo_set_source_rgba (cr, + ((text->rgba >> 24) & 0xff) / 255.0, + ((text->rgba >> 16) & 0xff) / 255.0, + ((text->rgba >> 8) & 0xff) / 255.0, + ( text->rgba & 0xff) / 255.0); - cairo_move_to (cr, text->cx - x, text->cy - y); - pango_cairo_show_layout (cr, text->layout); + cairo_move_to (cr, text->cx - x, text->cy - y); + pango_cairo_show_layout (cr, text->layout); cairo_restore (cr); } diff --git a/libgnomecanvas/gnome-canvas-util.c b/libgnomecanvas/gnome-canvas-util.c index d05171b4e4..5ca5979442 100644 --- a/libgnomecanvas/gnome-canvas-util.c +++ b/libgnomecanvas/gnome-canvas-util.c @@ -94,14 +94,14 @@ gnome_canvas_update_bbox (GnomeCanvasItem *item, gint x1, gint y1, gint x2, gint cairo_t * gnome_canvas_cairo_create_scratch (void) { - cairo_surface_t *surface; - cairo_t *cr; + cairo_surface_t *surface; + cairo_t *cr; - surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0); - cr = cairo_create (surface); - cairo_surface_destroy (surface); + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0); + cr = cairo_create (surface); + cairo_surface_destroy (surface); - return cr; + return cr; } /** @@ -119,38 +119,38 @@ void gnome_canvas_matrix_transform_rect (const cairo_matrix_t *matrix, double *x1, double *y1, double *x2, double *y2) { - double maxx, maxy, minx, miny; - double tmpx, tmpy; - - tmpx = *x1; - tmpy = *y1; - cairo_matrix_transform_point (matrix, &tmpx, &tmpy); - minx = maxx = tmpx; - miny = maxy = tmpy; - - tmpx = *x2; - tmpy = *y1; - cairo_matrix_transform_point (matrix, &tmpx, &tmpy); - minx = MIN (minx, tmpx); - maxx = MAX (maxx, tmpx); - miny = MIN (miny, tmpy); - maxy = MAX (maxy, tmpy); - - tmpx = *x2; - tmpy = *y2; - cairo_matrix_transform_point (matrix, &tmpx, &tmpy); - minx = MIN (minx, tmpx); - maxx = MAX (maxx, tmpx); - miny = MIN (miny, tmpy); - maxy = MAX (maxy, tmpy); - - tmpx = *x1; - tmpy = *y2; - cairo_matrix_transform_point (matrix, &tmpx, &tmpy); - minx = MIN (minx, tmpx); - maxx = MAX (maxx, tmpx); - miny = MIN (miny, tmpy); - maxy = MAX (maxy, tmpy); + double maxx, maxy, minx, miny; + double tmpx, tmpy; + + tmpx = *x1; + tmpy = *y1; + cairo_matrix_transform_point (matrix, &tmpx, &tmpy); + minx = maxx = tmpx; + miny = maxy = tmpy; + + tmpx = *x2; + tmpy = *y1; + cairo_matrix_transform_point (matrix, &tmpx, &tmpy); + minx = MIN (minx, tmpx); + maxx = MAX (maxx, tmpx); + miny = MIN (miny, tmpy); + maxy = MAX (maxy, tmpy); + + tmpx = *x2; + tmpy = *y2; + cairo_matrix_transform_point (matrix, &tmpx, &tmpy); + minx = MIN (minx, tmpx); + maxx = MAX (maxx, tmpx); + miny = MIN (miny, tmpy); + maxy = MAX (maxy, tmpy); + + tmpx = *x1; + tmpy = *y2; + cairo_matrix_transform_point (matrix, &tmpx, &tmpy); + minx = MIN (minx, tmpx); + maxx = MAX (maxx, tmpx); + miny = MIN (miny, tmpy); + maxy = MAX (maxy, tmpy); *x1 = minx; *x2 = maxx; diff --git a/libgnomecanvas/gnome-canvas-widget.c b/libgnomecanvas/gnome-canvas-widget.c index c6dd99f476..5fe04ba12b 100644 --- a/libgnomecanvas/gnome-canvas-widget.c +++ b/libgnomecanvas/gnome-canvas-widget.c @@ -121,39 +121,39 @@ gnome_canvas_widget_class_init (GnomeCanvasWidgetClass *class) gobject_class->set_property = gnome_canvas_widget_set_property; gobject_class->get_property = gnome_canvas_widget_get_property; - g_object_class_install_property - (gobject_class, - PROP_WIDGET, + g_object_class_install_property + (gobject_class, + PROP_WIDGET, g_param_spec_object ("widget", NULL, NULL, - GTK_TYPE_WIDGET, - (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_X, + GTK_TYPE_WIDGET, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + g_object_class_install_property + (gobject_class, + PROP_X, g_param_spec_double ("x", NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_Y, + g_object_class_install_property + (gobject_class, + PROP_Y, g_param_spec_double ("y", NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_WIDTH, + g_object_class_install_property + (gobject_class, + PROP_WIDTH, g_param_spec_double ("width", NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_HEIGHT, + g_object_class_install_property + (gobject_class, + PROP_HEIGHT, g_param_spec_double ("height", NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (G_PARAM_READABLE | G_PARAM_WRITABLE))); - g_object_class_install_property - (gobject_class, - PROP_SIZE_PIXELS, + g_object_class_install_property + (gobject_class, + PROP_SIZE_PIXELS, g_param_spec_boolean ("size_pixels", NULL, NULL, FALSE, (G_PARAM_READABLE | G_PARAM_WRITABLE))); @@ -436,7 +436,7 @@ gnome_canvas_widget_point (GnomeCanvasItem *item, gdouble x, gdouble y, return item; /* Point is outside widget bounds */ - return NULL; + return NULL; } static void diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c index 86624f2b99..30f703bd5e 100644 --- a/libgnomecanvas/gnome-canvas.c +++ b/libgnomecanvas/gnome-canvas.c @@ -174,7 +174,7 @@ gnome_canvas_item_init (GnomeCanvasItem *item) { item->flags |= GNOME_CANVAS_ITEM_VISIBLE; - cairo_matrix_init_identity (&item->matrix); + cairo_matrix_init_identity (&item->matrix); } /** @@ -435,7 +435,7 @@ gnome_canvas_item_invoke_update (GnomeCanvasItem *item, /* Calculate actual item transformation matrix */ - cairo_matrix_multiply (&i2c, &item->matrix, p2c); + cairo_matrix_multiply (&i2c, &item->matrix, p2c); /* apply object flags to child flags */ @@ -473,14 +473,14 @@ gnome_canvas_item_invoke_point (GnomeCanvasItem *item, gint cx, gint cy) { - cairo_matrix_t inverse; + cairo_matrix_t inverse; /* Calculate x & y in item local coordinates */ - inverse = item->matrix; - if (cairo_matrix_invert (&inverse) != CAIRO_STATUS_SUCCESS) - return NULL; + inverse = item->matrix; + if (cairo_matrix_invert (&inverse) != CAIRO_STATUS_SUCCESS) + return NULL; - cairo_matrix_transform_point (&inverse, &x, &y); + cairo_matrix_transform_point (&inverse, &x, &y); if (GNOME_CANVAS_ITEM_GET_CLASS (item)->point) return GNOME_CANVAS_ITEM_GET_CLASS (item)->point (item, x, y, cx, cy); @@ -565,9 +565,9 @@ gnome_canvas_item_set_matrix (GnomeCanvasItem *item, const cairo_matrix_t *matri g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); if (matrix) { - item->matrix = *matrix; + item->matrix = *matrix; } else { - cairo_matrix_init_identity (&item->matrix); + cairo_matrix_init_identity (&item->matrix); } if (!(item->flags & GNOME_CANVAS_ITEM_NEED_AFFINE)) { @@ -913,7 +913,7 @@ gnome_canvas_item_i2w_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) cairo_matrix_init_identity (matrix); while (item) { - cairo_matrix_multiply (matrix, matrix, &item->matrix); + cairo_matrix_multiply (matrix, matrix, &item->matrix); item = item->parent; } @@ -944,14 +944,14 @@ gnome_canvas_item_w2i_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) void gnome_canvas_item_w2i (GnomeCanvasItem *item, gdouble *x, gdouble *y) { - cairo_matrix_t matrix; + cairo_matrix_t matrix; g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); g_return_if_fail (x != NULL); g_return_if_fail (y != NULL); gnome_canvas_item_w2i_matrix (item, &matrix); - cairo_matrix_transform_point (&matrix, x, y); + cairo_matrix_transform_point (&matrix, x, y); } /** @@ -966,14 +966,14 @@ gnome_canvas_item_w2i (GnomeCanvasItem *item, gdouble *x, gdouble *y) void gnome_canvas_item_i2w (GnomeCanvasItem *item, gdouble *x, gdouble *y) { - cairo_matrix_t matrix; + cairo_matrix_t matrix; g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); g_return_if_fail (x != NULL); g_return_if_fail (y != NULL); gnome_canvas_item_i2w_matrix (item, &matrix); - cairo_matrix_transform_point (&matrix, x, y); + cairo_matrix_transform_point (&matrix, x, y); } /** @@ -1129,7 +1129,7 @@ gnome_canvas_item_get_bounds (GnomeCanvasItem *item, (* GNOME_CANVAS_ITEM_GET_CLASS (item)->bounds) (item, &tx1, &ty1, &tx2, &ty2); /* Make the bounds relative to the item's parent coordinate system */ - gnome_canvas_matrix_transform_rect (&item->matrix, &tx1, &ty1, &tx2, &ty2); + gnome_canvas_matrix_transform_rect (&item->matrix, &tx1, &ty1, &tx2, &ty2); /* Return the values */ @@ -1373,7 +1373,7 @@ gnome_canvas_group_update (GnomeCanvasItem *item, GnomeCanvasGroup *group; GList *list; GnomeCanvasItem *i; - double x1, y1, x2, y2; + double x1, y1, x2, y2; group = GNOME_CANVAS_GROUP (item); @@ -1389,19 +1389,19 @@ gnome_canvas_group_update (GnomeCanvasItem *item, gnome_canvas_item_invoke_update (i, i2c, flags); - x1 = MIN (x1, i->x1); - x2 = MAX (x2, i->x2); - y1 = MIN (y1, i->y1); - y2 = MAX (y2, i->y2); + x1 = MIN (x1, i->x1); + x2 = MAX (x2, i->x2); + y1 = MIN (y1, i->y1); + y2 = MAX (y2, i->y2); + } + if (x1 >= x2 || y1 >= y2) { + item->x1 = item->x2 = item->y1 = item->y2 = 0; + } else { + item->x1 = x1; + item->y1 = y1; + item->x2 = x2; + item->y2 = y2; } - if (x1 >= x2 || y1 >= y2) { - item->x1 = item->x2 = item->y1 = item->y2 = 0; - } else { - item->x1 = x1; - item->y1 = y1; - item->x2 = x2; - item->y2 = y2; - } } /* Realize handler for canvas groups */ @@ -1538,11 +1538,11 @@ gnome_canvas_group_point (GnomeCanvasItem *item, continue; if (!(child->flags & GNOME_CANVAS_ITEM_VISIBLE)) - continue; + continue; point_item = gnome_canvas_item_invoke_point (child, x, y, cx, cy); if (point_item) - return point_item; + return point_item; } return NULL; @@ -2253,14 +2253,14 @@ gnome_canvas_draw (GtkWidget *widget, GnomeCanvas *canvas = GNOME_CANVAS (widget); cairo_rectangle_int_t rect; - gdk_cairo_get_clip_rectangle (cr, &rect); + gdk_cairo_get_clip_rectangle (cr, &rect); - if (canvas->need_update) { - gnome_canvas_request_redraw (canvas, - rect.x, rect.y, - rect.x + rect.width, - rect.y + rect.height); - } else { + if (canvas->need_update) { + gnome_canvas_request_redraw (canvas, + rect.x, rect.y, + rect.x + rect.width, + rect.y + rect.height); + } else { GtkLayout *layout; GtkAdjustment *hadjustment; GtkAdjustment *vadjustment; @@ -2274,25 +2274,25 @@ gnome_canvas_draw (GtkWidget *widget, hadjustment_value = gtk_adjustment_get_value (hadjustment); vadjustment_value = gtk_adjustment_get_value (vadjustment); - cairo_save (cr); - cairo_translate (cr, - -canvas->zoom_xofs + rect.x, - -canvas->zoom_yofs + rect.y); + cairo_save (cr); + cairo_translate (cr, + -canvas->zoom_xofs + rect.x, + -canvas->zoom_yofs + rect.y); rect.x += hadjustment_value; rect.y += vadjustment_value; /* No pending updates, draw exposed area immediately */ - gnome_canvas_paint_rect (canvas, cr, - rect.x, rect.y, - rect.x + rect.width, - rect.y + rect.height); - cairo_restore (cr); + gnome_canvas_paint_rect (canvas, cr, + rect.x, rect.y, + rect.x + rect.width, + rect.y + rect.height); + cairo_restore (cr); /* And call expose on parent container class */ - GTK_WIDGET_CLASS (canvas_parent_class)-> - draw (widget, cr); - } + GTK_WIDGET_CLASS (canvas_parent_class)-> + draw (widget, cr); + } return FALSE; } @@ -2319,7 +2319,7 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event) */ /* g_warning ("emit_event() returning FALSE!\n");*/ return FALSE; - } + } if (canvas->grabbed_item) { switch (event->type) { @@ -2373,7 +2373,7 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event) ev = gdk_event_copy (event); switch (ev->type) - { + { case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: gnome_canvas_window_to_world (canvas, @@ -2386,10 +2386,10 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event) case GDK_2BUTTON_PRESS: case GDK_3BUTTON_PRESS: case GDK_BUTTON_RELEASE: - gnome_canvas_window_to_world (canvas, - ev->motion.x, ev->motion.y, - &ev->motion.x, &ev->motion.y); - break; + gnome_canvas_window_to_world (canvas, + ev->motion.x, ev->motion.y, + &ev->motion.x, &ev->motion.y); + break; default: break; @@ -2792,10 +2792,10 @@ do_update (GnomeCanvas *canvas) update_again: if (canvas->need_update) { - cairo_matrix_t w2c; + cairo_matrix_t w2c; /* We start updating root with w2c matrix */ - gnome_canvas_w2c_matrix (canvas, &w2c); + gnome_canvas_w2c_matrix (canvas, &w2c); gnome_canvas_item_invoke_update (canvas->root, &w2c, 0); @@ -3098,24 +3098,24 @@ get_visible_rect (GnomeCanvas *canvas, GdkRectangle *visible) void gnome_canvas_request_redraw (GnomeCanvas *canvas, gint x1, gint y1, gint x2, gint y2) { - GdkRectangle area, clip; + GdkRectangle area, clip; g_return_if_fail (GNOME_IS_CANVAS (canvas)); if (!gtk_widget_is_drawable (GTK_WIDGET (canvas)) || (x1 >= x2) || (y1 >= y2)) return; - area.x = x1; - area.y = y1; - area.width = x2 - x1; - area.height = y2 - y1; + area.x = x1; + area.y = y1; + area.width = x2 - x1; + area.height = y2 - y1; get_visible_rect (canvas, &clip); - if (!gdk_rectangle_intersect (&area, &clip, &area)) - return; + if (!gdk_rectangle_intersect (&area, &clip, &area)) + return; gdk_window_invalidate_rect (gtk_layout_get_bin_window (GTK_LAYOUT (canvas)), - &area, FALSE); + &area, FALSE); } /** @@ -3172,7 +3172,7 @@ gnome_canvas_w2c (GnomeCanvas *canvas, gdouble wx, gdouble wy, gint *cx, gint *c g_return_if_fail (GNOME_IS_CANVAS (canvas)); gnome_canvas_w2c_matrix (canvas, &w2c); - cairo_matrix_transform_point (&w2c, &wx, &wy); + cairo_matrix_transform_point (&w2c, &wx, &wy); if (cx) *cx = floor (wx + 0.5); @@ -3204,7 +3204,7 @@ gnome_canvas_w2c_d (GnomeCanvas *canvas, g_return_if_fail (GNOME_IS_CANVAS (canvas)); gnome_canvas_w2c_matrix (canvas, &w2c); - cairo_matrix_transform_point (&w2c, &wx, &wy); + cairo_matrix_transform_point (&w2c, &wx, &wy); if (cx) *cx = wx; @@ -3226,14 +3226,14 @@ void gnome_canvas_c2w (GnomeCanvas *canvas, gint cx, gint cy, gdouble *wx, gdouble *wy) { cairo_matrix_t c2w; - double x, y; + double x, y; g_return_if_fail (GNOME_IS_CANVAS (canvas)); - x = cx; - y = cy; + x = cx; + y = cy; gnome_canvas_c2w_matrix (canvas, &c2w); - cairo_matrix_transform_point (&c2w, &x, &y); + cairo_matrix_transform_point (&c2w, &x, &y); if (wx) *wx = x; |