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

Side by Side Diff: ui/gfx/screen.h

Issue 854713003: More old files deletion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix tryjobs? Created 5 years, 11 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
« no previous file with comments | « ui/gfx/scoped_ns_graphics_context_save_gstate_mac.mm ('k') | ui/gfx/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 (c) 2012 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_GFX_SCREEN_H_
6 #define UI_GFX_SCREEN_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "ui/gfx/display.h"
12 #include "ui/gfx/gfx_export.h"
13 #include "ui/gfx/native_widget_types.h"
14 #include "ui/gfx/point.h"
15 #include "ui/gfx/screen_type_delegate.h"
16
17 namespace gfx {
18 class DisplayObserver;
19 class Rect;
20
21 // A utility class for getting various info about screen size, displays,
22 // cursor position, etc.
23 //
24 // Note that this class does not represent an individual display connected to a
25 // computer -- see the Display class for that. A single Screen object exists on
26 // most operating systems regardless of the number of connected displays. On
27 // Windows 8, two Screens exist: one for Metro UI and another for the desktop.
28 class GFX_EXPORT Screen {
29 public:
30 // Retrieves the Screen that the specified NativeView belongs to. A value of
31 // NULL is treated as |SCREEN_TYPE_NATIVE|.
32 static Screen* GetScreenFor(NativeView view);
33
34 // Returns the SCREEN_TYPE_NATIVE Screen. This should be used with caution,
35 // as it is likely to be incorrect for code that runs on Windows.
36 static Screen* GetNativeScreen();
37
38 // Sets the global screen for a particular screen type. Only the _NATIVE
39 // ScreenType must be provided.
40 static void SetScreenInstance(ScreenType type, Screen* instance);
41
42 // Returns the global screen for a particular type. Types other than _NATIVE
43 // may be NULL.
44 static Screen* GetScreenByType(ScreenType type);
45
46 // Sets the global ScreenTypeDelegate. May be left unset if the platform
47 // uses only the _NATIVE ScreenType.
48 static void SetScreenTypeDelegate(ScreenTypeDelegate* delegate);
49
50 Screen();
51 virtual ~Screen();
52
53 // Returns true if DIP is enabled.
54 virtual bool IsDIPEnabled() = 0;
55
56 // Returns the current absolute position of the mouse pointer.
57 virtual gfx::Point GetCursorScreenPoint() = 0;
58
59 // Returns the window under the cursor.
60 virtual gfx::NativeWindow GetWindowUnderCursor() = 0;
61
62 // Returns the window at the given screen coordinate |point|.
63 virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) = 0;
64
65 // Returns the number of displays.
66 // Mirrored displays are excluded; this method is intended to return the
67 // number of distinct, usable displays.
68 virtual int GetNumDisplays() const = 0;
69
70 // Returns the list of displays that are currently available.
71 virtual std::vector<gfx::Display> GetAllDisplays() const = 0;
72
73 // Returns the display nearest the specified window.
74 // If the window is NULL or the window is not rooted to a display this will
75 // return the primary display.
76 virtual gfx::Display GetDisplayNearestWindow(NativeView view) const = 0;
77
78 // Returns the display nearest the specified point.
79 virtual gfx::Display GetDisplayNearestPoint(
80 const gfx::Point& point) const = 0;
81
82 // Returns the display that most closely intersects the provided bounds.
83 virtual gfx::Display GetDisplayMatching(
84 const gfx::Rect& match_rect) const = 0;
85
86 // Returns the primary display.
87 virtual gfx::Display GetPrimaryDisplay() const = 0;
88
89 // Adds/Removes display observers.
90 virtual void AddObserver(DisplayObserver* observer) = 0;
91 virtual void RemoveObserver(DisplayObserver* observer) = 0;
92
93 private:
94 DISALLOW_COPY_AND_ASSIGN(Screen);
95 };
96
97 Screen* CreateNativeScreen();
98
99 } // namespace gfx
100
101 #endif // UI_GFX_SCREEN_H_
OLDNEW
« no previous file with comments | « ui/gfx/scoped_ns_graphics_context_save_gstate_mac.mm ('k') | ui/gfx/screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698