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.
5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WINDOW_H_
6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/display/types/display_snapshot.h"
10 #include "ui/events/platform/platform_event_dispatcher.h"
11 #include "ui/gfx/geometry/rect.h"
12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/ozone/platform/dri/channel_observer.h"
14 #include "ui/platform_window/platform_window.h"
19 class DriWindowDelegate
;
20 class DriWindowManager
;
21 class EventFactoryEvdev
;
22 class DriGpuPlatformSupportHost
;
24 class DriWindow
: public PlatformWindow
,
25 public PlatformEventDispatcher
,
26 public ChannelObserver
{
28 DriWindow(PlatformWindowDelegate
* delegate
,
29 const gfx::Rect
& bounds
,
30 DriGpuPlatformSupportHost
* sender
,
31 EventFactoryEvdev
* event_factory
,
32 DriWindowManager
* window_manager
,
33 DisplayManager
* display_manager
);
34 ~DriWindow() override
;
41 void Close() override
;
42 void SetBounds(const gfx::Rect
& bounds
) override
;
43 gfx::Rect
GetBounds() override
;
44 void SetCapture() override
;
45 void ReleaseCapture() override
;
46 void ToggleFullscreen() override
;
47 void Maximize() override
;
48 void Minimize() override
;
49 void Restore() override
;
50 void SetCursor(PlatformCursor cursor
) override
;
51 void MoveCursorTo(const gfx::Point
& location
) override
;
53 // PlatformEventDispatcher:
54 bool CanDispatchEvent(const PlatformEvent
& event
) override
;
55 uint32_t DispatchEvent(const PlatformEvent
& event
) override
;
58 void OnChannelEstablished() override
;
59 void OnChannelDestroyed() override
;
62 PlatformWindowDelegate
* delegate_
; // Not owned.
63 DriGpuPlatformSupportHost
* sender_
; // Not owned.
64 EventFactoryEvdev
* event_factory_
; // Not owned.
65 DriWindowManager
* window_manager_
; // Not owned.
66 DisplayManager
* display_manager_
; // Not owned.
69 gfx::AcceleratedWidget widget_
;
71 DISALLOW_COPY_AND_ASSIGN(DriWindow
);
76 #endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_H_