Minimal changes needed to build/run wxPython on the 2.5 branch after
the merge. Still need to look for and apply most changes and new additions that have happened since the last merge. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -748,7 +748,7 @@ if BUILD_OGL:
|
|||||||
'%s/composit.cpp' % OGLLOC,
|
'%s/composit.cpp' % OGLLOC,
|
||||||
'%s/divided.cpp' % OGLLOC,
|
'%s/divided.cpp' % OGLLOC,
|
||||||
'%s/lines.cpp' % OGLLOC,
|
'%s/lines.cpp' % OGLLOC,
|
||||||
'%s/misc.cpp' % OGLLOC,
|
'%s/oglmisc.cpp' % OGLLOC,
|
||||||
'%s/basic2.cpp' % OGLLOC,
|
'%s/basic2.cpp' % OGLLOC,
|
||||||
'%s/canvas.cpp' % OGLLOC,
|
'%s/canvas.cpp' % OGLLOC,
|
||||||
'%s/constrnt.cpp' % OGLLOC,
|
'%s/constrnt.cpp' % OGLLOC,
|
||||||
@@ -758,7 +758,7 @@ if BUILD_OGL:
|
|||||||
] + swig_sources,
|
] + swig_sources,
|
||||||
|
|
||||||
include_dirs = [OGLINC] + includes,
|
include_dirs = [OGLINC] + includes,
|
||||||
define_macros = defines,
|
define_macros = defines + [('wxUSE_DEPRECATED', '0')],
|
||||||
|
|
||||||
library_dirs = libdirs,
|
library_dirs = libdirs,
|
||||||
libraries = libs,
|
libraries = libs,
|
||||||
|
@@ -970,6 +970,15 @@ of your Mac."""
|
|||||||
if redirect:
|
if redirect:
|
||||||
self.RedirectStdio(filename)
|
self.RedirectStdio(filename)
|
||||||
|
|
||||||
|
# Set the default handler for SIGINT. This fixes a problem
|
||||||
|
# where if Ctrl-C is pressed in the console that started this
|
||||||
|
# app then it will not appear to do anything, (not even send
|
||||||
|
# KeyboardInterrupt???) but will later segfault on exit. By
|
||||||
|
# setting the default handler then the app will exit, as
|
||||||
|
# expected (depending on platform.)
|
||||||
|
import signal
|
||||||
|
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||||
|
|
||||||
# this initializes wxWindows and then calls our OnInit
|
# this initializes wxWindows and then calls our OnInit
|
||||||
_wxStart(self.OnInit)
|
_wxStart(self.OnInit)
|
||||||
|
|
||||||
|
@@ -418,12 +418,10 @@ public:
|
|||||||
void UsePrimarySelection( int primary = FALSE );
|
void UsePrimarySelection( int primary = FALSE );
|
||||||
};
|
};
|
||||||
|
|
||||||
%{
|
|
||||||
// See below in the init function...
|
|
||||||
wxClipboard* wxPyTheClipboard;
|
|
||||||
%}
|
|
||||||
%readonly
|
%readonly
|
||||||
%name(wxTheClipboard) wxClipboard* wxPyTheClipboard;
|
// See also wxPy_ReinitStockObjects in helpers.cpp
|
||||||
|
extern wxClipboard* wxTheClipboard;
|
||||||
%readwrite
|
%readwrite
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@@ -674,7 +672,6 @@ public:
|
|||||||
|
|
||||||
%init %{
|
%init %{
|
||||||
|
|
||||||
wxPyTheClipboard = wxTheClipboard;
|
|
||||||
wxPyPtrTypeMap_Add("wxDropSource", "wxPyDropSource");
|
wxPyPtrTypeMap_Add("wxDropSource", "wxPyDropSource");
|
||||||
wxPyPtrTypeMap_Add("wxTextDropTarget", "wxPyTextDropTarget");
|
wxPyPtrTypeMap_Add("wxTextDropTarget", "wxPyTextDropTarget");
|
||||||
wxPyPtrTypeMap_Add("wxFileDropTarget", "wxPyFileDropTarget");
|
wxPyPtrTypeMap_Add("wxFileDropTarget", "wxPyFileDropTarget");
|
||||||
|
@@ -49,6 +49,7 @@
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
%readonly
|
%readonly
|
||||||
|
// See also wxPy_ReinitStockObjects in helpers.cpp
|
||||||
wxValidator wxDefaultValidator;
|
wxValidator wxDefaultValidator;
|
||||||
%readwrite
|
%readwrite
|
||||||
|
|
||||||
|
@@ -141,13 +141,23 @@ public:
|
|||||||
static void AddHandler(wxFileSystemHandler *handler);
|
static void AddHandler(wxFileSystemHandler *handler);
|
||||||
static void CleanUpHandlers();
|
static void CleanUpHandlers();
|
||||||
|
|
||||||
// // Returns the native path for a file URL
|
// Returns the file URL for a native path
|
||||||
// static wxFileName URLToFileName(const wxString& url);
|
static wxString FileNameToURL(const wxString& filename);
|
||||||
|
|
||||||
// // Returns the file URL for a native path
|
// Returns the native path for a file URL
|
||||||
// static wxString FileNameToURL(const wxFileName& filename);
|
//static wxFileName URLToFileName(const wxString& url); *** See below
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Returns the native path for a file URL
|
||||||
|
wxString wxFileSystem_URLToFileName(const wxString& url);
|
||||||
|
%{
|
||||||
|
wxString wxFileSystem_URLToFileName(const wxString& url) {
|
||||||
|
wxFileName fname = wxFileSystem::URLToFileName(url);
|
||||||
|
return fname.GetFullPath();
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxInternetFSHandler : public wxFileSystemHandler {
|
class wxInternetFSHandler : public wxFileSystemHandler {
|
||||||
|
@@ -432,31 +432,20 @@ public:
|
|||||||
class wxColourDatabase : public wxObject {
|
class wxColourDatabase : public wxObject {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
wxColour *FindColour(const wxString& colour);
|
wxColour *FindColour(const wxString& colour) ;
|
||||||
|
wxColour *FindColourNoAdd(const wxString& colour) const;
|
||||||
wxString FindName(const wxColour& colour) const;
|
wxString FindName(const wxColour& colour) const;
|
||||||
|
|
||||||
%addmethods {
|
%addmethods {
|
||||||
|
void AddColour(const wxString& name, wxColour* colour) {
|
||||||
|
// make a copy since the python one will be GC'd
|
||||||
|
wxColour* c = new wxColour(*colour);
|
||||||
|
self->AddColour(name, c);
|
||||||
|
}
|
||||||
|
|
||||||
void Append(const wxString& name, int red, int green, int blue) {
|
void Append(const wxString& name, int red, int green, int blue) {
|
||||||
// first see if the name is already there
|
wxColour* c = new wxColour(red, green, blue);
|
||||||
wxString cName = name;
|
self->AddColour(name, c);
|
||||||
cName.MakeUpper();
|
|
||||||
wxString cName2 = cName;
|
|
||||||
if ( !cName2.Replace(wxT("GRAY"), wxT("GREY")) )
|
|
||||||
cName2.clear();
|
|
||||||
|
|
||||||
wxNode *node = self->GetFirst();
|
|
||||||
while ( node ) {
|
|
||||||
const wxChar *key = node->GetKeyString();
|
|
||||||
if ( cName == key || cName2 == key ) {
|
|
||||||
wxColour* c = (wxColour *)node->GetData();
|
|
||||||
c->Set(red, green, blue);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
node = node->GetNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
// otherwise append the new colour
|
|
||||||
self->Append(name.c_str(), new wxColour(red, green, blue));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1164,6 +1153,8 @@ public:
|
|||||||
#if 0
|
#if 0
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
// See also wxPy_ReinitStockObjects in helpers.cpp
|
||||||
|
|
||||||
extern wxFont *wxNORMAL_FONT;
|
extern wxFont *wxNORMAL_FONT;
|
||||||
extern wxFont *wxSMALL_FONT;
|
extern wxFont *wxSMALL_FONT;
|
||||||
extern wxFont *wxITALIC_FONT;
|
extern wxFont *wxITALIC_FONT;
|
||||||
|
@@ -196,9 +196,7 @@ void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
|
|||||||
}
|
}
|
||||||
wxPyEndBlockThreads();
|
wxPyEndBlockThreads();
|
||||||
}
|
}
|
||||||
|
extern wxClipboard * wxTheClipboard;
|
||||||
// See below in the init function...
|
|
||||||
wxClipboard* wxPyTheClipboard;
|
|
||||||
|
|
||||||
class wxPyDropSource : public wxDropSource {
|
class wxPyDropSource : public wxDropSource {
|
||||||
public:
|
public:
|
||||||
@@ -364,17 +362,17 @@ static PyObject *_wrap_wxPyFormatInvalid_get() {
|
|||||||
return pyobj;
|
return pyobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _wrap_wxPyTheClipboard_set(PyObject *val) {
|
static int _wrap_wxTheClipboard_set(PyObject *val) {
|
||||||
|
|
||||||
PyErr_SetString(PyExc_TypeError,"Variable wxTheClipboard is read-only.");
|
PyErr_SetString(PyExc_TypeError,"Variable wxTheClipboard is read-only.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *_wrap_wxPyTheClipboard_get() {
|
static PyObject *_wrap_wxTheClipboard_get() {
|
||||||
PyObject * pyobj;
|
PyObject * pyobj;
|
||||||
char ptemp[128];
|
char ptemp[128];
|
||||||
|
|
||||||
SWIG_MakePtr(ptemp, (char *) wxPyTheClipboard,"_wxClipboard_p");
|
SWIG_MakePtr(ptemp, (char *) wxTheClipboard,"_wxClipboard_p");
|
||||||
pyobj = PyString_FromString(ptemp);
|
pyobj = PyString_FromString(ptemp);
|
||||||
return pyobj;
|
return pyobj;
|
||||||
}
|
}
|
||||||
@@ -3679,7 +3677,7 @@ SWIGEXPORT(void) initclip_dndc() {
|
|||||||
PyDict_SetItemString(d,"wxDF_MAX", PyInt_FromLong((long) wxDF_MAX));
|
PyDict_SetItemString(d,"wxDF_MAX", PyInt_FromLong((long) wxDF_MAX));
|
||||||
PyDict_SetItemString(d,"cvar", SWIG_globals);
|
PyDict_SetItemString(d,"cvar", SWIG_globals);
|
||||||
SWIG_addvarlink(SWIG_globals,"wxFormatInvalid",_wrap_wxPyFormatInvalid_get, _wrap_wxPyFormatInvalid_set);
|
SWIG_addvarlink(SWIG_globals,"wxFormatInvalid",_wrap_wxPyFormatInvalid_get, _wrap_wxPyFormatInvalid_set);
|
||||||
SWIG_addvarlink(SWIG_globals,"wxTheClipboard",_wrap_wxPyTheClipboard_get, _wrap_wxPyTheClipboard_set);
|
SWIG_addvarlink(SWIG_globals,"wxTheClipboard",_wrap_wxTheClipboard_get, _wrap_wxTheClipboard_set);
|
||||||
PyDict_SetItemString(d,"wxDrag_CopyOnly", PyInt_FromLong((long) wxDrag_CopyOnly));
|
PyDict_SetItemString(d,"wxDrag_CopyOnly", PyInt_FromLong((long) wxDrag_CopyOnly));
|
||||||
PyDict_SetItemString(d,"wxDrag_AllowMove", PyInt_FromLong((long) wxDrag_AllowMove));
|
PyDict_SetItemString(d,"wxDrag_AllowMove", PyInt_FromLong((long) wxDrag_AllowMove));
|
||||||
PyDict_SetItemString(d,"wxDrag_DefaultMove", PyInt_FromLong((long) wxDrag_DefaultMove));
|
PyDict_SetItemString(d,"wxDrag_DefaultMove", PyInt_FromLong((long) wxDrag_DefaultMove));
|
||||||
@@ -3691,7 +3689,6 @@ SWIGEXPORT(void) initclip_dndc() {
|
|||||||
PyDict_SetItemString(d,"wxDragCancel", PyInt_FromLong((long) wxDragCancel));
|
PyDict_SetItemString(d,"wxDragCancel", PyInt_FromLong((long) wxDragCancel));
|
||||||
|
|
||||||
|
|
||||||
wxPyTheClipboard = wxTheClipboard;
|
|
||||||
wxPyPtrTypeMap_Add("wxDropSource", "wxPyDropSource");
|
wxPyPtrTypeMap_Add("wxDropSource", "wxPyDropSource");
|
||||||
wxPyPtrTypeMap_Add("wxTextDropTarget", "wxPyTextDropTarget");
|
wxPyPtrTypeMap_Add("wxTextDropTarget", "wxPyTextDropTarget");
|
||||||
wxPyPtrTypeMap_Add("wxFileDropTarget", "wxPyFileDropTarget");
|
wxPyPtrTypeMap_Add("wxFileDropTarget", "wxPyFileDropTarget");
|
||||||
|
@@ -128,6 +128,11 @@ IMP_PYCALLBACK_FSF_FSSTRING_pure(wxPyFileSystemHandler, wxFileSystemHandler, Ope
|
|||||||
IMP_PYCALLBACK_STRING_STRINGINT_pure(wxPyFileSystemHandler, wxFileSystemHandler, FindFirst);
|
IMP_PYCALLBACK_STRING_STRINGINT_pure(wxPyFileSystemHandler, wxFileSystemHandler, FindFirst);
|
||||||
IMP_PYCALLBACK_STRING__pure(wxPyFileSystemHandler, wxFileSystemHandler, FindNext);
|
IMP_PYCALLBACK_STRING__pure(wxPyFileSystemHandler, wxFileSystemHandler, FindNext);
|
||||||
|
|
||||||
|
wxString wxFileSystem_URLToFileName(const wxString& url) {
|
||||||
|
wxFileName fname = wxFileSystem::URLToFileName(url);
|
||||||
|
return fname.GetFullPath();
|
||||||
|
}
|
||||||
|
|
||||||
void __wxMemoryFSHandler_AddFile_wxImage(const wxString& filename,
|
void __wxMemoryFSHandler_AddFile_wxImage(const wxString& filename,
|
||||||
wxImage& image,
|
wxImage& image,
|
||||||
long type) {
|
long type) {
|
||||||
@@ -151,6 +156,44 @@ void __wxMemoryFSHandler_AddFile_Data(const wxString& filename,
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
static PyObject *_wrap_wxFileSystem_URLToFileName(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
|
PyObject * _resultobj;
|
||||||
|
wxString * _result;
|
||||||
|
wxString * _arg0;
|
||||||
|
PyObject * _obj0 = 0;
|
||||||
|
char *_kwnames[] = { "url", NULL };
|
||||||
|
|
||||||
|
self = self;
|
||||||
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFileSystem_URLToFileName",_kwnames,&_obj0))
|
||||||
|
return NULL;
|
||||||
|
{
|
||||||
|
_arg0 = wxString_in_helper(_obj0);
|
||||||
|
if (_arg0 == NULL)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||||
|
_result = new wxString (wxFileSystem_URLToFileName(*_arg0));
|
||||||
|
|
||||||
|
wxPyEndAllowThreads(__tstate);
|
||||||
|
if (PyErr_Occurred()) return NULL;
|
||||||
|
}{
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
|
||||||
|
#else
|
||||||
|
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if (_obj0)
|
||||||
|
delete _arg0;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
delete _result;
|
||||||
|
}
|
||||||
|
return _resultobj;
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *_wrap___wxMemoryFSHandler_AddFile_wxImage(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap___wxMemoryFSHandler_AddFile_wxImage(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
wxString * _arg0;
|
wxString * _arg0;
|
||||||
@@ -1311,6 +1354,44 @@ static PyObject *_wrap_wxFileSystem_CleanUpHandlers(PyObject *self, PyObject *ar
|
|||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *_wrap_wxFileSystem_FileNameToURL(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
|
PyObject * _resultobj;
|
||||||
|
wxString * _result;
|
||||||
|
wxString * _arg0;
|
||||||
|
PyObject * _obj0 = 0;
|
||||||
|
char *_kwnames[] = { "filename", NULL };
|
||||||
|
|
||||||
|
self = self;
|
||||||
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFileSystem_FileNameToURL",_kwnames,&_obj0))
|
||||||
|
return NULL;
|
||||||
|
{
|
||||||
|
_arg0 = wxString_in_helper(_obj0);
|
||||||
|
if (_arg0 == NULL)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||||
|
_result = new wxString (wxFileSystem::FileNameToURL(*_arg0));
|
||||||
|
|
||||||
|
wxPyEndAllowThreads(__tstate);
|
||||||
|
if (PyErr_Occurred()) return NULL;
|
||||||
|
}{
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
|
||||||
|
#else
|
||||||
|
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if (_obj0)
|
||||||
|
delete _arg0;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
delete _result;
|
||||||
|
}
|
||||||
|
return _resultobj;
|
||||||
|
}
|
||||||
|
|
||||||
static void *SwigwxInternetFSHandlerTowxFileSystemHandler(void *ptr) {
|
static void *SwigwxInternetFSHandlerTowxFileSystemHandler(void *ptr) {
|
||||||
wxInternetFSHandler *src;
|
wxInternetFSHandler *src;
|
||||||
wxFileSystemHandler *dest;
|
wxFileSystemHandler *dest;
|
||||||
@@ -1911,6 +1992,7 @@ static PyMethodDef filesyscMethods[] = {
|
|||||||
{ "wxInternetFSHandler_OpenFile", (PyCFunction) _wrap_wxInternetFSHandler_OpenFile, METH_VARARGS | METH_KEYWORDS },
|
{ "wxInternetFSHandler_OpenFile", (PyCFunction) _wrap_wxInternetFSHandler_OpenFile, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxInternetFSHandler_CanOpen", (PyCFunction) _wrap_wxInternetFSHandler_CanOpen, METH_VARARGS | METH_KEYWORDS },
|
{ "wxInternetFSHandler_CanOpen", (PyCFunction) _wrap_wxInternetFSHandler_CanOpen, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "new_wxInternetFSHandler", (PyCFunction) _wrap_new_wxInternetFSHandler, METH_VARARGS | METH_KEYWORDS },
|
{ "new_wxInternetFSHandler", (PyCFunction) _wrap_new_wxInternetFSHandler, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
{ "wxFileSystem_FileNameToURL", (PyCFunction) _wrap_wxFileSystem_FileNameToURL, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxFileSystem_CleanUpHandlers", (PyCFunction) _wrap_wxFileSystem_CleanUpHandlers, METH_VARARGS | METH_KEYWORDS },
|
{ "wxFileSystem_CleanUpHandlers", (PyCFunction) _wrap_wxFileSystem_CleanUpHandlers, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxFileSystem_AddHandler", (PyCFunction) _wrap_wxFileSystem_AddHandler, METH_VARARGS | METH_KEYWORDS },
|
{ "wxFileSystem_AddHandler", (PyCFunction) _wrap_wxFileSystem_AddHandler, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxFileSystem_FindNext", (PyCFunction) _wrap_wxFileSystem_FindNext, METH_VARARGS | METH_KEYWORDS },
|
{ "wxFileSystem_FindNext", (PyCFunction) _wrap_wxFileSystem_FindNext, METH_VARARGS | METH_KEYWORDS },
|
||||||
@@ -1939,6 +2021,7 @@ static PyMethodDef filesyscMethods[] = {
|
|||||||
{ "__wxMemoryFSHandler_AddFile_Data", (PyCFunction) _wrap___wxMemoryFSHandler_AddFile_Data, METH_VARARGS | METH_KEYWORDS },
|
{ "__wxMemoryFSHandler_AddFile_Data", (PyCFunction) _wrap___wxMemoryFSHandler_AddFile_Data, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "__wxMemoryFSHandler_AddFile_wxBitmap", (PyCFunction) _wrap___wxMemoryFSHandler_AddFile_wxBitmap, METH_VARARGS | METH_KEYWORDS },
|
{ "__wxMemoryFSHandler_AddFile_wxBitmap", (PyCFunction) _wrap___wxMemoryFSHandler_AddFile_wxBitmap, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "__wxMemoryFSHandler_AddFile_wxImage", (PyCFunction) _wrap___wxMemoryFSHandler_AddFile_wxImage, METH_VARARGS | METH_KEYWORDS },
|
{ "__wxMemoryFSHandler_AddFile_wxImage", (PyCFunction) _wrap___wxMemoryFSHandler_AddFile_wxImage, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
{ "wxFileSystem_URLToFileName", (PyCFunction) _wrap_wxFileSystem_URLToFileName, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@@ -218,6 +218,8 @@ class wxMemoryFSHandler(wxMemoryFSHandlerPtr):
|
|||||||
|
|
||||||
#-------------- FUNCTION WRAPPERS ------------------
|
#-------------- FUNCTION WRAPPERS ------------------
|
||||||
|
|
||||||
|
wxFileSystem_URLToFileName = filesysc.wxFileSystem_URLToFileName
|
||||||
|
|
||||||
__wxMemoryFSHandler_AddFile_wxImage = filesysc.__wxMemoryFSHandler_AddFile_wxImage
|
__wxMemoryFSHandler_AddFile_wxImage = filesysc.__wxMemoryFSHandler_AddFile_wxImage
|
||||||
|
|
||||||
__wxMemoryFSHandler_AddFile_wxBitmap = filesysc.__wxMemoryFSHandler_AddFile_wxBitmap
|
__wxMemoryFSHandler_AddFile_wxBitmap = filesysc.__wxMemoryFSHandler_AddFile_wxBitmap
|
||||||
@@ -228,6 +230,8 @@ wxFileSystem_AddHandler = filesysc.wxFileSystem_AddHandler
|
|||||||
|
|
||||||
wxFileSystem_CleanUpHandlers = filesysc.wxFileSystem_CleanUpHandlers
|
wxFileSystem_CleanUpHandlers = filesysc.wxFileSystem_CleanUpHandlers
|
||||||
|
|
||||||
|
wxFileSystem_FileNameToURL = filesysc.wxFileSystem_FileNameToURL
|
||||||
|
|
||||||
wxMemoryFSHandler_RemoveFile = filesysc.wxMemoryFSHandler_RemoveFile
|
wxMemoryFSHandler_RemoveFile = filesysc.wxMemoryFSHandler_RemoveFile
|
||||||
|
|
||||||
|
|
||||||
|
@@ -3275,6 +3275,52 @@ static PyObject *_wrap_wxColourDatabase_FindColour(PyObject *self, PyObject *arg
|
|||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define wxColourDatabase_FindColourNoAdd(_swigobj,_swigarg0) (_swigobj->FindColourNoAdd(_swigarg0))
|
||||||
|
static PyObject *_wrap_wxColourDatabase_FindColourNoAdd(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
|
PyObject * _resultobj;
|
||||||
|
wxColour * _result;
|
||||||
|
wxColourDatabase * _arg0;
|
||||||
|
wxString * _arg1;
|
||||||
|
PyObject * _argo0 = 0;
|
||||||
|
PyObject * _obj1 = 0;
|
||||||
|
char *_kwnames[] = { "self","colour", NULL };
|
||||||
|
char _ptemp[128];
|
||||||
|
|
||||||
|
self = self;
|
||||||
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxColourDatabase_FindColourNoAdd",_kwnames,&_argo0,&_obj1))
|
||||||
|
return NULL;
|
||||||
|
if (_argo0) {
|
||||||
|
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||||
|
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColourDatabase_p")) {
|
||||||
|
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxColourDatabase_FindColourNoAdd. Expected _wxColourDatabase_p.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_arg1 = wxString_in_helper(_obj1);
|
||||||
|
if (_arg1 == NULL)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||||
|
_result = (wxColour *)wxColourDatabase_FindColourNoAdd(_arg0,*_arg1);
|
||||||
|
|
||||||
|
wxPyEndAllowThreads(__tstate);
|
||||||
|
if (PyErr_Occurred()) return NULL;
|
||||||
|
} if (_result) {
|
||||||
|
SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
|
||||||
|
_resultobj = Py_BuildValue("s",_ptemp);
|
||||||
|
} else {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
_resultobj = Py_None;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if (_obj1)
|
||||||
|
delete _arg1;
|
||||||
|
}
|
||||||
|
return _resultobj;
|
||||||
|
}
|
||||||
|
|
||||||
#define wxColourDatabase_FindName(_swigobj,_swigarg0) (_swigobj->FindName(_swigarg0))
|
#define wxColourDatabase_FindName(_swigobj,_swigarg0) (_swigobj->FindName(_swigarg0))
|
||||||
static PyObject *_wrap_wxColourDatabase_FindName(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxColourDatabase_FindName(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
@@ -3320,27 +3366,60 @@ static PyObject *_wrap_wxColourDatabase_FindName(PyObject *self, PyObject *args,
|
|||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void wxColourDatabase_AddColour(wxColourDatabase *self,const wxString & name,wxColour * colour) {
|
||||||
|
// make a copy since the python one will be GC'd
|
||||||
|
wxColour* c = new wxColour(*colour);
|
||||||
|
self->AddColour(name, c);
|
||||||
|
}
|
||||||
|
static PyObject *_wrap_wxColourDatabase_AddColour(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
|
PyObject * _resultobj;
|
||||||
|
wxColourDatabase * _arg0;
|
||||||
|
wxString * _arg1;
|
||||||
|
wxColour * _arg2;
|
||||||
|
PyObject * _argo0 = 0;
|
||||||
|
PyObject * _obj1 = 0;
|
||||||
|
wxColour temp;
|
||||||
|
PyObject * _obj2 = 0;
|
||||||
|
char *_kwnames[] = { "self","name","colour", NULL };
|
||||||
|
|
||||||
|
self = self;
|
||||||
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxColourDatabase_AddColour",_kwnames,&_argo0,&_obj1,&_obj2))
|
||||||
|
return NULL;
|
||||||
|
if (_argo0) {
|
||||||
|
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||||
|
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColourDatabase_p")) {
|
||||||
|
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxColourDatabase_AddColour. Expected _wxColourDatabase_p.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_arg1 = wxString_in_helper(_obj1);
|
||||||
|
if (_arg1 == NULL)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_arg2 = &temp;
|
||||||
|
if (! wxColour_helper(_obj2, &_arg2))
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||||
|
wxColourDatabase_AddColour(_arg0,*_arg1,_arg2);
|
||||||
|
|
||||||
|
wxPyEndAllowThreads(__tstate);
|
||||||
|
if (PyErr_Occurred()) return NULL;
|
||||||
|
} Py_INCREF(Py_None);
|
||||||
|
_resultobj = Py_None;
|
||||||
|
{
|
||||||
|
if (_obj1)
|
||||||
|
delete _arg1;
|
||||||
|
}
|
||||||
|
return _resultobj;
|
||||||
|
}
|
||||||
|
|
||||||
static void wxColourDatabase_Append(wxColourDatabase *self,const wxString & name,int red,int green,int blue) {
|
static void wxColourDatabase_Append(wxColourDatabase *self,const wxString & name,int red,int green,int blue) {
|
||||||
// first see if the name is already there
|
wxColour* c = new wxColour(red, green, blue);
|
||||||
wxString cName = name;
|
self->AddColour(name, c);
|
||||||
cName.MakeUpper();
|
|
||||||
wxString cName2 = cName;
|
|
||||||
if ( !cName2.Replace(wxT("GRAY"), wxT("GREY")) )
|
|
||||||
cName2.clear();
|
|
||||||
|
|
||||||
wxNode *node = self->GetFirst();
|
|
||||||
while ( node ) {
|
|
||||||
const wxChar *key = node->GetKeyString();
|
|
||||||
if ( cName == key || cName2 == key ) {
|
|
||||||
wxColour* c = (wxColour *)node->GetData();
|
|
||||||
c->Set(red, green, blue);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
node = node->GetNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
// otherwise append the new colour
|
|
||||||
self->Append(name.c_str(), new wxColour(red, green, blue));
|
|
||||||
}
|
}
|
||||||
static PyObject *_wrap_wxColourDatabase_Append(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxColourDatabase_Append(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
@@ -10874,7 +10953,9 @@ static PyMethodDef gdicMethods[] = {
|
|||||||
{ "delete_wxPen", (PyCFunction) _wrap_delete_wxPen, METH_VARARGS | METH_KEYWORDS },
|
{ "delete_wxPen", (PyCFunction) _wrap_delete_wxPen, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "new_wxPen", (PyCFunction) _wrap_new_wxPen, METH_VARARGS | METH_KEYWORDS },
|
{ "new_wxPen", (PyCFunction) _wrap_new_wxPen, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxColourDatabase_Append", (PyCFunction) _wrap_wxColourDatabase_Append, METH_VARARGS | METH_KEYWORDS },
|
{ "wxColourDatabase_Append", (PyCFunction) _wrap_wxColourDatabase_Append, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
{ "wxColourDatabase_AddColour", (PyCFunction) _wrap_wxColourDatabase_AddColour, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxColourDatabase_FindName", (PyCFunction) _wrap_wxColourDatabase_FindName, METH_VARARGS | METH_KEYWORDS },
|
{ "wxColourDatabase_FindName", (PyCFunction) _wrap_wxColourDatabase_FindName, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
{ "wxColourDatabase_FindColourNoAdd", (PyCFunction) _wrap_wxColourDatabase_FindColourNoAdd, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxColourDatabase_FindColour", (PyCFunction) _wrap_wxColourDatabase_FindColour, METH_VARARGS | METH_KEYWORDS },
|
{ "wxColourDatabase_FindColour", (PyCFunction) _wrap_wxColourDatabase_FindColour, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxColour___ne__", (PyCFunction) _wrap_wxColour___ne__, METH_VARARGS | METH_KEYWORDS },
|
{ "wxColour___ne__", (PyCFunction) _wrap_wxColour___ne__, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxColour___eq__", (PyCFunction) _wrap_wxColour___eq__, METH_VARARGS | METH_KEYWORDS },
|
{ "wxColour___eq__", (PyCFunction) _wrap_wxColour___eq__, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
@@ -294,9 +294,16 @@ class wxColourDatabasePtr(wxObjectPtr):
|
|||||||
val = gdic.wxColourDatabase_FindColour(self, *_args, **_kwargs)
|
val = gdic.wxColourDatabase_FindColour(self, *_args, **_kwargs)
|
||||||
if val: val = wxColourPtr(val)
|
if val: val = wxColourPtr(val)
|
||||||
return val
|
return val
|
||||||
|
def FindColourNoAdd(self, *_args, **_kwargs):
|
||||||
|
val = gdic.wxColourDatabase_FindColourNoAdd(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxColourPtr(val)
|
||||||
|
return val
|
||||||
def FindName(self, *_args, **_kwargs):
|
def FindName(self, *_args, **_kwargs):
|
||||||
val = gdic.wxColourDatabase_FindName(self, *_args, **_kwargs)
|
val = gdic.wxColourDatabase_FindName(self, *_args, **_kwargs)
|
||||||
return val
|
return val
|
||||||
|
def AddColour(self, *_args, **_kwargs):
|
||||||
|
val = gdic.wxColourDatabase_AddColour(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
def Append(self, *_args, **_kwargs):
|
def Append(self, *_args, **_kwargs):
|
||||||
val = gdic.wxColourDatabase_Append(self, *_args, **_kwargs)
|
val = gdic.wxColourDatabase_Append(self, *_args, **_kwargs)
|
||||||
return val
|
return val
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -324,6 +324,188 @@ class wxHtmlWinTagHandler(wxHtmlWinTagHandlerPtr):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxHtmlSelectionPtr :
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def __del__(self, delfunc=htmlc.delete_wxHtmlSelection):
|
||||||
|
if self.thisown == 1:
|
||||||
|
try:
|
||||||
|
delfunc(self)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
def Set(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_Set(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def SetCells(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_SetCells(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def GetFromCell(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_GetFromCell(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxHtmlCellPtr(val)
|
||||||
|
return val
|
||||||
|
def GetToCell(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_GetToCell(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxHtmlCellPtr(val)
|
||||||
|
return val
|
||||||
|
def GetFromPos(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_GetFromPos(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxPointPtr(val)
|
||||||
|
return val
|
||||||
|
def GetToPos(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_GetToPos(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxPointPtr(val)
|
||||||
|
return val
|
||||||
|
def GetFromPrivPos(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_GetFromPrivPos(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxPointPtr(val)
|
||||||
|
return val
|
||||||
|
def GetToPrivPos(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_GetToPrivPos(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxPointPtr(val)
|
||||||
|
return val
|
||||||
|
def SetFromPrivPos(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_SetFromPrivPos(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def SetToPrivPos(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_SetToPrivPos(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def ClearPrivPos(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_ClearPrivPos(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def IsEmpty(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlSelection_IsEmpty(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<%s.%s instance; proxy of C++ wxHtmlSelection instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||||
|
class wxHtmlSelection(wxHtmlSelectionPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = htmlc.new_wxHtmlSelection(*_args,**_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxHtmlRenderingStatePtr :
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def __del__(self, delfunc=htmlc.delete_wxHtmlRenderingState):
|
||||||
|
if self.thisown == 1:
|
||||||
|
try:
|
||||||
|
delfunc(self)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
def SetSelectionState(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingState_SetSelectionState(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def GetSelectionState(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingState_GetSelectionState(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def SetFgColour(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingState_SetFgColour(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def GetFgColour(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingState_GetFgColour(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxColourPtr(val)
|
||||||
|
return val
|
||||||
|
def SetBgColour(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingState_SetBgColour(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def GetBgColour(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingState_GetBgColour(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxColourPtr(val)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<%s.%s instance; proxy of C++ wxHtmlRenderingState instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||||
|
class wxHtmlRenderingState(wxHtmlRenderingStatePtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = htmlc.new_wxHtmlRenderingState(*_args,**_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxHtmlRenderingStylePtr :
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def GetSelectedTextColour(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingStyle_GetSelectedTextColour(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxColourPtr(val) ; val.thisown = 1
|
||||||
|
return val
|
||||||
|
def GetSelectedTextBgColour(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingStyle_GetSelectedTextBgColour(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxColourPtr(val) ; val.thisown = 1
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<%s.%s instance; proxy of C++ wxHtmlRenderingStyle instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||||
|
class wxHtmlRenderingStyle(wxHtmlRenderingStylePtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxDefaultHtmlRenderingStylePtr(wxHtmlRenderingStylePtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def GetSelectedTextColour(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxDefaultHtmlRenderingStyle_GetSelectedTextColour(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxColourPtr(val) ; val.thisown = 1
|
||||||
|
return val
|
||||||
|
def GetSelectedTextBgColour(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxDefaultHtmlRenderingStyle_GetSelectedTextBgColour(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxColourPtr(val) ; val.thisown = 1
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<%s.%s instance; proxy of C++ wxDefaultHtmlRenderingStyle instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||||
|
class wxDefaultHtmlRenderingStyle(wxDefaultHtmlRenderingStylePtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxHtmlRenderingInfoPtr :
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def __del__(self, delfunc=htmlc.delete_wxHtmlRenderingInfo):
|
||||||
|
if self.thisown == 1:
|
||||||
|
try:
|
||||||
|
delfunc(self)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
def SetSelection(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingInfo_SetSelection(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def GetSelection(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingInfo_GetSelection(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxHtmlSelectionPtr(val)
|
||||||
|
return val
|
||||||
|
def SetStyle(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingInfo_SetStyle(self, *_args, **_kwargs)
|
||||||
|
return val
|
||||||
|
def GetStyle(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingInfo_GetStyle(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxHtmlRenderingStylePtr(val)
|
||||||
|
return val
|
||||||
|
def GetState(self, *_args, **_kwargs):
|
||||||
|
val = htmlc.wxHtmlRenderingInfo_GetState(self, *_args, **_kwargs)
|
||||||
|
if val: val = wxHtmlRenderingStatePtr(val)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<%s.%s instance; proxy of C++ wxHtmlRenderingInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||||
|
class wxHtmlRenderingInfo(wxHtmlRenderingInfoPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = htmlc.new_wxHtmlRenderingInfo(*_args,**_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class wxHtmlCellPtr(wxObjectPtr):
|
class wxHtmlCellPtr(wxObjectPtr):
|
||||||
def __init__(self,this):
|
def __init__(self,this):
|
||||||
self.this = this
|
self.this = this
|
||||||
@@ -460,12 +642,13 @@ class wxHtmlContainerCellPtr(wxHtmlCellPtr):
|
|||||||
def SetBorder(self, *_args, **_kwargs):
|
def SetBorder(self, *_args, **_kwargs):
|
||||||
val = htmlc.wxHtmlContainerCell_SetBorder(self, *_args, **_kwargs)
|
val = htmlc.wxHtmlContainerCell_SetBorder(self, *_args, **_kwargs)
|
||||||
return val
|
return val
|
||||||
def GetFirstCell(self, *_args, **_kwargs):
|
def GetFirstChild(self, *_args, **_kwargs):
|
||||||
val = htmlc.wxHtmlContainerCell_GetFirstCell(self, *_args, **_kwargs)
|
val = htmlc.wxHtmlContainerCell_GetFirstChild(self, *_args, **_kwargs)
|
||||||
if val: val = wxHtmlCellPtr(val)
|
if val: val = wxHtmlCellPtr(val)
|
||||||
return val
|
return val
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<%s.%s instance; proxy of C++ wxHtmlContainerCell instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
return "<%s.%s instance; proxy of C++ wxHtmlContainerCell instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||||
|
GetFirstCell = GetFirstChild
|
||||||
class wxHtmlContainerCell(wxHtmlContainerCellPtr):
|
class wxHtmlContainerCell(wxHtmlContainerCellPtr):
|
||||||
def __init__(self,*_args,**_kwargs):
|
def __init__(self,*_args,**_kwargs):
|
||||||
self.this = htmlc.new_wxHtmlContainerCell(*_args,**_kwargs)
|
self.this = htmlc.new_wxHtmlContainerCell(*_args,**_kwargs)
|
||||||
@@ -812,6 +995,9 @@ wxHTML_REDIRECT = htmlc.wxHTML_REDIRECT
|
|||||||
wxHTML_URL_PAGE = htmlc.wxHTML_URL_PAGE
|
wxHTML_URL_PAGE = htmlc.wxHTML_URL_PAGE
|
||||||
wxHTML_URL_IMAGE = htmlc.wxHTML_URL_IMAGE
|
wxHTML_URL_IMAGE = htmlc.wxHTML_URL_IMAGE
|
||||||
wxHTML_URL_OTHER = htmlc.wxHTML_URL_OTHER
|
wxHTML_URL_OTHER = htmlc.wxHTML_URL_OTHER
|
||||||
|
wxHTML_SEL_OUT = htmlc.wxHTML_SEL_OUT
|
||||||
|
wxHTML_SEL_IN = htmlc.wxHTML_SEL_IN
|
||||||
|
wxHTML_SEL_CHANGING = htmlc.wxHTML_SEL_CHANGING
|
||||||
wxPAGE_ODD = htmlc.wxPAGE_ODD
|
wxPAGE_ODD = htmlc.wxPAGE_ODD
|
||||||
wxPAGE_EVEN = htmlc.wxPAGE_EVEN
|
wxPAGE_EVEN = htmlc.wxPAGE_EVEN
|
||||||
wxPAGE_ALL = htmlc.wxPAGE_ALL
|
wxPAGE_ALL = htmlc.wxPAGE_ALL
|
||||||
|
@@ -55,7 +55,6 @@ extern PyObject *SWIG_newvarlink(void);
|
|||||||
#define SWIG_name "miscc"
|
#define SWIG_name "miscc"
|
||||||
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include <wx/resource.h>
|
|
||||||
#include <wx/tooltip.h>
|
#include <wx/tooltip.h>
|
||||||
#include <wx/busyinfo.h>
|
#include <wx/busyinfo.h>
|
||||||
#include <wx/geometry.h>
|
#include <wx/geometry.h>
|
||||||
|
@@ -56,7 +56,6 @@ extern PyObject *SWIG_newvarlink(void);
|
|||||||
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "pyistream.h"
|
#include "pyistream.h"
|
||||||
#include <wx/resource.h>
|
|
||||||
#include <wx/tooltip.h>
|
#include <wx/tooltip.h>
|
||||||
#include <wx/caret.h>
|
#include <wx/caret.h>
|
||||||
#include <wx/tipdlg.h>
|
#include <wx/tipdlg.h>
|
||||||
@@ -73,7 +72,6 @@ extern PyObject *SWIG_newvarlink(void);
|
|||||||
#include <wx/mimetype.h>
|
#include <wx/mimetype.h>
|
||||||
#include <wx/snglinst.h>
|
#include <wx/snglinst.h>
|
||||||
#include <wx/effects.h>
|
#include <wx/effects.h>
|
||||||
//#include <wx/spawnbrowser.h>
|
|
||||||
|
|
||||||
|
|
||||||
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
|
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
|
||||||
@@ -8593,9 +8591,9 @@ static PyObject *_wrap_wxFileType_GetExtensions(PyObject *self, PyObject *args,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static wxIcon * wxFileType_GetIcon(wxFileType *self) {
|
static wxIcon * wxFileType_GetIcon(wxFileType *self) {
|
||||||
wxIcon icon;
|
wxIconLocation loc;
|
||||||
if (self->GetIcon(&icon))
|
if (self->GetIcon(&loc))
|
||||||
return new wxIcon(icon);
|
return new wxIcon(loc);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -8634,14 +8632,18 @@ static PyObject *_wrap_wxFileType_GetIcon(PyObject *self, PyObject *args, PyObje
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PyObject * wxFileType_GetIconInfo(wxFileType *self) {
|
static PyObject * wxFileType_GetIconInfo(wxFileType *self) {
|
||||||
wxIcon icon;
|
wxIconLocation loc;
|
||||||
wxString iconFile;
|
if (self->GetIcon(&loc)) {
|
||||||
int iconIndex;
|
wxString iconFile = loc.GetFileName();
|
||||||
if (self->GetIcon(&icon, &iconFile, &iconIndex)) {
|
int iconIndex = -1;
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
iconIndex = loc.GetIndex();
|
||||||
|
#endif
|
||||||
|
// Make a tuple and put the values in it
|
||||||
wxPyBeginBlockThreads();
|
wxPyBeginBlockThreads();
|
||||||
PyObject* tuple = PyTuple_New(3);
|
PyObject* tuple = PyTuple_New(3);
|
||||||
PyTuple_SetItem(tuple, 0, wxPyConstructObject(new wxIcon(icon),
|
PyTuple_SetItem(tuple, 0,
|
||||||
wxT("wxIcon"), TRUE));
|
wxPyConstructObject(new wxIcon(loc), wxT("wxIcon"), TRUE));
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
PyTuple_SetItem(tuple, 1, PyUnicode_FromWideChar(iconFile.c_str(), iconFile.Len()));
|
PyTuple_SetItem(tuple, 1, PyUnicode_FromWideChar(iconFile.c_str(), iconFile.Len()));
|
||||||
#else
|
#else
|
||||||
@@ -10282,34 +10284,6 @@ static PyObject *_wrap_wxFileHistory_GetCount(PyObject *self, PyObject *args, Py
|
|||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define wxFileHistory_GetNoHistoryFiles(_swigobj) (_swigobj->GetNoHistoryFiles())
|
|
||||||
static PyObject *_wrap_wxFileHistory_GetNoHistoryFiles(PyObject *self, PyObject *args, PyObject *kwargs) {
|
|
||||||
PyObject * _resultobj;
|
|
||||||
int _result;
|
|
||||||
wxFileHistory * _arg0;
|
|
||||||
PyObject * _argo0 = 0;
|
|
||||||
char *_kwnames[] = { "self", NULL };
|
|
||||||
|
|
||||||
self = self;
|
|
||||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFileHistory_GetNoHistoryFiles",_kwnames,&_argo0))
|
|
||||||
return NULL;
|
|
||||||
if (_argo0) {
|
|
||||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
|
||||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFileHistory_p")) {
|
|
||||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFileHistory_GetNoHistoryFiles. Expected _wxFileHistory_p.");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
|
||||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
|
||||||
_result = (int )wxFileHistory_GetNoHistoryFiles(_arg0);
|
|
||||||
|
|
||||||
wxPyEndAllowThreads(__tstate);
|
|
||||||
if (PyErr_Occurred()) return NULL;
|
|
||||||
} _resultobj = Py_BuildValue("i",_result);
|
|
||||||
return _resultobj;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *SwigwxEffectsTowxObject(void *ptr) {
|
static void *SwigwxEffectsTowxObject(void *ptr) {
|
||||||
wxEffects *src;
|
wxEffects *src;
|
||||||
wxObject *dest;
|
wxObject *dest;
|
||||||
@@ -11041,7 +11015,6 @@ static PyMethodDef misc2cMethods[] = {
|
|||||||
{ "wxEffects_GetLightShadow", (PyCFunction) _wrap_wxEffects_GetLightShadow, METH_VARARGS | METH_KEYWORDS },
|
{ "wxEffects_GetLightShadow", (PyCFunction) _wrap_wxEffects_GetLightShadow, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxEffects_GetHighlightColour", (PyCFunction) _wrap_wxEffects_GetHighlightColour, METH_VARARGS | METH_KEYWORDS },
|
{ "wxEffects_GetHighlightColour", (PyCFunction) _wrap_wxEffects_GetHighlightColour, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "new_wxEffects", (PyCFunction) _wrap_new_wxEffects, METH_VARARGS | METH_KEYWORDS },
|
{ "new_wxEffects", (PyCFunction) _wrap_new_wxEffects, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxFileHistory_GetNoHistoryFiles", (PyCFunction) _wrap_wxFileHistory_GetNoHistoryFiles, METH_VARARGS | METH_KEYWORDS },
|
|
||||||
{ "wxFileHistory_GetCount", (PyCFunction) _wrap_wxFileHistory_GetCount, METH_VARARGS | METH_KEYWORDS },
|
{ "wxFileHistory_GetCount", (PyCFunction) _wrap_wxFileHistory_GetCount, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxFileHistory_GetHistoryFile", (PyCFunction) _wrap_wxFileHistory_GetHistoryFile, METH_VARARGS | METH_KEYWORDS },
|
{ "wxFileHistory_GetHistoryFile", (PyCFunction) _wrap_wxFileHistory_GetHistoryFile, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxFileHistory_AddFilesToThisMenu", (PyCFunction) _wrap_wxFileHistory_AddFilesToThisMenu, METH_VARARGS | METH_KEYWORDS },
|
{ "wxFileHistory_AddFilesToThisMenu", (PyCFunction) _wrap_wxFileHistory_AddFilesToThisMenu, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
@@ -1060,11 +1060,9 @@ class wxFileHistoryPtr(wxObjectPtr):
|
|||||||
def GetCount(self, *_args, **_kwargs):
|
def GetCount(self, *_args, **_kwargs):
|
||||||
val = misc2c.wxFileHistory_GetCount(self, *_args, **_kwargs)
|
val = misc2c.wxFileHistory_GetCount(self, *_args, **_kwargs)
|
||||||
return val
|
return val
|
||||||
def GetNoHistoryFiles(self, *_args, **_kwargs):
|
|
||||||
val = misc2c.wxFileHistory_GetNoHistoryFiles(self, *_args, **_kwargs)
|
|
||||||
return val
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<%s.%s instance; proxy of C++ wxFileHistory instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
return "<%s.%s instance; proxy of C++ wxFileHistory instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||||
|
GetNoHistoryFiles = GetCount
|
||||||
class wxFileHistory(wxFileHistoryPtr):
|
class wxFileHistory(wxFileHistoryPtr):
|
||||||
def __init__(self,*_args,**_kwargs):
|
def __init__(self,*_args,**_kwargs):
|
||||||
self.this = misc2c.new_wxFileHistory(*_args,**_kwargs)
|
self.this = misc2c.new_wxFileHistory(*_args,**_kwargs)
|
||||||
|
@@ -28,6 +28,9 @@
|
|||||||
#include <wx/gtk/win_gtk.h>
|
#include <wx/gtk/win_gtk.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <wx/clipbrd.h>
|
||||||
|
#include <wx/mimetype.h>
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
#if PYTHON_API_VERSION <= 1007 && wxUSE_UNICODE
|
#if PYTHON_API_VERSION <= 1007 && wxUSE_UNICODE
|
||||||
@@ -36,14 +39,6 @@
|
|||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
|
||||||
int WXDLLEXPORT wxEntryStart( int& argc, char** argv );
|
|
||||||
#else
|
|
||||||
int WXDLLEXPORT wxEntryStart( int argc, char** argv );
|
|
||||||
#endif
|
|
||||||
int WXDLLEXPORT wxEntryInitGui();
|
|
||||||
void WXDLLEXPORT wxEntryCleanup();
|
|
||||||
|
|
||||||
wxPyApp* wxPythonApp = NULL; // Global instance of application object
|
wxPyApp* wxPythonApp = NULL; // Global instance of application object
|
||||||
bool wxPyDoCleanup = FALSE;
|
bool wxPyDoCleanup = FALSE;
|
||||||
bool wxPyDoingCleanup = FALSE;
|
bool wxPyDoingCleanup = FALSE;
|
||||||
@@ -334,6 +329,7 @@ void wxPyApp::SetMacHelpMenuTitleName(const wxString& val) {
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
static char* wxPyCopyCString(const wxChar* src)
|
static char* wxPyCopyCString(const wxChar* src)
|
||||||
{
|
{
|
||||||
wxWX2MBbuf buff = (wxWX2MBbuf)wxConvCurrent->cWX2MB(src);
|
wxWX2MBbuf buff = (wxWX2MBbuf)wxConvCurrent->cWX2MB(src);
|
||||||
@@ -366,13 +362,13 @@ static wxChar* wxPyCopyWString(const wxChar *src)
|
|||||||
return copystring(src);
|
return copystring(src);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
// This is where we pick up the first part of the wxEntry functionality...
|
// This function is called when the wxc module is imported to do some initial
|
||||||
// The rest is in __wxStart and __wxCleanup. This function is called when
|
// setup. (Before there is a wxApp object.)
|
||||||
// wxcmodule is imported. (Before there is a wxApp object.)
|
|
||||||
void __wxPreStart(PyObject* moduleDict)
|
void __wxPreStart(PyObject* moduleDict)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -386,25 +382,32 @@ void __wxPreStart(PyObject* moduleDict)
|
|||||||
wxPyTMutex = new wxMutex;
|
wxPyTMutex = new wxMutex;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Restore default signal handlers, (prevents crash upon Ctrl-C in the
|
// Ensure that the build options in the DLL (or whatever) match this build
|
||||||
// console that launched a wxPython app...)
|
|
||||||
PyOS_FiniInterrupts();
|
|
||||||
|
|
||||||
wxApp::CheckBuildOptions(wxBuildOptions());
|
wxApp::CheckBuildOptions(wxBuildOptions());
|
||||||
|
|
||||||
|
// Create an exception object to use for wxASSERTions
|
||||||
wxPyAssertionError = PyErr_NewException("wxPython.wxc.wxPyAssertionError",
|
wxPyAssertionError = PyErr_NewException("wxPython.wxc.wxPyAssertionError",
|
||||||
PyExc_AssertionError, NULL);
|
PyExc_AssertionError, NULL);
|
||||||
PyDict_SetItemString(moduleDict, "wxPyAssertionError", wxPyAssertionError);
|
PyDict_SetItemString(moduleDict, "wxPyAssertionError", wxPyAssertionError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Bail out if there is already a wxApp created. This means that the
|
|
||||||
// toolkit has already been initialized, as in embedding wxPython in
|
|
||||||
// a C++ wxWindows app, so we don't need to call wxEntryStart.
|
|
||||||
if (wxTheApp != NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
wxPyDoCleanup = TRUE;
|
|
||||||
|
|
||||||
|
// Initialize wxWindows and bootstrap the user application by calling the
|
||||||
|
// wxApp's OnInit, which is a parameter to this funciton. See wxApp.__init__
|
||||||
|
// in _extras.py to learn how the bootstrap is started.
|
||||||
|
PyObject* __wxStart(PyObject* /* self */, PyObject* args)
|
||||||
|
{
|
||||||
|
PyObject* onInitFunc = NULL;
|
||||||
|
PyObject* arglist= NULL;
|
||||||
|
PyObject* result = NULL;
|
||||||
|
PyObject* pyint = NULL;
|
||||||
|
long bResult;
|
||||||
|
|
||||||
|
if (!PyArg_ParseTuple(args, "O", &onInitFunc))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Get any command-line args passed to this program from the sys module
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
char** argv = NULL;
|
char** argv = NULL;
|
||||||
PyObject* sysargv = PySys_GetObject("argv");
|
PyObject* sysargv = PySys_GetObject("argv");
|
||||||
@@ -412,50 +415,27 @@ void __wxPreStart(PyObject* moduleDict)
|
|||||||
argc = PyList_Size(sysargv);
|
argc = PyList_Size(sysargv);
|
||||||
argv = new char*[argc+1];
|
argv = new char*[argc+1];
|
||||||
int x;
|
int x;
|
||||||
for(x=0; x<argc; x++) {
|
|
||||||
PyObject *item = PyList_GetItem(sysargv, x);
|
|
||||||
argv[x] = wxPyCopyCString(Py2wxString(item));
|
|
||||||
}
|
|
||||||
argv[argc] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxEntryStart(argc, argv);
|
|
||||||
delete [] argv;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Start the user application, user App's OnInit method is a parameter here
|
|
||||||
PyObject* __wxStart(PyObject* /* self */, PyObject* args)
|
|
||||||
{
|
|
||||||
PyObject* onInitFunc = NULL;
|
|
||||||
PyObject* arglist;
|
|
||||||
PyObject* result;
|
|
||||||
long bResult;
|
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "O", &onInitFunc))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
// This is the next part of the wxEntry functionality...
|
|
||||||
int argc = 0;
|
|
||||||
wxChar** argv = NULL;
|
|
||||||
PyObject* sysargv = PySys_GetObject("argv");
|
|
||||||
if (sysargv != NULL) {
|
|
||||||
argc = PyList_Size(sysargv);
|
|
||||||
argv = new wxChar*[argc+1];
|
|
||||||
int x;
|
|
||||||
for(x=0; x<argc; x++) {
|
for(x=0; x<argc; x++) {
|
||||||
PyObject *pyArg = PyList_GetItem(sysargv, x);
|
PyObject *pyArg = PyList_GetItem(sysargv, x);
|
||||||
argv[x] = wxPyCopyWString(Py2wxString(pyArg));
|
argv[x] = PyString_AsString(pyArg);
|
||||||
}
|
}
|
||||||
argv[argc] = NULL;
|
argv[argc] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPythonApp->argc = argc;
|
if (! wxEntryStart(argc, argv) ) {
|
||||||
wxPythonApp->argv = argv;
|
PyErr_SetString(PyExc_SystemError, // is this the right one?
|
||||||
|
"wxEntryStart failed!");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
delete [] argv;
|
||||||
|
|
||||||
wxEntryInitGui();
|
|
||||||
|
|
||||||
// Call the Python App's OnInit function
|
// The stock objects were all NULL when they were loaded into
|
||||||
|
// SWIG generated proxies, so re-init those now...
|
||||||
|
wxPy_ReinitStockObjects();
|
||||||
|
|
||||||
|
|
||||||
|
// Call the Python wxApp's OnInit function
|
||||||
arglist = PyTuple_New(0);
|
arglist = PyTuple_New(0);
|
||||||
result = PyEval_CallObject(onInitFunc, arglist);
|
result = PyEval_CallObject(onInitFunc, arglist);
|
||||||
Py_DECREF(arglist);
|
Py_DECREF(arglist);
|
||||||
@@ -463,7 +443,7 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* pyint = PyNumber_Int(result);
|
pyint = PyNumber_Int(result);
|
||||||
if (! pyint) {
|
if (! pyint) {
|
||||||
PyErr_SetString(PyExc_TypeError, "OnInit should return a boolean value");
|
PyErr_SetString(PyExc_TypeError, "OnInit should return a boolean value");
|
||||||
goto error;
|
goto error;
|
||||||
@@ -490,6 +470,7 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void __wxCleanup() {
|
void __wxCleanup() {
|
||||||
wxPyDoingCleanup = TRUE;
|
wxPyDoingCleanup = TRUE;
|
||||||
if (wxPyDoCleanup)
|
if (wxPyDoCleanup)
|
||||||
@@ -552,6 +533,102 @@ PyObject* __wxSetDictionary(PyObject* /* self */, PyObject* args)
|
|||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// The stock objects are no longer created when the wxc module is imported, but
|
||||||
|
// only after the app object has been created. This function will be called before
|
||||||
|
// OnInit is called so we can hack the new pointer values into the obj.this attributes.
|
||||||
|
|
||||||
|
void wxPy_ReinitStockObjects()
|
||||||
|
{
|
||||||
|
char ptrbuf[128];
|
||||||
|
PyObject* obj;
|
||||||
|
PyObject* ptrobj;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define REINITOBJ(name, type) \
|
||||||
|
obj = PyDict_GetItemString(wxPython_dict, #name); \
|
||||||
|
wxASSERT_MSG(obj != NULL, wxT("Unable to find stock object for " #name)); \
|
||||||
|
SWIG_MakePtr(ptrbuf, (char *) name, "_" #type "_p"); \
|
||||||
|
ptrobj = PyString_FromString(ptrbuf); \
|
||||||
|
PyObject_SetAttrString(obj, "this", ptrobj); \
|
||||||
|
Py_DECREF(ptrobj)
|
||||||
|
|
||||||
|
#define REINITOBJ2(name, type) \
|
||||||
|
obj = PyDict_GetItemString(wxPython_dict, #name); \
|
||||||
|
wxASSERT_MSG(obj != NULL, wxT("Unable to find stock object for " #name)); \
|
||||||
|
SWIG_MakePtr(ptrbuf, (char *) &name, "_" #type "_p"); \
|
||||||
|
ptrobj = PyString_FromString(ptrbuf); \
|
||||||
|
PyObject_SetAttrString(obj, "this", ptrobj); \
|
||||||
|
Py_DECREF(ptrobj)
|
||||||
|
|
||||||
|
|
||||||
|
REINITOBJ(wxNORMAL_FONT, wxFont);
|
||||||
|
REINITOBJ(wxSMALL_FONT, wxFont);
|
||||||
|
REINITOBJ(wxITALIC_FONT, wxFont);
|
||||||
|
REINITOBJ(wxSWISS_FONT, wxFont);
|
||||||
|
|
||||||
|
REINITOBJ(wxRED_PEN, wxPen);
|
||||||
|
REINITOBJ(wxCYAN_PEN, wxPen);
|
||||||
|
REINITOBJ(wxGREEN_PEN, wxPen);
|
||||||
|
REINITOBJ(wxBLACK_PEN, wxPen);
|
||||||
|
REINITOBJ(wxWHITE_PEN, wxPen);
|
||||||
|
REINITOBJ(wxTRANSPARENT_PEN, wxPen);
|
||||||
|
REINITOBJ(wxBLACK_DASHED_PEN, wxPen);
|
||||||
|
REINITOBJ(wxGREY_PEN, wxPen);
|
||||||
|
REINITOBJ(wxMEDIUM_GREY_PEN, wxPen);
|
||||||
|
REINITOBJ(wxLIGHT_GREY_PEN, wxPen);
|
||||||
|
|
||||||
|
REINITOBJ(wxBLUE_BRUSH, wxBrush);
|
||||||
|
REINITOBJ(wxGREEN_BRUSH, wxBrush);
|
||||||
|
REINITOBJ(wxWHITE_BRUSH, wxBrush);
|
||||||
|
REINITOBJ(wxBLACK_BRUSH, wxBrush);
|
||||||
|
REINITOBJ(wxTRANSPARENT_BRUSH, wxBrush);
|
||||||
|
REINITOBJ(wxCYAN_BRUSH, wxBrush);
|
||||||
|
REINITOBJ(wxRED_BRUSH, wxBrush);
|
||||||
|
REINITOBJ(wxGREY_BRUSH, wxBrush);
|
||||||
|
REINITOBJ(wxMEDIUM_GREY_BRUSH, wxBrush);
|
||||||
|
REINITOBJ(wxLIGHT_GREY_BRUSH, wxBrush);
|
||||||
|
|
||||||
|
REINITOBJ(wxBLACK, wxColour);
|
||||||
|
REINITOBJ(wxWHITE, wxColour);
|
||||||
|
REINITOBJ(wxRED, wxColour);
|
||||||
|
REINITOBJ(wxBLUE, wxColour);
|
||||||
|
REINITOBJ(wxGREEN, wxColour);
|
||||||
|
REINITOBJ(wxCYAN, wxColour);
|
||||||
|
REINITOBJ(wxLIGHT_GREY, wxColour);
|
||||||
|
|
||||||
|
REINITOBJ(wxSTANDARD_CURSOR, wxCursor);
|
||||||
|
REINITOBJ(wxHOURGLASS_CURSOR, wxCursor);
|
||||||
|
REINITOBJ(wxCROSS_CURSOR, wxCursor);
|
||||||
|
|
||||||
|
REINITOBJ2(wxNullBitmap, wxBitmap);
|
||||||
|
REINITOBJ2(wxNullIcon, wxIcon);
|
||||||
|
REINITOBJ2(wxNullCursor, wxCursor);
|
||||||
|
REINITOBJ2(wxNullPen, wxPen);
|
||||||
|
REINITOBJ2(wxNullBrush, wxBrush);
|
||||||
|
REINITOBJ2(wxNullPalette, wxPalette);
|
||||||
|
REINITOBJ2(wxNullFont, wxFont);
|
||||||
|
REINITOBJ2(wxNullColour, wxColour);
|
||||||
|
|
||||||
|
REINITOBJ(wxTheFontList, wxFontList);
|
||||||
|
REINITOBJ(wxThePenList, wxPenList);
|
||||||
|
REINITOBJ(wxTheBrushList, wxBrushList);
|
||||||
|
REINITOBJ(wxTheColourDatabase, wxColourDatabase);
|
||||||
|
|
||||||
|
|
||||||
|
REINITOBJ(wxTheClipboard, wxClipboard);
|
||||||
|
REINITOBJ(wxTheMimeTypesManager, wxMimeTypesManager);
|
||||||
|
REINITOBJ2(wxDefaultValidator, wxValidator);
|
||||||
|
REINITOBJ2(wxNullImage, wxImage);
|
||||||
|
REINITOBJ2(wxNullAcceleratorTable, wxAcceleratorTable);
|
||||||
|
|
||||||
|
#undef REINITOBJ
|
||||||
|
#undef REINITOBJ2
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxPyClientData_dtor(wxPyClientData* self) {
|
void wxPyClientData_dtor(wxPyClientData* self) {
|
||||||
|
@@ -48,6 +48,9 @@ void wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName);
|
|||||||
PyObject* wxPy_ConvertList(wxListBase* list, const char* className);
|
PyObject* wxPy_ConvertList(wxListBase* list, const char* className);
|
||||||
long wxPyGetWinHandle(wxWindow* win);
|
long wxPyGetWinHandle(wxWindow* win);
|
||||||
|
|
||||||
|
void wxPy_ReinitStockObjects();
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
// if we want to handle threads and Python threads are available...
|
// if we want to handle threads and Python threads are available...
|
||||||
|
@@ -369,6 +369,103 @@ private:
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
// wxHtmlSelection is data holder with information about text selection.
|
||||||
|
// Selection is defined by two positions (beginning and end of the selection)
|
||||||
|
// and two leaf(!) cells at these positions.
|
||||||
|
class wxHtmlSelection
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxHtmlSelection();
|
||||||
|
~wxHtmlSelection();
|
||||||
|
|
||||||
|
void Set(const wxPoint& fromPos, const wxHtmlCell *fromCell,
|
||||||
|
const wxPoint& toPos, const wxHtmlCell *toCell);
|
||||||
|
%name(SetCells)void Set(const wxHtmlCell *fromCell, const wxHtmlCell *toCell);
|
||||||
|
|
||||||
|
const wxHtmlCell *GetFromCell() const;
|
||||||
|
const wxHtmlCell *GetToCell() const;
|
||||||
|
|
||||||
|
// these values are in absolute coordinates:
|
||||||
|
const wxPoint& GetFromPos() const;
|
||||||
|
const wxPoint& GetToPos() const;
|
||||||
|
|
||||||
|
// these are From/ToCell's private data
|
||||||
|
const wxPoint& GetFromPrivPos() const;
|
||||||
|
const wxPoint& GetToPrivPos() const;
|
||||||
|
void SetFromPrivPos(const wxPoint& pos);
|
||||||
|
void SetToPrivPos(const wxPoint& pos);
|
||||||
|
void ClearPrivPos();
|
||||||
|
|
||||||
|
const bool IsEmpty() const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
enum wxHtmlSelectionState
|
||||||
|
{
|
||||||
|
wxHTML_SEL_OUT, // currently rendered cell is outside the selection
|
||||||
|
wxHTML_SEL_IN, // ... is inside selection
|
||||||
|
wxHTML_SEL_CHANGING // ... is the cell on which selection state changes
|
||||||
|
};
|
||||||
|
|
||||||
|
// Selection state is passed to wxHtmlCell::Draw so that it can render itself
|
||||||
|
// differently e.g. when inside text selection or outside it.
|
||||||
|
class wxHtmlRenderingState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxHtmlRenderingState();
|
||||||
|
~wxHtmlRenderingState();
|
||||||
|
|
||||||
|
void SetSelectionState(wxHtmlSelectionState s);
|
||||||
|
wxHtmlSelectionState GetSelectionState() const;
|
||||||
|
|
||||||
|
void SetFgColour(const wxColour& c);
|
||||||
|
const wxColour& GetFgColour() const;
|
||||||
|
void SetBgColour(const wxColour& c);
|
||||||
|
const wxColour& GetBgColour() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// HTML rendering customization. This class is used when rendering wxHtmlCells
|
||||||
|
// as a callback:
|
||||||
|
class wxHtmlRenderingStyle
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual wxColour GetSelectedTextColour(const wxColour& clr) = 0;
|
||||||
|
virtual wxColour GetSelectedTextBgColour(const wxColour& clr) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Standard style:
|
||||||
|
class wxDefaultHtmlRenderingStyle : public wxHtmlRenderingStyle
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual wxColour GetSelectedTextColour(const wxColour& clr);
|
||||||
|
virtual wxColour GetSelectedTextBgColour(const wxColour& clr);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Information given to cells when drawing them. Contains rendering state,
|
||||||
|
// selection information and rendering style object that can be used to
|
||||||
|
// customize the output.
|
||||||
|
class wxHtmlRenderingInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxHtmlRenderingInfo();
|
||||||
|
~wxHtmlRenderingInfo();
|
||||||
|
|
||||||
|
void SetSelection(wxHtmlSelection *s);
|
||||||
|
wxHtmlSelection *GetSelection() const;
|
||||||
|
|
||||||
|
void SetStyle(wxHtmlRenderingStyle *style);
|
||||||
|
wxHtmlRenderingStyle& GetStyle();
|
||||||
|
|
||||||
|
wxHtmlRenderingState& GetState();
|
||||||
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxHtmlCell : public wxObject {
|
class wxHtmlCell : public wxObject {
|
||||||
public:
|
public:
|
||||||
wxHtmlCell();
|
wxHtmlCell();
|
||||||
@@ -386,8 +483,10 @@ public:
|
|||||||
void SetParent(wxHtmlContainerCell *p);
|
void SetParent(wxHtmlContainerCell *p);
|
||||||
void SetPos(int x, int y);
|
void SetPos(int x, int y);
|
||||||
void Layout(int w);
|
void Layout(int w);
|
||||||
void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
|
void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2,
|
||||||
void DrawInvisible(wxDC& dc, int x, int y);
|
wxHtmlRenderingInfo& info);
|
||||||
|
void DrawInvisible(wxDC& dc, int x, int y,
|
||||||
|
wxHtmlRenderingInfo& info);
|
||||||
const wxHtmlCell* Find(int condition, const void* param);
|
const wxHtmlCell* Find(int condition, const void* param);
|
||||||
|
|
||||||
bool AdjustPagebreak(int* INOUT);
|
bool AdjustPagebreak(int* INOUT);
|
||||||
@@ -422,7 +521,8 @@ public:
|
|||||||
void SetBackgroundColour(const wxColour& clr);
|
void SetBackgroundColour(const wxColour& clr);
|
||||||
wxColour GetBackgroundColour();
|
wxColour GetBackgroundColour();
|
||||||
void SetBorder(const wxColour& clr1, const wxColour& clr2);
|
void SetBorder(const wxColour& clr1, const wxColour& clr2);
|
||||||
wxHtmlCell* GetFirstCell();
|
wxHtmlCell* GetFirstChild();
|
||||||
|
%pragma(python) addtoclass = "GetFirstCell = GetFirstChild"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -399,6 +399,7 @@ void wxInitAllImageHandlers();
|
|||||||
#if 0
|
#if 0
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
// See also wxPy_ReinitStockObjects in helpers.cpp
|
||||||
extern wxImage wxNullImage;
|
extern wxImage wxNullImage;
|
||||||
|
|
||||||
%readwrite
|
%readwrite
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
%{
|
%{
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include <wx/resource.h>
|
|
||||||
#include <wx/tooltip.h>
|
#include <wx/tooltip.h>
|
||||||
#include <wx/busyinfo.h>
|
#include <wx/busyinfo.h>
|
||||||
#include <wx/geometry.h>
|
#include <wx/geometry.h>
|
||||||
@@ -666,6 +665,7 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label);
|
|||||||
#if 0 // we want to use the definition from the header, not the
|
#if 0 // we want to use the definition from the header, not the
|
||||||
// one SWIG will generate.
|
// one SWIG will generate.
|
||||||
%}
|
%}
|
||||||
|
// See also wxPy_ReinitStockObjects in helpers.cpp
|
||||||
extern wxAcceleratorTable wxNullAcceleratorTable;
|
extern wxAcceleratorTable wxNullAcceleratorTable;
|
||||||
%{
|
%{
|
||||||
#endif
|
#endif
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
%{
|
%{
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "pyistream.h"
|
#include "pyistream.h"
|
||||||
#include <wx/resource.h>
|
|
||||||
#include <wx/tooltip.h>
|
#include <wx/tooltip.h>
|
||||||
#include <wx/caret.h>
|
#include <wx/caret.h>
|
||||||
#include <wx/tipdlg.h>
|
#include <wx/tipdlg.h>
|
||||||
@@ -34,7 +33,6 @@
|
|||||||
#include <wx/mimetype.h>
|
#include <wx/mimetype.h>
|
||||||
#include <wx/snglinst.h>
|
#include <wx/snglinst.h>
|
||||||
#include <wx/effects.h>
|
#include <wx/effects.h>
|
||||||
//#include <wx/spawnbrowser.h>
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@@ -1251,9 +1249,9 @@ public:
|
|||||||
%addmethods {
|
%addmethods {
|
||||||
// Get the icon corresponding to this file type
|
// Get the icon corresponding to this file type
|
||||||
%new wxIcon* GetIcon() {
|
%new wxIcon* GetIcon() {
|
||||||
wxIcon icon;
|
wxIconLocation loc;
|
||||||
if (self->GetIcon(&icon))
|
if (self->GetIcon(&loc))
|
||||||
return new wxIcon(icon);
|
return new wxIcon(loc);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1261,14 +1259,18 @@ public:
|
|||||||
// Get the icon corresponding to this file type, the name of the file
|
// Get the icon corresponding to this file type, the name of the file
|
||||||
// where this icon resides, and its index in this file if applicable.
|
// where this icon resides, and its index in this file if applicable.
|
||||||
PyObject* GetIconInfo() {
|
PyObject* GetIconInfo() {
|
||||||
wxIcon icon;
|
wxIconLocation loc;
|
||||||
wxString iconFile;
|
if (self->GetIcon(&loc)) {
|
||||||
int iconIndex;
|
wxString iconFile = loc.GetFileName();
|
||||||
if (self->GetIcon(&icon, &iconFile, &iconIndex)) {
|
int iconIndex = -1;
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
iconIndex = loc.GetIndex();
|
||||||
|
#endif
|
||||||
|
// Make a tuple and put the values in it
|
||||||
wxPyBeginBlockThreads();
|
wxPyBeginBlockThreads();
|
||||||
PyObject* tuple = PyTuple_New(3);
|
PyObject* tuple = PyTuple_New(3);
|
||||||
PyTuple_SetItem(tuple, 0, wxPyConstructObject(new wxIcon(icon),
|
PyTuple_SetItem(tuple, 0,
|
||||||
wxT("wxIcon"), TRUE));
|
wxPyConstructObject(new wxIcon(loc), wxT("wxIcon"), TRUE));
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
PyTuple_SetItem(tuple, 1, PyUnicode_FromWideChar(iconFile.c_str(), iconFile.Len()));
|
PyTuple_SetItem(tuple, 1, PyUnicode_FromWideChar(iconFile.c_str(), iconFile.Len()));
|
||||||
#else
|
#else
|
||||||
@@ -1470,6 +1472,7 @@ public:
|
|||||||
%{
|
%{
|
||||||
#if 0
|
#if 0
|
||||||
%}
|
%}
|
||||||
|
// See also wxPy_ReinitStockObjects in helpers.cpp
|
||||||
extern wxMimeTypesManager* wxTheMimeTypesManager;
|
extern wxMimeTypesManager* wxTheMimeTypesManager;
|
||||||
%{
|
%{
|
||||||
#endif
|
#endif
|
||||||
@@ -1627,9 +1630,8 @@ public:
|
|||||||
// Accessors
|
// Accessors
|
||||||
wxString GetHistoryFile(int i) const;
|
wxString GetHistoryFile(int i) const;
|
||||||
|
|
||||||
// A synonym for GetNoHistoryFiles
|
|
||||||
int GetCount() const;
|
int GetCount() const;
|
||||||
int GetNoHistoryFiles() const;
|
%pragma(python) addtoclass = "GetNoHistoryFiles = GetCount"
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user