~mh21/ubuntu/utopic/indicator-multiload/version-0.4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
/* function.c generated by valac 0.22.1, the Vala compiler
 * generated from function.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>


#define TYPE_FUNCTION (function_get_type ())
#define FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FUNCTION, Function))
#define FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FUNCTION, FunctionClass))
#define IS_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FUNCTION))
#define IS_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FUNCTION))
#define FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FUNCTION, FunctionClass))

typedef struct _Function Function;
typedef struct _FunctionClass FunctionClass;
typedef struct _FunctionPrivate FunctionPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_DECIMALS_FUNCTION (decimals_function_get_type ())
#define DECIMALS_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DECIMALS_FUNCTION, DecimalsFunction))
#define DECIMALS_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DECIMALS_FUNCTION, DecimalsFunctionClass))
#define IS_DECIMALS_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DECIMALS_FUNCTION))
#define IS_DECIMALS_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DECIMALS_FUNCTION))
#define DECIMALS_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DECIMALS_FUNCTION, DecimalsFunctionClass))

typedef struct _DecimalsFunction DecimalsFunction;
typedef struct _DecimalsFunctionClass DecimalsFunctionClass;
typedef struct _DecimalsFunctionPrivate DecimalsFunctionPrivate;

#define TYPE_SIZE_FUNCTION (size_function_get_type ())
#define SIZE_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SIZE_FUNCTION, SizeFunction))
#define SIZE_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SIZE_FUNCTION, SizeFunctionClass))
#define IS_SIZE_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SIZE_FUNCTION))
#define IS_SIZE_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SIZE_FUNCTION))
#define SIZE_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SIZE_FUNCTION, SizeFunctionClass))

typedef struct _SizeFunction SizeFunction;
typedef struct _SizeFunctionClass SizeFunctionClass;
typedef struct _SizeFunctionPrivate SizeFunctionPrivate;

#define TYPE_SPEED_FUNCTION (speed_function_get_type ())
#define SPEED_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SPEED_FUNCTION, SpeedFunction))
#define SPEED_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SPEED_FUNCTION, SpeedFunctionClass))
#define IS_SPEED_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SPEED_FUNCTION))
#define IS_SPEED_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SPEED_FUNCTION))
#define SPEED_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SPEED_FUNCTION, SpeedFunctionClass))

typedef struct _SpeedFunction SpeedFunction;
typedef struct _SpeedFunctionClass SpeedFunctionClass;
typedef struct _SpeedFunctionPrivate SpeedFunctionPrivate;

#define TYPE_FREQUENCY_FUNCTION (frequency_function_get_type ())
#define FREQUENCY_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREQUENCY_FUNCTION, FrequencyFunction))
#define FREQUENCY_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FREQUENCY_FUNCTION, FrequencyFunctionClass))
#define IS_FREQUENCY_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREQUENCY_FUNCTION))
#define IS_FREQUENCY_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FREQUENCY_FUNCTION))
#define FREQUENCY_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FREQUENCY_FUNCTION, FrequencyFunctionClass))

typedef struct _FrequencyFunction FrequencyFunction;
typedef struct _FrequencyFunctionClass FrequencyFunctionClass;
typedef struct _FrequencyFunctionPrivate FrequencyFunctionPrivate;

#define TYPE_PERCENT_FUNCTION (percent_function_get_type ())
#define PERCENT_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PERCENT_FUNCTION, PercentFunction))
#define PERCENT_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PERCENT_FUNCTION, PercentFunctionClass))
#define IS_PERCENT_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PERCENT_FUNCTION))
#define IS_PERCENT_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PERCENT_FUNCTION))
#define PERCENT_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PERCENT_FUNCTION, PercentFunctionClass))

typedef struct _PercentFunction PercentFunction;
typedef struct _PercentFunctionClass PercentFunctionClass;
typedef struct _PercentFunctionPrivate PercentFunctionPrivate;

struct _Function {
	GObject parent_instance;
	FunctionPrivate * priv;
};

struct _FunctionClass {
	GObjectClass parent_class;
	gchar* (*call) (Function* self, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
};

struct _FunctionPrivate {
	gchar* _id;
	gchar** _parameterdescs;
	gint _parameterdescs_length1;
	gint __parameterdescs_size_;
};

struct _DecimalsFunction {
	Function parent_instance;
	DecimalsFunctionPrivate * priv;
};

struct _DecimalsFunctionClass {
	FunctionClass parent_class;
};

struct _SizeFunction {
	Function parent_instance;
	SizeFunctionPrivate * priv;
};

struct _SizeFunctionClass {
	FunctionClass parent_class;
};

struct _SpeedFunction {
	Function parent_instance;
	SpeedFunctionPrivate * priv;
};

struct _SpeedFunctionClass {
	FunctionClass parent_class;
};

struct _FrequencyFunction {
	Function parent_instance;
	FrequencyFunctionPrivate * priv;
};

struct _FrequencyFunctionClass {
	FunctionClass parent_class;
};

struct _PercentFunction {
	Function parent_instance;
	PercentFunctionPrivate * priv;
};

struct _PercentFunctionClass {
	FunctionClass parent_class;
};


static gpointer function_parent_class = NULL;
static gpointer decimals_function_parent_class = NULL;
static gpointer size_function_parent_class = NULL;
static gpointer speed_function_parent_class = NULL;
static gpointer frequency_function_parent_class = NULL;
static gpointer percent_function_parent_class = NULL;

GType function_get_type (void) G_GNUC_CONST;
#define FUNCTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_FUNCTION, FunctionPrivate))
enum  {
	FUNCTION_DUMMY_PROPERTY,
	FUNCTION_ID,
	FUNCTION_PARAMETERDESCS
};
Function* function_construct (GType object_type, const gchar* id, gchar** parameterdescs, int parameterdescs_length1);
GError* function_error (const gchar* message);
gchar* function_call (Function* self, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
static gchar* function_real_call (Function* self, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
const gchar* function_get_id (Function* self);
static void function_set_id (Function* self, const gchar* value);
gchar** function_get_parameterdescs (Function* self, int* result_length1);
static void function_set_parameterdescs (Function* self, gchar** value, int value_length1);
static gchar** _vala_array_dup8 (gchar** self, int length);
static void function_finalize (GObject* obj);
static void _vala_function_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_function_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType decimals_function_get_type (void) G_GNUC_CONST;
enum  {
	DECIMALS_FUNCTION_DUMMY_PROPERTY
};
DecimalsFunction* decimals_function_new (void);
DecimalsFunction* decimals_function_construct (GType object_type);
static gchar* decimals_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
GType size_function_get_type (void) G_GNUC_CONST;
enum  {
	SIZE_FUNCTION_DUMMY_PROPERTY
};
SizeFunction* size_function_new (void);
SizeFunction* size_function_construct (GType object_type);
static gchar* size_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
gchar* utils_format_size (gdouble val);
GType speed_function_get_type (void) G_GNUC_CONST;
enum  {
	SPEED_FUNCTION_DUMMY_PROPERTY
};
SpeedFunction* speed_function_new (void);
SpeedFunction* speed_function_construct (GType object_type);
static gchar* speed_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
gchar* utils_format_speed (gdouble val);
GType frequency_function_get_type (void) G_GNUC_CONST;
enum  {
	FREQUENCY_FUNCTION_DUMMY_PROPERTY
};
FrequencyFunction* frequency_function_new (void);
FrequencyFunction* frequency_function_construct (GType object_type);
static gchar* frequency_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
gchar* utils_format_frequency (gdouble val);
GType percent_function_get_type (void) G_GNUC_CONST;
enum  {
	PERCENT_FUNCTION_DUMMY_PROPERTY
};
PercentFunction* percent_function_new (void);
PercentFunction* percent_function_construct (GType object_type);
static gchar* percent_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


Function* function_construct (GType object_type, const gchar* id, gchar** parameterdescs, int parameterdescs_length1) {
	Function * self = NULL;
	const gchar* _tmp0_ = NULL;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = id;
	_tmp1_ = parameterdescs;
	_tmp1__length1 = parameterdescs_length1;
	self = (Function*) g_object_new (object_type, "id", _tmp0_, "parameterdescs", _tmp1_, NULL);
	return self;
}


GError* function_error (const gchar* message) {
	GError* result = NULL;
	GQuark _tmp0_ = 0U;
	const gchar* _tmp1_ = NULL;
	GError* _tmp2_ = NULL;
	g_return_val_if_fail (message != NULL, NULL);
	_tmp0_ = g_quark_from_string ("function-error-quark");
	_tmp1_ = message;
	_tmp2_ = g_error_new (_tmp0_, 0, "%s", _tmp1_);
	result = _tmp2_;
	return result;
}


static gchar* function_real_call (Function* self, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
	g_critical ("Type `%s' does not implement abstract method `function_call'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}


gchar* function_call (Function* self, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
	g_return_val_if_fail (IS_FUNCTION (self), NULL);
	return FUNCTION_GET_CLASS (self)->call (self, parameters, parameters_length1, widest, error);
}


const gchar* function_get_id (Function* self) {
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	g_return_val_if_fail (IS_FUNCTION (self), NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}


static void function_set_id (Function* self, const gchar* value) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_if_fail (IS_FUNCTION (self));
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_id);
	self->priv->_id = _tmp1_;
	g_object_notify ((GObject *) self, "id");
}


gchar** function_get_parameterdescs (Function* self, int* result_length1) {
	gchar** result;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (IS_FUNCTION (self), NULL);
	_tmp0_ = self->priv->_parameterdescs;
	_tmp0__length1 = self->priv->_parameterdescs_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


static gchar** _vala_array_dup8 (gchar** self, int length) {
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_ = NULL;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static void function_set_parameterdescs (Function* self, gchar** value, int value_length1) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (IS_FUNCTION (self));
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup8 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_parameterdescs = (_vala_array_free (self->priv->_parameterdescs, self->priv->_parameterdescs_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_parameterdescs = _tmp1_;
	self->priv->_parameterdescs_length1 = _tmp1__length1;
	self->priv->__parameterdescs_size_ = self->priv->_parameterdescs_length1;
	g_object_notify ((GObject *) self, "parameterdescs");
}


static void function_class_init (FunctionClass * klass) {
	function_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (FunctionPrivate));
	FUNCTION_CLASS (klass)->call = function_real_call;
	G_OBJECT_CLASS (klass)->get_property = _vala_function_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_function_set_property;
	G_OBJECT_CLASS (klass)->finalize = function_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FUNCTION_ID, g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FUNCTION_PARAMETERDESCS, g_param_spec_boxed ("parameterdescs", "parameterdescs", "parameterdescs", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void function_instance_init (Function * self) {
	self->priv = FUNCTION_GET_PRIVATE (self);
}


static void function_finalize (GObject* obj) {
	Function * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_FUNCTION, Function);
	_g_free0 (self->priv->_id);
	self->priv->_parameterdescs = (_vala_array_free (self->priv->_parameterdescs, self->priv->_parameterdescs_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (function_parent_class)->finalize (obj);
}


/******************************************************************************
 * Copyright (C) 2011-2013  Michael Hofmann <mh21@mh21.de>                    *
 *                                                                            *
 * This program is free software; you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by       *
 * the Free Software Foundation; either version 3 of the License, or          *
 * (at your option) any later version.                                        *
 *                                                                            *
 * This program is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
 * GNU General Public License for more details.                               *
 *                                                                            *
 * You should have received a copy of the GNU General Public License along    *
 * with this program; if not, write to the Free Software Foundation, Inc.,    *
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                *
 ******************************************************************************/
GType function_get_type (void) {
	static volatile gsize function_type_id__volatile = 0;
	if (g_once_init_enter (&function_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FunctionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) function_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Function), 0, (GInstanceInitFunc) function_instance_init, NULL };
		GType function_type_id;
		function_type_id = g_type_register_static (G_TYPE_OBJECT, "Function", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&function_type_id__volatile, function_type_id);
	}
	return function_type_id__volatile;
}


static void _vala_function_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	Function * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_FUNCTION, Function);
	switch (property_id) {
		case FUNCTION_ID:
		g_value_set_string (value, function_get_id (self));
		break;
		case FUNCTION_PARAMETERDESCS:
		{
			int length;
			g_value_set_boxed (value, function_get_parameterdescs (self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_function_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	Function * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_FUNCTION, Function);
	switch (property_id) {
		case FUNCTION_ID:
		function_set_id (self, g_value_get_string (value));
		break;
		case FUNCTION_PARAMETERDESCS:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			function_set_parameterdescs (self, boxed, g_strv_length (boxed));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


DecimalsFunction* decimals_function_construct (GType object_type) {
	DecimalsFunction * self = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	_tmp0_ = g_strdup ("value");
	_tmp1_ = g_strdup ("decimals");
	_tmp2_ = g_new0 (gchar*, 2 + 1);
	_tmp2_[0] = _tmp0_;
	_tmp2_[1] = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp3__length1 = 2;
	self = (DecimalsFunction*) function_construct (object_type, "decimals", _tmp3_, 2);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
	return self;
}


DecimalsFunction* decimals_function_new (void) {
	return decimals_function_construct (TYPE_DECIMALS_FUNCTION);
}


static gdouble double_parse (const gchar* str) {
	gdouble result = 0.0;
	const gchar* _tmp0_ = NULL;
	gdouble _tmp1_ = 0.0;
	g_return_val_if_fail (str != NULL, 0.0);
	_tmp0_ = str;
	_tmp1_ = g_ascii_strtod (_tmp0_, NULL);
	result = _tmp1_;
	return result;
}


static gchar* decimals_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
	DecimalsFunction * self;
	gchar* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gboolean _tmp2_ = FALSE;
	gchar** _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
	const gchar* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	gchar** _tmp9_ = NULL;
	gint _tmp9__length1 = 0;
	const gchar* _tmp10_ = NULL;
	gdouble _tmp11_ = 0.0;
	gchar* _tmp12_ = NULL;
	GError * _inner_error_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_DECIMALS_FUNCTION, DecimalsFunction);
	_tmp0_ = parameters;
	_tmp0__length1 = parameters_length1;
	if (_tmp0__length1 != 2) {
		GError* _tmp1_ = NULL;
		_tmp1_ = function_error ("two parameters expected");
		_inner_error_ = _tmp1_;
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp2_ = widest;
	if (_tmp2_) {
		gchar** _tmp3_ = NULL;
		gint _tmp3__length1 = 0;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		_tmp3_ = parameters;
		_tmp3__length1 = parameters_length1;
		_tmp4_ = g_strdup ("8");
		_g_free0 (_tmp3_[0]);
		_tmp3_[0] = _tmp4_;
		_tmp5_ = _tmp3_[0];
	}
	_tmp6_ = parameters;
	_tmp6__length1 = parameters_length1;
	_tmp7_ = _tmp6_[1];
	_tmp8_ = atoi (_tmp7_);
	_tmp9_ = parameters;
	_tmp9__length1 = parameters_length1;
	_tmp10_ = _tmp9_[0];
	_tmp11_ = double_parse (_tmp10_);
	_tmp12_ = g_strdup_printf ("%.*f", _tmp8_, _tmp11_);
	result = _tmp12_;
	return result;
}


static void decimals_function_class_init (DecimalsFunctionClass * klass) {
	decimals_function_parent_class = g_type_class_peek_parent (klass);
	FUNCTION_CLASS (klass)->call = decimals_function_real_call;
}


static void decimals_function_instance_init (DecimalsFunction * self) {
}


GType decimals_function_get_type (void) {
	static volatile gsize decimals_function_type_id__volatile = 0;
	if (g_once_init_enter (&decimals_function_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DecimalsFunctionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) decimals_function_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DecimalsFunction), 0, (GInstanceInitFunc) decimals_function_instance_init, NULL };
		GType decimals_function_type_id;
		decimals_function_type_id = g_type_register_static (TYPE_FUNCTION, "DecimalsFunction", &g_define_type_info, 0);
		g_once_init_leave (&decimals_function_type_id__volatile, decimals_function_type_id);
	}
	return decimals_function_type_id__volatile;
}


SizeFunction* size_function_construct (GType object_type) {
	SizeFunction * self = NULL;
	gchar* _tmp0_ = NULL;
	gchar** _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	_tmp0_ = g_strdup ("value");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	self = (SizeFunction*) function_construct (object_type, "size", _tmp2_, 1);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	return self;
}


SizeFunction* size_function_new (void) {
	return size_function_construct (TYPE_SIZE_FUNCTION);
}


static gchar* size_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
	SizeFunction * self;
	gchar* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gboolean _tmp2_ = FALSE;
	gchar** _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
	const gchar* _tmp7_ = NULL;
	gdouble _tmp8_ = 0.0;
	gchar* _tmp9_ = NULL;
	GError * _inner_error_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SIZE_FUNCTION, SizeFunction);
	_tmp0_ = parameters;
	_tmp0__length1 = parameters_length1;
	if (_tmp0__length1 != 1) {
		GError* _tmp1_ = NULL;
		_tmp1_ = function_error ("one parameter expected");
		_inner_error_ = _tmp1_;
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp2_ = widest;
	if (_tmp2_) {
		gchar** _tmp3_ = NULL;
		gint _tmp3__length1 = 0;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		_tmp3_ = parameters;
		_tmp3__length1 = parameters_length1;
		_tmp4_ = g_strdup ("999000000");
		_g_free0 (_tmp3_[0]);
		_tmp3_[0] = _tmp4_;
		_tmp5_ = _tmp3_[0];
	}
	_tmp6_ = parameters;
	_tmp6__length1 = parameters_length1;
	_tmp7_ = _tmp6_[0];
	_tmp8_ = double_parse (_tmp7_);
	_tmp9_ = utils_format_size (_tmp8_);
	result = _tmp9_;
	return result;
}


static void size_function_class_init (SizeFunctionClass * klass) {
	size_function_parent_class = g_type_class_peek_parent (klass);
	FUNCTION_CLASS (klass)->call = size_function_real_call;
}


static void size_function_instance_init (SizeFunction * self) {
}


GType size_function_get_type (void) {
	static volatile gsize size_function_type_id__volatile = 0;
	if (g_once_init_enter (&size_function_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SizeFunctionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) size_function_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SizeFunction), 0, (GInstanceInitFunc) size_function_instance_init, NULL };
		GType size_function_type_id;
		size_function_type_id = g_type_register_static (TYPE_FUNCTION, "SizeFunction", &g_define_type_info, 0);
		g_once_init_leave (&size_function_type_id__volatile, size_function_type_id);
	}
	return size_function_type_id__volatile;
}


SpeedFunction* speed_function_construct (GType object_type) {
	SpeedFunction * self = NULL;
	gchar* _tmp0_ = NULL;
	gchar** _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	_tmp0_ = g_strdup ("value");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	self = (SpeedFunction*) function_construct (object_type, "speed", _tmp2_, 1);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	return self;
}


SpeedFunction* speed_function_new (void) {
	return speed_function_construct (TYPE_SPEED_FUNCTION);
}


static gchar* speed_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
	SpeedFunction * self;
	gchar* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gboolean _tmp2_ = FALSE;
	gchar** _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
	const gchar* _tmp7_ = NULL;
	gdouble _tmp8_ = 0.0;
	gchar* _tmp9_ = NULL;
	GError * _inner_error_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SPEED_FUNCTION, SpeedFunction);
	_tmp0_ = parameters;
	_tmp0__length1 = parameters_length1;
	if (_tmp0__length1 != 1) {
		GError* _tmp1_ = NULL;
		_tmp1_ = function_error ("one parameter expected");
		_inner_error_ = _tmp1_;
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp2_ = widest;
	if (_tmp2_) {
		gchar** _tmp3_ = NULL;
		gint _tmp3__length1 = 0;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		_tmp3_ = parameters;
		_tmp3__length1 = parameters_length1;
		_tmp4_ = g_strdup ("999000000");
		_g_free0 (_tmp3_[0]);
		_tmp3_[0] = _tmp4_;
		_tmp5_ = _tmp3_[0];
	}
	_tmp6_ = parameters;
	_tmp6__length1 = parameters_length1;
	_tmp7_ = _tmp6_[0];
	_tmp8_ = double_parse (_tmp7_);
	_tmp9_ = utils_format_speed (_tmp8_);
	result = _tmp9_;
	return result;
}


static void speed_function_class_init (SpeedFunctionClass * klass) {
	speed_function_parent_class = g_type_class_peek_parent (klass);
	FUNCTION_CLASS (klass)->call = speed_function_real_call;
}


static void speed_function_instance_init (SpeedFunction * self) {
}


GType speed_function_get_type (void) {
	static volatile gsize speed_function_type_id__volatile = 0;
	if (g_once_init_enter (&speed_function_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SpeedFunctionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) speed_function_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SpeedFunction), 0, (GInstanceInitFunc) speed_function_instance_init, NULL };
		GType speed_function_type_id;
		speed_function_type_id = g_type_register_static (TYPE_FUNCTION, "SpeedFunction", &g_define_type_info, 0);
		g_once_init_leave (&speed_function_type_id__volatile, speed_function_type_id);
	}
	return speed_function_type_id__volatile;
}


FrequencyFunction* frequency_function_construct (GType object_type) {
	FrequencyFunction * self = NULL;
	gchar* _tmp0_ = NULL;
	gchar** _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	_tmp0_ = g_strdup ("value");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	self = (FrequencyFunction*) function_construct (object_type, "frequency", _tmp2_, 1);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	return self;
}


FrequencyFunction* frequency_function_new (void) {
	return frequency_function_construct (TYPE_FREQUENCY_FUNCTION);
}


static gchar* frequency_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
	FrequencyFunction * self;
	gchar* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gboolean _tmp2_ = FALSE;
	gchar** _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
	const gchar* _tmp7_ = NULL;
	gdouble _tmp8_ = 0.0;
	gchar* _tmp9_ = NULL;
	GError * _inner_error_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_FREQUENCY_FUNCTION, FrequencyFunction);
	_tmp0_ = parameters;
	_tmp0__length1 = parameters_length1;
	if (_tmp0__length1 != 1) {
		GError* _tmp1_ = NULL;
		_tmp1_ = function_error ("one parameter expected");
		_inner_error_ = _tmp1_;
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp2_ = widest;
	if (_tmp2_) {
		gchar** _tmp3_ = NULL;
		gint _tmp3__length1 = 0;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		_tmp3_ = parameters;
		_tmp3__length1 = parameters_length1;
		_tmp4_ = g_strdup ("999000000");
		_g_free0 (_tmp3_[0]);
		_tmp3_[0] = _tmp4_;
		_tmp5_ = _tmp3_[0];
	}
	_tmp6_ = parameters;
	_tmp6__length1 = parameters_length1;
	_tmp7_ = _tmp6_[0];
	_tmp8_ = double_parse (_tmp7_);
	_tmp9_ = utils_format_frequency (_tmp8_);
	result = _tmp9_;
	return result;
}


static void frequency_function_class_init (FrequencyFunctionClass * klass) {
	frequency_function_parent_class = g_type_class_peek_parent (klass);
	FUNCTION_CLASS (klass)->call = frequency_function_real_call;
}


static void frequency_function_instance_init (FrequencyFunction * self) {
}


GType frequency_function_get_type (void) {
	static volatile gsize frequency_function_type_id__volatile = 0;
	if (g_once_init_enter (&frequency_function_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FrequencyFunctionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) frequency_function_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FrequencyFunction), 0, (GInstanceInitFunc) frequency_function_instance_init, NULL };
		GType frequency_function_type_id;
		frequency_function_type_id = g_type_register_static (TYPE_FUNCTION, "FrequencyFunction", &g_define_type_info, 0);
		g_once_init_leave (&frequency_function_type_id__volatile, frequency_function_type_id);
	}
	return frequency_function_type_id__volatile;
}


PercentFunction* percent_function_construct (GType object_type) {
	PercentFunction * self = NULL;
	gchar* _tmp0_ = NULL;
	gchar** _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	_tmp0_ = g_strdup ("value");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	self = (PercentFunction*) function_construct (object_type, "percent", _tmp2_, 1);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	return self;
}


PercentFunction* percent_function_new (void) {
	return percent_function_construct (TYPE_PERCENT_FUNCTION);
}


static gchar* percent_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
	PercentFunction * self;
	gchar* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp6_ = NULL;
	gchar** _tmp7_ = NULL;
	gint _tmp7__length1 = 0;
	const gchar* _tmp8_ = NULL;
	gdouble _tmp9_ = 0.0;
	gdouble _tmp10_ = 0.0;
	gchar* _tmp11_ = NULL;
	GError * _inner_error_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PERCENT_FUNCTION, PercentFunction);
	_tmp0_ = parameters;
	_tmp0__length1 = parameters_length1;
	if (_tmp0__length1 != 1) {
		GError* _tmp1_ = NULL;
		_tmp1_ = function_error ("one parameter expected");
		_inner_error_ = _tmp1_;
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp2_ = widest;
	if (_tmp2_) {
		gchar** _tmp3_ = NULL;
		gint _tmp3__length1 = 0;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		_tmp3_ = parameters;
		_tmp3__length1 = parameters_length1;
		_tmp4_ = g_strdup ("1");
		_g_free0 (_tmp3_[0]);
		_tmp3_[0] = _tmp4_;
		_tmp5_ = _tmp3_[0];
	}
	_tmp6_ = _ ("%u%%");
	_tmp7_ = parameters;
	_tmp7__length1 = parameters_length1;
	_tmp8_ = _tmp7_[0];
	_tmp9_ = double_parse (_tmp8_);
	_tmp10_ = round (100 * _tmp9_);
	_tmp11_ = g_strdup_printf (_tmp6_, (guint) _tmp10_);
	result = _tmp11_;
	return result;
}


static void percent_function_class_init (PercentFunctionClass * klass) {
	percent_function_parent_class = g_type_class_peek_parent (klass);
	FUNCTION_CLASS (klass)->call = percent_function_real_call;
}


static void percent_function_instance_init (PercentFunction * self) {
}


GType percent_function_get_type (void) {
	static volatile gsize percent_function_type_id__volatile = 0;
	if (g_once_init_enter (&percent_function_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PercentFunctionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) percent_function_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PercentFunction), 0, (GInstanceInitFunc) percent_function_instance_init, NULL };
		GType percent_function_type_id;
		percent_function_type_id = g_type_register_static (TYPE_FUNCTION, "PercentFunction", &g_define_type_info, 0);
		g_once_init_leave (&percent_function_type_id__volatile, percent_function_type_id);
	}
	return percent_function_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}