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

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

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

#line 31 "mn-custom-vfs-mailbox.c"
/* self casting macros */
#define SELF(x) MN_CUSTOM_VFS_MAILBOX(x)
#define SELF_CONST(x) MN_CUSTOM_VFS_MAILBOX_CONST(x)
#define IS_SELF(x) MN_IS_CUSTOM_VFS_MAILBOX(x)
#define TYPE_SELF MN_TYPE_CUSTOM_VFS_MAILBOX
#define SELF_CLASS(x) MN_CUSTOM_VFS_MAILBOX_CLASS(x)

#define SELF_GET_CLASS(x) MN_CUSTOM_VFS_MAILBOX_GET_CLASS(x)

/* self typedefs */
typedef MNCustomVFSMailbox Self;
typedef MNCustomVFSMailboxClass SelfClass;

/* here are local prototypes */
static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
#line 0 "src/mn-custom-vfs-mailbox.gob"
static void mn_custom_vfs_mailbox_init (MNCustomVFSMailbox * o);
#line 50 "mn-custom-vfs-mailbox.c"
#line 34 "src/mn-custom-vfs-mailbox.gob"
static void mn_custom_vfs_mailbox_class_init (MNCustomVFSMailboxClass * class);
#line 53 "mn-custom-vfs-mailbox.c"
#line 39 "src/mn-custom-vfs-mailbox.gob"
static void ___2_mn_custom_vfs_mailbox_seal (MNMailbox * mailbox);
#line 56 "mn-custom-vfs-mailbox.c"
#line 47 "src/mn-custom-vfs-mailbox.gob"
static MNMailbox * ___3_mn_custom_vfs_mailbox_parse_uri (MNMailbox * dummy, const char * uri);
#line 59 "mn-custom-vfs-mailbox.c"
#line 63 "src/mn-custom-vfs-mailbox.gob"
static void ___4_mn_custom_vfs_mailbox_check (MNMailbox * mailbox);
#line 62 "mn-custom-vfs-mailbox.c"

enum {
	PROP_0,
	PROP_URI
};

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

GType
mn_custom_vfs_mailbox_get_type (void)
{
	static GType type = 0;

	if ___GOB_UNLIKELY(type == 0) {
		static const GTypeInfo info = {
			sizeof (MNCustomVFSMailboxClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) mn_custom_vfs_mailbox_class_init,
			(GClassFinalizeFunc) NULL,
			NULL /* class_data */,
			sizeof (MNCustomVFSMailbox),
			0 /* n_preallocs */,
			(GInstanceInitFunc) mn_custom_vfs_mailbox_init,
			NULL
		};

		type = g_type_register_static (MN_TYPE_VFS_MAILBOX, "MNCustomVFSMailbox", &info, (GTypeFlags)0);
	}

	return type;
}

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

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


static void
___finalize(GObject *obj_self)
{
#define __GOB_FUNCTION__ "MN:Custom:VFS:Mailbox::finalize"
	MNCustomVFSMailbox *self G_GNUC_UNUSED = MN_CUSTOM_VFS_MAILBOX (obj_self);
	if(G_OBJECT_CLASS(parent_class)->finalize) \
		(* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
#line 31 "src/mn-custom-vfs-mailbox.gob"
	if(self->uri) { g_free ((gpointer) self->uri); self->uri = NULL; }
#line 124 "mn-custom-vfs-mailbox.c"
}
#undef __GOB_FUNCTION__

static void 
mn_custom_vfs_mailbox_init (MNCustomVFSMailbox * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:Custom:VFS:Mailbox::init"
}
#undef __GOB_FUNCTION__
#line 34 "src/mn-custom-vfs-mailbox.gob"
static void 
mn_custom_vfs_mailbox_class_init (MNCustomVFSMailboxClass * class G_GNUC_UNUSED)
{
#line 138 "mn-custom-vfs-mailbox.c"
#define __GOB_FUNCTION__ "MN:Custom:VFS:Mailbox::class_init"
	GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
	MNMailboxClass *mn_mailbox_class = (MNMailboxClass *)class;

	parent_class = g_type_class_ref (MN_TYPE_VFS_MAILBOX);

#line 39 "src/mn-custom-vfs-mailbox.gob"
	mn_mailbox_class->seal = ___2_mn_custom_vfs_mailbox_seal;
#line 47 "src/mn-custom-vfs-mailbox.gob"
	mn_mailbox_class->parse_uri = ___3_mn_custom_vfs_mailbox_parse_uri;
#line 63 "src/mn-custom-vfs-mailbox.gob"
	mn_mailbox_class->check = ___4_mn_custom_vfs_mailbox_check;
#line 151 "mn-custom-vfs-mailbox.c"
	g_object_class->finalize = ___finalize;
	g_object_class->get_property = ___object_get_property;
	g_object_class->set_property = ___object_set_property;
    {
	GParamSpec   *param_spec;

	param_spec = g_param_spec_string
		("uri" /* name */,
		 NULL /* nick */,
		 NULL /* blurb */,
		 NULL /* default_value */,
		 (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE | MN_MAILBOX_PARAM_REQUIRED | MN_MAILBOX_PARAM_LOAD_SAVE));
	g_object_class_install_property (g_object_class,
		PROP_URI,
		param_spec);
    }
 {
#line 35 "src/mn-custom-vfs-mailbox.gob"

    MN_MAILBOX_CLASS(class)->type = "custom-vfs";
  
#line 173 "mn-custom-vfs-mailbox.c"
 }
}
#undef __GOB_FUNCTION__

static void
___object_set_property (GObject *object,
	guint property_id,
	const GValue *VAL G_GNUC_UNUSED,
	GParamSpec *pspec G_GNUC_UNUSED)
#define __GOB_FUNCTION__ "MN:Custom:VFS:Mailbox::set_property"
{
	MNCustomVFSMailbox *self G_GNUC_UNUSED;

	self = MN_CUSTOM_VFS_MAILBOX (object);

	switch (property_id) {
	case PROP_URI:
		{
#line 32 "src/mn-custom-vfs-mailbox.gob"
{ char *old = self->uri; self->uri = g_value_dup_string (VAL); g_free (old); }
#line 194 "mn-custom-vfs-mailbox.c"
		}
		break;
	default:
/* Apparently in g++ this is needed, glib is b0rk */
#ifndef __PRETTY_FUNCTION__
#  undef G_STRLOC
#  define G_STRLOC	__FILE__ ":" G_STRINGIFY (__LINE__)
#endif
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
#undef __GOB_FUNCTION__

static void
___object_get_property (GObject *object,
	guint property_id,
	GValue *VAL G_GNUC_UNUSED,
	GParamSpec *pspec G_GNUC_UNUSED)
#define __GOB_FUNCTION__ "MN:Custom:VFS:Mailbox::get_property"
{
	MNCustomVFSMailbox *self G_GNUC_UNUSED;

	self = MN_CUSTOM_VFS_MAILBOX (object);

	switch (property_id) {
	case PROP_URI:
		{
#line 32 "src/mn-custom-vfs-mailbox.gob"
g_value_set_string (VAL, self->uri);
#line 225 "mn-custom-vfs-mailbox.c"
		}
		break;
	default:
/* Apparently in g++ this is needed, glib is b0rk */
#ifndef __PRETTY_FUNCTION__
#  undef G_STRLOC
#  define G_STRLOC	__FILE__ ":" G_STRINGIFY (__LINE__)
#endif
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
#undef __GOB_FUNCTION__



#line 39 "src/mn-custom-vfs-mailbox.gob"
static void 
___2_mn_custom_vfs_mailbox_seal (MNMailbox * mailbox G_GNUC_UNUSED)
#line 245 "mn-custom-vfs-mailbox.c"
#define PARENT_HANDLER(___mailbox) \
	{ if(MN_MAILBOX_CLASS(parent_class)->seal) \
		(* MN_MAILBOX_CLASS(parent_class)->seal)(___mailbox); }
{
#define __GOB_FUNCTION__ "MN:Custom:VFS:Mailbox::seal"
{
#line 41 "src/mn-custom-vfs-mailbox.gob"
	
    MN_VFS_MAILBOX(mailbox)->uri = gnome_vfs_make_uri_canonical(SELF(mailbox)->uri);

    PARENT_HANDLER(mailbox);
  }}
#line 258 "mn-custom-vfs-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 47 "src/mn-custom-vfs-mailbox.gob"
static MNMailbox * 
___3_mn_custom_vfs_mailbox_parse_uri (MNMailbox * dummy G_GNUC_UNUSED, const char * uri)
#line 265 "mn-custom-vfs-mailbox.c"
#define PARENT_HANDLER(___dummy,___uri) \
	((MN_MAILBOX_CLASS(parent_class)->parse_uri)? \
		(* MN_MAILBOX_CLASS(parent_class)->parse_uri)(___dummy,___uri): \
		((MNMailbox * )0))
{
#define __GOB_FUNCTION__ "MN:Custom:VFS:Mailbox::parse_uri"
{
#line 49 "src/mn-custom-vfs-mailbox.gob"
	
    GnomeVFSURI *vfs_uri;
    MNMailbox *mailbox = NULL;

    vfs_uri = gnome_vfs_uri_new(uri);
    if (vfs_uri)
      {
	mailbox = mn_mailbox_new("custom-vfs", "uri", uri, NULL);
	gnome_vfs_uri_unref(vfs_uri);
      }

    return mailbox;
  }}
#line 287 "mn-custom-vfs-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 63 "src/mn-custom-vfs-mailbox.gob"
static void 
___4_mn_custom_vfs_mailbox_check (MNMailbox * mailbox G_GNUC_UNUSED)
#line 294 "mn-custom-vfs-mailbox.c"
#define PARENT_HANDLER(___mailbox) \
	{ if(MN_MAILBOX_CLASS(parent_class)->check) \
		(* MN_MAILBOX_CLASS(parent_class)->check)(___mailbox); }
{
#define __GOB_FUNCTION__ "MN:Custom:VFS:Mailbox::check"
{
#line 65 "src/mn-custom-vfs-mailbox.gob"
	
    if (MN_VFS_MAILBOX(mailbox)->vfs_uri)
      {
	PARENT_HANDLER(mailbox);
      }
    else
      {
	mn_mailbox_set_error(mailbox, _("invalid location"));
	mn_mailbox_set_poll(mailbox, FALSE); /* disable the mailbox */
      }
  }}
#line 313 "mn-custom-vfs-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
