SWIGged code updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12510 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2001-11-20 06:30:33 +00:00
parent 0a8c1efb27
commit 80cb3dbc36
8 changed files with 89 additions and 9 deletions

View File

@ -693,6 +693,22 @@ SWIGEXPORT(void) initglcanvasc() {
SWIG_globals = SWIG_newvarlink();
m = Py_InitModule("glcanvasc", glcanvascMethods);
d = PyModule_GetDict(m);
PyDict_SetItemString(d,"WX_GL_RGBA", PyInt_FromLong((long) WX_GL_RGBA));
PyDict_SetItemString(d,"WX_GL_BUFFER_SIZE", PyInt_FromLong((long) WX_GL_BUFFER_SIZE));
PyDict_SetItemString(d,"WX_GL_LEVEL", PyInt_FromLong((long) WX_GL_LEVEL));
PyDict_SetItemString(d,"WX_GL_DOUBLEBUFFER", PyInt_FromLong((long) WX_GL_DOUBLEBUFFER));
PyDict_SetItemString(d,"WX_GL_STEREO", PyInt_FromLong((long) WX_GL_STEREO));
PyDict_SetItemString(d,"WX_GL_AUX_BUFFERS", PyInt_FromLong((long) WX_GL_AUX_BUFFERS));
PyDict_SetItemString(d,"WX_GL_MIN_RED", PyInt_FromLong((long) WX_GL_MIN_RED));
PyDict_SetItemString(d,"WX_GL_MIN_GREEN", PyInt_FromLong((long) WX_GL_MIN_GREEN));
PyDict_SetItemString(d,"WX_GL_MIN_BLUE", PyInt_FromLong((long) WX_GL_MIN_BLUE));
PyDict_SetItemString(d,"WX_GL_MIN_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ALPHA));
PyDict_SetItemString(d,"WX_GL_DEPTH_SIZE", PyInt_FromLong((long) WX_GL_DEPTH_SIZE));
PyDict_SetItemString(d,"WX_GL_STENCIL_SIZE", PyInt_FromLong((long) WX_GL_STENCIL_SIZE));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_RED", PyInt_FromLong((long) WX_GL_MIN_ACCUM_RED));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_GREEN", PyInt_FromLong((long) WX_GL_MIN_ACCUM_GREEN));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_BLUE", PyInt_FromLong((long) WX_GL_MIN_ACCUM_BLUE));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA));
wxClassInfo::CleanUpClasses();

View File

@ -15,6 +15,8 @@ from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
@ -38,8 +40,6 @@ from printfw import *
from sizers import *
from filesys import *
from utils import *
import wx
class wxGLContextPtr(wxObjectPtr):
def __init__(self,this):
@ -111,3 +111,19 @@ def wxGLCanvasWithContext(*_args,**_kwargs):
#-------------- VARIABLE WRAPPERS ------------------
WX_GL_RGBA = glcanvasc.WX_GL_RGBA
WX_GL_BUFFER_SIZE = glcanvasc.WX_GL_BUFFER_SIZE
WX_GL_LEVEL = glcanvasc.WX_GL_LEVEL
WX_GL_DOUBLEBUFFER = glcanvasc.WX_GL_DOUBLEBUFFER
WX_GL_STEREO = glcanvasc.WX_GL_STEREO
WX_GL_AUX_BUFFERS = glcanvasc.WX_GL_AUX_BUFFERS
WX_GL_MIN_RED = glcanvasc.WX_GL_MIN_RED
WX_GL_MIN_GREEN = glcanvasc.WX_GL_MIN_GREEN
WX_GL_MIN_BLUE = glcanvasc.WX_GL_MIN_BLUE
WX_GL_MIN_ALPHA = glcanvasc.WX_GL_MIN_ALPHA
WX_GL_DEPTH_SIZE = glcanvasc.WX_GL_DEPTH_SIZE
WX_GL_STENCIL_SIZE = glcanvasc.WX_GL_STENCIL_SIZE
WX_GL_MIN_ACCUM_RED = glcanvasc.WX_GL_MIN_ACCUM_RED
WX_GL_MIN_ACCUM_GREEN = glcanvasc.WX_GL_MIN_ACCUM_GREEN
WX_GL_MIN_ACCUM_BLUE = glcanvasc.WX_GL_MIN_ACCUM_BLUE
WX_GL_MIN_ACCUM_ALPHA = glcanvasc.WX_GL_MIN_ACCUM_ALPHA

View File

@ -9736,6 +9736,7 @@ SWIGEXPORT(void) initcontrols2c() {
PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_BEGIN_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_BEGIN_DRAG));
PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_DRAGGING", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_DRAGGING));
PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_END_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_END_DRAG));
PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_FOCUSED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_FOCUSED));
PyDict_SetItemString(d,"wxLC_VRULES", PyInt_FromLong((long) wxLC_VRULES));
PyDict_SetItemString(d,"wxLC_HRULES", PyInt_FromLong((long) wxLC_HRULES));
PyDict_SetItemString(d,"wxLC_ICON", PyInt_FromLong((long) wxLC_ICON));

View File

@ -77,6 +77,9 @@ def EVT_LIST_ITEM_ACTIVATED(win, id, func):
def EVT_LIST_CACHE_HINT(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_LIST_CACHE_HINT, func)
def EVT_LIST_ITEM_FOCUSED(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_FOCUSED, func)
# wxTreeCtrl events
def EVT_TREE_BEGIN_DRAG(win, id, func):
@ -1126,6 +1129,7 @@ wxEVT_COMMAND_LIST_COL_RIGHT_CLICK = controls2c.wxEVT_COMMAND_LIST_COL_RIGHT_CLI
wxEVT_COMMAND_LIST_COL_BEGIN_DRAG = controls2c.wxEVT_COMMAND_LIST_COL_BEGIN_DRAG
wxEVT_COMMAND_LIST_COL_DRAGGING = controls2c.wxEVT_COMMAND_LIST_COL_DRAGGING
wxEVT_COMMAND_LIST_COL_END_DRAG = controls2c.wxEVT_COMMAND_LIST_COL_END_DRAG
wxEVT_COMMAND_LIST_ITEM_FOCUSED = controls2c.wxEVT_COMMAND_LIST_ITEM_FOCUSED
wxLC_VRULES = controls2c.wxLC_VRULES
wxLC_HRULES = controls2c.wxLC_HRULES
wxLC_ICON = controls2c.wxLC_ICON

View File

@ -469,6 +469,41 @@ static PyObject *_wrap_wxEvent_Skip(PyObject *self, PyObject *args, PyObject *kw
return _resultobj;
}
#define wxEvent_Clone(_swigobj) (_swigobj->Clone())
static PyObject *_wrap_wxEvent_Clone(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxEvent * _result;
wxEvent * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEvent_Clone",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvent_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_Clone. Expected _wxEvent_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxEvent *)wxEvent_Clone(_arg0);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxEvent_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
static void *SwigwxSizeEventTowxEvent(void *ptr) {
wxSizeEvent *src;
wxEvent *dest;
@ -7179,6 +7214,7 @@ static PyMethodDef eventscMethods[] = {
{ "new_wxCloseEvent", (PyCFunction) _wrap_new_wxCloseEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxSizeEvent_GetSize", (PyCFunction) _wrap_wxSizeEvent_GetSize, METH_VARARGS | METH_KEYWORDS },
{ "new_wxSizeEvent", (PyCFunction) _wrap_new_wxSizeEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxEvent_Clone", (PyCFunction) _wrap_wxEvent_Clone, METH_VARARGS | METH_KEYWORDS },
{ "wxEvent_Skip", (PyCFunction) _wrap_wxEvent_Skip, METH_VARARGS | METH_KEYWORDS },
{ "wxEvent_SetTimestamp", (PyCFunction) _wrap_wxEvent_SetTimestamp, METH_VARARGS | METH_KEYWORDS },
{ "wxEvent_SetId", (PyCFunction) _wrap_wxEvent_SetId, METH_VARARGS | METH_KEYWORDS },

View File

@ -41,6 +41,10 @@ class wxEventPtr(wxObjectPtr):
def Skip(self, *_args, **_kwargs):
val = apply(eventsc.wxEvent_Skip,(self,) + _args, _kwargs)
return val
def Clone(self, *_args, **_kwargs):
val = apply(eventsc.wxEvent_Clone,(self,) + _args, _kwargs)
if val: val = wxEventPtr(val)
return val
def __repr__(self):
return "<C wxEvent instance at %s>" % (self.this,)
class wxEvent(wxEventPtr):

View File

@ -190,13 +190,16 @@ public:
{ m_dash = NULL; }
~wxPyPen() {
if (m_dash)
delete m_dash;
delete [] m_dash;
}
void SetDashes(int nb_dashes, const wxDash *dash) {
if (m_dash)
delete [] m_dash;
m_dash = new wxDash[nb_dashes];
for (int i=0; i<nb_dashes; i++)
for (int i=0; i<nb_dashes; i++) {
m_dash[i] = dash[i];
}
wxPen::SetDashes(nb_dashes, m_dash);
}

View File

@ -235,7 +235,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
#define PYCALLBACK_BOOL_INTINTSTRING(PCLASS, CBNAME) \
bool CBNAME(int a, int b, const wxString& c) { \
bool rval; \
bool rval = 0; \
bool found; \
wxPyTState* state = wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
@ -272,7 +272,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
#define PYCALLBACK_BOOL_INTINT(PCLASS, CBNAME) \
bool CBNAME(int a, int b) { \
bool rval; \
bool rval = 0; \
bool found; \
wxPyTState* state = wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
@ -332,7 +332,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
#define PYCALLBACK_BOOL_SIZETSIZET(PCLASS, CBNAME) \
bool CBNAME(size_t a, size_t b) { \
bool rval; \
bool rval = 0; \
bool found; \
wxPyTState* state = wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
@ -350,7 +350,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
#define PYCALLBACK_BOOL_SIZET(PCLASS, CBNAME) \
bool CBNAME(size_t a) { \
bool rval; \
bool rval = 0; \
bool found; \
wxPyTState* state = wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
@ -410,7 +410,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
#define PYCALLBACK_BOOL_(PCLASS, CBNAME) \
bool CBNAME() { \
bool rval; \
bool rval = 0; \
bool found; \
wxPyTState* state = wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \