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
This commit is contained in:
Matthias Clasen 2007-04-28 15:34:39 +00:00 committed by Matthias Clasen
parent 2dcdcfe4df
commit 065d1560e6
5 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,9 @@
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:

View File

@ -1,3 +1,7 @@
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

View File

@ -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>

View File

@ -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;

View File

@ -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 */