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

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

Issue 7457023: Adding a Wayland basic toolkit (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Naming for inlined functions Created 9 years, 4 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
OLDNEW
(Empty)
1 // Copyright (c) 2011 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,
48 int32_t x,
49 int32_t y,
50 int32_t physical_width,
51 int32_t physical_height,
52 int32_t subpixel,
53 const char* make,
54 const char* model);
55 static void OutputHandleMode(void* data,
56 wl_output* wl_output,
57 uint32_t flags,
58 int32_t width,
59 int32_t height,
60 int32_t refresh);
61
62 // The Wayland output this object wraps
63 wl_output* output_;
64 // The display that the output is associated with
tfarina 2011/07/26 14:49:28 separating each member variable with blank lines b
65 WaylandDisplay* display_;
66 // The position of the screen. This is important in multi monitor display
67 // since it provides the position of the screen in the virtual screen.
68 gfx::Point position_;
69
70 // List of supported modes
71 Modes modes_;
72
73 DISALLOW_COPY_AND_ASSIGN(WaylandScreen);
74 };
75
76 } // namespace ui
77
78 #endif // UI_WAYLAND_WAYLAND_SCREEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698