diff options
author | <robert.mcqueen@collabora.co.uk> | 2006-01-21 23:27:33 +0000 |
---|---|---|
committer | <robert.mcqueen@collabora.co.uk> | 2006-01-21 23:27:33 +0000 |
commit | be422aeb9b1270c591c1bb31ba0f956ce835111a (patch) | |
tree | 50ae0095e05a46cfb379e4831d32259cb6f5fc6f /generate/src | |
parent | be3ceebcea78a97b8c11595fa55efc587bfe305f (diff) |
remove any possibility for darcs crack when moving from generated XML or generated source to the live tree, by putting the generated code in the live tree, and make whoever is doing the generation pull the changes over manually
Diffstat (limited to 'generate/src')
-rw-r--r-- | generate/src/.git-darcs-dir | 0 | ||||
-rw-r--r-- | generate/src/gabble-connection-manager-signals-marshal.list | 1 | ||||
-rw-r--r-- | generate/src/gabble-connection-manager.c | 202 | ||||
-rw-r--r-- | generate/src/gabble-connection-manager.h | 65 | ||||
-rw-r--r-- | generate/src/gabble-connection-signals-marshal.list | 2 | ||||
-rw-r--r-- | generate/src/gabble-connection.c | 320 | ||||
-rw-r--r-- | generate/src/gabble-connection.h | 71 | ||||
-rw-r--r-- | generate/src/gabble-im-channel-signals-marshal.list | 3 | ||||
-rw-r--r-- | generate/src/gabble-im-channel.c | 258 | ||||
-rw-r--r-- | generate/src/gabble-im-channel.h | 67 | ||||
-rw-r--r-- | generate/src/telepathy-errors.h | 55 |
11 files changed, 1044 insertions, 0 deletions
diff --git a/generate/src/.git-darcs-dir b/generate/src/.git-darcs-dir new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/generate/src/.git-darcs-dir diff --git a/generate/src/gabble-connection-manager-signals-marshal.list b/generate/src/gabble-connection-manager-signals-marshal.list new file mode 100644 index 000000000..41e40276c --- /dev/null +++ b/generate/src/gabble-connection-manager-signals-marshal.list @@ -0,0 +1 @@ +VOID:STRING,STRING,STRING diff --git a/generate/src/gabble-connection-manager.c b/generate/src/gabble-connection-manager.c new file mode 100644 index 000000000..a9b6e4da8 --- /dev/null +++ b/generate/src/gabble-connection-manager.c @@ -0,0 +1,202 @@ +/* + * gabble-connection-manager.c - Source for GabbleConnectionManager + * Copyright (C) 2005 Collabora Ltd. + * Copyright (C) 2005 Nokia Corporation + * + * 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 <dbus/dbus-glib.h> +#include <stdio.h> +#include <stdlib.h> + +#include "gabble-connection-manager.h" +#include "gabble-connection-manager-signals-marshal.h" + +#include "gabble-connection-manager-glue.h" + +G_DEFINE_TYPE(GabbleConnectionManager, gabble_connection_manager, G_TYPE_OBJECT) + +/* signal enum */ +enum +{ + NEW_CONNECTION, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = {0}; + +/* private structure */ +typedef struct _GabbleConnectionManagerPrivate GabbleConnectionManagerPrivate; + +struct _GabbleConnectionManagerPrivate +{ + gboolean dispose_has_run; +}; + +#define GABBLE_CONNECTION_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_CONNECTION_MANAGER, GabbleConnectionManagerPrivate)) + +static void +gabble_connection_manager_init (GabbleConnectionManager *obj) +{ + GabbleConnectionManagerPrivate *priv = GABBLE_CONNECTION_MANAGER_GET_PRIVATE (obj); + + /* allocate any data required by the object here */ +} + +static void gabble_connection_manager_dispose (GObject *object); +static void gabble_connection_manager_finalize (GObject *object); + +static void +gabble_connection_manager_class_init (GabbleConnectionManagerClass *gabble_connection_manager_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (gabble_connection_manager_class); + + g_type_class_add_private (gabble_connection_manager_class, sizeof (GabbleConnectionManagerPrivate)); + + object_class->dispose = gabble_connection_manager_dispose; + object_class->finalize = gabble_connection_manager_finalize; + + signals[NEW_CONNECTION] = + g_signal_new ("new-connection", + G_OBJECT_CLASS_TYPE (gabble_connection_manager_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + 0, + NULL, NULL, + gabble_connection_manager_marshal_VOID__STRING_STRING_STRING, + G_TYPE_NONE, 3, G_TYPE_STRING, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (gabble_connection_manager_class), &dbus_glib_gabble_connection_manager_object_info); +} + +void +gabble_connection_manager_dispose (GObject *object) +{ + GabbleConnectionManager *self = GABBLE_CONNECTION_MANAGER (object); + GabbleConnectionManagerPrivate *priv = GABBLE_CONNECTION_MANAGER_GET_PRIVATE (self); + + if (priv->dispose_has_run) + return; + + priv->dispose_has_run = TRUE; + + /* release any references held by the object here */ + + if (G_OBJECT_CLASS (gabble_connection_manager_parent_class)->dispose) + G_OBJECT_CLASS (gabble_connection_manager_parent_class)->dispose (object); +} + +void +gabble_connection_manager_finalize (GObject *object) +{ + GabbleConnectionManager *self = GABBLE_CONNECTION_MANAGER (object); + GabbleConnectionManagerPrivate *priv = GABBLE_CONNECTION_MANAGER_GET_PRIVATE (self); + + /* free any data held directly by the object here */ + + G_OBJECT_CLASS (gabble_connection_manager_parent_class)->finalize (object); +} + + + +/** + * gabble_connection_manager_connect + * + * Implements DBus method Connect + * on interface org.freedesktop.Telepathy.ConnectionManager + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_manager_connect (GabbleConnectionManager *obj, const gchar * proto, GHashTable * parameters, gchar ** ret, gchar ** ret1, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_manager_get_mandatory_parameters + * + * Implements DBus method GetMandatoryParameters + * on interface org.freedesktop.Telepathy.ConnectionManager + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_manager_get_mandatory_parameters (GabbleConnectionManager *obj, const gchar * proto, GHashTable ** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_manager_get_optional_parameters + * + * Implements DBus method GetOptionalParameters + * on interface org.freedesktop.Telepathy.ConnectionManager + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_manager_get_optional_parameters (GabbleConnectionManager *obj, const gchar * proto, GHashTable ** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_manager_get_parameter_defaults + * + * Implements DBus method GetParameterDefaults + * on interface org.freedesktop.Telepathy.ConnectionManager + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_manager_get_parameter_defaults (GabbleConnectionManager *obj, const gchar * proto, GHashTable ** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_manager_list_protocols + * + * Implements DBus method ListProtocols + * on interface org.freedesktop.Telepathy.ConnectionManager + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_manager_list_protocols (GabbleConnectionManager *obj, gchar *** ret, GError **error) +{ + return TRUE; +} + diff --git a/generate/src/gabble-connection-manager.h b/generate/src/gabble-connection-manager.h new file mode 100644 index 000000000..b095df156 --- /dev/null +++ b/generate/src/gabble-connection-manager.h @@ -0,0 +1,65 @@ +/* + * gabble-connection-manager.h - Header for GabbleConnectionManager + * Copyright (C) 2005 Collabora Ltd. + * Copyright (C) 2005 Nokia Corporation + * + * 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 __GABBLE_CONNECTION_MANAGER_H__ +#define __GABBLE_CONNECTION_MANAGER_H__ + +#include <glib-object.h> + +G_BEGIN_DECLS + +typedef struct _GabbleConnectionManager GabbleConnectionManager; +typedef struct _GabbleConnectionManagerClass GabbleConnectionManagerClass; + +struct _GabbleConnectionManagerClass { + GObjectClass parent_class; +}; + +struct _GabbleConnectionManager { + GObject parent; +}; + +GType gabble_connection_manager_get_type(void); + +/* TYPE MACROS */ +#define GABBLE_TYPE_CONNECTION_MANAGER \ + (gabble_connection_manager_get_type()) +#define GABBLE_CONNECTION_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_CONNECTION_MANAGER, GabbleConnectionManager)) +#define GABBLE_CONNECTION_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_CONNECTION_MANAGER, GabbleConnectionManagerClass)) +#define GABBLE_IS_CONNECTION_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_CONNECTION_MANAGER)) +#define GABBLE_IS_CONNECTION_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_CONNECTION_MANAGER)) +#define GABBLE_CONNECTION_MANAGER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_CONNECTION_MANAGER, GabbleConnectionManagerClass)) + + +gboolean gabble_connection_manager_connect (GabbleConnectionManager *obj, const gchar * proto, GHashTable * parameters, gchar ** ret, gchar ** ret1, GError **error); +gboolean gabble_connection_manager_get_mandatory_parameters (GabbleConnectionManager *obj, const gchar * proto, GHashTable ** ret, GError **error); +gboolean gabble_connection_manager_get_optional_parameters (GabbleConnectionManager *obj, const gchar * proto, GHashTable ** ret, GError **error); +gboolean gabble_connection_manager_get_parameter_defaults (GabbleConnectionManager *obj, const gchar * proto, GHashTable ** ret, GError **error); +gboolean gabble_connection_manager_list_protocols (GabbleConnectionManager *obj, gchar *** ret, GError **error); + + +G_END_DECLS + +#endif /* #ifndef __GABBLE_CONNECTION_MANAGER_H__*/ diff --git a/generate/src/gabble-connection-signals-marshal.list b/generate/src/gabble-connection-signals-marshal.list new file mode 100644 index 000000000..05f2d2952 --- /dev/null +++ b/generate/src/gabble-connection-signals-marshal.list @@ -0,0 +1,2 @@ +VOID:STRING,STRING,INT,INT,BOOLEAN +VOID:INT,INT diff --git a/generate/src/gabble-connection.c b/generate/src/gabble-connection.c new file mode 100644 index 000000000..5327bcc9d --- /dev/null +++ b/generate/src/gabble-connection.c @@ -0,0 +1,320 @@ +/* + * gabble-connection.c - Source for GabbleConnection + * Copyright (C) 2005 Collabora Ltd. + * Copyright (C) 2005 Nokia Corporation + * + * 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 <dbus/dbus-glib.h> +#include <stdio.h> +#include <stdlib.h> + +#include "gabble-connection.h" +#include "gabble-connection-signals-marshal.h" + +#include "gabble-connection-glue.h" + +G_DEFINE_TYPE(GabbleConnection, gabble_connection, G_TYPE_OBJECT) + +/* signal enum */ +enum +{ + NEW_CHANNEL, + STATUS_CHANGED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = {0}; + +/* private structure */ +typedef struct _GabbleConnectionPrivate GabbleConnectionPrivate; + +struct _GabbleConnectionPrivate +{ + gboolean dispose_has_run; +}; + +#define GABBLE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_CONNECTION, GabbleConnectionPrivate)) + +static void +gabble_connection_init (GabbleConnection *obj) +{ + GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (obj); + + /* allocate any data required by the object here */ +} + +static void gabble_connection_dispose (GObject *object); +static void gabble_connection_finalize (GObject *object); + +static void +gabble_connection_class_init (GabbleConnectionClass *gabble_connection_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (gabble_connection_class); + + g_type_class_add_private (gabble_connection_class, sizeof (GabbleConnectionPrivate)); + + object_class->dispose = gabble_connection_dispose; + object_class->finalize = gabble_connection_finalize; + + signals[NEW_CHANNEL] = + g_signal_new ("new-channel", + G_OBJECT_CLASS_TYPE (gabble_connection_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + 0, + NULL, NULL, + gabble_connection_marshal_VOID__STRING_STRING_INT_INT_BOOLEAN, + G_TYPE_NONE, 5, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_BOOLEAN); + + signals[STATUS_CHANGED] = + g_signal_new ("status-changed", + G_OBJECT_CLASS_TYPE (gabble_connection_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + 0, + NULL, NULL, + gabble_connection_marshal_VOID__INT_INT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (gabble_connection_class), &dbus_glib_gabble_connection_object_info); +} + +void +gabble_connection_dispose (GObject *object) +{ + GabbleConnection *self = GABBLE_CONNECTION (object); + GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (self); + + if (priv->dispose_has_run) + return; + + priv->dispose_has_run = TRUE; + + /* release any references held by the object here */ + + if (G_OBJECT_CLASS (gabble_connection_parent_class)->dispose) + G_OBJECT_CLASS (gabble_connection_parent_class)->dispose (object); +} + +void +gabble_connection_finalize (GObject *object) +{ + GabbleConnection *self = GABBLE_CONNECTION (object); + GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (self); + + /* free any data held directly by the object here */ + + G_OBJECT_CLASS (gabble_connection_parent_class)->finalize (object); +} + + + +/** + * gabble_connection_disconnect + * + * Implements DBus method Disconnect + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_disconnect (GabbleConnection *obj, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_get_interfaces + * + * Implements DBus method GetInterfaces + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_get_interfaces (GabbleConnection *obj, gchar *** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_get_protocol + * + * Implements DBus method GetProtocol + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_get_protocol (GabbleConnection *obj, gchar ** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_get_self_handle + * + * Implements DBus method GetSelfHandle + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_get_self_handle (GabbleConnection *obj, guint* ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_get_status + * + * Implements DBus method GetStatus + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_get_status (GabbleConnection *obj, guint* ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_hold_handle + * + * Implements DBus method HoldHandle + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_hold_handle (GabbleConnection *obj, guint handle_type, guint handle, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_inspect_handle + * + * Implements DBus method InspectHandle + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_inspect_handle (GabbleConnection *obj, guint handle_type, guint handle, gchar ** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_list_channels + * + * Implements DBus method ListChannels + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_list_channels (GabbleConnection *obj, GPtrArray ** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_release_handle + * + * Implements DBus method ReleaseHandle + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_release_handle (GabbleConnection *obj, guint handle_type, guint handle, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_request_channel + * + * Implements DBus method RequestChannel + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_request_channel (GabbleConnection *obj, const gchar * type, guint handle_type, guint handle, gboolean supress_handler, gchar ** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_connection_request_handle + * + * Implements DBus method RequestHandle + * on interface org.freedesktop.Telepathy.Connection + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_connection_request_handle (GabbleConnection *obj, guint handle_type, const gchar * name, guint* ret, GError **error) +{ + return TRUE; +} + diff --git a/generate/src/gabble-connection.h b/generate/src/gabble-connection.h new file mode 100644 index 000000000..80fed639d --- /dev/null +++ b/generate/src/gabble-connection.h @@ -0,0 +1,71 @@ +/* + * gabble-connection.h - Header for GabbleConnection + * Copyright (C) 2005 Collabora Ltd. + * Copyright (C) 2005 Nokia Corporation + * + * 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 __GABBLE_CONNECTION_H__ +#define __GABBLE_CONNECTION_H__ + +#include <glib-object.h> + +G_BEGIN_DECLS + +typedef struct _GabbleConnection GabbleConnection; +typedef struct _GabbleConnectionClass GabbleConnectionClass; + +struct _GabbleConnectionClass { + GObjectClass parent_class; +}; + +struct _GabbleConnection { + GObject parent; +}; + +GType gabble_connection_get_type(void); + +/* TYPE MACROS */ +#define GABBLE_TYPE_CONNECTION \ + (gabble_connection_get_type()) +#define GABBLE_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_CONNECTION, GabbleConnection)) +#define GABBLE_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_CONNECTION, GabbleConnectionClass)) +#define GABBLE_IS_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_CONNECTION)) +#define GABBLE_IS_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_CONNECTION)) +#define GABBLE_CONNECTION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_CONNECTION, GabbleConnectionClass)) + + +gboolean gabble_connection_disconnect (GabbleConnection *obj, GError **error); +gboolean gabble_connection_get_interfaces (GabbleConnection *obj, gchar *** ret, GError **error); +gboolean gabble_connection_get_protocol (GabbleConnection *obj, gchar ** ret, GError **error); +gboolean gabble_connection_get_self_handle (GabbleConnection *obj, guint* ret, GError **error); +gboolean gabble_connection_get_status (GabbleConnection *obj, guint* ret, GError **error); +gboolean gabble_connection_hold_handle (GabbleConnection *obj, guint handle_type, guint handle, GError **error); +gboolean gabble_connection_inspect_handle (GabbleConnection *obj, guint handle_type, guint handle, gchar ** ret, GError **error); +gboolean gabble_connection_list_channels (GabbleConnection *obj, GPtrArray ** ret, GError **error); +gboolean gabble_connection_release_handle (GabbleConnection *obj, guint handle_type, guint handle, GError **error); +gboolean gabble_connection_request_channel (GabbleConnection *obj, const gchar * type, guint handle_type, guint handle, gboolean supress_handler, gchar ** ret, GError **error); +gboolean gabble_connection_request_handle (GabbleConnection *obj, guint handle_type, const gchar * name, guint* ret, GError **error); + + +G_END_DECLS + +#endif /* #ifndef __GABBLE_CONNECTION_H__*/ diff --git a/generate/src/gabble-im-channel-signals-marshal.list b/generate/src/gabble-im-channel-signals-marshal.list new file mode 100644 index 000000000..b974b8a80 --- /dev/null +++ b/generate/src/gabble-im-channel-signals-marshal.list @@ -0,0 +1,3 @@ +VOID:VOID +VOID:INT,INT,INT,INT,STRING +VOID:INT,INT,STRING diff --git a/generate/src/gabble-im-channel.c b/generate/src/gabble-im-channel.c new file mode 100644 index 000000000..fd5544517 --- /dev/null +++ b/generate/src/gabble-im-channel.c @@ -0,0 +1,258 @@ +/* + * gabble-im-channel.c - Source for GabbleIMChannel + * Copyright (C) 2005 Collabora Ltd. + * Copyright (C) 2005 Nokia Corporation + * + * 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 <dbus/dbus-glib.h> +#include <stdio.h> +#include <stdlib.h> + +#include "gabble-im-channel.h" +#include "gabble-im-channel-signals-marshal.h" + +#include "gabble-im-channel-glue.h" + +G_DEFINE_TYPE(GabbleIMChannel, gabble_im_channel, G_TYPE_OBJECT) + +/* signal enum */ +enum +{ + CLOSED, + RECEIVED, + SENT, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = {0}; + +/* private structure */ +typedef struct _GabbleIMChannelPrivate GabbleIMChannelPrivate; + +struct _GabbleIMChannelPrivate +{ + gboolean dispose_has_run; +}; + +#define GABBLE_IM_CHANNEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GABBLE_TYPE_IM_CHANNEL, GabbleIMChannelPrivate)) + +static void +gabble_im_channel_init (GabbleIMChannel *obj) +{ + GabbleIMChannelPrivate *priv = GABBLE_IM_CHANNEL_GET_PRIVATE (obj); + + /* allocate any data required by the object here */ +} + +static void gabble_im_channel_dispose (GObject *object); +static void gabble_im_channel_finalize (GObject *object); + +static void +gabble_im_channel_class_init (GabbleIMChannelClass *gabble_im_channel_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (gabble_im_channel_class); + + g_type_class_add_private (gabble_im_channel_class, sizeof (GabbleIMChannelPrivate)); + + object_class->dispose = gabble_im_channel_dispose; + object_class->finalize = gabble_im_channel_finalize; + + signals[CLOSED] = + g_signal_new ("closed", + G_OBJECT_CLASS_TYPE (gabble_im_channel_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + 0, + NULL, NULL, + gabble_im_channel_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[RECEIVED] = + g_signal_new ("received", + G_OBJECT_CLASS_TYPE (gabble_im_channel_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + 0, + NULL, NULL, + gabble_im_channel_marshal_VOID__INT_INT_INT_INT_STRING, + G_TYPE_NONE, 5, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_STRING); + + signals[SENT] = + g_signal_new ("sent", + G_OBJECT_CLASS_TYPE (gabble_im_channel_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + 0, + NULL, NULL, + gabble_im_channel_marshal_VOID__INT_INT_STRING, + G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_STRING); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (gabble_im_channel_class), &dbus_glib_gabble_im_channel_object_info); +} + +void +gabble_im_channel_dispose (GObject *object) +{ + GabbleIMChannel *self = GABBLE_IM_CHANNEL (object); + GabbleIMChannelPrivate *priv = GABBLE_IM_CHANNEL_GET_PRIVATE (self); + + if (priv->dispose_has_run) + return; + + priv->dispose_has_run = TRUE; + + /* release any references held by the object here */ + + if (G_OBJECT_CLASS (gabble_im_channel_parent_class)->dispose) + G_OBJECT_CLASS (gabble_im_channel_parent_class)->dispose (object); +} + +void +gabble_im_channel_finalize (GObject *object) +{ + GabbleIMChannel *self = GABBLE_IM_CHANNEL (object); + GabbleIMChannelPrivate *priv = GABBLE_IM_CHANNEL_GET_PRIVATE (self); + + /* free any data held directly by the object here */ + + G_OBJECT_CLASS (gabble_im_channel_parent_class)->finalize (object); +} + + + +/** + * gabble_im_channel_acknowledge_pending_message + * + * Implements DBus method AcknowledgePendingMessage + * on interface org.freedesktop.Telepathy.Channel.Type.Text + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_im_channel_acknowledge_pending_message (GabbleIMChannel *obj, guint id, GError **error) +{ + return TRUE; +} + + +/** + * gabble_im_channel_close + * + * Implements DBus method Close + * on interface org.freedesktop.Telepathy.Channel + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_im_channel_close (GabbleIMChannel *obj, GError **error) +{ + return TRUE; +} + + +/** + * gabble_im_channel_get_channel_type + * + * Implements DBus method GetChannelType + * on interface org.freedesktop.Telepathy.Channel + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_im_channel_get_channel_type (GabbleIMChannel *obj, gchar ** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_im_channel_get_handle + * + * Implements DBus method GetHandle + * on interface org.freedesktop.Telepathy.Channel + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_im_channel_get_handle (GabbleIMChannel *obj, guint* ret, guint* ret1, GError **error) +{ + return TRUE; +} + + +/** + * gabble_im_channel_get_interfaces + * + * Implements DBus method GetInterfaces + * on interface org.freedesktop.Telepathy.Channel + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_im_channel_get_interfaces (GabbleIMChannel *obj, gchar *** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_im_channel_list_pending_messages + * + * Implements DBus method ListPendingMessages + * on interface org.freedesktop.Telepathy.Channel.Type.Text + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_im_channel_list_pending_messages (GabbleIMChannel *obj, GPtrArray ** ret, GError **error) +{ + return TRUE; +} + + +/** + * gabble_im_channel_send + * + * Implements DBus method Send + * on interface org.freedesktop.Telepathy.Channel.Type.Text + * + * @error: Used to return a pointer to a GError detailing any error + * that occured, DBus will throw the error only if this + * function returns false. + * + * Returns: TRUE if successful, FALSE if an error was thrown. + */ +gboolean gabble_im_channel_send (GabbleIMChannel *obj, guint type, const gchar * text, GError **error) +{ + return TRUE; +} + diff --git a/generate/src/gabble-im-channel.h b/generate/src/gabble-im-channel.h new file mode 100644 index 000000000..8cab83a77 --- /dev/null +++ b/generate/src/gabble-im-channel.h @@ -0,0 +1,67 @@ +/* + * gabble-im-channel.h - Header for GabbleIMChannel + * Copyright (C) 2005 Collabora Ltd. + * Copyright (C) 2005 Nokia Corporation + * + * 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 __GABBLE_IM_CHANNEL_H__ +#define __GABBLE_IM_CHANNEL_H__ + +#include <glib-object.h> + +G_BEGIN_DECLS + +typedef struct _GabbleIMChannel GabbleIMChannel; +typedef struct _GabbleIMChannelClass GabbleIMChannelClass; + +struct _GabbleIMChannelClass { + GObjectClass parent_class; +}; + +struct _GabbleIMChannel { + GObject parent; +}; + +GType gabble_im_channel_get_type(void); + +/* TYPE MACROS */ +#define GABBLE_TYPE_IM_CHANNEL \ + (gabble_im_channel_get_type()) +#define GABBLE_IM_CHANNEL(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_IM_CHANNEL, GabbleIMChannel)) +#define GABBLE_IM_CHANNEL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_IM_CHANNEL, GabbleIMChannelClass)) +#define GABBLE_IS_IM_CHANNEL(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_IM_CHANNEL)) +#define GABBLE_IS_IM_CHANNEL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_IM_CHANNEL)) +#define GABBLE_IM_CHANNEL_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_IM_CHANNEL, GabbleIMChannelClass)) + + +gboolean gabble_im_channel_acknowledge_pending_message (GabbleIMChannel *obj, guint id, GError **error); +gboolean gabble_im_channel_close (GabbleIMChannel *obj, GError **error); +gboolean gabble_im_channel_get_channel_type (GabbleIMChannel *obj, gchar ** ret, GError **error); +gboolean gabble_im_channel_get_handle (GabbleIMChannel *obj, guint* ret, guint* ret1, GError **error); +gboolean gabble_im_channel_get_interfaces (GabbleIMChannel *obj, gchar *** ret, GError **error); +gboolean gabble_im_channel_list_pending_messages (GabbleIMChannel *obj, GPtrArray ** ret, GError **error); +gboolean gabble_im_channel_send (GabbleIMChannel *obj, guint type, const gchar * text, GError **error); + + +G_END_DECLS + +#endif /* #ifndef __GABBLE_IM_CHANNEL_H__*/ diff --git a/generate/src/telepathy-errors.h b/generate/src/telepathy-errors.h new file mode 100644 index 000000000..dbfdef4d0 --- /dev/null +++ b/generate/src/telepathy-errors.h @@ -0,0 +1,55 @@ +/* + * telepathy-errors.h - Header for Telepathy error types + * Copyright (C) 2005 Collabora Ltd. + * Copyright (C) 2005 Nokia Corporation + * + * 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 __TELEPATHY_ERRORS_H__ +#define __TELEPATHY_ERRORS_H__ + +#include <glib-object.h> + +G_BEGIN_DECLS + +typedef enum +{ + InvalidHandle, /** The contact name specified is unknown on this channel + * or connection. + */ + Disconnected, /** The connection is not currently connected and cannot be + * used. + */ + InvalidArgument, /** Raised when one of the provided arguments is invalid. + */ + NetworkError, /** Raised when there is an error reading from or writing + * to the network. + */ + PermissionDenied, /** The user is not permitted to perform the requested + * operation. + */ + NotAvailable, /** Raised when the requested functionality is temporarily + * unavailable. + */ + NotImplemented, /** Raised when the requested method, channel, etc is not + * available on this connection. + */ +} TelepathyErrors; + + +G_END_DECLS + +#endif /* #ifndef __TELEPATHY_ERRORS_H__*/ |