Add introspection friendly version of gtk_tree_path_new_from_indices

Add gtk_tree_path_new_from_indicesv which takes an array of
integers with a length. Use "Rename to" annotation to rename the
method as gtk_tree_path_new_from_indices. This is needed because
the original method takes variadic arguments which is not supported
by introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=706119
This commit is contained in:
Simon Feltman 2013-08-16 03:59:30 -07:00
parent 935dc1d273
commit efa8956718
3 changed files with 32 additions and 0 deletions

View File

@ -4244,6 +4244,7 @@ GtkTreeModelFlags
gtk_tree_path_new
gtk_tree_path_new_from_string
gtk_tree_path_new_from_indices
gtk_tree_path_new_from_indicesv
gtk_tree_path_to_string
gtk_tree_path_new_first
gtk_tree_path_append_index

View File

@ -681,6 +681,34 @@ gtk_tree_path_new_from_indices (gint first_index,
return path;
}
/**
* gtk_tree_path_new_from_indicesv: (rename-to gtk_tree_path_new_from_indices)
* @indices: (array length=length): array of indices
* @length: length of @indices array
*
* Creates a new path with the given @indices array of @length.
*
* Return value: A newly created #GtkTreePath
*
* Since: 3.12
*/
GtkTreePath *
gtk_tree_path_new_from_indicesv (gint *indices,
gsize length)
{
GtkTreePath *path;
g_return_val_if_fail (indices != NULL && length != 0, NULL);
path = gtk_tree_path_new ();
path->alloc = length;
path->depth = length;
path->indices = g_new (gint, length);
memcpy (path->indices, indices, length * sizeof (gint));
return path;
}
/**
* gtk_tree_path_to_string:
* @path: A #GtkTreePath

View File

@ -167,6 +167,9 @@ GtkTreePath *gtk_tree_path_new_from_string (const gchar *path);
GDK_AVAILABLE_IN_ALL
GtkTreePath *gtk_tree_path_new_from_indices (gint first_index,
...);
GDK_AVAILABLE_IN_3_12
GtkTreePath *gtk_tree_path_new_from_indicesv (gint *indices,
gsize length);
GDK_AVAILABLE_IN_ALL
gchar *gtk_tree_path_to_string (GtkTreePath *path);
GDK_AVAILABLE_IN_ALL