[anjuta] class-gen: fix compile warnings
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] class-gen: fix compile warnings
- Date: Wed, 6 Feb 2013 21:10:27 +0000 (UTC)
commit b12fb089096271fa6c2f8428d18471e269797f49
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date: Sun Feb 3 17:56:54 2013 +0100
class-gen: fix compile warnings
https://bugzilla.gnome.org/show_bug.cgi?id=693213
plugins/class-gen/cell-renderer-flags.c | 5 ++---
plugins/class-gen/combo-flags.c | 27 ++++++++++++++++++---------
plugins/class-gen/window.c | 16 +++-------------
3 files changed, 23 insertions(+), 25 deletions(-)
---
diff --git a/plugins/class-gen/cell-renderer-flags.c b/plugins/class-gen/cell-renderer-flags.c
index 67a9c21..40cf134 100644
--- a/plugins/class-gen/cell-renderer-flags.c
+++ b/plugins/class-gen/cell-renderer-flags.c
@@ -325,9 +325,8 @@ cg_cell_renderer_flags_start_editing (GtkCellRenderer *cell,
G_GNUC_UNUSED GdkEvent *event,
G_GNUC_UNUSED GtkWidget *widget,
const gchar *path,
- G_GNUC_UNUSED GdkRectangle
- *background_area,
- G_GNUC_UNUSED GdkRectangle *cell_area,
+ G_GNUC_UNUSED const GdkRectangle *background_area,
+ G_GNUC_UNUSED const GdkRectangle *cell_area,
G_GNUC_UNUSED GtkCellRendererState flags)
{
CgCellRendererFlags *cell_flags;
diff --git a/plugins/class-gen/combo-flags.c b/plugins/class-gen/combo-flags.c
index 20fa2ca..23b4e59 100644
--- a/plugins/class-gen/combo-flags.c
+++ b/plugins/class-gen/combo-flags.c
@@ -47,7 +47,10 @@ struct _CgComboFlagsPrivate
GtkWidget* window;
GtkWidget* treeview;
GtkTreeViewColumn* column;
-
+
+ GdkDevice* pointer_device;
+ GdkDevice* keyboard_device;
+
GSList* cells;
gboolean editing_started;
@@ -392,7 +395,7 @@ cg_combo_flags_get_position (CgComboFlags *combo,
*y += allocation.y;
}
- gtk_widget_size_request (priv->window, &popup_req);
+ gtk_widget_get_preferred_size (priv->window, &popup_req, NULL);
*width = allocation.width;
if (popup_req.width > *width) *width = popup_req.width;
@@ -717,6 +720,7 @@ cg_combo_flags_popup_idle (gpointer data)
GtkWidget *toplevel;
GtkWidget *scrolled;
GdkWindow *window;
+ GdkDeviceManager* device_manager;
gint height, width, x, y;
combo = CG_COMBO_FLAGS (data);
@@ -797,14 +801,19 @@ cg_combo_flags_popup_idle (gpointer data)
window = gtk_widget_get_window (priv->window);
- gdk_pointer_grab (window, TRUE,
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK,
- NULL, NULL, GDK_CURRENT_TIME);
+ device_manager = gdk_display_get_device_manager (gdk_window_get_display (window));
+ priv->pointer_device = gdk_device_manager_get_client_pointer (device_manager);
+ priv->keyboard_device = gdk_device_get_associated_device (priv->pointer_device);
gtk_grab_add (priv->window);
- gdk_keyboard_grab (window, TRUE, GDK_CURRENT_TIME);
+ gdk_device_grab (priv->pointer_device, window, GDK_OWNERSHIP_NONE, TRUE,
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK,
+ NULL, GDK_CURRENT_TIME);
+
+ gdk_device_grab (priv->keyboard_device, window, GDK_OWNERSHIP_NONE, TRUE,
+ GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK,
+ NULL, GDK_CURRENT_TIME);
return FALSE;
}
@@ -916,8 +925,8 @@ cg_combo_flags_popdown(CgComboFlags *combo)
if (priv->window != NULL)
{
gtk_grab_remove (priv->window);
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
- gdk_keyboard_ungrab (GDK_CURRENT_TIME);
+ gdk_device_ungrab (priv->pointer_device, GDK_CURRENT_TIME);
+ gdk_device_ungrab (priv->keyboard_device, GDK_CURRENT_TIME);
gtk_widget_hide (priv->window);
g_object_unref (priv->column);
diff --git a/plugins/class-gen/window.c b/plugins/class-gen/window.c
index 5e137f5..eafcf0e 100644
--- a/plugins/class-gen/window.c
+++ b/plugins/class-gen/window.c
@@ -298,15 +298,15 @@ cg_window_set_heap_value (CgWindow *window,
{
case G_TYPE_STRING:
text = cg_window_fetch_string (window, id);
- g_hash_table_insert (values, name, text);
+ g_hash_table_insert (values, (gchar*)name, text);
break;
case G_TYPE_INT:
int_value = cg_window_fetch_integer (window, id);
- g_hash_table_insert (values, name, g_strdup_printf ("%d", int_value));
+ g_hash_table_insert (values, (gchar*)name, g_strdup_printf ("%d", int_value));
break;
case G_TYPE_BOOLEAN:
text = g_strdup (cg_window_fetch_boolean (window, id) ? "1" : "0");
- g_hash_table_insert (values, name, text);
+ g_hash_table_insert (values, (gchar*)name, text);
break;
default:
break;
@@ -1171,12 +1171,10 @@ cg_window_set_property (GObject *object,
GParamSpec *pspec)
{
CgWindow *window;
- CgWindowPrivate *priv;
g_return_if_fail (CG_IS_WINDOW (object));
window = CG_WINDOW (object);
- priv = CG_WINDOW_PRIVATE (window);
switch (prop_id)
{
@@ -1300,7 +1298,6 @@ cg_window_create_value_heap (CgWindow *window)
CgWindowPrivate *priv;
GHashTable *values;
- GError *error;
gint license_index;
GtkNotebook *notebook;
@@ -1317,7 +1314,6 @@ cg_window_create_value_heap (CgWindow *window)
"top_notebook"));
values = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify)g_free);
- error = NULL;
switch (gtk_notebook_get_current_page (notebook))
{
@@ -1615,18 +1611,12 @@ cg_window_set_add_to_repository (CgWindow *window,
gboolean
cg_window_get_add_to_project(CgWindow *window)
{
- CgWindowPrivate *priv;
- priv = CG_WINDOW_PRIVATE (window);
-
return cg_window_fetch_boolean (window, "add_project");
}
gboolean
cg_window_get_add_to_repository (CgWindow *window)
{
- CgWindowPrivate *priv;
- priv = CG_WINDOW_PRIVATE (window);
-
return cg_window_fetch_boolean (window, "add_repository");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]