1 /* readonlysortedset.c generated by valac 0.46.6, the Vala compiler
2 * generated from readonlysortedset.vala, do not modify */
3
4 /* readonlysortedset.vala
5 *
6 * Copyright (C) 2009 Didier Villevalois, Maciej Piechotka
7 * Copyright (C) 2011 Maciej Piechotka
8 *
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.
13
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.
18
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
22 *
23 * Author:
24 * Maciej Piechotka <uzytkownik2@gmail.com>
25 */
26
27 #include <glib-object.h>
28 #include <glib.h>
29
30 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
31 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
32 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
33 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
34
35 typedef struct _GeeTraversable GeeTraversable;
36 typedef struct _GeeTraversableIface GeeTraversableIface;
37 typedef gboolean (*GeeForallFunc) (gpointer g, gpointer user_data);
38 typedef enum {
39 GEE_TRAVERSABLE_STREAM_YIELD,
40 GEE_TRAVERSABLE_STREAM_CONTINUE,
41 GEE_TRAVERSABLE_STREAM_END,
42 GEE_TRAVERSABLE_STREAM_WAIT
43 } GeeTraversableStream;
44
45 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
46
47 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
48 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
49 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
50 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
51 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
52 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
53
54 typedef struct _GeeLazy GeeLazy;
55 typedef struct _GeeLazyClass GeeLazyClass;
56 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy* * lazy, gpointer user_data);
57
58 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
59 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
60 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
61 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
62
63 typedef struct _GeeIterator GeeIterator;
64 typedef struct _GeeIteratorIface GeeIteratorIface;
65 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, gpointer user_data);
66 typedef gpointer (*GeeMapFunc) (gpointer g, gpointer user_data);
67 typedef gboolean (*GeePredicate) (gconstpointer g, gpointer user_data);
68 typedef GeeIterator* (*GeeFlatMapFunc) (gpointer g, gpointer user_data);
69
70 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
71 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
72 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
73 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
74
75 typedef struct _GeeIterable GeeIterable;
76 typedef struct _GeeIterableIface GeeIterableIface;
77
78 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
79 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
80 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
81 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
82
83 typedef struct _GeeCollection GeeCollection;
84 typedef struct _GeeCollectionIface GeeCollectionIface;
85
86 #define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ())
87 #define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection))
88 #define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass))
89 #define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION))
90 #define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION))
91 #define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass))
92
93 typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection;
94 typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass;
95 typedef struct _GeeReadOnlyCollectionPrivate GeeReadOnlyCollectionPrivate;
96
97 #define GEE_TYPE_SET (gee_set_get_type ())
98 #define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet))
99 #define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET))
100 #define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface))
101
102 typedef struct _GeeSet GeeSet;
103 typedef struct _GeeSetIface GeeSetIface;
104
105 #define GEE_TYPE_READ_ONLY_SET (gee_read_only_set_get_type ())
106 #define GEE_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySet))
107 #define GEE_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass))
108 #define GEE_IS_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SET))
109 #define GEE_IS_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SET))
110 #define GEE_READ_ONLY_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass))
111
112 typedef struct _GeeReadOnlySet GeeReadOnlySet;
113 typedef struct _GeeReadOnlySetClass GeeReadOnlySetClass;
114 typedef struct _GeeReadOnlySetPrivate GeeReadOnlySetPrivate;
115
116 #define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ())
117 #define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet))
118 #define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET))
119 #define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface))
120
121 typedef struct _GeeSortedSet GeeSortedSet;
122 typedef struct _GeeSortedSetIface GeeSortedSetIface;
123
124 #define GEE_TYPE_READ_ONLY_SORTED_SET (gee_read_only_sorted_set_get_type ())
125 #define GEE_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet))
126 #define GEE_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass))
127 #define GEE_IS_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_SET))
128 #define GEE_IS_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_SET))
129 #define GEE_READ_ONLY_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass))
130
131 typedef struct _GeeReadOnlySortedSet GeeReadOnlySortedSet;
132 typedef struct _GeeReadOnlySortedSetClass GeeReadOnlySortedSetClass;
133 typedef struct _GeeReadOnlySortedSetPrivate GeeReadOnlySortedSetPrivate;
134 enum {
135 GEE_READ_ONLY_SORTED_SET_0_PROPERTY,
136 GEE_READ_ONLY_SORTED_SET_G_TYPE,
137 GEE_READ_ONLY_SORTED_SET_G_DUP_FUNC,
138 GEE_READ_ONLY_SORTED_SET_G_DESTROY_FUNC,
139 GEE_READ_ONLY_SORTED_SET_READ_ONLY_VIEW_PROPERTY,
140 GEE_READ_ONLY_SORTED_SET_NUM_PROPERTIES
141 };
142 static GParamSpec* gee_read_only_sorted_set_properties[GEE_READ_ONLY_SORTED_SET_NUM_PROPERTIES];
143
144 #define GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR (gee_read_only_collection_iterator_get_type ())
145 #define GEE_READ_ONLY_COLLECTION_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIterator))
146 #define GEE_READ_ONLY_COLLECTION_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass))
147 #define GEE_READ_ONLY_COLLECTION_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR))
148 #define GEE_READ_ONLY_COLLECTION_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR))
149 #define GEE_READ_ONLY_COLLECTION_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass))
150
151 typedef struct _GeeReadOnlyCollectionIterator GeeReadOnlyCollectionIterator;
152 typedef struct _GeeReadOnlyCollectionIteratorClass GeeReadOnlyCollectionIteratorClass;
153 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
154
155 struct _GeeIteratorIface {
156 GTypeInterface parent_iface;
157 gboolean (*next) (GeeIterator* self);
158 gboolean (*has_next) (GeeIterator* self);
159 gpointer (*get) (GeeIterator* self);
160 void (*remove) (GeeIterator* self);
161 gboolean (*get_valid) (GeeIterator* self);
162 gboolean (*get_read_only) (GeeIterator* self);
163 };
164
165 struct _GeeTraversableIface {
166 GTypeInterface parent_iface;
167 GType (*get_g_type) (GeeTraversable* self);
168 GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
169 GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
170 gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, gpointer f_target);
171 GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, gpointer f_target, GDestroyNotify f_target_destroy_notify);
172 gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, gpointer f_target, gpointer seed);
173 GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, gpointer f_target);
174 GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, gpointer f_target, gpointer seed);
175 GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, gpointer pred_target, GDestroyNotify pred_target_destroy_notify);
176 GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
177 GType (*get_element_type) (GeeTraversable* self);
178 GeeIterator* (*flat_map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFlatMapFunc f, gpointer f_target, GDestroyNotify f_target_destroy_notify);
179 GeeIterator** (*tee) (GeeTraversable* self, guint forks, gint* result_length1);
180 gpointer (*first_match) (GeeTraversable* self, GeePredicate pred, gpointer pred_target, GDestroyNotify pred_target_destroy_notify);
181 gboolean (*any_match) (GeeTraversable* self, GeePredicate pred, gpointer pred_target, GDestroyNotify pred_target_destroy_notify);
182 gboolean (*all_match) (GeeTraversable* self, GeePredicate pred, gpointer pred_target, GDestroyNotify pred_target_destroy_notify);
183 gpointer (*max) (GeeTraversable* self, GCompareDataFunc compare, gpointer compare_target, GDestroyNotify compare_target_destroy_notify);
184 gpointer (*min) (GeeTraversable* self, GCompareDataFunc compare, gpointer compare_target, GDestroyNotify compare_target_destroy_notify);
185 GeeIterator* (*order_by) (GeeTraversable* self, GCompareDataFunc compare, gpointer compare_target, GDestroyNotify compare_target_destroy_notify);
186 };
187
188 struct _GeeIterableIface {
189 GTypeInterface parent_iface;
190 GType (*get_g_type) (GeeIterable* self);
191 GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
192 GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
193 GeeIterator* (*iterator) (GeeIterable* self);
194 };
195
196 struct _GeeCollectionIface {
197 GTypeInterface parent_iface;
198 GType (*get_g_type) (GeeCollection* self);
199 GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
200 GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
201 gboolean (*contains) (GeeCollection* self, gconstpointer item);
202 gboolean (*add) (GeeCollection* self, gconstpointer item);
203 gboolean (*remove) (GeeCollection* self, gconstpointer item);
204 void (*clear) (GeeCollection* self);
205 gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
206 gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
207 gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
208 gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
209 gpointer* (*to_array) (GeeCollection* self, gint* result_length1);
210 gint (*get_size) (GeeCollection* self);
211 gboolean (*get_is_empty) (GeeCollection* self);
212 gboolean (*get_read_only) (GeeCollection* self);
213 GeeCollection* (*get_read_only_view) (GeeCollection* self);
214 gboolean (*add_all_array) (GeeCollection* self, gpointer* array, gint array_length1);
215 gboolean (*contains_all_array) (GeeCollection* self, gpointer* array, gint array_length1);
216 gboolean (*remove_all_array) (GeeCollection* self, gpointer* array, gint array_length1);
217 gboolean (*add_all_iterator) (GeeCollection* self, GeeIterator* iter);
218 gboolean (*contains_all_iterator) (GeeCollection* self, GeeIterator* iter);
219 gboolean (*remove_all_iterator) (GeeCollection* self, GeeIterator* iter);
220 };
221
222 struct _GeeReadOnlyCollection {
223 GObject parent_instance;
224 GeeReadOnlyCollectionPrivate * priv;
225 GeeCollection* _collection;
226 };
227
228 struct _GeeReadOnlyCollectionClass {
229 GObjectClass parent_class;
230 GeeCollection* (*get_read_only_view) (GeeReadOnlyCollection* self);
231 };
232
233 struct _GeeSetIface {
234 GTypeInterface parent_iface;
235 GType (*get_g_type) (GeeSet* self);
236 GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self);
237 GDestroyNotify (*get_g_destroy_func) (GeeSet* self);
238 GeeSet* (*get_read_only_view) (GeeSet* self);
239 };
240
241 struct _GeeReadOnlySet {
242 GeeReadOnlyCollection parent_instance;
243 GeeReadOnlySetPrivate * priv;
244 };
245
246 struct _GeeReadOnlySetClass {
247 GeeReadOnlyCollectionClass parent_class;
248 GeeSet* (*get_read_only_view) (GeeReadOnlySet* self);
249 };
250
251 struct _GeeSortedSetIface {
252 GTypeInterface parent_iface;
253 GType (*get_g_type) (GeeSortedSet* self);
254 GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self);
255 GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self);
256 gpointer (*first) (GeeSortedSet* self);
257 gpointer (*last) (GeeSortedSet* self);
258 GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element);
259 gpointer (*lower) (GeeSortedSet* self, gconstpointer element);
260 gpointer (*higher) (GeeSortedSet* self, gconstpointer element);
261 gpointer (*floor) (GeeSortedSet* self, gconstpointer element);
262 gpointer (*ceil) (GeeSortedSet* self, gconstpointer element);
263 GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before);
264 GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after);
265 GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to);
266 GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self);
267 };
268
269 struct _GeeReadOnlySortedSet {
270 GeeReadOnlySet parent_instance;
271 GeeReadOnlySortedSetPrivate * priv;
272 };
273
274 struct _GeeReadOnlySortedSetClass {
275 GeeReadOnlySetClass parent_class;
276 };
277
278 struct _GeeReadOnlySortedSetPrivate {
279 GType g_type;
280 GBoxedCopyFunc g_dup_func;
281 GDestroyNotify g_destroy_func;
282 };
283
284 static gint GeeReadOnlySortedSet_private_offset;
285 static gpointer gee_read_only_sorted_set_parent_class = NULL;
286 static GeeSortedSetIface * gee_read_only_sorted_set_gee_sorted_set_parent_iface = NULL;
287
288 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
289 gpointer gee_lazy_ref (gpointer instance);
290 void gee_lazy_unref (gpointer instance);
291 GParamSpec* gee_param_spec_lazy (const gchar* name,
292 const gchar* nick,
293 const gchar* blurb,
294 GType object_type,
295 GParamFlags flags);
296 void gee_value_set_lazy (GValue* value,
297 gpointer v_object);
298 void gee_value_take_lazy (GValue* value,
299 gpointer v_object);
300 gpointer gee_value_get_lazy (const GValue* value);
301 GType gee_lazy_get_type (void) G_GNUC_CONST;
302 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeLazy, gee_lazy_unref)
303 GType gee_iterator_get_type (void) G_GNUC_CONST;
304 GType gee_traversable_get_type (void) G_GNUC_CONST;
305 GType gee_iterable_get_type (void) G_GNUC_CONST;
306 GType gee_collection_get_type (void) G_GNUC_CONST;
307 G_GNUC_INTERNAL GType gee_read_only_collection_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
308 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeReadOnlyCollection, g_object_unref)
309 GType gee_set_get_type (void) G_GNUC_CONST;
310 G_GNUC_INTERNAL GType gee_read_only_set_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
311 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeReadOnlySet, g_object_unref)
312 GType gee_sorted_set_get_type (void) G_GNUC_CONST;
313 G_GNUC_INTERNAL GType gee_read_only_sorted_set_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
314 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeReadOnlySortedSet, g_object_unref)
315 G_GNUC_INTERNAL GeeReadOnlySortedSet* gee_read_only_sorted_set_new (GType g_type,
316 GBoxedCopyFunc g_dup_func,
317 GDestroyNotify g_destroy_func,
318 GeeSortedSet* set);
319 G_GNUC_INTERNAL GeeReadOnlySortedSet* gee_read_only_sorted_set_construct (GType object_type,
320 GType g_type,
321 GBoxedCopyFunc g_dup_func,
322 GDestroyNotify g_destroy_func,
323 GeeSortedSet* set);
324 G_GNUC_INTERNAL GeeReadOnlySet* gee_read_only_set_new (GType g_type,
325 GBoxedCopyFunc g_dup_func,
326 GDestroyNotify g_destroy_func,
327 GeeSet* set);
328 G_GNUC_INTERNAL GeeReadOnlySet* gee_read_only_set_construct (GType object_type,
329 GType g_type,
330 GBoxedCopyFunc g_dup_func,
331 GDestroyNotify g_destroy_func,
332 GeeSet* set);
333 static gpointer gee_read_only_sorted_set_real_first (GeeSortedSet* base);
334 gpointer gee_sorted_set_first (GeeSortedSet* self);
335 static gpointer gee_read_only_sorted_set_real_last (GeeSortedSet* base);
336 gpointer gee_sorted_set_last (GeeSortedSet* self);
337 static GeeIterator* gee_read_only_sorted_set_real_iterator_at (GeeSortedSet* base,
338 gconstpointer element);
339 GeeIterator* gee_sorted_set_iterator_at (GeeSortedSet* self,
340 gconstpointer element);
341 GType gee_read_only_collection_iterator_get_type (void) G_GNUC_CONST;
342 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeReadOnlyCollectionIterator, g_object_unref)
343 G_GNUC_INTERNAL GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_new (GType g_type,
344 GBoxedCopyFunc g_dup_func,
345 GDestroyNotify g_destroy_func,
346 GeeIterator* iterator);
347 G_GNUC_INTERNAL GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_construct (GType object_type,
348 GType g_type,
349 GBoxedCopyFunc g_dup_func,
350 GDestroyNotify g_destroy_func,
351 GeeIterator* iterator);
352 static gpointer gee_read_only_sorted_set_real_lower (GeeSortedSet* base,
353 gconstpointer element);
354 gpointer gee_sorted_set_lower (GeeSortedSet* self,
355 gconstpointer element);
356 static gpointer gee_read_only_sorted_set_real_higher (GeeSortedSet* base,
357 gconstpointer element);
358 gpointer gee_sorted_set_higher (GeeSortedSet* self,
359 gconstpointer element);
360 static gpointer gee_read_only_sorted_set_real_floor (GeeSortedSet* base,
361 gconstpointer element);
362 gpointer gee_sorted_set_floor (GeeSortedSet* self,
363 gconstpointer element);
364 static gpointer gee_read_only_sorted_set_real_ceil (GeeSortedSet* base,
365 gconstpointer element);
366 gpointer gee_sorted_set_ceil (GeeSortedSet* self,
367 gconstpointer element);
368 static GeeSortedSet* gee_read_only_sorted_set_real_head_set (GeeSortedSet* base,
369 gconstpointer before);
370 GeeSortedSet* gee_sorted_set_head_set (GeeSortedSet* self,
371 gconstpointer before);
372 GeeSortedSet* gee_sorted_set_get_read_only_view (GeeSortedSet* self);
373 static GeeSortedSet* gee_read_only_sorted_set_real_tail_set (GeeSortedSet* base,
374 gconstpointer after);
375 GeeSortedSet* gee_sorted_set_tail_set (GeeSortedSet* self,
376 gconstpointer after);
377 static GeeSortedSet* gee_read_only_sorted_set_real_sub_set (GeeSortedSet* base,
378 gconstpointer from,
379 gconstpointer to);
380 GeeSortedSet* gee_sorted_set_sub_set (GeeSortedSet* self,
381 gconstpointer from,
382 gconstpointer to);
383 static void _vala_gee_read_only_sorted_set_get_property (GObject * object,
384 guint property_id,
385 GValue * value,
386 GParamSpec * pspec);
387 static void _vala_gee_read_only_sorted_set_set_property (GObject * object,
388 guint property_id,
389 const GValue * value,
390 GParamSpec * pspec);
391
392 static inline gpointer
gee_read_only_sorted_set_get_instance_private(GeeReadOnlySortedSet * self)393 gee_read_only_sorted_set_get_instance_private (GeeReadOnlySortedSet* self)
394 {
395 return G_STRUCT_MEMBER_P (self, GeeReadOnlySortedSet_private_offset);
396 }
397
398 /**
399 * Constructs a read-only set that mirrors the content of the specified set.
400 *
401 * @param set the set to decorate.
402 */
403 G_GNUC_INTERNAL GeeReadOnlySortedSet*
gee_read_only_sorted_set_construct(GType object_type,GType g_type,GBoxedCopyFunc g_dup_func,GDestroyNotify g_destroy_func,GeeSortedSet * set)404 gee_read_only_sorted_set_construct (GType object_type,
405 GType g_type,
406 GBoxedCopyFunc g_dup_func,
407 GDestroyNotify g_destroy_func,
408 GeeSortedSet* set)
409 {
410 GeeReadOnlySortedSet * self = NULL;
411 g_return_val_if_fail (set != NULL, NULL);
412 self = (GeeReadOnlySortedSet*) gee_read_only_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, (GeeSet*) set);
413 self->priv->g_type = g_type;
414 self->priv->g_dup_func = g_dup_func;
415 self->priv->g_destroy_func = g_destroy_func;
416 return self;
417 }
418
419 G_GNUC_INTERNAL GeeReadOnlySortedSet*
gee_read_only_sorted_set_new(GType g_type,GBoxedCopyFunc g_dup_func,GDestroyNotify g_destroy_func,GeeSortedSet * set)420 gee_read_only_sorted_set_new (GType g_type,
421 GBoxedCopyFunc g_dup_func,
422 GDestroyNotify g_destroy_func,
423 GeeSortedSet* set)
424 {
425 return gee_read_only_sorted_set_construct (GEE_TYPE_READ_ONLY_SORTED_SET, g_type, g_dup_func, g_destroy_func, set);
426 }
427
428 /**
429 * {@inheritDoc}
430 */
431 static gpointer
gee_read_only_sorted_set_real_first(GeeSortedSet * base)432 gee_read_only_sorted_set_real_first (GeeSortedSet* base)
433 {
434 GeeReadOnlySortedSet * self;
435 GeeCollection* _tmp0_;
436 gpointer _tmp1_;
437 gpointer result = NULL;
438 self = (GeeReadOnlySortedSet*) base;
439 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
440 _tmp1_ = gee_sorted_set_first (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet));
441 result = _tmp1_;
442 return result;
443 }
444
445 /**
446 * {@inheritDoc}
447 */
448 static gpointer
gee_read_only_sorted_set_real_last(GeeSortedSet * base)449 gee_read_only_sorted_set_real_last (GeeSortedSet* base)
450 {
451 GeeReadOnlySortedSet * self;
452 GeeCollection* _tmp0_;
453 gpointer _tmp1_;
454 gpointer result = NULL;
455 self = (GeeReadOnlySortedSet*) base;
456 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
457 _tmp1_ = gee_sorted_set_last (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet));
458 result = _tmp1_;
459 return result;
460 }
461
462 /**
463 * {@inheritDoc}
464 */
465 static GeeIterator*
gee_read_only_sorted_set_real_iterator_at(GeeSortedSet * base,gconstpointer element)466 gee_read_only_sorted_set_real_iterator_at (GeeSortedSet* base,
467 gconstpointer element)
468 {
469 GeeReadOnlySortedSet * self;
470 GeeIterator* iter = NULL;
471 GeeCollection* _tmp0_;
472 GeeIterator* _tmp1_;
473 GeeReadOnlyCollectionIterator* _tmp2_ = NULL;
474 GeeIterator* _tmp3_;
475 GeeIterator* result = NULL;
476 self = (GeeReadOnlySortedSet*) base;
477 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
478 _tmp1_ = gee_sorted_set_iterator_at (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet), element);
479 iter = _tmp1_;
480 _tmp3_ = iter;
481 if (_tmp3_ != NULL) {
482 GeeIterator* _tmp4_;
483 GeeReadOnlyCollectionIterator* _tmp5_;
484 _tmp4_ = iter;
485 _tmp5_ = gee_read_only_collection_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp4_);
486 _g_object_unref0 (_tmp2_);
487 _tmp2_ = _tmp5_;
488 } else {
489 _g_object_unref0 (_tmp2_);
490 _tmp2_ = NULL;
491 }
492 result = (GeeIterator*) _tmp2_;
493 _g_object_unref0 (iter);
494 return result;
495 }
496
497 /**
498 * {@inheritDoc}
499 */
500 static gpointer
gee_read_only_sorted_set_real_lower(GeeSortedSet * base,gconstpointer element)501 gee_read_only_sorted_set_real_lower (GeeSortedSet* base,
502 gconstpointer element)
503 {
504 GeeReadOnlySortedSet * self;
505 GeeCollection* _tmp0_;
506 gpointer _tmp1_;
507 gpointer result = NULL;
508 self = (GeeReadOnlySortedSet*) base;
509 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
510 _tmp1_ = gee_sorted_set_lower (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet), element);
511 result = _tmp1_;
512 return result;
513 }
514
515 /**
516 * {@inheritDoc}
517 */
518 static gpointer
gee_read_only_sorted_set_real_higher(GeeSortedSet * base,gconstpointer element)519 gee_read_only_sorted_set_real_higher (GeeSortedSet* base,
520 gconstpointer element)
521 {
522 GeeReadOnlySortedSet * self;
523 GeeCollection* _tmp0_;
524 gpointer _tmp1_;
525 gpointer result = NULL;
526 self = (GeeReadOnlySortedSet*) base;
527 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
528 _tmp1_ = gee_sorted_set_higher (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet), element);
529 result = _tmp1_;
530 return result;
531 }
532
533 /**
534 * {@inheritDoc}
535 */
536 static gpointer
gee_read_only_sorted_set_real_floor(GeeSortedSet * base,gconstpointer element)537 gee_read_only_sorted_set_real_floor (GeeSortedSet* base,
538 gconstpointer element)
539 {
540 GeeReadOnlySortedSet * self;
541 GeeCollection* _tmp0_;
542 gpointer _tmp1_;
543 gpointer result = NULL;
544 self = (GeeReadOnlySortedSet*) base;
545 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
546 _tmp1_ = gee_sorted_set_floor (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet), element);
547 result = _tmp1_;
548 return result;
549 }
550
551 /**
552 * {@inheritDoc}
553 */
554 static gpointer
gee_read_only_sorted_set_real_ceil(GeeSortedSet * base,gconstpointer element)555 gee_read_only_sorted_set_real_ceil (GeeSortedSet* base,
556 gconstpointer element)
557 {
558 GeeReadOnlySortedSet * self;
559 GeeCollection* _tmp0_;
560 gpointer _tmp1_;
561 gpointer result = NULL;
562 self = (GeeReadOnlySortedSet*) base;
563 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
564 _tmp1_ = gee_sorted_set_ceil (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet), element);
565 result = _tmp1_;
566 return result;
567 }
568
569 /**
570 * {@inheritDoc}
571 */
572 static GeeSortedSet*
gee_read_only_sorted_set_real_head_set(GeeSortedSet * base,gconstpointer before)573 gee_read_only_sorted_set_real_head_set (GeeSortedSet* base,
574 gconstpointer before)
575 {
576 GeeReadOnlySortedSet * self;
577 GeeCollection* _tmp0_;
578 GeeSortedSet* _tmp1_;
579 GeeSortedSet* _tmp2_;
580 GeeSortedSet* _tmp3_;
581 GeeSortedSet* _tmp4_;
582 GeeSortedSet* _tmp5_;
583 GeeSortedSet* result = NULL;
584 self = (GeeReadOnlySortedSet*) base;
585 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
586 _tmp1_ = gee_sorted_set_head_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet), before);
587 _tmp2_ = _tmp1_;
588 _tmp3_ = gee_sorted_set_get_read_only_view (_tmp2_);
589 _tmp4_ = _tmp3_;
590 _tmp5_ = _tmp4_;
591 _g_object_unref0 (_tmp2_);
592 result = _tmp5_;
593 return result;
594 }
595
596 /**
597 * {@inheritDoc}
598 */
599 static GeeSortedSet*
gee_read_only_sorted_set_real_tail_set(GeeSortedSet * base,gconstpointer after)600 gee_read_only_sorted_set_real_tail_set (GeeSortedSet* base,
601 gconstpointer after)
602 {
603 GeeReadOnlySortedSet * self;
604 GeeCollection* _tmp0_;
605 GeeSortedSet* _tmp1_;
606 GeeSortedSet* _tmp2_;
607 GeeSortedSet* _tmp3_;
608 GeeSortedSet* _tmp4_;
609 GeeSortedSet* _tmp5_;
610 GeeSortedSet* result = NULL;
611 self = (GeeReadOnlySortedSet*) base;
612 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
613 _tmp1_ = gee_sorted_set_tail_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet), after);
614 _tmp2_ = _tmp1_;
615 _tmp3_ = gee_sorted_set_get_read_only_view (_tmp2_);
616 _tmp4_ = _tmp3_;
617 _tmp5_ = _tmp4_;
618 _g_object_unref0 (_tmp2_);
619 result = _tmp5_;
620 return result;
621 }
622
623 /**
624 * {@inheritDoc}
625 */
626 static GeeSortedSet*
gee_read_only_sorted_set_real_sub_set(GeeSortedSet * base,gconstpointer from,gconstpointer to)627 gee_read_only_sorted_set_real_sub_set (GeeSortedSet* base,
628 gconstpointer from,
629 gconstpointer to)
630 {
631 GeeReadOnlySortedSet * self;
632 GeeCollection* _tmp0_;
633 GeeSortedSet* _tmp1_;
634 GeeSortedSet* _tmp2_;
635 GeeSortedSet* _tmp3_;
636 GeeSortedSet* _tmp4_;
637 GeeSortedSet* _tmp5_;
638 GeeSortedSet* result = NULL;
639 self = (GeeReadOnlySortedSet*) base;
640 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
641 _tmp1_ = gee_sorted_set_sub_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet), from, to);
642 _tmp2_ = _tmp1_;
643 _tmp3_ = gee_sorted_set_get_read_only_view (_tmp2_);
644 _tmp4_ = _tmp3_;
645 _tmp5_ = _tmp4_;
646 _g_object_unref0 (_tmp2_);
647 result = _tmp5_;
648 return result;
649 }
650
651 static gpointer
_g_object_ref0(gpointer self)652 _g_object_ref0 (gpointer self)
653 {
654 return self ? g_object_ref (self) : NULL;
655 }
656
657 static GeeSortedSet*
gee_read_only_sorted_set_real_get_read_only_view(GeeSortedSet * base)658 gee_read_only_sorted_set_real_get_read_only_view (GeeSortedSet* base)
659 {
660 GeeSortedSet* result;
661 GeeReadOnlySortedSet* self;
662 GeeSortedSet* _tmp0_;
663 self = (GeeReadOnlySortedSet*) base;
664 _tmp0_ = _g_object_ref0 ((GeeSortedSet*) self);
665 result = _tmp0_;
666 return result;
667 }
668
669 static void
gee_read_only_sorted_set_class_init(GeeReadOnlySortedSetClass * klass,gpointer klass_data)670 gee_read_only_sorted_set_class_init (GeeReadOnlySortedSetClass * klass,
671 gpointer klass_data)
672 {
673 gee_read_only_sorted_set_parent_class = g_type_class_peek_parent (klass);
674 g_type_class_adjust_private_offset (klass, &GeeReadOnlySortedSet_private_offset);
675 G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_sorted_set_get_property;
676 G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_sorted_set_set_property;
677 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
678 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
679 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
680 /**
681 * {@inheritDoc}
682 */
683 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_READ_ONLY_VIEW_PROPERTY, gee_read_only_sorted_set_properties[GEE_READ_ONLY_SORTED_SET_READ_ONLY_VIEW_PROPERTY] = g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
684 }
685
686 static GType
gee_read_only_sorted_set_gee_sorted_set_get_g_type(GeeReadOnlySortedSet * self)687 gee_read_only_sorted_set_gee_sorted_set_get_g_type (GeeReadOnlySortedSet* self)
688 {
689 return self->priv->g_type;
690 }
691
692 static GBoxedCopyFunc
gee_read_only_sorted_set_gee_sorted_set_get_g_dup_func(GeeReadOnlySortedSet * self)693 gee_read_only_sorted_set_gee_sorted_set_get_g_dup_func (GeeReadOnlySortedSet* self)
694 {
695 return self->priv->g_dup_func;
696 }
697
698 static GDestroyNotify
gee_read_only_sorted_set_gee_sorted_set_get_g_destroy_func(GeeReadOnlySortedSet * self)699 gee_read_only_sorted_set_gee_sorted_set_get_g_destroy_func (GeeReadOnlySortedSet* self)
700 {
701 return self->priv->g_destroy_func;
702 }
703
704 static void
gee_read_only_sorted_set_gee_sorted_set_interface_init(GeeSortedSetIface * iface,gpointer iface_data)705 gee_read_only_sorted_set_gee_sorted_set_interface_init (GeeSortedSetIface * iface,
706 gpointer iface_data)
707 {
708 gee_read_only_sorted_set_gee_sorted_set_parent_iface = g_type_interface_peek_parent (iface);
709 iface->first = (gpointer (*) (GeeSortedSet*)) gee_read_only_sorted_set_real_first;
710 iface->last = (gpointer (*) (GeeSortedSet*)) gee_read_only_sorted_set_real_last;
711 iface->iterator_at = (GeeIterator* (*) (GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_iterator_at;
712 iface->lower = (gpointer (*) (GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_lower;
713 iface->higher = (gpointer (*) (GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_higher;
714 iface->floor = (gpointer (*) (GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_floor;
715 iface->ceil = (gpointer (*) (GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_ceil;
716 iface->head_set = (GeeSortedSet* (*) (GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_head_set;
717 iface->tail_set = (GeeSortedSet* (*) (GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_tail_set;
718 iface->sub_set = (GeeSortedSet* (*) (GeeSortedSet*, gconstpointer, gconstpointer)) gee_read_only_sorted_set_real_sub_set;
719 iface->get_g_type = (GType (*) (GeeSortedSet *)) gee_read_only_sorted_set_gee_sorted_set_get_g_type;
720 iface->get_g_dup_func = (GBoxedCopyFunc (*) (GeeSortedSet *)) gee_read_only_sorted_set_gee_sorted_set_get_g_dup_func;
721 iface->get_g_destroy_func = (GDestroyNotify (*) (GeeSortedSet *)) gee_read_only_sorted_set_gee_sorted_set_get_g_destroy_func;
722 iface->get_read_only_view = gee_read_only_sorted_set_real_get_read_only_view;
723 }
724
725 static void
gee_read_only_sorted_set_instance_init(GeeReadOnlySortedSet * self,gpointer klass)726 gee_read_only_sorted_set_instance_init (GeeReadOnlySortedSet * self,
727 gpointer klass)
728 {
729 self->priv = gee_read_only_sorted_set_get_instance_private (self);
730 }
731
732 /**
733 * Read-only view for {@link SortedSet} collections.
734 *
735 * This class decorates any class which implements the {@link SortedSet} interface
736 * by making it read only. Any method which normally modify data will throw an
737 * error.
738 *
739 * @see SortedSet
740 */
741 G_GNUC_INTERNAL GType
gee_read_only_sorted_set_get_type(void)742 gee_read_only_sorted_set_get_type (void)
743 {
744 static volatile gsize gee_read_only_sorted_set_type_id__volatile = 0;
745 if (g_once_init_enter (&gee_read_only_sorted_set_type_id__volatile)) {
746 static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlySortedSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_sorted_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlySortedSet), 0, (GInstanceInitFunc) gee_read_only_sorted_set_instance_init, NULL };
747 static const GInterfaceInfo gee_sorted_set_info = { (GInterfaceInitFunc) gee_read_only_sorted_set_gee_sorted_set_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
748 GType gee_read_only_sorted_set_type_id;
749 gee_read_only_sorted_set_type_id = g_type_register_static (GEE_TYPE_READ_ONLY_SET, "GeeReadOnlySortedSet", &g_define_type_info, 0);
750 g_type_add_interface_static (gee_read_only_sorted_set_type_id, GEE_TYPE_SORTED_SET, &gee_sorted_set_info);
751 GeeReadOnlySortedSet_private_offset = g_type_add_instance_private (gee_read_only_sorted_set_type_id, sizeof (GeeReadOnlySortedSetPrivate));
752 g_once_init_leave (&gee_read_only_sorted_set_type_id__volatile, gee_read_only_sorted_set_type_id);
753 }
754 return gee_read_only_sorted_set_type_id__volatile;
755 }
756
757 static void
_vala_gee_read_only_sorted_set_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)758 _vala_gee_read_only_sorted_set_get_property (GObject * object,
759 guint property_id,
760 GValue * value,
761 GParamSpec * pspec)
762 {
763 GeeReadOnlySortedSet * self;
764 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet);
765 switch (property_id) {
766 case GEE_READ_ONLY_SORTED_SET_READ_ONLY_VIEW_PROPERTY:
767 g_value_take_object (value, gee_sorted_set_get_read_only_view ((GeeSortedSet*) self));
768 break;
769 case GEE_READ_ONLY_SORTED_SET_G_TYPE:
770 g_value_set_gtype (value, self->priv->g_type);
771 break;
772 case GEE_READ_ONLY_SORTED_SET_G_DUP_FUNC:
773 g_value_set_pointer (value, self->priv->g_dup_func);
774 break;
775 case GEE_READ_ONLY_SORTED_SET_G_DESTROY_FUNC:
776 g_value_set_pointer (value, self->priv->g_destroy_func);
777 break;
778 default:
779 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
780 break;
781 }
782 }
783
784 static void
_vala_gee_read_only_sorted_set_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)785 _vala_gee_read_only_sorted_set_set_property (GObject * object,
786 guint property_id,
787 const GValue * value,
788 GParamSpec * pspec)
789 {
790 GeeReadOnlySortedSet * self;
791 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet);
792 switch (property_id) {
793 case GEE_READ_ONLY_SORTED_SET_G_TYPE:
794 self->priv->g_type = g_value_get_gtype (value);
795 break;
796 case GEE_READ_ONLY_SORTED_SET_G_DUP_FUNC:
797 self->priv->g_dup_func = g_value_get_pointer (value);
798 break;
799 case GEE_READ_ONLY_SORTED_SET_G_DESTROY_FUNC:
800 self->priv->g_destroy_func = g_value_get_pointer (value);
801 break;
802 default:
803 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
804 break;
805 }
806 }
807
808