/* context-menu.c generated by valac 0.16.1, the Vala compiler
 * generated from context-menu.vala, do not modify */

/*
 * context-menu.vala - This file is part of the Geany MultiTerm plugin
 *
 * Copyright (c) 2012 Matthew Brush <matt@geany.org>.
 *
 * 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 2 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 <glib.h>
#include <glib-object.h>
#include "multiterm.h"
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;
#define _multi_term_shell_config_unref0(var) ((var == NULL) ? NULL : (var = (multi_term_shell_config_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _Block1Data {
	int _ref_count_;
	MultiTermContextMenu * self;
	GtkMenuItem* item;
	GtkCheckMenuItem* check_item;
};

struct _Block2Data {
	int _ref_count_;
	Block1Data * _data1_;
	MultiTermShellConfig* sh;
};


static gpointer multi_term_context_menu_parent_class = NULL;

enum  {
	MULTI_TERM_CONTEXT_MENU_DUMMY_PROPERTY
};
static void multi_term_context_menu_on_show_tabs_activate (MultiTermContextMenu* self, GtkCheckMenuItem* item);
static void multi_term_context_menu_on_next_previous_tab_activate (MultiTermContextMenu* self, GtkMenuItem* item, gboolean next);
static void multi_term_context_menu_on_move_to_location (MultiTermContextMenu* self, GtkMenuItem* item);
static void multi_term_context_menu_add_separator (MultiTermContextMenu* self);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void _____lambda3_ (Block2Data* _data2_);
static void ______lambda3__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda4_ (MultiTermContextMenu* self);
static void ___lambda4__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda5_ (Block1Data* _data1_);
static void ___lambda5__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda6_ (Block1Data* _data1_);
static void ___lambda6__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda7_ (MultiTermContextMenu* self);
static void ___lambda7__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda8_ (MultiTermContextMenu* self);
static void ___lambda8__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda9_ (Block1Data* _data1_);
static void ___lambda9__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda10_ (Block1Data* _data1_);
static void ___lambda10__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda11_ (MultiTermContextMenu* self);
static void ___lambda11__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void g_cclosure_user_marshal_VOID__MULTI_TERM_SHELL_CONFIG (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void g_cclosure_user_marshal_BOOLEAN__VOID (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);


static void multi_term_context_menu_on_show_tabs_activate (MultiTermContextMenu* self, GtkCheckMenuItem* item) {
	GtkCheckMenuItem* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	g_signal_emit_by_name (self, "show-tabs-activate", _tmp2_);
}


static void multi_term_context_menu_on_next_previous_tab_activate (MultiTermContextMenu* self, GtkMenuItem* item, gboolean next) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GtkMenuItem* _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp1_ = next;
	if (_tmp1_) {
		gboolean _tmp2_ = FALSE;
		g_signal_emit_by_name (self, "next-tab-activate", &_tmp2_);
		_tmp0_ = _tmp2_;
	} else {
		gboolean _tmp3_ = FALSE;
		g_signal_emit_by_name (self, "previous-tab-activate", &_tmp3_);
		_tmp0_ = _tmp3_;
	}
	_tmp4_ = item;
	_tmp5_ = _tmp0_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, _tmp5_);
}


static void multi_term_context_menu_on_move_to_location (MultiTermContextMenu* self, GtkMenuItem* item) {
	GtkMenuItem* _tmp0_;
	gconstpointer _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = g_object_get_data ((GObject*) _tmp0_, "location_is_msgwin");
	if (GPOINTER_TO_INT (_tmp1_)) {
		GtkMenuItem* _tmp2_;
		GtkMenuItem* _tmp3_;
		_tmp2_ = item;
		gtk_menu_item_set_label (_tmp2_, "Move to message window");
		_tmp3_ = item;
		g_object_set_data_full ((GObject*) _tmp3_, "location_is_msgwin", GINT_TO_POINTER (FALSE), NULL);
		g_signal_emit_by_name (self, "move-to-location-activate", "sidebar");
	} else {
		GtkMenuItem* _tmp4_;
		GtkMenuItem* _tmp5_;
		_tmp4_ = item;
		gtk_menu_item_set_label (_tmp4_, "Move to sidebar");
		_tmp5_ = item;
		g_object_set_data_full ((GObject*) _tmp5_, "location_is_msgwin", GINT_TO_POINTER (TRUE), NULL);
		g_signal_emit_by_name (self, "move-to-location-activate", "msgwin");
	}
}


static void multi_term_context_menu_add_separator (MultiTermContextMenu* self) {
	GtkSeparatorMenuItem* _tmp0_;
	GtkSeparatorMenuItem* _tmp1_;
	GtkSeparatorMenuItem* item;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
	_tmp1_ = g_object_ref_sink (_tmp0_);
	item = _tmp1_;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) ((GtkMenuItem*) item));
	gtk_widget_show ((GtkWidget*) item);
	_g_object_unref0 (item);
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		MultiTermContextMenu * self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->check_item);
		_g_object_unref0 (_data1_->item);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		MultiTermContextMenu * self;
		self = _data2_->_data1_->self;
		_multi_term_shell_config_unref0 (_data2_->sh);
		block1_data_unref (_data2_->_data1_);
		_data2_->_data1_ = NULL;
		g_slice_free (Block2Data, _data2_);
	}
}


static gpointer _multi_term_shell_config_ref0 (gpointer self) {
	return self ? multi_term_shell_config_ref (self) : NULL;
}


static void _____lambda3_ (Block2Data* _data2_) {
	Block1Data* _data1_;
	MultiTermContextMenu * self;
	MultiTermShellConfig* _tmp0_;
	_data1_ = _data2_->_data1_;
	self = _data1_->self;
	_tmp0_ = _data2_->sh;
	g_signal_emit_by_name (self, "new-shell-activate", _tmp0_);
}


static void ______lambda3__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	_____lambda3_ (self);
}


static void __lambda4_ (MultiTermContextMenu* self) {
	g_signal_emit_by_name (self, "new-window-activate");
}


static void ___lambda4__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda4_ (self);
}


static void __lambda5_ (Block1Data* _data1_) {
	MultiTermContextMenu * self;
	GtkMenuItem* _tmp0_;
	self = _data1_->self;
	_tmp0_ = _data1_->item;
	multi_term_context_menu_on_next_previous_tab_activate (self, _tmp0_, TRUE);
}


static void ___lambda5__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda5_ (self);
}


static void __lambda6_ (Block1Data* _data1_) {
	MultiTermContextMenu * self;
	GtkMenuItem* _tmp0_;
	self = _data1_->self;
	_tmp0_ = _data1_->item;
	multi_term_context_menu_on_next_previous_tab_activate (self, _tmp0_, FALSE);
}


static void ___lambda6__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda6_ (self);
}


static void __lambda7_ (MultiTermContextMenu* self) {
	g_signal_emit_by_name (self, "copy-activate");
}


static void ___lambda7__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda7_ (self);
}


static void __lambda8_ (MultiTermContextMenu* self) {
	g_signal_emit_by_name (self, "paste-activate");
}


static void ___lambda8__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda8_ (self);
}


static void __lambda9_ (Block1Data* _data1_) {
	MultiTermContextMenu * self;
	GtkCheckMenuItem* _tmp0_;
	self = _data1_->self;
	_tmp0_ = _data1_->check_item;
	multi_term_context_menu_on_show_tabs_activate (self, _tmp0_);
}


static void ___lambda9__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda9_ (self);
}


static void __lambda10_ (Block1Data* _data1_) {
	MultiTermContextMenu * self;
	GtkMenuItem* _tmp0_;
	self = _data1_->self;
	_tmp0_ = _data1_->item;
	multi_term_context_menu_on_move_to_location (self, _tmp0_);
}


static void ___lambda10__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda10_ (self);
}


static void __lambda11_ (MultiTermContextMenu* self) {
	g_signal_emit_by_name (self, "preferences-activate");
}


static void ___lambda11__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda11_ (self);
}


MultiTermContextMenu* multi_term_context_menu_construct (GType object_type, MultiTermConfig* cfg) {
	MultiTermContextMenu * self = NULL;
	Block1Data* _data1_;
	GtkMenu* menu = NULL;
	GtkImageMenuItem* image_item = NULL;
	GtkMenu* _tmp0_;
	GtkMenu* _tmp1_;
	GtkMenu* _tmp2_;
	GtkMenuItem* _tmp3_;
	GtkMenuItem* _tmp4_;
	GtkMenuItem* _tmp5_;
	GtkMenu* _tmp6_;
	GtkMenuItem* _tmp7_;
	GtkMenuItem* _tmp8_;
	MultiTermConfig* _tmp9_;
	GList* _tmp10_;
	GList* _tmp11_;
	guint _tmp12_ = 0U;
	guint len;
	GtkMenuItem* _tmp34_;
	GtkMenuItem* _tmp35_;
	GtkMenuItem* _tmp36_;
	GtkMenuItem* _tmp37_;
	GtkMenuItem* _tmp38_;
	GtkMenuItem* _tmp39_;
	GtkMenuItem* _tmp40_;
	GtkMenuItem* _tmp41_;
	GtkMenuItem* _tmp42_;
	GtkMenuItem* _tmp43_;
	GtkMenuItem* _tmp44_;
	GtkImageMenuItem* _tmp45_;
	GtkImageMenuItem* _tmp46_;
	GtkImageMenuItem* _tmp47_;
	GtkImageMenuItem* _tmp48_;
	GtkImageMenuItem* _tmp49_;
	GtkImageMenuItem* _tmp50_;
	GtkCheckMenuItem* _tmp51_;
	GtkCheckMenuItem* _tmp52_;
	GtkCheckMenuItem* _tmp53_;
	MultiTermConfig* _tmp54_;
	gboolean _tmp55_;
	gboolean _tmp56_;
	GtkCheckMenuItem* _tmp57_;
	GtkCheckMenuItem* _tmp58_;
	GtkCheckMenuItem* _tmp59_;
	MultiTermConfig* _tmp60_;
	gchar* _tmp61_;
	gchar* _tmp62_;
	gchar* _tmp63_;
	gboolean _tmp64_;
	GtkMenuItem* _tmp71_;
	GtkMenuItem* _tmp72_;
	GtkMenuItem* _tmp73_;
	GtkImageMenuItem* _tmp74_;
	GtkImageMenuItem* _tmp75_;
	GtkImageMenuItem* _tmp76_;
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	self = (MultiTermContextMenu*) g_object_new (object_type, NULL);
	_data1_->self = g_object_ref (self);
	_tmp0_ = (GtkMenu*) gtk_menu_new ();
	_tmp1_ = g_object_ref_sink (_tmp0_);
	_g_object_unref0 (menu);
	menu = _tmp1_;
	_tmp2_ = menu;
	gtk_widget_show ((GtkWidget*) _tmp2_);
	_tmp3_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Open Tab");
	_tmp4_ = g_object_ref_sink (_tmp3_);
	_g_object_unref0 (_data1_->item);
	_data1_->item = _tmp4_;
	_tmp5_ = _data1_->item;
	_tmp6_ = menu;
	gtk_menu_item_set_submenu (_tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = _data1_->item;
	gtk_widget_show ((GtkWidget*) _tmp7_);
	_tmp8_ = _data1_->item;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) _tmp8_);
	_tmp9_ = cfg;
	_tmp10_ = multi_term_config_get_shell_configs (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_list_length (_tmp11_);
	len = _tmp12_;
	{
		guint i;
		i = (guint) 0;
		{
			gboolean _tmp13_;
			_tmp13_ = TRUE;
			while (TRUE) {
				Block2Data* _data2_;
				gboolean _tmp14_;
				guint _tmp16_;
				guint _tmp17_;
				MultiTermConfig* _tmp18_;
				GList* _tmp19_;
				GList* _tmp20_;
				guint _tmp21_;
				gconstpointer _tmp22_ = NULL;
				MultiTermShellConfig* _tmp23_;
				MultiTermShellConfig* _tmp24_;
				gchar* _tmp25_;
				gchar* _tmp26_;
				gchar* _tmp27_;
				GtkMenuItem* _tmp28_;
				GtkMenuItem* _tmp29_;
				GtkMenuItem* _tmp30_;
				GtkMenu* _tmp31_;
				GtkMenuItem* _tmp32_;
				GtkMenuItem* _tmp33_;
				_data2_ = g_slice_new0 (Block2Data);
				_data2_->_ref_count_ = 1;
				_data2_->_data1_ = block1_data_ref (_data1_);
				_tmp14_ = _tmp13_;
				if (!_tmp14_) {
					guint _tmp15_;
					_tmp15_ = i;
					i = _tmp15_ + 1;
				}
				_tmp13_ = FALSE;
				_tmp16_ = i;
				_tmp17_ = len;
				if (!(_tmp16_ < _tmp17_)) {
					block2_data_unref (_data2_);
					_data2_ = NULL;
					break;
				}
				_tmp18_ = cfg;
				_tmp19_ = multi_term_config_get_shell_configs (_tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = i;
				_tmp22_ = g_list_nth_data (_tmp20_, _tmp21_);
				_tmp23_ = _multi_term_shell_config_ref0 ((MultiTermShellConfig*) _tmp22_);
				_data2_->sh = _tmp23_;
				_tmp24_ = _data2_->sh;
				_tmp25_ = multi_term_shell_config_get_name (_tmp24_);
				_tmp26_ = _tmp25_;
				_tmp27_ = _tmp26_;
				_tmp28_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp27_);
				_tmp29_ = g_object_ref_sink (_tmp28_);
				_g_object_unref0 (_data1_->item);
				_data1_->item = _tmp29_;
				_g_free0 (_tmp27_);
				_tmp30_ = _data1_->item;
				g_signal_connect_data (_tmp30_, "activate", (GCallback) ______lambda3__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
				_tmp31_ = menu;
				_tmp32_ = _data1_->item;
				gtk_menu_shell_append ((GtkMenuShell*) _tmp31_, (GtkWidget*) _tmp32_);
				_tmp33_ = _data1_->item;
				gtk_widget_show ((GtkWidget*) _tmp33_);
				block2_data_unref (_data2_);
				_data2_ = NULL;
			}
		}
	}
	_tmp34_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Open Window");
	_tmp35_ = g_object_ref_sink (_tmp34_);
	_g_object_unref0 (_data1_->item);
	_data1_->item = _tmp35_;
	_tmp36_ = _data1_->item;
	g_signal_connect_object (_tmp36_, "activate", (GCallback) ___lambda4__gtk_menu_item_activate, self, 0);
	_tmp37_ = _data1_->item;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) _tmp37_);
	_tmp38_ = _data1_->item;
	gtk_widget_show ((GtkWidget*) _tmp38_);
	multi_term_context_menu_add_separator (self);
	_tmp39_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Next tab");
	_tmp40_ = g_object_ref_sink (_tmp39_);
	_g_object_unref0 (_data1_->item);
	_data1_->item = _tmp40_;
	_tmp41_ = _data1_->item;
	g_signal_connect_data (_tmp41_, "activate", (GCallback) ___lambda5__gtk_menu_item_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp42_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Previous tab");
	_tmp43_ = g_object_ref_sink (_tmp42_);
	_g_object_unref0 (_data1_->item);
	_data1_->item = _tmp43_;
	_tmp44_ = _data1_->item;
	g_signal_connect_data (_tmp44_, "activate", (GCallback) ___lambda6__gtk_menu_item_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp45_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock (GTK_STOCK_COPY, NULL);
	_tmp46_ = g_object_ref_sink (_tmp45_);
	_g_object_unref0 (image_item);
	image_item = _tmp46_;
	_tmp47_ = image_item;
	g_signal_connect_object ((GtkMenuItem*) _tmp47_, "activate", (GCallback) ___lambda7__gtk_menu_item_activate, self, 0);
	_tmp48_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock (GTK_STOCK_PASTE, NULL);
	_tmp49_ = g_object_ref_sink (_tmp48_);
	_g_object_unref0 (image_item);
	image_item = _tmp49_;
	_tmp50_ = image_item;
	g_signal_connect_object ((GtkMenuItem*) _tmp50_, "activate", (GCallback) ___lambda8__gtk_menu_item_activate, self, 0);
	_tmp51_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label ("Show Tabs");
	_tmp52_ = g_object_ref_sink (_tmp51_);
	_g_object_unref0 (_data1_->check_item);
	_data1_->check_item = _tmp52_;
	_tmp53_ = _data1_->check_item;
	_tmp54_ = cfg;
	_tmp55_ = multi_term_config_get_show_tabs (_tmp54_);
	_tmp56_ = _tmp55_;
	gtk_check_menu_item_set_active (_tmp53_, _tmp56_);
	_tmp57_ = _data1_->check_item;
	g_signal_connect_data ((GtkMenuItem*) _tmp57_, "activate", (GCallback) ___lambda9__gtk_menu_item_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp58_ = _data1_->check_item;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) ((GtkMenuItem*) _tmp58_));
	_tmp59_ = _data1_->check_item;
	gtk_widget_show ((GtkWidget*) _tmp59_);
	_tmp60_ = cfg;
	_tmp61_ = multi_term_config_get_location (_tmp60_);
	_tmp62_ = _tmp61_;
	_tmp63_ = _tmp62_;
	_tmp64_ = g_strcmp0 (_tmp63_, "msgwin") == 0;
	_g_free0 (_tmp63_);
	if (_tmp64_) {
		GtkMenuItem* _tmp65_;
		GtkMenuItem* _tmp66_;
		GtkMenuItem* _tmp67_;
		_tmp65_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Move to sidebar");
		_tmp66_ = g_object_ref_sink (_tmp65_);
		_g_object_unref0 (_data1_->item);
		_data1_->item = _tmp66_;
		_tmp67_ = _data1_->item;
		g_object_set_data_full ((GObject*) _tmp67_, "location_is_msgwin", GINT_TO_POINTER (TRUE), NULL);
	} else {
		GtkMenuItem* _tmp68_;
		GtkMenuItem* _tmp69_;
		GtkMenuItem* _tmp70_;
		_tmp68_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Move to message window");
		_tmp69_ = g_object_ref_sink (_tmp68_);
		_g_object_unref0 (_data1_->item);
		_data1_->item = _tmp69_;
		_tmp70_ = _data1_->item;
		g_object_set_data_full ((GObject*) _tmp70_, "location_is_msgwin", GINT_TO_POINTER (FALSE), NULL);
	}
	_tmp71_ = _data1_->item;
	g_signal_connect_data (_tmp71_, "activate", (GCallback) ___lambda10__gtk_menu_item_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp72_ = _data1_->item;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) _tmp72_);
	_tmp73_ = _data1_->item;
	gtk_widget_show ((GtkWidget*) _tmp73_);
	_tmp74_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock (GTK_STOCK_PREFERENCES, NULL);
	_tmp75_ = g_object_ref_sink (_tmp74_);
	_g_object_unref0 (image_item);
	image_item = _tmp75_;
	_tmp76_ = image_item;
	g_signal_connect_object ((GtkMenuItem*) _tmp76_, "activate", (GCallback) ___lambda11__gtk_menu_item_activate, self, 0);
	_g_object_unref0 (image_item);
	_g_object_unref0 (menu);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return self;
}


MultiTermContextMenu* multi_term_context_menu_new (MultiTermConfig* cfg) {
	return multi_term_context_menu_construct (MULTI_TERM_TYPE_CONTEXT_MENU, cfg);
}


static void g_cclosure_user_marshal_VOID__MULTI_TERM_SHELL_CONFIG (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__MULTI_TERM_SHELL_CONFIG) (gpointer data1, gpointer arg_1, gpointer data2);
	register GMarshalFunc_VOID__MULTI_TERM_SHELL_CONFIG callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 2);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__MULTI_TERM_SHELL_CONFIG) (marshal_data ? marshal_data : cc->callback);
	callback (data1, multi_term_value_get_shell_config (param_values + 1), data2);
}


static void g_cclosure_user_marshal_BOOLEAN__VOID (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef gboolean (*GMarshalFunc_BOOLEAN__VOID) (gpointer data1, gpointer data2);
	register GMarshalFunc_BOOLEAN__VOID callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	gboolean v_return;
	cc = (GCClosure *) closure;
	g_return_if_fail (return_value != NULL);
	g_return_if_fail (n_param_values == 1);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_BOOLEAN__VOID) (marshal_data ? marshal_data : cc->callback);
	v_return = callback (data1, data2);
	g_value_set_boolean (return_value, v_return);
}


static void multi_term_context_menu_class_init (MultiTermContextMenuClass * klass) {
	multi_term_context_menu_parent_class = g_type_class_peek_parent (klass);
	g_signal_new ("new_shell_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__MULTI_TERM_SHELL_CONFIG, G_TYPE_NONE, 1, MULTI_TERM_TYPE_SHELL_CONFIG);
	g_signal_new ("new_window_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("copy_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("paste_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("show_tabs_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
	g_signal_new ("preferences_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("next_tab_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_BOOLEAN__VOID, G_TYPE_BOOLEAN, 0);
	g_signal_new ("previous_tab_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_BOOLEAN__VOID, G_TYPE_BOOLEAN, 0);
	g_signal_new ("move_to_location_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}


static void multi_term_context_menu_instance_init (MultiTermContextMenu * self) {
}


GType multi_term_context_menu_get_type (void) {
	static volatile gsize multi_term_context_menu_type_id__volatile = 0;
	if (g_once_init_enter (&multi_term_context_menu_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MultiTermContextMenuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) multi_term_context_menu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MultiTermContextMenu), 0, (GInstanceInitFunc) multi_term_context_menu_instance_init, NULL };
		GType multi_term_context_menu_type_id;
		multi_term_context_menu_type_id = g_type_register_static (GTK_TYPE_MENU, "MultiTermContextMenu", &g_define_type_info, 0);
		g_once_init_leave (&multi_term_context_menu_type_id__volatile, multi_term_context_menu_type_id);
	}
	return multi_term_context_menu_type_id__volatile;
}



