chiark / gitweb /
service: use uppercase SYSV prefix to make it easier to recognize
[elogind.git] / src / dbus.h
index 7c0da3320b33714749db9ee17af8fb1b1aa79c5b..2aaeb4745ff776afd200a2e3f56cacca18cd2d14 100644 (file)
 
 #include <dbus/dbus.h>
 
+#ifndef DBUS_ERROR_UNKNOWN_OBJECT
+#define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject"
+#endif
+
+#ifndef DBUS_ERROR_UNKNOWN_INTERFACE
+#define DBUS_ERROR_UNKNOWN_INTERFACE "org.freedesktop.DBus.Error.UnknownInterface"
+#endif
+
 #include "manager.h"
 
 typedef int (*BusPropertyCallback)(Manager *m, DBusMessageIter *iter, const char *property, void *data);
+typedef int (*BusPropertySetCallback)(Manager *m, DBusMessageIter *iter, const char *property);
 
 typedef struct BusProperty {
         const char *interface;           /* interface of the property */
@@ -34,6 +43,7 @@ typedef struct BusProperty {
         BusPropertyCallback append;      /* Function that is called to serialize this property */
         const char *signature;
         const void *data;                /* The data of this property */
+        BusPropertySetCallback set;      /* Function that is called to set this property */
 } BusProperty;
 
 #define BUS_PROPERTIES_INTERFACE                                        \
@@ -47,6 +57,11 @@ typedef struct BusProperty {
         "   <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n"    \
         "   <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>\n" \
         "  </method>\n"                                                 \
+        "  <method name=\"Set\">\n"                                     \
+        "   <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n"    \
+        "   <arg name=\"property\" direction=\"in\" type=\"s\"/>\n"     \
+        "   <arg name=\"value\" direction=\"in\" type=\"v\"/>\n"       \
+        "  </method>\n"                                                 \
         "  <signal name=\"PropertiesChanged\">\n"                       \
         "   <arg type=\"s\" name=\"interface\"/>\n"                     \
         "   <arg type=\"a{sv}\" name=\"changed_properties\"/>\n"        \
@@ -69,7 +84,7 @@ typedef struct BusProperty {
         " </method>\n"                                                  \
         "</interface>\n"
 
-int bus_init(Manager *m);
+int bus_init(Manager *m, bool try_bus_connect);
 void bus_done(Manager *m);
 
 unsigned bus_dispatch(Manager *m);