| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ | 5 #ifndef UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ |
| 6 #define UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ | 6 #define UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ |
| 7 | 7 |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 | 9 |
| 10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
| 11 #undef RootWindow | 11 #undef RootWindow |
| 12 | 12 |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "ui/aura/root_window_host.h" | 15 #include "ui/aura/root_window_host.h" |
| 16 #include "ui/base/x/x11_atom_cache.h" | 16 #include "ui/base/x/x11_atom_cache.h" |
| 17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
| 18 | 18 |
| 19 namespace ui { | 19 namespace ui { |
| 20 class MouseEvent; |
| 20 class ViewProp; | 21 class ViewProp; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace aura { | 24 namespace aura { |
| 24 | 25 |
| 25 namespace internal { | 26 namespace internal { |
| 26 class TouchEventCalibrate; | 27 class TouchEventCalibrate; |
| 27 } | 28 } |
| 28 | 29 |
| 29 class RootWindowHostLinux : public RootWindowHost, | 30 class RootWindowHostLinux : public RootWindowHost, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 72 |
| 72 // Returns true if there's an X window manager present... in most cases. Some | 73 // Returns true if there's an X window manager present... in most cases. Some |
| 73 // window managers (notably, ion3) don't implement enough of ICCCM for us to | 74 // window managers (notably, ion3) don't implement enough of ICCCM for us to |
| 74 // detect that they're there. | 75 // detect that they're there. |
| 75 bool IsWindowManagerPresent(); | 76 bool IsWindowManagerPresent(); |
| 76 | 77 |
| 77 // Sets the cursor on |xwindow_| to |cursor|. Does not check or update | 78 // Sets the cursor on |xwindow_| to |cursor|. Does not check or update |
| 78 // |current_cursor_|. | 79 // |current_cursor_|. |
| 79 void SetCursorInternal(gfx::NativeCursor cursor); | 80 void SetCursorInternal(gfx::NativeCursor cursor); |
| 80 | 81 |
| 82 // Translates the native mouse location into screen coordinates and and |
| 83 // dispatches the event to RootWindowHostDelegate. |
| 84 void TranslateAndDispatchMouseEvent(ui::MouseEvent* event); |
| 85 |
| 81 RootWindowHostDelegate* delegate_; | 86 RootWindowHostDelegate* delegate_; |
| 82 | 87 |
| 83 // The display and the native X window hosting the root window. | 88 // The display and the native X window hosting the root window. |
| 84 Display* xdisplay_; | 89 Display* xdisplay_; |
| 85 ::Window xwindow_; | 90 ::Window xwindow_; |
| 86 | 91 |
| 87 // The native root window. | 92 // The native root window. |
| 88 ::Window x_root_window_; | 93 ::Window x_root_window_; |
| 89 | 94 |
| 90 // Current Aura cursor. | 95 // Current Aura cursor. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 115 scoped_ptr<internal::TouchEventCalibrate> touch_calibrate_; | 120 scoped_ptr<internal::TouchEventCalibrate> touch_calibrate_; |
| 116 | 121 |
| 117 ui::X11AtomCache atom_cache_; | 122 ui::X11AtomCache atom_cache_; |
| 118 | 123 |
| 119 DISALLOW_COPY_AND_ASSIGN(RootWindowHostLinux); | 124 DISALLOW_COPY_AND_ASSIGN(RootWindowHostLinux); |
| 120 }; | 125 }; |
| 121 | 126 |
| 122 } // namespace aura | 127 } // namespace aura |
| 123 | 128 |
| 124 #endif // UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ | 129 #endif // UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ |
| OLD | NEW |