/* Generated by GOB (v2.0.20)   (do not edit directly) */

/* End world hunger, donate to the World Food Programme, http://www.wfp.org */


#line 3 "common/gtk/scrollable-text-view.gob"

/* Pioneers - Implementation of the excellent Settlers of Catan board game.
 *   Go buy a copy.
 *
 * Copyright (C) 2011 Micah Bunting <Amnykon@gmail.com>
 * Copyright (C) 2011 Roland Clobus <rclobus@rclobus.nl>
 *
 * 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 St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#line 30 "scrollable-text-view.c"
#define GOB_VERSION_MAJOR 2
#define GOB_VERSION_MINOR 0
#define GOB_VERSION_PATCHLEVEL 20

#define selfp (self->_priv)

#include <string.h> /* memset() */

#include "scrollable-text-view.h"

#ifdef G_LIKELY
#define ___GOB_LIKELY(expr) G_LIKELY(expr)
#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
#else /* ! G_LIKELY */
#define ___GOB_LIKELY(expr) (expr)
#define ___GOB_UNLIKELY(expr) (expr)
#endif /* G_LIKELY */

#line 31 "common/gtk/scrollable-text-view.gob"


#line 52 "scrollable-text-view.c"
/* self casting macros */
#define SELF(x) SCROLLABLE_TEXT_VIEW(x)
#define SELF_CONST(x) SCROLLABLE_TEXT_VIEW_CONST(x)
#define IS_SELF(x) SCROLLABLE_IS_TEXT_VIEW(x)
#define TYPE_SELF SCROLLABLE_TYPE_TEXT_VIEW
#define SELF_CLASS(x) SCROLLABLE_TEXT_VIEW_CLASS(x)

#define SELF_GET_CLASS(x) SCROLLABLE_TEXT_VIEW_GET_CLASS(x)

/* self typedefs */
typedef ScrollableTextView Self;
typedef ScrollableTextViewClass SelfClass;

/* here are local prototypes */
static void scrollable_text_view_class_init (ScrollableTextViewClass * c) G_GNUC_UNUSED;
#line 39 "common/gtk/scrollable-text-view.gob"
static void scrollable_text_view_init (ScrollableTextView * self) G_GNUC_UNUSED;
#line 70 "scrollable-text-view.c"

/* pointer to the class of our parent */
static GtkScrolledWindowClass *parent_class = NULL;

/* Short form macros */
#define self_new scrollable_text_view_new
#define self_set_text scrollable_text_view_set_text
#define self_get_text scrollable_text_view_get_text
#define self_get_for_mnemonic scrollable_text_view_get_for_mnemonic
GType
scrollable_text_view_get_type (void)
{
	static GType type = 0;

	if ___GOB_UNLIKELY(type == 0) {
		static const GTypeInfo info = {
			sizeof (ScrollableTextViewClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) scrollable_text_view_class_init,
			(GClassFinalizeFunc) NULL,
			NULL /* class_data */,
			sizeof (ScrollableTextView),
			0 /* n_preallocs */,
			(GInstanceInitFunc) scrollable_text_view_init,
			NULL
		};

		type = g_type_register_static (GTK_TYPE_SCROLLED_WINDOW, "ScrollableTextView", &info, (GTypeFlags)0);
	}

	return type;
}

/* a macro for creating a new object of our type */
#define GET_NEW ((ScrollableTextView *)g_object_new(scrollable_text_view_get_type(), NULL))

/* a function for creating a new object of our type */
#include <stdarg.h>
static ScrollableTextView * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
static ScrollableTextView *
GET_NEW_VARG (const char *first, ...)
{
	ScrollableTextView *ret;
	va_list ap;
	va_start (ap, first);
	ret = (ScrollableTextView *)g_object_new_valist (scrollable_text_view_get_type (), first, ap);
	va_end (ap);
	return ret;
}

static void 
scrollable_text_view_class_init (ScrollableTextViewClass * c G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "Scrollable:Text:View::class_init"

	parent_class = g_type_class_ref (GTK_TYPE_SCROLLED_WINDOW);

}
#undef __GOB_FUNCTION__
#line 39 "common/gtk/scrollable-text-view.gob"
static void 
scrollable_text_view_init (ScrollableTextView * self G_GNUC_UNUSED)
{
#line 135 "scrollable-text-view.c"
#define __GOB_FUNCTION__ "Scrollable:Text:View::init"
 {
#line 39 "common/gtk/scrollable-text-view.gob"

		GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(self);
		GtkWidget *text_view;

		gtk_scrolled_window_set_hadjustment(sw, NULL);
		gtk_scrolled_window_set_vadjustment(sw, NULL);
		gtk_scrolled_window_set_policy(sw, GTK_POLICY_AUTOMATIC,
					       GTK_POLICY_AUTOMATIC);

		text_view = gtk_text_view_new();
		gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text_view),
					    FALSE);
		gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text_view),
						 TRUE);
		gtk_text_view_set_accepts_tab(GTK_TEXT_VIEW(text_view),
					      FALSE);

		gtk_container_add(GTK_CONTAINER(self), text_view);
	
#line 158 "scrollable-text-view.c"
 }
}
#undef __GOB_FUNCTION__


#line 36 "common/gtk/scrollable-text-view.gob"
GtkWidget * 
scrollable_text_view_new (void)
{
#line 168 "scrollable-text-view.c"
#define __GOB_FUNCTION__ "Scrollable:Text:View::new"
{
#line 36 "common/gtk/scrollable-text-view.gob"
	
		return (GtkWidget *) GET_NEW;
	}}
#line 175 "scrollable-text-view.c"
#undef __GOB_FUNCTION__


#line 59 "common/gtk/scrollable-text-view.gob"
void 
scrollable_text_view_set_text (ScrollableTextView * self, const gchar * text)
{
#line 183 "scrollable-text-view.c"
#define __GOB_FUNCTION__ "Scrollable:Text:View::set_text"
#line 59 "common/gtk/scrollable-text-view.gob"
	g_return_if_fail (self != NULL);
#line 59 "common/gtk/scrollable-text-view.gob"
	g_return_if_fail (SCROLLABLE_IS_TEXT_VIEW (self));
#line 189 "scrollable-text-view.c"
{
#line 59 "common/gtk/scrollable-text-view.gob"
	
		GtkTextBuffer *buffer;
		GtkTextIter start;
		GtkTextIter end;

		buffer =
		    gtk_text_view_get_buffer(GTK_TEXT_VIEW
					     (gtk_bin_get_child
					      (GTK_BIN(self))));
		gtk_text_buffer_get_bounds(buffer, &start, &end);
		gtk_text_buffer_set_text(buffer, text ? text : "", -1);
		gtk_text_buffer_get_bounds(buffer, &start, &end);
		gtk_text_buffer_place_cursor(buffer, &start);
	}}
#line 206 "scrollable-text-view.c"
#undef __GOB_FUNCTION__

#line 74 "common/gtk/scrollable-text-view.gob"
gchar * 
scrollable_text_view_get_text (ScrollableTextView * self)
{
#line 213 "scrollable-text-view.c"
#define __GOB_FUNCTION__ "Scrollable:Text:View::get_text"
#line 74 "common/gtk/scrollable-text-view.gob"
	g_return_val_if_fail (self != NULL, (gchar * )0);
#line 74 "common/gtk/scrollable-text-view.gob"
	g_return_val_if_fail (SCROLLABLE_IS_TEXT_VIEW (self), (gchar * )0);
#line 219 "scrollable-text-view.c"
{
#line 74 "common/gtk/scrollable-text-view.gob"
	
		GtkTextBuffer *buffer;
		GtkTextIter start;
		GtkTextIter end;

		buffer =
		    gtk_text_view_get_buffer(GTK_TEXT_VIEW
					     (gtk_bin_get_child
					      (GTK_BIN(self))));
		gtk_text_buffer_get_bounds(buffer, &start, &end);
		return gtk_text_buffer_get_text(buffer, &start, &end,
						FALSE);
	}}
#line 235 "scrollable-text-view.c"
#undef __GOB_FUNCTION__

#line 88 "common/gtk/scrollable-text-view.gob"
GtkWidget * 
scrollable_text_view_get_for_mnemonic (ScrollableTextView * self)
{
#line 242 "scrollable-text-view.c"
#define __GOB_FUNCTION__ "Scrollable:Text:View::get_for_mnemonic"
#line 88 "common/gtk/scrollable-text-view.gob"
	g_return_val_if_fail (self != NULL, (GtkWidget * )0);
#line 88 "common/gtk/scrollable-text-view.gob"
	g_return_val_if_fail (SCROLLABLE_IS_TEXT_VIEW (self), (GtkWidget * )0);
#line 248 "scrollable-text-view.c"
{
#line 88 "common/gtk/scrollable-text-view.gob"
	
		return gtk_bin_get_child(GTK_BIN(self));
	}}
#line 254 "scrollable-text-view.c"
#undef __GOB_FUNCTION__
