diff --git a/Adapt/Makefile b/Adapt/Makefile
index a2b4d0a667236ac971371017fa1c8f5cd3e24312..035393d427f75c7f83822e4e442be346362846ab 100644
--- a/Adapt/Makefile
+++ b/Adapt/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.5 2000-11-27 17:13:35 geuzaine Exp $
+# $Id: Makefile,v 1.6 2000-12-29 10:27:00 geuzaine Exp $
 #
 # Makefile for "libAdapt.a"
 #
@@ -8,7 +8,7 @@
 CC        = c++
 C_FLAGS   = -g
 
-OS_FLAGS  = -D_UNIX
+OS_FLAGS  = -D_XMOTIF
 
 RM        = rm
 RMFLAGS   = -f
@@ -58,9 +58,8 @@ depend:
 
 # DO NOT DELETE THIS LINE
 Adapt.o: Adapt.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Adapt.h nrutil.h \
- ../Common/Const.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h Adapt.h nrutil.h ../Common/Const.h
 mnbrak.o: mnbrak.cpp nrutil.h ../Common/Const.h
 brent.o: brent.cpp nrutil.h ../Common/Const.h
 nrutil.o: nrutil.cpp
diff --git a/Box/Makefile b/Box/Makefile
index 1bdf9b01c65e2da96d297454f66edde4b84d6211..1cd7bdb4ceae24e65fb938b7f9dff65afca79ab7 100644
--- a/Box/Makefile
+++ b/Box/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 2000-11-25 15:26:10 geuzaine Exp $
+# $Id: Makefile,v 1.3 2000-12-29 10:27:00 geuzaine Exp $
 #
 # Makefile for ".a"
 #
@@ -9,7 +9,7 @@ CC            = c++
 C_FLAGS       = -g
 
 VERSION_FLAGS = 
-OS_FLAGS      = -D_UNIX 
+OS_FLAGS      = 
 
 RM       = rm
 RMFLAGS  = -f
diff --git a/Common/GmshUI.h b/Common/GmshUI.h
index 78a5b0d1cc94a57bac2771c33c4c2b53ef3a98ba..a01dc3791a91789ceb021b6c25fd9851045ec78d 100644
--- a/Common/GmshUI.h
+++ b/Common/GmshUI.h
@@ -1,8 +1,6 @@
-/* $Id: GmshUI.h,v 1.3 2000-11-23 14:11:28 geuzaine Exp $ */
+/* $Id: GmshUI.h,v 1.4 2000-12-29 10:27:00 geuzaine Exp $ */
 
-#ifdef _UNIX
-
-/* UNIX includes */
+#if defined(_XMOTIF) /* UNIX with X and Motif */
 
 #include <X11/keysym.h>
 #include <Xm/XmAll.h>
@@ -11,9 +9,11 @@
 #include <GL/glx.h>
 #include <GLwMDrawA.h>
 
-#else
+#elif defined(_FLTK) /* FLTK widget set */
+
+#error "Not ready yet for FLTK..."
 
-/* Windows includes */
+#elif defined(_WINDOWS) /* Pure Windows */
 
 #include<windows.h>
 #include <GL/gl.h>
@@ -22,4 +22,6 @@ extern "C"{
 #include <GL/glaux.h>
 }
 
+#else
+
 #endif
diff --git a/Common/Makefile b/Common/Makefile
index f256eef01e295cd51601a07c19788589a2ba1c11..2369fa1891f01055e01c97948f7641096d3accfa 100644
--- a/Common/Makefile
+++ b/Common/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.6 2000-12-08 10:56:36 geuzaine Exp $
+# $Id: Makefile,v 1.7 2000-12-29 10:27:00 geuzaine Exp $
 #
 # Makefile for "libCommon.a"
 #
@@ -8,7 +8,7 @@
 CC        = c++
 C_FLAGS   = -g -Wall
 
-OS_FLAGS  = -D_UNIX
+OS_FLAGS  = -D_XMOTIF
 
 RANLIB   = ranlib
 RM       = rm
@@ -51,15 +51,14 @@ depend:
 
 # DO NOT DELETE THIS LINE
 Context.o: Context.cpp Gmsh.h Message.h ../DataStr/Malloc.h \
- ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h \
- ../DataStr/Tools.h Const.h ../Geo/Geo.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
- ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Context.h \
- trackball.c trackball.h
-Views.o: Views.cpp Gmsh.h Message.h ../DataStr/Malloc.h \
- ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h \
- ../DataStr/Tools.h Views.h Const.h ColorTable.h Context.h
+  ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
+  Const.h ../Geo/Geo.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h \
+  ../Graphics/Draw.h ../Common/Views.h ../Common/Const.h \
+  ../Common/ColorTable.h Context.h trackball.c trackball.h
+Views.o: Views.cpp Gmsh.h Message.h ../DataStr/Malloc.h ../DataStr/List.h \
+  ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h Views.h Const.h \
+  ColorTable.h Context.h
 ColorTable.o: ColorTable.cpp Gmsh.h Message.h ../DataStr/Malloc.h \
- ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h \
- ../DataStr/Tools.h ColorTable.h Context.h
+  ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
+  ColorTable.h Context.h
diff --git a/Geo/Makefile b/Geo/Makefile
index 86529801df2fb7757359015f746cd7e060daf968..39e2a0b93360f8d24fa53415624aa9faa367eb38 100644
--- a/Geo/Makefile
+++ b/Geo/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.6 2000-12-07 08:46:16 geuzaine Exp $
+# $Id: Makefile,v 1.7 2000-12-29 10:27:00 geuzaine Exp $
 #
 # Makefile for "libGeo.a"
 #
@@ -8,7 +8,7 @@
 CC        = c++
 C_FLAGS   = -g -Wall
 
-OS_FLAGS  = -D_UNIX
+OS_FLAGS  = -D_XMOTIF
 
 RANLIB   = ranlib
 RM       = rm
@@ -54,45 +54,43 @@ depend:
 	$(RM) $(RMFLAGS) Makefile.new
 
 # DO NOT DELETE THIS LINE
-CAD.o: CAD.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Geo.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h DataBase.h \
- ../Mesh/Interpolation.h ../Mesh/Numeric.h ../Common/Const.h \
- ../Mesh/Create.h CAD.h ../Common/Context.h
+CAD.o: CAD.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
+  ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
+  Geo.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h DataBase.h \
+  ../Mesh/Interpolation.h ../Mesh/Numeric.h ../Common/Const.h \
+  ../Mesh/Create.h CAD.h ../Common/Context.h
 DataBase.o: DataBase.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Geo.h \
- ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h CAD.h ../Mesh/Create.h \
- Verif.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Geo.h \
+  ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h CAD.h ../Mesh/Create.h Verif.h \
+  ../Common/Context.h
 MinMax.o: MinMax.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h \
- ../Mesh/Vertex.h ../Common/Context.h
-ExtrudeParams.o: ExtrudeParams.cpp ../Common/Gmsh.h \
- ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
- ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h Geo.h CAD.h \
- ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h ExtrudeParams.h
-Geo.o: Geo.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Geo.h CAD.h \
- ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h DataBase.h ../Parser/Parser.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Mesh/Vertex.h \
+  ../Common/Context.h
+ExtrudeParams.o: ExtrudeParams.cpp ../Common/Gmsh.h ../Common/Message.h \
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h Geo.h CAD.h ../Mesh/Mesh.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ExtrudeParams.h
+Geo.o: Geo.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
+  ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
+  ../Common/Const.h Geo.h CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h \
+  ../Mesh/Simplex.h ../Mesh/Edge.h ../Geo/ExtrudeParams.h \
+  ../Mesh/Metric.h DataBase.h ../Parser/Parser.h
 StepGeomDatabase.o: StepGeomDatabase.cpp ../Common/Gmsh.h \
- ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
- ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
- ../Common/Const.h Geo.h StepGeomDatabase.h DataBase.h \
- ../Common/Context.h
+  ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
+  ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h \
+  Geo.h StepGeomDatabase.h DataBase.h ../Common/Context.h
 Verif.o: Verif.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Geo.h CAD.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h DataBase.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h Geo.h CAD.h ../Mesh/Mesh.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h DataBase.h
 Print_Geo.o: Print_Geo.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Geo.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h CAD.h ../Common/Context.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h Geo.h ../Mesh/Mesh.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h CAD.h ../Common/Context.h
diff --git a/Graphics/Draw.cpp b/Graphics/Draw.cpp
index 1c8340f3717fd196ff1de742f07ee88d4365edde..1d8d3dc55cc0f35d0cca0d3c1ae4faeac416e637 100644
--- a/Graphics/Draw.cpp
+++ b/Graphics/Draw.cpp
@@ -1,4 +1,4 @@
-/* $Id: Draw.cpp,v 1.13 2000-12-27 10:07:20 geuzaine Exp $ */
+/* $Id: Draw.cpp,v 1.14 2000-12-29 10:27:00 geuzaine Exp $ */
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -10,7 +10,7 @@
 
 #include "CbGeneral.h"
 
-#ifdef _UNIX
+#ifdef _XMOTIF
 #include "Widgets.h"
 #include "XContext.h"
 extern XContext_T   XCTX ;
@@ -80,7 +80,7 @@ void Draw2d(void){
   glPopMatrix();
 }
 
-#ifdef _UNIX
+#ifdef _XMOTIF
 void Draw(void){
   glClearColor(UNPACK_RED(CTX.color.bg)/255.,
                UNPACK_GREEN(CTX.color.bg)/255.,
@@ -171,12 +171,12 @@ void Orthogonalize(int x, int y){
 /*  i n i t                                                                 */
 /* ------------------------------------------------------------------------ */
 
-#ifdef _UNIX
+#ifdef _XMOTIF
 #include <X11/IntrinsicP.h>
 #endif
 
 void Init(void){
-#ifdef _UNIX
+#ifdef _XMOTIF
   /* Resize Graphical Window if told to do it */
   XWindowAttributes  xattrib;
   XGetWindowAttributes(XtDisplay(WID.G.bottomForm),XtWindow(WID.G.bottomForm),&xattrib);
@@ -193,7 +193,7 @@ void Init(void){
 }
 
 void InitOv(void){
-#ifdef _UNIX
+#ifdef _XMOTIF
   glXMakeCurrent(XtDisplay(WID.G.glo), XtWindow(WID.G.glo), XCTX.glo.context);
 #endif
   Orthogonalize(0,0);
@@ -329,7 +329,7 @@ void Filter_SelectionBuffer(int n, GLuint *typ, GLuint *ient, Vertex **thev,
 }
 
 
-#ifdef _UNIX
+#ifdef _XMOTIF
 
 int check_type(int type, Vertex *v, Curve *c, Surface *s){
   return ( (type==ENT_POINT   && v) ||
@@ -416,7 +416,7 @@ void myZoom(GLdouble X1, GLdouble X2, GLdouble Y1, GLdouble Y2,
 /*  InitCb, ResizeCb, ExposeCb                                              */
 /* ------------------------------------------------------------------------ */
 
-#ifdef _UNIX
+#ifdef _XMOTIF
 
 void InitCb(Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *cb){
   glXMakeCurrent(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), XCTX.glw.context);
diff --git a/Graphics/Makefile b/Graphics/Makefile
index 6e67694134735b18e9d31216ecfe273e8e49a568..24bde7246e1a4a30f4a8154af0fe337f8537c9d2 100644
--- a/Graphics/Makefile
+++ b/Graphics/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.9 2000-12-26 17:40:18 geuzaine Exp $
+# $Id: Makefile,v 1.10 2000-12-29 10:27:00 geuzaine Exp $
 #
 # Makefile for "libGraphics.a"
 #
@@ -9,7 +9,7 @@ CC            = c++
 C_FLAGS       = -g -Wall
 
 VERSION_FLAGS = 
-OS_FLAGS      = -D_UNIX
+OS_FLAGS      = -D_XMOTIF
 
 GL_INCLUDE    = -I$(HOME)/SOURCES/Mesa-3.1/include\
                 -I$(HOME)/SOURCES/Mesa-3.1/include/GL
@@ -34,6 +34,8 @@ SRC = Draw.cpp \
       Entity.cpp \
       Scale.cpp \
       Axes.cpp \
+      CreateFile.cpp \
+      XDump.cpp\
       gl2ps.cpp\
       gl2gif.cpp\
       gl2jpeg.cpp\
@@ -124,13 +126,23 @@ Axes.o: Axes.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
   ../Mesh/Simplex.h ../Mesh/Edge.h ../Geo/ExtrudeParams.h \
   ../Mesh/Metric.h Draw.h ../Common/Views.h ../Common/ColorTable.h \
   ../Common/Context.h
+CreateFile.o: CreateFile.cpp ../Common/Gmsh.h ../Common/Message.h \
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Mesh/Mesh.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Unix/Main.h \
+  ../Common/Const.h Draw.h ../Common/Views.h ../Common/ColorTable.h \
+  ../Common/Context.h ../Unix/Widgets.h ../Unix/XContext.h XDump.h \
+  gl2ps.h gl2gif.h gl2jpeg.h gl2ppm.h gl2yuv.h
+XDump.o: XDump.cpp
 gl2ps.o: gl2ps.cpp gl2ps.h
-gl2gif.o: gl2gif.cpp gl2gif.h
+gl2gif.o: gl2gif.cpp ../Common/Gmsh.h ../Common/Message.h \
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h gl2gif.h
 gl2jpeg.o: gl2jpeg.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \
-  ../Common/Context.h ../jpeg/jpeglib.h ../jpeg/jconfig.h \
-  ../jpeg/jmorecfg.h ../jpeg/jerror.h
+  ../jpeg/jpeglib.h ../jpeg/jconfig.h ../jpeg/jmorecfg.h ../jpeg/jerror.h
 gl2ppm.o: gl2ppm.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h
diff --git a/Graphics/Scale.cpp b/Graphics/Scale.cpp
index a4587aace2ef22faaecab1763b19bbccc783eeaa..62dd3783a59bdd49a951c87da11128bdd5332a5a 100644
--- a/Graphics/Scale.cpp
+++ b/Graphics/Scale.cpp
@@ -1,4 +1,4 @@
-/* $Id: Scale.cpp,v 1.10 2000-12-20 10:40:52 geuzaine Exp $ */
+/* $Id: Scale.cpp,v 1.11 2000-12-29 10:27:00 geuzaine Exp $ */
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -10,7 +10,7 @@
 
 extern Context_T   CTX;
 
-#ifdef _UNIX
+#ifdef _XMOTIF
 #include "XContext.h"
 extern XContext_T  XCTX;
 #define FONTHEIGHT  XCTX.xfont.helve_h
@@ -43,7 +43,7 @@ void Draw_String(char *s){
 }
 
 
-#ifdef _UNIX
+#ifdef _XMOTIF
 static int          dir,ascent, descent;
 static XCharStruct  overall;
 #define CHECK_W                                                                         \
diff --git a/Graphics/gl2gif.cpp b/Graphics/gl2gif.cpp
index c17cecbb3fadb78655ac9acbabdba61f0a6dcacd..bba8b253c78079327c88cb2b1a1b68a9e1fec911 100644
--- a/Graphics/gl2gif.cpp
+++ b/Graphics/gl2gif.cpp
@@ -1,4 +1,4 @@
-/* $Id: gl2gif.cpp,v 1.5 2000-12-28 18:57:05 geuzaine Exp $ */
+/* $Id: gl2gif.cpp,v 1.6 2000-12-29 10:27:00 geuzaine Exp $ */
 /* 
  * gl2gif: an OpenGL to GIF printing library
  *
@@ -42,7 +42,7 @@
    ------------------------------------------------------------------ */
 
 #define HASH_SIZE 20023
-#define ppm_hashpixel(p) ( ( (int) (p) & 0xfffffffful ) % HASH_SIZE )
+#define ppm_hashpixel(p) ( ( (int) (p) & 0x7fffffff ) % HASH_SIZE )
 
 static int     static_red[MAX_GIFCOLORS];
 static int     static_green[MAX_GIFCOLORS];
@@ -269,6 +269,257 @@ static int GetPixel( int x, int y ){
 }
 
 
+/* ------------------------------------------------------------------
+   PPM quantization
+   ------------------------------------------------------------------ */
+
+/* #define LARGE_NORM */
+#define LARGE_LUM
+
+/* #define REP_CENTER_BOX */
+/* #define REP_AVERAGE_COLORS */
+#define REP_AVERAGE_PIXELS
+
+typedef struct box* box_vector;
+struct box{
+  int ind;
+  int colors;
+  int sum;
+};
+
+static int redcompare( const void *ch1, const void *ch2 ){
+  return (int) PPM_GETR( ((colorhist_vector)ch1)->color ) - 
+    (int) PPM_GETR( ((colorhist_vector)ch2)->color );
+}
+
+static int greencompare( const void *ch1, const void *ch2 ) {
+  return (int) PPM_GETG(((colorhist_vector) ch1)->color ) - 
+    (int) PPM_GETG( ((colorhist_vector)ch2)->color );
+}
+
+static int bluecompare(const void *ch1, const void *ch2 ) {
+  return (int) PPM_GETB(((colorhist_vector)ch1)->color ) - 
+    (int) PPM_GETB(((colorhist_vector)ch2)->color );
+}
+
+static int sumcompare(const void *b1, const void *b2 ) {
+  return(((box_vector)b2)->sum - ((box_vector)b1)->sum);
+}
+
+/*
+ * Here is the fun part, the median-cut colormap generator.  This is based
+ * on Paul Heckbert's paper "Color Image Quantization for Frame Buffer
+ * Display", SIGGRAPH '82 Proceedings, page 297.
+ */
+
+static colorhist_vector mediancut( colorhist_vector chv, int colors, 
+				   int sum, pixval maxval, int newcolors ){
+  colorhist_vector colormap;
+  box_vector bv;
+  register int bi, i;
+  int boxes;
+  
+  bv = (box_vector) malloc( sizeof(struct box) * newcolors );
+  colormap =
+    (colorhist_vector) malloc( sizeof(struct colorhist_item) * newcolors );
+  if ( bv == (box_vector) 0 || colormap == (colorhist_vector) 0 )
+    Msg(ERROR,  "GIF: out of memory" );
+  for ( i = 0; i < newcolors; ++i )
+    PPM_ASSIGN( colormap[i].color, 0, 0, 0 );
+  
+  /*
+   * Set up the initial box.
+   */
+  bv[0].ind = 0;
+  bv[0].colors = colors;
+  bv[0].sum = sum;
+  boxes = 1;
+  
+  /*
+   * Main loop: split boxes until we have enough.
+   */
+  while ( boxes < newcolors ){
+    register int indx, clrs;
+    int sm;
+    register int minr, maxr, ming, maxg, minb, maxb, v;
+    int halfsum, lowersum;
+    
+    /*
+    * Find the first splittable box.
+    */
+    for ( bi = 0; bi < boxes; ++bi )
+      if ( bv[bi].colors >= 2 )
+	break;
+    if ( bi == boxes )
+      break;	/* ran out of colors! */
+    indx = bv[bi].ind;
+    clrs = bv[bi].colors;
+    sm = bv[bi].sum;
+    
+    /*
+     * Go through the box finding the minimum and maximum of each
+     * component - the boundaries of the box.
+     */
+    minr = maxr = PPM_GETR( chv[indx].color );
+    ming = maxg = PPM_GETG( chv[indx].color );
+    minb = maxb = PPM_GETB( chv[indx].color );
+    for ( i = 1; i < clrs; ++i ){
+      v = PPM_GETR( chv[indx + i].color );
+      if ( v < minr ) minr = v;
+      if ( v > maxr ) maxr = v;
+      v = PPM_GETG( chv[indx + i].color );
+      if ( v < ming ) ming = v;
+      if ( v > maxg ) maxg = v;
+      v = PPM_GETB( chv[indx + i].color );
+      if ( v < minb ) minb = v;
+      if ( v > maxb ) maxb = v;
+    }
+    
+    /*
+     * Find the largest dimension, and sort by that component.  I have
+     * included two methods for determining the "largest" dimension;
+     * first by simply comparing the range in RGB space, and second
+     * by transforming into luminosities before the comparison.  You
+     * can switch which method is used by switching the commenting on
+     * the LARGE_ defines at the beginning of this source file.
+     */
+#ifdef LARGE_NORM
+    if ( maxr - minr >= maxg - ming && maxr - minr >= maxb - minb )
+      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
+	     redcompare );
+    else if ( maxg - ming >= maxb - minb )
+      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
+	     greencompare );
+    else
+      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
+	     bluecompare );
+#endif 
+
+#ifdef LARGE_LUM
+    pixel p;
+    float rl, gl, bl;
+
+    PPM_ASSIGN(p, maxr - minr, 0, 0);
+    rl = PPM_LUMIN(p);
+    PPM_ASSIGN(p, 0, maxg - ming, 0);
+    gl = PPM_LUMIN(p);
+    PPM_ASSIGN(p, 0, 0, maxb - minb);
+    bl = PPM_LUMIN(p);
+    
+    if ( rl >= gl && rl >= bl )
+      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
+	     &redcompare );
+    else if ( gl >= bl )
+      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
+	     &greencompare );
+    else
+      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
+	     &bluecompare );
+#endif
+    
+    /*
+     * Now find the median based on the counts, so that about half the
+     * pixels (not colors, pixels) are in each subdivision.
+     */
+    lowersum = chv[indx].value;
+    halfsum = sm / 2;
+    for ( i = 1; i < clrs - 1; ++i ){
+      if ( lowersum >= halfsum )
+	break;
+      lowersum += chv[indx + i].value;
+    }
+    
+    /*
+    * Split the box, and sort to bring the biggest boxes to the top.
+    */
+    bv[bi].colors = i;
+    bv[bi].sum = lowersum;
+    bv[boxes].ind = indx + i;
+    bv[boxes].colors = clrs - i;
+    bv[boxes].sum = sm - lowersum;
+    ++boxes;
+    qsort( (char*) bv, boxes, sizeof(struct box), sumcompare );
+  }
+
+  /*
+   * Ok, we've got enough boxes.  Now choose a representative color for
+   * each box.  There are a number of possible ways to make this choice.
+   * One would be to choose the center of the box; this ignores any structure
+   * within the boxes.  Another method would be to average all the colors in
+   * the box - this is the method specified in Heckbert's paper.  A third
+   * method is to average all the pixels in the box.  You can switch which
+   * method is used by switching the commenting on the REP_ defines at
+   * the beginning of this source file.
+   */
+  for ( bi = 0; bi < boxes; ++bi ){
+
+#ifdef REP_CENTER_BOX
+    register int indx = bv[bi].ind;
+    register int clrs = bv[bi].colors;
+    register int minr, maxr, ming, maxg, minb, maxb, v;
+    
+    minr = maxr = PPM_GETR( chv[indx].color );
+    ming = maxg = PPM_GETG( chv[indx].color );
+    minb = maxb = PPM_GETB( chv[indx].color );
+    for ( i = 1; i < clrs; ++i ){
+      v = PPM_GETR( chv[indx + i].color );
+      minr = min( minr, v );
+      maxr = max( maxr, v );
+      v = PPM_GETG( chv[indx + i].color );
+      ming = min( ming, v );
+      maxg = max( maxg, v );
+      v = PPM_GETB( chv[indx + i].color );
+      minb = min( minb, v );
+      maxb = max( maxb, v );
+    }
+    PPM_ASSIGN( colormap[bi].color, ( minr + maxr ) / 2, ( ming + maxg ) / 2,
+		( minb + maxb ) / 2 );
+#endif
+
+#ifdef REP_AVERAGE_COLORS
+    register int indx = bv[bi].ind;
+    register int clrs = bv[bi].colors;
+    register long r = 0, g = 0, b = 0;
+    
+    for ( i = 0; i < clrs; ++i ){
+      r += PPM_GETR( chv[indx + i].color );
+      g += PPM_GETG( chv[indx + i].color );
+      b += PPM_GETB( chv[indx + i].color );
+    }
+    r = r / clrs;
+    g = g / clrs;
+    b = b / clrs;
+    PPM_ASSIGN( colormap[bi].color, r, g, b );
+#endif
+
+#ifdef REP_AVERAGE_PIXELS
+    register int indx = bv[bi].ind;
+    register int clrs = bv[bi].colors;
+    register long r = 0, g = 0, b = 0, sum = 0;
+    
+    for ( i = 0; i < clrs; ++i ){
+      r += PPM_GETR( chv[indx + i].color ) * chv[indx + i].value;
+      g += PPM_GETG( chv[indx + i].color ) * chv[indx + i].value;
+      b += PPM_GETB( chv[indx + i].color ) * chv[indx + i].value;
+      sum += chv[indx + i].value;
+    }
+    r = r / sum;
+    if ( r > (long)maxval ) r = maxval;	/* avoid math errors */
+    g = g / sum;
+    if ( g > (long)maxval ) g = maxval;
+    b = b / sum;
+    if ( b > (long)maxval ) b = maxval;
+    PPM_ASSIGN( colormap[bi].color, r, g, b );
+#endif
+  }
+  
+  /*
+   * All done.
+   */
+  return colormap;
+}
+
+
 /*------------------------------------------------------------------
   GIF compression routines
   ------------------------------------------------------------------*/
@@ -843,258 +1094,6 @@ static void GIFEncode( FILE* fp,
 }
 
 
-/* ------------------------------------------------------------------
-   PPM quantization
-   ------------------------------------------------------------------ */
-
-/* #define LARGE_NORM */
-#define LARGE_LUM
-
-/* #define REP_CENTER_BOX */
-/* #define REP_AVERAGE_COLORS */
-#define REP_AVERAGE_PIXELS
-
-typedef struct box* box_vector;
-struct box{
-  int ind;
-  int colors;
-  int sum;
-};
-
-static int redcompare( const void *ch1, const void *ch2 ){
-  return (int) PPM_GETR( ((colorhist_vector)ch1)->color ) - 
-    (int) PPM_GETR( ((colorhist_vector)ch2)->color );
-}
-
-static int greencompare( const void *ch1, const void *ch2 ) {
-  return (int) PPM_GETG(((colorhist_vector) ch1)->color ) - 
-    (int) PPM_GETG( ((colorhist_vector)ch2)->color );
-}
-
-static int bluecompare(const void *ch1, const void *ch2 ) {
-  return (int) PPM_GETB(((colorhist_vector)ch1)->color ) - 
-    (int) PPM_GETB(((colorhist_vector)ch2)->color );
-}
-
-static int sumcompare(const void *b1, const void *b2 ) {
-  return(((box_vector)b2)->sum - ((box_vector)b1)->sum);
-}
-
-/*
- * Here is the fun part, the median-cut colormap generator.  This is based
- * on Paul Heckbert's paper "Color Image Quantization for Frame Buffer
- * Display", SIGGRAPH '82 Proceedings, page 297.
- */
-
-static colorhist_vector mediancut( colorhist_vector chv, int colors, 
-				   int sum, pixval maxval, int newcolors ){
-  colorhist_vector colormap;
-  box_vector bv;
-  register int bi, i;
-  int boxes;
-  
-  bv = (box_vector) malloc( sizeof(struct box) * newcolors );
-  colormap =
-    (colorhist_vector) malloc( sizeof(struct colorhist_item) * newcolors );
-  if ( bv == (box_vector) 0 || colormap == (colorhist_vector) 0 )
-    Msg(ERROR,  "GIF: out of memory" );
-  for ( i = 0; i < newcolors; ++i )
-    PPM_ASSIGN( colormap[i].color, 0, 0, 0 );
-  
-  /*
-   * Set up the initial box.
-   */
-  bv[0].ind = 0;
-  bv[0].colors = colors;
-  bv[0].sum = sum;
-  boxes = 1;
-  
-  /*
-   * Main loop: split boxes until we have enough.
-   */
-  while ( boxes < newcolors ){
-    register int indx, clrs;
-    int sm;
-    register int minr, maxr, ming, maxg, minb, maxb, v;
-    int halfsum, lowersum;
-    
-    /*
-    * Find the first splittable box.
-    */
-    for ( bi = 0; bi < boxes; ++bi )
-      if ( bv[bi].colors >= 2 )
-	break;
-    if ( bi == boxes )
-      break;	/* ran out of colors! */
-    indx = bv[bi].ind;
-    clrs = bv[bi].colors;
-    sm = bv[bi].sum;
-    
-    /*
-     * Go through the box finding the minimum and maximum of each
-     * component - the boundaries of the box.
-     */
-    minr = maxr = PPM_GETR( chv[indx].color );
-    ming = maxg = PPM_GETG( chv[indx].color );
-    minb = maxb = PPM_GETB( chv[indx].color );
-    for ( i = 1; i < clrs; ++i ){
-      v = PPM_GETR( chv[indx + i].color );
-      if ( v < minr ) minr = v;
-      if ( v > maxr ) maxr = v;
-      v = PPM_GETG( chv[indx + i].color );
-      if ( v < ming ) ming = v;
-      if ( v > maxg ) maxg = v;
-      v = PPM_GETB( chv[indx + i].color );
-      if ( v < minb ) minb = v;
-      if ( v > maxb ) maxb = v;
-    }
-    
-    /*
-     * Find the largest dimension, and sort by that component.  I have
-     * included two methods for determining the "largest" dimension;
-     * first by simply comparing the range in RGB space, and second
-     * by transforming into luminosities before the comparison.  You
-     * can switch which method is used by switching the commenting on
-     * the LARGE_ defines at the beginning of this source file.
-     */
-#ifdef LARGE_NORM
-    if ( maxr - minr >= maxg - ming && maxr - minr >= maxb - minb )
-      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
-	     redcompare );
-    else if ( maxg - ming >= maxb - minb )
-      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
-	     greencompare );
-    else
-      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
-	     bluecompare );
-#endif 
-
-#ifdef LARGE_LUM
-    pixel p;
-    float rl, gl, bl;
-
-    PPM_ASSIGN(p, maxr - minr, 0, 0);
-    rl = PPM_LUMIN(p);
-    PPM_ASSIGN(p, 0, maxg - ming, 0);
-    gl = PPM_LUMIN(p);
-    PPM_ASSIGN(p, 0, 0, maxb - minb);
-    bl = PPM_LUMIN(p);
-    
-    if ( rl >= gl && rl >= bl )
-      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
-	     &redcompare );
-    else if ( gl >= bl )
-      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
-	     &greencompare );
-    else
-      qsort( (char*) &(chv[indx]), clrs, sizeof(struct colorhist_item),
-	     &bluecompare );
-#endif
-    
-    /*
-     * Now find the median based on the counts, so that about half the
-     * pixels (not colors, pixels) are in each subdivision.
-     */
-    lowersum = chv[indx].value;
-    halfsum = sm / 2;
-    for ( i = 1; i < clrs - 1; ++i ){
-      if ( lowersum >= halfsum )
-	break;
-      lowersum += chv[indx + i].value;
-    }
-    
-    /*
-    * Split the box, and sort to bring the biggest boxes to the top.
-    */
-    bv[bi].colors = i;
-    bv[bi].sum = lowersum;
-    bv[boxes].ind = indx + i;
-    bv[boxes].colors = clrs - i;
-    bv[boxes].sum = sm - lowersum;
-    ++boxes;
-    qsort( (char*) bv, boxes, sizeof(struct box), sumcompare );
-  }
-
-  /*
-   * Ok, we've got enough boxes.  Now choose a representative color for
-   * each box.  There are a number of possible ways to make this choice.
-   * One would be to choose the center of the box; this ignores any structure
-   * within the boxes.  Another method would be to average all the colors in
-   * the box - this is the method specified in Heckbert's paper.  A third
-   * method is to average all the pixels in the box.  You can switch which
-   * method is used by switching the commenting on the REP_ defines at
-   * the beginning of this source file.
-   */
-  for ( bi = 0; bi < boxes; ++bi ){
-
-#ifdef REP_CENTER_BOX
-    register int indx = bv[bi].ind;
-    register int clrs = bv[bi].colors;
-    register int minr, maxr, ming, maxg, minb, maxb, v;
-    
-    minr = maxr = PPM_GETR( chv[indx].color );
-    ming = maxg = PPM_GETG( chv[indx].color );
-    minb = maxb = PPM_GETB( chv[indx].color );
-    for ( i = 1; i < clrs; ++i ){
-      v = PPM_GETR( chv[indx + i].color );
-      minr = min( minr, v );
-      maxr = max( maxr, v );
-      v = PPM_GETG( chv[indx + i].color );
-      ming = min( ming, v );
-      maxg = max( maxg, v );
-      v = PPM_GETB( chv[indx + i].color );
-      minb = min( minb, v );
-      maxb = max( maxb, v );
-    }
-    PPM_ASSIGN( colormap[bi].color, ( minr + maxr ) / 2, ( ming + maxg ) / 2,
-		( minb + maxb ) / 2 );
-#endif
-
-#ifdef REP_AVERAGE_COLORS
-    register int indx = bv[bi].ind;
-    register int clrs = bv[bi].colors;
-    register long r = 0, g = 0, b = 0;
-    
-    for ( i = 0; i < clrs; ++i ){
-      r += PPM_GETR( chv[indx + i].color );
-      g += PPM_GETG( chv[indx + i].color );
-      b += PPM_GETB( chv[indx + i].color );
-    }
-    r = r / clrs;
-    g = g / clrs;
-    b = b / clrs;
-    PPM_ASSIGN( colormap[bi].color, r, g, b );
-#endif
-
-#ifdef REP_AVERAGE_PIXELS
-    register int indx = bv[bi].ind;
-    register int clrs = bv[bi].colors;
-    register long r = 0, g = 0, b = 0, sum = 0;
-    
-    for ( i = 0; i < clrs; ++i ){
-      r += PPM_GETR( chv[indx + i].color ) * chv[indx + i].value;
-      g += PPM_GETG( chv[indx + i].color ) * chv[indx + i].value;
-      b += PPM_GETB( chv[indx + i].color ) * chv[indx + i].value;
-      sum += chv[indx + i].value;
-    }
-    r = r / sum;
-    if ( r > (long)maxval ) r = maxval;	/* avoid math errors */
-    g = g / sum;
-    if ( g > (long)maxval ) g = maxval;
-    b = b / sum;
-    if ( b > (long)maxval ) b = maxval;
-    PPM_ASSIGN( colormap[bi].color, r, g, b );
-#endif
-  }
-  
-  /*
-   * All done.
-   */
-  return colormap;
-}
-
-
-
 /* ------------------------------------------------------------------
    GL2GIF public routine
    ------------------------------------------------------------------ */
@@ -1115,15 +1114,14 @@ void create_gif(FILE *outfile, int width, int height,
   colorhash_table cht;
   register pixel* pP;
   register int col, row, limitcol, ind;
-  int newcolors=255;
+  int newcolors=256;
   long *thisrerr, *nextrerr, *thisgerr, *nextgerr;
   long *thisberr, *nextberr, *temperr;
   register long sr=0, sg=0, sb=0, err=0;
   int fs_direction;
 
   /* This is stupid, but I couldn't figure out how to pack the data
-   directly from OpenGL frame buffer into the approproate format into
-   unsigned long pixel[][]. */
+   directly from the OpenGL frame buffer into unsigned long pixel[][] */
 
   glPixelStorei(GL_PACK_ALIGNMENT,1);
   glPixelStorei(GL_UNPACK_ALIGNMENT,1);
diff --git a/Graphics/gl2gif.h b/Graphics/gl2gif.h
index 73284befb1949cca7372cb8d926b8aceab19a557..66bf70b60d6f434bb656d9ee5869a8c68f87715d 100644
--- a/Graphics/gl2gif.h
+++ b/Graphics/gl2gif.h
@@ -12,8 +12,6 @@ typedef long int       count_int;
 
 /* PPM handling */
 
-#define PPM_MAXMAXVAL  1023
-
 #define PPM_GETR(p)    (((p) & 0x3ff00000) >> 20)
 #define PPM_GETG(p)    (((p) & 0xffc00) >> 10)
 #define PPM_GETB(p)    ((p) & 0x3ff)
diff --git a/Makefile b/Makefile
index 7ab4af90cb5fd9afb821730f2a382a06784388c5..4889e1d36720f01ea5a398819d3da66c38b39664 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.31 2000-12-22 11:09:39 geuzaine Exp $
+# $Id: Makefile,v 1.32 2000-12-29 10:27:00 geuzaine Exp $
 # ----------------------------------------------------------------------
 #  Makefile for Gmsh  
 # ----------------------------------------------------------------------
@@ -53,7 +53,7 @@ default: initialtag
 	@for i in $(GMSH_DIR); do (cd $$i && $(MAKE) \
            "CC=$(CC)" \
            "C_FLAGS=$(FLAGS)" \
-           "OS_FLAGS=-D_UNIX -D_LITTLE_ENDIAN" \
+           "OS_FLAGS=-D_XMOTIF -D_LITTLE_ENDIAN" \
            "VERSION_FLAGS=" \
            "GL_INCLUDE=$(OPENGL_INC)" \
            "MOTIF_INCLUDE=$(MOTIF_INC)" \
@@ -63,7 +63,7 @@ threads: initialtag
 	@for i in $(GMSH_DIR); do (cd $$i && $(MAKE) \
            "CC=$(CC)" \
            "C_FLAGS=$(FLAGS)" \
-           "OS_FLAGS=-D_UNIX -D_LITTLE_ENDIAN" \
+           "OS_FLAGS=-D_XMOTIF -D_LITTLE_ENDIAN" \
            "VERSION_FLAGS=" \
            "GL_INCLUDE=$(OPENGL_INC)" \
            "MOTIF_INCLUDE=$(MOTIF_INC)" \
@@ -73,7 +73,7 @@ profile: initialtag
 	@for i in $(GMSH_DIR); do (cd $$i && $(MAKE) \
            "CC=$(CC)" \
            "C_FLAGS=-O3 -pg" \
-           "OS_FLAGS=-D_UNIX -D_LITTLE_ENDIAN" \
+           "OS_FLAGS=-D_XMOTIF -D_LITTLE_ENDIAN" \
            "VERSION_FLAGS=" \
            "GL_INCLUDE=$(OPENGL_INC)" \
            "MOTIF_INCLUDE=$(MOTIF_INC)" \
@@ -164,7 +164,7 @@ bb: tag
 	@for i in $(GMSH_BOX_DIR); do (cd $$i && $(MAKE) \
            "CC=$(CC)" \
            "C_FLAGS=-O3" \
-           "OS_FLAGS=-D_UNIX" \
+           "OS_FLAGS=" \
            "VERSION_FLAGS=" \
            "GL_INCLUDE=" \
            "MOTIF_INCLUDE=" \
@@ -175,7 +175,7 @@ bbn: tag
 	@for i in $(GMSH_BOX_DIR) ; do (cd $$i && $(MAKE) \
            "CC=g++ -mno-cygwin -I/mingw/include" \
            "C_FLAGS=-O3" \
-           "OS_FLAGS=-D_UNIX" \
+           "OS_FLAGS=" \
            "VERSION_FLAGS=" \
            "GL_INCLUDE=" \
            "MOTIF_INCLUDE=" \
@@ -220,7 +220,7 @@ compile_little_endian:
 	@for i in $(GMSH_DISTRIB_DIR); do (cd $$i && $(MAKE) \
            "CC=g++" \
            "C_FLAGS=-O3" \
-           "OS_FLAGS=-D_UNIX -D_LITTLE_ENDIAN" \
+           "OS_FLAGS=-D_XMOTIF -D_LITTLE_ENDIAN" \
            "VERSION_FLAGS=" \
            "GL_INCLUDE=$(OPENGL_INC)" \
            "MOTIF_INCLUDE=$(MOTIF_INC)" \
@@ -230,7 +230,7 @@ compile_little_endian_2952:
 	@for i in $(GMSH_DISTRIB_DIR); do (cd $$i && $(MAKE) \
            "CC=$(HOME)/gcc-2.95.2/bin/g++" \
            "C_FLAGS=-O3" \
-           "OS_FLAGS=-D_UNIX -D_LITTLE_ENDIAN" \
+           "OS_FLAGS=-D_XMOTIF -D_LITTLE_ENDIAN" \
            "VERSION_FLAGS=" \
            "GL_INCLUDE=$(OPENGL_INC)" \
            "MOTIF_INCLUDE=$(MOTIF_INC)" \
@@ -240,7 +240,7 @@ compile_little_endian_threads:
 	@for i in $(GMSH_DISTRIB_DIR); do (cd $$i && $(MAKE) \
            "CC=g++" \
            "C_FLAGS=-D_REENTRANT -O3" \
-           "OS_FLAGS=-D_UNIX -D_LITTLE_ENDIAN" \
+           "OS_FLAGS=-D_XMOTIF -D_LITTLE_ENDIAN" \
            "VERSION_FLAGS=-D_USETHREADS" \
            "GL_INCLUDE=$(OPENGL_INC)" \
            "MOTIF_INCLUDE=$(MOTIF_INC)" \
@@ -250,7 +250,7 @@ compile_big_endian:
 	@for i in $(GMSH_DISTRIB_DIR); do (cd $$i && $(MAKE) \
            "CC=g++" \
            "C_FLAGS=-O3" \
-           "OS_FLAGS=-D_UNIX" \
+           "OS_FLAGS=-D_XMOTIF" \
            "VERSION_FLAGS=" \
            "GL_INCLUDE=$(OPENGL_INC)" \
            "MOTIF_INCLUDE=$(MOTIF_INC)" \
@@ -263,7 +263,7 @@ compile_sgi:
            "C_FLAGS=-O2 -o32 -Olimit 3000" \
            "RANLIB=true"\
            "AR=CC -o32 -ar -o"\
-           "OS_FLAGS=-D_UNIX" \
+           "OS_FLAGS=-D_XMOTIF" \
            "VERSION_FLAGS=" \
            "GL_INCLUDE=$(OPENGL_INC)" \
            "MOTIF_INCLUDE=$(MOTIF_INC)" \
@@ -273,7 +273,7 @@ compile_sgi:
            "C_FLAGS=-O1 -o32" \
            "AR=CC -o32 -ar -o"\
            "RANLIB=true"\
-           "OS_FLAGS=-D_UNIX" \
+           "OS_FLAGS=-D_XMOTIF" \
            "VERSION_FLAGS=" \
            "GL_INCLUDE=$(OPENGL_INC)" \
            "MOTIF_INCLUDE=$(MOTIF_INC)" \
diff --git a/Mesh/Makefile b/Mesh/Makefile
index 9f62671c1cec9d368e0f1b792ceea5debf3b8468..5c2f41636f0d915c7bae45881b7480ab2b85e3b4 100644
--- a/Mesh/Makefile
+++ b/Mesh/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.6 2000-12-08 10:56:47 geuzaine Exp $
+# $Id: Makefile,v 1.7 2000-12-29 10:27:00 geuzaine Exp $
 #
 # Makefile for "libMesh.a"
 #
@@ -8,7 +8,7 @@
 CC        = c++
 C_FLAGS   = -g -Wall
 
-OS_FLAGS = -D_UNIX
+OS_FLAGS = -D_XMOTIF
 
 RM       = rm
 RMFLAGS  = -f
@@ -88,195 +88,189 @@ depend:
 
 # DO NOT DELETE THIS LINE
 1D_Mesh.o: 1D_Mesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
- Mesh.h Vertex.h Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h \
- ../Common/Context.h Interpolation.h Numeric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  Mesh.h Vertex.h Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h \
+  ../Common/Context.h Interpolation.h Numeric.h
 2D_Mesh.o: 2D_Mesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
- ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
- ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h \
- Create.h 2D_Mesh.h Numeric.h ../Common/Context.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h Create.h \
+  2D_Mesh.h Numeric.h ../Common/Context.h
 2D_SMesh.o: 2D_SMesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Geo/Geo.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Numeric.h \
- Interpolation.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Geo/Geo.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Numeric.h \
+  Interpolation.h
 2D_Elliptic.o: 2D_Elliptic.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
- ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
- ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h
 2D_BGMesh.o: 2D_BGMesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
 2D_Recombine.o: 2D_Recombine.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h Create.h \
- Numeric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h Create.h \
+  Numeric.h
 2D_InitMesh.o: 2D_InitMesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h Numeric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h Numeric.h
 2D_Bowyer.o: 2D_Bowyer.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
 2D_Bricks.o: 2D_Bricks.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
-2D_DivAndConq.o: 2D_DivAndConq.cpp ../Common/Gmsh.h \
- ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
- ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
- ../Common/Const.h Mesh.h Vertex.h Simplex.h Edge.h \
- ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
+2D_DivAndConq.o: 2D_DivAndConq.cpp ../Common/Gmsh.h ../Common/Message.h \
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
 2D_Util.o: 2D_Util.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
 2D_Links.o: 2D_Links.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
 2D_Tree.o: 2D_Tree.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
- ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
-2D_Cylindrical.o: 2D_Cylindrical.cpp ../Common/Gmsh.h \
- ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
- ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
- ../Common/Const.h Mesh.h Vertex.h Simplex.h Edge.h \
- ../Geo/ExtrudeParams.h Metric.h ../Common/Context.h Numeric.h
-2D_Parametric.o: 2D_Parametric.cpp ../Common/Gmsh.h \
- ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
- ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
- ../Common/Const.h ../Geo/Geo.h ../Geo/CAD.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h Interpolation.h Mesh.h \
- 2D_Mesh.h Create.h ../Common/Context.h Numeric.h
-2D_Mesh_Aniso.o: 2D_Mesh_Aniso.cpp ../Common/Gmsh.h \
- ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
- ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
- ../Common/Const.h ../Geo/Geo.h ../Geo/CAD.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h Interpolation.h \
- Create.h ../Common/Context.h Numeric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
+  ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h
+2D_Cylindrical.o: 2D_Cylindrical.cpp ../Common/Gmsh.h ../Common/Message.h \
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h ../Common/Context.h \
+  Numeric.h
+2D_Parametric.o: 2D_Parametric.cpp ../Common/Gmsh.h ../Common/Message.h \
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Interpolation.h \
+  Mesh.h 2D_Mesh.h Create.h ../Common/Context.h Numeric.h
+2D_Mesh_Aniso.o: 2D_Mesh_Aniso.cpp ../Common/Gmsh.h ../Common/Message.h \
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h \
+  Interpolation.h Create.h ../Common/Context.h Numeric.h
 3D_Mesh.o: 3D_Mesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 3D_Mesh.h Create.h \
- Numeric.h ../Common/Context.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h 3D_Mesh.h Create.h \
+  Numeric.h ../Common/Context.h
 3D_SMesh.o: 3D_SMesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
- ../Geo/ExtrudeParams.h Metric.h Interpolation.h Create.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
+  ../Geo/ExtrudeParams.h Metric.h Interpolation.h Create.h
 3D_BGMesh.o: 3D_BGMesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
- ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h 3D_Mesh.h ../Adapt/Adapt.h \
- ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Numeric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
+  ../Geo/ExtrudeParams.h Metric.h 2D_Mesh.h 3D_Mesh.h ../Adapt/Adapt.h \
+  ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Numeric.h
 3D_Extrude.o: 3D_Extrude.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
- ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
- ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h \
- ../Common/Context.h Create.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h \
+  ../Common/Context.h Create.h
 3D_Coherence.o: 3D_Coherence.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
- Mesh.h Vertex.h Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h \
- 3D_Mesh.h Create.h Numeric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  Mesh.h Vertex.h Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h \
+  3D_Mesh.h Create.h Numeric.h
 3D_Divide.o: 3D_Divide.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h
 3D_Bricks.o: 3D_Bricks.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h
 MeshQuality.o: MeshQuality.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Numeric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Numeric.h
 Create.o: Create.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
- ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
- ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h \
- Numeric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h Numeric.h
 Generator.o: Generator.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Create.h \
- ../Common/Context.h ../Unix/Main.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Create.h \
+  ../Common/Context.h ../Unix/Main.h
 Print_Mesh.o: Print_Mesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
- ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
- ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h \
- Create.h ../Common/Context.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h Create.h \
+  ../Common/Context.h
 Read_Mesh.o: Read_Mesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Geo/Geo.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Create.h \
- ../Geo/MinMax.h
-STL.o: STL.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
- ../Geo/ExtrudeParams.h Metric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Geo/Geo.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Create.h \
+  ../Geo/MinMax.h
+STL.o: STL.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
+  ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
+  Mesh.h Vertex.h Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h
 SwapEdge.o: SwapEdge.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h SwapPatterns.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h SwapPatterns.h
 Numeric.o: Numeric.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
- ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
- ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h \
- Numeric.h Interpolation.h ../Adapt/nrutil.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h Numeric.h \
+  Interpolation.h ../Adapt/nrutil.h
 Metric.o: Metric.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
- ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
- ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h \
- Matrix.h Interpolation.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h Matrix.h \
+  Interpolation.h
 Nurbs.o: Nurbs.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
- ../Geo/ExtrudeParams.h Metric.h
-Interpolation.o: Interpolation.cpp ../Common/Gmsh.h \
- ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
- ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
- ../Common/Const.h ../Geo/Geo.h ../Geo/CAD.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h Numeric.h \
- Interpolation.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
+  ../Geo/ExtrudeParams.h Metric.h
+Interpolation.o: Interpolation.cpp ../Common/Gmsh.h ../Common/Message.h \
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Mesh.h Numeric.h \
+  Interpolation.h
 SecondOrder.o: SecondOrder.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Geo/Geo.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Interpolation.h \
- Numeric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Geo/Geo.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Interpolation.h \
+  Numeric.h
 Smoothing.o: Smoothing.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
- Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h Mesh.h Vertex.h \
+  Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h
 CrossData.o: CrossData.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
- ../Geo/ExtrudeParams.h Metric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
+  ../Geo/ExtrudeParams.h Metric.h
 Vertex.o: Vertex.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Vertex.h ../Common/Context.h
-Edge.o: Edge.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h Simplex.h Edge.h \
- ../Geo/ExtrudeParams.h Metric.h ../Common/Const.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h Vertex.h ../Common/Context.h
+Edge.o: Edge.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
+  ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
+  Mesh.h Vertex.h Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h \
+  ../Common/Const.h
 Simplex.o: Simplex.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
- Mesh.h Vertex.h Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h \
- Numeric.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  Mesh.h Vertex.h Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h \
+  Numeric.h
diff --git a/Parser/Makefile b/Parser/Makefile
index 7e21d508f7063c736f720ecba16f30506b00562a..4aac5c6048340c9699a62f1a31cbeba655acdba8 100644
--- a/Parser/Makefile
+++ b/Parser/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.9 2000-12-12 15:26:14 geuzaine Exp $
+# $Id: Makefile,v 1.10 2000-12-29 10:27:00 geuzaine Exp $
 #
 # Makefile for "libParser.a"
 #
@@ -8,7 +8,7 @@
 CC        = c++
 C_FLAGS   = -g -Wall
 
-OS_FLAGS  = -D_UNIX
+OS_FLAGS  = -D_XMOTIF
 
 AR       = ar ruvs
 RANLIB   = ranlib
@@ -58,17 +58,17 @@ depend:
 
 # DO NOT DELETE THIS LINE
 Gmsh.yy.o: Gmsh.yy.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Geo/Geo.h ../Geo/CAD.h \
- ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h Gmsh.tab.cpp.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h ../Geo/Geo.h \
+  ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h Gmsh.tab.cpp.h
 Gmsh.tab.o: Gmsh.tab.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h \
- ../Common/Context.h ../Geo/Geo.h ../Geo/CAD.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Geo/DataBase.h \
- ../Mesh/Create.h ../Common/Views.h ../Common/ColorTable.h \
- ../Geo/StepGeomDatabase.h ../Common/Options.h ../Graphics/Draw.h \
- ../Common/Colors.h Parser.h ../Unix/Main.h FunctionManager.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/Const.h \
+  ../Common/Context.h ../Geo/Geo.h ../Geo/CAD.h ../Mesh/Mesh.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Geo/DataBase.h \
+  ../Mesh/Create.h ../Common/Views.h ../Common/ColorTable.h \
+  ../Geo/StepGeomDatabase.h ../Common/Options.h ../Graphics/Draw.h \
+  ../Common/Colors.h Parser.h ../Unix/Main.h FunctionManager.h
 FunctionManager.o: FunctionManager.cpp FunctionManager.h
diff --git a/Unix/CbFile.cpp b/Unix/CbFile.cpp
index 4f78febc0c489a7dff987689fc08c43ac4581df6..f73429948730ca3c73b03e12cb9a8222341e1783 100644
--- a/Unix/CbFile.cpp
+++ b/Unix/CbFile.cpp
@@ -1,6 +1,4 @@
-/* $Id: CbFile.cpp,v 1.19 2000-12-28 18:58:37 geuzaine Exp $ */
-
-#include <unistd.h>
+/* $Id: CbFile.cpp,v 1.20 2000-12-29 10:27:00 geuzaine Exp $ */
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -9,27 +7,14 @@
 #include "Draw.h"
 #include "Widgets.h"
 #include "Context.h"
-#include "XContext.h"
 
 #include "CbFile.h"
 #include "CbColorbar.h"
 
-#include "XDump.h"
-#include "gl2ps.h"
-#include "gl2gif.h"
-#include "gl2jpeg.h"
-#include "gl2ppm.h"
-#include "gl2yuv.h"
-
 extern Context_T   CTX;
-extern XContext_T  XCTX;
 extern Widgets_T   WID;
 extern Mesh        M;
 
-/* ------------------------------------------------------------------------ */
-/*  C r e a t e I m a g e                                                   */
-/* ------------------------------------------------------------------------ */
-
 void SaveToDisk (char *FileName, Widget warning, 
                  void (*function)(char *filename, int format)){
   FILE    *fp ;
@@ -51,196 +36,11 @@ void SaveToDisk (char *FileName, Widget warning,
   function(KeepFileName, CTX.print.format);
 }
 
-void CreateFile (char *name, int format) {
-  FILE    *tmp, *fp;
-  GLint    size3d;
-  char     cmd[1000], ext[10];
-  char     *tmpFileName="tmp.xwd";
-  int      res;
-
-  CTX.print.gl_fonts = 1;
-
-  switch(format){
-
-  case FORMAT_AUTO :
-    if(strlen(name) < 4)
-      Msg(ERROR, "Unknown Extension for Automatic Format Detection");
-    else{
-      strcpy(ext,name+(strlen(name)-4));
-      if(!strcmp(ext,".geo")) CreateFile(name, FORMAT_GEO);
-      else if(!strcmp(ext,".msh")) CreateFile(name, FORMAT_MSH);
-      else if(!strcmp(ext,".unv")) CreateFile(name, FORMAT_UNV);
-      else if(!strcmp(ext,".gif")) CreateFile(name, FORMAT_GIF);
-      else if(!strcmp(ext,".jpg")) CreateFile(name, FORMAT_JPEG);
-      else if(!strcmp(ext,".eps")) CreateFile(name, FORMAT_EPS);
-      else if(!strcmp(ext,".xpm")) CreateFile(name, FORMAT_XPM);
-      else if(!strcmp(ext,".ppm")) CreateFile(name, FORMAT_PPM);
-      else if(!strcmp(ext,".yuv")) CreateFile(name, FORMAT_YUV);
-      else {
-	if(strlen(name) < 5)
-	  Msg(ERROR, "Unknown Extension for Automatic Format Detection");
-	else{
-	  strcpy(ext,name+(strlen(name)-5));
-	  if(!strcmp(ext,".jpeg")) CreateFile(name, FORMAT_JPEG);
-	  else if(!strcmp(ext,".gref")) CreateFile(name, FORMAT_GREF);
-	  else if(!strcmp(ext,".Gref")) CreateFile(name, FORMAT_GREF);
-	  else Msg(ERROR, "Unknown Extension \"%s\" for Automatic Format Detection", ext);
-	}
-      }
-    }
-    break;
-
-  case FORMAT_GEO :
-    Print_Geo(&M, name);
-    break;
-    
-  case FORMAT_MSH :
-    Print_Mesh(&M, name, FORMAT_MSH); 
-    break;
-
-  case FORMAT_UNV :
-    Print_Mesh(&M, name, FORMAT_UNV); 
-    break;
-    
-  case FORMAT_GREF :
-    Print_Mesh(&M, name, FORMAT_GREF); 
-    break;
-
-  case FORMAT_XPM :
-    if(!(fp = fopen(name,"wb"))) {
-      Msg(WARNING, "Unable to Open File '%s'", name); 
-      return;
-    }
-    Window_Dump(XCTX.display, XCTX.scrnum, XtWindow(WID.G.glw), fp);    
-    Msg(INFOS, "XPM Creation Complete '%s'", name);
-    Msg (INFO, "Wrote File '%s'", name);
-    fclose(fp);
-    break;
-
-  case FORMAT_JPEG :
-    if(!(fp = fopen(name,"wb"))) {
-      Msg(WARNING, "Unable to Open File '%s'", name); 
-      return;
-    }
-    Replot();
-    create_jpeg(fp, CTX.viewport[2]-CTX.viewport[0],
-		CTX.viewport[3]-CTX.viewport[1],
-		CTX.print.jpeg_quality);
-    Msg(INFOS, "JPEG Creation Complete '%s'", name);
-    Msg (INFO, "Wrote File '%s'", name);
-    fclose(fp);
-    break;
-
-  case FORMAT_GIF :
-    if(!(fp = fopen(name,"wb"))) {
-      Msg(WARNING, "Unable to Open File '%s'", name); 
-      return;
-    }
-    Replot();
-    create_gif(fp, CTX.viewport[2]-CTX.viewport[0],
-               CTX.viewport[3]-CTX.viewport[1], 
-	       CTX.print.gif_dither,
-	       CTX.print.gif_sort, 
-	       CTX.print.gif_interlace,
-	       CTX.print.gif_transparent,
-	       UNPACK_RED(CTX.color.bg),
-	       UNPACK_GREEN(CTX.color.bg),
-	       UNPACK_BLUE(CTX.color.bg));
-    Msg(INFOS, "GIF Creation Complete '%s'", name);
-    Msg (INFO, "Wrote File '%s'", name);
-    fclose(fp);
-    break;
-
-  case FORMAT_PPM :
-    if(!(fp = fopen(name,"wb"))) {
-      Msg(WARNING, "Unable to Open File '%s'", name); 
-      return;
-    }
-    Replot();
-    create_ppm(fp, CTX.viewport[2]-CTX.viewport[0],
-	       CTX.viewport[3]-CTX.viewport[1]);
-    Msg(INFOS, "PPM Creation Complete '%s'", name);
-    Msg (INFO, "Wrote File '%s'", name);
-    fclose(fp);
-    break;
-
-  case FORMAT_YUV :
-    if(!(fp = fopen(name,"wb"))) {
-      Msg(WARNING, "Unable to Open File '%s'", name); 
-      return;
-    }
-    Replot();
-    create_yuv(fp, CTX.viewport[2]-CTX.viewport[0],
-	       CTX.viewport[3]-CTX.viewport[1]);
-    Msg(INFOS, "YUV Creation Complete '%s'", name);
-    Msg (INFO, "Wrote File '%s'", name);
-    fclose(fp);
-    break;
-
-  case FORMAT_EPS :
-
-    switch(CTX.print.eps_quality){
-
-    case 0 : // Bitmap EPS
-      if(!(fp = fopen(name,"w"))) {
-	Msg(WARNING, "Unable to Open File '%s'", name); 
-	return;
-      }
-      if(!(tmp = fopen(tmpFileName,"w"))){
-	Msg(WARNING, "Unable to Open File '%s'", tmpFileName); 
-	return;
-      }
-      Window_Dump(XCTX.display, XCTX.scrnum, XtWindow(WID.G.glw), tmp);
-      fclose(tmp);
-      sprintf(cmd, "xpr -device ps -gray 4 %s >%s", tmpFileName, name);
-      Msg(INFOS, "Executing '%s'", cmd);
-      system(cmd);
-      unlink(tmpFileName);
-      Msg(INFOS, "Bitmap EPS Creation Complete '%s'", name);
-      Msg (INFO, "Wrote File '%s'", name);
-      fclose(fp);
-      break;
-      
-    default : // Vector EPS
-      if(!(fp = fopen(name,"w"))) {
-	Msg(WARNING, "Unable to Open File '%s'", name); 
-	return;
-      }
-      CTX.print.gl_fonts = 0;
-      size3d = 0 ;
-      res = GL2PS_OVERFLOW ;
-      while(res == GL2PS_OVERFLOW){
-	size3d += 2048*2048 ;
-	gl2psBeginPage(TheBaseFileName, "Gmsh", 
-		       (CTX.print.eps_quality == 1 ? GL2PS_SIMPLE_SORT : GL2PS_BSP_SORT),
-		       GL2PS_SIMPLE_LINE_OFFSET | GL2PS_DRAW_BACKGROUND,
-		       GL_RGBA, 0, NULL, size3d, fp);
-	CTX.stream = TO_FILE ;
-	Init();
-	Draw();
-	CTX.stream = TO_SCREEN ;
-	res = gl2psEndPage();
-      }
-      Msg(INFOS, "EPS Creation Complete '%s'", name);
-      Msg (INFO, "Wrote File '%s'", name);
-      fclose(fp);
-      CTX.print.gl_fonts = 1;
-      break;
-      
-    }
-    break ;
-    
-  default :
-    Msg(WARNING, "Unknown Print Format");
-    break;
-  }
-
-
-}
+/* ------------------------------------------------------------------------ 
+    F i l e C b                                                       
+   ------------------------------------------------------------------------ */
 
-/* ------------------------------------------------------------------------ */
-/*  file                                                                    */
-/* ------------------------------------------------------------------------ */
+extern void CreateFile (char *name, int format) ;
 
 void FileCb(Widget w, XtPointer client_data, XtPointer call_data){
   char      *c;
diff --git a/Unix/CbPost.cpp b/Unix/CbPost.cpp
index 07cc45d8558179b5a3c5ccb5526070de1cad93c9..53cac81cfcb243bf44ae43d26dd5f6f34be7dcb3 100644
--- a/Unix/CbPost.cpp
+++ b/Unix/CbPost.cpp
@@ -1,4 +1,4 @@
-/* $Id: CbPost.cpp,v 1.9 2000-12-08 10:56:51 geuzaine Exp $ */
+/* $Id: CbPost.cpp,v 1.10 2000-12-29 10:27:00 geuzaine Exp $ */
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -324,7 +324,7 @@ void PostDialogCb (Widget w, XtPointer client_data, XtPointer call_data){
                   (v->ArrowType == DRAW_POST_DISPLACEMENT)?True:False, NULL);
     sprintf(label, "%g", v->ArrowScale);
     XtVaSetValues(WID.PD.vectorScaleText, XmNvalue, label, NULL);
-    XtVaSetValues(WID.PD.vectorScaleScale, XmNvalue, THRESHOLD((int)v->ArrowScale,0,200), NULL);
+    XtVaSetValues(WID.PD.vectorScaleScale, XmNvalue, THRESHOLD((int)v->ArrowScale,0,500), NULL);
     XtVaSetValues(WID.PD.vectorLocationButt[0], XmNset, 
                   (v->ArrowLocation == DRAW_POST_LOCATE_COG)?True:False, NULL);
     XtVaSetValues(WID.PD.vectorLocationButt[1], XmNset, 
@@ -695,7 +695,7 @@ void ChangeViewParam (Post_View *v, XtPointer client_data, XtPointer call_data){
     break;
   case POST_VECTOR_SCALE_TEXT:    
     v->ArrowScale = atof(XmTextGetString(WID.PD.vectorScaleText));
-    XtVaSetValues(WID.PD.vectorScaleScale, XmNvalue, THRESHOLD((int)v->ArrowScale,0,200), NULL);
+    XtVaSetValues(WID.PD.vectorScaleScale, XmNvalue, THRESHOLD((int)v->ArrowScale,0,500), NULL);
     XmUpdateDisplay(WID.PD.vectorScaleScale);
     v->Changed = 1;
     break;
diff --git a/Unix/Makefile b/Unix/Makefile
index 6a965c24546b0bce045c966d1daec9e5248edfe5..ed72553abfc203b14f9b5c16a86a7db5e238b5c9 100644
--- a/Unix/Makefile
+++ b/Unix/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.5 2000-12-08 10:56:51 geuzaine Exp $
+# $Id: Makefile,v 1.6 2000-12-29 10:27:00 geuzaine Exp $
 #
 # Makefile for "libUnix.a"
 #
@@ -9,7 +9,7 @@ CC            = c++
 C_FLAGS       = -g -Wall
 
 VERSION_FLAGS = -D_NOTHREADS
-OS_FLAGS      = -D_UNIX 
+OS_FLAGS      = -D_XMOTIF 
 
 GL_INCLUDE    = -I$(HOME)/SOURCES/Mesa-3.1/include\
                 -I$(HOME)/SOURCES/Mesa-3.1/include/GL
@@ -31,7 +31,6 @@ SRC = Main.cpp \
       Geometry.cpp \
       Register.cpp \
       Pixmaps.cpp \
-      XDump.cpp \
       XColors.cpp \
       Message.cpp \
       CbContext.cpp \
@@ -71,106 +70,103 @@ depend:
 	$(RM) $(RMFLAGS) Makefile.new
 
 # DO NOT DELETE THIS LINE
-Main.o: Main.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
- ../Geo/Verif.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
- ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h \
- ../Graphics/Draw.h ../Common/Views.h ../Common/Const.h \
- ../Common/ColorTable.h ../Common/Context.h ../Parser/Parser.h \
- ../Geo/MinMax.h Widgets.h Pixmaps.h XColors.h XContext.h \
- XRessources.h CbContext.h CbGeom.h Register.h Geometry.h \
- ../Common/Static.h XStatic.h ../Common/Version.h
+Main.o: Main.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
+  ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
+  ../Common/GmshUI.h ../Geo/Geo.h ../Geo/Verif.h ../Mesh/Mesh.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
+  ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h \
+  ../Common/Context.h ../Parser/Parser.h ../Geo/MinMax.h Widgets.h \
+  Pixmaps.h XColors.h XContext.h XRessources.h CbContext.h CbGeom.h \
+  Register.h Geometry.h ../Common/Static.h XStatic.h ../Common/Version.h
 Widgets.o: Widgets.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Common/Context.h \
- XContext.h Info.h Widgets.h Help.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Mesh/Mesh.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Common/Context.h XContext.h \
+  Info.h Widgets.h Help.h
 Geometry.o: Geometry.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \
- ../Common/Context.h XContext.h Widgets.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \
+  ../Common/Context.h XContext.h Widgets.h
 Register.o: Register.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \
- ../Common/Context.h XContext.h Widgets.h Register.h CbOptions.h \
- CbContext.h CbFile.h CbGeom.h CbMesh.h CbPost.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \
+  ../Common/Context.h XContext.h Widgets.h Register.h CbOptions.h \
+  CbContext.h CbFile.h CbGeom.h CbMesh.h CbPost.h
 Pixmaps.o: Pixmaps.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h Widgets.h \
- ../Common/Context.h Pixmaps.h Bitmaps.h XColors.h
-XDump.o: XDump.cpp
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h Widgets.h \
+  ../Common/Context.h Pixmaps.h Bitmaps.h XColors.h
 XColors.o: XColors.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h XContext.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h XContext.h
 Message.o: Message.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \
- ../Common/Version.h ../Common/Context.h Widgets.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \
+  ../Common/Version.h ../Common/Context.h Widgets.h
 CbContext.o: CbContext.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
- ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
- ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Widgets.h \
- ../Common/Context.h XContext.h CbContext.h CbGeom.h CbMesh.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
+  ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
+  ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Widgets.h \
+  ../Common/Context.h XContext.h CbContext.h CbGeom.h CbMesh.h
 CbPost.o: CbPost.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
- ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
- ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Widgets.h \
- ../Common/Context.h XContext.h Main.h CbPost.h CbGeom.h CbMesh.h \
- CbColorbar.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
+  ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
+  ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Widgets.h \
+  ../Common/Context.h XContext.h Main.h CbPost.h CbGeom.h CbMesh.h \
+  CbColorbar.h
 CbColorbar.o: CbColorbar.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \
- ../Common/Const.h XColors.h Widgets.h Register.h ../Common/Context.h \
- XContext.h ../Common/ColorTable.h CbColorbar.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \
+  ../Common/Const.h XColors.h Widgets.h Register.h ../Common/Context.h \
+  XContext.h ../Common/ColorTable.h CbColorbar.h
 CbGeom.o: CbGeom.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
- ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
- ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Widgets.h \
- ../Common/Context.h ../Geo/Verif.h Main.h CbGeom.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
+  ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
+  ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Widgets.h \
+  ../Common/Context.h ../Geo/Verif.h Main.h CbGeom.h
 CbMesh.o: CbMesh.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
- ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
- ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h CbMesh.h \
- ../Common/Context.h Widgets.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
+  ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
+  ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h CbMesh.h \
+  ../Common/Context.h Widgets.h
 CbOptions.o: CbOptions.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
- ../Geo/Verif.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
- ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h \
- ../Graphics/Draw.h ../Common/Views.h ../Common/Const.h \
- ../Common/ColorTable.h Widgets.h Pixmaps.h ../Common/Context.h \
- XContext.h Register.h CbGeneral.h CbOptions.h CbGeom.h CbMesh.h \
- CbPost.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \
+  ../Geo/Verif.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h \
+  ../Graphics/Draw.h ../Common/Views.h ../Common/Const.h \
+  ../Common/ColorTable.h Widgets.h Pixmaps.h ../Common/Context.h \
+  XContext.h Register.h CbGeneral.h CbOptions.h CbGeom.h CbMesh.h \
+  CbPost.h
 CbFile.o: CbFile.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h Main.h \
- ../Common/Const.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
- ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h \
- ../Graphics/Draw.h ../Common/Views.h ../Common/ColorTable.h Widgets.h \
- ../Common/Context.h XContext.h CbFile.h CbColorbar.h XDump.h \
- ../Graphics/gl2ps.h ../Graphics/gl2gif.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h Main.h \
+  ../Common/Const.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h \
+  ../Graphics/Draw.h ../Common/Views.h ../Common/ColorTable.h Widgets.h \
+  ../Common/Context.h CbFile.h CbColorbar.h
 CbInput.o: CbInput.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
- ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Widgets.h \
- ../Common/Context.h XContext.h Register.h CbContext.h CbGeneral.h \
- CbGeom.h CbPost.h CbMesh.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Mesh/Mesh.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
+  ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h Widgets.h \
+  ../Common/Context.h XContext.h Register.h CbContext.h CbGeneral.h \
+  CbGeom.h CbPost.h CbMesh.h
 CbGeneral.o: CbGeneral.cpp ../Common/Gmsh.h ../Common/Message.h \
- ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
- ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Mesh/Mesh.h \
- ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
- ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
- ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h \
- ../Common/Context.h XContext.h Widgets.h
+  ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Mesh/Mesh.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
+  ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \
+  ../Common/Views.h ../Common/Const.h ../Common/ColorTable.h \
+  ../Common/Context.h XContext.h Widgets.h
diff --git a/Unix/Widgets.cpp b/Unix/Widgets.cpp
index 1a163b043bfbd734514e2d5a0f6bfeeb68479445..6d07e7e2fde70d9e588d6804bfeb4c0fa43a2652 100644
--- a/Unix/Widgets.cpp
+++ b/Unix/Widgets.cpp
@@ -1,4 +1,4 @@
-/* $Id: Widgets.cpp,v 1.26 2000-12-26 20:45:42 geuzaine Exp $ */
+/* $Id: Widgets.cpp,v 1.27 2000-12-29 10:27:00 geuzaine Exp $ */
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -2573,6 +2573,7 @@ void CreateWidgets_PD(Widgets_T *w){
   XtManageChild(w->PD.vectorFrame[1][0]);
 
   i=0;
+  XtSetArg(arg[i], XmNnumColumns, 2); i++;
   w->PD.vectorTypeCheck = XmCreateRadioBox(w->PD.vectorFrame[0][0], "PDvectorTypeCheck", arg, i);
   XtManageChild(w->PD.vectorTypeCheck);
 
@@ -2615,7 +2616,7 @@ void CreateWidgets_PD(Widgets_T *w){
   
   i=0;
   XtSetArg(arg[i], XmNminimum, 0); i++;
-  XtSetArg(arg[i], XmNmaximum, 200); i++;
+  XtSetArg(arg[i], XmNmaximum, 500); i++;
   XtSetArg(arg[i], XmNdecimalPoints, 2); i++;
   XtSetArg(arg[i], XmNshowValue, False); i++;
   XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++;