Coverage Report

Created: 2026-12-01 06:30

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/work/build/rauc-installer-generated.c
Line
Count
Source
1
/*
2
 * This file is generated by gdbus-codegen, do not modify it.
3
 *
4
 * The license of this code is the same as for the D-Bus interface description
5
 * it was derived from. Note that it links to GLib, so must comply with the
6
 * LGPL linking clauses.
7
 */
8
9
#ifdef HAVE_CONFIG_H
10
#  include "config.h"
11
#endif
12
13
#include "rauc-installer-generated.h"
14
15
#include <string.h>
16
#ifdef G_OS_UNIX
17
#  include <gio/gunixfdlist.h>
18
#endif
19
20
#ifdef G_ENABLE_DEBUG
21
#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
22
#define g_marshal_value_peek_char(v)     g_value_get_schar (v)
23
#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
24
#define g_marshal_value_peek_int(v)      g_value_get_int (v)
25
#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
26
#define g_marshal_value_peek_long(v)     g_value_get_long (v)
27
#define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
28
#define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
29
#define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
30
#define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
31
#define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
32
#define g_marshal_value_peek_float(v)    g_value_get_float (v)
33
#define g_marshal_value_peek_double(v)   g_value_get_double (v)
34
#define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
35
#define g_marshal_value_peek_param(v)    g_value_get_param (v)
36
#define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
37
#define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
38
#define g_marshal_value_peek_object(v)   g_value_get_object (v)
39
#define g_marshal_value_peek_variant(v)  g_value_get_variant (v)
40
#else /* !G_ENABLE_DEBUG */
41
/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
42
 *          Do not access GValues directly in your code. Instead, use the
43
 *          g_value_get_*() functions
44
 */
45
#define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
46
#define g_marshal_value_peek_char(v)     (v)->data[0].v_int
47
#define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
48
#define g_marshal_value_peek_int(v)      (v)->data[0].v_int
49
#define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
50
#define g_marshal_value_peek_long(v)     (v)->data[0].v_long
51
#define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
52
0
#define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
53
#define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
54
#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
55
#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
56
#define g_marshal_value_peek_float(v)    (v)->data[0].v_float
57
#define g_marshal_value_peek_double(v)   (v)->data[0].v_double
58
0
#define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
59
#define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
60
#define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
61
#define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
62
0
#define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
63
0
#define g_marshal_value_peek_variant(v)  (v)->data[0].v_pointer
64
#endif /* !G_ENABLE_DEBUG */
65
66
typedef struct
67
{
68
  GDBusArgInfo parent_struct;
69
  gboolean use_gvariant;
70
} _ExtendedGDBusArgInfo;
71
72
typedef struct
73
{
74
  GDBusMethodInfo parent_struct;
75
  const gchar *signal_name;
76
  gboolean pass_fdlist;
77
} _ExtendedGDBusMethodInfo;
78
79
typedef struct
80
{
81
  GDBusSignalInfo parent_struct;
82
  const gchar *signal_name;
83
} _ExtendedGDBusSignalInfo;
84
85
typedef struct
86
{
87
  GDBusPropertyInfo parent_struct;
88
  const gchar *hyphen_name;
89
  guint use_gvariant : 1;
90
  guint emits_changed_signal : 1;
91
} _ExtendedGDBusPropertyInfo;
92
93
typedef struct
94
{
95
  GDBusInterfaceInfo parent_struct;
96
  const gchar *hyphen_name;
97
} _ExtendedGDBusInterfaceInfo;
98
99
typedef struct
100
{
101
  const _ExtendedGDBusPropertyInfo *info;
102
  guint prop_id;
103
  GValue orig_value; /* the value before the change */
104
} ChangedProperty;
105
106
static void
107
_changed_property_free (ChangedProperty *data)
108
0
{
109
0
  g_value_unset (&data->orig_value);
110
0
  g_free (data);
111
0
}
112
113
static gboolean
114
_g_strv_equal0 (gchar **a, gchar **b)
115
0
{
116
0
  gboolean ret = FALSE;
117
0
  guint n;
118
0
  if (a == NULL && b == NULL)
119
0
    {
120
0
      ret = TRUE;
121
0
      goto out;
122
0
    }
123
0
  if (a == NULL || b == NULL)
124
0
    goto out;
125
0
  if (g_strv_length (a) != g_strv_length (b))
126
0
    goto out;
127
0
  for (n = 0; a[n] != NULL; n++)
128
0
    if (g_strcmp0 (a[n], b[n]) != 0)
129
0
      goto out;
130
0
  ret = TRUE;
131
0
out:
132
0
  return ret;
133
0
}
134
135
static gboolean
136
_g_variant_equal0 (GVariant *a, GVariant *b)
137
0
{
138
0
  gboolean ret = FALSE;
139
0
  if (a == NULL && b == NULL)
140
0
    {
141
0
      ret = TRUE;
142
0
      goto out;
143
0
    }
144
0
  if (a == NULL || b == NULL)
145
0
    goto out;
146
0
  ret = g_variant_equal (a, b);
147
0
out:
148
0
  return ret;
149
0
}
150
151
G_GNUC_UNUSED static gboolean
152
_g_value_equal (const GValue *a, const GValue *b)
153
0
{
154
0
  gboolean ret = FALSE;
155
0
  g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
156
0
  switch (G_VALUE_TYPE (a))
157
0
    {
158
0
      case G_TYPE_BOOLEAN:
159
0
        ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
160
0
        break;
161
0
      case G_TYPE_UCHAR:
162
0
        ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
163
0
        break;
164
0
      case G_TYPE_INT:
165
0
        ret = (g_value_get_int (a) == g_value_get_int (b));
166
0
        break;
167
0
      case G_TYPE_UINT:
168
0
        ret = (g_value_get_uint (a) == g_value_get_uint (b));
169
0
        break;
170
0
      case G_TYPE_INT64:
171
0
        ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
172
0
        break;
173
0
      case G_TYPE_UINT64:
174
0
        ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
175
0
        break;
176
0
      case G_TYPE_DOUBLE:
177
0
        {
178
          /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
179
0
          gdouble da = g_value_get_double (a);
180
0
          gdouble db = g_value_get_double (b);
181
0
          ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
182
0
        }
183
0
        break;
184
0
      case G_TYPE_STRING:
185
0
        ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
186
0
        break;
187
0
      case G_TYPE_VARIANT:
188
0
        ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
189
0
        break;
190
0
      default:
191
0
        if (G_VALUE_TYPE (a) == G_TYPE_STRV)
192
0
          ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
193
0
        else
194
0
          g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
195
0
        break;
196
0
    }
197
0
  return ret;
198
0
}
199
200
static void
201
_g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING (
202
    GClosure     *closure,
203
    GValue       *return_value,
204
    unsigned int  n_param_values,
205
    const GValue *param_values,
206
    void         *invocation_hint G_GNUC_UNUSED,
207
    void         *marshal_data)
208
0
{
209
0
  typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectStringFunc)
210
0
       (void *data1,
211
0
        GDBusMethodInvocation *arg_method_invocation,
212
0
        const gchar *arg_source,
213
0
        void *data2);
214
0
  _GDbusCodegenMarshalBoolean_ObjectStringFunc callback;
215
0
  GCClosure *cc = (GCClosure*) closure;
216
0
  void *data1, *data2;
217
0
  gboolean v_return;
218
219
0
  g_return_if_fail (return_value != NULL);
220
0
  g_return_if_fail (n_param_values == 3);
221
222
0
  if (G_CCLOSURE_SWAP_DATA (closure))
223
0
    {
224
0
      data1 = closure->data;
225
0
      data2 = g_value_peek_pointer (param_values + 0);
226
0
    }
227
0
  else
228
0
    {
229
0
      data1 = g_value_peek_pointer (param_values + 0);
230
0
      data2 = closure->data;
231
0
    }
232
233
0
  callback = (_GDbusCodegenMarshalBoolean_ObjectStringFunc)
234
0
    (marshal_data ? marshal_data : cc->callback);
235
236
0
  v_return =
237
0
    callback (data1,
238
0
              g_marshal_value_peek_object (param_values + 1),
239
0
              g_marshal_value_peek_string (param_values + 2),
240
0
              data2);
241
242
0
  g_value_set_boolean (return_value, v_return);
243
0
}
244
245
static void
246
_g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_VARIANT (
247
    GClosure     *closure,
248
    GValue       *return_value,
249
    unsigned int  n_param_values,
250
    const GValue *param_values,
251
    void         *invocation_hint G_GNUC_UNUSED,
252
    void         *marshal_data)
253
0
{
254
0
  typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectStringVariantFunc)
255
0
       (void *data1,
256
0
        GDBusMethodInvocation *arg_method_invocation,
257
0
        const gchar *arg_source,
258
0
        GVariant *arg_args,
259
0
        void *data2);
260
0
  _GDbusCodegenMarshalBoolean_ObjectStringVariantFunc callback;
261
0
  GCClosure *cc = (GCClosure*) closure;
262
0
  void *data1, *data2;
263
0
  gboolean v_return;
264
265
0
  g_return_if_fail (return_value != NULL);
266
0
  g_return_if_fail (n_param_values == 4);
267
268
0
  if (G_CCLOSURE_SWAP_DATA (closure))
269
0
    {
270
0
      data1 = closure->data;
271
0
      data2 = g_value_peek_pointer (param_values + 0);
272
0
    }
273
0
  else
274
0
    {
275
0
      data1 = g_value_peek_pointer (param_values + 0);
276
0
      data2 = closure->data;
277
0
    }
278
279
0
  callback = (_GDbusCodegenMarshalBoolean_ObjectStringVariantFunc)
280
0
    (marshal_data ? marshal_data : cc->callback);
281
282
0
  v_return =
283
0
    callback (data1,
284
0
              g_marshal_value_peek_object (param_values + 1),
285
0
              g_marshal_value_peek_string (param_values + 2),
286
0
              g_marshal_value_peek_variant (param_values + 3),
287
0
              data2);
288
289
0
  g_value_set_boolean (return_value, v_return);
290
0
}
291
292
static void
293
_g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_STRING (
294
    GClosure     *closure,
295
    GValue       *return_value,
296
    unsigned int  n_param_values,
297
    const GValue *param_values,
298
    void         *invocation_hint G_GNUC_UNUSED,
299
    void         *marshal_data)
300
0
{
301
0
  typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectStringStringFunc)
302
0
       (void *data1,
303
0
        GDBusMethodInvocation *arg_method_invocation,
304
0
        const gchar *arg_state,
305
0
        const gchar *arg_slot_identifier,
306
0
        void *data2);
307
0
  _GDbusCodegenMarshalBoolean_ObjectStringStringFunc callback;
308
0
  GCClosure *cc = (GCClosure*) closure;
309
0
  void *data1, *data2;
310
0
  gboolean v_return;
311
312
0
  g_return_if_fail (return_value != NULL);
313
0
  g_return_if_fail (n_param_values == 4);
314
315
0
  if (G_CCLOSURE_SWAP_DATA (closure))
316
0
    {
317
0
      data1 = closure->data;
318
0
      data2 = g_value_peek_pointer (param_values + 0);
319
0
    }
320
0
  else
321
0
    {
322
0
      data1 = g_value_peek_pointer (param_values + 0);
323
0
      data2 = closure->data;
324
0
    }
325
326
0
  callback = (_GDbusCodegenMarshalBoolean_ObjectStringStringFunc)
327
0
    (marshal_data ? marshal_data : cc->callback);
328
329
0
  v_return =
330
0
    callback (data1,
331
0
              g_marshal_value_peek_object (param_values + 1),
332
0
              g_marshal_value_peek_string (param_values + 2),
333
0
              g_marshal_value_peek_string (param_values + 3),
334
0
              data2);
335
336
0
  g_value_set_boolean (return_value, v_return);
337
0
}
338
339
static void
340
_g_dbus_codegen_marshal_BOOLEAN__OBJECT (
341
    GClosure     *closure,
342
    GValue       *return_value,
343
    unsigned int  n_param_values,
344
    const GValue *param_values,
345
    void         *invocation_hint G_GNUC_UNUSED,
346
    void         *marshal_data)
347
0
{
348
0
  typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectFunc)
349
0
       (void *data1,
350
0
        GDBusMethodInvocation *arg_method_invocation,
351
0
        void *data2);
352
0
  _GDbusCodegenMarshalBoolean_ObjectFunc callback;
353
0
  GCClosure *cc = (GCClosure*) closure;
354
0
  void *data1, *data2;
355
0
  gboolean v_return;
356
357
0
  g_return_if_fail (return_value != NULL);
358
0
  g_return_if_fail (n_param_values == 2);
359
360
0
  if (G_CCLOSURE_SWAP_DATA (closure))
361
0
    {
362
0
      data1 = closure->data;
363
0
      data2 = g_value_peek_pointer (param_values + 0);
364
0
    }
365
0
  else
366
0
    {
367
0
      data1 = g_value_peek_pointer (param_values + 0);
368
0
      data2 = closure->data;
369
0
    }
370
371
0
  callback = (_GDbusCodegenMarshalBoolean_ObjectFunc)
372
0
    (marshal_data ? marshal_data : cc->callback);
373
374
0
  v_return =
375
0
    callback (data1,
376
0
              g_marshal_value_peek_object (param_values + 1),
377
0
              data2);
378
379
0
  g_value_set_boolean (return_value, v_return);
380
0
}
381
382
/* ------------------------------------------------------------------------
383
 * Code for interface de.pengutronix.rauc.Installer
384
 * ------------------------------------------------------------------------
385
 */
386
387
/**
388
 * SECTION:RInstaller
389
 * @title: RInstaller
390
 * @short_description: Generated C code for the de.pengutronix.rauc.Installer D-Bus interface
391
 *
392
 * This section contains code for working with the <link linkend="gdbus-interface-de-pengutronix-rauc-Installer.top_of_page">de.pengutronix.rauc.Installer</link> D-Bus interface in C.
393
 */
394
395
enum
396
{
397
  R__INSTALLER_COMPLETED,
398
};
399
400
static unsigned R__INSTALLER_SIGNALS[1] = { 0 };
401
402
/* ---- Introspection data for de.pengutronix.rauc.Installer ---- */
403
404
static const _ExtendedGDBusArgInfo _r_installer_method_info_install_IN_ARG_source =
405
{
406
  {
407
    -1,
408
    (gchar *) "source",
409
    (gchar *) "s",
410
    NULL
411
  },
412
  FALSE
413
};
414
415
static const GDBusArgInfo * const _r_installer_method_info_install_IN_ARG_pointers[] =
416
{
417
  &_r_installer_method_info_install_IN_ARG_source.parent_struct,
418
  NULL
419
};
420
421
static const _ExtendedGDBusMethodInfo _r_installer_method_info_install =
422
{
423
  {
424
    -1,
425
    (gchar *) "Install",
426
    (GDBusArgInfo **) &_r_installer_method_info_install_IN_ARG_pointers,
427
    NULL,
428
    NULL
429
  },
430
  "handle-install",
431
  FALSE
432
};
433
434
static const _ExtendedGDBusArgInfo _r_installer_method_info_install_bundle_IN_ARG_source =
435
{
436
  {
437
    -1,
438
    (gchar *) "source",
439
    (gchar *) "s",
440
    NULL
441
  },
442
  FALSE
443
};
444
445
static const _ExtendedGDBusArgInfo _r_installer_method_info_install_bundle_IN_ARG_args =
446
{
447
  {
448
    -1,
449
    (gchar *) "args",
450
    (gchar *) "a{sv}",
451
    NULL
452
  },
453
  FALSE
454
};
455
456
static const GDBusArgInfo * const _r_installer_method_info_install_bundle_IN_ARG_pointers[] =
457
{
458
  &_r_installer_method_info_install_bundle_IN_ARG_source.parent_struct,
459
  &_r_installer_method_info_install_bundle_IN_ARG_args.parent_struct,
460
  NULL
461
};
462
463
static const GDBusAnnotationInfo _r_installer_method_install_bundle_annotation_info_0 =
464
{
465
  -1,
466
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In1",
467
  (gchar *) "QVariantMap",
468
  NULL
469
};
470
471
static const GDBusAnnotationInfo * const _r_installer_method_install_bundle_annotation_info_pointers[] =
472
{
473
  &_r_installer_method_install_bundle_annotation_info_0,
474
  NULL
475
};
476
477
static const _ExtendedGDBusMethodInfo _r_installer_method_info_install_bundle =
478
{
479
  {
480
    -1,
481
    (gchar *) "InstallBundle",
482
    (GDBusArgInfo **) &_r_installer_method_info_install_bundle_IN_ARG_pointers,
483
    NULL,
484
    (GDBusAnnotationInfo **) &_r_installer_method_install_bundle_annotation_info_pointers
485
  },
486
  "handle-install-bundle",
487
  FALSE
488
};
489
490
static const _ExtendedGDBusArgInfo _r_installer_method_info_info_IN_ARG_bundle =
491
{
492
  {
493
    -1,
494
    (gchar *) "bundle",
495
    (gchar *) "s",
496
    NULL
497
  },
498
  FALSE
499
};
500
501
static const GDBusArgInfo * const _r_installer_method_info_info_IN_ARG_pointers[] =
502
{
503
  &_r_installer_method_info_info_IN_ARG_bundle.parent_struct,
504
  NULL
505
};
506
507
static const _ExtendedGDBusArgInfo _r_installer_method_info_info_OUT_ARG_compatible =
508
{
509
  {
510
    -1,
511
    (gchar *) "compatible",
512
    (gchar *) "s",
513
    NULL
514
  },
515
  FALSE
516
};
517
518
static const _ExtendedGDBusArgInfo _r_installer_method_info_info_OUT_ARG_version =
519
{
520
  {
521
    -1,
522
    (gchar *) "version",
523
    (gchar *) "s",
524
    NULL
525
  },
526
  FALSE
527
};
528
529
static const GDBusArgInfo * const _r_installer_method_info_info_OUT_ARG_pointers[] =
530
{
531
  &_r_installer_method_info_info_OUT_ARG_compatible.parent_struct,
532
  &_r_installer_method_info_info_OUT_ARG_version.parent_struct,
533
  NULL
534
};
535
536
static const _ExtendedGDBusMethodInfo _r_installer_method_info_info =
537
{
538
  {
539
    -1,
540
    (gchar *) "Info",
541
    (GDBusArgInfo **) &_r_installer_method_info_info_IN_ARG_pointers,
542
    (GDBusArgInfo **) &_r_installer_method_info_info_OUT_ARG_pointers,
543
    NULL
544
  },
545
  "handle-info",
546
  FALSE
547
};
548
549
static const _ExtendedGDBusArgInfo _r_installer_method_info_inspect_bundle_IN_ARG_source =
550
{
551
  {
552
    -1,
553
    (gchar *) "source",
554
    (gchar *) "s",
555
    NULL
556
  },
557
  FALSE
558
};
559
560
static const _ExtendedGDBusArgInfo _r_installer_method_info_inspect_bundle_IN_ARG_args =
561
{
562
  {
563
    -1,
564
    (gchar *) "args",
565
    (gchar *) "a{sv}",
566
    NULL
567
  },
568
  FALSE
569
};
570
571
static const GDBusArgInfo * const _r_installer_method_info_inspect_bundle_IN_ARG_pointers[] =
572
{
573
  &_r_installer_method_info_inspect_bundle_IN_ARG_source.parent_struct,
574
  &_r_installer_method_info_inspect_bundle_IN_ARG_args.parent_struct,
575
  NULL
576
};
577
578
static const _ExtendedGDBusArgInfo _r_installer_method_info_inspect_bundle_OUT_ARG_info =
579
{
580
  {
581
    -1,
582
    (gchar *) "info",
583
    (gchar *) "a{sv}",
584
    NULL
585
  },
586
  FALSE
587
};
588
589
static const GDBusArgInfo * const _r_installer_method_info_inspect_bundle_OUT_ARG_pointers[] =
590
{
591
  &_r_installer_method_info_inspect_bundle_OUT_ARG_info.parent_struct,
592
  NULL
593
};
594
595
static const GDBusAnnotationInfo _r_installer_method_inspect_bundle_annotation_info_0 =
596
{
597
  -1,
598
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In1",
599
  (gchar *) "QVariantMap",
600
  NULL
601
};
602
603
static const GDBusAnnotationInfo _r_installer_method_inspect_bundle_annotation_info_1 =
604
{
605
  -1,
606
  (gchar *) "org.qtproject.QtDBus.QtTypeName.Out0",
607
  (gchar *) "QVariantMap",
608
  NULL
609
};
610
611
static const GDBusAnnotationInfo * const _r_installer_method_inspect_bundle_annotation_info_pointers[] =
612
{
613
  &_r_installer_method_inspect_bundle_annotation_info_0,
614
  &_r_installer_method_inspect_bundle_annotation_info_1,
615
  NULL
616
};
617
618
static const _ExtendedGDBusMethodInfo _r_installer_method_info_inspect_bundle =
619
{
620
  {
621
    -1,
622
    (gchar *) "InspectBundle",
623
    (GDBusArgInfo **) &_r_installer_method_info_inspect_bundle_IN_ARG_pointers,
624
    (GDBusArgInfo **) &_r_installer_method_info_inspect_bundle_OUT_ARG_pointers,
625
    (GDBusAnnotationInfo **) &_r_installer_method_inspect_bundle_annotation_info_pointers
626
  },
627
  "handle-inspect-bundle",
628
  FALSE
629
};
630
631
static const _ExtendedGDBusArgInfo _r_installer_method_info_mark_IN_ARG_state =
632
{
633
  {
634
    -1,
635
    (gchar *) "state",
636
    (gchar *) "s",
637
    NULL
638
  },
639
  FALSE
640
};
641
642
static const _ExtendedGDBusArgInfo _r_installer_method_info_mark_IN_ARG_slot_identifier =
643
{
644
  {
645
    -1,
646
    (gchar *) "slot_identifier",
647
    (gchar *) "s",
648
    NULL
649
  },
650
  FALSE
651
};
652
653
static const GDBusArgInfo * const _r_installer_method_info_mark_IN_ARG_pointers[] =
654
{
655
  &_r_installer_method_info_mark_IN_ARG_state.parent_struct,
656
  &_r_installer_method_info_mark_IN_ARG_slot_identifier.parent_struct,
657
  NULL
658
};
659
660
static const _ExtendedGDBusArgInfo _r_installer_method_info_mark_OUT_ARG_slot_name =
661
{
662
  {
663
    -1,
664
    (gchar *) "slot_name",
665
    (gchar *) "s",
666
    NULL
667
  },
668
  FALSE
669
};
670
671
static const _ExtendedGDBusArgInfo _r_installer_method_info_mark_OUT_ARG_message =
672
{
673
  {
674
    -1,
675
    (gchar *) "message",
676
    (gchar *) "s",
677
    NULL
678
  },
679
  FALSE
680
};
681
682
static const GDBusArgInfo * const _r_installer_method_info_mark_OUT_ARG_pointers[] =
683
{
684
  &_r_installer_method_info_mark_OUT_ARG_slot_name.parent_struct,
685
  &_r_installer_method_info_mark_OUT_ARG_message.parent_struct,
686
  NULL
687
};
688
689
static const _ExtendedGDBusMethodInfo _r_installer_method_info_mark =
690
{
691
  {
692
    -1,
693
    (gchar *) "Mark",
694
    (GDBusArgInfo **) &_r_installer_method_info_mark_IN_ARG_pointers,
695
    (GDBusArgInfo **) &_r_installer_method_info_mark_OUT_ARG_pointers,
696
    NULL
697
  },
698
  "handle-mark",
699
  FALSE
700
};
701
702
static const _ExtendedGDBusArgInfo _r_installer_method_info_get_slot_status_OUT_ARG_slot_status_array =
703
{
704
  {
705
    -1,
706
    (gchar *) "slot_status_array",
707
    (gchar *) "a(sa{sv})",
708
    NULL
709
  },
710
  FALSE
711
};
712
713
static const GDBusArgInfo * const _r_installer_method_info_get_slot_status_OUT_ARG_pointers[] =
714
{
715
  &_r_installer_method_info_get_slot_status_OUT_ARG_slot_status_array.parent_struct,
716
  NULL
717
};
718
719
static const GDBusAnnotationInfo _r_installer_method_get_slot_status_annotation_info_0 =
720
{
721
  -1,
722
  (gchar *) "org.qtproject.QtDBus.QtTypeName.Out0",
723
  (gchar *) "RaucSlotStatusArray",
724
  NULL
725
};
726
727
static const GDBusAnnotationInfo * const _r_installer_method_get_slot_status_annotation_info_pointers[] =
728
{
729
  &_r_installer_method_get_slot_status_annotation_info_0,
730
  NULL
731
};
732
733
static const _ExtendedGDBusMethodInfo _r_installer_method_info_get_slot_status =
734
{
735
  {
736
    -1,
737
    (gchar *) "GetSlotStatus",
738
    NULL,
739
    (GDBusArgInfo **) &_r_installer_method_info_get_slot_status_OUT_ARG_pointers,
740
    (GDBusAnnotationInfo **) &_r_installer_method_get_slot_status_annotation_info_pointers
741
  },
742
  "handle-get-slot-status",
743
  FALSE
744
};
745
746
static const _ExtendedGDBusArgInfo _r_installer_method_info_get_artifact_status_OUT_ARG_artifacts =
747
{
748
  {
749
    -1,
750
    (gchar *) "artifacts",
751
    (gchar *) "aa{sv}",
752
    NULL
753
  },
754
  FALSE
755
};
756
757
static const GDBusArgInfo * const _r_installer_method_info_get_artifact_status_OUT_ARG_pointers[] =
758
{
759
  &_r_installer_method_info_get_artifact_status_OUT_ARG_artifacts.parent_struct,
760
  NULL
761
};
762
763
static const GDBusAnnotationInfo _r_installer_method_get_artifact_status_annotation_info_0 =
764
{
765
  -1,
766
  (gchar *) "org.qtproject.QtDBus.QtTypeName.Out0",
767
  (gchar *) "QList<QVariantMap>",
768
  NULL
769
};
770
771
static const GDBusAnnotationInfo * const _r_installer_method_get_artifact_status_annotation_info_pointers[] =
772
{
773
  &_r_installer_method_get_artifact_status_annotation_info_0,
774
  NULL
775
};
776
777
static const _ExtendedGDBusMethodInfo _r_installer_method_info_get_artifact_status =
778
{
779
  {
780
    -1,
781
    (gchar *) "GetArtifactStatus",
782
    NULL,
783
    (GDBusArgInfo **) &_r_installer_method_info_get_artifact_status_OUT_ARG_pointers,
784
    (GDBusAnnotationInfo **) &_r_installer_method_get_artifact_status_annotation_info_pointers
785
  },
786
  "handle-get-artifact-status",
787
  FALSE
788
};
789
790
static const _ExtendedGDBusArgInfo _r_installer_method_info_get_primary_OUT_ARG_primary =
791
{
792
  {
793
    -1,
794
    (gchar *) "primary",
795
    (gchar *) "s",
796
    NULL
797
  },
798
  FALSE
799
};
800
801
static const GDBusArgInfo * const _r_installer_method_info_get_primary_OUT_ARG_pointers[] =
802
{
803
  &_r_installer_method_info_get_primary_OUT_ARG_primary.parent_struct,
804
  NULL
805
};
806
807
static const _ExtendedGDBusMethodInfo _r_installer_method_info_get_primary =
808
{
809
  {
810
    -1,
811
    (gchar *) "GetPrimary",
812
    NULL,
813
    (GDBusArgInfo **) &_r_installer_method_info_get_primary_OUT_ARG_pointers,
814
    NULL
815
  },
816
  "handle-get-primary",
817
  FALSE
818
};
819
820
static const GDBusMethodInfo * const _r_installer_method_info_pointers[] =
821
{
822
  &_r_installer_method_info_install.parent_struct,
823
  &_r_installer_method_info_install_bundle.parent_struct,
824
  &_r_installer_method_info_info.parent_struct,
825
  &_r_installer_method_info_inspect_bundle.parent_struct,
826
  &_r_installer_method_info_mark.parent_struct,
827
  &_r_installer_method_info_get_slot_status.parent_struct,
828
  &_r_installer_method_info_get_artifact_status.parent_struct,
829
  &_r_installer_method_info_get_primary.parent_struct,
830
  NULL
831
};
832
833
static const _ExtendedGDBusArgInfo _r_installer_signal_info_completed_ARG_result =
834
{
835
  {
836
    -1,
837
    (gchar *) "result",
838
    (gchar *) "i",
839
    NULL
840
  },
841
  FALSE
842
};
843
844
static const GDBusArgInfo * const _r_installer_signal_info_completed_ARG_pointers[] =
845
{
846
  &_r_installer_signal_info_completed_ARG_result.parent_struct,
847
  NULL
848
};
849
850
static const _ExtendedGDBusSignalInfo _r_installer_signal_info_completed =
851
{
852
  {
853
    -1,
854
    (gchar *) "Completed",
855
    (GDBusArgInfo **) &_r_installer_signal_info_completed_ARG_pointers,
856
    NULL
857
  },
858
  "completed"
859
};
860
861
static const GDBusSignalInfo * const _r_installer_signal_info_pointers[] =
862
{
863
  &_r_installer_signal_info_completed.parent_struct,
864
  NULL
865
};
866
867
static const _ExtendedGDBusPropertyInfo _r_installer_property_info_operation =
868
{
869
  {
870
    -1,
871
    (gchar *) "Operation",
872
    (gchar *) "s",
873
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
874
    NULL
875
  },
876
  "operation",
877
  FALSE,
878
  TRUE
879
};
880
881
static const _ExtendedGDBusPropertyInfo _r_installer_property_info_last_error =
882
{
883
  {
884
    -1,
885
    (gchar *) "LastError",
886
    (gchar *) "s",
887
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
888
    NULL
889
  },
890
  "last-error",
891
  FALSE,
892
  TRUE
893
};
894
895
static const GDBusAnnotationInfo _r_installer_property_progress_annotation_info_0 =
896
{
897
  -1,
898
  (gchar *) "org.qtproject.QtDBus.QtTypeName",
899
  (gchar *) "RaucProgress",
900
  NULL
901
};
902
903
static const GDBusAnnotationInfo * const _r_installer_property_progress_annotation_info_pointers[] =
904
{
905
  &_r_installer_property_progress_annotation_info_0,
906
  NULL
907
};
908
909
static const _ExtendedGDBusPropertyInfo _r_installer_property_info_progress =
910
{
911
  {
912
    -1,
913
    (gchar *) "Progress",
914
    (gchar *) "(isi)",
915
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
916
    (GDBusAnnotationInfo **) &_r_installer_property_progress_annotation_info_pointers
917
  },
918
  "progress",
919
  FALSE,
920
  TRUE
921
};
922
923
static const _ExtendedGDBusPropertyInfo _r_installer_property_info_compatible =
924
{
925
  {
926
    -1,
927
    (gchar *) "Compatible",
928
    (gchar *) "s",
929
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
930
    NULL
931
  },
932
  "compatible",
933
  FALSE,
934
  TRUE
935
};
936
937
static const _ExtendedGDBusPropertyInfo _r_installer_property_info_variant =
938
{
939
  {
940
    -1,
941
    (gchar *) "Variant",
942
    (gchar *) "s",
943
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
944
    NULL
945
  },
946
  "variant",
947
  FALSE,
948
  TRUE
949
};
950
951
static const _ExtendedGDBusPropertyInfo _r_installer_property_info_system_version =
952
{
953
  {
954
    -1,
955
    (gchar *) "SystemVersion",
956
    (gchar *) "s",
957
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
958
    NULL
959
  },
960
  "system-version",
961
  FALSE,
962
  TRUE
963
};
964
965
static const _ExtendedGDBusPropertyInfo _r_installer_property_info_boot_slot =
966
{
967
  {
968
    -1,
969
    (gchar *) "BootSlot",
970
    (gchar *) "s",
971
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
972
    NULL
973
  },
974
  "boot-slot",
975
  FALSE,
976
  TRUE
977
};
978
979
static const GDBusPropertyInfo * const _r_installer_property_info_pointers[] =
980
{
981
  &_r_installer_property_info_operation.parent_struct,
982
  &_r_installer_property_info_last_error.parent_struct,
983
  &_r_installer_property_info_progress.parent_struct,
984
  &_r_installer_property_info_compatible.parent_struct,
985
  &_r_installer_property_info_variant.parent_struct,
986
  &_r_installer_property_info_system_version.parent_struct,
987
  &_r_installer_property_info_boot_slot.parent_struct,
988
  NULL
989
};
990
991
static const _ExtendedGDBusInterfaceInfo _r_installer_interface_info =
992
{
993
  {
994
    -1,
995
    (gchar *) "de.pengutronix.rauc.Installer",
996
    (GDBusMethodInfo **) &_r_installer_method_info_pointers,
997
    (GDBusSignalInfo **) &_r_installer_signal_info_pointers,
998
    (GDBusPropertyInfo **) &_r_installer_property_info_pointers,
999
    NULL
1000
  },
1001
  "installer",
1002
};
1003
1004
1005
/**
1006
 * r_installer_interface_info:
1007
 *
1008
 * Gets a machine-readable description of the <link linkend="gdbus-interface-de-pengutronix-rauc-Installer.top_of_page">de.pengutronix.rauc.Installer</link> D-Bus interface.
1009
 *
1010
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
1011
 */
1012
GDBusInterfaceInfo *
1013
r_installer_interface_info (void)
1014
0
{
1015
0
  return (GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct;
1016
0
}
1017
1018
/**
1019
 * r_installer_override_properties:
1020
 * @klass: The class structure for a #GObject derived class.
1021
 * @property_id_begin: The property id to assign to the first overridden property.
1022
 *
1023
 * Overrides all #GObject properties in the #RInstaller interface for a concrete class.
1024
 * The properties are overridden in the order they are defined.
1025
 *
1026
 * Returns: The last property id.
1027
 */
1028
guint
1029
r_installer_override_properties (GObjectClass *klass, guint property_id_begin)
1030
0
{
1031
0
  g_object_class_override_property (klass, property_id_begin++, "operation");
1032
0
  g_object_class_override_property (klass, property_id_begin++, "last-error");
1033
0
  g_object_class_override_property (klass, property_id_begin++, "progress");
1034
0
  g_object_class_override_property (klass, property_id_begin++, "compatible");
1035
0
  g_object_class_override_property (klass, property_id_begin++, "variant");
1036
0
  g_object_class_override_property (klass, property_id_begin++, "system-version");
1037
0
  g_object_class_override_property (klass, property_id_begin++, "boot-slot");
1038
0
  return property_id_begin - 1;
1039
0
}
1040
1041
1042
inline static void
1043
r_installer_signal_marshal_completed (
1044
    GClosure     *closure,
1045
    GValue       *return_value,
1046
    unsigned int  n_param_values,
1047
    const GValue *param_values,
1048
    void         *invocation_hint,
1049
    void         *marshal_data)
1050
0
{
1051
0
  g_cclosure_marshal_VOID__INT (closure,
1052
0
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
1053
0
}
1054
1055
inline static void
1056
r_installer_method_marshal_install (
1057
    GClosure     *closure,
1058
    GValue       *return_value,
1059
    unsigned int  n_param_values,
1060
    const GValue *param_values,
1061
    void         *invocation_hint,
1062
    void         *marshal_data)
1063
0
{
1064
0
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING (closure,
1065
0
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
1066
0
}
1067
1068
inline static void
1069
r_installer_method_marshal_install_bundle (
1070
    GClosure     *closure,
1071
    GValue       *return_value,
1072
    unsigned int  n_param_values,
1073
    const GValue *param_values,
1074
    void         *invocation_hint,
1075
    void         *marshal_data)
1076
0
{
1077
0
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_VARIANT (closure,
1078
0
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
1079
0
}
1080
1081
inline static void
1082
r_installer_method_marshal_info (
1083
    GClosure     *closure,
1084
    GValue       *return_value,
1085
    unsigned int  n_param_values,
1086
    const GValue *param_values,
1087
    void         *invocation_hint,
1088
    void         *marshal_data)
1089
0
{
1090
0
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING (closure,
1091
0
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
1092
0
}
1093
1094
inline static void
1095
r_installer_method_marshal_inspect_bundle (
1096
    GClosure     *closure,
1097
    GValue       *return_value,
1098
    unsigned int  n_param_values,
1099
    const GValue *param_values,
1100
    void         *invocation_hint,
1101
    void         *marshal_data)
1102
0
{
1103
0
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_VARIANT (closure,
1104
0
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
1105
0
}
1106
1107
inline static void
1108
r_installer_method_marshal_mark (
1109
    GClosure     *closure,
1110
    GValue       *return_value,
1111
    unsigned int  n_param_values,
1112
    const GValue *param_values,
1113
    void         *invocation_hint,
1114
    void         *marshal_data)
1115
0
{
1116
0
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_STRING (closure,
1117
0
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
1118
0
}
1119
1120
inline static void
1121
r_installer_method_marshal_get_slot_status (
1122
    GClosure     *closure,
1123
    GValue       *return_value,
1124
    unsigned int  n_param_values,
1125
    const GValue *param_values,
1126
    void         *invocation_hint,
1127
    void         *marshal_data)
1128
0
{
1129
0
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
1130
0
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
1131
0
}
1132
1133
inline static void
1134
r_installer_method_marshal_get_artifact_status (
1135
    GClosure     *closure,
1136
    GValue       *return_value,
1137
    unsigned int  n_param_values,
1138
    const GValue *param_values,
1139
    void         *invocation_hint,
1140
    void         *marshal_data)
1141
0
{
1142
0
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
1143
0
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
1144
0
}
1145
1146
inline static void
1147
r_installer_method_marshal_get_primary (
1148
    GClosure     *closure,
1149
    GValue       *return_value,
1150
    unsigned int  n_param_values,
1151
    const GValue *param_values,
1152
    void         *invocation_hint,
1153
    void         *marshal_data)
1154
0
{
1155
0
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
1156
0
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
1157
0
}
1158
1159
1160
/**
1161
 * RInstaller:
1162
 *
1163
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Installer.top_of_page">de.pengutronix.rauc.Installer</link>.
1164
 */
1165
1166
/**
1167
 * RInstallerIface:
1168
 * @parent_iface: The parent interface.
1169
 * @handle_get_artifact_status: Handler for the #RInstaller::handle-get-artifact-status signal.
1170
 * @handle_get_primary: Handler for the #RInstaller::handle-get-primary signal.
1171
 * @handle_get_slot_status: Handler for the #RInstaller::handle-get-slot-status signal.
1172
 * @handle_info: Handler for the #RInstaller::handle-info signal.
1173
 * @handle_inspect_bundle: Handler for the #RInstaller::handle-inspect-bundle signal.
1174
 * @handle_install: Handler for the #RInstaller::handle-install signal.
1175
 * @handle_install_bundle: Handler for the #RInstaller::handle-install-bundle signal.
1176
 * @handle_mark: Handler for the #RInstaller::handle-mark signal.
1177
 * @get_boot_slot: Getter for the #RInstaller:boot-slot property.
1178
 * @get_compatible: Getter for the #RInstaller:compatible property.
1179
 * @get_last_error: Getter for the #RInstaller:last-error property.
1180
 * @get_operation: Getter for the #RInstaller:operation property.
1181
 * @get_progress: Getter for the #RInstaller:progress property.
1182
 * @get_system_version: Getter for the #RInstaller:system-version property.
1183
 * @get_variant: Getter for the #RInstaller:variant property.
1184
 * @completed: Handler for the #RInstaller::completed signal.
1185
 *
1186
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Installer.top_of_page">de.pengutronix.rauc.Installer</link>.
1187
 */
1188
1189
typedef RInstallerIface RInstallerInterface;
1190
0
G_DEFINE_INTERFACE (RInstaller, r_installer, G_TYPE_OBJECT)
1191
0
1192
0
static void
1193
0
r_installer_default_init (RInstallerIface *iface)
1194
0
{
1195
  /* GObject signals for incoming D-Bus method calls: */
1196
  /**
1197
   * RInstaller::handle-install:
1198
   * @object: A #RInstaller.
1199
   * @invocation: A #GDBusMethodInvocation.
1200
   * @arg_source: Argument passed by remote caller.
1201
   *
1202
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Install">Install()</link> D-Bus method.
1203
   *
1204
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call r_installer_complete_install() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1205
   *
1206
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1207
   */
1208
0
  g_signal_new ("handle-install",
1209
0
    G_TYPE_FROM_INTERFACE (iface),
1210
0
    G_SIGNAL_RUN_LAST,
1211
0
    G_STRUCT_OFFSET (RInstallerIface, handle_install),
1212
0
    g_signal_accumulator_true_handled,
1213
0
    NULL,
1214
0
      r_installer_method_marshal_install,
1215
0
    G_TYPE_BOOLEAN,
1216
0
    2,
1217
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
1218
1219
  /**
1220
   * RInstaller::handle-install-bundle:
1221
   * @object: A #RInstaller.
1222
   * @invocation: A #GDBusMethodInvocation.
1223
   * @arg_source: Argument passed by remote caller.
1224
   * @arg_args: Argument passed by remote caller.
1225
   *
1226
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InstallBundle">InstallBundle()</link> D-Bus method.
1227
   *
1228
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call r_installer_complete_install_bundle() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1229
   *
1230
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1231
   */
1232
0
  g_signal_new ("handle-install-bundle",
1233
0
    G_TYPE_FROM_INTERFACE (iface),
1234
0
    G_SIGNAL_RUN_LAST,
1235
0
    G_STRUCT_OFFSET (RInstallerIface, handle_install_bundle),
1236
0
    g_signal_accumulator_true_handled,
1237
0
    NULL,
1238
0
      r_installer_method_marshal_install_bundle,
1239
0
    G_TYPE_BOOLEAN,
1240
0
    3,
1241
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT);
1242
1243
  /**
1244
   * RInstaller::handle-info:
1245
   * @object: A #RInstaller.
1246
   * @invocation: A #GDBusMethodInvocation.
1247
   * @arg_bundle: Argument passed by remote caller.
1248
   *
1249
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Info">Info()</link> D-Bus method.
1250
   *
1251
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call r_installer_complete_info() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1252
   *
1253
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1254
   */
1255
0
  g_signal_new ("handle-info",
1256
0
    G_TYPE_FROM_INTERFACE (iface),
1257
0
    G_SIGNAL_RUN_LAST,
1258
0
    G_STRUCT_OFFSET (RInstallerIface, handle_info),
1259
0
    g_signal_accumulator_true_handled,
1260
0
    NULL,
1261
0
      r_installer_method_marshal_info,
1262
0
    G_TYPE_BOOLEAN,
1263
0
    2,
1264
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
1265
1266
  /**
1267
   * RInstaller::handle-inspect-bundle:
1268
   * @object: A #RInstaller.
1269
   * @invocation: A #GDBusMethodInvocation.
1270
   * @arg_source: Argument passed by remote caller.
1271
   * @arg_args: Argument passed by remote caller.
1272
   *
1273
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InspectBundle">InspectBundle()</link> D-Bus method.
1274
   *
1275
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call r_installer_complete_inspect_bundle() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1276
   *
1277
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1278
   */
1279
0
  g_signal_new ("handle-inspect-bundle",
1280
0
    G_TYPE_FROM_INTERFACE (iface),
1281
0
    G_SIGNAL_RUN_LAST,
1282
0
    G_STRUCT_OFFSET (RInstallerIface, handle_inspect_bundle),
1283
0
    g_signal_accumulator_true_handled,
1284
0
    NULL,
1285
0
      r_installer_method_marshal_inspect_bundle,
1286
0
    G_TYPE_BOOLEAN,
1287
0
    3,
1288
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT);
1289
1290
  /**
1291
   * RInstaller::handle-mark:
1292
   * @object: A #RInstaller.
1293
   * @invocation: A #GDBusMethodInvocation.
1294
   * @arg_state: Argument passed by remote caller.
1295
   * @arg_slot_identifier: Argument passed by remote caller.
1296
   *
1297
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Mark">Mark()</link> D-Bus method.
1298
   *
1299
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call r_installer_complete_mark() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1300
   *
1301
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1302
   */
1303
0
  g_signal_new ("handle-mark",
1304
0
    G_TYPE_FROM_INTERFACE (iface),
1305
0
    G_SIGNAL_RUN_LAST,
1306
0
    G_STRUCT_OFFSET (RInstallerIface, handle_mark),
1307
0
    g_signal_accumulator_true_handled,
1308
0
    NULL,
1309
0
      r_installer_method_marshal_mark,
1310
0
    G_TYPE_BOOLEAN,
1311
0
    3,
1312
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING);
1313
1314
  /**
1315
   * RInstaller::handle-get-slot-status:
1316
   * @object: A #RInstaller.
1317
   * @invocation: A #GDBusMethodInvocation.
1318
   *
1319
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetSlotStatus">GetSlotStatus()</link> D-Bus method.
1320
   *
1321
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call r_installer_complete_get_slot_status() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1322
   *
1323
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1324
   */
1325
0
  g_signal_new ("handle-get-slot-status",
1326
0
    G_TYPE_FROM_INTERFACE (iface),
1327
0
    G_SIGNAL_RUN_LAST,
1328
0
    G_STRUCT_OFFSET (RInstallerIface, handle_get_slot_status),
1329
0
    g_signal_accumulator_true_handled,
1330
0
    NULL,
1331
0
      r_installer_method_marshal_get_slot_status,
1332
0
    G_TYPE_BOOLEAN,
1333
0
    1,
1334
0
    G_TYPE_DBUS_METHOD_INVOCATION);
1335
1336
  /**
1337
   * RInstaller::handle-get-artifact-status:
1338
   * @object: A #RInstaller.
1339
   * @invocation: A #GDBusMethodInvocation.
1340
   *
1341
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetArtifactStatus">GetArtifactStatus()</link> D-Bus method.
1342
   *
1343
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call r_installer_complete_get_artifact_status() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1344
   *
1345
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1346
   */
1347
0
  g_signal_new ("handle-get-artifact-status",
1348
0
    G_TYPE_FROM_INTERFACE (iface),
1349
0
    G_SIGNAL_RUN_LAST,
1350
0
    G_STRUCT_OFFSET (RInstallerIface, handle_get_artifact_status),
1351
0
    g_signal_accumulator_true_handled,
1352
0
    NULL,
1353
0
      r_installer_method_marshal_get_artifact_status,
1354
0
    G_TYPE_BOOLEAN,
1355
0
    1,
1356
0
    G_TYPE_DBUS_METHOD_INVOCATION);
1357
1358
  /**
1359
   * RInstaller::handle-get-primary:
1360
   * @object: A #RInstaller.
1361
   * @invocation: A #GDBusMethodInvocation.
1362
   *
1363
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetPrimary">GetPrimary()</link> D-Bus method.
1364
   *
1365
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call r_installer_complete_get_primary() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1366
   *
1367
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1368
   */
1369
0
  g_signal_new ("handle-get-primary",
1370
0
    G_TYPE_FROM_INTERFACE (iface),
1371
0
    G_SIGNAL_RUN_LAST,
1372
0
    G_STRUCT_OFFSET (RInstallerIface, handle_get_primary),
1373
0
    g_signal_accumulator_true_handled,
1374
0
    NULL,
1375
0
      r_installer_method_marshal_get_primary,
1376
0
    G_TYPE_BOOLEAN,
1377
0
    1,
1378
0
    G_TYPE_DBUS_METHOD_INVOCATION);
1379
1380
  /* GObject signals for received D-Bus signals: */
1381
  /**
1382
   * RInstaller::completed:
1383
   * @object: A #RInstaller.
1384
   * @arg_result: Argument.
1385
   *
1386
   * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-de-pengutronix-rauc-Installer.Completed">"Completed"</link> is received.
1387
   *
1388
   * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
1389
   */
1390
0
  R__INSTALLER_SIGNALS[R__INSTALLER_COMPLETED] =
1391
0
    g_signal_new ("completed",
1392
0
      G_TYPE_FROM_INTERFACE (iface),
1393
0
      G_SIGNAL_RUN_LAST,
1394
0
      G_STRUCT_OFFSET (RInstallerIface, completed),
1395
0
      NULL,
1396
0
      NULL,
1397
0
      r_installer_signal_marshal_completed,
1398
0
      G_TYPE_NONE,
1399
0
      1, G_TYPE_INT);
1400
1401
  /* GObject properties for D-Bus properties: */
1402
  /**
1403
   * RInstaller:operation:
1404
   *
1405
   * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Operation">"Operation"</link>.
1406
   *
1407
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
1408
   */
1409
0
  g_object_interface_install_property (iface,
1410
0
    g_param_spec_string ("operation", "Operation", "Operation", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1411
  /**
1412
   * RInstaller:last-error:
1413
   *
1414
   * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.LastError">"LastError"</link>.
1415
   *
1416
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
1417
   */
1418
0
  g_object_interface_install_property (iface,
1419
0
    g_param_spec_string ("last-error", "LastError", "LastError", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1420
  /**
1421
   * RInstaller:progress:
1422
   *
1423
   * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Progress">"Progress"</link>.
1424
   *
1425
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
1426
   */
1427
0
  g_object_interface_install_property (iface,
1428
0
    g_param_spec_variant ("progress", "Progress", "Progress", G_VARIANT_TYPE ("(isi)"), NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1429
  /**
1430
   * RInstaller:compatible:
1431
   *
1432
   * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Compatible">"Compatible"</link>.
1433
   *
1434
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
1435
   */
1436
0
  g_object_interface_install_property (iface,
1437
0
    g_param_spec_string ("compatible", "Compatible", "Compatible", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1438
  /**
1439
   * RInstaller:variant:
1440
   *
1441
   * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Variant">"Variant"</link>.
1442
   *
1443
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
1444
   */
1445
0
  g_object_interface_install_property (iface,
1446
0
    g_param_spec_string ("variant", "Variant", "Variant", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1447
  /**
1448
   * RInstaller:system-version:
1449
   *
1450
   * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.SystemVersion">"SystemVersion"</link>.
1451
   *
1452
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
1453
   */
1454
0
  g_object_interface_install_property (iface,
1455
0
    g_param_spec_string ("system-version", "SystemVersion", "SystemVersion", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1456
  /**
1457
   * RInstaller:boot-slot:
1458
   *
1459
   * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.BootSlot">"BootSlot"</link>.
1460
   *
1461
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
1462
   */
1463
0
  g_object_interface_install_property (iface,
1464
0
    g_param_spec_string ("boot-slot", "BootSlot", "BootSlot", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1465
0
}
1466
1467
/**
1468
 * r_installer_get_operation: (skip)
1469
 * @object: A #RInstaller.
1470
 *
1471
 * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Operation">"Operation"</link> D-Bus property.
1472
 *
1473
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1474
 *
1475
 * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use r_installer_dup_operation() if on another thread.
1476
 *
1477
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1478
 */
1479
const gchar *
1480
r_installer_get_operation (RInstaller *object)
1481
0
{
1482
0
  g_return_val_if_fail (R_IS_INSTALLER (object), NULL);
1483
1484
0
  return R_INSTALLER_GET_IFACE (object)->get_operation (object);
1485
0
}
1486
1487
/**
1488
 * r_installer_dup_operation: (skip)
1489
 * @object: A #RInstaller.
1490
 *
1491
 * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Operation">"Operation"</link> D-Bus property.
1492
 *
1493
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1494
 *
1495
 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1496
 */
1497
gchar *
1498
r_installer_dup_operation (RInstaller *object)
1499
0
{
1500
0
  gchar *value;
1501
0
  g_object_get (G_OBJECT (object), "operation", &value, NULL);
1502
0
  return value;
1503
0
}
1504
1505
/**
1506
 * r_installer_set_operation: (skip)
1507
 * @object: A #RInstaller.
1508
 * @value: The value to set.
1509
 *
1510
 * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Operation">"Operation"</link> D-Bus property to @value.
1511
 *
1512
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1513
 */
1514
void
1515
r_installer_set_operation (RInstaller *object, const gchar *value)
1516
0
{
1517
0
  g_object_set (G_OBJECT (object), "operation", value, NULL);
1518
0
}
1519
1520
/**
1521
 * r_installer_get_last_error: (skip)
1522
 * @object: A #RInstaller.
1523
 *
1524
 * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.LastError">"LastError"</link> D-Bus property.
1525
 *
1526
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1527
 *
1528
 * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use r_installer_dup_last_error() if on another thread.
1529
 *
1530
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1531
 */
1532
const gchar *
1533
r_installer_get_last_error (RInstaller *object)
1534
0
{
1535
0
  g_return_val_if_fail (R_IS_INSTALLER (object), NULL);
1536
1537
0
  return R_INSTALLER_GET_IFACE (object)->get_last_error (object);
1538
0
}
1539
1540
/**
1541
 * r_installer_dup_last_error: (skip)
1542
 * @object: A #RInstaller.
1543
 *
1544
 * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.LastError">"LastError"</link> D-Bus property.
1545
 *
1546
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1547
 *
1548
 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1549
 */
1550
gchar *
1551
r_installer_dup_last_error (RInstaller *object)
1552
0
{
1553
0
  gchar *value;
1554
0
  g_object_get (G_OBJECT (object), "last-error", &value, NULL);
1555
0
  return value;
1556
0
}
1557
1558
/**
1559
 * r_installer_set_last_error: (skip)
1560
 * @object: A #RInstaller.
1561
 * @value: The value to set.
1562
 *
1563
 * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.LastError">"LastError"</link> D-Bus property to @value.
1564
 *
1565
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1566
 */
1567
void
1568
r_installer_set_last_error (RInstaller *object, const gchar *value)
1569
0
{
1570
0
  g_object_set (G_OBJECT (object), "last-error", value, NULL);
1571
0
}
1572
1573
/**
1574
 * r_installer_get_progress: (skip)
1575
 * @object: A #RInstaller.
1576
 *
1577
 * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Progress">"Progress"</link> D-Bus property.
1578
 *
1579
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1580
 *
1581
 * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use r_installer_dup_progress() if on another thread.
1582
 *
1583
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1584
 */
1585
GVariant *
1586
r_installer_get_progress (RInstaller *object)
1587
0
{
1588
0
  g_return_val_if_fail (R_IS_INSTALLER (object), NULL);
1589
1590
0
  return R_INSTALLER_GET_IFACE (object)->get_progress (object);
1591
0
}
1592
1593
/**
1594
 * r_installer_dup_progress: (skip)
1595
 * @object: A #RInstaller.
1596
 *
1597
 * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Progress">"Progress"</link> D-Bus property.
1598
 *
1599
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1600
 *
1601
 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref().
1602
 */
1603
GVariant *
1604
r_installer_dup_progress (RInstaller *object)
1605
0
{
1606
0
  GVariant *value;
1607
0
  g_object_get (G_OBJECT (object), "progress", &value, NULL);
1608
0
  return value;
1609
0
}
1610
1611
/**
1612
 * r_installer_set_progress: (skip)
1613
 * @object: A #RInstaller.
1614
 * @value: The value to set.
1615
 *
1616
 * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Progress">"Progress"</link> D-Bus property to @value.
1617
 *
1618
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1619
 */
1620
void
1621
r_installer_set_progress (RInstaller *object, GVariant *value)
1622
0
{
1623
0
  g_object_set (G_OBJECT (object), "progress", value, NULL);
1624
0
}
1625
1626
/**
1627
 * r_installer_get_compatible: (skip)
1628
 * @object: A #RInstaller.
1629
 *
1630
 * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Compatible">"Compatible"</link> D-Bus property.
1631
 *
1632
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1633
 *
1634
 * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use r_installer_dup_compatible() if on another thread.
1635
 *
1636
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1637
 */
1638
const gchar *
1639
r_installer_get_compatible (RInstaller *object)
1640
0
{
1641
0
  g_return_val_if_fail (R_IS_INSTALLER (object), NULL);
1642
1643
0
  return R_INSTALLER_GET_IFACE (object)->get_compatible (object);
1644
0
}
1645
1646
/**
1647
 * r_installer_dup_compatible: (skip)
1648
 * @object: A #RInstaller.
1649
 *
1650
 * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Compatible">"Compatible"</link> D-Bus property.
1651
 *
1652
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1653
 *
1654
 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1655
 */
1656
gchar *
1657
r_installer_dup_compatible (RInstaller *object)
1658
0
{
1659
0
  gchar *value;
1660
0
  g_object_get (G_OBJECT (object), "compatible", &value, NULL);
1661
0
  return value;
1662
0
}
1663
1664
/**
1665
 * r_installer_set_compatible: (skip)
1666
 * @object: A #RInstaller.
1667
 * @value: The value to set.
1668
 *
1669
 * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Compatible">"Compatible"</link> D-Bus property to @value.
1670
 *
1671
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1672
 */
1673
void
1674
r_installer_set_compatible (RInstaller *object, const gchar *value)
1675
0
{
1676
0
  g_object_set (G_OBJECT (object), "compatible", value, NULL);
1677
0
}
1678
1679
/**
1680
 * r_installer_get_variant: (skip)
1681
 * @object: A #RInstaller.
1682
 *
1683
 * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Variant">"Variant"</link> D-Bus property.
1684
 *
1685
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1686
 *
1687
 * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use r_installer_dup_variant() if on another thread.
1688
 *
1689
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1690
 */
1691
const gchar *
1692
r_installer_get_variant (RInstaller *object)
1693
0
{
1694
0
  g_return_val_if_fail (R_IS_INSTALLER (object), NULL);
1695
1696
0
  return R_INSTALLER_GET_IFACE (object)->get_variant (object);
1697
0
}
1698
1699
/**
1700
 * r_installer_dup_variant: (skip)
1701
 * @object: A #RInstaller.
1702
 *
1703
 * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Variant">"Variant"</link> D-Bus property.
1704
 *
1705
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1706
 *
1707
 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1708
 */
1709
gchar *
1710
r_installer_dup_variant (RInstaller *object)
1711
0
{
1712
0
  gchar *value;
1713
0
  g_object_get (G_OBJECT (object), "variant", &value, NULL);
1714
0
  return value;
1715
0
}
1716
1717
/**
1718
 * r_installer_set_variant: (skip)
1719
 * @object: A #RInstaller.
1720
 * @value: The value to set.
1721
 *
1722
 * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Variant">"Variant"</link> D-Bus property to @value.
1723
 *
1724
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1725
 */
1726
void
1727
r_installer_set_variant (RInstaller *object, const gchar *value)
1728
0
{
1729
0
  g_object_set (G_OBJECT (object), "variant", value, NULL);
1730
0
}
1731
1732
/**
1733
 * r_installer_get_system_version: (skip)
1734
 * @object: A #RInstaller.
1735
 *
1736
 * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.SystemVersion">"SystemVersion"</link> D-Bus property.
1737
 *
1738
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1739
 *
1740
 * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use r_installer_dup_system_version() if on another thread.
1741
 *
1742
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1743
 */
1744
const gchar *
1745
r_installer_get_system_version (RInstaller *object)
1746
0
{
1747
0
  g_return_val_if_fail (R_IS_INSTALLER (object), NULL);
1748
1749
0
  return R_INSTALLER_GET_IFACE (object)->get_system_version (object);
1750
0
}
1751
1752
/**
1753
 * r_installer_dup_system_version: (skip)
1754
 * @object: A #RInstaller.
1755
 *
1756
 * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.SystemVersion">"SystemVersion"</link> D-Bus property.
1757
 *
1758
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1759
 *
1760
 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1761
 */
1762
gchar *
1763
r_installer_dup_system_version (RInstaller *object)
1764
0
{
1765
0
  gchar *value;
1766
0
  g_object_get (G_OBJECT (object), "system-version", &value, NULL);
1767
0
  return value;
1768
0
}
1769
1770
/**
1771
 * r_installer_set_system_version: (skip)
1772
 * @object: A #RInstaller.
1773
 * @value: The value to set.
1774
 *
1775
 * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.SystemVersion">"SystemVersion"</link> D-Bus property to @value.
1776
 *
1777
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1778
 */
1779
void
1780
r_installer_set_system_version (RInstaller *object, const gchar *value)
1781
0
{
1782
0
  g_object_set (G_OBJECT (object), "system-version", value, NULL);
1783
0
}
1784
1785
/**
1786
 * r_installer_get_boot_slot: (skip)
1787
 * @object: A #RInstaller.
1788
 *
1789
 * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.BootSlot">"BootSlot"</link> D-Bus property.
1790
 *
1791
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1792
 *
1793
 * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use r_installer_dup_boot_slot() if on another thread.
1794
 *
1795
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1796
 */
1797
const gchar *
1798
r_installer_get_boot_slot (RInstaller *object)
1799
0
{
1800
0
  g_return_val_if_fail (R_IS_INSTALLER (object), NULL);
1801
1802
0
  return R_INSTALLER_GET_IFACE (object)->get_boot_slot (object);
1803
0
}
1804
1805
/**
1806
 * r_installer_dup_boot_slot: (skip)
1807
 * @object: A #RInstaller.
1808
 *
1809
 * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.BootSlot">"BootSlot"</link> D-Bus property.
1810
 *
1811
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1812
 *
1813
 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1814
 */
1815
gchar *
1816
r_installer_dup_boot_slot (RInstaller *object)
1817
0
{
1818
0
  gchar *value;
1819
0
  g_object_get (G_OBJECT (object), "boot-slot", &value, NULL);
1820
0
  return value;
1821
0
}
1822
1823
/**
1824
 * r_installer_set_boot_slot: (skip)
1825
 * @object: A #RInstaller.
1826
 * @value: The value to set.
1827
 *
1828
 * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.BootSlot">"BootSlot"</link> D-Bus property to @value.
1829
 *
1830
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1831
 */
1832
void
1833
r_installer_set_boot_slot (RInstaller *object, const gchar *value)
1834
0
{
1835
0
  g_object_set (G_OBJECT (object), "boot-slot", value, NULL);
1836
0
}
1837
1838
/**
1839
 * r_installer_emit_completed:
1840
 * @object: A #RInstaller.
1841
 * @arg_result: Argument to pass with the signal.
1842
 *
1843
 * Emits the <link linkend="gdbus-signal-de-pengutronix-rauc-Installer.Completed">"Completed"</link> D-Bus signal.
1844
 */
1845
void
1846
r_installer_emit_completed (
1847
    RInstaller *object,
1848
    gint arg_result)
1849
0
{
1850
0
  g_signal_emit (object, R__INSTALLER_SIGNALS[R__INSTALLER_COMPLETED], 0, arg_result);
1851
0
}
1852
1853
/**
1854
 * r_installer_call_install:
1855
 * @proxy: A #RInstallerProxy.
1856
 * @arg_source: Argument to pass with the method invocation.
1857
 * @cancellable: (nullable): A #GCancellable or %NULL.
1858
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1859
 * @user_data: User data to pass to @callback.
1860
 *
1861
 * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Install">Install()</link> D-Bus method on @proxy.
1862
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
1863
 * You can then call r_installer_call_install_finish() to get the result of the operation.
1864
 *
1865
 * See r_installer_call_install_sync() for the synchronous, blocking version of this method.
1866
 */
1867
void
1868
r_installer_call_install (
1869
    RInstaller *proxy,
1870
    const gchar *arg_source,
1871
    GCancellable *cancellable,
1872
    GAsyncReadyCallback callback,
1873
    gpointer user_data)
1874
0
{
1875
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1876
0
    "Install",
1877
0
    g_variant_new ("(s)",
1878
0
                   arg_source),
1879
0
    G_DBUS_CALL_FLAGS_NONE,
1880
0
    -1,
1881
0
    cancellable,
1882
0
    callback,
1883
0
    user_data);
1884
0
}
1885
1886
/**
1887
 * r_installer_call_install_finish:
1888
 * @proxy: A #RInstallerProxy.
1889
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_install().
1890
 * @error: Return location for error or %NULL.
1891
 *
1892
 * Finishes an operation started with r_installer_call_install().
1893
 *
1894
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1895
 */
1896
gboolean
1897
r_installer_call_install_finish (
1898
    RInstaller *proxy,
1899
    GAsyncResult *res,
1900
    GError **error)
1901
0
{
1902
0
  GVariant *_ret;
1903
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1904
0
  if (_ret == NULL)
1905
0
    goto _out;
1906
0
  g_variant_get (_ret,
1907
0
                 "()");
1908
0
  g_variant_unref (_ret);
1909
0
_out:
1910
0
  return _ret != NULL;
1911
0
}
1912
1913
/**
1914
 * r_installer_call_install_sync:
1915
 * @proxy: A #RInstallerProxy.
1916
 * @arg_source: Argument to pass with the method invocation.
1917
 * @cancellable: (nullable): A #GCancellable or %NULL.
1918
 * @error: Return location for error or %NULL.
1919
 *
1920
 * Synchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Install">Install()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1921
 *
1922
 * See r_installer_call_install() for the asynchronous version of this method.
1923
 *
1924
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1925
 */
1926
gboolean
1927
r_installer_call_install_sync (
1928
    RInstaller *proxy,
1929
    const gchar *arg_source,
1930
    GCancellable *cancellable,
1931
    GError **error)
1932
0
{
1933
0
  GVariant *_ret;
1934
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1935
0
    "Install",
1936
0
    g_variant_new ("(s)",
1937
0
                   arg_source),
1938
0
    G_DBUS_CALL_FLAGS_NONE,
1939
0
    -1,
1940
0
    cancellable,
1941
0
    error);
1942
0
  if (_ret == NULL)
1943
0
    goto _out;
1944
0
  g_variant_get (_ret,
1945
0
                 "()");
1946
0
  g_variant_unref (_ret);
1947
0
_out:
1948
0
  return _ret != NULL;
1949
0
}
1950
1951
/**
1952
 * r_installer_call_install_bundle:
1953
 * @proxy: A #RInstallerProxy.
1954
 * @arg_source: Argument to pass with the method invocation.
1955
 * @arg_args: Argument to pass with the method invocation.
1956
 * @cancellable: (nullable): A #GCancellable or %NULL.
1957
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1958
 * @user_data: User data to pass to @callback.
1959
 *
1960
 * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InstallBundle">InstallBundle()</link> D-Bus method on @proxy.
1961
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
1962
 * You can then call r_installer_call_install_bundle_finish() to get the result of the operation.
1963
 *
1964
 * See r_installer_call_install_bundle_sync() for the synchronous, blocking version of this method.
1965
 */
1966
void
1967
r_installer_call_install_bundle (
1968
    RInstaller *proxy,
1969
    const gchar *arg_source,
1970
    GVariant *arg_args,
1971
    GCancellable *cancellable,
1972
    GAsyncReadyCallback callback,
1973
    gpointer user_data)
1974
0
{
1975
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1976
0
    "InstallBundle",
1977
0
    g_variant_new ("(s@a{sv})",
1978
0
                   arg_source,
1979
0
                   arg_args),
1980
0
    G_DBUS_CALL_FLAGS_NONE,
1981
0
    -1,
1982
0
    cancellable,
1983
0
    callback,
1984
0
    user_data);
1985
0
}
1986
1987
/**
1988
 * r_installer_call_install_bundle_finish:
1989
 * @proxy: A #RInstallerProxy.
1990
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_install_bundle().
1991
 * @error: Return location for error or %NULL.
1992
 *
1993
 * Finishes an operation started with r_installer_call_install_bundle().
1994
 *
1995
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1996
 */
1997
gboolean
1998
r_installer_call_install_bundle_finish (
1999
    RInstaller *proxy,
2000
    GAsyncResult *res,
2001
    GError **error)
2002
0
{
2003
0
  GVariant *_ret;
2004
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2005
0
  if (_ret == NULL)
2006
0
    goto _out;
2007
0
  g_variant_get (_ret,
2008
0
                 "()");
2009
0
  g_variant_unref (_ret);
2010
0
_out:
2011
0
  return _ret != NULL;
2012
0
}
2013
2014
/**
2015
 * r_installer_call_install_bundle_sync:
2016
 * @proxy: A #RInstallerProxy.
2017
 * @arg_source: Argument to pass with the method invocation.
2018
 * @arg_args: Argument to pass with the method invocation.
2019
 * @cancellable: (nullable): A #GCancellable or %NULL.
2020
 * @error: Return location for error or %NULL.
2021
 *
2022
 * Synchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InstallBundle">InstallBundle()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2023
 *
2024
 * See r_installer_call_install_bundle() for the asynchronous version of this method.
2025
 *
2026
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2027
 */
2028
gboolean
2029
r_installer_call_install_bundle_sync (
2030
    RInstaller *proxy,
2031
    const gchar *arg_source,
2032
    GVariant *arg_args,
2033
    GCancellable *cancellable,
2034
    GError **error)
2035
0
{
2036
0
  GVariant *_ret;
2037
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2038
0
    "InstallBundle",
2039
0
    g_variant_new ("(s@a{sv})",
2040
0
                   arg_source,
2041
0
                   arg_args),
2042
0
    G_DBUS_CALL_FLAGS_NONE,
2043
0
    -1,
2044
0
    cancellable,
2045
0
    error);
2046
0
  if (_ret == NULL)
2047
0
    goto _out;
2048
0
  g_variant_get (_ret,
2049
0
                 "()");
2050
0
  g_variant_unref (_ret);
2051
0
_out:
2052
0
  return _ret != NULL;
2053
0
}
2054
2055
/**
2056
 * r_installer_call_info:
2057
 * @proxy: A #RInstallerProxy.
2058
 * @arg_bundle: Argument to pass with the method invocation.
2059
 * @cancellable: (nullable): A #GCancellable or %NULL.
2060
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2061
 * @user_data: User data to pass to @callback.
2062
 *
2063
 * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Info">Info()</link> D-Bus method on @proxy.
2064
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2065
 * You can then call r_installer_call_info_finish() to get the result of the operation.
2066
 *
2067
 * See r_installer_call_info_sync() for the synchronous, blocking version of this method.
2068
 */
2069
void
2070
r_installer_call_info (
2071
    RInstaller *proxy,
2072
    const gchar *arg_bundle,
2073
    GCancellable *cancellable,
2074
    GAsyncReadyCallback callback,
2075
    gpointer user_data)
2076
0
{
2077
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2078
0
    "Info",
2079
0
    g_variant_new ("(s)",
2080
0
                   arg_bundle),
2081
0
    G_DBUS_CALL_FLAGS_NONE,
2082
0
    -1,
2083
0
    cancellable,
2084
0
    callback,
2085
0
    user_data);
2086
0
}
2087
2088
/**
2089
 * r_installer_call_info_finish:
2090
 * @proxy: A #RInstallerProxy.
2091
 * @out_compatible: (out) (optional): Return location for return parameter or %NULL to ignore.
2092
 * @out_version: (out) (optional): Return location for return parameter or %NULL to ignore.
2093
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_info().
2094
 * @error: Return location for error or %NULL.
2095
 *
2096
 * Finishes an operation started with r_installer_call_info().
2097
 *
2098
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2099
 */
2100
gboolean
2101
r_installer_call_info_finish (
2102
    RInstaller *proxy,
2103
    gchar ** out_compatible,
2104
    gchar ** out_version,
2105
    GAsyncResult *res,
2106
    GError **error)
2107
0
{
2108
0
  GVariant *_ret;
2109
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2110
0
  if (_ret == NULL)
2111
0
    goto _out;
2112
0
  g_variant_get (_ret,
2113
0
                 "(ss)",
2114
0
                 out_compatible,
2115
0
                 out_version);
2116
0
  g_variant_unref (_ret);
2117
0
_out:
2118
0
  return _ret != NULL;
2119
0
}
2120
2121
/**
2122
 * r_installer_call_info_sync:
2123
 * @proxy: A #RInstallerProxy.
2124
 * @arg_bundle: Argument to pass with the method invocation.
2125
 * @out_compatible: (out) (optional): Return location for return parameter or %NULL to ignore.
2126
 * @out_version: (out) (optional): Return location for return parameter or %NULL to ignore.
2127
 * @cancellable: (nullable): A #GCancellable or %NULL.
2128
 * @error: Return location for error or %NULL.
2129
 *
2130
 * Synchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Info">Info()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2131
 *
2132
 * See r_installer_call_info() for the asynchronous version of this method.
2133
 *
2134
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2135
 */
2136
gboolean
2137
r_installer_call_info_sync (
2138
    RInstaller *proxy,
2139
    const gchar *arg_bundle,
2140
    gchar ** out_compatible,
2141
    gchar ** out_version,
2142
    GCancellable *cancellable,
2143
    GError **error)
2144
0
{
2145
0
  GVariant *_ret;
2146
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2147
0
    "Info",
2148
0
    g_variant_new ("(s)",
2149
0
                   arg_bundle),
2150
0
    G_DBUS_CALL_FLAGS_NONE,
2151
0
    -1,
2152
0
    cancellable,
2153
0
    error);
2154
0
  if (_ret == NULL)
2155
0
    goto _out;
2156
0
  g_variant_get (_ret,
2157
0
                 "(ss)",
2158
0
                 out_compatible,
2159
0
                 out_version);
2160
0
  g_variant_unref (_ret);
2161
0
_out:
2162
0
  return _ret != NULL;
2163
0
}
2164
2165
/**
2166
 * r_installer_call_inspect_bundle:
2167
 * @proxy: A #RInstallerProxy.
2168
 * @arg_source: Argument to pass with the method invocation.
2169
 * @arg_args: Argument to pass with the method invocation.
2170
 * @cancellable: (nullable): A #GCancellable or %NULL.
2171
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2172
 * @user_data: User data to pass to @callback.
2173
 *
2174
 * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InspectBundle">InspectBundle()</link> D-Bus method on @proxy.
2175
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2176
 * You can then call r_installer_call_inspect_bundle_finish() to get the result of the operation.
2177
 *
2178
 * See r_installer_call_inspect_bundle_sync() for the synchronous, blocking version of this method.
2179
 */
2180
void
2181
r_installer_call_inspect_bundle (
2182
    RInstaller *proxy,
2183
    const gchar *arg_source,
2184
    GVariant *arg_args,
2185
    GCancellable *cancellable,
2186
    GAsyncReadyCallback callback,
2187
    gpointer user_data)
2188
0
{
2189
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2190
0
    "InspectBundle",
2191
0
    g_variant_new ("(s@a{sv})",
2192
0
                   arg_source,
2193
0
                   arg_args),
2194
0
    G_DBUS_CALL_FLAGS_NONE,
2195
0
    -1,
2196
0
    cancellable,
2197
0
    callback,
2198
0
    user_data);
2199
0
}
2200
2201
/**
2202
 * r_installer_call_inspect_bundle_finish:
2203
 * @proxy: A #RInstallerProxy.
2204
 * @out_info: (out) (optional): Return location for return parameter or %NULL to ignore.
2205
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_inspect_bundle().
2206
 * @error: Return location for error or %NULL.
2207
 *
2208
 * Finishes an operation started with r_installer_call_inspect_bundle().
2209
 *
2210
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2211
 */
2212
gboolean
2213
r_installer_call_inspect_bundle_finish (
2214
    RInstaller *proxy,
2215
    GVariant ** out_info,
2216
    GAsyncResult *res,
2217
    GError **error)
2218
0
{
2219
0
  GVariant *_ret;
2220
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2221
0
  if (_ret == NULL)
2222
0
    goto _out;
2223
0
  g_variant_get (_ret,
2224
0
                 "(@a{sv})",
2225
0
                 out_info);
2226
0
  g_variant_unref (_ret);
2227
0
_out:
2228
0
  return _ret != NULL;
2229
0
}
2230
2231
/**
2232
 * r_installer_call_inspect_bundle_sync:
2233
 * @proxy: A #RInstallerProxy.
2234
 * @arg_source: Argument to pass with the method invocation.
2235
 * @arg_args: Argument to pass with the method invocation.
2236
 * @out_info: (out) (optional): Return location for return parameter or %NULL to ignore.
2237
 * @cancellable: (nullable): A #GCancellable or %NULL.
2238
 * @error: Return location for error or %NULL.
2239
 *
2240
 * Synchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InspectBundle">InspectBundle()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2241
 *
2242
 * See r_installer_call_inspect_bundle() for the asynchronous version of this method.
2243
 *
2244
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2245
 */
2246
gboolean
2247
r_installer_call_inspect_bundle_sync (
2248
    RInstaller *proxy,
2249
    const gchar *arg_source,
2250
    GVariant *arg_args,
2251
    GVariant ** out_info,
2252
    GCancellable *cancellable,
2253
    GError **error)
2254
0
{
2255
0
  GVariant *_ret;
2256
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2257
0
    "InspectBundle",
2258
0
    g_variant_new ("(s@a{sv})",
2259
0
                   arg_source,
2260
0
                   arg_args),
2261
0
    G_DBUS_CALL_FLAGS_NONE,
2262
0
    -1,
2263
0
    cancellable,
2264
0
    error);
2265
0
  if (_ret == NULL)
2266
0
    goto _out;
2267
0
  g_variant_get (_ret,
2268
0
                 "(@a{sv})",
2269
0
                 out_info);
2270
0
  g_variant_unref (_ret);
2271
0
_out:
2272
0
  return _ret != NULL;
2273
0
}
2274
2275
/**
2276
 * r_installer_call_mark:
2277
 * @proxy: A #RInstallerProxy.
2278
 * @arg_state: Argument to pass with the method invocation.
2279
 * @arg_slot_identifier: Argument to pass with the method invocation.
2280
 * @cancellable: (nullable): A #GCancellable or %NULL.
2281
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2282
 * @user_data: User data to pass to @callback.
2283
 *
2284
 * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Mark">Mark()</link> D-Bus method on @proxy.
2285
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2286
 * You can then call r_installer_call_mark_finish() to get the result of the operation.
2287
 *
2288
 * See r_installer_call_mark_sync() for the synchronous, blocking version of this method.
2289
 */
2290
void
2291
r_installer_call_mark (
2292
    RInstaller *proxy,
2293
    const gchar *arg_state,
2294
    const gchar *arg_slot_identifier,
2295
    GCancellable *cancellable,
2296
    GAsyncReadyCallback callback,
2297
    gpointer user_data)
2298
0
{
2299
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2300
0
    "Mark",
2301
0
    g_variant_new ("(ss)",
2302
0
                   arg_state,
2303
0
                   arg_slot_identifier),
2304
0
    G_DBUS_CALL_FLAGS_NONE,
2305
0
    -1,
2306
0
    cancellable,
2307
0
    callback,
2308
0
    user_data);
2309
0
}
2310
2311
/**
2312
 * r_installer_call_mark_finish:
2313
 * @proxy: A #RInstallerProxy.
2314
 * @out_slot_name: (out) (optional): Return location for return parameter or %NULL to ignore.
2315
 * @out_message: (out) (optional): Return location for return parameter or %NULL to ignore.
2316
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_mark().
2317
 * @error: Return location for error or %NULL.
2318
 *
2319
 * Finishes an operation started with r_installer_call_mark().
2320
 *
2321
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2322
 */
2323
gboolean
2324
r_installer_call_mark_finish (
2325
    RInstaller *proxy,
2326
    gchar ** out_slot_name,
2327
    gchar ** out_message,
2328
    GAsyncResult *res,
2329
    GError **error)
2330
0
{
2331
0
  GVariant *_ret;
2332
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2333
0
  if (_ret == NULL)
2334
0
    goto _out;
2335
0
  g_variant_get (_ret,
2336
0
                 "(ss)",
2337
0
                 out_slot_name,
2338
0
                 out_message);
2339
0
  g_variant_unref (_ret);
2340
0
_out:
2341
0
  return _ret != NULL;
2342
0
}
2343
2344
/**
2345
 * r_installer_call_mark_sync:
2346
 * @proxy: A #RInstallerProxy.
2347
 * @arg_state: Argument to pass with the method invocation.
2348
 * @arg_slot_identifier: Argument to pass with the method invocation.
2349
 * @out_slot_name: (out) (optional): Return location for return parameter or %NULL to ignore.
2350
 * @out_message: (out) (optional): Return location for return parameter or %NULL to ignore.
2351
 * @cancellable: (nullable): A #GCancellable or %NULL.
2352
 * @error: Return location for error or %NULL.
2353
 *
2354
 * Synchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Mark">Mark()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2355
 *
2356
 * See r_installer_call_mark() for the asynchronous version of this method.
2357
 *
2358
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2359
 */
2360
gboolean
2361
r_installer_call_mark_sync (
2362
    RInstaller *proxy,
2363
    const gchar *arg_state,
2364
    const gchar *arg_slot_identifier,
2365
    gchar ** out_slot_name,
2366
    gchar ** out_message,
2367
    GCancellable *cancellable,
2368
    GError **error)
2369
0
{
2370
0
  GVariant *_ret;
2371
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2372
0
    "Mark",
2373
0
    g_variant_new ("(ss)",
2374
0
                   arg_state,
2375
0
                   arg_slot_identifier),
2376
0
    G_DBUS_CALL_FLAGS_NONE,
2377
0
    -1,
2378
0
    cancellable,
2379
0
    error);
2380
0
  if (_ret == NULL)
2381
0
    goto _out;
2382
0
  g_variant_get (_ret,
2383
0
                 "(ss)",
2384
0
                 out_slot_name,
2385
0
                 out_message);
2386
0
  g_variant_unref (_ret);
2387
0
_out:
2388
0
  return _ret != NULL;
2389
0
}
2390
2391
/**
2392
 * r_installer_call_get_slot_status:
2393
 * @proxy: A #RInstallerProxy.
2394
 * @cancellable: (nullable): A #GCancellable or %NULL.
2395
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2396
 * @user_data: User data to pass to @callback.
2397
 *
2398
 * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetSlotStatus">GetSlotStatus()</link> D-Bus method on @proxy.
2399
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2400
 * You can then call r_installer_call_get_slot_status_finish() to get the result of the operation.
2401
 *
2402
 * See r_installer_call_get_slot_status_sync() for the synchronous, blocking version of this method.
2403
 */
2404
void
2405
r_installer_call_get_slot_status (
2406
    RInstaller *proxy,
2407
    GCancellable *cancellable,
2408
    GAsyncReadyCallback callback,
2409
    gpointer user_data)
2410
0
{
2411
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2412
0
    "GetSlotStatus",
2413
0
    g_variant_new ("()"),
2414
0
    G_DBUS_CALL_FLAGS_NONE,
2415
0
    -1,
2416
0
    cancellable,
2417
0
    callback,
2418
0
    user_data);
2419
0
}
2420
2421
/**
2422
 * r_installer_call_get_slot_status_finish:
2423
 * @proxy: A #RInstallerProxy.
2424
 * @out_slot_status_array: (out) (optional): Return location for return parameter or %NULL to ignore.
2425
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_get_slot_status().
2426
 * @error: Return location for error or %NULL.
2427
 *
2428
 * Finishes an operation started with r_installer_call_get_slot_status().
2429
 *
2430
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2431
 */
2432
gboolean
2433
r_installer_call_get_slot_status_finish (
2434
    RInstaller *proxy,
2435
    GVariant ** out_slot_status_array,
2436
    GAsyncResult *res,
2437
    GError **error)
2438
0
{
2439
0
  GVariant *_ret;
2440
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2441
0
  if (_ret == NULL)
2442
0
    goto _out;
2443
0
  g_variant_get (_ret,
2444
0
                 "(@a(sa{sv}))",
2445
0
                 out_slot_status_array);
2446
0
  g_variant_unref (_ret);
2447
0
_out:
2448
0
  return _ret != NULL;
2449
0
}
2450
2451
/**
2452
 * r_installer_call_get_slot_status_sync:
2453
 * @proxy: A #RInstallerProxy.
2454
 * @out_slot_status_array: (out) (optional): Return location for return parameter or %NULL to ignore.
2455
 * @cancellable: (nullable): A #GCancellable or %NULL.
2456
 * @error: Return location for error or %NULL.
2457
 *
2458
 * Synchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetSlotStatus">GetSlotStatus()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2459
 *
2460
 * See r_installer_call_get_slot_status() for the asynchronous version of this method.
2461
 *
2462
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2463
 */
2464
gboolean
2465
r_installer_call_get_slot_status_sync (
2466
    RInstaller *proxy,
2467
    GVariant ** out_slot_status_array,
2468
    GCancellable *cancellable,
2469
    GError **error)
2470
0
{
2471
0
  GVariant *_ret;
2472
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2473
0
    "GetSlotStatus",
2474
0
    g_variant_new ("()"),
2475
0
    G_DBUS_CALL_FLAGS_NONE,
2476
0
    -1,
2477
0
    cancellable,
2478
0
    error);
2479
0
  if (_ret == NULL)
2480
0
    goto _out;
2481
0
  g_variant_get (_ret,
2482
0
                 "(@a(sa{sv}))",
2483
0
                 out_slot_status_array);
2484
0
  g_variant_unref (_ret);
2485
0
_out:
2486
0
  return _ret != NULL;
2487
0
}
2488
2489
/**
2490
 * r_installer_call_get_artifact_status:
2491
 * @proxy: A #RInstallerProxy.
2492
 * @cancellable: (nullable): A #GCancellable or %NULL.
2493
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2494
 * @user_data: User data to pass to @callback.
2495
 *
2496
 * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetArtifactStatus">GetArtifactStatus()</link> D-Bus method on @proxy.
2497
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2498
 * You can then call r_installer_call_get_artifact_status_finish() to get the result of the operation.
2499
 *
2500
 * See r_installer_call_get_artifact_status_sync() for the synchronous, blocking version of this method.
2501
 */
2502
void
2503
r_installer_call_get_artifact_status (
2504
    RInstaller *proxy,
2505
    GCancellable *cancellable,
2506
    GAsyncReadyCallback callback,
2507
    gpointer user_data)
2508
0
{
2509
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2510
0
    "GetArtifactStatus",
2511
0
    g_variant_new ("()"),
2512
0
    G_DBUS_CALL_FLAGS_NONE,
2513
0
    -1,
2514
0
    cancellable,
2515
0
    callback,
2516
0
    user_data);
2517
0
}
2518
2519
/**
2520
 * r_installer_call_get_artifact_status_finish:
2521
 * @proxy: A #RInstallerProxy.
2522
 * @out_artifacts: (out) (optional): Return location for return parameter or %NULL to ignore.
2523
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_get_artifact_status().
2524
 * @error: Return location for error or %NULL.
2525
 *
2526
 * Finishes an operation started with r_installer_call_get_artifact_status().
2527
 *
2528
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2529
 */
2530
gboolean
2531
r_installer_call_get_artifact_status_finish (
2532
    RInstaller *proxy,
2533
    GVariant ** out_artifacts,
2534
    GAsyncResult *res,
2535
    GError **error)
2536
0
{
2537
0
  GVariant *_ret;
2538
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2539
0
  if (_ret == NULL)
2540
0
    goto _out;
2541
0
  g_variant_get (_ret,
2542
0
                 "(@aa{sv})",
2543
0
                 out_artifacts);
2544
0
  g_variant_unref (_ret);
2545
0
_out:
2546
0
  return _ret != NULL;
2547
0
}
2548
2549
/**
2550
 * r_installer_call_get_artifact_status_sync:
2551
 * @proxy: A #RInstallerProxy.
2552
 * @out_artifacts: (out) (optional): Return location for return parameter or %NULL to ignore.
2553
 * @cancellable: (nullable): A #GCancellable or %NULL.
2554
 * @error: Return location for error or %NULL.
2555
 *
2556
 * Synchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetArtifactStatus">GetArtifactStatus()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2557
 *
2558
 * See r_installer_call_get_artifact_status() for the asynchronous version of this method.
2559
 *
2560
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2561
 */
2562
gboolean
2563
r_installer_call_get_artifact_status_sync (
2564
    RInstaller *proxy,
2565
    GVariant ** out_artifacts,
2566
    GCancellable *cancellable,
2567
    GError **error)
2568
0
{
2569
0
  GVariant *_ret;
2570
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2571
0
    "GetArtifactStatus",
2572
0
    g_variant_new ("()"),
2573
0
    G_DBUS_CALL_FLAGS_NONE,
2574
0
    -1,
2575
0
    cancellable,
2576
0
    error);
2577
0
  if (_ret == NULL)
2578
0
    goto _out;
2579
0
  g_variant_get (_ret,
2580
0
                 "(@aa{sv})",
2581
0
                 out_artifacts);
2582
0
  g_variant_unref (_ret);
2583
0
_out:
2584
0
  return _ret != NULL;
2585
0
}
2586
2587
/**
2588
 * r_installer_call_get_primary:
2589
 * @proxy: A #RInstallerProxy.
2590
 * @cancellable: (nullable): A #GCancellable or %NULL.
2591
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2592
 * @user_data: User data to pass to @callback.
2593
 *
2594
 * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetPrimary">GetPrimary()</link> D-Bus method on @proxy.
2595
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2596
 * You can then call r_installer_call_get_primary_finish() to get the result of the operation.
2597
 *
2598
 * See r_installer_call_get_primary_sync() for the synchronous, blocking version of this method.
2599
 */
2600
void
2601
r_installer_call_get_primary (
2602
    RInstaller *proxy,
2603
    GCancellable *cancellable,
2604
    GAsyncReadyCallback callback,
2605
    gpointer user_data)
2606
0
{
2607
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2608
0
    "GetPrimary",
2609
0
    g_variant_new ("()"),
2610
0
    G_DBUS_CALL_FLAGS_NONE,
2611
0
    -1,
2612
0
    cancellable,
2613
0
    callback,
2614
0
    user_data);
2615
0
}
2616
2617
/**
2618
 * r_installer_call_get_primary_finish:
2619
 * @proxy: A #RInstallerProxy.
2620
 * @out_primary: (out) (optional): Return location for return parameter or %NULL to ignore.
2621
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_get_primary().
2622
 * @error: Return location for error or %NULL.
2623
 *
2624
 * Finishes an operation started with r_installer_call_get_primary().
2625
 *
2626
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2627
 */
2628
gboolean
2629
r_installer_call_get_primary_finish (
2630
    RInstaller *proxy,
2631
    gchar ** out_primary,
2632
    GAsyncResult *res,
2633
    GError **error)
2634
0
{
2635
0
  GVariant *_ret;
2636
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2637
0
  if (_ret == NULL)
2638
0
    goto _out;
2639
0
  g_variant_get (_ret,
2640
0
                 "(s)",
2641
0
                 out_primary);
2642
0
  g_variant_unref (_ret);
2643
0
_out:
2644
0
  return _ret != NULL;
2645
0
}
2646
2647
/**
2648
 * r_installer_call_get_primary_sync:
2649
 * @proxy: A #RInstallerProxy.
2650
 * @out_primary: (out) (optional): Return location for return parameter or %NULL to ignore.
2651
 * @cancellable: (nullable): A #GCancellable or %NULL.
2652
 * @error: Return location for error or %NULL.
2653
 *
2654
 * Synchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetPrimary">GetPrimary()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2655
 *
2656
 * See r_installer_call_get_primary() for the asynchronous version of this method.
2657
 *
2658
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2659
 */
2660
gboolean
2661
r_installer_call_get_primary_sync (
2662
    RInstaller *proxy,
2663
    gchar ** out_primary,
2664
    GCancellable *cancellable,
2665
    GError **error)
2666
0
{
2667
0
  GVariant *_ret;
2668
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2669
0
    "GetPrimary",
2670
0
    g_variant_new ("()"),
2671
0
    G_DBUS_CALL_FLAGS_NONE,
2672
0
    -1,
2673
0
    cancellable,
2674
0
    error);
2675
0
  if (_ret == NULL)
2676
0
    goto _out;
2677
0
  g_variant_get (_ret,
2678
0
                 "(s)",
2679
0
                 out_primary);
2680
0
  g_variant_unref (_ret);
2681
0
_out:
2682
0
  return _ret != NULL;
2683
0
}
2684
2685
/**
2686
 * r_installer_complete_install:
2687
 * @object: A #RInstaller.
2688
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2689
 *
2690
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Install">Install()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2691
 *
2692
 * This method will free @invocation, you cannot use it afterwards.
2693
 */
2694
void
2695
r_installer_complete_install (
2696
    RInstaller *object G_GNUC_UNUSED,
2697
    GDBusMethodInvocation *invocation)
2698
0
{
2699
0
  g_dbus_method_invocation_return_value (invocation,
2700
0
    g_variant_new ("()"));
2701
0
}
2702
2703
/**
2704
 * r_installer_complete_install_bundle:
2705
 * @object: A #RInstaller.
2706
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2707
 *
2708
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InstallBundle">InstallBundle()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2709
 *
2710
 * This method will free @invocation, you cannot use it afterwards.
2711
 */
2712
void
2713
r_installer_complete_install_bundle (
2714
    RInstaller *object G_GNUC_UNUSED,
2715
    GDBusMethodInvocation *invocation)
2716
0
{
2717
0
  g_dbus_method_invocation_return_value (invocation,
2718
0
    g_variant_new ("()"));
2719
0
}
2720
2721
/**
2722
 * r_installer_complete_info:
2723
 * @object: A #RInstaller.
2724
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2725
 * @compatible: Parameter to return.
2726
 * @version: Parameter to return.
2727
 *
2728
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Info">Info()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2729
 *
2730
 * This method will free @invocation, you cannot use it afterwards.
2731
 */
2732
void
2733
r_installer_complete_info (
2734
    RInstaller *object G_GNUC_UNUSED,
2735
    GDBusMethodInvocation *invocation,
2736
    const gchar *compatible,
2737
    const gchar *version)
2738
0
{
2739
0
  g_dbus_method_invocation_return_value (invocation,
2740
0
    g_variant_new ("(ss)",
2741
0
                   compatible,
2742
0
                   version));
2743
0
}
2744
2745
/**
2746
 * r_installer_complete_inspect_bundle:
2747
 * @object: A #RInstaller.
2748
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2749
 * @info: Parameter to return.
2750
 *
2751
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InspectBundle">InspectBundle()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2752
 *
2753
 * This method will free @invocation, you cannot use it afterwards.
2754
 */
2755
void
2756
r_installer_complete_inspect_bundle (
2757
    RInstaller *object G_GNUC_UNUSED,
2758
    GDBusMethodInvocation *invocation,
2759
    GVariant *info)
2760
0
{
2761
0
  g_dbus_method_invocation_return_value (invocation,
2762
0
    g_variant_new ("(@a{sv})",
2763
0
                   info));
2764
0
}
2765
2766
/**
2767
 * r_installer_complete_mark:
2768
 * @object: A #RInstaller.
2769
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2770
 * @slot_name: Parameter to return.
2771
 * @message: Parameter to return.
2772
 *
2773
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Mark">Mark()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2774
 *
2775
 * This method will free @invocation, you cannot use it afterwards.
2776
 */
2777
void
2778
r_installer_complete_mark (
2779
    RInstaller *object G_GNUC_UNUSED,
2780
    GDBusMethodInvocation *invocation,
2781
    const gchar *slot_name,
2782
    const gchar *message)
2783
0
{
2784
0
  g_dbus_method_invocation_return_value (invocation,
2785
0
    g_variant_new ("(ss)",
2786
0
                   slot_name,
2787
0
                   message));
2788
0
}
2789
2790
/**
2791
 * r_installer_complete_get_slot_status:
2792
 * @object: A #RInstaller.
2793
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2794
 * @slot_status_array: Parameter to return.
2795
 *
2796
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetSlotStatus">GetSlotStatus()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2797
 *
2798
 * This method will free @invocation, you cannot use it afterwards.
2799
 */
2800
void
2801
r_installer_complete_get_slot_status (
2802
    RInstaller *object G_GNUC_UNUSED,
2803
    GDBusMethodInvocation *invocation,
2804
    GVariant *slot_status_array)
2805
0
{
2806
0
  g_dbus_method_invocation_return_value (invocation,
2807
0
    g_variant_new ("(@a(sa{sv}))",
2808
0
                   slot_status_array));
2809
0
}
2810
2811
/**
2812
 * r_installer_complete_get_artifact_status:
2813
 * @object: A #RInstaller.
2814
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2815
 * @artifacts: Parameter to return.
2816
 *
2817
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetArtifactStatus">GetArtifactStatus()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2818
 *
2819
 * This method will free @invocation, you cannot use it afterwards.
2820
 */
2821
void
2822
r_installer_complete_get_artifact_status (
2823
    RInstaller *object G_GNUC_UNUSED,
2824
    GDBusMethodInvocation *invocation,
2825
    GVariant *artifacts)
2826
0
{
2827
0
  g_dbus_method_invocation_return_value (invocation,
2828
0
    g_variant_new ("(@aa{sv})",
2829
0
                   artifacts));
2830
0
}
2831
2832
/**
2833
 * r_installer_complete_get_primary:
2834
 * @object: A #RInstaller.
2835
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2836
 * @primary: Parameter to return.
2837
 *
2838
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetPrimary">GetPrimary()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2839
 *
2840
 * This method will free @invocation, you cannot use it afterwards.
2841
 */
2842
void
2843
r_installer_complete_get_primary (
2844
    RInstaller *object G_GNUC_UNUSED,
2845
    GDBusMethodInvocation *invocation,
2846
    const gchar *primary)
2847
0
{
2848
0
  g_dbus_method_invocation_return_value (invocation,
2849
0
    g_variant_new ("(s)",
2850
0
                   primary));
2851
0
}
2852
2853
/* ------------------------------------------------------------------------ */
2854
2855
/**
2856
 * RInstallerProxy:
2857
 *
2858
 * The #RInstallerProxy structure contains only private data and should only be accessed using the provided API.
2859
 */
2860
2861
/**
2862
 * RInstallerProxyClass:
2863
 * @parent_class: The parent class.
2864
 *
2865
 * Class structure for #RInstallerProxy.
2866
 */
2867
2868
struct _RInstallerProxyPrivate
2869
{
2870
  GData *qdata;
2871
};
2872
2873
static void r_installer_proxy_iface_init (RInstallerIface *iface);
2874
2875
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2876
0
G_DEFINE_TYPE_WITH_CODE (RInstallerProxy, r_installer_proxy, G_TYPE_DBUS_PROXY,
2877
0
                         G_ADD_PRIVATE (RInstallerProxy)
2878
0
                         G_IMPLEMENT_INTERFACE (R_TYPE_INSTALLER, r_installer_proxy_iface_init))
2879
0
2880
0
#else
2881
0
G_DEFINE_TYPE_WITH_CODE (RInstallerProxy, r_installer_proxy, G_TYPE_DBUS_PROXY,
2882
0
                         G_IMPLEMENT_INTERFACE (R_TYPE_INSTALLER, r_installer_proxy_iface_init))
2883
0
2884
0
#endif
2885
0
static void
2886
0
r_installer_proxy_finalize (GObject *object)
2887
0
{
2888
0
  RInstallerProxy *proxy = R_INSTALLER_PROXY (object);
2889
0
  g_datalist_clear (&proxy->priv->qdata);
2890
0
  G_OBJECT_CLASS (r_installer_proxy_parent_class)->finalize (object);
2891
0
}
2892
2893
static void
2894
r_installer_proxy_get_property (GObject      *object,
2895
  guint         prop_id,
2896
  GValue       *value,
2897
  GParamSpec   *pspec G_GNUC_UNUSED)
2898
0
{
2899
0
  const _ExtendedGDBusPropertyInfo *info;
2900
0
  GVariant *variant;
2901
0
  g_assert (prop_id != 0 && prop_id - 1 < 7);
2902
0
  info = (const _ExtendedGDBusPropertyInfo *) _r_installer_property_info_pointers[prop_id - 1];
2903
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
2904
0
  if (info->use_gvariant)
2905
0
    {
2906
0
      g_value_set_variant (value, variant);
2907
0
    }
2908
0
  else
2909
0
    {
2910
0
      if (variant != NULL)
2911
0
        g_dbus_gvariant_to_gvalue (variant, value);
2912
0
    }
2913
0
  if (variant != NULL)
2914
0
    g_variant_unref (variant);
2915
0
}
2916
2917
static void
2918
r_installer_proxy_set_property_cb (GDBusProxy *proxy,
2919
  GAsyncResult *res,
2920
  gpointer      user_data)
2921
0
{
2922
0
  const _ExtendedGDBusPropertyInfo *info = user_data;
2923
0
  GError *error;
2924
0
  GVariant *_ret;
2925
0
  error = NULL;
2926
0
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
2927
0
  if (!_ret)
2928
0
    {
2929
0
      g_warning ("Error setting property '%s' on interface de.pengutronix.rauc.Installer: %s (%s, %d)",
2930
0
                 info->parent_struct.name, 
2931
0
                 error->message, g_quark_to_string (error->domain), error->code);
2932
0
      g_error_free (error);
2933
0
    }
2934
0
  else
2935
0
    {
2936
0
      g_variant_unref (_ret);
2937
0
    }
2938
0
}
2939
2940
static void
2941
r_installer_proxy_set_property (GObject      *object,
2942
  guint         prop_id,
2943
  const GValue *value,
2944
  GParamSpec   *pspec G_GNUC_UNUSED)
2945
0
{
2946
0
  const _ExtendedGDBusPropertyInfo *info;
2947
0
  GVariant *variant;
2948
0
  g_assert (prop_id != 0 && prop_id - 1 < 7);
2949
0
  info = (const _ExtendedGDBusPropertyInfo *) _r_installer_property_info_pointers[prop_id - 1];
2950
0
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
2951
0
  g_dbus_proxy_call (G_DBUS_PROXY (object),
2952
0
    "org.freedesktop.DBus.Properties.Set",
2953
0
    g_variant_new ("(ssv)", "de.pengutronix.rauc.Installer", info->parent_struct.name, variant),
2954
0
    G_DBUS_CALL_FLAGS_NONE,
2955
0
    -1,
2956
0
    NULL, (GAsyncReadyCallback) r_installer_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
2957
0
  g_variant_unref (variant);
2958
0
}
2959
2960
static void
2961
r_installer_proxy_g_signal (GDBusProxy *proxy,
2962
  const gchar *sender_name G_GNUC_UNUSED,
2963
  const gchar *signal_name,
2964
  GVariant *parameters)
2965
0
{
2966
0
  _ExtendedGDBusSignalInfo *info;
2967
0
  GVariantIter iter;
2968
0
  GVariant *child;
2969
0
  GValue *paramv;
2970
0
  gsize num_params;
2971
0
  gsize n;
2972
0
  guint signal_id;
2973
0
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct, signal_name);
2974
0
  if (info == NULL)
2975
0
    return;
2976
0
  num_params = g_variant_n_children (parameters);
2977
0
  paramv = g_new0 (GValue, num_params + 1);
2978
0
  g_value_init (&paramv[0], R_TYPE_INSTALLER);
2979
0
  g_value_set_object (&paramv[0], proxy);
2980
0
  g_variant_iter_init (&iter, parameters);
2981
0
  n = 1;
2982
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
2983
0
    {
2984
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
2985
0
      if (arg_info->use_gvariant)
2986
0
        {
2987
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
2988
0
          g_value_set_variant (&paramv[n], child);
2989
0
          n++;
2990
0
        }
2991
0
      else
2992
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
2993
0
      g_variant_unref (child);
2994
0
    }
2995
0
  signal_id = g_signal_lookup (info->signal_name, R_TYPE_INSTALLER);
2996
0
  g_signal_emitv (paramv, signal_id, 0, NULL);
2997
0
  for (n = 0; n < num_params + 1; n++)
2998
0
    g_value_unset (&paramv[n]);
2999
0
  g_free (paramv);
3000
0
}
3001
3002
static void
3003
r_installer_proxy_g_properties_changed (GDBusProxy *_proxy,
3004
  GVariant *changed_properties,
3005
  const gchar *const *invalidated_properties)
3006
0
{
3007
0
  RInstallerProxy *proxy = R_INSTALLER_PROXY (_proxy);
3008
0
  guint n;
3009
0
  const gchar *key;
3010
0
  GVariantIter *iter;
3011
0
  _ExtendedGDBusPropertyInfo *info;
3012
0
  g_variant_get (changed_properties, "a{sv}", &iter);
3013
0
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
3014
0
    {
3015
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct, key);
3016
0
      g_datalist_remove_data (&proxy->priv->qdata, key);
3017
0
      if (info != NULL)
3018
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
3019
0
    }
3020
0
  g_variant_iter_free (iter);
3021
0
  for (n = 0; invalidated_properties[n] != NULL; n++)
3022
0
    {
3023
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct, invalidated_properties[n]);
3024
0
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
3025
0
      if (info != NULL)
3026
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
3027
0
    }
3028
0
}
3029
3030
static const gchar *
3031
r_installer_proxy_get_operation (RInstaller *object)
3032
0
{
3033
0
  RInstallerProxy *proxy = R_INSTALLER_PROXY (object);
3034
0
  GVariant *variant;
3035
0
  const gchar *value = NULL;
3036
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Operation");
3037
0
  if (variant != NULL)
3038
0
    {
3039
0
      value = g_variant_get_string (variant, NULL);
3040
0
      g_variant_unref (variant);
3041
0
    }
3042
0
  return value;
3043
0
}
3044
3045
static const gchar *
3046
r_installer_proxy_get_last_error (RInstaller *object)
3047
0
{
3048
0
  RInstallerProxy *proxy = R_INSTALLER_PROXY (object);
3049
0
  GVariant *variant;
3050
0
  const gchar *value = NULL;
3051
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "LastError");
3052
0
  if (variant != NULL)
3053
0
    {
3054
0
      value = g_variant_get_string (variant, NULL);
3055
0
      g_variant_unref (variant);
3056
0
    }
3057
0
  return value;
3058
0
}
3059
3060
static GVariant *
3061
r_installer_proxy_get_progress (RInstaller *object)
3062
0
{
3063
0
  RInstallerProxy *proxy = R_INSTALLER_PROXY (object);
3064
0
  GVariant *variant;
3065
0
  GVariant *value = NULL;
3066
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Progress");
3067
0
  value = variant;
3068
0
  if (variant != NULL)
3069
0
    g_variant_unref (variant);
3070
0
  return value;
3071
0
}
3072
3073
static const gchar *
3074
r_installer_proxy_get_compatible (RInstaller *object)
3075
0
{
3076
0
  RInstallerProxy *proxy = R_INSTALLER_PROXY (object);
3077
0
  GVariant *variant;
3078
0
  const gchar *value = NULL;
3079
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Compatible");
3080
0
  if (variant != NULL)
3081
0
    {
3082
0
      value = g_variant_get_string (variant, NULL);
3083
0
      g_variant_unref (variant);
3084
0
    }
3085
0
  return value;
3086
0
}
3087
3088
static const gchar *
3089
r_installer_proxy_get_variant (RInstaller *object)
3090
0
{
3091
0
  RInstallerProxy *proxy = R_INSTALLER_PROXY (object);
3092
0
  GVariant *variant;
3093
0
  const gchar *value = NULL;
3094
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Variant");
3095
0
  if (variant != NULL)
3096
0
    {
3097
0
      value = g_variant_get_string (variant, NULL);
3098
0
      g_variant_unref (variant);
3099
0
    }
3100
0
  return value;
3101
0
}
3102
3103
static const gchar *
3104
r_installer_proxy_get_system_version (RInstaller *object)
3105
0
{
3106
0
  RInstallerProxy *proxy = R_INSTALLER_PROXY (object);
3107
0
  GVariant *variant;
3108
0
  const gchar *value = NULL;
3109
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "SystemVersion");
3110
0
  if (variant != NULL)
3111
0
    {
3112
0
      value = g_variant_get_string (variant, NULL);
3113
0
      g_variant_unref (variant);
3114
0
    }
3115
0
  return value;
3116
0
}
3117
3118
static const gchar *
3119
r_installer_proxy_get_boot_slot (RInstaller *object)
3120
0
{
3121
0
  RInstallerProxy *proxy = R_INSTALLER_PROXY (object);
3122
0
  GVariant *variant;
3123
0
  const gchar *value = NULL;
3124
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "BootSlot");
3125
0
  if (variant != NULL)
3126
0
    {
3127
0
      value = g_variant_get_string (variant, NULL);
3128
0
      g_variant_unref (variant);
3129
0
    }
3130
0
  return value;
3131
0
}
3132
3133
static void
3134
r_installer_proxy_init (RInstallerProxy *proxy)
3135
0
{
3136
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3137
0
  proxy->priv = r_installer_proxy_get_instance_private (proxy);
3138
#else
3139
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, R_TYPE_INSTALLER_PROXY, RInstallerProxyPrivate);
3140
#endif
3141
3142
0
  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), r_installer_interface_info ());
3143
0
}
3144
3145
static void
3146
r_installer_proxy_class_init (RInstallerProxyClass *klass)
3147
0
{
3148
0
  GObjectClass *gobject_class;
3149
0
  GDBusProxyClass *proxy_class;
3150
3151
0
  gobject_class = G_OBJECT_CLASS (klass);
3152
0
  gobject_class->finalize     = r_installer_proxy_finalize;
3153
0
  gobject_class->get_property = r_installer_proxy_get_property;
3154
0
  gobject_class->set_property = r_installer_proxy_set_property;
3155
3156
0
  proxy_class = G_DBUS_PROXY_CLASS (klass);
3157
0
  proxy_class->g_signal = r_installer_proxy_g_signal;
3158
0
  proxy_class->g_properties_changed = r_installer_proxy_g_properties_changed;
3159
3160
0
  r_installer_override_properties (gobject_class, 1);
3161
3162
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3163
  g_type_class_add_private (klass, sizeof (RInstallerProxyPrivate));
3164
#endif
3165
0
}
3166
3167
static void
3168
r_installer_proxy_iface_init (RInstallerIface *iface)
3169
0
{
3170
0
  iface->get_operation = r_installer_proxy_get_operation;
3171
0
  iface->get_last_error = r_installer_proxy_get_last_error;
3172
0
  iface->get_progress = r_installer_proxy_get_progress;
3173
0
  iface->get_compatible = r_installer_proxy_get_compatible;
3174
0
  iface->get_variant = r_installer_proxy_get_variant;
3175
0
  iface->get_system_version = r_installer_proxy_get_system_version;
3176
0
  iface->get_boot_slot = r_installer_proxy_get_boot_slot;
3177
0
}
3178
3179
/**
3180
 * r_installer_proxy_new:
3181
 * @connection: A #GDBusConnection.
3182
 * @flags: Flags from the #GDBusProxyFlags enumeration.
3183
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3184
 * @object_path: An object path.
3185
 * @cancellable: (nullable): A #GCancellable or %NULL.
3186
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3187
 * @user_data: User data to pass to @callback.
3188
 *
3189
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Installer.top_of_page">de.pengutronix.rauc.Installer</link>. See g_dbus_proxy_new() for more details.
3190
 *
3191
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
3192
 * You can then call r_installer_proxy_new_finish() to get the result of the operation.
3193
 *
3194
 * See r_installer_proxy_new_sync() for the synchronous, blocking version of this constructor.
3195
 */
3196
void
3197
r_installer_proxy_new (
3198
    GDBusConnection     *connection,
3199
    GDBusProxyFlags      flags,
3200
    const gchar         *name,
3201
    const gchar         *object_path,
3202
    GCancellable        *cancellable,
3203
    GAsyncReadyCallback  callback,
3204
    gpointer             user_data)
3205
0
{
3206
0
  g_async_initable_new_async (R_TYPE_INSTALLER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "de.pengutronix.rauc.Installer", NULL);
3207
0
}
3208
3209
/**
3210
 * r_installer_proxy_new_finish:
3211
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_proxy_new().
3212
 * @error: Return location for error or %NULL
3213
 *
3214
 * Finishes an operation started with r_installer_proxy_new().
3215
 *
3216
 * Returns: (transfer full) (type RInstallerProxy): The constructed proxy object or %NULL if @error is set.
3217
 */
3218
RInstaller *
3219
r_installer_proxy_new_finish (
3220
    GAsyncResult        *res,
3221
    GError             **error)
3222
0
{
3223
0
  GObject *ret;
3224
0
  GObject *source_object;
3225
0
  source_object = g_async_result_get_source_object (res);
3226
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3227
0
  g_object_unref (source_object);
3228
0
  if (ret != NULL)
3229
0
    return R_INSTALLER (ret);
3230
0
  else
3231
0
    return NULL;
3232
0
}
3233
3234
/**
3235
 * r_installer_proxy_new_sync:
3236
 * @connection: A #GDBusConnection.
3237
 * @flags: Flags from the #GDBusProxyFlags enumeration.
3238
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3239
 * @object_path: An object path.
3240
 * @cancellable: (nullable): A #GCancellable or %NULL.
3241
 * @error: Return location for error or %NULL
3242
 *
3243
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Installer.top_of_page">de.pengutronix.rauc.Installer</link>. See g_dbus_proxy_new_sync() for more details.
3244
 *
3245
 * The calling thread is blocked until a reply is received.
3246
 *
3247
 * See r_installer_proxy_new() for the asynchronous version of this constructor.
3248
 *
3249
 * Returns: (transfer full) (type RInstallerProxy): The constructed proxy object or %NULL if @error is set.
3250
 */
3251
RInstaller *
3252
r_installer_proxy_new_sync (
3253
    GDBusConnection     *connection,
3254
    GDBusProxyFlags      flags,
3255
    const gchar         *name,
3256
    const gchar         *object_path,
3257
    GCancellable        *cancellable,
3258
    GError             **error)
3259
0
{
3260
0
  GInitable *ret;
3261
0
  ret = g_initable_new (R_TYPE_INSTALLER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "de.pengutronix.rauc.Installer", NULL);
3262
0
  if (ret != NULL)
3263
0
    return R_INSTALLER (ret);
3264
0
  else
3265
0
    return NULL;
3266
0
}
3267
3268
3269
/**
3270
 * r_installer_proxy_new_for_bus:
3271
 * @bus_type: A #GBusType.
3272
 * @flags: Flags from the #GDBusProxyFlags enumeration.
3273
 * @name: A bus name (well-known or unique).
3274
 * @object_path: An object path.
3275
 * @cancellable: (nullable): A #GCancellable or %NULL.
3276
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3277
 * @user_data: User data to pass to @callback.
3278
 *
3279
 * Like r_installer_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
3280
 *
3281
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
3282
 * You can then call r_installer_proxy_new_for_bus_finish() to get the result of the operation.
3283
 *
3284
 * See r_installer_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
3285
 */
3286
void
3287
r_installer_proxy_new_for_bus (
3288
    GBusType             bus_type,
3289
    GDBusProxyFlags      flags,
3290
    const gchar         *name,
3291
    const gchar         *object_path,
3292
    GCancellable        *cancellable,
3293
    GAsyncReadyCallback  callback,
3294
    gpointer             user_data)
3295
0
{
3296
0
  g_async_initable_new_async (R_TYPE_INSTALLER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "de.pengutronix.rauc.Installer", NULL);
3297
0
}
3298
3299
/**
3300
 * r_installer_proxy_new_for_bus_finish:
3301
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_proxy_new_for_bus().
3302
 * @error: Return location for error or %NULL
3303
 *
3304
 * Finishes an operation started with r_installer_proxy_new_for_bus().
3305
 *
3306
 * Returns: (transfer full) (type RInstallerProxy): The constructed proxy object or %NULL if @error is set.
3307
 */
3308
RInstaller *
3309
r_installer_proxy_new_for_bus_finish (
3310
    GAsyncResult        *res,
3311
    GError             **error)
3312
0
{
3313
0
  GObject *ret;
3314
0
  GObject *source_object;
3315
0
  source_object = g_async_result_get_source_object (res);
3316
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3317
0
  g_object_unref (source_object);
3318
0
  if (ret != NULL)
3319
0
    return R_INSTALLER (ret);
3320
0
  else
3321
0
    return NULL;
3322
0
}
3323
3324
/**
3325
 * r_installer_proxy_new_for_bus_sync:
3326
 * @bus_type: A #GBusType.
3327
 * @flags: Flags from the #GDBusProxyFlags enumeration.
3328
 * @name: A bus name (well-known or unique).
3329
 * @object_path: An object path.
3330
 * @cancellable: (nullable): A #GCancellable or %NULL.
3331
 * @error: Return location for error or %NULL
3332
 *
3333
 * Like r_installer_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
3334
 *
3335
 * The calling thread is blocked until a reply is received.
3336
 *
3337
 * See r_installer_proxy_new_for_bus() for the asynchronous version of this constructor.
3338
 *
3339
 * Returns: (transfer full) (type RInstallerProxy): The constructed proxy object or %NULL if @error is set.
3340
 */
3341
RInstaller *
3342
r_installer_proxy_new_for_bus_sync (
3343
    GBusType             bus_type,
3344
    GDBusProxyFlags      flags,
3345
    const gchar         *name,
3346
    const gchar         *object_path,
3347
    GCancellable        *cancellable,
3348
    GError             **error)
3349
0
{
3350
0
  GInitable *ret;
3351
0
  ret = g_initable_new (R_TYPE_INSTALLER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "de.pengutronix.rauc.Installer", NULL);
3352
0
  if (ret != NULL)
3353
0
    return R_INSTALLER (ret);
3354
0
  else
3355
0
    return NULL;
3356
0
}
3357
3358
3359
/* ------------------------------------------------------------------------ */
3360
3361
/**
3362
 * RInstallerSkeleton:
3363
 *
3364
 * The #RInstallerSkeleton structure contains only private data and should only be accessed using the provided API.
3365
 */
3366
3367
/**
3368
 * RInstallerSkeletonClass:
3369
 * @parent_class: The parent class.
3370
 *
3371
 * Class structure for #RInstallerSkeleton.
3372
 */
3373
3374
struct _RInstallerSkeletonPrivate
3375
{
3376
  GValue *properties;
3377
  GList *changed_properties;
3378
  GSource *changed_properties_idle_source;
3379
  GMainContext *context;
3380
  GMutex lock;
3381
};
3382
3383
static void
3384
_r_installer_skeleton_handle_method_call (
3385
  GDBusConnection *connection G_GNUC_UNUSED,
3386
  const gchar *sender G_GNUC_UNUSED,
3387
  const gchar *object_path G_GNUC_UNUSED,
3388
  const gchar *interface_name,
3389
  const gchar *method_name,
3390
  GVariant *parameters,
3391
  GDBusMethodInvocation *invocation,
3392
  gpointer user_data)
3393
0
{
3394
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (user_data);
3395
0
  _ExtendedGDBusMethodInfo *info;
3396
0
  GVariantIter iter;
3397
0
  GVariant *child;
3398
0
  GValue *paramv;
3399
0
  gsize num_params;
3400
0
  guint num_extra;
3401
0
  gsize n;
3402
0
  guint signal_id;
3403
0
  GValue return_value = G_VALUE_INIT;
3404
0
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
3405
0
  g_assert (info != NULL);
3406
0
  num_params = g_variant_n_children (parameters);
3407
0
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
3408
0
  n = 0;
3409
0
  g_value_init (&paramv[n], R_TYPE_INSTALLER);
3410
0
  g_value_set_object (&paramv[n++], skeleton);
3411
0
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
3412
0
  g_value_set_object (&paramv[n++], invocation);
3413
0
  if (info->pass_fdlist)
3414
0
    {
3415
0
#ifdef G_OS_UNIX
3416
0
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
3417
0
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
3418
#else
3419
      g_assert_not_reached ();
3420
#endif
3421
0
    }
3422
0
  g_variant_iter_init (&iter, parameters);
3423
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
3424
0
    {
3425
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
3426
0
      if (arg_info->use_gvariant)
3427
0
        {
3428
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
3429
0
          g_value_set_variant (&paramv[n], child);
3430
0
          n++;
3431
0
        }
3432
0
      else
3433
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
3434
0
      g_variant_unref (child);
3435
0
    }
3436
0
  signal_id = g_signal_lookup (info->signal_name, R_TYPE_INSTALLER);
3437
0
  g_value_init (&return_value, G_TYPE_BOOLEAN);
3438
0
  g_signal_emitv (paramv, signal_id, 0, &return_value);
3439
0
  if (!g_value_get_boolean (&return_value))
3440
0
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
3441
0
  g_value_unset (&return_value);
3442
0
  for (n = 0; n < num_params + num_extra; n++)
3443
0
    g_value_unset (&paramv[n]);
3444
0
  g_free (paramv);
3445
0
}
3446
3447
static GVariant *
3448
_r_installer_skeleton_handle_get_property (
3449
  GDBusConnection *connection G_GNUC_UNUSED,
3450
  const gchar *sender G_GNUC_UNUSED,
3451
  const gchar *object_path G_GNUC_UNUSED,
3452
  const gchar *interface_name G_GNUC_UNUSED,
3453
  const gchar *property_name,
3454
  GError **error,
3455
  gpointer user_data)
3456
0
{
3457
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (user_data);
3458
0
  GValue value = G_VALUE_INIT;
3459
0
  GParamSpec *pspec;
3460
0
  _ExtendedGDBusPropertyInfo *info;
3461
0
  GVariant *ret;
3462
0
  ret = NULL;
3463
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct, property_name);
3464
0
  g_assert (info != NULL);
3465
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
3466
0
  if (pspec == NULL)
3467
0
    {
3468
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
3469
0
    }
3470
0
  else
3471
0
    {
3472
0
      g_value_init (&value, pspec->value_type);
3473
0
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
3474
0
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
3475
0
      g_value_unset (&value);
3476
0
    }
3477
0
  return ret;
3478
0
}
3479
3480
static gboolean
3481
_r_installer_skeleton_handle_set_property (
3482
  GDBusConnection *connection G_GNUC_UNUSED,
3483
  const gchar *sender G_GNUC_UNUSED,
3484
  const gchar *object_path G_GNUC_UNUSED,
3485
  const gchar *interface_name G_GNUC_UNUSED,
3486
  const gchar *property_name,
3487
  GVariant *variant,
3488
  GError **error,
3489
  gpointer user_data)
3490
0
{
3491
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (user_data);
3492
0
  GValue value = G_VALUE_INIT;
3493
0
  GParamSpec *pspec;
3494
0
  _ExtendedGDBusPropertyInfo *info;
3495
0
  gboolean ret;
3496
0
  ret = FALSE;
3497
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct, property_name);
3498
0
  g_assert (info != NULL);
3499
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
3500
0
  if (pspec == NULL)
3501
0
    {
3502
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
3503
0
    }
3504
0
  else
3505
0
    {
3506
0
      if (info->use_gvariant)
3507
0
        g_value_set_variant (&value, variant);
3508
0
      else
3509
0
        g_dbus_gvariant_to_gvalue (variant, &value);
3510
0
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
3511
0
      g_value_unset (&value);
3512
0
      ret = TRUE;
3513
0
    }
3514
0
  return ret;
3515
0
}
3516
3517
static const GDBusInterfaceVTable _r_installer_skeleton_vtable =
3518
{
3519
  _r_installer_skeleton_handle_method_call,
3520
  _r_installer_skeleton_handle_get_property,
3521
  _r_installer_skeleton_handle_set_property,
3522
  {NULL}
3523
};
3524
3525
static GDBusInterfaceInfo *
3526
r_installer_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
3527
0
{
3528
0
  return r_installer_interface_info ();
3529
0
}
3530
3531
static GDBusInterfaceVTable *
3532
r_installer_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
3533
0
{
3534
0
  return (GDBusInterfaceVTable *) &_r_installer_skeleton_vtable;
3535
0
}
3536
3537
static GVariant *
3538
r_installer_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
3539
0
{
3540
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (_skeleton);
3541
3542
0
  GVariantBuilder builder;
3543
0
  guint n;
3544
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84
3545
  g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
3546
#else
3547
0
  g_variant_builder_init(&builder, G_VARIANT_TYPE ("a{sv}"));
3548
0
#endif
3549
0
  if (_r_installer_interface_info.parent_struct.properties == NULL)
3550
0
    goto out;
3551
0
  for (n = 0; _r_installer_interface_info.parent_struct.properties[n] != NULL; n++)
3552
0
    {
3553
0
      GDBusPropertyInfo *info = _r_installer_interface_info.parent_struct.properties[n];
3554
0
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
3555
0
        {
3556
0
          GVariant *value;
3557
0
          value = _r_installer_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "de.pengutronix.rauc.Installer", info->name, NULL, skeleton);
3558
0
          if (value != NULL)
3559
0
            {
3560
0
              g_variant_take_ref (value);
3561
0
              g_variant_builder_add (&builder, "{sv}", info->name, value);
3562
0
              g_variant_unref (value);
3563
0
            }
3564
0
        }
3565
0
    }
3566
0
out:
3567
0
  return g_variant_builder_end (&builder);
3568
0
}
3569
3570
static gboolean _r_installer_emit_changed (gpointer user_data);
3571
3572
static void
3573
r_installer_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
3574
0
{
3575
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (_skeleton);
3576
0
  gboolean emit_changed = FALSE;
3577
3578
0
  g_mutex_lock (&skeleton->priv->lock);
3579
0
  if (skeleton->priv->changed_properties_idle_source != NULL)
3580
0
    {
3581
0
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
3582
0
      skeleton->priv->changed_properties_idle_source = NULL;
3583
0
      emit_changed = TRUE;
3584
0
    }
3585
0
  g_mutex_unlock (&skeleton->priv->lock);
3586
3587
0
  if (emit_changed)
3588
0
    _r_installer_emit_changed (skeleton);
3589
0
}
3590
3591
static void
3592
_r_installer_on_signal_completed (
3593
    RInstaller *object,
3594
    gint arg_result)
3595
0
{
3596
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3597
3598
0
  GList      *connections, *l;
3599
0
  GVariant   *signal_variant;
3600
0
  connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
3601
3602
0
  signal_variant = g_variant_ref_sink (g_variant_new ("(i)",
3603
0
                   arg_result));
3604
0
  for (l = connections; l != NULL; l = l->next)
3605
0
    {
3606
0
      GDBusConnection *connection = l->data;
3607
0
      g_dbus_connection_emit_signal (connection,
3608
0
        NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "de.pengutronix.rauc.Installer", "Completed",
3609
0
        signal_variant, NULL);
3610
0
    }
3611
0
  g_variant_unref (signal_variant);
3612
0
  g_list_free_full (connections, g_object_unref);
3613
0
}
3614
3615
static void r_installer_skeleton_iface_init (RInstallerIface *iface);
3616
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3617
0
G_DEFINE_TYPE_WITH_CODE (RInstallerSkeleton, r_installer_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
3618
0
                         G_ADD_PRIVATE (RInstallerSkeleton)
3619
0
                         G_IMPLEMENT_INTERFACE (R_TYPE_INSTALLER, r_installer_skeleton_iface_init))
3620
0
3621
0
#else
3622
0
G_DEFINE_TYPE_WITH_CODE (RInstallerSkeleton, r_installer_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
3623
0
                         G_IMPLEMENT_INTERFACE (R_TYPE_INSTALLER, r_installer_skeleton_iface_init))
3624
0
3625
0
#endif
3626
0
static void
3627
0
r_installer_skeleton_finalize (GObject *object)
3628
0
{
3629
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3630
0
  guint n;
3631
0
  for (n = 0; n < 7; n++)
3632
0
    g_value_unset (&skeleton->priv->properties[n]);
3633
0
  g_free (skeleton->priv->properties);
3634
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
3635
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3636
  /* coverity[missing_lock : SUPPRESS] */
3637
0
  g_clear_pointer (&skeleton->priv->changed_properties_idle_source, g_source_destroy);
3638
#else
3639
  if (skeleton->priv->changed_properties_idle_source != NULL)
3640
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
3641
skeleton->priv->changed_properties_idle_source = NULL;
3642
#endif
3643
0
  g_main_context_unref (skeleton->priv->context);
3644
0
  g_mutex_clear (&skeleton->priv->lock);
3645
0
  G_OBJECT_CLASS (r_installer_skeleton_parent_class)->finalize (object);
3646
0
}
3647
3648
static void
3649
r_installer_skeleton_get_property (GObject      *object,
3650
  guint         prop_id,
3651
  GValue       *value,
3652
  GParamSpec   *pspec G_GNUC_UNUSED)
3653
0
{
3654
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3655
0
  g_assert (prop_id != 0 && prop_id - 1 < 7);
3656
0
  g_mutex_lock (&skeleton->priv->lock);
3657
0
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
3658
0
  g_mutex_unlock (&skeleton->priv->lock);
3659
0
}
3660
3661
static gboolean
3662
_r_installer_emit_changed (gpointer user_data)
3663
0
{
3664
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (user_data);
3665
0
  GList *l;
3666
0
  GVariantBuilder builder;
3667
0
  GVariantBuilder invalidated_builder;
3668
0
  guint num_changes;
3669
3670
0
  g_mutex_lock (&skeleton->priv->lock);
3671
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84
3672
  g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
3673
  g_variant_builder_init_static (&invalidated_builder, G_VARIANT_TYPE ("as"));
3674
#else
3675
0
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
3676
0
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
3677
0
#endif
3678
0
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
3679
0
    {
3680
0
      ChangedProperty *cp = l->data;
3681
0
      GVariant *variant;
3682
0
      const GValue *cur_value;
3683
3684
0
      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
3685
0
      if (!_g_value_equal (cur_value, &cp->orig_value))
3686
0
        {
3687
0
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
3688
0
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
3689
0
          g_variant_unref (variant);
3690
0
          num_changes++;
3691
0
        }
3692
0
    }
3693
0
  if (num_changes > 0)
3694
0
    {
3695
0
      GList *connections, *ll;
3696
0
      GVariant *signal_variant;
3697
0
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "de.pengutronix.rauc.Installer",
3698
0
                                           &builder, &invalidated_builder));
3699
0
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
3700
0
      for (ll = connections; ll != NULL; ll = ll->next)
3701
0
        {
3702
0
          GDBusConnection *connection = ll->data;
3703
3704
0
          g_dbus_connection_emit_signal (connection,
3705
0
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
3706
0
                                         "org.freedesktop.DBus.Properties",
3707
0
                                         "PropertiesChanged",
3708
0
                                         signal_variant,
3709
0
                                         NULL);
3710
0
        }
3711
0
      g_variant_unref (signal_variant);
3712
0
      g_list_free_full (connections, g_object_unref);
3713
0
    }
3714
0
  else
3715
0
    {
3716
0
      g_variant_builder_clear (&builder);
3717
0
      g_variant_builder_clear (&invalidated_builder);
3718
0
    }
3719
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
3720
0
  skeleton->priv->changed_properties = NULL;
3721
0
  skeleton->priv->changed_properties_idle_source = NULL;
3722
0
  g_mutex_unlock (&skeleton->priv->lock);
3723
0
  return FALSE;
3724
0
}
3725
3726
static void
3727
_r_installer_schedule_emit_changed (RInstallerSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
3728
0
{
3729
0
  ChangedProperty *cp;
3730
0
  GList *l;
3731
0
  cp = NULL;
3732
0
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
3733
0
    {
3734
0
      ChangedProperty *i_cp = l->data;
3735
0
      if (i_cp->info == info)
3736
0
        {
3737
0
          cp = i_cp;
3738
0
          break;
3739
0
        }
3740
0
    }
3741
0
  if (cp == NULL)
3742
0
    {
3743
0
      cp = g_new0 (ChangedProperty, 1);
3744
0
      cp->prop_id = prop_id;
3745
0
      cp->info = info;
3746
0
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
3747
0
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
3748
0
      g_value_copy (orig_value, &cp->orig_value);
3749
0
    }
3750
0
}
3751
3752
static void
3753
r_installer_skeleton_notify (GObject      *object,
3754
  GParamSpec *pspec G_GNUC_UNUSED)
3755
0
{
3756
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3757
0
  g_mutex_lock (&skeleton->priv->lock);
3758
0
  if (skeleton->priv->changed_properties != NULL &&
3759
0
      skeleton->priv->changed_properties_idle_source == NULL)
3760
0
    {
3761
0
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
3762
0
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
3763
0
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _r_installer_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
3764
0
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _r_installer_emit_changed");
3765
0
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
3766
0
      g_source_unref (skeleton->priv->changed_properties_idle_source);
3767
0
    }
3768
0
  g_mutex_unlock (&skeleton->priv->lock);
3769
0
}
3770
3771
static void
3772
r_installer_skeleton_set_property (GObject      *object,
3773
  guint         prop_id,
3774
  const GValue *value,
3775
  GParamSpec   *pspec)
3776
0
{
3777
0
  const _ExtendedGDBusPropertyInfo *info;
3778
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3779
0
  g_assert (prop_id != 0 && prop_id - 1 < 7);
3780
0
  info = (const _ExtendedGDBusPropertyInfo *) _r_installer_property_info_pointers[prop_id - 1];
3781
0
  g_mutex_lock (&skeleton->priv->lock);
3782
0
  g_object_freeze_notify (object);
3783
0
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
3784
0
    {
3785
0
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
3786
0
          info->emits_changed_signal)
3787
0
        _r_installer_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
3788
0
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
3789
0
      g_object_notify_by_pspec (object, pspec);
3790
0
    }
3791
0
  g_mutex_unlock (&skeleton->priv->lock);
3792
0
  g_object_thaw_notify (object);
3793
0
}
3794
3795
static void
3796
r_installer_skeleton_init (RInstallerSkeleton *skeleton)
3797
0
{
3798
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3799
0
  skeleton->priv = r_installer_skeleton_get_instance_private (skeleton);
3800
#else
3801
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, R_TYPE_INSTALLER_SKELETON, RInstallerSkeletonPrivate);
3802
#endif
3803
3804
0
  g_mutex_init (&skeleton->priv->lock);
3805
0
  skeleton->priv->context = g_main_context_ref_thread_default ();
3806
0
  skeleton->priv->properties = g_new0 (GValue, 7);
3807
0
  g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
3808
0
  g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING);
3809
0
  g_value_init (&skeleton->priv->properties[2], G_TYPE_VARIANT);
3810
0
  g_value_init (&skeleton->priv->properties[3], G_TYPE_STRING);
3811
0
  g_value_init (&skeleton->priv->properties[4], G_TYPE_STRING);
3812
0
  g_value_init (&skeleton->priv->properties[5], G_TYPE_STRING);
3813
0
  g_value_init (&skeleton->priv->properties[6], G_TYPE_STRING);
3814
0
}
3815
3816
static const gchar *
3817
r_installer_skeleton_get_operation (RInstaller *object)
3818
0
{
3819
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3820
0
  const gchar *value;
3821
0
  g_mutex_lock (&skeleton->priv->lock);
3822
0
  value = g_marshal_value_peek_string (&(skeleton->priv->properties[0]));
3823
0
  g_mutex_unlock (&skeleton->priv->lock);
3824
0
  return value;
3825
0
}
3826
3827
static const gchar *
3828
r_installer_skeleton_get_last_error (RInstaller *object)
3829
0
{
3830
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3831
0
  const gchar *value;
3832
0
  g_mutex_lock (&skeleton->priv->lock);
3833
0
  value = g_marshal_value_peek_string (&(skeleton->priv->properties[1]));
3834
0
  g_mutex_unlock (&skeleton->priv->lock);
3835
0
  return value;
3836
0
}
3837
3838
static GVariant *
3839
r_installer_skeleton_get_progress (RInstaller *object)
3840
0
{
3841
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3842
0
  GVariant *value;
3843
0
  g_mutex_lock (&skeleton->priv->lock);
3844
0
  value = g_marshal_value_peek_variant (&(skeleton->priv->properties[2]));
3845
0
  g_mutex_unlock (&skeleton->priv->lock);
3846
0
  return value;
3847
0
}
3848
3849
static const gchar *
3850
r_installer_skeleton_get_compatible (RInstaller *object)
3851
0
{
3852
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3853
0
  const gchar *value;
3854
0
  g_mutex_lock (&skeleton->priv->lock);
3855
0
  value = g_marshal_value_peek_string (&(skeleton->priv->properties[3]));
3856
0
  g_mutex_unlock (&skeleton->priv->lock);
3857
0
  return value;
3858
0
}
3859
3860
static const gchar *
3861
r_installer_skeleton_get_variant (RInstaller *object)
3862
0
{
3863
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3864
0
  const gchar *value;
3865
0
  g_mutex_lock (&skeleton->priv->lock);
3866
0
  value = g_marshal_value_peek_string (&(skeleton->priv->properties[4]));
3867
0
  g_mutex_unlock (&skeleton->priv->lock);
3868
0
  return value;
3869
0
}
3870
3871
static const gchar *
3872
r_installer_skeleton_get_system_version (RInstaller *object)
3873
0
{
3874
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3875
0
  const gchar *value;
3876
0
  g_mutex_lock (&skeleton->priv->lock);
3877
0
  value = g_marshal_value_peek_string (&(skeleton->priv->properties[5]));
3878
0
  g_mutex_unlock (&skeleton->priv->lock);
3879
0
  return value;
3880
0
}
3881
3882
static const gchar *
3883
r_installer_skeleton_get_boot_slot (RInstaller *object)
3884
0
{
3885
0
  RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object);
3886
0
  const gchar *value;
3887
0
  g_mutex_lock (&skeleton->priv->lock);
3888
0
  value = g_marshal_value_peek_string (&(skeleton->priv->properties[6]));
3889
0
  g_mutex_unlock (&skeleton->priv->lock);
3890
0
  return value;
3891
0
}
3892
3893
static void
3894
r_installer_skeleton_class_init (RInstallerSkeletonClass *klass)
3895
0
{
3896
0
  GObjectClass *gobject_class;
3897
0
  GDBusInterfaceSkeletonClass *skeleton_class;
3898
3899
0
  gobject_class = G_OBJECT_CLASS (klass);
3900
0
  gobject_class->finalize = r_installer_skeleton_finalize;
3901
0
  gobject_class->get_property = r_installer_skeleton_get_property;
3902
0
  gobject_class->set_property = r_installer_skeleton_set_property;
3903
0
  gobject_class->notify       = r_installer_skeleton_notify;
3904
3905
3906
0
  r_installer_override_properties (gobject_class, 1);
3907
3908
0
  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
3909
0
  skeleton_class->get_info = r_installer_skeleton_dbus_interface_get_info;
3910
0
  skeleton_class->get_properties = r_installer_skeleton_dbus_interface_get_properties;
3911
0
  skeleton_class->flush = r_installer_skeleton_dbus_interface_flush;
3912
0
  skeleton_class->get_vtable = r_installer_skeleton_dbus_interface_get_vtable;
3913
3914
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3915
  g_type_class_add_private (klass, sizeof (RInstallerSkeletonPrivate));
3916
#endif
3917
0
}
3918
3919
static void
3920
r_installer_skeleton_iface_init (RInstallerIface *iface)
3921
0
{
3922
0
  iface->completed = _r_installer_on_signal_completed;
3923
0
  iface->get_operation = r_installer_skeleton_get_operation;
3924
0
  iface->get_last_error = r_installer_skeleton_get_last_error;
3925
0
  iface->get_progress = r_installer_skeleton_get_progress;
3926
0
  iface->get_compatible = r_installer_skeleton_get_compatible;
3927
0
  iface->get_variant = r_installer_skeleton_get_variant;
3928
0
  iface->get_system_version = r_installer_skeleton_get_system_version;
3929
0
  iface->get_boot_slot = r_installer_skeleton_get_boot_slot;
3930
0
}
3931
3932
/**
3933
 * r_installer_skeleton_new:
3934
 *
3935
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Installer.top_of_page">de.pengutronix.rauc.Installer</link>.
3936
 *
3937
 * Returns: (transfer full) (type RInstallerSkeleton): The skeleton object.
3938
 */
3939
RInstaller *
3940
r_installer_skeleton_new (void)
3941
0
{
3942
0
  return R_INSTALLER (g_object_new (R_TYPE_INSTALLER_SKELETON, NULL));
3943
0
}
3944
3945
/* ------------------------------------------------------------------------
3946
 * Code for interface de.pengutronix.rauc.Poller
3947
 * ------------------------------------------------------------------------
3948
 */
3949
3950
/**
3951
 * SECTION:RPoller
3952
 * @title: RPoller
3953
 * @short_description: Generated C code for the de.pengutronix.rauc.Poller D-Bus interface
3954
 *
3955
 * This section contains code for working with the <link linkend="gdbus-interface-de-pengutronix-rauc-Poller.top_of_page">de.pengutronix.rauc.Poller</link> D-Bus interface in C.
3956
 */
3957
3958
/* ---- Introspection data for de.pengutronix.rauc.Poller ---- */
3959
3960
static const _ExtendedGDBusMethodInfo _r_poller_method_info_poll =
3961
{
3962
  {
3963
    -1,
3964
    (gchar *) "Poll",
3965
    NULL,
3966
    NULL,
3967
    NULL
3968
  },
3969
  "handle-poll",
3970
  FALSE
3971
};
3972
3973
static const GDBusMethodInfo * const _r_poller_method_info_pointers[] =
3974
{
3975
  &_r_poller_method_info_poll.parent_struct,
3976
  NULL
3977
};
3978
3979
static const _ExtendedGDBusPropertyInfo _r_poller_property_info_next_poll =
3980
{
3981
  {
3982
    -1,
3983
    (gchar *) "NextPoll",
3984
    (gchar *) "x",
3985
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3986
    NULL
3987
  },
3988
  "next-poll",
3989
  FALSE,
3990
  TRUE
3991
};
3992
3993
static const _ExtendedGDBusPropertyInfo _r_poller_property_info_status =
3994
{
3995
  {
3996
    -1,
3997
    (gchar *) "Status",
3998
    (gchar *) "a{sv}",
3999
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
4000
    NULL
4001
  },
4002
  "status",
4003
  FALSE,
4004
  TRUE
4005
};
4006
4007
static const GDBusPropertyInfo * const _r_poller_property_info_pointers[] =
4008
{
4009
  &_r_poller_property_info_next_poll.parent_struct,
4010
  &_r_poller_property_info_status.parent_struct,
4011
  NULL
4012
};
4013
4014
static const _ExtendedGDBusInterfaceInfo _r_poller_interface_info =
4015
{
4016
  {
4017
    -1,
4018
    (gchar *) "de.pengutronix.rauc.Poller",
4019
    (GDBusMethodInfo **) &_r_poller_method_info_pointers,
4020
    NULL,
4021
    (GDBusPropertyInfo **) &_r_poller_property_info_pointers,
4022
    NULL
4023
  },
4024
  "poller",
4025
};
4026
4027
4028
/**
4029
 * r_poller_interface_info:
4030
 *
4031
 * Gets a machine-readable description of the <link linkend="gdbus-interface-de-pengutronix-rauc-Poller.top_of_page">de.pengutronix.rauc.Poller</link> D-Bus interface.
4032
 *
4033
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
4034
 */
4035
GDBusInterfaceInfo *
4036
r_poller_interface_info (void)
4037
0
{
4038
0
  return (GDBusInterfaceInfo *) &_r_poller_interface_info.parent_struct;
4039
0
}
4040
4041
/**
4042
 * r_poller_override_properties:
4043
 * @klass: The class structure for a #GObject derived class.
4044
 * @property_id_begin: The property id to assign to the first overridden property.
4045
 *
4046
 * Overrides all #GObject properties in the #RPoller interface for a concrete class.
4047
 * The properties are overridden in the order they are defined.
4048
 *
4049
 * Returns: The last property id.
4050
 */
4051
guint
4052
r_poller_override_properties (GObjectClass *klass, guint property_id_begin)
4053
0
{
4054
0
  g_object_class_override_property (klass, property_id_begin++, "next-poll");
4055
0
  g_object_class_override_property (klass, property_id_begin++, "status");
4056
0
  return property_id_begin - 1;
4057
0
}
4058
4059
4060
inline static void
4061
r_poller_method_marshal_poll (
4062
    GClosure     *closure,
4063
    GValue       *return_value,
4064
    unsigned int  n_param_values,
4065
    const GValue *param_values,
4066
    void         *invocation_hint,
4067
    void         *marshal_data)
4068
0
{
4069
0
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
4070
0
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
4071
0
}
4072
4073
4074
/**
4075
 * RPoller:
4076
 *
4077
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Poller.top_of_page">de.pengutronix.rauc.Poller</link>.
4078
 */
4079
4080
/**
4081
 * RPollerIface:
4082
 * @parent_iface: The parent interface.
4083
 * @handle_poll: Handler for the #RPoller::handle-poll signal.
4084
 * @get_next_poll: Getter for the #RPoller:next-poll property.
4085
 * @get_status: Getter for the #RPoller:status property.
4086
 *
4087
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Poller.top_of_page">de.pengutronix.rauc.Poller</link>.
4088
 */
4089
4090
typedef RPollerIface RPollerInterface;
4091
0
G_DEFINE_INTERFACE (RPoller, r_poller, G_TYPE_OBJECT)
4092
0
4093
0
static void
4094
0
r_poller_default_init (RPollerIface *iface)
4095
0
{
4096
  /* GObject signals for incoming D-Bus method calls: */
4097
  /**
4098
   * RPoller::handle-poll:
4099
   * @object: A #RPoller.
4100
   * @invocation: A #GDBusMethodInvocation.
4101
   *
4102
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Poller.Poll">Poll()</link> D-Bus method.
4103
   *
4104
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call r_poller_complete_poll() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
4105
   *
4106
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
4107
   */
4108
0
  g_signal_new ("handle-poll",
4109
0
    G_TYPE_FROM_INTERFACE (iface),
4110
0
    G_SIGNAL_RUN_LAST,
4111
0
    G_STRUCT_OFFSET (RPollerIface, handle_poll),
4112
0
    g_signal_accumulator_true_handled,
4113
0
    NULL,
4114
0
      r_poller_method_marshal_poll,
4115
0
    G_TYPE_BOOLEAN,
4116
0
    1,
4117
0
    G_TYPE_DBUS_METHOD_INVOCATION);
4118
4119
  /* GObject properties for D-Bus properties: */
4120
  /**
4121
   * RPoller:next-poll:
4122
   *
4123
   * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Poller.NextPoll">"NextPoll"</link>.
4124
   *
4125
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
4126
   */
4127
0
  g_object_interface_install_property (iface,
4128
0
    g_param_spec_int64 ("next-poll", "NextPoll", "NextPoll", G_MININT64, G_MAXINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4129
  /**
4130
   * RPoller:status:
4131
   *
4132
   * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Poller.Status">"Status"</link>.
4133
   *
4134
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
4135
   */
4136
0
  g_object_interface_install_property (iface,
4137
0
    g_param_spec_variant ("status", "Status", "Status", G_VARIANT_TYPE ("a{sv}"), NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4138
0
}
4139
4140
/**
4141
 * r_poller_get_next_poll: (skip)
4142
 * @object: A #RPoller.
4143
 *
4144
 * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Poller.NextPoll">"NextPoll"</link> D-Bus property.
4145
 *
4146
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4147
 *
4148
 * Returns: The property value.
4149
 */
4150
gint64 
4151
r_poller_get_next_poll (RPoller *object)
4152
0
{
4153
0
  g_return_val_if_fail (R_IS_POLLER (object), 0);
4154
4155
0
  return R_POLLER_GET_IFACE (object)->get_next_poll (object);
4156
0
}
4157
4158
/**
4159
 * r_poller_set_next_poll: (skip)
4160
 * @object: A #RPoller.
4161
 * @value: The value to set.
4162
 *
4163
 * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Poller.NextPoll">"NextPoll"</link> D-Bus property to @value.
4164
 *
4165
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4166
 */
4167
void
4168
r_poller_set_next_poll (RPoller *object, gint64 value)
4169
0
{
4170
0
  g_object_set (G_OBJECT (object), "next-poll", value, NULL);
4171
0
}
4172
4173
/**
4174
 * r_poller_get_status: (skip)
4175
 * @object: A #RPoller.
4176
 *
4177
 * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Poller.Status">"Status"</link> D-Bus property.
4178
 *
4179
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4180
 *
4181
 * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use r_poller_dup_status() if on another thread.
4182
 *
4183
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4184
 */
4185
GVariant *
4186
r_poller_get_status (RPoller *object)
4187
0
{
4188
0
  g_return_val_if_fail (R_IS_POLLER (object), NULL);
4189
4190
0
  return R_POLLER_GET_IFACE (object)->get_status (object);
4191
0
}
4192
4193
/**
4194
 * r_poller_dup_status: (skip)
4195
 * @object: A #RPoller.
4196
 *
4197
 * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Poller.Status">"Status"</link> D-Bus property.
4198
 *
4199
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4200
 *
4201
 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref().
4202
 */
4203
GVariant *
4204
r_poller_dup_status (RPoller *object)
4205
0
{
4206
0
  GVariant *value;
4207
0
  g_object_get (G_OBJECT (object), "status", &value, NULL);
4208
0
  return value;
4209
0
}
4210
4211
/**
4212
 * r_poller_set_status: (skip)
4213
 * @object: A #RPoller.
4214
 * @value: The value to set.
4215
 *
4216
 * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Poller.Status">"Status"</link> D-Bus property to @value.
4217
 *
4218
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4219
 */
4220
void
4221
r_poller_set_status (RPoller *object, GVariant *value)
4222
0
{
4223
0
  g_object_set (G_OBJECT (object), "status", value, NULL);
4224
0
}
4225
4226
/**
4227
 * r_poller_call_poll:
4228
 * @proxy: A #RPollerProxy.
4229
 * @cancellable: (nullable): A #GCancellable or %NULL.
4230
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
4231
 * @user_data: User data to pass to @callback.
4232
 *
4233
 * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Poller.Poll">Poll()</link> D-Bus method on @proxy.
4234
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
4235
 * You can then call r_poller_call_poll_finish() to get the result of the operation.
4236
 *
4237
 * See r_poller_call_poll_sync() for the synchronous, blocking version of this method.
4238
 */
4239
void
4240
r_poller_call_poll (
4241
    RPoller *proxy,
4242
    GCancellable *cancellable,
4243
    GAsyncReadyCallback callback,
4244
    gpointer user_data)
4245
0
{
4246
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
4247
0
    "Poll",
4248
0
    g_variant_new ("()"),
4249
0
    G_DBUS_CALL_FLAGS_NONE,
4250
0
    -1,
4251
0
    cancellable,
4252
0
    callback,
4253
0
    user_data);
4254
0
}
4255
4256
/**
4257
 * r_poller_call_poll_finish:
4258
 * @proxy: A #RPollerProxy.
4259
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_poller_call_poll().
4260
 * @error: Return location for error or %NULL.
4261
 *
4262
 * Finishes an operation started with r_poller_call_poll().
4263
 *
4264
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
4265
 */
4266
gboolean
4267
r_poller_call_poll_finish (
4268
    RPoller *proxy,
4269
    GAsyncResult *res,
4270
    GError **error)
4271
0
{
4272
0
  GVariant *_ret;
4273
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
4274
0
  if (_ret == NULL)
4275
0
    goto _out;
4276
0
  g_variant_get (_ret,
4277
0
                 "()");
4278
0
  g_variant_unref (_ret);
4279
0
_out:
4280
0
  return _ret != NULL;
4281
0
}
4282
4283
/**
4284
 * r_poller_call_poll_sync:
4285
 * @proxy: A #RPollerProxy.
4286
 * @cancellable: (nullable): A #GCancellable or %NULL.
4287
 * @error: Return location for error or %NULL.
4288
 *
4289
 * Synchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Poller.Poll">Poll()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
4290
 *
4291
 * See r_poller_call_poll() for the asynchronous version of this method.
4292
 *
4293
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
4294
 */
4295
gboolean
4296
r_poller_call_poll_sync (
4297
    RPoller *proxy,
4298
    GCancellable *cancellable,
4299
    GError **error)
4300
0
{
4301
0
  GVariant *_ret;
4302
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
4303
0
    "Poll",
4304
0
    g_variant_new ("()"),
4305
0
    G_DBUS_CALL_FLAGS_NONE,
4306
0
    -1,
4307
0
    cancellable,
4308
0
    error);
4309
0
  if (_ret == NULL)
4310
0
    goto _out;
4311
0
  g_variant_get (_ret,
4312
0
                 "()");
4313
0
  g_variant_unref (_ret);
4314
0
_out:
4315
0
  return _ret != NULL;
4316
0
}
4317
4318
/**
4319
 * r_poller_complete_poll:
4320
 * @object: A #RPoller.
4321
 * @invocation: (transfer full): A #GDBusMethodInvocation.
4322
 *
4323
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-de-pengutronix-rauc-Poller.Poll">Poll()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
4324
 *
4325
 * This method will free @invocation, you cannot use it afterwards.
4326
 */
4327
void
4328
r_poller_complete_poll (
4329
    RPoller *object G_GNUC_UNUSED,
4330
    GDBusMethodInvocation *invocation)
4331
0
{
4332
0
  g_dbus_method_invocation_return_value (invocation,
4333
0
    g_variant_new ("()"));
4334
0
}
4335
4336
/* ------------------------------------------------------------------------ */
4337
4338
/**
4339
 * RPollerProxy:
4340
 *
4341
 * The #RPollerProxy structure contains only private data and should only be accessed using the provided API.
4342
 */
4343
4344
/**
4345
 * RPollerProxyClass:
4346
 * @parent_class: The parent class.
4347
 *
4348
 * Class structure for #RPollerProxy.
4349
 */
4350
4351
struct _RPollerProxyPrivate
4352
{
4353
  GData *qdata;
4354
};
4355
4356
static void r_poller_proxy_iface_init (RPollerIface *iface);
4357
4358
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4359
0
G_DEFINE_TYPE_WITH_CODE (RPollerProxy, r_poller_proxy, G_TYPE_DBUS_PROXY,
4360
0
                         G_ADD_PRIVATE (RPollerProxy)
4361
0
                         G_IMPLEMENT_INTERFACE (R_TYPE_POLLER, r_poller_proxy_iface_init))
4362
0
4363
0
#else
4364
0
G_DEFINE_TYPE_WITH_CODE (RPollerProxy, r_poller_proxy, G_TYPE_DBUS_PROXY,
4365
0
                         G_IMPLEMENT_INTERFACE (R_TYPE_POLLER, r_poller_proxy_iface_init))
4366
0
4367
0
#endif
4368
0
static void
4369
0
r_poller_proxy_finalize (GObject *object)
4370
0
{
4371
0
  RPollerProxy *proxy = R_POLLER_PROXY (object);
4372
0
  g_datalist_clear (&proxy->priv->qdata);
4373
0
  G_OBJECT_CLASS (r_poller_proxy_parent_class)->finalize (object);
4374
0
}
4375
4376
static void
4377
r_poller_proxy_get_property (GObject      *object,
4378
  guint         prop_id,
4379
  GValue       *value,
4380
  GParamSpec   *pspec G_GNUC_UNUSED)
4381
0
{
4382
0
  const _ExtendedGDBusPropertyInfo *info;
4383
0
  GVariant *variant;
4384
0
  g_assert (prop_id != 0 && prop_id - 1 < 2);
4385
0
  info = (const _ExtendedGDBusPropertyInfo *) _r_poller_property_info_pointers[prop_id - 1];
4386
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
4387
0
  if (info->use_gvariant)
4388
0
    {
4389
0
      g_value_set_variant (value, variant);
4390
0
    }
4391
0
  else
4392
0
    {
4393
0
      if (variant != NULL)
4394
0
        g_dbus_gvariant_to_gvalue (variant, value);
4395
0
    }
4396
0
  if (variant != NULL)
4397
0
    g_variant_unref (variant);
4398
0
}
4399
4400
static void
4401
r_poller_proxy_set_property_cb (GDBusProxy *proxy,
4402
  GAsyncResult *res,
4403
  gpointer      user_data)
4404
0
{
4405
0
  const _ExtendedGDBusPropertyInfo *info = user_data;
4406
0
  GError *error;
4407
0
  GVariant *_ret;
4408
0
  error = NULL;
4409
0
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
4410
0
  if (!_ret)
4411
0
    {
4412
0
      g_warning ("Error setting property '%s' on interface de.pengutronix.rauc.Poller: %s (%s, %d)",
4413
0
                 info->parent_struct.name, 
4414
0
                 error->message, g_quark_to_string (error->domain), error->code);
4415
0
      g_error_free (error);
4416
0
    }
4417
0
  else
4418
0
    {
4419
0
      g_variant_unref (_ret);
4420
0
    }
4421
0
}
4422
4423
static void
4424
r_poller_proxy_set_property (GObject      *object,
4425
  guint         prop_id,
4426
  const GValue *value,
4427
  GParamSpec   *pspec G_GNUC_UNUSED)
4428
0
{
4429
0
  const _ExtendedGDBusPropertyInfo *info;
4430
0
  GVariant *variant;
4431
0
  g_assert (prop_id != 0 && prop_id - 1 < 2);
4432
0
  info = (const _ExtendedGDBusPropertyInfo *) _r_poller_property_info_pointers[prop_id - 1];
4433
0
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
4434
0
  g_dbus_proxy_call (G_DBUS_PROXY (object),
4435
0
    "org.freedesktop.DBus.Properties.Set",
4436
0
    g_variant_new ("(ssv)", "de.pengutronix.rauc.Poller", info->parent_struct.name, variant),
4437
0
    G_DBUS_CALL_FLAGS_NONE,
4438
0
    -1,
4439
0
    NULL, (GAsyncReadyCallback) r_poller_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
4440
0
  g_variant_unref (variant);
4441
0
}
4442
4443
static void
4444
r_poller_proxy_g_signal (GDBusProxy *proxy,
4445
  const gchar *sender_name G_GNUC_UNUSED,
4446
  const gchar *signal_name,
4447
  GVariant *parameters)
4448
0
{
4449
0
  _ExtendedGDBusSignalInfo *info;
4450
0
  GVariantIter iter;
4451
0
  GVariant *child;
4452
0
  GValue *paramv;
4453
0
  gsize num_params;
4454
0
  gsize n;
4455
0
  guint signal_id;
4456
0
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_r_poller_interface_info.parent_struct, signal_name);
4457
0
  if (info == NULL)
4458
0
    return;
4459
0
  num_params = g_variant_n_children (parameters);
4460
0
  paramv = g_new0 (GValue, num_params + 1);
4461
0
  g_value_init (&paramv[0], R_TYPE_POLLER);
4462
0
  g_value_set_object (&paramv[0], proxy);
4463
0
  g_variant_iter_init (&iter, parameters);
4464
0
  n = 1;
4465
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
4466
0
    {
4467
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
4468
0
      if (arg_info->use_gvariant)
4469
0
        {
4470
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
4471
0
          g_value_set_variant (&paramv[n], child);
4472
0
          n++;
4473
0
        }
4474
0
      else
4475
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
4476
0
      g_variant_unref (child);
4477
0
    }
4478
0
  signal_id = g_signal_lookup (info->signal_name, R_TYPE_POLLER);
4479
0
  g_signal_emitv (paramv, signal_id, 0, NULL);
4480
0
  for (n = 0; n < num_params + 1; n++)
4481
0
    g_value_unset (&paramv[n]);
4482
0
  g_free (paramv);
4483
0
}
4484
4485
static void
4486
r_poller_proxy_g_properties_changed (GDBusProxy *_proxy,
4487
  GVariant *changed_properties,
4488
  const gchar *const *invalidated_properties)
4489
0
{
4490
0
  RPollerProxy *proxy = R_POLLER_PROXY (_proxy);
4491
0
  guint n;
4492
0
  const gchar *key;
4493
0
  GVariantIter *iter;
4494
0
  _ExtendedGDBusPropertyInfo *info;
4495
0
  g_variant_get (changed_properties, "a{sv}", &iter);
4496
0
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
4497
0
    {
4498
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_poller_interface_info.parent_struct, key);
4499
0
      g_datalist_remove_data (&proxy->priv->qdata, key);
4500
0
      if (info != NULL)
4501
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
4502
0
    }
4503
0
  g_variant_iter_free (iter);
4504
0
  for (n = 0; invalidated_properties[n] != NULL; n++)
4505
0
    {
4506
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_poller_interface_info.parent_struct, invalidated_properties[n]);
4507
0
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
4508
0
      if (info != NULL)
4509
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
4510
0
    }
4511
0
}
4512
4513
static gint64 
4514
r_poller_proxy_get_next_poll (RPoller *object)
4515
0
{
4516
0
  RPollerProxy *proxy = R_POLLER_PROXY (object);
4517
0
  GVariant *variant;
4518
0
  gint64 value = 0;
4519
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "NextPoll");
4520
0
  if (variant != NULL)
4521
0
    {
4522
0
      value = g_variant_get_int64 (variant);
4523
0
      g_variant_unref (variant);
4524
0
    }
4525
0
  return value;
4526
0
}
4527
4528
static GVariant *
4529
r_poller_proxy_get_status (RPoller *object)
4530
0
{
4531
0
  RPollerProxy *proxy = R_POLLER_PROXY (object);
4532
0
  GVariant *variant;
4533
0
  GVariant *value = NULL;
4534
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Status");
4535
0
  value = variant;
4536
0
  if (variant != NULL)
4537
0
    g_variant_unref (variant);
4538
0
  return value;
4539
0
}
4540
4541
static void
4542
r_poller_proxy_init (RPollerProxy *proxy)
4543
0
{
4544
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4545
0
  proxy->priv = r_poller_proxy_get_instance_private (proxy);
4546
#else
4547
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, R_TYPE_POLLER_PROXY, RPollerProxyPrivate);
4548
#endif
4549
4550
0
  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), r_poller_interface_info ());
4551
0
}
4552
4553
static void
4554
r_poller_proxy_class_init (RPollerProxyClass *klass)
4555
0
{
4556
0
  GObjectClass *gobject_class;
4557
0
  GDBusProxyClass *proxy_class;
4558
4559
0
  gobject_class = G_OBJECT_CLASS (klass);
4560
0
  gobject_class->finalize     = r_poller_proxy_finalize;
4561
0
  gobject_class->get_property = r_poller_proxy_get_property;
4562
0
  gobject_class->set_property = r_poller_proxy_set_property;
4563
4564
0
  proxy_class = G_DBUS_PROXY_CLASS (klass);
4565
0
  proxy_class->g_signal = r_poller_proxy_g_signal;
4566
0
  proxy_class->g_properties_changed = r_poller_proxy_g_properties_changed;
4567
4568
0
  r_poller_override_properties (gobject_class, 1);
4569
4570
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
4571
  g_type_class_add_private (klass, sizeof (RPollerProxyPrivate));
4572
#endif
4573
0
}
4574
4575
static void
4576
r_poller_proxy_iface_init (RPollerIface *iface)
4577
0
{
4578
0
  iface->get_next_poll = r_poller_proxy_get_next_poll;
4579
0
  iface->get_status = r_poller_proxy_get_status;
4580
0
}
4581
4582
/**
4583
 * r_poller_proxy_new:
4584
 * @connection: A #GDBusConnection.
4585
 * @flags: Flags from the #GDBusProxyFlags enumeration.
4586
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
4587
 * @object_path: An object path.
4588
 * @cancellable: (nullable): A #GCancellable or %NULL.
4589
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
4590
 * @user_data: User data to pass to @callback.
4591
 *
4592
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Poller.top_of_page">de.pengutronix.rauc.Poller</link>. See g_dbus_proxy_new() for more details.
4593
 *
4594
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
4595
 * You can then call r_poller_proxy_new_finish() to get the result of the operation.
4596
 *
4597
 * See r_poller_proxy_new_sync() for the synchronous, blocking version of this constructor.
4598
 */
4599
void
4600
r_poller_proxy_new (
4601
    GDBusConnection     *connection,
4602
    GDBusProxyFlags      flags,
4603
    const gchar         *name,
4604
    const gchar         *object_path,
4605
    GCancellable        *cancellable,
4606
    GAsyncReadyCallback  callback,
4607
    gpointer             user_data)
4608
0
{
4609
0
  g_async_initable_new_async (R_TYPE_POLLER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "de.pengutronix.rauc.Poller", NULL);
4610
0
}
4611
4612
/**
4613
 * r_poller_proxy_new_finish:
4614
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_poller_proxy_new().
4615
 * @error: Return location for error or %NULL
4616
 *
4617
 * Finishes an operation started with r_poller_proxy_new().
4618
 *
4619
 * Returns: (transfer full) (type RPollerProxy): The constructed proxy object or %NULL if @error is set.
4620
 */
4621
RPoller *
4622
r_poller_proxy_new_finish (
4623
    GAsyncResult        *res,
4624
    GError             **error)
4625
0
{
4626
0
  GObject *ret;
4627
0
  GObject *source_object;
4628
0
  source_object = g_async_result_get_source_object (res);
4629
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
4630
0
  g_object_unref (source_object);
4631
0
  if (ret != NULL)
4632
0
    return R_POLLER (ret);
4633
0
  else
4634
0
    return NULL;
4635
0
}
4636
4637
/**
4638
 * r_poller_proxy_new_sync:
4639
 * @connection: A #GDBusConnection.
4640
 * @flags: Flags from the #GDBusProxyFlags enumeration.
4641
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
4642
 * @object_path: An object path.
4643
 * @cancellable: (nullable): A #GCancellable or %NULL.
4644
 * @error: Return location for error or %NULL
4645
 *
4646
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Poller.top_of_page">de.pengutronix.rauc.Poller</link>. See g_dbus_proxy_new_sync() for more details.
4647
 *
4648
 * The calling thread is blocked until a reply is received.
4649
 *
4650
 * See r_poller_proxy_new() for the asynchronous version of this constructor.
4651
 *
4652
 * Returns: (transfer full) (type RPollerProxy): The constructed proxy object or %NULL if @error is set.
4653
 */
4654
RPoller *
4655
r_poller_proxy_new_sync (
4656
    GDBusConnection     *connection,
4657
    GDBusProxyFlags      flags,
4658
    const gchar         *name,
4659
    const gchar         *object_path,
4660
    GCancellable        *cancellable,
4661
    GError             **error)
4662
0
{
4663
0
  GInitable *ret;
4664
0
  ret = g_initable_new (R_TYPE_POLLER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "de.pengutronix.rauc.Poller", NULL);
4665
0
  if (ret != NULL)
4666
0
    return R_POLLER (ret);
4667
0
  else
4668
0
    return NULL;
4669
0
}
4670
4671
4672
/**
4673
 * r_poller_proxy_new_for_bus:
4674
 * @bus_type: A #GBusType.
4675
 * @flags: Flags from the #GDBusProxyFlags enumeration.
4676
 * @name: A bus name (well-known or unique).
4677
 * @object_path: An object path.
4678
 * @cancellable: (nullable): A #GCancellable or %NULL.
4679
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
4680
 * @user_data: User data to pass to @callback.
4681
 *
4682
 * Like r_poller_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
4683
 *
4684
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
4685
 * You can then call r_poller_proxy_new_for_bus_finish() to get the result of the operation.
4686
 *
4687
 * See r_poller_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
4688
 */
4689
void
4690
r_poller_proxy_new_for_bus (
4691
    GBusType             bus_type,
4692
    GDBusProxyFlags      flags,
4693
    const gchar         *name,
4694
    const gchar         *object_path,
4695
    GCancellable        *cancellable,
4696
    GAsyncReadyCallback  callback,
4697
    gpointer             user_data)
4698
0
{
4699
0
  g_async_initable_new_async (R_TYPE_POLLER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "de.pengutronix.rauc.Poller", NULL);
4700
0
}
4701
4702
/**
4703
 * r_poller_proxy_new_for_bus_finish:
4704
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_poller_proxy_new_for_bus().
4705
 * @error: Return location for error or %NULL
4706
 *
4707
 * Finishes an operation started with r_poller_proxy_new_for_bus().
4708
 *
4709
 * Returns: (transfer full) (type RPollerProxy): The constructed proxy object or %NULL if @error is set.
4710
 */
4711
RPoller *
4712
r_poller_proxy_new_for_bus_finish (
4713
    GAsyncResult        *res,
4714
    GError             **error)
4715
0
{
4716
0
  GObject *ret;
4717
0
  GObject *source_object;
4718
0
  source_object = g_async_result_get_source_object (res);
4719
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
4720
0
  g_object_unref (source_object);
4721
0
  if (ret != NULL)
4722
0
    return R_POLLER (ret);
4723
0
  else
4724
0
    return NULL;
4725
0
}
4726
4727
/**
4728
 * r_poller_proxy_new_for_bus_sync:
4729
 * @bus_type: A #GBusType.
4730
 * @flags: Flags from the #GDBusProxyFlags enumeration.
4731
 * @name: A bus name (well-known or unique).
4732
 * @object_path: An object path.
4733
 * @cancellable: (nullable): A #GCancellable or %NULL.
4734
 * @error: Return location for error or %NULL
4735
 *
4736
 * Like r_poller_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
4737
 *
4738
 * The calling thread is blocked until a reply is received.
4739
 *
4740
 * See r_poller_proxy_new_for_bus() for the asynchronous version of this constructor.
4741
 *
4742
 * Returns: (transfer full) (type RPollerProxy): The constructed proxy object or %NULL if @error is set.
4743
 */
4744
RPoller *
4745
r_poller_proxy_new_for_bus_sync (
4746
    GBusType             bus_type,
4747
    GDBusProxyFlags      flags,
4748
    const gchar         *name,
4749
    const gchar         *object_path,
4750
    GCancellable        *cancellable,
4751
    GError             **error)
4752
0
{
4753
0
  GInitable *ret;
4754
0
  ret = g_initable_new (R_TYPE_POLLER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "de.pengutronix.rauc.Poller", NULL);
4755
0
  if (ret != NULL)
4756
0
    return R_POLLER (ret);
4757
0
  else
4758
0
    return NULL;
4759
0
}
4760
4761
4762
/* ------------------------------------------------------------------------ */
4763
4764
/**
4765
 * RPollerSkeleton:
4766
 *
4767
 * The #RPollerSkeleton structure contains only private data and should only be accessed using the provided API.
4768
 */
4769
4770
/**
4771
 * RPollerSkeletonClass:
4772
 * @parent_class: The parent class.
4773
 *
4774
 * Class structure for #RPollerSkeleton.
4775
 */
4776
4777
struct _RPollerSkeletonPrivate
4778
{
4779
  GValue *properties;
4780
  GList *changed_properties;
4781
  GSource *changed_properties_idle_source;
4782
  GMainContext *context;
4783
  GMutex lock;
4784
};
4785
4786
static void
4787
_r_poller_skeleton_handle_method_call (
4788
  GDBusConnection *connection G_GNUC_UNUSED,
4789
  const gchar *sender G_GNUC_UNUSED,
4790
  const gchar *object_path G_GNUC_UNUSED,
4791
  const gchar *interface_name,
4792
  const gchar *method_name,
4793
  GVariant *parameters,
4794
  GDBusMethodInvocation *invocation,
4795
  gpointer user_data)
4796
0
{
4797
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (user_data);
4798
0
  _ExtendedGDBusMethodInfo *info;
4799
0
  GVariantIter iter;
4800
0
  GVariant *child;
4801
0
  GValue *paramv;
4802
0
  gsize num_params;
4803
0
  guint num_extra;
4804
0
  gsize n;
4805
0
  guint signal_id;
4806
0
  GValue return_value = G_VALUE_INIT;
4807
0
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
4808
0
  g_assert (info != NULL);
4809
0
  num_params = g_variant_n_children (parameters);
4810
0
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
4811
0
  n = 0;
4812
0
  g_value_init (&paramv[n], R_TYPE_POLLER);
4813
0
  g_value_set_object (&paramv[n++], skeleton);
4814
0
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
4815
0
  g_value_set_object (&paramv[n++], invocation);
4816
0
  if (info->pass_fdlist)
4817
0
    {
4818
0
#ifdef G_OS_UNIX
4819
0
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
4820
0
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
4821
#else
4822
      g_assert_not_reached ();
4823
#endif
4824
0
    }
4825
0
  g_variant_iter_init (&iter, parameters);
4826
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
4827
0
    {
4828
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
4829
0
      if (arg_info->use_gvariant)
4830
0
        {
4831
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
4832
0
          g_value_set_variant (&paramv[n], child);
4833
0
          n++;
4834
0
        }
4835
0
      else
4836
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
4837
0
      g_variant_unref (child);
4838
0
    }
4839
0
  signal_id = g_signal_lookup (info->signal_name, R_TYPE_POLLER);
4840
0
  g_value_init (&return_value, G_TYPE_BOOLEAN);
4841
0
  g_signal_emitv (paramv, signal_id, 0, &return_value);
4842
0
  if (!g_value_get_boolean (&return_value))
4843
0
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
4844
0
  g_value_unset (&return_value);
4845
0
  for (n = 0; n < num_params + num_extra; n++)
4846
0
    g_value_unset (&paramv[n]);
4847
0
  g_free (paramv);
4848
0
}
4849
4850
static GVariant *
4851
_r_poller_skeleton_handle_get_property (
4852
  GDBusConnection *connection G_GNUC_UNUSED,
4853
  const gchar *sender G_GNUC_UNUSED,
4854
  const gchar *object_path G_GNUC_UNUSED,
4855
  const gchar *interface_name G_GNUC_UNUSED,
4856
  const gchar *property_name,
4857
  GError **error,
4858
  gpointer user_data)
4859
0
{
4860
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (user_data);
4861
0
  GValue value = G_VALUE_INIT;
4862
0
  GParamSpec *pspec;
4863
0
  _ExtendedGDBusPropertyInfo *info;
4864
0
  GVariant *ret;
4865
0
  ret = NULL;
4866
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_poller_interface_info.parent_struct, property_name);
4867
0
  g_assert (info != NULL);
4868
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
4869
0
  if (pspec == NULL)
4870
0
    {
4871
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
4872
0
    }
4873
0
  else
4874
0
    {
4875
0
      g_value_init (&value, pspec->value_type);
4876
0
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
4877
0
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
4878
0
      g_value_unset (&value);
4879
0
    }
4880
0
  return ret;
4881
0
}
4882
4883
static gboolean
4884
_r_poller_skeleton_handle_set_property (
4885
  GDBusConnection *connection G_GNUC_UNUSED,
4886
  const gchar *sender G_GNUC_UNUSED,
4887
  const gchar *object_path G_GNUC_UNUSED,
4888
  const gchar *interface_name G_GNUC_UNUSED,
4889
  const gchar *property_name,
4890
  GVariant *variant,
4891
  GError **error,
4892
  gpointer user_data)
4893
0
{
4894
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (user_data);
4895
0
  GValue value = G_VALUE_INIT;
4896
0
  GParamSpec *pspec;
4897
0
  _ExtendedGDBusPropertyInfo *info;
4898
0
  gboolean ret;
4899
0
  ret = FALSE;
4900
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_poller_interface_info.parent_struct, property_name);
4901
0
  g_assert (info != NULL);
4902
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
4903
0
  if (pspec == NULL)
4904
0
    {
4905
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
4906
0
    }
4907
0
  else
4908
0
    {
4909
0
      if (info->use_gvariant)
4910
0
        g_value_set_variant (&value, variant);
4911
0
      else
4912
0
        g_dbus_gvariant_to_gvalue (variant, &value);
4913
0
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
4914
0
      g_value_unset (&value);
4915
0
      ret = TRUE;
4916
0
    }
4917
0
  return ret;
4918
0
}
4919
4920
static const GDBusInterfaceVTable _r_poller_skeleton_vtable =
4921
{
4922
  _r_poller_skeleton_handle_method_call,
4923
  _r_poller_skeleton_handle_get_property,
4924
  _r_poller_skeleton_handle_set_property,
4925
  {NULL}
4926
};
4927
4928
static GDBusInterfaceInfo *
4929
r_poller_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
4930
0
{
4931
0
  return r_poller_interface_info ();
4932
0
}
4933
4934
static GDBusInterfaceVTable *
4935
r_poller_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
4936
0
{
4937
0
  return (GDBusInterfaceVTable *) &_r_poller_skeleton_vtable;
4938
0
}
4939
4940
static GVariant *
4941
r_poller_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
4942
0
{
4943
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (_skeleton);
4944
4945
0
  GVariantBuilder builder;
4946
0
  guint n;
4947
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84
4948
  g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
4949
#else
4950
0
  g_variant_builder_init(&builder, G_VARIANT_TYPE ("a{sv}"));
4951
0
#endif
4952
0
  if (_r_poller_interface_info.parent_struct.properties == NULL)
4953
0
    goto out;
4954
0
  for (n = 0; _r_poller_interface_info.parent_struct.properties[n] != NULL; n++)
4955
0
    {
4956
0
      GDBusPropertyInfo *info = _r_poller_interface_info.parent_struct.properties[n];
4957
0
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
4958
0
        {
4959
0
          GVariant *value;
4960
0
          value = _r_poller_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "de.pengutronix.rauc.Poller", info->name, NULL, skeleton);
4961
0
          if (value != NULL)
4962
0
            {
4963
0
              g_variant_take_ref (value);
4964
0
              g_variant_builder_add (&builder, "{sv}", info->name, value);
4965
0
              g_variant_unref (value);
4966
0
            }
4967
0
        }
4968
0
    }
4969
0
out:
4970
0
  return g_variant_builder_end (&builder);
4971
0
}
4972
4973
static gboolean _r_poller_emit_changed (gpointer user_data);
4974
4975
static void
4976
r_poller_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
4977
0
{
4978
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (_skeleton);
4979
0
  gboolean emit_changed = FALSE;
4980
4981
0
  g_mutex_lock (&skeleton->priv->lock);
4982
0
  if (skeleton->priv->changed_properties_idle_source != NULL)
4983
0
    {
4984
0
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
4985
0
      skeleton->priv->changed_properties_idle_source = NULL;
4986
0
      emit_changed = TRUE;
4987
0
    }
4988
0
  g_mutex_unlock (&skeleton->priv->lock);
4989
4990
0
  if (emit_changed)
4991
0
    _r_poller_emit_changed (skeleton);
4992
0
}
4993
4994
static void r_poller_skeleton_iface_init (RPollerIface *iface);
4995
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4996
0
G_DEFINE_TYPE_WITH_CODE (RPollerSkeleton, r_poller_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
4997
0
                         G_ADD_PRIVATE (RPollerSkeleton)
4998
0
                         G_IMPLEMENT_INTERFACE (R_TYPE_POLLER, r_poller_skeleton_iface_init))
4999
0
5000
0
#else
5001
0
G_DEFINE_TYPE_WITH_CODE (RPollerSkeleton, r_poller_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
5002
0
                         G_IMPLEMENT_INTERFACE (R_TYPE_POLLER, r_poller_skeleton_iface_init))
5003
0
5004
0
#endif
5005
0
static void
5006
0
r_poller_skeleton_finalize (GObject *object)
5007
0
{
5008
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (object);
5009
0
  guint n;
5010
0
  for (n = 0; n < 2; n++)
5011
0
    g_value_unset (&skeleton->priv->properties[n]);
5012
0
  g_free (skeleton->priv->properties);
5013
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
5014
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5015
  /* coverity[missing_lock : SUPPRESS] */
5016
0
  g_clear_pointer (&skeleton->priv->changed_properties_idle_source, g_source_destroy);
5017
#else
5018
  if (skeleton->priv->changed_properties_idle_source != NULL)
5019
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
5020
skeleton->priv->changed_properties_idle_source = NULL;
5021
#endif
5022
0
  g_main_context_unref (skeleton->priv->context);
5023
0
  g_mutex_clear (&skeleton->priv->lock);
5024
0
  G_OBJECT_CLASS (r_poller_skeleton_parent_class)->finalize (object);
5025
0
}
5026
5027
static void
5028
r_poller_skeleton_get_property (GObject      *object,
5029
  guint         prop_id,
5030
  GValue       *value,
5031
  GParamSpec   *pspec G_GNUC_UNUSED)
5032
0
{
5033
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (object);
5034
0
  g_assert (prop_id != 0 && prop_id - 1 < 2);
5035
0
  g_mutex_lock (&skeleton->priv->lock);
5036
0
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
5037
0
  g_mutex_unlock (&skeleton->priv->lock);
5038
0
}
5039
5040
static gboolean
5041
_r_poller_emit_changed (gpointer user_data)
5042
0
{
5043
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (user_data);
5044
0
  GList *l;
5045
0
  GVariantBuilder builder;
5046
0
  GVariantBuilder invalidated_builder;
5047
0
  guint num_changes;
5048
5049
0
  g_mutex_lock (&skeleton->priv->lock);
5050
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84
5051
  g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
5052
  g_variant_builder_init_static (&invalidated_builder, G_VARIANT_TYPE ("as"));
5053
#else
5054
0
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
5055
0
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
5056
0
#endif
5057
0
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
5058
0
    {
5059
0
      ChangedProperty *cp = l->data;
5060
0
      GVariant *variant;
5061
0
      const GValue *cur_value;
5062
5063
0
      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
5064
0
      if (!_g_value_equal (cur_value, &cp->orig_value))
5065
0
        {
5066
0
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
5067
0
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
5068
0
          g_variant_unref (variant);
5069
0
          num_changes++;
5070
0
        }
5071
0
    }
5072
0
  if (num_changes > 0)
5073
0
    {
5074
0
      GList *connections, *ll;
5075
0
      GVariant *signal_variant;
5076
0
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "de.pengutronix.rauc.Poller",
5077
0
                                           &builder, &invalidated_builder));
5078
0
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
5079
0
      for (ll = connections; ll != NULL; ll = ll->next)
5080
0
        {
5081
0
          GDBusConnection *connection = ll->data;
5082
5083
0
          g_dbus_connection_emit_signal (connection,
5084
0
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
5085
0
                                         "org.freedesktop.DBus.Properties",
5086
0
                                         "PropertiesChanged",
5087
0
                                         signal_variant,
5088
0
                                         NULL);
5089
0
        }
5090
0
      g_variant_unref (signal_variant);
5091
0
      g_list_free_full (connections, g_object_unref);
5092
0
    }
5093
0
  else
5094
0
    {
5095
0
      g_variant_builder_clear (&builder);
5096
0
      g_variant_builder_clear (&invalidated_builder);
5097
0
    }
5098
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
5099
0
  skeleton->priv->changed_properties = NULL;
5100
0
  skeleton->priv->changed_properties_idle_source = NULL;
5101
0
  g_mutex_unlock (&skeleton->priv->lock);
5102
0
  return FALSE;
5103
0
}
5104
5105
static void
5106
_r_poller_schedule_emit_changed (RPollerSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
5107
0
{
5108
0
  ChangedProperty *cp;
5109
0
  GList *l;
5110
0
  cp = NULL;
5111
0
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
5112
0
    {
5113
0
      ChangedProperty *i_cp = l->data;
5114
0
      if (i_cp->info == info)
5115
0
        {
5116
0
          cp = i_cp;
5117
0
          break;
5118
0
        }
5119
0
    }
5120
0
  if (cp == NULL)
5121
0
    {
5122
0
      cp = g_new0 (ChangedProperty, 1);
5123
0
      cp->prop_id = prop_id;
5124
0
      cp->info = info;
5125
0
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
5126
0
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
5127
0
      g_value_copy (orig_value, &cp->orig_value);
5128
0
    }
5129
0
}
5130
5131
static void
5132
r_poller_skeleton_notify (GObject      *object,
5133
  GParamSpec *pspec G_GNUC_UNUSED)
5134
0
{
5135
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (object);
5136
0
  g_mutex_lock (&skeleton->priv->lock);
5137
0
  if (skeleton->priv->changed_properties != NULL &&
5138
0
      skeleton->priv->changed_properties_idle_source == NULL)
5139
0
    {
5140
0
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
5141
0
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
5142
0
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _r_poller_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
5143
0
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _r_poller_emit_changed");
5144
0
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
5145
0
      g_source_unref (skeleton->priv->changed_properties_idle_source);
5146
0
    }
5147
0
  g_mutex_unlock (&skeleton->priv->lock);
5148
0
}
5149
5150
static void
5151
r_poller_skeleton_set_property (GObject      *object,
5152
  guint         prop_id,
5153
  const GValue *value,
5154
  GParamSpec   *pspec)
5155
0
{
5156
0
  const _ExtendedGDBusPropertyInfo *info;
5157
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (object);
5158
0
  g_assert (prop_id != 0 && prop_id - 1 < 2);
5159
0
  info = (const _ExtendedGDBusPropertyInfo *) _r_poller_property_info_pointers[prop_id - 1];
5160
0
  g_mutex_lock (&skeleton->priv->lock);
5161
0
  g_object_freeze_notify (object);
5162
0
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
5163
0
    {
5164
0
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
5165
0
          info->emits_changed_signal)
5166
0
        _r_poller_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
5167
0
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
5168
0
      g_object_notify_by_pspec (object, pspec);
5169
0
    }
5170
0
  g_mutex_unlock (&skeleton->priv->lock);
5171
0
  g_object_thaw_notify (object);
5172
0
}
5173
5174
static void
5175
r_poller_skeleton_init (RPollerSkeleton *skeleton)
5176
0
{
5177
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5178
0
  skeleton->priv = r_poller_skeleton_get_instance_private (skeleton);
5179
#else
5180
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, R_TYPE_POLLER_SKELETON, RPollerSkeletonPrivate);
5181
#endif
5182
5183
0
  g_mutex_init (&skeleton->priv->lock);
5184
0
  skeleton->priv->context = g_main_context_ref_thread_default ();
5185
0
  skeleton->priv->properties = g_new0 (GValue, 2);
5186
0
  g_value_init (&skeleton->priv->properties[0], G_TYPE_INT64);
5187
0
  g_value_init (&skeleton->priv->properties[1], G_TYPE_VARIANT);
5188
0
}
5189
5190
static gint64 
5191
r_poller_skeleton_get_next_poll (RPoller *object)
5192
0
{
5193
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (object);
5194
0
  gint64 value;
5195
0
  g_mutex_lock (&skeleton->priv->lock);
5196
0
  value = g_marshal_value_peek_int64 (&(skeleton->priv->properties[0]));
5197
0
  g_mutex_unlock (&skeleton->priv->lock);
5198
0
  return value;
5199
0
}
5200
5201
static GVariant *
5202
r_poller_skeleton_get_status (RPoller *object)
5203
0
{
5204
0
  RPollerSkeleton *skeleton = R_POLLER_SKELETON (object);
5205
0
  GVariant *value;
5206
0
  g_mutex_lock (&skeleton->priv->lock);
5207
0
  value = g_marshal_value_peek_variant (&(skeleton->priv->properties[1]));
5208
0
  g_mutex_unlock (&skeleton->priv->lock);
5209
0
  return value;
5210
0
}
5211
5212
static void
5213
r_poller_skeleton_class_init (RPollerSkeletonClass *klass)
5214
0
{
5215
0
  GObjectClass *gobject_class;
5216
0
  GDBusInterfaceSkeletonClass *skeleton_class;
5217
5218
0
  gobject_class = G_OBJECT_CLASS (klass);
5219
0
  gobject_class->finalize = r_poller_skeleton_finalize;
5220
0
  gobject_class->get_property = r_poller_skeleton_get_property;
5221
0
  gobject_class->set_property = r_poller_skeleton_set_property;
5222
0
  gobject_class->notify       = r_poller_skeleton_notify;
5223
5224
5225
0
  r_poller_override_properties (gobject_class, 1);
5226
5227
0
  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
5228
0
  skeleton_class->get_info = r_poller_skeleton_dbus_interface_get_info;
5229
0
  skeleton_class->get_properties = r_poller_skeleton_dbus_interface_get_properties;
5230
0
  skeleton_class->flush = r_poller_skeleton_dbus_interface_flush;
5231
0
  skeleton_class->get_vtable = r_poller_skeleton_dbus_interface_get_vtable;
5232
5233
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
5234
  g_type_class_add_private (klass, sizeof (RPollerSkeletonPrivate));
5235
#endif
5236
0
}
5237
5238
static void
5239
r_poller_skeleton_iface_init (RPollerIface *iface)
5240
0
{
5241
0
  iface->get_next_poll = r_poller_skeleton_get_next_poll;
5242
0
  iface->get_status = r_poller_skeleton_get_status;
5243
0
}
5244
5245
/**
5246
 * r_poller_skeleton_new:
5247
 *
5248
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Poller.top_of_page">de.pengutronix.rauc.Poller</link>.
5249
 *
5250
 * Returns: (transfer full) (type RPollerSkeleton): The skeleton object.
5251
 */
5252
RPoller *
5253
r_poller_skeleton_new (void)
5254
0
{
5255
0
  return R_POLLER (g_object_new (R_TYPE_POLLER_SKELETON, NULL));
5256
0
}
5257