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