1 /* eggtreednd.h 2 * Copyright (C) 2001 Red Hat, Inc. 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public 15 * License along with this library; if not, write to the 16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 * Boston, MA 02111-1307, USA. 18 * 19 * Adapted by Pierre Wieser for the needs of Nautilus-Actions 20 */ 21 22 #ifndef __EGG_TREE_MULTI_DND_H__ 23 #define __EGG_TREE_MULTI_DND_H__ 24 25 #include <gtk/gtk.h> 26 27 G_BEGIN_DECLS 28 29 #define EGG_TYPE_TREE_MULTI_DRAG_SOURCE ( egg_tree_multi_drag_source_get_type()) 30 #define EGG_TREE_MULTI_DRAG_SOURCE( object ) ( G_TYPE_CHECK_INSTANCE_CAST(( object ), EGG_TYPE_TREE_MULTI_DRAG_SOURCE, EggTreeMultiDragSource )) 31 #define EGG_IS_TREE_MULTI_DRAG_SOURCE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE(( object ), EGG_TYPE_TREE_MULTI_DRAG_SOURCE )) 32 #define EGG_TREE_MULTI_DRAG_SOURCE_GET_IFACE( object ) ( G_TYPE_INSTANCE_GET_INTERFACE(( object ), EGG_TYPE_TREE_MULTI_DRAG_SOURCE, EggTreeMultiDragSourceIface )) 33 34 typedef struct EggTreeMultiDragSource EggTreeMultiDragSource; 35 typedef struct EggTreeMultiDragSourceIface EggTreeMultiDragSourceIface; 36 37 struct EggTreeMultiDragSourceIface 38 { 39 GTypeInterface g_iface; 40 41 /* vtable - not signals */ 42 gboolean ( *row_draggable ) ( EggTreeMultiDragSource *drag_source, GList *path_list ); 43 gboolean ( *drag_data_get ) ( EggTreeMultiDragSource *drag_source, GdkDragContext *context, GtkSelectionData *selection_data, GList *path_list, guint info ); 44 gboolean ( *drag_data_delete )( EggTreeMultiDragSource *drag_source, GList *path_list ); 45 GtkTargetList * ( *get_target_list ) ( EggTreeMultiDragSource *drag_source ); 46 void ( *free_target_list )( EggTreeMultiDragSource *drag_source, GtkTargetList *list ); 47 GdkDragAction ( *get_drag_actions )( EggTreeMultiDragSource *drag_source ); 48 }; 49 50 GType egg_tree_multi_drag_source_get_type( void ) G_GNUC_CONST; 51 52 /* initialize drag support on the treeview */ 53 void egg_tree_multi_drag_add_drag_support( EggTreeMultiDragSource *drag_source, GtkTreeView *tree_view ); 54 55 /* returns whether the given row can be dragged */ 56 gboolean egg_tree_multi_drag_source_row_draggable( EggTreeMultiDragSource *drag_source, GList *path_list ); 57 58 /* Fills in selection_data with type selection_data->target based on the row 59 * denoted by path, returns TRUE if it does anything 60 */ 61 gboolean egg_tree_multi_drag_source_drag_data_get( EggTreeMultiDragSource *drag_source, GdkDragContext *context, GtkSelectionData *selection_data, GList *path_list, guint info ); 62 63 /* deletes the given row, or returns FALSE if it can't */ 64 gboolean egg_tree_multi_drag_source_drag_data_delete( EggTreeMultiDragSource *drag_source, GList *path_list ); 65 66 G_END_DECLS 67 68 #endif /* __EGG_TREE_MULTI_DND_H__ */ 69