Olena-patches
  Threads by month 
                
            - ----- 2025 -----
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2024 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2023 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2022 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2021 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2020 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2019 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2018 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2017 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2016 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2015 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2014 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2013 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2012 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2011 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2010 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2009 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2008 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2007 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2006 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2005 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2004 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 
July 2008
- 4 participants
 - 57 discussions
 
27 Jul '08
                    
                        https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from  Roland Levillain  <roland(a)lrde.epita.fr>
	Add the ability to load images of built-in (POD) values.
	* mln/io/pnm/load.hh
	(mln::io::pnm::read_value(std::ifstream&, V&): Turn into...
	(mln::io::pnm::read_value(std::ifstream&, value::Scalar<V>&)):
	...this.
	(mln::io::pnm::read_value(std::ifstream&, V&): New overload.
	* mln/value/int_u8.hh (mln::io::pnm::int_u8): Use a fully
	qualified type name to help swig wrap this typedef.
	* mln/io/pgm/save.hh: Typo in comment.
 io/pgm/save.hh  |    2 +-
 io/pnm/load.hh  |   28 ++++++++++++++++++----------
 value/int_u8.hh |    2 +-
 3 files changed, 20 insertions(+), 12 deletions(-)
Index: mln/value/int_u8.hh
--- mln/value/int_u8.hh	(revision 2104)
+++ mln/value/int_u8.hh	(working copy)
@@ -44,7 +44,7 @@
 
 
     /// Alias for unsigned 8 bit integers.
-    typedef int_u<8> int_u8;
+    typedef mln::value::int_u<8> int_u8;
 
 
   } // end of namespace mln::value
Index: mln/io/pgm/save.hh
--- mln/io/pgm/save.hh	(revision 2104)
+++ mln/io/pgm/save.hh	(working copy)
@@ -78,7 +78,7 @@
       inline
       void save(const Image<I>& ima, const std::string& filename)
       {
-	// FIXME : this is to restrictive. Check if I is compatible with PGM.
+	// FIXME : this is too restrictive.  Check if I is compatible with PGM.
 	// 	mln::metal::or_<
 	// 	  mln::metal::templated_by<mln_value(I), value::int_u >,
 	// 	  mln::metal::templated_by<mln_value(I), value::int_u_sat >
Index: mln/io/pnm/load.hh
--- mln/io/pnm/load.hh	(revision 2104)
+++ mln/io/pnm/load.hh	(working copy)
@@ -58,12 +58,13 @@
     namespace pnm
     {
 
+
 # ifndef MLN_INCLUDE_ONLY
-      //read a rgb value (sizeof(int_u8) != 1)
+
+      // Read a Milena rgb value (sizeof(int_u8) != 1).
       template <unsigned int n>
       inline
-      void read_value(std::ifstream& file,
-		      value::rgb<n>& v)
+      void read_value(std::ifstream& file, value::rgb<n>& v)
       {
 	typedef typename value::int_u<n>::enc E;
 
@@ -76,25 +77,32 @@
 	v.blue() = c;
       }
 
-      
-      //read a scalar value (sizeof(int_u8) != 1)
+      // Read a Milena scalar value (sizeof(int_u8) != 1).
       template <class V>
       inline
-      void read_value(std::ifstream& file,
-		      V& v)
+      void read_value(std::ifstream& file, value::Scalar<V>& v)
       {
-	typedef typename V::enc E; // FIXME : if V = int
+	typedef typename V::enc E;
 
 	E c;
 	file.read((char*)(&c), sizeof(E));
+	exact(v) = c;
+      }
+
+      // Read a builtin scalar value.
+      template <typename V>
+      inline
+      void read_value(std::ifstream& file, V& v)
+      {
+	V c;
+	file.read((char*)(&c), sizeof(V));
 	v = c;
       }
 
       // used when (sizeof(int_u8) != 1)
       template <typename V>
       inline
-      void load_raw_2d_uncontiguous(std::ifstream& file,
-				    image2d<V>& ima)
+      void load_raw_2d_uncontiguous(std::ifstream& file, image2d<V>& ima)
       {
 	const int
 	  min_row = geom::min_row(ima),
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    24 Jul '08
                    
                        https://svn.lrde.epita.fr/svn/oln/trunk/swilena
Getting this work was not easy.  I had to figure out that dpoint2d had to
be wrapped for window2d to work, but error messages gave no hint about
this.  :(
Index: ChangeLog
from  Roland Levillain  <roland(a)lrde.epita.fr>
	Add preliminary support for windows and morpho in Swilena.
	* dpoint2d.i, window2d.i, morpho.ixx: New wrappers.
	* image2d.ixx, point2d.i, fill.ixx: Aesthetic changes.
	* image2d_int.i: Likewise.
	Use window2d and morpho::erosion.
	* python/swilena.py: Inject the contents of modules dpoint2d and
	window2d.
	* python/test.py: Exercise window2d and morpho::erosion.
	* python/Makefile.am: Handle modules dpoint2d and window2d.
	* Makefile.am (EXTRA_DIST): Remove image2d.i
	Add fill.ixx, image2d.ixx, intp.ixx, morpho.ixx, println.ixx,
	dpoint2d.i, image2d_int.i, point2d.i and window2d.i.
 Makefile.am        |    5 +-
 dpoint2d.i         |   64 ++++++++++++++++++++++++++++++
 fill.ixx           |    2 
 image2d.ixx        |   10 +---
 image2d_int.i      |   17 ++++++--
 morpho.ixx         |   54 ++++++++++++++++++++++++++
 point2d.i          |    2 
 python/Makefile.am |   20 +++++++++
 python/swilena.py  |    2 
 python/test.py     |   22 ++++++++++
 window2d.i         |  110 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 11 files changed, 296 insertions(+), 12 deletions(-)
Index: image2d.ixx
--- image2d.ixx	(revision 2103)
+++ image2d.ixx	(working copy)
@@ -37,10 +37,10 @@
 #include "mln/core/image2d.hh"
 %}
 
-%include "mln/core/box2d.hh";
-%include "mln/core/dpoint2d.hh";
+%include "mln/core/box2d.hh"
+%include "mln/core/dpoint2d.hh"
 
-%include "mln/core/concept/image.hh";
+%include "mln/core/concept/image.hh"
 
 // FIXME: Wrap mln::image2d by hand, for Milena macros disturb swig.
 // Annotate the original source code instead?
@@ -48,10 +48,8 @@
 {
   template <typename T>
   struct image2d
-  /* FIXME: This is a simple wrapping; ignore the base class (for the
-     moment). */
-  // : public internal::image_primary_< box2d, image2d<T> >
   /* FIXME: Cheat, so that generic algorithms can use mln::image2d. */
+  // : public internal::image_primary_< box2d, image2d<T> >
     :  public Image< image2d<T> >
   {
     // Warning: just to make effective types appear in Doxygen:
Index: python/test.py
--- python/test.py	(revision 2103)
+++ python/test.py	(working copy)
@@ -53,5 +53,27 @@
     v = image2d_int.intp_value(ima(p))
     print "ima(" + str(i) + ", " + str(j) + ") = " + str(v)
 
+# FIXME: This is too complicated.  We should be able to write
+# 
+#   ima(1,1) = 51
+#
+# or at least
+#
+#  ima.set(1, 1, 51)
+#
+image2d_int.intp_assign(ima(point2d(1,1)), 10)
+
 print
 image2d_int.println(ima)
+
+# Elementary erosion in 4-connectivity using win_c4p.
+eroded = image2d_int.erosion (ima, win_c4p())
+image2d_int.println(eroded)
+
+# Erosion using a custom window.
+w = window2d()
+w.insert(-1, 0)
+w.insert( 0, 0)
+w.insert(+1, 0)
+eroded = image2d_int.erosion (ima, w)
+image2d_int.println(eroded)
Index: python/Makefile.am
--- python/Makefile.am	(revision 2103)
+++ python/Makefile.am	(working copy)
@@ -50,6 +50,26 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_point2d-wrap.Pcc@am__quote@
 nodist_python_PYTHON += point2d.py
 
+## dpoint2d.
+pyexec_LTLIBRARIES += _dpoint2d.la
+nodist__dpoint2d_la_SOURCES = dpoint2d-wrap.cc
+_dpoint2d_la_LIBADD = $(AM_LIBADD)
+CLEANFILES += $(nodist__dpoint2d_la_SOURCES) dpoint2d.py dpoint2d.py[co]
+## Include the dependency files.  Copied from Automake's generated
+## case for C++.
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_dpoint2d-wrap.Pcc@am__quote@
+nodist_python_PYTHON += dpoint2d.py
+
+## window2d.
+pyexec_LTLIBRARIES += _window2d.la
+nodist__window2d_la_SOURCES = window2d-wrap.cc
+_window2d_la_LIBADD = $(AM_LIBADD)
+CLEANFILES += $(nodist__window2d_la_SOURCES) window2d.py window2d.py[co]
+## Include the dependency files.  Copied from Automake's generated
+## case for C++.
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_window2d-wrap.Pcc@am__quote@
+nodist_python_PYTHON += window2d.py
+
 ## image2d_int.
 pyexec_LTLIBRARIES += _image2d_int.la
 nodist__image2d_int_la_SOURCES = image2d_int-wrap.cc
Index: python/swilena.py
--- python/swilena.py	(revision 2103)
+++ python/swilena.py	(working copy)
@@ -30,4 +30,6 @@
 import ltihooks
 
 from point2d import *
+from dpoint2d import *
+from window2d import *
 import image2d_int
Index: window2d.i
--- window2d.i	(revision 0)
+++ window2d.i	(revision 0)
@@ -0,0 +1,110 @@
+//						       		-*- C++ -*-
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file window2d.i
+/// \brief A wrapper of mln::window2d.
+
+%module window2d
+
+%import "dpoint2d.i"
+
+%{
+#include "mln/core/window2d.hh"
+%}
+
+%include "mln/core/concept/window.hh"
+
+// FIXME: Wrap mln::image2d by hand, for Milena macros disturb swig.
+// Annotate the original source code instead?
+namespace mln
+{
+  template <typename D>
+  class window
+  /* FIXME: Simplify, so as to minimize the work.  */
+    : public Window< window<D> >
+    , public internal::dpoints_base_<D, window<D> >
+  {
+    typedef internal::dpoints_base_<D, window<D> > super_;
+  public:
+
+    /*! \brief Point_Iterator type to browse the points of a generic window
+     * w.r.t. the ordering of delta-points.
+     */
+    typedef dpoints_fwd_piter<D> fwd_qiter;
+
+    /*! \brief Point_Iterator type to browse the points of a generic window
+     * w.r.t. the reverse ordering of delta-points.
+     */
+    typedef dpoints_bkd_piter<D> bkd_qiter;
+
+
+    /*! \brief Constructor without argument.
+     *
+     * The constructed window is empty. 
+     */
+    window();
+
+
+    /*! \brief Test if the window is symmetric.
+     */
+    bool is_symmetric() const;
+
+    /// Insert a delta-point \p dp.
+    window<D>& insert(const D& dp);
+
+// FIXME: Swig tries to wrap everything by default; prevent it from wrapping
+// invalid methods (1D and 3D ctors for a point2d).
+    /// \{ Insertion of a delta-point with different numbers of
+    /// arguments (coordinates) w.r.t. the dimension.
+//     window<D>& insert(const mln_coord(D)& dind); // For 1D.
+
+// FIXME: The macro mln_coord disturbs swig.
+//     window<D>& insert(const mln_coord(D)& drow,
+// 		      const mln_coord(D)& dcol); // For 2D.
+    window<D>& insert(const typename D::coord& drow,
+ 		      const typename D::coord& dcol); // For 2D.
+
+//     window<D>& insert(const mln_coord(D)& dsli,
+// 		      const mln_coord(D)& drow,
+// 		      const mln_coord(D)& dcol); // For 3D.
+//     /// \}
+
+    /// Apply a central symmetry to the target window.
+    window<D>& sym();
+
+  protected:
+    
+// FIXME: The macro used here disturbs swig.
+//     box_<mln_point(D)> b_;
+    box_<typename D::point> b_;
+  };
+} // end of namespace mln
+
+%include "mln/core/window2d.hh"
+
+%template(window2d) mln::window< mln::dpoint_<mln::grid::square, int > >;
Index: point2d.i
--- point2d.i	(revision 2103)
+++ point2d.i	(working copy)
@@ -51,7 +51,7 @@
    Check whether this bug has been fixed in a recent release of SWIG
    or if it has been reported.  */
 %ignore mln::point_<mln::grid::square,int>::origin;
-// Ignoring to_h_vec saves us the wrapping of 
+// Ignoring to_h_vec saves us the wrapping of h_vec.
 %ignore mln::point_<mln::grid::square,int>::to_h_vec;
 // Swig tries to wrap everything by default; prevent it from wrapping
 // invalid methods (1D and 3D ctors for a point2d).
Index: Makefile.am
--- Makefile.am	(revision 2103)
+++ Makefile.am	(working copy)
@@ -2,6 +2,9 @@
 
 SUBDIRS = python
 
-EXTRA_DIST = image2d.i
+# Meta-wrappers (templates).
+EXTRA_DIST = fill.ixx image2d.ixx intp.ixx morpho.ixx println.ixx
+# Wrappers.
+EXTRA_DIST += dpoint2d.i image2d_int.i point2d.i window2d.i
 
 check_SCRIPTS = run
Index: image2d_int.i
--- image2d_int.i	(revision 2103)
+++ image2d_int.i	(working copy)
@@ -32,12 +32,21 @@
 
 %module image2d_int
 
-%include intp.ixx
-%include image2d.ixx
+%include "intp.ixx"
+%include "image2d.ixx"
 %template(image2d_int) mln::image2d<int>;
 
-%include fill.ixx
+%include "fill.ixx"
 %template(fill) mln::level::fill< mln::image2d<int> >;
 
-%include println.ixx
+%include "println.ixx"
 %template(println) mln::debug::println< mln::image2d<int> >;
+
+%import "window2d.i"
+// FIXME: The import directive does not import the `%{ ... %}' clauses.
+%{
+#include "mln/core/window2d.hh"
+%}
+
+%include "morpho.ixx"
+%template(erosion) mln::morpho::erosion< mln::image2d<int>, mln::window2d >;
Index: dpoint2d.i
--- dpoint2d.i	(revision 0)
+++ dpoint2d.i	(revision 0)
@@ -0,0 +1,64 @@
+//						       		-*- C++ -*-
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file dpoint2d.i
+/// \brief A wrapper of mln::dpoint2d.
+
+%module dpoint2d
+
+%{
+#include "mln/core/dpoint.hh"
+#include "mln/core/dpoint2d.hh"
+%}
+
+%include "mln/core/dpoint.hh";
+%include "mln/core/dpoint2d.hh";
+/* FIXME: Ignore `mln::dpoint_<M,C>::origin' to circumvent a swig bug.
+   Without this ignore clause, the generated code would trigger this
+   error :
+
+     image2d-wrap.cc:3115:144: error: macro "SWIG_as_voidptr" passed 2
+     arguments, but takes just 1
+     image2d-wrap.cc: In function 'PyObject* dpoint2d_origin_get()':
+     image2d-wrap.cc:3115: error: 'SWIG_as_voidptr' was not declared in this
+     scope
+
+   Check whether this bug has been fixed in a recent release of SWIG
+   or if it has been reported.  */
+// %ignore mln::dpoint_<mln::grid::square,int>::origin;
+// Ignoring to_h_vec saves us the wrapping of h_vec.
+// %ignore mln::dpoint_<mln::grid::square,int>::to_h_vec;
+// Swig tries to wrap everything by default; prevent it from wrapping
+// invalid methods (1D and 3D ctors for a dpoint2d).
+// %ignore mln::dpoint_<mln::grid::square,int>::dpoint_(const literal::zero_t&);
+%ignore mln::dpoint_<mln::grid::square,int>::dpoint_(const literal::one_t&);
+%ignore mln::dpoint_<mln::grid::square,int>::operator=(const literal::one_t&);
+%ignore mln::dpoint_<mln::grid::square,int>::dpoint_(int);
+%ignore mln::dpoint_<mln::grid::square,int>::dpoint_(int, int, int);
+
+%template(dpoint2d) mln::dpoint_<mln::grid::square, int>;
Index: morpho.ixx
--- morpho.ixx	(revision 0)
+++ morpho.ixx	(revision 0)
@@ -0,0 +1,54 @@
+//						       		-*- C++ -*-
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file fill.i
+/// \brief Wrappers of morphological algorithms from mln::morpho.
+
+%module morpho
+
+%{
+#include "mln/morpho/erosion.hh"
+%}
+
+// FIXME: Wrap mln::morpho::erosion by hand, for mln_concrete(I)
+// disturbs swig.  Annotate the original source code instead?
+namespace mln
+{
+  namespace morpho
+  {
+
+    template <typename I, typename W>
+    /* FIXME: How can we handle concrete in Swilena?  Simplify this
+     for the moment, and use I directly.  */
+//     typename mln::trait::concrete< I >::ret
+    I
+    erosion(const Image<I>& input, const Window<W>& win);
+
+  } // end of namespace mln::morpho
+
+} // end of namespace mln
Index: fill.ixx
--- fill.ixx	(revision 2103)
+++ fill.ixx	(working copy)
@@ -41,8 +41,10 @@
 {
   namespace level
   {
+
     template <typename I>
     void fill(mln::Image<I>& ima, const typename I::value& v);
+
   } // end of namespace mln::level
 
 } // end of namespace mln
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from  Roland Levillain  <roland(a)lrde.epita.fr>
	* mln/core/dpoint.hh,
	* mln/core/dpoint1d.hh,
	* mln/core/dpoint2d.hh,
	* mln/core/dpoint2d_h.hh,
	* mln/core/dpoint3d.hh,
	* mln/core/window1d.hh,
	* mln/core/window3d.hh:
	Update copyright headers.
 dpoint.hh     |    2 +-
 dpoint1d.hh   |    2 +-
 dpoint2d.hh   |    2 +-
 dpoint2d_h.hh |    2 +-
 dpoint3d.hh   |    2 +-
 window1d.hh   |    2 +-
 window3d.hh   |    2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
Index: mln/core/dpoint2d.hh
--- mln/core/dpoint2d.hh	(revision 2102)
+++ mln/core/dpoint2d.hh	(working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
 //
 // This file is part of the Olena Library.  This library is free
 // software; you can redistribute it and/or modify it under the terms
Index: mln/core/dpoint2d_h.hh
--- mln/core/dpoint2d_h.hh	(revision 2102)
+++ mln/core/dpoint2d_h.hh	(working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
 //
 // This file is part of the Olena Library.  This library is free
 // software; you can redistribute it and/or modify it under the terms
Index: mln/core/dpoint.hh
--- mln/core/dpoint.hh	(revision 2102)
+++ mln/core/dpoint.hh	(working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
 //
 // This file is part of the Olena Library.  This library is free
 // software; you can redistribute it and/or modify it under the terms
Index: mln/core/dpoint1d.hh
--- mln/core/dpoint1d.hh	(revision 2102)
+++ mln/core/dpoint1d.hh	(working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
 //
 // This file is part of the Olena Library.  This library is free
 // software; you can redistribute it and/or modify it under the terms
Index: mln/core/dpoint3d.hh
--- mln/core/dpoint3d.hh	(revision 2102)
+++ mln/core/dpoint3d.hh	(working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
 //
 // This file is part of the Olena Library.  This library is free
 // software; you can redistribute it and/or modify it under the terms
Index: mln/core/window1d.hh
--- mln/core/window1d.hh	(revision 2102)
+++ mln/core/window1d.hh	(working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
 //
 // This file is part of the Olena Library.  This library is free
 // software; you can redistribute it and/or modify it under the terms
Index: mln/core/window3d.hh
--- mln/core/window3d.hh	(revision 2102)
+++ mln/core/window3d.hh	(working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
 //
 // This file is part of the Olena Library.  This library is free
 // software; you can redistribute it and/or modify it under the terms
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            2101: Improve classical windows typedefs and add a	win_c4p generator.
                        
                        
by Roland Levillain 24 Jul '08
                    by Roland Levillain 24 Jul '08
24 Jul '08
                    
                        https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from  Roland Levillain  <roland(a)lrde.epita.fr>
	Improve classical windows typedefs and add a win_c4p generator.
	* mln/core/window1d.hh, mln/core/window3d.hh:
	Use fully qualified type names to help swig wrap these typedefs.
	* mln/core/window2d.hh: Likewise.
	(mln::win_c4p): New function.
 window1d.hh |   15 ++++++---------
 window2d.hh |   49 +++++++++++++++++++++++++++++++++++++++----------
 window3d.hh |   15 ++++++---------
 3 files changed, 51 insertions(+), 28 deletions(-)
Index: mln/core/window1d.hh
--- mln/core/window1d.hh	(revision 2101)
+++ mln/core/window1d.hh	(working copy)
@@ -28,11 +28,9 @@
 #ifndef MLN_CORE_WINDOW1D_HH
 # define MLN_CORE_WINDOW1D_HH
 
-/*! \file mln/core/window1d.hh
- *
- * \brief Definition of the mln::window1d alias and of a construction
- * routine.
- */
+/// \file mln/core/window1d.hh
+/// \brief Definition of the mln::window1d alias and of a construction
+/// routine.
 
 # include <mln/core/window.hh>
 # include <mln/core/dpoint1d.hh>
@@ -41,10 +39,9 @@
 namespace mln
 {
 
-  /*! \brief Type alias for a window with arbitrary shape, defined on
-   * the 1D square grid with integer coordinates.
-   */
-  typedef window<dpoint1d> window1d;
+  /// \brief Type alias for a window with arbitrary shape, defined on
+  /// the 1D square grid with integer coordinates.
+  typedef window<mln::dpoint1d> window1d;
 
 
 } // end of namespace mln
Index: mln/core/window2d.hh
--- mln/core/window2d.hh	(revision 2101)
+++ mln/core/window2d.hh	(working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
 //
 // This file is part of the Olena Library.  This library is free
 // software; you can redistribute it and/or modify it under the terms
@@ -28,11 +28,9 @@
 #ifndef MLN_CORE_WINDOW2D_HH
 # define MLN_CORE_WINDOW2D_HH
 
-/*! \file mln/core/window2d.hh
- *
- * \brief Definition of the mln::window2d alias and of a construction
- * routine.
- */
+/// \file mln/core/window2d.hh
+/// \brief Definition of the mln::window2d alias and of a construction
+/// routine.
 
 # include <mln/core/window.hh>
 # include <mln/core/dpoint2d.hh>
@@ -41,12 +39,43 @@
 namespace mln
 {
 
-  /*! \brief Type alias for a window with arbitrary shape, defined on
-   * the 2D square grid with integer coordinates.
-   */
-  typedef window<dpoint2d> window2d;
+  /// \brief Type alias for a window with arbitrary shape, defined on
+  /// the 2D square grid with integer coordinates.
+  typedef window<mln::dpoint2d> window2d;
+
+  /// \brief 4-connectivity window on the 2D grid, including the
+  /// center.
+  ///
+  ///  - o -
+  ///  o x o
+  ///  - o -
+  ///
+  /// \return A window2d.
+  const window2d& win_c4p();
 
 
+
+# ifndef MLN_INCLUDE_ONLY
+
+  inline const window2d&
+  win_c4p()
+  {
+    static bool initialized_p = false;
+    static window2d it;
+    if (!initialized_p)
+      {
+	it.insert(make::dpoint2d( 0, -1));
+	it.insert(make::dpoint2d(-1,  0));
+	it.insert(make::dpoint2d( 0,  0));
+	it.insert(make::dpoint2d(+1,  0));
+	it.insert(make::dpoint2d( 0, +1));
+	initialized_p = true;
+      }
+    return it;
+  }
+
+# endif // ! MLN_INCLUDE_ONLY
+
 } // end of namespace mln
 
 
Index: mln/core/window3d.hh
--- mln/core/window3d.hh	(revision 2101)
+++ mln/core/window3d.hh	(working copy)
@@ -28,11 +28,9 @@
 #ifndef MLN_CORE_WINDOW3D_HH
 # define MLN_CORE_WINDOW3D_HH
 
-/*! \file mln/core/window3d.hh
- *
- * \brief Definition of the mln::window3d alias and of a construction
- * routine.
- */
+/// \file mln/core/window3d.hh
+/// \brief Definition of the mln::window3d alias and of a construction
+/// routine.
 
 # include <mln/core/window.hh>
 # include <mln/core/dpoint3d.hh>
@@ -41,10 +39,9 @@
 namespace mln
 {
 
-  /*! \brief Type alias for a window with arbitrary shape, defined on
-   * the 3D square grid with integer coordinates.
-   */
-  typedef window<dpoint3d> window3d;
+  /// \brief Type alias for a window with arbitrary shape, defined on
+  /// the 3D square grid with integer coordinates.
+  typedef window<mln::dpoint3d> window3d;
 
 
 } // end of namespace mln
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from  Roland Levillain  <roland(a)lrde.epita.fr>
	Improve classical dpoints typedefs.
	* mln/core/dpoint.hh: Use fully qualified type names to help swig
	wrap these typedefs.
	* mln/core/dpoint1d.hh,
	* mln/core/dpoint2d.hh,
	* mln/core/dpoint2d_h.hh,
	* mln/core/dpoint3d.hh:
	Likewise.
	Include mln/core/grids.hh.
 dpoint.hh     |   10 +++++-----
 dpoint1d.hh   |    3 ++-
 dpoint2d.hh   |    3 ++-
 dpoint2d_h.hh |    3 ++-
 dpoint3d.hh   |    3 ++-
 5 files changed, 13 insertions(+), 9 deletions(-)
Index: mln/core/dpoint.hh
--- mln/core/dpoint.hh	(revision 2100)
+++ mln/core/dpoint.hh	(working copy)
@@ -114,13 +114,13 @@
 
     /// Conversion towards a algebra::vec.
     template <typename Q>
-    operator algebra::vec<M::dim, Q>() const;
+    operator mln::algebra::vec<M::dim, Q>() const;
 
     /// Explicit conversion.
-    algebra::vec<M::dim, C> to_vec() const;
+    mln::algebra::vec<M::dim, C> to_vec() const;
 
   protected:
-    algebra::vec<M::dim, C> coord_;
+    mln::algebra::vec<M::dim, C> coord_;
   };
 
 
@@ -231,14 +231,14 @@
   template <typename M, typename C>
   template <typename Q>
   inline
-  dpoint_<M,C>::operator algebra::vec<M::dim, Q> () const
+  dpoint_<M,C>::operator mln::algebra::vec<M::dim, Q> () const
   {
     return coord_;
   }
 
   template <typename M, typename C>
   inline
-  algebra::vec<M::dim, C>
+  mln::algebra::vec<M::dim, C>
   dpoint_<M,C>::to_vec() const
   {
     return coord_;
Index: mln/core/dpoint1d.hh
--- mln/core/dpoint1d.hh	(revision 2100)
+++ mln/core/dpoint1d.hh	(working copy)
@@ -35,6 +35,7 @@
  */
 
 # include <mln/core/dpoint.hh>
+# include <mln/core/grids.hh>
 
 
 namespace mln
@@ -43,7 +44,7 @@
   /*! \brief Type alias for a delta-point defined on the 1D square
    * grid with integer coordinates.
    */
-  typedef dpoint_<grid::tick, int> dpoint1d;
+  typedef dpoint_<mln::grid::tick, int> dpoint1d;
 
 
 } // end of namespace mln
Index: mln/core/dpoint2d.hh
--- mln/core/dpoint2d.hh	(revision 2100)
+++ mln/core/dpoint2d.hh	(working copy)
@@ -35,6 +35,7 @@
  */
 
 # include <mln/core/dpoint.hh>
+# include <mln/core/grids.hh>
 
 
 namespace mln
@@ -43,7 +44,7 @@
   /*! \brief Type alias for a delta-point defined on the 2D square
    * grid with integer coordinates.
    */
-  typedef dpoint_<grid::square, int> dpoint2d;
+  typedef dpoint_<mln::grid::square, int> dpoint2d;
 
 
 } // end of namespace mln
Index: mln/core/dpoint2d_h.hh
--- mln/core/dpoint2d_h.hh	(revision 2100)
+++ mln/core/dpoint2d_h.hh	(working copy)
@@ -35,6 +35,7 @@
  */
 
 # include <mln/core/dpoint.hh>
+# include <mln/core/grids.hh>
 
 
 namespace mln
@@ -43,7 +44,7 @@
   /*! \brief Type alias for a delta-point defined on the 2D square
    * grid with integer coordinates.
    */
-  typedef dpoint_<grid::hexa, int> dpoint2d_h;
+  typedef dpoint_<mln::grid::hexa, int> dpoint2d_h;
 
 
 } // end of namespace mln
Index: mln/core/dpoint3d.hh
--- mln/core/dpoint3d.hh	(revision 2100)
+++ mln/core/dpoint3d.hh	(working copy)
@@ -35,6 +35,7 @@
  */
 
 # include <mln/core/dpoint.hh>
+# include <mln/core/grids.hh>
 
 
 namespace mln
@@ -43,7 +44,7 @@
   /*! \brief Type alias for a delta-point defined on the 3D square
    * grid with integer coordinates.
    */
-  typedef dpoint_<grid::cube, int> dpoint3d;
+  typedef dpoint_<mln::grid::cube, int> dpoint3d;
 
 
 } // end of namespace mln
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        https://svn.lrde.epita.fr/svn/oln/trunk/swilena
Index: ChangeLog
from  Roland Levillain  <roland(a)lrde.epita.fr>
	Break Swilena's image2d into modules.
	* image2d.i: Rename as...
	* image2d.ixx: ...this.
	Move parts not directly related to mln::image2d<T>...
	* intpx.ixx, point2d.ixx, fill.ixx, println.ixx, image2d_int.i:
	...here (new files).
	* python/swilena.py: Adjust.
	Inject the contents of module point2d.
	* python/sps.py, python/test.py: Adjust.
	* python/Makefile.am: Handle module point2d.
 fill.ixx           |   48 +++++++++++++++++++++++++++
 image2d.ixx        |   94 +----------------------------------------------------
 image2d_int.i      |   43 ++++++++++++++++++++++++
 intp.ixx           |   37 ++++++++++++++++++++
 point2d.i          |   63 +++++++++++++++++++++++++++++++++++
 println.ixx        |   36 ++++++++++++++++++++
 python/Makefile.am |   26 ++++++++++----
 python/sps.py      |    6 +--
 python/swilena.py  |    4 +-
 python/test.py     |   12 +++---
 10 files changed, 260 insertions(+), 109 deletions(-)
Index: image2d.ixx
--- image2d.ixx	(revision 2099)
+++ image2d.ixx	(working copy)
@@ -27,63 +27,11 @@
 // Public License.
 
 /// \file image2d.i
-/// \brief A simple wrapping of mln::image2d<int> along with some
-/// algorithms.
-
+/// \brief A wrapper of mln::image2d<T>.
 
 %module image2d
 
-
-/*------.
-| int.  |
-`------*/
-
-%include "cpointer.i"
-// Wrap a class interface around an "int *" (see
-// // http://www.swig.org/Doc1.3/Library.html#Library_nn4)
-// %pointer_class(int, intp);
-/* Create some functions for working with "int *" */
-%pointer_functions(int, intp);
-
-
-/*---------------.
-| mln::point2d.  |
-`---------------*/
-
-%{
-#include "mln/core/point.hh"
-#include "mln/core/point2d.hh"
-%}
-
-%include "mln/core/point.hh";
-%include "mln/core/point2d.hh";
-/* FIXME: Ignore `mln::point_<M,C>::origin' to circumvent a swig bug.
-   Without this ignore clause, the generated code would trigger this
-   error :
-
-     image2d-wrap.cc:3115:144: error: macro "SWIG_as_voidptr" passed 2
-     arguments, but takes just 1
-     image2d-wrap.cc: In function 'PyObject* point2d_origin_get()':
-     image2d-wrap.cc:3115: error: 'SWIG_as_voidptr' was not declared in this
-     scope
-
-   Check whether this bug has been fixed in a recent release of SWIG
-   or if it has been reported.  */
-%ignore mln::point_<mln::grid::square,int>::origin;
-// Ignoring to_h_vec saves us the wrapping of 
-%ignore mln::point_<mln::grid::square,int>::to_h_vec;
-// Swig tries to wrap everything by default; prevent it from wrapping
-// invalid methods (1D and 3D ctors for a point2d).
-%ignore mln::point_<mln::grid::square,int>::point_(const literal::zero_t&);
-%ignore mln::point_<mln::grid::square,int>::point_(const literal::one_t&);
-%ignore mln::point_<mln::grid::square,int>::point_(int);
-%ignore mln::point_<mln::grid::square,int>::point_(int, int, int);
-// point2d.
-%template(point2d) mln::point_<mln::grid::square,int>;
-
-/*--------------------.
-| mln::image2d<int>.  |
-`--------------------*/
+%import "point2d.i"
 
 %{
 #include "mln/core/image2d.hh"
@@ -208,41 +156,3 @@
   };
 
 } // end of namespace mln
-
-%template(image2d_int) mln::image2d<int>;
-
-
-/*-------------------.
-| mln::level::fill.  |
-`-------------------*/
-
-%{
-#include "mln/level/fill.hh"
-%}
-
-// FIXME: Wrap mln::level::fill by hand, for mln_value(I) disturbs
-// swig.  Annotate the original source code instead?
-namespace mln
-{
-  namespace level
-  {
-    template <typename I>
-    void fill(mln::Image<I>& ima, const typename I::value& v);
-  } // end of namespace mln::level
-
-} // end of namespace mln
-
-%template(fill_image2d_int) mln::level::fill< mln::image2d<int> >;
-
-
-/*----------------------.
-| mln::debug::println.  |
-`----------------------*/
-
-%{
-  #include "mln/debug/println.hh"
-%}
-
-%include "mln/debug/println.hh"
-
-%template(println_image2d_int) mln::debug::println< mln::image2d<int> >;
Index: python/test.py
--- python/test.py	(revision 2099)
+++ python/test.py	(working copy)
@@ -29,12 +29,12 @@
 
 from swilena import *
 
-ima = image2d.image2d_int(3, 3)
-image2d.fill_image2d_int(ima, 42)
+ima = image2d_int.image2d_int(3, 3)
+image2d_int.fill(ima, 42)
 
 # FIXME: For the moment, we can't write
 #
-#   ima(image2d.point2d(i, j))
+#   ima(point2d(i, j))
 #
 # but I don't know why.  Anyway, eventually we'd like to be able to
 # write this:
@@ -45,13 +45,13 @@
 # as it is generic and way closer to what we do in C++.
 for i in range(0, 3):
   for j in range(0, 3):
-    p = image2d.point2d(i, j)
+    p = point2d(i, j)
     # FIXME: Handling POD types (like int) as value types is not
     # transparent: ima(p) returns a pointer to int wrapped in a SWIG
     # object, and cannot be easily converted to a Python integer
     # value.  Hence this explicit conversion using `intp_value'.
-    v = image2d.intp_value(ima(p))
+    v = image2d_int.intp_value(ima(p))
     print "ima(" + str(i) + ", " + str(j) + ") = " + str(v)
 
 print
-image2d.println_image2d_int(ima)
+image2d_int.println(ima)
Index: python/Makefile.am
--- python/Makefile.am	(revision 2099)
+++ python/Makefile.am	(working copy)
@@ -37,16 +37,28 @@
 ## FIXME: All of this should be generated.
 ## Don't forget to add a `deps-reset' target as in TC.
 
-## image2d.
-pyexec_LTLIBRARIES = _image2d.la
-nodist__image2d_la_SOURCES = image2d-wrap.cc
-_image2d_la_LIBADD = $(AM_LIBADD)
-CLEANFILES += $(nodist__image2d_la_SOURCES) image2d.py image2d.py[co]
+nodist_python_PYTHON =
+pyexec_LTLIBRARIES =
+
+## point2d.
+pyexec_LTLIBRARIES += _point2d.la
+nodist__point2d_la_SOURCES = point2d-wrap.cc
+_point2d_la_LIBADD = $(AM_LIBADD)
+CLEANFILES += $(nodist__point2d_la_SOURCES) point2d.py point2d.py[co]
 ## Include the dependency files.  Copied from Automake's generated
 ## case for C++.
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_image2d-wrap.Pcc@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_point2d-wrap.Pcc@am__quote@
+nodist_python_PYTHON += point2d.py
 
-nodist_python_PYTHON = image2d.py
+## image2d_int.
+pyexec_LTLIBRARIES += _image2d_int.la
+nodist__image2d_int_la_SOURCES = image2d_int-wrap.cc
+_image2d_int_la_LIBADD = $(AM_LIBADD)
+CLEANFILES += $(nodist__image2d_int_la_SOURCES) image2d_int.py image2d_int.py[co]
+## Include the dependency files.  Copied from Automake's generated
+## case for C++.
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_image2d_int-wrap.Pcc@am__quote@
+nodist_python_PYTHON += image2d_int.py
 
 
 ## ---------------------------- ##
Index: python/swilena.py
--- python/swilena.py	(revision 2099)
+++ python/swilena.py	(working copy)
@@ -28,4 +28,6 @@
 # Public License.
 
 import ltihooks
-import image2d
+
+from point2d import *
+import image2d_int
Index: python/sps.py
--- python/sps.py	(revision 2099)
+++ python/sps.py	(working copy)
@@ -41,9 +41,9 @@
 The following example creates a 2-d image of integers with 3 rows and
 3 columns, then fills its cells with the value `42' and prints it:
 
-  ima = image2d.image2d_int(3, 3)
-  image2d.fill_image2d_int(ima, 42)
-  image2d.println_image2d_int(ima)
+  ima = image2d_int.image2d_int(3, 3)
+  image2d_int.fill(ima, 42)
+  image2d_int.println(ima)
 
 You can try it by copying and pasting each line on the following prompt.
 ''')
Index: intp.ixx
--- intp.ixx	(revision 0)
+++ intp.ixx	(revision 0)
@@ -0,0 +1,37 @@
+//						       		-*- C++ -*-
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file intp.i
+/// \brief A wrapper of int pointers.
+
+%include "cpointer.i"
+// Wrap a class interface around an "int *" (see
+// // http://www.swig.org/Doc1.3/Library.html#Library_nn4)
+// %pointer_class(int, intp);
+/* Create some functions for working with "int *" */
+%pointer_functions(int, intp);
Index: point2d.i
--- point2d.i	(revision 0)
+++ point2d.i	(revision 0)
@@ -0,0 +1,63 @@
+//						       		-*- C++ -*-
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file point2d.i
+/// \brief A wrapper of mln::point2d.
+
+%module point2d
+
+%{
+#include "mln/core/point.hh"
+#include "mln/core/point2d.hh"
+%}
+
+%include "mln/core/point.hh";
+%include "mln/core/point2d.hh";
+/* FIXME: Ignore `mln::point_<M,C>::origin' to circumvent a swig bug.
+   Without this ignore clause, the generated code would trigger this
+   error :
+
+     image2d-wrap.cc:3115:144: error: macro "SWIG_as_voidptr" passed 2
+     arguments, but takes just 1
+     image2d-wrap.cc: In function 'PyObject* point2d_origin_get()':
+     image2d-wrap.cc:3115: error: 'SWIG_as_voidptr' was not declared in this
+     scope
+
+   Check whether this bug has been fixed in a recent release of SWIG
+   or if it has been reported.  */
+%ignore mln::point_<mln::grid::square,int>::origin;
+// Ignoring to_h_vec saves us the wrapping of 
+%ignore mln::point_<mln::grid::square,int>::to_h_vec;
+// Swig tries to wrap everything by default; prevent it from wrapping
+// invalid methods (1D and 3D ctors for a point2d).
+%ignore mln::point_<mln::grid::square,int>::point_(const literal::zero_t&);
+%ignore mln::point_<mln::grid::square,int>::point_(const literal::one_t&);
+%ignore mln::point_<mln::grid::square,int>::point_(int);
+%ignore mln::point_<mln::grid::square,int>::point_(int, int, int);
+
+%template(point2d) mln::point_<mln::grid::square,int>;
Index: image2d_int.i
--- image2d_int.i	(revision 0)
+++ image2d_int.i	(revision 0)
@@ -0,0 +1,43 @@
+//						       		-*- C++ -*-
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file image2d.i
+/// \brief A simple wrapping of mln::image2d<int> along with some
+/// algorithms.
+
+%module image2d_int
+
+%include intp.ixx
+%include image2d.ixx
+%template(image2d_int) mln::image2d<int>;
+
+%include fill.ixx
+%template(fill) mln::level::fill< mln::image2d<int> >;
+
+%include println.ixx
+%template(println) mln::debug::println< mln::image2d<int> >;
Index: fill.ixx
--- fill.ixx	(revision 0)
+++ fill.ixx	(revision 0)
@@ -0,0 +1,48 @@
+//						       		-*- C++ -*-
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file fill.i
+/// \brief A wrapper of mln::level::fill.
+
+%module fill
+
+%{
+#include "mln/level/fill.hh"
+%}
+
+// FIXME: Wrap mln::level::fill by hand, for mln_value(I) disturbs
+// swig.  Annotate the original source code instead?
+namespace mln
+{
+  namespace level
+  {
+    template <typename I>
+    void fill(mln::Image<I>& ima, const typename I::value& v);
+  } // end of namespace mln::level
+
+} // end of namespace mln
Index: println.ixx
--- println.ixx	(revision 0)
+++ println.ixx	(revision 0)
@@ -0,0 +1,36 @@
+//						       		-*- C++ -*-
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file println.i
+/// \brief A wrapper of mln::debug::println.
+
+%{
+  #include "mln/debug/println.hh"
+%}
+
+%include "mln/debug/println.hh"
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        https://svn.lrde.epita.fr/svn/oln/trunk/swilena
We now have a beginning of a Swilena Python Shell for Olena.  To try
it out, build it, go to the swilena/python directory of your *build*
tree (which can be the same as your source tree, of course) and run
`sps-local':
  make -C swilena
  cd swilena/python
  ./sps-local
and type `example', for instance.
Use `sps-local', not `sps', for the latter will only work when the
project is *installed*.  Once installed, you should be able to run
this shell using `sps'.
Index: ChangeLog
from  Roland Levillain  <roland(a)lrde.epita.fr>
	Improve sps.
	* python/sps-common.in: Move the lines printing information at
	the startup of the shell...
	* python/sps.py: ...here (new file).
	Use this script instead of swilena.py for sps...
	* python/sps.in, python/sps-local.in: ...here.
	* python/Makefile.am (python_PYTHON): Add sps.py.
 Makefile.am   |    6 ++++--
 sps-common.in |    4 +---
 sps-local.in  |    2 +-
 sps.in        |    2 +-
 sps.py        |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 61 insertions(+), 7 deletions(-)
Index: python/sps-common.in
--- python/sps-common.in	(revision 2098)
+++ python/sps-common.in	(working copy)
@@ -29,6 +29,4 @@
 
 # The Swilena Python Shell.
 
-echo 'The Swilena Python Shell (sps).'
-echo 'Type "help", "copyright", "credits" or "license" for more information.'
-echo 'Type "quit()" or ^D (Ctrl-D) to quit.'
+# FIXME: We might want to add some option processing here.
Index: python/sps-local.in
--- python/sps-local.in	(revision 2098)
+++ python/sps-local.in	(working copy)
@@ -3,4 +3,4 @@
 # sps local version, for use from non installed distributions.
 PYTHONPATH='@abs_builddir@/python:@abs_srcdir@/python':"$PYTHONPATH" \
 DYLD_LIBRARY_PATH='.libs:@abs_top_builddir@/src/.libs' \
-exec @PYTHON@ -i @abs_srcdir@/swilena.py "$@"
+exec @PYTHON@ -i @abs_srcdir@/sps.py "$@"
Index: python/Makefile.am
--- python/Makefile.am	(revision 2098)
+++ python/Makefile.am	(working copy)
@@ -23,8 +23,11 @@
 	  rm -f "$(DEPDIR)/$*-wrap.Tcc"; exit 1;\
 	fi
 
+
 # ltihooks.py: Python import hooks that understand Libtool libraries.
 python_PYTHON = ltihooks.py
+# swilena.py: The whole Swilena suite.
+python_PYTHON += swilena.py
 
 
 ## ----------------- ##
@@ -51,8 +54,7 @@
 ## ---------------------------- ##
 
 # FIXME: We might want to rename this shell as something else.
-
-python_PYTHON += swilena.py
+python_PYTHON += sps.py
 
 # The script to be used in installed distributions.
 bin_SCRIPTS = sps
Index: python/sps.in
--- python/sps.in	(revision 2098)
+++ python/sps.in	(working copy)
@@ -3,4 +3,4 @@
 # sps, for use from an installed distribution.
 PYTHONPATH='@pythondir@':"$PYTHONPATH" \
 DYLD_LIBRARY_PATH='@pythondir@:@libdir@' \
-exec @PYTHON@ -i @pythondir@/swilena.py "$@"
+exec @PYTHON@ -i @pythondir@/sps.py "$@"
Index: python/sps.py
--- python/sps.py	(revision 0)
+++ python/sps.py	(revision 0)
@@ -0,0 +1,54 @@
+#! /usr/bin/env python
+
+# Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+#
+# This file is part of the Olena Library.  This library is free
+# software; you can redistribute it and/or modify it under the terms
+# of the GNU General Public License version 2 as published by the
+# Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this library; see the file COPYING.  If not, write to
+# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+# Boston, MA 02111-1307, USA.
+#
+# As a special exception, you may use this file as part of a free
+# software library without restriction.  Specifically, if other files
+# instantiate templates or use macros or inline functions from this
+# file, or you compile this file and link it with other files to
+# produce an executable, this file does not by itself cause the
+# resulting executable to be covered by the GNU General Public
+# License.
+# reasons why the executable file might be covered by the GNU General
+# Public License.
+
+from swilena import *
+
+# FIXME: See if could use cmd.Cmd here
+# (http://docs.huihoo.com/pydoc/python/2.5/stdlib/cmd.Cmd-class.html)
+class Example:
+  def __init__(self, message):
+    self.message = message
+  def __repr__(self):
+    return self.message
+
+example = Example('''\
+The following example creates a 2-d image of integers with 3 rows and
+3 columns, then fills its cells with the value `42' and prints it:
+
+  ima = image2d.image2d_int(3, 3)
+  image2d.fill_image2d_int(ima, 42)
+  image2d.println_image2d_int(ima)
+
+You can try it by copying and pasting each line on the following prompt.
+''')
+
+print '''The Swilena Python Shell (sps).
+Type "help", "copyright", "credits" or "license" for more information on Python
+Type "example" for a short example.
+Type "quit()" or ^D (Ctrl-D) to quit.'''
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from  Roland Levillain  <roland(a)lrde.epita.fr>
	Configure the Swilena Python Shell (sps).
	* configure.ac: Configure swilena/python/sps and
	swilena/python/sps-local.
 configure.ac |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
Index: configure.ac
--- configure.ac	(revision 2097)
+++ configure.ac	(working copy)
@@ -107,9 +107,21 @@
 OLN_WITH_SWILENA([with_swilena=yes], [with_swilena=no])
 AM_CONDITIONAL([ENABLE_SWILENA], [test x$with_swilena = xyes])
 
-AC_CONFIG_FILES([swilena/Makefile swilena/python/Makefile])
+AC_CONFIG_FILES([swilena/Makefile
+                 swilena/python/Makefile])
+
 AC_CONFIG_FILES([swilena/run], [chmod +x swilena/run])
 
+AC_CONFIG_FILES(m4_do([swilena/python/sps],
+	              [:swilena/python/sps-common.in],
+                      [:swilena/python/sps.in]),
+                [chmod +x swilena/python/sps])
+AC_CONFIG_FILES(m4_do([swilena/python/sps-local],
+                      [:swilena/python/sps-common.in],
+                      [:swilena/python/sps-local.in]),
+                [chmod +x swilena/python/sps-local])
+
+
 
 ## --------------- ##
 ## Configuration.  ##
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        https://svn.lrde.epita.fr/svn/oln/trunk/swilena
Index: ChangeLog
from  Roland Levillain  <roland(a)lrde.epita.fr>
	Add the Swilena Python Shell (sps).
	* python/sps-common.in, python/sps.in, python/sps-local.in: New.
	* python/swilena.py: New.
	Use it...
	* python/test.py: ...here, to factor imports.
	* python/Makefile.am (python_PYTHON): Add swilena.py.
	(bin_SCRIPTS): New.  Add sps
	(noinst_SCRIPTS): New.  Add sps-local.
	(CLEANFILES): Add $(bin_SCRIPTS) and $(noinst_SCRIPTS).
 Makefile.am   |   16 ++++++++++++++++
 sps-common.in |   34 ++++++++++++++++++++++++++++++++++
 sps-local.in  |    6 ++++++
 sps.in        |    6 ++++++
 swilena.py    |   31 +++++++++++++++++++++++++++++++
 test.py       |    3 +--
 6 files changed, 94 insertions(+), 2 deletions(-)
Index: python/sps-common.in
--- python/sps-common.in	(revision 0)
+++ python/sps-common.in	(revision 0)
@@ -0,0 +1,34 @@
+#! /bin/sh
+
+# Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+#
+# This file is part of the Olena Library.  This library is free
+# software; you can redistribute it and/or modify it under the terms
+# of the GNU General Public License version 2 as published by the
+# Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this library; see the file COPYING.  If not, write to
+# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+# Boston, MA 02111-1307, USA.
+#
+# As a special exception, you may use this file as part of a free
+# software library without restriction.  Specifically, if other files
+# instantiate templates or use macros or inline functions from this
+# file, or you compile this file and link it with other files to
+# produce an executable, this file does not by itself cause the
+# resulting executable to be covered by the GNU General Public
+# License.
+# reasons why the executable file might be covered by the GNU General
+# Public License.
+
+# The Swilena Python Shell.
+
+echo 'The Swilena Python Shell (sps).'
+echo 'Type "help", "copyright", "credits" or "license" for more information.'
+echo 'Type "quit()" or ^D (Ctrl-D) to quit.'
Index: python/sps-local.in
--- python/sps-local.in	(revision 0)
+++ python/sps-local.in	(revision 0)
@@ -0,0 +1,6 @@
+								# -*- sh -*-
+
+# sps local version, for use from non installed distributions.
+PYTHONPATH='@abs_builddir@/python:@abs_srcdir@/python':"$PYTHONPATH" \
+DYLD_LIBRARY_PATH='.libs:@abs_top_builddir@/src/.libs' \
+exec @PYTHON@ -i @abs_srcdir@/swilena.py "$@"
Index: python/test.py
--- python/test.py	(revision 2096)
+++ python/test.py	(working copy)
@@ -27,8 +27,7 @@
 # reasons why the executable file might be covered by the GNU General
 # Public License.
 
-import ltihooks
-import image2d
+from swilena import *
 
 ima = image2d.image2d_int(3, 3)
 image2d.fill_image2d_int(ima, 42)
Index: python/Makefile.am
--- python/Makefile.am	(revision 2096)
+++ python/Makefile.am	(working copy)
@@ -46,6 +46,22 @@
 nodist_python_PYTHON = image2d.py
 
 
+## ---------------------------- ##
+## Swilena Python Shell (sps).  ##
+## ---------------------------- ##
+
+# FIXME: We might want to rename this shell as something else.
+
+python_PYTHON += swilena.py
+
+# The script to be used in installed distributions.
+bin_SCRIPTS = sps
+# The script to be used in non-installed distributions.
+noinst_SCRIPTS = sps-local
+
+CLEANFILES += $(bin_SCRIPTS) $(noinst_SCRIPTS)
+
+
 ## ------- ##
 ## Tests.  ##
 ## ------- ##
Index: python/swilena.py
--- python/swilena.py	(revision 0)
+++ python/swilena.py	(revision 0)
@@ -0,0 +1,31 @@
+#! /usr/bin/env python
+
+# Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+#
+# This file is part of the Olena Library.  This library is free
+# software; you can redistribute it and/or modify it under the terms
+# of the GNU General Public License version 2 as published by the
+# Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this library; see the file COPYING.  If not, write to
+# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+# Boston, MA 02111-1307, USA.
+#
+# As a special exception, you may use this file as part of a free
+# software library without restriction.  Specifically, if other files
+# instantiate templates or use macros or inline functions from this
+# file, or you compile this file and link it with other files to
+# produce an executable, this file does not by itself cause the
+# resulting executable to be covered by the GNU General Public
+# License.
+# reasons why the executable file might be covered by the GNU General
+# Public License.
+
+import ltihooks
+import image2d
Index: python/sps.in
--- python/sps.in	(revision 0)
+++ python/sps.in	(revision 0)
@@ -0,0 +1,6 @@
+								# -*- sh -*-
+
+# sps, for use from an installed distribution.
+PYTHONPATH='@pythondir@':"$PYTHONPATH" \
+DYLD_LIBRARY_PATH='@pythondir@:@libdir@' \
+exec @PYTHON@ -i @pythondir@/swilena.py "$@"
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        https://svn.lrde.epita.fr/svn/oln/trunk
Well, this is just a start.  The good news is, it took less than a day to
reuse the good recipes learned from Olena 0.11, TC and clspr.
Index: ChangeLog
from  Roland Levillain  <roland(a)lrde.epita.fr>
	Revive Swilena.
	* build-aux/pypath.m4, build-aux/swig.m4: New, imported.
	* build-aux/with-swilena.m4: New, imported from TC and adjusted.
	* configure.ac: Add support for Libtool, SWIG and Swilena.
	* Makefile.am (SUBDIRS): Append swilena.
	* swilena/: New directory.
 Makefile.am                |    3 
 build-aux/pypath.m4        |    6 +
 build-aux/swig.m4          |  149 +++++++++++++++++++++++++++
 build-aux/with-swilena.m4  |  107 +++++++++++++++++++
 configure.ac               |   13 ++
 swilena/ChangeLog          |   23 ++++
 swilena/Makefile.am        |    7 +
 swilena/image2d.i          |  248 +++++++++++++++++++++++++++++++++++++++++++++
 swilena/python/Makefile.am |   73 +++++++++++++
 swilena/python/ltihooks.py |   60 ++++++++++
 swilena/python/test.py     |   58 ++++++++++
 swilena/run.in             |   57 ++++++++++
 swilena/run.mk             |    6 +
 13 files changed, 810 insertions(+)
Index: swilena/image2d.i
--- swilena/image2d.i	(revision 0)
+++ swilena/image2d.i	(revision 0)
@@ -0,0 +1,248 @@
+//						       		-*- C++ -*-
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file image2d.i
+/// \brief A simple wrapping of mln::image2d<int> along with some
+/// algorithms.
+
+
+%module image2d
+
+
+/*------.
+| int.  |
+`------*/
+
+%include "cpointer.i"
+// Wrap a class interface around an "int *" (see
+// // http://www.swig.org/Doc1.3/Library.html#Library_nn4)
+// %pointer_class(int, intp);
+/* Create some functions for working with "int *" */
+%pointer_functions(int, intp);
+
+
+/*---------------.
+| mln::point2d.  |
+`---------------*/
+
+%{
+#include "mln/core/point.hh"
+#include "mln/core/point2d.hh"
+%}
+
+%include "mln/core/point.hh";
+%include "mln/core/point2d.hh";
+/* FIXME: Ignore `mln::point_<M,C>::origin' to circumvent a swig bug.
+   Without this ignore clause, the generated code would trigger this
+   error :
+
+     image2d-wrap.cc:3115:144: error: macro "SWIG_as_voidptr" passed 2
+     arguments, but takes just 1
+     image2d-wrap.cc: In function 'PyObject* point2d_origin_get()':
+     image2d-wrap.cc:3115: error: 'SWIG_as_voidptr' was not declared in this
+     scope
+
+   Check whether this bug has been fixed in a recent release of SWIG
+   or if it has been reported.  */
+%ignore mln::point_<mln::grid::square,int>::origin;
+// Ignoring to_h_vec saves us the wrapping of 
+%ignore mln::point_<mln::grid::square,int>::to_h_vec;
+// Swig tries to wrap everything by default; prevent it from wrapping
+// invalid methods (1D and 3D ctors for a point2d).
+%ignore mln::point_<mln::grid::square,int>::point_(const literal::zero_t&);
+%ignore mln::point_<mln::grid::square,int>::point_(const literal::one_t&);
+%ignore mln::point_<mln::grid::square,int>::point_(int);
+%ignore mln::point_<mln::grid::square,int>::point_(int, int, int);
+// point2d.
+%template(point2d) mln::point_<mln::grid::square,int>;
+
+/*--------------------.
+| mln::image2d<int>.  |
+`--------------------*/
+
+%{
+#include "mln/core/image2d.hh"
+%}
+
+%include "mln/core/box2d.hh";
+%include "mln/core/dpoint2d.hh";
+
+%include "mln/core/concept/image.hh";
+
+// FIXME: Wrap mln::image2d by hand, for Milena macros disturb swig.
+// Annotate the original source code instead?
+namespace mln
+{
+  template <typename T>
+  struct image2d
+  /* FIXME: This is a simple wrapping; ignore the base class (for the
+     moment). */
+  // : public internal::image_primary_< box2d, image2d<T> >
+  /* FIXME: Cheat, so that generic algorithms can use mln::image2d. */
+    :  public Image< image2d<T> >
+  {
+    // Warning: just to make effective types appear in Doxygen:
+    typedef box2d   pset;
+    typedef point2d psite;
+    typedef point2d point;
+    typedef dpoint2d dpoint;
+// FIXME: Those typedefs disturb swig.
+//     typedef mln_fwd_piter(box2d) fwd_piter;
+//     typedef mln_bkd_piter(box2d) bkd_piter;
+    typedef line_piter_<point> line_piter;
+    // End of warning.
+
+
+    /// Value associated type.
+    typedef T         value;
+
+    /// Return type of read-only access.
+    typedef const T& rvalue;
+
+    /// Return type of read-write access.
+    typedef T&       lvalue;
+
+
+    /// Skeleton.
+    typedef image2d< tag::value_<T> > skeleton;
+
+
+    /// Value_Set associated type.
+    typedef mln::value::set<T> vset;
+
+
+    /// Constructor without argument.
+    image2d();
+
+    /// Constructor with the numbers of rows and columns and the
+    /// border thickness.
+    image2d(int nrows, int ncols, unsigned bdr = border::thickness);
+
+    /// Constructor with a box and the border thickness (default is
+    /// 3).
+    image2d(const box2d& b, unsigned bdr = border::thickness);
+
+
+    /// Initialize an empty image.
+    void init_(const box2d& b, unsigned bdr = border::thickness);
+
+
+    /// Test if \p p is valid.
+    bool owns_(const point2d& p) const;
+
+    /// Give the set of values of the image.
+    const vset& values() const;
+
+    /// Give the definition domain.
+    const box2d& domain() const;
+
+    /// Give the border thickness.
+    unsigned border() const;
+
+    /// Give the number of cells (points including border ones).
+    std::size_t ncells() const;
+
+    /// Read-only access to the image value located at point \p p.
+    const T& operator()(const point2d& p) const;
+
+    /// Read-write access to the image value located at point \p p.
+    T& operator()(const point2d& p);
+
+// FIXME: swig won't wrap this operator.
+//     /// Read-only access to the image value located at offset \p o.
+//     const T& operator[](unsigned o) const;
+
+// FIXME: swig won't wrap this operator.
+//     /// Read-write access to the image value located at offset \p o.
+//     T& operator[](unsigned o);
+
+    /// Read-only access to the image value located at (\p row, \p col).
+    const T& at(int row, int col) const;
+
+    /// Read-write access to the image value located at (\p row, \p col).
+    T& at(int row, int col);
+
+
+    /// Fast Image method
+
+    /// Give the offset corresponding to the delta-point \p dp.
+    int offset(const dpoint2d& dp) const;
+
+    /// Give the point corresponding to the offset \p o.
+    point2d point_at_offset(unsigned o) const;
+
+    /// Give a hook to the value buffer.
+    const T* buffer() const;
+
+    /// Give a hook to the value buffer.
+    T* buffer();
+
+
+    /// Resize image border with new_border.
+    void resize_(unsigned new_border);
+  };
+
+} // end of namespace mln
+
+%template(image2d_int) mln::image2d<int>;
+
+
+/*-------------------.
+| mln::level::fill.  |
+`-------------------*/
+
+%{
+#include "mln/level/fill.hh"
+%}
+
+// FIXME: Wrap mln::level::fill by hand, for mln_value(I) disturbs
+// swig.  Annotate the original source code instead?
+namespace mln
+{
+  namespace level
+  {
+    template <typename I>
+    void fill(mln::Image<I>& ima, const typename I::value& v);
+  } // end of namespace mln::level
+
+} // end of namespace mln
+
+%template(fill_image2d_int) mln::level::fill< mln::image2d<int> >;
+
+
+/*----------------------.
+| mln::debug::println.  |
+`----------------------*/
+
+%{
+  #include "mln/debug/println.hh"
+%}
+
+%include "mln/debug/println.hh"
+
+%template(println_image2d_int) mln::debug::println< mln::image2d<int> >;
Index: swilena/python/ltihooks.py
--- swilena/python/ltihooks.py	(revision 0)
+++ swilena/python/ltihooks.py	(revision 0)
@@ -0,0 +1,60 @@
+# -*- Mode: Python; py-indent-offset: 4 -*-
+# ltihooks.py: python import hooks that understand libtool libraries.
+# Copyright (C) 2000 James Henstridge.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+import os, ihooks
+
+class LibtoolHooks(ihooks.Hooks):
+    def get_suffixes(self):
+        """Like normal get_suffixes, but adds .la suffixes to list"""
+	ret = ihooks.Hooks.get_suffixes(self)
+	ret.insert(0, ('module.la', 'rb', 3))
+	ret.insert(0, ('.la', 'rb', 3))
+	return ret
+
+    def load_dynamic(self, name, filename, file=None):
+        """Like normal load_dynamic, but treat .la files specially"""
+	if len(filename) > 3 and filename[-3:] == '.la':
+	    fp = open(filename, 'r')
+	    dlname = ''
+	    installed = 1
+	    line = fp.readline()
+	    while line:
+		if len(line) > 7 and line[:7] == 'dlname=':
+		    dlname = line[8:-2]
+		elif len(line) > 10 and line[:10] == 'installed=':
+		    installed = line[10:-1] == 'yes'
+		line = fp.readline()
+	    fp.close()
+	    if dlname:
+		if installed:
+		    filename = os.path.join(os.path.dirname(filename),
+					    dlname)
+		else:
+		    filename = os.path.join(os.path.dirname(filename),
+					    '.libs', dlname)
+	return ihooks.Hooks.load_dynamic(self, name, filename, file)
+
+importer = ihooks.ModuleImporter()
+importer.set_hooks(LibtoolHooks())
+
+def install():
+    importer.install()
+def uninstall():
+    importer.uninstall()
+
+install()
Index: swilena/python/test.py
--- swilena/python/test.py	(revision 0)
+++ swilena/python/test.py	(revision 0)
@@ -0,0 +1,58 @@
+#! /usr/bin/env python
+
+# Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+#
+# This file is part of the Olena Library.  This library is free
+# software; you can redistribute it and/or modify it under the terms
+# of the GNU General Public License version 2 as published by the
+# Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this library; see the file COPYING.  If not, write to
+# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+# Boston, MA 02111-1307, USA.
+#
+# As a special exception, you may use this file as part of a free
+# software library without restriction.  Specifically, if other files
+# instantiate templates or use macros or inline functions from this
+# file, or you compile this file and link it with other files to
+# produce an executable, this file does not by itself cause the
+# resulting executable to be covered by the GNU General Public
+# License.
+# reasons why the executable file might be covered by the GNU General
+# Public License.
+
+import ltihooks
+import image2d
+
+ima = image2d.image2d_int(3, 3)
+image2d.fill_image2d_int(ima, 42)
+
+# FIXME: For the moment, we can't write
+#
+#   ima(image2d.point2d(i, j))
+#
+# but I don't know why.  Anyway, eventually we'd like to be able to
+# write this:
+#
+#   for p in ima.domain():
+#     print "ima(" + str(i) + ", " + str(j) + ") = " + ima(p)
+#
+# as it is generic and way closer to what we do in C++.
+for i in range(0, 3):
+  for j in range(0, 3):
+    p = image2d.point2d(i, j)
+    # FIXME: Handling POD types (like int) as value types is not
+    # transparent: ima(p) returns a pointer to int wrapped in a SWIG
+    # object, and cannot be easily converted to a Python integer
+    # value.  Hence this explicit conversion using `intp_value'.
+    v = image2d.intp_value(ima(p))
+    print "ima(" + str(i) + ", " + str(j) + ") = " + str(v)
+
+print
+image2d.println_image2d_int(ima)
Index: swilena/python/Makefile.am
--- swilena/python/Makefile.am	(revision 0)
+++ swilena/python/Makefile.am	(revision 0)
@@ -0,0 +1,73 @@
+## Process this file through Automake to produce Makefile.in -*- Makefile -*-
+
+## ------------------ ##
+## Generic material.  ##
+## ------------------ ##
+
+## FIXME: Factor as much as possible.  See how we handled this in TC.
+
+CLEANFILES =
+AM_CPPFLAGS = -I$(PYTHONINC) -I$(top_srcdir)/milena
+AM_SWIGFLAGS = -c++ -python -I$(top_srcdir)/milena
+## We build modules, not plain libs.
+AM_LDFLAGS = -avoid-version -module -shared
+#### All the modules depend on libhw.
+##AM_LIBADD = $(top_builddir)/libhw.la
+
+## Run Swig to create the C++ wrapper files, the Python interface
+## files, and the dependency Makefile snippets.
+%-wrap.cc %.py: $(top_srcdir)/swilena/%.i
+	if $(SWIG) $(AM_SWIGFLAGS) $(SWIGFLAGS) -MD -MF "$(DEPDIR)/$*-wrap.Tcc" -o $@ $<; then \
+	  mv -f "$(DEPDIR)/$*-wrap.Tcc" "$(DEPDIR)/$*-wrap.Pcc";\
+	else \
+	  rm -f "$(DEPDIR)/$*-wrap.Tcc"; exit 1;\
+	fi
+
+# ltihooks.py: Python import hooks that understand Libtool libraries.
+python_PYTHON = ltihooks.py
+
+
+## ----------------- ##
+## Wrapped modules.  ##
+## ----------------- ##
+
+## FIXME: All of this should be generated.
+## Don't forget to add a `deps-reset' target as in TC.
+
+## image2d.
+pyexec_LTLIBRARIES = _image2d.la
+nodist__image2d_la_SOURCES = image2d-wrap.cc
+_image2d_la_LIBADD = $(AM_LIBADD)
+CLEANFILES += $(nodist__image2d_la_SOURCES) image2d.py image2d.py[co]
+## Include the dependency files.  Copied from Automake's generated
+## case for C++.
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_image2d-wrap.Pcc@am__quote@
+
+nodist_python_PYTHON = image2d.py
+
+
+## ------- ##
+## Tests.  ##
+## ------- ##
+
+include $(top_srcdir)/swilena/run.mk
+
+## FIXME: Do we really need to pass top_srcdir and top_builddir to run?
+##TESTS_ENVIRONMENT = \
+##  top_srcdir="$(top_srcdir)" top_builddir="$(top_builddir)" $(RUN)
+TESTS_ENVIRONMENT = $(RUN)
+# Ensure `run' is rebuilt before the tests are run.
+$(TESTS): $(srcdir)/run.stamp
+# The dependency is on `run.in' and not `run', since `run' is
+# regenerated at distribution time, and voids the time stamps (which
+# we don't want!).
+EXTRA_DIST = $(srcdir)/run.stamp
+$(srcdir)/run.stamp: $(RUN_IN)
+	@rm -f $@
+	@rm -f $@.tmp
+	@touch $@.tmp
+	$(MAKE) $(AM_MAKEFLAGS) $(RUN)
+	@mv -f $@.tmp $@
+
+TESTS = test.py
+EXTRA_DIST += $(TESTS)
Index: swilena/ChangeLog
--- swilena/ChangeLog	(revision 0)
+++ swilena/ChangeLog	(revision 0)
@@ -0,0 +1,23 @@
+2008-07-22  Roland Levillain  <roland(a)lrde.epita.fr>
+
+	Revive Swilena.
+
+	* swilena/image2d.i: New SWIG wrapper.
+	* swilena/run.in: New helper, imported from TC.
+	* swilena/Makefile.am: New.
+	* swilena/run.mk: New, imported from TC and adjusted.
+
+	* swilena/python/: New directory.
+	* swilena/python/ltihooks.py: New, imported.
+	* swilena/python/test.py: New test.
+	* swilena/python/Makefile.am: New.
+
+
+$Rev$
+$Id$
+$Date$
+
+Local Variables:
+ispell-local-dictionary: "american"
+coding: iso-latin-1
+End:
Property changes on: swilena/ChangeLog
___________________________________________________________________
Name: svn:keywords
   + Rev
Id
Date
Index: swilena/Makefile.am
--- swilena/Makefile.am	(revision 0)
+++ swilena/Makefile.am	(revision 0)
@@ -0,0 +1,7 @@
+## Process this file through Automake to produce Makefile.in -*- Makefile -*-
+
+SUBDIRS = python
+
+EXTRA_DIST = image2d.i
+
+check_SCRIPTS = run
Index: swilena/run.in
--- swilena/run.in	(revision 0)
+++ swilena/run.in	(revision 0)
@@ -0,0 +1,57 @@
+#!/bin/sh
+# Copyright (C) 2003, 2004, 2006  Laboratoire d'Informatique de Paris 6
+# (LIP6), d�partement Syst�mes R�partis Coop�ratifs (SRC), Universit�
+# Pierre et Marie Curie.
+#
+# This file is part of Spot, a model checking library.
+#
+# Spot is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# Spot is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Spot; see the file COPYING.  If not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+
+# If we are running from make check (srcdir is set) and VERBOSE is
+# unset, be quiet.
+test -n "$srcdir" && test -z "$VERBOSE" && exec >/dev/null 2>&1
+
+# Darwin needs some help in figuring out where non-installed libtool
+# libraries are (on this platform libtool encodes the expected final
+# path of dependent libraries in each library).
+modpath='.libs:@abs_top_builddir@/src/.libs'
+
+case $1 in
+  '' | *.py)
+    PYTHONPATH='@abs_builddir@/python:@abs_srcdir@/python':"$PYTHONPATH" \
+    DYLD_LIBRARY_PATH=$modpath \
+    exec @PYTHON@ "$@"
+    ;;
+  # What's the point in adding `.libs' to SWILENA_RUBY_PATH?
+  #
+  # As some of our SWIG interfaces import other SWIG interfaces
+  # (with the `%import' keyword), we must add the `.libs' directory
+  # to SWILENA_RUBY_PATH so that the Ruby interpreter can load the
+  # corresponding dynamic module(s) (SWIG's `%import' statements
+  # generate code in dynamic modules that bypass Ruby's
+  # `Kernel.require' mechanism).
+  *.rb)
+    SWILENA_RUBY_PATH='@abs_builddir@/ruby:@abs_srcdir@/ruby:.libs' \
+    DYLD_LIBRARY_PATH=$modpath \
+    exec @RUBY@ "$@"
+  ;;
+  *.test)
+    exec sh -x "$@";;
+  *)
+    echo "Unknown extension" 2>&1
+    exit 2;;
+esac
Property changes on: swilena/run.in
___________________________________________________________________
Name: svn:executable
   + *
Index: swilena/run.mk
--- swilena/run.mk	(revision 0)
+++ swilena/run.mk	(revision 0)
@@ -0,0 +1,6 @@
+# A test/script wrapper.
+
+RUN = $(top_builddir)/swilena/run
+RUN_IN = $(top_srcdir)/swilena/run.in
+$(RUN): $(RUN_IN)
+	cd $(top_builddir)/swilena && $(MAKE) $(AM_MAKEFLAGS) run
Index: configure.ac
--- configure.ac	(revision 2095)
+++ configure.ac	(working copy)
@@ -98,6 +98,19 @@
 AM_CONDITIONAL([CFITSIO], [test x$oln_have_cfitsio = xyes])
 
 
+## --------- ##
+## Swilena.  ##
+## --------- ##
+
+AC_PROG_LIBTOOL
+
+OLN_WITH_SWILENA([with_swilena=yes], [with_swilena=no])
+AM_CONDITIONAL([ENABLE_SWILENA], [test x$with_swilena = xyes])
+
+AC_CONFIG_FILES([swilena/Makefile swilena/python/Makefile])
+AC_CONFIG_FILES([swilena/run], [chmod +x swilena/run])
+
+
 ## --------------- ##
 ## Configuration.  ##
 ## --------------- ##
Index: Makefile.am
--- Makefile.am	(revision 2095)
+++ Makefile.am	(working copy)
@@ -3,3 +3,6 @@
 ACLOCAL_AMFLAGS = -I build-aux
 
 SUBDIRS = build-aux external milena
+
+# FIXME: Make Swilena optional (see TC's equipment).
+SUBDIRS += swilena
Index: build-aux/pypath.m4
--- build-aux/pypath.m4	(revision 0)
+++ build-aux/pypath.m4	(revision 0)
@@ -0,0 +1,6 @@
+AC_DEFUN([adl_CHECK_PYTHON], 
+ [AM_PATH_PYTHON([2.0])
+  AC_CACHE_CHECK([for $am_display_PYTHON includes directory],
+    [adl_cv_python_inc],
+    [adl_cv_python_inc=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()" 2>/dev/null`])
+  AC_SUBST([PYTHONINC], [$adl_cv_python_inc])])
Index: build-aux/swig.m4
--- build-aux/swig.m4	(revision 0)
+++ build-aux/swig.m4	(revision 0)
@@ -0,0 +1,149 @@
+dnl @synopsis AC_PROG_SWIG([major.minor.micro])
+dnl
+dnl This macro searches for a SWIG installation on your system. If found you
+dnl should call SWIG via $(SWIG).  You can use the optional first argument to
+dnl check if the version of the available SWIG is greater than or equal to the
+dnl value of the argument.  It should have the format: N[.N[.N]] (N is a
+dnl number between 0 and 999.  Only the first N is mandatory.)
+dnl
+dnl If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks that the
+dnl swig package is this version number or higher.
+dnl
+dnl In configure.in, use as:
+dnl
+dnl             AC_PROG_SWIG(1.3.17)
+dnl             SWIG_ENABLE_CXX
+dnl             SWIG_MULTI_MODULE_SUPPORT
+dnl             SWIG_PYTHON
+dnl
+dnl @author Sebastian Huber <sebastian-huber(a)web.de>, Alan W. Irwin <irwin(a)beluga.phys.uvic.ca>, Rafael Laboissiere <rafael(a)laboissiere.net>, and Andrew Collier <abcollier(a)yahoo.com>.
+dnl @version $Id: ac_pkg_swig.m4,v 1.2 2004/12/24 01:20:01 guidod Exp $
+dnl
+AC_DEFUN([AC_PROG_SWIG],[
+        AC_PATH_PROG([SWIG],[swig])
+        if test -z "$SWIG" ; then
+                AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org]
+                SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
+        elif test -n "$1" ; then
+                AC_MSG_CHECKING([for SWIG version])
+                [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
+                AC_MSG_RESULT([$swig_version])
+                if test -n "$swig_version" ; then
+                        # Calculate the required version number components
+                        [required=$1]
+                        [required_major=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_major" ; then
+                                [required_major=0]
+                        fi
+                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+                        [required_minor=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_minor" ; then
+                                [required_minor=0]
+                        fi
+                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+                        [required_patch=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_patch" ; then
+                                [required_patch=0]
+                        fi
+                        # Calculate the available version number components
+                        [available=$swig_version]
+                        [available_major=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_major" ; then
+                                [available_major=0]
+                        fi
+                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+                        [available_minor=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_minor" ; then
+                                [available_minor=0]
+                        fi
+                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+                        [available_patch=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_patch" ; then
+                                [available_patch=0]
+                        fi
+                        if test $available_major -ne $required_major \
+                                -o $available_minor -ne $required_minor \
+                                -o $available_patch -lt $required_patch ; then
+                                AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version.  You should look at http://www.swig.org]
+                                SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+                        else
+                                AC_MSG_NOTICE([SWIG executable is '$SWIG'])
+                                SWIG_LIB=`$SWIG -swiglib`
+                                AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
+                        fi
+                else
+                        AC_MSG_WARN([cannot determine SWIG version])
+                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
+                fi
+        fi
+        AC_SUBST([SWIG_LIB])
+])
+
+# SWIG_ENABLE_CXX()
+#
+# Enable SWIG C++ support.  This affects all invocations of $(SWIG).
+AC_DEFUN([SWIG_ENABLE_CXX],[
+        AC_REQUIRE([AC_PROG_SWIG])
+        AC_REQUIRE([AC_PROG_CXX])
+        SWIG="$SWIG -c++"
+])
+
+# SWIG_MULTI_MODULE_SUPPORT()
+#
+# Enable support for multiple modules.  This effects all invocations
+# of $(SWIG).  You have to link all generated modules against the
+# appropriate SWIG runtime library.  If you want to build Python
+# modules for example, use the SWIG_PYTHON() macro and link the
+# modules against $(SWIG_PYTHON_LIBS).
+#
+AC_DEFUN([SWIG_MULTI_MODULE_SUPPORT],[
+        AC_REQUIRE([AC_PROG_SWIG])
+        SWIG="$SWIG -noruntime"
+])
+
+# SWIG_PYTHON([use-shadow-classes = {no, yes}])
+#
+# Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS),
+# and $(SWIG_PYTHON_OPT) output variables.
+#
+# $(SWIG_PYTHON_OPT) contains all necessary SWIG options to generate
+# code for Python.  Shadow classes are enabled unless the value of the
+# optional first argument is exactly 'no'.  If you need multi module
+# support (provided by the SWIG_MULTI_MODULE_SUPPORT() macro) use
+# $(SWIG_PYTHON_LIBS) to link against the appropriate library.  It
+# contains the SWIG Python runtime library that is needed by the type
+# check system for example.
+AC_DEFUN([SWIG_PYTHON],[
+        AC_REQUIRE([AC_PROG_SWIG])
+        AC_REQUIRE([AC_PYTHON_DEVEL])
+        test "x$1" != "xno" || swig_shadow=" -noproxy"
+        AC_SUBST([SWIG_PYTHON_OPT],[-python$swig_shadow])
+        AC_SUBST([SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS])
+])
+
+
+dnl @synopsis AC_LIB_WAD
+dnl
+dnl This macro searches for installed WAD library.
+dnl
+AC_DEFUN([AC_LIB_WAD],
+[
+        AC_REQUIRE([AC_PYTHON_DEVEL])
+        AC_ARG_ENABLE(wad,
+        AC_HELP_STRING([--enable-wad], [enable wad module]),
+        [
+                case "${enableval}" in
+                        no)     ;;
+                        *)      if test "x${enableval}" = xyes;
+                                then
+                                        check_wad="yes"
+                                fi ;;
+                esac
+        ], [])
+
+        if test -n "$check_wad";
+        then
+                AC_CHECK_LIB(wadpy, _init, [WADPY=-lwadpy], [], $PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS)
+                AC_SUBST(WADPY)
+        fi
+])
Index: build-aux/with-swilena.m4
--- build-aux/with-swilena.m4	(revision 0)
+++ build-aux/with-swilena.m4	(revision 0)
@@ -0,0 +1,107 @@
+#                                                       -*- Autoconf -*-
+
+# FIXME: Revamp and make it generic, so that it can shared among
+# Olena, TC and clspr.
+
+# _OLN_WITH_SWIG(HAS-SWIG, HAS-NOT)
+# ---------------------------------
+# Check whether SWIG is requested, enabled, or disabled.  If
+# requested, check that Python is present as needed.  If enabled,
+# actually enable only if the environment is complete.
+AC_DEFUN([_OLN_WITH_SWIG],
+# FIXME: `with-swig' used to be set to `auto', but `no' is prefered
+# now, as
+# 1. users don't necessarily want to build Swilena by default;
+# 2. the `auto' flag is not honored by the checks for Python and Ruby.
+[AC_ARG_WITH([swig],
+	    [AC_HELP_STRING([--with-swig],
+			    [require SWIG modules (defaults to no)])],
+            [],
+	    [with_swig=no])
+
+case $with_swig:$enable_shared in
+  auto:no)
+  AC_MSG_NOTICE([SWIG use disabled: dynamic libraries disabled])
+  with_swig=no
+  ;;
+esac
+
+if test x$with_swig != xno; then
+  oln_has_swig=yes
+  AM_PATH_PYTHON([2.3])
+  adl_CHECK_PYTHON
+
+  # Check for Python and SWIG.
+  save_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS -I$PYTHONINC"
+  AC_CHECK_HEADERS([Python.h],
+		   [python_headers=yes],
+	           [python_headers=no])
+
+  if test x$python_headers = xno; then
+    oln_has_swig=no
+    if test x$with_swig = xyes; then
+      AC_MSG_ERROR(
+	  [Python.h is required to build SWIG modules.
+	  Add `-I python_include_path' to `CPPFLAGS'
+	  or `--without-swig' to disable SWIG modules.])
+    fi
+  fi
+
+  CPPFLAGS=$save_CPPFLAGS
+
+  # Check for Ruby.
+  AC_CHECK_PROGS([RUBY], [ruby], [$am_aux_dir/missing ruby])
+  if test "x$RUBY" = "x$am_aux_dir/missing ruby"; then
+    AC_MSG_ERROR([no suitable Ruby interpreter found])
+  fi
+
+  AC_ARG_VAR([RUBY_CPPFLAGS], [Path to ruby.h])
+  AC_ARG_WITH([ruby-includedir], [Include path for ruby.h],
+	      [RUBY_CPPFLAGS="-I$withval"],
+	      [RUBY_CPPFLAGS="-I`$RUBY -e 'puts $:.join("\n")' | \
+		 while read line
+		   do
+		   if [[ -f ${line}/ruby.h ]]; then
+		     echo $line
+		   fi
+		 done`"])
+  save_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS $RUBY_CPPFLAGS"
+  AC_CHECK_HEADERS([ruby.h], [],
+    [AC_MSG_ERROR(
+	    [You need Ruby development files to compile the Ruby interface.])])
+  CPPFLAGS=$save_CPPFLAGS
+
+  AC_PROG_SWIG([1.3.29])
+  if (eval "$SWIG -version") >/dev/null 2>&1; then :; else
+    oln_has_swig=no
+  fi
+
+  case $with_swig:$oln_has_swig in
+    yes:no)
+      AC_MSG_ERROR([SWIG 1.3.29 is required.
+		    Use `--without-swig' to disable SWIG modules.]);;
+  esac
+fi
+
+case $oln_has_swig in
+  yes) $1;;
+  * )  $2;;
+esac
+])
+
+# OLN_WITH_SWILENA(WITH, WITHOUT)
+# -------------------------------
+# Should we build Swilena or not.
+AC_DEFUN([OLN_WITH_SWILENA],
+[AC_CACHE_CHECK([whether building Swilena],
+                [oln_cv_with_swilena],
+                [_OLN_WITH_SWIG([oln_cv_with_swilena=yes],
+                                [oln_cv_with_swilena=no])])
+case $oln_cv_with_swilena in
+  yes) $1;;
+  no ) $2;;
+  *)   AC_MSG_ERROR([incorrect oln_cv_with_swilena value: $oln_cv_with_swilena]);;
+esac
+])
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0