Upstream version 9.37.197.0
[platform/framework/web/crosswalk.git] / src / ozone / wayland / proxy_display.h
1 // Copyright 2014 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_WAYLAND_PROXY_DISPLAY_H_
6 #define OZONE_WAYLAND_PROXY_DISPLAY_H_
7
8 #if !defined(__STDC_FORMAT_MACROS)
9 #define __STDC_FORMAT_MACROS
10 #endif
11
12 #include <wayland-client.h>
13 #include "ozone/ui/gfx/ozone_display.h"
14
15 namespace ozonewayland {
16
17 class WaylandScreen;
18 // WaylandProxyDisplay is a wrapper around wl_display. Once we get a valid
19 // wl_display, the Wayland server will send different events to register
20 // the Wayland compositor, shell, screens, input devices, ...
21 class WaylandProxyDisplay : public ui::OzoneDisplay {
22  public:
23   explicit WaylandProxyDisplay();
24   virtual ~WaylandProxyDisplay();
25
26   virtual void LookAheadOutputGeometry() OVERRIDE;
27
28  private:
29   // This handler resolves only screen registration. In general you don't want
30   // to use this but the one below.
31   static void DisplayHandleOutputOnly(
32       void *data,
33       struct wl_registry *registry,
34       uint32_t name,
35       const char *interface,
36       uint32_t version);
37
38   // WaylandProxyDisplay manages the memory of all these pointers.
39   WaylandScreen* screen_;
40   DISALLOW_COPY_AND_ASSIGN(WaylandProxyDisplay);
41 };
42
43 }  // namespace ozonewayland
44
45 #endif  // OZONE_WAYLAND_PROXY_DISPLAY_H_