Commit 065d1560 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Add GTK_TARGET_OTHER_{APP,WIDGET} to restrict drags within an

2007-04-28  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkdnd.[hc]: Add GTK_TARGET_OTHER_{APP,WIDGET} to
        restrict drags within an application/widget.  (#163141,
        Jorn Baayen)


svn path=/trunk/; revision=17676
parent 2dcdcfe4
2007-04-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkdnd.[hc]: Add GTK_TARGET_OTHER_{APP,WIDGET} to
restrict drags within an application/widget. (#163141,
Jorn Baayen)
2007-04-28 Matthias Clasen <mclasen@redhat.com>
* docs/tools/Makefile.am:
......
2007-04-28 Matthias Clasen <mclasen@redhat.com>
* gtk/tmpl/gtkdnd.sgml: Document GTK_TARGET_OTHER_*
2007-04-26 Matthias Clasen <mclasen@redhat.com>
* gtk/tmpl/gtkcomboboxentry.sgml: Mention that the entry
......
......@@ -69,6 +69,12 @@ constraints on an entry in a #GtkTargetTable.
@GTK_TARGET_SAME_WIDGET:
If this is set, the target will only be selected
for drags within a single widget.
@GTK_TARGET_OTHER_APP:
If this is set, the target will not be selected
for drags within a single application. Since 2.12
@GTK_TARGET_OTHER_WIDGET:
If this is set, the target will not be selected
for drags withing a single widget. Since 2.12
<!-- ##### FUNCTION gtk_drag_dest_set ##### -->
<para>
......
......@@ -1520,7 +1520,9 @@ gtk_drag_dest_find_target (GtkWidget *widget,
if (tmp_source->data == GUINT_TO_POINTER (pair->target))
{
if ((!(pair->flags & GTK_TARGET_SAME_APP) || source_widget) &&
(!(pair->flags & GTK_TARGET_SAME_WIDGET) || (source_widget == widget)))
(!(pair->flags & GTK_TARGET_SAME_WIDGET) || (source_widget == widget)) &&
(!(pair->flags & GTK_TARGET_OTHER_APP) || !source_widget) &&
(!(pair->flags & GTK_TARGET_OTHER_WIDGET) || (source_widget != widget)))
return pair->target;
else
break;
......
......@@ -46,7 +46,9 @@ typedef enum {
*/
typedef enum {
GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/
GTK_TARGET_SAME_WIDGET = 1 << 1 /*< nick=same-widget >*/
GTK_TARGET_SAME_WIDGET = 1 << 1, /*< nick=same-widget >*/
GTK_TARGET_OTHER_APP = 1 << 2, /*< nick=other-app >*/
GTK_TARGET_OTHER_WIDGET = 1 << 3 /*< nick=other-widget >*/
} GtkTargetFlags;
/* Destination side */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment