Commit 27fada20 authored by Richard Hughes's avatar Richard Hughes

trivial: add some gtk-doc markup into libupower-glib and hook it up to the build system

parent 69c06340
......@@ -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 */
......@@ -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
{
......
This diff is collapsed.
......@@ -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_MAJOR_VERSION (@UP_MAJOR_VERSION@)
/**
* UP_CHECK_MINOR:
*
* The compile-time minor version
*/
#define UP_MINOR_VERSION (@UP_MINOR_VERSION@)
/**
* UP_MICRO_VERSION:
*
* The compile-time micro version
*/
#define UP_COMPILE_VERSION (0x@VERSION@)
#define UP_MICRO_VERSION (@UP_MICRO_VERSION@)
/* check whether a the version is above the compile time version.
/* check whether a UPower version equal to or greater than
* major.minor.micro.
*/
#define UP_CHECK_VERSION(ver) \
(UP_COMPILE_VERSION > (ver) || \
(UP_COMPILE_VERSION == (ver)))
#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__
......
# 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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment