glib/docs/reference/gio
Matthew Leeds 2a605f6e15 gdbus-codegen: Add call_flags and timeout_msec args
Currently the code generated by gdbus-codegen uses
G_DBUS_CALL_FLAGS_NONE in its D-Bus calls, which occur for each method
defined by the input XML, and for proxy_set_property functions. This
means that if the daemon which implements the methods checks for
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION and only does interactive
authorization if that flag is present, users of the generated code have
no way to cause the daemon to use interactive authorization (e.g. polkit
dialogs).

If we simply changed the generated code to always use
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, its users would have no
way to disallow interactive authorization (except for manually calling
the D-Bus method themselves).

So instead, this commit adds a GDBusCallFlags argument to method call
functions. Since this is an API break which will require changes in
projects using gdbus-codegen code, the change is conditional on the
command line argument --glib-min-version having the value 2.64 or
higher.

The impetus for this change is that I'm changing accountsservice to
properly respect G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, and
libaccountsservice uses generated code for D-Bus method calls. So
these changes will allow libaccountsservice to continue allowing
interactive authorization, and avoid breaking any users of it which
expect that. See
https://gitlab.freedesktop.org/accountsservice/accountsservice/merge_requests/46

It might make sense to also let GDBusCallFlags be specified for property
set operations, but that is not needed in the case of accountsservice,
and would require significant work and breaking API in multiple places.

Similarly, the generated code currently hard codes -1 as the timeout
value when calling g_dbus_proxy_call*(). Add a timeout_msec argument so
the user of the generated code can specify the timeout as well.

Also, test this new API. In gio/tests/codegen.py we test that the new
arguments are generated if and only of --glib-min-version is used with a
value greater than or equal to 2.64, and in gio/tests/meson.build we
test that the generated code with the new API can be linked against.

The test_unix_fd_list() test also needed modification to continue
working now that we're using gdbus-test-codegen.c with code generated
with --glib-min-version=2.64 in one test.

Finally, update the docs for gdbus-codegen to explain the effect of
using --glib-min-version 2.64, both from this commit and from
"gdbus-codegen: Emit GUnixFDLists if an arg has type `h` w/
min-version".
2020-01-15 09:37:41 -08:00
..
xml docs: Change Bugzilla references to GitLab 2018-06-15 13:04:39 +01:00
.gitignore .gitignore updates for gsettings stuff 2010-04-27 17:04:57 -04:00
concat-files-helper.py doc: Split API reference per platform 2019-07-10 10:29:04 -04:00
gapplication.xml New gapplication(1) tool 2013-10-17 10:12:27 -04:00
gdbus-codegen.xml gdbus-codegen: Add call_flags and timeout_msec args 2020-01-15 09:37:41 -08:00
gdbus.xml docs: Change Bugzilla references to GitLab 2018-06-15 13:04:39 +01:00
gio-docs-unix.xml doc: Split API reference per platform 2019-07-10 10:29:04 -04:00
gio-docs-win32.xml doc: Split API reference per platform 2019-07-10 10:29:04 -04:00
gio-docs.xml gio: Add GMemoryMonitor to monitor for low-memory 2019-12-11 11:44:42 +00:00
gio-querymodules.xml docs: Improve man page consistency 2012-08-03 23:36:45 -04:00
gio-sections-common.txt docs: Update GMemoryMonitor listings in docs 2019-12-16 13:57:28 +00:00
gio-sections-win32.txt doc: Split API reference per platform 2019-07-10 10:29:04 -04:00
gio.xml gio-tool: Add a --default-permissions argument to gio copy 2019-09-30 14:40:50 +01:00
glib-compile-resources.xml glib-compile-resources: Add external data option 2018-12-19 16:43:21 +00:00
glib-compile-schemas.xml glib-compile-schemas: Add a --version option 2016-10-06 21:08:25 +01:00
gresource.xml gresource: fix documentation typo 2017-08-22 08:58:56 +01:00
gsettings.xml Add ‘gsettings list-schemas --print-paths’ option 2018-01-05 13:01:03 +00:00
gvfs-overview.odg update the overview image of the gio docs 2009-06-08 17:29:22 +02:00
gvfs-overview.png update the overview image of the gio docs 2009-06-08 17:29:22 +02:00
menu-example.png Add GMenuModel 2011-12-08 18:05:12 -05:00
menu-model.png Add GMenuModel 2011-12-08 18:05:12 -05:00
meson.build gio: Add GMemoryMonitor to monitor for low-memory 2019-12-11 11:44:42 +00:00
migrating-gconf.xml minor typos in the documentation (a/an) 2019-08-24 19:14:05 +00:00
migrating-gdbus.xml Revert "Revert "docs: remove GDBusObjectManager example"" 2019-12-12 11:30:36 +00:00
migrating-gnome-vfs.xml docs: Change Bugzilla references to GitLab 2018-06-15 13:04:39 +01:00
migrating-posix.xml Remove duplicate copies of migration docs 2010-05-27 13:07:54 -04:00
overview.xml Document "help" for extensions 2019-01-22 13:18:50 -05:00
version.xml.in gio/ docs/reference/gio Merged gio-standalone into glib. 2007-11-26 16:13:05 +00:00