Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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_OZONE_WINDOW_OZONE_WINDOW_H_ | |
| 6 #define UI_OZONE_WINDOW_OZONE_WINDOW_H_ | |
| 7 | |
| 8 #include "ui/base/cursor/cursor.h" | |
| 9 #include "ui/gfx/geometry/rect.h" | |
| 10 #include "ui/gfx/native_widget_types.h" | |
| 11 #include "ui/ozone/ozone_export.h" | |
| 12 | |
| 13 namespace gfx { | |
| 14 class PointF; | |
| 15 class Rect; | |
| 16 } | |
| 17 | |
| 18 namespace ui { | |
| 19 | |
| 20 // The ozone representation of a platform window. | |
| 21 // | |
| 22 // A window has a surface for painting on, a cursor, and receives events | |
| 23 // from the windowing system. You can paint on a window using either | |
| 24 // software compositing or GLES. | |
| 25 // | |
| 26 // The surface part is somewhat decoupled using an opaque handle | |
| 27 // represented by the type gfx::AcceleratedWidget. Once the window is | |
| 28 // created, you can call GetAcceleratedWidget() to get the handle. The same | |
| 29 // handle will get passed to SurfaceFactoryOzone::CreateSurfaceForWidget, | |
| 30 // which can be used to initialize the graphical output. | |
| 31 // | |
| 32 // This object is created & owned on the UI thread. The surface might be | |
| 33 // created in another thread, or even another process such as the GPU | |
| 34 // process. The implementation must be prepared to handle this. | |
| 35 class OZONE_EXPORT OzoneWindow { | |
|
rjkroege
2014/03/24 16:11:51
this needs to be coupled to the backing Display in
spang
2014/03/24 18:15:29
Yes. I think this must happen behind the scenes in
dnicoara
2014/03/24 21:04:26
Having the coupling behind the scenes should be fi
| |
| 36 public: | |
| 37 OzoneWindow(); | |
| 38 virtual ~OzoneWindow(); | |
| 39 | |
| 40 // Return a gfx::AcceleratedWidget that can be used to paint on the window. | |
| 41 virtual gfx::AcceleratedWidget GetAcceleratedWidget(); | |
| 42 | |
| 43 // Warp the cursor to a location within this window. If the cursor actually | |
| 44 // moves, the implementation must dispatch a mouse move event with the new | |
| 45 // location. | |
| 46 virtual void WarpCursorTo(const gfx::PointF& location); | |
| 47 | |
| 48 // Get the bounds of the window. | |
| 49 virtual gfx::Rect GetBounds(); | |
| 50 | |
| 51 // Resize the window. Returns whether the resize was successful. | |
| 52 virtual bool Resize(const gfx::Rect& bounds); | |
| 53 | |
| 54 // Change the active cursor for this window. | |
| 55 virtual void SetCursor(PlatformCursor cursor); | |
| 56 }; | |
| 57 | |
| 58 } // namespace ui | |
| 59 | |
| 60 #endif // UI_OZONE_WINDOW_OZONE_WINDOW_H_ | |
| OLD | NEW |