summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-09-09 14:41:53 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-09-09 14:41:53 -0400
commite077ba44d9e948cd4e83e5208d33729b166b3d2c (patch)
treea54fafef4ed2e4934b1a754c9b87ba324e27ce34
parent37f27d59cd32afcdaab4d5eb079ca4a8f17f4721 (diff)
Start of session manager shell
-rw-r--r--compositor/Makefile.am16
-rw-r--r--compositor/session-manager-shell.c104
-rw-r--r--configure.ac2
-rw-r--r--protocol/session-manager.xml6
4 files changed, 128 insertions, 0 deletions
diff --git a/compositor/Makefile.am b/compositor/Makefile.am
index 991e7539..58e78275 100644
--- a/compositor/Makefile.am
+++ b/compositor/Makefile.am
@@ -31,6 +31,7 @@ moduledir = @libdir@/wayland
module_LTLIBRARIES = \
$(desktop_shell) \
$(meego_tablet_shell) \
+ $(session_manager_shell) \
$(x11_backend) \
$(drm_backend) \
$(wayland_backend) \
@@ -92,11 +93,26 @@ meego_tablet_shell_la_SOURCES = \
meego-tablet-server-protocol.h
endif
+if ENABLE_SESSION_MANAGER_SHELL
+session_manager_shell = session-manager-shell.la
+session_manager_shell_la_LDFLAGS = -module -avoid-version
+session_manager_shell_la_LIBADD = $(COMPOSITOR_LIBS)
+session_manager_shell_la_CFLAGS = $(GCC_CFLAGS)
+session_manager_shell_la_SOURCES = \
+ session-manager-shell.c \
+ session-manager-shell.h \
+ session-manager-protocol.c \
+ session-manager-server-protocol.h
+endif
+
+
BUILT_SOURCES = \
screenshooter-server-protocol.h \
screenshooter-protocol.c \
meego-tablet-protocol.c \
meego-tablet-server-protocol.h \
+ session-manager-protocol.c \
+ session-manager-server-protocol.h \
xserver-protocol.c \
xserver-server-protocol.h \
desktop-shell-protocol.c \
diff --git a/compositor/session-manager-shell.c b/compositor/session-manager-shell.c
new file mode 100644
index 00000000..9a197249
--- /dev/null
+++ b/compositor/session-manager-shell.c
@@ -0,0 +1,104 @@
+/*
+ * Copyright © 2011 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 <sys/wait.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <fcntl.h>
+#include <linux/input.h>
+
+#include "compositor.h"
+#include "session-manager-server-protocol.h"
+
+struct session_manager_shell {
+ struct wl_resource resource;
+ struct wlsc_shell shell;
+ struct wlsc_compositor *compositor;
+ struct wl_client *client;
+};
+
+static void
+bind_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id)
+{
+ struct session_manager_shell *shell = data;
+
+ if (shell->client != client)
+ /* Throw an error or just let the client fail when it
+ * tries to access the object?. */
+ return;
+
+ shell->resource.client = client;
+ shell->resource.object.id = id;
+}
+
+static void
+session_manager_shell_lock(struct wlsc_shell *base)
+{
+}
+
+static void
+session_manager_shell_attach(struct wlsc_shell *base,
+ struct wlsc_surface *surface)
+{
+}
+
+static void
+session_manager_shell_set_selection_focus(struct wlsc_shell *shell,
+ struct wl_selection *selection,
+ struct wl_surface *surface,
+ uint32_t time)
+{
+}
+
+void
+shell_init(struct wlsc_compositor *compositor);
+
+WL_EXPORT void
+shell_init(struct wlsc_compositor *compositor)
+{
+ struct session_manager_shell *shell;
+
+ shell = malloc(sizeof *shell);
+ if (shell == NULL)
+ return;
+
+ memset(shell, 0, sizeof *shell);
+ shell->compositor = compositor;
+
+ shell->resource.object.interface = &session_manager_interface;
+ shell->resource.object.implementation = NULL;
+
+ /* FIXME: This will make the object available to all clients. */
+ wl_display_add_global(compositor->wl_display,
+ &session_manager_interface, shell, bind_shell);
+
+ compositor->shell = &shell->shell;
+
+ shell->shell.lock = session_manager_shell_lock;
+ shell->shell.attach = session_manager_shell_attach;
+ shell->shell.set_selection_focus =
+ session_manager_shell_set_selection_focus;
+}
diff --git a/configure.ac b/configure.ac
index f19c4e7d..78abfc27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,6 +124,8 @@ AC_ARG_ENABLE(meego-tablet-shell, [ --enable-meego-tablet-shell],,
AM_CONDITIONAL(ENABLE_MEEGO_TABLET_SHELL,
test x$enable_meego_tablet_shell == xyes)
+ AM_CONDITIONAL(ENABLE_SESSION_MANAGER_SHELL, true)
+
if test "x$GCC" = "xyes"; then
GCC_CFLAGS="-Wall -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden"
fi
diff --git a/protocol/session-manager.xml b/protocol/session-manager.xml
new file mode 100644
index 00000000..c3ca4bba
--- /dev/null
+++ b/protocol/session-manager.xml
@@ -0,0 +1,6 @@
+<protocol name="session_manager">
+
+ <interface name="session_manager" version="1">
+ </interface>
+
+</protocol>