mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-02-03 09:00:28 +01:00
trivial: add some gtk-doc markup into libupower-glib and hook it up to the build system
This commit is contained in:
parent
69c06340a8
commit
27fada20be
15 changed files with 342 additions and 106 deletions
18
configure.ac
18
configure.ac
|
|
@ -12,18 +12,22 @@ AC_CONFIG_SRCDIR(src)
|
|||
AM_INIT_AUTOMAKE([1.9 tar-ustar dist-bzip2])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_MAINTAINER_MODE
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
GOBJECT_INTROSPECTION_CHECK([0.6.7])
|
||||
|
||||
# enable nice build output on automake1.11
|
||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||
|
||||
# use this in dkp-version.h
|
||||
# use this in up-version.h
|
||||
UP_MAJOR_VERSION=up_major_version
|
||||
UP_MINOR_VERSION=up_minor_version
|
||||
UP_MICRO_VERSION=up_micro_version
|
||||
AC_SUBST(VERSION)
|
||||
AC_SUBST(UP_MAJOR_VERSION)
|
||||
AC_SUBST(UP_MINOR_VERSION)
|
||||
AC_SUBST(UP_MICRO_VERSION)
|
||||
|
||||
# libtool versioning - this applies to devkit-power-gobject
|
||||
# libtool versioning - this applies to libupower-glib
|
||||
#
|
||||
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
|
||||
#
|
||||
|
|
@ -208,7 +212,7 @@ if test "x$GCC" = "xyes"; then
|
|||
fi
|
||||
|
||||
IT_PROG_INTLTOOL([0.40.0])
|
||||
GETTEXT_PACKAGE=DeviceKit-power
|
||||
GETTEXT_PACKAGE=UPower
|
||||
AC_SUBST([GETTEXT_PACKAGE])
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
|
||||
|
|
@ -237,8 +241,8 @@ po/Makefile.in
|
|||
|
||||
dnl ==========================================================================
|
||||
echo "
|
||||
DeviceKit-power $VERSION
|
||||
=======================
|
||||
UPower $VERSION
|
||||
=========================
|
||||
|
||||
prefix: ${prefix}
|
||||
libdir: ${libdir}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@
|
|||
|
||||
/* check whether a the version is above the compile time version.
|
||||
*/
|
||||
#define DKP_CHECK_VERSION(ver) \
|
||||
(DKP_COMPILE_VERSION > (ver) || \
|
||||
(DKP_COMPILE_VERSION == (ver)))
|
||||
#define DKP_CHECK_VERSION(ver) (1)
|
||||
|
||||
#endif /* __DKP_VERSION_H */
|
||||
|
|
|
|||
1
doc/.gitignore
vendored
1
doc/.gitignore
vendored
|
|
@ -12,4 +12,5 @@ html
|
|||
tmpl
|
||||
version.xml
|
||||
xml
|
||||
.libs
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ NULL =
|
|||
AUTOMAKE_OPTIONS = 1.7
|
||||
|
||||
# The name of the module.
|
||||
DOC_MODULE=upower
|
||||
DOC_MODULE=UPower
|
||||
|
||||
# The top-level SGML file.
|
||||
DOC_MAIN_SGML_FILE=upower-docs.xml
|
||||
|
|
@ -25,6 +25,7 @@ CFILE_GLOB=
|
|||
|
||||
# Headers to ignore
|
||||
IGNORE_HFILES= \
|
||||
config.h \
|
||||
$(NULL)
|
||||
|
||||
# CFLAGS and LDFLAGS for compiling scan program. Only needed
|
||||
|
|
@ -32,11 +33,16 @@ IGNORE_HFILES= \
|
|||
INCLUDES = \
|
||||
$(DBUS_GLIB_CFLAGS) \
|
||||
$(GLIB_CFLAGS) \
|
||||
-I$(top_srcdir)/policy \
|
||||
-I$(top_builddir)/policy \
|
||||
-I$(top_srcdir)/libupower-glib \
|
||||
-I$(top_builddir)/libupower-glib \
|
||||
$(NULL)
|
||||
|
||||
UPOWER_GLIB_LIBS = \
|
||||
$(top_builddir)/libupower-glib/libupower-glib.la \
|
||||
$(NULL)
|
||||
|
||||
GTKDOC_LIBS = \
|
||||
$(UPOWER_GLIB_LIBS) \
|
||||
$(DBUS_GLIB_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@
|
|||
<releaseinfo>Version &version;</releaseinfo>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>David</firstname>
|
||||
<surname>Zeuthen</surname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>davidz@redhat.com</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
<firstname>Richard</firstname>
|
||||
<surname>Hughes</surname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>richard@hughsie.com</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</authorgroup>
|
||||
|
||||
|
|
@ -69,6 +69,27 @@
|
|||
<xi:include href="dbus/org.freedesktop.UPower.QoS.ref.xml"/>
|
||||
</reference>
|
||||
|
||||
<reference id="libupower-glib">
|
||||
<title>libpackagekit GObjects</title>
|
||||
<partintro>
|
||||
<para>
|
||||
This part documents GObjects used in libupower-glib.
|
||||
</para>
|
||||
</partintro>
|
||||
<xi:include href="xml/up-client.xml"/>
|
||||
<xi:include href="xml/up-device.xml"/>
|
||||
</reference>
|
||||
|
||||
<reference id="libupower-glib-helpers">
|
||||
<title>libupower-glib helpers</title>
|
||||
<partintro>
|
||||
<para>
|
||||
This part documents helper funtions in libupower-glib.
|
||||
</para>
|
||||
</partintro>
|
||||
<xi:include href="xml/up-types.xml"/>
|
||||
</reference>
|
||||
|
||||
<reference id="tools-fileformats">
|
||||
<title>Manual Pages</title>
|
||||
<partintro>
|
||||
|
|
|
|||
|
|
@ -47,12 +47,6 @@ libupower_glib_la_CFLAGS = \
|
|||
EXTRA_DIST = \
|
||||
up-client.h \
|
||||
up-device.h \
|
||||
up-enum.h \
|
||||
up-history-item.h \
|
||||
up-qos-item.h \
|
||||
up-stats-item.h \
|
||||
up-wakeup-item.h \
|
||||
up-wakeups.h \
|
||||
up-version.h.in
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:up-client
|
||||
* @short_description: Main client object for accessing the UPower daemon
|
||||
*
|
||||
* A helper GObject to use for accessing UPower information, and to be notified
|
||||
* when it is changed.
|
||||
*
|
||||
* See also: #UpDevice
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
@ -35,7 +45,12 @@ static void up_client_finalize (GObject *object);
|
|||
|
||||
#define UP_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_CLIENT, UpClientPrivate))
|
||||
|
||||
struct UpClientPrivate
|
||||
/**
|
||||
* UpClientPrivate:
|
||||
*
|
||||
* Private #UpClient data
|
||||
**/
|
||||
struct _UpClientPrivate
|
||||
{
|
||||
DBusGConnection *bus;
|
||||
DBusGProxy *proxy;
|
||||
|
|
@ -76,9 +91,9 @@ static gpointer up_client_object = NULL;
|
|||
|
||||
G_DEFINE_TYPE (UpClient, up_client, G_TYPE_OBJECT)
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_client_get_device:
|
||||
**/
|
||||
*/
|
||||
static UpDevice *
|
||||
up_client_get_device (UpClient *client, const gchar *object_path)
|
||||
{
|
||||
|
|
@ -111,9 +126,9 @@ up_client_get_devices (UpClient *client)
|
|||
return g_ptr_array_ref (client->priv->array);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_client_get_devices_private:
|
||||
**/
|
||||
*/
|
||||
static GPtrArray *
|
||||
up_client_get_devices_private (UpClient *client, GError **error)
|
||||
{
|
||||
|
|
@ -139,8 +154,8 @@ up_client_get_devices_private (UpClient *client, GError **error)
|
|||
|
||||
/**
|
||||
* up_client_suspend_sync:
|
||||
* @client : a #UpClient instance.
|
||||
* @error : a #GError.
|
||||
* @client: a #UpClient instance.
|
||||
* @error: a #GError, or %NULL.
|
||||
*
|
||||
* Puts the computer into a low power state, but state is not preserved if the
|
||||
* power is lost.
|
||||
|
|
@ -182,8 +197,8 @@ out:
|
|||
|
||||
/**
|
||||
* up_client_hibernate_sync:
|
||||
* @client : a #UpClient instance.
|
||||
* @error : a #GError.
|
||||
* @client: a #UpClient instance.
|
||||
* @error: a #GError.
|
||||
*
|
||||
* Puts the computer into a low power state, where state is preserved if the
|
||||
* power is lost.
|
||||
|
|
@ -223,6 +238,14 @@ out:
|
|||
|
||||
/**
|
||||
* up_client_get_properties_sync:
|
||||
* @client: a #UpClient instance.
|
||||
* @error: a #GError, or %NULL.
|
||||
*
|
||||
* Get all the properties from UPower daemon.
|
||||
*
|
||||
* Return value: %TRUE for success, else %FALSE.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
gboolean
|
||||
up_client_get_properties_sync (UpClient *client, GError **error)
|
||||
|
|
@ -331,9 +354,9 @@ out:
|
|||
|
||||
/**
|
||||
* up_client_get_daemon_version:
|
||||
* @client : a #UpClient instance.
|
||||
* @client: a #UpClient instance.
|
||||
*
|
||||
* Get DeviceKit-power daemon version.
|
||||
* Get UPower daemon version.
|
||||
*
|
||||
* Return value: string containing the daemon version, e.g. 008
|
||||
*
|
||||
|
|
@ -349,7 +372,7 @@ up_client_get_daemon_version (UpClient *client)
|
|||
|
||||
/**
|
||||
* up_client_get_can_hibernate:
|
||||
* @client : a #UpClient instance.
|
||||
* @client: a #UpClient instance.
|
||||
*
|
||||
* Get whether the system is able to hibernate.
|
||||
*
|
||||
|
|
@ -367,7 +390,7 @@ up_client_get_can_hibernate (UpClient *client)
|
|||
|
||||
/**
|
||||
* up_client_get_lid_is_closed:
|
||||
* @client : a #UpClient instance.
|
||||
* @client: a #UpClient instance.
|
||||
*
|
||||
* Get whether the laptop lid is closed.
|
||||
*
|
||||
|
|
@ -383,7 +406,7 @@ up_client_get_lid_is_closed (UpClient *client)
|
|||
|
||||
/**
|
||||
* up_client_get_can_suspend:
|
||||
* @client : a #UpClient instance.
|
||||
* @client: a #UpClient instance.
|
||||
*
|
||||
* Get whether the system is able to suspend.
|
||||
*
|
||||
|
|
@ -401,7 +424,7 @@ up_client_get_can_suspend (UpClient *client)
|
|||
|
||||
/**
|
||||
* up_client_get_on_battery:
|
||||
* @client : a #UpClient instance.
|
||||
* @client: a #UpClient instance.
|
||||
*
|
||||
* Get whether the system is running on battery power.
|
||||
*
|
||||
|
|
@ -419,7 +442,7 @@ up_client_get_on_battery (UpClient *client)
|
|||
|
||||
/**
|
||||
* up_client_get_on_low_battery:
|
||||
* @client : a #UpClient instance.
|
||||
* @client: a #UpClient instance.
|
||||
*
|
||||
* Get whether the system is running on low battery power.
|
||||
*
|
||||
|
|
@ -435,9 +458,9 @@ up_client_get_on_low_battery (UpClient *client)
|
|||
return client->priv->on_low_battery;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_client_add:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_client_add (UpClient *client, const gchar *object_path)
|
||||
{
|
||||
|
|
@ -457,18 +480,18 @@ out:
|
|||
g_object_unref (device);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_client_added_cb:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_device_added_cb (DBusGProxy *proxy, const gchar *object_path, UpClient *client)
|
||||
{
|
||||
up_client_add (client, object_path);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_client_changed_cb:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_device_changed_cb (DBusGProxy *proxy, const gchar *object_path, UpClient *client)
|
||||
{
|
||||
|
|
@ -478,9 +501,9 @@ up_device_changed_cb (DBusGProxy *proxy, const gchar *object_path, UpClient *cli
|
|||
g_signal_emit (client, signals [UP_CLIENT_DEVICE_CHANGED], 0, device);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_client_removed_cb:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_device_removed_cb (DBusGProxy *proxy, const gchar *object_path, UpClient *client)
|
||||
{
|
||||
|
|
@ -492,9 +515,9 @@ up_device_removed_cb (DBusGProxy *proxy, const gchar *object_path, UpClient *cli
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_client_changed_cb:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_client_changed_cb (DBusGProxy *proxy, UpClient *client)
|
||||
{
|
||||
|
|
@ -541,10 +564,10 @@ up_client_get_property (GObject *object,
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_client_class_init:
|
||||
* @klass: The UpClientClass
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_client_class_init (UpClientClass *klass)
|
||||
{
|
||||
|
|
@ -652,24 +675,62 @@ up_client_class_init (UpClientClass *klass)
|
|||
FALSE,
|
||||
G_PARAM_READABLE));
|
||||
|
||||
/**
|
||||
* UpClient::device-added:
|
||||
* @client: the #UpClient instance that emitted the signal
|
||||
* @device: the #UpDevice that was added.
|
||||
*
|
||||
* The ::device-added signal is emitted when a power device is added.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
signals [UP_CLIENT_DEVICE_ADDED] =
|
||||
g_signal_new ("device-added",
|
||||
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (UpClientClass, device_added),
|
||||
NULL, NULL, g_cclosure_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE, 1, G_TYPE_POINTER);
|
||||
NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1, UP_TYPE_DEVICE);
|
||||
|
||||
/**
|
||||
* UpClient::device-removed:
|
||||
* @client: the #UpClient instance that emitted the signal
|
||||
* @device: the #UpDevice that was removed.
|
||||
*
|
||||
* The ::device-added signal is emitted when a power device is removed.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
signals [UP_CLIENT_DEVICE_REMOVED] =
|
||||
g_signal_new ("device-removed",
|
||||
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (UpClientClass, device_removed),
|
||||
NULL, NULL, g_cclosure_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE, 1, G_TYPE_POINTER);
|
||||
NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1, UP_TYPE_DEVICE);
|
||||
|
||||
/**
|
||||
* UpClient::device-changed:
|
||||
* @client: the #UpClient instance that emitted the signal
|
||||
* @device: the #UpDevice that was changed.
|
||||
*
|
||||
* The ::device-changed signal is emitted when a power device is changed.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
signals [UP_CLIENT_DEVICE_CHANGED] =
|
||||
g_signal_new ("device-changed",
|
||||
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (UpClientClass, device_changed),
|
||||
NULL, NULL, g_cclosure_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE, 1, G_TYPE_POINTER);
|
||||
NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1, UP_TYPE_DEVICE);
|
||||
|
||||
/**
|
||||
* UpClient::changed:
|
||||
* @client: the #UpDevice instance that emitted the signal
|
||||
*
|
||||
* The ::changed signal is emitted when properties may have changed.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
signals [UP_CLIENT_CHANGED] =
|
||||
g_signal_new ("changed",
|
||||
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
|
||||
|
|
@ -682,6 +743,14 @@ up_client_class_init (UpClientClass *klass)
|
|||
|
||||
/**
|
||||
* up_client_enumerate_devices_sync:
|
||||
* @client: a #UpClient instance.
|
||||
* @error: a #GError, or %NULL.
|
||||
*
|
||||
* Enumerates all the devices from the daemon.
|
||||
*
|
||||
* Return value: %TRUE for success, else %FALSE.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
gboolean
|
||||
up_client_enumerate_devices_sync (UpClient *client, GError **error)
|
||||
|
|
@ -705,10 +774,10 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_client_init:
|
||||
* @client: This class instance
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_client_init (UpClient *client)
|
||||
{
|
||||
|
|
@ -764,9 +833,9 @@ out:
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_client_finalize:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_client_finalize (GObject *object)
|
||||
{
|
||||
|
|
@ -795,6 +864,8 @@ up_client_finalize (GObject *object)
|
|||
/**
|
||||
* up_client_new:
|
||||
*
|
||||
* Creates a new #UpClient object.
|
||||
*
|
||||
* Return value: a new UpClient object.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ G_BEGIN_DECLS
|
|||
#define UP_CLIENT_ERROR (up_client_error_quark ())
|
||||
#define UP_CLIENT_TYPE_ERROR (up_client_error_get_type ())
|
||||
|
||||
typedef struct UpClientPrivate UpClientPrivate;
|
||||
typedef struct _UpClientPrivate UpClientPrivate;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:up-device
|
||||
* @short_description: Client object for accessing information about UPower devices
|
||||
*
|
||||
* A helper GObject to use for accessing UPower devices, and to be notified
|
||||
* when it is changed.
|
||||
*
|
||||
* See also: #UpClient
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
@ -35,7 +45,12 @@ static void up_device_finalize (GObject *object);
|
|||
|
||||
#define UP_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE, UpDevicePrivate))
|
||||
|
||||
struct UpDevicePrivate
|
||||
/**
|
||||
* UpDevicePrivate:
|
||||
*
|
||||
* Private #PkDevice data
|
||||
**/
|
||||
struct _UpDevicePrivate
|
||||
{
|
||||
gchar *object_path;
|
||||
DBusGConnection *bus;
|
||||
|
|
@ -113,9 +128,9 @@ static guint signals [SIGNAL_LAST] = { 0 };
|
|||
|
||||
G_DEFINE_TYPE (UpDevice, up_device, G_TYPE_OBJECT)
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_get_device_properties:
|
||||
**/
|
||||
*/
|
||||
static GHashTable *
|
||||
up_device_get_device_properties (UpDevice *device, GError **error)
|
||||
{
|
||||
|
|
@ -138,9 +153,9 @@ out:
|
|||
return hash_table;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_collect_props_cb:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_device_collect_props_cb (const char *key, const GValue *value, UpDevice *device)
|
||||
{
|
||||
|
|
@ -209,9 +224,9 @@ up_device_collect_props_cb (const char *key, const GValue *value, UpDevice *devi
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_refresh_internal:
|
||||
**/
|
||||
*/
|
||||
static gboolean
|
||||
up_device_refresh_internal (UpDevice *device, GError **error)
|
||||
{
|
||||
|
|
@ -230,9 +245,9 @@ up_device_refresh_internal (UpDevice *device, GError **error)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_changed_cb:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_device_changed_cb (DBusGProxy *proxy, UpDevice *device)
|
||||
{
|
||||
|
|
@ -325,18 +340,18 @@ up_device_get_object_path (UpDevice *device)
|
|||
return device->priv->object_path;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_bool_to_string:
|
||||
**/
|
||||
*/
|
||||
static const gchar *
|
||||
up_device_bool_to_string (gboolean ret)
|
||||
{
|
||||
return ret ? "yes" : "no";
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_to_text_time_to_string:
|
||||
**/
|
||||
*/
|
||||
static gchar *
|
||||
up_device_to_text_time_to_string (gint seconds)
|
||||
{
|
||||
|
|
@ -359,6 +374,8 @@ up_device_to_text_time_to_string (gint seconds)
|
|||
/**
|
||||
* up_device_to_text:
|
||||
*
|
||||
* Converts the device to a string description.
|
||||
*
|
||||
* Return value: text representation of #UpDevice
|
||||
*
|
||||
* Since: 0.9.0
|
||||
|
|
@ -491,9 +508,9 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_set_property:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_device_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
|
|
@ -593,9 +610,9 @@ up_device_set_property (GObject *object, guint prop_id, const GValue *value, GPa
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_get_property:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_device_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
|
|
@ -689,9 +706,9 @@ up_device_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_class_init:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_device_class_init (UpDeviceClass *klass)
|
||||
{
|
||||
|
|
@ -701,7 +718,7 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
object_class->get_property = up_device_get_property;
|
||||
|
||||
/**
|
||||
* PkClient::changed:
|
||||
* UpDevice::changed:
|
||||
* @device: the #UpDevice instance that emitted the signal
|
||||
*
|
||||
* The ::changed signal is emitted when the device data has changed.
|
||||
|
|
@ -718,6 +735,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:update-time:
|
||||
*
|
||||
* The last time the device was updated.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -729,6 +748,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:vendor:
|
||||
*
|
||||
* The vendor of the device.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -740,6 +761,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:model:
|
||||
*
|
||||
* The model of the device.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -751,6 +774,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:serial:
|
||||
*
|
||||
* The serial number of the device.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -762,6 +787,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:native-path:
|
||||
*
|
||||
* The native path of the device, useful for direct device access.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -773,6 +800,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:power-supply:
|
||||
*
|
||||
* If the device is powering the system.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -784,6 +813,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:online:
|
||||
*
|
||||
* If the device is online, i.e. connected.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -795,6 +826,10 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:is-present:
|
||||
*
|
||||
* If the device is present, as some devices like laptop batteries
|
||||
* can be removed, leaving an empty bay that is still technically a
|
||||
* device.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -806,6 +841,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:is-rechargeable:
|
||||
*
|
||||
* If the device has a rechargable battery.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -817,6 +854,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:has-history:
|
||||
*
|
||||
* If the device has history data that might be useful.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -828,6 +867,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:has-statistics:
|
||||
*
|
||||
* If the device has statistics data that might be useful.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -839,6 +880,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:type:
|
||||
*
|
||||
* The device type, e.g. %UP_DEVICE_TYPE_KEYBOARD.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -852,6 +895,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:state:
|
||||
*
|
||||
* The state the device is in at this time, e.g. %UP_DEVICE_STATE_EMPTY.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -865,6 +910,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:technology:
|
||||
*
|
||||
* The battery technology e.g. %UP_DEVICE_TECHNOLOGY_LITHIUM_ION.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -878,6 +925,9 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:capacity:
|
||||
*
|
||||
* The percentage capacity of the device where 100% means the device has
|
||||
* the same charge potential as when it was manufactured.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -888,6 +938,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:energy:
|
||||
*
|
||||
* The energy left in the device. Measured in mWh.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -898,6 +950,9 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:energy-empty:
|
||||
*
|
||||
* The energy the device will have when it is empty. This is usually zero.
|
||||
* Measured in mWh.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -908,6 +963,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:energy-full:
|
||||
*
|
||||
* The amount of energy when the device is fully charged. Measured in mWh.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -918,6 +975,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:energy-full-design:
|
||||
*
|
||||
* The amount of energy when the device was brand new. Measured in mWh.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -928,6 +987,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:energy-rate:
|
||||
*
|
||||
* The rate of discharge or charge. Measured in mW.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -938,6 +999,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:voltage:
|
||||
*
|
||||
* The current voltage of the device.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -948,6 +1011,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:time-to-empty:
|
||||
*
|
||||
* The amount of time until the device is empty.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -958,6 +1023,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:time-to-full:
|
||||
*
|
||||
* The amount of time until the device is fully charged.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -968,6 +1035,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:percentage:
|
||||
*
|
||||
* The percentage charge of the device.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -978,6 +1047,10 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:recall-notice:
|
||||
*
|
||||
* If the device may be recalled due to defect. NOTE: This property does
|
||||
* not mean the battery is broken, and just that the user should
|
||||
* _check_ with the vendor.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -989,6 +1062,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:recall-vendor:
|
||||
*
|
||||
* The vendor that is recalling the device.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -1000,6 +1075,8 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
/**
|
||||
* UpDevice:recall-url:
|
||||
*
|
||||
* The vendors internet link for the recalled device.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
**/
|
||||
g_object_class_install_property (object_class,
|
||||
|
|
@ -1012,9 +1089,9 @@ up_device_class_init (UpDeviceClass *klass)
|
|||
g_type_class_add_private (klass, sizeof (UpDevicePrivate));
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_init:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_device_init (UpDevice *device)
|
||||
{
|
||||
|
|
@ -1024,9 +1101,9 @@ up_device_init (UpDevice *device)
|
|||
device->priv->proxy_props = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* up_device_finalize:
|
||||
**/
|
||||
*/
|
||||
static void
|
||||
up_device_finalize (GObject *object)
|
||||
{
|
||||
|
|
@ -1054,6 +1131,8 @@ up_device_finalize (GObject *object)
|
|||
/**
|
||||
* up_device_new:
|
||||
*
|
||||
* Creates a new #UpDevice object.
|
||||
*
|
||||
* Return value: a new UpDevice object.
|
||||
*
|
||||
* Since: 0.9.0
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ G_BEGIN_DECLS
|
|||
#define UP_DEVICE_ERROR (up_device_error_quark ())
|
||||
#define UP_DEVICE_TYPE_ERROR (up_device_error_get_type ())
|
||||
|
||||
typedef struct UpDevicePrivate UpDevicePrivate;
|
||||
typedef struct _UpDevicePrivate UpDevicePrivate;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
@ -76,14 +76,6 @@ gboolean up_device_refresh_sync (UpDevice *device,
|
|||
gboolean up_device_set_object_path_sync (UpDevice *device,
|
||||
const gchar *object_path,
|
||||
GError **error);
|
||||
GPtrArray *up_device_get_history_sync (UpDevice *device,
|
||||
const gchar *type,
|
||||
guint timespec,
|
||||
guint resolution,
|
||||
GError **error);
|
||||
GPtrArray *up_device_get_statistics_sync (UpDevice *device,
|
||||
const gchar *type,
|
||||
GError **error);
|
||||
|
||||
/* accessors */
|
||||
const gchar *up_device_get_object_path (UpDevice *device);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:up-types
|
||||
* @short_description: Types used by UPower and libupower-glib
|
||||
*
|
||||
* These helper functions provide a way to marshal enumerated values to
|
||||
* text and back again.
|
||||
*
|
||||
* See also: #UpClient, #UpDevice
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,11 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* UpDeviceType:
|
||||
*
|
||||
* The device type.
|
||||
**/
|
||||
typedef enum {
|
||||
UP_DEVICE_TYPE_UNKNOWN,
|
||||
UP_DEVICE_TYPE_LINE_POWER,
|
||||
|
|
@ -43,6 +48,11 @@ typedef enum {
|
|||
UP_DEVICE_TYPE_LAST
|
||||
} UpDeviceType;
|
||||
|
||||
/**
|
||||
* UpDeviceState:
|
||||
*
|
||||
* The device state.
|
||||
**/
|
||||
typedef enum {
|
||||
UP_DEVICE_STATE_UNKNOWN,
|
||||
UP_DEVICE_STATE_CHARGING,
|
||||
|
|
@ -54,6 +64,11 @@ typedef enum {
|
|||
UP_DEVICE_STATE_LAST
|
||||
} UpDeviceState;
|
||||
|
||||
/**
|
||||
* UpDeviceTechnology:
|
||||
*
|
||||
* The device technology.
|
||||
**/
|
||||
typedef enum {
|
||||
UP_DEVICE_TECHNOLOGY_UNKNOWN,
|
||||
UP_DEVICE_TECHNOLOGY_LITHIUM_ION,
|
||||
|
|
@ -65,6 +80,11 @@ typedef enum {
|
|||
UP_DEVICE_TECHNOLOGY_LAST
|
||||
} UpDeviceTechnology;
|
||||
|
||||
/**
|
||||
* UpQosType:
|
||||
*
|
||||
* The type of QOS request.
|
||||
**/
|
||||
typedef enum {
|
||||
UP_QOS_TYPE_UNKNOWN,
|
||||
UP_QOS_TYPE_NETWORK,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:up-version
|
||||
* @short_description: Obtains the version for the installed UPower
|
||||
*
|
||||
* These compile time macros allow the user to enable parts of client code
|
||||
* depending on the version of libupower-glib installed.
|
||||
*
|
||||
* See also: #UpClient, #UpDevice
|
||||
*/
|
||||
|
||||
#if !defined (__UPOWER_H_INSIDE__) && !defined (UP_COMPILATION)
|
||||
#error "Only <upower.h> can be included directly."
|
||||
#endif
|
||||
|
|
@ -26,14 +36,34 @@
|
|||
#ifndef __UP_VERSION_H
|
||||
#define __UP_VERSION_H
|
||||
|
||||
/* compile time version
|
||||
/**
|
||||
* UP_CHECK_VERSION:
|
||||
*
|
||||
* The compile-time major version
|
||||
*/
|
||||
#define UP_COMPILE_VERSION (0x@VERSION@)
|
||||
#define UP_MAJOR_VERSION (@UP_MAJOR_VERSION@)
|
||||
|
||||
/* check whether a the version is above the compile time version.
|
||||
/**
|
||||
* UP_CHECK_MINOR:
|
||||
*
|
||||
* The compile-time minor version
|
||||
*/
|
||||
#define UP_CHECK_VERSION(ver) \
|
||||
(UP_COMPILE_VERSION > (ver) || \
|
||||
(UP_COMPILE_VERSION == (ver)))
|
||||
#define UP_MINOR_VERSION (@UP_MINOR_VERSION@)
|
||||
|
||||
/**
|
||||
* UP_MICRO_VERSION:
|
||||
*
|
||||
* The compile-time micro version
|
||||
*/
|
||||
#define UP_MICRO_VERSION (@UP_MICRO_VERSION@)
|
||||
|
||||
/* check whether a UPower version equal to or greater than
|
||||
* major.minor.micro.
|
||||
*/
|
||||
#define UP_CHECK_VERSION(major,minor,micro) \
|
||||
(UP_MAJOR_VERSION > (major) || \
|
||||
(UP_MAJOR_VERSION == (major) && UP_MINOR_VERSION > (minor)) || \
|
||||
(UP_MAJOR_VERSION == (major) && UP_MINOR_VERSION == (minor) && \
|
||||
UP_MICRO_VERSION >= (micro)))
|
||||
|
||||
#endif /* __UP_VERSION_H */
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:upower
|
||||
* @short_description: Client objects for accessing UPower
|
||||
*
|
||||
* These objects allow client programs to trivially get details about the power
|
||||
* state, and about devices on the system.
|
||||
*
|
||||
* See also: #UpClient, #UpDevice
|
||||
*/
|
||||
|
||||
#ifndef __UPOWER_H__
|
||||
#define __UPOWER_H__
|
||||
|
||||
|
|
|
|||
4
po/it.po
4
po/it.po
|
|
@ -1,4 +1,4 @@
|
|||
# Italian translation for DeviceKit-power
|
||||
# Italian translation for UPower
|
||||
# Copyright (C) 2009 The Free Software Foundation, Inc
|
||||
# This file is distributed under the same license as the PolicyKit package.
|
||||
# Luca Ferretti <elle.uca@libero.it>, 2009.
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
# Milo Casagrande <milo@ubuntu.com>, 2009.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: DeviceKit-power 011\n"
|
||||
"Project-Id-Version: UPower 011\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-08-24 13:05+0200\n"
|
||||
"PO-Revision-Date: 2009-08-26 21:05+0200\n"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue