/* markers-vala.c generated by valac 0.14.0, the Vala compiler
 * generated from markers-vala.vala, do not modify */

/*
 * Copyright (C) 2010 Simon Wenner <simon@wenner.ch>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <glib.h>
#include <glib-object.h>
#include <champlain/champlain.h>
#include <clutter/clutter.h>
#include <pango/pango.h>


#define TYPE_DEMO_LAYER (demo_layer_get_type ())
#define DEMO_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DEMO_LAYER, DemoLayer))
#define DEMO_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DEMO_LAYER, DemoLayerClass))
#define IS_DEMO_LAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DEMO_LAYER))
#define IS_DEMO_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DEMO_LAYER))
#define DEMO_LAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DEMO_LAYER, DemoLayerClass))

typedef struct _DemoLayer DemoLayer;
typedef struct _DemoLayerClass DemoLayerClass;
typedef struct _DemoLayerPrivate DemoLayerPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _DemoLayer {
	ChamplainMarkerLayer parent_instance;
	DemoLayerPrivate * priv;
};

struct _DemoLayerClass {
	ChamplainMarkerLayerClass parent_class;
};


static gpointer demo_layer_parent_class = NULL;

GType demo_layer_get_type (void) G_GNUC_CONST;
enum  {
	DEMO_LAYER_DUMMY_PROPERTY
};
DemoLayer* demo_layer_new (void);
DemoLayer* demo_layer_construct (GType object_type);


DemoLayer* demo_layer_construct (GType object_type) {
	DemoLayer * self = NULL;
	ClutterColor _tmp0_ = {0};
	ClutterColor orange;
	ChamplainLabel* _tmp1_;
	ChamplainLabel* _tmp2_;
	ChamplainLabel* marker;
	ChamplainLabel* _tmp3_;
	ChamplainLabel* _tmp4_;
	ChamplainLabel* _tmp5_;
	ClutterColor _tmp6_;
	ChamplainLabel* _tmp7_;
	ChamplainLabel* _tmp8_;
	ChamplainLabel* _tmp15_;
	ChamplainLabel* _tmp16_;
	ChamplainLabel* _tmp17_;
	ChamplainLabel* _tmp24_;
	ChamplainLabel* _tmp25_;
	ChamplainLabel* _tmp32_;
	ChamplainLabel* _tmp33_;
	ChamplainLabel* _tmp34_;
	GError * _inner_error_ = NULL;
	self = (DemoLayer*) g_object_new (object_type, NULL);
	_tmp0_.red = (guint8) 0xf3;
	_tmp0_.green = (guint8) 0x94;
	_tmp0_.blue = (guint8) 0x07;
	_tmp0_.alpha = (guint8) 0xbb;
	orange = _tmp0_;
	_tmp1_ = (ChamplainLabel*) champlain_label_new_with_text ("Montréal\n<span size=\"xx-small\">Québec</span>", "Serif 14", NULL, NULL);
	_tmp2_ = g_object_ref_sink (_tmp1_);
	marker = _tmp2_;
	_tmp3_ = marker;
	champlain_label_set_use_markup (_tmp3_, TRUE);
	_tmp4_ = marker;
	champlain_label_set_alignment (_tmp4_, PANGO_ALIGN_RIGHT);
	_tmp5_ = marker;
	_tmp6_ = orange;
	champlain_label_set_color (_tmp5_, &_tmp6_);
	_tmp7_ = marker;
	champlain_location_set_location ((ChamplainLocation*) _tmp7_, 45.528178, -73.563788);
	_tmp8_ = marker;
	champlain_marker_layer_add_marker ((ChamplainMarkerLayer*) self, (ChamplainMarker*) _tmp8_);
	{
		ChamplainLabel* _tmp9_;
		ChamplainLabel* _tmp10_;
		ChamplainLabel* _tmp11_;
		ChamplainLabel* _tmp12_;
		_tmp9_ = (ChamplainLabel*) champlain_label_new_from_file ("icons/emblem-generic.png", &_inner_error_);
		_tmp10_ = g_object_ref_sink (_tmp9_);
		_tmp11_ = _tmp10_;
		if (_inner_error_ != NULL) {
			goto __catch0_g_error;
		}
		_tmp12_ = g_object_ref_sink (_tmp11_);
		_g_object_unref0 (marker);
		marker = _tmp12_;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp13_ = e;
		_tmp14_ = _tmp13_->message;
		g_warning ("markers-vala.vala:40: %s", _tmp14_);
		_g_error_free0 (e);
	}
	__finally0:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (marker);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp15_ = marker;
	champlain_label_set_text (_tmp15_, "New York");
	_tmp16_ = marker;
	champlain_location_set_location ((ChamplainLocation*) _tmp16_, 40.77, -73.98);
	_tmp17_ = marker;
	champlain_marker_layer_add_marker ((ChamplainMarkerLayer*) self, (ChamplainMarker*) _tmp17_);
	{
		ChamplainLabel* _tmp18_;
		ChamplainLabel* _tmp19_;
		ChamplainLabel* _tmp20_;
		ChamplainLabel* _tmp21_;
		_tmp18_ = (ChamplainLabel*) champlain_label_new_from_file ("icons/emblem-important.png", &_inner_error_);
		_tmp19_ = g_object_ref_sink (_tmp18_);
		_tmp20_ = _tmp19_;
		if (_inner_error_ != NULL) {
			goto __catch1_g_error;
		}
		_tmp21_ = g_object_ref_sink (_tmp20_);
		_g_object_unref0 (marker);
		marker = _tmp21_;
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp22_;
		const gchar* _tmp23_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp22_ = e;
		_tmp23_ = _tmp22_->message;
		g_warning ("markers-vala.vala:50: %s", _tmp23_);
		_g_error_free0 (e);
	}
	__finally1:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (marker);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp24_ = marker;
	champlain_location_set_location ((ChamplainLocation*) _tmp24_, 47.130885, -70.764141);
	_tmp25_ = marker;
	champlain_marker_layer_add_marker ((ChamplainMarkerLayer*) self, (ChamplainMarker*) _tmp25_);
	{
		ChamplainLabel* _tmp26_;
		ChamplainLabel* _tmp27_;
		ChamplainLabel* _tmp28_;
		ChamplainLabel* _tmp29_;
		_tmp26_ = (ChamplainLabel*) champlain_label_new_from_file ("icons/emblem-favorite.png", &_inner_error_);
		_tmp27_ = g_object_ref_sink (_tmp26_);
		_tmp28_ = _tmp27_;
		if (_inner_error_ != NULL) {
			goto __catch2_g_error;
		}
		_tmp29_ = g_object_ref_sink (_tmp28_);
		_g_object_unref0 (marker);
		marker = _tmp29_;
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		GError* _tmp30_;
		const gchar* _tmp31_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp30_ = e;
		_tmp31_ = _tmp30_->message;
		g_warning ("markers-vala.vala:59: %s", _tmp31_);
		_g_error_free0 (e);
	}
	__finally2:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (marker);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp32_ = marker;
	champlain_label_set_draw_background (_tmp32_, FALSE);
	_tmp33_ = marker;
	champlain_location_set_location ((ChamplainLocation*) _tmp33_, 45.41484, -71.918907);
	_tmp34_ = marker;
	champlain_marker_layer_add_marker ((ChamplainMarkerLayer*) self, (ChamplainMarker*) _tmp34_);
	_g_object_unref0 (marker);
	return self;
}


DemoLayer* demo_layer_new (void) {
	return demo_layer_construct (TYPE_DEMO_LAYER);
}


static void demo_layer_class_init (DemoLayerClass * klass) {
	demo_layer_parent_class = g_type_class_peek_parent (klass);
}


static void demo_layer_instance_init (DemoLayer * self) {
}


GType demo_layer_get_type (void) {
	static volatile gsize demo_layer_type_id__volatile = 0;
	if (g_once_init_enter (&demo_layer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DemoLayerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) demo_layer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DemoLayer), 0, (GInstanceInitFunc) demo_layer_instance_init, NULL };
		GType demo_layer_type_id;
		demo_layer_type_id = g_type_register_static (champlain_marker_layer_get_type (), "DemoLayer", &g_define_type_info, 0);
		g_once_init_leave (&demo_layer_type_id__volatile, demo_layer_type_id);
	}
	return demo_layer_type_id__volatile;
}



