]> git.saurik.com Git - wxWidgets.git/commitdiff
reSWIGged
authorRobin Dunn <robin@alldunn.com>
Mon, 28 Feb 2005 20:06:19 +0000 (20:06 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 28 Feb 2005 20:06:19 +0000 (20:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/mac/_core.py
wxPython/src/mac/_core_wrap.cpp
wxPython/src/mac/_gdi.py
wxPython/src/mac/_gdi_wrap.cpp
wxPython/src/mac/_misc_wrap.cpp
wxPython/src/mac/_windows.py
wxPython/src/mac/_windows_wrap.cpp

index 45d769786fece71c7a5d94ba0b768f89fc88db10..6ccb1d5b0eabcba7d3852b76d7be70d637241d70 100644 (file)
@@ -2523,6 +2523,9 @@ def InitAllImageHandlers():
 
 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
+PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
+PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
+PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
 BMP_24BPP = _core_.BMP_24BPP
 BMP_8BPP = _core_.BMP_8BPP
 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
@@ -2563,6 +2566,8 @@ IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
+IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
+IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
 
 class ICOHandler(BMPHandler):
     """Proxy of C++ ICOHandler class"""
@@ -9602,18 +9607,45 @@ class Sizer(Object):
             self.Add(*item)
 
     # for backwards compatibility only, please do not use in new code
-    AddWindow     = wx._deprecated(Add, "AddWindow is deprecated, use `Add` instead.")
-    AddSizer      = wx._deprecated(Add, "AddSizer is deprecated, use `Add` instead.")
-    AddSpacer     = wx._deprecated(Add, "AddSpacer is deprecated, use `Add` instead.")
-    PrependWindow = wx._deprecated(Prepend, "PrependWindow is deprecated, use `Prepend` instead.")
-    PrependSizer  = wx._deprecated(Prepend, "PrependSizer is deprecated, use `Prepend` instead.")
-    PrependSpacer = wx._deprecated(Prepend, "PrependSpacer is deprecated, use `Prepend` instead.")
-    InsertWindow  = wx._deprecated(Insert, "InsertWindow is deprecated, use `Insert` instead.")
-    InsertSizer   = wx._deprecated(Insert, "InsertSizer is deprecated, use `Insert` instead.")
-    InsertSpacer  = wx._deprecated(Insert, "InsertSpacer is deprecated, use `Insert` instead.")
-    RemoveWindow  = wx._deprecated(Remove, "RemoveWindow is deprecated, use `Remove` instead.")
-    RemoveSizer   = wx._deprecated(Remove, "RemoveSizer is deprecated, use `Remove` instead.")
-    RemovePos     = wx._deprecated(Remove, "RemovePos is deprecated, use `Remove` instead.")
+    def AddWindow(self, *args, **kw):
+        """Compatibility alias for `Add`."""
+        return self.Add(*args, **kw)
+    def AddSizer(self, *args, **kw):
+        """Compatibility alias for `Add`."""
+        return self.Add(*args, **kw)
+    def AddSpacer(self, *args, **kw):
+        """Compatibility alias for `Add`."""
+        return self.Add(*args, **kw)
+
+    def PrependWindow(self, *args, **kw):
+        """Compatibility alias for `Prepend`."""
+        return self.Prepend(*args, **kw)
+    def PrependSizer(self, *args, **kw):
+        """Compatibility alias for `Prepend`."""
+        return self.Prepend(*args, **kw)
+    def PrependSpacer(self, *args, **kw):
+        """Compatibility alias for `Prepend`."""
+        return self.Prepend(*args, **kw)
+
+    def InsertWindow(self, *args, **kw):
+        """Compatibility alias for `Insert`."""
+        return self.Insert(*args, **kw)
+    def InsertSizer(self, *args, **kw):
+        """Compatibility alias for `Insert`."""
+        return self.Insert(*args, **kw)
+    def InsertSpacer(self, *args, **kw):
+        """Compatibility alias for `Insert`."""
+        return self.Insert(*args, **kw)
+
+    def RemoveWindow(self, *args, **kw):
+        """Compatibility alias for `Remove`."""
+        return self.Remove(*args, **kw)
+    def RemoveSizer(self, *args, **kw):
+        """Compatibility alias for `Remove`."""
+        return self.Remove(*args, **kw)
+    def RemovePos(self, *args, **kw):
+        """Compatibility alias for `Remove`."""
+        return self.Remove(*args, **kw)
 
 
     def SetDimension(*args, **kwargs):
index ceb3d56e1420ed04ca6b2ec85ec02eba6d24622b..8580d65dea46b4c82f3949f1dcc9e7cb0a1d322a 100644 (file)
@@ -2476,6 +2476,8 @@ static wxBitmap wxImage_ConvertToMonoBitmap(wxImage *self,unsigned char red,unsi
  static const wxString wxPyIMAGE_OPTION_SAMPLESPERPIXEL(wxIMAGE_OPTION_SAMPLESPERPIXEL); 
  static const wxString wxPyIMAGE_OPTION_COMPRESSION(wxIMAGE_OPTION_COMPRESSION); 
  static const wxString wxPyIMAGE_OPTION_IMAGEDESCRIPTOR(wxIMAGE_OPTION_IMAGEDESCRIPTOR); 
+ static const wxString wxPyIMAGE_OPTION_PNG_FORMAT(wxIMAGE_OPTION_PNG_FORMAT); 
+ static const wxString wxPyIMAGE_OPTION_PNG_BITDEPTH(wxIMAGE_OPTION_PNG_BITDEPTH); 
 
 #include <wx/quantize.h>
 
@@ -2921,7 +2923,7 @@ struct wxPySizerItemInfo {
         : window(NULL), sizer(NULL), gotSize(false),
           size(wxDefaultSize), gotPos(false), pos(-1)
     {}
-    
+
     wxWindow* window;
     wxSizer*  sizer;
     bool      gotSize;
@@ -2929,7 +2931,7 @@ struct wxPySizerItemInfo {
     bool      gotPos;
     int       pos;
 };
+
 static wxPySizerItemInfo wxPySizerItemTypeHelper(PyObject* item, bool checkSize, bool checkIdx ) {
 
     wxPySizerItemInfo info;
@@ -2941,12 +2943,12 @@ static wxPySizerItemInfo wxPySizerItemTypeHelper(PyObject* item, bool checkSize,
     if ( ! wxPyConvertSwigPtr(item, (void**)&info.window, wxT("wxWindow")) ) {
         PyErr_Clear();
         info.window = NULL;
-                
+
         // try wxSizer
         if ( ! wxPyConvertSwigPtr(item, (void**)&info.sizer, wxT("wxSizer")) ) {
             PyErr_Clear();
             info.sizer = NULL;
-            
+
             // try wxSize or (w,h)
             if ( checkSize && wxSize_helper(item, &sizePtr)) {
                 info.size = *sizePtr;
@@ -2982,14 +2984,14 @@ static void wxSizer__setOORInfo(wxSizer *self,PyObject *_self){
                 self->SetClientObject(new wxPyOORClientData(_self));
         }
 static wxSizerItem *wxSizer_Add(wxSizer *self,PyObject *item,int proportion=0,int flag=0,int border=0,PyObject *userData=NULL){
-            
+
             wxPyUserData* data = NULL;
             bool blocked = wxPyBeginBlockThreads();
             wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
             if ( userData && (info.window || info.sizer || info.gotSize) )
                 data = new wxPyUserData(userData);
             wxPyEndBlockThreads(blocked);
-            
+
             // Now call the real Add method if a valid item type was found
             if ( info.window )
                 return self->Add(info.window, proportion, flag, border, data);
@@ -3009,7 +3011,7 @@ static wxSizerItem *wxSizer_Insert(wxSizer *self,int before,PyObject *item,int p
             if ( userData && (info.window || info.sizer || info.gotSize) )
                 data = new wxPyUserData(userData);
             wxPyEndBlockThreads(blocked);
-            
+
             // Now call the real Insert method if a valid item type was found
             if ( info.window )
                 return self->Insert(before, info.window, proportion, flag, border, data);
@@ -3029,7 +3031,7 @@ static wxSizerItem *wxSizer_Prepend(wxSizer *self,PyObject *item,int proportion=
             if ( userData && (info.window || info.sizer || info.gotSize) )
                 data = new wxPyUserData(userData);
             wxPyEndBlockThreads(blocked);
-            
+
             // Now call the real Prepend method if a valid item type was found
             if ( info.window )
                 return self->Prepend(info.window, proportion, flag, border, data);
@@ -3051,7 +3053,7 @@ static bool wxSizer_Remove(wxSizer *self,PyObject *item){
                 return self->Remove(info.sizer);
             else if ( info.gotPos )
                 return self->Remove(info.pos);
-            else 
+            else
                 return false;
         }
 static bool wxSizer_Detach(wxSizer *self,PyObject *item){
@@ -3064,7 +3066,7 @@ static bool wxSizer_Detach(wxSizer *self,PyObject *item){
                 return self->Detach(info.sizer);
             else if ( info.gotPos )
                 return self->Detach(info.pos);
-            else 
+            else
                 return false;
         }
 static wxSizerItem *wxSizer_GetItem(wxSizer *self,PyObject *item){
@@ -3112,9 +3114,9 @@ static bool wxSizer_IsShown(wxSizer *self,PyObject *item){
             bool blocked = wxPyBeginBlockThreads();
             wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, false);
             wxPyEndBlockThreads(blocked);
-            if ( info.window ) 
+            if ( info.window )
                 return self->IsShown(info.window);
-            else if ( info.sizer ) 
+            else if ( info.sizer )
                 return self->IsShown(info.sizer);
             else if ( info.gotPos )
                 return self->IsShown(info.pos);
@@ -3122,7 +3124,7 @@ static bool wxSizer_IsShown(wxSizer *self,PyObject *item){
                 return false;
         }
 
-// See pyclasses.h    
+// See pyclasses.h
 IMP_PYCALLBACK___pure(wxPySizer, wxSizer, RecalcSizes);
 IMP_PYCALLBACK_wxSize__pure(wxPySizer, wxSizer, CalcMin);
 IMPLEMENT_DYNAMIC_CLASS(wxPySizer, wxSizer);
@@ -13659,6 +13661,46 @@ static PyObject *_wrap_IMAGE_OPTION_IMAGEDESCRIPTOR_get(void) {
 }
 
 
+static int _wrap_IMAGE_OPTION_PNG_FORMAT_set(PyObject *) {
+    PyErr_SetString(PyExc_TypeError,"Variable IMAGE_OPTION_PNG_FORMAT is read-only.");
+    return 1;
+}
+
+
+static PyObject *_wrap_IMAGE_OPTION_PNG_FORMAT_get(void) {
+    PyObject *pyobj;
+    
+    {
+#if wxUSE_UNICODE
+        pyobj = PyUnicode_FromWideChar((&wxPyIMAGE_OPTION_PNG_FORMAT)->c_str(), (&wxPyIMAGE_OPTION_PNG_FORMAT)->Len());
+#else
+        pyobj = PyString_FromStringAndSize((&wxPyIMAGE_OPTION_PNG_FORMAT)->c_str(), (&wxPyIMAGE_OPTION_PNG_FORMAT)->Len());
+#endif
+    }
+    return pyobj;
+}
+
+
+static int _wrap_IMAGE_OPTION_PNG_BITDEPTH_set(PyObject *) {
+    PyErr_SetString(PyExc_TypeError,"Variable IMAGE_OPTION_PNG_BITDEPTH is read-only.");
+    return 1;
+}
+
+
+static PyObject *_wrap_IMAGE_OPTION_PNG_BITDEPTH_get(void) {
+    PyObject *pyobj;
+    
+    {
+#if wxUSE_UNICODE
+        pyobj = PyUnicode_FromWideChar((&wxPyIMAGE_OPTION_PNG_BITDEPTH)->c_str(), (&wxPyIMAGE_OPTION_PNG_BITDEPTH)->Len());
+#else
+        pyobj = PyString_FromStringAndSize((&wxPyIMAGE_OPTION_PNG_BITDEPTH)->c_str(), (&wxPyIMAGE_OPTION_PNG_BITDEPTH)->Len());
+#endif
+    }
+    return pyobj;
+}
+
+
 static PyObject *_wrap_new_BMPHandler(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxBMPHandler *result;
@@ -48946,6 +48988,17 @@ SWIGEXPORT(void) SWIG_init(void) {
     SWIG_addvarlink(SWIG_globals,(char*)"IMAGE_OPTION_SAMPLESPERPIXEL",_wrap_IMAGE_OPTION_SAMPLESPERPIXEL_get, _wrap_IMAGE_OPTION_SAMPLESPERPIXEL_set);
     SWIG_addvarlink(SWIG_globals,(char*)"IMAGE_OPTION_COMPRESSION",_wrap_IMAGE_OPTION_COMPRESSION_get, _wrap_IMAGE_OPTION_COMPRESSION_set);
     SWIG_addvarlink(SWIG_globals,(char*)"IMAGE_OPTION_IMAGEDESCRIPTOR",_wrap_IMAGE_OPTION_IMAGEDESCRIPTOR_get, _wrap_IMAGE_OPTION_IMAGEDESCRIPTOR_set);
+    SWIG_addvarlink(SWIG_globals,(char*)"IMAGE_OPTION_PNG_FORMAT",_wrap_IMAGE_OPTION_PNG_FORMAT_get, _wrap_IMAGE_OPTION_PNG_FORMAT_set);
+    SWIG_addvarlink(SWIG_globals,(char*)"IMAGE_OPTION_PNG_BITDEPTH",_wrap_IMAGE_OPTION_PNG_BITDEPTH_get, _wrap_IMAGE_OPTION_PNG_BITDEPTH_set);
+    {
+        PyDict_SetItemString(d,"PNG_TYPE_COLOUR", SWIG_From_int((int)(wxPNG_TYPE_COLOUR))); 
+    }
+    {
+        PyDict_SetItemString(d,"PNG_TYPE_GREY", SWIG_From_int((int)(wxPNG_TYPE_GREY))); 
+    }
+    {
+        PyDict_SetItemString(d,"PNG_TYPE_GREY_RED", SWIG_From_int((int)(wxPNG_TYPE_GREY_RED))); 
+    }
     {
         PyDict_SetItemString(d,"BMP_24BPP", SWIG_From_int((int)(wxBMP_24BPP))); 
     }
index 7b5657108501cf078845cc8f56755b63e61de534..4854085c70a6b850a0e0fdbe17cdd80871b291b6 100644 (file)
@@ -4458,6 +4458,14 @@ class ImageList(_core.Object):
         """AddIcon(self, Icon icon) -> int"""
         return _gdi_.ImageList_AddIcon(*args, **kwargs)
 
+    def GetBitmap(*args, **kwargs):
+        """GetBitmap(self, int index) -> Bitmap"""
+        return _gdi_.ImageList_GetBitmap(*args, **kwargs)
+
+    def GetIcon(*args, **kwargs):
+        """GetIcon(self, int index) -> Icon"""
+        return _gdi_.ImageList_GetIcon(*args, **kwargs)
+
     def Replace(*args, **kwargs):
         """Replace(self, int index, Bitmap bitmap) -> bool"""
         return _gdi_.ImageList_Replace(*args, **kwargs)
index 0f0c02e7a15bd05be9e213cf724ebf4658c4aa8d..936305ecfcc9ff32657fe4550dbb8bddb69f38a1 100644 (file)
@@ -18479,6 +18479,78 @@ static PyObject *_wrap_ImageList_AddIcon(PyObject *, PyObject *args, PyObject *k
 }
 
 
+static PyObject *_wrap_ImageList_GetBitmap(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxImageList *arg1 = (wxImageList *) 0 ;
+    int arg2 ;
+    SwigValueWrapper<wxBitmap > result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "index", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ImageList_GetBitmap",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxImageList, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    {
+        arg2 = (int)(SWIG_As_int(obj1)); 
+        if (SWIG_arg_fail(2)) SWIG_fail;
+    }
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = ((wxImageList const *)arg1)->GetBitmap(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        wxBitmap * resultptr;
+        resultptr = new wxBitmap((wxBitmap &)(result));
+        resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxBitmap, 1);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
+static PyObject *_wrap_ImageList_GetIcon(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxImageList *arg1 = (wxImageList *) 0 ;
+    int arg2 ;
+    wxIcon result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "index", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ImageList_GetIcon",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxImageList, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    {
+        arg2 = (int)(SWIG_As_int(obj1)); 
+        if (SWIG_arg_fail(2)) SWIG_fail;
+    }
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = ((wxImageList const *)arg1)->GetIcon(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        wxIcon * resultptr;
+        resultptr = new wxIcon((wxIcon &)(result));
+        resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxIcon, 1);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_ImageList_Replace(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxImageList *arg1 = (wxImageList *) 0 ;
@@ -21067,6 +21139,8 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"ImageList_Add", (PyCFunction) _wrap_ImageList_Add, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageList_AddWithColourMask", (PyCFunction) _wrap_ImageList_AddWithColourMask, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageList_AddIcon", (PyCFunction) _wrap_ImageList_AddIcon, METH_VARARGS | METH_KEYWORDS, NULL},
+        { (char *)"ImageList_GetBitmap", (PyCFunction) _wrap_ImageList_GetBitmap, METH_VARARGS | METH_KEYWORDS, NULL},
+        { (char *)"ImageList_GetIcon", (PyCFunction) _wrap_ImageList_GetIcon, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageList_Replace", (PyCFunction) _wrap_ImageList_Replace, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageList_Draw", (PyCFunction) _wrap_ImageList_Draw, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageList_GetImageCount", (PyCFunction) _wrap_ImageList_GetImageCount, METH_VARARGS | METH_KEYWORDS, NULL},
index 143d7a2eef9f23cb30bbb5c829f170fa9b4fc9b4..7015c85e7f88115680315da91ca7639a87776e57 100644 (file)
@@ -2515,6 +2515,17 @@ static bool wxConfigBase_ReadBool(wxConfigBase *self,wxString const &key,bool de
 
 #define LOCAL_TZ wxDateTime::Local
 
+static PyObject *DateTime_GetAmPmStrings(){
+            wxString am;
+            wxString pm;
+            wxDateTime::GetAmPmStrings(&am, &pm);
+            bool blocked = wxPyBeginBlockThreads();
+            PyObject* tup = PyTuple_New(2);
+            PyTuple_SET_ITEM(tup, 0, wx2PyString(am));
+            PyTuple_SET_ITEM(tup, 1, wx2PyString(pm));
+            wxPyEndBlockThreads(blocked);
+            return tup;
+        }
 
 #if UINT_MAX < LONG_MAX
 /*@/opt/swig/share/swig/1.3.24/python/pymacros.swg,66,SWIG_define@*/
@@ -19300,53 +19311,22 @@ static PyObject *_wrap_DateTime_GetWeekDayName(PyObject *, PyObject *args, PyObj
 
 static PyObject *_wrap_DateTime_GetAmPmStrings(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
-    wxString *arg1 = (wxString *) 0 ;
-    wxString *arg2 = (wxString *) 0 ;
-    bool temp1 = false ;
-    bool temp2 = false ;
-    PyObject * obj0 = 0 ;
-    PyObject * obj1 = 0 ;
+    PyObject *result;
     char *kwnames[] = {
-        (char *) "OUTPUT",(char *) "OUTPUT", NULL 
+        NULL 
     };
     
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:DateTime_GetAmPmStrings",kwnames,&obj0,&obj1)) goto fail;
-    {
-        arg1 = wxString_in_helper(obj0);
-        if (arg1 == NULL) SWIG_fail;
-        temp1 = true;
-    }
-    {
-        arg2 = wxString_in_helper(obj1);
-        if (arg2 == NULL) SWIG_fail;
-        temp2 = true;
-    }
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":DateTime_GetAmPmStrings",kwnames)) goto fail;
     {
         PyThreadState* __tstate = wxPyBeginAllowThreads();
-        wxDateTime::GetAmPmStrings(arg1,arg2);
+        result = (PyObject *)DateTime_GetAmPmStrings();
         
         wxPyEndAllowThreads(__tstate);
         if (PyErr_Occurred()) SWIG_fail;
     }
-    Py_INCREF(Py_None); resultobj = Py_None;
-    {
-        if (temp1)
-        delete arg1;
-    }
-    {
-        if (temp2)
-        delete arg2;
-    }
+    resultobj = result;
     return resultobj;
     fail:
-    {
-        if (temp1)
-        delete arg1;
-    }
-    {
-        if (temp2)
-        delete arg2;
-    }
     return NULL;
 }
 
index 0afc4d39f6573d0457e0389a0f1b16c73390cf95..4ad86123df0bd040832dea67a3bbdf8db64c3a96 100644 (file)
@@ -3961,6 +3961,14 @@ class PrintData(_core.Object):
         return _windows_.PrintData_SetFilename(*args, **kwargs)
 
     def __nonzero__(self): return self.Ok() 
+    def GetPrivData(*args, **kwargs):
+        """GetPrivData(self) -> PyObject"""
+        return _windows_.PrintData_GetPrivData(*args, **kwargs)
+
+    def SetPrivData(*args, **kwargs):
+        """SetPrivData(self, PyObject data)"""
+        return _windows_.PrintData_SetPrivData(*args, **kwargs)
+
     def GetPrinterCommand(*args, **kwargs):
         """GetPrinterCommand(self) -> String"""
         return _windows_.PrintData_GetPrinterCommand(*args, **kwargs)
index 8dd6cb9cee147a83eb239afe1f5e78d03a1def86..adffb97a0e991e0db1cc5f049e20c08db8f4c621 100644 (file)
@@ -2338,6 +2338,25 @@ IMP_PYCALLBACK_BOOL_(wxPyScrolledWindow, wxScrolledWindow, HasTransparentBackgro
 
  static const wxString wxPyPrintoutTitleStr(wxT("Printout")); 
  static const wxString wxPyPreviewCanvasNameStr(wxT("previewcanvas")); 
+static PyObject *wxPrintData_GetPrivData(wxPrintData *self){
+            PyObject* data;
+            bool blocked = wxPyBeginBlockThreads();
+            data = PyString_FromStringAndSize(self->GetPrivData(),
+                                              self->GetPrivDataLen());
+            wxPyEndBlockThreads(blocked);
+            return data;
+        }
+static void wxPrintData_SetPrivData(wxPrintData *self,PyObject *data){
+            if (! PyString_Check(data)) {
+                wxPyBLOCK_THREADS(PyErr_SetString(PyExc_TypeError,
+                                                  "Expected string object"));
+                return /* NULL */ ;
+            }
+
+            bool blocked = wxPyBeginBlockThreads();
+            self->SetPrivData(PyString_AS_STRING(data), PyString_GET_SIZE(data));
+            wxPyEndBlockThreads(blocked);
+        }
 
 
 IMPLEMENT_ABSTRACT_CLASS(wxPyPrintout, wxPrintout);
@@ -21000,6 +21019,60 @@ static PyObject *_wrap_PrintData_SetFilename(PyObject *, PyObject *args, PyObjec
 }
 
 
+static PyObject *_wrap_PrintData_GetPrivData(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPrintData *arg1 = (wxPrintData *) 0 ;
+    PyObject *result;
+    PyObject * obj0 = 0 ;
+    char *kwnames[] = {
+        (char *) "self", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PrintData_GetPrivData",kwnames,&obj0)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPrintData, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (PyObject *)wxPrintData_GetPrivData(arg1);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    resultobj = result;
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
+static PyObject *_wrap_PrintData_SetPrivData(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPrintData *arg1 = (wxPrintData *) 0 ;
+    PyObject *arg2 = (PyObject *) 0 ;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "data", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PrintData_SetPrivData",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPrintData, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    arg2 = obj1;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        wxPrintData_SetPrivData(arg1,arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    Py_INCREF(Py_None); resultobj = Py_None;
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_PrintData_GetPrinterCommand(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPrintData *arg1 = (wxPrintData *) 0 ;
@@ -27990,6 +28063,8 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"PrintData_SetPrintMode", (PyCFunction) _wrap_PrintData_SetPrintMode, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"PrintData_GetFilename", (PyCFunction) _wrap_PrintData_GetFilename, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"PrintData_SetFilename", (PyCFunction) _wrap_PrintData_SetFilename, METH_VARARGS | METH_KEYWORDS, NULL},
+        { (char *)"PrintData_GetPrivData", (PyCFunction) _wrap_PrintData_GetPrivData, METH_VARARGS | METH_KEYWORDS, NULL},
+        { (char *)"PrintData_SetPrivData", (PyCFunction) _wrap_PrintData_SetPrivData, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"PrintData_GetPrinterCommand", (PyCFunction) _wrap_PrintData_GetPrinterCommand, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"PrintData_GetPrinterOptions", (PyCFunction) _wrap_PrintData_GetPrinterOptions, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"PrintData_GetPreviewCommand", (PyCFunction) _wrap_PrintData_GetPreviewCommand, METH_VARARGS | METH_KEYWORDS, NULL},