reSWIGged

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31046 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-12-17 02:10:00 +00:00
parent 0d2653ff97
commit 5cbf236d83
26 changed files with 1590 additions and 170 deletions
+28
View File
@@ -5174,6 +5174,24 @@ def GetApp(*args, **kwargs):
Return a reference to the current wx.App object.
"""
return _core_.GetApp(*args, **kwargs)
def SetDefaultPyEncoding(*args, **kwargs):
"""
SetDefaultPyEncoding(string encoding)
Sets the encoding that wxPython will use when it needs to convert a
Python string or unicode object to or from a wxString.
"""
return _core_.SetDefaultPyEncoding(*args, **kwargs)
def GetDefaultPyEncoding(*args, **kwargs):
"""
GetDefaultPyEncoding() -> string
Gets the current encoding that wxPython will use when it needs to
convert a Python string or unicode object to or from a wxString.
"""
return _core_.GetDefaultPyEncoding(*args, **kwargs)
#----------------------------------------------------------------------
class PyOnDemandOutputWindow:
@@ -10841,6 +10859,16 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION:
#----------------------------------------------------------------------------
# Set the default string conversion encoding from the locale
import locale
default = locale.getdefaultlocale()[1]
if default:
wx.SetDefaultPyEncoding(default)
del default
del locale
#----------------------------------------------------------------------------
class PyDeadObjectError(AttributeError):
pass
+84
View File
@@ -1555,6 +1555,42 @@ wxPyApp *new_wxPyApp(){
wxPyApp* wxPyGetApp() { return (wxPyApp*)wxTheApp; }
SWIGSTATICINLINE(int)
SWIG_AsCharPtr(PyObject *obj, char **val)
{
char* cptr = 0;
if (SWIG_AsCharPtrAndSize(obj, &cptr, (size_t*)(0))) {
if (val) *val = cptr;
return 1;
}
if (val) {
PyErr_SetString(PyExc_TypeError, "a char* is expected");
}
return 0;
}
SWIGSTATICINLINE(PyObject *)
SWIG_FromCharPtr(const char* cptr)
{
if (cptr) {
size_t size = strlen(cptr);
if (size > INT_MAX) {
return SWIG_NewPointerObj(swig_const_cast(cptr,char*),
SWIG_TypeQuery("char *"), 0);
} else {
if (size != 0) {
return PyString_FromStringAndSize(cptr, size);
} else {
return PyString_FromString(cptr);
}
}
}
Py_INCREF(Py_None);
return Py_None;
}
#ifdef __WXMAC__
// A dummy class that raises an exception if used...
@@ -21467,6 +21503,52 @@ static PyObject *_wrap_GetApp(PyObject *, PyObject *args, PyObject *kwargs) {
}
static PyObject *_wrap_SetDefaultPyEncoding(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
char *arg1 ;
PyObject * obj0 = 0 ;
char *kwnames[] = {
(char *) "encoding", NULL
};
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:SetDefaultPyEncoding",kwnames,&obj0)) goto fail;
if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) SWIG_fail;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxSetDefaultPyEncoding((char const *)arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
Py_INCREF(Py_None); resultobj = Py_None;
return resultobj;
fail:
return NULL;
}
static PyObject *_wrap_GetDefaultPyEncoding(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
char *result;
char *kwnames[] = {
NULL
};
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetDefaultPyEncoding",kwnames)) goto fail;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (char *)wxGetDefaultPyEncoding();
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
resultobj = SWIG_FromCharPtr(result);
return resultobj;
fail:
return NULL;
}
static PyObject *_wrap_new_EventLoop(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxEventLoop *result;
@@ -42115,6 +42197,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"PostEvent", (PyCFunction) _wrap_PostEvent, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"App_CleanUp", (PyCFunction) _wrap_App_CleanUp, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"GetApp", (PyCFunction) _wrap_GetApp, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"SetDefaultPyEncoding", (PyCFunction) _wrap_SetDefaultPyEncoding, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"GetDefaultPyEncoding", (PyCFunction) _wrap_GetDefaultPyEncoding, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"new_EventLoop", (PyCFunction) _wrap_new_EventLoop, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"delete_EventLoop", (PyCFunction) _wrap_delete_EventLoop, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"EventLoop_Run", (PyCFunction) _wrap_EventLoop_Run, METH_VARARGS | METH_KEYWORDS, NULL },
+11
View File
@@ -3643,6 +3643,17 @@ class DC(_core.Object):
"""
return _gdi_.DC_SetLogicalFunction(*args, **kwargs)
def ComputeScaleAndOrigin(*args, **kwargs):
"""
ComputeScaleAndOrigin(self)
Performs all necessary computations for given platform and context
type after each change of scale and origin parameters. Usually called
automatically internally after such changes.
"""
return _gdi_.DC_ComputeScaleAndOrigin(*args, **kwargs)
def SetOptimization(self, optimize):
pass
def GetOptimization(self):
+26
View File
@@ -15540,6 +15540,31 @@ static PyObject *_wrap_DC_SetLogicalFunction(PyObject *, PyObject *args, PyObjec
}
static PyObject *_wrap_DC_ComputeScaleAndOrigin(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxDC *arg1 = (wxDC *) 0 ;
PyObject * obj0 = 0 ;
char *kwnames[] = {
(char *) "self", NULL
};
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:DC_ComputeScaleAndOrigin",kwnames,&obj0)) goto fail;
if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxDC,
SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
(arg1)->ComputeScaleAndOrigin();
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
Py_INCREF(Py_None); resultobj = Py_None;
return resultobj;
fail:
return NULL;
}
static PyObject *_wrap_DC_CalcBoundingBox(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxDC *arg1 = (wxDC *) 0 ;
@@ -19868,6 +19893,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"DC_SetAxisOrientation", (PyCFunction) _wrap_DC_SetAxisOrientation, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DC_GetLogicalFunction", (PyCFunction) _wrap_DC_GetLogicalFunction, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DC_SetLogicalFunction", (PyCFunction) _wrap_DC_SetLogicalFunction, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DC_ComputeScaleAndOrigin", (PyCFunction) _wrap_DC_ComputeScaleAndOrigin, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DC_CalcBoundingBox", (PyCFunction) _wrap_DC_CalcBoundingBox, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DC_CalcBoundingBoxPoint", (PyCFunction) _wrap_DC_CalcBoundingBoxPoint, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DC_ResetBoundingBox", (PyCFunction) _wrap_DC_ResetBoundingBox, METH_VARARGS | METH_KEYWORDS, NULL },
+5 -6
View File
@@ -45,12 +45,11 @@ class Panel(_core.Window):
"""
SetFocus(self)
Overrides `wx.Window.SetFocus`. This method
uses the (undocumented) mix-in class wxControlContainer which manages
the focus and TAB logic for controls which usually have child controls.
In practice, if you call this method and the panel has at least
one child window, then the focus will be given to the child window.
Overrides `wx.Window.SetFocus`. This method uses the (undocumented)
mix-in class wxControlContainer which manages the focus and TAB logic
for controls which usually have child controls. In practice, if you
call this method and the panel has at least one child window, then the
focus will be given to the child window.
"""
return _windows_.Panel_SetFocus(*args, **kwargs)