summaryrefslogtreecommitdiff
path: root/gio/src/dbusconnection.ccg
Commit message (Collapse)AuthorAgeFilesLines
* Meson build: No implicit_include_directoriesKjell Ahlstedt2021-03-261-1/+1
| | | | | | | It shall not be possible to find a glibmm header file with #include <xxx.h> instead of #include <glibmm/xxx.h>. Not fully fixed until https://github.com/mesonbuild/meson/issues/8562 has been fixed.
* dbusconnection.ccg: Include giomm/unixfdlist.h on *NIX onlyChun-wei Fan2020-03-021-0/+4
| | | | | | In Meson builds, we don't even generate giomm/unixfdlist.h unless we are building for *nix, and we aren't using the items there on non-*nix builds.
* Gio::DBus::Connection: Make the wrap() function thread-safeKjell Ahlstedt2019-10-221-1/+33
| | | | | | | Add a std::mutex that guarantees that two threads don't create C++ wrappers for the same GDBusConnection instance. Fixes #56
* Update the Free Software Foundation address in copyright noticesKjell Ahlstedt2017-08-301-2/+1
| | | | Bug 786824
* Add and use make_refptr_for_instance().Murray Cumming2017-04-061-8/+8
| | | | This will make it easier to change the underlying RefPtr type.
* Run clang-format on the .ccg files.Murray Cumming2016-02-261-455/+306
| | | | This seems to work.
* DBus::Connection: Pass an empty bus name as nullptrKjell Ahlstedt2016-02-041-13/+10
| | | | | | | | | | | | * gio/src/dbusconnection.[hg|ccg]: Some string parameters in some C functions accept nullptr, others don't. call(), call_sync(): bus_name: Pass nullptr for an empty string. emit_signal(): Only destination_bus_name can be nullptr. Other string parameters: Pass c_str(). The bug in call() and call_sync() was noticed by Gerlof Fokkema on gtkmm-list. The bug in emit_signal() is an overreaction to bug 645072. All string parameters were changed to pass nullptr, but only destination_bus_name should have been changed.
* Use Glib::c_str_or_nullptr()Kjell Ahlstedt2016-01-211-27/+25
| | | | Use Glib::c_str_or_nullptr(s) instead of s.empty() ? nullptr : s.c_str().
* Gio::DBus: Use nullptr instead of 0.Murray Cumming2015-11-201-43/+43
|
* More use of nullptr instead of 0.Murray Cumming2015-11-201-2/+2
|
* DBus::Connection::signal_subscribe(): Pass nullptr instead of "".Murray Cumming2015-09-211-2/+6
| | | | | | | | | Because that's what the C documentation requires, and the implementation doesn't accept "" to mean the same thing, though that would be convenient: https://developer.gnome.org/gio/stable/GDBusConnection.html#g-dbus-connection-signal-subscribe Noticed by Christof Meerwald on gtkmm-list.
* C++11: Use nullptr.Murray Cumming2015-07-161-9/+9
|
* C++11: Some use of the auto keyword.Murray Cumming2015-07-151-15/+15
|
* DBus::[Connection|Proxy]: Change ifdef G_OS_LINUX to ifdef G_OS_UNIX.Kjell Ahlstedt2013-01-301-2/+2
| | | | | | * gio/src/dbusconnection.[ccg|hg]: * gio/src/dbusproxy.[ccg|hg]: Change G_OS_LINUX to G_OS_UNIX. Glib does not define G_OS_LINUX. Correct function declarations for DBus::Proxy::call().
* DBusConnection: Fix a typo in implementation.Murray Cumming2012-10-011-1/+1
| | | | | | * gio/src/dbusconnection.ccg: g_dbus_connection_call_with_unix_fd_list() was mistyped. I wonder why the compiler did not complain.
* Gio::DBus::Connection: Add the call_[finish|sync]() with UnixFDLists.José Alburquerque2012-09-181-24/+10
| | | | | | | | | | * gio/src/dbusconnection.{hg,ccg}: Add the methods using gmmproc's output parameter functionality. Also add the cancellable and non-cancellable asynchronous call() methods that were #ifdef'ed out because of the missing call_finish() method. * tools/m4/convert_gio.m4: Add a necessary enum conversion. Bug #662371.
* Revert 'Gio::DBus::Connection: Add'José Alburquerque2012-09-181-62/+8
|
* Gio::DBus::Connection: AddMurray Cumming2012-09-161-8/+62
| | | | | | | | | * gio/src/dbusconnection.[hg|ccg]: Add call(), call_with_unix_fd_finish(), and call_finishcall_sync() method overloads that wrap g_dbus_connection_call_with_unix_fd_list(), g_dbus_connection_call_with_unix_fd_list_finish() and g_dbus_connection_call_with_unix_fd_list_sync() * tools/m4/convert_gio.m4: Add a necessary conversion.
* Simplified lots of code by using the {?} _WRAP_METHOD() syntax.Murray Cumming2012-09-151-30/+0
| | | | | | | | | | | | | | | | | | | | | | * gio/src/application.[hg|ccg]: * gio/src/bufferedinputstream.[hg|ccg]: * gio/src/datainputstream.[hg|ccg]: * gio/src/dataoutputstream.[hg|ccg]: * gio/src/dbusconnection.[hg|ccg]: * gio/src/fileenumerator.[hg|ccg]: * gio/src/initable.[hg|ccg]: * gio/src/inputstream.[hg|ccg]: * gio/src/iostream.[hg|ccg]: * gio/src/outputstream.[hg|ccg]: * gio/src/resolver.[hg|ccg]: * gio/src/seekable.[hg|ccg]: * gio/src/socket.[hg|ccg]: * gio/src/socketaddressenumerator.[hg|ccg]: * gio/src/socketclient.[hg|ccg]: This relatively new gmmproc syntax lets us avoid the manual implementations and declarations just to have overloads without the Cancellable parameters. * gio/src/unixconnection.hg: This had no method overloads without Cancellable parameters but now it does.
* Gio::DBus::Connection: Add the MenuModel export/unexport methods.José Alburquerque2012-02-231-0/+1
| | | | | | | * gio/src/dbusconnection.{ccg,hg}: Add the two new methods, wrapping the two functions in the GMenuModel exporter API: http://developer.gnome.org/gio/2.31/gio-GMenuModel-exporter.html * tools/m4/convert_gio.m4: Add necessary conversions.
* Gio::DBus::Connection: Add the ActionGroup export/unexport methods.José Alburquerque2012-02-201-0/+1
| | | | | | * gio/src/dbusconnection.{ccg,hg}: Add the two new methods, wrapping the two functions in the new GActionGroup exporter API: http://developer.gnome.org/gio/2.31/gio-GActionGroup-exporter.html
* gmmproc: Don't include <glibmm.h> by default in generated files.José Alburquerque2011-10-251-0/+1
| | | | | | | | | | | | * tools/m4/base.m4: Include <glibmm/ustring.h> and <sigc++/sigc++.h> by default in header files of generated files in modules other than glibmm. This should make compilation faster for those modules. * gio/src/*.{h,cc}g: * gio/giomm/slot_async.cc: Adjust includes according to the above change. Bug #662597
* Gio::DBus::Connection: Temporarily remove newly added call() methods.José Alburquerque2011-10-231-0/+4
| | | | | | | | | | * gio/src/dbusconnection.{ccg,hg}: Remove the newly added call() methods with a UnixFDList parameter until the call_finish() method with a UnixFDList parameter is added also. * gio/src/credentials.hg: * gio/src/dbusmessage.ccg: * gio/src/dbusmessage.hg: Typos.
* Gio::DBus::Connection: Add UnixFDList call() method overloads.José Alburquerque2011-10-121-4/+60
| | | | | * gio/src/dbusconnection.{ccg,hg}: Add cancellable and non-cancellable UnixFDList call() methods.
* Gio::DBus::Connection::emit_signal(): Say why convert empty strings.José Alburquerque2011-06-091-0/+4
| | | | | * gio/src/dbusconnection.ccg (emit_signal): Explain why empty strings are converted to NULL when passed to the C API.
* Gio::DBus::Connection::emit_signal(): Replace empty strings with NULL.José Alburquerque2011-06-081-2/+5
| | | | | | | | * gio/src/dbusconnection.ccg (emit_signal): Pass NULL to the C function call where strings are empty allowing emitting signals to all listeners. Bug #645072 (Yannick Guesnet).
* Gio::DBus::Connection: Added a register_method() overload with no vtable.Murray Cumming2011-04-021-0/+15
| | | | | * gio/src/dbusconnection.[hg|ccg]: This makes sense now that the C API's documentation was improved in bug #646419.
* Gio::DBus: Minor API changes.Murray Cumming2011-04-011-5/+5
| | | | | | | | | | | | | | | | | | | | | * gio/src/dbusconnection.[hg|ccg]: register_object(), register_subtree(): Take the VTable by reference, not pointer. register_object() can take a NULL but that needs documentation (see the bug mentioned) and a future method overload. * gio/src/dbusmethodinvocation.ccg: get_parameters(): Return a VariantContainerBase instead of taking a VariantBase output parameter, because this is always a tuple. Well, I think so: See the bug mentioned. * gio/src/dbusmethodinvocation.hg: return_value(): Take a VariantContainerBase instead of a VariantBase, because this is always a tuple. return_gerror(), return_error_literal(): Rename them both to return_error(). * glib/src/variant.hg: VariantContainerBase::create_tuple(): Add a method overload that takes a single VariantBase, for convenience, so that applications don't need to create a single-item vector. * examples/dbus/busserver.cc: Adapted. * examples/dbus/busserver.cc: Rename to server.cc and actually implement it, though I am currently confused about whether this server's object should be available on an existing bus. Maybe we should use Gio::DBus::own_name() instead of Gio::DBus::Server.
* Gio::DBus: Use VariantContainerBase for tuple Variants.Murray Cumming2011-03-251-25/+10
| | | | | | | | | | | | * gio/src/dbusconnection.[hg|ccg]: * gio/src/dbusproxy.ccg.[hg|ccg]: call_sync(), call(), call_finish(): Use VariantContainerBase, instead of VariantBase, for GVariants that are documented as being tuples. Because the type is known we can also use it as a simple return type instead of an output parameter. * tools/m4/convert_gio.m4: Added a necessary conversion. * examples/dbus/peer.cc: * examples/dbus/userbus.cc: Adapted. These already correctly assumed that the type should be VariantContainerBase.
* Gio::DBus: Move InterfaceVTable and SubtreeVTable to their own files.Murray Cumming2011-03-231-260/+0
| | | | | | | * gio/src/dbusinterfacevtable.[hg|ccg]: * gio/src/dbussubtreevtable.[hg|ccg]: Moved code here from * gio/src/dbusconnection.[hg|ccg]. * gio/src/filelist.am: Mention the new files.
* DBus::InterfaceVTable: Use g_error_copy() where appropriate.Murray Cumming2011-03-091-4/+4
| | | | | | | | * gio/src/dbusconnection.ccg: DBusInterfaceVTable_SetProperty_giomm_callback(), DBusInterfaceVTable_GetProperty_giomm_callback(): Copy the GError instead of just copying the pointer, because it will be freed along with the parent Glib::Error. Bug #644008 (Yannick.Guesnet)
* Bring back Gio::Error registration.Murray Cumming2011-02-231-1/+1
| | | | | | | | * gio/src/error.[hg|ccg]: Move Gio::DBus::Error to * gio/src/dbuserror.[hg|ccg]: and temporarily rename it to Gio::DBusError because generate_wrap_init.pl.in is wrapping only on of Gio::Error and Gio::DBus::Error. Unfortunately, we need to fix the generation to handle this properly even when it is called Gio::DBus::DBusError.
* Move the DBus classes into a Gio::DBus namespace.Murray Cumming2011-02-161-180/+185
| | | | | | | | | | | | | | | | | | | | | | * gio/giomm.h: * gio/src/dbus*.[hg|ccg] * gio/src/error.hg: Rename all DBus* classes to remove the prefix, putting them in a Gio::DBus namespace. This required the use of the new _GMMPROC_EXTRA_NAMESPACE macro, to avoid generating a confused wrap_init.cc. Along the way, I removed unnecessary class predeclarations, instead including the relevant header, because that is more convenient for users of the API. * gio/src/dbuserror.[hg|ccg]: Renamed to dbuserrorutils.[hg|ccg] and renamed the Error namespace to ErrorUtils, to avoid a clash with the Gio::DBus::Error exception. * gio/src/filelist.am: * tools/m4/convert_gio.m4: Changed some conversions. * examples/dbus/busserver.cc: * examples/dbus/peer.cc: * examples/dbus/userbus.cc: Adapted. This is generally more organized. A prefix, instead of a namespace, looked generally wrong to C++ coders.
* DBusConnection: Add a send_message() without an "out_serial" param.José Alburquerque2011-01-161-0/+15
| | | | | | * gio/src/dbusconnection.{ccg,hg} (send_message): Add new method without the "out_serial" param. * gio/src/unixfdlist.hg (append): Add exception docs to method.
* DBus: Avoid errors/exceptions in callbacks due to NULL C strings.José Alburquerque2011-01-131-20/+13
| | | | | | | | | | | * gio/src/dbusconnection.ccg: Modify the callbacks so that if a C string parameter might be NULL, it is passed to the slots as an empty string (""). This avoids possible exceptions from constructing a Glib::ustring from NULL. * gio/src/dbusconnection.hg: Typos. * examples/dbus/peer.cc: Add the usage examples from the C API's example.
* DBusConnection: Check for NULL bus name in the MethodCall callback.José Alburquerque2011-01-121-1/+2
| | | | | | | * gio/src/dbusconnection.ccg (DBusConnection_Message_Filter_giomm_callback): Since the sender can be NULL, check for that so that creating a Glib::ustring from a NULL does not cause exceptions.
* DBusConnection: call*() methods: Re-order bus_name parameter.José Alburquerque2011-01-111-4/+4
| | | | | | | | | | * gio/src/dbusconnection.{ccg,hg} (call*): Place the bus_name parameter before the timeout_msec parameter to make it easier to specifiy a bus name without having to set a timeout value. * gio/src/dbusaddress.hg (get_for_bus_sync): Correct declarations to return std::string instead of Glib::ustring in accordance with the last commit.
* DBus: Use std::string for addresses since they could be a file path.José Alburquerque2011-01-111-16/+16
| | | | | | | | | | * gio/src/dbusaddress.{ccg,hg}: * gio/src/dbusconnection.{ccg,hg}: * gio/src/dbusserver.{ccg,hg}: Use std::string instead of Glib::ustring for address parameters just to avoid possible errors since DBus address could be a filename path as the "Addresses" section of the DBus introduction seems to imply: http://www.freedesktop.org/wiki/IntroductionToDBus.
* DBus: Use std::string for guid's.José Alburquerque2011-01-111-16/+16
| | | | | | | | | * gio/src/dbusaddress.{ccg,hg}: * gio/src/dbusconnection.{ccg,hg}: * gio/src/dbusserver.{ccg,hg}: * gio/src/dbusutils.{ccg,hg}: Use std::string instead of Glib::ustring for guid's since std::string's API is probably adequate enough for their use.
* DBus: Add a peer example to test the DBusServer class.José Alburquerque2011-01-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | * gio/src/dbusconnection.{ccg,hg}: Reorder the VariantBase 'parameters' parameter in the call*() methods to come after the method_name parameter. * gio/src/dbusintrospection.hg: Use refreturn for methods where the C API does not automatically reference the return. * gio/src/dbusserver.{ccg,hg}: Add non-observable constructors and create() methods. * glib/src/variant.{ccg,hg} (create_tuple): Renamed from create(). Write this method to be more specific for tuples (it's probably the only case where this method might be used). Dealing with tuples still feels awkward with the method. Maybe there's a better way. * examples/Makefile.am: * examples/dbus/peer.cc: * examples/dbus/userbus.cc: * examples/dbus/well-known-address-client.cc: Add the new server/client peer example (named peer). The example crashes because the C API seems to not deal with empty strings "" well, but at least there is now an example. Making sure it runs well is necessary. Also rename the previous example to userbus.cc.
* DBusConnection: Callbacks: Check for NULL GError** parameters.José Alburquerque2011-01-071-2/+4
| | | | | | | | * gio/src/dbusconnection.ccg: Make sure that the callbacks that set a GError* do not try to access a NULL pointer if NULL has been passed as the GError** parameter. Bug #637587 (Yannick Guesnet)
* Gio::DBusConnection: Callbacks: Return all Glib::Errors to caller.José Alburquerque2011-01-071-2/+2
| | | | | | | | * gio/src/dbusconnection.ccg: Have to previously modified callbacks that deal with getting/setting properties return all Glib::Errors and not just Gio::DBusError types. Bug #637587 (Yannick Guesnet)
* DBusConnection: Callbacks: Return DBusError exceptions to caller.José Alburquerque2011-01-071-2/+11
| | | | | | | | * gio/src/dbusconnection.ccg: Modify the callbacks that deal with getting/setting properties for a DBus interface to set the GError* parameter if it is a DBus related GError. This should allow receiving DBus exceptions if the slot throws one with respect to not being able to successfully get/set a property.
* DBusConnection: Use gobj() instead of reinterpret_cast<> for *VTable.José Alburquerque2011-01-071-6/+3
| | | | | | * gio/src/dbusconnection.ccg: Use the gobj() of the DBusInterfaceVTable instead of casting it to a GDBusInterfaceVTable in the callbacks and in the register_object() method.
* DBusConnection: Use const guint instead of guint const.Murray Cumming2011-01-071-2/+2
| | | | * gio/src/dbusconnection.ccg: This is more consistent with other code.
* DBusConnection: Use _ suffixes on member variables.Murray Cumming2011-01-071-18/+18
| | | | | | * gio/src/dbusconnection.[hg|ccg]: Use a _ suffix on member variables to avoid confusion with method parameters of the same name, though this does not seem to be what is causing bug #637587.
* DBusConnection: Add [register|unregister]_subtree() methods.José Alburquerque2011-01-061-45/+164
| | | | | | | | | | * gio/src/dbusconnection.{ccg,hg}: Add the new methods along with a corresponding class (like the one for register_object()). Added method docs. Modified the registration methods so that the vtable is passed and not a struct containing the slots. Please note that this API feels like it could be made better before glibmm goes stable. In particular, it might be nice and (maybe even possible) to not require that the *VTable instances be global.
* DBusConnection: Add register/unregister_object() methods.José Alburquerque2010-12-231-4/+178
| | | | | | | | | * gio/src/dbusconnection.{ccg,hg}: Add register_object() and unregister_object() methods. Use a C++ wrapper class for the GDBusInterfaceVTable structure so that it is possible to use slots for the registration. Fixes Bug #637587 (Yannick Guesnet)
* DBus[Connection|Proxy]: Don't take extra reference on async creation.José Alburquerque2010-12-141-54/+8
| | | | | | | | * gio/src/dbusconnection.ccg: * gio/src/dbusproxy.ccg: There's no need to put the newly constructed DBusConnection|DBusProxy in a Glib::RefPtr<> and then take an extra reference. Simply constructing the object is enough to guarantee that the object continues existing until the SlotAsyncReady slot is called.
* DBusConnection: Add non-observable create method overloads.José Alburquerque2010-12-081-6/+214
| | | | | * gio/src/dbusconnection.{ccg,hg}: Add constructors and create methods that don't require a DBusAuthObservable paramter.