1 /* abstractlist.c generated by valac 0.18.0, the Vala compiler
2 * generated from abstractlist.vala, do not modify */
6 * Copyright (C) 2007 Jürg Billeter
7 * Copyright (C) 2009 Didier Villevalois
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 * Didier 'Ptitjes' Villevalois <ptitjes@free.fr>
28 #include <glib-object.h>
31 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
32 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
33 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
34 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
36 typedef struct _GeeTraversable GeeTraversable;
37 typedef struct _GeeTraversableIface GeeTraversableIface;
39 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
41 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
42 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
43 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
44 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
45 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
46 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
48 typedef struct _GeeLazy GeeLazy;
49 typedef struct _GeeLazyClass GeeLazyClass;
51 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
52 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
53 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
54 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
56 typedef struct _GeeIterator GeeIterator;
57 typedef struct _GeeIteratorIface GeeIteratorIface;
59 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
60 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
61 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
62 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
64 typedef struct _GeeIterable GeeIterable;
65 typedef struct _GeeIterableIface GeeIterableIface;
67 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
68 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
69 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
70 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
72 typedef struct _GeeCollection GeeCollection;
73 typedef struct _GeeCollectionIface GeeCollectionIface;
75 #define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ())
76 #define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection))
77 #define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
78 #define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION))
79 #define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION))
80 #define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
82 typedef struct _GeeAbstractCollection GeeAbstractCollection;
83 typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass;
84 typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate;
86 #define GEE_TYPE_LIST (gee_list_get_type ())
87 #define GEE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST, GeeList))
88 #define GEE_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST))
89 #define GEE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST, GeeListIface))
91 typedef struct _GeeList GeeList;
92 typedef struct _GeeListIface GeeListIface;
94 #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ())
95 #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator))
96 #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR))
97 #define GEE_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIteratorIface))
99 typedef struct _GeeListIterator GeeListIterator;
100 typedef struct _GeeListIteratorIface GeeListIteratorIface;
102 #define GEE_TYPE_ABSTRACT_LIST (gee_abstract_list_get_type ())
103 #define GEE_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractList))
104 #define GEE_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass))
105 #define GEE_IS_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_LIST))
106 #define GEE_IS_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_LIST))
107 #define GEE_ABSTRACT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass))
109 typedef struct _GeeAbstractList GeeAbstractList;
110 typedef struct _GeeAbstractListClass GeeAbstractListClass;
111 typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate;
113 #define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ())
114 #define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection))
115 #define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass))
116 #define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION))
117 #define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION))
118 #define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass))
120 typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection;
121 typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass;
123 #define GEE_TYPE_READ_ONLY_LIST (gee_read_only_list_get_type ())
124 #define GEE_READ_ONLY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyList))
125 #define GEE_READ_ONLY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyListClass))
126 #define GEE_IS_READ_ONLY_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_LIST))
127 #define GEE_IS_READ_ONLY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_LIST))
128 #define GEE_READ_ONLY_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyListClass))
130 typedef struct _GeeReadOnlyList GeeReadOnlyList;
131 typedef struct _GeeReadOnlyListClass GeeReadOnlyListClass;
132 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
134 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
136 GEE_TRAVERSABLE_STREAM_YIELD,
137 GEE_TRAVERSABLE_STREAM_CONTINUE,
138 GEE_TRAVERSABLE_STREAM_END
139 } GeeTraversableStream;
141 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
142 struct _GeeIteratorIface {
143 GTypeInterface parent_iface;
144 gboolean (*next) (GeeIterator* self);
145 gboolean (*has_next) (GeeIterator* self);
146 gpointer (*get) (GeeIterator* self);
147 void (*remove) (GeeIterator* self);
148 gboolean (*get_valid) (GeeIterator* self);
149 gboolean (*get_read_only) (GeeIterator* self);
152 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
153 typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
154 typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
155 struct _GeeTraversableIface {
156 GTypeInterface parent_iface;
157 GType (*get_g_type) (GeeTraversable* self);
158 GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
159 GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
160 gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
161 GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
162 gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
163 GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
164 GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
165 GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
166 GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
167 GType (*get_element_type) (GeeTraversable* self);
170 struct _GeeIterableIface {
171 GTypeInterface parent_iface;
172 GType (*get_g_type) (GeeIterable* self);
173 GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
174 GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
175 GeeIterator* (*iterator) (GeeIterable* self);
178 struct _GeeCollectionIface {
179 GTypeInterface parent_iface;
180 GType (*get_g_type) (GeeCollection* self);
181 GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
182 GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
183 gboolean (*contains) (GeeCollection* self, gconstpointer item);
184 gboolean (*add) (GeeCollection* self, gconstpointer item);
185 gboolean (*remove) (GeeCollection* self, gconstpointer item);
186 void (*clear) (GeeCollection* self);
187 gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
188 gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
189 gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
190 gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
191 gpointer* (*to_array) (GeeCollection* self, int* result_length1);
192 gint (*get_size) (GeeCollection* self);
193 gboolean (*get_is_empty) (GeeCollection* self);
194 gboolean (*get_read_only) (GeeCollection* self);
195 GeeCollection* (*get_read_only_view) (GeeCollection* self);
198 struct _GeeAbstractCollection {
199 GObject parent_instance;
200 GeeAbstractCollectionPrivate * priv;
203 struct _GeeAbstractCollectionClass {
204 GObjectClass parent_class;
205 gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item);
206 gboolean (*add) (GeeAbstractCollection* self, gconstpointer item);
207 gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item);
208 void (*clear) (GeeAbstractCollection* self);
209 GeeIterator* (*iterator) (GeeAbstractCollection* self);
210 gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target);
211 void (*reserved0) (GeeAbstractCollection* self);
212 void (*reserved1) (GeeAbstractCollection* self);
213 void (*reserved2) (GeeAbstractCollection* self);
214 void (*reserved3) (GeeAbstractCollection* self);
215 void (*reserved4) (GeeAbstractCollection* self);
216 void (*reserved5) (GeeAbstractCollection* self);
217 void (*reserved6) (GeeAbstractCollection* self);
218 void (*reserved7) (GeeAbstractCollection* self);
219 void (*reserved8) (GeeAbstractCollection* self);
220 void (*reserved9) (GeeAbstractCollection* self);
221 gint (*get_size) (GeeAbstractCollection* self);
222 gboolean (*get_read_only) (GeeAbstractCollection* self);
223 GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self);
226 struct _GeeListIteratorIface {
227 GTypeInterface parent_iface;
228 void (*set) (GeeListIterator* self, gconstpointer item);
229 void (*add) (GeeListIterator* self, gconstpointer item);
230 gint (*index) (GeeListIterator* self);
233 struct _GeeListIface {
234 GTypeInterface parent_iface;
235 GType (*get_g_type) (GeeList* self);
236 GBoxedCopyFunc (*get_g_dup_func) (GeeList* self);
237 GDestroyNotify (*get_g_destroy_func) (GeeList* self);
238 GeeListIterator* (*list_iterator) (GeeList* self);
239 gpointer (*get) (GeeList* self, gint index);
240 void (*set) (GeeList* self, gint index, gconstpointer item);
241 gint (*index_of) (GeeList* self, gconstpointer item);
242 void (*insert) (GeeList* self, gint index, gconstpointer item);
243 gpointer (*remove_at) (GeeList* self, gint index);
244 GeeList* (*slice) (GeeList* self, gint start, gint stop);
245 gpointer (*first) (GeeList* self);
246 gpointer (*last) (GeeList* self);
247 void (*insert_all) (GeeList* self, gint index, GeeCollection* collection);
248 void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify);
249 GeeList* (*get_read_only_view) (GeeList* self);
252 struct _GeeAbstractList {
253 GeeAbstractCollection parent_instance;
254 GeeAbstractListPrivate * priv;
257 struct _GeeAbstractListClass {
258 GeeAbstractCollectionClass parent_class;
259 GeeListIterator* (*list_iterator) (GeeAbstractList* self);
260 gpointer (*get) (GeeAbstractList* self, gint index);
261 void (*set) (GeeAbstractList* self, gint index, gconstpointer item);
262 gint (*index_of) (GeeAbstractList* self, gconstpointer item);
263 void (*insert) (GeeAbstractList* self, gint index, gconstpointer item);
264 gpointer (*remove_at) (GeeAbstractList* self, gint index);
265 GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop);
266 void (*reserved0) (GeeAbstractList* self);
267 void (*reserved1) (GeeAbstractList* self);
268 void (*reserved2) (GeeAbstractList* self);
269 void (*reserved3) (GeeAbstractList* self);
270 void (*reserved4) (GeeAbstractList* self);
271 void (*reserved5) (GeeAbstractList* self);
272 void (*reserved6) (GeeAbstractList* self);
273 void (*reserved7) (GeeAbstractList* self);
274 void (*reserved8) (GeeAbstractList* self);
275 void (*reserved9) (GeeAbstractList* self);
276 GeeList* (*get_read_only_view) (GeeAbstractList* self);
279 struct _GeeAbstractListPrivate {
281 GBoxedCopyFunc g_dup_func;
282 GDestroyNotify g_destroy_func;
283 GeeList* _read_only_view;
287 static gpointer gee_abstract_list_parent_class = NULL;
288 static GeeListIface* gee_abstract_list_gee_list_parent_iface = NULL;
290 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
291 gpointer gee_lazy_ref (gpointer instance);
292 void gee_lazy_unref (gpointer instance);
293 GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
294 void gee_value_set_lazy (GValue* value, gpointer v_object);
295 void gee_value_take_lazy (GValue* value, gpointer v_object);
296 gpointer gee_value_get_lazy (const GValue* value);
297 GType gee_lazy_get_type (void) G_GNUC_CONST;
298 GType gee_iterator_get_type (void) G_GNUC_CONST;
299 GType gee_traversable_get_type (void) G_GNUC_CONST;
300 GType gee_iterable_get_type (void) G_GNUC_CONST;
301 GType gee_collection_get_type (void) G_GNUC_CONST;
302 GType gee_abstract_collection_get_type (void) G_GNUC_CONST;
303 GType gee_list_iterator_get_type (void) G_GNUC_CONST;
304 GType gee_list_get_type (void) G_GNUC_CONST;
305 GType gee_abstract_list_get_type (void) G_GNUC_CONST;
306 #define GEE_ABSTRACT_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListPrivate))
308 GEE_ABSTRACT_LIST_DUMMY_PROPERTY,
309 GEE_ABSTRACT_LIST_G_TYPE,
310 GEE_ABSTRACT_LIST_G_DUP_FUNC,
311 GEE_ABSTRACT_LIST_G_DESTROY_FUNC,
312 GEE_ABSTRACT_LIST_READ_ONLY_VIEW
314 GeeListIterator* gee_abstract_list_list_iterator (GeeAbstractList* self);
315 static GeeListIterator* gee_abstract_list_real_list_iterator (GeeAbstractList* self);
316 gpointer gee_abstract_list_get (GeeAbstractList* self, gint index);
317 static gpointer gee_abstract_list_real_get (GeeAbstractList* self, gint index);
318 void gee_abstract_list_set (GeeAbstractList* self, gint index, gconstpointer item);
319 static void gee_abstract_list_real_set (GeeAbstractList* self, gint index, gconstpointer item);
320 gint gee_abstract_list_index_of (GeeAbstractList* self, gconstpointer item);
321 static gint gee_abstract_list_real_index_of (GeeAbstractList* self, gconstpointer item);
322 void gee_abstract_list_insert (GeeAbstractList* self, gint index, gconstpointer item);
323 static void gee_abstract_list_real_insert (GeeAbstractList* self, gint index, gconstpointer item);
324 gpointer gee_abstract_list_remove_at (GeeAbstractList* self, gint index);
325 static gpointer gee_abstract_list_real_remove_at (GeeAbstractList* self, gint index);
326 GeeList* gee_abstract_list_slice (GeeAbstractList* self, gint start, gint stop);
327 static GeeList* gee_abstract_list_real_slice (GeeAbstractList* self, gint start, gint stop);
328 void gee_abstract_list_reserved0 (GeeAbstractList* self);
329 static void gee_abstract_list_real_reserved0 (GeeAbstractList* self);
330 void gee_abstract_list_reserved1 (GeeAbstractList* self);
331 static void gee_abstract_list_real_reserved1 (GeeAbstractList* self);
332 void gee_abstract_list_reserved2 (GeeAbstractList* self);
333 static void gee_abstract_list_real_reserved2 (GeeAbstractList* self);
334 void gee_abstract_list_reserved3 (GeeAbstractList* self);
335 static void gee_abstract_list_real_reserved3 (GeeAbstractList* self);
336 void gee_abstract_list_reserved4 (GeeAbstractList* self);
337 static void gee_abstract_list_real_reserved4 (GeeAbstractList* self);
338 void gee_abstract_list_reserved5 (GeeAbstractList* self);
339 static void gee_abstract_list_real_reserved5 (GeeAbstractList* self);
340 void gee_abstract_list_reserved6 (GeeAbstractList* self);
341 static void gee_abstract_list_real_reserved6 (GeeAbstractList* self);
342 void gee_abstract_list_reserved7 (GeeAbstractList* self);
343 static void gee_abstract_list_real_reserved7 (GeeAbstractList* self);
344 void gee_abstract_list_reserved8 (GeeAbstractList* self);
345 static void gee_abstract_list_real_reserved8 (GeeAbstractList* self);
346 void gee_abstract_list_reserved9 (GeeAbstractList* self);
347 static void gee_abstract_list_real_reserved9 (GeeAbstractList* self);
348 GeeAbstractList* gee_abstract_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
349 GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
350 GeeList* gee_abstract_list_get_read_only_view (GeeAbstractList* self);
351 GeeReadOnlyList* gee_read_only_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list);
352 GeeReadOnlyList* gee_read_only_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list);
353 GType gee_read_only_collection_get_type (void) G_GNUC_CONST;
354 GType gee_read_only_list_get_type (void) G_GNUC_CONST;
355 static void gee_abstract_list_finalize (GObject* obj);
356 static void _vala_gee_abstract_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
357 static void _vala_gee_abstract_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
363 static GeeListIterator* gee_abstract_list_real_list_iterator (GeeAbstractList* self) {
364 g_critical ("Type `%s' does not implement abstract method `gee_abstract_list_list_iterator'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
369 GeeListIterator* gee_abstract_list_list_iterator (GeeAbstractList* self) {
370 g_return_val_if_fail (self != NULL, NULL);
371 return GEE_ABSTRACT_LIST_GET_CLASS (self)->list_iterator (self);
378 static gpointer gee_abstract_list_real_get (GeeAbstractList* self, gint index) {
379 g_critical ("Type `%s' does not implement abstract method `gee_abstract_list_get'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
384 gpointer gee_abstract_list_get (GeeAbstractList* self, gint index) {
385 g_return_val_if_fail (self != NULL, NULL);
386 return GEE_ABSTRACT_LIST_GET_CLASS (self)->get (self, index);
393 static void gee_abstract_list_real_set (GeeAbstractList* self, gint index, gconstpointer item) {
394 g_critical ("Type `%s' does not implement abstract method `gee_abstract_list_set'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
399 void gee_abstract_list_set (GeeAbstractList* self, gint index, gconstpointer item) {
400 g_return_if_fail (self != NULL);
401 GEE_ABSTRACT_LIST_GET_CLASS (self)->set (self, index, item);
408 static gint gee_abstract_list_real_index_of (GeeAbstractList* self, gconstpointer item) {
409 g_critical ("Type `%s' does not implement abstract method `gee_abstract_list_index_of'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
414 gint gee_abstract_list_index_of (GeeAbstractList* self, gconstpointer item) {
415 g_return_val_if_fail (self != NULL, 0);
416 return GEE_ABSTRACT_LIST_GET_CLASS (self)->index_of (self, item);
423 static void gee_abstract_list_real_insert (GeeAbstractList* self, gint index, gconstpointer item) {
424 g_critical ("Type `%s' does not implement abstract method `gee_abstract_list_insert'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
429 void gee_abstract_list_insert (GeeAbstractList* self, gint index, gconstpointer item) {
430 g_return_if_fail (self != NULL);
431 GEE_ABSTRACT_LIST_GET_CLASS (self)->insert (self, index, item);
438 static gpointer gee_abstract_list_real_remove_at (GeeAbstractList* self, gint index) {
439 g_critical ("Type `%s' does not implement abstract method `gee_abstract_list_remove_at'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
444 gpointer gee_abstract_list_remove_at (GeeAbstractList* self, gint index) {
445 g_return_val_if_fail (self != NULL, NULL);
446 return GEE_ABSTRACT_LIST_GET_CLASS (self)->remove_at (self, index);
453 static GeeList* gee_abstract_list_real_slice (GeeAbstractList* self, gint start, gint stop) {
454 g_critical ("Type `%s' does not implement abstract method `gee_abstract_list_slice'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
459 GeeList* gee_abstract_list_slice (GeeAbstractList* self, gint start, gint stop) {
460 g_return_val_if_fail (self != NULL, NULL);
461 return GEE_ABSTRACT_LIST_GET_CLASS (self)->slice (self, start, stop);
465 static void gee_abstract_list_real_reserved0 (GeeAbstractList* self) {
469 void gee_abstract_list_reserved0 (GeeAbstractList* self) {
470 g_return_if_fail (self != NULL);
471 GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved0 (self);
475 static void gee_abstract_list_real_reserved1 (GeeAbstractList* self) {
479 void gee_abstract_list_reserved1 (GeeAbstractList* self) {
480 g_return_if_fail (self != NULL);
481 GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved1 (self);
485 static void gee_abstract_list_real_reserved2 (GeeAbstractList* self) {
489 void gee_abstract_list_reserved2 (GeeAbstractList* self) {
490 g_return_if_fail (self != NULL);
491 GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved2 (self);
495 static void gee_abstract_list_real_reserved3 (GeeAbstractList* self) {
499 void gee_abstract_list_reserved3 (GeeAbstractList* self) {
500 g_return_if_fail (self != NULL);
501 GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved3 (self);
505 static void gee_abstract_list_real_reserved4 (GeeAbstractList* self) {
509 void gee_abstract_list_reserved4 (GeeAbstractList* self) {
510 g_return_if_fail (self != NULL);
511 GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved4 (self);
515 static void gee_abstract_list_real_reserved5 (GeeAbstractList* self) {
519 void gee_abstract_list_reserved5 (GeeAbstractList* self) {
520 g_return_if_fail (self != NULL);
521 GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved5 (self);
525 static void gee_abstract_list_real_reserved6 (GeeAbstractList* self) {
529 void gee_abstract_list_reserved6 (GeeAbstractList* self) {
530 g_return_if_fail (self != NULL);
531 GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved6 (self);
535 static void gee_abstract_list_real_reserved7 (GeeAbstractList* self) {
539 void gee_abstract_list_reserved7 (GeeAbstractList* self) {
540 g_return_if_fail (self != NULL);
541 GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved7 (self);
545 static void gee_abstract_list_real_reserved8 (GeeAbstractList* self) {
549 void gee_abstract_list_reserved8 (GeeAbstractList* self) {
550 g_return_if_fail (self != NULL);
551 GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved8 (self);
555 static void gee_abstract_list_real_reserved9 (GeeAbstractList* self) {
559 void gee_abstract_list_reserved9 (GeeAbstractList* self) {
560 g_return_if_fail (self != NULL);
561 GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved9 (self);
565 GeeAbstractList* gee_abstract_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
566 GeeAbstractList * self = NULL;
567 self = (GeeAbstractList*) gee_abstract_collection_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
568 self->priv->g_type = g_type;
569 self->priv->g_dup_func = g_dup_func;
570 self->priv->g_destroy_func = g_destroy_func;
575 GeeList* gee_abstract_list_get_read_only_view (GeeAbstractList* self) {
576 g_return_val_if_fail (self != NULL, NULL);
577 return GEE_ABSTRACT_LIST_GET_CLASS (self)->get_read_only_view (self);
581 static gpointer _g_object_ref0 (gpointer self) {
582 return self ? g_object_ref (self) : NULL;
586 static GeeList* gee_abstract_list_real_get_read_only_view (GeeAbstractList* base) {
588 GeeAbstractList* self;
594 _tmp0_ = self->priv->_read_only_view;
595 _tmp1_ = _g_object_ref0 (_tmp0_);
597 _tmp2_ = self->priv->_read_only_view;
598 if (_tmp2_ == NULL) {
599 GeeReadOnlyList* _tmp3_;
602 _tmp3_ = gee_read_only_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, (GeeList*) self);
603 _g_object_unref0 (instance);
604 instance = (GeeList*) _tmp3_;
606 self->priv->_read_only_view = _tmp4_;
608 g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_read_only_view));
615 static void gee_abstract_list_class_init (GeeAbstractListClass * klass) {
616 gee_abstract_list_parent_class = g_type_class_peek_parent (klass);
617 g_type_class_add_private (klass, sizeof (GeeAbstractListPrivate));
618 GEE_ABSTRACT_LIST_CLASS (klass)->list_iterator = gee_abstract_list_real_list_iterator;
619 GEE_ABSTRACT_LIST_CLASS (klass)->get = gee_abstract_list_real_get;
620 GEE_ABSTRACT_LIST_CLASS (klass)->set = gee_abstract_list_real_set;
621 GEE_ABSTRACT_LIST_CLASS (klass)->index_of = gee_abstract_list_real_index_of;
622 GEE_ABSTRACT_LIST_CLASS (klass)->insert = gee_abstract_list_real_insert;
623 GEE_ABSTRACT_LIST_CLASS (klass)->remove_at = gee_abstract_list_real_remove_at;
624 GEE_ABSTRACT_LIST_CLASS (klass)->slice = gee_abstract_list_real_slice;
625 GEE_ABSTRACT_LIST_CLASS (klass)->reserved0 = gee_abstract_list_real_reserved0;
626 GEE_ABSTRACT_LIST_CLASS (klass)->reserved1 = gee_abstract_list_real_reserved1;
627 GEE_ABSTRACT_LIST_CLASS (klass)->reserved2 = gee_abstract_list_real_reserved2;
628 GEE_ABSTRACT_LIST_CLASS (klass)->reserved3 = gee_abstract_list_real_reserved3;
629 GEE_ABSTRACT_LIST_CLASS (klass)->reserved4 = gee_abstract_list_real_reserved4;
630 GEE_ABSTRACT_LIST_CLASS (klass)->reserved5 = gee_abstract_list_real_reserved5;
631 GEE_ABSTRACT_LIST_CLASS (klass)->reserved6 = gee_abstract_list_real_reserved6;
632 GEE_ABSTRACT_LIST_CLASS (klass)->reserved7 = gee_abstract_list_real_reserved7;
633 GEE_ABSTRACT_LIST_CLASS (klass)->reserved8 = gee_abstract_list_real_reserved8;
634 GEE_ABSTRACT_LIST_CLASS (klass)->reserved9 = gee_abstract_list_real_reserved9;
635 GEE_ABSTRACT_LIST_CLASS (klass)->get_read_only_view = gee_abstract_list_real_get_read_only_view;
636 G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_list_get_property;
637 G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_list_set_property;
638 G_OBJECT_CLASS (klass)->finalize = gee_abstract_list_finalize;
639 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_LIST_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
640 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_LIST_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
641 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_LIST_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
645 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_LIST_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_LIST, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
649 static GType gee_abstract_list_gee_list_get_g_type (GeeAbstractList* self) {
650 return self->priv->g_type;
654 static GBoxedCopyFunc gee_abstract_list_gee_list_get_g_dup_func (GeeAbstractList* self) {
655 return self->priv->g_dup_func;
659 static GDestroyNotify gee_abstract_list_gee_list_get_g_destroy_func (GeeAbstractList* self) {
660 return self->priv->g_destroy_func;
664 static void gee_abstract_list_gee_list_interface_init (GeeListIface * iface) {
665 gee_abstract_list_gee_list_parent_iface = g_type_interface_peek_parent (iface);
666 iface->list_iterator = (GeeListIterator* (*)(GeeList*)) gee_abstract_list_list_iterator;
667 iface->get = (gpointer (*)(GeeList*, gint)) gee_abstract_list_get;
668 iface->set = (void (*)(GeeList*, gint, gconstpointer)) gee_abstract_list_set;
669 iface->index_of = (gint (*)(GeeList*, gconstpointer)) gee_abstract_list_index_of;
670 iface->insert = (void (*)(GeeList*, gint, gconstpointer)) gee_abstract_list_insert;
671 iface->remove_at = (gpointer (*)(GeeList*, gint)) gee_abstract_list_remove_at;
672 iface->slice = (GeeList* (*)(GeeList*, gint, gint)) gee_abstract_list_slice;
673 iface->get_g_type = (GType(*)(GeeList*)) gee_abstract_list_gee_list_get_g_type;
674 iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeList*)) gee_abstract_list_gee_list_get_g_dup_func;
675 iface->get_g_destroy_func = (GDestroyNotify(*)(GeeList*)) gee_abstract_list_gee_list_get_g_destroy_func;
676 iface->get_read_only_view = (GeeList* (*) (GeeList *)) gee_abstract_list_get_read_only_view;
680 static void gee_abstract_list_instance_init (GeeAbstractList * self) {
681 self->priv = GEE_ABSTRACT_LIST_GET_PRIVATE (self);
685 static void gee_abstract_list_finalize (GObject* obj) {
686 GeeAbstractList * self;
687 self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList);
688 G_OBJECT_CLASS (gee_abstract_list_parent_class)->finalize (obj);
693 * Skeletal implementation of the {@link List} interface.
695 * Contains common code shared by all list implementations.
700 GType gee_abstract_list_get_type (void) {
701 static volatile gsize gee_abstract_list_type_id__volatile = 0;
702 if (g_once_init_enter (&gee_abstract_list_type_id__volatile)) {
703 static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractList), 0, (GInstanceInitFunc) gee_abstract_list_instance_init, NULL };
704 static const GInterfaceInfo gee_list_info = { (GInterfaceInitFunc) gee_abstract_list_gee_list_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
705 GType gee_abstract_list_type_id;
706 gee_abstract_list_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_COLLECTION, "GeeAbstractList", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
707 g_type_add_interface_static (gee_abstract_list_type_id, GEE_TYPE_LIST, &gee_list_info);
708 g_once_init_leave (&gee_abstract_list_type_id__volatile, gee_abstract_list_type_id);
710 return gee_abstract_list_type_id__volatile;
714 static void _vala_gee_abstract_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
715 GeeAbstractList * self;
716 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList);
717 switch (property_id) {
718 case GEE_ABSTRACT_LIST_READ_ONLY_VIEW:
719 g_value_take_object (value, gee_abstract_list_get_read_only_view (self));
722 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
728 static void _vala_gee_abstract_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
729 GeeAbstractList * self;
730 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList);
731 switch (property_id) {
732 case GEE_ABSTRACT_LIST_G_TYPE:
733 self->priv->g_type = g_value_get_gtype (value);
735 case GEE_ABSTRACT_LIST_G_DUP_FUNC:
736 self->priv->g_dup_func = g_value_get_pointer (value);
738 case GEE_ABSTRACT_LIST_G_DESTROY_FUNC:
739 self->priv->g_destroy_func = g_value_get_pointer (value);
742 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);