1 /* gmpc-widgets-qtable.c generated by valac 0.12.0, the Vala compiler
2  * generated from gmpc-widgets-qtable.vala, do not modify */
3 
4 /* Gnome Music Player Client (GMPC)
5  * Copyright (C) 2004-2011 Qball Cow <qball@gmpclient.org>
6  * Project homepage: http://gmpclient.org/
7 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17 
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22 
23 #include <glib.h>
24 #include <glib-object.h>
25 #include <gtk/gtk.h>
26 #include <gtktransition.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include <config.h>
30 #include "gmpc-extras.h"
31 #include <gdk/gdk.h>
32 #include <gobject/gvaluecollector.h>
33 
34 
35 #define TYPE_QTABLE_ENTRY (qtable_entry_get_type ())
36 #define QTABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_QTABLE_ENTRY, QtableEntry))
37 #define QTABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_QTABLE_ENTRY, QtableEntryClass))
38 #define IS_QTABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_QTABLE_ENTRY))
39 #define IS_QTABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_QTABLE_ENTRY))
40 #define QTABLE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_QTABLE_ENTRY, QtableEntryClass))
41 
42 typedef struct _QtableEntry QtableEntry;
43 typedef struct _QtableEntryClass QtableEntryClass;
44 typedef struct _QtableEntryPrivate QtableEntryPrivate;
45 
46 #define QTABLE_ENTRY_TYPE_TYPE (qtable_entry_type_get_type ())
47 typedef struct _ParamSpecQtableEntry ParamSpecQtableEntry;
48 #define __g_list_free__qtable_entry_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__qtable_entry_unref0_ (var), NULL)))
49 #define _qtable_entry_unref0(var) ((var == NULL) ? NULL : (var = (qtable_entry_unref (var), NULL)))
50 
51 typedef enum  {
52 	QTABLE_ENTRY_TYPE_HEADER,
53 	QTABLE_ENTRY_TYPE_ITEM
54 } QtableEntryType;
55 
56 struct _QtableEntry {
57 	GTypeInstance parent_instance;
58 	volatile int ref_count;
59 	QtableEntryPrivate * priv;
60 	QtableEntryType type;
61 	GtkWidget* widget;
62 };
63 
64 struct _QtableEntryClass {
65 	GTypeClass parent_class;
66 	void (*finalize) (QtableEntry *self);
67 };
68 
69 struct _ParamSpecQtableEntry {
70 	GParamSpec parent_instance;
71 };
72 
73 struct _GmpcWidgetsQtablePrivate {
74 	gint item_width_real;
75 	gint item_height_real;
76 	gint header_height_real;
77 	gint max_columns_real;
78 	gint num_items;
79 	gint columns;
80 	gint _spacing;
81 	GList* children;
82 };
83 
84 
85 static gpointer qtable_entry_parent_class = NULL;
86 static gpointer gmpc_widgets_qtable_parent_class = NULL;
87 static GtkBuildableIface* gmpc_widgets_qtable_gtk_buildable_parent_iface = NULL;
88 
89 #define use_transition_gav TRUE
90 #define some_unique_name_gav VERSION
91 gpointer qtable_entry_ref (gpointer instance);
92 void qtable_entry_unref (gpointer instance);
93 GParamSpec* param_spec_qtable_entry (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
94 void value_set_qtable_entry (GValue* value, gpointer v_object);
95 void value_take_qtable_entry (GValue* value, gpointer v_object);
96 gpointer value_get_qtable_entry (const GValue* value);
97 GType qtable_entry_get_type (void) G_GNUC_CONST;
98 GType qtable_entry_type_get_type (void) G_GNUC_CONST;
99 enum  {
100 	QTABLE_ENTRY_DUMMY_PROPERTY
101 };
102 QtableEntry* qtable_entry_new (void);
103 QtableEntry* qtable_entry_construct (GType object_type);
104 static void qtable_entry_finalize (QtableEntry* obj);
105 #define GMPC_WIDGETS_QTABLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GMPC_WIDGETS_TYPE_QTABLE, GmpcWidgetsQtablePrivate))
106 enum  {
107 	GMPC_WIDGETS_QTABLE_DUMMY_PROPERTY,
108 	GMPC_WIDGETS_QTABLE_SPACING,
109 	GMPC_WIDGETS_QTABLE_MAX_COLUMNS,
110 	GMPC_WIDGETS_QTABLE_ITEM_WIDTH,
111 	GMPC_WIDGETS_QTABLE_ITEM_HEIGHT,
112 	GMPC_WIDGETS_QTABLE_HEADER_HEIGHT
113 };
114 static void _qtable_entry_unref0_ (gpointer var);
115 static void _g_list_free__qtable_entry_unref0_ (GList* self);
116 static void gmpc_widgets_qtable_real_add_child (GtkBuildable* base, GtkBuilder* build, GObject* child, const gchar* type);
117 static void gmpc_widgets_qtable_real_size_request (GtkWidget* base, GtkRequisition* req);
118 static void gmpc_widgets_qtable_real_add (GtkContainer* base, GtkWidget* widget);
119 static GType gmpc_widgets_qtable_real_child_type (GtkContainer* base);
120 static void gmpc_widgets_qtable_real_remove (GtkContainer* base, GtkWidget* widget);
121 static void gmpc_widgets_qtable_real_size_allocate (GtkWidget* base, GdkRectangle* alloc);
122 static void gmpc_widgets_qtable_real_forall_internal (GtkContainer* base, gboolean include_internals, GtkCallback callback, void* callback_target);
123 static GObject * gmpc_widgets_qtable_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
124 static void gmpc_widgets_qtable_finalize (GObject* obj);
125 static void _vala_gmpc_widgets_qtable_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
126 static void _vala_gmpc_widgets_qtable_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
127 
128 
qtable_entry_type_get_type(void)129 GType qtable_entry_type_get_type (void) {
130 	static volatile gsize qtable_entry_type_type_id__volatile = 0;
131 	if (g_once_init_enter (&qtable_entry_type_type_id__volatile)) {
132 		static const GEnumValue values[] = {{QTABLE_ENTRY_TYPE_HEADER, "QTABLE_ENTRY_TYPE_HEADER", "header"}, {QTABLE_ENTRY_TYPE_ITEM, "QTABLE_ENTRY_TYPE_ITEM", "item"}, {0, NULL, NULL}};
133 		GType qtable_entry_type_type_id;
134 		qtable_entry_type_type_id = g_enum_register_static ("QtableEntryType", values);
135 		g_once_init_leave (&qtable_entry_type_type_id__volatile, qtable_entry_type_type_id);
136 	}
137 	return qtable_entry_type_type_id__volatile;
138 }
139 
140 
qtable_entry_construct(GType object_type)141 QtableEntry* qtable_entry_construct (GType object_type) {
142 	QtableEntry* self = NULL;
143 	self = (QtableEntry*) g_type_create_instance (object_type);
144 	return self;
145 }
146 
147 
qtable_entry_new(void)148 QtableEntry* qtable_entry_new (void) {
149 	return qtable_entry_construct (TYPE_QTABLE_ENTRY);
150 }
151 
152 
value_qtable_entry_init(GValue * value)153 static void value_qtable_entry_init (GValue* value) {
154 	value->data[0].v_pointer = NULL;
155 }
156 
157 
value_qtable_entry_free_value(GValue * value)158 static void value_qtable_entry_free_value (GValue* value) {
159 	if (value->data[0].v_pointer) {
160 		qtable_entry_unref (value->data[0].v_pointer);
161 	}
162 }
163 
164 
value_qtable_entry_copy_value(const GValue * src_value,GValue * dest_value)165 static void value_qtable_entry_copy_value (const GValue* src_value, GValue* dest_value) {
166 	if (src_value->data[0].v_pointer) {
167 		dest_value->data[0].v_pointer = qtable_entry_ref (src_value->data[0].v_pointer);
168 	} else {
169 		dest_value->data[0].v_pointer = NULL;
170 	}
171 }
172 
173 
value_qtable_entry_peek_pointer(const GValue * value)174 static gpointer value_qtable_entry_peek_pointer (const GValue* value) {
175 	return value->data[0].v_pointer;
176 }
177 
178 
value_qtable_entry_collect_value(GValue * value,guint n_collect_values,GTypeCValue * collect_values,guint collect_flags)179 static gchar* value_qtable_entry_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
180 	if (collect_values[0].v_pointer) {
181 		QtableEntry* object;
182 		object = collect_values[0].v_pointer;
183 		if (object->parent_instance.g_class == NULL) {
184 			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
185 		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
186 			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
187 		}
188 		value->data[0].v_pointer = qtable_entry_ref (object);
189 	} else {
190 		value->data[0].v_pointer = NULL;
191 	}
192 	return NULL;
193 }
194 
195 
value_qtable_entry_lcopy_value(const GValue * value,guint n_collect_values,GTypeCValue * collect_values,guint collect_flags)196 static gchar* value_qtable_entry_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
197 	QtableEntry** object_p;
198 	object_p = collect_values[0].v_pointer;
199 	if (!object_p) {
200 		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
201 	}
202 	if (!value->data[0].v_pointer) {
203 		*object_p = NULL;
204 	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
205 		*object_p = value->data[0].v_pointer;
206 	} else {
207 		*object_p = qtable_entry_ref (value->data[0].v_pointer);
208 	}
209 	return NULL;
210 }
211 
212 
param_spec_qtable_entry(const gchar * name,const gchar * nick,const gchar * blurb,GType object_type,GParamFlags flags)213 GParamSpec* param_spec_qtable_entry (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
214 	ParamSpecQtableEntry* spec;
215 	g_return_val_if_fail (g_type_is_a (object_type, TYPE_QTABLE_ENTRY), NULL);
216 	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
217 	G_PARAM_SPEC (spec)->value_type = object_type;
218 	return G_PARAM_SPEC (spec);
219 }
220 
221 
value_get_qtable_entry(const GValue * value)222 gpointer value_get_qtable_entry (const GValue* value) {
223 	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_QTABLE_ENTRY), NULL);
224 	return value->data[0].v_pointer;
225 }
226 
227 
value_set_qtable_entry(GValue * value,gpointer v_object)228 void value_set_qtable_entry (GValue* value, gpointer v_object) {
229 	QtableEntry* old;
230 	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_QTABLE_ENTRY));
231 	old = value->data[0].v_pointer;
232 	if (v_object) {
233 		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_QTABLE_ENTRY));
234 		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
235 		value->data[0].v_pointer = v_object;
236 		qtable_entry_ref (value->data[0].v_pointer);
237 	} else {
238 		value->data[0].v_pointer = NULL;
239 	}
240 	if (old) {
241 		qtable_entry_unref (old);
242 	}
243 }
244 
245 
value_take_qtable_entry(GValue * value,gpointer v_object)246 void value_take_qtable_entry (GValue* value, gpointer v_object) {
247 	QtableEntry* old;
248 	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_QTABLE_ENTRY));
249 	old = value->data[0].v_pointer;
250 	if (v_object) {
251 		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_QTABLE_ENTRY));
252 		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
253 		value->data[0].v_pointer = v_object;
254 	} else {
255 		value->data[0].v_pointer = NULL;
256 	}
257 	if (old) {
258 		qtable_entry_unref (old);
259 	}
260 }
261 
262 
qtable_entry_class_init(QtableEntryClass * klass)263 static void qtable_entry_class_init (QtableEntryClass * klass) {
264 	qtable_entry_parent_class = g_type_class_peek_parent (klass);
265 	QTABLE_ENTRY_CLASS (klass)->finalize = qtable_entry_finalize;
266 }
267 
268 
qtable_entry_instance_init(QtableEntry * self)269 static void qtable_entry_instance_init (QtableEntry * self) {
270 	self->ref_count = 1;
271 }
272 
273 
qtable_entry_finalize(QtableEntry * obj)274 static void qtable_entry_finalize (QtableEntry* obj) {
275 	QtableEntry * self;
276 	self = QTABLE_ENTRY (obj);
277 }
278 
279 
qtable_entry_get_type(void)280 GType qtable_entry_get_type (void) {
281 	static volatile gsize qtable_entry_type_id__volatile = 0;
282 	if (g_once_init_enter (&qtable_entry_type_id__volatile)) {
283 		static const GTypeValueTable g_define_type_value_table = { value_qtable_entry_init, value_qtable_entry_free_value, value_qtable_entry_copy_value, value_qtable_entry_peek_pointer, "p", value_qtable_entry_collect_value, "p", value_qtable_entry_lcopy_value };
284 		static const GTypeInfo g_define_type_info = { sizeof (QtableEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) qtable_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (QtableEntry), 0, (GInstanceInitFunc) qtable_entry_instance_init, &g_define_type_value_table };
285 		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
286 		GType qtable_entry_type_id;
287 		qtable_entry_type_id = g_type_register_fundamental (g_type_fundamental_next (), "QtableEntry", &g_define_type_info, &g_define_type_fundamental_info, 0);
288 		g_once_init_leave (&qtable_entry_type_id__volatile, qtable_entry_type_id);
289 	}
290 	return qtable_entry_type_id__volatile;
291 }
292 
293 
qtable_entry_ref(gpointer instance)294 gpointer qtable_entry_ref (gpointer instance) {
295 	QtableEntry* self;
296 	self = instance;
297 	g_atomic_int_inc (&self->ref_count);
298 	return instance;
299 }
300 
301 
qtable_entry_unref(gpointer instance)302 void qtable_entry_unref (gpointer instance) {
303 	QtableEntry* self;
304 	self = instance;
305 	if (g_atomic_int_dec_and_test (&self->ref_count)) {
306 		QTABLE_ENTRY_GET_CLASS (self)->finalize (self);
307 		g_type_free_instance ((GTypeInstance *) self);
308 	}
309 }
310 
311 
_qtable_entry_unref0_(gpointer var)312 static void _qtable_entry_unref0_ (gpointer var) {
313 	(var == NULL) ? NULL : (var = (qtable_entry_unref (var), NULL));
314 }
315 
316 
_g_list_free__qtable_entry_unref0_(GList * self)317 static void _g_list_free__qtable_entry_unref0_ (GList* self) {
318 	g_list_foreach (self, (GFunc) _qtable_entry_unref0_, NULL);
319 	g_list_free (self);
320 }
321 
322 
gmpc_widgets_qtable_real_add_child(GtkBuildable * base,GtkBuilder * build,GObject * child,const gchar * type)323 static void gmpc_widgets_qtable_real_add_child (GtkBuildable* base, GtkBuilder* build, GObject* child, const gchar* type) {
324 	GmpcWidgetsQtable * self;
325 	gboolean _tmp0_ = FALSE;
326 	self = (GmpcWidgetsQtable*) base;
327 	g_return_if_fail (build != NULL);
328 	g_return_if_fail (child != NULL);
329 	if (!GTK_IS_WIDGET (child)) {
330 		g_warning ("gmpc-widgets-qtable.vala:92: Trying to add non widget");
331 		return;
332 	}
333 	if (type != NULL) {
334 		_tmp0_ = g_strcmp0 (type, "header") == 0;
335 	} else {
336 		_tmp0_ = FALSE;
337 	}
338 	if (_tmp0_) {
339 		GObject* _tmp1_;
340 		_tmp1_ = child;
341 		gmpc_widgets_qtable_add_header (self, GTK_IS_WIDGET (_tmp1_) ? ((GtkWidget*) _tmp1_) : NULL);
342 	} else {
343 		GObject* _tmp2_;
344 		_tmp2_ = child;
345 		gtk_container_add ((GtkContainer*) self, GTK_IS_WIDGET (_tmp2_) ? ((GtkWidget*) _tmp2_) : NULL);
346 	}
347 }
348 
349 
gmpc_widgets_qtable_construct(GType object_type)350 GmpcWidgetsQtable* gmpc_widgets_qtable_construct (GType object_type) {
351 	GmpcWidgetsQtable * self = NULL;
352 	self = (GmpcWidgetsQtable*) g_object_new (object_type, NULL);
353 	return self;
354 }
355 
356 
gmpc_widgets_qtable_new(void)357 GmpcWidgetsQtable* gmpc_widgets_qtable_new (void) {
358 	return gmpc_widgets_qtable_construct (GMPC_WIDGETS_TYPE_QTABLE);
359 }
360 
361 
362 /**
363      * Calculates the size of the widget.
364  */
_qtable_entry_ref0(gpointer self)365 static gpointer _qtable_entry_ref0 (gpointer self) {
366 	return self ? qtable_entry_ref (self) : NULL;
367 }
368 
369 
gmpc_widgets_qtable_real_size_request(GtkWidget * base,GtkRequisition * req)370 static void gmpc_widgets_qtable_real_size_request (GtkWidget* base, GtkRequisition* req) {
371 	GmpcWidgetsQtable * self;
372 	GtkRequisition _req = {0};
373 	GtkRequisition _tmp0_ = {0};
374 	GtkRequisition _tmp1_ = {0};
375 	gint cover_width;
376 	gint cover_height;
377 	gint header_height;
378 	gint width;
379 	gint items;
380 	gint rows;
381 	self = (GmpcWidgetsQtable*) base;
382 	memset (&_tmp0_, 0, sizeof (GtkRequisition));
383 	_tmp1_ = _tmp0_;
384 	_req = _tmp1_;
385 	cover_width = self->priv->item_width_real;
386 	cover_height = self->priv->item_height_real;
387 	header_height = self->priv->header_height_real;
388 	width = 0;
389 	items = 0;
390 	{
391 		GList* child_collection;
392 		GList* child_it;
393 		child_collection = self->priv->children;
394 		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
395 			QtableEntry* _tmp2_;
396 			QtableEntry* child;
397 			_tmp2_ = _qtable_entry_ref0 ((QtableEntry*) child_it->data);
398 			child = _tmp2_;
399 			{
400 				gboolean _tmp3_;
401 				_tmp3_ = gtk_widget_get_visible (child->widget);
402 				if (_tmp3_) {
403 					if (child->type == QTABLE_ENTRY_TYPE_ITEM) {
404 						GtkRequisition _tmp4_ = {0};
405 						GtkRequisition cr;
406 						GtkRequisition _tmp5_ = {0};
407 						gint _tmp6_;
408 						gint _tmp7_;
409 						_tmp4_.width = 0;
410 						_tmp4_.height = 0;
411 						cr = _tmp4_;
412 						gtk_widget_size_request (child->widget, &_tmp5_);
413 						cr = _tmp5_;
414 						_tmp6_ = MAX (cr.width, cover_width);
415 						cover_width = _tmp6_;
416 						_tmp7_ = MAX (cr.height, cover_height);
417 						cover_height = _tmp7_;
418 					} else {
419 						GtkRequisition _tmp8_ = {0};
420 						GtkRequisition cr;
421 						GtkRequisition _tmp9_ = {0};
422 						gint _tmp10_;
423 						gint _tmp11_;
424 						_tmp8_.width = 0;
425 						_tmp8_.height = 0;
426 						cr = _tmp8_;
427 						gtk_widget_size_request (child->widget, &_tmp9_);
428 						cr = _tmp9_;
429 						_tmp10_ = MAX (cr.width, width);
430 						width = _tmp10_;
431 						_tmp11_ = MAX (cr.height, header_height);
432 						header_height = _tmp11_;
433 					}
434 				}
435 				_qtable_entry_unref0 (child);
436 			}
437 		}
438 	}
439 	if (self->priv->_spacing > 0) {
440 		cover_width = cover_width + self->priv->_spacing;
441 		cover_height = cover_height + self->priv->_spacing;
442 		header_height = header_height + self->priv->_spacing;
443 	}
444 	rows = 0;
445 	{
446 		GList* child_collection;
447 		GList* child_it;
448 		child_collection = self->priv->children;
449 		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
450 			QtableEntry* _tmp12_;
451 			QtableEntry* child;
452 			_tmp12_ = _qtable_entry_ref0 ((QtableEntry*) child_it->data);
453 			child = _tmp12_;
454 			{
455 				gboolean _tmp13_;
456 				_tmp13_ = gtk_widget_get_visible (child->widget);
457 				if (_tmp13_) {
458 					if (child->type == QTABLE_ENTRY_TYPE_ITEM) {
459 						items++;
460 					} else {
461 						if (items != 0) {
462 							gint nrows;
463 							gint _tmp14_ = 0;
464 							gint remain;
465 							nrows = items / self->priv->columns;
466 							if ((items % self->priv->columns) > 0) {
467 								_tmp14_ = 1;
468 							} else {
469 								_tmp14_ = 0;
470 							}
471 							remain = _tmp14_;
472 							rows = rows + ((nrows + remain) * cover_height);
473 						}
474 						items = 0;
475 						rows = rows + header_height;
476 					}
477 				}
478 				_qtable_entry_unref0 (child);
479 			}
480 		}
481 	}
482 	if (items != 0) {
483 		gint nrows;
484 		gint _tmp15_ = 0;
485 		gint remain;
486 		nrows = items / self->priv->columns;
487 		if ((items % self->priv->columns) > 0) {
488 			_tmp15_ = 1;
489 		} else {
490 			_tmp15_ = 0;
491 		}
492 		remain = _tmp15_;
493 		rows = rows + ((nrows + remain) * cover_height);
494 	}
495 	_req.width = cover_width;
496 	_req.height = rows;
497 	if (req) {
498 		*req = _req;
499 	}
500 }
501 
502 
gmpc_widgets_qtable_real_add(GtkContainer * base,GtkWidget * widget)503 static void gmpc_widgets_qtable_real_add (GtkContainer* base, GtkWidget* widget) {
504 	GmpcWidgetsQtable * self;
505 	self = (GmpcWidgetsQtable*) base;
506 	g_return_if_fail (widget != NULL);
507 	if (widget != NULL) {
508 		QtableEntry* _tmp0_ = NULL;
509 		QtableEntry* a;
510 		QtableEntry* _tmp1_;
511 		_tmp0_ = qtable_entry_new ();
512 		a = _tmp0_;
513 		a->type = QTABLE_ENTRY_TYPE_ITEM;
514 		a->widget = widget;
515 		_tmp1_ = _qtable_entry_ref0 (a);
516 		self->priv->children = g_list_append (self->priv->children, _tmp1_);
517 		gtk_widget_set_parent (widget, (GtkWidget*) self);
518 		self->priv->num_items++;
519 		gtk_widget_queue_resize ((GtkWidget*) self);
520 		_qtable_entry_unref0 (a);
521 	}
522 }
523 
524 
gmpc_widgets_qtable_add_header(GmpcWidgetsQtable * self,GtkWidget * widget)525 void gmpc_widgets_qtable_add_header (GmpcWidgetsQtable* self, GtkWidget* widget) {
526 	g_return_if_fail (self != NULL);
527 	g_return_if_fail (widget != NULL);
528 	if (widget != NULL) {
529 		QtableEntry* _tmp0_ = NULL;
530 		QtableEntry* a;
531 		QtableEntry* _tmp1_;
532 		_tmp0_ = qtable_entry_new ();
533 		a = _tmp0_;
534 		a->type = QTABLE_ENTRY_TYPE_HEADER;
535 		a->widget = widget;
536 		_tmp1_ = _qtable_entry_ref0 (a);
537 		self->priv->children = g_list_append (self->priv->children, _tmp1_);
538 		gtk_widget_set_parent (widget, (GtkWidget*) self);
539 		self->priv->num_items++;
540 		gtk_widget_queue_resize ((GtkWidget*) self);
541 		_qtable_entry_unref0 (a);
542 	}
543 }
544 
545 
gmpc_widgets_qtable_real_child_type(GtkContainer * base)546 static GType gmpc_widgets_qtable_real_child_type (GtkContainer* base) {
547 	GmpcWidgetsQtable * self;
548 	GType result = 0UL;
549 	self = (GmpcWidgetsQtable*) base;
550 	result = GTK_TYPE_WIDGET;
551 	return result;
552 }
553 
554 
gmpc_widgets_qtable_real_remove(GtkContainer * base,GtkWidget * widget)555 static void gmpc_widgets_qtable_real_remove (GtkContainer* base, GtkWidget* widget) {
556 	GmpcWidgetsQtable * self;
557 	self = (GmpcWidgetsQtable*) base;
558 	g_return_if_fail (widget != NULL);
559 	if (widget != NULL) {
560 		QtableEntry* a;
561 		gboolean _tmp2_;
562 		gboolean visible;
563 		QtableEntry* _tmp3_;
564 		QtableEntry* _tmp4_;
565 		a = NULL;
566 		{
567 			GList* f_collection;
568 			GList* f_it;
569 			f_collection = self->priv->children;
570 			for (f_it = f_collection; f_it != NULL; f_it = f_it->next) {
571 				QtableEntry* _tmp0_;
572 				QtableEntry* f;
573 				_tmp0_ = _qtable_entry_ref0 ((QtableEntry*) f_it->data);
574 				f = _tmp0_;
575 				{
576 					if (f->widget == widget) {
577 						QtableEntry* _tmp1_;
578 						_tmp1_ = _qtable_entry_ref0 (f);
579 						_qtable_entry_unref0 (a);
580 						a = _tmp1_;
581 						_qtable_entry_unref0 (f);
582 						break;
583 					}
584 					_qtable_entry_unref0 (f);
585 				}
586 			}
587 		}
588 		if (a == NULL) {
589 			g_error ("gmpc-widgets-qtable.vala:221: Failed to find widget in container");
590 		}
591 		_tmp2_ = gtk_widget_get_visible (widget);
592 		visible = _tmp2_;
593 		gtk_widget_unparent (widget);
594 		_tmp3_ = a;
595 		a = NULL;
596 		_tmp4_ = _tmp3_;
597 		self->priv->children = g_list_remove (self->priv->children, _tmp4_);
598 		_qtable_entry_unref0 (_tmp4_);
599 		self->priv->num_items--;
600 		if (visible) {
601 			gtk_widget_queue_resize ((GtkWidget*) self);
602 		}
603 		_qtable_entry_unref0 (a);
604 	}
605 }
606 
607 
gmpc_widgets_qtable_real_size_allocate(GtkWidget * base,GdkRectangle * alloc)608 static void gmpc_widgets_qtable_real_size_allocate (GtkWidget* base, GdkRectangle* alloc) {
609 	GmpcWidgetsQtable * self;
610 	gint cover_width;
611 	gint cover_height;
612 	gint header_height;
613 	gint width;
614 	gint new_columns;
615 	gint rows;
616 	gint item;
617 	gint _tmp10_;
618 	self = (GmpcWidgetsQtable*) base;
619 	cover_width = self->priv->item_width_real;
620 	cover_height = self->priv->item_height_real;
621 	header_height = self->priv->header_height_real;
622 	if ((*alloc).width == 1) {
623 		return;
624 	}
625 	width = (*alloc).width;
626 	new_columns = 0;
627 	rows = 0;
628 	item = 0;
629 	((GtkWidget*) self)->allocation = (GtkAllocation) (*alloc);
630 	{
631 		GList* child_collection;
632 		GList* child_it;
633 		child_collection = self->priv->children;
634 		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
635 			QtableEntry* _tmp0_;
636 			QtableEntry* child;
637 			_tmp0_ = _qtable_entry_ref0 ((QtableEntry*) child_it->data);
638 			child = _tmp0_;
639 			{
640 				gboolean _tmp1_;
641 				_tmp1_ = gtk_widget_get_visible (child->widget);
642 				if (_tmp1_) {
643 					if (child->type == QTABLE_ENTRY_TYPE_ITEM) {
644 						GtkRequisition _tmp2_ = {0};
645 						GtkRequisition cr;
646 						GtkRequisition _tmp3_ = {0};
647 						gint _tmp4_;
648 						gint _tmp5_;
649 						_tmp2_.width = 0;
650 						_tmp2_.height = 0;
651 						cr = _tmp2_;
652 						gtk_widget_size_request (child->widget, &_tmp3_);
653 						cr = _tmp3_;
654 						_tmp4_ = MAX (cr.width, cover_width);
655 						cover_width = _tmp4_;
656 						_tmp5_ = MAX (cr.height, cover_height);
657 						cover_height = _tmp5_;
658 						item++;
659 					} else {
660 						GtkRequisition _tmp6_ = {0};
661 						GtkRequisition cr;
662 						GtkRequisition _tmp7_ = {0};
663 						gint _tmp8_;
664 						gint _tmp9_;
665 						_tmp6_.width = 0;
666 						_tmp6_.height = 0;
667 						cr = _tmp6_;
668 						gtk_widget_size_request (child->widget, &_tmp7_);
669 						cr = _tmp7_;
670 						item = 0;
671 						_tmp8_ = MAX (cr.width, width);
672 						width = _tmp8_;
673 						_tmp9_ = MAX (cr.height, header_height);
674 						header_height = _tmp9_;
675 					}
676 				}
677 				_qtable_entry_unref0 (child);
678 			}
679 		}
680 	}
681 	if (self->priv->_spacing > 0) {
682 		cover_width = cover_width + self->priv->_spacing;
683 		cover_height = cover_height + self->priv->_spacing;
684 		header_height = header_height + self->priv->_spacing;
685 	}
686 	_tmp10_ = MAX (width / cover_width, 1);
687 	new_columns = _tmp10_;
688 	if (self->priv->max_columns_real > 0) {
689 		gint _tmp11_;
690 		_tmp11_ = MIN (new_columns, self->priv->max_columns_real);
691 		new_columns = _tmp11_;
692 	}
693 	item = 0;
694 	{
695 		GList* child_collection;
696 		GList* child_it;
697 		child_collection = self->priv->children;
698 		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
699 			QtableEntry* _tmp12_;
700 			QtableEntry* child;
701 			_tmp12_ = _qtable_entry_ref0 ((QtableEntry*) child_it->data);
702 			child = _tmp12_;
703 			{
704 				gboolean _tmp13_;
705 				_tmp13_ = gtk_widget_get_visible (child->widget);
706 				if (_tmp13_) {
707 					if (child->type == QTABLE_ENTRY_TYPE_ITEM) {
708 						GdkRectangle _tmp14_ = {0};
709 						GdkRectangle ca;
710 						_tmp14_.x = 0;
711 						_tmp14_.y = 0;
712 						_tmp14_.width = 0;
713 						_tmp14_.height = 0;
714 						ca = _tmp14_;
715 						ca.x = (*alloc).x + ((item % self->priv->columns) * cover_width);
716 						ca.y = (rows + (*alloc).y) + ((item / self->priv->columns) * cover_height);
717 						ca.width = cover_width - self->priv->_spacing;
718 						ca.height = cover_height - self->priv->_spacing;
719 						gtk_widget_size_allocate (child->widget, &ca);
720 						item++;
721 					} else {
722 						GdkRectangle _tmp16_ = {0};
723 						GdkRectangle ca;
724 						if (item != 0) {
725 							gint nrows;
726 							gint _tmp15_ = 0;
727 							gint remain;
728 							nrows = item / self->priv->columns;
729 							if ((item % self->priv->columns) > 0) {
730 								_tmp15_ = 1;
731 							} else {
732 								_tmp15_ = 0;
733 							}
734 							remain = _tmp15_;
735 							rows = rows + ((nrows + remain) * cover_height);
736 						}
737 						item = 0;
738 						_tmp16_.x = 0;
739 						_tmp16_.y = 0;
740 						_tmp16_.width = 0;
741 						_tmp16_.height = 0;
742 						ca = _tmp16_;
743 						ca.x = (*alloc).x;
744 						ca.y = (*alloc).y + rows;
745 						ca.width = cover_width * self->priv->columns;
746 						ca.height = header_height - self->priv->_spacing;
747 						gtk_widget_size_allocate (child->widget, &ca);
748 						rows = rows + header_height;
749 					}
750 				}
751 				_qtable_entry_unref0 (child);
752 			}
753 		}
754 	}
755 	if (new_columns != self->priv->columns) {
756 		self->priv->columns = new_columns;
757 		gtk_widget_queue_resize ((GtkWidget*) self);
758 	}
759 }
760 
761 
gmpc_widgets_qtable_real_forall_internal(GtkContainer * base,gboolean include_internals,GtkCallback callback,void * callback_target)762 static void gmpc_widgets_qtable_real_forall_internal (GtkContainer* base, gboolean include_internals, GtkCallback callback, void* callback_target) {
763 	GmpcWidgetsQtable * self;
764 	GList* _tmp0_ = NULL;
765 	GList* iter;
766 	self = (GmpcWidgetsQtable*) base;
767 	_tmp0_ = g_list_first (self->priv->children);
768 	iter = _tmp0_;
769 	while (TRUE) {
770 		QtableEntry* child;
771 		if (!(iter != NULL)) {
772 			break;
773 		}
774 		child = (QtableEntry*) iter->data;
775 		iter = iter->next;
776 		callback (child->widget, callback_target);
777 	}
778 }
779 
780 
gmpc_widgets_qtable_clear(GmpcWidgetsQtable * self)781 void gmpc_widgets_qtable_clear (GmpcWidgetsQtable* self) {
782 	g_return_if_fail (self != NULL);
783 	{
784 		GList* a_collection;
785 		GList* a_it;
786 		a_collection = self->priv->children;
787 		for (a_it = a_collection; a_it != NULL; a_it = a_it->next) {
788 			QtableEntry* _tmp0_;
789 			QtableEntry* a;
790 			_tmp0_ = _qtable_entry_ref0 ((QtableEntry*) a_it->data);
791 			a = _tmp0_;
792 			{
793 				gtk_widget_unparent (a->widget);
794 				self->priv->num_items--;
795 				_qtable_entry_unref0 (a);
796 			}
797 		}
798 	}
799 	__g_list_free__qtable_entry_unref0_0 (self->priv->children);
800 	self->priv->children = NULL;
801 	gtk_widget_queue_resize ((GtkWidget*) self);
802 }
803 
804 
gmpc_widgets_qtable_get_spacing(GmpcWidgetsQtable * self)805 gint gmpc_widgets_qtable_get_spacing (GmpcWidgetsQtable* self) {
806 	gint result;
807 	g_return_val_if_fail (self != NULL, 0);
808 	result = self->priv->_spacing;
809 	return result;
810 }
811 
812 
gmpc_widgets_qtable_set_spacing(GmpcWidgetsQtable * self,gint value)813 void gmpc_widgets_qtable_set_spacing (GmpcWidgetsQtable* self, gint value) {
814 	g_return_if_fail (self != NULL);
815 	self->priv->_spacing = value;
816 	g_object_notify ((GObject *) self, "spacing");
817 }
818 
819 
gmpc_widgets_qtable_get_max_columns(GmpcWidgetsQtable * self)820 gint gmpc_widgets_qtable_get_max_columns (GmpcWidgetsQtable* self) {
821 	gint result;
822 	g_return_val_if_fail (self != NULL, 0);
823 	result = self->priv->max_columns_real;
824 	return result;
825 }
826 
827 
gmpc_widgets_qtable_set_max_columns(GmpcWidgetsQtable * self,gint value)828 void gmpc_widgets_qtable_set_max_columns (GmpcWidgetsQtable* self, gint value) {
829 	g_return_if_fail (self != NULL);
830 	self->priv->max_columns_real = value;
831 	gtk_widget_queue_resize ((GtkWidget*) self);
832 	g_object_notify ((GObject *) self, "max-columns");
833 }
834 
835 
gmpc_widgets_qtable_get_item_width(GmpcWidgetsQtable * self)836 gint gmpc_widgets_qtable_get_item_width (GmpcWidgetsQtable* self) {
837 	gint result;
838 	g_return_val_if_fail (self != NULL, 0);
839 	result = self->priv->item_width_real;
840 	return result;
841 }
842 
843 
gmpc_widgets_qtable_set_item_width(GmpcWidgetsQtable * self,gint value)844 void gmpc_widgets_qtable_set_item_width (GmpcWidgetsQtable* self, gint value) {
845 	g_return_if_fail (self != NULL);
846 	self->priv->item_width_real = value;
847 	gtk_widget_queue_resize ((GtkWidget*) self);
848 	g_object_notify ((GObject *) self, "item-width");
849 }
850 
851 
gmpc_widgets_qtable_get_item_height(GmpcWidgetsQtable * self)852 gint gmpc_widgets_qtable_get_item_height (GmpcWidgetsQtable* self) {
853 	gint result;
854 	g_return_val_if_fail (self != NULL, 0);
855 	result = self->priv->item_height_real;
856 	return result;
857 }
858 
859 
gmpc_widgets_qtable_set_item_height(GmpcWidgetsQtable * self,gint value)860 void gmpc_widgets_qtable_set_item_height (GmpcWidgetsQtable* self, gint value) {
861 	g_return_if_fail (self != NULL);
862 	self->priv->item_height_real = value;
863 	gtk_widget_queue_resize ((GtkWidget*) self);
864 	g_object_notify ((GObject *) self, "item-height");
865 }
866 
867 
gmpc_widgets_qtable_get_header_height(GmpcWidgetsQtable * self)868 gint gmpc_widgets_qtable_get_header_height (GmpcWidgetsQtable* self) {
869 	gint result;
870 	g_return_val_if_fail (self != NULL, 0);
871 	result = self->priv->header_height_real;
872 	return result;
873 }
874 
875 
gmpc_widgets_qtable_set_header_height(GmpcWidgetsQtable * self,gint value)876 void gmpc_widgets_qtable_set_header_height (GmpcWidgetsQtable* self, gint value) {
877 	g_return_if_fail (self != NULL);
878 	self->priv->header_height_real = value;
879 	gtk_widget_queue_resize ((GtkWidget*) self);
880 	g_object_notify ((GObject *) self, "header-height");
881 }
882 
883 
gmpc_widgets_qtable_constructor(GType type,guint n_construct_properties,GObjectConstructParam * construct_properties)884 static GObject * gmpc_widgets_qtable_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
885 	GObject * obj;
886 	GObjectClass * parent_class;
887 	GmpcWidgetsQtable * self;
888 	parent_class = G_OBJECT_CLASS (gmpc_widgets_qtable_parent_class);
889 	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
890 	self = GMPC_WIDGETS_QTABLE (obj);
891 	gtk_widget_set_has_window ((GtkWidget*) self, FALSE);
892 	gtk_widget_set_redraw_on_allocate ((GtkWidget*) self, FALSE);
893 	return obj;
894 }
895 
896 
gmpc_widgets_qtable_class_init(GmpcWidgetsQtableClass * klass)897 static void gmpc_widgets_qtable_class_init (GmpcWidgetsQtableClass * klass) {
898 	gmpc_widgets_qtable_parent_class = g_type_class_peek_parent (klass);
899 	g_type_class_add_private (klass, sizeof (GmpcWidgetsQtablePrivate));
900 	GTK_WIDGET_CLASS (klass)->size_request = gmpc_widgets_qtable_real_size_request;
901 	GTK_CONTAINER_CLASS (klass)->add = gmpc_widgets_qtable_real_add;
902 	GTK_CONTAINER_CLASS (klass)->child_type = gmpc_widgets_qtable_real_child_type;
903 	GTK_CONTAINER_CLASS (klass)->remove = gmpc_widgets_qtable_real_remove;
904 	GTK_WIDGET_CLASS (klass)->size_allocate = gmpc_widgets_qtable_real_size_allocate;
905 	GTK_CONTAINER_CLASS (klass)->forall = gmpc_widgets_qtable_real_forall_internal;
906 	G_OBJECT_CLASS (klass)->get_property = _vala_gmpc_widgets_qtable_get_property;
907 	G_OBJECT_CLASS (klass)->set_property = _vala_gmpc_widgets_qtable_set_property;
908 	G_OBJECT_CLASS (klass)->constructor = gmpc_widgets_qtable_constructor;
909 	G_OBJECT_CLASS (klass)->finalize = gmpc_widgets_qtable_finalize;
910 	g_object_class_install_property (G_OBJECT_CLASS (klass), GMPC_WIDGETS_QTABLE_SPACING, g_param_spec_int ("spacing", "spacing", "spacing", G_MININT, G_MAXINT, 8, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
911 	g_object_class_install_property (G_OBJECT_CLASS (klass), GMPC_WIDGETS_QTABLE_MAX_COLUMNS, g_param_spec_int ("max-columns", "max-columns", "max-columns", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
912 	g_object_class_install_property (G_OBJECT_CLASS (klass), GMPC_WIDGETS_QTABLE_ITEM_WIDTH, g_param_spec_int ("item-width", "item-width", "item-width", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
913 	g_object_class_install_property (G_OBJECT_CLASS (klass), GMPC_WIDGETS_QTABLE_ITEM_HEIGHT, g_param_spec_int ("item-height", "item-height", "item-height", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
914 	g_object_class_install_property (G_OBJECT_CLASS (klass), GMPC_WIDGETS_QTABLE_HEADER_HEIGHT, g_param_spec_int ("header-height", "header-height", "header-height", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
915 }
916 
917 
gmpc_widgets_qtable_gtk_buildable_interface_init(GtkBuildableIface * iface)918 static void gmpc_widgets_qtable_gtk_buildable_interface_init (GtkBuildableIface * iface) {
919 	gmpc_widgets_qtable_gtk_buildable_parent_iface = g_type_interface_peek_parent (iface);
920 	iface->add_child = (void (*)(GtkBuildable* ,GtkBuilder* ,GObject* ,const gchar*)) gmpc_widgets_qtable_real_add_child;
921 }
922 
923 
gmpc_widgets_qtable_instance_init(GmpcWidgetsQtable * self)924 static void gmpc_widgets_qtable_instance_init (GmpcWidgetsQtable * self) {
925 	self->priv = GMPC_WIDGETS_QTABLE_GET_PRIVATE (self);
926 	self->priv->item_width_real = 0;
927 	self->priv->item_height_real = 0;
928 	self->priv->header_height_real = 0;
929 	self->priv->max_columns_real = 0;
930 	self->priv->num_items = 0;
931 	self->priv->columns = 3;
932 	self->priv->_spacing = 8;
933 	self->priv->children = NULL;
934 }
935 
936 
gmpc_widgets_qtable_finalize(GObject * obj)937 static void gmpc_widgets_qtable_finalize (GObject* obj) {
938 	GmpcWidgetsQtable * self;
939 	self = GMPC_WIDGETS_QTABLE (obj);
940 	__g_list_free__qtable_entry_unref0_0 (self->priv->children);
941 	G_OBJECT_CLASS (gmpc_widgets_qtable_parent_class)->finalize (obj);
942 }
943 
944 
gmpc_widgets_qtable_get_type(void)945 GType gmpc_widgets_qtable_get_type (void) {
946 	static volatile gsize gmpc_widgets_qtable_type_id__volatile = 0;
947 	if (g_once_init_enter (&gmpc_widgets_qtable_type_id__volatile)) {
948 		static const GTypeInfo g_define_type_info = { sizeof (GmpcWidgetsQtableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gmpc_widgets_qtable_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GmpcWidgetsQtable), 0, (GInstanceInitFunc) gmpc_widgets_qtable_instance_init, NULL };
949 		static const GInterfaceInfo gtk_buildable_info = { (GInterfaceInitFunc) gmpc_widgets_qtable_gtk_buildable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
950 		GType gmpc_widgets_qtable_type_id;
951 		gmpc_widgets_qtable_type_id = g_type_register_static (GTK_TYPE_CONTAINER, "GmpcWidgetsQtable", &g_define_type_info, 0);
952 		g_type_add_interface_static (gmpc_widgets_qtable_type_id, GTK_TYPE_BUILDABLE, &gtk_buildable_info);
953 		g_once_init_leave (&gmpc_widgets_qtable_type_id__volatile, gmpc_widgets_qtable_type_id);
954 	}
955 	return gmpc_widgets_qtable_type_id__volatile;
956 }
957 
958 
_vala_gmpc_widgets_qtable_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)959 static void _vala_gmpc_widgets_qtable_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
960 	GmpcWidgetsQtable * self;
961 	self = GMPC_WIDGETS_QTABLE (object);
962 	switch (property_id) {
963 		case GMPC_WIDGETS_QTABLE_SPACING:
964 		g_value_set_int (value, gmpc_widgets_qtable_get_spacing (self));
965 		break;
966 		case GMPC_WIDGETS_QTABLE_MAX_COLUMNS:
967 		g_value_set_int (value, gmpc_widgets_qtable_get_max_columns (self));
968 		break;
969 		case GMPC_WIDGETS_QTABLE_ITEM_WIDTH:
970 		g_value_set_int (value, gmpc_widgets_qtable_get_item_width (self));
971 		break;
972 		case GMPC_WIDGETS_QTABLE_ITEM_HEIGHT:
973 		g_value_set_int (value, gmpc_widgets_qtable_get_item_height (self));
974 		break;
975 		case GMPC_WIDGETS_QTABLE_HEADER_HEIGHT:
976 		g_value_set_int (value, gmpc_widgets_qtable_get_header_height (self));
977 		break;
978 		default:
979 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
980 		break;
981 	}
982 }
983 
984 
_vala_gmpc_widgets_qtable_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)985 static void _vala_gmpc_widgets_qtable_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
986 	GmpcWidgetsQtable * self;
987 	self = GMPC_WIDGETS_QTABLE (object);
988 	switch (property_id) {
989 		case GMPC_WIDGETS_QTABLE_SPACING:
990 		gmpc_widgets_qtable_set_spacing (self, g_value_get_int (value));
991 		break;
992 		case GMPC_WIDGETS_QTABLE_MAX_COLUMNS:
993 		gmpc_widgets_qtable_set_max_columns (self, g_value_get_int (value));
994 		break;
995 		case GMPC_WIDGETS_QTABLE_ITEM_WIDTH:
996 		gmpc_widgets_qtable_set_item_width (self, g_value_get_int (value));
997 		break;
998 		case GMPC_WIDGETS_QTABLE_ITEM_HEIGHT:
999 		gmpc_widgets_qtable_set_item_height (self, g_value_get_int (value));
1000 		break;
1001 		case GMPC_WIDGETS_QTABLE_HEADER_HEIGHT:
1002 		gmpc_widgets_qtable_set_header_height (self, g_value_get_int (value));
1003 		break;
1004 		default:
1005 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1006 		break;
1007 	}
1008 }
1009 
1010 
1011 
1012