Chromium Code Reviews| Index: ui/wayland/wayland_window.h |
| diff --git a/ui/wayland/wayland_window.h b/ui/wayland/wayland_window.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..da2a11b793f05c4363034e3b02bfa5eb18b698e8 |
| --- /dev/null |
| +++ b/ui/wayland/wayland_window.h |
| @@ -0,0 +1,74 @@ |
| +// Copyright (c) 2011 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_WAYLAND_WAYLAND_WINDOW_H_ |
| +#define UI_WAYLAND_WAYLAND_WINDOW_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include "base/basictypes.h" |
| +#include "ui/gfx/point.h" |
| + |
| +struct wl_surface; |
| + |
| +namespace ui { |
| + |
| +class WaylandDisplay; |
| +class WaylandWidget; |
| + |
| +// WaylandWindow wraps a wl_surface and some basic operations for the surface. |
| +// WaylandWindow also keeps track of the WaylandWidget that will process all |
| +// events related to the window. |
| +class WaylandWindow { |
| + public: |
| + // Creates a toplevel window |
|
tfarina
2011/07/25 18:34:27
End with a period.
|
| + WaylandWindow(WaylandWidget* widget, WaylandDisplay* display); |
| + // Creates a transient window with an offset of (x,y) from parent |
|
tfarina
2011/07/25 18:34:27
period.
|
| + WaylandWindow(WaylandWidget* widget, WaylandDisplay* display, |
| + WaylandWindow* parent, int32_t x, int32_t y); |
| + virtual ~WaylandWindow(); |
|
tfarina
2011/07/25 18:34:27
This needs to be virtual? This class doesn't have
|
| + |
| + void SetVisible(bool visible); |
| + bool IsVisible() const; |
| + |
| + // Sets the window to fullscreen if 'fullscreen' is true. Otherwise it sets |
| + // it as a normal window. |
| + void SetFullscreen(bool fullscreen); |
| + bool IsFullscreen() const; |
| + |
| + // Returns a pointer to the parent window. NULL is this window doesn't have |
| + // a parent. |
| + WaylandWindow* GetParentWindow() const; |
|
tfarina
2011/07/25 18:34:27
The way we prefer is:
WaylandWindow* parent_windo
|
| + |
| + WaylandWidget* GetWidget() const; |
|
tfarina
2011/07/25 18:34:27
Same thing here:
WaylandWidget* widget() const {
|
| + // Returns the pointer to the surface associated with the window. |
| + // The WaylandWindow object owns the pointer. |
| + wl_surface* GetSurface() const; |
|
tfarina
2011/07/25 18:34:27
And here.
|
| + |
| + void Configure(uint32_t time, uint32_t edges, int32_t x, int32_t y, |
| + int32_t width, int32_t height); |
| + |
| + private: |
| + // The widget that will process events for this window. This is not owned |
| + // by the window. |
| + WaylandWidget* widget_; |
| + WaylandDisplay* display_; |
| + |
| + // The native wayland surface associated with this window. |
| + wl_surface* surface_; |
| + |
| + // Whether the window is in fullscreen mode. |
| + bool fullscreen_; |
| + |
| + WaylandWindow* parent_window_; |
|
tfarina
2011/07/25 18:34:27
Document this? I'd also move it near of widget_ an
|
| + // Position relative to parent window. This is only used by |
| + // a transient window. |
| + gfx::Point relative_position_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WaylandWindow); |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // UI_WAYLAND_WAYLAND_WINDOW_H_ |