[email protected] | 81585f3 | 2011-07-29 19:32:06 | [diff] [blame] | 1 | // Copyright (c) 2011 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 AURA_DESKTOP_H_ | ||||
6 | #define AURA_DESKTOP_H_ | ||||
7 | #pragma once | ||||
8 | |||||
[email protected] | b1b15551 | 2011-08-18 22:47:50 | [diff] [blame] | 9 | #include "aura/window.h" |
[email protected] | 81585f3 | 2011-07-29 19:32:06 | [diff] [blame] | 10 | #include "base/basictypes.h" |
11 | #include "base/memory/ref_counted.h" | ||||
12 | #include "ui/gfx/native_widget_types.h" | ||||
13 | |||||
14 | namespace gfx { | ||||
15 | class Size; | ||||
16 | } | ||||
17 | |||||
18 | namespace ui { | ||||
19 | class Compositor; | ||||
[email protected] | 81585f3 | 2011-07-29 19:32:06 | [diff] [blame] | 20 | } |
21 | |||||
22 | namespace aura { | ||||
23 | |||||
[email protected] | a83f0f2 | 2011-08-23 15:39:15 | [diff] [blame] | 24 | class MouseEvent; |
[email protected] | b1b15551 | 2011-08-18 22:47:50 | [diff] [blame] | 25 | class Window; |
26 | |||||
[email protected] | 81585f3 | 2011-07-29 19:32:06 | [diff] [blame] | 27 | // Desktop is responsible for hosting a set of windows. |
28 | class Desktop { | ||||
29 | public: | ||||
[email protected] | 50bde038 | 2011-08-25 21:44:29 | [diff] [blame] | 30 | Desktop(gfx::AcceleratedWidget widget, const gfx::Size& size); |
[email protected] | 81585f3 | 2011-07-29 19:32:06 | [diff] [blame] | 31 | ~Desktop(); |
32 | |||||
33 | // Draws the necessary set of windows. | ||||
34 | void Draw(); | ||||
35 | |||||
[email protected] | a83f0f2 | 2011-08-23 15:39:15 | [diff] [blame] | 36 | // Handles a mouse event. Returns true if handled. |
37 | bool OnMouseEvent(const MouseEvent& event); | ||||
38 | |||||
[email protected] | 81585f3 | 2011-07-29 19:32:06 | [diff] [blame] | 39 | // Compositor we're drawing to. |
40 | ui::Compositor* compositor() { return compositor_.get(); } | ||||
41 | |||||
[email protected] | b1b15551 | 2011-08-18 22:47:50 | [diff] [blame] | 42 | Window* window() { return window_.get(); } |
43 | |||||
[email protected] | 81585f3 | 2011-07-29 19:32:06 | [diff] [blame] | 44 | private: |
[email protected] | 81585f3 | 2011-07-29 19:32:06 | [diff] [blame] | 45 | scoped_refptr<ui::Compositor> compositor_; |
46 | |||||
[email protected] | b1b15551 | 2011-08-18 22:47:50 | [diff] [blame] | 47 | scoped_ptr<Window> window_; |
[email protected] | 81585f3 | 2011-07-29 19:32:06 | [diff] [blame] | 48 | |
[email protected] | 81585f3 | 2011-07-29 19:32:06 | [diff] [blame] | 49 | DISALLOW_COPY_AND_ASSIGN(Desktop); |
50 | }; | ||||
51 | |||||
52 | } // namespace aura | ||||
53 | |||||
54 | #endif // AURA_DESKTOP_H_ |