static void
rakia_media_manager_type_foreach_channel_class (GType type,
    TpChannelManagerTypeChannelClassFunc func,
    gpointer user_data)
{
  GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal,
      NULL, (GDestroyNotify) tp_g_value_slice_free);
  GValue *value, *handle_type_value;

  value = tp_g_value_slice_new (G_TYPE_STRING);
  g_value_set_static_string (value, TP_IFACE_CHANNEL_TYPE_CALL);
  g_hash_table_insert (table, TP_PROP_CHANNEL_CHANNEL_TYPE, value);

  handle_type_value = tp_g_value_slice_new (G_TYPE_UINT);
  /* no uint value yet - we'll change it for each channel class */
  g_hash_table_insert (table, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE,
      handle_type_value);

  g_value_set_uint (handle_type_value, TP_HANDLE_TYPE_CONTACT);

  g_hash_table_insert (table, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO,
      tp_g_value_slice_new_boolean (TRUE));

  func (type, table, named_channel_allowed_properties, user_data);

  g_hash_table_remove (table, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO);

  g_hash_table_insert (table, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO,
      tp_g_value_slice_new_boolean (TRUE));

  func (type, table, named_channel_allowed_properties, user_data);

  g_hash_table_unref (table);
}
コード例 #2
0
static void
debug_dialog_set_enabled (EmpathyDebugDialog *debug_dialog,
    gboolean enabled)
{
  EmpathyDebugDialogPriv *priv = GET_PRIV (debug_dialog);
  GValue *val;

  val = tp_g_value_slice_new_boolean (enabled);

  tp_cli_dbus_properties_call_set (priv->proxy, -1, EMP_IFACE_DEBUG,
      "Enabled", val, NULL, NULL, NULL, NULL);

  tp_g_value_slice_free (val);
}
コード例 #3
0
ファイル: empathy-plist.c プロジェクト: Dhinihan/empathy
static GValue *
empathy_plist_parse_boolean (xmlNode *a_node)
{
	gboolean bool_val;

	if (strcmp ((char *) a_node->name, "true") == 0) {
		bool_val = TRUE;
	} else if (strcmp ((char *) a_node->name, "false") == 0) {
		bool_val = FALSE;
	} else {
		return NULL;
	}

	return tp_g_value_slice_new_boolean (bool_val);
}