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_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
7 | 7 |
8 #include <X11/extensions/shape.h> | 8 #include <X11/extensions/shape.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "ui/aura/window_tree_host.h" | 14 #include "ui/aura/window_tree_host.h" |
15 #include "ui/base/cursor/cursor_loader_x11.h" | 15 #include "ui/base/cursor/cursor_loader_x11.h" |
| 16 #include "ui/events/platform/platform_event_dispatcher.h" |
16 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
17 #include "ui/gfx/x/x11_atom_cache.h" | 18 #include "ui/gfx/x/x11_atom_cache.h" |
18 #include "ui/views/views_export.h" | 19 #include "ui/views/views_export.h" |
19 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" | 20 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" |
20 | 21 |
21 namespace gfx { | 22 namespace gfx { |
22 class ImageSkia; | 23 class ImageSkia; |
23 class ImageSkiaRep; | 24 class ImageSkiaRep; |
24 } | 25 } |
25 | 26 |
26 namespace views { | 27 namespace views { |
27 class DesktopDragDropClientAuraX11; | 28 class DesktopDragDropClientAuraX11; |
28 class DesktopDispatcherClient; | 29 class DesktopDispatcherClient; |
29 class DesktopWindowTreeHostObserverX11; | 30 class DesktopWindowTreeHostObserverX11; |
30 class X11DesktopWindowMoveClient; | 31 class X11DesktopWindowMoveClient; |
31 class X11ScopedCapture; | 32 class X11ScopedCapture; |
32 class X11WindowEventFilter; | 33 class X11WindowEventFilter; |
33 | 34 |
34 class VIEWS_EXPORT DesktopWindowTreeHostX11 : | 35 class VIEWS_EXPORT DesktopWindowTreeHostX11 |
35 public DesktopWindowTreeHost, | 36 : public DesktopWindowTreeHost, |
36 public aura::WindowTreeHost, | 37 public aura::WindowTreeHost, |
37 public ui::EventSource, | 38 public ui::EventSource, |
38 public base::MessagePumpDispatcher { | 39 public ui::PlatformEventDispatcher { |
39 public: | 40 public: |
40 DesktopWindowTreeHostX11( | 41 DesktopWindowTreeHostX11( |
41 internal::NativeWidgetDelegate* native_widget_delegate, | 42 internal::NativeWidgetDelegate* native_widget_delegate, |
42 DesktopNativeWidgetAura* desktop_native_widget_aura); | 43 DesktopNativeWidgetAura* desktop_native_widget_aura); |
43 virtual ~DesktopWindowTreeHostX11(); | 44 virtual ~DesktopWindowTreeHostX11(); |
44 | 45 |
45 // A way of converting an X11 |xid| host window into a |content_window_|. | 46 // A way of converting an X11 |xid| host window into a |content_window_|. |
46 static aura::Window* GetContentWindowForXID(XID xid); | 47 static aura::Window* GetContentWindowForXID(XID xid); |
47 | 48 |
48 // A way of converting an X11 |xid| host window into this object. | 49 // A way of converting an X11 |xid| host window into this object. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Serializes an image to the format used by _NET_WM_ICON. | 197 // Serializes an image to the format used by _NET_WM_ICON. |
197 void SerializeImageRepresentation(const gfx::ImageSkiaRep& rep, | 198 void SerializeImageRepresentation(const gfx::ImageSkiaRep& rep, |
198 std::vector<unsigned long>* data); | 199 std::vector<unsigned long>* data); |
199 | 200 |
200 // See comment for variable open_windows_. | 201 // See comment for variable open_windows_. |
201 static std::list<XID>& open_windows(); | 202 static std::list<XID>& open_windows(); |
202 | 203 |
203 // Map the window (shows it) taking into account the given |show_state|. | 204 // Map the window (shows it) taking into account the given |show_state|. |
204 void MapWindow(ui::WindowShowState show_state); | 205 void MapWindow(ui::WindowShowState show_state); |
205 | 206 |
206 // Overridden from Dispatcher: | 207 // ui::PlatformEventDispatcher: |
207 virtual uint32_t Dispatch(const base::NativeEvent& event) OVERRIDE; | 208 virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE; |
| 209 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE; |
208 | 210 |
209 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; | 211 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; |
210 | 212 |
211 // X11 things | 213 // X11 things |
212 // The display and the native X window hosting the root window. | 214 // The display and the native X window hosting the root window. |
213 XDisplay* xdisplay_; | 215 XDisplay* xdisplay_; |
214 ::Window xwindow_; | 216 ::Window xwindow_; |
215 | 217 |
216 // The native root window. | 218 // The native root window. |
217 ::Window x_root_window_; | 219 ::Window x_root_window_; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 // attention to the window or completely ignore the hint. We stop flashing | 298 // attention to the window or completely ignore the hint. We stop flashing |
297 // the frame when |xwindow_| gains focus or handles a mouse button event. | 299 // the frame when |xwindow_| gains focus or handles a mouse button event. |
298 bool urgency_hint_set_; | 300 bool urgency_hint_set_; |
299 | 301 |
300 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); | 302 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); |
301 }; | 303 }; |
302 | 304 |
303 } // namespace views | 305 } // namespace views |
304 | 306 |
305 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 307 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
OLD | NEW |