]> git.saurik.com Git - wxWidgets.git/blob - interface/display.h
Test header and renderer aligment separately, II
[wxWidgets.git] / interface / display.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: display.h
3 // Purpose: interface of wxDisplay
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxDisplay
11 @wxheader{display.h}
12
13 Determines the sizes and locations of displays connected to the system.
14
15 @library{wxcore}
16 @category{FIXME}
17
18 @see wxClientDisplayRect(), wxDisplaySize(), wxDisplaySizeMM()
19 */
20 class wxDisplay
21 {
22 public:
23 /**
24 Constructor, setting up a wxDisplay instance with the specified display.
25
26 @param index
27 The index of the display to use. This must be non-negative
28 and lower than the value returned by GetCount().
29 */
30 wxDisplay(unsigned index = 0);
31
32 /**
33 Destructor.
34 */
35 ~wxDisplay();
36
37 /**
38 Changes the video mode of this display to the mode specified
39 in the mode parameter.
40 If wxDefaultVideoMode is passed in as the mode parameter,
41 the defined behaviour is that wxDisplay will reset the video
42 mode to the default mode used by the display. On Windows,
43 the behavior is normal. However, there are differences on other
44 platforms. On Unix variations using X11 extensions it should
45 behave as defined, but some irregularities may occur.
46 On wxMac passing in wxDefaultVideoMode as the mode
47 parameter does nothing. This happens because carbon
48 no longer has access to DMUseScreenPrefs, an undocumented
49 function that changed the video mode to the system
50 default by using the system's 'scrn' resource.
51 */
52 bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode);
53
54 /**
55 Returns the client area of the display. The client area is the part of the
56 display available for the normal (non full screen) windows, usually it is the
57 same as GetGeometry() but it could be less if
58 there is a taskbar (or equivalent) on this display.
59 */
60 wxRect GetClientArea() const;
61
62 /**
63 Returns the number of connected displays.
64 */
65 static unsigned GetCount();
66
67 /**
68 Returns the current video mode that this display is in.
69 */
70 wxVideoMode GetCurrentMode() const;
71
72 /**
73 Returns the bit depth of the display whose index was passed to the constructor.
74 */
75 int GetDepth() const;
76
77 /**
78 Returns the index of the display on which the given point lies. Returns
79 @c wxNOT_FOUND if the point is not on any connected display.
80
81 @param pt
82 The point to locate.
83 */
84 static int GetFromPoint(const wxPoint& pt);
85
86 /**
87 Returns the index of the display on which the given window lies.
88 If the window is on more than one display it gets the display that overlaps the
89 window the most.
90 Returns @c wxNOT_FOUND if the window is not on any connected display.
91
92 @param win
93 The window to locate.
94 */
95 static int GetFromWindow(const wxWindow* win);
96
97 /**
98 Returns the bounding rectangle of the display whose index was passed to the
99 constructor.
100 */
101 wxRect GetGeometry() const;
102
103 /**
104 Fills and returns an array with all the video modes that
105 are supported by this display, or video modes that are
106 supported by this display and match the mode parameter
107 (if mode is not wxDefaultVideoMode).
108 */
109 wxArrayVideoModes GetModes(const wxVideoMode& mode = wxDefaultVideoMode) const;
110
111 /**
112 Returns the display's name. A name is not available on all platforms.
113 */
114 wxString GetName() const;
115
116 /**
117 Returns @true if the display is the primary display. The primary display is the
118 one whose index is 0.
119 */
120 bool IsPrimary();
121 };
122