]> git.saurik.com Git - wxWidgets.git/commitdiff
The dummy wxDisplay class is no longer needed as there is now always a
authorRobin Dunn <robin@alldunn.com>
Fri, 17 Mar 2006 01:30:21 +0000 (01:30 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 17 Mar 2006 01:30:21 +0000 (01:30 +0000)
wxDisplay class available, but it has limiited functionality if
wxUSE_DISPLAY is zero.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38163 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/_display.i

index ff1e70c7eb123218b16bb8c9cc3cb65f6d70626f..2f45ed0041a05b954200c085005dc6ba74fb8e25 100644 (file)
@@ -34,7 +34,7 @@ struct wxVideoMode
     
     DocDeclStr(
         bool , Matches(const wxVideoMode& other) const,
     
     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)", "");
 
 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)", "");
 
@@ -77,6 +77,12 @@ means unspecified/known", "");
 };
 
 
 };
 
 
+%{
+#if !wxUSE_DISPLAY
+const wxVideoMode     wxDefaultVideoMode;
+#endif
+%} 
+
 %immutable;
 const wxVideoMode     wxDefaultVideoMode;
 %mutable;
 %immutable;
 const wxVideoMode     wxDefaultVideoMode;
 %mutable;
@@ -85,50 +91,6 @@ const wxVideoMode     wxDefaultVideoMode;
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
 
-%{
-// 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,
 
 
 DocStr(wxDisplay,
@@ -143,8 +105,8 @@ public:
 are numbered from 0 to GetCount() - 1, 0 is always the primary display
 and the only one which is always supported", "");
 
 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(
         static size_t , GetCount(),
         "Return the number of available displays.", "");
@@ -163,13 +125,13 @@ it is not shown at all.", "");
 
     
     DocDeclStr(
 
     
     DocDeclStr(
-        virtual bool , IsOk() const,
+        bool , IsOk() const,
         "Return true if the object was initialized successfully", "");
     %pythoncode { def __nonzero__(self): return self.IsOk() }
  
 
     DocDeclStr(
         "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.", "");
 
         "Returns the bounding rectangle of the display whose index was passed
 to the constructor.", "");
 
@@ -181,7 +143,7 @@ to the constructor.", "");
     
 
     DocDeclStr(
     
 
     DocDeclStr(
-        virtual wxString , GetName() const,
+        wxString , GetName() const,
         "Returns the display's name. A name is not available on all platforms.", "");
     
 
         "Returns the display's name. A name is not available on all platforms.", "");
     
 
@@ -204,6 +166,7 @@ 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) {
 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();
             PyObject* pyList = NULL;
             wxArrayVideoModes arr = self->GetModes(mode);
             wxPyBlock_t blocked = wxPyBeginBlockThreads();
@@ -216,18 +179,27 @@ function is not supported at all on this platform.", "");
             }
             wxPyEndBlockThreads(blocked);
             return pyList;
             }
             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
 mode parameter.
 
 If wx.DefaultVideoMode is passed in as the mode parameter, the defined
@@ -243,13 +215,30 @@ 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", "");
 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
 };
 
 //---------------------------------------------------------------------------
 };
 
 //---------------------------------------------------------------------------