telepathy-glib: future-account: add dummy object

Jonny Lamb jonny at kemper.freedesktop.org
Thu May 10 07:41:17 PDT 2012


Module: telepathy-glib
Branch: master
Commit: b304e203f8a781387523fcc1102c34963937a2ac
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=b304e203f8a781387523fcc1102c34963937a2ac

Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date:   Wed Apr 25 18:02:01 2012 +0100

future-account: add dummy object

Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>

---

 telepathy-glib/Makefile.am      |    2 +
 telepathy-glib/future-account.c |  128 +++++++++++++++++++++++++++++++++++++++
 telepathy-glib/future-account.h |   64 +++++++++++++++++++
 3 files changed, 194 insertions(+), 0 deletions(-)

diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am
index 30efdb6..6847490 100644
--- a/telepathy-glib/Makefile.am
+++ b/telepathy-glib/Makefile.am
@@ -85,6 +85,7 @@ our_headers = \
     errors.h \
     exportable-channel.h \
     file-transfer-channel.h \
+    future-account.h \
     gnio-util.h \
     group-mixin.h \
     gtypes.h \
@@ -254,6 +255,7 @@ libtelepathy_glib_internal_la_SOURCES = \
     errors.c \
     exportable-channel.c \
     file-transfer-channel.c \
+    future-account.c \
     gnio-util.c \
     group-mixin.c \
     gtypes.c \
diff --git a/telepathy-glib/future-account.c b/telepathy-glib/future-account.c
new file mode 100644
index 0000000..c15eec0
--- /dev/null
+++ b/telepathy-glib/future-account.c
@@ -0,0 +1,128 @@
+/*
+ * future-account.c - object for a currently non-existent account to create
+ *
+ * Copyright © 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 "telepathy-glib/future-account.h"
+
+#define DEBUG_FLAG TP_DEBUG_ACCOUNTS
+#include "telepathy-glib/debug-internal.h"
+
+/**
+ * SECTION:future-account
+ * @title: TpFutureAccount
+ * @short_description: object for a currently non-existent account in
+ *   order to create easily without knowing speaking fluent D-Bus
+ * @see_also: #TpAccountManager
+ *
+ * TODO
+ *
+ * Since: 0.UNRELEASED
+ */
+
+/**
+ * TpFutureAccount:
+ *
+ * TODO
+ *
+ * Since: 0.UNRELEASED
+ */
+
+/**
+ * TpFutureAccountClass:
+ *
+ * The class of a #TpFutureAccount.
+ */
+
+struct _TpFutureAccountPrivate {
+  gboolean dispose_has_run;
+};
+
+G_DEFINE_TYPE (TpFutureAccount, tp_future_account, G_TYPE_OBJECT)
+
+/* signals */
+enum {
+  LAST_SIGNAL
+};
+
+/*static guint signals[LAST_SIGNAL];*/
+
+/* properties */
+enum {
+  N_PROPS
+};
+
+static void
+tp_future_account_init (TpFutureAccount *self)
+{
+  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_FUTURE_ACCOUNT,
+      TpFutureAccountPrivate);
+}
+
+static void
+tp_future_account_dispose (GObject *object)
+{
+  TpFutureAccount *self = TP_FUTURE_ACCOUNT (object);
+  TpFutureAccountPrivate *priv = self->priv;
+
+  if (priv->dispose_has_run)
+    return;
+
+  priv->dispose_has_run = TRUE;
+
+  /* release any references held by the object here */
+
+  if (G_OBJECT_CLASS (tp_future_account_parent_class)->dispose != NULL)
+    G_OBJECT_CLASS (tp_future_account_parent_class)->dispose (object);
+}
+
+static void
+tp_future_account_finalize (GObject *object)
+{
+  /* free any data held directly by the object here */
+
+  if (G_OBJECT_CLASS (tp_future_account_parent_class)->finalize != NULL)
+    G_OBJECT_CLASS (tp_future_account_parent_class)->finalize (object);
+}
+
+static void
+tp_future_account_class_init (TpFutureAccountClass *klass)
+{
+  GObjectClass *object_class = (GObjectClass *) klass;
+
+  g_type_class_add_private (klass, sizeof (TpFutureAccountPrivate));
+
+  object_class->dispose = tp_future_account_dispose;
+  object_class->finalize = tp_future_account_finalize;
+}
+
+/**
+ * tp_future_account_new:
+ *
+ * Convenience function to create a new future account object.
+ *
+ * Returns: a new reference to a future account object, or %NULL
+ */
+TpFutureAccount *
+tp_future_account_new (void)
+{
+  return g_object_new (TP_TYPE_FUTURE_ACCOUNT, NULL);
+}
+
diff --git a/telepathy-glib/future-account.h b/telepathy-glib/future-account.h
new file mode 100644
index 0000000..df7e31a
--- /dev/null
+++ b/telepathy-glib/future-account.h
@@ -0,0 +1,64 @@
+/*
+ * future-account.h - object for a currently non-existent account to create
+ *
+ * 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 TP_FUTURE_ACCOUNT_H
+#define TP_FUTURE_ACCOUNT_H
+
+G_BEGIN_DECLS
+
+typedef struct _TpFutureAccount TpFutureAccount;
+typedef struct _TpFutureAccountClass TpFutureAccountClass;
+typedef struct _TpFutureAccountPrivate TpFutureAccountPrivate;
+
+struct _TpFutureAccount {
+    /*<private>*/
+    GObject parent;
+    TpFutureAccountPrivate *priv;
+};
+
+struct _TpFutureAccountClass {
+    /*<private>*/
+    GObjectClass parent_class;
+    GCallback _padding[7];
+};
+
+GType tp_future_account_get_type (void);
+
+#define TP_TYPE_FUTURE_ACCOUNT \
+  (tp_future_account_get_type ())
+#define TP_FUTURE_ACCOUNT(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_FUTURE_ACCOUNT, \
+                               TpFutureAccount))
+#define TP_FUTURE_ACCOUNT_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_FUTURE_ACCOUNT, \
+                            TpFutureAccountClass))
+#define TP_IS_FUTURE_ACCOUNT(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_FUTURE_ACCOUNT))
+#define TP_IS_FUTURE_ACCOUNT_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_FUTURE_ACCOUNT))
+#define TP_FUTURE_ACCOUNT_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_FUTURE_ACCOUNT, \
+                              TpFutureAccountClass))
+
+TpFutureAccount * tp_future_account_new (void) G_GNUC_WARN_UNUSED_RESULT;
+
+G_END_DECLS
+
+#endif



More information about the telepathy-commits mailing list