~ubuntu-desktop/remote-login-service/ubuntu

« back to all changes in this revision

Viewing changes to src/remote-login.c

  • Committer: Ted Gould
  • Date: 2012-08-15 16:28:26 UTC
  • mfrom: (1.2.2)
  • Revision ID: ted@gould.cx-20120815162826-plnqmhxzs1w2b67l
* New upstream release.
  * Support calling the UCCS service tool
  * Tests to deal with JSON output

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Generated by gdbus-codegen 2.33.8. DO NOT EDIT.
 
3
 *
 
4
 * The license of this code is the same as for the source it was derived from.
 
5
 */
 
6
 
 
7
#ifdef HAVE_CONFIG_H
 
8
#  include "config.h"
 
9
#endif
 
10
 
 
11
#include "remote-login.h"
 
12
 
 
13
#include <string.h>
 
14
#ifdef G_OS_UNIX
 
15
#  include <gio/gunixfdlist.h>
 
16
#endif
 
17
 
 
18
typedef struct
 
19
{
 
20
  GDBusArgInfo parent_struct;
 
21
  gboolean use_gvariant;
 
22
} _ExtendedGDBusArgInfo;
 
23
 
 
24
typedef struct
 
25
{
 
26
  GDBusMethodInfo parent_struct;
 
27
  const gchar *signal_name;
 
28
  gboolean pass_fdlist;
 
29
} _ExtendedGDBusMethodInfo;
 
30
 
 
31
typedef struct
 
32
{
 
33
  GDBusSignalInfo parent_struct;
 
34
  const gchar *signal_name;
 
35
} _ExtendedGDBusSignalInfo;
 
36
 
 
37
typedef struct
 
38
{
 
39
  GDBusPropertyInfo parent_struct;
 
40
  const gchar *hyphen_name;
 
41
  gboolean use_gvariant;
 
42
} _ExtendedGDBusPropertyInfo;
 
43
 
 
44
typedef struct
 
45
{
 
46
  GDBusInterfaceInfo parent_struct;
 
47
  const gchar *hyphen_name;
 
48
} _ExtendedGDBusInterfaceInfo;
 
49
 
 
50
typedef struct
 
51
{
 
52
  const _ExtendedGDBusPropertyInfo *info;
 
53
  guint prop_id;
 
54
  GValue orig_value; /* the value before the change */
 
55
} ChangedProperty;
 
56
 
 
57
static void
 
58
_changed_property_free (ChangedProperty *data)
 
59
{
 
60
  g_value_unset (&data->orig_value);
 
61
  g_free (data);
 
62
}
 
63
 
 
64
static gboolean
 
65
_g_strv_equal0 (gchar **a, gchar **b)
 
66
{
 
67
  gboolean ret = FALSE;
 
68
  guint n;
 
69
  if (a == NULL && b == NULL)
 
70
    {
 
71
      ret = TRUE;
 
72
      goto out;
 
73
    }
 
74
  if (a == NULL || b == NULL)
 
75
    goto out;
 
76
  if (g_strv_length (a) != g_strv_length (b))
 
77
    goto out;
 
78
  for (n = 0; a[n] != NULL; n++)
 
79
    if (g_strcmp0 (a[n], b[n]) != 0)
 
80
      goto out;
 
81
  ret = TRUE;
 
82
out:
 
83
  return ret;
 
84
}
 
85
 
 
86
static gboolean
 
87
_g_variant_equal0 (GVariant *a, GVariant *b)
 
88
{
 
89
  gboolean ret = FALSE;
 
90
  if (a == NULL && b == NULL)
 
91
    {
 
92
      ret = TRUE;
 
93
      goto out;
 
94
    }
 
95
  if (a == NULL || b == NULL)
 
96
    goto out;
 
97
  ret = g_variant_equal (a, b);
 
98
out:
 
99
  return ret;
 
100
}
 
101
 
 
102
G_GNUC_UNUSED static gboolean
 
103
_g_value_equal (const GValue *a, const GValue *b)
 
104
{
 
105
  gboolean ret = FALSE;
 
106
  g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
 
107
  switch (G_VALUE_TYPE (a))
 
108
    {
 
109
      case G_TYPE_BOOLEAN:
 
110
        ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
 
111
        break;
 
112
      case G_TYPE_UCHAR:
 
113
        ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
 
114
        break;
 
115
      case G_TYPE_INT:
 
116
        ret = (g_value_get_int (a) == g_value_get_int (b));
 
117
        break;
 
118
      case G_TYPE_UINT:
 
119
        ret = (g_value_get_uint (a) == g_value_get_uint (b));
 
120
        break;
 
121
      case G_TYPE_INT64:
 
122
        ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
 
123
        break;
 
124
      case G_TYPE_UINT64:
 
125
        ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
 
126
        break;
 
127
      case G_TYPE_DOUBLE:
 
128
        {
 
129
          /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
 
130
          gdouble da = g_value_get_double (a);
 
131
          gdouble db = g_value_get_double (b);
 
132
          ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
 
133
        }
 
134
        break;
 
135
      case G_TYPE_STRING:
 
136
        ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
 
137
        break;
 
138
      case G_TYPE_VARIANT:
 
139
        ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
 
140
        break;
 
141
      default:
 
142
        if (G_VALUE_TYPE (a) == G_TYPE_STRV)
 
143
          ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
 
144
        else
 
145
          g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
 
146
        break;
 
147
    }
 
148
  return ret;
 
149
}
 
150
 
 
151
/* ------------------------------------------------------------------------
 
152
 * Code for interface com.canonical.RemoteLogin
 
153
 * ------------------------------------------------------------------------
 
154
 */
 
155
 
 
156
/**
 
157
 * SECTION:RemoteLogin
 
158
 * @title: RemoteLogin
 
159
 * @short_description: Generated C code for the com.canonical.RemoteLogin D-Bus interface
 
160
 *
 
161
 * This section contains code for working with the <link linkend="gdbus-interface-com-canonical-RemoteLogin.top_of_page">com.canonical.RemoteLogin</link> D-Bus interface in C.
 
162
 */
 
163
 
 
164
/* ---- Introspection data for com.canonical.RemoteLogin ---- */
 
165
 
 
166
static const _ExtendedGDBusArgInfo _remote_login_method_info_get_servers_OUT_ARG_serverList =
 
167
{
 
168
  {
 
169
    -1,
 
170
    (gchar *) "serverList",
 
171
    (gchar *) "a(sssba(sbva{sv})a(si))",
 
172
    NULL
 
173
  },
 
174
  FALSE
 
175
};
 
176
 
 
177
static const _ExtendedGDBusArgInfo * const _remote_login_method_info_get_servers_OUT_ARG_pointers[] =
 
178
{
 
179
  &_remote_login_method_info_get_servers_OUT_ARG_serverList,
 
180
  NULL
 
181
};
 
182
 
 
183
static const _ExtendedGDBusMethodInfo _remote_login_method_info_get_servers =
 
184
{
 
185
  {
 
186
    -1,
 
187
    (gchar *) "GetServers",
 
188
    NULL,
 
189
    (GDBusArgInfo **) &_remote_login_method_info_get_servers_OUT_ARG_pointers,
 
190
    NULL
 
191
  },
 
192
  "handle-get-servers",
 
193
  FALSE
 
194
};
 
195
 
 
196
static const _ExtendedGDBusArgInfo _remote_login_method_info_get_servers_for_login_IN_ARG_uri =
 
197
{
 
198
  {
 
199
    -1,
 
200
    (gchar *) "uri",
 
201
    (gchar *) "s",
 
202
    NULL
 
203
  },
 
204
  FALSE
 
205
};
 
206
 
 
207
static const _ExtendedGDBusArgInfo _remote_login_method_info_get_servers_for_login_IN_ARG_emailAddress =
 
208
{
 
209
  {
 
210
    -1,
 
211
    (gchar *) "emailAddress",
 
212
    (gchar *) "s",
 
213
    NULL
 
214
  },
 
215
  FALSE
 
216
};
 
217
 
 
218
static const _ExtendedGDBusArgInfo _remote_login_method_info_get_servers_for_login_IN_ARG_password =
 
219
{
 
220
  {
 
221
    -1,
 
222
    (gchar *) "password",
 
223
    (gchar *) "s",
 
224
    NULL
 
225
  },
 
226
  FALSE
 
227
};
 
228
 
 
229
static const _ExtendedGDBusArgInfo _remote_login_method_info_get_servers_for_login_IN_ARG_allowCache =
 
230
{
 
231
  {
 
232
    -1,
 
233
    (gchar *) "allowCache",
 
234
    (gchar *) "b",
 
235
    NULL
 
236
  },
 
237
  FALSE
 
238
};
 
239
 
 
240
static const _ExtendedGDBusArgInfo * const _remote_login_method_info_get_servers_for_login_IN_ARG_pointers[] =
 
241
{
 
242
  &_remote_login_method_info_get_servers_for_login_IN_ARG_uri,
 
243
  &_remote_login_method_info_get_servers_for_login_IN_ARG_emailAddress,
 
244
  &_remote_login_method_info_get_servers_for_login_IN_ARG_password,
 
245
  &_remote_login_method_info_get_servers_for_login_IN_ARG_allowCache,
 
246
  NULL
 
247
};
 
248
 
 
249
static const _ExtendedGDBusArgInfo _remote_login_method_info_get_servers_for_login_OUT_ARG_dataType =
 
250
{
 
251
  {
 
252
    -1,
 
253
    (gchar *) "dataType",
 
254
    (gchar *) "s",
 
255
    NULL
 
256
  },
 
257
  FALSE
 
258
};
 
259
 
 
260
static const _ExtendedGDBusArgInfo _remote_login_method_info_get_servers_for_login_OUT_ARG_serverList =
 
261
{
 
262
  {
 
263
    -1,
 
264
    (gchar *) "serverList",
 
265
    (gchar *) "a(sssba(sbva{sv})a(si))",
 
266
    NULL
 
267
  },
 
268
  FALSE
 
269
};
 
270
 
 
271
static const _ExtendedGDBusArgInfo * const _remote_login_method_info_get_servers_for_login_OUT_ARG_pointers[] =
 
272
{
 
273
  &_remote_login_method_info_get_servers_for_login_OUT_ARG_dataType,
 
274
  &_remote_login_method_info_get_servers_for_login_OUT_ARG_serverList,
 
275
  NULL
 
276
};
 
277
 
 
278
static const _ExtendedGDBusMethodInfo _remote_login_method_info_get_servers_for_login =
 
279
{
 
280
  {
 
281
    -1,
 
282
    (gchar *) "GetServersForLogin",
 
283
    (GDBusArgInfo **) &_remote_login_method_info_get_servers_for_login_IN_ARG_pointers,
 
284
    (GDBusArgInfo **) &_remote_login_method_info_get_servers_for_login_OUT_ARG_pointers,
 
285
    NULL
 
286
  },
 
287
  "handle-get-servers-for-login",
 
288
  FALSE
 
289
};
 
290
 
 
291
static const _ExtendedGDBusArgInfo _remote_login_method_info_get_cached_domains_for_server_IN_ARG_uri =
 
292
{
 
293
  {
 
294
    -1,
 
295
    (gchar *) "uri",
 
296
    (gchar *) "s",
 
297
    NULL
 
298
  },
 
299
  FALSE
 
300
};
 
301
 
 
302
static const _ExtendedGDBusArgInfo * const _remote_login_method_info_get_cached_domains_for_server_IN_ARG_pointers[] =
 
303
{
 
304
  &_remote_login_method_info_get_cached_domains_for_server_IN_ARG_uri,
 
305
  NULL
 
306
};
 
307
 
 
308
static const _ExtendedGDBusArgInfo _remote_login_method_info_get_cached_domains_for_server_OUT_ARG_domains =
 
309
{
 
310
  {
 
311
    -1,
 
312
    (gchar *) "domains",
 
313
    (gchar *) "as",
 
314
    NULL
 
315
  },
 
316
  FALSE
 
317
};
 
318
 
 
319
static const _ExtendedGDBusArgInfo * const _remote_login_method_info_get_cached_domains_for_server_OUT_ARG_pointers[] =
 
320
{
 
321
  &_remote_login_method_info_get_cached_domains_for_server_OUT_ARG_domains,
 
322
  NULL
 
323
};
 
324
 
 
325
static const _ExtendedGDBusMethodInfo _remote_login_method_info_get_cached_domains_for_server =
 
326
{
 
327
  {
 
328
    -1,
 
329
    (gchar *) "GetCachedDomainsForServer",
 
330
    (GDBusArgInfo **) &_remote_login_method_info_get_cached_domains_for_server_IN_ARG_pointers,
 
331
    (GDBusArgInfo **) &_remote_login_method_info_get_cached_domains_for_server_OUT_ARG_pointers,
 
332
    NULL
 
333
  },
 
334
  "handle-get-cached-domains-for-server",
 
335
  FALSE
 
336
};
 
337
 
 
338
static const _ExtendedGDBusArgInfo _remote_login_method_info_set_applications_for_server_IN_ARG_uccsUri =
 
339
{
 
340
  {
 
341
    -1,
 
342
    (gchar *) "uccsUri",
 
343
    (gchar *) "s",
 
344
    NULL
 
345
  },
 
346
  FALSE
 
347
};
 
348
 
 
349
static const _ExtendedGDBusArgInfo _remote_login_method_info_set_applications_for_server_IN_ARG_serverUri =
 
350
{
 
351
  {
 
352
    -1,
 
353
    (gchar *) "serverUri",
 
354
    (gchar *) "s",
 
355
    NULL
 
356
  },
 
357
  FALSE
 
358
};
 
359
 
 
360
static const _ExtendedGDBusArgInfo _remote_login_method_info_set_applications_for_server_IN_ARG_applications =
 
361
{
 
362
  {
 
363
    -1,
 
364
    (gchar *) "applications",
 
365
    (gchar *) "a(si)",
 
366
    NULL
 
367
  },
 
368
  FALSE
 
369
};
 
370
 
 
371
static const _ExtendedGDBusArgInfo * const _remote_login_method_info_set_applications_for_server_IN_ARG_pointers[] =
 
372
{
 
373
  &_remote_login_method_info_set_applications_for_server_IN_ARG_uccsUri,
 
374
  &_remote_login_method_info_set_applications_for_server_IN_ARG_serverUri,
 
375
  &_remote_login_method_info_set_applications_for_server_IN_ARG_applications,
 
376
  NULL
 
377
};
 
378
 
 
379
static const _ExtendedGDBusMethodInfo _remote_login_method_info_set_applications_for_server =
 
380
{
 
381
  {
 
382
    -1,
 
383
    (gchar *) "SetApplicationsForServer",
 
384
    (GDBusArgInfo **) &_remote_login_method_info_set_applications_for_server_IN_ARG_pointers,
 
385
    NULL,
 
386
    NULL
 
387
  },
 
388
  "handle-set-applications-for-server",
 
389
  FALSE
 
390
};
 
391
 
 
392
static const _ExtendedGDBusArgInfo _remote_login_method_info_set_last_used_server_IN_ARG_uccsUri =
 
393
{
 
394
  {
 
395
    -1,
 
396
    (gchar *) "uccsUri",
 
397
    (gchar *) "s",
 
398
    NULL
 
399
  },
 
400
  FALSE
 
401
};
 
402
 
 
403
static const _ExtendedGDBusArgInfo _remote_login_method_info_set_last_used_server_IN_ARG_serverUri =
 
404
{
 
405
  {
 
406
    -1,
 
407
    (gchar *) "serverUri",
 
408
    (gchar *) "s",
 
409
    NULL
 
410
  },
 
411
  FALSE
 
412
};
 
413
 
 
414
static const _ExtendedGDBusArgInfo * const _remote_login_method_info_set_last_used_server_IN_ARG_pointers[] =
 
415
{
 
416
  &_remote_login_method_info_set_last_used_server_IN_ARG_uccsUri,
 
417
  &_remote_login_method_info_set_last_used_server_IN_ARG_serverUri,
 
418
  NULL
 
419
};
 
420
 
 
421
static const _ExtendedGDBusMethodInfo _remote_login_method_info_set_last_used_server =
 
422
{
 
423
  {
 
424
    -1,
 
425
    (gchar *) "SetLastUsedServer",
 
426
    (GDBusArgInfo **) &_remote_login_method_info_set_last_used_server_IN_ARG_pointers,
 
427
    NULL,
 
428
    NULL
 
429
  },
 
430
  "handle-set-last-used-server",
 
431
  FALSE
 
432
};
 
433
 
 
434
static const _ExtendedGDBusMethodInfo * const _remote_login_method_info_pointers[] =
 
435
{
 
436
  &_remote_login_method_info_get_servers,
 
437
  &_remote_login_method_info_get_servers_for_login,
 
438
  &_remote_login_method_info_get_cached_domains_for_server,
 
439
  &_remote_login_method_info_set_applications_for_server,
 
440
  &_remote_login_method_info_set_last_used_server,
 
441
  NULL
 
442
};
 
443
 
 
444
static const _ExtendedGDBusArgInfo _remote_login_signal_info_servers_updated_ARG_serverList =
 
445
{
 
446
  {
 
447
    -1,
 
448
    (gchar *) "serverList",
 
449
    (gchar *) "a(sssba(sbva{sv})a(si))",
 
450
    NULL
 
451
  },
 
452
  FALSE
 
453
};
 
454
 
 
455
static const _ExtendedGDBusArgInfo * const _remote_login_signal_info_servers_updated_ARG_pointers[] =
 
456
{
 
457
  &_remote_login_signal_info_servers_updated_ARG_serverList,
 
458
  NULL
 
459
};
 
460
 
 
461
static const _ExtendedGDBusSignalInfo _remote_login_signal_info_servers_updated =
 
462
{
 
463
  {
 
464
    -1,
 
465
    (gchar *) "ServersUpdated",
 
466
    (GDBusArgInfo **) &_remote_login_signal_info_servers_updated_ARG_pointers,
 
467
    NULL
 
468
  },
 
469
  "servers-updated"
 
470
};
 
471
 
 
472
static const _ExtendedGDBusArgInfo _remote_login_signal_info_login_servers_updated_ARG_uri =
 
473
{
 
474
  {
 
475
    -1,
 
476
    (gchar *) "uri",
 
477
    (gchar *) "s",
 
478
    NULL
 
479
  },
 
480
  FALSE
 
481
};
 
482
 
 
483
static const _ExtendedGDBusArgInfo _remote_login_signal_info_login_servers_updated_ARG_emailAddress =
 
484
{
 
485
  {
 
486
    -1,
 
487
    (gchar *) "emailAddress",
 
488
    (gchar *) "s",
 
489
    NULL
 
490
  },
 
491
  FALSE
 
492
};
 
493
 
 
494
static const _ExtendedGDBusArgInfo _remote_login_signal_info_login_servers_updated_ARG_dataType =
 
495
{
 
496
  {
 
497
    -1,
 
498
    (gchar *) "dataType",
 
499
    (gchar *) "s",
 
500
    NULL
 
501
  },
 
502
  FALSE
 
503
};
 
504
 
 
505
static const _ExtendedGDBusArgInfo _remote_login_signal_info_login_servers_updated_ARG_serverList =
 
506
{
 
507
  {
 
508
    -1,
 
509
    (gchar *) "serverList",
 
510
    (gchar *) "a(sssba(sbva{sv})a(si))",
 
511
    NULL
 
512
  },
 
513
  FALSE
 
514
};
 
515
 
 
516
static const _ExtendedGDBusArgInfo * const _remote_login_signal_info_login_servers_updated_ARG_pointers[] =
 
517
{
 
518
  &_remote_login_signal_info_login_servers_updated_ARG_uri,
 
519
  &_remote_login_signal_info_login_servers_updated_ARG_emailAddress,
 
520
  &_remote_login_signal_info_login_servers_updated_ARG_dataType,
 
521
  &_remote_login_signal_info_login_servers_updated_ARG_serverList,
 
522
  NULL
 
523
};
 
524
 
 
525
static const _ExtendedGDBusSignalInfo _remote_login_signal_info_login_servers_updated =
 
526
{
 
527
  {
 
528
    -1,
 
529
    (gchar *) "LoginServersUpdated",
 
530
    (GDBusArgInfo **) &_remote_login_signal_info_login_servers_updated_ARG_pointers,
 
531
    NULL
 
532
  },
 
533
  "login-servers-updated"
 
534
};
 
535
 
 
536
static const _ExtendedGDBusArgInfo _remote_login_signal_info_login_changed_ARG_uri =
 
537
{
 
538
  {
 
539
    -1,
 
540
    (gchar *) "uri",
 
541
    (gchar *) "s",
 
542
    NULL
 
543
  },
 
544
  FALSE
 
545
};
 
546
 
 
547
static const _ExtendedGDBusArgInfo _remote_login_signal_info_login_changed_ARG_emailAddress =
 
548
{
 
549
  {
 
550
    -1,
 
551
    (gchar *) "emailAddress",
 
552
    (gchar *) "s",
 
553
    NULL
 
554
  },
 
555
  FALSE
 
556
};
 
557
 
 
558
static const _ExtendedGDBusArgInfo * const _remote_login_signal_info_login_changed_ARG_pointers[] =
 
559
{
 
560
  &_remote_login_signal_info_login_changed_ARG_uri,
 
561
  &_remote_login_signal_info_login_changed_ARG_emailAddress,
 
562
  NULL
 
563
};
 
564
 
 
565
static const _ExtendedGDBusSignalInfo _remote_login_signal_info_login_changed =
 
566
{
 
567
  {
 
568
    -1,
 
569
    (gchar *) "LoginChanged",
 
570
    (GDBusArgInfo **) &_remote_login_signal_info_login_changed_ARG_pointers,
 
571
    NULL
 
572
  },
 
573
  "login-changed"
 
574
};
 
575
 
 
576
static const _ExtendedGDBusSignalInfo * const _remote_login_signal_info_pointers[] =
 
577
{
 
578
  &_remote_login_signal_info_servers_updated,
 
579
  &_remote_login_signal_info_login_servers_updated,
 
580
  &_remote_login_signal_info_login_changed,
 
581
  NULL
 
582
};
 
583
 
 
584
static const _ExtendedGDBusInterfaceInfo _remote_login_interface_info =
 
585
{
 
586
  {
 
587
    -1,
 
588
    (gchar *) "com.canonical.RemoteLogin",
 
589
    (GDBusMethodInfo **) &_remote_login_method_info_pointers,
 
590
    (GDBusSignalInfo **) &_remote_login_signal_info_pointers,
 
591
    NULL,
 
592
    NULL
 
593
  },
 
594
  "remote-login",
 
595
};
 
596
 
 
597
 
 
598
/**
 
599
 * remote_login_interface_info:
 
600
 *
 
601
 * Gets a machine-readable description of the <link linkend="gdbus-interface-com-canonical-RemoteLogin.top_of_page">com.canonical.RemoteLogin</link> D-Bus interface.
 
602
 *
 
603
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 
604
 */
 
605
GDBusInterfaceInfo *
 
606
remote_login_interface_info (void)
 
607
{
 
608
  return (GDBusInterfaceInfo *) &_remote_login_interface_info.parent_struct;
 
609
}
 
610
 
 
611
/**
 
612
 * remote_login_override_properties:
 
613
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 
614
 * @property_id_begin: The property id to assign to the first overridden property.
 
615
 *
 
616
 * Overrides all #GObject properties in the #RemoteLogin interface for a concrete class.
 
617
 * The properties are overridden in the order they are defined.
 
618
 *
 
619
 * Returns: The last property id.
 
620
 */
 
621
guint
 
622
remote_login_override_properties (GObjectClass *klass, guint property_id_begin)
 
623
{
 
624
  return property_id_begin - 1;
 
625
}
 
626
 
 
627
 
 
628
 
 
629
/**
 
630
 * RemoteLogin:
 
631
 *
 
632
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-com-canonical-RemoteLogin.top_of_page">com.canonical.RemoteLogin</link>.
 
633
 */
 
634
 
 
635
/**
 
636
 * RemoteLoginIface:
 
637
 * @parent_iface: The parent interface.
 
638
 * @handle_get_cached_domains_for_server: Handler for the #RemoteLogin::handle-get-cached-domains-for-server signal.
 
639
 * @handle_get_servers: Handler for the #RemoteLogin::handle-get-servers signal.
 
640
 * @handle_get_servers_for_login: Handler for the #RemoteLogin::handle-get-servers-for-login signal.
 
641
 * @handle_set_applications_for_server: Handler for the #RemoteLogin::handle-set-applications-for-server signal.
 
642
 * @handle_set_last_used_server: Handler for the #RemoteLogin::handle-set-last-used-server signal.
 
643
 * @login_changed: Handler for the #RemoteLogin::login-changed signal.
 
644
 * @login_servers_updated: Handler for the #RemoteLogin::login-servers-updated signal.
 
645
 * @servers_updated: Handler for the #RemoteLogin::servers-updated signal.
 
646
 *
 
647
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-com-canonical-RemoteLogin.top_of_page">com.canonical.RemoteLogin</link>.
 
648
 */
 
649
 
 
650
static void
 
651
remote_login_default_init (RemoteLoginIface *iface)
 
652
{
 
653
  /* GObject signals for incoming D-Bus method calls: */
 
654
  /**
 
655
   * RemoteLogin::handle-get-servers:
 
656
   * @object: A #RemoteLogin.
 
657
   * @invocation: A #GDBusMethodInvocation.
 
658
   *
 
659
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetServers">GetServers()</link> D-Bus method.
 
660
   *
 
661
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call remote_login_complete_get_servers() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
 
662
   *
 
663
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
 
664
   */
 
665
  g_signal_new ("handle-get-servers",
 
666
    G_TYPE_FROM_INTERFACE (iface),
 
667
    G_SIGNAL_RUN_LAST,
 
668
    G_STRUCT_OFFSET (RemoteLoginIface, handle_get_servers),
 
669
    g_signal_accumulator_true_handled,
 
670
    NULL,
 
671
    g_cclosure_marshal_generic,
 
672
    G_TYPE_BOOLEAN,
 
673
    1,
 
674
    G_TYPE_DBUS_METHOD_INVOCATION);
 
675
 
 
676
  /**
 
677
   * RemoteLogin::handle-get-servers-for-login:
 
678
   * @object: A #RemoteLogin.
 
679
   * @invocation: A #GDBusMethodInvocation.
 
680
   * @arg_uri: Argument passed by remote caller.
 
681
   * @arg_emailAddress: Argument passed by remote caller.
 
682
   * @arg_password: Argument passed by remote caller.
 
683
   * @arg_allowCache: Argument passed by remote caller.
 
684
   *
 
685
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetServersForLogin">GetServersForLogin()</link> D-Bus method.
 
686
   *
 
687
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call remote_login_complete_get_servers_for_login() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
 
688
   *
 
689
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
 
690
   */
 
691
  g_signal_new ("handle-get-servers-for-login",
 
692
    G_TYPE_FROM_INTERFACE (iface),
 
693
    G_SIGNAL_RUN_LAST,
 
694
    G_STRUCT_OFFSET (RemoteLoginIface, handle_get_servers_for_login),
 
695
    g_signal_accumulator_true_handled,
 
696
    NULL,
 
697
    g_cclosure_marshal_generic,
 
698
    G_TYPE_BOOLEAN,
 
699
    5,
 
700
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
 
701
 
 
702
  /**
 
703
   * RemoteLogin::handle-get-cached-domains-for-server:
 
704
   * @object: A #RemoteLogin.
 
705
   * @invocation: A #GDBusMethodInvocation.
 
706
   * @arg_uri: Argument passed by remote caller.
 
707
   *
 
708
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetCachedDomainsForServer">GetCachedDomainsForServer()</link> D-Bus method.
 
709
   *
 
710
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call remote_login_complete_get_cached_domains_for_server() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
 
711
   *
 
712
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
 
713
   */
 
714
  g_signal_new ("handle-get-cached-domains-for-server",
 
715
    G_TYPE_FROM_INTERFACE (iface),
 
716
    G_SIGNAL_RUN_LAST,
 
717
    G_STRUCT_OFFSET (RemoteLoginIface, handle_get_cached_domains_for_server),
 
718
    g_signal_accumulator_true_handled,
 
719
    NULL,
 
720
    g_cclosure_marshal_generic,
 
721
    G_TYPE_BOOLEAN,
 
722
    2,
 
723
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
 
724
 
 
725
  /**
 
726
   * RemoteLogin::handle-set-applications-for-server:
 
727
   * @object: A #RemoteLogin.
 
728
   * @invocation: A #GDBusMethodInvocation.
 
729
   * @arg_uccsUri: Argument passed by remote caller.
 
730
   * @arg_serverUri: Argument passed by remote caller.
 
731
   * @arg_applications: Argument passed by remote caller.
 
732
   *
 
733
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-canonical-RemoteLogin.SetApplicationsForServer">SetApplicationsForServer()</link> D-Bus method.
 
734
   *
 
735
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call remote_login_complete_set_applications_for_server() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
 
736
   *
 
737
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
 
738
   */
 
739
  g_signal_new ("handle-set-applications-for-server",
 
740
    G_TYPE_FROM_INTERFACE (iface),
 
741
    G_SIGNAL_RUN_LAST,
 
742
    G_STRUCT_OFFSET (RemoteLoginIface, handle_set_applications_for_server),
 
743
    g_signal_accumulator_true_handled,
 
744
    NULL,
 
745
    g_cclosure_marshal_generic,
 
746
    G_TYPE_BOOLEAN,
 
747
    4,
 
748
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);
 
749
 
 
750
  /**
 
751
   * RemoteLogin::handle-set-last-used-server:
 
752
   * @object: A #RemoteLogin.
 
753
   * @invocation: A #GDBusMethodInvocation.
 
754
   * @arg_uccsUri: Argument passed by remote caller.
 
755
   * @arg_serverUri: Argument passed by remote caller.
 
756
   *
 
757
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-canonical-RemoteLogin.SetLastUsedServer">SetLastUsedServer()</link> D-Bus method.
 
758
   *
 
759
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call remote_login_complete_set_last_used_server() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
 
760
   *
 
761
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
 
762
   */
 
763
  g_signal_new ("handle-set-last-used-server",
 
764
    G_TYPE_FROM_INTERFACE (iface),
 
765
    G_SIGNAL_RUN_LAST,
 
766
    G_STRUCT_OFFSET (RemoteLoginIface, handle_set_last_used_server),
 
767
    g_signal_accumulator_true_handled,
 
768
    NULL,
 
769
    g_cclosure_marshal_generic,
 
770
    G_TYPE_BOOLEAN,
 
771
    3,
 
772
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING);
 
773
 
 
774
  /* GObject signals for received D-Bus signals: */
 
775
  /**
 
776
   * RemoteLogin::servers-updated:
 
777
   * @object: A #RemoteLogin.
 
778
   * @arg_serverList: Argument.
 
779
   *
 
780
   * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-canonical-RemoteLogin.ServersUpdated">"ServersUpdated"</link> is received.
 
781
   *
 
782
   * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
 
783
   */
 
784
  g_signal_new ("servers-updated",
 
785
    G_TYPE_FROM_INTERFACE (iface),
 
786
    G_SIGNAL_RUN_LAST,
 
787
    G_STRUCT_OFFSET (RemoteLoginIface, servers_updated),
 
788
    NULL,
 
789
    NULL,
 
790
    g_cclosure_marshal_generic,
 
791
    G_TYPE_NONE,
 
792
    1, G_TYPE_VARIANT);
 
793
 
 
794
  /**
 
795
   * RemoteLogin::login-servers-updated:
 
796
   * @object: A #RemoteLogin.
 
797
   * @arg_uri: Argument.
 
798
   * @arg_emailAddress: Argument.
 
799
   * @arg_dataType: Argument.
 
800
   * @arg_serverList: Argument.
 
801
   *
 
802
   * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-canonical-RemoteLogin.LoginServersUpdated">"LoginServersUpdated"</link> is received.
 
803
   *
 
804
   * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
 
805
   */
 
806
  g_signal_new ("login-servers-updated",
 
807
    G_TYPE_FROM_INTERFACE (iface),
 
808
    G_SIGNAL_RUN_LAST,
 
809
    G_STRUCT_OFFSET (RemoteLoginIface, login_servers_updated),
 
810
    NULL,
 
811
    NULL,
 
812
    g_cclosure_marshal_generic,
 
813
    G_TYPE_NONE,
 
814
    4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);
 
815
 
 
816
  /**
 
817
   * RemoteLogin::login-changed:
 
818
   * @object: A #RemoteLogin.
 
819
   * @arg_uri: Argument.
 
820
   * @arg_emailAddress: Argument.
 
821
   *
 
822
   * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-canonical-RemoteLogin.LoginChanged">"LoginChanged"</link> is received.
 
823
   *
 
824
   * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
 
825
   */
 
826
  g_signal_new ("login-changed",
 
827
    G_TYPE_FROM_INTERFACE (iface),
 
828
    G_SIGNAL_RUN_LAST,
 
829
    G_STRUCT_OFFSET (RemoteLoginIface, login_changed),
 
830
    NULL,
 
831
    NULL,
 
832
    g_cclosure_marshal_generic,
 
833
    G_TYPE_NONE,
 
834
    2, G_TYPE_STRING, G_TYPE_STRING);
 
835
 
 
836
}
 
837
 
 
838
typedef RemoteLoginIface RemoteLoginInterface;
 
839
G_DEFINE_INTERFACE (RemoteLogin, remote_login, G_TYPE_OBJECT);
 
840
 
 
841
/**
 
842
 * remote_login_emit_servers_updated:
 
843
 * @object: A #RemoteLogin.
 
844
 * @arg_serverList: Argument to pass with the signal.
 
845
 *
 
846
 * Emits the <link linkend="gdbus-signal-com-canonical-RemoteLogin.ServersUpdated">"ServersUpdated"</link> D-Bus signal.
 
847
 */
 
848
void
 
849
remote_login_emit_servers_updated (
 
850
    RemoteLogin *object,
 
851
    GVariant *arg_serverList)
 
852
{
 
853
  g_signal_emit_by_name (object, "servers-updated", arg_serverList);
 
854
}
 
855
 
 
856
/**
 
857
 * remote_login_emit_login_servers_updated:
 
858
 * @object: A #RemoteLogin.
 
859
 * @arg_uri: Argument to pass with the signal.
 
860
 * @arg_emailAddress: Argument to pass with the signal.
 
861
 * @arg_dataType: Argument to pass with the signal.
 
862
 * @arg_serverList: Argument to pass with the signal.
 
863
 *
 
864
 * Emits the <link linkend="gdbus-signal-com-canonical-RemoteLogin.LoginServersUpdated">"LoginServersUpdated"</link> D-Bus signal.
 
865
 */
 
866
void
 
867
remote_login_emit_login_servers_updated (
 
868
    RemoteLogin *object,
 
869
    const gchar *arg_uri,
 
870
    const gchar *arg_emailAddress,
 
871
    const gchar *arg_dataType,
 
872
    GVariant *arg_serverList)
 
873
{
 
874
  g_signal_emit_by_name (object, "login-servers-updated", arg_uri, arg_emailAddress, arg_dataType, arg_serverList);
 
875
}
 
876
 
 
877
/**
 
878
 * remote_login_emit_login_changed:
 
879
 * @object: A #RemoteLogin.
 
880
 * @arg_uri: Argument to pass with the signal.
 
881
 * @arg_emailAddress: Argument to pass with the signal.
 
882
 *
 
883
 * Emits the <link linkend="gdbus-signal-com-canonical-RemoteLogin.LoginChanged">"LoginChanged"</link> D-Bus signal.
 
884
 */
 
885
void
 
886
remote_login_emit_login_changed (
 
887
    RemoteLogin *object,
 
888
    const gchar *arg_uri,
 
889
    const gchar *arg_emailAddress)
 
890
{
 
891
  g_signal_emit_by_name (object, "login-changed", arg_uri, arg_emailAddress);
 
892
}
 
893
 
 
894
/**
 
895
 * remote_login_call_get_servers:
 
896
 * @proxy: A #RemoteLoginProxy.
 
897
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
898
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 
899
 * @user_data: User data to pass to @callback.
 
900
 *
 
901
 * Asynchronously invokes the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetServers">GetServers()</link> D-Bus method on @proxy.
 
902
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 
903
 * You can then call remote_login_call_get_servers_finish() to get the result of the operation.
 
904
 *
 
905
 * See remote_login_call_get_servers_sync() for the synchronous, blocking version of this method.
 
906
 */
 
907
void
 
908
remote_login_call_get_servers (
 
909
    RemoteLogin *proxy,
 
910
    GCancellable *cancellable,
 
911
    GAsyncReadyCallback callback,
 
912
    gpointer user_data)
 
913
{
 
914
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
 
915
    "GetServers",
 
916
    g_variant_new ("()"),
 
917
    G_DBUS_CALL_FLAGS_NONE,
 
918
    -1,
 
919
    cancellable,
 
920
    callback,
 
921
    user_data);
 
922
}
 
923
 
 
924
/**
 
925
 * remote_login_call_get_servers_finish:
 
926
 * @proxy: A #RemoteLoginProxy.
 
927
 * @out_serverList: (out): Return location for return parameter or %NULL to ignore.
 
928
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to remote_login_call_get_servers().
 
929
 * @error: Return location for error or %NULL.
 
930
 *
 
931
 * Finishes an operation started with remote_login_call_get_servers().
 
932
 *
 
933
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 
934
 */
 
935
gboolean
 
936
remote_login_call_get_servers_finish (
 
937
    RemoteLogin *proxy,
 
938
    GVariant **out_serverList,
 
939
    GAsyncResult *res,
 
940
    GError **error)
 
941
{
 
942
  GVariant *_ret;
 
943
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
 
944
  if (_ret == NULL)
 
945
    goto _out;
 
946
  g_variant_get (_ret,
 
947
                 "(@a(sssba(sbva{sv})a(si)))",
 
948
                 out_serverList);
 
949
  g_variant_unref (_ret);
 
950
_out:
 
951
  return _ret != NULL;
 
952
}
 
953
 
 
954
/**
 
955
 * remote_login_call_get_servers_sync:
 
956
 * @proxy: A #RemoteLoginProxy.
 
957
 * @out_serverList: (out): Return location for return parameter or %NULL to ignore.
 
958
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
959
 * @error: Return location for error or %NULL.
 
960
 *
 
961
 * Synchronously invokes the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetServers">GetServers()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 
962
 *
 
963
 * See remote_login_call_get_servers() for the asynchronous version of this method.
 
964
 *
 
965
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 
966
 */
 
967
gboolean
 
968
remote_login_call_get_servers_sync (
 
969
    RemoteLogin *proxy,
 
970
    GVariant **out_serverList,
 
971
    GCancellable *cancellable,
 
972
    GError **error)
 
973
{
 
974
  GVariant *_ret;
 
975
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
 
976
    "GetServers",
 
977
    g_variant_new ("()"),
 
978
    G_DBUS_CALL_FLAGS_NONE,
 
979
    -1,
 
980
    cancellable,
 
981
    error);
 
982
  if (_ret == NULL)
 
983
    goto _out;
 
984
  g_variant_get (_ret,
 
985
                 "(@a(sssba(sbva{sv})a(si)))",
 
986
                 out_serverList);
 
987
  g_variant_unref (_ret);
 
988
_out:
 
989
  return _ret != NULL;
 
990
}
 
991
 
 
992
/**
 
993
 * remote_login_call_get_servers_for_login:
 
994
 * @proxy: A #RemoteLoginProxy.
 
995
 * @arg_uri: Argument to pass with the method invocation.
 
996
 * @arg_emailAddress: Argument to pass with the method invocation.
 
997
 * @arg_password: Argument to pass with the method invocation.
 
998
 * @arg_allowCache: Argument to pass with the method invocation.
 
999
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1000
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 
1001
 * @user_data: User data to pass to @callback.
 
1002
 *
 
1003
 * Asynchronously invokes the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetServersForLogin">GetServersForLogin()</link> D-Bus method on @proxy.
 
1004
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 
1005
 * You can then call remote_login_call_get_servers_for_login_finish() to get the result of the operation.
 
1006
 *
 
1007
 * See remote_login_call_get_servers_for_login_sync() for the synchronous, blocking version of this method.
 
1008
 */
 
1009
void
 
1010
remote_login_call_get_servers_for_login (
 
1011
    RemoteLogin *proxy,
 
1012
    const gchar *arg_uri,
 
1013
    const gchar *arg_emailAddress,
 
1014
    const gchar *arg_password,
 
1015
    gboolean arg_allowCache,
 
1016
    GCancellable *cancellable,
 
1017
    GAsyncReadyCallback callback,
 
1018
    gpointer user_data)
 
1019
{
 
1020
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
 
1021
    "GetServersForLogin",
 
1022
    g_variant_new ("(sssb)",
 
1023
                   arg_uri,
 
1024
                   arg_emailAddress,
 
1025
                   arg_password,
 
1026
                   arg_allowCache),
 
1027
    G_DBUS_CALL_FLAGS_NONE,
 
1028
    -1,
 
1029
    cancellable,
 
1030
    callback,
 
1031
    user_data);
 
1032
}
 
1033
 
 
1034
/**
 
1035
 * remote_login_call_get_servers_for_login_finish:
 
1036
 * @proxy: A #RemoteLoginProxy.
 
1037
 * @out_dataType: (out): Return location for return parameter or %NULL to ignore.
 
1038
 * @out_serverList: (out): Return location for return parameter or %NULL to ignore.
 
1039
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to remote_login_call_get_servers_for_login().
 
1040
 * @error: Return location for error or %NULL.
 
1041
 *
 
1042
 * Finishes an operation started with remote_login_call_get_servers_for_login().
 
1043
 *
 
1044
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 
1045
 */
 
1046
gboolean
 
1047
remote_login_call_get_servers_for_login_finish (
 
1048
    RemoteLogin *proxy,
 
1049
    gchar **out_dataType,
 
1050
    GVariant **out_serverList,
 
1051
    GAsyncResult *res,
 
1052
    GError **error)
 
1053
{
 
1054
  GVariant *_ret;
 
1055
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
 
1056
  if (_ret == NULL)
 
1057
    goto _out;
 
1058
  g_variant_get (_ret,
 
1059
                 "(s@a(sssba(sbva{sv})a(si)))",
 
1060
                 out_dataType,
 
1061
                 out_serverList);
 
1062
  g_variant_unref (_ret);
 
1063
_out:
 
1064
  return _ret != NULL;
 
1065
}
 
1066
 
 
1067
/**
 
1068
 * remote_login_call_get_servers_for_login_sync:
 
1069
 * @proxy: A #RemoteLoginProxy.
 
1070
 * @arg_uri: Argument to pass with the method invocation.
 
1071
 * @arg_emailAddress: Argument to pass with the method invocation.
 
1072
 * @arg_password: Argument to pass with the method invocation.
 
1073
 * @arg_allowCache: Argument to pass with the method invocation.
 
1074
 * @out_dataType: (out): Return location for return parameter or %NULL to ignore.
 
1075
 * @out_serverList: (out): Return location for return parameter or %NULL to ignore.
 
1076
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1077
 * @error: Return location for error or %NULL.
 
1078
 *
 
1079
 * Synchronously invokes the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetServersForLogin">GetServersForLogin()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 
1080
 *
 
1081
 * See remote_login_call_get_servers_for_login() for the asynchronous version of this method.
 
1082
 *
 
1083
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 
1084
 */
 
1085
gboolean
 
1086
remote_login_call_get_servers_for_login_sync (
 
1087
    RemoteLogin *proxy,
 
1088
    const gchar *arg_uri,
 
1089
    const gchar *arg_emailAddress,
 
1090
    const gchar *arg_password,
 
1091
    gboolean arg_allowCache,
 
1092
    gchar **out_dataType,
 
1093
    GVariant **out_serverList,
 
1094
    GCancellable *cancellable,
 
1095
    GError **error)
 
1096
{
 
1097
  GVariant *_ret;
 
1098
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
 
1099
    "GetServersForLogin",
 
1100
    g_variant_new ("(sssb)",
 
1101
                   arg_uri,
 
1102
                   arg_emailAddress,
 
1103
                   arg_password,
 
1104
                   arg_allowCache),
 
1105
    G_DBUS_CALL_FLAGS_NONE,
 
1106
    -1,
 
1107
    cancellable,
 
1108
    error);
 
1109
  if (_ret == NULL)
 
1110
    goto _out;
 
1111
  g_variant_get (_ret,
 
1112
                 "(s@a(sssba(sbva{sv})a(si)))",
 
1113
                 out_dataType,
 
1114
                 out_serverList);
 
1115
  g_variant_unref (_ret);
 
1116
_out:
 
1117
  return _ret != NULL;
 
1118
}
 
1119
 
 
1120
/**
 
1121
 * remote_login_call_get_cached_domains_for_server:
 
1122
 * @proxy: A #RemoteLoginProxy.
 
1123
 * @arg_uri: Argument to pass with the method invocation.
 
1124
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1125
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 
1126
 * @user_data: User data to pass to @callback.
 
1127
 *
 
1128
 * Asynchronously invokes the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetCachedDomainsForServer">GetCachedDomainsForServer()</link> D-Bus method on @proxy.
 
1129
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 
1130
 * You can then call remote_login_call_get_cached_domains_for_server_finish() to get the result of the operation.
 
1131
 *
 
1132
 * See remote_login_call_get_cached_domains_for_server_sync() for the synchronous, blocking version of this method.
 
1133
 */
 
1134
void
 
1135
remote_login_call_get_cached_domains_for_server (
 
1136
    RemoteLogin *proxy,
 
1137
    const gchar *arg_uri,
 
1138
    GCancellable *cancellable,
 
1139
    GAsyncReadyCallback callback,
 
1140
    gpointer user_data)
 
1141
{
 
1142
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
 
1143
    "GetCachedDomainsForServer",
 
1144
    g_variant_new ("(s)",
 
1145
                   arg_uri),
 
1146
    G_DBUS_CALL_FLAGS_NONE,
 
1147
    -1,
 
1148
    cancellable,
 
1149
    callback,
 
1150
    user_data);
 
1151
}
 
1152
 
 
1153
/**
 
1154
 * remote_login_call_get_cached_domains_for_server_finish:
 
1155
 * @proxy: A #RemoteLoginProxy.
 
1156
 * @out_domains: (out): Return location for return parameter or %NULL to ignore.
 
1157
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to remote_login_call_get_cached_domains_for_server().
 
1158
 * @error: Return location for error or %NULL.
 
1159
 *
 
1160
 * Finishes an operation started with remote_login_call_get_cached_domains_for_server().
 
1161
 *
 
1162
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 
1163
 */
 
1164
gboolean
 
1165
remote_login_call_get_cached_domains_for_server_finish (
 
1166
    RemoteLogin *proxy,
 
1167
    gchar ***out_domains,
 
1168
    GAsyncResult *res,
 
1169
    GError **error)
 
1170
{
 
1171
  GVariant *_ret;
 
1172
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
 
1173
  if (_ret == NULL)
 
1174
    goto _out;
 
1175
  g_variant_get (_ret,
 
1176
                 "(^as)",
 
1177
                 out_domains);
 
1178
  g_variant_unref (_ret);
 
1179
_out:
 
1180
  return _ret != NULL;
 
1181
}
 
1182
 
 
1183
/**
 
1184
 * remote_login_call_get_cached_domains_for_server_sync:
 
1185
 * @proxy: A #RemoteLoginProxy.
 
1186
 * @arg_uri: Argument to pass with the method invocation.
 
1187
 * @out_domains: (out): Return location for return parameter or %NULL to ignore.
 
1188
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1189
 * @error: Return location for error or %NULL.
 
1190
 *
 
1191
 * Synchronously invokes the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetCachedDomainsForServer">GetCachedDomainsForServer()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 
1192
 *
 
1193
 * See remote_login_call_get_cached_domains_for_server() for the asynchronous version of this method.
 
1194
 *
 
1195
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 
1196
 */
 
1197
gboolean
 
1198
remote_login_call_get_cached_domains_for_server_sync (
 
1199
    RemoteLogin *proxy,
 
1200
    const gchar *arg_uri,
 
1201
    gchar ***out_domains,
 
1202
    GCancellable *cancellable,
 
1203
    GError **error)
 
1204
{
 
1205
  GVariant *_ret;
 
1206
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
 
1207
    "GetCachedDomainsForServer",
 
1208
    g_variant_new ("(s)",
 
1209
                   arg_uri),
 
1210
    G_DBUS_CALL_FLAGS_NONE,
 
1211
    -1,
 
1212
    cancellable,
 
1213
    error);
 
1214
  if (_ret == NULL)
 
1215
    goto _out;
 
1216
  g_variant_get (_ret,
 
1217
                 "(^as)",
 
1218
                 out_domains);
 
1219
  g_variant_unref (_ret);
 
1220
_out:
 
1221
  return _ret != NULL;
 
1222
}
 
1223
 
 
1224
/**
 
1225
 * remote_login_call_set_applications_for_server:
 
1226
 * @proxy: A #RemoteLoginProxy.
 
1227
 * @arg_uccsUri: Argument to pass with the method invocation.
 
1228
 * @arg_serverUri: Argument to pass with the method invocation.
 
1229
 * @arg_applications: Argument to pass with the method invocation.
 
1230
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1231
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 
1232
 * @user_data: User data to pass to @callback.
 
1233
 *
 
1234
 * Asynchronously invokes the <link linkend="gdbus-method-com-canonical-RemoteLogin.SetApplicationsForServer">SetApplicationsForServer()</link> D-Bus method on @proxy.
 
1235
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 
1236
 * You can then call remote_login_call_set_applications_for_server_finish() to get the result of the operation.
 
1237
 *
 
1238
 * See remote_login_call_set_applications_for_server_sync() for the synchronous, blocking version of this method.
 
1239
 */
 
1240
void
 
1241
remote_login_call_set_applications_for_server (
 
1242
    RemoteLogin *proxy,
 
1243
    const gchar *arg_uccsUri,
 
1244
    const gchar *arg_serverUri,
 
1245
    GVariant *arg_applications,
 
1246
    GCancellable *cancellable,
 
1247
    GAsyncReadyCallback callback,
 
1248
    gpointer user_data)
 
1249
{
 
1250
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
 
1251
    "SetApplicationsForServer",
 
1252
    g_variant_new ("(ss@a(si))",
 
1253
                   arg_uccsUri,
 
1254
                   arg_serverUri,
 
1255
                   arg_applications),
 
1256
    G_DBUS_CALL_FLAGS_NONE,
 
1257
    -1,
 
1258
    cancellable,
 
1259
    callback,
 
1260
    user_data);
 
1261
}
 
1262
 
 
1263
/**
 
1264
 * remote_login_call_set_applications_for_server_finish:
 
1265
 * @proxy: A #RemoteLoginProxy.
 
1266
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to remote_login_call_set_applications_for_server().
 
1267
 * @error: Return location for error or %NULL.
 
1268
 *
 
1269
 * Finishes an operation started with remote_login_call_set_applications_for_server().
 
1270
 *
 
1271
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 
1272
 */
 
1273
gboolean
 
1274
remote_login_call_set_applications_for_server_finish (
 
1275
    RemoteLogin *proxy,
 
1276
    GAsyncResult *res,
 
1277
    GError **error)
 
1278
{
 
1279
  GVariant *_ret;
 
1280
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
 
1281
  if (_ret == NULL)
 
1282
    goto _out;
 
1283
  g_variant_get (_ret,
 
1284
                 "()");
 
1285
  g_variant_unref (_ret);
 
1286
_out:
 
1287
  return _ret != NULL;
 
1288
}
 
1289
 
 
1290
/**
 
1291
 * remote_login_call_set_applications_for_server_sync:
 
1292
 * @proxy: A #RemoteLoginProxy.
 
1293
 * @arg_uccsUri: Argument to pass with the method invocation.
 
1294
 * @arg_serverUri: Argument to pass with the method invocation.
 
1295
 * @arg_applications: Argument to pass with the method invocation.
 
1296
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1297
 * @error: Return location for error or %NULL.
 
1298
 *
 
1299
 * Synchronously invokes the <link linkend="gdbus-method-com-canonical-RemoteLogin.SetApplicationsForServer">SetApplicationsForServer()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 
1300
 *
 
1301
 * See remote_login_call_set_applications_for_server() for the asynchronous version of this method.
 
1302
 *
 
1303
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 
1304
 */
 
1305
gboolean
 
1306
remote_login_call_set_applications_for_server_sync (
 
1307
    RemoteLogin *proxy,
 
1308
    const gchar *arg_uccsUri,
 
1309
    const gchar *arg_serverUri,
 
1310
    GVariant *arg_applications,
 
1311
    GCancellable *cancellable,
 
1312
    GError **error)
 
1313
{
 
1314
  GVariant *_ret;
 
1315
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
 
1316
    "SetApplicationsForServer",
 
1317
    g_variant_new ("(ss@a(si))",
 
1318
                   arg_uccsUri,
 
1319
                   arg_serverUri,
 
1320
                   arg_applications),
 
1321
    G_DBUS_CALL_FLAGS_NONE,
 
1322
    -1,
 
1323
    cancellable,
 
1324
    error);
 
1325
  if (_ret == NULL)
 
1326
    goto _out;
 
1327
  g_variant_get (_ret,
 
1328
                 "()");
 
1329
  g_variant_unref (_ret);
 
1330
_out:
 
1331
  return _ret != NULL;
 
1332
}
 
1333
 
 
1334
/**
 
1335
 * remote_login_call_set_last_used_server:
 
1336
 * @proxy: A #RemoteLoginProxy.
 
1337
 * @arg_uccsUri: Argument to pass with the method invocation.
 
1338
 * @arg_serverUri: Argument to pass with the method invocation.
 
1339
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1340
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 
1341
 * @user_data: User data to pass to @callback.
 
1342
 *
 
1343
 * Asynchronously invokes the <link linkend="gdbus-method-com-canonical-RemoteLogin.SetLastUsedServer">SetLastUsedServer()</link> D-Bus method on @proxy.
 
1344
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 
1345
 * You can then call remote_login_call_set_last_used_server_finish() to get the result of the operation.
 
1346
 *
 
1347
 * See remote_login_call_set_last_used_server_sync() for the synchronous, blocking version of this method.
 
1348
 */
 
1349
void
 
1350
remote_login_call_set_last_used_server (
 
1351
    RemoteLogin *proxy,
 
1352
    const gchar *arg_uccsUri,
 
1353
    const gchar *arg_serverUri,
 
1354
    GCancellable *cancellable,
 
1355
    GAsyncReadyCallback callback,
 
1356
    gpointer user_data)
 
1357
{
 
1358
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
 
1359
    "SetLastUsedServer",
 
1360
    g_variant_new ("(ss)",
 
1361
                   arg_uccsUri,
 
1362
                   arg_serverUri),
 
1363
    G_DBUS_CALL_FLAGS_NONE,
 
1364
    -1,
 
1365
    cancellable,
 
1366
    callback,
 
1367
    user_data);
 
1368
}
 
1369
 
 
1370
/**
 
1371
 * remote_login_call_set_last_used_server_finish:
 
1372
 * @proxy: A #RemoteLoginProxy.
 
1373
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to remote_login_call_set_last_used_server().
 
1374
 * @error: Return location for error or %NULL.
 
1375
 *
 
1376
 * Finishes an operation started with remote_login_call_set_last_used_server().
 
1377
 *
 
1378
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 
1379
 */
 
1380
gboolean
 
1381
remote_login_call_set_last_used_server_finish (
 
1382
    RemoteLogin *proxy,
 
1383
    GAsyncResult *res,
 
1384
    GError **error)
 
1385
{
 
1386
  GVariant *_ret;
 
1387
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
 
1388
  if (_ret == NULL)
 
1389
    goto _out;
 
1390
  g_variant_get (_ret,
 
1391
                 "()");
 
1392
  g_variant_unref (_ret);
 
1393
_out:
 
1394
  return _ret != NULL;
 
1395
}
 
1396
 
 
1397
/**
 
1398
 * remote_login_call_set_last_used_server_sync:
 
1399
 * @proxy: A #RemoteLoginProxy.
 
1400
 * @arg_uccsUri: Argument to pass with the method invocation.
 
1401
 * @arg_serverUri: Argument to pass with the method invocation.
 
1402
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1403
 * @error: Return location for error or %NULL.
 
1404
 *
 
1405
 * Synchronously invokes the <link linkend="gdbus-method-com-canonical-RemoteLogin.SetLastUsedServer">SetLastUsedServer()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 
1406
 *
 
1407
 * See remote_login_call_set_last_used_server() for the asynchronous version of this method.
 
1408
 *
 
1409
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 
1410
 */
 
1411
gboolean
 
1412
remote_login_call_set_last_used_server_sync (
 
1413
    RemoteLogin *proxy,
 
1414
    const gchar *arg_uccsUri,
 
1415
    const gchar *arg_serverUri,
 
1416
    GCancellable *cancellable,
 
1417
    GError **error)
 
1418
{
 
1419
  GVariant *_ret;
 
1420
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
 
1421
    "SetLastUsedServer",
 
1422
    g_variant_new ("(ss)",
 
1423
                   arg_uccsUri,
 
1424
                   arg_serverUri),
 
1425
    G_DBUS_CALL_FLAGS_NONE,
 
1426
    -1,
 
1427
    cancellable,
 
1428
    error);
 
1429
  if (_ret == NULL)
 
1430
    goto _out;
 
1431
  g_variant_get (_ret,
 
1432
                 "()");
 
1433
  g_variant_unref (_ret);
 
1434
_out:
 
1435
  return _ret != NULL;
 
1436
}
 
1437
 
 
1438
/**
 
1439
 * remote_login_complete_get_servers:
 
1440
 * @object: A #RemoteLogin.
 
1441
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 
1442
 * @serverList: Parameter to return.
 
1443
 *
 
1444
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetServers">GetServers()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 
1445
 *
 
1446
 * This method will free @invocation, you cannot use it afterwards.
 
1447
 */
 
1448
void
 
1449
remote_login_complete_get_servers (
 
1450
    RemoteLogin *object,
 
1451
    GDBusMethodInvocation *invocation,
 
1452
    GVariant *serverList)
 
1453
{
 
1454
  g_dbus_method_invocation_return_value (invocation,
 
1455
    g_variant_new ("(@a(sssba(sbva{sv})a(si)))",
 
1456
                   serverList));
 
1457
}
 
1458
 
 
1459
/**
 
1460
 * remote_login_complete_get_servers_for_login:
 
1461
 * @object: A #RemoteLogin.
 
1462
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 
1463
 * @dataType: Parameter to return.
 
1464
 * @serverList: Parameter to return.
 
1465
 *
 
1466
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetServersForLogin">GetServersForLogin()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 
1467
 *
 
1468
 * This method will free @invocation, you cannot use it afterwards.
 
1469
 */
 
1470
void
 
1471
remote_login_complete_get_servers_for_login (
 
1472
    RemoteLogin *object,
 
1473
    GDBusMethodInvocation *invocation,
 
1474
    const gchar *dataType,
 
1475
    GVariant *serverList)
 
1476
{
 
1477
  g_dbus_method_invocation_return_value (invocation,
 
1478
    g_variant_new ("(s@a(sssba(sbva{sv})a(si)))",
 
1479
                   dataType,
 
1480
                   serverList));
 
1481
}
 
1482
 
 
1483
/**
 
1484
 * remote_login_complete_get_cached_domains_for_server:
 
1485
 * @object: A #RemoteLogin.
 
1486
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 
1487
 * @domains: Parameter to return.
 
1488
 *
 
1489
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-canonical-RemoteLogin.GetCachedDomainsForServer">GetCachedDomainsForServer()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 
1490
 *
 
1491
 * This method will free @invocation, you cannot use it afterwards.
 
1492
 */
 
1493
void
 
1494
remote_login_complete_get_cached_domains_for_server (
 
1495
    RemoteLogin *object,
 
1496
    GDBusMethodInvocation *invocation,
 
1497
    const gchar *const *domains)
 
1498
{
 
1499
  g_dbus_method_invocation_return_value (invocation,
 
1500
    g_variant_new ("(^as)",
 
1501
                   domains));
 
1502
}
 
1503
 
 
1504
/**
 
1505
 * remote_login_complete_set_applications_for_server:
 
1506
 * @object: A #RemoteLogin.
 
1507
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 
1508
 *
 
1509
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-canonical-RemoteLogin.SetApplicationsForServer">SetApplicationsForServer()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 
1510
 *
 
1511
 * This method will free @invocation, you cannot use it afterwards.
 
1512
 */
 
1513
void
 
1514
remote_login_complete_set_applications_for_server (
 
1515
    RemoteLogin *object,
 
1516
    GDBusMethodInvocation *invocation)
 
1517
{
 
1518
  g_dbus_method_invocation_return_value (invocation,
 
1519
    g_variant_new ("()"));
 
1520
}
 
1521
 
 
1522
/**
 
1523
 * remote_login_complete_set_last_used_server:
 
1524
 * @object: A #RemoteLogin.
 
1525
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 
1526
 *
 
1527
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-canonical-RemoteLogin.SetLastUsedServer">SetLastUsedServer()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 
1528
 *
 
1529
 * This method will free @invocation, you cannot use it afterwards.
 
1530
 */
 
1531
void
 
1532
remote_login_complete_set_last_used_server (
 
1533
    RemoteLogin *object,
 
1534
    GDBusMethodInvocation *invocation)
 
1535
{
 
1536
  g_dbus_method_invocation_return_value (invocation,
 
1537
    g_variant_new ("()"));
 
1538
}
 
1539
 
 
1540
/* ------------------------------------------------------------------------ */
 
1541
 
 
1542
/**
 
1543
 * RemoteLoginProxy:
 
1544
 *
 
1545
 * The #RemoteLoginProxy structure contains only private data and should only be accessed using the provided API.
 
1546
 */
 
1547
 
 
1548
/**
 
1549
 * RemoteLoginProxyClass:
 
1550
 * @parent_class: The parent class.
 
1551
 *
 
1552
 * Class structure for #RemoteLoginProxy.
 
1553
 */
 
1554
 
 
1555
struct _RemoteLoginProxyPrivate
 
1556
{
 
1557
  GData *qdata;
 
1558
};
 
1559
 
 
1560
static void remote_login_proxy_iface_init (RemoteLoginIface *iface);
 
1561
 
 
1562
G_DEFINE_TYPE_WITH_CODE (RemoteLoginProxy, remote_login_proxy, G_TYPE_DBUS_PROXY,
 
1563
                         G_IMPLEMENT_INTERFACE (TYPE_REMOTE_LOGIN, remote_login_proxy_iface_init));
 
1564
 
 
1565
static void
 
1566
remote_login_proxy_finalize (GObject *object)
 
1567
{
 
1568
  RemoteLoginProxy *proxy = REMOTE_LOGIN_PROXY (object);
 
1569
  g_datalist_clear (&proxy->priv->qdata);
 
1570
  G_OBJECT_CLASS (remote_login_proxy_parent_class)->finalize (object);
 
1571
}
 
1572
 
 
1573
static void
 
1574
remote_login_proxy_get_property (GObject      *object,
 
1575
  guint         prop_id,
 
1576
  GValue       *value,
 
1577
  GParamSpec   *pspec)
 
1578
{
 
1579
}
 
1580
 
 
1581
static void
 
1582
remote_login_proxy_set_property (GObject      *object,
 
1583
  guint         prop_id,
 
1584
  const GValue *value,
 
1585
  GParamSpec   *pspec)
 
1586
{
 
1587
}
 
1588
 
 
1589
static void
 
1590
remote_login_proxy_g_signal (GDBusProxy *proxy,
 
1591
  const gchar *sender_name,
 
1592
  const gchar *signal_name,
 
1593
  GVariant *parameters)
 
1594
{
 
1595
  _ExtendedGDBusSignalInfo *info;
 
1596
  GVariantIter iter;
 
1597
  GVariant *child;
 
1598
  GValue *paramv;
 
1599
  guint num_params;
 
1600
  guint n;
 
1601
  guint signal_id;
 
1602
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_remote_login_interface_info.parent_struct, signal_name);
 
1603
  if (info == NULL)
 
1604
    return;
 
1605
  num_params = g_variant_n_children (parameters);
 
1606
  paramv = g_new0 (GValue, num_params + 1);
 
1607
  g_value_init (&paramv[0], TYPE_REMOTE_LOGIN);
 
1608
  g_value_set_object (&paramv[0], proxy);
 
1609
  g_variant_iter_init (&iter, parameters);
 
1610
  n = 1;
 
1611
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
 
1612
    {
 
1613
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
 
1614
      if (arg_info->use_gvariant)
 
1615
        {
 
1616
          g_value_init (&paramv[n], G_TYPE_VARIANT);
 
1617
          g_value_set_variant (&paramv[n], child);
 
1618
          n++;
 
1619
        }
 
1620
      else
 
1621
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
 
1622
      g_variant_unref (child);
 
1623
    }
 
1624
  signal_id = g_signal_lookup (info->signal_name, TYPE_REMOTE_LOGIN);
 
1625
  g_signal_emitv (paramv, signal_id, 0, NULL);
 
1626
  for (n = 0; n < num_params + 1; n++)
 
1627
    g_value_unset (&paramv[n]);
 
1628
  g_free (paramv);
 
1629
}
 
1630
 
 
1631
static void
 
1632
remote_login_proxy_g_properties_changed (GDBusProxy *_proxy,
 
1633
  GVariant *changed_properties,
 
1634
  const gchar *const *invalidated_properties)
 
1635
{
 
1636
  RemoteLoginProxy *proxy = REMOTE_LOGIN_PROXY (_proxy);
 
1637
  guint n;
 
1638
  const gchar *key;
 
1639
  GVariantIter *iter;
 
1640
  _ExtendedGDBusPropertyInfo *info;
 
1641
  g_variant_get (changed_properties, "a{sv}", &iter);
 
1642
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
 
1643
    {
 
1644
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_remote_login_interface_info.parent_struct, key);
 
1645
      g_datalist_remove_data (&proxy->priv->qdata, key);
 
1646
      if (info != NULL)
 
1647
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
 
1648
    }
 
1649
  g_variant_iter_free (iter);
 
1650
  for (n = 0; invalidated_properties[n] != NULL; n++)
 
1651
    {
 
1652
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_remote_login_interface_info.parent_struct, invalidated_properties[n]);
 
1653
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
 
1654
      if (info != NULL)
 
1655
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
 
1656
    }
 
1657
}
 
1658
 
 
1659
static void
 
1660
remote_login_proxy_init (RemoteLoginProxy *proxy)
 
1661
{
 
1662
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_REMOTE_LOGIN_PROXY, RemoteLoginProxyPrivate);
 
1663
  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), remote_login_interface_info ());
 
1664
}
 
1665
 
 
1666
static void
 
1667
remote_login_proxy_class_init (RemoteLoginProxyClass *klass)
 
1668
{
 
1669
  GObjectClass *gobject_class;
 
1670
  GDBusProxyClass *proxy_class;
 
1671
 
 
1672
  g_type_class_add_private (klass, sizeof (RemoteLoginProxyPrivate));
 
1673
 
 
1674
  gobject_class = G_OBJECT_CLASS (klass);
 
1675
  gobject_class->finalize     = remote_login_proxy_finalize;
 
1676
  gobject_class->get_property = remote_login_proxy_get_property;
 
1677
  gobject_class->set_property = remote_login_proxy_set_property;
 
1678
 
 
1679
  proxy_class = G_DBUS_PROXY_CLASS (klass);
 
1680
  proxy_class->g_signal = remote_login_proxy_g_signal;
 
1681
  proxy_class->g_properties_changed = remote_login_proxy_g_properties_changed;
 
1682
 
 
1683
}
 
1684
 
 
1685
static void
 
1686
remote_login_proxy_iface_init (RemoteLoginIface *iface)
 
1687
{
 
1688
}
 
1689
 
 
1690
/**
 
1691
 * remote_login_proxy_new:
 
1692
 * @connection: A #GDBusConnection.
 
1693
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 
1694
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 
1695
 * @object_path: An object path.
 
1696
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1697
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 
1698
 * @user_data: User data to pass to @callback.
 
1699
 *
 
1700
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-canonical-RemoteLogin.top_of_page">com.canonical.RemoteLogin</link>. See g_dbus_proxy_new() for more details.
 
1701
 *
 
1702
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 
1703
 * You can then call remote_login_proxy_new_finish() to get the result of the operation.
 
1704
 *
 
1705
 * See remote_login_proxy_new_sync() for the synchronous, blocking version of this constructor.
 
1706
 */
 
1707
void
 
1708
remote_login_proxy_new (
 
1709
    GDBusConnection     *connection,
 
1710
    GDBusProxyFlags      flags,
 
1711
    const gchar         *name,
 
1712
    const gchar         *object_path,
 
1713
    GCancellable        *cancellable,
 
1714
    GAsyncReadyCallback  callback,
 
1715
    gpointer             user_data)
 
1716
{
 
1717
  g_async_initable_new_async (TYPE_REMOTE_LOGIN_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.canonical.RemoteLogin", NULL);
 
1718
}
 
1719
 
 
1720
/**
 
1721
 * remote_login_proxy_new_finish:
 
1722
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to remote_login_proxy_new().
 
1723
 * @error: Return location for error or %NULL
 
1724
 *
 
1725
 * Finishes an operation started with remote_login_proxy_new().
 
1726
 *
 
1727
 * Returns: (transfer full) (type RemoteLoginProxy): The constructed proxy object or %NULL if @error is set.
 
1728
 */
 
1729
RemoteLogin *
 
1730
remote_login_proxy_new_finish (
 
1731
    GAsyncResult        *res,
 
1732
    GError             **error)
 
1733
{
 
1734
  GObject *ret;
 
1735
  GObject *source_object;
 
1736
  source_object = g_async_result_get_source_object (res);
 
1737
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
 
1738
  g_object_unref (source_object);
 
1739
  if (ret != NULL)
 
1740
    return REMOTE_LOGIN (ret);
 
1741
  else
 
1742
    return NULL;
 
1743
}
 
1744
 
 
1745
/**
 
1746
 * remote_login_proxy_new_sync:
 
1747
 * @connection: A #GDBusConnection.
 
1748
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 
1749
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 
1750
 * @object_path: An object path.
 
1751
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1752
 * @error: Return location for error or %NULL
 
1753
 *
 
1754
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-canonical-RemoteLogin.top_of_page">com.canonical.RemoteLogin</link>. See g_dbus_proxy_new_sync() for more details.
 
1755
 *
 
1756
 * The calling thread is blocked until a reply is received.
 
1757
 *
 
1758
 * See remote_login_proxy_new() for the asynchronous version of this constructor.
 
1759
 *
 
1760
 * Returns: (transfer full) (type RemoteLoginProxy): The constructed proxy object or %NULL if @error is set.
 
1761
 */
 
1762
RemoteLogin *
 
1763
remote_login_proxy_new_sync (
 
1764
    GDBusConnection     *connection,
 
1765
    GDBusProxyFlags      flags,
 
1766
    const gchar         *name,
 
1767
    const gchar         *object_path,
 
1768
    GCancellable        *cancellable,
 
1769
    GError             **error)
 
1770
{
 
1771
  GInitable *ret;
 
1772
  ret = g_initable_new (TYPE_REMOTE_LOGIN_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.canonical.RemoteLogin", NULL);
 
1773
  if (ret != NULL)
 
1774
    return REMOTE_LOGIN (ret);
 
1775
  else
 
1776
    return NULL;
 
1777
}
 
1778
 
 
1779
 
 
1780
/**
 
1781
 * remote_login_proxy_new_for_bus:
 
1782
 * @bus_type: A #GBusType.
 
1783
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 
1784
 * @name: A bus name (well-known or unique).
 
1785
 * @object_path: An object path.
 
1786
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1787
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 
1788
 * @user_data: User data to pass to @callback.
 
1789
 *
 
1790
 * Like remote_login_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 
1791
 *
 
1792
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 
1793
 * You can then call remote_login_proxy_new_for_bus_finish() to get the result of the operation.
 
1794
 *
 
1795
 * See remote_login_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 
1796
 */
 
1797
void
 
1798
remote_login_proxy_new_for_bus (
 
1799
    GBusType             bus_type,
 
1800
    GDBusProxyFlags      flags,
 
1801
    const gchar         *name,
 
1802
    const gchar         *object_path,
 
1803
    GCancellable        *cancellable,
 
1804
    GAsyncReadyCallback  callback,
 
1805
    gpointer             user_data)
 
1806
{
 
1807
  g_async_initable_new_async (TYPE_REMOTE_LOGIN_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.canonical.RemoteLogin", NULL);
 
1808
}
 
1809
 
 
1810
/**
 
1811
 * remote_login_proxy_new_for_bus_finish:
 
1812
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to remote_login_proxy_new_for_bus().
 
1813
 * @error: Return location for error or %NULL
 
1814
 *
 
1815
 * Finishes an operation started with remote_login_proxy_new_for_bus().
 
1816
 *
 
1817
 * Returns: (transfer full) (type RemoteLoginProxy): The constructed proxy object or %NULL if @error is set.
 
1818
 */
 
1819
RemoteLogin *
 
1820
remote_login_proxy_new_for_bus_finish (
 
1821
    GAsyncResult        *res,
 
1822
    GError             **error)
 
1823
{
 
1824
  GObject *ret;
 
1825
  GObject *source_object;
 
1826
  source_object = g_async_result_get_source_object (res);
 
1827
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
 
1828
  g_object_unref (source_object);
 
1829
  if (ret != NULL)
 
1830
    return REMOTE_LOGIN (ret);
 
1831
  else
 
1832
    return NULL;
 
1833
}
 
1834
 
 
1835
/**
 
1836
 * remote_login_proxy_new_for_bus_sync:
 
1837
 * @bus_type: A #GBusType.
 
1838
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 
1839
 * @name: A bus name (well-known or unique).
 
1840
 * @object_path: An object path.
 
1841
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 
1842
 * @error: Return location for error or %NULL
 
1843
 *
 
1844
 * Like remote_login_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 
1845
 *
 
1846
 * The calling thread is blocked until a reply is received.
 
1847
 *
 
1848
 * See remote_login_proxy_new_for_bus() for the asynchronous version of this constructor.
 
1849
 *
 
1850
 * Returns: (transfer full) (type RemoteLoginProxy): The constructed proxy object or %NULL if @error is set.
 
1851
 */
 
1852
RemoteLogin *
 
1853
remote_login_proxy_new_for_bus_sync (
 
1854
    GBusType             bus_type,
 
1855
    GDBusProxyFlags      flags,
 
1856
    const gchar         *name,
 
1857
    const gchar         *object_path,
 
1858
    GCancellable        *cancellable,
 
1859
    GError             **error)
 
1860
{
 
1861
  GInitable *ret;
 
1862
  ret = g_initable_new (TYPE_REMOTE_LOGIN_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.canonical.RemoteLogin", NULL);
 
1863
  if (ret != NULL)
 
1864
    return REMOTE_LOGIN (ret);
 
1865
  else
 
1866
    return NULL;
 
1867
}
 
1868
 
 
1869
 
 
1870
/* ------------------------------------------------------------------------ */
 
1871
 
 
1872
/**
 
1873
 * RemoteLoginSkeleton:
 
1874
 *
 
1875
 * The #RemoteLoginSkeleton structure contains only private data and should only be accessed using the provided API.
 
1876
 */
 
1877
 
 
1878
/**
 
1879
 * RemoteLoginSkeletonClass:
 
1880
 * @parent_class: The parent class.
 
1881
 *
 
1882
 * Class structure for #RemoteLoginSkeleton.
 
1883
 */
 
1884
 
 
1885
struct _RemoteLoginSkeletonPrivate
 
1886
{
 
1887
  GValue *properties;
 
1888
  GList *changed_properties;
 
1889
  GSource *changed_properties_idle_source;
 
1890
  GMainContext *context;
 
1891
  GMutex lock;
 
1892
};
 
1893
 
 
1894
static void
 
1895
_remote_login_skeleton_handle_method_call (
 
1896
  GDBusConnection *connection,
 
1897
  const gchar *sender,
 
1898
  const gchar *object_path,
 
1899
  const gchar *interface_name,
 
1900
  const gchar *method_name,
 
1901
  GVariant *parameters,
 
1902
  GDBusMethodInvocation *invocation,
 
1903
  gpointer user_data)
 
1904
{
 
1905
  RemoteLoginSkeleton *skeleton = REMOTE_LOGIN_SKELETON (user_data);
 
1906
  _ExtendedGDBusMethodInfo *info;
 
1907
  GVariantIter iter;
 
1908
  GVariant *child;
 
1909
  GValue *paramv;
 
1910
  guint num_params;
 
1911
  guint num_extra;
 
1912
  guint n;
 
1913
  guint signal_id;
 
1914
  GValue return_value = G_VALUE_INIT;
 
1915
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
 
1916
  g_assert (info != NULL);
 
1917
  num_params = g_variant_n_children (parameters);
 
1918
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
 
1919
  n = 0;
 
1920
  g_value_init (&paramv[n], TYPE_REMOTE_LOGIN);
 
1921
  g_value_set_object (&paramv[n++], skeleton);
 
1922
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
 
1923
  g_value_set_object (&paramv[n++], invocation);
 
1924
  if (info->pass_fdlist)
 
1925
    {
 
1926
#ifdef G_OS_UNIX
 
1927
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
 
1928
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
 
1929
#else
 
1930
      g_assert_not_reached ();
 
1931
#endif
 
1932
    }
 
1933
  g_variant_iter_init (&iter, parameters);
 
1934
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
 
1935
    {
 
1936
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
 
1937
      if (arg_info->use_gvariant)
 
1938
        {
 
1939
          g_value_init (&paramv[n], G_TYPE_VARIANT);
 
1940
          g_value_set_variant (&paramv[n], child);
 
1941
          n++;
 
1942
        }
 
1943
      else
 
1944
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
 
1945
      g_variant_unref (child);
 
1946
    }
 
1947
  signal_id = g_signal_lookup (info->signal_name, TYPE_REMOTE_LOGIN);
 
1948
  g_value_init (&return_value, G_TYPE_BOOLEAN);
 
1949
  g_signal_emitv (paramv, signal_id, 0, &return_value);
 
1950
  if (!g_value_get_boolean (&return_value))
 
1951
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
 
1952
  g_value_unset (&return_value);
 
1953
  for (n = 0; n < num_params + num_extra; n++)
 
1954
    g_value_unset (&paramv[n]);
 
1955
  g_free (paramv);
 
1956
}
 
1957
 
 
1958
static GVariant *
 
1959
_remote_login_skeleton_handle_get_property (
 
1960
  GDBusConnection *connection,
 
1961
  const gchar *sender,
 
1962
  const gchar *object_path,
 
1963
  const gchar *interface_name,
 
1964
  const gchar *property_name,
 
1965
  GError **error,
 
1966
  gpointer user_data)
 
1967
{
 
1968
  RemoteLoginSkeleton *skeleton = REMOTE_LOGIN_SKELETON (user_data);
 
1969
  GValue value = G_VALUE_INIT;
 
1970
  GParamSpec *pspec;
 
1971
  _ExtendedGDBusPropertyInfo *info;
 
1972
  GVariant *ret;
 
1973
  ret = NULL;
 
1974
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_remote_login_interface_info.parent_struct, property_name);
 
1975
  g_assert (info != NULL);
 
1976
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
 
1977
  if (pspec == NULL)
 
1978
    {
 
1979
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
 
1980
    }
 
1981
  else
 
1982
    {
 
1983
      g_value_init (&value, pspec->value_type);
 
1984
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
 
1985
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
 
1986
      g_value_unset (&value);
 
1987
    }
 
1988
  return ret;
 
1989
}
 
1990
 
 
1991
static gboolean
 
1992
_remote_login_skeleton_handle_set_property (
 
1993
  GDBusConnection *connection,
 
1994
  const gchar *sender,
 
1995
  const gchar *object_path,
 
1996
  const gchar *interface_name,
 
1997
  const gchar *property_name,
 
1998
  GVariant *variant,
 
1999
  GError **error,
 
2000
  gpointer user_data)
 
2001
{
 
2002
  RemoteLoginSkeleton *skeleton = REMOTE_LOGIN_SKELETON (user_data);
 
2003
  GValue value = G_VALUE_INIT;
 
2004
  GParamSpec *pspec;
 
2005
  _ExtendedGDBusPropertyInfo *info;
 
2006
  gboolean ret;
 
2007
  ret = FALSE;
 
2008
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_remote_login_interface_info.parent_struct, property_name);
 
2009
  g_assert (info != NULL);
 
2010
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
 
2011
  if (pspec == NULL)
 
2012
    {
 
2013
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
 
2014
    }
 
2015
  else
 
2016
    {
 
2017
      if (info->use_gvariant)
 
2018
        g_value_set_variant (&value, variant);
 
2019
      else
 
2020
        g_dbus_gvariant_to_gvalue (variant, &value);
 
2021
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
 
2022
      g_value_unset (&value);
 
2023
      ret = TRUE;
 
2024
    }
 
2025
  return ret;
 
2026
}
 
2027
 
 
2028
static const GDBusInterfaceVTable _remote_login_skeleton_vtable =
 
2029
{
 
2030
  _remote_login_skeleton_handle_method_call,
 
2031
  _remote_login_skeleton_handle_get_property,
 
2032
  _remote_login_skeleton_handle_set_property
 
2033
};
 
2034
 
 
2035
static GDBusInterfaceInfo *
 
2036
remote_login_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
 
2037
{
 
2038
  return remote_login_interface_info ();
 
2039
}
 
2040
 
 
2041
static GDBusInterfaceVTable *
 
2042
remote_login_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
 
2043
{
 
2044
  return (GDBusInterfaceVTable *) &_remote_login_skeleton_vtable;
 
2045
}
 
2046
 
 
2047
static GVariant *
 
2048
remote_login_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
 
2049
{
 
2050
  RemoteLoginSkeleton *skeleton = REMOTE_LOGIN_SKELETON (_skeleton);
 
2051
 
 
2052
  GVariantBuilder builder;
 
2053
  guint n;
 
2054
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
 
2055
  if (_remote_login_interface_info.parent_struct.properties == NULL)
 
2056
    goto out;
 
2057
  for (n = 0; _remote_login_interface_info.parent_struct.properties[n] != NULL; n++)
 
2058
    {
 
2059
      GDBusPropertyInfo *info = _remote_login_interface_info.parent_struct.properties[n];
 
2060
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
 
2061
        {
 
2062
          GVariant *value;
 
2063
          value = _remote_login_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.canonical.RemoteLogin", info->name, NULL, skeleton);
 
2064
          if (value != NULL)
 
2065
            {
 
2066
              g_variant_take_ref (value);
 
2067
              g_variant_builder_add (&builder, "{sv}", info->name, value);
 
2068
              g_variant_unref (value);
 
2069
            }
 
2070
        }
 
2071
    }
 
2072
out:
 
2073
  return g_variant_builder_end (&builder);
 
2074
}
 
2075
 
 
2076
static void
 
2077
remote_login_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
 
2078
{
 
2079
}
 
2080
 
 
2081
static void
 
2082
_remote_login_on_signal_servers_updated (
 
2083
    RemoteLogin *object,
 
2084
    GVariant *arg_serverList)
 
2085
{
 
2086
  RemoteLoginSkeleton *skeleton = REMOTE_LOGIN_SKELETON (object);
 
2087
 
 
2088
  GList      *connections, *l;
 
2089
  GVariant   *signal_variant;
 
2090
  connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
 
2091
 
 
2092
  signal_variant = g_variant_ref_sink (g_variant_new ("(@a(sssba(sbva{sv})a(si)))",
 
2093
                   arg_serverList));
 
2094
  for (l = connections; l != NULL; l = l->next)
 
2095
    {
 
2096
      GDBusConnection *connection = l->data;
 
2097
      g_dbus_connection_emit_signal (connection,
 
2098
        NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.canonical.RemoteLogin", "ServersUpdated",
 
2099
        signal_variant, NULL);
 
2100
    }
 
2101
  g_variant_unref (signal_variant);
 
2102
  g_list_free_full (connections, g_object_unref);
 
2103
}
 
2104
 
 
2105
static void
 
2106
_remote_login_on_signal_login_servers_updated (
 
2107
    RemoteLogin *object,
 
2108
    const gchar *arg_uri,
 
2109
    const gchar *arg_emailAddress,
 
2110
    const gchar *arg_dataType,
 
2111
    GVariant *arg_serverList)
 
2112
{
 
2113
  RemoteLoginSkeleton *skeleton = REMOTE_LOGIN_SKELETON (object);
 
2114
 
 
2115
  GList      *connections, *l;
 
2116
  GVariant   *signal_variant;
 
2117
  connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
 
2118
 
 
2119
  signal_variant = g_variant_ref_sink (g_variant_new ("(sss@a(sssba(sbva{sv})a(si)))",
 
2120
                   arg_uri,
 
2121
                   arg_emailAddress,
 
2122
                   arg_dataType,
 
2123
                   arg_serverList));
 
2124
  for (l = connections; l != NULL; l = l->next)
 
2125
    {
 
2126
      GDBusConnection *connection = l->data;
 
2127
      g_dbus_connection_emit_signal (connection,
 
2128
        NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.canonical.RemoteLogin", "LoginServersUpdated",
 
2129
        signal_variant, NULL);
 
2130
    }
 
2131
  g_variant_unref (signal_variant);
 
2132
  g_list_free_full (connections, g_object_unref);
 
2133
}
 
2134
 
 
2135
static void
 
2136
_remote_login_on_signal_login_changed (
 
2137
    RemoteLogin *object,
 
2138
    const gchar *arg_uri,
 
2139
    const gchar *arg_emailAddress)
 
2140
{
 
2141
  RemoteLoginSkeleton *skeleton = REMOTE_LOGIN_SKELETON (object);
 
2142
 
 
2143
  GList      *connections, *l;
 
2144
  GVariant   *signal_variant;
 
2145
  connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
 
2146
 
 
2147
  signal_variant = g_variant_ref_sink (g_variant_new ("(ss)",
 
2148
                   arg_uri,
 
2149
                   arg_emailAddress));
 
2150
  for (l = connections; l != NULL; l = l->next)
 
2151
    {
 
2152
      GDBusConnection *connection = l->data;
 
2153
      g_dbus_connection_emit_signal (connection,
 
2154
        NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.canonical.RemoteLogin", "LoginChanged",
 
2155
        signal_variant, NULL);
 
2156
    }
 
2157
  g_variant_unref (signal_variant);
 
2158
  g_list_free_full (connections, g_object_unref);
 
2159
}
 
2160
 
 
2161
static void remote_login_skeleton_iface_init (RemoteLoginIface *iface);
 
2162
G_DEFINE_TYPE_WITH_CODE (RemoteLoginSkeleton, remote_login_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
 
2163
                         G_IMPLEMENT_INTERFACE (TYPE_REMOTE_LOGIN, remote_login_skeleton_iface_init));
 
2164
 
 
2165
static void
 
2166
remote_login_skeleton_finalize (GObject *object)
 
2167
{
 
2168
  RemoteLoginSkeleton *skeleton = REMOTE_LOGIN_SKELETON (object);
 
2169
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
 
2170
  if (skeleton->priv->changed_properties_idle_source != NULL)
 
2171
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
 
2172
  g_main_context_unref (skeleton->priv->context);
 
2173
  g_mutex_clear (&skeleton->priv->lock);
 
2174
  G_OBJECT_CLASS (remote_login_skeleton_parent_class)->finalize (object);
 
2175
}
 
2176
 
 
2177
static void
 
2178
remote_login_skeleton_init (RemoteLoginSkeleton *skeleton)
 
2179
{
 
2180
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_REMOTE_LOGIN_SKELETON, RemoteLoginSkeletonPrivate);
 
2181
  g_mutex_init (&skeleton->priv->lock);
 
2182
  skeleton->priv->context = g_main_context_ref_thread_default ();
 
2183
}
 
2184
 
 
2185
static void
 
2186
remote_login_skeleton_class_init (RemoteLoginSkeletonClass *klass)
 
2187
{
 
2188
  GObjectClass *gobject_class;
 
2189
  GDBusInterfaceSkeletonClass *skeleton_class;
 
2190
 
 
2191
  g_type_class_add_private (klass, sizeof (RemoteLoginSkeletonPrivate));
 
2192
 
 
2193
  gobject_class = G_OBJECT_CLASS (klass);
 
2194
  gobject_class->finalize = remote_login_skeleton_finalize;
 
2195
 
 
2196
  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
 
2197
  skeleton_class->get_info = remote_login_skeleton_dbus_interface_get_info;
 
2198
  skeleton_class->get_properties = remote_login_skeleton_dbus_interface_get_properties;
 
2199
  skeleton_class->flush = remote_login_skeleton_dbus_interface_flush;
 
2200
  skeleton_class->get_vtable = remote_login_skeleton_dbus_interface_get_vtable;
 
2201
}
 
2202
 
 
2203
static void
 
2204
remote_login_skeleton_iface_init (RemoteLoginIface *iface)
 
2205
{
 
2206
  iface->servers_updated = _remote_login_on_signal_servers_updated;
 
2207
  iface->login_servers_updated = _remote_login_on_signal_login_servers_updated;
 
2208
  iface->login_changed = _remote_login_on_signal_login_changed;
 
2209
}
 
2210
 
 
2211
/**
 
2212
 * remote_login_skeleton_new:
 
2213
 *
 
2214
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-com-canonical-RemoteLogin.top_of_page">com.canonical.RemoteLogin</link>.
 
2215
 *
 
2216
 * Returns: (transfer full) (type RemoteLoginSkeleton): The skeleton object.
 
2217
 */
 
2218
RemoteLogin *
 
2219
remote_login_skeleton_new (void)
 
2220
{
 
2221
  return REMOTE_LOGIN (g_object_new (TYPE_REMOTE_LOGIN_SKELETON, NULL));
 
2222
}
 
2223