eca8fb9ebaff3fa02eecc70530dd22f548805730
[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   const char* DefaultDisplaySpec();
36   bool InitializeHardware();
37   void ShutdownHardware();
38   intptr_t GetNativeDisplay();
39
40   gfx::Screen* CreateDesktopScreen();
41   const views::DesktopScreenWayland* GetPrimaryScreen() const;
42
43   gfx::AcceleratedWidget GetAcceleratedWidget();
44   gfx::AcceleratedWidget RealizeAcceleratedWidget(gfx::AcceleratedWidget w);
45
46   // OutputChangeObserver overrides.
47   virtual void OnOutputSizeChanged(unsigned width, unsigned height) OVERRIDE;
48
49  private:
50   WaylandWindow* GetWidget(gfx::AcceleratedWidget w);
51   void Terminate();
52   void LookAheadOutputGeometry();
53
54   static void DelayedInitialization(OzoneDisplay* display);
55
56   views::DesktopScreenWayland* desktop_screen_;
57   WaylandDisplay* display_;
58   OzoneDisplayChannel* channel_;
59   OzoneDisplayChannelHost* host_;
60   EventConverterOzoneWayland* event_converter_;
61   char* spec_;
62   static OzoneDisplay* instance_;
63   DISALLOW_COPY_AND_ASSIGN(OzoneDisplay);
64 };
65
66 }  // namespace ozonewayland
67
68 #endif  // OZONE_IMPL_OZONE_DISPLAY_H_