soylent r162 - trunk/libsoylent
- From: svenp svn gnome org
- To: svn-commits-list gnome org
- Subject: soylent r162 - trunk/libsoylent
- Date: Sat, 14 Jun 2008 16:31:14 +0000 (UTC)
Author: svenp
Date: Sat Jun 14 16:31:14 2008
New Revision: 162
URL: http://svn.gnome.org/viewvc/soylent?rev=162&view=rev
Log:
added SoylentGroup (GObject stuff working)
Added:
trunk/libsoylent/sl-group.c
trunk/libsoylent/sl-group.h
Modified:
trunk/libsoylent/Makefile.am
Modified: trunk/libsoylent/Makefile.am
==============================================================================
--- trunk/libsoylent/Makefile.am (original)
+++ trunk/libsoylent/Makefile.am Sat Jun 14 16:31:14 2008
@@ -8,10 +8,12 @@
soylent.h \
sl-entity.h \
sl-book.h \
+ sl-group.h \
sl-person.h \
soylent.c \
sl-entity.c \
sl-book.c \
+ sl-group.c \
sl-person.c
libsoylent_la_CFLAGS = $(LIBSOYLENT_CFLAGS) $(WARN_CFLAGS)
Added: trunk/libsoylent/sl-group.c
==============================================================================
--- (empty file)
+++ trunk/libsoylent/sl-group.c Sat Jun 14 16:31:14 2008
@@ -0,0 +1,98 @@
+/**/
+
+#include "sl-group.h"
+
+/* private structs and fields */
+
+struct _SlGroupPriv
+{
+ gpointer foo;
+};
+
+GObjectClass *parent_class = NULL;
+
+static void sl_group_class_init (gpointer g_class, gpointer class_data);
+static void sl_group_init (GTypeInstance *instance, gpointer g_class);
+static void sl_group_dispose (GObject *object);
+static void sl_group_get_property (GObject *object, guint property_id,
+ GValue *value, GParamSpec *pspec);
+static void sl_group_set_property (GObject *object, guint property_id,
+ const GValue *value, GParamSpec *pspec);
+
+GType
+sl_group_get_type (void)
+{
+ static GType type = 0;
+ static const GTypeInfo info =
+ {
+ sizeof (SlGroupClass),
+ NULL,
+ NULL,
+ sl_group_class_init,
+ NULL,
+ NULL,
+ sizeof (SlGroup),
+ 0,
+ sl_group_init,
+ NULL
+ };
+
+ if (type == 0)
+ {
+ type = g_type_register_static (SL_ENTITY_TYPE, "SlGroup", &info, 0);
+ }
+ return type;
+}
+
+static void
+sl_group_class_init (gpointer g_class, gpointer class_data)
+{
+ parent_class = g_type_class_peek (g_type_parent (SL_GROUP_TYPE));
+ g_assert (parent_class != NULL);
+
+ GObjectClass *obj_class = G_OBJECT_CLASS (g_class);
+ obj_class->dispose = sl_group_dispose;
+ obj_class->get_property = sl_group_get_property;
+ obj_class->set_property = sl_group_set_property;
+}
+
+static void
+sl_group_init (GTypeInstance *instance, gpointer g_class)
+{
+ SlGroup *self = SL_GROUP (instance);
+ SlGroupPriv *priv = g_new (SlGroupPriv, 1);
+ self->priv = priv;
+ SL_ENTITY (self)->disposed = FALSE;
+}
+
+static void
+sl_group_dispose (GObject *object)
+{
+ SlGroup *self = SL_GROUP (object);
+ g_return_if_fail (!SL_ENTITY (self)->disposed);
+
+ g_free (self->priv);
+
+ parent_class->dispose (object);
+}
+
+static void
+sl_group_get_property (GObject *object, guint property_id, GValue *value,
+ GParamSpec *pspec)
+{
+ g_warning("%s not implemented", __FUNCTION__);
+}
+
+static void
+sl_group_set_property (GObject *object, guint property_id, const GValue *value,
+ GParamSpec *pspec)
+{
+ g_warning("%s not implemented", __FUNCTION__);
+}
+
+SlGroup *
+sl_group_new (void)
+{
+ SlGroup *self = g_object_new (SL_GROUP_TYPE, NULL);
+ return self;
+}
Added: trunk/libsoylent/sl-group.h
==============================================================================
--- (empty file)
+++ trunk/libsoylent/sl-group.h Sat Jun 14 16:31:14 2008
@@ -0,0 +1,39 @@
+/**/
+
+#ifndef SL_GROUP_H
+#define SL_GROUP_H
+
+#include "sl-entity.h"
+
+#include <glib.h>
+#include <glib-object.h>
+
+#define SL_GROUP_TYPE (sl_group_get_type ())
+#define SL_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, \
+ SL_GROUP_TYPE, SlGroup))
+#define SL_GROUP_CLASS(cls) (G_TPYE_CHECK_CLASS_CAST(cls, SL_GROUP_TYPE, \
+ SlGroupClass))
+#define SL_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, SL_GROUP_TYPE))
+#define SL_IS_GROUP_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE(cls, SL_GROUP_TYPE))
+#define SL_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS(obj, SL_GROUP_TYPE))
+
+typedef struct _SlGroup SlGroup;
+typedef struct _SlGroupClass SlGroupClass;
+typedef struct _SlGroupPriv SlGroupPriv;
+
+struct _SlGroup
+{
+ SlEntity parent;
+ SlGroupPriv *priv;
+};
+
+struct _SlGroupClass
+{
+ SlEntityClass parent;
+};
+
+GType sl_group_get_type (void);
+
+SlGroup *sl_group_new (void);
+
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]