Add gtk_drag_source_set/get_target_list(). (#127499, based on patch from

Mon Mar  1 19:30:25 2004  Owen Taylor  <otaylor@redhat.com>

        * 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.
This commit is contained in:
Owen Taylor 2004-03-02 00:45:33 +00:00 committed by Owen Taylor
parent 7002bb3e55
commit d52caae6d1
12 changed files with 144 additions and 6 deletions

View File

@ -1,3 +1,11 @@
Mon Mar 1 19:30:25 2004 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> Tue Mar 2 01:34:40 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtksettings.c: Remove the include of Xft.h, which is already * gtk/gtksettings.c: Remove the include of Xft.h, which is already

View File

@ -1,3 +1,11 @@
Mon Mar 1 19:30:25 2004 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> Tue Mar 2 01:34:40 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtksettings.c: Remove the include of Xft.h, which is already * gtk/gtksettings.c: Remove the include of Xft.h, which is already

View File

@ -1,3 +1,11 @@
Mon Mar 1 19:30:25 2004 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> Tue Mar 2 01:34:40 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtksettings.c: Remove the include of Xft.h, which is already * gtk/gtksettings.c: Remove the include of Xft.h, which is already

View File

@ -1,3 +1,11 @@
Mon Mar 1 19:30:25 2004 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> Tue Mar 2 01:34:40 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtksettings.c: Remove the include of Xft.h, which is already * gtk/gtksettings.c: Remove the include of Xft.h, which is already

View File

@ -1,3 +1,11 @@
Mon Mar 1 19:30:25 2004 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> Tue Mar 2 01:34:40 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtksettings.c: Remove the include of Xft.h, which is already * gtk/gtksettings.c: Remove the include of Xft.h, which is already

View File

@ -4829,6 +4829,8 @@ gtk_drag_source_set_icon
gtk_drag_source_set_icon_pixbuf gtk_drag_source_set_icon_pixbuf
gtk_drag_source_set_icon_stock gtk_drag_source_set_icon_stock
gtk_drag_source_unset gtk_drag_source_unset
gtk_drag_source_set_target_list
gtk_drag_source_get_target_list
</SECTION> </SECTION>

View File

@ -156,6 +156,11 @@ The #GtkEntry-struct struct contains only private data.
</para> </para>
<!-- ##### ARG GtkEntry:xalign ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_entry_new ##### --> <!-- ##### FUNCTION gtk_entry_new ##### -->
<para> <para>
Creates a new #GtkEntry widget. Creates a new #GtkEntry widget.
@ -353,6 +358,24 @@ use gtk_editable_set_editable() instead.
@Returns: @Returns:
<!-- ##### FUNCTION gtk_entry_set_alignment ##### -->
<para>
</para>
@entry:
@xalign:
<!-- ##### FUNCTION gtk_entry_get_alignment ##### -->
<para>
</para>
@entry:
@Returns:
<!-- ##### FUNCTION gtk_entry_get_layout ##### --> <!-- ##### FUNCTION gtk_entry_get_layout ##### -->
<para> <para>

View File

@ -209,6 +209,11 @@ types related to the text widget and how they work together.
</para> </para>
<!-- ##### ARG GtkTextView:error-underline-color ##### -->
<para>
</para>
<!-- ##### ENUM GtkTextWindowType ##### --> <!-- ##### ENUM GtkTextWindowType ##### -->
<para> <para>

View File

@ -490,6 +490,16 @@ Deprecated alias for gtk_window_set_position().
@Returns: @Returns:
<!-- ##### FUNCTION gtk_window_activate_key ##### -->
<para>
</para>
@window:
@event:
@Returns:
<!-- ##### FUNCTION gtk_window_get_focus ##### --> <!-- ##### FUNCTION gtk_window_get_focus ##### -->
<para> <para>

View File

@ -1006,9 +1006,10 @@ gtk_drag_dest_set_target_list (GtkWidget *widget,
site = g_object_get_data (G_OBJECT (widget), "gtk-drag-dest"); 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; 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 static void
gtk_drag_source_unset_icon (GtkDragSourceSite *site) gtk_drag_source_unset_icon (GtkDragSourceSite *site)
{ {

View File

@ -96,6 +96,10 @@ void gtk_drag_source_set (GtkWidget *widget,
void gtk_drag_source_unset (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, void gtk_drag_source_set_icon (GtkWidget *widget,
GdkColormap *colormap, GdkColormap *colormap,
GdkPixmap *pixmap, GdkPixmap *pixmap,

View File

@ -2591,10 +2591,8 @@ void create_labels (GtkWidget *widget)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Bidirection Label"); 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" 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"
"Hebrew \327\251\327\234\327\225\327\235"); "\342\200\217Hebrew \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);
gtk_container_add (GTK_CONTAINER (frame), label); gtk_container_add (GTK_CONTAINER (frame), label);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);