diff options
author | Simon Feltman <sfeltman@src.gnome.org> | 2013-08-16 03:59:30 -0700 |
---|---|---|
committer | Simon Feltman <sfeltman@src.gnome.org> | 2014-01-05 11:23:41 -0800 |
commit | efa8956718386b29ecd37aa11e1a827656b66616 (patch) | |
tree | 343e9b2987c12bd9171c75cd7e11bc1443723ef7 /gtk/gtktreemodel.c | |
parent | 935dc1d273d01bcc95354083d951767d828206fb (diff) | |
download | gtk+-efa8956718386b29ecd37aa11e1a827656b66616.tar.gz |
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
Diffstat (limited to 'gtk/gtktreemodel.c')
-rw-r--r-- | gtk/gtktreemodel.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 1a8a9fc94a..b5190013db 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -682,6 +682,34 @@ gtk_tree_path_new_from_indices (gint first_index, } /** + * 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 * |