/usr/include/wx-3.0/wx/wxPython/i_files/_display.i is in python-wxgtk3.0-dev 3.0.2.0+dfsg-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | /////////////////////////////////////////////////////////////////////////////
// Name: _display.i
// Purpose: SWIG interface for wxVideoMode and wxDisplay
//
// Author: Robin Dunn
//
// Created: 9-Mar-2004
// RCS-ID: $Id$
// Copyright: (c) 2004 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
//---------------------------------------------------------------------------
%{
#include <wx/display.h>
#include <wx/vidmode.h>
%}
//---------------------------------------------------------------------------
%newgroup
DocStr(wxVideoMode,
"A simple struct containing video mode parameters for a display", "");
struct wxVideoMode
{
wxVideoMode(int width = 0, int height = 0, int depth = 0, int freq = 0);
~wxVideoMode();
DocDeclStr(
bool , Matches(const wxVideoMode& other) const,
"Returns True if this mode matches the other one in the sense that all
non-zero fields of the other mode have the same value in this
one (except for refresh which is allowed to have a greater value)", "");
DocDeclStr(
int , GetWidth() const,
"Returns the screen width in pixels (e.g. 640*480), 0 means unspecified", "");
DocDeclStr(
int , GetHeight() const,
"Returns the screen height in pixels (e.g. 640*480), 0 means unspecified", "");
DocDeclStr(
int , GetDepth() const,
"Returns the screen's bits per pixel (e.g. 32), 1 is monochrome and 0
means unspecified/known", "");
int GetRefresh() const;
DocDeclStr(
bool , IsOk() const,
"returns true if the object has been initialized", "");
%pythoncode { def __nonzero__(self): return self.IsOk() }
%extend {
bool __eq__(const wxVideoMode* other) { return other ? (*self == *other) : false; }
bool __ne__(const wxVideoMode* other) { return other ? (*self != *other) : true; }
}
// the screen size in pixels (e.g. 640*480), 0 means unspecified
int w, h;
// bits per pixel (e.g. 32), 1 is monochrome and 0 means unspecified/known
int bpp;
// refresh frequency in Hz, 0 means unspecified/unknown
int refresh;
%property(Depth, GetDepth, doc="See `GetDepth`");
%property(Height, GetHeight, doc="See `GetHeight`");
%property(Width, GetWidth, doc="See `GetWidth`");
%property(Refresh, GetRefresh);
};
%{
#if !wxUSE_DISPLAY
const wxVideoMode wxDefaultVideoMode;
#endif
%}
%immutable;
const wxVideoMode wxDefaultVideoMode;
%mutable;
//---------------------------------------------------------------------------
MustHaveApp(wxDisplay);
MustHaveApp(wxDisplay::GetCount);
MustHaveApp(wxDisplay::GetFromPoint);
MustHaveApp(wxDisplay::GetFromWindow);
DocStr(wxDisplay,
"Represents a display/monitor attached to the system", "");
class wxDisplay
{
public:
DocCtorStr(
wxDisplay(unsigned index = 0),
"Set up a Display instance with the specified display. The displays
are numbered from 0 to GetCount() - 1, 0 is always the primary display
and the only one which is always supported", "");
~wxDisplay();
DocDeclStr(
static unsigned , GetCount(),
"Return the number of available displays.", "");
DocDeclStr(
static int , GetFromPoint(const wxPoint& pt),
"Find the display where the given point lies, return wx.NOT_FOUND if it
doesn't belong to any display", "");
DocStr(GetFromWindow,
"Find the display where the given window lies, return wx.NOT_FOUND if
it is not shown at all.", "");
static int GetFromWindow(const wxWindow *window);
DocDeclStr(
bool , IsOk() const,
"Return true if the object was initialized successfully", "");
%pythoncode { def __nonzero__(self): return self.IsOk() }
DocDeclStr(
wxRect , GetGeometry() const,
"Returns the bounding rectangle of the display whose index was passed
to the constructor.", "");
DocDeclStr(
wxRect , GetClientArea() const,
"Returns the bounding rectangle the client area of the display,
i.e., without taskbars and such.", "");
DocDeclStr(
wxString , GetName() const,
"Returns the display's name. A name is not available on all platforms.", "");
DocDeclStr(
bool , IsPrimary() const,
"Returns True if the display is the primary display. The primary
display is the one whose index is 0.", "");
%extend
{
DocAStr(GetModes,
"GetModes(VideoMode mode=DefaultVideoMode) -> [videoMode...]",
"Enumerate all video modes supported by this display matching the given
one (in the sense of VideoMode.Match()).
As any mode matches the default value of the argument and there is
always at least one video mode supported by display, the returned
array is only empty for the default value of the argument if this
function is not supported at all on this platform.", "");
PyObject* GetModes(const wxVideoMode& mode = wxDefaultVideoMode)
{
%#if wxUSE_DISPLAY
PyObject* pyList = NULL;
wxArrayVideoModes arr = self->GetModes(mode);
wxPyBlock_t blocked = wxPyBeginBlockThreads();
pyList = PyList_New(0);
for (size_t i=0; i < arr.GetCount(); i++)
{
wxVideoMode* m = new wxVideoMode(arr.Item(i));
PyObject* pyObj = wxPyConstructObject(m, wxT("wxVideoMode"), true);
PyList_Append(pyList, pyObj);
Py_DECREF(pyObj);
}
wxPyEndBlockThreads(blocked);
return pyList;
%#else
wxPyRaiseNotImplemented();
return NULL;
%#endif
}
DocStr(GetCurrentMode,
"Get the current video mode.", "");
wxVideoMode GetCurrentMode() const
{
%#if wxUSE_DISPLAY
return self->GetCurrentMode();
%#else
wxPyRaiseNotImplemented();
return wxDefaultVideoMode;
%#endif
}
DocStr(
ChangeMode,
"Changes the video mode of this display to the mode specified in the
mode parameter.
If wx.DefaultVideoMode is passed in as the mode parameter, the defined
behaviour is that wx.Display will reset the video mode to the default
mode used by the display. On Windows, the behavior is normal.
However, there are differences on other platforms. On Unix variations
using X11 extensions it should behave as defined, but some
irregularities may occur.
On wxMac passing in wx.DefaultVideoMode as the mode parameter does
nothing. This happens because Carbon no longer has access to
DMUseScreenPrefs, an undocumented function that changed the video mode
to the system default by using the system's 'scrn' resource.
Returns True if succeeded, False otherwise", "");
bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode)
{
%#if wxUSE_DISPLAY
return self->ChangeMode(mode);
%#else
wxPyRaiseNotImplemented();
return false;
%#endif
}
DocStr(
ResetMode,
"Restore the default video mode (just a more readable synonym)", "");
void ResetMode()
{
%#if wxUSE_DISPLAY
self->ResetMode();
%#else
wxPyRaiseNotImplemented();
%#endif
}
} // end of %extend
%property(ClientArea, GetClientArea, doc="See `GetClientArea`");
%property(CurrentMode, GetCurrentMode, doc="See `GetCurrentMode`");
%property(Geometry, GetGeometry, doc="See `GetGeometry`");
%property(Modes, GetModes, doc="See `GetModes`");
%property(Name, GetName, doc="See `GetName`");
};
//---------------------------------------------------------------------------
|