~ubuntu-branches/debian/sid/upower/sid

« back to all changes in this revision

Viewing changes to libupower-glib/up-client.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2014-08-26 23:04:36 UTC
  • mfrom: (17.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20140826230436-u4i8mk38dyty8gz5
Tags: 0.99.1-2
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        PROP_ON_BATTERY,
68
68
        PROP_LID_IS_CLOSED,
69
69
        PROP_LID_IS_PRESENT,
70
 
        PROP_IS_DOCKED,
71
70
        PROP_LAST
72
71
};
73
72
 
131
130
 * @client: a #UpClient instance.
132
131
 *
133
132
 * Get the composite display device.
134
 
 * Return value: (transfer full) a #UpClient object, or %NULL on error.
 
133
 * Return value: (transfer full): a #UpClient object, or %NULL on error.
135
134
 *
136
135
 * Since: 1.0
137
136
 **/
227
226
}
228
227
 
229
228
/**
230
 
 * up_client_get_is_docked:
231
 
 * @client: a #UpClient instance.
232
 
 *
233
 
 * Get whether the machine is docked into a docking station.
234
 
 *
235
 
 * Return value: %TRUE if the machine is docked
236
 
 *
237
 
 * Since: 0.9.2
238
 
 */
239
 
gboolean
240
 
up_client_get_is_docked (UpClient *client)
241
 
{
242
 
        g_return_val_if_fail (UP_IS_CLIENT (client), FALSE);
243
 
        return up_client_glue_get_is_docked (client->priv->proxy);
244
 
}
245
 
 
246
 
/**
247
229
 * up_client_get_on_battery:
248
230
 * @client: a #UpClient instance.
249
231
 *
250
232
 * Get whether the system is running on battery power.
251
233
 *
252
 
 * Return value: TRUE if the system is currently running on battery, FALSE other wise.
 
234
 * Return value: %TRUE if the system is currently running on battery, %FALSE otherwise.
253
235
 *
254
236
 * Since: 0.9.0
255
237
 **/
322
304
        UpClient *client;
323
305
        client = UP_CLIENT (object);
324
306
 
 
307
        if (client->priv->proxy == NULL)
 
308
                return;
 
309
 
325
310
        switch (prop_id) {
326
311
        case PROP_DAEMON_VERSION:
327
312
                g_value_set_string (value, up_client_glue_get_daemon_version (client->priv->proxy));
335
320
        case PROP_LID_IS_PRESENT:
336
321
                g_value_set_boolean (value, up_client_glue_get_lid_is_present (client->priv->proxy));
337
322
                break;
338
 
        case PROP_IS_DOCKED:
339
 
                g_value_set_boolean (value, up_client_glue_get_is_docked (client->priv->proxy));
340
 
                break;
341
323
        default:
342
324
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
343
325
                break;
414
396
                                                               G_PARAM_READABLE));
415
397
 
416
398
        /**
417
 
         * UpClient:is-docked:
418
 
         *
419
 
         * If the laptop is docked
420
 
         *
421
 
         * Since: 0.9.8
422
 
         */
423
 
        g_object_class_install_property (object_class,
424
 
                                         PROP_IS_DOCKED,
425
 
                                         g_param_spec_boolean ("is-docked",
426
 
                                                               "If a laptop is docked",
427
 
                                                               NULL,
428
 
                                                               FALSE,
429
 
                                                               G_PARAM_READABLE));
430
 
 
431
 
        /**
432
399
         * UpClient::device-added:
433
400
         * @client: the #UpClient instance that emitted the signal
434
401
         * @device: the #UpDevice that was added.