[clutter/wip/wayland: 22/45] test-wayland-surface: Move the TWSSurface struct to a separate header



commit deb8dcd6ea67a9206ed7b9513c997e8aa5aee02a
Author: Neil Roberts <neil linux intel com>
Date:   Tue Jan 10 18:19:56 2012 +0000

    test-wayland-surface: Move the TWSSurface struct to a separate header
    
    The hope is to make the input support be self contained in a separate
    file so that it can be more easily moved to Mutter. The input support
    needs to get a ClutterActor pointer from a TWSSurface so the easiest
    way to do this is to share the struct.

 tests/interactive/Makefile.am            |    5 ++++-
 tests/interactive/test-wayland-surface.c |   22 +---------------------
 tests/interactive/tws-compositor.h       |   29 +++++++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 22 deletions(-)
---
diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am
index 30ec91e..9a36cfe 100644
--- a/tests/interactive/Makefile.am
+++ b/tests/interactive/Makefile.am
@@ -65,9 +65,12 @@ if X11_TESTS
 UNIT_TESTS += test-pixmap.c
 endif
 
+test_interactive_SOURCES =
+
 if SUPPORT_WAYLAND_COMPOSITOR
 if HAVE_WAYLAND_EXTENSION_PROTOCOLS_DIR
 UNIT_TESTS += test-wayland-surface.c
+test_interactive_SOURCES += tws-compositor.h
 endif
 endif
 
@@ -156,7 +159,7 @@ common_ldadd = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la
 
 noinst_PROGRAMS = test-interactive
 
-test_interactive_SOURCES = \
+test_interactive_SOURCES += \
 	test-main.c \
 	test-unit-names.h
 
diff --git a/tests/interactive/test-wayland-surface.c b/tests/interactive/test-wayland-surface.c
index 8840f17..b1a2dfe 100644
--- a/tests/interactive/test-wayland-surface.c
+++ b/tests/interactive/test-wayland-surface.c
@@ -18,27 +18,7 @@
 #include <wayland-server.h>
 
 #include "xserver-server-protocol.h"
-
-typedef struct _TWSCompositor TWSCompositor;
-
-typedef struct
-{
-  struct wl_buffer *wayland_buffer;
-  GList *surfaces_attached_to;
-  struct wl_listener buffer_destroy_listener;
-} TWSBuffer;
-
-typedef struct
-{
-  struct wl_surface wayland_surface;
-  TWSCompositor *compositor;
-  int x;
-  int y;
-  TWSBuffer *buffer;
-  ClutterActor *actor;
-  gboolean has_shell_surface;
-  struct wl_listener surface_destroy_listener;
-} TWSSurface;
+#include "tws-compositor.h"
 
 typedef struct
 {
diff --git a/tests/interactive/tws-compositor.h b/tests/interactive/tws-compositor.h
new file mode 100644
index 0000000..93b28c5
--- /dev/null
+++ b/tests/interactive/tws-compositor.h
@@ -0,0 +1,29 @@
+#ifndef __TWS_COMPOSITOR_H__
+#define __TWS_COMPOSITOR_H__
+
+#include <glib.h>
+#include <wayland-server.h>
+#include <clutter/clutter.h>
+
+typedef struct _TWSCompositor TWSCompositor;
+
+typedef struct
+{
+  struct wl_buffer *wayland_buffer;
+  GList *surfaces_attached_to;
+  struct wl_listener buffer_destroy_listener;
+} TWSBuffer;
+
+typedef struct
+{
+  struct wl_surface wayland_surface;
+  TWSCompositor *compositor;
+  int x;
+  int y;
+  TWSBuffer *buffer;
+  ClutterActor *actor;
+  gboolean has_shell_surface;
+  struct wl_listener surface_destroy_listener;
+} TWSSurface;
+
+#endif /* __TWS_COMPOSITOR_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]