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

/* SPDX-License-Identifier: LGPL-2.1-or-later*/
/* SPDX-FileCopyrightText: 2016 Software Freedom Conservancy Inc.*/

#include <glib-object.h>
#include "shotwell-plugin-dev-1.0.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "shotwell-publishing.h"
#include <glib/gi18n-lib.h>
#include "shotwell-plugin-common.h"
#include <gee.h>
#include <libsecret/secret.h>
#include <gobject/gvaluecollector.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <libxml/tree.h>
#include <float.h>
#include <math.h>
#include <libsoup/soup.h>
#include <gcr/gcr-base.h>
#include <ui/gcr-ui.h>

#define PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_PASSWORD_SCHEME "org.gnome.Shotwell.Piwigo"
#define PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_SCHEMA_KEY_PROFILE_ID "shotwell-profile-id"
#define PUBLISHING_PIWIGO_SERVICE_NAME "Piwigo"
#define PUBLISHING_PIWIGO_PIWIGO_WS "ws.php"
#define PUBLISHING_PIWIGO_ORIGINAL_SIZE -1
#define PUBLISHING_PIWIGO_CATEGORY_NO_ID -1
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define PUBLISHING_PIWIGO_TYPE_ACCOUNT (publishing_piwigo_account_get_type ())
#define PUBLISHING_PIWIGO_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_ACCOUNT, PublishingPiwigoAccount))
#define PUBLISHING_PIWIGO_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_ACCOUNT, PublishingPiwigoAccountClass))
#define PUBLISHING_PIWIGO_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_ACCOUNT))
#define PUBLISHING_PIWIGO_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_ACCOUNT))
#define PUBLISHING_PIWIGO_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_ACCOUNT, PublishingPiwigoAccountClass))

typedef struct _PublishingPiwigoAccount PublishingPiwigoAccount;
typedef struct _PublishingPiwigoAccountClass PublishingPiwigoAccountClass;
typedef struct _PublishingPiwigoAccountPrivate PublishingPiwigoAccountPrivate;
enum  {
	PUBLISHING_PIWIGO_ACCOUNT_0_PROPERTY,
	PUBLISHING_PIWIGO_ACCOUNT_NUM_PROPERTIES
};
static GParamSpec* publishing_piwigo_account_properties[PUBLISHING_PIWIGO_ACCOUNT_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_uri_unref0(var) ((var == NULL) ? NULL : (var = (g_uri_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	PIWIGO_SERVICE_0_PROPERTY,
	PIWIGO_SERVICE_NUM_PROPERTIES
};
static GParamSpec* piwigo_service_properties[PIWIGO_SERVICE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _secret_schema_unref0(var) ((var == NULL) ? NULL : (var = (secret_schema_unref (var), NULL)))

#define PUBLISHING_PIWIGO_TYPE_CATEGORY (publishing_piwigo_category_get_type ())
#define PUBLISHING_PIWIGO_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_CATEGORY, PublishingPiwigoCategory))
#define PUBLISHING_PIWIGO_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_CATEGORY, PublishingPiwigoCategoryClass))
#define PUBLISHING_PIWIGO_IS_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_CATEGORY))
#define PUBLISHING_PIWIGO_IS_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_CATEGORY))
#define PUBLISHING_PIWIGO_CATEGORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_CATEGORY, PublishingPiwigoCategoryClass))

typedef struct _PublishingPiwigoCategory PublishingPiwigoCategory;
typedef struct _PublishingPiwigoCategoryClass PublishingPiwigoCategoryClass;
typedef struct _PublishingPiwigoCategoryPrivate PublishingPiwigoCategoryPrivate;
typedef struct _PublishingPiwigoParamSpecCategory PublishingPiwigoParamSpecCategory;

#define PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL (publishing_piwigo_permission_level_get_type ())
#define PUBLISHING_PIWIGO_PERMISSION_LEVEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL, PublishingPiwigoPermissionLevel))
#define PUBLISHING_PIWIGO_PERMISSION_LEVEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL, PublishingPiwigoPermissionLevelClass))
#define PUBLISHING_PIWIGO_IS_PERMISSION_LEVEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL))
#define PUBLISHING_PIWIGO_IS_PERMISSION_LEVEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL))
#define PUBLISHING_PIWIGO_PERMISSION_LEVEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL, PublishingPiwigoPermissionLevelClass))

typedef struct _PublishingPiwigoPermissionLevel PublishingPiwigoPermissionLevel;
typedef struct _PublishingPiwigoPermissionLevelClass PublishingPiwigoPermissionLevelClass;
typedef struct _PublishingPiwigoPermissionLevelPrivate PublishingPiwigoPermissionLevelPrivate;
typedef struct _PublishingPiwigoParamSpecPermissionLevel PublishingPiwigoParamSpecPermissionLevel;

#define PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY (publishing_piwigo_size_entry_get_type ())
#define PUBLISHING_PIWIGO_SIZE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY, PublishingPiwigoSizeEntry))
#define PUBLISHING_PIWIGO_SIZE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY, PublishingPiwigoSizeEntryClass))
#define PUBLISHING_PIWIGO_IS_SIZE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY))
#define PUBLISHING_PIWIGO_IS_SIZE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY))
#define PUBLISHING_PIWIGO_SIZE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY, PublishingPiwigoSizeEntryClass))

typedef struct _PublishingPiwigoSizeEntry PublishingPiwigoSizeEntry;
typedef struct _PublishingPiwigoSizeEntryClass PublishingPiwigoSizeEntryClass;
typedef struct _PublishingPiwigoSizeEntryPrivate PublishingPiwigoSizeEntryPrivate;
typedef struct _PublishingPiwigoParamSpecSizeEntry PublishingPiwigoParamSpecSizeEntry;

#define PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS (publishing_piwigo_publishing_parameters_get_type ())
#define PUBLISHING_PIWIGO_PUBLISHING_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS, PublishingPiwigoPublishingParameters))
#define PUBLISHING_PIWIGO_PUBLISHING_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS, PublishingPiwigoPublishingParametersClass))
#define PUBLISHING_PIWIGO_IS_PUBLISHING_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS))
#define PUBLISHING_PIWIGO_IS_PUBLISHING_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS))
#define PUBLISHING_PIWIGO_PUBLISHING_PARAMETERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS, PublishingPiwigoPublishingParametersClass))

typedef struct _PublishingPiwigoPublishingParameters PublishingPiwigoPublishingParameters;
typedef struct _PublishingPiwigoPublishingParametersClass PublishingPiwigoPublishingParametersClass;
typedef struct _PublishingPiwigoPublishingParametersPrivate PublishingPiwigoPublishingParametersPrivate;
#define _publishing_piwigo_category_unref0(var) ((var == NULL) ? NULL : (var = (publishing_piwigo_category_unref (var), NULL)))
#define _publishing_piwigo_permission_level_unref0(var) ((var == NULL) ? NULL : (var = (publishing_piwigo_permission_level_unref (var), NULL)))
#define _publishing_piwigo_size_entry_unref0(var) ((var == NULL) ? NULL : (var = (publishing_piwigo_size_entry_unref (var), NULL)))
typedef struct _PublishingPiwigoParamSpecPublishingParameters PublishingPiwigoParamSpecPublishingParameters;

#define PUBLISHING_PIWIGO_TYPE_SESSION (publishing_piwigo_session_get_type ())
#define PUBLISHING_PIWIGO_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_SESSION, PublishingPiwigoSession))
#define PUBLISHING_PIWIGO_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_SESSION, PublishingPiwigoSessionClass))
#define PUBLISHING_PIWIGO_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_SESSION))
#define PUBLISHING_PIWIGO_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_SESSION))
#define PUBLISHING_PIWIGO_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_SESSION, PublishingPiwigoSessionClass))

typedef struct _PublishingPiwigoSession PublishingPiwigoSession;
typedef struct _PublishingPiwigoSessionClass PublishingPiwigoSessionClass;
enum  {
	PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_0_PROPERTY,
	PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_NUM_PROPERTIES
};
static GParamSpec* publishing_piwigo_piwigo_publisher_properties[PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_NUM_PROPERTIES];
#define _publishing_rest_support_session_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_session_unref (var), NULL)))
#define _publishing_piwigo_publishing_parameters_unref0(var) ((var == NULL) ? NULL : (var = (publishing_piwigo_publishing_parameters_unref (var), NULL)))
typedef enum  {
	PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_INTRO,
	PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_FAILED_RETRY_URL,
	PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_FAILED_RETRY_USER
} PublishingPiwigoAuthenticationPaneMode;

#define PUBLISHING_PIWIGO_AUTHENTICATION_PANE_TYPE_MODE (publishing_piwigo_authentication_pane_mode_get_type ())

#define PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE (publishing_piwigo_authentication_pane_get_type ())
#define PUBLISHING_PIWIGO_AUTHENTICATION_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE, PublishingPiwigoAuthenticationPane))
#define PUBLISHING_PIWIGO_AUTHENTICATION_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE, PublishingPiwigoAuthenticationPaneClass))
#define PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE))
#define PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE))
#define PUBLISHING_PIWIGO_AUTHENTICATION_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE, PublishingPiwigoAuthenticationPaneClass))

typedef struct _PublishingPiwigoAuthenticationPane PublishingPiwigoAuthenticationPane;
typedef struct _PublishingPiwigoAuthenticationPaneClass PublishingPiwigoAuthenticationPaneClass;

#define PUBLISHING_PIWIGO_TYPE_TRANSACTION (publishing_piwigo_transaction_get_type ())
#define PUBLISHING_PIWIGO_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_TRANSACTION, PublishingPiwigoTransaction))
#define PUBLISHING_PIWIGO_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_TRANSACTION, PublishingPiwigoTransactionClass))
#define PUBLISHING_PIWIGO_IS_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_TRANSACTION))
#define PUBLISHING_PIWIGO_IS_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_TRANSACTION))
#define PUBLISHING_PIWIGO_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_TRANSACTION, PublishingPiwigoTransactionClass))

typedef struct _PublishingPiwigoTransaction PublishingPiwigoTransaction;
typedef struct _PublishingPiwigoTransactionClass PublishingPiwigoTransactionClass;

#define PUBLISHING_PIWIGO_TYPE_SESSION_LOGIN_TRANSACTION (publishing_piwigo_session_login_transaction_get_type ())
#define PUBLISHING_PIWIGO_SESSION_LOGIN_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_SESSION_LOGIN_TRANSACTION, PublishingPiwigoSessionLoginTransaction))
#define PUBLISHING_PIWIGO_SESSION_LOGIN_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_SESSION_LOGIN_TRANSACTION, PublishingPiwigoSessionLoginTransactionClass))
#define PUBLISHING_PIWIGO_IS_SESSION_LOGIN_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_SESSION_LOGIN_TRANSACTION))
#define PUBLISHING_PIWIGO_IS_SESSION_LOGIN_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_SESSION_LOGIN_TRANSACTION))
#define PUBLISHING_PIWIGO_SESSION_LOGIN_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_SESSION_LOGIN_TRANSACTION, PublishingPiwigoSessionLoginTransactionClass))

typedef struct _PublishingPiwigoSessionLoginTransaction PublishingPiwigoSessionLoginTransaction;
typedef struct _PublishingPiwigoSessionLoginTransactionClass PublishingPiwigoSessionLoginTransactionClass;

#define PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE (publishing_piwigo_ssl_error_pane_get_type ())
#define PUBLISHING_PIWIGO_SSL_ERROR_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE, PublishingPiwigoSSLErrorPane))
#define PUBLISHING_PIWIGO_SSL_ERROR_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE, PublishingPiwigoSSLErrorPaneClass))
#define PUBLISHING_PIWIGO_IS_SSL_ERROR_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE))
#define PUBLISHING_PIWIGO_IS_SSL_ERROR_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE))
#define PUBLISHING_PIWIGO_SSL_ERROR_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE, PublishingPiwigoSSLErrorPaneClass))

typedef struct _PublishingPiwigoSSLErrorPane PublishingPiwigoSSLErrorPane;
typedef struct _PublishingPiwigoSSLErrorPaneClass PublishingPiwigoSSLErrorPaneClass;
#define _publishing_rest_support_transaction_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_transaction_unref (var), NULL)))
typedef struct _PublishingPiwigoPiwigoPublisherDoNetworkLoginData PublishingPiwigoPiwigoPublisherDoNetworkLoginData;
#define _publishing_rest_support_xml_document_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_xml_document_unref (var), NULL)))

#define PUBLISHING_PIWIGO_TYPE_SESSION_GET_STATUS_TRANSACTION (publishing_piwigo_session_get_status_transaction_get_type ())
#define PUBLISHING_PIWIGO_SESSION_GET_STATUS_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_SESSION_GET_STATUS_TRANSACTION, PublishingPiwigoSessionGetStatusTransaction))
#define PUBLISHING_PIWIGO_SESSION_GET_STATUS_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_SESSION_GET_STATUS_TRANSACTION, PublishingPiwigoSessionGetStatusTransactionClass))
#define PUBLISHING_PIWIGO_IS_SESSION_GET_STATUS_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_SESSION_GET_STATUS_TRANSACTION))
#define PUBLISHING_PIWIGO_IS_SESSION_GET_STATUS_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_SESSION_GET_STATUS_TRANSACTION))
#define PUBLISHING_PIWIGO_SESSION_GET_STATUS_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_SESSION_GET_STATUS_TRANSACTION, PublishingPiwigoSessionGetStatusTransactionClass))

typedef struct _PublishingPiwigoSessionGetStatusTransaction PublishingPiwigoSessionGetStatusTransaction;
typedef struct _PublishingPiwigoSessionGetStatusTransactionClass PublishingPiwigoSessionGetStatusTransactionClass;
typedef struct _PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData;

#define PUBLISHING_PIWIGO_TYPE_CATEGORIES_GET_LIST_TRANSACTION (publishing_piwigo_categories_get_list_transaction_get_type ())
#define PUBLISHING_PIWIGO_CATEGORIES_GET_LIST_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_CATEGORIES_GET_LIST_TRANSACTION, PublishingPiwigoCategoriesGetListTransaction))
#define PUBLISHING_PIWIGO_CATEGORIES_GET_LIST_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_CATEGORIES_GET_LIST_TRANSACTION, PublishingPiwigoCategoriesGetListTransactionClass))
#define PUBLISHING_PIWIGO_IS_CATEGORIES_GET_LIST_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_CATEGORIES_GET_LIST_TRANSACTION))
#define PUBLISHING_PIWIGO_IS_CATEGORIES_GET_LIST_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_CATEGORIES_GET_LIST_TRANSACTION))
#define PUBLISHING_PIWIGO_CATEGORIES_GET_LIST_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_CATEGORIES_GET_LIST_TRANSACTION, PublishingPiwigoCategoriesGetListTransactionClass))

typedef struct _PublishingPiwigoCategoriesGetListTransaction PublishingPiwigoCategoriesGetListTransaction;
typedef struct _PublishingPiwigoCategoriesGetListTransactionClass PublishingPiwigoCategoriesGetListTransactionClass;
typedef struct _PublishingPiwigoPiwigoPublisherDoFetchCategoriesData PublishingPiwigoPiwigoPublisherDoFetchCategoriesData;
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

#define PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE (publishing_piwigo_publishing_options_pane_get_type ())
#define PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, PublishingPiwigoPublishingOptionsPane))
#define PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, PublishingPiwigoPublishingOptionsPaneClass))
#define PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE))
#define PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE))
#define PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, PublishingPiwigoPublishingOptionsPaneClass))

typedef struct _PublishingPiwigoPublishingOptionsPane PublishingPiwigoPublishingOptionsPane;
typedef struct _PublishingPiwigoPublishingOptionsPaneClass PublishingPiwigoPublishingOptionsPaneClass;

#define PUBLISHING_PIWIGO_TYPE_SESSION_LOGOUT_TRANSACTION (publishing_piwigo_session_logout_transaction_get_type ())
#define PUBLISHING_PIWIGO_SESSION_LOGOUT_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_SESSION_LOGOUT_TRANSACTION, PublishingPiwigoSessionLogoutTransaction))
#define PUBLISHING_PIWIGO_SESSION_LOGOUT_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_SESSION_LOGOUT_TRANSACTION, PublishingPiwigoSessionLogoutTransactionClass))
#define PUBLISHING_PIWIGO_IS_SESSION_LOGOUT_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_SESSION_LOGOUT_TRANSACTION))
#define PUBLISHING_PIWIGO_IS_SESSION_LOGOUT_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_SESSION_LOGOUT_TRANSACTION))
#define PUBLISHING_PIWIGO_SESSION_LOGOUT_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_SESSION_LOGOUT_TRANSACTION, PublishingPiwigoSessionLogoutTransactionClass))

typedef struct _PublishingPiwigoSessionLogoutTransaction PublishingPiwigoSessionLogoutTransaction;
typedef struct _PublishingPiwigoSessionLogoutTransactionClass PublishingPiwigoSessionLogoutTransactionClass;
typedef struct _PublishingPiwigoPiwigoPublisherOnPublishingOptionsPaneLogoutClickedData PublishingPiwigoPiwigoPublisherOnPublishingOptionsPaneLogoutClickedData;

#define PUBLISHING_PIWIGO_TYPE_CATEGORIES_ADD_TRANSACTION (publishing_piwigo_categories_add_transaction_get_type ())
#define PUBLISHING_PIWIGO_CATEGORIES_ADD_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_CATEGORIES_ADD_TRANSACTION, PublishingPiwigoCategoriesAddTransaction))
#define PUBLISHING_PIWIGO_CATEGORIES_ADD_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_CATEGORIES_ADD_TRANSACTION, PublishingPiwigoCategoriesAddTransactionClass))
#define PUBLISHING_PIWIGO_IS_CATEGORIES_ADD_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_CATEGORIES_ADD_TRANSACTION))
#define PUBLISHING_PIWIGO_IS_CATEGORIES_ADD_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_CATEGORIES_ADD_TRANSACTION))
#define PUBLISHING_PIWIGO_CATEGORIES_ADD_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_CATEGORIES_ADD_TRANSACTION, PublishingPiwigoCategoriesAddTransactionClass))

typedef struct _PublishingPiwigoCategoriesAddTransaction PublishingPiwigoCategoriesAddTransaction;
typedef struct _PublishingPiwigoCategoriesAddTransactionClass PublishingPiwigoCategoriesAddTransactionClass;
typedef struct _PublishingPiwigoPiwigoPublisherDoCreateCategoryData PublishingPiwigoPiwigoPublisherDoCreateCategoryData;

#define PUBLISHING_PIWIGO_TYPE_UPLOADER (publishing_piwigo_uploader_get_type ())
#define PUBLISHING_PIWIGO_UPLOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_UPLOADER, PublishingPiwigoUploader))
#define PUBLISHING_PIWIGO_UPLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_UPLOADER, PublishingPiwigoUploaderClass))
#define PUBLISHING_PIWIGO_IS_UPLOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_UPLOADER))
#define PUBLISHING_PIWIGO_IS_UPLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_UPLOADER))
#define PUBLISHING_PIWIGO_UPLOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_UPLOADER, PublishingPiwigoUploaderClass))

typedef struct _PublishingPiwigoUploader PublishingPiwigoUploader;
typedef struct _PublishingPiwigoUploaderClass PublishingPiwigoUploaderClass;
#define _publishing_rest_support_batch_uploader_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_batch_uploader_unref (var), NULL)))
typedef struct _PublishingPiwigoPiwigoPublisherDoUploadData PublishingPiwigoPiwigoPublisherDoUploadData;
#define __vala_SoupCookie_free0(var) ((var == NULL) ? NULL : (var = (_vala_SoupCookie_free (var), NULL)))
typedef struct _PublishingPiwigoUploaderPrivate PublishingPiwigoUploaderPrivate;

#define PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_TRANSACTION (publishing_piwigo_images_add_transaction_get_type ())
#define PUBLISHING_PIWIGO_IMAGES_ADD_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_TRANSACTION, PublishingPiwigoImagesAddTransaction))
#define PUBLISHING_PIWIGO_IMAGES_ADD_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_TRANSACTION, PublishingPiwigoImagesAddTransactionClass))
#define PUBLISHING_PIWIGO_IS_IMAGES_ADD_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_TRANSACTION))
#define PUBLISHING_PIWIGO_IS_IMAGES_ADD_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_TRANSACTION))
#define PUBLISHING_PIWIGO_IMAGES_ADD_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_TRANSACTION, PublishingPiwigoImagesAddTransactionClass))

typedef struct _PublishingPiwigoImagesAddTransaction PublishingPiwigoImagesAddTransaction;
typedef struct _PublishingPiwigoImagesAddTransactionClass PublishingPiwigoImagesAddTransactionClass;
typedef struct _PublishingPiwigoSSLErrorPanePrivate PublishingPiwigoSSLErrorPanePrivate;
enum  {
	PUBLISHING_PIWIGO_SSL_ERROR_PANE_0_PROPERTY,
	PUBLISHING_PIWIGO_SSL_ERROR_PANE_HOST_PROPERTY,
	PUBLISHING_PIWIGO_SSL_ERROR_PANE_CERT_PROPERTY,
	PUBLISHING_PIWIGO_SSL_ERROR_PANE_ERROR_TEXT_PROPERTY,
	PUBLISHING_PIWIGO_SSL_ERROR_PANE_NUM_PROPERTIES
};
static GParamSpec* publishing_piwigo_ssl_error_pane_properties[PUBLISHING_PIWIGO_SSL_ERROR_PANE_NUM_PROPERTIES];
#define _g_byte_array_unref0(var) ((var == NULL) ? NULL : (var = (g_byte_array_unref (var), NULL)))
enum  {
	PUBLISHING_PIWIGO_SSL_ERROR_PANE_PROCEED_SIGNAL,
	PUBLISHING_PIWIGO_SSL_ERROR_PANE_NUM_SIGNALS
};
static guint publishing_piwigo_ssl_error_pane_signals[PUBLISHING_PIWIGO_SSL_ERROR_PANE_NUM_SIGNALS] = {0};
typedef struct _PublishingPiwigoAuthenticationPanePrivate PublishingPiwigoAuthenticationPanePrivate;
enum  {
	PUBLISHING_PIWIGO_AUTHENTICATION_PANE_0_PROPERTY,
	PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_PROPERTY,
	PUBLISHING_PIWIGO_AUTHENTICATION_PANE_PUBLISHER_PROPERTY,
	PUBLISHING_PIWIGO_AUTHENTICATION_PANE_NUM_PROPERTIES
};
static GParamSpec* publishing_piwigo_authentication_pane_properties[PUBLISHING_PIWIGO_AUTHENTICATION_PANE_NUM_PROPERTIES];
enum  {
	PUBLISHING_PIWIGO_AUTHENTICATION_PANE_LOGIN_SIGNAL,
	PUBLISHING_PIWIGO_AUTHENTICATION_PANE_NUM_SIGNALS
};
static guint publishing_piwigo_authentication_pane_signals[PUBLISHING_PIWIGO_AUTHENTICATION_PANE_NUM_SIGNALS] = {0};
typedef struct _PublishingPiwigoPublishingOptionsPanePrivate PublishingPiwigoPublishingOptionsPanePrivate;
enum  {
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_0_PROPERTY,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_CATEGORY_PROPERTY,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PERMISSION_LEVEL_PROPERTY,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PHOTO_SIZE_PROPERTY,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_TITLE_AS_COMMENT_PROPERTY,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_TAGS_PROPERTY,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_RATINGS_PROPERTY,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_STRIP_METADATA_ENABLED_PROPERTY,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_EXISTING_CATEGORIES_PROPERTY,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_DEFAULT_COMMENT_PROPERTY,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_NUM_PROPERTIES
};
static GParamSpec* publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_NUM_PROPERTIES];
enum  {
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_PUBLISH_SIGNAL,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LOGOUT_SIGNAL,
	PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_NUM_SIGNALS
};
static guint publishing_piwigo_publishing_options_pane_signals[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_NUM_SIGNALS] = {0};
typedef struct _PublishingPiwigoSessionPrivate PublishingPiwigoSessionPrivate;
typedef struct _PublishingPiwigoTransactionPrivate PublishingPiwigoTransactionPrivate;
typedef struct _PublishingPiwigoSessionLoginTransactionPrivate PublishingPiwigoSessionLoginTransactionPrivate;
#define _publishing_rest_support_argument_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_argument_unref (var), NULL)))
typedef struct _PublishingPiwigoSessionGetStatusTransactionPrivate PublishingPiwigoSessionGetStatusTransactionPrivate;
typedef struct _PublishingPiwigoCategoriesGetListTransactionPrivate PublishingPiwigoCategoriesGetListTransactionPrivate;
typedef struct _PublishingPiwigoSessionLogoutTransactionPrivate PublishingPiwigoSessionLogoutTransactionPrivate;
typedef struct _PublishingPiwigoCategoriesAddTransactionPrivate PublishingPiwigoCategoriesAddTransactionPrivate;
typedef struct _PublishingPiwigoImagesAddTransactionPrivate PublishingPiwigoImagesAddTransactionPrivate;

#define PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_RATING (publishing_piwigo_images_add_rating_get_type ())
#define PUBLISHING_PIWIGO_IMAGES_ADD_RATING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_RATING, PublishingPiwigoImagesAddRating))
#define PUBLISHING_PIWIGO_IMAGES_ADD_RATING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_RATING, PublishingPiwigoImagesAddRatingClass))
#define PUBLISHING_PIWIGO_IS_IMAGES_ADD_RATING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_RATING))
#define PUBLISHING_PIWIGO_IS_IMAGES_ADD_RATING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_RATING))
#define PUBLISHING_PIWIGO_IMAGES_ADD_RATING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_RATING, PublishingPiwigoImagesAddRatingClass))

typedef struct _PublishingPiwigoImagesAddRating PublishingPiwigoImagesAddRating;
typedef struct _PublishingPiwigoImagesAddRatingClass PublishingPiwigoImagesAddRatingClass;
typedef struct _PublishingPiwigoImagesAddRatingPrivate PublishingPiwigoImagesAddRatingPrivate;
#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 _PublishingPiwigoAccount {
	GObject parent_instance;
	PublishingPiwigoAccountPrivate * priv;
	gchar* server_uri;
	gchar* user;
};

struct _PublishingPiwigoAccountClass {
	GObjectClass parent_class;
};

struct _PublishingPiwigoCategory {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingPiwigoCategoryPrivate * priv;
	gint id;
	gchar* name;
	gchar* comment;
	gchar* display_name;
	gchar* uppercats;
};

struct _PublishingPiwigoCategoryClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingPiwigoCategory *self);
};

struct _PublishingPiwigoParamSpecCategory {
	GParamSpec parent_instance;
};

struct _PublishingPiwigoPermissionLevel {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingPiwigoPermissionLevelPrivate * priv;
	gint id;
	gchar* name;
};

struct _PublishingPiwigoPermissionLevelClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingPiwigoPermissionLevel *self);
};

struct _PublishingPiwigoParamSpecPermissionLevel {
	GParamSpec parent_instance;
};

struct _PublishingPiwigoSizeEntry {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingPiwigoSizeEntryPrivate * priv;
	gint id;
	gchar* name;
};

struct _PublishingPiwigoSizeEntryClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingPiwigoSizeEntry *self);
};

struct _PublishingPiwigoParamSpecSizeEntry {
	GParamSpec parent_instance;
};

struct _PublishingPiwigoPublishingParameters {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingPiwigoPublishingParametersPrivate * priv;
	PublishingPiwigoCategory* category;
	PublishingPiwigoPermissionLevel* perm_level;
	PublishingPiwigoSizeEntry* photo_size;
	gboolean title_as_comment;
	gboolean no_upload_tags;
	gboolean no_upload_ratings;
};

struct _PublishingPiwigoPublishingParametersClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingPiwigoPublishingParameters *self);
};

struct _PublishingPiwigoParamSpecPublishingParameters {
	GParamSpec parent_instance;
};

struct _PublishingPiwigoPiwigoPublisherPrivate {
	SpitPublishingService* service;
	SpitPublishingPluginHost* host;
	gboolean running;
	gboolean strip_metadata;
	PublishingPiwigoSession* session;
	PublishingPiwigoCategory** categories;
	gint categories_length1;
	gint _categories_size_;
	PublishingPiwigoPublishingParameters* parameters;
	SpitPublishingProgressCallback progress_reporter;
	gpointer progress_reporter_target;
	GDestroyNotify progress_reporter_target_destroy_notify;
	SecretSchema* schema;
	PublishingPiwigoAccount* account;
};

struct _PublishingPiwigoPiwigoPublisherDoNetworkLoginData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingPiwigoPiwigoPublisher* self;
	gchar* url;
	gchar* username;
	gchar* password;
	gboolean remember_password;
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	PublishingPiwigoSessionLoginTransaction* login_trans;
	PublishingPiwigoSession* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	PublishingPiwigoSessionLoginTransaction* _tmp5_;
	PublishingPiwigoSessionLoginTransaction* _tmp6_;
	GError* err;
	GError* _tmp7_;
	GError* _tmp8_;
	GError* _inner_error0_;
};

struct _PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingPiwigoPiwigoPublisher* self;
	gchar* url;
	gchar* pwg_id;
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	PublishingPiwigoSession* _tmp2_;
	PublishingPiwigoSessionGetStatusTransaction* status_txn;
	PublishingPiwigoSession* _tmp3_;
	PublishingPiwigoSessionGetStatusTransaction* _tmp4_;
	PublishingPiwigoSessionGetStatusTransaction* _tmp5_;
	PublishingPiwigoSessionGetStatusTransaction* _tmp6_;
	GError* err;
	GError* _tmp7_;
	PublishingPiwigoSessionGetStatusTransaction* _vala1_status_txn;
	PublishingPiwigoSession* _tmp8_;
	PublishingPiwigoSessionGetStatusTransaction* _tmp9_;
	PublishingPiwigoSessionGetStatusTransaction* _tmp10_;
	PublishingPiwigoSessionGetStatusTransaction* _tmp11_;
	GError* _vala1_err;
	GError* _tmp12_;
	GError* _inner_error0_;
};

struct _PublishingPiwigoPiwigoPublisherDoFetchCategoriesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingPiwigoPiwigoPublisher* self;
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	PublishingPiwigoCategoriesGetListTransaction* cat_trans;
	PublishingPiwigoSession* _tmp2_;
	PublishingPiwigoCategoriesGetListTransaction* _tmp3_;
	PublishingPiwigoCategoriesGetListTransaction* _tmp4_;
	PublishingPiwigoCategoriesGetListTransaction* _tmp5_;
	GError* err;
	GError* _tmp6_;
	GError* _inner_error0_;
};

struct _PublishingPiwigoPiwigoPublisherOnPublishingOptionsPaneLogoutClickedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingPiwigoPiwigoPublisher* self;
	PublishingPiwigoSession* _tmp0_;
	PublishingPiwigoSessionLogoutTransaction* _tmp1_;
	PublishingPiwigoSessionLogoutTransaction* _tmp2_;
	GError* err;
	GError* _tmp3_;
	GError* _inner_error0_;
};

struct _PublishingPiwigoPiwigoPublisherDoCreateCategoryData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingPiwigoPiwigoPublisher* self;
	PublishingPiwigoCategory* category;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	SpitPublishingPluginHost* _tmp3_;
	SpitPublishingPluginHost* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	PublishingPiwigoCategoriesAddTransaction* creation_trans;
	PublishingPiwigoSession* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	PublishingPiwigoCategoriesAddTransaction* _tmp14_;
	PublishingPiwigoCategoriesAddTransaction* _tmp15_;
	GError* err;
	GError* _tmp16_;
	GError* _inner_error0_;
};

struct _PublishingPiwigoPiwigoPublisherDoUploadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingPiwigoPiwigoPublisher* self;
	gboolean strip_metadata;
	SpitPublishingPluginHost* _tmp0_;
	PublishingPiwigoPublishingParameters* _tmp1_;
	PublishingPiwigoCategory* _tmp2_;
	PublishingPiwigoPublishingParameters* _tmp3_;
	PublishingPiwigoPermissionLevel* _tmp4_;
	PublishingPiwigoPublishingParameters* _tmp5_;
	PublishingPiwigoSizeEntry* _tmp6_;
	PublishingPiwigoPublishingParameters* _tmp7_;
	PublishingPiwigoPublishingParameters* _tmp8_;
	PublishingPiwigoPublishingParameters* _tmp9_;
	SpitPublishingPluginHost* _tmp10_;
	PublishingPiwigoPublishingParameters* _tmp11_;
	PublishingPiwigoSizeEntry* _tmp12_;
	gpointer _tmp13_;
	GDestroyNotify _tmp14_;
	SpitPublishingProgressCallback _tmp15_;
	SpitPublishingPublishable** publishables;
	SpitPublishingPluginHost* _tmp16_;
	gint _tmp17_;
	SpitPublishingPublishable** _tmp18_;
	gint publishables_length1;
	gint _publishables_size_;
	PublishingPiwigoUploader* uploader;
	PublishingPiwigoSession* _tmp19_;
	PublishingPiwigoPublishingParameters* _tmp20_;
	PublishingPiwigoUploader* _tmp21_;
	gint num_published;
	GError* err;
	GError* _tmp22_;
	GError* _inner_error0_;
};

struct _PublishingPiwigoUploader {
	PublishingRESTSupportBatchUploader parent_instance;
	PublishingPiwigoUploaderPrivate * priv;
};

struct _PublishingPiwigoUploaderClass {
	PublishingRESTSupportBatchUploaderClass parent_class;
};

struct _PublishingPiwigoUploaderPrivate {
	PublishingPiwigoPublishingParameters* parameters;
};

struct _PublishingPiwigoSSLErrorPane {
	ShotwellPluginsCommonBuilderPane parent_instance;
	PublishingPiwigoSSLErrorPanePrivate * priv;
};

struct _PublishingPiwigoSSLErrorPaneClass {
	ShotwellPluginsCommonBuilderPaneClass parent_class;
};

struct _PublishingPiwigoSSLErrorPanePrivate {
	gchar* _host;
	GTlsCertificate* _cert;
	gchar* _error_text;
};

struct _PublishingPiwigoAuthenticationPane {
	ShotwellPluginsCommonBuilderPane parent_instance;
	PublishingPiwigoAuthenticationPanePrivate * priv;
};

struct _PublishingPiwigoAuthenticationPaneClass {
	ShotwellPluginsCommonBuilderPaneClass parent_class;
};

struct _PublishingPiwigoAuthenticationPanePrivate {
	PublishingPiwigoAuthenticationPaneMode _mode;
	PublishingPiwigoPiwigoPublisher* _publisher;
	GtkEntry* url_entry;
	GtkEntry* username_entry;
	GtkEntry* password_entry;
	GtkSwitch* remember_password_checkbutton;
	GtkButton* login_button;
};

struct _PublishingPiwigoPublishingOptionsPane {
	ShotwellPluginsCommonBuilderPane parent_instance;
	PublishingPiwigoPublishingOptionsPanePrivate * priv;
};

struct _PublishingPiwigoPublishingOptionsPaneClass {
	ShotwellPluginsCommonBuilderPaneClass parent_class;
};

struct _PublishingPiwigoPublishingOptionsPanePrivate {
	GtkRadioButton* use_existing_radio;
	GtkRadioButton* create_new_radio;
	GtkComboBoxText* existing_categories_combo;
	GtkEntry* new_category_entry;
	GtkLabel* within_existing_label;
	GtkComboBoxText* within_existing_combo;
	GtkComboBoxText* perms_combo;
	GtkComboBoxText* size_combo;
	GtkCheckButton* strip_metadata_check;
	GtkCheckButton* title_as_comment_check;
	GtkCheckButton* no_upload_tags_check;
	GtkCheckButton* no_upload_ratings_check;
	GtkButton* logout_button;
	GtkButton* publish_button;
	GtkTextView* album_comment;
	GtkLabel* album_comment_label;
	PublishingPiwigoPermissionLevel** perm_levels;
	gint perm_levels_length1;
	gint _perm_levels_size_;
	PublishingPiwigoSizeEntry** photo_sizes;
	gint photo_sizes_length1;
	gint _photo_sizes_size_;
	gint _last_category;
	gint _last_permission_level;
	gint _last_photo_size;
	gboolean _last_title_as_comment;
	gboolean _last_no_upload_tags;
	gboolean _last_no_upload_ratings;
	gboolean _strip_metadata_enabled;
	GeeList* _existing_categories;
	gchar* _default_comment;
};

struct _PublishingPiwigoSession {
	PublishingRESTSupportSession parent_instance;
	PublishingPiwigoSessionPrivate * priv;
};

struct _PublishingPiwigoSessionClass {
	PublishingRESTSupportSessionClass parent_class;
};

struct _PublishingPiwigoSessionPrivate {
	gchar* pwg_url;
	gchar* pwg_id;
	gchar* username;
	SoupCookieJar* jar;
};

struct _PublishingPiwigoTransaction {
	PublishingRESTSupportTransaction parent_instance;
	PublishingPiwigoTransactionPrivate * priv;
};

struct _PublishingPiwigoTransactionClass {
	PublishingRESTSupportTransactionClass parent_class;
};

struct _PublishingPiwigoSessionLoginTransaction {
	PublishingPiwigoTransaction parent_instance;
	PublishingPiwigoSessionLoginTransactionPrivate * priv;
};

struct _PublishingPiwigoSessionLoginTransactionClass {
	PublishingPiwigoTransactionClass parent_class;
};

struct _PublishingPiwigoSessionGetStatusTransaction {
	PublishingPiwigoTransaction parent_instance;
	PublishingPiwigoSessionGetStatusTransactionPrivate * priv;
};

struct _PublishingPiwigoSessionGetStatusTransactionClass {
	PublishingPiwigoTransactionClass parent_class;
};

struct _PublishingPiwigoCategoriesGetListTransaction {
	PublishingPiwigoTransaction parent_instance;
	PublishingPiwigoCategoriesGetListTransactionPrivate * priv;
};

struct _PublishingPiwigoCategoriesGetListTransactionClass {
	PublishingPiwigoTransactionClass parent_class;
};

struct _PublishingPiwigoSessionLogoutTransaction {
	PublishingPiwigoTransaction parent_instance;
	PublishingPiwigoSessionLogoutTransactionPrivate * priv;
};

struct _PublishingPiwigoSessionLogoutTransactionClass {
	PublishingPiwigoTransactionClass parent_class;
};

struct _PublishingPiwigoCategoriesAddTransaction {
	PublishingPiwigoTransaction parent_instance;
	PublishingPiwigoCategoriesAddTransactionPrivate * priv;
};

struct _PublishingPiwigoCategoriesAddTransactionClass {
	PublishingPiwigoTransactionClass parent_class;
};

struct _PublishingPiwigoImagesAddTransaction {
	PublishingRESTSupportUploadTransaction parent_instance;
	PublishingPiwigoImagesAddTransactionPrivate * priv;
};

struct _PublishingPiwigoImagesAddTransactionClass {
	PublishingRESTSupportUploadTransactionClass parent_class;
};

struct _PublishingPiwigoImagesAddTransactionPrivate {
	PublishingPiwigoPublishingParameters* parameters;
	PublishingPiwigoSession* session;
};

struct _PublishingPiwigoImagesAddRating {
	PublishingPiwigoTransaction parent_instance;
	PublishingPiwigoImagesAddRatingPrivate * priv;
};

struct _PublishingPiwigoImagesAddRatingClass {
	PublishingPiwigoTransactionClass parent_class;
};

static gpointer publishing_piwigo_account_parent_class = NULL;
static SpitPublishingAccountIface * publishing_piwigo_account_spit_publishing_account_parent_iface = NULL;
static gpointer piwigo_service_parent_class = NULL;
static SpitPluggableIface * piwigo_service_spit_pluggable_parent_iface = NULL;
static SpitPublishingServiceIface * piwigo_service_spit_publishing_service_parent_iface = NULL;
static gpointer publishing_piwigo_category_parent_class = NULL;
static gpointer publishing_piwigo_permission_level_parent_class = NULL;
static gpointer publishing_piwigo_size_entry_parent_class = NULL;
static gpointer publishing_piwigo_publishing_parameters_parent_class = NULL;
static gint PublishingPiwigoPiwigoPublisher_private_offset;
static gpointer publishing_piwigo_piwigo_publisher_parent_class = NULL;
static SpitPublishingPublisherIface * publishing_piwigo_piwigo_publisher_spit_publishing_publisher_parent_iface = NULL;
static gint PublishingPiwigoUploader_private_offset;
static gpointer publishing_piwigo_uploader_parent_class = NULL;
static gint PublishingPiwigoSSLErrorPane_private_offset;
static gpointer publishing_piwigo_ssl_error_pane_parent_class = NULL;
static gint PublishingPiwigoAuthenticationPane_private_offset;
static gpointer publishing_piwigo_authentication_pane_parent_class = NULL;
static gchar* publishing_piwigo_authentication_pane_INTRO_MESSAGE;
static gchar* publishing_piwigo_authentication_pane_INTRO_MESSAGE = NULL;
static gchar* publishing_piwigo_authentication_pane_FAILED_RETRY_URL_MESSAGE;
static gchar* publishing_piwigo_authentication_pane_FAILED_RETRY_URL_MESSAGE = NULL;
static gchar* publishing_piwigo_authentication_pane_FAILED_RETRY_USER_MESSAGE;
static gchar* publishing_piwigo_authentication_pane_FAILED_RETRY_USER_MESSAGE = NULL;
static gint PublishingPiwigoPublishingOptionsPane_private_offset;
static gpointer publishing_piwigo_publishing_options_pane_parent_class = NULL;
static gchar* publishing_piwigo_publishing_options_pane_DEFAULT_CATEGORY_NAME;
static gchar* publishing_piwigo_publishing_options_pane_DEFAULT_CATEGORY_NAME = NULL;
static gint PublishingPiwigoSession_private_offset;
static gpointer publishing_piwigo_session_parent_class = NULL;
static gpointer publishing_piwigo_transaction_parent_class = NULL;
static gpointer publishing_piwigo_session_login_transaction_parent_class = NULL;
static gpointer publishing_piwigo_session_get_status_transaction_parent_class = NULL;
static gpointer publishing_piwigo_categories_get_list_transaction_parent_class = NULL;
static gpointer publishing_piwigo_session_logout_transaction_parent_class = NULL;
static gpointer publishing_piwigo_categories_add_transaction_parent_class = NULL;
static gint PublishingPiwigoImagesAddTransaction_private_offset;
static gpointer publishing_piwigo_images_add_transaction_parent_class = NULL;
static gpointer publishing_piwigo_images_add_rating_parent_class = NULL;

VALA_EXTERN GType publishing_piwigo_account_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoAccount* publishing_piwigo_account_new (const gchar* server_uri,
                                                        const gchar* user);
VALA_EXTERN PublishingPiwigoAccount* publishing_piwigo_account_construct (GType object_type,
                                                              const gchar* server_uri,
                                                              const gchar* user);
static gchar* publishing_piwigo_account_real_display_name (SpitPublishingAccount* base);
static void publishing_piwigo_account_finalize (GObject * obj);
static GType publishing_piwigo_account_get_type_once (void);
static gint piwigo_service_real_get_pluggable_interface (SpitPluggable* base,
                                                  gint min_host_interface,
                                                  gint max_host_interface);
static const gchar* piwigo_service_real_get_id (SpitPluggable* base);
static const gchar* piwigo_service_real_get_pluggable_name (SpitPluggable* base);
static SpitPluggableInfo* piwigo_service_real_get_info (SpitPluggable* base);
static void piwigo_service_real_activation (SpitPluggable* base,
                                     gboolean enabled);
static SpitPublishingPublisher* piwigo_service_real_create_publisher (SpitPublishingService* base,
                                                               SpitPublishingPluginHost* host);
static SpitPublishingPublisher* piwigo_service_real_create_publisher_with_account (SpitPublishingService* base,
                                                                            SpitPublishingPluginHost* host,
                                                                            SpitPublishingAccount* account);
static SpitPublishingPublisherMediaType piwigo_service_real_get_supported_media (SpitPublishingService* base);
static GeeList* piwigo_service_real_get_accounts (SpitPublishingService* base,
                                           const gchar* profile_id);
static void _g_free0_ (gpointer var);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static GType piwigo_service_get_type_once (void);
VALA_EXTERN gpointer publishing_piwigo_category_ref (gpointer instance);
VALA_EXTERN void publishing_piwigo_category_unref (gpointer instance);
VALA_EXTERN GParamSpec* publishing_piwigo_param_spec_category (const gchar* name,
                                                   const gchar* nick,
                                                   const gchar* blurb,
                                                   GType object_type,
                                                   GParamFlags flags);
VALA_EXTERN void publishing_piwigo_value_set_category (GValue* value,
                                           gpointer v_object);
VALA_EXTERN void publishing_piwigo_value_take_category (GValue* value,
                                            gpointer v_object);
VALA_EXTERN gpointer publishing_piwigo_value_get_category (const GValue* value);
VALA_EXTERN GType publishing_piwigo_category_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoCategory* publishing_piwigo_category_new (gint id,
                                                          const gchar* name,
                                                          const gchar* uppercats,
                                                          const gchar* comment);
VALA_EXTERN PublishingPiwigoCategory* publishing_piwigo_category_construct (GType object_type,
                                                                gint id,
                                                                const gchar* name,
                                                                const gchar* uppercats,
                                                                const gchar* comment);
VALA_EXTERN PublishingPiwigoCategory* publishing_piwigo_category_new_local (const gchar* name,
                                                                gint parent_id,
                                                                const gchar* comment);
VALA_EXTERN PublishingPiwigoCategory* publishing_piwigo_category_construct_local (GType object_type,
                                                                      const gchar* name,
                                                                      gint parent_id,
                                                                      const gchar* comment);
VALA_EXTERN gboolean publishing_piwigo_category_is_local (PublishingPiwigoCategory* self);
VALA_EXTERN gboolean publishing_piwigo_category_equal (PublishingPiwigoCategory* _self_,
                                           PublishingPiwigoCategory* other);
static void publishing_piwigo_category_finalize (PublishingPiwigoCategory * obj);
static GType publishing_piwigo_category_get_type_once (void);
VALA_EXTERN gpointer publishing_piwigo_permission_level_ref (gpointer instance);
VALA_EXTERN void publishing_piwigo_permission_level_unref (gpointer instance);
VALA_EXTERN GParamSpec* publishing_piwigo_param_spec_permission_level (const gchar* name,
                                                           const gchar* nick,
                                                           const gchar* blurb,
                                                           GType object_type,
                                                           GParamFlags flags);
VALA_EXTERN void publishing_piwigo_value_set_permission_level (GValue* value,
                                                   gpointer v_object);
VALA_EXTERN void publishing_piwigo_value_take_permission_level (GValue* value,
                                                    gpointer v_object);
VALA_EXTERN gpointer publishing_piwigo_value_get_permission_level (const GValue* value);
VALA_EXTERN GType publishing_piwigo_permission_level_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoPermissionLevel* publishing_piwigo_permission_level_new (gint id,
                                                                         const gchar* name);
VALA_EXTERN PublishingPiwigoPermissionLevel* publishing_piwigo_permission_level_construct (GType object_type,
                                                                               gint id,
                                                                               const gchar* name);
static void publishing_piwigo_permission_level_finalize (PublishingPiwigoPermissionLevel * obj);
static GType publishing_piwigo_permission_level_get_type_once (void);
VALA_EXTERN gpointer publishing_piwigo_size_entry_ref (gpointer instance);
VALA_EXTERN void publishing_piwigo_size_entry_unref (gpointer instance);
VALA_EXTERN GParamSpec* publishing_piwigo_param_spec_size_entry (const gchar* name,
                                                     const gchar* nick,
                                                     const gchar* blurb,
                                                     GType object_type,
                                                     GParamFlags flags);
VALA_EXTERN void publishing_piwigo_value_set_size_entry (GValue* value,
                                             gpointer v_object);
VALA_EXTERN void publishing_piwigo_value_take_size_entry (GValue* value,
                                              gpointer v_object);
VALA_EXTERN gpointer publishing_piwigo_value_get_size_entry (const GValue* value);
VALA_EXTERN GType publishing_piwigo_size_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoSizeEntry* publishing_piwigo_size_entry_new (gint id,
                                                             const gchar* name);
VALA_EXTERN PublishingPiwigoSizeEntry* publishing_piwigo_size_entry_construct (GType object_type,
                                                                   gint id,
                                                                   const gchar* name);
static void publishing_piwigo_size_entry_finalize (PublishingPiwigoSizeEntry * obj);
static GType publishing_piwigo_size_entry_get_type_once (void);
VALA_EXTERN gpointer publishing_piwigo_publishing_parameters_ref (gpointer instance);
VALA_EXTERN void publishing_piwigo_publishing_parameters_unref (gpointer instance);
VALA_EXTERN GParamSpec* publishing_piwigo_param_spec_publishing_parameters (const gchar* name,
                                                                const gchar* nick,
                                                                const gchar* blurb,
                                                                GType object_type,
                                                                GParamFlags flags);
VALA_EXTERN void publishing_piwigo_value_set_publishing_parameters (GValue* value,
                                                        gpointer v_object);
VALA_EXTERN void publishing_piwigo_value_take_publishing_parameters (GValue* value,
                                                         gpointer v_object);
VALA_EXTERN gpointer publishing_piwigo_value_get_publishing_parameters (const GValue* value);
VALA_EXTERN GType publishing_piwigo_publishing_parameters_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoPublishingParameters* publishing_piwigo_publishing_parameters_new (void);
VALA_EXTERN PublishingPiwigoPublishingParameters* publishing_piwigo_publishing_parameters_construct (GType object_type);
static void publishing_piwigo_publishing_parameters_finalize (PublishingPiwigoPublishingParameters * obj);
static GType publishing_piwigo_publishing_parameters_get_type_once (void);
VALA_EXTERN GType publishing_piwigo_session_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoSession* publishing_piwigo_session_new (void);
VALA_EXTERN PublishingPiwigoSession* publishing_piwigo_session_construct (GType object_type);
static SpitPublishingService* publishing_piwigo_piwigo_publisher_real_get_service (SpitPublishingPublisher* base);
static gboolean publishing_piwigo_piwigo_publisher_real_is_running (SpitPublishingPublisher* base);
static void publishing_piwigo_piwigo_publisher_real_start (SpitPublishingPublisher* base);
static void publishing_piwigo_piwigo_publisher_do_fetch_categories (PublishingPiwigoPiwigoPublisher* self,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_do_fetch_categories_finish (PublishingPiwigoPiwigoPublisher* self,
                                                                    GAsyncResult* _res_);
static void publishing_piwigo_piwigo_publisher_do_network_login (PublishingPiwigoPiwigoPublisher* self,
                                                          const gchar* url,
                                                          const gchar* username,
                                                          const gchar* password,
                                                          gboolean remember_password,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_do_network_login_finish (PublishingPiwigoPiwigoPublisher* self,
                                                                 GAsyncResult* _res_);
VALA_EXTERN GType publishing_piwigo_authentication_pane_mode_get_type (void) G_GNUC_CONST ;
static void publishing_piwigo_piwigo_publisher_do_show_authentication_pane (PublishingPiwigoPiwigoPublisher* self,
                                                                     PublishingPiwigoAuthenticationPaneMode mode);
static void publishing_piwigo_piwigo_publisher_real_stop (SpitPublishingPublisher* base);
static void publishing_piwigo_piwigo_publisher_set_persistent_url (PublishingPiwigoPiwigoPublisher* self,
                                                            const gchar* url);
static void publishing_piwigo_piwigo_publisher_set_persistent_username (PublishingPiwigoPiwigoPublisher* self,
                                                                 const gchar* username);
static void publishing_piwigo_piwigo_publisher_set_persistent_password (PublishingPiwigoPiwigoPublisher* self,
                                                                 const gchar* url,
                                                                 const gchar* user,
                                                                 const gchar* password);
static void publishing_piwigo_piwigo_publisher_set_remember_password (PublishingPiwigoPiwigoPublisher* self,
                                                               gboolean remember_password);
static void publishing_piwigo_piwigo_publisher_set_last_category (PublishingPiwigoPiwigoPublisher* self,
                                                           gint last_category);
static void publishing_piwigo_piwigo_publisher_set_last_permission_level (PublishingPiwigoPiwigoPublisher* self,
                                                                   gint last_permission_level);
static void publishing_piwigo_piwigo_publisher_set_last_photo_size (PublishingPiwigoPiwigoPublisher* self,
                                                             gint last_photo_size);
static gboolean publishing_piwigo_piwigo_publisher_get_last_title_as_comment (PublishingPiwigoPiwigoPublisher* self);
static void publishing_piwigo_piwigo_publisher_set_last_title_as_comment (PublishingPiwigoPiwigoPublisher* self,
                                                                   gboolean title_as_comment);
static gboolean publishing_piwigo_piwigo_publisher_get_last_no_upload_tags (PublishingPiwigoPiwigoPublisher* self);
static void publishing_piwigo_piwigo_publisher_set_last_no_upload_tags (PublishingPiwigoPiwigoPublisher* self,
                                                                 gboolean no_upload_tags);
static gboolean publishing_piwigo_piwigo_publisher_get_last_no_upload_ratings (PublishingPiwigoPiwigoPublisher* self);
static void publishing_piwigo_piwigo_publisher_set_last_no_upload_ratings (PublishingPiwigoPiwigoPublisher* self,
                                                                    gboolean no_upload_ratings);
static gboolean publishing_piwigo_piwigo_publisher_get_metadata_removal_choice (PublishingPiwigoPiwigoPublisher* self);
static void publishing_piwigo_piwigo_publisher_set_metadata_removal_choice (PublishingPiwigoPiwigoPublisher* self,
                                                                     gboolean strip_metadata);
VALA_EXTERN GType publishing_piwigo_authentication_pane_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoAuthenticationPane* publishing_piwigo_authentication_pane_new (PublishingPiwigoPiwigoPublisher* publisher,
                                                                               PublishingPiwigoAuthenticationPaneMode mode);
VALA_EXTERN PublishingPiwigoAuthenticationPane* publishing_piwigo_authentication_pane_construct (GType object_type,
                                                                                     PublishingPiwigoPiwigoPublisher* publisher,
                                                                                     PublishingPiwigoAuthenticationPaneMode mode);
static void publishing_piwigo_piwigo_publisher_on_authentication_pane_login_clicked (PublishingPiwigoPiwigoPublisher* self,
                                                                              const gchar* url,
                                                                              const gchar* username,
                                                                              const gchar* password,
                                                                              gboolean remember_password);
static void _publishing_piwigo_piwigo_publisher_on_authentication_pane_login_clicked_publishing_piwigo_authentication_pane_login (PublishingPiwigoAuthenticationPane* _sender,
                                                                                                                           const gchar* url,
                                                                                                                           const gchar* user,
                                                                                                                           const gchar* password,
                                                                                                                           gboolean remember_password,
                                                                                                                           gpointer self);
VALA_EXTERN GType publishing_piwigo_transaction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType publishing_piwigo_session_login_transaction_get_type (void) G_GNUC_CONST ;
static void publishing_piwigo_piwigo_publisher_do_show_ssl_downgrade_pane (PublishingPiwigoPiwigoPublisher* self,
                                                                    PublishingPiwigoSessionLoginTransaction* trans,
                                                                    const gchar* url);
VALA_EXTERN GType publishing_piwigo_ssl_error_pane_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoSSLErrorPane* publishing_piwigo_ssl_error_pane_new (PublishingPiwigoSessionLoginTransaction* transaction,
                                                                    const gchar* host);
VALA_EXTERN PublishingPiwigoSSLErrorPane* publishing_piwigo_ssl_error_pane_construct (GType object_type,
                                                                          PublishingPiwigoSessionLoginTransaction* transaction,
                                                                          const gchar* host);
static void __lambda7_ (PublishingPiwigoPiwigoPublisher* self);
static void ___lambda7__publishing_piwigo_ssl_error_pane_proceed (PublishingPiwigoSSLErrorPane* _sender,
                                                           gpointer self);
static void publishing_piwigo_piwigo_publisher_do_network_login_data_free (gpointer _data);
static gboolean publishing_piwigo_piwigo_publisher_do_network_login_co (PublishingPiwigoPiwigoPublisherDoNetworkLoginData* _data_);
VALA_EXTERN PublishingPiwigoSessionLoginTransaction* publishing_piwigo_session_login_transaction_new (PublishingPiwigoSession* session,
                                                                                          const gchar* url,
                                                                                          const gchar* username,
                                                                                          const gchar* password);
VALA_EXTERN PublishingPiwigoSessionLoginTransaction* publishing_piwigo_session_login_transaction_construct (GType object_type,
                                                                                                PublishingPiwigoSession* session,
                                                                                                const gchar* url,
                                                                                                const gchar* username,
                                                                                                const gchar* password);
static void publishing_piwigo_piwigo_publisher_do_network_login_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_on_login_network_complete (PublishingPiwigoPiwigoPublisher* self,
                                                                   PublishingRESTSupportTransaction* txn);
static void publishing_piwigo_piwigo_publisher_do_show_error (PublishingPiwigoPiwigoPublisher* self,
                                                       GError* e);
VALA_EXTERN gchar* publishing_piwigo_transaction_validate_xml (PublishingRESTSupportXmlDocument* doc);
static gchar* _publishing_piwigo_transaction_validate_xml_publishing_rest_support_xml_document_check_for_error_response (PublishingRESTSupportXmlDocument* doc,
                                                                                                                  gpointer self);
VALA_EXTERN gchar* publishing_piwigo_transaction_get_error_code (PublishingRESTSupportXmlDocument* doc);
static gchar* _publishing_piwigo_transaction_get_error_code_publishing_rest_support_xml_document_check_for_error_response (PublishingRESTSupportXmlDocument* doc,
                                                                                                                    gpointer self);
static gchar* publishing_piwigo_piwigo_publisher_get_pwg_id_from_transaction (PublishingPiwigoPiwigoPublisher* self,
                                                                       PublishingRESTSupportTransaction* txn);
VALA_EXTERN void publishing_piwigo_session_set_pwg_id (PublishingPiwigoSession* self,
                                           const gchar* id);
static void publishing_piwigo_piwigo_publisher_do_fetch_session_status (PublishingPiwigoPiwigoPublisher* self,
                                                                 const gchar* url,
                                                                 const gchar* pwg_id,
                                                                 GAsyncReadyCallback _callback_,
                                                                 gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_do_fetch_session_status_finish (PublishingPiwigoPiwigoPublisher* self,
                                                                        GAsyncResult* _res_);
static void publishing_piwigo_piwigo_publisher_do_fetch_session_status_data_free (gpointer _data);
static gboolean publishing_piwigo_piwigo_publisher_do_fetch_session_status_co (PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData* _data_);
VALA_EXTERN GType publishing_piwigo_session_get_status_transaction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoSessionGetStatusTransaction* publishing_piwigo_session_get_status_transaction_new_unauthenticated (PublishingPiwigoSession* session,
                                                                                                                   const gchar* url,
                                                                                                                   const gchar* pwg_id);
VALA_EXTERN PublishingPiwigoSessionGetStatusTransaction* publishing_piwigo_session_get_status_transaction_construct_unauthenticated (GType object_type,
                                                                                                                         PublishingPiwigoSession* session,
                                                                                                                         const gchar* url,
                                                                                                                         const gchar* pwg_id);
static void publishing_piwigo_piwigo_publisher_do_fetch_session_status_ready (GObject* source_object,
                                                                       GAsyncResult* _res_,
                                                                       gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_on_session_get_status_complete (PublishingPiwigoPiwigoPublisher* self,
                                                                        PublishingRESTSupportTransaction* txn);
VALA_EXTERN PublishingPiwigoSessionGetStatusTransaction* publishing_piwigo_session_get_status_transaction_new (PublishingPiwigoSession* session);
VALA_EXTERN PublishingPiwigoSessionGetStatusTransaction* publishing_piwigo_session_get_status_transaction_construct (GType object_type,
                                                                                                         PublishingPiwigoSession* session);
VALA_EXTERN gchar* publishing_piwigo_session_get_pwg_id (PublishingPiwigoSession* self);
VALA_EXTERN void publishing_piwigo_session_authenticate (PublishingPiwigoSession* self,
                                             const gchar* url,
                                             const gchar* username,
                                             const gchar* id);
VALA_EXTERN gchar* publishing_piwigo_session_get_pwg_url (PublishingPiwigoSession* self);
VALA_EXTERN gchar* publishing_piwigo_session_get_username (PublishingPiwigoSession* self);
static void publishing_piwigo_piwigo_publisher_do_fetch_categories_data_free (gpointer _data);
static gboolean publishing_piwigo_piwigo_publisher_do_fetch_categories_co (PublishingPiwigoPiwigoPublisherDoFetchCategoriesData* _data_);
VALA_EXTERN GType publishing_piwigo_categories_get_list_transaction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoCategoriesGetListTransaction* publishing_piwigo_categories_get_list_transaction_new (PublishingPiwigoSession* session);
VALA_EXTERN PublishingPiwigoCategoriesGetListTransaction* publishing_piwigo_categories_get_list_transaction_construct (GType object_type,
                                                                                                           PublishingPiwigoSession* session);
static void publishing_piwigo_piwigo_publisher_do_fetch_categories_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_on_category_fetch_complete (PublishingPiwigoPiwigoPublisher* self,
                                                                    PublishingRESTSupportTransaction* txn);
static void _vala_array_add24 (PublishingPiwigoCategory** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoCategory* value);
static void publishing_piwigo_piwigo_publisher_do_show_publishing_options_pane (PublishingPiwigoPiwigoPublisher* self);
VALA_EXTERN GType publishing_piwigo_publishing_options_pane_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoPublishingOptionsPane* publishing_piwigo_publishing_options_pane_new (PublishingPiwigoPiwigoPublisher* publisher,
                                                                                      PublishingPiwigoCategory** categories,
                                                                                      gint categories_length1,
                                                                                      gint last_category,
                                                                                      gint last_permission_level,
                                                                                      gint last_photo_size,
                                                                                      gboolean last_title_as_comment,
                                                                                      gboolean last_no_upload_tags,
                                                                                      gboolean last_no_upload_ratings,
                                                                                      gboolean strip_metadata_enabled);
VALA_EXTERN PublishingPiwigoPublishingOptionsPane* publishing_piwigo_publishing_options_pane_construct (GType object_type,
                                                                                            PublishingPiwigoPiwigoPublisher* publisher,
                                                                                            PublishingPiwigoCategory** categories,
                                                                                            gint categories_length1,
                                                                                            gint last_category,
                                                                                            gint last_permission_level,
                                                                                            gint last_photo_size,
                                                                                            gboolean last_title_as_comment,
                                                                                            gboolean last_no_upload_tags,
                                                                                            gboolean last_no_upload_ratings,
                                                                                            gboolean strip_metadata_enabled);
static void __lambda8_ (PublishingPiwigoPiwigoPublisher* self);
static void publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked (PublishingPiwigoPiwigoPublisher* self,
                                                                                   GAsyncReadyCallback _callback_,
                                                                                   gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_finish (PublishingPiwigoPiwigoPublisher* self,
                                                                                          GAsyncResult* _res_);
static void ___lambda8__publishing_piwigo_publishing_options_pane_logout (PublishingPiwigoPublishingOptionsPane* _sender,
                                                                   gpointer self);
static void publishing_piwigo_piwigo_publisher_on_publishing_options_pane_publish_clicked (PublishingPiwigoPiwigoPublisher* self,
                                                                                    PublishingPiwigoPublishingParameters* parameters,
                                                                                    gboolean strip_metadata);
static void _publishing_piwigo_piwigo_publisher_on_publishing_options_pane_publish_clicked_publishing_piwigo_publishing_options_pane_publish (PublishingPiwigoPublishingOptionsPane* _sender,
                                                                                                                                       PublishingPiwigoPublishingParameters* parameters,
                                                                                                                                       gboolean strip_metadata,
                                                                                                                                       gpointer self);
static void publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_data_free (gpointer _data);
static gboolean publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_co (PublishingPiwigoPiwigoPublisherOnPublishingOptionsPaneLogoutClickedData* _data_);
VALA_EXTERN PublishingPiwigoSessionLogoutTransaction* publishing_piwigo_session_logout_transaction_new (PublishingPiwigoSession* session);
VALA_EXTERN PublishingPiwigoSessionLogoutTransaction* publishing_piwigo_session_logout_transaction_construct (GType object_type,
                                                                                                  PublishingPiwigoSession* session);
VALA_EXTERN GType publishing_piwigo_session_logout_transaction_get_type (void) G_GNUC_CONST ;
static void publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_ready (GObject* source_object,
                                                                                         GAsyncResult* _res_,
                                                                                         gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_on_logout_network_complete (PublishingPiwigoPiwigoPublisher* self);
VALA_EXTERN void publishing_piwigo_session_deauthenticate (PublishingPiwigoSession* self);
static void publishing_piwigo_piwigo_publisher_do_create_category (PublishingPiwigoPiwigoPublisher* self,
                                                            PublishingPiwigoCategory* category,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_do_create_category_finish (PublishingPiwigoPiwigoPublisher* self,
                                                                   GAsyncResult* _res_);
static void publishing_piwigo_piwigo_publisher_do_upload (PublishingPiwigoPiwigoPublisher* self,
                                                   gboolean strip_metadata,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_do_upload_finish (PublishingPiwigoPiwigoPublisher* self,
                                                          GAsyncResult* _res_);
static void publishing_piwigo_piwigo_publisher_do_create_category_data_free (gpointer _data);
static gboolean publishing_piwigo_piwigo_publisher_do_create_category_co (PublishingPiwigoPiwigoPublisherDoCreateCategoryData* _data_);
VALA_EXTERN GType publishing_piwigo_categories_add_transaction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoCategoriesAddTransaction* publishing_piwigo_categories_add_transaction_new (PublishingPiwigoSession* session,
                                                                                            const gchar* category,
                                                                                            gint parent_id,
                                                                                            const gchar* comment);
VALA_EXTERN PublishingPiwigoCategoriesAddTransaction* publishing_piwigo_categories_add_transaction_construct (GType object_type,
                                                                                                  PublishingPiwigoSession* session,
                                                                                                  const gchar* category,
                                                                                                  gint parent_id,
                                                                                                  const gchar* comment);
static void publishing_piwigo_piwigo_publisher_do_create_category_ready (GObject* source_object,
                                                                  GAsyncResult* _res_,
                                                                  gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_on_category_add_complete (PublishingPiwigoPiwigoPublisher* self,
                                                                  PublishingRESTSupportTransaction* txn);
static void publishing_piwigo_piwigo_publisher_do_upload_data_free (gpointer _data);
static gboolean publishing_piwigo_piwigo_publisher_do_upload_co (PublishingPiwigoPiwigoPublisherDoUploadData* _data_);
VALA_EXTERN GType publishing_piwigo_uploader_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingPiwigoUploader* publishing_piwigo_uploader_new (PublishingPiwigoSession* session,
                                                          SpitPublishingPublishable** publishables,
                                                          gint publishables_length1,
                                                          PublishingPiwigoPublishingParameters* parameters);
VALA_EXTERN PublishingPiwigoUploader* publishing_piwigo_uploader_construct (GType object_type,
                                                                PublishingPiwigoSession* session,
                                                                SpitPublishingPublishable** publishables,
                                                                gint publishables_length1,
                                                                PublishingPiwigoPublishingParameters* parameters);
static void publishing_piwigo_piwigo_publisher_on_upload_status_updated (PublishingPiwigoPiwigoPublisher* self,
                                                                  gint file_number,
                                                                  gdouble completed_fraction);
static void _publishing_piwigo_piwigo_publisher_on_upload_status_updated_spit_publishing_progress_callback (gint file_number,
                                                                                                     gdouble fraction_complete,
                                                                                                     gpointer self);
static void publishing_piwigo_piwigo_publisher_do_upload_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void publishing_piwigo_piwigo_publisher_on_upload_complete (PublishingPiwigoPiwigoPublisher* self,
                                                            gint num_published);
static void publishing_piwigo_piwigo_publisher_do_show_success_pane (PublishingPiwigoPiwigoPublisher* self);
static void publishing_piwigo_piwigo_publisher_do_show_error_message (PublishingPiwigoPiwigoPublisher* self,
                                                               const gchar* message);
static SoupCookie* _vala_SoupCookie_copy (SoupCookie* self);
static void _vala_SoupCookie_free (SoupCookie* self);
static void __vala_SoupCookie_free0_ (gpointer var);
static inline void _g_slist_free___vala_SoupCookie_free0_ (GSList* self);
static void publishing_piwigo_piwigo_publisher_finalize (GObject * obj);
static GType publishing_piwigo_piwigo_publisher_get_type_once (void);
static PublishingRESTSupportTransaction* publishing_piwigo_uploader_real_create_transaction (PublishingRESTSupportBatchUploader* base,
                                                                                      SpitPublishingPublishable* publishable);
VALA_EXTERN PublishingPiwigoImagesAddTransaction* publishing_piwigo_images_add_transaction_new (PublishingPiwigoSession* session,
                                                                                    PublishingPiwigoPublishingParameters* parameters,
                                                                                    SpitPublishingPublishable* publishable);
VALA_EXTERN PublishingPiwigoImagesAddTransaction* publishing_piwigo_images_add_transaction_construct (GType object_type,
                                                                                          PublishingPiwigoSession* session,
                                                                                          PublishingPiwigoPublishingParameters* parameters,
                                                                                          SpitPublishingPublishable* publishable);
VALA_EXTERN GType publishing_piwigo_images_add_transaction_get_type (void) G_GNUC_CONST ;
static void publishing_piwigo_uploader_finalize (PublishingRESTSupportBatchUploader * obj);
static GType publishing_piwigo_uploader_get_type_once (void);
static void publishing_piwigo_ssl_error_pane_real_constructed (GObject* base);
VALA_EXTERN gchar* publishing_piwigo_ssl_error_pane_get_host (PublishingPiwigoSSLErrorPane* self);
VALA_EXTERN gchar* publishing_piwigo_ssl_error_pane_get_error_text (PublishingPiwigoSSLErrorPane* self);
static GTlsCertificate* publishing_piwigo_ssl_error_pane_get_cert (PublishingPiwigoSSLErrorPane* self);
static void ___lambda5_ (PublishingPiwigoSSLErrorPane* self);
static void ____lambda5__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda6_ (PublishingPiwigoSSLErrorPane* self);
static void ___lambda6__gtk_button_clicked (GtkButton* _sender,
                                     gpointer self);
static void publishing_piwigo_ssl_error_pane_set_host (PublishingPiwigoSSLErrorPane* self,
                                                const gchar* value);
static void publishing_piwigo_ssl_error_pane_set_cert (PublishingPiwigoSSLErrorPane* self,
                                                GTlsCertificate* value);
static void publishing_piwigo_ssl_error_pane_set_error_text (PublishingPiwigoSSLErrorPane* self,
                                                      const gchar* value);
static void publishing_piwigo_ssl_error_pane_finalize (GObject * obj);
static GType publishing_piwigo_ssl_error_pane_get_type_once (void);
static void _vala_publishing_piwigo_ssl_error_pane_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec);
static void _vala_publishing_piwigo_ssl_error_pane_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec);
static void publishing_piwigo_authentication_pane_real_constructed (GObject* base);
VALA_EXTERN PublishingPiwigoAuthenticationPaneMode publishing_piwigo_authentication_pane_get_mode (PublishingPiwigoAuthenticationPane* self);
VALA_EXTERN PublishingPiwigoPiwigoPublisher* publishing_piwigo_authentication_pane_get_publisher (PublishingPiwigoAuthenticationPane* self);
static void publishing_piwigo_authentication_pane_on_user_changed (PublishingPiwigoAuthenticationPane* self);
static void _publishing_piwigo_authentication_pane_on_user_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                  gpointer self);
static void publishing_piwigo_authentication_pane_on_url_changed (PublishingPiwigoAuthenticationPane* self);
static void _publishing_piwigo_authentication_pane_on_url_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                 gpointer self);
static void publishing_piwigo_authentication_pane_on_password_changed (PublishingPiwigoAuthenticationPane* self);
static void _publishing_piwigo_authentication_pane_on_password_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                      gpointer self);
static void publishing_piwigo_authentication_pane_on_login_button_clicked (PublishingPiwigoAuthenticationPane* self);
static void _publishing_piwigo_authentication_pane_on_login_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                        gpointer self);
static void publishing_piwigo_authentication_pane_update_login_button_sensitivity (PublishingPiwigoAuthenticationPane* self);
static void publishing_piwigo_authentication_pane_real_on_pane_installed (ShotwellPluginsCommonBuilderPane* base);
static void publishing_piwigo_authentication_pane_set_mode (PublishingPiwigoAuthenticationPane* self,
                                                     PublishingPiwigoAuthenticationPaneMode value);
static void publishing_piwigo_authentication_pane_set_publisher (PublishingPiwigoAuthenticationPane* self,
                                                          PublishingPiwigoPiwigoPublisher* value);
static void g_cclosure_user_marshal_VOID__STRING_STRING_STRING_BOOLEAN (GClosure * closure,
                                                                 GValue * return_value,
                                                                 guint n_param_values,
                                                                 const GValue * param_values,
                                                                 gpointer invocation_hint,
                                                                 gpointer marshal_data);
static void publishing_piwigo_authentication_pane_finalize (GObject * obj);
static GType publishing_piwigo_authentication_pane_get_type_once (void);
static void _vala_publishing_piwigo_authentication_pane_get_property (GObject * object,
                                                               guint property_id,
                                                               GValue * value,
                                                               GParamSpec * pspec);
static void _vala_publishing_piwigo_authentication_pane_set_property (GObject * object,
                                                               guint property_id,
                                                               const GValue * value,
                                                               GParamSpec * pspec);
static PublishingPiwigoCategory** _vala_array_dup3 (PublishingPiwigoCategory** self,
                                             gssize length);
static gboolean _publishing_piwigo_category_equal_gee_equal_data_func (gconstpointer a,
                                                                gconstpointer b,
                                                                gpointer self);
static gchar* publishing_piwigo_publishing_options_pane_get_common_comment_if_possible (PublishingPiwigoPiwigoPublisher* publisher);
static void publishing_piwigo_publishing_options_pane_real_constructed (GObject* base);
static gboolean publishing_piwigo_publishing_options_pane_get_strip_metadata_enabled (PublishingPiwigoPublishingOptionsPane* self);
static gboolean publishing_piwigo_publishing_options_pane_get_last_title_as_comment (PublishingPiwigoPublishingOptionsPane* self);
static gboolean publishing_piwigo_publishing_options_pane_get_last_no_upload_tags (PublishingPiwigoPublishingOptionsPane* self);
static gboolean publishing_piwigo_publishing_options_pane_get_last_no_upload_ratings (PublishingPiwigoPublishingOptionsPane* self);
static void publishing_piwigo_publishing_options_pane_on_logout_button_clicked (PublishingPiwigoPublishingOptionsPane* self);
static void _publishing_piwigo_publishing_options_pane_on_logout_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                             gpointer self);
static void publishing_piwigo_publishing_options_pane_on_publish_button_clicked (PublishingPiwigoPublishingOptionsPane* self);
static void _publishing_piwigo_publishing_options_pane_on_publish_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                              gpointer self);
static void publishing_piwigo_publishing_options_pane_on_use_existing_radio_clicked (PublishingPiwigoPublishingOptionsPane* self);
static void _publishing_piwigo_publishing_options_pane_on_use_existing_radio_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                                  gpointer self);
static void publishing_piwigo_publishing_options_pane_on_create_new_radio_clicked (PublishingPiwigoPublishingOptionsPane* self);
static void _publishing_piwigo_publishing_options_pane_on_create_new_radio_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                                gpointer self);
static void publishing_piwigo_publishing_options_pane_on_new_category_entry_changed (PublishingPiwigoPublishingOptionsPane* self);
static void _publishing_piwigo_publishing_options_pane_on_new_category_entry_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                                    gpointer self);
static void publishing_piwigo_publishing_options_pane_on_existing_combo_changed (PublishingPiwigoPublishingOptionsPane* self);
static void _publishing_piwigo_publishing_options_pane_on_existing_combo_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                                                 gpointer self);
static PublishingPiwigoPermissionLevel** publishing_piwigo_publishing_options_pane_create_perm_levels (PublishingPiwigoPublishingOptionsPane* self,
                                                                                                gint* result_length1);
static PublishingPiwigoSizeEntry** publishing_piwigo_publishing_options_pane_create_sizes (PublishingPiwigoPublishingOptionsPane* self,
                                                                                    gint* result_length1);
static const gchar* publishing_piwigo_publishing_options_pane_get_default_comment (PublishingPiwigoPublishingOptionsPane* self);
static void _vala_array_add25 (PublishingPiwigoPermissionLevel** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoPermissionLevel* value);
static void _vala_array_add26 (PublishingPiwigoPermissionLevel** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoPermissionLevel* value);
static void _vala_array_add27 (PublishingPiwigoPermissionLevel** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoPermissionLevel* value);
static void _vala_array_add28 (PublishingPiwigoPermissionLevel** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoPermissionLevel* value);
static void _vala_array_add29 (PublishingPiwigoPermissionLevel** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoPermissionLevel* value);
static void _vala_array_add30 (PublishingPiwigoSizeEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoSizeEntry* value);
static void _vala_array_add31 (PublishingPiwigoSizeEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoSizeEntry* value);
static void _vala_array_add32 (PublishingPiwigoSizeEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoSizeEntry* value);
static void _vala_array_add33 (PublishingPiwigoSizeEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoSizeEntry* value);
static void _vala_array_add34 (PublishingPiwigoSizeEntry** * array,
                        gint* length,
                        gint* size,
                        PublishingPiwigoSizeEntry* value);
static GeeList* publishing_piwigo_publishing_options_pane_get_existing_categories (PublishingPiwigoPublishingOptionsPane* self);
static void publishing_piwigo_publishing_options_pane_update_publish_button_sensitivity (PublishingPiwigoPublishingOptionsPane* self);
static gboolean publishing_piwigo_publishing_options_pane_category_already_exists (PublishingPiwigoPublishingOptionsPane* self,
                                                                            const gchar* category_name);
static void publishing_piwigo_publishing_options_pane_real_on_pane_installed (ShotwellPluginsCommonBuilderPane* base);
static void publishing_piwigo_publishing_options_pane_create_categories_combo (PublishingPiwigoPublishingOptionsPane* self);
static void publishing_piwigo_publishing_options_pane_create_within_categories_combo (PublishingPiwigoPublishingOptionsPane* self);
static void publishing_piwigo_publishing_options_pane_create_permissions_combo (PublishingPiwigoPublishingOptionsPane* self);
static void publishing_piwigo_publishing_options_pane_create_size_combo (PublishingPiwigoPublishingOptionsPane* self);
static gint publishing_piwigo_publishing_options_pane_find_category_index (PublishingPiwigoPublishingOptionsPane* self,
                                                                    gint category_id);
static gint publishing_piwigo_publishing_options_pane_get_last_category (PublishingPiwigoPublishingOptionsPane* self);
static gint publishing_piwigo_publishing_options_pane_find_permission_level_index (PublishingPiwigoPublishingOptionsPane* self,
                                                                            gint permission_level_id);
static gint publishing_piwigo_publishing_options_pane_get_last_permission_level (PublishingPiwigoPublishingOptionsPane* self);
static gint publishing_piwigo_publishing_options_pane_find_size_index (PublishingPiwigoPublishingOptionsPane* self,
                                                                gint size_id);
static gint publishing_piwigo_publishing_options_pane_get_last_photo_size (PublishingPiwigoPublishingOptionsPane* self);
static void publishing_piwigo_publishing_options_pane_set_last_category (PublishingPiwigoPublishingOptionsPane* self,
                                                                  gint value);
static void publishing_piwigo_publishing_options_pane_set_last_permission_level (PublishingPiwigoPublishingOptionsPane* self,
                                                                          gint value);
static void publishing_piwigo_publishing_options_pane_set_last_photo_size (PublishingPiwigoPublishingOptionsPane* self,
                                                                    gint value);
static void publishing_piwigo_publishing_options_pane_set_last_title_as_comment (PublishingPiwigoPublishingOptionsPane* self,
                                                                          gboolean value);
static void publishing_piwigo_publishing_options_pane_set_last_no_upload_tags (PublishingPiwigoPublishingOptionsPane* self,
                                                                        gboolean value);
static void publishing_piwigo_publishing_options_pane_set_last_no_upload_ratings (PublishingPiwigoPublishingOptionsPane* self,
                                                                           gboolean value);
static void publishing_piwigo_publishing_options_pane_set_strip_metadata_enabled (PublishingPiwigoPublishingOptionsPane* self,
                                                                           gboolean value);
static void publishing_piwigo_publishing_options_pane_set_existing_categories (PublishingPiwigoPublishingOptionsPane* self,
                                                                        GeeList* value);
static void publishing_piwigo_publishing_options_pane_set_default_comment (PublishingPiwigoPublishingOptionsPane* self,
                                                                    const gchar* value);
static void g_cclosure_user_marshal_VOID__PUBLISHING_PIWIGO_PUBLISHING_PARAMETERS_BOOLEAN (GClosure * closure,
                                                                                    GValue * return_value,
                                                                                    guint n_param_values,
                                                                                    const GValue * param_values,
                                                                                    gpointer invocation_hint,
                                                                                    gpointer marshal_data);
static void publishing_piwigo_publishing_options_pane_finalize (GObject * obj);
static GType publishing_piwigo_publishing_options_pane_get_type_once (void);
static void _vala_publishing_piwigo_publishing_options_pane_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec);
static void _vala_publishing_piwigo_publishing_options_pane_set_property (GObject * object,
                                                                   guint property_id,
                                                                   const GValue * value,
                                                                   GParamSpec * pspec);
static gboolean publishing_piwigo_session_real_is_authenticated (PublishingRESTSupportSession* base);
static void publishing_piwigo_session_finalize (PublishingRESTSupportSession * obj);
static GType publishing_piwigo_session_get_type_once (void);
VALA_EXTERN PublishingPiwigoTransaction* publishing_piwigo_transaction_new (PublishingPiwigoSession* session);
VALA_EXTERN PublishingPiwigoTransaction* publishing_piwigo_transaction_construct (GType object_type,
                                                                      PublishingPiwigoSession* session);
VALA_EXTERN PublishingPiwigoTransaction* publishing_piwigo_transaction_new_authenticated (PublishingPiwigoSession* session);
VALA_EXTERN PublishingPiwigoTransaction* publishing_piwigo_transaction_construct_authenticated (GType object_type,
                                                                                    PublishingPiwigoSession* session);
static GType publishing_piwigo_transaction_get_type_once (void);
VALA_EXTERN PublishingPiwigoSessionLoginTransaction* publishing_piwigo_session_login_transaction_new_from_other (PublishingPiwigoSession* session,
                                                                                                     PublishingPiwigoTransaction* other);
VALA_EXTERN PublishingPiwigoSessionLoginTransaction* publishing_piwigo_session_login_transaction_construct_from_other (GType object_type,
                                                                                                           PublishingPiwigoSession* session,
                                                                                                           PublishingPiwigoTransaction* other);
static GType publishing_piwigo_session_login_transaction_get_type_once (void);
static GType publishing_piwigo_session_get_status_transaction_get_type_once (void);
static GType publishing_piwigo_categories_get_list_transaction_get_type_once (void);
static GType publishing_piwigo_session_logout_transaction_get_type_once (void);
static GType publishing_piwigo_categories_add_transaction_get_type_once (void);
static void publishing_piwigo_images_add_transaction_on_completed (PublishingPiwigoImagesAddTransaction* self);
static void _publishing_piwigo_images_add_transaction_on_completed_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender,
                                                                                                           gpointer self);
VALA_EXTERN PublishingPiwigoImagesAddRating* publishing_piwigo_images_add_rating_new (PublishingPiwigoSession* session,
                                                                          SpitPublishingPublishable* publishable,
                                                                          const gchar* image_id);
VALA_EXTERN PublishingPiwigoImagesAddRating* publishing_piwigo_images_add_rating_construct (GType object_type,
                                                                                PublishingPiwigoSession* session,
                                                                                SpitPublishingPublishable* publishable,
                                                                                const gchar* image_id);
VALA_EXTERN GType publishing_piwigo_images_add_rating_get_type (void) G_GNUC_CONST ;
static void publishing_piwigo_images_add_transaction_finalize (PublishingRESTSupportTransaction * obj);
static GType publishing_piwigo_images_add_transaction_get_type_once (void);
static GType publishing_piwigo_images_add_rating_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

PublishingPiwigoAccount*
publishing_piwigo_account_construct (GType object_type,
                                     const gchar* server_uri,
                                     const gchar* user)
{
	PublishingPiwigoAccount * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (server_uri != NULL, NULL);
	g_return_val_if_fail (user != NULL, NULL);
	self = (PublishingPiwigoAccount*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (server_uri);
	_g_free0 (self->server_uri);
	self->server_uri = _tmp0_;
	_tmp1_ = g_strdup (user);
	_g_free0 (self->user);
	self->user = _tmp1_;
	return self;
}

PublishingPiwigoAccount*
publishing_piwigo_account_new (const gchar* server_uri,
                               const gchar* user)
{
	return publishing_piwigo_account_construct (PUBLISHING_PIWIGO_TYPE_ACCOUNT, server_uri, user);
}

static gchar*
publishing_piwigo_account_real_display_name (SpitPublishingAccount* base)
{
	PublishingPiwigoAccount * self;
	GError* _inner_error0_ = NULL;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_ACCOUNT, PublishingPiwigoAccount);
	{
		GUri* uri = NULL;
		const gchar* _tmp0_;
		GUri* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp0_ = self->server_uri;
		_tmp1_ = g_uri_parse (_tmp0_, G_URI_FLAGS_NONE, &_inner_error0_);
		uri = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = self->user;
		_tmp3_ = g_strconcat (_tmp2_, "@", NULL);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_uri_get_host (uri);
		_tmp6_ = g_strconcat (_tmp4_, _tmp5_, NULL);
		_tmp7_ = _tmp6_;
		_g_free0 (_tmp4_);
		result = _tmp7_;
		_g_uri_unref0 (uri);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = err;
		_tmp9_ = _tmp8_->message;
		g_debug ("PiwigoPublishing.vala:18: Failed to parse uri in Piwigo account. %s", _tmp9_);
		_tmp10_ = self->user;
		_tmp11_ = g_strconcat (_tmp10_, "@", NULL);
		_tmp12_ = _tmp11_;
		_tmp13_ = self->server_uri;
		_tmp14_ = g_strconcat (_tmp12_, _tmp13_, NULL);
		_tmp15_ = _tmp14_;
		_g_free0 (_tmp12_);
		result = _tmp15_;
		_g_error_free0 (err);
		return result;
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static void
publishing_piwigo_account_class_init (PublishingPiwigoAccountClass * klass,
                                      gpointer klass_data)
{
	publishing_piwigo_account_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = publishing_piwigo_account_finalize;
}

static void
publishing_piwigo_account_spit_publishing_account_interface_init (SpitPublishingAccountIface * iface,
                                                                  gpointer iface_data)
{
	publishing_piwigo_account_spit_publishing_account_parent_iface = g_type_interface_peek_parent (iface);
	iface->display_name = (gchar* (*) (SpitPublishingAccount*)) publishing_piwigo_account_real_display_name;
}

static void
publishing_piwigo_account_instance_init (PublishingPiwigoAccount * self,
                                         gpointer klass)
{
}

static void
publishing_piwigo_account_finalize (GObject * obj)
{
	PublishingPiwigoAccount * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_ACCOUNT, PublishingPiwigoAccount);
	_g_free0 (self->server_uri);
	_g_free0 (self->user);
	G_OBJECT_CLASS (publishing_piwigo_account_parent_class)->finalize (obj);
}

static GType
publishing_piwigo_account_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoAccountClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_account_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoAccount), 0, (GInstanceInitFunc) publishing_piwigo_account_instance_init, NULL };
	static const GInterfaceInfo spit_publishing_account_info = { (GInterfaceInitFunc) publishing_piwigo_account_spit_publishing_account_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType publishing_piwigo_account_type_id;
	publishing_piwigo_account_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingPiwigoAccount", &g_define_type_info, 0);
	g_type_add_interface_static (publishing_piwigo_account_type_id, SPIT_PUBLISHING_TYPE_ACCOUNT, &spit_publishing_account_info);
	return publishing_piwigo_account_type_id;
}

GType
publishing_piwigo_account_get_type (void)
{
	static volatile gsize publishing_piwigo_account_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_account_type_id__once)) {
		GType publishing_piwigo_account_type_id;
		publishing_piwigo_account_type_id = publishing_piwigo_account_get_type_once ();
		g_once_init_leave (&publishing_piwigo_account_type_id__once, publishing_piwigo_account_type_id);
	}
	return publishing_piwigo_account_type_id__once;
}

PiwigoService*
piwigo_service_construct (GType object_type)
{
	PiwigoService * self = NULL;
	self = (PiwigoService*) g_object_new (object_type, NULL);
	return self;
}

PiwigoService*
piwigo_service_new (void)
{
	return piwigo_service_construct (TYPE_PIWIGO_SERVICE);
}

static gint
piwigo_service_real_get_pluggable_interface (SpitPluggable* base,
                                             gint min_host_interface,
                                             gint max_host_interface)
{
	PiwigoService * self;
	gint result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PIWIGO_SERVICE, PiwigoService);
	result = spit_negotiate_interfaces (min_host_interface, max_host_interface, SPIT_PUBLISHING_CURRENT_INTERFACE);
	return result;
}

static const gchar*
piwigo_service_real_get_id (SpitPluggable* base)
{
	PiwigoService * self;
	const gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PIWIGO_SERVICE, PiwigoService);
	result = "org.gnome.shotwell.publishing.piwigo";
	return result;
}

static const gchar*
piwigo_service_real_get_pluggable_name (SpitPluggable* base)
{
	PiwigoService * self;
	const gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PIWIGO_SERVICE, PiwigoService);
	result = "Piwigo";
	return result;
}

static SpitPluggableInfo*
piwigo_service_real_get_info (SpitPluggable* base)
{
	PiwigoService * self;
	SpitPluggableInfo* info = NULL;
	SpitPluggableInfo* _tmp0_;
	SpitPluggableInfo* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PIWIGO_SERVICE, PiwigoService);
	_tmp0_ = spit_pluggable_info_new ();
	info = _tmp0_;
	spit_pluggable_info_set_authors (info, "Bruno Girin");
	spit_pluggable_info_set_copyright (info, _ ("Copyright 2016 Software Freedom Conservancy Inc."));
	spit_pluggable_info_set_translators (info, RESOURCES_TRANSLATORS);
	spit_pluggable_info_set_version (info, _VERSION);
	spit_pluggable_info_set_icon_name (info, "piwigo");
	result = info;
	return result;
}

static void
piwigo_service_real_activation (SpitPluggable* base,
                                gboolean enabled)
{
	PiwigoService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PIWIGO_SERVICE, PiwigoService);
}

static SpitPublishingPublisher*
piwigo_service_real_create_publisher (SpitPublishingService* base,
                                      SpitPublishingPluginHost* host)
{
	PiwigoService * self;
	PublishingPiwigoPiwigoPublisher* _tmp0_;
	SpitPublishingPublisher* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PIWIGO_SERVICE, PiwigoService);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (host, SPIT_PUBLISHING_TYPE_PLUGIN_HOST), NULL);
	_tmp0_ = publishing_piwigo_piwigo_publisher_new (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_SERVICE, SpitPublishingService), host, NULL);
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher);
	return result;
}

static SpitPublishingPublisher*
piwigo_service_real_create_publisher_with_account (SpitPublishingService* base,
                                                   SpitPublishingPluginHost* host,
                                                   SpitPublishingAccount* account)
{
	PiwigoService * self;
	PublishingPiwigoPiwigoPublisher* _tmp0_;
	SpitPublishingPublisher* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PIWIGO_SERVICE, PiwigoService);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (host, SPIT_PUBLISHING_TYPE_PLUGIN_HOST), NULL);
	g_return_val_if_fail ((account == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (account, SPIT_PUBLISHING_TYPE_ACCOUNT), NULL);
	_tmp0_ = publishing_piwigo_piwigo_publisher_new (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_SERVICE, SpitPublishingService), host, account);
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher);
	return result;
}

static SpitPublishingPublisherMediaType
piwigo_service_real_get_supported_media (SpitPublishingService* base)
{
	PiwigoService * self;
	SpitPublishingPublisherMediaType result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PIWIGO_SERVICE, PiwigoService);
	result = SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_PHOTO;
	return result;
}

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

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

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static GeeList*
piwigo_service_real_get_accounts (SpitPublishingService* base,
                                  const gchar* profile_id)
{
	PiwigoService * self;
	GeeArrayList* list = NULL;
	GeeArrayList* _tmp0_;
	SpitPublishingDefaultAccount* _tmp1_;
	SpitPublishingDefaultAccount* _tmp2_;
	SecretSchema* schema = NULL;
	SecretSchema* _tmp3_;
	GHashTable* attributes = NULL;
	GHashFunc _tmp4_;
	GEqualFunc _tmp5_;
	GHashTable* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GError* _inner_error0_ = NULL;
	GeeList* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PIWIGO_SERVICE, PiwigoService);
	g_return_val_if_fail (profile_id != NULL, NULL);
	_tmp0_ = gee_array_list_new (SPIT_PUBLISHING_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	list = _tmp0_;
	_tmp1_ = spit_publishing_default_account_new ();
	_tmp2_ = _tmp1_;
	gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SPIT_PUBLISHING_TYPE_ACCOUNT, SpitPublishingAccount));
	_g_object_unref0 (_tmp2_);
	_tmp3_ = secret_schema_new (PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_PASSWORD_SCHEME, SECRET_SCHEMA_NONE, PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_SCHEMA_KEY_PROFILE_ID, SECRET_SCHEMA_ATTRIBUTE_STRING, "url", SECRET_SCHEMA_ATTRIBUTE_STRING, "user", SECRET_SCHEMA_ATTRIBUTE_STRING, NULL);
	schema = _tmp3_;
	_tmp4_ = g_str_hash;
	_tmp5_ = g_str_equal;
	_tmp6_ = g_hash_table_new_full (_tmp4_, _tmp5_, _g_free0_, _g_free0_);
	attributes = _tmp6_;
	_tmp7_ = g_strdup (PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_SCHEMA_KEY_PROFILE_ID);
	_tmp8_ = g_strdup (profile_id);
	g_hash_table_insert (attributes, _tmp7_, _tmp8_);
	{
		GList* entries = NULL;
		GList* _tmp9_;
		_tmp9_ = secret_password_searchv_sync (schema, attributes, SECRET_SEARCH_ALL, NULL, &_inner_error0_);
		entries = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		{
			GList* entry_collection = NULL;
			GList* entry_it = NULL;
			entry_collection = entries;
			for (entry_it = entry_collection; entry_it != NULL; entry_it = entry_it->next) {
				SecretRetrievable* _tmp10_;
				SecretRetrievable* entry = NULL;
				_tmp10_ = _g_object_ref0 ((SecretRetrievable*) entry_it->data);
				entry = _tmp10_;
				{
					GHashTable* found_attributes = NULL;
					SecretRetrievable* _tmp11_;
					GHashTable* _tmp12_;
					GHashTable* _tmp13_;
					gconstpointer _tmp14_;
					GHashTable* _tmp15_;
					gconstpointer _tmp16_;
					PublishingPiwigoAccount* _tmp17_;
					PublishingPiwigoAccount* _tmp18_;
					_tmp11_ = entry;
					_tmp12_ = secret_retrievable_get_attributes (_tmp11_);
					found_attributes = _tmp12_;
					_tmp13_ = found_attributes;
					_tmp14_ = g_hash_table_lookup (_tmp13_, "url");
					_tmp15_ = found_attributes;
					_tmp16_ = g_hash_table_lookup (_tmp15_, "user");
					_tmp17_ = publishing_piwigo_account_new ((const gchar*) _tmp14_, (const gchar*) _tmp16_);
					_tmp18_ = _tmp17_;
					gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, SPIT_PUBLISHING_TYPE_ACCOUNT, SpitPublishingAccount));
					_g_object_unref0 (_tmp18_);
					_g_hash_table_unref0 (found_attributes);
					_g_object_unref0 (entry);
				}
			}
		}
		(entries == NULL) ? NULL : (entries = (_g_list_free__g_object_unref0_ (entries), NULL));
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp19_;
		const gchar* _tmp20_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp19_ = err;
		_tmp20_ = _tmp19_->message;
		g_warning ("PiwigoPublishing.vala:91: Failed to look up accounts for Piwigo: %s", _tmp20_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_hash_table_unref0 (attributes);
		_secret_schema_unref0 (schema);
		_g_object_unref0 (list);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_LIST, GeeList);
	_g_hash_table_unref0 (attributes);
	_secret_schema_unref0 (schema);
	return result;
}

static void
piwigo_service_class_init (PiwigoServiceClass * klass,
                           gpointer klass_data)
{
	piwigo_service_parent_class = g_type_class_peek_parent (klass);
}

static void
piwigo_service_spit_pluggable_interface_init (SpitPluggableIface * iface,
                                              gpointer iface_data)
{
	piwigo_service_spit_pluggable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_pluggable_interface = (gint (*) (SpitPluggable*, gint, gint)) piwigo_service_real_get_pluggable_interface;
	iface->get_id = (const gchar* (*) (SpitPluggable*)) piwigo_service_real_get_id;
	iface->get_pluggable_name = (const gchar* (*) (SpitPluggable*)) piwigo_service_real_get_pluggable_name;
	iface->get_info = (SpitPluggableInfo* (*) (SpitPluggable*)) piwigo_service_real_get_info;
	iface->activation = (void (*) (SpitPluggable*, gboolean)) piwigo_service_real_activation;
}

static void
piwigo_service_spit_publishing_service_interface_init (SpitPublishingServiceIface * iface,
                                                       gpointer iface_data)
{
	piwigo_service_spit_publishing_service_parent_iface = g_type_interface_peek_parent (iface);
	iface->create_publisher = (SpitPublishingPublisher* (*) (SpitPublishingService*, SpitPublishingPluginHost*)) piwigo_service_real_create_publisher;
	iface->create_publisher_with_account = (SpitPublishingPublisher* (*) (SpitPublishingService*, SpitPublishingPluginHost*, SpitPublishingAccount*)) piwigo_service_real_create_publisher_with_account;
	iface->get_supported_media = (SpitPublishingPublisherMediaType (*) (SpitPublishingService*)) piwigo_service_real_get_supported_media;
	iface->get_accounts = (GeeList* (*) (SpitPublishingService*, const gchar*)) piwigo_service_real_get_accounts;
}

static void
piwigo_service_instance_init (PiwigoService * self,
                              gpointer klass)
{
}

static GType
piwigo_service_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PiwigoServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) piwigo_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PiwigoService), 0, (GInstanceInitFunc) piwigo_service_instance_init, NULL };
	static const GInterfaceInfo spit_pluggable_info = { (GInterfaceInitFunc) piwigo_service_spit_pluggable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo spit_publishing_service_info = { (GInterfaceInitFunc) piwigo_service_spit_publishing_service_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType piwigo_service_type_id;
	piwigo_service_type_id = g_type_register_static (G_TYPE_OBJECT, "PiwigoService", &g_define_type_info, 0);
	g_type_add_interface_static (piwigo_service_type_id, SPIT_TYPE_PLUGGABLE, &spit_pluggable_info);
	g_type_add_interface_static (piwigo_service_type_id, SPIT_PUBLISHING_TYPE_SERVICE, &spit_publishing_service_info);
	return piwigo_service_type_id;
}

GType
piwigo_service_get_type (void)
{
	static volatile gsize piwigo_service_type_id__once = 0;
	if (g_once_init_enter (&piwigo_service_type_id__once)) {
		GType piwigo_service_type_id;
		piwigo_service_type_id = piwigo_service_get_type_once ();
		g_once_init_leave (&piwigo_service_type_id__once, piwigo_service_type_id);
	}
	return piwigo_service_type_id__once;
}

PublishingPiwigoCategory*
publishing_piwigo_category_construct (GType object_type,
                                      gint id,
                                      const gchar* name,
                                      const gchar* uppercats,
                                      const gchar* comment)
{
	PublishingPiwigoCategory* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (uppercats != NULL, NULL);
	self = (PublishingPiwigoCategory*) g_type_create_instance (object_type);
	self->id = id;
	_tmp0_ = g_strdup (name);
	_g_free0 (self->name);
	self->name = _tmp0_;
	_tmp1_ = g_strdup (uppercats);
	_g_free0 (self->uppercats);
	self->uppercats = _tmp1_;
	_tmp2_ = g_strdup (comment);
	_g_free0 (self->comment);
	self->comment = _tmp2_;
	return self;
}

PublishingPiwigoCategory*
publishing_piwigo_category_new (gint id,
                                const gchar* name,
                                const gchar* uppercats,
                                const gchar* comment)
{
	return publishing_piwigo_category_construct (PUBLISHING_PIWIGO_TYPE_CATEGORY, id, name, uppercats, comment);
}

PublishingPiwigoCategory*
publishing_piwigo_category_construct_local (GType object_type,
                                            const gchar* name,
                                            gint parent_id,
                                            const gchar* comment)
{
	PublishingPiwigoCategory* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_val_if_fail (name != NULL, NULL);
	self = (PublishingPiwigoCategory*) g_type_create_instance (object_type);
	self->id = PUBLISHING_PIWIGO_CATEGORY_NO_ID;
	_tmp0_ = g_strdup (name);
	_g_free0 (self->name);
	self->name = _tmp0_;
	_tmp1_ = g_strdup_printf ("%i", parent_id);
	_g_free0 (self->uppercats);
	self->uppercats = _tmp1_;
	_tmp2_ = g_strdup (comment);
	_g_free0 (self->comment);
	self->comment = _tmp2_;
	return self;
}

PublishingPiwigoCategory*
publishing_piwigo_category_new_local (const gchar* name,
                                      gint parent_id,
                                      const gchar* comment)
{
	return publishing_piwigo_category_construct_local (PUBLISHING_PIWIGO_TYPE_CATEGORY, name, parent_id, comment);
}

gboolean
publishing_piwigo_category_is_local (PublishingPiwigoCategory* self)
{
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_CATEGORY (self), FALSE);
	result = self->id == PUBLISHING_PIWIGO_CATEGORY_NO_ID;
	return result;
}

gboolean
publishing_piwigo_category_equal (PublishingPiwigoCategory* _self_,
                                  PublishingPiwigoCategory* other)
{
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_CATEGORY (_self_), FALSE);
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_CATEGORY (other), FALSE);
	result = _self_->id == other->id;
	return result;
}

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

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

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

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

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

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

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

void
publishing_piwigo_value_set_category (GValue* value,
                                      gpointer v_object)
{
	PublishingPiwigoCategory * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_PIWIGO_TYPE_CATEGORY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_PIWIGO_TYPE_CATEGORY));
		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_piwigo_category_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_piwigo_category_unref (old);
	}
}

void
publishing_piwigo_value_take_category (GValue* value,
                                       gpointer v_object)
{
	PublishingPiwigoCategory * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_PIWIGO_TYPE_CATEGORY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_PIWIGO_TYPE_CATEGORY));
		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_piwigo_category_unref (old);
	}
}

static void
publishing_piwigo_category_class_init (PublishingPiwigoCategoryClass * klass,
                                       gpointer klass_data)
{
	publishing_piwigo_category_parent_class = g_type_class_peek_parent (klass);
	((PublishingPiwigoCategoryClass *) klass)->finalize = publishing_piwigo_category_finalize;
}

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

static void
publishing_piwigo_category_finalize (PublishingPiwigoCategory * obj)
{
	PublishingPiwigoCategory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_CATEGORY, PublishingPiwigoCategory);
	g_signal_handlers_destroy (self);
	_g_free0 (self->name);
	_g_free0 (self->comment);
	_g_free0 (self->display_name);
	_g_free0 (self->uppercats);
}

static GType
publishing_piwigo_category_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_piwigo_value_category_init, publishing_piwigo_value_category_free_value, publishing_piwigo_value_category_copy_value, publishing_piwigo_value_category_peek_pointer, "p", publishing_piwigo_value_category_collect_value, "p", publishing_piwigo_value_category_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoCategoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_category_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoCategory), 0, (GInstanceInitFunc) publishing_piwigo_category_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_piwigo_category_type_id;
	publishing_piwigo_category_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingPiwigoCategory", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return publishing_piwigo_category_type_id;
}

GType
publishing_piwigo_category_get_type (void)
{
	static volatile gsize publishing_piwigo_category_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_category_type_id__once)) {
		GType publishing_piwigo_category_type_id;
		publishing_piwigo_category_type_id = publishing_piwigo_category_get_type_once ();
		g_once_init_leave (&publishing_piwigo_category_type_id__once, publishing_piwigo_category_type_id);
	}
	return publishing_piwigo_category_type_id__once;
}

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

void
publishing_piwigo_category_unref (gpointer instance)
{
	PublishingPiwigoCategory * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_PIWIGO_CATEGORY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

PublishingPiwigoPermissionLevel*
publishing_piwigo_permission_level_construct (GType object_type,
                                              gint id,
                                              const gchar* name)
{
	PublishingPiwigoPermissionLevel* self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (name != NULL, NULL);
	self = (PublishingPiwigoPermissionLevel*) g_type_create_instance (object_type);
	self->id = id;
	_tmp0_ = g_strdup (name);
	_g_free0 (self->name);
	self->name = _tmp0_;
	return self;
}

PublishingPiwigoPermissionLevel*
publishing_piwigo_permission_level_new (gint id,
                                        const gchar* name)
{
	return publishing_piwigo_permission_level_construct (PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL, id, name);
}

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

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

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

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

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

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

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

void
publishing_piwigo_value_set_permission_level (GValue* value,
                                              gpointer v_object)
{
	PublishingPiwigoPermissionLevel * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL));
		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_piwigo_permission_level_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_piwigo_permission_level_unref (old);
	}
}

void
publishing_piwigo_value_take_permission_level (GValue* value,
                                               gpointer v_object)
{
	PublishingPiwigoPermissionLevel * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL));
		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_piwigo_permission_level_unref (old);
	}
}

static void
publishing_piwigo_permission_level_class_init (PublishingPiwigoPermissionLevelClass * klass,
                                               gpointer klass_data)
{
	publishing_piwigo_permission_level_parent_class = g_type_class_peek_parent (klass);
	((PublishingPiwigoPermissionLevelClass *) klass)->finalize = publishing_piwigo_permission_level_finalize;
}

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

static void
publishing_piwigo_permission_level_finalize (PublishingPiwigoPermissionLevel * obj)
{
	PublishingPiwigoPermissionLevel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_PERMISSION_LEVEL, PublishingPiwigoPermissionLevel);
	g_signal_handlers_destroy (self);
	_g_free0 (self->name);
}

static GType
publishing_piwigo_permission_level_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_piwigo_value_permission_level_init, publishing_piwigo_value_permission_level_free_value, publishing_piwigo_value_permission_level_copy_value, publishing_piwigo_value_permission_level_peek_pointer, "p", publishing_piwigo_value_permission_level_collect_value, "p", publishing_piwigo_value_permission_level_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoPermissionLevelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_permission_level_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoPermissionLevel), 0, (GInstanceInitFunc) publishing_piwigo_permission_level_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_piwigo_permission_level_type_id;
	publishing_piwigo_permission_level_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingPiwigoPermissionLevel", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return publishing_piwigo_permission_level_type_id;
}

GType
publishing_piwigo_permission_level_get_type (void)
{
	static volatile gsize publishing_piwigo_permission_level_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_permission_level_type_id__once)) {
		GType publishing_piwigo_permission_level_type_id;
		publishing_piwigo_permission_level_type_id = publishing_piwigo_permission_level_get_type_once ();
		g_once_init_leave (&publishing_piwigo_permission_level_type_id__once, publishing_piwigo_permission_level_type_id);
	}
	return publishing_piwigo_permission_level_type_id__once;
}

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

void
publishing_piwigo_permission_level_unref (gpointer instance)
{
	PublishingPiwigoPermissionLevel * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_PIWIGO_PERMISSION_LEVEL_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

PublishingPiwigoSizeEntry*
publishing_piwigo_size_entry_construct (GType object_type,
                                        gint id,
                                        const gchar* name)
{
	PublishingPiwigoSizeEntry* self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (name != NULL, NULL);
	self = (PublishingPiwigoSizeEntry*) g_type_create_instance (object_type);
	self->id = id;
	_tmp0_ = g_strdup (name);
	_g_free0 (self->name);
	self->name = _tmp0_;
	return self;
}

PublishingPiwigoSizeEntry*
publishing_piwigo_size_entry_new (gint id,
                                  const gchar* name)
{
	return publishing_piwigo_size_entry_construct (PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY, id, name);
}

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

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

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

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

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

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

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

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

void
publishing_piwigo_value_set_size_entry (GValue* value,
                                        gpointer v_object)
{
	PublishingPiwigoSizeEntry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		publishing_piwigo_size_entry_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_piwigo_size_entry_unref (old);
	}
}

void
publishing_piwigo_value_take_size_entry (GValue* value,
                                         gpointer v_object)
{
	PublishingPiwigoSizeEntry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_piwigo_size_entry_unref (old);
	}
}

static void
publishing_piwigo_size_entry_class_init (PublishingPiwigoSizeEntryClass * klass,
                                         gpointer klass_data)
{
	publishing_piwigo_size_entry_parent_class = g_type_class_peek_parent (klass);
	((PublishingPiwigoSizeEntryClass *) klass)->finalize = publishing_piwigo_size_entry_finalize;
}

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

static void
publishing_piwigo_size_entry_finalize (PublishingPiwigoSizeEntry * obj)
{
	PublishingPiwigoSizeEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_SIZE_ENTRY, PublishingPiwigoSizeEntry);
	g_signal_handlers_destroy (self);
	_g_free0 (self->name);
}

static GType
publishing_piwigo_size_entry_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_piwigo_value_size_entry_init, publishing_piwigo_value_size_entry_free_value, publishing_piwigo_value_size_entry_copy_value, publishing_piwigo_value_size_entry_peek_pointer, "p", publishing_piwigo_value_size_entry_collect_value, "p", publishing_piwigo_value_size_entry_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoSizeEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_size_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoSizeEntry), 0, (GInstanceInitFunc) publishing_piwigo_size_entry_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType publishing_piwigo_size_entry_type_id;
	publishing_piwigo_size_entry_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingPiwigoSizeEntry", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return publishing_piwigo_size_entry_type_id;
}

GType
publishing_piwigo_size_entry_get_type (void)
{
	static volatile gsize publishing_piwigo_size_entry_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_size_entry_type_id__once)) {
		GType publishing_piwigo_size_entry_type_id;
		publishing_piwigo_size_entry_type_id = publishing_piwigo_size_entry_get_type_once ();
		g_once_init_leave (&publishing_piwigo_size_entry_type_id__once, publishing_piwigo_size_entry_type_id);
	}
	return publishing_piwigo_size_entry_type_id__once;
}

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

void
publishing_piwigo_size_entry_unref (gpointer instance)
{
	PublishingPiwigoSizeEntry * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_PIWIGO_SIZE_ENTRY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

PublishingPiwigoPublishingParameters*
publishing_piwigo_publishing_parameters_construct (GType object_type)
{
	PublishingPiwigoPublishingParameters* self = NULL;
	self = (PublishingPiwigoPublishingParameters*) g_type_create_instance (object_type);
	return self;
}

PublishingPiwigoPublishingParameters*
publishing_piwigo_publishing_parameters_new (void)
{
	return publishing_piwigo_publishing_parameters_construct (PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS);
}

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

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

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

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

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

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

GParamSpec*
publishing_piwigo_param_spec_publishing_parameters (const gchar* name,
                                                    const gchar* nick,
                                                    const gchar* blurb,
                                                    GType object_type,
                                                    GParamFlags flags)
{
	PublishingPiwigoParamSpecPublishingParameters* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PUBLISHING_PIWIGO_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_piwigo_value_get_publishing_parameters (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS), NULL);
	return value->data[0].v_pointer;
}

void
publishing_piwigo_value_set_publishing_parameters (GValue* value,
                                                   gpointer v_object)
{
	PublishingPiwigoPublishingParameters * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_PIWIGO_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_piwigo_publishing_parameters_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_piwigo_publishing_parameters_unref (old);
	}
}

void
publishing_piwigo_value_take_publishing_parameters (GValue* value,
                                                    gpointer v_object)
{
	PublishingPiwigoPublishingParameters * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_PIWIGO_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_piwigo_publishing_parameters_unref (old);
	}
}

static void
publishing_piwigo_publishing_parameters_class_init (PublishingPiwigoPublishingParametersClass * klass,
                                                    gpointer klass_data)
{
	publishing_piwigo_publishing_parameters_parent_class = g_type_class_peek_parent (klass);
	((PublishingPiwigoPublishingParametersClass *) klass)->finalize = publishing_piwigo_publishing_parameters_finalize;
}

static void
publishing_piwigo_publishing_parameters_instance_init (PublishingPiwigoPublishingParameters * self,
                                                       gpointer klass)
{
	self->category = NULL;
	self->perm_level = NULL;
	self->photo_size = NULL;
	self->title_as_comment = FALSE;
	self->no_upload_tags = FALSE;
	self->no_upload_ratings = FALSE;
	self->ref_count = 1;
}

static void
publishing_piwigo_publishing_parameters_finalize (PublishingPiwigoPublishingParameters * obj)
{
	PublishingPiwigoPublishingParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS, PublishingPiwigoPublishingParameters);
	g_signal_handlers_destroy (self);
	_publishing_piwigo_category_unref0 (self->category);
	_publishing_piwigo_permission_level_unref0 (self->perm_level);
	_publishing_piwigo_size_entry_unref0 (self->photo_size);
}

static GType
publishing_piwigo_publishing_parameters_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_piwigo_value_publishing_parameters_init, publishing_piwigo_value_publishing_parameters_free_value, publishing_piwigo_value_publishing_parameters_copy_value, publishing_piwigo_value_publishing_parameters_peek_pointer, "p", publishing_piwigo_value_publishing_parameters_collect_value, "p", publishing_piwigo_value_publishing_parameters_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoPublishingParametersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_publishing_parameters_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoPublishingParameters), 0, (GInstanceInitFunc) publishing_piwigo_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_piwigo_publishing_parameters_type_id;
	publishing_piwigo_publishing_parameters_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingPiwigoPublishingParameters", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return publishing_piwigo_publishing_parameters_type_id;
}

GType
publishing_piwigo_publishing_parameters_get_type (void)
{
	static volatile gsize publishing_piwigo_publishing_parameters_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_publishing_parameters_type_id__once)) {
		GType publishing_piwigo_publishing_parameters_type_id;
		publishing_piwigo_publishing_parameters_type_id = publishing_piwigo_publishing_parameters_get_type_once ();
		g_once_init_leave (&publishing_piwigo_publishing_parameters_type_id__once, publishing_piwigo_publishing_parameters_type_id);
	}
	return publishing_piwigo_publishing_parameters_type_id__once;
}

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

void
publishing_piwigo_publishing_parameters_unref (gpointer instance)
{
	PublishingPiwigoPublishingParameters * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_PIWIGO_PUBLISHING_PARAMETERS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
publishing_piwigo_piwigo_publisher_get_instance_private (PublishingPiwigoPiwigoPublisher* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingPiwigoPiwigoPublisher_private_offset);
}

PublishingPiwigoPiwigoPublisher*
publishing_piwigo_piwigo_publisher_construct (GType object_type,
                                              SpitPublishingService* service,
                                              SpitPublishingPluginHost* host,
                                              SpitPublishingAccount* account)
{
	PublishingPiwigoPiwigoPublisher * self = NULL;
	SpitPublishingService* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	PublishingPiwigoSession* _tmp2_;
	SecretSchema* _tmp4_;
	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);
	g_return_val_if_fail ((account == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (account, SPIT_PUBLISHING_TYPE_ACCOUNT), NULL);
	self = (PublishingPiwigoPiwigoPublisher*) g_object_new (object_type, NULL);
	g_debug ("PiwigoPublishing.vala:187: PiwigoPublisher instantiated.");
	_tmp0_ = _g_object_ref0 (service);
	_g_object_unref0 (self->priv->service);
	self->priv->service = _tmp0_;
	_tmp1_ = _g_object_ref0 (host);
	_g_object_unref0 (self->priv->host);
	self->priv->host = _tmp1_;
	_tmp2_ = publishing_piwigo_session_new ();
	_publishing_rest_support_session_unref0 (self->priv->session);
	self->priv->session = _tmp2_;
	if (PUBLISHING_PIWIGO_IS_ACCOUNT (account)) {
		PublishingPiwigoAccount* _tmp3_;
		_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (account, PUBLISHING_PIWIGO_TYPE_ACCOUNT, PublishingPiwigoAccount));
		_g_object_unref0 (self->priv->account);
		self->priv->account = _tmp3_;
	}
	_tmp4_ = secret_schema_new (PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_PASSWORD_SCHEME, SECRET_SCHEMA_NONE, PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_SCHEMA_KEY_PROFILE_ID, SECRET_SCHEMA_ATTRIBUTE_STRING, "url", SECRET_SCHEMA_ATTRIBUTE_STRING, "user", SECRET_SCHEMA_ATTRIBUTE_STRING, NULL);
	_secret_schema_unref0 (self->priv->schema);
	self->priv->schema = _tmp4_;
	return self;
}

PublishingPiwigoPiwigoPublisher*
publishing_piwigo_piwigo_publisher_new (SpitPublishingService* service,
                                        SpitPublishingPluginHost* host,
                                        SpitPublishingAccount* account)
{
	return publishing_piwigo_piwigo_publisher_construct (PUBLISHING_PIWIGO_TYPE_PIWIGO_PUBLISHER, service, host, account);
}

static SpitPublishingService*
publishing_piwigo_piwigo_publisher_real_get_service (SpitPublishingPublisher* base)
{
	PublishingPiwigoPiwigoPublisher * self;
	SpitPublishingService* _tmp0_;
	SpitPublishingService* _tmp1_;
	SpitPublishingService* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_PIWIGO_PUBLISHER, PublishingPiwigoPiwigoPublisher);
	_tmp0_ = self->priv->service;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

SpitPublishingPluginHost*
publishing_piwigo_piwigo_publisher_get_host (PublishingPiwigoPiwigoPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	SpitPublishingPluginHost* result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), NULL);
	_tmp0_ = self->priv->host;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
publishing_piwigo_piwigo_publisher_real_is_running (SpitPublishingPublisher* base)
{
	PublishingPiwigoPiwigoPublisher * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_PIWIGO_PUBLISHER, PublishingPiwigoPiwigoPublisher);
	result = self->priv->running;
	return result;
}

static void
publishing_piwigo_piwigo_publisher_real_start (SpitPublishingPublisher* base)
{
	PublishingPiwigoPiwigoPublisher * self;
	PublishingPiwigoSession* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_PIWIGO_PUBLISHER, PublishingPiwigoPiwigoPublisher);
	if (spit_publishing_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher))) {
		return;
	}
	g_debug ("PiwigoPublishing.vala:221: PiwigoPublisher: starting interaction.");
	self->priv->running = TRUE;
	_tmp0_ = self->priv->session;
	if (publishing_rest_support_session_is_authenticated (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession))) {
		g_debug ("PiwigoPublishing.vala:226: PiwigoPublisher: session is authenticated.");
		publishing_piwigo_piwigo_publisher_do_fetch_categories (self, NULL, NULL);
	} else {
		gchar* persistent_url = NULL;
		gchar* _tmp1_;
		gchar* persistent_username = NULL;
		gchar* _tmp2_;
		gchar* persistent_password = NULL;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_ = FALSE;
		const gchar* _tmp8_;
		g_debug ("PiwigoPublishing.vala:229: PiwigoPublisher: session is not authenticat" \
"ed.");
		_tmp1_ = publishing_piwigo_piwigo_publisher_get_persistent_url (self);
		persistent_url = _tmp1_;
		_tmp2_ = publishing_piwigo_piwigo_publisher_get_persistent_username (self);
		persistent_username = _tmp2_;
		_tmp3_ = persistent_url;
		_tmp4_ = persistent_username;
		_tmp5_ = publishing_piwigo_piwigo_publisher_get_persistent_password (self, _tmp3_, _tmp4_);
		persistent_password = _tmp5_;
		_tmp8_ = persistent_url;
		if (_tmp8_ != NULL) {
			const gchar* _tmp9_;
			_tmp9_ = persistent_username;
			_tmp7_ = _tmp9_ != NULL;
		} else {
			_tmp7_ = FALSE;
		}
		if (_tmp7_) {
			const gchar* _tmp10_;
			_tmp10_ = persistent_password;
			_tmp6_ = _tmp10_ != NULL;
		} else {
			_tmp6_ = FALSE;
		}
		if (_tmp6_) {
			const gchar* _tmp11_;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			_tmp11_ = persistent_url;
			_tmp12_ = persistent_username;
			_tmp13_ = persistent_password;
			publishing_piwigo_piwigo_publisher_do_network_login (self, _tmp11_, _tmp12_, _tmp13_, publishing_piwigo_piwigo_publisher_get_remember_password (self), NULL, NULL);
		} else {
			publishing_piwigo_piwigo_publisher_do_show_authentication_pane (self, PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_INTRO);
		}
		_g_free0 (persistent_password);
		_g_free0 (persistent_username);
		_g_free0 (persistent_url);
	}
}

static void
publishing_piwigo_piwigo_publisher_real_stop (SpitPublishingPublisher* base)
{
	PublishingPiwigoPiwigoPublisher * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_PIWIGO_PUBLISHER, PublishingPiwigoPiwigoPublisher);
	self->priv->running = FALSE;
}

gchar*
publishing_piwigo_piwigo_publisher_get_persistent_url (PublishingPiwigoPiwigoPublisher* self)
{
	PublishingPiwigoAccount* _tmp0_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), NULL);
	_tmp0_ = self->priv->account;
	if (_tmp0_ != NULL) {
		PublishingPiwigoAccount* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp1_ = self->priv->account;
		_tmp2_ = _tmp1_->server_uri;
		_tmp3_ = g_strdup (_tmp2_);
		result = _tmp3_;
		return result;
	}
	result = NULL;
	return result;
}

static void
publishing_piwigo_piwigo_publisher_set_persistent_url (PublishingPiwigoPiwigoPublisher* self,
                                                       const gchar* url)
{
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (url != NULL);
}

gchar*
publishing_piwigo_piwigo_publisher_get_persistent_username (PublishingPiwigoPiwigoPublisher* self)
{
	PublishingPiwigoAccount* _tmp0_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), NULL);
	_tmp0_ = self->priv->account;
	if (_tmp0_ != NULL) {
		PublishingPiwigoAccount* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp1_ = self->priv->account;
		_tmp2_ = _tmp1_->user;
		_tmp3_ = g_strdup (_tmp2_);
		result = _tmp3_;
		return result;
	}
	result = NULL;
	return result;
}

static void
publishing_piwigo_piwigo_publisher_set_persistent_username (PublishingPiwigoPiwigoPublisher* self,
                                                            const gchar* username)
{
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (username != NULL);
}

gchar*
publishing_piwigo_piwigo_publisher_get_persistent_password (PublishingPiwigoPiwigoPublisher* self,
                                                            const gchar* url,
                                                            const gchar* user)
{
	gboolean _tmp0_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), NULL);
	if (url != NULL) {
		_tmp0_ = user != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		{
			gchar* pw = NULL;
			SecretSchema* _tmp1_;
			SpitPublishingPluginHost* _tmp2_;
			gchar* _tmp3_;
			gchar* _tmp4_;
			gchar* _tmp5_;
			gchar* _tmp6_;
			_tmp1_ = self->priv->schema;
			_tmp2_ = self->priv->host;
			_tmp3_ = spit_publishing_plugin_host_get_current_profile_id (_tmp2_);
			_tmp4_ = _tmp3_;
			_tmp5_ = secret_password_lookup_sync (_tmp1_, NULL, &_inner_error0_, PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_SCHEMA_KEY_PROFILE_ID, _tmp4_, "url", url, "user", user, NULL);
			_tmp6_ = _tmp5_;
			_g_free0 (_tmp4_);
			pw = _tmp6_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			result = pw;
			return result;
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* err = NULL;
			GError* _tmp7_;
			const gchar* _tmp8_;
			err = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp7_ = err;
			_tmp8_ = _tmp7_->message;
			g_critical ("PiwigoPublishing.vala:282: Failed to lookup the password for url %s an" \
"d user %s: %s", url, user, _tmp8_);
			result = NULL;
			_g_error_free0 (err);
			return result;
		}
		__finally0:
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = NULL;
	return result;
}

static void
publishing_piwigo_piwigo_publisher_set_persistent_password (PublishingPiwigoPiwigoPublisher* self,
                                                            const gchar* url,
                                                            const gchar* user,
                                                            const gchar* password)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	{
		if (password == NULL) {
			SecretSchema* _tmp0_;
			SpitPublishingPluginHost* _tmp1_;
			gchar* _tmp2_;
			gchar* _tmp3_;
			_tmp0_ = self->priv->schema;
			_tmp1_ = self->priv->host;
			_tmp2_ = spit_publishing_plugin_host_get_current_profile_id (_tmp1_);
			_tmp3_ = _tmp2_;
			secret_password_clear_sync (_tmp0_, NULL, &_inner_error0_, PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_SCHEMA_KEY_PROFILE_ID, _tmp3_, "url", url, "user", user, NULL);
			_g_free0 (_tmp3_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		} else {
			SecretSchema* _tmp4_;
			gchar* _tmp5_;
			gchar* _tmp6_;
			SpitPublishingPluginHost* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			_tmp4_ = self->priv->schema;
			_tmp5_ = g_strdup_printf ("Shotwell publishing (Piwigo account %s@%s)", user, url);
			_tmp6_ = _tmp5_;
			_tmp7_ = self->priv->host;
			_tmp8_ = spit_publishing_plugin_host_get_current_profile_id (_tmp7_);
			_tmp9_ = _tmp8_;
			secret_password_store_sync (_tmp4_, SECRET_COLLECTION_DEFAULT, _tmp6_, password, NULL, &_inner_error0_, PUBLISHING_PIWIGO_PIWIGO_PUBLISHER_SCHEMA_KEY_PROFILE_ID, _tmp9_, "url", url, "user", user, NULL);
			_g_free0 (_tmp9_);
			_g_free0 (_tmp6_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp10_;
		const gchar* _tmp11_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp10_ = err;
		_tmp11_ = _tmp10_->message;
		g_critical ("PiwigoPublishing.vala:307: Failed to store password for %s@%s: %s", user, url, _tmp11_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

gboolean
publishing_piwigo_piwigo_publisher_get_remember_password (PublishingPiwigoPiwigoPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), FALSE);
	_tmp0_ = self->priv->host;
	result = spit_host_interface_get_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "remember-password", FALSE);
	return result;
}

static void
publishing_piwigo_piwigo_publisher_set_remember_password (PublishingPiwigoPiwigoPublisher* self,
                                                          gboolean remember_password)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	_tmp0_ = self->priv->host;
	spit_host_interface_set_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "remember-password", remember_password);
}

gint
publishing_piwigo_piwigo_publisher_get_last_category (PublishingPiwigoPiwigoPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	gint result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), -1);
	_tmp0_ = self->priv->host;
	result = spit_host_interface_get_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-category", -1);
	return result;
}

static void
publishing_piwigo_piwigo_publisher_set_last_category (PublishingPiwigoPiwigoPublisher* self,
                                                      gint last_category)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	_tmp0_ = self->priv->host;
	spit_host_interface_set_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-category", last_category);
}

gint
publishing_piwigo_piwigo_publisher_get_last_permission_level (PublishingPiwigoPiwigoPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	gint result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), -1);
	_tmp0_ = self->priv->host;
	result = spit_host_interface_get_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-permission-level", -1);
	return result;
}

static void
publishing_piwigo_piwigo_publisher_set_last_permission_level (PublishingPiwigoPiwigoPublisher* self,
                                                              gint last_permission_level)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	_tmp0_ = self->priv->host;
	spit_host_interface_set_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-permission-level", last_permission_level);
}

gint
publishing_piwigo_piwigo_publisher_get_last_photo_size (PublishingPiwigoPiwigoPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	gint result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), -1);
	_tmp0_ = self->priv->host;
	result = spit_host_interface_get_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-photo-size", -1);
	return result;
}

static void
publishing_piwigo_piwigo_publisher_set_last_photo_size (PublishingPiwigoPiwigoPublisher* self,
                                                        gint last_photo_size)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	_tmp0_ = self->priv->host;
	spit_host_interface_set_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-photo-size", last_photo_size);
}

static gboolean
publishing_piwigo_piwigo_publisher_get_last_title_as_comment (PublishingPiwigoPiwigoPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), FALSE);
	_tmp0_ = self->priv->host;
	result = spit_host_interface_get_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-title-as-comment", FALSE);
	return result;
}

static void
publishing_piwigo_piwigo_publisher_set_last_title_as_comment (PublishingPiwigoPiwigoPublisher* self,
                                                              gboolean title_as_comment)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	_tmp0_ = self->priv->host;
	spit_host_interface_set_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-title-as-comment", title_as_comment);
}

static gboolean
publishing_piwigo_piwigo_publisher_get_last_no_upload_tags (PublishingPiwigoPiwigoPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), FALSE);
	_tmp0_ = self->priv->host;
	result = spit_host_interface_get_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-no-upload-tags", FALSE);
	return result;
}

static void
publishing_piwigo_piwigo_publisher_set_last_no_upload_tags (PublishingPiwigoPiwigoPublisher* self,
                                                            gboolean no_upload_tags)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	_tmp0_ = self->priv->host;
	spit_host_interface_set_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-no-upload-tags", no_upload_tags);
}

static gboolean
publishing_piwigo_piwigo_publisher_get_last_no_upload_ratings (PublishingPiwigoPiwigoPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), FALSE);
	_tmp0_ = self->priv->host;
	result = spit_host_interface_get_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-no-upload-ratings", FALSE);
	return result;
}

static void
publishing_piwigo_piwigo_publisher_set_last_no_upload_ratings (PublishingPiwigoPiwigoPublisher* self,
                                                               gboolean no_upload_ratings)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	_tmp0_ = self->priv->host;
	spit_host_interface_set_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-no-upload-ratings", no_upload_ratings);
}

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

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

/**
     * Action that shows the authentication pane.
     *
     * This action method shows the authentication pane. It is shown at the
     * very beginning of the interaction when no persistent parameters are found
     * or after a failed login attempt using persisted parameters. It can be
     * given a mode flag to specify whether it should be displayed in initial
     * mode or in any of the error modes that it supports.
     *
     * @param mode the mode for the authentication pane
     */
static void
_publishing_piwigo_piwigo_publisher_on_authentication_pane_login_clicked_publishing_piwigo_authentication_pane_login (PublishingPiwigoAuthenticationPane* _sender,
                                                                                                                      const gchar* url,
                                                                                                                      const gchar* user,
                                                                                                                      const gchar* password,
                                                                                                                      gboolean remember_password,
                                                                                                                      gpointer self)
{
	publishing_piwigo_piwigo_publisher_on_authentication_pane_login_clicked ((PublishingPiwigoPiwigoPublisher*) self, url, user, password, remember_password);
}

static void
publishing_piwigo_piwigo_publisher_do_show_authentication_pane (PublishingPiwigoPiwigoPublisher* self,
                                                                PublishingPiwigoAuthenticationPaneMode mode)
{
	SpitPublishingPluginHost* _tmp0_;
	PublishingPiwigoAuthenticationPane* authentication_pane = NULL;
	PublishingPiwigoAuthenticationPane* _tmp1_;
	SpitPublishingPluginHost* _tmp2_;
	SpitPublishingPluginHost* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_debug ("PiwigoPublishing.vala:389: ACTION: installing authentication pane");
	_tmp0_ = self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_tmp0_, FALSE);
	_tmp1_ = publishing_piwigo_authentication_pane_new (self, mode);
	authentication_pane = _tmp1_;
	g_signal_connect_object (authentication_pane, "login", (GCallback) _publishing_piwigo_piwigo_publisher_on_authentication_pane_login_clicked_publishing_piwigo_authentication_pane_login, self, 0);
	_tmp2_ = self->priv->host;
	spit_publishing_plugin_host_install_dialog_pane (_tmp2_, G_TYPE_CHECK_INSTANCE_CAST (authentication_pane, SPIT_PUBLISHING_TYPE_DIALOG_PANE, SpitPublishingDialogPane), SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CLOSE);
	_tmp3_ = self->priv->host;
	_tmp4_ = shotwell_plugins_common_builder_pane_get_default_widget (G_TYPE_CHECK_INSTANCE_CAST (authentication_pane, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	_tmp5_ = _tmp4_;
	spit_publishing_plugin_host_set_dialog_default_widget (_tmp3_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (authentication_pane);
}

static void
__lambda7_ (PublishingPiwigoPiwigoPublisher* self)
{
	PublishingPiwigoSession* _tmp0_;
	PublishingPiwigoSession* _tmp1_;
	gchar* persistent_url = NULL;
	gchar* _tmp2_;
	gchar* persistent_username = NULL;
	gchar* _tmp3_;
	gchar* persistent_password = NULL;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	const gchar* _tmp9_;
	g_debug ("PiwigoPublishing.vala:410: SSL: User wants us to retry with broken cer" \
"tificate");
	_tmp0_ = publishing_piwigo_session_new ();
	_publishing_rest_support_session_unref0 (self->priv->session);
	self->priv->session = _tmp0_;
	_tmp1_ = self->priv->session;
	publishing_rest_support_session_set_insecure (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession));
	_tmp2_ = publishing_piwigo_piwigo_publisher_get_persistent_url (self);
	persistent_url = _tmp2_;
	_tmp3_ = publishing_piwigo_piwigo_publisher_get_persistent_username (self);
	persistent_username = _tmp3_;
	_tmp4_ = persistent_url;
	_tmp5_ = persistent_username;
	_tmp6_ = publishing_piwigo_piwigo_publisher_get_persistent_password (self, _tmp4_, _tmp5_);
	persistent_password = _tmp6_;
	_tmp9_ = persistent_url;
	if (_tmp9_ != NULL) {
		const gchar* _tmp10_;
		_tmp10_ = persistent_username;
		_tmp8_ = _tmp10_ != NULL;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		const gchar* _tmp11_;
		_tmp11_ = persistent_password;
		_tmp7_ = _tmp11_ != NULL;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		_tmp12_ = persistent_url;
		_tmp13_ = persistent_username;
		_tmp14_ = persistent_password;
		publishing_piwigo_piwigo_publisher_do_network_login (self, _tmp12_, _tmp13_, _tmp14_, publishing_piwigo_piwigo_publisher_get_remember_password (self), NULL, NULL);
	} else {
		publishing_piwigo_piwigo_publisher_do_show_authentication_pane (self, PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_INTRO);
	}
	_g_free0 (persistent_password);
	_g_free0 (persistent_username);
	_g_free0 (persistent_url);
}

static void
___lambda7__publishing_piwigo_ssl_error_pane_proceed (PublishingPiwigoSSLErrorPane* _sender,
                                                      gpointer self)
{
	__lambda7_ ((PublishingPiwigoPiwigoPublisher*) self);
}

static void
publishing_piwigo_piwigo_publisher_do_show_ssl_downgrade_pane (PublishingPiwigoPiwigoPublisher* self,
                                                               PublishingPiwigoSessionLoginTransaction* trans,
                                                               const gchar* url)
{
	gchar* host_name = NULL;
	gchar* _tmp0_;
	SpitPublishingPluginHost* _tmp7_;
	PublishingPiwigoSSLErrorPane* ssl_pane = NULL;
	const gchar* _tmp8_;
	PublishingPiwigoSSLErrorPane* _tmp9_;
	SpitPublishingPluginHost* _tmp10_;
	SpitPublishingPluginHost* _tmp11_;
	GtkWidget* _tmp12_;
	GtkWidget* _tmp13_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (PUBLISHING_PIWIGO_IS_SESSION_LOGIN_TRANSACTION (trans));
	g_return_if_fail (url != NULL);
	_tmp0_ = g_strdup ("");
	host_name = _tmp0_;
	{
		GUri* _tmp1_ = NULL;
		GUri* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = g_uri_parse (url, G_URI_FLAGS_NONE, &_inner_error0_);
		_tmp1_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = g_uri_get_host (_tmp1_);
		_tmp4_ = g_strdup (_tmp3_);
		_g_free0 (host_name);
		host_name = _tmp4_;
		_g_uri_unref0 (_tmp1_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = err;
		_tmp6_ = _tmp5_->message;
		g_debug ("PiwigoPublishing.vala:405: Failed to parse URL: %s", _tmp6_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (host_name);
		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->host;
	spit_publishing_plugin_host_set_service_locked (_tmp7_, FALSE);
	_tmp8_ = host_name;
	_tmp9_ = publishing_piwigo_ssl_error_pane_new (trans, _tmp8_);
	ssl_pane = _tmp9_;
	g_signal_connect_object (ssl_pane, "proceed", (GCallback) ___lambda7__publishing_piwigo_ssl_error_pane_proceed, self, 0);
	_tmp10_ = self->priv->host;
	spit_publishing_plugin_host_install_dialog_pane (_tmp10_, G_TYPE_CHECK_INSTANCE_CAST (ssl_pane, SPIT_PUBLISHING_TYPE_DIALOG_PANE, SpitPublishingDialogPane), SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CLOSE);
	_tmp11_ = self->priv->host;
	_tmp12_ = shotwell_plugins_common_builder_pane_get_default_widget (G_TYPE_CHECK_INSTANCE_CAST (ssl_pane, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	_tmp13_ = _tmp12_;
	spit_publishing_plugin_host_set_dialog_default_widget (_tmp11_, _tmp13_);
	_g_object_unref0 (_tmp13_);
	_g_object_unref0 (ssl_pane);
	_g_free0 (host_name);
}

/**
     * Event triggered when the login button in the authentication panel is
     * clicked.
     *
     * This event is triggered when the login button in the authentication
     * panel is clicked. It then triggers a network login interaction.
     *
     * @param url the URL of the Piwigo service as entered in the dialog
     * @param username the name of the Piwigo user as entered in the dialog
     * @param password the password of the Piwigo as entered in the dialog
     */
static void
publishing_piwigo_piwigo_publisher_on_authentication_pane_login_clicked (PublishingPiwigoPiwigoPublisher* self,
                                                                         const gchar* url,
                                                                         const gchar* username,
                                                                         const gchar* password,
                                                                         gboolean remember_password)
{
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (url != NULL);
	g_return_if_fail (username != NULL);
	g_return_if_fail (password != NULL);
	g_debug ("PiwigoPublishing.vala:442: EVENT: on_authentication_pane_login_clicked");
	if (!self->priv->running) {
		return;
	}
	publishing_piwigo_piwigo_publisher_do_network_login (self, url, username, password, remember_password, NULL, NULL);
}

static void
publishing_piwigo_piwigo_publisher_do_network_login_data_free (gpointer _data)
{
	PublishingPiwigoPiwigoPublisherDoNetworkLoginData* _data_;
	_data_ = _data;
	_g_free0 (_data_->url);
	_g_free0 (_data_->username);
	_g_free0 (_data_->password);
	_g_object_unref0 (_data_->self);
	g_slice_free (PublishingPiwigoPiwigoPublisherDoNetworkLoginData, _data_);
}

static void
publishing_piwigo_piwigo_publisher_do_network_login (PublishingPiwigoPiwigoPublisher* self,
                                                     const gchar* url,
                                                     const gchar* username,
                                                     const gchar* password,
                                                     gboolean remember_password,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherDoNetworkLoginData* _data_;
	PublishingPiwigoPiwigoPublisher* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (url != NULL);
	g_return_if_fail (username != NULL);
	g_return_if_fail (password != NULL);
	_data_ = g_slice_new0 (PublishingPiwigoPiwigoPublisherDoNetworkLoginData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_piwigo_piwigo_publisher_do_network_login_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (url);
	_g_free0 (_data_->url);
	_data_->url = _tmp1_;
	_tmp2_ = g_strdup (username);
	_g_free0 (_data_->username);
	_data_->username = _tmp2_;
	_tmp3_ = g_strdup (password);
	_g_free0 (_data_->password);
	_data_->password = _tmp3_;
	_data_->remember_password = remember_password;
	publishing_piwigo_piwigo_publisher_do_network_login_co (_data_);
}

static void
publishing_piwigo_piwigo_publisher_do_network_login_finish (PublishingPiwigoPiwigoPublisher* self,
                                                            GAsyncResult* _res_)
{
	PublishingPiwigoPiwigoPublisherDoNetworkLoginData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

/**
     * Action to perform a network login to a Piwigo service.
     *
     * This action performs a network login a Piwigo service specified by a
     * URL and using the given user name and password as credentials.
     *
     * @param url the URL of the Piwigo service; this URL will be normalised
     *     before being used
     * @param username the name of the Piwigo user used to login
     * @param password the password of the Piwigo user used to login
     */
static void
publishing_piwigo_piwigo_publisher_do_network_login_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherDoNetworkLoginData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_piwigo_piwigo_publisher_do_network_login_co (_data_);
}

static gboolean
publishing_piwigo_piwigo_publisher_do_network_login_co (PublishingPiwigoPiwigoPublisherDoNetworkLoginData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("PiwigoPublishing.vala:461: ACTION: logging in");
	_data_->_tmp0_ = _data_->self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp0_, TRUE);
	_data_->_tmp1_ = _data_->self->priv->host;
	spit_publishing_plugin_host_install_login_wait_pane (_data_->_tmp1_);
	publishing_piwigo_piwigo_publisher_set_remember_password (_data_->self, _data_->remember_password);
	if (_data_->remember_password) {
		publishing_piwigo_piwigo_publisher_set_persistent_password (_data_->self, _data_->url, _data_->username, _data_->password);
	} else {
		publishing_piwigo_piwigo_publisher_set_persistent_password (_data_->self, _data_->url, _data_->username, NULL);
	}
	_data_->_tmp2_ = _data_->self->priv->session;
	_data_->_tmp3_ = publishing_piwigo_piwigo_publisher_normalise_url (_data_->url);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = publishing_piwigo_session_login_transaction_new (_data_->_tmp2_, _data_->_tmp4_, _data_->username, _data_->password);
	_data_->_tmp6_ = _data_->_tmp5_;
	_g_free0 (_data_->_tmp4_);
	_data_->login_trans = _data_->_tmp6_;
	{
		_data_->_state_ = 1;
		publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->login_trans, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_piwigo_piwigo_publisher_do_network_login_ready, _data_);
		return FALSE;
		_state_1:
		publishing_rest_support_transaction_execute_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->login_trans, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			_publishing_rest_support_transaction_unref0 (_data_->login_trans);
			g_critical ("file %s: line %d: unexpected 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_piwigo_piwigo_publisher_on_login_network_complete (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->login_trans, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp7_ = _data_->err;
		if (g_error_matches (_data_->_tmp7_, SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_SSL_FAILED)) {
			g_debug ("PiwigoPublishing.vala:480: ERROR: SSL connection problems");
			publishing_piwigo_piwigo_publisher_do_show_ssl_downgrade_pane (_data_->self, _data_->login_trans, _data_->url);
		} else {
			g_debug ("PiwigoPublishing.vala:483: ERROR: do_network_login");
			_data_->_tmp8_ = _data_->err;
			publishing_piwigo_piwigo_publisher_do_show_error (_data_->self, _data_->_tmp8_);
		}
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_publishing_rest_support_transaction_unref0 (_data_->login_trans);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_publishing_rest_support_transaction_unref0 (_data_->login_trans);
	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;
}

gchar*
publishing_piwigo_piwigo_publisher_normalise_url (const gchar* url)
{
	gchar* norm_url = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp7_ = FALSE;
	const gchar* _tmp8_;
	gchar* result;
	g_return_val_if_fail (url != NULL, NULL);
	_tmp0_ = g_strdup (url);
	norm_url = _tmp0_;
	_tmp1_ = norm_url;
	if (!g_str_has_suffix (_tmp1_, ".php")) {
		const gchar* _tmp2_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp2_ = norm_url;
		if (!g_str_has_suffix (_tmp2_, "/")) {
			const gchar* _tmp3_;
			gchar* _tmp4_;
			_tmp3_ = norm_url;
			_tmp4_ = g_strconcat (_tmp3_, "/", NULL);
			_g_free0 (norm_url);
			norm_url = _tmp4_;
		}
		_tmp5_ = norm_url;
		_tmp6_ = g_strconcat (_tmp5_, PUBLISHING_PIWIGO_PIWIGO_WS, NULL);
		_g_free0 (norm_url);
		norm_url = _tmp6_;
	}
	_tmp8_ = norm_url;
	if (!g_str_has_prefix (_tmp8_, "http://")) {
		const gchar* _tmp9_;
		_tmp9_ = norm_url;
		_tmp7_ = !g_str_has_prefix (_tmp9_, "https://");
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		const gchar* _tmp10_;
		gchar* _tmp11_;
		_tmp10_ = norm_url;
		_tmp11_ = g_strconcat ("http://", _tmp10_, NULL);
		_g_free0 (norm_url);
		norm_url = _tmp11_;
	}
	result = norm_url;
	return result;
}

/**
     * Event triggered when the network login action is complete and successful.
     *
     * This event is triggered on successful completion of a network login.
     * Calling this event implies that the URL, user name and password provided
     * in the authentication pane are valid and that the transaction should
     * contain a Set-Cookie header that includes the value pwg_id for that
     * user. As a result, this event will also authenticate the session and
     * persist all values so that they can be re-used during the next publishing
     * interaction.
     *
     * @param txn the received REST transaction
     */
static gchar*
_publishing_piwigo_transaction_validate_xml_publishing_rest_support_xml_document_check_for_error_response (PublishingRESTSupportXmlDocument* doc,
                                                                                                           gpointer self)
{
	gchar* result;
	result = publishing_piwigo_transaction_validate_xml (doc);
	return result;
}

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

static void
publishing_piwigo_piwigo_publisher_on_login_network_complete (PublishingPiwigoPiwigoPublisher* self,
                                                              PublishingRESTSupportTransaction* txn)
{
	gchar* endpoint_url = NULL;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* pwg_id = NULL;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	PublishingPiwigoSession* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION));
	g_debug ("PiwigoPublishing.vala:520: EVENT: on_login_network_complete");
	{
		gchar* _tmp0_;
		gchar* _tmp1_;
		PublishingRESTSupportXmlDocument* _tmp2_;
		PublishingRESTSupportXmlDocument* _tmp3_;
		_tmp0_ = publishing_rest_support_transaction_get_response (txn);
		_tmp1_ = _tmp0_;
		_tmp2_ = publishing_rest_support_xml_document_parse_string (_tmp1_, _publishing_piwigo_transaction_validate_xml_publishing_rest_support_xml_document_check_for_error_response, NULL, &_inner_error0_);
		_tmp3_ = _tmp2_;
		_publishing_rest_support_xml_document_unref0 (_tmp3_);
		_g_free0 (_tmp1_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		GError* err = NULL;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		{
			gchar* _tmp4_;
			gchar* _tmp5_;
			PublishingRESTSupportXmlDocument* _tmp6_;
			PublishingRESTSupportXmlDocument* _tmp7_;
			_tmp4_ = publishing_rest_support_transaction_get_response (txn);
			_tmp5_ = _tmp4_;
			_tmp6_ = publishing_rest_support_xml_document_parse_string (_tmp5_, _publishing_piwigo_transaction_get_error_code_publishing_rest_support_xml_document_check_for_error_response, NULL, &_inner_error0_);
			_tmp7_ = _tmp6_;
			_publishing_rest_support_xml_document_unref0 (_tmp7_);
			_g_free0 (_tmp5_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
					goto __catch1_spit_publishing_publishing_error;
				}
				_g_error_free0 (err);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
		goto __finally1;
		__catch1_spit_publishing_publishing_error:
		{
			GError* code = NULL;
			gint code_int = 0;
			GError* _tmp8_;
			const gchar* _tmp9_;
			code = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp8_ = code;
			_tmp9_ = _tmp8_->message;
			code_int = atoi (_tmp9_);
			if (code_int == 999) {
				g_debug ("PiwigoPublishing.vala:533: ERROR: on_login_network_complete, code 999");
				publishing_piwigo_piwigo_publisher_do_show_authentication_pane (self, PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_FAILED_RETRY_USER);
			} else {
				GError* _tmp10_;
				g_debug ("PiwigoPublishing.vala:536: ERROR: on_login_network_complete");
				_tmp10_ = err;
				publishing_piwigo_piwigo_publisher_do_show_error (self, _tmp10_);
			}
			_g_error_free0 (code);
		}
		__finally1:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_error_free0 (err);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_g_error_free0 (err);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp11_ = publishing_rest_support_transaction_get_endpoint_url (txn);
	endpoint_url = _tmp11_;
	_tmp12_ = endpoint_url;
	g_debug ("PiwigoPublishing.vala:544: Setting endpoint URL to %s", _tmp12_);
	_tmp13_ = publishing_piwigo_piwigo_publisher_get_pwg_id_from_transaction (self, txn);
	pwg_id = _tmp13_;
	_tmp14_ = pwg_id;
	g_debug ("PiwigoPublishing.vala:546: Setting session pwg_id to %s", _tmp14_);
	_tmp15_ = self->priv->session;
	_tmp16_ = pwg_id;
	publishing_piwigo_session_set_pwg_id (_tmp15_, _tmp16_);
	_tmp17_ = endpoint_url;
	_tmp18_ = pwg_id;
	publishing_piwigo_piwigo_publisher_do_fetch_session_status (self, _tmp17_, _tmp18_, NULL, NULL);
	_g_free0 (pwg_id);
	_g_free0 (endpoint_url);
}

static void
publishing_piwigo_piwigo_publisher_do_fetch_session_status_data_free (gpointer _data)
{
	PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData* _data_;
	_data_ = _data;
	_g_free0 (_data_->url);
	_g_free0 (_data_->pwg_id);
	_g_object_unref0 (_data_->self);
	g_slice_free (PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData, _data_);
}

static void
publishing_piwigo_piwigo_publisher_do_fetch_session_status (PublishingPiwigoPiwigoPublisher* self,
                                                            const gchar* url,
                                                            const gchar* pwg_id,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData* _data_;
	PublishingPiwigoPiwigoPublisher* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (url != NULL);
	g_return_if_fail (pwg_id != NULL);
	_data_ = g_slice_new0 (PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_piwigo_piwigo_publisher_do_fetch_session_status_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (url);
	_g_free0 (_data_->url);
	_data_->url = _tmp1_;
	_tmp2_ = g_strdup (pwg_id);
	_g_free0 (_data_->pwg_id);
	_data_->pwg_id = _tmp2_;
	publishing_piwigo_piwigo_publisher_do_fetch_session_status_co (_data_);
}

static void
publishing_piwigo_piwigo_publisher_do_fetch_session_status_finish (PublishingPiwigoPiwigoPublisher* self,
                                                                   GAsyncResult* _res_)
{
	PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

/**
     * Action to fetch the session status for a known Piwigo user.
     *
     * This action fetches the session status for a Piwigo user for whom the
     * pwg_id is known. If triggered after a network login, it should just
     * confirm that the session is OK. It can also be triggered as the first
     * action of the interaction for users for who the pwg_id was previously
     * persisted. In this case, it will log the user in and confirm the
     * identity.
     */
static void
publishing_piwigo_piwigo_publisher_do_fetch_session_status_ready (GObject* source_object,
                                                                  GAsyncResult* _res_,
                                                                  gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_piwigo_piwigo_publisher_do_fetch_session_status_co (_data_);
}

static gboolean
publishing_piwigo_piwigo_publisher_do_fetch_session_status_co (PublishingPiwigoPiwigoPublisherDoFetchSessionStatusData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("PiwigoPublishing.vala:563: ACTION: fetching session status");
	_data_->_tmp0_ = _data_->self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp0_, TRUE);
	_data_->_tmp1_ = _data_->self->priv->host;
	spit_publishing_plugin_host_install_account_fetch_wait_pane (_data_->_tmp1_);
	_data_->_tmp2_ = _data_->self->priv->session;
	if (!publishing_rest_support_session_is_authenticated (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp2_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession))) {
		_data_->_tmp3_ = _data_->self->priv->session;
		_data_->_tmp4_ = publishing_piwigo_session_get_status_transaction_new_unauthenticated (_data_->_tmp3_, _data_->url, _data_->pwg_id);
		_data_->status_txn = _data_->_tmp4_;
		{
			_data_->_tmp5_ = _data_->status_txn;
			_data_->_state_ = 1;
			publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_piwigo_piwigo_publisher_do_fetch_session_status_ready, _data_);
			return FALSE;
			_state_1:
			publishing_rest_support_transaction_execute_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
					goto __catch0_spit_publishing_publishing_error;
				}
				_publishing_rest_support_transaction_unref0 (_data_->status_txn);
				g_critical ("file %s: line %d: unexpected 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;
			}
			_data_->_tmp6_ = _data_->status_txn;
			publishing_piwigo_piwigo_publisher_on_session_get_status_complete (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp6_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
		}
		goto __finally0;
		__catch0_spit_publishing_publishing_error:
		{
			_data_->err = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			g_debug ("PiwigoPublishing.vala:574: ERROR: do_fetch_session_status, not authent" \
"icated");
			_data_->_tmp7_ = _data_->err;
			publishing_piwigo_piwigo_publisher_do_show_error (_data_->self, _data_->_tmp7_);
			_g_error_free0 (_data_->err);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_publishing_rest_support_transaction_unref0 (_data_->status_txn);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_publishing_rest_support_transaction_unref0 (_data_->status_txn);
	} else {
		_data_->_tmp8_ = _data_->self->priv->session;
		_data_->_tmp9_ = publishing_piwigo_session_get_status_transaction_new (_data_->_tmp8_);
		_data_->_vala1_status_txn = _data_->_tmp9_;
		{
			_data_->_tmp10_ = _data_->_vala1_status_txn;
			_data_->_state_ = 2;
			publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_piwigo_piwigo_publisher_do_fetch_session_status_ready, _data_);
			return FALSE;
			_state_2:
			publishing_rest_support_transaction_execute_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
					goto __catch1_spit_publishing_publishing_error;
				}
				_publishing_rest_support_transaction_unref0 (_data_->_vala1_status_txn);
				g_critical ("file %s: line %d: unexpected 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;
			}
			_data_->_tmp11_ = _data_->_vala1_status_txn;
			publishing_piwigo_piwigo_publisher_on_session_get_status_complete (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
		}
		goto __finally1;
		__catch1_spit_publishing_publishing_error:
		{
			_data_->_vala1_err = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			g_debug ("PiwigoPublishing.vala:584: ERROR: do_fetch_session_status, authenticat" \
"ed");
			_data_->_tmp12_ = _data_->_vala1_err;
			publishing_piwigo_piwigo_publisher_do_show_error (_data_->self, _data_->_tmp12_);
			_g_error_free0 (_data_->_vala1_err);
		}
		__finally1:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_publishing_rest_support_transaction_unref0 (_data_->_vala1_status_txn);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_publishing_rest_support_transaction_unref0 (_data_->_vala1_status_txn);
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

/**
     * Event triggered when the get session status action completes successfully.
     *
     * This event being triggered confirms that the session is valid and can becyclonic enema
     * used. If the session is not fully authenticated yet, this event finalises
     * session authentication. It then triggers the fetch categories action.
     */
static void
publishing_piwigo_piwigo_publisher_on_session_get_status_complete (PublishingPiwigoPiwigoPublisher* self,
                                                                   PublishingRESTSupportTransaction* txn)
{
	PublishingPiwigoSession* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION));
	g_debug ("PiwigoPublishing.vala:598: EVENT: on_session_get_status_complete");
	_tmp0_ = self->priv->session;
	if (!publishing_rest_support_session_is_authenticated (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession))) {
		gchar* endpoint_url = NULL;
		gchar* _tmp1_;
		gchar* pwg_id = NULL;
		PublishingPiwigoSession* _tmp2_;
		gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp1_ = publishing_rest_support_transaction_get_endpoint_url (txn);
		endpoint_url = _tmp1_;
		_tmp2_ = self->priv->session;
		_tmp3_ = publishing_piwigo_session_get_pwg_id (_tmp2_);
		pwg_id = _tmp3_;
		_tmp4_ = pwg_id;
		g_debug ("PiwigoPublishing.vala:603: Fetching session status for pwg_id %s", _tmp4_);
		{
			PublishingRESTSupportXmlDocument* doc = NULL;
			gchar* _tmp5_;
			gchar* _tmp6_;
			PublishingRESTSupportXmlDocument* _tmp7_;
			PublishingRESTSupportXmlDocument* _tmp8_;
			xmlNode* root = NULL;
			PublishingRESTSupportXmlDocument* _tmp9_;
			xmlNode* _tmp10_;
			xmlNode* username_node = NULL;
			_tmp5_ = publishing_rest_support_transaction_get_response (txn);
			_tmp6_ = _tmp5_;
			_tmp7_ = publishing_rest_support_xml_document_parse_string (_tmp6_, _publishing_piwigo_transaction_validate_xml_publishing_rest_support_xml_document_check_for_error_response, NULL, &_inner_error0_);
			_tmp8_ = _tmp7_;
			_g_free0 (_tmp6_);
			doc = _tmp8_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
					goto __catch0_spit_publishing_publishing_error;
				}
				_g_free0 (pwg_id);
				_g_free0 (endpoint_url);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
			_tmp9_ = doc;
			_tmp10_ = publishing_rest_support_xml_document_get_root_node (_tmp9_);
			root = _tmp10_;
			{
				xmlNode* _tmp11_ = NULL;
				PublishingRESTSupportXmlDocument* _tmp12_;
				xmlNode* _tmp13_;
				xmlNode* _tmp14_;
				gchar* username = NULL;
				xmlNode* _tmp15_;
				gchar* _tmp16_;
				const gchar* _tmp17_;
				PublishingPiwigoSession* _tmp18_;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				const gchar* _tmp21_;
				PublishingPiwigoSession* _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				PublishingPiwigoSession* _tmp25_;
				gchar* _tmp26_;
				gchar* _tmp27_;
				_tmp12_ = doc;
				_tmp13_ = root;
				_tmp14_ = publishing_rest_support_xml_document_get_named_child (_tmp12_, _tmp13_, "username", &_inner_error0_);
				_tmp11_ = _tmp14_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
						goto __catch1_spit_publishing_publishing_error;
					}
					_publishing_rest_support_xml_document_unref0 (doc);
					_g_free0 (pwg_id);
					_g_free0 (endpoint_url);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
				username_node = _tmp11_;
				_tmp15_ = username_node;
				_tmp16_ = (gchar*) xmlNodeGetContent (_tmp15_);
				username = _tmp16_;
				_tmp17_ = username;
				g_debug ("PiwigoPublishing.vala:614: Returned username is %s", _tmp17_);
				_tmp18_ = self->priv->session;
				_tmp19_ = endpoint_url;
				_tmp20_ = username;
				_tmp21_ = pwg_id;
				publishing_piwigo_session_authenticate (_tmp18_, _tmp19_, _tmp20_, _tmp21_);
				_tmp22_ = self->priv->session;
				_tmp23_ = publishing_piwigo_session_get_pwg_url (_tmp22_);
				_tmp24_ = _tmp23_;
				publishing_piwigo_piwigo_publisher_set_persistent_url (self, _tmp24_);
				_g_free0 (_tmp24_);
				_tmp25_ = self->priv->session;
				_tmp26_ = publishing_piwigo_session_get_username (_tmp25_);
				_tmp27_ = _tmp26_;
				publishing_piwigo_piwigo_publisher_set_persistent_username (self, _tmp27_);
				_g_free0 (_tmp27_);
				publishing_piwigo_piwigo_publisher_do_fetch_categories (self, NULL, NULL);
				_g_free0 (username);
			}
			goto __finally1;
			__catch1_spit_publishing_publishing_error:
			{
				GError* err2 = NULL;
				GError* _tmp28_;
				err2 = _inner_error0_;
				_inner_error0_ = NULL;
				g_debug ("PiwigoPublishing.vala:620: ERROR: on_session_get_status_complete, inne" \
"r");
				_tmp28_ = err2;
				publishing_piwigo_piwigo_publisher_do_show_error (self, _tmp28_);
				_g_error_free0 (err2);
				_publishing_rest_support_xml_document_unref0 (doc);
				_g_free0 (pwg_id);
				_g_free0 (endpoint_url);
				return;
			}
			__finally1:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_publishing_rest_support_xml_document_unref0 (doc);
				if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
					goto __catch0_spit_publishing_publishing_error;
				}
				_g_free0 (pwg_id);
				_g_free0 (endpoint_url);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
			_publishing_rest_support_xml_document_unref0 (doc);
		}
		goto __finally0;
		__catch0_spit_publishing_publishing_error:
		{
			GError* err = NULL;
			GError* _tmp29_;
			err = _inner_error0_;
			_inner_error0_ = NULL;
			g_debug ("PiwigoPublishing.vala:625: ERROR: on_session_get_status_complete, oute" \
"r");
			_tmp29_ = err;
			publishing_piwigo_piwigo_publisher_do_show_error (self, _tmp29_);
			_g_error_free0 (err);
			_g_free0 (pwg_id);
			_g_free0 (endpoint_url);
			return;
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (pwg_id);
			_g_free0 (endpoint_url);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_g_free0 (pwg_id);
		_g_free0 (endpoint_url);
	} else {
		publishing_piwigo_piwigo_publisher_do_fetch_categories (self, NULL, NULL);
	}
}

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

static void
publishing_piwigo_piwigo_publisher_do_fetch_categories (PublishingPiwigoPiwigoPublisher* self,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherDoFetchCategoriesData* _data_;
	PublishingPiwigoPiwigoPublisher* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	_data_ = g_slice_new0 (PublishingPiwigoPiwigoPublisherDoFetchCategoriesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_piwigo_piwigo_publisher_do_fetch_categories_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	publishing_piwigo_piwigo_publisher_do_fetch_categories_co (_data_);
}

static void
publishing_piwigo_piwigo_publisher_do_fetch_categories_finish (PublishingPiwigoPiwigoPublisher* self,
                                                               GAsyncResult* _res_)
{
	PublishingPiwigoPiwigoPublisherDoFetchCategoriesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

/**
     * Action that fetches all available categories from the Piwigo service.
     *
     * This action fetches all categories from the Piwigo service in order
     * to populate the publishing pane presented to the user.
     */
static void
publishing_piwigo_piwigo_publisher_do_fetch_categories_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherDoFetchCategoriesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_piwigo_piwigo_publisher_do_fetch_categories_co (_data_);
}

static gboolean
publishing_piwigo_piwigo_publisher_do_fetch_categories_co (PublishingPiwigoPiwigoPublisherDoFetchCategoriesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("PiwigoPublishing.vala:644: ACTION: fetching categories");
	_data_->_tmp0_ = _data_->self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp0_, TRUE);
	_data_->_tmp1_ = _data_->self->priv->host;
	spit_publishing_plugin_host_install_account_fetch_wait_pane (_data_->_tmp1_);
	_data_->_tmp2_ = _data_->self->priv->session;
	_data_->_tmp3_ = publishing_piwigo_categories_get_list_transaction_new (_data_->_tmp2_);
	_data_->cat_trans = _data_->_tmp3_;
	{
		_data_->_tmp4_ = _data_->cat_trans;
		_data_->_state_ = 1;
		publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp4_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_piwigo_piwigo_publisher_do_fetch_categories_ready, _data_);
		return FALSE;
		_state_1:
		publishing_rest_support_transaction_execute_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp4_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			_publishing_rest_support_transaction_unref0 (_data_->cat_trans);
			g_critical ("file %s: line %d: unexpected 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;
		}
		_data_->_tmp5_ = _data_->cat_trans;
		publishing_piwigo_piwigo_publisher_on_category_fetch_complete (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		g_debug ("PiwigoPublishing.vala:654: ERROR: do_fetch_categories");
		_data_->_tmp6_ = _data_->err;
		publishing_piwigo_piwigo_publisher_do_show_error (_data_->self, _data_->_tmp6_);
		_g_error_free0 (_data_->err);
		_publishing_rest_support_transaction_unref0 (_data_->cat_trans);
		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;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_publishing_rest_support_transaction_unref0 (_data_->cat_trans);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_publishing_rest_support_transaction_unref0 (_data_->cat_trans);
	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;
}

/**
     * Event triggered when the fetch categories action completes successfully.
     *
     * This event retrieves all categories from the received transaction and
     * populates the categories list. It then triggers the display of the
     * publishing options pane.
     */
static void
_vala_array_add24 (PublishingPiwigoCategory** * array,
                   gint* length,
                   gint* size,
                   PublishingPiwigoCategory* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingPiwigoCategory*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
publishing_piwigo_piwigo_publisher_on_category_fetch_complete (PublishingPiwigoPiwigoPublisher* self,
                                                               PublishingRESTSupportTransaction* txn)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	PublishingPiwigoCategory** _tmp2_;
	gint _tmp2__length1;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION));
	g_debug ("PiwigoPublishing.vala:668: EVENT: on_category_fetch_complete");
	_tmp0_ = publishing_rest_support_transaction_get_response (txn);
	_tmp1_ = _tmp0_;
	g_debug ("PiwigoPublishing.vala:669: PiwigoConnector: list of categories: %s", _tmp1_);
	_g_free0 (_tmp1_);
	_tmp2_ = self->priv->categories;
	_tmp2__length1 = self->priv->categories_length1;
	if (_tmp2_ != NULL) {
		self->priv->categories = (_vala_array_free (self->priv->categories, self->priv->categories_length1, (GDestroyNotify) publishing_piwigo_category_unref), NULL);
		self->priv->categories = NULL;
		self->priv->categories_length1 = 0;
		self->priv->_categories_size_ = self->priv->categories_length1;
	}
	{
		PublishingRESTSupportXmlDocument* doc = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		PublishingRESTSupportXmlDocument* _tmp5_;
		PublishingRESTSupportXmlDocument* _tmp6_;
		xmlNode* root = NULL;
		PublishingRESTSupportXmlDocument* _tmp7_;
		xmlNode* _tmp8_;
		xmlNode* categories_node = NULL;
		xmlNode* _tmp9_;
		xmlNode* _tmp10_;
		xmlNode* category_node_iter = NULL;
		xmlNode* _tmp11_;
		xmlNode* _tmp12_;
		xmlNode* name_node = NULL;
		xmlNode* uppercats_node = NULL;
		gchar* name = NULL;
		gchar* _tmp13_;
		gchar* id_string = NULL;
		gchar* _tmp14_;
		gchar* uppercats = NULL;
		gchar* _tmp15_;
		GeeHashMap* id_map = NULL;
		GeeHashMap* _tmp16_;
		_tmp3_ = publishing_rest_support_transaction_get_response (txn);
		_tmp4_ = _tmp3_;
		_tmp5_ = publishing_rest_support_xml_document_parse_string (_tmp4_, _publishing_piwigo_transaction_validate_xml_publishing_rest_support_xml_document_check_for_error_response, NULL, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		doc = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp7_ = doc;
		_tmp8_ = publishing_rest_support_xml_document_get_root_node (_tmp7_);
		root = _tmp8_;
		_tmp9_ = root;
		_tmp10_ = xmlFirstElementChild (_tmp9_);
		categories_node = _tmp10_;
		_tmp11_ = categories_node;
		_tmp12_ = _tmp11_->children;
		category_node_iter = _tmp12_;
		_tmp13_ = g_strdup ("");
		name = _tmp13_;
		_tmp14_ = g_strdup ("");
		id_string = _tmp14_;
		_tmp15_ = g_strdup ("");
		uppercats = _tmp15_;
		_tmp16_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
		id_map = _tmp16_;
		{
			gboolean _tmp17_ = FALSE;
			_tmp17_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp20_;
				xmlNode* _tmp21_ = NULL;
				PublishingRESTSupportXmlDocument* _tmp22_;
				xmlNode* _tmp23_;
				xmlNode* _tmp24_;
				xmlNode* _tmp25_;
				gchar* _tmp26_;
				xmlNode* _tmp27_ = NULL;
				PublishingRESTSupportXmlDocument* _tmp28_;
				xmlNode* _tmp29_;
				xmlNode* _tmp30_;
				xmlNode* _tmp31_;
				gchar* _tmp32_;
				xmlNode* _tmp33_;
				gchar* _tmp34_;
				GeeHashMap* _tmp35_;
				const gchar* _tmp36_;
				const gchar* _tmp37_;
				PublishingPiwigoCategory** _tmp38_;
				gint _tmp38__length1;
				const gchar* _tmp40_;
				const gchar* _tmp41_;
				const gchar* _tmp42_;
				PublishingPiwigoCategory* _tmp43_;
				if (!_tmp17_) {
					xmlNode* _tmp18_;
					xmlNode* _tmp19_;
					_tmp18_ = category_node_iter;
					_tmp19_ = _tmp18_->next;
					category_node_iter = _tmp19_;
				}
				_tmp17_ = FALSE;
				_tmp20_ = category_node_iter;
				if (!(_tmp20_ != NULL)) {
					break;
				}
				_tmp22_ = doc;
				_tmp23_ = category_node_iter;
				_tmp24_ = publishing_rest_support_xml_document_get_named_child (_tmp22_, _tmp23_, "name", &_inner_error0_);
				_tmp21_ = _tmp24_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (id_map);
					_g_free0 (uppercats);
					_g_free0 (id_string);
					_g_free0 (name);
					_publishing_rest_support_xml_document_unref0 (doc);
					if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
						goto __catch0_spit_publishing_publishing_error;
					}
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
				name_node = _tmp21_;
				_tmp25_ = name_node;
				_tmp26_ = (gchar*) xmlNodeGetContent (_tmp25_);
				_g_free0 (name);
				name = _tmp26_;
				_tmp28_ = doc;
				_tmp29_ = category_node_iter;
				_tmp30_ = publishing_rest_support_xml_document_get_named_child (_tmp28_, _tmp29_, "uppercats", &_inner_error0_);
				_tmp27_ = _tmp30_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (id_map);
					_g_free0 (uppercats);
					_g_free0 (id_string);
					_g_free0 (name);
					_publishing_rest_support_xml_document_unref0 (doc);
					if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
						goto __catch0_spit_publishing_publishing_error;
					}
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
				uppercats_node = _tmp27_;
				_tmp31_ = uppercats_node;
				_tmp32_ = (gchar*) xmlNodeGetContent (_tmp31_);
				_g_free0 (uppercats);
				uppercats = (gchar*) _tmp32_;
				_tmp33_ = category_node_iter;
				_tmp34_ = (gchar*) xmlGetProp (_tmp33_, (xmlChar*) "id");
				_g_free0 (id_string);
				id_string = _tmp34_;
				_tmp35_ = id_map;
				_tmp36_ = id_string;
				_tmp37_ = name;
				gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp36_, _tmp37_);
				_tmp38_ = self->priv->categories;
				_tmp38__length1 = self->priv->categories_length1;
				if (_tmp38_ == NULL) {
					PublishingPiwigoCategory** _tmp39_;
					_tmp39_ = g_new0 (PublishingPiwigoCategory*, 0 + 1);
					self->priv->categories = (_vala_array_free (self->priv->categories, self->priv->categories_length1, (GDestroyNotify) publishing_piwigo_category_unref), NULL);
					self->priv->categories = _tmp39_;
					self->priv->categories_length1 = 0;
					self->priv->_categories_size_ = self->priv->categories_length1;
				}
				_tmp40_ = id_string;
				_tmp41_ = name;
				_tmp42_ = uppercats;
				_tmp43_ = publishing_piwigo_category_new (atoi (_tmp40_), _tmp41_, _tmp42_, "");
				_vala_array_add24 (&self->priv->categories, &self->priv->categories_length1, &self->priv->_categories_size_, _tmp43_);
			}
		}
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp44_ = FALSE;
				_tmp44_ = TRUE;
				while (TRUE) {
					PublishingPiwigoCategory** _tmp46_;
					gint _tmp46__length1;
					gchar** upcatids = NULL;
					PublishingPiwigoCategory** _tmp47_;
					gint _tmp47__length1;
					PublishingPiwigoCategory* _tmp48_;
					const gchar* _tmp49_;
					gchar** _tmp50_;
					gchar** _tmp51_;
					gint upcatids_length1;
					gint _upcatids_size_;
					GString* builder = NULL;
					GString* _tmp52_;
					PublishingPiwigoCategory** _tmp64_;
					gint _tmp64__length1;
					PublishingPiwigoCategory* _tmp65_;
					GString* _tmp66_;
					const gchar* _tmp67_;
					gchar* _tmp68_;
					if (!_tmp44_) {
						gint _tmp45_;
						_tmp45_ = i;
						i = _tmp45_ + 1;
					}
					_tmp44_ = FALSE;
					_tmp46_ = self->priv->categories;
					_tmp46__length1 = self->priv->categories_length1;
					if (!(i < _tmp46__length1)) {
						break;
					}
					_tmp47_ = self->priv->categories;
					_tmp47__length1 = self->priv->categories_length1;
					_tmp48_ = _tmp47_[i];
					_tmp49_ = _tmp48_->uppercats;
					_tmp51_ = _tmp50_ = g_strsplit (_tmp49_, ",", 0);
					upcatids = _tmp51_;
					upcatids_length1 = _vala_array_length (_tmp50_);
					_upcatids_size_ = upcatids_length1;
					_tmp52_ = g_string_new ("");
					builder = _tmp52_;
					{
						gint j = 0;
						j = 0;
						{
							gboolean _tmp53_ = FALSE;
							_tmp53_ = TRUE;
							while (TRUE) {
								gchar** _tmp55_;
								gint _tmp55__length1;
								GString* _tmp56_;
								GString* _tmp57_;
								GeeHashMap* _tmp58_;
								gchar** _tmp59_;
								gint _tmp59__length1;
								const gchar* _tmp60_;
								gpointer _tmp61_;
								gchar* _tmp62_;
								GString* _tmp63_;
								if (!_tmp53_) {
									gint _tmp54_;
									_tmp54_ = j;
									j = _tmp54_ + 1;
								}
								_tmp53_ = FALSE;
								_tmp55_ = upcatids;
								_tmp55__length1 = upcatids_length1;
								if (!(j < _tmp55__length1)) {
									break;
								}
								_tmp56_ = builder;
								g_string_append (_tmp56_, "/ ");
								_tmp57_ = builder;
								_tmp58_ = id_map;
								_tmp59_ = upcatids;
								_tmp59__length1 = upcatids_length1;
								_tmp60_ = _tmp59_[j];
								_tmp61_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp60_);
								_tmp62_ = (gchar*) _tmp61_;
								g_string_append (_tmp57_, _tmp62_);
								_g_free0 (_tmp62_);
								_tmp63_ = builder;
								g_string_append (_tmp63_, " ");
							}
						}
					}
					_tmp64_ = self->priv->categories;
					_tmp64__length1 = self->priv->categories_length1;
					_tmp65_ = _tmp64_[i];
					_tmp66_ = builder;
					_tmp67_ = _tmp66_->str;
					_tmp68_ = g_strdup (_tmp67_);
					_g_free0 (_tmp65_->display_name);
					_tmp65_->display_name = _tmp68_;
					_g_string_free0 (builder);
					upcatids = (_vala_array_free (upcatids, upcatids_length1, (GDestroyNotify) g_free), NULL);
				}
			}
		}
		_g_object_unref0 (id_map);
		_g_free0 (uppercats);
		_g_free0 (id_string);
		_g_free0 (name);
		_publishing_rest_support_xml_document_unref0 (doc);
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		GError* err = NULL;
		GError* _tmp69_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		g_debug ("PiwigoPublishing.vala:715: ERROR: on_category_fetch_complete");
		_tmp69_ = err;
		publishing_piwigo_piwigo_publisher_do_show_error (self, _tmp69_);
		_g_error_free0 (err);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	publishing_piwigo_piwigo_publisher_do_show_publishing_options_pane (self);
}

/**
     * Action that shows the publishing options pane.
     *
     * This action method shows the publishing options pane.
     */
static void
__lambda8_ (PublishingPiwigoPiwigoPublisher* self)
{
	publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked (self, NULL, NULL);
}

static void
___lambda8__publishing_piwigo_publishing_options_pane_logout (PublishingPiwigoPublishingOptionsPane* _sender,
                                                              gpointer self)
{
	__lambda8_ ((PublishingPiwigoPiwigoPublisher*) self);
}

static void
_publishing_piwigo_piwigo_publisher_on_publishing_options_pane_publish_clicked_publishing_piwigo_publishing_options_pane_publish (PublishingPiwigoPublishingOptionsPane* _sender,
                                                                                                                                  PublishingPiwigoPublishingParameters* parameters,
                                                                                                                                  gboolean strip_metadata,
                                                                                                                                  gpointer self)
{
	publishing_piwigo_piwigo_publisher_on_publishing_options_pane_publish_clicked ((PublishingPiwigoPiwigoPublisher*) self, parameters, strip_metadata);
}

static void
publishing_piwigo_piwigo_publisher_do_show_publishing_options_pane (PublishingPiwigoPiwigoPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	PublishingPiwigoPublishingOptionsPane* opts_pane = NULL;
	PublishingPiwigoCategory** _tmp1_;
	gint _tmp1__length1;
	PublishingPiwigoPublishingOptionsPane* _tmp2_;
	SpitPublishingPluginHost* _tmp3_;
	SpitPublishingPluginHost* _tmp4_;
	GtkWidget* _tmp5_;
	GtkWidget* _tmp6_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_debug ("PiwigoPublishing.vala:729: ACTION: installing publishing options pane");
	_tmp0_ = self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_tmp0_, FALSE);
	_tmp1_ = self->priv->categories;
	_tmp1__length1 = self->priv->categories_length1;
	_tmp2_ = publishing_piwigo_publishing_options_pane_new (self, _tmp1_, _tmp1__length1, publishing_piwigo_piwigo_publisher_get_last_category (self), publishing_piwigo_piwigo_publisher_get_last_permission_level (self), publishing_piwigo_piwigo_publisher_get_last_photo_size (self), publishing_piwigo_piwigo_publisher_get_last_title_as_comment (self), publishing_piwigo_piwigo_publisher_get_last_no_upload_tags (self), publishing_piwigo_piwigo_publisher_get_last_no_upload_ratings (self), publishing_piwigo_piwigo_publisher_get_metadata_removal_choice (self));
	opts_pane = _tmp2_;
	g_signal_connect_object (opts_pane, "logout", (GCallback) ___lambda8__publishing_piwigo_publishing_options_pane_logout, self, 0);
	g_signal_connect_object (opts_pane, "publish", (GCallback) _publishing_piwigo_piwigo_publisher_on_publishing_options_pane_publish_clicked_publishing_piwigo_publishing_options_pane_publish, self, 0);
	_tmp3_ = self->priv->host;
	spit_publishing_plugin_host_install_dialog_pane (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (opts_pane, SPIT_PUBLISHING_TYPE_DIALOG_PANE, SpitPublishingDialogPane), SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CLOSE);
	_tmp4_ = self->priv->host;
	_tmp5_ = shotwell_plugins_common_builder_pane_get_default_widget (G_TYPE_CHECK_INSTANCE_CAST (opts_pane, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	_tmp6_ = _tmp5_;
	spit_publishing_plugin_host_set_dialog_default_widget (_tmp4_, _tmp6_);
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (opts_pane);
}

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

static void
publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked (PublishingPiwigoPiwigoPublisher* self,
                                                                              GAsyncReadyCallback _callback_,
                                                                              gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherOnPublishingOptionsPaneLogoutClickedData* _data_;
	PublishingPiwigoPiwigoPublisher* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	_data_ = g_slice_new0 (PublishingPiwigoPiwigoPublisherOnPublishingOptionsPaneLogoutClickedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_co (_data_);
}

static void
publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_finish (PublishingPiwigoPiwigoPublisher* self,
                                                                                     GAsyncResult* _res_)
{
	PublishingPiwigoPiwigoPublisherOnPublishingOptionsPaneLogoutClickedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

/**
     * Event triggered when the user clicks logout in the publishing options pane.
     */
static void
publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_ready (GObject* source_object,
                                                                                    GAsyncResult* _res_,
                                                                                    gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherOnPublishingOptionsPaneLogoutClickedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_co (_data_);
}

static gboolean
publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_co (PublishingPiwigoPiwigoPublisherOnPublishingOptionsPaneLogoutClickedData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("PiwigoPublishing.vala:745: EVENT: on_publishing_options_pane_logout_cl" \
"icked");
	{
		_data_->_tmp0_ = _data_->self->priv->session;
		_data_->_tmp1_ = publishing_piwigo_session_logout_transaction_new (_data_->_tmp0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_state_ = 1;
		publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp2_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_piwigo_piwigo_publisher_on_publishing_options_pane_logout_clicked_ready, _data_);
		return FALSE;
		_state_1:
		publishing_rest_support_transaction_execute_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp2_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
		_publishing_rest_support_transaction_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _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_piwigo_piwigo_publisher_on_logout_network_complete (_data_->self);
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		g_debug ("PiwigoPublishing.vala:751: ERROR: on_publishing_options_pane_logout_cl" \
"icked");
		_data_->_tmp3_ = _data_->err;
		publishing_piwigo_piwigo_publisher_do_show_error (_data_->self, _data_->_tmp3_);
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != 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;
	}
	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;
}

/**
     * Event triggered when the logout action completes successfully.
     *
     * This event de-authenticates the session and shows the authentication
     * pane again.
     */
static void
publishing_piwigo_piwigo_publisher_on_logout_network_complete (PublishingPiwigoPiwigoPublisher* self)
{
	PublishingPiwigoSession* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_debug ("PiwigoPublishing.vala:763: EVENT: on_logout_network_complete");
	_tmp0_ = self->priv->session;
	publishing_piwigo_session_deauthenticate (_tmp0_);
	publishing_piwigo_piwigo_publisher_do_show_authentication_pane (self, PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_INTRO);
}

/**
     * Event triggered when the user clicks publish in the publishing options pane.
     *
     * This event first saves the parameters so that they can re-used later.
     * If the publishing parameters indicate that the user wants to create a new
     * category, the create category action is called. Otherwise, the upload
     * action is called.
     *
     * @param parameters the publishing parameters
     */
static gpointer
_publishing_piwigo_publishing_parameters_ref0 (gpointer self)
{
	return self ? publishing_piwigo_publishing_parameters_ref (self) : NULL;
}

static void
publishing_piwigo_piwigo_publisher_on_publishing_options_pane_publish_clicked (PublishingPiwigoPiwigoPublisher* self,
                                                                               PublishingPiwigoPublishingParameters* parameters,
                                                                               gboolean strip_metadata)
{
	PublishingPiwigoPublishingParameters* _tmp0_;
	PublishingPiwigoCategory* _tmp1_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_PARAMETERS (parameters));
	g_debug ("PiwigoPublishing.vala:782: EVENT: on_publishing_options_pane_publish_c" \
"licked");
	_tmp0_ = _publishing_piwigo_publishing_parameters_ref0 (parameters);
	_publishing_piwigo_publishing_parameters_unref0 (self->priv->parameters);
	self->priv->parameters = _tmp0_;
	self->priv->strip_metadata = strip_metadata;
	_tmp1_ = parameters->category;
	if (publishing_piwigo_category_is_local (_tmp1_)) {
		PublishingPiwigoCategory* _tmp2_;
		_tmp2_ = parameters->category;
		publishing_piwigo_piwigo_publisher_do_create_category (self, _tmp2_, NULL, NULL);
	} else {
		publishing_piwigo_piwigo_publisher_do_upload (self, self->priv->strip_metadata, NULL, NULL);
	}
}

static void
publishing_piwigo_piwigo_publisher_do_create_category_data_free (gpointer _data)
{
	PublishingPiwigoPiwigoPublisherDoCreateCategoryData* _data_;
	_data_ = _data;
	_publishing_piwigo_category_unref0 (_data_->category);
	_g_object_unref0 (_data_->self);
	g_slice_free (PublishingPiwigoPiwigoPublisherDoCreateCategoryData, _data_);
}

static gpointer
_publishing_piwigo_category_ref0 (gpointer self)
{
	return self ? publishing_piwigo_category_ref (self) : NULL;
}

static void
publishing_piwigo_piwigo_publisher_do_create_category (PublishingPiwigoPiwigoPublisher* self,
                                                       PublishingPiwigoCategory* category,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherDoCreateCategoryData* _data_;
	PublishingPiwigoPiwigoPublisher* _tmp0_;
	PublishingPiwigoCategory* _tmp1_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (PUBLISHING_PIWIGO_IS_CATEGORY (category));
	_data_ = g_slice_new0 (PublishingPiwigoPiwigoPublisherDoCreateCategoryData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_piwigo_piwigo_publisher_do_create_category_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _publishing_piwigo_category_ref0 (category);
	_publishing_piwigo_category_unref0 (_data_->category);
	_data_->category = _tmp1_;
	publishing_piwigo_piwigo_publisher_do_create_category_co (_data_);
}

static void
publishing_piwigo_piwigo_publisher_do_create_category_finish (PublishingPiwigoPiwigoPublisher* self,
                                                              GAsyncResult* _res_)
{
	PublishingPiwigoPiwigoPublisherDoCreateCategoryData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

/**
     * Action that creates a new category in the Piwigo library.
     *
     * This actions runs a REST transaction to create a new category in the
     * Piwigo library. It displays a wait pane with an information message
     * while the transaction is running. This action should only be called with
     * a local category, i.e. one that does not exist on the server and does
     * not yet have an ID.
     *
     * @param category the new category to create on the server
     */
static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
publishing_piwigo_piwigo_publisher_do_create_category_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherDoCreateCategoryData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_piwigo_piwigo_publisher_do_create_category_co (_data_);
}

static gboolean
publishing_piwigo_piwigo_publisher_do_create_category_co (PublishingPiwigoPiwigoPublisherDoCreateCategoryData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->category->name;
	_data_->_tmp1_ = g_strdup_printf ("ACTION: creating a new category: %s", _data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	g_debug ("PiwigoPublishing.vala:805: %s", _data_->_tmp2_);
	_g_free0 (_data_->_tmp2_);
	_vala_assert (publishing_piwigo_category_is_local (_data_->category), "category.is_local()");
	_data_->_tmp3_ = _data_->self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp3_, TRUE);
	_data_->_tmp4_ = _data_->self->priv->host;
	_data_->_tmp5_ = _data_->category->name;
	_data_->_tmp6_ = g_strdup_printf (_ ("Creating album %s…"), _data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	spit_publishing_plugin_host_install_static_message_pane (_data_->_tmp4_, _data_->_tmp7_, SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CANCEL);
	_g_free0 (_data_->_tmp7_);
	_data_->_tmp8_ = _data_->self->priv->session;
	_data_->_tmp9_ = _data_->category->name;
	_data_->_tmp10_ = string_strip (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = _data_->category->uppercats;
	_data_->_tmp13_ = _data_->category->comment;
	_data_->_tmp14_ = publishing_piwigo_categories_add_transaction_new (_data_->_tmp8_, _data_->_tmp11_, atoi (_data_->_tmp12_), _data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_g_free0 (_data_->_tmp11_);
	_data_->creation_trans = _data_->_tmp15_;
	{
		_data_->_state_ = 1;
		publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->creation_trans, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_piwigo_piwigo_publisher_do_create_category_ready, _data_);
		return FALSE;
		_state_1:
		publishing_rest_support_transaction_execute_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->creation_trans, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			_publishing_rest_support_transaction_unref0 (_data_->creation_trans);
			g_critical ("file %s: line %d: unexpected 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_piwigo_piwigo_publisher_on_category_add_complete (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->creation_trans, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		g_debug ("PiwigoPublishing.vala:818: ERROR: do_create_category");
		_data_->_tmp16_ = _data_->err;
		publishing_piwigo_piwigo_publisher_do_show_error (_data_->self, _data_->_tmp16_);
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_publishing_rest_support_transaction_unref0 (_data_->creation_trans);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_publishing_rest_support_transaction_unref0 (_data_->creation_trans);
	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;
}

/**
     * Event triggered when the add category action completes successfully.
     *
     * This event parses the ID assigned to new category out of the received
     * transaction and assigns that ID to the category currently held in
     * the publishing parameters. It then calls the upload action.
     */
static void
publishing_piwigo_piwigo_publisher_on_category_add_complete (PublishingPiwigoPiwigoPublisher* self,
                                                             PublishingRESTSupportTransaction* txn)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION));
	g_debug ("PiwigoPublishing.vala:831: EVENT: on_category_add_complete");
	{
		PublishingRESTSupportXmlDocument* doc = NULL;
		gchar* _tmp0_;
		gchar* _tmp1_;
		PublishingRESTSupportXmlDocument* _tmp2_;
		PublishingRESTSupportXmlDocument* _tmp3_;
		xmlNode* rsp = NULL;
		PublishingRESTSupportXmlDocument* _tmp4_;
		xmlNode* _tmp5_;
		xmlNode* id_node = NULL;
		xmlNode* _tmp6_ = NULL;
		PublishingRESTSupportXmlDocument* _tmp7_;
		xmlNode* _tmp8_;
		xmlNode* _tmp9_;
		gchar* id_string = NULL;
		xmlNode* _tmp10_;
		gchar* _tmp11_;
		gint id = 0;
		const gchar* _tmp12_;
		PublishingPiwigoPublishingParameters* _tmp13_;
		PublishingPiwigoCategory* _tmp14_;
		_tmp0_ = publishing_rest_support_transaction_get_response (txn);
		_tmp1_ = _tmp0_;
		_tmp2_ = publishing_rest_support_xml_document_parse_string (_tmp1_, _publishing_piwigo_transaction_validate_xml_publishing_rest_support_xml_document_check_for_error_response, NULL, &_inner_error0_);
		_tmp3_ = _tmp2_;
		_g_free0 (_tmp1_);
		doc = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp4_ = doc;
		_tmp5_ = publishing_rest_support_xml_document_get_root_node (_tmp4_);
		rsp = _tmp5_;
		_tmp7_ = doc;
		_tmp8_ = rsp;
		_tmp9_ = publishing_rest_support_xml_document_get_named_child (_tmp7_, _tmp8_, "id", &_inner_error0_);
		_tmp6_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_publishing_rest_support_xml_document_unref0 (doc);
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		id_node = _tmp6_;
		_tmp10_ = id_node;
		_tmp11_ = (gchar*) xmlNodeGetContent (_tmp10_);
		id_string = _tmp11_;
		_tmp12_ = id_string;
		id = atoi (_tmp12_);
		_tmp13_ = self->priv->parameters;
		_tmp14_ = _tmp13_->category;
		_tmp14_->id = id;
		publishing_piwigo_piwigo_publisher_do_upload (self, self->priv->strip_metadata, NULL, NULL);
		_g_free0 (id_string);
		_publishing_rest_support_xml_document_unref0 (doc);
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		GError* err = NULL;
		GError* _tmp15_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		g_debug ("PiwigoPublishing.vala:846: ERROR: on_category_add_complete");
		_tmp15_ = err;
		publishing_piwigo_piwigo_publisher_do_show_error (self, _tmp15_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

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

static void
publishing_piwigo_piwigo_publisher_do_upload (PublishingPiwigoPiwigoPublisher* self,
                                              gboolean strip_metadata,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherDoUploadData* _data_;
	PublishingPiwigoPiwigoPublisher* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	_data_ = g_slice_new0 (PublishingPiwigoPiwigoPublisherDoUploadData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_piwigo_piwigo_publisher_do_upload_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->strip_metadata = strip_metadata;
	publishing_piwigo_piwigo_publisher_do_upload_co (_data_);
}

static void
publishing_piwigo_piwigo_publisher_do_upload_finish (PublishingPiwigoPiwigoPublisher* self,
                                                     GAsyncResult* _res_)
{
	PublishingPiwigoPiwigoPublisherDoUploadData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

/**
     * Upload action: the big one, the one we've been waiting for!
     */
static void
_publishing_piwigo_piwigo_publisher_on_upload_status_updated_spit_publishing_progress_callback (gint file_number,
                                                                                                gdouble fraction_complete,
                                                                                                gpointer self)
{
	publishing_piwigo_piwigo_publisher_on_upload_status_updated ((PublishingPiwigoPiwigoPublisher*) self, file_number, fraction_complete);
}

static void
publishing_piwigo_piwigo_publisher_do_upload_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	PublishingPiwigoPiwigoPublisherDoUploadData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_piwigo_piwigo_publisher_do_upload_co (_data_);
}

static gboolean
publishing_piwigo_piwigo_publisher_do_upload_co (PublishingPiwigoPiwigoPublisherDoUploadData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->self->priv->strip_metadata = _data_->strip_metadata;
	g_debug ("PiwigoPublishing.vala:856: ACTION: uploading pictures");
	_data_->_tmp0_ = _data_->self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp0_, TRUE);
	_data_->_tmp1_ = _data_->self->priv->parameters;
	_data_->_tmp2_ = _data_->_tmp1_->category;
	publishing_piwigo_piwigo_publisher_set_last_category (_data_->self, _data_->_tmp2_->id);
	_data_->_tmp3_ = _data_->self->priv->parameters;
	_data_->_tmp4_ = _data_->_tmp3_->perm_level;
	publishing_piwigo_piwigo_publisher_set_last_permission_level (_data_->self, _data_->_tmp4_->id);
	_data_->_tmp5_ = _data_->self->priv->parameters;
	_data_->_tmp6_ = _data_->_tmp5_->photo_size;
	publishing_piwigo_piwigo_publisher_set_last_photo_size (_data_->self, _data_->_tmp6_->id);
	_data_->_tmp7_ = _data_->self->priv->parameters;
	publishing_piwigo_piwigo_publisher_set_last_title_as_comment (_data_->self, _data_->_tmp7_->title_as_comment);
	_data_->_tmp8_ = _data_->self->priv->parameters;
	publishing_piwigo_piwigo_publisher_set_last_no_upload_tags (_data_->self, _data_->_tmp8_->no_upload_tags);
	_data_->_tmp9_ = _data_->self->priv->parameters;
	publishing_piwigo_piwigo_publisher_set_last_no_upload_ratings (_data_->self, _data_->_tmp9_->no_upload_ratings);
	publishing_piwigo_piwigo_publisher_set_metadata_removal_choice (_data_->self, _data_->strip_metadata);
	_data_->_tmp10_ = _data_->self->priv->host;
	_data_->_tmp11_ = _data_->self->priv->parameters;
	_data_->_tmp12_ = _data_->_tmp11_->photo_size;
	_data_->_tmp13_ = NULL;
	_data_->_tmp14_ = NULL;
	_data_->_tmp15_ = spit_publishing_plugin_host_serialize_publishables (_data_->_tmp10_, _data_->_tmp12_->id, _data_->self->priv->strip_metadata, &_data_->_tmp13_, &_data_->_tmp14_);
	(_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_->_tmp15_;
	_data_->self->priv->progress_reporter_target = _data_->_tmp13_;
	_data_->self->priv->progress_reporter_target_destroy_notify = _data_->_tmp14_;
	_data_->_tmp16_ = _data_->self->priv->host;
	_data_->_tmp17_ = 0;
	_data_->_tmp18_ = spit_publishing_plugin_host_get_publishables (_data_->_tmp16_, &_data_->_tmp17_);
	_data_->publishables = _data_->_tmp18_;
	_data_->publishables_length1 = _data_->_tmp17_;
	_data_->_publishables_size_ = _data_->publishables_length1;
	_data_->_tmp19_ = _data_->self->priv->session;
	_data_->_tmp20_ = _data_->self->priv->parameters;
	_data_->_tmp21_ = publishing_piwigo_uploader_new (_data_->_tmp19_, _data_->publishables, _data_->publishables_length1, _data_->_tmp20_);
	_data_->uploader = _data_->_tmp21_;
	{
		_data_->_state_ = 1;
		publishing_rest_support_batch_uploader_upload_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->uploader, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader), _publishing_piwigo_piwigo_publisher_on_upload_status_updated_spit_publishing_progress_callback, _data_->self, publishing_piwigo_piwigo_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_->uploader, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			_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: unexpected 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_piwigo_piwigo_publisher_on_upload_complete (_data_->self, _data_->num_published);
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp22_ = _data_->err;
		publishing_piwigo_piwigo_publisher_do_show_error (_data_->self, _data_->_tmp22_);
		_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;
}

/**
     * Event triggered when the batch uploader reports that at least one of the
     * network transactions encapsulating uploads has completed successfully
     */
static void
publishing_piwigo_piwigo_publisher_on_upload_complete (PublishingPiwigoPiwigoPublisher* self,
                                                       gint num_published)
{
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_debug ("PiwigoPublishing.vala:885: EVENT: on_upload_complete");
	if (!spit_publishing_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher))) {
		return;
	}
	publishing_piwigo_piwigo_publisher_do_show_success_pane (self);
}

/**
     * Event triggered when upload progresses and the status needs to be updated.
     */
static void
publishing_piwigo_piwigo_publisher_on_upload_status_updated (PublishingPiwigoPiwigoPublisher* self,
                                                             gint file_number,
                                                             gdouble completed_fraction)
{
	SpitPublishingProgressCallback _tmp0_;
	gpointer _tmp0__target;
	SpitPublishingProgressCallback _tmp1_;
	gpointer _tmp1__target;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	if (!spit_publishing_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher))) {
		return;
	}
	g_debug ("PiwigoPublishing.vala:902: EVENT: uploader reports upload %.2f percent" \
" complete.", 100.0 * completed_fraction);
	_tmp0_ = self->priv->progress_reporter;
	_tmp0__target = self->priv->progress_reporter_target;
	_vala_assert (_tmp0_ != NULL, "progress_reporter != null");
	_tmp1_ = self->priv->progress_reporter;
	_tmp1__target = self->priv->progress_reporter_target;
	_tmp1_ (file_number, completed_fraction, _tmp1__target);
}

/**
     * Action to display the success pane in the publishing dialog.
     */
static void
publishing_piwigo_piwigo_publisher_do_show_success_pane (PublishingPiwigoPiwigoPublisher* self)
{
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_debug ("PiwigoPublishing.vala:913: ACTION: installing success pane");
	_tmp0_ = self->priv->host;
	spit_publishing_plugin_host_set_service_locked (_tmp0_, FALSE);
	_tmp1_ = self->priv->host;
	spit_publishing_plugin_host_install_success_pane (_tmp1_);
}

/**
     * Action to display an error to the user.
     */
static void
publishing_piwigo_piwigo_publisher_do_show_error (PublishingPiwigoPiwigoPublisher* self,
                                                  GError* e)
{
	gchar* error_type = NULL;
	gchar* _tmp0_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_debug ("PiwigoPublishing.vala:923: ACTION: do_show_error");
	_tmp0_ = g_strdup ("UNKNOWN");
	error_type = _tmp0_;
	if (g_error_matches (e, SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_NO_ANSWER)) {
		publishing_piwigo_piwigo_publisher_do_show_authentication_pane (self, PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_FAILED_RETRY_URL);
		_g_free0 (error_type);
		return;
	} else {
		if (g_error_matches (e, SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_COMMUNICATION_FAILED)) {
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("COMMUNICATION_FAILED");
			_g_free0 (error_type);
			error_type = _tmp1_;
		} else {
			if (g_error_matches (e, SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_PROTOCOL_ERROR)) {
				gchar* _tmp2_;
				_tmp2_ = g_strdup ("PROTOCOL_ERROR");
				_g_free0 (error_type);
				error_type = _tmp2_;
			} else {
				if (g_error_matches (e, SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_SERVICE_ERROR)) {
					gchar* _tmp3_;
					_tmp3_ = g_strdup ("SERVICE_ERROR");
					_g_free0 (error_type);
					error_type = _tmp3_;
				} else {
					if (g_error_matches (e, SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_MALFORMED_RESPONSE)) {
						gchar* _tmp4_;
						_tmp4_ = g_strdup ("MALFORMED_RESPONSE");
						_g_free0 (error_type);
						error_type = _tmp4_;
					} else {
						if (g_error_matches (e, SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_LOCAL_FILE_ERROR)) {
							gchar* _tmp5_;
							_tmp5_ = g_strdup ("LOCAL_FILE_ERROR");
							_g_free0 (error_type);
							error_type = _tmp5_;
						} else {
							if (g_error_matches (e, SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_EXPIRED_SESSION)) {
								gchar* _tmp6_;
								_tmp6_ = g_strdup ("EXPIRED_SESSION");
								_g_free0 (error_type);
								error_type = _tmp6_;
							} else {
								if (g_error_matches (e, SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_SSL_FAILED)) {
									gchar* _tmp7_;
									_tmp7_ = g_strdup ("SECURE_CONNECTION_FAILED");
									_g_free0 (error_type);
									error_type = _tmp7_;
								}
							}
						}
					}
				}
			}
		}
	}
	_tmp8_ = error_type;
	_tmp9_ = e->message;
	_tmp10_ = g_strdup_printf ("Unhandled error: type=%s; message='%s'", _tmp8_, _tmp9_);
	_tmp11_ = _tmp10_;
	g_debug ("PiwigoPublishing.vala:944: %s", _tmp11_);
	_g_free0 (_tmp11_);
	publishing_piwigo_piwigo_publisher_do_show_error_message (self, _ ("An error message occurred when publishing to Piwigo. Please try again."));
	_g_free0 (error_type);
}

/**
     * Action to display an error message to the user.
     */
static void
publishing_piwigo_piwigo_publisher_do_show_error_message (PublishingPiwigoPiwigoPublisher* self,
                                                          const gchar* message)
{
	SpitPublishingPluginHost* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self));
	g_return_if_fail (message != NULL);
	g_debug ("PiwigoPublishing.vala:952: ACTION: do_show_error_message");
	_tmp0_ = self->priv->host;
	spit_publishing_plugin_host_install_static_message_pane (_tmp0_, message, SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CLOSE);
}

/**
     * Retrieves session ID from a REST Transaction received
     *
     * This helper method extracts the pwg_id out of the Set-Cookie header if
     * present in the received transaction.
     *
     * @param txn the received transaction
     * @return the value of pwg_id if present or null if not found
     */
static SoupCookie*
_vala_SoupCookie_copy (SoupCookie* self)
{
	return g_boxed_copy (soup_cookie_get_type (), self);
}

static gpointer
__vala_SoupCookie_copy0 (gpointer self)
{
	return self ? _vala_SoupCookie_copy (self) : NULL;
}

static void
_vala_SoupCookie_free (SoupCookie* self)
{
	g_boxed_free (soup_cookie_get_type (), self);
}

static void
__vala_SoupCookie_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (_vala_SoupCookie_free (var), NULL));
}

static inline void
_g_slist_free___vala_SoupCookie_free0_ (GSList* self)
{
	g_slist_free_full (self, (GDestroyNotify) __vala_SoupCookie_free0_);
}

static gchar*
publishing_piwigo_piwigo_publisher_get_pwg_id_from_transaction (PublishingPiwigoPiwigoPublisher* self,
                                                                PublishingRESTSupportTransaction* txn)
{
	gchar* pwg_id = NULL;
	SoupMessage* _tmp0_;
	SoupMessage* _tmp1_;
	GSList* _tmp2_;
	GSList* _tmp3_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (self), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION), NULL);
	pwg_id = NULL;
	_tmp0_ = publishing_rest_support_transaction_get_message (txn);
	_tmp1_ = _tmp0_;
	_tmp2_ = soup_cookies_from_response (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	{
		GSList* cookie_collection = NULL;
		GSList* cookie_it = NULL;
		cookie_collection = _tmp3_;
		for (cookie_it = cookie_collection; cookie_it != NULL; cookie_it = cookie_it->next) {
			SoupCookie* _tmp4_;
			SoupCookie* cookie = NULL;
			_tmp4_ = __vala_SoupCookie_copy0 ((SoupCookie*) cookie_it->data);
			cookie = _tmp4_;
			{
				SoupCookie* _tmp5_;
				const gchar* _tmp6_;
				_tmp5_ = cookie;
				_tmp6_ = soup_cookie_get_name (_tmp5_);
				if (g_strcmp0 (_tmp6_, "pwg_id") == 0) {
					SoupCookie* _tmp7_;
					const gchar* _tmp8_;
					gchar* _tmp9_;
					const gchar* _tmp10_;
					_tmp7_ = cookie;
					_tmp8_ = soup_cookie_get_value (_tmp7_);
					_tmp9_ = g_strdup (_tmp8_);
					_g_free0 (pwg_id);
					pwg_id = _tmp9_;
					_tmp10_ = pwg_id;
					g_debug ("PiwigoPublishing.vala:976: Found pwg_id %s", _tmp10_);
				}
				__vala_SoupCookie_free0 (cookie);
			}
		}
		(cookie_collection == NULL) ? NULL : (cookie_collection = (_g_slist_free___vala_SoupCookie_free0_ (cookie_collection), NULL));
	}
	result = pwg_id;
	return result;
}

static void
publishing_piwigo_piwigo_publisher_class_init (PublishingPiwigoPiwigoPublisherClass * klass,
                                               gpointer klass_data)
{
	publishing_piwigo_piwigo_publisher_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingPiwigoPiwigoPublisher_private_offset);
	G_OBJECT_CLASS (klass)->finalize = publishing_piwigo_piwigo_publisher_finalize;
}

static void
publishing_piwigo_piwigo_publisher_spit_publishing_publisher_interface_init (SpitPublishingPublisherIface * iface,
                                                                             gpointer iface_data)
{
	publishing_piwigo_piwigo_publisher_spit_publishing_publisher_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_service = (SpitPublishingService* (*) (SpitPublishingPublisher*)) publishing_piwigo_piwigo_publisher_real_get_service;
	iface->is_running = (gboolean (*) (SpitPublishingPublisher*)) publishing_piwigo_piwigo_publisher_real_is_running;
	iface->start = (void (*) (SpitPublishingPublisher*)) publishing_piwigo_piwigo_publisher_real_start;
	iface->stop = (void (*) (SpitPublishingPublisher*)) publishing_piwigo_piwigo_publisher_real_stop;
}

static void
publishing_piwigo_piwigo_publisher_instance_init (PublishingPiwigoPiwigoPublisher * self,
                                                  gpointer klass)
{
	self->priv = publishing_piwigo_piwigo_publisher_get_instance_private (self);
	self->priv->running = FALSE;
	self->priv->strip_metadata = FALSE;
	self->priv->categories = NULL;
	self->priv->categories_length1 = 0;
	self->priv->_categories_size_ = self->priv->categories_length1;
	self->priv->parameters = NULL;
	self->priv->progress_reporter = NULL;
	self->priv->progress_reporter_target = NULL;
	self->priv->progress_reporter_target_destroy_notify = NULL;
	self->priv->schema = NULL;
	self->priv->account = NULL;
}

static void
publishing_piwigo_piwigo_publisher_finalize (GObject * obj)
{
	PublishingPiwigoPiwigoPublisher * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_PIWIGO_PUBLISHER, PublishingPiwigoPiwigoPublisher);
	_g_object_unref0 (self->priv->service);
	_g_object_unref0 (self->priv->host);
	_publishing_rest_support_session_unref0 (self->priv->session);
	self->priv->categories = (_vala_array_free (self->priv->categories, self->priv->categories_length1, (GDestroyNotify) publishing_piwigo_category_unref), NULL);
	_publishing_piwigo_publishing_parameters_unref0 (self->priv->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;
	_secret_schema_unref0 (self->priv->schema);
	_g_object_unref0 (self->priv->account);
	G_OBJECT_CLASS (publishing_piwigo_piwigo_publisher_parent_class)->finalize (obj);
}

static GType
publishing_piwigo_piwigo_publisher_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoPiwigoPublisherClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_piwigo_publisher_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoPiwigoPublisher), 0, (GInstanceInitFunc) publishing_piwigo_piwigo_publisher_instance_init, NULL };
	static const GInterfaceInfo spit_publishing_publisher_info = { (GInterfaceInitFunc) publishing_piwigo_piwigo_publisher_spit_publishing_publisher_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType publishing_piwigo_piwigo_publisher_type_id;
	publishing_piwigo_piwigo_publisher_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingPiwigoPiwigoPublisher", &g_define_type_info, 0);
	g_type_add_interface_static (publishing_piwigo_piwigo_publisher_type_id, SPIT_PUBLISHING_TYPE_PUBLISHER, &spit_publishing_publisher_info);
	PublishingPiwigoPiwigoPublisher_private_offset = g_type_add_instance_private (publishing_piwigo_piwigo_publisher_type_id, sizeof (PublishingPiwigoPiwigoPublisherPrivate));
	return publishing_piwigo_piwigo_publisher_type_id;
}

GType
publishing_piwigo_piwigo_publisher_get_type (void)
{
	static volatile gsize publishing_piwigo_piwigo_publisher_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_piwigo_publisher_type_id__once)) {
		GType publishing_piwigo_piwigo_publisher_type_id;
		publishing_piwigo_piwigo_publisher_type_id = publishing_piwigo_piwigo_publisher_get_type_once ();
		g_once_init_leave (&publishing_piwigo_piwigo_publisher_type_id__once, publishing_piwigo_piwigo_publisher_type_id);
	}
	return publishing_piwigo_piwigo_publisher_type_id__once;
}

static inline gpointer
publishing_piwigo_uploader_get_instance_private (PublishingPiwigoUploader* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingPiwigoUploader_private_offset);
}

PublishingPiwigoUploader*
publishing_piwigo_uploader_construct (GType object_type,
                                      PublishingPiwigoSession* session,
                                      SpitPublishingPublishable** publishables,
                                      gint publishables_length1,
                                      PublishingPiwigoPublishingParameters* parameters)
{
	PublishingPiwigoUploader* self = NULL;
	PublishingPiwigoPublishingParameters* _tmp0_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_PARAMETERS (parameters), NULL);
	self = (PublishingPiwigoUploader*) 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_piwigo_publishing_parameters_ref0 (parameters);
	_publishing_piwigo_publishing_parameters_unref0 (self->priv->parameters);
	self->priv->parameters = _tmp0_;
	return self;
}

PublishingPiwigoUploader*
publishing_piwigo_uploader_new (PublishingPiwigoSession* session,
                                SpitPublishingPublishable** publishables,
                                gint publishables_length1,
                                PublishingPiwigoPublishingParameters* parameters)
{
	return publishing_piwigo_uploader_construct (PUBLISHING_PIWIGO_TYPE_UPLOADER, session, publishables, publishables_length1, parameters);
}

static PublishingRESTSupportTransaction*
publishing_piwigo_uploader_real_create_transaction (PublishingRESTSupportBatchUploader* base,
                                                    SpitPublishingPublishable* publishable)
{
	PublishingPiwigoUploader * self;
	PublishingRESTSupportSession* _tmp0_;
	PublishingPiwigoSession* _tmp1_;
	PublishingPiwigoPublishingParameters* _tmp2_;
	PublishingPiwigoImagesAddTransaction* _tmp3_;
	PublishingRESTSupportTransaction* _tmp4_;
	PublishingRESTSupportTransaction* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_UPLOADER, PublishingPiwigoUploader);
	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_PIWIGO_TYPE_SESSION, PublishingPiwigoSession);
	_tmp2_ = self->priv->parameters;
	_tmp3_ = publishing_piwigo_images_add_transaction_new (_tmp1_, _tmp2_, publishable);
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction);
	_publishing_rest_support_session_unref0 (_tmp1_);
	result = _tmp4_;
	return result;
}

static void
publishing_piwigo_uploader_class_init (PublishingPiwigoUploaderClass * klass,
                                       gpointer klass_data)
{
	publishing_piwigo_uploader_parent_class = g_type_class_peek_parent (klass);
	((PublishingRESTSupportBatchUploaderClass *) klass)->finalize = publishing_piwigo_uploader_finalize;
	g_type_class_adjust_private_offset (klass, &PublishingPiwigoUploader_private_offset);
	((PublishingRESTSupportBatchUploaderClass *) klass)->create_transaction = (PublishingRESTSupportTransaction* (*) (PublishingRESTSupportBatchUploader*, SpitPublishingPublishable*)) publishing_piwigo_uploader_real_create_transaction;
}

static void
publishing_piwigo_uploader_instance_init (PublishingPiwigoUploader * self,
                                          gpointer klass)
{
	self->priv = publishing_piwigo_uploader_get_instance_private (self);
}

static void
publishing_piwigo_uploader_finalize (PublishingRESTSupportBatchUploader * obj)
{
	PublishingPiwigoUploader * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_UPLOADER, PublishingPiwigoUploader);
	_publishing_piwigo_publishing_parameters_unref0 (self->priv->parameters);
	PUBLISHING_REST_SUPPORT_BATCH_UPLOADER_CLASS (publishing_piwigo_uploader_parent_class)->finalize (obj);
}

static GType
publishing_piwigo_uploader_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoUploaderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_uploader_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoUploader), 0, (GInstanceInitFunc) publishing_piwigo_uploader_instance_init, NULL };
	GType publishing_piwigo_uploader_type_id;
	publishing_piwigo_uploader_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, "PublishingPiwigoUploader", &g_define_type_info, 0);
	PublishingPiwigoUploader_private_offset = g_type_add_instance_private (publishing_piwigo_uploader_type_id, sizeof (PublishingPiwigoUploaderPrivate));
	return publishing_piwigo_uploader_type_id;
}

GType
publishing_piwigo_uploader_get_type (void)
{
	static volatile gsize publishing_piwigo_uploader_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_uploader_type_id__once)) {
		GType publishing_piwigo_uploader_type_id;
		publishing_piwigo_uploader_type_id = publishing_piwigo_uploader_get_type_once ();
		g_once_init_leave (&publishing_piwigo_uploader_type_id__once, publishing_piwigo_uploader_type_id);
	}
	return publishing_piwigo_uploader_type_id__once;
}

static inline gpointer
publishing_piwigo_ssl_error_pane_get_instance_private (PublishingPiwigoSSLErrorPane* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingPiwigoSSLErrorPane_private_offset);
}

PublishingPiwigoSSLErrorPane*
publishing_piwigo_ssl_error_pane_construct (GType object_type,
                                            PublishingPiwigoSessionLoginTransaction* transaction,
                                            const gchar* host)
{
	PublishingPiwigoSSLErrorPane * self = NULL;
	GTlsCertificate* cert = NULL;
	gchar* text = NULL;
	GTlsCertificate* _tmp0_ = NULL;
	gchar* _tmp1_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION_LOGIN_TRANSACTION (transaction), NULL);
	g_return_val_if_fail (host != NULL, NULL);
	_tmp1_ = publishing_rest_support_transaction_detailed_error_from_tls_flags (G_TYPE_CHECK_INSTANCE_CAST (transaction, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), &_tmp0_);
	_g_object_unref0 (cert);
	cert = _tmp0_;
	text = _tmp1_;
	self = (PublishingPiwigoSSLErrorPane*) g_object_new (object_type, "resource-path", PLUGIN_RESOURCE_PATH "/piwigo_ssl_failure_pane.ui", "default-id", "default", "cert", cert, "error-text", text, "host", host, NULL);
	_g_free0 (text);
	_g_object_unref0 (cert);
	return self;
}

PublishingPiwigoSSLErrorPane*
publishing_piwigo_ssl_error_pane_new (PublishingPiwigoSessionLoginTransaction* transaction,
                                      const gchar* host)
{
	return publishing_piwigo_ssl_error_pane_construct (PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE, transaction, host);
}

static void
___lambda5_ (PublishingPiwigoSSLErrorPane* self)
{
	GcrSimpleCertificate* simple_cert = NULL;
	GTlsCertificate* _tmp0_;
	GByteArray* _tmp1_;
	GByteArray* _tmp2_;
	GByteArray* _tmp3_;
	guint8* _tmp4_;
	gint _tmp4__length1;
	GcrSimpleCertificate* _tmp5_;
	GcrSimpleCertificate* _tmp6_;
	GcrCertificateWidget* widget = NULL;
	GcrSimpleCertificate* _tmp7_;
	GcrCertificateWidget* _tmp8_;
	gboolean use_header = FALSE;
	GtkSettings* _tmp9_;
	gboolean _tmp10_ = FALSE;
	GtkDialogFlags flags = 0U;
	GtkDialog* dialog = NULL;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	GtkDialog* _tmp16_;
	GtkDialog* _tmp17_;
	GtkBox* _tmp18_;
	GcrCertificateWidget* _tmp19_;
	_tmp0_ = self->priv->_cert;
	g_object_get (_tmp0_, "certificate", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_->data;
	_tmp4__length1 = _tmp3_->len;
	_tmp5_ = (GcrSimpleCertificate*) gcr_simple_certificate_new (_tmp4_, _tmp4__length1);
	_tmp6_ = _tmp5_;
	_g_byte_array_unref0 (_tmp3_);
	simple_cert = _tmp6_;
	_tmp7_ = simple_cert;
	_tmp8_ = gcr_certificate_widget_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gcr_certificate_get_type (), GcrCertificate));
	g_object_ref_sink (_tmp8_);
	widget = _tmp8_;
	use_header = TRUE;
	_tmp9_ = gtk_settings_get_default ();
	g_object_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, G_TYPE_OBJECT, GObject), "gtk-dialogs-use-header", &_tmp10_, NULL);
	use_header = _tmp10_;
	flags = (GtkDialogFlags) 0;
	if (use_header) {
		flags |= GTK_DIALOG_USE_HEADER_BAR;
	}
	_tmp11_ = publishing_piwigo_ssl_error_pane_get_host (self);
	_tmp12_ = _tmp11_;
	_tmp13_ = _tmp12_;
	_tmp14_ = g_strdup_printf (_ ("Certificate of %s"), _tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = (GtkDialog*) gtk_dialog_new_with_buttons (_tmp15_, NULL, flags, _ ("_OK"), GTK_RESPONSE_OK, NULL);
	g_object_ref_sink (_tmp16_);
	_tmp17_ = _tmp16_;
	_g_free0 (_tmp15_);
	_g_free0 (_tmp13_);
	dialog = _tmp17_;
	_tmp18_ = gtk_dialog_get_content_area (dialog);
	_tmp19_ = widget;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_widget_get_type (), GtkWidget));
	gtk_dialog_set_default_response (dialog, (gint) GTK_RESPONSE_OK);
	gtk_window_set_default_size (G_TYPE_CHECK_INSTANCE_CAST (dialog, gtk_window_get_type (), GtkWindow), 640, -1);
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (dialog, gtk_widget_get_type (), GtkWidget));
	gtk_dialog_run (dialog);
	gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (dialog, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (dialog);
	_g_object_unref0 (widget);
	_g_object_unref0 (simple_cert);
}

static void
____lambda5__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	___lambda5_ ((PublishingPiwigoSSLErrorPane*) self);
}

static void
__lambda6_ (PublishingPiwigoSSLErrorPane* self)
{
	g_signal_emit (self, publishing_piwigo_ssl_error_pane_signals[PUBLISHING_PIWIGO_SSL_ERROR_PANE_PROCEED_SIGNAL], 0);
}

static void
___lambda6__gtk_button_clicked (GtkButton* _sender,
                                gpointer self)
{
	__lambda6_ ((PublishingPiwigoSSLErrorPane*) self);
}

static void
publishing_piwigo_ssl_error_pane_real_constructed (GObject* base)
{
	PublishingPiwigoSSLErrorPane * self;
	GtkLabel* label = NULL;
	GtkBuilder* _tmp0_;
	GtkBuilder* _tmp1_;
	GObject* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	gchar* bold_host = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GtkLabel* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	GtkLabel* _tmp14_;
	GtkBuilder* _tmp15_;
	GtkBuilder* _tmp16_;
	GObject* _tmp17_;
	GtkLabel* _tmp18_;
	GtkLabel* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	GtkButton* info = NULL;
	GtkBuilder* _tmp23_;
	GtkBuilder* _tmp24_;
	GObject* _tmp25_;
	GtkButton* _tmp26_;
	GtkButton* _tmp27_;
	GTlsCertificate* _tmp28_;
	GtkButton* proceed = NULL;
	GtkBuilder* _tmp33_;
	GtkBuilder* _tmp34_;
	GObject* _tmp35_;
	GtkButton* _tmp36_;
	GtkButton* _tmp37_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE, PublishingPiwigoSSLErrorPane);
	G_OBJECT_CLASS (publishing_piwigo_ssl_error_pane_parent_class)->constructed (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane), G_TYPE_OBJECT, GObject));
	_tmp0_ = shotwell_plugins_common_builder_pane_get_builder (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "main_text");
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp2_) : NULL);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	label = _tmp4_;
	_tmp5_ = publishing_piwigo_ssl_error_pane_get_host (self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf ("<b>%s</b>", _tmp7_);
	_tmp9_ = _tmp8_;
	_g_free0 (_tmp7_);
	bold_host = _tmp9_;
	_tmp10_ = label;
	_tmp11_ = bold_host;
	_tmp12_ = g_strdup_printf (_ ("This does not look like the real %s. Attackers might be trying to stea" \
"l or alter information going to or from this site (for example, privat" \
"e messages, credit card information, or passwords)."), _tmp11_);
	_tmp13_ = _tmp12_;
	gtk_label_set_text (_tmp10_, _tmp13_);
	_g_free0 (_tmp13_);
	_tmp14_ = label;
	gtk_label_set_use_markup (_tmp14_, TRUE);
	_tmp15_ = shotwell_plugins_common_builder_pane_get_builder (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	_tmp16_ = _tmp15_;
	_tmp17_ = gtk_builder_get_object (_tmp16_, "ssl_errors");
	_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp17_) : NULL);
	_g_object_unref0 (label);
	label = _tmp18_;
	_g_object_unref0 (_tmp16_);
	_tmp19_ = label;
	_tmp20_ = publishing_piwigo_ssl_error_pane_get_error_text (self);
	_tmp21_ = _tmp20_;
	_tmp22_ = _tmp21_;
	gtk_label_set_text (_tmp19_, _tmp22_);
	_g_free0 (_tmp22_);
	_tmp23_ = shotwell_plugins_common_builder_pane_get_builder (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	_tmp24_ = _tmp23_;
	_tmp25_ = gtk_builder_get_object (_tmp24_, "default");
	_tmp26_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp25_, gtk_button_get_type ()) ? ((GtkButton*) _tmp25_) : NULL);
	_tmp27_ = _tmp26_;
	_g_object_unref0 (_tmp24_);
	info = _tmp27_;
	_tmp28_ = self->priv->_cert;
	if (_tmp28_ != NULL) {
		GtkButton* _tmp29_;
		_tmp29_ = info;
		g_signal_connect_object (_tmp29_, "clicked", (GCallback) ____lambda5__gtk_button_clicked, self, 0);
	} else {
		GtkButton* _tmp30_;
		GtkContainer* _tmp31_;
		GtkButton* _tmp32_;
		_tmp30_ = info;
		_tmp31_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_widget_get_type (), GtkWidget));
		_tmp32_ = info;
		gtk_container_remove (_tmp31_, G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_widget_get_type (), GtkWidget));
	}
	_tmp33_ = shotwell_plugins_common_builder_pane_get_builder (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	_tmp34_ = _tmp33_;
	_tmp35_ = gtk_builder_get_object (_tmp34_, "proceed_button");
	_tmp36_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp35_, gtk_button_get_type ()) ? ((GtkButton*) _tmp35_) : NULL);
	_tmp37_ = _tmp36_;
	_g_object_unref0 (_tmp34_);
	proceed = _tmp37_;
	g_signal_connect_object (proceed, "clicked", (GCallback) ___lambda6__gtk_button_clicked, self, 0);
	_g_object_unref0 (proceed);
	_g_object_unref0 (info);
	_g_free0 (bold_host);
	_g_object_unref0 (label);
}

gchar*
publishing_piwigo_ssl_error_pane_get_host (PublishingPiwigoSSLErrorPane* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SSL_ERROR_PANE (self), NULL);
	_tmp0_ = self->priv->_host;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
publishing_piwigo_ssl_error_pane_set_host (PublishingPiwigoSSLErrorPane* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_SSL_ERROR_PANE (self));
	old_value = publishing_piwigo_ssl_error_pane_get_host (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_host);
		self->priv->_host = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_ssl_error_pane_properties[PUBLISHING_PIWIGO_SSL_ERROR_PANE_HOST_PROPERTY]);
	}
	_g_free0 (old_value);
}

static GTlsCertificate*
publishing_piwigo_ssl_error_pane_get_cert (PublishingPiwigoSSLErrorPane* self)
{
	GTlsCertificate* result;
	GTlsCertificate* _tmp0_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SSL_ERROR_PANE (self), NULL);
	_tmp0_ = self->priv->_cert;
	result = _tmp0_;
	return result;
}

static void
publishing_piwigo_ssl_error_pane_set_cert (PublishingPiwigoSSLErrorPane* self,
                                           GTlsCertificate* value)
{
	GTlsCertificate* old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_SSL_ERROR_PANE (self));
	old_value = publishing_piwigo_ssl_error_pane_get_cert (self);
	if (old_value != value) {
		GTlsCertificate* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_cert);
		self->priv->_cert = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_ssl_error_pane_properties[PUBLISHING_PIWIGO_SSL_ERROR_PANE_CERT_PROPERTY]);
	}
}

gchar*
publishing_piwigo_ssl_error_pane_get_error_text (PublishingPiwigoSSLErrorPane* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SSL_ERROR_PANE (self), NULL);
	_tmp0_ = self->priv->_error_text;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
publishing_piwigo_ssl_error_pane_set_error_text (PublishingPiwigoSSLErrorPane* self,
                                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_SSL_ERROR_PANE (self));
	old_value = publishing_piwigo_ssl_error_pane_get_error_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_error_text);
		self->priv->_error_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_ssl_error_pane_properties[PUBLISHING_PIWIGO_SSL_ERROR_PANE_ERROR_TEXT_PROPERTY]);
	}
	_g_free0 (old_value);
}

static void
publishing_piwigo_ssl_error_pane_class_init (PublishingPiwigoSSLErrorPaneClass * klass,
                                             gpointer klass_data)
{
	publishing_piwigo_ssl_error_pane_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingPiwigoSSLErrorPane_private_offset);
	((GObjectClass *) klass)->constructed = (void (*) (GObject*)) publishing_piwigo_ssl_error_pane_real_constructed;
	G_OBJECT_CLASS (klass)->get_property = _vala_publishing_piwigo_ssl_error_pane_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_publishing_piwigo_ssl_error_pane_set_property;
	G_OBJECT_CLASS (klass)->finalize = publishing_piwigo_ssl_error_pane_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_SSL_ERROR_PANE_HOST_PROPERTY, publishing_piwigo_ssl_error_pane_properties[PUBLISHING_PIWIGO_SSL_ERROR_PANE_HOST_PROPERTY] = g_param_spec_string ("host", "host", "host", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_SSL_ERROR_PANE_CERT_PROPERTY, publishing_piwigo_ssl_error_pane_properties[PUBLISHING_PIWIGO_SSL_ERROR_PANE_CERT_PROPERTY] = g_param_spec_object ("cert", "cert", "cert", g_tls_certificate_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_SSL_ERROR_PANE_ERROR_TEXT_PROPERTY, publishing_piwigo_ssl_error_pane_properties[PUBLISHING_PIWIGO_SSL_ERROR_PANE_ERROR_TEXT_PROPERTY] = g_param_spec_string ("error-text", "error-text", "error-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	publishing_piwigo_ssl_error_pane_signals[PUBLISHING_PIWIGO_SSL_ERROR_PANE_PROCEED_SIGNAL] = g_signal_new ("proceed", PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
publishing_piwigo_ssl_error_pane_instance_init (PublishingPiwigoSSLErrorPane * self,
                                                gpointer klass)
{
	self->priv = publishing_piwigo_ssl_error_pane_get_instance_private (self);
}

static void
publishing_piwigo_ssl_error_pane_finalize (GObject * obj)
{
	PublishingPiwigoSSLErrorPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE, PublishingPiwigoSSLErrorPane);
	_g_free0 (self->priv->_host);
	_g_object_unref0 (self->priv->_cert);
	_g_free0 (self->priv->_error_text);
	G_OBJECT_CLASS (publishing_piwigo_ssl_error_pane_parent_class)->finalize (obj);
}

static GType
publishing_piwigo_ssl_error_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoSSLErrorPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_ssl_error_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoSSLErrorPane), 0, (GInstanceInitFunc) publishing_piwigo_ssl_error_pane_instance_init, NULL };
	GType publishing_piwigo_ssl_error_pane_type_id;
	publishing_piwigo_ssl_error_pane_type_id = g_type_register_static (SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, "PublishingPiwigoSSLErrorPane", &g_define_type_info, 0);
	PublishingPiwigoSSLErrorPane_private_offset = g_type_add_instance_private (publishing_piwigo_ssl_error_pane_type_id, sizeof (PublishingPiwigoSSLErrorPanePrivate));
	return publishing_piwigo_ssl_error_pane_type_id;
}

GType
publishing_piwigo_ssl_error_pane_get_type (void)
{
	static volatile gsize publishing_piwigo_ssl_error_pane_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_ssl_error_pane_type_id__once)) {
		GType publishing_piwigo_ssl_error_pane_type_id;
		publishing_piwigo_ssl_error_pane_type_id = publishing_piwigo_ssl_error_pane_get_type_once ();
		g_once_init_leave (&publishing_piwigo_ssl_error_pane_type_id__once, publishing_piwigo_ssl_error_pane_type_id);
	}
	return publishing_piwigo_ssl_error_pane_type_id__once;
}

static void
_vala_publishing_piwigo_ssl_error_pane_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec)
{
	PublishingPiwigoSSLErrorPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE, PublishingPiwigoSSLErrorPane);
	switch (property_id) {
		case PUBLISHING_PIWIGO_SSL_ERROR_PANE_HOST_PROPERTY:
		g_value_take_string (value, publishing_piwigo_ssl_error_pane_get_host (self));
		break;
		case PUBLISHING_PIWIGO_SSL_ERROR_PANE_CERT_PROPERTY:
		g_value_set_object (value, publishing_piwigo_ssl_error_pane_get_cert (self));
		break;
		case PUBLISHING_PIWIGO_SSL_ERROR_PANE_ERROR_TEXT_PROPERTY:
		g_value_take_string (value, publishing_piwigo_ssl_error_pane_get_error_text (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_publishing_piwigo_ssl_error_pane_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec)
{
	PublishingPiwigoSSLErrorPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PUBLISHING_PIWIGO_TYPE_SSL_ERROR_PANE, PublishingPiwigoSSLErrorPane);
	switch (property_id) {
		case PUBLISHING_PIWIGO_SSL_ERROR_PANE_HOST_PROPERTY:
		publishing_piwigo_ssl_error_pane_set_host (self, g_value_get_string (value));
		break;
		case PUBLISHING_PIWIGO_SSL_ERROR_PANE_CERT_PROPERTY:
		publishing_piwigo_ssl_error_pane_set_cert (self, g_value_get_object (value));
		break;
		case PUBLISHING_PIWIGO_SSL_ERROR_PANE_ERROR_TEXT_PROPERTY:
		publishing_piwigo_ssl_error_pane_set_error_text (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
publishing_piwigo_authentication_pane_get_instance_private (PublishingPiwigoAuthenticationPane* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingPiwigoAuthenticationPane_private_offset);
}

static GType
publishing_piwigo_authentication_pane_mode_get_type_once (void)
{
	static const GEnumValue values[] = {{PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_INTRO, "PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_INTRO", "intro"}, {PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_FAILED_RETRY_URL, "PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_FAILED_RETRY_URL", "failed-retry-url"}, {PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_FAILED_RETRY_USER, "PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_FAILED_RETRY_USER", "failed-retry-user"}, {0, NULL, NULL}};
	GType publishing_piwigo_authentication_pane_mode_type_id;
	publishing_piwigo_authentication_pane_mode_type_id = g_enum_register_static ("PublishingPiwigoAuthenticationPaneMode", values);
	return publishing_piwigo_authentication_pane_mode_type_id;
}

GType
publishing_piwigo_authentication_pane_mode_get_type (void)
{
	static volatile gsize publishing_piwigo_authentication_pane_mode_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_authentication_pane_mode_type_id__once)) {
		GType publishing_piwigo_authentication_pane_mode_type_id;
		publishing_piwigo_authentication_pane_mode_type_id = publishing_piwigo_authentication_pane_mode_get_type_once ();
		g_once_init_leave (&publishing_piwigo_authentication_pane_mode_type_id__once, publishing_piwigo_authentication_pane_mode_type_id);
	}
	return publishing_piwigo_authentication_pane_mode_type_id__once;
}

PublishingPiwigoAuthenticationPane*
publishing_piwigo_authentication_pane_construct (GType object_type,
                                                 PublishingPiwigoPiwigoPublisher* publisher,
                                                 PublishingPiwigoAuthenticationPaneMode mode)
{
	PublishingPiwigoAuthenticationPane * self = NULL;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (publisher), NULL);
	self = (PublishingPiwigoAuthenticationPane*) g_object_new (object_type, "resource-path", PLUGIN_RESOURCE_PATH "/piwigo_authentication_pane.ui", "connect-signals", TRUE, "default-id", "login_button", "mode", mode, "publisher", publisher, NULL);
	return self;
}

PublishingPiwigoAuthenticationPane*
publishing_piwigo_authentication_pane_new (PublishingPiwigoPiwigoPublisher* publisher,
                                           PublishingPiwigoAuthenticationPaneMode mode)
{
	return publishing_piwigo_authentication_pane_construct (PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE, publisher, mode);
}

static void
_publishing_piwigo_authentication_pane_on_user_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                             gpointer self)
{
	publishing_piwigo_authentication_pane_on_user_changed ((PublishingPiwigoAuthenticationPane*) self);
}

static void
_publishing_piwigo_authentication_pane_on_url_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                            gpointer self)
{
	publishing_piwigo_authentication_pane_on_url_changed ((PublishingPiwigoAuthenticationPane*) self);
}

static void
_publishing_piwigo_authentication_pane_on_password_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                 gpointer self)
{
	publishing_piwigo_authentication_pane_on_password_changed ((PublishingPiwigoAuthenticationPane*) self);
}

static void
_publishing_piwigo_authentication_pane_on_login_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                   gpointer self)
{
	publishing_piwigo_authentication_pane_on_login_button_clicked ((PublishingPiwigoAuthenticationPane*) self);
}

static void
publishing_piwigo_authentication_pane_real_constructed (GObject* base)
{
	PublishingPiwigoAuthenticationPane * self;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp0_;
	GtkLabel* message_label = NULL;
	GtkBuilder* _tmp1_;
	GObject* _tmp2_;
	GtkLabel* _tmp3_;
	PublishingPiwigoAuthenticationPaneMode _tmp4_;
	GtkBuilder* _tmp15_;
	GObject* _tmp16_;
	GtkEntry* _tmp17_;
	gchar* persistent_url = NULL;
	PublishingPiwigoPiwigoPublisher* _tmp18_;
	gchar* _tmp19_;
	const gchar* _tmp20_;
	GtkBuilder* _tmp23_;
	GObject* _tmp24_;
	GtkEntry* _tmp25_;
	gchar* persistent_username = NULL;
	PublishingPiwigoPiwigoPublisher* _tmp26_;
	gchar* _tmp27_;
	const gchar* _tmp28_;
	GtkBuilder* _tmp31_;
	GObject* _tmp32_;
	GtkEntry* _tmp33_;
	gchar* persistent_password = NULL;
	PublishingPiwigoPiwigoPublisher* _tmp34_;
	const gchar* _tmp35_;
	const gchar* _tmp36_;
	gchar* _tmp37_;
	const gchar* _tmp38_;
	GtkBuilder* _tmp41_;
	GObject* _tmp42_;
	GtkSwitch* _tmp43_;
	GtkSwitch* _tmp44_;
	PublishingPiwigoPiwigoPublisher* _tmp45_;
	GtkBuilder* _tmp46_;
	GObject* _tmp47_;
	GtkButton* _tmp48_;
	GtkEntry* _tmp49_;
	GtkEntry* _tmp50_;
	GtkEntry* _tmp51_;
	GtkButton* _tmp52_;
	PublishingPiwigoPiwigoPublisher* _tmp53_;
	SpitPublishingPluginHost* _tmp54_;
	SpitPublishingPluginHost* _tmp55_;
	GtkButton* _tmp56_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE, PublishingPiwigoAuthenticationPane);
	G_OBJECT_CLASS (publishing_piwigo_authentication_pane_parent_class)->constructed (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane), G_TYPE_OBJECT, GObject));
	_tmp0_ = shotwell_plugins_common_builder_pane_get_builder (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	builder = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "message_label");
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp2_) : NULL);
	message_label = _tmp3_;
	_tmp4_ = self->priv->_mode;
	switch (_tmp4_) {
		case PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_INTRO:
		{
			GtkLabel* _tmp5_;
			const gchar* _tmp6_;
			_tmp5_ = message_label;
			_tmp6_ = publishing_piwigo_authentication_pane_INTRO_MESSAGE;
			gtk_label_set_text (_tmp5_, _tmp6_);
			break;
		}
		case PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_FAILED_RETRY_URL:
		{
			GtkLabel* _tmp7_;
			const gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp7_ = message_label;
			_tmp8_ = publishing_piwigo_authentication_pane_FAILED_RETRY_URL_MESSAGE;
			_tmp9_ = g_strdup_printf ("<b>%s</b>\n\n%s", _ ("Invalid URL"), _tmp8_);
			_tmp10_ = _tmp9_;
			gtk_label_set_markup (_tmp7_, _tmp10_);
			_g_free0 (_tmp10_);
			break;
		}
		case PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_FAILED_RETRY_USER:
		{
			GtkLabel* _tmp11_;
			const gchar* _tmp12_;
			gchar* _tmp13_;
			gchar* _tmp14_;
			_tmp11_ = message_label;
			_tmp12_ = publishing_piwigo_authentication_pane_FAILED_RETRY_USER_MESSAGE;
			_tmp13_ = g_strdup_printf ("<b>%s</b>\n\n%s", _ ("Invalid User Name or Password"), _tmp12_);
			_tmp14_ = _tmp13_;
			gtk_label_set_markup (_tmp11_, _tmp14_);
			_g_free0 (_tmp14_);
			break;
		}
		default:
		break;
	}
	_tmp15_ = builder;
	_tmp16_ = gtk_builder_get_object (_tmp15_, "url_entry");
	_tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp16_) : NULL);
	_g_object_unref0 (self->priv->url_entry);
	self->priv->url_entry = _tmp17_;
	_tmp18_ = self->priv->_publisher;
	_tmp19_ = publishing_piwigo_piwigo_publisher_get_persistent_url (_tmp18_);
	persistent_url = _tmp19_;
	_tmp20_ = persistent_url;
	if (_tmp20_ != NULL) {
		GtkEntry* _tmp21_;
		const gchar* _tmp22_;
		_tmp21_ = self->priv->url_entry;
		_tmp22_ = persistent_url;
		gtk_entry_set_text (_tmp21_, _tmp22_);
	}
	_tmp23_ = builder;
	_tmp24_ = gtk_builder_get_object (_tmp23_, "username_entry");
	_tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp24_) : NULL);
	_g_object_unref0 (self->priv->username_entry);
	self->priv->username_entry = _tmp25_;
	_tmp26_ = self->priv->_publisher;
	_tmp27_ = publishing_piwigo_piwigo_publisher_get_persistent_username (_tmp26_);
	persistent_username = _tmp27_;
	_tmp28_ = persistent_username;
	if (_tmp28_ != NULL) {
		GtkEntry* _tmp29_;
		const gchar* _tmp30_;
		_tmp29_ = self->priv->username_entry;
		_tmp30_ = persistent_username;
		gtk_entry_set_text (_tmp29_, _tmp30_);
	}
	_tmp31_ = builder;
	_tmp32_ = gtk_builder_get_object (_tmp31_, "password_entry");
	_tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp32_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp32_) : NULL);
	_g_object_unref0 (self->priv->password_entry);
	self->priv->password_entry = _tmp33_;
	_tmp34_ = self->priv->_publisher;
	_tmp35_ = persistent_url;
	_tmp36_ = persistent_username;
	_tmp37_ = publishing_piwigo_piwigo_publisher_get_persistent_password (_tmp34_, _tmp35_, _tmp36_);
	persistent_password = _tmp37_;
	_tmp38_ = persistent_password;
	if (_tmp38_ != NULL) {
		GtkEntry* _tmp39_;
		const gchar* _tmp40_;
		_tmp39_ = self->priv->password_entry;
		_tmp40_ = persistent_password;
		gtk_entry_set_text (_tmp39_, _tmp40_);
	}
	_tmp41_ = builder;
	_tmp42_ = gtk_builder_get_object (_tmp41_, "remember_password_checkbutton");
	_tmp43_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp42_, gtk_switch_get_type ()) ? ((GtkSwitch*) _tmp42_) : NULL);
	_g_object_unref0 (self->priv->remember_password_checkbutton);
	self->priv->remember_password_checkbutton = _tmp43_;
	_tmp44_ = self->priv->remember_password_checkbutton;
	_tmp45_ = self->priv->_publisher;
	gtk_switch_set_active (_tmp44_, publishing_piwigo_piwigo_publisher_get_remember_password (_tmp45_));
	_tmp46_ = builder;
	_tmp47_ = gtk_builder_get_object (_tmp46_, "login_button");
	_tmp48_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp47_, gtk_button_get_type ()) ? ((GtkButton*) _tmp47_) : NULL);
	_g_object_unref0 (self->priv->login_button);
	self->priv->login_button = _tmp48_;
	_tmp49_ = self->priv->username_entry;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _publishing_piwigo_authentication_pane_on_user_changed_gtk_editable_changed, self, 0);
	_tmp50_ = self->priv->url_entry;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _publishing_piwigo_authentication_pane_on_url_changed_gtk_editable_changed, self, 0);
	_tmp51_ = self->priv->password_entry;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _publishing_piwigo_authentication_pane_on_password_changed_gtk_editable_changed, self, 0);
	_tmp52_ = self->priv->login_button;
	g_signal_connect_object (_tmp52_, "clicked", (GCallback) _publishing_piwigo_authentication_pane_on_login_button_clicked_gtk_button_clicked, self, 0);
	_tmp53_ = self->priv->_publisher;
	_tmp54_ = publishing_piwigo_piwigo_publisher_get_host (_tmp53_);
	_tmp55_ = _tmp54_;
	_tmp56_ = self->priv->login_button;
	spit_publishing_plugin_host_set_dialog_default_widget (_tmp55_, G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (_tmp55_);
	_g_free0 (persistent_password);
	_g_free0 (persistent_username);
	_g_free0 (persistent_url);
	_g_object_unref0 (message_label);
	_g_object_unref0 (builder);
}

static void
publishing_piwigo_authentication_pane_on_login_button_clicked (PublishingPiwigoAuthenticationPane* self)
{
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	GtkEntry* _tmp2_;
	const gchar* _tmp3_;
	GtkEntry* _tmp4_;
	const gchar* _tmp5_;
	GtkSwitch* _tmp6_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE (self));
	_tmp0_ = self->priv->url_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	_tmp2_ = self->priv->username_entry;
	_tmp3_ = gtk_entry_get_text (_tmp2_);
	_tmp4_ = self->priv->password_entry;
	_tmp5_ = gtk_entry_get_text (_tmp4_);
	_tmp6_ = self->priv->remember_password_checkbutton;
	g_signal_emit (self, publishing_piwigo_authentication_pane_signals[PUBLISHING_PIWIGO_AUTHENTICATION_PANE_LOGIN_SIGNAL], 0, _tmp1_, _tmp3_, _tmp5_, gtk_switch_get_active (_tmp6_));
}

static void
publishing_piwigo_authentication_pane_on_url_changed (PublishingPiwigoAuthenticationPane* self)
{
	g_return_if_fail (PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE (self));
	publishing_piwigo_authentication_pane_update_login_button_sensitivity (self);
}

static void
publishing_piwigo_authentication_pane_on_user_changed (PublishingPiwigoAuthenticationPane* self)
{
	g_return_if_fail (PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE (self));
	publishing_piwigo_authentication_pane_update_login_button_sensitivity (self);
}

static void
publishing_piwigo_authentication_pane_on_password_changed (PublishingPiwigoAuthenticationPane* self)
{
	g_return_if_fail (PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE (self));
	publishing_piwigo_authentication_pane_update_login_button_sensitivity (self);
}

static void
publishing_piwigo_authentication_pane_update_login_button_sensitivity (PublishingPiwigoAuthenticationPane* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GtkEntry* _tmp2_;
	guint _tmp3_;
	guint _tmp4_;
	GtkButton* _tmp11_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE (self));
	_tmp2_ = self->priv->url_entry;
	_tmp3_ = gtk_entry_get_text_length (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ != ((guint) 0)) {
		GtkEntry* _tmp5_;
		guint _tmp6_;
		guint _tmp7_;
		_tmp5_ = self->priv->username_entry;
		_tmp6_ = gtk_entry_get_text_length (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_ != ((guint) 0);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GtkEntry* _tmp8_;
		guint _tmp9_;
		guint _tmp10_;
		_tmp8_ = self->priv->password_entry;
		_tmp9_ = gtk_entry_get_text_length (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = _tmp10_ != ((guint) 0);
	} else {
		_tmp0_ = FALSE;
	}
	_tmp11_ = self->priv->login_button;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget), _tmp0_);
}

static void
publishing_piwigo_authentication_pane_real_on_pane_installed (ShotwellPluginsCommonBuilderPane* base)
{
	PublishingPiwigoAuthenticationPane * self;
	GtkEntry* _tmp0_;
	GtkEntry* _tmp1_;
	GtkButton* _tmp2_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE, PublishingPiwigoAuthenticationPane);
	SHOTWELL_PLUGINS_COMMON_BUILDER_PANE_CLASS (publishing_piwigo_authentication_pane_parent_class)->on_pane_installed (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	_tmp0_ = self->priv->url_entry;
	gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = self->priv->password_entry;
	gtk_entry_set_activates_default (_tmp1_, TRUE);
	_tmp2_ = self->priv->login_button;
	gtk_widget_set_can_default (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), TRUE);
	publishing_piwigo_authentication_pane_update_login_button_sensitivity (self);
}

PublishingPiwigoAuthenticationPaneMode
publishing_piwigo_authentication_pane_get_mode (PublishingPiwigoAuthenticationPane* self)
{
	PublishingPiwigoAuthenticationPaneMode result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE (self), 0);
	result = self->priv->_mode;
	return result;
}

static void
publishing_piwigo_authentication_pane_set_mode (PublishingPiwigoAuthenticationPane* self,
                                                PublishingPiwigoAuthenticationPaneMode value)
{
	PublishingPiwigoAuthenticationPaneMode old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE (self));
	old_value = publishing_piwigo_authentication_pane_get_mode (self);
	if (old_value != value) {
		self->priv->_mode = value;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_authentication_pane_properties[PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_PROPERTY]);
	}
}

PublishingPiwigoPiwigoPublisher*
publishing_piwigo_authentication_pane_get_publisher (PublishingPiwigoAuthenticationPane* self)
{
	PublishingPiwigoPiwigoPublisher* result;
	PublishingPiwigoPiwigoPublisher* _tmp0_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE (self), NULL);
	_tmp0_ = self->priv->_publisher;
	result = _tmp0_;
	return result;
}

static void
publishing_piwigo_authentication_pane_set_publisher (PublishingPiwigoAuthenticationPane* self,
                                                     PublishingPiwigoPiwigoPublisher* value)
{
	PublishingPiwigoPiwigoPublisher* old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_AUTHENTICATION_PANE (self));
	old_value = publishing_piwigo_authentication_pane_get_publisher (self);
	if (old_value != value) {
		self->priv->_publisher = value;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_authentication_pane_properties[PUBLISHING_PIWIGO_AUTHENTICATION_PANE_PUBLISHER_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_VOID__STRING_STRING_STRING_BOOLEAN (GClosure * closure,
                                                            GValue * return_value,
                                                            guint n_param_values,
                                                            const GValue * param_values,
                                                            gpointer invocation_hint,
                                                            gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING_BOOLEAN) (gpointer data1, const char* arg_1, const char* arg_2, const char* arg_3, gboolean arg_4, gpointer data2);
	register GMarshalFunc_VOID__STRING_STRING_STRING_BOOLEAN callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 5);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_STRING_STRING_BOOLEAN) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), g_value_get_string (param_values + 3), g_value_get_boolean (param_values + 4), data2);
}

static void
publishing_piwigo_authentication_pane_class_init (PublishingPiwigoAuthenticationPaneClass * klass,
                                                  gpointer klass_data)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	publishing_piwigo_authentication_pane_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingPiwigoAuthenticationPane_private_offset);
	((GObjectClass *) klass)->constructed = (void (*) (GObject*)) publishing_piwigo_authentication_pane_real_constructed;
	((ShotwellPluginsCommonBuilderPaneClass *) klass)->on_pane_installed = (void (*) (ShotwellPluginsCommonBuilderPane*)) publishing_piwigo_authentication_pane_real_on_pane_installed;
	G_OBJECT_CLASS (klass)->get_property = _vala_publishing_piwigo_authentication_pane_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_publishing_piwigo_authentication_pane_set_property;
	G_OBJECT_CLASS (klass)->finalize = publishing_piwigo_authentication_pane_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_PROPERTY, publishing_piwigo_authentication_pane_properties[PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_PROPERTY] = g_param_spec_enum ("mode", "mode", "mode", PUBLISHING_PIWIGO_AUTHENTICATION_PANE_TYPE_MODE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_AUTHENTICATION_PANE_PUBLISHER_PROPERTY, publishing_piwigo_authentication_pane_properties[PUBLISHING_PIWIGO_AUTHENTICATION_PANE_PUBLISHER_PROPERTY] = g_param_spec_object ("publisher", "publisher", "publisher", PUBLISHING_PIWIGO_TYPE_PIWIGO_PUBLISHER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	publishing_piwigo_authentication_pane_signals[PUBLISHING_PIWIGO_AUTHENTICATION_PANE_LOGIN_SIGNAL] = g_signal_new ("login", PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING_STRING_BOOLEAN, G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
	_tmp0_ = g_strdup (_ ("Enter the URL of your Piwigo photo library as well as the username and" \
" password associated with your Piwigo account for that library."));
	publishing_piwigo_authentication_pane_INTRO_MESSAGE = _tmp0_;
	_tmp1_ = g_strdup (_ ("Shotwell cannot contact your Piwigo photo library. Please verify the U" \
"RL you entered"));
	publishing_piwigo_authentication_pane_FAILED_RETRY_URL_MESSAGE = _tmp1_;
	_tmp2_ = g_strdup (_ ("Username and/or password invalid. Please try again"));
	publishing_piwigo_authentication_pane_FAILED_RETRY_USER_MESSAGE = _tmp2_;
}

static void
publishing_piwigo_authentication_pane_instance_init (PublishingPiwigoAuthenticationPane * self,
                                                     gpointer klass)
{
	self->priv = publishing_piwigo_authentication_pane_get_instance_private (self);
}

static void
publishing_piwigo_authentication_pane_finalize (GObject * obj)
{
	PublishingPiwigoAuthenticationPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE, PublishingPiwigoAuthenticationPane);
	_g_object_unref0 (self->priv->url_entry);
	_g_object_unref0 (self->priv->username_entry);
	_g_object_unref0 (self->priv->password_entry);
	_g_object_unref0 (self->priv->remember_password_checkbutton);
	_g_object_unref0 (self->priv->login_button);
	G_OBJECT_CLASS (publishing_piwigo_authentication_pane_parent_class)->finalize (obj);
}

/**
 * The authentication pane used when asking service URL, user name and password
 * from the user.
 */
static GType
publishing_piwigo_authentication_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoAuthenticationPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_authentication_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoAuthenticationPane), 0, (GInstanceInitFunc) publishing_piwigo_authentication_pane_instance_init, NULL };
	GType publishing_piwigo_authentication_pane_type_id;
	publishing_piwigo_authentication_pane_type_id = g_type_register_static (SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, "PublishingPiwigoAuthenticationPane", &g_define_type_info, 0);
	PublishingPiwigoAuthenticationPane_private_offset = g_type_add_instance_private (publishing_piwigo_authentication_pane_type_id, sizeof (PublishingPiwigoAuthenticationPanePrivate));
	return publishing_piwigo_authentication_pane_type_id;
}

GType
publishing_piwigo_authentication_pane_get_type (void)
{
	static volatile gsize publishing_piwigo_authentication_pane_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_authentication_pane_type_id__once)) {
		GType publishing_piwigo_authentication_pane_type_id;
		publishing_piwigo_authentication_pane_type_id = publishing_piwigo_authentication_pane_get_type_once ();
		g_once_init_leave (&publishing_piwigo_authentication_pane_type_id__once, publishing_piwigo_authentication_pane_type_id);
	}
	return publishing_piwigo_authentication_pane_type_id__once;
}

static void
_vala_publishing_piwigo_authentication_pane_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec)
{
	PublishingPiwigoAuthenticationPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE, PublishingPiwigoAuthenticationPane);
	switch (property_id) {
		case PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_PROPERTY:
		g_value_set_enum (value, publishing_piwigo_authentication_pane_get_mode (self));
		break;
		case PUBLISHING_PIWIGO_AUTHENTICATION_PANE_PUBLISHER_PROPERTY:
		g_value_set_object (value, publishing_piwigo_authentication_pane_get_publisher (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_publishing_piwigo_authentication_pane_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec)
{
	PublishingPiwigoAuthenticationPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PUBLISHING_PIWIGO_TYPE_AUTHENTICATION_PANE, PublishingPiwigoAuthenticationPane);
	switch (property_id) {
		case PUBLISHING_PIWIGO_AUTHENTICATION_PANE_MODE_PROPERTY:
		publishing_piwigo_authentication_pane_set_mode (self, g_value_get_enum (value));
		break;
		case PUBLISHING_PIWIGO_AUTHENTICATION_PANE_PUBLISHER_PROPERTY:
		publishing_piwigo_authentication_pane_set_publisher (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
publishing_piwigo_publishing_options_pane_get_instance_private (PublishingPiwigoPublishingOptionsPane* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingPiwigoPublishingOptionsPane_private_offset);
}

static PublishingPiwigoCategory**
_vala_array_dup3 (PublishingPiwigoCategory** self,
                  gssize length)
{
	if (length >= 0) {
		PublishingPiwigoCategory** result;
		gssize i;
		result = g_new0 (PublishingPiwigoCategory*, length + 1);
		for (i = 0; i < length; i++) {
			PublishingPiwigoCategory* _tmp0_;
			_tmp0_ = _publishing_piwigo_category_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gboolean
_publishing_piwigo_category_equal_gee_equal_data_func (gconstpointer a,
                                                       gconstpointer b,
                                                       gpointer self)
{
	gboolean result;
	result = publishing_piwigo_category_equal ((PublishingPiwigoCategory*) a, (PublishingPiwigoCategory*) b);
	return result;
}

PublishingPiwigoPublishingOptionsPane*
publishing_piwigo_publishing_options_pane_construct (GType object_type,
                                                     PublishingPiwigoPiwigoPublisher* publisher,
                                                     PublishingPiwigoCategory** categories,
                                                     gint categories_length1,
                                                     gint last_category,
                                                     gint last_permission_level,
                                                     gint last_photo_size,
                                                     gboolean last_title_as_comment,
                                                     gboolean last_no_upload_tags,
                                                     gboolean last_no_upload_ratings,
                                                     gboolean strip_metadata_enabled)
{
	PublishingPiwigoPublishingOptionsPane * self = NULL;
	PublishingPiwigoCategory** _tmp0_;
	gint _tmp0__length1;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (publisher), NULL);
	_tmp0_ = (categories != NULL) ? _vala_array_dup3 (categories, categories_length1) : categories;
	_tmp0__length1 = categories_length1;
	_tmp1_ = gee_array_list_new_wrap (PUBLISHING_PIWIGO_TYPE_CATEGORY, (GBoxedCopyFunc) publishing_piwigo_category_ref, (GDestroyNotify) publishing_piwigo_category_unref, _tmp0_, _tmp0__length1, _publishing_piwigo_category_equal_gee_equal_data_func, NULL, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = publishing_piwigo_publishing_options_pane_get_common_comment_if_possible (publisher);
	_tmp4_ = _tmp3_;
	self = (PublishingPiwigoPublishingOptionsPane*) g_object_new (object_type, "resource-path", PLUGIN_RESOURCE_PATH "/piwigo_publishing_options_pane.ui", "connect-signals", TRUE, "default-id", "publish_button", "last-category", last_category, "last-permission-level", last_permission_level, "last-photo-size", last_photo_size, "last-title-as-comment", last_title_as_comment, "last-no-upload-tags", last_no_upload_tags, "last-no-upload-ratings", last_no_upload_ratings, "strip-metadata-enabled", strip_metadata_enabled, "existing-categories", _tmp2_, "default-comment", _tmp4_, NULL);
	_g_free0 (_tmp4_);
	_g_object_unref0 (_tmp2_);
	return self;
}

PublishingPiwigoPublishingOptionsPane*
publishing_piwigo_publishing_options_pane_new (PublishingPiwigoPiwigoPublisher* publisher,
                                               PublishingPiwigoCategory** categories,
                                               gint categories_length1,
                                               gint last_category,
                                               gint last_permission_level,
                                               gint last_photo_size,
                                               gboolean last_title_as_comment,
                                               gboolean last_no_upload_tags,
                                               gboolean last_no_upload_ratings,
                                               gboolean strip_metadata_enabled)
{
	return publishing_piwigo_publishing_options_pane_construct (PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, publisher, categories, categories_length1, last_category, last_permission_level, last_photo_size, last_title_as_comment, last_no_upload_tags, last_no_upload_ratings, strip_metadata_enabled);
}

static void
_publishing_piwigo_publishing_options_pane_on_logout_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                        gpointer self)
{
	publishing_piwigo_publishing_options_pane_on_logout_button_clicked ((PublishingPiwigoPublishingOptionsPane*) self);
}

static void
_publishing_piwigo_publishing_options_pane_on_publish_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                         gpointer self)
{
	publishing_piwigo_publishing_options_pane_on_publish_button_clicked ((PublishingPiwigoPublishingOptionsPane*) self);
}

static void
_publishing_piwigo_publishing_options_pane_on_use_existing_radio_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                             gpointer self)
{
	publishing_piwigo_publishing_options_pane_on_use_existing_radio_clicked ((PublishingPiwigoPublishingOptionsPane*) self);
}

static void
_publishing_piwigo_publishing_options_pane_on_create_new_radio_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                           gpointer self)
{
	publishing_piwigo_publishing_options_pane_on_create_new_radio_clicked ((PublishingPiwigoPublishingOptionsPane*) self);
}

static void
_publishing_piwigo_publishing_options_pane_on_new_category_entry_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                               gpointer self)
{
	publishing_piwigo_publishing_options_pane_on_new_category_entry_changed ((PublishingPiwigoPublishingOptionsPane*) self);
}

static void
_publishing_piwigo_publishing_options_pane_on_existing_combo_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                                            gpointer self)
{
	publishing_piwigo_publishing_options_pane_on_existing_combo_changed ((PublishingPiwigoPublishingOptionsPane*) self);
}

static void
publishing_piwigo_publishing_options_pane_real_constructed (GObject* base)
{
	PublishingPiwigoPublishingOptionsPane * self;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp0_;
	GObject* _tmp1_;
	GtkRadioButton* _tmp2_;
	GObject* _tmp3_;
	GtkRadioButton* _tmp4_;
	GObject* _tmp5_;
	GtkComboBoxText* _tmp6_;
	GObject* _tmp7_;
	GtkEntry* _tmp8_;
	GObject* _tmp9_;
	GtkLabel* _tmp10_;
	GObject* _tmp11_;
	GtkComboBoxText* _tmp12_;
	GObject* _tmp13_;
	GtkTextView* _tmp14_;
	GtkTextView* _tmp15_;
	GtkTextBuffer* _tmp16_;
	GtkTextBuffer* _tmp17_;
	GObject* _tmp18_;
	GtkLabel* _tmp19_;
	GObject* _tmp20_;
	GtkComboBoxText* _tmp21_;
	GObject* _tmp22_;
	GtkComboBoxText* _tmp23_;
	GObject* _tmp24_;
	GtkCheckButton* _tmp25_;
	GtkCheckButton* _tmp26_;
	gboolean _tmp27_;
	GObject* _tmp28_;
	GtkCheckButton* _tmp29_;
	GtkCheckButton* _tmp30_;
	gboolean _tmp31_;
	GObject* _tmp32_;
	GtkCheckButton* _tmp33_;
	GtkCheckButton* _tmp34_;
	gboolean _tmp35_;
	GObject* _tmp36_;
	GtkCheckButton* _tmp37_;
	GtkCheckButton* _tmp38_;
	gboolean _tmp39_;
	GObject* _tmp40_;
	GtkButton* _tmp41_;
	GtkButton* _tmp42_;
	GObject* _tmp43_;
	GtkButton* _tmp44_;
	GtkButton* _tmp45_;
	GtkRadioButton* _tmp46_;
	GtkRadioButton* _tmp47_;
	GtkEntry* _tmp48_;
	GtkComboBoxText* _tmp49_;
	gint _tmp50_ = 0;
	PublishingPiwigoPermissionLevel** _tmp51_;
	gint _tmp52_ = 0;
	PublishingPiwigoSizeEntry** _tmp53_;
	GtkTextView* _tmp54_;
	GtkTextBuffer* _tmp55_;
	GtkTextBuffer* _tmp56_;
	const gchar* _tmp57_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, PublishingPiwigoPublishingOptionsPane);
	G_OBJECT_CLASS (publishing_piwigo_publishing_options_pane_parent_class)->constructed (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane), G_TYPE_OBJECT, GObject));
	_tmp0_ = shotwell_plugins_common_builder_pane_get_builder (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	builder = _tmp0_;
	_tmp1_ = gtk_builder_get_object (builder, "use_existing_radio");
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_radio_button_get_type ()) ? ((GtkRadioButton*) _tmp1_) : NULL);
	_g_object_unref0 (self->priv->use_existing_radio);
	self->priv->use_existing_radio = _tmp2_;
	_tmp3_ = gtk_builder_get_object (builder, "create_new_radio");
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, gtk_radio_button_get_type ()) ? ((GtkRadioButton*) _tmp3_) : NULL);
	_g_object_unref0 (self->priv->create_new_radio);
	self->priv->create_new_radio = _tmp4_;
	_tmp5_ = gtk_builder_get_object (builder, "existing_categories_combo");
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_combo_box_text_get_type ()) ? ((GtkComboBoxText*) _tmp5_) : NULL);
	_g_object_unref0 (self->priv->existing_categories_combo);
	self->priv->existing_categories_combo = _tmp6_;
	_tmp7_ = gtk_builder_get_object (builder, "new_category_entry");
	_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp7_) : NULL);
	_g_object_unref0 (self->priv->new_category_entry);
	self->priv->new_category_entry = _tmp8_;
	_tmp9_ = gtk_builder_get_object (builder, "within_existing_label");
	_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp9_) : NULL);
	_g_object_unref0 (self->priv->within_existing_label);
	self->priv->within_existing_label = _tmp10_;
	_tmp11_ = gtk_builder_get_object (builder, "within_existing_combo");
	_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, gtk_combo_box_text_get_type ()) ? ((GtkComboBoxText*) _tmp11_) : NULL);
	_g_object_unref0 (self->priv->within_existing_combo);
	self->priv->within_existing_combo = _tmp12_;
	_tmp13_ = gtk_builder_get_object (builder, "album_comment");
	_tmp14_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, gtk_text_view_get_type ()) ? ((GtkTextView*) _tmp13_) : NULL);
	_g_object_unref0 (self->priv->album_comment);
	self->priv->album_comment = _tmp14_;
	_tmp15_ = self->priv->album_comment;
	_tmp16_ = gtk_text_buffer_new (NULL);
	_tmp17_ = _tmp16_;
	gtk_text_view_set_buffer (_tmp15_, _tmp17_);
	_g_object_unref0 (_tmp17_);
	_tmp18_ = gtk_builder_get_object (builder, "album_comment_label");
	_tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp18_) : NULL);
	_g_object_unref0 (self->priv->album_comment_label);
	self->priv->album_comment_label = _tmp19_;
	_tmp20_ = gtk_builder_get_object (builder, "perms_combo");
	_tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, gtk_combo_box_text_get_type ()) ? ((GtkComboBoxText*) _tmp20_) : NULL);
	_g_object_unref0 (self->priv->perms_combo);
	self->priv->perms_combo = _tmp21_;
	_tmp22_ = gtk_builder_get_object (builder, "size_combo");
	_tmp23_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp22_, gtk_combo_box_text_get_type ()) ? ((GtkComboBoxText*) _tmp22_) : NULL);
	_g_object_unref0 (self->priv->size_combo);
	self->priv->size_combo = _tmp23_;
	_tmp24_ = gtk_builder_get_object (builder, "strip_metadata_check");
	_tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, gtk_check_button_get_type ()) ? ((GtkCheckButton*) _tmp24_) : NULL);
	_g_object_unref0 (self->priv->strip_metadata_check);
	self->priv->strip_metadata_check = _tmp25_;
	_tmp26_ = self->priv->strip_metadata_check;
	_tmp27_ = self->priv->_strip_metadata_enabled;
	gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_toggle_button_get_type (), GtkToggleButton), _tmp27_);
	_tmp28_ = gtk_builder_get_object (builder, "title_as_comment_check");
	_tmp29_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp28_, gtk_check_button_get_type ()) ? ((GtkCheckButton*) _tmp28_) : NULL);
	_g_object_unref0 (self->priv->title_as_comment_check);
	self->priv->title_as_comment_check = _tmp29_;
	_tmp30_ = self->priv->title_as_comment_check;
	_tmp31_ = self->priv->_last_title_as_comment;
	gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_toggle_button_get_type (), GtkToggleButton), _tmp31_);
	_tmp32_ = gtk_builder_get_object (builder, "no_upload_tags_check");
	_tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp32_, gtk_check_button_get_type ()) ? ((GtkCheckButton*) _tmp32_) : NULL);
	_g_object_unref0 (self->priv->no_upload_tags_check);
	self->priv->no_upload_tags_check = _tmp33_;
	_tmp34_ = self->priv->no_upload_tags_check;
	_tmp35_ = self->priv->_last_no_upload_tags;
	gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, gtk_toggle_button_get_type (), GtkToggleButton), _tmp35_);
	_tmp36_ = gtk_builder_get_object (builder, "no_upload_ratings_check");
	_tmp37_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp36_, gtk_check_button_get_type ()) ? ((GtkCheckButton*) _tmp36_) : NULL);
	_g_object_unref0 (self->priv->no_upload_ratings_check);
	self->priv->no_upload_ratings_check = _tmp37_;
	_tmp38_ = self->priv->no_upload_ratings_check;
	_tmp39_ = self->priv->_last_no_upload_ratings;
	gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, gtk_toggle_button_get_type (), GtkToggleButton), _tmp39_);
	_tmp40_ = gtk_builder_get_object (builder, "logout_button");
	_tmp41_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp40_, gtk_button_get_type ()) ? ((GtkButton*) _tmp40_) : NULL);
	_g_object_unref0 (self->priv->logout_button);
	self->priv->logout_button = _tmp41_;
	_tmp42_ = self->priv->logout_button;
	g_signal_connect_object (_tmp42_, "clicked", (GCallback) _publishing_piwigo_publishing_options_pane_on_logout_button_clicked_gtk_button_clicked, self, 0);
	_tmp43_ = gtk_builder_get_object (builder, "publish_button");
	_tmp44_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp43_, gtk_button_get_type ()) ? ((GtkButton*) _tmp43_) : NULL);
	_g_object_unref0 (self->priv->publish_button);
	self->priv->publish_button = _tmp44_;
	_tmp45_ = self->priv->publish_button;
	g_signal_connect_object (_tmp45_, "clicked", (GCallback) _publishing_piwigo_publishing_options_pane_on_publish_button_clicked_gtk_button_clicked, self, 0);
	_tmp46_ = self->priv->use_existing_radio;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, gtk_button_get_type (), GtkButton), "clicked", (GCallback) _publishing_piwigo_publishing_options_pane_on_use_existing_radio_clicked_gtk_button_clicked, self, 0);
	_tmp47_ = self->priv->create_new_radio;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, gtk_button_get_type (), GtkButton), "clicked", (GCallback) _publishing_piwigo_publishing_options_pane_on_create_new_radio_clicked_gtk_button_clicked, self, 0);
	_tmp48_ = self->priv->new_category_entry;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _publishing_piwigo_publishing_options_pane_on_new_category_entry_changed_gtk_editable_changed, self, 0);
	_tmp49_ = self->priv->within_existing_combo;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _publishing_piwigo_publishing_options_pane_on_existing_combo_changed_gtk_combo_box_changed, self, 0);
	_tmp51_ = publishing_piwigo_publishing_options_pane_create_perm_levels (self, &_tmp50_);
	self->priv->perm_levels = (_vala_array_free (self->priv->perm_levels, self->priv->perm_levels_length1, (GDestroyNotify) publishing_piwigo_permission_level_unref), NULL);
	self->priv->perm_levels = _tmp51_;
	self->priv->perm_levels_length1 = _tmp50_;
	self->priv->_perm_levels_size_ = self->priv->perm_levels_length1;
	_tmp53_ = publishing_piwigo_publishing_options_pane_create_sizes (self, &_tmp52_);
	self->priv->photo_sizes = (_vala_array_free (self->priv->photo_sizes, self->priv->photo_sizes_length1, (GDestroyNotify) publishing_piwigo_size_entry_unref), NULL);
	self->priv->photo_sizes = _tmp53_;
	self->priv->photo_sizes_length1 = _tmp52_;
	self->priv->_photo_sizes_size_ = self->priv->photo_sizes_length1;
	_tmp54_ = self->priv->album_comment;
	_tmp55_ = gtk_text_view_get_buffer (_tmp54_);
	_tmp56_ = _tmp55_;
	_tmp57_ = self->priv->_default_comment;
	gtk_text_buffer_set_text (_tmp56_, _tmp57_, -1);
	_g_object_unref0 (builder);
}

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

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

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

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

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

static PublishingPiwigoPermissionLevel**
publishing_piwigo_publishing_options_pane_create_perm_levels (PublishingPiwigoPublishingOptionsPane* self,
                                                              gint* result_length1)
{
	PublishingPiwigoPermissionLevel** _result_ = NULL;
	PublishingPiwigoPermissionLevel** _tmp0_;
	gint _result__length1;
	gint __result__size_;
	PublishingPiwigoPermissionLevel* _tmp1_;
	PublishingPiwigoPermissionLevel* _tmp2_;
	PublishingPiwigoPermissionLevel* _tmp3_;
	PublishingPiwigoPermissionLevel* _tmp4_;
	PublishingPiwigoPermissionLevel* _tmp5_;
	PublishingPiwigoPermissionLevel** _tmp6_;
	gint _tmp6__length1;
	PublishingPiwigoPermissionLevel** result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), NULL);
	_tmp0_ = g_new0 (PublishingPiwigoPermissionLevel*, 0 + 1);
	_result_ = _tmp0_;
	_result__length1 = 0;
	__result__size_ = _result__length1;
	_tmp1_ = publishing_piwigo_permission_level_new (0, _ ("Everyone"));
	_vala_array_add25 (&_result_, &_result__length1, &__result__size_, _tmp1_);
	_tmp2_ = publishing_piwigo_permission_level_new (1, _ ("Admins, Family, Friends, Contacts"));
	_vala_array_add26 (&_result_, &_result__length1, &__result__size_, _tmp2_);
	_tmp3_ = publishing_piwigo_permission_level_new (2, _ ("Admins, Family, Friends"));
	_vala_array_add27 (&_result_, &_result__length1, &__result__size_, _tmp3_);
	_tmp4_ = publishing_piwigo_permission_level_new (4, _ ("Admins, Family"));
	_vala_array_add28 (&_result_, &_result__length1, &__result__size_, _tmp4_);
	_tmp5_ = publishing_piwigo_permission_level_new (8, _ ("Admins"));
	_vala_array_add29 (&_result_, &_result__length1, &__result__size_, _tmp5_);
	_tmp6_ = _result_;
	_tmp6__length1 = _result__length1;
	if (result_length1) {
		*result_length1 = _tmp6__length1;
	}
	result = _tmp6_;
	return result;
}

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

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

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

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

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

static PublishingPiwigoSizeEntry**
publishing_piwigo_publishing_options_pane_create_sizes (PublishingPiwigoPublishingOptionsPane* self,
                                                        gint* result_length1)
{
	PublishingPiwigoSizeEntry** _result_ = NULL;
	PublishingPiwigoSizeEntry** _tmp0_;
	gint _result__length1;
	gint __result__size_;
	PublishingPiwigoSizeEntry* _tmp1_;
	PublishingPiwigoSizeEntry* _tmp2_;
	PublishingPiwigoSizeEntry* _tmp3_;
	PublishingPiwigoSizeEntry* _tmp4_;
	PublishingPiwigoSizeEntry* _tmp5_;
	PublishingPiwigoSizeEntry** _tmp6_;
	gint _tmp6__length1;
	PublishingPiwigoSizeEntry** result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), NULL);
	_tmp0_ = g_new0 (PublishingPiwigoSizeEntry*, 0 + 1);
	_result_ = _tmp0_;
	_result__length1 = 0;
	__result__size_ = _result__length1;
	_tmp1_ = publishing_piwigo_size_entry_new (500, _ ("500 × 375 pixels"));
	_vala_array_add30 (&_result_, &_result__length1, &__result__size_, _tmp1_);
	_tmp2_ = publishing_piwigo_size_entry_new (1024, _ ("1024 × 768 pixels"));
	_vala_array_add31 (&_result_, &_result__length1, &__result__size_, _tmp2_);
	_tmp3_ = publishing_piwigo_size_entry_new (2048, _ ("2048 × 1536 pixels"));
	_vala_array_add32 (&_result_, &_result__length1, &__result__size_, _tmp3_);
	_tmp4_ = publishing_piwigo_size_entry_new (4096, _ ("4096 × 3072 pixels"));
	_vala_array_add33 (&_result_, &_result__length1, &__result__size_, _tmp4_);
	_tmp5_ = publishing_piwigo_size_entry_new (PUBLISHING_PIWIGO_ORIGINAL_SIZE, _ ("Original size"));
	_vala_array_add34 (&_result_, &_result__length1, &__result__size_, _tmp5_);
	_tmp6_ = _result_;
	_tmp6__length1 = _result__length1;
	if (result_length1) {
		*result_length1 = _tmp6__length1;
	}
	result = _tmp6_;
	return result;
}

static void
publishing_piwigo_publishing_options_pane_on_logout_button_clicked (PublishingPiwigoPublishingOptionsPane* self)
{
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	g_signal_emit (self, publishing_piwigo_publishing_options_pane_signals[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LOGOUT_SIGNAL], 0);
}

static gpointer
_publishing_piwigo_permission_level_ref0 (gpointer self)
{
	return self ? publishing_piwigo_permission_level_ref (self) : NULL;
}

static gpointer
_publishing_piwigo_size_entry_ref0 (gpointer self)
{
	return self ? publishing_piwigo_size_entry_ref (self) : NULL;
}

static void
publishing_piwigo_publishing_options_pane_on_publish_button_clicked (PublishingPiwigoPublishingOptionsPane* self)
{
	PublishingPiwigoPublishingParameters* params = NULL;
	PublishingPiwigoPublishingParameters* _tmp0_;
	PublishingPiwigoPublishingParameters* _tmp1_;
	PublishingPiwigoPermissionLevel** _tmp2_;
	gint _tmp2__length1;
	GtkComboBoxText* _tmp3_;
	PublishingPiwigoPermissionLevel* _tmp4_;
	PublishingPiwigoPermissionLevel* _tmp5_;
	PublishingPiwigoPublishingParameters* _tmp6_;
	PublishingPiwigoSizeEntry** _tmp7_;
	gint _tmp7__length1;
	GtkComboBoxText* _tmp8_;
	PublishingPiwigoSizeEntry* _tmp9_;
	PublishingPiwigoSizeEntry* _tmp10_;
	PublishingPiwigoPublishingParameters* _tmp11_;
	GtkCheckButton* _tmp12_;
	PublishingPiwigoPublishingParameters* _tmp13_;
	GtkCheckButton* _tmp14_;
	PublishingPiwigoPublishingParameters* _tmp15_;
	GtkCheckButton* _tmp16_;
	GtkRadioButton* _tmp17_;
	PublishingPiwigoPublishingParameters* _tmp45_;
	GtkCheckButton* _tmp46_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = publishing_piwigo_publishing_parameters_new ();
	params = _tmp0_;
	_tmp1_ = params;
	_tmp2_ = self->priv->perm_levels;
	_tmp2__length1 = self->priv->perm_levels_length1;
	_tmp3_ = self->priv->perms_combo;
	_tmp4_ = _tmp2_[gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_combo_box_get_type (), GtkComboBox))];
	_tmp5_ = _publishing_piwigo_permission_level_ref0 (_tmp4_);
	_publishing_piwigo_permission_level_unref0 (_tmp1_->perm_level);
	_tmp1_->perm_level = _tmp5_;
	_tmp6_ = params;
	_tmp7_ = self->priv->photo_sizes;
	_tmp7__length1 = self->priv->photo_sizes_length1;
	_tmp8_ = self->priv->size_combo;
	_tmp9_ = _tmp7_[gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_combo_box_get_type (), GtkComboBox))];
	_tmp10_ = _publishing_piwigo_size_entry_ref0 (_tmp9_);
	_publishing_piwigo_size_entry_unref0 (_tmp6_->photo_size);
	_tmp6_->photo_size = _tmp10_;
	_tmp11_ = params;
	_tmp12_ = self->priv->title_as_comment_check;
	_tmp11_->title_as_comment = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_toggle_button_get_type (), GtkToggleButton));
	_tmp13_ = params;
	_tmp14_ = self->priv->no_upload_tags_check;
	_tmp13_->no_upload_tags = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_toggle_button_get_type (), GtkToggleButton));
	_tmp15_ = params;
	_tmp16_ = self->priv->no_upload_ratings_check;
	_tmp15_->no_upload_ratings = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_toggle_button_get_type (), GtkToggleButton));
	_tmp17_ = self->priv->create_new_radio;
	if (gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_toggle_button_get_type (), GtkToggleButton))) {
		gchar* uploadcomment = NULL;
		GtkTextView* _tmp18_;
		GtkTextBuffer* _tmp19_;
		GtkTextBuffer* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		gchar* _tmp24_;
		gchar* _tmp25_;
		gint a = 0;
		GtkComboBoxText* _tmp26_;
		_tmp18_ = self->priv->album_comment;
		_tmp19_ = gtk_text_view_get_buffer (_tmp18_);
		_tmp20_ = _tmp19_;
		g_object_get (_tmp20_, "text", &_tmp21_, NULL);
		_tmp22_ = _tmp21_;
		_tmp23_ = _tmp22_;
		_tmp24_ = string_strip (_tmp23_);
		_tmp25_ = _tmp24_;
		_g_free0 (_tmp23_);
		uploadcomment = _tmp25_;
		_tmp26_ = self->priv->within_existing_combo;
		a = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_combo_box_get_type (), GtkComboBox));
		if (a == 0) {
			PublishingPiwigoPublishingParameters* _tmp27_;
			GtkEntry* _tmp28_;
			const gchar* _tmp29_;
			const gchar* _tmp30_;
			PublishingPiwigoCategory* _tmp31_;
			_tmp27_ = params;
			_tmp28_ = self->priv->new_category_entry;
			_tmp29_ = gtk_entry_get_text (_tmp28_);
			_tmp30_ = uploadcomment;
			_tmp31_ = publishing_piwigo_category_new_local (_tmp29_, 0, _tmp30_);
			_publishing_piwigo_category_unref0 (_tmp27_->category);
			_tmp27_->category = _tmp31_;
		} else {
			gint _tmp32_;
			PublishingPiwigoPublishingParameters* _tmp33_;
			GtkEntry* _tmp34_;
			const gchar* _tmp35_;
			GeeList* _tmp36_;
			gpointer _tmp37_;
			PublishingPiwigoCategory* _tmp38_;
			const gchar* _tmp39_;
			PublishingPiwigoCategory* _tmp40_;
			_tmp32_ = a;
			a = _tmp32_ - 1;
			_tmp33_ = params;
			_tmp34_ = self->priv->new_category_entry;
			_tmp35_ = gtk_entry_get_text (_tmp34_);
			_tmp36_ = self->priv->_existing_categories;
			_tmp37_ = gee_list_get (_tmp36_, a);
			_tmp38_ = (PublishingPiwigoCategory*) _tmp37_;
			_tmp39_ = uploadcomment;
			_tmp40_ = publishing_piwigo_category_new_local (_tmp35_, _tmp38_->id, _tmp39_);
			_publishing_piwigo_category_unref0 (_tmp33_->category);
			_tmp33_->category = _tmp40_;
			_publishing_piwigo_category_unref0 (_tmp38_);
		}
		_g_free0 (uploadcomment);
	} else {
		PublishingPiwigoPublishingParameters* _tmp41_;
		GeeList* _tmp42_;
		GtkComboBoxText* _tmp43_;
		gpointer _tmp44_;
		_tmp41_ = params;
		_tmp42_ = self->priv->_existing_categories;
		_tmp43_ = self->priv->existing_categories_combo;
		_tmp44_ = gee_list_get (_tmp42_, gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, gtk_combo_box_get_type (), GtkComboBox)));
		_publishing_piwigo_category_unref0 (_tmp41_->category);
		_tmp41_->category = (PublishingPiwigoCategory*) _tmp44_;
	}
	_tmp45_ = params;
	_tmp46_ = self->priv->strip_metadata_check;
	g_signal_emit (self, publishing_piwigo_publishing_options_pane_signals[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_PUBLISH_SIGNAL], 0, _tmp45_, gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, gtk_toggle_button_get_type (), GtkToggleButton)));
	_publishing_piwigo_publishing_parameters_unref0 (params);
}

static void
publishing_piwigo_publishing_options_pane_on_use_existing_radio_clicked (PublishingPiwigoPublishingOptionsPane* self)
{
	GtkComboBoxText* _tmp0_;
	GtkEntry* _tmp1_;
	GtkLabel* _tmp2_;
	GtkComboBoxText* _tmp3_;
	GtkComboBoxText* _tmp4_;
	GtkLabel* _tmp5_;
	GtkTextView* _tmp6_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->existing_categories_combo;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp1_ = self->priv->new_category_entry;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp2_ = self->priv->within_existing_label;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp3_ = self->priv->within_existing_combo;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp4_ = self->priv->existing_categories_combo;
	gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget));
	_tmp5_ = self->priv->album_comment_label;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp6_ = self->priv->album_comment;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), FALSE);
	publishing_piwigo_publishing_options_pane_update_publish_button_sensitivity (self);
}

static void
publishing_piwigo_publishing_options_pane_on_create_new_radio_clicked (PublishingPiwigoPublishingOptionsPane* self)
{
	GtkEntry* _tmp0_;
	GtkLabel* _tmp1_;
	GtkComboBoxText* _tmp2_;
	GtkLabel* _tmp3_;
	GtkTextView* _tmp4_;
	GtkComboBoxText* _tmp5_;
	GtkEntry* _tmp6_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->new_category_entry;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp1_ = self->priv->within_existing_label;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp2_ = self->priv->within_existing_combo;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp3_ = self->priv->album_comment_label;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp4_ = self->priv->album_comment;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp5_ = self->priv->existing_categories_combo;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp6_ = self->priv->new_category_entry;
	gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget));
	publishing_piwigo_publishing_options_pane_update_publish_button_sensitivity (self);
}

static void
publishing_piwigo_publishing_options_pane_on_new_category_entry_changed (PublishingPiwigoPublishingOptionsPane* self)
{
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	publishing_piwigo_publishing_options_pane_update_publish_button_sensitivity (self);
}

static void
publishing_piwigo_publishing_options_pane_on_existing_combo_changed (PublishingPiwigoPublishingOptionsPane* self)
{
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	publishing_piwigo_publishing_options_pane_update_publish_button_sensitivity (self);
}

static void
publishing_piwigo_publishing_options_pane_update_publish_button_sensitivity (PublishingPiwigoPublishingOptionsPane* self)
{
	gchar* category_name = NULL;
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint a = 0;
	GtkComboBoxText* _tmp3_;
	gchar* search_name = NULL;
	gboolean _tmp15_ = FALSE;
	GtkRadioButton* _tmp16_;
	GtkButton* _tmp20_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->new_category_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	_tmp2_ = string_strip (_tmp1_);
	category_name = _tmp2_;
	_tmp3_ = self->priv->within_existing_combo;
	a = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_combo_box_get_type (), GtkComboBox));
	if (a <= 0) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = category_name;
		_tmp5_ = g_strconcat ("/ ", _tmp4_, NULL);
		_g_free0 (search_name);
		search_name = _tmp5_;
	} else {
		gint _tmp6_;
		GeeList* _tmp7_;
		gpointer _tmp8_;
		PublishingPiwigoCategory* _tmp9_;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp6_ = a;
		a = _tmp6_ - 1;
		_tmp7_ = self->priv->_existing_categories;
		_tmp8_ = gee_list_get (_tmp7_, a);
		_tmp9_ = (PublishingPiwigoCategory*) _tmp8_;
		_tmp10_ = _tmp9_->display_name;
		_tmp11_ = g_strconcat (_tmp10_, "/ ", NULL);
		_tmp12_ = _tmp11_;
		_tmp13_ = category_name;
		_tmp14_ = g_strconcat (_tmp12_, _tmp13_, NULL);
		_g_free0 (search_name);
		search_name = _tmp14_;
		_g_free0 (_tmp12_);
		_publishing_piwigo_category_unref0 (_tmp9_);
	}
	_tmp16_ = self->priv->create_new_radio;
	if (gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_toggle_button_get_type (), GtkToggleButton))) {
		gboolean _tmp17_ = FALSE;
		const gchar* _tmp18_;
		_tmp18_ = category_name;
		if (g_strcmp0 (_tmp18_, "") == 0) {
			_tmp17_ = TRUE;
		} else {
			const gchar* _tmp19_;
			_tmp19_ = search_name;
			_tmp17_ = publishing_piwigo_publishing_options_pane_category_already_exists (self, _tmp19_);
		}
		_tmp15_ = _tmp17_;
	} else {
		_tmp15_ = FALSE;
	}
	_tmp20_ = self->priv->publish_button;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_widget_get_type (), GtkWidget), !_tmp15_);
	_g_free0 (search_name);
	_g_free0 (category_name);
}

static void
publishing_piwigo_publishing_options_pane_real_on_pane_installed (ShotwellPluginsCommonBuilderPane* base)
{
	PublishingPiwigoPublishingOptionsPane * self;
	GtkButton* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, PublishingPiwigoPublishingOptionsPane);
	SHOTWELL_PLUGINS_COMMON_BUILDER_PANE_CLASS (publishing_piwigo_publishing_options_pane_parent_class)->on_pane_installed (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, ShotwellPluginsCommonBuilderPane));
	publishing_piwigo_publishing_options_pane_create_categories_combo (self);
	publishing_piwigo_publishing_options_pane_create_within_categories_combo (self);
	publishing_piwigo_publishing_options_pane_create_permissions_combo (self);
	publishing_piwigo_publishing_options_pane_create_size_combo (self);
	_tmp0_ = self->priv->publish_button;
	gtk_widget_set_can_default (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), TRUE);
	publishing_piwigo_publishing_options_pane_update_publish_button_sensitivity (self);
}

static gchar*
publishing_piwigo_publishing_options_pane_get_common_comment_if_possible (PublishingPiwigoPiwigoPublisher* publisher)
{
	SpitPublishingPublishable** publishables = NULL;
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	gint _tmp2_ = 0;
	SpitPublishingPublishable** _tmp3_;
	SpitPublishingPublishable** _tmp4_;
	gint _tmp4__length1;
	gint publishables_length1;
	gint _publishables_size_;
	gchar* common = NULL;
	gchar* _tmp5_;
	gboolean isfirst = FALSE;
	SpitPublishingPublishable** _tmp6_;
	gint _tmp6__length1;
	const gchar* _tmp17_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PIWIGO_PUBLISHER (publisher), NULL);
	_tmp0_ = publishing_piwigo_piwigo_publisher_get_host (publisher);
	_tmp1_ = _tmp0_;
	_tmp3_ = spit_publishing_plugin_host_get_publishables (_tmp1_, &_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp4__length1 = _tmp2_;
	_g_object_unref0 (_tmp1_);
	publishables = _tmp4_;
	publishables_length1 = _tmp4__length1;
	_publishables_size_ = publishables_length1;
	_tmp5_ = g_strdup ("");
	common = _tmp5_;
	isfirst = TRUE;
	_tmp6_ = publishables;
	_tmp6__length1 = publishables_length1;
	if (_tmp6_ != NULL) {
		SpitPublishingPublishable** _tmp7_;
		gint _tmp7__length1;
		_tmp7_ = publishables;
		_tmp7__length1 = publishables_length1;
		{
			SpitPublishingPublishable** pub_collection = NULL;
			gint pub_collection_length1 = 0;
			gint _pub_collection_size_ = 0;
			gint pub_it = 0;
			pub_collection = _tmp7_;
			pub_collection_length1 = _tmp7__length1;
			for (pub_it = 0; pub_it < pub_collection_length1; pub_it = pub_it + 1) {
				SpitPublishingPublishable* _tmp8_;
				SpitPublishingPublishable* pub = NULL;
				_tmp8_ = _g_object_ref0 (pub_collection[pub_it]);
				pub = _tmp8_;
				{
					gchar* cur = NULL;
					SpitPublishingPublishable* _tmp9_;
					gchar* _tmp10_;
					const gchar* _tmp11_;
					_tmp9_ = pub;
					_tmp10_ = spit_publishing_publishable_get_param_string (_tmp9_, SPIT_PUBLISHING_PUBLISHABLE_PARAM_STRING_EVENTCOMMENT);
					cur = _tmp10_;
					_tmp11_ = cur;
					if (_tmp11_ == NULL) {
						_g_free0 (cur);
						_g_object_unref0 (pub);
						continue;
					}
					if (isfirst) {
						const gchar* _tmp12_;
						gchar* _tmp13_;
						_tmp12_ = cur;
						_tmp13_ = g_strdup (_tmp12_);
						_g_free0 (common);
						common = _tmp13_;
						isfirst = FALSE;
					} else {
						const gchar* _tmp14_;
						const gchar* _tmp15_;
						_tmp14_ = cur;
						_tmp15_ = common;
						if (g_strcmp0 (_tmp14_, _tmp15_) != 0) {
							gchar* _tmp16_;
							_tmp16_ = g_strdup ("");
							_g_free0 (common);
							common = _tmp16_;
							_g_free0 (cur);
							_g_object_unref0 (pub);
							break;
						}
					}
					_g_free0 (cur);
					_g_object_unref0 (pub);
				}
			}
		}
	}
	_tmp17_ = common;
	g_debug ("PiwigoPublishing.vala:1440: PiwigoConnector: found common event commen" \
"t %s\n", _tmp17_);
	result = common;
	publishables = (_vala_array_free (publishables, publishables_length1, (GDestroyNotify) g_object_unref), NULL);
	return result;
}

static void
publishing_piwigo_publishing_options_pane_create_categories_combo (PublishingPiwigoPublishingOptionsPane* self)
{
	GeeList* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	const gchar* _tmp25_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	{
		GeeList* _cat_list = NULL;
		GeeList* _tmp0_;
		gint _cat_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _cat_index = 0;
		_tmp0_ = self->priv->_existing_categories;
		_cat_list = _tmp0_;
		_tmp1_ = _cat_list;
		_tmp2_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp3_ = _tmp2_;
		_cat_size = _tmp3_;
		_cat_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			PublishingPiwigoCategory* cat = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			GtkComboBoxText* _tmp8_;
			PublishingPiwigoCategory* _tmp9_;
			const gchar* _tmp10_;
			_cat_index = _cat_index + 1;
			_tmp4_ = _cat_index;
			_tmp5_ = _cat_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _cat_list;
			_tmp7_ = gee_list_get (_tmp6_, _cat_index);
			cat = (PublishingPiwigoCategory*) _tmp7_;
			_tmp8_ = self->priv->existing_categories_combo;
			_tmp9_ = cat;
			_tmp10_ = _tmp9_->display_name;
			gtk_combo_box_text_append_text (_tmp8_, _tmp10_);
			_publishing_piwigo_category_unref0 (cat);
		}
	}
	_tmp11_ = self->priv->_existing_categories;
	_tmp12_ = gee_collection_get_is_empty (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp13_ = _tmp12_;
	if (_tmp13_) {
		GtkComboBoxText* _tmp14_;
		GtkRadioButton* _tmp15_;
		GtkRadioButton* _tmp16_;
		GtkTextView* _tmp17_;
		GtkLabel* _tmp18_;
		GtkEntry* _tmp19_;
		_tmp14_ = self->priv->existing_categories_combo;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget), FALSE);
		_tmp15_ = self->priv->use_existing_radio;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget), FALSE);
		_tmp16_ = self->priv->create_new_radio;
		gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE);
		_tmp17_ = self->priv->album_comment;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget), TRUE);
		_tmp18_ = self->priv->album_comment_label;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_widget_get_type (), GtkWidget), TRUE);
		_tmp19_ = self->priv->new_category_entry;
		gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_widget_get_type (), GtkWidget));
	} else {
		gint last_category_index = 0;
		gint _tmp20_;
		GtkComboBoxText* _tmp21_;
		GtkEntry* _tmp22_;
		GtkTextView* _tmp23_;
		GtkLabel* _tmp24_;
		_tmp20_ = self->priv->_last_category;
		last_category_index = publishing_piwigo_publishing_options_pane_find_category_index (self, _tmp20_);
		_tmp21_ = self->priv->existing_categories_combo;
		gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_combo_box_get_type (), GtkComboBox), last_category_index);
		_tmp22_ = self->priv->new_category_entry;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_widget_get_type (), GtkWidget), FALSE);
		_tmp23_ = self->priv->album_comment;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_widget_get_type (), GtkWidget), FALSE);
		_tmp24_ = self->priv->album_comment_label;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_widget_get_type (), GtkWidget), FALSE);
	}
	_tmp25_ = publishing_piwigo_publishing_options_pane_DEFAULT_CATEGORY_NAME;
	if (!publishing_piwigo_publishing_options_pane_category_already_exists (self, _tmp25_)) {
		GtkEntry* _tmp26_;
		const gchar* _tmp27_;
		_tmp26_ = self->priv->new_category_entry;
		_tmp27_ = publishing_piwigo_publishing_options_pane_DEFAULT_CATEGORY_NAME;
		gtk_entry_set_text (_tmp26_, _tmp27_);
	}
}

static void
publishing_piwigo_publishing_options_pane_create_within_categories_combo (PublishingPiwigoPublishingOptionsPane* self)
{
	GtkComboBoxText* _tmp0_;
	GtkLabel* _tmp12_;
	GtkComboBoxText* _tmp13_;
	GtkComboBoxText* _tmp14_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->within_existing_combo;
	gtk_combo_box_text_append_text (_tmp0_, "/ ");
	{
		GeeList* _cat_list = NULL;
		GeeList* _tmp1_;
		gint _cat_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _cat_index = 0;
		_tmp1_ = self->priv->_existing_categories;
		_cat_list = _tmp1_;
		_tmp2_ = _cat_list;
		_tmp3_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp4_ = _tmp3_;
		_cat_size = _tmp4_;
		_cat_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			PublishingPiwigoCategory* cat = NULL;
			GeeList* _tmp7_;
			gpointer _tmp8_;
			GtkComboBoxText* _tmp9_;
			PublishingPiwigoCategory* _tmp10_;
			const gchar* _tmp11_;
			_cat_index = _cat_index + 1;
			_tmp5_ = _cat_index;
			_tmp6_ = _cat_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _cat_list;
			_tmp8_ = gee_list_get (_tmp7_, _cat_index);
			cat = (PublishingPiwigoCategory*) _tmp8_;
			_tmp9_ = self->priv->within_existing_combo;
			_tmp10_ = cat;
			_tmp11_ = _tmp10_->display_name;
			gtk_combo_box_text_append_text (_tmp9_, _tmp11_);
			_publishing_piwigo_category_unref0 (cat);
		}
	}
	_tmp12_ = self->priv->within_existing_label;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp13_ = self->priv->within_existing_combo;
	gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_combo_box_get_type (), GtkComboBox), 0);
	_tmp14_ = self->priv->within_existing_combo;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget), FALSE);
}

static void
publishing_piwigo_publishing_options_pane_create_permissions_combo (PublishingPiwigoPublishingOptionsPane* self)
{
	PublishingPiwigoPermissionLevel** _tmp0_;
	gint _tmp0__length1;
	gint last_permission_level_index = 0;
	gint _tmp5_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->perm_levels;
	_tmp0__length1 = self->priv->perm_levels_length1;
	{
		PublishingPiwigoPermissionLevel** perm_collection = NULL;
		gint perm_collection_length1 = 0;
		gint _perm_collection_size_ = 0;
		gint perm_it = 0;
		perm_collection = _tmp0_;
		perm_collection_length1 = _tmp0__length1;
		for (perm_it = 0; perm_it < perm_collection_length1; perm_it = perm_it + 1) {
			PublishingPiwigoPermissionLevel* _tmp1_;
			PublishingPiwigoPermissionLevel* perm = NULL;
			_tmp1_ = _publishing_piwigo_permission_level_ref0 (perm_collection[perm_it]);
			perm = _tmp1_;
			{
				GtkComboBoxText* _tmp2_;
				PublishingPiwigoPermissionLevel* _tmp3_;
				const gchar* _tmp4_;
				_tmp2_ = self->priv->perms_combo;
				_tmp3_ = perm;
				_tmp4_ = _tmp3_->name;
				gtk_combo_box_text_append_text (_tmp2_, _tmp4_);
				_publishing_piwigo_permission_level_unref0 (perm);
			}
		}
	}
	_tmp5_ = self->priv->_last_permission_level;
	last_permission_level_index = publishing_piwigo_publishing_options_pane_find_permission_level_index (self, _tmp5_);
	if (last_permission_level_index < 0) {
		GtkComboBoxText* _tmp6_;
		_tmp6_ = self->priv->perms_combo;
		gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_combo_box_get_type (), GtkComboBox), 0);
	} else {
		GtkComboBoxText* _tmp7_;
		_tmp7_ = self->priv->perms_combo;
		gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_combo_box_get_type (), GtkComboBox), last_permission_level_index);
	}
}

static void
publishing_piwigo_publishing_options_pane_create_size_combo (PublishingPiwigoPublishingOptionsPane* self)
{
	PublishingPiwigoSizeEntry** _tmp0_;
	gint _tmp0__length1;
	gint last_size_index = 0;
	gint _tmp5_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	_tmp0_ = self->priv->photo_sizes;
	_tmp0__length1 = self->priv->photo_sizes_length1;
	{
		PublishingPiwigoSizeEntry** size_collection = NULL;
		gint size_collection_length1 = 0;
		gint _size_collection_size_ = 0;
		gint size_it = 0;
		size_collection = _tmp0_;
		size_collection_length1 = _tmp0__length1;
		for (size_it = 0; size_it < size_collection_length1; size_it = size_it + 1) {
			PublishingPiwigoSizeEntry* _tmp1_;
			PublishingPiwigoSizeEntry* size = NULL;
			_tmp1_ = _publishing_piwigo_size_entry_ref0 (size_collection[size_it]);
			size = _tmp1_;
			{
				GtkComboBoxText* _tmp2_;
				PublishingPiwigoSizeEntry* _tmp3_;
				const gchar* _tmp4_;
				_tmp2_ = self->priv->size_combo;
				_tmp3_ = size;
				_tmp4_ = _tmp3_->name;
				gtk_combo_box_text_append_text (_tmp2_, _tmp4_);
				_publishing_piwigo_size_entry_unref0 (size);
			}
		}
	}
	_tmp5_ = self->priv->_last_photo_size;
	last_size_index = publishing_piwigo_publishing_options_pane_find_size_index (self, _tmp5_);
	if (last_size_index < 0) {
		GtkComboBoxText* _tmp6_;
		_tmp6_ = self->priv->size_combo;
		gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_combo_box_get_type (), GtkComboBox), publishing_piwigo_publishing_options_pane_find_size_index (self, PUBLISHING_PIWIGO_ORIGINAL_SIZE));
	} else {
		GtkComboBoxText* _tmp7_;
		_tmp7_ = self->priv->size_combo;
		gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_combo_box_get_type (), GtkComboBox), last_size_index);
	}
}

static gint
publishing_piwigo_publishing_options_pane_find_category_index (PublishingPiwigoPublishingOptionsPane* self,
                                                               gint category_id)
{
	gint _result_ = 0;
	gint result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), -1);
	_result_ = 0;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GeeList* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				GeeList* _tmp5_;
				gpointer _tmp6_;
				PublishingPiwigoCategory* _tmp7_;
				gboolean _tmp8_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->_existing_categories;
				_tmp3_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection));
				_tmp4_ = _tmp3_;
				if (!(i < _tmp4_)) {
					break;
				}
				_tmp5_ = self->priv->_existing_categories;
				_tmp6_ = gee_list_get (_tmp5_, i);
				_tmp7_ = (PublishingPiwigoCategory*) _tmp6_;
				_tmp8_ = _tmp7_->id == category_id;
				_publishing_piwigo_category_unref0 (_tmp7_);
				if (_tmp8_) {
					_result_ = i;
					break;
				}
			}
		}
	}
	result = _result_;
	return result;
}

static gint
publishing_piwigo_publishing_options_pane_find_permission_level_index (PublishingPiwigoPublishingOptionsPane* self,
                                                                       gint permission_level_id)
{
	gint _result_ = 0;
	gint result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), -1);
	_result_ = -1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				PublishingPiwigoPermissionLevel** _tmp2_;
				gint _tmp2__length1;
				PublishingPiwigoPermissionLevel** _tmp3_;
				gint _tmp3__length1;
				PublishingPiwigoPermissionLevel* _tmp4_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->perm_levels;
				_tmp2__length1 = self->priv->perm_levels_length1;
				if (!(i < _tmp2__length1)) {
					break;
				}
				_tmp3_ = self->priv->perm_levels;
				_tmp3__length1 = self->priv->perm_levels_length1;
				_tmp4_ = _tmp3_[i];
				if (_tmp4_->id == permission_level_id) {
					_result_ = i;
					break;
				}
			}
		}
	}
	result = _result_;
	return result;
}

static gint
publishing_piwigo_publishing_options_pane_find_size_index (PublishingPiwigoPublishingOptionsPane* self,
                                                           gint size_id)
{
	gint _result_ = 0;
	gint result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), -1);
	_result_ = -1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				PublishingPiwigoSizeEntry** _tmp2_;
				gint _tmp2__length1;
				PublishingPiwigoSizeEntry** _tmp3_;
				gint _tmp3__length1;
				PublishingPiwigoSizeEntry* _tmp4_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->photo_sizes;
				_tmp2__length1 = self->priv->photo_sizes_length1;
				if (!(i < _tmp2__length1)) {
					break;
				}
				_tmp3_ = self->priv->photo_sizes;
				_tmp3__length1 = self->priv->photo_sizes_length1;
				_tmp4_ = _tmp3_[i];
				if (_tmp4_->id == size_id) {
					_result_ = i;
					break;
				}
			}
		}
	}
	result = _result_;
	return result;
}

static gboolean
publishing_piwigo_publishing_options_pane_category_already_exists (PublishingPiwigoPublishingOptionsPane* self,
                                                                   const gchar* category_name)
{
	gboolean _result_ = FALSE;
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), FALSE);
	g_return_val_if_fail (category_name != NULL, FALSE);
	_result_ = FALSE;
	{
		GeeList* _category_list = NULL;
		GeeList* _tmp0_;
		gint _category_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _category_index = 0;
		_tmp0_ = self->priv->_existing_categories;
		_category_list = _tmp0_;
		_tmp1_ = _category_list;
		_tmp2_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp3_ = _tmp2_;
		_category_size = _tmp3_;
		_category_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			PublishingPiwigoCategory* category = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			PublishingPiwigoCategory* _tmp8_;
			const gchar* _tmp9_;
			gchar* _tmp10_;
			gchar* _tmp11_;
			gboolean _tmp12_;
			_category_index = _category_index + 1;
			_tmp4_ = _category_index;
			_tmp5_ = _category_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _category_list;
			_tmp7_ = gee_list_get (_tmp6_, _category_index);
			category = (PublishingPiwigoCategory*) _tmp7_;
			_tmp8_ = category;
			_tmp9_ = _tmp8_->display_name;
			_tmp10_ = string_strip (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = g_strcmp0 (_tmp11_, category_name) == 0;
			_g_free0 (_tmp11_);
			if (_tmp12_) {
				_result_ = TRUE;
				_publishing_piwigo_category_unref0 (category);
				break;
			}
			_publishing_piwigo_category_unref0 (category);
		}
	}
	result = _result_;
	return result;
}

static gint
publishing_piwigo_publishing_options_pane_get_last_category (PublishingPiwigoPublishingOptionsPane* self)
{
	gint result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), -1);
	result = self->priv->_last_category;
	return result;
}

static void
publishing_piwigo_publishing_options_pane_set_last_category (PublishingPiwigoPublishingOptionsPane* self,
                                                             gint value)
{
	gint old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	old_value = publishing_piwigo_publishing_options_pane_get_last_category (self);
	if (old_value != value) {
		self->priv->_last_category = value;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_CATEGORY_PROPERTY]);
	}
}

static gint
publishing_piwigo_publishing_options_pane_get_last_permission_level (PublishingPiwigoPublishingOptionsPane* self)
{
	gint result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), -1);
	result = self->priv->_last_permission_level;
	return result;
}

static void
publishing_piwigo_publishing_options_pane_set_last_permission_level (PublishingPiwigoPublishingOptionsPane* self,
                                                                     gint value)
{
	gint old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	old_value = publishing_piwigo_publishing_options_pane_get_last_permission_level (self);
	if (old_value != value) {
		self->priv->_last_permission_level = value;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PERMISSION_LEVEL_PROPERTY]);
	}
}

static gint
publishing_piwigo_publishing_options_pane_get_last_photo_size (PublishingPiwigoPublishingOptionsPane* self)
{
	gint result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), -1);
	result = self->priv->_last_photo_size;
	return result;
}

static void
publishing_piwigo_publishing_options_pane_set_last_photo_size (PublishingPiwigoPublishingOptionsPane* self,
                                                               gint value)
{
	gint old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	old_value = publishing_piwigo_publishing_options_pane_get_last_photo_size (self);
	if (old_value != value) {
		self->priv->_last_photo_size = value;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PHOTO_SIZE_PROPERTY]);
	}
}

static gboolean
publishing_piwigo_publishing_options_pane_get_last_title_as_comment (PublishingPiwigoPublishingOptionsPane* self)
{
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), FALSE);
	result = self->priv->_last_title_as_comment;
	return result;
}

static void
publishing_piwigo_publishing_options_pane_set_last_title_as_comment (PublishingPiwigoPublishingOptionsPane* self,
                                                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	old_value = publishing_piwigo_publishing_options_pane_get_last_title_as_comment (self);
	if (old_value != value) {
		self->priv->_last_title_as_comment = value;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_TITLE_AS_COMMENT_PROPERTY]);
	}
}

static gboolean
publishing_piwigo_publishing_options_pane_get_last_no_upload_tags (PublishingPiwigoPublishingOptionsPane* self)
{
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), FALSE);
	result = self->priv->_last_no_upload_tags;
	return result;
}

static void
publishing_piwigo_publishing_options_pane_set_last_no_upload_tags (PublishingPiwigoPublishingOptionsPane* self,
                                                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	old_value = publishing_piwigo_publishing_options_pane_get_last_no_upload_tags (self);
	if (old_value != value) {
		self->priv->_last_no_upload_tags = value;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_TAGS_PROPERTY]);
	}
}

static gboolean
publishing_piwigo_publishing_options_pane_get_last_no_upload_ratings (PublishingPiwigoPublishingOptionsPane* self)
{
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), FALSE);
	result = self->priv->_last_no_upload_ratings;
	return result;
}

static void
publishing_piwigo_publishing_options_pane_set_last_no_upload_ratings (PublishingPiwigoPublishingOptionsPane* self,
                                                                      gboolean value)
{
	gboolean old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	old_value = publishing_piwigo_publishing_options_pane_get_last_no_upload_ratings (self);
	if (old_value != value) {
		self->priv->_last_no_upload_ratings = value;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_RATINGS_PROPERTY]);
	}
}

static gboolean
publishing_piwigo_publishing_options_pane_get_strip_metadata_enabled (PublishingPiwigoPublishingOptionsPane* self)
{
	gboolean result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), FALSE);
	result = self->priv->_strip_metadata_enabled;
	return result;
}

static void
publishing_piwigo_publishing_options_pane_set_strip_metadata_enabled (PublishingPiwigoPublishingOptionsPane* self,
                                                                      gboolean value)
{
	gboolean old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	old_value = publishing_piwigo_publishing_options_pane_get_strip_metadata_enabled (self);
	if (old_value != value) {
		self->priv->_strip_metadata_enabled = value;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_STRIP_METADATA_ENABLED_PROPERTY]);
	}
}

static GeeList*
publishing_piwigo_publishing_options_pane_get_existing_categories (PublishingPiwigoPublishingOptionsPane* self)
{
	GeeList* result;
	GeeList* _tmp0_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), NULL);
	_tmp0_ = self->priv->_existing_categories;
	result = _tmp0_;
	return result;
}

static void
publishing_piwigo_publishing_options_pane_set_existing_categories (PublishingPiwigoPublishingOptionsPane* self,
                                                                   GeeList* value)
{
	GeeList* old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	old_value = publishing_piwigo_publishing_options_pane_get_existing_categories (self);
	if (old_value != value) {
		GeeList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_existing_categories);
		self->priv->_existing_categories = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_EXISTING_CATEGORIES_PROPERTY]);
	}
}

static const gchar*
publishing_piwigo_publishing_options_pane_get_default_comment (PublishingPiwigoPublishingOptionsPane* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self), NULL);
	_tmp0_ = self->priv->_default_comment;
	result = _tmp0_;
	return result;
}

static void
publishing_piwigo_publishing_options_pane_set_default_comment (PublishingPiwigoPublishingOptionsPane* self,
                                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_OPTIONS_PANE (self));
	old_value = publishing_piwigo_publishing_options_pane_get_default_comment (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_default_comment);
		self->priv->_default_comment = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_DEFAULT_COMMENT_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_VOID__PUBLISHING_PIWIGO_PUBLISHING_PARAMETERS_BOOLEAN (GClosure * closure,
                                                                               GValue * return_value,
                                                                               guint n_param_values,
                                                                               const GValue * param_values,
                                                                               gpointer invocation_hint,
                                                                               gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__PUBLISHING_PIWIGO_PUBLISHING_PARAMETERS_BOOLEAN) (gpointer data1, gpointer arg_1, gboolean arg_2, gpointer data2);
	register GMarshalFunc_VOID__PUBLISHING_PIWIGO_PUBLISHING_PARAMETERS_BOOLEAN callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__PUBLISHING_PIWIGO_PUBLISHING_PARAMETERS_BOOLEAN) (marshal_data ? marshal_data : cc->callback);
	callback (data1, publishing_piwigo_value_get_publishing_parameters (param_values + 1), g_value_get_boolean (param_values + 2), data2);
}

static void
publishing_piwigo_publishing_options_pane_class_init (PublishingPiwigoPublishingOptionsPaneClass * klass,
                                                      gpointer klass_data)
{
	gchar* _tmp0_;
	publishing_piwigo_publishing_options_pane_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingPiwigoPublishingOptionsPane_private_offset);
	((GObjectClass *) klass)->constructed = (void (*) (GObject*)) publishing_piwigo_publishing_options_pane_real_constructed;
	((ShotwellPluginsCommonBuilderPaneClass *) klass)->on_pane_installed = (void (*) (ShotwellPluginsCommonBuilderPane*)) publishing_piwigo_publishing_options_pane_real_on_pane_installed;
	G_OBJECT_CLASS (klass)->get_property = _vala_publishing_piwigo_publishing_options_pane_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_publishing_piwigo_publishing_options_pane_set_property;
	G_OBJECT_CLASS (klass)->finalize = publishing_piwigo_publishing_options_pane_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_CATEGORY_PROPERTY, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_CATEGORY_PROPERTY] = g_param_spec_int ("last-category", "last-category", "last-category", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PERMISSION_LEVEL_PROPERTY, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PERMISSION_LEVEL_PROPERTY] = g_param_spec_int ("last-permission-level", "last-permission-level", "last-permission-level", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PHOTO_SIZE_PROPERTY, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PHOTO_SIZE_PROPERTY] = g_param_spec_int ("last-photo-size", "last-photo-size", "last-photo-size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_TITLE_AS_COMMENT_PROPERTY, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_TITLE_AS_COMMENT_PROPERTY] = g_param_spec_boolean ("last-title-as-comment", "last-title-as-comment", "last-title-as-comment", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_TAGS_PROPERTY, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_TAGS_PROPERTY] = g_param_spec_boolean ("last-no-upload-tags", "last-no-upload-tags", "last-no-upload-tags", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_RATINGS_PROPERTY, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_RATINGS_PROPERTY] = g_param_spec_boolean ("last-no-upload-ratings", "last-no-upload-ratings", "last-no-upload-ratings", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_STRIP_METADATA_ENABLED_PROPERTY, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_STRIP_METADATA_ENABLED_PROPERTY] = g_param_spec_boolean ("strip-metadata-enabled", "strip-metadata-enabled", "strip-metadata-enabled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_EXISTING_CATEGORIES_PROPERTY, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_EXISTING_CATEGORIES_PROPERTY] = g_param_spec_object ("existing-categories", "existing-categories", "existing-categories", GEE_TYPE_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_DEFAULT_COMMENT_PROPERTY, publishing_piwigo_publishing_options_pane_properties[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_DEFAULT_COMMENT_PROPERTY] = g_param_spec_string ("default-comment", "default-comment", "default-comment", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	publishing_piwigo_publishing_options_pane_signals[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_PUBLISH_SIGNAL] = g_signal_new ("publish", PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__PUBLISHING_PIWIGO_PUBLISHING_PARAMETERS_BOOLEAN, G_TYPE_NONE, 2, PUBLISHING_PIWIGO_TYPE_PUBLISHING_PARAMETERS, G_TYPE_BOOLEAN);
	publishing_piwigo_publishing_options_pane_signals[PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LOGOUT_SIGNAL] = g_signal_new ("logout", PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	_tmp0_ = g_strdup (_ ("Shotwell Connect"));
	publishing_piwigo_publishing_options_pane_DEFAULT_CATEGORY_NAME = _tmp0_;
}

static void
publishing_piwigo_publishing_options_pane_instance_init (PublishingPiwigoPublishingOptionsPane * self,
                                                         gpointer klass)
{
	self->priv = publishing_piwigo_publishing_options_pane_get_instance_private (self);
	self->priv->strip_metadata_check = NULL;
	self->priv->title_as_comment_check = NULL;
	self->priv->no_upload_tags_check = NULL;
	self->priv->no_upload_ratings_check = NULL;
}

static void
publishing_piwigo_publishing_options_pane_finalize (GObject * obj)
{
	PublishingPiwigoPublishingOptionsPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, PublishingPiwigoPublishingOptionsPane);
	_g_object_unref0 (self->priv->use_existing_radio);
	_g_object_unref0 (self->priv->create_new_radio);
	_g_object_unref0 (self->priv->existing_categories_combo);
	_g_object_unref0 (self->priv->new_category_entry);
	_g_object_unref0 (self->priv->within_existing_label);
	_g_object_unref0 (self->priv->within_existing_combo);
	_g_object_unref0 (self->priv->perms_combo);
	_g_object_unref0 (self->priv->size_combo);
	_g_object_unref0 (self->priv->strip_metadata_check);
	_g_object_unref0 (self->priv->title_as_comment_check);
	_g_object_unref0 (self->priv->no_upload_tags_check);
	_g_object_unref0 (self->priv->no_upload_ratings_check);
	_g_object_unref0 (self->priv->logout_button);
	_g_object_unref0 (self->priv->publish_button);
	_g_object_unref0 (self->priv->album_comment);
	_g_object_unref0 (self->priv->album_comment_label);
	self->priv->perm_levels = (_vala_array_free (self->priv->perm_levels, self->priv->perm_levels_length1, (GDestroyNotify) publishing_piwigo_permission_level_unref), NULL);
	self->priv->photo_sizes = (_vala_array_free (self->priv->photo_sizes, self->priv->photo_sizes_length1, (GDestroyNotify) publishing_piwigo_size_entry_unref), NULL);
	_g_object_unref0 (self->priv->_existing_categories);
	_g_free0 (self->priv->_default_comment);
	G_OBJECT_CLASS (publishing_piwigo_publishing_options_pane_parent_class)->finalize (obj);
}

/**
 * The publishing options pane.
 */
static GType
publishing_piwigo_publishing_options_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoPublishingOptionsPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_publishing_options_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoPublishingOptionsPane), 0, (GInstanceInitFunc) publishing_piwigo_publishing_options_pane_instance_init, NULL };
	GType publishing_piwigo_publishing_options_pane_type_id;
	publishing_piwigo_publishing_options_pane_type_id = g_type_register_static (SHOTWELL_PLUGINS_COMMON_TYPE_BUILDER_PANE, "PublishingPiwigoPublishingOptionsPane", &g_define_type_info, 0);
	PublishingPiwigoPublishingOptionsPane_private_offset = g_type_add_instance_private (publishing_piwigo_publishing_options_pane_type_id, sizeof (PublishingPiwigoPublishingOptionsPanePrivate));
	return publishing_piwigo_publishing_options_pane_type_id;
}

GType
publishing_piwigo_publishing_options_pane_get_type (void)
{
	static volatile gsize publishing_piwigo_publishing_options_pane_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_publishing_options_pane_type_id__once)) {
		GType publishing_piwigo_publishing_options_pane_type_id;
		publishing_piwigo_publishing_options_pane_type_id = publishing_piwigo_publishing_options_pane_get_type_once ();
		g_once_init_leave (&publishing_piwigo_publishing_options_pane_type_id__once, publishing_piwigo_publishing_options_pane_type_id);
	}
	return publishing_piwigo_publishing_options_pane_type_id__once;
}

static void
_vala_publishing_piwigo_publishing_options_pane_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec)
{
	PublishingPiwigoPublishingOptionsPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, PublishingPiwigoPublishingOptionsPane);
	switch (property_id) {
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_CATEGORY_PROPERTY:
		g_value_set_int (value, publishing_piwigo_publishing_options_pane_get_last_category (self));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PERMISSION_LEVEL_PROPERTY:
		g_value_set_int (value, publishing_piwigo_publishing_options_pane_get_last_permission_level (self));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PHOTO_SIZE_PROPERTY:
		g_value_set_int (value, publishing_piwigo_publishing_options_pane_get_last_photo_size (self));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_TITLE_AS_COMMENT_PROPERTY:
		g_value_set_boolean (value, publishing_piwigo_publishing_options_pane_get_last_title_as_comment (self));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_TAGS_PROPERTY:
		g_value_set_boolean (value, publishing_piwigo_publishing_options_pane_get_last_no_upload_tags (self));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_RATINGS_PROPERTY:
		g_value_set_boolean (value, publishing_piwigo_publishing_options_pane_get_last_no_upload_ratings (self));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_STRIP_METADATA_ENABLED_PROPERTY:
		g_value_set_boolean (value, publishing_piwigo_publishing_options_pane_get_strip_metadata_enabled (self));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_EXISTING_CATEGORIES_PROPERTY:
		g_value_set_object (value, publishing_piwigo_publishing_options_pane_get_existing_categories (self));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_DEFAULT_COMMENT_PROPERTY:
		g_value_set_string (value, publishing_piwigo_publishing_options_pane_get_default_comment (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_publishing_piwigo_publishing_options_pane_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec)
{
	PublishingPiwigoPublishingOptionsPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PUBLISHING_PIWIGO_TYPE_PUBLISHING_OPTIONS_PANE, PublishingPiwigoPublishingOptionsPane);
	switch (property_id) {
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_CATEGORY_PROPERTY:
		publishing_piwigo_publishing_options_pane_set_last_category (self, g_value_get_int (value));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PERMISSION_LEVEL_PROPERTY:
		publishing_piwigo_publishing_options_pane_set_last_permission_level (self, g_value_get_int (value));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_PHOTO_SIZE_PROPERTY:
		publishing_piwigo_publishing_options_pane_set_last_photo_size (self, g_value_get_int (value));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_TITLE_AS_COMMENT_PROPERTY:
		publishing_piwigo_publishing_options_pane_set_last_title_as_comment (self, g_value_get_boolean (value));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_TAGS_PROPERTY:
		publishing_piwigo_publishing_options_pane_set_last_no_upload_tags (self, g_value_get_boolean (value));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_LAST_NO_UPLOAD_RATINGS_PROPERTY:
		publishing_piwigo_publishing_options_pane_set_last_no_upload_ratings (self, g_value_get_boolean (value));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_STRIP_METADATA_ENABLED_PROPERTY:
		publishing_piwigo_publishing_options_pane_set_strip_metadata_enabled (self, g_value_get_boolean (value));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_EXISTING_CATEGORIES_PROPERTY:
		publishing_piwigo_publishing_options_pane_set_existing_categories (self, g_value_get_object (value));
		break;
		case PUBLISHING_PIWIGO_PUBLISHING_OPTIONS_PANE_DEFAULT_COMMENT_PROPERTY:
		publishing_piwigo_publishing_options_pane_set_default_comment (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
publishing_piwigo_session_get_instance_private (PublishingPiwigoSession* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingPiwigoSession_private_offset);
}

PublishingPiwigoSession*
publishing_piwigo_session_construct (GType object_type)
{
	PublishingPiwigoSession* self = NULL;
	SoupCookieJar* cookies = NULL;
	SoupCookieJar* _tmp0_;
	SoupSessionFeature* _tmp1_;
	SoupSessionFeature** _tmp2_;
	SoupSessionFeature** _tmp3_;
	gint _tmp3__length1;
	SoupCookieJar* _tmp4_;
	_tmp0_ = soup_cookie_jar_new ();
	cookies = _tmp0_;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (cookies, soup_session_feature_get_type (), SoupSessionFeature));
	_tmp2_ = g_new0 (SoupSessionFeature*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp3__length1 = 1;
	self = (PublishingPiwigoSession*) publishing_rest_support_session_construct (object_type, "", _tmp3_, (gint) 1);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp4_ = _g_object_ref0 (cookies);
	_g_object_unref0 (self->priv->jar);
	self->priv->jar = _tmp4_;
	_g_object_unref0 (cookies);
	return self;
}

PublishingPiwigoSession*
publishing_piwigo_session_new (void)
{
	return publishing_piwigo_session_construct (PUBLISHING_PIWIGO_TYPE_SESSION);
}

static gboolean
publishing_piwigo_session_real_is_authenticated (PublishingRESTSupportSession* base)
{
	PublishingPiwigoSession * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_PIWIGO_TYPE_SESSION, PublishingPiwigoSession);
	_tmp2_ = self->priv->pwg_id;
	if (_tmp2_ != NULL) {
		const gchar* _tmp3_;
		_tmp3_ = self->priv->pwg_url;
		_tmp1_ = _tmp3_ != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		const gchar* _tmp4_;
		_tmp4_ = self->priv->username;
		_tmp0_ = _tmp4_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

void
publishing_piwigo_session_authenticate (PublishingPiwigoSession* self,
                                        const gchar* url,
                                        const gchar* username,
                                        const gchar* id)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_SESSION (self));
	g_return_if_fail (url != NULL);
	g_return_if_fail (username != NULL);
	g_return_if_fail (id != NULL);
	_tmp0_ = g_strdup (url);
	_g_free0 (self->priv->pwg_url);
	self->priv->pwg_url = _tmp0_;
	_tmp1_ = g_strdup (username);
	_g_free0 (self->priv->username);
	self->priv->username = _tmp1_;
	_tmp2_ = g_strdup (id);
	_g_free0 (self->priv->pwg_id);
	self->priv->pwg_id = _tmp2_;
}

void
publishing_piwigo_session_deauthenticate (PublishingPiwigoSession* self)
{
	GSList* cookies = NULL;
	SoupCookieJar* _tmp0_;
	GSList* _tmp1_;
	GSList* _tmp2_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_SESSION (self));
	_g_free0 (self->priv->pwg_url);
	self->priv->pwg_url = NULL;
	_g_free0 (self->priv->pwg_id);
	self->priv->pwg_id = NULL;
	_g_free0 (self->priv->username);
	self->priv->username = NULL;
	_tmp0_ = self->priv->jar;
	_tmp1_ = soup_cookie_jar_all_cookies (_tmp0_);
	cookies = _tmp1_;
	_tmp2_ = cookies;
	{
		GSList* cookie_collection = NULL;
		GSList* cookie_it = NULL;
		cookie_collection = _tmp2_;
		for (cookie_it = cookie_collection; cookie_it != NULL; cookie_it = cookie_it->next) {
			SoupCookie* _tmp3_;
			SoupCookie* cookie = NULL;
			_tmp3_ = __vala_SoupCookie_copy0 ((SoupCookie*) cookie_it->data);
			cookie = _tmp3_;
			{
				SoupCookieJar* _tmp4_;
				SoupCookie* _tmp5_;
				_tmp4_ = self->priv->jar;
				_tmp5_ = cookie;
				soup_cookie_jar_delete_cookie (_tmp4_, _tmp5_);
				__vala_SoupCookie_free0 (cookie);
			}
		}
	}
	(cookies == NULL) ? NULL : (cookies = (_g_slist_free___vala_SoupCookie_free0_ (cookies), NULL));
}

gchar*
publishing_piwigo_session_get_username (PublishingPiwigoSession* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (self), NULL);
	_tmp0_ = self->priv->username;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
publishing_piwigo_session_get_pwg_url (PublishingPiwigoSession* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (self), NULL);
	_tmp0_ = self->priv->pwg_url;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
publishing_piwigo_session_get_pwg_id (PublishingPiwigoSession* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (self), NULL);
	_tmp0_ = self->priv->pwg_id;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

void
publishing_piwigo_session_set_pwg_id (PublishingPiwigoSession* self,
                                      const gchar* id)
{
	gchar* _tmp0_;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_SESSION (self));
	g_return_if_fail (id != NULL);
	_tmp0_ = g_strdup (id);
	_g_free0 (self->priv->pwg_id);
	self->priv->pwg_id = _tmp0_;
}

static void
publishing_piwigo_session_class_init (PublishingPiwigoSessionClass * klass,
                                      gpointer klass_data)
{
	publishing_piwigo_session_parent_class = g_type_class_peek_parent (klass);
	((PublishingRESTSupportSessionClass *) klass)->finalize = publishing_piwigo_session_finalize;
	g_type_class_adjust_private_offset (klass, &PublishingPiwigoSession_private_offset);
	((PublishingRESTSupportSessionClass *) klass)->is_authenticated = (gboolean (*) (PublishingRESTSupportSession*)) publishing_piwigo_session_real_is_authenticated;
}

static void
publishing_piwigo_session_instance_init (PublishingPiwigoSession * self,
                                         gpointer klass)
{
	self->priv = publishing_piwigo_session_get_instance_private (self);
	self->priv->pwg_url = NULL;
	self->priv->pwg_id = NULL;
	self->priv->username = NULL;
	self->priv->jar = NULL;
}

static void
publishing_piwigo_session_finalize (PublishingRESTSupportSession * obj)
{
	PublishingPiwigoSession * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_SESSION, PublishingPiwigoSession);
	_g_free0 (self->priv->pwg_url);
	_g_free0 (self->priv->pwg_id);
	_g_free0 (self->priv->username);
	_g_object_unref0 (self->priv->jar);
	PUBLISHING_REST_SUPPORT_SESSION_CLASS (publishing_piwigo_session_parent_class)->finalize (obj);
}

/**
 * Session class that keeps track of the authentication status and of the
 * user token pwg_id.
 */
static GType
publishing_piwigo_session_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoSessionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_session_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoSession), 0, (GInstanceInitFunc) publishing_piwigo_session_instance_init, NULL };
	GType publishing_piwigo_session_type_id;
	publishing_piwigo_session_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_SESSION, "PublishingPiwigoSession", &g_define_type_info, 0);
	PublishingPiwigoSession_private_offset = g_type_add_instance_private (publishing_piwigo_session_type_id, sizeof (PublishingPiwigoSessionPrivate));
	return publishing_piwigo_session_type_id;
}

GType
publishing_piwigo_session_get_type (void)
{
	static volatile gsize publishing_piwigo_session_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_session_type_id__once)) {
		GType publishing_piwigo_session_type_id;
		publishing_piwigo_session_type_id = publishing_piwigo_session_get_type_once ();
		g_once_init_leave (&publishing_piwigo_session_type_id__once, publishing_piwigo_session_type_id);
	}
	return publishing_piwigo_session_type_id__once;
}

PublishingPiwigoTransaction*
publishing_piwigo_transaction_construct (GType object_type,
                                         PublishingPiwigoSession* session)
{
	PublishingPiwigoTransaction* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	self = (PublishingPiwigoTransaction*) publishing_rest_support_transaction_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (session, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), PUBLISHING_REST_SUPPORT_HTTP_METHOD_POST);
	_tmp0_ = publishing_piwigo_session_get_pwg_url (session);
	_tmp1_ = _tmp0_;
	publishing_rest_support_transaction_add_header (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "Referer", _tmp1_);
	_g_free0 (_tmp1_);
	return self;
}

PublishingPiwigoTransaction*
publishing_piwigo_transaction_new (PublishingPiwigoSession* session)
{
	return publishing_piwigo_transaction_construct (PUBLISHING_PIWIGO_TYPE_TRANSACTION, session);
}

PublishingPiwigoTransaction*
publishing_piwigo_transaction_construct_authenticated (GType object_type,
                                                       PublishingPiwigoSession* session)
{
	PublishingPiwigoTransaction* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	_tmp0_ = publishing_piwigo_session_get_pwg_url (session);
	_tmp1_ = _tmp0_;
	self = (PublishingPiwigoTransaction*) publishing_rest_support_transaction_construct_with_endpoint_url (object_type, G_TYPE_CHECK_INSTANCE_CAST (session, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), _tmp1_, PUBLISHING_REST_SUPPORT_HTTP_METHOD_POST);
	_g_free0 (_tmp1_);
	_tmp2_ = publishing_piwigo_session_get_pwg_url (session);
	_tmp3_ = _tmp2_;
	publishing_rest_support_transaction_add_header (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "Referer", _tmp3_);
	_g_free0 (_tmp3_);
	return self;
}

PublishingPiwigoTransaction*
publishing_piwigo_transaction_new_authenticated (PublishingPiwigoSession* session)
{
	return publishing_piwigo_transaction_construct_authenticated (PUBLISHING_PIWIGO_TYPE_TRANSACTION, session);
}

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

gchar*
publishing_piwigo_transaction_get_error_code (PublishingRESTSupportXmlDocument* doc)
{
	xmlNode* root = NULL;
	xmlNode* _tmp0_;
	xmlNode* errcode = NULL;
	xmlNode* _tmp5_;
	gchar* _tmp6_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (doc, PUBLISHING_REST_SUPPORT_TYPE_XML_DOCUMENT), NULL);
	_tmp0_ = publishing_rest_support_xml_document_get_root_node (doc);
	root = _tmp0_;
	{
		xmlNode* _tmp1_ = NULL;
		xmlNode* _tmp2_;
		xmlNode* _tmp3_;
		_tmp2_ = root;
		_tmp3_ = publishing_rest_support_xml_document_get_named_child (doc, _tmp2_, "err", &_inner_error0_);
		_tmp1_ = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		errcode = _tmp1_;
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		gchar* _tmp4_;
		g_clear_error (&_inner_error0_);
		_tmp4_ = g_strdup ("0");
		result = _tmp4_;
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp5_ = errcode;
	_tmp6_ = (gchar*) xmlGetProp (_tmp5_, (xmlChar*) "code");
	result = _tmp6_;
	return result;
}

static void
publishing_piwigo_transaction_class_init (PublishingPiwigoTransactionClass * klass,
                                          gpointer klass_data)
{
	publishing_piwigo_transaction_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_piwigo_transaction_instance_init (PublishingPiwigoTransaction * self,
                                             gpointer klass)
{
}

/**
 * Generic REST transaction class.
 *
 * This class implements the generic logic for all REST transactions used
 * by the Piwigo publishing plugin. 
 */
static GType
publishing_piwigo_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoTransaction), 0, (GInstanceInitFunc) publishing_piwigo_transaction_instance_init, NULL };
	GType publishing_piwigo_transaction_type_id;
	publishing_piwigo_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, "PublishingPiwigoTransaction", &g_define_type_info, 0);
	return publishing_piwigo_transaction_type_id;
}

GType
publishing_piwigo_transaction_get_type (void)
{
	static volatile gsize publishing_piwigo_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_transaction_type_id__once)) {
		GType publishing_piwigo_transaction_type_id;
		publishing_piwigo_transaction_type_id = publishing_piwigo_transaction_get_type_once ();
		g_once_init_leave (&publishing_piwigo_transaction_type_id__once, publishing_piwigo_transaction_type_id);
	}
	return publishing_piwigo_transaction_type_id__once;
}

PublishingPiwigoSessionLoginTransaction*
publishing_piwigo_session_login_transaction_construct (GType object_type,
                                                       PublishingPiwigoSession* session,
                                                       const gchar* url,
                                                       const gchar* username,
                                                       const gchar* password)
{
	PublishingPiwigoSessionLoginTransaction* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	g_return_val_if_fail (url != NULL, NULL);
	g_return_val_if_fail (username != NULL, NULL);
	g_return_val_if_fail (password != NULL, NULL);
	self = (PublishingPiwigoSessionLoginTransaction*) publishing_rest_support_transaction_construct_with_endpoint_url (object_type, G_TYPE_CHECK_INSTANCE_CAST (session, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), url, PUBLISHING_REST_SUPPORT_HTTP_METHOD_POST);
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "method", "pwg.session.login");
	_tmp0_ = g_uri_escape_string (username, NULL, TRUE);
	_tmp1_ = _tmp0_;
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "username", _tmp1_);
	_g_free0 (_tmp1_);
	_tmp2_ = g_uri_escape_string (password, NULL, TRUE);
	_tmp3_ = _tmp2_;
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "password", _tmp3_);
	_g_free0 (_tmp3_);
	return self;
}

PublishingPiwigoSessionLoginTransaction*
publishing_piwigo_session_login_transaction_new (PublishingPiwigoSession* session,
                                                 const gchar* url,
                                                 const gchar* username,
                                                 const gchar* password)
{
	return publishing_piwigo_session_login_transaction_construct (PUBLISHING_PIWIGO_TYPE_SESSION_LOGIN_TRANSACTION, session, url, username, password);
}

static gpointer
_publishing_rest_support_argument_ref0 (gpointer self)
{
	return self ? publishing_rest_support_argument_ref (self) : NULL;
}

PublishingPiwigoSessionLoginTransaction*
publishing_piwigo_session_login_transaction_construct_from_other (GType object_type,
                                                                  PublishingPiwigoSession* session,
                                                                  PublishingPiwigoTransaction* other)
{
	PublishingPiwigoSessionLoginTransaction* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint _tmp2_ = 0;
	PublishingRESTSupportArgument** _tmp3_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_TRANSACTION (other), NULL);
	_tmp0_ = publishing_rest_support_transaction_get_endpoint_url (G_TYPE_CHECK_INSTANCE_CAST (other, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
	_tmp1_ = _tmp0_;
	self = (PublishingPiwigoSessionLoginTransaction*) publishing_rest_support_transaction_construct_with_endpoint_url (object_type, G_TYPE_CHECK_INSTANCE_CAST (session, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), _tmp1_, PUBLISHING_REST_SUPPORT_HTTP_METHOD_POST);
	_g_free0 (_tmp1_);
	_tmp3_ = publishing_rest_support_transaction_get_arguments (G_TYPE_CHECK_INSTANCE_CAST (other, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), &_tmp2_);
	{
		PublishingRESTSupportArgument** argument_collection = NULL;
		gint argument_collection_length1 = 0;
		gint _argument_collection_size_ = 0;
		gint argument_it = 0;
		argument_collection = _tmp3_;
		argument_collection_length1 = _tmp2_;
		for (argument_it = 0; argument_it < argument_collection_length1; argument_it = argument_it + 1) {
			PublishingRESTSupportArgument* _tmp4_;
			PublishingRESTSupportArgument* argument = NULL;
			_tmp4_ = _publishing_rest_support_argument_ref0 (argument_collection[argument_it]);
			argument = _tmp4_;
			{
				PublishingRESTSupportArgument* _tmp5_;
				const gchar* _tmp6_;
				PublishingRESTSupportArgument* _tmp7_;
				const gchar* _tmp8_;
				_tmp5_ = argument;
				_tmp6_ = _tmp5_->key;
				_tmp7_ = argument;
				_tmp8_ = _tmp7_->value;
				publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _tmp6_, _tmp8_);
				_publishing_rest_support_argument_unref0 (argument);
			}
		}
		argument_collection = (_vala_array_free (argument_collection, argument_collection_length1, (GDestroyNotify) publishing_rest_support_argument_unref), NULL);
	}
	return self;
}

PublishingPiwigoSessionLoginTransaction*
publishing_piwigo_session_login_transaction_new_from_other (PublishingPiwigoSession* session,
                                                            PublishingPiwigoTransaction* other)
{
	return publishing_piwigo_session_login_transaction_construct_from_other (PUBLISHING_PIWIGO_TYPE_SESSION_LOGIN_TRANSACTION, session, other);
}

static void
publishing_piwigo_session_login_transaction_class_init (PublishingPiwigoSessionLoginTransactionClass * klass,
                                                        gpointer klass_data)
{
	publishing_piwigo_session_login_transaction_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_piwigo_session_login_transaction_instance_init (PublishingPiwigoSessionLoginTransaction * self,
                                                           gpointer klass)
{
}

/**
 * Transaction used to implement the network login interaction.
 */
static GType
publishing_piwigo_session_login_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoSessionLoginTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_session_login_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoSessionLoginTransaction), 0, (GInstanceInitFunc) publishing_piwigo_session_login_transaction_instance_init, NULL };
	GType publishing_piwigo_session_login_transaction_type_id;
	publishing_piwigo_session_login_transaction_type_id = g_type_register_static (PUBLISHING_PIWIGO_TYPE_TRANSACTION, "PublishingPiwigoSessionLoginTransaction", &g_define_type_info, 0);
	return publishing_piwigo_session_login_transaction_type_id;
}

GType
publishing_piwigo_session_login_transaction_get_type (void)
{
	static volatile gsize publishing_piwigo_session_login_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_session_login_transaction_type_id__once)) {
		GType publishing_piwigo_session_login_transaction_type_id;
		publishing_piwigo_session_login_transaction_type_id = publishing_piwigo_session_login_transaction_get_type_once ();
		g_once_init_leave (&publishing_piwigo_session_login_transaction_type_id__once, publishing_piwigo_session_login_transaction_type_id);
	}
	return publishing_piwigo_session_login_transaction_type_id__once;
}

PublishingPiwigoSessionGetStatusTransaction*
publishing_piwigo_session_get_status_transaction_construct_unauthenticated (GType object_type,
                                                                            PublishingPiwigoSession* session,
                                                                            const gchar* url,
                                                                            const gchar* pwg_id)
{
	PublishingPiwigoSessionGetStatusTransaction* self = NULL;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	g_return_val_if_fail (url != NULL, NULL);
	g_return_val_if_fail (pwg_id != NULL, NULL);
	self = (PublishingPiwigoSessionGetStatusTransaction*) publishing_rest_support_transaction_construct_with_endpoint_url (object_type, G_TYPE_CHECK_INSTANCE_CAST (session, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), url, PUBLISHING_REST_SUPPORT_HTTP_METHOD_POST);
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "method", "pwg.session.getStatus");
	return self;
}

PublishingPiwigoSessionGetStatusTransaction*
publishing_piwigo_session_get_status_transaction_new_unauthenticated (PublishingPiwigoSession* session,
                                                                      const gchar* url,
                                                                      const gchar* pwg_id)
{
	return publishing_piwigo_session_get_status_transaction_construct_unauthenticated (PUBLISHING_PIWIGO_TYPE_SESSION_GET_STATUS_TRANSACTION, session, url, pwg_id);
}

PublishingPiwigoSessionGetStatusTransaction*
publishing_piwigo_session_get_status_transaction_construct (GType object_type,
                                                            PublishingPiwigoSession* session)
{
	PublishingPiwigoSessionGetStatusTransaction* self = NULL;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	self = (PublishingPiwigoSessionGetStatusTransaction*) publishing_piwigo_transaction_construct_authenticated (object_type, session);
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "method", "pwg.session.getStatus");
	return self;
}

PublishingPiwigoSessionGetStatusTransaction*
publishing_piwigo_session_get_status_transaction_new (PublishingPiwigoSession* session)
{
	return publishing_piwigo_session_get_status_transaction_construct (PUBLISHING_PIWIGO_TYPE_SESSION_GET_STATUS_TRANSACTION, session);
}

static void
publishing_piwigo_session_get_status_transaction_class_init (PublishingPiwigoSessionGetStatusTransactionClass * klass,
                                                             gpointer klass_data)
{
	publishing_piwigo_session_get_status_transaction_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_piwigo_session_get_status_transaction_instance_init (PublishingPiwigoSessionGetStatusTransaction * self,
                                                                gpointer klass)
{
}

/**
 * Transaction used to implement the get status interaction.
 */
static GType
publishing_piwigo_session_get_status_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoSessionGetStatusTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_session_get_status_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoSessionGetStatusTransaction), 0, (GInstanceInitFunc) publishing_piwigo_session_get_status_transaction_instance_init, NULL };
	GType publishing_piwigo_session_get_status_transaction_type_id;
	publishing_piwigo_session_get_status_transaction_type_id = g_type_register_static (PUBLISHING_PIWIGO_TYPE_TRANSACTION, "PublishingPiwigoSessionGetStatusTransaction", &g_define_type_info, 0);
	return publishing_piwigo_session_get_status_transaction_type_id;
}

GType
publishing_piwigo_session_get_status_transaction_get_type (void)
{
	static volatile gsize publishing_piwigo_session_get_status_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_session_get_status_transaction_type_id__once)) {
		GType publishing_piwigo_session_get_status_transaction_type_id;
		publishing_piwigo_session_get_status_transaction_type_id = publishing_piwigo_session_get_status_transaction_get_type_once ();
		g_once_init_leave (&publishing_piwigo_session_get_status_transaction_type_id__once, publishing_piwigo_session_get_status_transaction_type_id);
	}
	return publishing_piwigo_session_get_status_transaction_type_id__once;
}

PublishingPiwigoCategoriesGetListTransaction*
publishing_piwigo_categories_get_list_transaction_construct (GType object_type,
                                                             PublishingPiwigoSession* session)
{
	PublishingPiwigoCategoriesGetListTransaction* self = NULL;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	self = (PublishingPiwigoCategoriesGetListTransaction*) publishing_piwigo_transaction_construct_authenticated (object_type, session);
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "method", "pwg.categories.getList");
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "recursive", "true");
	return self;
}

PublishingPiwigoCategoriesGetListTransaction*
publishing_piwigo_categories_get_list_transaction_new (PublishingPiwigoSession* session)
{
	return publishing_piwigo_categories_get_list_transaction_construct (PUBLISHING_PIWIGO_TYPE_CATEGORIES_GET_LIST_TRANSACTION, session);
}

static void
publishing_piwigo_categories_get_list_transaction_class_init (PublishingPiwigoCategoriesGetListTransactionClass * klass,
                                                              gpointer klass_data)
{
	publishing_piwigo_categories_get_list_transaction_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_piwigo_categories_get_list_transaction_instance_init (PublishingPiwigoCategoriesGetListTransaction * self,
                                                                 gpointer klass)
{
}

/**
 * Transaction used to implement the fetch categories interaction.
 */
static GType
publishing_piwigo_categories_get_list_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoCategoriesGetListTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_categories_get_list_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoCategoriesGetListTransaction), 0, (GInstanceInitFunc) publishing_piwigo_categories_get_list_transaction_instance_init, NULL };
	GType publishing_piwigo_categories_get_list_transaction_type_id;
	publishing_piwigo_categories_get_list_transaction_type_id = g_type_register_static (PUBLISHING_PIWIGO_TYPE_TRANSACTION, "PublishingPiwigoCategoriesGetListTransaction", &g_define_type_info, 0);
	return publishing_piwigo_categories_get_list_transaction_type_id;
}

GType
publishing_piwigo_categories_get_list_transaction_get_type (void)
{
	static volatile gsize publishing_piwigo_categories_get_list_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_categories_get_list_transaction_type_id__once)) {
		GType publishing_piwigo_categories_get_list_transaction_type_id;
		publishing_piwigo_categories_get_list_transaction_type_id = publishing_piwigo_categories_get_list_transaction_get_type_once ();
		g_once_init_leave (&publishing_piwigo_categories_get_list_transaction_type_id__once, publishing_piwigo_categories_get_list_transaction_type_id);
	}
	return publishing_piwigo_categories_get_list_transaction_type_id__once;
}

PublishingPiwigoSessionLogoutTransaction*
publishing_piwigo_session_logout_transaction_construct (GType object_type,
                                                        PublishingPiwigoSession* session)
{
	PublishingPiwigoSessionLogoutTransaction* self = NULL;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	self = (PublishingPiwigoSessionLogoutTransaction*) publishing_piwigo_transaction_construct_authenticated (object_type, session);
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "method", "pwg.session.logout");
	return self;
}

PublishingPiwigoSessionLogoutTransaction*
publishing_piwigo_session_logout_transaction_new (PublishingPiwigoSession* session)
{
	return publishing_piwigo_session_logout_transaction_construct (PUBLISHING_PIWIGO_TYPE_SESSION_LOGOUT_TRANSACTION, session);
}

static void
publishing_piwigo_session_logout_transaction_class_init (PublishingPiwigoSessionLogoutTransactionClass * klass,
                                                         gpointer klass_data)
{
	publishing_piwigo_session_logout_transaction_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_piwigo_session_logout_transaction_instance_init (PublishingPiwigoSessionLogoutTransaction * self,
                                                            gpointer klass)
{
}

static GType
publishing_piwigo_session_logout_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoSessionLogoutTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_session_logout_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoSessionLogoutTransaction), 0, (GInstanceInitFunc) publishing_piwigo_session_logout_transaction_instance_init, NULL };
	GType publishing_piwigo_session_logout_transaction_type_id;
	publishing_piwigo_session_logout_transaction_type_id = g_type_register_static (PUBLISHING_PIWIGO_TYPE_TRANSACTION, "PublishingPiwigoSessionLogoutTransaction", &g_define_type_info, 0);
	return publishing_piwigo_session_logout_transaction_type_id;
}

GType
publishing_piwigo_session_logout_transaction_get_type (void)
{
	static volatile gsize publishing_piwigo_session_logout_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_session_logout_transaction_type_id__once)) {
		GType publishing_piwigo_session_logout_transaction_type_id;
		publishing_piwigo_session_logout_transaction_type_id = publishing_piwigo_session_logout_transaction_get_type_once ();
		g_once_init_leave (&publishing_piwigo_session_logout_transaction_type_id__once, publishing_piwigo_session_logout_transaction_type_id);
	}
	return publishing_piwigo_session_logout_transaction_type_id__once;
}

PublishingPiwigoCategoriesAddTransaction*
publishing_piwigo_categories_add_transaction_construct (GType object_type,
                                                        PublishingPiwigoSession* session,
                                                        const gchar* category,
                                                        gint parent_id,
                                                        const gchar* comment)
{
	PublishingPiwigoCategoriesAddTransaction* self = NULL;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	g_return_val_if_fail (category != NULL, NULL);
	self = (PublishingPiwigoCategoriesAddTransaction*) publishing_piwigo_transaction_construct_authenticated (object_type, session);
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "method", "pwg.categories.add");
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "name", category);
	if (parent_id != 0) {
		gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = g_strdup_printf ("%i", parent_id);
		_tmp1_ = _tmp0_;
		publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "parent", _tmp1_);
		_g_free0 (_tmp1_);
	}
	if (g_strcmp0 (comment, "") != 0) {
		publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "comment", comment);
	}
	return self;
}

PublishingPiwigoCategoriesAddTransaction*
publishing_piwigo_categories_add_transaction_new (PublishingPiwigoSession* session,
                                                  const gchar* category,
                                                  gint parent_id,
                                                  const gchar* comment)
{
	return publishing_piwigo_categories_add_transaction_construct (PUBLISHING_PIWIGO_TYPE_CATEGORIES_ADD_TRANSACTION, session, category, parent_id, comment);
}

static void
publishing_piwigo_categories_add_transaction_class_init (PublishingPiwigoCategoriesAddTransactionClass * klass,
                                                         gpointer klass_data)
{
	publishing_piwigo_categories_add_transaction_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_piwigo_categories_add_transaction_instance_init (PublishingPiwigoCategoriesAddTransaction * self,
                                                            gpointer klass)
{
}

static GType
publishing_piwigo_categories_add_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoCategoriesAddTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_categories_add_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoCategoriesAddTransaction), 0, (GInstanceInitFunc) publishing_piwigo_categories_add_transaction_instance_init, NULL };
	GType publishing_piwigo_categories_add_transaction_type_id;
	publishing_piwigo_categories_add_transaction_type_id = g_type_register_static (PUBLISHING_PIWIGO_TYPE_TRANSACTION, "PublishingPiwigoCategoriesAddTransaction", &g_define_type_info, 0);
	return publishing_piwigo_categories_add_transaction_type_id;
}

GType
publishing_piwigo_categories_add_transaction_get_type (void)
{
	static volatile gsize publishing_piwigo_categories_add_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_categories_add_transaction_type_id__once)) {
		GType publishing_piwigo_categories_add_transaction_type_id;
		publishing_piwigo_categories_add_transaction_type_id = publishing_piwigo_categories_add_transaction_get_type_once ();
		g_once_init_leave (&publishing_piwigo_categories_add_transaction_type_id__once, publishing_piwigo_categories_add_transaction_type_id);
	}
	return publishing_piwigo_categories_add_transaction_type_id__once;
}

static inline gpointer
publishing_piwigo_images_add_transaction_get_instance_private (PublishingPiwigoImagesAddTransaction* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingPiwigoImagesAddTransaction_private_offset);
}

static gpointer
_publishing_rest_support_session_ref0 (gpointer self)
{
	return self ? publishing_rest_support_session_ref (self) : NULL;
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static void
_publishing_piwigo_images_add_transaction_on_completed_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender,
                                                                                                      gpointer self)
{
	publishing_piwigo_images_add_transaction_on_completed ((PublishingPiwigoImagesAddTransaction*) self);
}

PublishingPiwigoImagesAddTransaction*
publishing_piwigo_images_add_transaction_construct (GType object_type,
                                                    PublishingPiwigoSession* session,
                                                    PublishingPiwigoPublishingParameters* parameters,
                                                    SpitPublishingPublishable* publishable)
{
	PublishingPiwigoImagesAddTransaction* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	PublishingPiwigoSession* _tmp2_;
	PublishingPiwigoPublishingParameters* _tmp3_;
	gchar** keywords = NULL;
	gint _tmp4_ = 0;
	gchar** _tmp5_;
	gint keywords_length1;
	gint _keywords_size_;
	gchar* tags = NULL;
	gchar* _tmp6_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	GFile* _tmp10_;
	GFile* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	PublishingPiwigoCategory* _tmp14_;
	PublishingPiwigoPermissionLevel* _tmp15_;
	gchar* name = NULL;
	gchar* _tmp16_;
	gchar* comment = NULL;
	gchar* _tmp17_;
	gboolean _tmp18_ = FALSE;
	const gchar* _tmp19_;
	PublishingPiwigoCategory* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	PublishingPiwigoPermissionLevel* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	GHashTable* disposition_table = NULL;
	GHashFunc _tmp42_;
	GEqualFunc _tmp43_;
	GHashTable* _tmp44_;
	gchar* basename = NULL;
	gchar* _tmp45_;
	gboolean _tmp46_ = FALSE;
	const gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gboolean _tmp50_;
	GHashTable* _tmp56_;
	gchar* _tmp57_;
	const gchar* _tmp58_;
	gchar* _tmp59_;
	GHashTable* _tmp60_;
	gchar* _tmp61_;
	gchar* _tmp62_;
	GHashTable* _tmp63_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_PUBLISHING_PARAMETERS (parameters), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (publishable, SPIT_PUBLISHING_TYPE_PUBLISHABLE), NULL);
	_tmp0_ = publishing_piwigo_session_get_pwg_url (session);
	_tmp1_ = _tmp0_;
	self = (PublishingPiwigoImagesAddTransaction*) publishing_rest_support_upload_transaction_construct_with_endpoint_url (object_type, G_TYPE_CHECK_INSTANCE_CAST (session, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), publishable, _tmp1_);
	_g_free0 (_tmp1_);
	_tmp2_ = _publishing_rest_support_session_ref0 (session);
	_publishing_rest_support_session_unref0 (self->priv->session);
	self->priv->session = _tmp2_;
	_tmp3_ = _publishing_piwigo_publishing_parameters_ref0 (parameters);
	_publishing_piwigo_publishing_parameters_unref0 (self->priv->parameters);
	self->priv->parameters = _tmp3_;
	_tmp5_ = spit_publishing_publishable_get_publishing_keywords (publishable, &_tmp4_);
	keywords = _tmp5_;
	keywords_length1 = _tmp4_;
	_keywords_size_ = keywords_length1;
	_tmp6_ = g_strdup ("");
	tags = _tmp6_;
	_tmp7_ = keywords;
	_tmp7__length1 = keywords_length1;
	if (_tmp7_ != NULL) {
		gchar** _tmp8_;
		gint _tmp8__length1;
		gchar* _tmp9_;
		_tmp8_ = keywords;
		_tmp8__length1 = keywords_length1;
		_tmp9_ = _vala_g_strjoinv (",", _tmp8_, (gint) _tmp8__length1);
		_g_free0 (tags);
		tags = _tmp9_;
	}
	_tmp10_ = spit_publishing_publishable_get_serialized_file (publishable);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_file_get_basename (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = parameters->category;
	_tmp15_ = parameters->perm_level;
	g_debug ("PiwigoPublishing.vala:1745: PiwigoConnector: Uploading photo %s to cat" \
"egory id %d with perm level %d", _tmp13_, _tmp14_->id, _tmp15_->id);
	_g_free0 (_tmp13_);
	_g_object_unref0 (_tmp11_);
	_tmp16_ = spit_publishing_publishable_get_publishing_name (publishable);
	name = _tmp16_;
	_tmp17_ = spit_publishing_publishable_get_param_string (publishable, SPIT_PUBLISHING_PUBLISHABLE_PARAM_STRING_COMMENT);
	comment = _tmp17_;
	_tmp19_ = name;
	if (_tmp19_ == NULL) {
		_tmp18_ = TRUE;
	} else {
		const gchar* _tmp20_;
		_tmp20_ = name;
		_tmp18_ = g_strcmp0 (_tmp20_, "") == 0;
	}
	if (_tmp18_) {
		gchar* _tmp21_;
		const gchar* _tmp22_;
		gboolean _tmp23_ = FALSE;
		const gchar* _tmp24_;
		_tmp21_ = spit_publishing_publishable_get_param_string (publishable, SPIT_PUBLISHING_PUBLISHABLE_PARAM_STRING_BASENAME);
		_g_free0 (name);
		name = _tmp21_;
		_tmp22_ = name;
		publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "name", _tmp22_);
		_tmp24_ = comment;
		if (_tmp24_ != NULL) {
			const gchar* _tmp25_;
			_tmp25_ = comment;
			_tmp23_ = g_strcmp0 (_tmp25_, "") != 0;
		} else {
			_tmp23_ = FALSE;
		}
		if (_tmp23_) {
			const gchar* _tmp26_;
			_tmp26_ = comment;
			publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "comment", _tmp26_);
		}
	} else {
		gboolean _tmp27_ = FALSE;
		const gchar* _tmp28_;
		_tmp28_ = comment;
		if (_tmp28_ != NULL) {
			const gchar* _tmp29_;
			_tmp29_ = comment;
			_tmp27_ = g_strcmp0 (_tmp29_, "") != 0;
		} else {
			_tmp27_ = FALSE;
		}
		if (_tmp27_) {
			const gchar* _tmp30_;
			const gchar* _tmp31_;
			_tmp30_ = name;
			publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "name", _tmp30_);
			_tmp31_ = comment;
			publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "comment", _tmp31_);
		} else {
			if (parameters->title_as_comment) {
				const gchar* _tmp32_;
				_tmp32_ = name;
				publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "comment", _tmp32_);
			} else {
				const gchar* _tmp33_;
				_tmp33_ = name;
				publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "name", _tmp33_);
			}
		}
	}
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "method", "pwg.images.addSimple");
	_tmp34_ = parameters->category;
	_tmp35_ = g_strdup_printf ("%i", _tmp34_->id);
	_tmp36_ = _tmp35_;
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "category", _tmp36_);
	_g_free0 (_tmp36_);
	_tmp37_ = parameters->perm_level;
	_tmp38_ = g_strdup_printf ("%i", _tmp37_->id);
	_tmp39_ = _tmp38_;
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "level", _tmp39_);
	_g_free0 (_tmp39_);
	if (!parameters->no_upload_tags) {
		const gchar* _tmp40_;
		_tmp40_ = tags;
		if (g_strcmp0 (_tmp40_, "") != 0) {
			const gchar* _tmp41_;
			_tmp41_ = tags;
			publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "tags", _tmp41_);
		}
	}
	_tmp42_ = g_str_hash;
	_tmp43_ = g_str_equal;
	_tmp44_ = g_hash_table_new_full (_tmp42_, _tmp43_, _g_free0_, _g_free0_);
	disposition_table = _tmp44_;
	_tmp45_ = spit_publishing_publishable_get_param_string (publishable, SPIT_PUBLISHING_PUBLISHABLE_PARAM_STRING_BASENAME);
	basename = _tmp45_;
	_tmp47_ = basename;
	_tmp48_ = g_utf8_strdown (_tmp47_, (gssize) -1);
	_tmp49_ = _tmp48_;
	_tmp50_ = !g_str_has_suffix (_tmp49_, ".jpeg");
	_g_free0 (_tmp49_);
	if (_tmp50_) {
		const gchar* _tmp51_;
		gchar* _tmp52_;
		gchar* _tmp53_;
		_tmp51_ = basename;
		_tmp52_ = g_utf8_strdown (_tmp51_, (gssize) -1);
		_tmp53_ = _tmp52_;
		_tmp46_ = !g_str_has_suffix (_tmp53_, ".jpg");
		_g_free0 (_tmp53_);
	} else {
		_tmp46_ = FALSE;
	}
	if (_tmp46_) {
		const gchar* _tmp54_;
		gchar* _tmp55_;
		_tmp54_ = basename;
		_tmp55_ = g_strconcat (_tmp54_, ".jpg", NULL);
		_g_free0 (basename);
		basename = _tmp55_;
	}
	_tmp56_ = disposition_table;
	_tmp57_ = g_strdup ("filename");
	_tmp58_ = basename;
	_tmp59_ = g_uri_escape_string (_tmp58_, NULL, TRUE);
	g_hash_table_insert (_tmp56_, _tmp57_, _tmp59_);
	_tmp60_ = disposition_table;
	_tmp61_ = g_strdup ("name");
	_tmp62_ = g_strdup ("image");
	g_hash_table_insert (_tmp60_, _tmp61_, _tmp62_);
	_tmp63_ = disposition_table;
	publishing_rest_support_upload_transaction_set_binary_disposition_table (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_UPLOAD_TRANSACTION, PublishingRESTSupportUploadTransaction), _tmp63_);
	g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_UPLOAD_TRANSACTION, PublishingRESTSupportUploadTransaction), PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "completed", (GCallback) _publishing_piwigo_images_add_transaction_on_completed_publishing_rest_support_transaction_completed, self);
	_g_free0 (basename);
	_g_hash_table_unref0 (disposition_table);
	_g_free0 (comment);
	_g_free0 (name);
	_g_free0 (tags);
	keywords = (_vala_array_free (keywords, keywords_length1, (GDestroyNotify) g_free), NULL);
	return self;
}

PublishingPiwigoImagesAddTransaction*
publishing_piwigo_images_add_transaction_new (PublishingPiwigoSession* session,
                                              PublishingPiwigoPublishingParameters* parameters,
                                              SpitPublishingPublishable* publishable)
{
	return publishing_piwigo_images_add_transaction_construct (PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_TRANSACTION, session, parameters, publishable);
}

static void
publishing_piwigo_images_add_transaction_on_completed (PublishingPiwigoImagesAddTransaction* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (PUBLISHING_PIWIGO_IS_IMAGES_ADD_TRANSACTION (self));
	{
		PublishingRESTSupportXmlDocument* resp_doc = NULL;
		gchar* _tmp0_;
		gchar* _tmp1_;
		PublishingRESTSupportXmlDocument* _tmp2_;
		PublishingRESTSupportXmlDocument* _tmp3_;
		xmlNode* image_node = NULL;
		PublishingRESTSupportXmlDocument* _tmp4_;
		PublishingRESTSupportXmlDocument* _tmp5_;
		xmlNode* _tmp6_;
		xmlNode* _tmp7_;
		gchar* image_id = NULL;
		xmlNode* _tmp8_;
		gchar* _tmp9_;
		gboolean _tmp10_ = FALSE;
		PublishingPiwigoPublishingParameters* _tmp11_;
		_tmp0_ = publishing_rest_support_transaction_get_response (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_UPLOAD_TRANSACTION, PublishingRESTSupportUploadTransaction), PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
		_tmp1_ = _tmp0_;
		_tmp2_ = publishing_rest_support_xml_document_parse_string (_tmp1_, _publishing_piwigo_transaction_validate_xml_publishing_rest_support_xml_document_check_for_error_response, NULL, &_inner_error0_);
		_tmp3_ = _tmp2_;
		_g_free0 (_tmp1_);
		resp_doc = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp4_ = resp_doc;
		_tmp5_ = resp_doc;
		_tmp6_ = publishing_rest_support_xml_document_get_root_node (_tmp5_);
		_tmp7_ = publishing_rest_support_xml_document_get_named_child (_tmp4_, _tmp6_, "image_id", &_inner_error0_);
		image_node = _tmp7_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_publishing_rest_support_xml_document_unref0 (resp_doc);
			if (_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
				goto __catch0_spit_publishing_publishing_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp8_ = image_node;
		_tmp9_ = (gchar*) xmlNodeGetContent (_tmp8_);
		image_id = _tmp9_;
		_tmp11_ = self->priv->parameters;
		if (!_tmp11_->no_upload_ratings) {
			SpitPublishingPublishable* _tmp12_;
			_tmp12_ = G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_UPLOAD_TRANSACTION, PublishingRESTSupportUploadTransaction)->publishable;
			_tmp10_ = spit_publishing_publishable_get_rating (_tmp12_) > ((guint) 0);
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			PublishingPiwigoSession* _tmp13_;
			SpitPublishingPublishable* _tmp14_;
			const gchar* _tmp15_;
			PublishingPiwigoImagesAddRating* _tmp16_;
			PublishingPiwigoImagesAddRating* _tmp17_;
			_tmp13_ = self->priv->session;
			_tmp14_ = G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_UPLOAD_TRANSACTION, PublishingRESTSupportUploadTransaction)->publishable;
			_tmp15_ = image_id;
			_tmp16_ = publishing_piwigo_images_add_rating_new (_tmp13_, _tmp14_, _tmp15_);
			_tmp17_ = _tmp16_;
			_publishing_rest_support_transaction_unref0 (_tmp17_);
		}
		_g_free0 (image_id);
		_publishing_rest_support_xml_document_unref0 (resp_doc);
	}
	goto __finally0;
	__catch0_spit_publishing_publishing_error:
	{
		g_clear_error (&_inner_error0_);
		g_debug ("PiwigoPublishing.vala:1813: Response parse error");
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
publishing_piwigo_images_add_transaction_class_init (PublishingPiwigoImagesAddTransactionClass * klass,
                                                     gpointer klass_data)
{
	publishing_piwigo_images_add_transaction_parent_class = g_type_class_peek_parent (klass);
	((PublishingRESTSupportTransactionClass *) klass)->finalize = publishing_piwigo_images_add_transaction_finalize;
	g_type_class_adjust_private_offset (klass, &PublishingPiwigoImagesAddTransaction_private_offset);
}

static void
publishing_piwigo_images_add_transaction_instance_init (PublishingPiwigoImagesAddTransaction * self,
                                                        gpointer klass)
{
	self->priv = publishing_piwigo_images_add_transaction_get_instance_private (self);
	self->priv->parameters = NULL;
	self->priv->session = NULL;
}

static void
publishing_piwigo_images_add_transaction_finalize (PublishingRESTSupportTransaction * obj)
{
	PublishingPiwigoImagesAddTransaction * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_TRANSACTION, PublishingPiwigoImagesAddTransaction);
	_publishing_piwigo_publishing_parameters_unref0 (self->priv->parameters);
	_publishing_rest_support_session_unref0 (self->priv->session);
	PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_piwigo_images_add_transaction_parent_class)->finalize (obj);
}

static GType
publishing_piwigo_images_add_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoImagesAddTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_images_add_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoImagesAddTransaction), 0, (GInstanceInitFunc) publishing_piwigo_images_add_transaction_instance_init, NULL };
	GType publishing_piwigo_images_add_transaction_type_id;
	publishing_piwigo_images_add_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_UPLOAD_TRANSACTION, "PublishingPiwigoImagesAddTransaction", &g_define_type_info, 0);
	PublishingPiwigoImagesAddTransaction_private_offset = g_type_add_instance_private (publishing_piwigo_images_add_transaction_type_id, sizeof (PublishingPiwigoImagesAddTransactionPrivate));
	return publishing_piwigo_images_add_transaction_type_id;
}

GType
publishing_piwigo_images_add_transaction_get_type (void)
{
	static volatile gsize publishing_piwigo_images_add_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_images_add_transaction_type_id__once)) {
		GType publishing_piwigo_images_add_transaction_type_id;
		publishing_piwigo_images_add_transaction_type_id = publishing_piwigo_images_add_transaction_get_type_once ();
		g_once_init_leave (&publishing_piwigo_images_add_transaction_type_id__once, publishing_piwigo_images_add_transaction_type_id);
	}
	return publishing_piwigo_images_add_transaction_type_id__once;
}

PublishingPiwigoImagesAddRating*
publishing_piwigo_images_add_rating_construct (GType object_type,
                                               PublishingPiwigoSession* session,
                                               SpitPublishingPublishable* publishable,
                                               const gchar* image_id)
{
	PublishingPiwigoImagesAddRating* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (PUBLISHING_PIWIGO_IS_SESSION (session), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (publishable, SPIT_PUBLISHING_TYPE_PUBLISHABLE), NULL);
	g_return_val_if_fail (image_id != NULL, NULL);
	_tmp0_ = publishing_piwigo_session_get_pwg_url (session);
	_tmp1_ = _tmp0_;
	self = (PublishingPiwigoImagesAddRating*) publishing_rest_support_transaction_construct_with_endpoint_url (object_type, G_TYPE_CHECK_INSTANCE_CAST (session, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), _tmp1_, PUBLISHING_REST_SUPPORT_HTTP_METHOD_POST);
	_g_free0 (_tmp1_);
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "method", "pwg.images.rate");
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "image_id", image_id);
	_tmp2_ = g_strdup_printf ("%u", spit_publishing_publishable_get_rating (publishable));
	_tmp3_ = _tmp2_;
	publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "rate", _tmp3_);
	_g_free0 (_tmp3_);
	publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_PIWIGO_TYPE_TRANSACTION, PublishingPiwigoTransaction), PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), NULL, NULL);
	return self;
}

PublishingPiwigoImagesAddRating*
publishing_piwigo_images_add_rating_new (PublishingPiwigoSession* session,
                                         SpitPublishingPublishable* publishable,
                                         const gchar* image_id)
{
	return publishing_piwigo_images_add_rating_construct (PUBLISHING_PIWIGO_TYPE_IMAGES_ADD_RATING, session, publishable, image_id);
}

static void
publishing_piwigo_images_add_rating_class_init (PublishingPiwigoImagesAddRatingClass * klass,
                                                gpointer klass_data)
{
	publishing_piwigo_images_add_rating_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_piwigo_images_add_rating_instance_init (PublishingPiwigoImagesAddRating * self,
                                                   gpointer klass)
{
}

static GType
publishing_piwigo_images_add_rating_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingPiwigoImagesAddRatingClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_piwigo_images_add_rating_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingPiwigoImagesAddRating), 0, (GInstanceInitFunc) publishing_piwigo_images_add_rating_instance_init, NULL };
	GType publishing_piwigo_images_add_rating_type_id;
	publishing_piwigo_images_add_rating_type_id = g_type_register_static (PUBLISHING_PIWIGO_TYPE_TRANSACTION, "PublishingPiwigoImagesAddRating", &g_define_type_info, 0);
	return publishing_piwigo_images_add_rating_type_id;
}

GType
publishing_piwigo_images_add_rating_get_type (void)
{
	static volatile gsize publishing_piwigo_images_add_rating_type_id__once = 0;
	if (g_once_init_enter (&publishing_piwigo_images_add_rating_type_id__once)) {
		GType publishing_piwigo_images_add_rating_type_id;
		publishing_piwigo_images_add_rating_type_id = publishing_piwigo_images_add_rating_get_type_once ();
		g_once_init_leave (&publishing_piwigo_images_add_rating_type_id__once, publishing_piwigo_images_add_rating_type_id);
	}
	return publishing_piwigo_images_add_rating_type_id__once;
}

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

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

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

