summaryrefslogtreecommitdiffstats
path: root/src/platforms/mirserver/mirwindowmanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/platforms/mirserver/mirwindowmanager.h')
-rw-r--r--src/platforms/mirserver/mirwindowmanager.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/platforms/mirserver/mirwindowmanager.h b/src/platforms/mirserver/mirwindowmanager.h
new file mode 100644
index 0000000..0ec1839
--- /dev/null
+++ b/src/platforms/mirserver/mirwindowmanager.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright © 2015 Canonical Ltd.
+ *
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License version 3, as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef QPAMIRSERVER_WINDOW_MANAGER_H
+#define QPAMIRSERVER_WINDOW_MANAGER_H
+
+#include <mir/shell/window_manager.h>
+
+#include <QObject>
+
+namespace mir {
+ namespace shell {
+ class DisplayLayout;
+ }
+}
+
+class MirWindowManager : public QObject, public mir::shell::WindowManager
+{
+ Q_OBJECT
+
+public:
+
+ MirWindowManager(const std::shared_ptr<mir::shell::DisplayLayout> &displayLayout);
+
+ void add_session(std::shared_ptr<mir::scene::Session> const& session) override;
+
+ void remove_session(std::shared_ptr<mir::scene::Session> const& session) override;
+
+ mir::frontend::SurfaceId add_surface(
+ std::shared_ptr<mir::scene::Session> const& session,
+ mir::scene::SurfaceCreationParameters const& params,
+ std::function<mir::frontend::SurfaceId(std::shared_ptr<mir::scene::Session> const& session, mir::scene::SurfaceCreationParameters const& params)> const& build) override;
+
+ void remove_surface(
+ std::shared_ptr<mir::scene::Session> const& session,
+ std::weak_ptr<mir::scene::Surface> const& surface) override;
+
+ void add_display(mir::geometry::Rectangle const& area) override;
+
+ void remove_display(mir::geometry::Rectangle const& area) override;
+
+ bool handle_keyboard_event(MirKeyboardEvent const* event) override;
+
+ bool handle_touch_event(MirTouchEvent const* event) override;
+
+ bool handle_pointer_event(MirPointerEvent const* event) override;
+
+ int set_surface_attribute(
+ std::shared_ptr<mir::scene::Session> const& session,
+ std::shared_ptr<mir::scene::Surface> const& surface,
+ MirSurfaceAttrib attrib,
+ int value) override;
+
+ void modify_surface(const std::shared_ptr<mir::scene::Session>&, const std::shared_ptr<mir::scene::Surface>&, const mir::shell::SurfaceSpecification&);
+
+private:
+ std::shared_ptr<mir::shell::DisplayLayout> const m_displayLayout;
+};
+
+#endif /* QPAMIRSERVER_WINDOW_MANAGER_H */