commit 7cde7c2

Michael Forney  ·  2013-12-24 19:58:56 +0000 UTC
parent 6f88c9e
view: Add initialize/finalize functions
4 files changed,  +43, -2
+2, -2
 1@@ -891,8 +891,8 @@ bool swc_compositor_initialize(struct swc_compositor * compositor,
 2     compositor->pointer_listener.notify = &handle_pointer_event;
 3     compositor->scheduled_updates = 0;
 4     compositor->pending_flips = 0;
 5-    compositor->compositor_view.impl = &view_impl;
 6-    compositor->cursor_view.impl = &swc_cursor_view_impl;
 7+    swc_view_initialize(&compositor->compositor_view, &view_impl);
 8+    swc_view_initialize(&compositor->cursor_view, &swc_cursor_view_impl);
 9     compositor->pointer_handler = (struct swc_pointer_handler) {
10         .focus = &handle_focus,
11         .motion = &handle_motion
+1, -0
1@@ -30,6 +30,7 @@ $(dir)_PACKAGES =   \
2 
3 SWC_SOURCES =                       \
4     libswc/compositor.c             \
5+    libswc/view.c                   \
6     libswc/util.c                   \
7     libswc/output.c                 \
8     libswc/plane.c                  \
+35, -0
 1@@ -0,0 +1,35 @@
 2+/* swc: libswc/view.c
 3+ *
 4+ * Copyright (c) 2013 Michael Forney
 5+ *
 6+ * Permission is hereby granted, free of charge, to any person obtaining a copy
 7+ * of this software and associated documentation files (the "Software"), to deal
 8+ * in the Software without restriction, including without limitation the rights
 9+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+ * copies of the Software, and to permit persons to whom the Software is
11+ * furnished to do so, subject to the following conditions:
12+ *
13+ * The above copyright notice and this permission notice shall be included in
14+ * all copies or substantial portions of the Software.
15+ *
16+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+ * SOFTWARE.
23+ */
24+
25+#include "view.h"
26+
27+void swc_view_initialize(struct swc_view * view,
28+                         const struct swc_view_impl * impl)
29+{
30+    view->impl = impl;
31+}
32+
33+void swc_view_finalize(struct swc_view * view)
34+{
35+}
36+
+5, -0
 1@@ -59,5 +59,10 @@ struct swc_view_impl
 2     void (* move)(struct swc_surface * surface, int32_t x, int32_t y);
 3 };
 4 
 5+void swc_view_initialize(struct swc_view * view,
 6+                         const struct swc_view_impl * impl);
 7+
 8+void swc_view_finalize(struct swc_view * view);
 9+
10 #endif
11