aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
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
parent27c2f5dd5d2c88e8d7de49223f59354b606a5b2d (diff)
downloadgsoc2013-evolution-a84d2e0d8c6d6ee440de7a1823dca76d157f7546.tar.gz
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')
-rw-r--r--widgets/misc/e-canvas-utils.c34
-rw-r--r--widgets/misc/e-canvas-utils.h25
2 files changed, 56 insertions, 3 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;
diff --git a/widgets/misc/e-canvas-utils.h b/widgets/misc/e-canvas-utils.h
index 97a9989fb9..40eca8237e 100644
--- a/widgets/misc/e-canvas-utils.h
+++ b/widgets/misc/e-canvas-utils.h
@@ -27,9 +27,28 @@
BEGIN_GNOME_DECLS
-void e_canvas_item_move_absolute (GnomeCanvasItem *item, double dx, double dy);
-void e_canvas_item_show_area (GnomeCanvasItem *item, double x1, double y1, double x2, double y2);
-void e_canvas_item_show_area_delayed (GnomeCanvasItem *item, double x1, double y1, double x2, double y2, gint delay);
+void e_canvas_item_move_absolute (GnomeCanvasItem *item,
+ double dx,
+ double dy);
+void e_canvas_item_show_area (GnomeCanvasItem *item,
+ double x1,
+ double y1,
+ double x2,
+ double y2);
+void e_canvas_item_show_area_delayed (GnomeCanvasItem *item,
+ double x1,
+ double y1,
+ double x2,
+ double y2,
+ gint delay);
+/* Returns TRUE if the area is already shown on the screen (including
+ spacing.) This is equivelent to returning FALSE iff show_area
+ would do anything. */
+gboolean e_canvas_item_area_shown (GnomeCanvasItem *item,
+ double x1,
+ double y1,
+ double x2,
+ double y2);
END_GNOME_DECLS