Merge commit 'upstream/013'
Michael Biebl
14 years ago
1 | 1 | Author: Richard Hughes <richard@hughsie.com> |
2 | 2 | Date: Wed Aug 6 06:58:45 2008 +0100 |
3 | 3 | |
4 | make some stuff non-global in devkit-power | |
5 | ||
6 | tools/dkp-tool.c | 7 +++---- | |
4 | make some stuff non-global in upower | |
5 | ||
6 | tools/up-tool.c | 7 +++---- | |
7 | 7 | 1 files changed, 3 insertions(+), 4 deletions(-) |
8 | 8 | |
9 | 9 | commit b242cbd9a617b4cf1d62cb22e3680167683577fd |
12 | 12 | |
13 | 13 | trivial: remove some un-needed defines |
14 | 14 | |
15 | tools/dkp-tool.c | 18 ------------------ | |
15 | tools/up-tool.c | 18 ------------------ | |
16 | 16 | 1 files changed, 0 insertions(+), 18 deletions(-) |
17 | 17 | |
18 | 18 | commit 5b6bae572f39a05e78f6c0c35018725f05c97a4d |
19 | 19 | Author: Richard Hughes <richard@hughsie.com> |
20 | 20 | Date: Tue Aug 5 17:26:35 2008 +0100 |
21 | 21 | |
22 | abstract out the client and client device parts of the devkit-power | |
22 | abstract out the client and client device parts of the upower | |
23 | 23 | tool |
24 | 24 | |
25 | 25 | tools/Makefile.am | 4 + |
26 | tools/dkp-device.c | 384 | |
26 | tools/up-device.c | 384 | |
27 | 27 | +++++++++++++++++++++++++++++++++++++++++++++ |
28 | tools/dkp-device.h | 72 +++++++++ | |
29 | tools/dkp-client.c | 269 +++++++++++++++++++++++++++++++ | |
30 | tools/dkp-client.h | 66 ++++++++ | |
31 | tools/dkp-tool.c | 248 ++++------------------------- | |
28 | tools/up-device.h | 72 +++++++++ | |
29 | tools/up-client.c | 269 +++++++++++++++++++++++++++++++ | |
30 | tools/up-client.h | 66 ++++++++ | |
31 | tools/up-tool.c | 248 ++++------------------------- | |
32 | 32 | 6 files changed, 829 insertions(+), 214 deletions(-) |
33 | 33 | |
34 | 34 | commit da8ec3f3b12f9869f2d7b0c93169d3c68e434ef2 |
37 | 37 | |
38 | 38 | move the enumeration into it's own function ready for tidyup |
39 | 39 | |
40 | tools/dkp-tool.c | 46 +++++++++++++++++++++++++++++++++++----------- | |
40 | tools/up-tool.c | 46 +++++++++++++++++++++++++++++++++++----------- | |
41 | 41 | 1 files changed, 35 insertions(+), 11 deletions(-) |
42 | 42 | |
43 | 43 | commit 12c592ddeedc4bb0892234e449db8bd3e97c5d61 |
46 | 46 | |
47 | 47 | make the LowBatteryChanged and OnBatteryChanged signals work |
48 | 48 | |
49 | src/dkp-daemon.c | 88 | |
49 | src/up-daemon.c | 88 | |
50 | 50 | ++++++++++++++++++++++++++++++++++++++++++++++++----- |
51 | src/dkp-source.c | 55 +++++++++++++++++++++------------ | |
52 | src/dkp-source.h | 7 ++-- | |
51 | src/up-source.c | 55 +++++++++++++++++++++------------ | |
52 | src/up-source.h | 7 ++-- | |
53 | 53 | 3 files changed, 118 insertions(+), 32 deletions(-) |
54 | 54 | |
55 | 55 | commit 16f2c597aa03d1405c04b14595690f9717a801c8 |
58 | 58 | |
59 | 59 | don't segfault when a history file is present but empty |
60 | 60 | |
61 | devkit-power-gobject/dkp-history-obj.c | 2 +- | |
62 | src/dkp-history.c | 10 ++++++++-- | |
61 | upower-gobject/up-history-obj.c | 2 +- | |
62 | src/up-history.c | 10 ++++++++-- | |
63 | 63 | 2 files changed, 9 insertions(+), 3 deletions(-) |
64 | 64 | |
65 | 65 | commit 38f86d7dae9f190f6e33c1940452a880bf96e396 |
69 | 69 | add some GObject checks in a couple of modules to try to debug a |
70 | 70 | problem I'm seeing |
71 | 71 | |
72 | src/dkp-device-list.c | 17 ++++- | |
73 | src/dkp-device-list.h | 12 ++-- | |
74 | src/dkp-history.c | 182 | |
72 | src/up-device-list.c | 17 ++++- | |
73 | src/up-device-list.h | 12 ++-- | |
74 | src/up-history.c | 182 | |
75 | 75 | +++++++++++++++++++++++++++---------------------- |
76 | src/dkp-history.h | 24 +++--- | |
76 | src/up-history.h | 24 +++--- | |
77 | 77 | 4 files changed, 133 insertions(+), 102 deletions(-) |
78 | 78 | |
79 | 79 | commit 22dfd9e7db9e58584e9f00359528c379f0a98cea |
82 | 82 | |
83 | 83 | don't get the ID in DkpDevice, we already set it in DkpSource |
84 | 84 | |
85 | src/dkp-device.c | 5 ----- | |
85 | src/up-device.c | 5 ----- | |
86 | 86 | 1 files changed, 0 insertions(+), 5 deletions(-) |
87 | 87 | |
88 | 88 | commit eed12da295df1209496ac029f07fbc376afdfb3f |
93 | 93 | easily get the device list for the power queries |
94 | 94 | |
95 | 95 | src/Makefile.am | 1 + |
96 | src/dkp-daemon.c | 88 ++++++++++--------------- | |
97 | src/dkp-device-list.c | 173 | |
96 | src/up-daemon.c | 88 ++++++++++--------------- | |
97 | src/up-device-list.c | 173 | |
98 | 98 | +++++++++++++++++++++++++++++++++++++++++++++++++ |
99 | src/dkp-device-list.h | 68 +++++++++++++++++++ | |
99 | src/up-device-list.h | 68 +++++++++++++++++++ | |
100 | 100 | 4 files changed, 277 insertions(+), 53 deletions(-) |
101 | 101 | |
102 | 102 | commit 4e4859c9cba1dfb16a0299bf6328aa58cf001818 |
106 | 106 | add some helpers in DkpSource to get the binary states of primary |
107 | 107 | batteries |
108 | 108 | |
109 | src/dkp-daemon.c | 2 ++ | |
110 | src/dkp-source.c | 28 ++++++++++++++++++++++++++++ | |
111 | src/dkp-source.h | 4 ++++ | |
109 | src/up-daemon.c | 2 ++ | |
110 | src/up-source.c | 28 ++++++++++++++++++++++++++++ | |
111 | src/up-source.h | 4 ++++ | |
112 | 112 | 3 files changed, 34 insertions(+), 0 deletions(-) |
113 | 113 | |
114 | 114 | commit 9dca67f115ff8a71c1f633356918a9e056d24cac |
117 | 117 | |
118 | 118 | add a new ninary to get the battery power state |
119 | 119 | |
120 | src/dkp-history.c | 3 +- | |
120 | src/up-history.c | 3 +- | |
121 | 121 | tools/Makefile.am | 19 +++++++++++-- |
122 | tools/dkp-battery-power.c | 67 | |
122 | tools/up-battery-power.c | 67 | |
123 | 123 | +++++++++++++++++++++++++++++++++++++++++++++ |
124 | 124 | 3 files changed, 84 insertions(+), 5 deletions(-) |
125 | 125 | |
130 | 130 | treat the timespan like a range, and search backwards so we aways |
131 | 131 | get some data |
132 | 132 | |
133 | src/dkp-history.c | 21 ++++++++++++++------- | |
133 | src/up-history.c | 21 ++++++++++++++------- | |
134 | 134 | 1 files changed, 14 insertions(+), 7 deletions(-) |
135 | 135 | |
136 | 136 | commit 50cadd86229fb5cbd681d259b9b6e5323b251337 |
139 | 139 | |
140 | 140 | correct the signature of GetOnBattery and GetLowbattery |
141 | 141 | |
142 | src/org.freedesktop.DeviceKit.Power.xml | 4 ++-- | |
142 | src/org.freedesktop.UPower.xml | 4 ++-- | |
143 | 143 | 1 files changed, 2 insertions(+), 2 deletions(-) |
144 | 144 | |
145 | 145 | commit 9f171a14ef6b27fe1a458ded143684dc6e988886 |
146 | 146 | Author: Richard Hughes <richard@hughsie.com> |
147 | 147 | Date: Mon Aug 4 16:41:58 2008 +0100 |
148 | 148 | |
149 | make devkit-power --dump work | |
150 | ||
151 | tools/dkp-tool.c | 11 +++++++---- | |
149 | make upower --dump work | |
150 | ||
151 | tools/up-tool.c | 11 +++++++---- | |
152 | 152 | 1 files changed, 7 insertions(+), 4 deletions(-) |
153 | 153 | |
154 | 154 | commit 8c4efc79f33511eafa06074357fffc2c16e8e284 |
155 | 155 | Author: Richard Hughes <richard@hughsie.com> |
156 | 156 | Date: Mon Aug 4 16:25:25 2008 +0100 |
157 | 157 | |
158 | use DkpHistoryObj in devkit-power | |
159 | ||
160 | devkit-power-gobject/Makefile.am | 2 + | |
161 | devkit-power-gobject/dkp-history-obj.c | 173 | |
158 | use DkpHistoryObj in upower | |
159 | ||
160 | upower-gobject/Makefile.am | 2 + | |
161 | upower-gobject/up-history-obj.c | 173 | |
162 | 162 | +++++++++++++++++++++++++++++++++++++ |
163 | devkit-power-gobject/dkp-history-obj.h | 51 +++++++++++ | |
163 | upower-gobject/up-history-obj.h | 51 +++++++++++ | |
164 | 164 | src/Makefile.am | 1 - |
165 | src/dkp-history-obj.c | 173 | |
165 | src/up-history-obj.c | 173 | |
166 | 166 | ------------------------------------- |
167 | src/dkp-history-obj.h | 51 ----------- | |
168 | tools/dkp-tool.c | 29 ++++-- | |
167 | src/up-history-obj.h | 51 ----------- | |
168 | tools/up-tool.c | 29 ++++-- | |
169 | 169 | 7 files changed, 245 insertions(+), 235 deletions(-) |
170 | 170 | |
171 | 171 | commit 3e8ab9514a4524d33128295e65b32fc42411b523 |
174 | 174 | |
175 | 175 | get the device stats in the helper tool |
176 | 176 | |
177 | tools/dkp-tool.c | 82 | |
177 | tools/up-tool.c | 82 | |
178 | 178 | +++++++++++++++++++++++++++++++++++++++++++++++++++-- |
179 | 179 | 1 files changed, 78 insertions(+), 4 deletions(-) |
180 | 180 | |
184 | 184 | |
185 | 185 | don't crash if we do GetStatistics on a device without history |
186 | 186 | |
187 | src/dkp-source.c | 7 +++++++ | |
187 | src/up-source.c | 7 +++++++ | |
188 | 188 | 1 files changed, 7 insertions(+), 0 deletions(-) |
189 | 189 | |
190 | 190 | commit 0e617b862c8e427cfbcaaeb5f47b7f19979479b5 |
191 | 191 | Author: Richard Hughes <richard@hughsie.com> |
192 | 192 | Date: Mon Aug 4 15:36:47 2008 +0100 |
193 | 193 | |
194 | Add a GetStatistics() method on org.freedesktop.DeviceKit.Power.Source | |
194 | Add a GetStatistics() method on org.freedesktop.UPower.Source | |
195 | 195 | so we can print some funky graphs |
196 | 196 | |
197 | src/dkp-source.c | 96 | |
197 | src/up-source.c | 96 | |
198 | 198 | ++++++++++++++++++++++- |
199 | src/dkp-source.h | 20 +++++- | |
200 | src/org.freedesktop.DeviceKit.Power.Source.xml | 23 ++++++ | |
199 | src/up-source.h | 20 +++++- | |
200 | src/org.freedesktop.UPower.Source.xml | 23 ++++++ | |
201 | 201 | 3 files changed, 132 insertions(+), 7 deletions(-) |
202 | 202 | |
203 | 203 | commit dfd11030674b9e52ada85c62a3a0860d14c4ac95 |
206 | 206 | |
207 | 207 | the power_supply class gives a very clear status enum, just use it |
208 | 208 | |
209 | src/dkp-source.c | 36 +++++++++++++++--------------------- | |
209 | src/up-source.c | 36 +++++++++++++++--------------------- | |
210 | 210 | 1 files changed, 15 insertions(+), 21 deletions(-) |
211 | 211 | |
212 | 212 | commit a562159bc73920fd913a859bf5c822a31d14ef1e |
216 | 216 | add simple history data to be saved and retrieved |
217 | 217 | |
218 | 218 | src/Makefile.am | 4 + |
219 | src/dkp-history.c | 495 | |
219 | src/up-history.c | 495 | |
220 | 220 | +++++++++++++++++++++++++++++++++++++++++++++++++++++ |
221 | src/dkp-history.h | 71 ++++++++ | |
222 | src/dkp-source.c | 43 +++++- | |
221 | src/up-history.h | 71 ++++++++ | |
222 | src/up-source.c | 43 +++++- | |
223 | 223 | 4 files changed, 612 insertions(+), 1 deletions(-) |
224 | 224 | |
225 | 225 | commit 1d7655c14fe6b622e6d01269e11c1c193e1a63ce |
229 | 229 | add some helpers to manipulate DkpHistoryObj objects for the future |
230 | 230 | history and profiling code |
231 | 231 | |
232 | src/dkp-history-obj.c | 173 | |
232 | src/up-history-obj.c | 173 | |
233 | 233 | +++++++++++++++++++++++++++++++++++++++++++++++++ |
234 | src/dkp-history-obj.h | 51 ++++++++++++++ | |
234 | src/up-history-obj.h | 51 ++++++++++++++ | |
235 | 235 | 2 files changed, 224 insertions(+), 0 deletions(-) |
236 | 236 | |
237 | 237 | commit 3f606443b59c0f2c5eac3573855080edf1a28468 |
238 | 238 | Author: Richard Hughes <richard@hughsie.com> |
239 | 239 | Date: Mon Aug 4 14:30:34 2008 +0100 |
240 | 240 | |
241 | add a function dkp_object_diff() to pretty print the differences | |
241 | add a function up_object_diff() to pretty print the differences | |
242 | 242 | between two DkpObject's |
243 | 243 | |
244 | devkit-power-gobject/dkp-object.c | 162 | |
244 | upower-gobject/up-object.c | 162 | |
245 | 245 | ++++++++++++++++++++++++++++++++++++----- |
246 | devkit-power-gobject/dkp-object.h | 2 + | |
246 | upower-gobject/up-object.h | 2 + | |
247 | 247 | 2 files changed, 144 insertions(+), 20 deletions(-) |
248 | 248 | |
249 | 249 | commit 66b6a807227036a256634cfc42f0ecc4ce51d83d |
252 | 252 | |
253 | 253 | print a better seconds/minutes/hours text -- needs localising properly |
254 | 254 | |
255 | devkit-power-gobject/dkp-object.c | 36 ++++++++++++++++++++++++++++++------ | |
255 | upower-gobject/up-object.c | 36 ++++++++++++++++++++++++++++++------ | |
256 | 256 | 1 files changed, 30 insertions(+), 6 deletions(-) |
257 | 257 | |
258 | 258 | commit b5b5b6824bece0dd9a49f9e219dcf743e0b22a81 |
270 | 270 | |
271 | 271 | remove some trivial whitespace and an invalid comment |
272 | 272 | |
273 | src/org.freedesktop.DeviceKit.Power.Source.xml | 7 ------- | |
273 | src/org.freedesktop.UPower.Source.xml | 7 ------- | |
274 | 274 | 1 files changed, 0 insertions(+), 7 deletions(-) |
275 | 275 | |
276 | 276 | commit 0cd1a18a20a2de890704a69d813969442899adf7 |
279 | 279 | |
280 | 280 | add the skeleton --dump option for debugging -- more to come |
281 | 281 | |
282 | tools/dkp-tool.c | 6 +++++- | |
282 | tools/up-tool.c | 6 +++++- | |
283 | 283 | 1 files changed, 5 insertions(+), 1 deletions(-) |
284 | 284 | |
285 | 285 | commit 117720b03de371e7d4194a8556c3eb413f7c43d1 |
298 | 298 | only poll when we have no updates when charging or discharging. if |
299 | 299 | we are empty or full, there's no point |
300 | 300 | |
301 | src/dkp-source.c | 12 ++++++------ | |
301 | src/up-source.c | 12 ++++++------ | |
302 | 302 | 1 files changed, 6 insertions(+), 6 deletions(-) |
303 | 303 | |
304 | 304 | commit b626fcd195908e07b3c9581183bc6c6d11479e2a |
326 | 326 | |
327 | 327 | Makefile.am | 2 +- |
328 | 328 | configure.in | 1 + |
329 | devkit-power-gobject/.gitignore | 11 ++ | |
330 | devkit-power-gobject/Makefile.am | 25 +++ | |
331 | devkit-power-gobject/egg-debug.c | 240 ++++++++++++++++++++++++++++ | |
332 | devkit-power-gobject/egg-debug.h | 80 +++++++++ | |
333 | devkit-power-gobject/dkp-enum.c | 229 ++++++++++++++++++++++++++ | |
334 | devkit-power-gobject/dkp-enum.h | 69 ++++++++ | |
335 | devkit-power-gobject/dkp-object.c | 361 | |
329 | upower-gobject/.gitignore | 11 ++ | |
330 | upower-gobject/Makefile.am | 25 +++ | |
331 | upower-gobject/egg-debug.c | 240 ++++++++++++++++++++++++++++ | |
332 | upower-gobject/egg-debug.h | 80 +++++++++ | |
333 | upower-gobject/up-enum.c | 229 ++++++++++++++++++++++++++ | |
334 | upower-gobject/up-enum.h | 69 ++++++++ | |
335 | upower-gobject/up-object.c | 361 | |
336 | 336 | ++++++++++++++++++++++++++++++++++++++++++ |
337 | devkit-power-gobject/dkp-object.h | 67 ++++++++ | |
337 | upower-gobject/up-object.h | 67 ++++++++ | |
338 | 338 | src/Makefile.am | 7 +- |
339 | 339 | src/egg-debug.c | 240 ---------------------------- |
340 | 340 | src/egg-debug.h | 80 --------- |
341 | src/dkp-enum.c | 229 -------------------------- | |
342 | src/dkp-enum.h | 69 -------- | |
343 | src/dkp-object.c | 361 | |
341 | src/up-enum.c | 229 -------------------------- | |
342 | src/up-enum.h | 69 -------- | |
343 | src/up-object.c | 361 | |
344 | 344 | ------------------------------------------ |
345 | src/dkp-object.h | 67 -------- | |
345 | src/up-object.h | 67 -------- | |
346 | 346 | tools/Makefile.am | 7 +- |
347 | tools/dkp-tool.c | 4 +- | |
347 | tools/up-tool.c | 4 +- | |
348 | 348 | 19 files changed, 1094 insertions(+), 1055 deletions(-) |
349 | 349 | |
350 | 350 | commit d06a9707c5e2ab366325e5e8e77207dcc1885c56 |
353 | 353 | |
354 | 354 | trivial line fixes :-) |
355 | 355 | |
356 | src/dkp-daemon.c | 7 ------- | |
357 | src/dkp-source.c | 2 -- | |
356 | src/up-daemon.c | 7 ------- | |
357 | src/up-source.c | 2 -- | |
358 | 358 | 2 files changed, 0 insertions(+), 9 deletions(-) |
359 | 359 | |
360 | 360 | commit d9a0190fe2d3f277750ace2e71ae25aa0ead7cef |
361 | 361 | Author: Richard Hughes <richard@hughsie.com> |
362 | 362 | Date: Fri Aug 1 16:55:50 2008 +0100 |
363 | 363 | |
364 | don't print blank lines in dkp_object_print | |
365 | ||
366 | src/dkp-object.c | 32 +++++++++++++++++++++++++++++--- | |
367 | src/dkp-source.c | 5 +++++ | |
364 | don't print blank lines in up_object_print | |
365 | ||
366 | src/up-object.c | 32 +++++++++++++++++++++++++++++--- | |
367 | src/up-source.c | 5 +++++ | |
368 | 368 | 2 files changed, 34 insertions(+), 3 deletions(-) |
369 | 369 | |
370 | 370 | commit dee758ac78df79e5378efddd493e6e870c75f3d6 |
371 | 371 | Author: Richard Hughes <richard@hughsie.com> |
372 | 372 | Date: Fri Aug 1 16:48:33 2008 +0100 |
373 | 373 | |
374 | use DkpObject in devkit-power command line tool | |
375 | ||
376 | tools/dkp-tool.c | 209 | |
374 | use DkpObject in upower command line tool | |
375 | ||
376 | tools/up-tool.c | 209 | |
377 | 377 | ++++++++++++------------------------------------------ |
378 | 378 | 1 files changed, 46 insertions(+), 163 deletions(-) |
379 | 379 | |
385 | 385 | it, check for changes and print it |
386 | 386 | |
387 | 387 | src/Makefile.am | 1 + |
388 | src/dkp-object.c | 335 | |
388 | src/up-object.c | 335 | |
389 | 389 | +++++++++++++++++++++++++++++++++++++++++++++++++++ |
390 | src/dkp-object.h | 67 +++++++++++ | |
391 | src/dkp-source.c | 344 | |
390 | src/up-object.h | 67 +++++++++++ | |
391 | src/up-source.c | 344 | |
392 | 392 | +++++++++++++++++++++-------------------------------- |
393 | 393 | tools/Makefile.am | 2 + |
394 | 394 | 5 files changed, 542 insertions(+), 207 deletions(-) |
397 | 397 | Author: Richard Hughes <richard@hughsie.com> |
398 | 398 | Date: Fri Aug 1 16:36:12 2008 +0100 |
399 | 399 | |
400 | remove energy-empty-design from devkit-power tool | |
401 | ||
402 | tools/dkp-tool.c | 4 ---- | |
400 | remove energy-empty-design from upower tool | |
401 | ||
402 | tools/up-tool.c | 4 ---- | |
403 | 403 | 1 files changed, 0 insertions(+), 4 deletions(-) |
404 | 404 | |
405 | 405 | commit 9cc2a944cb50c29cf0dc1b95f436a1e88cda38dd |
408 | 408 | |
409 | 409 | add the abilty to turn the text enum forms back into enumerated types |
410 | 410 | |
411 | src/dkp-enum.c | 77 | |
411 | src/up-enum.c | 77 | |
412 | 412 | ++++++++++++++++++++++++++++++++++++++++++++++++++++--- |
413 | src/dkp-enum.h | 9 ++++-- | |
413 | src/up-enum.h | 9 ++++-- | |
414 | 414 | 2 files changed, 78 insertions(+), 8 deletions(-) |
415 | 415 | |
416 | 416 | commit 9db5f0d3dcb665c7fad558da547c9648ef6ba647 |
419 | 419 | |
420 | 420 | fix the type and state enums when getting unknown |
421 | 421 | |
422 | src/dkp-enum.c | 6 ++++++ | |
422 | src/up-enum.c | 6 ++++++ | |
423 | 423 | 1 files changed, 6 insertions(+), 0 deletions(-) |
424 | 424 | |
425 | 425 | commit 27cde0b6e03adc2db73413e4b4df09e00e86c337 |
426 | 426 | Author: Richard Hughes <richard@hughsie.com> |
427 | 427 | Date: Fri Aug 1 13:15:40 2008 +0100 |
428 | 428 | |
429 | rework devkit-power tool, more work to come | |
429 | rework upower tool, more work to come | |
430 | 430 | |
431 | 431 | po/POTFILES.in | 3 + |
432 | 432 | tools/Makefile.am | 19 ++-- |
433 | tools/devkit-power.c | 376 | |
433 | tools/upower.c | 376 | |
434 | 434 | -------------------------------------------------- |
435 | tools/dkp-tool.c | 371 | |
435 | tools/up-tool.c | 371 | |
436 | 436 | +++++++++++++++++++++++++++++++++++++++++++++++++ |
437 | 437 | 4 files changed, 384 insertions(+), 385 deletions(-) |
438 | 438 | |
443 | 443 | add some debugging infrastructure |
444 | 444 | |
445 | 445 | src/Makefile.am | 1 + |
446 | src/dkp-daemon.c | 49 ++++++------ | |
446 | src/up-daemon.c | 49 ++++++------ | |
447 | 447 | src/egg-debug.c | 240 |
448 | 448 | +++++++++++++++++++++++++++++++++++++++++++++++++++++ |
449 | 449 | src/egg-debug.h | 80 ++++++++++++++++++ |
450 | src/dkp-device.c | 12 ++- | |
451 | src/dkp-enum.c | 7 +- | |
452 | src/dkp-source.c | 23 +++--- | |
450 | src/up-device.c | 12 ++- | |
451 | src/up-enum.c | 7 +- | |
452 | src/up-source.c | 23 +++--- | |
453 | 453 | src/main.c | 44 +++++----- |
454 | 454 | src/sysfs-utils.c | 10 +- |
455 | 455 | 9 files changed, 396 insertions(+), 70 deletions(-) |
460 | 460 | |
461 | 461 | convert spaces to tabs, and make sure functions have sensible names |
462 | 462 | |
463 | src/dkp-daemon.c | 1095 +++++++++++++++++++++++++----------------------- | |
464 | src/dkp-daemon.h | 63 ++-- | |
465 | src/dkp-device.c | 49 ++- | |
466 | src/dkp-device.h | 43 +- | |
467 | src/dkp-enum.c | 164 ++++---- | |
468 | src/dkp-enum.h | 50 ++-- | |
469 | src/dkp-source.c | 1213 | |
463 | src/up-daemon.c | 1095 +++++++++++++++++++++++++----------------------- | |
464 | src/up-daemon.h | 63 ++-- | |
465 | src/up-device.c | 49 ++- | |
466 | src/up-device.h | 43 +- | |
467 | src/up-enum.c | 164 ++++---- | |
468 | src/up-enum.h | 50 ++-- | |
469 | src/up-source.c | 1213 | |
470 | 470 | +++++++++++++++++++++++++++-------------------------- |
471 | src/dkp-source.h | 29 +- | |
471 | src/up-source.h | 29 +- | |
472 | 472 | src/main.c | 176 ++++---- |
473 | 473 | src/sysfs-utils.c | 244 ++++++------ |
474 | 474 | 10 files changed, 1624 insertions(+), 1502 deletions(-) |
480 | 480 | change the GObject prefix from DevkitPower to Dkp |
481 | 481 | |
482 | 482 | src/Makefile.am | 8 ++-- |
483 | src/dkp-daemon.c | 152 | |
483 | src/up-daemon.c | 152 | |
484 | 484 | +++++++++++++++++++++++++++--------------------------- |
485 | src/dkp-daemon.h | 62 +++++++++++----------- | |
486 | src/dkp-device.c | 32 ++++++------ | |
487 | src/dkp-device.h | 38 +++++++------- | |
488 | src/dkp-enum.c | 60 +++++++++++----------- | |
489 | src/dkp-enum.h | 60 +++++++++++----------- | |
490 | src/dkp-source.c | 138 ++++++++++++++++++++++++------------------------ | |
491 | src/dkp-source.h | 38 +++++++------- | |
485 | src/up-daemon.h | 62 +++++++++++----------- | |
486 | src/up-device.c | 32 ++++++------ | |
487 | src/up-device.h | 38 +++++++------- | |
488 | src/up-enum.c | 60 +++++++++++----------- | |
489 | src/up-enum.h | 60 +++++++++++----------- | |
490 | src/up-source.c | 138 ++++++++++++++++++++++++------------------------ | |
491 | src/up-source.h | 38 +++++++------- | |
492 | 492 | src/main.c | 4 +- |
493 | 493 | 10 files changed, 296 insertions(+), 296 deletions(-) |
494 | 494 | |
500 | 500 | |
501 | 501 | src/Makefile.am | 53 |
502 | 502 | +++++++++++++++++++++++++++-------------------------- |
503 | src/dkp-daemon.c | 8 ++++---- | |
504 | src/dkp-device.c | 4 ++-- | |
505 | src/dkp-device.h | 2 +- | |
506 | src/dkp-enum.c | 3 ++- | |
507 | src/dkp-source.c | 8 ++++---- | |
508 | src/dkp-source.h | 4 ++-- | |
503 | src/up-daemon.c | 8 ++++---- | |
504 | src/up-device.c | 4 ++-- | |
505 | src/up-device.h | 2 +- | |
506 | src/up-enum.c | 3 ++- | |
507 | src/up-source.c | 8 ++++---- | |
508 | src/up-source.h | 4 ++-- | |
509 | 509 | src/main.c | 2 +- |
510 | 510 | 8 files changed, 43 insertions(+), 41 deletions(-) |
511 | 511 | |
516 | 516 | add some more GCC warnings |
517 | 517 | |
518 | 518 | configure.in | 9 + |
519 | src/devkit-power-daemon.c | 755 | |
519 | src/upower-daemon.c | 755 | |
520 | 520 | ------------------------------------- |
521 | src/devkit-power-daemon.h | 92 ----- | |
522 | src/devkit-power-device.c | 92 ----- | |
523 | src/devkit-power-device.h | 68 ---- | |
524 | src/devkit-power-enum.c | 142 ------- | |
525 | src/devkit-power-enum.h | 66 ---- | |
526 | src/devkit-power-marshal.list | 2 - | |
527 | src/devkit-power-source.c | 838 | |
521 | src/upower-daemon.h | 92 ----- | |
522 | src/upower-device.c | 92 ----- | |
523 | src/upower-device.h | 68 ---- | |
524 | src/upower-enum.c | 142 ------- | |
525 | src/upower-enum.h | 66 ---- | |
526 | src/upower-marshal.list | 2 - | |
527 | src/upower-source.c | 838 | |
528 | 528 | ----------------------------------------- |
529 | src/devkit-power-source.h | 65 ---- | |
530 | src/dkp-daemon.c | 755 | |
529 | src/upower-source.h | 65 ---- | |
530 | src/up-daemon.c | 755 | |
531 | 531 | +++++++++++++++++++++++++++++++++++++ |
532 | src/dkp-daemon.h | 92 +++++ | |
533 | src/dkp-device.c | 92 +++++ | |
534 | src/dkp-device.h | 68 ++++ | |
535 | src/dkp-enum.c | 142 +++++++ | |
536 | src/dkp-enum.h | 66 ++++ | |
537 | src/dkp-marshal.list | 2 + | |
538 | src/dkp-source.c | 838 | |
532 | src/up-daemon.h | 92 +++++ | |
533 | src/up-device.c | 92 +++++ | |
534 | src/up-device.h | 68 ++++ | |
535 | src/up-enum.c | 142 +++++++ | |
536 | src/up-enum.h | 66 ++++ | |
537 | src/up-marshal.list | 2 + | |
538 | src/up-source.c | 838 | |
539 | 539 | +++++++++++++++++++++++++++++++++++++++++ |
540 | src/dkp-source.h | 65 ++++ | |
540 | src/up-source.h | 65 ++++ | |
541 | 541 | 19 files changed, 2129 insertions(+), 2120 deletions(-) |
542 | 542 | |
543 | 543 | commit 1023e581335f5a078319b86794c24dd92f9b69f2 |
546 | 546 | |
547 | 547 | when we haven't got a rate value, try to calculate this |
548 | 548 | |
549 | src/devkit-power-source.c | 75 | |
549 | src/upower-source.c | 75 | |
550 | 550 | ++++++++++++++++++++++++++++++++++++-------- |
551 | 551 | 1 files changed, 61 insertions(+), 14 deletions(-) |
552 | 552 | |
556 | 556 | |
557 | 557 | don't return an ID if we are not present |
558 | 558 | |
559 | src/devkit-power-source.c | 4 ++++ | |
559 | src/upower-source.c | 4 ++++ | |
560 | 560 | 1 files changed, 4 insertions(+), 0 deletions(-) |
561 | 561 | |
562 | 562 | commit d85c4956741a3c02a7ae03cd2b429f0035080992 |
565 | 565 | |
566 | 566 | add some more logic into the power supply class |
567 | 567 | |
568 | src/devkit-power-source.c | 23 ++++++++++++++++------- | |
568 | src/upower-source.c | 23 ++++++++++++++++------- | |
569 | 569 | 1 files changed, 16 insertions(+), 7 deletions(-) |
570 | 570 | |
571 | 571 | commit fccd159c739a71e8863c96ee6b9037ba8f3ae83e |
574 | 574 | |
575 | 575 | calculate a quick and dirty time remaining value |
576 | 576 | |
577 | src/devkit-power-source.c | 30 ++++++++++++++++++++++++++++++ | |
577 | src/upower-source.c | 30 ++++++++++++++++++++++++++++++ | |
578 | 578 | 1 files changed, 30 insertions(+), 0 deletions(-) |
579 | 579 | |
580 | 580 | commit d7447437dd1d2bc722a2bc746d9af2fb8b9a1a28 |
583 | 583 | |
584 | 584 | only suppy an id for devices supplying the system |
585 | 585 | |
586 | src/devkit-power-source.c | 4 ++++ | |
586 | src/upower-source.c | 4 ++++ | |
587 | 587 | 1 files changed, 4 insertions(+), 0 deletions(-) |
588 | 588 | |
589 | 589 | commit 4a15e42c41415a8c9cc59e23c51092e097dfe7d4 |
593 | 593 | add a power-supply bool property so we can tell if the device is a |
594 | 594 | supplier or consumer |
595 | 595 | |
596 | src/devkit-power-source.c | 14 ++++++++++++++ | |
597 | src/org.freedesktop.DeviceKit.Power.Source.xml | 8 ++++++++ | |
596 | src/upower-source.c | 14 ++++++++++++++ | |
597 | src/org.freedesktop.UPower.Source.xml | 8 ++++++++ | |
598 | 598 | 2 files changed, 22 insertions(+), 0 deletions(-) |
599 | 599 | |
600 | 600 | commit 36bf97d9133f4bfd1f134da6c3052785701be65d |
603 | 603 | |
604 | 604 | provide a function for getting a unique ID for the battery |
605 | 605 | |
606 | src/devkit-power-source.c | 42 | |
606 | src/upower-source.c | 42 | |
607 | 607 | ++++++++++++++++++++++++++++++++++++++++++ |
608 | src/devkit-power-source.h | 1 + | |
608 | src/upower-source.h | 1 + | |
609 | 609 | 2 files changed, 43 insertions(+), 0 deletions(-) |
610 | 610 | |
611 | 611 | commit 2ed6ed80190a746f30c8b3fa08d3462b02669c5a |
614 | 614 | |
615 | 615 | add a couple of sanity checks for the battery values |
616 | 616 | |
617 | src/devkit-power-source.c | 10 ++++++++++ | |
617 | src/upower-source.c | 10 ++++++++++ | |
618 | 618 | 1 files changed, 10 insertions(+), 0 deletions(-) |
619 | 619 | |
620 | 620 | commit 32df1e0cc1ae92503902a1e329ed56952a942841 |
624 | 624 | add two bits of data that session applications really want -- |
625 | 625 | battery mode and low battery mode |
626 | 626 | |
627 | src/devkit-power-daemon.c | 46 ++++++++++++++++++++++ | |
628 | src/devkit-power-daemon.h | 4 ++ | |
629 | src/org.freedesktop.DeviceKit.Power.xml | 63 | |
627 | src/upower-daemon.c | 46 ++++++++++++++++++++++ | |
628 | src/upower-daemon.h | 4 ++ | |
629 | src/org.freedesktop.UPower.xml | 63 | |
630 | 630 | +++++++++++++++++++++++++++++++ |
631 | 631 | 3 files changed, 113 insertions(+), 0 deletions(-) |
632 | 632 | |
636 | 636 | |
637 | 637 | add the Suspend() and Hibernate() stub methods |
638 | 638 | |
639 | src/devkit-power-daemon.c | 78 | |
639 | src/upower-daemon.c | 78 | |
640 | 640 | +++++++++++++++++++++++++++++++ |
641 | src/devkit-power-daemon.h | 4 ++ | |
642 | src/org.freedesktop.DeviceKit.Power.xml | 28 +++++++++++ | |
641 | src/upower-daemon.h | 4 ++ | |
642 | src/org.freedesktop.UPower.xml | 28 +++++++++++ | |
643 | 643 | 3 files changed, 110 insertions(+), 0 deletions(-) |
644 | 644 | |
645 | 645 | commit 9ce7f3665be06b34e6a4cb9199050b98c731b0fc |
648 | 648 | |
649 | 649 | if the battery goes away, properly clean up the cached values |
650 | 650 | |
651 | src/devkit-power-source.c | 7 +++++++ | |
651 | src/upower-source.c | 7 +++++++ | |
652 | 652 | 1 files changed, 7 insertions(+), 0 deletions(-) |
653 | 653 | |
654 | 654 | commit a6f9b0fcb6043b0ad778f88e660694fbadefd81b |
658 | 658 | using the technology as the coldplug indicator is a bad idea, |
659 | 659 | properly flag this |
660 | 660 | |
661 | src/devkit-power-source.c | 86 | |
661 | src/upower-source.c | 86 | |
662 | 662 | ++++++++++++++++++++++++++++++++------------ |
663 | 663 | 1 files changed, 62 insertions(+), 24 deletions(-) |
664 | 664 | |
669 | 669 | export battery-is-present as some batteries in laptops and UPSs can |
670 | 670 | be removed |
671 | 671 | |
672 | src/devkit-power-source.c | 13 +++++++++++++ | |
673 | src/org.freedesktop.DeviceKit.Power.Source.xml | 12 ++++++++++++ | |
672 | src/upower-source.c | 13 +++++++++++++ | |
673 | src/org.freedesktop.UPower.Source.xml | 12 ++++++++++++ | |
674 | 674 | 2 files changed, 25 insertions(+), 0 deletions(-) |
675 | 675 | |
676 | 676 | commit a1f9c0528097593c62822329ba1e66bf3a3f8d16 |
680 | 680 | export battery-is-rechargeable so we can export if we think it can |
681 | 681 | be recharged |
682 | 682 | |
683 | src/devkit-power-source.c | 12 ++++++++++++ | |
684 | src/org.freedesktop.DeviceKit.Power.Source.xml | 10 ++++++++++ | |
683 | src/upower-source.c | 12 ++++++++++++ | |
684 | src/org.freedesktop.UPower.Source.xml | 10 ++++++++++ | |
685 | 685 | 2 files changed, 22 insertions(+), 0 deletions(-) |
686 | 686 | |
687 | 687 | commit 4433bd3379bd4aa675ad2542bd64bbef2c5dc253 |
690 | 690 | |
691 | 691 | export battery-capacity as it's a useful property of a battery |
692 | 692 | |
693 | src/devkit-power-source.c | 9 +++++++++ | |
694 | src/org.freedesktop.DeviceKit.Power.Source.xml | 17 +++++++++++++++++ | |
693 | src/upower-source.c | 9 +++++++++ | |
694 | src/org.freedesktop.UPower.Source.xml | 17 +++++++++++++++++ | |
695 | 695 | 2 files changed, 26 insertions(+), 0 deletions(-) |
696 | 696 | |
697 | 697 | commit ec658f5d29fef7ba592450703766b9f374dbe79f |
700 | 700 | |
701 | 701 | battery-technology should be an enumerated type |
702 | 702 | |
703 | src/devkit-power-enum.c | 62 | |
703 | src/upower-enum.c | 62 | |
704 | 704 | ++++++++++++++++++++++++ |
705 | src/devkit-power-enum.h | 12 +++++ | |
706 | src/devkit-power-source.c | 10 ++-- | |
707 | src/org.freedesktop.DeviceKit.Power.Source.xml | 3 +- | |
705 | src/upower-enum.h | 12 +++++ | |
706 | src/upower-source.c | 10 ++-- | |
707 | src/org.freedesktop.UPower.Source.xml | 3 +- | |
708 | 708 | 4 files changed, 80 insertions(+), 7 deletions(-) |
709 | 709 | |
710 | 710 | commit 2da987f9bca5479e352ac98bc73d5ebfe2c0e43d |
713 | 713 | |
714 | 714 | add the battery state enumerated type property |
715 | 715 | |
716 | src/devkit-power-enum.c | 24 | |
716 | src/upower-enum.c | 24 | |
717 | 717 | ++++++++++++++++++++++++ |
718 | src/devkit-power-enum.h | 9 +++++++++ | |
719 | src/devkit-power-source.c | 23 | |
718 | src/upower-enum.h | 9 +++++++++ | |
719 | src/upower-source.c | 23 | |
720 | 720 | ++++++++++++++++++++++- |
721 | src/org.freedesktop.DeviceKit.Power.Source.xml | 12 ++++++++++++ | |
721 | src/org.freedesktop.UPower.Source.xml | 12 ++++++++++++ | |
722 | 722 | 4 files changed, 67 insertions(+), 1 deletions(-) |
723 | 723 | |
724 | 724 | commit f1c5630274195d4c613b95a49200ac48c3130f11 |
725 | 725 | Author: Richard Hughes <richard@hughsie.com> |
726 | 726 | Date: Thu Jul 24 17:52:51 2008 +0100 |
727 | 727 | |
728 | split out the enumerated stuff into devkit-power-enum.[c|h] as | |
728 | split out the enumerated stuff into upower-enum.[c|h] as | |
729 | 729 | they'll be more soon |
730 | 730 | |
731 | 731 | src/Makefile.am | 1 + |
732 | src/devkit-power-enum.c | 56 | |
732 | src/upower-enum.c | 56 | |
733 | 733 | +++++++++++++++++++++++++++++++++++++++++++++ |
734 | src/devkit-power-enum.h | 45 ++++++++++++++++++++++++++++++++++++ | |
735 | src/devkit-power-source.c | 24 ++++++++----------- | |
734 | src/upower-enum.h | 45 ++++++++++++++++++++++++++++++++++++ | |
735 | src/upower-source.c | 24 ++++++++----------- | |
736 | 736 | 4 files changed, 112 insertions(+), 14 deletions(-) |
737 | 737 | |
738 | 738 | commit 8a04a2c3eda34f049a0d2190070c9c9e19ee46ec |
742 | 742 | remove the battery-energy-empty-design parameter, it's never going |
743 | 743 | to be anything other than zero |
744 | 744 | |
745 | src/devkit-power-source.c | 9 --------- | |
746 | src/org.freedesktop.DeviceKit.Power.Source.xml | 11 ----------- | |
745 | src/upower-source.c | 9 --------- | |
746 | src/org.freedesktop.UPower.Source.xml | 11 ----------- | |
747 | 747 | 2 files changed, 0 insertions(+), 20 deletions(-) |
748 | 748 | |
749 | 749 | commit 4398839de1ecf4e88f425703c182444540a488c2 |
750 | 750 | Author: Richard Hughes <richard@hughsie.com> |
751 | 751 | Date: Thu Jul 24 17:41:14 2008 +0100 |
752 | 752 | |
753 | add the PolicyKit action org.freedesktop.devicekit.power.hibernate | |
754 | ||
755 | policy/org.freedesktop.devicekit.power.policy.in | 14 ++++++++++++-- | |
753 | add the PolicyKit action org.freedesktop.upower.hibernate | |
754 | ||
755 | policy/org.freedesktop.upower.policy.in | 14 ++++++++++++-- | |
756 | 756 | 1 files changed, 12 insertions(+), 2 deletions(-) |
757 | 757 | |
758 | 758 | commit 058834be91645d445c1c785e3339fc383efba301 |
772 | 772 | fixup a few places where we mention a disk daemon to a power daemon |
773 | 773 | |
774 | 774 | HACKING | 4 ++-- |
775 | src/org.freedesktop.DeviceKit.Power.Source.xml | 2 +- | |
776 | src/org.freedesktop.DeviceKit.Power.xml | 2 +- | |
777 | tools/devkit-power.c | 2 +- | |
775 | src/org.freedesktop.UPower.Source.xml | 2 +- | |
776 | src/org.freedesktop.UPower.xml | 2 +- | |
777 | tools/upower.c | 2 +- | |
778 | 778 | 4 files changed, 5 insertions(+), 5 deletions(-) |
779 | 779 | |
780 | 780 | commit 2a09a8062afc2a5947cb9ef5b0b1c2a57d1efdbb |
792 | 792 | |
793 | 793 | forgot to add files |
794 | 794 | |
795 | src/org.freedesktop.DeviceKit.Power.conf.in | 11 +++++++++++ | |
796 | src/org.freedesktop.DeviceKit.Power.service.in | 5 +++++ | |
795 | src/org.freedesktop.UPower.conf.in | 11 +++++++++++ | |
796 | src/org.freedesktop.UPower.service.in | 5 +++++ | |
797 | 797 | 2 files changed, 16 insertions(+), 0 deletions(-) |
798 | 798 | |
799 | 799 | commit 44d53913068e11cd3da871f4dc5285f6149b5b4f |
827 | 827 | doc/dbus/dbus-introspect-docs.dtd | 32 ++ |
828 | 828 | doc/dbus/spec-to-docbook.xsl | 543 |
829 | 829 | +++++++++++++++++++ |
830 | doc/devkit-power-docs.xml | 94 ++++ | |
831 | doc/man/DeviceKit-power.xml | 64 +++ | |
830 | doc/upower-docs.xml | 94 ++++ | |
831 | doc/man/UPower.xml | 64 +++ | |
832 | 832 | doc/man/Makefile.am | 24 + |
833 | doc/man/devkit-power-daemon.xml | 84 +++ | |
834 | doc/man/devkit-power.xml | 99 ++++ | |
833 | doc/man/upower-daemon.xml | 84 +++ | |
834 | doc/man/upower.xml | 99 ++++ | |
835 | 835 | doc/version.xml | 1 + |
836 | 836 | gtk-doc.make | 159 ++++++ |
837 | 837 | mkinstalldirs | 111 ++++ |
838 | 838 | po/LINGUAS | 4 + |
839 | 839 | po/POTFILES.in | 4 + |
840 | 840 | policy/Makefile.am | 17 + |
841 | policy/org.freedesktop.devicekit.power.policy.in | 32 ++ | |
841 | policy/org.freedesktop.upower.policy.in | 32 ++ | |
842 | 842 | src/Makefile.am | 82 +++ |
843 | src/devkit-power-daemon.c | 631 | |
843 | src/upower-daemon.c | 631 | |
844 | 844 | ++++++++++++++++++++++ |
845 | src/devkit-power-daemon.h | 84 +++ | |
846 | src/devkit-power-device.c | 92 ++++ | |
847 | src/devkit-power-device.h | 68 +++ | |
848 | src/devkit-power-marshal.list | 2 + | |
849 | src/devkit-power-source.c | 593 | |
845 | src/upower-daemon.h | 84 +++ | |
846 | src/upower-device.c | 92 ++++ | |
847 | src/upower-device.h | 68 +++ | |
848 | src/upower-marshal.list | 2 + | |
849 | src/upower-source.c | 593 | |
850 | 850 | ++++++++++++++++++++ |
851 | src/devkit-power-source.h | 64 +++ | |
851 | src/upower-source.h | 64 +++ | |
852 | 852 | src/main.c | 157 ++++++ |
853 | src/org.freedesktop.DeviceKit.Power.Source.xml | 228 ++++++++ | |
854 | src/org.freedesktop.DeviceKit.Power.xml | 77 +++ | |
853 | src/org.freedesktop.UPower.Source.xml | 228 ++++++++ | |
854 | src/org.freedesktop.UPower.xml | 77 +++ | |
855 | 855 | src/sysfs-utils.c | 203 +++++++ |
856 | 856 | src/sysfs-utils.h | 36 ++ |
857 | 857 | tools/Makefile.am | 49 ++ |
858 | tools/devkit-power.c | 376 +++++++++++++ | |
858 | tools/upower.c | 376 +++++++++++++ | |
859 | 859 | 41 files changed, 4941 insertions(+), 0 deletions(-) |
0 | Version 013 | |
1 | ~~~~~~~~~~~ | |
2 | Released: 2009-12-07 | |
3 | ||
4 | Note: | |
5 | - The DBus interface of DeviceKit-power may be subject to change in future | |
6 | versions of this daemon. | |
7 | - This will probably be the last release of DeviceKit-power as the project has | |
8 | been renamed to upower. | |
9 | ||
10 | New Features: | |
11 | - When using devkit-power --monitor, print a timestamp before each message for | |
12 | debugging. Fixes fd#24666 (Richard Hughes) | |
13 | ||
14 | Bugfixes: | |
15 | - Update the list of HID UPS (Arnaud Quette) | |
16 | - Use a gdouble for percentage to fix on-battery reporting (Byron Clark) | |
17 | - Bug 24262 – incorrect battery recall warning for Lenovo T61 (Martin Pitt) | |
18 | - Fix the toshiba battery recal notices by matching up the double quotes (Richard Hughes) | |
19 | - Avoid going from discharging to pending-discharge when the expansion battery | |
20 | is very low (Richard Hughes) | |
21 | - Some vendors fill the NVRAM full of junk. Don't crash the daemon if the | |
22 | battery is broken. Fixes rh#533654 (Richard Hughes) | |
23 | - When the internal battery is in the unknown state, we can't make a decision | |
24 | whether the system is on battery power (Richard Hughes) | |
25 | - Some batteries give out massive rate values when nearly empty (Richard Hughes) | |
26 | ||
0 | 27 | Version 012 |
1 | 28 | ~~~~~~~~~~~ |
2 | 29 | Released: 2009-10-19 |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.63 for DeviceKit-power 012. | |
2 | # Generated by GNU Autoconf 2.63 for DeviceKit-power 013. | |
3 | 3 | # |
4 | 4 | # Report bugs to <http://lists.freedesktop.org/mailman/listinfo/devkit-devel>. |
5 | 5 | # |
744 | 744 | # Identity of this package. |
745 | 745 | PACKAGE_NAME='DeviceKit-power' |
746 | 746 | PACKAGE_TARNAME='devicekit-power' |
747 | PACKAGE_VERSION='012' | |
748 | PACKAGE_STRING='DeviceKit-power 012' | |
747 | PACKAGE_VERSION='013' | |
748 | PACKAGE_STRING='DeviceKit-power 013' | |
749 | 749 | PACKAGE_BUGREPORT='http://lists.freedesktop.org/mailman/listinfo/devkit-devel' |
750 | 750 | |
751 | 751 | # Factoring default headers for most tests. |
1569 | 1569 | # Omit some internal or obsolete options to make the list less imposing. |
1570 | 1570 | # This message is too long to be a string in the A/UX 3.1 sh. |
1571 | 1571 | cat <<_ACEOF |
1572 | \`configure' configures DeviceKit-power 012 to adapt to many kinds of systems. | |
1572 | \`configure' configures DeviceKit-power 013 to adapt to many kinds of systems. | |
1573 | 1573 | |
1574 | 1574 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1575 | 1575 | |
1639 | 1639 | |
1640 | 1640 | if test -n "$ac_init_help"; then |
1641 | 1641 | case $ac_init_help in |
1642 | short | recursive ) echo "Configuration of DeviceKit-power 012:";; | |
1642 | short | recursive ) echo "Configuration of DeviceKit-power 013:";; | |
1643 | 1643 | esac |
1644 | 1644 | cat <<\_ACEOF |
1645 | 1645 | |
1769 | 1769 | test -n "$ac_init_help" && exit $ac_status |
1770 | 1770 | if $ac_init_version; then |
1771 | 1771 | cat <<\_ACEOF |
1772 | DeviceKit-power configure 012 | |
1772 | DeviceKit-power configure 013 | |
1773 | 1773 | generated by GNU Autoconf 2.63 |
1774 | 1774 | |
1775 | 1775 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
1783 | 1783 | This file contains any messages produced by compilers while |
1784 | 1784 | running configure, to aid debugging if configure makes a mistake. |
1785 | 1785 | |
1786 | It was created by DeviceKit-power $as_me 012, which was | |
1786 | It was created by DeviceKit-power $as_me 013, which was | |
1787 | 1787 | generated by GNU Autoconf 2.63. Invocation command line was |
1788 | 1788 | |
1789 | 1789 | $ $0 $@ |
2632 | 2632 | |
2633 | 2633 | # Define the identity of the package. |
2634 | 2634 | PACKAGE=DeviceKit-power |
2635 | VERSION=012 | |
2635 | VERSION=013 | |
2636 | 2636 | |
2637 | 2637 | |
2638 | 2638 | cat >>confdefs.h <<_ACEOF |
17627 | 17627 | # report actual input values of CONFIG_FILES etc. instead of their |
17628 | 17628 | # values after options handling. |
17629 | 17629 | ac_log=" |
17630 | This file was extended by DeviceKit-power $as_me 012, which was | |
17630 | This file was extended by DeviceKit-power $as_me 013, which was | |
17631 | 17631 | generated by GNU Autoconf 2.63. Invocation command line was |
17632 | 17632 | |
17633 | 17633 | CONFIG_FILES = $CONFIG_FILES |
17690 | 17690 | _ACEOF |
17691 | 17691 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
17692 | 17692 | ac_cs_version="\\ |
17693 | DeviceKit-power config.status 012 | |
17693 | DeviceKit-power config.status 013 | |
17694 | 17694 | configured by $0, generated by GNU Autoconf 2.63, |
17695 | 17695 | with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" |
17696 | 17696 |
0 | 0 | dnl Process this file with autoconf to produce a configure script. |
1 | 1 | |
2 | 2 | AC_PREREQ(2.59c) |
3 | AC_INIT(DeviceKit-power, 012, http://lists.freedesktop.org/mailman/listinfo/devkit-devel) | |
4 | AM_INIT_AUTOMAKE(DeviceKit-power, 012) | |
3 | AC_INIT(DeviceKit-power, 013, http://lists.freedesktop.org/mailman/listinfo/devkit-devel) | |
4 | AM_INIT_AUTOMAKE(DeviceKit-power, 013) | |
5 | 5 | AM_CONFIG_HEADER(config.h) |
6 | 6 | AM_MAINTAINER_MODE |
7 | 7 |
27 | 27 | |
28 | 28 | /* compile time version |
29 | 29 | */ |
30 | #define DKP_COMPILE_VERSION (0x012) | |
30 | #define DKP_COMPILE_VERSION (0x013) | |
31 | 31 | |
32 | 32 | /* check whether a the version is above the compile time version. |
33 | 33 | */ |
56 | 56 | </pre> |
57 | 57 | </div> |
58 | 58 | <div class="refsect1" title="Signals"> |
59 | <a name="id2923551"></a><h2>Signals</h2> | |
59 | <a name="id2853086"></a><h2>Signals</h2> | |
60 | 60 | <pre class="synopsis"><a class="link" href="Device.html#Device::Changed">Changed</a> () |
61 | 61 | </pre> |
62 | 62 | </div> |
63 | 63 | <div class="refsect1" title="Implemented Interfaces"> |
64 | <a name="id2935406"></a><h2>Implemented Interfaces</h2> | |
64 | <a name="id2825516"></a><h2>Implemented Interfaces</h2> | |
65 | 65 | <p> |
66 | 66 | Objects implementing org.freedesktop.DeviceKit.Power.Device also implements |
67 | 67 | org.freedesktop.DBus.Introspectable, |
69 | 69 | </p> |
70 | 70 | </div> |
71 | 71 | <div class="refsect1" title="Properties"> |
72 | <a name="id2934950"></a><h2>Properties</h2> | |
72 | <a name="id2852823"></a><h2>Properties</h2> | |
73 | 73 | <pre class="synopsis"><a class="link" href="Device.html#Device:NativePath">'NativePath'</a> read 's' |
74 | 74 | <a class="link" href="Device.html#Device:Vendor">'Vendor'</a> read 's' |
75 | 75 | <a class="link" href="Device.html#Device:Model">'Model'</a> read 's' |
100 | 100 | </pre> |
101 | 101 | </div> |
102 | 102 | <div class="refsect1" title="Description"> |
103 | <a name="id2863647"></a><h2>Description</h2> | |
103 | <a name="id2769235"></a><h2>Description</h2> | |
104 | 104 | <p> |
105 | 105 | |
106 | 106 | </p> |
239 | 239 | </p> |
240 | 240 | </div> |
241 | 241 | <div class="refsect1" title="Details"> |
242 | <a name="id2863764"></a><h2>Details</h2> | |
242 | <a name="id2769349"></a><h2>Details</h2> | |
243 | 243 | <div class="refsect2" title="Refresh ()"> |
244 | <a name="id2863772"></a><h3> | |
244 | <a name="id2769357"></a><h3> | |
245 | 245 | <a name="Device.Refresh"></a>Refresh ()</h3> |
246 | 246 | <pre class="programlisting">Refresh ()</pre> |
247 | 247 | </div> |
253 | 253 | <tbody></tbody> |
254 | 254 | </table></div> |
255 | 255 | <div class="refsect3" title="Errors"> |
256 | <a name="id2939450"></a><h4>Errors</h4> | |
256 | <a name="id2845028"></a><h4>Errors</h4> | |
257 | 257 | <div class="variablelist"><table border="0"> |
258 | 258 | <col align="left" valign="top"> |
259 | 259 | <tbody><tr> |
263 | 263 | </table></div> |
264 | 264 | </div> |
265 | 265 | <div class="refsect3" title="Permissions"> |
266 | <a name="id2939468"></a><h4>Permissions</h4> | |
266 | <a name="id2845047"></a><h4>Permissions</h4> | |
267 | 267 | <p class="permission">Callers need the org.freedesktop.devicekit.power.refresh-power-source authorization</p> |
268 | 268 | </div> |
269 | 269 | <hr> |
270 | 270 | <div class="refsect2" title="GetHistory ()"> |
271 | <a name="id2939478"></a><h3> | |
271 | <a name="id2845057"></a><h3> | |
272 | 272 | <a name="Device.GetHistory"></a>GetHistory ()</h3> |
273 | 273 | <pre class="programlisting">GetHistory (in 's' type, |
274 | 274 | in 'u' timespan, |
324 | 324 | </table></div> |
325 | 325 | <hr> |
326 | 326 | <div class="refsect2" title="GetStatistics ()"> |
327 | <a name="id2939624"></a><h3> | |
327 | <a name="id2845203"></a><h3> | |
328 | 328 | <a name="Device.GetStatistics"></a>GetStatistics ()</h3> |
329 | 329 | <pre class="programlisting">GetStatistics (in 's' type, |
330 | 330 | out 'a(dd)' data)</pre> |
362 | 362 | </table></div> |
363 | 363 | </div> |
364 | 364 | <div class="refsect1" title="Signal Details"> |
365 | <a name="id2928909"></a><h2>Signal Details</h2> | |
365 | <a name="id2853884"></a><h2>Signal Details</h2> | |
366 | 366 | <div class="refsect2" title="The Changed signal"> |
367 | <a name="id2928917"></a><h3> | |
367 | <a name="id2853893"></a><h3> | |
368 | 368 | <a name="Device::Changed"></a>The Changed signal</h3> |
369 | 369 | <pre class="programlisting">Changed ()</pre> |
370 | 370 | </div> |
377 | 377 | </table></div> |
378 | 378 | </div> |
379 | 379 | <div class="refsect1" title="Property Details"> |
380 | <a name="id2928950"></a><h2>Property Details</h2> | |
380 | <a name="id2853926"></a><h2>Property Details</h2> | |
381 | 381 | <div class="refsect2" title='The "NativePath" property'> |
382 | <a name="id2928958"></a><h3> | |
382 | <a name="id2853934"></a><h3> | |
383 | 383 | <a name="Device:NativePath"></a>The "NativePath" property</h3> |
384 | 384 | <pre class="programlisting">'NativePath' read 's' |
385 | 385 | </pre> |
397 | 397 | </table></div> |
398 | 398 | <hr> |
399 | 399 | <div class="refsect2" title='The "Vendor" property'> |
400 | <a name="id2929000"></a><h3> | |
400 | <a name="id2853976"></a><h3> | |
401 | 401 | <a name="Device:Vendor"></a>The "Vendor" property</h3> |
402 | 402 | <pre class="programlisting">'Vendor' read 's' |
403 | 403 | </pre> |
411 | 411 | </table></div> |
412 | 412 | <hr> |
413 | 413 | <div class="refsect2" title='The "Model" property'> |
414 | <a name="id2929031"></a><h3> | |
414 | <a name="id2854007"></a><h3> | |
415 | 415 | <a name="Device:Model"></a>The "Model" property</h3> |
416 | 416 | <pre class="programlisting">'Model' read 's' |
417 | 417 | </pre> |
425 | 425 | </table></div> |
426 | 426 | <hr> |
427 | 427 | <div class="refsect2" title='The "Serial" property'> |
428 | <a name="id2929062"></a><h3> | |
428 | <a name="id2854038"></a><h3> | |
429 | 429 | <a name="Device:Serial"></a>The "Serial" property</h3> |
430 | 430 | <pre class="programlisting">'Serial' read 's' |
431 | 431 | </pre> |
439 | 439 | </table></div> |
440 | 440 | <hr> |
441 | 441 | <div class="refsect2" title='The "UpdateTime" property'> |
442 | <a name="id2929093"></a><h3> | |
442 | <a name="id2854069"></a><h3> | |
443 | 443 | <a name="Device:UpdateTime"></a>The "UpdateTime" property</h3> |
444 | 444 | <pre class="programlisting">'UpdateTime' read 't' |
445 | 445 | </pre> |
454 | 454 | </table></div> |
455 | 455 | <hr> |
456 | 456 | <div class="refsect2" title='The "Type" property'> |
457 | <a name="id2929127"></a><h3> | |
457 | <a name="id2854103"></a><h3> | |
458 | 458 | <a name="Device:Type"></a>The "Type" property</h3> |
459 | 459 | <pre class="programlisting">'Type' read 'u' |
460 | 460 | </pre> |
488 | 488 | </table></div> |
489 | 489 | <hr> |
490 | 490 | <div class="refsect2" title='The "PowerSupply" property'> |
491 | <a name="id2929225"></a><h3> | |
491 | <a name="id2854201"></a><h3> | |
492 | 492 | <a name="Device:PowerSupply"></a>The "PowerSupply" property</h3> |
493 | 493 | <pre class="programlisting">'PowerSupply' read 'b' |
494 | 494 | </pre> |
504 | 504 | </table></div> |
505 | 505 | <hr> |
506 | 506 | <div class="refsect2" title='The "HasHistory" property'> |
507 | <a name="id2929259"></a><h3> | |
507 | <a name="id2854235"></a><h3> | |
508 | 508 | <a name="Device:HasHistory"></a>The "HasHistory" property</h3> |
509 | 509 | <pre class="programlisting">'HasHistory' read 'b' |
510 | 510 | </pre> |
518 | 518 | </table></div> |
519 | 519 | <hr> |
520 | 520 | <div class="refsect2" title='The "HasStatistics" property'> |
521 | <a name="id2929291"></a><h3> | |
521 | <a name="id2854267"></a><h3> | |
522 | 522 | <a name="Device:HasStatistics"></a>The "HasStatistics" property</h3> |
523 | 523 | <pre class="programlisting">'HasStatistics' read 'b' |
524 | 524 | </pre> |
532 | 532 | </table></div> |
533 | 533 | <hr> |
534 | 534 | <div class="refsect2" title='The "Online" property'> |
535 | <a name="id2929323"></a><h3> | |
535 | <a name="id2854299"></a><h3> | |
536 | 536 | <a name="Device:Online"></a>The "Online" property</h3> |
537 | 537 | <pre class="programlisting">'Online' read 'b' |
538 | 538 | </pre> |
549 | 549 | </table></div> |
550 | 550 | <hr> |
551 | 551 | <div class="refsect2" title='The "Energy" property'> |
552 | <a name="id2929366"></a><h3> | |
552 | <a name="id2854342"></a><h3> | |
553 | 553 | <a name="Device:Energy"></a>The "Energy" property</h3> |
554 | 554 | <pre class="programlisting">'Energy' read 'd' |
555 | 555 | </pre> |
569 | 569 | </table></div> |
570 | 570 | <hr> |
571 | 571 | <div class="refsect2" title='The "EnergyEmpty" property'> |
572 | <a name="id2929411"></a><h3> | |
572 | <a name="id2854387"></a><h3> | |
573 | 573 | <a name="Device:EnergyEmpty"></a>The "EnergyEmpty" property</h3> |
574 | 574 | <pre class="programlisting">'EnergyEmpty' read 'd' |
575 | 575 | </pre> |
589 | 589 | </table></div> |
590 | 590 | <hr> |
591 | 591 | <div class="refsect2" title='The "EnergyFull" property'> |
592 | <a name="id2929458"></a><h3> | |
592 | <a name="id2854434"></a><h3> | |
593 | 593 | <a name="Device:EnergyFull"></a>The "EnergyFull" property</h3> |
594 | 594 | <pre class="programlisting">'EnergyFull' read 'd' |
595 | 595 | </pre> |
609 | 609 | </table></div> |
610 | 610 | <hr> |
611 | 611 | <div class="refsect2" title='The "EnergyFullDesign" property'> |
612 | <a name="id2929504"></a><h3> | |
612 | <a name="id2854480"></a><h3> | |
613 | 613 | <a name="Device:EnergyFullDesign"></a>The "EnergyFullDesign" property</h3> |
614 | 614 | <pre class="programlisting">'EnergyFullDesign' read 'd' |
615 | 615 | </pre> |
629 | 629 | </table></div> |
630 | 630 | <hr> |
631 | 631 | <div class="refsect2" title='The "EnergyRate" property'> |
632 | <a name="id2929551"></a><h3> | |
632 | <a name="id2854527"></a><h3> | |
633 | 633 | <a name="Device:EnergyRate"></a>The "EnergyRate" property</h3> |
634 | 634 | <pre class="programlisting">'EnergyRate' read 'd' |
635 | 635 | </pre> |
650 | 650 | </table></div> |
651 | 651 | <hr> |
652 | 652 | <div class="refsect2" title='The "Voltage" property'> |
653 | <a name="id2929598"></a><h3> | |
653 | <a name="id2854574"></a><h3> | |
654 | 654 | <a name="Device:Voltage"></a>The "Voltage" property</h3> |
655 | 655 | <pre class="programlisting">'Voltage' read 'd' |
656 | 656 | </pre> |
664 | 664 | </table></div> |
665 | 665 | <hr> |
666 | 666 | <div class="refsect2" title='The "TimeToEmpty" property'> |
667 | <a name="id2929630"></a><h3> | |
667 | <a name="id2854606"></a><h3> | |
668 | 668 | <a name="Device:TimeToEmpty"></a>The "TimeToEmpty" property</h3> |
669 | 669 | <pre class="programlisting">'TimeToEmpty' read 'x' |
670 | 670 | </pre> |
684 | 684 | </table></div> |
685 | 685 | <hr> |
686 | 686 | <div class="refsect2" title='The "TimeToFull" property'> |
687 | <a name="id2929676"></a><h3> | |
687 | <a name="id2854652"></a><h3> | |
688 | 688 | <a name="Device:TimeToFull"></a>The "TimeToFull" property</h3> |
689 | 689 | <pre class="programlisting">'TimeToFull' read 'x' |
690 | 690 | </pre> |
704 | 704 | </table></div> |
705 | 705 | <hr> |
706 | 706 | <div class="refsect2" title='The "Percentage" property'> |
707 | <a name="id2929722"></a><h3> | |
707 | <a name="id2854698"></a><h3> | |
708 | 708 | <a name="Device:Percentage"></a>The "Percentage" property</h3> |
709 | 709 | <pre class="programlisting">'Percentage' read 'd' |
710 | 710 | </pre> |
731 | 731 | </table></div> |
732 | 732 | <hr> |
733 | 733 | <div class="refsect2" title='The "IsPresent" property'> |
734 | <a name="id2929812"></a><h3> | |
734 | <a name="id2854787"></a><h3> | |
735 | 735 | <a name="Device:IsPresent"></a>The "IsPresent" property</h3> |
736 | 736 | <pre class="programlisting">'IsPresent' read 'b' |
737 | 737 | </pre> |
752 | 752 | </table></div> |
753 | 753 | <hr> |
754 | 754 | <div class="refsect2" title='The "State" property'> |
755 | <a name="id2929859"></a><h3> | |
755 | <a name="id2854834"></a><h3> | |
756 | 756 | <a name="Device:State"></a>The "State" property</h3> |
757 | 757 | <pre class="programlisting">'State' read 'u' |
758 | 758 | </pre> |
787 | 787 | </table></div> |
788 | 788 | <hr> |
789 | 789 | <div class="refsect2" title='The "IsRechargeable" property'> |
790 | <a name="id2929958"></a><h3> | |
790 | <a name="id2854934"></a><h3> | |
791 | 791 | <a name="Device:IsRechargeable"></a>The "IsRechargeable" property</h3> |
792 | 792 | <pre class="programlisting">'IsRechargeable' read 'b' |
793 | 793 | </pre> |
806 | 806 | </table></div> |
807 | 807 | <hr> |
808 | 808 | <div class="refsect2" title='The "Capacity" property'> |
809 | <a name="id2930003"></a><h3> | |
809 | <a name="id2854979"></a><h3> | |
810 | 810 | <a name="Device:Capacity"></a>The "Capacity" property</h3> |
811 | 811 | <pre class="programlisting">'Capacity' read 'd' |
812 | 812 | </pre> |
832 | 832 | </table></div> |
833 | 833 | <hr> |
834 | 834 | <div class="refsect2" title='The "Technology" property'> |
835 | <a name="id2930074"></a><h3> | |
835 | <a name="id2855050"></a><h3> | |
836 | 836 | <a name="Device:Technology"></a>The "Technology" property</h3> |
837 | 837 | <pre class="programlisting">'Technology' read 'u' |
838 | 838 | </pre> |
867 | 867 | </table></div> |
868 | 868 | <hr> |
869 | 869 | <div class="refsect2" title='The "RecallNotice" property'> |
870 | <a name="id2930173"></a><h3> | |
870 | <a name="id2855149"></a><h3> | |
871 | 871 | <a name="Device:RecallNotice"></a>The "RecallNotice" property</h3> |
872 | 872 | <pre class="programlisting">'RecallNotice' read 'b' |
873 | 873 | </pre> |
884 | 884 | </table></div> |
885 | 885 | <hr> |
886 | 886 | <div class="refsect2" title='The "RecallVendor" property'> |
887 | <a name="id2930209"></a><h3> | |
887 | <a name="id2855185"></a><h3> | |
888 | 888 | <a name="Device:RecallVendor"></a>The "RecallVendor" property</h3> |
889 | 889 | <pre class="programlisting">'RecallVendor' read 's' |
890 | 890 | </pre> |
901 | 901 | </table></div> |
902 | 902 | <hr> |
903 | 903 | <div class="refsect2" title='The "RecallUrl" property'> |
904 | <a name="id2930246"></a><h3> | |
904 | <a name="id2855222"></a><h3> | |
905 | 905 | <a name="Device:RecallUrl"></a>The "RecallUrl" property</h3> |
906 | 906 | <pre class="programlisting">'RecallUrl' read 's' |
907 | 907 | </pre> |
32 | 32 | <td valign="top" align="right"></td> |
33 | 33 | </tr></table></div> |
34 | 34 | <div class="refsect1" title="DESCRIPTION"> |
35 | <a name="id2919916"></a><h2>DESCRIPTION</h2> | |
35 | <a name="id2848292"></a><h2>DESCRIPTION</h2> | |
36 | 36 | <p> |
37 | 37 | DeviceKit-power provides an interface to enumerate power sources |
38 | 38 | on the system and control system-wide power management. Any |
43 | 43 | </p> |
44 | 44 | </div> |
45 | 45 | <div class="refsect1" title="AUTHOR"> |
46 | <a name="id2943831"></a><h2>AUTHOR</h2> | |
46 | <a name="id2823404"></a><h2>AUTHOR</h2> | |
47 | 47 | <p> |
48 | 48 | Written by David Zeuthen <code class="email"><<a class="email" href="mailto:davidz@redhat.com">davidz@redhat.com</a>></code> with |
49 | 49 | a lot of help from many others. |
50 | 50 | </p> |
51 | 51 | </div> |
52 | 52 | <div class="refsect1" title="BUGS"> |
53 | <a name="id2934622"></a><h2>BUGS</h2> | |
53 | <a name="id2848309"></a><h2>BUGS</h2> | |
54 | 54 | <p> |
55 | 55 | Please send bug reports to either the distribution or the |
56 | 56 | DeviceKit mailing list, |
59 | 59 | </p> |
60 | 60 | </div> |
61 | 61 | <div class="refsect1" title="SEE ALSO"> |
62 | <a name="id2943821"></a><h2>SEE ALSO</h2> | |
62 | <a name="id2843549"></a><h2>SEE ALSO</h2> | |
63 | 63 | <p> |
64 | 64 | <span class="citerefentry"><span class="refentrytitle">DeviceKit</span>(7)</span>, |
65 | 65 | <span class="citerefentry"><span class="refentrytitle">PolicyKit</span>(8)</span>, |
52 | 52 | </pre> |
53 | 53 | </div> |
54 | 54 | <div class="refsect1" title="Signals"> |
55 | <a name="id2939896"></a><h2>Signals</h2> | |
55 | <a name="id2849482"></a><h2>Signals</h2> | |
56 | 56 | <pre class="synopsis"><a class="link" href="Power.html#Power::DeviceAdded">DeviceAdded</a> ('o' device) |
57 | 57 | <a class="link" href="Power.html#Power::DeviceRemoved">DeviceRemoved</a> ('o' device) |
58 | 58 | <a class="link" href="Power.html#Power::DeviceChanged">DeviceChanged</a> ('o' device) |
60 | 60 | </pre> |
61 | 61 | </div> |
62 | 62 | <div class="refsect1" title="Implemented Interfaces"> |
63 | <a name="id2925535"></a><h2>Implemented Interfaces</h2> | |
63 | <a name="id2831112"></a><h2>Implemented Interfaces</h2> | |
64 | 64 | <p> |
65 | 65 | Objects implementing org.freedesktop.DeviceKit.Power also implements |
66 | 66 | org.freedesktop.DBus.Introspectable, |
68 | 68 | </p> |
69 | 69 | </div> |
70 | 70 | <div class="refsect1" title="Properties"> |
71 | <a name="id2862784"></a><h2>Properties</h2> | |
71 | <a name="id2768495"></a><h2>Properties</h2> | |
72 | 72 | <pre class="synopsis"><a class="link" href="Power.html#Power:DaemonVersion">'DaemonVersion'</a> read 's' |
73 | 73 | <a class="link" href="Power.html#Power:CanSuspend">'CanSuspend'</a> read 'b' |
74 | 74 | <a class="link" href="Power.html#Power:CanHibernate">'CanHibernate'</a> read 'b' |
79 | 79 | </pre> |
80 | 80 | </div> |
81 | 81 | <div class="refsect1" title="Description"> |
82 | <a name="id2864618"></a><h2>Description</h2> | |
82 | <a name="id2770204"></a><h2>Description</h2> | |
83 | 83 | <p> |
84 | 84 | |
85 | 85 | </p> |
115 | 115 | </p> |
116 | 116 | </div> |
117 | 117 | <div class="refsect1" title="Details"> |
118 | <a name="id2864680"></a><h2>Details</h2> | |
118 | <a name="id2770268"></a><h2>Details</h2> | |
119 | 119 | <div class="refsect2" title="EnumerateDevices ()"> |
120 | <a name="id2864688"></a><h3> | |
120 | <a name="id2770276"></a><h3> | |
121 | 121 | <a name="Power.EnumerateDevices"></a>EnumerateDevices ()</h3> |
122 | 122 | <pre class="programlisting">EnumerateDevices (out 'ao' devices)</pre> |
123 | 123 | </div> |
133 | 133 | </table></div> |
134 | 134 | <hr> |
135 | 135 | <div class="refsect2" title="Suspend ()"> |
136 | <a name="id2863516"></a><h3> | |
136 | <a name="id2769095"></a><h3> | |
137 | 137 | <a name="Power.Suspend"></a>Suspend ()</h3> |
138 | 138 | <pre class="programlisting">Suspend ()</pre> |
139 | 139 | </div> |
147 | 147 | </table></div> |
148 | 148 | <hr> |
149 | 149 | <div class="refsect2" title="Hibernate ()"> |
150 | <a name="id2863549"></a><h3> | |
150 | <a name="id2769128"></a><h3> | |
151 | 151 | <a name="Power.Hibernate"></a>Hibernate ()</h3> |
152 | 152 | <pre class="programlisting">Hibernate ()</pre> |
153 | 153 | </div> |
161 | 161 | </table></div> |
162 | 162 | </div> |
163 | 163 | <div class="refsect1" title="Signal Details"> |
164 | <a name="id2863584"></a><h2>Signal Details</h2> | |
164 | <a name="id2769163"></a><h2>Signal Details</h2> | |
165 | 165 | <div class="refsect2" title="The DeviceAdded signal"> |
166 | <a name="id2863592"></a><h3> | |
166 | <a name="id2769171"></a><h3> | |
167 | 167 | <a name="Power::DeviceAdded"></a>The DeviceAdded signal</h3> |
168 | 168 | <pre class="programlisting">DeviceAdded ('o' device)</pre> |
169 | 169 | </div> |
179 | 179 | </table></div> |
180 | 180 | <hr> |
181 | 181 | <div class="refsect2" title="The DeviceRemoved signal"> |
182 | <a name="id2863634"></a><h3> | |
182 | <a name="id2769214"></a><h3> | |
183 | 183 | <a name="Power::DeviceRemoved"></a>The DeviceRemoved signal</h3> |
184 | 184 | <pre class="programlisting">DeviceRemoved ('o' device)</pre> |
185 | 185 | </div> |
195 | 195 | </table></div> |
196 | 196 | <hr> |
197 | 197 | <div class="refsect2" title="The DeviceChanged signal"> |
198 | <a name="id2864314"></a><h3> | |
198 | <a name="id2769892"></a><h3> | |
199 | 199 | <a name="Power::DeviceChanged"></a>The DeviceChanged signal</h3> |
200 | 200 | <pre class="programlisting">DeviceChanged ('o' device)</pre> |
201 | 201 | </div> |
211 | 211 | </table></div> |
212 | 212 | <hr> |
213 | 213 | <div class="refsect2" title="The Changed signal"> |
214 | <a name="id2864356"></a><h3> | |
214 | <a name="id2769934"></a><h3> | |
215 | 215 | <a name="Power::Changed"></a>The Changed signal</h3> |
216 | 216 | <pre class="programlisting">Changed ()</pre> |
217 | 217 | </div> |
224 | 224 | </table></div> |
225 | 225 | </div> |
226 | 226 | <div class="refsect1" title="Property Details"> |
227 | <a name="id2864389"></a><h2>Property Details</h2> | |
227 | <a name="id2769967"></a><h2>Property Details</h2> | |
228 | 228 | <div class="refsect2" title='The "DaemonVersion" property'> |
229 | <a name="id2864397"></a><h3> | |
229 | <a name="id2769975"></a><h3> | |
230 | 230 | <a name="Power:DaemonVersion"></a>The "DaemonVersion" property</h3> |
231 | 231 | <pre class="programlisting">'DaemonVersion' read 's' |
232 | 232 | </pre> |
240 | 240 | </table></div> |
241 | 241 | <hr> |
242 | 242 | <div class="refsect2" title='The "CanSuspend" property'> |
243 | <a name="id2868893"></a><h3> | |
243 | <a name="id2770010"></a><h3> | |
244 | 244 | <a name="Power:CanSuspend"></a>The "CanSuspend" property</h3> |
245 | 245 | <pre class="programlisting">'CanSuspend' read 'b' |
246 | 246 | </pre> |
254 | 254 | </table></div> |
255 | 255 | <hr> |
256 | 256 | <div class="refsect2" title='The "CanHibernate" property'> |
257 | <a name="id2868922"></a><h3> | |
257 | <a name="id2774498"></a><h3> | |
258 | 258 | <a name="Power:CanHibernate"></a>The "CanHibernate" property</h3> |
259 | 259 | <pre class="programlisting">'CanHibernate' read 'b' |
260 | 260 | </pre> |
268 | 268 | </table></div> |
269 | 269 | <hr> |
270 | 270 | <div class="refsect2" title='The "OnBattery" property'> |
271 | <a name="id2868952"></a><h3> | |
271 | <a name="id2774528"></a><h3> | |
272 | 272 | <a name="Power:OnBattery"></a>The "OnBattery" property</h3> |
273 | 273 | <pre class="programlisting">'OnBattery' read 'b' |
274 | 274 | </pre> |
283 | 283 | </table></div> |
284 | 284 | <hr> |
285 | 285 | <div class="refsect2" title='The "OnLowBattery" property'> |
286 | <a name="id2868982"></a><h3> | |
286 | <a name="id2774558"></a><h3> | |
287 | 287 | <a name="Power:OnLowBattery"></a>The "OnLowBattery" property</h3> |
288 | 288 | <pre class="programlisting">'OnLowBattery' read 'b' |
289 | 289 | </pre> |
298 | 298 | </table></div> |
299 | 299 | <hr> |
300 | 300 | <div class="refsect2" title='The "LidIsClosed" property'> |
301 | <a name="id2869013"></a><h3> | |
301 | <a name="id2774589"></a><h3> | |
302 | 302 | <a name="Power:LidIsClosed"></a>The "LidIsClosed" property</h3> |
303 | 303 | <pre class="programlisting">'LidIsClosed' read 'b' |
304 | 304 | </pre> |
312 | 312 | </table></div> |
313 | 313 | <hr> |
314 | 314 | <div class="refsect2" title='The "LidIsPresent" property'> |
315 | <a name="id2869045"></a><h3> | |
315 | <a name="id2774622"></a><h3> | |
316 | 316 | <a name="Power:LidIsPresent"></a>The "LidIsPresent" property</h3> |
317 | 317 | <pre class="programlisting">'LidIsPresent' read 'b' |
318 | 318 | </pre> |
58 | 58 | </pre> |
59 | 59 | </div> |
60 | 60 | <div class="refsect1" title="Signals"> |
61 | <a name="id2889113"></a><h2>Signals</h2> | |
61 | <a name="id2844816"></a><h2>Signals</h2> | |
62 | 62 | <pre class="synopsis"><a class="link" href="QoS.html#QoS::LatencyChanged">LatencyChanged</a> ('s' type, |
63 | 63 | 'i' value) |
64 | 64 | <a class="link" href="QoS.html#QoS::RequestsChanged">RequestsChanged</a> () |
65 | 65 | </pre> |
66 | 66 | </div> |
67 | 67 | <div class="refsect1" title="Implemented Interfaces"> |
68 | <a name="id2926826"></a><h2>Implemented Interfaces</h2> | |
68 | <a name="id2857025"></a><h2>Implemented Interfaces</h2> | |
69 | 69 | <p> |
70 | 70 | Objects implementing org.freedesktop.DeviceKit.Power.QoS also implements |
71 | 71 | org.freedesktop.DBus.Introspectable, |
73 | 73 | </p> |
74 | 74 | </div> |
75 | 75 | <div class="refsect1" title="Description"> |
76 | <a name="id2936335"></a><h2>Description</h2> | |
76 | <a name="id2834519"></a><h2>Description</h2> | |
77 | 77 | <p> |
78 | 78 | |
79 | 79 | </p> |
160 | 160 | </p> |
161 | 161 | </div> |
162 | 162 | <div class="refsect1" title="Details"> |
163 | <a name="id2952378"></a><h2>Details</h2> | |
163 | <a name="id2825222"></a><h2>Details</h2> | |
164 | 164 | <div class="refsect2" title="SetMinimumLatency ()"> |
165 | <a name="id2952386"></a><h3> | |
165 | <a name="id2825230"></a><h3> | |
166 | 166 | <a name="QoS.SetMinimumLatency"></a>SetMinimumLatency ()</h3> |
167 | 167 | <pre class="programlisting">SetMinimumLatency (in 's' type, |
168 | 168 | in 'i' value)</pre> |
196 | 196 | </tbody> |
197 | 197 | </table></div> |
198 | 198 | <div class="refsect3" title="Errors"> |
199 | <a name="id2925026"></a><h4>Errors</h4> | |
199 | <a name="id2839689"></a><h4>Errors</h4> | |
200 | 200 | <div class="variablelist"><table border="0"> |
201 | 201 | <col align="left" valign="top"> |
202 | 202 | <tbody><tr> |
206 | 206 | </table></div> |
207 | 207 | </div> |
208 | 208 | <div class="refsect3" title="Permissions"> |
209 | <a name="id2925046"></a><h4>Permissions</h4> | |
209 | <a name="id2839708"></a><h4>Permissions</h4> | |
210 | 210 | <p class="permission">Callers need the <code class="literal">org.freedesktop.devicekit.power.qos.set-minimum-latency</code> authorization</p> |
211 | 211 | </div> |
212 | 212 | <hr> |
213 | 213 | <div class="refsect2" title="RequestLatency ()"> |
214 | <a name="id2925061"></a><h3> | |
214 | <a name="id2839724"></a><h3> | |
215 | 215 | <a name="QoS.RequestLatency"></a>RequestLatency ()</h3> |
216 | 216 | <pre class="programlisting">RequestLatency (in 's' type, |
217 | 217 | in 'i' value, |
259 | 259 | </tbody> |
260 | 260 | </table></div> |
261 | 261 | <div class="refsect3" title="Errors"> |
262 | <a name="id2922914"></a><h4>Errors</h4> | |
262 | <a name="id2821004"></a><h4>Errors</h4> | |
263 | 263 | <div class="variablelist"><table border="0"> |
264 | 264 | <col align="left" valign="top"> |
265 | 265 | <tbody><tr> |
269 | 269 | </table></div> |
270 | 270 | </div> |
271 | 271 | <div class="refsect3" title="Permissions"> |
272 | <a name="id2922933"></a><h4>Permissions</h4> | |
272 | <a name="id2821023"></a><h4>Permissions</h4> | |
273 | 273 | <p class="permission"> |
274 | 274 | Callers need the |
275 | 275 | <code class="literal">org.freedesktop.devicekit.power.qos.request-latency-persistent</code> |
279 | 279 | </div> |
280 | 280 | <hr> |
281 | 281 | <div class="refsect2" title="CancelRequest ()"> |
282 | <a name="id2922961"></a><h3> | |
282 | <a name="id2821050"></a><h3> | |
283 | 283 | <a name="QoS.CancelRequest"></a>CancelRequest ()</h3> |
284 | 284 | <pre class="programlisting">CancelRequest (in 's' type, |
285 | 285 | in 'u' cookie)</pre> |
307 | 307 | </tbody> |
308 | 308 | </table></div> |
309 | 309 | <div class="refsect3" title="Errors"> |
310 | <a name="id2923033"></a><h4>Errors</h4> | |
310 | <a name="id2821122"></a><h4>Errors</h4> | |
311 | 311 | <div class="variablelist"><table border="0"> |
312 | 312 | <col align="left" valign="top"> |
313 | 313 | <tbody><tr> |
317 | 317 | </table></div> |
318 | 318 | </div> |
319 | 319 | <div class="refsect3" title="Permissions"> |
320 | <a name="id2923052"></a><h4>Permissions</h4> | |
320 | <a name="id2821142"></a><h4>Permissions</h4> | |
321 | 321 | <p class="permission"> |
322 | 322 | Callers need the |
323 | 323 | <code class="literal">org.freedesktop.devicekit.power.qos.cancel-request</code> |
326 | 326 | </div> |
327 | 327 | <hr> |
328 | 328 | <div class="refsect2" title="GetLatency ()"> |
329 | <a name="id2923068"></a><h3> | |
329 | <a name="id2821157"></a><h3> | |
330 | 330 | <a name="QoS.GetLatency"></a>GetLatency ()</h3> |
331 | 331 | <pre class="programlisting">GetLatency (in 's' type, |
332 | 332 | out 'i' value)</pre> |
354 | 354 | </tbody> |
355 | 355 | </table></div> |
356 | 356 | <div class="refsect3" title="Errors"> |
357 | <a name="id2923145"></a><h4>Errors</h4> | |
357 | <a name="id2821234"></a><h4>Errors</h4> | |
358 | 358 | <div class="variablelist"><table border="0"> |
359 | 359 | <col align="left" valign="top"> |
360 | 360 | <tbody><tr> |
365 | 365 | </div> |
366 | 366 | <hr> |
367 | 367 | <div class="refsect2" title="GetLatencyRequests ()"> |
368 | <a name="id2954417"></a><h3> | |
368 | <a name="id2859593"></a><h3> | |
369 | 369 | <a name="QoS.GetLatencyRequests"></a>GetLatencyRequests ()</h3> |
370 | 370 | <pre class="programlisting">GetLatencyRequests (out 'a(uuusxbssi)' requests)</pre> |
371 | 371 | </div> |
419 | 419 | </table></div> |
420 | 420 | </div> |
421 | 421 | <div class="refsect1" title="Signal Details"> |
422 | <a name="id2954545"></a><h2>Signal Details</h2> | |
422 | <a name="id2859721"></a><h2>Signal Details</h2> | |
423 | 423 | <div class="refsect2" title="The LatencyChanged signal"> |
424 | <a name="id2954553"></a><h3> | |
424 | <a name="id2859729"></a><h3> | |
425 | 425 | <a name="QoS::LatencyChanged"></a>The LatencyChanged signal</h3> |
426 | 426 | <pre class="programlisting">LatencyChanged ('s' type, |
427 | 427 | 'i' value)</pre> |
450 | 450 | </table></div> |
451 | 451 | <hr> |
452 | 452 | <div class="refsect2" title="The RequestsChanged signal"> |
453 | <a name="id2954612"></a><h3> | |
453 | <a name="id2859788"></a><h3> | |
454 | 454 | <a name="QoS::RequestsChanged"></a>The RequestsChanged signal</h3> |
455 | 455 | <pre class="programlisting">RequestsChanged ()</pre> |
456 | 456 | </div> |
36 | 36 | <div class="cmdsynopsis"><p><code class="command">devkit-power-daemon</code> [<code class="option">--help</code>]</p></div> |
37 | 37 | </div> |
38 | 38 | <div class="refsect1" title="DESCRIPTION"> |
39 | <a name="id2862842"></a><h2>DESCRIPTION</h2> | |
39 | <a name="id2827438"></a><h2>DESCRIPTION</h2> | |
40 | 40 | <p> |
41 | 41 | <span class="emphasis"><em><span class="refentrytitle">devkit-power-daemon</span></em></span> provides |
42 | 42 | the <span class="emphasis"><em>org.freedesktop.DeviceKit.Power</em></span> service on the |
48 | 48 | </p> |
49 | 49 | </div> |
50 | 50 | <div class="refsect1" title="OPTIONS"> |
51 | <a name="id2918802"></a><h2>OPTIONS</h2> | |
51 | <a name="id2839175"></a><h2>OPTIONS</h2> | |
52 | 52 | <div class="variablelist"><table border="0"> |
53 | 53 | <col align="left" valign="top"> |
54 | 54 | <tbody><tr> |
60 | 60 | </table></div> |
61 | 61 | </div> |
62 | 62 | <div class="refsect1" title="AUTHOR"> |
63 | <a name="id2936214"></a><h2>AUTHOR</h2> | |
63 | <a name="id2827104"></a><h2>AUTHOR</h2> | |
64 | 64 | <p> |
65 | 65 | Written by David Zeuthen <code class="email"><<a class="email" href="mailto:davidz@redhat.com">davidz@redhat.com</a>></code> with |
66 | 66 | a lot of help from many others. |
67 | 67 | </p> |
68 | 68 | </div> |
69 | 69 | <div class="refsect1" title="BUGS"> |
70 | <a name="id2932822"></a><h2>BUGS</h2> | |
70 | <a name="id2842988"></a><h2>BUGS</h2> | |
71 | 71 | <p> |
72 | 72 | Please send bug reports to either the distribution or the |
73 | 73 | DeviceKit mailing list, |
76 | 76 | </p> |
77 | 77 | </div> |
78 | 78 | <div class="refsect1" title="SEE ALSO"> |
79 | <a name="id2944274"></a><h2>SEE ALSO</h2> | |
79 | <a name="id2824365"></a><h2>SEE ALSO</h2> | |
80 | 80 | <p> |
81 | 81 | <span class="citerefentry"><span class="refentrytitle">DeviceKit-power</span>(7)</span>, |
82 | 82 | <span class="citerefentry"><span class="refentrytitle">devkit-power</span>(1)</span>, |
36 | 36 | <div class="cmdsynopsis"><p><code class="command">devkit-power</code> [<code class="option">--enumerate</code>] [<code class="option">--monitor</code>] [<code class="option">--monitor-detail</code>] [<code class="option">--help</code>]</p></div> |
37 | 37 | </div> |
38 | 38 | <div class="refsect1" title="DESCRIPTION"> |
39 | <a name="id2942485"></a><h2>DESCRIPTION</h2> | |
39 | <a name="id2851374"></a><h2>DESCRIPTION</h2> | |
40 | 40 | <p> |
41 | 41 | <span class="emphasis"><em><span class="refentrytitle">devkit-power</span></em></span> is a |
42 | 42 | simple command line client for the |
45 | 45 | </p> |
46 | 46 | </div> |
47 | 47 | <div class="refsect1" title="OPTIONS"> |
48 | <a name="id2943809"></a><h2>OPTIONS</h2> | |
48 | <a name="id2842965"></a><h2>OPTIONS</h2> | |
49 | 49 | <div class="variablelist"><table border="0"> |
50 | 50 | <col align="left" valign="top"> |
51 | 51 | <tbody> |
73 | 73 | </table></div> |
74 | 74 | </div> |
75 | 75 | <div class="refsect1" title="AUTHOR"> |
76 | <a name="id2937429"></a><h2>AUTHOR</h2> | |
76 | <a name="id2843456"></a><h2>AUTHOR</h2> | |
77 | 77 | <p> |
78 | 78 | Written by David Zeuthen <code class="email"><<a class="email" href="mailto:davidz@redhat.com">davidz@redhat.com</a>></code> with |
79 | 79 | a lot of help from many others. |
80 | 80 | </p> |
81 | 81 | </div> |
82 | 82 | <div class="refsect1" title="BUGS"> |
83 | <a name="id2937883"></a><h2>BUGS</h2> | |
83 | <a name="id2833801"></a><h2>BUGS</h2> | |
84 | 84 | <p> |
85 | 85 | Please send bug reports to either the distribution or the |
86 | 86 | DeviceKit mailing list, |
89 | 89 | </p> |
90 | 90 | </div> |
91 | 91 | <div class="refsect1" title="SEE ALSO"> |
92 | <a name="id2928232"></a><h2>SEE ALSO</h2> | |
92 | <a name="id2825523"></a><h2>SEE ALSO</h2> | |
93 | 93 | <p> |
94 | 94 | <span class="citerefentry"><span class="refentrytitle">devkit-power-daemon</span>(8)</span>, |
95 | 95 | <span class="citerefentry"><span class="refentrytitle">DeviceKit-power</span>(7)</span>, |
25 | 25 | Â Â Â Â <code class="email"><<a class="email" href="mailto:davidz@redhat.com">davidz@redhat.com</a>></code><br> |
26 | 26 | Â Â </p></div></div> |
27 | 27 | </div></div></div> |
28 | <div><p class="releaseinfo">Version 012 | |
28 | <div><p class="releaseinfo">Version 013 | |
29 | 29 | </p></div> |
30 | 30 | <div><p class="copyright">Copyright © 2008 The DeviceKit-power Authors</p></div> |
31 | 31 | <div><div class="legalnotice" title="Legal Notice"> |
32 | <a name="id2903519"></a><p> | |
32 | <a name="id2809093"></a><p> | |
33 | 33 | Permission is granted to copy, distribute and/or modify this |
34 | 34 | document under the terms of the <em class="citetitle">GNU Free |
35 | 35 | Documentation License</em>, Version 1.1 or any later |
24 | 24 | </tr></table> |
25 | 25 | <div class="index" title="Index"> |
26 | 26 | <div class="titlepage"><div><div><h2 class="title"> |
27 | <a name="id2864240"></a>Index</h2></div></div></div> | |
27 | <a name="id2769821"></a>Index</h2></div></div></div> | |
28 | 28 | <div class="index"> |
29 | 29 | <div class="indexdiv"> |
30 | 30 | <h3>C</h3> |
31 | 31 | <dl> |
32 | 32 | <dt>CancelRequest</dt> |
33 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2922961">CancelRequest ()</a> | |
33 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2821050">CancelRequest ()</a> | |
34 | 34 | </dt></dl></dd> |
35 | 35 | <dt>CanHibernate</dt> |
36 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2868922">The "CanHibernate" property</a> | |
36 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2774498">The "CanHibernate" property</a> | |
37 | 37 | </dt></dl></dd> |
38 | 38 | <dt>CanSuspend</dt> |
39 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2868893">The "CanSuspend" property</a> | |
39 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2770010">The "CanSuspend" property</a> | |
40 | 40 | </dt></dl></dd> |
41 | 41 | <dt>Capacity</dt> |
42 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2930003">The "Capacity" property</a> | |
42 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854979">The "Capacity" property</a> | |
43 | 43 | </dt></dl></dd> |
44 | 44 | <dt>Changed</dt> |
45 | 45 | <dd><dl> |
46 | <dt>Device, <a class="indexterm" href="Device.html#id2928917">The Changed signal</a> | |
46 | <dt>Device, <a class="indexterm" href="Device.html#id2853893">The Changed signal</a> | |
47 | 47 | </dt> |
48 | <dt>Power, <a class="indexterm" href="Power.html#id2864356">The Changed signal</a> | |
48 | <dt>Power, <a class="indexterm" href="Power.html#id2769934">The Changed signal</a> | |
49 | 49 | </dt> |
50 | 50 | </dl></dd> |
51 | 51 | </dl> |
54 | 54 | <h3>D</h3> |
55 | 55 | <dl> |
56 | 56 | <dt>DaemonVersion</dt> |
57 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2864397">The "DaemonVersion" property</a> | |
57 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2769975">The "DaemonVersion" property</a> | |
58 | 58 | </dt></dl></dd> |
59 | 59 | <dt>DeviceAdded</dt> |
60 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2863592">The DeviceAdded signal</a> | |
60 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2769171">The DeviceAdded signal</a> | |
61 | 61 | </dt></dl></dd> |
62 | 62 | <dt>DeviceChanged</dt> |
63 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2864314">The DeviceChanged signal</a> | |
63 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2769892">The DeviceChanged signal</a> | |
64 | 64 | </dt></dl></dd> |
65 | 65 | <dt>DeviceRemoved</dt> |
66 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2863634">The DeviceRemoved signal</a> | |
66 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2769214">The DeviceRemoved signal</a> | |
67 | 67 | </dt></dl></dd> |
68 | 68 | </dl> |
69 | 69 | </div> |
71 | 71 | <h3>E</h3> |
72 | 72 | <dl> |
73 | 73 | <dt>Energy</dt> |
74 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929366">The "Energy" property</a> | |
74 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854342">The "Energy" property</a> | |
75 | 75 | </dt></dl></dd> |
76 | 76 | <dt>EnergyEmpty</dt> |
77 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929411">The "EnergyEmpty" property</a> | |
77 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854387">The "EnergyEmpty" property</a> | |
78 | 78 | </dt></dl></dd> |
79 | 79 | <dt>EnergyFull</dt> |
80 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929458">The "EnergyFull" property</a> | |
80 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854434">The "EnergyFull" property</a> | |
81 | 81 | </dt></dl></dd> |
82 | 82 | <dt>EnergyFullDesign</dt> |
83 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929504">The "EnergyFullDesign" property</a> | |
83 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854480">The "EnergyFullDesign" property</a> | |
84 | 84 | </dt></dl></dd> |
85 | 85 | <dt>EnergyRate</dt> |
86 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929551">The "EnergyRate" property</a> | |
86 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854527">The "EnergyRate" property</a> | |
87 | 87 | </dt></dl></dd> |
88 | 88 | <dt>EnumerateDevices</dt> |
89 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2864688">EnumerateDevices ()</a> | |
89 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2770276">EnumerateDevices ()</a> | |
90 | 90 | </dt></dl></dd> |
91 | 91 | </dl> |
92 | 92 | </div> |
94 | 94 | <h3>G</h3> |
95 | 95 | <dl> |
96 | 96 | <dt>GetHistory</dt> |
97 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2939478">GetHistory ()</a> | |
97 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2845057">GetHistory ()</a> | |
98 | 98 | </dt></dl></dd> |
99 | 99 | <dt>GetLatency</dt> |
100 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2923068">GetLatency ()</a> | |
100 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2821157">GetLatency ()</a> | |
101 | 101 | </dt></dl></dd> |
102 | 102 | <dt>GetLatencyRequests</dt> |
103 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2954417">GetLatencyRequests ()</a> | |
103 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2859593">GetLatencyRequests ()</a> | |
104 | 104 | </dt></dl></dd> |
105 | 105 | <dt>GetStatistics</dt> |
106 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2939624">GetStatistics ()</a> | |
106 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2845203">GetStatistics ()</a> | |
107 | 107 | </dt></dl></dd> |
108 | 108 | </dl> |
109 | 109 | </div> |
111 | 111 | <h3>H</h3> |
112 | 112 | <dl> |
113 | 113 | <dt>HasHistory</dt> |
114 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929259">The "HasHistory" property</a> | |
114 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854235">The "HasHistory" property</a> | |
115 | 115 | </dt></dl></dd> |
116 | 116 | <dt>HasStatistics</dt> |
117 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929291">The "HasStatistics" property</a> | |
117 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854267">The "HasStatistics" property</a> | |
118 | 118 | </dt></dl></dd> |
119 | 119 | <dt>Hibernate</dt> |
120 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2863549">Hibernate ()</a> | |
120 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2769128">Hibernate ()</a> | |
121 | 121 | </dt></dl></dd> |
122 | 122 | </dl> |
123 | 123 | </div> |
125 | 125 | <h3>I</h3> |
126 | 126 | <dl> |
127 | 127 | <dt>IsPresent</dt> |
128 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929812">The "IsPresent" property</a> | |
128 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854787">The "IsPresent" property</a> | |
129 | 129 | </dt></dl></dd> |
130 | 130 | <dt>IsRechargeable</dt> |
131 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929958">The "IsRechargeable" property</a> | |
131 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854934">The "IsRechargeable" property</a> | |
132 | 132 | </dt></dl></dd> |
133 | 133 | </dl> |
134 | 134 | </div> |
136 | 136 | <h3>L</h3> |
137 | 137 | <dl> |
138 | 138 | <dt>LatencyChanged</dt> |
139 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2954553">The LatencyChanged signal</a> | |
139 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2859729">The LatencyChanged signal</a> | |
140 | 140 | </dt></dl></dd> |
141 | 141 | <dt>LidIsClosed</dt> |
142 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2869013">The "LidIsClosed" property</a> | |
142 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2774589">The "LidIsClosed" property</a> | |
143 | 143 | </dt></dl></dd> |
144 | 144 | <dt>LidIsPresent</dt> |
145 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2869045">The "LidIsPresent" property</a> | |
145 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2774622">The "LidIsPresent" property</a> | |
146 | 146 | </dt></dl></dd> |
147 | 147 | </dl> |
148 | 148 | </div> |
150 | 150 | <h3>M</h3> |
151 | 151 | <dl> |
152 | 152 | <dt>Model</dt> |
153 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929031">The "Model" property</a> | |
153 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854007">The "Model" property</a> | |
154 | 154 | </dt></dl></dd> |
155 | 155 | </dl> |
156 | 156 | </div> |
158 | 158 | <h3>N</h3> |
159 | 159 | <dl> |
160 | 160 | <dt>NativePath</dt> |
161 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2928958">The "NativePath" property</a> | |
161 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2853934">The "NativePath" property</a> | |
162 | 162 | </dt></dl></dd> |
163 | 163 | </dl> |
164 | 164 | </div> |
166 | 166 | <h3>O</h3> |
167 | 167 | <dl> |
168 | 168 | <dt>OnBattery</dt> |
169 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2868952">The "OnBattery" property</a> | |
169 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2774528">The "OnBattery" property</a> | |
170 | 170 | </dt></dl></dd> |
171 | 171 | <dt>Online</dt> |
172 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929323">The "Online" property</a> | |
172 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854299">The "Online" property</a> | |
173 | 173 | </dt></dl></dd> |
174 | 174 | <dt>OnLowBattery</dt> |
175 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2868982">The "OnLowBattery" property</a> | |
175 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2774558">The "OnLowBattery" property</a> | |
176 | 176 | </dt></dl></dd> |
177 | 177 | </dl> |
178 | 178 | </div> |
180 | 180 | <h3>P</h3> |
181 | 181 | <dl> |
182 | 182 | <dt>Percentage</dt> |
183 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929722">The "Percentage" property</a> | |
183 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854698">The "Percentage" property</a> | |
184 | 184 | </dt></dl></dd> |
185 | 185 | <dt>PowerSupply</dt> |
186 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929225">The "PowerSupply" property</a> | |
186 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854201">The "PowerSupply" property</a> | |
187 | 187 | </dt></dl></dd> |
188 | 188 | </dl> |
189 | 189 | </div> |
191 | 191 | <h3>R</h3> |
192 | 192 | <dl> |
193 | 193 | <dt>RecallNotice</dt> |
194 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2930173">The "RecallNotice" property</a> | |
194 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2855149">The "RecallNotice" property</a> | |
195 | 195 | </dt></dl></dd> |
196 | 196 | <dt>RecallUrl</dt> |
197 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2930246">The "RecallUrl" property</a> | |
197 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2855222">The "RecallUrl" property</a> | |
198 | 198 | </dt></dl></dd> |
199 | 199 | <dt>RecallVendor</dt> |
200 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2930209">The "RecallVendor" property</a> | |
200 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2855185">The "RecallVendor" property</a> | |
201 | 201 | </dt></dl></dd> |
202 | 202 | <dt>Refresh</dt> |
203 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2863772">Refresh ()</a> | |
203 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2769357">Refresh ()</a> | |
204 | 204 | </dt></dl></dd> |
205 | 205 | <dt>RequestLatency</dt> |
206 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2925061">RequestLatency ()</a> | |
206 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2839724">RequestLatency ()</a> | |
207 | 207 | </dt></dl></dd> |
208 | 208 | <dt>RequestsChanged</dt> |
209 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2954612">The RequestsChanged signal</a> | |
209 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2859788">The RequestsChanged signal</a> | |
210 | 210 | </dt></dl></dd> |
211 | 211 | </dl> |
212 | 212 | </div> |
214 | 214 | <h3>S</h3> |
215 | 215 | <dl> |
216 | 216 | <dt>Serial</dt> |
217 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929062">The "Serial" property</a> | |
217 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854038">The "Serial" property</a> | |
218 | 218 | </dt></dl></dd> |
219 | 219 | <dt>SetMinimumLatency</dt> |
220 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2952386">SetMinimumLatency ()</a> | |
220 | <dd><dl><dt>QoS, <a class="indexterm" href="QoS.html#id2825230">SetMinimumLatency ()</a> | |
221 | 221 | </dt></dl></dd> |
222 | 222 | <dt>State</dt> |
223 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929859">The "State" property</a> | |
223 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854834">The "State" property</a> | |
224 | 224 | </dt></dl></dd> |
225 | 225 | <dt>Suspend</dt> |
226 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2863516">Suspend ()</a> | |
226 | <dd><dl><dt>Power, <a class="indexterm" href="Power.html#id2769095">Suspend ()</a> | |
227 | 227 | </dt></dl></dd> |
228 | 228 | </dl> |
229 | 229 | </div> |
231 | 231 | <h3>T</h3> |
232 | 232 | <dl> |
233 | 233 | <dt>Technology</dt> |
234 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2930074">The "Technology" property</a> | |
234 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2855050">The "Technology" property</a> | |
235 | 235 | </dt></dl></dd> |
236 | 236 | <dt>TimeToEmpty</dt> |
237 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929630">The "TimeToEmpty" property</a> | |
237 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854606">The "TimeToEmpty" property</a> | |
238 | 238 | </dt></dl></dd> |
239 | 239 | <dt>TimeToFull</dt> |
240 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929676">The "TimeToFull" property</a> | |
240 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854652">The "TimeToFull" property</a> | |
241 | 241 | </dt></dl></dd> |
242 | 242 | <dt>Type</dt> |
243 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929127">The "Type" property</a> | |
243 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854103">The "Type" property</a> | |
244 | 244 | </dt></dl></dd> |
245 | 245 | </dl> |
246 | 246 | </div> |
248 | 248 | <h3>U</h3> |
249 | 249 | <dl> |
250 | 250 | <dt>UpdateTime</dt> |
251 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929093">The "UpdateTime" property</a> | |
251 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854069">The "UpdateTime" property</a> | |
252 | 252 | </dt></dl></dd> |
253 | 253 | </dl> |
254 | 254 | </div> |
256 | 256 | <h3>V</h3> |
257 | 257 | <dl> |
258 | 258 | <dt>Vendor</dt> |
259 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929000">The "Vendor" property</a> | |
259 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2853976">The "Vendor" property</a> | |
260 | 260 | </dt></dl></dd> |
261 | 261 | <dt>Voltage</dt> |
262 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2929598">The "Voltage" property</a> | |
262 | <dd><dl><dt>Device, <a class="indexterm" href="Device.html#id2854574">The "Voltage" property</a> | |
263 | 263 | </dt></dl></dd> |
264 | 264 | </dl> |
265 | 265 | </div> |
4 | 4 | policy/org.freedesktop.devicekit.power.qos.policy.in |
5 | 5 | src/dkp-main.c |
6 | 6 | tools/dkp-tool.c |
7 | src/egg-debug.c | |
7 | 8 |
15 | 15 | # only match correct manufacturer |
16 | 16 | ATTR{manufacturer}!="SONY", GOTO="dkp_battery_recall_ibm_end" |
17 | 17 | |
18 | # only recalled on some particular models | |
19 | ATTR{[dmi/id]product_version}!="*R60*|*T60*|*Z60m*|*Z61e*|*Z61m*|*Z61p*", GOTO="dkp_battery_recall_ibm_end" | |
20 | ||
18 | 21 | ATTR{model_name}=="92P1072", ENV{DKP_RECALL_NOTICE}="1" |
19 | 22 | ATTR{model_name}=="92P1073", ENV{DKP_RECALL_NOTICE}="1" |
20 | 23 | ATTR{model_name}=="92P1088", ENV{DKP_RECALL_NOTICE}="1" |
15 | 15 | # only match correct manufacturer |
16 | 16 | ATTR{manufacturer}!="TOSHIBA", GOTO="dkp_battery_recall_toshiba_end" |
17 | 17 | |
18 | ATTR{model_name}=="PA3465U, ENV{DKP_RECALL_NOTICE}="1" | |
19 | ATTR{model_name}=="PA3399U, ENV{DKP_RECALL_NOTICE}="1" | |
20 | ATTR{model_name}=="PA3400U, ENV{DKP_RECALL_NOTICE}="1" | |
21 | ATTR{model_name}=="PA3465U, ENV{DKP_RECALL_NOTICE}="1" | |
22 | ATTR{model_name}=="PA3399U, ENV{DKP_RECALL_NOTICE}="1" | |
23 | ATTR{model_name}=="PA3400U, ENV{DKP_RECALL_NOTICE}="1" | |
18 | ATTR{model_name}=="PA3465U", ENV{DKP_RECALL_NOTICE}="1" | |
19 | ATTR{model_name}=="PA3399U", ENV{DKP_RECALL_NOTICE}="1" | |
20 | ATTR{model_name}=="PA3400U", ENV{DKP_RECALL_NOTICE}="1" | |
21 | ATTR{model_name}=="PA3465U", ENV{DKP_RECALL_NOTICE}="1" | |
22 | ATTR{model_name}=="PA3399U", ENV{DKP_RECALL_NOTICE}="1" | |
23 | ATTR{model_name}=="PA3400U", ENV{DKP_RECALL_NOTICE}="1" | |
24 | 24 | |
25 | 25 | ENV{DKP_RECALL_NOTICE}=="1", ENV{DKP_RECALL_VENDOR}="Toshiba", ENV{DKP_RECALL_URL}="http://bxinfo.toshiba.com/" |
26 | 26 |
13 | 13 | |
14 | 14 | ATTRS{idVendor}=="03f0", ENV{DKP_VENDOR}="Hewlett Packard" |
15 | 15 | ATTRS{idVendor}=="0463", ENV{DKP_VENDOR}="Eaton" |
16 | ATTRS{idVendor}=="047c", ENV{DKP_VENDOR}="Dell" | |
16 | 17 | ATTRS{idVendor}=="050d", ENV{DKP_VENDOR}="Belkin" |
17 | 18 | ATTRS{idVendor}=="051d", ENV{DKP_VENDOR}="APC" |
18 | 19 | ATTRS{idVendor}=="06da", ENV{DKP_VENDOR}="Liebert" |
19 | 20 | ATTRS{idVendor}=="0764", ENV{DKP_VENDOR}="Cyber Power Systems" |
20 | 21 | ATTRS{idVendor}=="09ae", ENV{DKP_VENDOR}="TrippLite" |
22 | ATTRS{idVendor}=="0d9f", ENV{DKP_VENDOR}="PowerCOM" | |
23 | ATTRS{idVendor}=="10af", ENV{DKP_VENDOR}="Liebert" | |
21 | 24 | |
22 | 25 | # Hewlett Packard |
23 | 26 | ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1f06", ENV{DKP_BATTERY_TYPE}="ups" |
26 | 29 | # Eaton |
27 | 30 | ATTRS{idVendor}=="0463", ATTRS{idProduct}=="0001", ENV{DKP_BATTERY_TYPE}="ups" |
28 | 31 | ATTRS{idVendor}=="0463", ATTRS{idProduct}=="ffff", ENV{DKP_BATTERY_TYPE}="ups" |
32 | ||
33 | # Dell | |
34 | ATTRS{idVendor}=="047c", ATTRS{idProduct}=="ffff", ENV{DKP_BATTERY_TYPE}="ups" | |
29 | 35 | |
30 | 36 | # Belkin |
31 | 37 | ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0375", ENV{DKP_BATTERY_TYPE}="ups" |
47 | 53 | # Cyber Power Systems |
48 | 54 | ATTRS{idVendor}=="0764", ATTRS{idProduct}=="0005", ENV{DKP_BATTERY_TYPE}="ups" |
49 | 55 | ATTRS{idVendor}=="0764", ATTRS{idProduct}=="0501", ENV{DKP_BATTERY_TYPE}="ups" |
56 | ATTRS{idVendor}=="0764", ATTRS{idProduct}=="0601", ENV{DKP_BATTERY_TYPE}="ups" | |
50 | 57 | |
51 | 58 | # TrippLite |
52 | 59 | ATTRS{idVendor}=="09ae", ATTRS{idProduct}=="1003", ENV{DKP_BATTERY_TYPE}="ups" |
53 | 60 | ATTRS{idVendor}=="09ae", ATTRS{idProduct}=="1007", ENV{DKP_BATTERY_TYPE}="ups" |
61 | ATTRS{idVendor}=="09ae", ATTRS{idProduct}=="1008", ENV{DKP_BATTERY_TYPE}="ups" | |
54 | 62 | ATTRS{idVendor}=="09ae", ATTRS{idProduct}=="2005", ENV{DKP_BATTERY_TYPE}="ups" |
55 | 63 | ATTRS{idVendor}=="09ae", ATTRS{idProduct}=="2007", ENV{DKP_BATTERY_TYPE}="ups" |
56 | 64 | ATTRS{idVendor}=="09ae", ATTRS{idProduct}=="3012", ENV{DKP_BATTERY_TYPE}="ups" |
59 | 67 | ATTRS{idVendor}=="09ae", ATTRS{idProduct}=="4002", ENV{DKP_BATTERY_TYPE}="ups" |
60 | 68 | ATTRS{idVendor}=="09ae", ATTRS{idProduct}=="4003", ENV{DKP_BATTERY_TYPE}="ups" |
61 | 69 | |
70 | # PowerCOM | |
71 | ATTRS{idVendor}=="0d9f", ATTRS{idProduct}=="00a2", ENV{DKP_BATTERY_TYPE}="ups" | |
72 | ATTRS{idVendor}=="0d9f", ATTRS{idProduct}=="00a3", ENV{DKP_BATTERY_TYPE}="ups" | |
73 | ATTRS{idVendor}=="0d9f", ATTRS{idProduct}=="00a4", ENV{DKP_BATTERY_TYPE}="ups" | |
74 | ATTRS{idVendor}=="0d9f", ATTRS{idProduct}=="00a5", ENV{DKP_BATTERY_TYPE}="ups" | |
75 | ATTRS{idVendor}=="0d9f", ATTRS{idProduct}=="00a6", ENV{DKP_BATTERY_TYPE}="ups" | |
76 | ||
77 | # Liebert | |
78 | ATTRS{idVendor}=="10af", ATTRS{idProduct}=="0001", ENV{DKP_BATTERY_TYPE}="ups" | |
79 | ||
62 | 80 | LABEL="dkp_hid_end" |
81 |
562 | 562 | } |
563 | 563 | |
564 | 564 | /* encrypted swap? */ |
565 | if (!daemon->priv->hibernate_has_encrypted_swap) { | |
565 | if (daemon->priv->hibernate_has_encrypted_swap) { | |
566 | 566 | error = g_error_new (DKP_DAEMON_ERROR, |
567 | 567 | DKP_DAEMON_ERROR_GENERAL, |
568 | 568 | "Swap space is encrypted"); |
84 | 84 | |
85 | 85 | static gboolean dkp_device_register_device (DkpDevice *device); |
86 | 86 | |
87 | enum | |
88 | { | |
87 | enum { | |
89 | 88 | PROP_0, |
90 | 89 | PROP_NATIVE_PATH, |
91 | 90 | PROP_VENDOR, |
117 | 116 | PROP_LAST |
118 | 117 | }; |
119 | 118 | |
120 | enum | |
121 | { | |
119 | enum { | |
122 | 120 | SIGNAL_CHANGED, |
123 | 121 | SIGNAL_LAST, |
124 | 122 | }; |
531 | 529 | gboolean ret; |
532 | 530 | const gchar *native_path; |
533 | 531 | DkpDeviceClass *klass = DKP_DEVICE_GET_CLASS (device); |
534 | gchar *id; | |
532 | gchar *id = NULL; | |
535 | 533 | |
536 | 534 | g_return_val_if_fail (DKP_IS_DEVICE (device), FALSE); |
537 | 535 | |
578 | 576 | id = dkp_device_get_id (device); |
579 | 577 | if (id != NULL) |
580 | 578 | dkp_history_set_id (device->priv->history, id); |
581 | g_free (id); | |
582 | 579 | |
583 | 580 | out: |
584 | 581 | /* start signals and callbacks */ |
585 | 582 | g_object_thaw_notify (G_OBJECT(device)); |
586 | 583 | device->priv->during_coldplug = FALSE; |
587 | 584 | egg_debug ("device now not coldplug"); |
585 | g_free (id); | |
588 | 586 | return ret; |
589 | 587 | } |
590 | 588 |
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
107 | * dkp_main_timed_exit_cb: | |
108 | * | |
109 | * Exits the main loop, which is helpful for valgrinding. | |
110 | **/ | |
111 | static gboolean | |
112 | dkp_main_timed_exit_cb (GMainLoop *loop) | |
113 | { | |
114 | g_main_loop_quit (loop); | |
115 | return FALSE; | |
116 | } | |
117 | ||
118 | /** | |
107 | 119 | * main: |
108 | 120 | **/ |
109 | 121 | gint |
110 | 122 | main (gint argc, gchar **argv) |
111 | 123 | { |
112 | 124 | GError *error = NULL; |
113 | DkpDaemon *daemon; | |
114 | DkpQos *qos; | |
115 | DkpWakeups *wakeups; | |
125 | DkpDaemon *daemon = NULL; | |
126 | DkpQos *qos = NULL; | |
127 | DkpWakeups *wakeups = NULL; | |
116 | 128 | GOptionContext *context; |
117 | 129 | DBusGProxy *bus_proxy; |
118 | 130 | DBusGConnection *bus; |
119 | gboolean verbose = FALSE; | |
120 | 131 | gboolean ret; |
121 | 132 | gint retval = 1; |
122 | ||
123 | const GOptionEntry entries[] = { | |
124 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, | |
125 | _("Show extra debugging information"), NULL }, | |
126 | { NULL } | |
133 | gboolean timed_exit = FALSE; | |
134 | gboolean immediate_exit = FALSE; | |
135 | ||
136 | const GOptionEntry options[] = { | |
137 | { "timed-exit", '\0', 0, G_OPTION_ARG_NONE, &timed_exit, | |
138 | /* TRANSLATORS: exit after we've started up, used for user profiling */ | |
139 | _("Exit after a small delay"), NULL }, | |
140 | { "immediate-exit", '\0', 0, G_OPTION_ARG_NONE, &immediate_exit, | |
141 | /* TRANSLATORS: exit straight away, used for automatic profiling */ | |
142 | _("Exit after the engine has loaded"), NULL }, | |
143 | { NULL} | |
127 | 144 | }; |
128 | 145 | |
129 | 146 | g_type_init (); |
130 | 147 | |
131 | 148 | context = g_option_context_new ("DeviceKit Power Daemon"); |
132 | g_option_context_add_main_entries (context, entries, NULL); | |
149 | g_option_context_add_main_entries (context, options, NULL); | |
150 | g_option_context_add_group (context, egg_debug_get_option_group ()); | |
133 | 151 | g_option_context_parse (context, &argc, &argv, NULL); |
134 | 152 | g_option_context_free (context); |
135 | egg_debug_init (verbose); | |
136 | 153 | |
137 | 154 | /* get bus connection */ |
138 | 155 | bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); |
165 | 182 | qos = dkp_qos_new (); |
166 | 183 | wakeups = dkp_wakeups_new (); |
167 | 184 | daemon = dkp_daemon_new (); |
185 | loop = g_main_loop_new (NULL, FALSE); | |
168 | 186 | ret = dkp_daemon_startup (daemon); |
169 | 187 | if (!ret) { |
170 | 188 | egg_warning ("Could not startup; bailing out"); |
171 | 189 | goto out; |
172 | 190 | } |
173 | 191 | |
174 | loop = g_main_loop_new (NULL, FALSE); | |
192 | /* only timeout and close the mainloop if we have specified it on the command line */ | |
193 | if (timed_exit) | |
194 | g_timeout_add_seconds (30, (GSourceFunc) dkp_main_timed_exit_cb, loop); | |
195 | ||
196 | /* immediatly exit */ | |
197 | if (immediate_exit) | |
198 | g_timeout_add (50, (GSourceFunc) dkp_main_timed_exit_cb, loop); | |
199 | ||
200 | /* wait for input or timeout */ | |
175 | 201 | g_main_loop_run (loop); |
176 | ||
177 | g_object_unref (qos); | |
178 | g_object_unref (wakeups); | |
179 | g_object_unref (daemon); | |
180 | g_main_loop_unref (loop); | |
181 | 202 | retval = 0; |
182 | 203 | out: |
204 | if (qos != NULL) | |
205 | g_object_unref (qos); | |
206 | if (wakeups != NULL) | |
207 | g_object_unref (wakeups); | |
208 | if (daemon != NULL) | |
209 | g_object_unref (daemon); | |
210 | if (loop != NULL) | |
211 | g_main_loop_unref (loop); | |
183 | 212 | return retval; |
184 | 213 | } |
185 | 214 |
41 | 41 | |
42 | 42 | g_type_init (); |
43 | 43 | test = egg_test_init (); |
44 | egg_debug_init (TRUE); | |
44 | egg_debug_init (&argc, &argv); | |
45 | 45 | |
46 | 46 | /* tests go here */ |
47 | 47 | dkp_backend_test (test); |
0 | 0 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- |
1 | 1 | * |
2 | * Copyright (C) 2007-2008 Richard Hughes <richard@hughsie.com> | |
2 | * Copyright (C) 2007-2009 Richard Hughes <richard@hughsie.com> | |
3 | 3 | * |
4 | 4 | * Licensed under the GNU General Public License Version 2 |
5 | 5 | * |
24 | 24 | * |
25 | 25 | * This file contains functions that can be used for debugging. |
26 | 26 | */ |
27 | ||
28 | #include "config.h" | |
27 | 29 | |
28 | 30 | #include <glib.h> |
29 | 31 | #include <glib/gi18n.h> |
38 | 40 | #include <sys/stat.h> |
39 | 41 | #include <fcntl.h> |
40 | 42 | #include <time.h> |
43 | ||
44 | #ifdef HAVE_EXECINFO_H | |
41 | 45 | #include <execinfo.h> |
46 | #endif | |
42 | 47 | |
43 | 48 | #include "egg-debug.h" |
44 | 49 | |
52 | 57 | #define CONSOLE_CYAN 36 |
53 | 58 | #define CONSOLE_WHITE 37 |
54 | 59 | |
55 | static gint fd = -1; | |
56 | ||
57 | /** | |
58 | * pk_set_console_mode: | |
60 | static gint _fd = -1; | |
61 | static gboolean _verbose = FALSE; | |
62 | static gboolean _console = FALSE; | |
63 | static gchar *_log_filename = NULL; | |
64 | static gboolean _initialized = FALSE; | |
65 | static GPtrArray *_modules_array = NULL; | |
66 | static GPtrArray *_functions_array = NULL; | |
67 | static gchar **_modules = NULL; | |
68 | static gchar **_functions = NULL; | |
69 | ||
70 | /** | |
71 | * egg_debug_filter_module: | |
72 | **/ | |
73 | static gboolean | |
74 | egg_debug_filter_module (const gchar *filename) | |
75 | { | |
76 | gchar *module; | |
77 | const gchar *module_tmp; | |
78 | guint i; | |
79 | gboolean ret = FALSE; | |
80 | ||
81 | /* nothing filtering */ | |
82 | if (_modules_array == NULL) | |
83 | return FALSE; | |
84 | ||
85 | /* are we in the filter list */ | |
86 | module = g_strdup (filename); | |
87 | g_strdelimit (module, ".", '\0'); | |
88 | for (i=0; i<_modules_array->len; i++) { | |
89 | module_tmp = g_ptr_array_index (_modules_array, i); | |
90 | if (g_strcmp0 (module_tmp, module) == 0) { | |
91 | ret = TRUE; | |
92 | break; | |
93 | } | |
94 | } | |
95 | return ret; | |
96 | } | |
97 | ||
98 | /** | |
99 | * egg_debug_filter_function: | |
100 | **/ | |
101 | static gboolean | |
102 | egg_debug_filter_function (const gchar *function) | |
103 | { | |
104 | guint i; | |
105 | const gchar *function_tmp; | |
106 | gboolean ret = FALSE; | |
107 | ||
108 | /* nothing filtering */ | |
109 | if (_functions_array == NULL) | |
110 | return FALSE; | |
111 | ||
112 | /* are we in the filter list */ | |
113 | for (i=0; i<_functions_array->len; i++) { | |
114 | function_tmp = g_ptr_array_index (_functions_array, i); | |
115 | if (g_str_has_prefix (function, function_tmp)) { | |
116 | ret = TRUE; | |
117 | break; | |
118 | } | |
119 | } | |
120 | return ret; | |
121 | } | |
122 | ||
123 | /** | |
124 | * egg_debug_set_console_mode: | |
59 | 125 | **/ |
60 | 126 | static void |
61 | pk_set_console_mode (guint console_code) | |
127 | egg_debug_set_console_mode (guint console_code) | |
62 | 128 | { |
63 | 129 | gchar command[13]; |
64 | 130 | |
65 | 131 | /* don't put extra commands into logs */ |
66 | if (!egg_debug_is_console ()) | |
132 | if (!_console) | |
67 | 133 | return; |
68 | 134 | |
69 | 135 | /* Command is the control command to the terminal */ |
77 | 143 | void |
78 | 144 | egg_debug_backtrace (void) |
79 | 145 | { |
146 | #ifdef HAVE_EXECINFO_H | |
80 | 147 | void *call_stack[512]; |
81 | 148 | int call_stack_size; |
82 | 149 | char **symbols; |
85 | 152 | call_stack_size = backtrace (call_stack, G_N_ELEMENTS (call_stack)); |
86 | 153 | symbols = backtrace_symbols (call_stack, call_stack_size); |
87 | 154 | if (symbols != NULL) { |
88 | pk_set_console_mode (CONSOLE_RED); | |
155 | egg_debug_set_console_mode (CONSOLE_RED); | |
89 | 156 | g_print ("Traceback:\n"); |
90 | 157 | while (i < call_stack_size) { |
91 | 158 | g_print ("\t%s\n", symbols[i]); |
92 | 159 | i++; |
93 | 160 | } |
94 | pk_set_console_mode (CONSOLE_RESET); | |
161 | egg_debug_set_console_mode (CONSOLE_RESET); | |
95 | 162 | free (symbols); |
96 | 163 | } |
97 | } | |
98 | ||
99 | /** | |
100 | * pk_log_line: | |
164 | #endif | |
165 | } | |
166 | ||
167 | /** | |
168 | * egg_debug_log_line: | |
101 | 169 | **/ |
102 | 170 | static void |
103 | pk_log_line (const gchar *buffer) | |
171 | egg_debug_log_line (const gchar *buffer) | |
104 | 172 | { |
105 | 173 | ssize_t count; |
174 | ||
106 | 175 | /* open a file */ |
107 | if (fd == -1) { | |
176 | if (_fd == -1) { | |
108 | 177 | /* ITS4: ignore, /var/log/foo is owned by root, and this is just debug text */ |
109 | fd = open (EGG_LOG_FILE, O_WRONLY|O_APPEND|O_CREAT, 0777); | |
110 | if (fd == -1) | |
111 | g_error ("could not open log: '%s'", EGG_LOG_FILE); | |
178 | _fd = open (_log_filename, O_WRONLY|O_APPEND|O_CREAT, 0777); | |
179 | if (_fd == -1) | |
180 | g_error ("could not open log: '%s'", _log_filename); | |
112 | 181 | } |
113 | 182 | |
114 | 183 | /* ITS4: ignore, debug text always NULL terminated */ |
115 | count = write (fd, buffer, strlen (buffer)); | |
184 | count = write (_fd, buffer, strlen (buffer)); | |
116 | 185 | if (count == -1) |
117 | 186 | g_warning ("could not write %s", buffer); |
187 | ||
118 | 188 | /* newline */ |
119 | count = write (fd, "\n", 1); | |
189 | count = write (_fd, "\n", 1); | |
120 | 190 | if (count == -1) |
121 | 191 | g_warning ("could not write newline"); |
122 | 192 | } |
123 | 193 | |
124 | 194 | /** |
125 | * pk_print_line: | |
195 | * egg_debug_print_line: | |
126 | 196 | **/ |
127 | 197 | static void |
128 | pk_print_line (const gchar *func, const gchar *file, const int line, const gchar *buffer, guint color) | |
198 | egg_debug_print_line (const gchar *func, const gchar *file, const int line, const gchar *buffer, guint color) | |
129 | 199 | { |
130 | 200 | gchar *str_time; |
131 | 201 | gchar *header; |
132 | 202 | time_t the_time; |
133 | GThread *thread; | |
134 | 203 | |
135 | 204 | time (&the_time); |
136 | 205 | str_time = g_new0 (gchar, 255); |
137 | 206 | strftime (str_time, 254, "%H:%M:%S", localtime (&the_time)); |
138 | thread = g_thread_self (); | |
139 | 207 | |
140 | 208 | /* generate header text */ |
141 | header = g_strdup_printf ("TI:%s\tTH:%p\tFI:%s\tFN:%s,%d", str_time, thread, file, func, line); | |
209 | header = g_strdup_printf ("TI:%s\tFI:%s\tFN:%s,%d", str_time, file, func, line); | |
142 | 210 | g_free (str_time); |
143 | 211 | |
144 | 212 | /* always in light green */ |
145 | pk_set_console_mode (CONSOLE_GREEN); | |
213 | egg_debug_set_console_mode (CONSOLE_GREEN); | |
146 | 214 | printf ("%s\n", header); |
147 | 215 | |
148 | 216 | /* different colors according to the severity */ |
149 | pk_set_console_mode (color); | |
217 | egg_debug_set_console_mode (color); | |
150 | 218 | printf (" - %s\n", buffer); |
151 | pk_set_console_mode (CONSOLE_RESET); | |
219 | egg_debug_set_console_mode (CONSOLE_RESET); | |
152 | 220 | |
153 | 221 | /* log to a file */ |
154 | if (egg_debug_is_logging ()) { | |
155 | pk_log_line (header); | |
156 | pk_log_line (buffer); | |
222 | if (_log_filename != NULL) { | |
223 | egg_debug_log_line (header); | |
224 | egg_debug_log_line (buffer); | |
157 | 225 | } |
158 | 226 | |
159 | 227 | /* flush this output, as we need to debug */ |
171 | 239 | va_list args; |
172 | 240 | gchar *buffer = NULL; |
173 | 241 | |
174 | if (!egg_debug_enabled ()) | |
242 | if (!_verbose && !egg_debug_filter_module (file) && !egg_debug_filter_function (func)) | |
175 | 243 | return; |
176 | 244 | |
177 | 245 | va_start (args, format); |
178 | 246 | g_vasprintf (&buffer, format, args); |
179 | 247 | va_end (args); |
180 | 248 | |
181 | pk_print_line (func, file, line, buffer, CONSOLE_BLUE); | |
182 | ||
183 | g_free(buffer); | |
249 | egg_debug_print_line (func, file, line, buffer, CONSOLE_BLUE); | |
250 | ||
251 | g_free (buffer); | |
184 | 252 | } |
185 | 253 | |
186 | 254 | /** |
192 | 260 | va_list args; |
193 | 261 | gchar *buffer = NULL; |
194 | 262 | |
195 | if (!egg_debug_enabled ()) | |
263 | if (!_verbose && !egg_debug_filter_module (file) && !egg_debug_filter_function (func)) | |
196 | 264 | return; |
197 | 265 | |
198 | 266 | va_start (args, format); |
200 | 268 | va_end (args); |
201 | 269 | |
202 | 270 | /* do extra stuff for a warning */ |
203 | if (!egg_debug_is_console ()) | |
271 | if (!_console) | |
204 | 272 | printf ("*** WARNING ***\n"); |
205 | pk_print_line (func, file, line, buffer, CONSOLE_RED); | |
206 | ||
207 | g_free(buffer); | |
273 | egg_debug_print_line (func, file, line, buffer, CONSOLE_RED); | |
274 | ||
275 | g_free (buffer); | |
208 | 276 | } |
209 | 277 | |
210 | 278 | /** |
221 | 289 | va_end (args); |
222 | 290 | |
223 | 291 | /* do extra stuff for a warning */ |
224 | if (!egg_debug_is_console ()) | |
292 | if (!_console) | |
225 | 293 | printf ("*** ERROR ***\n"); |
226 | pk_print_line (func, file, line, buffer, CONSOLE_RED); | |
227 | g_free(buffer); | |
294 | egg_debug_print_line (func, file, line, buffer, CONSOLE_RED); | |
295 | g_free (buffer); | |
228 | 296 | |
229 | 297 | /* we want to fix this! */ |
230 | 298 | egg_debug_backtrace (); |
233 | 301 | } |
234 | 302 | |
235 | 303 | /** |
236 | * egg_debug_enabled: | |
304 | * egg_debug_is_verbose: | |
237 | 305 | * |
238 | 306 | * Returns: TRUE if we have debugging enabled |
239 | 307 | **/ |
240 | 308 | gboolean |
241 | egg_debug_enabled (void) | |
242 | { | |
243 | const gchar *env; | |
244 | env = g_getenv (EGG_VERBOSE); | |
245 | return (g_strcmp0 (env, "1") == 0); | |
246 | } | |
247 | ||
248 | /** | |
249 | * egg_debug_is_logging: | |
250 | * | |
251 | * Returns: TRUE if we have logging enabled | |
309 | egg_debug_is_verbose (void) | |
310 | { | |
311 | return _verbose; | |
312 | } | |
313 | ||
314 | /** | |
315 | * egg_debug_set_log_filename: | |
316 | **/ | |
317 | void | |
318 | egg_debug_set_log_filename (const gchar *filename) | |
319 | { | |
320 | g_free (_log_filename); | |
321 | _log_filename = g_strdup (filename); | |
322 | } | |
323 | ||
324 | /** | |
325 | * egg_debug_strv_split_to_ptr_array: | |
326 | **/ | |
327 | static GPtrArray * | |
328 | egg_debug_strv_split_to_ptr_array (gchar **modules) | |
329 | { | |
330 | GPtrArray *array = NULL; | |
331 | guint i, j; | |
332 | gchar **split; | |
333 | ||
334 | /* nothing */ | |
335 | if (modules == NULL) | |
336 | goto out; | |
337 | ||
338 | /* create array of strings */ | |
339 | array = g_ptr_array_new_with_free_func (g_free); | |
340 | ||
341 | /* parse each --debug-foo option */ | |
342 | for (i=0; modules[i] != NULL; i++) { | |
343 | /* use a comma to delimit multiple entries */ | |
344 | split = g_strsplit (modules[i], ",", -1); | |
345 | for (j=0; split[j] != NULL; j++) | |
346 | g_ptr_array_add (array, g_strdup (split[j])); | |
347 | g_strfreev (split); | |
348 | } | |
349 | out: | |
350 | return array; | |
351 | } | |
352 | ||
353 | /** | |
354 | * egg_debug_pre_parse_hook: | |
355 | */ | |
356 | static gboolean | |
357 | egg_debug_pre_parse_hook (GOptionContext *context, GOptionGroup *group, gpointer data, GError **error) | |
358 | { | |
359 | const gchar *env_string; | |
360 | const GOptionEntry main_entries[] = { | |
361 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &_verbose, | |
362 | /* TRANSLATORS: turn on all debugging */ | |
363 | N_("Show debugging information for all files"), NULL }, | |
364 | { NULL} | |
365 | }; | |
366 | ||
367 | /* global variable */ | |
368 | env_string = g_getenv ("VERBOSE"); | |
369 | if (env_string != NULL) | |
370 | _verbose = TRUE; | |
371 | ||
372 | /* add main entry */ | |
373 | g_option_context_add_main_entries (context, main_entries, NULL); | |
374 | ||
375 | return TRUE; | |
376 | } | |
377 | ||
378 | /** | |
379 | * egg_debug_free: | |
380 | **/ | |
381 | static void | |
382 | egg_debug_free (void) | |
383 | { | |
384 | if (!_initialized) | |
385 | return; | |
386 | ||
387 | /* close file */ | |
388 | if (_fd != -1) | |
389 | close (_fd); | |
390 | ||
391 | /* free memory */ | |
392 | g_free (_log_filename); | |
393 | if (_modules_array != NULL) | |
394 | g_ptr_array_unref (_modules_array); | |
395 | if (_functions_array != NULL) | |
396 | g_ptr_array_unref (_functions_array); | |
397 | g_strfreev (_modules); | |
398 | g_strfreev (_functions); | |
399 | ||
400 | /* can not re-init */ | |
401 | _initialized = FALSE; | |
402 | } | |
403 | ||
404 | /** | |
405 | * egg_debug_post_parse_hook: | |
406 | */ | |
407 | static gboolean | |
408 | egg_debug_post_parse_hook (GOptionContext *context, GOptionGroup *group, gpointer data, GError **error) | |
409 | { | |
410 | _initialized = TRUE; | |
411 | _modules_array = egg_debug_strv_split_to_ptr_array (_modules); | |
412 | _functions_array = egg_debug_strv_split_to_ptr_array (_functions); | |
413 | _console = (isatty (fileno (stdout)) == 1); | |
414 | egg_debug ("Verbose debugging %i (on console %i)", _verbose, _console); | |
415 | ||
416 | /* run this function on cleanup */ | |
417 | atexit (egg_debug_free); | |
418 | ||
419 | return TRUE; | |
420 | } | |
421 | ||
422 | /** | |
423 | * egg_debug_get_option_group: | |
424 | * | |
425 | * Returns a #GOptionGroup for the commandline arguments recognized | |
426 | * by debugging. You should add this group to your #GOptionContext | |
427 | * with g_option_context_add_group(), if you are using | |
428 | * g_option_context_parse() to parse your commandline arguments. | |
429 | * | |
430 | * Returns: a #GOptionGroup for the commandline arguments | |
431 | */ | |
432 | GOptionGroup * | |
433 | egg_debug_get_option_group (void) | |
434 | { | |
435 | GOptionGroup *group; | |
436 | const GOptionEntry debug_entries[] = { | |
437 | { "debug-modules", '\0', 0, G_OPTION_ARG_STRING_ARRAY, &_modules, | |
438 | /* TRANSLATORS: a list of modules to debug */ | |
439 | N_("Debug these specific modules"), NULL }, | |
440 | { "debug-functions", '\0', 0, G_OPTION_ARG_STRING_ARRAY, &_functions, | |
441 | /* TRANSLATORS: a list of functions to debug */ | |
442 | N_("Debug these specific functions"), NULL }, | |
443 | { "debug-log-filename", '\0', 0, G_OPTION_ARG_STRING, &_log_filename, | |
444 | /* TRANSLATORS: save to a log */ | |
445 | N_("Log debugging data to a file"), NULL }, | |
446 | { NULL} | |
447 | }; | |
448 | ||
449 | group = g_option_group_new ("debug", _("Debugging Options"), _("Show debugging options"), NULL, NULL); | |
450 | g_option_group_set_parse_hooks (group, egg_debug_pre_parse_hook, egg_debug_post_parse_hook); | |
451 | g_option_group_add_entries (group, debug_entries); | |
452 | return group; | |
453 | } | |
454 | ||
455 | /** | |
456 | * egg_debug_init: | |
457 | * @argc: a pointer to the number of command line arguments. | |
458 | * @argv: a pointer to the array of command line arguments. | |
459 | * | |
460 | * Parses command line arguments. | |
461 | * | |
462 | * Return value: %TRUE if initialization succeeded, otherwise %FALSE. | |
252 | 463 | **/ |
253 | 464 | gboolean |
254 | egg_debug_is_logging (void) | |
255 | { | |
256 | const gchar *env; | |
257 | env = g_getenv (EGG_LOGGING); | |
258 | return (g_strcmp0 (env, "1") == 0); | |
259 | } | |
260 | ||
261 | /** | |
262 | * egg_debug_is_console: | |
263 | * | |
264 | * Returns: TRUE if we have debugging enabled | |
265 | **/ | |
266 | gboolean | |
267 | egg_debug_is_console (void) | |
268 | { | |
269 | const gchar *env; | |
270 | env = g_getenv (EGG_CONSOLE); | |
271 | return (g_strcmp0 (env, "1") == 0); | |
272 | } | |
273 | ||
274 | /** | |
275 | * egg_debug_set_logging: | |
276 | **/ | |
277 | void | |
278 | egg_debug_set_logging (gboolean enabled) | |
279 | { | |
280 | if (enabled) | |
281 | g_setenv (EGG_LOGGING, "1", TRUE); | |
282 | else | |
283 | g_setenv (EGG_LOGGING, "0", TRUE); | |
284 | ||
285 | if (egg_debug_is_logging ()) | |
286 | egg_debug ("logging to %s", EGG_LOG_FILE); | |
287 | } | |
288 | ||
289 | /** | |
290 | * egg_debug_init: | |
291 | * @debug: If we should print out verbose logging | |
292 | **/ | |
293 | void | |
294 | egg_debug_init (gboolean debug) | |
295 | { | |
296 | /* check if we are on console */ | |
297 | if (isatty (fileno (stdout)) == 1) | |
298 | g_setenv (EGG_CONSOLE, "1", FALSE); | |
299 | else | |
300 | g_setenv (EGG_CONSOLE, "0", FALSE); | |
301 | if (debug) | |
302 | g_setenv (EGG_VERBOSE, "1", FALSE); | |
303 | else | |
304 | g_setenv (EGG_VERBOSE, "0", FALSE); | |
305 | egg_debug ("Verbose debugging %i (on console %i)%s", egg_debug_enabled (), egg_debug_is_console (), EGG_VERBOSE); | |
306 | } | |
307 | ||
465 | egg_debug_init (gint *argc, gchar ***argv) | |
466 | { | |
467 | GOptionContext *context; | |
468 | ||
469 | /* already initialized */ | |
470 | if (_initialized) | |
471 | return TRUE; | |
472 | ||
473 | context = g_option_context_new (NULL); | |
474 | g_option_context_set_ignore_unknown_options (context, TRUE); | |
475 | g_option_context_add_group (context, egg_debug_get_option_group ()); | |
476 | g_option_context_parse (context, argc, argv, NULL); | |
477 | g_option_context_free (context); | |
478 | ||
479 | return TRUE; | |
480 | } | |
481 |
0 | 0 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- |
1 | 1 | * |
2 | * Copyright (C) 2007-2008 Richard Hughes <richard@hughsie.com> | |
2 | * Copyright (C) 2007-2009 Richard Hughes <richard@hughsie.com> | |
3 | 3 | * |
4 | 4 | * Licensed under the GNU General Public License Version 2 |
5 | 5 | * |
58 | 58 | #define egg_error(...) |
59 | 59 | #endif |
60 | 60 | |
61 | void egg_debug_init (gboolean debug); | |
62 | void egg_debug_set_logging (gboolean enabled); | |
63 | gboolean egg_debug_enabled (void); | |
64 | gboolean egg_debug_is_logging (void); | |
65 | gboolean egg_debug_is_console (void); | |
66 | void egg_debug_backtrace (void); | |
67 | void egg_debug_real (const gchar *func, | |
61 | gboolean egg_debug_init (gint *argc, | |
62 | gchar ***argv); | |
63 | GOptionGroup *egg_debug_get_option_group (void); | |
64 | gboolean egg_debug_is_verbose (void); | |
65 | void egg_debug_backtrace (void); | |
66 | void egg_debug_set_log_filename (const gchar *filename); | |
67 | void egg_debug_real (const gchar *func, | |
68 | 68 | const gchar *file, |
69 | int line, | |
69 | gint line, | |
70 | 70 | const gchar *format, ...) __attribute__((format (printf,4,5))); |
71 | void egg_warning_real (const gchar *func, | |
71 | void egg_warning_real (const gchar *func, | |
72 | 72 | const gchar *file, |
73 | int line, | |
73 | gint line, | |
74 | 74 | const gchar *format, ...) __attribute__((format (printf,4,5))); |
75 | void egg_error_real (const gchar *func, | |
75 | void egg_error_real (const gchar *func, | |
76 | 76 | const gchar *file, |
77 | int line, | |
77 | gint line, | |
78 | 78 | const gchar *format, ...) G_GNUC_NORETURN __attribute__((format (printf,4,5))); |
79 | 79 | |
80 | 80 | G_END_DECLS |
142 | 142 | |
143 | 143 | if (type != DKP_DEVICE_TYPE_BATTERY) |
144 | 144 | return FALSE; |
145 | if (state == DKP_DEVICE_STATE_UNKNOWN) | |
146 | return FALSE; | |
145 | 147 | if (!is_present) |
146 | 148 | return FALSE; |
147 | 149 | |
158 | 160 | gboolean ret; |
159 | 161 | gboolean on_battery; |
160 | 162 | DkpDeviceSupply *supply = DKP_DEVICE_SUPPLY (device); |
161 | guint percentage; | |
163 | gdouble percentage; | |
162 | 164 | |
163 | 165 | g_return_val_if_fail (DKP_IS_SUPPLY (supply), FALSE); |
164 | 166 | g_return_val_if_fail (low_battery != NULL, FALSE); |
175 | 177 | } |
176 | 178 | |
177 | 179 | g_object_get (device, "percentage", &percentage, NULL); |
178 | *low_battery = (percentage < 10); | |
180 | *low_battery = (percentage < 10.0f); | |
179 | 181 | return TRUE; |
180 | 182 | } |
181 | 183 | |
219 | 221 | |
220 | 222 | g_object_get (device, "energy", &energy, NULL); |
221 | 223 | |
222 | if (energy < 0) | |
224 | if (energy < 0.1f) | |
223 | 225 | return; |
224 | 226 | |
225 | if (supply->priv->energy_old < 0) | |
227 | if (supply->priv->energy_old < 0.1f) | |
226 | 228 | return; |
227 | 229 | |
228 | 230 | if (supply->priv->energy_old == energy) |
237 | 239 | |
238 | 240 | /* get the difference in charge */ |
239 | 241 | energy = supply->priv->energy_old - energy; |
240 | if (energy < 0.1) | |
242 | if (energy < 0.1f) | |
241 | 243 | return; |
242 | 244 | |
243 | 245 | /* probably okay */ |
340 | 342 | } |
341 | 343 | |
342 | 344 | /** |
345 | * dkp_device_supply_make_safe_string: | |
346 | **/ | |
347 | static void | |
348 | dkp_device_supply_make_safe_string (gchar *text) | |
349 | { | |
350 | guint i; | |
351 | guint idx = 0; | |
352 | ||
353 | /* no point checking */ | |
354 | if (text == NULL) | |
355 | return; | |
356 | ||
357 | /* shunt up only safe chars */ | |
358 | for (i=0; text[i] != '\0'; i++) { | |
359 | if (g_ascii_isprint (text[i])) { | |
360 | /* only copy if the address is going to change */ | |
361 | if (idx != i) | |
362 | text[idx] = text[i]; | |
363 | idx++; | |
364 | } else { | |
365 | egg_debug ("invalid char '%c'", text[i]); | |
366 | } | |
367 | } | |
368 | ||
369 | /* ensure null terminated */ | |
370 | text[idx] = '\0'; | |
371 | } | |
372 | ||
373 | /** | |
343 | 374 | * dkp_device_supply_refresh_battery: |
344 | 375 | * |
345 | 376 | * Return %TRUE on success, %FALSE if we failed to refresh or no data |
348 | 379 | dkp_device_supply_refresh_battery (DkpDeviceSupply *supply) |
349 | 380 | { |
350 | 381 | gchar *status = NULL; |
351 | gchar *technology_native; | |
382 | gchar *technology_native = NULL; | |
352 | 383 | gboolean ret = TRUE; |
353 | 384 | gdouble voltage_design; |
354 | 385 | DkpDeviceState old_state; |
366 | 397 | gdouble voltage; |
367 | 398 | guint64 time_to_empty; |
368 | 399 | guint64 time_to_full; |
369 | gchar *manufacturer; | |
370 | gchar *model_name; | |
371 | gchar *serial_number; | |
400 | gchar *manufacturer = NULL; | |
401 | gchar *model_name = NULL; | |
402 | gchar *serial_number = NULL; | |
372 | 403 | gboolean recall_notice; |
373 | 404 | const gchar *recall_vendor = NULL; |
374 | 405 | const gchar *recall_url = NULL; |
404 | 435 | /* the ACPI spec is bad at defining battery type constants */ |
405 | 436 | technology_native = dkp_device_supply_get_string (native_path, "technology"); |
406 | 437 | g_object_set (device, "technology", dkp_device_supply_convert_device_technology (technology_native), NULL); |
407 | g_free (technology_native); | |
408 | 438 | |
409 | 439 | /* get values which may be blank */ |
410 | 440 | manufacturer = dkp_device_supply_get_string (native_path, "manufacturer"); |
411 | 441 | model_name = dkp_device_supply_get_string (native_path, "model_name"); |
412 | 442 | serial_number = dkp_device_supply_get_string (native_path, "serial_number"); |
443 | ||
444 | /* some vendors fill this with binary garbage */ | |
445 | dkp_device_supply_make_safe_string (manufacturer); | |
446 | dkp_device_supply_make_safe_string (model_name); | |
447 | dkp_device_supply_make_safe_string (serial_number); | |
413 | 448 | |
414 | 449 | /* are we possibly recalled by the vendor? */ |
415 | 450 | recall_notice = g_udev_device_has_property (native, "DKP_RECALL_NOTICE"); |
429 | 464 | "recall-vendor", recall_vendor, |
430 | 465 | "recall-url", recall_url, |
431 | 466 | NULL); |
432 | ||
433 | g_free (manufacturer); | |
434 | g_free (model_name); | |
435 | g_free (serial_number); | |
436 | 467 | |
437 | 468 | /* these don't change at runtime */ |
438 | 469 | energy_full = sysfs_get_double (native_path, "energy_full") / 1000000.0; |
571 | 602 | battery_count = dkp_daemon_get_number_devices_of_type (daemon, DKP_DEVICE_TYPE_BATTERY); |
572 | 603 | |
573 | 604 | /* try to find a suitable icon depending on AC state */ |
574 | if (on_battery && battery_count > 1) | |
575 | state = DKP_DEVICE_STATE_PENDING_DISCHARGE; | |
576 | else if (battery_count > 1) | |
577 | state = DKP_DEVICE_STATE_PENDING_CHARGE; | |
578 | else if (on_battery) | |
579 | state = DKP_DEVICE_STATE_DISCHARGING; | |
580 | else | |
581 | state = DKP_DEVICE_STATE_FULLY_CHARGED; | |
605 | if (battery_count > 1) { | |
606 | if (on_battery && percentage < 1.0f) { | |
607 | /* battery is low */ | |
608 | state = DKP_DEVICE_STATE_EMPTY; | |
609 | } else if (on_battery) { | |
610 | /* battery is waiting */ | |
611 | state = DKP_DEVICE_STATE_PENDING_DISCHARGE; | |
612 | } else { | |
613 | /* battery is waiting */ | |
614 | state = DKP_DEVICE_STATE_PENDING_CHARGE; | |
615 | } | |
616 | } else { | |
617 | if (on_battery) { | |
618 | /* battery is assumed discharging */ | |
619 | state = DKP_DEVICE_STATE_DISCHARGING; | |
620 | } else { | |
621 | /* battery is waiting */ | |
622 | state = DKP_DEVICE_STATE_FULLY_CHARGED; | |
623 | } | |
624 | } | |
582 | 625 | |
583 | 626 | /* print what we did */ |
584 | 627 | egg_debug ("guessing battery state '%s' using global on-battery:%i", |
592 | 635 | egg_warning ("Setting %s state empty as unknown and very low", native_path); |
593 | 636 | state = DKP_DEVICE_STATE_EMPTY; |
594 | 637 | } |
638 | ||
639 | /* some batteries give out massive rate values when nearly empty */ | |
640 | if (energy < 0.1f) | |
641 | energy_rate = 0.0f; | |
595 | 642 | |
596 | 643 | /* calculate a quick and dirty time remaining value */ |
597 | 644 | time_to_empty = 0; |
633 | 680 | NULL); |
634 | 681 | |
635 | 682 | out: |
683 | g_free (technology_native); | |
684 | g_free (manufacturer); | |
685 | g_free (model_name); | |
686 | g_free (serial_number); | |
636 | 687 | g_free (status); |
637 | 688 | return ret; |
638 | 689 | } |
40 | 40 | static gboolean opt_monitor_detail = FALSE; |
41 | 41 | |
42 | 42 | /** |
43 | * dkp_tool_get_timestamp: | |
44 | **/ | |
45 | static gchar * | |
46 | dkp_tool_get_timestamp (void) | |
47 | { | |
48 | gchar *str_time; | |
49 | gchar *timestamp; | |
50 | time_t the_time; | |
51 | struct timeval time_val; | |
52 | ||
53 | time (&the_time); | |
54 | gettimeofday (&time_val, NULL); | |
55 | str_time = g_new0 (gchar, 255); | |
56 | strftime (str_time, 254, "%H:%M:%S", localtime (&the_time)); | |
57 | ||
58 | /* generate header text */ | |
59 | timestamp = g_strdup_printf ("%s.%03i", str_time, (gint) time_val.tv_usec / 1000); | |
60 | g_free (str_time); | |
61 | return timestamp; | |
62 | } | |
63 | ||
64 | /** | |
43 | 65 | * dkp_tool_device_added_cb: |
44 | 66 | **/ |
45 | 67 | static void |
46 | 68 | dkp_tool_device_added_cb (DkpClient *client, const DkpDevice *device, gpointer user_data) |
47 | 69 | { |
48 | g_print ("device added: %s\n", dkp_device_get_object_path (device)); | |
70 | gchar *timestamp; | |
71 | timestamp = dkp_tool_get_timestamp (); | |
72 | g_print ("[%s]\tdevice added: %s\n", timestamp, dkp_device_get_object_path (device)); | |
49 | 73 | if (opt_monitor_detail) { |
50 | 74 | dkp_device_print (device); |
51 | 75 | g_print ("\n"); |
52 | 76 | } |
77 | g_free (timestamp); | |
53 | 78 | } |
54 | 79 | |
55 | 80 | /** |
58 | 83 | static void |
59 | 84 | dkp_tool_device_changed_cb (DkpClient *client, const DkpDevice *device, gpointer user_data) |
60 | 85 | { |
61 | g_print ("device changed: %s\n", dkp_device_get_object_path (device)); | |
86 | gchar *timestamp; | |
87 | timestamp = dkp_tool_get_timestamp (); | |
88 | g_print ("[%s]\tdevice changed: %s\n", timestamp, dkp_device_get_object_path (device)); | |
62 | 89 | if (opt_monitor_detail) { |
63 | 90 | /* TODO: would be nice to just show the diff */ |
64 | 91 | dkp_device_print (device); |
65 | 92 | g_print ("\n"); |
66 | 93 | } |
94 | g_free (timestamp); | |
67 | 95 | } |
68 | 96 | |
69 | 97 | /** |
72 | 100 | static void |
73 | 101 | dkp_tool_device_removed_cb (DkpClient *client, const DkpDevice *device, gpointer user_data) |
74 | 102 | { |
75 | g_print ("device removed: %s\n", dkp_device_get_object_path (device)); | |
103 | gchar *timestamp; | |
104 | timestamp = dkp_tool_get_timestamp (); | |
105 | g_print ("[%s]\tdevice removed: %s\n", timestamp, dkp_device_get_object_path (device)); | |
76 | 106 | if (opt_monitor_detail) |
77 | 107 | g_print ("\n"); |
108 | g_free (timestamp); | |
78 | 109 | } |
79 | 110 | |
80 | 111 | /** |
118 | 149 | static void |
119 | 150 | dkp_tool_changed_cb (DkpClient *client, gpointer user_data) |
120 | 151 | { |
121 | g_print ("daemon changed:\n"); | |
152 | gchar *timestamp; | |
153 | timestamp = dkp_tool_get_timestamp (); | |
154 | g_print ("[%s]\tdaemon changed:\n", timestamp); | |
122 | 155 | if (opt_monitor_detail) { |
123 | 156 | dkp_client_print (client); |
124 | 157 | g_print ("\n"); |
125 | 158 | } |
159 | g_free (timestamp); | |
126 | 160 | } |
127 | 161 | |
128 | 162 | /** |
195 | 229 | gint retval = EXIT_FAILURE; |
196 | 230 | guint i; |
197 | 231 | GOptionContext *context; |
198 | gboolean verbose = FALSE; | |
199 | 232 | gboolean opt_dump = FALSE; |
200 | 233 | gboolean opt_wakeups = FALSE; |
201 | 234 | gboolean opt_enumerate = FALSE; |
209 | 242 | DkpDevice *device; |
210 | 243 | |
211 | 244 | const GOptionEntry entries[] = { |
212 | { "verbose", '\0', 0, G_OPTION_ARG_NONE, &verbose, _("Show extra debugging information"), NULL }, | |
213 | 245 | { "enumerate", 'e', 0, G_OPTION_ARG_NONE, &opt_enumerate, _("Enumerate objects paths for devices"), NULL }, |
214 | 246 | { "dump", 'd', 0, G_OPTION_ARG_NONE, &opt_dump, _("Dump all parameters for all objects"), NULL }, |
215 | 247 | { "wakeups", 'w', 0, G_OPTION_ARG_NONE, &opt_wakeups, _("Get the wakeup data"), NULL }, |
224 | 256 | |
225 | 257 | context = g_option_context_new ("DeviceKit-power tool"); |
226 | 258 | g_option_context_add_main_entries (context, entries, NULL); |
259 | g_option_context_add_group (context, egg_debug_get_option_group ()); | |
227 | 260 | g_option_context_parse (context, &argc, &argv, NULL); |
228 | 261 | g_option_context_free (context); |
229 | egg_debug_init (verbose); | |
230 | 262 | |
231 | 263 | loop = g_main_loop_new (NULL, FALSE); |
232 | 264 | client = dkp_client_new (); |
0 | 0 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- |
1 | 1 | * |
2 | * Copyright (C) 2007-2008 Richard Hughes <richard@hughsie.com> | |
2 | * Copyright (C) 2007-2009 Richard Hughes <richard@hughsie.com> | |
3 | 3 | * |
4 | 4 | * Licensed under the GNU General Public License Version 2 |
5 | 5 | * |
24 | 24 | * |
25 | 25 | * This file contains functions that can be used for debugging. |
26 | 26 | */ |
27 | ||
28 | #include "config.h" | |
27 | 29 | |
28 | 30 | #include <glib.h> |
29 | 31 | #include <glib/gi18n.h> |
38 | 40 | #include <sys/stat.h> |
39 | 41 | #include <fcntl.h> |
40 | 42 | #include <time.h> |
43 | ||
44 | #ifdef HAVE_EXECINFO_H | |
41 | 45 | #include <execinfo.h> |
46 | #endif | |
42 | 47 | |
43 | 48 | #include "egg-debug.h" |
44 | 49 | |
52 | 57 | #define CONSOLE_CYAN 36 |
53 | 58 | #define CONSOLE_WHITE 37 |
54 | 59 | |
55 | static gint fd = -1; | |
56 | ||
57 | /** | |
58 | * pk_set_console_mode: | |
60 | static gint _fd = -1; | |
61 | static gboolean _verbose = FALSE; | |
62 | static gboolean _console = FALSE; | |
63 | static gchar *_log_filename = NULL; | |
64 | static gboolean _initialized = FALSE; | |
65 | static GPtrArray *_modules_array = NULL; | |
66 | static GPtrArray *_functions_array = NULL; | |
67 | static gchar **_modules = NULL; | |
68 | static gchar **_functions = NULL; | |
69 | ||
70 | /** | |
71 | * egg_debug_filter_module: | |
72 | **/ | |
73 | static gboolean | |
74 | egg_debug_filter_module (const gchar *filename) | |
75 | { | |
76 | gchar *module; | |
77 | const gchar *module_tmp; | |
78 | guint i; | |
79 | gboolean ret = FALSE; | |
80 | ||
81 | /* nothing filtering */ | |
82 | if (_modules_array == NULL) | |
83 | return FALSE; | |
84 | ||
85 | /* are we in the filter list */ | |
86 | module = g_strdup (filename); | |
87 | g_strdelimit (module, ".", '\0'); | |
88 | for (i=0; i<_modules_array->len; i++) { | |
89 | module_tmp = g_ptr_array_index (_modules_array, i); | |
90 | if (g_strcmp0 (module_tmp, module) == 0) { | |
91 | ret = TRUE; | |
92 | break; | |
93 | } | |
94 | } | |
95 | return ret; | |
96 | } | |
97 | ||
98 | /** | |
99 | * egg_debug_filter_function: | |
100 | **/ | |
101 | static gboolean | |
102 | egg_debug_filter_function (const gchar *function) | |
103 | { | |
104 | guint i; | |
105 | const gchar *function_tmp; | |
106 | gboolean ret = FALSE; | |
107 | ||
108 | /* nothing filtering */ | |
109 | if (_functions_array == NULL) | |
110 | return FALSE; | |
111 | ||
112 | /* are we in the filter list */ | |
113 | for (i=0; i<_functions_array->len; i++) { | |
114 | function_tmp = g_ptr_array_index (_functions_array, i); | |
115 | if (g_str_has_prefix (function, function_tmp)) { | |
116 | ret = TRUE; | |
117 | break; | |
118 | } | |
119 | } | |
120 | return ret; | |
121 | } | |
122 | ||
123 | /** | |
124 | * egg_debug_set_console_mode: | |
59 | 125 | **/ |
60 | 126 | static void |
61 | pk_set_console_mode (guint console_code) | |
127 | egg_debug_set_console_mode (guint console_code) | |
62 | 128 | { |
63 | 129 | gchar command[13]; |
64 | 130 | |
65 | 131 | /* don't put extra commands into logs */ |
66 | if (!egg_debug_is_console ()) | |
132 | if (!_console) | |
67 | 133 | return; |
68 | 134 | |
69 | 135 | /* Command is the control command to the terminal */ |
77 | 143 | void |
78 | 144 | egg_debug_backtrace (void) |
79 | 145 | { |
146 | #ifdef HAVE_EXECINFO_H | |
80 | 147 | void *call_stack[512]; |
81 | 148 | int call_stack_size; |
82 | 149 | char **symbols; |
85 | 152 | call_stack_size = backtrace (call_stack, G_N_ELEMENTS (call_stack)); |
86 | 153 | symbols = backtrace_symbols (call_stack, call_stack_size); |
87 | 154 | if (symbols != NULL) { |
88 | pk_set_console_mode (CONSOLE_RED); | |
155 | egg_debug_set_console_mode (CONSOLE_RED); | |
89 | 156 | g_print ("Traceback:\n"); |
90 | 157 | while (i < call_stack_size) { |
91 | 158 | g_print ("\t%s\n", symbols[i]); |
92 | 159 | i++; |
93 | 160 | } |
94 | pk_set_console_mode (CONSOLE_RESET); | |
161 | egg_debug_set_console_mode (CONSOLE_RESET); | |
95 | 162 | free (symbols); |
96 | 163 | } |
97 | } | |
98 | ||
99 | /** | |
100 | * pk_log_line: | |
164 | #endif | |
165 | } | |
166 | ||
167 | /** | |
168 | * egg_debug_log_line: | |
101 | 169 | **/ |
102 | 170 | static void |
103 | pk_log_line (const gchar *buffer) | |
171 | egg_debug_log_line (const gchar *buffer) | |
104 | 172 | { |
105 | 173 | ssize_t count; |
174 | ||
106 | 175 | /* open a file */ |
107 | if (fd == -1) { | |
176 | if (_fd == -1) { | |
108 | 177 | /* ITS4: ignore, /var/log/foo is owned by root, and this is just debug text */ |
109 | fd = open (EGG_LOG_FILE, O_WRONLY|O_APPEND|O_CREAT, 0777); | |
110 | if (fd == -1) | |
111 | g_error ("could not open log: '%s'", EGG_LOG_FILE); | |
178 | _fd = open (_log_filename, O_WRONLY|O_APPEND|O_CREAT, 0777); | |
179 | if (_fd == -1) | |
180 | g_error ("could not open log: '%s'", _log_filename); | |
112 | 181 | } |
113 | 182 | |
114 | 183 | /* ITS4: ignore, debug text always NULL terminated */ |
115 | count = write (fd, buffer, strlen (buffer)); | |
184 | count = write (_fd, buffer, strlen (buffer)); | |
116 | 185 | if (count == -1) |
117 | 186 | g_warning ("could not write %s", buffer); |
187 | ||
118 | 188 | /* newline */ |
119 | count = write (fd, "\n", 1); | |
189 | count = write (_fd, "\n", 1); | |
120 | 190 | if (count == -1) |
121 | 191 | g_warning ("could not write newline"); |
122 | 192 | } |
123 | 193 | |
124 | 194 | /** |
125 | * pk_print_line: | |
195 | * egg_debug_print_line: | |
126 | 196 | **/ |
127 | 197 | static void |
128 | pk_print_line (const gchar *func, const gchar *file, const int line, const gchar *buffer, guint color) | |
198 | egg_debug_print_line (const gchar *func, const gchar *file, const int line, const gchar *buffer, guint color) | |
129 | 199 | { |
130 | 200 | gchar *str_time; |
131 | 201 | gchar *header; |
132 | 202 | time_t the_time; |
133 | GThread *thread; | |
134 | 203 | |
135 | 204 | time (&the_time); |
136 | 205 | str_time = g_new0 (gchar, 255); |
137 | 206 | strftime (str_time, 254, "%H:%M:%S", localtime (&the_time)); |
138 | thread = g_thread_self (); | |
139 | 207 | |
140 | 208 | /* generate header text */ |
141 | header = g_strdup_printf ("TI:%s\tTH:%p\tFI:%s\tFN:%s,%d", str_time, thread, file, func, line); | |
209 | header = g_strdup_printf ("TI:%s\tFI:%s\tFN:%s,%d", str_time, file, func, line); | |
142 | 210 | g_free (str_time); |
143 | 211 | |
144 | 212 | /* always in light green */ |
145 | pk_set_console_mode (CONSOLE_GREEN); | |
213 | egg_debug_set_console_mode (CONSOLE_GREEN); | |
146 | 214 | printf ("%s\n", header); |
147 | 215 | |
148 | 216 | /* different colors according to the severity */ |
149 | pk_set_console_mode (color); | |
217 | egg_debug_set_console_mode (color); | |
150 | 218 | printf (" - %s\n", buffer); |
151 | pk_set_console_mode (CONSOLE_RESET); | |
219 | egg_debug_set_console_mode (CONSOLE_RESET); | |
152 | 220 | |
153 | 221 | /* log to a file */ |
154 | if (egg_debug_is_logging ()) { | |
155 | pk_log_line (header); | |
156 | pk_log_line (buffer); | |
222 | if (_log_filename != NULL) { | |
223 | egg_debug_log_line (header); | |
224 | egg_debug_log_line (buffer); | |
157 | 225 | } |
158 | 226 | |
159 | 227 | /* flush this output, as we need to debug */ |
171 | 239 | va_list args; |
172 | 240 | gchar *buffer = NULL; |
173 | 241 | |
174 | if (!egg_debug_enabled ()) | |
242 | if (!_verbose && !egg_debug_filter_module (file) && !egg_debug_filter_function (func)) | |
175 | 243 | return; |
176 | 244 | |
177 | 245 | va_start (args, format); |
178 | 246 | g_vasprintf (&buffer, format, args); |
179 | 247 | va_end (args); |
180 | 248 | |
181 | pk_print_line (func, file, line, buffer, CONSOLE_BLUE); | |
182 | ||
183 | g_free(buffer); | |
249 | egg_debug_print_line (func, file, line, buffer, CONSOLE_BLUE); | |
250 | ||
251 | g_free (buffer); | |
184 | 252 | } |
185 | 253 | |
186 | 254 | /** |
192 | 260 | va_list args; |
193 | 261 | gchar *buffer = NULL; |
194 | 262 | |
195 | if (!egg_debug_enabled ()) | |
263 | if (!_verbose && !egg_debug_filter_module (file) && !egg_debug_filter_function (func)) | |
196 | 264 | return; |
197 | 265 | |
198 | 266 | va_start (args, format); |
200 | 268 | va_end (args); |
201 | 269 | |
202 | 270 | /* do extra stuff for a warning */ |
203 | if (!egg_debug_is_console ()) | |
271 | if (!_console) | |
204 | 272 | printf ("*** WARNING ***\n"); |
205 | pk_print_line (func, file, line, buffer, CONSOLE_RED); | |
206 | ||
207 | g_free(buffer); | |
273 | egg_debug_print_line (func, file, line, buffer, CONSOLE_RED); | |
274 | ||
275 | g_free (buffer); | |
208 | 276 | } |
209 | 277 | |
210 | 278 | /** |
221 | 289 | va_end (args); |
222 | 290 | |
223 | 291 | /* do extra stuff for a warning */ |
224 | if (!egg_debug_is_console ()) | |
292 | if (!_console) | |
225 | 293 | printf ("*** ERROR ***\n"); |
226 | pk_print_line (func, file, line, buffer, CONSOLE_RED); | |
227 | g_free(buffer); | |
294 | egg_debug_print_line (func, file, line, buffer, CONSOLE_RED); | |
295 | g_free (buffer); | |
228 | 296 | |
229 | 297 | /* we want to fix this! */ |
230 | 298 | egg_debug_backtrace (); |
233 | 301 | } |
234 | 302 | |
235 | 303 | /** |
236 | * egg_debug_enabled: | |
304 | * egg_debug_is_verbose: | |
237 | 305 | * |
238 | 306 | * Returns: TRUE if we have debugging enabled |
239 | 307 | **/ |
240 | 308 | gboolean |
241 | egg_debug_enabled (void) | |
242 | { | |
243 | const gchar *env; | |
244 | env = g_getenv (EGG_VERBOSE); | |
245 | return (g_strcmp0 (env, "1") == 0); | |
246 | } | |
247 | ||
248 | /** | |
249 | * egg_debug_is_logging: | |
250 | * | |
251 | * Returns: TRUE if we have logging enabled | |
309 | egg_debug_is_verbose (void) | |
310 | { | |
311 | return _verbose; | |
312 | } | |
313 | ||
314 | /** | |
315 | * egg_debug_set_log_filename: | |
316 | **/ | |
317 | void | |
318 | egg_debug_set_log_filename (const gchar *filename) | |
319 | { | |
320 | g_free (_log_filename); | |
321 | _log_filename = g_strdup (filename); | |
322 | } | |
323 | ||
324 | /** | |
325 | * egg_debug_strv_split_to_ptr_array: | |
326 | **/ | |
327 | static GPtrArray * | |
328 | egg_debug_strv_split_to_ptr_array (gchar **modules) | |
329 | { | |
330 | GPtrArray *array = NULL; | |
331 | guint i, j; | |
332 | gchar **split; | |
333 | ||
334 | /* nothing */ | |
335 | if (modules == NULL) | |
336 | goto out; | |
337 | ||
338 | /* create array of strings */ | |
339 | array = g_ptr_array_new_with_free_func (g_free); | |
340 | ||
341 | /* parse each --debug-foo option */ | |
342 | for (i=0; modules[i] != NULL; i++) { | |
343 | /* use a comma to delimit multiple entries */ | |
344 | split = g_strsplit (modules[i], ",", -1); | |
345 | for (j=0; split[j] != NULL; j++) | |
346 | g_ptr_array_add (array, g_strdup (split[j])); | |
347 | g_strfreev (split); | |
348 | } | |
349 | out: | |
350 | return array; | |
351 | } | |
352 | ||
353 | /** | |
354 | * egg_debug_pre_parse_hook: | |
355 | */ | |
356 | static gboolean | |
357 | egg_debug_pre_parse_hook (GOptionContext *context, GOptionGroup *group, gpointer data, GError **error) | |
358 | { | |
359 | const gchar *env_string; | |
360 | const GOptionEntry main_entries[] = { | |
361 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &_verbose, | |
362 | /* TRANSLATORS: turn on all debugging */ | |
363 | N_("Show debugging information for all files"), NULL }, | |
364 | { NULL} | |
365 | }; | |
366 | ||
367 | /* global variable */ | |
368 | env_string = g_getenv ("VERBOSE"); | |
369 | if (env_string != NULL) | |
370 | _verbose = TRUE; | |
371 | ||
372 | /* add main entry */ | |
373 | g_option_context_add_main_entries (context, main_entries, NULL); | |
374 | ||
375 | return TRUE; | |
376 | } | |
377 | ||
378 | /** | |
379 | * egg_debug_free: | |
380 | **/ | |
381 | static void | |
382 | egg_debug_free (void) | |
383 | { | |
384 | if (!_initialized) | |
385 | return; | |
386 | ||
387 | /* close file */ | |
388 | if (_fd != -1) | |
389 | close (_fd); | |
390 | ||
391 | /* free memory */ | |
392 | g_free (_log_filename); | |
393 | if (_modules_array != NULL) | |
394 | g_ptr_array_unref (_modules_array); | |
395 | if (_functions_array != NULL) | |
396 | g_ptr_array_unref (_functions_array); | |
397 | g_strfreev (_modules); | |
398 | g_strfreev (_functions); | |
399 | ||
400 | /* can not re-init */ | |
401 | _initialized = FALSE; | |
402 | } | |
403 | ||
404 | /** | |
405 | * egg_debug_post_parse_hook: | |
406 | */ | |
407 | static gboolean | |
408 | egg_debug_post_parse_hook (GOptionContext *context, GOptionGroup *group, gpointer data, GError **error) | |
409 | { | |
410 | _initialized = TRUE; | |
411 | _modules_array = egg_debug_strv_split_to_ptr_array (_modules); | |
412 | _functions_array = egg_debug_strv_split_to_ptr_array (_functions); | |
413 | _console = (isatty (fileno (stdout)) == 1); | |
414 | egg_debug ("Verbose debugging %i (on console %i)", _verbose, _console); | |
415 | ||
416 | /* run this function on cleanup */ | |
417 | atexit (egg_debug_free); | |
418 | ||
419 | return TRUE; | |
420 | } | |
421 | ||
422 | /** | |
423 | * egg_debug_get_option_group: | |
424 | * | |
425 | * Returns a #GOptionGroup for the commandline arguments recognized | |
426 | * by debugging. You should add this group to your #GOptionContext | |
427 | * with g_option_context_add_group(), if you are using | |
428 | * g_option_context_parse() to parse your commandline arguments. | |
429 | * | |
430 | * Returns: a #GOptionGroup for the commandline arguments | |
431 | */ | |
432 | GOptionGroup * | |
433 | egg_debug_get_option_group (void) | |
434 | { | |
435 | GOptionGroup *group; | |
436 | const GOptionEntry debug_entries[] = { | |
437 | { "debug-modules", '\0', 0, G_OPTION_ARG_STRING_ARRAY, &_modules, | |
438 | /* TRANSLATORS: a list of modules to debug */ | |
439 | N_("Debug these specific modules"), NULL }, | |
440 | { "debug-functions", '\0', 0, G_OPTION_ARG_STRING_ARRAY, &_functions, | |
441 | /* TRANSLATORS: a list of functions to debug */ | |
442 | N_("Debug these specific functions"), NULL }, | |
443 | { "debug-log-filename", '\0', 0, G_OPTION_ARG_STRING, &_log_filename, | |
444 | /* TRANSLATORS: save to a log */ | |
445 | N_("Log debugging data to a file"), NULL }, | |
446 | { NULL} | |
447 | }; | |
448 | ||
449 | group = g_option_group_new ("debug", _("Debugging Options"), _("Show debugging options"), NULL, NULL); | |
450 | g_option_group_set_parse_hooks (group, egg_debug_pre_parse_hook, egg_debug_post_parse_hook); | |
451 | g_option_group_add_entries (group, debug_entries); | |
452 | return group; | |
453 | } | |
454 | ||
455 | /** | |
456 | * egg_debug_init: | |
457 | * @argc: a pointer to the number of command line arguments. | |
458 | * @argv: a pointer to the array of command line arguments. | |
459 | * | |
460 | * Parses command line arguments. | |
461 | * | |
462 | * Return value: %TRUE if initialization succeeded, otherwise %FALSE. | |
252 | 463 | **/ |
253 | 464 | gboolean |
254 | egg_debug_is_logging (void) | |
255 | { | |
256 | const gchar *env; | |
257 | env = g_getenv (EGG_LOGGING); | |
258 | return (g_strcmp0 (env, "1") == 0); | |
259 | } | |
260 | ||
261 | /** | |
262 | * egg_debug_is_console: | |
263 | * | |
264 | * Returns: TRUE if we have debugging enabled | |
265 | **/ | |
266 | gboolean | |
267 | egg_debug_is_console (void) | |
268 | { | |
269 | const gchar *env; | |
270 | env = g_getenv (EGG_CONSOLE); | |
271 | return (g_strcmp0 (env, "1") == 0); | |
272 | } | |
273 | ||
274 | /** | |
275 | * egg_debug_set_logging: | |
276 | **/ | |
277 | void | |
278 | egg_debug_set_logging (gboolean enabled) | |
279 | { | |
280 | if (enabled) | |
281 | g_setenv (EGG_LOGGING, "1", TRUE); | |
282 | else | |
283 | g_setenv (EGG_LOGGING, "0", TRUE); | |
284 | ||
285 | if (egg_debug_is_logging ()) | |
286 | egg_debug ("logging to %s", EGG_LOG_FILE); | |
287 | } | |
288 | ||
289 | /** | |
290 | * egg_debug_init: | |
291 | * @debug: If we should print out verbose logging | |
292 | **/ | |
293 | void | |
294 | egg_debug_init (gboolean debug) | |
295 | { | |
296 | /* check if we are on console */ | |
297 | if (isatty (fileno (stdout)) == 1) | |
298 | g_setenv (EGG_CONSOLE, "1", FALSE); | |
299 | else | |
300 | g_setenv (EGG_CONSOLE, "0", FALSE); | |
301 | if (debug) | |
302 | g_setenv (EGG_VERBOSE, "1", FALSE); | |
303 | else | |
304 | g_setenv (EGG_VERBOSE, "0", FALSE); | |
305 | egg_debug ("Verbose debugging %i (on console %i)%s", egg_debug_enabled (), egg_debug_is_console (), EGG_VERBOSE); | |
306 | } | |
307 | ||
465 | egg_debug_init (gint *argc, gchar ***argv) | |
466 | { | |
467 | GOptionContext *context; | |
468 | ||
469 | /* already initialized */ | |
470 | if (_initialized) | |
471 | return TRUE; | |
472 | ||
473 | context = g_option_context_new (NULL); | |
474 | g_option_context_set_ignore_unknown_options (context, TRUE); | |
475 | g_option_context_add_group (context, egg_debug_get_option_group ()); | |
476 | g_option_context_parse (context, argc, argv, NULL); | |
477 | g_option_context_free (context); | |
478 | ||
479 | return TRUE; | |
480 | } | |
481 |
0 | 0 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- |
1 | 1 | * |
2 | * Copyright (C) 2007-2008 Richard Hughes <richard@hughsie.com> | |
2 | * Copyright (C) 2007-2009 Richard Hughes <richard@hughsie.com> | |
3 | 3 | * |
4 | 4 | * Licensed under the GNU General Public License Version 2 |
5 | 5 | * |
58 | 58 | #define egg_error(...) |
59 | 59 | #endif |
60 | 60 | |
61 | void egg_debug_init (gboolean debug); | |
62 | void egg_debug_set_logging (gboolean enabled); | |
63 | gboolean egg_debug_enabled (void); | |
64 | gboolean egg_debug_is_logging (void); | |
65 | gboolean egg_debug_is_console (void); | |
66 | void egg_debug_backtrace (void); | |
67 | void egg_debug_real (const gchar *func, | |
61 | gboolean egg_debug_init (gint *argc, | |
62 | gchar ***argv); | |
63 | GOptionGroup *egg_debug_get_option_group (void); | |
64 | gboolean egg_debug_is_verbose (void); | |
65 | void egg_debug_backtrace (void); | |
66 | void egg_debug_set_log_filename (const gchar *filename); | |
67 | void egg_debug_real (const gchar *func, | |
68 | 68 | const gchar *file, |
69 | int line, | |
69 | gint line, | |
70 | 70 | const gchar *format, ...) __attribute__((format (printf,4,5))); |
71 | void egg_warning_real (const gchar *func, | |
71 | void egg_warning_real (const gchar *func, | |
72 | 72 | const gchar *file, |
73 | int line, | |
73 | gint line, | |
74 | 74 | const gchar *format, ...) __attribute__((format (printf,4,5))); |
75 | void egg_error_real (const gchar *func, | |
75 | void egg_error_real (const gchar *func, | |
76 | 76 | const gchar *file, |
77 | int line, | |
77 | gint line, | |
78 | 78 | const gchar *format, ...) G_GNUC_NORETURN __attribute__((format (printf,4,5))); |
79 | 79 | |
80 | 80 | G_END_DECLS |