Added typemap for wxArrayString

Added wxMimeTypesManager and wxFileType

Other updates...


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-10-30 06:53:13 +00:00
parent b37c7e1dcd
commit 5c0282d504
10 changed files with 2271 additions and 113 deletions

View File

@@ -28,7 +28,7 @@ on.
""" """
BUILD_GLCANVAS = 0 # If true, build the contrib/glcanvas extension module BUILD_GLCANVAS = 1 # If true, build the contrib/glcanvas extension module
BUILD_OGL = 1 # If true, build the contrib/ogl extension module BUILD_OGL = 1 # If true, build the contrib/ogl extension module
BUILD_STC = 1 # If true, build the contrib/stc extension module BUILD_STC = 1 # If true, build the contrib/stc extension module
BUILD_IEWIN = 0 # Internet Explorer wrapper (experimental) BUILD_IEWIN = 0 # Internet Explorer wrapper (experimental)

View File

@@ -294,11 +294,7 @@ bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y,
const wxArrayString& filenames) { const wxArrayString& filenames) {
bool rval = FALSE; bool rval = FALSE;
wxPyTState* state = wxPyBeginBlockThreads(); wxPyTState* state = wxPyBeginBlockThreads();
PyObject* list = PyList_New(0); PyObject* list = wxArrayString2PyList_helper(filenames);
for (size_t i=0; i<filenames.GetCount(); i++) {
PyObject* str = PyString_FromString(filenames[i].c_str());
PyList_Append(list, str);
}
if (m_myInst.findCallback("OnDropFiles")) if (m_myInst.findCallback("OnDropFiles"))
rval = m_myInst.callCallback(Py_BuildValue("(iiO)",x,y,list)); rval = m_myInst.callCallback(Py_BuildValue("(iiO)",x,y,list));
Py_DECREF(list); Py_DECREF(list);
@@ -1711,10 +1707,7 @@ static PyObject *_wrap_new_wxFileDataObject(PyObject *self, PyObject *args, PyOb
static PyObject * wxFileDataObject_GetFilenames(wxFileDataObject *self) { static PyObject * wxFileDataObject_GetFilenames(wxFileDataObject *self) {
const wxArrayString& strings = self->GetFilenames(); const wxArrayString& strings = self->GetFilenames();
PyObject* list = PyList_New(0); return wxArrayString2PyList_helper(strings);
for (size_t x=0; x<strings.GetCount(); x++)
PyList_Append(list, PyString_FromString(strings[x]));
return list;
} }
static PyObject *_wrap_wxFileDataObject_GetFilenames(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxFileDataObject_GetFilenames(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;

View File

@@ -1470,13 +1470,7 @@ static PyObject *_wrap_wxFileDialog_ShowModal(PyObject *self, PyObject *args, Py
static PyObject * wxFileDialog_GetFilenames(wxFileDialog *self) { static PyObject * wxFileDialog_GetFilenames(wxFileDialog *self) {
wxArrayString arr; wxArrayString arr;
self->GetFilenames(arr); self->GetFilenames(arr);
size_t count = arr.GetCount(); return wxArrayString2PyList_helper(arr);
PyObject* listObj = PyList_New(0);
for(size_t x=0; x<count; x++) {
PyObject* name = PyString_FromString(arr[x]);
PyList_Append(listObj, name);
}
return listObj;
} }
static PyObject *_wrap_wxFileDialog_GetFilenames(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxFileDialog_GetFilenames(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
@@ -1510,13 +1504,7 @@ static PyObject *_wrap_wxFileDialog_GetFilenames(PyObject *self, PyObject *args,
static PyObject * wxFileDialog_GetPaths(wxFileDialog *self) { static PyObject * wxFileDialog_GetPaths(wxFileDialog *self) {
wxArrayString arr; wxArrayString arr;
self->GetPaths(arr); self->GetPaths(arr);
size_t count = arr.GetCount(); return wxArrayString2PyList_helper(arr);
PyObject* listObj = PyList_New(0);
for(size_t x=0; x<count; x++) {
PyObject* name = PyString_FromString(arr[x]);
PyList_Append(listObj, name);
}
return listObj;
} }
static PyObject *_wrap_wxFileDialog_GetPaths(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxFileDialog_GetPaths(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;

View File

@@ -1457,13 +1457,13 @@ static PyObject *_wrap_new_wxBitmap(PyObject *self, PyObject *args, PyObject *kw
PyObject * _resultobj; PyObject * _resultobj;
wxBitmap * _result; wxBitmap * _result;
wxString * _arg0; wxString * _arg0;
wxBitmapType _arg1; wxBitmapType _arg1 = (wxBitmapType ) wxBITMAP_TYPE_BMP;
PyObject * _obj0 = 0; PyObject * _obj0 = 0;
char *_kwnames[] = { "name","type", NULL }; char *_kwnames[] = { "name","type", NULL };
char _ptemp[128]; char _ptemp[128];
self = self; self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:new_wxBitmap",_kwnames,&_obj0,&_arg1)) if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:new_wxBitmap",_kwnames,&_obj0,&_arg1))
return NULL; return NULL;
{ {
#if PYTHON_API_VERSION >= 1009 #if PYTHON_API_VERSION >= 1009
@@ -1607,13 +1607,13 @@ static PyObject *_wrap_wxBitmap_LoadFile(PyObject *self, PyObject *args, PyObjec
bool _result; bool _result;
wxBitmap * _arg0; wxBitmap * _arg0;
wxString * _arg1; wxString * _arg1;
long _arg2; wxBitmapType _arg2 = (wxBitmapType ) wxBITMAP_TYPE_BMP;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _obj1 = 0; PyObject * _obj1 = 0;
char *_kwnames[] = { "self","name","flags", NULL }; char *_kwnames[] = { "self","name","type", NULL };
self = self; self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOl:wxBitmap_LoadFile",_kwnames,&_argo0,&_obj1,&_arg2)) if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxBitmap_LoadFile",_kwnames,&_argo0,&_obj1,&_arg2))
return NULL; return NULL;
if (_argo0) { if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; } if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -1660,7 +1660,7 @@ static PyObject *_wrap_wxBitmap_SaveFile(PyObject *self, PyObject *args, PyObjec
bool _result; bool _result;
wxBitmap * _arg0; wxBitmap * _arg0;
wxString * _arg1; wxString * _arg1;
int _arg2; wxBitmapType _arg2;
wxPalette * _arg3 = (wxPalette *) NULL; wxPalette * _arg3 = (wxPalette *) NULL;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _obj1 = 0; PyObject * _obj1 = 0;

View File

@@ -7822,67 +7822,6 @@ static PyObject *_wrap_wxGrid_DrawTextRectangle(PyObject *self, PyObject *args,
return _resultobj; return _resultobj;
} }
#define wxGrid_StringToLines(_swigobj,_swigarg0,_swigarg1) (_swigobj->StringToLines(_swigarg0,_swigarg1))
static PyObject *_wrap_wxGrid_StringToLines(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGrid * _arg0;
wxString * _arg1;
wxArrayString * _arg2;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo2 = 0;
char *_kwnames[] = { "self","value","lines", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxGrid_StringToLines",_kwnames,&_argo0,&_obj1,&_argo2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGrid_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGrid_StringToLines. Expected _wxGrid_p.");
return NULL;
}
}
{
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
return NULL;
_arg1 = new wxString(tmpPtr, tmpSize);
#else
if (!PyString_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
_arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1));
#endif
}
if (_argo2) {
if (_argo2 == Py_None) { _arg2 = NULL; }
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxArrayString_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxGrid_StringToLines. Expected _wxArrayString_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGrid_StringToLines(_arg0,*_arg1,*_arg2);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}
#define wxGrid_GetTextBoxSize(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->GetTextBoxSize(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) #define wxGrid_GetTextBoxSize(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->GetTextBoxSize(_swigarg0,_swigarg1,_swigarg2,_swigarg3))
static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
@@ -7895,7 +7834,7 @@ static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyO
long temp0; long temp0;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _argo1 = 0; PyObject * _argo1 = 0;
PyObject * _argo2 = 0; PyObject * _obj2 = 0;
char *_kwnames[] = { "self","dc","lines", NULL }; char *_kwnames[] = { "self","dc","lines", NULL };
self = self; self = self;
@@ -7905,7 +7844,7 @@ static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyO
{ {
_arg4 = &temp0; _arg4 = &temp0;
} }
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxGrid_GetTextBoxSize",_kwnames,&_argo0,&_argo1,&_argo2)) if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxGrid_GetTextBoxSize",_kwnames,&_argo0,&_argo1,&_obj2))
return NULL; return NULL;
if (_argo0) { if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; } if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -7921,13 +7860,21 @@ static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyO
return NULL; return NULL;
} }
} }
if (_argo2) { {
if (_argo2 == Py_None) { _arg2 = NULL; } if (! PySequence_Check(_obj2)) {
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxArrayString_p")) { PyErr_SetString(PyExc_TypeError, "Sequence of strings expected.");
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxGrid_GetTextBoxSize. Expected _wxArrayString_p.");
return NULL; return NULL;
}
} }
_arg2 = new wxArrayString;
int i, len=PySequence_Length(_obj2);
for (i=0; i<len; i++) {
PyObject* item = PySequence_GetItem(_obj2, i);
PyObject* str = PyObject_Str(item);
_arg2->Add(PyString_AsString(item));
Py_DECREF(item);
Py_DECREF(str);
}
}
{ {
wxPy_BEGIN_ALLOW_THREADS; wxPy_BEGIN_ALLOW_THREADS;
wxGrid_GetTextBoxSize(_arg0,*_arg1,*_arg2,_arg3,_arg4); wxGrid_GetTextBoxSize(_arg0,*_arg1,*_arg2,_arg3,_arg4);
@@ -7945,6 +7892,10 @@ static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyO
PyObject *o; PyObject *o;
o = PyInt_FromLong((long) (*_arg4)); o = PyInt_FromLong((long) (*_arg4));
_resultobj = t_output_helper(_resultobj, o); _resultobj = t_output_helper(_resultobj, o);
}
{
if (_obj2)
delete _arg2;
} }
return _resultobj; return _resultobj;
} }
@@ -14175,7 +14126,6 @@ static PyMethodDef gridcMethods[] = {
{ "wxGrid_EndBatch", (PyCFunction) _wrap_wxGrid_EndBatch, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_EndBatch", (PyCFunction) _wrap_wxGrid_EndBatch, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_BeginBatch", (PyCFunction) _wrap_wxGrid_BeginBatch, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_BeginBatch", (PyCFunction) _wrap_wxGrid_BeginBatch, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_GetTextBoxSize", (PyCFunction) _wrap_wxGrid_GetTextBoxSize, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_GetTextBoxSize", (PyCFunction) _wrap_wxGrid_GetTextBoxSize, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_StringToLines", (PyCFunction) _wrap_wxGrid_StringToLines, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_DrawTextRectangle", (PyCFunction) _wrap_wxGrid_DrawTextRectangle, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_DrawTextRectangle", (PyCFunction) _wrap_wxGrid_DrawTextRectangle, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_DrawCellHighlight", (PyCFunction) _wrap_wxGrid_DrawCellHighlight, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_DrawCellHighlight", (PyCFunction) _wrap_wxGrid_DrawCellHighlight, METH_VARARGS | METH_KEYWORDS },
{ "wxGrid_DeleteCols", (PyCFunction) _wrap_wxGrid_DeleteCols, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_DeleteCols", (PyCFunction) _wrap_wxGrid_DeleteCols, METH_VARARGS | METH_KEYWORDS },

View File

@@ -958,9 +958,6 @@ class wxGridPtr(wxScrolledWindowPtr):
def DrawTextRectangle(self, *_args, **_kwargs): def DrawTextRectangle(self, *_args, **_kwargs):
val = apply(gridc.wxGrid_DrawTextRectangle,(self,) + _args, _kwargs) val = apply(gridc.wxGrid_DrawTextRectangle,(self,) + _args, _kwargs)
return val return val
def StringToLines(self, *_args, **_kwargs):
val = apply(gridc.wxGrid_StringToLines,(self,) + _args, _kwargs)
return val
def GetTextBoxSize(self, *_args, **_kwargs): def GetTextBoxSize(self, *_args, **_kwargs):
val = apply(gridc.wxGrid_GetTextBoxSize,(self,) + _args, _kwargs) val = apply(gridc.wxGrid_GetTextBoxSize,(self,) + _args, _kwargs)
return val return val

File diff suppressed because it is too large Load Diff

View File

@@ -313,6 +313,32 @@ class wxPyTimer(wxPyTimerPtr):
class wxStopWatchPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def Start(self, *_args, **_kwargs):
val = apply(misc2c.wxStopWatch_Start,(self,) + _args, _kwargs)
return val
def Pause(self, *_args, **_kwargs):
val = apply(misc2c.wxStopWatch_Pause,(self,) + _args, _kwargs)
return val
def Resume(self, *_args, **_kwargs):
val = apply(misc2c.wxStopWatch_Resume,(self,) + _args, _kwargs)
return val
def Time(self, *_args, **_kwargs):
val = apply(misc2c.wxStopWatch_Time,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxStopWatch instance at %s>" % (self.this,)
class wxStopWatch(wxStopWatchPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(misc2c.new_wxStopWatch,_args,_kwargs)
self.thisown = 1
class wxLogPtr : class wxLogPtr :
def __init__(self,this): def __init__(self,this):
self.this = this self.this = this
@@ -726,6 +752,170 @@ class wxWave(wxWavePtr):
class wxFileTypeInfoPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def IsValid(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_IsValid,(self,) + _args, _kwargs)
return val
def SetIcon(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_SetIcon,(self,) + _args, _kwargs)
return val
def SetShortDesc(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_SetShortDesc,(self,) + _args, _kwargs)
return val
def GetMimeType(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetMimeType,(self,) + _args, _kwargs)
return val
def GetOpenCommand(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetOpenCommand,(self,) + _args, _kwargs)
return val
def GetPrintCommand(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetPrintCommand,(self,) + _args, _kwargs)
return val
def GetShortDesc(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetShortDesc,(self,) + _args, _kwargs)
return val
def GetDescription(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetDescription,(self,) + _args, _kwargs)
return val
def GetExtensions(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetExtensions,(self,) + _args, _kwargs)
return val
def GetExtensionsCount(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetExtensionsCount,(self,) + _args, _kwargs)
return val
def GetIconFile(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetIconFile,(self,) + _args, _kwargs)
return val
def GetIconIndex(self, *_args, **_kwargs):
val = apply(misc2c.wxFileTypeInfo_GetIconIndex,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxFileTypeInfo instance at %s>" % (self.this,)
class wxFileTypeInfo(wxFileTypeInfoPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(misc2c.new_wxFileTypeInfo,_args,_kwargs)
self.thisown = 1
def wxFileTypeInfoSequence(*_args,**_kwargs):
val = wxFileTypeInfoPtr(apply(misc2c.new_wxFileTypeInfoSequence,_args,_kwargs))
val.thisown = 1
return val
def wxNullFileTypeInfo(*_args,**_kwargs):
val = wxFileTypeInfoPtr(apply(misc2c.new_wxNullFileTypeInfo,_args,_kwargs))
val.thisown = 1
return val
class wxFileTypePtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def GetMimeType(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetMimeType,(self,) + _args, _kwargs)
return val
def GetMimeTypes(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetMimeTypes,(self,) + _args, _kwargs)
return val
def GetExtensions(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetExtensions,(self,) + _args, _kwargs)
return val
def GetIcon(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetIcon,(self,) + _args, _kwargs)
if val: val = wxIconPtr(val) ; val.thisown = 1
return val
def GetIconInfo(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetIconInfo,(self,) + _args, _kwargs)
return val
def GetDescription(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetDescription,(self,) + _args, _kwargs)
return val
def GetOpenCommand(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetOpenCommand,(self,) + _args, _kwargs)
return val
def GetPrintCommand(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetPrintCommand,(self,) + _args, _kwargs)
return val
def GetAllCommands(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_GetAllCommands,(self,) + _args, _kwargs)
return val
def SetCommand(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_SetCommand,(self,) + _args, _kwargs)
return val
def SetDefaultIcon(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_SetDefaultIcon,(self,) + _args, _kwargs)
return val
def Unassociate(self, *_args, **_kwargs):
val = apply(misc2c.wxFileType_Unassociate,(self,) + _args, _kwargs)
return val
def __del__(self,misc2c=misc2c):
if self.thisown == 1 :
misc2c.delete_wxFileType(self)
def __repr__(self):
return "<C wxFileType instance at %s>" % (self.this,)
class wxFileType(wxFileTypePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(misc2c.new_wxFileType,_args,_kwargs)
self.thisown = 1
class wxMimeTypesManagerPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def Initialize(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_Initialize,(self,) + _args, _kwargs)
return val
def ClearData(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_ClearData,(self,) + _args, _kwargs)
return val
def GetFileTypeFromExtension(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_GetFileTypeFromExtension,(self,) + _args, _kwargs)
if val: val = wxFileTypePtr(val) ; val.thisown = 1
return val
def GetFileTypeFromMimeType(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_GetFileTypeFromMimeType,(self,) + _args, _kwargs)
if val: val = wxFileTypePtr(val) ; val.thisown = 1
return val
def ReadMailcap(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_ReadMailcap,(self,) + _args, _kwargs)
return val
def ReadMimeTypes(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_ReadMimeTypes,(self,) + _args, _kwargs)
return val
def EnumAllFileTypes(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_EnumAllFileTypes,(self,) + _args, _kwargs)
return val
def AddFallback(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_AddFallback,(self,) + _args, _kwargs)
return val
def Associate(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_Associate,(self,) + _args, _kwargs)
if val: val = wxFileTypePtr(val) ; val.thisown = 1
return val
def Unassociate(self, *_args, **_kwargs):
val = apply(misc2c.wxMimeTypesManager_Unassociate,(self,) + _args, _kwargs)
return val
def __del__(self,misc2c=misc2c):
if self.thisown == 1 :
misc2c.delete_wxMimeTypesManager(self)
def __repr__(self):
return "<C wxMimeTypesManager instance at %s>" % (self.this,)
class wxMimeTypesManager(wxMimeTypesManagerPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(misc2c.new_wxMimeTypesManager,_args,_kwargs)
self.thisown = 1
#-------------- FUNCTION WRAPPERS ------------------ #-------------- FUNCTION WRAPPERS ------------------
@@ -929,6 +1119,10 @@ wxLog_GetTraceMask = misc2c.wxLog_GetTraceMask
wxLog_IsAllowedTraceMask = misc2c.wxLog_IsAllowedTraceMask wxLog_IsAllowedTraceMask = misc2c.wxLog_IsAllowedTraceMask
wxFileType_ExpandCommand = misc2c.wxFileType_ExpandCommand
wxMimeTypesManager_IsOfType = misc2c.wxMimeTypesManager_IsOfType
#-------------- VARIABLE WRAPPERS ------------------ #-------------- VARIABLE WRAPPERS ------------------
@@ -1030,3 +1224,10 @@ wxLOG_Trace = misc2c.wxLOG_Trace
wxLOG_Progress = misc2c.wxLOG_Progress wxLOG_Progress = misc2c.wxLOG_Progress
wxLOG_User = misc2c.wxLOG_User wxLOG_User = misc2c.wxLOG_User
wxEVT_END_PROCESS = misc2c.wxEVT_END_PROCESS wxEVT_END_PROCESS = misc2c.wxEVT_END_PROCESS
wxMAILCAP_STANDARD = misc2c.wxMAILCAP_STANDARD
wxMAILCAP_NETSCAPE = misc2c.wxMAILCAP_NETSCAPE
wxMAILCAP_KDE = misc2c.wxMAILCAP_KDE
wxMAILCAP_GNOME = misc2c.wxMAILCAP_GNOME
wxMAILCAP_ALL = misc2c.wxMAILCAP_ALL
cvar = misc2c.cvar
wxTheMimeTypesManager = wxMimeTypesManagerPtr(misc2c.cvar.wxTheMimeTypesManager)

View File

@@ -58,7 +58,9 @@ extern PyObject *SWIG_newvarlink(void);
#include "helpers.h" #include "helpers.h"
#include <wx/sashwin.h> #include <wx/sashwin.h>
#include <wx/laywin.h> #include <wx/laywin.h>
#ifndef __WXMAC__
#include <wx/popupwin.h> #include <wx/popupwin.h>
#endif
static PyObject* t_output_helper(PyObject* target, PyObject* o) { static PyObject* t_output_helper(PyObject* target, PyObject* o) {

View File

@@ -1493,7 +1493,8 @@ def wxPyTypeCast(obj, typeStr):
theClass = globals()[typeStr+"Ptr"] theClass = globals()[typeStr+"Ptr"]
typeStr = __wxPyPtrTypeMap.get(typeStr, typeStr) typeStr = __wxPyPtrTypeMap.get(typeStr, typeStr)
if hasattr(obj, "this"): if hasattr(obj, "this"):
if obj.__class__ is theClass: # if already the right type then just return it # if already the right type then just return it
if isinstance(obj, theClass) or obj.__class__ is theClass:
return obj return obj
newPtr = ptrcast(obj.this, typeStr+"_p") newPtr = ptrcast(obj.this, typeStr+"_p")
else: else: