From 98a3c749a15349b874dcef0ce3a43ebff651d95a Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Wed, 1 Feb 2012 11:08:15 +0000 Subject: Activated GTK_DISABLE_DEPRECATED again to avoid some warnings. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@233 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 18 ++++++++++++ configure.ac | 3 +- src/gtkext/easygtk.c | 70 ++++++++++++++++++++++---------------------- src/gtkext/gtkbufferview.c | 9 ++++-- src/gtkext/gtkdockitem.h | 4 +-- src/gtkext/gtkdockpanel.c | 4 +-- src/gtkext/gtkdockpanel.h | 10 +++---- src/gtkext/gtkdockstation.h | 8 ++--- src/gtkext/gtkdropwindow.h | 4 +-- src/gtkext/gtkextstatusbar.h | 4 +-- src/gtkext/gtkviewpanel.c | 4 ++- src/gui/panels/symbols.c | 3 -- src/panels/breaks.c | 3 +- 13 files changed, 81 insertions(+), 63 deletions(-) diff --git a/ChangeLog b/ChangeLog index 91ee03f..e09997e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,24 @@ 12-02-01 Cyrille Bagard * configure.ac: + Activate GTK_DISABLE_DEPRECATED again to avoid some warnings. + + * src/gtkext/easygtk.c: + * src/gtkext/gtkbufferview.c: + * src/gtkext/gtkdockitem.h: + * src/gtkext/gtkdockpanel.c: + * src/gtkext/gtkdockpanel.h: + * src/gtkext/gtkdockstation.h: + * src/gtkext/gtkdropwindow.h: + * src/gtkext/gtkextstatusbar.h: + * src/gtkext/gtkviewpanel.c: + * src/gui/panels/symbols.c: + * src/panels/breaks.c: + Fix the code to discard deprecated usages. + +12-02-01 Cyrille Bagard + + * configure.ac: Check for pygobject-2.0 and add the new Makefile from the 'plugins/pyoida/debug' directory to AC_CONFIG_FILES. diff --git a/configure.ac b/configure.ac index 1d1e990..b59f323 100644 --- a/configure.ac +++ b/configure.ac @@ -154,8 +154,7 @@ AC_SUBST(WARNING_FLAGS) # _XOPEN_SOURCE: strdup, snprintf # _ISOC99_SOURCE: INFINITY; NAN # GTK_DISABLE_DEPRECATED: on reste conforme au C99 -COMPLIANCE_FLAGS="-D_GNU_SOURCE " -#-DGTK_DISABLE_DEPRECATED" +COMPLIANCE_FLAGS="-D_GNU_SOURCE -DGTK_DISABLE_DEPRECATED" AC_SUBST(COMPLIANCE_FLAGS) diff --git a/src/gtkext/easygtk.c b/src/gtkext/easygtk.c index ff4d9e6..5218381 100644 --- a/src/gtkext/easygtk.c +++ b/src/gtkext/easygtk.c @@ -2,7 +2,7 @@ /* OpenIDA - Outil d'analyse de fichiers binaires * easygtk.c - mise en place rapide de composants GTK * - * Copyright (C) 2008-2011 Cyrille Bagard + * Copyright (C) 2008-2012 Cyrille Bagard * * This file is part of OpenIDA. * @@ -117,8 +117,8 @@ GtkWidget *qck_create_notebook(GObject *object, const char *name) if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -151,8 +151,8 @@ GtkWidget *qck_create_scrolled_window(GObject *object, const char *name) if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -191,8 +191,8 @@ GtkWidget *qck_create_image(GObject *object, const char *name, gchar *filename) if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -224,8 +224,8 @@ GtkWidget *qck_create_label(GObject *object, const char *name, const char *capti if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -258,8 +258,8 @@ GtkWidget *qck_create_entry(GObject *object, const char *name, const char *text) if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -296,8 +296,8 @@ GtkWidget *qck_create_textview(GObject *object, const char *name, GCallback hand if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -338,8 +338,8 @@ GtkWidget *qck_create_button(GObject *object, const char *name, const char *capt if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -377,8 +377,8 @@ GtkWidget *qck_create_button_from_stock(GObject *object, const char *name, const if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -421,8 +421,8 @@ GtkWidget *qck_create_button_with_img(GObject *object, const char *name, const c if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -459,8 +459,8 @@ GtkWidget *qck_create_check_button(GObject *object, const char *name, const char if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)gtk_widget_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -496,8 +496,8 @@ GtkWidget *qck_create_combobox(GObject *object, const char *name, GCallback hand if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -539,8 +539,8 @@ GtkWidget *qck_create_menu_item(GObject *object, const char *name, const char *c if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -577,8 +577,8 @@ GtkWidget *qck_create_check_menu_item(GObject *object, const char *name, const c if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -616,8 +616,8 @@ GtkWidget *qck_create_radio_menu_item(GObject *object, const char *name, GSList if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -715,8 +715,8 @@ GtkWidget *qck_create_tool_button(GObject *object, const char *name, const char if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -757,8 +757,8 @@ GtkWidget *qck_create_toggle_tool_button(GObject *object, const char *name, cons if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); @@ -792,8 +792,8 @@ GtkWidget *qck_create_tool_separator(GObject *object, const char *name) if (G_IS_OBJECT(object) && name != NULL) { - gtk_widget_ref(result); - g_object_set_data_full(object, name, result, (GtkDestroyNotify)g_object_unref); + g_object_ref(G_OBJECT(result)); + g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref); } gtk_widget_show(result); diff --git a/src/gtkext/gtkbufferview.c b/src/gtkext/gtkbufferview.c index 3e58500..186b53f 100644 --- a/src/gtkext/gtkbufferview.c +++ b/src/gtkext/gtkbufferview.c @@ -213,7 +213,7 @@ static void gtk_buffer_view_size_allocate(GtkWidget *widget, GtkAllocation *allo widget->allocation = *allocation; - if (GTK_WIDGET_REALIZED(widget)) + if (gtk_widget_get_realized(widget)) gdk_window_move_resize(widget->window, allocation->x, allocation->y, allocation->width, allocation->height); @@ -284,6 +284,7 @@ static gboolean gtk_buffer_view_expose(GtkWidget *widget, GdkEventExpose *event) GdkDrawable *drawable; /* Surface de dessin */ gint fake_x; /* Abscisse virtuelle */ gint fake_y; /* Ordonnée virtuelle */ + GtkStateType state; /* Etat du composant */ GtkViewPanelClass *parent_class; /* Version pure du parent */ view = GTK_BUFFER_VIEW(widget); @@ -304,12 +305,14 @@ static gboolean gtk_buffer_view_expose(GtkWidget *widget, GdkEventExpose *event) /* Dessin de la marge gauche */ - gdk_gc_set_foreground(pview->gc, &style->mid[GTK_WIDGET_STATE(widget)]); + state = gtk_widget_get_state(widget); + + gdk_gc_set_foreground(pview->gc, &style->mid[state]); gdk_draw_rectangle(drawable, pview->gc, TRUE, fake_x, event->area.y, view->left_margin, event->area.y + event->area.height); - gdk_gc_set_foreground(pview->gc, &style->dark[GTK_WIDGET_STATE(widget)]); + gdk_gc_set_foreground(pview->gc, &style->dark[state]); gdk_draw_line(drawable, pview->gc, fake_x + view->left_margin, event->area.y, diff --git a/src/gtkext/gtkdockitem.h b/src/gtkext/gtkdockitem.h index d6f2fbc..7525b9a 100644 --- a/src/gtkext/gtkdockitem.h +++ b/src/gtkext/gtkdockitem.h @@ -2,7 +2,7 @@ /* OpenIDA - Outil d'analyse de fichiers binaires * gtkdockitem.h - prototypes pour la mémorisation des propriétés d'un panneau dockable * - * Copyright (C) 2009 Cyrille Bagard + * Copyright (C) 2009-2012 Cyrille Bagard * * This file is part of OpenIDA. * @@ -74,7 +74,7 @@ struct _GDockItemClass /* Détermine le type d'un panneau dockable. */ -GtkType g_dock_item_get_type(void); +GType g_dock_item_get_type(void); /* Crée une nouvelle mémorisation de panneau dockable. */ GDockItem *g_dock_item_new(const gchar *, GtkWidget *); diff --git a/src/gtkext/gtkdockpanel.c b/src/gtkext/gtkdockpanel.c index ea83b73..24e99eb 100644 --- a/src/gtkext/gtkdockpanel.c +++ b/src/gtkext/gtkdockpanel.c @@ -2,7 +2,7 @@ /* OpenIDA - Outil d'analyse de fichiers binaires * gtkdockpanel.c - manipulation et affichage de panneaux dockables * - * Copyright (C) 2009 Cyrille Bagard + * Copyright (C) 2009-2012 Cyrille Bagard * * This file is part of OpenIDA. * @@ -397,7 +397,7 @@ static gboolean gtk_dock_panel_drag_motion_cb(GtkDockPanel *dpanel, GdkDragConte gint new_y; /* Ordonnée de la fenêtre */ GtkRequisition req; /* Taille actuelle du panneau */ - if (!GTK_WIDGET_VISIBLE(dpanel->dropwin)) + if (!gtk_widget_get_visible(dpanel->dropwin)) { gdk_window_get_origin(GTK_WIDGET(dpanel)->window, &new_x, &new_y); diff --git a/src/gtkext/gtkdockpanel.h b/src/gtkext/gtkdockpanel.h index 1d820bc..9609710 100644 --- a/src/gtkext/gtkdockpanel.h +++ b/src/gtkext/gtkdockpanel.h @@ -2,7 +2,7 @@ /* OpenIDA - Outil d'analyse de fichiers binaires * gtkdockpanel.h - prototypes pour la manipulation et l'affichage de panneaux dockables * - * Copyright (C) 2009 Cyrille Bagard + * Copyright (C) 2009-2012 Cyrille Bagard * * This file is part of OpenIDA. * @@ -37,9 +37,9 @@ G_BEGIN_DECLS #define GTK_TYPE_DOCK_PANEL (gtk_dock_panel_get_type()) -#define GTK_DOCK_PANEL(obj) GTK_CHECK_CAST(obj, gtk_dock_panel_get_type (), GtkDockPanel) -#define GTK_DOCK_PANEL_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, gtk_dock_panel_get_type(), GtkDockPanelClass) -#define GTK_IS_DOCK_PANEL(obj) GTK_CHECK_TYPE(obj, gtk_dock_panel_get_type()) +#define GTK_DOCK_PANEL(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, gtk_dock_panel_get_type (), GtkDockPanel) +#define GTK_DOCK_PANEL_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, gtk_dock_panel_get_type(), GtkDockPanelClass) +#define GTK_IS_DOCK_PANEL(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, gtk_dock_panel_get_type()) typedef struct _GtkDockPanel GtkDockPanel; @@ -74,7 +74,7 @@ struct _GtkDockPanelClass /* Détermine le type du composant d'affichage des morceaux. */ -GtkType gtk_dock_panel_get_type(void); +GType gtk_dock_panel_get_type(void); /* Crée un nouveau composant pour station dockable. */ GtkWidget *gtk_dock_panel_new(void); diff --git a/src/gtkext/gtkdockstation.h b/src/gtkext/gtkdockstation.h index a15667a..770681f 100644 --- a/src/gtkext/gtkdockstation.h +++ b/src/gtkext/gtkdockstation.h @@ -32,9 +32,9 @@ G_BEGIN_DECLS #define GTK_TYPE_DOCK_STATION (gtk_dock_station_get_type()) -#define GTK_DOCK_STATION(obj) GTK_CHECK_CAST(obj, gtk_dock_station_get_type (), GtkDockStation) -#define GTK_DOCK_STATION_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, gtk_dock_station_get_type(), GtkDockStationClass) -#define GTK_IS_DOCK_STATION(obj) GTK_CHECK_TYPE(obj, gtk_dock_station_get_type()) +#define GTK_DOCK_STATION(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, gtk_dock_station_get_type (), GtkDockStation) +#define GTK_DOCK_STATION_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, gtk_dock_station_get_type(), GtkDockStationClass) +#define GTK_IS_DOCK_STATION(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, gtk_dock_station_get_type()) /* Station de réception pour concentration d'éléments (instance) */ @@ -67,7 +67,7 @@ struct _GtkDockStationClass /* Détermine le type du composant d'affichage concentré. */ -GtkType gtk_dock_station_get_type(void); +GType gtk_dock_station_get_type(void); /* Crée un nouveau composant pour support d'affichage concentré. */ GtkWidget *gtk_dock_station_new(void); diff --git a/src/gtkext/gtkdropwindow.h b/src/gtkext/gtkdropwindow.h index f9dcb12..c7852be 100644 --- a/src/gtkext/gtkdropwindow.h +++ b/src/gtkext/gtkdropwindow.h @@ -2,7 +2,7 @@ /* OpenIDA - Outil d'analyse de fichiers binaires * gtkdropwindow.h - prototypes pour la fenêtre de sélection de zone de destination pour dock * - * Copyright (C) 2009 Cyrille Bagard + * Copyright (C) 2009-2012 Cyrille Bagard * * This file is part of OpenIDA. * @@ -58,7 +58,7 @@ struct _GtkDropWindowClass /* Détermine le type de fenêtre d'affichage pour destination de DnD. */ -GtkType gtk_drop_window_get_type(void); +GType gtk_drop_window_get_type(void); /* Crée un nouveau composant pour station dockable. */ GtkWidget *gtk_drop_window_new(void); diff --git a/src/gtkext/gtkextstatusbar.h b/src/gtkext/gtkextstatusbar.h index 2342b56..4cba821 100644 --- a/src/gtkext/gtkextstatusbar.h +++ b/src/gtkext/gtkextstatusbar.h @@ -2,7 +2,7 @@ /* OpenIDA - Outil d'analyse de fichiers binaires * gtkextstatusbar.h - prototypes pour la barre de statut améliorée * - * Copyright (C) 2009 Cyrille Bagard + * Copyright (C) 2009-2012 Cyrille Bagard * * This file is part of OpenIDA. * @@ -66,7 +66,7 @@ struct _GtkExtStatusBarClass /* Détermine le type de la barre de statut améliorée. */ -GtkType gtk_extended_status_bar_get_type(void); +GType gtk_extended_status_bar_get_type(void); /* Crée une nouvelle instance de barre de statut. */ GtkWidget *gtk_extended_status_bar_new(void); diff --git a/src/gtkext/gtkviewpanel.c b/src/gtkext/gtkviewpanel.c index 9aba036..43ab569 100644 --- a/src/gtkext/gtkviewpanel.c +++ b/src/gtkext/gtkviewpanel.c @@ -295,6 +295,7 @@ static gboolean gtk_view_panel_expose(GtkWidget *widget, GdkEventExpose *event) GtkStyle *style; /* Style associé au composant */ int width; /* Largeur de l'élément */ int height; /* Hauteur de l'élément */ + GtkStateType state; /* Etat du composant */ panel = GTK_VIEW_PANEL(widget); @@ -305,7 +306,8 @@ static gboolean gtk_view_panel_expose(GtkWidget *widget, GdkEventExpose *event) gtk_widget_get_size_request(widget, &width, &height); - gdk_gc_set_foreground(panel->gc, &style->dark[GTK_WIDGET_STATE(widget)]); + state = gtk_widget_get_state(widget); + gdk_gc_set_foreground(panel->gc, &style->dark[state]); gdk_draw_rectangle(GDK_DRAWABLE(widget->window), panel->gc, FALSE, 0, 0, width - 1, height - 1); diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c index bac2152..c0d34a7 100644 --- a/src/gui/panels/symbols.c +++ b/src/gui/panels/symbols.c @@ -162,7 +162,6 @@ static void g_symbols_panel_init(GSymbolsPanel *panel) { GEditorItem *base; /* Version basique d'instance */ GObject *ref; /* Espace de référencement */ - GtkTooltips *tooltips; /* Affichage des bulles d'aide */ GtkWidget *toolbar; /* Barre d'outils */ GtkWidget *button; /* Bouton de cette même barre */ GtkWidget *separator; /* Barre de séparation vert. */ @@ -182,8 +181,6 @@ static void g_symbols_panel_init(GSymbolsPanel *panel) /* Barre d'outils supérieure */ - tooltips = gtk_tooltips_new(); - toolbar = gtk_toolbar_new(); gtk_widget_show(toolbar); gtk_box_pack_start(GTK_BOX(base->widget), toolbar, FALSE, FALSE, 0); diff --git a/src/panels/breaks.c b/src/panels/breaks.c index 5455aed..31e2217 100644 --- a/src/panels/breaks.c +++ b/src/panels/breaks.c @@ -2,7 +2,7 @@ /* OpenIDA - Outil d'analyse de fichiers binaires * breaks.c - panneau d'affichage des points d'arrêt * - * Copyright (C) 2010 Cyrille Bagard + * Copyright (C) 2010-2012 Cyrille Bagard * * This file is part of OpenIDA. * @@ -138,7 +138,6 @@ static void g_breaks_panel_init(GBreaksPanel *panel) { GEditorPanel *base; /* Version basique d'instance */ GObject *ref; /* Espace de référencement */ - GtkTooltips *tooltips; /* Affichage des bulles d'aide */ GtkWidget *toolbar; /* Barre d'outils */ GtkWidget *button; /* Bouton de cette même barre */ GtkWidget *separator; /* Barre de séparation vert. */ -- cgit v0.11.2-87-g4458