static GObject *
do_constructor (GType type,
- guint n_props,
- GObjectConstructParam *props)
+ guint n_props,
+ GObjectConstructParam *props)
{
GObject *retval;
static void
ft_handler_outgoing_ready_cb (EmpathyFTHandler *handler,
- GError *error,
- gpointer user_data)
+ GError *error,
+ gpointer user_data)
{
EmpathyFTFactory *factory = user_data;
static void
ft_handler_incoming_ready_cb (EmpathyFTHandler *handler,
- GError *error,
- gpointer user_data)
+ GError *error,
+ gpointer user_data)
{
EmpathyFTFactory *factory = user_data;
void
empathy_ft_factory_new_transfer_outgoing (EmpathyFTFactory *factory,
- EmpathyContact *contact,
- GFile *source,
- gboolean use_hash)
+ EmpathyContact *contact,
+ GFile *source,
+ gboolean use_hash)
{
g_return_if_fail (EMPATHY_IS_FT_FACTORY (factory));
g_return_if_fail (EMPATHY_IS_CONTACT (contact));
void
empathy_ft_factory_claim_channel (EmpathyFTFactory *factory,
- EmpathyDispatchOperation *operation)
+ EmpathyDispatchOperation *operation)
{
EmpathyTpFile *tp_file;
}
void
-empathy_ft_factory_set_destination_for_incoming_handler
- (EmpathyFTFactory *factory,
- EmpathyFTHandler *handler,
- GFile *destination,
- gboolean use_hash)
+empathy_ft_factory_set_destination_for_incoming_handler (
+ EmpathyFTFactory *factory,
+ EmpathyFTHandler *handler,
+ GFile *destination,
+ gboolean use_hash)
{
g_return_if_fail (EMPATHY_IS_FT_FACTORY (factory));
g_return_if_fail (EMPATHY_IS_FT_HANDLER (handler));
#define EMPATHY_TYPE_FT_FACTORY empathy_ft_factory_get_type()
#define EMPATHY_FT_FACTORY(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMPATHY_TYPE_FT_FACTORY, EmpathyFTFactory))
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ EMPATHY_TYPE_FT_FACTORY, EmpathyFTFactory))
#define EMPATHY_FT_FACTORY_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), EMPATHY_TYPE_FT_FACTORY, EmpathyFTFactoryClass))
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ EMPATHY_TYPE_FT_FACTORY, EmpathyFTFactoryClass))
#define EMPATHY_IS_FT_FACTORY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMPATHY_TYPE_FT_FACTORY))
#define EMPATHY_IS_FT_FACTORY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EMPATHY_TYPE_FT_FACTORY))
#define EMPATHY_FT_FACTORY_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_FT_FACTORY, EmpathyFTFactoryClass))
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ EMPATHY_TYPE_FT_FACTORY, EmpathyFTFactoryClass))
typedef struct {
GObject parent;
/* public methods */
EmpathyFTFactory* empathy_ft_factory_dup_singleton (void);
void empathy_ft_factory_new_transfer_outgoing (EmpathyFTFactory *factory,
- EmpathyContact *contact, GFile *source, gboolean use_hash);
+ EmpathyContact *contact,
+ GFile *source,
+ gboolean use_hash);
void empathy_ft_factory_claim_channel (EmpathyFTFactory *factory,
- EmpathyDispatchOperation *operation);
-void empathy_ft_factory_set_destination_for_incoming_handler
- (EmpathyFTFactory *factory, EmpathyFTHandler *handler,
- GFile *destination, gboolean use_hash);
+ EmpathyDispatchOperation *operation);
+void empathy_ft_factory_set_destination_for_incoming_handler (
+ EmpathyFTFactory *factory,
+ EmpathyFTHandler *handler,
+ GFile *destination,
+ gboolean use_hash);
G_END_DECLS
/* GObject implementations */
static void
do_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
EmpathyFTHandlerPriv *priv = GET_PRIV (object);
static void
do_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
EmpathyFTHandlerPriv *priv = GET_PRIV (object);
static void
emit_error_signal (EmpathyFTHandler *handler,
- const GError *error)
+ const GError *error)
{
EmpathyFTHandlerPriv *priv = GET_PRIV (handler);
static void
ft_transfer_operation_callback (EmpathyTpFile *tp_file,
- const GError *error,
- gpointer user_data)
+ const GError *error,
+ gpointer user_data)
{
EmpathyFTHandler *handler = user_data;
EmpathyFTHandlerPriv *priv = GET_PRIV (handler);
static void
update_remaining_time_and_speed (EmpathyFTHandler *handler,
- guint64 transferred_bytes)
+ guint64 transferred_bytes)
{
EmpathyFTHandlerPriv *priv = GET_PRIV (handler);
time_t elapsed_time, current_time;
static void
ft_transfer_progress_callback (EmpathyTpFile *tp_file,
- guint64 transferred_bytes,
- gpointer user_data)
+ guint64 transferred_bytes,
+ gpointer user_data)
{
EmpathyFTHandler *handler = user_data;
EmpathyFTHandlerPriv *priv = GET_PRIV (handler);
static void
ft_handler_create_channel_cb (EmpathyDispatchOperation *operation,
- const GError *error,
- gpointer user_data)
+ const GError *error,
+ gpointer user_data)
{
EmpathyFTHandler *handler = user_data;
EmpathyFTHandlerPriv *priv = GET_PRIV (handler);
error = g_error_new_literal (EMPATHY_FT_ERROR_QUARK,
EMPATHY_FT_ERROR_HASH_MISMATCH,
- _("The hash of the received file and the sent one do not match"));
+ _("The hash of the received file and the "
+ "sent one do not match"));
goto cleanup;
}
else
static gboolean
do_hash_job (GIOSchedulerJob *job,
- GCancellable *cancellable,
- gpointer user_data)
+ GCancellable *cancellable,
+ gpointer user_data)
{
HashingData *hash_data = user_data;
gssize bytes_read;
static gboolean
do_hash_job_incoming (GIOSchedulerJob *job,
- GCancellable *cancellable,
- gpointer user_data)
+ GCancellable *cancellable,
+ gpointer user_data)
{
HashingData *hash_data = user_data;
EmpathyFTHandler *handler = hash_data->handler;
static void
ft_handler_read_async_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data)
+ GAsyncResult *res,
+ gpointer user_data)
{
GFileInputStream *stream;
GError *error = NULL;
static void
ft_handler_gfile_ready_cb (GObject *source,
- GAsyncResult *res,
- CallbacksData *cb_data)
+ GAsyncResult *res,
+ CallbacksData *cb_data)
{
GFileInfo *info;
GError *error = NULL;
static void
contact_factory_contact_cb (EmpathyTpContactFactory *factory,
- EmpathyContact *contact,
- const GError *error,
- gpointer user_data,
- GObject *weak_object)
+ EmpathyContact *contact,
+ const GError *error,
+ gpointer user_data,
+ GObject *weak_object)
{
CallbacksData *cb_data = user_data;
EmpathyFTHandler *handler = EMPATHY_FT_HANDLER (weak_object);
static void
channel_get_all_properties_cb (TpProxy *proxy,
- GHashTable *properties,
- const GError *error,
- gpointer user_data,
- GObject *weak_object)
+ GHashTable *properties,
+ const GError *error,
+ gpointer user_data,
+ GObject *weak_object)
{
CallbacksData *cb_data = user_data;
EmpathyFTHandler *handler = EMPATHY_FT_HANDLER (weak_object);
void
empathy_ft_handler_new_outgoing (EmpathyContact *contact,
- GFile *source,
- gboolean use_hash,
- EmpathyFTHandlerReadyCallback callback,
- gpointer user_data)
+ GFile *source,
+ gboolean use_hash,
+ EmpathyFTHandlerReadyCallback callback,
+ gpointer user_data)
{
EmpathyFTHandler *handler;
CallbacksData *data;
void
empathy_ft_handler_new_incoming (EmpathyTpFile *tp_file,
- EmpathyFTHandlerReadyCallback callback,
- gpointer user_data)
+ EmpathyFTHandlerReadyCallback callback,
+ gpointer user_data)
{
EmpathyFTHandler *handler;
TpChannel *channel;
void
empathy_ft_handler_incoming_set_destination (EmpathyFTHandler *handler,
- GFile *destination,
- gboolean use_hash)
+ GFile *destination,
+ gboolean use_hash)
{
DEBUG ("Set incoming destination, use hash %s",
use_hash ? "True" : "False");
#define EMPATHY_TYPE_FT_HANDLER empathy_ft_handler_get_type()
#define EMPATHY_FT_HANDLER(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandler))
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandler))
#define EMPATHY_FT_HANDLER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandlerClass))
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandlerClass))
#define EMPATHY_IS_FT_HANDLER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMPATHY_TYPE_FT_HANDLER))
#define EMPATHY_IS_FT_HANDLER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EMPATHY_TYPE_FT_HANDLER))
#define EMPATHY_FT_HANDLER_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandlerClass))
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandlerClass))
typedef struct {
GObject parent;
} EmpathyFTHandlerClass;
typedef void (* EmpathyFTHandlerReadyCallback) (EmpathyFTHandler *handler,
- GError *error,
- gpointer user_data);
+ GError *error,
+ gpointer user_data);
GType empathy_ft_handler_get_type (void);
/* public methods */
void empathy_ft_handler_new_outgoing (EmpathyContact *contact,
- GFile *source, gboolean use_hash, EmpathyFTHandlerReadyCallback callback,
+ GFile *source,
+ gboolean use_hash,
+ EmpathyFTHandlerReadyCallback callback,
gpointer user_data);
void empathy_ft_handler_new_incoming (EmpathyTpFile *tp_file,
- EmpathyFTHandlerReadyCallback callback, gpointer user_data);
+ EmpathyFTHandlerReadyCallback callback,
+ gpointer user_data);
void empathy_ft_handler_incoming_set_destination (EmpathyFTHandler *handler,
- GFile *destination, gboolean use_hash);
+ GFile *destination,
+ gboolean use_hash);
void empathy_ft_handler_start_transfer (EmpathyFTHandler *handler);
void empathy_ft_handler_cancel_transfer (EmpathyFTHandler *handler);
static void
tp_file_get_state_cb (TpProxy *proxy,
- const GValue *value,
- const GError *error,
- gpointer user_data,
- GObject *weak_object)
+ const GValue *value,
+ const GError *error,
+ gpointer user_data,
+ GObject *weak_object)
{
EmpathyTpFilePriv *priv = GET_PRIV (weak_object);
static void
tp_file_invalidated_cb (TpProxy *proxy,
- guint domain,
- gint code,
- gchar *message,
- EmpathyTpFile *tp_file)
+ guint domain,
+ gint code,
+ gchar *message,
+ EmpathyTpFile *tp_file)
{
EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
static void
ft_operation_close_with_error (EmpathyTpFile *tp_file,
- GError *error)
+ GError *error)
{
EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
static void
splice_stream_ready_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data)
+ GAsyncResult *res,
+ gpointer user_data)
{
EmpathyTpFile *tp_file;
GError *error = NULL;
static void
tp_file_state_changed_cb (TpChannel *proxy,
- guint state,
- guint reason,
- gpointer user_data,
- GObject *weak_object)
+ guint state,
+ guint reason,
+ gpointer user_data,
+ GObject *weak_object)
{
EmpathyTpFilePriv *priv = GET_PRIV (weak_object);
GError *error;
static void
tp_file_transferred_bytes_changed_cb (TpChannel *proxy,
- guint64 count,
- gpointer user_data,
- GObject *weak_object)
+ guint64 count,
+ gpointer user_data,
+ GObject *weak_object)
{
EmpathyTpFilePriv *priv = GET_PRIV (weak_object);
static void
ft_operation_provide_or_accept_file_cb (TpChannel *proxy,
- const GValue *address,
- const GError *error,
- gpointer user_data,
- GObject *weak_object)
+ const GValue *address,
+ const GError *error,
+ gpointer user_data,
+ GObject *weak_object)
{
EmpathyTpFile *tp_file = EMPATHY_TP_FILE (weak_object);
GError *myerr = NULL;
static void
file_read_async_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data)
+ GAsyncResult *res,
+ gpointer user_data)
{
GValue nothing = { 0 };
EmpathyTpFile *tp_file = user_data;
tp_cli_channel_type_file_transfer_call_provide_file (
priv->channel, -1,
TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST,
- ¬hing, ft_operation_provide_or_accept_file_cb, NULL, NULL, G_OBJECT (tp_file));
+ ¬hing, ft_operation_provide_or_accept_file_cb,
+ NULL, NULL, G_OBJECT (tp_file));
}
static void
file_replace_async_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data)
+ GAsyncResult *res,
+ gpointer user_data)
{
GValue nothing = { 0 };
EmpathyTpFile *tp_file = user_data;
static void
channel_closed_cb (TpChannel *proxy,
- const GError *error,
- gpointer user_data,
- GObject *weak_object)
+ const GError *error,
+ gpointer user_data,
+ GObject *weak_object)
{
EmpathyTpFile *tp_file = EMPATHY_TP_FILE (weak_object);
EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
static void
close_channel_internal (EmpathyTpFile *tp_file,
- gboolean cancel)
+ gboolean cancel)
{
EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
static void
do_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec)
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec)
{
EmpathyTpFilePriv *priv = GET_PRIV (object);
static void
do_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint param_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
EmpathyTpFilePriv *priv = GET_PRIV (object);
switch (param_id)
static GObject *
do_constructor (GType type,
- guint n_props,
- GObjectConstructParam *props)
+ guint n_props,
+ GObjectConstructParam *props)
{
GObject *file_obj;
EmpathyTpFile *tp_file;
* Return value: a new #EmpathyTpFile
*/
EmpathyTpFile *
-empathy_tp_file_new (TpChannel *channel, gboolean incoming)
+empathy_tp_file_new (TpChannel *channel,
+ gboolean incoming)
{
EmpathyTpFile *tp_file;
void
empathy_tp_file_accept (EmpathyTpFile *tp_file,
- guint64 offset,
- GFile *gfile,
- GCancellable *cancellable,
- EmpathyTpFileProgressCallback progress_callback,
- gpointer progress_user_data,
- EmpathyTpFileOperationCallback op_callback,
- gpointer op_user_data)
+ guint64 offset,
+ GFile *gfile,
+ GCancellable *cancellable,
+ EmpathyTpFileProgressCallback progress_callback,
+ gpointer progress_user_data,
+ EmpathyTpFileOperationCallback op_callback,
+ gpointer op_user_data)
{
EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
void
empathy_tp_file_offer (EmpathyTpFile *tp_file,
- GFile *gfile,
- GCancellable *cancellable,
- EmpathyTpFileProgressCallback progress_callback,
- gpointer progress_user_data,
- EmpathyTpFileOperationCallback op_callback,
- gpointer op_user_data)
+ GFile *gfile,
+ GCancellable *cancellable,
+ EmpathyTpFileProgressCallback progress_callback,
+ gpointer progress_user_data,
+ EmpathyTpFileOperationCallback op_callback,
+ gpointer op_user_data)
{
EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2007-2009 Collabora Ltd.
* Copyright (C) 2007 Marco Barisione <marco@barisione.org>
#define EMPATHY_TP_FILE_UNKNOWN_SIZE G_MAXUINT64
-#define EMPATHY_TYPE_TP_FILE (empathy_tp_file_get_type ())
-#define EMPATHY_TP_FILE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_TP_FILE, EmpathyTpFile))
-#define EMPATHY_TP_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_TP_FILE, EmpathyTpFileClass))
-#define EMPATHY_IS_TP_FILE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_TP_FILE))
-#define EMPATHY_IS_TP_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_TP_FILE))
-#define EMPATHY_TP_FILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_TP_FILE, EmpathyTpFileClass))
+#define EMPATHY_TYPE_TP_FILE (empathy_tp_file_get_type ())
+#define EMPATHY_TP_FILE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
+ EMPATHY_TYPE_TP_FILE, EmpathyTpFile))
+#define EMPATHY_TP_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), \
+ EMPATHY_TYPE_TP_FILE, EmpathyTpFileClass))
+#define EMPATHY_IS_TP_FILE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
+ EMPATHY_TYPE_TP_FILE))
+#define EMPATHY_IS_TP_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), \
+ EMPATHY_TYPE_TP_FILE))
+#define EMPATHY_TP_FILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
+ EMPATHY_TYPE_TP_FILE, EmpathyTpFileClass))
typedef struct _EmpathyTpFile EmpathyTpFile;
typedef struct _EmpathyTpFileClass EmpathyTpFileClass;
/* public methods */
-EmpathyTpFile * empathy_tp_file_new (TpChannel *channel, gboolean incoming);
+EmpathyTpFile * empathy_tp_file_new (TpChannel *channel,
+ gboolean incoming);
void empathy_tp_file_accept (EmpathyTpFile *tp_file,
- guint64 offset,
- GFile *gfile,
- GCancellable *cancellable,
- EmpathyTpFileProgressCallback progress_callback,
- gpointer progress_user_data,
- EmpathyTpFileOperationCallback op_callback,
- gpointer op_user_data);
+ guint64 offset,
+ GFile *gfile,
+ GCancellable *cancellable,
+ EmpathyTpFileProgressCallback progress_callback,
+ gpointer progress_user_data,
+ EmpathyTpFileOperationCallback op_callback,
+ gpointer op_user_data);
void empathy_tp_file_offer (EmpathyTpFile *tp_file,
- GFile *gfile,
- GCancellable *cancellable,
- EmpathyTpFileProgressCallback progress_callback,
- gpointer progress_user_data,
- EmpathyTpFileOperationCallback op_callback,
- gpointer op_user_data);
+ GFile *gfile,
+ GCancellable *cancellable,
+ EmpathyTpFileProgressCallback progress_callback,
+ gpointer progress_user_data,
+ EmpathyTpFileOperationCallback op_callback,
+ gpointer op_user_data);
void empathy_tp_file_cancel (EmpathyTpFile *tp_file);
void empathy_tp_file_close (EmpathyTpFile *tp_file);