]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gdi.i
fixed compilation in Unicode build
[wxWidgets.git] / wxPython / src / gdi.i
index 29aca1dcacf3b95f31c3c093449d788bc2b76891..032a3b2947fb248b7f02b8604c433a9928975aa2 100644 (file)
@@ -20,6 +20,7 @@
 #include <wx/fontenc.h>
 #include <wx/fontmap.h>
 #include <wx/fontutil.h>
 #include <wx/fontenc.h>
 #include <wx/fontmap.h>
 #include <wx/fontutil.h>
+#include <wx/dcbuffer.h>
 %}
 
 //----------------------------------------------------------------------
 %}
 
 //----------------------------------------------------------------------
 %import misc.i
 
 
 %import misc.i
 
 
+//---------------------------------------------------------------------------
+%{
+    // Put some wx default wxChar* values into wxStrings.
+    static const wxString wxPyEmptyString(wxT(""));
+%}
 //---------------------------------------------------------------------------
 
 class wxGDIObject : public wxObject {
 //---------------------------------------------------------------------------
 
 class wxGDIObject : public wxObject {
@@ -51,12 +57,12 @@ public:
 class wxBitmap : public wxGDIObject
 {
 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();
     ~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__
     bool SaveFile(const wxString& name, wxBitmapType type, wxPalette* palette = NULL);
     void SetMask(wxMask* mask);
 #ifdef __WXMSW__
@@ -234,6 +240,7 @@ public:
 // Declarations of some alternate "constructors"
 %new wxIcon* wxEmptyIcon();
 %new wxIcon* wxIconFromXPMData(PyObject* listOfStrings);
 // 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() {
 
 %{ // Implementations of some alternate "constructors"
     wxIcon* wxEmptyIcon() {
@@ -251,6 +258,12 @@ public:
         delete [] cArray;
         return icon;
     }
         delete [] cArray;
         return icon;
     }
+
+    wxIcon* wxIconFromBitmap(const wxBitmap& bmp) {
+        wxIcon* icon = new wxIcon();
+        icon->CopyFromBitmap(bmp);
+        return icon;
+    }
 %}
 
 //---------------------------------------------------------------------------
 %}
 
 //---------------------------------------------------------------------------
@@ -474,7 +487,7 @@ public:
     // that can be used it wxFont ctor otherwise return FALSE
     //bool GetAltForEncoding(wxFontEncoding encoding,
     //                       wxFontEncoding *alt_encoding,
     // that can be used it wxFont ctor otherwise return FALSE
     //bool GetAltForEncoding(wxFontEncoding encoding,
     //                       wxFontEncoding *alt_encoding,
-    //                       const wxString& facename = wxEmptyString,
+    //                       const wxString& facename = wxPyEmptyString,
     //                       bool interactive = TRUE);
 
 
     //                       bool interactive = TRUE);
 
 
@@ -483,7 +496,7 @@ public:
     // returns None.
     %addmethods {
         PyObject* GetAltForEncoding(wxFontEncoding encoding,
     // returns None.
     %addmethods {
         PyObject* GetAltForEncoding(wxFontEncoding encoding,
-                                    const wxString& facename = wxEmptyString,
+                                    const wxString& facename = wxPyEmptyString,
                                     bool interactive = TRUE) {
             wxFontEncoding alt_enc;
             if (self->GetAltForEncoding(encoding, &alt_enc, facename, interactive))
                                     bool interactive = TRUE) {
             wxFontEncoding alt_enc;
             if (self->GetAltForEncoding(encoding, &alt_enc, facename, interactive))
@@ -499,7 +512,7 @@ public:
     // checks whether given encoding is available in given face or not.
     // If no facename is given,
     bool IsEncodingAvailable(wxFontEncoding encoding,
     // checks whether given encoding is available in given face or not.
     // If no facename is given,
     bool IsEncodingAvailable(wxFontEncoding encoding,
-                             const wxString& facename = wxEmptyString);
+                             const wxString& facename = wxPyEmptyString);
 
     // returns the encoding for the given charset (in the form of RFC 2046) or
     // wxFONTENCODING_SYSTEM if couldn't decode it
 
     // returns the encoding for the given charset (in the form of RFC 2046) or
     // wxFONTENCODING_SYSTEM if couldn't decode it
@@ -534,7 +547,7 @@ public:
     void SetConfigPath(const wxString& prefix);
 
     // return default config path
     void SetConfigPath(const wxString& prefix);
 
     // return default config path
-    static const wxChar *GetDefaultConfigPath();
+    static wxString GetDefaultConfigPath();
 };
 
 
 };
 
 
@@ -543,7 +556,7 @@ public:
 class wxFont : public wxGDIObject {
 public:
     wxFont( int pointSize, int family, int style, int weight,
 class wxFont : public wxGDIObject {
 public:
     wxFont( int pointSize, int family, int style, int weight,
-            int underline=FALSE, char* faceName = "",
+            int underline=FALSE, const wxString& faceName = wxPyEmptyString,
             wxFontEncoding encoding=wxFONTENCODING_DEFAULT);
 
     %name(wxFontFromNativeInfo)wxFont(const wxNativeFontInfo& info);
             wxFontEncoding encoding=wxFONTENCODING_DEFAULT);
 
     %name(wxFontFromNativeInfo)wxFont(const wxNativeFontInfo& info);
@@ -591,7 +604,7 @@ public:
 
     void AddFont(wxFont* font);
     wxFont * FindOrCreateFont(int point_size, int family, int style, int weight,
 
     void AddFont(wxFont* font);
     wxFont * FindOrCreateFont(int point_size, int family, int style, int weight,
-                              bool underline = FALSE, const char* facename = NULL,
+                              bool underline = FALSE, const wxString& facename = wxPyEmptyString,
                               wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
     void RemoveFont(wxFont *font);
 
                               wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
     void RemoveFont(wxFont *font);
 
@@ -647,7 +660,7 @@ public:
             wxString cName = name;
             cName.MakeUpper();
             wxString cName2 = cName;
             wxString cName = name;
             cName.MakeUpper();
             wxString cName2 = cName;
-            if ( !cName2.Replace("GRAY", "GREY") )
+            if ( !cName2.Replace(wxT("GRAY"), wxT("GREY")) )
                 cName2.clear();
 
             wxNode *node = self->First();
                 cName2.clear();
 
             wxNode *node = self->First();
@@ -1132,6 +1145,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 {
 //---------------------------------------------------------------------------
 
 class wxScreenDC : public wxDC {
@@ -1175,7 +1208,7 @@ public:
 
 class wxMetaFile : public wxObject {
 public:
 
 class wxMetaFile : public wxObject {
 public:
-    wxMetaFile(const wxString& filename = wxEmptyString);
+    wxMetaFile(const wxString& filename = wxPyEmptyString);
     ~wxMetaFile();
 
     bool Ok();
     ~wxMetaFile();
 
     bool Ok();
@@ -1195,9 +1228,9 @@ public:
 
 class wxMetaFileDC : public wxDC {
 public:
 
 class wxMetaFileDC : public wxDC {
 public:
-    wxMetaFileDC(const wxString& filename = wxEmptyString,
+    wxMetaFileDC(const wxString& filename = wxPyEmptyString,
                  int width = 0, int height = 0,
                  int width = 0, int height = 0,
-                 const wxString& description = wxEmptyString);
+                 const wxString& description = wxPyEmptyString);
     wxMetaFile* Close();
 };
 
     wxMetaFile* Close();
 };