]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/gdi.i
Added some missing EVT_ functions
[wxWidgets.git] / utils / wxPython / src / gdi.i
index b97cb5a75649187568db54f232c0cdfa5b6bf7df..e926551ddab4b0715881f2c5677a93813705e5a4 100644 (file)
 
 //---------------------------------------------------------------------------
 
-class wxBitmap {
+//  class wxGDIImage {
+//  public:
+//      long GetHandle();
+//      void SetHandle(long handle);
+//      bool Ok();
+//      int GetWidth();
+//      int GetHeight();
+//      int GetDepth();
+//      void SetWidth(int w);
+//      void SetHeight(int h);
+//      void SetDepth(int d);
+//      void SetSize(const wxSize& size);
+//  };
+
+//---------------------------------------------------------------------------
+
+class wxBitmap
+//: public wxGDIImage
+{
 public:
     wxBitmap(const wxString& name, long type);
     ~wxBitmap();
 
-#ifdef __WXMSW__
-    void Create(int width, int height, int depth = -1);
-#endif
-    int GetDepth();
-    int GetHeight();
     wxPalette* GetPalette();
     wxMask* GetMask();
-    int GetWidth();
     bool LoadFile(const wxString& name, long flags);
-    bool Ok();
     bool SaveFile(const wxString& name, int type, wxPalette* palette = NULL);
-    void SetDepth(int depth);
-    void SetHeight(int height);
     void SetMask(wxMask* mask);
 #ifdef __WXMSW__
     void SetPalette(wxPalette& palette);
 #endif
-    void SetWidth(int width);
+
+    // wxGDIImage methods
+#ifdef __WXMSW__
+    long GetHandle();
+    void SetHandle(long handle);
+#endif
+    bool Ok();
+    int GetWidth();
+    int GetHeight();
+    int GetDepth();
+    void SetWidth(int w);
+    void SetHeight(int h);
+    void SetDepth(int d);
+#ifdef __WXMSW__
+    void SetSize(const wxSize& size);
+#endif
 };
 
+
 %new wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1);
-wxBitmap* wxNoRefBitmap(char* name, long flags);
 
 #ifdef __WXMSW__
 %new wxBitmap* wxBitmapFromData(char* data, long type,
@@ -71,14 +95,6 @@ wxBitmap* wxNoRefBitmap(char* name, long flags);
         return new wxBitmap(width, height, depth);
     }
 
-                                // This one won't own the reference, so Python
-                                // won't call the dtor, this is good for
-                                // toolbars and such where the parent will
-                                // manage the bitmap.
-    wxBitmap* wxNoRefBitmap(char* name, long flags) {
-        return new wxBitmap(name, flags);
-    }
-
 #ifdef __WXMSW__
     wxBitmap* wxBitmapFromData(char* data, long type,
                                int width, int height, int depth = 1) {
@@ -92,7 +108,7 @@ wxBitmap* wxNoRefBitmap(char* name, long flags);
 class wxMask {
 public:
     wxMask(const wxBitmap& bitmap);
-    ~wxMask();
+    //~wxMask();
 };
 
 %new wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour);
@@ -106,32 +122,60 @@ public:
 //---------------------------------------------------------------------------
 
 
-class wxIcon : public wxBitmap {
+class wxIcon
+//: public wxGDIImage
+{
 public:
     wxIcon(const wxString& name, long flags,
            int desiredWidth = -1, int desiredHeight = -1);
     ~wxIcon();
 
-    int GetDepth();
-    int GetHeight();
-    int GetWidth();
     bool LoadFile(const wxString& name, long flags);
+
+    // wxGDIImage methods
+#ifdef __WXMSW__
+    long GetHandle();
+    void SetHandle(long handle);
+#endif
     bool Ok();
-    void SetDepth(int depth);
-    void SetHeight(int height);
-    void SetWidth(int width);
+    int GetWidth();
+    int GetHeight();
+    int GetDepth();
+    void SetWidth(int w);
+    void SetHeight(int h);
+    void SetDepth(int d);
+#ifdef __WXMSW__
+    void SetSize(const wxSize& size);
+#endif
 };
 
 
 //---------------------------------------------------------------------------
 
-class wxCursor : public wxBitmap {
+class wxCursor
+//: public wxGDIImage
+{
 public:
 #ifdef __WXMSW__
     wxCursor(const wxString& cursorName, long flags, int hotSpotX=0, int hotSpotY=0);
 #endif
     ~wxCursor();
+
+    // wxGDIImage methods
+#ifdef __WXMSW__
+    long GetHandle();
+    void SetHandle(long handle);
+#endif
     bool Ok();
+#ifdef __WXMSW__
+    int GetWidth();
+    int GetHeight();
+    int GetDepth();
+    void SetWidth(int w);
+    void SetHeight(int h);
+    void SetDepth(int d);
+    void SetSize(const wxSize& size);
+#endif
 };
 
 %name(wxStockCursor) %new wxCursor* wxPyStockCursor(int id);
@@ -257,6 +301,10 @@ public:
             return rv;
         }
     }
+    %pragma(python) addtoclass = "asTuple = Get"
+    %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())"
+    %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())"
+
 };
 
 %new wxColour* wxNamedColour(const wxString& colorName);
@@ -269,7 +317,12 @@ public:
 
 //----------------------------------------------------------------------
 
+#ifdef __WXMSW__
 typedef unsigned long wxDash;
+#else
+typedef char wxDash;
+#endif
+
 
 class wxPen {
 public:
@@ -295,11 +348,12 @@ public:
     void SetStyle(int style);
     void SetWidth(int width);
 
-#ifdef __WXMSW__
             // **** This one needs to return a list of ints (wxDash)
     int GetDashes(wxDash **dashes);
-    wxBitmap* GetStipple();
     void SetDashes(int LCOUNT, wxDash* LIST);
+
+#ifdef __WXMSW__
+    wxBitmap* GetStipple();
     void SetStipple(wxBitmap& stipple);
 #endif
 };
@@ -363,6 +417,7 @@ public:
                      int fill_style=wxODDEVEN_RULE);
     void DrawPoint(long x, long y);
     void DrawRectangle(long x, long y, long width, long height);
+    void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
     void DrawRoundedRectangle(long x, long y, long width, long height, long radius=20);
     void DrawSpline(int LCOUNT, wxPoint* LIST);
     void DrawText(const wxString& text, long x, long y);
@@ -611,7 +666,7 @@ enum {
 
 class wxImageList {
 public:
-    wxImageList(int width, int height, const bool mask=TRUE, int initialCount=1);
+    wxImageList(int width, int height, int mask=TRUE, int initialCount=1);
     ~wxImageList();
 
 #ifdef __WXMSW__