~ubuntu-branches/ubuntu/warty/gnome-pilot/warty

« back to all changes in this revision

Viewing changes to gpilotd/gnome-pilot-client.c

  • Committer: Bazaar Package Importer
  • Author(s): Mike Markley
  • Date: 2001-12-15 02:46:06 UTC
  • Revision ID: james.westby@ubuntu.com-20011215024606-7xu0i6y4v6okdiij
Tags: upstream-0.1.64
ImportĀ upstreamĀ versionĀ 0.1.64

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Generated by GOB (v1.0.10) on Mon Dec  3 03:10:36 2001
 
2
   (do not edit directly) */
 
3
 
 
4
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
 
5
 
 
6
#define GOB_VERSION_MAJOR 1
 
7
#define GOB_VERSION_MINOR 0
 
8
#define GOB_VERSION_PATCHLEVEL 10
 
9
 
 
10
#include "gnome-pilot-client.h"
 
11
 
 
12
#include "gnome-pilot-client-private.h"
 
13
 
 
14
 
 
15
#line 62 "gnome-pilot-client.gob"
 
16
 
 
17
 
 
18
#include <sys/types.h>
 
19
#include <signal.h>
 
20
        
 
21
typedef struct {
 
22
        POA_GNOME_Pilot_Client servant;
 
23
        GnomePilotClient *self;
 
24
} GnomePilotClientServant;
 
25
 
 
26
GnomePilotClient* get_self (PortableServer_Servant servant);
 
27
pid_t gpilotd_get_pid (void);
 
28
 
 
29
PortableServer_ServantBase__epv base_epv = {
 
30
        NULL,
 
31
        NULL,
 
32
        NULL
 
33
};
 
34
 
 
35
static POA_GNOME_Pilot_Client__epv  gnome_pilot_client_epv;
 
36
static POA_GNOME_Pilot_Client__vepv gnome_pilot_client_vepv = { &base_epv, &gnome_pilot_client_epv };
 
37
 
 
38
enum get_triple_ptr_action {
 
39
        GPILOTD_APP_PILOT_NAMES,
 
40
        GPILOTD_APP_PILOT_IDS,
 
41
        GPILOTD_APP_PILOTS_BY_NAME,
 
42
        GPILOTD_APP_PILOTS_BY_LOGIN,
 
43
        GPILOTD_APP_USER_NAMES,
 
44
        GPILOTD_APP_DATABASES_FROM_CACHE,
 
45
        GPILOTD_APP_CRADLES
 
46
};
 
47
 
 
48
#ifdef WITH_VFS
 
49
gboolean xfer_callback (GnomeVFSXferProgressInfo *info,
 
50
                        GnomePilotClient *this);
 
51
#endif
 
52
 
 
53
 
 
54
#line 55 "gnome-pilot-client.c"
 
55
/* self casting macros */
 
56
#define SELF(x) GNOME_PILOT_CLIENT(x)
 
57
#define SELF_CONST(x) GNOME_PILOT_CLIENT_CONST(x)
 
58
#define IS_SELF(x) GNOME_IS_PILOT_CLIENT(x)
 
59
#define TYPE_SELF GNOME_TYPE_PILOT_CLIENT
 
60
#define SELF_CLASS(x) GNOME_PILOT_CLIENT_CLASS(x)
 
61
 
 
62
#define SELF_GET_CLASS(x) GNOME_PILOT_CLIENT_GET_CLASS(x)
 
63
 
 
64
/* self typedefs */
 
65
typedef GnomePilotClient Self;
 
66
typedef GnomePilotClientClass SelfClass;
 
67
 
 
68
/* GTK_CLASS_TYPE for 1.2<->1.3/2.0 GTK+ compatibility */
 
69
#ifndef GTK_CLASS_TYPE
 
70
#define GTK_CLASS_TYPE(x) (GTK_OBJECT_CLASS(x)->type)
 
71
#endif /* GTK_CLASS_TYPE */
 
72
 
 
73
/* here are local prototypes */
 
74
static void gnome_pilot_client_class_init (GnomePilotClientClass * class) G_GNUC_UNUSED;
 
75
static ORBit_MessageValidationResult gnome_pilot_client_accept_all_cookies (CORBA_unsigned_long request_id, CORBA_Principal * principal, CORBA_char * operation) G_GNUC_UNUSED;
 
76
static void gnome_pilot_client_init_corba_class (GnomePilotClient * self) G_GNUC_UNUSED;
 
77
static void gnome_pilot_client_init (GnomePilotClient * self) G_GNUC_UNUSED;
 
78
static CORBA_char * gnome_pilot_client_corba_get_client_id (PortableServer_Servant servant, CORBA_Environment * ev) G_GNUC_UNUSED;
 
79
static void gnome_pilot_client_corba_set_client_id (PortableServer_Servant servant, const CORBA_char * id, CORBA_Environment * ev) G_GNUC_UNUSED;
 
80
static void gnome_pilot_client_corba_connect (PortableServer_Servant servant, const CORBA_char * pilot_id, const GNOME_Pilot_UserInfo * user, CORBA_Environment * ev) G_GNUC_UNUSED;
 
81
static void gnome_pilot_client_corba_disconnect (PortableServer_Servant servant, const CORBA_char * pilot_id, CORBA_Environment * ev) G_GNUC_UNUSED;
 
82
static void gnome_pilot_client_corba_request_completed (PortableServer_Servant servant, const CORBA_char * pilot_id, CORBA_unsigned_long id, CORBA_Environment * ev) G_GNUC_UNUSED;
 
83
static void gnome_pilot_client_corba_user_info_requested (PortableServer_Servant servant, const CORBA_char * pilot_id, const GNOME_Pilot_UserInfo * user, CORBA_Environment * ev) G_GNUC_UNUSED;
 
84
static void gnome_pilot_client_corba_system_info_requested (PortableServer_Servant servant, const CORBA_char * device, const GNOME_Pilot_SysInfo * sysinfo, CORBA_Environment * ev) G_GNUC_UNUSED;
 
85
static void gnome_pilot_client_corba_conduit_start (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * database, CORBA_Environment * ev) G_GNUC_UNUSED;
 
86
static void gnome_pilot_client_corba_conduit_end (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, CORBA_Environment * ev) G_GNUC_UNUSED;
 
87
static void gnome_pilot_client_corba_overall_progress (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_unsigned_long current, const CORBA_unsigned_long total, CORBA_Environment * ev) G_GNUC_UNUSED;
 
88
static void gnome_pilot_client_corba_conduit_progress (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_unsigned_long current, const CORBA_unsigned_long total, CORBA_Environment * ev) G_GNUC_UNUSED;
 
89
static void gnome_pilot_client_corba_conduit_message (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * message, CORBA_Environment * ev) G_GNUC_UNUSED;
 
90
static void gnome_pilot_client_corba_daemon_message (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * message, CORBA_Environment * ev) G_GNUC_UNUSED;
 
91
static void gnome_pilot_client_corba_daemon_error (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * message, CORBA_Environment * ev) G_GNUC_UNUSED;
 
92
static void gnome_pilot_client_corba_conduit_error (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * message, CORBA_Environment * ev) G_GNUC_UNUSED;
 
93
static void gnome_pilot_client_corba_pause (PortableServer_Servant servant, const CORBA_boolean on_off, CORBA_Environment * ev) G_GNUC_UNUSED;
 
94
static void ___real_gnome_pilot_client_pilot_connect (GnomePilotClient * self, const gchar * pilot_name, const GNOME_Pilot_UserInfo * userinfo);
 
95
static void ___real_gnome_pilot_client_pilot_disconnect (GnomePilotClient * self, const gchar * pilot_name);
 
96
static void ___real_gnome_pilot_client_completed_request (GnomePilotClient * self, const gchar * pilot_name, unsigned long request_id);
 
97
static void ___real_gnome_pilot_client_user_info (GnomePilotClient * self, const gchar * device, const GNOME_Pilot_UserInfo * userinfo);
 
98
static void ___real_gnome_pilot_client_system_info (GnomePilotClient * self, const gchar * device, const GNOME_Pilot_SysInfo * sysinfo);
 
99
static void ___real_gnome_pilot_client_start_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * database);
 
100
static void ___real_gnome_pilot_client_end_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name);
 
101
static void ___real_gnome_pilot_client_progress_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, guint current, guint total);
 
102
static void ___real_gnome_pilot_client_message_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message);
 
103
static void ___real_gnome_pilot_client_message_daemon (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message);
 
104
static void ___real_gnome_pilot_client_error_daemon (GnomePilotClient * self, const gchar * pilot_name, const gchar * message);
 
105
static void ___real_gnome_pilot_client_error_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message);
 
106
static void ___real_gnome_pilot_client_daemon_pause (GnomePilotClient * self, gboolean on_off);
 
107
static gint gnome_pilot_client_get_triple_ptr (GnomePilotClient * self, enum get_triple_ptr_action action, const gchar * name, GList ** output) G_GNUC_UNUSED;
 
108
 
 
109
typedef void  (*___Sig1) (GnomePilotClient *, gpointer , gpointer , gpointer);
 
110
 
 
111
static void
 
112
___marshal_Sig1 (GtkObject * object,
 
113
        GtkSignalFunc func,
 
114
        gpointer func_data,
 
115
        GtkArg * args)
 
116
{
 
117
        ___Sig1 rfunc;
 
118
 
 
119
        rfunc = (___Sig1)func;
 
120
 
 
121
        (*rfunc)((GnomePilotClient *)object,
 
122
                GTK_VALUE_POINTER(args[0]),
 
123
                GTK_VALUE_POINTER(args[1]),
 
124
                func_data);
 
125
}
 
126
 
 
127
 
 
128
typedef void  (*___Sig2) (GnomePilotClient *, gpointer , gpointer);
 
129
 
 
130
static void
 
131
___marshal_Sig2 (GtkObject * object,
 
132
        GtkSignalFunc func,
 
133
        gpointer func_data,
 
134
        GtkArg * args)
 
135
{
 
136
        ___Sig2 rfunc;
 
137
 
 
138
        rfunc = (___Sig2)func;
 
139
 
 
140
        (*rfunc)((GnomePilotClient *)object,
 
141
                GTK_VALUE_POINTER(args[0]),
 
142
                func_data);
 
143
}
 
144
 
 
145
 
 
146
typedef void  (*___Sig3) (GnomePilotClient *, gpointer , gint , gpointer);
 
147
 
 
148
static void
 
149
___marshal_Sig3 (GtkObject * object,
 
150
        GtkSignalFunc func,
 
151
        gpointer func_data,
 
152
        GtkArg * args)
 
153
{
 
154
        ___Sig3 rfunc;
 
155
 
 
156
        rfunc = (___Sig3)func;
 
157
 
 
158
        (*rfunc)((GnomePilotClient *)object,
 
159
                GTK_VALUE_POINTER(args[0]),
 
160
                GTK_VALUE_INT(args[1]),
 
161
                func_data);
 
162
}
 
163
 
 
164
 
 
165
typedef void  (*___Sig4) (GnomePilotClient *, gpointer , gpointer , gpointer , gpointer);
 
166
 
 
167
static void
 
168
___marshal_Sig4 (GtkObject * object,
 
169
        GtkSignalFunc func,
 
170
        gpointer func_data,
 
171
        GtkArg * args)
 
172
{
 
173
        ___Sig4 rfunc;
 
174
 
 
175
        rfunc = (___Sig4)func;
 
176
 
 
177
        (*rfunc)((GnomePilotClient *)object,
 
178
                GTK_VALUE_POINTER(args[0]),
 
179
                GTK_VALUE_POINTER(args[1]),
 
180
                GTK_VALUE_POINTER(args[2]),
 
181
                func_data);
 
182
}
 
183
 
 
184
 
 
185
typedef void  (*___Sig5) (GnomePilotClient *, gpointer , gpointer , guint , guint , gpointer);
 
186
 
 
187
static void
 
188
___marshal_Sig5 (GtkObject * object,
 
189
        GtkSignalFunc func,
 
190
        gpointer func_data,
 
191
        GtkArg * args)
 
192
{
 
193
        ___Sig5 rfunc;
 
194
 
 
195
        rfunc = (___Sig5)func;
 
196
 
 
197
        (*rfunc)((GnomePilotClient *)object,
 
198
                GTK_VALUE_POINTER(args[0]),
 
199
                GTK_VALUE_POINTER(args[1]),
 
200
                GTK_VALUE_UINT(args[2]),
 
201
                GTK_VALUE_UINT(args[3]),
 
202
                func_data);
 
203
}
 
204
 
 
205
 
 
206
typedef void  (*___Sig6) (GnomePilotClient *, gpointer , guint , guint , gpointer);
 
207
 
 
208
static void
 
209
___marshal_Sig6 (GtkObject * object,
 
210
        GtkSignalFunc func,
 
211
        gpointer func_data,
 
212
        GtkArg * args)
 
213
{
 
214
        ___Sig6 rfunc;
 
215
 
 
216
        rfunc = (___Sig6)func;
 
217
 
 
218
        (*rfunc)((GnomePilotClient *)object,
 
219
                GTK_VALUE_POINTER(args[0]),
 
220
                GTK_VALUE_UINT(args[1]),
 
221
                GTK_VALUE_UINT(args[2]),
 
222
                func_data);
 
223
}
 
224
 
 
225
 
 
226
typedef void  (*___Sig7) (GnomePilotClient *, gboolean , gpointer);
 
227
 
 
228
static void
 
229
___marshal_Sig7 (GtkObject * object,
 
230
        GtkSignalFunc func,
 
231
        gpointer func_data,
 
232
        GtkArg * args)
 
233
{
 
234
        ___Sig7 rfunc;
 
235
 
 
236
        rfunc = (___Sig7)func;
 
237
 
 
238
        (*rfunc)((GnomePilotClient *)object,
 
239
                GTK_VALUE_BOOL(args[0]),
 
240
                func_data);
 
241
}
 
242
 
 
243
 
 
244
enum {
 
245
        PILOT_CONNECT_SIGNAL,
 
246
        PILOT_DISCONNECT_SIGNAL,
 
247
        COMPLETED_REQUEST_SIGNAL,
 
248
        USER_INFO_SIGNAL,
 
249
        SYSTEM_INFO_SIGNAL,
 
250
        START_CONDUIT_SIGNAL,
 
251
        END_CONDUIT_SIGNAL,
 
252
        PROGRESS_CONDUIT_SIGNAL,
 
253
        PROGRESS_OVERALL_SIGNAL,
 
254
        MESSAGE_CONDUIT_SIGNAL,
 
255
        MESSAGE_DAEMON_SIGNAL,
 
256
        ERROR_DAEMON_SIGNAL,
 
257
        ERROR_CONDUIT_SIGNAL,
 
258
        DAEMON_PAUSE_SIGNAL,
 
259
        LAST_SIGNAL
 
260
};
 
261
 
 
262
static guint object_signals[LAST_SIGNAL] = {0};
 
263
 
 
264
/* pointer to the class of our parent */
 
265
static GtkObjectClass *parent_class = NULL;
 
266
 
 
267
GtkType
 
268
gnome_pilot_client_get_type (void)
 
269
{
 
270
        static GtkType type = 0;
 
271
 
 
272
        if (type == 0) {
 
273
                static const GtkTypeInfo info = {
 
274
                        "GnomePilotClient",
 
275
                        sizeof (GnomePilotClient),
 
276
                        sizeof (GnomePilotClientClass),
 
277
                        (GtkClassInitFunc) gnome_pilot_client_class_init,
 
278
                        (GtkObjectInitFunc) gnome_pilot_client_init,
 
279
                        /* reserved_1 */ NULL,
 
280
                        /* reserved_2 */ NULL,
 
281
                        (GtkClassInitFunc) NULL
 
282
                };
 
283
 
 
284
                type = gtk_type_unique (gtk_object_get_type(), &info);
 
285
        }
 
286
 
 
287
        return type;
 
288
}
 
289
 
 
290
/* Short form macros */
 
291
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 
292
#define accept_all_cookies(args...) gnome_pilot_client_accept_all_cookies(args)
 
293
#define init_corba_class(args...) gnome_pilot_client_init_corba_class(args)
 
294
#define new() gnome_pilot_client_new()
 
295
#define destroy(args...) gnome_pilot_client_destroy(args)
 
296
#define connect_to_daemon(args...) gnome_pilot_client_connect_to_daemon(args)
 
297
#define corba_get_client_id(args...) gnome_pilot_client_corba_get_client_id(args)
 
298
#define corba_set_client_id(args...) gnome_pilot_client_corba_set_client_id(args)
 
299
#define corba_connect(args...) gnome_pilot_client_corba_connect(args)
 
300
#define corba_disconnect(args...) gnome_pilot_client_corba_disconnect(args)
 
301
#define corba_request_completed(args...) gnome_pilot_client_corba_request_completed(args)
 
302
#define corba_user_info_requested(args...) gnome_pilot_client_corba_user_info_requested(args)
 
303
#define corba_system_info_requested(args...) gnome_pilot_client_corba_system_info_requested(args)
 
304
#define corba_conduit_start(args...) gnome_pilot_client_corba_conduit_start(args)
 
305
#define corba_conduit_end(args...) gnome_pilot_client_corba_conduit_end(args)
 
306
#define corba_overall_progress(args...) gnome_pilot_client_corba_overall_progress(args)
 
307
#define corba_conduit_progress(args...) gnome_pilot_client_corba_conduit_progress(args)
 
308
#define corba_conduit_message(args...) gnome_pilot_client_corba_conduit_message(args)
 
309
#define corba_daemon_message(args...) gnome_pilot_client_corba_daemon_message(args)
 
310
#define corba_daemon_error(args...) gnome_pilot_client_corba_daemon_error(args)
 
311
#define corba_conduit_error(args...) gnome_pilot_client_corba_conduit_error(args)
 
312
#define corba_pause(args...) gnome_pilot_client_corba_pause(args)
 
313
#define pilot_connect(args...) gnome_pilot_client_pilot_connect(args)
 
314
#define pilot_disconnect(args...) gnome_pilot_client_pilot_disconnect(args)
 
315
#define completed_request(args...) gnome_pilot_client_completed_request(args)
 
316
#define user_info(args...) gnome_pilot_client_user_info(args)
 
317
#define system_info(args...) gnome_pilot_client_system_info(args)
 
318
#define start_conduit(args...) gnome_pilot_client_start_conduit(args)
 
319
#define end_conduit(args...) gnome_pilot_client_end_conduit(args)
 
320
#define progress_conduit(args...) gnome_pilot_client_progress_conduit(args)
 
321
#define progress_overall(args...) gnome_pilot_client_progress_overall(args)
 
322
#define message_conduit(args...) gnome_pilot_client_message_conduit(args)
 
323
#define message_daemon(args...) gnome_pilot_client_message_daemon(args)
 
324
#define error_daemon(args...) gnome_pilot_client_error_daemon(args)
 
325
#define error_conduit(args...) gnome_pilot_client_error_conduit(args)
 
326
#define daemon_pause(args...) gnome_pilot_client_daemon_pause(args)
 
327
#define pause_daemon(args...) gnome_pilot_client_pause_daemon(args)
 
328
#define unpause_daemon(args...) gnome_pilot_client_unpause_daemon(args)
 
329
#define noop(args...) gnome_pilot_client_noop(args)
 
330
#define restart_daemon(args...) gnome_pilot_client_restart_daemon(args)
 
331
#define monitor_on(args...) gnome_pilot_client_monitor_on(args)
 
332
#define monitor_on_all_pilots(args...) gnome_pilot_client_monitor_on_all_pilots(args)
 
333
#define monitor_off(args...) gnome_pilot_client_monitor_off(args)
 
334
#define monitor_off_all_pilots(args...) gnome_pilot_client_monitor_off_all_pilots(args)
 
335
#define notify_on(args...) gnome_pilot_client_notify_on(args)
 
336
#define notify_off(args...) gnome_pilot_client_notify_off(args)
 
337
#define restore(args...) gnome_pilot_client_restore(args)
 
338
#define install_file(args...) gnome_pilot_client_install_file(args)
 
339
#define get_user_info(args...) gnome_pilot_client_get_user_info(args)
 
340
#define set_user_info(args...) gnome_pilot_client_set_user_info(args)
 
341
#define get_system_info(args...) gnome_pilot_client_get_system_info(args)
 
342
#define remove_request(args...) gnome_pilot_client_remove_request(args)
 
343
#define conduit(args...) gnome_pilot_client_conduit(args)
 
344
#define get_triple_ptr(args...) gnome_pilot_client_get_triple_ptr(args)
 
345
#define get_users(args...) gnome_pilot_client_get_users(args)
 
346
#define get_databases_from_cache(args...) gnome_pilot_client_get_databases_from_cache(args)
 
347
#define get_cradles(args...) gnome_pilot_client_get_cradles(args)
 
348
#define get_pilots(args...) gnome_pilot_client_get_pilots(args)
 
349
#define get_pilot_ids(args...) gnome_pilot_client_get_pilot_ids(args)
 
350
#define get_pilots_by_user_name(args...) gnome_pilot_client_get_pilots_by_user_name(args)
 
351
#define get_pilots_by_user_login(args...) gnome_pilot_client_get_pilots_by_user_login(args)
 
352
#define get_user_name_by_pilot_name(args...) gnome_pilot_client_get_user_name_by_pilot_name(args)
 
353
#define get_user_login_by_pilot_name(args...) gnome_pilot_client_get_user_login_by_pilot_name(args)
 
354
#define get_pilot_base_dir_by_name(args...) gnome_pilot_client_get_pilot_base_dir_by_name(args)
 
355
#define get_pilot_base_dir_by_id(args...) gnome_pilot_client_get_pilot_base_dir_by_id(args)
 
356
#define get_pilot_id_by_name(args...) gnome_pilot_client_get_pilot_id_by_name(args)
 
357
#define get_pilot_name_by_id(args...) gnome_pilot_client_get_pilot_name_by_id(args)
 
358
#endif /* __GNUC__ && !__STRICT_ANSI__ */
 
359
 
 
360
/* Short form pointers */
 
361
static ORBit_MessageValidationResult (* const accept_all_cookies) (CORBA_unsigned_long request_id, CORBA_Principal * principal, CORBA_char * operation) = gnome_pilot_client_accept_all_cookies;
 
362
static void (* const init_corba_class) (GnomePilotClient * self) = gnome_pilot_client_init_corba_class;
 
363
static GtkObject * (* const new) (void) = gnome_pilot_client_new;
 
364
static void (* const destroy) (GnomePilotClient * self) = gnome_pilot_client_destroy;
 
365
static gint (* const connect_to_daemon) (GnomePilotClient * self) = gnome_pilot_client_connect_to_daemon;
 
366
static CORBA_char * (* const corba_get_client_id) (PortableServer_Servant servant, CORBA_Environment * ev) = gnome_pilot_client_corba_get_client_id;
 
367
static void (* const corba_set_client_id) (PortableServer_Servant servant, const CORBA_char * id, CORBA_Environment * ev) = gnome_pilot_client_corba_set_client_id;
 
368
static void (* const corba_connect) (PortableServer_Servant servant, const CORBA_char * pilot_id, const GNOME_Pilot_UserInfo * user, CORBA_Environment * ev) = gnome_pilot_client_corba_connect;
 
369
static void (* const corba_disconnect) (PortableServer_Servant servant, const CORBA_char * pilot_id, CORBA_Environment * ev) = gnome_pilot_client_corba_disconnect;
 
370
static void (* const corba_request_completed) (PortableServer_Servant servant, const CORBA_char * pilot_id, CORBA_unsigned_long id, CORBA_Environment * ev) = gnome_pilot_client_corba_request_completed;
 
371
static void (* const corba_user_info_requested) (PortableServer_Servant servant, const CORBA_char * pilot_id, const GNOME_Pilot_UserInfo * user, CORBA_Environment * ev) = gnome_pilot_client_corba_user_info_requested;
 
372
static void (* const corba_system_info_requested) (PortableServer_Servant servant, const CORBA_char * device, const GNOME_Pilot_SysInfo * sysinfo, CORBA_Environment * ev) = gnome_pilot_client_corba_system_info_requested;
 
373
static void (* const corba_conduit_start) (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * database, CORBA_Environment * ev) = gnome_pilot_client_corba_conduit_start;
 
374
static void (* const corba_conduit_end) (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, CORBA_Environment * ev) = gnome_pilot_client_corba_conduit_end;
 
375
static void (* const corba_overall_progress) (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_unsigned_long current, const CORBA_unsigned_long total, CORBA_Environment * ev) = gnome_pilot_client_corba_overall_progress;
 
376
static void (* const corba_conduit_progress) (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_unsigned_long current, const CORBA_unsigned_long total, CORBA_Environment * ev) = gnome_pilot_client_corba_conduit_progress;
 
377
static void (* const corba_conduit_message) (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * message, CORBA_Environment * ev) = gnome_pilot_client_corba_conduit_message;
 
378
static void (* const corba_daemon_message) (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * message, CORBA_Environment * ev) = gnome_pilot_client_corba_daemon_message;
 
379
static void (* const corba_daemon_error) (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * message, CORBA_Environment * ev) = gnome_pilot_client_corba_daemon_error;
 
380
static void (* const corba_conduit_error) (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * message, CORBA_Environment * ev) = gnome_pilot_client_corba_conduit_error;
 
381
static void (* const corba_pause) (PortableServer_Servant servant, const CORBA_boolean on_off, CORBA_Environment * ev) = gnome_pilot_client_corba_pause;
 
382
static void (* const pilot_connect) (GnomePilotClient * self, const gchar * pilot_name, const GNOME_Pilot_UserInfo * userinfo) = gnome_pilot_client_pilot_connect;
 
383
static void (* const pilot_disconnect) (GnomePilotClient * self, const gchar * pilot_name) = gnome_pilot_client_pilot_disconnect;
 
384
static void (* const completed_request) (GnomePilotClient * self, const gchar * pilot_name, unsigned long request_id) = gnome_pilot_client_completed_request;
 
385
static void (* const user_info) (GnomePilotClient * self, const gchar * device, const GNOME_Pilot_UserInfo * userinfo) = gnome_pilot_client_user_info;
 
386
static void (* const system_info) (GnomePilotClient * self, const gchar * device, const GNOME_Pilot_SysInfo * sysinfo) = gnome_pilot_client_system_info;
 
387
static void (* const start_conduit) (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * database) = gnome_pilot_client_start_conduit;
 
388
static void (* const end_conduit) (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name) = gnome_pilot_client_end_conduit;
 
389
static void (* const progress_conduit) (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, guint current, guint total) = gnome_pilot_client_progress_conduit;
 
390
static void (* const progress_overall) (GnomePilotClient * self, const gchar * pilot_name, guint current, guint total) = gnome_pilot_client_progress_overall;
 
391
static void (* const message_conduit) (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message) = gnome_pilot_client_message_conduit;
 
392
static void (* const message_daemon) (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message) = gnome_pilot_client_message_daemon;
 
393
static void (* const error_daemon) (GnomePilotClient * self, const gchar * pilot_name, const gchar * message) = gnome_pilot_client_error_daemon;
 
394
static void (* const error_conduit) (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message) = gnome_pilot_client_error_conduit;
 
395
static void (* const daemon_pause) (GnomePilotClient * self, gboolean on_off) = gnome_pilot_client_daemon_pause;
 
396
static gint (* const pause_daemon) (GnomePilotClient * self) = gnome_pilot_client_pause_daemon;
 
397
static gint (* const unpause_daemon) (GnomePilotClient * self) = gnome_pilot_client_unpause_daemon;
 
398
static gint (* const noop) (GnomePilotClient * self) = gnome_pilot_client_noop;
 
399
static gint (* const restart_daemon) (GnomePilotClient * self) = gnome_pilot_client_restart_daemon;
 
400
static gint (* const monitor_on) (GnomePilotClient * self, const gchar * pilot_id) = gnome_pilot_client_monitor_on;
 
401
static gint (* const monitor_on_all_pilots) (GnomePilotClient * self) = gnome_pilot_client_monitor_on_all_pilots;
 
402
static gint (* const monitor_off) (GnomePilotClient * self, const gchar * pilot_id) = gnome_pilot_client_monitor_off;
 
403
static gint (* const monitor_off_all_pilots) (GnomePilotClient * self) = gnome_pilot_client_monitor_off_all_pilots;
 
404
static gint (* const notify_on) (GnomePilotClient * self, GNOME_Pilot_EventType type) = gnome_pilot_client_notify_on;
 
405
static gint (* const notify_off) (GnomePilotClient * self, GNOME_Pilot_EventType type) = gnome_pilot_client_notify_off;
 
406
static gint (* const restore) (GnomePilotClient * self, const gchar * pilot_id, const gchar * directory, GNOME_Pilot_Survival survival, gint timeout, gint * handle) = gnome_pilot_client_restore;
 
407
static gint (* const install_file) (GnomePilotClient * self, const gchar * pilot_name, const gchar * infile, GNOME_Pilot_Survival survival, gint timeout, gint * handle) = gnome_pilot_client_install_file;
 
408
static gint (* const get_user_info) (GnomePilotClient * self, gchar * cradle_name, GNOME_Pilot_Survival survival, gint timeout, gint * handle) = gnome_pilot_client_get_user_info;
 
409
static gint (* const set_user_info) (GnomePilotClient * self, gchar * cradle_name, GNOME_Pilot_UserInfo user, gboolean continue_sync, GNOME_Pilot_Survival survival, gint timeout, gint * handle) = gnome_pilot_client_set_user_info;
 
410
static gint (* const get_system_info) (GnomePilotClient * self, gchar * cradle_name, GNOME_Pilot_Survival survival, gint timeout, gint * handle) = gnome_pilot_client_get_system_info;
 
411
static gint (* const remove_request) (GnomePilotClient * self, gint handle) = gnome_pilot_client_remove_request;
 
412
static gint (* const conduit) (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, GNOME_Pilot_ConduitOperation operation, GNOME_Pilot_Survival survival, gint timeout, gint * handle) = gnome_pilot_client_conduit;
 
413
static gint (* const get_triple_ptr) (GnomePilotClient * self, enum get_triple_ptr_action action, const gchar * name, GList ** output) = gnome_pilot_client_get_triple_ptr;
 
414
static gint (* const get_users) (GnomePilotClient * self, GList ** output) = gnome_pilot_client_get_users;
 
415
static gint (* const get_databases_from_cache) (GnomePilotClient * self, const gchar * pilot_name, GList ** output) = gnome_pilot_client_get_databases_from_cache;
 
416
static gint (* const get_cradles) (GnomePilotClient * self, GList ** output) = gnome_pilot_client_get_cradles;
 
417
static gint (* const get_pilots) (GnomePilotClient * self, GList ** output) = gnome_pilot_client_get_pilots;
 
418
static gint (* const get_pilot_ids) (GnomePilotClient * self, gint ** output) = gnome_pilot_client_get_pilot_ids;
 
419
static gint (* const get_pilots_by_user_name) (GnomePilotClient * self, const gchar * name, GList ** output) = gnome_pilot_client_get_pilots_by_user_name;
 
420
static gint (* const get_pilots_by_user_login) (GnomePilotClient * self, const gchar * login, GList ** output) = gnome_pilot_client_get_pilots_by_user_login;
 
421
static gint (* const get_user_name_by_pilot_name) (GnomePilotClient * self, const gchar * pilot_name, gchar ** output) = gnome_pilot_client_get_user_name_by_pilot_name;
 
422
static gint (* const get_user_login_by_pilot_name) (GnomePilotClient * self, const gchar * pilot_name, gchar ** output) = gnome_pilot_client_get_user_login_by_pilot_name;
 
423
static gint (* const get_pilot_base_dir_by_name) (GnomePilotClient * self, const gchar * pilot_name, gchar ** output) = gnome_pilot_client_get_pilot_base_dir_by_name;
 
424
static gint (* const get_pilot_base_dir_by_id) (GnomePilotClient * self, guint32 pilot_id, gchar ** output) = gnome_pilot_client_get_pilot_base_dir_by_id;
 
425
static gint (* const get_pilot_id_by_name) (GnomePilotClient * self, const gchar * pilot_name, guint32 * output) = gnome_pilot_client_get_pilot_id_by_name;
 
426
static gint (* const get_pilot_name_by_id) (GnomePilotClient * self, guint32 pilot_id, gchar ** output) = gnome_pilot_client_get_pilot_name_by_id;
 
427
 
 
428
/* a macro for creating a new object of our type */
 
429
#define GET_NEW ((GnomePilotClient *)gtk_type_new(gnome_pilot_client_get_type()))
 
430
 
 
431
#line 108 "gnome-pilot-client.gob"
 
432
static void 
 
433
gnome_pilot_client_class_init (GnomePilotClientClass * class)
 
434
#line 435 "gnome-pilot-client.c"
 
435
{
 
436
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::class_init"
 
437
        GtkObjectClass *gtk_object_class = (GtkObjectClass*) class;
 
438
#ifdef G_OBJECT_CLASS
 
439
        GObjectClass *g_object_class = (GObjectClass*) class;
 
440
#endif /* G_OBJECT_CLASS */
 
441
 
 
442
        parent_class = gtk_type_class (gtk_object_get_type ());
 
443
 
 
444
        object_signals[PILOT_CONNECT_SIGNAL] =
 
445
                gtk_signal_new ("pilot_connect",
 
446
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
447
                        GTK_CLASS_TYPE(gtk_object_class),
 
448
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, pilot_connect),
 
449
                        ___marshal_Sig1,
 
450
                        GTK_TYPE_NONE, 2,
 
451
                        GTK_TYPE_POINTER,
 
452
                        GTK_TYPE_POINTER);
 
453
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const GNOME_Pilot_UserInfo * ) != sizeof(gpointer )) {
 
454
                g_error("gnome-pilot-client.gob line 402: Type mismatch of \"pilot_connect\" signal signature");
 
455
        }
 
456
        object_signals[PILOT_DISCONNECT_SIGNAL] =
 
457
                gtk_signal_new ("pilot_disconnect",
 
458
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
459
                        GTK_CLASS_TYPE(gtk_object_class),
 
460
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, pilot_disconnect),
 
461
                        ___marshal_Sig2,
 
462
                        GTK_TYPE_NONE, 1,
 
463
                        GTK_TYPE_POINTER);
 
464
        if(sizeof(const gchar * ) != sizeof(gpointer )) {
 
465
                g_error("gnome-pilot-client.gob line 407: Type mismatch of \"pilot_disconnect\" signal signature");
 
466
        }
 
467
        object_signals[COMPLETED_REQUEST_SIGNAL] =
 
468
                gtk_signal_new ("completed_request",
 
469
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
470
                        GTK_CLASS_TYPE(gtk_object_class),
 
471
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, completed_request),
 
472
                        ___marshal_Sig3,
 
473
                        GTK_TYPE_NONE, 2,
 
474
                        GTK_TYPE_POINTER,
 
475
                        GTK_TYPE_INT);
 
476
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(unsigned long ) != sizeof(gint )) {
 
477
                g_error("gnome-pilot-client.gob line 412: Type mismatch of \"completed_request\" signal signature");
 
478
        }
 
479
        object_signals[USER_INFO_SIGNAL] =
 
480
                gtk_signal_new ("user_info",
 
481
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
482
                        GTK_CLASS_TYPE(gtk_object_class),
 
483
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, user_info),
 
484
                        ___marshal_Sig1,
 
485
                        GTK_TYPE_NONE, 2,
 
486
                        GTK_TYPE_POINTER,
 
487
                        GTK_TYPE_POINTER);
 
488
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const GNOME_Pilot_UserInfo * ) != sizeof(gpointer )) {
 
489
                g_error("gnome-pilot-client.gob line 417: Type mismatch of \"user_info\" signal signature");
 
490
        }
 
491
        object_signals[SYSTEM_INFO_SIGNAL] =
 
492
                gtk_signal_new ("system_info",
 
493
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
494
                        GTK_CLASS_TYPE(gtk_object_class),
 
495
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, system_info),
 
496
                        ___marshal_Sig1,
 
497
                        GTK_TYPE_NONE, 2,
 
498
                        GTK_TYPE_POINTER,
 
499
                        GTK_TYPE_POINTER);
 
500
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const GNOME_Pilot_SysInfo * ) != sizeof(gpointer )) {
 
501
                g_error("gnome-pilot-client.gob line 422: Type mismatch of \"system_info\" signal signature");
 
502
        }
 
503
        object_signals[START_CONDUIT_SIGNAL] =
 
504
                gtk_signal_new ("start_conduit",
 
505
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
506
                        GTK_CLASS_TYPE(gtk_object_class),
 
507
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, start_conduit),
 
508
                        ___marshal_Sig4,
 
509
                        GTK_TYPE_NONE, 3,
 
510
                        GTK_TYPE_POINTER,
 
511
                        GTK_TYPE_POINTER,
 
512
                        GTK_TYPE_POINTER);
 
513
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer )) {
 
514
                g_error("gnome-pilot-client.gob line 427: Type mismatch of \"start_conduit\" signal signature");
 
515
        }
 
516
        object_signals[END_CONDUIT_SIGNAL] =
 
517
                gtk_signal_new ("end_conduit",
 
518
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
519
                        GTK_CLASS_TYPE(gtk_object_class),
 
520
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, end_conduit),
 
521
                        ___marshal_Sig1,
 
522
                        GTK_TYPE_NONE, 2,
 
523
                        GTK_TYPE_POINTER,
 
524
                        GTK_TYPE_POINTER);
 
525
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer )) {
 
526
                g_error("gnome-pilot-client.gob line 432: Type mismatch of \"end_conduit\" signal signature");
 
527
        }
 
528
        object_signals[PROGRESS_CONDUIT_SIGNAL] =
 
529
                gtk_signal_new ("progress_conduit",
 
530
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
531
                        GTK_CLASS_TYPE(gtk_object_class),
 
532
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, progress_conduit),
 
533
                        ___marshal_Sig5,
 
534
                        GTK_TYPE_NONE, 4,
 
535
                        GTK_TYPE_POINTER,
 
536
                        GTK_TYPE_POINTER,
 
537
                        GTK_TYPE_UINT,
 
538
                        GTK_TYPE_UINT);
 
539
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(guint ) != sizeof(guint ) || sizeof(guint ) != sizeof(guint )) {
 
540
                g_error("gnome-pilot-client.gob line 437: Type mismatch of \"progress_conduit\" signal signature");
 
541
        }
 
542
        object_signals[PROGRESS_OVERALL_SIGNAL] =
 
543
                gtk_signal_new ("progress_overall",
 
544
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
545
                        GTK_CLASS_TYPE(gtk_object_class),
 
546
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, progress_overall),
 
547
                        ___marshal_Sig6,
 
548
                        GTK_TYPE_NONE, 3,
 
549
                        GTK_TYPE_POINTER,
 
550
                        GTK_TYPE_UINT,
 
551
                        GTK_TYPE_UINT);
 
552
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(guint ) != sizeof(guint ) || sizeof(guint ) != sizeof(guint )) {
 
553
                g_error("gnome-pilot-client.gob line 442: Type mismatch of \"progress_overall\" signal signature");
 
554
        }
 
555
        object_signals[MESSAGE_CONDUIT_SIGNAL] =
 
556
                gtk_signal_new ("message_conduit",
 
557
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
558
                        GTK_CLASS_TYPE(gtk_object_class),
 
559
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, message_conduit),
 
560
                        ___marshal_Sig4,
 
561
                        GTK_TYPE_NONE, 3,
 
562
                        GTK_TYPE_POINTER,
 
563
                        GTK_TYPE_POINTER,
 
564
                        GTK_TYPE_POINTER);
 
565
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer )) {
 
566
                g_error("gnome-pilot-client.gob line 448: Type mismatch of \"message_conduit\" signal signature");
 
567
        }
 
568
        object_signals[MESSAGE_DAEMON_SIGNAL] =
 
569
                gtk_signal_new ("message_daemon",
 
570
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
571
                        GTK_CLASS_TYPE(gtk_object_class),
 
572
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, message_daemon),
 
573
                        ___marshal_Sig4,
 
574
                        GTK_TYPE_NONE, 3,
 
575
                        GTK_TYPE_POINTER,
 
576
                        GTK_TYPE_POINTER,
 
577
                        GTK_TYPE_POINTER);
 
578
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer )) {
 
579
                g_error("gnome-pilot-client.gob line 453: Type mismatch of \"message_daemon\" signal signature");
 
580
        }
 
581
        object_signals[ERROR_DAEMON_SIGNAL] =
 
582
                gtk_signal_new ("error_daemon",
 
583
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
584
                        GTK_CLASS_TYPE(gtk_object_class),
 
585
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, error_daemon),
 
586
                        ___marshal_Sig1,
 
587
                        GTK_TYPE_NONE, 2,
 
588
                        GTK_TYPE_POINTER,
 
589
                        GTK_TYPE_POINTER);
 
590
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer )) {
 
591
                g_error("gnome-pilot-client.gob line 458: Type mismatch of \"error_daemon\" signal signature");
 
592
        }
 
593
        object_signals[ERROR_CONDUIT_SIGNAL] =
 
594
                gtk_signal_new ("error_conduit",
 
595
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
596
                        GTK_CLASS_TYPE(gtk_object_class),
 
597
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, error_conduit),
 
598
                        ___marshal_Sig4,
 
599
                        GTK_TYPE_NONE, 3,
 
600
                        GTK_TYPE_POINTER,
 
601
                        GTK_TYPE_POINTER,
 
602
                        GTK_TYPE_POINTER);
 
603
        if(sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer ) || sizeof(const gchar * ) != sizeof(gpointer )) {
 
604
                g_error("gnome-pilot-client.gob line 463: Type mismatch of \"error_conduit\" signal signature");
 
605
        }
 
606
        object_signals[DAEMON_PAUSE_SIGNAL] =
 
607
                gtk_signal_new ("daemon_pause",
 
608
                        (GtkSignalRunType)(GTK_RUN_FIRST | GTK_RUN_ACTION),
 
609
                        GTK_CLASS_TYPE(gtk_object_class),
 
610
                        GTK_SIGNAL_OFFSET (GnomePilotClientClass, daemon_pause),
 
611
                        ___marshal_Sig7,
 
612
                        GTK_TYPE_NONE, 1,
 
613
                        GTK_TYPE_BOOL);
 
614
        if(sizeof(gboolean ) != sizeof(gboolean )) {
 
615
                g_error("gnome-pilot-client.gob line 468: Type mismatch of \"daemon_pause\" signal signature");
 
616
        }
 
617
        gtk_object_class_add_signals (gtk_object_class,
 
618
                object_signals, LAST_SIGNAL);
 
619
 
 
620
 
 
621
#line 402 "gnome-pilot-client.gob"
 
622
        class->pilot_connect = ___real_gnome_pilot_client_pilot_connect;
 
623
#line 407 "gnome-pilot-client.gob"
 
624
        class->pilot_disconnect = ___real_gnome_pilot_client_pilot_disconnect;
 
625
#line 412 "gnome-pilot-client.gob"
 
626
        class->completed_request = ___real_gnome_pilot_client_completed_request;
 
627
#line 417 "gnome-pilot-client.gob"
 
628
        class->user_info = ___real_gnome_pilot_client_user_info;
 
629
#line 422 "gnome-pilot-client.gob"
 
630
        class->system_info = ___real_gnome_pilot_client_system_info;
 
631
#line 427 "gnome-pilot-client.gob"
 
632
        class->start_conduit = ___real_gnome_pilot_client_start_conduit;
 
633
#line 432 "gnome-pilot-client.gob"
 
634
        class->end_conduit = ___real_gnome_pilot_client_end_conduit;
 
635
#line 437 "gnome-pilot-client.gob"
 
636
        class->progress_conduit = ___real_gnome_pilot_client_progress_conduit;
 
637
#line 638 "gnome-pilot-client.c"
 
638
        class->progress_overall = NULL;
 
639
#line 448 "gnome-pilot-client.gob"
 
640
        class->message_conduit = ___real_gnome_pilot_client_message_conduit;
 
641
#line 453 "gnome-pilot-client.gob"
 
642
        class->message_daemon = ___real_gnome_pilot_client_message_daemon;
 
643
#line 458 "gnome-pilot-client.gob"
 
644
        class->error_daemon = ___real_gnome_pilot_client_error_daemon;
 
645
#line 463 "gnome-pilot-client.gob"
 
646
        class->error_conduit = ___real_gnome_pilot_client_error_conduit;
 
647
#line 468 "gnome-pilot-client.gob"
 
648
        class->daemon_pause = ___real_gnome_pilot_client_daemon_pause;
 
649
#line 650 "gnome-pilot-client.c"
 
650
 {
 
651
#line 108 "gnome-pilot-client.gob"
 
652
 
 
653
#ifdef WITH_VFS
 
654
                if (gnome_vfs_initialized () == FALSE) {
 
655
                        g_message ("Initing gnome vfs");
 
656
                        if (gnome_vfs_init () == FALSE) {
 
657
                                g_warning ("Failed to init gnome-vfs");
 
658
                        }
 
659
                }
 
660
#endif /* WITH_VFS */
 
661
        
 
662
#line 663 "gnome-pilot-client.c"
 
663
 }
 
664
        return;
 
665
        class = NULL;
 
666
        gtk_object_class = NULL;
 
667
#ifdef G_OBJECT_CLASS
 
668
        g_object_class = NULL;
 
669
#endif /* G_OBJECT_CLASS */
 
670
}
 
671
#undef __GOB_FUNCTION__
 
672
#line 151 "gnome-pilot-client.gob"
 
673
static void 
 
674
gnome_pilot_client_init (GnomePilotClient * self)
 
675
#line 676 "gnome-pilot-client.c"
 
676
{
 
677
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::init"
 
678
 {
 
679
#line 151 "gnome-pilot-client.gob"
 
680
 
 
681
#if USING_OAF
 
682
                        int argc=0;
 
683
                        char *argv=NULL;
 
684
#endif /* USING_OAF */
 
685
                        CORBA_Environment *ev;
 
686
                        PortableServer_POA the_poa;
 
687
                        GnomePilotClientServant *gnome_pilot_client_servant;
 
688
 
 
689
                        ev = &(self->ev);
 
690
                        init_corba_class (self);
 
691
 
 
692
                        CORBA_exception_init (ev);
 
693
#if USING_OAF
 
694
                        if (!oaf_is_initialized ())
 
695
                                self->orb = oaf_init (argc, &argv);
 
696
                        else
 
697
                                self->orb = oaf_orb_get ();
 
698
                        ORBit_set_request_validation_handler (accept_all_cookies);
 
699
#else /* USING_OAF */
 
700
                        self->orb = gnome_CORBA_ORB ();
 
701
#endif /* USING_OAF */
 
702
 
 
703
                        g_assert (self->orb!=NULL);
 
704
                                        
 
705
                        gnome_pilot_client_servant = g_new0(GnomePilotClientServant,1);
 
706
                        gnome_pilot_client_servant->servant.vepv = 
 
707
                                                    &gnome_pilot_client_vepv;
 
708
                        gnome_pilot_client_servant->self = self;
 
709
                        
 
710
                        the_poa = (PortableServer_POA)CORBA_ORB_resolve_initial_references (self->orb,"RootPOA",ev);
 
711
                        if (ev->_major != CORBA_NO_EXCEPTION) {
 
712
                                g_warning ("%s:%d: Caught exception: %s",
 
713
                                           __FILE__,__LINE__, 
 
714
                                           CORBA_exception_id (ev));
 
715
                                CORBA_exception_free (ev);
 
716
                        }
 
717
 
 
718
                        PortableServer_POAManager_activate (PortableServer_POA__get_the_POAManager (the_poa, ev), ev);
 
719
                        if (ev->_major != CORBA_NO_EXCEPTION) {
 
720
                                g_warning ("%s:%d: Caught exception: %s",
 
721
                                           __FILE__,__LINE__, 
 
722
                                           CORBA_exception_id (ev));
 
723
                                CORBA_exception_free (ev);
 
724
                        }
 
725
 
 
726
                        POA_GNOME_Pilot_Client__init ((PortableServer_Servant)gnome_pilot_client_servant,ev);
 
727
                        if (ev->_major != CORBA_NO_EXCEPTION) {
 
728
                                g_warning ("%s:%d: Caught exception: %s",
 
729
                                           __FILE__,__LINE__, 
 
730
                                           CORBA_exception_id (ev));
 
731
                                CORBA_exception_free (ev);
 
732
                        }
 
733
 
 
734
                        CORBA_free (
 
735
                                PortableServer_POA_activate_object (the_poa,
 
736
                                                                   gnome_pilot_client_servant,
 
737
                                                                   ev)
 
738
                                );
 
739
                        if (ev->_major != CORBA_NO_EXCEPTION) {
 
740
                                g_warning ("%s:%d: Caught exception: %s",
 
741
                                           __FILE__,__LINE__, 
 
742
                                           CORBA_exception_id (ev));
 
743
                                CORBA_exception_free (ev);
 
744
                        }
 
745
                        
 
746
                        self->gpilotdclient = 
 
747
                                PortableServer_POA_servant_to_reference (the_poa, 
 
748
                                                                        gnome_pilot_client_servant, 
 
749
                                                                        ev);
 
750
                        if (ev->_major != CORBA_NO_EXCEPTION) {
 
751
                                g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (ev));
 
752
                                CORBA_exception_free (ev);
 
753
                        }                       
 
754
        
 
755
#line 756 "gnome-pilot-client.c"
 
756
 }
 
757
        return;
 
758
        self = NULL;
 
759
}
 
760
#undef __GOB_FUNCTION__
 
761
 
 
762
 
 
763
#line 119 "gnome-pilot-client.gob"
 
764
static ORBit_MessageValidationResult 
 
765
gnome_pilot_client_accept_all_cookies (CORBA_unsigned_long request_id, CORBA_Principal * principal, CORBA_char * operation)
 
766
#line 767 "gnome-pilot-client.c"
 
767
{
 
768
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::accept_all_cookies"
 
769
{
 
770
#line 121 "gnome-pilot-client.gob"
 
771
        
 
772
                /* allow ALL cookies */
 
773
                return ORBIT_MESSAGE_ALLOW_ALL;
 
774
        }}
 
775
#line 776 "gnome-pilot-client.c"
 
776
#undef __GOB_FUNCTION__
 
777
 
 
778
#line 126 "gnome-pilot-client.gob"
 
779
static void 
 
780
gnome_pilot_client_init_corba_class (GnomePilotClient * self)
 
781
#line 782 "gnome-pilot-client.c"
 
782
{
 
783
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::init_corba_class"
 
784
#line 126 "gnome-pilot-client.gob"
 
785
        g_return_if_fail (self != NULL);
 
786
#line 126 "gnome-pilot-client.gob"
 
787
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
788
#line 789 "gnome-pilot-client.c"
 
789
{
 
790
#line 126 "gnome-pilot-client.gob"
 
791
        
 
792
                static gboolean inited = FALSE;
 
793
                
 
794
                if (inited==FALSE) {
 
795
                        self->client_id = NULL;
 
796
                        inited = TRUE;
 
797
                        gnome_pilot_client_epv._get_client_id = corba_get_client_id;
 
798
                        gnome_pilot_client_epv._set_client_id = corba_set_client_id;
 
799
                        gnome_pilot_client_epv.connect = corba_connect;
 
800
                        gnome_pilot_client_epv.disconnect = corba_disconnect;
 
801
                        gnome_pilot_client_epv.request_completed = corba_request_completed;
 
802
                        gnome_pilot_client_epv.userinfo_requested = corba_user_info_requested;
 
803
                        gnome_pilot_client_epv.sysinfo_requested = corba_system_info_requested;
 
804
                        gnome_pilot_client_epv.conduit_start = corba_conduit_start;
 
805
                        gnome_pilot_client_epv.conduit_end = corba_conduit_end;
 
806
                        gnome_pilot_client_epv.overall_progress = corba_overall_progress;
 
807
                        gnome_pilot_client_epv.conduit_progress = corba_conduit_progress;
 
808
                        gnome_pilot_client_epv.conduit_message = corba_conduit_message;
 
809
                        gnome_pilot_client_epv.daemon_message = corba_daemon_message;
 
810
                        gnome_pilot_client_epv.daemon_error = corba_daemon_error;
 
811
                        gnome_pilot_client_epv.conduit_error = corba_conduit_error;
 
812
                        gnome_pilot_client_epv.pause = corba_pause;
 
813
                }
 
814
        }}
 
815
#line 816 "gnome-pilot-client.c"
 
816
#undef __GOB_FUNCTION__
 
817
 
 
818
 
 
819
#line 227 "gnome-pilot-client.gob"
 
820
GtkObject * 
 
821
gnome_pilot_client_new (void)
 
822
#line 823 "gnome-pilot-client.c"
 
823
{
 
824
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::new"
 
825
{
 
826
#line 228 "gnome-pilot-client.gob"
 
827
        
 
828
                GnomePilotClient *ret = GET_NEW;
 
829
                return GTK_OBJECT (ret);
 
830
        }}
 
831
#line 832 "gnome-pilot-client.c"
 
832
#undef __GOB_FUNCTION__
 
833
 
 
834
#line 233 "gnome-pilot-client.gob"
 
835
void 
 
836
gnome_pilot_client_destroy (GnomePilotClient * self)
 
837
#line 838 "gnome-pilot-client.c"
 
838
{
 
839
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::destroy"
 
840
#line 233 "gnome-pilot-client.gob"
 
841
        g_return_if_fail (self != NULL);
 
842
#line 233 "gnome-pilot-client.gob"
 
843
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
844
#line 845 "gnome-pilot-client.c"
 
845
{
 
846
#line 233 "gnome-pilot-client.gob"
 
847
        
 
848
                g_free (self->client_id);
 
849
                /* FIXME: ick, what more to do here ? */
 
850
        }}
 
851
#line 852 "gnome-pilot-client.c"
 
852
#undef __GOB_FUNCTION__
 
853
 
 
854
#line 238 "gnome-pilot-client.gob"
 
855
gint 
 
856
gnome_pilot_client_connect_to_daemon (GnomePilotClient * self)
 
857
#line 858 "gnome-pilot-client.c"
 
858
{
 
859
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::connect_to_daemon"
 
860
#line 238 "gnome-pilot-client.gob"
 
861
        g_return_val_if_fail (self != NULL, (gint )0);
 
862
#line 238 "gnome-pilot-client.gob"
 
863
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )0);
 
864
#line 865 "gnome-pilot-client.c"
 
865
{
 
866
#line 238 "gnome-pilot-client.gob"
 
867
        
 
868
#ifdef USING_OAF
 
869
                OAF_ServerInfoList *list;
 
870
                CORBA_Environment *ev;
 
871
                
 
872
                ev = &(self->ev);
 
873
                list = oaf_query ("repo_ids.has ('IDL:GNOME/Pilot/Daemon:1.0')", NULL, ev);
 
874
                if (list->_length == 0) {
 
875
                        return GPILOTD_ERR_NOT_CONNECTED;
 
876
                } else {
 
877
                        OAF_ServerInfo info;
 
878
                        info = list->_buffer[0];
 
879
                        g_message ("Activating OAF object %s", info.iid);
 
880
                        self->gpilotddaemon = oaf_activate_from_id (info.iid,             
 
881
                                                                    OAF_FLAG_NO_LOCAL, NULL, NULL);
 
882
                }
 
883
                CORBA_free (list);
 
884
                CORBA_exception_free (ev);
 
885
#else /* USING_OAF */
 
886
                self->gpilotddaemon = goad_server_activate_with_repo_id (NULL,
 
887
                                                             "IDL:GNOME/Pilot/Daemon:1.0",
 
888
                                                                      0,NULL);
 
889
#endif /* USING_OAF */
 
890
                if (self->gpilotddaemon == NULL) return GPILOTD_ERR_NOT_CONNECTED;
 
891
 
 
892
                return GPILOTD_OK;
 
893
        }}
 
894
#line 895 "gnome-pilot-client.c"
 
895
#undef __GOB_FUNCTION__
 
896
 
 
897
#line 266 "gnome-pilot-client.gob"
 
898
static CORBA_char * 
 
899
gnome_pilot_client_corba_get_client_id (PortableServer_Servant servant, CORBA_Environment * ev)
 
900
#line 901 "gnome-pilot-client.c"
 
901
{
 
902
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_get_client_id"
 
903
{
 
904
#line 268 "gnome-pilot-client.gob"
 
905
        
 
906
                gchar *id;
 
907
                id = get_self (servant)->client_id;
 
908
                if (id==NULL) return CORBA_string_dup ("");
 
909
                return CORBA_string_dup (id);
 
910
        }}
 
911
#line 912 "gnome-pilot-client.c"
 
912
#undef __GOB_FUNCTION__
 
913
 
 
914
#line 275 "gnome-pilot-client.gob"
 
915
static void 
 
916
gnome_pilot_client_corba_set_client_id (PortableServer_Servant servant, const CORBA_char * id, CORBA_Environment * ev)
 
917
#line 918 "gnome-pilot-client.c"
 
918
{
 
919
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_set_client_id"
 
920
{
 
921
#line 278 "gnome-pilot-client.gob"
 
922
        
 
923
                if (get_self (servant)->client_id!=NULL) {
 
924
                        /* throw exception */
 
925
                        g_assert (0);
 
926
                } get_self (servant)->client_id = g_strdup (id);
 
927
        }}
 
928
#line 929 "gnome-pilot-client.c"
 
929
#undef __GOB_FUNCTION__
 
930
 
 
931
#line 285 "gnome-pilot-client.gob"
 
932
static void 
 
933
gnome_pilot_client_corba_connect (PortableServer_Servant servant, const CORBA_char * pilot_id, const GNOME_Pilot_UserInfo * user, CORBA_Environment * ev)
 
934
#line 935 "gnome-pilot-client.c"
 
935
{
 
936
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_connect"
 
937
{
 
938
#line 289 "gnome-pilot-client.gob"
 
939
        
 
940
                pilot_connect (get_self (servant),pilot_id,user);
 
941
        }}
 
942
#line 943 "gnome-pilot-client.c"
 
943
#undef __GOB_FUNCTION__
 
944
 
 
945
#line 293 "gnome-pilot-client.gob"
 
946
static void 
 
947
gnome_pilot_client_corba_disconnect (PortableServer_Servant servant, const CORBA_char * pilot_id, CORBA_Environment * ev)
 
948
#line 949 "gnome-pilot-client.c"
 
949
{
 
950
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_disconnect"
 
951
{
 
952
#line 296 "gnome-pilot-client.gob"
 
953
        
 
954
                pilot_disconnect (get_self (servant),pilot_id);
 
955
        }}
 
956
#line 957 "gnome-pilot-client.c"
 
957
#undef __GOB_FUNCTION__
 
958
 
 
959
#line 300 "gnome-pilot-client.gob"
 
960
static void 
 
961
gnome_pilot_client_corba_request_completed (PortableServer_Servant servant, const CORBA_char * pilot_id, CORBA_unsigned_long id, CORBA_Environment * ev)
 
962
#line 963 "gnome-pilot-client.c"
 
963
{
 
964
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_request_completed"
 
965
{
 
966
#line 304 "gnome-pilot-client.gob"
 
967
        
 
968
                completed_request (get_self (servant),pilot_id,id);
 
969
        }}
 
970
#line 971 "gnome-pilot-client.c"
 
971
#undef __GOB_FUNCTION__
 
972
 
 
973
#line 308 "gnome-pilot-client.gob"
 
974
static void 
 
975
gnome_pilot_client_corba_user_info_requested (PortableServer_Servant servant, const CORBA_char * pilot_id, const GNOME_Pilot_UserInfo * user, CORBA_Environment * ev)
 
976
#line 977 "gnome-pilot-client.c"
 
977
{
 
978
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_user_info_requested"
 
979
{
 
980
#line 312 "gnome-pilot-client.gob"
 
981
        
 
982
                user_info (get_self (servant),pilot_id,user);
 
983
        }}
 
984
#line 985 "gnome-pilot-client.c"
 
985
#undef __GOB_FUNCTION__
 
986
 
 
987
#line 316 "gnome-pilot-client.gob"
 
988
static void 
 
989
gnome_pilot_client_corba_system_info_requested (PortableServer_Servant servant, const CORBA_char * device, const GNOME_Pilot_SysInfo * sysinfo, CORBA_Environment * ev)
 
990
#line 991 "gnome-pilot-client.c"
 
991
{
 
992
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_system_info_requested"
 
993
{
 
994
#line 320 "gnome-pilot-client.gob"
 
995
        
 
996
                system_info (get_self (servant),device,sysinfo);
 
997
        }}
 
998
#line 999 "gnome-pilot-client.c"
 
999
#undef __GOB_FUNCTION__
 
1000
 
 
1001
#line 324 "gnome-pilot-client.gob"
 
1002
static void 
 
1003
gnome_pilot_client_corba_conduit_start (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * database, CORBA_Environment * ev)
 
1004
#line 1005 "gnome-pilot-client.c"
 
1005
{
 
1006
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_conduit_start"
 
1007
{
 
1008
#line 329 "gnome-pilot-client.gob"
 
1009
        
 
1010
                start_conduit (get_self (servant),pilot_id,conduit_name,database);
 
1011
        }}
 
1012
#line 1013 "gnome-pilot-client.c"
 
1013
#undef __GOB_FUNCTION__
 
1014
 
 
1015
#line 333 "gnome-pilot-client.gob"
 
1016
static void 
 
1017
gnome_pilot_client_corba_conduit_end (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, CORBA_Environment * ev)
 
1018
#line 1019 "gnome-pilot-client.c"
 
1019
{
 
1020
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_conduit_end"
 
1021
{
 
1022
#line 337 "gnome-pilot-client.gob"
 
1023
        
 
1024
                end_conduit (get_self (servant),pilot_id,conduit_name);
 
1025
        }}
 
1026
#line 1027 "gnome-pilot-client.c"
 
1027
#undef __GOB_FUNCTION__
 
1028
 
 
1029
#line 341 "gnome-pilot-client.gob"
 
1030
static void 
 
1031
gnome_pilot_client_corba_overall_progress (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_unsigned_long current, const CORBA_unsigned_long total, CORBA_Environment * ev)
 
1032
#line 1033 "gnome-pilot-client.c"
 
1033
{
 
1034
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_overall_progress"
 
1035
{
 
1036
#line 346 "gnome-pilot-client.gob"
 
1037
        
 
1038
                progress_overall (get_self (servant),pilot_id, current, total);
 
1039
        }}
 
1040
#line 1041 "gnome-pilot-client.c"
 
1041
#undef __GOB_FUNCTION__
 
1042
 
 
1043
#line 350 "gnome-pilot-client.gob"
 
1044
static void 
 
1045
gnome_pilot_client_corba_conduit_progress (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_unsigned_long current, const CORBA_unsigned_long total, CORBA_Environment * ev)
 
1046
#line 1047 "gnome-pilot-client.c"
 
1047
{
 
1048
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_conduit_progress"
 
1049
{
 
1050
#line 356 "gnome-pilot-client.gob"
 
1051
        
 
1052
                progress_conduit (get_self (servant),pilot_id,conduit_name,current,total);
 
1053
        }}
 
1054
#line 1055 "gnome-pilot-client.c"
 
1055
#undef __GOB_FUNCTION__
 
1056
 
 
1057
#line 360 "gnome-pilot-client.gob"
 
1058
static void 
 
1059
gnome_pilot_client_corba_conduit_message (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * message, CORBA_Environment * ev)
 
1060
#line 1061 "gnome-pilot-client.c"
 
1061
{
 
1062
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_conduit_message"
 
1063
{
 
1064
#line 365 "gnome-pilot-client.gob"
 
1065
        
 
1066
                message_conduit (get_self (servant),pilot_id,conduit_name,message);
 
1067
        }}
 
1068
#line 1069 "gnome-pilot-client.c"
 
1069
#undef __GOB_FUNCTION__
 
1070
 
 
1071
#line 369 "gnome-pilot-client.gob"
 
1072
static void 
 
1073
gnome_pilot_client_corba_daemon_message (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * message, CORBA_Environment * ev)
 
1074
#line 1075 "gnome-pilot-client.c"
 
1075
{
 
1076
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_daemon_message"
 
1077
{
 
1078
#line 374 "gnome-pilot-client.gob"
 
1079
        
 
1080
                message_daemon (get_self (servant),pilot_id,conduit_name,message);
 
1081
        }}
 
1082
#line 1083 "gnome-pilot-client.c"
 
1083
#undef __GOB_FUNCTION__
 
1084
 
 
1085
#line 378 "gnome-pilot-client.gob"
 
1086
static void 
 
1087
gnome_pilot_client_corba_daemon_error (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * message, CORBA_Environment * ev)
 
1088
#line 1089 "gnome-pilot-client.c"
 
1089
{
 
1090
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_daemon_error"
 
1091
{
 
1092
#line 382 "gnome-pilot-client.gob"
 
1093
        
 
1094
                error_daemon (get_self (servant), pilot_id, message);
 
1095
        }}
 
1096
#line 1097 "gnome-pilot-client.c"
 
1097
#undef __GOB_FUNCTION__
 
1098
 
 
1099
#line 386 "gnome-pilot-client.gob"
 
1100
static void 
 
1101
gnome_pilot_client_corba_conduit_error (PortableServer_Servant servant, const CORBA_char * pilot_id, const CORBA_char * conduit_name, const CORBA_char * message, CORBA_Environment * ev)
 
1102
#line 1103 "gnome-pilot-client.c"
 
1103
{
 
1104
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_conduit_error"
 
1105
{
 
1106
#line 391 "gnome-pilot-client.gob"
 
1107
        
 
1108
                error_conduit (get_self (servant),pilot_id,conduit_name,message);
 
1109
        }}
 
1110
#line 1111 "gnome-pilot-client.c"
 
1111
#undef __GOB_FUNCTION__
 
1112
 
 
1113
#line 395 "gnome-pilot-client.gob"
 
1114
static void 
 
1115
gnome_pilot_client_corba_pause (PortableServer_Servant servant, const CORBA_boolean on_off, CORBA_Environment * ev)
 
1116
#line 1117 "gnome-pilot-client.c"
 
1117
{
 
1118
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::corba_pause"
 
1119
{
 
1120
#line 398 "gnome-pilot-client.gob"
 
1121
        
 
1122
                daemon_pause (get_self (servant), on_off);
 
1123
        }}
 
1124
#line 1125 "gnome-pilot-client.c"
 
1125
#undef __GOB_FUNCTION__
 
1126
 
 
1127
#line 402 "gnome-pilot-client.gob"
 
1128
void 
 
1129
gnome_pilot_client_pilot_connect (GnomePilotClient * self, const gchar * pilot_name, const GNOME_Pilot_UserInfo * userinfo)
 
1130
#line 1131 "gnome-pilot-client.c"
 
1131
{
 
1132
#line 402 "gnome-pilot-client.gob"
 
1133
        g_return_if_fail (self != NULL);
 
1134
#line 402 "gnome-pilot-client.gob"
 
1135
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1136
#line 1137 "gnome-pilot-client.c"
 
1137
        gtk_signal_emit (GTK_OBJECT (self),
 
1138
                object_signals[PILOT_CONNECT_SIGNAL],
 
1139
                (gpointer )pilot_name,
 
1140
                (gpointer )userinfo);
 
1141
}
 
1142
#line 402 "gnome-pilot-client.gob"
 
1143
static void 
 
1144
___real_gnome_pilot_client_pilot_connect (GnomePilotClient * self, const gchar * pilot_name, const GNOME_Pilot_UserInfo * userinfo)
 
1145
#line 1146 "gnome-pilot-client.c"
 
1146
{
 
1147
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::pilot_connect"
 
1148
{
 
1149
#line 403 "gnome-pilot-client.gob"
 
1150
        
 
1151
                return;
 
1152
        }}
 
1153
#line 1154 "gnome-pilot-client.c"
 
1154
#undef __GOB_FUNCTION__
 
1155
 
 
1156
#line 407 "gnome-pilot-client.gob"
 
1157
void 
 
1158
gnome_pilot_client_pilot_disconnect (GnomePilotClient * self, const gchar * pilot_name)
 
1159
#line 1160 "gnome-pilot-client.c"
 
1160
{
 
1161
#line 407 "gnome-pilot-client.gob"
 
1162
        g_return_if_fail (self != NULL);
 
1163
#line 407 "gnome-pilot-client.gob"
 
1164
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1165
#line 1166 "gnome-pilot-client.c"
 
1166
        gtk_signal_emit (GTK_OBJECT (self),
 
1167
                object_signals[PILOT_DISCONNECT_SIGNAL],
 
1168
                (gpointer )pilot_name);
 
1169
}
 
1170
#line 407 "gnome-pilot-client.gob"
 
1171
static void 
 
1172
___real_gnome_pilot_client_pilot_disconnect (GnomePilotClient * self, const gchar * pilot_name)
 
1173
#line 1174 "gnome-pilot-client.c"
 
1174
{
 
1175
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::pilot_disconnect"
 
1176
{
 
1177
#line 408 "gnome-pilot-client.gob"
 
1178
        
 
1179
                return;
 
1180
        }}
 
1181
#line 1182 "gnome-pilot-client.c"
 
1182
#undef __GOB_FUNCTION__
 
1183
 
 
1184
#line 412 "gnome-pilot-client.gob"
 
1185
void 
 
1186
gnome_pilot_client_completed_request (GnomePilotClient * self, const gchar * pilot_name, unsigned long request_id)
 
1187
#line 1188 "gnome-pilot-client.c"
 
1188
{
 
1189
#line 412 "gnome-pilot-client.gob"
 
1190
        g_return_if_fail (self != NULL);
 
1191
#line 412 "gnome-pilot-client.gob"
 
1192
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1193
#line 1194 "gnome-pilot-client.c"
 
1194
        gtk_signal_emit (GTK_OBJECT (self),
 
1195
                object_signals[COMPLETED_REQUEST_SIGNAL],
 
1196
                (gpointer )pilot_name,
 
1197
                (gint )request_id);
 
1198
}
 
1199
#line 412 "gnome-pilot-client.gob"
 
1200
static void 
 
1201
___real_gnome_pilot_client_completed_request (GnomePilotClient * self, const gchar * pilot_name, unsigned long request_id)
 
1202
#line 1203 "gnome-pilot-client.c"
 
1203
{
 
1204
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::completed_request"
 
1205
{
 
1206
#line 413 "gnome-pilot-client.gob"
 
1207
        
 
1208
                return;
 
1209
        }}
 
1210
#line 1211 "gnome-pilot-client.c"
 
1211
#undef __GOB_FUNCTION__
 
1212
 
 
1213
#line 417 "gnome-pilot-client.gob"
 
1214
void 
 
1215
gnome_pilot_client_user_info (GnomePilotClient * self, const gchar * device, const GNOME_Pilot_UserInfo * userinfo)
 
1216
#line 1217 "gnome-pilot-client.c"
 
1217
{
 
1218
#line 417 "gnome-pilot-client.gob"
 
1219
        g_return_if_fail (self != NULL);
 
1220
#line 417 "gnome-pilot-client.gob"
 
1221
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1222
#line 1223 "gnome-pilot-client.c"
 
1223
        gtk_signal_emit (GTK_OBJECT (self),
 
1224
                object_signals[USER_INFO_SIGNAL],
 
1225
                (gpointer )device,
 
1226
                (gpointer )userinfo);
 
1227
}
 
1228
#line 417 "gnome-pilot-client.gob"
 
1229
static void 
 
1230
___real_gnome_pilot_client_user_info (GnomePilotClient * self, const gchar * device, const GNOME_Pilot_UserInfo * userinfo)
 
1231
#line 1232 "gnome-pilot-client.c"
 
1232
{
 
1233
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::user_info"
 
1234
{
 
1235
#line 418 "gnome-pilot-client.gob"
 
1236
        
 
1237
                return;
 
1238
        }}
 
1239
#line 1240 "gnome-pilot-client.c"
 
1240
#undef __GOB_FUNCTION__
 
1241
 
 
1242
#line 422 "gnome-pilot-client.gob"
 
1243
void 
 
1244
gnome_pilot_client_system_info (GnomePilotClient * self, const gchar * device, const GNOME_Pilot_SysInfo * sysinfo)
 
1245
#line 1246 "gnome-pilot-client.c"
 
1246
{
 
1247
#line 422 "gnome-pilot-client.gob"
 
1248
        g_return_if_fail (self != NULL);
 
1249
#line 422 "gnome-pilot-client.gob"
 
1250
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1251
#line 1252 "gnome-pilot-client.c"
 
1252
        gtk_signal_emit (GTK_OBJECT (self),
 
1253
                object_signals[SYSTEM_INFO_SIGNAL],
 
1254
                (gpointer )device,
 
1255
                (gpointer )sysinfo);
 
1256
}
 
1257
#line 422 "gnome-pilot-client.gob"
 
1258
static void 
 
1259
___real_gnome_pilot_client_system_info (GnomePilotClient * self, const gchar * device, const GNOME_Pilot_SysInfo * sysinfo)
 
1260
#line 1261 "gnome-pilot-client.c"
 
1261
{
 
1262
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::system_info"
 
1263
{
 
1264
#line 423 "gnome-pilot-client.gob"
 
1265
        
 
1266
                return;
 
1267
        }}
 
1268
#line 1269 "gnome-pilot-client.c"
 
1269
#undef __GOB_FUNCTION__
 
1270
 
 
1271
#line 427 "gnome-pilot-client.gob"
 
1272
void 
 
1273
gnome_pilot_client_start_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * database)
 
1274
#line 1275 "gnome-pilot-client.c"
 
1275
{
 
1276
#line 427 "gnome-pilot-client.gob"
 
1277
        g_return_if_fail (self != NULL);
 
1278
#line 427 "gnome-pilot-client.gob"
 
1279
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1280
#line 1281 "gnome-pilot-client.c"
 
1281
        gtk_signal_emit (GTK_OBJECT (self),
 
1282
                object_signals[START_CONDUIT_SIGNAL],
 
1283
                (gpointer )pilot_name,
 
1284
                (gpointer )conduit_name,
 
1285
                (gpointer )database);
 
1286
}
 
1287
#line 427 "gnome-pilot-client.gob"
 
1288
static void 
 
1289
___real_gnome_pilot_client_start_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * database)
 
1290
#line 1291 "gnome-pilot-client.c"
 
1291
{
 
1292
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::start_conduit"
 
1293
{
 
1294
#line 428 "gnome-pilot-client.gob"
 
1295
        
 
1296
                return;
 
1297
        }}
 
1298
#line 1299 "gnome-pilot-client.c"
 
1299
#undef __GOB_FUNCTION__
 
1300
 
 
1301
#line 432 "gnome-pilot-client.gob"
 
1302
void 
 
1303
gnome_pilot_client_end_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name)
 
1304
#line 1305 "gnome-pilot-client.c"
 
1305
{
 
1306
#line 432 "gnome-pilot-client.gob"
 
1307
        g_return_if_fail (self != NULL);
 
1308
#line 432 "gnome-pilot-client.gob"
 
1309
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1310
#line 1311 "gnome-pilot-client.c"
 
1311
        gtk_signal_emit (GTK_OBJECT (self),
 
1312
                object_signals[END_CONDUIT_SIGNAL],
 
1313
                (gpointer )pilot_name,
 
1314
                (gpointer )conduit_name);
 
1315
}
 
1316
#line 432 "gnome-pilot-client.gob"
 
1317
static void 
 
1318
___real_gnome_pilot_client_end_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name)
 
1319
#line 1320 "gnome-pilot-client.c"
 
1320
{
 
1321
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::end_conduit"
 
1322
{
 
1323
#line 433 "gnome-pilot-client.gob"
 
1324
        
 
1325
                return;
 
1326
        }}
 
1327
#line 1328 "gnome-pilot-client.c"
 
1328
#undef __GOB_FUNCTION__
 
1329
 
 
1330
#line 437 "gnome-pilot-client.gob"
 
1331
void 
 
1332
gnome_pilot_client_progress_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, guint current, guint total)
 
1333
#line 1334 "gnome-pilot-client.c"
 
1334
{
 
1335
#line 437 "gnome-pilot-client.gob"
 
1336
        g_return_if_fail (self != NULL);
 
1337
#line 437 "gnome-pilot-client.gob"
 
1338
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1339
#line 1340 "gnome-pilot-client.c"
 
1340
        gtk_signal_emit (GTK_OBJECT (self),
 
1341
                object_signals[PROGRESS_CONDUIT_SIGNAL],
 
1342
                (gpointer )pilot_name,
 
1343
                (gpointer )conduit_name,
 
1344
                (guint )current,
 
1345
                (guint )total);
 
1346
}
 
1347
#line 437 "gnome-pilot-client.gob"
 
1348
static void 
 
1349
___real_gnome_pilot_client_progress_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, guint current, guint total)
 
1350
#line 1351 "gnome-pilot-client.c"
 
1351
{
 
1352
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::progress_conduit"
 
1353
{
 
1354
#line 438 "gnome-pilot-client.gob"
 
1355
        
 
1356
                return;
 
1357
        }}
 
1358
#line 1359 "gnome-pilot-client.c"
 
1359
#undef __GOB_FUNCTION__
 
1360
 
 
1361
#line 442 "gnome-pilot-client.gob"
 
1362
void 
 
1363
gnome_pilot_client_progress_overall (GnomePilotClient * self, const gchar * pilot_name, guint current, guint total)
 
1364
#line 1365 "gnome-pilot-client.c"
 
1365
{
 
1366
#line 442 "gnome-pilot-client.gob"
 
1367
        g_return_if_fail (self != NULL);
 
1368
#line 442 "gnome-pilot-client.gob"
 
1369
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1370
#line 1371 "gnome-pilot-client.c"
 
1371
        gtk_signal_emit (GTK_OBJECT (self),
 
1372
                object_signals[PROGRESS_OVERALL_SIGNAL],
 
1373
                (gpointer )pilot_name,
 
1374
                (guint )current,
 
1375
                (guint )total);
 
1376
}
 
1377
 
 
1378
#line 448 "gnome-pilot-client.gob"
 
1379
void 
 
1380
gnome_pilot_client_message_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message)
 
1381
#line 1382 "gnome-pilot-client.c"
 
1382
{
 
1383
#line 448 "gnome-pilot-client.gob"
 
1384
        g_return_if_fail (self != NULL);
 
1385
#line 448 "gnome-pilot-client.gob"
 
1386
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1387
#line 1388 "gnome-pilot-client.c"
 
1388
        gtk_signal_emit (GTK_OBJECT (self),
 
1389
                object_signals[MESSAGE_CONDUIT_SIGNAL],
 
1390
                (gpointer )pilot_name,
 
1391
                (gpointer )conduit_name,
 
1392
                (gpointer )message);
 
1393
}
 
1394
#line 448 "gnome-pilot-client.gob"
 
1395
static void 
 
1396
___real_gnome_pilot_client_message_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message)
 
1397
#line 1398 "gnome-pilot-client.c"
 
1398
{
 
1399
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::message_conduit"
 
1400
{
 
1401
#line 449 "gnome-pilot-client.gob"
 
1402
        
 
1403
                return;
 
1404
        }}
 
1405
#line 1406 "gnome-pilot-client.c"
 
1406
#undef __GOB_FUNCTION__
 
1407
 
 
1408
#line 453 "gnome-pilot-client.gob"
 
1409
void 
 
1410
gnome_pilot_client_message_daemon (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message)
 
1411
#line 1412 "gnome-pilot-client.c"
 
1412
{
 
1413
#line 453 "gnome-pilot-client.gob"
 
1414
        g_return_if_fail (self != NULL);
 
1415
#line 453 "gnome-pilot-client.gob"
 
1416
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1417
#line 1418 "gnome-pilot-client.c"
 
1418
        gtk_signal_emit (GTK_OBJECT (self),
 
1419
                object_signals[MESSAGE_DAEMON_SIGNAL],
 
1420
                (gpointer )pilot_name,
 
1421
                (gpointer )conduit_name,
 
1422
                (gpointer )message);
 
1423
}
 
1424
#line 453 "gnome-pilot-client.gob"
 
1425
static void 
 
1426
___real_gnome_pilot_client_message_daemon (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message)
 
1427
#line 1428 "gnome-pilot-client.c"
 
1428
{
 
1429
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::message_daemon"
 
1430
{
 
1431
#line 454 "gnome-pilot-client.gob"
 
1432
        
 
1433
                return;
 
1434
        }}
 
1435
#line 1436 "gnome-pilot-client.c"
 
1436
#undef __GOB_FUNCTION__
 
1437
 
 
1438
#line 458 "gnome-pilot-client.gob"
 
1439
void 
 
1440
gnome_pilot_client_error_daemon (GnomePilotClient * self, const gchar * pilot_name, const gchar * message)
 
1441
#line 1442 "gnome-pilot-client.c"
 
1442
{
 
1443
#line 458 "gnome-pilot-client.gob"
 
1444
        g_return_if_fail (self != NULL);
 
1445
#line 458 "gnome-pilot-client.gob"
 
1446
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1447
#line 1448 "gnome-pilot-client.c"
 
1448
        gtk_signal_emit (GTK_OBJECT (self),
 
1449
                object_signals[ERROR_DAEMON_SIGNAL],
 
1450
                (gpointer )pilot_name,
 
1451
                (gpointer )message);
 
1452
}
 
1453
#line 458 "gnome-pilot-client.gob"
 
1454
static void 
 
1455
___real_gnome_pilot_client_error_daemon (GnomePilotClient * self, const gchar * pilot_name, const gchar * message)
 
1456
#line 1457 "gnome-pilot-client.c"
 
1457
{
 
1458
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::error_daemon"
 
1459
{
 
1460
#line 459 "gnome-pilot-client.gob"
 
1461
        
 
1462
                return;
 
1463
        }}
 
1464
#line 1465 "gnome-pilot-client.c"
 
1465
#undef __GOB_FUNCTION__
 
1466
 
 
1467
#line 463 "gnome-pilot-client.gob"
 
1468
void 
 
1469
gnome_pilot_client_error_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message)
 
1470
#line 1471 "gnome-pilot-client.c"
 
1471
{
 
1472
#line 463 "gnome-pilot-client.gob"
 
1473
        g_return_if_fail (self != NULL);
 
1474
#line 463 "gnome-pilot-client.gob"
 
1475
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1476
#line 1477 "gnome-pilot-client.c"
 
1477
        gtk_signal_emit (GTK_OBJECT (self),
 
1478
                object_signals[ERROR_CONDUIT_SIGNAL],
 
1479
                (gpointer )pilot_name,
 
1480
                (gpointer )conduit_name,
 
1481
                (gpointer )message);
 
1482
}
 
1483
#line 463 "gnome-pilot-client.gob"
 
1484
static void 
 
1485
___real_gnome_pilot_client_error_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, const gchar * message)
 
1486
#line 1487 "gnome-pilot-client.c"
 
1487
{
 
1488
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::error_conduit"
 
1489
{
 
1490
#line 464 "gnome-pilot-client.gob"
 
1491
        
 
1492
                return;
 
1493
        }}
 
1494
#line 1495 "gnome-pilot-client.c"
 
1495
#undef __GOB_FUNCTION__
 
1496
 
 
1497
#line 468 "gnome-pilot-client.gob"
 
1498
void 
 
1499
gnome_pilot_client_daemon_pause (GnomePilotClient * self, gboolean on_off)
 
1500
#line 1501 "gnome-pilot-client.c"
 
1501
{
 
1502
#line 468 "gnome-pilot-client.gob"
 
1503
        g_return_if_fail (self != NULL);
 
1504
#line 468 "gnome-pilot-client.gob"
 
1505
        g_return_if_fail (GNOME_IS_PILOT_CLIENT (self));
 
1506
#line 1507 "gnome-pilot-client.c"
 
1507
        gtk_signal_emit (GTK_OBJECT (self),
 
1508
                object_signals[DAEMON_PAUSE_SIGNAL],
 
1509
                (gboolean )on_off);
 
1510
}
 
1511
#line 468 "gnome-pilot-client.gob"
 
1512
static void 
 
1513
___real_gnome_pilot_client_daemon_pause (GnomePilotClient * self, gboolean on_off)
 
1514
#line 1515 "gnome-pilot-client.c"
 
1515
{
 
1516
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::daemon_pause"
 
1517
{
 
1518
#line 469 "gnome-pilot-client.gob"
 
1519
        
 
1520
                return;
 
1521
        }}
 
1522
#line 1523 "gnome-pilot-client.c"
 
1523
#undef __GOB_FUNCTION__
 
1524
 
 
1525
#line 473 "gnome-pilot-client.gob"
 
1526
gint 
 
1527
gnome_pilot_client_pause_daemon (GnomePilotClient * self)
 
1528
#line 1529 "gnome-pilot-client.c"
 
1529
{
 
1530
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::pause_daemon"
 
1531
#line 473 "gnome-pilot-client.gob"
 
1532
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
1533
#line 473 "gnome-pilot-client.gob"
 
1534
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
1535
#line 1536 "gnome-pilot-client.c"
 
1536
{
 
1537
#line 473 "gnome-pilot-client.gob"
 
1538
        
 
1539
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
1540
 
 
1541
                GNOME_Pilot_Daemon_pause (self->gpilotddaemon,TRUE,&self->ev);
 
1542
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
1543
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
1544
                        CORBA_exception_free (&self->ev);
 
1545
                        return GPILOTD_ERR_FAILED;
 
1546
                }
 
1547
                return GPILOTD_OK;
 
1548
        }}
 
1549
#line 1550 "gnome-pilot-client.c"
 
1550
#undef __GOB_FUNCTION__
 
1551
 
 
1552
#line 485 "gnome-pilot-client.gob"
 
1553
gint 
 
1554
gnome_pilot_client_unpause_daemon (GnomePilotClient * self)
 
1555
#line 1556 "gnome-pilot-client.c"
 
1556
{
 
1557
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::unpause_daemon"
 
1558
#line 485 "gnome-pilot-client.gob"
 
1559
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
1560
#line 485 "gnome-pilot-client.gob"
 
1561
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
1562
#line 1563 "gnome-pilot-client.c"
 
1563
{
 
1564
#line 485 "gnome-pilot-client.gob"
 
1565
        
 
1566
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
1567
 
 
1568
                GNOME_Pilot_Daemon_pause (self->gpilotddaemon,FALSE,&self->ev);
 
1569
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
1570
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
1571
                        CORBA_exception_free (&self->ev);
 
1572
                        return GPILOTD_ERR_FAILED;
 
1573
                }
 
1574
                return GPILOTD_OK;
 
1575
        }}
 
1576
#line 1577 "gnome-pilot-client.c"
 
1577
#undef __GOB_FUNCTION__
 
1578
 
 
1579
#line 497 "gnome-pilot-client.gob"
 
1580
gint 
 
1581
gnome_pilot_client_noop (GnomePilotClient * self)
 
1582
#line 1583 "gnome-pilot-client.c"
 
1583
{
 
1584
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::noop"
 
1585
#line 497 "gnome-pilot-client.gob"
 
1586
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
1587
#line 497 "gnome-pilot-client.gob"
 
1588
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
1589
#line 1590 "gnome-pilot-client.c"
 
1590
{
 
1591
#line 497 "gnome-pilot-client.gob"
 
1592
        
 
1593
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
1594
 
 
1595
                GNOME_Pilot_Daemon_noop (self->gpilotddaemon, &self->ev);
 
1596
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
1597
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
1598
                        CORBA_exception_free (&self->ev);
 
1599
                        return GPILOTD_ERR_NOT_CONNECTED;
 
1600
                }
 
1601
                return GPILOTD_OK;
 
1602
        }}
 
1603
#line 1604 "gnome-pilot-client.c"
 
1604
#undef __GOB_FUNCTION__
 
1605
 
 
1606
#line 509 "gnome-pilot-client.gob"
 
1607
gint 
 
1608
gnome_pilot_client_restart_daemon (GnomePilotClient * self)
 
1609
#line 1610 "gnome-pilot-client.c"
 
1610
{
 
1611
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::restart_daemon"
 
1612
#line 509 "gnome-pilot-client.gob"
 
1613
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
1614
#line 509 "gnome-pilot-client.gob"
 
1615
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
1616
#line 1617 "gnome-pilot-client.c"
 
1617
{
 
1618
#line 509 "gnome-pilot-client.gob"
 
1619
        
 
1620
                pid_t pid;
 
1621
                
 
1622
                /* NOTE: this is going to suck when gpilotd is running on another machine... */
 
1623
                pid = gpilotd_get_pid ();
 
1624
                if (pid == -1) return -1;
 
1625
                
 
1626
                kill (pid,SIGTERM);
 
1627
                return connect_to_daemon (self);
 
1628
        }}
 
1629
#line 1630 "gnome-pilot-client.c"
 
1630
#undef __GOB_FUNCTION__
 
1631
 
 
1632
#line 520 "gnome-pilot-client.gob"
 
1633
gint 
 
1634
gnome_pilot_client_monitor_on (GnomePilotClient * self, const gchar * pilot_id)
 
1635
#line 1636 "gnome-pilot-client.c"
 
1636
{
 
1637
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::monitor_on"
 
1638
#line 520 "gnome-pilot-client.gob"
 
1639
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
1640
#line 520 "gnome-pilot-client.gob"
 
1641
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
1642
#line 520 "gnome-pilot-client.gob"
 
1643
        g_return_val_if_fail (pilot_id != NULL, (gint )GPILOTD_ERR_INVAL);
 
1644
#line 1645 "gnome-pilot-client.c"
 
1645
{
 
1646
#line 521 "gnome-pilot-client.gob"
 
1647
        
 
1648
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
1649
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
1650
                GNOME_Pilot_Daemon_monitor_on (self->gpilotddaemon,self->gpilotdclient,pilot_id,&self->ev);
 
1651
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
1652
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
1653
                        CORBA_exception_free (&self->ev);
 
1654
                        return GPILOTD_ERR_FAILED;
 
1655
                }
 
1656
                return GPILOTD_OK;
 
1657
        }}
 
1658
#line 1659 "gnome-pilot-client.c"
 
1659
#undef __GOB_FUNCTION__
 
1660
 
 
1661
#line 533 "gnome-pilot-client.gob"
 
1662
gint 
 
1663
gnome_pilot_client_monitor_on_all_pilots (GnomePilotClient * self)
 
1664
#line 1665 "gnome-pilot-client.c"
 
1665
{
 
1666
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::monitor_on_all_pilots"
 
1667
#line 533 "gnome-pilot-client.gob"
 
1668
        g_return_val_if_fail (self != NULL, (gint )0);
 
1669
#line 533 "gnome-pilot-client.gob"
 
1670
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )0);
 
1671
#line 1672 "gnome-pilot-client.c"
 
1672
{
 
1673
#line 533 "gnome-pilot-client.gob"
 
1674
        
 
1675
                GList   *pilots = NULL,
 
1676
                        *ptr;
 
1677
                gint ret = GPILOTD_OK;
 
1678
                
 
1679
                if (get_pilots (self,&pilots) != GPILOTD_OK) return GPILOTD_ERR_FAILED;
 
1680
                
 
1681
                for (ptr = pilots; ptr; ptr = ptr->next) {
 
1682
                        ret = monitor_on (self,(gchar*)ptr->data);
 
1683
                }
 
1684
                g_list_foreach (pilots,(GFunc)g_free,NULL);
 
1685
                return ret;
 
1686
        }}
 
1687
#line 1688 "gnome-pilot-client.c"
 
1688
#undef __GOB_FUNCTION__
 
1689
 
 
1690
#line 547 "gnome-pilot-client.gob"
 
1691
gint 
 
1692
gnome_pilot_client_monitor_off (GnomePilotClient * self, const gchar * pilot_id)
 
1693
#line 1694 "gnome-pilot-client.c"
 
1694
{
 
1695
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::monitor_off"
 
1696
#line 547 "gnome-pilot-client.gob"
 
1697
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
1698
#line 547 "gnome-pilot-client.gob"
 
1699
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
1700
#line 547 "gnome-pilot-client.gob"
 
1701
        g_return_val_if_fail (pilot_id != NULL, (gint )GPILOTD_ERR_INVAL);
 
1702
#line 1703 "gnome-pilot-client.c"
 
1703
{
 
1704
#line 548 "gnome-pilot-client.gob"
 
1705
        
 
1706
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
1707
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
1708
 
 
1709
                GNOME_Pilot_Daemon_monitor_off (self->gpilotddaemon,self->gpilotdclient,pilot_id,&self->ev);
 
1710
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
1711
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
1712
                        CORBA_exception_free (&self->ev);
 
1713
                        return GPILOTD_ERR_FAILED;
 
1714
                }
 
1715
                return GPILOTD_OK;
 
1716
        }}
 
1717
#line 1718 "gnome-pilot-client.c"
 
1718
#undef __GOB_FUNCTION__
 
1719
 
 
1720
#line 561 "gnome-pilot-client.gob"
 
1721
gint 
 
1722
gnome_pilot_client_monitor_off_all_pilots (GnomePilotClient * self)
 
1723
#line 1724 "gnome-pilot-client.c"
 
1724
{
 
1725
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::monitor_off_all_pilots"
 
1726
#line 561 "gnome-pilot-client.gob"
 
1727
        g_return_val_if_fail (self != NULL, (gint )0);
 
1728
#line 561 "gnome-pilot-client.gob"
 
1729
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )0);
 
1730
#line 1731 "gnome-pilot-client.c"
 
1731
{
 
1732
#line 561 "gnome-pilot-client.gob"
 
1733
        
 
1734
                GList   *pilots = NULL,
 
1735
                        *ptr;
 
1736
                gint ret = GPILOTD_OK;
 
1737
                
 
1738
                if (get_pilots (self,&pilots) != GPILOTD_OK) return GPILOTD_ERR_FAILED;
 
1739
                
 
1740
                for (ptr = pilots; ptr; ptr = ptr->next) {
 
1741
                        ret = monitor_on (self,(gchar*)ptr->data);
 
1742
                }
 
1743
                g_list_foreach (pilots,(GFunc)g_free,NULL);
 
1744
                return ret;
 
1745
        }}
 
1746
#line 1747 "gnome-pilot-client.c"
 
1747
#undef __GOB_FUNCTION__
 
1748
 
 
1749
#line 575 "gnome-pilot-client.gob"
 
1750
gint 
 
1751
gnome_pilot_client_notify_on (GnomePilotClient * self, GNOME_Pilot_EventType type)
 
1752
#line 1753 "gnome-pilot-client.c"
 
1753
{
 
1754
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::notify_on"
 
1755
#line 575 "gnome-pilot-client.gob"
 
1756
        g_return_val_if_fail (self != NULL, (gint )0);
 
1757
#line 575 "gnome-pilot-client.gob"
 
1758
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )0);
 
1759
#line 1760 "gnome-pilot-client.c"
 
1760
{
 
1761
#line 576 "gnome-pilot-client.gob"
 
1762
        
 
1763
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
1764
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
1765
 
 
1766
                GNOME_Pilot_Daemon_notify_on (self->gpilotddaemon,type,self->gpilotdclient,&self->ev);
 
1767
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
1768
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
1769
                        CORBA_exception_free (&self->ev);
 
1770
                        return GPILOTD_ERR_FAILED;
 
1771
                }
 
1772
                return GPILOTD_OK;
 
1773
        }}
 
1774
#line 1775 "gnome-pilot-client.c"
 
1775
#undef __GOB_FUNCTION__
 
1776
 
 
1777
#line 589 "gnome-pilot-client.gob"
 
1778
gint 
 
1779
gnome_pilot_client_notify_off (GnomePilotClient * self, GNOME_Pilot_EventType type)
 
1780
#line 1781 "gnome-pilot-client.c"
 
1781
{
 
1782
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::notify_off"
 
1783
#line 589 "gnome-pilot-client.gob"
 
1784
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
1785
#line 589 "gnome-pilot-client.gob"
 
1786
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
1787
#line 1788 "gnome-pilot-client.c"
 
1788
{
 
1789
#line 590 "gnome-pilot-client.gob"
 
1790
        
 
1791
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
1792
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
1793
 
 
1794
                GNOME_Pilot_Daemon_notify_off (self->gpilotddaemon,type,self->gpilotdclient,&self->ev);
 
1795
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
1796
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
1797
                        CORBA_exception_free (&self->ev);
 
1798
                        return GPILOTD_ERR_FAILED;
 
1799
                }
 
1800
                return GPILOTD_OK;
 
1801
        }}
 
1802
#line 1803 "gnome-pilot-client.c"
 
1803
#undef __GOB_FUNCTION__
 
1804
 
 
1805
#line 603 "gnome-pilot-client.gob"
 
1806
gint 
 
1807
gnome_pilot_client_restore (GnomePilotClient * self, const gchar * pilot_id, const gchar * directory, GNOME_Pilot_Survival survival, gint timeout, gint * handle)
 
1808
#line 1809 "gnome-pilot-client.c"
 
1809
{
 
1810
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::restore"
 
1811
#line 603 "gnome-pilot-client.gob"
 
1812
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
1813
#line 603 "gnome-pilot-client.gob"
 
1814
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
1815
#line 603 "gnome-pilot-client.gob"
 
1816
        g_return_val_if_fail (pilot_id != NULL, (gint )GPILOTD_ERR_INVAL);
 
1817
#line 603 "gnome-pilot-client.gob"
 
1818
        g_return_val_if_fail (directory != NULL, (gint )GPILOTD_ERR_INVAL);
 
1819
#line 603 "gnome-pilot-client.gob"
 
1820
        g_return_val_if_fail (timeout >= 0, (gint )GPILOTD_ERR_INVAL);
 
1821
#line 1822 "gnome-pilot-client.c"
 
1822
{
 
1823
#line 608 "gnome-pilot-client.gob"
 
1824
        
 
1825
                gint val;
 
1826
 
 
1827
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
1828
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
1829
 
 
1830
                val = GNOME_Pilot_Daemon_request_restore (self->gpilotddaemon,
 
1831
                                                         self->gpilotdclient,
 
1832
                                                         pilot_id,
 
1833
                                                         directory,
 
1834
                                                         survival,
 
1835
                                                         timeout,
 
1836
                                                         &self->ev);
 
1837
                switch (self->ev._major) {
 
1838
                case CORBA_SYSTEM_EXCEPTION:
 
1839
                case CORBA_USER_EXCEPTION: {
 
1840
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
1841
                        if (strcmp (ex_GNOME_Pilot_MissingFile,CORBA_exception_id (&self->ev))==0) {
 
1842
                                g_warning ("Missing file");
 
1843
                        } 
 
1844
                        CORBA_exception_free (&self->ev);
 
1845
                        return GPILOTD_ERR_FAILED;
 
1846
                        break;
 
1847
                }
 
1848
                case CORBA_NO_EXCEPTION: 
 
1849
                default:
 
1850
                        break;
 
1851
                }
 
1852
 
 
1853
                if (handle!=NULL) *handle = val;
 
1854
 
 
1855
                return GPILOTD_OK;
 
1856
        }}
 
1857
#line 1858 "gnome-pilot-client.c"
 
1858
#undef __GOB_FUNCTION__
 
1859
 
 
1860
#line 642 "gnome-pilot-client.gob"
 
1861
gint 
 
1862
gnome_pilot_client_install_file (GnomePilotClient * self, const gchar * pilot_name, const gchar * infile, GNOME_Pilot_Survival survival, gint timeout, gint * handle)
 
1863
#line 1864 "gnome-pilot-client.c"
 
1864
{
 
1865
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::install_file"
 
1866
#line 642 "gnome-pilot-client.gob"
 
1867
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
1868
#line 642 "gnome-pilot-client.gob"
 
1869
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
1870
#line 642 "gnome-pilot-client.gob"
 
1871
        g_return_val_if_fail (pilot_name != NULL, (gint )GPILOTD_ERR_INVAL);
 
1872
#line 642 "gnome-pilot-client.gob"
 
1873
        g_return_val_if_fail (infile != NULL, (gint )GPILOTD_ERR_INVAL);
 
1874
#line 642 "gnome-pilot-client.gob"
 
1875
        g_return_val_if_fail (timeout >= 0, (gint )GPILOTD_ERR_INVAL);
 
1876
#line 1877 "gnome-pilot-client.c"
 
1877
{
 
1878
#line 647 "gnome-pilot-client.gob"
 
1879
        
 
1880
                gint val;
 
1881
                gboolean file_copied = FALSE;
 
1882
                gchar *filename;
 
1883
 
 
1884
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
1885
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
1886
               
 
1887
                /* g_message ("Installing %s to %s", infile, pilot_name); */
 
1888
 
 
1889
#ifdef WITH_VFS
 
1890
                {
 
1891
                        GnomeVFSResult result;
 
1892
                        GnomeVFSXferOptions xfer_options = 0;
 
1893
                        GnomeVFSURI *src_uri;
 
1894
                        GnomeVFSURI *dest_uri;
 
1895
                        char *filename_uri;
 
1896
                        char pwd[128];
 
1897
                        char *infile_with_path;
 
1898
                        gchar *queue;
 
1899
 
 
1900
                        queue = g_strdup_printf ("%s/.gpilotd/",g_get_home_dir ());
 
1901
                        filename = tempnam (queue,"PDB");
 
1902
                                                
 
1903
                        filename_uri = g_strdup_printf ("file://%s", filename);
 
1904
 
 
1905
                        /*
 
1906
                        g_message ("%s test is %d %d", infile, 
 
1907
                                   infile[0] != '/',
 
1908
                                   strncmp (infile, "file:/", 6)!=0);
 
1909
                        */
 
1910
 
 
1911
                        if (infile[0] != '/' && strncmp (infile, "file:/", 6)!=0) {
 
1912
                                /* gnomevfs needs the file with path */
 
1913
                                getcwd (pwd, 127);
 
1914
                                infile_with_path = g_strdup_printf ("%s/%s", pwd, infile);
 
1915
                        } else {
 
1916
                                infile_with_path = g_strdup (infile);
 
1917
                        }
 
1918
 
 
1919
                        src_uri = gnome_vfs_uri_new (infile_with_path);
 
1920
                        dest_uri = gnome_vfs_uri_new (filename_uri);
 
1921
 
 
1922
                        /*
 
1923
                        g_message ("from : \"%s\"", infile_with_path);
 
1924
                        g_message ("to   : \"%s\"", filename_uri);
 
1925
                        */
 
1926
 
 
1927
                        result = gnome_vfs_xfer_uri (src_uri, dest_uri,
 
1928
                                                     xfer_options,
 
1929
                                                     GNOME_VFS_XFER_ERROR_MODE_QUERY,
 
1930
                                                     GNOME_VFS_XFER_OVERWRITE_MODE_QUERY,
 
1931
                                                     (GnomeVFSXferProgressCallback)xfer_callback, 
 
1932
                                                     self);
 
1933
 
 
1934
                        /* g_message ("gnome-vfs-xfer-uri: %s\n",gnome_vfs_result_to_string (result));  */
 
1935
 
 
1936
                        if (result == GNOME_VFS_OK) {
 
1937
                                file_copied = TRUE;
 
1938
                        } else {
 
1939
                                file_copied = FALSE;
 
1940
                        }
 
1941
                        g_free (filename_uri);
 
1942
                        gnome_vfs_uri_unref (src_uri);
 
1943
                        gnome_vfs_uri_unref (dest_uri);
 
1944
                        g_free (queue);
 
1945
                        g_free (infile_with_path);                      
 
1946
                }
 
1947
#else /* WITH_VFS */
 
1948
                {
 
1949
                        gchar *queue;
 
1950
                        FILE *in,*out;
 
1951
 
 
1952
                        queue = g_strdup_printf ("%s/.gnome/gnome-pilot.d/",g_get_home_dir ());
 
1953
                        filename = tempnam (queue,"PDB");                       
 
1954
                        
 
1955
                        in = fopen (infile,"rb");
 
1956
                        if (in==NULL) {
 
1957
                                file_copied = FALSE;
 
1958
                        } 
 
1959
 
 
1960
                        out = fopen (filename,"wb");
 
1961
                        if (out==NULL) {
 
1962
                                file_copied = FALSE;
 
1963
                        }
 
1964
                        
 
1965
                        while (!feof (in)) {
 
1966
                                size_t act;
 
1967
                                char block[1024];
 
1968
                                act=fread (block,1,1024,in);
 
1969
                                if (ferror (in)) {
 
1970
                                        file_copied = FALSE;
 
1971
                                }
 
1972
                                if (fwrite (block,1,act,out)!=act) {
 
1973
                                        file_copied = FALSE;
 
1974
                                }
 
1975
                                if (ferror (out)) {
 
1976
                                        file_copied = FALSE;
 
1977
                                }
 
1978
                        }
 
1979
                        
 
1980
                        if (out) {
 
1981
                                fflush (out);
 
1982
                        }
 
1983
                        if (in) {
 
1984
                                fclose (in); 
 
1985
                        }
 
1986
                        if (out) {
 
1987
                                fclose (out);           
 
1988
                        }
 
1989
                        g_free (queue);
 
1990
                }
 
1991
#endif /* WITH_VFS */
 
1992
                if (file_copied == FALSE) {
 
1993
#ifndef WITH_VFS
 
1994
                        g_message ("File copy failed");
 
1995
#endif
 
1996
                        free (filename);
 
1997
                        return GPILOTD_ERR_FAILED;
 
1998
                }
 
1999
 
 
2000
                val = GNOME_Pilot_Daemon_request_install (self->gpilotddaemon,
 
2001
                                                         self->gpilotdclient,
 
2002
                                                         pilot_name,
 
2003
                                                         filename,
 
2004
                                                         infile,
 
2005
                                                         survival,
 
2006
                                                         timeout,
 
2007
                                                         &self->ev);
 
2008
                switch (self->ev._major) {
 
2009
                case CORBA_NO_EXCEPTION: 
 
2010
                        break;
 
2011
                case CORBA_SYSTEM_EXCEPTION:
 
2012
                case CORBA_USER_EXCEPTION:
 
2013
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
2014
                        
 
2015
                        if (strcmp (ex_GNOME_Pilot_MissingFile,CORBA_exception_id (&self->ev))==0) {
 
2016
                                g_warning ("Missing file");
 
2017
                        } else {
 
2018
                                unlink (filename);
 
2019
                        }
 
2020
                        CORBA_exception_free (&self->ev);
 
2021
                        free (filename);
 
2022
                        return GPILOTD_ERR_FAILED;
 
2023
                        break;
 
2024
                default:
 
2025
                        break;
 
2026
                }
 
2027
 
 
2028
                if (handle!=NULL) *handle = val;
 
2029
 
 
2030
                free (filename);
 
2031
                return GPILOTD_OK;
 
2032
        }}
 
2033
#line 2034 "gnome-pilot-client.c"
 
2034
#undef __GOB_FUNCTION__
 
2035
 
 
2036
#line 802 "gnome-pilot-client.gob"
 
2037
gint 
 
2038
gnome_pilot_client_get_user_info (GnomePilotClient * self, gchar * cradle_name, GNOME_Pilot_Survival survival, gint timeout, gint * handle)
 
2039
#line 2040 "gnome-pilot-client.c"
 
2040
{
 
2041
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_user_info"
 
2042
#line 802 "gnome-pilot-client.gob"
 
2043
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2044
#line 802 "gnome-pilot-client.gob"
 
2045
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2046
#line 802 "gnome-pilot-client.gob"
 
2047
        g_return_val_if_fail (cradle_name != NULL, (gint )GPILOTD_ERR_INVAL);
 
2048
#line 802 "gnome-pilot-client.gob"
 
2049
        g_return_val_if_fail (timeout >= 0, (gint )GPILOTD_ERR_INVAL);
 
2050
#line 2051 "gnome-pilot-client.c"
 
2051
{
 
2052
#line 806 "gnome-pilot-client.gob"
 
2053
        
 
2054
                gint val;
 
2055
 
 
2056
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
2057
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
2058
 
 
2059
                val = GNOME_Pilot_Daemon_get_user_info (self->gpilotddaemon,
 
2060
                                                       self->gpilotdclient,
 
2061
                                                       cradle_name,
 
2062
                                                       survival,
 
2063
                                                       timeout,
 
2064
                                                       &self->ev);
 
2065
 
 
2066
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2067
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
2068
                        CORBA_exception_free (&self->ev);
 
2069
                        return GPILOTD_ERR_FAILED;
 
2070
                }
 
2071
 
 
2072
                if (handle!=NULL) *handle =val;
 
2073
 
 
2074
                return GPILOTD_OK;
 
2075
        }}
 
2076
#line 2077 "gnome-pilot-client.c"
 
2077
#undef __GOB_FUNCTION__
 
2078
 
 
2079
#line 830 "gnome-pilot-client.gob"
 
2080
gint 
 
2081
gnome_pilot_client_set_user_info (GnomePilotClient * self, gchar * cradle_name, GNOME_Pilot_UserInfo user, gboolean continue_sync, GNOME_Pilot_Survival survival, gint timeout, gint * handle)
 
2082
#line 2083 "gnome-pilot-client.c"
 
2083
{
 
2084
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::set_user_info"
 
2085
#line 830 "gnome-pilot-client.gob"
 
2086
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2087
#line 830 "gnome-pilot-client.gob"
 
2088
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2089
#line 830 "gnome-pilot-client.gob"
 
2090
        g_return_val_if_fail (cradle_name != NULL, (gint )GPILOTD_ERR_INVAL);
 
2091
#line 830 "gnome-pilot-client.gob"
 
2092
        g_return_val_if_fail (timeout >= 0, (gint )GPILOTD_ERR_INVAL);
 
2093
#line 2094 "gnome-pilot-client.c"
 
2094
{
 
2095
#line 836 "gnome-pilot-client.gob"
 
2096
        
 
2097
                gint val;
 
2098
 
 
2099
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
2100
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
2101
 
 
2102
                val = GNOME_Pilot_Daemon_set_user_info (self->gpilotddaemon,
 
2103
                                                       self->gpilotdclient,
 
2104
                                                       &user,
 
2105
                                                       cradle_name,
 
2106
                                                       continue_sync,
 
2107
                                                       survival,
 
2108
                                                       timeout,
 
2109
                                                       &self->ev);
 
2110
 
 
2111
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2112
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
2113
                        CORBA_exception_free (&self->ev);
 
2114
                        return GPILOTD_ERR_FAILED;
 
2115
                }
 
2116
 
 
2117
                if (handle!=NULL) *handle =val;
 
2118
 
 
2119
                return GPILOTD_OK;
 
2120
        }}
 
2121
#line 2122 "gnome-pilot-client.c"
 
2122
#undef __GOB_FUNCTION__
 
2123
 
 
2124
#line 862 "gnome-pilot-client.gob"
 
2125
gint 
 
2126
gnome_pilot_client_get_system_info (GnomePilotClient * self, gchar * cradle_name, GNOME_Pilot_Survival survival, gint timeout, gint * handle)
 
2127
#line 2128 "gnome-pilot-client.c"
 
2128
{
 
2129
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_system_info"
 
2130
#line 862 "gnome-pilot-client.gob"
 
2131
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2132
#line 862 "gnome-pilot-client.gob"
 
2133
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2134
#line 862 "gnome-pilot-client.gob"
 
2135
        g_return_val_if_fail (cradle_name != NULL, (gint )GPILOTD_ERR_INVAL);
 
2136
#line 2137 "gnome-pilot-client.c"
 
2137
{
 
2138
#line 866 "gnome-pilot-client.gob"
 
2139
        
 
2140
                gint val;
 
2141
 
 
2142
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
2143
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
2144
 
 
2145
                val = GNOME_Pilot_Daemon_get_system_info (self->gpilotddaemon,
 
2146
                                                         self->gpilotdclient,
 
2147
                                                         cradle_name,
 
2148
                                                         survival,
 
2149
                                                         timeout,
 
2150
                                                         &self->ev);
 
2151
 
 
2152
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2153
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
2154
                        CORBA_exception_free (&self->ev);
 
2155
                        return GPILOTD_ERR_FAILED;
 
2156
                }
 
2157
 
 
2158
                if (handle!=NULL) *handle =val;
 
2159
 
 
2160
                return GPILOTD_OK;
 
2161
        }}
 
2162
#line 2163 "gnome-pilot-client.c"
 
2163
#undef __GOB_FUNCTION__
 
2164
 
 
2165
#line 890 "gnome-pilot-client.gob"
 
2166
gint 
 
2167
gnome_pilot_client_remove_request (GnomePilotClient * self, gint handle)
 
2168
#line 2169 "gnome-pilot-client.c"
 
2169
{
 
2170
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::remove_request"
 
2171
#line 890 "gnome-pilot-client.gob"
 
2172
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2173
#line 890 "gnome-pilot-client.gob"
 
2174
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2175
#line 2176 "gnome-pilot-client.c"
 
2176
{
 
2177
#line 891 "gnome-pilot-client.gob"
 
2178
        
 
2179
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
2180
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
2181
 
 
2182
                GNOME_Pilot_Daemon_remove_request (self->gpilotddaemon,handle,&self->ev);
 
2183
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2184
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
2185
                        CORBA_exception_free (&self->ev);
 
2186
                        return GPILOTD_ERR_FAILED;
 
2187
                }
 
2188
                return GPILOTD_OK;              
 
2189
        }}
 
2190
#line 2191 "gnome-pilot-client.c"
 
2191
#undef __GOB_FUNCTION__
 
2192
 
 
2193
#line 904 "gnome-pilot-client.gob"
 
2194
gint 
 
2195
gnome_pilot_client_conduit (GnomePilotClient * self, const gchar * pilot_name, const gchar * conduit_name, GNOME_Pilot_ConduitOperation operation, GNOME_Pilot_Survival survival, gint timeout, gint * handle)
 
2196
#line 2197 "gnome-pilot-client.c"
 
2197
{
 
2198
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::conduit"
 
2199
#line 904 "gnome-pilot-client.gob"
 
2200
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2201
#line 904 "gnome-pilot-client.gob"
 
2202
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2203
#line 904 "gnome-pilot-client.gob"
 
2204
        g_return_val_if_fail (pilot_name != NULL, (gint )GPILOTD_ERR_INVAL);
 
2205
#line 904 "gnome-pilot-client.gob"
 
2206
        g_return_val_if_fail (conduit_name != NULL, (gint )GPILOTD_ERR_INVAL);
 
2207
#line 904 "gnome-pilot-client.gob"
 
2208
        g_return_val_if_fail (timeout >= 0, (gint )GPILOTD_ERR_INVAL);
 
2209
#line 2210 "gnome-pilot-client.c"
 
2210
{
 
2211
#line 910 "gnome-pilot-client.gob"
 
2212
        
 
2213
                gint val;
 
2214
 
 
2215
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
2216
                g_return_val_if_fail (self->gpilotdclient!=NULL, GPILOTD_ERR_INTERNAL);
 
2217
                
 
2218
                val = GNOME_Pilot_Daemon_request_conduit (self->gpilotddaemon,
 
2219
                                                         self->gpilotdclient,
 
2220
                                                         pilot_name,
 
2221
                                                         conduit_name,
 
2222
                                                         operation,
 
2223
                                                         survival,
 
2224
                                                         timeout,
 
2225
                                                         &self->ev);
 
2226
                
 
2227
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2228
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
2229
                        CORBA_exception_free (&self->ev);
 
2230
                        return GPILOTD_ERR_FAILED;
 
2231
                }
 
2232
 
 
2233
                if (handle!=NULL) *handle =val;
 
2234
 
 
2235
                return GPILOTD_OK;
 
2236
        }}
 
2237
#line 2238 "gnome-pilot-client.c"
 
2238
#undef __GOB_FUNCTION__
 
2239
 
 
2240
#line 936 "gnome-pilot-client.gob"
 
2241
static gint 
 
2242
gnome_pilot_client_get_triple_ptr (GnomePilotClient * self, enum get_triple_ptr_action action, const gchar * name, GList ** output)
 
2243
#line 2244 "gnome-pilot-client.c"
 
2244
{
 
2245
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_triple_ptr"
 
2246
#line 936 "gnome-pilot-client.gob"
 
2247
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2248
#line 936 "gnome-pilot-client.gob"
 
2249
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2250
#line 936 "gnome-pilot-client.gob"
 
2251
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2252
#line 2253 "gnome-pilot-client.c"
 
2253
{
 
2254
#line 939 "gnome-pilot-client.gob"
 
2255
        
 
2256
                GNOME_Pilot_StringSequence *seq=NULL;
 
2257
                GNOME_Pilot_LongSequence *seq_long=NULL;
 
2258
        
 
2259
#ifndef G_DISABLE_CHECKS                
 
2260
                if (*output!=NULL) {
 
2261
                        g_warning ("%s:%d: get_triple_ptr called with non-null pointer for output, leak-alert!",
 
2262
                                  __FILE__,__LINE__);
 
2263
                }
 
2264
#endif
 
2265
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
2266
 
 
2267
                (*output) = NULL;
 
2268
 
 
2269
                switch (action) {
 
2270
                case GPILOTD_APP_PILOT_NAMES:
 
2271
                        seq = GNOME_Pilot_Daemon_get_pilots (self->gpilotddaemon, &self->ev);
 
2272
                        break;
 
2273
                case GPILOTD_APP_PILOT_IDS:
 
2274
                        seq_long = GNOME_Pilot_Daemon_get_pilot_ids (self->gpilotddaemon, &self->ev);
 
2275
                        break;
 
2276
                case GPILOTD_APP_PILOTS_BY_NAME:
 
2277
                        seq = GNOME_Pilot_Daemon_get_pilots_by_user_name (self->gpilotddaemon,name,&self->ev);
 
2278
                        break;
 
2279
                case GPILOTD_APP_PILOTS_BY_LOGIN:
 
2280
                        seq = GNOME_Pilot_Daemon_get_pilots_by_user_login (self->gpilotddaemon,name,&self->ev);
 
2281
                        break;
 
2282
                case GPILOTD_APP_USER_NAMES:
 
2283
                        seq = GNOME_Pilot_Daemon_get_users (self->gpilotddaemon,&self->ev);
 
2284
                        break;
 
2285
                case GPILOTD_APP_DATABASES_FROM_CACHE:
 
2286
                        seq = GNOME_Pilot_Daemon_get_databases_from_cache (self->gpilotddaemon,name,&self->ev);
 
2287
                        break;
 
2288
                case GPILOTD_APP_CRADLES:
 
2289
                        seq = GNOME_Pilot_Daemon_get_cradles (self->gpilotddaemon,&self->ev);
 
2290
                        break;
 
2291
                }
 
2292
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2293
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
2294
                        CORBA_exception_free (&self->ev);
 
2295
                        return GPILOTD_ERR_FAILED;
 
2296
                }
 
2297
                if (seq && seq->_length>0) {
 
2298
                        int i;
 
2299
                        for (i=0;i<seq->_length;i++) {
 
2300
                                if (strlen (seq->_buffer[i]))
 
2301
                                        (*output) = g_list_append ((*output),g_strdup (seq->_buffer[i]));
 
2302
                        }
 
2303
                } 
 
2304
                if (seq_long && seq_long->_length>0) {
 
2305
                        int i;
 
2306
                        for (i=0;i<seq_long->_length;i++) {
 
2307
                                (*output) = g_list_append ((*output),
 
2308
                                                           GINT_TO_POINTER (seq_long->_buffer[i]));
 
2309
                        }
 
2310
                } 
 
2311
                
 
2312
                CORBA_free (seq);
 
2313
                CORBA_free (seq_long);
 
2314
 
 
2315
                return GPILOTD_OK;
 
2316
        }}
 
2317
#line 2318 "gnome-pilot-client.c"
 
2318
#undef __GOB_FUNCTION__
 
2319
 
 
2320
#line 1002 "gnome-pilot-client.gob"
 
2321
gint 
 
2322
gnome_pilot_client_get_users (GnomePilotClient * self, GList ** output)
 
2323
#line 2324 "gnome-pilot-client.c"
 
2324
{
 
2325
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_users"
 
2326
#line 1002 "gnome-pilot-client.gob"
 
2327
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2328
#line 1002 "gnome-pilot-client.gob"
 
2329
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2330
#line 1002 "gnome-pilot-client.gob"
 
2331
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2332
#line 2333 "gnome-pilot-client.c"
 
2333
{
 
2334
#line 1003 "gnome-pilot-client.gob"
 
2335
        
 
2336
                return get_triple_ptr (self,GPILOTD_APP_USER_NAMES,NULL,output);
 
2337
        }}
 
2338
#line 2339 "gnome-pilot-client.c"
 
2339
#undef __GOB_FUNCTION__
 
2340
 
 
2341
#line 1007 "gnome-pilot-client.gob"
 
2342
gint 
 
2343
gnome_pilot_client_get_databases_from_cache (GnomePilotClient * self, const gchar * pilot_name, GList ** output)
 
2344
#line 2345 "gnome-pilot-client.c"
 
2345
{
 
2346
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_databases_from_cache"
 
2347
#line 1007 "gnome-pilot-client.gob"
 
2348
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2349
#line 1007 "gnome-pilot-client.gob"
 
2350
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2351
#line 1007 "gnome-pilot-client.gob"
 
2352
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2353
#line 2354 "gnome-pilot-client.c"
 
2354
{
 
2355
#line 1009 "gnome-pilot-client.gob"
 
2356
        
 
2357
                return get_triple_ptr (self,GPILOTD_APP_DATABASES_FROM_CACHE,pilot_name,output);
 
2358
        }}
 
2359
#line 2360 "gnome-pilot-client.c"
 
2360
#undef __GOB_FUNCTION__
 
2361
 
 
2362
#line 1013 "gnome-pilot-client.gob"
 
2363
gint 
 
2364
gnome_pilot_client_get_cradles (GnomePilotClient * self, GList ** output)
 
2365
#line 2366 "gnome-pilot-client.c"
 
2366
{
 
2367
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_cradles"
 
2368
#line 1013 "gnome-pilot-client.gob"
 
2369
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2370
#line 1013 "gnome-pilot-client.gob"
 
2371
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2372
#line 1013 "gnome-pilot-client.gob"
 
2373
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2374
#line 2375 "gnome-pilot-client.c"
 
2375
{
 
2376
#line 1014 "gnome-pilot-client.gob"
 
2377
        
 
2378
                return get_triple_ptr (self,GPILOTD_APP_CRADLES,NULL,output);
 
2379
        }}
 
2380
#line 2381 "gnome-pilot-client.c"
 
2381
#undef __GOB_FUNCTION__
 
2382
 
 
2383
#line 1018 "gnome-pilot-client.gob"
 
2384
gint 
 
2385
gnome_pilot_client_get_pilots (GnomePilotClient * self, GList ** output)
 
2386
#line 2387 "gnome-pilot-client.c"
 
2387
{
 
2388
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_pilots"
 
2389
#line 1018 "gnome-pilot-client.gob"
 
2390
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2391
#line 1018 "gnome-pilot-client.gob"
 
2392
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2393
#line 1018 "gnome-pilot-client.gob"
 
2394
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2395
#line 2396 "gnome-pilot-client.c"
 
2396
{
 
2397
#line 1019 "gnome-pilot-client.gob"
 
2398
        
 
2399
                return get_triple_ptr (self,GPILOTD_APP_PILOT_NAMES,NULL,output);
 
2400
        }}
 
2401
#line 2402 "gnome-pilot-client.c"
 
2402
#undef __GOB_FUNCTION__
 
2403
 
 
2404
#line 1023 "gnome-pilot-client.gob"
 
2405
gint 
 
2406
gnome_pilot_client_get_pilot_ids (GnomePilotClient * self, gint ** output)
 
2407
#line 2408 "gnome-pilot-client.c"
 
2408
{
 
2409
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_pilot_ids"
 
2410
#line 1023 "gnome-pilot-client.gob"
 
2411
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2412
#line 1023 "gnome-pilot-client.gob"
 
2413
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2414
#line 1023 "gnome-pilot-client.gob"
 
2415
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2416
#line 2417 "gnome-pilot-client.c"
 
2417
{
 
2418
#line 1024 "gnome-pilot-client.gob"
 
2419
        
 
2420
                GList *long_output = NULL, *ptr;
 
2421
                gint result, idx;
 
2422
 
 
2423
                result = get_triple_ptr (self, GPILOTD_APP_PILOT_IDS, NULL, &long_output);
 
2424
 
 
2425
                (*output) = g_new0 (int, g_list_length (long_output));
 
2426
                idx = 0;
 
2427
                for (ptr = long_output; ptr; ptr = g_list_next (ptr)) {
 
2428
                        (*output)[idx] = GPOINTER_TO_INT (ptr->data);
 
2429
                        idx++;
 
2430
                }
 
2431
                g_list_free (long_output);
 
2432
 
 
2433
                return result;
 
2434
        }}
 
2435
#line 2436 "gnome-pilot-client.c"
 
2436
#undef __GOB_FUNCTION__
 
2437
 
 
2438
#line 1042 "gnome-pilot-client.gob"
 
2439
gint 
 
2440
gnome_pilot_client_get_pilots_by_user_name (GnomePilotClient * self, const gchar * name, GList ** output)
 
2441
#line 2442 "gnome-pilot-client.c"
 
2442
{
 
2443
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_pilots_by_user_name"
 
2444
#line 1042 "gnome-pilot-client.gob"
 
2445
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2446
#line 1042 "gnome-pilot-client.gob"
 
2447
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2448
#line 1042 "gnome-pilot-client.gob"
 
2449
        g_return_val_if_fail (name != NULL, (gint )GPILOTD_ERR_INVAL);
 
2450
#line 1042 "gnome-pilot-client.gob"
 
2451
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2452
#line 2453 "gnome-pilot-client.c"
 
2453
{
 
2454
#line 1044 "gnome-pilot-client.gob"
 
2455
        
 
2456
                return get_triple_ptr (self,GPILOTD_APP_PILOTS_BY_NAME,name,output);
 
2457
        }}
 
2458
#line 2459 "gnome-pilot-client.c"
 
2459
#undef __GOB_FUNCTION__
 
2460
 
 
2461
#line 1048 "gnome-pilot-client.gob"
 
2462
gint 
 
2463
gnome_pilot_client_get_pilots_by_user_login (GnomePilotClient * self, const gchar * login, GList ** output)
 
2464
#line 2465 "gnome-pilot-client.c"
 
2465
{
 
2466
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_pilots_by_user_login"
 
2467
#line 1048 "gnome-pilot-client.gob"
 
2468
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2469
#line 1048 "gnome-pilot-client.gob"
 
2470
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2471
#line 1048 "gnome-pilot-client.gob"
 
2472
        g_return_val_if_fail (login != NULL, (gint )GPILOTD_ERR_INVAL);
 
2473
#line 1048 "gnome-pilot-client.gob"
 
2474
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2475
#line 2476 "gnome-pilot-client.c"
 
2476
{
 
2477
#line 1050 "gnome-pilot-client.gob"
 
2478
        
 
2479
                return get_triple_ptr (self,GPILOTD_APP_PILOTS_BY_LOGIN,login,output);
 
2480
        }}
 
2481
#line 2482 "gnome-pilot-client.c"
 
2482
#undef __GOB_FUNCTION__
 
2483
 
 
2484
#line 1054 "gnome-pilot-client.gob"
 
2485
gint 
 
2486
gnome_pilot_client_get_user_name_by_pilot_name (GnomePilotClient * self, const gchar * pilot_name, gchar ** output)
 
2487
#line 2488 "gnome-pilot-client.c"
 
2488
{
 
2489
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_user_name_by_pilot_name"
 
2490
#line 1054 "gnome-pilot-client.gob"
 
2491
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2492
#line 1054 "gnome-pilot-client.gob"
 
2493
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2494
#line 1054 "gnome-pilot-client.gob"
 
2495
        g_return_val_if_fail (pilot_name != NULL, (gint )GPILOTD_ERR_INVAL);
 
2496
#line 1054 "gnome-pilot-client.gob"
 
2497
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2498
#line 2499 "gnome-pilot-client.c"
 
2499
{
 
2500
#line 1056 "gnome-pilot-client.gob"
 
2501
        
 
2502
                CORBA_char *user_name = NULL;
 
2503
 
 
2504
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
2505
#ifndef G_DISABLE_CHECKS                
 
2506
                if (*output!=NULL) {
 
2507
                        g_warning ("%s:%d: get_user_name_by_pilot_name called with non-null pointer for output, leak-alert!",
 
2508
                                  __FILE__,__LINE__);
 
2509
                }
 
2510
#endif
 
2511
                user_name = GNOME_Pilot_Daemon_get_user_name_by_pilot_name (self->gpilotddaemon,
 
2512
                                                                            pilot_name,
 
2513
                                                                            &self->ev);
 
2514
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2515
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, 
 
2516
                                   CORBA_exception_id (&self->ev));
 
2517
                        CORBA_exception_free (&self->ev);
 
2518
                        return GPILOTD_ERR_FAILED;
 
2519
                }
 
2520
                
 
2521
                *output = g_strdup (user_name);
 
2522
                CORBA_free (user_name);
 
2523
 
 
2524
                return GPILOTD_OK;      
 
2525
        }}
 
2526
#line 2527 "gnome-pilot-client.c"
 
2527
#undef __GOB_FUNCTION__
 
2528
 
 
2529
#line 1082 "gnome-pilot-client.gob"
 
2530
gint 
 
2531
gnome_pilot_client_get_user_login_by_pilot_name (GnomePilotClient * self, const gchar * pilot_name, gchar ** output)
 
2532
#line 2533 "gnome-pilot-client.c"
 
2533
{
 
2534
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_user_login_by_pilot_name"
 
2535
#line 1082 "gnome-pilot-client.gob"
 
2536
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2537
#line 1082 "gnome-pilot-client.gob"
 
2538
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2539
#line 1082 "gnome-pilot-client.gob"
 
2540
        g_return_val_if_fail (pilot_name != NULL, (gint )GPILOTD_ERR_INVAL);
 
2541
#line 1082 "gnome-pilot-client.gob"
 
2542
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2543
#line 2544 "gnome-pilot-client.c"
 
2544
{
 
2545
#line 1084 "gnome-pilot-client.gob"
 
2546
        
 
2547
                CORBA_char *user_login = NULL;
 
2548
 
 
2549
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
2550
#ifndef G_DISABLE_CHECKS                
 
2551
                if (*output!=NULL) {
 
2552
                        g_warning ("%s:%d: get_user_login_by_pilot_name called with non-null pointer for output, leak-alert!",
 
2553
                                  __FILE__,__LINE__);
 
2554
                }
 
2555
#endif
 
2556
                user_login = GNOME_Pilot_Daemon_get_user_login_by_pilot_name (self->gpilotddaemon,
 
2557
                                                                              pilot_name,
 
2558
                                                                              &self->ev);
 
2559
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2560
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, 
 
2561
                                   CORBA_exception_id (&self->ev));
 
2562
                        CORBA_exception_free (&self->ev);
 
2563
                        return GPILOTD_ERR_FAILED;
 
2564
                }
 
2565
                
 
2566
                *output = g_strdup (user_login);
 
2567
                CORBA_free (user_login);
 
2568
 
 
2569
                return GPILOTD_OK;      
 
2570
        }}
 
2571
#line 2572 "gnome-pilot-client.c"
 
2572
#undef __GOB_FUNCTION__
 
2573
 
 
2574
#line 1114 "gnome-pilot-client.gob"
 
2575
gint 
 
2576
gnome_pilot_client_get_pilot_base_dir_by_name (GnomePilotClient * self, const gchar * pilot_name, gchar ** output)
 
2577
#line 2578 "gnome-pilot-client.c"
 
2578
{
 
2579
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_pilot_base_dir_by_name"
 
2580
#line 1114 "gnome-pilot-client.gob"
 
2581
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2582
#line 1114 "gnome-pilot-client.gob"
 
2583
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2584
#line 1114 "gnome-pilot-client.gob"
 
2585
        g_return_val_if_fail (pilot_name != NULL, (gint )GPILOTD_ERR_INVAL);
 
2586
#line 1114 "gnome-pilot-client.gob"
 
2587
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2588
#line 2589 "gnome-pilot-client.c"
 
2589
{
 
2590
#line 1116 "gnome-pilot-client.gob"
 
2591
        
 
2592
                CORBA_char *basedir;
 
2593
 
 
2594
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
2595
#ifndef G_DISABLE_CHECKS                
 
2596
                if (*output!=NULL) {
 
2597
                        g_warning ("%s:%d: get_pilot_base_dir_by_name called with non-null pointer for output, leak-alert!",
 
2598
                                  __FILE__,__LINE__);
 
2599
                }
 
2600
#endif
 
2601
                basedir = GNOME_Pilot_Daemon_get_pilot_base_dir (self->gpilotddaemon,pilot_name,&self->ev);
 
2602
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2603
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
2604
                        CORBA_exception_free (&self->ev);
 
2605
                        return GPILOTD_ERR_FAILED;
 
2606
                }
 
2607
                
 
2608
                *output = g_strdup (basedir);
 
2609
                CORBA_free (basedir);
 
2610
                
 
2611
                if (strlen (*output)==0) {
 
2612
                        g_free (*output);
 
2613
                       *output = g_strdup_printf ("%s/%s",g_get_home_dir (),pilot_name);
 
2614
                }
 
2615
                
 
2616
                return GPILOTD_OK;      
 
2617
        }}
 
2618
#line 2619 "gnome-pilot-client.c"
 
2619
#undef __GOB_FUNCTION__
 
2620
 
 
2621
#line 1144 "gnome-pilot-client.gob"
 
2622
gint 
 
2623
gnome_pilot_client_get_pilot_base_dir_by_id (GnomePilotClient * self, guint32 pilot_id, gchar ** output)
 
2624
#line 2625 "gnome-pilot-client.c"
 
2625
{
 
2626
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_pilot_base_dir_by_id"
 
2627
#line 1144 "gnome-pilot-client.gob"
 
2628
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2629
#line 1144 "gnome-pilot-client.gob"
 
2630
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2631
#line 1144 "gnome-pilot-client.gob"
 
2632
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2633
#line 2634 "gnome-pilot-client.c"
 
2634
{
 
2635
#line 1146 "gnome-pilot-client.gob"
 
2636
        
 
2637
                gchar *pilot_name;
 
2638
                gint return_code;
 
2639
 
 
2640
                return_code = get_pilot_name_by_id (self,pilot_id,&pilot_name);
 
2641
                if (return_code!=GPILOTD_OK) {
 
2642
                        return return_code;
 
2643
                }
 
2644
 
 
2645
                return_code = get_pilot_base_dir_by_name (self,pilot_name,output);
 
2646
                g_free (pilot_name);
 
2647
                return return_code;
 
2648
        }}
 
2649
#line 2650 "gnome-pilot-client.c"
 
2650
#undef __GOB_FUNCTION__
 
2651
 
 
2652
#line 1161 "gnome-pilot-client.gob"
 
2653
gint 
 
2654
gnome_pilot_client_get_pilot_id_by_name (GnomePilotClient * self, const gchar * pilot_name, guint32 * output)
 
2655
#line 2656 "gnome-pilot-client.c"
 
2656
{
 
2657
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_pilot_id_by_name"
 
2658
#line 1161 "gnome-pilot-client.gob"
 
2659
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2660
#line 1161 "gnome-pilot-client.gob"
 
2661
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2662
#line 1161 "gnome-pilot-client.gob"
 
2663
        g_return_val_if_fail (pilot_name != NULL, (gint )GPILOTD_ERR_INVAL);
 
2664
#line 1161 "gnome-pilot-client.gob"
 
2665
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2666
#line 2667 "gnome-pilot-client.c"
 
2667
{
 
2668
#line 1163 "gnome-pilot-client.gob"
 
2669
                        
 
2670
                g_return_val_if_fail (self->gpilotddaemon!=NULL, GPILOTD_ERR_NOT_CONNECTED);
 
2671
                
 
2672
                *output = GNOME_Pilot_Daemon_get_pilot_id_from_name (self->gpilotddaemon,pilot_name,&self->ev);
 
2673
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2674
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
2675
                        CORBA_exception_free (&self->ev);
 
2676
                        return GPILOTD_ERR_FAILED;
 
2677
                }
 
2678
                
 
2679
                return GPILOTD_OK;      
 
2680
        }}
 
2681
#line 2682 "gnome-pilot-client.c"
 
2682
#undef __GOB_FUNCTION__
 
2683
 
 
2684
#line 1176 "gnome-pilot-client.gob"
 
2685
gint 
 
2686
gnome_pilot_client_get_pilot_name_by_id (GnomePilotClient * self, guint32 pilot_id, gchar ** output)
 
2687
#line 2688 "gnome-pilot-client.c"
 
2688
{
 
2689
#define __GOB_FUNCTION__ "Gnome:Pilot:Client::get_pilot_name_by_id"
 
2690
#line 1176 "gnome-pilot-client.gob"
 
2691
        g_return_val_if_fail (self != NULL, (gint )GPILOTD_ERR_INVAL);
 
2692
#line 1176 "gnome-pilot-client.gob"
 
2693
        g_return_val_if_fail (GNOME_IS_PILOT_CLIENT (self), (gint )GPILOTD_ERR_INVAL);
 
2694
#line 1176 "gnome-pilot-client.gob"
 
2695
        g_return_val_if_fail (output != NULL, (gint )GPILOTD_ERR_INVAL);
 
2696
#line 2697 "gnome-pilot-client.c"
 
2697
{
 
2698
#line 1178 "gnome-pilot-client.gob"
 
2699
        
 
2700
                CORBA_char *name;
 
2701
#ifndef G_DISABLE_CHECKS                
 
2702
                if (*output!=NULL) {
 
2703
                        g_warning ("%s:%d: get_pilot_name_by_id called with non-null pointer for output, leak-alert!",
 
2704
                                  __FILE__,__LINE__);
 
2705
                }
 
2706
#endif
 
2707
                name = GNOME_Pilot_Daemon_get_pilot_name_from_id (self->gpilotddaemon,pilot_id,&self->ev);
 
2708
                if (self->ev._major != CORBA_NO_EXCEPTION) {
 
2709
                        g_warning ("%s:%d: Caught exception: %s",__FILE__,__LINE__, CORBA_exception_id (&self->ev));
 
2710
                        CORBA_exception_free (&self->ev);
 
2711
                        return GPILOTD_ERR_FAILED;
 
2712
                }
 
2713
                
 
2714
                *output = g_strdup (name);
 
2715
                CORBA_free (name);
 
2716
                
 
2717
                if (output==NULL || strlen (*output)==0) {
 
2718
                        g_free (*output);
 
2719
                        return GPILOTD_ERR_FAILED;
 
2720
                }
 
2721
                
 
2722
                return GPILOTD_OK;      
 
2723
        }}
 
2724
#line 2725 "gnome-pilot-client.c"
 
2725
#undef __GOB_FUNCTION__
 
2726
 
 
2727
 
 
2728
#if (!defined __GNUC__) || (defined __GNUC__ && defined __STRICT_ANSI__)
 
2729
/*REALLY BAD HACK
 
2730
  This is to avoid unused warnings if you don't call
 
2731
  some method.  I need to find a better way to do
 
2732
  this, not needed in GCC since we use some gcc
 
2733
  extentions to make saner, faster code */
 
2734
static void
 
2735
___gnome_pilot_client_really_bad_hack_to_avoid_warnings(void)
 
2736
{
 
2737
        ((void (*)(void))accept_all_cookies)();
 
2738
        ((void (*)(void))init_corba_class)();
 
2739
        ((void (*)(void))new)();
 
2740
        ((void (*)(void))destroy)();
 
2741
        ((void (*)(void))connect_to_daemon)();
 
2742
        ((void (*)(void))corba_get_client_id)();
 
2743
        ((void (*)(void))corba_set_client_id)();
 
2744
        ((void (*)(void))corba_connect)();
 
2745
        ((void (*)(void))corba_disconnect)();
 
2746
        ((void (*)(void))corba_request_completed)();
 
2747
        ((void (*)(void))corba_user_info_requested)();
 
2748
        ((void (*)(void))corba_system_info_requested)();
 
2749
        ((void (*)(void))corba_conduit_start)();
 
2750
        ((void (*)(void))corba_conduit_end)();
 
2751
        ((void (*)(void))corba_overall_progress)();
 
2752
        ((void (*)(void))corba_conduit_progress)();
 
2753
        ((void (*)(void))corba_conduit_message)();
 
2754
        ((void (*)(void))corba_daemon_message)();
 
2755
        ((void (*)(void))corba_daemon_error)();
 
2756
        ((void (*)(void))corba_conduit_error)();
 
2757
        ((void (*)(void))corba_pause)();
 
2758
        ((void (*)(void))pilot_connect)();
 
2759
        ((void (*)(void))pilot_disconnect)();
 
2760
        ((void (*)(void))completed_request)();
 
2761
        ((void (*)(void))user_info)();
 
2762
        ((void (*)(void))system_info)();
 
2763
        ((void (*)(void))start_conduit)();
 
2764
        ((void (*)(void))end_conduit)();
 
2765
        ((void (*)(void))progress_conduit)();
 
2766
        ((void (*)(void))progress_overall)();
 
2767
        ((void (*)(void))message_conduit)();
 
2768
        ((void (*)(void))message_daemon)();
 
2769
        ((void (*)(void))error_daemon)();
 
2770
        ((void (*)(void))error_conduit)();
 
2771
        ((void (*)(void))daemon_pause)();
 
2772
        ((void (*)(void))pause_daemon)();
 
2773
        ((void (*)(void))unpause_daemon)();
 
2774
        ((void (*)(void))noop)();
 
2775
        ((void (*)(void))restart_daemon)();
 
2776
        ((void (*)(void))monitor_on)();
 
2777
        ((void (*)(void))monitor_on_all_pilots)();
 
2778
        ((void (*)(void))monitor_off)();
 
2779
        ((void (*)(void))monitor_off_all_pilots)();
 
2780
        ((void (*)(void))notify_on)();
 
2781
        ((void (*)(void))notify_off)();
 
2782
        ((void (*)(void))restore)();
 
2783
        ((void (*)(void))install_file)();
 
2784
        ((void (*)(void))get_user_info)();
 
2785
        ((void (*)(void))set_user_info)();
 
2786
        ((void (*)(void))get_system_info)();
 
2787
        ((void (*)(void))remove_request)();
 
2788
        ((void (*)(void))conduit)();
 
2789
        ((void (*)(void))get_triple_ptr)();
 
2790
        ((void (*)(void))get_users)();
 
2791
        ((void (*)(void))get_databases_from_cache)();
 
2792
        ((void (*)(void))get_cradles)();
 
2793
        ((void (*)(void))get_pilots)();
 
2794
        ((void (*)(void))get_pilot_ids)();
 
2795
        ((void (*)(void))get_pilots_by_user_name)();
 
2796
        ((void (*)(void))get_pilots_by_user_login)();
 
2797
        ((void (*)(void))get_user_name_by_pilot_name)();
 
2798
        ((void (*)(void))get_user_login_by_pilot_name)();
 
2799
        ((void (*)(void))get_pilot_base_dir_by_name)();
 
2800
        ((void (*)(void))get_pilot_base_dir_by_id)();
 
2801
        ((void (*)(void))get_pilot_id_by_name)();
 
2802
        ((void (*)(void))get_pilot_name_by_id)();
 
2803
        ___gnome_pilot_client_really_bad_hack_to_avoid_warnings();
 
2804
}
 
2805
#endif /* !__GNUC__ || (__GNUC__ && __STRICT_ANSI__) */
 
2806
 
 
2807
 
 
2808
#line 1208 "gnome-pilot-client.gob"
 
2809
 
 
2810
 
 
2811
#ifdef WITH_VFS
 
2812
gboolean xfer_callback (GnomeVFSXferProgressInfo *info,
 
2813
                        GnomePilotClient *this) {
 
2814
        switch (info->status) {
 
2815
        case GNOME_VFS_XFER_PROGRESS_STATUS_VFSERROR:
 
2816
                g_message ("VFS Error: %s\n",
 
2817
                           gnome_vfs_result_to_string (info->vfs_status));
 
2818
                return FALSE;
 
2819
                break;
 
2820
        case GNOME_VFS_XFER_PROGRESS_STATUS_OVERWRITE:
 
2821
                g_message ("VFS: Overwriting `%s' with `%s'",
 
2822
                           info->target_name, info->source_name);
 
2823
                return TRUE;
 
2824
                break;
 
2825
        case GNOME_VFS_XFER_PROGRESS_STATUS_OK:
 
2826
                switch (info->phase) {
 
2827
                case GNOME_VFS_XFER_PHASE_INITIAL:
 
2828
                        return TRUE;
 
2829
                case GNOME_VFS_XFER_PHASE_COLLECTING:
 
2830
                        return TRUE;
 
2831
                case GNOME_VFS_XFER_PHASE_READYTOGO:
 
2832
                        return TRUE;
 
2833
                case GNOME_VFS_XFER_PHASE_OPENSOURCE:
 
2834
                        return TRUE;
 
2835
                case GNOME_VFS_XFER_PHASE_OPENTARGET:
 
2836
                        return TRUE;
 
2837
                case GNOME_VFS_XFER_PHASE_COPYING:
 
2838
/*
 
2839
                        g_message ("Transferring `%s' to `%s' (file %ld/%ld, byte %ld/%ld in file, "
 
2840
                                   "%" GNOME_VFS_SIZE_FORMAT_STR "/%" GNOME_VFS_SIZE_FORMAT_STR " total)",
 
2841
                                   info->source_name,
 
2842
                                   info->target_name,
 
2843
                                   info->file_index,
 
2844
                                   info->files_total,
 
2845
                                   (glong) info->bytes_copied,
 
2846
                                   (glong) info->file_size,
 
2847
                                   info->total_bytes_copied,
 
2848
                                   info->bytes_total);
 
2849
*/
 
2850
                        return TRUE;
 
2851
                case GNOME_VFS_XFER_PHASE_CLOSESOURCE:
 
2852
                        return TRUE;
 
2853
                case GNOME_VFS_XFER_PHASE_CLOSETARGET:
 
2854
                        return TRUE;
 
2855
                case GNOME_VFS_XFER_PHASE_FILECOMPLETED:
 
2856
                        return TRUE;
 
2857
                case GNOME_VFS_XFER_PHASE_COMPLETED:
 
2858
                        return TRUE;
 
2859
                default:
 
2860
                        /* g_message ("Unexpected phase %d", info->phase); */
 
2861
                        return TRUE; 
 
2862
                }
 
2863
                break;
 
2864
        case GNOME_VFS_XFER_PROGRESS_STATUS_DUPLICATE:
 
2865
                g_message ("VFS: Duplicate");
 
2866
                return FALSE;
 
2867
        default:
 
2868
                g_message ("VFS: Unknown status");
 
2869
                return FALSE;
 
2870
        }       
 
2871
 
 
2872
        g_message ("VFS: doh!");
 
2873
        return FALSE;   
 
2874
                
 
2875
}
 
2876
#endif /* WITH_VFS */
 
2877
 
 
2878
pid_t
 
2879
gpilotd_get_pid (void)
 
2880
{
 
2881
        FILE *f;
 
2882
        gchar *homedir;
 
2883
        GString *str;
 
2884
        gchar pidstr[100];
 
2885
        pid_t pid;
 
2886
        
 
2887
        homedir = g_get_home_dir (); 
 
2888
        if (!homedir)
 
2889
                return -1;
 
2890
        
 
2891
        str = g_string_new (homedir);
 
2892
        g_string_append (str, "/.gpilotd.pid");
 
2893
        f = fopen (str->str, "r");
 
2894
        g_string_free (str, TRUE);
 
2895
        if (!f) {
 
2896
                return -1;
 
2897
        } else {
 
2898
                fgets (pidstr, sizeof (pidstr), f);
 
2899
                fclose (f);
 
2900
                pid = strtol (pidstr, NULL, 10);
 
2901
                if (pid == '\0')
 
2902
                        return -1;
 
2903
                else
 
2904
                        return pid;
 
2905
        }
 
2906
}
 
2907
 
 
2908
GnomePilotClient *
 
2909
get_self (PortableServer_Servant servant) {
 
2910
        GnomePilotClientServant *s;
 
2911
        s = (GnomePilotClientServant*)servant;
 
2912
        return s->self;
 
2913
}
 
2914
 
 
2915
 
 
2916
#line 2917 "gnome-pilot-client.c"