]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/mac/_core_wrap.cpp
Added color setting tool to the RichTextCtrl sample
[wxWidgets.git] / wxPython / src / mac / _core_wrap.cpp
index 73f818f3eeb9eb5a5b446d1ec1b02d145d0dbcf8..36f30a338de90c9d12be6ceb0e12d22282a85259 100644 (file)
@@ -985,6 +985,10 @@ typedef struct swig_const_info {
 
 /* Common SWIG API */
 
 
 /* Common SWIG API */
 
+#if PY_VERSION_HEX < 0x02050000
+typedef int Py_ssize_t;
+#endif
+
 /* for raw pointers */
 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
 #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
 /* for raw pointers */
 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
 #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
@@ -2048,7 +2052,7 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
     void *vptr = 0;
     
     /* here we get the method pointer for callbacks */
     void *vptr = 0;
     
     /* here we get the method pointer for callbacks */
-    char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
     if (desc) {
       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
     if (desc) {
       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
@@ -3208,7 +3212,7 @@ SWIGINTERN int
 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
 {
   if (PyString_Check(obj)) {
 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
 {
   if (PyString_Check(obj)) {
-    char *cstr; int len;
+    char *cstr; Py_ssize_t len;
     PyString_AsStringAndSize(obj, &cstr, &len);
     if (cptr)  {
       if (alloc) {
     PyString_AsStringAndSize(obj, &cstr, &len);
     if (cptr)  {
       if (alloc) {
@@ -11861,6 +11865,62 @@ fail:
 }
 
 
 }
 
 
+SWIGINTERN PyObject *_wrap_ImageHandler_CanReadStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
+  PyObject *resultobj = 0;
+  wxImageHandler *arg1 = (wxImageHandler *) 0 ;
+  wxInputStream *arg2 = 0 ;
+  bool result;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  wxPyInputStream *temp2 ;
+  bool created2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  char *  kwnames[] = {
+    (char *) "self",(char *) "stream", NULL 
+  };
+  
+  if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ImageHandler_CanReadStream",kwnames,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxImageHandler, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageHandler_CanReadStream" "', expected argument " "1"" of type '" "wxImageHandler *""'"); 
+  }
+  arg1 = reinterpret_cast< wxImageHandler * >(argp1);
+  {
+    if (wxPyConvertSwigPtr(obj1, (void **)&temp2, wxT("wxPyInputStream"))) {
+      arg2 = temp2->m_wxis;
+      created2 = false;
+    } else {
+      PyErr_Clear();  // clear the failure of the wxPyConvert above
+      arg2 = wxPyCBInputStream_create(obj1, false);
+      if (arg2 == NULL) {
+        PyErr_SetString(PyExc_TypeError, "Expected wx.InputStream or Python file-like object.");
+        SWIG_fail;
+      }
+      created2 = true;
+    }
+  }
+  {
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    result = (bool)(arg1)->CanRead(*arg2);
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) SWIG_fail;
+  }
+  {
+    resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+  }
+  {
+    if (created2) delete arg2; 
+  }
+  return resultobj;
+fail:
+  {
+    if (created2) delete arg2; 
+  }
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_ImageHandler_SetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
   PyObject *resultobj = 0;
   wxImageHandler *arg1 = (wxImageHandler *) 0 ;
 SWIGINTERN PyObject *_wrap_ImageHandler_SetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
   PyObject *resultobj = 0;
   wxImageHandler *arg1 = (wxImageHandler *) 0 ;
@@ -52893,6 +52953,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"ImageHandler_GetType", (PyCFunction)_wrap_ImageHandler_GetType, METH_O, NULL},
         { (char *)"ImageHandler_GetMimeType", (PyCFunction)_wrap_ImageHandler_GetMimeType, METH_O, NULL},
         { (char *)"ImageHandler_CanRead", (PyCFunction) _wrap_ImageHandler_CanRead, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageHandler_GetType", (PyCFunction)_wrap_ImageHandler_GetType, METH_O, NULL},
         { (char *)"ImageHandler_GetMimeType", (PyCFunction)_wrap_ImageHandler_GetMimeType, METH_O, NULL},
         { (char *)"ImageHandler_CanRead", (PyCFunction) _wrap_ImageHandler_CanRead, METH_VARARGS | METH_KEYWORDS, NULL},
+        { (char *)"ImageHandler_CanReadStream", (PyCFunction) _wrap_ImageHandler_CanReadStream, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageHandler_SetName", (PyCFunction) _wrap_ImageHandler_SetName, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageHandler_SetExtension", (PyCFunction) _wrap_ImageHandler_SetExtension, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageHandler_SetType", (PyCFunction) _wrap_ImageHandler_SetType, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageHandler_SetName", (PyCFunction) _wrap_ImageHandler_SetName, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageHandler_SetExtension", (PyCFunction) _wrap_ImageHandler_SetExtension, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ImageHandler_SetType", (PyCFunction) _wrap_ImageHandler_SetType, METH_VARARGS | METH_KEYWORDS, NULL},
@@ -55616,11 +55677,11 @@ extern "C" {
     swig_type_info **types_initial) {
     size_t i;
     for (i = 0; methods[i].ml_name; ++i) {
     swig_type_info **types_initial) {
     size_t i;
     for (i = 0; methods[i].ml_name; ++i) {
-      char *c = methods[i].ml_doc;
+      const char *c = methods[i].ml_doc;
       if (c && (c = strstr(c, "swig_ptr: "))) {
         int j;
         swig_const_info *ci = 0;
       if (c && (c = strstr(c, "swig_ptr: "))) {
         int j;
         swig_const_info *ci = 0;
-        char *name = c + 10;
+        const char *name = c + 10;
         for (j = 0; const_table[j].type; ++j) {
           if (strncmp(const_table[j].name, name, 
               strlen(const_table[j].name)) == 0) {
         for (j = 0; const_table[j].type; ++j) {
           if (strncmp(const_table[j].name, name, 
               strlen(const_table[j].name)) == 0) {