start wfits test extension
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Thu, 6 Dec 2012 23:33:23 +0000 (15:33 -0800)
committerU. Artie Eoff <ullysses.a.eoff@intel.com>
Thu, 6 Dec 2012 23:33:23 +0000 (15:33 -0800)
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
configure.ac
src/Makefile.am
src/extensions/Makefile.am [new file with mode: 0644]
src/extensions/protocol/Makefile.am [new file with mode: 0644]
src/extensions/protocol/wayland-fits.xml [new file with mode: 0644]
src/extensions/weston/.gitignore [new file with mode: 0644]
src/extensions/weston/Makefile.am [new file with mode: 0644]
src/extensions/weston/weston-wfits.c [new file with mode: 0644]

index e0b165a..6e04132 100644 (file)
@@ -22,13 +22,19 @@ LT_INIT
 PKG_CHECK_MODULES([CHECK], [check >= 0.9.8])
 PKG_CHECK_MODULES(CAIRO, [cairo >= 1.10.0])
 PKG_CHECK_MODULES(WAYLAND, [wayland-client wayland-egl])
+PKG_CHECK_MODULES(WAYLAND_SERVER, [wayland-server])
 PKG_CHECK_MODULES(EFL, [elementary ecore-wayland evas-wayland-egl evas-wayland-shm])
 
 # TODO: Add support to conditionally build EFL suite, Core suite, etc...
 
+WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/extensions/protocol'])
+
 AC_CONFIG_FILES([Makefile
                 src/Makefile
                 src/common/Makefile
                 src/core/Makefile
-                src/efl/Makefile])
+                src/efl/Makefile
+                src/extensions/Makefile
+                src/extensions/weston/Makefile
+                src/extensions/protocol/Makefile])
 AC_OUTPUT
index 13b1480..103889e 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = common core efl
+SUBDIRS = common core efl extensions
 
 TESTS = wfits
 
diff --git a/src/extensions/Makefile.am b/src/extensions/Makefile.am
new file mode 100644 (file)
index 0000000..ad9320b
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = protocol weston
diff --git a/src/extensions/protocol/Makefile.am b/src/extensions/protocol/Makefile.am
new file mode 100644 (file)
index 0000000..82ef692
--- /dev/null
@@ -0,0 +1,2 @@
+EXTRA_DIST =                   \
+       wayland-fits.xml
diff --git a/src/extensions/protocol/wayland-fits.xml b/src/extensions/protocol/wayland-fits.xml
new file mode 100644 (file)
index 0000000..1911375
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="wayland_fits">
+
+  <copyright>
+    Copyright © 2012 Intel Corporation
+
+    Permission to use, copy, modify, distribute, and sell this
+    software and its documentation for any purpose is hereby granted
+    without fee, provided that the above copyright notice appear in
+    all copies and that both that copyright notice and this permission
+    notice appear in supporting documentation, and that the name of
+    the copyright holders not be used in advertising or publicity
+    pertaining to distribution of the software without specific,
+    written prior permission.  The copyright holders make no
+    representations about the suitability of this software for any
+    purpose.  It is provided "as is" without express or implied
+    warranty.
+
+    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+    THIS SOFTWARE.
+  </copyright>
+
+  <interface name="wfits_uinput" version="1">
+    <request name="move_pointer">
+      <arg name="x" type="int"/>
+      <arg name="y" type="int"/>
+    </request>
+  </interface>
+</protocol>
\ No newline at end of file
diff --git a/src/extensions/weston/.gitignore b/src/extensions/weston/.gitignore
new file mode 100644 (file)
index 0000000..a6bd975
--- /dev/null
@@ -0,0 +1,4 @@
+wayland-fits-client-protocol.h
+wayland-fits-protocol.c
+wayland-fits-server-protocol.h
+
diff --git a/src/extensions/weston/Makefile.am b/src/extensions/weston/Makefile.am
new file mode 100644 (file)
index 0000000..6fa1e31
--- /dev/null
@@ -0,0 +1,25 @@
+moduledir = @libdir@/weston
+module_LTLIBRARIES =                           \
+       $(weston_wfits)
+
+# AM_CFLAGS = $(GCC_CFLAGS)
+# AM_CPPFLAGS = -I$(top_srcdir)/src $(WAYLAND_SERVER_CFLAGS)
+# AM_LDFLAGS = -module -avoid-version -rpath $(libdir)
+
+weston_wfits = weston-wfits.la
+weston_wfits_la_CFLAGS = $(GCC_CFLAGS) $(WAYLAND_SERVER_CFLAGS)
+weston_wfits_la_LDFLAGS = -module -avoid-version
+weston_wfits_la_LIBADD = $(WAYLAND_SERVER_LIBS)
+weston_wfits_la_SOURCES =                      \
+       weston-wfits.c                  \
+       wayland-fits-protocol.c                 \
+       wayland-fits-server-protocol.h
+
+BUILT_SOURCES =                                        \
+       wayland-fits-protocol.c                 \
+       wayland-fits-server-protocol.h          \
+       wayland-fits-client-protocol.h
+
+CLEANFILES = $(BUILT_SOURCES)
+
+@wayland_scanner_rules@
diff --git a/src/extensions/weston/weston-wfits.c b/src/extensions/weston/weston-wfits.c
new file mode 100644 (file)
index 0000000..813aace
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright © 2012 Intel Corporation
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the copyright holders not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission.  The copyright holders make
+ * no representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+// #include "../src/compositor.h"
+#include "wayland-server.h"
+#include "wayland-fits-server-protocol.h"
+
+struct compositor {
+       struct wl_signal destroy_signal;
+       struct wl_display *wl_display;
+};
+
+struct wfits {
+       struct compositor *compositor;
+};
+
+static void
+move_pointer(struct wl_client *client, struct wl_resource *resource,
+            int32_t x, int32_t y)
+{
+       struct wfits *wfits = resource->data;
+}
+
+static const struct wfits_uinput_interface wfits_uinput_implementation = {
+       move_pointer,
+};
+
+static void
+bind_uinput(struct wl_client *client, void *data, uint32_t version, uint32_t id)
+{
+       struct wfits *wfits = data;
+       struct wl_resource *resource;
+
+       resource = wl_client_add_object(client, &wfits_uinput_interface,
+                                       &wfits_uinput_implementation, id, wfits);
+}
+
+WL_EXPORT int
+module_init(void *p)
+{
+       struct wfits *wfits;
+       struct compositor* ec = p;
+
+       wfits = malloc(sizeof *wfits);
+       if (wfits == NULL)
+               return -1;
+
+       memset(wfits, 0, sizeof *wfits);
+       wfits->compositor = ec;
+
+       if (wl_display_add_global(ec->wl_display, &wfits_uinput_interface,
+                                 wfits, bind_uinput) == NULL)
+               return -1;
+       return 0;
+}