diff options
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | docs/reference/ytstenut-glib/Makefile.am | 10 | ||||
-rw-r--r-- | docs/reference/ytstenut-glib/ytstenut-glib-docs.xml.in | 11 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-caps.h | 7 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-client.c | 44 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-contact.c | 18 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-debug.h | 36 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-error.c | 26 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-error.h | 1 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-message.c | 7 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-metadata-service.c | 28 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-metadata.c | 7 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-roster.c | 25 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-service.c | 35 | ||||
-rw-r--r-- | ytstenut-glib/ytsg-status.c | 8 |
15 files changed, 254 insertions, 13 deletions
diff --git a/Makefile.am b/Makefile.am index 8b7fdee..a9684c8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -#SUBDIRS=ytstenut-glib docs tests -SUBDIRS=ytstenut-glib tests +SUBDIRS=ytstenut-glib docs tests +#SUBDIRS=ytstenut-glib tests #DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc diff --git a/docs/reference/ytstenut-glib/Makefile.am b/docs/reference/ytstenut-glib/Makefile.am index c396cea..6924ba9 100644 --- a/docs/reference/ytstenut-glib/Makefile.am +++ b/docs/reference/ytstenut-glib/Makefile.am @@ -7,7 +7,7 @@ AUTOMAKE_OPTIONS = 1.6 DOC_MODULE=ytstenut-glib # Uncomment for versioned docs and specify the version of the module, e.g. '2'. -#DOC_MODULE_VERSION=$(YTSTENUT_VERSION) +#DOC_MODULE_VERSION=$(YTSG_VERSION) # The top-level SGML file. You can change this if you want to. @@ -55,8 +55,8 @@ EXTRA_HFILES= # Header files to ignore when scanning. Use base file name, no paths # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES= \ - ns-marshal.h \ - ns-enum-types.h + ytsg-marshal.h \ + ytsg-enum-types.h # Images to copy into HTML directory. @@ -77,8 +77,8 @@ expand_content_files= # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) -INCLUDES=-I$(top_srcdir)/ytstenut-glib $(YTSTENUT_CFLAGS) -GTKDOC_LIBS=$(top_builddir)/ytstenut-glib/libytstenut-glib-@YTSTENUT_API_VERSION@.la $(YTSTENUT_LIBS) +INCLUDES=-I$(top_srcdir)/ytstenut-glib $(YTSG_CFLAGS) +GTKDOC_LIBS=$(top_builddir)/ytstenut-glib/libytstenut-glib-@YTSG_API_VERSION@.la $(YTSG_LIBS) # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make diff --git a/docs/reference/ytstenut-glib/ytstenut-glib-docs.xml.in b/docs/reference/ytstenut-glib/ytstenut-glib-docs.xml.in index 80e8445..14cc204 100644 --- a/docs/reference/ytstenut-glib/ytstenut-glib-docs.xml.in +++ b/docs/reference/ytstenut-glib/ytstenut-glib-docs.xml.in @@ -37,7 +37,7 @@ </legalnotice> </bookinfo> - <!-- <xi:include href="xml/overview.xml"/> --> + <xi:include href="xml/overview.xml"/> <part id="ytsg-reference"> @@ -46,7 +46,14 @@ <chapter id="ytsg-classes"> <title>Ytstenut-glib Objects</title> -<!-- <xi:include href="xml/ns-client.xml"/> --> + <xi:include href="xml/ytsg-client.xml"/> + <xi:include href="xml/ytsg-roster.xml"/> + <xi:include href="xml/ytsg-contact.xml"/> + <xi:include href="xml/ytsg-service.xml"/> + <xi:include href="xml/ytsg-metadata-service.xml"/> + <xi:include href="xml/ytsg-metadata.xml"/> + <xi:include href="xml/ytsg-status.xml"/> + <xi:include href="xml/ytsg-message.xml"/> </chapter> diff --git a/ytstenut-glib/ytsg-caps.h b/ytstenut-glib/ytsg-caps.h index 34c9a2b..ce7d180 100644 --- a/ytstenut-glib/ytsg-caps.h +++ b/ytstenut-glib/ytsg-caps.h @@ -19,6 +19,13 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ +/** + * SECTION:ytsg-caps + * @short_description: represents application capability. + * + * #YtsgCaps represents application capability. + */ + #ifndef _YTSG_CAPS_H #define _YTSG_CAPS_H diff --git a/ytstenut-glib/ytsg-client.c b/ytstenut-glib/ytsg-client.c index 67242bb..04a971c 100644 --- a/ytstenut-glib/ytsg-client.c +++ b/ytstenut-glib/ytsg-client.c @@ -19,6 +19,15 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ +/** + * SECTION:ytsg-client + * @short_description: Object representing the service connecting to the + * Ytstenut mesh. + * + * #YtsgClient is an object that mediates connection between the current + * application and the Ytstenut application mesh. + */ + #include "ytsg-client.h" #include "ytsg-debug.h" #include "ytsg-enum-types.h" @@ -1909,6 +1918,15 @@ ytsg_client_set_capabilities (YtsgClient *client, YtsgCaps caps) g_object_notify ((GObject*)client, "capabilities"); } +/** + * ytsg_client_get_roster: + * @client: #YtsgClient + * + * Gets the #YtsgRoster for this client. The object is owned by the client + * and must not be freed by the caller. + * + * Return value (tranfer none): #YtsgRoster. + */ YtsgRoster * ytsg_client_get_roster (YtsgClient *client) { @@ -1983,6 +2001,9 @@ ytsg_client_set_incoming_file_directory (YtsgClient *client, * ytsg_client_get_incoming_file_directory: * @client: #YtsgClient * + * Returns the directory into which any files from incoming file transfers will + * be placed. + * * Return value: (tranfer none): directory where incoming files are stored. */ const char * @@ -1997,6 +2018,14 @@ ytsg_client_get_incoming_file_directory (YtsgClient *client) return priv->incoming_dir; } +/** + * ytsg_client_get_jid: + * @client: #YtsgClient + * + * Returns the jabber id associated with the current client. + * + * Return value: the jabber id. + */ const char * ytsg_client_get_jid (const YtsgClient *client) { @@ -2011,6 +2040,14 @@ ytsg_client_get_jid (const YtsgClient *client) return NULL; } +/** + * ytsg_client_get_uid: + * @client: #YtsgClient + * + * Returns uid of the service this client represents. + * + * Return value: the service uid. + */ const char * ytsg_client_get_uid (const YtsgClient *client) { @@ -2047,6 +2084,13 @@ _ytsg_client_get_tp_status (YtsgClient *client) return priv->tp_status; } +/** + * ytsg_client_set_status: + * @client: #YtsgClient + * @status: new #YtsgStatus + * + * Changes the status of the service represented by this client to status. + */ void ytsg_client_set_status (YtsgClient *client, YtsgStatus *status) { diff --git a/ytstenut-glib/ytsg-contact.c b/ytstenut-glib/ytsg-contact.c index fc87424..acf4d47 100644 --- a/ytstenut-glib/ytsg-contact.c +++ b/ytstenut-glib/ytsg-contact.c @@ -19,6 +19,14 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ +/** + * SECTION:ytsg-contact + * @short_description: Object representing a device connected to the Ytstenut + * mesh. + * + * #YtsgContact represents a known device in the Ytstenut application mesh. + */ + #include <string.h> #include <telepathy-glib/gtypes.h> #include <telepathy-glib/connection.h> @@ -583,6 +591,16 @@ _ytsg_contact_new (YtsgClient *client, const char *jid) NULL); } +/** + * ytsg_contact_get_tp_contact: + * @contact: #YtsgContact + * + * Retrieves the #TpContact associated with this #YtsgContact object; can be + * %NULL. When the #TpContact is available, the YtsgContact::notify-tp-contact + * signal will be emitted. + * + * Return value (transfer none): The associated #TpContact. + */ TpContact * ytsg_contact_get_tp_contact (const YtsgContact *contact) { diff --git a/ytstenut-glib/ytsg-debug.h b/ytstenut-glib/ytsg-debug.h index fe8f3e7..f6cccfc 100644 --- a/ytstenut-glib/ytsg-debug.h +++ b/ytstenut-glib/ytsg-debug.h @@ -30,6 +30,18 @@ G_BEGIN_DECLS +/** + * YtsgProtocol: + * @YTSG_DEBUG_CLIENT: debug client + * @YTSG_DEBUG_ROSTER: debug roster + * @YTSG_DEBUG_STATUS: debug status + * @YTSG_DEBUG_TP: debug telepathy + * @YTSG_DEBUG_MANAGER: debug manager + * @YTSG_DEBUG_MESSAGE: debug messages + * @YTSG_DEBUG_FILE_TRANSFER: debug file transfer + * @YTSG_DEBUG_CONTACT: debug contact + * + */ typedef enum { YTSG_DEBUG_CLIENT = 0x001, YTSG_DEBUG_ROSTER = 0x002, @@ -43,6 +55,30 @@ typedef enum { #ifdef YTSG_ENABLE_DEBUG +/** + * YTSG_NOTE: + * @type: the note type + * @x: the note text, printf-like formatting allowed + * @a...: parmaters, if any + * + * Prints a note to stdout + */ + +/** + * YTSG_TIMESTAMP: + * @type: the note type + * @x: the note text, printf-like formatting allowed + * @a...: parmaters, if any + * + * Prints a note with a timestamp to stdout. + */ + +/** + * YTSG_MARK: + * + * Prints a mark to stdout. + */ + #ifdef __GNUC__ #define YTSG_NOTE(type,x,a...) G_STMT_START { \ if (ytsg_debug_flags & YTSG_DEBUG_##type) \ diff --git a/ytstenut-glib/ytsg-error.c b/ytstenut-glib/ytsg-error.c index b23ad7f..69a498d 100644 --- a/ytstenut-glib/ytsg-error.c +++ b/ytstenut-glib/ytsg-error.c @@ -1,9 +1,29 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* - * Copyright (c) 2010 Intel Corp. + * Copyright (c) 2011 Intel Corp. * * Author: Tomas Frydrych <tf@linux.intel.com> + * + * 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 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, see <http://www.gnu.org/licenses/>. + */ + +/** + * SECTION:ytsg-error + * @short_description: and error object. + * + * #YtsgError represents an errror in asynchronous operations. */ #ifdef HAVE_CONFIG_H @@ -16,6 +36,8 @@ * ytsg_error_get_code: * @error: #YtsgError * + * Retrives error code from #YtsgError. + * * Return value: the error code represented by this #YtsgError. */ guint @@ -28,6 +50,8 @@ ytsg_error_get_code (YtsgError error) * ytsg_error_get_atom: * @error: #YtsgError * + * Retrieves the atom identifying the origin of this error from #YtsgError. + * * Return value: the atom identifying the operation represented by this * #YtsgError. */ diff --git a/ytstenut-glib/ytsg-error.h b/ytstenut-glib/ytsg-error.h index cfaafe3..af6d512 100644 --- a/ytstenut-glib/ytsg-error.h +++ b/ytstenut-glib/ytsg-error.h @@ -28,7 +28,6 @@ G_BEGIN_DECLS * @YTSG_ERROR_NOT_ALLOWED: the operation is not allowed. * @YTSG_ERROR_NO_ROUTE: no route to complete the operation * @YTSG_ERROR_UNKNOWN: some other,unspecified, error condition. - * * @YTSG_ERROR_CUSTOM_START: custom error codes can start at this value * @YTSG_ERROR_CUSTOM_END: custom error code must not exceed this value * diff --git a/ytstenut-glib/ytsg-message.c b/ytstenut-glib/ytsg-message.c index 2515996..d0f293e 100644 --- a/ytstenut-glib/ytsg-message.c +++ b/ytstenut-glib/ytsg-message.c @@ -19,6 +19,13 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ +/** + * SECTION:ytsg-message + * @short_description: Object encapsulating a Ytstenut metadata message. + * + * #YtsgMessage represents a Ytstenut metadata message. + */ + #include "ytsg-message.h" #include "ytsg-private.h" diff --git a/ytstenut-glib/ytsg-metadata-service.c b/ytstenut-glib/ytsg-metadata-service.c index 686fd52..1613e34 100644 --- a/ytstenut-glib/ytsg-metadata-service.c +++ b/ytstenut-glib/ytsg-metadata-service.c @@ -1,5 +1,33 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2011 Intel Corp. + * + * Author: Tomas Frydrych <tf@linux.intel.com> + * + * 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 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, see <http://www.gnu.org/licenses/>. + */ + +/** + * SECTION:ytsg-metadata-service + * @short_description: Object representing a metadata service connected to the + * Ytstenut mesh. + * + * #YtsgMetadataService represents a known metadata service in the Ytstenut + * application mesh. + */ + #include <string.h> #include <telepathy-glib/util.h> diff --git a/ytstenut-glib/ytsg-metadata.c b/ytstenut-glib/ytsg-metadata.c index 78d40c7..68fb56d 100644 --- a/ytstenut-glib/ytsg-metadata.c +++ b/ytstenut-glib/ytsg-metadata.c @@ -19,6 +19,13 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ +/** + * SECTION:ytsg-matadata + * @short_description: base class for #YtsgStatus and #YtsgMessage. + * + * #YtsgMetadata is a base class for Ytstenut metadata classes. + */ + #include "ytsg-metadata.h" #include "ytsg-private.h" #include "ytsg-message.h" diff --git a/ytstenut-glib/ytsg-roster.c b/ytstenut-glib/ytsg-roster.c index d52444b..1e62591 100644 --- a/ytstenut-glib/ytsg-roster.c +++ b/ytstenut-glib/ytsg-roster.c @@ -19,6 +19,15 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ +/** + * SECTION:ytsg-roster + * @short_description: Object representing a roster of devices and services + * connected to the Ytstenut application mesh. + * + * #YtsgRoster represents all known devices and services in the Ytstenut + * application mesh. + */ + #include "ytsg-client.h" #include "ytsg-contact.h" #include "ytsg-marshal.h" @@ -100,6 +109,8 @@ ytsg_roster_class_init (YtsgRosterClass *klass) * @roster: #YtsgRoster object which emitted the signal, * @contact: #YtsgContact that was added. * + * Emitted when contact is added to the roster. + * * Since: 0.1 */ signals[CONTACT_ADDED] = @@ -117,8 +128,9 @@ ytsg_roster_class_init (YtsgRosterClass *klass) * @roster: #YtsgRoster object which emitted the signal, * @contact: #YtsgContact that was removed. * - * Applications that connected signal handlers to the contact, should disconnect - * them when this signal is emitted. + * Emitted when contact is removed from the roster. Applications that + * connected signal handlers to the contact, should disconnect them when this + * signal is emitted. * * Since: 0.1 */ @@ -419,6 +431,15 @@ _ytsg_roster_new (YtsgClient *client) NULL); } +/** + * ytsg_roster_get_client: + * @roster: #YtsgRoster + * + * Retrieves the #YtsgClient associated with this roster; the client object + * must not be freed by the caller. + * + * Return value (transfer none): #YtsgClient. + */ YtsgClient* ytsg_roster_get_client (YtsgRoster *roster) { diff --git a/ytstenut-glib/ytsg-service.c b/ytstenut-glib/ytsg-service.c index 70f246b..0a2cd7b 100644 --- a/ytstenut-glib/ytsg-service.c +++ b/ytstenut-glib/ytsg-service.c @@ -19,6 +19,14 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ +/** + * SECTION:ytsg-service + * @short_description: Object representing a service connected to the Ytstenut + * mesh. + * + * #YtsgService represents a known service in the Ytstenut application mesh. + */ + #include "ytsg-service.h" #include "ytsg-metadata-service.h" #include "ytsg-client.h" @@ -219,6 +227,33 @@ ytsg_service_get_uid (YtsgService *service) return service->priv->uid; } +/** + * ytsg_service_get_jid: + * @service: #YtsgService + * + * Returns the jid of the the client on which th given service is running. The + * returned pointer is to a canonical representation created with + * g_intern_string(). + * + * Return value: (transfer none): the jid. + */ +const char * +ytsg_service_get_jid (YtsgService *service) +{ + g_return_val_if_fail (YTSG_IS_SERVICE (service), NULL); + + return service->priv->jid; +} + +/** + * ytsg_service_get_client: + * @service: #YtsgService + * + * Retrieves the #YtsgClient associated with this service; the client object + * must not be freed by the caller. + * + * Return value (transfer none): #YtsgClient. + */ YtsgClient* ytsg_service_get_client (YtsgService *service) { diff --git a/ytstenut-glib/ytsg-status.c b/ytstenut-glib/ytsg-status.c index 47919f1..b1ab706 100644 --- a/ytstenut-glib/ytsg-status.c +++ b/ytstenut-glib/ytsg-status.c @@ -19,6 +19,14 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ +/** + * SECTION:ytsg-status + * @short_description: Object representing a service connected to the Ytstenut + * mesh. + * + * #YtsgStatus represents a known service in the Ytstenut application mesh. + */ + #include <string.h> #include <rest/rest-xml-node.h> |