aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-canvas.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-06-21 11:45:32 +0800
committerChris Lahey <clahey@src.gnome.org>2000-06-21 11:45:32 +0800
commit26f8433aa06f52cefb43fa6d69a4101d6563ef8b (patch)
tree1fc10cbb639cf7efac573125d3718ce7e25ecd4d /widgets/misc/e-canvas.c
parente7b121771f307c4eed3ca92a6920d4b6328261de (diff)
downloadgsoc2013-evolution-26f8433aa06f52cefb43fa6d69a4101d6563ef8b.tar.gz
gsoc2013-evolution-26f8433aa06f52cefb43fa6d69a4101d6563ef8b.tar.zst
gsoc2013-evolution-26f8433aa06f52cefb43fa6d69a4101d6563ef8b.zip
Added a variable to keep track of the cursor. Set the cursor when
2000-06-20 Christopher James Lahey <clahey@helixcode.com> * e-canvas.c, e-canvas.h: Added a variable to keep track of the cursor. Set the cursor when selection_add is called. Properly unset the cursor at the right times. svn path=/trunk/; revision=3663
Diffstat (limited to 'widgets/misc/e-canvas.c')
-rw-r--r--widgets/misc/e-canvas.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index bbe58efdc3..5b843bf5b8 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -45,11 +45,6 @@ enum {
static guint e_canvas_signals [LAST_SIGNAL] = { 0, };
-typedef struct {
- GnomeCanvasItem *item;
- gpointer id;
-} ECanvasSelectionInfo;
-
GtkType
e_canvas_get_type (void)
{
@@ -113,6 +108,7 @@ static void
e_canvas_init (ECanvas *canvas)
{
canvas->selection = NULL;
+ canvas->cursor = NULL;
}
static void
@@ -519,6 +515,7 @@ e_canvas_item_set_cursor (GnomeCanvasItem *item, gpointer id)
func(item, flags, id);
canvas->selection = g_list_prepend(canvas->selection, info);
+ canvas->cursor = info;
}
void
@@ -538,9 +535,19 @@ e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id)
g_return_if_fail(GNOME_IS_CANVAS_ITEM(item));
g_return_if_fail(item->canvas != NULL);
g_return_if_fail(E_IS_CANVAS(item->canvas));
+
+ flags = E_CANVAS_ITEM_SELECTION_SELECT;
+ canvas = E_CANVAS(item->canvas);
+
+ if (canvas->cursor) {
+ func = gtk_object_get_data(GTK_OBJECT(canvas->cursor->item), "ECanvasItem::selection_callback");
+ if (func)
+ func(canvas->cursor->item, flags, canvas->cursor->id);
+ }
+
+ gnome_canvas_item_grab_focus(item);
flags = E_CANVAS_ITEM_SELECTION_SELECT | E_CANVAS_ITEM_SELECTION_CURSOR;
- canvas = E_CANVAS(item->canvas);
info = g_new(ECanvasSelectionInfo, 1);
info->item = item;
@@ -551,6 +558,7 @@ e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id)
func(item, flags, id);
canvas->selection = g_list_prepend(canvas->selection, info);
+ canvas->cursor = info;
}
void
@@ -575,12 +583,17 @@ e_canvas_item_remove_selection (GnomeCanvasItem *item, gpointer id)
if (info->item == item) {
ECanvasItemSelectionCompareFunc compare_func;
compare_func = gtk_object_get_data(GTK_OBJECT(info->item), "ECanvasItem::selection_compare_callback");
+
if (compare_func(info->item, info->id, id, 0) == 0) {
ECanvasItemSelectionFunc func;
func = gtk_object_get_data(GTK_OBJECT(info->item), "ECanvasItem::selection_callback");
if (func)
func(info->item, flags, info->id);
canvas->selection = g_list_remove_link(canvas->selection, list);
+
+ if (canvas->cursor == info)
+ canvas->cursor = NULL;
+
g_free(info);
g_list_free_1(list);
break;
='2015-04-23 06:16:22 +0800'>2015-04-231-2/+2 * Update to new upstream release 2.1.20.Matthias Andree2015-04-103-8/+8 * Add CPE information.Matthias Andree2015-03-101-1/+3 * Remove Author from pkg-descr and white space fixesBaptiste Daroussin2015-03-031-2/+1 * Update to new upstream release 2.1.19.Matthias Andree2015-03-024-8/+18 * Install powerlogo.png in both image locations.Matthias Andree2015-01-176-6/+10 * Update Apache instructions in post-install notes for 2.4 [1], dropping 1.3.Matthias Andree2015-01-092-19/+30 * Repair packaging with non-default MM_USERNAME.Matthias Andree2015-01-091-1/+1 * With CVS gone, use the GIF file directly, ditching the uuencoding.Matthias Andree2015-01-073-122/+1 * Update rcfile and permission handling.Matthias Andree2015-01-075-138/+89 * mail private expect 02770Baptiste Daroussin2014-12-271-1/+1 * The rcfile now runs bin/check_perms so users have a visual clue in caseMatthias Andree2014-12-276-199/+222 * Back out bapt's "cleanup" commit r371953.Matthias Andree2014-12-272-11/+162 * Simplify plistBaptiste Daroussin2014-11-011-161/+10 * Reinstate checksums for optional patches[1], fixing regression from c334818.Matthias Andree2014-09-172-2/+5 * Add OPENSMTPD's user ID [1]. Add warnings about GIDs [2].Matthias Andree2014-08-143-5/+26 * - Switch databases/namazu2 to USES=libtool, drop .la filesDmitry Marakasov2014-07-301-1/+1 * Fix make fetchAntoine Brodin2014-07-301-1/+2 * Convert a bunch of EXTRACT_SUFX=... into USES=tar:...Adam Weinberger2014-07-301-2/+1 * Rename all patches that contain '::' as a path separator, and useAdam Weinberger2014-07-303-0/+0 * Avoid leftovers on pkg_add-based systems by running aMatthias Andree2014-05-163-8/+10 * Upgrade to new upstream bugfix release 2.1.18-1.Matthias Andree2014-05-112-3/+3