Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(587)

Unified Diff: ui/ozone/platform/wayland/wayland_window.h

Issue 1610683003: Add initial SHM-only Wayland Ozone implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use base::SharedMemory, expand ObjectTraits macros, etc Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/wayland/wayland_window.h
diff --git a/ui/ozone/platform/wayland/wayland_window.h b/ui/ozone/platform/wayland/wayland_window.h
new file mode 100644
index 0000000000000000000000000000000000000000..b1e0ff14191431495ace16ff0e7fb9aa2269e7e6
--- /dev/null
+++ b/ui/ozone/platform/wayland/wayland_window.h
@@ -0,0 +1,75 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_WINDOW_H_
+#define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_WINDOW_H_
+
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/native_widget_types.h"
+#include "ui/ozone/platform/wayland/wayland_object.h"
+#include "ui/platform_window/platform_window.h"
+
+namespace ui {
+
+class WaylandDisplay;
+
+class WaylandWindow : public PlatformWindow {
+ public:
+ WaylandWindow(PlatformWindowDelegate* delegate,
+ WaylandDisplay* display,
+ const gfx::Rect& bounds);
+ ~WaylandWindow() override;
+
+ bool Initialize();
+
+ wl_surface* GetSurface();
+ gfx::AcceleratedWidget GetWidget();
+
+ void ApplyPendingBounds();
spang 2016/01/25 18:57:58 It would be nice to comment these.
Michael Forney 2016/01/26 02:25:26 Done.
+ void SetKeyboardFocus(bool focus);
+ void SetPointerFocus(bool focus);
+
+ // PlatformWindow
+ void Show() override;
+ void Hide() override;
+ void Close() override;
+ void SetBounds(const gfx::Rect& bounds) override;
+ gfx::Rect GetBounds() override;
+ void SetTitle(const base::string16& title) override;
+ void SetCapture() override;
+ void ReleaseCapture() override;
+ void ToggleFullscreen() override;
+ void Maximize() override;
+ void Minimize() override;
+ void Restore() override;
+ void SetCursor(PlatformCursor cursor) override;
+ void MoveCursorTo(const gfx::Point& location) override;
+ void ConfineCursorToBounds(const gfx::Rect& bounds) override;
+ PlatformImeController* GetPlatformImeController() override;
+
+ // xdg_surface_listener
+ static void Configure(void* data,
+ xdg_surface* obj,
+ int32_t width,
+ int32_t height,
+ wl_array* states,
+ uint32_t serial);
+ static void Close(void* data, xdg_surface* obj);
+
+ private:
+ PlatformWindowDelegate* delegate_;
+ WaylandDisplay* display_;
+
+ wl::Object<wl_surface> surface_;
+ wl::Object<xdg_surface> xdg_surface_;
spang 2016/01/25 18:57:58 What's the difference between these two things?
Michael Forney 2016/01/25 19:16:45 The wl_surface is a generic surface object that is
+
+ gfx::Rect bounds_, pending_bounds_;
spang 2016/01/25 18:57:57 Just one declaration per line.
Michael Forney 2016/01/26 02:25:26 Done.
+ uint32_t pending_configure_serial_;
+
+ DISALLOW_COPY_AND_ASSIGN(WaylandWindow);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_WINDOW_H_

Powered by Google App Engine
This is Rietveld 408576698