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

/*
 *  Copyright (C) 2009-2010 Michael J. Chudobiak.
 *
 *  This file is part of moserial.
 *
 *  moserial 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.
 *
 *  moserial 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 moserial.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>


#define MOSERIAL_TYPE_HEX_TEXT_BUFFER (moserial_hex_text_buffer_get_type ())
#define MOSERIAL_HEX_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MOSERIAL_TYPE_HEX_TEXT_BUFFER, moserialHexTextBuffer))
#define MOSERIAL_HEX_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOSERIAL_TYPE_HEX_TEXT_BUFFER, moserialHexTextBufferClass))
#define MOSERIAL_IS_HEX_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MOSERIAL_TYPE_HEX_TEXT_BUFFER))
#define MOSERIAL_IS_HEX_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOSERIAL_TYPE_HEX_TEXT_BUFFER))
#define MOSERIAL_HEX_TEXT_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOSERIAL_TYPE_HEX_TEXT_BUFFER, moserialHexTextBufferClass))

typedef struct _moserialHexTextBuffer moserialHexTextBuffer;
typedef struct _moserialHexTextBufferClass moserialHexTextBufferClass;
typedef struct _moserialHexTextBufferPrivate moserialHexTextBufferPrivate;
enum  {
	MOSERIAL_HEX_TEXT_BUFFER_0_PROPERTY,
	MOSERIAL_HEX_TEXT_BUFFER_NUM_PROPERTIES
};
static GParamSpec* moserial_hex_text_buffer_properties[MOSERIAL_HEX_TEXT_BUFFER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_PREFERENCES (preferences_get_type ())
#define PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PREFERENCES, Preferences))
#define PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PREFERENCES, PreferencesClass))
#define IS_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PREFERENCES))
#define IS_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PREFERENCES))
#define PREFERENCES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PREFERENCES, PreferencesClass))

typedef struct _Preferences Preferences;
typedef struct _PreferencesClass PreferencesClass;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _moserialHexTextBuffer {
	GtkTextBuffer parent_instance;
	moserialHexTextBufferPrivate * priv;
};

struct _moserialHexTextBufferClass {
	GtkTextBufferClass parent_class;
};

struct _moserialHexTextBufferPrivate {
	GtkTextMark* nextHexMark;
	GtkTextMark* nextCharMark;
	GtkTextTag* addressTag;
	gint hexBytes;
};


static gpointer moserial_hex_text_buffer_parent_class = NULL;

GType moserial_hex_text_buffer_get_type (void) G_GNUC_CONST;
#define MOSERIAL_HEX_TEXT_BUFFER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MOSERIAL_TYPE_HEX_TEXT_BUFFER, moserialHexTextBufferPrivate))
GType preferences_get_type (void) G_GNUC_CONST;
void moserial_hex_text_buffer_applyPreferences (moserialHexTextBuffer* self, Preferences* preferences);
const gchar* preferences_get_highlightColor (Preferences* self);
void moserial_hex_text_buffer_clear (moserialHexTextBuffer* self);
static void moserial_hex_text_buffer_setup (moserialHexTextBuffer* self);
void moserial_hex_text_buffer_add (moserialHexTextBuffer* self, guchar data);
moserialHexTextBuffer* moserial_hex_text_buffer_new (void);
moserialHexTextBuffer* moserial_hex_text_buffer_construct (GType object_type);
static GObject * moserial_hex_text_buffer_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void moserial_hex_text_buffer_finalize (GObject * obj);


void moserial_hex_text_buffer_applyPreferences (moserialHexTextBuffer* self, Preferences* preferences) {
	GtkTextTag* _tmp0_;
	Preferences* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (preferences != NULL);
	_tmp0_ = self->priv->addressTag;
	_tmp1_ = preferences;
	_tmp2_ = preferences_get_highlightColor (_tmp1_);
	_tmp3_ = _tmp2_;
	g_object_set (_tmp0_, "foreground", _tmp3_, NULL);
}


void moserial_hex_text_buffer_clear (moserialHexTextBuffer* self) {
	GtkTextMark* _tmp0_;
	GtkTextMark* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->nextHexMark;
	gtk_text_buffer_delete_mark ((GtkTextBuffer*) self, _tmp0_);
	_tmp1_ = self->priv->nextCharMark;
	gtk_text_buffer_delete_mark ((GtkTextBuffer*) self, _tmp1_);
	gtk_text_buffer_set_text ((GtkTextBuffer*) self, "", 0);
	moserial_hex_text_buffer_setup (self);
}


static void moserial_hex_text_buffer_setup (moserialHexTextBuffer* self) {
	GtkTextIter nextHexIter = {0};
	GtkTextIter nextCharIter = {0};
	GtkTextIter _tmp0_ = {0};
	GtkTextMark* _tmp1_;
	GtkTextMark* _tmp2_;
	GtkTextIter _tmp3_;
	GtkTextIter _tmp4_;
	GtkTextMark* _tmp5_;
	GtkTextMark* _tmp6_;
	GtkTextIter _tmp7_;
	g_return_if_fail (self != NULL);
	gtk_text_buffer_get_end_iter ((GtkTextBuffer*) self, &_tmp0_);
	nextHexIter = _tmp0_;
	_tmp1_ = gtk_text_mark_new ("nextHex", TRUE);
	_g_object_unref0 (self->priv->nextHexMark);
	self->priv->nextHexMark = _tmp1_;
	_tmp2_ = self->priv->nextHexMark;
	_tmp3_ = nextHexIter;
	gtk_text_buffer_add_mark ((GtkTextBuffer*) self, _tmp2_, &_tmp3_);
	_tmp4_ = nextHexIter;
	nextCharIter = _tmp4_;
	_tmp5_ = gtk_text_mark_new ("nextChar", TRUE);
	_g_object_unref0 (self->priv->nextCharMark);
	self->priv->nextCharMark = _tmp5_;
	_tmp6_ = self->priv->nextCharMark;
	_tmp7_ = nextCharIter;
	gtk_text_buffer_add_mark ((GtkTextBuffer*) self, _tmp6_, &_tmp7_);
	self->priv->hexBytes = 0;
}


static gunichar string_get_char (const gchar* self, glong index) {
	gunichar result = 0U;
	glong _tmp0_;
	gunichar _tmp1_;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = index;
	_tmp1_ = g_utf8_get_char (((gchar*) self) + _tmp0_);
	result = _tmp1_;
	return result;
}


void moserial_hex_text_buffer_add (moserialHexTextBuffer* self, guchar data) {
	GtkTextIter nextHexIter = {0};
	GtkTextIter nextCharIter = {0};
	gchar* incomingHexBuffer = NULL;
	gchar* _tmp0_;
	gint _tmp1_;
	GtkTextMark* _tmp37_;
	GtkTextIter _tmp38_ = {0};
	const gchar* _tmp39_;
	guchar _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	gint _tmp46_;
	gint _tmp47_;
	GtkTextMark* _tmp48_;
	GtkTextIter _tmp49_ = {0};
	const gchar* _tmp50_;
	gint _tmp51_;
	gint _tmp52_;
	GtkTextMark* _tmp53_;
	GtkTextMark* _tmp54_;
	GtkTextMark* _tmp55_;
	GtkTextIter _tmp56_;
	GtkTextIter tempIter = {0};
	GtkTextIter _tmp57_;
	gchar* _tmp58_;
	gint _tmp59_;
	GtkTextMark* _tmp60_;
	GtkTextIter _tmp61_ = {0};
	gunichar c = 0U;
	guchar _tmp62_;
	gchar* _tmp63_;
	gchar* _tmp64_;
	gunichar _tmp65_;
	gunichar _tmp66_;
	gchar* s = NULL;
	guchar _tmp67_;
	gchar* _tmp68_;
	gboolean _tmp69_ = FALSE;
	const gchar* _tmp70_;
	gboolean _tmp71_;
	GtkTextMark* _tmp85_;
	GtkTextMark* _tmp86_;
	GtkTextMark* _tmp87_;
	GtkTextIter _tmp88_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("");
	incomingHexBuffer = _tmp0_;
	_tmp1_ = self->priv->hexBytes;
	if ((_tmp1_ % 16) == 0) {
		GtkTextIter startIter = {0};
		GtkTextMark* _tmp2_;
		GtkTextIter _tmp3_ = {0};
		GtkTextMark* startMark = NULL;
		GtkTextMark* _tmp4_;
		GtkTextMark* _tmp5_;
		GtkTextIter _tmp6_;
		gint _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		GtkTextIter _tmp10_ = {0};
		GtkTextMark* _tmp11_;
		GtkTextIter _tmp12_ = {0};
		GtkTextIter _tmp13_;
		GtkTextIter _tmp14_;
		GtkTextMark* _tmp15_;
		GtkTextIter _tmp16_ = {0};
		GtkTextMark* _tmp17_;
		GtkTextIter _tmp18_;
		GtkTextMark* _tmp19_;
		GtkTextMark* _tmp20_;
		GtkTextIter _tmp21_;
		GtkTextIter _tmp22_ = {0};
		GtkTextMark* _tmp23_;
		GtkTextMark* _tmp24_;
		GtkTextMark* _tmp25_;
		GtkTextIter _tmp26_;
		_tmp2_ = self->priv->nextCharMark;
		gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp3_, _tmp2_);
		nextCharIter = _tmp3_;
		_tmp4_ = gtk_text_mark_new ("startMark", TRUE);
		startMark = _tmp4_;
		_tmp5_ = startMark;
		_tmp6_ = nextCharIter;
		gtk_text_buffer_add_mark ((GtkTextBuffer*) self, _tmp5_, &_tmp6_);
		_tmp7_ = self->priv->hexBytes;
		_tmp8_ = g_strdup_printf ("\n%08x", (guint) _tmp7_);
		_tmp9_ = _tmp8_;
		gtk_text_buffer_insert ((GtkTextBuffer*) self, &nextCharIter, _tmp9_, 9);
		_g_free0 (_tmp9_);
		gtk_text_buffer_get_end_iter ((GtkTextBuffer*) self, &_tmp10_);
		nextCharIter = _tmp10_;
		_tmp11_ = startMark;
		gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp12_, _tmp11_);
		startIter = _tmp12_;
		_tmp13_ = startIter;
		_tmp14_ = nextCharIter;
		gtk_text_buffer_apply_tag_by_name ((GtkTextBuffer*) self, "hex_address", &_tmp13_, &_tmp14_);
		_tmp15_ = startMark;
		gtk_text_buffer_delete_mark ((GtkTextBuffer*) self, _tmp15_);
		gtk_text_buffer_insert ((GtkTextBuffer*) self, &nextCharIter, " ", 1);
		gtk_text_buffer_get_end_iter ((GtkTextBuffer*) self, &_tmp16_);
		nextCharIter = _tmp16_;
		_tmp17_ = self->priv->nextHexMark;
		gtk_text_buffer_delete_mark ((GtkTextBuffer*) self, _tmp17_);
		_tmp18_ = nextCharIter;
		nextHexIter = _tmp18_;
		_tmp19_ = gtk_text_mark_new ("nextHex", TRUE);
		_g_object_unref0 (self->priv->nextHexMark);
		self->priv->nextHexMark = _tmp19_;
		_tmp20_ = self->priv->nextHexMark;
		_tmp21_ = nextHexIter;
		gtk_text_buffer_add_mark ((GtkTextBuffer*) self, _tmp20_, &_tmp21_);
		gtk_text_buffer_insert ((GtkTextBuffer*) self, &nextCharIter, "                                                   ", 51);
		gtk_text_buffer_get_end_iter ((GtkTextBuffer*) self, &_tmp22_);
		nextCharIter = _tmp22_;
		_tmp23_ = self->priv->nextCharMark;
		gtk_text_buffer_delete_mark ((GtkTextBuffer*) self, _tmp23_);
		_tmp24_ = gtk_text_mark_new ("nextChar", TRUE);
		_g_object_unref0 (self->priv->nextCharMark);
		self->priv->nextCharMark = _tmp24_;
		_tmp25_ = self->priv->nextCharMark;
		_tmp26_ = nextCharIter;
		gtk_text_buffer_add_mark ((GtkTextBuffer*) self, _tmp25_, &_tmp26_);
		_g_object_unref0 (startMark);
	} else {
		gint _tmp27_;
		_tmp27_ = self->priv->hexBytes;
		if ((_tmp27_ % 8) == 0) {
			GtkTextMark* _tmp28_;
			GtkTextIter _tmp29_ = {0};
			GtkTextMark* _tmp30_;
			GtkTextIter _tmp31_ = {0};
			GtkTextMark* _tmp32_;
			GtkTextMark* _tmp33_;
			GtkTextMark* _tmp34_;
			GtkTextIter _tmp35_;
			GtkTextIter tempIter = {0};
			GtkTextIter _tmp36_;
			_tmp28_ = self->priv->nextHexMark;
			gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp29_, _tmp28_);
			nextHexIter = _tmp29_;
			gtk_text_buffer_insert ((GtkTextBuffer*) self, &nextHexIter, "  ", 2);
			_tmp30_ = self->priv->nextHexMark;
			gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp31_, _tmp30_);
			nextHexIter = _tmp31_;
			gtk_text_iter_forward_chars (&nextHexIter, 2);
			_tmp32_ = self->priv->nextHexMark;
			gtk_text_buffer_delete_mark ((GtkTextBuffer*) self, _tmp32_);
			_tmp33_ = gtk_text_mark_new ("nextHex", TRUE);
			_g_object_unref0 (self->priv->nextHexMark);
			self->priv->nextHexMark = _tmp33_;
			_tmp34_ = self->priv->nextHexMark;
			_tmp35_ = nextHexIter;
			gtk_text_buffer_add_mark ((GtkTextBuffer*) self, _tmp34_, &_tmp35_);
			_tmp36_ = nextHexIter;
			tempIter = _tmp36_;
			gtk_text_iter_forward_chars (&tempIter, 2);
			gtk_text_buffer_delete ((GtkTextBuffer*) self, &nextHexIter, &tempIter);
		}
	}
	_tmp37_ = self->priv->nextHexMark;
	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp38_, _tmp37_);
	nextHexIter = _tmp38_;
	_tmp39_ = incomingHexBuffer;
	_tmp40_ = data;
	_tmp41_ = g_strdup_printf ("%02X ", (guint) _tmp40_);
	_tmp42_ = _tmp41_;
	_tmp43_ = g_strconcat (_tmp39_, _tmp42_, NULL);
	_g_free0 (incomingHexBuffer);
	incomingHexBuffer = _tmp43_;
	_g_free0 (_tmp42_);
	_tmp44_ = incomingHexBuffer;
	_tmp45_ = incomingHexBuffer;
	_tmp46_ = strlen (_tmp45_);
	_tmp47_ = _tmp46_;
	gtk_text_buffer_insert ((GtkTextBuffer*) self, &nextHexIter, _tmp44_, (gint) _tmp47_);
	_tmp48_ = self->priv->nextHexMark;
	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp49_, _tmp48_);
	nextHexIter = _tmp49_;
	_tmp50_ = incomingHexBuffer;
	_tmp51_ = strlen (_tmp50_);
	_tmp52_ = _tmp51_;
	gtk_text_iter_forward_chars (&nextHexIter, _tmp52_);
	_tmp53_ = self->priv->nextHexMark;
	gtk_text_buffer_delete_mark ((GtkTextBuffer*) self, _tmp53_);
	_tmp54_ = gtk_text_mark_new ("nextHex", TRUE);
	_g_object_unref0 (self->priv->nextHexMark);
	self->priv->nextHexMark = _tmp54_;
	_tmp55_ = self->priv->nextHexMark;
	_tmp56_ = nextHexIter;
	gtk_text_buffer_add_mark ((GtkTextBuffer*) self, _tmp55_, &_tmp56_);
	_tmp57_ = nextHexIter;
	tempIter = _tmp57_;
	gtk_text_iter_forward_chars (&tempIter, 3);
	gtk_text_buffer_delete ((GtkTextBuffer*) self, &nextHexIter, &tempIter);
	_tmp58_ = g_strdup ("");
	_g_free0 (incomingHexBuffer);
	incomingHexBuffer = _tmp58_;
	_tmp59_ = self->priv->hexBytes;
	self->priv->hexBytes = _tmp59_ + 1;
	_tmp60_ = self->priv->nextCharMark;
	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp61_, _tmp60_);
	nextCharIter = _tmp61_;
	_tmp62_ = data;
	_tmp63_ = g_strdup_printf ("%c", (gint) _tmp62_);
	_tmp64_ = _tmp63_;
	_tmp65_ = string_get_char (_tmp64_, (glong) 0);
	_tmp66_ = _tmp65_;
	_g_free0 (_tmp64_);
	c = _tmp66_;
	_tmp67_ = data;
	_tmp68_ = g_strdup_printf ("%c", (gint) _tmp67_);
	s = _tmp68_;
	_tmp70_ = s;
	_tmp71_ = g_utf8_validate (_tmp70_, (gssize) -1, NULL);
	if (_tmp71_) {
		gunichar _tmp72_;
		gboolean _tmp73_;
		_tmp72_ = c;
		_tmp73_ = g_unichar_isprint (_tmp72_);
		_tmp69_ = _tmp73_;
	} else {
		_tmp69_ = FALSE;
	}
	if (_tmp69_) {
		const gchar* _tmp74_;
		const gchar* _tmp75_;
		gint _tmp76_;
		gint _tmp77_;
		GtkTextMark* _tmp78_;
		GtkTextIter _tmp79_ = {0};
		const gchar* _tmp80_;
		gint _tmp81_;
		gint _tmp82_;
		_tmp74_ = s;
		_tmp75_ = s;
		_tmp76_ = strlen (_tmp75_);
		_tmp77_ = _tmp76_;
		gtk_text_buffer_insert ((GtkTextBuffer*) self, &nextCharIter, _tmp74_, (gint) _tmp77_);
		_tmp78_ = self->priv->nextCharMark;
		gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp79_, _tmp78_);
		nextCharIter = _tmp79_;
		_tmp80_ = s;
		_tmp81_ = strlen (_tmp80_);
		_tmp82_ = _tmp81_;
		gtk_text_iter_forward_chars (&nextCharIter, _tmp82_);
	} else {
		GtkTextMark* _tmp83_;
		GtkTextIter _tmp84_ = {0};
		gtk_text_buffer_insert ((GtkTextBuffer*) self, &nextCharIter, ".", 1);
		_tmp83_ = self->priv->nextCharMark;
		gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp84_, _tmp83_);
		nextCharIter = _tmp84_;
		gtk_text_iter_forward_chars (&nextCharIter, 1);
	}
	_tmp85_ = self->priv->nextCharMark;
	gtk_text_buffer_delete_mark ((GtkTextBuffer*) self, _tmp85_);
	_tmp86_ = gtk_text_mark_new ("nextChar", TRUE);
	_g_object_unref0 (self->priv->nextCharMark);
	self->priv->nextCharMark = _tmp86_;
	_tmp87_ = self->priv->nextCharMark;
	_tmp88_ = nextCharIter;
	gtk_text_buffer_add_mark ((GtkTextBuffer*) self, _tmp87_, &_tmp88_);
	_g_free0 (s);
	_g_free0 (incomingHexBuffer);
}


moserialHexTextBuffer* moserial_hex_text_buffer_construct (GType object_type) {
	moserialHexTextBuffer * self = NULL;
	self = (moserialHexTextBuffer*) g_object_new (object_type, NULL);
	return self;
}


moserialHexTextBuffer* moserial_hex_text_buffer_new (void) {
	return moserial_hex_text_buffer_construct (MOSERIAL_TYPE_HEX_TEXT_BUFFER);
}


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


static GObject * moserial_hex_text_buffer_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	moserialHexTextBuffer * self;
	GtkTextTag* _tmp0_;
	GtkTextTag* _tmp1_;
	parent_class = G_OBJECT_CLASS (moserial_hex_text_buffer_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MOSERIAL_TYPE_HEX_TEXT_BUFFER, moserialHexTextBuffer);
	moserial_hex_text_buffer_setup (self);
	_tmp0_ = gtk_text_buffer_create_tag ((GtkTextBuffer*) self, "hex_address", "foreground", "#2020ff", NULL, NULL);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->addressTag);
	self->priv->addressTag = _tmp1_;
	return obj;
}


static void moserial_hex_text_buffer_class_init (moserialHexTextBufferClass * klass) {
	moserial_hex_text_buffer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (moserialHexTextBufferPrivate));
	G_OBJECT_CLASS (klass)->constructor = moserial_hex_text_buffer_constructor;
	G_OBJECT_CLASS (klass)->finalize = moserial_hex_text_buffer_finalize;
}


static void moserial_hex_text_buffer_instance_init (moserialHexTextBuffer * self) {
	self->priv = MOSERIAL_HEX_TEXT_BUFFER_GET_PRIVATE (self);
}


static void moserial_hex_text_buffer_finalize (GObject * obj) {
	moserialHexTextBuffer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MOSERIAL_TYPE_HEX_TEXT_BUFFER, moserialHexTextBuffer);
	_g_object_unref0 (self->priv->nextHexMark);
	_g_object_unref0 (self->priv->nextCharMark);
	_g_object_unref0 (self->priv->addressTag);
	G_OBJECT_CLASS (moserial_hex_text_buffer_parent_class)->finalize (obj);
}


GType moserial_hex_text_buffer_get_type (void) {
	static volatile gsize moserial_hex_text_buffer_type_id__volatile = 0;
	if (g_once_init_enter (&moserial_hex_text_buffer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (moserialHexTextBufferClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) moserial_hex_text_buffer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (moserialHexTextBuffer), 0, (GInstanceInitFunc) moserial_hex_text_buffer_instance_init, NULL };
		GType moserial_hex_text_buffer_type_id;
		moserial_hex_text_buffer_type_id = g_type_register_static (gtk_text_buffer_get_type (), "moserialHexTextBuffer", &g_define_type_info, 0);
		g_once_init_leave (&moserial_hex_text_buffer_type_id__volatile, moserial_hex_text_buffer_type_id);
	}
	return moserial_hex_text_buffer_type_id__volatile;
}



