mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
rename gtk_selection_data_set_tree_row, #60218
Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename gtk_selection_data_set_tree_row, #60218 (gtk_tree_get_row_drag_data): rename gtk_selection_data_get_tree_row, #60218 * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually get this right, after the third try, #63122.
This commit is contained in:
parent
f2f7090a62
commit
d7a97b9728
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename
|
||||
gtk_selection_data_set_tree_row, #60218
|
||||
(gtk_tree_get_row_drag_data): rename
|
||||
gtk_selection_data_get_tree_row, #60218
|
||||
|
||||
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually
|
||||
get this right, after the third try, #63122.
|
||||
|
||||
2001-10-31 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* gdk/gdkselection.h (GDK_TARGET_STRING):
|
||||
|
@ -1,3 +1,13 @@
|
||||
Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename
|
||||
gtk_selection_data_set_tree_row, #60218
|
||||
(gtk_tree_get_row_drag_data): rename
|
||||
gtk_selection_data_get_tree_row, #60218
|
||||
|
||||
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually
|
||||
get this right, after the third try, #63122.
|
||||
|
||||
2001-10-31 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* gdk/gdkselection.h (GDK_TARGET_STRING):
|
||||
|
@ -1,3 +1,13 @@
|
||||
Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename
|
||||
gtk_selection_data_set_tree_row, #60218
|
||||
(gtk_tree_get_row_drag_data): rename
|
||||
gtk_selection_data_get_tree_row, #60218
|
||||
|
||||
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually
|
||||
get this right, after the third try, #63122.
|
||||
|
||||
2001-10-31 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* gdk/gdkselection.h (GDK_TARGET_STRING):
|
||||
|
@ -1,3 +1,13 @@
|
||||
Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename
|
||||
gtk_selection_data_set_tree_row, #60218
|
||||
(gtk_tree_get_row_drag_data): rename
|
||||
gtk_selection_data_get_tree_row, #60218
|
||||
|
||||
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually
|
||||
get this right, after the third try, #63122.
|
||||
|
||||
2001-10-31 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* gdk/gdkselection.h (GDK_TARGET_STRING):
|
||||
|
@ -1,3 +1,13 @@
|
||||
Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename
|
||||
gtk_selection_data_set_tree_row, #60218
|
||||
(gtk_tree_get_row_drag_data): rename
|
||||
gtk_selection_data_get_tree_row, #60218
|
||||
|
||||
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually
|
||||
get this right, after the third try, #63122.
|
||||
|
||||
2001-10-31 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* gdk/gdkselection.h (GDK_TARGET_STRING):
|
||||
|
@ -1,3 +1,13 @@
|
||||
Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename
|
||||
gtk_selection_data_set_tree_row, #60218
|
||||
(gtk_tree_get_row_drag_data): rename
|
||||
gtk_selection_data_get_tree_row, #60218
|
||||
|
||||
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually
|
||||
get this right, after the third try, #63122.
|
||||
|
||||
2001-10-31 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* gdk/gdkselection.h (GDK_TARGET_STRING):
|
||||
|
@ -1,3 +1,13 @@
|
||||
Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename
|
||||
gtk_selection_data_set_tree_row, #60218
|
||||
(gtk_tree_get_row_drag_data): rename
|
||||
gtk_selection_data_get_tree_row, #60218
|
||||
|
||||
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually
|
||||
get this right, after the third try, #63122.
|
||||
|
||||
2001-10-31 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* gdk/gdkselection.h (GDK_TARGET_STRING):
|
||||
|
@ -1278,9 +1278,9 @@ gtk_list_store_drag_data_get (GtkTreeDragSource *drag_source,
|
||||
* default handler.
|
||||
*/
|
||||
|
||||
if (gtk_selection_data_set_tree_row (selection_data,
|
||||
GTK_TREE_MODEL (drag_source),
|
||||
path))
|
||||
if (gtk_tree_set_row_drag_data (selection_data,
|
||||
GTK_TREE_MODEL (drag_source),
|
||||
path))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@ -1308,9 +1308,9 @@ gtk_list_store_drag_data_received (GtkTreeDragDest *drag_dest,
|
||||
tree_model = GTK_TREE_MODEL (drag_dest);
|
||||
list_store = GTK_LIST_STORE (drag_dest);
|
||||
|
||||
if (gtk_selection_data_get_tree_row (selection_data,
|
||||
&src_model,
|
||||
&src_path) &&
|
||||
if (gtk_tree_get_row_drag_data (selection_data,
|
||||
&src_model,
|
||||
&src_path) &&
|
||||
src_model == tree_model)
|
||||
{
|
||||
/* Copy the given row to a new position */
|
||||
|
@ -196,7 +196,7 @@ struct _TreeRowData
|
||||
};
|
||||
|
||||
/**
|
||||
* gtk_selection_data_set_tree_row:
|
||||
* gtk_tree_set_row_drag_data:
|
||||
* @selection_data: some #GtkSelectionData
|
||||
* @tree_model: a #GtkTreeModel
|
||||
* @path: a row in @tree_model
|
||||
@ -207,9 +207,9 @@ struct _TreeRowData
|
||||
* Return value: %TRUE if the #GtkSelectionData had the proper target type to allow us to set a tree row
|
||||
**/
|
||||
gboolean
|
||||
gtk_selection_data_set_tree_row (GtkSelectionData *selection_data,
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreePath *path)
|
||||
gtk_tree_set_row_drag_data (GtkSelectionData *selection_data,
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreePath *path)
|
||||
{
|
||||
TreeRowData *trd;
|
||||
gchar *path_str;
|
||||
@ -249,7 +249,7 @@ gtk_selection_data_set_tree_row (GtkSelectionData *selection_data,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_selection_data_get_tree_row:
|
||||
* gtk_tree_get_row_drag_data:
|
||||
* @selection_data: a #GtkSelectionData
|
||||
* @tree_model: a #GtkTreeModel
|
||||
* @path: row in @tree_model
|
||||
@ -268,9 +268,9 @@ gtk_selection_data_set_tree_row (GtkSelectionData *selection_data,
|
||||
* is otherwise valid
|
||||
**/
|
||||
gboolean
|
||||
gtk_selection_data_get_tree_row (GtkSelectionData *selection_data,
|
||||
GtkTreeModel **tree_model,
|
||||
GtkTreePath **path)
|
||||
gtk_tree_get_row_drag_data (GtkSelectionData *selection_data,
|
||||
GtkTreeModel **tree_model,
|
||||
GtkTreePath **path)
|
||||
{
|
||||
TreeRowData *trd;
|
||||
|
||||
|
@ -91,25 +91,28 @@ GType gtk_tree_drag_dest_get_type (void) G_GNUC_CONST;
|
||||
/* Inserts a row before dest which contains data in selection_data,
|
||||
* or returns FALSE if it can't
|
||||
*/
|
||||
gboolean gtk_tree_drag_dest_drag_data_received (GtkTreeDragDest *drag_dest,
|
||||
GtkTreePath *dest,
|
||||
GtkSelectionData *selection_data);
|
||||
gboolean gtk_tree_drag_dest_drag_data_received (GtkTreeDragDest *drag_dest,
|
||||
GtkTreePath *dest,
|
||||
GtkSelectionData *selection_data);
|
||||
|
||||
|
||||
/* Returns TRUE if we can drop before path; path may not exist. */
|
||||
gboolean gtk_tree_drag_dest_row_drop_possible (GtkTreeDragDest *drag_dest,
|
||||
GtkTreeModel *src_model,
|
||||
GtkTreePath *src_path,
|
||||
GtkTreePath *dest_path);
|
||||
gboolean gtk_tree_drag_dest_row_drop_possible (GtkTreeDragDest *drag_dest,
|
||||
GtkTreeModel *src_model,
|
||||
GtkTreePath *src_path,
|
||||
GtkTreePath *dest_path);
|
||||
|
||||
|
||||
/* The selection data would normally have target type GTK_TREE_MODEL_ROW in this
|
||||
* case. If the target is wrong these functions return FALSE.
|
||||
*/
|
||||
gboolean gtk_selection_data_set_tree_row (GtkSelectionData *selection_data,
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreePath *path);
|
||||
gboolean gtk_selection_data_get_tree_row (GtkSelectionData *selection_data,
|
||||
GtkTreeModel **tree_model,
|
||||
GtkTreePath **path);
|
||||
gboolean gtk_tree_set_row_drag_data (GtkSelectionData *selection_data,
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreePath *path);
|
||||
gboolean gtk_tree_get_row_drag_data (GtkSelectionData *selection_data,
|
||||
GtkTreeModel **tree_model,
|
||||
GtkTreePath **path);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ gtk_tree_path_compare (const GtkTreePath *a,
|
||||
* @path: a #GtkTreePath
|
||||
* @descendant: another #GtkTreePath
|
||||
*
|
||||
*
|
||||
* Returns %TRUE is @descendant is a descendant of @path.
|
||||
*
|
||||
* Return value: %TRUE if @descendant is contained inside @path
|
||||
**/
|
||||
@ -1303,16 +1303,25 @@ gtk_tree_row_ref_deleted_callback (GObject *object,
|
||||
|
||||
if (reference->path)
|
||||
{
|
||||
if (gtk_tree_path_is_ancestor (path, reference->path))
|
||||
{
|
||||
reference->path->indices[path->depth-1]-=1;
|
||||
}
|
||||
else if (gtk_tree_path_compare (path, reference->path) == 0)
|
||||
gint i;
|
||||
|
||||
if (path->depth > reference->path->depth)
|
||||
continue;
|
||||
for (i = 0; i < path->depth - 1; i++)
|
||||
if (path->indices[i] != reference->path->indices[i])
|
||||
continue;
|
||||
|
||||
/* We know it affects us. */
|
||||
if (path->indices[i] == reference->path->indices[i])
|
||||
{
|
||||
gtk_tree_row_reference_unref_path (reference->path, reference->model, FALSE);
|
||||
gtk_tree_path_free (reference->path);
|
||||
reference->path = NULL;
|
||||
}
|
||||
else if (path->indices[i] < reference->path->indices[i])
|
||||
{
|
||||
reference->path->indices[path->depth-1]-=1;
|
||||
}
|
||||
}
|
||||
tmp_list = g_slist_next (tmp_list);
|
||||
}
|
||||
|
@ -1390,9 +1390,9 @@ gtk_tree_store_drag_data_get (GtkTreeDragSource *drag_source,
|
||||
* default handler.
|
||||
*/
|
||||
|
||||
if (gtk_selection_data_set_tree_row (selection_data,
|
||||
GTK_TREE_MODEL (drag_source),
|
||||
path))
|
||||
if (gtk_tree_set_row_drag_data (selection_data,
|
||||
GTK_TREE_MODEL (drag_source),
|
||||
path))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@ -1492,9 +1492,9 @@ gtk_tree_store_drag_data_received (GtkTreeDragDest *drag_dest,
|
||||
|
||||
validate_tree (tree_store);
|
||||
|
||||
if (gtk_selection_data_get_tree_row (selection_data,
|
||||
&src_model,
|
||||
&src_path) &&
|
||||
if (gtk_tree_get_row_drag_data (selection_data,
|
||||
&src_model,
|
||||
&src_path) &&
|
||||
src_model == tree_model)
|
||||
{
|
||||
/* Copy the given row to a new position */
|
||||
|
@ -3581,9 +3581,9 @@ gtk_tree_view_drag_data_get (GtkWidget *widget,
|
||||
/* If drag_data_get does nothing, try providing row data. */
|
||||
if (selection_data->target == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
|
||||
{
|
||||
gtk_selection_data_set_tree_row (selection_data,
|
||||
model,
|
||||
source_row);
|
||||
gtk_tree_set_row_drag_data (selection_data,
|
||||
model,
|
||||
source_row);
|
||||
}
|
||||
|
||||
done:
|
||||
@ -3809,9 +3809,9 @@ gtk_tree_view_drag_data_received (GtkWidget *widget,
|
||||
GtkTreeModel *src_model = NULL;
|
||||
GtkTreePath *src_path = NULL;
|
||||
|
||||
if (!gtk_selection_data_get_tree_row (selection_data,
|
||||
&src_model,
|
||||
&src_path))
|
||||
if (!gtk_tree_get_row_drag_data (selection_data,
|
||||
&src_model,
|
||||
&src_path))
|
||||
suggested_action = 0;
|
||||
|
||||
if (suggested_action)
|
||||
|
Loading…
Reference in New Issue
Block a user