[Telepathy-commits] [telepathy-glib/master] extended CM example: rename ExampleConnection to ExampleExtendedConnection
Simon McVittie
simon.mcvittie at collabora.co.uk
Wed Jan 7 07:49:28 PST 2009
---
examples/cm/extended/conn.c | 32 +++++++++---------
examples/cm/extended/conn.h | 50 ++++++++++++++--------------
examples/cm/extended/connection-manager.c | 4 +-
3 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/examples/cm/extended/conn.c b/examples/cm/extended/conn.c
index 70c8629..7cc274c 100644
--- a/examples/cm/extended/conn.c
+++ b/examples/cm/extended/conn.c
@@ -24,8 +24,8 @@
static void _hats_iface_init (gpointer, gpointer);
-G_DEFINE_TYPE_WITH_CODE (ExampleConnection,
- example_connection,
+G_DEFINE_TYPE_WITH_CODE (ExampleExtendedConnection,
+ example_extended_connection,
TP_TYPE_BASE_CONNECTION,
G_IMPLEMENT_INTERFACE (EXAMPLE_TYPE_SVC_CONNECTION_INTERFACE_HATS,
_hats_iface_init))
@@ -38,7 +38,7 @@ enum
N_PROPS
};
-struct _ExampleConnectionPrivate
+struct _ExampleExtendedConnectionPrivate
{
gchar *account;
@@ -49,10 +49,10 @@ struct _ExampleConnectionPrivate
};
static void
-example_connection_init (ExampleConnection *self)
+example_extended_connection_init (ExampleExtendedConnection *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CONNECTION,
- ExampleConnectionPrivate);
+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_EXTENDED_CONNECTION,
+ ExampleExtendedConnectionPrivate);
self->priv->hat_color = g_strdup ("");
self->priv->hat_style = EXAMPLE_HAT_STYLE_NONE;
@@ -66,7 +66,7 @@ get_property (GObject *object,
GValue *value,
GParamSpec *spec)
{
- ExampleConnection *self = EXAMPLE_CONNECTION (object);
+ ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (object);
switch (property_id) {
case PROP_ACCOUNT:
@@ -83,7 +83,7 @@ set_property (GObject *object,
const GValue *value,
GParamSpec *spec)
{
- ExampleConnection *self = EXAMPLE_CONNECTION (object);
+ ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (object);
switch (property_id) {
case PROP_ACCOUNT:
@@ -98,19 +98,19 @@ set_property (GObject *object,
static void
finalize (GObject *object)
{
- ExampleConnection *self = EXAMPLE_CONNECTION (object);
+ ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (object);
g_free (self->priv->account);
g_free (self->priv->hat_color);
g_hash_table_destroy (self->priv->hat_properties);
- G_OBJECT_CLASS (example_connection_parent_class)->finalize (object);
+ G_OBJECT_CLASS (example_extended_connection_parent_class)->finalize (object);
}
static gchar *
get_unique_connection_name (TpBaseConnection *conn)
{
- ExampleConnection *self = EXAMPLE_CONNECTION (conn);
+ ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (conn);
return g_strdup (self->priv->account);
}
@@ -149,7 +149,7 @@ static gboolean
start_connecting (TpBaseConnection *conn,
GError **error)
{
- ExampleConnection *self = EXAMPLE_CONNECTION (conn);
+ ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (conn);
TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn,
TP_HANDLE_TYPE_CONTACT);
@@ -176,7 +176,7 @@ shut_down (TpBaseConnection *conn)
}
static void
-example_connection_class_init (ExampleConnectionClass *klass)
+example_extended_connection_class_init (ExampleExtendedConnectionClass *klass)
{
TpBaseConnectionClass *base_class =
(TpBaseConnectionClass *) klass;
@@ -189,7 +189,7 @@ example_connection_class_init (ExampleConnectionClass *klass)
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
- g_type_class_add_private (klass, sizeof (ExampleConnectionPrivate));
+ g_type_class_add_private (klass, sizeof (ExampleExtendedConnectionPrivate));
base_class->create_handle_repos = create_handle_repos;
base_class->get_unique_connection_name = get_unique_connection_name;
@@ -211,7 +211,7 @@ my_get_hats (ExampleSvcConnectionInterfaceHats *iface,
const GArray *contacts,
DBusGMethodInvocation *context)
{
- ExampleConnection *self = EXAMPLE_CONNECTION (iface);
+ ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (iface);
TpBaseConnection *base = (TpBaseConnection *) self;
TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base,
TP_HANDLE_TYPE_CONTACT);
@@ -283,7 +283,7 @@ my_set_hat (ExampleSvcConnectionInterfaceHats *iface,
GHashTable *properties,
DBusGMethodInvocation *context)
{
- ExampleConnection *self = EXAMPLE_CONNECTION (iface);
+ ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (iface);
TpBaseConnection *base = (TpBaseConnection *) self;
g_free (self->priv->hat_color);
diff --git a/examples/cm/extended/conn.h b/examples/cm/extended/conn.h
index 20e8968..1d23be1 100644
--- a/examples/cm/extended/conn.h
+++ b/examples/cm/extended/conn.h
@@ -9,47 +9,47 @@
* notice and this notice are preserved.
*/
-#ifndef __EXAMPLE_CONN_H__
-#define __EXAMPLE_CONN_H__
+#ifndef __EXAMPLE_EXTENDED_CONN_H__
+#define __EXAMPLE_EXTENDED_CONN_H__
#include <glib-object.h>
#include <telepathy-glib/base-connection.h>
G_BEGIN_DECLS
-typedef struct _ExampleConnection ExampleConnection;
-typedef struct _ExampleConnectionClass ExampleConnectionClass;
-typedef struct _ExampleConnectionPrivate ExampleConnectionPrivate;
+typedef struct _ExampleExtendedConnection ExampleExtendedConnection;
+typedef struct _ExampleExtendedConnectionClass ExampleExtendedConnectionClass;
+typedef struct _ExampleExtendedConnectionPrivate ExampleExtendedConnectionPrivate;
-struct _ExampleConnectionClass {
+struct _ExampleExtendedConnectionClass {
TpBaseConnectionClass parent_class;
};
-struct _ExampleConnection {
+struct _ExampleExtendedConnection {
TpBaseConnection parent;
- ExampleConnectionPrivate *priv;
+ ExampleExtendedConnectionPrivate *priv;
};
-GType example_connection_get_type (void);
+GType example_extended_connection_get_type (void);
/* TYPE MACROS */
-#define EXAMPLE_TYPE_CONNECTION \
- (example_connection_get_type ())
-#define EXAMPLE_CONNECTION(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_CONNECTION, \
- ExampleConnection))
-#define EXAMPLE_CONNECTION_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_CONNECTION, \
- ExampleConnectionClass))
-#define EXAMPLE_IS_CONNECTION(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_CONNECTION))
-#define EXAMPLE_IS_CONNECTION_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_CONNECTION))
-#define EXAMPLE_CONNECTION_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CONNECTION, \
- ExampleConnectionClass))
+#define EXAMPLE_TYPE_EXTENDED_CONNECTION \
+ (example_extended_connection_get_type ())
+#define EXAMPLE_EXTENDED_CONNECTION(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_EXTENDED_CONNECTION, \
+ ExampleExtendedConnection))
+#define EXAMPLE_EXTENDED_CONNECTION_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_EXTENDED_CONNECTION, \
+ ExampleExtendedConnectionClass))
+#define EXAMPLE_IS_EXTENDED_CONNECTION(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_EXTENDED_CONNECTION))
+#define EXAMPLE_IS_EXTENDED_CONNECTION_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_EXTENDED_CONNECTION))
+#define EXAMPLE_EXTENDED_CONNECTION_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_EXTENDED_CONNECTION, \
+ ExampleExtendedConnectionClass))
G_END_DECLS
-#endif /* #ifndef __EXAMPLE_CONN_H__ */
+#endif
diff --git a/examples/cm/extended/connection-manager.c b/examples/cm/extended/connection-manager.c
index 5a1087b..0362e19 100644
--- a/examples/cm/extended/connection-manager.c
+++ b/examples/cm/extended/connection-manager.c
@@ -74,8 +74,8 @@ new_connection (TpBaseConnectionManager *self,
GError **error)
{
ExampleParams *params = parsed_params;
- ExampleConnection *conn = EXAMPLE_CONNECTION
- (g_object_new (EXAMPLE_TYPE_CONNECTION,
+ ExampleExtendedConnection *conn = EXAMPLE_EXTENDED_CONNECTION
+ (g_object_new (EXAMPLE_TYPE_EXTENDED_CONNECTION,
"account", params->account,
"protocol", proto,
NULL));
--
1.5.6.5
More information about the Telepathy-commits
mailing list