[libgda] Removed compilation warnings



commit 85e8027493a5000493db1c91bc4b8425e5ecd44e
Author: Vivien Malerba <malerba gnome-db org>
Date:   Thu Apr 19 22:46:43 2012 +0200

    Removed compilation warnings

 .../data-entries/gdaui-data-cell-renderer-combo.c  |   18 -----------
 libgda-ui/data-entries/gdaui-entry-common-time.c   |   33 ++++++++++++-------
 libgda-ui/internal/popup-container.c               |   11 +++++-
 providers/firebird/gda-firebird-meta.c             |   28 ++++++++++++----
 4 files changed, 51 insertions(+), 39 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
index 58140e1..522fa93 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
@@ -495,7 +495,6 @@ gdaui_data_cell_renderer_combo_render (GtkCellRenderer      *cell,
 				       GtkCellRendererState  flags)
 	
 {
-	GtkStateType state = 0;	
 	GdauiDataCellRendererCombo *combocell = GDAUI_DATA_CELL_RENDERER_COMBO (cell);
 
 	/* render the text as for the GtkCellRendererText */
@@ -503,23 +502,6 @@ gdaui_data_cell_renderer_combo_render (GtkCellRenderer      *cell,
 	(text_class->render) (cell, cr, widget, background_area, cell_area, flags);
 
 	/* render the popdown menu symbol */
-	if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED)	{
-		gboolean hasfocus;
-		g_object_get ((GObject*) widget, "has-focus", &hasfocus, NULL);
-		if (hasfocus)
-			state = GTK_STATE_SELECTED;
-		else
-			state = GTK_STATE_ACTIVE;
-	}
-	else {
-		gboolean editable;
-		g_object_get ((GObject*) cell, "editable", &editable, NULL);
-		if (editable)
-			state = GTK_STATE_NORMAL;
-		else
-			state = GTK_STATE_INSENSITIVE;
-	}
-
 	if (combocell->priv->show_expander) {
 		gint expander_size;
 		GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
diff --git a/libgda-ui/data-entries/gdaui-entry-common-time.c b/libgda-ui/data-entries/gdaui-entry-common-time.c
index 49d8a6d..d4bd788 100644
--- a/libgda-ui/data-entries/gdaui-entry-common-time.c
+++ b/libgda-ui/data-entries/gdaui-entry-common-time.c
@@ -800,7 +800,7 @@ date_day_selected_double_click (G_GNUC_UNUSED GtkCalendar *calendar, GdauiEntryC
 }
 
 
-static gboolean popup_grab_on_window (GdkWindow *window, guint32 activate_time);
+static gboolean popup_grab_on_window (GtkWidget *widget, guint32 activate_time);
 static void position_popup (GdauiEntryCommonTime *mgtim);
 static void
 date_calendar_choose_cb (GtkWidget *button, GdauiEntryCommonTime *mgtim)
@@ -870,7 +870,7 @@ date_calendar_choose_cb (GtkWidget *button, GdauiEntryCommonTime *mgtim)
 
         /* popup window */
         /* Temporarily grab pointer and keyboard, copied from GnomeDateEdit */
-        if (!popup_grab_on_window (gtk_widget_get_window (button), gtk_get_current_event_time ()))
+        if (!popup_grab_on_window (button, gtk_get_current_event_time ()))
                 return;
 
         position_popup (mgtim);
@@ -913,22 +913,31 @@ date_calendar_choose_cb (GtkWidget *button, GdauiEntryCommonTime *mgtim)
 		gtk_window_move (GTK_WINDOW (mgtim->priv->window), root_x, root_y);
 
         gtk_widget_grab_focus (mgtim->priv->date);
-        popup_grab_on_window (gtk_widget_get_window (mgtim->priv->window),
+        popup_grab_on_window (mgtim->priv->window,
                               gtk_get_current_event_time ());
 }
 
 static gboolean
-popup_grab_on_window (GdkWindow *window, guint32 activate_time)
+popup_grab_on_window (GtkWidget *widget, guint32 activate_time)
 {
-        if ((gdk_pointer_grab (window, TRUE,
-                               GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
-                               GDK_POINTER_MOTION_MASK,
-                               NULL, NULL, activate_time) == 0)) {
-                if (gdk_keyboard_grab (window, TRUE,
-                                       activate_time) == 0)
+	GdkDeviceManager *manager;
+	GdkDevice *pointer;
+	GdkWindow *window;
+	window = gtk_widget_get_window (widget);
+	manager = gdk_display_get_device_manager (gtk_widget_get_display (widget));
+	pointer = gdk_device_manager_get_client_pointer (manager);
+        if (gdk_device_grab (pointer, window, GDK_OWNERSHIP_WINDOW, TRUE,
+			     GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+			     GDK_POINTER_MOTION_MASK,
+			     NULL, activate_time) == GDK_GRAB_SUCCESS) {
+		GdkDevice *keyb;
+		keyb = gdk_device_get_associated_device (pointer);
+                if (gdk_device_grab (keyb, window, GDK_OWNERSHIP_WINDOW, TRUE,
+				     GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, NULL, activate_time) ==
+		    GDK_GRAB_SUCCESS)
                         return TRUE;
                 else {
-                        gdk_pointer_ungrab (activate_time);
+                        gdk_device_ungrab (pointer, activate_time);
                         return FALSE;
                 }
         }
@@ -943,7 +952,7 @@ position_popup (GdauiEntryCommonTime *mgtim)
         GtkRequisition req_minimum, req_natural;
 
         gtk_widget_get_preferred_size (mgtim->priv->window, &req_minimum,
-                &req_natural);
+				       &req_natural);
 
         gdk_window_get_origin (gtk_widget_get_window (mgtim->priv->date_button), &x, &y);
 	GtkAllocation alloc;
diff --git a/libgda-ui/internal/popup-container.c b/libgda-ui/internal/popup-container.c
index 6707528..cf7cdf5 100644
--- a/libgda-ui/internal/popup-container.c
+++ b/libgda-ui/internal/popup-container.c
@@ -140,8 +140,15 @@ popup_container_dispose (GObject *object)
 static void
 default_position_func (G_GNUC_UNUSED PopupContainer *container, gint *out_x, gint *out_y)
 {
-	gdk_display_get_pointer (gdk_display_get_default (), NULL,
-				 out_x, out_y, NULL);
+	GdkDeviceManager *manager;
+	GdkDevice *pointer;
+	GdkWindow *window;
+	GtkWidget *widget;
+	widget = GTK_WIDGET (container);
+	window = gtk_widget_get_window (widget);
+	manager = gdk_display_get_device_manager (gtk_widget_get_display (widget));
+	pointer = gdk_device_manager_get_client_pointer (manager);
+	gdk_device_get_position (pointer, NULL, out_x, out_y);
 }
 
 static gboolean
diff --git a/providers/firebird/gda-firebird-meta.c b/providers/firebird/gda-firebird-meta.c
index 3dbe0a4..eef1e59 100644
--- a/providers/firebird/gda-firebird-meta.c
+++ b/providers/firebird/gda-firebird-meta.c
@@ -1274,7 +1274,7 @@ _gda_firebird_meta__check_columns (GdaServerProvider *prov, GdaConnection *cnc,
 {
 	//WHERE_AM_I;
 
-	//TO_IMPLEMENT;
+	TO_IMPLEMENT;
 	return TRUE;
 }
 
@@ -1285,7 +1285,7 @@ _gda_firebird_meta_check_columns (GdaServerProvider *prov, GdaConnection *cnc,
 			      const GValue *table_name, const GValue *constraint_name)
 {
 	//WHERE_AM_I;
-	//TO_IMPLEMENT;
+	TO_IMPLEMENT;
 	return TRUE;
 }
 
@@ -1294,7 +1294,7 @@ _gda_firebird_meta__triggers (GdaServerProvider *prov, GdaConnection *cnc,
 			  GdaMetaStore *store, GdaMetaContext *context, GError **error)
 {
 //WHERE_AM_I;
-	return TRUE;
+
 /*	GdaDataModel *model;
 	gboolean retval;
 
@@ -1312,6 +1312,8 @@ _gda_firebird_meta__triggers (GdaServerProvider *prov, GdaConnection *cnc,
 
 	return retval;
 */
+	TO_IMPLEMENT;
+	return TRUE;
 }
 
 gboolean
@@ -1344,6 +1346,8 @@ _gda_firebird_meta_triggers (GdaServerProvider *prov, GdaConnection *cnc,
 
 	return retval;
 */
+	TO_IMPLEMENT;
+	return TRUE;
 }
 
 gboolean
@@ -1369,6 +1373,8 @@ _gda_firebird_meta__routines (GdaServerProvider *prov, GdaConnection *cnc,
 
 	return retval;
 */
+	TO_IMPLEMENT;
+	return TRUE;
 }
 
 gboolean
@@ -1409,6 +1415,8 @@ _gda_firebird_meta_routines (GdaServerProvider *prov, GdaConnection *cnc,
 
 	return retval;
 */
+	TO_IMPLEMENT;
+	return TRUE;
 }
 
 gboolean
@@ -1416,7 +1424,7 @@ _gda_firebird_meta__routine_col (GdaServerProvider *prov, GdaConnection *cnc,
 			     GdaMetaStore *store, GdaMetaContext *context, GError **error)
 {
 	//WHERE_AM_I;
-	//TO_IMPLEMENT;
+	TO_IMPLEMENT;
 	return TRUE;
 }
 
@@ -1427,7 +1435,7 @@ _gda_firebird_meta_routine_col (GdaServerProvider *prov, GdaConnection *cnc,
 			    const GValue *rout_name)
 {
 	//WHERE_AM_I;
-	//TO_IMPLEMENT;
+	TO_IMPLEMENT;
 	return TRUE;
 }
 
@@ -1436,7 +1444,7 @@ _gda_firebird_meta__routine_par (GdaServerProvider *prov, GdaConnection *cnc,
 			     GdaMetaStore *store, GdaMetaContext *context, GError **error)
 {
 	//WHERE_AM_I;
-	//TO_IMPLEMENT;
+	TO_IMPLEMENT;
 	return TRUE;
 }
 
@@ -1447,7 +1455,7 @@ _gda_firebird_meta_routine_par (GdaServerProvider *prov, GdaConnection *cnc,
 			    const GValue *rout_name)
 {
 	//WHERE_AM_I;
-	//TO_IMPLEMENT;
+	TO_IMPLEMENT;
 	return TRUE;
 }
 
@@ -1456,6 +1464,7 @@ _gda_firebird_meta__indexes_tab (G_GNUC_UNUSED GdaServerProvider *prov, GdaConne
 			      GdaMetaStore *store, GdaMetaContext *context, GError **error)
 {
 //WHERE_AM_I;
+	TO_IMPLEMENT;
 	return TRUE;
 /*
 	GdaDataModel *model;
@@ -1484,6 +1493,7 @@ _gda_firebird_meta_indexes_tab (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnec
 			     const GValue *table_name, const GValue *index_name_n)
 {
 //WHERE_AM_I;
+	TO_IMPLEMENT;
 	return TRUE;
 /*
 	GdaDataModel *model;
@@ -1546,6 +1556,8 @@ _gda_firebird_meta__index_cols (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnec
 
 	return retval;
 */
+	TO_IMPLEMENT;
+	return TRUE;
 }
 
 gboolean
@@ -1579,5 +1591,7 @@ _gda_firebird_meta_index_cols (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnect
 
 	return retval;
 */
+	TO_IMPLEMENT;
+	return TRUE;
 }
 



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