Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 98825
Collapse All | Expand All

(-)wxPython-src-2.6.0.0/wxPython/include/wx/wxPython/wxPython_int.h (+47 lines)
Lines 127-133 Link Here
127
PyObject* wxPyMake_wxSizer(wxSizer* source, bool setThisOwn);
127
PyObject* wxPyMake_wxSizer(wxSizer* source, bool setThisOwn);
128
void      wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName);
128
void      wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName);
129
129
130
#ifndef wxUSE_STL
130
PyObject* wxPy_ConvertList(wxListBase* list);
131
PyObject* wxPy_ConvertList(wxListBase* list);
132
#endif
133
131
long      wxPyGetWinHandle(wxWindow* win);
134
long      wxPyGetWinHandle(wxWindow* win);
132
135
133
void wxPy_ReinitStockObjects(int pass);
136
void wxPy_ReinitStockObjects(int pass);
Lines 178-183 Link Here
178
wxPyBlock_t wxPyBeginBlockThreads();
181
wxPyBlock_t wxPyBeginBlockThreads();
179
void wxPyEndBlockThreads(wxPyBlock_t blocked);
182
void wxPyEndBlockThreads(wxPyBlock_t blocked);
180
183
184
#ifdef wxUSE_STL
185
template <class T> 
186
PyObject* wxPy_ConvertList(std::list<T*>* list)
187
{
188
    PyObject*   pyList;
189
    PyObject*   pyObj;
190
    wxObject*   wxObj;
191
192
    wxPyBlock_t blocked = wxPyBeginBlockThreads();
193
    pyList = PyList_New(0);
194
    for(typename std::list<T*>::iterator it=list->begin(); it!=list->end(); ++it)
195
    {
196
        wxObj = *it;
197
        pyObj = wxPyMake_wxObject(wxObj,false);
198
        PyList_Append(pyList, pyObj);
199
    }
200
    wxPyEndBlockThreads(blocked);
201
    return pyList;
202
}
203
204
template <class T> 
205
PyObject* wxPy_ConvertList(std::list<T>* list)
206
{
207
    PyObject*   pyList;
208
    PyObject*   pyObj;
209
    wxObject*   wxObj;
210
211
    wxPyBlock_t blocked = wxPyBeginBlockThreads();
212
    pyList = PyList_New(0);
213
    for(typename std::list<T>::iterator it=list->begin(); it!=list->end(); ++it)
214
    {
215
        wxObj = &*it;
216
        pyObj = wxPyMake_wxObject(wxObj,false);
217
        PyList_Append(pyList, pyObj);
218
    }
219
    wxPyEndBlockThreads(blocked);
220
    return pyList;
221
}
222
#endif // wxUSE_STL
223
181
#endif // wxPyUSE_EXPORTED_API
224
#endif // wxPyUSE_EXPORTED_API
182
225
183
226
Lines 376-382 Link Here
376
    wxPyBlock_t         (*p_wxPyBeginBlockThreads)();
419
    wxPyBlock_t         (*p_wxPyBeginBlockThreads)();
377
    void                (*p_wxPyEndBlockThreads)(wxPyBlock_t blocked);
420
    void                (*p_wxPyEndBlockThreads)(wxPyBlock_t blocked);
378
421
422
#ifdef wxUSE_STL
423
    PyObject*           (*p_wxPy_ConvertList)(std::list<wxObject>* list);
424
#else
379
    PyObject*           (*p_wxPy_ConvertList)(wxListBase* list);
425
    PyObject*           (*p_wxPy_ConvertList)(wxListBase* list);
426
#endif
380
427
381
    wxString*           (*p_wxString_in_helper)(PyObject* source);
428
    wxString*           (*p_wxString_in_helper)(PyObject* source);
382
    wxString            (*p_Py2wxString)(PyObject* source);
429
    wxString            (*p_Py2wxString)(PyObject* source);
(-)wxPython-src-2.6.0.0/wxPython/src/helpers.cpp (+2 lines)
Lines 1904-1909 Link Here
1904
//---------------------------------------------------------------------------
1904
//---------------------------------------------------------------------------
1905
// Convert a wxList to a Python List, only works for lists of wxObjects
1905
// Convert a wxList to a Python List, only works for lists of wxObjects
1906
1906
1907
#ifndef wxUSE_STL
1907
PyObject* wxPy_ConvertList(wxListBase* listbase) {
1908
PyObject* wxPy_ConvertList(wxListBase* listbase) {
1908
    wxList*     list = (wxList*)listbase;  // this is probably bad...
1909
    wxList*     list = (wxList*)listbase;  // this is probably bad...
1909
    PyObject*   pyList;
1910
    PyObject*   pyList;
Lines 1922-1927 Link Here
1922
    wxPyEndBlockThreads(blocked);
1923
    wxPyEndBlockThreads(blocked);
1923
    return pyList;
1924
    return pyList;
1924
}
1925
}
1926
#endif // wxUSE_STL
1925
1927
1926
//----------------------------------------------------------------------
1928
//----------------------------------------------------------------------
1927
1929

Return to bug 98825