summaryrefslogtreecommitdiff
blob: 689192ff9e59b9f713409c0ae92baa7009a2e7d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
diff -uprN mate-power-manager-orig/src/gpm-common.h mate-power-manager/src/gpm-common.h
--- mate-power-manager-orig/src/gpm-common.h	2013-10-03 13:56:55.000000000 +0200
+++ mate-power-manager/src/gpm-common.h	2013-10-13 19:54:10.649901214 +0200
@@ -33,6 +33,7 @@ G_BEGIN_DECLS
 #define	GPM_DBUS_SERVICE		"org.mate.PowerManager"
 #define	GPM_DBUS_INTERFACE		"org.mate.PowerManager"
 #define	GPM_DBUS_INTERFACE_BACKLIGHT	"org.mate.PowerManager.Backlight"
+#define	GPM_DBUS_INTERFACE_KBD_BACKLIGHT	"org.mate.PowerManager.KbdBacklight"
 #define	GPM_DBUS_PATH			"/org/mate/PowerManager"
 #define	GPM_DBUS_PATH_BACKLIGHT		"/org/mate/PowerManager/Backlight"
 #define GPM_DBUS_PATH_KBD_BACKLIGHT    "/org/mate/PowerManager/KbdBacklight"
diff -uprN mate-power-manager-orig/src/gpm-kbd-backlight.c mate-power-manager/src/gpm-kbd-backlight.c
--- mate-power-manager-orig/src/gpm-kbd-backlight.c	2013-10-03 13:56:55.000000000 +0200
+++ mate-power-manager/src/gpm-kbd-backlight.c	2013-10-13 19:58:07.154258855 +0200
@@ -31,21 +31,6 @@
 #include "gpm-kbd-backlight.h"
 #include "gsd-media-keys-window.h"
 
-static const gchar *kbd_backlight_introspection = ""
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?>""<node name=\"/\">"
-  "<interface name=\"org.mate.PowerManager.Backlight\">"
-    "<method name=\"GetBrightness\">"
-      "<arg type=\"u\" name=\"percentage_brightness\" direction=\"out\"/>"
-    "</method>"
-    "<method name=\"SetBrightness\">"
-      "<arg type=\"u\" name=\"percentage_brightness\" direction=\"in\"/>"
-    "</method>"
-    "<signal name=\"BrightnessChanged\">"
-      "<arg type=\"u\" name=\"percentage_brightness\" direction=\"out\"/>"
-    "</signal>"
-  "</interface>"
-"</node>";
-
 #define GPM_KBD_BACKLIGHT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_KBD_BACKLIGHT, GpmKbdBacklightPrivate))
 
 struct GpmKbdBacklightPrivate
@@ -430,40 +415,6 @@ gpm_kbd_backlight_dbus_property_set (GDB
    return FALSE;
 }
 
-/**
- * gpm_kbd_backlight_register_dbus:
- * @backlight:
- * @connection:
- * @error:
- **/
-void
-gpm_kbd_backlight_register_dbus (GpmKbdBacklight *backlight,
-                GDBusConnection *connection,
-                GError **error)
-{
-   GDBusNodeInfo *node_info;
-   GDBusInterfaceInfo *interface_info;
-   GDBusInterfaceVTable interface_vtable = {
-           gpm_kbd_backlight_dbus_method_call,
-           gpm_kbd_backlight_dbus_property_get,
-           gpm_kbd_backlight_dbus_property_set
-   };
-
-   node_info = g_dbus_node_info_new_for_xml (kbd_backlight_introspection, NULL);
-   interface_info = g_dbus_node_info_lookup_interface (node_info, GPM_DBUS_INTERFACE_BACKLIGHT);
-
-   backlight->priv->bus_connection = g_object_ref (connection);
-   backlight->priv->bus_object_id =
-       g_dbus_connection_register_object (connection,
-                          GPM_DBUS_PATH_KBD_BACKLIGHT,
-                          interface_info,
-                          &interface_vtable,
-                          backlight,
-                          NULL,
-                          error);
-   g_dbus_node_info_unref (node_info);
-}
-
 static gboolean
 gpm_kbd_backlight_evaluate_power_source_and_set (GpmKbdBacklight *backlight)
 {
diff -uprN mate-power-manager-orig/src/gpm-manager.c mate-power-manager/src/gpm-manager.c
--- mate-power-manager-orig/src/gpm-manager.c	2013-10-03 13:56:55.000000000 +0200
+++ mate-power-manager/src/gpm-manager.c	2013-10-13 20:05:11.449488592 +0200
@@ -63,6 +63,7 @@
 #include "gpm-disks.h"
 
 #include "org.mate.PowerManager.Backlight.h"
+#include "org.mate.PowerManager.KbdBacklight.h"
 
 static void     gpm_manager_finalize	(GObject	 *object);
 
@@ -1986,12 +1987,13 @@ gpm_manager_init (GpmManager *manager)
 						     G_OBJECT (manager->priv->backlight));
 	}
 
-    manager->priv->kbd_backlight = gpm_kbd_backlight_new ();
-    if (manager->priv->kbd_backlight != NULL) {
-        gpm_kbd_backlight_register_dbus (manager->priv->kbd_backlight,
-                                        g_connection,
-                                        NULL);
-    }
+        manager->priv->kbd_backlight = gpm_kbd_backlight_new ();
+        if (manager->priv->kbd_backlight != NULL) {
+            dbus_g_object_type_install_info (GPM_TYPE_KBD_BACKLIGHT,
+                                             &dbus_glib_gpm_kbd_backlight_object_info);
+        dbus_g_connection_register_g_object (connection, GPM_DBUS_PATH_KBD_BACKLIGHT,
+                                             G_OBJECT (manager->priv->kbd_backlight));
+        }
 
 	manager->priv->idle = gpm_idle_new ();
 	g_signal_connect (manager->priv->idle, "idle-changed",
diff -uprN mate-power-manager-orig/src/Makefile.am mate-power-manager/src/Makefile.am
--- mate-power-manager-orig/src/Makefile.am	2013-10-03 13:56:55.000000000 +0200
+++ mate-power-manager/src/Makefile.am	2013-10-13 20:10:17.374533688 +0200
@@ -6,6 +6,7 @@ NULL =
 EXTRA_DIST =						\
 	org.mate.PowerManager.xml			\
 	org.mate.PowerManager.Backlight.xml		\
+	org.mate.PowerManager.KbdBacklight.xml		\
 	gpm-marshal.list				\
 	$(NULL)
 
@@ -270,6 +271,7 @@ endif
 BUILT_SOURCES = 					\
 	org.mate.PowerManager.h			\
 	org.mate.PowerManager.Backlight.h		\
+	org.mate.PowerManager.KbdBacklight.h		\
 	gpm-marshal.c					\
 	gpm-marshal.h					\
 	$(NULL)
@@ -295,6 +297,13 @@ org.mate.PowerManager.Backlight.h: org.m
 		--output=org.mate.PowerManager.Backlight.h	\
 		$(srcdir)/org.mate.PowerManager.Backlight.xml
 
+org.mate.PowerManager.KbdBacklight.h: org.mate.PowerManager.KbdBacklight.xml
+	libtool --mode=execute dbus-binding-tool	\
+		--prefix=gpm_kbd_backlight			\
+		--mode=glib-server			\
+		--output=org.mate.PowerManager.KbdBacklight.h	\
+		$(srcdir)/org.mate.PowerManager.KbdBacklight.xml
+
 clean-local:
 	rm -f *~
 	rm -f gpm-marshal.c gpm-marshal.h
diff -uprN mate-power-manager-orig/src/org.mate.PowerManager.KbdBacklight.xml mate-power-manager/src/org.mate.PowerManager.KbdBacklight.xml
--- mate-power-manager-orig/src/org.mate.PowerManager.KbdBacklight.xml	2013-10-13 20:12:11.556667787 +0200
+++ mate-power-manager/src/org.mate.PowerManager.KbdBacklight.xml	2013-10-13 20:11:45.972413654 +0200
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<node name="/">
+  <interface name="org.mate.PowerManager.KbdBacklight">
+    <method name="GetBrightness">
+      <arg type="u" name="percentage_brightness" direction="out"/>
+    </method>
+    <method name="SetBrightness">
+      <arg type="u" name="percentage_brightness" direction="in"/>
+    </method>
+    <signal name="BrightnessChanged">
+      <arg type="u" name="percentage_brightness" direction="out"/>
+    </signal>
+  </interface>
+</node>
+