/work/build/rauc-installer-generated.c
Line | Count | Source (jump to first uncovered line) |
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 | | typedef struct |
21 | | { |
22 | | GDBusArgInfo parent_struct; |
23 | | gboolean use_gvariant; |
24 | | } _ExtendedGDBusArgInfo; |
25 | | |
26 | | typedef struct |
27 | | { |
28 | | GDBusMethodInfo parent_struct; |
29 | | const gchar *signal_name; |
30 | | gboolean pass_fdlist; |
31 | | } _ExtendedGDBusMethodInfo; |
32 | | |
33 | | typedef struct |
34 | | { |
35 | | GDBusSignalInfo parent_struct; |
36 | | const gchar *signal_name; |
37 | | } _ExtendedGDBusSignalInfo; |
38 | | |
39 | | typedef struct |
40 | | { |
41 | | GDBusPropertyInfo parent_struct; |
42 | | const gchar *hyphen_name; |
43 | | guint use_gvariant : 1; |
44 | | guint emits_changed_signal : 1; |
45 | | } _ExtendedGDBusPropertyInfo; |
46 | | |
47 | | typedef struct |
48 | | { |
49 | | GDBusInterfaceInfo parent_struct; |
50 | | const gchar *hyphen_name; |
51 | | } _ExtendedGDBusInterfaceInfo; |
52 | | |
53 | | typedef struct |
54 | | { |
55 | | const _ExtendedGDBusPropertyInfo *info; |
56 | | guint prop_id; |
57 | | GValue orig_value; /* the value before the change */ |
58 | | } ChangedProperty; |
59 | | |
60 | | static void |
61 | | _changed_property_free (ChangedProperty *data) |
62 | 0 | { |
63 | 0 | g_value_unset (&data->orig_value); |
64 | 0 | g_free (data); |
65 | 0 | } |
66 | | |
67 | | static gboolean |
68 | | _g_strv_equal0 (gchar **a, gchar **b) |
69 | 0 | { |
70 | 0 | gboolean ret = FALSE; |
71 | 0 | guint n; |
72 | 0 | if (a == NULL && b == NULL) |
73 | 0 | { |
74 | 0 | ret = TRUE; |
75 | 0 | goto out; |
76 | 0 | } |
77 | 0 | if (a == NULL || b == NULL) |
78 | 0 | goto out; |
79 | 0 | if (g_strv_length (a) != g_strv_length (b)) |
80 | 0 | goto out; |
81 | 0 | for (n = 0; a[n] != NULL; n++) |
82 | 0 | if (g_strcmp0 (a[n], b[n]) != 0) |
83 | 0 | goto out; |
84 | 0 | ret = TRUE; |
85 | 0 | out: |
86 | 0 | return ret; |
87 | 0 | } |
88 | | |
89 | | static gboolean |
90 | | _g_variant_equal0 (GVariant *a, GVariant *b) |
91 | 0 | { |
92 | 0 | gboolean ret = FALSE; |
93 | 0 | if (a == NULL && b == NULL) |
94 | 0 | { |
95 | 0 | ret = TRUE; |
96 | 0 | goto out; |
97 | 0 | } |
98 | 0 | if (a == NULL || b == NULL) |
99 | 0 | goto out; |
100 | 0 | ret = g_variant_equal (a, b); |
101 | 0 | out: |
102 | 0 | return ret; |
103 | 0 | } |
104 | | |
105 | | G_GNUC_UNUSED static gboolean |
106 | | _g_value_equal (const GValue *a, const GValue *b) |
107 | 0 | { |
108 | 0 | gboolean ret = FALSE; |
109 | 0 | g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); |
110 | 0 | switch (G_VALUE_TYPE (a)) |
111 | 0 | { |
112 | 0 | case G_TYPE_BOOLEAN: |
113 | 0 | ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); |
114 | 0 | break; |
115 | 0 | case G_TYPE_UCHAR: |
116 | 0 | ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); |
117 | 0 | break; |
118 | 0 | case G_TYPE_INT: |
119 | 0 | ret = (g_value_get_int (a) == g_value_get_int (b)); |
120 | 0 | break; |
121 | 0 | case G_TYPE_UINT: |
122 | 0 | ret = (g_value_get_uint (a) == g_value_get_uint (b)); |
123 | 0 | break; |
124 | 0 | case G_TYPE_INT64: |
125 | 0 | ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); |
126 | 0 | break; |
127 | 0 | case G_TYPE_UINT64: |
128 | 0 | ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); |
129 | 0 | break; |
130 | 0 | case G_TYPE_DOUBLE: |
131 | 0 | { |
132 | | /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ |
133 | 0 | gdouble da = g_value_get_double (a); |
134 | 0 | gdouble db = g_value_get_double (b); |
135 | 0 | ret = memcmp (&da, &db, sizeof (gdouble)) == 0; |
136 | 0 | } |
137 | 0 | break; |
138 | 0 | case G_TYPE_STRING: |
139 | 0 | ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); |
140 | 0 | break; |
141 | 0 | case G_TYPE_VARIANT: |
142 | 0 | ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); |
143 | 0 | break; |
144 | 0 | default: |
145 | 0 | if (G_VALUE_TYPE (a) == G_TYPE_STRV) |
146 | 0 | ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); |
147 | 0 | else |
148 | 0 | g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); |
149 | 0 | break; |
150 | 0 | } |
151 | 0 | return ret; |
152 | 0 | } |
153 | | |
154 | | /* ------------------------------------------------------------------------ |
155 | | * Code for interface de.pengutronix.rauc.Installer |
156 | | * ------------------------------------------------------------------------ |
157 | | */ |
158 | | |
159 | | /** |
160 | | * SECTION:RInstaller |
161 | | * @title: RInstaller |
162 | | * @short_description: Generated C code for the de.pengutronix.rauc.Installer D-Bus interface |
163 | | * |
164 | | * 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. |
165 | | */ |
166 | | |
167 | | /* ---- Introspection data for de.pengutronix.rauc.Installer ---- */ |
168 | | |
169 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_install_IN_ARG_source = |
170 | | { |
171 | | { |
172 | | -1, |
173 | | (gchar *) "source", |
174 | | (gchar *) "s", |
175 | | NULL |
176 | | }, |
177 | | FALSE |
178 | | }; |
179 | | |
180 | | static const GDBusArgInfo * const _r_installer_method_info_install_IN_ARG_pointers[] = |
181 | | { |
182 | | &_r_installer_method_info_install_IN_ARG_source.parent_struct, |
183 | | NULL |
184 | | }; |
185 | | |
186 | | static const _ExtendedGDBusMethodInfo _r_installer_method_info_install = |
187 | | { |
188 | | { |
189 | | -1, |
190 | | (gchar *) "Install", |
191 | | (GDBusArgInfo **) &_r_installer_method_info_install_IN_ARG_pointers, |
192 | | NULL, |
193 | | NULL |
194 | | }, |
195 | | "handle-install", |
196 | | FALSE |
197 | | }; |
198 | | |
199 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_install_bundle_IN_ARG_source = |
200 | | { |
201 | | { |
202 | | -1, |
203 | | (gchar *) "source", |
204 | | (gchar *) "s", |
205 | | NULL |
206 | | }, |
207 | | FALSE |
208 | | }; |
209 | | |
210 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_install_bundle_IN_ARG_args = |
211 | | { |
212 | | { |
213 | | -1, |
214 | | (gchar *) "args", |
215 | | (gchar *) "a{sv}", |
216 | | NULL |
217 | | }, |
218 | | FALSE |
219 | | }; |
220 | | |
221 | | static const GDBusArgInfo * const _r_installer_method_info_install_bundle_IN_ARG_pointers[] = |
222 | | { |
223 | | &_r_installer_method_info_install_bundle_IN_ARG_source.parent_struct, |
224 | | &_r_installer_method_info_install_bundle_IN_ARG_args.parent_struct, |
225 | | NULL |
226 | | }; |
227 | | |
228 | | static const GDBusAnnotationInfo _r_installer_method_install_bundle_annotation_info_0 = |
229 | | { |
230 | | -1, |
231 | | (gchar *) "org.qtproject.QtDBus.QtTypeName.In1", |
232 | | (gchar *) "QVariantMap", |
233 | | NULL |
234 | | }; |
235 | | |
236 | | static const GDBusAnnotationInfo * const _r_installer_method_install_bundle_annotation_info_pointers[] = |
237 | | { |
238 | | &_r_installer_method_install_bundle_annotation_info_0, |
239 | | NULL |
240 | | }; |
241 | | |
242 | | static const _ExtendedGDBusMethodInfo _r_installer_method_info_install_bundle = |
243 | | { |
244 | | { |
245 | | -1, |
246 | | (gchar *) "InstallBundle", |
247 | | (GDBusArgInfo **) &_r_installer_method_info_install_bundle_IN_ARG_pointers, |
248 | | NULL, |
249 | | (GDBusAnnotationInfo **) &_r_installer_method_install_bundle_annotation_info_pointers |
250 | | }, |
251 | | "handle-install-bundle", |
252 | | FALSE |
253 | | }; |
254 | | |
255 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_info_IN_ARG_bundle = |
256 | | { |
257 | | { |
258 | | -1, |
259 | | (gchar *) "bundle", |
260 | | (gchar *) "s", |
261 | | NULL |
262 | | }, |
263 | | FALSE |
264 | | }; |
265 | | |
266 | | static const GDBusArgInfo * const _r_installer_method_info_info_IN_ARG_pointers[] = |
267 | | { |
268 | | &_r_installer_method_info_info_IN_ARG_bundle.parent_struct, |
269 | | NULL |
270 | | }; |
271 | | |
272 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_info_OUT_ARG_compatible = |
273 | | { |
274 | | { |
275 | | -1, |
276 | | (gchar *) "compatible", |
277 | | (gchar *) "s", |
278 | | NULL |
279 | | }, |
280 | | FALSE |
281 | | }; |
282 | | |
283 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_info_OUT_ARG_version = |
284 | | { |
285 | | { |
286 | | -1, |
287 | | (gchar *) "version", |
288 | | (gchar *) "s", |
289 | | NULL |
290 | | }, |
291 | | FALSE |
292 | | }; |
293 | | |
294 | | static const GDBusArgInfo * const _r_installer_method_info_info_OUT_ARG_pointers[] = |
295 | | { |
296 | | &_r_installer_method_info_info_OUT_ARG_compatible.parent_struct, |
297 | | &_r_installer_method_info_info_OUT_ARG_version.parent_struct, |
298 | | NULL |
299 | | }; |
300 | | |
301 | | static const _ExtendedGDBusMethodInfo _r_installer_method_info_info = |
302 | | { |
303 | | { |
304 | | -1, |
305 | | (gchar *) "Info", |
306 | | (GDBusArgInfo **) &_r_installer_method_info_info_IN_ARG_pointers, |
307 | | (GDBusArgInfo **) &_r_installer_method_info_info_OUT_ARG_pointers, |
308 | | NULL |
309 | | }, |
310 | | "handle-info", |
311 | | FALSE |
312 | | }; |
313 | | |
314 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_inspect_bundle_IN_ARG_source = |
315 | | { |
316 | | { |
317 | | -1, |
318 | | (gchar *) "source", |
319 | | (gchar *) "s", |
320 | | NULL |
321 | | }, |
322 | | FALSE |
323 | | }; |
324 | | |
325 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_inspect_bundle_IN_ARG_args = |
326 | | { |
327 | | { |
328 | | -1, |
329 | | (gchar *) "args", |
330 | | (gchar *) "a{sv}", |
331 | | NULL |
332 | | }, |
333 | | FALSE |
334 | | }; |
335 | | |
336 | | static const GDBusArgInfo * const _r_installer_method_info_inspect_bundle_IN_ARG_pointers[] = |
337 | | { |
338 | | &_r_installer_method_info_inspect_bundle_IN_ARG_source.parent_struct, |
339 | | &_r_installer_method_info_inspect_bundle_IN_ARG_args.parent_struct, |
340 | | NULL |
341 | | }; |
342 | | |
343 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_inspect_bundle_OUT_ARG_info = |
344 | | { |
345 | | { |
346 | | -1, |
347 | | (gchar *) "info", |
348 | | (gchar *) "a{sv}", |
349 | | NULL |
350 | | }, |
351 | | FALSE |
352 | | }; |
353 | | |
354 | | static const GDBusArgInfo * const _r_installer_method_info_inspect_bundle_OUT_ARG_pointers[] = |
355 | | { |
356 | | &_r_installer_method_info_inspect_bundle_OUT_ARG_info.parent_struct, |
357 | | NULL |
358 | | }; |
359 | | |
360 | | static const GDBusAnnotationInfo _r_installer_method_inspect_bundle_annotation_info_0 = |
361 | | { |
362 | | -1, |
363 | | (gchar *) "org.qtproject.QtDBus.QtTypeName.In1", |
364 | | (gchar *) "QVariantMap", |
365 | | NULL |
366 | | }; |
367 | | |
368 | | static const GDBusAnnotationInfo _r_installer_method_inspect_bundle_annotation_info_1 = |
369 | | { |
370 | | -1, |
371 | | (gchar *) "org.qtproject.QtDBus.QtTypeName.Out0", |
372 | | (gchar *) "QVariantMap", |
373 | | NULL |
374 | | }; |
375 | | |
376 | | static const GDBusAnnotationInfo * const _r_installer_method_inspect_bundle_annotation_info_pointers[] = |
377 | | { |
378 | | &_r_installer_method_inspect_bundle_annotation_info_0, |
379 | | &_r_installer_method_inspect_bundle_annotation_info_1, |
380 | | NULL |
381 | | }; |
382 | | |
383 | | static const _ExtendedGDBusMethodInfo _r_installer_method_info_inspect_bundle = |
384 | | { |
385 | | { |
386 | | -1, |
387 | | (gchar *) "InspectBundle", |
388 | | (GDBusArgInfo **) &_r_installer_method_info_inspect_bundle_IN_ARG_pointers, |
389 | | (GDBusArgInfo **) &_r_installer_method_info_inspect_bundle_OUT_ARG_pointers, |
390 | | (GDBusAnnotationInfo **) &_r_installer_method_inspect_bundle_annotation_info_pointers |
391 | | }, |
392 | | "handle-inspect-bundle", |
393 | | FALSE |
394 | | }; |
395 | | |
396 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_mark_IN_ARG_state = |
397 | | { |
398 | | { |
399 | | -1, |
400 | | (gchar *) "state", |
401 | | (gchar *) "s", |
402 | | NULL |
403 | | }, |
404 | | FALSE |
405 | | }; |
406 | | |
407 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_mark_IN_ARG_slot_identifier = |
408 | | { |
409 | | { |
410 | | -1, |
411 | | (gchar *) "slot_identifier", |
412 | | (gchar *) "s", |
413 | | NULL |
414 | | }, |
415 | | FALSE |
416 | | }; |
417 | | |
418 | | static const GDBusArgInfo * const _r_installer_method_info_mark_IN_ARG_pointers[] = |
419 | | { |
420 | | &_r_installer_method_info_mark_IN_ARG_state.parent_struct, |
421 | | &_r_installer_method_info_mark_IN_ARG_slot_identifier.parent_struct, |
422 | | NULL |
423 | | }; |
424 | | |
425 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_mark_OUT_ARG_slot_name = |
426 | | { |
427 | | { |
428 | | -1, |
429 | | (gchar *) "slot_name", |
430 | | (gchar *) "s", |
431 | | NULL |
432 | | }, |
433 | | FALSE |
434 | | }; |
435 | | |
436 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_mark_OUT_ARG_message = |
437 | | { |
438 | | { |
439 | | -1, |
440 | | (gchar *) "message", |
441 | | (gchar *) "s", |
442 | | NULL |
443 | | }, |
444 | | FALSE |
445 | | }; |
446 | | |
447 | | static const GDBusArgInfo * const _r_installer_method_info_mark_OUT_ARG_pointers[] = |
448 | | { |
449 | | &_r_installer_method_info_mark_OUT_ARG_slot_name.parent_struct, |
450 | | &_r_installer_method_info_mark_OUT_ARG_message.parent_struct, |
451 | | NULL |
452 | | }; |
453 | | |
454 | | static const _ExtendedGDBusMethodInfo _r_installer_method_info_mark = |
455 | | { |
456 | | { |
457 | | -1, |
458 | | (gchar *) "Mark", |
459 | | (GDBusArgInfo **) &_r_installer_method_info_mark_IN_ARG_pointers, |
460 | | (GDBusArgInfo **) &_r_installer_method_info_mark_OUT_ARG_pointers, |
461 | | NULL |
462 | | }, |
463 | | "handle-mark", |
464 | | FALSE |
465 | | }; |
466 | | |
467 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_get_slot_status_OUT_ARG_slot_status_array = |
468 | | { |
469 | | { |
470 | | -1, |
471 | | (gchar *) "slot_status_array", |
472 | | (gchar *) "a(sa{sv})", |
473 | | NULL |
474 | | }, |
475 | | FALSE |
476 | | }; |
477 | | |
478 | | static const GDBusArgInfo * const _r_installer_method_info_get_slot_status_OUT_ARG_pointers[] = |
479 | | { |
480 | | &_r_installer_method_info_get_slot_status_OUT_ARG_slot_status_array.parent_struct, |
481 | | NULL |
482 | | }; |
483 | | |
484 | | static const GDBusAnnotationInfo _r_installer_method_get_slot_status_annotation_info_0 = |
485 | | { |
486 | | -1, |
487 | | (gchar *) "org.qtproject.QtDBus.QtTypeName.Out0", |
488 | | (gchar *) "RaucSlotStatusArray", |
489 | | NULL |
490 | | }; |
491 | | |
492 | | static const GDBusAnnotationInfo * const _r_installer_method_get_slot_status_annotation_info_pointers[] = |
493 | | { |
494 | | &_r_installer_method_get_slot_status_annotation_info_0, |
495 | | NULL |
496 | | }; |
497 | | |
498 | | static const _ExtendedGDBusMethodInfo _r_installer_method_info_get_slot_status = |
499 | | { |
500 | | { |
501 | | -1, |
502 | | (gchar *) "GetSlotStatus", |
503 | | NULL, |
504 | | (GDBusArgInfo **) &_r_installer_method_info_get_slot_status_OUT_ARG_pointers, |
505 | | (GDBusAnnotationInfo **) &_r_installer_method_get_slot_status_annotation_info_pointers |
506 | | }, |
507 | | "handle-get-slot-status", |
508 | | FALSE |
509 | | }; |
510 | | |
511 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_get_artifact_status_OUT_ARG_artifacts = |
512 | | { |
513 | | { |
514 | | -1, |
515 | | (gchar *) "artifacts", |
516 | | (gchar *) "aa{sv}", |
517 | | NULL |
518 | | }, |
519 | | FALSE |
520 | | }; |
521 | | |
522 | | static const GDBusArgInfo * const _r_installer_method_info_get_artifact_status_OUT_ARG_pointers[] = |
523 | | { |
524 | | &_r_installer_method_info_get_artifact_status_OUT_ARG_artifacts.parent_struct, |
525 | | NULL |
526 | | }; |
527 | | |
528 | | static const GDBusAnnotationInfo _r_installer_method_get_artifact_status_annotation_info_0 = |
529 | | { |
530 | | -1, |
531 | | (gchar *) "org.qtproject.QtDBus.QtTypeName.Out0", |
532 | | (gchar *) "QList<QVariantMap>", |
533 | | NULL |
534 | | }; |
535 | | |
536 | | static const GDBusAnnotationInfo * const _r_installer_method_get_artifact_status_annotation_info_pointers[] = |
537 | | { |
538 | | &_r_installer_method_get_artifact_status_annotation_info_0, |
539 | | NULL |
540 | | }; |
541 | | |
542 | | static const _ExtendedGDBusMethodInfo _r_installer_method_info_get_artifact_status = |
543 | | { |
544 | | { |
545 | | -1, |
546 | | (gchar *) "GetArtifactStatus", |
547 | | NULL, |
548 | | (GDBusArgInfo **) &_r_installer_method_info_get_artifact_status_OUT_ARG_pointers, |
549 | | (GDBusAnnotationInfo **) &_r_installer_method_get_artifact_status_annotation_info_pointers |
550 | | }, |
551 | | "handle-get-artifact-status", |
552 | | FALSE |
553 | | }; |
554 | | |
555 | | static const _ExtendedGDBusArgInfo _r_installer_method_info_get_primary_OUT_ARG_primary = |
556 | | { |
557 | | { |
558 | | -1, |
559 | | (gchar *) "primary", |
560 | | (gchar *) "s", |
561 | | NULL |
562 | | }, |
563 | | FALSE |
564 | | }; |
565 | | |
566 | | static const GDBusArgInfo * const _r_installer_method_info_get_primary_OUT_ARG_pointers[] = |
567 | | { |
568 | | &_r_installer_method_info_get_primary_OUT_ARG_primary.parent_struct, |
569 | | NULL |
570 | | }; |
571 | | |
572 | | static const _ExtendedGDBusMethodInfo _r_installer_method_info_get_primary = |
573 | | { |
574 | | { |
575 | | -1, |
576 | | (gchar *) "GetPrimary", |
577 | | NULL, |
578 | | (GDBusArgInfo **) &_r_installer_method_info_get_primary_OUT_ARG_pointers, |
579 | | NULL |
580 | | }, |
581 | | "handle-get-primary", |
582 | | FALSE |
583 | | }; |
584 | | |
585 | | static const GDBusMethodInfo * const _r_installer_method_info_pointers[] = |
586 | | { |
587 | | &_r_installer_method_info_install.parent_struct, |
588 | | &_r_installer_method_info_install_bundle.parent_struct, |
589 | | &_r_installer_method_info_info.parent_struct, |
590 | | &_r_installer_method_info_inspect_bundle.parent_struct, |
591 | | &_r_installer_method_info_mark.parent_struct, |
592 | | &_r_installer_method_info_get_slot_status.parent_struct, |
593 | | &_r_installer_method_info_get_artifact_status.parent_struct, |
594 | | &_r_installer_method_info_get_primary.parent_struct, |
595 | | NULL |
596 | | }; |
597 | | |
598 | | static const _ExtendedGDBusArgInfo _r_installer_signal_info_completed_ARG_result = |
599 | | { |
600 | | { |
601 | | -1, |
602 | | (gchar *) "result", |
603 | | (gchar *) "i", |
604 | | NULL |
605 | | }, |
606 | | FALSE |
607 | | }; |
608 | | |
609 | | static const GDBusArgInfo * const _r_installer_signal_info_completed_ARG_pointers[] = |
610 | | { |
611 | | &_r_installer_signal_info_completed_ARG_result.parent_struct, |
612 | | NULL |
613 | | }; |
614 | | |
615 | | static const _ExtendedGDBusSignalInfo _r_installer_signal_info_completed = |
616 | | { |
617 | | { |
618 | | -1, |
619 | | (gchar *) "Completed", |
620 | | (GDBusArgInfo **) &_r_installer_signal_info_completed_ARG_pointers, |
621 | | NULL |
622 | | }, |
623 | | "completed" |
624 | | }; |
625 | | |
626 | | static const GDBusSignalInfo * const _r_installer_signal_info_pointers[] = |
627 | | { |
628 | | &_r_installer_signal_info_completed.parent_struct, |
629 | | NULL |
630 | | }; |
631 | | |
632 | | static const _ExtendedGDBusPropertyInfo _r_installer_property_info_operation = |
633 | | { |
634 | | { |
635 | | -1, |
636 | | (gchar *) "Operation", |
637 | | (gchar *) "s", |
638 | | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
639 | | NULL |
640 | | }, |
641 | | "operation", |
642 | | FALSE, |
643 | | TRUE |
644 | | }; |
645 | | |
646 | | static const _ExtendedGDBusPropertyInfo _r_installer_property_info_last_error = |
647 | | { |
648 | | { |
649 | | -1, |
650 | | (gchar *) "LastError", |
651 | | (gchar *) "s", |
652 | | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
653 | | NULL |
654 | | }, |
655 | | "last-error", |
656 | | FALSE, |
657 | | TRUE |
658 | | }; |
659 | | |
660 | | static const GDBusAnnotationInfo _r_installer_property_progress_annotation_info_0 = |
661 | | { |
662 | | -1, |
663 | | (gchar *) "org.qtproject.QtDBus.QtTypeName", |
664 | | (gchar *) "RaucProgress", |
665 | | NULL |
666 | | }; |
667 | | |
668 | | static const GDBusAnnotationInfo * const _r_installer_property_progress_annotation_info_pointers[] = |
669 | | { |
670 | | &_r_installer_property_progress_annotation_info_0, |
671 | | NULL |
672 | | }; |
673 | | |
674 | | static const _ExtendedGDBusPropertyInfo _r_installer_property_info_progress = |
675 | | { |
676 | | { |
677 | | -1, |
678 | | (gchar *) "Progress", |
679 | | (gchar *) "(isi)", |
680 | | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
681 | | (GDBusAnnotationInfo **) &_r_installer_property_progress_annotation_info_pointers |
682 | | }, |
683 | | "progress", |
684 | | FALSE, |
685 | | TRUE |
686 | | }; |
687 | | |
688 | | static const _ExtendedGDBusPropertyInfo _r_installer_property_info_compatible = |
689 | | { |
690 | | { |
691 | | -1, |
692 | | (gchar *) "Compatible", |
693 | | (gchar *) "s", |
694 | | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
695 | | NULL |
696 | | }, |
697 | | "compatible", |
698 | | FALSE, |
699 | | TRUE |
700 | | }; |
701 | | |
702 | | static const _ExtendedGDBusPropertyInfo _r_installer_property_info_variant = |
703 | | { |
704 | | { |
705 | | -1, |
706 | | (gchar *) "Variant", |
707 | | (gchar *) "s", |
708 | | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
709 | | NULL |
710 | | }, |
711 | | "variant", |
712 | | FALSE, |
713 | | TRUE |
714 | | }; |
715 | | |
716 | | static const _ExtendedGDBusPropertyInfo _r_installer_property_info_boot_slot = |
717 | | { |
718 | | { |
719 | | -1, |
720 | | (gchar *) "BootSlot", |
721 | | (gchar *) "s", |
722 | | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
723 | | NULL |
724 | | }, |
725 | | "boot-slot", |
726 | | FALSE, |
727 | | TRUE |
728 | | }; |
729 | | |
730 | | static const GDBusPropertyInfo * const _r_installer_property_info_pointers[] = |
731 | | { |
732 | | &_r_installer_property_info_operation.parent_struct, |
733 | | &_r_installer_property_info_last_error.parent_struct, |
734 | | &_r_installer_property_info_progress.parent_struct, |
735 | | &_r_installer_property_info_compatible.parent_struct, |
736 | | &_r_installer_property_info_variant.parent_struct, |
737 | | &_r_installer_property_info_boot_slot.parent_struct, |
738 | | NULL |
739 | | }; |
740 | | |
741 | | static const _ExtendedGDBusInterfaceInfo _r_installer_interface_info = |
742 | | { |
743 | | { |
744 | | -1, |
745 | | (gchar *) "de.pengutronix.rauc.Installer", |
746 | | (GDBusMethodInfo **) &_r_installer_method_info_pointers, |
747 | | (GDBusSignalInfo **) &_r_installer_signal_info_pointers, |
748 | | (GDBusPropertyInfo **) &_r_installer_property_info_pointers, |
749 | | NULL |
750 | | }, |
751 | | "installer", |
752 | | }; |
753 | | |
754 | | |
755 | | /** |
756 | | * r_installer_interface_info: |
757 | | * |
758 | | * 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. |
759 | | * |
760 | | * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. |
761 | | */ |
762 | | GDBusInterfaceInfo * |
763 | | r_installer_interface_info (void) |
764 | 0 | { |
765 | 0 | return (GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct; |
766 | 0 | } |
767 | | |
768 | | /** |
769 | | * r_installer_override_properties: |
770 | | * @klass: The class structure for a #GObject derived class. |
771 | | * @property_id_begin: The property id to assign to the first overridden property. |
772 | | * |
773 | | * Overrides all #GObject properties in the #RInstaller interface for a concrete class. |
774 | | * The properties are overridden in the order they are defined. |
775 | | * |
776 | | * Returns: The last property id. |
777 | | */ |
778 | | guint |
779 | | r_installer_override_properties (GObjectClass *klass, guint property_id_begin) |
780 | 0 | { |
781 | 0 | g_object_class_override_property (klass, property_id_begin++, "operation"); |
782 | 0 | g_object_class_override_property (klass, property_id_begin++, "last-error"); |
783 | 0 | g_object_class_override_property (klass, property_id_begin++, "progress"); |
784 | 0 | g_object_class_override_property (klass, property_id_begin++, "compatible"); |
785 | 0 | g_object_class_override_property (klass, property_id_begin++, "variant"); |
786 | 0 | g_object_class_override_property (klass, property_id_begin++, "boot-slot"); |
787 | 0 | return property_id_begin - 1; |
788 | 0 | } |
789 | | |
790 | | |
791 | | |
792 | | /** |
793 | | * RInstaller: |
794 | | * |
795 | | * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Installer.top_of_page">de.pengutronix.rauc.Installer</link>. |
796 | | */ |
797 | | |
798 | | /** |
799 | | * RInstallerIface: |
800 | | * @parent_iface: The parent interface. |
801 | | * @handle_get_artifact_status: Handler for the #RInstaller::handle-get-artifact-status signal. |
802 | | * @handle_get_primary: Handler for the #RInstaller::handle-get-primary signal. |
803 | | * @handle_get_slot_status: Handler for the #RInstaller::handle-get-slot-status signal. |
804 | | * @handle_info: Handler for the #RInstaller::handle-info signal. |
805 | | * @handle_inspect_bundle: Handler for the #RInstaller::handle-inspect-bundle signal. |
806 | | * @handle_install: Handler for the #RInstaller::handle-install signal. |
807 | | * @handle_install_bundle: Handler for the #RInstaller::handle-install-bundle signal. |
808 | | * @handle_mark: Handler for the #RInstaller::handle-mark signal. |
809 | | * @get_boot_slot: Getter for the #RInstaller:boot-slot property. |
810 | | * @get_compatible: Getter for the #RInstaller:compatible property. |
811 | | * @get_last_error: Getter for the #RInstaller:last-error property. |
812 | | * @get_operation: Getter for the #RInstaller:operation property. |
813 | | * @get_progress: Getter for the #RInstaller:progress property. |
814 | | * @get_variant: Getter for the #RInstaller:variant property. |
815 | | * @completed: Handler for the #RInstaller::completed signal. |
816 | | * |
817 | | * Virtual table for the D-Bus interface <link linkend="gdbus-interface-de-pengutronix-rauc-Installer.top_of_page">de.pengutronix.rauc.Installer</link>. |
818 | | */ |
819 | | |
820 | | typedef RInstallerIface RInstallerInterface; |
821 | | G_DEFINE_INTERFACE (RInstaller, r_installer, G_TYPE_OBJECT) |
822 | | |
823 | | static void |
824 | | r_installer_default_init (RInstallerIface *iface) |
825 | 0 | { |
826 | | /* GObject signals for incoming D-Bus method calls: */ |
827 | | /** |
828 | | * RInstaller::handle-install: |
829 | | * @object: A #RInstaller. |
830 | | * @invocation: A #GDBusMethodInvocation. |
831 | | * @arg_source: Argument passed by remote caller. |
832 | | * |
833 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Install">Install()</link> D-Bus method. |
834 | | * |
835 | | * 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. |
836 | | * |
837 | | * 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. |
838 | | */ |
839 | 0 | g_signal_new ("handle-install", |
840 | 0 | G_TYPE_FROM_INTERFACE (iface), |
841 | 0 | G_SIGNAL_RUN_LAST, |
842 | 0 | G_STRUCT_OFFSET (RInstallerIface, handle_install), |
843 | 0 | g_signal_accumulator_true_handled, |
844 | 0 | NULL, |
845 | 0 | g_cclosure_marshal_generic, |
846 | 0 | G_TYPE_BOOLEAN, |
847 | 0 | 2, |
848 | 0 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); |
849 | | |
850 | | /** |
851 | | * RInstaller::handle-install-bundle: |
852 | | * @object: A #RInstaller. |
853 | | * @invocation: A #GDBusMethodInvocation. |
854 | | * @arg_source: Argument passed by remote caller. |
855 | | * @arg_args: Argument passed by remote caller. |
856 | | * |
857 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InstallBundle">InstallBundle()</link> D-Bus method. |
858 | | * |
859 | | * 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. |
860 | | * |
861 | | * 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. |
862 | | */ |
863 | 0 | g_signal_new ("handle-install-bundle", |
864 | 0 | G_TYPE_FROM_INTERFACE (iface), |
865 | 0 | G_SIGNAL_RUN_LAST, |
866 | 0 | G_STRUCT_OFFSET (RInstallerIface, handle_install_bundle), |
867 | 0 | g_signal_accumulator_true_handled, |
868 | 0 | NULL, |
869 | 0 | g_cclosure_marshal_generic, |
870 | 0 | G_TYPE_BOOLEAN, |
871 | 0 | 3, |
872 | 0 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT); |
873 | | |
874 | | /** |
875 | | * RInstaller::handle-info: |
876 | | * @object: A #RInstaller. |
877 | | * @invocation: A #GDBusMethodInvocation. |
878 | | * @arg_bundle: Argument passed by remote caller. |
879 | | * |
880 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Info">Info()</link> D-Bus method. |
881 | | * |
882 | | * 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. |
883 | | * |
884 | | * 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. |
885 | | */ |
886 | 0 | g_signal_new ("handle-info", |
887 | 0 | G_TYPE_FROM_INTERFACE (iface), |
888 | 0 | G_SIGNAL_RUN_LAST, |
889 | 0 | G_STRUCT_OFFSET (RInstallerIface, handle_info), |
890 | 0 | g_signal_accumulator_true_handled, |
891 | 0 | NULL, |
892 | 0 | g_cclosure_marshal_generic, |
893 | 0 | G_TYPE_BOOLEAN, |
894 | 0 | 2, |
895 | 0 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); |
896 | | |
897 | | /** |
898 | | * RInstaller::handle-inspect-bundle: |
899 | | * @object: A #RInstaller. |
900 | | * @invocation: A #GDBusMethodInvocation. |
901 | | * @arg_source: Argument passed by remote caller. |
902 | | * @arg_args: Argument passed by remote caller. |
903 | | * |
904 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InspectBundle">InspectBundle()</link> D-Bus method. |
905 | | * |
906 | | * 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. |
907 | | * |
908 | | * 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. |
909 | | */ |
910 | 0 | g_signal_new ("handle-inspect-bundle", |
911 | 0 | G_TYPE_FROM_INTERFACE (iface), |
912 | 0 | G_SIGNAL_RUN_LAST, |
913 | 0 | G_STRUCT_OFFSET (RInstallerIface, handle_inspect_bundle), |
914 | 0 | g_signal_accumulator_true_handled, |
915 | 0 | NULL, |
916 | 0 | g_cclosure_marshal_generic, |
917 | 0 | G_TYPE_BOOLEAN, |
918 | 0 | 3, |
919 | 0 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT); |
920 | | |
921 | | /** |
922 | | * RInstaller::handle-mark: |
923 | | * @object: A #RInstaller. |
924 | | * @invocation: A #GDBusMethodInvocation. |
925 | | * @arg_state: Argument passed by remote caller. |
926 | | * @arg_slot_identifier: Argument passed by remote caller. |
927 | | * |
928 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Mark">Mark()</link> D-Bus method. |
929 | | * |
930 | | * 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. |
931 | | * |
932 | | * 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. |
933 | | */ |
934 | 0 | g_signal_new ("handle-mark", |
935 | 0 | G_TYPE_FROM_INTERFACE (iface), |
936 | 0 | G_SIGNAL_RUN_LAST, |
937 | 0 | G_STRUCT_OFFSET (RInstallerIface, handle_mark), |
938 | 0 | g_signal_accumulator_true_handled, |
939 | 0 | NULL, |
940 | 0 | g_cclosure_marshal_generic, |
941 | 0 | G_TYPE_BOOLEAN, |
942 | 0 | 3, |
943 | 0 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING); |
944 | | |
945 | | /** |
946 | | * RInstaller::handle-get-slot-status: |
947 | | * @object: A #RInstaller. |
948 | | * @invocation: A #GDBusMethodInvocation. |
949 | | * |
950 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetSlotStatus">GetSlotStatus()</link> D-Bus method. |
951 | | * |
952 | | * 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. |
953 | | * |
954 | | * 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. |
955 | | */ |
956 | 0 | g_signal_new ("handle-get-slot-status", |
957 | 0 | G_TYPE_FROM_INTERFACE (iface), |
958 | 0 | G_SIGNAL_RUN_LAST, |
959 | 0 | G_STRUCT_OFFSET (RInstallerIface, handle_get_slot_status), |
960 | 0 | g_signal_accumulator_true_handled, |
961 | 0 | NULL, |
962 | 0 | g_cclosure_marshal_generic, |
963 | 0 | G_TYPE_BOOLEAN, |
964 | 0 | 1, |
965 | 0 | G_TYPE_DBUS_METHOD_INVOCATION); |
966 | | |
967 | | /** |
968 | | * RInstaller::handle-get-artifact-status: |
969 | | * @object: A #RInstaller. |
970 | | * @invocation: A #GDBusMethodInvocation. |
971 | | * |
972 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetArtifactStatus">GetArtifactStatus()</link> D-Bus method. |
973 | | * |
974 | | * 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. |
975 | | * |
976 | | * 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. |
977 | | */ |
978 | 0 | g_signal_new ("handle-get-artifact-status", |
979 | 0 | G_TYPE_FROM_INTERFACE (iface), |
980 | 0 | G_SIGNAL_RUN_LAST, |
981 | 0 | G_STRUCT_OFFSET (RInstallerIface, handle_get_artifact_status), |
982 | 0 | g_signal_accumulator_true_handled, |
983 | 0 | NULL, |
984 | 0 | g_cclosure_marshal_generic, |
985 | 0 | G_TYPE_BOOLEAN, |
986 | 0 | 1, |
987 | 0 | G_TYPE_DBUS_METHOD_INVOCATION); |
988 | | |
989 | | /** |
990 | | * RInstaller::handle-get-primary: |
991 | | * @object: A #RInstaller. |
992 | | * @invocation: A #GDBusMethodInvocation. |
993 | | * |
994 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetPrimary">GetPrimary()</link> D-Bus method. |
995 | | * |
996 | | * 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. |
997 | | * |
998 | | * 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. |
999 | | */ |
1000 | 0 | g_signal_new ("handle-get-primary", |
1001 | 0 | G_TYPE_FROM_INTERFACE (iface), |
1002 | 0 | G_SIGNAL_RUN_LAST, |
1003 | 0 | G_STRUCT_OFFSET (RInstallerIface, handle_get_primary), |
1004 | 0 | g_signal_accumulator_true_handled, |
1005 | 0 | NULL, |
1006 | 0 | g_cclosure_marshal_generic, |
1007 | 0 | G_TYPE_BOOLEAN, |
1008 | 0 | 1, |
1009 | 0 | G_TYPE_DBUS_METHOD_INVOCATION); |
1010 | | |
1011 | | /* GObject signals for received D-Bus signals: */ |
1012 | | /** |
1013 | | * RInstaller::completed: |
1014 | | * @object: A #RInstaller. |
1015 | | * @arg_result: Argument. |
1016 | | * |
1017 | | * 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. |
1018 | | * |
1019 | | * 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. |
1020 | | */ |
1021 | 0 | g_signal_new ("completed", |
1022 | 0 | G_TYPE_FROM_INTERFACE (iface), |
1023 | 0 | G_SIGNAL_RUN_LAST, |
1024 | 0 | G_STRUCT_OFFSET (RInstallerIface, completed), |
1025 | 0 | NULL, |
1026 | 0 | NULL, |
1027 | 0 | g_cclosure_marshal_generic, |
1028 | 0 | G_TYPE_NONE, |
1029 | 0 | 1, G_TYPE_INT); |
1030 | | |
1031 | | /* GObject properties for D-Bus properties: */ |
1032 | | /** |
1033 | | * RInstaller:operation: |
1034 | | * |
1035 | | * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Operation">"Operation"</link>. |
1036 | | * |
1037 | | * 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. |
1038 | | */ |
1039 | 0 | g_object_interface_install_property (iface, |
1040 | 0 | g_param_spec_string ("operation", "Operation", "Operation", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
1041 | | /** |
1042 | | * RInstaller:last-error: |
1043 | | * |
1044 | | * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.LastError">"LastError"</link>. |
1045 | | * |
1046 | | * 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. |
1047 | | */ |
1048 | 0 | g_object_interface_install_property (iface, |
1049 | 0 | g_param_spec_string ("last-error", "LastError", "LastError", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
1050 | | /** |
1051 | | * RInstaller:progress: |
1052 | | * |
1053 | | * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Progress">"Progress"</link>. |
1054 | | * |
1055 | | * 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. |
1056 | | */ |
1057 | 0 | g_object_interface_install_property (iface, |
1058 | 0 | g_param_spec_variant ("progress", "Progress", "Progress", G_VARIANT_TYPE ("(isi)"), NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
1059 | | /** |
1060 | | * RInstaller:compatible: |
1061 | | * |
1062 | | * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Compatible">"Compatible"</link>. |
1063 | | * |
1064 | | * 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. |
1065 | | */ |
1066 | 0 | g_object_interface_install_property (iface, |
1067 | 0 | g_param_spec_string ("compatible", "Compatible", "Compatible", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
1068 | | /** |
1069 | | * RInstaller:variant: |
1070 | | * |
1071 | | * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Variant">"Variant"</link>. |
1072 | | * |
1073 | | * 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. |
1074 | | */ |
1075 | 0 | g_object_interface_install_property (iface, |
1076 | 0 | g_param_spec_string ("variant", "Variant", "Variant", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
1077 | | /** |
1078 | | * RInstaller:boot-slot: |
1079 | | * |
1080 | | * Represents the D-Bus property <link linkend="gdbus-property-de-pengutronix-rauc-Installer.BootSlot">"BootSlot"</link>. |
1081 | | * |
1082 | | * 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. |
1083 | | */ |
1084 | 0 | g_object_interface_install_property (iface, |
1085 | 0 | g_param_spec_string ("boot-slot", "BootSlot", "BootSlot", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
1086 | 0 | } |
1087 | | |
1088 | | /** |
1089 | | * r_installer_get_operation: (skip) |
1090 | | * @object: A #RInstaller. |
1091 | | * |
1092 | | * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Operation">"Operation"</link> D-Bus property. |
1093 | | * |
1094 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1095 | | * |
1096 | | * 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. |
1097 | | * |
1098 | | * 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. |
1099 | | */ |
1100 | | const gchar * |
1101 | | r_installer_get_operation (RInstaller *object) |
1102 | 0 | { |
1103 | 0 | g_return_val_if_fail (R_IS_INSTALLER (object), NULL); |
1104 | | |
1105 | 0 | return R_INSTALLER_GET_IFACE (object)->get_operation (object); |
1106 | 0 | } |
1107 | | |
1108 | | /** |
1109 | | * r_installer_dup_operation: (skip) |
1110 | | * @object: A #RInstaller. |
1111 | | * |
1112 | | * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Operation">"Operation"</link> D-Bus property. |
1113 | | * |
1114 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1115 | | * |
1116 | | * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
1117 | | */ |
1118 | | gchar * |
1119 | | r_installer_dup_operation (RInstaller *object) |
1120 | 0 | { |
1121 | 0 | gchar *value; |
1122 | 0 | g_object_get (G_OBJECT (object), "operation", &value, NULL); |
1123 | 0 | return value; |
1124 | 0 | } |
1125 | | |
1126 | | /** |
1127 | | * r_installer_set_operation: (skip) |
1128 | | * @object: A #RInstaller. |
1129 | | * @value: The value to set. |
1130 | | * |
1131 | | * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Operation">"Operation"</link> D-Bus property to @value. |
1132 | | * |
1133 | | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
1134 | | */ |
1135 | | void |
1136 | | r_installer_set_operation (RInstaller *object, const gchar *value) |
1137 | 0 | { |
1138 | 0 | g_object_set (G_OBJECT (object), "operation", value, NULL); |
1139 | 0 | } |
1140 | | |
1141 | | /** |
1142 | | * r_installer_get_last_error: (skip) |
1143 | | * @object: A #RInstaller. |
1144 | | * |
1145 | | * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.LastError">"LastError"</link> D-Bus property. |
1146 | | * |
1147 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1148 | | * |
1149 | | * 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. |
1150 | | * |
1151 | | * 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. |
1152 | | */ |
1153 | | const gchar * |
1154 | | r_installer_get_last_error (RInstaller *object) |
1155 | 0 | { |
1156 | 0 | g_return_val_if_fail (R_IS_INSTALLER (object), NULL); |
1157 | | |
1158 | 0 | return R_INSTALLER_GET_IFACE (object)->get_last_error (object); |
1159 | 0 | } |
1160 | | |
1161 | | /** |
1162 | | * r_installer_dup_last_error: (skip) |
1163 | | * @object: A #RInstaller. |
1164 | | * |
1165 | | * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.LastError">"LastError"</link> D-Bus property. |
1166 | | * |
1167 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1168 | | * |
1169 | | * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
1170 | | */ |
1171 | | gchar * |
1172 | | r_installer_dup_last_error (RInstaller *object) |
1173 | 0 | { |
1174 | 0 | gchar *value; |
1175 | 0 | g_object_get (G_OBJECT (object), "last-error", &value, NULL); |
1176 | 0 | return value; |
1177 | 0 | } |
1178 | | |
1179 | | /** |
1180 | | * r_installer_set_last_error: (skip) |
1181 | | * @object: A #RInstaller. |
1182 | | * @value: The value to set. |
1183 | | * |
1184 | | * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.LastError">"LastError"</link> D-Bus property to @value. |
1185 | | * |
1186 | | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
1187 | | */ |
1188 | | void |
1189 | | r_installer_set_last_error (RInstaller *object, const gchar *value) |
1190 | 0 | { |
1191 | 0 | g_object_set (G_OBJECT (object), "last-error", value, NULL); |
1192 | 0 | } |
1193 | | |
1194 | | /** |
1195 | | * r_installer_get_progress: (skip) |
1196 | | * @object: A #RInstaller. |
1197 | | * |
1198 | | * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Progress">"Progress"</link> D-Bus property. |
1199 | | * |
1200 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1201 | | * |
1202 | | * 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. |
1203 | | * |
1204 | | * 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. |
1205 | | */ |
1206 | | GVariant * |
1207 | | r_installer_get_progress (RInstaller *object) |
1208 | 0 | { |
1209 | 0 | g_return_val_if_fail (R_IS_INSTALLER (object), NULL); |
1210 | | |
1211 | 0 | return R_INSTALLER_GET_IFACE (object)->get_progress (object); |
1212 | 0 | } |
1213 | | |
1214 | | /** |
1215 | | * r_installer_dup_progress: (skip) |
1216 | | * @object: A #RInstaller. |
1217 | | * |
1218 | | * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Progress">"Progress"</link> D-Bus property. |
1219 | | * |
1220 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1221 | | * |
1222 | | * 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(). |
1223 | | */ |
1224 | | GVariant * |
1225 | | r_installer_dup_progress (RInstaller *object) |
1226 | 0 | { |
1227 | 0 | GVariant *value; |
1228 | 0 | g_object_get (G_OBJECT (object), "progress", &value, NULL); |
1229 | 0 | return value; |
1230 | 0 | } |
1231 | | |
1232 | | /** |
1233 | | * r_installer_set_progress: (skip) |
1234 | | * @object: A #RInstaller. |
1235 | | * @value: The value to set. |
1236 | | * |
1237 | | * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Progress">"Progress"</link> D-Bus property to @value. |
1238 | | * |
1239 | | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
1240 | | */ |
1241 | | void |
1242 | | r_installer_set_progress (RInstaller *object, GVariant *value) |
1243 | 0 | { |
1244 | 0 | g_object_set (G_OBJECT (object), "progress", value, NULL); |
1245 | 0 | } |
1246 | | |
1247 | | /** |
1248 | | * r_installer_get_compatible: (skip) |
1249 | | * @object: A #RInstaller. |
1250 | | * |
1251 | | * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Compatible">"Compatible"</link> D-Bus property. |
1252 | | * |
1253 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1254 | | * |
1255 | | * 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. |
1256 | | * |
1257 | | * 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. |
1258 | | */ |
1259 | | const gchar * |
1260 | | r_installer_get_compatible (RInstaller *object) |
1261 | 0 | { |
1262 | 0 | g_return_val_if_fail (R_IS_INSTALLER (object), NULL); |
1263 | | |
1264 | 0 | return R_INSTALLER_GET_IFACE (object)->get_compatible (object); |
1265 | 0 | } |
1266 | | |
1267 | | /** |
1268 | | * r_installer_dup_compatible: (skip) |
1269 | | * @object: A #RInstaller. |
1270 | | * |
1271 | | * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Compatible">"Compatible"</link> D-Bus property. |
1272 | | * |
1273 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1274 | | * |
1275 | | * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
1276 | | */ |
1277 | | gchar * |
1278 | | r_installer_dup_compatible (RInstaller *object) |
1279 | 0 | { |
1280 | 0 | gchar *value; |
1281 | 0 | g_object_get (G_OBJECT (object), "compatible", &value, NULL); |
1282 | 0 | return value; |
1283 | 0 | } |
1284 | | |
1285 | | /** |
1286 | | * r_installer_set_compatible: (skip) |
1287 | | * @object: A #RInstaller. |
1288 | | * @value: The value to set. |
1289 | | * |
1290 | | * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Compatible">"Compatible"</link> D-Bus property to @value. |
1291 | | * |
1292 | | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
1293 | | */ |
1294 | | void |
1295 | | r_installer_set_compatible (RInstaller *object, const gchar *value) |
1296 | 0 | { |
1297 | 0 | g_object_set (G_OBJECT (object), "compatible", value, NULL); |
1298 | 0 | } |
1299 | | |
1300 | | /** |
1301 | | * r_installer_get_variant: (skip) |
1302 | | * @object: A #RInstaller. |
1303 | | * |
1304 | | * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Variant">"Variant"</link> D-Bus property. |
1305 | | * |
1306 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1307 | | * |
1308 | | * 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. |
1309 | | * |
1310 | | * 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. |
1311 | | */ |
1312 | | const gchar * |
1313 | | r_installer_get_variant (RInstaller *object) |
1314 | 0 | { |
1315 | 0 | g_return_val_if_fail (R_IS_INSTALLER (object), NULL); |
1316 | | |
1317 | 0 | return R_INSTALLER_GET_IFACE (object)->get_variant (object); |
1318 | 0 | } |
1319 | | |
1320 | | /** |
1321 | | * r_installer_dup_variant: (skip) |
1322 | | * @object: A #RInstaller. |
1323 | | * |
1324 | | * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Variant">"Variant"</link> D-Bus property. |
1325 | | * |
1326 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1327 | | * |
1328 | | * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
1329 | | */ |
1330 | | gchar * |
1331 | | r_installer_dup_variant (RInstaller *object) |
1332 | 0 | { |
1333 | 0 | gchar *value; |
1334 | 0 | g_object_get (G_OBJECT (object), "variant", &value, NULL); |
1335 | 0 | return value; |
1336 | 0 | } |
1337 | | |
1338 | | /** |
1339 | | * r_installer_set_variant: (skip) |
1340 | | * @object: A #RInstaller. |
1341 | | * @value: The value to set. |
1342 | | * |
1343 | | * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.Variant">"Variant"</link> D-Bus property to @value. |
1344 | | * |
1345 | | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
1346 | | */ |
1347 | | void |
1348 | | r_installer_set_variant (RInstaller *object, const gchar *value) |
1349 | 0 | { |
1350 | 0 | g_object_set (G_OBJECT (object), "variant", value, NULL); |
1351 | 0 | } |
1352 | | |
1353 | | /** |
1354 | | * r_installer_get_boot_slot: (skip) |
1355 | | * @object: A #RInstaller. |
1356 | | * |
1357 | | * Gets the value of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.BootSlot">"BootSlot"</link> D-Bus property. |
1358 | | * |
1359 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1360 | | * |
1361 | | * 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. |
1362 | | * |
1363 | | * 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. |
1364 | | */ |
1365 | | const gchar * |
1366 | | r_installer_get_boot_slot (RInstaller *object) |
1367 | 0 | { |
1368 | 0 | g_return_val_if_fail (R_IS_INSTALLER (object), NULL); |
1369 | | |
1370 | 0 | return R_INSTALLER_GET_IFACE (object)->get_boot_slot (object); |
1371 | 0 | } |
1372 | | |
1373 | | /** |
1374 | | * r_installer_dup_boot_slot: (skip) |
1375 | | * @object: A #RInstaller. |
1376 | | * |
1377 | | * Gets a copy of the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.BootSlot">"BootSlot"</link> D-Bus property. |
1378 | | * |
1379 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
1380 | | * |
1381 | | * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
1382 | | */ |
1383 | | gchar * |
1384 | | r_installer_dup_boot_slot (RInstaller *object) |
1385 | 0 | { |
1386 | 0 | gchar *value; |
1387 | 0 | g_object_get (G_OBJECT (object), "boot-slot", &value, NULL); |
1388 | 0 | return value; |
1389 | 0 | } |
1390 | | |
1391 | | /** |
1392 | | * r_installer_set_boot_slot: (skip) |
1393 | | * @object: A #RInstaller. |
1394 | | * @value: The value to set. |
1395 | | * |
1396 | | * Sets the <link linkend="gdbus-property-de-pengutronix-rauc-Installer.BootSlot">"BootSlot"</link> D-Bus property to @value. |
1397 | | * |
1398 | | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
1399 | | */ |
1400 | | void |
1401 | | r_installer_set_boot_slot (RInstaller *object, const gchar *value) |
1402 | 0 | { |
1403 | 0 | g_object_set (G_OBJECT (object), "boot-slot", value, NULL); |
1404 | 0 | } |
1405 | | |
1406 | | /** |
1407 | | * r_installer_emit_completed: |
1408 | | * @object: A #RInstaller. |
1409 | | * @arg_result: Argument to pass with the signal. |
1410 | | * |
1411 | | * Emits the <link linkend="gdbus-signal-de-pengutronix-rauc-Installer.Completed">"Completed"</link> D-Bus signal. |
1412 | | */ |
1413 | | void |
1414 | | r_installer_emit_completed ( |
1415 | | RInstaller *object, |
1416 | | gint arg_result) |
1417 | 0 | { |
1418 | 0 | g_signal_emit_by_name (object, "completed", arg_result); |
1419 | 0 | } |
1420 | | |
1421 | | /** |
1422 | | * r_installer_call_install: |
1423 | | * @proxy: A #RInstallerProxy. |
1424 | | * @arg_source: Argument to pass with the method invocation. |
1425 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1426 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
1427 | | * @user_data: User data to pass to @callback. |
1428 | | * |
1429 | | * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Install">Install()</link> D-Bus method on @proxy. |
1430 | | * 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()). |
1431 | | * You can then call r_installer_call_install_finish() to get the result of the operation. |
1432 | | * |
1433 | | * See r_installer_call_install_sync() for the synchronous, blocking version of this method. |
1434 | | */ |
1435 | | void |
1436 | | r_installer_call_install ( |
1437 | | RInstaller *proxy, |
1438 | | const gchar *arg_source, |
1439 | | GCancellable *cancellable, |
1440 | | GAsyncReadyCallback callback, |
1441 | | gpointer user_data) |
1442 | 0 | { |
1443 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
1444 | 0 | "Install", |
1445 | 0 | g_variant_new ("(s)", |
1446 | 0 | arg_source), |
1447 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1448 | 0 | -1, |
1449 | 0 | cancellable, |
1450 | 0 | callback, |
1451 | 0 | user_data); |
1452 | 0 | } |
1453 | | |
1454 | | /** |
1455 | | * r_installer_call_install_finish: |
1456 | | * @proxy: A #RInstallerProxy. |
1457 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_install(). |
1458 | | * @error: Return location for error or %NULL. |
1459 | | * |
1460 | | * Finishes an operation started with r_installer_call_install(). |
1461 | | * |
1462 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1463 | | */ |
1464 | | gboolean |
1465 | | r_installer_call_install_finish ( |
1466 | | RInstaller *proxy, |
1467 | | GAsyncResult *res, |
1468 | | GError **error) |
1469 | 0 | { |
1470 | 0 | GVariant *_ret; |
1471 | 0 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
1472 | 0 | if (_ret == NULL) |
1473 | 0 | goto _out; |
1474 | 0 | g_variant_get (_ret, |
1475 | 0 | "()"); |
1476 | 0 | g_variant_unref (_ret); |
1477 | 0 | _out: |
1478 | 0 | return _ret != NULL; |
1479 | 0 | } |
1480 | | |
1481 | | /** |
1482 | | * r_installer_call_install_sync: |
1483 | | * @proxy: A #RInstallerProxy. |
1484 | | * @arg_source: Argument to pass with the method invocation. |
1485 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1486 | | * @error: Return location for error or %NULL. |
1487 | | * |
1488 | | * 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. |
1489 | | * |
1490 | | * See r_installer_call_install() for the asynchronous version of this method. |
1491 | | * |
1492 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1493 | | */ |
1494 | | gboolean |
1495 | | r_installer_call_install_sync ( |
1496 | | RInstaller *proxy, |
1497 | | const gchar *arg_source, |
1498 | | GCancellable *cancellable, |
1499 | | GError **error) |
1500 | 0 | { |
1501 | 0 | GVariant *_ret; |
1502 | 0 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
1503 | 0 | "Install", |
1504 | 0 | g_variant_new ("(s)", |
1505 | 0 | arg_source), |
1506 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1507 | 0 | -1, |
1508 | 0 | cancellable, |
1509 | 0 | error); |
1510 | 0 | if (_ret == NULL) |
1511 | 0 | goto _out; |
1512 | 0 | g_variant_get (_ret, |
1513 | 0 | "()"); |
1514 | 0 | g_variant_unref (_ret); |
1515 | 0 | _out: |
1516 | 0 | return _ret != NULL; |
1517 | 0 | } |
1518 | | |
1519 | | /** |
1520 | | * r_installer_call_install_bundle: |
1521 | | * @proxy: A #RInstallerProxy. |
1522 | | * @arg_source: Argument to pass with the method invocation. |
1523 | | * @arg_args: Argument to pass with the method invocation. |
1524 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1525 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
1526 | | * @user_data: User data to pass to @callback. |
1527 | | * |
1528 | | * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InstallBundle">InstallBundle()</link> D-Bus method on @proxy. |
1529 | | * 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()). |
1530 | | * You can then call r_installer_call_install_bundle_finish() to get the result of the operation. |
1531 | | * |
1532 | | * See r_installer_call_install_bundle_sync() for the synchronous, blocking version of this method. |
1533 | | */ |
1534 | | void |
1535 | | r_installer_call_install_bundle ( |
1536 | | RInstaller *proxy, |
1537 | | const gchar *arg_source, |
1538 | | GVariant *arg_args, |
1539 | | GCancellable *cancellable, |
1540 | | GAsyncReadyCallback callback, |
1541 | | gpointer user_data) |
1542 | 0 | { |
1543 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
1544 | 0 | "InstallBundle", |
1545 | 0 | g_variant_new ("(s@a{sv})", |
1546 | 0 | arg_source, |
1547 | 0 | arg_args), |
1548 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1549 | 0 | -1, |
1550 | 0 | cancellable, |
1551 | 0 | callback, |
1552 | 0 | user_data); |
1553 | 0 | } |
1554 | | |
1555 | | /** |
1556 | | * r_installer_call_install_bundle_finish: |
1557 | | * @proxy: A #RInstallerProxy. |
1558 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_install_bundle(). |
1559 | | * @error: Return location for error or %NULL. |
1560 | | * |
1561 | | * Finishes an operation started with r_installer_call_install_bundle(). |
1562 | | * |
1563 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1564 | | */ |
1565 | | gboolean |
1566 | | r_installer_call_install_bundle_finish ( |
1567 | | RInstaller *proxy, |
1568 | | GAsyncResult *res, |
1569 | | GError **error) |
1570 | 0 | { |
1571 | 0 | GVariant *_ret; |
1572 | 0 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
1573 | 0 | if (_ret == NULL) |
1574 | 0 | goto _out; |
1575 | 0 | g_variant_get (_ret, |
1576 | 0 | "()"); |
1577 | 0 | g_variant_unref (_ret); |
1578 | 0 | _out: |
1579 | 0 | return _ret != NULL; |
1580 | 0 | } |
1581 | | |
1582 | | /** |
1583 | | * r_installer_call_install_bundle_sync: |
1584 | | * @proxy: A #RInstallerProxy. |
1585 | | * @arg_source: Argument to pass with the method invocation. |
1586 | | * @arg_args: Argument to pass with the method invocation. |
1587 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1588 | | * @error: Return location for error or %NULL. |
1589 | | * |
1590 | | * 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. |
1591 | | * |
1592 | | * See r_installer_call_install_bundle() for the asynchronous version of this method. |
1593 | | * |
1594 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1595 | | */ |
1596 | | gboolean |
1597 | | r_installer_call_install_bundle_sync ( |
1598 | | RInstaller *proxy, |
1599 | | const gchar *arg_source, |
1600 | | GVariant *arg_args, |
1601 | | GCancellable *cancellable, |
1602 | | GError **error) |
1603 | 0 | { |
1604 | 0 | GVariant *_ret; |
1605 | 0 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
1606 | 0 | "InstallBundle", |
1607 | 0 | g_variant_new ("(s@a{sv})", |
1608 | 0 | arg_source, |
1609 | 0 | arg_args), |
1610 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1611 | 0 | -1, |
1612 | 0 | cancellable, |
1613 | 0 | error); |
1614 | 0 | if (_ret == NULL) |
1615 | 0 | goto _out; |
1616 | 0 | g_variant_get (_ret, |
1617 | 0 | "()"); |
1618 | 0 | g_variant_unref (_ret); |
1619 | 0 | _out: |
1620 | 0 | return _ret != NULL; |
1621 | 0 | } |
1622 | | |
1623 | | /** |
1624 | | * r_installer_call_info: |
1625 | | * @proxy: A #RInstallerProxy. |
1626 | | * @arg_bundle: Argument to pass with the method invocation. |
1627 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1628 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
1629 | | * @user_data: User data to pass to @callback. |
1630 | | * |
1631 | | * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Info">Info()</link> D-Bus method on @proxy. |
1632 | | * 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()). |
1633 | | * You can then call r_installer_call_info_finish() to get the result of the operation. |
1634 | | * |
1635 | | * See r_installer_call_info_sync() for the synchronous, blocking version of this method. |
1636 | | */ |
1637 | | void |
1638 | | r_installer_call_info ( |
1639 | | RInstaller *proxy, |
1640 | | const gchar *arg_bundle, |
1641 | | GCancellable *cancellable, |
1642 | | GAsyncReadyCallback callback, |
1643 | | gpointer user_data) |
1644 | 0 | { |
1645 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
1646 | 0 | "Info", |
1647 | 0 | g_variant_new ("(s)", |
1648 | 0 | arg_bundle), |
1649 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1650 | 0 | -1, |
1651 | 0 | cancellable, |
1652 | 0 | callback, |
1653 | 0 | user_data); |
1654 | 0 | } |
1655 | | |
1656 | | /** |
1657 | | * r_installer_call_info_finish: |
1658 | | * @proxy: A #RInstallerProxy. |
1659 | | * @out_compatible: (out) (optional): Return location for return parameter or %NULL to ignore. |
1660 | | * @out_version: (out) (optional): Return location for return parameter or %NULL to ignore. |
1661 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_info(). |
1662 | | * @error: Return location for error or %NULL. |
1663 | | * |
1664 | | * Finishes an operation started with r_installer_call_info(). |
1665 | | * |
1666 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1667 | | */ |
1668 | | gboolean |
1669 | | r_installer_call_info_finish ( |
1670 | | RInstaller *proxy, |
1671 | | gchar **out_compatible, |
1672 | | gchar **out_version, |
1673 | | GAsyncResult *res, |
1674 | | GError **error) |
1675 | 0 | { |
1676 | 0 | GVariant *_ret; |
1677 | 0 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
1678 | 0 | if (_ret == NULL) |
1679 | 0 | goto _out; |
1680 | 0 | g_variant_get (_ret, |
1681 | 0 | "(ss)", |
1682 | 0 | out_compatible, |
1683 | 0 | out_version); |
1684 | 0 | g_variant_unref (_ret); |
1685 | 0 | _out: |
1686 | 0 | return _ret != NULL; |
1687 | 0 | } |
1688 | | |
1689 | | /** |
1690 | | * r_installer_call_info_sync: |
1691 | | * @proxy: A #RInstallerProxy. |
1692 | | * @arg_bundle: Argument to pass with the method invocation. |
1693 | | * @out_compatible: (out) (optional): Return location for return parameter or %NULL to ignore. |
1694 | | * @out_version: (out) (optional): Return location for return parameter or %NULL to ignore. |
1695 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1696 | | * @error: Return location for error or %NULL. |
1697 | | * |
1698 | | * 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. |
1699 | | * |
1700 | | * See r_installer_call_info() for the asynchronous version of this method. |
1701 | | * |
1702 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1703 | | */ |
1704 | | gboolean |
1705 | | r_installer_call_info_sync ( |
1706 | | RInstaller *proxy, |
1707 | | const gchar *arg_bundle, |
1708 | | gchar **out_compatible, |
1709 | | gchar **out_version, |
1710 | | GCancellable *cancellable, |
1711 | | GError **error) |
1712 | 0 | { |
1713 | 0 | GVariant *_ret; |
1714 | 0 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
1715 | 0 | "Info", |
1716 | 0 | g_variant_new ("(s)", |
1717 | 0 | arg_bundle), |
1718 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1719 | 0 | -1, |
1720 | 0 | cancellable, |
1721 | 0 | error); |
1722 | 0 | if (_ret == NULL) |
1723 | 0 | goto _out; |
1724 | 0 | g_variant_get (_ret, |
1725 | 0 | "(ss)", |
1726 | 0 | out_compatible, |
1727 | 0 | out_version); |
1728 | 0 | g_variant_unref (_ret); |
1729 | 0 | _out: |
1730 | 0 | return _ret != NULL; |
1731 | 0 | } |
1732 | | |
1733 | | /** |
1734 | | * r_installer_call_inspect_bundle: |
1735 | | * @proxy: A #RInstallerProxy. |
1736 | | * @arg_source: Argument to pass with the method invocation. |
1737 | | * @arg_args: Argument to pass with the method invocation. |
1738 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1739 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
1740 | | * @user_data: User data to pass to @callback. |
1741 | | * |
1742 | | * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.InspectBundle">InspectBundle()</link> D-Bus method on @proxy. |
1743 | | * 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()). |
1744 | | * You can then call r_installer_call_inspect_bundle_finish() to get the result of the operation. |
1745 | | * |
1746 | | * See r_installer_call_inspect_bundle_sync() for the synchronous, blocking version of this method. |
1747 | | */ |
1748 | | void |
1749 | | r_installer_call_inspect_bundle ( |
1750 | | RInstaller *proxy, |
1751 | | const gchar *arg_source, |
1752 | | GVariant *arg_args, |
1753 | | GCancellable *cancellable, |
1754 | | GAsyncReadyCallback callback, |
1755 | | gpointer user_data) |
1756 | 0 | { |
1757 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
1758 | 0 | "InspectBundle", |
1759 | 0 | g_variant_new ("(s@a{sv})", |
1760 | 0 | arg_source, |
1761 | 0 | arg_args), |
1762 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1763 | 0 | -1, |
1764 | 0 | cancellable, |
1765 | 0 | callback, |
1766 | 0 | user_data); |
1767 | 0 | } |
1768 | | |
1769 | | /** |
1770 | | * r_installer_call_inspect_bundle_finish: |
1771 | | * @proxy: A #RInstallerProxy. |
1772 | | * @out_info: (out) (optional): Return location for return parameter or %NULL to ignore. |
1773 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_inspect_bundle(). |
1774 | | * @error: Return location for error or %NULL. |
1775 | | * |
1776 | | * Finishes an operation started with r_installer_call_inspect_bundle(). |
1777 | | * |
1778 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1779 | | */ |
1780 | | gboolean |
1781 | | r_installer_call_inspect_bundle_finish ( |
1782 | | RInstaller *proxy, |
1783 | | GVariant **out_info, |
1784 | | GAsyncResult *res, |
1785 | | GError **error) |
1786 | 0 | { |
1787 | 0 | GVariant *_ret; |
1788 | 0 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
1789 | 0 | if (_ret == NULL) |
1790 | 0 | goto _out; |
1791 | 0 | g_variant_get (_ret, |
1792 | 0 | "(@a{sv})", |
1793 | 0 | out_info); |
1794 | 0 | g_variant_unref (_ret); |
1795 | 0 | _out: |
1796 | 0 | return _ret != NULL; |
1797 | 0 | } |
1798 | | |
1799 | | /** |
1800 | | * r_installer_call_inspect_bundle_sync: |
1801 | | * @proxy: A #RInstallerProxy. |
1802 | | * @arg_source: Argument to pass with the method invocation. |
1803 | | * @arg_args: Argument to pass with the method invocation. |
1804 | | * @out_info: (out) (optional): Return location for return parameter or %NULL to ignore. |
1805 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1806 | | * @error: Return location for error or %NULL. |
1807 | | * |
1808 | | * 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. |
1809 | | * |
1810 | | * See r_installer_call_inspect_bundle() for the asynchronous version of this method. |
1811 | | * |
1812 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1813 | | */ |
1814 | | gboolean |
1815 | | r_installer_call_inspect_bundle_sync ( |
1816 | | RInstaller *proxy, |
1817 | | const gchar *arg_source, |
1818 | | GVariant *arg_args, |
1819 | | GVariant **out_info, |
1820 | | GCancellable *cancellable, |
1821 | | GError **error) |
1822 | 0 | { |
1823 | 0 | GVariant *_ret; |
1824 | 0 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
1825 | 0 | "InspectBundle", |
1826 | 0 | g_variant_new ("(s@a{sv})", |
1827 | 0 | arg_source, |
1828 | 0 | arg_args), |
1829 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1830 | 0 | -1, |
1831 | 0 | cancellable, |
1832 | 0 | error); |
1833 | 0 | if (_ret == NULL) |
1834 | 0 | goto _out; |
1835 | 0 | g_variant_get (_ret, |
1836 | 0 | "(@a{sv})", |
1837 | 0 | out_info); |
1838 | 0 | g_variant_unref (_ret); |
1839 | 0 | _out: |
1840 | 0 | return _ret != NULL; |
1841 | 0 | } |
1842 | | |
1843 | | /** |
1844 | | * r_installer_call_mark: |
1845 | | * @proxy: A #RInstallerProxy. |
1846 | | * @arg_state: Argument to pass with the method invocation. |
1847 | | * @arg_slot_identifier: Argument to pass with the method invocation. |
1848 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1849 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
1850 | | * @user_data: User data to pass to @callback. |
1851 | | * |
1852 | | * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.Mark">Mark()</link> D-Bus method on @proxy. |
1853 | | * 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()). |
1854 | | * You can then call r_installer_call_mark_finish() to get the result of the operation. |
1855 | | * |
1856 | | * See r_installer_call_mark_sync() for the synchronous, blocking version of this method. |
1857 | | */ |
1858 | | void |
1859 | | r_installer_call_mark ( |
1860 | | RInstaller *proxy, |
1861 | | const gchar *arg_state, |
1862 | | const gchar *arg_slot_identifier, |
1863 | | GCancellable *cancellable, |
1864 | | GAsyncReadyCallback callback, |
1865 | | gpointer user_data) |
1866 | 0 | { |
1867 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
1868 | 0 | "Mark", |
1869 | 0 | g_variant_new ("(ss)", |
1870 | 0 | arg_state, |
1871 | 0 | arg_slot_identifier), |
1872 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1873 | 0 | -1, |
1874 | 0 | cancellable, |
1875 | 0 | callback, |
1876 | 0 | user_data); |
1877 | 0 | } |
1878 | | |
1879 | | /** |
1880 | | * r_installer_call_mark_finish: |
1881 | | * @proxy: A #RInstallerProxy. |
1882 | | * @out_slot_name: (out) (optional): Return location for return parameter or %NULL to ignore. |
1883 | | * @out_message: (out) (optional): Return location for return parameter or %NULL to ignore. |
1884 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_mark(). |
1885 | | * @error: Return location for error or %NULL. |
1886 | | * |
1887 | | * Finishes an operation started with r_installer_call_mark(). |
1888 | | * |
1889 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1890 | | */ |
1891 | | gboolean |
1892 | | r_installer_call_mark_finish ( |
1893 | | RInstaller *proxy, |
1894 | | gchar **out_slot_name, |
1895 | | gchar **out_message, |
1896 | | GAsyncResult *res, |
1897 | | GError **error) |
1898 | 0 | { |
1899 | 0 | GVariant *_ret; |
1900 | 0 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
1901 | 0 | if (_ret == NULL) |
1902 | 0 | goto _out; |
1903 | 0 | g_variant_get (_ret, |
1904 | 0 | "(ss)", |
1905 | 0 | out_slot_name, |
1906 | 0 | out_message); |
1907 | 0 | g_variant_unref (_ret); |
1908 | 0 | _out: |
1909 | 0 | return _ret != NULL; |
1910 | 0 | } |
1911 | | |
1912 | | /** |
1913 | | * r_installer_call_mark_sync: |
1914 | | * @proxy: A #RInstallerProxy. |
1915 | | * @arg_state: Argument to pass with the method invocation. |
1916 | | * @arg_slot_identifier: Argument to pass with the method invocation. |
1917 | | * @out_slot_name: (out) (optional): Return location for return parameter or %NULL to ignore. |
1918 | | * @out_message: (out) (optional): Return location for return parameter or %NULL to ignore. |
1919 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1920 | | * @error: Return location for error or %NULL. |
1921 | | * |
1922 | | * 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. |
1923 | | * |
1924 | | * See r_installer_call_mark() for the asynchronous version of this method. |
1925 | | * |
1926 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1927 | | */ |
1928 | | gboolean |
1929 | | r_installer_call_mark_sync ( |
1930 | | RInstaller *proxy, |
1931 | | const gchar *arg_state, |
1932 | | const gchar *arg_slot_identifier, |
1933 | | gchar **out_slot_name, |
1934 | | gchar **out_message, |
1935 | | GCancellable *cancellable, |
1936 | | GError **error) |
1937 | 0 | { |
1938 | 0 | GVariant *_ret; |
1939 | 0 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
1940 | 0 | "Mark", |
1941 | 0 | g_variant_new ("(ss)", |
1942 | 0 | arg_state, |
1943 | 0 | arg_slot_identifier), |
1944 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1945 | 0 | -1, |
1946 | 0 | cancellable, |
1947 | 0 | error); |
1948 | 0 | if (_ret == NULL) |
1949 | 0 | goto _out; |
1950 | 0 | g_variant_get (_ret, |
1951 | 0 | "(ss)", |
1952 | 0 | out_slot_name, |
1953 | 0 | out_message); |
1954 | 0 | g_variant_unref (_ret); |
1955 | 0 | _out: |
1956 | 0 | return _ret != NULL; |
1957 | 0 | } |
1958 | | |
1959 | | /** |
1960 | | * r_installer_call_get_slot_status: |
1961 | | * @proxy: A #RInstallerProxy. |
1962 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
1963 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
1964 | | * @user_data: User data to pass to @callback. |
1965 | | * |
1966 | | * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetSlotStatus">GetSlotStatus()</link> D-Bus method on @proxy. |
1967 | | * 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()). |
1968 | | * You can then call r_installer_call_get_slot_status_finish() to get the result of the operation. |
1969 | | * |
1970 | | * See r_installer_call_get_slot_status_sync() for the synchronous, blocking version of this method. |
1971 | | */ |
1972 | | void |
1973 | | r_installer_call_get_slot_status ( |
1974 | | RInstaller *proxy, |
1975 | | GCancellable *cancellable, |
1976 | | GAsyncReadyCallback callback, |
1977 | | gpointer user_data) |
1978 | 0 | { |
1979 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
1980 | 0 | "GetSlotStatus", |
1981 | 0 | g_variant_new ("()"), |
1982 | 0 | G_DBUS_CALL_FLAGS_NONE, |
1983 | 0 | -1, |
1984 | 0 | cancellable, |
1985 | 0 | callback, |
1986 | 0 | user_data); |
1987 | 0 | } |
1988 | | |
1989 | | /** |
1990 | | * r_installer_call_get_slot_status_finish: |
1991 | | * @proxy: A #RInstallerProxy. |
1992 | | * @out_slot_status_array: (out) (optional): Return location for return parameter or %NULL to ignore. |
1993 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_get_slot_status(). |
1994 | | * @error: Return location for error or %NULL. |
1995 | | * |
1996 | | * Finishes an operation started with r_installer_call_get_slot_status(). |
1997 | | * |
1998 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
1999 | | */ |
2000 | | gboolean |
2001 | | r_installer_call_get_slot_status_finish ( |
2002 | | RInstaller *proxy, |
2003 | | GVariant **out_slot_status_array, |
2004 | | GAsyncResult *res, |
2005 | | GError **error) |
2006 | 0 | { |
2007 | 0 | GVariant *_ret; |
2008 | 0 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
2009 | 0 | if (_ret == NULL) |
2010 | 0 | goto _out; |
2011 | 0 | g_variant_get (_ret, |
2012 | 0 | "(@a(sa{sv}))", |
2013 | 0 | out_slot_status_array); |
2014 | 0 | g_variant_unref (_ret); |
2015 | 0 | _out: |
2016 | 0 | return _ret != NULL; |
2017 | 0 | } |
2018 | | |
2019 | | /** |
2020 | | * r_installer_call_get_slot_status_sync: |
2021 | | * @proxy: A #RInstallerProxy. |
2022 | | * @out_slot_status_array: (out) (optional): Return location for return parameter or %NULL to ignore. |
2023 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
2024 | | * @error: Return location for error or %NULL. |
2025 | | * |
2026 | | * 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. |
2027 | | * |
2028 | | * See r_installer_call_get_slot_status() for the asynchronous version of this method. |
2029 | | * |
2030 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
2031 | | */ |
2032 | | gboolean |
2033 | | r_installer_call_get_slot_status_sync ( |
2034 | | RInstaller *proxy, |
2035 | | GVariant **out_slot_status_array, |
2036 | | GCancellable *cancellable, |
2037 | | GError **error) |
2038 | 0 | { |
2039 | 0 | GVariant *_ret; |
2040 | 0 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
2041 | 0 | "GetSlotStatus", |
2042 | 0 | g_variant_new ("()"), |
2043 | 0 | G_DBUS_CALL_FLAGS_NONE, |
2044 | 0 | -1, |
2045 | 0 | cancellable, |
2046 | 0 | error); |
2047 | 0 | if (_ret == NULL) |
2048 | 0 | goto _out; |
2049 | 0 | g_variant_get (_ret, |
2050 | 0 | "(@a(sa{sv}))", |
2051 | 0 | out_slot_status_array); |
2052 | 0 | g_variant_unref (_ret); |
2053 | 0 | _out: |
2054 | 0 | return _ret != NULL; |
2055 | 0 | } |
2056 | | |
2057 | | /** |
2058 | | * r_installer_call_get_artifact_status: |
2059 | | * @proxy: A #RInstallerProxy. |
2060 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
2061 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
2062 | | * @user_data: User data to pass to @callback. |
2063 | | * |
2064 | | * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetArtifactStatus">GetArtifactStatus()</link> D-Bus method on @proxy. |
2065 | | * 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()). |
2066 | | * You can then call r_installer_call_get_artifact_status_finish() to get the result of the operation. |
2067 | | * |
2068 | | * See r_installer_call_get_artifact_status_sync() for the synchronous, blocking version of this method. |
2069 | | */ |
2070 | | void |
2071 | | r_installer_call_get_artifact_status ( |
2072 | | RInstaller *proxy, |
2073 | | GCancellable *cancellable, |
2074 | | GAsyncReadyCallback callback, |
2075 | | gpointer user_data) |
2076 | 0 | { |
2077 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
2078 | 0 | "GetArtifactStatus", |
2079 | 0 | g_variant_new ("()"), |
2080 | 0 | G_DBUS_CALL_FLAGS_NONE, |
2081 | 0 | -1, |
2082 | 0 | cancellable, |
2083 | 0 | callback, |
2084 | 0 | user_data); |
2085 | 0 | } |
2086 | | |
2087 | | /** |
2088 | | * r_installer_call_get_artifact_status_finish: |
2089 | | * @proxy: A #RInstallerProxy. |
2090 | | * @out_artifacts: (out) (optional): Return location for return parameter or %NULL to ignore. |
2091 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_get_artifact_status(). |
2092 | | * @error: Return location for error or %NULL. |
2093 | | * |
2094 | | * Finishes an operation started with r_installer_call_get_artifact_status(). |
2095 | | * |
2096 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
2097 | | */ |
2098 | | gboolean |
2099 | | r_installer_call_get_artifact_status_finish ( |
2100 | | RInstaller *proxy, |
2101 | | GVariant **out_artifacts, |
2102 | | GAsyncResult *res, |
2103 | | GError **error) |
2104 | 0 | { |
2105 | 0 | GVariant *_ret; |
2106 | 0 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
2107 | 0 | if (_ret == NULL) |
2108 | 0 | goto _out; |
2109 | 0 | g_variant_get (_ret, |
2110 | 0 | "(@aa{sv})", |
2111 | 0 | out_artifacts); |
2112 | 0 | g_variant_unref (_ret); |
2113 | 0 | _out: |
2114 | 0 | return _ret != NULL; |
2115 | 0 | } |
2116 | | |
2117 | | /** |
2118 | | * r_installer_call_get_artifact_status_sync: |
2119 | | * @proxy: A #RInstallerProxy. |
2120 | | * @out_artifacts: (out) (optional): Return location for return parameter or %NULL to ignore. |
2121 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
2122 | | * @error: Return location for error or %NULL. |
2123 | | * |
2124 | | * 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. |
2125 | | * |
2126 | | * See r_installer_call_get_artifact_status() for the asynchronous version of this method. |
2127 | | * |
2128 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
2129 | | */ |
2130 | | gboolean |
2131 | | r_installer_call_get_artifact_status_sync ( |
2132 | | RInstaller *proxy, |
2133 | | GVariant **out_artifacts, |
2134 | | GCancellable *cancellable, |
2135 | | GError **error) |
2136 | 0 | { |
2137 | 0 | GVariant *_ret; |
2138 | 0 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
2139 | 0 | "GetArtifactStatus", |
2140 | 0 | g_variant_new ("()"), |
2141 | 0 | G_DBUS_CALL_FLAGS_NONE, |
2142 | 0 | -1, |
2143 | 0 | cancellable, |
2144 | 0 | error); |
2145 | 0 | if (_ret == NULL) |
2146 | 0 | goto _out; |
2147 | 0 | g_variant_get (_ret, |
2148 | 0 | "(@aa{sv})", |
2149 | 0 | out_artifacts); |
2150 | 0 | g_variant_unref (_ret); |
2151 | 0 | _out: |
2152 | 0 | return _ret != NULL; |
2153 | 0 | } |
2154 | | |
2155 | | /** |
2156 | | * r_installer_call_get_primary: |
2157 | | * @proxy: A #RInstallerProxy. |
2158 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
2159 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
2160 | | * @user_data: User data to pass to @callback. |
2161 | | * |
2162 | | * Asynchronously invokes the <link linkend="gdbus-method-de-pengutronix-rauc-Installer.GetPrimary">GetPrimary()</link> D-Bus method on @proxy. |
2163 | | * 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()). |
2164 | | * You can then call r_installer_call_get_primary_finish() to get the result of the operation. |
2165 | | * |
2166 | | * See r_installer_call_get_primary_sync() for the synchronous, blocking version of this method. |
2167 | | */ |
2168 | | void |
2169 | | r_installer_call_get_primary ( |
2170 | | RInstaller *proxy, |
2171 | | GCancellable *cancellable, |
2172 | | GAsyncReadyCallback callback, |
2173 | | gpointer user_data) |
2174 | 0 | { |
2175 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
2176 | 0 | "GetPrimary", |
2177 | 0 | g_variant_new ("()"), |
2178 | 0 | G_DBUS_CALL_FLAGS_NONE, |
2179 | 0 | -1, |
2180 | 0 | cancellable, |
2181 | 0 | callback, |
2182 | 0 | user_data); |
2183 | 0 | } |
2184 | | |
2185 | | /** |
2186 | | * r_installer_call_get_primary_finish: |
2187 | | * @proxy: A #RInstallerProxy. |
2188 | | * @out_primary: (out) (optional): Return location for return parameter or %NULL to ignore. |
2189 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_call_get_primary(). |
2190 | | * @error: Return location for error or %NULL. |
2191 | | * |
2192 | | * Finishes an operation started with r_installer_call_get_primary(). |
2193 | | * |
2194 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
2195 | | */ |
2196 | | gboolean |
2197 | | r_installer_call_get_primary_finish ( |
2198 | | RInstaller *proxy, |
2199 | | gchar **out_primary, |
2200 | | GAsyncResult *res, |
2201 | | GError **error) |
2202 | 0 | { |
2203 | 0 | GVariant *_ret; |
2204 | 0 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
2205 | 0 | if (_ret == NULL) |
2206 | 0 | goto _out; |
2207 | 0 | g_variant_get (_ret, |
2208 | 0 | "(s)", |
2209 | 0 | out_primary); |
2210 | 0 | g_variant_unref (_ret); |
2211 | 0 | _out: |
2212 | 0 | return _ret != NULL; |
2213 | 0 | } |
2214 | | |
2215 | | /** |
2216 | | * r_installer_call_get_primary_sync: |
2217 | | * @proxy: A #RInstallerProxy. |
2218 | | * @out_primary: (out) (optional): Return location for return parameter or %NULL to ignore. |
2219 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
2220 | | * @error: Return location for error or %NULL. |
2221 | | * |
2222 | | * 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. |
2223 | | * |
2224 | | * See r_installer_call_get_primary() for the asynchronous version of this method. |
2225 | | * |
2226 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
2227 | | */ |
2228 | | gboolean |
2229 | | r_installer_call_get_primary_sync ( |
2230 | | RInstaller *proxy, |
2231 | | gchar **out_primary, |
2232 | | GCancellable *cancellable, |
2233 | | GError **error) |
2234 | 0 | { |
2235 | 0 | GVariant *_ret; |
2236 | 0 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
2237 | 0 | "GetPrimary", |
2238 | 0 | g_variant_new ("()"), |
2239 | 0 | G_DBUS_CALL_FLAGS_NONE, |
2240 | 0 | -1, |
2241 | 0 | cancellable, |
2242 | 0 | error); |
2243 | 0 | if (_ret == NULL) |
2244 | 0 | goto _out; |
2245 | 0 | g_variant_get (_ret, |
2246 | 0 | "(s)", |
2247 | 0 | out_primary); |
2248 | 0 | g_variant_unref (_ret); |
2249 | 0 | _out: |
2250 | 0 | return _ret != NULL; |
2251 | 0 | } |
2252 | | |
2253 | | /** |
2254 | | * r_installer_complete_install: |
2255 | | * @object: A #RInstaller. |
2256 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
2257 | | * |
2258 | | * 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. |
2259 | | * |
2260 | | * This method will free @invocation, you cannot use it afterwards. |
2261 | | */ |
2262 | | void |
2263 | | r_installer_complete_install ( |
2264 | | RInstaller *object G_GNUC_UNUSED, |
2265 | | GDBusMethodInvocation *invocation) |
2266 | 0 | { |
2267 | 0 | g_dbus_method_invocation_return_value (invocation, |
2268 | 0 | g_variant_new ("()")); |
2269 | 0 | } |
2270 | | |
2271 | | /** |
2272 | | * r_installer_complete_install_bundle: |
2273 | | * @object: A #RInstaller. |
2274 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
2275 | | * |
2276 | | * 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. |
2277 | | * |
2278 | | * This method will free @invocation, you cannot use it afterwards. |
2279 | | */ |
2280 | | void |
2281 | | r_installer_complete_install_bundle ( |
2282 | | RInstaller *object G_GNUC_UNUSED, |
2283 | | GDBusMethodInvocation *invocation) |
2284 | 0 | { |
2285 | 0 | g_dbus_method_invocation_return_value (invocation, |
2286 | 0 | g_variant_new ("()")); |
2287 | 0 | } |
2288 | | |
2289 | | /** |
2290 | | * r_installer_complete_info: |
2291 | | * @object: A #RInstaller. |
2292 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
2293 | | * @compatible: Parameter to return. |
2294 | | * @version: Parameter to return. |
2295 | | * |
2296 | | * 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. |
2297 | | * |
2298 | | * This method will free @invocation, you cannot use it afterwards. |
2299 | | */ |
2300 | | void |
2301 | | r_installer_complete_info ( |
2302 | | RInstaller *object G_GNUC_UNUSED, |
2303 | | GDBusMethodInvocation *invocation, |
2304 | | const gchar *compatible, |
2305 | | const gchar *version) |
2306 | 0 | { |
2307 | 0 | g_dbus_method_invocation_return_value (invocation, |
2308 | 0 | g_variant_new ("(ss)", |
2309 | 0 | compatible, |
2310 | 0 | version)); |
2311 | 0 | } |
2312 | | |
2313 | | /** |
2314 | | * r_installer_complete_inspect_bundle: |
2315 | | * @object: A #RInstaller. |
2316 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
2317 | | * @info: Parameter to return. |
2318 | | * |
2319 | | * 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. |
2320 | | * |
2321 | | * This method will free @invocation, you cannot use it afterwards. |
2322 | | */ |
2323 | | void |
2324 | | r_installer_complete_inspect_bundle ( |
2325 | | RInstaller *object G_GNUC_UNUSED, |
2326 | | GDBusMethodInvocation *invocation, |
2327 | | GVariant *info) |
2328 | 0 | { |
2329 | 0 | g_dbus_method_invocation_return_value (invocation, |
2330 | 0 | g_variant_new ("(@a{sv})", |
2331 | 0 | info)); |
2332 | 0 | } |
2333 | | |
2334 | | /** |
2335 | | * r_installer_complete_mark: |
2336 | | * @object: A #RInstaller. |
2337 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
2338 | | * @slot_name: Parameter to return. |
2339 | | * @message: Parameter to return. |
2340 | | * |
2341 | | * 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. |
2342 | | * |
2343 | | * This method will free @invocation, you cannot use it afterwards. |
2344 | | */ |
2345 | | void |
2346 | | r_installer_complete_mark ( |
2347 | | RInstaller *object G_GNUC_UNUSED, |
2348 | | GDBusMethodInvocation *invocation, |
2349 | | const gchar *slot_name, |
2350 | | const gchar *message) |
2351 | 0 | { |
2352 | 0 | g_dbus_method_invocation_return_value (invocation, |
2353 | 0 | g_variant_new ("(ss)", |
2354 | 0 | slot_name, |
2355 | 0 | message)); |
2356 | 0 | } |
2357 | | |
2358 | | /** |
2359 | | * r_installer_complete_get_slot_status: |
2360 | | * @object: A #RInstaller. |
2361 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
2362 | | * @slot_status_array: Parameter to return. |
2363 | | * |
2364 | | * 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. |
2365 | | * |
2366 | | * This method will free @invocation, you cannot use it afterwards. |
2367 | | */ |
2368 | | void |
2369 | | r_installer_complete_get_slot_status ( |
2370 | | RInstaller *object G_GNUC_UNUSED, |
2371 | | GDBusMethodInvocation *invocation, |
2372 | | GVariant *slot_status_array) |
2373 | 0 | { |
2374 | 0 | g_dbus_method_invocation_return_value (invocation, |
2375 | 0 | g_variant_new ("(@a(sa{sv}))", |
2376 | 0 | slot_status_array)); |
2377 | 0 | } |
2378 | | |
2379 | | /** |
2380 | | * r_installer_complete_get_artifact_status: |
2381 | | * @object: A #RInstaller. |
2382 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
2383 | | * @artifacts: Parameter to return. |
2384 | | * |
2385 | | * 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. |
2386 | | * |
2387 | | * This method will free @invocation, you cannot use it afterwards. |
2388 | | */ |
2389 | | void |
2390 | | r_installer_complete_get_artifact_status ( |
2391 | | RInstaller *object G_GNUC_UNUSED, |
2392 | | GDBusMethodInvocation *invocation, |
2393 | | GVariant *artifacts) |
2394 | 0 | { |
2395 | 0 | g_dbus_method_invocation_return_value (invocation, |
2396 | 0 | g_variant_new ("(@aa{sv})", |
2397 | 0 | artifacts)); |
2398 | 0 | } |
2399 | | |
2400 | | /** |
2401 | | * r_installer_complete_get_primary: |
2402 | | * @object: A #RInstaller. |
2403 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
2404 | | * @primary: Parameter to return. |
2405 | | * |
2406 | | * 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. |
2407 | | * |
2408 | | * This method will free @invocation, you cannot use it afterwards. |
2409 | | */ |
2410 | | void |
2411 | | r_installer_complete_get_primary ( |
2412 | | RInstaller *object G_GNUC_UNUSED, |
2413 | | GDBusMethodInvocation *invocation, |
2414 | | const gchar *primary) |
2415 | 0 | { |
2416 | 0 | g_dbus_method_invocation_return_value (invocation, |
2417 | 0 | g_variant_new ("(s)", |
2418 | 0 | primary)); |
2419 | 0 | } |
2420 | | |
2421 | | /* ------------------------------------------------------------------------ */ |
2422 | | |
2423 | | /** |
2424 | | * RInstallerProxy: |
2425 | | * |
2426 | | * The #RInstallerProxy structure contains only private data and should only be accessed using the provided API. |
2427 | | */ |
2428 | | |
2429 | | /** |
2430 | | * RInstallerProxyClass: |
2431 | | * @parent_class: The parent class. |
2432 | | * |
2433 | | * Class structure for #RInstallerProxy. |
2434 | | */ |
2435 | | |
2436 | | struct _RInstallerProxyPrivate |
2437 | | { |
2438 | | GData *qdata; |
2439 | | }; |
2440 | | |
2441 | | static void r_installer_proxy_iface_init (RInstallerIface *iface); |
2442 | | |
2443 | | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
2444 | | G_DEFINE_TYPE_WITH_CODE (RInstallerProxy, r_installer_proxy, G_TYPE_DBUS_PROXY, |
2445 | | G_ADD_PRIVATE (RInstallerProxy) |
2446 | | G_IMPLEMENT_INTERFACE (R_TYPE_INSTALLER, r_installer_proxy_iface_init)) |
2447 | | |
2448 | | #else |
2449 | | G_DEFINE_TYPE_WITH_CODE (RInstallerProxy, r_installer_proxy, G_TYPE_DBUS_PROXY, |
2450 | | G_IMPLEMENT_INTERFACE (R_TYPE_INSTALLER, r_installer_proxy_iface_init)) |
2451 | | |
2452 | | #endif |
2453 | | static void |
2454 | | r_installer_proxy_finalize (GObject *object) |
2455 | 0 | { |
2456 | 0 | RInstallerProxy *proxy = R_INSTALLER_PROXY (object); |
2457 | 0 | g_datalist_clear (&proxy->priv->qdata); |
2458 | 0 | G_OBJECT_CLASS (r_installer_proxy_parent_class)->finalize (object); |
2459 | 0 | } |
2460 | | |
2461 | | static void |
2462 | | r_installer_proxy_get_property (GObject *object, |
2463 | | guint prop_id, |
2464 | | GValue *value, |
2465 | | GParamSpec *pspec G_GNUC_UNUSED) |
2466 | 0 | { |
2467 | 0 | const _ExtendedGDBusPropertyInfo *info; |
2468 | 0 | GVariant *variant; |
2469 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 6); |
2470 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _r_installer_property_info_pointers[prop_id - 1]; |
2471 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); |
2472 | 0 | if (info->use_gvariant) |
2473 | 0 | { |
2474 | 0 | g_value_set_variant (value, variant); |
2475 | 0 | } |
2476 | 0 | else |
2477 | 0 | { |
2478 | 0 | if (variant != NULL) |
2479 | 0 | g_dbus_gvariant_to_gvalue (variant, value); |
2480 | 0 | } |
2481 | 0 | if (variant != NULL) |
2482 | 0 | g_variant_unref (variant); |
2483 | 0 | } |
2484 | | |
2485 | | static void |
2486 | | r_installer_proxy_set_property_cb (GDBusProxy *proxy, |
2487 | | GAsyncResult *res, |
2488 | | gpointer user_data) |
2489 | 0 | { |
2490 | 0 | const _ExtendedGDBusPropertyInfo *info = user_data; |
2491 | 0 | GError *error; |
2492 | 0 | GVariant *_ret; |
2493 | 0 | error = NULL; |
2494 | 0 | _ret = g_dbus_proxy_call_finish (proxy, res, &error); |
2495 | 0 | if (!_ret) |
2496 | 0 | { |
2497 | 0 | g_warning ("Error setting property '%s' on interface de.pengutronix.rauc.Installer: %s (%s, %d)", |
2498 | 0 | info->parent_struct.name, |
2499 | 0 | error->message, g_quark_to_string (error->domain), error->code); |
2500 | 0 | g_error_free (error); |
2501 | 0 | } |
2502 | 0 | else |
2503 | 0 | { |
2504 | 0 | g_variant_unref (_ret); |
2505 | 0 | } |
2506 | 0 | } |
2507 | | |
2508 | | static void |
2509 | | r_installer_proxy_set_property (GObject *object, |
2510 | | guint prop_id, |
2511 | | const GValue *value, |
2512 | | GParamSpec *pspec G_GNUC_UNUSED) |
2513 | 0 | { |
2514 | 0 | const _ExtendedGDBusPropertyInfo *info; |
2515 | 0 | GVariant *variant; |
2516 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 6); |
2517 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _r_installer_property_info_pointers[prop_id - 1]; |
2518 | 0 | variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); |
2519 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (object), |
2520 | 0 | "org.freedesktop.DBus.Properties.Set", |
2521 | 0 | g_variant_new ("(ssv)", "de.pengutronix.rauc.Installer", info->parent_struct.name, variant), |
2522 | 0 | G_DBUS_CALL_FLAGS_NONE, |
2523 | 0 | -1, |
2524 | 0 | NULL, (GAsyncReadyCallback) r_installer_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); |
2525 | 0 | g_variant_unref (variant); |
2526 | 0 | } |
2527 | | |
2528 | | static void |
2529 | | r_installer_proxy_g_signal (GDBusProxy *proxy, |
2530 | | const gchar *sender_name G_GNUC_UNUSED, |
2531 | | const gchar *signal_name, |
2532 | | GVariant *parameters) |
2533 | 0 | { |
2534 | 0 | _ExtendedGDBusSignalInfo *info; |
2535 | 0 | GVariantIter iter; |
2536 | 0 | GVariant *child; |
2537 | 0 | GValue *paramv; |
2538 | 0 | gsize num_params; |
2539 | 0 | gsize n; |
2540 | 0 | guint signal_id; |
2541 | 0 | info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct, signal_name); |
2542 | 0 | if (info == NULL) |
2543 | 0 | return; |
2544 | 0 | num_params = g_variant_n_children (parameters); |
2545 | 0 | paramv = g_new0 (GValue, num_params + 1); |
2546 | 0 | g_value_init (¶mv[0], R_TYPE_INSTALLER); |
2547 | 0 | g_value_set_object (¶mv[0], proxy); |
2548 | 0 | g_variant_iter_init (&iter, parameters); |
2549 | 0 | n = 1; |
2550 | 0 | while ((child = g_variant_iter_next_value (&iter)) != NULL) |
2551 | 0 | { |
2552 | 0 | _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; |
2553 | 0 | if (arg_info->use_gvariant) |
2554 | 0 | { |
2555 | 0 | g_value_init (¶mv[n], G_TYPE_VARIANT); |
2556 | 0 | g_value_set_variant (¶mv[n], child); |
2557 | 0 | n++; |
2558 | 0 | } |
2559 | 0 | else |
2560 | 0 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
2561 | 0 | g_variant_unref (child); |
2562 | 0 | } |
2563 | 0 | signal_id = g_signal_lookup (info->signal_name, R_TYPE_INSTALLER); |
2564 | 0 | g_signal_emitv (paramv, signal_id, 0, NULL); |
2565 | 0 | for (n = 0; n < num_params + 1; n++) |
2566 | 0 | g_value_unset (¶mv[n]); |
2567 | 0 | g_free (paramv); |
2568 | 0 | } |
2569 | | |
2570 | | static void |
2571 | | r_installer_proxy_g_properties_changed (GDBusProxy *_proxy, |
2572 | | GVariant *changed_properties, |
2573 | | const gchar *const *invalidated_properties) |
2574 | 0 | { |
2575 | 0 | RInstallerProxy *proxy = R_INSTALLER_PROXY (_proxy); |
2576 | 0 | guint n; |
2577 | 0 | const gchar *key; |
2578 | 0 | GVariantIter *iter; |
2579 | 0 | _ExtendedGDBusPropertyInfo *info; |
2580 | 0 | g_variant_get (changed_properties, "a{sv}", &iter); |
2581 | 0 | while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) |
2582 | 0 | { |
2583 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct, key); |
2584 | 0 | g_datalist_remove_data (&proxy->priv->qdata, key); |
2585 | 0 | if (info != NULL) |
2586 | 0 | g_object_notify (G_OBJECT (proxy), info->hyphen_name); |
2587 | 0 | } |
2588 | 0 | g_variant_iter_free (iter); |
2589 | 0 | for (n = 0; invalidated_properties[n] != NULL; n++) |
2590 | 0 | { |
2591 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct, invalidated_properties[n]); |
2592 | 0 | g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); |
2593 | 0 | if (info != NULL) |
2594 | 0 | g_object_notify (G_OBJECT (proxy), info->hyphen_name); |
2595 | 0 | } |
2596 | 0 | } |
2597 | | |
2598 | | static const gchar * |
2599 | | r_installer_proxy_get_operation (RInstaller *object) |
2600 | 0 | { |
2601 | 0 | RInstallerProxy *proxy = R_INSTALLER_PROXY (object); |
2602 | 0 | GVariant *variant; |
2603 | 0 | const gchar *value = NULL; |
2604 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Operation"); |
2605 | 0 | if (variant != NULL) |
2606 | 0 | { |
2607 | 0 | value = g_variant_get_string (variant, NULL); |
2608 | 0 | g_variant_unref (variant); |
2609 | 0 | } |
2610 | 0 | return value; |
2611 | 0 | } |
2612 | | |
2613 | | static const gchar * |
2614 | | r_installer_proxy_get_last_error (RInstaller *object) |
2615 | 0 | { |
2616 | 0 | RInstallerProxy *proxy = R_INSTALLER_PROXY (object); |
2617 | 0 | GVariant *variant; |
2618 | 0 | const gchar *value = NULL; |
2619 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "LastError"); |
2620 | 0 | if (variant != NULL) |
2621 | 0 | { |
2622 | 0 | value = g_variant_get_string (variant, NULL); |
2623 | 0 | g_variant_unref (variant); |
2624 | 0 | } |
2625 | 0 | return value; |
2626 | 0 | } |
2627 | | |
2628 | | static GVariant * |
2629 | | r_installer_proxy_get_progress (RInstaller *object) |
2630 | 0 | { |
2631 | 0 | RInstallerProxy *proxy = R_INSTALLER_PROXY (object); |
2632 | 0 | GVariant *variant; |
2633 | 0 | GVariant *value = NULL; |
2634 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Progress"); |
2635 | 0 | value = variant; |
2636 | 0 | if (variant != NULL) |
2637 | 0 | g_variant_unref (variant); |
2638 | 0 | return value; |
2639 | 0 | } |
2640 | | |
2641 | | static const gchar * |
2642 | | r_installer_proxy_get_compatible (RInstaller *object) |
2643 | 0 | { |
2644 | 0 | RInstallerProxy *proxy = R_INSTALLER_PROXY (object); |
2645 | 0 | GVariant *variant; |
2646 | 0 | const gchar *value = NULL; |
2647 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Compatible"); |
2648 | 0 | if (variant != NULL) |
2649 | 0 | { |
2650 | 0 | value = g_variant_get_string (variant, NULL); |
2651 | 0 | g_variant_unref (variant); |
2652 | 0 | } |
2653 | 0 | return value; |
2654 | 0 | } |
2655 | | |
2656 | | static const gchar * |
2657 | | r_installer_proxy_get_variant (RInstaller *object) |
2658 | 0 | { |
2659 | 0 | RInstallerProxy *proxy = R_INSTALLER_PROXY (object); |
2660 | 0 | GVariant *variant; |
2661 | 0 | const gchar *value = NULL; |
2662 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Variant"); |
2663 | 0 | if (variant != NULL) |
2664 | 0 | { |
2665 | 0 | value = g_variant_get_string (variant, NULL); |
2666 | 0 | g_variant_unref (variant); |
2667 | 0 | } |
2668 | 0 | return value; |
2669 | 0 | } |
2670 | | |
2671 | | static const gchar * |
2672 | | r_installer_proxy_get_boot_slot (RInstaller *object) |
2673 | 0 | { |
2674 | 0 | RInstallerProxy *proxy = R_INSTALLER_PROXY (object); |
2675 | 0 | GVariant *variant; |
2676 | 0 | const gchar *value = NULL; |
2677 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "BootSlot"); |
2678 | 0 | if (variant != NULL) |
2679 | 0 | { |
2680 | 0 | value = g_variant_get_string (variant, NULL); |
2681 | 0 | g_variant_unref (variant); |
2682 | 0 | } |
2683 | 0 | return value; |
2684 | 0 | } |
2685 | | |
2686 | | static void |
2687 | | r_installer_proxy_init (RInstallerProxy *proxy) |
2688 | 0 | { |
2689 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
2690 | 0 | proxy->priv = r_installer_proxy_get_instance_private (proxy); |
2691 | | #else |
2692 | | proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, R_TYPE_INSTALLER_PROXY, RInstallerProxyPrivate); |
2693 | | #endif |
2694 | |
|
2695 | 0 | g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), r_installer_interface_info ()); |
2696 | 0 | } |
2697 | | |
2698 | | static void |
2699 | | r_installer_proxy_class_init (RInstallerProxyClass *klass) |
2700 | 0 | { |
2701 | 0 | GObjectClass *gobject_class; |
2702 | 0 | GDBusProxyClass *proxy_class; |
2703 | |
|
2704 | 0 | gobject_class = G_OBJECT_CLASS (klass); |
2705 | 0 | gobject_class->finalize = r_installer_proxy_finalize; |
2706 | 0 | gobject_class->get_property = r_installer_proxy_get_property; |
2707 | 0 | gobject_class->set_property = r_installer_proxy_set_property; |
2708 | |
|
2709 | 0 | proxy_class = G_DBUS_PROXY_CLASS (klass); |
2710 | 0 | proxy_class->g_signal = r_installer_proxy_g_signal; |
2711 | 0 | proxy_class->g_properties_changed = r_installer_proxy_g_properties_changed; |
2712 | |
|
2713 | 0 | r_installer_override_properties (gobject_class, 1); |
2714 | |
|
2715 | | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
2716 | | g_type_class_add_private (klass, sizeof (RInstallerProxyPrivate)); |
2717 | | #endif |
2718 | 0 | } |
2719 | | |
2720 | | static void |
2721 | | r_installer_proxy_iface_init (RInstallerIface *iface) |
2722 | 0 | { |
2723 | 0 | iface->get_operation = r_installer_proxy_get_operation; |
2724 | 0 | iface->get_last_error = r_installer_proxy_get_last_error; |
2725 | 0 | iface->get_progress = r_installer_proxy_get_progress; |
2726 | 0 | iface->get_compatible = r_installer_proxy_get_compatible; |
2727 | 0 | iface->get_variant = r_installer_proxy_get_variant; |
2728 | 0 | iface->get_boot_slot = r_installer_proxy_get_boot_slot; |
2729 | 0 | } |
2730 | | |
2731 | | /** |
2732 | | * r_installer_proxy_new: |
2733 | | * @connection: A #GDBusConnection. |
2734 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
2735 | | * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. |
2736 | | * @object_path: An object path. |
2737 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
2738 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied. |
2739 | | * @user_data: User data to pass to @callback. |
2740 | | * |
2741 | | * 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. |
2742 | | * |
2743 | | * 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()). |
2744 | | * You can then call r_installer_proxy_new_finish() to get the result of the operation. |
2745 | | * |
2746 | | * See r_installer_proxy_new_sync() for the synchronous, blocking version of this constructor. |
2747 | | */ |
2748 | | void |
2749 | | r_installer_proxy_new ( |
2750 | | GDBusConnection *connection, |
2751 | | GDBusProxyFlags flags, |
2752 | | const gchar *name, |
2753 | | const gchar *object_path, |
2754 | | GCancellable *cancellable, |
2755 | | GAsyncReadyCallback callback, |
2756 | | gpointer user_data) |
2757 | 0 | { |
2758 | 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); |
2759 | 0 | } |
2760 | | |
2761 | | /** |
2762 | | * r_installer_proxy_new_finish: |
2763 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_proxy_new(). |
2764 | | * @error: Return location for error or %NULL |
2765 | | * |
2766 | | * Finishes an operation started with r_installer_proxy_new(). |
2767 | | * |
2768 | | * Returns: (transfer full) (type RInstallerProxy): The constructed proxy object or %NULL if @error is set. |
2769 | | */ |
2770 | | RInstaller * |
2771 | | r_installer_proxy_new_finish ( |
2772 | | GAsyncResult *res, |
2773 | | GError **error) |
2774 | 0 | { |
2775 | 0 | GObject *ret; |
2776 | 0 | GObject *source_object; |
2777 | 0 | source_object = g_async_result_get_source_object (res); |
2778 | 0 | ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); |
2779 | 0 | g_object_unref (source_object); |
2780 | 0 | if (ret != NULL) |
2781 | 0 | return R_INSTALLER (ret); |
2782 | 0 | else |
2783 | 0 | return NULL; |
2784 | 0 | } |
2785 | | |
2786 | | /** |
2787 | | * r_installer_proxy_new_sync: |
2788 | | * @connection: A #GDBusConnection. |
2789 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
2790 | | * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. |
2791 | | * @object_path: An object path. |
2792 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
2793 | | * @error: Return location for error or %NULL |
2794 | | * |
2795 | | * 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. |
2796 | | * |
2797 | | * The calling thread is blocked until a reply is received. |
2798 | | * |
2799 | | * See r_installer_proxy_new() for the asynchronous version of this constructor. |
2800 | | * |
2801 | | * Returns: (transfer full) (type RInstallerProxy): The constructed proxy object or %NULL if @error is set. |
2802 | | */ |
2803 | | RInstaller * |
2804 | | r_installer_proxy_new_sync ( |
2805 | | GDBusConnection *connection, |
2806 | | GDBusProxyFlags flags, |
2807 | | const gchar *name, |
2808 | | const gchar *object_path, |
2809 | | GCancellable *cancellable, |
2810 | | GError **error) |
2811 | 0 | { |
2812 | 0 | GInitable *ret; |
2813 | 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); |
2814 | 0 | if (ret != NULL) |
2815 | 0 | return R_INSTALLER (ret); |
2816 | 0 | else |
2817 | 0 | return NULL; |
2818 | 0 | } |
2819 | | |
2820 | | |
2821 | | /** |
2822 | | * r_installer_proxy_new_for_bus: |
2823 | | * @bus_type: A #GBusType. |
2824 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
2825 | | * @name: A bus name (well-known or unique). |
2826 | | * @object_path: An object path. |
2827 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
2828 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied. |
2829 | | * @user_data: User data to pass to @callback. |
2830 | | * |
2831 | | * Like r_installer_proxy_new() but takes a #GBusType instead of a #GDBusConnection. |
2832 | | * |
2833 | | * 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()). |
2834 | | * You can then call r_installer_proxy_new_for_bus_finish() to get the result of the operation. |
2835 | | * |
2836 | | * See r_installer_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. |
2837 | | */ |
2838 | | void |
2839 | | r_installer_proxy_new_for_bus ( |
2840 | | GBusType bus_type, |
2841 | | GDBusProxyFlags flags, |
2842 | | const gchar *name, |
2843 | | const gchar *object_path, |
2844 | | GCancellable *cancellable, |
2845 | | GAsyncReadyCallback callback, |
2846 | | gpointer user_data) |
2847 | 0 | { |
2848 | 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); |
2849 | 0 | } |
2850 | | |
2851 | | /** |
2852 | | * r_installer_proxy_new_for_bus_finish: |
2853 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to r_installer_proxy_new_for_bus(). |
2854 | | * @error: Return location for error or %NULL |
2855 | | * |
2856 | | * Finishes an operation started with r_installer_proxy_new_for_bus(). |
2857 | | * |
2858 | | * Returns: (transfer full) (type RInstallerProxy): The constructed proxy object or %NULL if @error is set. |
2859 | | */ |
2860 | | RInstaller * |
2861 | | r_installer_proxy_new_for_bus_finish ( |
2862 | | GAsyncResult *res, |
2863 | | GError **error) |
2864 | 0 | { |
2865 | 0 | GObject *ret; |
2866 | 0 | GObject *source_object; |
2867 | 0 | source_object = g_async_result_get_source_object (res); |
2868 | 0 | ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); |
2869 | 0 | g_object_unref (source_object); |
2870 | 0 | if (ret != NULL) |
2871 | 0 | return R_INSTALLER (ret); |
2872 | 0 | else |
2873 | 0 | return NULL; |
2874 | 0 | } |
2875 | | |
2876 | | /** |
2877 | | * r_installer_proxy_new_for_bus_sync: |
2878 | | * @bus_type: A #GBusType. |
2879 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
2880 | | * @name: A bus name (well-known or unique). |
2881 | | * @object_path: An object path. |
2882 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
2883 | | * @error: Return location for error or %NULL |
2884 | | * |
2885 | | * Like r_installer_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. |
2886 | | * |
2887 | | * The calling thread is blocked until a reply is received. |
2888 | | * |
2889 | | * See r_installer_proxy_new_for_bus() for the asynchronous version of this constructor. |
2890 | | * |
2891 | | * Returns: (transfer full) (type RInstallerProxy): The constructed proxy object or %NULL if @error is set. |
2892 | | */ |
2893 | | RInstaller * |
2894 | | r_installer_proxy_new_for_bus_sync ( |
2895 | | GBusType bus_type, |
2896 | | GDBusProxyFlags flags, |
2897 | | const gchar *name, |
2898 | | const gchar *object_path, |
2899 | | GCancellable *cancellable, |
2900 | | GError **error) |
2901 | 0 | { |
2902 | 0 | GInitable *ret; |
2903 | 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); |
2904 | 0 | if (ret != NULL) |
2905 | 0 | return R_INSTALLER (ret); |
2906 | 0 | else |
2907 | 0 | return NULL; |
2908 | 0 | } |
2909 | | |
2910 | | |
2911 | | /* ------------------------------------------------------------------------ */ |
2912 | | |
2913 | | /** |
2914 | | * RInstallerSkeleton: |
2915 | | * |
2916 | | * The #RInstallerSkeleton structure contains only private data and should only be accessed using the provided API. |
2917 | | */ |
2918 | | |
2919 | | /** |
2920 | | * RInstallerSkeletonClass: |
2921 | | * @parent_class: The parent class. |
2922 | | * |
2923 | | * Class structure for #RInstallerSkeleton. |
2924 | | */ |
2925 | | |
2926 | | struct _RInstallerSkeletonPrivate |
2927 | | { |
2928 | | GValue *properties; |
2929 | | GList *changed_properties; |
2930 | | GSource *changed_properties_idle_source; |
2931 | | GMainContext *context; |
2932 | | GMutex lock; |
2933 | | }; |
2934 | | |
2935 | | static void |
2936 | | _r_installer_skeleton_handle_method_call ( |
2937 | | GDBusConnection *connection G_GNUC_UNUSED, |
2938 | | const gchar *sender G_GNUC_UNUSED, |
2939 | | const gchar *object_path G_GNUC_UNUSED, |
2940 | | const gchar *interface_name, |
2941 | | const gchar *method_name, |
2942 | | GVariant *parameters, |
2943 | | GDBusMethodInvocation *invocation, |
2944 | | gpointer user_data) |
2945 | 0 | { |
2946 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (user_data); |
2947 | 0 | _ExtendedGDBusMethodInfo *info; |
2948 | 0 | GVariantIter iter; |
2949 | 0 | GVariant *child; |
2950 | 0 | GValue *paramv; |
2951 | 0 | gsize num_params; |
2952 | 0 | guint num_extra; |
2953 | 0 | gsize n; |
2954 | 0 | guint signal_id; |
2955 | 0 | GValue return_value = G_VALUE_INIT; |
2956 | 0 | info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); |
2957 | 0 | g_assert (info != NULL); |
2958 | 0 | num_params = g_variant_n_children (parameters); |
2959 | 0 | num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); |
2960 | 0 | n = 0; |
2961 | 0 | g_value_init (¶mv[n], R_TYPE_INSTALLER); |
2962 | 0 | g_value_set_object (¶mv[n++], skeleton); |
2963 | 0 | g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); |
2964 | 0 | g_value_set_object (¶mv[n++], invocation); |
2965 | 0 | if (info->pass_fdlist) |
2966 | 0 | { |
2967 | 0 | #ifdef G_OS_UNIX |
2968 | 0 | g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); |
2969 | 0 | g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); |
2970 | | #else |
2971 | | g_assert_not_reached (); |
2972 | | #endif |
2973 | 0 | } |
2974 | 0 | g_variant_iter_init (&iter, parameters); |
2975 | 0 | while ((child = g_variant_iter_next_value (&iter)) != NULL) |
2976 | 0 | { |
2977 | 0 | _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; |
2978 | 0 | if (arg_info->use_gvariant) |
2979 | 0 | { |
2980 | 0 | g_value_init (¶mv[n], G_TYPE_VARIANT); |
2981 | 0 | g_value_set_variant (¶mv[n], child); |
2982 | 0 | n++; |
2983 | 0 | } |
2984 | 0 | else |
2985 | 0 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
2986 | 0 | g_variant_unref (child); |
2987 | 0 | } |
2988 | 0 | signal_id = g_signal_lookup (info->signal_name, R_TYPE_INSTALLER); |
2989 | 0 | g_value_init (&return_value, G_TYPE_BOOLEAN); |
2990 | 0 | g_signal_emitv (paramv, signal_id, 0, &return_value); |
2991 | 0 | if (!g_value_get_boolean (&return_value)) |
2992 | 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); |
2993 | 0 | g_value_unset (&return_value); |
2994 | 0 | for (n = 0; n < num_params + num_extra; n++) |
2995 | 0 | g_value_unset (¶mv[n]); |
2996 | 0 | g_free (paramv); |
2997 | 0 | } |
2998 | | |
2999 | | static GVariant * |
3000 | | _r_installer_skeleton_handle_get_property ( |
3001 | | GDBusConnection *connection G_GNUC_UNUSED, |
3002 | | const gchar *sender G_GNUC_UNUSED, |
3003 | | const gchar *object_path G_GNUC_UNUSED, |
3004 | | const gchar *interface_name G_GNUC_UNUSED, |
3005 | | const gchar *property_name, |
3006 | | GError **error, |
3007 | | gpointer user_data) |
3008 | 0 | { |
3009 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (user_data); |
3010 | 0 | GValue value = G_VALUE_INIT; |
3011 | 0 | GParamSpec *pspec; |
3012 | 0 | _ExtendedGDBusPropertyInfo *info; |
3013 | 0 | GVariant *ret; |
3014 | 0 | ret = NULL; |
3015 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct, property_name); |
3016 | 0 | g_assert (info != NULL); |
3017 | 0 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); |
3018 | 0 | if (pspec == NULL) |
3019 | 0 | { |
3020 | 0 | g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); |
3021 | 0 | } |
3022 | 0 | else |
3023 | 0 | { |
3024 | 0 | g_value_init (&value, pspec->value_type); |
3025 | 0 | g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); |
3026 | 0 | ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); |
3027 | 0 | g_value_unset (&value); |
3028 | 0 | } |
3029 | 0 | return ret; |
3030 | 0 | } |
3031 | | |
3032 | | static gboolean |
3033 | | _r_installer_skeleton_handle_set_property ( |
3034 | | GDBusConnection *connection G_GNUC_UNUSED, |
3035 | | const gchar *sender G_GNUC_UNUSED, |
3036 | | const gchar *object_path G_GNUC_UNUSED, |
3037 | | const gchar *interface_name G_GNUC_UNUSED, |
3038 | | const gchar *property_name, |
3039 | | GVariant *variant, |
3040 | | GError **error, |
3041 | | gpointer user_data) |
3042 | 0 | { |
3043 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (user_data); |
3044 | 0 | GValue value = G_VALUE_INIT; |
3045 | 0 | GParamSpec *pspec; |
3046 | 0 | _ExtendedGDBusPropertyInfo *info; |
3047 | 0 | gboolean ret; |
3048 | 0 | ret = FALSE; |
3049 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_r_installer_interface_info.parent_struct, property_name); |
3050 | 0 | g_assert (info != NULL); |
3051 | 0 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); |
3052 | 0 | if (pspec == NULL) |
3053 | 0 | { |
3054 | 0 | g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); |
3055 | 0 | } |
3056 | 0 | else |
3057 | 0 | { |
3058 | 0 | if (info->use_gvariant) |
3059 | 0 | g_value_set_variant (&value, variant); |
3060 | 0 | else |
3061 | 0 | g_dbus_gvariant_to_gvalue (variant, &value); |
3062 | 0 | g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); |
3063 | 0 | g_value_unset (&value); |
3064 | 0 | ret = TRUE; |
3065 | 0 | } |
3066 | 0 | return ret; |
3067 | 0 | } |
3068 | | |
3069 | | static const GDBusInterfaceVTable _r_installer_skeleton_vtable = |
3070 | | { |
3071 | | _r_installer_skeleton_handle_method_call, |
3072 | | _r_installer_skeleton_handle_get_property, |
3073 | | _r_installer_skeleton_handle_set_property, |
3074 | | {NULL} |
3075 | | }; |
3076 | | |
3077 | | static GDBusInterfaceInfo * |
3078 | | r_installer_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
3079 | 0 | { |
3080 | 0 | return r_installer_interface_info (); |
3081 | 0 | } |
3082 | | |
3083 | | static GDBusInterfaceVTable * |
3084 | | r_installer_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
3085 | 0 | { |
3086 | 0 | return (GDBusInterfaceVTable *) &_r_installer_skeleton_vtable; |
3087 | 0 | } |
3088 | | |
3089 | | static GVariant * |
3090 | | r_installer_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) |
3091 | 0 | { |
3092 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (_skeleton); |
3093 | |
|
3094 | 0 | GVariantBuilder builder; |
3095 | 0 | guint n; |
3096 | 0 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); |
3097 | 0 | if (_r_installer_interface_info.parent_struct.properties == NULL) |
3098 | 0 | goto out; |
3099 | 0 | for (n = 0; _r_installer_interface_info.parent_struct.properties[n] != NULL; n++) |
3100 | 0 | { |
3101 | 0 | GDBusPropertyInfo *info = _r_installer_interface_info.parent_struct.properties[n]; |
3102 | 0 | if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) |
3103 | 0 | { |
3104 | 0 | GVariant *value; |
3105 | 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); |
3106 | 0 | if (value != NULL) |
3107 | 0 | { |
3108 | 0 | g_variant_take_ref (value); |
3109 | 0 | g_variant_builder_add (&builder, "{sv}", info->name, value); |
3110 | 0 | g_variant_unref (value); |
3111 | 0 | } |
3112 | 0 | } |
3113 | 0 | } |
3114 | 0 | out: |
3115 | 0 | return g_variant_builder_end (&builder); |
3116 | 0 | } |
3117 | | |
3118 | | static gboolean _r_installer_emit_changed (gpointer user_data); |
3119 | | |
3120 | | static void |
3121 | | r_installer_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) |
3122 | 0 | { |
3123 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (_skeleton); |
3124 | 0 | gboolean emit_changed = FALSE; |
3125 | |
|
3126 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3127 | 0 | if (skeleton->priv->changed_properties_idle_source != NULL) |
3128 | 0 | { |
3129 | 0 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
3130 | 0 | skeleton->priv->changed_properties_idle_source = NULL; |
3131 | 0 | emit_changed = TRUE; |
3132 | 0 | } |
3133 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3134 | |
|
3135 | 0 | if (emit_changed) |
3136 | 0 | _r_installer_emit_changed (skeleton); |
3137 | 0 | } |
3138 | | |
3139 | | static void |
3140 | | _r_installer_on_signal_completed ( |
3141 | | RInstaller *object, |
3142 | | gint arg_result) |
3143 | 0 | { |
3144 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3145 | |
|
3146 | 0 | GList *connections, *l; |
3147 | 0 | GVariant *signal_variant; |
3148 | 0 | connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); |
3149 | |
|
3150 | 0 | signal_variant = g_variant_ref_sink (g_variant_new ("(i)", |
3151 | 0 | arg_result)); |
3152 | 0 | for (l = connections; l != NULL; l = l->next) |
3153 | 0 | { |
3154 | 0 | GDBusConnection *connection = l->data; |
3155 | 0 | g_dbus_connection_emit_signal (connection, |
3156 | 0 | NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "de.pengutronix.rauc.Installer", "Completed", |
3157 | 0 | signal_variant, NULL); |
3158 | 0 | } |
3159 | 0 | g_variant_unref (signal_variant); |
3160 | 0 | g_list_free_full (connections, g_object_unref); |
3161 | 0 | } |
3162 | | |
3163 | | static void r_installer_skeleton_iface_init (RInstallerIface *iface); |
3164 | | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
3165 | | G_DEFINE_TYPE_WITH_CODE (RInstallerSkeleton, r_installer_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
3166 | | G_ADD_PRIVATE (RInstallerSkeleton) |
3167 | | G_IMPLEMENT_INTERFACE (R_TYPE_INSTALLER, r_installer_skeleton_iface_init)) |
3168 | | |
3169 | | #else |
3170 | | G_DEFINE_TYPE_WITH_CODE (RInstallerSkeleton, r_installer_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
3171 | | G_IMPLEMENT_INTERFACE (R_TYPE_INSTALLER, r_installer_skeleton_iface_init)) |
3172 | | |
3173 | | #endif |
3174 | | static void |
3175 | | r_installer_skeleton_finalize (GObject *object) |
3176 | 0 | { |
3177 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3178 | 0 | guint n; |
3179 | 0 | for (n = 0; n < 6; n++) |
3180 | 0 | g_value_unset (&skeleton->priv->properties[n]); |
3181 | 0 | g_free (skeleton->priv->properties); |
3182 | 0 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
3183 | 0 | if (skeleton->priv->changed_properties_idle_source != NULL) |
3184 | 0 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
3185 | 0 | g_main_context_unref (skeleton->priv->context); |
3186 | 0 | g_mutex_clear (&skeleton->priv->lock); |
3187 | 0 | G_OBJECT_CLASS (r_installer_skeleton_parent_class)->finalize (object); |
3188 | 0 | } |
3189 | | |
3190 | | static void |
3191 | | r_installer_skeleton_get_property (GObject *object, |
3192 | | guint prop_id, |
3193 | | GValue *value, |
3194 | | GParamSpec *pspec G_GNUC_UNUSED) |
3195 | 0 | { |
3196 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3197 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 6); |
3198 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3199 | 0 | g_value_copy (&skeleton->priv->properties[prop_id - 1], value); |
3200 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3201 | 0 | } |
3202 | | |
3203 | | static gboolean |
3204 | | _r_installer_emit_changed (gpointer user_data) |
3205 | 0 | { |
3206 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (user_data); |
3207 | 0 | GList *l; |
3208 | 0 | GVariantBuilder builder; |
3209 | 0 | GVariantBuilder invalidated_builder; |
3210 | 0 | guint num_changes; |
3211 | |
|
3212 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3213 | 0 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); |
3214 | 0 | g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); |
3215 | 0 | for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) |
3216 | 0 | { |
3217 | 0 | ChangedProperty *cp = l->data; |
3218 | 0 | GVariant *variant; |
3219 | 0 | const GValue *cur_value; |
3220 | |
|
3221 | 0 | cur_value = &skeleton->priv->properties[cp->prop_id - 1]; |
3222 | 0 | if (!_g_value_equal (cur_value, &cp->orig_value)) |
3223 | 0 | { |
3224 | 0 | variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); |
3225 | 0 | g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); |
3226 | 0 | g_variant_unref (variant); |
3227 | 0 | num_changes++; |
3228 | 0 | } |
3229 | 0 | } |
3230 | 0 | if (num_changes > 0) |
3231 | 0 | { |
3232 | 0 | GList *connections, *ll; |
3233 | 0 | GVariant *signal_variant; |
3234 | 0 | signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "de.pengutronix.rauc.Installer", |
3235 | 0 | &builder, &invalidated_builder)); |
3236 | 0 | connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); |
3237 | 0 | for (ll = connections; ll != NULL; ll = ll->next) |
3238 | 0 | { |
3239 | 0 | GDBusConnection *connection = ll->data; |
3240 | |
|
3241 | 0 | g_dbus_connection_emit_signal (connection, |
3242 | 0 | NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), |
3243 | 0 | "org.freedesktop.DBus.Properties", |
3244 | 0 | "PropertiesChanged", |
3245 | 0 | signal_variant, |
3246 | 0 | NULL); |
3247 | 0 | } |
3248 | 0 | g_variant_unref (signal_variant); |
3249 | 0 | g_list_free_full (connections, g_object_unref); |
3250 | 0 | } |
3251 | 0 | else |
3252 | 0 | { |
3253 | 0 | g_variant_builder_clear (&builder); |
3254 | 0 | g_variant_builder_clear (&invalidated_builder); |
3255 | 0 | } |
3256 | 0 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
3257 | 0 | skeleton->priv->changed_properties = NULL; |
3258 | 0 | skeleton->priv->changed_properties_idle_source = NULL; |
3259 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3260 | 0 | return FALSE; |
3261 | 0 | } |
3262 | | |
3263 | | static void |
3264 | | _r_installer_schedule_emit_changed (RInstallerSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) |
3265 | 0 | { |
3266 | 0 | ChangedProperty *cp; |
3267 | 0 | GList *l; |
3268 | 0 | cp = NULL; |
3269 | 0 | for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) |
3270 | 0 | { |
3271 | 0 | ChangedProperty *i_cp = l->data; |
3272 | 0 | if (i_cp->info == info) |
3273 | 0 | { |
3274 | 0 | cp = i_cp; |
3275 | 0 | break; |
3276 | 0 | } |
3277 | 0 | } |
3278 | 0 | if (cp == NULL) |
3279 | 0 | { |
3280 | 0 | cp = g_new0 (ChangedProperty, 1); |
3281 | 0 | cp->prop_id = prop_id; |
3282 | 0 | cp->info = info; |
3283 | 0 | skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); |
3284 | 0 | g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); |
3285 | 0 | g_value_copy (orig_value, &cp->orig_value); |
3286 | 0 | } |
3287 | 0 | } |
3288 | | |
3289 | | static void |
3290 | | r_installer_skeleton_notify (GObject *object, |
3291 | | GParamSpec *pspec G_GNUC_UNUSED) |
3292 | 0 | { |
3293 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3294 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3295 | 0 | if (skeleton->priv->changed_properties != NULL && |
3296 | 0 | skeleton->priv->changed_properties_idle_source == NULL) |
3297 | 0 | { |
3298 | 0 | skeleton->priv->changed_properties_idle_source = g_idle_source_new (); |
3299 | 0 | g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); |
3300 | 0 | g_source_set_callback (skeleton->priv->changed_properties_idle_source, _r_installer_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); |
3301 | 0 | g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _r_installer_emit_changed"); |
3302 | 0 | g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); |
3303 | 0 | g_source_unref (skeleton->priv->changed_properties_idle_source); |
3304 | 0 | } |
3305 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3306 | 0 | } |
3307 | | |
3308 | | static void |
3309 | | r_installer_skeleton_set_property (GObject *object, |
3310 | | guint prop_id, |
3311 | | const GValue *value, |
3312 | | GParamSpec *pspec) |
3313 | 0 | { |
3314 | 0 | const _ExtendedGDBusPropertyInfo *info; |
3315 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3316 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 6); |
3317 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _r_installer_property_info_pointers[prop_id - 1]; |
3318 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3319 | 0 | g_object_freeze_notify (object); |
3320 | 0 | if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) |
3321 | 0 | { |
3322 | 0 | if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL && |
3323 | 0 | info->emits_changed_signal) |
3324 | 0 | _r_installer_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]); |
3325 | 0 | g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); |
3326 | 0 | g_object_notify_by_pspec (object, pspec); |
3327 | 0 | } |
3328 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3329 | 0 | g_object_thaw_notify (object); |
3330 | 0 | } |
3331 | | |
3332 | | static void |
3333 | | r_installer_skeleton_init (RInstallerSkeleton *skeleton) |
3334 | 0 | { |
3335 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
3336 | 0 | skeleton->priv = r_installer_skeleton_get_instance_private (skeleton); |
3337 | | #else |
3338 | | skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, R_TYPE_INSTALLER_SKELETON, RInstallerSkeletonPrivate); |
3339 | | #endif |
3340 | |
|
3341 | 0 | g_mutex_init (&skeleton->priv->lock); |
3342 | 0 | skeleton->priv->context = g_main_context_ref_thread_default (); |
3343 | 0 | skeleton->priv->properties = g_new0 (GValue, 6); |
3344 | 0 | g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING); |
3345 | 0 | g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING); |
3346 | 0 | g_value_init (&skeleton->priv->properties[2], G_TYPE_VARIANT); |
3347 | 0 | g_value_init (&skeleton->priv->properties[3], G_TYPE_STRING); |
3348 | 0 | g_value_init (&skeleton->priv->properties[4], G_TYPE_STRING); |
3349 | 0 | g_value_init (&skeleton->priv->properties[5], G_TYPE_STRING); |
3350 | 0 | } |
3351 | | |
3352 | | static const gchar * |
3353 | | r_installer_skeleton_get_operation (RInstaller *object) |
3354 | 0 | { |
3355 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3356 | 0 | const gchar *value; |
3357 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3358 | 0 | value = g_value_get_string (&(skeleton->priv->properties[0])); |
3359 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3360 | 0 | return value; |
3361 | 0 | } |
3362 | | |
3363 | | static const gchar * |
3364 | | r_installer_skeleton_get_last_error (RInstaller *object) |
3365 | 0 | { |
3366 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3367 | 0 | const gchar *value; |
3368 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3369 | 0 | value = g_value_get_string (&(skeleton->priv->properties[1])); |
3370 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3371 | 0 | return value; |
3372 | 0 | } |
3373 | | |
3374 | | static GVariant * |
3375 | | r_installer_skeleton_get_progress (RInstaller *object) |
3376 | 0 | { |
3377 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3378 | 0 | GVariant *value; |
3379 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3380 | 0 | value = g_value_get_variant (&(skeleton->priv->properties[2])); |
3381 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3382 | 0 | return value; |
3383 | 0 | } |
3384 | | |
3385 | | static const gchar * |
3386 | | r_installer_skeleton_get_compatible (RInstaller *object) |
3387 | 0 | { |
3388 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3389 | 0 | const gchar *value; |
3390 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3391 | 0 | value = g_value_get_string (&(skeleton->priv->properties[3])); |
3392 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3393 | 0 | return value; |
3394 | 0 | } |
3395 | | |
3396 | | static const gchar * |
3397 | | r_installer_skeleton_get_variant (RInstaller *object) |
3398 | 0 | { |
3399 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3400 | 0 | const gchar *value; |
3401 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3402 | 0 | value = g_value_get_string (&(skeleton->priv->properties[4])); |
3403 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3404 | 0 | return value; |
3405 | 0 | } |
3406 | | |
3407 | | static const gchar * |
3408 | | r_installer_skeleton_get_boot_slot (RInstaller *object) |
3409 | 0 | { |
3410 | 0 | RInstallerSkeleton *skeleton = R_INSTALLER_SKELETON (object); |
3411 | 0 | const gchar *value; |
3412 | 0 | g_mutex_lock (&skeleton->priv->lock); |
3413 | 0 | value = g_value_get_string (&(skeleton->priv->properties[5])); |
3414 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
3415 | 0 | return value; |
3416 | 0 | } |
3417 | | |
3418 | | static void |
3419 | | r_installer_skeleton_class_init (RInstallerSkeletonClass *klass) |
3420 | 0 | { |
3421 | 0 | GObjectClass *gobject_class; |
3422 | 0 | GDBusInterfaceSkeletonClass *skeleton_class; |
3423 | |
|
3424 | 0 | gobject_class = G_OBJECT_CLASS (klass); |
3425 | 0 | gobject_class->finalize = r_installer_skeleton_finalize; |
3426 | 0 | gobject_class->get_property = r_installer_skeleton_get_property; |
3427 | 0 | gobject_class->set_property = r_installer_skeleton_set_property; |
3428 | 0 | gobject_class->notify = r_installer_skeleton_notify; |
3429 | | |
3430 | |
|
3431 | 0 | r_installer_override_properties (gobject_class, 1); |
3432 | |
|
3433 | 0 | skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); |
3434 | 0 | skeleton_class->get_info = r_installer_skeleton_dbus_interface_get_info; |
3435 | 0 | skeleton_class->get_properties = r_installer_skeleton_dbus_interface_get_properties; |
3436 | 0 | skeleton_class->flush = r_installer_skeleton_dbus_interface_flush; |
3437 | 0 | skeleton_class->get_vtable = r_installer_skeleton_dbus_interface_get_vtable; |
3438 | |
|
3439 | | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
3440 | | g_type_class_add_private (klass, sizeof (RInstallerSkeletonPrivate)); |
3441 | | #endif |
3442 | 0 | } |
3443 | | |
3444 | | static void |
3445 | | r_installer_skeleton_iface_init (RInstallerIface *iface) |
3446 | 0 | { |
3447 | 0 | iface->completed = _r_installer_on_signal_completed; |
3448 | 0 | iface->get_operation = r_installer_skeleton_get_operation; |
3449 | 0 | iface->get_last_error = r_installer_skeleton_get_last_error; |
3450 | 0 | iface->get_progress = r_installer_skeleton_get_progress; |
3451 | 0 | iface->get_compatible = r_installer_skeleton_get_compatible; |
3452 | 0 | iface->get_variant = r_installer_skeleton_get_variant; |
3453 | 0 | iface->get_boot_slot = r_installer_skeleton_get_boot_slot; |
3454 | 0 | } |
3455 | | |
3456 | | /** |
3457 | | * r_installer_skeleton_new: |
3458 | | * |
3459 | | * 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>. |
3460 | | * |
3461 | | * Returns: (transfer full) (type RInstallerSkeleton): The skeleton object. |
3462 | | */ |
3463 | | RInstaller * |
3464 | | r_installer_skeleton_new (void) |
3465 | 0 | { |
3466 | 0 | return R_INSTALLER (g_object_new (R_TYPE_INSTALLER_SKELETON, NULL)); |
3467 | 0 | } |
3468 | | |