Logo Search packages:      
Sourcecode: mail-notification version File versions

mn-system-mailbox-properties.c

/* Generated by GOB (v2.0.11) on Sun Mar  6 22:34:28 2005
   (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 11

#define selfp (self->_priv)

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

#include "mn-system-mailbox-properties.h"

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

#include "config.h"
#include <glib/gi18n.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include "mn-mailbox-properties.h"

#line 34 "mn-system-mailbox-properties.c"
/* self casting macros */
#define SELF(x) MN_SYSTEM_MAILBOX_PROPERTIES(x)
#define SELF_CONST(x) MN_SYSTEM_MAILBOX_PROPERTIES_CONST(x)
#define IS_SELF(x) MN_IS_SYSTEM_MAILBOX_PROPERTIES(x)
#define TYPE_SELF MN_TYPE_SYSTEM_MAILBOX_PROPERTIES
#define SELF_CLASS(x) MN_SYSTEM_MAILBOX_PROPERTIES_CLASS(x)

#define SELF_GET_CLASS(x) MN_SYSTEM_MAILBOX_PROPERTIES_GET_CLASS(x)

/* self typedefs */
typedef MNSystemMailboxProperties Self;
typedef MNSystemMailboxPropertiesClass 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);
static void mn_system_mailbox_properties_class_init (MNSystemMailboxPropertiesClass * c) G_GNUC_UNUSED;
static void mn_system_mailbox_properties_init (MNSystemMailboxProperties * self) G_GNUC_UNUSED;
static gboolean mn_system_mailbox_properties_set_uri (MNMailboxProperties * self, MNURI * uri) G_GNUC_UNUSED;
static MNURI * mn_system_mailbox_properties_get_uri (MNMailboxProperties * self) G_GNUC_UNUSED;

enum {
      PROP_0,
      PROP_LABEL,
      PROP_SIZE_GROUP,
      PROP_COMPLETE
};

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

/* Short form macros */
#define self_set_uri mn_system_mailbox_properties_set_uri
#define self_get_uri mn_system_mailbox_properties_get_uri


static void
___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
{
#line 67 "mn-system-mailbox-properties.gob"
      iface->set_uri = self_set_uri;
#line 74 "mn-system-mailbox-properties.gob"
      iface->get_uri = self_get_uri;
#line 78 "mn-system-mailbox-properties.c"
}

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

      if ___GOB_UNLIKELY(type == 0) {
            static const GTypeInfo info = {
                  sizeof (MNSystemMailboxPropertiesClass),
                  (GBaseInitFunc) NULL,
                  (GBaseFinalizeFunc) NULL,
                  (GClassInitFunc) mn_system_mailbox_properties_class_init,
                  (GClassFinalizeFunc) NULL,
                  NULL /* class_data */,
                  sizeof (MNSystemMailboxProperties),
                  0 /* n_preallocs */,
                  (GInstanceInitFunc) mn_system_mailbox_properties_init,
                  NULL
            };

            static const GInterfaceInfo MN_Mailbox_Properties_info = {
                  (GInterfaceInitFunc) ___MN_Mailbox_Properties_init,
                  NULL,
                  NULL
            };

            type = g_type_register_static (GTK_TYPE_LABEL, "MNSystemMailboxProperties", &info, (GTypeFlags)0);
            g_type_add_interface_static (type,
                  MN_TYPE_MAILBOX_PROPERTIES,
                  &MN_Mailbox_Properties_info);
      }

      return type;
}

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

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


static void
___dispose (GObject *obj_self)
{
#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::dispose"
      MNSystemMailboxProperties *self G_GNUC_UNUSED = MN_SYSTEM_MAILBOX_PROPERTIES (obj_self);
      if (G_OBJECT_CLASS (parent_class)->dispose) \
            (* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
#line 36 "mn-system-mailbox-properties.gob"
      if(self->_priv->size_group) { g_object_unref ((gpointer) self->_priv->size_group); self->_priv->size_group = NULL; }
#line 142 "mn-system-mailbox-properties.c"
}
#undef __GOB_FUNCTION__


static void
___finalize(GObject *obj_self)
{
#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::finalize"
      MNSystemMailboxProperties *self G_GNUC_UNUSED = MN_SYSTEM_MAILBOX_PROPERTIES (obj_self);
      gpointer priv G_GNUC_UNUSED = self->_priv;
      if(G_OBJECT_CLASS(parent_class)->finalize) \
            (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
}
#undef __GOB_FUNCTION__

static void 
mn_system_mailbox_properties_class_init (MNSystemMailboxPropertiesClass * c G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::class_init"
      GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;

      g_type_class_add_private(c,sizeof(MNSystemMailboxPropertiesPrivate));

      parent_class = g_type_class_ref (GTK_TYPE_LABEL);

      g_object_class->dispose = ___dispose;
      g_object_class->finalize = ___finalize;
      g_object_class->get_property = ___object_get_property;
      g_object_class->set_property = ___object_set_property;
    {
      g_object_class_override_property (g_object_class,
            PROP_LABEL,
            "label");
      g_object_class_override_property (g_object_class,
            PROP_SIZE_GROUP,
            "size_group");
      g_object_class_override_property (g_object_class,
            PROP_COMPLETE,
            "complete");
    }
}
#undef __GOB_FUNCTION__
#line 44 "mn-system-mailbox-properties.gob"
static void 
mn_system_mailbox_properties_init (MNSystemMailboxProperties * self G_GNUC_UNUSED)
#line 188 "mn-system-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::init"
      self->_priv = G_TYPE_INSTANCE_GET_PRIVATE(self,TYPE_SELF,MNSystemMailboxPropertiesPrivate);
 {
#line 45 "mn-system-mailbox-properties.gob"

    gtk_label_set_line_wrap(GTK_LABEL(self), TRUE);
    gtk_misc_set_alignment(GTK_MISC(self), 0.0, 0.5);

    selfp->system_uri = mn_uri_get_system_mailbox();
    if (selfp->system_uri)
      {
      char *path;
      char *markup;
      
      path = gnome_vfs_get_local_path_from_uri(selfp->system_uri);

      markup = g_markup_printf_escaped(_("Your system mailbox (<span weight=\"bold\">%s</span>) will be used."), path ? path : selfp->system_uri);
      gtk_label_set_markup(GTK_LABEL(self), markup);
      g_free(markup);

      g_free(path);
      }
    else
      gtk_label_set_text(GTK_LABEL(self), _("The location of your system mailbox could not be detected. Please set the MAIL environment variable."));
  
#line 215 "mn-system-mailbox-properties.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:System:Mailbox:Properties::set_property"
{
      MNSystemMailboxProperties *self G_GNUC_UNUSED;

      self = MN_SYSTEM_MAILBOX_PROPERTIES (object);

      switch (property_id) {
      case PROP_SIZE_GROUP:
            {
#line 37 "mn-system-mailbox-properties.gob"
{ GObject *___old = (GObject *)self->_priv->size_group; self->_priv->size_group = (void *)g_value_dup_object (VAL); if (___old != NULL) { g_object_unref (G_OBJECT (___old)); } }
#line 236 "mn-system-mailbox-properties.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:System:Mailbox:Properties::get_property"
{
      MNSystemMailboxProperties *self G_GNUC_UNUSED;

      self = MN_SYSTEM_MAILBOX_PROPERTIES (object);

      switch (property_id) {
      case PROP_LABEL:
            {
#line 34 "mn-system-mailbox-properties.gob"
 g_value_set_string(VAL, _("System Mailbox")); 
#line 267 "mn-system-mailbox-properties.c"
            }
            break;
      case PROP_SIZE_GROUP:
            {
#line 37 "mn-system-mailbox-properties.gob"
g_value_set_object (VAL, (gpointer)self->_priv->size_group);
#line 274 "mn-system-mailbox-properties.c"
            }
            break;
      case PROP_COMPLETE:
            {
#line 40 "mn-system-mailbox-properties.gob"
 g_value_set_boolean(VAL, selfp->system_uri != NULL); 
#line 281 "mn-system-mailbox-properties.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 67 "mn-system-mailbox-properties.gob"
static gboolean 
mn_system_mailbox_properties_set_uri (MNMailboxProperties * self, MNURI * uri)
#line 301 "mn-system-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::set_uri"
#line 67 "mn-system-mailbox-properties.gob"
      g_return_val_if_fail (self != NULL, (gboolean )0);
#line 67 "mn-system-mailbox-properties.gob"
      g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (gboolean )0);
#line 67 "mn-system-mailbox-properties.gob"
      g_return_val_if_fail (uri != NULL, (gboolean )0);
#line 310 "mn-system-mailbox-properties.c"
{
#line 70 "mn-system-mailbox-properties.gob"
      
    return MN_URI_IS_SYSTEM_MAILBOX(uri);
  }}
#line 316 "mn-system-mailbox-properties.c"
#undef __GOB_FUNCTION__

#line 74 "mn-system-mailbox-properties.gob"
static MNURI * 
mn_system_mailbox_properties_get_uri (MNMailboxProperties * self)
#line 322 "mn-system-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::get_uri"
#line 74 "mn-system-mailbox-properties.gob"
      g_return_val_if_fail (self != NULL, (MNURI * )0);
#line 74 "mn-system-mailbox-properties.gob"
      g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (MNURI * )0);
#line 329 "mn-system-mailbox-properties.c"
{
#line 76 "mn-system-mailbox-properties.gob"
      
    return mn_uri_new(SELF(self)->_priv->system_uri);
  }}
#line 335 "mn-system-mailbox-properties.c"
#undef __GOB_FUNCTION__

Generated by  Doxygen 1.6.0   Back to index