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/wayland/wayland_geometry_utils.h" |
| 12 |
| 13 class WaylandDisplay; |
| 14 class WaylandWidget; |
| 15 struct wl_surface; |
| 16 |
| 17 // WaylandWindow wraps a wl_surface and some basic operations for the surface. |
| 18 // WaylandWindow also keeps track of the WaylandWidget that will process all |
| 19 // events related to the window. |
| 20 class WaylandWindow { |
| 21 public: |
| 22 // Creates a toplevel window |
| 23 WaylandWindow(WaylandWidget* widget, WaylandDisplay* display); |
| 24 // Creates a transient window with an offset of (x,y) from parent |
| 25 WaylandWindow(WaylandWidget* widget, WaylandDisplay* display, |
| 26 WaylandWindow* parent, int32_t x, int32_t y); |
| 27 virtual ~WaylandWindow(); |
| 28 |
| 29 void SetVisible(bool visible); |
| 30 bool IsVisible() const; |
| 31 |
| 32 // Sets the window to fullscreen if 'fullscreen' is true. Otherwise it sets |
| 33 // it as a normal window. |
| 34 void SetFullscreen(bool fullscreen); |
| 35 bool IsFullscreen() const; |
| 36 |
| 37 // Returns a pointer to the parent window. NULL is this window doesn't have |
| 38 // a parent. |
| 39 WaylandWindow* GetParentWindow() const; |
| 40 |
| 41 WaylandWidget* GetWidget() const; |
| 42 // Returns the pointer to the surface associated with the window. |
| 43 // The WaylandWindow object owns the pointer. |
| 44 wl_surface* GetSurface() const; |
| 45 |
| 46 void Configure(uint32_t time, uint32_t edges, int32_t x, int32_t y, |
| 47 int32_t width, int32_t height); |
| 48 private: |
| 49 // The widget that will process events for this window. This is not owned |
| 50 // by the window. |
| 51 WaylandWidget* widget_; |
| 52 WaylandDisplay* display_; |
| 53 |
| 54 // The native wayland surface associated with this window. |
| 55 wl_surface* surface_; |
| 56 |
| 57 // Whether the window is in fullscreen mode. |
| 58 bool fullscreen_; |
| 59 |
| 60 WaylandWindow* parent_window_; |
| 61 // Position relative to parent window. This is only used by |
| 62 // a transient window. |
| 63 Point relative_position_; |
| 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(WaylandWindow); |
| 66 }; |
| 67 |
| 68 #endif |
OLD | NEW |