]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gdi.i
enabled toolbar as it works now
[wxWidgets.git] / wxPython / src / gdi.i
index 697de042fa7c209cbaad9c722410a4c1b1abd2a8..ba26ef7556ee6789ba3555113d0e622b23ed47e3 100644 (file)
@@ -20,6 +20,7 @@
 #include <wx/fontenc.h>
 #include <wx/fontmap.h>
 #include <wx/fontutil.h>
+#include <wx/dcbuffer.h>
 %}
 
 //----------------------------------------------------------------------
@@ -51,12 +52,12 @@ public:
 class wxBitmap : public wxGDIObject
 {
 public:
-    wxBitmap(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_BMP);
+    wxBitmap(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_ANY);
     ~wxBitmap();
 
     wxPalette* GetPalette();
     wxMask* GetMask();
-    bool LoadFile(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_BMP);
+    bool LoadFile(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_ANY);
     bool SaveFile(const wxString& name, wxBitmapType type, wxPalette* palette = NULL);
     void SetMask(wxMask* mask);
 #ifdef __WXMSW__
@@ -234,6 +235,7 @@ public:
 // Declarations of some alternate "constructors"
 %new wxIcon* wxEmptyIcon();
 %new wxIcon* wxIconFromXPMData(PyObject* listOfStrings);
+%new wxIcon* wxIconFromBitmap(const wxBitmap& bmp);
 
 %{ // Implementations of some alternate "constructors"
     wxIcon* wxEmptyIcon() {
@@ -251,6 +253,12 @@ public:
         delete [] cArray;
         return icon;
     }
+
+    wxIcon* wxIconFromBitmap(const wxBitmap& bmp) {
+        wxIcon* icon = new wxIcon();
+        icon->CopyFromBitmap(bmp);
+        return icon;
+    }
 %}
 
 //---------------------------------------------------------------------------
@@ -643,6 +651,25 @@ public:
 
     %addmethods {
         void Append(const wxString& name, int red, int green, int blue) {
+            // first see if the name is already there
+            wxString cName = name;
+            cName.MakeUpper();
+            wxString cName2 = cName;
+            if ( !cName2.Replace(wxT("GRAY"), wxT("GREY")) )
+                cName2.clear();
+
+            wxNode *node = self->First();
+            while ( node ) {
+                const wxChar *key = node->GetKeyString();
+                if ( cName == key || cName2 == key ) {
+                    wxColour* c = (wxColour *)node->Data();
+                    c->Set(red, green, blue);
+                    return;
+                }
+                node = node->Next();
+            }
+
+            // otherwise append the new colour
             self->Append(name.c_str(), new wxColour(red, green, blue));
         }
     }
@@ -1113,6 +1140,26 @@ public:
 %}
 
 
+//---------------------------------------------------------------------------
+
+class wxBufferedDC : public wxMemoryDC {
+public:
+        // Construct a wxBufferedDC using a user supplied buffer.
+    wxBufferedDC( wxDC *dc, const wxBitmap &buffer );
+
+        // Construct a wxBufferedDC with an internal buffer of 'area'
+        // (where area is usually something like the size of the window
+        // being buffered)
+    %name(wxBufferedDCInternalBuffer)wxBufferedDC( wxDC *dc, const wxSize &area );
+};
+
+
+class wxBufferedPaintDC : public wxBufferedDC
+{
+public:
+    wxBufferedPaintDC( wxWindow *window, const wxBitmap &buffer = wxNullBitmap );
+};
+
 //---------------------------------------------------------------------------
 
 class wxScreenDC : public wxDC {
@@ -1248,7 +1295,9 @@ public:
     ~wxRegion();
 
     void Clear();
+#ifndef __WXMAC__
     bool Offset(wxCoord x, wxCoord y);
+#endif
 
     wxRegionContain Contains(long x, long y);
     %name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt);