Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: ui/wayland/wayland_screen.h

Issue 17265006: wayland patch for inspection Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/wayland/wayland_input_method_event_filter.cc ('k') | ui/wayland/wayland_screen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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 UI_WAYLAND_WAYLAND_SCREEN_H_
6 #define UI_WAYLAND_WAYLAND_SCREEN_H_
7
8 #include <stdint.h>
9
10 #include <list>
11
12 #include "base/basictypes.h"
13 #include "ui/gfx/point.h"
14 #include "ui/gfx/rect.h"
15
16 struct wl_output;
17
18 namespace ui {
19
20 class WaylandDisplay;
21
22 // WaylandScreen objects keep track of the current outputs (screens/monitors)
23 // that are available to the application.
24 class WaylandScreen {
25 public:
26 WaylandScreen(WaylandDisplay* display, uint32_t id);
27 ~WaylandScreen();
28
29 // Returns the active allocation of the screen.
30 gfx::Rect GetAllocation() const;
31
32 private:
33 // Used to store information regarding the available modes for the current
34 // screen.
35 // - (width, height): is the resolution of the screen
36 // - refresh: is the refresh rate of the screen under this mode
37 // - flags: contains extra information regarding the mode. The most important
38 // is the active mode flag.
39 struct Mode {
40 int32_t width, height, refresh, flags;
41 };
42 typedef std::list<Mode> Modes;
43
44 // Callback functions that allows the display to initialize the screen's
45 // position and available modes.
46 static void OutputHandleGeometry(void* data,
47 wl_output* output, int32_t x, int32_t y,
48 int32_t physical_width, int32_t physical_height,
49 int32_t subpixel, const char* make,
50 const char* model, int32_t output_transform);
51
52 static void OutputHandleMode(void* data,
53 wl_output* wl_output, uint32_t flags,
54 int32_t width, int32_t height,
55 int32_t refresh);
56
57 // The Wayland output this object wraps
58 wl_output* output_;
59 // The display that the output is associated with
60 WaylandDisplay* display_;
61 // The position of the screen. This is important in multi monitor display
62 // since it provides the position of the screen in the virtual screen.
63 gfx::Point position_;
64
65 // List of supported modes
66 Modes modes_;
67
68 DISALLOW_COPY_AND_ASSIGN(WaylandScreen);
69 };
70
71 } // namespace ui
72
73 #endif // UI_WAYLAND_WAYLAND_SCREEN_H_
OLDNEW
« no previous file with comments | « ui/wayland/wayland_input_method_event_filter.cc ('k') | ui/wayland/wayland_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698