~jbicha/ubuntu/oneiric/gnome-shell/oneiric-3.2.2.1

« back to all changes in this revision

Viewing changes to src/shell-tp-client.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2011-09-07 09:09:05 UTC
  • mfrom: (1.1.29 upstream)
  • Revision ID: package-import@ubuntu.com-20110907090905-kbo4fewcg12zt99u
Tags: 3.1.90.1-0ubuntu1
* New upstream release.
* debian/control: Bump build-depends on new mutter
* debian/patches/01_favorite_apps.patch: Updated
* debian/patches/03_remove-glx-dependency-on-armel.patch: Refreshed
* debian/patches/04_build-without-caribou.patch
  - Build without caribou since Ubuntu uses onboard and our System 
    Settings doesn't support choosing a different screen keyboard yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
  ShellTpClientHandleChannelsImpl handle_channels_impl;
20
20
  gpointer user_data_handle_channels;
21
21
  GDestroyNotify destroy_handle_channels;
 
22
 
 
23
  ShellTpClientContactListChangedImpl contact_list_changed_impl;
 
24
  gpointer user_data_contact_list_changed;
 
25
  GDestroyNotify destroy_contact_list_changed;
22
26
};
23
27
 
24
28
/**
77
81
 * Signature of the implementation of the HandleChannels method.
78
82
 */
79
83
 
 
84
/**
 
85
 * ShellTpClientContactListChangedImpl:
 
86
 * @connection: a #TpConnection having %TP_CONNECTION_FEATURE_CORE prepared
 
87
 * if possible
 
88
 * @added: (element-type TelepathyGLib.Contact): a #GPtrArray of added #TpContact
 
89
 * @removed: (element-type TelepathyGLib.Contact): a #GPtrArray of removed #TpContact
 
90
 *
 
91
 * Signature of the implementation of the ContactListChanged method.
 
92
 */
 
93
 
80
94
static void
81
95
shell_tp_client_init (ShellTpClient *self)
82
96
{
127
141
        TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
128
142
        NULL));
129
143
 
 
144
  /* Approve file transfers. We let Empathy handle the transfer itself. */
 
145
  tp_base_client_take_approver_filter (TP_BASE_CLIENT (self),
 
146
      tp_asv_new (
 
147
        TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
 
148
          TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER,
 
149
        TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
 
150
        NULL));
 
151
 
130
152
  /* Handler */
131
153
  tp_base_client_add_handler_filter (TP_BASE_CLIENT (self), filter);
132
154
 
212
234
      self->priv->user_data_handle_channels = NULL;
213
235
    }
214
236
 
 
237
  if (self->priv->destroy_contact_list_changed != NULL)
 
238
    {
 
239
      self->priv->destroy_contact_list_changed (self->priv->user_data_contact_list_changed);
 
240
      self->priv->destroy_contact_list_changed = NULL;
 
241
      self->priv->user_data_contact_list_changed = NULL;
 
242
    }
 
243
 
215
244
  if (dispose != NULL)
216
245
    dispose (object);
217
246
}
270
299
  self->priv->destroy_handle_channels = destroy;
271
300
}
272
301
 
 
302
void
 
303
shell_tp_client_set_contact_list_changed_func (ShellTpClient *self,
 
304
    ShellTpClientContactListChangedImpl contact_list_changed_impl,
 
305
    gpointer user_data,
 
306
    GDestroyNotify destroy)
 
307
{
 
308
  g_assert (self->priv->contact_list_changed_impl == NULL);
 
309
 
 
310
  self->priv->contact_list_changed_impl = contact_list_changed_impl;
 
311
  self->priv->user_data_handle_channels = user_data;
 
312
  self->priv->destroy_handle_channels = destroy;
 
313
}
 
314
 
 
315
static void
 
316
on_contact_list_changed (TpConnection *conn,
 
317
                         GPtrArray *added,
 
318
                         GPtrArray *removed,
 
319
                         gpointer user_data)
 
320
{
 
321
  ShellTpClient *self = (ShellTpClient *) user_data;
 
322
 
 
323
  g_assert (self->priv->contact_list_changed_impl != NULL);
 
324
 
 
325
  self->priv->contact_list_changed_impl (conn,
 
326
      added, removed,
 
327
      self->priv->user_data_contact_list_changed);
 
328
}
 
329
 
 
330
void
 
331
shell_tp_client_grab_contact_list_changed (ShellTpClient *self,
 
332
                                           TpConnection *conn)
 
333
{
 
334
  g_signal_connect (conn, "contact-list-changed",
 
335
                    G_CALLBACK (on_contact_list_changed),
 
336
                    self);
 
337
}
 
338
 
273
339
/* Telepathy utility functions */
274
340
 
275
341
/**