[nautilus-actions] gtk_selection_data accessors: use GTK_CHECK_VERSION macro



commit c3fe370675878340b39dbaf8c05437977effe88c
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sun Jan 2 14:50:12 2011 +0100

    gtk_selection_data accessors: use GTK_CHECK_VERSION macro

 ChangeLog                      |    4 +++-
 src/nact/nact-clipboard.c      |   13 ++++++++-----
 src/nact/nact-tree-model-dnd.c |   15 +++++++++------
 3 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c8aa02f..f22093d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,7 +8,9 @@
 	* src/nact/egg-sm-client-xsmp.c: 
 	* src/nact/nact-add-capability-dialog.c:
 	* src/nact/nact-add-scheme-dialog.c:
-	* src/nact/nact-main-tab.c: Use GTK_CHECK_VERSION macro.
+	* src/nact/nact-main-tab.c:
+	* src/nact/nact-clipboard.c:
+	* src/nact/nact-tree-model-dnd.c: Use GTK_CHECK_VERSION macro.
 
 	* configure.ac:
 	* m4/na-check-for-gtk.m4:
diff --git a/src/nact/nact-clipboard.c b/src/nact/nact-clipboard.c
index 8ac70bd..ce4b345 100644
--- a/src/nact/nact-clipboard.c
+++ b/src/nact/nact-clipboard.c
@@ -346,7 +346,10 @@ 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 )
+/* gtk_selection_data_get_data() appears with Gtk+ 2.14.0 release on 2008-09-04
+ * see http://git.gnome.org/browse/gtk+/commit/?id=9eae7a1d2e7457d67ba00bb8c35775c1523fa186
+ */
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 			data = ( NactClipboardDndData * ) gtk_selection_data_get_data( selection );
 #else
 			data = ( NactClipboardDndData * ) selection->data;
@@ -427,7 +430,7 @@ 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 )
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 			data = ( NactClipboardDndData * ) gtk_selection_data_get_data( selection );
 #else
 			data = ( NactClipboardDndData * ) selection->data;
@@ -466,7 +469,7 @@ get_from_dnd_clipboard_callback( GtkClipboard *clipboard, GtkSelectionData *sele
 	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 )
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 	selection_data_target = gtk_selection_data_get_target( selection_data );
 #else
 	selection_data_target = selection_data->target;
@@ -723,7 +726,7 @@ 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 )
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 			user_data = ( PrimaryData * ) gtk_selection_data_get_data( selection );
 #else
 			user_data = ( PrimaryData * ) selection->data;
@@ -789,7 +792,7 @@ get_from_primary_clipboard_callback( GtkClipboard *gtk_clipboard, GtkSelectionDa
 	gchar *buffer;
 	GdkAtom selection_data_target;
 
-#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 	selection_data_target = gtk_selection_data_get_target( selection_data );
 #else
 	selection_data_target = selection_data->target;
diff --git a/src/nact/nact-tree-model-dnd.c b/src/nact/nact-tree-model-dnd.c
index f2337f8..70b1413 100644
--- a/src/nact/nact-tree-model-dnd.c
+++ b/src/nact/nact-tree-model-dnd.c
@@ -172,7 +172,10 @@ nact_tree_model_dnd_idrag_dest_drag_data_received( GtkTreeDragDest *drag_dest, G
 	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 );
 
-#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+/* gtk_selection_data_get_data() appears with Gtk+ 2.14.0 release on 2008-09-04
+ * see http://git.gnome.org/browse/gtk+/commit/?id=9eae7a1d2e7457d67ba00bb8c35775c1523fa186
+ */
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 	selection_data_selection = gtk_selection_data_get_selection( selection_data );
 #else
 	selection_data_selection = selection_data->selection;
@@ -181,7 +184,7 @@ nact_tree_model_dnd_idrag_dest_drag_data_received( GtkTreeDragDest *drag_dest, G
 	g_debug( "%s: selection=%s", thisfn, atom_name );
 	g_free( atom_name );
 
-#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 	selection_data_target = gtk_selection_data_get_target( selection_data );
 #else
 	selection_data_target = selection_data->target;
@@ -190,7 +193,7 @@ nact_tree_model_dnd_idrag_dest_drag_data_received( GtkTreeDragDest *drag_dest, G
 	g_debug( "%s: target=%s", thisfn, atom_name );
 	g_free( atom_name );
 
-#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 	selection_data_type = gtk_selection_data_get_data_type( selection_data );
 #else
 	selection_data_type = selection_data->type;
@@ -199,7 +202,7 @@ nact_tree_model_dnd_idrag_dest_drag_data_received( GtkTreeDragDest *drag_dest, G
 	g_debug( "%s: type=%s", thisfn, atom_name );
 	g_free( atom_name );
 
-#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 	selection_data_format = gtk_selection_data_get_format( selection_data );
 	selection_data_length = gtk_selection_data_get_length( selection_data );
 #else
@@ -307,7 +310,7 @@ nact_tree_model_dnd_imulti_drag_source_drag_data_get( EggTreeMultiDragSource *dr
 	GdkDragAction context_suggested_action;
 	GdkDragAction context_selected_action;
 
-#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 	selection_data_target = gtk_selection_data_get_target( selection_data );
 #else
 	selection_data_target = selection_data->target;
@@ -883,7 +886,7 @@ 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 )));
 
-#if(( GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 14 ) || GTK_MAJOR_VERSION >= 3 )
+#if GTK_CHECK_VERSION( 2, 14, 0 )
 	selection_data_data = ( const gchar * ) gtk_selection_data_get_data( selection_data );
 #else
 	selection_data_data = ( const gchar * ) selection_data->data;



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