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