[gnome-pilot/dbus] Add signals definations defined in gpilot-daemon.xml
- From: Halton Huo <haltonhuo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-pilot/dbus] Add signals definations defined in gpilot-daemon.xml
- Date: Mon, 8 Mar 2010 03:44:26 +0000 (UTC)
commit c9eb19a871ab7baf8c30487871eb63a09a99f45b
Author: Halton Huo <halton huo sun com>
Date: Thu Mar 4 18:30:51 2010 +0800
Add signals definations defined in gpilot-daemon.xml
gpilotd/gpilot-daemon.c | 188 +++++++++++++++++++++++++++++++++++++++++++++
gpilotd/gpilot-daemon.h | 58 +++++++++++++-
gpilotd/gpilot-daemon.xml | 2 +-
gpilotd/gpmarshal.list | 9 ++
4 files changed, 252 insertions(+), 5 deletions(-)
---
diff --git a/gpilotd/gpilot-daemon.c b/gpilotd/gpilot-daemon.c
index db4d6ea..9a216b3 100644
--- a/gpilotd/gpilot-daemon.c
+++ b/gpilotd/gpilot-daemon.c
@@ -30,6 +30,7 @@
#include "gnome-pilot-structures.h"
#include "queue_io.h"
#include "gnome-pilot-config.h"
+#include "gpmarshal.h"
#define DEBUG_CODE
@@ -48,6 +49,26 @@ struct GpilotDaemonPrivate
GHashTable *monitors;
};
+enum {
+ CONNECTED,
+ DISCONNECTED,
+ REQUEST_COMPLETED,
+ USERINFO_REQUESTED,
+ SYSINFO_REQUESTED,
+ CONDUIT_START,
+ CONDUIT_PROGRESS,
+ CONDUIT_END,
+ OVERALL_PROGRESS,
+ DAEMON_MESSAGE,
+ DAEMON_ERROR,
+ CONDUIT_MESSAGE,
+ CONDUIT_ERROR,
+ PAUSED,
+ LAST_SIGNAL
+};
+
+static guint signals [LAST_SIGNAL] = { 0, };
+
/** structure that carries a GSList to gchar* (IORs) for
each notification type */
@@ -1233,6 +1254,173 @@ gpilot_daemon_class_init (GpilotDaemonClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gpilot_daemon_finalize;
+
+ signals [CONNECTED] = g_signal_new ("connected",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, connected),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_UINT_STRING,
+ G_TYPE_NONE,
+ 3,
+ G_TYPE_STRING,
+ G_TYPE_UINT,
+ G_TYPE_STRING);
+ signals [DISCONNECTED] = g_signal_new ("disconnected",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, disconnected),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRING);
+ signals [REQUEST_COMPLETED] = g_signal_new ("request-completed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, request_completed),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_UINT,
+ G_TYPE_NONE,
+ 2,
+ G_TYPE_STRING,
+ G_TYPE_UINT);
+ signals [USERINFO_REQUESTED] = g_signal_new ("userinfo-requested",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, userinfo_requested),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_UINT_STRING,
+ G_TYPE_NONE,
+ 3,
+ G_TYPE_STRING,
+ G_TYPE_UINT,
+ G_TYPE_STRING);
+ signals [SYSINFO_REQUESTED] = g_signal_new ("sysinfo-requested",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, sysinfo_requested),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_UINT_UINT_UINT_STRING_STRING_STRING_UINT,
+ G_TYPE_NONE,
+ 8,
+ G_TYPE_STRING,
+ G_TYPE_UINT,
+ G_TYPE_UINT,
+ G_TYPE_UINT,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_UINT);
+ signals [CONDUIT_START] = g_signal_new ("conduit-start",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, conduit_start),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_STRING_STRING,
+ G_TYPE_NONE,
+ 3,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
+ signals [CONDUIT_PROGRESS] = g_signal_new ("conduit-progress",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, conduit_progress),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_STRING_UINT_UINT,
+ G_TYPE_NONE,
+ 4,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_UINT,
+ G_TYPE_UINT);
+ signals [CONDUIT_END] = g_signal_new ("conduit-end",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, conduit_end),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRING);
+ signals [OVERALL_PROGRESS] = g_signal_new ("overall-progress",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, overall_progress),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_UINT_UINT,
+ G_TYPE_NONE,
+ 3,
+ G_TYPE_STRING,
+ G_TYPE_UINT,
+ G_TYPE_UINT);
+ signals [DAEMON_MESSAGE] = g_signal_new ("daemon-message",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, daemon_message),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_STRING_STRING,
+ G_TYPE_NONE,
+ 3,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
+ signals [DAEMON_ERROR] = g_signal_new ("daemon-error",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, daemon_error),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_STRING,
+ G_TYPE_NONE,
+ 2,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
+ signals [CONDUIT_MESSAGE] = g_signal_new ("conduit-message",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, conduit_message),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_STRING_STRING,
+ G_TYPE_NONE,
+ 3,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
+ signals [CONDUIT_ERROR] = g_signal_new ("conduit-error",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, conduit_error),
+ NULL,
+ NULL,
+ gp_marshal_VOID__STRING_STRING_STRING,
+ G_TYPE_NONE,
+ 3,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
+ signals [PAUSED] = g_signal_new ("paused",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GpilotDaemonClass, paused),
+ NULL,
+ NULL,
+ gp_marshal_VOID__BOOLEAN,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_BOOLEAN);
}
static void
diff --git a/gpilotd/gpilot-daemon.h b/gpilotd/gpilot-daemon.h
index 1569fc4..0693963 100644
--- a/gpilotd/gpilot-daemon.h
+++ b/gpilotd/gpilot-daemon.h
@@ -48,10 +48,60 @@ typedef struct
typedef struct
{
GObjectClass parent_class;
- void (* connected) (GpilotDaemon *gpilot,
- const char *pilot_name,
- unsigned long *uid,
- const char *user);
+ void (* connected) (GpilotDaemon *gpilot,
+ const char *pilot_name,
+ unsigned long *uid,
+ const char *user);
+ void (* disconnected) (GpilotDaemon *gpilot,
+ const char *pilot_id);
+ void (* request_completed) (GpilotDaemon *gpilot,
+ const char *pilot_id,
+ unsigned long request_id);
+ void (* userinfo_requested) (GpilotDaemon *gpilot,
+ const char *device,
+ unsigned long uid,
+ const char *username);
+ void (* sysinfo_requested) (GpilotDaemon *gpilot,
+ const char *pilot_id,
+ int rom_size,
+ int ram_size,
+ int ram_free,
+ const char *name,
+ const char *manufacturer,
+ const char *creation,
+ int rom_version);
+ void (* conduit_start) (GpilotDaemon *gpilot,
+ const char *pilot_id,
+ const char *conduit,
+ const char *database);
+ void (* conduit_progress) (GpilotDaemon *gpilot,
+ const char *pilot_id,
+ const char *conduit,
+ unsigned long current,
+ unsigned long total);
+ void (* conduit_end) (GpilotDaemon *gpilot,
+ const char *pilot_id);
+ void (* overall_progress) (GpilotDaemon *gpilot,
+ const char *pilot_id,
+ unsigned long current,
+ unsigned long total);
+ void (* daemon_message) (GpilotDaemon *gpilot,
+ const char *pilot_id,
+ const char *conduit,
+ const char *message);
+ void (* daemon_error) (GpilotDaemon *gpilot,
+ const char *pilot_id,
+ const char *message);
+ void (* conduit_message) (GpilotDaemon *gpilot,
+ const char *pilot_id,
+ const char *conduit,
+ const char *message);
+ void (* conduit_error) (GpilotDaemon *gpilot,
+ const char *pilot_id,
+ const char *conduit,
+ const char *message);
+ void (* paused) (GpilotDaemon *gpilot,
+ gboolean on_ff);
} GpilotDaemonClass;
typedef struct {
diff --git a/gpilotd/gpilot-daemon.xml b/gpilotd/gpilot-daemon.xml
index 4aa4c3a..3d92cd8 100644
--- a/gpilotd/gpilot-daemon.xml
+++ b/gpilotd/gpilot-daemon.xml
@@ -801,7 +801,7 @@
</signal>
<signal name="Paused">
- <arg name="on" type="b">
+ <arg name="on_off" type="b">
<doc:doc>
<doc:summary>Indicate pause on or off.</doc:summary>
</doc:doc>
diff --git a/gpilotd/gpmarshal.list b/gpilotd/gpmarshal.list
index 97afc71..8c6b7bb 100644
--- a/gpilotd/gpmarshal.list
+++ b/gpilotd/gpmarshal.list
@@ -5,3 +5,12 @@ INT:POINTER,BOOL
INT:POINTER,INT,INT
INT:POINTER
INT:NONE
+VOID:STRING
+VOID:BOOLEAN
+VOID:STRING,UINT
+VOID:STRING,STRING
+VOID:STRING,UINT,STRING
+VOID:STRING,STRING,STRING
+VOID:STRING,STRING,UINT,UINT
+VOID:STRING,UINT,UINT
+VOID:STRING,UINT,UINT,UINT,STRING,STRING,STRING,UINT
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]