Index: ui/aura/root_window_host_wayland.h |
diff --git a/ui/aura/root_window_host_x11.h b/ui/aura/root_window_host_wayland.h |
similarity index 64% |
copy from ui/aura/root_window_host_x11.h |
copy to ui/aura/root_window_host_wayland.h |
index c2ad5d4024ee1cb4195baca14009b8fe388dfc07..745ab5d0c4a6994b6d4147260aa993bdb9919f82 100644 |
--- a/ui/aura/root_window_host_x11.h |
+++ b/ui/aura/root_window_host_wayland.h |
@@ -1,26 +1,26 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright 2013 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_AURA_ROOT_WINDOW_HOST_X11_H_ |
-#define UI_AURA_ROOT_WINDOW_HOST_X11_H_ |
- |
-#include <X11/Xlib.h> |
+#ifndef UI_AURA_ROOT_WINDOW_HOST_WAYLAND_H_ |
+#define UI_AURA_ROOT_WINDOW_HOST_WAYLAND_H_ |
#include <vector> |
-// Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
-#undef RootWindow |
- |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop.h" |
-#include "ui/aura/aura_export.h" |
#include "ui/aura/env_observer.h" |
#include "ui/aura/root_window_host.h" |
-#include "ui/base/x/x11_atom_cache.h" |
-#include "ui/base/x/x11_util.h" |
#include "ui/gfx/insets.h" |
#include "ui/gfx/rect.h" |
+#include "ui/wayland/wayland_display.h" |
+#include "ui/wayland/wayland_window.h" |
+ |
+namespace base { |
+namespace wayland { |
+union WaylandEvent; |
+} |
+} |
namespace ui { |
class MouseEvent; |
@@ -28,16 +28,12 @@ class MouseEvent; |
namespace aura { |
-namespace internal { |
-class TouchEventCalibrate; |
-} |
- |
-class RootWindowHostX11 : public RootWindowHost, |
- public base::MessageLoop::Dispatcher, |
- public EnvObserver { |
+class RootWindowHostWayland : public RootWindowHost, |
+ public base::MessageLoop::Dispatcher, |
+ public EnvObserver { |
public: |
- explicit RootWindowHostX11(const gfx::Rect& bounds); |
- virtual ~RootWindowHostX11(); |
+ explicit RootWindowHostWayland(const gfx::Rect& bounds); |
+ virtual ~RootWindowHostWayland(); |
// Overridden from Dispatcher overrides: |
virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
@@ -66,6 +62,9 @@ class RootWindowHostX11 : public RootWindowHost, |
virtual bool CopyAreaToSkCanvas(const gfx::Rect& source_bounds, |
const gfx::Point& dest_offset, |
SkCanvas* canvas) OVERRIDE; |
+ virtual bool GrabSnapshot( |
+ const gfx::Rect& snapshot_bounds, |
+ std::vector<unsigned char>* png_representation) OVERRIDE; |
virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE; |
virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
virtual void PrepareForShutdown() OVERRIDE; |
@@ -74,15 +73,9 @@ class RootWindowHostX11 : public RootWindowHost, |
virtual void OnWindowInitialized(Window* window) OVERRIDE; |
virtual void OnRootWindowInitialized(RootWindow* root_window) OVERRIDE; |
private: |
- class MouseMoveFilter; |
bool DispatchEventForRootWindow(const base::NativeEvent& event); |
- // Dispatches XI2 events. Note that some events targetted for the X root |
- // window are dispatched to the aura root window (e.g. touch events after |
- // calibration). |
- void DispatchXI2Event(const base::NativeEvent& event); |
- |
// Returns true if there's an X window manager present... in most cases. Some |
// window managers (notably, ion3) don't implement enough of ICCCM for us to |
// detect that they're there. |
@@ -96,21 +89,14 @@ class RootWindowHostX11 : public RootWindowHost, |
// dispatches the event to RootWindowHostDelegate. |
void TranslateAndDispatchMouseEvent(ui::MouseEvent* event); |
- // Copies and returns |snapshot_bounds| from |xwindow_|. Helper method for |
- // CopyAreaToSkCanvas() and GrabSnapshot(). |
- scoped_ptr<ui::XScopedImage> GetXImage(const gfx::Rect& snapshot_bounds); |
- |
// Update is_internal_display_ based on delegate_ state |
void UpdateIsInternalDisplay(); |
RootWindowHostDelegate* delegate_; |
- // The display and the native X window hosting the root window. |
- Display* xdisplay_; |
- ::Window xwindow_; |
- |
- // The native root window. |
- ::Window x_root_window_; |
+ // The display and the native window hosting the root window. |
+ ui::WaylandDisplay* display_; |
+ ui::WaylandWindow* window_; |
// Current Aura cursor. |
gfx::NativeCursor current_cursor_; |
@@ -124,33 +110,15 @@ class RootWindowHostX11 : public RootWindowHost, |
// The insets that specifies the effective area within the |window_|. |
gfx::Insets insets_; |
- // The bounds of |x_root_window_|. |
- gfx::Rect x_root_bounds_; |
- |
// True if the root host resides on the internal display |
bool is_internal_display_; |
// True if the window should be focused when the window is shown. |
bool focus_when_shown_; |
- scoped_ptr<XID[]> pointer_barriers_; |
- |
- scoped_ptr<internal::TouchEventCalibrate> touch_calibrate_; |
- |
- scoped_ptr<MouseMoveFilter> mouse_move_filter_; |
- |
- ui::X11AtomCache atom_cache_; |
- |
- DISALLOW_COPY_AND_ASSIGN(RootWindowHostX11); |
+ DISALLOW_COPY_AND_ASSIGN(RootWindowHostWayland); |
}; |
-namespace test { |
- |
-// Set the default value of the override redirect flag used to |
-// create a X window for RootWindowHostX11. |
-AURA_EXPORT void SetUseOverrideRedirectWindowByDefault(bool override_redirect); |
- |
-} // namespace test |
} // namespace aura |
-#endif // UI_AURA_ROOT_WINDOW_HOST_X11_H_ |
+#endif // UI_AURA_ROOT_WINDOW_HOST_WAYLAND_H_ |