| 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_WINDOW_TREE_HOST_X11_H_ | 5 #ifndef UI_AURA_WINDOW_TREE_HOST_X11_H_ |
| 6 #define UI_AURA_WINDOW_TREE_HOST_X11_H_ | 6 #define UI_AURA_WINDOW_TREE_HOST_X11_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "ui/aura/aura_export.h" | 13 #include "ui/aura/aura_export.h" |
| 14 #include "ui/aura/window_tree_host.h" | 14 #include "ui/aura/window_tree_host.h" |
| 15 #include "ui/events/platform/platform_event_dispatcher.h" | 15 #include "ui/events/platform/platform_event_dispatcher.h" |
| 16 #include "ui/gfx/geometry/insets.h" | 16 #include "ui/gfx/geometry/insets.h" |
| 17 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
| 18 #include "ui/gfx/x/x11_atom_cache.h" | |
| 19 | 18 |
| 20 // X forward decls to avoid including Xlib.h in a header file. | 19 // X forward decls to avoid including Xlib.h in a header file. |
| 21 typedef struct _XDisplay XDisplay; | 20 typedef struct _XDisplay XDisplay; |
| 22 typedef unsigned long XID; | 21 typedef unsigned long XID; |
| 23 typedef XID Window; | 22 typedef XID Window; |
| 24 | 23 |
| 25 namespace ui { | 24 namespace ui { |
| 26 class XScopedEventSelector; | 25 class XScopedEventSelector; |
| 27 } | 26 } |
| 28 | 27 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Called when X Configure Notify event is recevied. | 59 // Called when X Configure Notify event is recevied. |
| 61 virtual void OnConfigureNotify(); | 60 virtual void OnConfigureNotify(); |
| 62 | 61 |
| 63 // Translates the native mouse location into screen coordinates and | 62 // Translates the native mouse location into screen coordinates and |
| 64 // dispatches the event via WindowEventDispatcher. | 63 // dispatches the event via WindowEventDispatcher. |
| 65 virtual void TranslateAndDispatchLocatedEvent(ui::LocatedEvent* event); | 64 virtual void TranslateAndDispatchLocatedEvent(ui::LocatedEvent* event); |
| 66 | 65 |
| 67 ::Window x_root_window() { return x_root_window_; } | 66 ::Window x_root_window() { return x_root_window_; } |
| 68 XDisplay* xdisplay() { return xdisplay_; } | 67 XDisplay* xdisplay() { return xdisplay_; } |
| 69 const gfx::Rect& bounds() const { return bounds_; } | 68 const gfx::Rect& bounds() const { return bounds_; } |
| 70 ui::X11AtomCache* atom_cache() { return &atom_cache_; } | |
| 71 | 69 |
| 72 private: | 70 private: |
| 73 // Dispatches XI2 events. Note that some events targetted for the X root | 71 // Dispatches XI2 events. Note that some events targetted for the X root |
| 74 // window are dispatched to the aura root window (e.g. touch events after | 72 // window are dispatched to the aura root window (e.g. touch events after |
| 75 // calibration). | 73 // calibration). |
| 76 void DispatchXI2Event(const base::NativeEvent& event); | 74 void DispatchXI2Event(const base::NativeEvent& event); |
| 77 | 75 |
| 78 // Sets the cursor on |xwindow_| to |cursor|. Does not check or update | 76 // Sets the cursor on |xwindow_| to |cursor|. Does not check or update |
| 79 // |current_cursor_|. | 77 // |current_cursor_|. |
| 80 void SetCursorInternal(gfx::NativeCursor cursor); | 78 void SetCursorInternal(gfx::NativeCursor cursor); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 91 | 89 |
| 92 // Current Aura cursor. | 90 // Current Aura cursor. |
| 93 gfx::NativeCursor current_cursor_; | 91 gfx::NativeCursor current_cursor_; |
| 94 | 92 |
| 95 // Is the window mapped to the screen? | 93 // Is the window mapped to the screen? |
| 96 bool window_mapped_; | 94 bool window_mapped_; |
| 97 | 95 |
| 98 // The bounds of |xwindow_|. | 96 // The bounds of |xwindow_|. |
| 99 gfx::Rect bounds_; | 97 gfx::Rect bounds_; |
| 100 | 98 |
| 101 ui::X11AtomCache atom_cache_; | |
| 102 | |
| 103 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostX11); | 99 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostX11); |
| 104 }; | 100 }; |
| 105 | 101 |
| 106 } // namespace aura | 102 } // namespace aura |
| 107 | 103 |
| 108 #endif // UI_AURA_WINDOW_TREE_HOST_X11_H_ | 104 #endif // UI_AURA_WINDOW_TREE_HOST_X11_H_ |
| OLD | NEW |