/* app-load-operation.c generated by valac 0.56.19, the Vala compiler
 * generated from app-load-operation.vala, do not modify */

/*
 * Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

#include "geary-engine.h"
#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define GEARY_APP_TYPE_CONVERSATION_OPERATION (geary_app_conversation_operation_get_type ())
#define GEARY_APP_CONVERSATION_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_APP_TYPE_CONVERSATION_OPERATION, GearyAppConversationOperation))
#define GEARY_APP_CONVERSATION_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_APP_TYPE_CONVERSATION_OPERATION, GearyAppConversationOperationClass))
#define GEARY_APP_IS_CONVERSATION_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_APP_TYPE_CONVERSATION_OPERATION))
#define GEARY_APP_IS_CONVERSATION_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_APP_TYPE_CONVERSATION_OPERATION))
#define GEARY_APP_CONVERSATION_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_APP_TYPE_CONVERSATION_OPERATION, GearyAppConversationOperationClass))

typedef struct _GearyAppConversationOperation GearyAppConversationOperation;
typedef struct _GearyAppConversationOperationClass GearyAppConversationOperationClass;
typedef struct _GearyAppConversationOperationPrivate GearyAppConversationOperationPrivate;

#define GEARY_APP_TYPE_LOAD_OPERATION (geary_app_load_operation_get_type ())
#define GEARY_APP_LOAD_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_APP_TYPE_LOAD_OPERATION, GearyAppLoadOperation))
#define GEARY_APP_LOAD_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_APP_TYPE_LOAD_OPERATION, GearyAppLoadOperationClass))
#define GEARY_APP_IS_LOAD_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_APP_TYPE_LOAD_OPERATION))
#define GEARY_APP_IS_LOAD_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_APP_TYPE_LOAD_OPERATION))
#define GEARY_APP_LOAD_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_APP_TYPE_LOAD_OPERATION, GearyAppLoadOperationClass))

typedef struct _GearyAppLoadOperation GearyAppLoadOperation;
typedef struct _GearyAppLoadOperationClass GearyAppLoadOperationClass;
typedef struct _GearyAppLoadOperationPrivate GearyAppLoadOperationPrivate;
enum  {
	GEARY_APP_LOAD_OPERATION_0_PROPERTY,
	GEARY_APP_LOAD_OPERATION_NUM_PROPERTIES
};
static GParamSpec* geary_app_load_operation_properties[GEARY_APP_LOAD_OPERATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _GearyAppLoadOperationExecuteAsyncData GearyAppLoadOperationExecuteAsyncData;
typedef struct _GearyAppLoadOperationWaitUntilCompleteData GearyAppLoadOperationWaitUntilCompleteData;

struct _GearyAppConversationOperation {
	GearyBaseObject parent_instance;
	GearyAppConversationMonitor* monitor;
	GearyAppConversationOperationPrivate * priv;
};

struct _GearyAppConversationOperationClass {
	GearyBaseObjectClass parent_class;
	void (*execute_async) (GearyAppConversationOperation* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*execute_finish) (GearyAppConversationOperation* self, GAsyncResult* _res_, GError** error);
};

struct _GearyAppLoadOperation {
	GearyAppConversationOperation parent_instance;
	GearyAppLoadOperationPrivate * priv;
};

struct _GearyAppLoadOperationClass {
	GearyAppConversationOperationClass parent_class;
};

struct _GearyAppLoadOperationPrivate {
	GearyEmailIdentifier* to_load;
	GearyNonblockingSpinlock* completed;
};

struct _GearyAppLoadOperationExecuteAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyAppLoadOperation* self;
	GearyEmailIdentifier* lowest_known;
	GearyAppConversationMonitor* _tmp0_;
	GearyEmailIdentifier* _tmp1_;
	GearyEmailIdentifier* _tmp2_;
	gboolean _tmp3_;
	GearyEmailIdentifier* _tmp4_;
	GearyEmailIdentifier* _tmp5_;
	GearyEmailIdentifier* _tmp6_;
	GearyAppConversationMonitor* _tmp7_;
	GearyFolder* _tmp8_;
	GearyFolder* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GearyAppConversationMonitor* _tmp12_;
	GearyEmailIdentifier* _tmp13_;
	GearyAppConversationMonitor* _tmp14_;
	GearyFolder* _tmp15_;
	GearyFolder* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	GearyNonblockingSpinlock* _tmp19_;
	GError* _inner_error0_;
};

struct _GearyAppLoadOperationWaitUntilCompleteData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyAppLoadOperation* self;
	GCancellable* cancellable;
	GearyNonblockingSpinlock* _tmp0_;
	GError* _inner_error0_;
};

static gint GearyAppLoadOperation_private_offset;
static gpointer geary_app_load_operation_parent_class = NULL;

VALA_EXTERN GType geary_app_conversation_operation_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_app_load_operation_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void geary_app_conversation_operation_execute_async (GearyAppConversationOperation* self,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN void geary_app_conversation_operation_execute_finish (GearyAppConversationOperation* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
VALA_EXTERN GearyAppLoadOperation* geary_app_load_operation_new (GearyAppConversationMonitor* monitor,
                                                     GearyEmailIdentifier* to_load,
                                                     GCancellable* cancellable);
VALA_EXTERN GearyAppLoadOperation* geary_app_load_operation_construct (GType object_type,
                                                           GearyAppConversationMonitor* monitor,
                                                           GearyEmailIdentifier* to_load,
                                                           GCancellable* cancellable);
VALA_EXTERN GearyAppConversationOperation* geary_app_conversation_operation_construct (GType object_type,
                                                                           GearyAppConversationMonitor* monitor,
                                                                           gboolean allow_duplicates);
static void geary_app_load_operation_real_execute_async_data_free (gpointer _data);
static void geary_app_load_operation_real_execute_async (GearyAppConversationOperation* base,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static gboolean geary_app_load_operation_real_execute_async_co (GearyAppLoadOperationExecuteAsyncData* _data_);
VALA_EXTERN GearyEmailIdentifier* geary_app_conversation_monitor_get_window_lowest (GearyAppConversationMonitor* self);
VALA_EXTERN void geary_app_conversation_monitor_load_by_id_async (GearyAppConversationMonitor* self,
                                                      GearyEmailIdentifier* initial_id,
                                                      gint count,
                                                      GearyFolderListFlags flags,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
VALA_EXTERN gint geary_app_conversation_monitor_load_by_id_finish (GearyAppConversationMonitor* self,
                                                       GAsyncResult* _res_,
                                                       GError** error);
static void geary_app_load_operation_execute_async_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void geary_app_load_operation_wait_until_complete_data_free (gpointer _data);
VALA_EXTERN void geary_app_load_operation_wait_until_complete (GearyAppLoadOperation* self,
                                                   GCancellable* cancellable,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
VALA_EXTERN void geary_app_load_operation_wait_until_complete_finish (GearyAppLoadOperation* self,
                                                          GAsyncResult* _res_,
                                                          GError** error);
static gboolean geary_app_load_operation_wait_until_complete_co (GearyAppLoadOperationWaitUntilCompleteData* _data_);
static void geary_app_load_operation_wait_until_complete_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void geary_app_load_operation_finalize (GObject * obj);
static GType geary_app_load_operation_get_type_once (void);

static inline gpointer
geary_app_load_operation_get_instance_private (GearyAppLoadOperation* self)
{
	return G_STRUCT_MEMBER_P (self, GearyAppLoadOperation_private_offset);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

GearyAppLoadOperation*
geary_app_load_operation_construct (GType object_type,
                                    GearyAppConversationMonitor* monitor,
                                    GearyEmailIdentifier* to_load,
                                    GCancellable* cancellable)
{
	GearyAppLoadOperation * self = NULL;
	GearyEmailIdentifier* _tmp0_;
	GearyNonblockingSpinlock* _tmp1_;
	g_return_val_if_fail (GEARY_APP_IS_CONVERSATION_MONITOR (monitor), NULL);
	g_return_val_if_fail (GEARY_IS_EMAIL_IDENTIFIER (to_load), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()), NULL);
	self = (GearyAppLoadOperation*) geary_app_conversation_operation_construct (object_type, monitor, TRUE);
	_tmp0_ = _g_object_ref0 (to_load);
	_g_object_unref0 (self->priv->to_load);
	self->priv->to_load = _tmp0_;
	_tmp1_ = geary_nonblocking_spinlock_new (cancellable);
	_g_object_unref0 (self->priv->completed);
	self->priv->completed = _tmp1_;
	return self;
}

GearyAppLoadOperation*
geary_app_load_operation_new (GearyAppConversationMonitor* monitor,
                              GearyEmailIdentifier* to_load,
                              GCancellable* cancellable)
{
	return geary_app_load_operation_construct (GEARY_APP_TYPE_LOAD_OPERATION, monitor, to_load, cancellable);
}

static void
geary_app_load_operation_real_execute_async_data_free (gpointer _data)
{
	GearyAppLoadOperationExecuteAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GearyAppLoadOperationExecuteAsyncData, _data_);
}

static void
geary_app_load_operation_real_execute_async (GearyAppConversationOperation* base,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	GearyAppLoadOperation * self;
	GearyAppLoadOperationExecuteAsyncData* _data_;
	GearyAppLoadOperation* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_APP_TYPE_LOAD_OPERATION, GearyAppLoadOperation);
	_data_ = g_slice_new0 (GearyAppLoadOperationExecuteAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_app_load_operation_real_execute_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	geary_app_load_operation_real_execute_async_co (_data_);
}

static void
geary_app_load_operation_execute_finish (GearyAppConversationOperation* base,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	GearyAppLoadOperationExecuteAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
geary_app_load_operation_execute_async_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	GearyAppLoadOperationExecuteAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_app_load_operation_real_execute_async_co (_data_);
}

static gboolean
geary_app_load_operation_real_execute_async_co (GearyAppLoadOperationExecuteAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_APP_TYPE_CONVERSATION_OPERATION, GearyAppConversationOperation)->monitor;
	_data_->_tmp1_ = geary_app_conversation_monitor_get_window_lowest (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->lowest_known = _data_->_tmp2_;
	_data_->_tmp4_ = _data_->lowest_known;
	if (_data_->_tmp4_ == NULL) {
		_data_->_tmp3_ = TRUE;
	} else {
		_data_->_tmp5_ = _data_->self->priv->to_load;
		_data_->_tmp6_ = _data_->lowest_known;
		_data_->_tmp3_ = geary_email_identifier_natural_sort_comparator (_data_->_tmp5_, _data_->_tmp6_) < 0;
	}
	if (_data_->_tmp3_) {
		_data_->_tmp7_ = G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_APP_TYPE_CONVERSATION_OPERATION, GearyAppConversationOperation)->monitor;
		_data_->_tmp8_ = geary_app_conversation_monitor_get_base_folder (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp9_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
		_data_->_tmp11_ = _data_->_tmp10_;
		g_debug ("app-load-operation.vala:33: Loading messages into %s", _data_->_tmp11_);
		_g_free0 (_data_->_tmp11_);
		_data_->_tmp12_ = G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_APP_TYPE_CONVERSATION_OPERATION, GearyAppConversationOperation)->monitor;
		_data_->_tmp13_ = _data_->self->priv->to_load;
		_data_->_state_ = 1;
		geary_app_conversation_monitor_load_by_id_async (_data_->_tmp12_, _data_->_tmp13_, G_MAXINT, GEARY_FOLDER_LIST_FLAGS_OLDEST_TO_NEWEST, geary_app_load_operation_execute_async_ready, _data_);
		return FALSE;
		_state_1:
		geary_app_conversation_monitor_load_by_id_finish (_data_->_tmp12_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->lowest_known);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	} else {
		_data_->_tmp14_ = G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_APP_TYPE_CONVERSATION_OPERATION, GearyAppConversationOperation)->monitor;
		_data_->_tmp15_ = geary_app_conversation_monitor_get_base_folder (_data_->_tmp14_);
		_data_->_tmp16_ = _data_->_tmp15_;
		_data_->_tmp17_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp16_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
		_data_->_tmp18_ = _data_->_tmp17_;
		g_debug ("app-load-operation.vala:39: Not loading messages in %s", _data_->_tmp18_);
		_g_free0 (_data_->_tmp18_);
	}
	_data_->_tmp19_ = _data_->self->priv->completed;
	geary_nonblocking_lock_notify (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp19_, GEARY_NONBLOCKING_TYPE_LOCK, GearyNonblockingLock), &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->lowest_known);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->lowest_known);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
geary_app_load_operation_wait_until_complete_data_free (gpointer _data)
{
	GearyAppLoadOperationWaitUntilCompleteData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (GearyAppLoadOperationWaitUntilCompleteData, _data_);
}

void
geary_app_load_operation_wait_until_complete (GearyAppLoadOperation* self,
                                              GCancellable* cancellable,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	GearyAppLoadOperationWaitUntilCompleteData* _data_;
	GearyAppLoadOperation* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (GEARY_APP_IS_LOAD_OPERATION (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (GearyAppLoadOperationWaitUntilCompleteData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_app_load_operation_wait_until_complete_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	geary_app_load_operation_wait_until_complete_co (_data_);
}

void
geary_app_load_operation_wait_until_complete_finish (GearyAppLoadOperation* self,
                                                     GAsyncResult* _res_,
                                                     GError** error)
{
	GearyAppLoadOperationWaitUntilCompleteData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
geary_app_load_operation_wait_until_complete_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	GearyAppLoadOperationWaitUntilCompleteData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_app_load_operation_wait_until_complete_co (_data_);
}

static gboolean
geary_app_load_operation_wait_until_complete_co (GearyAppLoadOperationWaitUntilCompleteData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->completed;
	_data_->_state_ = 1;
	geary_nonblocking_lock_wait_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp0_, GEARY_NONBLOCKING_TYPE_LOCK, GearyNonblockingLock), _data_->cancellable, geary_app_load_operation_wait_until_complete_ready, _data_);
	return FALSE;
	_state_1:
	geary_nonblocking_lock_wait_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp0_, GEARY_NONBLOCKING_TYPE_LOCK, GearyNonblockingLock), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
geary_app_load_operation_class_init (GearyAppLoadOperationClass * klass,
                                     gpointer klass_data)
{
	geary_app_load_operation_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GearyAppLoadOperation_private_offset);
	((GearyAppConversationOperationClass *) klass)->execute_async = (void (*) (GearyAppConversationOperation*, GAsyncReadyCallback, gpointer)) geary_app_load_operation_real_execute_async;
	((GearyAppConversationOperationClass *) klass)->execute_finish = (void (*) (GearyAppConversationOperation*, GAsyncResult*, GError**)) geary_app_load_operation_execute_finish;
	G_OBJECT_CLASS (klass)->finalize = geary_app_load_operation_finalize;
}

static void
geary_app_load_operation_instance_init (GearyAppLoadOperation * self,
                                        gpointer klass)
{
	GearyNonblockingSpinlock* _tmp0_;
	self->priv = geary_app_load_operation_get_instance_private (self);
	_tmp0_ = geary_nonblocking_spinlock_new (NULL);
	self->priv->completed = _tmp0_;
}

static void
geary_app_load_operation_finalize (GObject * obj)
{
	GearyAppLoadOperation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEARY_APP_TYPE_LOAD_OPERATION, GearyAppLoadOperation);
	_g_object_unref0 (self->priv->to_load);
	_g_object_unref0 (self->priv->completed);
	G_OBJECT_CLASS (geary_app_load_operation_parent_class)->finalize (obj);
}

/**
 * Loads a specific email all the way to the end of the vector.
 */
 G_GNUC_NO_INLINE static GType
geary_app_load_operation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyAppLoadOperationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_app_load_operation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GearyAppLoadOperation), 0, (GInstanceInitFunc) geary_app_load_operation_instance_init, NULL };
	GType geary_app_load_operation_type_id;
	geary_app_load_operation_type_id = g_type_register_static (GEARY_APP_TYPE_CONVERSATION_OPERATION, "GearyAppLoadOperation", &g_define_type_info, 0);
	GearyAppLoadOperation_private_offset = g_type_add_instance_private (geary_app_load_operation_type_id, sizeof (GearyAppLoadOperationPrivate));
	return geary_app_load_operation_type_id;
}

GType
geary_app_load_operation_get_type (void)
{
	static gsize geary_app_load_operation_type_id__once = 0;
	if (g_once_init_enter (&geary_app_load_operation_type_id__once)) {
		GType geary_app_load_operation_type_id;
		geary_app_load_operation_type_id = geary_app_load_operation_get_type_once ();
		g_once_init_leave (&geary_app_load_operation_type_id__once, geary_app_load_operation_type_id);
	}
	return geary_app_load_operation_type_id__once;
}

