340
340
* Virtual table for handling properties and method calls for a D-Bus
343
* If you want to handle getting/setting D-Bus properties asynchronously, simply
344
* register an object with the <literal>org.freedesktop.DBus.Properties</literal>
345
* D-Bus interface using g_dbus_connection_register_object().
343
* Since 2.38, if you want to handle getting/setting D-Bus properties
344
* asynchronously, give %NULL as your get_property() or set_property()
345
* function. The D-Bus call will be directed to your @method_call
346
* function, with the provided @interface_name set to
347
* <literal>"org.freedesktop.DBus.Properties"</literal>.
349
* The usual checks on the validity of the calls is performed. For
350
* <literal>'Get'</literal> calls, an error is automatically returned if
351
* the property does not exist or the permissions do not allow access.
352
* The same checks are performed for <literal>'Set'</literal> calls, and
353
* the provided value is also checked for being the correct type.
355
* For both <literal>'Get'</literal> and <literal>'Set'</literal> calls,
356
* the #GDBusMethodInvocation passed to the method_call handler can be
357
* queried with g_dbus_method_invocation_get_property_info() to get a
358
* pointer to the #GDBusPropertyInfo of the property.
360
* If you have readable properties specified in your interface info, you
361
* must ensure that you either provide a non-%NULL @get_property()
362
* function or provide implementations of both the
363
* <literal>'Get'</literal> and <literal>'GetAll'</literal> methods on
364
* the <literal>'org.freedesktop.DBus.Properties'</literal> interface in
365
* your @method_call function. Note that the required return type of
366
* the <literal>'Get'</literal> call is <literal>(v)</literal>, not the
367
* type of the property. <literal>'GetAll'</literal> expects a return
368
* value of type <literal>a{sv}</literal>.
370
* If you have writable properties specified in your interface info, you
371
* must ensure that you either provide a non-%NULL @set_property()
372
* function or provide an implementation of the <literal>'Set'</literal>
373
* call. If implementing the call, you must return the value of type
374
* %G_VARIANT_TYPE_UNIT.