DocDeclStr(
bool , Matches(const wxVideoMode& other) const,
- "Returns true if this mode matches the other one in the sense that all
+ "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)", "");
};
+%{
+#if !wxUSE_DISPLAY
+const wxVideoMode wxDefaultVideoMode;
+#endif
+%}
+
%immutable;
const wxVideoMode wxDefaultVideoMode;
%mutable;
//---------------------------------------------------------------------------
-%{
-// dummy version of wxDisplay for when it is not enabled in the wxWidgets build
-#if !wxUSE_DISPLAY
-#include <wx/dynarray.h>
-#include <wx/vidmode.h>
-
- WX_DECLARE_OBJARRAY(wxVideoMode, wxArrayVideoModes);
-#include "wx/arrimpl.cpp"
-WX_DEFINE_OBJARRAY(wxArrayVideoModes);
-const wxVideoMode wxDefaultVideoMode;
-
-class wxDisplay
-{
-public:
- wxDisplay(size_t index = 0) { wxPyRaiseNotImplemented(); }
- ~wxDisplay() {}
-
- static size_t GetCount()
- { wxPyRaiseNotImplemented(); return 0; }
-
- static int GetFromPoint(const wxPoint& pt)
- { wxPyRaiseNotImplemented(); return wxNOT_FOUND; }
- static int GetFromWindow(wxWindow *window)
- { wxPyRaiseNotImplemented(); return wxNOT_FOUND; }
-
- virtual bool IsOk() const { return false; }
- virtual wxRect GetGeometry() const { wxRect r; return r; }
- virtual wxString GetName() const { return wxEmptyString; }
- bool IsPrimary() const { return false; }
-
- wxArrayVideoModes GetModes(const wxVideoMode& mode = wxDefaultVideoMode)
- { wxArrayVideoModes a; return a; }
-
- virtual wxVideoMode GetCurrentMode() const
- { return wxDefaultVideoMode; }
-
- virtual bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode)
- { return false; }
-
- void ResetMode() {}
-};
-#endif
-%}
-
DocStr(wxDisplay,
are numbered from 0 to GetCount() - 1, 0 is always the primary display
and the only one which is always supported", "");
- virtual ~wxDisplay();
-
+ ~wxDisplay();
+
DocDeclStr(
static size_t , GetCount(),
"Return the number of available displays.", "");
DocDeclStr(
- virtual bool , IsOk() const,
+ bool , IsOk() const,
"Return true if the object was initialized successfully", "");
%pythoncode { def __nonzero__(self): return self.IsOk() }
DocDeclStr(
- virtual wxRect , GetGeometry() const,
+ wxRect , GetGeometry() const,
"Returns the bounding rectangle of the display whose index was passed
to the constructor.", "");
DocDeclStr(
- virtual wxString , GetName() const,
+ wxString , GetName() const,
"Returns the display's name. A name is not available on all platforms.", "");
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();
}
wxPyEndBlockThreads(blocked);
return pyList;
+%#else
+ wxPyRaiseNotImplemented();
+ return NULL;
+%#endif
}
- }
-
-
- DocDeclStr(
- virtual wxVideoMode , GetCurrentMode() const,
- "Get the current video mode.", "");
-
+
+ DocStr(GetCurrentMode,
+ "Get the current video mode.", "");
+ wxVideoMode GetCurrentMode() const {
+%#if wxUSE_DISPLAY
+ return self->GetCurrentMode();
+%#else
+ wxPyRaiseNotImplemented();
+ return wxDefaultVideoMode;
+%#endif
+ }
+
- DocDeclStr(
- virtual bool , ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode),
- "Changes the video mode of this display to the mode specified in the
+ 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
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
+ }
- DocDeclStr(
- void , ResetMode(),
- "Restore the default video mode (just a more readable synonym)", "");
+ 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
};
//---------------------------------------------------------------------------