mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
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:
parent
935dc1d273
commit
efa8956718
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user