aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-canvas-utils.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-02 19:12:31 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-02 19:12:31 +0800
commita84d2e0d8c6d6ee440de7a1823dca76d157f7546 (patch)
treecc4943f0c9507bfb5aec350b15b6415c362b9a6c /widgets/misc/e-canvas-utils.c
parent27c2f5dd5d2c88e8d7de49223f59354b606a5b2d (diff)
downloadgsoc2013-evolution-a84d2e0d8c6d6ee440de7a1823dca76d157f7546.tar
gsoc2013-evolution-a84d2e0d8c6d6ee440de7a1823dca76d157f7546.tar.gz
gsoc2013-evolution-a84d2e0d8c6d6ee440de7a1823dca76d157f7546.tar.bz2
gsoc2013-evolution-a84d2e0d8c6d6ee440de7a1823dca76d157f7546.tar.lz
gsoc2013-evolution-a84d2e0d8c6d6ee440de7a1823dca76d157f7546.tar.xz
gsoc2013-evolution-a84d2e0d8c6d6ee440de7a1823dca76d157f7546.tar.zst
gsoc2013-evolution-a84d2e0d8c6d6ee440de7a1823dca76d157f7546.zip
Bumped the sonumber to 14.
2001-10-02 Christopher James Lahey <clahey@ximian.com> * configure.in: Bumped the sonumber to 14. * gal/widgets/e-canvas-utils.c, gal/widgets/e-canvas-utils.h (e_canvas_item_area_shown): New function returns TRUE iff e_canvas_item_show_area would be a noop. svn path=/trunk/; revision=13296
Diffstat (limited to 'widgets/misc/e-canvas-utils.c')
-rw-r--r--widgets/misc/e-canvas-utils.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/widgets/misc/e-canvas-utils.c b/widgets/misc/e-canvas-utils.c
index 50fcf0d7e5..14d44f7bb2 100644
--- a/widgets/misc/e-canvas-utils.c
+++ b/widgets/misc/e-canvas-utils.c
@@ -95,6 +95,40 @@ e_canvas_item_show_area (GnomeCanvasItem *item, double x1, double y1, double x2,
e_canvas_show_area(item->canvas, x1, y1, x2, y2);
}
+
+static gboolean
+e_canvas_area_shown (GnomeCanvas *canvas, double x1, double y1, double x2, double y2)
+{
+ GtkAdjustment *h, *v;
+ int dx = 0, dy = 0;
+
+ g_return_val_if_fail (canvas != NULL, FALSE);
+ g_return_val_if_fail (GNOME_IS_CANVAS (canvas), FALSE);
+
+ h = gtk_layout_get_hadjustment(GTK_LAYOUT(canvas));
+ dx = compute_offset(x1, x2, h->value, h->value + h->page_size);
+ if (CLAMP(h->value + dx, h->lower, h->upper - h->page_size) - h->value != 0)
+ return FALSE;
+
+ v = gtk_layout_get_vadjustment(GTK_LAYOUT(canvas));
+ dy = compute_offset(y1, y2, v->value, v->value + v->page_size);
+ if (CLAMP(v->value + dy, v->lower, v->upper - v->page_size) - v->value != 0)
+ return FALSE;
+ return TRUE;
+}
+
+gboolean
+e_canvas_item_area_shown (GnomeCanvasItem *item, double x1, double y1, double x2, double y2)
+{
+ g_return_val_if_fail (item != NULL, FALSE);
+ g_return_val_if_fail (GNOME_IS_CANVAS_ITEM (item), FALSE);
+
+ gnome_canvas_item_i2w(item, &x1, &y1);
+ gnome_canvas_item_i2w(item, &x2, &y2);
+
+ return e_canvas_area_shown(item->canvas, x1, y1, x2, y2);
+}
+
typedef struct {
double x1;
double y1;