/* 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-test-mailbox.h"

#include "mn-test-mailbox-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-test-mailbox.gob"

#include <glib/gi18n.h>
#include "mn-mailbox-private.h"
#include "mn-message.h"
#include "mn-util.h"

#line 33 "mn-test-mailbox.c"
/* self casting macros */
#define SELF(x) MN_TEST_MAILBOX(x)
#define SELF_CONST(x) MN_TEST_MAILBOX_CONST(x)
#define IS_SELF(x) MN_IS_TEST_MAILBOX(x)
#define TYPE_SELF MN_TYPE_TEST_MAILBOX
#define SELF_CLASS(x) MN_TEST_MAILBOX_CLASS(x)

#define SELF_GET_CLASS(x) MN_TEST_MAILBOX_GET_CLASS(x)

/* self typedefs */
typedef MNTestMailbox Self;
typedef MNTestMailboxClass SelfClass;

/* here are local prototypes */
#line 0 "src/mn-test-mailbox.gob"
static void mn_test_mailbox_class_init (MNTestMailboxClass * c);
#line 50 "mn-test-mailbox.c"
#line 33 "src/mn-test-mailbox.gob"
static void mn_test_mailbox_init (MNTestMailbox * self);
#line 53 "mn-test-mailbox.c"
#line 41 "src/mn-test-mailbox.gob"
static void ___2_mn_test_mailbox_check (MNMailbox * mailbox);
#line 56 "mn-test-mailbox.c"

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

/* Short form macros */
#define self_new mn_test_mailbox_new
GType
mn_test_mailbox_get_type (void)
{
	static GType type = 0;

	if ___GOB_UNLIKELY(type == 0) {
		static const GTypeInfo info = {
			sizeof (MNTestMailboxClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) mn_test_mailbox_class_init,
			(GClassFinalizeFunc) NULL,
			NULL /* class_data */,
			sizeof (MNTestMailbox),
			0 /* n_preallocs */,
			(GInstanceInitFunc) mn_test_mailbox_init,
			NULL
		};

		type = g_type_register_static (MN_TYPE_MAILBOX, "MNTestMailbox", &info, (GTypeFlags)0);
	}

	return type;
}

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

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

static void 
mn_test_mailbox_class_init (MNTestMailboxClass * c G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:Test:Mailbox::class_init"
	MNMailboxClass *mn_mailbox_class = (MNMailboxClass *)c;

	parent_class = g_type_class_ref (MN_TYPE_MAILBOX);

#line 41 "src/mn-test-mailbox.gob"
	mn_mailbox_class->check = ___2_mn_test_mailbox_check;
#line 115 "mn-test-mailbox.c"
}
#undef __GOB_FUNCTION__
#line 33 "src/mn-test-mailbox.gob"
static void 
mn_test_mailbox_init (MNTestMailbox * self G_GNUC_UNUSED)
{
#line 122 "mn-test-mailbox.c"
#define __GOB_FUNCTION__ "MN:Test:Mailbox::init"
 {
#line 34 "src/mn-test-mailbox.gob"

    MNMailbox *mailbox = MN_MAILBOX(self);

    mn_mailbox_set_poll(mailbox, FALSE);
    mailbox->runtime_name = g_strdup(_("Test mailbox"));
  
#line 132 "mn-test-mailbox.c"
 }
}
#undef __GOB_FUNCTION__



#line 41 "src/mn-test-mailbox.gob"
static void 
___2_mn_test_mailbox_check (MNMailbox * mailbox G_GNUC_UNUSED)
#line 142 "mn-test-mailbox.c"
#define PARENT_HANDLER(___mailbox) \
	{ if(MN_MAILBOX_CLASS(parent_class)->check) \
		(* MN_MAILBOX_CLASS(parent_class)->check)(___mailbox); }
{
#define __GOB_FUNCTION__ "MN:Test:Mailbox::check"
{
#line 43 "src/mn-test-mailbox.gob"
	
    GSList *messages = NULL;
    time_t now;
    int i;

    PARENT_HANDLER(mailbox);

    now = mn_time();

    for (i = 1; i < 4; i++)
      {
	MNMessage *message;
	char *subject;

	subject = g_strdup_printf(_("Test message #%i"), i);
	message = mn_message_new(mailbox,
				 now,
				 NULL,
				 NULL,
				 /* translators: header capitalization */
				 _("Mail Notification Properties Dialog"),
				 subject,
				 NULL,
				 MN_MESSAGE_NEW);
	g_free(subject);

	messages = g_slist_append(messages, message);
      }

    mn_mailbox_set_messages(mailbox, messages);
    mn_g_object_slist_free(messages);
  }}
#line 182 "mn-test-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 76 "src/mn-test-mailbox.gob"
MNMailbox * 
mn_test_mailbox_new (void)
{
#line 190 "mn-test-mailbox.c"
#define __GOB_FUNCTION__ "MN:Test:Mailbox::new"
{
#line 78 "src/mn-test-mailbox.gob"
	
    return MN_MAILBOX(GET_NEW);
  }}
#line 197 "mn-test-mailbox.c"
#undef __GOB_FUNCTION__
