Commit 21012c7d authored by Richard Hughes's avatar Richard Hughes

trivial: add some more gtk-doc markup to the new objects

parent af56b087
......@@ -111,10 +111,10 @@ typedef DkpQosType UpQosType;
#define UP_DEVICE_TECHNOLOGY_NICKEL_CADMIUM DKP_DEVICE_TECHNOLOGY_NICKEL_CADMIUM
#define UP_DEVICE_TECHNOLOGY_NICKEL_METAL_HYDRIDE DKP_DEVICE_TECHNOLOGY_NICKEL_METAL_HYDRIDE
#define UP_DEVICE_TECHNOLOGY_LAST DKP_DEVICE_TECHNOLOGY_LAST
#define UP_QOS_TYPE_UNKNOWN DKP_QOS_TYPE_UNKNOWN
#define UP_QOS_TYPE_NETWORK DKP_QOS_TYPE_NETWORK
#define UP_QOS_TYPE_CPU_DMA DKP_QOS_TYPE_CPU_DMA
#define UP_QOS_TYPE_LAST DKP_QOS_TYPE_LAST
#define UP_QOS_KIND_UNKNOWN DKP_QOS_TYPE_UNKNOWN
#define UP_QOS_KIND_NETWORK DKP_QOS_TYPE_NETWORK
#define UP_QOS_KIND_CPU_DMA DKP_QOS_TYPE_CPU_DMA
#define UP_QOS_KIND_LAST DKP_QOS_TYPE_LAST
const gchar *dkp_device_type_to_text (DkpDeviceType type_enum);
const gchar *dkp_device_state_to_text (DkpDeviceState state_enum);
......
......@@ -19,6 +19,16 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* SECTION:up-history-item
* @short_description: Helper object representing one item of historical data.
*
* This object represents one item of data which may be returned from the
* daemon in response to a query.
*
* See also: #UpDevice, #UpClient
*/
#include "config.h"
#include <glib.h>
......
......@@ -19,6 +19,16 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* SECTION:up-qos-item
* @short_description: Helper object representing one item of QOS data.
*
* This object represents one item of data which may be returned from the
* daemon in response to a query.
*
* See also: #UpDevice, #UpClient
*/
#include "config.h"
#include <glib.h>
......@@ -545,7 +555,7 @@ up_qos_item_class_init (UpQosItemClass *klass)
g_object_class_install_property (object_class,
PROP_TYPE,
g_param_spec_uint ("type", NULL, NULL,
0, G_MAXUINT, UP_QOS_TYPE_UNKNOWN,
0, G_MAXUINT, UP_QOS_KIND_UNKNOWN,
G_PARAM_READWRITE));
/**
* UpQosItem:value:
......@@ -577,7 +587,7 @@ up_qos_item_init (UpQosItem *qos_item)
qos_item->priv->cookie = 0;
qos_item->priv->timespec = 0;
qos_item->priv->persistent = FALSE;
qos_item->priv->type = UP_QOS_TYPE_UNKNOWN;
qos_item->priv->type = UP_QOS_KIND_UNKNOWN;
qos_item->priv->value = 0;
}
......
......@@ -19,6 +19,16 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* SECTION:up-stats-item
* @short_description: Helper object representing one item of statistics data.
*
* This object represents one item of data which may be returned from the
* daemon in response to a query.
*
* See also: #UpDevice, #UpClient
*/
#include "config.h"
#include <glib.h>
......
......@@ -261,9 +261,9 @@ up_device_technology_from_string (const gchar *technology)
const gchar *
up_qos_kind_to_string (UpQosKind type)
{
if (type == UP_QOS_TYPE_NETWORK)
if (type == UP_QOS_KIND_NETWORK)
return "network";
if (type == UP_QOS_TYPE_CPU_DMA)
if (type == UP_QOS_KIND_CPU_DMA)
return "cpu_dma";
return NULL;
}
......@@ -281,9 +281,9 @@ UpQosKind
up_qos_kind_from_string (const gchar *type)
{
if (g_strcmp0 (type, "network") == 0)
return UP_QOS_TYPE_NETWORK;
return UP_QOS_KIND_NETWORK;
if (g_strcmp0 (type, "cpu_dma") == 0)
return UP_QOS_TYPE_CPU_DMA;
return UP_QOS_TYPE_UNKNOWN;
return UP_QOS_KIND_CPU_DMA;
return UP_QOS_KIND_UNKNOWN;
}
......@@ -86,10 +86,10 @@ typedef enum {
* The type of QOS request.
**/
typedef enum {
UP_QOS_TYPE_UNKNOWN,
UP_QOS_TYPE_NETWORK,
UP_QOS_TYPE_CPU_DMA,
UP_QOS_TYPE_LAST
UP_QOS_KIND_UNKNOWN,
UP_QOS_KIND_NETWORK,
UP_QOS_KIND_CPU_DMA,
UP_QOS_KIND_LAST
} UpQosKind;
const gchar *up_device_kind_to_string (UpDeviceKind type_enum);
......
......@@ -19,6 +19,16 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* SECTION:up-wakeup-item
* @short_description: Helper object representing one item of wakeup data.
*
* This object represents one item of data which may be returned from the
* daemon in response to a query.
*
* See also: #UpDevice, #UpClient
*/
#include "config.h"
#include <glib.h>
......
......@@ -59,9 +59,9 @@ static void up_qos_finalize (GObject *object);
struct UpQosPrivate
{
GPtrArray *data;
gint fd[UP_QOS_TYPE_LAST];
gint last[UP_QOS_TYPE_LAST];
gint minimum[UP_QOS_TYPE_LAST];
gint fd[UP_QOS_KIND_LAST];
gint last[UP_QOS_KIND_LAST];
gint minimum[UP_QOS_KIND_LAST];
UpPolkit *polkit;
DBusGConnection *connection;
DBusGProxy *proxy;
......@@ -256,7 +256,7 @@ up_qos_request_latency (UpQos *qos, const gchar *type_text, gint value, gboolean
/* get correct data */
type = up_qos_type_from_text (type_text);
if (type == UP_QOS_TYPE_UNKNOWN) {
if (type == UP_QOS_KIND_UNKNOWN) {
error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "type invalid: %s", type_text);
dbus_g_method_return_error (context, error);
goto out;
......@@ -411,7 +411,7 @@ up_qos_get_latency (UpQos *qos, const gchar *type_text, gint *value, GError **er
/* get correct data */
type = up_qos_type_from_text (type_text);
if (type == UP_QOS_TYPE_UNKNOWN) {
if (type == UP_QOS_KIND_UNKNOWN) {
g_set_error (error, UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "type invalid: %s", type_text);
return FALSE;
}
......@@ -432,7 +432,7 @@ up_qos_set_minimum_latency (UpQos *qos, const gchar *type_text, gint value, DBus
/* type valid? */
type = up_qos_type_from_text (type_text);
if (type == UP_QOS_TYPE_UNKNOWN) {
if (type == UP_QOS_KIND_UNKNOWN) {
error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "type invalid: %s", type_text);
dbus_g_method_return_error (context, error);
return;
......@@ -560,18 +560,18 @@ up_qos_init (UpQos *qos)
/* TODO: need to load persistent values */
/* setup lowest */
for (i=0; i<UP_QOS_TYPE_LAST; i++)
for (i=0; i<UP_QOS_KIND_LAST; i++)
qos->priv->last[i] = up_qos_get_lowest (qos, i);
/* setup minimum */
for (i=0; i<UP_QOS_TYPE_LAST; i++)
for (i=0; i<UP_QOS_KIND_LAST; i++)
qos->priv->minimum[i] = -1;
qos->priv->fd[UP_QOS_TYPE_CPU_DMA] = open ("/dev/cpu_dma_latency", O_WRONLY);
if (qos->priv->fd[UP_QOS_TYPE_CPU_DMA] < 0)
qos->priv->fd[UP_QOS_KIND_CPU_DMA] = open ("/dev/cpu_dma_latency", O_WRONLY);
if (qos->priv->fd[UP_QOS_KIND_CPU_DMA] < 0)
egg_warning ("cannot open cpu_dma device file");
qos->priv->fd[UP_QOS_TYPE_NETWORK] = open ("/dev/network_latency", O_WRONLY);
if (qos->priv->fd[UP_QOS_TYPE_NETWORK] < 0)
qos->priv->fd[UP_QOS_KIND_NETWORK] = open ("/dev/network_latency", O_WRONLY);
if (qos->priv->fd[UP_QOS_KIND_NETWORK] < 0)
egg_warning ("cannot open network device file");
qos->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
......@@ -609,7 +609,7 @@ up_qos_finalize (GObject *object)
qos->priv = UP_QOS_GET_PRIVATE (qos);
/* close files */
for (i=0; i<UP_QOS_TYPE_LAST; i++) {
for (i=0; i<UP_QOS_KIND_LAST; i++) {
if (qos->priv->fd[i] > 0)
close (qos->priv->fd[i]);
}
......
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