stringlist: Export gtk_string_object_new()

There are various use cases where it makes sense to construct these -
from our internal testing to using them in flatten- or mapmodels.
This commit is contained in:
Benjamin Otte 2020-07-04 17:02:44 +02:00
parent f6c2c2edbd
commit 1dbb8df95f
3 changed files with 14 additions and 2 deletions

View File

@ -7611,7 +7611,9 @@ gtk_string_list_take
gtk_string_list_remove
gtk_string_list_splice
gtk_string_list_get_string
<SUBSECTION>
GtkStringObject
gtk_string_object_new
gtk_string_object_get_string
</SECTION>

View File

@ -156,7 +156,15 @@ gtk_string_object_new_take (char *string)
return obj;
}
static GtkStringObject *
/**
* gtk_string_object_new:
* @string: (non-nullable): The string to wrap
*
* Wraps a string in an object for use with #GListModel
*
* Returns: a new #GtkStringObject
**/
GtkStringObject *
gtk_string_object_new (const char *string)
{
return gtk_string_object_new_take (g_strdup (string));

View File

@ -37,7 +37,9 @@ GDK_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (GtkStringObject, gtk_string_object, GTK, STRING_OBJECT, GObject)
GDK_AVAILABLE_IN_ALL
const char * gtk_string_object_get_string (GtkStringObject *self);
GtkStringObject * gtk_string_object_new (const char *string);
GDK_AVAILABLE_IN_ALL
const char * gtk_string_object_get_string (GtkStringObject *self);
#define GTK_TYPE_STRING_LIST (gtk_string_list_get_type ())