]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/gdi.i
converted some args to return values
[wxWidgets.git] / utils / wxPython / src / gdi.i
index d0494d09a1b4f373db14535d577149ca4c79b6b9..353c478c54265232a28431ede64b125d4e2d2859 100644 (file)
@@ -86,7 +86,7 @@ public:
 %new wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1);
 
 #ifdef __WXMSW__
-%new wxBitmap* wxBitmapFromData(char* data, long type,
+%new wxBitmap* wxBitmapFromData(PyObject* data, long type,
                                 int width, int height, int depth = 1);
 #endif
 
@@ -96,9 +96,14 @@ public:
     }
 
 #ifdef __WXMSW__
-    wxBitmap* wxBitmapFromData(char* data, long type,
+    wxBitmap* wxBitmapFromData(PyObject* data, long type,
                                int width, int height, int depth = 1) {
-        return new wxBitmap((void*)data, type, width, height, depth);
+        if (! PyString_Check(data)) {
+            PyErr_SetString(PyExc_TypeError, "Expected string object");
+            return NULL;
+        }
+
+        return new wxBitmap((void*)PyString_AsString(data), type, width, height, depth);
     }
 #endif
 %}
@@ -365,12 +370,14 @@ public:
     // I'll do it this way to use long-lived objects and not have to
     // worry about when python may delete the object.
     %addmethods {
-        wxBrush(wxColour* colour, int style=wxSOLID) {
+        wxBrush(const wxColour* colour, int style=wxSOLID) {
             return wxTheBrushList->FindOrCreateBrush(*colour, style);
         }
         // NO Destructor.
     }
 
+//      wxBrush(const wxColour& colour, int style=wxSOLID);
+
     wxColour& GetColour();
     wxBitmap * GetStipple();
     int GetStyle();
@@ -494,7 +501,6 @@ public:
     void GetLogicalOrigin(int *OUTPUT, int *OUTPUT);
     void SetLogicalOrigin(int x, int y);
     void GetDeviceOrigin(int *OUTPUT, int *OUTPUT);
-    void SetDeviceOrigin(int x, int y);
     void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
 
 };
@@ -523,8 +529,8 @@ class wxScreenDC : public wxDC {
 public:
     wxScreenDC();
 
-    bool StartDrawingOnTop(wxWindow* window);
-    %name(StartDrawingOnTopRect) bool StartDrawingOnTop(wxRect* rect = NULL);
+    %name(StartDrawingOnTopWin) bool StartDrawingOnTop(wxWindow* window);
+    bool StartDrawingOnTop(wxRect* rect = NULL);
     bool EndDrawingOnTop();
 };
 
@@ -665,7 +671,7 @@ enum {
 
 class wxImageList {
 public:
-    wxImageList(int width, int height, int mask=FALSE, int initialCount=1);
+    wxImageList(int width, int height, int mask=TRUE, int initialCount=1);
     ~wxImageList();
 
 #ifdef __WXMSW__