]> git.saurik.com Git - wxWidgets.git/blame - include/wx/display.h
define wxEventLoopBase::ms_activeLoop in appcmn.cpp instead of doing it in all platfo...
[wxWidgets.git] / include / wx / display.h
CommitLineData
a536e411 1/////////////////////////////////////////////////////////////////////////////
bfc90810 2// Name: wx/display.h
a536e411
JS
3// Purpose: wxDisplay class
4// Author: Royce Mitchell III
bfc90810 5// Modified by: Vadim Zeitlin (resolution changes, display modes, ...)
a536e411
JS
6// Created: 06/21/02
7// RCS-ID: $Id$
77ffb593 8// Copyright: (c) 2002-2003 wxWidgets team
65571936 9// Licence: wxWindows licence
a536e411
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_DISPLAY_H_BASE_
13#define _WX_DISPLAY_H_BASE_
14
fdc37e95 15#if wxUSE_DISPLAY
a536e411 16
bfc90810 17#include "wx/dynarray.h"
fedec981 18#include "wx/vidmode.h"
bfc90810 19
e97251c5 20class WXDLLEXPORT wxWindow;
3dd514f1
VZ
21class WXDLLEXPORT wxPoint;
22class WXDLLEXPORT wxRect;
68379eaf 23class WXDLLEXPORT wxString;
e97251c5 24
bfc90810
VZ
25WX_DECLARE_EXPORTED_OBJARRAY(wxVideoMode, wxArrayVideoModes);
26
27// default, uninitialized, video mode object
16cba29d 28extern WXDLLEXPORT_DATA(const wxVideoMode) wxDefaultVideoMode;
bfc90810
VZ
29
30// ----------------------------------------------------------------------------
31// wxDisplayBase: represents a display/monitor attached to the system
32// ----------------------------------------------------------------------------
a536e411
JS
33
34class WXDLLEXPORT wxDisplayBase
35{
36public:
37 // initialize the object containing all information about the given
38 // display
bfc90810
VZ
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);
a536e411
JS
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
bfc90810 48 // find the display where the given point lies, return wxNOT_FOUND if
a536e411 49 // it doesn't belong to any display
bfc90810
VZ
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);
a536e411 55
a536e411 56
06efac1f
VZ
57 // return true if the object was initialized successfully
58 virtual bool IsOk() const { return true; }
59
bfc90810
VZ
60 // get the display size
61 virtual wxRect GetGeometry() const = 0;
a536e411
JS
62
63 // name may be empty
64 virtual wxString GetName() const = 0;
65
24d2b4f5
RN
66 // display 0 is usually the primary display
67 virtual bool IsPrimary() const { return m_index == 0; }
bfc90810 68
a536e411 69
bfc90810
VZ
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;
a536e411 79
bfc90810
VZ
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() { }
a536e411
JS
93
94protected:
bfc90810
VZ
95 // the index of this display (0 is always the primary one)
96 size_t m_index;
a536e411 97
b2644cc3 98 DECLARE_NO_COPY_CLASS(wxDisplayBase)
a536e411
JS
99};
100
bfc90810 101
a536e411
JS
102#if defined(__WXMSW__)
103 #include "wx/msw/display.h"
104#elif defined(__WXMOTIF__)
b96f9d19 105 #include "wx/unix/displayx11.h"
a536e411 106#elif defined(__WXGTK__)
b1b3ddd8 107 #include "wx/unix/displayx11.h"
11e72075
MB
108#elif defined(__WXX11__)
109 #include "wx/unix/displayx11.h"
51259762
RN
110#elif defined(__WXCOCOA__)
111 #include "wx/cocoa/display.h"
a536e411
JS
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_