]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_gdicmn.i
Make an app bundle for the doc viewer
[wxWidgets.git] / wxPython / src / _gdicmn.i
index 1fd60f0b5adf050cc609f141d75de672a5ac75d9..5ccbf5d5ba0b8743279179776bcb43c4d6930738 100644 (file)
@@ -21,36 +21,38 @@ enum wxBitmapType
 {
     wxBITMAP_TYPE_INVALID,          // should be == 0 for compatibility!
     wxBITMAP_TYPE_BMP,
 {
     wxBITMAP_TYPE_INVALID,          // should be == 0 for compatibility!
     wxBITMAP_TYPE_BMP,
-    wxBITMAP_TYPE_BMP_RESOURCE,
-    wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE,
     wxBITMAP_TYPE_ICO,
     wxBITMAP_TYPE_ICO,
-    wxBITMAP_TYPE_ICO_RESOURCE,
     wxBITMAP_TYPE_CUR,
     wxBITMAP_TYPE_CUR,
-    wxBITMAP_TYPE_CUR_RESOURCE,
     wxBITMAP_TYPE_XBM,
     wxBITMAP_TYPE_XBM_DATA,
     wxBITMAP_TYPE_XPM,
     wxBITMAP_TYPE_XPM_DATA,
     wxBITMAP_TYPE_TIF,
     wxBITMAP_TYPE_XBM,
     wxBITMAP_TYPE_XBM_DATA,
     wxBITMAP_TYPE_XPM,
     wxBITMAP_TYPE_XPM_DATA,
     wxBITMAP_TYPE_TIF,
-    wxBITMAP_TYPE_TIF_RESOURCE,
     wxBITMAP_TYPE_GIF,
     wxBITMAP_TYPE_GIF,
-    wxBITMAP_TYPE_GIF_RESOURCE,
     wxBITMAP_TYPE_PNG,
     wxBITMAP_TYPE_PNG,
-    wxBITMAP_TYPE_PNG_RESOURCE,
     wxBITMAP_TYPE_JPEG,
     wxBITMAP_TYPE_JPEG,
-    wxBITMAP_TYPE_JPEG_RESOURCE,
     wxBITMAP_TYPE_PNM,
     wxBITMAP_TYPE_PNM,
-    wxBITMAP_TYPE_PNM_RESOURCE,
     wxBITMAP_TYPE_PCX,
     wxBITMAP_TYPE_PCX,
-    wxBITMAP_TYPE_PCX_RESOURCE,
     wxBITMAP_TYPE_PICT,
     wxBITMAP_TYPE_PICT,
-    wxBITMAP_TYPE_PICT_RESOURCE,
     wxBITMAP_TYPE_ICON,
     wxBITMAP_TYPE_ICON,
-    wxBITMAP_TYPE_ICON_RESOURCE,
     wxBITMAP_TYPE_ANI,
     wxBITMAP_TYPE_IFF,
     wxBITMAP_TYPE_MACCURSOR,
     wxBITMAP_TYPE_ANI,
     wxBITMAP_TYPE_IFF,
     wxBITMAP_TYPE_MACCURSOR,
-    wxBITMAP_TYPE_MACCURSOR_RESOURCE,
+
+//    wxBITMAP_TYPE_BMP_RESOURCE,
+//    wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE,
+//    wxBITMAP_TYPE_ICO_RESOURCE,
+//    wxBITMAP_TYPE_CUR_RESOURCE,
+//    wxBITMAP_TYPE_TIF_RESOURCE,
+//    wxBITMAP_TYPE_GIF_RESOURCE,
+//    wxBITMAP_TYPE_PNG_RESOURCE,
+//    wxBITMAP_TYPE_JPEG_RESOURCE,
+//    wxBITMAP_TYPE_PNM_RESOURCE,
+//    wxBITMAP_TYPE_PCX_RESOURCE,
+//    wxBITMAP_TYPE_PICT_RESOURCE,
+//    wxBITMAP_TYPE_ICON_RESOURCE,
+//    wxBITMAP_TYPE_MACCURSOR_RESOURCE,
+
     wxBITMAP_TYPE_ANY = 50
 };
 
     wxBITMAP_TYPE_ANY = 50
 };
 
@@ -128,6 +130,11 @@ public:
 
     ~wxSize();
 
 
     ~wxSize();
 
+//     %extend {
+//         bool __eq__(const wxSize* other) { return other ? (*self == *other) : False; }
+//         bool __ne__(const wxSize* other) { return other ? (*self != *other) : True;  }
+//     }
+
     DocDeclStr(
         bool, operator==(const wxSize& sz),
         "Test for equality of wx.Size objects.");
     DocDeclStr(
         bool, operator==(const wxSize& sz),
         "Test for equality of wx.Size objects.");
@@ -171,11 +178,11 @@ public:
                "Get() -> (width,height)",
                "Returns the width and height properties as a tuple.");
         PyObject* Get() {
                "Get() -> (width,height)",
                "Returns the width and height properties as a tuple.");
         PyObject* Get() {
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             PyObject* tup = PyTuple_New(2);
             PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
             PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
             PyObject* tup = PyTuple_New(2);
             PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
             PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             return tup;
         }
     }
             return tup;
         }
     }
@@ -190,9 +197,8 @@ public:
         elif index == 1: self.height = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0)
         elif index == 1: self.height = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.Size, self.Get())
     }
 
 };
     }
 
 };
@@ -245,11 +251,11 @@ public:
                "Get() -> (x,y)",
                "Return the x and y properties as a tuple. ");
         PyObject* Get() {
                "Get() -> (x,y)",
                "Return the x and y properties as a tuple. ");
         PyObject* Get() {
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             PyObject* tup = PyTuple_New(2);
             PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x));
             PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y));
             PyObject* tup = PyTuple_New(2);
             PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x));
             PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y));
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             return tup;
         }
     }
             return tup;
         }
     }
@@ -265,9 +271,8 @@ public:
         elif index == 1: self.y = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0.0, 0.0)
         elif index == 1: self.y = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0.0, 0.0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.RealPoint, self.Get())
     }
 };
 
     }
 };
 
@@ -301,11 +306,18 @@ public:
         bool, operator!=(const wxPoint& pt),
         "Test for inequality of wx.Point objects.");
 
         bool, operator!=(const wxPoint& pt),
         "Test for inequality of wx.Point objects.");
 
+
+
+//     %nokwargs operator+;
+//     %nokwargs operator-;
+//     %nokwargs operator+=;
+//     %nokwargs operator-=;
     
     DocDeclStr(
         wxPoint, operator+(const wxPoint& pt),
         "Add pt's proprties to this and return the result.");
 
     
     DocDeclStr(
         wxPoint, operator+(const wxPoint& pt),
         "Add pt's proprties to this and return the result.");
 
+   
     DocDeclStr(
         wxPoint, operator-(const wxPoint& pt),
         "Subtract pt's proprties from this and return the result");
     DocDeclStr(
         wxPoint, operator-(const wxPoint& pt),
         "Subtract pt's proprties from this and return the result");
@@ -319,6 +331,27 @@ public:
         wxPoint&, operator-=(const wxPoint& pt),
         "Subtract pt from this object.");
 
         wxPoint&, operator-=(const wxPoint& pt),
         "Subtract pt from this object.");
 
+
+    
+//     DocDeclStr(
+//         wxPoint, operator+(const wxSize& sz),
+//         "Add sz to this Point and return the result.");
+
+//     DocDeclStr(
+//         wxPoint, operator-(const wxSize& sz),
+//         "Subtract sz from this Point and return the result");
+
+
+//     DocDeclStr(
+//         wxPoint&, operator+=(const wxSize& sz),
+//         "Add sz to this object.");
+
+//     DocDeclStr(
+//         wxPoint&, operator-=(const wxSize& sz),
+//         "Subtract sz from this object.");
+
+
+    
     
     %extend {
         DocStr(Set, "Set both the x and y properties");
     
     %extend {
         DocStr(Set, "Set both the x and y properties");
@@ -331,11 +364,11 @@ public:
                "Get() -> (x,y)",
                "Return the x and y properties as a tuple. ");
         PyObject* Get() {
                "Get() -> (x,y)",
                "Return the x and y properties as a tuple. ");
         PyObject* Get() {
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             PyObject* tup = PyTuple_New(2);
             PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
             PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
             PyObject* tup = PyTuple_New(2);
             PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
             PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             return tup;
         }
     }
             return tup;
         }
     }
@@ -351,9 +384,8 @@ public:
         elif index == 1: self.y = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0)
         elif index == 1: self.y = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.Point, self.Get())
     }
 };
 
     }
 };
 
@@ -403,6 +435,16 @@ public:
     wxSize GetSize() const;
     void SetSize( const wxSize &s );
 
     wxSize GetSize() const;
     void SetSize( const wxSize &s );
 
+    wxPoint GetTopLeft() const;
+    void SetTopLeft(const wxPoint &p);
+    wxPoint GetBottomRight() const;
+    void SetBottomRight(const wxPoint &p);
+
+//    wxPoint GetLeftTop() const;
+//    void SetLeftTop(const wxPoint &p);
+//    wxPoint GetRightBottom() const;
+//    void SetRightBottom(const wxPoint &p);
+
     int GetLeft()   const;
     int GetTop()    const;
     int GetBottom() const;
     int GetLeft()   const;
     int GetTop()    const;
     int GetBottom() const;
@@ -490,13 +532,13 @@ public:
                "Get() -> (x,y,width,height)",
                "Return the rectangle properties as a tuple.");
         PyObject* Get() {
                "Get() -> (x,y,width,height)",
                "Return the rectangle properties as a tuple.");
         PyObject* Get() {
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             PyObject* tup = PyTuple_New(4);
             PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
             PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
             PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width));
             PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height));
             PyObject* tup = PyTuple_New(4);
             PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
             PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
             PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width));
             PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height));
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             return tup;
         }
     }
             return tup;
         }
     }
@@ -514,9 +556,8 @@ public:
         elif index == 3: self.height = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0,0,0)
         elif index == 3: self.height = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0,0,0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.Rect, self.Get())
     }
 };
 
     }
 };
 
@@ -535,10 +576,10 @@ DocAStr(wxIntersectRect,
         dest = reg1.GetBox();
 
         if (dest != wxRect(0,0,0,0)) {
         dest = reg1.GetBox();
 
         if (dest != wxRect(0,0,0,0)) {
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             wxRect* newRect = new wxRect(dest);
             obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), True);
             wxRect* newRect = new wxRect(dest);
             obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), True);
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             return obj;
         }
         Py_INCREF(Py_None);
             return obj;
         }
         Py_INCREF(Py_None);
@@ -622,11 +663,11 @@ public:
                "Get() -> (x,y)",
                "Return x and y properties as a tuple.");               
         PyObject* Get() {
                "Get() -> (x,y)",
                "Return x and y properties as a tuple.");               
         PyObject* Get() {
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             PyObject* tup = PyTuple_New(2);
             PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->m_x));
             PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->m_y));
             PyObject* tup = PyTuple_New(2);
             PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->m_x));
             PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->m_y));
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             return tup;
         }
     }
             return tup;
         }
     }
@@ -642,10 +683,8 @@ public:
         elif index == 1: self.y = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0.0, 0.0)
         elif index == 1: self.y = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0.0, 0.0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
-
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.Point2D, self.Get())
     }
 };
 
     }
 };