3 * Copyright (C) 2007-2009 Jürg Billeter
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Jürg Billeter <j@bitron.ch>
23 [CCode (cheader_filename = "dbus/dbus-glib-lowlevel.h,dbus/dbus-glib.h")]
25 [CCode (cprefix = "DBUS_BUS_")]
33 [CCode (cname = "dbus_bus_get")]
34 public static RawConnection get (BusType type, ref RawError error);
37 [CCode (ref_function = "dbus_connection_ref", unref_function = "dbus_connection_unref", cname = "DBusConnection")]
38 public class RawConnection {
39 [CCode (cname = "dbus_connection_setup_with_g_main")]
40 public void setup_with_main (GLib.MainContext? context = null);
41 [CCode (cname = "dbus_connection_get_g_connection")]
42 public Connection get_g_connection ();
43 [CCode (cname = "dbus_connection_register_g_object")]
44 public void register_object (string at_path, GLib.Object object);
47 [CCode (cname = "DBusError", cprefix = "dbus_error_", destroy_function = "dbus_error_free")]
48 public struct RawError {
50 public string message;
53 public bool has_name (string name);
54 public bool is_set ();
57 [DBus (name = "org.freedesktop.DBus.Error")]
58 [CCode (cname = "DBusGError", lower_case_csuffix = "gerror", cprefix = "DBUS_GERROR_")]
59 public errordomain Error {
65 [DBus (name = "IOError")]
84 [DBus (name = "Spawn.ExecFailed")]
86 [DBus (name = "Spawn.ForkFailed")]
88 [DBus (name = "Spawn.ChildExited")]
90 [DBus (name = "Spawn.ChildSignaled")]
92 [DBus (name = "Spawn.Failed")]
94 UNIX_PROCESS_ID_UNKNOWN,
97 [DBus (name = "SELinuxSecurityContextUnknown")]
98 SELINUX_SECURITY_CONTEXT_UNKNOWN,
103 [CCode (cname = "dbus_g_bus_get")]
104 public static Connection get (BusType type) throws Error;
108 [CCode (ref_function = "dbus_g_connection_ref", unref_function = "dbus_g_connection_unref", cname = "DBusGConnection")]
109 public class Connection {
110 [CCode (cname = "dbus_g_proxy_new_for_name")]
111 public Object get_object (string name, string path, string? interface_ = null);
112 [CCode (cname = "dbus_g_proxy_new_from_type")]
113 public GLib.Object get_object_from_type (string name, string path, string interface_, GLib.Type type);
114 [CCode (cname = "dbus_g_connection_register_g_object")]
115 public void register_object (string at_path, GLib.Object object);
116 [CCode (cname = "dbus_g_connection_lookup_g_object")]
117 public weak GLib.Object lookup_object (string at_path);
118 [CCode (cname = "dbus_g_connection_get_connection")]
119 public RawConnection get_connection ();
122 [CCode (cname = "DBusGProxy", lower_case_csuffix = "g_proxy")]
123 public class Object : GLib.Object {
124 public bool call (string method, out GLib.Error error, GLib.Type first_arg_type, ...);
125 public weak ProxyCall begin_call (string method, ProxyCallNotify notify, GLib.DestroyNotify destroy, GLib.Type first_arg_type, ...);
126 public bool end_call (ProxyCall call, out GLib.Error error, GLib.Type first_arg_type, ...);
127 public void cancel_call (ProxyCall call);
128 public weak string get_path ();
129 public weak string get_bus_name ();
130 public weak string get_interface ();
133 [CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "DBUS_TYPE_G_OBJECT_PATH", marshaller_type_name = "STRING", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string", type_signature = "o")]
134 public class ObjectPath : string {
135 [CCode (cname = "g_strdup")]
136 public ObjectPath (string path);
139 [CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "DBUS_TYPE_G_OBJECT_PATH", marshaller_type_name = "STRING", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string")]
140 public class BusName : string {
141 [CCode (cname = "g_strdup")]
142 public BusName (string bus_name);
145 [CCode (cname = "DBusGProxyCallNotify")]
146 public delegate void ProxyCallNotify (Object obj, ProxyCall call_id);
148 [CCode (cname = "DBusGProxyCall")]
149 public class ProxyCall {
153 public enum NameFlag {
159 public enum RequestNameReply {