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:
Robin Dunn 2003-07-18 02:26:53 +00:00
parent fd657b8a59
commit dd116e73f0
22 changed files with 1923 additions and 197 deletions

View File

@ -748,7 +748,7 @@ if BUILD_OGL:
'%s/composit.cpp' % OGLLOC,
'%s/divided.cpp' % OGLLOC,
'%s/lines.cpp' % OGLLOC,
'%s/misc.cpp' % OGLLOC,
'%s/oglmisc.cpp' % OGLLOC,
'%s/basic2.cpp' % OGLLOC,
'%s/canvas.cpp' % OGLLOC,
'%s/constrnt.cpp' % OGLLOC,
@ -758,7 +758,7 @@ if BUILD_OGL:
] + swig_sources,
include_dirs = [OGLINC] + includes,
define_macros = defines,
define_macros = defines + [('wxUSE_DEPRECATED', '0')],
library_dirs = libdirs,
libraries = libs,

View File

@ -970,6 +970,15 @@ of your Mac."""
if redirect:
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
_wxStart(self.OnInit)

View File

@ -418,12 +418,10 @@ public:
void UsePrimarySelection( int primary = FALSE );
};
%{
// See below in the init function...
wxClipboard* wxPyTheClipboard;
%}
%readonly
%name(wxTheClipboard) wxClipboard* wxPyTheClipboard;
// See also wxPy_ReinitStockObjects in helpers.cpp
extern wxClipboard* wxTheClipboard;
%readwrite
//----------------------------------------------------------------------
@ -674,7 +672,6 @@ public:
%init %{
wxPyTheClipboard = wxTheClipboard;
wxPyPtrTypeMap_Add("wxDropSource", "wxPyDropSource");
wxPyPtrTypeMap_Add("wxTextDropTarget", "wxPyTextDropTarget");
wxPyPtrTypeMap_Add("wxFileDropTarget", "wxPyFileDropTarget");

View File

@ -49,6 +49,7 @@
//----------------------------------------------------------------------
%readonly
// See also wxPy_ReinitStockObjects in helpers.cpp
wxValidator wxDefaultValidator;
%readwrite

View File

@ -141,13 +141,23 @@ public:
static void AddHandler(wxFileSystemHandler *handler);
static void CleanUpHandlers();
// // Returns the native path for a file URL
// static wxFileName URLToFileName(const wxString& url);
// Returns the file URL for a native path
static wxString FileNameToURL(const wxString& filename);
// // Returns the file URL for a native path
// static wxString FileNameToURL(const wxFileName& filename);
// Returns the native path for a file URL
//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 {

View File

@ -432,31 +432,20 @@ public:
class wxColourDatabase : public wxObject {
public:
wxColour *FindColour(const wxString& colour);
wxColour *FindColour(const wxString& colour) ;
wxColour *FindColourNoAdd(const wxString& colour) const;
wxString FindName(const wxColour& colour) const;
%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) {
// first see if the name is already there
wxString cName = name;
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));
wxColour* c = new wxColour(red, green, blue);
self->AddColour(name, c);
}
}
};
@ -1164,6 +1153,8 @@ public:
#if 0
%}
// See also wxPy_ReinitStockObjects in helpers.cpp
extern wxFont *wxNORMAL_FONT;
extern wxFont *wxSMALL_FONT;
extern wxFont *wxITALIC_FONT;

View File

@ -196,9 +196,7 @@ void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
}
wxPyEndBlockThreads();
}
// See below in the init function...
wxClipboard* wxPyTheClipboard;
extern wxClipboard * wxTheClipboard;
class wxPyDropSource : public wxDropSource {
public:
@ -364,17 +362,17 @@ static PyObject *_wrap_wxPyFormatInvalid_get() {
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.");
return 1;
}
static PyObject *_wrap_wxPyTheClipboard_get() {
static PyObject *_wrap_wxTheClipboard_get() {
PyObject * pyobj;
char ptemp[128];
SWIG_MakePtr(ptemp, (char *) wxPyTheClipboard,"_wxClipboard_p");
SWIG_MakePtr(ptemp, (char *) wxTheClipboard,"_wxClipboard_p");
pyobj = PyString_FromString(ptemp);
return pyobj;
}
@ -3679,7 +3677,7 @@ SWIGEXPORT(void) initclip_dndc() {
PyDict_SetItemString(d,"wxDF_MAX", PyInt_FromLong((long) wxDF_MAX));
PyDict_SetItemString(d,"cvar", SWIG_globals);
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_AllowMove", PyInt_FromLong((long) wxDrag_AllowMove));
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));
wxPyTheClipboard = wxTheClipboard;
wxPyPtrTypeMap_Add("wxDropSource", "wxPyDropSource");
wxPyPtrTypeMap_Add("wxTextDropTarget", "wxPyTextDropTarget");
wxPyPtrTypeMap_Add("wxFileDropTarget", "wxPyFileDropTarget");

View File

@ -128,6 +128,11 @@ IMP_PYCALLBACK_FSF_FSSTRING_pure(wxPyFileSystemHandler, wxFileSystemHandler, Ope
IMP_PYCALLBACK_STRING_STRINGINT_pure(wxPyFileSystemHandler, wxFileSystemHandler, FindFirst);
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,
wxImage& image,
long type) {
@ -151,6 +156,44 @@ void __wxMemoryFSHandler_AddFile_Data(const wxString& filename,
#ifdef __cplusplus
extern "C" {
#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) {
PyObject * _resultobj;
wxString * _arg0;
@ -1311,6 +1354,44 @@ static PyObject *_wrap_wxFileSystem_CleanUpHandlers(PyObject *self, PyObject *ar
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) {
wxInternetFSHandler *src;
wxFileSystemHandler *dest;
@ -1911,6 +1992,7 @@ static PyMethodDef filesyscMethods[] = {
{ "wxInternetFSHandler_OpenFile", (PyCFunction) _wrap_wxInternetFSHandler_OpenFile, METH_VARARGS | METH_KEYWORDS },
{ "wxInternetFSHandler_CanOpen", (PyCFunction) _wrap_wxInternetFSHandler_CanOpen, 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_AddHandler", (PyCFunction) _wrap_wxFileSystem_AddHandler, 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_wxBitmap", (PyCFunction) _wrap___wxMemoryFSHandler_AddFile_wxBitmap, 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 }
};
#ifdef __cplusplus

View File

@ -218,6 +218,8 @@ class wxMemoryFSHandler(wxMemoryFSHandlerPtr):
#-------------- FUNCTION WRAPPERS ------------------
wxFileSystem_URLToFileName = filesysc.wxFileSystem_URLToFileName
__wxMemoryFSHandler_AddFile_wxImage = filesysc.__wxMemoryFSHandler_AddFile_wxImage
__wxMemoryFSHandler_AddFile_wxBitmap = filesysc.__wxMemoryFSHandler_AddFile_wxBitmap
@ -228,6 +230,8 @@ wxFileSystem_AddHandler = filesysc.wxFileSystem_AddHandler
wxFileSystem_CleanUpHandlers = filesysc.wxFileSystem_CleanUpHandlers
wxFileSystem_FileNameToURL = filesysc.wxFileSystem_FileNameToURL
wxMemoryFSHandler_RemoveFile = filesysc.wxMemoryFSHandler_RemoveFile

View File

@ -3275,6 +3275,52 @@ static PyObject *_wrap_wxColourDatabase_FindColour(PyObject *self, PyObject *arg
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))
static PyObject *_wrap_wxColourDatabase_FindName(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@ -3320,27 +3366,60 @@ static PyObject *_wrap_wxColourDatabase_FindName(PyObject *self, PyObject *args,
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) {
// first see if the name is already there
wxString cName = name;
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));
wxColour* c = new wxColour(red, green, blue);
self->AddColour(name, c);
}
static PyObject *_wrap_wxColourDatabase_Append(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@ -10874,7 +10953,9 @@ static PyMethodDef gdicMethods[] = {
{ "delete_wxPen", (PyCFunction) _wrap_delete_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_AddColour", (PyCFunction) _wrap_wxColourDatabase_AddColour, 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 },
{ "wxColour___ne__", (PyCFunction) _wrap_wxColour___ne__, METH_VARARGS | METH_KEYWORDS },
{ "wxColour___eq__", (PyCFunction) _wrap_wxColour___eq__, METH_VARARGS | METH_KEYWORDS },

View File

@ -294,9 +294,16 @@ class wxColourDatabasePtr(wxObjectPtr):
val = gdic.wxColourDatabase_FindColour(self, *_args, **_kwargs)
if val: val = wxColourPtr(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):
val = gdic.wxColourDatabase_FindName(self, *_args, **_kwargs)
return val
def AddColour(self, *_args, **_kwargs):
val = gdic.wxColourDatabase_AddColour(self, *_args, **_kwargs)
return val
def Append(self, *_args, **_kwargs):
val = gdic.wxColourDatabase_Append(self, *_args, **_kwargs)
return val

File diff suppressed because it is too large Load Diff

View File

@ -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):
def __init__(self,this):
self.this = this
@ -460,12 +642,13 @@ class wxHtmlContainerCellPtr(wxHtmlCellPtr):
def SetBorder(self, *_args, **_kwargs):
val = htmlc.wxHtmlContainerCell_SetBorder(self, *_args, **_kwargs)
return val
def GetFirstCell(self, *_args, **_kwargs):
val = htmlc.wxHtmlContainerCell_GetFirstCell(self, *_args, **_kwargs)
def GetFirstChild(self, *_args, **_kwargs):
val = htmlc.wxHtmlContainerCell_GetFirstChild(self, *_args, **_kwargs)
if val: val = wxHtmlCellPtr(val)
return val
def __repr__(self):
return "<%s.%s instance; proxy of C++ wxHtmlContainerCell instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
GetFirstCell = GetFirstChild
class wxHtmlContainerCell(wxHtmlContainerCellPtr):
def __init__(self,*_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_IMAGE = htmlc.wxHTML_URL_IMAGE
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_EVEN = htmlc.wxPAGE_EVEN
wxPAGE_ALL = htmlc.wxPAGE_ALL

View File

@ -55,7 +55,6 @@ extern PyObject *SWIG_newvarlink(void);
#define SWIG_name "miscc"
#include "helpers.h"
#include <wx/resource.h>
#include <wx/tooltip.h>
#include <wx/busyinfo.h>
#include <wx/geometry.h>

View File

@ -56,7 +56,6 @@ extern PyObject *SWIG_newvarlink(void);
#include "helpers.h"
#include "pyistream.h"
#include <wx/resource.h>
#include <wx/tooltip.h>
#include <wx/caret.h>
#include <wx/tipdlg.h>
@ -73,7 +72,6 @@ extern PyObject *SWIG_newvarlink(void);
#include <wx/mimetype.h>
#include <wx/snglinst.h>
#include <wx/effects.h>
//#include <wx/spawnbrowser.h>
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) {
wxIcon icon;
if (self->GetIcon(&icon))
return new wxIcon(icon);
wxIconLocation loc;
if (self->GetIcon(&loc))
return new wxIcon(loc);
else
return NULL;
}
@ -8634,14 +8632,18 @@ static PyObject *_wrap_wxFileType_GetIcon(PyObject *self, PyObject *args, PyObje
}
static PyObject * wxFileType_GetIconInfo(wxFileType *self) {
wxIcon icon;
wxString iconFile;
int iconIndex;
if (self->GetIcon(&icon, &iconFile, &iconIndex)) {
wxIconLocation loc;
if (self->GetIcon(&loc)) {
wxString iconFile = loc.GetFileName();
int iconIndex = -1;
#ifdef __WXMSW__
iconIndex = loc.GetIndex();
#endif
// Make a tuple and put the values in it
wxPyBeginBlockThreads();
PyObject* tuple = PyTuple_New(3);
PyTuple_SetItem(tuple, 0, wxPyConstructObject(new wxIcon(icon),
wxT("wxIcon"), TRUE));
PyTuple_SetItem(tuple, 0,
wxPyConstructObject(new wxIcon(loc), wxT("wxIcon"), TRUE));
#if wxUSE_UNICODE
PyTuple_SetItem(tuple, 1, PyUnicode_FromWideChar(iconFile.c_str(), iconFile.Len()));
#else
@ -10282,34 +10284,6 @@ static PyObject *_wrap_wxFileHistory_GetCount(PyObject *self, PyObject *args, Py
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) {
wxEffects *src;
wxObject *dest;
@ -11041,7 +11015,6 @@ static PyMethodDef misc2cMethods[] = {
{ "wxEffects_GetLightShadow", (PyCFunction) _wrap_wxEffects_GetLightShadow, METH_VARARGS | METH_KEYWORDS },
{ "wxEffects_GetHighlightColour", (PyCFunction) _wrap_wxEffects_GetHighlightColour, 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_GetHistoryFile", (PyCFunction) _wrap_wxFileHistory_GetHistoryFile, METH_VARARGS | METH_KEYWORDS },
{ "wxFileHistory_AddFilesToThisMenu", (PyCFunction) _wrap_wxFileHistory_AddFilesToThisMenu, METH_VARARGS | METH_KEYWORDS },

View File

@ -1060,11 +1060,9 @@ class wxFileHistoryPtr(wxObjectPtr):
def GetCount(self, *_args, **_kwargs):
val = misc2c.wxFileHistory_GetCount(self, *_args, **_kwargs)
return val
def GetNoHistoryFiles(self, *_args, **_kwargs):
val = misc2c.wxFileHistory_GetNoHistoryFiles(self, *_args, **_kwargs)
return val
def __repr__(self):
return "<%s.%s instance; proxy of C++ wxFileHistory instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
GetNoHistoryFiles = GetCount
class wxFileHistory(wxFileHistoryPtr):
def __init__(self,*_args,**_kwargs):
self.this = misc2c.new_wxFileHistory(*_args,**_kwargs)

View File

@ -28,6 +28,9 @@
#include <wx/gtk/win_gtk.h>
#endif
#include <wx/clipbrd.h>
#include <wx/mimetype.h>
//----------------------------------------------------------------------
#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
bool wxPyDoCleanup = FALSE;
bool wxPyDoingCleanup = FALSE;
@ -334,6 +329,7 @@ void wxPyApp::SetMacHelpMenuTitleName(const wxString& val) {
//----------------------------------------------------------------------
#if 0
static char* wxPyCopyCString(const wxChar* src)
{
wxWX2MBbuf buff = (wxWX2MBbuf)wxConvCurrent->cWX2MB(src);
@ -366,13 +362,13 @@ static wxChar* wxPyCopyWString(const wxChar *src)
return copystring(src);
}
#endif
#endif
//----------------------------------------------------------------------
// This is where we pick up the first part of the wxEntry functionality...
// The rest is in __wxStart and __wxCleanup. This function is called when
// wxcmodule is imported. (Before there is a wxApp object.)
// This function is called when the wxc module is imported to do some initial
// setup. (Before there is a wxApp object.)
void __wxPreStart(PyObject* moduleDict)
{
@ -386,25 +382,32 @@ void __wxPreStart(PyObject* moduleDict)
wxPyTMutex = new wxMutex;
#endif
// Restore default signal handlers, (prevents crash upon Ctrl-C in the
// console that launched a wxPython app...)
PyOS_FiniInterrupts();
// Ensure that the build options in the DLL (or whatever) match this build
wxApp::CheckBuildOptions(wxBuildOptions());
// Create an exception object to use for wxASSERTions
wxPyAssertionError = PyErr_NewException("wxPython.wxc.wxPyAssertionError",
PyExc_AssertionError, NULL);
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;
char** argv = NULL;
PyObject* sysargv = PySys_GetObject("argv");
@ -412,50 +415,27 @@ void __wxPreStart(PyObject* moduleDict)
argc = PyList_Size(sysargv);
argv = new char*[argc+1];
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++) {
PyObject *pyArg = PyList_GetItem(sysargv, x);
argv[x] = wxPyCopyWString(Py2wxString(pyArg));
argv[x] = PyString_AsString(pyArg);
}
argv[argc] = NULL;
}
wxPythonApp->argc = argc;
wxPythonApp->argv = argv;
if (! wxEntryStart(argc, 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);
result = PyEval_CallObject(onInitFunc, arglist);
Py_DECREF(arglist);
@ -463,7 +443,7 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args)
return NULL;
}
PyObject* pyint = PyNumber_Int(result);
pyint = PyNumber_Int(result);
if (! pyint) {
PyErr_SetString(PyExc_TypeError, "OnInit should return a boolean value");
goto error;
@ -490,6 +470,7 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args)
}
void __wxCleanup() {
wxPyDoingCleanup = TRUE;
if (wxPyDoCleanup)
@ -552,6 +533,102 @@ PyObject* __wxSetDictionary(PyObject* /* self */, PyObject* args)
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) {

View File

@ -48,6 +48,9 @@ void wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName);
PyObject* wxPy_ConvertList(wxListBase* list, const char* className);
long wxPyGetWinHandle(wxWindow* win);
void wxPy_ReinitStockObjects();
//----------------------------------------------------------------------
// if we want to handle threads and Python threads are available...

View File

@ -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 {
public:
wxHtmlCell();
@ -386,8 +483,10 @@ public:
void SetParent(wxHtmlContainerCell *p);
void SetPos(int x, int y);
void Layout(int w);
void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
void DrawInvisible(wxDC& dc, int x, int y);
void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2,
wxHtmlRenderingInfo& info);
void DrawInvisible(wxDC& dc, int x, int y,
wxHtmlRenderingInfo& info);
const wxHtmlCell* Find(int condition, const void* param);
bool AdjustPagebreak(int* INOUT);
@ -422,7 +521,8 @@ public:
void SetBackgroundColour(const wxColour& clr);
wxColour GetBackgroundColour();
void SetBorder(const wxColour& clr1, const wxColour& clr2);
wxHtmlCell* GetFirstCell();
wxHtmlCell* GetFirstChild();
%pragma(python) addtoclass = "GetFirstCell = GetFirstChild"
};

View File

@ -399,6 +399,7 @@ void wxInitAllImageHandlers();
#if 0
%}
// See also wxPy_ReinitStockObjects in helpers.cpp
extern wxImage wxNullImage;
%readwrite

View File

@ -14,7 +14,6 @@
%{
#include "helpers.h"
#include <wx/resource.h>
#include <wx/tooltip.h>
#include <wx/busyinfo.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
// one SWIG will generate.
%}
// See also wxPy_ReinitStockObjects in helpers.cpp
extern wxAcceleratorTable wxNullAcceleratorTable;
%{
#endif

View File

@ -17,7 +17,6 @@
%{
#include "helpers.h"
#include "pyistream.h"
#include <wx/resource.h>
#include <wx/tooltip.h>
#include <wx/caret.h>
#include <wx/tipdlg.h>
@ -34,7 +33,6 @@
#include <wx/mimetype.h>
#include <wx/snglinst.h>
#include <wx/effects.h>
//#include <wx/spawnbrowser.h>
%}
//----------------------------------------------------------------------
@ -1251,9 +1249,9 @@ public:
%addmethods {
// Get the icon corresponding to this file type
%new wxIcon* GetIcon() {
wxIcon icon;
if (self->GetIcon(&icon))
return new wxIcon(icon);
wxIconLocation loc;
if (self->GetIcon(&loc))
return new wxIcon(loc);
else
return NULL;
}
@ -1261,14 +1259,18 @@ public:
// 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.
PyObject* GetIconInfo() {
wxIcon icon;
wxString iconFile;
int iconIndex;
if (self->GetIcon(&icon, &iconFile, &iconIndex)) {
wxIconLocation loc;
if (self->GetIcon(&loc)) {
wxString iconFile = loc.GetFileName();
int iconIndex = -1;
#ifdef __WXMSW__
iconIndex = loc.GetIndex();
#endif
// Make a tuple and put the values in it
wxPyBeginBlockThreads();
PyObject* tuple = PyTuple_New(3);
PyTuple_SetItem(tuple, 0, wxPyConstructObject(new wxIcon(icon),
wxT("wxIcon"), TRUE));
PyTuple_SetItem(tuple, 0,
wxPyConstructObject(new wxIcon(loc), wxT("wxIcon"), TRUE));
#if wxUSE_UNICODE
PyTuple_SetItem(tuple, 1, PyUnicode_FromWideChar(iconFile.c_str(), iconFile.Len()));
#else
@ -1470,6 +1472,7 @@ public:
%{
#if 0
%}
// See also wxPy_ReinitStockObjects in helpers.cpp
extern wxMimeTypesManager* wxTheMimeTypesManager;
%{
#endif
@ -1627,9 +1630,8 @@ public:
// Accessors
wxString GetHistoryFile(int i) const;
// A synonym for GetNoHistoryFiles
int GetCount() const;
int GetNoHistoryFiles() const;
%pragma(python) addtoclass = "GetNoHistoryFiles = GetCount"
};