]> git.saurik.com Git - wxWidgets.git/commitdiff
reSWIGged
authorRobin Dunn <robin@alldunn.com>
Mon, 4 Apr 2005 15:29:48 +0000 (15:29 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 4 Apr 2005 15:29:48 +0000 (15:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/__core_rename.i
wxPython/src/gtk/_core.py
wxPython/src/gtk/_core_wrap.cpp
wxPython/wxPython/_core.py

index c52f48d9fc69965022f60da436c091f2af08228f..5ae38d0fc0fda946524164506a3a63556d6a4abc 100644 (file)
@@ -15,6 +15,7 @@
 %rename(STATIC_BORDER)                      wxSTATIC_BORDER;
 %rename(TRANSPARENT_WINDOW)                 wxTRANSPARENT_WINDOW;
 %rename(NO_BORDER)                          wxNO_BORDER;
+%rename(DEFAULT_CONTROL_BORDER)             wxDEFAULT_CONTROL_BORDER;
 %rename(TAB_TRAVERSAL)                      wxTAB_TRAVERSAL;
 %rename(WANTS_CHARS)                        wxWANTS_CHARS;
 %rename(POPUP_WINDOW)                       wxPOPUP_WINDOW;
 %rename(InternetFSHandler)                  wxInternetFSHandler;
 %rename(ZipFSHandler)                       wxZipFSHandler;
 %rename(MemoryFSHandler)                    wxMemoryFSHandler;
+%rename(IMAGE_ALPHA_TRANSPARENT)            wxIMAGE_ALPHA_TRANSPARENT;
+%rename(IMAGE_ALPHA_THRESHOLD)              wxIMAGE_ALPHA_THRESHOLD;
+%rename(IMAGE_ALPHA_OPAQUE)                 wxIMAGE_ALPHA_OPAQUE;
 %rename(ImageHandler)                       wxImageHandler;
 %rename(ImageHistogram)                     wxImageHistogram;
 %rename(Image)                              wxImage;
index 2120e6cb58e35ba2075c178db01c5da349fcf208..366bb719945be8c210a0d0f23933269df8b4de91 100644 (file)
@@ -85,6 +85,7 @@ SIMPLE_BORDER = _core_.SIMPLE_BORDER
 STATIC_BORDER = _core_.STATIC_BORDER
 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
 NO_BORDER = _core_.NO_BORDER
+DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
 WANTS_CHARS = _core_.WANTS_CHARS
 POPUP_WINDOW = _core_.POPUP_WINDOW
@@ -2033,6 +2034,9 @@ def MemoryFSHandler_RemoveFile(*args, **kwargs):
     """MemoryFSHandler_RemoveFile(String filename)"""
     return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
 
+IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
+IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
+IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
 #---------------------------------------------------------------------------
 
 class ImageHandler(Object):
@@ -2241,6 +2245,15 @@ class Image(Object):
         """
         return _core_.Image_InitAlpha(*args, **kwargs)
 
+    def IsTransparent(*args, **kwargs):
+        """
+        IsTransparent(self, int x, int y, unsigned char threshold=IMAGE_ALPHA_THRESHOLD) -> bool
+
+        Returns True if this pixel is masked or has an alpha value less than
+        the spcified threshold.
+        """
+        return _core_.Image_IsTransparent(*args, **kwargs)
+
     def FindFirstUnusedColour(*args, **kwargs):
         """
         FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
@@ -2253,7 +2266,7 @@ class Image(Object):
 
     def ConvertAlphaToMask(*args, **kwargs):
         """
-        ConvertAlphaToMask(self, byte threshold=128) -> bool
+        ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
 
         If the image has alpha channel, this method converts it to mask. All pixels
         with alpha value less than ``threshold`` are replaced with mask colour and the
index 461ff8bddd63ebffc7b782ca2a4b47e964cf83d6..fbd79c59111ad5ee3dc117e7d502e3567cb9cc17 100644 (file)
@@ -11522,6 +11522,54 @@ static PyObject *_wrap_Image_InitAlpha(PyObject *, PyObject *args, PyObject *kwa
 }
 
 
+static PyObject *_wrap_Image_IsTransparent(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxImage *arg1 = (wxImage *) 0 ;
+    int arg2 ;
+    int arg3 ;
+    unsigned char arg4 = (unsigned char) wxIMAGE_ALPHA_THRESHOLD ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    PyObject * obj2 = 0 ;
+    PyObject * obj3 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "x",(char *) "y",(char *) "threshold", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Image_IsTransparent",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxImage, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    {
+        arg2 = (int)(SWIG_As_int(obj1)); 
+        if (SWIG_arg_fail(2)) SWIG_fail;
+    }
+    {
+        arg3 = (int)(SWIG_As_int(obj2)); 
+        if (SWIG_arg_fail(3)) SWIG_fail;
+    }
+    if (obj3) {
+        {
+            arg4 = (unsigned char)(SWIG_As_unsigned_SS_char(obj3)); 
+            if (SWIG_arg_fail(4)) SWIG_fail;
+        }
+    }
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)((wxImage const *)arg1)->IsTransparent(arg2,arg3,arg4);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_Image_FindFirstUnusedColour(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxImage *arg1 = (wxImage *) 0 ;
@@ -11595,7 +11643,7 @@ static PyObject *_wrap_Image_FindFirstUnusedColour(PyObject *, PyObject *args, P
 static PyObject *_wrap_Image_ConvertAlphaToMask(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxImage *arg1 = (wxImage *) 0 ;
-    byte arg2 = (byte) 128 ;
+    byte arg2 = (byte) wxIMAGE_ALPHA_THRESHOLD ;
     bool result;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
@@ -45456,6 +45504,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Image_GetAlpha", (PyCFunction) _wrap_Image_GetAlpha, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"Image_HasAlpha", (PyCFunction) _wrap_Image_HasAlpha, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"Image_InitAlpha", (PyCFunction) _wrap_Image_InitAlpha, METH_VARARGS | METH_KEYWORDS, NULL},
+        { (char *)"Image_IsTransparent", (PyCFunction) _wrap_Image_IsTransparent, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"Image_FindFirstUnusedColour", (PyCFunction) _wrap_Image_FindFirstUnusedColour, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"Image_ConvertAlphaToMask", (PyCFunction) _wrap_Image_ConvertAlphaToMask, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"Image_ConvertColourToAlpha", (PyCFunction) _wrap_Image_ConvertColourToAlpha, METH_VARARGS | METH_KEYWORDS, NULL},
@@ -47675,6 +47724,9 @@ SWIGEXPORT(void) SWIG_init(void) {
     {
         PyDict_SetItemString(d,"NO_BORDER", SWIG_From_int((int)(wxNO_BORDER))); 
     }
+    {
+        PyDict_SetItemString(d,"DEFAULT_CONTROL_BORDER", SWIG_From_int((int)(wxDEFAULT_CONTROL_BORDER))); 
+    }
     {
         PyDict_SetItemString(d,"TAB_TRAVERSAL", SWIG_From_int((int)(wxTAB_TRAVERSAL))); 
     }
@@ -49464,6 +49516,15 @@ SWIGEXPORT(void) SWIG_init(void) {
     
     wxPyPtrTypeMap_Add("wxFileSystemHandler", "wxPyFileSystemHandler");
     
+    {
+        PyDict_SetItemString(d,"IMAGE_ALPHA_TRANSPARENT", SWIG_From_int((int)(wxIMAGE_ALPHA_TRANSPARENT))); 
+    }
+    {
+        PyDict_SetItemString(d,"IMAGE_ALPHA_THRESHOLD", SWIG_From_int((int)(wxIMAGE_ALPHA_THRESHOLD))); 
+    }
+    {
+        PyDict_SetItemString(d,"IMAGE_ALPHA_OPAQUE", SWIG_From_int((int)(wxIMAGE_ALPHA_OPAQUE))); 
+    }
     SWIG_addvarlink(SWIG_globals,(char*)"NullImage",_wrap_NullImage_get, _wrap_NullImage_set);
     SWIG_addvarlink(SWIG_globals,(char*)"IMAGE_OPTION_FILENAME",_wrap_IMAGE_OPTION_FILENAME_get, _wrap_IMAGE_OPTION_FILENAME_set);
     SWIG_addvarlink(SWIG_globals,(char*)"IMAGE_OPTION_BMP_FORMAT",_wrap_IMAGE_OPTION_BMP_FORMAT_get, _wrap_IMAGE_OPTION_BMP_FORMAT_set);
index 6c6b496ecf633d7841215c5bbbcd9bfb33981d70..d9111019895f5d4a5788868ddb2e9048ed49ec42 100644 (file)
@@ -31,6 +31,7 @@ wxSIMPLE_BORDER = wx._core.SIMPLE_BORDER
 wxSTATIC_BORDER = wx._core.STATIC_BORDER
 wxTRANSPARENT_WINDOW = wx._core.TRANSPARENT_WINDOW
 wxNO_BORDER = wx._core.NO_BORDER
+wxDEFAULT_CONTROL_BORDER = wx._core.DEFAULT_CONTROL_BORDER
 wxTAB_TRAVERSAL = wx._core.TAB_TRAVERSAL
 wxWANTS_CHARS = wx._core.WANTS_CHARS
 wxPOPUP_WINDOW = wx._core.POPUP_WINDOW
@@ -673,6 +674,9 @@ __wxMemoryFSHandler_AddFile_Data = wx._core.__wxMemoryFSHandler_AddFile_Data
 wxMemoryFSHandler = wx._core.MemoryFSHandler
 wxMemoryFSHandlerPtr = wx._core.MemoryFSHandlerPtr
 wxMemoryFSHandler_RemoveFile = wx._core.MemoryFSHandler_RemoveFile
+wxIMAGE_ALPHA_TRANSPARENT = wx._core.IMAGE_ALPHA_TRANSPARENT
+wxIMAGE_ALPHA_THRESHOLD = wx._core.IMAGE_ALPHA_THRESHOLD
+wxIMAGE_ALPHA_OPAQUE = wx._core.IMAGE_ALPHA_OPAQUE
 wxImageHandler = wx._core.ImageHandler
 wxImageHandlerPtr = wx._core.ImageHandlerPtr
 wxImageHistogram = wx._core.ImageHistogram