aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-09-18 06:39:59 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-09-18 06:39:59 +0800
commitafe6f502c326350cc31d34646d5000a964321525 (patch)
tree9d9469a0ce33428e24e602fdbf87bc496864bc57 /widgets/table
parentb79bf3d187cabd11df74d2e6e414e41ae637f307 (diff)
downloadgsoc2013-evolution-afe6f502c326350cc31d34646d5000a964321525.tar.gz
gsoc2013-evolution-afe6f502c326350cc31d34646d5000a964321525.tar.zst
gsoc2013-evolution-afe6f502c326350cc31d34646d5000a964321525.zip
Use new GDK keysym names if available.
In GTK+ 2.21.8, the keysym names were renamed from GDK_* to GDK_KEY_*. I've added backward-compatibility macors to gtk-compat.h, which can be dumped as soon as we require GTK+ >= 2.22.0.
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-cell-combo.c17
-rw-r--r--widgets/table/e-cell-date-edit.c5
-rw-r--r--widgets/table/e-cell-popup.c5
-rw-r--r--widgets/table/e-cell-text.c9
-rw-r--r--widgets/table/e-cell-toggle.c5
-rw-r--r--widgets/table/e-table-click-to-add.c19
-rw-r--r--widgets/table/e-table-group-container.c29
-rw-r--r--widgets/table/e-table-header-item.c12
-rw-r--r--widgets/table/e-table-item.c77
-rw-r--r--widgets/table/e-table.c31
-rw-r--r--widgets/table/e-tree.c35
-rw-r--r--widgets/table/gal-a11y-e-cell-popup.c5
-rw-r--r--widgets/table/gal-a11y-e-table.c5
-rw-r--r--widgets/table/gal-a11y-e-tree.c5
14 files changed, 148 insertions, 111 deletions
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c
index 186ae4dfed..6e8eb41762 100644
--- a/widgets/table/e-cell-combo.c
+++ b/widgets/table/e-cell-combo.c
@@ -68,6 +68,9 @@
#include "e-cell-combo.h"
#include "e-cell-text.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
#define d(x)
/* The height to make the popup list if there aren't any items in it. */
@@ -628,14 +631,14 @@ e_cell_combo_key_press (GtkWidget *popup_window,
ECellCombo *ecc)
{
/* If the Escape key is pressed we hide the popup. */
- if (event->keyval != GDK_Escape
- && event->keyval != GDK_Return
- && event->keyval != GDK_KP_Enter
- && event->keyval != GDK_ISO_Enter
- && event->keyval != GDK_3270_Enter)
+ if (event->keyval != GDK_KEY_Escape
+ && event->keyval != GDK_KEY_Return
+ && event->keyval != GDK_KEY_KP_Enter
+ && event->keyval != GDK_KEY_ISO_Enter
+ && event->keyval != GDK_KEY_3270_Enter)
return FALSE;
- if (event->keyval == GDK_Escape && (!ecc->popup_window||!gtk_widget_get_visible (ecc->popup_window)))
+ if (event->keyval == GDK_KEY_Escape && (!ecc->popup_window||!gtk_widget_get_visible (ecc->popup_window)))
return FALSE;
gtk_grab_remove (ecc->popup_window);
@@ -646,7 +649,7 @@ e_cell_combo_key_press (GtkWidget *popup_window,
e_cell_popup_set_shown (E_CELL_POPUP (ecc), FALSE);
d(g_print("%s: popup_shown = FALSE\n", __FUNCTION__));
- if (event->keyval != GDK_Escape)
+ if (event->keyval != GDK_KEY_Escape)
e_cell_combo_update_cell (ecc);
e_cell_combo_restart_edit (ecc);
diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c
index 4080172058..73a5d946b2 100644
--- a/widgets/table/e-cell-date-edit.c
+++ b/widgets/table/e-cell-date-edit.c
@@ -48,6 +48,9 @@
/* This depends on ECalendar which is why I didn't put it in gal. */
#include <misc/e-calendar.h>
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
static void e_cell_date_edit_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -726,7 +729,7 @@ e_cell_date_edit_key_press (GtkWidget *popup_window,
ECellDateEdit *ecde)
{
/* If the Escape key is pressed we hide the popup. */
- if (event->keyval != GDK_Escape)
+ if (event->keyval != GDK_KEY_Escape)
return FALSE;
e_cell_date_edit_hide_popup (ecde);
diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c
index e918e7fcc2..5b98a205f2 100644
--- a/widgets/table/e-cell-popup.c
+++ b/widgets/table/e-cell-popup.c
@@ -41,6 +41,9 @@
#include "e-table-item.h"
#include <gtk/gtk.h>
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
#define E_CELL_POPUP_ARROW_WIDTH 16
#define E_CELL_POPUP_ARROW_XPAD 3
#define E_CELL_POPUP_ARROW_YPAD 3
@@ -340,7 +343,7 @@ ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col,
case GDK_KEY_PRESS:
if (e_table_model_is_cell_editable (ecv->e_table_model, model_col, row) &&
event->key.state & GDK_MOD1_MASK
- && event->key.keyval == GDK_Down) {
+ && event->key.keyval == GDK_KEY_Down) {
return e_cell_popup_do_popup (ecp_view, event, row, view_col);
}
break;
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 51188aa101..011e334b21 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -54,11 +54,14 @@
#include "e-util/e-util.h"
#include "misc/e-canvas.h"
#include "e-util/e-unicode.h"
-#include "e-util/gtk-compat.h"
#include "e-table.h"
#include "e-cell-text.h"
#include "e-table-item.h"
+
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
#define d(x)
#define DO_SELECTION 1
#define VIEW_TO_CELL(view) E_CELL_TEXT (((ECellView *)view)->ecell)
@@ -974,7 +977,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col
return 1;
}
- if (event->key.keyval == GDK_Escape) {
+ if (event->key.keyval == GDK_KEY_Escape) {
/* if not changed, then pass this even to parent */
return_val = text_view->edit != NULL && text_view->edit->text && text_view->edit->old_text && 0 != strcmp (text_view->edit->text, text_view->edit->old_text);
ect_cancel_edit (text_view);
@@ -992,7 +995,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col
if (edit_display) {
GdkEventKey key = event->key;
if (key.type == GDK_KEY_PRESS &&
- (key.keyval == GDK_KP_Enter || key.keyval == GDK_Return)) {
+ (key.keyval == GDK_KEY_KP_Enter || key.keyval == GDK_KEY_Return)) {
/* stop editing when it's only GDK_KEY_PRESS event */
e_table_item_leave_edit_ (text_view->cell_view.e_table_item_view);
} else {
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
index 35e06fbe79..2ae69c2ba4 100644
--- a/widgets/table/e-cell-toggle.c
+++ b/widgets/table/e-cell-toggle.c
@@ -38,6 +38,9 @@
#include "e-cell-toggle.h"
#include "e-table-item.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
#define E_CELL_TOGGLE_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_CELL_TOGGLE, ECellTogglePrivate))
@@ -271,7 +274,7 @@ cell_toggle_event (ECellView *ecell_view,
switch (event->type) {
case GDK_KEY_PRESS:
- if (event->key.keyval != GDK_space)
+ if (event->key.keyval != GDK_KEY_space)
return FALSE;
/* Fall through */
case GDK_BUTTON_PRESS:
diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c
index 3d5a374382..ca564cbbcd 100644
--- a/widgets/table/e-table-click-to-add.c
+++ b/widgets/table/e-table-click-to-add.c
@@ -41,6 +41,9 @@
#include "e-table-header.h"
#include "e-table-one.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
enum {
CURSOR_CHANGE,
STYLE_SET,
@@ -330,10 +333,10 @@ item_key_press (ETableItem *item,
ETableClickToAdd *etcta)
{
switch (event->key.keyval) {
- case GDK_Return:
- case GDK_KP_Enter:
- case GDK_ISO_Enter:
- case GDK_3270_Enter:
+ case GDK_KEY_Return:
+ case GDK_KEY_KP_Enter:
+ case GDK_KEY_ISO_Enter:
+ case GDK_KEY_3270_Enter:
finish_editing (etcta);
return TRUE;
}
@@ -436,14 +439,14 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e)
case GDK_KEY_PRESS:
switch (e->key.keyval) {
- case GDK_Tab:
- case GDK_KP_Tab:
- case GDK_ISO_Left_Tab:
+ case GDK_KEY_Tab:
+ case GDK_KEY_KP_Tab:
+ case GDK_KEY_ISO_Left_Tab:
finish_editing (etcta);
break;
default:
return FALSE;
- case GDK_Escape:
+ case GDK_KEY_Escape:
if (etcta->row) {
e_table_item_leave_edit (E_TABLE_ITEM (etcta->row));
etcta_drop_one (etcta);
diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c
index ba6ddf9476..a2b7be785c 100644
--- a/widgets/table/e-table-group-container.c
+++ b/widgets/table/e-table-group-container.c
@@ -39,6 +39,9 @@
#include "e-table-item.h"
#include "e-table-sorting-utils.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
#define TITLE_HEIGHT 16
/* workaround for avoiding API breakage */
@@ -212,37 +215,37 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event)
switch (event->type) {
case GDK_KEY_PRESS:
- if (event->key.keyval == GDK_Tab ||
- event->key.keyval == GDK_KP_Tab ||
- event->key.keyval == GDK_ISO_Left_Tab) {
+ if (event->key.keyval == GDK_KEY_Tab ||
+ event->key.keyval == GDK_KEY_KP_Tab ||
+ event->key.keyval == GDK_KEY_ISO_Left_Tab) {
change_focus = TRUE;
use_col = TRUE;
start_col = (event->key.state & GDK_SHIFT_MASK) ? -1 : 0;
direction = (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START;
- } else if (event->key.keyval == GDK_Left ||
- event->key.keyval == GDK_KP_Left) {
+ } else if (event->key.keyval == GDK_KEY_Left ||
+ event->key.keyval == GDK_KEY_KP_Left) {
change_focus = TRUE;
use_col = TRUE;
start_col = -1;
direction = E_FOCUS_END;
- } else if (event->key.keyval == GDK_Right ||
- event->key.keyval == GDK_KP_Right) {
+ } else if (event->key.keyval == GDK_KEY_Right ||
+ event->key.keyval == GDK_KEY_KP_Right) {
change_focus = TRUE;
use_col = TRUE;
start_col = 0;
direction = E_FOCUS_START;
- } else if (event->key.keyval == GDK_Down ||
- event->key.keyval == GDK_KP_Down) {
+ } else if (event->key.keyval == GDK_KEY_Down ||
+ event->key.keyval == GDK_KEY_KP_Down) {
change_focus = TRUE;
use_col = FALSE;
direction = E_FOCUS_START;
- } else if (event->key.keyval == GDK_Up ||
- event->key.keyval == GDK_KP_Up) {
+ } else if (event->key.keyval == GDK_KEY_Up ||
+ event->key.keyval == GDK_KEY_KP_Up) {
change_focus = TRUE;
use_col = FALSE;
direction = E_FOCUS_END;
- } else if (event->key.keyval == GDK_Return ||
- event->key.keyval == GDK_KP_Enter) {
+ } else if (event->key.keyval == GDK_KEY_Return ||
+ event->key.keyval == GDK_KEY_KP_Enter) {
change_focus = TRUE;
use_col = FALSE;
direction = E_FOCUS_START;
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index 14597c943b..a550bbdda5 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -37,7 +37,6 @@
#include <glib/gi18n.h>
#include "e-util/e-util.h"
#include "e-util/e-xml-utils.h"
-#include "e-util/gtk-compat.h"
#include "misc/e-canvas.h"
#include "misc/e-popup-menu.h"
@@ -56,6 +55,9 @@
#include "arrow-up.xpm"
#include "arrow-down.xpm"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
enum {
BUTTON_PRESSED,
LAST_SIGNAL
@@ -1939,7 +1941,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e)
break;
}
case GDK_KEY_PRESS:
- if ((e->key.keyval == GDK_F10) && (e->key.state & GDK_SHIFT_MASK)) {
+ if ((e->key.keyval == GDK_KEY_F10) && (e->key.state & GDK_SHIFT_MASK)) {
EthiHeaderInfo *info = g_new (EthiHeaderInfo, 1);
ETableCol *ecol;
GtkMenu *popup;
@@ -1962,12 +1964,12 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e)
GTK_MENU (popup),
NULL, NULL, NULL, NULL,
0, GDK_CURRENT_TIME);
- } else if (e->key.keyval == GDK_space) {
+ } else if (e->key.keyval == GDK_KEY_space) {
ETableCol *ecol;
ecol = e_table_header_get_column (ethi->eth, ethi->selected_col);
ethi_change_sort_state (ethi, ecol);
- } else if ((e->key.keyval == GDK_Right) || (e->key.keyval == GDK_KP_Right)) {
+ } else if ((e->key.keyval == GDK_KEY_Right) || (e->key.keyval == GDK_KEY_KP_Right)) {
ETableCol *ecol;
if ((ethi->selected_col < 0) || (ethi->selected_col >= ethi->eth->col_count - 1))
@@ -1976,7 +1978,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e)
ethi->selected_col++;
ecol = e_table_header_get_column (ethi->eth, ethi->selected_col);
ethi_change_sort_state (ethi, ecol);
- } else if ((e->key.keyval == GDK_Left) || (e->key.keyval == GDK_KP_Left)) {
+ } else if ((e->key.keyval == GDK_KEY_Left) || (e->key.keyval == GDK_KEY_KP_Left)) {
ETableCol *ecol;
if ((ethi->selected_col <= 0) || (ethi->selected_col >= ethi->eth->col_count))
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 48c51d8f75..390c207727 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -48,6 +48,9 @@
#include "e-table-item.h"
#include "e-table-subset.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
/* workaround for avoiding API breakage */
#define eti_get_type e_table_item_get_type
G_DEFINE_TYPE (ETableItem, eti, GNOME_TYPE_CANVAS_ITEM)
@@ -2524,8 +2527,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
eti->in_key_press = TRUE;
switch (e->key.keyval) {
- case GDK_Left:
- case GDK_KP_Left:
+ case GDK_KEY_Left:
+ case GDK_KEY_KP_Left:
if (eti_editing (eti)) {
handled = FALSE;
break;
@@ -2540,8 +2543,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
return_val = 1;
break;
- case GDK_Right:
- case GDK_KP_Right:
+ case GDK_KEY_Right:
+ case GDK_KEY_KP_Right:
if (eti_editing (eti)) {
handled = FALSE;
break;
@@ -2556,12 +2559,12 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
return_val = 1;
break;
- case GDK_Up:
- case GDK_KP_Up:
- case GDK_Down:
- case GDK_KP_Down:
+ case GDK_KEY_Up:
+ case GDK_KEY_KP_Up:
+ case GDK_KEY_Down:
+ case GDK_KEY_KP_Down:
if ((e->key.state & GDK_MOD1_MASK)
- && ((e->key.keyval == GDK_Down ) || (e->key.keyval == GDK_KP_Down))) {
+ && ((e->key.keyval == GDK_KEY_Down ) || (e->key.keyval == GDK_KEY_KP_Down))) {
gint view_col = model_to_view_col (eti, cursor_col);
if ((view_col >= 0) && (view_col < eti->cols))
@@ -2570,8 +2573,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
} else
return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
break;
- case GDK_Home:
- case GDK_KP_Home:
+ case GDK_KEY_Home:
+ case GDK_KEY_KP_Home:
if (eti_editing (eti)) {
handled = FALSE;
break;
@@ -2583,8 +2586,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
} else
return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
break;
- case GDK_End:
- case GDK_KP_End:
+ case GDK_KEY_End:
+ case GDK_KEY_KP_End:
if (eti_editing (eti)) {
handled = FALSE;
break;
@@ -2596,9 +2599,9 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
} else
return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
break;
- case GDK_Tab:
- case GDK_KP_Tab:
- case GDK_ISO_Left_Tab:
+ case GDK_KEY_Tab:
+ case GDK_KEY_KP_Tab:
+ case GDK_KEY_ISO_Left_Tab:
if ((e->key.state & GDK_CONTROL_MASK) != 0) {
return_val = FALSE;
break;
@@ -2636,10 +2639,10 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
break;
}
- case GDK_Return:
- case GDK_KP_Enter:
- case GDK_ISO_Enter:
- case GDK_3270_Enter:
+ case GDK_KEY_Return:
+ case GDK_KEY_KP_Enter:
+ case GDK_KEY_ISO_Enter:
+ case GDK_KEY_3270_Enter:
if (eti_editing (eti)) {
ecell_view = eti->cell_views[eti->editing_col];
return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time,
@@ -2661,23 +2664,23 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
if (!handled) {
switch (e->key.keyval) {
- case GDK_Scroll_Lock:
- case GDK_Sys_Req:
- case GDK_Shift_L:
- case GDK_Shift_R:
- case GDK_Control_L:
- case GDK_Control_R:
- case GDK_Caps_Lock:
- case GDK_Shift_Lock:
- case GDK_Meta_L:
- case GDK_Meta_R:
- case GDK_Alt_L:
- case GDK_Alt_R:
- case GDK_Super_L:
- case GDK_Super_R:
- case GDK_Hyper_L:
- case GDK_Hyper_R:
- case GDK_ISO_Lock:
+ case GDK_KEY_Scroll_Lock:
+ case GDK_KEY_Sys_Req:
+ case GDK_KEY_Shift_L:
+ case GDK_KEY_Shift_R:
+ case GDK_KEY_Control_L:
+ case GDK_KEY_Control_R:
+ case GDK_KEY_Caps_Lock:
+ case GDK_KEY_Shift_Lock:
+ case GDK_KEY_Meta_L:
+ case GDK_KEY_Meta_R:
+ case GDK_KEY_Alt_L:
+ case GDK_KEY_Alt_R:
+ case GDK_KEY_Super_L:
+ case GDK_KEY_Super_R:
+ case GDK_KEY_Hyper_L:
+ case GDK_KEY_Hyper_R:
+ case GDK_KEY_ISO_Lock:
break;
default:
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 254ea47046..23640b2d9f 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -53,6 +53,9 @@
#include "e-table-subset.h"
#include "e-table-utils.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
#define COLUMN_HEADER_HEIGHT 16
#define d(x)
@@ -845,8 +848,8 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *
adjustment = gtk_layout_get_vadjustment (layout);
switch (key->keyval) {
- case GDK_Page_Down:
- case GDK_KP_Page_Down:
+ case GDK_KEY_Page_Down:
+ case GDK_KEY_KP_Page_Down:
page_size = gtk_adjustment_get_page_size (adjustment);
upper = gtk_adjustment_get_value (adjustment);
value = gtk_adjustment_get_value (adjustment);
@@ -865,8 +868,8 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *
row_local, col_local, key->state);
return_val = 1;
break;
- case GDK_Page_Up:
- case GDK_KP_Page_Up:
+ case GDK_KEY_Page_Up:
+ case GDK_KEY_KP_Page_Up:
page_size = gtk_adjustment_get_page_size (adjustment);
upper = gtk_adjustment_get_upper (adjustment);
value = gtk_adjustment_get_value (adjustment);
@@ -885,7 +888,7 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *
row_local, col_local, key->state);
return_val = 1;
break;
- case GDK_BackSpace:
+ case GDK_KEY_BackSpace:
init_search (et);
if (e_table_search_backspace (et->search))
return TRUE;
@@ -895,9 +898,9 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *
if ((key->state & ~(GDK_SHIFT_MASK | GDK_LOCK_MASK |
GDK_MOD1_MASK | GDK_MOD2_MASK | GDK_MOD3_MASK |
GDK_MOD4_MASK | GDK_MOD5_MASK)) == 0
- && ((key->keyval >= GDK_a && key->keyval <= GDK_z) ||
- (key->keyval >= GDK_A && key->keyval <= GDK_Z) ||
- (key->keyval >= GDK_0 && key->keyval <= GDK_9)))
+ && ((key->keyval >= GDK_KEY_a && key->keyval <= GDK_KEY_z) ||
+ (key->keyval >= GDK_KEY_A && key->keyval <= GDK_KEY_Z) ||
+ (key->keyval >= GDK_KEY_0 && key->keyval <= GDK_KEY_9)))
e_table_search_input_character (et->search, key->keyval);
g_signal_emit (G_OBJECT (et), et_signals[KEY_PRESS], 0,
row, col, event, &return_val);
@@ -1223,9 +1226,9 @@ canvas_vbox_event (ECanvasVbox *vbox, GdkEventKey *key, ETable *etable)
return FALSE;
}
switch (key->keyval) {
- case GDK_Tab:
- case GDK_KP_Tab:
- case GDK_ISO_Left_Tab:
+ case GDK_KEY_Tab:
+ case GDK_KEY_KP_Tab:
+ case GDK_KEY_ISO_Left_Tab:
if ((key->state & GDK_CONTROL_MASK) && etable->click_to_add) {
gnome_canvas_item_grab_focus (etable->click_to_add);
break;
@@ -1245,9 +1248,9 @@ click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable)
return FALSE;
}
switch (key->keyval) {
- case GDK_Tab:
- case GDK_KP_Tab:
- case GDK_ISO_Left_Tab:
+ case GDK_KEY_Tab:
+ case GDK_KEY_KP_Tab:
+ case GDK_KEY_ISO_Left_Tab:
if (key->state & GDK_CONTROL_MASK) {
if (etable->group) {
if (e_table_model_row_count (etable->model) > 0)
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index be1f8937a6..b85475248a 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -52,6 +52,9 @@
#include "e-tree.h"
#include "e-tree-table-adapter.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
#define COLUMN_HEADER_HEIGHT 16
#define d(x)
@@ -938,8 +941,8 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et)
value = gtk_adjustment_get_value (adjustment);
switch (key->keyval) {
- case GDK_Page_Down:
- case GDK_KP_Page_Down:
+ case GDK_KEY_Page_Down:
+ case GDK_KEY_KP_Page_Down:
y = CLAMP (value + (2 * page_size - 50), 0, upper);
y -= value;
e_tree_get_cell_at (et, 30, y, &row_local, &col_local);
@@ -956,8 +959,8 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et)
return_val = 1;
break;
- case GDK_Page_Up:
- case GDK_KP_Page_Up:
+ case GDK_KEY_Page_Up:
+ case GDK_KEY_KP_Page_Up:
y = CLAMP (value - (page_size - 50), 0, upper);
y -= value;
e_tree_get_cell_at (et, 30, y, &row_local, &col_local);
@@ -974,10 +977,10 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et)
return_val = 1;
break;
- case GDK_plus:
- case GDK_KP_Add:
- case GDK_Right:
- case GDK_KP_Right:
+ case GDK_KEY_plus:
+ case GDK_KEY_KP_Add:
+ case GDK_KEY_Right:
+ case GDK_KEY_KP_Right:
/* Only allow if the Shift modifier is used.
* eg. Ctrl-Equal shouldn't be handled. */
if ((key->state & (GDK_SHIFT_MASK | GDK_LOCK_MASK |
@@ -990,10 +993,10 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et)
}
return_val = 1;
break;
- case GDK_underscore:
- case GDK_KP_Subtract:
- case GDK_Left:
- case GDK_KP_Left:
+ case GDK_KEY_underscore:
+ case GDK_KEY_KP_Subtract:
+ case GDK_KEY_Left:
+ case GDK_KEY_KP_Left:
/* Only allow if the Shift modifier is used.
* eg. Ctrl-Minus shouldn't be handled. */
if ((key->state & (GDK_SHIFT_MASK | GDK_LOCK_MASK |
@@ -1006,7 +1009,7 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et)
}
return_val = 1;
break;
- case GDK_BackSpace:
+ case GDK_KEY_BackSpace:
if (e_table_search_backspace (et->priv->search))
return TRUE;
/* Fallthrough */
@@ -1014,9 +1017,9 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et)
if ((key->state & ~(GDK_SHIFT_MASK | GDK_LOCK_MASK |
GDK_MOD1_MASK | GDK_MOD2_MASK | GDK_MOD3_MASK |
GDK_MOD4_MASK | GDK_MOD5_MASK)) == 0
- && ((key->keyval >= GDK_a && key->keyval <= GDK_z) ||
- (key->keyval >= GDK_A && key->keyval <= GDK_Z) ||
- (key->keyval >= GDK_0 && key->keyval <= GDK_9))) {
+ && ((key->keyval >= GDK_KEY_a && key->keyval <= GDK_KEY_z) ||
+ (key->keyval >= GDK_KEY_A && key->keyval <= GDK_KEY_Z) ||
+ (key->keyval >= GDK_KEY_0 && key->keyval <= GDK_KEY_9))) {
e_table_search_input_character (et->priv->search, key->keyval);
}
path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
diff --git a/widgets/table/gal-a11y-e-cell-popup.c b/widgets/table/gal-a11y-e-cell-popup.c
index 755325d4f3..92ee3a8322 100644
--- a/widgets/table/gal-a11y-e-cell-popup.c
+++ b/widgets/table/gal-a11y-e-cell-popup.c
@@ -32,6 +32,9 @@
#include "gal-a11y-e-cell-popup.h"
#include "gal-a11y-e-cell-registry.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
static AtkObjectClass *parent_class = NULL;
#define PARENT_TYPE (gal_a11y_e_cell_get_type ())
@@ -142,7 +145,7 @@ popup_cell_action (GalA11yECell *cell)
event.key.send_event = TRUE;
event.key.time = GDK_CURRENT_TIME;
event.key.state = GDK_MOD1_MASK;
- event.key.keyval = GDK_Down;
+ event.key.keyval = GDK_KEY_Down;
g_signal_emit_by_name (cell->item, "event", &event, &finished);
}
diff --git a/widgets/table/gal-a11y-e-table.c b/widgets/table/gal-a11y-e-table.c
index 6c68842415..1bf522767b 100644
--- a/widgets/table/gal-a11y-e-table.c
+++ b/widgets/table/gal-a11y-e-table.c
@@ -22,8 +22,6 @@
#include <config.h>
-#include "e-util/gtk-compat.h"
-
#include "a11y/gal-a11y-util.h"
#include "table/e-table.h"
#include "table/e-table-click-to-add.h"
@@ -35,6 +33,9 @@
#include "gal-a11y-e-table-factory.h"
#include "gal-a11y-e-table-item.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETableClass))
static AtkObjectClass *parent_class;
static GType parent_type;
diff --git a/widgets/table/gal-a11y-e-tree.c b/widgets/table/gal-a11y-e-tree.c
index c65ed543c8..87dc8f1618 100644
--- a/widgets/table/gal-a11y-e-tree.c
+++ b/widgets/table/gal-a11y-e-tree.c
@@ -22,8 +22,6 @@
#include <config.h>
-#include "e-util/gtk-compat.h"
-
#include "a11y/gal-a11y-util.h"
#include "table/e-table-item.h"
#include "table/e-tree.h"
@@ -32,6 +30,9 @@
#include "gal-a11y-e-tree.h"
#include "gal-a11y-e-tree-factory.h"
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETreeClass))
static AtkObjectClass *parent_class;
static GType parent_type;