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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <gio/gio.h>
#include <libsoup/soup.h>
#include <json-glib/json-glib.h>
#include <adwaita.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdk.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_VOTE_BOX (tuba_widgets_vote_box_get_type ())
#define TUBA_WIDGETS_VOTE_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBox))
#define TUBA_WIDGETS_VOTE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBoxClass))
#define TUBA_WIDGETS_IS_VOTE_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_VOTE_BOX))
#define TUBA_WIDGETS_IS_VOTE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_VOTE_BOX))
#define TUBA_WIDGETS_VOTE_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBoxClass))

typedef struct _TubaWidgetsVoteBox TubaWidgetsVoteBox;
typedef struct _TubaWidgetsVoteBoxClass TubaWidgetsVoteBoxClass;
typedef struct _TubaWidgetsVoteBoxPrivate TubaWidgetsVoteBoxPrivate;

#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_POLL (tuba_api_poll_get_type ())
#define TUBA_API_POLL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_POLL, TubaAPIPoll))
#define TUBA_API_POLL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_POLL, TubaAPIPollClass))
#define TUBA_API_IS_POLL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_POLL))
#define TUBA_API_IS_POLL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_POLL))
#define TUBA_API_POLL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_POLL, TubaAPIPollClass))

typedef struct _TubaAPIPoll TubaAPIPoll;
typedef struct _TubaAPIPollClass TubaAPIPollClass;

#define TUBA_API_TYPE_TRANSLATION (tuba_api_translation_get_type ())
#define TUBA_API_TRANSLATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_TRANSLATION, TubaAPITranslation))
#define TUBA_API_TRANSLATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_TRANSLATION, TubaAPITranslationClass))
#define TUBA_API_IS_TRANSLATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_TRANSLATION))
#define TUBA_API_IS_TRANSLATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_TRANSLATION))
#define TUBA_API_TRANSLATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_TRANSLATION, TubaAPITranslationClass))

typedef struct _TubaAPITranslation TubaAPITranslation;
typedef struct _TubaAPITranslationClass TubaAPITranslationClass;

#define TUBA_WIDGETS_TYPE_VOTE_ROW (tuba_widgets_vote_row_get_type ())
#define TUBA_WIDGETS_VOTE_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_VOTE_ROW, TubaWidgetsVoteRow))
#define TUBA_WIDGETS_VOTE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_VOTE_ROW, TubaWidgetsVoteRowClass))
#define TUBA_WIDGETS_IS_VOTE_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_VOTE_ROW))
#define TUBA_WIDGETS_IS_VOTE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_VOTE_ROW))
#define TUBA_WIDGETS_VOTE_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_VOTE_ROW, TubaWidgetsVoteRowClass))

typedef struct _TubaWidgetsVoteRow TubaWidgetsVoteRow;
typedef struct _TubaWidgetsVoteRowClass TubaWidgetsVoteRowClass;
enum  {
	TUBA_WIDGETS_VOTE_BOX_0_PROPERTY,
	TUBA_WIDGETS_VOTE_BOX_USABLE_PROPERTY,
	TUBA_WIDGETS_VOTE_BOX_POLL_PROPERTY,
	TUBA_WIDGETS_VOTE_BOX_TRANSLATION_PROPERTY,
	TUBA_WIDGETS_VOTE_BOX_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_vote_box_properties[TUBA_WIDGETS_VOTE_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON (tuba_widgets_vote_check_button_get_type ())
#define TUBA_WIDGETS_VOTE_CHECK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButton))
#define TUBA_WIDGETS_VOTE_CHECK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButtonClass))
#define TUBA_WIDGETS_IS_VOTE_CHECK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON))
#define TUBA_WIDGETS_IS_VOTE_CHECK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON))
#define TUBA_WIDGETS_VOTE_CHECK_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButtonClass))

typedef struct _TubaWidgetsVoteCheckButton TubaWidgetsVoteCheckButton;
typedef struct _TubaWidgetsVoteCheckButtonClass TubaWidgetsVoteCheckButtonClass;

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;

#define TUBA_API_TYPE_POLL_OPTION (tuba_api_poll_option_get_type ())
#define TUBA_API_POLL_OPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_POLL_OPTION, TubaAPIPollOption))
#define TUBA_API_POLL_OPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_POLL_OPTION, TubaAPIPollOptionClass))
#define TUBA_API_IS_POLL_OPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_POLL_OPTION))
#define TUBA_API_IS_POLL_OPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_POLL_OPTION))
#define TUBA_API_POLL_OPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_POLL_OPTION, TubaAPIPollOptionClass))

typedef struct _TubaAPIPollOption TubaAPIPollOption;
typedef struct _TubaAPIPollOptionClass TubaAPIPollOptionClass;

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;

#define TUBA_TYPE_OOPSIE (tuba_oopsie_get_type ())

#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 __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))

#define TUBA_TYPE_APPLICATION (tuba_application_get_type ())
#define TUBA_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_APPLICATION, TubaApplication))
#define TUBA_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_APPLICATION, TubaApplicationClass))
#define TUBA_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_APPLICATION))
#define TUBA_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_APPLICATION))
#define TUBA_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_APPLICATION, TubaApplicationClass))

typedef struct _TubaApplication TubaApplication;
typedef struct _TubaApplicationClass TubaApplicationClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaWidgetsVoteBoxOnVoteRealData TubaWidgetsVoteBoxOnVoteRealData;

#define TUBA_API_TRANSLATION_TYPE_POLL (tuba_api_translation_poll_get_type ())
#define TUBA_API_TRANSLATION_POLL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TRANSLATION_TYPE_POLL, TubaAPITranslationPoll))
#define TUBA_API_TRANSLATION_POLL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TRANSLATION_TYPE_POLL, TubaAPITranslationPollClass))
#define TUBA_API_TRANSLATION_IS_POLL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TRANSLATION_TYPE_POLL))
#define TUBA_API_TRANSLATION_IS_POLL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TRANSLATION_TYPE_POLL))
#define TUBA_API_TRANSLATION_POLL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TRANSLATION_TYPE_POLL, TubaAPITranslationPollClass))

typedef struct _TubaAPITranslationPoll TubaAPITranslationPoll;
typedef struct _TubaAPITranslationPollClass TubaAPITranslationPollClass;

#define TUBA_API_TRANSLATION_POLL_TYPE_OPTION (tuba_api_translation_poll_option_get_type ())
#define TUBA_API_TRANSLATION_POLL_OPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TRANSLATION_POLL_TYPE_OPTION, TubaAPITranslationPollOption))
#define TUBA_API_TRANSLATION_POLL_OPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TRANSLATION_POLL_TYPE_OPTION, TubaAPITranslationPollOptionClass))
#define TUBA_API_TRANSLATION_POLL_IS_OPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TRANSLATION_POLL_TYPE_OPTION))
#define TUBA_API_TRANSLATION_POLL_IS_OPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TRANSLATION_POLL_TYPE_OPTION))
#define TUBA_API_TRANSLATION_POLL_OPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TRANSLATION_POLL_TYPE_OPTION, TubaAPITranslationPollOptionClass))

typedef struct _TubaAPITranslationPollOption TubaAPITranslationPollOption;
typedef struct _TubaAPITranslationPollOptionClass TubaAPITranslationPollOptionClass;
typedef enum  {
	TUBA_REQUEST_V2_METHOD_GET,
	TUBA_REQUEST_V2_METHOD_POST,
	TUBA_REQUEST_V2_METHOD_PUT,
	TUBA_REQUEST_V2_METHOD_DELETE,
	TUBA_REQUEST_V2_METHOD_PATCH
} TubaRequestV2Method;

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())
typedef struct _TubaWidgetsVoteBoxDoRefreshPollRealData TubaWidgetsVoteBoxDoRefreshPollRealData;

struct _TubaWidgetsVoteBox {
	GtkBox parent_instance;
	TubaWidgetsVoteBoxPrivate * priv;
	GtkListBox* poll_box;
	GtkButton* button_vote;
	GtkButton* button_refresh;
	GtkButton* button_results;
	GtkLabel* info_label;
	GeeArrayList* selected_index;
};

struct _TubaWidgetsVoteBoxClass {
	GtkBoxClass parent_class;
};

struct _TubaWidgetsVoteBoxPrivate {
	TubaAPIPoll* _poll;
	gboolean _show_results;
	TubaAPITranslation* _translation;
	TubaWidgetsVoteRow** vote_rows;
	gint vote_rows_length1;
	gint _vote_rows_size_;
	gchar* voted_numerical_string;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaWidgetsVoteBoxOnVoteRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaWidgetsVoteBox* self;
	GtkButton* button;
	TubaRequestV2* req;
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	TubaAPIPoll* _tmp3_;
	GeeArrayList* _tmp4_;
	GeeArrayList* _tmp5_;
	GeeArrayList* _tmp6_;
	TubaAPIPoll* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	TubaRequestV2* _tmp10_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp11_;
	GInputStream* _tmp12_;
	JsonParser* parser;
	GInputStream* _tmp13_;
	JsonParser* _tmp14_;
	TubaAPIPoll* _tmp15_;
	TubaNetwork* _tmp16_;
	JsonParser* _tmp17_;
	JsonNode* _tmp18_;
	JsonNode* _tmp19_;
	TubaAPIPoll* _tmp20_;
	TubaAPIPoll* _tmp21_;
	GError* e;
	GError* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	GError* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	TubaApplication* _tmp30_;
	GError* _tmp31_;
	const gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	GError* _inner_error0_;
};

struct _TubaWidgetsVoteBoxDoRefreshPollRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaWidgetsVoteBox* self;
	TubaRequestV2* req;
	TubaAPIPoll* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	TubaAccountStore* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaInstanceAccount* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaRequestV2* _tmp10_;
	TubaRequestV2* _tmp11_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp12_;
	GInputStream* _tmp13_;
	GtkButton* _tmp14_;
	JsonParser* parser;
	GInputStream* _tmp15_;
	JsonParser* _tmp16_;
	JsonNode* node;
	TubaNetwork* _tmp17_;
	JsonParser* _tmp18_;
	JsonNode* _tmp19_;
	TubaAPIPoll* parsed_poll;
	JsonNode* _tmp20_;
	TubaAPIPoll* _tmp21_;
	TubaAPIPoll* _tmp22_;
	TubaAPIPoll* _tmp23_;
	GError* e;
	TubaAPIPoll* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	GError* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	GError* _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	GtkButton* _tmp36_;
	TubaApplication* _tmp37_;
	GError* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	GError* _inner_error0_;
};

static gint TubaWidgetsVoteBox_private_offset;
static gpointer tuba_widgets_vote_box_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaNetwork* tuba_network;
VALA_EXTERN TubaApplication* tuba_app;

VALA_EXTERN GType tuba_widgets_vote_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsVoteBox, 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_poll_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPoll, g_object_unref)
VALA_EXTERN GType tuba_api_translation_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPITranslation, g_object_unref)
VALA_EXTERN GType tuba_widgets_vote_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsVoteRow, g_object_unref)
static void tuba_widgets_vote_box_on_clicked (TubaWidgetsVoteBox* self,
                                       GtkGestureClick* gesture,
                                       gint n_press,
                                       gdouble x,
                                       gdouble y);
static void tuba_widgets_vote_box_on_listboxrow_activated (TubaWidgetsVoteBox* self,
                                                    GtkListBoxRow* row);
VALA_EXTERN GType tuba_widgets_vote_check_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsVoteCheckButton, g_object_unref)
VALA_EXTERN TubaWidgetsVoteCheckButton* tuba_widgets_vote_row_get_check_button (TubaWidgetsVoteRow* self);
static void tuba_widgets_vote_box_on_vote_button_clicked (TubaWidgetsVoteBox* self,
                                                   GtkButton* button);
static void tuba_widgets_vote_box_update_selected_index (TubaWidgetsVoteBox* self);
static void tuba_widgets_vote_box_on_vote_real (TubaWidgetsVoteBox* self,
                                         GtkButton* button,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static void tuba_widgets_vote_box_on_vote_real_finish (TubaWidgetsVoteBox* self,
                                                GAsyncResult* _res_);
static void tuba_widgets_vote_box_on_vote_real_data_free (gpointer _data);
static gboolean tuba_widgets_vote_box_on_vote_real_co (TubaWidgetsVoteBoxOnVoteRealData* _data_);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN GType tuba_api_poll_option_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPollOption, g_object_unref)
VALA_EXTERN TubaRequestV2* tuba_api_poll_vote (TubaInstanceAccount* acc,
                                   GeeArrayList* options,
                                   GeeArrayList* selection,
                                   const gchar* id);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN TubaAPIPoll* tuba_widgets_vote_box_get_poll (TubaWidgetsVoteBox* self);
VALA_EXTERN GeeArrayList* tuba_api_poll_get_options (TubaAPIPoll* self);
VALA_EXTERN const gchar* tuba_api_poll_get_id (TubaAPIPoll* self);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_widgets_vote_box_on_vote_real_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
VALA_EXTERN void tuba_network_get_parser_from_inputstream_async (GInputStream* in_stream,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream_finish (GAsyncResult* _res_,
                                                             GError** error);
VALA_EXTERN TubaAPIPoll* tuba_api_poll_from (JsonNode* node,
                                 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);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN void tuba_widgets_vote_box_set_poll (TubaWidgetsVoteBox* self,
                                     TubaAPIPoll* value);
static void tuba_widgets_vote_box_update_rows (TubaWidgetsVoteBox* self);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
static void tuba_widgets_vote_box_update_translations (TubaWidgetsVoteBox* self);
VALA_EXTERN TubaAPITranslation* tuba_widgets_vote_box_get_translation (TubaWidgetsVoteBox* self);
VALA_EXTERN GType tuba_api_translation_poll_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPITranslationPoll, g_object_unref)
VALA_EXTERN TubaAPITranslationPoll* tuba_api_translation_get_poll (TubaAPITranslation* self);
VALA_EXTERN const gchar* tuba_api_translation_poll_get_id (TubaAPITranslationPoll* self);
VALA_EXTERN GType tuba_api_translation_poll_option_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPITranslationPollOption, g_object_unref)
VALA_EXTERN GeeArrayList* tuba_api_translation_poll_get_options (TubaAPITranslationPoll* self);
VALA_EXTERN const gchar* tuba_api_translation_poll_option_get_title (TubaAPITranslationPollOption* self);
VALA_EXTERN void tuba_api_poll_option_set_tuba_translated_title (TubaAPIPollOption* self,
                                                     const gchar* value);
static gboolean ____lambda76_ (TubaWidgetsVoteBox* self,
                        TubaAPIPollOption* item);
static gboolean _____lambda76__gee_forall_func (gpointer g,
                                         gpointer self);
static void tuba_widgets_vote_box_update (TubaWidgetsVoteBox* self);
VALA_EXTERN GeeHashMap* tuba_api_poll_gen_emojis_map (TubaAPIPoll* self);
VALA_EXTERN const gchar* tuba_api_poll_option_get_title (TubaAPIPollOption* self);
VALA_EXTERN TubaWidgetsVoteRow* tuba_widgets_vote_row_new (const gchar* poll_title);
VALA_EXTERN TubaWidgetsVoteRow* tuba_widgets_vote_row_construct (GType object_type,
                                                     const gchar* poll_title);
VALA_EXTERN void tuba_widgets_vote_row_set_delayed_animation (TubaWidgetsVoteRow* self,
                                                  gboolean value);
VALA_EXTERN void tuba_widgets_vote_row_set_instance_emojis (TubaWidgetsVoteRow* self,
                                                GeeHashMap* value);
VALA_EXTERN gboolean tuba_api_poll_get_multiple (TubaAPIPoll* self);
static void tuba_widgets_vote_box_on_check_option_toggled (TubaWidgetsVoteBox* self,
                                                    GtkCheckButton* radio);
static void _tuba_widgets_vote_box_on_check_option_toggled_gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                              gpointer self);
static void _vala_array_add154 (TubaWidgetsVoteRow** * array,
                         gint* length,
                         gint* size,
                         TubaWidgetsVoteRow* value);
static void tuba_widgets_vote_box_update_aria (TubaWidgetsVoteBox* self);
VALA_EXTERN gboolean tuba_api_poll_get_voted (TubaAPIPoll* self);
VALA_EXTERN const gchar* tuba_widgets_vote_check_button_get_poll_title (TubaWidgetsVoteCheckButton* self);
static void tuba_widgets_vote_box_on_refresh_poll (TubaWidgetsVoteBox* self);
static void tuba_widgets_vote_box_do_refresh_poll_real (TubaWidgetsVoteBox* self,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static void tuba_widgets_vote_box_do_refresh_poll_real_finish (TubaWidgetsVoteBox* self,
                                                        GAsyncResult* _res_);
static void _tuba_widgets_vote_box_on_refresh_poll_gtk_button_clicked (GtkButton* _sender,
                                                                gpointer self);
static void tuba_widgets_vote_box_do_refresh_poll_real_data_free (gpointer _data);
static gboolean tuba_widgets_vote_box_do_refresh_poll_real_co (TubaWidgetsVoteBoxDoRefreshPollRealData* _data_);
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
static void tuba_widgets_vote_box_do_refresh_poll_real_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static void tuba_widgets_vote_box_on_toggle_results (TubaWidgetsVoteBox* self);
static gboolean tuba_widgets_vote_box_get_show_results (TubaWidgetsVoteBox* self);
static void tuba_widgets_vote_box_set_show_results (TubaWidgetsVoteBox* self,
                                             gboolean value);
static void _tuba_widgets_vote_box_on_toggle_results_gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self);
VALA_EXTERN gboolean tuba_api_poll_get_expired (TubaAPIPoll* self);
VALA_EXTERN gint64 tuba_api_poll_option_get_votes_count (TubaAPIPollOption* self);
VALA_EXTERN const gchar* tuba_api_poll_option_get_tuba_translated_title (TubaAPIPollOption* self);
VALA_EXTERN void tuba_widgets_vote_row_set_title (TubaWidgetsVoteRow* self,
                                      const gchar* value);
VALA_EXTERN void tuba_widgets_vote_row_set_voted (TubaWidgetsVoteRow* self,
                                      gboolean value);
VALA_EXTERN void tuba_widgets_vote_row_set_winner (TubaWidgetsVoteRow* self,
                                       gboolean value);
VALA_EXTERN void tuba_widgets_vote_row_set_show_results (TubaWidgetsVoteRow* self,
                                             gboolean value);
VALA_EXTERN gint64 tuba_api_poll_get_votes_count (TubaAPIPoll* self);
VALA_EXTERN void tuba_widgets_vote_row_set_percentage (TubaWidgetsVoteRow* self,
                                           gdouble value);
VALA_EXTERN GeeArrayList* tuba_api_poll_get_own_votes (TubaAPIPoll* self);
VALA_EXTERN void tuba_widgets_vote_row_play_animation (TubaWidgetsVoteRow* self);
VALA_EXTERN gchar* tuba_utils_units_shorten (gint64 unit);
VALA_EXTERN void tuba_widgets_vote_box_update_time (TubaWidgetsVoteBox* self,
                                        gboolean skip_aria);
VALA_EXTERN const gchar* tuba_api_poll_get_expires_at (TubaAPIPoll* self);
VALA_EXTERN gchar* tuba_utils_date_time_humanize_ago (const gchar* iso8601);
VALA_EXTERN gchar* tuba_utils_date_time_humanize_left (const gchar* iso8601);
VALA_EXTERN TubaWidgetsVoteBox* tuba_widgets_vote_box_new (void);
VALA_EXTERN TubaWidgetsVoteBox* tuba_widgets_vote_box_construct (GType object_type);
VALA_EXTERN void tuba_widgets_vote_box_set_usable (TubaWidgetsVoteBox* self,
                                       gboolean value);
VALA_EXTERN void tuba_widgets_vote_box_set_translation (TubaWidgetsVoteBox* self,
                                            TubaAPITranslation* value);
static GObject * tuba_widgets_vote_box_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
static void _tuba_widgets_vote_box_on_vote_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self);
static void _tuba_widgets_vote_box_update_g_object_notify (GObject* _sender,
                                                    GParamSpec* pspec,
                                                    gpointer self);
static void _tuba_widgets_vote_box_on_listboxrow_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                GtkListBoxRow* row,
                                                                                gpointer self);
static void _tuba_widgets_vote_box_on_clicked_gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                  gint n_press,
                                                                  gdouble x,
                                                                  gdouble y,
                                                                  gpointer self);
static void tuba_widgets_vote_box_finalize (GObject * obj);
static GType tuba_widgets_vote_box_get_type_once (void);
static void _vala_tuba_widgets_vote_box_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_tuba_widgets_vote_box_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_vote_box_get_instance_private (TubaWidgetsVoteBox* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsVoteBox_private_offset);
}

static void
tuba_widgets_vote_box_on_clicked (TubaWidgetsVoteBox* self,
                                  GtkGestureClick* gesture,
                                  gint n_press,
                                  gdouble x,
                                  gdouble y)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (gesture != NULL);
	gtk_gesture_set_state ((GtkGesture*) gesture, GTK_EVENT_SEQUENCE_CLAIMED);
}

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

static void
tuba_widgets_vote_box_on_listboxrow_activated (TubaWidgetsVoteBox* self,
                                               GtkListBoxRow* row)
{
	TubaWidgetsVoteRow* vote_row = NULL;
	TubaWidgetsVoteRow* _tmp0_;
	gboolean _tmp1_ = FALSE;
	TubaWidgetsVoteRow* _tmp2_;
	TubaWidgetsVoteRow* _tmp8_;
	TubaWidgetsVoteCheckButton* _tmp9_;
	TubaWidgetsVoteCheckButton* _tmp10_;
	TubaWidgetsVoteRow* _tmp11_;
	TubaWidgetsVoteCheckButton* _tmp12_;
	TubaWidgetsVoteCheckButton* _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp0_ = _g_object_ref0 (TUBA_WIDGETS_IS_VOTE_ROW (row) ? ((TubaWidgetsVoteRow*) row) : NULL);
	vote_row = _tmp0_;
	_tmp2_ = vote_row;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		TubaWidgetsVoteRow* _tmp3_;
		TubaWidgetsVoteCheckButton* _tmp4_;
		TubaWidgetsVoteCheckButton* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp3_ = vote_row;
		_tmp4_ = tuba_widgets_vote_row_get_check_button (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = gtk_widget_get_visible ((GtkWidget*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = !_tmp7_;
	}
	if (_tmp1_) {
		_g_object_unref0 (vote_row);
		return;
	}
	_tmp8_ = vote_row;
	_tmp9_ = tuba_widgets_vote_row_get_check_button (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = vote_row;
	_tmp12_ = tuba_widgets_vote_row_get_check_button (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = gtk_check_button_get_active ((GtkCheckButton*) _tmp13_);
	_tmp15_ = _tmp14_;
	gtk_check_button_set_active ((GtkCheckButton*) _tmp10_, !_tmp15_);
	_g_object_unref0 (vote_row);
}

static void
tuba_widgets_vote_box_on_vote_button_clicked (TubaWidgetsVoteBox* self,
                                              GtkButton* button)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	gtk_widget_set_sensitive ((GtkWidget*) button, FALSE);
	tuba_widgets_vote_box_update_selected_index (self);
	tuba_widgets_vote_box_on_vote_real (self, button, NULL, NULL);
}

static void
tuba_widgets_vote_box_on_vote_real_data_free (gpointer _data)
{
	TubaWidgetsVoteBoxOnVoteRealData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->button);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaWidgetsVoteBoxOnVoteRealData, _data_);
}

static void
tuba_widgets_vote_box_on_vote_real (TubaWidgetsVoteBox* self,
                                    GtkButton* button,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	TubaWidgetsVoteBoxOnVoteRealData* _data_;
	TubaWidgetsVoteBox* _tmp0_;
	GtkButton* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	_data_ = g_slice_new0 (TubaWidgetsVoteBoxOnVoteRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_widgets_vote_box_on_vote_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (button);
	_g_object_unref0 (_data_->button);
	_data_->button = _tmp1_;
	tuba_widgets_vote_box_on_vote_real_co (_data_);
}

static void
tuba_widgets_vote_box_on_vote_real_finish (TubaWidgetsVoteBox* self,
                                           GAsyncResult* _res_)
{
	TubaWidgetsVoteBoxOnVoteRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_widgets_vote_box_on_vote_real_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	TubaWidgetsVoteBoxOnVoteRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_widgets_vote_box_on_vote_real_co (_data_);
}

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

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 gboolean
tuba_widgets_vote_box_on_vote_real_co (TubaWidgetsVoteBoxOnVoteRealData* _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:
	_data_->_tmp0_ = tuba_accounts;
	_data_->_tmp1_ = tuba_account_store_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->self->priv->_poll;
	_data_->_tmp4_ = tuba_api_poll_get_options (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->self->selected_index;
	_data_->_tmp7_ = _data_->self->priv->_poll;
	_data_->_tmp8_ = tuba_api_poll_get_id (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = tuba_api_poll_vote (_data_->_tmp2_, _data_->_tmp5_, _data_->_tmp6_, _data_->_tmp9_);
	_data_->req = _data_->_tmp10_;
	{
		_data_->_tmp11_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp11_, tuba_widgets_vote_box_on_vote_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp12_ = tuba_request_v2_exec_finish (_data_->_tmp11_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp12_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp13_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp13_, NULL, tuba_widgets_vote_box_on_vote_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp14_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp14_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		g_object_freeze_notify ((GObject*) _data_->self);
		_data_->_tmp16_ = tuba_network;
		_data_->_tmp17_ = _data_->parser;
		_data_->_tmp18_ = tuba_network_parse_node (_data_->_tmp16_, _data_->_tmp17_);
		_data_->_tmp19_ = _data_->_tmp18_;
		_data_->_tmp20_ = tuba_api_poll_from (_data_->_tmp19_, &_data_->_inner_error0_);
		_data_->_tmp21_ = _data_->_tmp20_;
		__vala_JsonNode_free0 (_data_->_tmp19_);
		_data_->_tmp15_ = _data_->_tmp21_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		tuba_widgets_vote_box_set_poll (_data_->self, _data_->_tmp15_);
		g_object_thaw_notify ((GObject*) _data_->self);
		tuba_widgets_vote_box_update_rows (_data_->self);
		gtk_widget_set_sensitive ((GtkWidget*) _data_->button, TRUE);
		_g_object_unref0 (_data_->_tmp15_);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_io_error_cancelled:
	{
		g_clear_error (&_data_->_inner_error0_);
		g_debug ("VoteBox.vala:67: Message is cancelled.");
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp22_ = _data_->e;
		_data_->_tmp23_ = g_strdup_printf ("%i", _data_->_tmp22_->code);
		_data_->_tmp24_ = _data_->_tmp23_;
		_data_->_tmp25_ = _data_->e;
		_data_->_tmp26_ = _data_->_tmp25_->message;
		_data_->_tmp27_ = string_to_string (_data_->_tmp26_);
		_data_->_tmp28_ = g_strconcat ("Error while voting: ", _data_->_tmp24_, " ", _data_->_tmp27_, NULL);
		_data_->_tmp29_ = _data_->_tmp28_;
		g_warning ("VoteBox.vala:69: %s", _data_->_tmp29_);
		_g_free0 (_data_->_tmp29_);
		_g_free0 (_data_->_tmp24_);
		_data_->_tmp30_ = tuba_app;
		_data_->_tmp31_ = _data_->e;
		_data_->_tmp32_ = _data_->_tmp31_->message;
		_data_->_tmp33_ = g_strdup_printf ("%s: %s", _ ("Error"), _data_->_tmp32_);
		_data_->_tmp34_ = _data_->_tmp33_;
		g_signal_emit_by_name (_data_->_tmp30_, "toast", _data_->_tmp34_, (guint) 5, NULL, NULL, NULL);
		_g_free0 (_data_->_tmp34_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		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_object_unref0 (_data_->req);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gboolean
____lambda76_ (TubaWidgetsVoteBox* self,
               TubaAPIPollOption* item)
{
	gboolean result;
	g_return_val_if_fail (item != NULL, FALSE);
	tuba_api_poll_option_set_tuba_translated_title (item, NULL);
	result = TRUE;
	_g_object_unref0 (item);
	return result;
}

static gboolean
_____lambda76__gee_forall_func (gpointer g,
                                gpointer self)
{
	gboolean result;
	result = ____lambda76_ ((TubaWidgetsVoteBox*) self, (TubaAPIPollOption*) g);
	return result;
}

static void
tuba_widgets_vote_box_update_translations (TubaWidgetsVoteBox* self)
{
	gboolean _tmp0_ = FALSE;
	TubaAPIPoll* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_poll;
	_tmp2_ = tuba_api_poll_get_options (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		TubaAPIPoll* _tmp4_;
		GeeArrayList* _tmp5_;
		GeeArrayList* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp4_ = self->priv->_poll;
		_tmp5_ = tuba_api_poll_get_options (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = _tmp8_ > 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gboolean _tmp9_ = FALSE;
		gboolean _tmp10_ = FALSE;
		gboolean _tmp11_ = FALSE;
		gboolean _tmp12_ = FALSE;
		TubaAPITranslation* _tmp13_;
		_tmp13_ = self->priv->_translation;
		if (_tmp13_ != NULL) {
			TubaAPITranslation* _tmp14_;
			TubaAPITranslationPoll* _tmp15_;
			TubaAPITranslationPoll* _tmp16_;
			_tmp14_ = self->priv->_translation;
			_tmp15_ = tuba_api_translation_get_poll (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp12_ = _tmp16_ != NULL;
		} else {
			_tmp12_ = FALSE;
		}
		if (_tmp12_) {
			TubaAPITranslation* _tmp17_;
			TubaAPITranslationPoll* _tmp18_;
			TubaAPITranslationPoll* _tmp19_;
			const gchar* _tmp20_;
			const gchar* _tmp21_;
			_tmp17_ = self->priv->_translation;
			_tmp18_ = tuba_api_translation_get_poll (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = tuba_api_translation_poll_get_id (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp11_ = g_strcmp0 (_tmp21_, "") != 0;
		} else {
			_tmp11_ = FALSE;
		}
		if (_tmp11_) {
			TubaAPITranslation* _tmp22_;
			TubaAPITranslationPoll* _tmp23_;
			TubaAPITranslationPoll* _tmp24_;
			const gchar* _tmp25_;
			const gchar* _tmp26_;
			TubaAPIPoll* _tmp27_;
			const gchar* _tmp28_;
			const gchar* _tmp29_;
			_tmp22_ = self->priv->_translation;
			_tmp23_ = tuba_api_translation_get_poll (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp25_ = tuba_api_translation_poll_get_id (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = self->priv->_poll;
			_tmp28_ = tuba_api_poll_get_id (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp10_ = g_strcmp0 (_tmp26_, _tmp29_) == 0;
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			TubaAPITranslation* _tmp30_;
			TubaAPITranslationPoll* _tmp31_;
			TubaAPITranslationPoll* _tmp32_;
			GeeArrayList* _tmp33_;
			GeeArrayList* _tmp34_;
			gint _tmp35_;
			gint _tmp36_;
			_tmp30_ = self->priv->_translation;
			_tmp31_ = tuba_api_translation_get_poll (_tmp30_);
			_tmp32_ = _tmp31_;
			_tmp33_ = tuba_api_translation_poll_get_options (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp34_);
			_tmp36_ = _tmp35_;
			_tmp9_ = _tmp36_ > 0;
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp37_ = FALSE;
					_tmp37_ = TRUE;
					while (TRUE) {
						TubaAPITranslation* _tmp39_;
						TubaAPITranslationPoll* _tmp40_;
						TubaAPITranslationPoll* _tmp41_;
						GeeArrayList* _tmp42_;
						GeeArrayList* _tmp43_;
						gint _tmp44_;
						gint _tmp45_;
						TubaAPIPoll* _tmp46_;
						GeeArrayList* _tmp47_;
						GeeArrayList* _tmp48_;
						gpointer _tmp49_;
						TubaAPIPollOption* _tmp50_;
						TubaAPITranslation* _tmp51_;
						TubaAPITranslationPoll* _tmp52_;
						TubaAPITranslationPoll* _tmp53_;
						GeeArrayList* _tmp54_;
						GeeArrayList* _tmp55_;
						gpointer _tmp56_;
						TubaAPITranslationPollOption* _tmp57_;
						const gchar* _tmp58_;
						const gchar* _tmp59_;
						if (!_tmp37_) {
							gint _tmp38_;
							_tmp38_ = i;
							i = _tmp38_ + 1;
						}
						_tmp37_ = FALSE;
						_tmp39_ = self->priv->_translation;
						_tmp40_ = tuba_api_translation_get_poll (_tmp39_);
						_tmp41_ = _tmp40_;
						_tmp42_ = tuba_api_translation_poll_get_options (_tmp41_);
						_tmp43_ = _tmp42_;
						_tmp44_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp43_);
						_tmp45_ = _tmp44_;
						if (!(i < _tmp45_)) {
							break;
						}
						_tmp46_ = self->priv->_poll;
						_tmp47_ = tuba_api_poll_get_options (_tmp46_);
						_tmp48_ = _tmp47_;
						_tmp49_ = gee_abstract_list_get ((GeeAbstractList*) _tmp48_, i);
						_tmp50_ = (TubaAPIPollOption*) _tmp49_;
						_tmp51_ = self->priv->_translation;
						_tmp52_ = tuba_api_translation_get_poll (_tmp51_);
						_tmp53_ = _tmp52_;
						_tmp54_ = tuba_api_translation_poll_get_options (_tmp53_);
						_tmp55_ = _tmp54_;
						_tmp56_ = gee_abstract_list_get ((GeeAbstractList*) _tmp55_, i);
						_tmp57_ = (TubaAPITranslationPollOption*) _tmp56_;
						_tmp58_ = tuba_api_translation_poll_option_get_title (_tmp57_);
						_tmp59_ = _tmp58_;
						tuba_api_poll_option_set_tuba_translated_title (_tmp50_, _tmp59_);
						_g_object_unref0 (_tmp57_);
						_g_object_unref0 (_tmp50_);
					}
				}
			}
		} else {
			TubaAPIPoll* _tmp60_;
			GeeArrayList* _tmp61_;
			GeeArrayList* _tmp62_;
			_tmp60_ = self->priv->_poll;
			_tmp61_ = tuba_api_poll_get_options (_tmp60_);
			_tmp62_ = _tmp61_;
			gee_abstract_collection_foreach ((GeeAbstractCollection*) _tmp62_, _____lambda76__gee_forall_func, self);
		}
	}
}

static void
_tuba_widgets_vote_box_on_check_option_toggled_gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                         gpointer self)
{
	tuba_widgets_vote_box_on_check_option_toggled ((TubaWidgetsVoteBox*) self, _sender);
}

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

static void
tuba_widgets_vote_box_update (TubaWidgetsVoteBox* self)
{
	TubaWidgetsVoteRow** _tmp0_;
	gint row_number = 0;
	TubaWidgetsVoteCheckButton* group_radio_option = NULL;
	GtkWidget* entry = NULL;
	GtkListBox* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GeeArrayList* _tmp10_;
	GeeHashMap* emojis_map = NULL;
	TubaAPIPoll* _tmp11_;
	GeeHashMap* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_new0 (TubaWidgetsVoteRow*, 0 + 1);
	self->priv->vote_rows = (_vala_array_free (self->priv->vote_rows, self->priv->vote_rows_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->vote_rows = _tmp0_;
	self->priv->vote_rows_length1 = 0;
	self->priv->_vote_rows_size_ = self->priv->vote_rows_length1;
	row_number = 0;
	group_radio_option = NULL;
	_tmp1_ = self->poll_box;
	_tmp2_ = gtk_widget_get_first_child ((GtkWidget*) _tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	entry = _tmp3_;
	while (TRUE) {
		GtkWidget* _tmp4_;
		GtkListBox* _tmp5_;
		GtkWidget* _tmp6_;
		GtkListBox* _tmp7_;
		GtkWidget* _tmp8_;
		GtkWidget* _tmp9_;
		_tmp4_ = entry;
		if (!(_tmp4_ != NULL)) {
			break;
		}
		_tmp5_ = self->poll_box;
		_tmp6_ = entry;
		gtk_list_box_remove (_tmp5_, _tmp6_);
		_tmp7_ = self->poll_box;
		_tmp8_ = gtk_widget_get_first_child ((GtkWidget*) _tmp7_);
		_tmp9_ = _g_object_ref0 (_tmp8_);
		_g_object_unref0 (entry);
		entry = _tmp9_;
	}
	_tmp10_ = self->selected_index;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp10_);
	_tmp11_ = self->priv->_poll;
	_tmp12_ = tuba_api_poll_gen_emojis_map (_tmp11_);
	emojis_map = _tmp12_;
	{
		GeeArrayList* _p_list = NULL;
		TubaAPIPoll* _tmp13_;
		GeeArrayList* _tmp14_;
		GeeArrayList* _tmp15_;
		gint _p_size = 0;
		GeeArrayList* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		gint _p_index = 0;
		_tmp13_ = self->priv->_poll;
		_tmp14_ = tuba_api_poll_get_options (_tmp13_);
		_tmp15_ = _tmp14_;
		_p_list = _tmp15_;
		_tmp16_ = _p_list;
		_tmp17_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp16_);
		_tmp18_ = _tmp17_;
		_p_size = _tmp18_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp19_;
			gint _tmp20_;
			TubaAPIPollOption* p = NULL;
			GeeArrayList* _tmp21_;
			gpointer _tmp22_;
			TubaWidgetsVoteRow* row = NULL;
			TubaAPIPollOption* _tmp23_;
			const gchar* _tmp24_;
			const gchar* _tmp25_;
			GeeHashMap* _tmp26_;
			GeeHashMap* _tmp27_;
			TubaWidgetsVoteRow* _tmp28_ = NULL;
			TubaAPIPoll* _tmp29_;
			gboolean _tmp30_;
			gboolean _tmp31_;
			TubaWidgetsVoteRow* _tmp40_;
			TubaWidgetsVoteCheckButton* _tmp41_;
			TubaWidgetsVoteCheckButton* _tmp42_;
			TubaWidgetsVoteRow* _tmp43_;
			TubaWidgetsVoteRow* _tmp44_;
			GtkListBox* _tmp45_;
			TubaWidgetsVoteRow* _tmp46_;
			gint _tmp47_;
			_p_index = _p_index + 1;
			_tmp19_ = _p_index;
			_tmp20_ = _p_size;
			if (!(_tmp19_ < _tmp20_)) {
				break;
			}
			_tmp21_ = _p_list;
			_tmp22_ = gee_abstract_list_get ((GeeAbstractList*) _tmp21_, _p_index);
			p = (TubaAPIPollOption*) _tmp22_;
			_tmp23_ = p;
			_tmp24_ = tuba_api_poll_option_get_title (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = emojis_map;
			_tmp27_ = _g_object_ref0 (_tmp26_);
			_tmp28_ = tuba_widgets_vote_row_new (_tmp25_);
			tuba_widgets_vote_row_set_delayed_animation (_tmp28_, TRUE);
			tuba_widgets_vote_row_set_instance_emojis (_tmp28_, _tmp27_);
			_g_object_unref0 (_tmp27_);
			g_object_ref_sink (_tmp28_);
			row = _tmp28_;
			_tmp29_ = self->priv->_poll;
			_tmp30_ = tuba_api_poll_get_multiple (_tmp29_);
			_tmp31_ = _tmp30_;
			if (!_tmp31_) {
				if (row_number == 0) {
					TubaWidgetsVoteRow* _tmp32_;
					TubaWidgetsVoteCheckButton* _tmp33_;
					TubaWidgetsVoteCheckButton* _tmp34_;
					TubaWidgetsVoteCheckButton* _tmp35_;
					_tmp32_ = row;
					_tmp33_ = tuba_widgets_vote_row_get_check_button (_tmp32_);
					_tmp34_ = _tmp33_;
					_tmp35_ = _g_object_ref0 (_tmp34_);
					_g_object_unref0 (group_radio_option);
					group_radio_option = _tmp35_;
				} else {
					TubaWidgetsVoteRow* _tmp36_;
					TubaWidgetsVoteCheckButton* _tmp37_;
					TubaWidgetsVoteCheckButton* _tmp38_;
					TubaWidgetsVoteCheckButton* _tmp39_;
					_tmp36_ = row;
					_tmp37_ = tuba_widgets_vote_row_get_check_button (_tmp36_);
					_tmp38_ = _tmp37_;
					_tmp39_ = group_radio_option;
					gtk_check_button_set_group ((GtkCheckButton*) _tmp38_, (GtkCheckButton*) _tmp39_);
				}
			}
			_tmp40_ = row;
			_tmp41_ = tuba_widgets_vote_row_get_check_button (_tmp40_);
			_tmp42_ = _tmp41_;
			g_signal_connect_object ((GtkCheckButton*) _tmp42_, "toggled", (GCallback) _tuba_widgets_vote_box_on_check_option_toggled_gtk_check_button_toggled, self, 0);
			_tmp43_ = row;
			_tmp44_ = _g_object_ref0 (_tmp43_);
			_vala_array_add154 (&self->priv->vote_rows, &self->priv->vote_rows_length1, &self->priv->_vote_rows_size_, _tmp44_);
			_tmp45_ = self->poll_box;
			_tmp46_ = row;
			gtk_list_box_append (_tmp45_, (GtkWidget*) _tmp46_);
			_tmp47_ = row_number;
			row_number = _tmp47_ + 1;
			_g_object_unref0 (row);
			_g_object_unref0 (p);
		}
	}
	tuba_widgets_vote_box_update_rows (self);
	_g_object_unref0 (emojis_map);
	_g_object_unref0 (entry);
	_g_object_unref0 (group_radio_option);
}

static void
tuba_widgets_vote_box_update_aria (TubaWidgetsVoteBox* self)
{
	gchar* aria_poll = NULL;
	TubaAPIPoll* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	TubaAPIPoll* _tmp5_;
	GeeArrayList* _tmp6_;
	GeeArrayList* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	gchar* _tmp10_;
	gchar* aria_voted = NULL;
	gchar* _tmp11_;
	TubaAPIPoll* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	GtkListBox* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	GtkLabel* _tmp19_;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_poll;
	_tmp1_ = tuba_api_poll_get_options (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->_poll;
	_tmp6_ = tuba_api_poll_get_options (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strdup_printf (ngettext ("Poll with %d option.", "Poll with %d options.", (gulong) _tmp4_), _tmp9_);
	aria_poll = _tmp10_;
	_tmp11_ = g_strdup ("");
	aria_voted = _tmp11_;
	_tmp12_ = self->priv->_poll;
	_tmp13_ = tuba_api_poll_get_voted (_tmp12_);
	_tmp14_ = _tmp13_;
	if (_tmp14_) {
		gchar* _tmp15_;
		_tmp15_ = g_strdup (_ ("You have voted."));
		_g_free0 (aria_voted);
		aria_voted = _tmp15_;
	}
	_tmp16_ = self->poll_box;
	_tmp17_ = aria_poll;
	_tmp18_ = aria_voted;
	_tmp19_ = self->info_label;
	_tmp20_ = gtk_label_get_text (_tmp19_);
	_tmp21_ = g_strdup_printf ("%s %s %s.", _tmp17_, _tmp18_, _tmp20_);
	_tmp22_ = _tmp21_;
	gtk_accessible_update_property ((GtkAccessible*) _tmp16_, GTK_ACCESSIBLE_PROPERTY_LABEL, _tmp22_, -1, -1);
	_g_free0 (_tmp22_);
	_g_free0 (aria_voted);
	_g_free0 (aria_poll);
}

static void
tuba_widgets_vote_box_on_check_option_toggled (TubaWidgetsVoteBox* self,
                                               GtkCheckButton* radio)
{
	gboolean can_vote = FALSE;
	TubaWidgetsVoteRow** _tmp0_;
	gint _tmp0__length1;
	GtkButton* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (radio != NULL);
	can_vote = FALSE;
	_tmp0_ = self->priv->vote_rows;
	_tmp0__length1 = self->priv->vote_rows_length1;
	{
		TubaWidgetsVoteRow** row_collection = NULL;
		gint row_collection_length1 = 0;
		gint _row_collection_size_ = 0;
		gint row_it = 0;
		row_collection = _tmp0_;
		row_collection_length1 = _tmp0__length1;
		for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
			TubaWidgetsVoteRow* _tmp1_;
			TubaWidgetsVoteRow* row = NULL;
			_tmp1_ = _g_object_ref0 (row_collection[row_it]);
			row = _tmp1_;
			{
				TubaWidgetsVoteRow* _tmp2_;
				TubaWidgetsVoteCheckButton* _tmp3_;
				TubaWidgetsVoteCheckButton* _tmp4_;
				gboolean _tmp5_;
				gboolean _tmp6_;
				_tmp2_ = row;
				_tmp3_ = tuba_widgets_vote_row_get_check_button (_tmp2_);
				_tmp4_ = _tmp3_;
				_tmp5_ = gtk_check_button_get_active ((GtkCheckButton*) _tmp4_);
				_tmp6_ = _tmp5_;
				if (_tmp6_) {
					can_vote = TRUE;
					_g_object_unref0 (row);
					break;
				}
				_g_object_unref0 (row);
			}
		}
	}
	_tmp7_ = self->button_vote;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp7_, can_vote);
}

static void
tuba_widgets_vote_box_update_selected_index (TubaWidgetsVoteBox* self)
{
	TubaWidgetsVoteRow** _tmp0_;
	gint _tmp0__length1;
	GtkButton* _tmp27_;
	GeeArrayList* _tmp28_;
	gint _tmp29_;
	gint _tmp30_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->vote_rows;
	_tmp0__length1 = self->priv->vote_rows_length1;
	{
		TubaWidgetsVoteRow** row_collection = NULL;
		gint row_collection_length1 = 0;
		gint _row_collection_size_ = 0;
		gint row_it = 0;
		row_collection = _tmp0_;
		row_collection_length1 = _tmp0__length1;
		for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
			TubaWidgetsVoteRow* _tmp1_;
			TubaWidgetsVoteRow* row = NULL;
			_tmp1_ = _g_object_ref0 (row_collection[row_it]);
			row = _tmp1_;
			{
				gboolean contained = FALSE;
				GeeArrayList* _tmp2_;
				TubaWidgetsVoteRow* _tmp3_;
				TubaWidgetsVoteCheckButton* _tmp4_;
				TubaWidgetsVoteCheckButton* _tmp5_;
				const gchar* _tmp6_;
				const gchar* _tmp7_;
				gboolean active = FALSE;
				TubaWidgetsVoteRow* _tmp8_;
				TubaWidgetsVoteCheckButton* _tmp9_;
				TubaWidgetsVoteCheckButton* _tmp10_;
				gboolean _tmp11_;
				gboolean _tmp12_;
				gboolean _tmp13_ = FALSE;
				_tmp2_ = self->selected_index;
				_tmp3_ = row;
				_tmp4_ = tuba_widgets_vote_row_get_check_button (_tmp3_);
				_tmp5_ = _tmp4_;
				_tmp6_ = tuba_widgets_vote_check_button_get_poll_title (_tmp5_);
				_tmp7_ = _tmp6_;
				contained = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp2_, _tmp7_);
				_tmp8_ = row;
				_tmp9_ = tuba_widgets_vote_row_get_check_button (_tmp8_);
				_tmp10_ = _tmp9_;
				_tmp11_ = gtk_check_button_get_active ((GtkCheckButton*) _tmp10_);
				_tmp12_ = _tmp11_;
				active = _tmp12_;
				if (contained) {
					_tmp13_ = !active;
				} else {
					_tmp13_ = FALSE;
				}
				if (_tmp13_) {
					GeeArrayList* _tmp14_;
					TubaWidgetsVoteRow* _tmp15_;
					TubaWidgetsVoteCheckButton* _tmp16_;
					TubaWidgetsVoteCheckButton* _tmp17_;
					const gchar* _tmp18_;
					const gchar* _tmp19_;
					_tmp14_ = self->selected_index;
					_tmp15_ = row;
					_tmp16_ = tuba_widgets_vote_row_get_check_button (_tmp15_);
					_tmp17_ = _tmp16_;
					_tmp18_ = tuba_widgets_vote_check_button_get_poll_title (_tmp17_);
					_tmp19_ = _tmp18_;
					gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp14_, _tmp19_);
				} else {
					gboolean _tmp20_ = FALSE;
					if (!contained) {
						_tmp20_ = active;
					} else {
						_tmp20_ = FALSE;
					}
					if (_tmp20_) {
						GeeArrayList* _tmp21_;
						TubaWidgetsVoteRow* _tmp22_;
						TubaWidgetsVoteCheckButton* _tmp23_;
						TubaWidgetsVoteCheckButton* _tmp24_;
						const gchar* _tmp25_;
						const gchar* _tmp26_;
						_tmp21_ = self->selected_index;
						_tmp22_ = row;
						_tmp23_ = tuba_widgets_vote_row_get_check_button (_tmp22_);
						_tmp24_ = _tmp23_;
						_tmp25_ = tuba_widgets_vote_check_button_get_poll_title (_tmp24_);
						_tmp26_ = _tmp25_;
						gee_abstract_collection_add ((GeeAbstractCollection*) _tmp21_, _tmp26_);
					}
				}
				_g_object_unref0 (row);
			}
		}
	}
	_tmp27_ = self->button_vote;
	_tmp28_ = self->selected_index;
	_tmp29_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp28_);
	_tmp30_ = _tmp29_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp27_, _tmp30_ > 0);
}

static void
tuba_widgets_vote_box_on_refresh_poll (TubaWidgetsVoteBox* self)
{
	TubaAPIPoll* _tmp0_;
	GtkListBox* _tmp1_;
	GtkButton* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_poll;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->poll_box;
	gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
	_tmp2_ = self->button_refresh;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp2_, FALSE);
	tuba_widgets_vote_box_do_refresh_poll_real (self, NULL, NULL);
}

static void
_tuba_widgets_vote_box_on_refresh_poll_gtk_button_clicked (GtkButton* _sender,
                                                           gpointer self)
{
	tuba_widgets_vote_box_on_refresh_poll ((TubaWidgetsVoteBox*) self);
}

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

static void
tuba_widgets_vote_box_do_refresh_poll_real (TubaWidgetsVoteBox* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	TubaWidgetsVoteBoxDoRefreshPollRealData* _data_;
	TubaWidgetsVoteBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaWidgetsVoteBoxDoRefreshPollRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_widgets_vote_box_do_refresh_poll_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_widgets_vote_box_do_refresh_poll_real_co (_data_);
}

static void
tuba_widgets_vote_box_do_refresh_poll_real_finish (TubaWidgetsVoteBox* self,
                                                   GAsyncResult* _res_)
{
	TubaWidgetsVoteBoxDoRefreshPollRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_widgets_vote_box_do_refresh_poll_real_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	TubaWidgetsVoteBoxDoRefreshPollRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_widgets_vote_box_do_refresh_poll_real_co (_data_);
}

static gboolean
tuba_widgets_vote_box_do_refresh_poll_real_co (TubaWidgetsVoteBoxDoRefreshPollRealData* _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:
	_data_->_tmp0_ = _data_->self->priv->_poll;
	_data_->_tmp1_ = tuba_api_poll_get_id (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = string_to_string (_data_->_tmp2_);
	_data_->_tmp4_ = g_strconcat ("/api/v1/polls/", _data_->_tmp3_, NULL);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = tuba_accounts;
	_data_->_tmp7_ = tuba_account_store_get_active (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _g_object_ref0 (_data_->_tmp8_);
	_data_->_tmp10_ = NULL;
	_data_->_tmp10_ = tuba_request_v2_new (_data_->_tmp5_, TUBA_REQUEST_V2_METHOD_GET);
	tuba_request_v2_set_account (_data_->_tmp10_, _data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_g_free0 (_data_->_tmp5_);
	_data_->req = _data_->_tmp11_;
	{
		_data_->_tmp12_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp12_, tuba_widgets_vote_box_do_refresh_poll_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp13_ = tuba_request_v2_exec_finish (_data_->_tmp12_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp13_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp14_ = _data_->self->button_refresh;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp14_, TRUE);
		_data_->_tmp15_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp15_, NULL, tuba_widgets_vote_box_do_refresh_poll_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp16_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp16_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp17_ = tuba_network;
		_data_->_tmp18_ = _data_->parser;
		_data_->_tmp19_ = tuba_network_parse_node (_data_->_tmp17_, _data_->_tmp18_);
		_data_->node = _data_->_tmp19_;
		_data_->_tmp20_ = _data_->node;
		_data_->_tmp21_ = tuba_api_poll_from (_data_->_tmp20_, &_data_->_inner_error0_);
		_data_->parsed_poll = _data_->_tmp21_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			__vala_JsonNode_free0 (_data_->node);
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp22_ = _data_->parsed_poll;
		if (_data_->_tmp22_ != NULL) {
			_data_->_tmp23_ = _data_->parsed_poll;
			tuba_widgets_vote_box_set_poll (_data_->self, _data_->_tmp23_);
			tuba_widgets_vote_box_update_rows (_data_->self);
		}
		_g_object_unref0 (_data_->parsed_poll);
		__vala_JsonNode_free0 (_data_->node);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp24_ = _data_->self->priv->_poll;
		_data_->_tmp25_ = tuba_api_poll_get_id (_data_->_tmp24_);
		_data_->_tmp26_ = _data_->_tmp25_;
		_data_->_tmp27_ = string_to_string (_data_->_tmp26_);
		_data_->_tmp28_ = _data_->e;
		_data_->_tmp29_ = g_strdup_printf ("%i", _data_->_tmp28_->code);
		_data_->_tmp30_ = _data_->_tmp29_;
		_data_->_tmp31_ = _data_->e;
		_data_->_tmp32_ = _data_->_tmp31_->message;
		_data_->_tmp33_ = string_to_string (_data_->_tmp32_);
		_data_->_tmp34_ = g_strconcat ("Couldn't refresh poll ", _data_->_tmp27_, ": ", _data_->_tmp30_, " ", _data_->_tmp33_, NULL);
		_data_->_tmp35_ = _data_->_tmp34_;
		g_warning ("VoteBox.vala:212: %s", _data_->_tmp35_);
		_g_free0 (_data_->_tmp35_);
		_g_free0 (_data_->_tmp30_);
		_data_->_tmp36_ = _data_->self->button_refresh;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp36_, TRUE);
		_data_->_tmp37_ = tuba_app;
		_data_->_tmp38_ = _data_->e;
		_data_->_tmp39_ = _data_->_tmp38_->message;
		_data_->_tmp40_ = string_to_string (_data_->_tmp39_);
		_data_->_tmp41_ = g_strconcat ("Couldn't refresh poll: ", _data_->_tmp40_, NULL);
		_data_->_tmp42_ = _data_->_tmp41_;
		g_signal_emit_by_name (_data_->_tmp37_, "toast", _data_->_tmp42_, (guint) 5, NULL, NULL, NULL);
		_g_free0 (_data_->_tmp42_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		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_object_unref0 (_data_->req);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
tuba_widgets_vote_box_on_toggle_results (TubaWidgetsVoteBox* self)
{
	TubaAPIPoll* _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_poll;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_show_results;
	tuba_widgets_vote_box_set_show_results (self, !_tmp1_);
	tuba_widgets_vote_box_update_rows (self);
}

static void
_tuba_widgets_vote_box_on_toggle_results_gtk_button_clicked (GtkButton* _sender,
                                                             gpointer self)
{
	tuba_widgets_vote_box_on_toggle_results ((TubaWidgetsVoteBox*) self);
}

static void
tuba_widgets_vote_box_update_rows (TubaWidgetsVoteBox* self)
{
	GtkButton* _tmp0_;
	GeeArrayList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_;
	GtkButton* _tmp13_;
	gboolean _tmp14_ = FALSE;
	TubaAPIPoll* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	GtkButton* _tmp21_;
	gboolean _tmp22_ = FALSE;
	GtkButton* _tmp23_;
	gboolean _tmp24_;
	gboolean _tmp25_;
	GtkButton* _tmp29_;
	gboolean _tmp30_;
	gint64 winner_p = 0LL;
	gboolean _tmp35_ = FALSE;
	gboolean _tmp36_ = FALSE;
	TubaAPIPoll* _tmp37_;
	gboolean _tmp38_;
	gboolean _tmp39_;
	TubaWidgetsVoteRow** _tmp60_;
	gint _tmp60__length1;
	TubaAPIPoll* _tmp61_;
	GeeArrayList* _tmp62_;
	GeeArrayList* _tmp63_;
	gint _tmp64_;
	gint _tmp65_;
	gchar* voted_string = NULL;
	TubaAPIPoll* _tmp156_;
	gint64 _tmp157_;
	gint64 _tmp158_;
	gchar* _tmp159_;
	TubaAPIPoll* _tmp160_;
	gint64 _tmp161_;
	gint64 _tmp162_;
	gchar* _tmp163_;
	g_return_if_fail (self != NULL);
	tuba_widgets_vote_box_update_translations (self);
	_tmp0_ = self->button_vote;
	_tmp1_ = self->selected_index;
	_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
	_tmp3_ = _tmp2_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp3_ > 0);
	_tmp6_ = self->priv->_show_results;
	if (!_tmp6_) {
		TubaAPIPoll* _tmp7_;
		gboolean _tmp8_;
		gboolean _tmp9_;
		_tmp7_ = self->priv->_poll;
		_tmp8_ = tuba_api_poll_get_expired (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp5_ = !_tmp9_;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		TubaAPIPoll* _tmp10_;
		gboolean _tmp11_;
		gboolean _tmp12_;
		_tmp10_ = self->priv->_poll;
		_tmp11_ = tuba_api_poll_get_voted (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp4_ = !_tmp12_;
	} else {
		_tmp4_ = FALSE;
	}
	_tmp13_ = self->button_vote;
	gtk_widget_set_visible ((GtkWidget*) _tmp13_, _tmp4_);
	_tmp15_ = self->priv->_poll;
	_tmp16_ = tuba_api_poll_get_expired (_tmp15_);
	_tmp17_ = _tmp16_;
	if (!_tmp17_) {
		TubaAPIPoll* _tmp18_;
		gboolean _tmp19_;
		gboolean _tmp20_;
		_tmp18_ = self->priv->_poll;
		_tmp19_ = tuba_api_poll_get_voted (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp14_ = !_tmp20_;
	} else {
		_tmp14_ = FALSE;
	}
	_tmp21_ = self->button_results;
	gtk_widget_set_visible ((GtkWidget*) _tmp21_, _tmp14_);
	_tmp23_ = self->button_vote;
	_tmp24_ = gtk_widget_get_visible ((GtkWidget*) _tmp23_);
	_tmp25_ = _tmp24_;
	if (!_tmp25_) {
		TubaAPIPoll* _tmp26_;
		gboolean _tmp27_;
		gboolean _tmp28_;
		_tmp26_ = self->priv->_poll;
		_tmp27_ = tuba_api_poll_get_expired (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp22_ = !_tmp28_;
	} else {
		_tmp22_ = FALSE;
	}
	_tmp29_ = self->button_refresh;
	gtk_widget_set_visible ((GtkWidget*) _tmp29_, _tmp22_);
	_tmp30_ = self->priv->_show_results;
	if (_tmp30_) {
		GtkButton* _tmp31_;
		GtkButton* _tmp32_;
		_tmp31_ = self->button_results;
		gtk_button_set_icon_name (_tmp31_, "tuba-eye-not-looking-symbolic");
		_tmp32_ = self->button_results;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp32_, _ ("Hide Results"));
	} else {
		GtkButton* _tmp33_;
		GtkButton* _tmp34_;
		_tmp33_ = self->button_results;
		gtk_button_set_icon_name (_tmp33_, "tuba-eye-open-negative-filled-symbolic");
		_tmp34_ = self->button_results;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp34_, _ ("Show Results"));
	}
	winner_p = (gint64) 0;
	_tmp37_ = self->priv->_poll;
	_tmp38_ = tuba_api_poll_get_expired (_tmp37_);
	_tmp39_ = _tmp38_;
	if (_tmp39_) {
		_tmp36_ = TRUE;
	} else {
		TubaAPIPoll* _tmp40_;
		gboolean _tmp41_;
		gboolean _tmp42_;
		_tmp40_ = self->priv->_poll;
		_tmp41_ = tuba_api_poll_get_voted (_tmp40_);
		_tmp42_ = _tmp41_;
		_tmp36_ = _tmp42_;
	}
	if (_tmp36_) {
		_tmp35_ = TRUE;
	} else {
		gboolean _tmp43_;
		_tmp43_ = self->priv->_show_results;
		_tmp35_ = _tmp43_;
	}
	if (_tmp35_) {
		{
			GeeArrayList* _p_list = NULL;
			TubaAPIPoll* _tmp44_;
			GeeArrayList* _tmp45_;
			GeeArrayList* _tmp46_;
			gint _p_size = 0;
			GeeArrayList* _tmp47_;
			gint _tmp48_;
			gint _tmp49_;
			gint _p_index = 0;
			_tmp44_ = self->priv->_poll;
			_tmp45_ = tuba_api_poll_get_options (_tmp44_);
			_tmp46_ = _tmp45_;
			_p_list = _tmp46_;
			_tmp47_ = _p_list;
			_tmp48_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp47_);
			_tmp49_ = _tmp48_;
			_p_size = _tmp49_;
			_p_index = -1;
			while (TRUE) {
				gint _tmp50_;
				gint _tmp51_;
				TubaAPIPollOption* p = NULL;
				GeeArrayList* _tmp52_;
				gpointer _tmp53_;
				TubaAPIPollOption* _tmp54_;
				gint64 _tmp55_;
				gint64 _tmp56_;
				_p_index = _p_index + 1;
				_tmp50_ = _p_index;
				_tmp51_ = _p_size;
				if (!(_tmp50_ < _tmp51_)) {
					break;
				}
				_tmp52_ = _p_list;
				_tmp53_ = gee_abstract_list_get ((GeeAbstractList*) _tmp52_, _p_index);
				p = (TubaAPIPollOption*) _tmp53_;
				_tmp54_ = p;
				_tmp55_ = tuba_api_poll_option_get_votes_count (_tmp54_);
				_tmp56_ = _tmp55_;
				if (_tmp56_ > winner_p) {
					TubaAPIPollOption* _tmp57_;
					gint64 _tmp58_;
					gint64 _tmp59_;
					_tmp57_ = p;
					_tmp58_ = tuba_api_poll_option_get_votes_count (_tmp57_);
					_tmp59_ = _tmp58_;
					winner_p = _tmp59_;
				}
				_g_object_unref0 (p);
			}
		}
	}
	_tmp60_ = self->priv->vote_rows;
	_tmp60__length1 = self->priv->vote_rows_length1;
	_tmp61_ = self->priv->_poll;
	_tmp62_ = tuba_api_poll_get_options (_tmp61_);
	_tmp63_ = _tmp62_;
	_tmp64_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp63_);
	_tmp65_ = _tmp64_;
	if (_tmp60__length1 <= _tmp65_) {
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp66_ = FALSE;
				_tmp66_ = TRUE;
				while (TRUE) {
					TubaWidgetsVoteRow** _tmp68_;
					gint _tmp68__length1;
					TubaWidgetsVoteRow* row = NULL;
					TubaWidgetsVoteRow** _tmp69_;
					gint _tmp69__length1;
					TubaWidgetsVoteRow* _tmp70_;
					TubaWidgetsVoteRow* _tmp71_;
					TubaAPIPollOption* p = NULL;
					TubaAPIPoll* _tmp72_;
					GeeArrayList* _tmp73_;
					GeeArrayList* _tmp74_;
					gpointer _tmp75_;
					const gchar* _tmp76_ = NULL;
					TubaAPIPollOption* _tmp77_;
					const gchar* _tmp78_;
					const gchar* _tmp79_;
					TubaWidgetsVoteRow* _tmp86_;
					TubaWidgetsVoteRow* _tmp87_;
					TubaWidgetsVoteRow* _tmp88_;
					TubaWidgetsVoteRow* _tmp89_;
					TubaWidgetsVoteRow* _tmp90_;
					TubaWidgetsVoteCheckButton* _tmp91_;
					TubaWidgetsVoteCheckButton* _tmp92_;
					GeeArrayList* _tmp93_;
					TubaWidgetsVoteRow* _tmp94_;
					TubaWidgetsVoteCheckButton* _tmp95_;
					TubaWidgetsVoteCheckButton* _tmp96_;
					const gchar* _tmp97_;
					const gchar* _tmp98_;
					gboolean _tmp99_ = FALSE;
					gboolean _tmp100_ = FALSE;
					TubaAPIPoll* _tmp101_;
					gboolean _tmp102_;
					gboolean _tmp103_;
					TubaWidgetsVoteRow* _tmp155_;
					if (!_tmp66_) {
						gint _tmp67_;
						_tmp67_ = i;
						i = _tmp67_ + 1;
					}
					_tmp66_ = FALSE;
					_tmp68_ = self->priv->vote_rows;
					_tmp68__length1 = self->priv->vote_rows_length1;
					if (!(i < _tmp68__length1)) {
						break;
					}
					_tmp69_ = self->priv->vote_rows;
					_tmp69__length1 = self->priv->vote_rows_length1;
					_tmp70_ = _tmp69_[i];
					_tmp71_ = _g_object_ref0 (_tmp70_);
					row = _tmp71_;
					_tmp72_ = self->priv->_poll;
					_tmp73_ = tuba_api_poll_get_options (_tmp72_);
					_tmp74_ = _tmp73_;
					_tmp75_ = gee_abstract_list_get ((GeeAbstractList*) _tmp74_, i);
					p = (TubaAPIPollOption*) _tmp75_;
					_tmp77_ = p;
					_tmp78_ = tuba_api_poll_option_get_tuba_translated_title (_tmp77_);
					_tmp79_ = _tmp78_;
					if (_tmp79_ == NULL) {
						TubaAPIPollOption* _tmp80_;
						const gchar* _tmp81_;
						const gchar* _tmp82_;
						_tmp80_ = p;
						_tmp81_ = tuba_api_poll_option_get_title (_tmp80_);
						_tmp82_ = _tmp81_;
						_tmp76_ = _tmp82_;
					} else {
						TubaAPIPollOption* _tmp83_;
						const gchar* _tmp84_;
						const gchar* _tmp85_;
						_tmp83_ = p;
						_tmp84_ = tuba_api_poll_option_get_tuba_translated_title (_tmp83_);
						_tmp85_ = _tmp84_;
						_tmp76_ = _tmp85_;
					}
					_tmp86_ = row;
					tuba_widgets_vote_row_set_title (_tmp86_, _tmp76_);
					_tmp87_ = row;
					tuba_widgets_vote_row_set_voted (_tmp87_, FALSE);
					_tmp88_ = row;
					tuba_widgets_vote_row_set_winner (_tmp88_, FALSE);
					_tmp89_ = row;
					tuba_widgets_vote_row_set_show_results (_tmp89_, FALSE);
					_tmp90_ = row;
					_tmp91_ = tuba_widgets_vote_row_get_check_button (_tmp90_);
					_tmp92_ = _tmp91_;
					_tmp93_ = self->selected_index;
					_tmp94_ = row;
					_tmp95_ = tuba_widgets_vote_row_get_check_button (_tmp94_);
					_tmp96_ = _tmp95_;
					_tmp97_ = tuba_widgets_vote_check_button_get_poll_title (_tmp96_);
					_tmp98_ = _tmp97_;
					gtk_check_button_set_active ((GtkCheckButton*) _tmp92_, gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp93_, _tmp98_));
					_tmp101_ = self->priv->_poll;
					_tmp102_ = tuba_api_poll_get_expired (_tmp101_);
					_tmp103_ = _tmp102_;
					if (_tmp103_) {
						_tmp100_ = TRUE;
					} else {
						TubaAPIPoll* _tmp104_;
						gboolean _tmp105_;
						gboolean _tmp106_;
						_tmp104_ = self->priv->_poll;
						_tmp105_ = tuba_api_poll_get_voted (_tmp104_);
						_tmp106_ = _tmp105_;
						_tmp100_ = _tmp106_;
					}
					if (_tmp100_) {
						_tmp99_ = TRUE;
					} else {
						gboolean _tmp107_;
						_tmp107_ = self->priv->_show_results;
						_tmp99_ = _tmp107_;
					}
					if (_tmp99_) {
						gdouble _tmp108_ = 0.0;
						TubaAPIPoll* _tmp109_;
						gint64 _tmp110_;
						gint64 _tmp111_;
						gdouble percentage = 0.0;
						TubaWidgetsVoteRow* _tmp118_;
						TubaWidgetsVoteRow* _tmp119_;
						TubaAPIPollOption* _tmp120_;
						gint64 _tmp121_;
						gint64 _tmp122_;
						TubaAPIPoll* _tmp123_;
						GeeArrayList* _tmp124_;
						GeeArrayList* _tmp125_;
						TubaWidgetsVoteRow* _tmp137_;
						_tmp109_ = self->priv->_poll;
						_tmp110_ = tuba_api_poll_get_votes_count (_tmp109_);
						_tmp111_ = _tmp110_;
						if (_tmp111_ > ((gint64) 0)) {
							TubaAPIPollOption* _tmp112_;
							gint64 _tmp113_;
							gint64 _tmp114_;
							TubaAPIPoll* _tmp115_;
							gint64 _tmp116_;
							gint64 _tmp117_;
							_tmp112_ = p;
							_tmp113_ = tuba_api_poll_option_get_votes_count (_tmp112_);
							_tmp114_ = _tmp113_;
							_tmp115_ = self->priv->_poll;
							_tmp116_ = tuba_api_poll_get_votes_count (_tmp115_);
							_tmp117_ = _tmp116_;
							_tmp108_ = (((gdouble) _tmp114_) / _tmp117_) * 100;
						} else {
							_tmp108_ = 0.0;
						}
						percentage = _tmp108_;
						_tmp118_ = row;
						tuba_widgets_vote_row_set_percentage (_tmp118_, percentage);
						_tmp119_ = row;
						_tmp120_ = p;
						_tmp121_ = tuba_api_poll_option_get_votes_count (_tmp120_);
						_tmp122_ = _tmp121_;
						tuba_widgets_vote_row_set_winner (_tmp119_, _tmp122_ == winner_p);
						_tmp123_ = self->priv->_poll;
						_tmp124_ = tuba_api_poll_get_own_votes (_tmp123_);
						_tmp125_ = _tmp124_;
						if (_tmp125_ != NULL) {
							{
								GeeArrayList* _own_vote_list = NULL;
								TubaAPIPoll* _tmp126_;
								GeeArrayList* _tmp127_;
								GeeArrayList* _tmp128_;
								gint _own_vote_size = 0;
								GeeArrayList* _tmp129_;
								gint _tmp130_;
								gint _tmp131_;
								gint _own_vote_index = 0;
								_tmp126_ = self->priv->_poll;
								_tmp127_ = tuba_api_poll_get_own_votes (_tmp126_);
								_tmp128_ = _tmp127_;
								_own_vote_list = _tmp128_;
								_tmp129_ = _own_vote_list;
								_tmp130_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp129_);
								_tmp131_ = _tmp130_;
								_own_vote_size = _tmp131_;
								_own_vote_index = -1;
								while (TRUE) {
									gint _tmp132_;
									gint _tmp133_;
									gint own_vote = 0;
									GeeArrayList* _tmp134_;
									gpointer _tmp135_;
									_own_vote_index = _own_vote_index + 1;
									_tmp132_ = _own_vote_index;
									_tmp133_ = _own_vote_size;
									if (!(_tmp132_ < _tmp133_)) {
										break;
									}
									_tmp134_ = _own_vote_list;
									_tmp135_ = gee_abstract_list_get ((GeeAbstractList*) _tmp134_, _own_vote_index);
									own_vote = (gint) ((gintptr) _tmp135_);
									if (own_vote == i) {
										TubaWidgetsVoteRow* _tmp136_;
										_tmp136_ = row;
										tuba_widgets_vote_row_set_voted (_tmp136_, TRUE);
										break;
									}
								}
							}
						}
						_tmp137_ = row;
						tuba_widgets_vote_row_set_show_results (_tmp137_, TRUE);
					} else {
						TubaAPIPoll* _tmp138_;
						GeeArrayList* _tmp139_;
						GeeArrayList* _tmp140_;
						_tmp138_ = self->priv->_poll;
						_tmp139_ = tuba_api_poll_get_own_votes (_tmp138_);
						_tmp140_ = _tmp139_;
						if (_tmp140_ != NULL) {
							{
								GeeArrayList* _own_vote_list = NULL;
								TubaAPIPoll* _tmp141_;
								GeeArrayList* _tmp142_;
								GeeArrayList* _tmp143_;
								gint _own_vote_size = 0;
								GeeArrayList* _tmp144_;
								gint _tmp145_;
								gint _tmp146_;
								gint _own_vote_index = 0;
								_tmp141_ = self->priv->_poll;
								_tmp142_ = tuba_api_poll_get_own_votes (_tmp141_);
								_tmp143_ = _tmp142_;
								_own_vote_list = _tmp143_;
								_tmp144_ = _own_vote_list;
								_tmp145_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp144_);
								_tmp146_ = _tmp145_;
								_own_vote_size = _tmp146_;
								_own_vote_index = -1;
								while (TRUE) {
									gint _tmp147_;
									gint _tmp148_;
									gint own_vote = 0;
									GeeArrayList* _tmp149_;
									gpointer _tmp150_;
									_own_vote_index = _own_vote_index + 1;
									_tmp147_ = _own_vote_index;
									_tmp148_ = _own_vote_size;
									if (!(_tmp147_ < _tmp148_)) {
										break;
									}
									_tmp149_ = _own_vote_list;
									_tmp150_ = gee_abstract_list_get ((GeeAbstractList*) _tmp149_, _own_vote_index);
									own_vote = (gint) ((gintptr) _tmp150_);
									if (own_vote == i) {
										TubaWidgetsVoteRow* _tmp151_;
										TubaWidgetsVoteCheckButton* _tmp152_;
										TubaWidgetsVoteCheckButton* _tmp153_;
										TubaWidgetsVoteRow* _tmp154_;
										_tmp151_ = row;
										_tmp152_ = tuba_widgets_vote_row_get_check_button (_tmp151_);
										_tmp153_ = _tmp152_;
										gtk_check_button_set_active ((GtkCheckButton*) _tmp153_, TRUE);
										_tmp154_ = row;
										tuba_widgets_vote_row_set_voted (_tmp154_, TRUE);
									}
								}
							}
						}
					}
					_tmp155_ = row;
					tuba_widgets_vote_row_play_animation (_tmp155_);
					_g_object_unref0 (p);
					_g_object_unref0 (row);
				}
			}
		}
	}
	_tmp156_ = self->priv->_poll;
	_tmp157_ = tuba_api_poll_get_votes_count (_tmp156_);
	_tmp158_ = _tmp157_;
	_tmp159_ = tuba_utils_units_shorten (_tmp158_);
	voted_string = _tmp159_;
	_tmp160_ = self->priv->_poll;
	_tmp161_ = tuba_api_poll_get_votes_count (_tmp160_);
	_tmp162_ = _tmp161_;
	_tmp163_ = g_strdup_printf (ngettext ("%s voted", "%s voted", (gulong) _tmp162_), voted_string);
	_g_free0 (self->priv->voted_numerical_string);
	self->priv->voted_numerical_string = _tmp163_;
	tuba_widgets_vote_box_update_time (self, TRUE);
	tuba_widgets_vote_box_update_aria (self);
	tuba_widgets_vote_box_update_selected_index (self);
	_g_free0 (voted_string);
}

void
tuba_widgets_vote_box_update_time (TubaWidgetsVoteBox* self,
                                   gboolean skip_aria)
{
	TubaAPIPoll* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_poll;
	_tmp1_ = tuba_api_poll_get_expires_at (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		gchar* _tmp3_ = NULL;
		TubaAPIPoll* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		GtkLabel* _tmp15_;
		const gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		_tmp4_ = self->priv->_poll;
		_tmp5_ = tuba_api_poll_get_expired (_tmp4_);
		_tmp6_ = _tmp5_;
		if (_tmp6_) {
			TubaAPIPoll* _tmp7_;
			const gchar* _tmp8_;
			const gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp7_ = self->priv->_poll;
			_tmp8_ = tuba_api_poll_get_expires_at (_tmp7_);
			_tmp9_ = _tmp8_;
			_tmp10_ = tuba_utils_date_time_humanize_ago (_tmp9_);
			_g_free0 (_tmp3_);
			_tmp3_ = _tmp10_;
		} else {
			TubaAPIPoll* _tmp11_;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			gchar* _tmp14_;
			_tmp11_ = self->priv->_poll;
			_tmp12_ = tuba_api_poll_get_expires_at (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = tuba_utils_date_time_humanize_left (_tmp13_);
			_g_free0 (_tmp3_);
			_tmp3_ = _tmp14_;
		}
		_tmp15_ = self->info_label;
		_tmp16_ = self->priv->voted_numerical_string;
		_tmp17_ = g_strdup_printf ("%s · %s", _tmp16_, _tmp3_);
		_tmp18_ = _tmp17_;
		gtk_label_set_label (_tmp15_, _tmp18_);
		_g_free0 (_tmp18_);
		if (!skip_aria) {
			tuba_widgets_vote_box_update_aria (self);
		}
		_g_free0 (_tmp3_);
	} else {
		GtkLabel* _tmp19_;
		const gchar* _tmp20_;
		_tmp19_ = self->info_label;
		_tmp20_ = self->priv->voted_numerical_string;
		gtk_label_set_label (_tmp19_, _tmp20_);
	}
}

TubaWidgetsVoteBox*
tuba_widgets_vote_box_construct (GType object_type)
{
	TubaWidgetsVoteBox * self = NULL;
	self = (TubaWidgetsVoteBox*) g_object_new (object_type, NULL);
	return self;
}

TubaWidgetsVoteBox*
tuba_widgets_vote_box_new (void)
{
	return tuba_widgets_vote_box_construct (TUBA_WIDGETS_TYPE_VOTE_BOX);
}

void
tuba_widgets_vote_box_set_usable (TubaWidgetsVoteBox* self,
                                  gboolean value)
{
	GtkButton* _tmp0_;
	GtkButton* _tmp1_;
	GtkButton* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->button_vote;
	_tmp1_ = self->button_refresh;
	_tmp2_ = self->button_results;
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, value);
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, value);
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_box_properties[TUBA_WIDGETS_VOTE_BOX_USABLE_PROPERTY]);
}

TubaAPIPoll*
tuba_widgets_vote_box_get_poll (TubaWidgetsVoteBox* self)
{
	TubaAPIPoll* result;
	TubaAPIPoll* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_poll;
	result = _tmp0_;
	return result;
}

void
tuba_widgets_vote_box_set_poll (TubaWidgetsVoteBox* self,
                                TubaAPIPoll* value)
{
	TubaAPIPoll* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_vote_box_get_poll (self);
	if (old_value != value) {
		TubaAPIPoll* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_poll);
		self->priv->_poll = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_box_properties[TUBA_WIDGETS_VOTE_BOX_POLL_PROPERTY]);
	}
}

static gboolean
tuba_widgets_vote_box_get_show_results (TubaWidgetsVoteBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_results;
	return result;
}

static void
tuba_widgets_vote_box_set_show_results (TubaWidgetsVoteBox* self,
                                        gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_show_results = value;
}

TubaAPITranslation*
tuba_widgets_vote_box_get_translation (TubaWidgetsVoteBox* self)
{
	TubaAPITranslation* result;
	TubaAPITranslation* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_translation;
	result = _tmp0_;
	return result;
}

void
tuba_widgets_vote_box_set_translation (TubaWidgetsVoteBox* self,
                                       TubaAPITranslation* value)
{
	TubaAPITranslation* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_vote_box_get_translation (self);
	if (old_value != value) {
		TubaAPITranslation* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_translation);
		self->priv->_translation = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_box_properties[TUBA_WIDGETS_VOTE_BOX_TRANSLATION_PROPERTY]);
	}
}

static void
_tuba_widgets_vote_box_on_vote_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self)
{
	tuba_widgets_vote_box_on_vote_button_clicked ((TubaWidgetsVoteBox*) self, _sender);
}

static void
_tuba_widgets_vote_box_update_g_object_notify (GObject* _sender,
                                               GParamSpec* pspec,
                                               gpointer self)
{
	tuba_widgets_vote_box_update ((TubaWidgetsVoteBox*) self);
}

static void
_tuba_widgets_vote_box_on_listboxrow_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                           GtkListBoxRow* row,
                                                                           gpointer self)
{
	tuba_widgets_vote_box_on_listboxrow_activated ((TubaWidgetsVoteBox*) self, row);
}

static void
_tuba_widgets_vote_box_on_clicked_gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                             gint n_press,
                                                             gdouble x,
                                                             gdouble y,
                                                             gpointer self)
{
	tuba_widgets_vote_box_on_clicked ((TubaWidgetsVoteBox*) self, _sender, n_press, x, y);
}

static GObject *
tuba_widgets_vote_box_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsVoteBox * self;
	GtkButton* _tmp0_;
	GtkButton* _tmp1_;
	GtkListBox* _tmp2_;
	GtkGestureClick* click_gesture = NULL;
	GtkGestureClick* _tmp3_ = NULL;
	GtkGestureClick* _tmp4_;
	GtkListBox* _tmp5_;
	GtkGestureClick* _tmp6_;
	GtkEventController* _tmp7_;
	parent_class = G_OBJECT_CLASS (tuba_widgets_vote_box_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBox);
	_tmp0_ = self->button_vote;
	g_signal_connect_object (_tmp0_, "clicked", (GCallback) _tuba_widgets_vote_box_on_vote_button_clicked_gtk_button_clicked, self, 0);
	g_signal_connect_object ((GObject*) self, "notify::poll", (GCallback) _tuba_widgets_vote_box_update_g_object_notify, self, 0);
	_tmp1_ = self->button_vote;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, FALSE);
	_tmp2_ = self->poll_box;
	g_signal_connect_object (_tmp2_, "row-activated", (GCallback) _tuba_widgets_vote_box_on_listboxrow_activated_gtk_list_box_row_activated, self, 0);
	_tmp3_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp3_, (guint) GDK_BUTTON_PRIMARY);
	click_gesture = _tmp3_;
	_tmp4_ = click_gesture;
	g_signal_connect_object (_tmp4_, "pressed", (GCallback) _tuba_widgets_vote_box_on_clicked_gtk_gesture_click_pressed, self, 0);
	_tmp5_ = self->poll_box;
	_tmp6_ = click_gesture;
	_tmp7_ = _g_object_ref0 ((GtkEventController*) _tmp6_);
	gtk_widget_add_controller ((GtkWidget*) _tmp5_, _tmp7_);
	_g_object_unref0 (click_gesture);
	return obj;
}

static void
tuba_widgets_vote_box_class_init (TubaWidgetsVoteBoxClass * klass,
                                  gpointer klass_data)
{
	tuba_widgets_vote_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsVoteBox_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_vote_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_vote_box_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_vote_box_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_vote_box_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_BOX_USABLE_PROPERTY, tuba_widgets_vote_box_properties[TUBA_WIDGETS_VOTE_BOX_USABLE_PROPERTY] = g_param_spec_boolean ("usable", "usable", "usable", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_BOX_POLL_PROPERTY, tuba_widgets_vote_box_properties[TUBA_WIDGETS_VOTE_BOX_POLL_PROPERTY] = g_param_spec_object ("poll", "poll", "poll", TUBA_API_TYPE_POLL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_BOX_TRANSLATION_PROPERTY, tuba_widgets_vote_box_properties[TUBA_WIDGETS_VOTE_BOX_TRANSLATION_PROPERTY] = g_param_spec_object ("translation", "translation", "translation", TUBA_API_TYPE_TRANSLATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/widgets/votebox.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "poll_box", FALSE, G_STRUCT_OFFSET (TubaWidgetsVoteBox, poll_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "button_vote", FALSE, G_STRUCT_OFFSET (TubaWidgetsVoteBox, button_vote));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "button_refresh", FALSE, G_STRUCT_OFFSET (TubaWidgetsVoteBox, button_refresh));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "button_results", FALSE, G_STRUCT_OFFSET (TubaWidgetsVoteBox, button_results));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "info_label", FALSE, G_STRUCT_OFFSET (TubaWidgetsVoteBox, info_label));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_refresh_poll", G_CALLBACK(_tuba_widgets_vote_box_on_refresh_poll_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_toggle_results", G_CALLBACK(_tuba_widgets_vote_box_on_toggle_results_gtk_button_clicked));
}

static void
tuba_widgets_vote_box_instance_init (TubaWidgetsVoteBox * self,
                                     gpointer klass)
{
	GeeArrayList* _tmp0_;
	TubaWidgetsVoteRow** _tmp1_;
	gchar* _tmp2_;
	self->priv = tuba_widgets_vote_box_get_instance_private (self);
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	self->selected_index = _tmp0_;
	self->priv->_show_results = FALSE;
	self->priv->_translation = NULL;
	_tmp1_ = g_new0 (TubaWidgetsVoteRow*, 0 + 1);
	self->priv->vote_rows = _tmp1_;
	self->priv->vote_rows_length1 = 0;
	self->priv->_vote_rows_size_ = self->priv->vote_rows_length1;
	_tmp2_ = g_strdup ("");
	self->priv->voted_numerical_string = _tmp2_;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_widgets_vote_box_finalize (GObject * obj)
{
	TubaWidgetsVoteBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBox);
	_g_object_unref0 (self->priv->_poll);
	_g_object_unref0 (self->selected_index);
	_g_object_unref0 (self->priv->_translation);
	self->priv->vote_rows = (_vala_array_free (self->priv->vote_rows, self->priv->vote_rows_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_free0 (self->priv->voted_numerical_string);
	G_OBJECT_CLASS (tuba_widgets_vote_box_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_vote_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsVoteBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_vote_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsVoteBox), 0, (GInstanceInitFunc) tuba_widgets_vote_box_instance_init, NULL };
	GType tuba_widgets_vote_box_type_id;
	tuba_widgets_vote_box_type_id = g_type_register_static (gtk_box_get_type (), "TubaWidgetsVoteBox", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsVoteBox_private_offset = g_type_add_instance_private (tuba_widgets_vote_box_type_id, sizeof (TubaWidgetsVoteBoxPrivate));
	return tuba_widgets_vote_box_type_id;
}

GType
tuba_widgets_vote_box_get_type (void)
{
	static GType tuba_widgets_vote_box_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_vote_box_type_id__once)) {
		GType tuba_widgets_vote_box_type_id;
		tuba_widgets_vote_box_type_id = tuba_widgets_vote_box_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_vote_box_type_id__once, tuba_widgets_vote_box_type_id);
	}
	return tuba_widgets_vote_box_type_id__once;
}

static void
_vala_tuba_widgets_vote_box_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	TubaWidgetsVoteBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBox);
	switch (property_id) {
		case TUBA_WIDGETS_VOTE_BOX_POLL_PROPERTY:
		g_value_set_object (value, tuba_widgets_vote_box_get_poll (self));
		break;
		case TUBA_WIDGETS_VOTE_BOX_TRANSLATION_PROPERTY:
		g_value_set_object (value, tuba_widgets_vote_box_get_translation (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_vote_box_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	TubaWidgetsVoteBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBox);
	switch (property_id) {
		case TUBA_WIDGETS_VOTE_BOX_USABLE_PROPERTY:
		tuba_widgets_vote_box_set_usable (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_VOTE_BOX_POLL_PROPERTY:
		tuba_widgets_vote_box_set_poll (self, g_value_get_object (value));
		break;
		case TUBA_WIDGETS_VOTE_BOX_TRANSLATION_PROPERTY:
		tuba_widgets_vote_box_set_translation (self, g_value_get_object (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);
}

