]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/misc.i
added CodeWarrior project for Classic Mac OS
[wxWidgets.git] / wxPython / src / misc.i
index 6f0312e99e484ba5ce7e18521cdfc8245dbff0d0..70e22c48acca3d91e52747be99db53f28e68a5e2 100644 (file)
 %import _defs.i
 
 
 %import _defs.i
 
 
+%{
+    static wxString wxPyEmptyStr("");
+%}
+
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
 
@@ -81,6 +85,21 @@ public:
             PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y));
             return tup;
         }
             PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y));
             return tup;
         }
+
+        wxRealPoint __add__(const wxRealPoint* p) {
+            if (! p) return *self;
+            return *self + *p;
+        }
+
+        wxRealPoint __sub__(const wxRealPoint* p) {
+            if (! p) return *self;
+            return *self - *p;
+        }
+
+        int __cmp__(const wxRealPoint* p) {
+            if (! p) return 0;
+            return *self == *p;
+        }
     }
     %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())"
     %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())"
     }
     %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())"
     %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())"
@@ -105,6 +124,21 @@ public:
             PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
             return tup;
         }
             PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
             return tup;
         }
+
+        wxPoint __add__(const wxPoint* p) {
+            if (! p) return *self;
+            return *self + *p;
+        }
+
+        wxPoint __sub__(const wxPoint* p) {
+            if (! p) return *self;
+            return *self - *p;
+        }
+
+        int __cmp__(const wxPoint* p) {
+            if (! p) return 0;
+            return *self == *p;
+        }
     }
     %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())"
     %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())"
     }
     %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())"
     %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())"
@@ -225,7 +259,9 @@ public:
             bool doSave = wxPyRestoreThread();
             wxRect* newRect = new wxRect(dest);
             obj = wxPyConstructObject((void*)newRect, "wxRect");
             bool doSave = wxPyRestoreThread();
             wxRect* newRect = new wxRect(dest);
             obj = wxPyConstructObject((void*)newRect, "wxRect");
-            PyObject_SetAttrString(obj, "thisown", PyInt_FromLong(1));
+            PyObject* one = PyInt_FromLong(1);
+            PyObject_SetAttrString(obj, "thisown", one);
+            Py_DECREF(one);
             wxPySaveThread(doSave);
             return obj;
         }
             wxPySaveThread(doSave);
             return obj;
         }
@@ -246,7 +282,7 @@ void wxRegisterId(long id);
 void wxBell();
 void wxDisplaySize(int *OUTPUT, int *OUTPUT);
 void wxEndBusyCursor();
 void wxBell();
 void wxDisplaySize(int *OUTPUT, int *OUTPUT);
 void wxEndBusyCursor();
-long wxExecute(const wxString& command, int sync = FALSE);
+
 long wxGetElapsedTime(bool resetTimer = TRUE);
 #ifdef __WXMSW__
 long wxGetFreeMemory();
 long wxGetElapsedTime(bool resetTimer = TRUE);
 #ifdef __WXMSW__
 long wxGetFreeMemory();
@@ -257,10 +293,11 @@ wxString wxNow();
 bool wxShell(const wxString& command = wxPyEmptyStr);
 void wxStartTimer();
 int wxGetOsVersion(int *OUTPUT, int *OUTPUT);
 bool wxShell(const wxString& command = wxPyEmptyStr);
 void wxStartTimer();
 int wxGetOsVersion(int *OUTPUT, int *OUTPUT);
+wxString wxGetOsDescription();
 
 void wxSleep(int secs);
 
 void wxSleep(int secs);
+void wxUsleep(unsigned long milliseconds);
 bool wxYield();
 bool wxYield();
-bool wxSafeYield();
 void wxEnableTopLevelWindows(bool enable);
 
 %inline %{
 void wxEnableTopLevelWindows(bool enable);
 
 %inline %{
@@ -273,6 +310,15 @@ void wxEnableTopLevelWindows(bool enable);
 
 wxString wxStripMenuCodes(const wxString& in);
 
 
 wxString wxStripMenuCodes(const wxString& in);
 
+
+wxString wxGetEmailAddress();
+wxString wxGetHostName();
+wxString wxGetFullHostName();
+wxString wxGetUserId();
+wxString wxGetUserName();
+wxString wxGetHomeDir();
+
+
 //----------------------------------------------------------------------
 
 enum wxEdge { wxLeft, wxTop, wxRight, wxBottom, wxWidth, wxHeight,
 //----------------------------------------------------------------------
 
 enum wxEdge { wxLeft, wxTop, wxRight, wxBottom, wxWidth, wxHeight,
@@ -333,7 +379,7 @@ enum wxRegionContain {
 
 class wxRegion {
 public:
 
 class wxRegion {
 public:
-    wxRegion();
+    wxRegion(long x=0, long y=0, long width=0, long height=0);
     ~wxRegion();
 
     void Clear();
     ~wxRegion();
 
     void Clear();
@@ -412,6 +458,7 @@ public:
 
 };
 
 
 };
 
+wxAcceleratorEntry *wxGetAccelFromString(const wxString& label);
 
 %readonly
 %{
 
 %readonly
 %{
@@ -432,8 +479,7 @@ public:
     ~wxBusyInfo();
 };
 
     ~wxBusyInfo();
 };
 
-
-
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
 
+