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

/*
* Copyright 2021-2023 elementary, Inc. (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <shumate/shumate.h>
#include <gio/gio.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <geocode-glib/geocode-glib.h>
#include <geoclue.h>
#include <libecal/libecal.h>
#include <granite-7.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 TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC (tasks_widgets_entry_popover_generic_get_type ())
#define TASKS_WIDGETS_ENTRY_POPOVER_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, TasksWidgetsEntryPopoverGeneric))
#define TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, TasksWidgetsEntryPopoverGenericClass))
#define TASKS_WIDGETS_ENTRY_POPOVER_IS_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC))
#define TASKS_WIDGETS_ENTRY_POPOVER_IS_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC))
#define TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, TasksWidgetsEntryPopoverGenericClass))

typedef struct _TasksWidgetsEntryPopoverGeneric TasksWidgetsEntryPopoverGeneric;
typedef struct _TasksWidgetsEntryPopoverGenericClass TasksWidgetsEntryPopoverGenericClass;
typedef struct _TasksWidgetsEntryPopoverGenericPrivate TasksWidgetsEntryPopoverGenericPrivate;

#define TASKS_WIDGETS_ENTRY_POPOVER_TYPE_LOCATION (tasks_widgets_entry_popover_location_get_type ())
#define TASKS_WIDGETS_ENTRY_POPOVER_LOCATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_LOCATION, TasksWidgetsEntryPopoverLocation))
#define TASKS_WIDGETS_ENTRY_POPOVER_LOCATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_LOCATION, TasksWidgetsEntryPopoverLocationClass))
#define TASKS_WIDGETS_ENTRY_POPOVER_IS_LOCATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_LOCATION))
#define TASKS_WIDGETS_ENTRY_POPOVER_IS_LOCATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_LOCATION))
#define TASKS_WIDGETS_ENTRY_POPOVER_LOCATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_LOCATION, TasksWidgetsEntryPopoverLocationClass))

typedef struct _TasksWidgetsEntryPopoverLocation TasksWidgetsEntryPopoverLocation;
typedef struct _TasksWidgetsEntryPopoverLocationClass TasksWidgetsEntryPopoverLocationClass;
typedef struct _TasksWidgetsEntryPopoverLocationPrivate TasksWidgetsEntryPopoverLocationPrivate;
enum  {
	TASKS_WIDGETS_ENTRY_POPOVER_LOCATION_0_PROPERTY,
	TASKS_WIDGETS_ENTRY_POPOVER_LOCATION_NUM_PROPERTIES
};
static GParamSpec* tasks_widgets_entry_popover_location_properties[TASKS_WIDGETS_ENTRY_POPOVER_LOCATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TASKS_TYPE_LOCATION (tasks_location_get_type ())
typedef struct _TasksLocation TasksLocation;
typedef enum  {
	TASKS_LOCATION_PROXIMITY_ARRIVE,
	TASKS_LOCATION_PROXIMITY_DEPART
} TasksLocationProximity;

#define TASKS_TYPE_LOCATION_PROXIMITY (tasks_location_proximity_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TasksWidgetsEntryPopoverLocationSearchLocationData TasksWidgetsEntryPopoverLocationSearchLocationData;
typedef struct _TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData;

struct _TasksWidgetsEntryPopoverGeneric {
	GtkWidget parent_instance;
	TasksWidgetsEntryPopoverGenericPrivate * priv;
};

struct _TasksWidgetsEntryPopoverGenericClass {
	GtkWidgetClass parent_class;
};

struct _TasksWidgetsEntryPopoverLocation {
	TasksWidgetsEntryPopoverGeneric parent_instance;
	TasksWidgetsEntryPopoverLocationPrivate * priv;
};

struct _TasksWidgetsEntryPopoverLocationClass {
	TasksWidgetsEntryPopoverGenericClass parent_class;
};

struct _TasksWidgetsEntryPopoverLocationPrivate {
	ShumateSimpleMap* simple_map;
	GtkSearchEntry* search_entry;
	GCancellable* search_cancellable;
	ShumateMarker* point;
	GtkToggleButton* arriving_button;
	GtkToggleButton* leaving_button;
};

struct _TasksLocation {
	gchar* postal_address;
	gchar* display_name;
	gdouble longitude;
	gdouble latitude;
	gint accuracy;
	TasksLocationProximity proximity;
};

struct _TasksWidgetsEntryPopoverLocationSearchLocationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TasksWidgetsEntryPopoverLocation* self;
	gchar* location;
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	GeocodeForward* forward;
	GeocodeForward* _tmp3_;
	GList* places;
	GCancellable* _tmp4_;
	GList* _tmp5_;
	GList* place_collection;
	GList* place_it;
	GeocodePlace* _tmp6_;
	GeocodePlace* place;
	ShumateMarker* _tmp7_;
	GeocodePlace* _tmp8_;
	GeocodeLocation* _tmp9_;
	GeocodeLocation* _tmp10_;
	gdouble _tmp11_;
	gdouble _tmp12_;
	ShumateMarker* _tmp13_;
	GeocodePlace* _tmp14_;
	GeocodeLocation* _tmp15_;
	GeocodeLocation* _tmp16_;
	gdouble _tmp17_;
	gdouble _tmp18_;
	gconstpointer _tmp19_;
	gconstpointer _tmp20_;
	gconstpointer _tmp21_;
	gconstpointer _tmp22_;
	GeocodePlace* _tmp23_;
	GeocodeLocation* _tmp24_;
	GeocodeLocation* _tmp25_;
	gdouble _tmp26_;
	gdouble _tmp27_;
	gconstpointer _tmp28_;
	gconstpointer _tmp29_;
	GeocodePlace* _tmp30_;
	GeocodeLocation* _tmp31_;
	GeocodeLocation* _tmp32_;
	gdouble _tmp33_;
	gdouble _tmp34_;
	GtkSearchEntry* _tmp35_;
	GError* _error_;
	GError* _tmp36_;
	const gchar* _tmp37_;
	GError* _inner_error0_;
};

struct _TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TasksWidgetsEntryPopoverLocation* self;
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	GClueSimple* simple;
	GClueSimple* _tmp3_;
	ShumateMarker* _tmp4_;
	GClueLocationProxy* _tmp5_;
	GClueLocationProxy* _tmp6_;
	gdouble _tmp7_;
	gdouble _tmp8_;
	ShumateMarker* _tmp9_;
	GClueLocationProxy* _tmp10_;
	GClueLocationProxy* _tmp11_;
	gdouble _tmp12_;
	gdouble _tmp13_;
	GError* e;
	GError* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	GError* _inner_error0_;
};

static gint TasksWidgetsEntryPopoverLocation_private_offset;
static gpointer tasks_widgets_entry_popover_location_parent_class = NULL;

VALA_EXTERN GType tasks_widgets_entry_popover_generic_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksWidgetsEntryPopoverGeneric, g_object_unref)
VALA_EXTERN GType tasks_widgets_entry_popover_location_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksWidgetsEntryPopoverLocation, g_object_unref)
VALA_EXTERN TasksWidgetsEntryPopoverLocation* tasks_widgets_entry_popover_location_new (void);
VALA_EXTERN TasksWidgetsEntryPopoverLocation* tasks_widgets_entry_popover_location_construct (GType object_type);
VALA_EXTERN GType tasks_location_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType tasks_location_proximity_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TasksLocation* tasks_location_dup (const TasksLocation* self);
VALA_EXTERN void tasks_location_free (TasksLocation* self);
VALA_EXTERN void tasks_location_copy (const TasksLocation* self,
                          TasksLocation* dest);
VALA_EXTERN void tasks_location_destroy (TasksLocation* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (TasksLocation, tasks_location_destroy)
static void tasks_widgets_entry_popover_location_on_popover_show (TasksWidgetsEntryPopoverLocation* self);
VALA_EXTERN gconstpointer tasks_widgets_entry_popover_generic_get_value (TasksWidgetsEntryPopoverGeneric* self);
static void tasks_widgets_entry_popover_location_search_location (TasksWidgetsEntryPopoverLocation* self,
                                                           const gchar* location,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_);
static void tasks_widgets_entry_popover_location_search_location_finish (TasksWidgetsEntryPopoverLocation* self,
                                                                  GAsyncResult* _res_);
static void tasks_widgets_entry_popover_location_discover_current_location (TasksWidgetsEntryPopoverLocation* self,
                                                                     GAsyncReadyCallback _callback_,
                                                                     gpointer _user_data_);
static void tasks_widgets_entry_popover_location_discover_current_location_finish (TasksWidgetsEntryPopoverLocation* self,
                                                                            GAsyncResult* _res_);
static void tasks_widgets_entry_popover_location_on_value_changed (TasksWidgetsEntryPopoverLocation* self);
static void tasks_widgets_entry_popover_location_on_search_entry_activate (TasksWidgetsEntryPopoverLocation* self);
VALA_EXTERN void tasks_widgets_entry_popover_generic_set_value (TasksWidgetsEntryPopoverGeneric* self,
                                                    gconstpointer value);
static void tasks_widgets_entry_popover_location_on_location_mode_changed (TasksWidgetsEntryPopoverLocation* self,
                                                                    TasksLocationProximity proximity);
static void tasks_widgets_entry_popover_location_search_location_data_free (gpointer _data);
static gboolean tasks_widgets_entry_popover_location_search_location_co (TasksWidgetsEntryPopoverLocationSearchLocationData* _data_);
static void tasks_widgets_entry_popover_location_search_location_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_);
static gboolean _____lambda48_ (TasksWidgetsEntryPopoverLocation* self);
static gboolean ______lambda48__gsource_func (gpointer self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void tasks_widgets_entry_popover_location_discover_current_location_data_free (gpointer _data);
static gboolean tasks_widgets_entry_popover_location_discover_current_location_co (TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData* _data_);
static void tasks_widgets_entry_popover_location_discover_current_location_ready (GObject* source_object,
                                                                           GAsyncResult* _res_,
                                                                           gpointer _user_data_);
static gboolean ___lambda49_ (TasksWidgetsEntryPopoverLocation* self);
static gboolean ____lambda49__gsource_func (gpointer self);
static GObject * tasks_widgets_entry_popover_location_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties);
VALA_EXTERN GtkPopover* tasks_widgets_entry_popover_generic_get_popover (TasksWidgetsEntryPopoverGeneric* self);
static void _tasks_widgets_entry_popover_location_on_popover_show_gtk_widget_show (GtkWidget* _sender,
                                                                            gpointer self);
static void _tasks_widgets_entry_popover_location_on_value_changed_g_object_notify (GObject* _sender,
                                                                             GParamSpec* pspec,
                                                                             gpointer self);
static void _tasks_widgets_entry_popover_location_on_search_entry_activate_gtk_search_entry_activate (GtkSearchEntry* _sender,
                                                                                               gpointer self);
static void _tasks_widgets_entry_popover_location___lambda50_ (TasksWidgetsEntryPopoverLocation* self);
static void __tasks_widgets_entry_popover_location___lambda50__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                                   gpointer self);
static void _tasks_widgets_entry_popover_location___lambda51_ (TasksWidgetsEntryPopoverLocation* self);
static void __tasks_widgets_entry_popover_location___lambda51__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                                   gpointer self);
static void tasks_widgets_entry_popover_location_finalize (GObject * obj);
static GType tasks_widgets_entry_popover_location_get_type_once (void);

static inline gpointer
tasks_widgets_entry_popover_location_get_instance_private (TasksWidgetsEntryPopoverLocation* self)
{
	return G_STRUCT_MEMBER_P (self, TasksWidgetsEntryPopoverLocation_private_offset);
}

TasksWidgetsEntryPopoverLocation*
tasks_widgets_entry_popover_location_construct (GType object_type)
{
	TasksWidgetsEntryPopoverLocation * self = NULL;
	self = (TasksWidgetsEntryPopoverLocation*) g_object_new (object_type, "t-type", TASKS_TYPE_LOCATION, "t-dup-func", (GBoxedCopyFunc) tasks_location_dup, "t-destroy-func", (GDestroyNotify) tasks_location_free, "icon-name", "mark-location-symbolic", "placeholder", _ ("Set Location"), NULL);
	return self;
}

TasksWidgetsEntryPopoverLocation*
tasks_widgets_entry_popover_location_new (void)
{
	return tasks_widgets_entry_popover_location_construct (TASKS_WIDGETS_ENTRY_POPOVER_TYPE_LOCATION);
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
tasks_widgets_entry_popover_location_on_popover_show (TasksWidgetsEntryPopoverLocation* self)
{
	const gchar* _tmp0_ = NULL;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	GtkSearchEntry* _tmp6_;
	gboolean _tmp7_ = FALSE;
	GtkSearchEntry* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp1_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp2_ = _tmp1_;
	if (((TasksLocation*) _tmp2_) == NULL) {
		_tmp0_ = "";
	} else {
		gconstpointer _tmp3_;
		gconstpointer _tmp4_;
		const gchar* _tmp5_;
		_tmp3_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp4_ = _tmp3_;
		_tmp5_ = (*((TasksLocation*) _tmp4_)).postal_address;
		_tmp0_ = _tmp5_;
	}
	_tmp6_ = self->priv->search_entry;
	gtk_editable_set_text ((GtkEditable*) _tmp6_, _tmp0_);
	_tmp8_ = self->priv->search_entry;
	_tmp9_ = gtk_editable_get_text ((GtkEditable*) _tmp8_);
	_tmp10_ = _tmp9_;
	if (_tmp10_ != NULL) {
		GtkSearchEntry* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		gint _tmp16_;
		gint _tmp17_;
		_tmp11_ = self->priv->search_entry;
		_tmp12_ = gtk_editable_get_text ((GtkEditable*) _tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = string_strip (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = strlen (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp7_ = _tmp17_ > 0;
		_g_free0 (_tmp15_);
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		GtkSearchEntry* _tmp18_;
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		_tmp18_ = self->priv->search_entry;
		_tmp19_ = gtk_editable_get_text ((GtkEditable*) _tmp18_);
		_tmp20_ = _tmp19_;
		tasks_widgets_entry_popover_location_search_location (self, _tmp20_, NULL, NULL);
	} else {
		tasks_widgets_entry_popover_location_discover_current_location (self, NULL, NULL);
	}
}

static void
tasks_widgets_entry_popover_location_on_value_changed (TasksWidgetsEntryPopoverLocation* self)
{
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean _tmp2_ = FALSE;
	gconstpointer _tmp3_;
	gconstpointer _tmp4_;
	const gchar* _tmp5_;
	gboolean value_has_postal_address = FALSE;
	gboolean _tmp13_ = FALSE;
	gconstpointer _tmp24_;
	gconstpointer _tmp25_;
	gboolean need_relocation = FALSE;
	gboolean _tmp34_ = FALSE;
	gboolean _tmp35_ = FALSE;
	gboolean _tmp36_ = FALSE;
	gconstpointer _tmp37_;
	gconstpointer _tmp38_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp1_ = _tmp0_;
	if (((TasksLocation*) _tmp1_) == NULL) {
		return;
	}
	_tmp3_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = (*((TasksLocation*) _tmp4_)).postal_address;
	if (_tmp5_ != NULL) {
		gconstpointer _tmp6_;
		gconstpointer _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		_tmp6_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = (*((TasksLocation*) _tmp7_)).postal_address;
		_tmp9_ = string_strip (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = strlen (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp2_ = _tmp12_ > 0;
		_g_free0 (_tmp10_);
	} else {
		_tmp2_ = FALSE;
	}
	value_has_postal_address = _tmp2_;
	if (value_has_postal_address) {
		GtkSearchEntry* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		gconstpointer _tmp17_;
		gconstpointer _tmp18_;
		const gchar* _tmp19_;
		_tmp14_ = self->priv->search_entry;
		_tmp15_ = gtk_editable_get_text ((GtkEditable*) _tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp18_ = _tmp17_;
		_tmp19_ = (*((TasksLocation*) _tmp18_)).postal_address;
		_tmp13_ = g_strcmp0 (_tmp16_, _tmp19_) != 0;
	} else {
		_tmp13_ = FALSE;
	}
	if (_tmp13_) {
		GtkSearchEntry* _tmp20_;
		gconstpointer _tmp21_;
		gconstpointer _tmp22_;
		const gchar* _tmp23_;
		_tmp20_ = self->priv->search_entry;
		_tmp21_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp22_ = _tmp21_;
		_tmp23_ = (*((TasksLocation*) _tmp22_)).postal_address;
		gtk_editable_set_text ((GtkEditable*) _tmp20_, _tmp23_);
	}
	_tmp24_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp25_ = _tmp24_;
	switch ((*((TasksLocation*) _tmp25_)).proximity) {
		case TASKS_LOCATION_PROXIMITY_ARRIVE:
		{
			GtkToggleButton* _tmp26_;
			gboolean _tmp27_;
			gboolean _tmp28_;
			_tmp26_ = self->priv->arriving_button;
			_tmp27_ = gtk_toggle_button_get_active (_tmp26_);
			_tmp28_ = _tmp27_;
			if (!_tmp28_) {
				GtkToggleButton* _tmp29_;
				_tmp29_ = self->priv->arriving_button;
				gtk_toggle_button_set_active (_tmp29_, TRUE);
			}
			break;
		}
		default:
		{
			GtkToggleButton* _tmp30_;
			gboolean _tmp31_;
			gboolean _tmp32_;
			_tmp30_ = self->priv->leaving_button;
			_tmp31_ = gtk_toggle_button_get_active (_tmp30_);
			_tmp32_ = _tmp31_;
			if (!_tmp32_) {
				GtkToggleButton* _tmp33_;
				_tmp33_ = self->priv->leaving_button;
				gtk_toggle_button_set_active (_tmp33_, TRUE);
			}
			break;
		}
	}
	need_relocation = TRUE;
	_tmp37_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp38_ = _tmp37_;
	if ((*((TasksLocation*) _tmp38_)).latitude >= SHUMATE_MIN_LATITUDE) {
		gconstpointer _tmp39_;
		gconstpointer _tmp40_;
		_tmp39_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp40_ = _tmp39_;
		_tmp36_ = (*((TasksLocation*) _tmp40_)).longitude >= SHUMATE_MIN_LONGITUDE;
	} else {
		_tmp36_ = FALSE;
	}
	if (_tmp36_) {
		gconstpointer _tmp41_;
		gconstpointer _tmp42_;
		_tmp41_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp42_ = _tmp41_;
		_tmp35_ = (*((TasksLocation*) _tmp42_)).latitude <= SHUMATE_MAX_LATITUDE;
	} else {
		_tmp35_ = FALSE;
	}
	if (_tmp35_) {
		gconstpointer _tmp43_;
		gconstpointer _tmp44_;
		_tmp43_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp44_ = _tmp43_;
		_tmp34_ = (*((TasksLocation*) _tmp44_)).longitude <= SHUMATE_MAX_LONGITUDE;
	} else {
		_tmp34_ = FALSE;
	}
	if (_tmp34_) {
		ShumateMarker* _tmp45_;
		gconstpointer _tmp46_;
		gconstpointer _tmp47_;
		ShumateMarker* _tmp48_;
		gconstpointer _tmp49_;
		gconstpointer _tmp50_;
		gboolean _tmp51_ = FALSE;
		gconstpointer _tmp52_;
		gconstpointer _tmp53_;
		_tmp45_ = self->priv->point;
		_tmp46_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp47_ = _tmp46_;
		g_object_set ((ShumateLocation*) _tmp45_, "latitude", (*((TasksLocation*) _tmp47_)).latitude, NULL);
		_tmp48_ = self->priv->point;
		_tmp49_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp50_ = _tmp49_;
		g_object_set ((ShumateLocation*) _tmp48_, "longitude", (*((TasksLocation*) _tmp50_)).longitude, NULL);
		_tmp52_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp53_ = _tmp52_;
		if ((*((TasksLocation*) _tmp53_)).latitude == ((gdouble) 0)) {
			gconstpointer _tmp54_;
			gconstpointer _tmp55_;
			_tmp54_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
			_tmp55_ = _tmp54_;
			_tmp51_ = (*((TasksLocation*) _tmp55_)).longitude == ((gdouble) 0);
		} else {
			_tmp51_ = FALSE;
		}
		need_relocation = _tmp51_;
	}
	if (need_relocation == TRUE) {
		if (value_has_postal_address) {
			gconstpointer _tmp56_;
			gconstpointer _tmp57_;
			const gchar* _tmp58_;
			_tmp56_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
			_tmp57_ = _tmp56_;
			_tmp58_ = (*((TasksLocation*) _tmp57_)).postal_address;
			tasks_widgets_entry_popover_location_search_location (self, _tmp58_, NULL, NULL);
		} else {
			tasks_widgets_entry_popover_location_discover_current_location (self, NULL, NULL);
		}
	}
}

static void
tasks_widgets_entry_popover_location_on_search_entry_activate (TasksWidgetsEntryPopoverLocation* self)
{
	gint _tmp0_ = 0;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	TasksLocationProximity _tmp5_ = 0;
	gconstpointer _tmp6_;
	gconstpointer _tmp7_;
	GtkSearchEntry* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	GtkSearchEntry* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	TasksLocation _tmp18_ = {0};
	TasksLocation _tmp19_;
	TasksLocation _tmp20_;
	g_return_if_fail (self != NULL);
	_tmp1_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp2_ = _tmp1_;
	if (((TasksLocation*) _tmp2_) == NULL) {
		_tmp0_ = GEOCODE_LOCATION_ACCURACY_UNKNOWN;
	} else {
		gconstpointer _tmp3_;
		gconstpointer _tmp4_;
		_tmp3_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp4_ = _tmp3_;
		_tmp0_ = (*((TasksLocation*) _tmp4_)).accuracy;
	}
	_tmp6_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp7_ = _tmp6_;
	if (((TasksLocation*) _tmp7_) == NULL) {
		_tmp5_ = TASKS_LOCATION_PROXIMITY_DEPART;
	} else {
		gconstpointer _tmp8_;
		gconstpointer _tmp9_;
		_tmp8_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp9_ = _tmp8_;
		_tmp5_ = (*((TasksLocation*) _tmp9_)).proximity;
	}
	_tmp10_ = self->priv->search_entry;
	_tmp11_ = gtk_editable_get_text ((GtkEditable*) _tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strdup (_tmp12_);
	_tmp14_ = self->priv->search_entry;
	_tmp15_ = gtk_editable_get_text ((GtkEditable*) _tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_strdup (_tmp16_);
	memset (&_tmp18_, 0, sizeof (TasksLocation));
	_g_free0 (_tmp18_.postal_address);
	_tmp18_.postal_address = _tmp13_;
	_g_free0 (_tmp18_.display_name);
	_tmp18_.display_name = _tmp17_;
	_tmp18_.longitude = (gdouble) 0;
	_tmp18_.latitude = (gdouble) 0;
	_tmp18_.accuracy = _tmp0_;
	_tmp18_.proximity = _tmp5_;
	_tmp19_ = _tmp18_;
	_tmp20_ = _tmp19_;
	tasks_widgets_entry_popover_generic_set_value ((TasksWidgetsEntryPopoverGeneric*) self, &_tmp20_);
	tasks_location_destroy (&_tmp19_);
}

static void
tasks_widgets_entry_popover_location_on_location_mode_changed (TasksWidgetsEntryPopoverLocation* self,
                                                               TasksLocationProximity proximity)
{
	const gchar* _tmp0_ = NULL;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	const gchar* _tmp9_ = NULL;
	gconstpointer _tmp10_;
	gconstpointer _tmp11_;
	gdouble _tmp18_ = 0.0;
	gconstpointer _tmp19_;
	gconstpointer _tmp20_;
	gdouble _tmp23_ = 0.0;
	gconstpointer _tmp24_;
	gconstpointer _tmp25_;
	gint _tmp28_ = 0;
	gconstpointer _tmp29_;
	gconstpointer _tmp30_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	TasksLocation _tmp35_ = {0};
	TasksLocation _tmp36_;
	TasksLocation _tmp37_;
	g_return_if_fail (self != NULL);
	_tmp1_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp2_ = _tmp1_;
	if (((TasksLocation*) _tmp2_) == NULL) {
		GtkSearchEntry* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp3_ = self->priv->search_entry;
		_tmp4_ = gtk_editable_get_text ((GtkEditable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp0_ = _tmp5_;
	} else {
		gconstpointer _tmp6_;
		gconstpointer _tmp7_;
		const gchar* _tmp8_;
		_tmp6_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = (*((TasksLocation*) _tmp7_)).postal_address;
		_tmp0_ = _tmp8_;
	}
	_tmp10_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp11_ = _tmp10_;
	if (((TasksLocation*) _tmp11_) == NULL) {
		GtkSearchEntry* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		_tmp12_ = self->priv->search_entry;
		_tmp13_ = gtk_editable_get_text ((GtkEditable*) _tmp12_);
		_tmp14_ = _tmp13_;
		_tmp9_ = _tmp14_;
	} else {
		gconstpointer _tmp15_;
		gconstpointer _tmp16_;
		const gchar* _tmp17_;
		_tmp15_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp16_ = _tmp15_;
		_tmp17_ = (*((TasksLocation*) _tmp16_)).display_name;
		_tmp9_ = _tmp17_;
	}
	_tmp19_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp20_ = _tmp19_;
	if (((TasksLocation*) _tmp20_) == NULL) {
		_tmp18_ = (gdouble) 0;
	} else {
		gconstpointer _tmp21_;
		gconstpointer _tmp22_;
		_tmp21_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp22_ = _tmp21_;
		_tmp18_ = (*((TasksLocation*) _tmp22_)).longitude;
	}
	_tmp24_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp25_ = _tmp24_;
	if (((TasksLocation*) _tmp25_) == NULL) {
		_tmp23_ = (gdouble) 0;
	} else {
		gconstpointer _tmp26_;
		gconstpointer _tmp27_;
		_tmp26_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp27_ = _tmp26_;
		_tmp23_ = (*((TasksLocation*) _tmp27_)).latitude;
	}
	_tmp29_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp30_ = _tmp29_;
	if (((TasksLocation*) _tmp30_) == NULL) {
		_tmp28_ = GEOCODE_LOCATION_ACCURACY_UNKNOWN;
	} else {
		gconstpointer _tmp31_;
		gconstpointer _tmp32_;
		_tmp31_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) self);
		_tmp32_ = _tmp31_;
		_tmp28_ = (*((TasksLocation*) _tmp32_)).accuracy;
	}
	_tmp33_ = g_strdup (_tmp0_);
	_tmp34_ = g_strdup (_tmp9_);
	memset (&_tmp35_, 0, sizeof (TasksLocation));
	_g_free0 (_tmp35_.postal_address);
	_tmp35_.postal_address = _tmp33_;
	_g_free0 (_tmp35_.display_name);
	_tmp35_.display_name = _tmp34_;
	_tmp35_.longitude = _tmp18_;
	_tmp35_.latitude = _tmp23_;
	_tmp35_.accuracy = _tmp28_;
	_tmp35_.proximity = proximity;
	_tmp36_ = _tmp35_;
	_tmp37_ = _tmp36_;
	tasks_widgets_entry_popover_generic_set_value ((TasksWidgetsEntryPopoverGeneric*) self, &_tmp37_);
	tasks_location_destroy (&_tmp36_);
}

static void
tasks_widgets_entry_popover_location_search_location_data_free (gpointer _data)
{
	TasksWidgetsEntryPopoverLocationSearchLocationData* _data_;
	_data_ = _data;
	_g_free0 (_data_->location);
	_g_object_unref0 (_data_->self);
	g_slice_free (TasksWidgetsEntryPopoverLocationSearchLocationData, _data_);
}

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

static void
tasks_widgets_entry_popover_location_search_location (TasksWidgetsEntryPopoverLocation* self,
                                                      const gchar* location,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_)
{
	TasksWidgetsEntryPopoverLocationSearchLocationData* _data_;
	TasksWidgetsEntryPopoverLocation* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (location != NULL);
	_data_ = g_slice_new0 (TasksWidgetsEntryPopoverLocationSearchLocationData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tasks_widgets_entry_popover_location_search_location_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (location);
	_g_free0 (_data_->location);
	_data_->location = _tmp1_;
	tasks_widgets_entry_popover_location_search_location_co (_data_);
}

static void
tasks_widgets_entry_popover_location_search_location_finish (TasksWidgetsEntryPopoverLocation* self,
                                                             GAsyncResult* _res_)
{
	TasksWidgetsEntryPopoverLocationSearchLocationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tasks_widgets_entry_popover_location_search_location_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_)
{
	TasksWidgetsEntryPopoverLocationSearchLocationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tasks_widgets_entry_popover_location_search_location_co (_data_);
}

static gboolean
_____lambda48_ (TasksWidgetsEntryPopoverLocation* self)
{
	GCancellable* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->search_cancellable;
	if (g_cancellable_is_cancelled (_tmp0_) == FALSE) {
		ShumateSimpleMap* _tmp1_;
		ShumateMap* _tmp2_;
		ShumateMap* _tmp3_;
		ShumateMarker* _tmp4_;
		gdouble _tmp5_;
		gdouble _tmp6_;
		ShumateMarker* _tmp7_;
		gdouble _tmp8_;
		gdouble _tmp9_;
		_tmp1_ = self->priv->simple_map;
		_tmp2_ = shumate_simple_map_get_map (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = self->priv->point;
		g_object_get ((ShumateLocation*) _tmp4_, "latitude", &_tmp5_, NULL);
		_tmp6_ = _tmp5_;
		_tmp7_ = self->priv->point;
		g_object_get ((ShumateLocation*) _tmp7_, "longitude", &_tmp8_, NULL);
		_tmp9_ = _tmp8_;
		shumate_map_go_to (_tmp3_, _tmp6_, _tmp9_);
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
______lambda48__gsource_func (gpointer self)
{
	gboolean result;
	result = _____lambda48_ ((TasksWidgetsEntryPopoverLocation*) self);
	return result;
}

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

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

static gboolean
tasks_widgets_entry_popover_location_search_location_co (TasksWidgetsEntryPopoverLocationSearchLocationData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->search_cancellable;
	if (_data_->_tmp0_ != NULL) {
		_data_->_tmp1_ = _data_->self->priv->search_cancellable;
		g_cancellable_cancel (_data_->_tmp1_);
	}
	_data_->_tmp2_ = g_cancellable_new ();
	_g_object_unref0 (_data_->self->priv->search_cancellable);
	_data_->self->priv->search_cancellable = _data_->_tmp2_;
	_data_->_tmp3_ = geocode_forward_new_for_string (_data_->location);
	_data_->forward = _data_->_tmp3_;
	{
		geocode_forward_set_answer_count (_data_->forward, (guint) 1);
		_data_->_tmp4_ = _data_->self->priv->search_cancellable;
		_data_->_state_ = 1;
		geocode_forward_search_async (_data_->forward, _data_->_tmp4_, tasks_widgets_entry_popover_location_search_location_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp5_ = geocode_forward_search_finish (_data_->forward, _data_->_res_, &_data_->_inner_error0_);
		_data_->places = _data_->_tmp5_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		{
			_data_->place_collection = _data_->places;
			for (_data_->place_it = _data_->place_collection; _data_->place_it != NULL; _data_->place_it = _data_->place_it->next) {
				_data_->_tmp6_ = _g_object_ref0 ((GeocodePlace*) _data_->place_it->data);
				_data_->place = _data_->_tmp6_;
				{
					_data_->_tmp7_ = _data_->self->priv->point;
					_data_->_tmp8_ = _data_->place;
					_data_->_tmp9_ = geocode_place_get_location (_data_->_tmp8_);
					_data_->_tmp10_ = _data_->_tmp9_;
					g_object_get (_data_->_tmp10_, "latitude", &_data_->_tmp11_, NULL);
					_data_->_tmp12_ = _data_->_tmp11_;
					g_object_set ((ShumateLocation*) _data_->_tmp7_, "latitude", _data_->_tmp12_, NULL);
					_data_->_tmp13_ = _data_->self->priv->point;
					_data_->_tmp14_ = _data_->place;
					_data_->_tmp15_ = geocode_place_get_location (_data_->_tmp14_);
					_data_->_tmp16_ = _data_->_tmp15_;
					g_object_get (_data_->_tmp16_, "longitude", &_data_->_tmp17_, NULL);
					_data_->_tmp18_ = _data_->_tmp17_;
					g_object_set ((ShumateLocation*) _data_->_tmp13_, "longitude", _data_->_tmp18_, NULL);
					_data_->_tmp19_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) _data_->self);
					_data_->_tmp20_ = _data_->_tmp19_;
					if (((TasksLocation*) _data_->_tmp20_) != NULL) {
						_data_->_tmp21_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) _data_->self);
						_data_->_tmp22_ = _data_->_tmp21_;
						_data_->_tmp23_ = _data_->place;
						_data_->_tmp24_ = geocode_place_get_location (_data_->_tmp23_);
						_data_->_tmp25_ = _data_->_tmp24_;
						g_object_get (_data_->_tmp25_, "latitude", &_data_->_tmp26_, NULL);
						_data_->_tmp27_ = _data_->_tmp26_;
						(*((TasksLocation*) _data_->_tmp22_)).latitude = _data_->_tmp27_;
						_data_->_tmp28_ = tasks_widgets_entry_popover_generic_get_value ((TasksWidgetsEntryPopoverGeneric*) _data_->self);
						_data_->_tmp29_ = _data_->_tmp28_;
						_data_->_tmp30_ = _data_->place;
						_data_->_tmp31_ = geocode_place_get_location (_data_->_tmp30_);
						_data_->_tmp32_ = _data_->_tmp31_;
						g_object_get (_data_->_tmp32_, "longitude", &_data_->_tmp33_, NULL);
						_data_->_tmp34_ = _data_->_tmp33_;
						(*((TasksLocation*) _data_->_tmp29_)).longitude = _data_->_tmp34_;
					}
					g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ______lambda48__gsource_func, g_object_ref (_data_->self), g_object_unref);
					_g_object_unref0 (_data_->place);
				}
			}
		}
		_data_->_tmp35_ = _data_->self->priv->search_entry;
		gtk_widget_grab_focus ((GtkWidget*) _data_->_tmp35_);
		(_data_->places == NULL) ? NULL : (_data_->places = (_g_list_free__g_object_unref0_ (_data_->places), NULL));
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp36_ = _data_->_error_;
		_data_->_tmp37_ = _data_->_tmp36_->message;
		g_debug ("Location.vala:221: %s", _data_->_tmp37_);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->forward);
		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_->forward);
	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
tasks_widgets_entry_popover_location_discover_current_location_data_free (gpointer _data)
{
	TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData, _data_);
}

static void
tasks_widgets_entry_popover_location_discover_current_location (TasksWidgetsEntryPopoverLocation* self,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_)
{
	TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData* _data_;
	TasksWidgetsEntryPopoverLocation* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tasks_widgets_entry_popover_location_discover_current_location_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tasks_widgets_entry_popover_location_discover_current_location_co (_data_);
}

static void
tasks_widgets_entry_popover_location_discover_current_location_finish (TasksWidgetsEntryPopoverLocation* self,
                                                                       GAsyncResult* _res_)
{
	TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tasks_widgets_entry_popover_location_discover_current_location_ready (GObject* source_object,
                                                                      GAsyncResult* _res_,
                                                                      gpointer _user_data_)
{
	TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tasks_widgets_entry_popover_location_discover_current_location_co (_data_);
}

static gboolean
___lambda49_ (TasksWidgetsEntryPopoverLocation* self)
{
	GCancellable* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->search_cancellable;
	if (g_cancellable_is_cancelled (_tmp0_) == FALSE) {
		ShumateSimpleMap* _tmp1_;
		ShumateMap* _tmp2_;
		ShumateMap* _tmp3_;
		ShumateMarker* _tmp4_;
		gdouble _tmp5_;
		gdouble _tmp6_;
		ShumateMarker* _tmp7_;
		gdouble _tmp8_;
		gdouble _tmp9_;
		_tmp1_ = self->priv->simple_map;
		_tmp2_ = shumate_simple_map_get_map (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = self->priv->point;
		g_object_get ((ShumateLocation*) _tmp4_, "latitude", &_tmp5_, NULL);
		_tmp6_ = _tmp5_;
		_tmp7_ = self->priv->point;
		g_object_get ((ShumateLocation*) _tmp7_, "longitude", &_tmp8_, NULL);
		_tmp9_ = _tmp8_;
		shumate_map_go_to (_tmp3_, _tmp6_, _tmp9_);
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
____lambda49__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda49_ ((TasksWidgetsEntryPopoverLocation*) self);
	return result;
}

static gboolean
tasks_widgets_entry_popover_location_discover_current_location_co (TasksWidgetsEntryPopoverLocationDiscoverCurrentLocationData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->search_cancellable;
	if (_data_->_tmp0_ != NULL) {
		_data_->_tmp1_ = _data_->self->priv->search_cancellable;
		g_cancellable_cancel (_data_->_tmp1_);
	}
	_data_->_tmp2_ = g_cancellable_new ();
	_g_object_unref0 (_data_->self->priv->search_cancellable);
	_data_->self->priv->search_cancellable = _data_->_tmp2_;
	{
		_data_->_state_ = 1;
		gclue_simple_new ("io.elementary.tasks", GCLUE_ACCURACY_LEVEL_CITY, NULL, tasks_widgets_entry_popover_location_discover_current_location_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp3_ = gclue_simple_new_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->simple = _data_->_tmp3_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp4_ = _data_->self->priv->point;
		_data_->_tmp5_ = gclue_simple_get_location (_data_->simple);
		_data_->_tmp6_ = _data_->_tmp5_;
		g_object_get ((GClueLocation*) _data_->_tmp6_, "latitude", &_data_->_tmp7_, NULL);
		_data_->_tmp8_ = _data_->_tmp7_;
		g_object_set ((ShumateLocation*) _data_->_tmp4_, "latitude", _data_->_tmp8_, NULL);
		_data_->_tmp9_ = _data_->self->priv->point;
		_data_->_tmp10_ = gclue_simple_get_location (_data_->simple);
		_data_->_tmp11_ = _data_->_tmp10_;
		g_object_get ((GClueLocation*) _data_->_tmp11_, "longitude", &_data_->_tmp12_, NULL);
		_data_->_tmp13_ = _data_->_tmp12_;
		g_object_set ((ShumateLocation*) _data_->_tmp9_, "longitude", _data_->_tmp13_, NULL);
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda49__gsource_func, g_object_ref (_data_->self), g_object_unref);
		_g_object_unref0 (_data_->simple);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp14_ = _data_->e;
		_data_->_tmp15_ = _data_->_tmp14_->message;
		g_warning ("Location.vala:244: Failed to connect to GeoClue2 service: %s", _data_->_tmp15_);
		_data_->_tmp16_ = e_cal_util_get_system_timezone_location ();
		_data_->_tmp17_ = _data_->_tmp16_;
		tasks_widgets_entry_popover_location_search_location (_data_->self, _data_->_tmp17_, NULL, NULL);
		_g_free0 (_data_->_tmp17_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
_tasks_widgets_entry_popover_location_on_popover_show_gtk_widget_show (GtkWidget* _sender,
                                                                       gpointer self)
{
	tasks_widgets_entry_popover_location_on_popover_show ((TasksWidgetsEntryPopoverLocation*) self);
}

static void
_tasks_widgets_entry_popover_location_on_value_changed_g_object_notify (GObject* _sender,
                                                                        GParamSpec* pspec,
                                                                        gpointer self)
{
	tasks_widgets_entry_popover_location_on_value_changed ((TasksWidgetsEntryPopoverLocation*) self);
}

static void
_tasks_widgets_entry_popover_location_on_search_entry_activate_gtk_search_entry_activate (GtkSearchEntry* _sender,
                                                                                          gpointer self)
{
	tasks_widgets_entry_popover_location_on_search_entry_activate ((TasksWidgetsEntryPopoverLocation*) self);
}

static void
_tasks_widgets_entry_popover_location___lambda50_ (TasksWidgetsEntryPopoverLocation* self)
{
	GtkToggleButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->arriving_button;
	_tmp1_ = gtk_toggle_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		tasks_widgets_entry_popover_location_on_location_mode_changed (self, TASKS_LOCATION_PROXIMITY_ARRIVE);
	}
}

static void
__tasks_widgets_entry_popover_location___lambda50__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                              gpointer self)
{
	_tasks_widgets_entry_popover_location___lambda50_ ((TasksWidgetsEntryPopoverLocation*) self);
}

static void
_tasks_widgets_entry_popover_location___lambda51_ (TasksWidgetsEntryPopoverLocation* self)
{
	GtkToggleButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->leaving_button;
	_tmp1_ = gtk_toggle_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		tasks_widgets_entry_popover_location_on_location_mode_changed (self, TASKS_LOCATION_PROXIMITY_DEPART);
	}
}

static void
__tasks_widgets_entry_popover_location___lambda51__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                              gpointer self)
{
	_tasks_widgets_entry_popover_location___lambda51_ ((TasksWidgetsEntryPopoverLocation*) self);
}

static GObject *
tasks_widgets_entry_popover_location_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TasksWidgetsEntryPopoverLocation * self;
	ShumateMapSourceRegistry* registry = NULL;
	ShumateMapSourceRegistry* _tmp0_;
	ShumateMapSourceRegistry* _tmp1_;
	ShumateMapSource* _tmp2_;
	ShumateMapSource* _tmp3_;
	ShumateSimpleMap* _tmp4_ = NULL;
	GtkImage* _tmp5_ = NULL;
	ShumateMarker* _tmp6_ = NULL;
	ShumateMarkerLayer* marker_layer = NULL;
	ShumateSimpleMap* _tmp7_;
	ShumateViewport* _tmp8_;
	ShumateViewport* _tmp9_;
	ShumateMarkerLayer* _tmp10_;
	ShumateMarkerLayer* _tmp11_;
	ShumateMarker* _tmp12_;
	ShumateViewport* map_view = NULL;
	ShumateSimpleMap* _tmp13_;
	ShumateViewport* _tmp14_;
	ShumateViewport* _tmp15_;
	ShumateViewport* _tmp16_;
	ShumateViewport* _tmp17_;
	ShumateMap* map = NULL;
	ShumateSimpleMap* _tmp18_;
	ShumateMap* _tmp19_;
	ShumateMap* _tmp20_;
	ShumateMap* _tmp21_;
	ShumateMap* _tmp22_;
	ShumateMap* _tmp23_;
	ShumateMarkerLayer* _tmp24_;
	ShumateMap* _tmp25_;
	ShumateMarker* _tmp26_;
	gdouble _tmp27_;
	gdouble _tmp28_;
	ShumateMarker* _tmp29_;
	gdouble _tmp30_;
	gdouble _tmp31_;
	GtkFrame* map_frame = NULL;
	ShumateSimpleMap* _tmp32_;
	GtkWidget* _tmp33_;
	GtkFrame* _tmp34_ = NULL;
	GtkToggleButton* _tmp35_ = NULL;
	GtkToggleButton* _tmp36_;
	GtkToggleButton* _tmp37_;
	GtkToggleButton* _tmp38_ = NULL;
	GtkBox* mode_box = NULL;
	GtkBox* _tmp39_;
	GtkBox* _tmp40_;
	GtkToggleButton* _tmp41_;
	GtkBox* _tmp42_;
	GtkToggleButton* _tmp43_;
	GtkBox* _tmp44_;
	gchar* _tmp45_;
	GtkSearchEntry* _tmp46_ = NULL;
	GtkBox* box = NULL;
	GtkBox* _tmp47_ = NULL;
	GtkBox* _tmp48_;
	GtkSearchEntry* _tmp49_;
	GtkBox* _tmp50_;
	GtkBox* _tmp51_;
	GtkBox* _tmp52_;
	GtkFrame* _tmp53_;
	GtkPopover* _tmp54_;
	GtkPopover* _tmp55_;
	GtkBox* _tmp56_;
	GtkPopover* _tmp57_;
	GtkPopover* _tmp58_;
	GtkSearchEntry* _tmp59_;
	GtkToggleButton* _tmp60_;
	GtkToggleButton* _tmp61_;
	parent_class = G_OBJECT_CLASS (tasks_widgets_entry_popover_location_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TASKS_WIDGETS_ENTRY_POPOVER_TYPE_LOCATION, TasksWidgetsEntryPopoverLocation);
	_tmp0_ = shumate_map_source_registry_new_with_defaults ();
	registry = _tmp0_;
	_tmp1_ = registry;
	_tmp2_ = shumate_map_source_registry_get_by_id (_tmp1_, SHUMATE_MAP_SOURCE_OSM_MAPNIK);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = shumate_simple_map_new ();
	g_object_set ((GtkWidget*) _tmp4_, "height-request", 140, NULL);
	g_object_set ((GtkWidget*) _tmp4_, "width-request", 260, NULL);
	shumate_simple_map_set_map_source (_tmp4_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->simple_map);
	self->priv->simple_map = _tmp4_;
	_tmp5_ = (GtkImage*) gtk_image_new_from_icon_name ("location-marker");
	gtk_image_set_icon_size (_tmp5_, GTK_ICON_SIZE_LARGE);
	g_object_ref_sink (_tmp5_);
	_tmp6_ = shumate_marker_new ();
	shumate_marker_set_child (_tmp6_, (GtkWidget*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->point);
	self->priv->point = _tmp6_;
	_tmp7_ = self->priv->simple_map;
	_tmp8_ = shumate_simple_map_get_viewport (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = shumate_marker_layer_new_full (_tmp9_, GTK_SELECTION_SINGLE);
	g_object_ref_sink (_tmp10_);
	marker_layer = _tmp10_;
	_tmp11_ = marker_layer;
	_tmp12_ = self->priv->point;
	shumate_marker_layer_add_marker (_tmp11_, _tmp12_);
	_tmp13_ = self->priv->simple_map;
	_tmp14_ = shumate_simple_map_get_viewport (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = _g_object_ref0 (_tmp15_);
	map_view = _tmp16_;
	_tmp17_ = map_view;
	shumate_viewport_set_zoom_level (_tmp17_, (gdouble) 10);
	_tmp18_ = self->priv->simple_map;
	_tmp19_ = shumate_simple_map_get_map (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = _g_object_ref0 (_tmp20_);
	map = _tmp21_;
	_tmp22_ = map;
	shumate_map_set_go_to_duration (_tmp22_, (guint) 500);
	_tmp23_ = map;
	_tmp24_ = marker_layer;
	shumate_map_add_layer (_tmp23_, (ShumateLayer*) _tmp24_);
	_tmp25_ = map;
	_tmp26_ = self->priv->point;
	g_object_get ((ShumateLocation*) _tmp26_, "latitude", &_tmp27_, NULL);
	_tmp28_ = _tmp27_;
	_tmp29_ = self->priv->point;
	g_object_get ((ShumateLocation*) _tmp29_, "longitude", &_tmp30_, NULL);
	_tmp31_ = _tmp30_;
	shumate_map_center_on (_tmp25_, _tmp28_, _tmp31_);
	_tmp32_ = self->priv->simple_map;
	_tmp33_ = _g_object_ref0 ((GtkWidget*) _tmp32_);
	_tmp34_ = (GtkFrame*) gtk_frame_new (NULL);
	gtk_frame_set_child (_tmp34_, _tmp33_);
	_g_object_unref0 (_tmp33_);
	g_object_ref_sink (_tmp34_);
	map_frame = _tmp34_;
	_tmp35_ = (GtkToggleButton*) gtk_toggle_button_new_with_label (_ ("Arriving"));
	gtk_widget_set_hexpand ((GtkWidget*) _tmp35_, TRUE);
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (self->priv->arriving_button);
	self->priv->arriving_button = _tmp35_;
	_tmp36_ = self->priv->arriving_button;
	_tmp37_ = _g_object_ref0 (_tmp36_);
	_tmp38_ = (GtkToggleButton*) gtk_toggle_button_new_with_label (_ ("Leaving"));
	gtk_toggle_button_set_group (_tmp38_, _tmp37_);
	_g_object_unref0 (_tmp37_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp38_, TRUE);
	g_object_ref_sink (_tmp38_);
	_g_object_unref0 (self->priv->leaving_button);
	self->priv->leaving_button = _tmp38_;
	_tmp39_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp39_);
	mode_box = _tmp39_;
	_tmp40_ = mode_box;
	_tmp41_ = self->priv->arriving_button;
	gtk_box_append (_tmp40_, (GtkWidget*) _tmp41_);
	_tmp42_ = mode_box;
	_tmp43_ = self->priv->leaving_button;
	gtk_box_append (_tmp42_, (GtkWidget*) _tmp43_);
	_tmp44_ = mode_box;
	gtk_widget_add_css_class ((GtkWidget*) _tmp44_, GRANITE_STYLE_CLASS_LINKED);
	_tmp45_ = g_strdup (_ ("John Smith OR Example St."));
	_tmp46_ = (GtkSearchEntry*) gtk_search_entry_new ();
	g_object_set (_tmp46_, "placeholder-text", _tmp45_, NULL);
	_g_free0 (_tmp45_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp46_, TRUE);
	g_object_ref_sink (_tmp46_);
	_g_object_unref0 (self->priv->search_entry);
	self->priv->search_entry = _tmp46_;
	_tmp47_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp47_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp47_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp47_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp47_, 12);
	g_object_ref_sink (_tmp47_);
	box = _tmp47_;
	_tmp48_ = box;
	_tmp49_ = self->priv->search_entry;
	gtk_box_append (_tmp48_, (GtkWidget*) _tmp49_);
	_tmp50_ = box;
	_tmp51_ = mode_box;
	gtk_box_append (_tmp50_, (GtkWidget*) _tmp51_);
	_tmp52_ = box;
	_tmp53_ = map_frame;
	gtk_box_append (_tmp52_, (GtkWidget*) _tmp53_);
	_tmp54_ = tasks_widgets_entry_popover_generic_get_popover ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp55_ = _tmp54_;
	_tmp56_ = box;
	gtk_popover_set_child (_tmp55_, (GtkWidget*) _tmp56_);
	_tmp57_ = tasks_widgets_entry_popover_generic_get_popover ((TasksWidgetsEntryPopoverGeneric*) self);
	_tmp58_ = _tmp57_;
	g_signal_connect_object ((GtkWidget*) _tmp58_, "show", (GCallback) _tasks_widgets_entry_popover_location_on_popover_show_gtk_widget_show, self, 0);
	g_signal_connect_object ((GObject*) self, "notify::value", (GCallback) _tasks_widgets_entry_popover_location_on_value_changed_g_object_notify, self, 0);
	_tmp59_ = self->priv->search_entry;
	g_signal_connect_object (_tmp59_, "activate", (GCallback) _tasks_widgets_entry_popover_location_on_search_entry_activate_gtk_search_entry_activate, self, 0);
	_tmp60_ = self->priv->arriving_button;
	g_signal_connect_object (_tmp60_, "toggled", (GCallback) __tasks_widgets_entry_popover_location___lambda50__gtk_toggle_button_toggled, self, 0);
	_tmp61_ = self->priv->leaving_button;
	g_signal_connect_object (_tmp61_, "toggled", (GCallback) __tasks_widgets_entry_popover_location___lambda51__gtk_toggle_button_toggled, self, 0);
	_g_object_unref0 (box);
	_g_object_unref0 (mode_box);
	_g_object_unref0 (map_frame);
	_g_object_unref0 (map);
	_g_object_unref0 (map_view);
	_g_object_unref0 (marker_layer);
	_g_object_unref0 (registry);
	return obj;
}

static void
tasks_widgets_entry_popover_location_class_init (TasksWidgetsEntryPopoverLocationClass * klass,
                                                 gpointer klass_data)
{
	tasks_widgets_entry_popover_location_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TasksWidgetsEntryPopoverLocation_private_offset);
	G_OBJECT_CLASS (klass)->constructor = tasks_widgets_entry_popover_location_constructor;
	G_OBJECT_CLASS (klass)->finalize = tasks_widgets_entry_popover_location_finalize;
}

static void
tasks_widgets_entry_popover_location_instance_init (TasksWidgetsEntryPopoverLocation * self,
                                                    gpointer klass)
{
	self->priv = tasks_widgets_entry_popover_location_get_instance_private (self);
}

static void
tasks_widgets_entry_popover_location_finalize (GObject * obj)
{
	TasksWidgetsEntryPopoverLocation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TASKS_WIDGETS_ENTRY_POPOVER_TYPE_LOCATION, TasksWidgetsEntryPopoverLocation);
	_g_object_unref0 (self->priv->simple_map);
	_g_object_unref0 (self->priv->search_entry);
	_g_object_unref0 (self->priv->search_cancellable);
	_g_object_unref0 (self->priv->point);
	_g_object_unref0 (self->priv->arriving_button);
	_g_object_unref0 (self->priv->leaving_button);
	G_OBJECT_CLASS (tasks_widgets_entry_popover_location_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tasks_widgets_entry_popover_location_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TasksWidgetsEntryPopoverLocationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tasks_widgets_entry_popover_location_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TasksWidgetsEntryPopoverLocation), 0, (GInstanceInitFunc) tasks_widgets_entry_popover_location_instance_init, NULL };
	GType tasks_widgets_entry_popover_location_type_id;
	tasks_widgets_entry_popover_location_type_id = g_type_register_static (TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, "TasksWidgetsEntryPopoverLocation", &g_define_type_info, 0);
	TasksWidgetsEntryPopoverLocation_private_offset = g_type_add_instance_private (tasks_widgets_entry_popover_location_type_id, sizeof (TasksWidgetsEntryPopoverLocationPrivate));
	return tasks_widgets_entry_popover_location_type_id;
}

GType
tasks_widgets_entry_popover_location_get_type (void)
{
	static gsize tasks_widgets_entry_popover_location_type_id__once = 0;
	if (g_once_init_enter (&tasks_widgets_entry_popover_location_type_id__once)) {
		GType tasks_widgets_entry_popover_location_type_id;
		tasks_widgets_entry_popover_location_type_id = tasks_widgets_entry_popover_location_get_type_once ();
		g_once_init_leave (&tasks_widgets_entry_popover_location_type_id__once, tasks_widgets_entry_popover_location_type_id);
	}
	return tasks_widgets_entry_popover_location_type_id__once;
}

