blob: 1eb89ca4f8a7a2eaedc3a452ae7aa04a20e33ac0 [file] [log] [blame]
[email protected]81585f32011-07-29 19:32:061// 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]b1b155512011-08-18 22:47:509#include "aura/window.h"
[email protected]81585f32011-07-29 19:32:0610#include "base/basictypes.h"
11#include "base/memory/ref_counted.h"
12#include "ui/gfx/native_widget_types.h"
13
14namespace gfx {
15class Size;
16}
17
18namespace ui {
19class Compositor;
[email protected]81585f32011-07-29 19:32:0620}
21
22namespace aura {
23
[email protected]a83f0f22011-08-23 15:39:1524class MouseEvent;
[email protected]b1b155512011-08-18 22:47:5025class Window;
26
[email protected]81585f32011-07-29 19:32:0627// Desktop is responsible for hosting a set of windows.
28class Desktop {
29 public:
[email protected]50bde0382011-08-25 21:44:2930 Desktop(gfx::AcceleratedWidget widget, const gfx::Size& size);
[email protected]81585f32011-07-29 19:32:0631 ~Desktop();
32
33 // Draws the necessary set of windows.
34 void Draw();
35
[email protected]a83f0f22011-08-23 15:39:1536 // Handles a mouse event. Returns true if handled.
37 bool OnMouseEvent(const MouseEvent& event);
38
[email protected]81585f32011-07-29 19:32:0639 // Compositor we're drawing to.
40 ui::Compositor* compositor() { return compositor_.get(); }
41
[email protected]b1b155512011-08-18 22:47:5042 Window* window() { return window_.get(); }
43
[email protected]81585f32011-07-29 19:32:0644 private:
[email protected]81585f32011-07-29 19:32:0645 scoped_refptr<ui::Compositor> compositor_;
46
[email protected]b1b155512011-08-18 22:47:5047 scoped_ptr<Window> window_;
[email protected]81585f32011-07-29 19:32:0648
[email protected]81585f32011-07-29 19:32:0649 DISALLOW_COPY_AND_ASSIGN(Desktop);
50};
51
52} // namespace aura
53
54#endif // AURA_DESKTOP_H_