Commit Graph

14 Commits

Author SHA1 Message Date
Matthias Clasen
86c7fceb09 Merge branch 'list-model-docs' into 'master'
List model docs

See merge request GNOME/gtk!2182
2020-07-19 23:50:09 +00:00
Benjamin Otte
60a09e59e8 stringlist: Convert to array
Stringlists are usually built and then never modified, and accessing
items through an array is faster.
2020-07-16 18:09:58 +02:00
Emmanuele Bassi
fdeda388bf Fix "not nullable" annotation 2020-07-07 12:03:44 +01:00
Benjamin Otte
1dbb8df95f 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.
2020-07-05 02:59:21 +02:00
Benjamin Otte
f6c2c2edbd stringlist: Call splice() for adding items after construction
This has the benefit of actually allowing NULL to be passed.
2020-07-05 02:59:21 +02:00
Benjamin Otte
c4e4de36f6 stringlist: Remove n_additions argument from gtk_string_list_splice()
char ** arrays are null-terminated everywhere, so make sure they are in
splice(), too.

Also fix the argument to be a const char * const * like in the
constructor.
2020-07-05 02:59:21 +02:00
Benjamin Otte
67cbb2a7d3 stringlist: Clarify docs for gtk_string_list_get_string()
Make sure it's obvious that it behaves like g_list_model_get_item() and
returns NULL for pos >= n_items.
2020-07-05 02:59:21 +02:00
Benjamin Otte
a979daa8ea stringlist: Make one constructor call the other
Simplifies code.
2020-07-05 02:59:21 +02:00
Benjamin Otte
fb14f50ec1 stringlist: Make property not construct-only
Massively speeds up creation of long stringlists.
2020-07-05 02:59:21 +02:00
Benjamin Otte
f75a3a0e95 stringlist: Take a const char const * argument
Sucks that we need to cast a char**, but otherwise we need to cast
{"foo", "bar", "baz" } arrays.
2020-07-05 02:34:42 +02:00
Matthias Clasen
130bd5937c docs: Add guidance about list model performance
Add a section about the performance tradeoffs between
different list model implementations.
2020-07-03 09:29:19 -04:00
Matthias Clasen
5d9bcfb64a stringlist: Cosmetic documentation fix 2020-06-28 12:43:16 -04:00
Rico Tzschichholz
5b1195f874 gtk: Add some g-i annotations to GtkStringList 2020-06-26 06:36:23 +02:00
Matthias Clasen
e8210d5865 Add GtkStringList as public api
This is a list model holding strings, initialized
from a char **. String lists are buildable as well,
and that replaces the buildable support in GktDropDowns.
2020-06-23 16:11:46 -04:00