[gtk+] Add a default handler for drag_failed
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add a default handler for drag_failed
- Date: Wed, 22 Dec 2010 23:47:14 +0000 (UTC)
commit 9baf24f87e504363e8b313f2ec02d84f13c5e262
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Dec 22 18:46:29 2010 -0500
Add a default handler for drag_failed
And use it in notebook dnd.
gtk/gtknotebook.c | 10 +++-------
gtk/gtkwidget.c | 3 ++-
gtk/gtkwidget.h | 3 +++
3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index df0383d..062f337 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -371,8 +371,7 @@ static void gtk_notebook_drag_end (GtkWidget *widget,
GdkDragContext *context);
static gboolean gtk_notebook_drag_failed (GtkWidget *widget,
GdkDragContext *context,
- GtkDragResult result,
- gpointer data);
+ GtkDragResult result);
static gboolean gtk_notebook_drag_motion (GtkWidget *widget,
GdkDragContext *context,
gint x,
@@ -665,6 +664,7 @@ gtk_notebook_class_init (GtkNotebookClass *class)
widget_class->drag_drop = gtk_notebook_drag_drop;
widget_class->drag_data_get = gtk_notebook_drag_data_get;
widget_class->drag_data_received = gtk_notebook_drag_data_received;
+ widget_class->drag_failed = gtk_notebook_drag_failed;
widget_class->compute_expand = gtk_notebook_compute_expand;
container_class->add = gtk_notebook_add;
@@ -1202,9 +1202,6 @@ gtk_notebook_init (GtkNotebook *notebook)
notebook_targets, G_N_ELEMENTS (notebook_targets),
GDK_ACTION_MOVE);
- g_signal_connect (G_OBJECT (notebook), "drag-failed",
- G_CALLBACK (gtk_notebook_drag_failed), NULL);
-
gtk_drag_dest_set_track_motion (GTK_WIDGET (notebook), TRUE);
context = gtk_widget_get_style_context (GTK_WIDGET (notebook));
@@ -3588,8 +3585,7 @@ gtk_notebook_create_window (GtkNotebook *notebook,
static gboolean
gtk_notebook_drag_failed (GtkWidget *widget,
GdkDragContext *context,
- GtkDragResult result,
- gpointer data)
+ GtkDragResult result)
{
if (result == GTK_DRAG_RESULT_NO_TARGET)
{
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 87834ed..07f360c 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2455,7 +2455,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
g_signal_new (I_("drag-failed"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- 0, _gtk_boolean_handled_accumulator, NULL,
+ G_STRUCT_OFFSET (GtkWidgetClass, drag_failed),
+ _gtk_boolean_handled_accumulator, NULL,
_gtk_marshal_BOOLEAN__OBJECT_ENUM,
G_TYPE_BOOLEAN, 2,
GDK_TYPE_DRAG_CONTEXT,
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 54acc3d..a2d4d5b 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -375,6 +375,9 @@ struct _GtkWidgetClass
GtkSelectionData *selection_data,
guint info,
guint time_);
+ gboolean (* drag_failed) (GtkWidget *widget,
+ GdkDragContext *context,
+ GtkDragResult result);
/* Signals used only for keybindings */
gboolean (* popup_menu) (GtkWidget *widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]