/* FlickrPublishing.c generated by valac 0.56.19, the Vala compiler
 * generated from FlickrPublishing.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 "shotwell-publishing.h"
#include <glib-object.h>
#include <glib.h>
#include "shotwell-plugin-dev-1.0.h"
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gobject/gvaluecollector.h>
#include "shotwell-plugin-common.h"
#include "shotwell-authenticator.h"
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <libxml/tree.h>
#include <gtk/gtk.h>
#include <gee.h>
#include <gexiv2/gexiv2.h>

#define PUBLISHING_FLICKR_SERVICE_NAME "Flickr"
#define PUBLISHING_FLICKR_ENDPOINT_URL "https://api.flickr.com/services/rest"
#define PUBLISHING_FLICKR_ORIGINAL_SIZE -1
#define PUBLISHING_FLICKR_EXPIRED_SESSION_ERROR_CODE "98"
#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

enum  {
	FLICKR_SERVICE_0_PROPERTY,
	FLICKR_SERVICE_NUM_PROPERTIES
};
static GParamSpec* flickr_service_properties[FLICKR_SERVICE_NUM_PROPERTIES];
typedef enum  {
	PUBLISHING_FLICKR_USER_KIND_PRO,
	PUBLISHING_FLICKR_USER_KIND_FREE
} PublishingFlickrUserKind;

#define PUBLISHING_FLICKR_TYPE_USER_KIND (publishing_flickr_user_kind_get_type ())

#define PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION (publishing_flickr_visibility_specification_get_type ())
#define PUBLISHING_FLICKR_VISIBILITY_SPECIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION, PublishingFlickrVisibilitySpecification))
#define PUBLISHING_FLICKR_VISIBILITY_SPECIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION, PublishingFlickrVisibilitySpecificationClass))
#define PUBLISHING_FLICKR_IS_VISIBILITY_SPECIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION))
#define PUBLISHING_FLICKR_IS_VISIBILITY_SPECIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION))
#define PUBLISHING_FLICKR_VISIBILITY_SPECIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION, PublishingFlickrVisibilitySpecificationClass))

typedef struct _PublishingFlickrVisibilitySpecification PublishingFlickrVisibilitySpecification;
typedef struct _PublishingFlickrVisibilitySpecificationClass PublishingFlickrVisibilitySpecificationClass;
typedef struct _PublishingFlickrVisibilitySpecificationPrivate PublishingFlickrVisibilitySpecificationPrivate;
typedef struct _PublishingFlickrParamSpecVisibilitySpecification PublishingFlickrParamSpecVisibilitySpecification;

#define PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS (publishing_flickr_publishing_parameters_get_type ())
#define PUBLISHING_FLICKR_PUBLISHING_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS, PublishingFlickrPublishingParameters))
#define PUBLISHING_FLICKR_PUBLISHING_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS, PublishingFlickrPublishingParametersClass))
#define PUBLISHING_FLICKR_IS_PUBLISHING_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS))
#define PUBLISHING_FLICKR_IS_PUBLISHING_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS))
#define PUBLISHING_FLICKR_PUBLISHING_PARAMETERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS, PublishingFlickrPublishingParametersClass))

typedef struct _PublishingFlickrPublishingParameters PublishingFlickrPublishingParameters;
typedef struct _PublishingFlickrPublishingParametersClass PublishingFlickrPublishingParametersClass;
typedef struct _PublishingFlickrPublishingParametersPrivate PublishingFlickrPublishingParametersPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _publishing_flickr_visibility_specification_unref0(var) ((var == NULL) ? NULL : (var = (publishing_flickr_visibility_specification_unref (var), NULL)))
typedef struct _PublishingFlickrParamSpecPublishingParameters PublishingFlickrParamSpecPublishingParameters;

#define PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE (publishing_flickr_publishing_options_pane_get_type ())
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, PublishingFlickrPublishingOptionsPane))
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, PublishingFlickrPublishingOptionsPaneClass))
#define PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE))
#define PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE))
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, PublishingFlickrPublishingOptionsPaneClass))

typedef struct _PublishingFlickrPublishingOptionsPane PublishingFlickrPublishingOptionsPane;
typedef struct _PublishingFlickrPublishingOptionsPaneClass PublishingFlickrPublishingOptionsPaneClass;
enum  {
	PUBLISHING_FLICKR_FLICKR_PUBLISHER_0_PROPERTY,
	PUBLISHING_FLICKR_FLICKR_PUBLISHER_NUM_PROPERTIES
};
static GParamSpec* publishing_flickr_flickr_publisher_properties[PUBLISHING_FLICKR_FLICKR_PUBLISHER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _publishing_rest_support_session_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_session_unref (var), NULL)))
#define _publishing_flickr_publishing_parameters_unref0(var) ((var == NULL) ? NULL : (var = (publishing_flickr_publishing_parameters_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

#define PUBLISHING_FLICKR_TYPE_ACCOUNT_INFO_FETCH_TRANSACTION (publishing_flickr_account_info_fetch_transaction_get_type ())
#define PUBLISHING_FLICKR_ACCOUNT_INFO_FETCH_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_FLICKR_TYPE_ACCOUNT_INFO_FETCH_TRANSACTION, PublishingFlickrAccountInfoFetchTransaction))
#define PUBLISHING_FLICKR_ACCOUNT_INFO_FETCH_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_FLICKR_TYPE_ACCOUNT_INFO_FETCH_TRANSACTION, PublishingFlickrAccountInfoFetchTransactionClass))
#define PUBLISHING_FLICKR_IS_ACCOUNT_INFO_FETCH_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_FLICKR_TYPE_ACCOUNT_INFO_FETCH_TRANSACTION))
#define PUBLISHING_FLICKR_IS_ACCOUNT_INFO_FETCH_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_FLICKR_TYPE_ACCOUNT_INFO_FETCH_TRANSACTION))
#define PUBLISHING_FLICKR_ACCOUNT_INFO_FETCH_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_FLICKR_TYPE_ACCOUNT_INFO_FETCH_TRANSACTION, PublishingFlickrAccountInfoFetchTransactionClass))

typedef struct _PublishingFlickrAccountInfoFetchTransaction PublishingFlickrAccountInfoFetchTransaction;
typedef struct _PublishingFlickrAccountInfoFetchTransactionClass PublishingFlickrAccountInfoFetchTransactionClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _publishing_rest_support_transaction_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_transaction_unref (var), NULL)))
typedef struct _PublishingFlickrFlickrPublisherDoFetchAccountInfoData PublishingFlickrFlickrPublisherDoFetchAccountInfoData;
#define _publishing_rest_support_xml_document_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_xml_document_unref (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

#define PUBLISHING_FLICKR_TYPE_UPLOADER (publishing_flickr_uploader_get_type ())
#define PUBLISHING_FLICKR_UPLOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_FLICKR_TYPE_UPLOADER, PublishingFlickrUploader))
#define PUBLISHING_FLICKR_UPLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_FLICKR_TYPE_UPLOADER, PublishingFlickrUploaderClass))
#define PUBLISHING_FLICKR_IS_UPLOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_FLICKR_TYPE_UPLOADER))
#define PUBLISHING_FLICKR_IS_UPLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_FLICKR_TYPE_UPLOADER))
#define PUBLISHING_FLICKR_UPLOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_FLICKR_TYPE_UPLOADER, PublishingFlickrUploaderClass))

typedef struct _PublishingFlickrUploader PublishingFlickrUploader;
typedef struct _PublishingFlickrUploaderClass PublishingFlickrUploaderClass;
#define _publishing_rest_support_batch_uploader_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_batch_uploader_unref (var), NULL)))
typedef struct _PublishingFlickrFlickrPublisherDoPublishData PublishingFlickrFlickrPublisherDoPublishData;
typedef struct _PublishingFlickrAccountInfoFetchTransactionPrivate PublishingFlickrAccountInfoFetchTransactionPrivate;

#define PUBLISHING_FLICKR_TYPE_UPLOAD_TRANSACTION (publishing_flickr_upload_transaction_get_type ())
#define PUBLISHING_FLICKR_UPLOAD_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_FLICKR_TYPE_UPLOAD_TRANSACTION, PublishingFlickrUploadTransaction))
#define PUBLISHING_FLICKR_UPLOAD_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_FLICKR_TYPE_UPLOAD_TRANSACTION, PublishingFlickrUploadTransactionClass))
#define PUBLISHING_FLICKR_IS_UPLOAD_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_FLICKR_TYPE_UPLOAD_TRANSACTION))
#define PUBLISHING_FLICKR_IS_UPLOAD_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_FLICKR_TYPE_UPLOAD_TRANSACTION))
#define PUBLISHING_FLICKR_UPLOAD_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_FLICKR_TYPE_UPLOAD_TRANSACTION, PublishingFlickrUploadTransactionClass))

typedef struct _PublishingFlickrUploadTransaction PublishingFlickrUploadTransaction;
typedef struct _PublishingFlickrUploadTransactionClass PublishingFlickrUploadTransactionClass;
typedef struct _PublishingFlickrUploadTransactionPrivate PublishingFlickrUploadTransactionPrivate;
typedef struct _PublishingFlickrUploadTransactionExecuteAsyncData PublishingFlickrUploadTransactionExecuteAsyncData;
typedef struct _PublishingFlickrPublishingOptionsPanePrivate PublishingFlickrPublishingOptionsPanePrivate;

#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY (publishing_flickr_publishing_options_pane_visibility_entry_get_type ())
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_VISIBILITY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY, PublishingFlickrPublishingOptionsPaneVisibilityEntry))
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_VISIBILITY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY, PublishingFlickrPublishingOptionsPaneVisibilityEntryClass))
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_IS_VISIBILITY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY))
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_IS_VISIBILITY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY))
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_VISIBILITY_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY, PublishingFlickrPublishingOptionsPaneVisibilityEntryClass))

typedef struct _PublishingFlickrPublishingOptionsPaneVisibilityEntry PublishingFlickrPublishingOptionsPaneVisibilityEntry;
typedef struct _PublishingFlickrPublishingOptionsPaneVisibilityEntryClass PublishingFlickrPublishingOptionsPaneVisibilityEntryClass;

#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY (publishing_flickr_publishing_options_pane_size_entry_get_type ())
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_SIZE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY, PublishingFlickrPublishingOptionsPaneSizeEntry))
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_SIZE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY, PublishingFlickrPublishingOptionsPaneSizeEntryClass))
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_IS_SIZE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY))
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_IS_SIZE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY))
#define PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_SIZE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY, PublishingFlickrPublishingOptionsPaneSizeEntryClass))

typedef struct _PublishingFlickrPublishingOptionsPaneSizeEntry PublishingFlickrPublishingOptionsPaneSizeEntry;
typedef struct _PublishingFlickrPublishingOptionsPaneSizeEntryClass PublishingFlickrPublishingOptionsPaneSizeEntryClass;
enum  {
	PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_0_PROPERTY,
	PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_NUM_PROPERTIES
};
static GParamSpec* publishing_flickr_publishing_options_pane_properties[PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_NUM_PROPERTIES];
typedef struct _PublishingFlickrPublishingOptionsPaneVisibilityEntryPrivate PublishingFlickrPublishingOptionsPaneVisibilityEntryPrivate;
typedef struct _PublishingFlickrPublishingOptionsPaneSizeEntryPrivate PublishingFlickrPublishingOptionsPaneSizeEntryPrivate;
#define _publishing_flickr_publishing_options_pane_visibility_entry_unref0(var) ((var == NULL) ? NULL : (var = (publishing_flickr_publishing_options_pane_visibility_entry_unref (var), NULL)))
#define _publishing_flickr_publishing_options_pane_size_entry_unref0(var) ((var == NULL) ? NULL : (var = (publishing_flickr_publishing_options_pane_size_entry_unref (var), NULL)))
typedef struct _PublishingFlickrPublishingOptionsPaneParamSpecSizeEntry PublishingFlickrPublishingOptionsPaneParamSpecSizeEntry;
typedef struct _PublishingFlickrPublishingOptionsPaneParamSpecVisibilityEntry PublishingFlickrPublishingOptionsPaneParamSpecVisibilityEntry;
enum  {
	PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_PUBLISH_SIGNAL,
	PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_LOGOUT_SIGNAL,
	PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_NUM_SIGNALS
};
static guint publishing_flickr_publishing_options_pane_signals[PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_NUM_SIGNALS] = {0};
typedef struct _PublishingFlickrUploaderPrivate PublishingFlickrUploaderPrivate;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _PublishingFlickrVisibilitySpecification {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingFlickrVisibilitySpecificationPrivate * priv;
	gint friends_level;
	gint family_level;
	gint everyone_level;
};

struct _PublishingFlickrVisibilitySpecificationClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingFlickrVisibilitySpecification *self);
};

struct _PublishingFlickrParamSpecVisibilitySpecification {
	GParamSpec parent_instance;
};

struct _PublishingFlickrPublishingParameters {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingFlickrPublishingParametersPrivate * priv;
	PublishingFlickrUserKind user_kind;
	gint64 max_images_count;
	guint64 uploaded_images_count;
	gint photo_major_axis_size;
	gchar* username;
	PublishingFlickrVisibilitySpecification* visibility_specification;
	gboolean strip_metadata;
};

struct _PublishingFlickrPublishingParametersClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingFlickrPublishingParameters *self);
};

struct _PublishingFlickrParamSpecPublishingParameters {
	GParamSpec parent_instance;
};

struct _PublishingFlickrFlickrPublisherPrivate {
	SpitPublishingService* service;
	SpitPublishingPluginHost* host;
	SpitPublishingProgressCallback progress_reporter;
	gpointer progress_reporter_target;
	GDestroyNotify progress_reporter_target_destroy_notify;
	gboolean running;
	gboolean was_started;
	PublishingRESTSupportOAuth1Session* session;
	PublishingFlickrPublishingOptionsPane* publishing_options_pane;
	SpitPublishingAuthenticator* authenticator;
	PublishingFlickrPublishingParameters* parameters;
};

struct _PublishingFlickrFlickrPublisherDoFetchAccountInfoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingFlickrFlickrPublisher* self;
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	PublishingFlickrAccountInfoFetchTransaction* txn;
	PublishingRESTSupportOAuth1Session* _tmp2_;
	PublishingFlickrAccountInfoFetchTransaction* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GError* err;
	SpitPublishingPluginHost* _tmp6_;
	GError* _tmp7_;
	GError* _inner_error0_;
};

struct _PublishingFlickrFlickrPublisherDoPublishData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingFlickrFlickrPublisher* self;
	gboolean strip_metadata;
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	PublishingFlickrPublishingParameters* _tmp2_;
	gpointer _tmp3_;
	GDestroyNotify _tmp4_;
	SpitPublishingProgressCallback _tmp5_;
	SpitPublishingPublishable** publishables;
	SpitPublishingPluginHost* _tmp6_;
	gint _tmp7_;
	SpitPublishingPublishable** _tmp8_;
	gint publishables_length1;
	gint _publishables_size_;
	GeeArrayList* sorted_list;
	GeeArrayList* _tmp9_;
	SpitPublishingPublishable** _tmp10_;
	gint _tmp10__length1;
	SpitPublishingPublishable** p_collection;
	gint p_collection_length1;
	gint _p_collection_size_;
	gint p_it;
	SpitPublishingPublishable* _tmp11_;
	SpitPublishingPublishable* p;
	GeeArrayList* _tmp12_;
	SpitPublishingPublishable* _tmp13_;
	GeeArrayList* _tmp14_;
	PublishingFlickrUploader* uploader;
	PublishingRESTSupportOAuth1Session* _tmp15_;
	GeeArrayList* _tmp16_;
	gint _tmp17_;
	gpointer* _tmp18_;
	SpitPublishingPublishable** _tmp19_;
	gint _tmp19__length1;
	PublishingFlickrPublishingParameters* _tmp20_;
	PublishingFlickrUploader* _tmp21_;
	PublishingFlickrUploader* _tmp22_;
	gint num_published;
	PublishingFlickrUploader* _tmp23_;
	GError* err;
	GError* _tmp24_;
	const gchar* _tmp25_;
	SpitPublishingPluginHost* _tmp26_;
	GError* _tmp27_;
	GError* _inner_error0_;
};

struct _PublishingFlickrAccountInfoFetchTransaction {
	PublishingRESTSupportOAuth1Transaction parent_instance;
	PublishingFlickrAccountInfoFetchTransactionPrivate * priv;
};

struct _PublishingFlickrAccountInfoFetchTransactionClass {
	PublishingRESTSupportOAuth1TransactionClass parent_class;
};

struct _PublishingFlickrUploadTransaction {
	PublishingRESTSupportOAuth1UploadTransaction parent_instance;
	PublishingFlickrUploadTransactionPrivate * priv;
};

struct _PublishingFlickrUploadTransactionClass {
	PublishingRESTSupportOAuth1UploadTransactionClass parent_class;
};

struct _PublishingFlickrUploadTransactionPrivate {
	PublishingFlickrPublishingParameters* parameters;
};

struct _PublishingFlickrUploadTransactionExecuteAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingFlickrUploadTransaction* self;
	GError* _inner_error0_;
};

struct _PublishingFlickrPublishingOptionsPane {
	GObject parent_instance;
	PublishingFlickrPublishingOptionsPanePrivate * priv;
};

struct _PublishingFlickrPublishingOptionsPaneClass {
	GObjectClass parent_class;
};

struct _PublishingFlickrPublishingOptionsPanePrivate {
	GtkBuilder* builder;
	GtkBox* pane_widget;
	GtkLabel* visibility_label;
	GtkLabel* upload_info_label;
	GtkLabel* size_label;
	GtkButton* logout_button;
	GtkButton* publish_button;
	GtkComboBoxText* visibility_combo;
	GtkComboBoxText* size_combo;
	GtkCheckButton* strip_metadata_check;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry** visibilities;
	gint visibilities_length1;
	gint _visibilities_size_;
	PublishingFlickrPublishingOptionsPaneSizeEntry** sizes;
	gint sizes_length1;
	gint _sizes_size_;
	PublishingFlickrPublishingParameters* parameters;
	PublishingFlickrFlickrPublisher* publisher;
	SpitPublishingPublisherMediaType media_type;
};

struct _PublishingFlickrPublishingOptionsPaneVisibilityEntry {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingFlickrPublishingOptionsPaneVisibilityEntryPrivate * priv;
	PublishingFlickrVisibilitySpecification* specification;
	gchar* title;
};

struct _PublishingFlickrPublishingOptionsPaneVisibilityEntryClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingFlickrPublishingOptionsPaneVisibilityEntry *self);
};

struct _PublishingFlickrPublishingOptionsPaneSizeEntry {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingFlickrPublishingOptionsPaneSizeEntryPrivate * priv;
	gchar* title;
	gint size;
};

struct _PublishingFlickrPublishingOptionsPaneSizeEntryClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingFlickrPublishingOptionsPaneSizeEntry *self);
};

struct _PublishingFlickrPublishingOptionsPaneParamSpecSizeEntry {
	GParamSpec parent_instance;
};

struct _PublishingFlickrPublishingOptionsPaneParamSpecVisibilityEntry {
	GParamSpec parent_instance;
};

struct _PublishingFlickrUploader {
	PublishingRESTSupportBatchUploader parent_instance;
	PublishingFlickrUploaderPrivate * priv;
};

struct _PublishingFlickrUploaderClass {
	PublishingRESTSupportBatchUploaderClass parent_class;
};

struct _PublishingFlickrUploaderPrivate {
	PublishingFlickrPublishingParameters* parameters;
	gboolean strip_metadata;
};

static gpointer flickr_service_parent_class = NULL;
static SpitPluggableIface * flickr_service_spit_pluggable_parent_iface = NULL;
static SpitPublishingServiceIface * flickr_service_spit_publishing_service_parent_iface = NULL;
static gpointer publishing_flickr_visibility_specification_parent_class = NULL;
static gpointer publishing_flickr_publishing_parameters_parent_class = NULL;
static gint PublishingFlickrFlickrPublisher_private_offset;
static gpointer publishing_flickr_flickr_publisher_parent_class = NULL;
static SpitPublishingPublisherIface * publishing_flickr_flickr_publisher_spit_publishing_publisher_parent_iface = NULL;
static gpointer publishing_flickr_account_info_fetch_transaction_parent_class = NULL;
static gint PublishingFlickrUploadTransaction_private_offset;
static gpointer publishing_flickr_upload_transaction_parent_class = NULL;
static gint PublishingFlickrPublishingOptionsPane_private_offset;
static gpointer publishing_flickr_publishing_options_pane_parent_class = NULL;
static gpointer publishing_flickr_publishing_options_pane_size_entry_parent_class = NULL;
static gpointer publishing_flickr_publishing_options_pane_visibility_entry_parent_class = NULL;
static SpitPublishingDialogPaneIface * publishing_flickr_publishing_options_pane_spit_publishing_dialog_pane_parent_iface = NULL;
static gint PublishingFlickrUploader_private_offset;
static gpointer publishing_flickr_uploader_parent_class = NULL;

static gint flickr_service_real_get_pluggable_interface (SpitPluggable* base,
                                                  gint min_host_interface,
                                                  gint max_host_interface);
static const gchar* flickr_service_real_get_id (SpitPluggable* base);
static const gchar* flickr_service_real_get_pluggable_name (SpitPluggable* base);
static SpitPluggableInfo* flickr_service_real_get_info (SpitPluggable* base);
static void flickr_service_real_activation (SpitPluggable* base,
                                     gboolean enabled);
static SpitPublishingPublisher* flickr_service_real_create_publisher (SpitPublishingService* base,
                                                               SpitPublishingPluginHost* host);
static SpitPublishingPublisherMediaType flickr_service_real_get_supported_media (SpitPublishingService* base);
static GType flickr_service_get_type_once (void);
VALA_EXTERN GType publishing_flickr_user_kind_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer publishing_flickr_visibility_specification_ref (gpointer instance);
VALA_EXTERN void publishing_flickr_visibility_specification_unref (gpointer instance);
VALA_EXTERN GParamSpec* publishing_flickr_param_spec_visibility_specification (const gchar* name,
                                                                   const gchar* nick,
                                                                   const gchar* blurb,
                                                                   GType object_type,
                                                                   GParamFlags flags);
VALA_EXTERN void publishing_flickr_value_set_visibility_specification (GValue* value,
                                                           gpointer v_object);
VALA_EXTERN void publishing_flickr_value_take_visibility_specification (GValue* value,
                                                            gpointer v_object);
VALA_EXTERN gpointer publishing_flickr_value_get_visibility_specification (const GValue* value);
VALA_EXTERN GType publishing_flickr_visibility_specification_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingFlickrVisibilitySpecification* publishing_flickr_visibility_specification_new (gint friends_level,
                                                                                         gint family_level,
                                                                                         gint everyone_level);
VALA_EXTERN PublishingFlickrVisibilitySpecification* publishing_flickr_visibility_specification_construct (GType object_type,
                                                                                               gint friends_level,
                                                                                               gint family_level,
                                                                                               gint everyone_level);
static void publishing_flickr_visibility_specification_finalize (PublishingFlickrVisibilitySpecification * obj);
static GType publishing_flickr_visibility_specification_get_type_once (void);
VALA_EXTERN gpointer publishing_flickr_publishing_parameters_ref (gpointer instance);
VALA_EXTERN void publishing_flickr_publishing_parameters_unref (gpointer instance);
VALA_EXTERN GParamSpec* publishing_flickr_param_spec_publishing_parameters (const gchar* name,
                                                                const gchar* nick,
                                                                const gchar* blurb,
                                                                GType object_type,
                                                                GParamFlags flags);
VALA_EXTERN void publishing_flickr_value_set_publishing_parameters (GValue* value,
                                                        gpointer v_object);
VALA_EXTERN void publishing_flickr_value_take_publishing_parameters (GValue* value,
                                                         gpointer v_object);
VALA_EXTERN gpointer publishing_flickr_value_get_publishing_parameters (const GValue* value);
VALA_EXTERN GType publishing_flickr_publishing_parameters_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingFlickrPublishingParameters* publishing_flickr_publishing_parameters_new (void);
VALA_EXTERN PublishingFlickrPublishingParameters* publishing_flickr_publishing_parameters_construct (GType object_type);
static void publishing_flickr_publishing_parameters_finalize (PublishingFlickrPublishingParameters * obj);
static GType publishing_flickr_publishing_parameters_get_type_once (void);
VALA_EXTERN GType publishing_flickr_publishing_options_pane_get_type (void) G_GNUC_CONST ;
static void publishing_flickr_flickr_publisher_on_session_authenticated (PublishingFlickrFlickrPublisher* self);
static void _publishing_flickr_flickr_publisher_on_session_authenticated_spit_publishing_authenticator_authenticated (SpitPublishingAuthenticator* _sender,
                                                                                                               gpointer self);
static gboolean publishing_flickr_flickr_publisher_get_persistent_strip_metadata (PublishingFlickrFlickrPublisher* self);
static void publishing_flickr_flickr_publisher_set_persistent_strip_metadata (PublishingFlickrFlickrPublisher* self,
                                                                       gboolean strip_metadata);
static void publishing_flickr_flickr_publisher_do_fetch_account_info (PublishingFlickrFlickrPublisher* self,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_);
static void publishing_flickr_flickr_publisher_do_fetch_account_info_finish (PublishingFlickrFlickrPublisher* self,
                                                                      GAsyncResult* _res_);
static void publishing_flickr_flickr_publisher_on_account_info_available (PublishingFlickrFlickrPublisher* self);
static void publishing_flickr_flickr_publisher_do_show_publishing_options_pane (PublishingFlickrFlickrPublisher* self);
static void publishing_flickr_flickr_publisher_on_publishing_options_pane_publish (PublishingFlickrFlickrPublisher* self,
                                                                            gboolean strip_metadata);
static void _publishing_flickr_flickr_publisher_on_publishing_options_pane_publish_publishing_flickr_publishing_options_pane_publish (PublishingFlickrPublishingOptionsPane* _sender,
                                                                                                                               gboolean strip_metadata,
                                                                                                                               gpointer self);
static void publishing_flickr_flickr_publisher_on_publishing_options_pane_logout (PublishingFlickrFlickrPublisher* self);
static void _publishing_flickr_flickr_publisher_on_publishing_options_pane_logout_publishing_flickr_publishing_options_pane_logout (PublishingFlickrPublishingOptionsPane* _sender,
                                                                                                                             gpointer self);
static void publishing_flickr_flickr_publisher_do_publish (PublishingFlickrFlickrPublisher* self,
                                                    gboolean strip_metadata,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
static void publishing_flickr_flickr_publisher_do_publish_finish (PublishingFlickrFlickrPublisher* self,
                                                           GAsyncResult* _res_);
static void publishing_flickr_flickr_publisher_do_logout (PublishingFlickrFlickrPublisher* self);
static void publishing_flickr_flickr_publisher_on_upload_status_updated (PublishingFlickrFlickrPublisher* self,
                                                                  gint file_number,
                                                                  gdouble completed_fraction);
static void publishing_flickr_flickr_publisher_do_fetch_account_info_data_free (gpointer _data);
static gboolean publishing_flickr_flickr_publisher_do_fetch_account_info_co (PublishingFlickrFlickrPublisherDoFetchAccountInfoData* _data_);
VALA_EXTERN GType publishing_flickr_account_info_fetch_transaction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingFlickrAccountInfoFetchTransaction* publishing_flickr_account_info_fetch_transaction_new (PublishingRESTSupportOAuth1Session* session);
VALA_EXTERN PublishingFlickrAccountInfoFetchTransaction* publishing_flickr_account_info_fetch_transaction_construct (GType object_type,
                                                                                                         PublishingRESTSupportOAuth1Session* session);
static void publishing_flickr_flickr_publisher_do_fetch_account_info_ready (GObject* source_object,
                                                                     GAsyncResult* _res_,
                                                                     gpointer _user_data_);
static void publishing_flickr_flickr_publisher_do_parse_account_info_from_xml (PublishingFlickrFlickrPublisher* self,
                                                                        const gchar* xml);
static void publishing_flickr_flickr_publisher_attempt_start (PublishingFlickrFlickrPublisher* self);
VALA_EXTERN PublishingFlickrPublishingOptionsPane* publishing_flickr_publishing_options_pane_new (PublishingFlickrFlickrPublisher* publisher,
                                                                                      PublishingFlickrPublishingParameters* parameters,
                                                                                      SpitPublishingPublisherMediaType media_type,
                                                                                      GtkBuilder* builder,
                                                                                      gboolean strip_metadata);
VALA_EXTERN PublishingFlickrPublishingOptionsPane* publishing_flickr_publishing_options_pane_construct (GType object_type,
                                                                                            PublishingFlickrFlickrPublisher* publisher,
                                                                                            PublishingFlickrPublishingParameters* parameters,
                                                                                            SpitPublishingPublisherMediaType media_type,
                                                                                            GtkBuilder* builder,
                                                                                            gboolean strip_metadata);
static void publishing_flickr_flickr_publisher_do_publish_data_free (gpointer _data);
static gboolean publishing_flickr_flickr_publisher_do_publish_co (PublishingFlickrFlickrPublisherDoPublishData* _data_);
static gint _publishing_flickr_flickr_publisher_flickr_date_time_compare_func_gcompare_data_func (gconstpointer a,
                                                                                           gconstpointer b,
                                                                                           gpointer self);
VALA_EXTERN GType publishing_flickr_uploader_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingFlickrUploader* publishing_flickr_uploader_new (PublishingRESTSupportOAuth1Session* session,
                                                          SpitPublishingPublishable** publishables,
                                                          gint publishables_length1,
                                                          PublishingFlickrPublishingParameters* parameters,
                                                          gboolean strip_metadata);
VALA_EXTERN PublishingFlickrUploader* publishing_flickr_uploader_construct (GType object_type,
                                                                PublishingRESTSupportOAuth1Session* session,
                                                                SpitPublishingPublishable** publishables,
                                                                gint publishables_length1,
                                                                PublishingFlickrPublishingParameters* parameters,
                                                                gboolean strip_metadata);
static void _publishing_flickr_flickr_publisher_on_upload_status_updated_spit_publishing_progress_callback (gint file_number,
                                                                                                     gdouble fraction_complete,
                                                                                                     gpointer self);
static void publishing_flickr_flickr_publisher_do_publish_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_);
static void publishing_flickr_flickr_publisher_do_show_success_pane (PublishingFlickrFlickrPublisher* self);
VALA_EXTERN gint publishing_flickr_flickr_publisher_get_persistent_visibility (PublishingFlickrFlickrPublisher* self);
VALA_EXTERN void publishing_flickr_flickr_publisher_set_persistent_visibility (PublishingFlickrFlickrPublisher* self,
                                                                   gint vis);
VALA_EXTERN gint publishing_flickr_flickr_publisher_get_persistent_default_size (PublishingFlickrFlickrPublisher* self);
VALA_EXTERN void publishing_flickr_flickr_publisher_set_persistent_default_size (PublishingFlickrFlickrPublisher* self,
                                                                     gint size);
static SpitPublishingService* publishing_flickr_flickr_publisher_real_get_service (SpitPublishingPublisher* base);
static gboolean publishing_flickr_flickr_publisher_real_is_running (SpitPublishingPublisher* base);
static void publishing_flickr_flickr_publisher_real_start (SpitPublishingPublisher* base);
static void publishing_flickr_flickr_publisher_real_stop (SpitPublishingPublisher* base);
static void publishing_flickr_flickr_publisher_finalize (GObject * obj);
static GType publishing_flickr_flickr_publisher_get_type_once (void);
static gchar* _publishing_flickr_transaction_validate_xml_publishing_rest_support_xml_document_check_for_error_response (PublishingRESTSupportXmlDocument* doc,
                                                                                                                  gpointer self);
static GType publishing_flickr_account_info_fetch_transaction_get_type_once (void);
VALA_EXTERN GType publishing_flickr_upload_transaction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingFlickrUploadTransaction* publishing_flickr_upload_transaction_new (PublishingRESTSupportOAuth1Session* session,
                                                                             PublishingFlickrPublishingParameters* parameters,
                                                                             SpitPublishingPublishable* publishable);
VALA_EXTERN PublishingFlickrUploadTransaction* publishing_flickr_upload_transaction_construct (GType object_type,
                                                                                   PublishingRESTSupportOAuth1Session* session,
                                                                                   PublishingFlickrPublishingParameters* parameters,
                                                                                   SpitPublishingPublishable* publishable);
static void _g_free0_ (gpointer var);
static void publishing_flickr_upload_transaction_real_execute_async_data_free (gpointer _data);
static void publishing_flickr_upload_transaction_real_execute_async (PublishingRESTSupportTransaction* base,
                                                              GAsyncReadyCallback _callback_,
                                                              gpointer _user_data_);
static gboolean publishing_flickr_upload_transaction_real_execute_async_co (PublishingFlickrUploadTransactionExecuteAsyncData* _data_);
static void publishing_flickr_upload_transaction_execute_async_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_);
static void publishing_flickr_upload_transaction_finalize (PublishingRESTSupportTransaction * obj);
static GType publishing_flickr_upload_transaction_get_type_once (void);
static gpointer publishing_flickr_publishing_options_pane_visibility_entry_ref (gpointer instance);
static void publishing_flickr_publishing_options_pane_visibility_entry_unref (gpointer instance);
static GParamSpec* publishing_flickr_publishing_options_pane_param_spec_visibility_entry (const gchar* name,
                                                                                   const gchar* nick,
                                                                                   const gchar* blurb,
                                                                                   GType object_type,
                                                                                   GParamFlags flags) G_GNUC_UNUSED ;
static void publishing_flickr_publishing_options_pane_value_set_visibility_entry (GValue* value,
                                                                           gpointer v_object) G_GNUC_UNUSED ;
static void publishing_flickr_publishing_options_pane_value_take_visibility_entry (GValue* value,
                                                                            gpointer v_object) G_GNUC_UNUSED ;
static gpointer publishing_flickr_publishing_options_pane_value_get_visibility_entry (const GValue* value) G_GNUC_UNUSED ;
static GType publishing_flickr_publishing_options_pane_visibility_entry_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static gpointer publishing_flickr_publishing_options_pane_size_entry_ref (gpointer instance);
static void publishing_flickr_publishing_options_pane_size_entry_unref (gpointer instance);
static GParamSpec* publishing_flickr_publishing_options_pane_param_spec_size_entry (const gchar* name,
                                                                             const gchar* nick,
                                                                             const gchar* blurb,
                                                                             GType object_type,
                                                                             GParamFlags flags) G_GNUC_UNUSED ;
static void publishing_flickr_publishing_options_pane_value_set_size_entry (GValue* value,
                                                                     gpointer v_object) G_GNUC_UNUSED ;
static void publishing_flickr_publishing_options_pane_value_take_size_entry (GValue* value,
                                                                      gpointer v_object) G_GNUC_UNUSED ;
static gpointer publishing_flickr_publishing_options_pane_value_get_size_entry (const GValue* value) G_GNUC_UNUSED ;
static GType publishing_flickr_publishing_options_pane_size_entry_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static PublishingFlickrPublishingOptionsPaneVisibilityEntry** publishing_flickr_publishing_options_pane_create_visibilities (PublishingFlickrPublishingOptionsPane* self,
                                                                                                                      gint* result_length1);
static PublishingFlickrPublishingOptionsPaneSizeEntry** publishing_flickr_publishing_options_pane_create_sizes (PublishingFlickrPublishingOptionsPane* self,
                                                                                                         gint* result_length1);
static void publishing_flickr_publishing_options_pane_populate_visibility_combo (PublishingFlickrPublishingOptionsPane* self);
static void publishing_flickr_publishing_options_pane_on_visibility_changed (PublishingFlickrPublishingOptionsPane* self);
static void _publishing_flickr_publishing_options_pane_on_visibility_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                                             gpointer self);
static void publishing_flickr_publishing_options_pane_populate_size_combo (PublishingFlickrPublishingOptionsPane* self);
static void publishing_flickr_publishing_options_pane_on_size_changed (PublishingFlickrPublishingOptionsPane* self);
static void _publishing_flickr_publishing_options_pane_on_size_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                                       gpointer self);
static void publishing_flickr_publishing_options_pane_on_logout_clicked (PublishingFlickrPublishingOptionsPane* self);
static void _publishing_flickr_publishing_options_pane_on_logout_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                      gpointer self);
static void publishing_flickr_publishing_options_pane_on_publish_clicked (PublishingFlickrPublishingOptionsPane* self);
static void _publishing_flickr_publishing_options_pane_on_publish_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                       gpointer self);
static PublishingFlickrPublishingOptionsPaneVisibilityEntry* publishing_flickr_publishing_options_pane_visibility_entry_new (const gchar* creator_title,
                                                                                                                      PublishingFlickrVisibilitySpecification* creator_specification);
static PublishingFlickrPublishingOptionsPaneVisibilityEntry* publishing_flickr_publishing_options_pane_visibility_entry_construct (GType object_type,
                                                                                                                            const gchar* creator_title,
                                                                                                                            PublishingFlickrVisibilitySpecification* creator_specification);
static void _vala_array_add6 (PublishingFlickrPublishingOptionsPaneVisibilityEntry** * array,
                       gint* length,
                       gint* size,
                       PublishingFlickrPublishingOptionsPaneVisibilityEntry* value);
static void _vala_array_add7 (PublishingFlickrPublishingOptionsPaneVisibilityEntry** * array,
                       gint* length,
                       gint* size,
                       PublishingFlickrPublishingOptionsPaneVisibilityEntry* value);
static void _vala_array_add8 (PublishingFlickrPublishingOptionsPaneVisibilityEntry** * array,
                       gint* length,
                       gint* size,
                       PublishingFlickrPublishingOptionsPaneVisibilityEntry* value);
static void _vala_array_add9 (PublishingFlickrPublishingOptionsPaneVisibilityEntry** * array,
                       gint* length,
                       gint* size,
                       PublishingFlickrPublishingOptionsPaneVisibilityEntry* value);
static void _vala_array_add10 (PublishingFlickrPublishingOptionsPaneVisibilityEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingFlickrPublishingOptionsPaneVisibilityEntry* value);
static PublishingFlickrPublishingOptionsPaneSizeEntry* publishing_flickr_publishing_options_pane_size_entry_new (const gchar* creator_title,
                                                                                                          gint creator_size);
static PublishingFlickrPublishingOptionsPaneSizeEntry* publishing_flickr_publishing_options_pane_size_entry_construct (GType object_type,
                                                                                                                const gchar* creator_title,
                                                                                                                gint creator_size);
static void _vala_array_add11 (PublishingFlickrPublishingOptionsPaneSizeEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingFlickrPublishingOptionsPaneSizeEntry* value);
static void _vala_array_add12 (PublishingFlickrPublishingOptionsPaneSizeEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingFlickrPublishingOptionsPaneSizeEntry* value);
static void _vala_array_add13 (PublishingFlickrPublishingOptionsPaneSizeEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingFlickrPublishingOptionsPaneSizeEntry* value);
static void _vala_array_add14 (PublishingFlickrPublishingOptionsPaneSizeEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingFlickrPublishingOptionsPaneSizeEntry* value);
static void _vala_array_add15 (PublishingFlickrPublishingOptionsPaneSizeEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingFlickrPublishingOptionsPaneSizeEntry* value);
VALA_EXTERN void publishing_flickr_publishing_options_pane_notify_publish (PublishingFlickrPublishingOptionsPane* self);
VALA_EXTERN void publishing_flickr_publishing_options_pane_notify_logout (PublishingFlickrPublishingOptionsPane* self);
static GtkWidget* publishing_flickr_publishing_options_pane_real_get_widget (SpitPublishingDialogPane* base);
static SpitPublishingDialogPaneGeometryOptions publishing_flickr_publishing_options_pane_real_get_preferred_geometry (SpitPublishingDialogPane* base);
static void publishing_flickr_publishing_options_pane_real_on_pane_installed (SpitPublishingDialogPane* base);
static void _publishing_flickr_publishing_options_pane_notify_publish_publishing_flickr_publishing_options_pane_publish (PublishingFlickrPublishingOptionsPane* _sender,
                                                                                                                  gboolean strip_metadata,
                                                                                                                  gpointer self);
static void _publishing_flickr_publishing_options_pane_notify_logout_publishing_flickr_publishing_options_pane_logout (PublishingFlickrPublishingOptionsPane* _sender,
                                                                                                                gpointer self);
static void publishing_flickr_publishing_options_pane_real_on_pane_uninstalled (SpitPublishingDialogPane* base);
static void publishing_flickr_publishing_options_pane_size_entry_finalize (PublishingFlickrPublishingOptionsPaneSizeEntry * obj);
static GType publishing_flickr_publishing_options_pane_size_entry_get_type_once (void);
static void publishing_flickr_publishing_options_pane_visibility_entry_finalize (PublishingFlickrPublishingOptionsPaneVisibilityEntry * obj);
static GType publishing_flickr_publishing_options_pane_visibility_entry_get_type_once (void);
static void publishing_flickr_publishing_options_pane_finalize (GObject * obj);
static GType publishing_flickr_publishing_options_pane_get_type_once (void);
static void publishing_flickr_uploader_preprocess_publishable (PublishingFlickrUploader* self,
                                                        SpitPublishingPublishable* publishable);
static void _vala_array_add16 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static PublishingRESTSupportTransaction* publishing_flickr_uploader_real_create_transaction (PublishingRESTSupportBatchUploader* base,
                                                                                      SpitPublishingPublishable* publishable);
static void publishing_flickr_uploader_finalize (PublishingRESTSupportBatchUploader * obj);
static GType publishing_flickr_uploader_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

FlickrService*
flickr_service_construct (GType object_type)
{
	FlickrService * self = NULL;
	self = (FlickrService*) g_object_new (object_type, NULL);
	return self;
}

FlickrService*
flickr_service_new (void)
{
	return flickr_service_construct (TYPE_FLICKR_SERVICE);
}

static gint
flickr_service_real_get_pluggable_interface (SpitPluggable* base,
                                             gint min_host_interface,
                                             gint max_host_interface)
{
	FlickrService * self;
	gint result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_FLICKR_SERVICE, FlickrService);
	result = spit_negotiate_interfaces (min_host_interface, max_host_interface, SPIT_PUBLISHING_CURRENT_INTERFACE);
	return result;
}

static const gchar*
flickr_service_real_get_id (SpitPluggable* base)
{
	FlickrService * self;
	const gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_FLICKR_SERVICE, FlickrService);
	result = "org.gnome.shotwell.publishing.flickr";
	return result;
}

static const gchar*
flickr_service_real_get_pluggable_name (SpitPluggable* base)
{
	FlickrService * self;
	const gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_FLICKR_SERVICE, FlickrService);
	result = "Flickr";
	return result;
}

static SpitPluggableInfo*
flickr_service_real_get_info (SpitPluggable* base)
{
	FlickrService * self;
	SpitPluggableInfo* info = NULL;
	SpitPluggableInfo* _tmp0_;
	SpitPluggableInfo* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_FLICKR_SERVICE, FlickrService);
	_tmp0_ = spit_pluggable_info_new ();
	info = _tmp0_;
	spit_pluggable_info_set_authors (info, "Lucas Beeler");
	spit_pluggable_info_set_copyright (info, _ ("Copyright 2016 Software Freedom Conservancy Inc."));
	result = info;
	return result;
}

static void
flickr_service_real_activation (SpitPluggable* base,
                                gboolean enabled)
{
	FlickrService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_FLICKR_SERVICE, FlickrService);
}

static SpitPublishingPublisher*
flickr_service_real_create_publisher (SpitPublishingService* base,
                                      SpitPublishingPluginHost* host)
{
	FlickrService * self;
	PublishingFlickrFlickrPublisher* _tmp0_;
	SpitPublishingPublisher* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_FLICKR_SERVICE, FlickrService);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (host, SPIT_PUBLISHING_TYPE_PLUGIN_HOST), NULL);
	_tmp0_ = publishing_flickr_flickr_publisher_new (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_SERVICE, SpitPublishingService), host);
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher);
	return result;
}

static SpitPublishingPublisherMediaType
flickr_service_real_get_supported_media (SpitPublishingService* base)
{
	FlickrService * self;
	SpitPublishingPublisherMediaType result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_FLICKR_SERVICE, FlickrService);
	result = SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_PHOTO | SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_VIDEO;
	return result;
}

static void
flickr_service_class_init (FlickrServiceClass * klass,
                           gpointer klass_data)
{
	flickr_service_parent_class = g_type_class_peek_parent (klass);
}

static void
flickr_service_spit_pluggable_interface_init (SpitPluggableIface * iface,
                                              gpointer iface_data)
{
	flickr_service_spit_pluggable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_pluggable_interface = (gint (*) (SpitPluggable*, gint, gint)) flickr_service_real_get_pluggable_interface;
	iface->get_id = (const gchar* (*) (SpitPluggable*)) flickr_service_real_get_id;
	iface->get_pluggable_name = (const gchar* (*) (SpitPluggable*)) flickr_service_real_get_pluggable_name;
	iface->get_info = (SpitPluggableInfo* (*) (SpitPluggable*)) flickr_service_real_get_info;
	iface->activation = (void (*) (SpitPluggable*, gboolean)) flickr_service_real_activation;
}

static void
flickr_service_spit_publishing_service_interface_init (SpitPublishingServiceIface * iface,
                                                       gpointer iface_data)
{
	flickr_service_spit_publishing_service_parent_iface = g_type_interface_peek_parent (iface);
	iface->create_publisher = (SpitPublishingPublisher* (*) (SpitPublishingService*, SpitPublishingPluginHost*)) flickr_service_real_create_publisher;
	iface->get_supported_media = (SpitPublishingPublisherMediaType (*) (SpitPublishingService*)) flickr_service_real_get_supported_media;
}

static void
flickr_service_instance_init (FlickrService * self,
                              gpointer klass)
{
}

static GType
flickr_service_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FlickrServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) flickr_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FlickrService), 0, (GInstanceInitFunc) flickr_service_instance_init, NULL };
	static const GInterfaceInfo spit_pluggable_info = { (GInterfaceInitFunc) flickr_service_spit_pluggable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo spit_publishing_service_info = { (GInterfaceInitFunc) flickr_service_spit_publishing_service_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType flickr_service_type_id;
	flickr_service_type_id = g_type_register_static (G_TYPE_OBJECT, "FlickrService", &g_define_type_info, 0);
	g_type_add_interface_static (flickr_service_type_id, SPIT_TYPE_PLUGGABLE, &spit_pluggable_info);
	g_type_add_interface_static (flickr_service_type_id, SPIT_PUBLISHING_TYPE_SERVICE, &spit_publishing_service_info);
	return flickr_service_type_id;
}

GType
flickr_service_get_type (void)
{
	static volatile gsize flickr_service_type_id__once = 0;
	if (g_once_init_enter (&flickr_service_type_id__once)) {
		GType flickr_service_type_id;
		flickr_service_type_id = flickr_service_get_type_once ();
		g_once_init_leave (&flickr_service_type_id__once, flickr_service_type_id);
	}
	return flickr_service_type_id__once;
}

static GType
publishing_flickr_user_kind_get_type_once (void)
{
	static const GEnumValue values[] = {{PUBLISHING_FLICKR_USER_KIND_PRO, "PUBLISHING_FLICKR_USER_KIND_PRO", "pro"}, {PUBLISHING_FLICKR_USER_KIND_FREE, "PUBLISHING_FLICKR_USER_KIND_FREE", "free"}, {0, NULL, NULL}};
	GType publishing_flickr_user_kind_type_id;
	publishing_flickr_user_kind_type_id = g_enum_register_static ("PublishingFlickrUserKind", values);
	return publishing_flickr_user_kind_type_id;
}

GType
publishing_flickr_user_kind_get_type (void)
{
	static volatile gsize publishing_flickr_user_kind_type_id__once = 0;
	if (g_once_init_enter (&publishing_flickr_user_kind_type_id__once)) {
		GType publishing_flickr_user_kind_type_id;
		publishing_flickr_user_kind_type_id = publishing_flickr_user_kind_get_type_once ();
		g_once_init_leave (&publishing_flickr_user_kind_type_id__once, publishing_flickr_user_kind_type_id);
	}
	return publishing_flickr_user_kind_type_id__once;
}

PublishingFlickrVisibilitySpecification*
publishing_flickr_visibility_specification_construct (GType object_type,
                                                      gint friends_level,
                                                      gint family_level,
                                                      gint everyone_level)
{
	PublishingFlickrVisibilitySpecification* self = NULL;
	self = (PublishingFlickrVisibilitySpecification*) g_type_create_instance (object_type);
	self->friends_level = friends_level;
	self->family_level = family_level;
	self->everyone_level = everyone_level;
	return self;
}

PublishingFlickrVisibilitySpecification*
publishing_flickr_visibility_specification_new (gint friends_level,
                                                gint family_level,
                                                gint everyone_level)
{
	return publishing_flickr_visibility_specification_construct (PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION, friends_level, family_level, everyone_level);
}

static void
publishing_flickr_value_visibility_specification_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
publishing_flickr_value_visibility_specification_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		publishing_flickr_visibility_specification_unref (value->data[0].v_pointer);
	}
}

static void
publishing_flickr_value_visibility_specification_copy_value (const GValue* src_value,
                                                             GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = publishing_flickr_visibility_specification_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
publishing_flickr_value_visibility_specification_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
publishing_flickr_value_visibility_specification_collect_value (GValue* value,
                                                                guint n_collect_values,
                                                                GTypeCValue* collect_values,
                                                                guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		PublishingFlickrVisibilitySpecification * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = publishing_flickr_visibility_specification_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
publishing_flickr_value_visibility_specification_lcopy_value (const GValue* value,
                                                              guint n_collect_values,
                                                              GTypeCValue* collect_values,
                                                              guint collect_flags)
{
	PublishingFlickrVisibilitySpecification ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = publishing_flickr_visibility_specification_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
publishing_flickr_param_spec_visibility_specification (const gchar* name,
                                                       const gchar* nick,
                                                       const gchar* blurb,
                                                       GType object_type,
                                                       GParamFlags flags)
{
	PublishingFlickrParamSpecVisibilitySpecification* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
publishing_flickr_value_get_visibility_specification (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION), NULL);
	return value->data[0].v_pointer;
}

void
publishing_flickr_value_set_visibility_specification (GValue* value,
                                                      gpointer v_object)
{
	PublishingFlickrVisibilitySpecification * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		publishing_flickr_visibility_specification_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_flickr_visibility_specification_unref (old);
	}
}

void
publishing_flickr_value_take_visibility_specification (GValue* value,
                                                       gpointer v_object)
{
	PublishingFlickrVisibilitySpecification * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_flickr_visibility_specification_unref (old);
	}
}

static void
publishing_flickr_visibility_specification_class_init (PublishingFlickrVisibilitySpecificationClass * klass,
                                                       gpointer klass_data)
{
	publishing_flickr_visibility_specification_parent_class = g_type_class_peek_parent (klass);
	((PublishingFlickrVisibilitySpecificationClass *) klass)->finalize = publishing_flickr_visibility_specification_finalize;
}

static void
publishing_flickr_visibility_specification_instance_init (PublishingFlickrVisibilitySpecification * self,
                                                          gpointer klass)
{
	self->ref_count = 1;
}

static void
publishing_flickr_visibility_specification_finalize (PublishingFlickrVisibilitySpecification * obj)
{
	PublishingFlickrVisibilitySpecification * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_FLICKR_TYPE_VISIBILITY_SPECIFICATION, PublishingFlickrVisibilitySpecification);
	g_signal_handlers_destroy (self);
}

static GType
publishing_flickr_visibility_specification_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_flickr_value_visibility_specification_init, publishing_flickr_value_visibility_specification_free_value, publishing_flickr_value_visibility_specification_copy_value, publishing_flickr_value_visibility_specification_peek_pointer, "p", publishing_flickr_value_visibility_specification_collect_value, "p", publishing_flickr_value_visibility_specification_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingFlickrVisibilitySpecificationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_flickr_visibility_specification_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingFlickrVisibilitySpecification), 0, (GInstanceInitFunc) publishing_flickr_visibility_specification_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType publishing_flickr_visibility_specification_type_id;
	publishing_flickr_visibility_specification_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingFlickrVisibilitySpecification", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return publishing_flickr_visibility_specification_type_id;
}

GType
publishing_flickr_visibility_specification_get_type (void)
{
	static volatile gsize publishing_flickr_visibility_specification_type_id__once = 0;
	if (g_once_init_enter (&publishing_flickr_visibility_specification_type_id__once)) {
		GType publishing_flickr_visibility_specification_type_id;
		publishing_flickr_visibility_specification_type_id = publishing_flickr_visibility_specification_get_type_once ();
		g_once_init_leave (&publishing_flickr_visibility_specification_type_id__once, publishing_flickr_visibility_specification_type_id);
	}
	return publishing_flickr_visibility_specification_type_id__once;
}

gpointer
publishing_flickr_visibility_specification_ref (gpointer instance)
{
	PublishingFlickrVisibilitySpecification * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
publishing_flickr_visibility_specification_unref (gpointer instance)
{
	PublishingFlickrVisibilitySpecification * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_FLICKR_VISIBILITY_SPECIFICATION_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

PublishingFlickrPublishingParameters*
publishing_flickr_publishing_parameters_construct (GType object_type)
{
	PublishingFlickrPublishingParameters* self = NULL;
	self = (PublishingFlickrPublishingParameters*) g_type_create_instance (object_type);
	return self;
}

PublishingFlickrPublishingParameters*
publishing_flickr_publishing_parameters_new (void)
{
	return publishing_flickr_publishing_parameters_construct (PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS);
}

static void
publishing_flickr_value_publishing_parameters_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
publishing_flickr_value_publishing_parameters_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		publishing_flickr_publishing_parameters_unref (value->data[0].v_pointer);
	}
}

static void
publishing_flickr_value_publishing_parameters_copy_value (const GValue* src_value,
                                                          GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = publishing_flickr_publishing_parameters_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
publishing_flickr_value_publishing_parameters_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
publishing_flickr_value_publishing_parameters_collect_value (GValue* value,
                                                             guint n_collect_values,
                                                             GTypeCValue* collect_values,
                                                             guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		PublishingFlickrPublishingParameters * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = publishing_flickr_publishing_parameters_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
publishing_flickr_value_publishing_parameters_lcopy_value (const GValue* value,
                                                           guint n_collect_values,
                                                           GTypeCValue* collect_values,
                                                           guint collect_flags)
{
	PublishingFlickrPublishingParameters ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = publishing_flickr_publishing_parameters_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
publishing_flickr_param_spec_publishing_parameters (const gchar* name,
                                                    const gchar* nick,
                                                    const gchar* blurb,
                                                    GType object_type,
                                                    GParamFlags flags)
{
	PublishingFlickrParamSpecPublishingParameters* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
publishing_flickr_value_get_publishing_parameters (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS), NULL);
	return value->data[0].v_pointer;
}

void
publishing_flickr_value_set_publishing_parameters (GValue* value,
                                                   gpointer v_object)
{
	PublishingFlickrPublishingParameters * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		publishing_flickr_publishing_parameters_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_flickr_publishing_parameters_unref (old);
	}
}

void
publishing_flickr_value_take_publishing_parameters (GValue* value,
                                                    gpointer v_object)
{
	PublishingFlickrPublishingParameters * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_flickr_publishing_parameters_unref (old);
	}
}

static void
publishing_flickr_publishing_parameters_class_init (PublishingFlickrPublishingParametersClass * klass,
                                                    gpointer klass_data)
{
	publishing_flickr_publishing_parameters_parent_class = g_type_class_peek_parent (klass);
	((PublishingFlickrPublishingParametersClass *) klass)->finalize = publishing_flickr_publishing_parameters_finalize;
}

static void
publishing_flickr_publishing_parameters_instance_init (PublishingFlickrPublishingParameters * self,
                                                       gpointer klass)
{
	self->ref_count = 1;
}

static void
publishing_flickr_publishing_parameters_finalize (PublishingFlickrPublishingParameters * obj)
{
	PublishingFlickrPublishingParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_FLICKR_TYPE_PUBLISHING_PARAMETERS, PublishingFlickrPublishingParameters);
	g_signal_handlers_destroy (self);
	_g_free0 (self->username);
	_publishing_flickr_visibility_specification_unref0 (self->visibility_specification);
}

static GType
publishing_flickr_publishing_parameters_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_flickr_value_publishing_parameters_init, publishing_flickr_value_publishing_parameters_free_value, publishing_flickr_value_publishing_parameters_copy_value, publishing_flickr_value_publishing_parameters_peek_pointer, "p", publishing_flickr_value_publishing_parameters_collect_value, "p", publishing_flickr_value_publishing_parameters_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingFlickrPublishingParametersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_flickr_publishing_parameters_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingFlickrPublishingParameters), 0, (GInstanceInitFunc) publishing_flickr_publishing_parameters_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType publishing_flickr_publishing_parameters_type_id;
	publishing_flickr_publishing_parameters_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingFlickrPublishingParameters", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return publishing_flickr_publishing_parameters_type_id;
}

GType
publishing_flickr_publishing_parameters_get_type (void)
{
	static volatile gsize publishing_flickr_publishing_parameters_type_id__once = 0;
	if (g_once_init_enter (&publishing_flickr_publishing_parameters_type_id__once)) {
		GType publishing_flickr_publishing_parameters_type_id;
		publishing_flickr_publishing_parameters_type_id = publishing_flickr_publishing_parameters_get_type_once ();
		g_once_init_leave (&publishing_flickr_publishing_parameters_type_id__once, publishing_flickr_publishing_parameters_type_id);
	}
	return publishing_flickr_publishing_parameters_type_id__once;
}

gpointer
publishing_flickr_publishing_parameters_ref (gpointer instance)
{
	PublishingFlickrPublishingParameters * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
publishing_flickr_publishing_parameters_unref (gpointer instance)
{
	PublishingFlickrPublishingParameters * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_FLICKR_PUBLISHING_PARAMETERS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
publishing_flickr_flickr_publisher_get_instance_private (PublishingFlickrFlickrPublisher* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingFlickrFlickrPublisher_private_offset);
}

static void
_publishing_flickr_flickr_publisher_on_session_authenticated_spit_publishing_authenticator_authenticated (SpitPublishingAuthenticator* _sender,
                                                                                                          gpointer self)
{
	publishing_flickr_flickr_publisher_on_session_authenticated ((PublishingFlickrFlickrPublisher*) self);
}

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

PublishingFlickrFlickrPublisher*
publishing_flickr_flickr_publisher_construct (GType object_type,
                                              SpitPublishingService* service,
                                              SpitPublishingPluginHost* host)
{
	PublishingFlickrFlickrPublisher * self = NULL;
	SpitPublishingService* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	PublishingRESTSupportOAuth1Session* _tmp2_;
	PublishingFlickrPublishingParameters* _tmp3_;
	PublishingAuthenticatorFactory* _tmp4_;
	PublishingAuthenticatorFactory* _tmp5_;
	SpitPublishingAuthenticator* _tmp6_;
	SpitPublishingAuthenticator* _tmp7_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (service, SPIT_PUBLISHING_TYPE_SERVICE), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (host, SPIT_PUBLISHING_TYPE_PLUGIN_HOST), NULL);
	self = (PublishingFlickrFlickrPublisher*) g_object_new (object_type, NULL);
	g_debug ("FlickrPublishing.vala:97: FlickrPublisher instantiated.");
	_tmp0_ = _g_object_ref0 (service);
	_g_object_unref0 (self->priv->service);
	self->priv->service = _tmp0_;
	_tmp1_ = _g_object_ref0 (host);
	_g_object_unref0 (self->priv->host);
	self->priv->host = _tmp1_;
	_tmp2_ = publishing_rest_support_oauth1_session_new (PUBLISHING_FLICKR_ENDPOINT_URL);
	_publishing_rest_support_session_unref0 (self->priv->session);
	self->priv->session = _tmp2_;
	_tmp3_ = publishing_flickr_publishing_parameters_new ();
	_publishing_flickr_publishing_parameters_unref0 (self->priv->parameters);
	self->priv->parameters = _tmp3_;
	_tmp4_ = publishing_authenticator_factory_get_instance ();
	_tmp5_ = _tmp4_;
	_tmp6_ = spit_publishing_authenticator_factory_create (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, SPIT_PUBLISHING_TYPE_AUTHENTICATOR_FACTORY, SpitPublishingAuthenticatorFactory), "flickr", host);
	_g_object_unref0 (self->priv->authenticator);
	self->priv->authenticator = _tmp6_;
	_g_object_unref0 (_tmp5_);
	_tmp7_ = self->priv->authenticator;
	g_signal_connect_object (_tmp7_, "authenticated", (GCallback) _publishing_flickr_flickr_publisher_on_session_authenticated_spit_publishing_authenticator_authenticated, self, 0);
	return self;
}

PublishingFlickrFlickrPublisher*
publishing_flickr_flickr_publisher_new (SpitPublishingService* service,
                                        SpitPublishingPluginHost* host)
{
	return publishing_flickr_flickr_publisher_construct (PUBLISHING_FLICKR_TYPE_FLICKR_PUBLISHER, service, host);
}

SpitPublishingAuthenticator*
publishing_flickr_flickr_publisher_get_authenticator (PublishingFlickrFlickrPublisher* self)
{
	SpitPublishingAuthenticator* _tmp0_;
	SpitPublishingAuthenticator* _tmp1_;
	SpitPublishingAuthenticator* result;
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self), NULL);
	_tmp0_ = self->priv->authenticator;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
publishing_flickr_flickr_publisher_get_persistent_strip_metadata (PublishingFlickrFlickrPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	gboolean result;
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self), FALSE);
	_tmp0_ = self->priv->host;
	result = spit_host_interface_get_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "strip_metadata", FALSE);
	return result;
}

static void
publishing_flickr_flickr_publisher_set_persistent_strip_metadata (PublishingFlickrFlickrPublisher* self,
                                                                  gboolean strip_metadata)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	_tmp0_ = self->priv->host;
	spit_host_interface_set_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "strip_metadata", strip_metadata);
}

static gpointer
_g_variant_ref0 (gpointer self)
{
	return self ? g_variant_ref (self) : NULL;
}

static void
publishing_flickr_flickr_publisher_on_session_authenticated (PublishingFlickrFlickrPublisher* self)
{
	GHashTable* params = NULL;
	SpitPublishingAuthenticator* _tmp0_;
	GHashTable* _tmp1_;
	GVariant* consumer_key = NULL;
	GVariant* consumer_secret = NULL;
	GVariant* auth_token = NULL;
	GVariant* auth_token_secret = NULL;
	GVariant* username = NULL;
	GHashTable* _tmp2_;
	gconstpointer _tmp3_ = NULL;
	GVariant* _tmp4_;
	GHashTable* _tmp5_;
	gconstpointer _tmp6_ = NULL;
	GVariant* _tmp7_;
	PublishingRESTSupportOAuth1Session* _tmp8_;
	GVariant* _tmp9_;
	const gchar* _tmp10_;
	GVariant* _tmp11_;
	const gchar* _tmp12_;
	GHashTable* _tmp13_;
	gconstpointer _tmp14_ = NULL;
	GVariant* _tmp15_;
	GHashTable* _tmp16_;
	gconstpointer _tmp17_ = NULL;
	GVariant* _tmp18_;
	GHashTable* _tmp19_;
	gconstpointer _tmp20_ = NULL;
	GVariant* _tmp21_;
	PublishingRESTSupportOAuth1Session* _tmp22_;
	GVariant* _tmp23_;
	const gchar* _tmp24_;
	GVariant* _tmp25_;
	const gchar* _tmp26_;
	GVariant* _tmp27_;
	const gchar* _tmp28_;
	PublishingFlickrPublishingParameters* _tmp29_;
	PublishingRESTSupportOAuth1Session* _tmp30_;
	gchar* _tmp31_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	if (!spit_publishing_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher))) {
		return;
	}
	g_debug ("FlickrPublishing.vala:127: EVENT: a fully authenticated session has be" \
"come available");
	_tmp0_ = self->priv->authenticator;
	_tmp1_ = spit_publishing_authenticator_get_authentication_parameter (_tmp0_);
	params = _tmp1_;
	consumer_key = NULL;
	consumer_secret = NULL;
	auth_token = NULL;
	auth_token_secret = NULL;
	username = NULL;
	_tmp2_ = params;
	g_hash_table_lookup_extended (_tmp2_, "ConsumerKey", NULL, &_tmp3_);
	_g_variant_unref0 (consumer_key);
	_tmp4_ = _g_variant_ref0 ((GVariant*) _tmp3_);
	consumer_key = _tmp4_;
	_tmp5_ = params;
	g_hash_table_lookup_extended (_tmp5_, "ConsumerSecret", NULL, &_tmp6_);
	_g_variant_unref0 (consumer_secret);
	_tmp7_ = _g_variant_ref0 ((GVariant*) _tmp6_);
	consumer_secret = _tmp7_;
	_tmp8_ = self->priv->session;
	_tmp9_ = consumer_key;
	_tmp10_ = g_variant_get_string (_tmp9_, NULL);
	_tmp11_ = consumer_secret;
	_tmp12_ = g_variant_get_string (_tmp11_, NULL);
	publishing_rest_support_oauth1_session_set_api_credentials (_tmp8_, _tmp10_, _tmp12_);
	_tmp13_ = params;
	g_hash_table_lookup_extended (_tmp13_, "AuthToken", NULL, &_tmp14_);
	_g_variant_unref0 (auth_token);
	_tmp15_ = _g_variant_ref0 ((GVariant*) _tmp14_);
	auth_token = _tmp15_;
	_tmp16_ = params;
	g_hash_table_lookup_extended (_tmp16_, "AuthTokenSecret", NULL, &_tmp17_);
	_g_variant_unref0 (auth_token_secret);
	_tmp18_ = _g_variant_ref0 ((GVariant*) _tmp17_);
	auth_token_secret = _tmp18_;
	_tmp19_ = params;
	g_hash_table_lookup_extended (_tmp19_, "Username", NULL, &_tmp20_);
	_g_variant_unref0 (username);
	_tmp21_ = _g_variant_ref0 ((GVariant*) _tmp20_);
	username = _tmp21_;
	_tmp22_ = self->priv->session;
	_tmp23_ = auth_token;
	_tmp24_ = g_variant_get_string (_tmp23_, NULL);
	_tmp25_ = auth_token_secret;
	_tmp26_ = g_variant_get_string (_tmp25_, NULL);
	_tmp27_ = username;
	_tmp28_ = g_variant_get_string (_tmp27_, NULL);
	publishing_rest_support_oauth1_session_set_access_phase_credentials (_tmp22_, _tmp24_, _tmp26_, _tmp28_);
	_tmp29_ = self->priv->parameters;
	_tmp30_ = self->priv->session;
	_tmp31_ = publishing_rest_support_oauth1_session_get_username (_tmp30_);
	_g_free0 (_tmp29_->username);
	_tmp29_->username = _tmp31_;
	publishing_flickr_flickr_publisher_do_fetch_account_info (self, NULL, NULL);
	_g_variant_unref0 (username);
	_g_variant_unref0 (auth_token_secret);
	_g_variant_unref0 (auth_token);
	_g_variant_unref0 (consumer_secret);
	_g_variant_unref0 (consumer_key);
	_g_hash_table_unref0 (params);
}

static void
publishing_flickr_flickr_publisher_on_account_info_available (PublishingFlickrFlickrPublisher* self)
{
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	if (!spit_publishing_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher))) {
		return;
	}
	g_debug ("FlickrPublishing.vala:155: EVENT: account information has become avail" \
"able");
	publishing_flickr_flickr_publisher_do_show_publishing_options_pane (self);
}

static void
_publishing_flickr_flickr_publisher_on_publishing_options_pane_publish_publishing_flickr_publishing_options_pane_publish (PublishingFlickrPublishingOptionsPane* _sender,
                                                                                                                          gboolean strip_metadata,
                                                                                                                          gpointer self)
{
	publishing_flickr_flickr_publisher_on_publishing_options_pane_publish ((PublishingFlickrFlickrPublisher*) self, strip_metadata);
}

static void
_publishing_flickr_flickr_publisher_on_publishing_options_pane_logout_publishing_flickr_publishing_options_pane_logout (PublishingFlickrPublishingOptionsPane* _sender,
                                                                                                                        gpointer self)
{
	publishing_flickr_flickr_publisher_on_publishing_options_pane_logout ((PublishingFlickrFlickrPublisher*) self);
}

static void
publishing_flickr_flickr_publisher_on_publishing_options_pane_publish (PublishingFlickrFlickrPublisher* self,
                                                                       gboolean strip_metadata)
{
	PublishingFlickrPublishingOptionsPane* _tmp0_;
	guint _tmp1_;
	PublishingFlickrPublishingOptionsPane* _tmp2_;
	guint _tmp3_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	_tmp0_ = self->priv->publishing_options_pane;
	g_signal_parse_name ("publish", PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_flickr_flickr_publisher_on_publishing_options_pane_publish_publishing_flickr_publishing_options_pane_publish, self);
	_tmp2_ = self->priv->publishing_options_pane;
	g_signal_parse_name ("logout", PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_flickr_flickr_publisher_on_publishing_options_pane_logout_publishing_flickr_publishing_options_pane_logout, self);
	if (!spit_publishing_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher))) {
		return;
	}
	g_debug ("FlickrPublishing.vala:166: EVENT: user clicked the 'Publish' button in" \
" the publishing options pane");
	publishing_flickr_flickr_publisher_do_publish (self, strip_metadata, NULL, NULL);
}

static void
publishing_flickr_flickr_publisher_on_publishing_options_pane_logout (PublishingFlickrFlickrPublisher* self)
{
	PublishingFlickrPublishingOptionsPane* _tmp0_;
	guint _tmp1_;
	PublishingFlickrPublishingOptionsPane* _tmp2_;
	guint _tmp3_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	_tmp0_ = self->priv->publishing_options_pane;
	g_signal_parse_name ("publish", PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_flickr_flickr_publisher_on_publishing_options_pane_publish_publishing_flickr_publishing_options_pane_publish, self);
	_tmp2_ = self->priv->publishing_options_pane;
	g_signal_parse_name ("logout", PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_flickr_flickr_publisher_on_publishing_options_pane_logout_publishing_flickr_publishing_options_pane_logout, self);
	if (!spit_publishing_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher))) {
		return;
	}
	g_debug ("FlickrPublishing.vala:177: EVENT: user clicked the 'Logout' button in " \
"the publishing options pane");
	publishing_flickr_flickr_publisher_do_logout (self);
}

static void
publishing_flickr_flickr_publisher_on_upload_status_updated (PublishingFlickrFlickrPublisher* self,
                                                             gint file_number,
                                                             gdouble completed_fraction)
{
	SpitPublishingProgressCallback _tmp0_;
	gpointer _tmp0__target;
	SpitPublishingProgressCallback _tmp1_;
	gpointer _tmp1__target;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	if (!spit_publishing_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher))) {
		return;
	}
	g_debug ("FlickrPublishing.vala:186: EVENT: uploader reports upload %.2f percent" \
" complete.", 100.0 * completed_fraction);
	_tmp0_ = self->priv->progress_reporter;
	_tmp0__target = self->priv->progress_reporter_target;
	_vala_assert (_tmp0_ != NULL, "progress_reporter != null");
	_tmp1_ = self->priv->progress_reporter;
	_tmp1__target = self->priv->progress_reporter_target;
	_tmp1_ (file_number, completed_fraction, _tmp1__target);
}

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

static void
publishing_flickr_flickr_publisher_do_fetch_account_info (PublishingFlickrFlickrPublisher* self,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_)
{
	PublishingFlickrFlickrPublisherDoFetchAccountInfoData* _data_;
	PublishingFlickrFlickrPublisher* _tmp0_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	_data_ = g_slice_new0 (PublishingFlickrFlickrPublisherDoFetchAccountInfoData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_flickr_flickr_publisher_do_fetch_account_info_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	publishing_flickr_flickr_publisher_do_fetch_account_info_co (_data_);
}

static void
publishing_flickr_flickr_publisher_do_fetch_account_info_finish (PublishingFlickrFlickrPublisher* self,
                                                                 GAsyncResult* _res_)
{
	PublishingFlickrFlickrPublisherDoFetchAccountInfoData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
publishing_flickr_flickr_publisher_do_fetch_account_info_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_)
{
	PublishingFlickrFlickrPublisherDoFetchAccountInfoData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_flickr_flickr_publisher_do_fetch_account_info_co (_data_);
}

static gboolean
publishing_flickr_flickr_publisher_do_fetch_account_info_co (PublishingFlickrFlickrPublisherDoFetchAccountInfoData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("FlickrPublishing.vala:194: ACTION: running network transaction to fetc" \
"h account information");
	_data_->_tmp0_ = _data_->self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp0_, TRUE);
	_data_->_tmp1_ = _data_->self->priv->host;
	spit_publishing_plugin_host_install_account_fetch_wait_pane (_data_->_tmp1_);
	_data_->_tmp2_ = _data_->self->priv->session;
	_data_->_tmp3_ = publishing_flickr_account_info_fetch_transaction_new (_data_->_tmp2_);
	_data_->txn = _data_->_tmp3_;
	{
		_data_->_state_ = 1;
		publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_flickr_flickr_publisher_do_fetch_account_info_ready, _data_);
		return FALSE;
		_state_1:
		publishing_rest_support_transaction_execute_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		g_debug ("FlickrPublishing.vala:202: EVENT: account fetch transaction response r" \
"eceived over the network");
		_data_->_tmp4_ = publishing_rest_support_transaction_get_response (G_TYPE_CHECK_INSTANCE_CAST (_data_->txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
		_data_->_tmp5_ = _data_->_tmp4_;
		publishing_flickr_flickr_publisher_do_parse_account_info_from_xml (_data_->self, _data_->_tmp5_);
		_g_free0 (_data_->_tmp5_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		g_debug ("FlickrPublishing.vala:205: EVENT: account fetch transaction caused a n" \
"etwork error");
		_data_->_tmp6_ = _data_->self->priv->host;
		_data_->_tmp7_ = _data_->err;
		spit_publishing_plugin_host_post_error (_data_->_tmp6_, _data_->_tmp7_);
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_publishing_rest_support_transaction_unref0 (_data_->txn);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_publishing_rest_support_transaction_unref0 (_data_->txn);
	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 gint64
int64_parse (const gchar* str,
             guint _base)
{
	gint64 result;
	g_return_val_if_fail (str != NULL, -1LL);
	result = g_ascii_strtoll (str, NULL, _base);
	return result;
}

static void
publishing_flickr_flickr_publisher_do_parse_account_info_from_xml (PublishingFlickrFlickrPublisher* self,
                                                                   const gchar* xml)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	g_return_if_fail (xml != NULL);
	g_debug ("FlickrPublishing.vala:211: ACTION: parsing account information from xm" \
"l = '%s'", xml);
	{
		PublishingRESTSupportXmlDocument* response_doc = NULL;
		PublishingRESTSupportXmlDocument* _tmp0_;
		xmlNode* root_node = NULL;
		PublishingRESTSupportXmlDocument* _tmp1_;
		xmlNode* _tmp2_;
		xmlNode* user_node = NULL;
		PublishingRESTSupportXmlDocument* _tmp3_;
		xmlNode* _tmp4_;
		xmlNode* _tmp5_;
		gchar* is_pro_str = NULL;
		PublishingRESTSupportXmlDocument* _tmp6_;
		xmlNode* _tmp7_;
		gchar* _tmp8_;
		gchar* max_images_str = NULL;
		PublishingRESTSupportXmlDocument* _tmp9_;
		xmlNode* _tmp10_;
		gchar* _tmp11_;
		gchar* uploaded_images_str = NULL;
		PublishingRESTSupportXmlDocument* _tmp12_;
		xmlNode* _tmp13_;
		gchar* _tmp14_;
		PublishingFlickrUserKind user_kind = 0;
		const gchar* _tmp15_;
		PublishingFlickrPublishingParameters* _tmp18_;
		const gchar* _tmp19_;
		PublishingFlickrPublishingParameters* _tmp20_;
		const gchar* _tmp21_;
		PublishingFlickrPublishingParameters* _tmp22_;
		_tmp0_ = publishing_flickr_transaction_parse_flickr_response (xml, &_inner_error0_);
		response_doc = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp1_ = response_doc;
		_tmp2_ = publishing_rest_support_xml_document_get_root_node (_tmp1_);
		root_node = _tmp2_;
		_tmp3_ = response_doc;
		_tmp4_ = root_node;
		_tmp5_ = publishing_rest_support_xml_document_get_named_child (_tmp3_, _tmp4_, "user", &_inner_error0_);
		user_node = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_publishing_rest_support_xml_document_unref0 (response_doc);
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp6_ = response_doc;
		_tmp7_ = user_node;
		_tmp8_ = publishing_rest_support_xml_document_get_property_value (_tmp6_, _tmp7_, "ispro", &_inner_error0_);
		is_pro_str = _tmp8_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_publishing_rest_support_xml_document_unref0 (response_doc);
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp9_ = response_doc;
		_tmp10_ = user_node;
		_tmp11_ = publishing_rest_support_xml_document_get_property_value (_tmp9_, _tmp10_, "upload_limit", &_inner_error0_);
		max_images_str = _tmp11_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (is_pro_str);
			_publishing_rest_support_xml_document_unref0 (response_doc);
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp12_ = response_doc;
		_tmp13_ = user_node;
		_tmp14_ = publishing_rest_support_xml_document_get_property_value (_tmp12_, _tmp13_, "upload_count", &_inner_error0_);
		uploaded_images_str = _tmp14_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (max_images_str);
			_g_free0 (is_pro_str);
			_publishing_rest_support_xml_document_unref0 (response_doc);
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp15_ = is_pro_str;
		if (g_strcmp0 (_tmp15_, "0") == 0) {
			user_kind = PUBLISHING_FLICKR_USER_KIND_FREE;
		} else {
			const gchar* _tmp16_;
			_tmp16_ = is_pro_str;
			if (g_strcmp0 (_tmp16_, "1") == 0) {
				user_kind = PUBLISHING_FLICKR_USER_KIND_PRO;
			} else {
				GError* _tmp17_;
				_tmp17_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_MALFORMED_RESPONSE, "Unable to determine if user has free or pro account");
				_inner_error0_ = _tmp17_;
				_g_free0 (uploaded_images_str);
				_g_free0 (max_images_str);
				_g_free0 (is_pro_str);
				_publishing_rest_support_xml_document_unref0 (response_doc);
				if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
					goto __catch0_spit_publishing_publishing_error;
				}
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
		_tmp18_ = self->priv->parameters;
		_tmp19_ = max_images_str;
		_tmp18_->max_images_count = int64_parse (_tmp19_, (guint) 0);
		_tmp20_ = self->priv->parameters;
		_tmp21_ = uploaded_images_str;
		_tmp20_->uploaded_images_count = (guint64) int64_parse (_tmp21_, (guint) 0);
		_tmp22_ = self->priv->parameters;
		_tmp22_->user_kind = user_kind;
		_g_free0 (uploaded_images_str);
		_g_free0 (max_images_str);
		_g_free0 (is_pro_str);
		_publishing_rest_support_xml_document_unref0 (response_doc);
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		GError* err = NULL;
		GError* _tmp23_;
		SpitPublishingPluginHost* _tmp24_;
		GError* _tmp25_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp23_ = err;
		if (g_error_matches (_tmp23_, SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_EXPIRED_SESSION)) {
			publishing_flickr_flickr_publisher_do_logout (self);
			_g_error_free0 (err);
			return;
		}
		_tmp24_ = self->priv->host;
		_tmp25_ = err;
		spit_publishing_plugin_host_post_error (_tmp24_, _tmp25_);
		_g_error_free0 (err);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	publishing_flickr_flickr_publisher_on_account_info_available (self);
}

static void
publishing_flickr_flickr_publisher_do_logout (PublishingFlickrFlickrPublisher* self)
{
	SpitPublishingAuthenticator* _tmp0_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	g_debug ("FlickrPublishing.vala:253: ACTION: logging user out, deauthenticating " \
"session, and erasing stored credentials");
	_tmp0_ = self->priv->authenticator;
	if (spit_publishing_authenticator_can_logout (_tmp0_)) {
		SpitPublishingAuthenticator* _tmp1_;
		_tmp1_ = self->priv->authenticator;
		spit_publishing_authenticator_logout (_tmp1_);
	}
	self->priv->running = FALSE;
	publishing_flickr_flickr_publisher_attempt_start (self);
}

static void
publishing_flickr_flickr_publisher_do_show_publishing_options_pane (PublishingFlickrFlickrPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp1_;
	PublishingFlickrPublishingParameters* _tmp8_;
	SpitPublishingPluginHost* _tmp9_;
	GtkBuilder* _tmp10_;
	PublishingFlickrPublishingOptionsPane* _tmp11_;
	PublishingFlickrPublishingOptionsPane* _tmp12_;
	PublishingFlickrPublishingOptionsPane* _tmp13_;
	SpitPublishingPluginHost* _tmp14_;
	PublishingFlickrPublishingOptionsPane* _tmp15_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	g_debug ("FlickrPublishing.vala:265: ACTION: displaying publishing options pane");
	_tmp0_ = self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_tmp0_, FALSE);
	_tmp1_ = gtk_builder_new ();
	builder = _tmp1_;
	{
		GtkBuilder* _tmp2_;
		_tmp2_ = builder;
		gtk_builder_add_from_resource (_tmp2_, PLUGIN_RESOURCE_PATH "/" "flickr_publishing_options_pane.ui", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		SpitPublishingPluginHost* _tmp5_;
		GError* _tmp6_;
		GError* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("FlickrPublishing.vala:277: Could not parse UI file! Error: %s.", _tmp4_);
		_tmp5_ = self->priv->host;
		_tmp6_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_LOCAL_FILE_ERROR, _ ("A file required for publishing is unavailable. Publishing to Flickr ca" \
"n’t continue."));
		_tmp7_ = _tmp6_;
		spit_publishing_plugin_host_post_error (_tmp5_, _tmp7_);
		_g_error_free0 (_tmp7_);
		_g_error_free0 (e);
		_g_object_unref0 (builder);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (builder);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp8_ = self->priv->parameters;
	_tmp9_ = self->priv->host;
	_tmp10_ = builder;
	_tmp11_ = publishing_flickr_publishing_options_pane_new (self, _tmp8_, spit_publishing_plugin_host_get_publishable_media_type (_tmp9_), _tmp10_, publishing_flickr_flickr_publisher_get_persistent_strip_metadata (self));
	_g_object_unref0 (self->priv->publishing_options_pane);
	self->priv->publishing_options_pane = _tmp11_;
	_tmp12_ = self->priv->publishing_options_pane;
	g_signal_connect_object (_tmp12_, "publish", (GCallback) _publishing_flickr_flickr_publisher_on_publishing_options_pane_publish_publishing_flickr_publishing_options_pane_publish, self, 0);
	_tmp13_ = self->priv->publishing_options_pane;
	g_signal_connect_object (_tmp13_, "logout", (GCallback) _publishing_flickr_flickr_publisher_on_publishing_options_pane_logout_publishing_flickr_publishing_options_pane_logout, self, 0);
	_tmp14_ = self->priv->host;
	_tmp15_ = self->priv->publishing_options_pane;
	spit_publishing_plugin_host_install_dialog_pane (_tmp14_, G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, SPIT_PUBLISHING_TYPE_DIALOG_PANE, SpitPublishingDialogPane), SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CANCEL);
	_g_object_unref0 (builder);
}

gint
publishing_flickr_flickr_publisher_flickr_date_time_compare_func (SpitPublishingPublishable* a,
                                                                  SpitPublishingPublishable* b)
{
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	gint _tmp4_;
	gint result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (a, SPIT_PUBLISHING_TYPE_PUBLISHABLE), -1);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (b, SPIT_PUBLISHING_TYPE_PUBLISHABLE), -1);
	_tmp0_ = spit_publishing_publishable_get_exposure_date_time (a);
	_tmp1_ = _tmp0_;
	_tmp2_ = spit_publishing_publishable_get_exposure_date_time (b);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_date_time_compare (_tmp1_, _tmp3_);
	_g_date_time_unref0 (_tmp3_);
	_g_date_time_unref0 (_tmp1_);
	result = _tmp4_;
	return result;
}

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

static void
publishing_flickr_flickr_publisher_do_publish (PublishingFlickrFlickrPublisher* self,
                                               gboolean strip_metadata,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	PublishingFlickrFlickrPublisherDoPublishData* _data_;
	PublishingFlickrFlickrPublisher* _tmp0_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	_data_ = g_slice_new0 (PublishingFlickrFlickrPublisherDoPublishData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_flickr_flickr_publisher_do_publish_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->strip_metadata = strip_metadata;
	publishing_flickr_flickr_publisher_do_publish_co (_data_);
}

static void
publishing_flickr_flickr_publisher_do_publish_finish (PublishingFlickrFlickrPublisher* self,
                                                      GAsyncResult* _res_)
{
	PublishingFlickrFlickrPublisherDoPublishData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gint
_publishing_flickr_flickr_publisher_flickr_date_time_compare_func_gcompare_data_func (gconstpointer a,
                                                                                      gconstpointer b,
                                                                                      gpointer self)
{
	gint result;
	result = publishing_flickr_flickr_publisher_flickr_date_time_compare_func ((SpitPublishingPublishable*) a, (SpitPublishingPublishable*) b);
	return result;
}

static void
_publishing_flickr_flickr_publisher_on_upload_status_updated_spit_publishing_progress_callback (gint file_number,
                                                                                                gdouble fraction_complete,
                                                                                                gpointer self)
{
	publishing_flickr_flickr_publisher_on_upload_status_updated ((PublishingFlickrFlickrPublisher*) self, file_number, fraction_complete);
}

static void
publishing_flickr_flickr_publisher_do_publish_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	PublishingFlickrFlickrPublisherDoPublishData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_flickr_flickr_publisher_do_publish_co (_data_);
}

static gboolean
publishing_flickr_flickr_publisher_do_publish_co (PublishingFlickrFlickrPublisherDoPublishData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	publishing_flickr_flickr_publisher_set_persistent_strip_metadata (_data_->self, _data_->strip_metadata);
	g_debug ("FlickrPublishing.vala:298: ACTION: uploading media items to remote ser" \
"ver.");
	_data_->_tmp0_ = _data_->self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp0_, TRUE);
	_data_->_tmp1_ = _data_->self->priv->host;
	_data_->_tmp2_ = _data_->self->priv->parameters;
	_data_->_tmp3_ = NULL;
	_data_->_tmp4_ = NULL;
	_data_->_tmp5_ = spit_publishing_plugin_host_serialize_publishables (_data_->_tmp1_, _data_->_tmp2_->photo_major_axis_size, _data_->strip_metadata, &_data_->_tmp3_, &_data_->_tmp4_);
	(_data_->self->priv->progress_reporter_target_destroy_notify == NULL) ? NULL : (_data_->self->priv->progress_reporter_target_destroy_notify (_data_->self->priv->progress_reporter_target), NULL);
	_data_->self->priv->progress_reporter = NULL;
	_data_->self->priv->progress_reporter_target = NULL;
	_data_->self->priv->progress_reporter_target_destroy_notify = NULL;
	_data_->self->priv->progress_reporter = _data_->_tmp5_;
	_data_->self->priv->progress_reporter_target = _data_->_tmp3_;
	_data_->self->priv->progress_reporter_target_destroy_notify = _data_->_tmp4_;
	if (!spit_publishing_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher))) {
		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;
	}
	_data_->_tmp6_ = _data_->self->priv->host;
	_data_->_tmp7_ = 0;
	_data_->_tmp8_ = spit_publishing_plugin_host_get_publishables (_data_->_tmp6_, &_data_->_tmp7_);
	_data_->publishables = _data_->_tmp8_;
	_data_->publishables_length1 = _data_->_tmp7_;
	_data_->_publishables_size_ = _data_->publishables_length1;
	_data_->_tmp9_ = gee_array_list_new (SPIT_PUBLISHING_TYPE_PUBLISHABLE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_data_->sorted_list = _data_->_tmp9_;
	_data_->_tmp10_ = _data_->publishables;
	_data_->_tmp10__length1 = _data_->publishables_length1;
	{
		_data_->p_collection_length1 = 0;
		_data_->_p_collection_size_ = 0;
		_data_->p_collection = _data_->_tmp10_;
		_data_->p_collection_length1 = _data_->_tmp10__length1;
		for (_data_->p_it = 0; _data_->p_it < _data_->p_collection_length1; _data_->p_it = _data_->p_it + 1) {
			_data_->_tmp11_ = _g_object_ref0 (_data_->p_collection[_data_->p_it]);
			_data_->p = _data_->_tmp11_;
			{
				_data_->_tmp12_ = _data_->sorted_list;
				_data_->_tmp13_ = _data_->p;
				gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp12_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _data_->_tmp13_);
				_g_object_unref0 (_data_->p);
			}
		}
	}
	_data_->_tmp14_ = _data_->sorted_list;
	gee_list_sort (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp14_, GEE_TYPE_LIST, GeeList), _publishing_flickr_flickr_publisher_flickr_date_time_compare_func_gcompare_data_func, NULL, NULL);
	_data_->_tmp15_ = _data_->self->priv->session;
	_data_->_tmp16_ = _data_->sorted_list;
	_data_->_tmp17_ = 0;
	_data_->_tmp18_ = gee_collection_to_array (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp16_, GEE_TYPE_COLLECTION, GeeCollection), &_data_->_tmp17_);
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp19__length1 = _data_->_tmp17_;
	_data_->_tmp20_ = _data_->self->priv->parameters;
	_data_->_tmp21_ = publishing_flickr_uploader_new (_data_->_tmp15_, _data_->_tmp19_, _data_->_tmp17_, _data_->_tmp20_, _data_->strip_metadata);
	_data_->_tmp22_ = _data_->_tmp21_;
	_data_->_tmp19_ = (_vala_array_free (_data_->_tmp19_, _data_->_tmp19__length1, (GDestroyNotify) g_object_unref), NULL);
	_data_->uploader = _data_->_tmp22_;
	{
		_data_->_tmp23_ = _data_->uploader;
		_data_->_state_ = 1;
		publishing_rest_support_batch_uploader_upload_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp23_, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader), _publishing_flickr_flickr_publisher_on_upload_status_updated_spit_publishing_progress_callback, _data_->self, publishing_flickr_flickr_publisher_do_publish_ready, _data_);
		return FALSE;
		_state_1:
		_data_->num_published = publishing_rest_support_batch_uploader_upload_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp23_, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		g_debug ("FlickrPublishing.vala:322: EVENT: uploader reports upload complete; %d" \
" items published.", _data_->num_published);
		publishing_flickr_flickr_publisher_do_show_success_pane (_data_->self);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp24_ = _data_->err;
		_data_->_tmp25_ = _data_->_tmp24_->message;
		g_debug ("FlickrPublishing.vala:325: EVENT: uploader reports upload error = '%s'" \
".", _data_->_tmp25_);
		_data_->_tmp26_ = _data_->self->priv->host;
		_data_->_tmp27_ = _data_->err;
		spit_publishing_plugin_host_post_error (_data_->_tmp26_, _data_->_tmp27_);
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_publishing_rest_support_batch_uploader_unref0 (_data_->uploader);
		_g_object_unref0 (_data_->sorted_list);
		_data_->publishables = (_vala_array_free (_data_->publishables, _data_->publishables_length1, (GDestroyNotify) g_object_unref), NULL);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_publishing_rest_support_batch_uploader_unref0 (_data_->uploader);
	_g_object_unref0 (_data_->sorted_list);
	_data_->publishables = (_vala_array_free (_data_->publishables, _data_->publishables_length1, (GDestroyNotify) g_object_unref), NULL);
	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
publishing_flickr_flickr_publisher_do_show_success_pane (PublishingFlickrFlickrPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	g_debug ("FlickrPublishing.vala:331: ACTION: showing success pane.");
	_tmp0_ = self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_tmp0_, FALSE);
	_tmp1_ = self->priv->host;
	spit_publishing_plugin_host_install_success_pane (_tmp1_);
}

gint
publishing_flickr_flickr_publisher_get_persistent_visibility (PublishingFlickrFlickrPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	gint result;
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self), -1);
	_tmp0_ = self->priv->host;
	result = spit_host_interface_get_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "visibility", 0);
	return result;
}

void
publishing_flickr_flickr_publisher_set_persistent_visibility (PublishingFlickrFlickrPublisher* self,
                                                              gint vis)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	_tmp0_ = self->priv->host;
	spit_host_interface_set_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "visibility", vis);
}

gint
publishing_flickr_flickr_publisher_get_persistent_default_size (PublishingFlickrFlickrPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	gint result;
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self), -1);
	_tmp0_ = self->priv->host;
	result = spit_host_interface_get_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "default_size", 1);
	return result;
}

void
publishing_flickr_flickr_publisher_set_persistent_default_size (PublishingFlickrFlickrPublisher* self,
                                                                gint size)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	_tmp0_ = self->priv->host;
	spit_host_interface_set_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "default_size", size);
}

static SpitPublishingService*
publishing_flickr_flickr_publisher_real_get_service (SpitPublishingPublisher* base)
{
	PublishingFlickrFlickrPublisher * self;
	SpitPublishingService* _tmp0_;
	SpitPublishingService* _tmp1_;
	SpitPublishingService* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_FLICKR_TYPE_FLICKR_PUBLISHER, PublishingFlickrFlickrPublisher);
	_tmp0_ = self->priv->service;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
publishing_flickr_flickr_publisher_real_is_running (SpitPublishingPublisher* base)
{
	PublishingFlickrFlickrPublisher * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_FLICKR_TYPE_FLICKR_PUBLISHER, PublishingFlickrFlickrPublisher);
	result = self->priv->running;
	return result;
}

static void
publishing_flickr_flickr_publisher_attempt_start (PublishingFlickrFlickrPublisher* self)
{
	SpitPublishingAuthenticator* _tmp0_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (self));
	self->priv->running = TRUE;
	self->priv->was_started = TRUE;
	_tmp0_ = self->priv->authenticator;
	spit_publishing_authenticator_authenticate (_tmp0_);
}

static void
publishing_flickr_flickr_publisher_real_start (SpitPublishingPublisher* base)
{
	PublishingFlickrFlickrPublisher * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_FLICKR_TYPE_FLICKR_PUBLISHER, PublishingFlickrFlickrPublisher);
	if (spit_publishing_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher))) {
		return;
	}
	if (self->priv->was_started) {
		g_error ("FlickrPublishing.vala:375: FlickrPublisher: start( ): can't start; thi" \
"s publisher is not restartable.");
	}
	g_debug ("FlickrPublishing.vala:377: FlickrPublisher: starting interaction.");
	publishing_flickr_flickr_publisher_attempt_start (self);
}

static void
publishing_flickr_flickr_publisher_real_stop (SpitPublishingPublisher* base)
{
	PublishingFlickrFlickrPublisher * self;
	PublishingRESTSupportOAuth1Session* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_FLICKR_TYPE_FLICKR_PUBLISHER, PublishingFlickrFlickrPublisher);
	g_debug ("FlickrPublishing.vala:383: FlickrPublisher: stop( ) invoked.");
	_tmp0_ = self->priv->session;
	if (_tmp0_ != NULL) {
		PublishingRESTSupportOAuth1Session* _tmp1_;
		_tmp1_ = self->priv->session;
		publishing_rest_support_session_stop_transactions (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession));
	}
	self->priv->running = FALSE;
}

static void
publishing_flickr_flickr_publisher_class_init (PublishingFlickrFlickrPublisherClass * klass,
                                               gpointer klass_data)
{
	publishing_flickr_flickr_publisher_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingFlickrFlickrPublisher_private_offset);
	G_OBJECT_CLASS (klass)->finalize = publishing_flickr_flickr_publisher_finalize;
}

static void
publishing_flickr_flickr_publisher_spit_publishing_publisher_interface_init (SpitPublishingPublisherIface * iface,
                                                                             gpointer iface_data)
{
	publishing_flickr_flickr_publisher_spit_publishing_publisher_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_service = (SpitPublishingService* (*) (SpitPublishingPublisher*)) publishing_flickr_flickr_publisher_real_get_service;
	iface->is_running = (gboolean (*) (SpitPublishingPublisher*)) publishing_flickr_flickr_publisher_real_is_running;
	iface->start = (void (*) (SpitPublishingPublisher*)) publishing_flickr_flickr_publisher_real_start;
	iface->stop = (void (*) (SpitPublishingPublisher*)) publishing_flickr_flickr_publisher_real_stop;
}

static void
publishing_flickr_flickr_publisher_instance_init (PublishingFlickrFlickrPublisher * self,
                                                  gpointer klass)
{
	self->priv = publishing_flickr_flickr_publisher_get_instance_private (self);
	self->priv->progress_reporter = NULL;
	self->priv->progress_reporter_target = NULL;
	self->priv->progress_reporter_target_destroy_notify = NULL;
	self->priv->running = FALSE;
	self->priv->was_started = FALSE;
	self->priv->session = NULL;
	self->priv->publishing_options_pane = NULL;
	self->priv->authenticator = NULL;
	self->priv->parameters = NULL;
}

static void
publishing_flickr_flickr_publisher_finalize (GObject * obj)
{
	PublishingFlickrFlickrPublisher * self;
	SpitPublishingAuthenticator* _tmp0_;
	guint _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_FLICKR_TYPE_FLICKR_PUBLISHER, PublishingFlickrFlickrPublisher);
	_tmp0_ = self->priv->authenticator;
	g_signal_parse_name ("authenticated", SPIT_PUBLISHING_TYPE_AUTHENTICATOR, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_flickr_flickr_publisher_on_session_authenticated_spit_publishing_authenticator_authenticated, self);
	_g_object_unref0 (self->priv->service);
	_g_object_unref0 (self->priv->host);
	(self->priv->progress_reporter_target_destroy_notify == NULL) ? NULL : (self->priv->progress_reporter_target_destroy_notify (self->priv->progress_reporter_target), NULL);
	self->priv->progress_reporter = NULL;
	self->priv->progress_reporter_target = NULL;
	self->priv->progress_reporter_target_destroy_notify = NULL;
	_publishing_rest_support_session_unref0 (self->priv->session);
	_g_object_unref0 (self->priv->publishing_options_pane);
	_g_object_unref0 (self->priv->authenticator);
	_publishing_flickr_publishing_parameters_unref0 (self->priv->parameters);
	G_OBJECT_CLASS (publishing_flickr_flickr_publisher_parent_class)->finalize (obj);
}

static GType
publishing_flickr_flickr_publisher_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingFlickrFlickrPublisherClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_flickr_flickr_publisher_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingFlickrFlickrPublisher), 0, (GInstanceInitFunc) publishing_flickr_flickr_publisher_instance_init, NULL };
	static const GInterfaceInfo spit_publishing_publisher_info = { (GInterfaceInitFunc) publishing_flickr_flickr_publisher_spit_publishing_publisher_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType publishing_flickr_flickr_publisher_type_id;
	publishing_flickr_flickr_publisher_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingFlickrFlickrPublisher", &g_define_type_info, 0);
	g_type_add_interface_static (publishing_flickr_flickr_publisher_type_id, SPIT_PUBLISHING_TYPE_PUBLISHER, &spit_publishing_publisher_info);
	PublishingFlickrFlickrPublisher_private_offset = g_type_add_instance_private (publishing_flickr_flickr_publisher_type_id, sizeof (PublishingFlickrFlickrPublisherPrivate));
	return publishing_flickr_flickr_publisher_type_id;
}

GType
publishing_flickr_flickr_publisher_get_type (void)
{
	static volatile gsize publishing_flickr_flickr_publisher_type_id__once = 0;
	if (g_once_init_enter (&publishing_flickr_flickr_publisher_type_id__once)) {
		GType publishing_flickr_flickr_publisher_type_id;
		publishing_flickr_flickr_publisher_type_id = publishing_flickr_flickr_publisher_get_type_once ();
		g_once_init_leave (&publishing_flickr_flickr_publisher_type_id__once, publishing_flickr_flickr_publisher_type_id);
	}
	return publishing_flickr_flickr_publisher_type_id__once;
}

gchar*
publishing_flickr_transaction_validate_xml (PublishingRESTSupportXmlDocument* doc)
{
	xmlNode* root = NULL;
	xmlNode* _tmp0_;
	gchar* status = NULL;
	xmlNode* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp5_;
	xmlNode* errcode = NULL;
	xmlNode* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	xmlNode* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (doc, PUBLISHING_REST_SUPPORT_TYPE_XML_DOCUMENT), NULL);
	_tmp0_ = publishing_rest_support_xml_document_get_root_node (doc);
	root = _tmp0_;
	_tmp1_ = root;
	_tmp2_ = (gchar*) xmlGetProp (_tmp1_, (xmlChar*) "stat");
	status = _tmp2_;
	_tmp3_ = status;
	if (_tmp3_ == NULL) {
		gchar* _tmp4_;
		_tmp4_ = g_strdup ("No status property in root node");
		result = _tmp4_;
		_g_free0 (status);
		return result;
	}
	_tmp5_ = status;
	if (g_strcmp0 (_tmp5_, "ok") == 0) {
		result = NULL;
		_g_free0 (status);
		return result;
	}
	{
		xmlNode* _tmp6_ = NULL;
		xmlNode* _tmp7_;
		xmlNode* _tmp8_;
		_tmp7_ = root;
		_tmp8_ = publishing_rest_support_xml_document_get_named_child (doc, _tmp7_, "err", &_inner_error0_);
		_tmp6_ = _tmp8_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			_g_free0 (status);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		errcode = _tmp6_;
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		gchar* _tmp9_;
		g_clear_error (&_inner_error0_);
		_tmp9_ = g_strdup ("No error code specified");
		result = _tmp9_;
		_g_free0 (status);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (status);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp10_ = errcode;
	_tmp11_ = (gchar*) xmlGetProp (_tmp10_, (xmlChar*) "msg");
	_tmp12_ = _tmp11_;
	_tmp13_ = errcode;
	_tmp14_ = (gchar*) xmlGetProp (_tmp13_, (xmlChar*) "code");
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strdup_printf ("%s (error code %s)", _tmp12_, _tmp15_);
	_tmp17_ = _tmp16_;
	_g_free0 (_tmp15_);
	_g_free0 (_tmp12_);
	result = _tmp17_;
	_g_free0 (status);
	return result;
}

static gchar*
_publishing_flickr_transaction_validate_xml_publishing_rest_support_xml_document_check_for_error_response (PublishingRESTSupportXmlDocument* doc,
                                                                                                           gpointer self)
{
	gchar* result;
	result = publishing_flickr_transaction_validate_xml (doc);
	return result;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

PublishingRESTSupportXmlDocument*
publishing_flickr_transaction_parse_flickr_response (const gchar* xml,
                                                     GError** error)
{
	PublishingRESTSupportXmlDocument* _result_ = NULL;
	GError* _inner_error0_ = NULL;
	PublishingRESTSupportXmlDocument* result;
	g_return_val_if_fail (xml != NULL, NULL);
	_result_ = NULL;
	{
		PublishingRESTSupportXmlDocument* _tmp0_ = NULL;
		PublishingRESTSupportXmlDocument* _tmp1_;
		PublishingRESTSupportXmlDocument* _tmp2_;
		_tmp1_ = publishing_rest_support_xml_document_parse_string (xml, _publishing_flickr_transaction_validate_xml_publishing_rest_support_xml_document_check_for_error_response, NULL, &_inner_error0_);
		_tmp0_ = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			_publishing_rest_support_xml_document_unref0 (_result_);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_publishing_rest_support_xml_document_unref0 (_result_);
		_result_ = _tmp2_;
		_publishing_rest_support_xml_document_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gboolean _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		_tmp5_ = g_strdup_printf ("(error code %s)", PUBLISHING_FLICKR_EXPIRED_SESSION_ERROR_CODE);
		_tmp6_ = _tmp5_;
		_tmp7_ = string_contains (_tmp4_, _tmp6_);
		_g_free0 (_tmp6_);
		if (_tmp7_) {
			GError* _tmp8_;
			const gchar* _tmp9_;
			GError* _tmp10_;
			_tmp8_ = e;
			_tmp9_ = _tmp8_->message;
			_tmp10_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_EXPIRED_SESSION, _tmp9_);
			_inner_error0_ = _tmp10_;
			_g_error_free0 (e);
			goto __finally0;
		} else {
			GError* _tmp11_;
			GError* _tmp12_;
			_tmp11_ = e;
			_tmp12_ = _g_error_copy0 (_tmp11_);
			_inner_error0_ = _tmp12_;
			_g_error_free0 (e);
			goto __finally0;
		}
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_publishing_rest_support_xml_document_unref0 (_result_);
			return NULL;
		} else {
			_publishing_rest_support_xml_document_unref0 (_result_);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = _result_;
	return result;
}

PublishingFlickrAccountInfoFetchTransaction*
publishing_flickr_account_info_fetch_transaction_construct (GType object_type,
                                                            PublishingRESTSupportOAuth1Session* session)
{
	PublishingFlickrAccountInfoFetchTransaction* self = NULL;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (session, PUBLISHING_REST_SUPPORT_OAUTH1_TYPE_SESSION), NULL);
	self = (PublishingFlickrAccountInfoFetchTransaction*) publishing_rest_support_oauth1_transaction_construct (object_type, session, PUBLISHING_REST_SUPPORT_HTTP_METHOD_GET);
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "method", "flickr.people.getUploadStatus");
	return self;
}

PublishingFlickrAccountInfoFetchTransaction*
publishing_flickr_account_info_fetch_transaction_new (PublishingRESTSupportOAuth1Session* session)
{
	return publishing_flickr_account_info_fetch_transaction_construct (PUBLISHING_FLICKR_TYPE_ACCOUNT_INFO_FETCH_TRANSACTION, session);
}

static void
publishing_flickr_account_info_fetch_transaction_class_init (PublishingFlickrAccountInfoFetchTransactionClass * klass,
                                                             gpointer klass_data)
{
	publishing_flickr_account_info_fetch_transaction_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_flickr_account_info_fetch_transaction_instance_init (PublishingFlickrAccountInfoFetchTransaction * self,
                                                                gpointer klass)
{
}

static GType
publishing_flickr_account_info_fetch_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingFlickrAccountInfoFetchTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_flickr_account_info_fetch_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingFlickrAccountInfoFetchTransaction), 0, (GInstanceInitFunc) publishing_flickr_account_info_fetch_transaction_instance_init, NULL };
	GType publishing_flickr_account_info_fetch_transaction_type_id;
	publishing_flickr_account_info_fetch_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_OAUTH1_TYPE_TRANSACTION, "PublishingFlickrAccountInfoFetchTransaction", &g_define_type_info, 0);
	return publishing_flickr_account_info_fetch_transaction_type_id;
}

GType
publishing_flickr_account_info_fetch_transaction_get_type (void)
{
	static volatile gsize publishing_flickr_account_info_fetch_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_flickr_account_info_fetch_transaction_type_id__once)) {
		GType publishing_flickr_account_info_fetch_transaction_type_id;
		publishing_flickr_account_info_fetch_transaction_type_id = publishing_flickr_account_info_fetch_transaction_get_type_once ();
		g_once_init_leave (&publishing_flickr_account_info_fetch_transaction_type_id__once, publishing_flickr_account_info_fetch_transaction_type_id);
	}
	return publishing_flickr_account_info_fetch_transaction_type_id__once;
}

static inline gpointer
publishing_flickr_upload_transaction_get_instance_private (PublishingFlickrUploadTransaction* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingFlickrUploadTransaction_private_offset);
}

static gpointer
_publishing_flickr_publishing_parameters_ref0 (gpointer self)
{
	return self ? publishing_flickr_publishing_parameters_ref (self) : NULL;
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

PublishingFlickrUploadTransaction*
publishing_flickr_upload_transaction_construct (GType object_type,
                                                PublishingRESTSupportOAuth1Session* session,
                                                PublishingFlickrPublishingParameters* parameters,
                                                SpitPublishingPublishable* publishable)
{
	PublishingFlickrUploadTransaction* self = NULL;
	PublishingFlickrPublishingParameters* _tmp0_;
	PublishingFlickrVisibilitySpecification* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	PublishingFlickrVisibilitySpecification* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	PublishingFlickrVisibilitySpecification* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GHashTable* disposition_table = NULL;
	GHashFunc _tmp20_;
	GEqualFunc _tmp21_;
	GHashTable* _tmp22_;
	gchar* filename = NULL;
	gchar* _tmp23_;
	gboolean _tmp24_ = FALSE;
	const gchar* _tmp25_;
	GHashTable* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	GHashTable* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	GHashTable* _tmp36_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (session, PUBLISHING_REST_SUPPORT_OAUTH1_TYPE_SESSION), NULL);
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_PARAMETERS (parameters), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (publishable, SPIT_PUBLISHING_TYPE_PUBLISHABLE), NULL);
	self = (PublishingFlickrUploadTransaction*) publishing_rest_support_oauth1_upload_transaction_construct (object_type, session, publishable, "https://up.flickr.com/services/upload");
	_tmp0_ = _publishing_flickr_publishing_parameters_ref0 (parameters);
	_publishing_flickr_publishing_parameters_unref0 (self->priv->parameters);
	self->priv->parameters = _tmp0_;
	_tmp1_ = parameters->visibility_specification;
	_tmp2_ = g_strdup_printf ("%d", _tmp1_->everyone_level);
	_tmp3_ = _tmp2_;
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "is_public", _tmp3_);
	_g_free0 (_tmp3_);
	_tmp4_ = parameters->visibility_specification;
	_tmp5_ = g_strdup_printf ("%d", _tmp4_->friends_level);
	_tmp6_ = _tmp5_;
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "is_friend", _tmp6_);
	_g_free0 (_tmp6_);
	_tmp7_ = parameters->visibility_specification;
	_tmp8_ = g_strdup_printf ("%d", _tmp7_->family_level);
	_tmp9_ = _tmp8_;
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "is_family", _tmp9_);
	_g_free0 (_tmp9_);
	if (!parameters->strip_metadata) {
		gchar* title = NULL;
		gchar* _tmp10_;
		gboolean _tmp11_ = FALSE;
		const gchar* _tmp12_;
		gchar* comment = NULL;
		gchar* _tmp15_;
		gboolean _tmp16_ = FALSE;
		const gchar* _tmp17_;
		_tmp10_ = spit_publishing_publishable_get_param_string (publishable, SPIT_PUBLISHING_PUBLISHABLE_PARAM_STRING_TITLE);
		title = _tmp10_;
		_tmp12_ = title;
		if (_tmp12_ != NULL) {
			const gchar* _tmp13_;
			_tmp13_ = title;
			_tmp11_ = g_strcmp0 (_tmp13_, "") != 0;
		} else {
			_tmp11_ = FALSE;
		}
		if (_tmp11_) {
			const gchar* _tmp14_;
			_tmp14_ = title;
			publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "title", _tmp14_);
		}
		_tmp15_ = spit_publishing_publishable_get_param_string (publishable, SPIT_PUBLISHING_PUBLISHABLE_PARAM_STRING_COMMENT);
		comment = _tmp15_;
		_tmp17_ = comment;
		if (_tmp17_ != NULL) {
			const gchar* _tmp18_;
			_tmp18_ = comment;
			_tmp16_ = g_strcmp0 (_tmp18_, "") != 0;
		} else {
			_tmp16_ = FALSE;
		}
		if (_tmp16_) {
			const gchar* _tmp19_;
			_tmp19_ = comment;
			publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "description", _tmp19_);
		}
		_g_free0 (comment);
		_g_free0 (title);
	}
	_tmp20_ = g_str_hash;
	_tmp21_ = g_str_equal;
	_tmp22_ = g_hash_table_new_full (_tmp20_, _tmp21_, _g_free0_, _g_free0_);
	disposition_table = _tmp22_;
	_tmp23_ = spit_publishing_publishable_get_publishing_name (publishable);
	filename = _tmp23_;
	_tmp25_ = filename;
	if (_tmp25_ == NULL) {
		_tmp24_ = TRUE;
	} else {
		const gchar* _tmp26_;
		_tmp26_ = filename;
		_tmp24_ = g_strcmp0 (_tmp26_, "") == 0;
	}
	if (_tmp24_) {
		gchar* _tmp27_;
		_tmp27_ = spit_publishing_publishable_get_param_string (publishable, SPIT_PUBLISHING_PUBLISHABLE_PARAM_STRING_BASENAME);
		_g_free0 (filename);
		filename = _tmp27_;
	}
	_tmp28_ = disposition_table;
	_tmp29_ = g_strdup ("filename");
	_tmp30_ = spit_publishing_publishable_get_param_string (publishable, SPIT_PUBLISHING_PUBLISHABLE_PARAM_STRING_BASENAME);
	_tmp31_ = _tmp30_;
	_tmp32_ = g_uri_escape_string (_tmp31_, NULL, TRUE);
	g_hash_table_insert (_tmp28_, _tmp29_, _tmp32_);
	_g_free0 (_tmp31_);
	_tmp33_ = disposition_table;
	_tmp34_ = g_strdup ("name");
	_tmp35_ = g_strdup ("photo");
	g_hash_table_insert (_tmp33_, _tmp34_, _tmp35_);
	_tmp36_ = disposition_table;
	publishing_rest_support_upload_transaction_set_binary_disposition_table (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_UPLOAD_TRANSACTION, PublishingRESTSupportUploadTransaction), _tmp36_);
	_g_free0 (filename);
	_g_hash_table_unref0 (disposition_table);
	return self;
}

PublishingFlickrUploadTransaction*
publishing_flickr_upload_transaction_new (PublishingRESTSupportOAuth1Session* session,
                                          PublishingFlickrPublishingParameters* parameters,
                                          SpitPublishingPublishable* publishable)
{
	return publishing_flickr_upload_transaction_construct (PUBLISHING_FLICKR_TYPE_UPLOAD_TRANSACTION, session, parameters, publishable);
}

static void
publishing_flickr_upload_transaction_real_execute_async_data_free (gpointer _data)
{
	PublishingFlickrUploadTransactionExecuteAsyncData* _data_;
	_data_ = _data;
	_publishing_rest_support_transaction_unref0 (_data_->self);
	g_slice_free (PublishingFlickrUploadTransactionExecuteAsyncData, _data_);
}

static gpointer
_publishing_rest_support_transaction_ref0 (gpointer self)
{
	return self ? publishing_rest_support_transaction_ref (self) : NULL;
}

static void
publishing_flickr_upload_transaction_real_execute_async (PublishingRESTSupportTransaction* base,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_)
{
	PublishingFlickrUploadTransaction * self;
	PublishingFlickrUploadTransactionExecuteAsyncData* _data_;
	PublishingFlickrUploadTransaction* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_FLICKR_TYPE_UPLOAD_TRANSACTION, PublishingFlickrUploadTransaction);
	_data_ = g_slice_new0 (PublishingFlickrUploadTransactionExecuteAsyncData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_flickr_upload_transaction_real_execute_async_data_free);
	_tmp0_ = _publishing_rest_support_transaction_ref0 (self);
	_data_->self = _tmp0_;
	publishing_flickr_upload_transaction_real_execute_async_co (_data_);
}

static void
publishing_flickr_upload_transaction_execute_finish (PublishingRESTSupportTransaction* base,
                                                     GAsyncResult* _res_,
                                                     GError** error)
{
	PublishingFlickrUploadTransactionExecuteAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
publishing_flickr_upload_transaction_execute_async_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_)
{
	PublishingFlickrUploadTransactionExecuteAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_flickr_upload_transaction_real_execute_async_co (_data_);
}

static gboolean
publishing_flickr_upload_transaction_real_execute_async_co (PublishingFlickrUploadTransactionExecuteAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	publishing_rest_support_oauth1_upload_transaction_authorize (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_OAUTH1_TYPE_UPLOAD_TRANSACTION, PublishingRESTSupportOAuth1UploadTransaction));
	_data_->_state_ = 1;
	PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_flickr_upload_transaction_parent_class)->execute_async (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_OAUTH1_TYPE_UPLOAD_TRANSACTION, PublishingRESTSupportOAuth1UploadTransaction), PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_flickr_upload_transaction_execute_async_ready, _data_);
	return FALSE;
	_state_1:
	PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_flickr_upload_transaction_parent_class)->execute_finish (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_OAUTH1_TYPE_UPLOAD_TRANSACTION, PublishingRESTSupportOAuth1UploadTransaction), PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_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
publishing_flickr_upload_transaction_class_init (PublishingFlickrUploadTransactionClass * klass,
                                                 gpointer klass_data)
{
	publishing_flickr_upload_transaction_parent_class = g_type_class_peek_parent (klass);
	((PublishingRESTSupportTransactionClass *) klass)->finalize = publishing_flickr_upload_transaction_finalize;
	g_type_class_adjust_private_offset (klass, &PublishingFlickrUploadTransaction_private_offset);
	((PublishingRESTSupportTransactionClass *) klass)->execute_async = (void (*) (PublishingRESTSupportTransaction*, GAsyncReadyCallback, gpointer)) publishing_flickr_upload_transaction_real_execute_async;
	((PublishingRESTSupportTransactionClass *) klass)->execute_finish = (void (*) (PublishingRESTSupportTransaction*, GAsyncResult*, GError**)) publishing_flickr_upload_transaction_execute_finish;
}

static void
publishing_flickr_upload_transaction_instance_init (PublishingFlickrUploadTransaction * self,
                                                    gpointer klass)
{
	self->priv = publishing_flickr_upload_transaction_get_instance_private (self);
}

static void
publishing_flickr_upload_transaction_finalize (PublishingRESTSupportTransaction * obj)
{
	PublishingFlickrUploadTransaction * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_FLICKR_TYPE_UPLOAD_TRANSACTION, PublishingFlickrUploadTransaction);
	_publishing_flickr_publishing_parameters_unref0 (self->priv->parameters);
	PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_flickr_upload_transaction_parent_class)->finalize (obj);
}

static GType
publishing_flickr_upload_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingFlickrUploadTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_flickr_upload_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingFlickrUploadTransaction), 0, (GInstanceInitFunc) publishing_flickr_upload_transaction_instance_init, NULL };
	GType publishing_flickr_upload_transaction_type_id;
	publishing_flickr_upload_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_OAUTH1_TYPE_UPLOAD_TRANSACTION, "PublishingFlickrUploadTransaction", &g_define_type_info, 0);
	PublishingFlickrUploadTransaction_private_offset = g_type_add_instance_private (publishing_flickr_upload_transaction_type_id, sizeof (PublishingFlickrUploadTransactionPrivate));
	return publishing_flickr_upload_transaction_type_id;
}

GType
publishing_flickr_upload_transaction_get_type (void)
{
	static volatile gsize publishing_flickr_upload_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_flickr_upload_transaction_type_id__once)) {
		GType publishing_flickr_upload_transaction_type_id;
		publishing_flickr_upload_transaction_type_id = publishing_flickr_upload_transaction_get_type_once ();
		g_once_init_leave (&publishing_flickr_upload_transaction_type_id__once, publishing_flickr_upload_transaction_type_id);
	}
	return publishing_flickr_upload_transaction_type_id__once;
}

static inline gpointer
publishing_flickr_publishing_options_pane_get_instance_private (PublishingFlickrPublishingOptionsPane* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingFlickrPublishingOptionsPane_private_offset);
}

static void
_publishing_flickr_publishing_options_pane_on_visibility_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                                        gpointer self)
{
	publishing_flickr_publishing_options_pane_on_visibility_changed ((PublishingFlickrPublishingOptionsPane*) self);
}

static void
_publishing_flickr_publishing_options_pane_on_size_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                                  gpointer self)
{
	publishing_flickr_publishing_options_pane_on_size_changed ((PublishingFlickrPublishingOptionsPane*) self);
}

static void
_publishing_flickr_publishing_options_pane_on_logout_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                 gpointer self)
{
	publishing_flickr_publishing_options_pane_on_logout_clicked ((PublishingFlickrPublishingOptionsPane*) self);
}

static void
_publishing_flickr_publishing_options_pane_on_publish_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                  gpointer self)
{
	publishing_flickr_publishing_options_pane_on_publish_clicked ((PublishingFlickrPublishingOptionsPane*) self);
}

PublishingFlickrPublishingOptionsPane*
publishing_flickr_publishing_options_pane_construct (GType object_type,
                                                     PublishingFlickrFlickrPublisher* publisher,
                                                     PublishingFlickrPublishingParameters* parameters,
                                                     SpitPublishingPublisherMediaType media_type,
                                                     GtkBuilder* builder,
                                                     gboolean strip_metadata)
{
	PublishingFlickrPublishingOptionsPane * self = NULL;
	GtkBuilder* _tmp0_;
	GSList* _tmp1_;
	GSList* _tmp2_;
	GtkBuilder* _tmp3_;
	GObject* _tmp4_;
	GtkBox* _tmp5_;
	GtkBuilder* _tmp6_;
	GObject* _tmp7_;
	GtkLabel* _tmp8_;
	GtkBuilder* _tmp9_;
	GObject* _tmp10_;
	GtkLabel* _tmp11_;
	GtkBuilder* _tmp12_;
	GObject* _tmp13_;
	GtkButton* _tmp14_;
	GtkBuilder* _tmp15_;
	GObject* _tmp16_;
	GtkButton* _tmp17_;
	GtkBuilder* _tmp18_;
	GObject* _tmp19_;
	GtkComboBoxText* _tmp20_;
	GtkBuilder* _tmp21_;
	GObject* _tmp22_;
	GtkComboBoxText* _tmp23_;
	GtkBuilder* _tmp24_;
	GObject* _tmp25_;
	GtkLabel* _tmp26_;
	GtkBuilder* _tmp27_;
	GObject* _tmp28_;
	GtkCheckButton* _tmp29_;
	SpitPublishingAuthenticator* _tmp30_;
	SpitPublishingAuthenticator* _tmp31_;
	gboolean _tmp32_;
	PublishingFlickrPublishingParameters* _tmp37_;
	PublishingFlickrFlickrPublisher* _tmp38_;
	gint _tmp39_ = 0;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry** _tmp40_;
	gint _tmp41_ = 0;
	PublishingFlickrPublishingOptionsPaneSizeEntry** _tmp42_;
	gchar* upload_label_text = NULL;
	const gchar* _tmp43_;
	gchar* _tmp44_;
	GtkLabel* _tmp53_;
	const gchar* _tmp54_;
	gchar* visibility_label_text = NULL;
	gchar* _tmp55_;
	GtkLabel* _tmp58_;
	const gchar* _tmp59_;
	GtkComboBoxText* _tmp60_;
	GtkCheckButton* _tmp64_;
	GtkButton* _tmp65_;
	GtkButton* _tmp66_;
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_FLICKR_PUBLISHER (publisher), NULL);
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_PARAMETERS (parameters), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (builder, gtk_builder_get_type ()), NULL);
	self = (PublishingFlickrPublishingOptionsPane*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (builder);
	_g_object_unref0 (self->priv->builder);
	self->priv->builder = _tmp0_;
	_vala_assert (builder != NULL, "builder != null");
	_tmp1_ = gtk_builder_get_objects (builder);
	_tmp2_ = _tmp1_;
	_vala_assert (g_slist_length (_tmp2_) > ((guint) 0), "builder.get_objects().length() > 0");
	(_tmp2_ == NULL) ? NULL : (_tmp2_ = (g_slist_free (_tmp2_), NULL));
	_tmp3_ = self->priv->builder;
	_tmp4_ = gtk_builder_get_object (_tmp3_, "flickr_pane");
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_box_get_type (), GtkBox));
	_g_object_unref0 (self->priv->pane_widget);
	self->priv->pane_widget = _tmp5_;
	_tmp6_ = self->priv->builder;
	_tmp7_ = gtk_builder_get_object (_tmp6_, "visibility_label");
	_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_label_get_type (), GtkLabel));
	_g_object_unref0 (self->priv->visibility_label);
	self->priv->visibility_label = _tmp8_;
	_tmp9_ = self->priv->builder;
	_tmp10_ = gtk_builder_get_object (_tmp9_, "upload_info_label");
	_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_label_get_type (), GtkLabel));
	_g_object_unref0 (self->priv->upload_info_label);
	self->priv->upload_info_label = _tmp11_;
	_tmp12_ = self->priv->builder;
	_tmp13_ = gtk_builder_get_object (_tmp12_, "logout_button");
	_tmp14_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_button_get_type (), GtkButton));
	_g_object_unref0 (self->priv->logout_button);
	self->priv->logout_button = _tmp14_;
	_tmp15_ = self->priv->builder;
	_tmp16_ = gtk_builder_get_object (_tmp15_, "publish_button");
	_tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_button_get_type (), GtkButton));
	_g_object_unref0 (self->priv->publish_button);
	self->priv->publish_button = _tmp17_;
	_tmp18_ = self->priv->builder;
	_tmp19_ = gtk_builder_get_object (_tmp18_, "visibility_combo");
	_tmp20_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_combo_box_text_get_type (), GtkComboBoxText));
	_g_object_unref0 (self->priv->visibility_combo);
	self->priv->visibility_combo = _tmp20_;
	_tmp21_ = self->priv->builder;
	_tmp22_ = gtk_builder_get_object (_tmp21_, "size_combo");
	_tmp23_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_combo_box_text_get_type (), GtkComboBoxText));
	_g_object_unref0 (self->priv->size_combo);
	self->priv->size_combo = _tmp23_;
	_tmp24_ = self->priv->builder;
	_tmp25_ = gtk_builder_get_object (_tmp24_, "size_label");
	_tmp26_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_label_get_type (), GtkLabel));
	_g_object_unref0 (self->priv->size_label);
	self->priv->size_label = _tmp26_;
	_tmp27_ = self->priv->builder;
	_tmp28_ = gtk_builder_get_object (_tmp27_, "strip_metadata_check");
	_tmp29_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, gtk_check_button_get_type (), GtkCheckButton));
	_g_object_unref0 (self->priv->strip_metadata_check);
	self->priv->strip_metadata_check = _tmp29_;
	_tmp30_ = publishing_flickr_flickr_publisher_get_authenticator (publisher);
	_tmp31_ = _tmp30_;
	_tmp32_ = !spit_publishing_authenticator_can_logout (_tmp31_);
	_g_object_unref0 (_tmp31_);
	if (_tmp32_) {
		GtkButton* _tmp33_;
		GtkContainer* _tmp34_;
		GtkContainer* _tmp35_;
		GtkButton* _tmp36_;
		_tmp33_ = self->priv->logout_button;
		_tmp34_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_widget_get_type (), GtkWidget));
		_tmp35_ = _tmp34_;
		_tmp36_ = self->priv->logout_button;
		gtk_container_remove (_tmp35_, G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, gtk_widget_get_type (), GtkWidget));
	}
	_tmp37_ = _publishing_flickr_publishing_parameters_ref0 (parameters);
	_publishing_flickr_publishing_parameters_unref0 (self->priv->parameters);
	self->priv->parameters = _tmp37_;
	_tmp38_ = _g_object_ref0 (publisher);
	_g_object_unref0 (self->priv->publisher);
	self->priv->publisher = _tmp38_;
	self->priv->media_type = media_type;
	_tmp40_ = publishing_flickr_publishing_options_pane_create_visibilities (self, &_tmp39_);
	self->priv->visibilities = (_vala_array_free (self->priv->visibilities, self->priv->visibilities_length1, (GDestroyNotify) publishing_flickr_publishing_options_pane_visibility_entry_unref), NULL);
	self->priv->visibilities = _tmp40_;
	self->priv->visibilities_length1 = _tmp39_;
	self->priv->_visibilities_size_ = self->priv->visibilities_length1;
	_tmp42_ = publishing_flickr_publishing_options_pane_create_sizes (self, &_tmp41_);
	self->priv->sizes = (_vala_array_free (self->priv->sizes, self->priv->sizes_length1, (GDestroyNotify) publishing_flickr_publishing_options_pane_size_entry_unref), NULL);
	self->priv->sizes = _tmp42_;
	self->priv->sizes_length1 = _tmp41_;
	self->priv->_sizes_size_ = self->priv->sizes_length1;
	_tmp43_ = parameters->username;
	_tmp44_ = g_strdup_printf (_ ("You are logged into Flickr as %s.\n\n"), _tmp43_);
	upload_label_text = _tmp44_;
	if (parameters->user_kind == PUBLISHING_FLICKR_USER_KIND_FREE) {
		const gchar* _tmp45_;
		gchar* _tmp46_;
		gchar* _tmp47_;
		gchar* _tmp48_;
		_tmp45_ = upload_label_text;
		_tmp46_ = g_strdup_printf (_ ("Your free Flickr account limits how many photos you can upload to the " \
"service.\n" \
"You have uploaded %llu out of your %lld file limit."), parameters->uploaded_images_count, parameters->max_images_count);
		_tmp47_ = _tmp46_;
		_tmp48_ = g_strconcat (_tmp45_, _tmp47_, NULL);
		_g_free0 (upload_label_text);
		upload_label_text = _tmp48_;
		_g_free0 (_tmp47_);
	} else {
		const gchar* _tmp49_;
		gchar* _tmp50_;
		gchar* _tmp51_;
		gchar* _tmp52_;
		_tmp49_ = upload_label_text;
		_tmp50_ = g_strdup_printf (ngettext ("Your Flickr Pro account entitles you to unlimited uploads. You have cu" \
"rrently uploaded a file", "Your Flickr Pro account entitles you to unlimited uploads. You have cu" \
"rrently uploaded %d files", (gulong) ((gint) parameters->uploaded_images_count)), (gint) parameters->uploaded_images_count);
		_tmp51_ = _tmp50_;
		_tmp52_ = g_strconcat (_tmp49_, _tmp51_, NULL);
		_g_free0 (upload_label_text);
		upload_label_text = _tmp52_;
		_g_free0 (_tmp51_);
	}
	_tmp53_ = self->priv->upload_info_label;
	_tmp54_ = upload_label_text;
	gtk_label_set_label (_tmp53_, _tmp54_);
	_tmp55_ = g_strdup (_ ("Photos _visible to"));
	visibility_label_text = _tmp55_;
	if (media_type == SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_VIDEO) {
		gchar* _tmp56_;
		_tmp56_ = g_strdup (_ ("Videos _visible to"));
		_g_free0 (visibility_label_text);
		visibility_label_text = _tmp56_;
	} else {
		if (media_type == (SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_PHOTO | SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_VIDEO)) {
			gchar* _tmp57_;
			_tmp57_ = g_strdup (_ ("Photos and videos _visible to"));
			_g_free0 (visibility_label_text);
			visibility_label_text = _tmp57_;
		}
	}
	_tmp58_ = self->priv->visibility_label;
	_tmp59_ = visibility_label_text;
	gtk_label_set_label (_tmp58_, _tmp59_);
	publishing_flickr_publishing_options_pane_populate_visibility_combo (self);
	_tmp60_ = self->priv->visibility_combo;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _publishing_flickr_publishing_options_pane_on_visibility_changed_gtk_combo_box_changed, self, 0);
	if (media_type != SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_VIDEO) {
		GtkComboBoxText* _tmp61_;
		publishing_flickr_publishing_options_pane_populate_size_combo (self);
		_tmp61_ = self->priv->size_combo;
		g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp61_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _publishing_flickr_publishing_options_pane_on_size_changed_gtk_combo_box_changed, self, 0);
	} else {
		GtkComboBoxText* _tmp62_;
		GtkLabel* _tmp63_;
		_tmp62_ = self->priv->size_combo;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_widget_get_type (), GtkWidget), FALSE);
		_tmp63_ = self->priv->size_label;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, gtk_widget_get_type (), GtkWidget), FALSE);
	}
	_tmp64_ = self->priv->strip_metadata_check;
	gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, gtk_toggle_button_get_type (), GtkToggleButton), strip_metadata);
	_tmp65_ = self->priv->logout_button;
	g_signal_connect_object (_tmp65_, "clicked", (GCallback) _publishing_flickr_publishing_options_pane_on_logout_clicked_gtk_button_clicked, self, 0);
	_tmp66_ = self->priv->publish_button;
	g_signal_connect_object (_tmp66_, "clicked", (GCallback) _publishing_flickr_publishing_options_pane_on_publish_clicked_gtk_button_clicked, self, 0);
	_g_free0 (visibility_label_text);
	_g_free0 (upload_label_text);
	return self;
}

PublishingFlickrPublishingOptionsPane*
publishing_flickr_publishing_options_pane_new (PublishingFlickrFlickrPublisher* publisher,
                                               PublishingFlickrPublishingParameters* parameters,
                                               SpitPublishingPublisherMediaType media_type,
                                               GtkBuilder* builder,
                                               gboolean strip_metadata)
{
	return publishing_flickr_publishing_options_pane_construct (PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, publisher, parameters, media_type, builder, strip_metadata);
}

static void
publishing_flickr_publishing_options_pane_on_logout_clicked (PublishingFlickrPublishingOptionsPane* self)
{
	g_return_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE (self));
	g_signal_emit (self, publishing_flickr_publishing_options_pane_signals[PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_LOGOUT_SIGNAL], 0);
}

static gpointer
_publishing_flickr_visibility_specification_ref0 (gpointer self)
{
	return self ? publishing_flickr_visibility_specification_ref (self) : NULL;
}

static void
publishing_flickr_publishing_options_pane_on_publish_clicked (PublishingFlickrPublishingOptionsPane* self)
{
	PublishingFlickrPublishingParameters* _tmp0_;
	GtkCheckButton* _tmp1_;
	PublishingFlickrPublishingParameters* _tmp2_;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry** _tmp3_;
	gint _tmp3__length1;
	GtkComboBoxText* _tmp4_;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry* _tmp5_;
	PublishingFlickrVisibilitySpecification* _tmp6_;
	PublishingFlickrVisibilitySpecification* _tmp7_;
	GtkCheckButton* _tmp12_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->parameters;
	_tmp1_ = self->priv->strip_metadata_check;
	_tmp0_->strip_metadata = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_toggle_button_get_type (), GtkToggleButton));
	_tmp2_ = self->priv->parameters;
	_tmp3_ = self->priv->visibilities;
	_tmp3__length1 = self->priv->visibilities_length1;
	_tmp4_ = self->priv->visibility_combo;
	_tmp5_ = _tmp3_[gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_combo_box_get_type (), GtkComboBox))];
	_tmp6_ = _tmp5_->specification;
	_tmp7_ = _publishing_flickr_visibility_specification_ref0 (_tmp6_);
	_publishing_flickr_visibility_specification_unref0 (_tmp2_->visibility_specification);
	_tmp2_->visibility_specification = _tmp7_;
	if ((self->priv->media_type & SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_PHOTO) != 0) {
		PublishingFlickrPublishingParameters* _tmp8_;
		PublishingFlickrPublishingOptionsPaneSizeEntry** _tmp9_;
		gint _tmp9__length1;
		GtkComboBoxText* _tmp10_;
		PublishingFlickrPublishingOptionsPaneSizeEntry* _tmp11_;
		_tmp8_ = self->priv->parameters;
		_tmp9_ = self->priv->sizes;
		_tmp9__length1 = self->priv->sizes_length1;
		_tmp10_ = self->priv->size_combo;
		_tmp11_ = _tmp9_[gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_combo_box_get_type (), GtkComboBox))];
		_tmp8_->photo_major_axis_size = _tmp11_->size;
	}
	_tmp12_ = self->priv->strip_metadata_check;
	g_signal_emit (self, publishing_flickr_publishing_options_pane_signals[PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_PUBLISH_SIGNAL], 0, gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_toggle_button_get_type (), GtkToggleButton)));
}

static void
_vala_array_add6 (PublishingFlickrPublishingOptionsPaneVisibilityEntry** * array,
                  gint* length,
                  gint* size,
                  PublishingFlickrPublishingOptionsPaneVisibilityEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingFlickrPublishingOptionsPaneVisibilityEntry*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add7 (PublishingFlickrPublishingOptionsPaneVisibilityEntry** * array,
                  gint* length,
                  gint* size,
                  PublishingFlickrPublishingOptionsPaneVisibilityEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingFlickrPublishingOptionsPaneVisibilityEntry*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add8 (PublishingFlickrPublishingOptionsPaneVisibilityEntry** * array,
                  gint* length,
                  gint* size,
                  PublishingFlickrPublishingOptionsPaneVisibilityEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingFlickrPublishingOptionsPaneVisibilityEntry*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add9 (PublishingFlickrPublishingOptionsPaneVisibilityEntry** * array,
                  gint* length,
                  gint* size,
                  PublishingFlickrPublishingOptionsPaneVisibilityEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingFlickrPublishingOptionsPaneVisibilityEntry*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add10 (PublishingFlickrPublishingOptionsPaneVisibilityEntry** * array,
                   gint* length,
                   gint* size,
                   PublishingFlickrPublishingOptionsPaneVisibilityEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingFlickrPublishingOptionsPaneVisibilityEntry*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static PublishingFlickrPublishingOptionsPaneVisibilityEntry**
publishing_flickr_publishing_options_pane_create_visibilities (PublishingFlickrPublishingOptionsPane* self,
                                                               gint* result_length1)
{
	PublishingFlickrPublishingOptionsPaneVisibilityEntry** _result_ = NULL;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry** _tmp0_;
	gint _result__length1;
	gint __result__size_;
	PublishingFlickrVisibilitySpecification* _tmp1_;
	PublishingFlickrVisibilitySpecification* _tmp2_;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry* _tmp3_;
	PublishingFlickrVisibilitySpecification* _tmp4_;
	PublishingFlickrVisibilitySpecification* _tmp5_;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry* _tmp6_;
	PublishingFlickrVisibilitySpecification* _tmp7_;
	PublishingFlickrVisibilitySpecification* _tmp8_;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry* _tmp9_;
	PublishingFlickrVisibilitySpecification* _tmp10_;
	PublishingFlickrVisibilitySpecification* _tmp11_;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry* _tmp12_;
	PublishingFlickrVisibilitySpecification* _tmp13_;
	PublishingFlickrVisibilitySpecification* _tmp14_;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry* _tmp15_;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry** _tmp16_;
	gint _tmp16__length1;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry** result;
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE (self), NULL);
	_tmp0_ = g_new0 (PublishingFlickrPublishingOptionsPaneVisibilityEntry*, 0 + 1);
	_result_ = _tmp0_;
	_result__length1 = 0;
	__result__size_ = _result__length1;
	_tmp1_ = publishing_flickr_visibility_specification_new (1, 1, 1);
	_tmp2_ = _tmp1_;
	_tmp3_ = publishing_flickr_publishing_options_pane_visibility_entry_new (_ ("Everyone"), _tmp2_);
	_vala_array_add6 (&_result_, &_result__length1, &__result__size_, _tmp3_);
	_publishing_flickr_visibility_specification_unref0 (_tmp2_);
	_tmp4_ = publishing_flickr_visibility_specification_new (1, 1, 0);
	_tmp5_ = _tmp4_;
	_tmp6_ = publishing_flickr_publishing_options_pane_visibility_entry_new (_ ("Friends & family only"), _tmp5_);
	_vala_array_add7 (&_result_, &_result__length1, &__result__size_, _tmp6_);
	_publishing_flickr_visibility_specification_unref0 (_tmp5_);
	_tmp7_ = publishing_flickr_visibility_specification_new (0, 1, 0);
	_tmp8_ = _tmp7_;
	_tmp9_ = publishing_flickr_publishing_options_pane_visibility_entry_new (_ ("Family only"), _tmp8_);
	_vala_array_add8 (&_result_, &_result__length1, &__result__size_, _tmp9_);
	_publishing_flickr_visibility_specification_unref0 (_tmp8_);
	_tmp10_ = publishing_flickr_visibility_specification_new (1, 0, 0);
	_tmp11_ = _tmp10_;
	_tmp12_ = publishing_flickr_publishing_options_pane_visibility_entry_new (_ ("Friends only"), _tmp11_);
	_vala_array_add9 (&_result_, &_result__length1, &__result__size_, _tmp12_);
	_publishing_flickr_visibility_specification_unref0 (_tmp11_);
	_tmp13_ = publishing_flickr_visibility_specification_new (0, 0, 0);
	_tmp14_ = _tmp13_;
	_tmp15_ = publishing_flickr_publishing_options_pane_visibility_entry_new (_ ("Just me"), _tmp14_);
	_vala_array_add10 (&_result_, &_result__length1, &__result__size_, _tmp15_);
	_publishing_flickr_visibility_specification_unref0 (_tmp14_);
	_tmp16_ = _result_;
	_tmp16__length1 = _result__length1;
	if (result_length1) {
		*result_length1 = _tmp16__length1;
	}
	result = _tmp16_;
	return result;
}

static gpointer
_publishing_flickr_publishing_options_pane_visibility_entry_ref0 (gpointer self)
{
	return self ? publishing_flickr_publishing_options_pane_visibility_entry_ref (self) : NULL;
}

static void
publishing_flickr_publishing_options_pane_populate_visibility_combo (PublishingFlickrPublishingOptionsPane* self)
{
	PublishingFlickrPublishingOptionsPaneVisibilityEntry** _tmp0_;
	gint _tmp0__length1;
	PublishingFlickrPublishingOptionsPaneVisibilityEntry** _tmp3_;
	gint _tmp3__length1;
	GtkComboBoxText* _tmp8_;
	PublishingFlickrFlickrPublisher* _tmp9_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->visibilities;
	_tmp0__length1 = self->priv->visibilities_length1;
	if (_tmp0_ == NULL) {
		gint _tmp1_ = 0;
		PublishingFlickrPublishingOptionsPaneVisibilityEntry** _tmp2_;
		_tmp2_ = publishing_flickr_publishing_options_pane_create_visibilities (self, &_tmp1_);
		self->priv->visibilities = (_vala_array_free (self->priv->visibilities, self->priv->visibilities_length1, (GDestroyNotify) publishing_flickr_publishing_options_pane_visibility_entry_unref), NULL);
		self->priv->visibilities = _tmp2_;
		self->priv->visibilities_length1 = _tmp1_;
		self->priv->_visibilities_size_ = self->priv->visibilities_length1;
	}
	_tmp3_ = self->priv->visibilities;
	_tmp3__length1 = self->priv->visibilities_length1;
	{
		PublishingFlickrPublishingOptionsPaneVisibilityEntry** v_collection = NULL;
		gint v_collection_length1 = 0;
		gint _v_collection_size_ = 0;
		gint v_it = 0;
		v_collection = _tmp3_;
		v_collection_length1 = _tmp3__length1;
		for (v_it = 0; v_it < v_collection_length1; v_it = v_it + 1) {
			PublishingFlickrPublishingOptionsPaneVisibilityEntry* _tmp4_;
			PublishingFlickrPublishingOptionsPaneVisibilityEntry* v = NULL;
			_tmp4_ = _publishing_flickr_publishing_options_pane_visibility_entry_ref0 (v_collection[v_it]);
			v = _tmp4_;
			{
				GtkComboBoxText* _tmp5_;
				PublishingFlickrPublishingOptionsPaneVisibilityEntry* _tmp6_;
				const gchar* _tmp7_;
				_tmp5_ = self->priv->visibility_combo;
				_tmp6_ = v;
				_tmp7_ = _tmp6_->title;
				gtk_combo_box_text_append_text (_tmp5_, _tmp7_);
				_publishing_flickr_publishing_options_pane_visibility_entry_unref0 (v);
			}
		}
	}
	_tmp8_ = self->priv->visibility_combo;
	_tmp9_ = self->priv->publisher;
	gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_combo_box_get_type (), GtkComboBox), publishing_flickr_flickr_publisher_get_persistent_visibility (_tmp9_));
}

static void
_vala_array_add11 (PublishingFlickrPublishingOptionsPaneSizeEntry** * array,
                   gint* length,
                   gint* size,
                   PublishingFlickrPublishingOptionsPaneSizeEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingFlickrPublishingOptionsPaneSizeEntry*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add12 (PublishingFlickrPublishingOptionsPaneSizeEntry** * array,
                   gint* length,
                   gint* size,
                   PublishingFlickrPublishingOptionsPaneSizeEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingFlickrPublishingOptionsPaneSizeEntry*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add13 (PublishingFlickrPublishingOptionsPaneSizeEntry** * array,
                   gint* length,
                   gint* size,
                   PublishingFlickrPublishingOptionsPaneSizeEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingFlickrPublishingOptionsPaneSizeEntry*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add14 (PublishingFlickrPublishingOptionsPaneSizeEntry** * array,
                   gint* length,
                   gint* size,
                   PublishingFlickrPublishingOptionsPaneSizeEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingFlickrPublishingOptionsPaneSizeEntry*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add15 (PublishingFlickrPublishingOptionsPaneSizeEntry** * array,
                   gint* length,
                   gint* size,
                   PublishingFlickrPublishingOptionsPaneSizeEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingFlickrPublishingOptionsPaneSizeEntry*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static PublishingFlickrPublishingOptionsPaneSizeEntry**
publishing_flickr_publishing_options_pane_create_sizes (PublishingFlickrPublishingOptionsPane* self,
                                                        gint* result_length1)
{
	PublishingFlickrPublishingOptionsPaneSizeEntry** _result_ = NULL;
	PublishingFlickrPublishingOptionsPaneSizeEntry** _tmp0_;
	gint _result__length1;
	gint __result__size_;
	PublishingFlickrPublishingOptionsPaneSizeEntry* _tmp1_;
	PublishingFlickrPublishingOptionsPaneSizeEntry* _tmp2_;
	PublishingFlickrPublishingOptionsPaneSizeEntry* _tmp3_;
	PublishingFlickrPublishingOptionsPaneSizeEntry* _tmp4_;
	PublishingFlickrPublishingOptionsPaneSizeEntry* _tmp5_;
	PublishingFlickrPublishingOptionsPaneSizeEntry** _tmp6_;
	gint _tmp6__length1;
	PublishingFlickrPublishingOptionsPaneSizeEntry** result;
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE (self), NULL);
	_tmp0_ = g_new0 (PublishingFlickrPublishingOptionsPaneSizeEntry*, 0 + 1);
	_result_ = _tmp0_;
	_result__length1 = 0;
	__result__size_ = _result__length1;
	_tmp1_ = publishing_flickr_publishing_options_pane_size_entry_new (_ ("500 × 375 pixels"), 500);
	_vala_array_add11 (&_result_, &_result__length1, &__result__size_, _tmp1_);
	_tmp2_ = publishing_flickr_publishing_options_pane_size_entry_new (_ ("1024 × 768 pixels"), 1024);
	_vala_array_add12 (&_result_, &_result__length1, &__result__size_, _tmp2_);
	_tmp3_ = publishing_flickr_publishing_options_pane_size_entry_new (_ ("2048 × 1536 pixels"), 2048);
	_vala_array_add13 (&_result_, &_result__length1, &__result__size_, _tmp3_);
	_tmp4_ = publishing_flickr_publishing_options_pane_size_entry_new (_ ("4096 × 3072 pixels"), 4096);
	_vala_array_add14 (&_result_, &_result__length1, &__result__size_, _tmp4_);
	_tmp5_ = publishing_flickr_publishing_options_pane_size_entry_new (_ ("Original size"), PUBLISHING_FLICKR_ORIGINAL_SIZE);
	_vala_array_add15 (&_result_, &_result__length1, &__result__size_, _tmp5_);
	_tmp6_ = _result_;
	_tmp6__length1 = _result__length1;
	if (result_length1) {
		*result_length1 = _tmp6__length1;
	}
	result = _tmp6_;
	return result;
}

static gpointer
_publishing_flickr_publishing_options_pane_size_entry_ref0 (gpointer self)
{
	return self ? publishing_flickr_publishing_options_pane_size_entry_ref (self) : NULL;
}

static void
publishing_flickr_publishing_options_pane_populate_size_combo (PublishingFlickrPublishingOptionsPane* self)
{
	PublishingFlickrPublishingOptionsPaneSizeEntry** _tmp0_;
	gint _tmp0__length1;
	PublishingFlickrPublishingOptionsPaneSizeEntry** _tmp3_;
	gint _tmp3__length1;
	GtkComboBoxText* _tmp8_;
	PublishingFlickrFlickrPublisher* _tmp9_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->sizes;
	_tmp0__length1 = self->priv->sizes_length1;
	if (_tmp0_ == NULL) {
		gint _tmp1_ = 0;
		PublishingFlickrPublishingOptionsPaneSizeEntry** _tmp2_;
		_tmp2_ = publishing_flickr_publishing_options_pane_create_sizes (self, &_tmp1_);
		self->priv->sizes = (_vala_array_free (self->priv->sizes, self->priv->sizes_length1, (GDestroyNotify) publishing_flickr_publishing_options_pane_size_entry_unref), NULL);
		self->priv->sizes = _tmp2_;
		self->priv->sizes_length1 = _tmp1_;
		self->priv->_sizes_size_ = self->priv->sizes_length1;
	}
	_tmp3_ = self->priv->sizes;
	_tmp3__length1 = self->priv->sizes_length1;
	{
		PublishingFlickrPublishingOptionsPaneSizeEntry** e_collection = NULL;
		gint e_collection_length1 = 0;
		gint _e_collection_size_ = 0;
		gint e_it = 0;
		e_collection = _tmp3_;
		e_collection_length1 = _tmp3__length1;
		for (e_it = 0; e_it < e_collection_length1; e_it = e_it + 1) {
			PublishingFlickrPublishingOptionsPaneSizeEntry* _tmp4_;
			PublishingFlickrPublishingOptionsPaneSizeEntry* e = NULL;
			_tmp4_ = _publishing_flickr_publishing_options_pane_size_entry_ref0 (e_collection[e_it]);
			e = _tmp4_;
			{
				GtkComboBoxText* _tmp5_;
				PublishingFlickrPublishingOptionsPaneSizeEntry* _tmp6_;
				const gchar* _tmp7_;
				_tmp5_ = self->priv->size_combo;
				_tmp6_ = e;
				_tmp7_ = _tmp6_->title;
				gtk_combo_box_text_append_text (_tmp5_, _tmp7_);
				_publishing_flickr_publishing_options_pane_size_entry_unref0 (e);
			}
		}
	}
	_tmp8_ = self->priv->size_combo;
	_tmp9_ = self->priv->publisher;
	gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_combo_box_get_type (), GtkComboBox), publishing_flickr_flickr_publisher_get_persistent_default_size (_tmp9_));
}

static void
publishing_flickr_publishing_options_pane_on_size_changed (PublishingFlickrPublishingOptionsPane* self)
{
	PublishingFlickrFlickrPublisher* _tmp0_;
	GtkComboBoxText* _tmp1_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->publisher;
	_tmp1_ = self->priv->size_combo;
	publishing_flickr_flickr_publisher_set_persistent_default_size (_tmp0_, gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_combo_box_get_type (), GtkComboBox)));
}

static void
publishing_flickr_publishing_options_pane_on_visibility_changed (PublishingFlickrPublishingOptionsPane* self)
{
	PublishingFlickrFlickrPublisher* _tmp0_;
	GtkComboBoxText* _tmp1_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->publisher;
	_tmp1_ = self->priv->visibility_combo;
	publishing_flickr_flickr_publisher_set_persistent_visibility (_tmp0_, gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_combo_box_get_type (), GtkComboBox)));
}

void
publishing_flickr_publishing_options_pane_notify_publish (PublishingFlickrPublishingOptionsPane* self)
{
	GtkCheckButton* _tmp0_;
	g_return_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->strip_metadata_check;
	g_signal_emit (self, publishing_flickr_publishing_options_pane_signals[PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_PUBLISH_SIGNAL], 0, gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_toggle_button_get_type (), GtkToggleButton)));
}

void
publishing_flickr_publishing_options_pane_notify_logout (PublishingFlickrPublishingOptionsPane* self)
{
	g_return_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_OPTIONS_PANE (self));
	g_signal_emit (self, publishing_flickr_publishing_options_pane_signals[PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_LOGOUT_SIGNAL], 0);
}

static GtkWidget*
publishing_flickr_publishing_options_pane_real_get_widget (SpitPublishingDialogPane* base)
{
	PublishingFlickrPublishingOptionsPane * self;
	GtkBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, PublishingFlickrPublishingOptionsPane);
	_tmp0_ = self->priv->pane_widget;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
	result = _tmp1_;
	return result;
}

static SpitPublishingDialogPaneGeometryOptions
publishing_flickr_publishing_options_pane_real_get_preferred_geometry (SpitPublishingDialogPane* base)
{
	PublishingFlickrPublishingOptionsPane * self;
	SpitPublishingDialogPaneGeometryOptions result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, PublishingFlickrPublishingOptionsPane);
	result = SPIT_PUBLISHING_DIALOG_PANE_GEOMETRY_OPTIONS_NONE;
	return result;
}

static void
_publishing_flickr_publishing_options_pane_notify_publish_publishing_flickr_publishing_options_pane_publish (PublishingFlickrPublishingOptionsPane* _sender,
                                                                                                             gboolean strip_metadata,
                                                                                                             gpointer self)
{
	publishing_flickr_publishing_options_pane_notify_publish ((PublishingFlickrPublishingOptionsPane*) self);
}

static void
_publishing_flickr_publishing_options_pane_notify_logout_publishing_flickr_publishing_options_pane_logout (PublishingFlickrPublishingOptionsPane* _sender,
                                                                                                           gpointer self)
{
	publishing_flickr_publishing_options_pane_notify_logout ((PublishingFlickrPublishingOptionsPane*) self);
}

static void
publishing_flickr_publishing_options_pane_real_on_pane_installed (SpitPublishingDialogPane* base)
{
	PublishingFlickrPublishingOptionsPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, PublishingFlickrPublishingOptionsPane);
	g_signal_connect_object (self, "publish", (GCallback) _publishing_flickr_publishing_options_pane_notify_publish_publishing_flickr_publishing_options_pane_publish, self, 0);
	g_signal_connect_object (self, "logout", (GCallback) _publishing_flickr_publishing_options_pane_notify_logout_publishing_flickr_publishing_options_pane_logout, self, 0);
}

static void
publishing_flickr_publishing_options_pane_real_on_pane_uninstalled (SpitPublishingDialogPane* base)
{
	PublishingFlickrPublishingOptionsPane * self;
	guint _tmp0_;
	guint _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, PublishingFlickrPublishingOptionsPane);
	g_signal_parse_name ("publish", PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, &_tmp0_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _publishing_flickr_publishing_options_pane_notify_publish_publishing_flickr_publishing_options_pane_publish, self);
	g_signal_parse_name ("logout", PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_flickr_publishing_options_pane_notify_logout_publishing_flickr_publishing_options_pane_logout, self);
}

static PublishingFlickrPublishingOptionsPaneSizeEntry*
publishing_flickr_publishing_options_pane_size_entry_construct (GType object_type,
                                                                const gchar* creator_title,
                                                                gint creator_size)
{
	PublishingFlickrPublishingOptionsPaneSizeEntry* self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (creator_title != NULL, NULL);
	self = (PublishingFlickrPublishingOptionsPaneSizeEntry*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup (creator_title);
	_g_free0 (self->title);
	self->title = _tmp0_;
	self->size = creator_size;
	return self;
}

static PublishingFlickrPublishingOptionsPaneSizeEntry*
publishing_flickr_publishing_options_pane_size_entry_new (const gchar* creator_title,
                                                          gint creator_size)
{
	return publishing_flickr_publishing_options_pane_size_entry_construct (PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY, creator_title, creator_size);
}

static void
publishing_flickr_publishing_options_pane_value_size_entry_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
publishing_flickr_publishing_options_pane_value_size_entry_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		publishing_flickr_publishing_options_pane_size_entry_unref (value->data[0].v_pointer);
	}
}

static void
publishing_flickr_publishing_options_pane_value_size_entry_copy_value (const GValue* src_value,
                                                                       GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = publishing_flickr_publishing_options_pane_size_entry_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
publishing_flickr_publishing_options_pane_value_size_entry_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
publishing_flickr_publishing_options_pane_value_size_entry_collect_value (GValue* value,
                                                                          guint n_collect_values,
                                                                          GTypeCValue* collect_values,
                                                                          guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		PublishingFlickrPublishingOptionsPaneSizeEntry * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = publishing_flickr_publishing_options_pane_size_entry_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
publishing_flickr_publishing_options_pane_value_size_entry_lcopy_value (const GValue* value,
                                                                        guint n_collect_values,
                                                                        GTypeCValue* collect_values,
                                                                        guint collect_flags)
{
	PublishingFlickrPublishingOptionsPaneSizeEntry ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = publishing_flickr_publishing_options_pane_size_entry_ref (value->data[0].v_pointer);
	}
	return NULL;
}

static GParamSpec*
publishing_flickr_publishing_options_pane_param_spec_size_entry (const gchar* name,
                                                                 const gchar* nick,
                                                                 const gchar* blurb,
                                                                 GType object_type,
                                                                 GParamFlags flags)
{
	PublishingFlickrPublishingOptionsPaneParamSpecSizeEntry* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

static gpointer
publishing_flickr_publishing_options_pane_value_get_size_entry (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY), NULL);
	return value->data[0].v_pointer;
}

static void
publishing_flickr_publishing_options_pane_value_set_size_entry (GValue* value,
                                                                gpointer v_object)
{
	PublishingFlickrPublishingOptionsPaneSizeEntry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		publishing_flickr_publishing_options_pane_size_entry_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_flickr_publishing_options_pane_size_entry_unref (old);
	}
}

static void
publishing_flickr_publishing_options_pane_value_take_size_entry (GValue* value,
                                                                 gpointer v_object)
{
	PublishingFlickrPublishingOptionsPaneSizeEntry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_flickr_publishing_options_pane_size_entry_unref (old);
	}
}

static void
publishing_flickr_publishing_options_pane_size_entry_class_init (PublishingFlickrPublishingOptionsPaneSizeEntryClass * klass,
                                                                 gpointer klass_data)
{
	publishing_flickr_publishing_options_pane_size_entry_parent_class = g_type_class_peek_parent (klass);
	((PublishingFlickrPublishingOptionsPaneSizeEntryClass *) klass)->finalize = publishing_flickr_publishing_options_pane_size_entry_finalize;
}

static void
publishing_flickr_publishing_options_pane_size_entry_instance_init (PublishingFlickrPublishingOptionsPaneSizeEntry * self,
                                                                    gpointer klass)
{
	self->ref_count = 1;
}

static void
publishing_flickr_publishing_options_pane_size_entry_finalize (PublishingFlickrPublishingOptionsPaneSizeEntry * obj)
{
	PublishingFlickrPublishingOptionsPaneSizeEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_SIZE_ENTRY, PublishingFlickrPublishingOptionsPaneSizeEntry);
	g_signal_handlers_destroy (self);
	_g_free0 (self->title);
}

static GType
publishing_flickr_publishing_options_pane_size_entry_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_flickr_publishing_options_pane_value_size_entry_init, publishing_flickr_publishing_options_pane_value_size_entry_free_value, publishing_flickr_publishing_options_pane_value_size_entry_copy_value, publishing_flickr_publishing_options_pane_value_size_entry_peek_pointer, "p", publishing_flickr_publishing_options_pane_value_size_entry_collect_value, "p", publishing_flickr_publishing_options_pane_value_size_entry_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingFlickrPublishingOptionsPaneSizeEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_flickr_publishing_options_pane_size_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingFlickrPublishingOptionsPaneSizeEntry), 0, (GInstanceInitFunc) publishing_flickr_publishing_options_pane_size_entry_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType publishing_flickr_publishing_options_pane_size_entry_type_id;
	publishing_flickr_publishing_options_pane_size_entry_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingFlickrPublishingOptionsPaneSizeEntry", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return publishing_flickr_publishing_options_pane_size_entry_type_id;
}

static GType
publishing_flickr_publishing_options_pane_size_entry_get_type (void)
{
	static volatile gsize publishing_flickr_publishing_options_pane_size_entry_type_id__once = 0;
	if (g_once_init_enter (&publishing_flickr_publishing_options_pane_size_entry_type_id__once)) {
		GType publishing_flickr_publishing_options_pane_size_entry_type_id;
		publishing_flickr_publishing_options_pane_size_entry_type_id = publishing_flickr_publishing_options_pane_size_entry_get_type_once ();
		g_once_init_leave (&publishing_flickr_publishing_options_pane_size_entry_type_id__once, publishing_flickr_publishing_options_pane_size_entry_type_id);
	}
	return publishing_flickr_publishing_options_pane_size_entry_type_id__once;
}

static gpointer
publishing_flickr_publishing_options_pane_size_entry_ref (gpointer instance)
{
	PublishingFlickrPublishingOptionsPaneSizeEntry * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

static void
publishing_flickr_publishing_options_pane_size_entry_unref (gpointer instance)
{
	PublishingFlickrPublishingOptionsPaneSizeEntry * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_SIZE_ENTRY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static PublishingFlickrPublishingOptionsPaneVisibilityEntry*
publishing_flickr_publishing_options_pane_visibility_entry_construct (GType object_type,
                                                                      const gchar* creator_title,
                                                                      PublishingFlickrVisibilitySpecification* creator_specification)
{
	PublishingFlickrPublishingOptionsPaneVisibilityEntry* self = NULL;
	PublishingFlickrVisibilitySpecification* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (creator_title != NULL, NULL);
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_VISIBILITY_SPECIFICATION (creator_specification), NULL);
	self = (PublishingFlickrPublishingOptionsPaneVisibilityEntry*) g_type_create_instance (object_type);
	_tmp0_ = _publishing_flickr_visibility_specification_ref0 (creator_specification);
	_publishing_flickr_visibility_specification_unref0 (self->specification);
	self->specification = _tmp0_;
	_tmp1_ = g_strdup (creator_title);
	_g_free0 (self->title);
	self->title = _tmp1_;
	return self;
}

static PublishingFlickrPublishingOptionsPaneVisibilityEntry*
publishing_flickr_publishing_options_pane_visibility_entry_new (const gchar* creator_title,
                                                                PublishingFlickrVisibilitySpecification* creator_specification)
{
	return publishing_flickr_publishing_options_pane_visibility_entry_construct (PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY, creator_title, creator_specification);
}

static void
publishing_flickr_publishing_options_pane_value_visibility_entry_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
publishing_flickr_publishing_options_pane_value_visibility_entry_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		publishing_flickr_publishing_options_pane_visibility_entry_unref (value->data[0].v_pointer);
	}
}

static void
publishing_flickr_publishing_options_pane_value_visibility_entry_copy_value (const GValue* src_value,
                                                                             GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = publishing_flickr_publishing_options_pane_visibility_entry_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
publishing_flickr_publishing_options_pane_value_visibility_entry_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
publishing_flickr_publishing_options_pane_value_visibility_entry_collect_value (GValue* value,
                                                                                guint n_collect_values,
                                                                                GTypeCValue* collect_values,
                                                                                guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		PublishingFlickrPublishingOptionsPaneVisibilityEntry * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = publishing_flickr_publishing_options_pane_visibility_entry_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
publishing_flickr_publishing_options_pane_value_visibility_entry_lcopy_value (const GValue* value,
                                                                              guint n_collect_values,
                                                                              GTypeCValue* collect_values,
                                                                              guint collect_flags)
{
	PublishingFlickrPublishingOptionsPaneVisibilityEntry ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = publishing_flickr_publishing_options_pane_visibility_entry_ref (value->data[0].v_pointer);
	}
	return NULL;
}

static GParamSpec*
publishing_flickr_publishing_options_pane_param_spec_visibility_entry (const gchar* name,
                                                                       const gchar* nick,
                                                                       const gchar* blurb,
                                                                       GType object_type,
                                                                       GParamFlags flags)
{
	PublishingFlickrPublishingOptionsPaneParamSpecVisibilityEntry* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

static gpointer
publishing_flickr_publishing_options_pane_value_get_visibility_entry (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY), NULL);
	return value->data[0].v_pointer;
}

static void
publishing_flickr_publishing_options_pane_value_set_visibility_entry (GValue* value,
                                                                      gpointer v_object)
{
	PublishingFlickrPublishingOptionsPaneVisibilityEntry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		publishing_flickr_publishing_options_pane_visibility_entry_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_flickr_publishing_options_pane_visibility_entry_unref (old);
	}
}

static void
publishing_flickr_publishing_options_pane_value_take_visibility_entry (GValue* value,
                                                                       gpointer v_object)
{
	PublishingFlickrPublishingOptionsPaneVisibilityEntry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_flickr_publishing_options_pane_visibility_entry_unref (old);
	}
}

static void
publishing_flickr_publishing_options_pane_visibility_entry_class_init (PublishingFlickrPublishingOptionsPaneVisibilityEntryClass * klass,
                                                                       gpointer klass_data)
{
	publishing_flickr_publishing_options_pane_visibility_entry_parent_class = g_type_class_peek_parent (klass);
	((PublishingFlickrPublishingOptionsPaneVisibilityEntryClass *) klass)->finalize = publishing_flickr_publishing_options_pane_visibility_entry_finalize;
}

static void
publishing_flickr_publishing_options_pane_visibility_entry_instance_init (PublishingFlickrPublishingOptionsPaneVisibilityEntry * self,
                                                                          gpointer klass)
{
	self->ref_count = 1;
}

static void
publishing_flickr_publishing_options_pane_visibility_entry_finalize (PublishingFlickrPublishingOptionsPaneVisibilityEntry * obj)
{
	PublishingFlickrPublishingOptionsPaneVisibilityEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_TYPE_VISIBILITY_ENTRY, PublishingFlickrPublishingOptionsPaneVisibilityEntry);
	g_signal_handlers_destroy (self);
	_publishing_flickr_visibility_specification_unref0 (self->specification);
	_g_free0 (self->title);
}

static GType
publishing_flickr_publishing_options_pane_visibility_entry_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_flickr_publishing_options_pane_value_visibility_entry_init, publishing_flickr_publishing_options_pane_value_visibility_entry_free_value, publishing_flickr_publishing_options_pane_value_visibility_entry_copy_value, publishing_flickr_publishing_options_pane_value_visibility_entry_peek_pointer, "p", publishing_flickr_publishing_options_pane_value_visibility_entry_collect_value, "p", publishing_flickr_publishing_options_pane_value_visibility_entry_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingFlickrPublishingOptionsPaneVisibilityEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_flickr_publishing_options_pane_visibility_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingFlickrPublishingOptionsPaneVisibilityEntry), 0, (GInstanceInitFunc) publishing_flickr_publishing_options_pane_visibility_entry_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType publishing_flickr_publishing_options_pane_visibility_entry_type_id;
	publishing_flickr_publishing_options_pane_visibility_entry_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingFlickrPublishingOptionsPaneVisibilityEntry", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return publishing_flickr_publishing_options_pane_visibility_entry_type_id;
}

static GType
publishing_flickr_publishing_options_pane_visibility_entry_get_type (void)
{
	static volatile gsize publishing_flickr_publishing_options_pane_visibility_entry_type_id__once = 0;
	if (g_once_init_enter (&publishing_flickr_publishing_options_pane_visibility_entry_type_id__once)) {
		GType publishing_flickr_publishing_options_pane_visibility_entry_type_id;
		publishing_flickr_publishing_options_pane_visibility_entry_type_id = publishing_flickr_publishing_options_pane_visibility_entry_get_type_once ();
		g_once_init_leave (&publishing_flickr_publishing_options_pane_visibility_entry_type_id__once, publishing_flickr_publishing_options_pane_visibility_entry_type_id);
	}
	return publishing_flickr_publishing_options_pane_visibility_entry_type_id__once;
}

static gpointer
publishing_flickr_publishing_options_pane_visibility_entry_ref (gpointer instance)
{
	PublishingFlickrPublishingOptionsPaneVisibilityEntry * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

static void
publishing_flickr_publishing_options_pane_visibility_entry_unref (gpointer instance)
{
	PublishingFlickrPublishingOptionsPaneVisibilityEntry * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_VISIBILITY_ENTRY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
publishing_flickr_publishing_options_pane_class_init (PublishingFlickrPublishingOptionsPaneClass * klass,
                                                      gpointer klass_data)
{
	publishing_flickr_publishing_options_pane_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingFlickrPublishingOptionsPane_private_offset);
	G_OBJECT_CLASS (klass)->finalize = publishing_flickr_publishing_options_pane_finalize;
	publishing_flickr_publishing_options_pane_signals[PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_PUBLISH_SIGNAL] = g_signal_new ("publish", PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
	publishing_flickr_publishing_options_pane_signals[PUBLISHING_FLICKR_PUBLISHING_OPTIONS_PANE_LOGOUT_SIGNAL] = g_signal_new ("logout", PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
publishing_flickr_publishing_options_pane_spit_publishing_dialog_pane_interface_init (SpitPublishingDialogPaneIface * iface,
                                                                                      gpointer iface_data)
{
	publishing_flickr_publishing_options_pane_spit_publishing_dialog_pane_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_widget = (GtkWidget* (*) (SpitPublishingDialogPane*)) publishing_flickr_publishing_options_pane_real_get_widget;
	iface->get_preferred_geometry = (SpitPublishingDialogPaneGeometryOptions (*) (SpitPublishingDialogPane*)) publishing_flickr_publishing_options_pane_real_get_preferred_geometry;
	iface->on_pane_installed = (void (*) (SpitPublishingDialogPane*)) publishing_flickr_publishing_options_pane_real_on_pane_installed;
	iface->on_pane_uninstalled = (void (*) (SpitPublishingDialogPane*)) publishing_flickr_publishing_options_pane_real_on_pane_uninstalled;
}

static void
publishing_flickr_publishing_options_pane_instance_init (PublishingFlickrPublishingOptionsPane * self,
                                                         gpointer klass)
{
	self->priv = publishing_flickr_publishing_options_pane_get_instance_private (self);
	self->priv->pane_widget = NULL;
	self->priv->visibility_label = NULL;
	self->priv->upload_info_label = NULL;
	self->priv->size_label = NULL;
	self->priv->logout_button = NULL;
	self->priv->publish_button = NULL;
	self->priv->visibility_combo = NULL;
	self->priv->size_combo = NULL;
	self->priv->strip_metadata_check = NULL;
	self->priv->visibilities = NULL;
	self->priv->visibilities_length1 = 0;
	self->priv->_visibilities_size_ = self->priv->visibilities_length1;
	self->priv->sizes = NULL;
	self->priv->sizes_length1 = 0;
	self->priv->_sizes_size_ = self->priv->sizes_length1;
	self->priv->parameters = NULL;
	self->priv->publisher = NULL;
}

static void
publishing_flickr_publishing_options_pane_finalize (GObject * obj)
{
	PublishingFlickrPublishingOptionsPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_FLICKR_TYPE_PUBLISHING_OPTIONS_PANE, PublishingFlickrPublishingOptionsPane);
	_g_object_unref0 (self->priv->builder);
	_g_object_unref0 (self->priv->pane_widget);
	_g_object_unref0 (self->priv->visibility_label);
	_g_object_unref0 (self->priv->upload_info_label);
	_g_object_unref0 (self->priv->size_label);
	_g_object_unref0 (self->priv->logout_button);
	_g_object_unref0 (self->priv->publish_button);
	_g_object_unref0 (self->priv->visibility_combo);
	_g_object_unref0 (self->priv->size_combo);
	_g_object_unref0 (self->priv->strip_metadata_check);
	self->priv->visibilities = (_vala_array_free (self->priv->visibilities, self->priv->visibilities_length1, (GDestroyNotify) publishing_flickr_publishing_options_pane_visibility_entry_unref), NULL);
	self->priv->sizes = (_vala_array_free (self->priv->sizes, self->priv->sizes_length1, (GDestroyNotify) publishing_flickr_publishing_options_pane_size_entry_unref), NULL);
	_publishing_flickr_publishing_parameters_unref0 (self->priv->parameters);
	_g_object_unref0 (self->priv->publisher);
	G_OBJECT_CLASS (publishing_flickr_publishing_options_pane_parent_class)->finalize (obj);
}

static GType
publishing_flickr_publishing_options_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingFlickrPublishingOptionsPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_flickr_publishing_options_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingFlickrPublishingOptionsPane), 0, (GInstanceInitFunc) publishing_flickr_publishing_options_pane_instance_init, NULL };
	static const GInterfaceInfo spit_publishing_dialog_pane_info = { (GInterfaceInitFunc) publishing_flickr_publishing_options_pane_spit_publishing_dialog_pane_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType publishing_flickr_publishing_options_pane_type_id;
	publishing_flickr_publishing_options_pane_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingFlickrPublishingOptionsPane", &g_define_type_info, 0);
	g_type_add_interface_static (publishing_flickr_publishing_options_pane_type_id, SPIT_PUBLISHING_TYPE_DIALOG_PANE, &spit_publishing_dialog_pane_info);
	PublishingFlickrPublishingOptionsPane_private_offset = g_type_add_instance_private (publishing_flickr_publishing_options_pane_type_id, sizeof (PublishingFlickrPublishingOptionsPanePrivate));
	return publishing_flickr_publishing_options_pane_type_id;
}

GType
publishing_flickr_publishing_options_pane_get_type (void)
{
	static volatile gsize publishing_flickr_publishing_options_pane_type_id__once = 0;
	if (g_once_init_enter (&publishing_flickr_publishing_options_pane_type_id__once)) {
		GType publishing_flickr_publishing_options_pane_type_id;
		publishing_flickr_publishing_options_pane_type_id = publishing_flickr_publishing_options_pane_get_type_once ();
		g_once_init_leave (&publishing_flickr_publishing_options_pane_type_id__once, publishing_flickr_publishing_options_pane_type_id);
	}
	return publishing_flickr_publishing_options_pane_type_id__once;
}

static inline gpointer
publishing_flickr_uploader_get_instance_private (PublishingFlickrUploader* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingFlickrUploader_private_offset);
}

PublishingFlickrUploader*
publishing_flickr_uploader_construct (GType object_type,
                                      PublishingRESTSupportOAuth1Session* session,
                                      SpitPublishingPublishable** publishables,
                                      gint publishables_length1,
                                      PublishingFlickrPublishingParameters* parameters,
                                      gboolean strip_metadata)
{
	PublishingFlickrUploader* self = NULL;
	PublishingFlickrPublishingParameters* _tmp0_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (session, PUBLISHING_REST_SUPPORT_OAUTH1_TYPE_SESSION), NULL);
	g_return_val_if_fail (PUBLISHING_FLICKR_IS_PUBLISHING_PARAMETERS (parameters), NULL);
	self = (PublishingFlickrUploader*) publishing_rest_support_batch_uploader_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (session, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), publishables, (gint) publishables_length1);
	_tmp0_ = _publishing_flickr_publishing_parameters_ref0 (parameters);
	_publishing_flickr_publishing_parameters_unref0 (self->priv->parameters);
	self->priv->parameters = _tmp0_;
	self->priv->strip_metadata = strip_metadata;
	return self;
}

PublishingFlickrUploader*
publishing_flickr_uploader_new (PublishingRESTSupportOAuth1Session* session,
                                SpitPublishingPublishable** publishables,
                                gint publishables_length1,
                                PublishingFlickrPublishingParameters* parameters,
                                gboolean strip_metadata)
{
	return publishing_flickr_uploader_construct (PUBLISHING_FLICKR_TYPE_UPLOADER, session, publishables, publishables_length1, parameters, strip_metadata);
}

static void
_vala_array_add16 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
publishing_flickr_uploader_preprocess_publishable (PublishingFlickrUploader* self,
                                                   SpitPublishingPublishable* publishable)
{
	GExiv2Metadata* publishable_metadata = NULL;
	GExiv2Metadata* _tmp0_;
	GExiv2Metadata* _tmp10_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_FLICKR_IS_UPLOADER (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (publishable, SPIT_PUBLISHING_TYPE_PUBLISHABLE));
	if (spit_publishing_publishable_get_media_type (publishable) != SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_PHOTO) {
		return;
	}
	_tmp0_ = gexiv2_metadata_new ();
	publishable_metadata = _tmp0_;
	{
		GExiv2Metadata* _tmp1_;
		GFile* _tmp2_;
		GFile* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp1_ = publishable_metadata;
		_tmp2_ = spit_publishing_publishable_get_serialized_file (publishable);
		_tmp3_ = _tmp2_;
		_tmp4_ = g_file_get_path (_tmp3_);
		_tmp5_ = _tmp4_;
		gexiv2_metadata_open_path (_tmp1_, _tmp5_, &_inner_error0_);
		_g_free0 (_tmp5_);
		_g_object_unref0 (_tmp3_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GFile* _tmp6_;
		GFile* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		g_clear_error (&_inner_error0_);
		_tmp6_ = spit_publishing_publishable_get_serialized_file (publishable);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_file_get_path (_tmp7_);
		_tmp9_ = _tmp8_;
		g_warning ("FlickrPublishing.vala:715: couldn't read metadata from file '%s' for u" \
"pload preprocessing.", _tmp9_);
		_g_free0 (_tmp9_);
		_g_object_unref0 (_tmp7_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (publishable_metadata);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp10_ = publishable_metadata;
	if (!gexiv2_metadata_has_iptc (_tmp10_)) {
		_g_object_unref0 (publishable_metadata);
		return;
	}
	{
		gboolean _tmp11_ = FALSE;
		GExiv2Metadata* _tmp12_;
		_tmp12_ = publishable_metadata;
		_tmp11_ = gexiv2_metadata_try_has_tag (_tmp12_, "Iptc.Application2.Caption", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
		if (_tmp11_) {
			gchar* _tmp13_ = NULL;
			GExiv2Metadata* _tmp14_;
			gchar* _tmp15_;
			GExiv2Metadata* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			_tmp14_ = publishable_metadata;
			_tmp15_ = gexiv2_metadata_try_get_tag_string (_tmp14_, "Iptc.Application2.Caption", &_inner_error0_);
			_tmp13_ = _tmp15_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
			_tmp16_ = publishable_metadata;
			_tmp17_ = publishing_rest_support_asciify_string (_tmp13_);
			_tmp18_ = _tmp17_;
			gexiv2_metadata_try_set_tag_string (_tmp16_, "Iptc.Application2.Caption", _tmp18_, &_inner_error0_);
			_g_free0 (_tmp18_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (_tmp13_);
				goto __catch1_g_error;
			}
			_g_free0 (_tmp13_);
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (publishable_metadata);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	{
		gboolean _tmp19_ = FALSE;
		GExiv2Metadata* _tmp20_;
		_tmp20_ = publishable_metadata;
		_tmp19_ = gexiv2_metadata_try_has_tag (_tmp20_, "Iptc.Application2.Headline", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch2_g_error;
		}
		if (_tmp19_) {
			gchar* _tmp21_ = NULL;
			GExiv2Metadata* _tmp22_;
			gchar* _tmp23_;
			GExiv2Metadata* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			_tmp22_ = publishable_metadata;
			_tmp23_ = gexiv2_metadata_try_get_tag_string (_tmp22_, "Iptc.Application2.Headline", &_inner_error0_);
			_tmp21_ = _tmp23_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch2_g_error;
			}
			_tmp24_ = publishable_metadata;
			_tmp25_ = publishing_rest_support_asciify_string (_tmp21_);
			_tmp26_ = _tmp25_;
			gexiv2_metadata_try_set_tag_string (_tmp24_, "Iptc.Application2.Headline", _tmp26_, &_inner_error0_);
			_g_free0 (_tmp26_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (_tmp21_);
				goto __catch2_g_error;
			}
			_g_free0 (_tmp21_);
		}
	}
	goto __finally2;
	__catch2_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally2:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (publishable_metadata);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	{
		gboolean _tmp27_ = FALSE;
		GExiv2Metadata* _tmp28_;
		_tmp28_ = publishable_metadata;
		_tmp27_ = gexiv2_metadata_try_has_tag (_tmp28_, "Iptc.Application2.Keywords", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch3_g_error;
		}
		if (_tmp27_) {
			GeeSet* keyword_set = NULL;
			GeeHashSet* _tmp29_;
			gchar** iptc_keywords = NULL;
			GExiv2Metadata* _tmp30_;
			gchar** _tmp31_;
			gchar** _tmp32_;
			gint iptc_keywords_length1;
			gint _iptc_keywords_size_;
			gchar** _tmp33_;
			gint _tmp33__length1;
			gchar** xmp_keywords = NULL;
			GExiv2Metadata* _tmp38_;
			gchar** _tmp39_;
			gchar** _tmp40_;
			gint xmp_keywords_length1;
			gint _xmp_keywords_size_;
			gchar** _tmp41_;
			gint _tmp41__length1;
			gchar** all_keywords = NULL;
			GeeSet* _tmp46_;
			gint _tmp47_ = 0;
			gpointer* _tmp48_;
			gint all_keywords_length1;
			gint _all_keywords_size_;
			gchar** no_keywords = NULL;
			gchar** _tmp49_;
			gint no_keywords_length1;
			gint _no_keywords_size_;
			gchar** _tmp50_;
			gint _tmp50__length1;
			_tmp29_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
			keyword_set = G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, GEE_TYPE_SET, GeeSet);
			_tmp30_ = publishable_metadata;
			_tmp32_ = _tmp31_ = gexiv2_metadata_try_get_tag_multiple (_tmp30_, "Iptc.Application2.Keywords", &_inner_error0_);
			iptc_keywords = _tmp32_;
			iptc_keywords_length1 = _vala_array_length (_tmp31_);
			_iptc_keywords_size_ = iptc_keywords_length1;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (keyword_set);
				goto __catch3_g_error;
			}
			_tmp33_ = iptc_keywords;
			_tmp33__length1 = iptc_keywords_length1;
			if (_tmp33_ != NULL) {
				gchar** _tmp34_;
				gint _tmp34__length1;
				_tmp34_ = iptc_keywords;
				_tmp34__length1 = iptc_keywords_length1;
				{
					gchar** keyword_collection = NULL;
					gint keyword_collection_length1 = 0;
					gint _keyword_collection_size_ = 0;
					gint keyword_it = 0;
					keyword_collection = _tmp34_;
					keyword_collection_length1 = _tmp34__length1;
					for (keyword_it = 0; keyword_it < keyword_collection_length1; keyword_it = keyword_it + 1) {
						gchar* _tmp35_;
						gchar* keyword = NULL;
						_tmp35_ = g_strdup (keyword_collection[keyword_it]);
						keyword = _tmp35_;
						{
							GeeSet* _tmp36_;
							const gchar* _tmp37_;
							_tmp36_ = keyword_set;
							_tmp37_ = keyword;
							gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GEE_TYPE_COLLECTION, GeeCollection), _tmp37_);
							_g_free0 (keyword);
						}
					}
				}
			}
			_tmp38_ = publishable_metadata;
			_tmp40_ = _tmp39_ = gexiv2_metadata_try_get_tag_multiple (_tmp38_, "Xmp.dc.subject", &_inner_error0_);
			xmp_keywords = _tmp40_;
			xmp_keywords_length1 = _vala_array_length (_tmp39_);
			_xmp_keywords_size_ = xmp_keywords_length1;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				iptc_keywords = (_vala_array_free (iptc_keywords, iptc_keywords_length1, (GDestroyNotify) g_free), NULL);
				_g_object_unref0 (keyword_set);
				goto __catch3_g_error;
			}
			_tmp41_ = xmp_keywords;
			_tmp41__length1 = xmp_keywords_length1;
			if (_tmp41_ != NULL) {
				gchar** _tmp42_;
				gint _tmp42__length1;
				_tmp42_ = xmp_keywords;
				_tmp42__length1 = xmp_keywords_length1;
				{
					gchar** keyword_collection = NULL;
					gint keyword_collection_length1 = 0;
					gint _keyword_collection_size_ = 0;
					gint keyword_it = 0;
					keyword_collection = _tmp42_;
					keyword_collection_length1 = _tmp42__length1;
					for (keyword_it = 0; keyword_it < keyword_collection_length1; keyword_it = keyword_it + 1) {
						gchar* _tmp43_;
						gchar* keyword = NULL;
						_tmp43_ = g_strdup (keyword_collection[keyword_it]);
						keyword = _tmp43_;
						{
							GeeSet* _tmp44_;
							const gchar* _tmp45_;
							_tmp44_ = keyword_set;
							_tmp45_ = keyword;
							gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, GEE_TYPE_COLLECTION, GeeCollection), _tmp45_);
							_g_free0 (keyword);
						}
					}
				}
			}
			_tmp46_ = keyword_set;
			_tmp48_ = gee_collection_to_array (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, GEE_TYPE_COLLECTION, GeeCollection), &_tmp47_);
			all_keywords = _tmp48_;
			all_keywords_length1 = _tmp47_;
			_all_keywords_size_ = all_keywords_length1;
			_vala_array_add16 (&all_keywords, &all_keywords_length1, &_all_keywords_size_, NULL);
			_tmp49_ = g_new0 (gchar*, 1 + 1);
			no_keywords = _tmp49_;
			no_keywords_length1 = 1;
			_no_keywords_size_ = no_keywords_length1;
			_tmp50_ = no_keywords;
			_tmp50__length1 = no_keywords_length1;
			_g_free0 (_tmp50_[0]);
			_tmp50_[0] = NULL;
			{
				GExiv2Metadata* _tmp51_;
				gchar** _tmp52_;
				gint _tmp52__length1;
				_tmp51_ = publishable_metadata;
				_tmp52_ = all_keywords;
				_tmp52__length1 = all_keywords_length1;
				gexiv2_metadata_try_set_tag_multiple (_tmp51_, "Xmp.dc.subject", _tmp52_, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch4_g_error;
				}
			}
			goto __finally4;
			__catch4_g_error:
			{
				g_clear_error (&_inner_error0_);
			}
			__finally4:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				no_keywords = (_vala_array_free (no_keywords, no_keywords_length1, (GDestroyNotify) g_free), NULL);
				all_keywords = (_vala_array_free (all_keywords, all_keywords_length1, (GDestroyNotify) g_free), NULL);
				xmp_keywords = (_vala_array_free (xmp_keywords, xmp_keywords_length1, (GDestroyNotify) g_free), NULL);
				iptc_keywords = (_vala_array_free (iptc_keywords, iptc_keywords_length1, (GDestroyNotify) g_free), NULL);
				_g_object_unref0 (keyword_set);
				goto __catch3_g_error;
			}
			{
				GExiv2Metadata* _tmp53_;
				gchar** _tmp54_;
				gint _tmp54__length1;
				_tmp53_ = publishable_metadata;
				_tmp54_ = no_keywords;
				_tmp54__length1 = no_keywords_length1;
				gexiv2_metadata_try_set_tag_multiple (_tmp53_, "Iptc.Application2.Keywords", _tmp54_, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch5_g_error;
				}
			}
			goto __finally5;
			__catch5_g_error:
			{
				g_clear_error (&_inner_error0_);
			}
			__finally5:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				no_keywords = (_vala_array_free (no_keywords, no_keywords_length1, (GDestroyNotify) g_free), NULL);
				all_keywords = (_vala_array_free (all_keywords, all_keywords_length1, (GDestroyNotify) g_free), NULL);
				xmp_keywords = (_vala_array_free (xmp_keywords, xmp_keywords_length1, (GDestroyNotify) g_free), NULL);
				iptc_keywords = (_vala_array_free (iptc_keywords, iptc_keywords_length1, (GDestroyNotify) g_free), NULL);
				_g_object_unref0 (keyword_set);
				goto __catch3_g_error;
			}
			{
				GExiv2Metadata* _tmp55_;
				GFile* _tmp56_;
				GFile* _tmp57_;
				gchar* _tmp58_;
				gchar* _tmp59_;
				_tmp55_ = publishable_metadata;
				_tmp56_ = spit_publishing_publishable_get_serialized_file (publishable);
				_tmp57_ = _tmp56_;
				_tmp58_ = g_file_get_path (_tmp57_);
				_tmp59_ = _tmp58_;
				gexiv2_metadata_save_file (_tmp55_, _tmp59_, &_inner_error0_);
				_g_free0 (_tmp59_);
				_g_object_unref0 (_tmp57_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch6_g_error;
				}
			}
			goto __finally6;
			__catch6_g_error:
			{
				GFile* _tmp60_;
				GFile* _tmp61_;
				gchar* _tmp62_;
				gchar* _tmp63_;
				g_clear_error (&_inner_error0_);
				_tmp60_ = spit_publishing_publishable_get_serialized_file (publishable);
				_tmp61_ = _tmp60_;
				_tmp62_ = g_file_get_path (_tmp61_);
				_tmp63_ = _tmp62_;
				g_warning ("FlickrPublishing.vala:777: couldn't write metadata to file '%s' for up" \
"load preprocessing.", _tmp63_);
				_g_free0 (_tmp63_);
				_g_object_unref0 (_tmp61_);
			}
			__finally6:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				no_keywords = (_vala_array_free (no_keywords, no_keywords_length1, (GDestroyNotify) g_free), NULL);
				all_keywords = (_vala_array_free (all_keywords, all_keywords_length1, (GDestroyNotify) g_free), NULL);
				xmp_keywords = (_vala_array_free (xmp_keywords, xmp_keywords_length1, (GDestroyNotify) g_free), NULL);
				iptc_keywords = (_vala_array_free (iptc_keywords, iptc_keywords_length1, (GDestroyNotify) g_free), NULL);
				_g_object_unref0 (keyword_set);
				goto __catch3_g_error;
			}
			no_keywords = (_vala_array_free (no_keywords, no_keywords_length1, (GDestroyNotify) g_free), NULL);
			all_keywords = (_vala_array_free (all_keywords, all_keywords_length1, (GDestroyNotify) g_free), NULL);
			xmp_keywords = (_vala_array_free (xmp_keywords, xmp_keywords_length1, (GDestroyNotify) g_free), NULL);
			iptc_keywords = (_vala_array_free (iptc_keywords, iptc_keywords_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (keyword_set);
		}
	}
	goto __finally3;
	__catch3_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally3:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (publishable_metadata);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_object_unref0 (publishable_metadata);
}

static PublishingRESTSupportTransaction*
publishing_flickr_uploader_real_create_transaction (PublishingRESTSupportBatchUploader* base,
                                                    SpitPublishingPublishable* publishable)
{
	PublishingFlickrUploader * self;
	SpitPublishingPublishable* _tmp0_;
	SpitPublishingPublishable* _tmp1_;
	PublishingRESTSupportSession* _tmp2_;
	PublishingRESTSupportOAuth1Session* _tmp3_;
	PublishingFlickrPublishingParameters* _tmp4_;
	SpitPublishingPublishable* _tmp5_;
	SpitPublishingPublishable* _tmp6_;
	PublishingFlickrUploadTransaction* _tmp7_;
	PublishingRESTSupportTransaction* _tmp8_;
	PublishingRESTSupportTransaction* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_FLICKR_TYPE_UPLOADER, PublishingFlickrUploader);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (publishable, SPIT_PUBLISHING_TYPE_PUBLISHABLE), NULL);
	_tmp0_ = publishing_rest_support_batch_uploader_get_current_publishable (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader));
	_tmp1_ = _tmp0_;
	publishing_flickr_uploader_preprocess_publishable (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = publishing_rest_support_batch_uploader_get_session (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader));
	_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, PUBLISHING_REST_SUPPORT_OAUTH1_TYPE_SESSION, PublishingRESTSupportOAuth1Session);
	_tmp4_ = self->priv->parameters;
	_tmp5_ = publishing_rest_support_batch_uploader_get_current_publishable (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader));
	_tmp6_ = _tmp5_;
	_tmp7_ = publishing_flickr_upload_transaction_new (_tmp3_, _tmp4_, _tmp6_);
	_tmp8_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction);
	_g_object_unref0 (_tmp6_);
	_publishing_rest_support_session_unref0 (_tmp3_);
	result = _tmp8_;
	return result;
}

static void
publishing_flickr_uploader_class_init (PublishingFlickrUploaderClass * klass,
                                       gpointer klass_data)
{
	publishing_flickr_uploader_parent_class = g_type_class_peek_parent (klass);
	((PublishingRESTSupportBatchUploaderClass *) klass)->finalize = publishing_flickr_uploader_finalize;
	g_type_class_adjust_private_offset (klass, &PublishingFlickrUploader_private_offset);
	((PublishingRESTSupportBatchUploaderClass *) klass)->create_transaction = (PublishingRESTSupportTransaction* (*) (PublishingRESTSupportBatchUploader*, SpitPublishingPublishable*)) publishing_flickr_uploader_real_create_transaction;
}

static void
publishing_flickr_uploader_instance_init (PublishingFlickrUploader * self,
                                          gpointer klass)
{
	self->priv = publishing_flickr_uploader_get_instance_private (self);
}

static void
publishing_flickr_uploader_finalize (PublishingRESTSupportBatchUploader * obj)
{
	PublishingFlickrUploader * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_FLICKR_TYPE_UPLOADER, PublishingFlickrUploader);
	_publishing_flickr_publishing_parameters_unref0 (self->priv->parameters);
	PUBLISHING_REST_SUPPORT_BATCH_UPLOADER_CLASS (publishing_flickr_uploader_parent_class)->finalize (obj);
}

static GType
publishing_flickr_uploader_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingFlickrUploaderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_flickr_uploader_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingFlickrUploader), 0, (GInstanceInitFunc) publishing_flickr_uploader_instance_init, NULL };
	GType publishing_flickr_uploader_type_id;
	publishing_flickr_uploader_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, "PublishingFlickrUploader", &g_define_type_info, 0);
	PublishingFlickrUploader_private_offset = g_type_add_instance_private (publishing_flickr_uploader_type_id, sizeof (PublishingFlickrUploaderPrivate));
	return publishing_flickr_uploader_type_id;
}

GType
publishing_flickr_uploader_get_type (void)
{
	static volatile gsize publishing_flickr_uploader_type_id__once = 0;
	if (g_once_init_enter (&publishing_flickr_uploader_type_id__once)) {
		GType publishing_flickr_uploader_type_id;
		publishing_flickr_uploader_type_id = publishing_flickr_uploader_get_type_once ();
		g_once_init_leave (&publishing_flickr_uploader_type_id__once, publishing_flickr_uploader_type_id);
	}
	return publishing_flickr_uploader_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

