]> git.saurik.com Git - wxWidgets.git/blob - include/wx/display.h
The standalone PyShell and PyCrust apps need to set the focus to the
[wxWidgets.git] / include / wx / display.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: display.h
3 // Purpose: wxDisplay class
4 // Author: Royce Mitchell III
5 // Modified by:
6 // Created: 06/21/02
7 // RCS-ID: $Id$
8 // Copyright: (c) wxWindows 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 #if defined(__GNUG__) && !defined(__APPLE__)
18 #pragma interface "display.h"
19 #endif
20
21 class wxPoint;
22 class wxRect;
23 class wxString;
24
25 class WXDLLEXPORT wxDisplayBase
26 {
27 public:
28 // initialize the object containing all information about the given
29 // display
30 wxDisplayBase ( size_t index = 0 ) : m_index ( index )
31 {
32 wxASSERT_MSG(m_index < wxDisplayBase::GetCount(), wxT("An invalid index was passed to wxDisplay"));
33 }
34
35 // accessors
36
37 // return the number of available displays, valid parameters to
38 // wxDisplay ctor are from 0 up to this number
39 static size_t GetCount();
40
41 // find the display where the given point lies, return -1 if
42 // it doesn't belong to any display
43 static int GetFromPoint ( const wxPoint& pt );
44
45 virtual wxRect GetGeometry() const = 0;
46 virtual int GetDepth() const = 0;
47 bool IsColour() const { return GetDepth() != 1; }
48
49 // some people never learn to spell ;-)
50 bool IsColor() const { return IsColour(); }
51
52 // name may be empty
53 virtual wxString GetName() const = 0;
54
55 // let display 0 always be the primary display
56 bool IsPrimary() { return m_index == 0; }
57
58
59 virtual ~wxDisplayBase() {}
60
61 protected:
62 size_t m_index; // which display did we select when creating this file?
63
64 DECLARE_NO_COPY_CLASS(wxDisplayBase);
65 };
66
67 #if defined(__WXMSW__)
68 #include "wx/msw/display.h"
69 #elif defined(__WXMOTIF__)
70 #include "wx/motif/display.h"
71 #elif defined(__WXGTK__)
72 #include "wx/gtk/display.h"
73 #elif defined(__WXMAC__)
74 #include "wx/mac/display.h"
75 #elif defined(__WXPM__)
76 #include "wx/os2/display.h"
77 #endif
78
79 #endif // wxUSE_DISPLAY
80
81 #endif // _WX_DISPLAY_H_BASE_