OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ | |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ | |
7 | |
8 #include "ui/gfx/native_widget_types.h" | |
9 #include "ui/gfx/x/x11_types.h" | |
10 | |
11 namespace views { | |
12 | |
13 // Runs a nested message loop and grabs the mouse. This is used to implement | |
14 // dragging. | |
15 class X11MoveLoop { | |
16 public: | |
17 virtual ~X11MoveLoop() {} | |
18 | |
19 // Runs the nested message loop. While the mouse is grabbed, use |cursor| as | |
20 // the mouse cursor. Returns true if the move-loop is completed successfully. | |
21 // If the pointer-grab fails, or the move-loop is canceled by the user (e.g. | |
22 // by pressing escape), then returns false. | |
23 virtual bool RunMoveLoop(aura::Window* window, gfx::NativeCursor cursor) = 0; | |
24 | |
25 // Updates the cursor while the move loop is running. | |
26 virtual void UpdateCursor(gfx::NativeCursor cursor) = 0; | |
27 | |
28 // Ends the RunMoveLoop() that's currently in progress. | |
29 virtual void EndMoveLoop() = 0; | |
30 | |
31 // Sets an image to be used during the drag. | |
32 virtual void SetDragImage(const gfx::ImageSkia& image, | |
33 const gfx::Vector2dF& offset) = 0; | |
34 }; | |
35 | |
36 } // namespace views | |
37 | |
38 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ | |
OLD | NEW |