Unicode fixes for wxPython

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-12-18 06:15:40 +00:00
parent fb7eaf0d7b
commit fbd3b09c78
17 changed files with 233 additions and 186 deletions

View File

@@ -110,8 +110,8 @@ public:
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) { if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
PyObject* dcobj = wxPyMake_wxObject(&dc); PyObject* dcobj = wxPyMake_wxObject(&dc);
PyObject* idobj = wxPyConstructObject((void*)&id, "wxTreeItemId", FALSE); PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, "wxRect", FALSE); PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), FALSE);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj)); wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
Py_DECREF(dcobj); Py_DECREF(dcobj);
Py_DECREF(idobj); Py_DECREF(idobj);

View File

@@ -272,8 +272,8 @@ public:
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) { if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
PyObject* dcobj = wxPyMake_wxObject(&dc); PyObject* dcobj = wxPyMake_wxObject(&dc);
PyObject* idobj = wxPyConstructObject((void*)&id, "wxTreeItemId", FALSE); PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, "wxRect", FALSE); PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), FALSE);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj)); wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
Py_DECREF(dcobj); Py_DECREF(dcobj);
Py_DECREF(idobj); Py_DECREF(idobj);

View File

@@ -69,7 +69,7 @@ public:
~wxGLContext(); ~wxGLContext();
void SetCurrent(); void SetCurrent();
void SetColour(const char *colour); void SetColour(const wxString& colour);
void SwapBuffers(); void SwapBuffers();
#ifdef __WXGTK__ #ifdef __WXGTK__
@@ -151,7 +151,7 @@ public:
%pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)" %pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)"
void SetCurrent(); void SetCurrent();
void SetColour(const char *colour); void SetColour(const wxString& colour);
void SwapBuffers(); void SwapBuffers();
wxGLContext* GetContext(); wxGLContext* GetContext();

View File

@@ -210,12 +210,13 @@ static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, Py
static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
wxGLContext * _arg0; wxGLContext * _arg0;
char * _arg1; wxString * _arg1;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","colour", NULL }; char *_kwnames[] = { "self","colour", NULL };
self = self; self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLContext_SetColour",_kwnames,&_argo0,&_arg1)) if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1))
return NULL; return NULL;
if (_argo0) { if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; } if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -224,14 +225,23 @@ static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyO
return NULL; return NULL;
} }
} }
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{ {
PyThreadState* __tstate = wxPyBeginAllowThreads(); PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SetColour(_arg0,_arg1); wxGLContext_SetColour(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate); wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL; if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None); } Py_INCREF(Py_None);
_resultobj = Py_None; _resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
return _resultobj; return _resultobj;
} }
@@ -544,12 +554,13 @@ static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyO
static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
wxGLCanvas * _arg0; wxGLCanvas * _arg0;
char * _arg1; wxString * _arg1;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","colour", NULL }; char *_kwnames[] = { "self","colour", NULL };
self = self; self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLCanvas_SetColour",_kwnames,&_argo0,&_arg1)) if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_kwnames,&_argo0,&_obj1))
return NULL; return NULL;
if (_argo0) { if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; } if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -558,14 +569,23 @@ static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyOb
return NULL; return NULL;
} }
} }
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{ {
PyThreadState* __tstate = wxPyBeginAllowThreads(); PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SetColour(_arg0,_arg1); wxGLCanvas_SetColour(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate); wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL; if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None); } Py_INCREF(Py_None);
_resultobj = Py_None; _resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
return _resultobj; return _resultobj;
} }

View File

@@ -27,15 +27,17 @@
#if wxUSE_GLCANVAS #if wxUSE_GLCANVAS
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include <wx/frame.h> #include "wx/frame.h"
#include "wx/settings.h"
#include "wx/intl.h"
#include "wx/log.h"
#endif #endif
#include <wx/msw/private.h> #include "wx/msw/private.h"
#include <wx/settings.h>
#include <wx/log.h>
#include "myglcanvas.h" #include "myglcanvas.h"
const wxChar* wxGLCanvasName = wxT("GLcanvas");
static const wxChar *wxGLCanvasClassName = wxT("wxGLCanvasClass"); static const wxChar *wxGLCanvasClassName = wxT("wxGLCanvasClass");
static const wxChar *wxGLCanvasClassNameNoRedraw = wxT("wxGLCanvasClassNR"); static const wxChar *wxGLCanvasClassNameNoRedraw = wxT("wxGLCanvasClassNR");
@@ -108,7 +110,7 @@ void wxGLContext::SetCurrent()
*/ */
} }
void wxGLContext::SetColour(const char *colour) void wxGLContext::SetColour(const wxChar *colour)
{ {
float r = 0.0; float r = 0.0;
float g = 0.0; float g = 0.0;
@@ -403,7 +405,6 @@ static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC) void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
{ {
int pixelFormat;
PIXELFORMATDESCRIPTOR pfd = { PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), /* size */ sizeof(PIXELFORMATDESCRIPTOR), /* size */
1, /* version */ 1, /* version */
@@ -427,13 +428,13 @@ void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
AdjustPFDForAttributes(pfd, attribList); AdjustPFDForAttributes(pfd, attribList);
pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd); int pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
if (pixelFormat == 0) { if (pixelFormat == 0) {
wxLogWarning(_("ChoosePixelFormat failed.")); wxLogLastError(_T("ChoosePixelFormat"));
} }
else { else {
if (SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) != TRUE) { if ( !::SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) ) {
wxLogWarning(_("SetPixelFormat failed.")); wxLogLastError(_T("SetPixelFormat"));
} }
} }
} }
@@ -527,7 +528,7 @@ void wxGLCanvas::SetCurrent()
} }
} }
void wxGLCanvas::SetColour(const char *colour) void wxGLCanvas::SetColour(const wxChar *colour)
{ {
if (m_glContext) if (m_glContext)
m_glContext->SetColour(colour); m_glContext->SetColour(colour);
@@ -728,7 +729,7 @@ bool wxGLApp::InitGLVisual(int *attribList)
AdjustPFDForAttributes(pfd, attribList); AdjustPFDForAttributes(pfd, attribList);
// use DC for whole (root) screen, since no windows have yet been created // use DC for whole (root) screen, since no windows have yet been created
pixelFormat = ChoosePixelFormat((HDC) ::GetDC(NULL), &pfd); pixelFormat = ChoosePixelFormat(ScreenHDC(), &pfd);
if (pixelFormat == 0) { if (pixelFormat == 0) {
wxLogError(_("Failed to initialize OpenGL")); wxLogError(_("Failed to initialize OpenGL"));

View File

@@ -24,6 +24,7 @@
#include <wx/scrolwin.h> #include <wx/scrolwin.h>
#include <windows.h> #include <windows.h>
#include "wx/msw/winundef.h"
#include <GL/gl.h> #include <GL/gl.h>
@@ -69,7 +70,7 @@ public:
~wxGLContext(); ~wxGLContext();
void SetCurrent(); void SetCurrent();
void SetColour(const char *colour); void SetColour(const wxChar *colour);
void SwapBuffers(); void SwapBuffers();
@@ -83,21 +84,26 @@ public:
wxWindow* m_window; wxWindow* m_window;
}; };
extern const wxChar* wxGLCanvasName;
class wxGLCanvas: public wxWindow class wxGLCanvas: public wxWindow
{ {
DECLARE_CLASS(wxGLCanvas) DECLARE_CLASS(wxGLCanvas)
public: public:
wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette); const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette);
wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL, wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL,
wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "GLCanvas", const wxSize& size = wxDefaultSize, long style = 0, const wxString&
name = wxGLCanvasName,
int *attribList = (int*) NULL, const wxPalette& palette = wxNullPalette ); int *attribList = (int*) NULL, const wxPalette& palette = wxNullPalette );
wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxWindowID id = -1, wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette ); const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette );
~wxGLCanvas(); ~wxGLCanvas();
@@ -106,7 +112,7 @@ class wxGLCanvas: public wxWindow
const wxPoint& pos, const wxSize& size, long style, const wxString& name); const wxPoint& pos, const wxSize& size, long style, const wxString& name);
void SetCurrent(); void SetCurrent();
void SetColour(const char *colour); void SetColour(const wxChar *colour);
void SwapBuffers(); void SwapBuffers();
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);

View File

@@ -72,7 +72,7 @@ public:
m_iewin->GetParent()->AddPendingEvent(event); m_iewin->GetParent()->AddPendingEvent(event);
}; };
bool Process(WXTYPE etype, wxString text = "", long l1 = 0, long l2 = 0) bool Process(WXTYPE etype, wxString text = wxEmptyString, long l1 = 0, long l2 = 0)
{ {
if (! m_iewin || ! m_iewin->GetParent()) if (! m_iewin || ! m_iewin->GetParent())
return true; return true;
@@ -103,7 +103,7 @@ public:
return v.bstrVal; return v.bstrVal;
} }
else else
return ""; return wxEmptyString;
}; };
#define STR_ARG(arg) GetStrArg(pDispParams->rgvarg[arg]) #define STR_ARG(arg) GetStrArg(pDispParams->rgvarg[arg])
@@ -137,7 +137,7 @@ public:
break; break;
case DISPID_PROGRESSCHANGE: case DISPID_PROGRESSCHANGE:
Post(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, "", LONG_ARG(1), LONG_ARG(0)); Post(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, wxEmptyString, LONG_ARG(1), LONG_ARG(0));
break; break;
case DISPID_DOCUMENTCOMPLETE: case DISPID_DOCUMENTCOMPLETE:
@@ -524,7 +524,7 @@ wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
{ {
wxAutoOleInterface<IHTMLTxtRange> tr(GetSelRange(m_oleObject)); wxAutoOleInterface<IHTMLTxtRange> tr(GetSelRange(m_oleObject));
if (! tr) if (! tr)
return ""; return wxEmptyString;
BSTR text = NULL; BSTR text = NULL;
HRESULT hr = E_FAIL; HRESULT hr = E_FAIL;
@@ -534,7 +534,7 @@ wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
else else
hr = tr->get_text(&text); hr = tr->get_text(&text);
if (hr != S_OK) if (hr != S_OK)
return ""; return wxEmptyString;
wxString s = text; wxString s = text;
SysFreeString(text); SysFreeString(text);
@@ -545,26 +545,26 @@ wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
wxString wxIEHtmlWin::GetText(bool asHTML) wxString wxIEHtmlWin::GetText(bool asHTML)
{ {
if (! m_webBrowser.Ok()) if (! m_webBrowser.Ok())
return ""; return wxEmptyString;
// get document dispatch interface // get document dispatch interface
IDispatch *iDisp = NULL; IDispatch *iDisp = NULL;
HRESULT hr = m_webBrowser->get_Document(&iDisp); HRESULT hr = m_webBrowser->get_Document(&iDisp);
if (hr != S_OK) if (hr != S_OK)
return ""; return wxEmptyString;
// Query for Document Interface // Query for Document Interface
wxAutoOleInterface<IHTMLDocument2> hd(IID_IHTMLDocument2, iDisp); wxAutoOleInterface<IHTMLDocument2> hd(IID_IHTMLDocument2, iDisp);
iDisp->Release(); iDisp->Release();
if (! hd.Ok()) if (! hd.Ok())
return ""; return wxEmptyString;
// get body element // get body element
IHTMLElement *_body = NULL; IHTMLElement *_body = NULL;
hd->get_body(&_body); hd->get_body(&_body);
if (! _body) if (! _body)
return ""; return wxEmptyString;
wxAutoOleInterface<IHTMLElement> body(_body); wxAutoOleInterface<IHTMLElement> body(_body);
// get inner text // get inner text
@@ -576,7 +576,7 @@ wxString wxIEHtmlWin::GetText(bool asHTML)
else else
hr = body->get_innerText(&text); hr = body->get_innerText(&text);
if (hr != S_OK) if (hr != S_OK)
return ""; return wxEmptyString;
wxString s = text; wxString s = text;
SysFreeString(text); SysFreeString(text);

View File

@@ -697,12 +697,12 @@ wxVariant& wxActiveXEvent::operator[] (wxString name)
return m_params[i]; return m_params[i];
}; };
wxString err = "wxActiveXEvent::operator[] invalid name <" + name + ">"; wxString err = wxT("wxActiveXEvent::operator[] invalid name <") + name + wxT(">");
err += "\r\nValid Names = :\r\n"; err += wxT("\r\nValid Names = :\r\n");
for (i = 0; i < m_params.GetCount(); i++) for (i = 0; i < m_params.GetCount(); i++)
{ {
err += m_params[i].GetName(); err += m_params[i].GetName();
err += "\r\n"; err += wxT("\r\n");
}; };
wxASSERT_MSG(false, err); wxASSERT_MSG(false, err);
@@ -772,12 +772,12 @@ void wxActiveX::GetTypeInfo()
{ {
if (impTypeFlags & IMPLTYPEFLAG_FSOURCE) if (impTypeFlags & IMPLTYPEFLAG_FSOURCE)
{ {
WXOLE_TRACEOUT("Default Event Sink"); WXOLE_TRACEOUT(wxT("Default Event Sink"));
defEventSink = true; defEventSink = true;
} }
else else
{ {
WXOLE_TRACEOUT("Default Interface"); WXOLE_TRACEOUT(wxT("Default Interface"));
} }
}; };
@@ -804,7 +804,7 @@ void wxActiveX::GetTypeInfo(ITypeInfo *ti, bool defEventSink)
if (ta->typekind == TKIND_DISPATCH) if (ta->typekind == TKIND_DISPATCH)
{ {
WXOLE_TRACEOUT("GUID = " << GetIIDName(ta->guid).c_str()); WXOLE_TRACEOUT(wxT("GUID = ") << GetIIDName(ta->guid).c_str());
if (defEventSink) if (defEventSink)
{ {
@@ -831,7 +831,7 @@ void wxActiveX::GetTypeInfo(ITypeInfo *ti, bool defEventSink)
{ {
wxString name = anames[0]; wxString name = anames[0];
WXOLE_TRACEOUT("Name " << i << " = " << name.c_str()); WXOLE_TRACEOUT(wxT("Name ") << i << wxT(" = ") << name.c_str());
SysFreeString(anames[0]); SysFreeString(anames[0]);
if (defEventSink) if (defEventSink)
@@ -1775,49 +1775,49 @@ wxString OLEHResultToString(HRESULT hr)
switch (hr) switch (hr)
{ {
case S_OK: case S_OK:
return ""; return wxEmptyString;
case OLECMDERR_E_UNKNOWNGROUP: case OLECMDERR_E_UNKNOWNGROUP:
return "The pguidCmdGroup parameter is not NULL but does not specify a recognized command group."; return wxT("The pguidCmdGroup parameter is not NULL but does not specify a recognized command group.");
case OLECMDERR_E_NOTSUPPORTED: case OLECMDERR_E_NOTSUPPORTED:
return "The nCmdID parameter is not a valid command in the group identified by pguidCmdGroup."; return wxT("The nCmdID parameter is not a valid command in the group identified by pguidCmdGroup.");
case OLECMDERR_E_DISABLED: case OLECMDERR_E_DISABLED:
return "The command identified by nCmdID is currently disabled and cannot be executed."; return wxT("The command identified by nCmdID is currently disabled and cannot be executed.");
case OLECMDERR_E_NOHELP: case OLECMDERR_E_NOHELP:
return "The caller has asked for help on the command identified by nCmdID, but no help is available."; return wxT("The caller has asked for help on the command identified by nCmdID, but no help is available.");
case OLECMDERR_E_CANCELED: case OLECMDERR_E_CANCELED:
return "The user canceled the execution of the command."; return wxT("The user canceled the execution of the command.");
case E_INVALIDARG: case E_INVALIDARG:
return "E_INVALIDARG"; return wxT("E_INVALIDARG");
case E_OUTOFMEMORY: case E_OUTOFMEMORY:
return "E_OUTOFMEMORY"; return wxT("E_OUTOFMEMORY");
case E_NOINTERFACE: case E_NOINTERFACE:
return "E_NOINTERFACE"; return wxT("E_NOINTERFACE");
case E_UNEXPECTED: case E_UNEXPECTED:
return "E_UNEXPECTED"; return wxT("E_UNEXPECTED");
case STG_E_INVALIDFLAG: case STG_E_INVALIDFLAG:
return "STG_E_INVALIDFLAG"; return wxT("STG_E_INVALIDFLAG");
case E_FAIL: case E_FAIL:
return "E_FAIL"; return wxT("E_FAIL");
case E_NOTIMPL: case E_NOTIMPL:
return "E_NOTIMPL"; return wxT("E_NOTIMPL");
default: default:
{ {
char buf[64]; wxString buf;
sprintf(buf, "Unknown - 0x%X", hr); buf.Printf(wxT("Unknown - 0x%X"), hr);
return wxString(buf); return buf;
} }
}; };
}; };
@@ -1948,5 +1948,5 @@ wxString GetIIDName(REFIID riid)
return s; return s;
} }
else else
return "StringFromIID() error"; return wxT("StringFromIID() error");
} }

View File

@@ -391,16 +391,17 @@ static PyObject *_wrap_wxPseudoMetaFile_LoadFromMetaFile(PyObject *self, PyObjec
PyObject * _resultobj; PyObject * _resultobj;
bool _result; bool _result;
wxPseudoMetaFile * _arg0; wxPseudoMetaFile * _arg0;
char * _arg1; wxString * _arg1;
double * _arg2; double * _arg2;
double * _arg3; double * _arg3;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo2 = 0; PyObject * _argo2 = 0;
PyObject * _argo3 = 0; PyObject * _argo3 = 0;
char *_kwnames[] = { "self","filename","width","height", NULL }; char *_kwnames[] = { "self","filename","width","height", NULL };
self = self; self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OsOO:wxPseudoMetaFile_LoadFromMetaFile",_kwnames,&_argo0,&_arg1,&_argo2,&_argo3)) if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOO:wxPseudoMetaFile_LoadFromMetaFile",_kwnames,&_argo0,&_obj1,&_argo2,&_argo3))
return NULL; return NULL;
if (_argo0) { if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; } if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -409,6 +410,11 @@ static PyObject *_wrap_wxPseudoMetaFile_LoadFromMetaFile(PyObject *self, PyObjec
return NULL; return NULL;
} }
} }
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
if (_argo2) { if (_argo2) {
if (_argo2 == Py_None) { _arg2 = NULL; } if (_argo2 == Py_None) { _arg2 = NULL; }
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_double_p")) { else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_double_p")) {
@@ -425,11 +431,15 @@ static PyObject *_wrap_wxPseudoMetaFile_LoadFromMetaFile(PyObject *self, PyObjec
} }
{ {
PyThreadState* __tstate = wxPyBeginAllowThreads(); PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxPseudoMetaFile_LoadFromMetaFile(_arg0,_arg1,_arg2,_arg3); _result = (bool )wxPseudoMetaFile_LoadFromMetaFile(_arg0,*_arg1,_arg2,_arg3);
wxPyEndAllowThreads(__tstate); wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL; if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result); } _resultobj = Py_BuildValue("i",_result);
{
if (_obj1)
delete _arg1;
}
return _resultobj; return _resultobj;
} }
@@ -5938,12 +5948,13 @@ static PyObject *_wrap_wxPyDrawnShape_LoadFromMetaFile(PyObject *self, PyObject
PyObject * _resultobj; PyObject * _resultobj;
bool _result; bool _result;
wxPyDrawnShape * _arg0; wxPyDrawnShape * _arg0;
char * _arg1; wxString * _arg1;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","filename", NULL }; char *_kwnames[] = { "self","filename", NULL };
self = self; self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxPyDrawnShape_LoadFromMetaFile",_kwnames,&_argo0,&_arg1)) if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyDrawnShape_LoadFromMetaFile",_kwnames,&_argo0,&_obj1))
return NULL; return NULL;
if (_argo0) { if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; } if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -5952,13 +5963,22 @@ static PyObject *_wrap_wxPyDrawnShape_LoadFromMetaFile(PyObject *self, PyObject
return NULL; return NULL;
} }
} }
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{ {
PyThreadState* __tstate = wxPyBeginAllowThreads(); PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxPyDrawnShape_LoadFromMetaFile(_arg0,_arg1); _result = (bool )wxPyDrawnShape_LoadFromMetaFile(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate); wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL; if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result); } _resultobj = Py_BuildValue("i",_result);
{
if (_obj1)
delete _arg1;
}
return _resultobj; return _resultobj;
} }

View File

@@ -56,7 +56,7 @@ public:
void ScaleTo(double w, double h); void ScaleTo(double w, double h);
void Translate(double x, double y); void Translate(double x, double y);
void Rotate(double x, double y, double theta); void Rotate(double x, double y, double theta);
bool LoadFromMetaFile(char* filename, double *width, double *height); bool LoadFromMetaFile(const wxString& filename, double *width, double *height);
void GetBounds(double *minX, double *minY, double *maxX, double *maxY); void GetBounds(double *minX, double *minY, double *maxX, double *maxY);
void CalculateSize(wxPyDrawnShape* shape); void CalculateSize(wxPyDrawnShape* shape);
@@ -281,7 +281,7 @@ public:
wxPseudoMetaFile& GetMetaFile(); wxPseudoMetaFile& GetMetaFile();
double GetRotation(); double GetRotation();
bool LoadFromMetaFile(char * filename); bool LoadFromMetaFile(const wxString& filename);
void Rotate(double x, double y, double theta); void Rotate(double x, double y, double theta);
void SetClippingRect(const wxRect& rect); void SetClippingRect(const wxRect& rect);
void SetDrawnBackgroundColour(const wxColour& colour); void SetDrawnBackgroundColour(const wxColour& colour);

View File

@@ -291,7 +291,7 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() {
void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) { void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
if (m_myInst.findCallback("SetBitmap")) { if (m_myInst.findCallback("SetBitmap")) {
PyObject* bo = wxPyConstructObject((void*)&bitmap, "wxBitmap"); PyObject* bo = wxPyConstructObject((void*)&bitmap, wxT("wxBitmap"));
m_myInst.callCallback(Py_BuildValue("(O)", bo)); m_myInst.callCallback(Py_BuildValue("(O)", bo));
Py_DECREF(bo); Py_DECREF(bo);
} }

View File

@@ -1102,8 +1102,8 @@ public:
bool found; bool found;
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
if ((found = m_myInst.findCallback("OnCompareItems"))) { if ((found = m_myInst.findCallback("OnCompareItems"))) {
PyObject *o1 = wxPyConstructObject((void*)&item1, "wxTreeItemId"); PyObject *o1 = wxPyConstructObject((void*)&item1, wxT("wxTreeItemId"));
PyObject *o2 = wxPyConstructObject((void*)&item2, "wxTreeItemId"); PyObject *o2 = wxPyConstructObject((void*)&item2, wxT("wxTreeItemId"));
rval = m_myInst.callCallback(Py_BuildValue("(OO)",o1,o2)); rval = m_myInst.callCallback(Py_BuildValue("(OO)",o1,o2));
Py_DECREF(o1); Py_DECREF(o1);
Py_DECREF(o2); Py_DECREF(o2);
@@ -1244,7 +1244,7 @@ public:
num = self->GetSelections(array); num = self->GetSelections(array);
for (x=0; x < num; x++) { for (x=0; x < num; x++) {
wxTreeItemId *tii = new wxTreeItemId(array.Item(x)); wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
PyObject* item = wxPyConstructObject((void*)tii, "wxTreeItemId", TRUE); PyObject* item = wxPyConstructObject((void*)tii, wxT("wxTreeItemId"), TRUE);
PyList_Append(rval, item); PyList_Append(rval, item);
} }
wxPyEndBlockThreads(); wxPyEndBlockThreads();
@@ -1335,7 +1335,7 @@ public:
if (self->GetBoundingRect(item, rect, textOnly)) { if (self->GetBoundingRect(item, rect, textOnly)) {
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
wxRect* r = new wxRect(rect); wxRect* r = new wxRect(rect);
PyObject* val = wxPyConstructObject((void*)r, "wxRect"); PyObject* val = wxPyConstructObject((void*)r, wxT("wxRect"));
wxPyEndBlockThreads(); wxPyEndBlockThreads();
return val; return val;
} }

View File

@@ -70,7 +70,7 @@ PyObject* wxPyMake_##TYPE(TYPE* source) { \
/* Otherwise make a new wrapper for it the old fashioned way and \ /* Otherwise make a new wrapper for it the old fashioned way and \
give it the OOR treatment */ \ give it the OOR treatment */ \
if (! target) { \ if (! target) { \
target = wxPyConstructObject(source, #TYPE, FALSE); \ target = wxPyConstructObject(source, wxT(#TYPE), FALSE); \
if (target) \ if (target) \
source->SetClientObject(new wxPyOORClientData(target)); \ source->SetClientObject(new wxPyOORClientData(target)); \
} \ } \
@@ -571,7 +571,7 @@ public:
PyObject* go = wxPyMake_wxObject(&grid); PyObject* go = wxPyMake_wxObject(&grid);
PyObject* dco = wxPyMake_wxObject(&dc); PyObject* dco = wxPyMake_wxObject(&dc);
PyObject* ao = wxPyMake_wxGridCellAttr(&attr); PyObject* ao = wxPyMake_wxGridCellAttr(&attr);
PyObject* ro = wxPyConstructObject((void*)&rect, "wxRect", 0); PyObject* ro = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOOiii)", go, ao, dco, ro, wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOOiii)", go, ao, dco, ro,
row, col, isSelected)); row, col, isSelected));
@@ -856,7 +856,7 @@ public:
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "PaintBackground)"))) { if ((found = wxPyCBH_findCallback(m_myInst, "PaintBackground)"))) {
PyObject* ao = wxPyMake_wxGridCellAttr(attr); PyObject* ao = wxPyMake_wxGridCellAttr(attr);
PyObject* ro = wxPyConstructObject((void*)&rectCell, "wxRect", 0); PyObject* ro = wxPyConstructObject((void*)&rectCell, wxT("wxRect"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", ro, ao)); wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", ro, ao));

View File

@@ -527,7 +527,7 @@ public:
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxHW_SCROLLBAR_AUTO, long style = wxHW_SCROLLBAR_AUTO,
const wxString& name = "htmlWindow") const wxString& name = wxPyHtmlWindowNameStr)
: wxHtmlWindow(parent, id, pos, size, style, name) {}; : wxHtmlWindow(parent, id, pos, size, style, name) {};
wxPyHtmlWindow() : wxHtmlWindow() {}; wxPyHtmlWindow() : wxHtmlWindow() {};
@@ -563,7 +563,7 @@ void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) {
bool found; bool found;
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "OnLinkClicked"))) { if ((found = wxPyCBH_findCallback(m_myInst, "OnLinkClicked"))) {
PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo", 0); PyObject* obj = wxPyConstructObject((void*)&link, wxT("wxHtmlLinkInfo"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));
Py_DECREF(obj); Py_DECREF(obj);
} }

View File

@@ -318,7 +318,7 @@ public:
if (dest != wxRect(0,0,0,0)) { if (dest != wxRect(0,0,0,0)) {
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
wxRect* newRect = new wxRect(dest); wxRect* newRect = new wxRect(dest);
obj = wxPyConstructObject((void*)newRect, "wxRect"); obj = wxPyConstructObject((void*)newRect, wxT("wxRect"));
PyObject* one = PyInt_FromLong(1); PyObject* one = PyInt_FromLong(1);
PyObject_SetAttrString(obj, "thisown", one); PyObject_SetAttrString(obj, "thisown", one);
Py_DECREF(one); Py_DECREF(one);

View File

@@ -1257,7 +1257,7 @@ public:
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
PyObject* tuple = PyTuple_New(3); PyObject* tuple = PyTuple_New(3);
PyTuple_SetItem(tuple, 0, wxPyConstructObject(new wxIcon(icon), PyTuple_SetItem(tuple, 0, wxPyConstructObject(new wxIcon(icon),
"wxIcon", TRUE)); wxT("wxIcon"), TRUE));
#if wxUSE_UNICODE #if wxUSE_UNICODE
PyTuple_SetItem(tuple, 1, PyUnicode_FromUnicode(iconFile.c_str(), iconFile.Len())); PyTuple_SetItem(tuple, 1, PyUnicode_FromUnicode(iconFile.c_str(), iconFile.Len()));
#else #else
@@ -1527,7 +1527,7 @@ public:
wxBitmap rval = wxNullBitmap; wxBitmap rval = wxNullBitmap;
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
if ((wxPyCBH_findCallback(m_myInst, "CreateBitmap"))) { if ((wxPyCBH_findCallback(m_myInst, "CreateBitmap"))) {
PyObject* so = wxPyConstructObject((void*)&size, "wxSize", 0); PyObject* so = wxPyConstructObject((void*)&size, wxT("wxSize"), 0);
PyObject* ro; PyObject* ro;
wxBitmap* ptr; wxBitmap* ptr;
PyObject* s1, *s2; PyObject* s1, *s2;

View File

@@ -61,7 +61,7 @@
if ($source) { if ($source) {
_ptr = new wxPyInputStream($source); _ptr = new wxPyInputStream($source);
} }
$target = wxPyConstructObject(_ptr, "wxInputStream", TRUE); $target = wxPyConstructObject(_ptr, wxT("wxInputStream"), TRUE);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------