mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-15 06:40:08 +00:00
Add a GdkDrag::surface property
This commit is contained in:
parent
9cc3e2c8ef
commit
5ce3520a2a
@ -55,6 +55,7 @@ enum {
|
|||||||
PROP_FORMATS,
|
PROP_FORMATS,
|
||||||
PROP_SELECTED_ACTION,
|
PROP_SELECTED_ACTION,
|
||||||
PROP_ACTIONS,
|
PROP_ACTIONS,
|
||||||
|
PROP_SURFACE,
|
||||||
N_PROPERTIES
|
N_PROPERTIES
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -68,7 +69,7 @@ enum {
|
|||||||
typedef struct _GdkDragPrivate GdkDragPrivate;
|
typedef struct _GdkDragPrivate GdkDragPrivate;
|
||||||
|
|
||||||
struct _GdkDragPrivate {
|
struct _GdkDragPrivate {
|
||||||
GdkSurface *source_surface;
|
GdkSurface *surface;
|
||||||
|
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
GdkDevice *device;
|
GdkDevice *device;
|
||||||
@ -266,6 +267,11 @@ gdk_drag_set_property (GObject *gobject,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_SURFACE:
|
||||||
|
priv->surface = g_value_dup_object (value);
|
||||||
|
g_assert (priv->surface != NULL);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@ -307,6 +313,10 @@ gdk_drag_get_property (GObject *gobject,
|
|||||||
g_value_set_flags (value, priv->actions);
|
g_value_set_flags (value, priv->actions);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_SURFACE:
|
||||||
|
g_value_set_object (value, priv->surface);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@ -324,8 +334,7 @@ gdk_drag_finalize (GObject *object)
|
|||||||
g_clear_object (&priv->content);
|
g_clear_object (&priv->content);
|
||||||
g_clear_pointer (&priv->formats, gdk_content_formats_unref);
|
g_clear_pointer (&priv->formats, gdk_content_formats_unref);
|
||||||
|
|
||||||
if (priv->source_surface)
|
g_clear_object (&priv->surface);
|
||||||
g_object_unref (priv->source_surface);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (gdk_drag_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gdk_drag_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
@ -417,6 +426,17 @@ gdk_drag_class_init (GdkDragClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS |
|
G_PARAM_STATIC_STRINGS |
|
||||||
G_PARAM_EXPLICIT_NOTIFY);
|
G_PARAM_EXPLICIT_NOTIFY);
|
||||||
|
|
||||||
|
properties[PROP_SURFACE] =
|
||||||
|
g_param_spec_object ("surface",
|
||||||
|
"Surface",
|
||||||
|
"The surface where the drag originates",
|
||||||
|
GDK_TYPE_SURFACE,
|
||||||
|
G_PARAM_READWRITE |
|
||||||
|
G_PARAM_CONSTRUCT_ONLY |
|
||||||
|
G_PARAM_STATIC_STRINGS |
|
||||||
|
G_PARAM_EXPLICIT_NOTIFY);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GdkDrag::cancel:
|
* GdkDrag::cancel:
|
||||||
* @drag: The object on which the signal is emitted
|
* @drag: The object on which the signal is emitted
|
||||||
|
Loading…
Reference in New Issue
Block a user