]> git.saurik.com Git - wxWidgets.git/blob - include/wx/display.h
added more HP-UX charset names
[wxWidgets.git] / include / wx / display.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/display.h
3 // Purpose: wxDisplay class
4 // Author: Royce Mitchell III
5 // Modified by: Vadim Zeitlin (resolution changes, display modes, ...)
6 // Created: 06/21/02
7 // RCS-ID: $Id$
8 // Copyright: (c) 2002-2003 wxWidgets team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DISPLAY_H_BASE_
13 #define _WX_DISPLAY_H_BASE_
14
15 #if wxUSE_DISPLAY
16
17 #include "wx/dynarray.h"
18 #include "wx/vidmode.h"
19
20 class WXDLLEXPORT wxWindow;
21 class WXDLLEXPORT wxPoint;
22 class WXDLLEXPORT wxRect;
23 class WXDLLEXPORT wxString;
24
25 WX_DECLARE_EXPORTED_OBJARRAY(wxVideoMode, wxArrayVideoModes);
26
27 // default, uninitialized, video mode object
28 extern WXDLLEXPORT_DATA(const wxVideoMode) wxDefaultVideoMode;
29
30 // ----------------------------------------------------------------------------
31 // wxDisplayBase: represents a display/monitor attached to the system
32 // ----------------------------------------------------------------------------
33
34 class WXDLLEXPORT wxDisplayBase
35 {
36 public:
37 // initialize the object containing all information about the given
38 // display
39 //
40 // the displays are numbered from 0 to GetCount() - 1, 0 is always the
41 // primary display and the only one which is always supported
42 wxDisplayBase(size_t index = 0);
43
44 // return the number of available displays, valid parameters to
45 // wxDisplay ctor are from 0 up to this number
46 static size_t GetCount();
47
48 // find the display where the given point lies, return wxNOT_FOUND if
49 // it doesn't belong to any display
50 static int GetFromPoint(const wxPoint& pt);
51
52 // find the display where the given window lies, return wxNOT_FOUND if it
53 // is not shown at all
54 static int GetFromWindow(wxWindow *window);
55
56
57 // return true if the object was initialized successfully
58 virtual bool IsOk() const { return true; }
59
60 // get the display size
61 virtual wxRect GetGeometry() const = 0;
62
63 // name may be empty
64 virtual wxString GetName() const = 0;
65
66 // display 0 is usually the primary display
67 virtual bool IsPrimary() const { return m_index == 0; }
68
69
70 // enumerate all video modes supported by this display matching the given
71 // one (in the sense of wxVideoMode::Match())
72 //
73 // as any mode matches the default value of the argument and there is
74 // always at least one video mode supported by display, the returned array
75 // is only empty for the default value of the argument if this function is
76 // not supported at all on this platform
77 virtual wxArrayVideoModes
78 GetModes(const wxVideoMode& mode = wxDefaultVideoMode) const = 0;
79
80 // get current video mode
81 virtual wxVideoMode GetCurrentMode() const = 0;
82
83 // change current mode, return true if succeeded, false otherwise
84 //
85 // for the default value of the argument restores the video mode to default
86 virtual bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode) = 0;
87
88 // restore the default video mode (just a more readable synonym)
89 void ResetMode() { (void)ChangeMode(); }
90
91 // virtual dtor as for any base class
92 virtual ~wxDisplayBase() { }
93
94 protected:
95 // the index of this display (0 is always the primary one)
96 size_t m_index;
97
98 DECLARE_NO_COPY_CLASS(wxDisplayBase)
99 };
100
101
102 #if defined(__WXMSW__)
103 #include "wx/msw/display.h"
104 #elif defined(__WXMOTIF__)
105 #include "wx/unix/displayx11.h"
106 #elif defined(__WXGTK__)
107 #include "wx/unix/displayx11.h"
108 #elif defined(__WXX11__)
109 #include "wx/unix/displayx11.h"
110 #elif defined(__WXCOCOA__)
111 #include "wx/cocoa/display.h"
112 #elif defined(__WXMAC__)
113 #include "wx/mac/display.h"
114 #elif defined(__WXPM__)
115 #include "wx/os2/display.h"
116 #endif
117
118 #endif // wxUSE_DISPLAY
119
120 #endif // _WX_DISPLAY_H_BASE_