/* gitg-when-mapped.c generated by valac 0.28.0, the Vala compiler
 * generated from gitg-when-mapped.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2012 - Jesse van den Kieboom
 *
 * gitg 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 2 of the License, or
 * (at your option) any later version.
 *
 * gitg 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 gitg. If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gobject/gvaluecollector.h>


#define GITG_TYPE_WHEN_MAPPED (gitg_when_mapped_get_type ())
#define GITG_WHEN_MAPPED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_WHEN_MAPPED, GitgWhenMapped))
#define GITG_WHEN_MAPPED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_WHEN_MAPPED, GitgWhenMappedClass))
#define GITG_IS_WHEN_MAPPED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_WHEN_MAPPED))
#define GITG_IS_WHEN_MAPPED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_WHEN_MAPPED))
#define GITG_WHEN_MAPPED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_WHEN_MAPPED, GitgWhenMappedClass))

typedef struct _GitgWhenMapped GitgWhenMapped;
typedef struct _GitgWhenMappedClass GitgWhenMappedClass;
typedef struct _GitgWhenMappedPrivate GitgWhenMappedPrivate;
typedef struct _Block34Data Block34Data;
#define _gitg_when_mapped_unref0(var) ((var == NULL) ? NULL : (var = (gitg_when_mapped_unref (var), NULL)))
typedef struct _GitgParamSpecWhenMapped GitgParamSpecWhenMapped;

struct _GitgWhenMapped {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GitgWhenMappedPrivate * priv;
};

struct _GitgWhenMappedClass {
	GTypeClass parent_class;
	void (*finalize) (GitgWhenMapped *self);
};

struct _GitgWhenMappedPrivate {
	GtkWidget* d_widget;
	GObject* d_lifetime;
	gulong d_sid;
};

typedef void (*GitgWhenMappedOnMapped) (void* user_data);
struct _Block34Data {
	int _ref_count_;
	GitgWhenMapped* self;
	GitgWhenMappedOnMapped mapped;
	gpointer mapped_target;
	GDestroyNotify mapped_target_destroy_notify;
};

struct _GitgParamSpecWhenMapped {
	GParamSpec parent_instance;
};


static gpointer gitg_when_mapped_parent_class = NULL;

gpointer gitg_when_mapped_ref (gpointer instance);
void gitg_when_mapped_unref (gpointer instance);
GParamSpec* gitg_param_spec_when_mapped (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gitg_value_set_when_mapped (GValue* value, gpointer v_object);
void gitg_value_take_when_mapped (GValue* value, gpointer v_object);
gpointer gitg_value_get_when_mapped (const GValue* value);
GType gitg_when_mapped_get_type (void) G_GNUC_CONST;
#define GITG_WHEN_MAPPED_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GITG_TYPE_WHEN_MAPPED, GitgWhenMappedPrivate))
enum  {
	GITG_WHEN_MAPPED_DUMMY_PROPERTY
};
static void gitg_when_mapped_weak_notify (GitgWhenMapped* self, GObject* o);
static void _gitg_when_mapped_weak_notify_gweak_notify (gpointer self, GObject* object);
static void gitg_when_mapped_lifetime_weak_notify (GitgWhenMapped* self, GObject* o);
static void _gitg_when_mapped_lifetime_weak_notify_gweak_notify (gpointer self, GObject* object);
GitgWhenMapped* gitg_when_mapped_new (GtkWidget* widget);
GitgWhenMapped* gitg_when_mapped_construct (GType object_type, GtkWidget* widget);
void gitg_when_mapped_update (GitgWhenMapped* self, GitgWhenMappedOnMapped mapped, void* mapped_target, GDestroyNotify mapped_target_destroy_notify, GObject* lifetime);
static Block34Data* block34_data_ref (Block34Data* _data34_);
static void block34_data_unref (void * _userdata_);
static void ___lambda68_ (Block34Data* _data34_);
static void ____lambda68__gtk_widget_map (GtkWidget* _sender, gpointer self);
static void gitg_when_mapped_finalize (GitgWhenMapped* obj);


static void _gitg_when_mapped_weak_notify_gweak_notify (gpointer self, GObject* object) {
#line 58 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	gitg_when_mapped_weak_notify ((GitgWhenMapped*) self, object);
#line 105 "gitg-when-mapped.c"
}


static void _gitg_when_mapped_lifetime_weak_notify_gweak_notify (gpointer self, GObject* object) {
#line 64 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	gitg_when_mapped_lifetime_weak_notify ((GitgWhenMapped*) self, object);
#line 112 "gitg-when-mapped.c"
}


GitgWhenMapped* gitg_when_mapped_construct (GType object_type, GtkWidget* widget) {
	GitgWhenMapped* self = NULL;
	GtkWidget* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
#line 30 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_return_val_if_fail (widget != NULL, NULL);
#line 30 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	self = (GitgWhenMapped*) g_type_create_instance (object_type);
#line 32 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	self->priv->d_sid = (gulong) 0;
#line 33 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp0_ = widget;
#line 33 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	self->priv->d_widget = _tmp0_;
#line 35 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp1_ = self->priv->d_widget;
#line 35 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_object_weak_ref ((GObject*) _tmp1_, _gitg_when_mapped_weak_notify_gweak_notify, self);
#line 30 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	return self;
#line 136 "gitg-when-mapped.c"
}


GitgWhenMapped* gitg_when_mapped_new (GtkWidget* widget) {
#line 30 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	return gitg_when_mapped_construct (GITG_TYPE_WHEN_MAPPED, widget);
#line 143 "gitg-when-mapped.c"
}


static void gitg_when_mapped_weak_notify (GitgWhenMapped* self, GObject* o) {
	GObject* _tmp0_ = NULL;
#line 38 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_return_if_fail (self != NULL);
#line 38 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_return_if_fail (o != NULL);
#line 40 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	self->priv->d_widget = NULL;
#line 42 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp0_ = self->priv->d_lifetime;
#line 42 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (_tmp0_ != NULL) {
#line 159 "gitg-when-mapped.c"
		GObject* _tmp1_ = NULL;
#line 44 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp1_ = self->priv->d_lifetime;
#line 44 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_object_weak_unref (_tmp1_, _gitg_when_mapped_lifetime_weak_notify_gweak_notify, self);
#line 45 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		self->priv->d_lifetime = NULL;
#line 167 "gitg-when-mapped.c"
	}
}


static void gitg_when_mapped_lifetime_weak_notify (GitgWhenMapped* self, GObject* o) {
	gboolean _tmp0_ = FALSE;
	gulong _tmp1_ = 0UL;
#line 69 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_return_if_fail (self != NULL);
#line 69 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_return_if_fail (o != NULL);
#line 71 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp1_ = self->priv->d_sid;
#line 71 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (_tmp1_ != ((gulong) 0)) {
#line 183 "gitg-when-mapped.c"
		GtkWidget* _tmp2_ = NULL;
#line 71 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp2_ = self->priv->d_widget;
#line 71 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp0_ = _tmp2_ != NULL;
#line 189 "gitg-when-mapped.c"
	} else {
#line 71 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp0_ = FALSE;
#line 193 "gitg-when-mapped.c"
	}
#line 71 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (_tmp0_) {
#line 197 "gitg-when-mapped.c"
		GtkWidget* _tmp3_ = NULL;
		gulong _tmp4_ = 0UL;
#line 73 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp3_ = self->priv->d_widget;
#line 73 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp4_ = self->priv->d_sid;
#line 73 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_signal_handler_disconnect ((GObject*) _tmp3_, _tmp4_);
#line 74 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		self->priv->d_sid = (gulong) 0;
#line 208 "gitg-when-mapped.c"
	}
#line 77 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	self->priv->d_lifetime = NULL;
#line 212 "gitg-when-mapped.c"
}


static Block34Data* block34_data_ref (Block34Data* _data34_) {
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_atomic_int_inc (&_data34_->_ref_count_);
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	return _data34_;
#line 221 "gitg-when-mapped.c"
}


static void block34_data_unref (void * _userdata_) {
	Block34Data* _data34_;
	_data34_ = (Block34Data*) _userdata_;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
#line 230 "gitg-when-mapped.c"
		GitgWhenMapped* self;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		self = _data34_->self;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		(_data34_->mapped_target_destroy_notify == NULL) ? NULL : (_data34_->mapped_target_destroy_notify (_data34_->mapped_target), NULL);
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_data34_->mapped = NULL;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_data34_->mapped_target = NULL;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_data34_->mapped_target_destroy_notify = NULL;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_gitg_when_mapped_unref0 (self);
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_slice_free (Block34Data, _data34_);
#line 246 "gitg-when-mapped.c"
	}
}


static void ___lambda68_ (Block34Data* _data34_) {
	GitgWhenMapped* self;
	GObject* _tmp0_ = NULL;
	GitgWhenMappedOnMapped _tmp2_ = NULL;
	void* _tmp2__target = NULL;
#line 104 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	self = _data34_->self;
#line 105 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	self->priv->d_sid = (gulong) 0;
#line 107 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp0_ = self->priv->d_lifetime;
#line 107 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (_tmp0_ != NULL) {
#line 264 "gitg-when-mapped.c"
		GObject* _tmp1_ = NULL;
#line 109 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp1_ = self->priv->d_lifetime;
#line 109 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_object_weak_unref (_tmp1_, _gitg_when_mapped_lifetime_weak_notify_gweak_notify, self);
#line 110 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		self->priv->d_lifetime = NULL;
#line 272 "gitg-when-mapped.c"
	}
#line 113 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp2_ = _data34_->mapped;
#line 113 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp2__target = _data34_->mapped_target;
#line 113 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp2_ (_tmp2__target);
#line 280 "gitg-when-mapped.c"
}


static void ____lambda68__gtk_widget_map (GtkWidget* _sender, gpointer self) {
#line 104 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	___lambda68_ (self);
#line 287 "gitg-when-mapped.c"
}


void gitg_when_mapped_update (GitgWhenMapped* self, GitgWhenMappedOnMapped mapped, void* mapped_target, GDestroyNotify mapped_target_destroy_notify, GObject* lifetime) {
	Block34Data* _data34_;
	GitgWhenMappedOnMapped _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	GtkWidget* _tmp1_ = NULL;
	gulong _tmp2_ = 0UL;
	GObject* _tmp5_ = NULL;
	GtkWidget* _tmp7_ = NULL;
	gboolean _tmp8_ = FALSE;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_return_if_fail (self != NULL);
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_data34_ = g_slice_new0 (Block34Data);
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_data34_->_ref_count_ = 1;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_data34_->self = gitg_when_mapped_ref (self);
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp0_ = mapped;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp0__target = mapped_target;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	(_data34_->mapped_target_destroy_notify == NULL) ? NULL : (_data34_->mapped_target_destroy_notify (_data34_->mapped_target), NULL);
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_data34_->mapped = NULL;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_data34_->mapped_target = NULL;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_data34_->mapped_target_destroy_notify = NULL;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_data34_->mapped = _tmp0_;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_data34_->mapped_target = _tmp0__target;
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_data34_->mapped_target_destroy_notify = mapped_target_destroy_notify;
#line 82 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp1_ = self->priv->d_widget;
#line 82 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (_tmp1_ == NULL) {
#line 84 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		block34_data_unref (_data34_);
#line 84 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_data34_ = NULL;
#line 84 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		return;
#line 336 "gitg-when-mapped.c"
	}
#line 87 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp2_ = self->priv->d_sid;
#line 87 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (_tmp2_ != ((gulong) 0)) {
#line 342 "gitg-when-mapped.c"
		GtkWidget* _tmp3_ = NULL;
		gulong _tmp4_ = 0UL;
#line 89 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp3_ = self->priv->d_widget;
#line 89 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp4_ = self->priv->d_sid;
#line 89 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_signal_handler_disconnect ((GObject*) _tmp3_, _tmp4_);
#line 351 "gitg-when-mapped.c"
	}
#line 92 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp5_ = self->priv->d_lifetime;
#line 92 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (_tmp5_ != NULL) {
#line 357 "gitg-when-mapped.c"
		GObject* _tmp6_ = NULL;
#line 94 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp6_ = self->priv->d_lifetime;
#line 94 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_object_weak_unref (_tmp6_, _gitg_when_mapped_lifetime_weak_notify_gweak_notify, self);
#line 95 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		self->priv->d_lifetime = NULL;
#line 365 "gitg-when-mapped.c"
	}
#line 98 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp7_ = self->priv->d_widget;
#line 98 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp8_ = gtk_widget_get_mapped (_tmp7_);
#line 98 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (_tmp8_) {
#line 373 "gitg-when-mapped.c"
		GitgWhenMappedOnMapped _tmp9_ = NULL;
		void* _tmp9__target = NULL;
#line 100 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp9_ = _data34_->mapped;
#line 100 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp9__target = _data34_->mapped_target;
#line 100 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp9_ (_tmp9__target);
#line 382 "gitg-when-mapped.c"
	} else {
		GtkWidget* _tmp10_ = NULL;
		gulong _tmp11_ = 0UL;
		GObject* _tmp12_ = NULL;
		GObject* _tmp13_ = NULL;
#line 104 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp10_ = self->priv->d_widget;
#line 104 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp11_ = g_signal_connect_data (_tmp10_, "map", (GCallback) ____lambda68__gtk_widget_map, block34_data_ref (_data34_), (GClosureNotify) block34_data_unref, 0);
#line 104 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		self->priv->d_sid = _tmp11_;
#line 116 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp12_ = lifetime;
#line 116 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		self->priv->d_lifetime = _tmp12_;
#line 118 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp13_ = self->priv->d_lifetime;
#line 118 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		if (_tmp13_ != NULL) {
#line 402 "gitg-when-mapped.c"
			GObject* _tmp14_ = NULL;
#line 120 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
			_tmp14_ = self->priv->d_lifetime;
#line 120 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
			g_object_weak_ref (_tmp14_, _gitg_when_mapped_lifetime_weak_notify_gweak_notify, self);
#line 408 "gitg-when-mapped.c"
		}
	}
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	block34_data_unref (_data34_);
#line 80 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_data34_ = NULL;
#line 415 "gitg-when-mapped.c"
}


static void gitg_value_when_mapped_init (GValue* value) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	value->data[0].v_pointer = NULL;
#line 422 "gitg-when-mapped.c"
}


static void gitg_value_when_mapped_free_value (GValue* value) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (value->data[0].v_pointer) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		gitg_when_mapped_unref (value->data[0].v_pointer);
#line 431 "gitg-when-mapped.c"
	}
}


static void gitg_value_when_mapped_copy_value (const GValue* src_value, GValue* dest_value) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (src_value->data[0].v_pointer) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		dest_value->data[0].v_pointer = gitg_when_mapped_ref (src_value->data[0].v_pointer);
#line 441 "gitg-when-mapped.c"
	} else {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		dest_value->data[0].v_pointer = NULL;
#line 445 "gitg-when-mapped.c"
	}
}


static gpointer gitg_value_when_mapped_peek_pointer (const GValue* value) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	return value->data[0].v_pointer;
#line 453 "gitg-when-mapped.c"
}


static gchar* gitg_value_when_mapped_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (collect_values[0].v_pointer) {
#line 460 "gitg-when-mapped.c"
		GitgWhenMapped* object;
		object = collect_values[0].v_pointer;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		if (object->parent_instance.g_class == NULL) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 467 "gitg-when-mapped.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 471 "gitg-when-mapped.c"
		}
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		value->data[0].v_pointer = gitg_when_mapped_ref (object);
#line 475 "gitg-when-mapped.c"
	} else {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		value->data[0].v_pointer = NULL;
#line 479 "gitg-when-mapped.c"
	}
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	return NULL;
#line 483 "gitg-when-mapped.c"
}


static gchar* gitg_value_when_mapped_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	GitgWhenMapped** object_p;
	object_p = collect_values[0].v_pointer;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (!object_p) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 494 "gitg-when-mapped.c"
	}
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (!value->data[0].v_pointer) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		*object_p = NULL;
#line 500 "gitg-when-mapped.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		*object_p = value->data[0].v_pointer;
#line 504 "gitg-when-mapped.c"
	} else {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		*object_p = gitg_when_mapped_ref (value->data[0].v_pointer);
#line 508 "gitg-when-mapped.c"
	}
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	return NULL;
#line 512 "gitg-when-mapped.c"
}


GParamSpec* gitg_param_spec_when_mapped (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	GitgParamSpecWhenMapped* spec;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_return_val_if_fail (g_type_is_a (object_type, GITG_TYPE_WHEN_MAPPED), NULL);
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	return G_PARAM_SPEC (spec);
#line 526 "gitg-when-mapped.c"
}


gpointer gitg_value_get_when_mapped (const GValue* value) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GITG_TYPE_WHEN_MAPPED), NULL);
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	return value->data[0].v_pointer;
#line 535 "gitg-when-mapped.c"
}


void gitg_value_set_when_mapped (GValue* value, gpointer v_object) {
	GitgWhenMapped* old;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GITG_TYPE_WHEN_MAPPED));
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	old = value->data[0].v_pointer;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (v_object) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GITG_TYPE_WHEN_MAPPED));
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		value->data[0].v_pointer = v_object;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		gitg_when_mapped_ref (value->data[0].v_pointer);
#line 555 "gitg-when-mapped.c"
	} else {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		value->data[0].v_pointer = NULL;
#line 559 "gitg-when-mapped.c"
	}
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (old) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		gitg_when_mapped_unref (old);
#line 565 "gitg-when-mapped.c"
	}
}


void gitg_value_take_when_mapped (GValue* value, gpointer v_object) {
	GitgWhenMapped* old;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GITG_TYPE_WHEN_MAPPED));
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	old = value->data[0].v_pointer;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (v_object) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GITG_TYPE_WHEN_MAPPED));
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		value->data[0].v_pointer = v_object;
#line 584 "gitg-when-mapped.c"
	} else {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		value->data[0].v_pointer = NULL;
#line 588 "gitg-when-mapped.c"
	}
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (old) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		gitg_when_mapped_unref (old);
#line 594 "gitg-when-mapped.c"
	}
}


static void gitg_when_mapped_class_init (GitgWhenMappedClass * klass) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	gitg_when_mapped_parent_class = g_type_class_peek_parent (klass);
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	((GitgWhenMappedClass *) klass)->finalize = gitg_when_mapped_finalize;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_type_class_add_private (klass, sizeof (GitgWhenMappedPrivate));
#line 606 "gitg-when-mapped.c"
}


static void gitg_when_mapped_instance_init (GitgWhenMapped * self) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	self->priv = GITG_WHEN_MAPPED_GET_PRIVATE (self);
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	self->ref_count = 1;
#line 615 "gitg-when-mapped.c"
}


static void gitg_when_mapped_finalize (GitgWhenMapped* obj) {
	GitgWhenMapped * self;
	GtkWidget* _tmp0_ = NULL;
	GObject* _tmp5_ = NULL;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_WHEN_MAPPED, GitgWhenMapped);
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_signal_handlers_destroy (self);
#line 51 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp0_ = self->priv->d_widget;
#line 51 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (_tmp0_ != NULL) {
#line 631 "gitg-when-mapped.c"
		gulong _tmp1_ = 0UL;
		GtkWidget* _tmp4_ = NULL;
#line 53 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp1_ = self->priv->d_sid;
#line 53 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		if (_tmp1_ != ((gulong) 0)) {
#line 638 "gitg-when-mapped.c"
			GtkWidget* _tmp2_ = NULL;
			gulong _tmp3_ = 0UL;
#line 55 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
			_tmp2_ = self->priv->d_widget;
#line 55 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
			_tmp3_ = self->priv->d_sid;
#line 55 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
			g_signal_handler_disconnect ((GObject*) _tmp2_, _tmp3_);
#line 647 "gitg-when-mapped.c"
		}
#line 58 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp4_ = self->priv->d_widget;
#line 58 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_object_weak_unref ((GObject*) _tmp4_, _gitg_when_mapped_weak_notify_gweak_notify, self);
#line 59 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		self->priv->d_widget = NULL;
#line 655 "gitg-when-mapped.c"
	}
#line 62 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	_tmp5_ = self->priv->d_lifetime;
#line 62 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (_tmp5_ != NULL) {
#line 661 "gitg-when-mapped.c"
		GObject* _tmp6_ = NULL;
#line 64 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		_tmp6_ = self->priv->d_lifetime;
#line 64 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_object_weak_unref (_tmp6_, _gitg_when_mapped_lifetime_weak_notify_gweak_notify, self);
#line 65 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		self->priv->d_lifetime = NULL;
#line 669 "gitg-when-mapped.c"
	}
}


GType gitg_when_mapped_get_type (void) {
	static volatile gsize gitg_when_mapped_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_when_mapped_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { gitg_value_when_mapped_init, gitg_value_when_mapped_free_value, gitg_value_when_mapped_copy_value, gitg_value_when_mapped_peek_pointer, "p", gitg_value_when_mapped_collect_value, "p", gitg_value_when_mapped_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (GitgWhenMappedClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_when_mapped_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgWhenMapped), 0, (GInstanceInitFunc) gitg_when_mapped_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType gitg_when_mapped_type_id;
		gitg_when_mapped_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GitgWhenMapped", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&gitg_when_mapped_type_id__volatile, gitg_when_mapped_type_id);
	}
	return gitg_when_mapped_type_id__volatile;
}


gpointer gitg_when_mapped_ref (gpointer instance) {
	GitgWhenMapped* self;
	self = instance;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	g_atomic_int_inc (&self->ref_count);
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	return instance;
#line 695 "gitg-when-mapped.c"
}


void gitg_when_mapped_unref (gpointer instance) {
	GitgWhenMapped* self;
	self = instance;
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		GITG_WHEN_MAPPED_GET_CLASS (self)->finalize (self);
#line 22 "/home/jesse/devel/gitg/libgitg/gitg-when-mapped.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 708 "gitg-when-mapped.c"
	}
}



