From: Jorn Baayen Date: Thu, 20 Apr 2006 08:08:37 +0000 (+0000) Subject: Added GSSDPService dummy implementation X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b3c0f3ef2f29de95faa8a697a79c50bdce885be;p=profile%2Fivi%2FGSSDP.git Added GSSDPService dummy implementation git-svn-id: https://svn.o-hand.com/repos/gupnp/gssdp@122 d8cb91d7-bff9-0310-92b9-80b65e4482b2 --- diff --git a/libgssdp/Makefile.am b/libgssdp/Makefile.am index 1a00d44..c290f21 100644 --- a/libgssdp/Makefile.am +++ b/libgssdp/Makefile.am @@ -12,7 +12,8 @@ libgssdpinc_HEADERS = gssdp-device.h \ libgssdp_1_0_la_SOURCES = gssdp-device.c \ gssdp-device-private.h \ - gssdp-discoverable.c + gssdp-discoverable.c \ + gssdp-service.c libgssdp_1_0_la_LIBADD = $(LIBGSSDP_LIBS) diff --git a/libgssdp/gssdp-device.c b/libgssdp/gssdp-device.c index 7f90710..d8d9f3b 100644 --- a/libgssdp/gssdp-device.c +++ b/libgssdp/gssdp-device.c @@ -24,7 +24,6 @@ #include #include -#include "gssdp-device.h" #include "gssdp-device-private.h" /* Hack around G_DEFINE_TYPE hardcoding the type function name */ diff --git a/libgssdp/gssdp-service.c b/libgssdp/gssdp-service.c new file mode 100644 index 0000000..5e696f1 --- /dev/null +++ b/libgssdp/gssdp-service.c @@ -0,0 +1,77 @@ +/* + * (C) 2006 OpenedHand Ltd. + * + * Author: Jorn Baayen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* XXX connect to "notify::available" and handle actual advertisement */ + +#include + +#include "gssdp-service.h" + +/* Hack around G_DEFINE_TYPE hardcoding the type function name */ +#define gssdp_service_get_type gssdp_service_type + +G_DEFINE_TYPE (GSSDPService, + gssdp_service, + GSSDP_TYPE_DISCOVERABLE); + +#undef gssdp_service_get_type + +struct _GSSDPServicePrivate { +}; + +static void +gssdp_service_init (GSSDPService *service) +{ + service->priv = G_TYPE_INSTANCE_GET_PRIVATE + (service, + GSSDP_TYPE_SERVICE, + GSSDPServicePrivate); +} + +static void +gssdp_service_class_init (GSSDPServiceClass *klass) +{ + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GSSDPServicePrivate)); +} + +/** + * gssdp_service_new + * @parent: A #GSSDPDevice + * @type: A string identifying the type of the service + * @version: A #gushort identifying the version of the service type + * + * Return value: A new #GSSDPService object. + **/ +GSSDPService * +gssdp_service_new (GSSDPDevice *parent, + const char *type, + gushort version) +{ + return g_object_new (GSSDP_TYPE_SERVICE, + "parent", parent, + "type", type, + "version", version, + NULL); +}