diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-01-17 23:11:19 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-01-17 23:11:19 +0800 |
commit | 569e29360fb99c0bb165066a034a2f68c7038d8c (patch) | |
tree | 1edad4be385b4e2e9e64e8409e77376dc861f0d0 | |
parent | 8f0f48283e2c7873e5de2ca76de851a0c880c52e (diff) | |
download | gsoc2013-evolution-569e29360fb99c0bb165066a034a2f68c7038d8c.tar gsoc2013-evolution-569e29360fb99c0bb165066a034a2f68c7038d8c.tar.gz gsoc2013-evolution-569e29360fb99c0bb165066a034a2f68c7038d8c.tar.bz2 gsoc2013-evolution-569e29360fb99c0bb165066a034a2f68c7038d8c.tar.lz gsoc2013-evolution-569e29360fb99c0bb165066a034a2f68c7038d8c.tar.xz gsoc2013-evolution-569e29360fb99c0bb165066a034a2f68c7038d8c.tar.zst gsoc2013-evolution-569e29360fb99c0bb165066a034a2f68c7038d8c.zip |
Some little more DnD work.
svn path=/trunk/; revision=7577
-rw-r--r-- | shell/ChangeLog | 21 | ||||
-rw-r--r-- | shell/e-storage-set-view.c | 82 | ||||
-rw-r--r-- | shell/e-storage-set-view.h | 2 |
3 files changed, 73 insertions, 32 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 094e0dd380..19b9d139ff 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,24 @@ +2001-01-17 Ettore Perazzoli <ettore@ximian.com> + + * e-storage-set-view.c (table_drag_drop): Don't emit the + "dnd_action" signal here. Instead, do a `gtk_drag_get_data()' to + retrieve information about the drop. + (table_drag_data_received): New, implementation for + `ETable::table_drag_data_received'. + (class_init): Install it. + (table_drag_data_get): Use `unsigned int' instead of `guint' for + consistency. + (table_drag_motion): Same here. Also use `int' instead of `gint'. + (table_drag_drop): Likewise. + (treepath_compare): Likewise. + (marshal_NONE__ENUM_STRING_STRING_STRING): Removed. + (marshal_NONE__GDKDRAGACTION_STRING_STRING_STRING): New. + (class_init): Use it; update signal "dnd_action" so that it passes + a `GdkDragAction *' instead of . + + * e-storage-set-view.h: Change signal "::dnd_action" so that it + provides a `GdkDragContext' instead of just a `GdkDragAction'. + 2001-01-16 Michael Meeks <michael@helixcode.com> * e-shell-view.c (e_shell_view_construct): set config diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index 9d703216ca..32c55b279a 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -81,7 +81,7 @@ enum { LAST_SIGNAL }; -static guint signals[LAST_SIGNAL] = { 0 }; +static unsigned int signals[LAST_SIGNAL] = { 0 }; /* DND stuff. */ @@ -222,20 +222,23 @@ get_pixbuf_for_folder (EStorageSetView *storage_set_view, /* Custom marshalling function. */ -typedef void (* GtkSignal_NONE__ENUM_STRING_STRING_STRING) (GtkObject *object, - int, const char *, const char *, const char *); +typedef void (* GtkSignal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING) (GtkObject *object, + GdkDragContext *action, + const char *, + const char *, + const char *); static void -marshal_NONE__ENUM_STRING_STRING_STRING (GtkObject *object, - GtkSignalFunc func, - void *func_data, - GtkArg *args) +marshal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING (GtkObject *object, + GtkSignalFunc func, + void *func_data, + GtkArg *args) { - GtkSignal_NONE__ENUM_STRING_STRING_STRING rfunc; + GtkSignal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING rfunc; - rfunc = (GtkSignal_NONE__ENUM_STRING_STRING_STRING) func; + rfunc = (GtkSignal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING) func; (* rfunc) (object, - GTK_VALUE_ENUM (args[0]), + GTK_VALUE_POINTER (args[0]), GTK_VALUE_STRING (args[1]), GTK_VALUE_STRING (args[2]), GTK_VALUE_STRING (args[3])); @@ -454,7 +457,7 @@ table_drag_data_get (ETable *etable, int drag_col, GdkDragContext *context, GtkSelectionData *selection_data, - guint info, + unsigned int info, guint32 time) { EStorageSetView *storage_set_view; @@ -478,9 +481,9 @@ table_drag_motion (ETable *table, int row, int col, GdkDragContext *context, - gint x, - gint y, - guint time) + int x, + int y, + unsigned int time) { gdk_drag_status (context, GDK_ACTION_MOVE, time); @@ -492,9 +495,30 @@ table_drag_drop (ETable *etable, int row, int col, GdkDragContext *context, - gint x, - gint y, - guint time) + int x, + int y, + unsigned int time) +{ + if (context->targets != NULL) { + gtk_drag_get_data (GTK_WIDGET (etable), context, + GPOINTER_TO_INT (context->targets->data), + time); + return TRUE; + } + + return FALSE; +} + +static void +table_drag_data_received (ETable *etable, + int row, + int col, + GdkDragContext *context, + int x, + int y, + GtkSelectionData *selection_data, + unsigned int info, + unsigned int time) { EStorageSetView *storage_set_view; EStorageSetViewPrivate *priv; @@ -506,11 +530,6 @@ table_drag_drop (ETable *etable, target_tree_path = e_tree_model_node_at_row (priv->etree_model, row); target_path = e_tree_model_node_get_data (priv->etree_model, target_tree_path); - - gtk_signal_emit (GTK_OBJECT (etable), signals[DND_ACTION], - context->action, NULL, NULL, NULL); - - return TRUE; } static gboolean @@ -688,7 +707,7 @@ etree_is_editable (ETreeModel *etree, ETreePath *path, int col, void *model_data /* StorageSet signal handling. */ -static gint +static int treepath_compare (ETreeModel *model, ETreePath *node1, ETreePath *node2) @@ -852,12 +871,13 @@ class_init (EStorageSetViewClass *klass) object_class->destroy = destroy; etable_class = E_TABLE_CLASS (klass); - etable_class->right_click = right_click; - etable_class->cursor_change = cursor_change; - etable_class->table_drag_begin = table_drag_begin; - etable_class->table_drag_data_get = table_drag_data_get; - etable_class->table_drag_motion = table_drag_motion; - etable_class->table_drag_drop = table_drag_drop; + etable_class->right_click = right_click; + etable_class->cursor_change = cursor_change; + etable_class->table_drag_begin = table_drag_begin; + etable_class->table_drag_data_get = table_drag_data_get; + etable_class->table_drag_motion = table_drag_motion; + etable_class->table_drag_drop = table_drag_drop; + etable_class->table_drag_data_received = table_drag_data_received; signals[FOLDER_SELECTED] = gtk_signal_new ("folder_selected", @@ -882,9 +902,9 @@ class_init (EStorageSetViewClass *klass) GTK_RUN_FIRST, object_class->type, GTK_SIGNAL_OFFSET (EStorageSetViewClass, dnd_action), - marshal_NONE__ENUM_STRING_STRING_STRING, + marshal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING, GTK_TYPE_NONE, 4, - GTK_TYPE_ENUM, + GTK_TYPE_GDK_DRAG_CONTEXT, GTK_TYPE_STRING, GTK_TYPE_STRING, GTK_TYPE_STRING); diff --git a/shell/e-storage-set-view.h b/shell/e-storage-set-view.h index 92c9c84167..1d0483b0fa 100644 --- a/shell/e-storage-set-view.h +++ b/shell/e-storage-set-view.h @@ -64,7 +64,7 @@ struct _EStorageSetViewClass { const char *name); void (* dnd_action) (EStorageSetView *storage_set_view, - GdkDragAction action, + GdkDragContext *context, const char *source_data, const char *source_data_type, const char *target_path); |