/* YouTubePublishing.c generated by valac 0.56.19, the Vala compiler
 * generated from YouTubePublishing.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU LGPL (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 <gio/gio.h>
#include <float.h>
#include <math.h>
#include <gtk/gtk.h>
#include "shotwell-authenticator.h"

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

enum  {
	YOU_TUBE_SERVICE_0_PROPERTY,
	YOU_TUBE_SERVICE_NUM_PROPERTIES
};
static GParamSpec* you_tube_service_properties[YOU_TUBE_SERVICE_NUM_PROPERTIES];
typedef enum  {
	PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PUBLIC,
	PUBLISHING_YOU_TUBE_PRIVACY_SETTING_UNLISTED,
	PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PRIVATE
} PublishingYouTubePrivacySetting;

#define PUBLISHING_YOU_TUBE_TYPE_PRIVACY_SETTING (publishing_you_tube_privacy_setting_get_type ())

#define PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS (publishing_you_tube_publishing_parameters_get_type ())
#define PUBLISHING_YOU_TUBE_PUBLISHING_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS, PublishingYouTubePublishingParameters))
#define PUBLISHING_YOU_TUBE_PUBLISHING_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS, PublishingYouTubePublishingParametersClass))
#define PUBLISHING_YOU_TUBE_IS_PUBLISHING_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS))
#define PUBLISHING_YOU_TUBE_IS_PUBLISHING_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS))
#define PUBLISHING_YOU_TUBE_PUBLISHING_PARAMETERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS, PublishingYouTubePublishingParametersClass))

typedef struct _PublishingYouTubePublishingParameters PublishingYouTubePublishingParameters;
typedef struct _PublishingYouTubePublishingParametersClass PublishingYouTubePublishingParametersClass;
typedef struct _PublishingYouTubePublishingParametersPrivate PublishingYouTubePublishingParametersPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _PublishingYouTubeParamSpecPublishingParameters PublishingYouTubeParamSpecPublishingParameters;
enum  {
	PUBLISHING_YOU_TUBE_YOU_TUBE_PUBLISHER_0_PROPERTY,
	PUBLISHING_YOU_TUBE_YOU_TUBE_PUBLISHER_NUM_PROPERTIES
};
static GParamSpec* publishing_you_tube_you_tube_publisher_properties[PUBLISHING_YOU_TUBE_YOU_TUBE_PUBLISHER_NUM_PROPERTIES];
#define _publishing_you_tube_publishing_parameters_unref0(var) ((var == NULL) ? NULL : (var = (publishing_you_tube_publishing_parameters_unref (var), NULL)))
#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 _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE (publishing_you_tube_publishing_options_pane_get_type ())
#define PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, PublishingYouTubePublishingOptionsPane))
#define PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, PublishingYouTubePublishingOptionsPaneClass))
#define PUBLISHING_YOU_TUBE_IS_PUBLISHING_OPTIONS_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE))
#define PUBLISHING_YOU_TUBE_IS_PUBLISHING_OPTIONS_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE))
#define PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, PublishingYouTubePublishingOptionsPaneClass))

typedef struct _PublishingYouTubePublishingOptionsPane PublishingYouTubePublishingOptionsPane;
typedef struct _PublishingYouTubePublishingOptionsPaneClass PublishingYouTubePublishingOptionsPaneClass;

#define PUBLISHING_YOU_TUBE_TYPE_UPLOADER (publishing_you_tube_uploader_get_type ())
#define PUBLISHING_YOU_TUBE_UPLOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_YOU_TUBE_TYPE_UPLOADER, PublishingYouTubeUploader))
#define PUBLISHING_YOU_TUBE_UPLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_YOU_TUBE_TYPE_UPLOADER, PublishingYouTubeUploaderClass))
#define PUBLISHING_YOU_TUBE_IS_UPLOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_YOU_TUBE_TYPE_UPLOADER))
#define PUBLISHING_YOU_TUBE_IS_UPLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_YOU_TUBE_TYPE_UPLOADER))
#define PUBLISHING_YOU_TUBE_UPLOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_YOU_TUBE_TYPE_UPLOADER, PublishingYouTubeUploaderClass))

typedef struct _PublishingYouTubeUploader PublishingYouTubeUploader;
typedef struct _PublishingYouTubeUploaderClass PublishingYouTubeUploaderClass;
#define _publishing_rest_support_batch_uploader_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_batch_uploader_unref (var), NULL)))
typedef struct _PublishingYouTubeYouTubePublisherDoUploadData PublishingYouTubeYouTubePublisherDoUploadData;
typedef struct _PublishingYouTubePublishingOptionsPanePrivate PublishingYouTubePublishingOptionsPanePrivate;

#define PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION (publishing_you_tube_publishing_options_pane_privacy_description_get_type ())
#define PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_PRIVACY_DESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION, PublishingYouTubePublishingOptionsPanePrivacyDescription))
#define PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_PRIVACY_DESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION, PublishingYouTubePublishingOptionsPanePrivacyDescriptionClass))
#define PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_IS_PRIVACY_DESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION))
#define PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_IS_PRIVACY_DESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION))
#define PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_PRIVACY_DESCRIPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION, PublishingYouTubePublishingOptionsPanePrivacyDescriptionClass))

typedef struct _PublishingYouTubePublishingOptionsPanePrivacyDescription PublishingYouTubePublishingOptionsPanePrivacyDescription;
typedef struct _PublishingYouTubePublishingOptionsPanePrivacyDescriptionClass PublishingYouTubePublishingOptionsPanePrivacyDescriptionClass;
enum  {
	PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_0_PROPERTY,
	PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_NUM_PROPERTIES
};
static GParamSpec* publishing_you_tube_publishing_options_pane_properties[PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_NUM_PROPERTIES];
typedef struct _PublishingYouTubePublishingOptionsPanePrivacyDescriptionPrivate PublishingYouTubePublishingOptionsPanePrivacyDescriptionPrivate;
#define _publishing_you_tube_publishing_options_pane_privacy_description_unref0(var) ((var == NULL) ? NULL : (var = (publishing_you_tube_publishing_options_pane_privacy_description_unref (var), NULL)))
typedef struct _PublishingYouTubePublishingOptionsPaneParamSpecPrivacyDescription PublishingYouTubePublishingOptionsPaneParamSpecPrivacyDescription;
enum  {
	PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_PUBLISH_SIGNAL,
	PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_LOGOUT_SIGNAL,
	PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_NUM_SIGNALS
};
static guint publishing_you_tube_publishing_options_pane_signals[PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_NUM_SIGNALS] = {0};
typedef struct _PublishingYouTubeUploaderPrivate PublishingYouTubeUploaderPrivate;

#define PUBLISHING_YOU_TUBE_TYPE_UPLOAD_TRANSACTION (publishing_you_tube_upload_transaction_get_type ())
#define PUBLISHING_YOU_TUBE_UPLOAD_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_YOU_TUBE_TYPE_UPLOAD_TRANSACTION, PublishingYouTubeUploadTransaction))
#define PUBLISHING_YOU_TUBE_UPLOAD_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_YOU_TUBE_TYPE_UPLOAD_TRANSACTION, PublishingYouTubeUploadTransactionClass))
#define PUBLISHING_YOU_TUBE_IS_UPLOAD_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_YOU_TUBE_TYPE_UPLOAD_TRANSACTION))
#define PUBLISHING_YOU_TUBE_IS_UPLOAD_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_YOU_TUBE_TYPE_UPLOAD_TRANSACTION))
#define PUBLISHING_YOU_TUBE_UPLOAD_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_YOU_TUBE_TYPE_UPLOAD_TRANSACTION, PublishingYouTubeUploadTransactionClass))

typedef struct _PublishingYouTubeUploadTransaction PublishingYouTubeUploadTransaction;
typedef struct _PublishingYouTubeUploadTransactionClass PublishingYouTubeUploadTransactionClass;
#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 _PublishingYouTubePublishingParameters {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingYouTubePublishingParametersPrivate * priv;
};

struct _PublishingYouTubePublishingParametersClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingYouTubePublishingParameters *self);
};

struct _PublishingYouTubePublishingParametersPrivate {
	PublishingYouTubePrivacySetting privacy;
	gchar* user_name;
};

struct _PublishingYouTubeParamSpecPublishingParameters {
	GParamSpec parent_instance;
};

struct _PublishingYouTubeYouTubePublisherPrivate {
	gboolean running;
	PublishingYouTubePublishingParameters* publishing_parameters;
	SpitPublishingProgressCallback progress_reporter;
	gpointer progress_reporter_target;
	GDestroyNotify progress_reporter_target_destroy_notify;
	SpitPublishingAuthenticator* authenticator;
};

struct _PublishingYouTubeYouTubePublisherDoUploadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingYouTubeYouTubePublisher* self;
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	SpitPublishingPluginHost* _tmp2_;
	gpointer _tmp3_;
	GDestroyNotify _tmp4_;
	SpitPublishingProgressCallback _tmp5_;
	SpitPublishingPublishable** publishables;
	SpitPublishingPluginHost* _tmp6_;
	gint _tmp7_;
	SpitPublishingPublishable** _tmp8_;
	gint publishables_length1;
	gint _publishables_size_;
	PublishingYouTubeUploader* uploader;
	PublishingRESTSupportGoogleSession* _tmp9_;
	PublishingRESTSupportGoogleSession* _tmp10_;
	SpitPublishingPublishable** _tmp11_;
	gint _tmp11__length1;
	PublishingYouTubePublishingParameters* _tmp12_;
	PublishingYouTubeUploader* _tmp13_;
	PublishingYouTubeUploader* _tmp14_;
	gint num_published;
	PublishingYouTubeUploader* _tmp15_;
	GError* err;
	GError* _tmp16_;
	const gchar* _tmp17_;
	SpitPublishingPluginHost* _tmp18_;
	GError* _tmp19_;
	GError* _inner_error0_;
};

struct _PublishingYouTubePublishingOptionsPane {
	GObject parent_instance;
	PublishingYouTubePublishingOptionsPanePrivate * priv;
};

struct _PublishingYouTubePublishingOptionsPaneClass {
	GObjectClass parent_class;
};

struct _PublishingYouTubePublishingOptionsPanePrivate {
	GtkBox* pane_widget;
	GtkComboBoxText* privacy_combo;
	GtkLabel* login_identity_label;
	GtkButton* publish_button;
	GtkButton* logout_button;
	GtkBuilder* builder;
	GtkLabel* privacy_label;
	PublishingYouTubePublishingOptionsPanePrivacyDescription** privacy_descriptions;
	gint privacy_descriptions_length1;
	gint _privacy_descriptions_size_;
	PublishingYouTubePublishingParameters* publishing_parameters;
};

struct _PublishingYouTubePublishingOptionsPanePrivacyDescription {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingYouTubePublishingOptionsPanePrivacyDescriptionPrivate * priv;
	gchar* description;
	PublishingYouTubePrivacySetting privacy_setting;
};

struct _PublishingYouTubePublishingOptionsPanePrivacyDescriptionClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingYouTubePublishingOptionsPanePrivacyDescription *self);
};

struct _PublishingYouTubePublishingOptionsPaneParamSpecPrivacyDescription {
	GParamSpec parent_instance;
};

struct _PublishingYouTubeUploader {
	PublishingRESTSupportBatchUploader parent_instance;
	PublishingYouTubeUploaderPrivate * priv;
};

struct _PublishingYouTubeUploaderClass {
	PublishingRESTSupportBatchUploaderClass parent_class;
};

struct _PublishingYouTubeUploaderPrivate {
	PublishingYouTubePublishingParameters* parameters;
};

static gpointer you_tube_service_parent_class = NULL;
static SpitPluggableIface * you_tube_service_spit_pluggable_parent_iface = NULL;
static SpitPublishingServiceIface * you_tube_service_spit_publishing_service_parent_iface = NULL;
static gint PublishingYouTubePublishingParameters_private_offset;
static gpointer publishing_you_tube_publishing_parameters_parent_class = NULL;
static gint PublishingYouTubeYouTubePublisher_private_offset;
static gpointer publishing_you_tube_you_tube_publisher_parent_class = NULL;
static gint PublishingYouTubePublishingOptionsPane_private_offset;
static gpointer publishing_you_tube_publishing_options_pane_parent_class = NULL;
static gpointer publishing_you_tube_publishing_options_pane_privacy_description_parent_class = NULL;
static SpitPublishingDialogPaneIface * publishing_you_tube_publishing_options_pane_spit_publishing_dialog_pane_parent_iface = NULL;
static gint PublishingYouTubeUploader_private_offset;
static gpointer publishing_you_tube_uploader_parent_class = NULL;

static gint you_tube_service_real_get_pluggable_interface (SpitPluggable* base,
                                                    gint min_host_interface,
                                                    gint max_host_interface);
static const gchar* you_tube_service_real_get_id (SpitPluggable* base);
static const gchar* you_tube_service_real_get_pluggable_name (SpitPluggable* base);
static SpitPluggableInfo* you_tube_service_real_get_info (SpitPluggable* base);
static SpitPublishingPublisher* you_tube_service_real_create_publisher (SpitPublishingService* base,
                                                                 SpitPublishingPluginHost* host);
static SpitPublishingPublisherMediaType you_tube_service_real_get_supported_media (SpitPublishingService* base);
static void you_tube_service_real_activation (SpitPluggable* base,
                                       gboolean enabled);
static GType you_tube_service_get_type_once (void);
VALA_EXTERN GType publishing_you_tube_privacy_setting_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar* publishing_you_tube_privacy_setting_to_string (PublishingYouTubePrivacySetting self);
VALA_EXTERN gpointer publishing_you_tube_publishing_parameters_ref (gpointer instance);
VALA_EXTERN void publishing_you_tube_publishing_parameters_unref (gpointer instance);
VALA_EXTERN GParamSpec* publishing_you_tube_param_spec_publishing_parameters (const gchar* name,
                                                                  const gchar* nick,
                                                                  const gchar* blurb,
                                                                  GType object_type,
                                                                  GParamFlags flags);
VALA_EXTERN void publishing_you_tube_value_set_publishing_parameters (GValue* value,
                                                          gpointer v_object);
VALA_EXTERN void publishing_you_tube_value_take_publishing_parameters (GValue* value,
                                                           gpointer v_object);
VALA_EXTERN gpointer publishing_you_tube_value_get_publishing_parameters (const GValue* value);
VALA_EXTERN GType publishing_you_tube_publishing_parameters_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingYouTubePublishingParameters* publishing_you_tube_publishing_parameters_new (void);
VALA_EXTERN PublishingYouTubePublishingParameters* publishing_you_tube_publishing_parameters_construct (GType object_type);
VALA_EXTERN PublishingYouTubePrivacySetting publishing_you_tube_publishing_parameters_get_privacy (PublishingYouTubePublishingParameters* self);
VALA_EXTERN void publishing_you_tube_publishing_parameters_set_privacy (PublishingYouTubePublishingParameters* self,
                                                            PublishingYouTubePrivacySetting privacy);
VALA_EXTERN gchar* publishing_you_tube_publishing_parameters_get_user_name (PublishingYouTubePublishingParameters* self);
VALA_EXTERN void publishing_you_tube_publishing_parameters_set_user_name (PublishingYouTubePublishingParameters* self,
                                                              const gchar* user_name);
static void publishing_you_tube_publishing_parameters_finalize (PublishingYouTubePublishingParameters * obj);
static GType publishing_you_tube_publishing_parameters_get_type_once (void);
static gboolean publishing_you_tube_you_tube_publisher_real_is_running (PublishingRESTSupportGooglePublisher* base);
static void publishing_you_tube_you_tube_publisher_real_start (PublishingRESTSupportGooglePublisher* base);
static void publishing_you_tube_you_tube_publisher_real_stop (PublishingRESTSupportGooglePublisher* base);
static void publishing_you_tube_you_tube_publisher_real_on_login_flow_complete (PublishingRESTSupportGooglePublisher* base);
static void publishing_you_tube_you_tube_publisher_do_show_publishing_options_pane (PublishingYouTubeYouTubePublisher* self);
static void publishing_you_tube_you_tube_publisher_on_publishing_options_logout (PublishingYouTubeYouTubePublisher* self);
static void publishing_you_tube_you_tube_publisher_on_publishing_options_publish (PublishingYouTubeYouTubePublisher* self);
static void publishing_you_tube_you_tube_publisher_do_upload (PublishingYouTubeYouTubePublisher* self,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_);
static void publishing_you_tube_you_tube_publisher_do_upload_finish (PublishingYouTubeYouTubePublisher* self,
                                                              GAsyncResult* _res_);
static void publishing_you_tube_you_tube_publisher_on_upload_status_updated (PublishingYouTubeYouTubePublisher* self,
                                                                      gint file_number,
                                                                      gdouble completed_fraction);
VALA_EXTERN GType publishing_you_tube_publishing_options_pane_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingYouTubePublishingOptionsPane* publishing_you_tube_publishing_options_pane_new (SpitPublishingAuthenticator* authenticator,
                                                                                         SpitPublishingPluginHost* host,
                                                                                         GtkBuilder* builder,
                                                                                         PublishingYouTubePublishingParameters* publishing_parameters);
VALA_EXTERN PublishingYouTubePublishingOptionsPane* publishing_you_tube_publishing_options_pane_construct (GType object_type,
                                                                                               SpitPublishingAuthenticator* authenticator,
                                                                                               SpitPublishingPluginHost* host,
                                                                                               GtkBuilder* builder,
                                                                                               PublishingYouTubePublishingParameters* publishing_parameters);
static void _publishing_you_tube_you_tube_publisher_on_publishing_options_publish_publishing_you_tube_publishing_options_pane_publish (PublishingYouTubePublishingOptionsPane* _sender,
                                                                                                                                gpointer self);
static void _publishing_you_tube_you_tube_publisher_on_publishing_options_logout_publishing_you_tube_publishing_options_pane_logout (PublishingYouTubePublishingOptionsPane* _sender,
                                                                                                                              gpointer self);
static void publishing_you_tube_you_tube_publisher_do_upload_data_free (gpointer _data);
static gboolean publishing_you_tube_you_tube_publisher_do_upload_co (PublishingYouTubeYouTubePublisherDoUploadData* _data_);
VALA_EXTERN GType publishing_you_tube_uploader_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingYouTubeUploader* publishing_you_tube_uploader_new (PublishingRESTSupportGoogleSession* session,
                                                             SpitPublishingPublishable** publishables,
                                                             gint publishables_length1,
                                                             PublishingYouTubePublishingParameters* parameters);
VALA_EXTERN PublishingYouTubeUploader* publishing_you_tube_uploader_construct (GType object_type,
                                                                   PublishingRESTSupportGoogleSession* session,
                                                                   SpitPublishingPublishable** publishables,
                                                                   gint publishables_length1,
                                                                   PublishingYouTubePublishingParameters* parameters);
static void _publishing_you_tube_you_tube_publisher_on_upload_status_updated_spit_publishing_progress_callback (gint file_number,
                                                                                                         gdouble fraction_complete,
                                                                                                         gpointer self);
static void publishing_you_tube_you_tube_publisher_do_upload_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_);
static void publishing_you_tube_you_tube_publisher_do_show_success_pane (PublishingYouTubeYouTubePublisher* self);
static void publishing_you_tube_you_tube_publisher_real_do_logout (PublishingRESTSupportGooglePublisher* base);
static SpitPublishingAuthenticator* publishing_you_tube_you_tube_publisher_real_get_authenticator (PublishingRESTSupportGooglePublisher* base);
static void publishing_you_tube_you_tube_publisher_finalize (GObject * obj);
static GType publishing_you_tube_you_tube_publisher_get_type_once (void);
static gpointer publishing_you_tube_publishing_options_pane_privacy_description_ref (gpointer instance);
static void publishing_you_tube_publishing_options_pane_privacy_description_unref (gpointer instance);
static GParamSpec* publishing_you_tube_publishing_options_pane_param_spec_privacy_description (const gchar* name,
                                                                                        const gchar* nick,
                                                                                        const gchar* blurb,
                                                                                        GType object_type,
                                                                                        GParamFlags flags) G_GNUC_UNUSED ;
static void publishing_you_tube_publishing_options_pane_value_set_privacy_description (GValue* value,
                                                                                gpointer v_object) G_GNUC_UNUSED ;
static void publishing_you_tube_publishing_options_pane_value_take_privacy_description (GValue* value,
                                                                                 gpointer v_object) G_GNUC_UNUSED ;
static gpointer publishing_you_tube_publishing_options_pane_value_get_privacy_description (const GValue* value) G_GNUC_UNUSED ;
static GType publishing_you_tube_publishing_options_pane_privacy_description_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static PublishingYouTubePublishingOptionsPanePrivacyDescription** publishing_you_tube_publishing_options_pane_create_privacy_descriptions (PublishingYouTubePublishingOptionsPane* self,
                                                                                                                                    gint* result_length1);
static void publishing_you_tube_publishing_options_pane_on_logout_clicked (PublishingYouTubePublishingOptionsPane* self);
static void _publishing_you_tube_publishing_options_pane_on_logout_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                        gpointer self);
static void publishing_you_tube_publishing_options_pane_on_publish_clicked (PublishingYouTubePublishingOptionsPane* self);
static void _publishing_you_tube_publishing_options_pane_on_publish_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                         gpointer self);
static void publishing_you_tube_publishing_options_pane_update_publish_button_sensitivity (PublishingYouTubePublishingOptionsPane* self);
static PublishingYouTubePublishingOptionsPanePrivacyDescription* publishing_you_tube_publishing_options_pane_privacy_description_new (const gchar* description,
                                                                                                                               PublishingYouTubePrivacySetting privacy_setting);
static PublishingYouTubePublishingOptionsPanePrivacyDescription* publishing_you_tube_publishing_options_pane_privacy_description_construct (GType object_type,
                                                                                                                                     const gchar* description,
                                                                                                                                     PublishingYouTubePrivacySetting privacy_setting);
static void _vala_array_add21 (PublishingYouTubePublishingOptionsPanePrivacyDescription** * array,
                        gint* length,
                        gint* size,
                        PublishingYouTubePublishingOptionsPanePrivacyDescription* value);
static void _vala_array_add22 (PublishingYouTubePublishingOptionsPanePrivacyDescription** * array,
                        gint* length,
                        gint* size,
                        PublishingYouTubePublishingOptionsPanePrivacyDescription* value);
static void _vala_array_add23 (PublishingYouTubePublishingOptionsPanePrivacyDescription** * array,
                        gint* length,
                        gint* size,
                        PublishingYouTubePublishingOptionsPanePrivacyDescription* value);
static GtkWidget* publishing_you_tube_publishing_options_pane_real_get_widget (SpitPublishingDialogPane* base);
static SpitPublishingDialogPaneGeometryOptions publishing_you_tube_publishing_options_pane_real_get_preferred_geometry (SpitPublishingDialogPane* base);
static void publishing_you_tube_publishing_options_pane_real_on_pane_installed (SpitPublishingDialogPane* base);
static void publishing_you_tube_publishing_options_pane_real_on_pane_uninstalled (SpitPublishingDialogPane* base);
static void publishing_you_tube_publishing_options_pane_privacy_description_finalize (PublishingYouTubePublishingOptionsPanePrivacyDescription * obj);
static GType publishing_you_tube_publishing_options_pane_privacy_description_get_type_once (void);
static void publishing_you_tube_publishing_options_pane_finalize (GObject * obj);
static GType publishing_you_tube_publishing_options_pane_get_type_once (void);
static PublishingRESTSupportTransaction* publishing_you_tube_uploader_real_create_transaction (PublishingRESTSupportBatchUploader* base,
                                                                                        SpitPublishingPublishable* publishable);
VALA_EXTERN PublishingYouTubeUploadTransaction* publishing_you_tube_upload_transaction_new (PublishingRESTSupportGoogleSession* session,
                                                                                PublishingYouTubePublishingParameters* parameters,
                                                                                SpitPublishingPublishable* publishable);
VALA_EXTERN PublishingYouTubeUploadTransaction* publishing_you_tube_upload_transaction_construct (GType object_type,
                                                                                      PublishingRESTSupportGoogleSession* session,
                                                                                      PublishingYouTubePublishingParameters* parameters,
                                                                                      SpitPublishingPublishable* publishable);
VALA_EXTERN GType publishing_you_tube_upload_transaction_get_type (void) G_GNUC_CONST ;
static void publishing_you_tube_uploader_finalize (PublishingRESTSupportBatchUploader * obj);
static GType publishing_you_tube_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);

YouTubeService*
you_tube_service_construct (GType object_type)
{
	YouTubeService * self = NULL;
	self = (YouTubeService*) g_object_new (object_type, NULL);
	return self;
}

YouTubeService*
you_tube_service_new (void)
{
	return you_tube_service_construct (TYPE_YOU_TUBE_SERVICE);
}

static gint
you_tube_service_real_get_pluggable_interface (SpitPluggable* base,
                                               gint min_host_interface,
                                               gint max_host_interface)
{
	YouTubeService * self;
	gint result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_YOU_TUBE_SERVICE, YouTubeService);
	result = spit_negotiate_interfaces (min_host_interface, max_host_interface, SPIT_PUBLISHING_CURRENT_INTERFACE);
	return result;
}

static const gchar*
you_tube_service_real_get_id (SpitPluggable* base)
{
	YouTubeService * self;
	const gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_YOU_TUBE_SERVICE, YouTubeService);
	result = "org.gnome.shotwell.publishing.youtube";
	return result;
}

static const gchar*
you_tube_service_real_get_pluggable_name (SpitPluggable* base)
{
	YouTubeService * self;
	const gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_YOU_TUBE_SERVICE, YouTubeService);
	result = "YouTube";
	return result;
}

static SpitPluggableInfo*
you_tube_service_real_get_info (SpitPluggable* base)
{
	YouTubeService * self;
	SpitPluggableInfo* info = NULL;
	SpitPluggableInfo* _tmp0_;
	SpitPluggableInfo* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_YOU_TUBE_SERVICE, YouTubeService);
	_tmp0_ = spit_pluggable_info_new ();
	info = _tmp0_;
	spit_pluggable_info_set_authors (info, "Jani Monoses, Lucas Beeler");
	spit_pluggable_info_set_copyright (info, _ ("Copyright 2016 Software Freedom Conservancy Inc."));
	spit_pluggable_info_set_icon_name (info, "youtube");
	result = info;
	return result;
}

static SpitPublishingPublisher*
you_tube_service_real_create_publisher (SpitPublishingService* base,
                                        SpitPublishingPluginHost* host)
{
	YouTubeService * self;
	PublishingYouTubeYouTubePublisher* _tmp0_;
	SpitPublishingPublisher* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_YOU_TUBE_SERVICE, YouTubeService);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (host, SPIT_PUBLISHING_TYPE_PLUGIN_HOST), NULL);
	_tmp0_ = publishing_you_tube_you_tube_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
you_tube_service_real_get_supported_media (SpitPublishingService* base)
{
	YouTubeService * self;
	SpitPublishingPublisherMediaType result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_YOU_TUBE_SERVICE, YouTubeService);
	result = SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_VIDEO;
	return result;
}

static void
you_tube_service_real_activation (SpitPluggable* base,
                                  gboolean enabled)
{
	YouTubeService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_YOU_TUBE_SERVICE, YouTubeService);
}

static void
you_tube_service_class_init (YouTubeServiceClass * klass,
                             gpointer klass_data)
{
	you_tube_service_parent_class = g_type_class_peek_parent (klass);
}

static void
you_tube_service_spit_pluggable_interface_init (SpitPluggableIface * iface,
                                                gpointer iface_data)
{
	you_tube_service_spit_pluggable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_pluggable_interface = (gint (*) (SpitPluggable*, gint, gint)) you_tube_service_real_get_pluggable_interface;
	iface->get_id = (const gchar* (*) (SpitPluggable*)) you_tube_service_real_get_id;
	iface->get_pluggable_name = (const gchar* (*) (SpitPluggable*)) you_tube_service_real_get_pluggable_name;
	iface->get_info = (SpitPluggableInfo* (*) (SpitPluggable*)) you_tube_service_real_get_info;
	iface->activation = (void (*) (SpitPluggable*, gboolean)) you_tube_service_real_activation;
}

static void
you_tube_service_spit_publishing_service_interface_init (SpitPublishingServiceIface * iface,
                                                         gpointer iface_data)
{
	you_tube_service_spit_publishing_service_parent_iface = g_type_interface_peek_parent (iface);
	iface->create_publisher = (SpitPublishingPublisher* (*) (SpitPublishingService*, SpitPublishingPluginHost*)) you_tube_service_real_create_publisher;
	iface->get_supported_media = (SpitPublishingPublisherMediaType (*) (SpitPublishingService*)) you_tube_service_real_get_supported_media;
}

static void
you_tube_service_instance_init (YouTubeService * self,
                                gpointer klass)
{
}

static GType
you_tube_service_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (YouTubeServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) you_tube_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (YouTubeService), 0, (GInstanceInitFunc) you_tube_service_instance_init, NULL };
	static const GInterfaceInfo spit_pluggable_info = { (GInterfaceInitFunc) you_tube_service_spit_pluggable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo spit_publishing_service_info = { (GInterfaceInitFunc) you_tube_service_spit_publishing_service_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType you_tube_service_type_id;
	you_tube_service_type_id = g_type_register_static (G_TYPE_OBJECT, "YouTubeService", &g_define_type_info, 0);
	g_type_add_interface_static (you_tube_service_type_id, SPIT_TYPE_PLUGGABLE, &spit_pluggable_info);
	g_type_add_interface_static (you_tube_service_type_id, SPIT_PUBLISHING_TYPE_SERVICE, &spit_publishing_service_info);
	return you_tube_service_type_id;
}

GType
you_tube_service_get_type (void)
{
	static volatile gsize you_tube_service_type_id__once = 0;
	if (g_once_init_enter (&you_tube_service_type_id__once)) {
		GType you_tube_service_type_id;
		you_tube_service_type_id = you_tube_service_get_type_once ();
		g_once_init_leave (&you_tube_service_type_id__once, you_tube_service_type_id);
	}
	return you_tube_service_type_id__once;
}

gchar*
publishing_you_tube_privacy_setting_to_string (PublishingYouTubePrivacySetting self)
{
	gchar* result;
	switch (self) {
		case PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PUBLIC:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("public");
			result = _tmp0_;
			return result;
		}
		case PUBLISHING_YOU_TUBE_PRIVACY_SETTING_UNLISTED:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("unlisted");
			result = _tmp1_;
			return result;
		}
		case PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PRIVATE:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("private");
			result = _tmp2_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static GType
publishing_you_tube_privacy_setting_get_type_once (void)
{
	static const GEnumValue values[] = {{PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PUBLIC, "PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PUBLIC", "public"}, {PUBLISHING_YOU_TUBE_PRIVACY_SETTING_UNLISTED, "PUBLISHING_YOU_TUBE_PRIVACY_SETTING_UNLISTED", "unlisted"}, {PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PRIVATE, "PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PRIVATE", "private"}, {0, NULL, NULL}};
	GType publishing_you_tube_privacy_setting_type_id;
	publishing_you_tube_privacy_setting_type_id = g_enum_register_static ("PublishingYouTubePrivacySetting", values);
	return publishing_you_tube_privacy_setting_type_id;
}

GType
publishing_you_tube_privacy_setting_get_type (void)
{
	static volatile gsize publishing_you_tube_privacy_setting_type_id__once = 0;
	if (g_once_init_enter (&publishing_you_tube_privacy_setting_type_id__once)) {
		GType publishing_you_tube_privacy_setting_type_id;
		publishing_you_tube_privacy_setting_type_id = publishing_you_tube_privacy_setting_get_type_once ();
		g_once_init_leave (&publishing_you_tube_privacy_setting_type_id__once, publishing_you_tube_privacy_setting_type_id);
	}
	return publishing_you_tube_privacy_setting_type_id__once;
}

static inline gpointer
publishing_you_tube_publishing_parameters_get_instance_private (PublishingYouTubePublishingParameters* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingYouTubePublishingParameters_private_offset);
}

PublishingYouTubePublishingParameters*
publishing_you_tube_publishing_parameters_construct (GType object_type)
{
	PublishingYouTubePublishingParameters* self = NULL;
	self = (PublishingYouTubePublishingParameters*) g_type_create_instance (object_type);
	self->priv->privacy = PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PRIVATE;
	_g_free0 (self->priv->user_name);
	self->priv->user_name = NULL;
	return self;
}

PublishingYouTubePublishingParameters*
publishing_you_tube_publishing_parameters_new (void)
{
	return publishing_you_tube_publishing_parameters_construct (PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS);
}

PublishingYouTubePrivacySetting
publishing_you_tube_publishing_parameters_get_privacy (PublishingYouTubePublishingParameters* self)
{
	PublishingYouTubePrivacySetting result;
	g_return_val_if_fail (PUBLISHING_YOU_TUBE_IS_PUBLISHING_PARAMETERS (self), 0);
	result = self->priv->privacy;
	return result;
}

void
publishing_you_tube_publishing_parameters_set_privacy (PublishingYouTubePublishingParameters* self,
                                                       PublishingYouTubePrivacySetting privacy)
{
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_PUBLISHING_PARAMETERS (self));
	self->priv->privacy = privacy;
}

gchar*
publishing_you_tube_publishing_parameters_get_user_name (PublishingYouTubePublishingParameters* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_YOU_TUBE_IS_PUBLISHING_PARAMETERS (self), NULL);
	_tmp0_ = self->priv->user_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

void
publishing_you_tube_publishing_parameters_set_user_name (PublishingYouTubePublishingParameters* self,
                                                         const gchar* user_name)
{
	gchar* _tmp0_;
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_PUBLISHING_PARAMETERS (self));
	_tmp0_ = g_strdup (user_name);
	_g_free0 (self->priv->user_name);
	self->priv->user_name = _tmp0_;
}

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

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

static void
publishing_you_tube_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_you_tube_publishing_parameters_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

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

static gchar*
publishing_you_tube_value_publishing_parameters_collect_value (GValue* value,
                                                               guint n_collect_values,
                                                               GTypeCValue* collect_values,
                                                               guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		PublishingYouTubePublishingParameters * 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_you_tube_publishing_parameters_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
publishing_you_tube_value_publishing_parameters_lcopy_value (const GValue* value,
                                                             guint n_collect_values,
                                                             GTypeCValue* collect_values,
                                                             guint collect_flags)
{
	PublishingYouTubePublishingParameters ** 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_you_tube_publishing_parameters_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
publishing_you_tube_param_spec_publishing_parameters (const gchar* name,
                                                      const gchar* nick,
                                                      const gchar* blurb,
                                                      GType object_type,
                                                      GParamFlags flags)
{
	PublishingYouTubeParamSpecPublishingParameters* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PUBLISHING_YOU_TUBE_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_you_tube_value_get_publishing_parameters (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS), NULL);
	return value->data[0].v_pointer;
}

void
publishing_you_tube_value_set_publishing_parameters (GValue* value,
                                                     gpointer v_object)
{
	PublishingYouTubePublishingParameters * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_YOU_TUBE_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_you_tube_publishing_parameters_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_you_tube_publishing_parameters_unref (old);
	}
}

void
publishing_you_tube_value_take_publishing_parameters (GValue* value,
                                                      gpointer v_object)
{
	PublishingYouTubePublishingParameters * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_YOU_TUBE_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_you_tube_publishing_parameters_unref (old);
	}
}

static void
publishing_you_tube_publishing_parameters_class_init (PublishingYouTubePublishingParametersClass * klass,
                                                      gpointer klass_data)
{
	publishing_you_tube_publishing_parameters_parent_class = g_type_class_peek_parent (klass);
	((PublishingYouTubePublishingParametersClass *) klass)->finalize = publishing_you_tube_publishing_parameters_finalize;
	g_type_class_adjust_private_offset (klass, &PublishingYouTubePublishingParameters_private_offset);
}

static void
publishing_you_tube_publishing_parameters_instance_init (PublishingYouTubePublishingParameters * self,
                                                         gpointer klass)
{
	self->priv = publishing_you_tube_publishing_parameters_get_instance_private (self);
	self->ref_count = 1;
}

static void
publishing_you_tube_publishing_parameters_finalize (PublishingYouTubePublishingParameters * obj)
{
	PublishingYouTubePublishingParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_PARAMETERS, PublishingYouTubePublishingParameters);
	g_signal_handlers_destroy (self);
	_g_free0 (self->priv->user_name);
}

static GType
publishing_you_tube_publishing_parameters_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_you_tube_value_publishing_parameters_init, publishing_you_tube_value_publishing_parameters_free_value, publishing_you_tube_value_publishing_parameters_copy_value, publishing_you_tube_value_publishing_parameters_peek_pointer, "p", publishing_you_tube_value_publishing_parameters_collect_value, "p", publishing_you_tube_value_publishing_parameters_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingYouTubePublishingParametersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_you_tube_publishing_parameters_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingYouTubePublishingParameters), 0, (GInstanceInitFunc) publishing_you_tube_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_you_tube_publishing_parameters_type_id;
	publishing_you_tube_publishing_parameters_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingYouTubePublishingParameters", &g_define_type_info, &g_define_type_fundamental_info, 0);
	PublishingYouTubePublishingParameters_private_offset = g_type_add_instance_private (publishing_you_tube_publishing_parameters_type_id, sizeof (PublishingYouTubePublishingParametersPrivate));
	return publishing_you_tube_publishing_parameters_type_id;
}

GType
publishing_you_tube_publishing_parameters_get_type (void)
{
	static volatile gsize publishing_you_tube_publishing_parameters_type_id__once = 0;
	if (g_once_init_enter (&publishing_you_tube_publishing_parameters_type_id__once)) {
		GType publishing_you_tube_publishing_parameters_type_id;
		publishing_you_tube_publishing_parameters_type_id = publishing_you_tube_publishing_parameters_get_type_once ();
		g_once_init_leave (&publishing_you_tube_publishing_parameters_type_id__once, publishing_you_tube_publishing_parameters_type_id);
	}
	return publishing_you_tube_publishing_parameters_type_id__once;
}

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

void
publishing_you_tube_publishing_parameters_unref (gpointer instance)
{
	PublishingYouTubePublishingParameters * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_YOU_TUBE_PUBLISHING_PARAMETERS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
publishing_you_tube_you_tube_publisher_get_instance_private (PublishingYouTubeYouTubePublisher* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingYouTubeYouTubePublisher_private_offset);
}

PublishingYouTubeYouTubePublisher*
publishing_you_tube_you_tube_publisher_construct (GType object_type,
                                                  SpitPublishingService* service,
                                                  SpitPublishingPluginHost* host)
{
	PublishingYouTubeYouTubePublisher * self = NULL;
	PublishingYouTubePublishingParameters* _tmp0_;
	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 = (PublishingYouTubeYouTubePublisher*) publishing_rest_support_google_publisher_construct (object_type, service, host, "https://www.googleapis.com/upload/youtube/v3/videos");
	self->priv->running = FALSE;
	_tmp0_ = publishing_you_tube_publishing_parameters_new ();
	_publishing_you_tube_publishing_parameters_unref0 (self->priv->publishing_parameters);
	self->priv->publishing_parameters = _tmp0_;
	(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;
	self->priv->progress_reporter = NULL;
	self->priv->progress_reporter_target = NULL;
	self->priv->progress_reporter_target_destroy_notify = NULL;
	return self;
}

PublishingYouTubeYouTubePublisher*
publishing_you_tube_you_tube_publisher_new (SpitPublishingService* service,
                                            SpitPublishingPluginHost* host)
{
	return publishing_you_tube_you_tube_publisher_construct (PUBLISHING_YOU_TUBE_TYPE_YOU_TUBE_PUBLISHER, service, host);
}

static gboolean
publishing_you_tube_you_tube_publisher_real_is_running (PublishingRESTSupportGooglePublisher* base)
{
	PublishingYouTubeYouTubePublisher * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_YOU_TUBE_PUBLISHER, PublishingYouTubeYouTubePublisher);
	result = self->priv->running;
	return result;
}

static void
publishing_you_tube_you_tube_publisher_real_start (PublishingRESTSupportGooglePublisher* base)
{
	PublishingYouTubeYouTubePublisher * self;
	SpitPublishingAuthenticator* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_YOU_TUBE_PUBLISHER, PublishingYouTubeYouTubePublisher);
	g_debug ("YouTubePublishing.vala:111: YouTubePublisher: started.");
	if (publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
		return;
	}
	self->priv->running = TRUE;
	_tmp0_ = self->priv->authenticator;
	spit_publishing_authenticator_authenticate (_tmp0_);
}

static void
publishing_you_tube_you_tube_publisher_real_stop (PublishingRESTSupportGooglePublisher* base)
{
	PublishingYouTubeYouTubePublisher * self;
	PublishingRESTSupportGoogleSession* _tmp0_;
	PublishingRESTSupportGoogleSession* _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_YOU_TUBE_PUBLISHER, PublishingYouTubeYouTubePublisher);
	g_debug ("YouTubePublishing.vala:122: YouTubePublisher: stopped.");
	self->priv->running = FALSE;
	_tmp0_ = publishing_rest_support_google_publisher_get_session (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_tmp1_ = _tmp0_;
	publishing_rest_support_session_stop_transactions (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession));
	_publishing_rest_support_session_unref0 (_tmp1_);
}

static void
publishing_you_tube_you_tube_publisher_real_on_login_flow_complete (PublishingRESTSupportGooglePublisher* base)
{
	PublishingYouTubeYouTubePublisher * self;
	PublishingYouTubePublishingParameters* _tmp0_;
	PublishingRESTSupportGoogleSession* _tmp1_;
	PublishingRESTSupportGoogleSession* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_YOU_TUBE_PUBLISHER, PublishingYouTubeYouTubePublisher);
	g_debug ("YouTubePublishing.vala:130: EVENT: OAuth login flow complete.");
	_tmp0_ = self->priv->publishing_parameters;
	_tmp1_ = publishing_rest_support_google_publisher_get_session (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_tmp2_ = _tmp1_;
	_tmp3_ = publishing_rest_support_google_session_get_user_name (_tmp2_);
	_tmp4_ = _tmp3_;
	publishing_you_tube_publishing_parameters_set_user_name (_tmp0_, _tmp4_);
	_g_free0 (_tmp4_);
	_publishing_rest_support_session_unref0 (_tmp2_);
	publishing_you_tube_you_tube_publisher_do_show_publishing_options_pane (self);
}

static void
publishing_you_tube_you_tube_publisher_on_publishing_options_logout (PublishingYouTubeYouTubePublisher* self)
{
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_YOU_TUBE_PUBLISHER (self));
	g_debug ("YouTubePublishing.vala:138: EVENT: user clicked 'Logout' in the publis" \
"hing options pane.");
	if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
		return;
	}
	publishing_rest_support_google_publisher_do_logout (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
}

static void
publishing_you_tube_you_tube_publisher_on_publishing_options_publish (PublishingYouTubeYouTubePublisher* self)
{
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_YOU_TUBE_PUBLISHER (self));
	g_debug ("YouTubePublishing.vala:147: EVENT: user clicked 'Publish' in the publi" \
"shing options pane.");
	if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
		return;
	}
	publishing_you_tube_you_tube_publisher_do_upload (self, NULL, NULL);
}

static void
publishing_you_tube_you_tube_publisher_on_upload_status_updated (PublishingYouTubeYouTubePublisher* self,
                                                                 gint file_number,
                                                                 gdouble completed_fraction)
{
	SpitPublishingProgressCallback _tmp0_;
	gpointer _tmp0__target;
	SpitPublishingProgressCallback _tmp1_;
	gpointer _tmp1__target;
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_YOU_TUBE_PUBLISHER (self));
	g_debug ("YouTubePublishing.vala:156: EVENT: uploader reports upload %.2f percen" \
"t complete.", 100.0 * completed_fraction);
	_tmp0_ = self->priv->progress_reporter;
	_tmp0__target = self->priv->progress_reporter_target;
	_vala_assert (_tmp0_ != NULL, "progress_reporter != null");
	if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
		return;
	}
	_tmp1_ = self->priv->progress_reporter;
	_tmp1__target = self->priv->progress_reporter_target;
	_tmp1_ (file_number, completed_fraction, _tmp1__target);
}

static void
_publishing_you_tube_you_tube_publisher_on_publishing_options_publish_publishing_you_tube_publishing_options_pane_publish (PublishingYouTubePublishingOptionsPane* _sender,
                                                                                                                           gpointer self)
{
	publishing_you_tube_you_tube_publisher_on_publishing_options_publish ((PublishingYouTubeYouTubePublisher*) self);
}

static void
_publishing_you_tube_you_tube_publisher_on_publishing_options_logout_publishing_you_tube_publishing_options_pane_logout (PublishingYouTubePublishingOptionsPane* _sender,
                                                                                                                         gpointer self)
{
	publishing_you_tube_you_tube_publisher_on_publishing_options_logout ((PublishingYouTubeYouTubePublisher*) self);
}

static void
publishing_you_tube_you_tube_publisher_do_show_publishing_options_pane (PublishingYouTubeYouTubePublisher* self)
{
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp0_;
	PublishingYouTubePublishingOptionsPane* opts_pane = NULL;
	SpitPublishingAuthenticator* _tmp7_;
	SpitPublishingPluginHost* _tmp8_;
	GtkBuilder* _tmp9_;
	PublishingYouTubePublishingParameters* _tmp10_;
	PublishingYouTubePublishingOptionsPane* _tmp11_;
	PublishingYouTubePublishingOptionsPane* _tmp12_;
	PublishingYouTubePublishingOptionsPane* _tmp13_;
	SpitPublishingPluginHost* _tmp14_;
	PublishingYouTubePublishingOptionsPane* _tmp15_;
	SpitPublishingPluginHost* _tmp16_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_YOU_TUBE_PUBLISHER (self));
	g_debug ("YouTubePublishing.vala:167: ACTION: showing publishing options pane.");
	_tmp0_ = gtk_builder_new ();
	builder = _tmp0_;
	{
		GtkBuilder* _tmp1_;
		_tmp1_ = builder;
		gtk_builder_add_from_resource (_tmp1_, PLUGIN_RESOURCE_PATH "/youtube_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* _tmp2_;
		const gchar* _tmp3_;
		SpitPublishingPluginHost* _tmp4_;
		GError* _tmp5_;
		GError* _tmp6_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		g_warning ("YouTubePublishing.vala:175: Could not parse UI file! Error: %s.", _tmp3_);
		_tmp4_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
		_tmp5_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_LOCAL_FILE_ERROR, _ ("A file required for publishing is unavailable. Publishing to YouTube c" \
"an’t continue."));
		_tmp6_ = _tmp5_;
		spit_publishing_plugin_host_post_error (_tmp4_, _tmp6_);
		_g_error_free0 (_tmp6_);
		_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;
	}
	_tmp7_ = self->priv->authenticator;
	_tmp8_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_tmp9_ = builder;
	_tmp10_ = self->priv->publishing_parameters;
	_tmp11_ = publishing_you_tube_publishing_options_pane_new (_tmp7_, _tmp8_, _tmp9_, _tmp10_);
	opts_pane = _tmp11_;
	_tmp12_ = opts_pane;
	g_signal_connect_object (_tmp12_, "publish", (GCallback) _publishing_you_tube_you_tube_publisher_on_publishing_options_publish_publishing_you_tube_publishing_options_pane_publish, self, 0);
	_tmp13_ = opts_pane;
	g_signal_connect_object (_tmp13_, "logout", (GCallback) _publishing_you_tube_you_tube_publisher_on_publishing_options_logout_publishing_you_tube_publishing_options_pane_logout, self, 0);
	_tmp14_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_tmp15_ = opts_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);
	_tmp16_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_set_service_locked (_tmp16_, FALSE);
	_g_object_unref0 (opts_pane);
	_g_object_unref0 (builder);
}

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

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

static void
publishing_you_tube_you_tube_publisher_do_upload (PublishingYouTubeYouTubePublisher* self,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_)
{
	PublishingYouTubeYouTubePublisherDoUploadData* _data_;
	PublishingYouTubeYouTubePublisher* _tmp0_;
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_YOU_TUBE_PUBLISHER (self));
	_data_ = g_slice_new0 (PublishingYouTubeYouTubePublisherDoUploadData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_you_tube_you_tube_publisher_do_upload_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	publishing_you_tube_you_tube_publisher_do_upload_co (_data_);
}

static void
publishing_you_tube_you_tube_publisher_do_upload_finish (PublishingYouTubeYouTubePublisher* self,
                                                         GAsyncResult* _res_)
{
	PublishingYouTubeYouTubePublisherDoUploadData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
_publishing_you_tube_you_tube_publisher_on_upload_status_updated_spit_publishing_progress_callback (gint file_number,
                                                                                                    gdouble fraction_complete,
                                                                                                    gpointer self)
{
	publishing_you_tube_you_tube_publisher_on_upload_status_updated ((PublishingYouTubeYouTubePublisher*) self, file_number, fraction_complete);
}

static void
publishing_you_tube_you_tube_publisher_do_upload_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_)
{
	PublishingYouTubeYouTubePublisherDoUploadData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_you_tube_you_tube_publisher_do_upload_co (_data_);
}

static gboolean
publishing_you_tube_you_tube_publisher_do_upload_co (PublishingYouTubeYouTubePublisherDoUploadData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("YouTubePublishing.vala:191: ACTION: uploading media items to remote se" \
"rver.");
	_data_->_tmp0_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp0_, TRUE);
	_data_->_tmp1_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_install_account_fetch_wait_pane (_data_->_tmp1_);
	_data_->_tmp2_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_data_->_tmp3_ = NULL;
	_data_->_tmp4_ = NULL;
	_data_->_tmp5_ = spit_publishing_plugin_host_serialize_publishables (_data_->_tmp2_, -1, FALSE, &_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 (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
		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_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_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_ = publishing_rest_support_google_publisher_get_session (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->publishables;
	_data_->_tmp11__length1 = _data_->publishables_length1;
	_data_->_tmp12_ = _data_->self->priv->publishing_parameters;
	_data_->_tmp13_ = publishing_you_tube_uploader_new (_data_->_tmp10_, _data_->_tmp11_, _data_->_tmp11__length1, _data_->_tmp12_);
	_data_->_tmp14_ = _data_->_tmp13_;
	_publishing_rest_support_session_unref0 (_data_->_tmp10_);
	_data_->uploader = _data_->_tmp14_;
	{
		_data_->_tmp15_ = _data_->uploader;
		_data_->_state_ = 1;
		publishing_rest_support_batch_uploader_upload_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp15_, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader), _publishing_you_tube_you_tube_publisher_on_upload_status_updated_spit_publishing_progress_callback, _data_->self, publishing_you_tube_you_tube_publisher_do_upload_ready, _data_);
		return FALSE;
		_state_1:
		_data_->num_published = publishing_rest_support_batch_uploader_upload_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp15_, 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 ("YouTubePublishing.vala:210: EVENT: uploader reports upload complete; %" \
"d items published.", _data_->num_published);
		if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
			_publishing_rest_support_batch_uploader_unref0 (_data_->uploader);
			_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;
		}
		publishing_you_tube_you_tube_publisher_do_show_success_pane (_data_->self);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
			_g_error_free0 (_data_->err);
			_publishing_rest_support_batch_uploader_unref0 (_data_->uploader);
			_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;
		}
		_data_->_tmp16_ = _data_->err;
		_data_->_tmp17_ = _data_->_tmp16_->message;
		g_debug ("YouTubePublishing.vala:220: EVENT: uploader reports upload error = '%s" \
"'.", _data_->_tmp17_);
		_data_->_tmp18_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
		_data_->_tmp19_ = _data_->err;
		spit_publishing_plugin_host_post_error (_data_->_tmp18_, _data_->_tmp19_);
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_publishing_rest_support_batch_uploader_unref0 (_data_->uploader);
		_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);
	_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_you_tube_you_tube_publisher_do_show_success_pane (PublishingYouTubeYouTubePublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_YOU_TUBE_PUBLISHER (self));
	g_debug ("YouTubePublishing.vala:227: ACTION: showing success pane.");
	_tmp0_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_set_service_locked (_tmp0_, FALSE);
	_tmp1_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_install_success_pane (_tmp1_);
}

static void
publishing_you_tube_you_tube_publisher_real_do_logout (PublishingRESTSupportGooglePublisher* base)
{
	PublishingYouTubeYouTubePublisher * self;
	SpitPublishingAuthenticator* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_YOU_TUBE_PUBLISHER, PublishingYouTubeYouTubePublisher);
	g_debug ("YouTubePublishing.vala:234: ACTION: logging out user.");
	_tmp0_ = self->priv->authenticator;
	if (spit_publishing_authenticator_can_logout (_tmp0_)) {
		SpitPublishingAuthenticator* _tmp1_;
		SpitPublishingAuthenticator* _tmp2_;
		_tmp1_ = self->priv->authenticator;
		spit_publishing_authenticator_logout (_tmp1_);
		_tmp2_ = self->priv->authenticator;
		spit_publishing_authenticator_authenticate (_tmp2_);
	}
}

static SpitPublishingAuthenticator*
publishing_you_tube_you_tube_publisher_real_get_authenticator (PublishingRESTSupportGooglePublisher* base)
{
	PublishingYouTubeYouTubePublisher * self;
	SpitPublishingAuthenticator* _tmp0_;
	SpitPublishingAuthenticator* _tmp5_;
	SpitPublishingAuthenticator* _tmp6_;
	SpitPublishingAuthenticator* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_YOU_TUBE_PUBLISHER, PublishingYouTubeYouTubePublisher);
	_tmp0_ = self->priv->authenticator;
	if (_tmp0_ == NULL) {
		PublishingAuthenticatorFactory* _tmp1_;
		PublishingAuthenticatorFactory* _tmp2_;
		SpitPublishingPluginHost* _tmp3_;
		SpitPublishingAuthenticator* _tmp4_;
		_tmp1_ = publishing_authenticator_factory_get_instance ();
		_tmp2_ = _tmp1_;
		_tmp3_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
		_tmp4_ = spit_publishing_authenticator_factory_create (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SPIT_PUBLISHING_TYPE_AUTHENTICATOR_FACTORY, SpitPublishingAuthenticatorFactory), "youtube", _tmp3_);
		_g_object_unref0 (self->priv->authenticator);
		self->priv->authenticator = _tmp4_;
		_g_object_unref0 (_tmp2_);
	}
	_tmp5_ = self->priv->authenticator;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	result = _tmp6_;
	return result;
}

static void
publishing_you_tube_you_tube_publisher_class_init (PublishingYouTubeYouTubePublisherClass * klass,
                                                   gpointer klass_data)
{
	publishing_you_tube_you_tube_publisher_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingYouTubeYouTubePublisher_private_offset);
	((PublishingRESTSupportGooglePublisherClass *) klass)->is_running = (gboolean (*) (PublishingRESTSupportGooglePublisher*)) publishing_you_tube_you_tube_publisher_real_is_running;
	((PublishingRESTSupportGooglePublisherClass *) klass)->start = (void (*) (PublishingRESTSupportGooglePublisher*)) publishing_you_tube_you_tube_publisher_real_start;
	((PublishingRESTSupportGooglePublisherClass *) klass)->stop = (void (*) (PublishingRESTSupportGooglePublisher*)) publishing_you_tube_you_tube_publisher_real_stop;
	((PublishingRESTSupportGooglePublisherClass *) klass)->on_login_flow_complete = (void (*) (PublishingRESTSupportGooglePublisher*)) publishing_you_tube_you_tube_publisher_real_on_login_flow_complete;
	((PublishingRESTSupportGooglePublisherClass *) klass)->do_logout = (void (*) (PublishingRESTSupportGooglePublisher*)) publishing_you_tube_you_tube_publisher_real_do_logout;
	((PublishingRESTSupportGooglePublisherClass *) klass)->get_authenticator = (SpitPublishingAuthenticator* (*) (PublishingRESTSupportGooglePublisher*)) publishing_you_tube_you_tube_publisher_real_get_authenticator;
	G_OBJECT_CLASS (klass)->finalize = publishing_you_tube_you_tube_publisher_finalize;
}

static void
publishing_you_tube_you_tube_publisher_instance_init (PublishingYouTubeYouTubePublisher * self,
                                                      gpointer klass)
{
	self->priv = publishing_you_tube_you_tube_publisher_get_instance_private (self);
}

static void
publishing_you_tube_you_tube_publisher_finalize (GObject * obj)
{
	PublishingYouTubeYouTubePublisher * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_YOU_TUBE_TYPE_YOU_TUBE_PUBLISHER, PublishingYouTubeYouTubePublisher);
	_publishing_you_tube_publishing_parameters_unref0 (self->priv->publishing_parameters);
	(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;
	_g_object_unref0 (self->priv->authenticator);
	G_OBJECT_CLASS (publishing_you_tube_you_tube_publisher_parent_class)->finalize (obj);
}

static GType
publishing_you_tube_you_tube_publisher_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingYouTubeYouTubePublisherClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_you_tube_you_tube_publisher_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingYouTubeYouTubePublisher), 0, (GInstanceInitFunc) publishing_you_tube_you_tube_publisher_instance_init, NULL };
	GType publishing_you_tube_you_tube_publisher_type_id;
	publishing_you_tube_you_tube_publisher_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, "PublishingYouTubeYouTubePublisher", &g_define_type_info, 0);
	PublishingYouTubeYouTubePublisher_private_offset = g_type_add_instance_private (publishing_you_tube_you_tube_publisher_type_id, sizeof (PublishingYouTubeYouTubePublisherPrivate));
	return publishing_you_tube_you_tube_publisher_type_id;
}

GType
publishing_you_tube_you_tube_publisher_get_type (void)
{
	static volatile gsize publishing_you_tube_you_tube_publisher_type_id__once = 0;
	if (g_once_init_enter (&publishing_you_tube_you_tube_publisher_type_id__once)) {
		GType publishing_you_tube_you_tube_publisher_type_id;
		publishing_you_tube_you_tube_publisher_type_id = publishing_you_tube_you_tube_publisher_get_type_once ();
		g_once_init_leave (&publishing_you_tube_you_tube_publisher_type_id__once, publishing_you_tube_you_tube_publisher_type_id);
	}
	return publishing_you_tube_you_tube_publisher_type_id__once;
}

static inline gpointer
publishing_you_tube_publishing_options_pane_get_instance_private (PublishingYouTubePublishingOptionsPane* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingYouTubePublishingOptionsPane_private_offset);
}

static gpointer
_publishing_you_tube_publishing_parameters_ref0 (gpointer self)
{
	return self ? publishing_you_tube_publishing_parameters_ref (self) : NULL;
}

static gpointer
_publishing_you_tube_publishing_options_pane_privacy_description_ref0 (gpointer self)
{
	return self ? publishing_you_tube_publishing_options_pane_privacy_description_ref (self) : NULL;
}

static void
_publishing_you_tube_publishing_options_pane_on_logout_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                   gpointer self)
{
	publishing_you_tube_publishing_options_pane_on_logout_clicked ((PublishingYouTubePublishingOptionsPane*) self);
}

static void
_publishing_you_tube_publishing_options_pane_on_publish_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                    gpointer self)
{
	publishing_you_tube_publishing_options_pane_on_publish_clicked ((PublishingYouTubePublishingOptionsPane*) self);
}

PublishingYouTubePublishingOptionsPane*
publishing_you_tube_publishing_options_pane_construct (GType object_type,
                                                       SpitPublishingAuthenticator* authenticator,
                                                       SpitPublishingPluginHost* host,
                                                       GtkBuilder* builder,
                                                       PublishingYouTubePublishingParameters* publishing_parameters)
{
	PublishingYouTubePublishingOptionsPane * self = NULL;
	gint _tmp0_ = 0;
	PublishingYouTubePublishingOptionsPanePrivacyDescription** _tmp1_;
	PublishingYouTubePublishingParameters* _tmp2_;
	GtkBuilder* _tmp3_;
	GSList* _tmp4_;
	GSList* _tmp5_;
	GtkBuilder* _tmp6_;
	GObject* _tmp7_;
	GtkLabel* _tmp8_;
	GtkBuilder* _tmp9_;
	GObject* _tmp10_;
	GtkComboBoxText* _tmp11_;
	GtkBuilder* _tmp12_;
	GObject* _tmp13_;
	GtkButton* _tmp14_;
	GtkBuilder* _tmp15_;
	GObject* _tmp16_;
	GtkButton* _tmp17_;
	GtkBuilder* _tmp18_;
	GObject* _tmp19_;
	GtkBox* _tmp20_;
	GtkBuilder* _tmp21_;
	GObject* _tmp22_;
	GtkLabel* _tmp23_;
	GtkLabel* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	PublishingYouTubePublishingOptionsPanePrivacyDescription** _tmp33_;
	gint _tmp33__length1;
	GtkComboBoxText* _tmp38_;
	GtkLabel* _tmp39_;
	GtkComboBoxText* _tmp40_;
	GtkButton* _tmp41_;
	GtkButton* _tmp42_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (authenticator, SPIT_PUBLISHING_TYPE_AUTHENTICATOR), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (host, SPIT_PUBLISHING_TYPE_PLUGIN_HOST), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (builder, gtk_builder_get_type ()), NULL);
	g_return_val_if_fail (PUBLISHING_YOU_TUBE_IS_PUBLISHING_PARAMETERS (publishing_parameters), NULL);
	self = (PublishingYouTubePublishingOptionsPane*) g_object_new (object_type, NULL);
	_tmp1_ = publishing_you_tube_publishing_options_pane_create_privacy_descriptions (self, &_tmp0_);
	self->priv->privacy_descriptions = (_vala_array_free (self->priv->privacy_descriptions, self->priv->privacy_descriptions_length1, (GDestroyNotify) publishing_you_tube_publishing_options_pane_privacy_description_unref), NULL);
	self->priv->privacy_descriptions = _tmp1_;
	self->priv->privacy_descriptions_length1 = _tmp0_;
	self->priv->_privacy_descriptions_size_ = self->priv->privacy_descriptions_length1;
	_tmp2_ = _publishing_you_tube_publishing_parameters_ref0 (publishing_parameters);
	_publishing_you_tube_publishing_parameters_unref0 (self->priv->publishing_parameters);
	self->priv->publishing_parameters = _tmp2_;
	_tmp3_ = _g_object_ref0 (builder);
	_g_object_unref0 (self->priv->builder);
	self->priv->builder = _tmp3_;
	_vala_assert (builder != NULL, "builder != null");
	_tmp4_ = gtk_builder_get_objects (builder);
	_tmp5_ = _tmp4_;
	_vala_assert (g_slist_length (_tmp5_) > ((guint) 0), "builder.get_objects().length() > 0");
	(_tmp5_ == NULL) ? NULL : (_tmp5_ = (g_slist_free (_tmp5_), NULL));
	_tmp6_ = self->priv->builder;
	_tmp7_ = gtk_builder_get_object (_tmp6_, "login_identity_label");
	_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp7_) : NULL);
	_g_object_unref0 (self->priv->login_identity_label);
	self->priv->login_identity_label = _tmp8_;
	_tmp9_ = self->priv->builder;
	_tmp10_ = gtk_builder_get_object (_tmp9_, "privacy_combo");
	_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, gtk_combo_box_text_get_type ()) ? ((GtkComboBoxText*) _tmp10_) : NULL);
	_g_object_unref0 (self->priv->privacy_combo);
	self->priv->privacy_combo = _tmp11_;
	_tmp12_ = self->priv->builder;
	_tmp13_ = gtk_builder_get_object (_tmp12_, "publish_button");
	_tmp14_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, gtk_button_get_type ()) ? ((GtkButton*) _tmp13_) : NULL);
	_g_object_unref0 (self->priv->publish_button);
	self->priv->publish_button = _tmp14_;
	_tmp15_ = self->priv->builder;
	_tmp16_ = gtk_builder_get_object (_tmp15_, "logout_button");
	_tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, gtk_button_get_type ()) ? ((GtkButton*) _tmp16_) : NULL);
	_g_object_unref0 (self->priv->logout_button);
	self->priv->logout_button = _tmp17_;
	_tmp18_ = self->priv->builder;
	_tmp19_ = gtk_builder_get_object (_tmp18_, "youtube_pane_widget");
	_tmp20_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, gtk_box_get_type ()) ? ((GtkBox*) _tmp19_) : NULL);
	_g_object_unref0 (self->priv->pane_widget);
	self->priv->pane_widget = _tmp20_;
	_tmp21_ = self->priv->builder;
	_tmp22_ = gtk_builder_get_object (_tmp21_, "privacy_label");
	_tmp23_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp22_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp22_) : NULL);
	_g_object_unref0 (self->priv->privacy_label);
	self->priv->privacy_label = _tmp23_;
	if (!spit_publishing_authenticator_can_logout (authenticator)) {
		GtkButton* _tmp24_;
		GtkContainer* _tmp25_;
		GtkContainer* _tmp26_;
		GtkButton* _tmp27_;
		_tmp24_ = self->priv->logout_button;
		_tmp25_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_widget_get_type (), GtkWidget));
		_tmp26_ = _tmp25_;
		_tmp27_ = self->priv->logout_button;
		gtk_container_remove (_tmp26_, G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, gtk_widget_get_type (), GtkWidget));
	}
	_tmp28_ = self->priv->login_identity_label;
	_tmp29_ = publishing_you_tube_publishing_parameters_get_user_name (publishing_parameters);
	_tmp30_ = _tmp29_;
	_tmp31_ = g_strdup_printf (_ ("You are logged into YouTube as %s."), _tmp30_);
	_tmp32_ = _tmp31_;
	gtk_label_set_label (_tmp28_, _tmp32_);
	_g_free0 (_tmp32_);
	_g_free0 (_tmp30_);
	_tmp33_ = self->priv->privacy_descriptions;
	_tmp33__length1 = self->priv->privacy_descriptions_length1;
	{
		PublishingYouTubePublishingOptionsPanePrivacyDescription** desc_collection = NULL;
		gint desc_collection_length1 = 0;
		gint _desc_collection_size_ = 0;
		gint desc_it = 0;
		desc_collection = _tmp33_;
		desc_collection_length1 = _tmp33__length1;
		for (desc_it = 0; desc_it < desc_collection_length1; desc_it = desc_it + 1) {
			PublishingYouTubePublishingOptionsPanePrivacyDescription* _tmp34_;
			PublishingYouTubePublishingOptionsPanePrivacyDescription* desc = NULL;
			_tmp34_ = _publishing_you_tube_publishing_options_pane_privacy_description_ref0 (desc_collection[desc_it]);
			desc = _tmp34_;
			{
				GtkComboBoxText* _tmp35_;
				PublishingYouTubePublishingOptionsPanePrivacyDescription* _tmp36_;
				const gchar* _tmp37_;
				_tmp35_ = self->priv->privacy_combo;
				_tmp36_ = desc;
				_tmp37_ = _tmp36_->description;
				gtk_combo_box_text_append_text (_tmp35_, _tmp37_);
				_publishing_you_tube_publishing_options_pane_privacy_description_unref0 (desc);
			}
		}
	}
	_tmp38_ = self->priv->privacy_combo;
	gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, gtk_combo_box_get_type (), GtkComboBox), (gint) PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PUBLIC);
	_tmp39_ = self->priv->privacy_label;
	_tmp40_ = self->priv->privacy_combo;
	gtk_label_set_mnemonic_widget (_tmp39_, G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, gtk_widget_get_type (), GtkWidget));
	_tmp41_ = self->priv->logout_button;
	g_signal_connect_object (_tmp41_, "clicked", (GCallback) _publishing_you_tube_publishing_options_pane_on_logout_clicked_gtk_button_clicked, self, 0);
	_tmp42_ = self->priv->publish_button;
	g_signal_connect_object (_tmp42_, "clicked", (GCallback) _publishing_you_tube_publishing_options_pane_on_publish_clicked_gtk_button_clicked, self, 0);
	return self;
}

PublishingYouTubePublishingOptionsPane*
publishing_you_tube_publishing_options_pane_new (SpitPublishingAuthenticator* authenticator,
                                                 SpitPublishingPluginHost* host,
                                                 GtkBuilder* builder,
                                                 PublishingYouTubePublishingParameters* publishing_parameters)
{
	return publishing_you_tube_publishing_options_pane_construct (PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, authenticator, host, builder, publishing_parameters);
}

static void
publishing_you_tube_publishing_options_pane_on_publish_clicked (PublishingYouTubePublishingOptionsPane* self)
{
	PublishingYouTubePublishingParameters* _tmp0_;
	PublishingYouTubePublishingOptionsPanePrivacyDescription** _tmp1_;
	gint _tmp1__length1;
	GtkComboBoxText* _tmp2_;
	PublishingYouTubePublishingOptionsPanePrivacyDescription* _tmp3_;
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->publishing_parameters;
	_tmp1_ = self->priv->privacy_descriptions;
	_tmp1__length1 = self->priv->privacy_descriptions_length1;
	_tmp2_ = self->priv->privacy_combo;
	_tmp3_ = _tmp1_[gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_combo_box_get_type (), GtkComboBox))];
	publishing_you_tube_publishing_parameters_set_privacy (_tmp0_, _tmp3_->privacy_setting);
	g_signal_emit (self, publishing_you_tube_publishing_options_pane_signals[PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_PUBLISH_SIGNAL], 0);
}

static void
publishing_you_tube_publishing_options_pane_on_logout_clicked (PublishingYouTubePublishingOptionsPane* self)
{
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_PUBLISHING_OPTIONS_PANE (self));
	g_signal_emit (self, publishing_you_tube_publishing_options_pane_signals[PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_LOGOUT_SIGNAL], 0);
}

static void
publishing_you_tube_publishing_options_pane_update_publish_button_sensitivity (PublishingYouTubePublishingOptionsPane* self)
{
	GtkButton* _tmp0_;
	g_return_if_fail (PUBLISHING_YOU_TUBE_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->publish_button;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), TRUE);
}

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

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

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

static PublishingYouTubePublishingOptionsPanePrivacyDescription**
publishing_you_tube_publishing_options_pane_create_privacy_descriptions (PublishingYouTubePublishingOptionsPane* self,
                                                                         gint* result_length1)
{
	PublishingYouTubePublishingOptionsPanePrivacyDescription** _result_ = NULL;
	PublishingYouTubePublishingOptionsPanePrivacyDescription** _tmp0_;
	gint _result__length1;
	gint __result__size_;
	PublishingYouTubePublishingOptionsPanePrivacyDescription* _tmp1_;
	PublishingYouTubePublishingOptionsPanePrivacyDescription* _tmp2_;
	PublishingYouTubePublishingOptionsPanePrivacyDescription* _tmp3_;
	PublishingYouTubePublishingOptionsPanePrivacyDescription** _tmp4_;
	gint _tmp4__length1;
	PublishingYouTubePublishingOptionsPanePrivacyDescription** result;
	g_return_val_if_fail (PUBLISHING_YOU_TUBE_IS_PUBLISHING_OPTIONS_PANE (self), NULL);
	_tmp0_ = g_new0 (PublishingYouTubePublishingOptionsPanePrivacyDescription*, 0 + 1);
	_result_ = _tmp0_;
	_result__length1 = 0;
	__result__size_ = _result__length1;
	_tmp1_ = publishing_you_tube_publishing_options_pane_privacy_description_new (_ ("Public"), PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PUBLIC);
	_vala_array_add21 (&_result_, &_result__length1, &__result__size_, _tmp1_);
	_tmp2_ = publishing_you_tube_publishing_options_pane_privacy_description_new (_ ("Private"), PUBLISHING_YOU_TUBE_PRIVACY_SETTING_PRIVATE);
	_vala_array_add22 (&_result_, &_result__length1, &__result__size_, _tmp2_);
	_tmp3_ = publishing_you_tube_publishing_options_pane_privacy_description_new (_ ("unlisted"), PUBLISHING_YOU_TUBE_PRIVACY_SETTING_UNLISTED);
	_vala_array_add23 (&_result_, &_result__length1, &__result__size_, _tmp3_);
	_tmp4_ = _result_;
	_tmp4__length1 = _result__length1;
	if (result_length1) {
		*result_length1 = _tmp4__length1;
	}
	result = _tmp4_;
	return result;
}

static GtkWidget*
publishing_you_tube_publishing_options_pane_real_get_widget (SpitPublishingDialogPane* base)
{
	PublishingYouTubePublishingOptionsPane * self;
	GtkBox* _tmp0_;
	GtkBox* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, PublishingYouTubePublishingOptionsPane);
	_tmp0_ = self->priv->pane_widget;
	_vala_assert (_tmp0_ != NULL, "pane_widget != null");
	_tmp1_ = self->priv->pane_widget;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
	result = _tmp2_;
	return result;
}

static SpitPublishingDialogPaneGeometryOptions
publishing_you_tube_publishing_options_pane_real_get_preferred_geometry (SpitPublishingDialogPane* base)
{
	PublishingYouTubePublishingOptionsPane * self;
	SpitPublishingDialogPaneGeometryOptions result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, PublishingYouTubePublishingOptionsPane);
	result = SPIT_PUBLISHING_DIALOG_PANE_GEOMETRY_OPTIONS_NONE;
	return result;
}

static void
publishing_you_tube_publishing_options_pane_real_on_pane_installed (SpitPublishingDialogPane* base)
{
	PublishingYouTubePublishingOptionsPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, PublishingYouTubePublishingOptionsPane);
	publishing_you_tube_publishing_options_pane_update_publish_button_sensitivity (self);
}

static void
publishing_you_tube_publishing_options_pane_real_on_pane_uninstalled (SpitPublishingDialogPane* base)
{
	PublishingYouTubePublishingOptionsPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, PublishingYouTubePublishingOptionsPane);
}

static PublishingYouTubePublishingOptionsPanePrivacyDescription*
publishing_you_tube_publishing_options_pane_privacy_description_construct (GType object_type,
                                                                           const gchar* description,
                                                                           PublishingYouTubePrivacySetting privacy_setting)
{
	PublishingYouTubePublishingOptionsPanePrivacyDescription* self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (description != NULL, NULL);
	self = (PublishingYouTubePublishingOptionsPanePrivacyDescription*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup (description);
	_g_free0 (self->description);
	self->description = _tmp0_;
	self->privacy_setting = privacy_setting;
	return self;
}

static PublishingYouTubePublishingOptionsPanePrivacyDescription*
publishing_you_tube_publishing_options_pane_privacy_description_new (const gchar* description,
                                                                     PublishingYouTubePrivacySetting privacy_setting)
{
	return publishing_you_tube_publishing_options_pane_privacy_description_construct (PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION, description, privacy_setting);
}

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

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

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

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

static gchar*
publishing_you_tube_publishing_options_pane_value_privacy_description_collect_value (GValue* value,
                                                                                     guint n_collect_values,
                                                                                     GTypeCValue* collect_values,
                                                                                     guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		PublishingYouTubePublishingOptionsPanePrivacyDescription * 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_you_tube_publishing_options_pane_privacy_description_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
publishing_you_tube_publishing_options_pane_value_privacy_description_lcopy_value (const GValue* value,
                                                                                   guint n_collect_values,
                                                                                   GTypeCValue* collect_values,
                                                                                   guint collect_flags)
{
	PublishingYouTubePublishingOptionsPanePrivacyDescription ** 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_you_tube_publishing_options_pane_privacy_description_ref (value->data[0].v_pointer);
	}
	return NULL;
}

static GParamSpec*
publishing_you_tube_publishing_options_pane_param_spec_privacy_description (const gchar* name,
                                                                            const gchar* nick,
                                                                            const gchar* blurb,
                                                                            GType object_type,
                                                                            GParamFlags flags)
{
	PublishingYouTubePublishingOptionsPaneParamSpecPrivacyDescription* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION), 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_you_tube_publishing_options_pane_value_get_privacy_description (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION), NULL);
	return value->data[0].v_pointer;
}

static void
publishing_you_tube_publishing_options_pane_value_set_privacy_description (GValue* value,
                                                                           gpointer v_object)
{
	PublishingYouTubePublishingOptionsPanePrivacyDescription * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION));
		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_you_tube_publishing_options_pane_privacy_description_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_you_tube_publishing_options_pane_privacy_description_unref (old);
	}
}

static void
publishing_you_tube_publishing_options_pane_value_take_privacy_description (GValue* value,
                                                                            gpointer v_object)
{
	PublishingYouTubePublishingOptionsPanePrivacyDescription * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION));
		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_you_tube_publishing_options_pane_privacy_description_unref (old);
	}
}

static void
publishing_you_tube_publishing_options_pane_privacy_description_class_init (PublishingYouTubePublishingOptionsPanePrivacyDescriptionClass * klass,
                                                                            gpointer klass_data)
{
	publishing_you_tube_publishing_options_pane_privacy_description_parent_class = g_type_class_peek_parent (klass);
	((PublishingYouTubePublishingOptionsPanePrivacyDescriptionClass *) klass)->finalize = publishing_you_tube_publishing_options_pane_privacy_description_finalize;
}

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

static void
publishing_you_tube_publishing_options_pane_privacy_description_finalize (PublishingYouTubePublishingOptionsPanePrivacyDescription * obj)
{
	PublishingYouTubePublishingOptionsPanePrivacyDescription * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_TYPE_PRIVACY_DESCRIPTION, PublishingYouTubePublishingOptionsPanePrivacyDescription);
	g_signal_handlers_destroy (self);
	_g_free0 (self->description);
}

static GType
publishing_you_tube_publishing_options_pane_privacy_description_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_you_tube_publishing_options_pane_value_privacy_description_init, publishing_you_tube_publishing_options_pane_value_privacy_description_free_value, publishing_you_tube_publishing_options_pane_value_privacy_description_copy_value, publishing_you_tube_publishing_options_pane_value_privacy_description_peek_pointer, "p", publishing_you_tube_publishing_options_pane_value_privacy_description_collect_value, "p", publishing_you_tube_publishing_options_pane_value_privacy_description_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingYouTubePublishingOptionsPanePrivacyDescriptionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_you_tube_publishing_options_pane_privacy_description_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingYouTubePublishingOptionsPanePrivacyDescription), 0, (GInstanceInitFunc) publishing_you_tube_publishing_options_pane_privacy_description_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_you_tube_publishing_options_pane_privacy_description_type_id;
	publishing_you_tube_publishing_options_pane_privacy_description_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingYouTubePublishingOptionsPanePrivacyDescription", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return publishing_you_tube_publishing_options_pane_privacy_description_type_id;
}

static GType
publishing_you_tube_publishing_options_pane_privacy_description_get_type (void)
{
	static volatile gsize publishing_you_tube_publishing_options_pane_privacy_description_type_id__once = 0;
	if (g_once_init_enter (&publishing_you_tube_publishing_options_pane_privacy_description_type_id__once)) {
		GType publishing_you_tube_publishing_options_pane_privacy_description_type_id;
		publishing_you_tube_publishing_options_pane_privacy_description_type_id = publishing_you_tube_publishing_options_pane_privacy_description_get_type_once ();
		g_once_init_leave (&publishing_you_tube_publishing_options_pane_privacy_description_type_id__once, publishing_you_tube_publishing_options_pane_privacy_description_type_id);
	}
	return publishing_you_tube_publishing_options_pane_privacy_description_type_id__once;
}

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

static void
publishing_you_tube_publishing_options_pane_privacy_description_unref (gpointer instance)
{
	PublishingYouTubePublishingOptionsPanePrivacyDescription * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_PRIVACY_DESCRIPTION_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
publishing_you_tube_publishing_options_pane_class_init (PublishingYouTubePublishingOptionsPaneClass * klass,
                                                        gpointer klass_data)
{
	publishing_you_tube_publishing_options_pane_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingYouTubePublishingOptionsPane_private_offset);
	G_OBJECT_CLASS (klass)->finalize = publishing_you_tube_publishing_options_pane_finalize;
	publishing_you_tube_publishing_options_pane_signals[PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_PUBLISH_SIGNAL] = g_signal_new ("publish", PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	publishing_you_tube_publishing_options_pane_signals[PUBLISHING_YOU_TUBE_PUBLISHING_OPTIONS_PANE_LOGOUT_SIGNAL] = g_signal_new ("logout", PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
publishing_you_tube_publishing_options_pane_spit_publishing_dialog_pane_interface_init (SpitPublishingDialogPaneIface * iface,
                                                                                        gpointer iface_data)
{
	publishing_you_tube_publishing_options_pane_spit_publishing_dialog_pane_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_widget = (GtkWidget* (*) (SpitPublishingDialogPane*)) publishing_you_tube_publishing_options_pane_real_get_widget;
	iface->get_preferred_geometry = (SpitPublishingDialogPaneGeometryOptions (*) (SpitPublishingDialogPane*)) publishing_you_tube_publishing_options_pane_real_get_preferred_geometry;
	iface->on_pane_installed = (void (*) (SpitPublishingDialogPane*)) publishing_you_tube_publishing_options_pane_real_on_pane_installed;
	iface->on_pane_uninstalled = (void (*) (SpitPublishingDialogPane*)) publishing_you_tube_publishing_options_pane_real_on_pane_uninstalled;
}

static void
publishing_you_tube_publishing_options_pane_instance_init (PublishingYouTubePublishingOptionsPane * self,
                                                           gpointer klass)
{
	self->priv = publishing_you_tube_publishing_options_pane_get_instance_private (self);
	self->priv->pane_widget = NULL;
	self->priv->privacy_combo = NULL;
	self->priv->login_identity_label = NULL;
	self->priv->publish_button = NULL;
	self->priv->logout_button = NULL;
	self->priv->builder = NULL;
	self->priv->privacy_label = NULL;
}

static void
publishing_you_tube_publishing_options_pane_finalize (GObject * obj)
{
	PublishingYouTubePublishingOptionsPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_YOU_TUBE_TYPE_PUBLISHING_OPTIONS_PANE, PublishingYouTubePublishingOptionsPane);
	_g_object_unref0 (self->priv->pane_widget);
	_g_object_unref0 (self->priv->privacy_combo);
	_g_object_unref0 (self->priv->login_identity_label);
	_g_object_unref0 (self->priv->publish_button);
	_g_object_unref0 (self->priv->logout_button);
	_g_object_unref0 (self->priv->builder);
	_g_object_unref0 (self->priv->privacy_label);
	self->priv->privacy_descriptions = (_vala_array_free (self->priv->privacy_descriptions, self->priv->privacy_descriptions_length1, (GDestroyNotify) publishing_you_tube_publishing_options_pane_privacy_description_unref), NULL);
	_publishing_you_tube_publishing_parameters_unref0 (self->priv->publishing_parameters);
	G_OBJECT_CLASS (publishing_you_tube_publishing_options_pane_parent_class)->finalize (obj);
}

static GType
publishing_you_tube_publishing_options_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingYouTubePublishingOptionsPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_you_tube_publishing_options_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingYouTubePublishingOptionsPane), 0, (GInstanceInitFunc) publishing_you_tube_publishing_options_pane_instance_init, NULL };
	static const GInterfaceInfo spit_publishing_dialog_pane_info = { (GInterfaceInitFunc) publishing_you_tube_publishing_options_pane_spit_publishing_dialog_pane_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType publishing_you_tube_publishing_options_pane_type_id;
	publishing_you_tube_publishing_options_pane_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingYouTubePublishingOptionsPane", &g_define_type_info, 0);
	g_type_add_interface_static (publishing_you_tube_publishing_options_pane_type_id, SPIT_PUBLISHING_TYPE_DIALOG_PANE, &spit_publishing_dialog_pane_info);
	PublishingYouTubePublishingOptionsPane_private_offset = g_type_add_instance_private (publishing_you_tube_publishing_options_pane_type_id, sizeof (PublishingYouTubePublishingOptionsPanePrivate));
	return publishing_you_tube_publishing_options_pane_type_id;
}

GType
publishing_you_tube_publishing_options_pane_get_type (void)
{
	static volatile gsize publishing_you_tube_publishing_options_pane_type_id__once = 0;
	if (g_once_init_enter (&publishing_you_tube_publishing_options_pane_type_id__once)) {
		GType publishing_you_tube_publishing_options_pane_type_id;
		publishing_you_tube_publishing_options_pane_type_id = publishing_you_tube_publishing_options_pane_get_type_once ();
		g_once_init_leave (&publishing_you_tube_publishing_options_pane_type_id__once, publishing_you_tube_publishing_options_pane_type_id);
	}
	return publishing_you_tube_publishing_options_pane_type_id__once;
}

static inline gpointer
publishing_you_tube_uploader_get_instance_private (PublishingYouTubeUploader* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingYouTubeUploader_private_offset);
}

PublishingYouTubeUploader*
publishing_you_tube_uploader_construct (GType object_type,
                                        PublishingRESTSupportGoogleSession* session,
                                        SpitPublishingPublishable** publishables,
                                        gint publishables_length1,
                                        PublishingYouTubePublishingParameters* parameters)
{
	PublishingYouTubeUploader* self = NULL;
	PublishingYouTubePublishingParameters* _tmp0_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (session, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_SESSION), NULL);
	g_return_val_if_fail (PUBLISHING_YOU_TUBE_IS_PUBLISHING_PARAMETERS (parameters), NULL);
	self = (PublishingYouTubeUploader*) 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_you_tube_publishing_parameters_ref0 (parameters);
	_publishing_you_tube_publishing_parameters_unref0 (self->priv->parameters);
	self->priv->parameters = _tmp0_;
	return self;
}

PublishingYouTubeUploader*
publishing_you_tube_uploader_new (PublishingRESTSupportGoogleSession* session,
                                  SpitPublishingPublishable** publishables,
                                  gint publishables_length1,
                                  PublishingYouTubePublishingParameters* parameters)
{
	return publishing_you_tube_uploader_construct (PUBLISHING_YOU_TUBE_TYPE_UPLOADER, session, publishables, publishables_length1, parameters);
}

static PublishingRESTSupportTransaction*
publishing_you_tube_uploader_real_create_transaction (PublishingRESTSupportBatchUploader* base,
                                                      SpitPublishingPublishable* publishable)
{
	PublishingYouTubeUploader * self;
	PublishingRESTSupportSession* _tmp0_;
	PublishingRESTSupportGoogleSession* _tmp1_;
	PublishingYouTubePublishingParameters* _tmp2_;
	SpitPublishingPublishable* _tmp3_;
	SpitPublishingPublishable* _tmp4_;
	PublishingYouTubeUploadTransaction* _tmp5_;
	PublishingRESTSupportTransaction* _tmp6_;
	PublishingRESTSupportTransaction* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_YOU_TUBE_TYPE_UPLOADER, PublishingYouTubeUploader);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (publishable, SPIT_PUBLISHING_TYPE_PUBLISHABLE), NULL);
	_tmp0_ = publishing_rest_support_batch_uploader_get_session (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader));
	_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_SESSION, PublishingRESTSupportGoogleSession);
	_tmp2_ = self->priv->parameters;
	_tmp3_ = publishing_rest_support_batch_uploader_get_current_publishable (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader));
	_tmp4_ = _tmp3_;
	_tmp5_ = publishing_you_tube_upload_transaction_new (_tmp1_, _tmp2_, _tmp4_);
	_tmp6_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction);
	_g_object_unref0 (_tmp4_);
	_publishing_rest_support_session_unref0 (_tmp1_);
	result = _tmp6_;
	return result;
}

static void
publishing_you_tube_uploader_class_init (PublishingYouTubeUploaderClass * klass,
                                         gpointer klass_data)
{
	publishing_you_tube_uploader_parent_class = g_type_class_peek_parent (klass);
	((PublishingRESTSupportBatchUploaderClass *) klass)->finalize = publishing_you_tube_uploader_finalize;
	g_type_class_adjust_private_offset (klass, &PublishingYouTubeUploader_private_offset);
	((PublishingRESTSupportBatchUploaderClass *) klass)->create_transaction = (PublishingRESTSupportTransaction* (*) (PublishingRESTSupportBatchUploader*, SpitPublishingPublishable*)) publishing_you_tube_uploader_real_create_transaction;
}

static void
publishing_you_tube_uploader_instance_init (PublishingYouTubeUploader * self,
                                            gpointer klass)
{
	self->priv = publishing_you_tube_uploader_get_instance_private (self);
}

static void
publishing_you_tube_uploader_finalize (PublishingRESTSupportBatchUploader * obj)
{
	PublishingYouTubeUploader * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_YOU_TUBE_TYPE_UPLOADER, PublishingYouTubeUploader);
	_publishing_you_tube_publishing_parameters_unref0 (self->priv->parameters);
	PUBLISHING_REST_SUPPORT_BATCH_UPLOADER_CLASS (publishing_you_tube_uploader_parent_class)->finalize (obj);
}

static GType
publishing_you_tube_uploader_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingYouTubeUploaderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_you_tube_uploader_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingYouTubeUploader), 0, (GInstanceInitFunc) publishing_you_tube_uploader_instance_init, NULL };
	GType publishing_you_tube_uploader_type_id;
	publishing_you_tube_uploader_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, "PublishingYouTubeUploader", &g_define_type_info, 0);
	PublishingYouTubeUploader_private_offset = g_type_add_instance_private (publishing_you_tube_uploader_type_id, sizeof (PublishingYouTubeUploaderPrivate));
	return publishing_you_tube_uploader_type_id;
}

GType
publishing_you_tube_uploader_get_type (void)
{
	static volatile gsize publishing_you_tube_uploader_type_id__once = 0;
	if (g_once_init_enter (&publishing_you_tube_uploader_type_id__once)) {
		GType publishing_you_tube_uploader_type_id;
		publishing_you_tube_uploader_type_id = publishing_you_tube_uploader_get_type_once ();
		g_once_init_leave (&publishing_you_tube_uploader_type_id__once, publishing_you_tube_uploader_type_id);
	}
	return publishing_you_tube_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);
}

