diff options
Diffstat (limited to 'widgets/table/e-table-item.c')
-rw-r--r-- | widgets/table/e-table-item.c | 91 |
1 files changed, 11 insertions, 80 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index dd5a040c1d..21a82f6df3 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -46,7 +46,6 @@ #include "gal/util/e-i18n.h" #include <string.h> #include <stdlib.h> -#include <atk/atk.h> #define PARENT_OBJECT_TYPE gnome_canvas_item_get_type () @@ -75,8 +74,6 @@ enum { KEY_PRESS, START_DRAG, STYLE_SET, - SELECTION_MODEL_REMOVED, - SELECTION_MODEL_ADDED, LAST_SIGNAL }; @@ -262,8 +259,6 @@ eti_get_cell_background_color (ETableItem *eti, int row, int col, gboolean selec if (color_spec != NULL) { if (gdk_color_parse (color_spec, &bg)) { background = gdk_color_copy (&bg); - gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (canvas)), background, - FALSE, TRUE); allocated = TRUE; } } @@ -277,8 +272,7 @@ eti_get_cell_background_color (ETableItem *eti, int row, int col, gboolean selec allocated = TRUE; } e_hsv_tweak (background, 0.0f, 0.0f, -0.07f); - gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (canvas)), background, - FALSE, TRUE); + gdk_color_alloc (gtk_widget_get_colormap (GTK_WIDGET (canvas)), background); } } if (allocatedp) @@ -1317,8 +1311,6 @@ eti_add_selection_model (ETableItem *eti, ESelectionModel *selection) G_CALLBACK (eti_cursor_activated), eti); eti_selection_change(selection, eti); - g_signal_emit_by_name (G_OBJECT(eti), - "selection_model_added", eti->selection); } static void @@ -1464,8 +1456,6 @@ eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe break; case PROP_SELECTION_MODEL: - g_signal_emit_by_name (G_OBJECT(eti), - "selection_model_removed", eti->selection); eti_remove_selection_model (eti); if (g_value_get_object (value)) eti_add_selection_model (eti, E_SELECTION_MODEL(g_value_get_object(value))); @@ -1568,8 +1558,6 @@ eti_init (GnomeCanvasItem *item) { ETableItem *eti = E_TABLE_ITEM (item); - eti->motion_row = -1; - eti->motion_col = -1; eti->editing_col = -1; eti->editing_row = -1; eti->height = 0; @@ -2524,7 +2512,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) break; } case GDK_MOTION_NOTIFY: { - int col, row, flags; + int col, row; double x1, y1; gint cursor_col, cursor_row; @@ -2548,19 +2536,6 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (!find_cell (eti, e->motion.x, e->motion.y, &col, &row, &x1, &y1)) return TRUE; - if (eti->motion_row != -1 && eti->motion_col != -1 && - (row != eti->motion_row || col != eti->motion_col)) { - GdkEvent *cross = gdk_event_new (GDK_LEAVE_NOTIFY); - cross->crossing.time = e->motion.time; - return_val = eti_e_cell_event (eti, eti->cell_views [eti->motion_col], - cross, cross->crossing.time, - view_to_model_col(eti, eti->motion_col), - eti->motion_col, eti->motion_row, 0); - } - - eti->motion_row = row; - eti->motion_col = col; - g_object_get(eti->selection, "cursor_row", &cursor_row, "cursor_col", &cursor_col, @@ -2580,21 +2555,18 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } #endif - flags = 0; if (cursor_row == view_to_model_row(eti, row) && cursor_col == view_to_model_col(eti, col)){ - flags = E_CELL_EDITING | E_CELL_CURSOR; - } - - ecell_view = eti->cell_views [col]; + ecell_view = eti->cell_views [col]; - /* - * Adjust the event positions - */ - e->motion.x = x1; - e->motion.y = y1; + /* + * Adjust the event positions + */ + e->motion.x = x1; + e->motion.y = y1; - return_val = eti_e_cell_event (eti, ecell_view, e, e->motion.time, - view_to_model_col(eti, col), col, row, flags); + return_val = eti_e_cell_event (eti, ecell_view, e, e->motion.time, + view_to_model_col(eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR); + } break; } @@ -2653,12 +2625,6 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_KP_Up: case GDK_Down: case GDK_KP_Down: - if ((e->key.state & GDK_MOD1_MASK) - && ((e->key.keyval == GDK_Down ) || (e->key.keyval == GDK_KP_Down))) { - gint view_col = model_to_view_col(eti, cursor_col); - if (eti_e_cell_event (eti, eti->cell_views [view_col], e, ((GdkEventKey *)e)->time, cursor_col, view_col, model_to_view_row(eti, cursor_row), E_CELL_CURSOR)) - return TRUE; - } else return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; case GDK_Home: @@ -2815,14 +2781,6 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (eti->tooltip->timer) gtk_timeout_remove (eti->tooltip->timer); eti->tooltip->timer = 0; - if (eti->motion_row != -1 && eti->motion_col != -1) - return_val = eti_e_cell_event (eti, eti->cell_views [eti->motion_col], - e, e->crossing.time, - view_to_model_col(eti, eti->motion_col), - eti->motion_col, eti->motion_row, 0); - eti->motion_row = -1; - eti->motion_col = -1; - break; case GDK_FOCUS_CHANGE: @@ -2909,8 +2867,6 @@ eti_class_init (GObjectClass *object_class) eti_class->key_press = NULL; eti_class->start_drag = NULL; eti_class->style_set = eti_style_set; - eti_class->selection_model_removed = NULL; - eti_class->selection_model_added = NULL; g_object_class_install_property (object_class, PROP_TABLE_HEADER, g_param_spec_object ("ETableHeader", @@ -3085,31 +3041,6 @@ eti_class_init (GObjectClass *object_class) NULL, NULL, e_marshal_NONE__OBJECT, G_TYPE_NONE, 1, GTK_TYPE_STYLE); - - eti_signals[SELECTION_MODEL_REMOVED] = - g_signal_new ("selection_model_removed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (ETableItemClass, selection_model_removed), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, - G_TYPE_POINTER); - - eti_signals[SELECTION_MODEL_ADDED] = - g_signal_new ("selection_model_added", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (ETableItemClass, selection_model_added), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, - G_TYPE_POINTER); - - atk_registry_set_factory_type (atk_get_default_registry (), - E_TABLE_ITEM_TYPE, - gal_a11y_e_table_item_factory_get_type ()); - } E_MAKE_TYPE (e_table_item, |