compositor: Organize surface stack using new struct weston_layer

The surface data structure is now a list of list of surfaces.  The core
compositor defines the fade and cursor layer, and it's up to the shell to
provide more layers for the various surface types it implements.
diff --git a/src/compositor.h b/src/compositor.h
index 9f29c4b..d0b7206 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -163,6 +163,11 @@
 
 struct screenshooter;
 
+struct weston_layer {
+	struct wl_list surface_list;
+	struct wl_list link;
+};
+
 struct weston_compositor {
 	struct wl_shm *shm;
 	struct weston_xserver *wxs;
@@ -181,8 +186,12 @@
 	/* There can be more than one, but not right now... */
 	struct wl_input_device *input_device;
 
+	struct weston_layer fade_layer;
+	struct weston_layer cursor_layer;
+
 	struct wl_list output_list;
 	struct wl_list input_device_list;
+	struct wl_list layer_list;
 	struct wl_list surface_list;
 	struct wl_list binding_list;
 	struct wl_list animation_list;
@@ -267,6 +276,7 @@
 	pixman_region32_t input;
 	int32_t pitch;
 	struct wl_list link;
+	struct wl_list layer_link;
 	struct wl_list buffer_link;
 	struct weston_shader *shader;
 	GLfloat color[4];
@@ -372,6 +382,9 @@
 	     int x, int y, int touch_type);
 
 void
+weston_layer_init(struct weston_layer *layer, struct wl_list *below);
+
+void
 weston_output_finish_frame(struct weston_output *output, int msecs);
 void
 weston_output_damage(struct weston_output *output);
@@ -424,6 +437,9 @@
 			 GLfloat x, GLfloat y, int width, int height);
 
 void
+weston_surface_restack(struct weston_surface *surface, struct wl_list *below);
+
+void
 weston_surface_set_position(struct weston_surface *surface,
 			    GLfloat x, GLfloat y);