Upstream version 6.34.113.0
[platform/framework/web/crosswalk.git] / src / ozone / impl / ozone_display.h
1 // Copyright 2013 Intel Corporation. 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 OZONE_IMPL_OZONE_DISPLAY_H_
6 #define OZONE_IMPL_OZONE_DISPLAY_H_
7
8 #include "ozone/platform/ozone_export_wayland.h"
9 #include "ozone/ui/events/output_change_observer.h"
10 #include "ui/gfx/native_widget_types.h"
11
12 namespace gfx {
13 class Screen;
14 }
15
16 namespace views {
17 class DesktopScreenWayland;
18 }
19
20 namespace ozonewayland {
21
22 class EventConverterOzoneWayland;
23 class OzoneDisplayChannel;
24 class OzoneDisplayChannelHost;
25 class WaylandDisplay;
26 class WaylandWindow;
27
28 class OZONE_WAYLAND_EXPORT OzoneDisplay : public OutputChangeObserver {
29  public:
30   static OzoneDisplay* GetInstance();
31
32   OzoneDisplay();
33   virtual ~OzoneDisplay();
34
35   bool InitializeHardware();
36   void ShutdownHardware();
37   intptr_t GetNativeDisplay();
38
39   gfx::Screen* CreateDesktopScreen();
40   const views::DesktopScreenWayland* GetPrimaryScreen() const;
41
42   gfx::AcceleratedWidget GetAcceleratedWidget();
43   gfx::AcceleratedWidget RealizeAcceleratedWidget(gfx::AcceleratedWidget w);
44
45   // OutputChangeObserver overrides.
46   virtual void OnOutputSizeChanged(unsigned width, unsigned height) OVERRIDE;
47
48  private:
49   WaylandWindow* GetWidget(gfx::AcceleratedWidget w);
50   void Terminate();
51   void LookAheadOutputGeometry();
52
53   static void DelayedInitialization(OzoneDisplay* display);
54
55   views::DesktopScreenWayland* desktop_screen_;
56   WaylandDisplay* display_;
57   OzoneDisplayChannel* channel_;
58   OzoneDisplayChannelHost* host_;
59   EventConverterOzoneWayland* event_converter_;
60   static OzoneDisplay* instance_;
61   DISALLOW_COPY_AND_ASSIGN(OzoneDisplay);
62 };
63
64 }  // namespace ozonewayland
65
66 #endif  // OZONE_IMPL_OZONE_DISPLAY_H_