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

/*
 * plugin.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 <geanyplugin.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gstdio.h>


#define MULTI_TERM_TYPE_NOTEBOOK (multi_term_notebook_get_type ())
#define MULTI_TERM_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MULTI_TERM_TYPE_NOTEBOOK, MultiTermNotebook))
#define MULTI_TERM_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MULTI_TERM_TYPE_NOTEBOOK, MultiTermNotebookClass))
#define MULTI_TERM_IS_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MULTI_TERM_TYPE_NOTEBOOK))
#define MULTI_TERM_IS_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MULTI_TERM_TYPE_NOTEBOOK))
#define MULTI_TERM_NOTEBOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MULTI_TERM_TYPE_NOTEBOOK, MultiTermNotebookClass))

typedef struct _MultiTermNotebook MultiTermNotebook;
typedef struct _MultiTermNotebookClass MultiTermNotebookClass;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#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)))
typedef struct _MultiTermNotebookPrivate MultiTermNotebookPrivate;

#define MULTI_TERM_TYPE_CONFIG (multi_term_config_get_type ())
#define MULTI_TERM_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MULTI_TERM_TYPE_CONFIG, MultiTermConfig))
#define MULTI_TERM_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MULTI_TERM_TYPE_CONFIG, MultiTermConfigClass))
#define MULTI_TERM_IS_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MULTI_TERM_TYPE_CONFIG))
#define MULTI_TERM_IS_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MULTI_TERM_TYPE_CONFIG))
#define MULTI_TERM_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MULTI_TERM_TYPE_CONFIG, MultiTermConfigClass))

typedef struct _MultiTermConfig MultiTermConfig;
typedef struct _MultiTermConfigClass MultiTermConfigClass;

struct _MultiTermNotebook {
	GtkNotebook parent_instance;
	MultiTermNotebookPrivate * priv;
	MultiTermConfig* cfg;
};

struct _MultiTermNotebookClass {
	GtkNotebookClass parent_class;
};


extern GeanyPlugin* geany_plugin;
GeanyPlugin* geany_plugin = NULL;
extern GeanyData* geany_data;
GeanyData* geany_data = NULL;
extern GeanyFunctions* geany_functions;
GeanyFunctions* geany_functions = NULL;
extern GList* toplevel_widgets;
GList* toplevel_widgets = NULL;

gint plugin_version_check (gint abi_version);
void plugin_set_info (PluginInfo* info);
void plugin_init (GeanyData* data);
GType multi_term_notebook_get_type (void) G_GNUC_CONST;
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
#define MULTI_TERM_default_config "######################################################################" \
"##\n" \
"# MultiTerm Configuration File                                        " \
" #\n" \
"#=====================================================================" \
"=#\n" \
"#                                                                     " \
" #\n" \
"# You can configure the behaviour of the MultiTerm plugin by adjusting" \
" #\n" \
"# the values in this file.  Lines beginning with a # are considered   " \
" #\n" \
"# comments and are left as is.  Group/section names go in [] and keys " \
" #\n" \
"# and values are separated by an = symbol.  Where more than one value " \
" #\n" \
"# can be supplied, as in a list, separate the values with the ; symbol" \
".#\n" \
"#                                                                     " \
" #\n" \
"# Groups/section names beginning with 'shell=' denote a type of       " \
" #\n" \
"# terminal/shell that can be opened.  The name of the shell follows   " \
" #\n" \
"# the = symbol. Each shell can have it's own specific VTE             " \
" #\n" \
"# configuration and can run it's own child command.  As an example, if" \
" #\n" \
"# you wanted to use the Python interpreter shell instead of the       " \
" #\n" \
"# default shell, specify 'command=python'.                            " \
" #\n" \
"#                                                                     " \
" #\n" \
"# Keys/values commented out or empty values will cause MultiTerm to   " \
" #\n" \
"# use default values.                                                 " \
" #\n" \
"#                                                                     " \
" #\n" \
"######################################################################" \
"##\n" \
"\n" \
"#=====================================================================" \
"==\n" \
"# General Settings\n" \
"#=====================================================================" \
"==\n" \
"[general]\n" \
"\n" \
"# Where to put the multiterm notebook in the Geany user interface\n" \
"# one of: sidebar, msgwin\n" \
"location=msgwin\n" \
"\n" \
"# Make tabs take up as much space as is available\n" \
"full_width_tabs=true\n" \
"\n" \
"# Allow reordering of tabs\n" \
"reorderable_tabs=true\n" \
"\n" \
"# When there is only one tab left in the notebook, hide the tabs area\n" \
"hide_tabs_on_last=true\n" \
"\n" \
"# When launching an external terminal from the MultiTerm context menu," \
"\n" \
"# use this terminal.  Good choices include xterm, gnome-terminal,\n" \
"# xfce4-terminal or konsole.\n" \
"external_terminal=xterm\n" \
"\n" \
"# Save which shells were open when Geany closes and restore their\n" \
"# tabs when it restarts.\n" \
"save_tabs=false\n" \
"\n" \
"# Whether to show tabs or not\n" \
"show_tabs=true\n" \
"\n" \
"bg_color=#ffffff\n" \
"fg_color=#000000\n" \
"font=Monospace 9\n" \
"\n" \
"\n" \
"#=====================================================================" \
"==\n" \
"# Default Shell\n" \
"#=====================================================================" \
"==\n" \
"[shell=default]\n" \
"\n" \
"# This will be the tabs default tab label and won't change unless\n" \
"# track_title is set to true.\n" \
"name=Default Shell\n" \
"\n" \
"# This is the command to fork in the VTE, leave blank for default shel" \
"l\n" \
"command=\n" \
"\n" \
"# Make the tab's label track the VTE title\n" \
"track_title=true\n" \
"\n" \
"# Background color, foreground color and font for the VTE\n" \
"bg_color=#ffffff\n" \
"fg_color=#000000\n" \
"font=Monospace 9\n" \
"\n" \
"# Whether to allow bold fonts in the VTE\n" \
"#allow_bold=true\n" \
"\n" \
"# Whether to beep when the child outputs a bell sequence.\n" \
"#audible_bell=true\n" \
"\n" \
"# Controls whether the cursor blinks or not, one of:\n" \
"#   system (or blank), on, off\n" \
"#cursor_blink_mode=system\n" \
"\n" \
"# Controls the shape of the VTE cursor, one of:\n" \
"#   block, ibeam, underline\n" \
"#cursor_shape=block\n" \
"\n" \
"# Controls how erasing characters is handled, one of:\n" \
"#   auto, ascii_backspace, ascii_delete, delete_sequence, tty\n" \
"#backspace_binding=auto\n" \
"\n" \
"# Whether to hide the mouse pointer on key press if it's in the\n" \
"# terminal window\n" \
"#pointer_autohide=false\n" \
"\n" \
"# Scroll to the prompt at the bottom of the scrollback buffer on key\n" \
"# press\n" \
"#scroll_on_keystroke=true\n" \
"\n" \
"# Scroll to the bottom of the scrollback buffer when the child sends\n" \
"# output\n" \
"#scroll_on_output=false\n" \
"\n" \
"# The number of lines to keep in the scrollback buffer\n" \
"#scrollback_lines=512\n" \
"\n" \
"# Whether the terminal will present a visible bell when the child\n" \
"# sends a bell sequence.  The terminal will clear itself to the\n" \
"# default foreground color and then repaint itself.\n" \
"#visible_bell=false\n" \
"\n" \
"# When the user double-clicks to start selection, the terminal will\n" \
"# extend the selection on word boundaries. It will treat characters\n" \
"# the word-chars characters as parts of words, and all other\n" \
"# characters as word separators. Ranges of characters can be\n" \
"# specified by separating them with a hyphen.\n" \
"word_chars=-A-Za-z0-9,./\\\\?%&#:_\n" \
"\n" \
"\n" \
"#=====================================================================" \
"==\n" \
"# Other Shells\n" \
"#=====================================================================" \
"==\n" \
"\n" \
"# You can define additional shells just like the default shell but\n" \
"# using other commands and/or settings.\n" \
"\n" \
"#[shell=python]\n" \
"#name=Python Shell\n" \
"#command=python\n" \
"#track_title=false\n" \
"\n" \
"#[shell=irb]\n" \
"#name=Ruby Shell\n" \
"#command=irb\n" \
"#track_title=false\n"
MultiTermNotebook* multi_term_notebook_new (const gchar* config_filename);
MultiTermNotebook* multi_term_notebook_construct (GType object_type, const gchar* config_filename);
gpointer multi_term_config_ref (gpointer instance);
void multi_term_config_unref (gpointer instance);
GParamSpec* multi_term_param_spec_config (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void multi_term_value_set_config (GValue* value, gpointer v_object);
void multi_term_value_take_config (GValue* value, gpointer v_object);
gpointer multi_term_value_get_config (const GValue* value);
GType multi_term_config_get_type (void) G_GNUC_CONST;
gchar* multi_term_config_get_location (MultiTermConfig* self);
void plugin_cleanup (void);


static gint geany_vala_plugin_VERSION_CHECK (gint abi_version, gint api_required) {
	gint result = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	_tmp0_ = abi_version;
	_tmp1_ = GEANY_ABI_VERSION;
	if (_tmp0_ != _tmp1_) {
		result = -1;
		return result;
	}
	_tmp2_ = api_required;
	result = _tmp2_;
	return result;
}


gint plugin_version_check (gint abi_version) {
	gint result = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	_tmp0_ = abi_version;
	_tmp1_ = geany_vala_plugin_VERSION_CHECK (_tmp0_, 185);
	result = _tmp1_;
	return result;
}


static void geany_vala_plugin_SET_INFO (PluginInfo* self, const gchar* name, const gchar* description, const gchar* version, const gchar* author) {
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = name;
	self->name = _tmp0_;
	_tmp1_ = description;
	self->description = _tmp1_;
	_tmp2_ = version;
	self->version = _tmp2_;
	_tmp3_ = author;
	self->author = _tmp3_;
}


void plugin_set_info (PluginInfo* info) {
	PluginInfo* _tmp0_ = NULL;
	g_return_if_fail (info != NULL);
	_tmp0_ = info;
	geany_vala_plugin_SET_INFO (_tmp0_, "MultiTerm", "Multi-tabbed virtual terminal emulator.", "0.1", "Matthew Brush <matt@geany.org>");
}


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


static void _g_list_free__g_object_unref0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_list_free (self);
}


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


static GtkNotebook* geany_vala_plugin_main_widgets_get_message_window_notebook (GeanyMainWidgets* self) {
	GtkNotebook* result;
	GtkWidget* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->message_window_notebook;
	result = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GTK_TYPE_NOTEBOOK) ? ((GtkNotebook*) _tmp0_) : NULL;
	return result;
}


static GtkNotebook* geany_vala_plugin_main_widgets_get_sidebar_notebook (GeanyMainWidgets* self) {
	GtkNotebook* result;
	GtkWidget* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->sidebar_notebook;
	result = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GTK_TYPE_NOTEBOOK) ? ((GtkNotebook*) _tmp0_) : NULL;
	return result;
}


void plugin_init (GeanyData* data) {
	gchar* config_file = NULL;
	gchar* config_dir = NULL;
	GtkLabel* label = NULL;
	GtkAlignment* align = NULL;
	MultiTermNotebook* notebook = NULL;
	GeanyPlugin* _tmp0_ = NULL;
	GeanyData* _tmp1_ = NULL;
	GeanyApp* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	GtkAlignment* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	MultiTermNotebook* _tmp15_ = NULL;
	GtkAlignment* _tmp16_ = NULL;
	MultiTermNotebook* _tmp17_ = NULL;
	GtkAlignment* _tmp18_ = NULL;
	GtkAlignment* _tmp19_ = NULL;
	GtkWidget* _tmp20_ = NULL;
	GtkLabel* _tmp21_ = NULL;
	MultiTermNotebook* _tmp22_ = NULL;
	GtkLabel* _tmp23_ = NULL;
	GtkLabel* _tmp24_ = NULL;
	MultiTermNotebook* _tmp25_ = NULL;
	GeanyData* _tmp26_ = NULL;
	GeanyMainWidgets* _tmp27_ = NULL;
	GtkNotebook* _tmp28_ = NULL;
	GtkNotebook* _tmp29_ = NULL;
	GtkNotebook* _tmp30_ = NULL;
	MultiTermNotebook* _tmp31_ = NULL;
	GeanyData* _tmp32_ = NULL;
	GeanyMainWidgets* _tmp33_ = NULL;
	GtkNotebook* _tmp34_ = NULL;
	GtkNotebook* _tmp35_ = NULL;
	GtkNotebook* _tmp36_ = NULL;
	MultiTermNotebook* _tmp37_ = NULL;
	MultiTermConfig* _tmp38_ = NULL;
	gchar* _tmp39_ = NULL;
	gchar* _tmp40_ = NULL;
	gchar* _tmp41_ = NULL;
	gboolean _tmp42_ = FALSE;
	GError * _inner_error_ = NULL;
	g_return_if_fail (data != NULL);
	_tmp0_ = geany_plugin;
	plugin_module_make_resident (_tmp0_);
	__g_list_free__g_object_unref0_0 (toplevel_widgets);
	toplevel_widgets = NULL;
	_tmp1_ = geany_data;
	_tmp2_ = _tmp1_->app;
	_tmp3_ = _tmp2_->configdir;
	_tmp4_ = g_build_filename (_tmp3_, "plugins", "multiterm", NULL);
	_g_free0 (config_dir);
	config_dir = _tmp4_;
	_tmp5_ = config_dir;
	_tmp6_ = g_build_filename (_tmp5_, "multiterm.conf", NULL);
	_g_free0 (config_file);
	config_file = _tmp6_;
	_tmp7_ = config_dir;
	g_mkdir_with_parents (_tmp7_, 0755);
	{
		const gchar* _tmp8_ = NULL;
		gboolean _tmp9_ = FALSE;
		_tmp8_ = config_file;
		_tmp9_ = g_file_test (_tmp8_, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR);
		if (!_tmp9_) {
			const gchar* _tmp10_ = NULL;
			_tmp10_ = config_file;
			g_file_set_contents (_tmp10_, MULTI_TERM_default_config, (gssize) (-1), &_inner_error_);
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				if (_inner_error_->domain == G_FILE_ERROR) {
					goto __catch6_g_file_error;
				}
				_g_object_unref0 (notebook);
				_g_object_unref0 (align);
				_g_object_unref0 (label);
				_g_free0 (config_dir);
				_g_free0 (config_file);
				g_critical ("file %s: line %d: unexpected 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;
			}
		}
	}
	goto __finally6;
	__catch6_g_file_error:
	{
		GError* err = NULL;
		GError* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp11_ = err;
		_tmp12_ = _tmp11_->message;
		g_warning ("plugin.vala:74: Unable to write default config file: %s", _tmp12_);
		_g_error_free0 (err);
	}
	__finally6:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (notebook);
		_g_object_unref0 (align);
		_g_object_unref0 (label);
		_g_free0 (config_dir);
		_g_free0 (config_file);
		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;
	}
	_tmp13_ = (GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, 1.0f, 1.0f);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (align);
	align = _tmp13_;
	_tmp14_ = config_file;
	_tmp15_ = multi_term_notebook_new (_tmp14_);
	g_object_ref_sink (_tmp15_);
	_g_object_unref0 (notebook);
	notebook = _tmp15_;
	_tmp16_ = align;
	_tmp17_ = notebook;
	gtk_container_add ((GtkContainer*) _tmp16_, (GtkWidget*) (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, GTK_TYPE_NOTEBOOK) ? ((GtkNotebook*) _tmp17_) : NULL));
	_tmp18_ = align;
	gtk_widget_show_all ((GtkWidget*) _tmp18_);
	_tmp19_ = align;
	_tmp20_ = _g_object_ref0 ((GtkWidget*) _tmp19_);
	toplevel_widgets = g_list_append (toplevel_widgets, _tmp20_);
	_tmp21_ = (GtkLabel*) gtk_label_new ("MultiTerm");
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (label);
	label = _tmp21_;
	_tmp22_ = notebook;
	_tmp23_ = label;
	_tmp24_ = _g_object_ref0 (_tmp23_);
	g_object_set_data_full ((GObject*) _tmp22_, "label", _tmp24_, g_object_unref);
	_tmp25_ = notebook;
	_tmp26_ = data;
	_tmp27_ = _tmp26_->main_widgets;
	_tmp28_ = geany_vala_plugin_main_widgets_get_message_window_notebook (_tmp27_);
	_tmp29_ = _tmp28_;
	_tmp30_ = _g_object_ref0 (_tmp29_);
	g_object_set_data_full ((GObject*) _tmp25_, "msgwin_notebook", _tmp30_, g_object_unref);
	_tmp31_ = notebook;
	_tmp32_ = data;
	_tmp33_ = _tmp32_->main_widgets;
	_tmp34_ = geany_vala_plugin_main_widgets_get_sidebar_notebook (_tmp33_);
	_tmp35_ = _tmp34_;
	_tmp36_ = _g_object_ref0 (_tmp35_);
	g_object_set_data_full ((GObject*) _tmp31_, "sidebar_notebook", _tmp36_, g_object_unref);
	_tmp37_ = notebook;
	_tmp38_ = _tmp37_->cfg;
	_tmp39_ = multi_term_config_get_location (_tmp38_);
	_tmp40_ = _tmp39_;
	_tmp41_ = _tmp40_;
	_tmp42_ = g_strcmp0 (_tmp41_, "msgwin") == 0;
	_g_free0 (_tmp41_);
	if (_tmp42_) {
		GeanyData* _tmp43_ = NULL;
		GeanyMainWidgets* _tmp44_ = NULL;
		GtkNotebook* _tmp45_ = NULL;
		GtkNotebook* _tmp46_ = NULL;
		GtkAlignment* _tmp47_ = NULL;
		GtkLabel* _tmp48_ = NULL;
		GeanyData* _tmp49_ = NULL;
		GeanyMainWidgets* _tmp50_ = NULL;
		GtkNotebook* _tmp51_ = NULL;
		GtkNotebook* _tmp52_ = NULL;
		GeanyData* _tmp53_ = NULL;
		GeanyMainWidgets* _tmp54_ = NULL;
		GtkNotebook* _tmp55_ = NULL;
		GtkNotebook* _tmp56_ = NULL;
		GtkAlignment* _tmp57_ = NULL;
		gint _tmp58_ = 0;
		_tmp43_ = data;
		_tmp44_ = _tmp43_->main_widgets;
		_tmp45_ = geany_vala_plugin_main_widgets_get_message_window_notebook (_tmp44_);
		_tmp46_ = _tmp45_;
		_tmp47_ = align;
		_tmp48_ = label;
		gtk_notebook_append_page (_tmp46_, (GtkWidget*) _tmp47_, (GtkWidget*) _tmp48_);
		_tmp49_ = data;
		_tmp50_ = _tmp49_->main_widgets;
		_tmp51_ = geany_vala_plugin_main_widgets_get_message_window_notebook (_tmp50_);
		_tmp52_ = _tmp51_;
		_tmp53_ = data;
		_tmp54_ = _tmp53_->main_widgets;
		_tmp55_ = geany_vala_plugin_main_widgets_get_message_window_notebook (_tmp54_);
		_tmp56_ = _tmp55_;
		_tmp57_ = align;
		_tmp58_ = gtk_notebook_page_num (_tmp56_, (GtkWidget*) _tmp57_);
		gtk_notebook_set_current_page (_tmp52_, _tmp58_);
	} else {
		GeanyData* _tmp59_ = NULL;
		GeanyMainWidgets* _tmp60_ = NULL;
		GtkNotebook* _tmp61_ = NULL;
		GtkNotebook* _tmp62_ = NULL;
		GtkAlignment* _tmp63_ = NULL;
		GtkLabel* _tmp64_ = NULL;
		GeanyData* _tmp65_ = NULL;
		GeanyMainWidgets* _tmp66_ = NULL;
		GtkNotebook* _tmp67_ = NULL;
		GtkNotebook* _tmp68_ = NULL;
		GeanyData* _tmp69_ = NULL;
		GeanyMainWidgets* _tmp70_ = NULL;
		GtkNotebook* _tmp71_ = NULL;
		GtkNotebook* _tmp72_ = NULL;
		GtkAlignment* _tmp73_ = NULL;
		gint _tmp74_ = 0;
		_tmp59_ = data;
		_tmp60_ = _tmp59_->main_widgets;
		_tmp61_ = geany_vala_plugin_main_widgets_get_sidebar_notebook (_tmp60_);
		_tmp62_ = _tmp61_;
		_tmp63_ = align;
		_tmp64_ = label;
		gtk_notebook_append_page (_tmp62_, (GtkWidget*) _tmp63_, (GtkWidget*) _tmp64_);
		_tmp65_ = data;
		_tmp66_ = _tmp65_->main_widgets;
		_tmp67_ = geany_vala_plugin_main_widgets_get_sidebar_notebook (_tmp66_);
		_tmp68_ = _tmp67_;
		_tmp69_ = data;
		_tmp70_ = _tmp69_->main_widgets;
		_tmp71_ = geany_vala_plugin_main_widgets_get_sidebar_notebook (_tmp70_);
		_tmp72_ = _tmp71_;
		_tmp73_ = align;
		_tmp74_ = gtk_notebook_page_num (_tmp72_, (GtkWidget*) _tmp73_);
		gtk_notebook_set_current_page (_tmp68_, _tmp74_);
	}
	_g_object_unref0 (notebook);
	_g_object_unref0 (align);
	_g_object_unref0 (label);
	_g_free0 (config_dir);
	_g_free0 (config_file);
}


void plugin_cleanup (void) {
	GList* _tmp0_ = NULL;
	_tmp0_ = toplevel_widgets;
	{
		GList* wid_collection = NULL;
		GList* wid_it = NULL;
		wid_collection = _tmp0_;
		for (wid_it = wid_collection; wid_it != NULL; wid_it = wid_it->next) {
			GtkWidget* _tmp1_ = NULL;
			GtkWidget* wid = NULL;
			_tmp1_ = _g_object_ref0 ((GtkWidget*) wid_it->data);
			wid = _tmp1_;
			{
				GtkWidget* _tmp2_ = NULL;
				_tmp2_ = wid;
				gtk_object_destroy ((GtkObject*) _tmp2_);
				_g_object_unref0 (wid);
			}
		}
	}
	__g_list_free__g_object_unref0_0 (toplevel_widgets);
	toplevel_widgets = NULL;
}



