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

/*
 * This file is part of GNOME LaTeX.
 *
 * Copyright © 2012 Sébastien Wilmet
 *
 * GNOME LaTeX 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.
 *
 * GNOME LaTeX 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 GNOME LaTeX.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Author: Sébastien Wilmet
 */


#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <latexila.h>
#include <glib/gi18n-lib.h>


#define TYPE_BOTTOM_PANEL (bottom_panel_get_type ())
#define BOTTOM_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BOTTOM_PANEL, BottomPanel))
#define BOTTOM_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BOTTOM_PANEL, BottomPanelClass))
#define IS_BOTTOM_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BOTTOM_PANEL))
#define IS_BOTTOM_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BOTTOM_PANEL))
#define BOTTOM_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BOTTOM_PANEL, BottomPanelClass))

typedef struct _BottomPanel BottomPanel;
typedef struct _BottomPanelClass BottomPanelClass;
typedef struct _BottomPanelPrivate BottomPanelPrivate;
enum  {
	BOTTOM_PANEL_0_PROPERTY,
	BOTTOM_PANEL_NUM_PROPERTIES
};
static GParamSpec* bottom_panel_properties[BOTTOM_PANEL_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BottomPanel {
	GtkGrid parent_instance;
	BottomPanelPrivate * priv;
};

struct _BottomPanelClass {
	GtkGridClass parent_class;
};


static gpointer bottom_panel_parent_class = NULL;

GType bottom_panel_get_type (void) G_GNUC_CONST;
BottomPanel* bottom_panel_new (LatexilaBuildView* build_view,
                               GtkToolbar* toolbar);
BottomPanel* bottom_panel_construct (GType object_type,
                                     LatexilaBuildView* build_view,
                                     GtkToolbar* toolbar);
GtkScrolledWindow* utils_add_scrollbar (GtkWidget* child);
static GtkButton* bottom_panel_get_close_button (BottomPanel* self);
static void __lambda26_ (BottomPanel* self);
static void ___lambda26__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);


BottomPanel*
bottom_panel_construct (GType object_type,
                        LatexilaBuildView* build_view,
                        GtkToolbar* toolbar)
{
	BottomPanel * self = NULL;
	GtkScrolledWindow* scrolled_window = NULL;
	GtkScrolledWindow* _tmp0_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp1_;
	GtkButton* _tmp2_;
	GtkButton* _tmp3_;
#line 26 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	g_return_val_if_fail (build_view != NULL, NULL);
#line 26 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	g_return_val_if_fail (toolbar != NULL, NULL);
#line 26 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	self = (BottomPanel*) g_object_new (object_type, NULL);
#line 28 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_HORIZONTAL);
#line 30 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_tmp0_ = utils_add_scrollbar ((GtkWidget*) build_view);
#line 30 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	scrolled_window = _tmp0_;
#line 32 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	g_object_set ((GtkWidget*) scrolled_window, "expand", TRUE, NULL);
#line 33 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_widget_show_all ((GtkWidget*) scrolled_window);
#line 34 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_scrolled_window_set_shadow_type (scrolled_window, GTK_SHADOW_IN);
#line 35 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) scrolled_window);
#line 37 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_tmp1_ = (GtkGrid*) gtk_grid_new ();
#line 37 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	g_object_ref_sink (_tmp1_);
#line 37 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	grid = _tmp1_;
#line 38 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_orientable_set_orientation ((GtkOrientable*) grid, GTK_ORIENTATION_VERTICAL);
#line 39 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_tmp2_ = bottom_panel_get_close_button (self);
#line 39 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_tmp3_ = _tmp2_;
#line 39 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_container_add ((GtkContainer*) grid, (GtkWidget*) _tmp3_);
#line 39 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_g_object_unref0 (_tmp3_);
#line 41 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_widget_set_vexpand ((GtkWidget*) toolbar, TRUE);
#line 42 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_container_add ((GtkContainer*) grid, (GtkWidget*) toolbar);
#line 44 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_widget_show_all ((GtkWidget*) grid);
#line 45 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) grid);
#line 26 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_g_object_unref0 (grid);
#line 26 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_g_object_unref0 (scrolled_window);
#line 26 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	return self;
#line 138 "bottom_panel.c"
}


BottomPanel*
bottom_panel_new (LatexilaBuildView* build_view,
                  GtkToolbar* toolbar)
{
#line 26 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	return bottom_panel_construct (TYPE_BOTTOM_PANEL, build_view, toolbar);
#line 148 "bottom_panel.c"
}


static void
__lambda26_ (BottomPanel* self)
{
#line 55 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_widget_hide ((GtkWidget*) self);
#line 157 "bottom_panel.c"
}


static void
___lambda26__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
#line 55 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	__lambda26_ ((BottomPanel*) self);
#line 167 "bottom_panel.c"
}


static GtkButton*
bottom_panel_get_close_button (BottomPanel* self)
{
	GtkButton* result = NULL;
	GtkButton* close_button = NULL;
	GtkButton* _tmp0_;
	GtkImage* _tmp1_;
	GtkImage* _tmp2_;
#line 48 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 50 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_tmp0_ = (GtkButton*) gtk_button_new ();
#line 50 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	g_object_ref_sink (_tmp0_);
#line 50 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	close_button = _tmp0_;
#line 51 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_button_set_relief (close_button, GTK_RELIEF_NONE);
#line 52 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_widget_set_focus_on_click ((GtkWidget*) close_button, FALSE);
#line 53 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) close_button, _ ("Hide panel"));
#line 54 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name ("window-close", (GtkIconSize) GTK_ICON_SIZE_MENU);
#line 54 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	g_object_ref_sink (_tmp1_);
#line 54 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_tmp2_ = _tmp1_;
#line 54 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	gtk_container_add ((GtkContainer*) close_button, (GtkWidget*) _tmp2_);
#line 54 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	_g_object_unref0 (_tmp2_);
#line 55 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	g_signal_connect_object (close_button, "clicked", (GCallback) ___lambda26__gtk_button_clicked, self, 0);
#line 57 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	result = close_button;
#line 57 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	return result;
#line 209 "bottom_panel.c"
}


static void
bottom_panel_class_init (BottomPanelClass * klass)
{
#line 24 "/home/seb/gnome/gnome-latex/src/bottom_panel.vala"
	bottom_panel_parent_class = g_type_class_peek_parent (klass);
#line 218 "bottom_panel.c"
}


static void
bottom_panel_instance_init (BottomPanel * self)
{
}


GType
bottom_panel_get_type (void)
{
	static volatile gsize bottom_panel_type_id__volatile = 0;
	if (g_once_init_enter (&bottom_panel_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BottomPanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bottom_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BottomPanel), 0, (GInstanceInitFunc) bottom_panel_instance_init, NULL };
		GType bottom_panel_type_id;
		bottom_panel_type_id = g_type_register_static (gtk_grid_get_type (), "BottomPanel", &g_define_type_info, 0);
		g_once_init_leave (&bottom_panel_type_id__volatile, bottom_panel_type_id);
	}
	return bottom_panel_type_id__volatile;
}



