Added GSSDPService dummy implementation
authorJorn Baayen <jorn@openedhand.com>
Thu, 20 Apr 2006 08:08:37 +0000 (08:08 +0000)
committerJorn Baayen <jorn@openedhand.com>
Thu, 20 Apr 2006 08:08:37 +0000 (08:08 +0000)
git-svn-id: https://svn.o-hand.com/repos/gupnp/gssdp@122 d8cb91d7-bff9-0310-92b9-80b65e4482b2

libgssdp/Makefile.am
libgssdp/gssdp-device.c
libgssdp/gssdp-service.c [new file with mode: 0644]

index 1a00d44..c290f21 100644 (file)
@@ -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)
 
index 7f90710..d8d9f3b 100644 (file)
@@ -24,7 +24,6 @@
 #include <config.h>
 #include <uuid/uuid.h>
 
-#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 (file)
index 0000000..5e696f1
--- /dev/null
@@ -0,0 +1,77 @@
+/* 
+ * (C) 2006 OpenedHand Ltd.
+ *
+ * Author: Jorn Baayen <jorn@openedhand.com>
+ *
+ * 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 <config.h>
+
+#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);
+}