Document how to use info with text/image targets.

2004-10-22  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkdnd.c: Document how to use info with text/image
	targets.

	* gtk/gtkselection.h:
	* gtk/gtkselection.c (gtk_target_list_add_text_targets):
	(gtk_target_list_add_image_targets): Add info argument.

	* gtk/gtkcalendar.c (gtk_calendar_motion_notify):
	* gtk/gtkentry.c (gtk_entry_init):
	* gtk/gtktextview.c (gtk_text_view_init): Adjust all callers.
This commit is contained in:
Matthias Clasen 2004-10-22 17:27:06 +00:00 committed by Matthias Clasen
parent 85d52f75dd
commit 81229a1b0b
10 changed files with 93 additions and 25 deletions

View File

@ -1,3 +1,16 @@
2004-10-22 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkdnd.c: Document how to use info with text/image
targets.
* gtk/gtkselection.h:
* gtk/gtkselection.c (gtk_target_list_add_text_targets):
(gtk_target_list_add_image_targets): Add info argument.
* gtk/gtkcalendar.c (gtk_calendar_motion_notify):
* gtk/gtkentry.c (gtk_entry_init):
* gtk/gtktextview.c (gtk_text_view_init): Adjust all callers.
2004-10-22 Anders Carlsson <andersca@gnome.org>
* gtk/gtktexttag.c: (gtk_text_tag_get_property):

View File

@ -1,3 +1,16 @@
2004-10-22 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkdnd.c: Document how to use info with text/image
targets.
* gtk/gtkselection.h:
* gtk/gtkselection.c (gtk_target_list_add_text_targets):
(gtk_target_list_add_image_targets): Add info argument.
* gtk/gtkcalendar.c (gtk_calendar_motion_notify):
* gtk/gtkentry.c (gtk_entry_init):
* gtk/gtktextview.c (gtk_text_view_init): Adjust all callers.
2004-10-22 Anders Carlsson <andersca@gnome.org>
* gtk/gtktexttag.c: (gtk_text_tag_get_property):

View File

@ -1,3 +1,16 @@
2004-10-22 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkdnd.c: Document how to use info with text/image
targets.
* gtk/gtkselection.h:
* gtk/gtkselection.c (gtk_target_list_add_text_targets):
(gtk_target_list_add_image_targets): Add info argument.
* gtk/gtkcalendar.c (gtk_calendar_motion_notify):
* gtk/gtkentry.c (gtk_entry_init):
* gtk/gtktextview.c (gtk_text_view_init): Adjust all callers.
2004-10-22 Anders Carlsson <andersca@gnome.org>
* gtk/gtktexttag.c: (gtk_text_tag_get_property):

View File

@ -1,3 +1,16 @@
2004-10-22 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkdnd.c: Document how to use info with text/image
targets.
* gtk/gtkselection.h:
* gtk/gtkselection.c (gtk_target_list_add_text_targets):
(gtk_target_list_add_image_targets): Add info argument.
* gtk/gtkcalendar.c (gtk_calendar_motion_notify):
* gtk/gtkentry.c (gtk_entry_init):
* gtk/gtktextview.c (gtk_text_view_init): Adjust all callers.
2004-10-22 Anders Carlsson <andersca@gnome.org>
* gtk/gtktexttag.c: (gtk_text_tag_get_property):

View File

@ -2816,7 +2816,7 @@ gtk_calendar_motion_notify (GtkWidget *widget,
{
GdkDragContext *context;
GtkTargetList *target_list = gtk_target_list_new (NULL, 0);
gtk_target_list_add_text_targets (target_list);
gtk_target_list_add_text_targets (target_list, 0);
context = gtk_drag_begin (widget, target_list, GDK_ACTION_COPY,
1, (GdkEvent *)event);

View File

@ -1030,7 +1030,10 @@ gtk_drag_dest_set_target_list (GtkWidget *widget,
* @widget: a #GtkWidget that's a drag destination
*
* Add the text targets supported by #GtkSelection to
* the target list of the drag destination.
* the target list of the drag destination. The targets
* are added with @info = 0. If you need another value,
* use gtk_target_list_add_text_targets() and
* gtk_drag_dest_set_target_list().
*
* Since: 2.6
**/
@ -1044,7 +1047,7 @@ gtk_drag_dest_add_text_targets (GtkWidget *widget)
gtk_target_list_ref (target_list);
else
target_list = gtk_target_list_new (NULL, 0);
gtk_target_list_add_text_targets (target_list);
gtk_target_list_add_text_targets (target_list, 0);
gtk_drag_dest_set_target_list (widget, target_list);
gtk_target_list_unref (target_list);
}
@ -1054,7 +1057,10 @@ gtk_drag_dest_add_text_targets (GtkWidget *widget)
* @widget: a #GtkWidget that's a drag destination
*
* Add the image targets supported by #GtkSelection to
* the target list of the drag destination.
* the target list of the drag destination. The targets
* are added with @info = 0. If you need another value,
* use gtk_target_list_add_image_targets() and
* gtk_drag_dest_set_target_list().
*
* Since: 2.6
**/
@ -1068,7 +1074,7 @@ gtk_drag_dest_add_image_targets (GtkWidget *widget)
gtk_target_list_ref (target_list);
else
target_list = gtk_target_list_new (NULL, 0);
gtk_target_list_add_image_targets (target_list, FALSE);
gtk_target_list_add_image_targets (target_list, 0, FALSE);
gtk_drag_dest_set_target_list (widget, target_list);
gtk_target_list_unref (target_list);
}
@ -2221,7 +2227,10 @@ gtk_drag_source_set_target_list (GtkWidget *widget,
* @widget: a #GtkWidget that's is a drag source
*
* Add the text targets supported by #GtkSelection to
* the target list of the drag source.
* the target list of the drag source. The targets
* are added with @info = 0. If you need another value,
* use gtk_target_list_add_text_targets() and
* gtk_drag_dest_set_target_list().
*
* Since: 2.6
**/
@ -2235,7 +2244,7 @@ gtk_drag_source_add_text_targets (GtkWidget *widget)
gtk_target_list_ref (target_list);
else
target_list = gtk_target_list_new (NULL, 0);
gtk_target_list_add_text_targets (target_list);
gtk_target_list_add_text_targets (target_list, 0);
gtk_drag_source_set_target_list (widget, target_list);
gtk_target_list_unref (target_list);
}
@ -2245,7 +2254,10 @@ gtk_drag_source_add_text_targets (GtkWidget *widget)
* @widget: a #GtkWidget that's is a drag source
*
* Add the writable image targets supported by #GtkSelection to
* the target list of the drag source.
* the target list of the drag source. The targets
* are added with @info = 0. If you need another value,
* use gtk_target_list_add_text_targets() and
* gtk_drag_dest_set_target_list().
*
* Since: 2.6
**/
@ -2259,7 +2271,7 @@ gtk_drag_source_add_image_targets (GtkWidget *widget)
gtk_target_list_ref (target_list);
else
target_list = gtk_target_list_new (NULL, 0);
gtk_target_list_add_image_targets (target_list, TRUE);
gtk_target_list_add_image_targets (target_list, 0, TRUE);
gtk_drag_source_set_target_list (widget, target_list);
gtk_target_list_unref (target_list);
}

View File

@ -1684,7 +1684,7 @@ gtk_entry_motion_notify (GtkWidget *widget,
GtkTargetList *target_list = gtk_target_list_new (NULL, 0);
guint actions = entry->editable ? GDK_ACTION_COPY | GDK_ACTION_MOVE : GDK_ACTION_COPY;
gtk_target_list_add_text_targets (target_list);
gtk_target_list_add_text_targets (target_list, 0);
context = gtk_drag_begin (widget, target_list, actions,
entry->button, (GdkEvent *)event);

View File

@ -270,15 +270,16 @@ init_atoms (void)
/**
* gtk_target_list_add_text_targets:
* @list: a #GtkTargetList
* @info: an ID that will be passed back to the application
*
* Adds the text targets supported by #GtkSelection to
* the target list. The targets are added with both flags
* and info being zero.
* the target list. All targets are added with the same @info.
*
* Since: 2.6
**/
void
gtk_target_list_add_text_targets (GtkTargetList *list)
gtk_target_list_add_text_targets (GtkTargetList *list,
guint info)
{
g_return_if_fail (list != NULL);
@ -286,29 +287,30 @@ gtk_target_list_add_text_targets (GtkTargetList *list)
/* Keep in sync with gtk_selection_data_targets_include_text()
*/
gtk_target_list_add (list, utf8_atom, 0, 0);
gtk_target_list_add (list, ctext_atom, 0, 0);
gtk_target_list_add (list, text_atom, 0, 0);
gtk_target_list_add (list, GDK_TARGET_STRING, 0, 0);
gtk_target_list_add (list, text_plain_utf8_atom, 0, 0);
gtk_target_list_add (list, text_plain_locale_atom, 0, 0);
gtk_target_list_add (list, text_plain_atom, 0, 0);
gtk_target_list_add (list, utf8_atom, 0, info);
gtk_target_list_add (list, ctext_atom, 0, info);
gtk_target_list_add (list, text_atom, 0, info);
gtk_target_list_add (list, GDK_TARGET_STRING, 0, info);
gtk_target_list_add (list, text_plain_utf8_atom, 0, info);
gtk_target_list_add (list, text_plain_locale_atom, 0, info);
gtk_target_list_add (list, text_plain_atom, 0, info);
}
/**
* gtk_target_list_add_image_targets:
* @list: a #GtkTargetList
* @info: an ID that will be passed back to the application
* @writable: whether to add only targets for which GTK+ knows
* how to convert a pixbuf into the format
*
* Adds the image targets supported by #GtkSelection to
* the target list. The targets are added with both flags
* and info being zero.
* the target list. All targets are added with the same @info.
*
* Since: 2.6
**/
void
gtk_target_list_add_image_targets (GtkTargetList *list,
guint info,
gboolean writable)
{
GSList *formats, *f;
@ -330,7 +332,7 @@ gtk_target_list_add_image_targets (GtkTargetList *list,
for (m = mimes; *m; m++)
{
atom = gdk_atom_intern (*m, FALSE);
gtk_target_list_add (list, atom, 0, 0);
gtk_target_list_add (list, atom, 0, info);
}
g_strfreev (mimes);
}

View File

@ -95,8 +95,10 @@ void gtk_target_list_add (GtkTargetList *list,
GdkAtom target,
guint flags,
guint info);
void gtk_target_list_add_text_targets (GtkTargetList *list);
void gtk_target_list_add_text_targets (GtkTargetList *list,
guint info);
void gtk_target_list_add_image_targets (GtkTargetList *list,
guint info,
gboolean writable);
void gtk_target_list_add_table (GtkTargetList *list,
const GtkTargetEntry *targets,

View File

@ -5901,7 +5901,7 @@ gtk_text_view_start_selection_dnd (GtkTextView *text_view,
target_list = gtk_target_list_new (target_table,
G_N_ELEMENTS (target_table));
gtk_target_list_add_text_targets (target_list);
gtk_target_list_add_text_targets (target_list, 0);
context = gtk_drag_begin (GTK_WIDGET (text_view), target_list,
GDK_ACTION_COPY | GDK_ACTION_MOVE,