56
56
typedef struct _SpeedFunctionClass SpeedFunctionClass;
57
57
typedef struct _SpeedFunctionPrivate SpeedFunctionPrivate;
59
#define TYPE_FREQUENCY_FUNCTION (frequency_function_get_type ())
60
#define FREQUENCY_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREQUENCY_FUNCTION, FrequencyFunction))
61
#define FREQUENCY_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FREQUENCY_FUNCTION, FrequencyFunctionClass))
62
#define IS_FREQUENCY_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREQUENCY_FUNCTION))
63
#define IS_FREQUENCY_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FREQUENCY_FUNCTION))
64
#define FREQUENCY_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FREQUENCY_FUNCTION, FrequencyFunctionClass))
66
typedef struct _FrequencyFunction FrequencyFunction;
67
typedef struct _FrequencyFunctionClass FrequencyFunctionClass;
68
typedef struct _FrequencyFunctionPrivate FrequencyFunctionPrivate;
59
70
#define TYPE_PERCENT_FUNCTION (percent_function_get_type ())
60
71
#define PERCENT_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PERCENT_FUNCTION, PercentFunction))
61
72
#define PERCENT_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PERCENT_FUNCTION, PercentFunctionClass))
111
122
FunctionClass parent_class;
125
struct _FrequencyFunction {
126
Function parent_instance;
127
FrequencyFunctionPrivate * priv;
130
struct _FrequencyFunctionClass {
131
FunctionClass parent_class;
114
134
struct _PercentFunction {
115
135
Function parent_instance;
116
136
PercentFunctionPrivate * priv;
142
163
static void function_set_id (Function* self, const gchar* value);
143
164
gchar** function_get_parameterdescs (Function* self, int* result_length1);
144
165
static void function_set_parameterdescs (Function* self, gchar** value, int value_length1);
145
static gchar** _vala_array_dup6 (gchar** self, int length);
166
static gchar** _vala_array_dup8 (gchar** self, int length);
146
167
static void function_finalize (GObject* obj);
147
168
static void _vala_function_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
148
169
static void _vala_function_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
169
190
SpeedFunction* speed_function_construct (GType object_type);
170
191
static gchar* speed_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
171
192
gchar* utils_format_speed (gdouble val);
193
GType frequency_function_get_type (void) G_GNUC_CONST;
195
FREQUENCY_FUNCTION_DUMMY_PROPERTY
197
FrequencyFunction* frequency_function_new (void);
198
FrequencyFunction* frequency_function_construct (GType object_type);
199
static gchar* frequency_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
200
gchar* utils_format_frequency (gdouble val);
172
201
GType percent_function_get_type (void) G_GNUC_CONST;
174
203
PERCENT_FUNCTION_DUMMY_PROPERTY
277
306
static void function_set_parameterdescs (Function* self, gchar** value, int value_length1) {
307
gchar** _tmp0_ = NULL;
308
gint _tmp0__length1 = 0;
309
gchar** _tmp1_ = NULL;
310
gint _tmp1__length1 = 0;
282
311
g_return_if_fail (IS_FUNCTION (self));
284
313
_tmp0__length1 = value_length1;
285
_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup6 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
314
_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup8 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
286
315
_tmp1__length1 = _tmp0__length1;
287
316
self->priv->_parameterdescs = (_vala_array_free (self->priv->_parameterdescs, self->priv->_parameterdescs_length1, (GDestroyNotify) g_free), NULL);
288
317
self->priv->_parameterdescs = _tmp1_;
312
341
static void function_finalize (GObject* obj) {
314
self = FUNCTION (obj);
343
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_FUNCTION, Function);
315
344
_g_free0 (self->priv->_id);
316
345
self->priv->_parameterdescs = (_vala_array_free (self->priv->_parameterdescs, self->priv->_parameterdescs_length1, (GDestroyNotify) g_free), NULL);
317
346
G_OBJECT_CLASS (function_parent_class)->finalize (obj);
428
457
static gchar* decimals_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
429
458
DecimalsFunction * self;
430
459
gchar* result = NULL;
460
gchar** _tmp0_ = NULL;
461
gint _tmp0__length1 = 0;
462
gboolean _tmp2_ = FALSE;
463
gchar** _tmp6_ = NULL;
464
gint _tmp6__length1 = 0;
465
const gchar* _tmp7_ = NULL;
440
const gchar* _tmp10_;
467
gchar** _tmp9_ = NULL;
468
gint _tmp9__length1 = 0;
469
const gchar* _tmp10_ = NULL;
441
470
gdouble _tmp11_ = 0.0;
442
471
gchar* _tmp12_ = NULL;
443
472
GError * _inner_error_ = NULL;
444
self = DECIMALS_FUNCTION (base);
473
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_DECIMALS_FUNCTION, DecimalsFunction);
445
474
_tmp0_ = parameters;
446
475
_tmp0__length1 = parameters_length1;
447
476
if (_tmp0__length1 != 2) {
525
554
static gchar* size_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
526
555
SizeFunction * self;
527
556
gchar* result = NULL;
557
gchar** _tmp0_ = NULL;
558
gint _tmp0__length1 = 0;
559
gboolean _tmp2_ = FALSE;
560
gchar** _tmp6_ = NULL;
561
gint _tmp6__length1 = 0;
562
const gchar* _tmp7_ = NULL;
534
563
gdouble _tmp8_ = 0.0;
535
564
gchar* _tmp9_ = NULL;
536
565
GError * _inner_error_ = NULL;
537
self = SIZE_FUNCTION (base);
566
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SIZE_FUNCTION, SizeFunction);
538
567
_tmp0_ = parameters;
539
568
_tmp0__length1 = parameters_length1;
540
569
if (_tmp0__length1 != 1) {
614
643
static gchar* speed_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
615
644
SpeedFunction * self;
616
645
gchar* result = NULL;
646
gchar** _tmp0_ = NULL;
647
gint _tmp0__length1 = 0;
648
gboolean _tmp2_ = FALSE;
649
gchar** _tmp6_ = NULL;
650
gint _tmp6__length1 = 0;
651
const gchar* _tmp7_ = NULL;
623
652
gdouble _tmp8_ = 0.0;
624
653
gchar* _tmp9_ = NULL;
625
654
GError * _inner_error_ = NULL;
626
self = SPEED_FUNCTION (base);
655
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SPEED_FUNCTION, SpeedFunction);
627
656
_tmp0_ = parameters;
628
657
_tmp0__length1 = parameters_length1;
629
658
if (_tmp0__length1 != 1) {
710
FrequencyFunction* frequency_function_construct (GType object_type) {
711
FrequencyFunction * self = NULL;
712
gchar* _tmp0_ = NULL;
713
gchar** _tmp1_ = NULL;
714
gchar** _tmp2_ = NULL;
715
gint _tmp2__length1 = 0;
716
_tmp0_ = g_strdup ("value");
717
_tmp1_ = g_new0 (gchar*, 1 + 1);
721
self = (FrequencyFunction*) function_construct (object_type, "frequency", _tmp2_, 1);
722
_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
727
FrequencyFunction* frequency_function_new (void) {
728
return frequency_function_construct (TYPE_FREQUENCY_FUNCTION);
732
static gchar* frequency_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
733
FrequencyFunction * self;
734
gchar* result = NULL;
735
gchar** _tmp0_ = NULL;
736
gint _tmp0__length1 = 0;
737
gboolean _tmp2_ = FALSE;
738
gchar** _tmp6_ = NULL;
739
gint _tmp6__length1 = 0;
740
const gchar* _tmp7_ = NULL;
741
gdouble _tmp8_ = 0.0;
742
gchar* _tmp9_ = NULL;
743
GError * _inner_error_ = NULL;
744
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_FREQUENCY_FUNCTION, FrequencyFunction);
746
_tmp0__length1 = parameters_length1;
747
if (_tmp0__length1 != 1) {
748
GError* _tmp1_ = NULL;
749
_tmp1_ = function_error ("one parameter expected");
750
_inner_error_ = _tmp1_;
751
g_propagate_error (error, _inner_error_);
756
gchar** _tmp3_ = NULL;
757
gint _tmp3__length1 = 0;
758
gchar* _tmp4_ = NULL;
759
gchar* _tmp5_ = NULL;
761
_tmp3__length1 = parameters_length1;
762
_tmp4_ = g_strdup ("999000000");
763
_g_free0 (_tmp3_[0]);
768
_tmp6__length1 = parameters_length1;
770
_tmp8_ = double_parse (_tmp7_);
771
_tmp9_ = utils_format_frequency (_tmp8_);
777
static void frequency_function_class_init (FrequencyFunctionClass * klass) {
778
frequency_function_parent_class = g_type_class_peek_parent (klass);
779
FUNCTION_CLASS (klass)->call = frequency_function_real_call;
783
static void frequency_function_instance_init (FrequencyFunction * self) {
787
GType frequency_function_get_type (void) {
788
static volatile gsize frequency_function_type_id__volatile = 0;
789
if (g_once_init_enter (&frequency_function_type_id__volatile)) {
790
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 };
791
GType frequency_function_type_id;
792
frequency_function_type_id = g_type_register_static (TYPE_FUNCTION, "FrequencyFunction", &g_define_type_info, 0);
793
g_once_init_leave (&frequency_function_type_id__volatile, frequency_function_type_id);
795
return frequency_function_type_id__volatile;
681
799
PercentFunction* percent_function_construct (GType object_type) {
682
800
PercentFunction * self = NULL;
801
gchar* _tmp0_ = NULL;
684
802
gchar** _tmp1_ = NULL;
803
gchar** _tmp2_ = NULL;
804
gint _tmp2__length1 = 0;
687
805
_tmp0_ = g_strdup ("value");
688
806
_tmp1_ = g_new0 (gchar*, 1 + 1);
689
807
_tmp1_[0] = _tmp0_;
703
821
static gchar* percent_function_real_call (Function* base, gchar** parameters, int parameters_length1, gboolean widest, GError** error) {
704
822
PercentFunction * self;
705
823
gchar* result = NULL;
824
gchar** _tmp0_ = NULL;
825
gint _tmp0__length1 = 0;
826
gboolean _tmp2_ = FALSE;
709
827
const gchar* _tmp6_ = NULL;
828
gchar** _tmp7_ = NULL;
829
gint _tmp7__length1 = 0;
830
const gchar* _tmp8_ = NULL;
713
831
gdouble _tmp9_ = 0.0;
714
832
gdouble _tmp10_ = 0.0;
715
833
gchar* _tmp11_ = NULL;
716
834
GError * _inner_error_ = NULL;
717
self = PERCENT_FUNCTION (base);
835
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PERCENT_FUNCTION, PercentFunction);
718
836
_tmp0_ = parameters;
719
837
_tmp0__length1 = parameters_length1;
720
838
if (_tmp0__length1 != 1) {