]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/image.i
Fixed bug in DnD. wxDragSource will now delete itself when done.
[wxWidgets.git] / utils / wxPython / src / image.i
index ae84b468bb97764dd6668ca7651bd0a3be9d7de5..acb2f14e08138e6dd2899dbb601e9d3888165169 100644 (file)
@@ -32,7 +32,7 @@
 
 class wxImageHandler {
 public:
 
 class wxImageHandler {
 public:
-    wxImageHandler();
+    // wxImageHandler();    Abstract Base Class
     wxString GetName();
     wxString GetExtension();
     long GetType();
     wxString GetName();
     wxString GetExtension();
     long GetType();
@@ -72,7 +72,15 @@ public:
     wxGIFHandler();
 };
 
     wxGIFHandler();
 };
 
+class wxPNMHandler : public wxImageHandler {
+public:
+    wxPNMHandler();
+};
 
 
+class wxPCXHandler : public wxImageHandler {
+public:
+    wxPCXHandler();
+};
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -102,6 +110,8 @@ public:
     int GetWidth();
     int GetHeight();
 
     int GetWidth();
     int GetHeight();
 
+    wxImage GetSubImage(const wxRect& rect);
+
     //unsigned char *GetData();
     //void SetData( unsigned char *data );
 
     //unsigned char *GetData();
     //void SetData( unsigned char *data );
 
@@ -119,7 +129,10 @@ public:
                 PyErr_SetString(PyExc_TypeError, "Expected string object");
                 return /* NULL */ ;
             }
                 PyErr_SetString(PyExc_TypeError, "Expected string object");
                 return /* NULL */ ;
             }
-            dataPtr = (unsigned char*)PyString_AsString(data);
+
+            size_t len = self->GetWidth() * self->GetHeight() * 3;
+            dataPtr = new unsigned char[len];
+            memcpy(dataPtr, PyString_AsString(data), len);
             self->SetData(dataPtr);
         }
     }
             self->SetData(dataPtr);
         }
     }
@@ -164,9 +177,7 @@ void wxImage_AddHandler(wxImageHandler *handler);
     }
 %}
 
     }
 %}
 
+void wxInitAllImageHandlers();
+
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
-
-
-
-