| 1 | /* |
| 2 | * Copyright © 2018 Benjamin Otte |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2.1 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 16 | * |
| 17 | * Authors: Benjamin Otte <[email protected]> |
| 18 | */ |
| 19 | |
| 20 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 21 | |
| 22 | #include "gtksortlistmodel.h"cxx . . $ `<file>/gtk/gtksortlistmodel.h`/ |
| 23 | |
| 24 | #include "gtkbitset.h"cxx . . $ `<file>/gtk/gtkbitset.h`/ |
| 25 | #include "gtkmultisorter.h"cxx . . $ `<file>/gtk/gtkmultisorter.h`/ |
| 26 | #include "gtkprivate.h"cxx . . $ `<file>/gtk/gtkprivate.h`/ |
| 27 | #include "gtksectionmodel.h"cxx . . $ `<file>/gtk/gtksectionmodel.h`/ |
| 28 | #include "gtksorterprivate.h"cxx . . $ `<file>/gtk/gtksorterprivate.h`/ |
| 29 | #include "timsort/gtktimsortprivate.h"cxx . . $ `<file>/gtk/timsort/gtktimsortprivate.h`/ |
| 30 | |
| 31 | /* The maximum amount of items to merge for a single merge step |
| 32 | * |
| 33 | * Making this smaller will result in more steps, which has more overhead and slows |
| 34 | * down total sort time. |
| 35 | * Making it larger will result in fewer steps, which increases the time taken for |
| 36 | * a single step. |
| 37 | * |
| 38 | * As merges are the most expensive steps, this is essentially a tunable for the |
| 39 | * longest time spent in gtk_tim_sort_step(). |
| 40 | * |
| 41 | * Note that this should be reset to 0 when not doing incremental sorting to get |
| 42 | * rid of all the overhead. |
| 43 | */ |
| 44 | #define GTK_SORT_MAX_MERGE_SIZEcxx . . $ `gtk/gtksortlistmodel.c:44:9`! (1024) |
| 45 | |
| 46 | /* Time we spend in the sort callback before returning to the main loop |
| 47 | * |
| 48 | * Increasing this number will make the callback take longer and potentially |
| 49 | * reduce responsiveness of an application, but will increase the amount of |
| 50 | * work done per step. And we emit an ::items-changed() signal after every |
| 51 | * step, so if we can avoid that, we recuce the overhead in the list widget |
| 52 | * and in turn reduce the total sort time. |
| 53 | */ |
| 54 | #define GTK_SORT_STEP_TIME_UScxx . . $ `gtk/gtksortlistmodel.c:54:9`! (1000) /* 1 millisecond */ |
| 55 | |
| 56 | /** |
| 57 | * GtkSortListModel: |
| 58 | * |
| 59 | * A list model that sorts the elements of another model. |
| 60 | * |
| 61 | * The elements are sorted according to a `GtkSorter`. |
| 62 | * |
| 63 | * The model is a stable sort. If two items compare equal according |
| 64 | * to the sorter, the one that appears first in the original model will |
| 65 | * also appear first after sorting. |
| 66 | * |
| 67 | * Note that if you change the sorter, the previous order will have no |
| 68 | * influence on the new order. If you want that, consider using a |
| 69 | * `GtkMultiSorter` and appending the previous sorter to it. |
| 70 | * |
| 71 | * The model can be set up to do incremental sorting, so that |
| 72 | * sorting long lists doesn't block the UI. See |
| 73 | * [[email protected]_incremental] for details. |
| 74 | * |
| 75 | * `GtkSortListModel` is a generic model and because of that it |
| 76 | * cannot take advantage of any external knowledge when sorting. |
| 77 | * If you run into performance issues with `GtkSortListModel`, |
| 78 | * it is strongly recommended that you write your own sorting list |
| 79 | * model. |
| 80 | * |
| 81 | * `GtkSortListModel` allows sorting the items into sections. It |
| 82 | * implements `GtkSectionModel` and when [[email protected]:section-sorter] |
| 83 | * is set, it will sort all items with that sorter and items comparing |
| 84 | * equal with it will be put into the same section. |
| 85 | * The [[email protected]:sorter] will then be used to sort items |
| 86 | * inside their sections. |
| 87 | */ |
| 88 | |
| 89 | enumcxx . . $ $anonymous_type_680fcd87957162ca_0# { |
| 90 | PROP_0cxx . . $ PROP_0., |
| 91 | PROP_INCREMENTALcxx . . $ PROP_INCREMENTAL., |
| 92 | PROP_ITEM_TYPEcxx . . $ PROP_ITEM_TYPE., |
| 93 | PROP_MODELcxx . . $ PROP_MODEL., |
| 94 | PROP_N_ITEMScxx . . $ PROP_N_ITEMS., |
| 95 | PROP_PENDINGcxx . . $ PROP_PENDING., |
| 96 | PROP_SECTION_SORTERcxx . . $ PROP_SECTION_SORTER., |
| 97 | PROP_SORTERcxx . . $ PROP_SORTER., |
| 98 | NUM_PROPERTIEScxx . . $ NUM_PROPERTIES. |
| 99 | }; |
| 100 | |
| 101 | struct _GtkSortListModelcxx . . $ _GtkSortListModel# |
| 102 | { |
| 103 | GObjectcxx . . $ GObject# parent_instancecxx . . $ _GtkSortListModel#parent_instance.; |
| 104 | |
| 105 | GListModelcxx . . $ GListModel# *modelcxx . . $ _GtkSortListModel#model.; |
| 106 | GtkSortercxx . . $ GtkSorter# *sortercxx . . $ _GtkSortListModel#sorter.; |
| 107 | GtkSortercxx . . $ GtkSorter# *section_sortercxx . . $ _GtkSortListModel#section_sorter.; |
| 108 | GtkSortercxx . . $ GtkSorter# *real_sortercxx . . $ _GtkSortListModel#real_sorter.; |
| 109 | gbooleancxx . . $ gboolean# incrementalcxx . . $ _GtkSortListModel#incremental.; |
| 110 | |
| 111 | GtkTimSortcxx . . $ GtkTimSort# sortcxx . . $ _GtkSortListModel#sort.; /* ongoing sort operation */ |
| 112 | guintcxx . . $ guint# sort_cbcxx . . $ _GtkSortListModel#sort_cb.; /* 0 or current ongoing sort callback */ |
| 113 | |
| 114 | guintcxx . . $ guint# n_itemscxx . . $ _GtkSortListModel#n_items.; |
| 115 | GtkSortKeyscxx . . $ GtkSortKeys# *sort_keyscxx . . $ _GtkSortListModel#sort_keys.; |
| 116 | GtkSortKeyscxx . . $ GtkSortKeys# *section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys.; /* we assume they are compatible with the sort keys because they're the first element */ |
| 117 | gsizecxx . . $ gsize# key_sizecxx . . $ _GtkSortListModel#key_size.; |
| 118 | gpointercxx . . $ gpointer# keyscxx . . $ _GtkSortListModel#keys.; |
| 119 | GtkBitsetcxx . . $ GtkBitset# *missing_keyscxx . . $ _GtkSortListModel#missing_keys.; |
| 120 | |
| 121 | gpointercxx . . $ gpointer# *positionscxx . . $ _GtkSortListModel#positions.; |
| 122 | }; |
| 123 | |
| 124 | struct _GtkSortListModelClasscxx . . $ _GtkSortListModelClass# |
| 125 | { |
| 126 | GObjectClasscxx . . $ GObjectClass# parent_classcxx . . $ _GtkSortListModelClass#parent_class.; |
| 127 | }; |
| 128 | |
| 129 | static GParamSpeccxx . . $ GParamSpec# *propertiescxx . . $ properties.[NUM_PROPERTIEScxx . . $ NUM_PROPERTIES.] = { NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, }; |
| 130 | |
| 131 | static guintcxx . . $ guint# |
| 132 | pos_from_keycxx . . $ pos_from_key(cbb0c22fd3419499). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 133 | gpointercxx . . $ gpointer# key) |
| 134 | { |
| 135 | guintcxx . . $ guint# pos = ((char *) key - (char *) self->keyscxx . . $ _GtkSortListModel#keys.) / self->key_sizecxx . . $ _GtkSortListModel#key_size.; |
| 136 | |
| 137 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (pos < self->n_items); |
| 138 | |
| 139 | return pos; |
| 140 | } |
| 141 | |
| 142 | static gpointercxx . . $ gpointer# |
| 143 | key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 144 | guintcxx . . $ guint# pos) |
| 145 | { |
| 146 | return (char *) self->keyscxx . . $ _GtkSortListModel#keys. + self->key_sizecxx . . $ _GtkSortListModel#key_size. * pos; |
| 147 | } |
| 148 | |
| 149 | static GTypecxx . . $ GType# |
| 150 | gtk_sort_list_model_get_item_typecxx . . $ gtk_sort_list_model_get_item_type(94bfa31565da8ed5). (GListModelcxx . . $ GListModel# *list) |
| 151 | { |
| 152 | return G_TYPE_OBJECTcxx . . $ `<external>/9567554376676449156/gtype.h:189:9`!; |
| 153 | } |
| 154 | |
| 155 | static guintcxx . . $ guint# |
| 156 | gtk_sort_list_model_get_n_itemscxx . . $ gtk_sort_list_model_get_n_items(43b97f6a983b4be8). (GListModelcxx . . $ GListModel# *list) |
| 157 | { |
| 158 | GtkSortListModelcxx . . $ GtkSortListModel# *self = GTK_SORT_LIST_MODELcxx . . $ GTK_SORT_LIST_MODEL(9213e74d72ebfc32). (list); |
| 159 | |
| 160 | if (self->modelcxx . . $ _GtkSortListModel#model. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 161 | return 0; |
| 162 | |
| 163 | return g_list_model_get_n_itemscxx . . $ g_list_model_get_n_items(43b97f6a983b4be8). (self->modelcxx . . $ _GtkSortListModel#model.); |
| 164 | } |
| 165 | |
| 166 | static gpointercxx . . $ gpointer# |
| 167 | gtk_sort_list_model_get_itemcxx . . $ gtk_sort_list_model_get_item(9715a6516b430a30). (GListModelcxx . . $ GListModel# *list, |
| 168 | guintcxx . . $ guint# position) |
| 169 | { |
| 170 | GtkSortListModelcxx . . $ GtkSortListModel# *self = GTK_SORT_LIST_MODELcxx . . $ GTK_SORT_LIST_MODEL(9213e74d72ebfc32). (list); |
| 171 | |
| 172 | if (self->modelcxx . . $ _GtkSortListModel#model. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 173 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 174 | |
| 175 | if (position >= self->n_itemscxx . . $ _GtkSortListModel#n_items.) |
| 176 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 177 | |
| 178 | if (self->positionscxx . . $ _GtkSortListModel#positions.) |
| 179 | position = pos_from_keycxx . . $ pos_from_key(cbb0c22fd3419499). (self, self->positionscxx . . $ _GtkSortListModel#positions.[position]); |
| 180 | |
| 181 | return g_list_model_get_itemcxx . . $ g_list_model_get_item(9715a6516b430a30). (self->modelcxx . . $ _GtkSortListModel#model., position); |
| 182 | } |
| 183 | |
| 184 | static void |
| 185 | gtk_sort_list_model_model_initcxx . . $ gtk_sort_list_model_model_init(41b235b28ecdc2f9). (GListModelInterfacecxx . . $ GListModelInterface# *iface) |
| 186 | { |
| 187 | iface->get_item_typecxx . . $ _GListModelInterface#get_item_type. = gtk_sort_list_model_get_item_typecxx . . $ gtk_sort_list_model_get_item_type(94bfa31565da8ed5).; |
| 188 | iface->get_n_itemscxx . . $ _GListModelInterface#get_n_items. = gtk_sort_list_model_get_n_itemscxx . . $ gtk_sort_list_model_get_n_items(43b97f6a983b4be8).; |
| 189 | iface->get_itemcxx . . $ _GListModelInterface#get_item. = gtk_sort_list_model_get_itemcxx . . $ gtk_sort_list_model_get_item(9715a6516b430a30).; |
| 190 | } |
| 191 | |
| 192 | static void |
| 193 | gtk_sort_list_model_ensure_keycxx . . $ gtk_sort_list_model_ensure_key(50fb92b57f258899). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 194 | guintcxx . . $ guint# pos) |
| 195 | { |
| 196 | gpointercxx . . $ gpointer# item; |
| 197 | |
| 198 | if (!gtk_bitset_containscxx . . $ gtk_bitset_contains(b5dbc79c3ad10a04). (self->missing_keyscxx . . $ _GtkSortListModel#missing_keys., pos)) |
| 199 | return; |
| 200 | |
| 201 | item = g_list_model_get_itemcxx . . $ g_list_model_get_item(9715a6516b430a30). (self->modelcxx . . $ _GtkSortListModel#model., pos); |
| 202 | gtk_sort_keys_init_keycxx . . $ gtk_sort_keys_init_key(57c02422f6b769d). (self->sort_keyscxx . . $ _GtkSortListModel#sort_keys., item, key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, pos)); |
| 203 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (item); |
| 204 | |
| 205 | gtk_bitset_removecxx . . $ gtk_bitset_remove(ccf69cc021ffb008). (self->missing_keyscxx . . $ _GtkSortListModel#missing_keys., pos); |
| 206 | } |
| 207 | |
| 208 | static void |
| 209 | gtk_sort_list_model_get_section_unsortedcxx . . $ gtk_sort_list_model_get_section_unsorted(3d478115b8fc4812). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 210 | guintcxx . . $ guint# position, |
| 211 | guintcxx . . $ guint# *out_start, |
| 212 | guintcxx . . $ guint# *out_end) |
| 213 | { |
| 214 | gpointercxx . . $ gpointer# *pos, *start, *end; |
| 215 | |
| 216 | pos = &self->positionscxx . . $ _GtkSortListModel#positions.[position]; |
| 217 | gtk_sort_list_model_ensure_keycxx . . $ gtk_sort_list_model_ensure_key(50fb92b57f258899). (self, pos_from_keycxx . . $ pos_from_key(cbb0c22fd3419499). (self, *pos)); |
| 218 | |
| 219 | for (start = pos; |
| 220 | start > self->positionscxx . . $ _GtkSortListModel#positions.; |
| 221 | start--) |
| 222 | { |
| 223 | gtk_sort_list_model_ensure_keycxx . . $ gtk_sort_list_model_ensure_key(50fb92b57f258899). (self, pos_from_keycxx . . $ pos_from_key(cbb0c22fd3419499). (self, start[-1])); |
| 224 | if (gtk_sort_keys_comparecxx . . $ gtk_sort_keys_compare(8b25bfb04e75b443). (self->section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys., start[-1], *pos) != GTK_ORDERING_EQUALcxx . . $ GTK_ORDERING_EQUAL.) |
| 225 | break; |
| 226 | } |
| 227 | |
| 228 | for (end = pos + 1; |
| 229 | end < &self->positionscxx . . $ _GtkSortListModel#positions.[self->n_itemscxx . . $ _GtkSortListModel#n_items.]; |
| 230 | end++) |
| 231 | { |
| 232 | gtk_sort_list_model_ensure_keycxx . . $ gtk_sort_list_model_ensure_key(50fb92b57f258899). (self, pos_from_keycxx . . $ pos_from_key(cbb0c22fd3419499). (self, *end)); |
| 233 | if (gtk_sort_keys_comparecxx . . $ gtk_sort_keys_compare(8b25bfb04e75b443). (self->section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys., *end, *pos) != GTK_ORDERING_EQUALcxx . . $ GTK_ORDERING_EQUAL.) |
| 234 | break; |
| 235 | } |
| 236 | |
| 237 | *out_start = start - self->positionscxx . . $ _GtkSortListModel#positions.; |
| 238 | *out_end = end - self->positionscxx . . $ _GtkSortListModel#positions.; |
| 239 | } |
| 240 | |
| 241 | static void |
| 242 | gtk_sort_list_model_get_section_sortedcxx . . $ gtk_sort_list_model_get_section_sorted(3d478115b8fc4812). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 243 | guintcxx . . $ guint# position, |
| 244 | guintcxx . . $ guint# *out_start, |
| 245 | guintcxx . . $ guint# *out_end) |
| 246 | { |
| 247 | gpointercxx . . $ gpointer# *pos; |
| 248 | guintcxx . . $ guint# step, min, max, mid; |
| 249 | |
| 250 | pos = &self->positionscxx . . $ _GtkSortListModel#positions.[position]; |
| 251 | |
| 252 | max = position; |
| 253 | step = 1; |
| 254 | while (max > 0) |
| 255 | { |
| 256 | min = max - MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (max, step); |
| 257 | step *= 2; |
| 258 | if (gtk_sort_keys_comparecxx . . $ gtk_sort_keys_compare(8b25bfb04e75b443). (self->section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys., self->positionscxx . . $ _GtkSortListModel#positions.[min], *pos) == GTK_ORDERING_EQUALcxx . . $ GTK_ORDERING_EQUAL.) |
| 259 | { |
| 260 | max = min; |
| 261 | continue; |
| 262 | } |
| 263 | /* now min is different, max is equal, bsearch where that changes */ |
| 264 | while (max - min > 1) |
| 265 | { |
| 266 | mid = (max + min) / 2; |
| 267 | if (gtk_sort_keys_comparecxx . . $ gtk_sort_keys_compare(8b25bfb04e75b443). (self->section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys., self->positionscxx . . $ _GtkSortListModel#positions.[mid], *pos) == GTK_ORDERING_EQUALcxx . . $ GTK_ORDERING_EQUAL.) |
| 268 | max = mid; |
| 269 | else |
| 270 | min = mid; |
| 271 | } |
| 272 | break; |
| 273 | } |
| 274 | *out_start = max; |
| 275 | |
| 276 | min = position; |
| 277 | step = 1; |
| 278 | while (min < self->n_itemscxx . . $ _GtkSortListModel#n_items. - 1) |
| 279 | { |
| 280 | max = min + MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (self->n_items - 1 - min, step); |
| 281 | step *= 2; |
| 282 | if (gtk_sort_keys_comparecxx . . $ gtk_sort_keys_compare(8b25bfb04e75b443). (self->section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys., self->positionscxx . . $ _GtkSortListModel#positions.[max], *pos) == GTK_ORDERING_EQUALcxx . . $ GTK_ORDERING_EQUAL.) |
| 283 | { |
| 284 | min = max; |
| 285 | continue; |
| 286 | } |
| 287 | /* now min is equal, max is different, bsearch where that changes */ |
| 288 | while (max - min > 1) |
| 289 | { |
| 290 | mid = (max + min) / 2; |
| 291 | if (gtk_sort_keys_comparecxx . . $ gtk_sort_keys_compare(8b25bfb04e75b443). (self->section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys., self->positionscxx . . $ _GtkSortListModel#positions.[mid], *pos) == GTK_ORDERING_EQUALcxx . . $ GTK_ORDERING_EQUAL.) |
| 292 | min = mid; |
| 293 | else |
| 294 | max = mid; |
| 295 | } |
| 296 | break; |
| 297 | } |
| 298 | *out_end = min + 1; |
| 299 | } |
| 300 | |
| 301 | static void |
| 302 | gtk_sort_list_model_get_sectioncxx . . $ gtk_sort_list_model_get_section(cb2d549c16e2156c). (GtkSectionModelcxx . . $ GtkSectionModel# *model, |
| 303 | guintcxx . . $ guint# position, |
| 304 | guintcxx . . $ guint# *out_start, |
| 305 | guintcxx . . $ guint# *out_end) |
| 306 | { |
| 307 | GtkSortListModelcxx . . $ GtkSortListModel# *self = GTK_SORT_LIST_MODELcxx . . $ GTK_SORT_LIST_MODEL(9213e74d72ebfc32). (model); |
| 308 | |
| 309 | if (position >= self->n_itemscxx . . $ _GtkSortListModel#n_items.) |
| 310 | { |
| 311 | *out_start = self->n_itemscxx . . $ _GtkSortListModel#n_items.; |
| 312 | *out_end = G_MAXUINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:40:9`!; |
| 313 | return; |
| 314 | } |
| 315 | |
| 316 | if (self->section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 317 | { |
| 318 | *out_start = 0; |
| 319 | *out_end = self->n_itemscxx . . $ _GtkSortListModel#n_items.; |
| 320 | return; |
| 321 | } |
| 322 | |
| 323 | /* When the list is not sorted: |
| 324 | * - keys may not exist yet |
| 325 | * - equal items may not be adjacent |
| 326 | * So add a slow path that can deal with that, but is O(N). |
| 327 | * The fast path is O(log N) and will be used for I guess |
| 328 | * 99% of cases. |
| 329 | */ |
| 330 | if (self->sort_cbcxx . . $ _GtkSortListModel#sort_cb.) |
| 331 | gtk_sort_list_model_get_section_unsortedcxx . . $ gtk_sort_list_model_get_section_unsorted(3d478115b8fc4812). (self, position, out_start, out_end); |
| 332 | else |
| 333 | gtk_sort_list_model_get_section_sortedcxx . . $ gtk_sort_list_model_get_section_sorted(3d478115b8fc4812). (self, position, out_start, out_end); |
| 334 | } |
| 335 | |
| 336 | static void |
| 337 | gtk_sort_list_model_section_model_initcxx . . $ gtk_sort_list_model_section_model_init(fb93d891eef27d66). (GtkSectionModelInterfacecxx . . $ GtkSectionModelInterface# *iface) |
| 338 | { |
| 339 | iface->get_sectioncxx . . $ _GtkSectionModelInterface#get_section. = gtk_sort_list_model_get_sectioncxx . . $ gtk_sort_list_model_get_section(cb2d549c16e2156c).; |
| 340 | } |
| 341 | |
| 342 | G_DEFINE_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1850:9`! (GtkSortListModel, gtk_sort_list_model, G_TYPE_OBJECTcxx . . $ `<external>/9567554376676449156/gtype.h:189:9`!, |
| 343 | G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (G_TYPE_LIST_MODELcxx . . $ `<external>/10117917155607792737/glistmodel.h:36:9`!, gtk_sort_list_model_model_init) |
| 344 | G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (GTK_TYPE_SECTION_MODELcxx . . $ `gtk/gtksectionmodel.h:30:9`!, gtk_sort_list_model_section_model_init)) |
| 345 | |
| 346 | static gbooleancxx . . $ gboolean# |
| 347 | gtk_sort_list_model_is_sortingcxx . . $ gtk_sort_list_model_is_sorting(ca2f0979a7cbc8e6). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 348 | { |
| 349 | return self->sort_cbcxx . . $ _GtkSortListModel#sort_cb. != 0; |
| 350 | } |
| 351 | |
| 352 | static void |
| 353 | gtk_sort_list_model_stop_sortingcxx . . $ gtk_sort_list_model_stop_sorting(762bbe791ef27c7c). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 354 | gsizecxx . . $ gsize# *runs) |
| 355 | { |
| 356 | if (self->sort_cbcxx . . $ _GtkSortListModel#sort_cb. == 0) |
| 357 | { |
| 358 | if (runs) |
| 359 | { |
| 360 | runs[0] = self->n_itemscxx . . $ _GtkSortListModel#n_items.; |
| 361 | runs[1] = 0; |
| 362 | } |
| 363 | return; |
| 364 | } |
| 365 | |
| 366 | if (runs) |
| 367 | gtk_tim_sort_get_runscxx . . $ gtk_tim_sort_get_runs(17a0b685f1963d27). (&self->sortcxx . . $ _GtkSortListModel#sort., runs); |
| 368 | gtk_tim_sort_finishcxx . . $ gtk_tim_sort_finish(66cb275ad66ec7e0). (&self->sortcxx . . $ _GtkSortListModel#sort.); |
| 369 | g_clear_handle_idcxx . . $ `<external>/1856471541377536744/gmain.h:867:9`! (&self->sort_cb, g_source_remove); |
| 370 | |
| 371 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_PENDINGcxx . . $ PROP_PENDING.]); |
| 372 | } |
| 373 | |
| 374 | static gbooleancxx . . $ gboolean# |
| 375 | gtk_sort_list_model_sort_stepcxx . . $ gtk_sort_list_model_sort_step(2dbf91f1ccb80911). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 376 | gbooleancxx . . $ gboolean# finish, |
| 377 | guintcxx . . $ guint# *out_position, |
| 378 | guintcxx . . $ guint# *out_n_items) |
| 379 | { |
| 380 | gint64cxx . . $ gint64# end_time = g_get_monotonic_timecxx . . $ g_get_monotonic_time(da6335ded91d79c2). (); |
| 381 | gbooleancxx . . $ gboolean# result = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 382 | GtkTimSortRuncxx . . $ GtkTimSortRun# change; |
| 383 | gpointercxx . . $ gpointer# *start_change, *end_change; |
| 384 | |
| 385 | end_time += GTK_SORT_STEP_TIME_UScxx . . $ `gtk/gtksortlistmodel.c:54:9`!; |
| 386 | |
| 387 | if (!gtk_bitset_is_emptycxx . . $ gtk_bitset_is_empty(552670c4b5304b90). (self->missing_keyscxx . . $ _GtkSortListModel#missing_keys.)) |
| 388 | { |
| 389 | GtkBitsetItercxx . . $ GtkBitsetIter# iter; |
| 390 | guintcxx . . $ guint# pos; |
| 391 | |
| 392 | for (gtk_bitset_iter_init_firstcxx . . $ gtk_bitset_iter_init_first(6a467db681b923c8). (&iter, self->missing_keyscxx . . $ _GtkSortListModel#missing_keys., &pos); |
| 393 | gtk_bitset_iter_is_validcxx . . $ gtk_bitset_iter_is_valid(d97646fb588d01). (&iter); |
| 394 | gtk_bitset_iter_nextcxx . . $ gtk_bitset_iter_next(244371cbdf2d6e67). (&iter, &pos)) |
| 395 | { |
| 396 | gpointercxx . . $ gpointer# item = g_list_model_get_itemcxx . . $ g_list_model_get_item(9715a6516b430a30). (self->modelcxx . . $ _GtkSortListModel#model., pos); |
| 397 | gtk_sort_keys_init_keycxx . . $ gtk_sort_keys_init_key(57c02422f6b769d). (self->sort_keyscxx . . $ _GtkSortListModel#sort_keys., item, key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, pos)); |
| 398 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (item); |
| 399 | |
| 400 | if (g_get_monotonic_timecxx . . $ g_get_monotonic_time(da6335ded91d79c2). () >= end_time && !finish) |
| 401 | { |
| 402 | gtk_bitset_remove_range_closedcxx . . $ gtk_bitset_remove_range_closed(ea2408edad2b84f4). (self->missing_keyscxx . . $ _GtkSortListModel#missing_keys., 0, pos); |
| 403 | *out_position = 0; |
| 404 | *out_n_items = 0; |
| 405 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 406 | } |
| 407 | } |
| 408 | result = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 409 | gtk_bitset_remove_allcxx . . $ gtk_bitset_remove_all(a981648d8e5e1e8a). (self->missing_keyscxx . . $ _GtkSortListModel#missing_keys.); |
| 410 | } |
| 411 | |
| 412 | end_change = self->positionscxx . . $ _GtkSortListModel#positions.; |
| 413 | start_change = self->positionscxx . . $ _GtkSortListModel#positions. + self->n_itemscxx . . $ _GtkSortListModel#n_items.; |
| 414 | |
| 415 | while (gtk_tim_sort_stepcxx . . $ gtk_tim_sort_step(a3cd5f8650ca4faf). (&self->sortcxx . . $ _GtkSortListModel#sort., &change)) |
| 416 | { |
| 417 | result = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 418 | if (change.lencxx . . $ _GtkTimSortRun#len.) |
| 419 | { |
| 420 | start_change = MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (start_change, (gpointer *) change.base); |
| 421 | end_change = MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (end_change, ((gpointer *) change.base) + change.len); |
| 422 | } |
| 423 | |
| 424 | if (g_get_monotonic_timecxx . . $ g_get_monotonic_time(da6335ded91d79c2). () >= end_time && !finish) |
| 425 | break; |
| 426 | } |
| 427 | |
| 428 | if (start_change < end_change) |
| 429 | { |
| 430 | *out_position = start_change - self->positionscxx . . $ _GtkSortListModel#positions.; |
| 431 | *out_n_items = end_change - start_change; |
| 432 | } |
| 433 | else |
| 434 | { |
| 435 | *out_position = 0; |
| 436 | *out_n_items = 0; |
| 437 | } |
| 438 | |
| 439 | return result; |
| 440 | } |
| 441 | |
| 442 | static gbooleancxx . . $ gboolean# |
| 443 | gtk_sort_list_model_sort_cbcxx . . $ gtk_sort_list_model_sort_cb(dedf1e9b1c614a07). (gpointercxx . . $ gpointer# data) |
| 444 | { |
| 445 | GtkSortListModelcxx . . $ GtkSortListModel# *self = data; |
| 446 | guintcxx . . $ guint# pos, n_items; |
| 447 | |
| 448 | if (gtk_sort_list_model_sort_stepcxx . . $ gtk_sort_list_model_sort_step(2dbf91f1ccb80911). (self, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, &pos, &n_items)) |
| 449 | { |
| 450 | if (n_items) |
| 451 | g_list_model_items_changedcxx . . $ g_list_model_items_changed(2896dae0034144d8). (G_LIST_MODELcxx . . $ G_LIST_MODEL(26f73d2a39e7201f). (self), pos, n_items, n_items); |
| 452 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_PENDINGcxx . . $ PROP_PENDING.]); |
| 453 | return G_SOURCE_CONTINUEcxx . . $ `<external>/1856471541377536744/gmain.h:485:9`!; |
| 454 | } |
| 455 | |
| 456 | gtk_sort_list_model_stop_sortingcxx . . $ gtk_sort_list_model_stop_sorting(762bbe791ef27c7c). (self, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 457 | return G_SOURCE_REMOVEcxx . . $ `<external>/1856471541377536744/gmain.h:475:9`!; |
| 458 | } |
| 459 | |
| 460 | static int |
| 461 | sort_funccxx . . $ sort_func(b8f62d2ccbc12f7d). (gconstpointercxx . . $ gconstpointer# a, |
| 462 | gconstpointercxx . . $ gconstpointer# b, |
| 463 | gpointercxx . . $ gpointer# data) |
| 464 | { |
| 465 | gpointercxx . . $ gpointer# *sa = (gpointercxx . . $ gpointer# *) a; |
| 466 | gpointercxx . . $ gpointer# *sb = (gpointercxx . . $ gpointer# *) b; |
| 467 | int result; |
| 468 | |
| 469 | result = gtk_sort_keys_comparecxx . . $ gtk_sort_keys_compare(8b25bfb04e75b443). (data, *sa, *sb); |
| 470 | if (result) |
| 471 | return result; |
| 472 | |
| 473 | return *sa < *sb ? -1 : 1; |
| 474 | } |
| 475 | |
| 476 | static gbooleancxx . . $ gboolean# |
| 477 | gtk_sort_list_model_start_sortingcxx . . $ gtk_sort_list_model_start_sorting(e8b293e475b0686d). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 478 | gsizecxx . . $ gsize# *runs) |
| 479 | { |
| 480 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (self->sort_cb == 0); |
| 481 | |
| 482 | gtk_tim_sort_initcxx . . $ gtk_tim_sort_init(42e5fc7dfac18a70). (&self->sortcxx . . $ _GtkSortListModel#sort., |
| 483 | self->positionscxx . . $ _GtkSortListModel#positions., |
| 484 | self->n_itemscxx . . $ _GtkSortListModel#n_items., |
| 485 | sizeof (gpointercxx . . $ gpointer#), |
| 486 | sort_funccxx . . $ sort_func(b8f62d2ccbc12f7d)., |
| 487 | self->sort_keyscxx . . $ _GtkSortListModel#sort_keys.); |
| 488 | if (runs) |
| 489 | gtk_tim_sort_set_runscxx . . $ gtk_tim_sort_set_runs(17a0b685f1963d27). (&self->sortcxx . . $ _GtkSortListModel#sort., runs); |
| 490 | if (self->incrementalcxx . . $ _GtkSortListModel#incremental.) |
| 491 | gtk_tim_sort_set_max_merge_sizecxx . . $ gtk_tim_sort_set_max_merge_size(9dcb2f516e86b67b). (&self->sortcxx . . $ _GtkSortListModel#sort., GTK_SORT_MAX_MERGE_SIZEcxx . . $ `gtk/gtksortlistmodel.c:44:9`!); |
| 492 | |
| 493 | if (!self->incrementalcxx . . $ _GtkSortListModel#incremental.) |
| 494 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 495 | |
| 496 | self->sort_cbcxx . . $ _GtkSortListModel#sort_cb. = g_idle_addcxx . . $ g_idle_add(2deff12c7cdf5ff5). (gtk_sort_list_model_sort_cbcxx . . $ gtk_sort_list_model_sort_cb(dedf1e9b1c614a07)., self); |
| 497 | gdk_source_set_static_name_by_idcxx . . $ gdk_source_set_static_name_by_id(d7adf5cfafc0e15a). (self->sort_cbcxx . . $ _GtkSortListModel#sort_cb., "[gtk] gtk_sort_list_model_sort_cb"); |
| 498 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_PENDINGcxx . . $ PROP_PENDING.]); |
| 499 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 500 | } |
| 501 | |
| 502 | static void |
| 503 | gtk_sort_list_model_finish_sortingcxx . . $ gtk_sort_list_model_finish_sorting(d2230e1368d4a41). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 504 | guintcxx . . $ guint# *pos, |
| 505 | guintcxx . . $ guint# *n_items) |
| 506 | { |
| 507 | gtk_tim_sort_set_max_merge_sizecxx . . $ gtk_tim_sort_set_max_merge_size(9dcb2f516e86b67b). (&self->sortcxx . . $ _GtkSortListModel#sort., 0); |
| 508 | |
| 509 | gtk_sort_list_model_sort_stepcxx . . $ gtk_sort_list_model_sort_step(2dbf91f1ccb80911). (self, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, pos, n_items); |
| 510 | gtk_tim_sort_finishcxx . . $ gtk_tim_sort_finish(66cb275ad66ec7e0). (&self->sortcxx . . $ _GtkSortListModel#sort.); |
| 511 | |
| 512 | gtk_sort_list_model_stop_sortingcxx . . $ gtk_sort_list_model_stop_sorting(762bbe791ef27c7c). (self, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 513 | } |
| 514 | |
| 515 | static void |
| 516 | gtk_sort_list_model_clear_sort_keyscxx . . $ gtk_sort_list_model_clear_sort_keys(f75ddf6919e0d543). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 517 | guintcxx . . $ guint# position, |
| 518 | guintcxx . . $ guint# n_items) |
| 519 | { |
| 520 | GtkBitsetItercxx . . $ GtkBitsetIter# iter; |
| 521 | GtkBitsetcxx . . $ GtkBitset# *clear; |
| 522 | guintcxx . . $ guint# pos; |
| 523 | |
| 524 | if (!gtk_sort_keys_needs_clear_keycxx . . $ gtk_sort_keys_needs_clear_key(4a7641e5a2948234). (self->sort_keyscxx . . $ _GtkSortListModel#sort_keys.)) |
| 525 | return; |
| 526 | |
| 527 | clear = gtk_bitset_new_rangecxx . . $ gtk_bitset_new_range(64e2fc13bc89d53a). (position, n_items); |
| 528 | gtk_bitset_subtractcxx . . $ gtk_bitset_subtract(520b88407e229cb9). (clear, self->missing_keyscxx . . $ _GtkSortListModel#missing_keys.); |
| 529 | |
| 530 | for (gtk_bitset_iter_init_firstcxx . . $ gtk_bitset_iter_init_first(6a467db681b923c8). (&iter, clear, &pos); |
| 531 | gtk_bitset_iter_is_validcxx . . $ gtk_bitset_iter_is_valid(d97646fb588d01). (&iter); |
| 532 | gtk_bitset_iter_nextcxx . . $ gtk_bitset_iter_next(244371cbdf2d6e67). (&iter, &pos)) |
| 533 | { |
| 534 | gtk_sort_keys_clear_keycxx . . $ gtk_sort_keys_clear_key(fc995e6bdefb588e). (self->sort_keyscxx . . $ _GtkSortListModel#sort_keys., key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, pos)); |
| 535 | } |
| 536 | |
| 537 | gtk_bitset_unrefcxx . . $ gtk_bitset_unref(a981648d8e5e1e8a). (clear); |
| 538 | } |
| 539 | |
| 540 | static void |
| 541 | gtk_sort_list_model_clear_keyscxx . . $ gtk_sort_list_model_clear_keys(c864703ba79740d4). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 542 | { |
| 543 | gtk_sort_list_model_clear_sort_keyscxx . . $ gtk_sort_list_model_clear_sort_keys(f75ddf6919e0d543). (self, 0, self->n_itemscxx . . $ _GtkSortListModel#n_items.); |
| 544 | |
| 545 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->missing_keys, gtk_bitset_unref); |
| 546 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->keys, g_free); |
| 547 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->sort_keys, gtk_sort_keys_unref); |
| 548 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->section_sort_keys, gtk_sort_keys_unref); |
| 549 | self->key_sizecxx . . $ _GtkSortListModel#key_size. = 0; |
| 550 | } |
| 551 | |
| 552 | static void |
| 553 | gtk_sort_list_model_clear_itemscxx . . $ gtk_sort_list_model_clear_items(d2230e1368d4a41). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 554 | guintcxx . . $ guint# *pos, |
| 555 | guintcxx . . $ guint# *n_items) |
| 556 | { |
| 557 | gtk_sort_list_model_stop_sortingcxx . . $ gtk_sort_list_model_stop_sorting(762bbe791ef27c7c). (self, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 558 | |
| 559 | if (self->sort_keyscxx . . $ _GtkSortListModel#sort_keys. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 560 | { |
| 561 | if (pos || n_items) |
| 562 | *pos = *n_items = 0; |
| 563 | return; |
| 564 | } |
| 565 | |
| 566 | if (pos || n_items) |
| 567 | { |
| 568 | guintcxx . . $ guint# start, end; |
| 569 | |
| 570 | for (start = 0; start < self->n_itemscxx . . $ _GtkSortListModel#n_items.; start++) |
| 571 | { |
| 572 | if (pos_from_keycxx . . $ pos_from_key(cbb0c22fd3419499). (self, self->positionscxx . . $ _GtkSortListModel#positions.[start]) != + start) |
| 573 | break; |
| 574 | } |
| 575 | for (end = self->n_itemscxx . . $ _GtkSortListModel#n_items.; end > start; end--) |
| 576 | { |
| 577 | if (pos_from_keycxx . . $ pos_from_key(cbb0c22fd3419499). (self, self->positionscxx . . $ _GtkSortListModel#positions.[end - 1]) != end - 1) |
| 578 | break; |
| 579 | } |
| 580 | |
| 581 | *n_items = end - start; |
| 582 | if (*n_items == 0) |
| 583 | *pos = 0; |
| 584 | else |
| 585 | *pos = start; |
| 586 | } |
| 587 | |
| 588 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->positions, g_free); |
| 589 | |
| 590 | gtk_sort_list_model_clear_keyscxx . . $ gtk_sort_list_model_clear_keys(c864703ba79740d4). (self); |
| 591 | } |
| 592 | |
| 593 | static gbooleancxx . . $ gboolean# |
| 594 | gtk_sort_list_model_should_sortcxx . . $ gtk_sort_list_model_should_sort(ca2f0979a7cbc8e6). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 595 | { |
| 596 | return self->real_sortercxx . . $ _GtkSortListModel#real_sorter. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && |
| 597 | self->modelcxx . . $ _GtkSortListModel#model. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && |
| 598 | gtk_sorter_get_ordercxx . . $ gtk_sorter_get_order(4b53baa32927438b). (self->real_sortercxx . . $ _GtkSortListModel#real_sorter.) != GTK_SORTER_ORDER_NONEcxx . . $ GTK_SORTER_ORDER_NONE.; |
| 599 | } |
| 600 | |
| 601 | static void |
| 602 | gtk_sort_list_model_create_keyscxx . . $ gtk_sort_list_model_create_keys(c864703ba79740d4). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 603 | { |
| 604 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (self->keys == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 605 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (self->sort_keys == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 606 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (self->section_sort_keys == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 607 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (self->key_size == 0); |
| 608 | |
| 609 | self->sort_keyscxx . . $ _GtkSortListModel#sort_keys. = gtk_sorter_get_keyscxx . . $ gtk_sorter_get_keys(d19169138b9ed4a1). (self->real_sortercxx . . $ _GtkSortListModel#real_sorter.); |
| 610 | if (self->section_sortercxx . . $ _GtkSortListModel#section_sorter.) |
| 611 | self->section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys. = gtk_sorter_get_keyscxx . . $ gtk_sorter_get_keys(d19169138b9ed4a1). (self->section_sortercxx . . $ _GtkSortListModel#section_sorter.); |
| 612 | self->key_sizecxx . . $ _GtkSortListModel#key_size. = GTK_SORT_KEYS_ALIGNcxx . . $ `gtk/gtksortkeysprivate.h:70:9`! (gtk_sort_keys_get_key_size (self->sort_keys), |
| 613 | gtk_sort_keys_get_key_align (self->sort_keys)); |
| 614 | self->keyscxx . . $ _GtkSortListModel#keys. = g_malloc_ncxx . . $ g_malloc_n(63a7bf2941bfcd7a). (self->n_itemscxx . . $ _GtkSortListModel#n_items., self->key_sizecxx . . $ _GtkSortListModel#key_size.); |
| 615 | self->missing_keyscxx . . $ _GtkSortListModel#missing_keys. = gtk_bitset_new_rangecxx . . $ gtk_bitset_new_range(64e2fc13bc89d53a). (0, self->n_itemscxx . . $ _GtkSortListModel#n_items.); |
| 616 | } |
| 617 | |
| 618 | static void |
| 619 | gtk_sort_list_model_create_itemscxx . . $ gtk_sort_list_model_create_items(c864703ba79740d4). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 620 | { |
| 621 | guintcxx . . $ guint# i; |
| 622 | |
| 623 | if (!gtk_sort_list_model_should_sortcxx . . $ gtk_sort_list_model_should_sort(ca2f0979a7cbc8e6). (self)) |
| 624 | return; |
| 625 | |
| 626 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (self->sort_keys == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 627 | |
| 628 | self->positionscxx . . $ _GtkSortListModel#positions. = g_newcxx . . $ `<external>/1123956534522462559/gmem.h:318:9`! (gpointer, self->n_items); |
| 629 | |
| 630 | gtk_sort_list_model_create_keyscxx . . $ gtk_sort_list_model_create_keys(c864703ba79740d4). (self); |
| 631 | |
| 632 | for (i = 0; i < self->n_itemscxx . . $ _GtkSortListModel#n_items.; i++) |
| 633 | self->positionscxx . . $ _GtkSortListModel#positions.[i] = key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, i); |
| 634 | } |
| 635 | |
| 636 | /* This realloc()s the arrays but does not set the added values. */ |
| 637 | static void |
| 638 | gtk_sort_list_model_update_itemscxx . . $ gtk_sort_list_model_update_items(22bc80a46a2ff39). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 639 | gsizecxx . . $ gsize# runs[GTK_TIM_SORT_MAX_PENDINGcxx . . $ `gtk/timsort/gtktimsortprivate.h:28:9`! + 1], |
| 640 | guintcxx . . $ guint# position, |
| 641 | guintcxx . . $ guint# removed, |
| 642 | guintcxx . . $ guint# added, |
| 643 | guintcxx . . $ guint# *unmodified_start, |
| 644 | guintcxx . . $ guint# *unmodified_end) |
| 645 | { |
| 646 | guintcxx . . $ guint# i, n_items, valid; |
| 647 | guintcxx . . $ guint# run_index, valid_run, valid_run_end, run_end; |
| 648 | guintcxx . . $ guint# start, end; |
| 649 | gpointercxx . . $ gpointer# *old_keys; |
| 650 | |
| 651 | n_items = self->n_itemscxx . . $ _GtkSortListModel#n_items.; |
| 652 | start = n_items; |
| 653 | end = n_items; |
| 654 | |
| 655 | /* first, move the keys over */ |
| 656 | old_keys = self->keyscxx . . $ _GtkSortListModel#keys.; |
| 657 | gtk_sort_list_model_clear_sort_keyscxx . . $ gtk_sort_list_model_clear_sort_keys(f75ddf6919e0d543). (self, position, removed); |
| 658 | |
| 659 | if (removed > added) |
| 660 | { |
| 661 | memmovecxx . . $ memmove(cc817cb175f282d). (key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, position + added), |
| 662 | key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, position + removed), |
| 663 | self->key_sizecxx . . $ _GtkSortListModel#key_size. * (n_items - position - removed)); |
| 664 | self->keyscxx . . $ _GtkSortListModel#keys. = g_realloc_ncxx . . $ g_realloc_n(dfa4a9ebc9436eff). (self->keyscxx . . $ _GtkSortListModel#keys., n_items - removed + added, self->key_sizecxx . . $ _GtkSortListModel#key_size.); |
| 665 | } |
| 666 | else if (removed < added) |
| 667 | { |
| 668 | self->keyscxx . . $ _GtkSortListModel#keys. = g_realloc_ncxx . . $ g_realloc_n(dfa4a9ebc9436eff). (self->keyscxx . . $ _GtkSortListModel#keys., n_items - removed + added, self->key_sizecxx . . $ _GtkSortListModel#key_size.); |
| 669 | memmovecxx . . $ memmove(cc817cb175f282d). (key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, position + added), |
| 670 | key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, position + removed), |
| 671 | self->key_sizecxx . . $ _GtkSortListModel#key_size. * (n_items - position - removed)); |
| 672 | } |
| 673 | |
| 674 | /* then, update the positions */ |
| 675 | valid = 0; |
| 676 | valid_run = 0; |
| 677 | valid_run_end = 0; |
| 678 | run_index = 0; |
| 679 | run_end = 0; |
| 680 | for (i = 0; i < n_items;) |
| 681 | { |
| 682 | if (runs[run_index] == 0) |
| 683 | { |
| 684 | run_end = n_items; |
| 685 | valid_run_end = G_MAXUINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:40:9`!; |
| 686 | } |
| 687 | else |
| 688 | { |
| 689 | run_end += runs[run_index++]; |
| 690 | } |
| 691 | |
| 692 | for (; i < run_end; i++) |
| 693 | { |
| 694 | guintcxx . . $ guint# pos = ((char *) self->positionscxx . . $ _GtkSortListModel#positions.[i] - (char *) old_keys) / self->key_sizecxx . . $ _GtkSortListModel#key_size.; |
| 695 | |
| 696 | if (pos >= position + removed) |
| 697 | pos = pos - removed + added; |
| 698 | else if (pos >= position) |
| 699 | { |
| 700 | start = MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (start, valid); |
| 701 | end = n_items - i - 1; |
| 702 | continue; |
| 703 | } |
| 704 | |
| 705 | self->positionscxx . . $ _GtkSortListModel#positions.[valid] = key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, pos); |
| 706 | valid++; |
| 707 | } |
| 708 | |
| 709 | if (valid_run_end < valid) |
| 710 | { |
| 711 | runs[valid_run++] = valid - valid_run_end; |
| 712 | valid_run_end = valid; |
| 713 | } |
| 714 | } |
| 715 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (i == n_items); |
| 716 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (valid == n_items - removed); |
| 717 | runs[valid_run] = 0; |
| 718 | |
| 719 | self->positionscxx . . $ _GtkSortListModel#positions. = g_renewcxx . . $ `<external>/1123956534522462559/gmem.h:349:9`! (gpointer, self->positions, n_items - removed + added); |
| 720 | |
| 721 | if (self->missing_keyscxx . . $ _GtkSortListModel#missing_keys.) |
| 722 | { |
| 723 | gtk_bitset_splicecxx . . $ gtk_bitset_splice(369a4ae45433a81b). (self->missing_keyscxx . . $ _GtkSortListModel#missing_keys., position, removed, added); |
| 724 | gtk_bitset_add_rangecxx . . $ gtk_bitset_add_range(ea2408edad2b84f4). (self->missing_keyscxx . . $ _GtkSortListModel#missing_keys., position, added); |
| 725 | } |
| 726 | |
| 727 | self->n_itemscxx . . $ _GtkSortListModel#n_items. = n_items - removed + added; |
| 728 | |
| 729 | for (i = 0; i < added; i++) |
| 730 | { |
| 731 | self->positionscxx . . $ _GtkSortListModel#positions.[self->n_itemscxx . . $ _GtkSortListModel#n_items. - added + i] = key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, position + i); |
| 732 | } |
| 733 | |
| 734 | *unmodified_start = start; |
| 735 | *unmodified_end = end; |
| 736 | } |
| 737 | |
| 738 | static void |
| 739 | gtk_sort_list_model_items_changed_cbcxx . . $ gtk_sort_list_model_items_changed_cb(80f0bb02614f0e9). (GListModelcxx . . $ GListModel# *model, |
| 740 | guintcxx . . $ guint# position, |
| 741 | guintcxx . . $ guint# removed, |
| 742 | guintcxx . . $ guint# added, |
| 743 | GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 744 | { |
| 745 | gsizecxx . . $ gsize# runs[GTK_TIM_SORT_MAX_PENDINGcxx . . $ `gtk/timsort/gtktimsortprivate.h:28:9`! + 1]; |
| 746 | guintcxx . . $ guint# i, n_items, start, end; |
| 747 | gbooleancxx . . $ gboolean# was_sorting; |
| 748 | |
| 749 | if (removed == 0 && added == 0) |
| 750 | return; |
| 751 | |
| 752 | if (!gtk_sort_list_model_should_sortcxx . . $ gtk_sort_list_model_should_sort(ca2f0979a7cbc8e6). (self)) |
| 753 | { |
| 754 | self->n_itemscxx . . $ _GtkSortListModel#n_items. = self->n_itemscxx . . $ _GtkSortListModel#n_items. - removed + added; |
| 755 | g_list_model_items_changedcxx . . $ g_list_model_items_changed(2896dae0034144d8). (G_LIST_MODELcxx . . $ G_LIST_MODEL(26f73d2a39e7201f). (self), position, removed, added); |
| 756 | if (removed != added) |
| 757 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_N_ITEMScxx . . $ PROP_N_ITEMS.]); |
| 758 | return; |
| 759 | } |
| 760 | |
| 761 | was_sorting = gtk_sort_list_model_is_sortingcxx . . $ gtk_sort_list_model_is_sorting(ca2f0979a7cbc8e6). (self); |
| 762 | gtk_sort_list_model_stop_sortingcxx . . $ gtk_sort_list_model_stop_sorting(762bbe791ef27c7c). (self, runs); |
| 763 | |
| 764 | gtk_sort_list_model_update_itemscxx . . $ gtk_sort_list_model_update_items(22bc80a46a2ff39). (self, runs, position, removed, added, &start, &end); |
| 765 | |
| 766 | if (added > 0) |
| 767 | { |
| 768 | if (gtk_sort_list_model_start_sortingcxx . . $ gtk_sort_list_model_start_sorting(e8b293e475b0686d). (self, runs)) |
| 769 | { |
| 770 | end = 0; |
| 771 | } |
| 772 | else |
| 773 | { |
| 774 | guintcxx . . $ guint# pos, n; |
| 775 | gtk_sort_list_model_finish_sortingcxx . . $ gtk_sort_list_model_finish_sorting(d2230e1368d4a41). (self, &pos, &n); |
| 776 | if (n) |
| 777 | start = MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (start, pos); |
| 778 | /* find first item that was added */ |
| 779 | for (i = 0; i < end; i++) |
| 780 | { |
| 781 | pos = pos_from_keycxx . . $ pos_from_key(cbb0c22fd3419499). (self, self->positionscxx . . $ _GtkSortListModel#positions.[self->n_itemscxx . . $ _GtkSortListModel#n_items. - i - 1]); |
| 782 | if (pos >= position && pos < position + added) |
| 783 | { |
| 784 | end = i; |
| 785 | break; |
| 786 | } |
| 787 | } |
| 788 | } |
| 789 | } |
| 790 | else |
| 791 | { |
| 792 | if (was_sorting) |
| 793 | gtk_sort_list_model_start_sortingcxx . . $ gtk_sort_list_model_start_sorting(e8b293e475b0686d). (self, runs); |
| 794 | } |
| 795 | |
| 796 | n_items = self->n_itemscxx . . $ _GtkSortListModel#n_items. - start - end; |
| 797 | g_list_model_items_changedcxx . . $ g_list_model_items_changed(2896dae0034144d8). (G_LIST_MODELcxx . . $ G_LIST_MODEL(26f73d2a39e7201f). (self), start, n_items - added + removed, n_items); |
| 798 | if (removed != added) |
| 799 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_N_ITEMScxx . . $ PROP_N_ITEMS.]); |
| 800 | } |
| 801 | |
| 802 | static void |
| 803 | gtk_sort_list_model_set_propertycxx . . $ gtk_sort_list_model_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *object, |
| 804 | guintcxx . . $ guint# prop_id, |
| 805 | const GValuecxx . . $ GValue# *value, |
| 806 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 807 | { |
| 808 | GtkSortListModelcxx . . $ GtkSortListModel# *self = GTK_SORT_LIST_MODELcxx . . $ GTK_SORT_LIST_MODEL(9213e74d72ebfc32). (object); |
| 809 | |
| 810 | switch (prop_id) |
| 811 | { |
| 812 | case PROP_INCREMENTALcxx . . $ PROP_INCREMENTAL.: |
| 813 | gtk_sort_list_model_set_incrementalcxx . . $ gtk_sort_list_model_set_incremental(45ab7e0fa447a740). (self, g_value_get_booleancxx . . $ g_value_get_boolean(f890c5c75ead5b21). (value)); |
| 814 | break; |
| 815 | |
| 816 | case PROP_MODELcxx . . $ PROP_MODEL.: |
| 817 | gtk_sort_list_model_set_modelcxx . . $ gtk_sort_list_model_set_model(5099fcb9b5576b05). (self, g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value)); |
| 818 | break; |
| 819 | |
| 820 | case PROP_SECTION_SORTERcxx . . $ PROP_SECTION_SORTER.: |
| 821 | gtk_sort_list_model_set_section_sortercxx . . $ gtk_sort_list_model_set_section_sorter(2def8541674f11ea). (self, g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value)); |
| 822 | break; |
| 823 | |
| 824 | case PROP_SORTERcxx . . $ PROP_SORTER.: |
| 825 | gtk_sort_list_model_set_sortercxx . . $ gtk_sort_list_model_set_sorter(2def8541674f11ea). (self, g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value)); |
| 826 | break; |
| 827 | |
| 828 | default: |
| 829 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec); |
| 830 | break; |
| 831 | } |
| 832 | } |
| 833 | |
| 834 | static void |
| 835 | gtk_sort_list_model_get_propertycxx . . $ gtk_sort_list_model_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *object, |
| 836 | guintcxx . . $ guint# prop_id, |
| 837 | GValuecxx . . $ GValue# *value, |
| 838 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 839 | { |
| 840 | GtkSortListModelcxx . . $ GtkSortListModel# *self = GTK_SORT_LIST_MODELcxx . . $ GTK_SORT_LIST_MODEL(9213e74d72ebfc32). (object); |
| 841 | |
| 842 | switch (prop_id) |
| 843 | { |
| 844 | case PROP_INCREMENTALcxx . . $ PROP_INCREMENTAL.: |
| 845 | g_value_set_booleancxx . . $ g_value_set_boolean(b698c61e8e30c4ea). (value, self->incrementalcxx . . $ _GtkSortListModel#incremental.); |
| 846 | break; |
| 847 | |
| 848 | case PROP_ITEM_TYPEcxx . . $ PROP_ITEM_TYPE.: |
| 849 | g_value_set_gtypecxx . . $ g_value_set_gtype(235192cae6c1f0e4). (value, gtk_sort_list_model_get_item_typecxx . . $ gtk_sort_list_model_get_item_type(94bfa31565da8ed5). (G_LIST_MODELcxx . . $ G_LIST_MODEL(26f73d2a39e7201f). (self))); |
| 850 | break; |
| 851 | |
| 852 | case PROP_MODELcxx . . $ PROP_MODEL.: |
| 853 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, self->modelcxx . . $ _GtkSortListModel#model.); |
| 854 | break; |
| 855 | |
| 856 | case PROP_N_ITEMScxx . . $ PROP_N_ITEMS.: |
| 857 | g_value_set_uintcxx . . $ g_value_set_uint(f81c5c84daf56975). (value, gtk_sort_list_model_get_n_itemscxx . . $ gtk_sort_list_model_get_n_items(43b97f6a983b4be8). (G_LIST_MODELcxx . . $ G_LIST_MODEL(26f73d2a39e7201f). (self))); |
| 858 | break; |
| 859 | |
| 860 | case PROP_PENDINGcxx . . $ PROP_PENDING.: |
| 861 | g_value_set_uintcxx . . $ g_value_set_uint(f81c5c84daf56975). (value, gtk_sort_list_model_get_pendingcxx . . $ gtk_sort_list_model_get_pending(e4e7ebffa3182d0a). (self)); |
| 862 | break; |
| 863 | |
| 864 | case PROP_SECTION_SORTERcxx . . $ PROP_SECTION_SORTER.: |
| 865 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, self->section_sortercxx . . $ _GtkSortListModel#section_sorter.); |
| 866 | break; |
| 867 | |
| 868 | case PROP_SORTERcxx . . $ PROP_SORTER.: |
| 869 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, self->sortercxx . . $ _GtkSortListModel#sorter.); |
| 870 | break; |
| 871 | |
| 872 | default: |
| 873 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec); |
| 874 | break; |
| 875 | } |
| 876 | } |
| 877 | |
| 878 | static void |
| 879 | gtk_sort_list_model_sorter_changedcxx . . $ gtk_sort_list_model_sorter_changed(bbd49007ad938e00). (GtkSortercxx . . $ GtkSorter# *sorter, |
| 880 | int change, |
| 881 | GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 882 | gbooleancxx . . $ gboolean# sections_changed) |
| 883 | { |
| 884 | guintcxx . . $ guint# pos, n_items; |
| 885 | |
| 886 | if (gtk_sort_list_model_should_sortcxx . . $ gtk_sort_list_model_should_sort(ca2f0979a7cbc8e6). (self)) |
| 887 | { |
| 888 | gtk_sort_list_model_stop_sortingcxx . . $ gtk_sort_list_model_stop_sorting(762bbe791ef27c7c). (self, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 889 | |
| 890 | if (self->sort_keyscxx . . $ _GtkSortListModel#sort_keys. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 891 | { |
| 892 | gtk_sort_list_model_create_itemscxx . . $ gtk_sort_list_model_create_items(c864703ba79740d4). (self); |
| 893 | } |
| 894 | else |
| 895 | { |
| 896 | GtkSortKeyscxx . . $ GtkSortKeys# *new_keys = gtk_sorter_get_keyscxx . . $ gtk_sorter_get_keys(d19169138b9ed4a1). (sorter); |
| 897 | |
| 898 | if (!gtk_sort_keys_is_compatiblecxx . . $ gtk_sort_keys_is_compatible(4070d1c6f051bcd2). (new_keys, self->sort_keyscxx . . $ _GtkSortListModel#sort_keys.)) |
| 899 | { |
| 900 | char *old_keys = self->keyscxx . . $ _GtkSortListModel#keys.; |
| 901 | gsizecxx . . $ gsize# old_key_size = self->key_sizecxx . . $ _GtkSortListModel#key_size.; |
| 902 | guintcxx . . $ guint# i; |
| 903 | |
| 904 | gtk_sort_list_model_clear_keyscxx . . $ gtk_sort_list_model_clear_keys(c864703ba79740d4). (self); |
| 905 | gtk_sort_list_model_create_keyscxx . . $ gtk_sort_list_model_create_keys(c864703ba79740d4). (self); |
| 906 | |
| 907 | for (i = 0; i < self->n_itemscxx . . $ _GtkSortListModel#n_items.; i++) |
| 908 | self->positionscxx . . $ _GtkSortListModel#positions.[i] = key_from_poscxx . . $ key_from_pos(d67a1a18e1f9eee4). (self, ((char *) self->positionscxx . . $ _GtkSortListModel#positions.[i] - old_keys) / old_key_size); |
| 909 | |
| 910 | gtk_sort_keys_unrefcxx . . $ gtk_sort_keys_unref(67e512b7258cdc6c). (new_keys); |
| 911 | } |
| 912 | else |
| 913 | { |
| 914 | gtk_sort_keys_unrefcxx . . $ gtk_sort_keys_unref(67e512b7258cdc6c). (self->sort_keyscxx . . $ _GtkSortListModel#sort_keys.); |
| 915 | self->sort_keyscxx . . $ _GtkSortListModel#sort_keys. = new_keys; |
| 916 | } |
| 917 | } |
| 918 | |
| 919 | if (self->section_sortercxx . . $ _GtkSortListModel#section_sorter.) |
| 920 | { |
| 921 | gtk_sort_keys_unrefcxx . . $ gtk_sort_keys_unref(67e512b7258cdc6c). (self->section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys.); |
| 922 | self->section_sort_keyscxx . . $ _GtkSortListModel#section_sort_keys. = gtk_sorter_get_keyscxx . . $ gtk_sorter_get_keys(d19169138b9ed4a1). (self->section_sortercxx . . $ _GtkSortListModel#section_sorter.); |
| 923 | } |
| 924 | |
| 925 | if (gtk_sort_list_model_start_sortingcxx . . $ gtk_sort_list_model_start_sorting(e8b293e475b0686d). (self, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 926 | pos = n_items = 0; |
| 927 | else |
| 928 | gtk_sort_list_model_finish_sortingcxx . . $ gtk_sort_list_model_finish_sorting(d2230e1368d4a41). (self, &pos, &n_items); |
| 929 | } |
| 930 | else |
| 931 | { |
| 932 | gtk_sort_list_model_clear_itemscxx . . $ gtk_sort_list_model_clear_items(d2230e1368d4a41). (self, &pos, &n_items); |
| 933 | } |
| 934 | |
| 935 | if (sections_changed && self->n_itemscxx . . $ _GtkSortListModel#n_items. > 0) |
| 936 | { |
| 937 | if (n_items > 0) |
| 938 | g_list_model_items_changedcxx . . $ g_list_model_items_changed(2896dae0034144d8). (G_LIST_MODELcxx . . $ G_LIST_MODEL(26f73d2a39e7201f). (self), 0, self->n_itemscxx . . $ _GtkSortListModel#n_items., self->n_itemscxx . . $ _GtkSortListModel#n_items.); |
| 939 | else |
| 940 | gtk_section_model_sections_changedcxx . . $ gtk_section_model_sections_changed(769754b59bafb6d0). (GTK_SECTION_MODELcxx . . $ GTK_SECTION_MODEL(f2def7259fc93597). (self), 0, self->n_itemscxx . . $ _GtkSortListModel#n_items.); |
| 941 | } |
| 942 | else if (n_items > 0) |
| 943 | { |
| 944 | g_list_model_items_changedcxx . . $ g_list_model_items_changed(2896dae0034144d8). (G_LIST_MODELcxx . . $ G_LIST_MODEL(26f73d2a39e7201f). (self), pos, n_items, n_items); |
| 945 | } |
| 946 | } |
| 947 | |
| 948 | static void |
| 949 | gtk_sort_list_model_sorter_changed_cbcxx . . $ gtk_sort_list_model_sorter_changed_cb(bfe0e0163f214fed). (GtkSortercxx . . $ GtkSorter# *sorter, |
| 950 | int change, |
| 951 | GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 952 | { |
| 953 | gtk_sort_list_model_sorter_changedcxx . . $ gtk_sort_list_model_sorter_changed(bbd49007ad938e00). (sorter, change, self, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 954 | } |
| 955 | |
| 956 | static void |
| 957 | gtk_sort_list_model_clear_modelcxx . . $ gtk_sort_list_model_clear_model(c864703ba79740d4). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 958 | { |
| 959 | if (self->modelcxx . . $ _GtkSortListModel#model. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 960 | return; |
| 961 | |
| 962 | g_signal_handlers_disconnect_by_funccxx . . $ `<external>/15952772511652638895/gsignal.h:629:9`! (self->model, gtk_sort_list_model_items_changed_cb, self); |
| 963 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&self->model); |
| 964 | gtk_sort_list_model_clear_itemscxx . . $ gtk_sort_list_model_clear_items(d2230e1368d4a41). (self, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 965 | self->n_itemscxx . . $ _GtkSortListModel#n_items. = 0; |
| 966 | } |
| 967 | |
| 968 | static void |
| 969 | gtk_sort_list_model_clear_real_sortercxx . . $ gtk_sort_list_model_clear_real_sorter(c864703ba79740d4). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 970 | { |
| 971 | if (self->real_sortercxx . . $ _GtkSortListModel#real_sorter. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 972 | return; |
| 973 | |
| 974 | g_signal_handlers_disconnect_by_funccxx . . $ `<external>/15952772511652638895/gsignal.h:629:9`! (self->real_sorter, gtk_sort_list_model_sorter_changed_cb, self); |
| 975 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&self->real_sorter); |
| 976 | } |
| 977 | |
| 978 | static void |
| 979 | gtk_sort_list_model_ensure_real_sortercxx . . $ gtk_sort_list_model_ensure_real_sorter(45ab7e0fa447a740). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 980 | gbooleancxx . . $ gboolean# sections_changed) |
| 981 | { |
| 982 | if (self->sortercxx . . $ _GtkSortListModel#sorter.) |
| 983 | { |
| 984 | if (self->section_sortercxx . . $ _GtkSortListModel#section_sorter.) |
| 985 | { |
| 986 | GtkMultiSortercxx . . $ GtkMultiSorter# *multi; |
| 987 | |
| 988 | multi = gtk_multi_sorter_newcxx . . $ gtk_multi_sorter_new(1d46ddf50fccdeaf). (); |
| 989 | self->real_sortercxx . . $ _GtkSortListModel#real_sorter. = GTK_SORTERcxx . . $ GTK_SORTER(cf32dcc2d2e89335). (multi); |
| 990 | gtk_multi_sorter_appendcxx . . $ gtk_multi_sorter_append(1235e506f4d4be0b). (multi, g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (self->section_sorter)); |
| 991 | gtk_multi_sorter_appendcxx . . $ gtk_multi_sorter_append(1235e506f4d4be0b). (multi, g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (self->sorter)); |
| 992 | } |
| 993 | else |
| 994 | self->real_sortercxx . . $ _GtkSortListModel#real_sorter. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (self->sorter); |
| 995 | } |
| 996 | else |
| 997 | { |
| 998 | if (self->section_sortercxx . . $ _GtkSortListModel#section_sorter.) |
| 999 | self->real_sortercxx . . $ _GtkSortListModel#real_sorter. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (self->section_sorter); |
| 1000 | } |
| 1001 | |
| 1002 | if (self->real_sortercxx . . $ _GtkSortListModel#real_sorter.) |
| 1003 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (self->real_sorter, "changed", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (gtk_sort_list_model_sorter_changed_cb), self); |
| 1004 | |
| 1005 | gtk_sort_list_model_sorter_changedcxx . . $ gtk_sort_list_model_sorter_changed(bbd49007ad938e00). (self->real_sortercxx . . $ _GtkSortListModel#real_sorter., GTK_SORTER_CHANGE_DIFFERENTcxx . . $ GTK_SORTER_CHANGE_DIFFERENT., self, sections_changed); |
| 1006 | } |
| 1007 | |
| 1008 | static void |
| 1009 | gtk_sort_list_model_disposecxx . . $ gtk_sort_list_model_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 1010 | { |
| 1011 | GtkSortListModelcxx . . $ GtkSortListModel# *self = GTK_SORT_LIST_MODELcxx . . $ GTK_SORT_LIST_MODEL(9213e74d72ebfc32). (object); |
| 1012 | |
| 1013 | gtk_sort_list_model_clear_modelcxx . . $ gtk_sort_list_model_clear_model(c864703ba79740d4). (self); |
| 1014 | gtk_sort_list_model_clear_real_sortercxx . . $ gtk_sort_list_model_clear_real_sorter(c864703ba79740d4). (self); |
| 1015 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&self->section_sorter); |
| 1016 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&self->sorter); |
| 1017 | |
| 1018 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gtk_sort_list_model_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object); |
| 1019 | }; |
| 1020 | |
| 1021 | static void |
| 1022 | gtk_sort_list_model_class_initcxx . . $ gtk_sort_list_model_class_init(3789611a369bad76). (GtkSortListModelClasscxx . . $ GtkSortListModelClass# *class) |
| 1023 | { |
| 1024 | GObjectClasscxx . . $ GObjectClass# *gobject_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (class); |
| 1025 | |
| 1026 | gobject_class->set_propertycxx . . $ _GObjectClass#set_property. = gtk_sort_list_model_set_propertycxx . . $ gtk_sort_list_model_set_property(d7c4bb29f36c0dc4).; |
| 1027 | gobject_class->get_propertycxx . . $ _GObjectClass#get_property. = gtk_sort_list_model_get_propertycxx . . $ gtk_sort_list_model_get_property(cee2c52f22407c66).; |
| 1028 | gobject_class->disposecxx . . $ _GObjectClass#dispose. = gtk_sort_list_model_disposecxx . . $ gtk_sort_list_model_dispose(6087475fa43034d3).; |
| 1029 | |
| 1030 | /** |
| 1031 | * GtkSortListModel:incremental: |
| 1032 | * |
| 1033 | * If the model should sort items incrementally. |
| 1034 | */ |
| 1035 | propertiescxx . . $ properties.[PROP_INCREMENTALcxx . . $ PROP_INCREMENTAL.] = |
| 1036 | g_param_spec_booleancxx . . $ g_param_spec_boolean(315d86b79c0116e0). ("incremental", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1037 | FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, |
| 1038 | GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`! | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 1039 | |
| 1040 | /** |
| 1041 | * GtkSortListModel:item-type: |
| 1042 | * |
| 1043 | * The type of items. See [[email protected]_item_type]. |
| 1044 | * |
| 1045 | * Since: 4.8 |
| 1046 | **/ |
| 1047 | propertiescxx . . $ properties.[PROP_ITEM_TYPEcxx . . $ PROP_ITEM_TYPE.] = |
| 1048 | g_param_spec_gtypecxx . . $ g_param_spec_gtype(faf99966f027a127). ("item-type", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1049 | G_TYPE_OBJECTcxx . . $ `<external>/9567554376676449156/gtype.h:189:9`!, |
| 1050 | G_PARAM_READABLEcxx . . $ G_PARAM_READABLE. | G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`!); |
| 1051 | |
| 1052 | /** |
| 1053 | * GtkSortListModel:model: |
| 1054 | * |
| 1055 | * The model being sorted. |
| 1056 | */ |
| 1057 | propertiescxx . . $ properties.[PROP_MODELcxx . . $ PROP_MODEL.] = |
| 1058 | g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("model", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1059 | G_TYPE_LIST_MODELcxx . . $ `<external>/10117917155607792737/glistmodel.h:36:9`!, |
| 1060 | GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`! | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 1061 | |
| 1062 | /** |
| 1063 | * GtkSortListModel:n-items: |
| 1064 | * |
| 1065 | * The number of items. See [[email protected]_n_items]. |
| 1066 | * |
| 1067 | * Since: 4.8 |
| 1068 | **/ |
| 1069 | propertiescxx . . $ properties.[PROP_N_ITEMScxx . . $ PROP_N_ITEMS.] = |
| 1070 | g_param_spec_uintcxx . . $ g_param_spec_uint(503a1013c8de17d5). ("n-items", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1071 | 0, G_MAXUINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:40:9`!, 0, |
| 1072 | G_PARAM_READABLEcxx . . $ G_PARAM_READABLE. | G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`!); |
| 1073 | |
| 1074 | /** |
| 1075 | * GtkSortListModel:pending: |
| 1076 | * |
| 1077 | * Estimate of unsorted items remaining. |
| 1078 | */ |
| 1079 | propertiescxx . . $ properties.[PROP_PENDINGcxx . . $ PROP_PENDING.] = |
| 1080 | g_param_spec_uintcxx . . $ g_param_spec_uint(503a1013c8de17d5). ("pending", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1081 | 0, G_MAXUINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:40:9`!, 0, |
| 1082 | GTK_PARAM_READABLEcxx . . $ `gtk/gtkprivate.h:42:9`! | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 1083 | |
| 1084 | /** |
| 1085 | * GtkSortListModel:section-sorter: |
| 1086 | * |
| 1087 | * The section sorter for this model, if one is set. |
| 1088 | * |
| 1089 | * Since: 4.12 |
| 1090 | */ |
| 1091 | propertiescxx . . $ properties.[PROP_SECTION_SORTERcxx . . $ PROP_SECTION_SORTER.] = |
| 1092 | g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("section-sorter", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1093 | GTK_TYPE_SORTERcxx . . $ `gtk/gtksorter.h:70:9`!, |
| 1094 | GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`! | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 1095 | |
| 1096 | /** |
| 1097 | * GtkSortListModel:sorter: |
| 1098 | * |
| 1099 | * The sorter for this model. |
| 1100 | */ |
| 1101 | propertiescxx . . $ properties.[PROP_SORTERcxx . . $ PROP_SORTER.] = |
| 1102 | g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("sorter", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1103 | GTK_TYPE_SORTERcxx . . $ `gtk/gtksorter.h:70:9`!, |
| 1104 | GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`! | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 1105 | |
| 1106 | g_object_class_install_propertiescxx . . $ g_object_class_install_properties(569d03e6a4088541). (gobject_class, NUM_PROPERTIEScxx . . $ NUM_PROPERTIES., propertiescxx . . $ properties.); |
| 1107 | } |
| 1108 | |
| 1109 | static void |
| 1110 | gtk_sort_list_model_initcxx . . $ gtk_sort_list_model_init(c864703ba79740d4). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 1111 | { |
| 1112 | } |
| 1113 | |
| 1114 | /** |
| 1115 | * gtk_sort_list_model_new: |
| 1116 | * @model: (nullable) (transfer full): the model to sort |
| 1117 | * @sorter: (nullable) (transfer full): the `GtkSorter` to sort @model with, |
| 1118 | * |
| 1119 | * Creates a new sort list model that uses the @sorter to sort @model. |
| 1120 | * |
| 1121 | * Returns: a new `GtkSortListModel` |
| 1122 | */ |
| 1123 | GtkSortListModelcxx . . $ GtkSortListModel# * |
| 1124 | gtk_sort_list_model_newcxx . . $ gtk_sort_list_model_new(8824ba106326af8f). (GListModelcxx . . $ GListModel# *model, |
| 1125 | GtkSortercxx . . $ GtkSorter# *sorter) |
| 1126 | { |
| 1127 | GtkSortListModelcxx . . $ GtkSortListModel# *result; |
| 1128 | |
| 1129 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (model == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || G_IS_LIST_MODEL (model), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1130 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (sorter == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || GTK_IS_SORTER (sorter), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1131 | |
| 1132 | result = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_SORT_LIST_MODELcxx . . $ `gtk/gtksortlistmodel.h:34:9`!, |
| 1133 | "model", model, |
| 1134 | "sorter", sorter, |
| 1135 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1136 | |
| 1137 | /* consume the references */ |
| 1138 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&model); |
| 1139 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&sorter); |
| 1140 | |
| 1141 | return result; |
| 1142 | } |
| 1143 | |
| 1144 | /** |
| 1145 | * gtk_sort_list_model_set_model: |
| 1146 | * @self: a `GtkSortListModel` |
| 1147 | * @model: (nullable): The model to be sorted |
| 1148 | * |
| 1149 | * Sets the model to be sorted. |
| 1150 | * |
| 1151 | * The @model's item type must conform to the item type of @self. |
| 1152 | */ |
| 1153 | void |
| 1154 | gtk_sort_list_model_set_modelcxx . . $ gtk_sort_list_model_set_model(5099fcb9b5576b05). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 1155 | GListModelcxx . . $ GListModel# *model) |
| 1156 | { |
| 1157 | guintcxx . . $ guint# removed; |
| 1158 | |
| 1159 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_SORT_LIST_MODEL (self)); |
| 1160 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (model == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || G_IS_LIST_MODEL (model)); |
| 1161 | |
| 1162 | if (self->modelcxx . . $ _GtkSortListModel#model. == model) |
| 1163 | return; |
| 1164 | |
| 1165 | removed = g_list_model_get_n_itemscxx . . $ g_list_model_get_n_items(43b97f6a983b4be8). (G_LIST_MODELcxx . . $ G_LIST_MODEL(26f73d2a39e7201f). (self)); |
| 1166 | gtk_sort_list_model_clear_modelcxx . . $ gtk_sort_list_model_clear_model(c864703ba79740d4). (self); |
| 1167 | |
| 1168 | if (model) |
| 1169 | { |
| 1170 | guintcxx . . $ guint# ignore1, ignore2; |
| 1171 | |
| 1172 | self->modelcxx . . $ _GtkSortListModel#model. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (model); |
| 1173 | self->n_itemscxx . . $ _GtkSortListModel#n_items. = g_list_model_get_n_itemscxx . . $ g_list_model_get_n_items(43b97f6a983b4be8). (model); |
| 1174 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (model, "items-changed", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (gtk_sort_list_model_items_changed_cb), self); |
| 1175 | |
| 1176 | if (gtk_sort_list_model_should_sortcxx . . $ gtk_sort_list_model_should_sort(ca2f0979a7cbc8e6). (self)) |
| 1177 | { |
| 1178 | gtk_sort_list_model_create_itemscxx . . $ gtk_sort_list_model_create_items(c864703ba79740d4). (self); |
| 1179 | if (!gtk_sort_list_model_start_sortingcxx . . $ gtk_sort_list_model_start_sorting(e8b293e475b0686d). (self, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 1180 | gtk_sort_list_model_finish_sortingcxx . . $ gtk_sort_list_model_finish_sorting(d2230e1368d4a41). (self, &ignore1, &ignore2); |
| 1181 | } |
| 1182 | } |
| 1183 | |
| 1184 | if (removed > 0 || self->n_itemscxx . . $ _GtkSortListModel#n_items. > 0) |
| 1185 | g_list_model_items_changedcxx . . $ g_list_model_items_changed(2896dae0034144d8). (G_LIST_MODELcxx . . $ G_LIST_MODEL(26f73d2a39e7201f). (self), 0, removed, self->n_itemscxx . . $ _GtkSortListModel#n_items.); |
| 1186 | if (removed != self->n_itemscxx . . $ _GtkSortListModel#n_items.) |
| 1187 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_N_ITEMScxx . . $ PROP_N_ITEMS.]); |
| 1188 | |
| 1189 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_MODELcxx . . $ PROP_MODEL.]); |
| 1190 | } |
| 1191 | |
| 1192 | /** |
| 1193 | * gtk_sort_list_model_get_model: |
| 1194 | * @self: a `GtkSortListModel` |
| 1195 | * |
| 1196 | * Gets the model currently sorted or %NULL if none. |
| 1197 | * |
| 1198 | * Returns: (nullable) (transfer none): The model that gets sorted |
| 1199 | */ |
| 1200 | GListModelcxx . . $ GListModel# * |
| 1201 | gtk_sort_list_model_get_modelcxx . . $ gtk_sort_list_model_get_model(a063d7010576d3bf). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 1202 | { |
| 1203 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_SORT_LIST_MODEL (self), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1204 | |
| 1205 | return self->modelcxx . . $ _GtkSortListModel#model.; |
| 1206 | } |
| 1207 | |
| 1208 | /** |
| 1209 | * gtk_sort_list_model_set_sorter: |
| 1210 | * @self: a `GtkSortListModel` |
| 1211 | * @sorter: (nullable): the `GtkSorter` to sort @model with |
| 1212 | * |
| 1213 | * Sets a new sorter on @self. |
| 1214 | */ |
| 1215 | void |
| 1216 | gtk_sort_list_model_set_sortercxx . . $ gtk_sort_list_model_set_sorter(2def8541674f11ea). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 1217 | GtkSortercxx . . $ GtkSorter# *sorter) |
| 1218 | { |
| 1219 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_SORT_LIST_MODEL (self)); |
| 1220 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (sorter == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || GTK_IS_SORTER (sorter)); |
| 1221 | |
| 1222 | if (self->sortercxx . . $ _GtkSortListModel#sorter. == sorter) |
| 1223 | return; |
| 1224 | |
| 1225 | gtk_sort_list_model_clear_real_sortercxx . . $ gtk_sort_list_model_clear_real_sorter(c864703ba79740d4). (self); |
| 1226 | g_set_objectcxx . . $ `<external>/1341695927569185362/gobject.h:762:9`! (&self->sorter, sorter); |
| 1227 | gtk_sort_list_model_ensure_real_sortercxx . . $ gtk_sort_list_model_ensure_real_sorter(45ab7e0fa447a740). (self, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 1228 | |
| 1229 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_SORTERcxx . . $ PROP_SORTER.]); |
| 1230 | } |
| 1231 | |
| 1232 | /** |
| 1233 | * gtk_sort_list_model_get_sorter: |
| 1234 | * @self: a `GtkSortListModel` |
| 1235 | * |
| 1236 | * Gets the sorter that is used to sort @self. |
| 1237 | * |
| 1238 | * Returns: (nullable) (transfer none): the sorter of #self |
| 1239 | */ |
| 1240 | GtkSortercxx . . $ GtkSorter# * |
| 1241 | gtk_sort_list_model_get_sortercxx . . $ gtk_sort_list_model_get_sorter(54dfe339e9ca36c4). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 1242 | { |
| 1243 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_SORT_LIST_MODEL (self), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1244 | |
| 1245 | return self->sortercxx . . $ _GtkSortListModel#sorter.; |
| 1246 | } |
| 1247 | |
| 1248 | /** |
| 1249 | * gtk_sort_list_model_set_section_sorter: |
| 1250 | * @self: a `GtkSortListModel` |
| 1251 | * @sorter: (nullable): the `GtkSorter` to sort @model with |
| 1252 | * |
| 1253 | * Sets a new section sorter on @self. |
| 1254 | * |
| 1255 | * Since: 4.12 |
| 1256 | */ |
| 1257 | void |
| 1258 | gtk_sort_list_model_set_section_sortercxx . . $ gtk_sort_list_model_set_section_sorter(2def8541674f11ea). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 1259 | GtkSortercxx . . $ GtkSorter# *sorter) |
| 1260 | { |
| 1261 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_SORT_LIST_MODEL (self)); |
| 1262 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (sorter == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || GTK_IS_SORTER (sorter)); |
| 1263 | |
| 1264 | if (self->section_sortercxx . . $ _GtkSortListModel#section_sorter. == sorter) |
| 1265 | return; |
| 1266 | |
| 1267 | gtk_sort_list_model_clear_real_sortercxx . . $ gtk_sort_list_model_clear_real_sorter(c864703ba79740d4). (self); |
| 1268 | g_set_objectcxx . . $ `<external>/1341695927569185362/gobject.h:762:9`! (&self->section_sorter, sorter); |
| 1269 | gtk_sort_list_model_ensure_real_sortercxx . . $ gtk_sort_list_model_ensure_real_sorter(45ab7e0fa447a740). (self, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 1270 | |
| 1271 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_SECTION_SORTERcxx . . $ PROP_SECTION_SORTER.]); |
| 1272 | } |
| 1273 | |
| 1274 | /** |
| 1275 | * gtk_sort_list_model_get_section_sorter: |
| 1276 | * @self: a `GtkSortListModel` |
| 1277 | * |
| 1278 | * Gets the section sorter that is used to sort items of @self into |
| 1279 | * sections. |
| 1280 | * |
| 1281 | * Returns: (nullable) (transfer none): the sorter of #self |
| 1282 | * |
| 1283 | * Since: 4.12 |
| 1284 | */ |
| 1285 | GtkSortercxx . . $ GtkSorter# * |
| 1286 | gtk_sort_list_model_get_section_sortercxx . . $ gtk_sort_list_model_get_section_sorter(54dfe339e9ca36c4). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 1287 | { |
| 1288 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_SORT_LIST_MODEL (self), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1289 | |
| 1290 | return self->section_sortercxx . . $ _GtkSortListModel#section_sorter.; |
| 1291 | } |
| 1292 | |
| 1293 | /** |
| 1294 | * gtk_sort_list_model_set_incremental: |
| 1295 | * @self: a `GtkSortListModel` |
| 1296 | * @incremental: %TRUE to sort incrementally |
| 1297 | * |
| 1298 | * Sets the sort model to do an incremental sort. |
| 1299 | * |
| 1300 | * When incremental sorting is enabled, the `GtkSortListModel` will not do |
| 1301 | * a complete sort immediately, but will instead queue an idle handler that |
| 1302 | * incrementally sorts the items towards their correct position. This of |
| 1303 | * course means that items do not instantly appear in the right place. It |
| 1304 | * also means that the total sorting time is a lot slower. |
| 1305 | * |
| 1306 | * When your filter blocks the UI while sorting, you might consider |
| 1307 | * turning this on. Depending on your model and sorters, this may become |
| 1308 | * interesting around 10,000 to 100,000 items. |
| 1309 | * |
| 1310 | * By default, incremental sorting is disabled. |
| 1311 | * |
| 1312 | * See [[email protected]_pending] for progress information |
| 1313 | * about an ongoing incremental sorting operation. |
| 1314 | */ |
| 1315 | void |
| 1316 | gtk_sort_list_model_set_incrementalcxx . . $ gtk_sort_list_model_set_incremental(45ab7e0fa447a740). (GtkSortListModelcxx . . $ GtkSortListModel# *self, |
| 1317 | gbooleancxx . . $ gboolean# incremental) |
| 1318 | { |
| 1319 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_SORT_LIST_MODEL (self)); |
| 1320 | |
| 1321 | if (self->incrementalcxx . . $ _GtkSortListModel#incremental. == incremental) |
| 1322 | return; |
| 1323 | |
| 1324 | self->incrementalcxx . . $ _GtkSortListModel#incremental. = incremental; |
| 1325 | |
| 1326 | if (!incremental && gtk_sort_list_model_is_sortingcxx . . $ gtk_sort_list_model_is_sorting(ca2f0979a7cbc8e6). (self)) |
| 1327 | { |
| 1328 | guintcxx . . $ guint# pos, n_items; |
| 1329 | |
| 1330 | gtk_sort_list_model_finish_sortingcxx . . $ gtk_sort_list_model_finish_sorting(d2230e1368d4a41). (self, &pos, &n_items); |
| 1331 | if (n_items) |
| 1332 | g_list_model_items_changedcxx . . $ g_list_model_items_changed(2896dae0034144d8). (G_LIST_MODELcxx . . $ G_LIST_MODEL(26f73d2a39e7201f). (self), pos, n_items, n_items); |
| 1333 | } |
| 1334 | |
| 1335 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_INCREMENTALcxx . . $ PROP_INCREMENTAL.]); |
| 1336 | } |
| 1337 | |
| 1338 | /** |
| 1339 | * gtk_sort_list_model_get_incremental: |
| 1340 | * @self: a `GtkSortListModel` |
| 1341 | * |
| 1342 | * Returns whether incremental sorting is enabled. |
| 1343 | * |
| 1344 | * See [[email protected]_incremental]. |
| 1345 | * |
| 1346 | * Returns: %TRUE if incremental sorting is enabled |
| 1347 | */ |
| 1348 | gbooleancxx . . $ gboolean# |
| 1349 | gtk_sort_list_model_get_incrementalcxx . . $ gtk_sort_list_model_get_incremental(ca2f0979a7cbc8e6). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 1350 | { |
| 1351 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_SORT_LIST_MODEL (self), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 1352 | |
| 1353 | return self->incrementalcxx . . $ _GtkSortListModel#incremental.; |
| 1354 | } |
| 1355 | |
| 1356 | /** |
| 1357 | * gtk_sort_list_model_get_pending: |
| 1358 | * @self: a `GtkSortListModel` |
| 1359 | * |
| 1360 | * Estimates progress of an ongoing sorting operation. |
| 1361 | * |
| 1362 | * The estimate is the number of items that would still need to be |
| 1363 | * sorted to finish the sorting operation if this was a linear |
| 1364 | * algorithm. So this number is not related to how many items are |
| 1365 | * already correctly sorted. |
| 1366 | * |
| 1367 | * If you want to estimate the progress, you can use code like this: |
| 1368 | * ```c |
| 1369 | * pending = gtk_sort_list_model_get_pending (self); |
| 1370 | * model = gtk_sort_list_model_get_model (self); |
| 1371 | * progress = 1.0 - pending / (double) MAX (1, g_list_model_get_n_items (model)); |
| 1372 | * ``` |
| 1373 | * |
| 1374 | * If no sort operation is ongoing - in particular when |
| 1375 | * [[email protected]:incremental] is %FALSE - this |
| 1376 | * function returns 0. |
| 1377 | * |
| 1378 | * Returns: a progress estimate of remaining items to sort |
| 1379 | */ |
| 1380 | guintcxx . . $ guint# |
| 1381 | gtk_sort_list_model_get_pendingcxx . . $ gtk_sort_list_model_get_pending(e4e7ebffa3182d0a). (GtkSortListModelcxx . . $ GtkSortListModel# *self) |
| 1382 | { |
| 1383 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_SORT_LIST_MODEL (self), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 1384 | |
| 1385 | if (self->sort_cbcxx . . $ _GtkSortListModel#sort_cb. == 0) |
| 1386 | return 0; |
| 1387 | |
| 1388 | /* We do a random guess that 50% of time is spent generating keys |
| 1389 | * and the other 50% is spent actually sorting. |
| 1390 | * |
| 1391 | * This is of course massively wrong, but it depends on the sorter |
| 1392 | * in use, and estimating this correctly is hard, so this will have |
| 1393 | * to be good enough. |
| 1394 | */ |
| 1395 | if (!gtk_bitset_is_emptycxx . . $ gtk_bitset_is_empty(552670c4b5304b90). (self->missing_keyscxx . . $ _GtkSortListModel#missing_keys.)) |
| 1396 | { |
| 1397 | return (self->n_itemscxx . . $ _GtkSortListModel#n_items. + gtk_bitset_get_sizecxx . . $ gtk_bitset_get_size(69f9a7c04b446200). (self->missing_keyscxx . . $ _GtkSortListModel#missing_keys.)) / 2; |
| 1398 | } |
| 1399 | else |
| 1400 | { |
| 1401 | return (self->n_itemscxx . . $ _GtkSortListModel#n_items. - gtk_tim_sort_get_progresscxx . . $ gtk_tim_sort_get_progress(f6c3c0eca65ffa27). (&self->sortcxx . . $ _GtkSortListModel#sort.)) / 2; |
| 1402 | } |
| 1403 | } |
| 1404 |