[libgda/gtk3] Adaptations to GDK_KEY changes



commit 295302570d4ea235148e401eec6b19219369840d
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sun Sep 12 15:21:40 2010 +0200

    Adaptations to GDK_KEY changes

 libgda-ui/data-entries/gdaui-entry-common-time.c   |    4 +-
 libgda-ui/data-entries/gdaui-entry-number.c        |    2 +-
 libgda-ui/data-entries/gdaui-entry-shell.c         |    4 +-
 libgda-ui/data-entries/gdaui-entry-string.c        |    2 +-
 libgda-ui/gdaui-cloud.c                            |   24 ++++++------
 libgda-ui/gdaui-raw-form.c                         |    8 ++--
 libgda-ui/gdaui-raw-grid.c                         |   12 +++---
 libgda-ui/internal/popup-container.c               |    2 +-
 tests/parser/Makefile.am                           |    2 +-
 tools/browser/browser-window.c                     |    2 +-
 tools/browser/canvas/browser-canvas-db-relations.c |    2 +-
 tools/browser/canvas/browser-canvas-table.c        |    2 +-
 tools/browser/canvas/browser-canvas-text.c         |    2 +-
 tools/browser/canvas/browser-canvas-utility.c      |   18 +++++-----
 tools/browser/canvas/browser-canvas.c              |    2 +-
 tools/browser/common/objects-cloud.c               |    4 +-
 tools/browser/data-manager/data-console.c          |    2 +-
 .../browser/data-manager/data-favorite-selector.c  |    2 +-
 tools/browser/query-exec/query-editor.c            |   37 +++++++++-----------
 tools/browser/query-exec/query-favorite-selector.c |    2 +-
 tools/browser/schema-browser/favorite-selector.c   |    2 +-
 tools/browser/schema-browser/table-columns.c       |    4 +-
 22 files changed, 69 insertions(+), 72 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry-common-time.c b/libgda-ui/data-entries/gdaui-entry-common-time.c
index c3227b0..0ec93cf 100644
--- a/libgda-ui/data-entries/gdaui-entry-common-time.c
+++ b/libgda-ui/data-entries/gdaui-entry-common-time.c
@@ -155,7 +155,7 @@ gdaui_entry_common_time_class_init (GdauiEntryCommonTimeClass * class)
 static gboolean
 key_press_event_cb (GdauiEntryCommonTime *mgtim, GdkEventKey *key_event, gpointer data)
 {
-	if (key_event->keyval == GDK_Escape)
+	if (key_event->keyval == GDK_KEY_Escape)
 		mgtim->priv->editing_canceled = TRUE;
 	return FALSE;
 }
@@ -769,7 +769,7 @@ date_delete_popup (GtkWidget *widget, GdauiEntryCommonTime *mgtim)
 static gint
 date_key_press_popup (GtkWidget *widget, GdkEventKey *event, GdauiEntryCommonTime *mgtim)
 {
-	if (event->keyval != GDK_Escape)
+	if (event->keyval != GDK_KEY_Escape)
                 return FALSE;
 
         g_signal_stop_emission_by_name (widget, "key-press-event");
diff --git a/libgda-ui/data-entries/gdaui-entry-number.c b/libgda-ui/data-entries/gdaui-entry-number.c
index f710ffc..d731ac1 100644
--- a/libgda-ui/data-entries/gdaui-entry-number.c
+++ b/libgda-ui/data-entries/gdaui-entry-number.c
@@ -149,7 +149,7 @@ gdaui_entry_number_class_init (GdauiEntryNumberClass * klass)
 static gboolean
 key_press_event_cb (GdauiEntryNumber *mgstr, GdkEventKey *key_event, gpointer data)
 {
-	if (key_event->keyval == GDK_Escape)
+	if (key_event->keyval == GDK_KEY_Escape)
 		mgstr->priv->editing_canceled = TRUE;
 	return FALSE;
 }
diff --git a/libgda-ui/data-entries/gdaui-entry-shell.c b/libgda-ui/data-entries/gdaui-entry-shell.c
index 59394d5..5bac35c 100644
--- a/libgda-ui/data-entries/gdaui-entry-shell.c
+++ b/libgda-ui/data-entries/gdaui-entry-shell.c
@@ -345,7 +345,7 @@ event_cb (GtkWidget *widget, GdkEvent *event, GdauiEntryShell *shell)
 		GtkWidget *menu;
 		GdkEventKey *kevent = (GdkEventKey *) event;
 
-		if (kevent->keyval == GDK_space) {
+		if (kevent->keyval == GDK_KEY_space) {
 			guint attributes;
 
 			attributes = gdaui_entry_shell_refresh_attributes (shell);
@@ -357,7 +357,7 @@ event_cb (GtkWidget *widget, GdkEvent *event, GdauiEntryShell *shell)
 			done = TRUE;
 		}
 		else {
-			if (kevent->keyval == GDK_Tab)
+			if (kevent->keyval == GDK_KEY_Tab)
 				done = FALSE;
 			else
 				done = TRUE;
diff --git a/libgda-ui/data-entries/gdaui-entry-string.c b/libgda-ui/data-entries/gdaui-entry-string.c
index b02a675..4287c01 100644
--- a/libgda-ui/data-entries/gdaui-entry-string.c
+++ b/libgda-ui/data-entries/gdaui-entry-string.c
@@ -162,7 +162,7 @@ gdaui_entry_string_class_init (GdauiEntryStringClass * klass)
 static gboolean
 key_press_event_cb (GdauiEntryString *mgstr, GdkEventKey *key_event, gpointer data)
 {
-	if (key_event->keyval == GDK_Escape)
+	if (key_event->keyval == GDK_KEY_Escape)
 		mgstr->priv->editing_canceled = TRUE;
 	return FALSE;
 }
diff --git a/libgda-ui/gdaui-cloud.c b/libgda-ui/gdaui-cloud.c
index d38c21f..374e15b 100644
--- a/libgda-ui/gdaui-cloud.c
+++ b/libgda-ui/gdaui-cloud.c
@@ -827,18 +827,18 @@ key_press_event (GtkWidget *text_view, GdkEventKey *event, GdauiCloud *cloud)
         GtkTextBuffer *buffer;
 
         switch (event->keyval) {
-        case GDK_Return:
-        case GDK_space:
-        case GDK_KP_Enter:
+        case GDK_KEY_Return:
+        case GDK_KEY_space:
+        case GDK_KEY_KP_Enter:
                 buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
                 gtk_text_buffer_get_iter_at_mark (buffer, &iter,
                                                   gtk_text_buffer_get_insert (buffer));
                 follow_if_link (text_view, &iter, cloud);
 		return TRUE;
-	case GDK_Up:
-	case GDK_Down:
-	case GDK_Left:
-	case GDK_Right:
+	case GDK_KEY_Up:
+	case GDK_KEY_Down:
+	case GDK_KEY_Left:
+	case GDK_KEY_Right:
 		if ((cloud->priv->selection_mode == GTK_SELECTION_SINGLE) ||
 		    (cloud->priv->selection_mode == GTK_SELECTION_BROWSE)) {
 			GtkTextIter iter;
@@ -847,7 +847,7 @@ key_press_event (GtkWidget *text_view, GdkEventKey *event, GdauiCloud *cloud)
 				mark = gtk_text_buffer_get_insert (cloud->priv->tbuffer);
 				gtk_text_buffer_get_iter_at_mark (cloud->priv->tbuffer, &iter, mark);
 			}
-			else if ((event->keyval == GDK_Right) || (event->keyval == GDK_Down))
+			else if ((event->keyval == GDK_KEY_Right) || (event->keyval == GDK_KEY_Down))
 				gtk_text_buffer_get_start_iter (cloud->priv->tbuffer, &iter);
 			else
 				gtk_text_buffer_get_end_iter (cloud->priv->tbuffer, &iter);
@@ -858,22 +858,22 @@ key_press_event (GtkWidget *text_view, GdkEventKey *event, GdauiCloud *cloud)
 				GtkMovementStep mvt_type;
 				gint mvt_amount;
 				switch (event->keyval) {
-				case GDK_Up:
+				case GDK_KEY_Up:
 					done = ! gtk_text_view_backward_display_line ((GtkTextView*)cloud->priv->tview, &iter);
 					mvt_type = GTK_MOVEMENT_DISPLAY_LINES;
 					mvt_amount = -1;
 					break;
-				case GDK_Down:
+				case GDK_KEY_Down:
 					done = ! gtk_text_view_forward_display_line ((GtkTextView*)cloud->priv->tview, &iter);
 					mvt_type = GTK_MOVEMENT_DISPLAY_LINES;
 					mvt_amount = 1;
 					break;
-				case GDK_Left:
+				case GDK_KEY_Left:
 					done = ! gtk_text_iter_backward_char (&iter);
 					mvt_type = GTK_MOVEMENT_VISUAL_POSITIONS;
 					mvt_amount = -1;
 					break;
-				case GDK_Right:
+				case GDK_KEY_Right:
 					done = ! gtk_text_iter_forward_char (&iter);
 					mvt_type = GTK_MOVEMENT_VISUAL_POSITIONS;
 					mvt_amount = 1;
diff --git a/libgda-ui/gdaui-raw-form.c b/libgda-ui/gdaui-raw-form.c
index 9da9905..ce7b770 100644
--- a/libgda-ui/gdaui-raw-form.c
+++ b/libgda-ui/gdaui-raw-form.c
@@ -758,10 +758,10 @@ filter_event (GtkWidget *widget, GdkEventAny *event, GdauiRawForm *form)
 static gboolean
 key_press_filter_event (GtkWidget *widget, GdkEventKey *event, GdauiRawForm *form)
 {
-	if (event->keyval == GDK_Escape ||
-	    event->keyval == GDK_Tab ||
-            event->keyval == GDK_KP_Tab ||
-            event->keyval == GDK_ISO_Left_Tab) {
+	if (event->keyval == GDK_KEY_Escape ||
+	    event->keyval == GDK_KEY_Tab ||
+            event->keyval == GDK_KEY_KP_Tab ||
+            event->keyval == GDK_KEY_ISO_Left_Tab) {
 		hide_filter_window (form);
 		return TRUE;
 	}
diff --git a/libgda-ui/gdaui-raw-grid.c b/libgda-ui/gdaui-raw-grid.c
index 0d110c5..dc29684 100644
--- a/libgda-ui/gdaui-raw-grid.c
+++ b/libgda-ui/gdaui-raw-grid.c
@@ -1479,10 +1479,10 @@ filter_event (GtkWidget *widget, GdkEventAny *event, GdauiRawGrid *grid)
 static gboolean
 key_press_filter_event (GtkWidget *widget, GdkEventKey *event, GdauiRawGrid *grid)
 {
-	if (event->keyval == GDK_Escape ||
-	    event->keyval == GDK_Tab ||
-            event->keyval == GDK_KP_Tab ||
-            event->keyval == GDK_ISO_Left_Tab) {
+	if (event->keyval == GDK_KEY_Escape ||
+	    event->keyval == GDK_KEY_Tab ||
+            event->keyval == GDK_KEY_KP_Tab ||
+            event->keyval == GDK_KEY_ISO_Left_Tab) {
 		hide_filter_window (grid);
 		return TRUE;
 	}
@@ -1627,7 +1627,7 @@ tree_view_event_cb (GtkWidget *treeview, GdkEvent *event, GdauiRawGrid *grid)
 		guint modifiers = gtk_accelerator_get_default_mod_mask ();
 
 		/* Tab to move one column left or right */
-		if (ekey->keyval == GDK_Tab) {
+		if (ekey->keyval == GDK_KEY_Tab) {
 			GtkTreeViewColumn *column;
 			GtkTreePath *path;
 
@@ -1662,7 +1662,7 @@ tree_view_event_cb (GtkWidget *treeview, GdkEvent *event, GdauiRawGrid *grid)
 		}
 
 		/* DELETE to delete the selected row */
-		if (ekey->keyval == GDK_Delete) {
+		if (ekey->keyval == GDK_KEY_Delete) {
 			GtkTreeIter iter;
 			GtkTreeSelection *selection;
 			GtkTreeModel *model;
diff --git a/libgda-ui/internal/popup-container.c b/libgda-ui/internal/popup-container.c
index 7bb2609..1e55a79 100644
--- a/libgda-ui/internal/popup-container.c
+++ b/libgda-ui/internal/popup-container.c
@@ -66,7 +66,7 @@ delete_popup (GtkWidget *widget, PopupContainer *container)
 static gboolean
 key_press_popup (GtkWidget *widget, GdkEventKey *event, PopupContainer *container)
 {
-        if (event->keyval != GDK_Escape)
+        if (event->keyval != GDK_KEY_Escape)
                 return FALSE;
 
         g_signal_stop_emission_by_name (widget, "key-press-event");
diff --git a/tests/parser/Makefile.am b/tests/parser/Makefile.am
index da4fcad..75b233d 100644
--- a/tests/parser/Makefile.am
+++ b/tests/parser/Makefile.am
@@ -37,7 +37,7 @@ check_script_LDADD = \
 
 check_rewrite_for_default_SOURCES = check_rewrite_for_default.c
 check_rewrite_for_default_LDADD = \
-	$(top_builddir)/libgda/libgda-4.0.la \
+	$(top_builddir)/libgda/libgda-5.0.la \
 	$(LIBGDA_LIBS)
 
 
diff --git a/tools/browser/browser-window.c b/tools/browser/browser-window.c
index 7f15a7a..1017461 100644
--- a/tools/browser/browser-window.c
+++ b/tools/browser/browser-window.c
@@ -1038,7 +1038,7 @@ window_fullscreen_cb (GtkToggleAction *action, BrowserWindow *bwin)
 static gboolean
 key_press_event (GtkWidget *widget, GdkEventKey *event)
 {
-	if ((event->keyval == GDK_Escape) &&
+	if ((event->keyval == GDK_KEY_Escape) &&
 	    browser_window_is_fullscreen (BROWSER_WINDOW (widget))) {
 		browser_window_set_fullscreen (BROWSER_WINDOW (widget), FALSE);
 		return TRUE;
diff --git a/tools/browser/canvas/browser-canvas-db-relations.c b/tools/browser/canvas/browser-canvas-db-relations.c
index 7a62669..333d4c2 100644
--- a/tools/browser/canvas/browser-canvas-db-relations.c
+++ b/tools/browser/canvas/browser-canvas-db-relations.c
@@ -524,7 +524,7 @@ popup_add_table_cb (GtkMenuItem *mitem, BrowserCanvasDbRelations *dbrels)
 		GtkWidget *vbox, *cloud, *find, *dcontents;
 		dbrels->priv->add_dialog = gtk_dialog_new_with_buttons (_("Select tables to add to diagram"),
 									(GtkWindow*) gtk_widget_get_toplevel ((GtkWidget*) dbrels),
-									GTK_DIALOG_NO_SEPARATOR,
+									0,
 									NULL);
 		g_signal_connect (dbrels->priv->add_dialog, "close",
 				  G_CALLBACK (gtk_widget_hide), NULL);
diff --git a/tools/browser/canvas/browser-canvas-table.c b/tools/browser/canvas/browser-canvas-table.c
index 46538e5..9ace70c 100644
--- a/tools/browser/canvas/browser-canvas-table.c
+++ b/tools/browser/canvas/browser-canvas-table.c
@@ -311,7 +311,7 @@ create_items (BrowserCanvasTable *ce)
 	y = RADIUS_Y;
         title = goo_canvas_text_new  (GOO_CANVAS_ITEM (ce), tmpstr,
 				      RADIUS_X + X_PAD, y, 
-				      -1, GTK_ANCHOR_NORTH_WEST,
+				      -1, GOO_CANVAS_ANCHOR_NORTH_WEST,
 				      "font", "Sans 11",
 				      "use-markup", TRUE, NULL);
 
diff --git a/tools/browser/canvas/browser-canvas-text.c b/tools/browser/canvas/browser-canvas-text.c
index 9e5dbba..2217338 100644
--- a/tools/browser/canvas/browser-canvas-text.c
+++ b/tools/browser/canvas/browser-canvas-text.c
@@ -342,7 +342,7 @@ create_items (BrowserCanvasText *ct)
 	/* text: text's name */
 	text = goo_canvas_text_new (GOO_CANVAS_ITEM (ct), ct->priv->text,
 				    0., 0.,
-				    -1, GTK_ANCHOR_NORTH_WEST, 
+				    -1, GOO_CANVAS_ANCHOR_NORTH_WEST, 
 				    "fill_color", "black",
 				    "font", BROWSER_CANVAS_FONT,
 				    "alignment", PANGO_ALIGN_RIGHT, 
diff --git a/tools/browser/canvas/browser-canvas-utility.c b/tools/browser/canvas/browser-canvas-utility.c
index bead0fa..7a5cf8b 100644
--- a/tools/browser/canvas/browser-canvas-utility.c
+++ b/tools/browser/canvas/browser-canvas-utility.c
@@ -26,7 +26,7 @@ static gboolean compute_intersect_rect_line (gdouble rectx1, gdouble recty1, gdo
 					     gdouble *R1x, gdouble *R1y, gdouble *R2x, gdouble *R2y);
 
 static void     compute_text_marks_offsets (gdouble x1, gdouble y1, gdouble x2, gdouble y2,
-					    gdouble *xoff, gdouble *yoff, GtkAnchorType *anchor_type);
+					    gdouble *xoff, gdouble *yoff, GooCanvasAnchorType *anchor_type);
 
 static GSList *browser_canvas_util_compute_handle_shapes  (GooCanvasItem *parent, GSList *shapes, gint index,
 							 gdouble x1, gdouble y1, gdouble x2, gdouble y2);
@@ -172,7 +172,7 @@ browser_canvas_util_compute_anchor_shapes (GooCanvasItem *parent, GSList *shapes
 					item = goo_canvas_text_new (parent, "*", 
 								    points->coords[2] + 5.,
 								    points->coords[3] - 5., -1,
-								    GTK_ANCHOR_SOUTH, NULL);
+								    GOO_CANVAS_ANCHOR_SOUTH, NULL);
 					retval = browser_canvas_canvas_shape_add_to_list (retval, id, item);
 				}
 			}
@@ -190,7 +190,7 @@ browser_canvas_util_compute_anchor_shapes (GooCanvasItem *parent, GSList *shapes
 					item = goo_canvas_text_new (parent, "*", 
 								    points->coords[4] + 5.,
 								    points->coords[5] + 5., -1,
-								    GTK_ANCHOR_NORTH, NULL);
+								    GOO_CANVAS_ANCHOR_NORTH, NULL);
 					retval = browser_canvas_canvas_shape_add_to_list (retval, id, item);
 				}
 			}
@@ -295,7 +295,7 @@ browser_canvas_util_compute_anchor_shapes (GooCanvasItem *parent, GSList *shapes
 			/* extension marks as text */
 			if (ext & CANVAS_SHAPE_EXT_JOIN_OUTER_1) {
 				gdouble mxoff = 0., myoff = 0.;
-				GtkAnchorType atype;
+				GooCanvasAnchorType atype;
 
 				compute_text_marks_offsets (points->coords[0], points->coords[1], 
 							    points->coords[2], points->coords[3],
@@ -321,7 +321,7 @@ browser_canvas_util_compute_anchor_shapes (GooCanvasItem *parent, GSList *shapes
 
 			if (ext & CANVAS_SHAPE_EXT_JOIN_OUTER_2) {
 				gdouble mxoff, myoff;
-				GtkAnchorType atype;
+				GooCanvasAnchorType atype;
 				
 				compute_text_marks_offsets (points->coords[2], points->coords[3], 
 							    points->coords[0], points->coords[1],
@@ -365,10 +365,10 @@ browser_canvas_util_compute_anchor_shapes (GooCanvasItem *parent, GSList *shapes
  */
 static void
 compute_text_marks_offsets (gdouble x1, gdouble y1, gdouble x2, gdouble y2,
-			    gdouble *xoff, gdouble *yoff, GtkAnchorType *anchor_type)
+			    gdouble *xoff, gdouble *yoff, GooCanvasAnchorType *anchor_type)
 {
 	gdouble mxoff, myoff;
-	GtkAnchorType atype = GTK_ANCHOR_CENTER; /* FIXME */
+	GooCanvasAnchorType atype = GOO_CANVAS_ANCHOR_CENTER; /* FIXME */
 	gdouble sint, cost;
 	gdouble sina = 0.5;
 	gdouble cosa = 0.866025; /* sqrt(3)/2 */
@@ -620,7 +620,7 @@ browser_canvas_util_compute_connect_shapes (GooCanvasItem *parent, GSList *shape
 	/* extension marks as text */
 	if (ext & CANVAS_SHAPE_EXT_JOIN_OUTER_1) {
 		gdouble mxoff = 0., myoff = 0.;
-		GtkAnchorType atype;
+		GooCanvasAnchorType atype;
 		
 		compute_text_marks_offsets (points->coords[4], points->coords[5], 
 					    points->coords[2], points->coords[3],
@@ -647,7 +647,7 @@ browser_canvas_util_compute_connect_shapes (GooCanvasItem *parent, GSList *shape
 	
 	if (ext & CANVAS_SHAPE_EXT_JOIN_OUTER_2) {
 		gdouble mxoff, myoff;
-		GtkAnchorType atype;
+		GooCanvasAnchorType atype;
 		
 		compute_text_marks_offsets (points->coords[2], points->coords[3], 
 					    points->coords[4], points->coords[5],
diff --git a/tools/browser/canvas/browser-canvas.c b/tools/browser/canvas/browser-canvas.c
index 5c7019a..e396c80 100644
--- a/tools/browser/canvas/browser-canvas.c
+++ b/tools/browser/canvas/browser-canvas.c
@@ -172,7 +172,7 @@ browser_canvas_init (BrowserCanvas *canvas)
 		      "automatic-bounds", TRUE,
 		      "bounds-padding", 5., 
 		      "bounds-from-origin", FALSE, 
-		      "anchor", GTK_ANCHOR_CENTER, NULL);
+		      "anchor", GOO_CANVAS_ANCHOR_CENTER, NULL);
 
 	/* reseting the zoom */
 	goo_canvas_set_scale (canvas->priv->goocanvas, DEFAULT_SCALE);
diff --git a/tools/browser/common/objects-cloud.c b/tools/browser/common/objects-cloud.c
index a5b6e47..c353084 100644
--- a/tools/browser/common/objects-cloud.c
+++ b/tools/browser/common/objects-cloud.c
@@ -644,8 +644,8 @@ key_press_event (GtkWidget *text_view, GdkEventKey *event, ObjectsCloud *cloud)
 	GtkTextBuffer *buffer;
 	
 	switch (event->keyval) {
-	case GDK_Return: 
-	case GDK_KP_Enter:
+	case GDK_KEY_Return: 
+	case GDK_KEY_KP_Enter:
 		buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
 		gtk_text_buffer_get_iter_at_mark (buffer, &iter, 
 						  gtk_text_buffer_get_insert (buffer));
diff --git a/tools/browser/data-manager/data-console.c b/tools/browser/data-manager/data-console.c
index b930b8c..57a090d 100644
--- a/tools/browser/data-manager/data-console.c
+++ b/tools/browser/data-manager/data-console.c
@@ -146,7 +146,7 @@ key_press_event (GtkWidget *widget, GdkEventKey *event)
 {
 	DataConsole *dconsole;
 	dconsole = DATA_CONSOLE (widget);
-	if ((event->keyval == GDK_Escape) &&
+	if ((event->keyval == GDK_KEY_Escape) &&
 	    (gtk_notebook_get_current_page (GTK_NOTEBOOK (dconsole->priv->main_notebook)) == MAIN_PAGE_DATA)) {
 		if (dconsole->priv->agroup) {
 			GtkAction *action;
diff --git a/tools/browser/data-manager/data-favorite-selector.c b/tools/browser/data-manager/data-favorite-selector.c
index b533397..2c96e88 100644
--- a/tools/browser/data-manager/data-favorite-selector.c
+++ b/tools/browser/data-manager/data-favorite-selector.c
@@ -180,7 +180,7 @@ data_favorite_selector_get_type (void)
 static gboolean
 key_press_event_cb (GtkTreeView *treeview, GdkEventKey *event, DataFavoriteSelector *tsel)
 {
-	if (event->keyval == GDK_Delete) {
+	if (event->keyval == GDK_KEY_Delete) {
 		GtkTreeModel *model;
 		GtkTreeSelection *select;
 		GtkTreeIter iter;
diff --git a/tools/browser/query-exec/query-editor.c b/tools/browser/query-exec/query-editor.c
index 9518b6c..7f78e82 100644
--- a/tools/browser/query-exec/query-editor.c
+++ b/tools/browser/query-exec/query-editor.c
@@ -490,10 +490,10 @@ event (GtkWidget *text_view, GdkEvent *ev, QueryEditor *editor)
 	else if (ev->type == GDK_KEY_PRESS) {
 		GdkEventKey *evkey = ((GdkEventKey*) ev);
 		if ((editor->priv->mode == QUERY_EDITOR_HISTORY) &&
-		    ((evkey->keyval == GDK_Up) || (evkey->keyval == GDK_Down))) {
+		    ((evkey->keyval == GDK_KEY_Up) || (evkey->keyval == GDK_KEY_Down))) {
 			HistItemData *nfocus = NULL;
 			if (editor->priv->hist_focus) {
-				if (((GdkEventKey*) ev)->keyval == GDK_Up)
+				if (((GdkEventKey*) ev)->keyval == GDK_KEY_Up)
 					nfocus = get_prev_hist_data (editor, editor->priv->hist_focus);
 				else
 					nfocus = get_next_hist_data (editor, editor->priv->hist_focus);
@@ -505,7 +505,7 @@ event (GtkWidget *text_view, GdkEvent *ev, QueryEditor *editor)
 			return TRUE;
 		}
 		else if ((editor->priv->mode == QUERY_EDITOR_HISTORY) &&
-			 ((evkey->keyval == GDK_Delete) && editor->priv->hist_focus)) {
+			 ((evkey->keyval == GDK_KEY_Delete) && editor->priv->hist_focus)) {
 			if (editor->priv->hist_focus->item)
 				query_editor_del_current_history_item (editor);
 			else if (editor->priv->hist_focus->batch)
@@ -514,7 +514,7 @@ event (GtkWidget *text_view, GdkEvent *ev, QueryEditor *editor)
 		}
 		else if ((editor->priv->mode == QUERY_EDITOR_READWRITE) && 
 			 (evkey->state & GDK_CONTROL_MASK) &&
-			 ((evkey->keyval == GDK_L) || (evkey->keyval == GDK_l))) {
+			 ((evkey->keyval == GDK_KEY_L) || (evkey->keyval == GDK_KEY_l))) {
 			GtkTextIter start, end;
 			gtk_text_buffer_get_start_iter (buffer, &start);
 			gtk_text_buffer_get_end_iter (buffer, &end);
@@ -523,13 +523,13 @@ event (GtkWidget *text_view, GdkEvent *ev, QueryEditor *editor)
 		}
 		else if ((editor->priv->mode == QUERY_EDITOR_READWRITE) && 
 			 (evkey->state & GDK_CONTROL_MASK) &&
-			 (evkey->keyval == GDK_Return)) {
+			 (evkey->keyval == GDK_KEY_Return)) {
 			g_signal_emit (editor, query_editor_signals[EXECUTE_REQUEST], 0);
 			return TRUE;
 		}
 		else if ((editor->priv->mode == QUERY_EDITOR_READWRITE) && 
 			 (evkey->state & GDK_CONTROL_MASK) &&
-			 (evkey->keyval == GDK_Up) &&
+			 (evkey->keyval == GDK_KEY_Up) &&
 			 editor->priv->states) {
 			if (editor->priv->states->len > 0) {
 				gint i = -1;
@@ -560,7 +560,7 @@ event (GtkWidget *text_view, GdkEvent *ev, QueryEditor *editor)
 		}
 		else if ((editor->priv->mode == QUERY_EDITOR_READWRITE) && 
 			 (evkey->state & GDK_CONTROL_MASK) &&
-			 (evkey->keyval == GDK_Down) &&
+			 (evkey->keyval == GDK_KEY_Down) &&
 			 editor->priv->states) {
 			if (editor->priv->states->len > 0) {
 				if (editor->priv->current_state < editor->priv->states->len - 1) {
@@ -580,7 +580,7 @@ event (GtkWidget *text_view, GdkEvent *ev, QueryEditor *editor)
 		}
 		else if ((editor->priv->mode == QUERY_EDITOR_READWRITE) && 
 			 (evkey->state & GDK_CONTROL_MASK) &&
-			 (evkey->keyval == GDK_space)) {
+			 (evkey->keyval == GDK_KEY_space)) {
 			display_completions (editor);
 			return TRUE;
 		}
@@ -608,7 +608,6 @@ text_view_expose_event (GtkTextView *tv, GdkEventExpose *event, QueryEditor *edi
 	gint y, ye;
 	gint height, heighte;
 	gint win_y;
-	GdkGC *gc;
 	gint margin;
 	GtkTextBuffer *tbuffer;
 	
@@ -649,18 +648,16 @@ text_view_expose_event (GtkTextView *tv, GdkEventExpose *event, QueryEditor *edi
 	redraw_rect.width = visible_rect.width;
 	redraw_rect.height = visible_rect.height;
 	
-	GtkStateType state;
-	state = gtk_widget_get_state (GTK_WIDGET (tv));
-	gc = gtk_widget_get_style (GTK_WIDGET (tv))->bg_gc[state];
+	cairo_t *cr = gdk_cairo_create (GDK_DRAWABLE (win));
+	GdkRectangle rect;
 	margin = gtk_text_view_get_left_margin (tv);
-	
-	gdk_draw_rectangle (event->window,
-			    gc,
-			    TRUE,
-			    redraw_rect.x + MAX (0, margin - 1),
-			    win_y,
-			    redraw_rect.width,
-			    height);
+	rect.x = redraw_rect.x + MAX (0, margin - 1);
+	rect.y = win_y;
+	rect.width = redraw_rect.width;
+	rect.height = height;
+	gdk_cairo_rectangle (cr, &rect);
+	cairo_fill (cr);
+	cairo_destroy (cr);
 
 	return FALSE;
 }
diff --git a/tools/browser/query-exec/query-favorite-selector.c b/tools/browser/query-exec/query-favorite-selector.c
index 7c04e35..6622a4d 100644
--- a/tools/browser/query-exec/query-favorite-selector.c
+++ b/tools/browser/query-exec/query-favorite-selector.c
@@ -170,7 +170,7 @@ query_favorite_selector_get_type (void)
 static gboolean
 key_press_event_cb (GtkTreeView *treeview, GdkEventKey *event, QueryFavoriteSelector *tsel)
 {
-	if (event->keyval == GDK_Delete) {
+	if (event->keyval == GDK_KEY_Delete) {
 		GtkTreeModel *model;
 		GtkTreeSelection *select;
 		GtkTreeIter iter;
diff --git a/tools/browser/schema-browser/favorite-selector.c b/tools/browser/schema-browser/favorite-selector.c
index d162814..2674033 100644
--- a/tools/browser/schema-browser/favorite-selector.c
+++ b/tools/browser/schema-browser/favorite-selector.c
@@ -149,7 +149,7 @@ favorite_selector_get_type (void)
 static gboolean
 key_press_event_cb (GtkTreeView *treeview, GdkEventKey *event, FavoriteSelector *tsel)
 {
-	if (event->keyval == GDK_Delete) {
+	if (event->keyval == GDK_KEY_Delete) {
 		GtkTreeModel *model;
 		GtkTreeSelection *select;
 		GtkTreeIter iter;
diff --git a/tools/browser/schema-browser/table-columns.c b/tools/browser/schema-browser/table-columns.c
index f074ee5..b0acfc2 100644
--- a/tools/browser/schema-browser/table-columns.c
+++ b/tools/browser/schema-browser/table-columns.c
@@ -723,8 +723,8 @@ key_press_event (GtkWidget *text_view, GdkEventKey *event, TableColumns *tcolumn
 	GtkTextBuffer *buffer;
 	
 	switch (event->keyval) {
-	case GDK_Return: 
-	case GDK_KP_Enter:
+	case GDK_KEY_Return: 
+	case GDK_KEY_KP_Enter:
 		buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
 		gtk_text_buffer_get_iter_at_mark (buffer, &iter, 
 						  gtk_text_buffer_get_insert (buffer));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]