-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();
- }
+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);