Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: ui/ozone/window/ozone_window.h

Issue 205433005: ozone: Add OzoneWindowFactory & OzoneWindow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/test/ozone_platform_test.cc ('k') | ui/ozone/window/ozone_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/window/ozone_window.h
diff --git a/ui/ozone/window/ozone_window.h b/ui/ozone/window/ozone_window.h
new file mode 100644
index 0000000000000000000000000000000000000000..24ea18b57be529d64d5cb773c0a84df08b29e934
--- /dev/null
+++ b/ui/ozone/window/ozone_window.h
@@ -0,0 +1,60 @@
+// Copyright 2014 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_OZONE_WINDOW_OZONE_WINDOW_H_
+#define UI_OZONE_WINDOW_OZONE_WINDOW_H_
+
+#include "ui/base/cursor/cursor.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/native_widget_types.h"
+#include "ui/ozone/ozone_export.h"
+
+namespace gfx {
+class PointF;
+class Rect;
+}
+
+namespace ui {
+
+// The ozone representation of a platform window.
+//
+// A window has a surface for painting on, a cursor, and receives events
+// from the windowing system. You can paint on a window using either
+// software compositing or GLES.
+//
+// The surface part is somewhat decoupled using an opaque handle
+// represented by the type gfx::AcceleratedWidget. Once the window is
+// created, you can call GetAcceleratedWidget() to get the handle. The same
+// handle will get passed to SurfaceFactoryOzone::CreateSurfaceForWidget,
+// which can be used to initialize the graphical output.
+//
+// This object is created & owned on the UI thread. The surface might be
+// created in another thread, or even another process such as the GPU
+// process. The implementation must be prepared to handle this.
+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
+ public:
+ OzoneWindow();
+ virtual ~OzoneWindow();
+
+ // Return a gfx::AcceleratedWidget that can be used to paint on the window.
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget();
+
+ // Warp the cursor to a location within this window. If the cursor actually
+ // moves, the implementation must dispatch a mouse move event with the new
+ // location.
+ virtual void WarpCursorTo(const gfx::PointF& location);
+
+ // Get the bounds of the window.
+ virtual gfx::Rect GetBounds();
+
+ // Resize the window. Returns whether the resize was successful.
+ virtual bool Resize(const gfx::Rect& bounds);
+
+ // Change the active cursor for this window.
+ virtual void SetCursor(PlatformCursor cursor);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_WINDOW_OZONE_WINDOW_H_
« no previous file with comments | « ui/ozone/platform/test/ozone_platform_test.cc ('k') | ui/ozone/window/ozone_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698