-%typemap(out) ListDicomDirPatient & {
- PyObject* NewItem = (PyObject*)0;
- $result = PyList_New(0); // The result of this typemap
-
- for (std::list<gdcm::DicomDirPatient *>::iterator New = ($1)->begin();
- New != ($1)->end(); ++New) {
- NewItem = SWIG_NewPointerObj(*New,SWIGTYPE_p_DicomDirPatient,1);
- PyList_Append($result, NewItem);
- }
-}
-
-%typemap(out) ListDicomDirStudy & {
- PyObject* NewItem = (PyObject*)0;
- $result = PyList_New(0); // The result of this typemap
-
- for (std::list<gdcm::DicomDirStudy *>::iterator New = ($1)->begin();
- New != ($1)->end(); ++New) {
- NewItem = SWIG_NewPointerObj(*New,SWIGTYPE_p_DicomDirStudy,1);
- PyList_Append($result, NewItem);
- }
-}
-
-%typemap(out) ListDicomDirSerie & {
- PyObject* NewItem = (PyObject*)0;
- $result = PyList_New(0); // The result of this typemap
-
- for (std::list<gdcm::DicomDirSerie *>::iterator New = ($1)->begin();
- New != ($1)->end(); ++New) {
- NewItem = SWIG_NewPointerObj(*New,SWIGTYPE_p_DicomDirSerie,1);
- PyList_Append($result, NewItem);
- }
-}
-
-%typemap(out) ListDicomDirImage & {
- PyObject* NewItem = (PyObject*)0;
- $result = PyList_New(0); // The result of this typemap
-
- for (std::list<gdcm::DicomDirImage *>::iterator New = ($1)->begin();
- New != ($1)->end(); ++New) {
- NewItem = SWIG_NewPointerObj(*New,SWIGTYPE_p_DicomDirImage,1);
- PyList_Append($result, NewItem);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////
-// Deals with function returning a C++ string.
-%typemap(python, in) (gdcm::Method *,void * =NULL,gdcm::Method * =NULL) {
+// Multi-argument typemap designed for wrapping the progress related methods
+// in order to control from an external application the computation of
+// a DicomDir object (see DicomDir::SetStartMethod*,
+// DicomDir::SetProgressMethod* and DicomDir::SetEndMethod*).
+// Motivation: since DicomDir parsing can be quite long, a GUI application
+// needs to display the avancement and potentially offer a
+// cancel method to the user (when this one feels things are
+// longer than expected).
+// Example of usage: refer to demo/DicomDirProgressMethod.py
+// Note: Uses gdcmPythonVoidFunc and gdcmPythonVoidFuncArgDelete defined
+// in the Swig verbatim section of this gdcm.i i.e. in the above section
+// enclosed within the %{ ... %} scope operator ).
+%typemap(python, in) (void(*method)(void *),void *arg,void(*argDelete)(void *))
+{