aboutsummaryrefslogtreecommitdiffstats
path: root/libgnomecanvas/gnome-canvas-rich-text.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-25 22:36:27 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-27 01:31:26 +0800
commit5d812173d0e4e12a74bce2ee137d04b0e56db827 (patch)
tree3e86f53297ae3f0e5c61385c9fa430ca1bb05373 /libgnomecanvas/gnome-canvas-rich-text.c
parentde12bb89a800991bd63ce09ae42b04e1f7903198 (diff)
downloadgsoc2013-evolution-5d812173d0e4e12a74bce2ee137d04b0e56db827.tar.gz
gsoc2013-evolution-5d812173d0e4e12a74bce2ee137d04b0e56db827.tar.zst
gsoc2013-evolution-5d812173d0e4e12a74bce2ee137d04b0e56db827.zip
Drop usage of GtkAnchorType.
gtk+-3.0 removed it for being "unused".
Diffstat (limited to 'libgnomecanvas/gnome-canvas-rich-text.c')
-rw-r--r--libgnomecanvas/gnome-canvas-rich-text.c85
1 files changed, 6 insertions, 79 deletions
diff --git a/libgnomecanvas/gnome-canvas-rich-text.c b/libgnomecanvas/gnome-canvas-rich-text.c
index bd988ae3f5..2decb1dfbf 100644
--- a/libgnomecanvas/gnome-canvas-rich-text.c
+++ b/libgnomecanvas/gnome-canvas-rich-text.c
@@ -58,7 +58,6 @@ struct _GnomeCanvasRichTextPrivate {
GtkWrapMode wrap_mode;
GtkJustification justification;
GtkTextDirection direction;
- GtkAnchorType anchor;
gint pixels_above_lines;
gint pixels_below_lines;
gint pixels_inside_wrap;
@@ -316,15 +315,6 @@ gnome_canvas_rich_text_class_init (GnomeCanvasRichTextClass *klass)
G_PARAM_READWRITE));
g_object_class_install_property (
gobject_class,
- PROP_ANCHOR,
- g_param_spec_enum ("anchor",
- "Anchor",
- "Anchor point for text",
- GTK_TYPE_ANCHOR_TYPE,
- GTK_ANCHOR_NW,
- G_PARAM_READWRITE));
- g_object_class_install_property (
- gobject_class,
PROP_PIXELS_ABOVE_LINES,
g_param_spec_int ("pixels_above_lines",
"Pixels Above Lines",
@@ -418,7 +408,6 @@ gnome_canvas_rich_text_init (GnomeCanvasRichText *text)
text->_priv->wrap_mode = GTK_WRAP_WORD;
text->_priv->justification = GTK_JUSTIFY_LEFT;
text->_priv->direction = gtk_widget_get_default_direction ();
- text->_priv->anchor = GTK_ANCHOR_NW;
text->_priv->blink_timeout = 0;
text->_priv->preblink_timeout = 0;
@@ -531,9 +520,6 @@ gnome_canvas_rich_text_set_property (GObject *object, guint property_id,
gtk_text_layout_default_style_changed (text->_priv->layout);
}
break;
- case PROP_ANCHOR:
- text->_priv->anchor = g_value_get_enum (value);
- break;
case PROP_PIXELS_ABOVE_LINES:
text->_priv->pixels_above_lines = g_value_get_int (value);
@@ -639,9 +625,6 @@ gnome_canvas_rich_text_get_property (GObject *object, guint property_id,
case PROP_DIRECTION:
g_value_set_enum (value, text->_priv->direction);
break;
- case PROP_ANCHOR:
- g_value_set_enum (value, text->_priv->anchor);
- break;
case PROP_PIXELS_ABOVE_LINES:
g_value_set_enum (value, text->_priv->pixels_above_lines);
break;
@@ -1969,65 +1952,6 @@ gnome_canvas_rich_text_destroy_layout (GnomeCanvasRichText *text)
} /* gnome_canvas_rich_text_destroy_layout */
static void
-adjust_for_anchors (GnomeCanvasRichText *text, gdouble *ax, gdouble *ay)
-{
- gdouble x, y;
-
- x = text->_priv->x;
- y = text->_priv->y;
-
- /* Anchor text */
- /* X coordinates */
- switch (text->_priv->anchor) {
- case GTK_ANCHOR_NW:
- case GTK_ANCHOR_W:
- case GTK_ANCHOR_SW:
- break;
-
- case GTK_ANCHOR_N:
- case GTK_ANCHOR_CENTER:
- case GTK_ANCHOR_S:
- x -= text->_priv->width / 2;
- break;
-
- case GTK_ANCHOR_NE:
- case GTK_ANCHOR_E:
- case GTK_ANCHOR_SE:
- x -= text->_priv->width;
- break;
- default:
- break;
- }
-
- /* Y coordinates */
- switch (text->_priv->anchor) {
- case GTK_ANCHOR_NW:
- case GTK_ANCHOR_N:
- case GTK_ANCHOR_NE:
- break;
-
- case GTK_ANCHOR_W:
- case GTK_ANCHOR_CENTER:
- case GTK_ANCHOR_E:
- y -= text->_priv->height / 2;
- break;
-
- case GTK_ANCHOR_SW:
- case GTK_ANCHOR_S:
- case GTK_ANCHOR_SE:
- y -= text->_priv->height;
- break;
- default:
- break;
- }
-
- if (ax)
- *ax = x;
- if (ay)
- *ay = y;
-} /* adjust_for_anchors */
-
-static void
get_bounds (GnomeCanvasRichText *text, gdouble *px1, gdouble *py1,
gdouble *px2, gdouble *py2)
{
@@ -2036,7 +1960,8 @@ get_bounds (GnomeCanvasRichText *text, gdouble *px1, gdouble *py1,
gdouble x1, x2, y1, y2;
gint cx1, cx2, cy1, cy2;
- adjust_for_anchors (text, &x, &y);
+ x = text->_priv->x;
+ y = text->_priv->y;
x1 = x;
y1 = y;
@@ -2099,7 +2024,8 @@ gnome_canvas_rich_text_point (GnomeCanvasItem *item, gdouble x, gdouble y,
/* This is a lame cop-out. Anywhere inside of the bounding box. */
- adjust_for_anchors (text, &ax, &ay);
+ ax = text->_priv->x;
+ ay = text->_priv->y;
x1 = ax;
y1 = ay;
@@ -2143,7 +2069,8 @@ gnome_canvas_rich_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
gnome_canvas_w2c_affine (item->canvas, w2c);
art_affine_multiply (i2c, i2w, w2c);
- adjust_for_anchors (text, &ax, &ay);
+ ax = text->_priv->x;
+ ay = text->_priv->y;
i1.x = ax;
i1.y = ay;