diff --git a/ChangeLog b/ChangeLog index cd290511f1..65e5bc632b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Mar 1 19:30:25 2004 Owen Taylor + + * gtk/gtkdnd.[ch]: Add gtk_drag_source_set/get_target_list(). + (#127499, based on patch from Michael Natterer) + + * tests/testgtk.c: Fix bidi strings to display correctly + with new auto-bidi. + Tue Mar 2 01:34:40 2004 Matthias Clasen * gtk/gtksettings.c: Remove the include of Xft.h, which is already diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index cd290511f1..65e5bc632b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Mon Mar 1 19:30:25 2004 Owen Taylor + + * gtk/gtkdnd.[ch]: Add gtk_drag_source_set/get_target_list(). + (#127499, based on patch from Michael Natterer) + + * tests/testgtk.c: Fix bidi strings to display correctly + with new auto-bidi. + Tue Mar 2 01:34:40 2004 Matthias Clasen * gtk/gtksettings.c: Remove the include of Xft.h, which is already diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index cd290511f1..65e5bc632b 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Mon Mar 1 19:30:25 2004 Owen Taylor + + * gtk/gtkdnd.[ch]: Add gtk_drag_source_set/get_target_list(). + (#127499, based on patch from Michael Natterer) + + * tests/testgtk.c: Fix bidi strings to display correctly + with new auto-bidi. + Tue Mar 2 01:34:40 2004 Matthias Clasen * gtk/gtksettings.c: Remove the include of Xft.h, which is already diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index cd290511f1..65e5bc632b 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Mon Mar 1 19:30:25 2004 Owen Taylor + + * gtk/gtkdnd.[ch]: Add gtk_drag_source_set/get_target_list(). + (#127499, based on patch from Michael Natterer) + + * tests/testgtk.c: Fix bidi strings to display correctly + with new auto-bidi. + Tue Mar 2 01:34:40 2004 Matthias Clasen * gtk/gtksettings.c: Remove the include of Xft.h, which is already diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index cd290511f1..65e5bc632b 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Mon Mar 1 19:30:25 2004 Owen Taylor + + * gtk/gtkdnd.[ch]: Add gtk_drag_source_set/get_target_list(). + (#127499, based on patch from Michael Natterer) + + * tests/testgtk.c: Fix bidi strings to display correctly + with new auto-bidi. + Tue Mar 2 01:34:40 2004 Matthias Clasen * gtk/gtksettings.c: Remove the include of Xft.h, which is already diff --git a/docs/reference/gtk/gtk-sections.txt b/docs/reference/gtk/gtk-sections.txt index 597620d8b1..3bd2f8bd96 100644 --- a/docs/reference/gtk/gtk-sections.txt +++ b/docs/reference/gtk/gtk-sections.txt @@ -4829,6 +4829,8 @@ gtk_drag_source_set_icon gtk_drag_source_set_icon_pixbuf gtk_drag_source_set_icon_stock gtk_drag_source_unset +gtk_drag_source_set_target_list +gtk_drag_source_get_target_list diff --git a/docs/reference/gtk/tmpl/gtkentry.sgml b/docs/reference/gtk/tmpl/gtkentry.sgml index cfb42b5b02..92204167f8 100644 --- a/docs/reference/gtk/tmpl/gtkentry.sgml +++ b/docs/reference/gtk/tmpl/gtkentry.sgml @@ -156,6 +156,11 @@ The #GtkEntry-struct struct contains only private data. + + + + + Creates a new #GtkEntry widget. @@ -353,6 +358,24 @@ use gtk_editable_set_editable() instead. @Returns: + + + + + +@entry: +@xalign: + + + + + + + +@entry: +@Returns: + + diff --git a/docs/reference/gtk/tmpl/gtktextview.sgml b/docs/reference/gtk/tmpl/gtktextview.sgml index 40feb5fb13..bfbebedba5 100644 --- a/docs/reference/gtk/tmpl/gtktextview.sgml +++ b/docs/reference/gtk/tmpl/gtktextview.sgml @@ -209,6 +209,11 @@ types related to the text widget and how they work together. + + + + + diff --git a/docs/reference/gtk/tmpl/gtkwindow.sgml b/docs/reference/gtk/tmpl/gtkwindow.sgml index 3414d41555..124b86277b 100644 --- a/docs/reference/gtk/tmpl/gtkwindow.sgml +++ b/docs/reference/gtk/tmpl/gtkwindow.sgml @@ -490,6 +490,16 @@ Deprecated alias for gtk_window_set_position(). @Returns: + + + + + +@window: +@event: +@Returns: + + diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 7994635c3a..840cfcc30d 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -1006,9 +1006,10 @@ gtk_drag_dest_set_target_list (GtkWidget *widget, site = g_object_get_data (G_OBJECT (widget), "gtk-drag-dest"); - if (site == NULL) + if (!site) { - g_warning ("can't set a target list on a widget until you've called gtk_drag_dest_set() to make the widget into a drag destination"); + g_warning ("Can't set a target list on a widget until you've called gtk_drag_dest_set() " + "to make the widget into a drag destination"); return; } @@ -2099,6 +2100,61 @@ gtk_drag_source_unset (GtkWidget *widget) } } +/** + * gtk_drag_source_get_target_list: + * @widget: a #GtkWidget + * + * Gets the list of targets this widget can provide for + * drag-and-drop. + * + * Return value: the #GtkTargetList, or %NULL if none + **/ +GtkTargetList * +gtk_drag_source_get_target_list (GtkWidget *widget) +{ + GtkDragSourceSite *site; + + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); + + site = g_object_get_data (G_OBJECT (widget), "gtk-site-data"); + + return site ? site->target_list : NULL; +} + +/** + * gtk_drag_source_set_target_list: + * @widget: a #GtkWidget that's a drag source + * @target_list: list of draggable targets, or %NULL for none + * + * Changes the target types that this widget offers for drag-and-drop. + * The widget must first be made into a drag source with + * gtk_drag_source_set(). + **/ +void +gtk_drag_source_set_target_list (GtkWidget *widget, + GtkTargetList *target_list) +{ + GtkDragSourceSite *site; + + g_return_if_fail (GTK_IS_WIDGET (widget)); + + site = g_object_get_data (G_OBJECT (widget), "gtk-site-data"); + if (site == NULL) + { + g_warning ("gtk_drag_source_set_target_list() requires the widget " + "to already be a drag source."); + return; + } + + if (target_list) + gtk_target_list_ref (target_list); + + if (site->target_list) + gtk_target_list_unref (site->target_list); + + site->target_list = target_list; +} + static void gtk_drag_source_unset_icon (GtkDragSourceSite *site) { diff --git a/gtk/gtkdnd.h b/gtk/gtkdnd.h index c392442a9e..1c8456772b 100644 --- a/gtk/gtkdnd.h +++ b/gtk/gtkdnd.h @@ -96,6 +96,10 @@ void gtk_drag_source_set (GtkWidget *widget, void gtk_drag_source_unset (GtkWidget *widget); +GtkTargetList* gtk_drag_source_get_target_list (GtkWidget *widget); +void gtk_drag_source_set_target_list (GtkWidget *widget, + GtkTargetList *target_list); + void gtk_drag_source_set_icon (GtkWidget *widget, GdkColormap *colormap, GdkPixmap *pixmap, diff --git a/tests/testgtk.c b/tests/testgtk.c index 8358d47d6d..6f30fe94f8 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -2591,10 +2591,8 @@ void create_labels (GtkWidget *widget) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); frame = gtk_frame_new ("Bidirection Label"); - label = gtk_label_new ("Arabic \330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205\n" - "Hebrew \327\251\327\234\327\225\327\235"); - gtk_widget_set_direction (label, GTK_TEXT_DIR_RTL); - gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT); + label = gtk_label_new ("\342\200\217Arabic \330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205\n" + "\342\200\217Hebrew \327\251\327\234\327\225\327\235"); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);