[nautilus-actions] Build with Gtk+-3 depending of found environment



commit 1d4bf5c6388219875a2495e8f93a93b005762bde
Author: Pierre Wieser <pwieser trychlos org>
Date:   Thu Dec 16 19:48:09 2010 +0100

    Build with Gtk+-3 depending of found environment
    
    Build, but does not run yet!
    In particular, GtkComboBoxEntry embedded in NACT UI must be ported to Gtk+-3.

 ChangeLog                        |   50 +++++++++++++++++
 configure.ac                     |  106 ++++++++++++++++---------------------
 m4/na-check-module.m4            |   55 +++++++++++++++++++
 m4/na-enable-manuals.m4          |   16 +++---
 m4/na-maintainer-mode.m4         |    6 +-
 run-autogen.sh                   |   36 +++++++++----
 src/core/na-importer-ask.c       |    2 +-
 src/nact/base-assistant.c        |    2 +-
 src/nact/base-window.c           |    4 +-
 src/nact/nact-clipboard.c        |   39 ++++++++++++--
 src/nact/nact-gtk-utils.c        |   22 +++++++-
 src/nact/nact-gtk-utils.h        |    2 +-
 src/nact/nact-iaction-tab.c      |   86 +++++++++++++++++++++++------
 src/nact/nact-iactions-list.c    |    8 ++--
 src/nact/nact-ibasenames-tab.c   |    2 +-
 src/nact/nact-icommand-tab.c     |   12 ++--
 src/nact/nact-ienvironment-tab.c |   22 ++++----
 src/nact/nact-iexecution-tab.c   |   14 +++---
 src/nact/nact-ifolders-tab.c     |    2 +-
 src/nact/nact-iproperties-tab.c  |    8 ++--
 src/nact/nact-ischemes-tab.c     |    2 +-
 src/nact/nact-main-statusbar.c   |   14 ++++-
 src/nact/nact-match-list.c       |   12 ++--
 src/nact/nact-schemes-list.c     |   10 ++--
 src/nact/nact-tree-model-dnd.c   |  110 ++++++++++++++++++++++++++++++++------
 25 files changed, 465 insertions(+), 177 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3b76425..fc54bb5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,53 @@
+2010-12-16 Pierre Wieser <pwieser trychlos org>
+
+	* configure.ac: Build with Gtk+ 3.0 if first found by pkg-config.
+
+	* run-autogen.sh: Setup PKG_CONFIG_PATH and LD_LIBRARY_PATH
+	to be able to build against Gtk+ 3.0.
+
+	* src/core/na-importer-ask.c (na_importer_ask_user):
+	* src/nact/base-window.c (instance_dispose):
+	Replace deprecated gtk_widget_hide_all() with gtk_widget_hide().
+
+	* src/nact/base-assistant.c (on_key_pressed_event):
+	* src/nact/nact-iactions-list.c (on_key_pressed_event):
+	* src/nact/nact-match-list.c (on_key_pressed_event):
+	* src/nact/nact-schemes-list.c (on_key_pressed_event):
+	Replace deprecated GDK_xxxx symbols keys with GDK_KEY_xxxx.
+
+	* src/nact/nact-clipboard.c
+	(nact_clipboard_dnd_get_data,get_from_dnd_clipboard_callback,
+	nact_clipboard_primary_get,get_from_primary_clipboard_callback):
+	* src/nact/nact-tree-model-dnd.c
+	(nact_tree_model_dnd_idrag_dest_drag_data_received,
+	nact_tree_model_dnd_imulti_drag_source_drag_data_get,
+	nact_tree_model_dnd_on_drag_begin,nact_tree_model_dnd_on_drag_end,
+	drop_uri_list,get_xds_atom_value):
+	Use gtk_selection_data_get_xxx accessors, available since Gtk+ 2.14.
+	Use gdk_drag_context_get_xxx accessors, available since Gtk+ 2.22.
+
+	* src/nact/nact-gtk-utils.c (nact_gtk_utils_set_editable):
+	* src/nact/nact-gtk-utils.h:
+	* src/nact/nact-iaction-tab.c (on_tab_updatable_selection_changed):
+	* src/nact/nact-ibasenames-tab.c (on_tab_updatable_selection_changed):
+	* src/nact/nact-icommand-tab.c (on_tab_updatable_selection_changed):
+	* src/nact/nact-ienvironment-tab.c (on_tab_updatable_selection_changed):
+	* src/nact/nact-iexecution-tab.c (on_tab_updatable_selection_changed):
+	* src/nact/nact-ifolders-tab.c (on_tab_updatable_selection_changed):
+	* src/nact/nact-iproperties-tab.c (on_tab_updatable_selection_changed):
+	* src/nact/nact-ischemes-tab.c (on_tab_updatable_selection_changed):
+	* src/nact/nact-match-list.c (nact_match_list_on_selection_changed):
+	* src/nact/nact-schemes-list.c (nact_schemes_list_create_model):
+	Replace deprecated GtkObject with GtkWidget.
+	Replace deprecated GtkComboboxEntry with GtkCombobox starting with
+	Gtk+ 2.24.
+
+	* src/nact/nact-gtk-utils.c (nact_gtk_utils_get_pixbuf):
+	Replace deprecated gtk_widget_render_icon() with gtk_widget_render_icon_pixbuf().
+
+	* src/nact/nact-main-statusbar.c (nact_main_statusbar_initial_load_toplevel):
+	Replace deprecated gtk_widget_size_request() with gtk_widget_get_preferred_size().
+
 2010-12-14 Pierre Wieser <pwieser trychlos org>
 
 	* configure.ac:
diff --git a/configure.ac b/configure.ac
index 23be8af..b5e96b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,60 +130,46 @@ AM_GCONF_SOURCE_2
 # [configure.ac, nautilus-actions.c] remove test for
 # 	nautilus_menu_provider_emit_items_updated_signal() when Gnome >= 2.16
 #
-GLIB_REQUIRED=2.16.0
-GTK_REQUIRED=2.12.0
-NAUTILUS_EXTENSION_REQUIRED=2.8.0
-GCONF_REQUIRED=2.8.0
-LIBXML_REQUIRED=2.6.0
-GOBJECT_REQUIRED=2.4.0
-LIBGTOP_REQUIRED=2.23.1
-
 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 if test "${PKG_CONFIG}" = "no"; then
 	AC_MSG_ERROR([You need to install pkg-config])
 fi
 
-PKG_CHECK_MODULES([DBUS],				[dbus-glib-1])
-PKG_CHECK_MODULES([GCONF],				[gconf-2.0		>= ${GCONF_REQUIRED}])
-PKG_CHECK_MODULES([GMODULE],			[gmodule-2.0	>= ${GLIB_REQUIRED}])
-PKG_CHECK_MODULES([GLIB],				[glib-2.0		>= ${GLIB_REQUIRED}])
-PKG_CHECK_MODULES([GTK],				[gtk+-2.0		>= ${GTK_REQUIRED}])
-PKG_CHECK_MODULES([GTOP],				[libgtop-2.0	>= ${LIBGTOP_REQUIRED}])
-PKG_CHECK_MODULES([LIBXML],				[libxml-2.0		>= ${LIBXML_REQUIRED}])
-PKG_CHECK_MODULES([SM],					[sm				>= 1.0.0])
-PKG_CHECK_MODULES([UNIQUE],				[unique-1.0])
-PKG_CHECK_MODULES([UUID],				[uuid])
-PKG_CHECK_MODULES([NAUTILUS_EXTENSION],	[libnautilus-extension >= ${NAUTILUS_EXTENSION_REQUIRED}])
-
-AC_SUBST([NAUTILUS_ACTIONS_CFLAGS],["	\
-	${DBUS_CFLAGS}						\
-	${GCONF_CFLAGS}						\
-	${CGMODULE_CFLAGS}					\
-	${GLIB_CFLAGS}						\
-	${GTK_CFLAGS}						\
-	${GTOP_CFLAGS}						\
-	${LIBXML_CFLAGS}					\
-	${SM_CFLAGS}						\
-	${UNIQUE_CFLAGS}					\
-	${UUID_CFLAGS}						\
-	${NAUTILUS_EXTENSION_CFLAGS}		\
-"])
-AC_DEFINE_UNQUOTED([NAUTILUS_ACTIONS_CFLAGS],["${NAUTILUS_ACTIONS_CFLAGS}"],[N-A compiler flags])
-
-AC_SUBST([NAUTILUS_ACTIONS_LIBS],["		\
-	${DBUS_LIBS}						\
-	${GCONF_LIBS}						\
-	${CGMODULE_LIBS}					\
-	${GLIB_LIBS}						\
-	${GTK_LIBS}							\
-	${GTOP_LIBS}						\
-	${LIBXML_LIBS}						\
-	${SM_LIBS}							\
-	${UNIQUE_LIBS}						\
-	${UUID_LIBS}						\
-	${NAUTILUS_EXTENSION_LIBS}			\
-"])
-AC_DEFINE_UNQUOTED([NAUTILUS_ACTIONS_LIBS],["${NAUTILUS_ACTIONS_LIBS}"],[N-A linker flags])
+gtk_required=2.12.0
+PKG_CHECK_MODULES([GTK3],[gtk+-3.0 >= ${gtk_required}],[have_gtk3=yes],[have_gtk3=no])
+if test "${have_gtk3}" = "yes"; then
+	unique_module="unique-3.0"
+	NAUTILUS_ACTIONS_CFLAGS="${GTK3_CFLAGS}"
+	NAUTILUS_ACTIONS_LIBS="${GTK3_LIBS}"
+	AC_MSG_CHECKING([for GTK2])
+	AC_MSG_RESULT([skipped as Gtk+-3 build has been detected])
+else
+	PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= ${gtk_required}],[have_gtk2=yes],[have_gtk2=no])
+	if test "${have_gtk2}" = "yes"; then
+		unique_module="unique-1.0"
+		NAUTILUS_ACTIONS_CFLAGS="${GTK2_CFLAGS}"
+		NAUTILUS_ACTIONS_LIBS="${GTK2_LIBS}"
+	else
+		AC_MSG_ERROR([unable to find any Gtk+ library])
+	fi
+fi
+
+glib_required=2.16.0
+
+dnl aclocal complains if the comma is not just after the square bracket
+NA_CHECK_MODULE([DBUS],              [dbus-glib-1])
+NA_CHECK_MODULE([GCONF],             [gconf-2.0 >= 2.8.0])
+NA_CHECK_MODULE([GMODULE],           [gmodule-2.0 >= ${glib_required}])
+NA_CHECK_MODULE([GLIB],              [glib-2.0 >= ${glib_required}])
+NA_CHECK_MODULE([GTOP],              [libgtop-2.0 >= 2.23.1])
+NA_CHECK_MODULE([LIBXML],            [libxml-2.0 >= 2.6])
+NA_CHECK_MODULE([SM],                [sm >= 1.0])
+NA_CHECK_MODULE([UNIQUE],            [${unique_module}])
+NA_CHECK_MODULE([UUID],              [uuid])
+NA_CHECK_MODULE([NAUTILUS_EXTENSION],[libnautilus-extension >= 2.8])
+
+AC_SUBST([NAUTILUS_ACTIONS_CFLAGS])
+AC_SUBST([NAUTILUS_ACTIONS_LIBS])
 
 # defines log domains when in maintainer mode
 NA_LOG_DOMAINS
@@ -195,7 +181,7 @@ NA_ENABLE_MANUALS
 NA_SET_DEFAULT_IO_PROVIDER([na-desktop])
 
 # when working in a test environment, nautilus extensions are typically
-# installed in a non-standard location ; lets specify them here
+# installed in a non-standard location ; lets specify this location here
 NA_NAUTILUS_EXTDIR
 
 # define NA_MAINTAINER_MODE variable
@@ -213,11 +199,11 @@ AC_DEFINE_UNQUOTED([NA_CONFIG_OPTIONS],["$0 ${config_options}"],["Configure opti
 AC_OUTPUT
 
 if test "x${enable_schemas_install}" = "xno"; then
-	_ac_na_schemas_install="disabled"; else
-	_ac_na_schemas_install="enabled in ${GCONF_SCHEMA_FILE_DIR}"
+	msg_schemas_install="disabled"; else
+	msg_schemas_install="enabled in ${GCONF_SCHEMA_FILE_DIR}"
 fi
-_ac_na_gtk_html_doc=`if test "x${enable_gtk_doc_html}" = "xno"; then echo disabled; else echo "enabled with gtk-doc"; fi`
-_ac_na_gtk_pdf_doc=`if test "x${enable_gtk_doc_pdf}" = "xno"; then echo disabled; else echo enabled; fi`
+msg_gtk_html_doc=`if test "x${enable_gtk_doc_html}" = "xno"; then echo disabled; else echo "enabled with gtk-doc"; fi`
+msg_gtk_pdf_doc=`if test "x${enable_gtk_doc_pdf}" = "xno"; then echo disabled; else echo enabled; fi`
 $as_echo "
 	${PACKAGE_STRING} configuration summary:
 
@@ -225,12 +211,12 @@ $as_echo "
 	Build system type               ${ac_cv_build}
 	Nautilus extensions directory   ${ac_with_nact_nautilus_extdir}
 	Default I/O provider            ${with_default_io_provider}
-	GConf schemas installation      ${_ac_na_schemas_install}
-	Maintainer mode                 ${_ac_na_maintainer_mode}
-	HTML API Reference generation   ${_ac_na_gtk_html_doc}
-	PDF API Reference generation    ${_ac_na_gtk_pdf_doc}
-	HTML manuals generation         ${_ac_na_html_manuals}
-	PDF manuals generation          ${_ac_na_pdf_manuals}
+	GConf schemas installation      ${msg_schemas_install}
+	Maintainer mode                 ${msg_maintainer_mode}
+	HTML API Reference generation   ${msg_gtk_html_doc}
+	PDF API Reference generation    ${msg_gtk_pdf_doc}
+	HTML manuals generation         ${msg_html_manuals}
+	PDF manuals generation          ${msg_pdf_manuals}
 "
 #	Preprocessor flags              ${AM_CPPFLAGS}
 #	Compiler flags                  ${AM_CFLAGS} ${NAUTILUS_ACTIONS_CFLAGS}
diff --git a/m4/na-check-module.m4 b/m4/na-check-module.m4
new file mode 100644
index 0000000..8e12258
--- /dev/null
+++ b/m4/na-check-module.m4
@@ -0,0 +1,55 @@
+# Nautilus Actions
+# A Nautilus extension which offers configurable context menu actions.
+#
+# Copyright (C) 2005 The GNOME Foundation
+# Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+# Copyright (C) 2009, 2010 Pierre Wieser and others (see AUTHORS)
+#
+# This Program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This Program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this Library; see the file COPYING.  If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307, USA.
+#
+# Authors:
+#   Frederic Ruaudel <grumz grumz net>
+#   Rodrigo Moya <rodrigo gnome-db org>
+#   Pierre Wieser <pwieser trychlos org>
+#   ... and many others (see AUTHORS)
+
+# serial 1 creation
+
+dnl usage:  NA_CHECK_MODULE([var],[condition])
+dnl
+dnl this macro checks that gtk+-2.0 and gtk+-3.0 libraries are not mixed
+
+AC_DEFUN([NA_CHECK_MODULE],[
+	PKG_CHECK_MODULES([$1],[$2])
+	#echo "cflags='${$1_CFLAGS}'"
+	#echo "libs='${$1_LIBS}'"
+	if ! test -z "${$1_LIBS}"; then
+		if test "${have_gtk3}" = "yes"; then
+			if test "$(echo ${$1_LIBS} | grep gtk-x11-2.0)" != ""; then
+				AC_MSG_ERROR([$1: compiling with Gtk+-3 but adresses Gtk+-2 libraries])
+			fi
+		else
+			if test "$(echo ${$1_LIBS} | grep gtk-x11-3.0)" != ""; then
+				AC_MSG_ERROR([$1: compiling with Gtk+-2 but adresses Gtk+-3 libraries])
+			fi
+		fi
+				
+		NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} $1_CFLAGS"
+		NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} $1_LIBS"
+	else
+		AC_MSG_ERROR([condition $2 not satisfied])
+	fi
+])
diff --git a/m4/na-enable-manuals.m4 b/m4/na-enable-manuals.m4
index 2a061d1..dd3b67c 100644
--- a/m4/na-enable-manuals.m4
+++ b/m4/na-enable-manuals.m4
@@ -26,7 +26,7 @@
 #   Pierre Wieser <pwieser trychlos org>
 #   ... and many others (see AUTHORS)
 
-# serial 1 creation
+# serial 3 add 'msg_' prefixed messages
 
 dnl --enable-html-manuals[=gdt|db2html]
 dnl   generates HTML manuals for all locales
@@ -65,7 +65,7 @@ AC_DEFUN([_AC_ARG_NA_ENABLE_HTML_MANUALS],[
 
 AC_DEFUN([_CHECK_FOR_HTML_MANUALS],[
 	AC_MSG_CHECKING([whether to build HTML manuals])
-	_ac_na_html_manuals="disabled"
+	msg_html_manuals="disabled"
 	if test "x${enable_html_manuals}" = "xno"; then
 		AC_MSG_RESULT([no])
 	else
@@ -87,11 +87,11 @@ AC_DEFUN([_CHECK_FOR_HTML_MANUALS],[
 		if test "x${with_gdt}" = "xno" -a "x${with_db2html}" = "xno"; then
 			AC_MSG_ERROR([neither gnome-doc-tool not db2html have been found, unable to generate HTML manuals])
 		fi
-		_ac_na_html_manuals="enabled with"
+		msg_html_manuals="enabled with"
 		if test "x${with_gdt}" = "xno"; then
-			_ac_na_html_manuals="${_ac_na_html_manuals} db2html"
+			msg_html_manuals="${msg_html_manuals} db2html"
 		else
-			_ac_na_html_manuals="${_ac_na_html_manuals} gnome-doc-tool"
+			msg_html_manuals="${msg_html_manuals} gnome-doc-tool"
 		fi
 	fi
 
@@ -113,17 +113,17 @@ AC_DEFUN([_AC_ARG_NA_ENABLE_PDF_MANUALS],[
 
 AC_DEFUN([_CHECK_FOR_PDF_MANUALS],[
 	AC_MSG_CHECKING([whether to build PDF manuals])
-	_ac_na_pdf_manuals="disabled"
+	msg_pdf_manuals="disabled"
 	if test "x${enable_pdf_manuals}" = "xno"; then
 		AC_MSG_RESULT([no])
 	else
 		AC_MSG_RESULT([yes])
 		if test "x${enable_pdf_manuals}" = "xyes"; then
 			AC_CHECK_PROG([with_dblatex],[dblatex],[yes],[no])
-			_ac_na_pdf_manuals="enabled with dblatex"
+			msg_pdf_manuals="enabled with dblatex"
 		elif test "x${enable_pdf_manuals}" = "xdblatex"; then
 			AC_CHECK_PROG([with_dblatex],[dblatex],[yes],[no])
-			_ac_na_pdf_manuals="enabled with dblatex"
+			msg_pdf_manuals="enabled with dblatex"
 		else
 			AC_MSG_ERROR([${enable_pdf_manuals} is not a known tool, must be 'dblatex'])
 		fi
diff --git a/m4/na-maintainer-mode.m4 b/m4/na-maintainer-mode.m4
index fc50048..de7b959 100644
--- a/m4/na-maintainer-mode.m4
+++ b/m4/na-maintainer-mode.m4
@@ -26,17 +26,17 @@
 #   Pierre Wieser <pwieser trychlos org>
 #   ... and many others (see AUTHORS)
 
-# serial 2 change NACT_ prefix to NA_ (Nautilus Actions)
+# serial 3 prefix message with 'msg_'
 
 dnl define NA_MAINTAINER_MODE
 
 AC_DEFUN([NA_IS_MAINTAINER_MODE],[
-	_ac_na_maintainer_mode="disabled"
+	msg_maintainer_mode="disabled"
 
 	if test "${USE_MAINTAINER_MODE}" = "yes"; then
 		AC_DEFINE([NA_MAINTAINER_MODE],[1],[Define to 1 if we are in maintainer mode])
 		AC_SUBST([AM_CPPFLAGS],["${AM_CPPFLAGS} ${DISABLE_DEPRECATED} -DGSEAL_ENABLED"])
 		AC_SUBST([AM_CFLAGS],["${AM_CFLAGS} -Werror"])
-		_ac_na_maintainer_mode="enabled"
+		msg_maintainer_mode="enabled"
 	fi
 ])
diff --git a/run-autogen.sh b/run-autogen.sh
index 62e1939..704984b 100755
--- a/run-autogen.sh
+++ b/run-autogen.sh
@@ -5,13 +5,29 @@
 # so clean it here
 find . -maxdepth 1 -type d -name 'nautilus-actions-*' | xargs rm -fr
 
-exec ./autogen.sh \
-	--prefix=$(pwd)/install \
-	--with-nautilus-extdir=$(pwd)/install/lib/nautilus \
-	--enable-silent-rules \
-	--disable-schemas-install \
-	--enable-gtk-doc \
-	--enable-gtk-doc-pdf \
-	--disable-scrollkeeper \
-	--enable-html-manuals \
-	--enable-pdf-manuals
+#exec ./autogen.sh \
+#	--prefix=$(pwd)/install \
+#	--with-nautilus-extdir=$(pwd)/install/lib/nautilus \
+#	--enable-silent-rules \
+#	--disable-schemas-install \
+#	--enable-gtk-doc \
+#	--enable-gtk-doc-pdf \
+#	--disable-scrollkeeper \
+#	--enable-html-manuals \
+#	--enable-pdf-manuals
+
+# Build with Gtk+ 3 (actually a 2.97.x unstable version)
+# installed in ~/.local/jhbuild
+#
+# Note that building with Gtk 3.0 not only requires that we have a
+# Gtk+ 3 available library, but also that all our required libraries
+# only depend of Gtk+ 3.0. In our case, we have:
+# $ grep gtk+-2.0 /usr/lib/pkgconfig/*
+#   libnautilus-extension.pc:Requires: glib-2.0 gio-2.0 gtk+-2.0
+#   unique-1.0.pc:Requires: gtk+-2.0
+PKG_CONFIG_PATH=/home/pierre/.local/jhbuild/lib/pkgconfig \
+LD_LIBRARY_PATH=/home/pierre/.local/jhbuild/lib \
+	exec ./autogen.sh \
+		--prefix=/home/pierre/.local/jhbuild \
+		--with-nautilus-extdir=/home/pierre/.local/jhbuild/lib/nautilus \
+		--disable-schemas-install
diff --git a/src/core/na-importer-ask.c b/src/core/na-importer-ask.c
index e92bc44..c61b3c4 100644
--- a/src/core/na-importer-ask.c
+++ b/src/core/na-importer-ask.c
@@ -270,7 +270,7 @@ na_importer_ask_user( const NAObjectItem *importing, const NAObjectItem *existin
 
 		mode = dialog->private->mode;
 
-		gtk_widget_hide_all( GTK_WIDGET( dialog->private->toplevel ));
+		gtk_widget_hide( GTK_WIDGET( dialog->private->toplevel ));
 		gtk_widget_destroy( GTK_WIDGET( dialog->private->toplevel ));
 
 	} else {
diff --git a/src/nact/base-assistant.c b/src/nact/base-assistant.c
index f932e4c..70d6019 100644
--- a/src/nact/base-assistant.c
+++ b/src/nact/base-assistant.c
@@ -538,7 +538,7 @@ on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, BaseAssistant *assi
 
 	if( !assistant->private->dispose_has_run ){
 
-		if( event->keyval == GDK_Escape &&
+		if( event->keyval == GDK_KEY_Escape &&
 			assistant->private->cancel_on_escape ){
 
 				assistant->private->escape_key_pressed = TRUE;
diff --git a/src/nact/base-window.c b/src/nact/base-window.c
index 27d221c..979f91a 100644
--- a/src/nact/base-window.c
+++ b/src/nact/base-window.c
@@ -522,13 +522,13 @@ instance_dispose( GObject *window )
 			g_debug( "%s: quitting assistant", thisfn );
 			gtk_main_quit();
 			if( is_toplevel_initialized( self, self->private->toplevel_window )){
-				gtk_widget_hide_all( GTK_WIDGET( self->private->toplevel_window ));
+				gtk_widget_hide( GTK_WIDGET( self->private->toplevel_window ));
 			}
 
 		} else {
 			g_debug( "%s: quitting dialog", thisfn );
 			if( is_toplevel_initialized( self, self->private->toplevel_window )){
-				gtk_widget_hide_all( GTK_WIDGET( self->private->toplevel_window ));
+				gtk_widget_hide( GTK_WIDGET( self->private->toplevel_window ));
 			}
 		}
 
diff --git a/src/nact/nact-clipboard.c b/src/nact/nact-clipboard.c
index 76c18ed..2acc9e3 100644
--- a/src/nact/nact-clipboard.c
+++ b/src/nact/nact-clipboard.c
@@ -346,7 +346,11 @@ nact_clipboard_dnd_get_data( NactClipboard *clipboard, gboolean *copy_data )
 		selection = gtk_clipboard_wait_for_contents( clipboard->private->dnd, NACT_CLIPBOARD_NACT_ATOM );
 		if( selection ){
 
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+			data = ( NactClipboardDndData * ) gtk_selection_data_get_data( selection );
+#else
 			data = ( NactClipboardDndData * ) selection->data;
+#endif
 			if( data->target == NACT_XCHANGE_FORMAT_NACT ){
 
 				model = gtk_tree_row_reference_get_model(( GtkTreeRowReference * ) data->rows->data );
@@ -423,7 +427,11 @@ nact_clipboard_dnd_drag_end( NactClipboard *clipboard )
 		g_debug( "%s: selection=%p", thisfn, ( void * ) selection );
 
 		if( selection ){
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+			data = ( NactClipboardDndData * ) gtk_selection_data_get_data( selection );
+#else
 			data = ( NactClipboardDndData * ) selection->data;
+#endif
 			g_debug( "%s: data=%p (NactClipboardDndData)", thisfn, ( void * ) data );
 
 			if( data->target == NACT_XCHANGE_FORMAT_XDS ){
@@ -456,12 +464,20 @@ static void
 get_from_dnd_clipboard_callback( GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, guchar *data )
 {
 	static const gchar *thisfn = "nact_clipboard_get_from_dnd_clipboard_callback";
+	GdkAtom selection_data_target;
+
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+	selection_data_target = gtk_selection_data_get_target( selection_data );
+#else
+	selection_data_target = selection_data->target;
+#endif
 
 	g_debug( "%s: clipboard=%p, selection_data=%p, target=%s, info=%d, data=%p",
 			thisfn, ( void * ) clipboard,
-			( void * ) selection_data, gdk_atom_name( selection_data->target ), info, ( void * ) data );
+			( void * ) selection_data, gdk_atom_name( selection_data_target ), info, ( void * ) data );
 
-	gtk_selection_data_set( selection_data, selection_data->target, 8, data, sizeof( NactClipboardDndData ));
+	gtk_selection_data_set( selection_data,
+			selection_data_target, 8, data, sizeof( NactClipboardDndData ));
 }
 
 static void
@@ -707,7 +723,11 @@ nact_clipboard_primary_get( NactClipboard *clipboard, gboolean *relabel )
 		selection = gtk_clipboard_wait_for_contents( clipboard->private->primary, NACT_CLIPBOARD_NACT_ATOM );
 
 		if( selection ){
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+			user_data = ( PrimaryData * ) gtk_selection_data_get_data( selection );
+#else
 			user_data = ( PrimaryData * ) selection->data;
+#endif
 			g_debug( "%s: retrieving PrimaryData=%p", thisfn, ( void * ) user_data );
 
 			if( user_data ){
@@ -767,20 +787,29 @@ get_from_primary_clipboard_callback( GtkClipboard *gtk_clipboard, GtkSelectionDa
 	static const gchar *thisfn = "nact_clipboard_get_from_primary_clipboard_callback";
 	PrimaryData *user_data;
 	gchar *buffer;
+	GdkAtom selection_data_target;
+
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+	selection_data_target = gtk_selection_data_get_target( selection_data );
+#else
+	selection_data_target = selection_data->target;
+#endif
 
 	g_debug( "%s: gtk_clipboard=%p, selection_data=%p, target=%s, info=%d, clipboard=%p",
 			thisfn, ( void * ) gtk_clipboard,
-			( void * ) selection_data, gdk_atom_name( selection_data->target ), info, ( void * ) clipboard );
+			( void * ) selection_data, gdk_atom_name( selection_data_target ), info, ( void * ) clipboard );
 
 	user_data = clipboard->private->primary_data;
 
 	if( info == NACT_CLIPBOARD_FORMAT_TEXT_PLAIN ){
 		buffer = export_objects( clipboard, user_data->items );
-		gtk_selection_data_set( selection_data, selection_data->target, 8, ( const guchar * ) buffer, strlen( buffer ));
+		gtk_selection_data_set( selection_data,
+				selection_data_target, 8, ( const guchar * ) buffer, strlen( buffer ));
 		g_free( buffer );
 
 	} else {
-		gtk_selection_data_set( selection_data, selection_data->target, 8, ( const guchar * ) user_data, sizeof( PrimaryData ));
+		gtk_selection_data_set( selection_data,
+				selection_data_target, 8, ( const guchar * ) user_data, sizeof( PrimaryData ));
 	}
 }
 
diff --git a/src/nact/nact-gtk-utils.c b/src/nact/nact-gtk-utils.c
index 1c0ab1b..864a0d1 100644
--- a/src/nact/nact-gtk-utils.c
+++ b/src/nact/nact-gtk-utils.c
@@ -54,11 +54,19 @@
  * Try to set a visual indication of whether the @widget is editable or not.
  */
 void
-nact_gtk_utils_set_editable( GtkObject *widget, gboolean editable )
+nact_gtk_utils_set_editable( GtkWidget *widget, gboolean editable )
 {
 	GList *renderers, *irender;
 
+	/* GtkComboBoxEntry is deprecated from Gtk+3
+	 * see. http://git.gnome.org/browse/gtk+/commit/?id=9612c648176378bf237ad0e1a8c6c995b0ca7c61
+	 * while 'has_entry' property exists since 2.24
+	 */
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 24 ) || GTK_MAJOR_VERSION >= 3 )
+	if( gtk_combo_box_get_has_entry( GTK_COMBO_BOX( widget ))){
+#else
 	if( GTK_IS_COMBO_BOX_ENTRY( widget )){
+#endif
 		/* idem as GtkEntry */
 		gtk_editable_set_editable( GTK_EDITABLE( gtk_bin_get_child( GTK_BIN( widget ))), editable );
 		g_object_set( G_OBJECT( gtk_bin_get_child( GTK_BIN( widget ))), "can-focus", editable, NULL );
@@ -66,8 +74,8 @@ nact_gtk_utils_set_editable( GtkObject *widget, gboolean editable )
 		gtk_combo_box_set_button_sensitivity( GTK_COMBO_BOX( widget ), editable ? GTK_SENSITIVITY_ON : GTK_SENSITIVITY_OFF );
 
 	} else if( GTK_IS_COMBO_BOX( widget )){
-			/* disable the listbox button itself */
-			gtk_combo_box_set_button_sensitivity( GTK_COMBO_BOX( widget ), editable ? GTK_SENSITIVITY_ON : GTK_SENSITIVITY_OFF );
+		/* disable the listbox button itself */
+		gtk_combo_box_set_button_sensitivity( GTK_COMBO_BOX( widget ), editable ? GTK_SENSITIVITY_ON : GTK_SENSITIVITY_OFF );
 
 	} else if( GTK_IS_ENTRY( widget )){
 		gtk_editable_set_editable( GTK_EDITABLE( widget ), editable );
@@ -200,7 +208,15 @@ nact_gtk_utils_get_pixbuf( const gchar *name, GtkWidget *widget, GtkIconSize siz
 			}
 
 		} else {
+			/* gtk_widget_render_icon() is deprecated since Gtk+ 3.0
+			 * see http://library.gnome.org/devel/gtk/unstable/GtkWidget.html#gtk-widget-render-icon
+			 * and http://git.gnome.org/browse/gtk+/commit/?id=07eeae15825403037b7df139acf9bfa104d5559d
+			 */
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 91 ) || GTK_MAJOR_VERSION >= 3 )
+			pixbuf = gtk_widget_render_icon_pixbuf( widget, name, size );
+#else
 			pixbuf = gtk_widget_render_icon( widget, name, size, NULL );
+#endif
 		}
 	}
 
diff --git a/src/nact/nact-gtk-utils.h b/src/nact/nact-gtk-utils.h
index 8414f29..cd5f399 100644
--- a/src/nact/nact-gtk-utils.h
+++ b/src/nact/nact-gtk-utils.h
@@ -43,7 +43,7 @@
 
 G_BEGIN_DECLS
 
-void       nact_gtk_utils_set_editable( GtkObject *widget, gboolean editable );
+void       nact_gtk_utils_set_editable( GtkWidget *widget, gboolean editable );
 
 void       nact_gtk_utils_set_initial_state  ( GtkToggleButton *button, GCallback func );
 void       nact_gtk_utils_reset_initial_state( GtkToggleButton *button, GCallback func, void *data, gboolean active );
diff --git a/src/nact/nact-iaction-tab.c b/src/nact/nact-iaction-tab.c
index 0632f51..b1eab8b 100644
--- a/src/nact/nact-iaction-tab.c
+++ b/src/nact/nact-iaction-tab.c
@@ -95,7 +95,18 @@ static void          on_toolbar_label_changed( GtkEntry *entry, NactIActionTab *
 static void          toolbar_label_set_sensitive( NactIActionTab *instance, NAObjectItem *item );
 static void          on_tooltip_changed( GtkEntry *entry, NactIActionTab *instance );
 static GtkTreeModel *create_stock_icon_model( void );
-static void          icon_combo_list_fill( GtkComboBoxEntry* combo );
+
+/* GtkComboBoxEntry is deprecated from Gtk+3
+ * see. http://git.gnome.org/browse/gtk+/commit/?id=9612c648176378bf237ad0e1a8c6c995b0ca7c61
+ * while 'has_entry' property exists since 2.24
+ */
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 24 ) || GTK_MAJOR_VERSION >= 3 )
+static void          icon_combo_list_set_entry( GtkComboBox* combo );
+#else
+static void          icon_combo_list_set_entry( GtkComboBoxEntry* combo );
+#endif
+
+static void          icon_combo_list_set_layout( GtkComboBox* combo );
 static void          on_icon_browse( GtkButton *button, NactIActionTab *instance );
 static void          on_icon_changed( GtkEntry *entry, NactIActionTab *instance );
 static void          icon_preview_cb( GtkFileChooser *dialog, GtkWidget *preview );
@@ -189,9 +200,13 @@ nact_iaction_tab_initial_load_toplevel( NactIActionTab *instance )
 	GtkWidget *icon_widget;
 	GtkTreeModel *model;
 	GtkButton *button;
-	GtkRequisition requisition;
 	GtkFrame *frame;
 	gint size;
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 91 ) || GTK_MAJOR_VERSION >= 3 )
+	GtkRequisition minimal_size, natural_size;
+#else
+	GtkRequisition requisition;
+#endif
 
 	g_return_if_fail( NACT_IS_IACTION_TAB( instance ));
 
@@ -200,10 +215,15 @@ nact_iaction_tab_initial_load_toplevel( NactIActionTab *instance )
 		g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
 
 		button = GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconBrowseButton" ));
+		frame = GTK_FRAME( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconFrame" ));
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 91 ) || GTK_MAJOR_VERSION >= 3 )
+		gtk_widget_get_preferred_size( GTK_WIDGET( button ), &minimal_size, &natural_size );
+		size = MAX( minimal_size.height, natural_size.height ) - 4;
+#else
 		gtk_widget_size_request( GTK_WIDGET( button ), &requisition );
 		g_debug( "%s: button requisition width=%d, height=%d", thisfn, requisition.width, requisition.height );
-		frame = GTK_FRAME( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconFrame" ));
 		size = requisition.height - 4;
+#endif
 		gtk_widget_set_size_request( GTK_WIDGET( frame ), size, size );
 		gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
 
@@ -211,7 +231,14 @@ nact_iaction_tab_initial_load_toplevel( NactIActionTab *instance )
 		model = create_stock_icon_model();
 		gtk_combo_box_set_model( GTK_COMBO_BOX( icon_widget ), model );
 		g_object_unref( model );
-		icon_combo_list_fill( GTK_COMBO_BOX_ENTRY( icon_widget ));
+
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 24 ) || GTK_MAJOR_VERSION >= 3 )
+		icon_combo_list_set_entry( GTK_COMBO_BOX( icon_widget ));
+#else
+		icon_combo_list_set_entry( GTK_COMBO_BOX_ENTRY( icon_widget ));
+#endif
+
+		icon_combo_list_set_layout( GTK_COMBO_BOX( icon_widget ));
 	}
 }
 
@@ -430,12 +457,12 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
 		toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetSelectionButton" ));
 		gtk_toggle_button_set_active( toggle, target_selection || ( item && NA_IS_OBJECT_MENU( item )));
 		gtk_widget_set_sensitive( GTK_WIDGET( toggle ), item && NA_IS_OBJECT_ACTION( item ));
-		nact_gtk_utils_set_editable( GTK_OBJECT( toggle ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( toggle ), editable );
 
 		toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetLocationButton" ));
 		gtk_toggle_button_set_active( toggle, target_location || ( item && NA_IS_OBJECT_MENU( item )));
 		gtk_widget_set_sensitive( GTK_WIDGET( toggle ), item && NA_IS_OBJECT_ACTION( item ));
-		nact_gtk_utils_set_editable( GTK_OBJECT( toggle ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( toggle ), editable );
 
 		enable_label = target_selection || target_location || ( item && NA_IS_OBJECT_MENU( item ));
 		label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionMenuLabelEntry" );
@@ -447,25 +474,25 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
 		}
 		g_free( label );
 		gtk_widget_set_sensitive( label_widget, enable_label );
-		nact_gtk_utils_set_editable( GTK_OBJECT( label_widget ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( label_widget ), editable );
 
 		toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetToolbarButton" ));
 		gtk_toggle_button_set_active( toggle, target_toolbar );
 		gtk_widget_set_sensitive( GTK_WIDGET( toggle ), item && NA_IS_OBJECT_ACTION( item ));
-		nact_gtk_utils_set_editable( GTK_OBJECT( toggle ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( toggle ), editable );
 
 		toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ToolbarSameLabelButton" ));
 		same_label = item && NA_IS_OBJECT_ACTION( item ) ? na_object_is_toolbar_same_label( item ) : FALSE;
 		gtk_toggle_button_set_active( toggle, same_label );
 		gtk_widget_set_sensitive( GTK_WIDGET( toggle ), target_toolbar );
-		nact_gtk_utils_set_editable( GTK_OBJECT( toggle ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( toggle ), editable );
 
 		label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionToolbarLabelEntry" );
 		label = item && NA_IS_OBJECT_ACTION( item ) ? na_object_get_toolbar_label( item ) : g_strdup( "" );
 		gtk_entry_set_text( GTK_ENTRY( label_widget ), label );
 		g_free( label );
 		gtk_widget_set_sensitive( label_widget, target_toolbar && !same_label );
-		nact_gtk_utils_set_editable( GTK_OBJECT( label_widget ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( label_widget ), editable );
 
 		label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionToolbarLabelLabel" );
 		gtk_widget_set_sensitive( label_widget, target_toolbar && !same_label );
@@ -475,17 +502,17 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
 		tooltip = tooltip ? tooltip : g_strdup( "" );
 		gtk_entry_set_text( GTK_ENTRY( tooltip_widget ), tooltip );
 		g_free( tooltip );
-		nact_gtk_utils_set_editable( GTK_OBJECT( tooltip_widget ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( tooltip_widget ), editable );
 
 		icon_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionIconComboBoxEntry" );
 		icon = item ? na_object_get_icon( item ) : g_strdup( "" );
 		icon = icon ? icon : g_strdup( "" );
 		gtk_entry_set_text( GTK_ENTRY( gtk_bin_get_child( GTK_BIN( icon_widget ))), icon );
 		g_free( icon );
-		nact_gtk_utils_set_editable( GTK_OBJECT( icon_widget ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( icon_widget ), editable );
 
 		icon_button = GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconBrowseButton" ));
-		nact_gtk_utils_set_editable( GTK_OBJECT( icon_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( icon_button ), editable );
 
 		st_on_selection_change = FALSE;
 	}
@@ -629,11 +656,20 @@ static void
 set_label_label( NactIActionTab *instance, const gchar *color_str )
 {
 	GtkWidget *label;
-	GdkColor color;
 
 	label = base_window_get_widget( BASE_WINDOW( instance ), "ActionMenuLabelLabel" );
+
+	/* gtk_widget_modify_fg() is deprecated as of Gtk+ 3.0
+	 */
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 91 ) || GTK_MAJOR_VERSION >= 3 )
+	GdkRGBA color;
+	gdk_rgba_parse( &color, color_str );
+	gtk_widget_override_color( label, GTK_STATE_FLAG_ACTIVE, &color );
+#else
+	GdkColor color;
 	gdk_color_parse( color_str, &color );
 	gtk_widget_modify_fg( label, GTK_STATE_NORMAL, &color );
+#endif
 }
 
 static void
@@ -842,15 +878,29 @@ create_stock_icon_model( void )
 	return( GTK_TREE_MODEL( model ));
 }
 
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 24 ) || GTK_MAJOR_VERSION >= 3 )
 static void
-icon_combo_list_fill( GtkComboBoxEntry* combo )
+icon_combo_list_set_entry( GtkComboBox* combo )
+{
+	if( gtk_combo_box_get_entry_text_column( combo ) == -1 ){
+		gtk_combo_box_set_entry_text_column( combo, ICON_STOCK_COLUMN );
+	}
+}
+#else
+static void
+icon_combo_list_set_entry( GtkComboBoxEntry* combo )
 {
-	GtkCellRenderer *cell_renderer_pix;
-	GtkCellRenderer *cell_renderer_text;
-
 	if( gtk_combo_box_entry_get_text_column( combo ) == -1 ){
 		gtk_combo_box_entry_set_text_column( combo, ICON_STOCK_COLUMN );
 	}
+}
+#endif
+
+static void
+icon_combo_list_set_layout( GtkComboBox *combo )
+{
+	GtkCellRenderer *cell_renderer_pix;
+	GtkCellRenderer *cell_renderer_text;
 
 	gtk_cell_layout_clear( GTK_CELL_LAYOUT( combo ));
 
diff --git a/src/nact/nact-iactions-list.c b/src/nact/nact-iactions-list.c
index dcd069c..13a5a4c 100644
--- a/src/nact/nact-iactions-list.c
+++ b/src/nact/nact-iactions-list.c
@@ -1195,22 +1195,22 @@ on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, NactIActionsList *i
 	g_debug( "%s: widget=%p, event=%p, user_data=%p", thisfn, widget, event, user_data );*/
 	gboolean stop = FALSE;
 
-	if( event->keyval == GDK_Return || event->keyval == GDK_KP_Enter ){
+	if( event->keyval == GDK_KEY_Return || event->keyval == GDK_KEY_KP_Enter ){
 		nact_iactions_list_bis_toggle_collapse( instance );
 		stop = TRUE;
 	}
 
-	if( event->keyval == GDK_F2 ){
+	if( event->keyval == GDK_KEY_F2 ){
 		inline_edition( instance );
 		stop = TRUE;
 	}
 
-	if( event->keyval == GDK_Right ){
+	if( event->keyval == GDK_KEY_Right ){
 		nact_iactions_list_bis_expand_to_first_child( instance );
 		stop = TRUE;
 	}
 
-	if( event->keyval == GDK_Left ){
+	if( event->keyval == GDK_KEY_Left ){
 		nact_iactions_list_bis_collapse_to_parent( instance );
 		stop = TRUE;
 	}
diff --git a/src/nact/nact-ibasenames-tab.c b/src/nact/nact-ibasenames-tab.c
index 7436d7b..54cacf9 100644
--- a/src/nact/nact-ibasenames-tab.c
+++ b/src/nact/nact-ibasenames-tab.c
@@ -256,7 +256,7 @@ on_tab_updatable_selection_changed( BaseWindow *window, gint count_selected )
 		matchcase_button = GTK_TOGGLE_BUTTON( base_window_get_widget( window, "BasenamesMatchcaseButton" ));
 		matchcase = context ? na_object_get_matchcase( context ) : FALSE;
 		gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( matchcase_button ), matchcase );
-		nact_gtk_utils_set_editable( GTK_OBJECT( matchcase_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( matchcase_button ), editable );
 
 		st_on_selection_change = FALSE;
 	}
diff --git a/src/nact/nact-icommand-tab.c b/src/nact/nact-icommand-tab.c
index 1666699..99a0696 100644
--- a/src/nact/nact-icommand-tab.c
+++ b/src/nact/nact-icommand-tab.c
@@ -386,7 +386,7 @@ on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_select
 		gtk_entry_set_text( GTK_ENTRY( label_entry ), label );
 		g_free( label );
 		gtk_widget_set_sensitive( label_entry, profile != NULL );
-		nact_gtk_utils_set_editable( GTK_OBJECT( label_entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( label_entry ), editable );
 
 		path_entry = get_path_entry( instance );
 		path = profile ? na_object_get_path( profile ) : g_strdup( "" );
@@ -394,11 +394,11 @@ on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_select
 		gtk_entry_set_text( GTK_ENTRY( path_entry ), path );
 		g_free( path );
 		gtk_widget_set_sensitive( path_entry, profile != NULL );
-		nact_gtk_utils_set_editable( GTK_OBJECT( path_entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( path_entry ), editable );
 
 		path_button = get_path_button( instance );
 		gtk_widget_set_sensitive( GTK_WIDGET( path_button ), profile != NULL );
-		nact_gtk_utils_set_editable( GTK_OBJECT( path_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( path_button ), editable );
 
 		parameters_entry = get_parameters_entry( instance );
 		parameters = profile ? na_object_get_parameters( profile ) : g_strdup( "" );
@@ -406,7 +406,7 @@ on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_select
 		gtk_entry_set_text( GTK_ENTRY( parameters_entry ), parameters );
 		g_free( parameters );
 		gtk_widget_set_sensitive( parameters_entry, profile != NULL );
-		nact_gtk_utils_set_editable( GTK_OBJECT( parameters_entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( parameters_entry ), editable );
 
 		legend_button = get_legend_button( instance );
 		gtk_widget_set_sensitive( GTK_WIDGET( legend_button ), profile != NULL );
@@ -419,11 +419,11 @@ on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_select
 		gtk_entry_set_text( GTK_ENTRY( wdir_entry ), wdir );
 		g_free( wdir );
 		gtk_widget_set_sensitive( wdir_entry, profile != NULL );
-		nact_gtk_utils_set_editable( GTK_OBJECT( wdir_entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( wdir_entry ), editable );
 
 		wdir_button = GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "CommandWorkingDirectoryButton" ));
 		gtk_widget_set_sensitive( GTK_WIDGET( wdir_button ), profile != NULL );
-		nact_gtk_utils_set_editable( GTK_OBJECT( wdir_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( wdir_button ), editable );
 
 		st_on_selection_change = FALSE;
 	}
diff --git a/src/nact/nact-ienvironment-tab.c b/src/nact/nact-ienvironment-tab.c
index 85c8ff9..a745fdd 100644
--- a/src/nact/nact-ienvironment-tab.c
+++ b/src/nact/nact-ienvironment-tab.c
@@ -431,23 +431,23 @@ on_tab_updatable_selection_changed( NactIEnvironmentTab *instance, gint count_se
 		g_free( sel_count );
 
 		combo = base_window_get_widget( BASE_WINDOW( instance ), "SelectionCountSigneCombobox" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( combo ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( combo ), editable );
 
 		entry = base_window_get_widget( BASE_WINDOW( instance ), "SelectionCountNumberEntry" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( entry ), editable );
 
 		/* desktop environment
 		 */
 		raz_desktop_listview( instance );
 
 		always_button = base_window_get_widget( BASE_WINDOW( instance ), "ShowAlwaysButton" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( always_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( always_button ), editable );
 
 		show_button = base_window_get_widget( BASE_WINDOW( instance ), "OnlyShowButton" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( show_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( show_button ), editable );
 
 		notshow_button = base_window_get_widget( BASE_WINDOW( instance ), "DoNotShowButton" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( notshow_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( notshow_button ), editable );
 
 		desktops = context ? na_object_get_only_show_in( context ) : NULL;
 		listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( instance ), "EnvironmentsDesktopTreeView" ));
@@ -480,34 +480,34 @@ on_tab_updatable_selection_changed( NactIEnvironmentTab *instance, gint count_se
 		text = text && strlen( text ) ? text : g_strdup( "" );
 		gtk_entry_set_text( GTK_ENTRY( entry ), text );
 		g_free( text );
-		nact_gtk_utils_set_editable( GTK_OBJECT( entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( entry ), editable );
 
 		browse_button = base_window_get_widget( BASE_WINDOW( instance ), "TryExecButton" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( browse_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( browse_button ), editable );
 
 		entry = base_window_get_widget( BASE_WINDOW( instance ), "ShowIfRegisteredEntry" );
 		text = context ? na_object_get_show_if_registered( context ) : g_strdup( "" );
 		text = text && strlen( text ) ? text : g_strdup( "" );
 		gtk_entry_set_text( GTK_ENTRY( entry ), text );
 		g_free( text );
-		nact_gtk_utils_set_editable( GTK_OBJECT( entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( entry ), editable );
 
 		entry = base_window_get_widget( BASE_WINDOW( instance ), "ShowIfTrueEntry" );
 		text = context ? na_object_get_show_if_true( context ) : g_strdup( "" );
 		text = text && strlen( text ) ? text : g_strdup( "" );
 		gtk_entry_set_text( GTK_ENTRY( entry ), text );
 		g_free( text );
-		nact_gtk_utils_set_editable( GTK_OBJECT( entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( entry ), editable );
 
 		entry = base_window_get_widget( BASE_WINDOW( instance ), "ShowIfRunningEntry" );
 		text = context ? na_object_get_show_if_running( context ) : g_strdup( "" );
 		text = text && strlen( text ) ? text : g_strdup( "" );
 		gtk_entry_set_text( GTK_ENTRY( entry ), text );
 		g_free( text );
-		nact_gtk_utils_set_editable( GTK_OBJECT( entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( entry ), editable );
 
 		browse_button = base_window_get_widget( BASE_WINDOW( instance ), "ShowIfRunningButton" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( browse_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( browse_button ), editable );
 
 		st_on_selection_change = FALSE;
 
diff --git a/src/nact/nact-iexecution-tab.c b/src/nact/nact-iexecution-tab.c
index bf5fd81..b8d0550 100644
--- a/src/nact/nact-iexecution-tab.c
+++ b/src/nact/nact-iexecution-tab.c
@@ -293,16 +293,16 @@ on_tab_updatable_selection_changed( NactIExecutionTab *instance, gint count_sele
 		st_on_selection_change = TRUE;
 
 		normal_toggle = base_window_get_widget( BASE_WINDOW( instance ), "ExecutionModeNormal" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( normal_toggle ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( normal_toggle ), editable );
 
 		terminal_toggle = base_window_get_widget( BASE_WINDOW( instance ), "ExecutionModeTerminal" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( terminal_toggle ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( terminal_toggle ), editable );
 
 		embedded_toggle = base_window_get_widget( BASE_WINDOW( instance ), "ExecutionModeEmbedded" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( embedded_toggle ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( embedded_toggle ), editable );
 
 		display_toggle = base_window_get_widget( BASE_WINDOW( instance ), "ExecutionModeDisplayOutput" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( display_toggle ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( display_toggle ), editable );
 
 		mode = profile ? na_object_get_execution_mode( profile ) : g_strdup( "Normal" );
 		gtk_toggle_button_set_inconsistent( GTK_TOGGLE_BUTTON( normal_toggle ), profile == NULL );
@@ -327,19 +327,19 @@ on_tab_updatable_selection_changed( NactIExecutionTab *instance, gint count_sele
 
 		notify = profile ? na_object_get_startup_notify( profile ) : FALSE;
 		notify_check = base_window_get_widget( BASE_WINDOW( instance ), "StartupNotifyButton" );
-		nact_gtk_utils_set_editable( GTK_OBJECT( notify_check ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( notify_check ), editable );
 		gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( notify_check ), notify );
 
 		class = profile ? na_object_get_startup_class( profile ) : g_strdup( "" );
 		entry = base_window_get_widget( BASE_WINDOW( instance ), "StartupWMClassEntry" );
 		gtk_entry_set_text( GTK_ENTRY( entry ), class );
-		nact_gtk_utils_set_editable( GTK_OBJECT( entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( entry ), editable );
 		g_free( class );
 
 		user = profile ? na_object_get_execute_as( profile ) : g_strdup( "" );
 		entry = base_window_get_widget( BASE_WINDOW( instance ), "ExecuteAsEntry" );
 		gtk_entry_set_text( GTK_ENTRY( entry ), user );
-		nact_gtk_utils_set_editable( GTK_OBJECT( entry ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( entry ), editable );
 		g_free( user );
 
 		st_on_selection_change = FALSE;
diff --git a/src/nact/nact-ifolders-tab.c b/src/nact/nact-ifolders-tab.c
index 4db79ae..9a040e0 100644
--- a/src/nact/nact-ifolders-tab.c
+++ b/src/nact/nact-ifolders-tab.c
@@ -239,7 +239,7 @@ on_tab_updatable_selection_changed( NactIFoldersTab *instance, gint count_select
 
 	context = nact_main_tab_get_context( NACT_MAIN_WINDOW( instance ), &editable );
 	button = base_window_get_widget( BASE_WINDOW( instance ), "FolderBrowseButton" );
-	nact_gtk_utils_set_editable( GTK_OBJECT( button ), editable );
+	nact_gtk_utils_set_editable( GTK_WIDGET( button ), editable );
 }
 
 static void
diff --git a/src/nact/nact-iproperties-tab.c b/src/nact/nact-iproperties-tab.c
index cb440f7..05afbff 100644
--- a/src/nact/nact-iproperties-tab.c
+++ b/src/nact/nact-iproperties-tab.c
@@ -286,14 +286,14 @@ on_tab_updatable_selection_changed( NactIPropertiesTab *instance, gint count_sel
 		enabled_button = get_enabled_button( instance );
 		enabled_item = item ? na_object_is_enabled( NA_OBJECT_ITEM( item )) : FALSE;
 		gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( enabled_button ), enabled_item );
-		nact_gtk_utils_set_editable( GTK_OBJECT( enabled_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( enabled_button ), editable );
 
 		label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionDescriptionText" );
 		buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW( label_widget ));
 		label = item ? na_object_get_description( item ) : g_strdup( "" );
 		gtk_text_buffer_set_text( buffer, label, -1 );
 		g_free( label );
-		nact_gtk_utils_set_editable( GTK_OBJECT( label_widget ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( label_widget ), editable );
 
 		shortcut_button = base_window_get_widget( BASE_WINDOW( instance ), "SuggestedShortcutButton" );
 		shortcut = item ? na_object_get_shortcut( item ) : g_strdup( "" );
@@ -303,7 +303,7 @@ on_tab_updatable_selection_changed( NactIPropertiesTab *instance, gint count_sel
 		}
 		gtk_button_set_label( GTK_BUTTON( shortcut_button ), shortcut );
 		g_free( shortcut );
-		nact_gtk_utils_set_editable( GTK_OBJECT( shortcut_button ), editable );
+		nact_gtk_utils_set_editable( GTK_WIDGET( shortcut_button ), editable );
 
 		/* TODO: don't know how to edit a shortcut for now */
 		gtk_widget_set_sensitive( shortcut_button, FALSE );
@@ -313,7 +313,7 @@ on_tab_updatable_selection_changed( NactIPropertiesTab *instance, gint count_sel
 		 */
 		readonly_button = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionReadonlyButton" ));
 		gtk_toggle_button_set_active( readonly_button, item ? na_object_is_readonly( item ) : FALSE );
-		nact_gtk_utils_set_editable( GTK_OBJECT( readonly_button ), FALSE );
+		nact_gtk_utils_set_editable( GTK_WIDGET( readonly_button ), FALSE );
 
 		label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionItemID" );
 		label = item ? na_object_get_id( item ) : g_strdup( "" );
diff --git a/src/nact/nact-ischemes-tab.c b/src/nact/nact-ischemes-tab.c
index 6bc9755..5f75b8d 100644
--- a/src/nact/nact-ischemes-tab.c
+++ b/src/nact/nact-ischemes-tab.c
@@ -228,7 +228,7 @@ on_tab_updatable_selection_changed( BaseWindow *window, gint count_selected )
 
 	context = nact_main_tab_get_context( NACT_MAIN_WINDOW( window ), &editable );
 	button = base_window_get_widget( window, "AddFromDefaultButton" );
-	nact_gtk_utils_set_editable( GTK_OBJECT( button ), editable );
+	nact_gtk_utils_set_editable( GTK_WIDGET( button ), editable );
 }
 
 static void
diff --git a/src/nact/nact-main-statusbar.c b/src/nact/nact-main-statusbar.c
index 885d7a4..08db7a0 100644
--- a/src/nact/nact-main-statusbar.c
+++ b/src/nact/nact-main-statusbar.c
@@ -62,18 +62,28 @@ nact_main_statusbar_initial_load_toplevel( NactMainWindow *window )
 	static const gchar *thisfn = "nact_main_statusbar_initial_load_toplevel";
 	gint width, height;
 	GtkStatusbar *bar;
-	GtkRequisition requisition;
 	GtkFrame *frame;
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 91 ) || GTK_MAJOR_VERSION >= 3 )
+	GtkRequisition minimal_size, natural_size;
+#else
+	GtkRequisition requisition;
+#endif
 
 	g_debug( "%s: window=%p", thisfn, ( void * ) window );
 
 	gtk_icon_size_lookup( GTK_ICON_SIZE_MENU, &width, &height );
 
 	bar = get_statusbar( window );
+	frame = GTK_FRAME( base_window_get_widget( BASE_WINDOW( window ), "ActionLockedFrame" ));
+
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 91 ) || GTK_MAJOR_VERSION >= 3 )
+	gtk_widget_get_preferred_size( GTK_WIDGET( bar ), &minimal_size, &natural_size );
+	gtk_widget_set_size_request( GTK_WIDGET( bar ), natural_size.width, height+8 );
+#else
 	gtk_widget_size_request( GTK_WIDGET( bar ), &requisition );
 	gtk_widget_set_size_request( GTK_WIDGET( bar ), requisition.width, height+8 );
+#endif
 
-	frame = GTK_FRAME( base_window_get_widget( BASE_WINDOW( window ), "ActionLockedFrame" ));
 	gtk_widget_set_size_request( GTK_WIDGET( frame ), width+4, height+4 );
 	gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
 }
diff --git a/src/nact/nact-match-list.c b/src/nact/nact-match-list.c
index e8659c4..18585fd 100644
--- a/src/nact/nact-match-list.c
+++ b/src/nact/nact-match-list.c
@@ -351,10 +351,10 @@ nact_match_list_on_selection_changed( BaseWindow *window, const gchar *tab_name,
 	}
 
 	column = gtk_tree_view_get_column( data->listview, ITEM_COLUMN );
-	nact_gtk_utils_set_editable( GTK_OBJECT( column ), data->editable_item && data->editable_filter );
+	nact_gtk_utils_set_editable( GTK_WIDGET( column ), data->editable_item && data->editable_filter );
 
-	nact_gtk_utils_set_editable( GTK_OBJECT( data->addbutton ), data->editable_item );
-	nact_gtk_utils_set_editable( GTK_OBJECT( data->removebutton ), data->editable_item );
+	nact_gtk_utils_set_editable( GTK_WIDGET( data->addbutton ), data->editable_item );
+	nact_gtk_utils_set_editable( GTK_WIDGET( data->removebutton ), data->editable_item );
 	gtk_widget_set_sensitive( data->removebutton, FALSE );
 
 	st_on_selection_change = FALSE;
@@ -537,21 +537,21 @@ on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, MatchListStr *data
 
 	stop = FALSE;
 
-	if( event->keyval == GDK_F2 ){
+	if( event->keyval == GDK_KEY_F2 ){
 		if( data->editable_filter ){
 			edit_inline( data );
 			stop = TRUE;
 		}
 	}
 
-	if( event->keyval == GDK_Insert || event->keyval == GDK_KP_Insert ){
+	if( event->keyval == GDK_KEY_Insert || event->keyval == GDK_KEY_KP_Insert ){
 		if( data->editable_item ){
 			insert_new_row( data );
 			stop = TRUE;
 		}
 	}
 
-	if( event->keyval == GDK_Delete || event->keyval == GDK_KP_Delete ){
+	if( event->keyval == GDK_KEY_Delete || event->keyval == GDK_KEY_KP_Delete ){
 		if( data->editable_item ){
 			delete_current_row( data );
 			stop = TRUE;
diff --git a/src/nact/nact-schemes-list.c b/src/nact/nact-schemes-list.c
index f2a3189..9ce17b2 100644
--- a/src/nact/nact-schemes-list.c
+++ b/src/nact/nact-schemes-list.c
@@ -142,7 +142,7 @@ nact_schemes_list_create_model( GtkTreeView *treeview, guint mode )
 	gtk_tree_sortable_set_sort_column_id( GTK_TREE_SORTABLE( model ), SCHEMES_KEYWORD_COLUMN, GTK_SORT_ASCENDING );
 	gtk_tree_view_column_set_cell_data_func(
 			column, text_cell, ( GtkTreeCellDataFunc ) display_keyword, data, NULL );
-	nact_gtk_utils_set_editable( GTK_OBJECT( column ), mode == SCHEMES_LIST_FOR_PREFERENCES );
+	nact_gtk_utils_set_editable( GTK_WIDGET( column ), mode == SCHEMES_LIST_FOR_PREFERENCES );
 
 	text_cell = gtk_cell_renderer_text_new();
 	column = gtk_tree_view_column_new_with_attributes(
@@ -153,7 +153,7 @@ nact_schemes_list_create_model( GtkTreeView *treeview, guint mode )
 	gtk_tree_view_append_column( treeview, column );
 	gtk_tree_view_column_set_cell_data_func(
 			column, text_cell, ( GtkTreeCellDataFunc ) display_description, data, NULL );
-	nact_gtk_utils_set_editable( GTK_OBJECT( column ), mode == SCHEMES_LIST_FOR_PREFERENCES );
+	nact_gtk_utils_set_editable( GTK_WIDGET( column ), mode == SCHEMES_LIST_FOR_PREFERENCES );
 
 	gtk_tree_view_set_headers_visible( treeview, FALSE );
 
@@ -539,17 +539,17 @@ on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, BaseWindow *window
 
 	stop = FALSE;
 
-	if( event->keyval == GDK_F2 ){
+	if( event->keyval == GDK_KEY_F2 ){
 		edit_inline( window );
 		stop = TRUE;
 	}
 
-	if( event->keyval == GDK_Insert || event->keyval == GDK_KP_Insert ){
+	if( event->keyval == GDK_KEY_Insert || event->keyval == GDK_KEY_KP_Insert ){
 		insert_new_row( window );
 		stop = TRUE;
 	}
 
-	if( event->keyval == GDK_Delete || event->keyval == GDK_KP_Delete ){
+	if( event->keyval == GDK_KEY_Delete || event->keyval == GDK_KEY_KP_Delete ){
 		delete_row( window );
 		stop = TRUE;
 	}
diff --git a/src/nact/nact-tree-model-dnd.c b/src/nact/nact-tree-model-dnd.c
index 2bf439e..e52f96f 100644
--- a/src/nact/nact-tree-model-dnd.c
+++ b/src/nact/nact-tree-model-dnd.c
@@ -163,25 +163,52 @@ nact_tree_model_dnd_idrag_dest_drag_data_received( GtkTreeDragDest *drag_dest, G
 	gchar *atom_name;
 	guint info;
 	gchar *path_str;
+	GdkAtom selection_data_selection;
+	GdkAtom selection_data_target;
+	GdkAtom selection_data_type;
+	gint selection_data_format;
+	gint selection_data_length;
 
 	g_debug( "%s: drag_dest=%p, dest=%p, selection_data=%p", thisfn, ( void * ) drag_dest, ( void * ) dest, ( void * ) selection_data );
 	g_return_val_if_fail( NACT_IS_TREE_MODEL( drag_dest ), FALSE );
 
-	atom_name = gdk_atom_name( selection_data->selection );
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+	selection_data_selection = gtk_selection_data_get_selection( selection_data );
+#else
+	selection_data_selection = selection_data->selection;
+#endif
+	atom_name = gdk_atom_name( selection_data_selection );
 	g_debug( "%s: selection=%s", thisfn, atom_name );
 	g_free( atom_name );
 
-	atom_name = gdk_atom_name( selection_data->target );
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+	selection_data_target = gtk_selection_data_get_target( selection_data );
+#else
+	selection_data_target = selection_data->target;
+#endif
+	atom_name = gdk_atom_name( selection_data_target );
 	g_debug( "%s: target=%s", thisfn, atom_name );
 	g_free( atom_name );
 
-	atom_name = gdk_atom_name( selection_data->type );
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+	selection_data_type = gtk_selection_data_get_data_type( selection_data );
+#else
+	selection_data_type = selection_data->type;
+#endif
+	atom_name = gdk_atom_name( selection_data_type );
 	g_debug( "%s: type=%s", thisfn, atom_name );
 	g_free( atom_name );
 
-	g_debug( "%s: format=%d, length=%d", thisfn, selection_data->format, selection_data->length );
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+	selection_data_format = gtk_selection_data_get_format( selection_data );
+	selection_data_length = gtk_selection_data_get_length( selection_data );
+#else
+	selection_data_format = selection_data->format;
+	selection_data_length = selection_data->length;
+#endif
+	g_debug( "%s: format=%d, length=%d", thisfn, selection_data_format, selection_data_length );
 
-	info = target_atom_to_id( selection_data->type );
+	info = target_atom_to_id( selection_data_type );
 	g_debug( "%s: info=%u", thisfn, info );
 
 	path_str = gtk_tree_path_to_string( dest );
@@ -276,10 +303,28 @@ nact_tree_model_dnd_imulti_drag_source_drag_data_get( EggTreeMultiDragSource *dr
 	gchar *dest_folder, *folder;
 	gboolean is_writable;
 	gboolean copy_data;
+	GdkAtom selection_data_target;
+	GdkDragAction context_suggested_action;
+	GdkDragAction context_selected_action;
+
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+	selection_data_target = gtk_selection_data_get_target( selection_data );
+#else
+	selection_data_target = selection_data->target;
+#endif
+
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 22 ) || GTK_MAJOR_VERSION >= 3 )
+	context_suggested_action = gdk_drag_context_get_suggested_action( context );
+	context_selected_action = gdk_drag_context_get_selected_action( context );
+#else
+	context_suggested_action = context->suggested_action;
+	context_selected_action = context->action;
+#endif
 
-	atom_name = gdk_atom_name( selection_data->target );
+	atom_name = gdk_atom_name( selection_data_target );
 	g_debug( "%s: drag_source=%p, context=%p, action=%d, selection_data=%p, rows=%p, atom=%s",
-			thisfn, ( void * ) drag_source, ( void * ) context, ( int ) context->suggested_action, ( void * ) selection_data, ( void * ) rows,
+			thisfn, ( void * ) drag_source, ( void * ) context, ( int ) context_suggested_action,
+			( void * ) selection_data, ( void * ) rows,
 			atom_name );
 	g_free( atom_name );
 
@@ -294,8 +339,9 @@ nact_tree_model_dnd_imulti_drag_source_drag_data_get( EggTreeMultiDragSource *dr
 
 		switch( info ){
 			case NACT_XCHANGE_FORMAT_NACT:
-				copy_data = ( context->action == GDK_ACTION_COPY );
-				gtk_selection_data_set( selection_data, selection_data->target, 8, ( guchar * ) "", 0 );
+				copy_data = ( context_selected_action == GDK_ACTION_COPY );
+				gtk_selection_data_set( selection_data,
+						selection_data_target, 8, ( guchar * ) "", 0 );
 				nact_clipboard_dnd_set( model->private->clipboard, info, rows, NULL, copy_data );
 				ret = TRUE;
 				break;
@@ -311,7 +357,8 @@ nact_tree_model_dnd_imulti_drag_source_drag_data_get( EggTreeMultiDragSource *dr
 				 */
 				is_writable = na_core_utils_dir_is_writable_uri( dest_folder );
 				g_debug( "%s: dest_folder=%s, is_writable=%s", thisfn, dest_folder, is_writable ? "True":"False" );
-				gtk_selection_data_set( selection_data, selection_data->target, 8, ( guchar * )( is_writable ? "S" : "F" ), 1 );
+				gtk_selection_data_set( selection_data,
+						selection_data_target, 8, ( guchar * )( is_writable ? "S" : "F" ), 1 );
 
 				if( is_writable ){
 					nact_clipboard_dnd_set( model->private->clipboard, info, rows, dest_folder, TRUE );
@@ -325,7 +372,8 @@ nact_tree_model_dnd_imulti_drag_source_drag_data_get( EggTreeMultiDragSource *dr
 			case NACT_XCHANGE_FORMAT_APPLICATION_XML:
 			case NACT_XCHANGE_FORMAT_TEXT_PLAIN:
 				data = nact_clipboard_dnd_get_text( model->private->clipboard, rows );
-				gtk_selection_data_set( selection_data, selection_data->target, 8, ( guchar * ) data, strlen( data ));
+				gtk_selection_data_set( selection_data,
+						selection_data_target, 8, ( guchar * ) data, strlen( data ));
 				g_free( data );
 				ret = TRUE;
 				break;
@@ -436,6 +484,7 @@ nact_tree_model_dnd_on_drag_begin( GtkWidget *widget, GdkDragContext *context, B
 {
 	static const gchar *thisfn = "nact_tree_model_dnd_on_drag_begin";
 	NactTreeModel *model;
+	GdkWindow *context_source_window;
 
 	g_debug( "%s: widget=%p, context=%p, window=%p",
 			thisfn, ( void * ) widget, ( void * ) context, ( void * ) window );
@@ -450,8 +499,14 @@ nact_tree_model_dnd_on_drag_begin( GtkWidget *widget, GdkDragContext *context, B
 
 		nact_clipboard_dnd_clear( model->private->clipboard );
 
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 22 ) || GTK_MAJOR_VERSION >= 3 )
+		context_source_window = gdk_drag_context_get_source_window( context );
+#else
+		context_source_window = context->source_window;
+#endif
+
 		gdk_property_change(
-				context->source_window,
+				context_source_window,
 				XDS_ATOM, TEXT_ATOM, 8, GDK_PROP_MODE_REPLACE, ( guchar * ) XDS_FILENAME, strlen( XDS_FILENAME ));
 	}
 }
@@ -467,6 +522,7 @@ nact_tree_model_dnd_on_drag_end( GtkWidget *widget, GdkDragContext *context, Bas
 {
 	static const gchar *thisfn = "nact_tree_model_dnd_on_drag_end";
 	NactTreeModel *model;
+	GdkWindow *context_source_window;
 
 	g_debug( "%s: widget=%p, context=%p, window=%p",
 			thisfn, ( void * ) widget, ( void * ) context, ( void * ) window );
@@ -478,7 +534,14 @@ nact_tree_model_dnd_on_drag_end( GtkWidget *widget, GdkDragContext *context, Bas
 
 		nact_clipboard_dnd_drag_end( model->private->clipboard );
 		nact_clipboard_dnd_clear( model->private->clipboard );
-		gdk_property_delete( context->source_window, XDS_ATOM );
+
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 22 ) || GTK_MAJOR_VERSION >= 3 )
+		context_source_window = gdk_drag_context_get_source_window( context );
+#else
+		context_source_window = context->source_window;
+#endif
+
+		gdk_property_delete( context_source_window, XDS_ATOM );
 	}
 }
 
@@ -802,6 +865,7 @@ drop_uri_list( NactTreeModel *model, GtkTreePath *dest, GtkSelectionData  *selec
 	GString *str;
 	GSList *im;
 	GList *imported;
+	const gchar *selection_data_data;
 
 	gchar *dest_str = gtk_tree_path_to_string( dest );
 	g_debug( "%s: model=%p, dest=%p (%s), selection_data=%p",
@@ -819,10 +883,15 @@ drop_uri_list( NactTreeModel *model, GtkTreePath *dest, GtkSelectionData  *selec
 	updater = nact_application_get_updater( application );
 	main_window = NACT_MAIN_WINDOW( base_application_get_main_window( BASE_APPLICATION( application )));
 
-	g_debug( "%s", ( const gchar * ) selection_data->data );
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+	selection_data_data = ( const gchar * ) gtk_selection_data_get_data( selection_data );
+#else
+	selection_data_data = ( const gchar * ) selection_data->data;
+#endif
+	g_debug( "%s", selection_data_data );
 
 	parms.parent = base_window_get_toplevel( BASE_WINDOW( main_window ));
-	parms.uris = g_slist_reverse( na_core_utils_slist_from_split(( const gchar * ) selection_data->data, "\r\n" ));
+	parms.uris = g_slist_reverse( na_core_utils_slist_from_split( selection_data_data, "\r\n" ));
 
 	gconf = gconf_client_get_default();
 	parms.mode = na_iprefs_get_import_mode( gconf, IPREFS_IMPORT_ITEMS_IMPORT_MODE );
@@ -1023,11 +1092,18 @@ get_xds_atom_value( GdkDragContext *context )
 {
 	gchar *ret;
 	gint actual_length;
+	GdkWindow *context_source_window;
+
+#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 22 ) || GTK_MAJOR_VERSION >= 3 )
+		context_source_window = gdk_drag_context_get_source_window( context );
+#else
+		context_source_window = context->source_window;
+#endif
 
 	g_return_val_if_fail( context != NULL, NULL );
-	g_return_val_if_fail( context->source_window != NULL, NULL );
+	g_return_val_if_fail( context_source_window != NULL, NULL );
 
-	gdk_property_get( context->source_window,		/* a GdkWindow */
+	gdk_property_get( context_source_window,		/* a GdkWindow */
 						XDS_ATOM, 					/* the property to retrieve */
 						TEXT_ATOM,					/* the desired property type */
 						0, 							/* offset (in 4 bytes chunks) */



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