-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmpris_gc.c
5781 lines (5412 loc) · 211 KB
/
mpris_gc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Generated by gdbus-codegen 2.34.3. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "mpris_gc.h"
#include <string.h>
#ifdef G_OS_UNIX
# include <gio/gunixfdlist.h>
#endif
typedef struct
{
GDBusArgInfo parent_struct;
gboolean use_gvariant;
} _ExtendedGDBusArgInfo;
typedef struct
{
GDBusMethodInfo parent_struct;
const gchar *signal_name;
gboolean pass_fdlist;
} _ExtendedGDBusMethodInfo;
typedef struct
{
GDBusSignalInfo parent_struct;
const gchar *signal_name;
} _ExtendedGDBusSignalInfo;
typedef struct
{
GDBusPropertyInfo parent_struct;
const gchar *hyphen_name;
gboolean use_gvariant;
} _ExtendedGDBusPropertyInfo;
typedef struct
{
GDBusInterfaceInfo parent_struct;
const gchar *hyphen_name;
} _ExtendedGDBusInterfaceInfo;
typedef struct
{
const _ExtendedGDBusPropertyInfo *info;
guint prop_id;
GValue orig_value; /* the value before the change */
} ChangedProperty;
static void
_changed_property_free (ChangedProperty *data)
{
g_value_unset (&data->orig_value);
g_free (data);
}
static gboolean
_g_strv_equal0 (gchar **a, gchar **b)
{
gboolean ret = FALSE;
guint n;
if (a == NULL && b == NULL)
{
ret = TRUE;
goto out;
}
if (a == NULL || b == NULL)
goto out;
if (g_strv_length (a) != g_strv_length (b))
goto out;
for (n = 0; a[n] != NULL; n++)
if (g_strcmp0 (a[n], b[n]) != 0)
goto out;
ret = TRUE;
out:
return ret;
}
static gboolean
_g_variant_equal0 (GVariant *a, GVariant *b)
{
gboolean ret = FALSE;
if (a == NULL && b == NULL)
{
ret = TRUE;
goto out;
}
if (a == NULL || b == NULL)
goto out;
ret = g_variant_equal (a, b);
out:
return ret;
}
G_GNUC_UNUSED static gboolean
_g_value_equal (const GValue *a, const GValue *b)
{
gboolean ret = FALSE;
g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
switch (G_VALUE_TYPE (a))
{
case G_TYPE_BOOLEAN:
ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
break;
case G_TYPE_UCHAR:
ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
break;
case G_TYPE_INT:
ret = (g_value_get_int (a) == g_value_get_int (b));
break;
case G_TYPE_UINT:
ret = (g_value_get_uint (a) == g_value_get_uint (b));
break;
case G_TYPE_INT64:
ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
break;
case G_TYPE_UINT64:
ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
break;
case G_TYPE_DOUBLE:
{
/* Avoid -Wfloat-equal warnings by doing a direct bit compare */
gdouble da = g_value_get_double (a);
gdouble db = g_value_get_double (b);
ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
}
break;
case G_TYPE_STRING:
ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
break;
case G_TYPE_VARIANT:
ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
break;
default:
if (G_VALUE_TYPE (a) == G_TYPE_STRV)
ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
else
g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
break;
}
return ret;
}
/* ------------------------------------------------------------------------
* Code for interface org.mpris.MediaPlayer2
* ------------------------------------------------------------------------
*/
/**
* SECTION:OrgMprisMediaPlayer2
* @title: OrgMprisMediaPlayer2
* @short_description: Generated C code for the org.mpris.MediaPlayer2 D-Bus interface
*
* This section contains code for working with the <link linkend="gdbus-interface-org-mpris-MediaPlayer2.top_of_page">org.mpris.MediaPlayer2</link> D-Bus interface in C.
*/
/* ---- Introspection data for org.mpris.MediaPlayer2 ---- */
static const _ExtendedGDBusMethodInfo _org_mpris_media_player2_method_info_raise =
{
{
-1,
(gchar *) "Raise",
NULL,
NULL,
NULL
},
"handle-raise",
FALSE
};
static const _ExtendedGDBusMethodInfo _org_mpris_media_player2_method_info_quit =
{
{
-1,
(gchar *) "Quit",
NULL,
NULL,
NULL
},
"handle-quit",
FALSE
};
static const _ExtendedGDBusMethodInfo * const _org_mpris_media_player2_method_info_pointers[] =
{
&_org_mpris_media_player2_method_info_raise,
&_org_mpris_media_player2_method_info_quit,
NULL
};
static const _ExtendedGDBusPropertyInfo _org_mpris_media_player2_property_info_can_quit =
{
{
-1,
(gchar *) "CanQuit",
(gchar *) "b",
G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
NULL
},
"can-quit",
FALSE
};
static const _ExtendedGDBusPropertyInfo _org_mpris_media_player2_property_info_can_raise =
{
{
-1,
(gchar *) "CanRaise",
(gchar *) "b",
G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
NULL
},
"can-raise",
FALSE
};
static const _ExtendedGDBusPropertyInfo _org_mpris_media_player2_property_info_has_track_list =
{
{
-1,
(gchar *) "HasTrackList",
(gchar *) "b",
G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
NULL
},
"has-track-list",
FALSE
};
static const _ExtendedGDBusPropertyInfo _org_mpris_media_player2_property_info_identity =
{
{
-1,
(gchar *) "Identity",
(gchar *) "s",
G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
NULL
},
"identity",
FALSE
};
static const _ExtendedGDBusPropertyInfo _org_mpris_media_player2_property_info_desktop_entry =
{
{
-1,
(gchar *) "DesktopEntry",
(gchar *) "s",
G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
NULL
},
"desktop-entry",
FALSE
};
static const _ExtendedGDBusPropertyInfo _org_mpris_media_player2_property_info_supported_uri_schemes =
{
{
-1,
(gchar *) "SupportedUriSchemes",
(gchar *) "as",
G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
NULL
},
"supported-uri-schemes",
FALSE
};
static const _ExtendedGDBusPropertyInfo _org_mpris_media_player2_property_info_supported_mime_types =
{
{
-1,
(gchar *) "SupportedMimeTypes",
(gchar *) "as",
G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
NULL
},
"supported-mime-types",
FALSE
};
static const _ExtendedGDBusPropertyInfo * const _org_mpris_media_player2_property_info_pointers[] =
{
&_org_mpris_media_player2_property_info_can_quit,
&_org_mpris_media_player2_property_info_can_raise,
&_org_mpris_media_player2_property_info_has_track_list,
&_org_mpris_media_player2_property_info_identity,
&_org_mpris_media_player2_property_info_desktop_entry,
&_org_mpris_media_player2_property_info_supported_uri_schemes,
&_org_mpris_media_player2_property_info_supported_mime_types,
NULL
};
static const _ExtendedGDBusInterfaceInfo _org_mpris_media_player2_interface_info =
{
{
-1,
(gchar *) "org.mpris.MediaPlayer2",
(GDBusMethodInfo **) &_org_mpris_media_player2_method_info_pointers,
NULL,
(GDBusPropertyInfo **) &_org_mpris_media_player2_property_info_pointers,
NULL
},
"org-mpris-media-player2",
};
/**
* org_mpris_media_player2_interface_info:
*
* Gets a machine-readable description of the <link linkend="gdbus-interface-org-mpris-MediaPlayer2.top_of_page">org.mpris.MediaPlayer2</link> D-Bus interface.
*
* Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
*/
GDBusInterfaceInfo *
org_mpris_media_player2_interface_info (void)
{
return (GDBusInterfaceInfo *) &_org_mpris_media_player2_interface_info.parent_struct;
}
/**
* org_mpris_media_player2_override_properties:
* @klass: The class structure for a #GObject<!-- -->-derived class.
* @property_id_begin: The property id to assign to the first overridden property.
*
* Overrides all #GObject properties in the #OrgMprisMediaPlayer2 interface for a concrete class.
* The properties are overridden in the order they are defined.
*
* Returns: The last property id.
*/
guint
org_mpris_media_player2_override_properties (GObjectClass *klass, guint property_id_begin)
{
g_object_class_override_property (klass, property_id_begin++, "can-quit");
g_object_class_override_property (klass, property_id_begin++, "can-raise");
g_object_class_override_property (klass, property_id_begin++, "has-track-list");
g_object_class_override_property (klass, property_id_begin++, "identity");
g_object_class_override_property (klass, property_id_begin++, "desktop-entry");
g_object_class_override_property (klass, property_id_begin++, "supported-uri-schemes");
g_object_class_override_property (klass, property_id_begin++, "supported-mime-types");
return property_id_begin - 1;
}
/**
* OrgMprisMediaPlayer2:
*
* Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-mpris-MediaPlayer2.top_of_page">org.mpris.MediaPlayer2</link>.
*/
/**
* OrgMprisMediaPlayer2Iface:
* @parent_iface: The parent interface.
* @handle_quit: Handler for the #OrgMprisMediaPlayer2::handle-quit signal.
* @handle_raise: Handler for the #OrgMprisMediaPlayer2::handle-raise signal.
* @get_can_quit: Getter for the #OrgMprisMediaPlayer2:can-quit property.
* @get_can_raise: Getter for the #OrgMprisMediaPlayer2:can-raise property.
* @get_desktop_entry: Getter for the #OrgMprisMediaPlayer2:desktop-entry property.
* @get_has_track_list: Getter for the #OrgMprisMediaPlayer2:has-track-list property.
* @get_identity: Getter for the #OrgMprisMediaPlayer2:identity property.
* @get_supported_mime_types: Getter for the #OrgMprisMediaPlayer2:supported-mime-types property.
* @get_supported_uri_schemes: Getter for the #OrgMprisMediaPlayer2:supported-uri-schemes property.
*
* Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-mpris-MediaPlayer2.top_of_page">org.mpris.MediaPlayer2</link>.
*/
static void
org_mpris_media_player2_default_init (OrgMprisMediaPlayer2Iface *iface)
{
/* GObject signals for incoming D-Bus method calls: */
/**
* OrgMprisMediaPlayer2::handle-raise:
* @object: A #OrgMprisMediaPlayer2.
* @invocation: A #GDBusMethodInvocation.
*
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-mpris-MediaPlayer2.Raise">Raise()</link> D-Bus method.
*
* 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 org_mpris_media_player2_complete_raise() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
*
* Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
*/
g_signal_new ("handle-raise",
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (OrgMprisMediaPlayer2Iface, handle_raise),
g_signal_accumulator_true_handled,
NULL,
g_cclosure_marshal_generic,
G_TYPE_BOOLEAN,
1,
G_TYPE_DBUS_METHOD_INVOCATION);
/**
* OrgMprisMediaPlayer2::handle-quit:
* @object: A #OrgMprisMediaPlayer2.
* @invocation: A #GDBusMethodInvocation.
*
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-mpris-MediaPlayer2.Quit">Quit()</link> D-Bus method.
*
* 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 org_mpris_media_player2_complete_quit() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
*
* Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
*/
g_signal_new ("handle-quit",
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (OrgMprisMediaPlayer2Iface, handle_quit),
g_signal_accumulator_true_handled,
NULL,
g_cclosure_marshal_generic,
G_TYPE_BOOLEAN,
1,
G_TYPE_DBUS_METHOD_INVOCATION);
/* GObject properties for D-Bus properties: */
/**
* OrgMprisMediaPlayer2:can-quit:
*
* Represents the D-Bus property <link linkend="gdbus-property-org-mpris-MediaPlayer2.CanQuit">"CanQuit"</link>.
*
* 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.
*/
g_object_interface_install_property (iface,
g_param_spec_boolean ("can-quit", "CanQuit", "CanQuit", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* OrgMprisMediaPlayer2:can-raise:
*
* Represents the D-Bus property <link linkend="gdbus-property-org-mpris-MediaPlayer2.CanRaise">"CanRaise"</link>.
*
* 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.
*/
g_object_interface_install_property (iface,
g_param_spec_boolean ("can-raise", "CanRaise", "CanRaise", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* OrgMprisMediaPlayer2:has-track-list:
*
* Represents the D-Bus property <link linkend="gdbus-property-org-mpris-MediaPlayer2.HasTrackList">"HasTrackList"</link>.
*
* 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.
*/
g_object_interface_install_property (iface,
g_param_spec_boolean ("has-track-list", "HasTrackList", "HasTrackList", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* OrgMprisMediaPlayer2:identity:
*
* Represents the D-Bus property <link linkend="gdbus-property-org-mpris-MediaPlayer2.Identity">"Identity"</link>.
*
* 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.
*/
g_object_interface_install_property (iface,
g_param_spec_string ("identity", "Identity", "Identity", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* OrgMprisMediaPlayer2:desktop-entry:
*
* Represents the D-Bus property <link linkend="gdbus-property-org-mpris-MediaPlayer2.DesktopEntry">"DesktopEntry"</link>.
*
* 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.
*/
g_object_interface_install_property (iface,
g_param_spec_string ("desktop-entry", "DesktopEntry", "DesktopEntry", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* OrgMprisMediaPlayer2:supported-uri-schemes:
*
* Represents the D-Bus property <link linkend="gdbus-property-org-mpris-MediaPlayer2.SupportedUriSchemes">"SupportedUriSchemes"</link>.
*
* 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.
*/
g_object_interface_install_property (iface,
g_param_spec_boxed ("supported-uri-schemes", "SupportedUriSchemes", "SupportedUriSchemes", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* OrgMprisMediaPlayer2:supported-mime-types:
*
* Represents the D-Bus property <link linkend="gdbus-property-org-mpris-MediaPlayer2.SupportedMimeTypes">"SupportedMimeTypes"</link>.
*
* 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.
*/
g_object_interface_install_property (iface,
g_param_spec_boxed ("supported-mime-types", "SupportedMimeTypes", "SupportedMimeTypes", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
typedef OrgMprisMediaPlayer2Iface OrgMprisMediaPlayer2Interface;
G_DEFINE_INTERFACE (OrgMprisMediaPlayer2, org_mpris_media_player2, G_TYPE_OBJECT);
/**
* org_mpris_media_player2_get_can_quit: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets the value of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.CanQuit">"CanQuit"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* Returns: The property value.
*/
gboolean
org_mpris_media_player2_get_can_quit (OrgMprisMediaPlayer2 *object)
{
return ORG_MPRIS_MEDIA_PLAYER2_GET_IFACE (object)->get_can_quit (object);
}
/**
* org_mpris_media_player2_set_can_quit: (skip)
* @object: A #OrgMprisMediaPlayer2.
* @value: The value to set.
*
* Sets the <link linkend="gdbus-property-org-mpris-MediaPlayer2.CanQuit">"CanQuit"</link> D-Bus property to @value.
*
* Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
*/
void
org_mpris_media_player2_set_can_quit (OrgMprisMediaPlayer2 *object, gboolean value)
{
g_object_set (G_OBJECT (object), "can-quit", value, NULL);
}
/**
* org_mpris_media_player2_get_can_raise: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets the value of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.CanRaise">"CanRaise"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* Returns: The property value.
*/
gboolean
org_mpris_media_player2_get_can_raise (OrgMprisMediaPlayer2 *object)
{
return ORG_MPRIS_MEDIA_PLAYER2_GET_IFACE (object)->get_can_raise (object);
}
/**
* org_mpris_media_player2_set_can_raise: (skip)
* @object: A #OrgMprisMediaPlayer2.
* @value: The value to set.
*
* Sets the <link linkend="gdbus-property-org-mpris-MediaPlayer2.CanRaise">"CanRaise"</link> D-Bus property to @value.
*
* Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
*/
void
org_mpris_media_player2_set_can_raise (OrgMprisMediaPlayer2 *object, gboolean value)
{
g_object_set (G_OBJECT (object), "can-raise", value, NULL);
}
/**
* org_mpris_media_player2_get_has_track_list: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets the value of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.HasTrackList">"HasTrackList"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* Returns: The property value.
*/
gboolean
org_mpris_media_player2_get_has_track_list (OrgMprisMediaPlayer2 *object)
{
return ORG_MPRIS_MEDIA_PLAYER2_GET_IFACE (object)->get_has_track_list (object);
}
/**
* org_mpris_media_player2_set_has_track_list: (skip)
* @object: A #OrgMprisMediaPlayer2.
* @value: The value to set.
*
* Sets the <link linkend="gdbus-property-org-mpris-MediaPlayer2.HasTrackList">"HasTrackList"</link> D-Bus property to @value.
*
* Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
*/
void
org_mpris_media_player2_set_has_track_list (OrgMprisMediaPlayer2 *object, gboolean value)
{
g_object_set (G_OBJECT (object), "has-track-list", value, NULL);
}
/**
* org_mpris_media_player2_get_identity: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets the value of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.Identity">"Identity"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* <warning>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 org_mpris_media_player2_dup_identity() if on another thread.</warning>
*
* Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
*/
const gchar *
org_mpris_media_player2_get_identity (OrgMprisMediaPlayer2 *object)
{
return ORG_MPRIS_MEDIA_PLAYER2_GET_IFACE (object)->get_identity (object);
}
/**
* org_mpris_media_player2_dup_identity: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets a copy of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.Identity">"Identity"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
*/
gchar *
org_mpris_media_player2_dup_identity (OrgMprisMediaPlayer2 *object)
{
gchar *value;
g_object_get (G_OBJECT (object), "identity", &value, NULL);
return value;
}
/**
* org_mpris_media_player2_set_identity: (skip)
* @object: A #OrgMprisMediaPlayer2.
* @value: The value to set.
*
* Sets the <link linkend="gdbus-property-org-mpris-MediaPlayer2.Identity">"Identity"</link> D-Bus property to @value.
*
* Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
*/
void
org_mpris_media_player2_set_identity (OrgMprisMediaPlayer2 *object, const gchar *value)
{
g_object_set (G_OBJECT (object), "identity", value, NULL);
}
/**
* org_mpris_media_player2_get_desktop_entry: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets the value of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.DesktopEntry">"DesktopEntry"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* <warning>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 org_mpris_media_player2_dup_desktop_entry() if on another thread.</warning>
*
* Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
*/
const gchar *
org_mpris_media_player2_get_desktop_entry (OrgMprisMediaPlayer2 *object)
{
return ORG_MPRIS_MEDIA_PLAYER2_GET_IFACE (object)->get_desktop_entry (object);
}
/**
* org_mpris_media_player2_dup_desktop_entry: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets a copy of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.DesktopEntry">"DesktopEntry"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
*/
gchar *
org_mpris_media_player2_dup_desktop_entry (OrgMprisMediaPlayer2 *object)
{
gchar *value;
g_object_get (G_OBJECT (object), "desktop-entry", &value, NULL);
return value;
}
/**
* org_mpris_media_player2_set_desktop_entry: (skip)
* @object: A #OrgMprisMediaPlayer2.
* @value: The value to set.
*
* Sets the <link linkend="gdbus-property-org-mpris-MediaPlayer2.DesktopEntry">"DesktopEntry"</link> D-Bus property to @value.
*
* Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
*/
void
org_mpris_media_player2_set_desktop_entry (OrgMprisMediaPlayer2 *object, const gchar *value)
{
g_object_set (G_OBJECT (object), "desktop-entry", value, NULL);
}
/**
* org_mpris_media_player2_get_supported_uri_schemes: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets the value of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.SupportedUriSchemes">"SupportedUriSchemes"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* <warning>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 org_mpris_media_player2_dup_supported_uri_schemes() if on another thread.</warning>
*
* Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
*/
const gchar *const *
org_mpris_media_player2_get_supported_uri_schemes (OrgMprisMediaPlayer2 *object)
{
return ORG_MPRIS_MEDIA_PLAYER2_GET_IFACE (object)->get_supported_uri_schemes (object);
}
/**
* org_mpris_media_player2_dup_supported_uri_schemes: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets a copy of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.SupportedUriSchemes">"SupportedUriSchemes"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev().
*/
gchar **
org_mpris_media_player2_dup_supported_uri_schemes (OrgMprisMediaPlayer2 *object)
{
gchar **value;
g_object_get (G_OBJECT (object), "supported-uri-schemes", &value, NULL);
return value;
}
/**
* org_mpris_media_player2_set_supported_uri_schemes: (skip)
* @object: A #OrgMprisMediaPlayer2.
* @value: The value to set.
*
* Sets the <link linkend="gdbus-property-org-mpris-MediaPlayer2.SupportedUriSchemes">"SupportedUriSchemes"</link> D-Bus property to @value.
*
* Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
*/
void
org_mpris_media_player2_set_supported_uri_schemes (OrgMprisMediaPlayer2 *object, const gchar *const *value)
{
g_object_set (G_OBJECT (object), "supported-uri-schemes", value, NULL);
}
/**
* org_mpris_media_player2_get_supported_mime_types: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets the value of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.SupportedMimeTypes">"SupportedMimeTypes"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* <warning>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 org_mpris_media_player2_dup_supported_mime_types() if on another thread.</warning>
*
* Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
*/
const gchar *const *
org_mpris_media_player2_get_supported_mime_types (OrgMprisMediaPlayer2 *object)
{
return ORG_MPRIS_MEDIA_PLAYER2_GET_IFACE (object)->get_supported_mime_types (object);
}
/**
* org_mpris_media_player2_dup_supported_mime_types: (skip)
* @object: A #OrgMprisMediaPlayer2.
*
* Gets a copy of the <link linkend="gdbus-property-org-mpris-MediaPlayer2.SupportedMimeTypes">"SupportedMimeTypes"</link> D-Bus property.
*
* Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
*
* Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev().
*/
gchar **
org_mpris_media_player2_dup_supported_mime_types (OrgMprisMediaPlayer2 *object)
{
gchar **value;
g_object_get (G_OBJECT (object), "supported-mime-types", &value, NULL);
return value;
}
/**
* org_mpris_media_player2_set_supported_mime_types: (skip)
* @object: A #OrgMprisMediaPlayer2.
* @value: The value to set.
*
* Sets the <link linkend="gdbus-property-org-mpris-MediaPlayer2.SupportedMimeTypes">"SupportedMimeTypes"</link> D-Bus property to @value.
*
* Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
*/
void
org_mpris_media_player2_set_supported_mime_types (OrgMprisMediaPlayer2 *object, const gchar *const *value)
{
g_object_set (G_OBJECT (object), "supported-mime-types", value, NULL);
}
/**
* org_mpris_media_player2_call_raise:
* @proxy: A #OrgMprisMediaPlayer2Proxy.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
* @user_data: User data to pass to @callback.
*
* Asynchronously invokes the <link linkend="gdbus-method-org-mpris-MediaPlayer2.Raise">Raise()</link> D-Bus method on @proxy.
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
* You can then call org_mpris_media_player2_call_raise_finish() to get the result of the operation.
*
* See org_mpris_media_player2_call_raise_sync() for the synchronous, blocking version of this method.
*/
void
org_mpris_media_player2_call_raise (
OrgMprisMediaPlayer2 *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"Raise",
g_variant_new ("()"),
G_DBUS_CALL_FLAGS_NONE,
-1,
cancellable,
callback,
user_data);
}
/**
* org_mpris_media_player2_call_raise_finish:
* @proxy: A #OrgMprisMediaPlayer2Proxy.
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_mpris_media_player2_call_raise().
* @error: Return location for error or %NULL.
*
* Finishes an operation started with org_mpris_media_player2_call_raise().
*
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
*/
gboolean
org_mpris_media_player2_call_raise_finish (
OrgMprisMediaPlayer2 *proxy,
GAsyncResult *res,
GError **error)
{
GVariant *_ret;
_ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
if (_ret == NULL)
goto _out;
g_variant_get (_ret,
"()");
g_variant_unref (_ret);
_out:
return _ret != NULL;
}
/**
* org_mpris_media_player2_call_raise_sync:
* @proxy: A #OrgMprisMediaPlayer2Proxy.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @error: Return location for error or %NULL.
*
* Synchronously invokes the <link linkend="gdbus-method-org-mpris-MediaPlayer2.Raise">Raise()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
*
* See org_mpris_media_player2_call_raise() for the asynchronous version of this method.
*
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
*/
gboolean
org_mpris_media_player2_call_raise_sync (
OrgMprisMediaPlayer2 *proxy,
GCancellable *cancellable,
GError **error)
{
GVariant *_ret;
_ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"Raise",
g_variant_new ("()"),
G_DBUS_CALL_FLAGS_NONE,
-1,
cancellable,
error);
if (_ret == NULL)
goto _out;
g_variant_get (_ret,
"()");
g_variant_unref (_ret);
_out:
return _ret != NULL;
}
/**
* org_mpris_media_player2_call_quit:
* @proxy: A #OrgMprisMediaPlayer2Proxy.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
* @user_data: User data to pass to @callback.
*
* Asynchronously invokes the <link linkend="gdbus-method-org-mpris-MediaPlayer2.Quit">Quit()</link> D-Bus method on @proxy.
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
* You can then call org_mpris_media_player2_call_quit_finish() to get the result of the operation.
*
* See org_mpris_media_player2_call_quit_sync() for the synchronous, blocking version of this method.
*/
void
org_mpris_media_player2_call_quit (
OrgMprisMediaPlayer2 *proxy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"Quit",
g_variant_new ("()"),
G_DBUS_CALL_FLAGS_NONE,
-1,
cancellable,
callback,
user_data);
}
/**
* org_mpris_media_player2_call_quit_finish:
* @proxy: A #OrgMprisMediaPlayer2Proxy.
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_mpris_media_player2_call_quit().
* @error: Return location for error or %NULL.
*
* Finishes an operation started with org_mpris_media_player2_call_quit().
*
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
*/
gboolean
org_mpris_media_player2_call_quit_finish (
OrgMprisMediaPlayer2 *proxy,
GAsyncResult *res,
GError **error)
{
GVariant *_ret;
_ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
if (_ret == NULL)
goto _out;
g_variant_get (_ret,
"()");
g_variant_unref (_ret);
_out:
return _ret != NULL;
}
/**
* org_mpris_media_player2_call_quit_sync:
* @proxy: A #OrgMprisMediaPlayer2Proxy.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @error: Return location for error or %NULL.
*
* Synchronously invokes the <link linkend="gdbus-method-org-mpris-MediaPlayer2.Quit">Quit()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
*
* See org_mpris_media_player2_call_quit() for the asynchronous version of this method.
*
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
*/
gboolean
org_mpris_media_player2_call_quit_sync (
OrgMprisMediaPlayer2 *proxy,
GCancellable *cancellable,
GError **error)
{
GVariant *_ret;
_ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"Quit",
g_variant_new ("()"),
G_DBUS_CALL_FLAGS_NONE,
-1,
cancellable,
error);
if (_ret == NULL)
goto _out;
g_variant_get (_ret,
"()");
g_variant_unref (_ret);
_out:
return _ret != NULL;
}
/**
* org_mpris_media_player2_complete_raise:
* @object: A #OrgMprisMediaPlayer2.
* @invocation: (transfer full): A #GDBusMethodInvocation.
*
* Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-mpris-MediaPlayer2.Raise">Raise()</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.
*
* This method will free @invocation, you cannot use it afterwards.
*/
void
org_mpris_media_player2_complete_raise (
OrgMprisMediaPlayer2 *object,
GDBusMethodInvocation *invocation)
{
g_dbus_method_invocation_return_value (invocation,
g_variant_new ("()"));
}
/**
* org_mpris_media_player2_complete_quit:
* @object: A #OrgMprisMediaPlayer2.
* @invocation: (transfer full): A #GDBusMethodInvocation.
*
* Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-mpris-MediaPlayer2.Quit">Quit()</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.
*
* This method will free @invocation, you cannot use it afterwards.
*/