/* BookWyrmPage.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from BookWyrmPage.vala, do not modify */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <gee.h>
#include <gio/gio.h>
#include <libsoup/soup.h>
#include <json-glib/json-glib.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TUBA_WIDGETS_TYPE_BOOK_WYRM_PAGE (tuba_widgets_book_wyrm_page_get_type ())
#define TUBA_WIDGETS_BOOK_WYRM_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_BOOK_WYRM_PAGE, TubaWidgetsBookWyrmPage))
#define TUBA_WIDGETS_BOOK_WYRM_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_BOOK_WYRM_PAGE, TubaWidgetsBookWyrmPageClass))
#define TUBA_WIDGETS_IS_BOOK_WYRM_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_BOOK_WYRM_PAGE))
#define TUBA_WIDGETS_IS_BOOK_WYRM_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_BOOK_WYRM_PAGE))
#define TUBA_WIDGETS_BOOK_WYRM_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_BOOK_WYRM_PAGE, TubaWidgetsBookWyrmPageClass))

typedef struct _TubaWidgetsBookWyrmPage TubaWidgetsBookWyrmPage;
typedef struct _TubaWidgetsBookWyrmPageClass TubaWidgetsBookWyrmPageClass;
typedef struct _TubaWidgetsBookWyrmPagePrivate TubaWidgetsBookWyrmPagePrivate;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_BOOK_WYRM (tuba_api_book_wyrm_get_type ())
#define TUBA_API_BOOK_WYRM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_BOOK_WYRM, TubaAPIBookWyrm))
#define TUBA_API_BOOK_WYRM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_BOOK_WYRM, TubaAPIBookWyrmClass))
#define TUBA_API_IS_BOOK_WYRM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_BOOK_WYRM))
#define TUBA_API_IS_BOOK_WYRM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_BOOK_WYRM))
#define TUBA_API_BOOK_WYRM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_BOOK_WYRM, TubaAPIBookWyrmClass))

typedef struct _TubaAPIBookWyrm TubaAPIBookWyrm;
typedef struct _TubaAPIBookWyrmClass TubaAPIBookWyrmClass;
enum  {
	TUBA_WIDGETS_BOOK_WYRM_PAGE_0_PROPERTY,
	TUBA_WIDGETS_BOOK_WYRM_PAGE_BOOK_PROPERTY,
	TUBA_WIDGETS_BOOK_WYRM_PAGE_SELECTABLE_PROPERTY,
	TUBA_WIDGETS_BOOK_WYRM_PAGE_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_book_wyrm_page_properties[TUBA_WIDGETS_BOOK_WYRM_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TUBA_API_TYPE_BOOK_WYRM_COVER (tuba_api_book_wyrm_cover_get_type ())
#define TUBA_API_BOOK_WYRM_COVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_BOOK_WYRM_COVER, TubaAPIBookWyrmCover))
#define TUBA_API_BOOK_WYRM_COVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_BOOK_WYRM_COVER, TubaAPIBookWyrmCoverClass))
#define TUBA_API_IS_BOOK_WYRM_COVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_BOOK_WYRM_COVER))
#define TUBA_API_IS_BOOK_WYRM_COVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_BOOK_WYRM_COVER))
#define TUBA_API_BOOK_WYRM_COVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_BOOK_WYRM_COVER, TubaAPIBookWyrmCoverClass))

typedef struct _TubaAPIBookWyrmCover TubaAPIBookWyrmCover;
typedef struct _TubaAPIBookWyrmCoverClass TubaAPIBookWyrmCoverClass;
typedef void (*TubaHelperImageOnItemChangedFn) (GdkPaintable* data, gpointer user_data);
typedef struct _Block119Data Block119Data;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TUBA_TYPE_REQUEST (tuba_request_get_type ())
#define TUBA_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST, TubaRequest))
#define TUBA_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST, TubaRequestClass))
#define TUBA_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST))
#define TUBA_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST))
#define TUBA_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST, TubaRequestClass))

typedef struct _TubaRequest TubaRequest;
typedef struct _TubaRequestClass TubaRequestClass;
typedef void (*TubaNetworkSuccessCallback) (GInputStream* in_stream, SoupMessageHeaders* response_headers, gpointer user_data, GError** error);

#define TUBA_TYPE_NETWORK (tuba_network_get_type ())
#define TUBA_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_NETWORK, TubaNetwork))
#define TUBA_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_NETWORK, TubaNetworkClass))
#define TUBA_IS_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_NETWORK))
#define TUBA_IS_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_NETWORK))
#define TUBA_NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_NETWORK, TubaNetworkClass))

typedef struct _TubaNetwork TubaNetwork;
typedef struct _TubaNetworkClass TubaNetworkClass;

#define TUBA_API_TYPE_BOOK_WYRM_AUTHOR (tuba_api_book_wyrm_author_get_type ())
#define TUBA_API_BOOK_WYRM_AUTHOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_BOOK_WYRM_AUTHOR, TubaAPIBookWyrmAuthor))
#define TUBA_API_BOOK_WYRM_AUTHOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_BOOK_WYRM_AUTHOR, TubaAPIBookWyrmAuthorClass))
#define TUBA_API_IS_BOOK_WYRM_AUTHOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_BOOK_WYRM_AUTHOR))
#define TUBA_API_IS_BOOK_WYRM_AUTHOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_BOOK_WYRM_AUTHOR))
#define TUBA_API_BOOK_WYRM_AUTHOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_BOOK_WYRM_AUTHOR, TubaAPIBookWyrmAuthorClass))

typedef struct _TubaAPIBookWyrmAuthor TubaAPIBookWyrmAuthor;
typedef struct _TubaAPIBookWyrmAuthorClass TubaAPIBookWyrmAuthorClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
typedef void (*TubaNetworkErrorCallback) (gint32 code, const gchar* reason, gpointer user_data);

struct _TubaWidgetsBookWyrmPage {
	GtkBox parent_instance;
	TubaWidgetsBookWyrmPagePrivate * priv;
};

struct _TubaWidgetsBookWyrmPageClass {
	GtkBoxClass parent_class;
};

struct _TubaWidgetsBookWyrmPagePrivate {
	TubaAPIBookWyrm* _book;
	GtkPicture* cover;
	GtkLabel* title;
	GtkLabel* authors;
	GtkLabel* isbn;
	GtkButton* ol_btn;
	GtkLabel* description;
	GtkLabel* date;
	gchar** author_labels;
	gint author_labels_length1;
	gint _author_labels_size_;
};

struct _Block119Data {
	int _ref_count_;
	TubaWidgetsBookWyrmPage* self;
	gchar* author;
};

static gint TubaWidgetsBookWyrmPage_private_offset;
static gpointer tuba_widgets_book_wyrm_page_parent_class = NULL;
VALA_EXTERN TubaNetwork* tuba_network;

VALA_EXTERN GType tuba_widgets_book_wyrm_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsBookWyrmPage, g_object_unref)
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_book_wyrm_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIBookWyrm, g_object_unref)
VALA_EXTERN TubaWidgetsBookWyrmPage* tuba_widgets_book_wyrm_page_new (TubaAPIBookWyrm* t_obj);
VALA_EXTERN TubaWidgetsBookWyrmPage* tuba_widgets_book_wyrm_page_construct (GType object_type,
                                                                TubaAPIBookWyrm* t_obj);
static void tuba_widgets_book_wyrm_page_set_book (TubaWidgetsBookWyrmPage* self,
                                           TubaAPIBookWyrm* value);
VALA_EXTERN const gchar* tuba_api_book_wyrm_get_title (TubaAPIBookWyrm* self);
VALA_EXTERN GType tuba_api_book_wyrm_cover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIBookWyrmCover, g_object_unref)
VALA_EXTERN TubaAPIBookWyrmCover* tuba_api_book_wyrm_get_cover (TubaAPIBookWyrm* self);
VALA_EXTERN const gchar* tuba_api_book_wyrm_cover_get_url (TubaAPIBookWyrmCover* self);
VALA_EXTERN void tuba_helper_image_request_paintable (const gchar* url,
                                          const gchar* blurhash,
                                          gboolean disable_cache,
                                          TubaHelperImageOnItemChangedFn cb,
                                          gpointer cb_target,
                                          GDestroyNotify cb_target_destroy_notify);
static void tuba_widgets_book_wyrm_page_on_cache_response (TubaWidgetsBookWyrmPage* self,
                                                    GdkPaintable* data);
static void _tuba_widgets_book_wyrm_page_on_cache_response_tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                                                          gpointer self);
VALA_EXTERN const gchar* tuba_api_book_wyrm_cover_get_name (TubaAPIBookWyrmCover* self);
VALA_EXTERN GeeArrayList* tuba_api_book_wyrm_get_authors (TubaAPIBookWyrm* self);
static Block119Data* block119_data_ref (Block119Data* _data119_);
static void block119_data_unref (void * _userdata_);
VALA_EXTERN TubaRequest* tuba_request_new_GET (const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_construct_GET (GType object_type,
                                         const gchar* url);
VALA_EXTERN GType tuba_request_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequest, g_object_unref)
VALA_EXTERN TubaRequest* tuba_request_then (TubaRequest* self,
                                TubaNetworkSuccessCallback cb,
                                gpointer cb_target,
                                GDestroyNotify cb_target_destroy_notify);
static void _____lambda56_ (Block119Data* _data119_,
                     GInputStream* in_stream,
                     GError** error);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream (GInputStream* in_stream,
                                                      GError** error);
VALA_EXTERN GType tuba_network_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaNetwork, g_object_unref)
VALA_EXTERN JsonNode* tuba_network_parse_node (TubaNetwork* self,
                                   JsonParser* parser);
VALA_EXTERN GType tuba_api_book_wyrm_author_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIBookWyrmAuthor, g_object_unref)
VALA_EXTERN TubaAPIBookWyrmAuthor* tuba_api_book_wyrm_author_from (JsonNode* node,
                                                       GError** error);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN const gchar* tuba_api_book_wyrm_author_get_id (TubaAPIBookWyrmAuthor* self);
static gchar* tuba_widgets_book_wyrm_page_generate_authors_label (TubaWidgetsBookWyrmPage* self,
                                                           const gchar* author,
                                                           const gchar* author_url);
VALA_EXTERN const gchar* tuba_api_book_wyrm_author_get_name (TubaAPIBookWyrmAuthor* self);
static void ______lambda56__tuba_network_success_callback (GInputStream* in_stream,
                                                    SoupMessageHeaders* response_headers,
                                                    gpointer self,
                                                    GError** error);
VALA_EXTERN TubaRequest* tuba_request_on_error (TubaRequest* self,
                                    TubaNetworkErrorCallback cb,
                                    gpointer cb_target,
                                    GDestroyNotify cb_target_destroy_notify);
static void _____lambda57_ (TubaWidgetsBookWyrmPage* self);
static void ______lambda57__tuba_network_error_callback (gint32 code,
                                                  const gchar* reason,
                                                  gpointer self);
VALA_EXTERN TubaRequest* tuba_request_exec (TubaRequest* self);
VALA_EXTERN const gchar* tuba_api_book_wyrm_get_isbn13 (TubaAPIBookWyrm* self);
VALA_EXTERN const gchar* tuba_api_book_wyrm_get_openlibraryKey (TubaAPIBookWyrm* self);
VALA_EXTERN const gchar* tuba_api_book_wyrm_get_description (TubaAPIBookWyrm* self);
VALA_EXTERN gchar* tuba_utils_htmlx_remove_tags (const gchar* content);
VALA_EXTERN const gchar* tuba_api_book_wyrm_get_publishedDate (TubaAPIBookWyrm* self);
static gchar* tuba_widgets_book_wyrm_page_authors_markup (TubaWidgetsBookWyrmPage* self,
                                                   const gchar* author,
                                                   const gchar* author_url);
static void _vala_array_add104 (gchar** * array,
                         gint* length,
                         gint* size,
                         gchar* value);
static void tuba_widgets_book_wyrm_page_open_on_openlibrary (TubaWidgetsBookWyrmPage* self);
VALA_EXTERN void tuba_utils_host_open_url (const gchar* _uri,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN gboolean tuba_utils_host_open_url_finish (GAsyncResult* _res_);
VALA_EXTERN TubaAPIBookWyrm* tuba_widgets_book_wyrm_page_get_book (TubaWidgetsBookWyrmPage* self);
static void _tuba_widgets_book_wyrm_page_open_on_openlibrary_gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self);
static void tuba_widgets_book_wyrm_page_open_on_bw (TubaWidgetsBookWyrmPage* self);
VALA_EXTERN const gchar* tuba_api_book_wyrm_get_id (TubaAPIBookWyrm* self);
static void _tuba_widgets_book_wyrm_page_open_on_bw_gtk_button_clicked (GtkButton* _sender,
                                                                 gpointer self);
VALA_EXTERN void tuba_widgets_book_wyrm_page_set_selectable (TubaWidgetsBookWyrmPage* self,
                                                 gboolean value);
static void tuba_widgets_book_wyrm_page_finalize (GObject * obj);
static GType tuba_widgets_book_wyrm_page_get_type_once (void);
static void _vala_tuba_widgets_book_wyrm_page_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_tuba_widgets_book_wyrm_page_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
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 inline gpointer
tuba_widgets_book_wyrm_page_get_instance_private (TubaWidgetsBookWyrmPage* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsBookWyrmPage_private_offset);
}

static void
_tuba_widgets_book_wyrm_page_on_cache_response_tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                                                     gpointer self)
{
	tuba_widgets_book_wyrm_page_on_cache_response ((TubaWidgetsBookWyrmPage*) self, data);
}

static Block119Data*
block119_data_ref (Block119Data* _data119_)
{
	g_atomic_int_inc (&_data119_->_ref_count_);
	return _data119_;
}

static void
block119_data_unref (void * _userdata_)
{
	Block119Data* _data119_;
	_data119_ = (Block119Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data119_->_ref_count_)) {
		TubaWidgetsBookWyrmPage* self;
		self = _data119_->self;
		_g_free0 (_data119_->author);
		_g_object_unref0 (self);
		g_slice_free (Block119Data, _data119_);
	}
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static void
_____lambda56_ (Block119Data* _data119_,
                GInputStream* in_stream,
                GError** error)
{
	TubaWidgetsBookWyrmPage* self;
	JsonParser* parser = NULL;
	JsonParser* _tmp0_;
	JsonNode* node = NULL;
	TubaNetwork* _tmp1_;
	JsonParser* _tmp2_;
	JsonNode* _tmp3_;
	TubaAPIBookWyrmAuthor* author_obj = NULL;
	JsonNode* _tmp4_;
	TubaAPIBookWyrmAuthor* _tmp5_;
	TubaAPIBookWyrmAuthor* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	GError* _inner_error0_ = NULL;
	self = _data119_->self;
	g_return_if_fail (in_stream != NULL);
	_tmp0_ = tuba_network_get_parser_from_inputstream (in_stream, &_inner_error0_);
	parser = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp1_ = tuba_network;
	_tmp2_ = parser;
	_tmp3_ = tuba_network_parse_node (_tmp1_, _tmp2_);
	node = _tmp3_;
	_tmp4_ = node;
	_tmp5_ = tuba_api_book_wyrm_author_from (_tmp4_, &_inner_error0_);
	author_obj = _tmp5_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		__vala_JsonNode_free0 (node);
		_g_object_unref0 (parser);
		return;
	}
	_tmp6_ = author_obj;
	_tmp7_ = tuba_api_book_wyrm_author_get_id (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = _data119_->author;
	if (g_strcmp0 (_tmp8_, _tmp9_) == 0) {
		GtkLabel* _tmp10_;
		TubaAPIBookWyrmAuthor* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		TubaAPIBookWyrmAuthor* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		_tmp10_ = self->priv->authors;
		_tmp11_ = author_obj;
		_tmp12_ = tuba_api_book_wyrm_author_get_name (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = author_obj;
		_tmp15_ = tuba_api_book_wyrm_author_get_id (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = tuba_widgets_book_wyrm_page_generate_authors_label (self, _tmp13_, _tmp16_);
		_tmp18_ = _tmp17_;
		gtk_label_set_label (_tmp10_, _tmp18_);
		_g_free0 (_tmp18_);
	}
	_g_object_unref0 (author_obj);
	__vala_JsonNode_free0 (node);
	_g_object_unref0 (parser);
}

static void
______lambda56__tuba_network_success_callback (GInputStream* in_stream,
                                               SoupMessageHeaders* response_headers,
                                               gpointer self,
                                               GError** error)
{
	_____lambda56_ (self, in_stream, error);
}

static void
_____lambda57_ (TubaWidgetsBookWyrmPage* self)
{
	GtkLabel* _tmp0_;
	_tmp0_ = self->priv->authors;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
}

static void
______lambda57__tuba_network_error_callback (gint32 code,
                                             const gchar* reason,
                                             gpointer self)
{
	_____lambda57_ ((TubaWidgetsBookWyrmPage*) self);
}

TubaWidgetsBookWyrmPage*
tuba_widgets_book_wyrm_page_construct (GType object_type,
                                       TubaAPIBookWyrm* t_obj)
{
	TubaWidgetsBookWyrmPage * self = NULL;
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	TubaAPIBookWyrmCover* _tmp5_;
	TubaAPIBookWyrmCover* _tmp6_;
	gboolean _tmp30_ = FALSE;
	GeeArrayList* _tmp31_;
	GeeArrayList* _tmp32_;
	const gchar* _tmp59_;
	const gchar* _tmp60_;
	const gchar* _tmp68_;
	const gchar* _tmp69_;
	const gchar* _tmp71_;
	const gchar* _tmp72_;
	const gchar* _tmp79_;
	const gchar* _tmp80_;
	g_return_val_if_fail (t_obj != NULL, NULL);
	self = (TubaWidgetsBookWyrmPage*) g_object_new (object_type, NULL);
	tuba_widgets_book_wyrm_page_set_book (self, t_obj);
	_tmp0_ = self->priv->title;
	_tmp1_ = tuba_api_book_wyrm_get_title (t_obj);
	_tmp2_ = _tmp1_;
	gtk_label_set_label (_tmp0_, _tmp2_);
	_tmp5_ = tuba_api_book_wyrm_get_cover (t_obj);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != NULL) {
		TubaAPIBookWyrmCover* _tmp7_;
		TubaAPIBookWyrmCover* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp7_ = tuba_api_book_wyrm_get_cover (t_obj);
		_tmp8_ = _tmp7_;
		_tmp9_ = tuba_api_book_wyrm_cover_get_url (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp4_ = _tmp10_ != NULL;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		TubaAPIBookWyrmCover* _tmp11_;
		TubaAPIBookWyrmCover* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		_tmp11_ = tuba_api_book_wyrm_get_cover (t_obj);
		_tmp12_ = _tmp11_;
		_tmp13_ = tuba_api_book_wyrm_cover_get_url (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp3_ = g_strcmp0 (_tmp14_, "") != 0;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		TubaAPIBookWyrmCover* _tmp15_;
		TubaAPIBookWyrmCover* _tmp16_;
		const gchar* _tmp17_;
		const gchar* _tmp18_;
		TubaAPIBookWyrmCover* _tmp19_;
		TubaAPIBookWyrmCover* _tmp20_;
		const gchar* _tmp21_;
		const gchar* _tmp22_;
		_tmp15_ = tuba_api_book_wyrm_get_cover (t_obj);
		_tmp16_ = _tmp15_;
		_tmp17_ = tuba_api_book_wyrm_cover_get_url (_tmp16_);
		_tmp18_ = _tmp17_;
		tuba_helper_image_request_paintable (_tmp18_, NULL, FALSE, _tuba_widgets_book_wyrm_page_on_cache_response_tuba_helper_image_on_item_changed_fn, g_object_ref (self), g_object_unref);
		_tmp19_ = tuba_api_book_wyrm_get_cover (t_obj);
		_tmp20_ = _tmp19_;
		_tmp21_ = tuba_api_book_wyrm_cover_get_name (_tmp20_);
		_tmp22_ = _tmp21_;
		if (g_strcmp0 (_tmp22_, "") != 0) {
			GtkPicture* _tmp23_;
			GtkPicture* _tmp24_;
			TubaAPIBookWyrmCover* _tmp25_;
			TubaAPIBookWyrmCover* _tmp26_;
			const gchar* _tmp27_;
			const gchar* _tmp28_;
			_tmp23_ = self->priv->cover;
			_tmp24_ = self->priv->cover;
			_tmp25_ = tuba_api_book_wyrm_get_cover (t_obj);
			_tmp26_ = _tmp25_;
			_tmp27_ = tuba_api_book_wyrm_cover_get_name (_tmp26_);
			_tmp28_ = _tmp27_;
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp24_, _tmp28_);
			gtk_picture_set_alternative_text (_tmp23_, _tmp28_);
		}
	} else {
		GtkPicture* _tmp29_;
		_tmp29_ = self->priv->cover;
		gtk_widget_set_visible ((GtkWidget*) _tmp29_, FALSE);
	}
	_tmp31_ = tuba_api_book_wyrm_get_authors (t_obj);
	_tmp32_ = _tmp31_;
	if (_tmp32_ != NULL) {
		GeeArrayList* _tmp33_;
		GeeArrayList* _tmp34_;
		gint _tmp35_;
		gint _tmp36_;
		_tmp33_ = tuba_api_book_wyrm_get_authors (t_obj);
		_tmp34_ = _tmp33_;
		_tmp35_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp34_);
		_tmp36_ = _tmp35_;
		_tmp30_ = _tmp36_ > 0;
	} else {
		_tmp30_ = FALSE;
	}
	if (_tmp30_) {
		{
			GeeArrayList* _author_list = NULL;
			GeeArrayList* _tmp37_;
			GeeArrayList* _tmp38_;
			gint _author_size = 0;
			GeeArrayList* _tmp39_;
			gint _tmp40_;
			gint _tmp41_;
			gint _author_index = 0;
			_tmp37_ = tuba_api_book_wyrm_get_authors (t_obj);
			_tmp38_ = _tmp37_;
			_author_list = _tmp38_;
			_tmp39_ = _author_list;
			_tmp40_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp39_);
			_tmp41_ = _tmp40_;
			_author_size = _tmp41_;
			_author_index = -1;
			while (TRUE) {
				Block119Data* _data119_;
				gint _tmp42_;
				gint _tmp43_;
				GeeArrayList* _tmp44_;
				gpointer _tmp45_;
				const gchar* _tmp46_;
				const gchar* _tmp47_;
				gchar* _tmp48_;
				gchar* _tmp49_;
				TubaRequest* _tmp50_;
				TubaRequest* _tmp51_;
				TubaRequest* _tmp52_;
				TubaRequest* _tmp53_;
				TubaRequest* _tmp54_;
				TubaRequest* _tmp55_;
				TubaRequest* _tmp56_;
				TubaRequest* _tmp57_;
				_data119_ = g_slice_new0 (Block119Data);
				_data119_->_ref_count_ = 1;
				_data119_->self = g_object_ref (self);
				_author_index = _author_index + 1;
				_tmp42_ = _author_index;
				_tmp43_ = _author_size;
				if (!(_tmp42_ < _tmp43_)) {
					block119_data_unref (_data119_);
					_data119_ = NULL;
					break;
				}
				_tmp44_ = _author_list;
				_tmp45_ = gee_abstract_list_get ((GeeAbstractList*) _tmp44_, _author_index);
				_data119_->author = (gchar*) _tmp45_;
				_tmp46_ = _data119_->author;
				_tmp47_ = string_to_string (_tmp46_);
				_tmp48_ = g_strconcat (_tmp47_, ".json", NULL);
				_tmp49_ = _tmp48_;
				_tmp50_ = tuba_request_new_GET (_tmp49_);
				_tmp51_ = _tmp50_;
				_tmp52_ = tuba_request_then (_tmp51_, ______lambda56__tuba_network_success_callback, block119_data_ref (_data119_), block119_data_unref);
				_tmp53_ = _tmp52_;
				_tmp54_ = tuba_request_on_error (_tmp53_, ______lambda57__tuba_network_error_callback, g_object_ref (self), g_object_unref);
				_tmp55_ = _tmp54_;
				_tmp56_ = tuba_request_exec (_tmp55_);
				_tmp57_ = _tmp56_;
				_g_object_unref0 (_tmp57_);
				_g_object_unref0 (_tmp55_);
				_g_object_unref0 (_tmp53_);
				_g_object_unref0 (_tmp51_);
				_g_free0 (_tmp49_);
				block119_data_unref (_data119_);
				_data119_ = NULL;
			}
		}
	} else {
		GtkLabel* _tmp58_;
		_tmp58_ = self->priv->authors;
		gtk_widget_set_visible ((GtkWidget*) _tmp58_, FALSE);
	}
	_tmp59_ = tuba_api_book_wyrm_get_isbn13 (t_obj);
	_tmp60_ = _tmp59_;
	if (g_strcmp0 (_tmp60_, "") != 0) {
		GtkLabel* _tmp61_;
		const gchar* _tmp62_;
		const gchar* _tmp63_;
		const gchar* _tmp64_;
		gchar* _tmp65_;
		gchar* _tmp66_;
		_tmp61_ = self->priv->isbn;
		_tmp62_ = tuba_api_book_wyrm_get_isbn13 (t_obj);
		_tmp63_ = _tmp62_;
		_tmp64_ = string_to_string (_tmp63_);
		_tmp65_ = g_strconcat ("ISBN: ", _tmp64_, NULL);
		_tmp66_ = _tmp65_;
		gtk_label_set_label (_tmp61_, _tmp66_);
		_g_free0 (_tmp66_);
	} else {
		GtkLabel* _tmp67_;
		_tmp67_ = self->priv->isbn;
		gtk_widget_set_visible ((GtkWidget*) _tmp67_, FALSE);
	}
	_tmp68_ = tuba_api_book_wyrm_get_openlibraryKey (t_obj);
	_tmp69_ = _tmp68_;
	if (g_strcmp0 (_tmp69_, "") == 0) {
		GtkButton* _tmp70_;
		_tmp70_ = self->priv->ol_btn;
		gtk_widget_set_visible ((GtkWidget*) _tmp70_, FALSE);
	}
	_tmp71_ = tuba_api_book_wyrm_get_description (t_obj);
	_tmp72_ = _tmp71_;
	if (g_strcmp0 (_tmp72_, "") != 0) {
		GtkLabel* _tmp73_;
		const gchar* _tmp74_;
		const gchar* _tmp75_;
		gchar* _tmp76_;
		gchar* _tmp77_;
		_tmp73_ = self->priv->description;
		_tmp74_ = tuba_api_book_wyrm_get_description (t_obj);
		_tmp75_ = _tmp74_;
		_tmp76_ = tuba_utils_htmlx_remove_tags (_tmp75_);
		_tmp77_ = _tmp76_;
		gtk_label_set_label (_tmp73_, _tmp77_);
		_g_free0 (_tmp77_);
	} else {
		GtkLabel* _tmp78_;
		_tmp78_ = self->priv->description;
		gtk_widget_set_visible ((GtkWidget*) _tmp78_, FALSE);
	}
	_tmp79_ = tuba_api_book_wyrm_get_publishedDate (t_obj);
	_tmp80_ = _tmp79_;
	if (g_strcmp0 (_tmp80_, "") != 0) {
		GtkLabel* _tmp81_;
		const gchar* _tmp82_;
		const gchar* _tmp83_;
		gchar* _tmp84_;
		gchar* _tmp85_;
		_tmp81_ = self->priv->date;
		_tmp82_ = tuba_api_book_wyrm_get_publishedDate (t_obj);
		_tmp83_ = _tmp82_;
		_tmp84_ = g_strdup_printf (_ ("Published: %s"), _tmp83_);
		_tmp85_ = _tmp84_;
		gtk_label_set_label (_tmp81_, _tmp85_);
		_g_free0 (_tmp85_);
	} else {
		GtkLabel* _tmp86_;
		_tmp86_ = self->priv->date;
		gtk_widget_set_visible ((GtkWidget*) _tmp86_, FALSE);
	}
	return self;
}

TubaWidgetsBookWyrmPage*
tuba_widgets_book_wyrm_page_new (TubaAPIBookWyrm* t_obj)
{
	return tuba_widgets_book_wyrm_page_construct (TUBA_WIDGETS_TYPE_BOOK_WYRM_PAGE, t_obj);
}

static gchar*
tuba_widgets_book_wyrm_page_authors_markup (TubaWidgetsBookWyrmPage* self,
                                            const gchar* author,
                                            const gchar* author_url)
{
	gboolean _tmp0_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (author != NULL, NULL);
	if (author_url != NULL) {
		_tmp0_ = g_strcmp0 (author_url, "") != 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp1_ = string_to_string (author_url);
		_tmp2_ = string_to_string (author);
		_tmp3_ = g_strconcat ("<a href=\"", _tmp1_, "\">", _tmp2_, "</a>", NULL);
		result = _tmp3_;
		return result;
	}
	_tmp4_ = g_strdup (author);
	result = _tmp4_;
	return result;
}

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

static 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 gchar*
tuba_widgets_book_wyrm_page_generate_authors_label (TubaWidgetsBookWyrmPage* self,
                                                    const gchar* author,
                                                    const gchar* author_url)
{
	gchar* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (author != NULL, NULL);
	_tmp0_ = tuba_widgets_book_wyrm_page_authors_markup (self, author, author_url);
	_vala_array_add104 (&self->priv->author_labels, &self->priv->author_labels_length1, &self->priv->_author_labels_size_, _tmp0_);
	_tmp1_ = self->priv->author_labels;
	_tmp1__length1 = self->priv->author_labels_length1;
	_tmp2_ = _vala_g_strjoinv (", ", _tmp1_, (gint) _tmp1__length1);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf (_ ("by %s"), _tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	result = _tmp5_;
	return result;
}

static void
tuba_widgets_book_wyrm_page_on_cache_response (TubaWidgetsBookWyrmPage* self,
                                               GdkPaintable* data)
{
	GtkPicture* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->cover;
	gtk_picture_set_paintable (_tmp0_, data);
}

static void
tuba_widgets_book_wyrm_page_open_on_openlibrary (TubaWidgetsBookWyrmPage* self)
{
	TubaAPIBookWyrm* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_book;
	_tmp1_ = tuba_api_book_wyrm_get_openlibraryKey (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_to_string (_tmp2_);
	_tmp4_ = g_strconcat ("https://openlibrary.org/books/", _tmp3_, NULL);
	_tmp5_ = _tmp4_;
	tuba_utils_host_open_url (_tmp5_, NULL, NULL);
	_g_free0 (_tmp5_);
}

static void
_tuba_widgets_book_wyrm_page_open_on_openlibrary_gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self)
{
	tuba_widgets_book_wyrm_page_open_on_openlibrary ((TubaWidgetsBookWyrmPage*) self);
}

static void
tuba_widgets_book_wyrm_page_open_on_bw (TubaWidgetsBookWyrmPage* self)
{
	TubaAPIBookWyrm* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_book;
	_tmp1_ = tuba_api_book_wyrm_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	tuba_utils_host_open_url (_tmp2_, NULL, NULL);
}

static void
_tuba_widgets_book_wyrm_page_open_on_bw_gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self)
{
	tuba_widgets_book_wyrm_page_open_on_bw ((TubaWidgetsBookWyrmPage*) self);
}

TubaAPIBookWyrm*
tuba_widgets_book_wyrm_page_get_book (TubaWidgetsBookWyrmPage* self)
{
	TubaAPIBookWyrm* result;
	TubaAPIBookWyrm* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_book;
	result = _tmp0_;
	return result;
}

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

static void
tuba_widgets_book_wyrm_page_set_book (TubaWidgetsBookWyrmPage* self,
                                      TubaAPIBookWyrm* value)
{
	TubaAPIBookWyrm* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_book_wyrm_page_get_book (self);
	if (old_value != value) {
		TubaAPIBookWyrm* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_book);
		self->priv->_book = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_book_wyrm_page_properties[TUBA_WIDGETS_BOOK_WYRM_PAGE_BOOK_PROPERTY]);
	}
}

void
tuba_widgets_book_wyrm_page_set_selectable (TubaWidgetsBookWyrmPage* self,
                                            gboolean value)
{
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->title;
	_tmp1_ = self->priv->isbn;
	_tmp2_ = self->priv->description;
	gtk_label_set_selectable (_tmp2_, value);
	gtk_label_set_selectable (_tmp1_, value);
	gtk_label_set_selectable (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_book_wyrm_page_properties[TUBA_WIDGETS_BOOK_WYRM_PAGE_SELECTABLE_PROPERTY]);
}

static void
tuba_widgets_book_wyrm_page_class_init (TubaWidgetsBookWyrmPageClass * klass,
                                        gpointer klass_data)
{
	tuba_widgets_book_wyrm_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsBookWyrmPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_book_wyrm_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_book_wyrm_page_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_book_wyrm_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_BOOK_WYRM_PAGE_BOOK_PROPERTY, tuba_widgets_book_wyrm_page_properties[TUBA_WIDGETS_BOOK_WYRM_PAGE_BOOK_PROPERTY] = g_param_spec_object ("book", "book", "book", TUBA_API_TYPE_BOOK_WYRM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_BOOK_WYRM_PAGE_SELECTABLE_PROPERTY, tuba_widgets_book_wyrm_page_properties[TUBA_WIDGETS_BOOK_WYRM_PAGE_SELECTABLE_PROPERTY] = g_param_spec_boolean ("selectable", "selectable", "selectable", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/widgets/bookwyrmpage.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "cover", FALSE, TubaWidgetsBookWyrmPage_private_offset + G_STRUCT_OFFSET (TubaWidgetsBookWyrmPagePrivate, cover));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title", FALSE, TubaWidgetsBookWyrmPage_private_offset + G_STRUCT_OFFSET (TubaWidgetsBookWyrmPagePrivate, title));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "authors", FALSE, TubaWidgetsBookWyrmPage_private_offset + G_STRUCT_OFFSET (TubaWidgetsBookWyrmPagePrivate, authors));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "isbn", FALSE, TubaWidgetsBookWyrmPage_private_offset + G_STRUCT_OFFSET (TubaWidgetsBookWyrmPagePrivate, isbn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "ol_btn", FALSE, TubaWidgetsBookWyrmPage_private_offset + G_STRUCT_OFFSET (TubaWidgetsBookWyrmPagePrivate, ol_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "description", FALSE, TubaWidgetsBookWyrmPage_private_offset + G_STRUCT_OFFSET (TubaWidgetsBookWyrmPagePrivate, description));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "date", FALSE, TubaWidgetsBookWyrmPage_private_offset + G_STRUCT_OFFSET (TubaWidgetsBookWyrmPagePrivate, date));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "open_on_openlibrary", G_CALLBACK(_tuba_widgets_book_wyrm_page_open_on_openlibrary_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "open_on_bw", G_CALLBACK(_tuba_widgets_book_wyrm_page_open_on_bw_gtk_button_clicked));
}

static void
tuba_widgets_book_wyrm_page_instance_init (TubaWidgetsBookWyrmPage * self,
                                           gpointer klass)
{
	gchar** _tmp0_;
	self->priv = tuba_widgets_book_wyrm_page_get_instance_private (self);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	self->priv->author_labels = _tmp0_;
	self->priv->author_labels_length1 = 0;
	self->priv->_author_labels_size_ = self->priv->author_labels_length1;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_widgets_book_wyrm_page_finalize (GObject * obj)
{
	TubaWidgetsBookWyrmPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_BOOK_WYRM_PAGE, TubaWidgetsBookWyrmPage);
	g_debug ("BookWyrmPage.vala:26: Destroying BookWyrmPage");
	_g_object_unref0 (self->priv->_book);
	self->priv->author_labels = (_vala_array_free (self->priv->author_labels, self->priv->author_labels_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (tuba_widgets_book_wyrm_page_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_book_wyrm_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsBookWyrmPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_book_wyrm_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsBookWyrmPage), 0, (GInstanceInitFunc) tuba_widgets_book_wyrm_page_instance_init, NULL };
	GType tuba_widgets_book_wyrm_page_type_id;
	tuba_widgets_book_wyrm_page_type_id = g_type_register_static (gtk_box_get_type (), "TubaWidgetsBookWyrmPage", &g_define_type_info, 0);
	TubaWidgetsBookWyrmPage_private_offset = g_type_add_instance_private (tuba_widgets_book_wyrm_page_type_id, sizeof (TubaWidgetsBookWyrmPagePrivate));
	return tuba_widgets_book_wyrm_page_type_id;
}

GType
tuba_widgets_book_wyrm_page_get_type (void)
{
	static gsize tuba_widgets_book_wyrm_page_type_id__once = 0;
	if (g_once_init_enter (&tuba_widgets_book_wyrm_page_type_id__once)) {
		GType tuba_widgets_book_wyrm_page_type_id;
		tuba_widgets_book_wyrm_page_type_id = tuba_widgets_book_wyrm_page_get_type_once ();
		g_once_init_leave (&tuba_widgets_book_wyrm_page_type_id__once, tuba_widgets_book_wyrm_page_type_id);
	}
	return tuba_widgets_book_wyrm_page_type_id__once;
}

static void
_vala_tuba_widgets_book_wyrm_page_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	TubaWidgetsBookWyrmPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_BOOK_WYRM_PAGE, TubaWidgetsBookWyrmPage);
	switch (property_id) {
		case TUBA_WIDGETS_BOOK_WYRM_PAGE_BOOK_PROPERTY:
		g_value_set_object (value, tuba_widgets_book_wyrm_page_get_book (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_book_wyrm_page_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	TubaWidgetsBookWyrmPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_BOOK_WYRM_PAGE, TubaWidgetsBookWyrmPage);
	switch (property_id) {
		case TUBA_WIDGETS_BOOK_WYRM_PAGE_BOOK_PROPERTY:
		tuba_widgets_book_wyrm_page_set_book (self, g_value_get_object (value));
		break;
		case TUBA_WIDGETS_BOOK_WYRM_PAGE_SELECTABLE_PROPERTY:
		tuba_widgets_book_wyrm_page_set_selectable (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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);
}

