]> git.saurik.com Git - wxWidgets.git/blame - interface/display.h
pen.h depends from brush.h in compat mode
[wxWidgets.git] / interface / display.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: display.h
e54c96f1 3// Purpose: interface of wxDisplay
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxDisplay
11 @wxheader{display.h}
7c913512 12
23324ae1 13 Determines the sizes and locations of displays connected to the system.
7c913512 14
23324ae1
FM
15 @library{wxcore}
16 @category{FIXME}
7c913512 17
e54c96f1 18 @see wxClientDisplayRect(), wxDisplaySize(), wxDisplaySizeMM()
23324ae1 19*/
7c913512 20class wxDisplay
23324ae1
FM
21{
22public:
23 /**
24 Constructor, setting up a wxDisplay instance with the specified display.
25
7c913512 26 @param index
4cc4bfaf
FM
27 The index of the display to use. This must be non-negative
28 and lower than the value returned by GetCount().
23324ae1
FM
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.
23324ae1
FM
40 If wxDefaultVideoMode is passed in as the mode parameter,
41 the defined behaviour is that wxDisplay will reset the video
7c913512 42 mode to the default mode used by the display. On Windows,
23324ae1
FM
43 the behavior is normal. However, there are differences on other
44 platforms. On Unix variations using X11 extensions it should
7c913512 45 behave as defined, but some irregularities may occur.
23324ae1 46 On wxMac passing in wxDefaultVideoMode as the mode
7c913512 47 parameter does nothing. This happens because carbon
23324ae1
FM
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 */
328f5751 60 wxRect GetClientArea() const;
23324ae1
FM
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 */
328f5751 70 wxVideoMode GetCurrentMode() const;
23324ae1
FM
71
72 /**
73 Returns the bit depth of the display whose index was passed to the constructor.
74 */
328f5751 75 int GetDepth() const;
23324ae1
FM
76
77 /**
7c913512 78 Returns the index of the display on which the given point lies. Returns
23324ae1
FM
79 @c wxNOT_FOUND if the point is not on any connected display.
80
7c913512 81 @param pt
4cc4bfaf 82 The point to locate.
23324ae1
FM
83 */
84 static int GetFromPoint(const wxPoint& pt);
85
86 /**
87 Returns the index of the display on which the given window lies.
23324ae1
FM
88 If the window is on more than one display it gets the display that overlaps the
89 window the most.
23324ae1
FM
90 Returns @c wxNOT_FOUND if the window is not on any connected display.
91
7c913512 92 @param win
4cc4bfaf 93 The window to locate.
23324ae1
FM
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 */
328f5751 101 wxRect GetGeometry() const;
23324ae1
FM
102
103 /**
104 Fills and returns an array with all the video modes that
7c913512 105 are supported by this display, or video modes that are
23324ae1
FM
106 supported by this display and match the mode parameter
107 (if mode is not wxDefaultVideoMode).
108 */
328f5751 109 wxArrayVideoModes GetModes(const wxVideoMode& mode = wxDefaultVideoMode) const;
23324ae1
FM
110
111 /**
112 Returns the display's name. A name is not available on all platforms.
113 */
328f5751 114 wxString GetName() const;
23324ae1
FM
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};
e54c96f1 122