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

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

#define GOB_VERSION_MAJOR 2
#define GOB_VERSION_MINOR 0
#define GOB_VERSION_PATCHLEVEL 15

#define selfp (self->_priv)

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

#include "mn-standard-message-view.h"

#include "mn-standard-message-view-private.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 24 "src/mn-standard-message-view.gob"

#include <glib/gi18n.h>
#include "mn-message-view-private.h"
#include "mn-message.h"
#include "mn-util.h"
#include "mn-text-table.h"

#line 34 "mn-standard-message-view.c"
/* self casting macros */
#define SELF(x) MN_STANDARD_MESSAGE_VIEW(x)
#define SELF_CONST(x) MN_STANDARD_MESSAGE_VIEW_CONST(x)
#define IS_SELF(x) MN_IS_STANDARD_MESSAGE_VIEW(x)
#define TYPE_SELF MN_TYPE_STANDARD_MESSAGE_VIEW
#define SELF_CLASS(x) MN_STANDARD_MESSAGE_VIEW_CLASS(x)

#define SELF_GET_CLASS(x) MN_STANDARD_MESSAGE_VIEW_GET_CLASS(x)

/* self typedefs */
typedef MNStandardMessageView Self;
typedef MNStandardMessageViewClass SelfClass;

/* here are local prototypes */
#line 0 "src/mn-standard-message-view.gob"
static void mn_standard_message_view_init (MNStandardMessageView * o);
#line 51 "mn-standard-message-view.c"
#line 0 "src/mn-standard-message-view.gob"
static void mn_standard_message_view_class_init (MNStandardMessageViewClass * c);
#line 54 "mn-standard-message-view.c"
#line 34 "src/mn-standard-message-view.gob"
static void ___1_mn_standard_message_view_append_message (MNMessageView * view, MNMessage * message, time_t now);
#line 57 "mn-standard-message-view.c"
#line 51 "src/mn-standard-message-view.gob"
static void ___2_mn_standard_message_view_append_message_separator (MNMessageView * view);
#line 60 "mn-standard-message-view.c"
#line 58 "src/mn-standard-message-view.gob"
static void mn_standard_message_view_append_row (MNStandardMessageView * self, const char * name, const char * value);
#line 63 "mn-standard-message-view.c"
#line 68 "src/mn-standard-message-view.gob"
static void mn_standard_message_view_append_header (MNStandardMessageView * self, const char * name);
#line 66 "mn-standard-message-view.c"

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

/* Short form macros */
#define self_append_row mn_standard_message_view_append_row
#define self_append_header mn_standard_message_view_append_header
#define self_new mn_standard_message_view_new
GType
mn_standard_message_view_get_type (void)
{
	static GType type = 0;

	if ___GOB_UNLIKELY(type == 0) {
		static const GTypeInfo info = {
			sizeof (MNStandardMessageViewClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) mn_standard_message_view_class_init,
			(GClassFinalizeFunc) NULL,
			NULL /* class_data */,
			sizeof (MNStandardMessageView),
			0 /* n_preallocs */,
			(GInstanceInitFunc) mn_standard_message_view_init,
			NULL
		};

		type = g_type_register_static (MN_TYPE_MESSAGE_VIEW, "MNStandardMessageView", &info, (GTypeFlags)0);
	}

	return type;
}

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

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

static void 
mn_standard_message_view_init (MNStandardMessageView * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:Standard:Message:View::init"
}
#undef __GOB_FUNCTION__
static void 
mn_standard_message_view_class_init (MNStandardMessageViewClass * c G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:Standard:Message:View::class_init"
	MNMessageViewClass *mn_message_view_class = (MNMessageViewClass *)c;

	parent_class = g_type_class_ref (MN_TYPE_MESSAGE_VIEW);

#line 34 "src/mn-standard-message-view.gob"
	mn_message_view_class->append_message = ___1_mn_standard_message_view_append_message;
#line 51 "src/mn-standard-message-view.gob"
	mn_message_view_class->append_message_separator = ___2_mn_standard_message_view_append_message_separator;
#line 135 "mn-standard-message-view.c"
}
#undef __GOB_FUNCTION__



#line 34 "src/mn-standard-message-view.gob"
static void 
___1_mn_standard_message_view_append_message (MNMessageView * view G_GNUC_UNUSED, MNMessage * message, time_t now)
#line 144 "mn-standard-message-view.c"
#define PARENT_HANDLER(___view,___message,___now) \
	{ if(MN_MESSAGE_VIEW_CLASS(parent_class)->append_message) \
		(* MN_MESSAGE_VIEW_CLASS(parent_class)->append_message)(___view,___message,___now); }
{
#define __GOB_FUNCTION__ "MN:Standard:Message:View::append_message"
{
#line 36 "src/mn-standard-message-view.gob"
	
    Self *self = SELF(view);

    self_append_row(self, _("Mailbox:"), message->mailbox->runtime_name);
    self_append_row(self, _("From:"), message->from);
    self_append_row(self, _("Subject:"), message->subject);

    if (message->sent_time > 0)
      {
	self_append_header(self, _("Sent:"));
	mn_message_view_append_past_time_cell(MN_MESSAGE_VIEW(self), message->sent_time, now);
	mn_text_table_line_break(MN_TEXT_TABLE(self));
      }
  }}
#line 166 "mn-standard-message-view.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 51 "src/mn-standard-message-view.gob"
static void 
___2_mn_standard_message_view_append_message_separator (MNMessageView * view G_GNUC_UNUSED)
#line 173 "mn-standard-message-view.c"
#define PARENT_HANDLER(___view) \
	{ if(MN_MESSAGE_VIEW_CLASS(parent_class)->append_message_separator) \
		(* MN_MESSAGE_VIEW_CLASS(parent_class)->append_message_separator)(___view); }
{
#define __GOB_FUNCTION__ "MN:Standard:Message:View::append_message_separator"
{
#line 53 "src/mn-standard-message-view.gob"
	
    mn_text_table_append_blank_cell(MN_TEXT_TABLE(view), 0, 12);
    mn_text_table_line_break(MN_TEXT_TABLE(view));
  }}
#line 185 "mn-standard-message-view.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 58 "src/mn-standard-message-view.gob"
static void 
mn_standard_message_view_append_row (MNStandardMessageView * self, const char * name, const char * value)
{
#line 193 "mn-standard-message-view.c"
#define __GOB_FUNCTION__ "MN:Standard:Message:View::append_row"
#line 58 "src/mn-standard-message-view.gob"
	g_return_if_fail (self != NULL);
#line 58 "src/mn-standard-message-view.gob"
	g_return_if_fail (MN_IS_STANDARD_MESSAGE_VIEW (self));
#line 58 "src/mn-standard-message-view.gob"
	g_return_if_fail (name != NULL);
#line 58 "src/mn-standard-message-view.gob"
	g_return_if_fail (value != NULL);
#line 203 "mn-standard-message-view.c"
{
#line 62 "src/mn-standard-message-view.gob"
	
    self_append_header(self, name);
    mn_text_table_append_text_cell(MN_TEXT_TABLE(self), value);
    mn_text_table_line_break(MN_TEXT_TABLE(self));
  }}
#line 211 "mn-standard-message-view.c"
#undef __GOB_FUNCTION__

#line 68 "src/mn-standard-message-view.gob"
static void 
mn_standard_message_view_append_header (MNStandardMessageView * self, const char * name)
{
#line 218 "mn-standard-message-view.c"
#define __GOB_FUNCTION__ "MN:Standard:Message:View::append_header"
#line 68 "src/mn-standard-message-view.gob"
	g_return_if_fail (self != NULL);
#line 68 "src/mn-standard-message-view.gob"
	g_return_if_fail (MN_IS_STANDARD_MESSAGE_VIEW (self));
#line 68 "src/mn-standard-message-view.gob"
	g_return_if_fail (name != NULL);
#line 226 "mn-standard-message-view.c"
{
#line 70 "src/mn-standard-message-view.gob"
	
    char *markup;

    markup = g_markup_printf_escaped("<span weight=\"bold\">%s</span>", name);
    mn_text_table_append_text_cell_from_markup(MN_TEXT_TABLE(self), markup);
    g_free(markup);
  }}
#line 236 "mn-standard-message-view.c"
#undef __GOB_FUNCTION__

#line 78 "src/mn-standard-message-view.gob"
GtkWidget * 
mn_standard_message_view_new (void)
{
#line 243 "mn-standard-message-view.c"
#define __GOB_FUNCTION__ "MN:Standard:Message:View::new"
{
#line 80 "src/mn-standard-message-view.gob"
	
    return GTK_WIDGET(GET_NEW);
  }}
#line 250 "mn-standard-message-view.c"
#undef __GOB_FUNCTION__
