[empathy: 1/12] add empathy-roster-model-aggregator



commit c906321a8a61cf8d7a980dd088a751399bc2de7f
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Aug 8 10:37:07 2012 +0200

    add empathy-roster-model-aggregator

 libempathy-gtk/Makefile.am                       |    2 +
 libempathy-gtk/empathy-roster-model-aggregator.c |  165 ++++++++++++++++++++++
 libempathy-gtk/empathy-roster-model-aggregator.h |   74 ++++++++++
 3 files changed, 241 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am
index 87d7875..902a5e5 100644
--- a/libempathy-gtk/Makefile.am
+++ b/libempathy-gtk/Makefile.am
@@ -77,6 +77,7 @@ libempathy_gtk_handwritten_source =            	\
 	empathy-roster-contact.c			\
 	empathy-roster-group.c			\
 	empathy-roster-model.c			\
+	empathy-roster-model-aggregator.c			\
 	empathy-roster-model-manager.c			\
 	empathy-roster-view.c			\
 	empathy-search-bar.c			\
@@ -148,6 +149,7 @@ libempathy_gtk_headers =			\
 	empathy-roster-contact.h			\
 	empathy-roster-group.h			\
 	empathy-roster-model.h			\
+	empathy-roster-model-aggregator.h			\
 	empathy-roster-model-manager.h			\
 	empathy-roster-view.h			\
 	empathy-search-bar.h			\
diff --git a/libempathy-gtk/empathy-roster-model-aggregator.c b/libempathy-gtk/empathy-roster-model-aggregator.c
new file mode 100644
index 0000000..75289dc
--- /dev/null
+++ b/libempathy-gtk/empathy-roster-model-aggregator.c
@@ -0,0 +1,165 @@
+/*
+ * empathy-roster-model-aggregator.c
+ *
+ * Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+
+#include "config.h"
+
+#include "empathy-roster-model-aggregator.h"
+
+/**
+ * SECTION: empathy-roster-model-aggregator
+ * @title: EmpathyRosterModelAggregator
+ * @short_description: TODO
+ *
+ * TODO
+ */
+
+/**
+ * EmpathyRosterModelAggregator:
+ *
+ * Data structure representing a #EmpathyRosterModelAggregator.
+ *
+ * Since: UNRELEASED
+ */
+
+/**
+ * EmpathyRosterModelAggregatorClass:
+ *
+ * The class of a #EmpathyRosterModelAggregator.
+ *
+ * Since: UNRELEASED
+ */
+
+G_DEFINE_TYPE (EmpathyRosterModelAggregator, empathy_roster_model_aggregator, G_TYPE_OBJECT)
+
+enum
+{
+  PROP_FIRST_PROP = 1,
+  N_PROPS
+};
+
+/*
+enum
+{
+  LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL];
+*/
+
+struct _EmpathyRosterModelAggregatorPriv
+{
+  gpointer badger;
+};
+
+static void
+empathy_roster_model_aggregator_get_property (GObject *object,
+    guint property_id,
+    GValue *value,
+    GParamSpec *pspec)
+{
+  //EmpathyRosterModelAggregator *self = EMPATHY_ROSTER_MODEL_AGGREGATOR (object);
+
+  switch (property_id)
+    {
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+        break;
+    }
+}
+
+static void
+empathy_roster_model_aggregator_set_property (GObject *object,
+    guint property_id,
+    const GValue *value,
+    GParamSpec *pspec)
+{
+  //EmpathyRosterModelAggregator *self = EMPATHY_ROSTER_MODEL_AGGREGATOR (object);
+
+  switch (property_id)
+    {
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+        break;
+    }
+}
+
+static void
+empathy_roster_model_aggregator_constructed (GObject *object)
+{
+  //EmpathyRosterModelAggregator *self = EMPATHY_ROSTER_MODEL_AGGREGATOR (object);
+  void (*chain_up) (GObject *) =
+      ((GObjectClass *) empathy_roster_model_aggregator_parent_class)->constructed;
+
+  if (chain_up != NULL)
+    chain_up (object);
+}
+
+static void
+empathy_roster_model_aggregator_dispose (GObject *object)
+{
+  //EmpathyRosterModelAggregator *self = EMPATHY_ROSTER_MODEL_AGGREGATOR (object);
+  void (*chain_up) (GObject *) =
+      ((GObjectClass *) empathy_roster_model_aggregator_parent_class)->dispose;
+
+  if (chain_up != NULL)
+    chain_up (object);
+}
+
+static void
+empathy_roster_model_aggregator_finalize (GObject *object)
+{
+  //EmpathyRosterModelAggregator *self = EMPATHY_ROSTER_MODEL_AGGREGATOR (object);
+  void (*chain_up) (GObject *) =
+      ((GObjectClass *) empathy_roster_model_aggregator_parent_class)->finalize;
+
+  if (chain_up != NULL)
+    chain_up (object);
+}
+
+static void
+empathy_roster_model_aggregator_class_init (
+    EmpathyRosterModelAggregatorClass *klass)
+{
+  GObjectClass *oclass = G_OBJECT_CLASS (klass);
+  //GParamSpec *spec;
+
+  oclass->get_property = empathy_roster_model_aggregator_get_property;
+  oclass->set_property = empathy_roster_model_aggregator_set_property;
+  oclass->constructed = empathy_roster_model_aggregator_constructed;
+  oclass->dispose = empathy_roster_model_aggregator_dispose;
+  oclass->finalize = empathy_roster_model_aggregator_finalize;
+
+  g_type_class_add_private (klass, sizeof (EmpathyRosterModelAggregatorPriv));
+}
+
+static void
+empathy_roster_model_aggregator_init (EmpathyRosterModelAggregator *self)
+{
+  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
+      EMPATHY_TYPE_ROSTER_MODEL_AGGREGATOR, EmpathyRosterModelAggregatorPriv);
+}
+
+EmpathyRosterModelAggregator *
+empathy_roster_model_aggregator_new (void)
+{
+  return g_object_new (EMPATHY_TYPE_ROSTER_MODEL_AGGREGATOR,
+      NULL);
+}
diff --git a/libempathy-gtk/empathy-roster-model-aggregator.h b/libempathy-gtk/empathy-roster-model-aggregator.h
new file mode 100644
index 0000000..2beb3c0
--- /dev/null
+++ b/libempathy-gtk/empathy-roster-model-aggregator.h
@@ -0,0 +1,74 @@
+/*
+ * empathy-roster-model-aggregator.h
+ *
+ * Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+
+#ifndef __EMPATHY_ROSTER_MODEL_AGGREGATOR_H__
+#define __EMPATHY_ROSTER_MODEL_AGGREGATOR_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+typedef struct _EmpathyRosterModelAggregator EmpathyRosterModelAggregator;
+typedef struct _EmpathyRosterModelAggregatorClass EmpathyRosterModelAggregatorClass;
+typedef struct _EmpathyRosterModelAggregatorPriv EmpathyRosterModelAggregatorPriv;
+
+struct _EmpathyRosterModelAggregatorClass
+{
+  /*<private>*/
+  GObjectClass parent_class;
+};
+
+struct _EmpathyRosterModelAggregator
+{
+  /*<private>*/
+  GObject parent;
+  EmpathyRosterModelAggregatorPriv *priv;
+};
+
+GType empathy_roster_model_aggregator_get_type (void);
+
+/* TYPE MACROS */
+#define EMPATHY_TYPE_ROSTER_MODEL_AGGREGATOR \
+  (empathy_roster_model_aggregator_get_type ())
+#define EMPATHY_ROSTER_MODEL_AGGREGATOR(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+    EMPATHY_TYPE_ROSTER_MODEL_AGGREGATOR, \
+    EmpathyRosterModelAggregator))
+#define EMPATHY_ROSTER_MODEL_AGGREGATOR_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), \
+    EMPATHY_TYPE_ROSTER_MODEL_AGGREGATOR, \
+    EmpathyRosterModelAggregatorClass))
+#define EMPATHY_IS_ROSTER_MODEL_AGGREGATOR(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+    EMPATHY_TYPE_ROSTER_MODEL_AGGREGATOR))
+#define EMPATHY_IS_ROSTER_MODEL_AGGREGATOR_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), \
+    EMPATHY_TYPE_ROSTER_MODEL_AGGREGATOR))
+#define EMPATHY_ROSTER_MODEL_AGGREGATOR_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+    EMPATHY_TYPE_ROSTER_MODEL_AGGREGATOR, \
+    EmpathyRosterModelAggregatorClass))
+
+EmpathyRosterModelAggregator * empathy_roster_model_aggregator_new (void);
+
+G_END_DECLS
+
+#endif /* #ifndef __EMPATHY_ROSTER_MODEL_AGGREGATOR_H__*/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]