OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_WAYLAND_WAYLAND_WINDOW_H_ |
| 6 #define UI_WAYLAND_WAYLAND_WINDOW_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "ui/gfx/point.h" |
| 12 |
| 13 struct wl_surface; |
| 14 |
| 15 namespace ui { |
| 16 |
| 17 class WaylandDisplay; |
| 18 class WaylandWidget; |
| 19 |
| 20 // WaylandWindow wraps a wl_surface and some basic operations for the surface. |
| 21 // WaylandWindow also keeps track of the WaylandWidget that will process all |
| 22 // events related to the window. |
| 23 class WaylandWindow { |
| 24 public: |
| 25 // Creates a toplevel window |
| 26 WaylandWindow(WaylandWidget* widget, WaylandDisplay* display); |
| 27 // Creates a transient window with an offset of (x,y) from parent |
| 28 WaylandWindow(WaylandWidget* widget, WaylandDisplay* display, |
| 29 WaylandWindow* parent, int32_t x, int32_t y); |
| 30 virtual ~WaylandWindow(); |
| 31 |
| 32 void SetVisible(bool visible); |
| 33 bool IsVisible() const; |
| 34 |
| 35 // Sets the window to fullscreen if 'fullscreen' is true. Otherwise it sets |
| 36 // it as a normal window. |
| 37 void SetFullscreen(bool fullscreen); |
| 38 bool IsFullscreen() const; |
| 39 |
| 40 // Returns a pointer to the parent window. NULL is this window doesn't have |
| 41 // a parent. |
| 42 WaylandWindow* GetParentWindow() const; |
| 43 |
| 44 WaylandWidget* GetWidget() const; |
| 45 // Returns the pointer to the surface associated with the window. |
| 46 // The WaylandWindow object owns the pointer. |
| 47 wl_surface* GetSurface() const; |
| 48 |
| 49 void Configure(uint32_t time, uint32_t edges, int32_t x, int32_t y, |
| 50 int32_t width, int32_t height); |
| 51 |
| 52 private: |
| 53 // The widget that will process events for this window. This is not owned |
| 54 // by the window. |
| 55 WaylandWidget* widget_; |
| 56 WaylandDisplay* display_; |
| 57 |
| 58 // The native wayland surface associated with this window. |
| 59 wl_surface* surface_; |
| 60 |
| 61 // Whether the window is in fullscreen mode. |
| 62 bool fullscreen_; |
| 63 |
| 64 WaylandWindow* parent_window_; |
| 65 // Position relative to parent window. This is only used by |
| 66 // a transient window. |
| 67 gfx::Point relative_position_; |
| 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(WaylandWindow); |
| 70 }; |
| 71 |
| 72 } // namespace ui |
| 73 |
| 74 #endif // UI_WAYLAND_WAYLAND_WINDOW_H_ |
OLD | NEW |