Logo Search packages:      
Sourcecode: gnome-compiz-manager version File versions

gcm-xorg.c

/* Generated by GOB (v2.0.14)   (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 14

#define selfp (self->_priv)

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

#include "gcm-xorg.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 29 "gcm-xorg.gob"

#include "gcm-application.h"

#line 28 "gcm-xorg.c"
/* self casting macros */
#define SELF(x) GCM_XORG(x)
#define SELF_CONST(x) GCM_XORG_CONST(x)
#define IS_SELF(x) GCM_IS_XORG(x)
#define TYPE_SELF GCM_TYPE_XORG
#define SELF_CLASS(x) GCM_XORG_CLASS(x)

#define SELF_GET_CLASS(x) GCM_XORG_GET_CLASS(x)

/* self typedefs */
typedef GCMXorg Self;
typedef GCMXorgClass SelfClass;

struct _GCMXorgPrivate {
#line 35 "gcm-xorg.gob"
      GCMApplication * xorg;
#line 37 "gcm-xorg.gob"
      GCMApplication * xgl;
#line 39 "gcm-xorg.gob"
      GCMXorgConfig * config;
#line 49 "gcm-xorg.c"
};
/* here are local prototypes */
static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void gcm_xorg_init (GCMXorg * o) G_GNUC_UNUSED;
static void gcm_xorg_class_init (GCMXorgClass * c) G_GNUC_UNUSED;

enum {
      PROP_0,
      PROP_CONFIG
};

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

/* Short form macros */
#define self_get_config gcm_xorg_get_config
#define self_new gcm_xorg_new
#define self_stop gcm_xorg_stop
#define self_is_xgl gcm_xorg_is_xgl
GType
gcm_xorg_get_type (void)
{
      static GType type = 0;

      if ___GOB_UNLIKELY(type == 0) {
            static const GTypeInfo info = {
                  sizeof (GCMXorgClass),
                  (GBaseInitFunc) NULL,
                  (GBaseFinalizeFunc) NULL,
                  (GClassInitFunc) gcm_xorg_class_init,
                  (GClassFinalizeFunc) NULL,
                  NULL /* class_data */,
                  sizeof (GCMXorg),
                  0 /* n_preallocs */,
                  (GInstanceInitFunc) gcm_xorg_init,
                  NULL
            };

            type = g_type_register_static (G_TYPE_OBJECT, "GCMXorg", &info, (GTypeFlags)0);
      }

      return type;
}

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

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


static void
___finalize(GObject *obj_self)
{
#define __GOB_FUNCTION__ "GCM:Xorg::finalize"
      GCMXorg *self G_GNUC_UNUSED = GCM_XORG (obj_self);
      gpointer priv G_GNUC_UNUSED = self->_priv;
      if(G_OBJECT_CLASS(parent_class)->finalize) \
            (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
#line 36 "gcm-xorg.gob"
      if(self->_priv->xorg) { g_object_unref ((gpointer) self->_priv->xorg); self->_priv->xorg = NULL; }
#line 122 "gcm-xorg.c"
#line 38 "gcm-xorg.gob"
      if(self->_priv->xgl) { g_object_unref ((gpointer) self->_priv->xgl); self->_priv->xgl = NULL; }
#line 125 "gcm-xorg.c"
#line 40 "gcm-xorg.gob"
      if(self->_priv->config) { g_object_unref ((gpointer) self->_priv->config); self->_priv->config = NULL; }
#line 128 "gcm-xorg.c"
}
#undef __GOB_FUNCTION__

static void 
gcm_xorg_init (GCMXorg * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "GCM:Xorg::init"
      o->_priv = G_TYPE_INSTANCE_GET_PRIVATE(o,GCM_TYPE_XORG,GCMXorgPrivate);
}
#undef __GOB_FUNCTION__
static void 
gcm_xorg_class_init (GCMXorgClass * c G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "GCM:Xorg::class_init"
      GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;

      g_type_class_add_private(c,sizeof(GCMXorgPrivate));

      parent_class = g_type_class_ref (G_TYPE_OBJECT);

      g_object_class->finalize = ___finalize;
      g_object_class->get_property = ___object_get_property;
    {
      GParamSpec   *param_spec;

      param_spec = g_param_spec_pointer
            ("config" /* name */,
             "Config" /* nick */,
             "Xorg config filename" /* blurb */,
             (GParamFlags)(G_PARAM_READABLE));
      g_object_class_install_property (g_object_class,
            PROP_CONFIG,
            param_spec);
    }
}
#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__ "GCM:Xorg::get_property"
{
      GCMXorg *self G_GNUC_UNUSED;

      self = GCM_XORG (object);

      switch (property_id) {
      case PROP_CONFIG:
            {
#line 47 "gcm-xorg.gob"

                  g_value_set_pointer(VAL, selfp->config);
            
#line 184 "gcm-xorg.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 47 "gcm-xorg.gob"
gpointer 
gcm_xorg_get_config (GCMXorg * self)
#line 204 "gcm-xorg.c"
{
#define __GOB_FUNCTION__ "GCM:Xorg::get_config"
{
#line 41 "gcm-xorg.gob"
            gpointer val; g_object_get (G_OBJECT (self), "config", &val, NULL); return val;
}}
#line 211 "gcm-xorg.c"
#undef __GOB_FUNCTION__

#line 51 "gcm-xorg.gob"
GCMXorg * 
gcm_xorg_new (void)
#line 217 "gcm-xorg.c"
{
#define __GOB_FUNCTION__ "GCM:Xorg::new"
{
#line 53 "gcm-xorg.gob"
      
            GCMXorg * self = GET_NEW;
            
            selfp->xorg = gcm_application_new("Xorg", "X", NULL);
            selfp->xgl = gcm_application_new("Xgl", NULL, NULL);
            selfp->config = gcm_xorg_config_new();
            
            return self;
      }}
#line 231 "gcm-xorg.c"
#undef __GOB_FUNCTION__

#line 63 "gcm-xorg.gob"
void 
gcm_xorg_stop (GCMXorg * self)
#line 237 "gcm-xorg.c"
{
#define __GOB_FUNCTION__ "GCM:Xorg::stop"
#line 63 "gcm-xorg.gob"
      g_return_if_fail (self != NULL);
#line 63 "gcm-xorg.gob"
      g_return_if_fail (GCM_IS_XORG (self));
#line 244 "gcm-xorg.c"
{
#line 65 "gcm-xorg.gob"
      
            if (selfp->xgl) gcm_application_stop(selfp->xgl);
            printf("kill %i\n", gcm_application_get_pid(selfp->xorg));
            gcm_application_stop(selfp->xorg);
      }}
#line 252 "gcm-xorg.c"
#undef __GOB_FUNCTION__

#line 71 "gcm-xorg.gob"
gboolean 
gcm_xorg_is_xgl (GCMXorg * self)
#line 258 "gcm-xorg.c"
{
#define __GOB_FUNCTION__ "GCM:Xorg::is_xgl"
#line 71 "gcm-xorg.gob"
      g_return_val_if_fail (self != NULL, (gboolean )FALSE);
#line 71 "gcm-xorg.gob"
      g_return_val_if_fail (GCM_IS_XORG (self), (gboolean )FALSE);
#line 265 "gcm-xorg.c"
{
#line 73 "gcm-xorg.gob"
      
            return selfp->xgl != NULL && gcm_application_get_pid(selfp->xgl);
      }}
#line 271 "gcm-xorg.c"
#undef __GOB_FUNCTION__

Generated by  Doxygen 1.6.0   Back to index