Index: /trunk/Ohana/src/kapa/Makefile
===================================================================
--- /trunk/Ohana/src/kapa/Makefile	(revision 4768)
+++ /trunk/Ohana/src/kapa/Makefile	(revision 4769)
@@ -4,5 +4,4 @@
 
 default: $(PROGRAM)
-CC      =       gcc -g -Wall
 
 INC	=	$(HOME)/include
Index: /trunk/Ohana/src/kapa/doc/Changes.log
===================================================================
--- /trunk/Ohana/src/kapa/doc/Changes.log	(revision 4768)
+++ /trunk/Ohana/src/kapa/doc/Changes.log	(revision 4769)
@@ -1,2 +1,7 @@
+
+kapa-1-2:
+	cleaned up complaints from -Wall -Werror.  mostly defining 
+	  prototypes, removing unused variables, pushing Graphcolors
+	  into the MakeColormap function 
 
 kapa-1-1:
Index: /trunk/Ohana/src/kapa/event/FlushDisplay.c
===================================================================
--- /trunk/Ohana/src/kapa/event/FlushDisplay.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/event/FlushDisplay.c	(revision 4769)
@@ -14,8 +14,8 @@
   if (!reftimeset) {
     flush = TRUE;
-    gettimeofday (&reftime, (struct timeval *) NULL);
+    gettimeofday (&reftime, NULL);
   } 
 
-  gettimeofday (&now, (struct timeval *) NULL);
+  gettimeofday (&now, NULL);
   dtime = DTIME (now, reftime);
 
Index: /trunk/Ohana/src/kapa/event/PositionPicture.c
===================================================================
--- /trunk/Ohana/src/kapa/event/PositionPicture.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/event/PositionPicture.c	(revision 4769)
@@ -4,5 +4,5 @@
 
   int fontsize, bump, Nc;
-  double PADx, PADy, Dx, Dy, dPx, dPy;
+  double PADx, PADy, Dx, Dy;
   double PXm, PXp, PYm, PYp;
   double X0, Y0, dX, dY;
@@ -64,7 +64,7 @@
   layout[0].label[LABELX1].y = layout[0].axis[2].fy - bump;
 
-  sprintf (string, "%4g\0", layout[0].axis[1].min);
+  sprintf (string, "%4g", layout[0].axis[1].min);
   Nc = strlen (string);
-  sprintf (string, "%4g\0", layout[0].axis[1].max);
+  sprintf (string, "%4g", layout[0].axis[1].max);
   Nc = MAX (Nc, strlen (string));
 
@@ -73,7 +73,7 @@
   layout[0].label[LABELY0].x = layout[0].axis[1].fx - bump;
 
-  sprintf (string, "%4g\0", layout[0].axis[1].min);
+  sprintf (string, "%4g", layout[0].axis[1].min);
   Nc = strlen (string);
-  sprintf (string, "%4g\0", layout[0].axis[1].max);
+  sprintf (string, "%4g", layout[0].axis[1].max);
   Nc = MAX (Nc, strlen (string));
 
Index: /trunk/Ohana/src/kapa/event/SetSection.c
===================================================================
--- /trunk/Ohana/src/kapa/event/SetSection.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/event/SetSection.c	(revision 4769)
@@ -92,7 +92,6 @@
 int ListSection () {
   
-  int i, status, Nbytes, NewSection, ThisSection, MoveSection;
+  int i, status, Nbytes, ThisSection;
   char buffer[128], name[128];
-  double x, y, dx, dy;
 
   SCAN;
Index: /trunk/Ohana/src/kapa/graph/DrawFrame.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/DrawFrame.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/DrawFrame.c	(revision 4769)
@@ -47,10 +47,10 @@
 }
 
-DrawTick (int fx, int fy, int dfx, int dfy, 
-	  int P, double min, double max, 
-	  double value, int mode, int naxis) {
+void DrawTick (int fx, int fy, int dfx, int dfy, 
+	       int P, double min, double max, 
+	       double value, int mode, int naxis) {
   
   int x, y, dx, dy, pos, dir, fontsize;
-  double tmp, size, n;
+  double size, n;
   char string[64], *fontname;
 
@@ -92,5 +92,5 @@
     y = fy + (value-min)*dfy/(max - min) + dy;
     if (fabs(value/(max-min)) < 0.001) { value = 0.0; }
-    sprintf (string, "%4g\0", value);
+    sprintf (string, "%4g", value);
     DrawRotText (x, y, string, pos, 0.0);
   }
@@ -99,5 +99,5 @@
 
 
-AxisTickScale (Axis *axis, double *major, double *minor) {
+void AxisTickScale (Axis *axis, double *major, double *minor) {
 
   double range, lrange, factor, mantis, fmantis, power;
Index: /trunk/Ohana/src/kapa/graph/DrawObjects.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/DrawObjects.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/DrawObjects.c	(revision 4769)
@@ -21,5 +21,5 @@
     DrawObjectN (layout, &layout[0].objects[i]);
   }    
-
+  return (TRUE);
 }
 
@@ -29,5 +29,5 @@
   static unsigned char dash[2] = {5,10};
   static unsigned char dot[2] = {3,3};
-  int ltype, lweight;
+  int lweight;
   
   lweight = MAX (0, MIN (10, object[0].lweight));
@@ -74,4 +74,5 @@
   XSetLineAttributes (graphic.display, graphic.gc, 0, LineSolid, CapNotLast, JoinMiter);
   XSetForeground (graphic.display, graphic.gc, graphic.fore);
+  return (TRUE);
 }
 
Index: /trunk/Ohana/src/kapa/graph/DrawPtext.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/DrawPtext.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/DrawPtext.c	(revision 4769)
@@ -3,5 +3,5 @@
 void DrawPtext (Layout *layout) {
   
-  int i, width, pos, x, y, size;
+  int i, x, y, size;
   double angle;
   char *fontname;
Index: /trunk/Ohana/src/kapa/graph/DrawRotString.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/DrawRotString.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/DrawRotString.c	(revision 4769)
@@ -10,5 +10,5 @@
 
   char *c, *bitmap, basefont[64];
-  int i, dy, dx, N, X, Y, X1, Y1, code;
+  int i, dy, dx, N, X, Y, code;
   int dX, Xoff, dY, Yoff, YoffBase, basesize;
   double cs, sn;
@@ -16,5 +16,5 @@
   /* strip leading whitespace */
   for (c = string; (*c == ' ') || (*c == '\t'); c++);
-  if (*c == 0) return;
+  if (*c == 0) return (FALSE);
   
   /* compute string length */
@@ -97,17 +97,13 @@
   }
   SetRotFont (basefont, basesize);
-}
-
-int DrawRotBitmap (x, y, dx, dy, bitmap, mode, angle, scale)
-int         x, y, dx, dy;
-char        bitmap[];
-int         mode;
-double      angle, scale;
-{
+  return (TRUE);
+}
+
+int DrawRotBitmap (int x, int y, int dx, int dy, char *bitmap, int mode, double angle, double scale) {
 
   int ii, jj, byte_line, byte, bit, flag;
   unsigned long int fore, back;
   double i, j, cs, sn, rscale, tmp;
-  int Xt, Yt, X, Y, X0, X1, X2, Y0, Y1, Y2, x0, y0;
+  int X, Y, X0, X1, X2, Y0, Y1, Y2, x0, y0;
 
   if (mode) {
@@ -214,7 +210,8 @@
   }
   XSetForeground (graphic.display, graphic.gc, graphic.fore);
-}
-
-InitRotFonts () {
+  return (TRUE);
+}
+
+void InitRotFonts () {
 
   int i, Nhardwired;
@@ -448,5 +445,5 @@
 
 
-PSDumpRotSegment (FILE *f, char *segment, int *Nseg) {
+void PSDumpRotSegment (FILE *f, char *segment, int *Nseg) {
   fprintf (f, "(%s) show\n", segment);
   bzero (segment, *Nseg);
@@ -454,5 +451,5 @@
 }
 
-PSSetFont (FILE *f, int size) {
+void PSSetFont (FILE *f, int size) {
   if (!strcmp (currentname, "times")) 
     fprintf (f, "/Times-Roman findfont %d scalefont setfont\n", size);
Index: /trunk/Ohana/src/kapa/graph/LoadObject.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/LoadObject.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/LoadObject.c	(revision 4769)
@@ -43,5 +43,5 @@
   
   /* force valid ranges */
-  if ((layout[0].objects[N].color > NGRAPHCOLORS) || (layout[0].objects[N].color < 0))
+  if ((layout[0].objects[N].color > GetColormapSize()) || (layout[0].objects[N].color < 0))
     layout[0].objects[N].color = 0;
 
@@ -182,5 +182,5 @@
 }
 
-FreeObjectData (Gobjects *object) {
+void FreeObjectData (Gobjects *object) {
 
   if (object[0].x != (float *) NULL) free (object[0].x);
Index: /trunk/Ohana/src/kapa/graph/LoadPtext.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/LoadPtext.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/LoadPtext.c	(revision 4769)
@@ -4,5 +4,5 @@
   
   char buffer[256], *c;
-  int N, status, Nbytes, mode, size;
+  int N, status, size;
   double tmp, L;
   Layout *layout;
Index: /trunk/Ohana/src/kapa/graph/PNGit.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/PNGit.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/PNGit.c	(revision 4769)
@@ -1,5 +1,4 @@
 # include "Ximage.h"
 # include <png.h>
-# define NPALETTE NGRAPHCOLORS
 
 int PNGit () {
@@ -8,14 +7,19 @@
   png_structp png_ptr;
   png_infop info_ptr;
-  png_color palette[NPALETTE];
-  int pchoice[NPALETTE];
+  png_color *palette;
+  int *pchoice;
   XColor color;
   png_byte **rows;
   int dx, dy;
   int i, j, k, found;
+  int Npalette;
   XImage *tmpimage;
   unsigned long pixel;
   char filename[1024];
   int Nbytes, status;
+
+  Npalette = GetColormapSize ();
+  ALLOCATE (pchoice, int, Npalette);
+  ALLOCATE (palette, png_color, Npalette);
 
   dx = graphic.dx;
@@ -35,5 +39,5 @@
 
   /* define the palette */
-  for (i = 0; i < NPALETTE; i++) {
+  for (i = 0; i < Npalette; i++) {
     color.pixel = graphic.color[i];
     XQueryColor (graphic.display, graphic.colormap, &color);
@@ -47,4 +51,6 @@
   if (f == (FILE *) NULL) {
     fprintf (stderr, "can't open output file %s\n", "Xgraph.png");
+    free (pchoice);
+    free (palette);
     return (TRUE);  /* true because otherwise it quits kapa! */
   }
@@ -54,4 +60,6 @@
     fclose (f);
     fprintf (stderr, "can't get png structure\n");
+    free (pchoice);
+    free (palette);
     return (TRUE);
   }
@@ -62,4 +70,6 @@
     fclose (f);
     fprintf (stderr, "can't get png info structure\n");
+    free (pchoice);
+    free (palette);
     return (TRUE);
   }
@@ -69,4 +79,6 @@
     fclose (f);
     fprintf (stderr, "can't get png return\n");
+    free (pchoice);
+    free (palette);
     return (TRUE);
   }
@@ -80,5 +92,5 @@
   /* png_set_IHDR (png_ptr, info_ptr, dx, dy, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); */
 
-  png_set_PLTE (png_ptr, info_ptr, palette, NPALETTE); 
+  png_set_PLTE (png_ptr, info_ptr, palette, Npalette); 
  
   png_write_info (png_ptr, info_ptr);
@@ -104,5 +116,5 @@
       for (i = 0; i < dx; i++) {
 	pixel = XGetPixel (tmpimage, i, j);
-	for (found = k = 0; (k < NPALETTE) && !found; k++) {
+	for (found = k = 0; (k < Npalette) && !found; k++) {
 	  if (pixel == pchoice[k]) {
 	    found = TRUE;
@@ -133,4 +145,6 @@
 
   fclose (f);
+  free (pchoice);
+  free (palette);
   return (TRUE);
 
Index: /trunk/Ohana/src/kapa/graph/PSFrame.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/PSFrame.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/PSFrame.c	(revision 4769)
@@ -4,5 +4,5 @@
 int PSFrame (Layout *layout, FILE *f) {
   
-  int i, j, P, IsLabel, fontsize;
+  int i, P, IsLabel, fontsize;
   double fx, fy, dfx, dfy, range, major, minor, first, next;
   char *fontname;
@@ -46,7 +46,8 @@
     }
   }
+  return (TRUE);
 }
 
-PSTick (FILE *f, double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis) {
+void PSTick (FILE *f, double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis) {
   
   int pos, dir, fontsize;
@@ -68,10 +69,4 @@
   DrawLine (x, y, dx, dy);
 
-# ifdef IN_AND_OUT_TICKS
-# define SPACE 0.03
-# else
-# define SPACE 0.01
-# endif
-
   if (mode == 1) {
     fontname = GetRotFont (&fontsize);
@@ -87,8 +82,7 @@
     y = fy + (value-min)*dfy/(max - min) + dy;
     if (fabs(value) < 1e-14) { value = 0.0; }
-    sprintf (string, "%g\0", value);
+    sprintf (string, "%g", value);
     PSRotText (f, (int)x, (int)y, string, pos, 0.0);
   }
-  
 }
 
Index: /trunk/Ohana/src/kapa/graph/PSLabels.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/PSLabels.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/PSLabels.c	(revision 4769)
@@ -3,9 +3,7 @@
 void PSLabels (Layout *layout, FILE *f) {
   
-  int dX, dY, Xoff;
-  int i, width, pos, x, y, size;
+  int i, pos, x, y, size;
   double angle;
   char *fontname;
-  double cs, sn;
 
   fontname = GetRotFont (&size);
Index: /trunk/Ohana/src/kapa/graph/PSObjects.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/PSObjects.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/PSObjects.c	(revision 4769)
@@ -90,5 +90,5 @@
 int PSObjects (Layout *layout, FILE *f) {
   
-  int i, ltype;
+  int i;
   double lweight;
   static char dash[] = "5";
@@ -111,5 +111,5 @@
     lweight = MAX (0, MIN (10, layout[0].objects[i].lweight));
     fprintf (f, "%.1f setlinewidth\n", lweight);
-    fprintf (f, "%s setrgbcolor\n", GRAPHCOLORS[layout[0].objects[i].color][1]);
+    fprintf (f, "%s setrgbcolor\n", GetRGBString(layout[0].objects[i].color));
 
     switch (layout[0].objects[i].style) {
@@ -134,4 +134,5 @@
     fprintf (f, "0.00 0.00 0.00 setrgbcolor\n");
   }
+  return (TRUE);
 }
 
Index: /trunk/Ohana/src/kapa/graph/PSPtext.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/PSPtext.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/PSPtext.c	(revision 4769)
@@ -3,5 +3,5 @@
 void PSPtext (Layout *layout, FILE *f) {
 
-  int i, width, pos, x, y, size;
+  int i, x, y, size;
   double angle;
   char *fontname;
Index: /trunk/Ohana/src/kapa/graph/cursor.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/cursor.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/graph/cursor.c	(revision 4769)
@@ -6,5 +6,5 @@
   XEvent          event;
   KeySym          keysym;
-  int             status, xstatus, value;
+  int             status, value;
   XComposeStatus  composestatus;
   char            string[10], line[35];
@@ -79,5 +79,5 @@
 	y = (event.xkey.y - layout[0].axis[1].fy)*(layout[0].axis[1].max - layout[0].axis[1].min)/layout[0].axis[1].dfy + layout[0].axis[1].min;
 	if ((value > 0) && (isdigit(string[0]) || isalpha(string[0]))) {
-	  sprintf (line, "%c %12.6f %12.6f \0", string[0], x, y);
+	  sprintf (line, "%c %12.6f %12.6f ", string[0], x, y);
 	  write (sock, line, 32);
 	}
Index: /trunk/Ohana/src/kapa/include/prototypes.h
===================================================================
--- /trunk/Ohana/src/kapa/include/prototypes.h	(revision 4768)
+++ /trunk/Ohana/src/kapa/include/prototypes.h	(revision 4769)
@@ -1,131 +1,124 @@
+Button       *CheckButtons        PROTO((XButtonEvent *, Layout *));
+void          CheckColors         PROTO((int *, char **));
+void          CheckDisplayName    PROTO((int *, char **, char *));
+void          CheckFontName       PROTO((int *, char **, char *));
+void          CheckGeometry       PROTO((int *, char **));
+int           CheckPipe           PROTO(());
+void          CreateWindow        PROTO((Window, int, long));
+void          DefineLayout        PROTO((int, char **));
+void          DrawConnect         PROTO((Layout *, Gobjects *));
+void          DrawFrame           PROTO((Layout *));
+void          DrawHistogram       PROTO((Layout *, Gobjects *));
+void          DrawLabels          PROTO((Layout *));
+int           DrawObjectN         PROTO((Layout *, Gobjects *));
+int           DrawObjects         PROTO((Layout *));
+void          DrawPoints          PROTO((Layout *, Gobjects *));
+void          DrawXErrors         PROTO((Layout *, Gobjects *));
+void          DrawYErrors         PROTO((Layout *, Gobjects *));
+int           ErasePlot           PROTO(());
+unsigned long GetColor            PROTO((Display *, char *, Colormap, unsigned long));
+int           GetColormapSize     PROTO(());
+char         *GetRGBString        PROTO((int N));
+int           InButton            PROTO((XButtonEvent *, Button *));
+int           InPicture           PROTO((XButtonEvent *, Picture *));
+int           ListSection         PROTO(());
+int           LoadBox             PROTO(());
+void          LoadFont            PROTO((int *, char **, char *));
+int           LoadLabels          PROTO(());
+int           LoadObject          PROTO(());
+int           LoadPtext           PROTO(());
+int           LoadVectorData      PROTO((Layout *, int, char *));
+void          MakeColormap        PROTO((int, char **));
+void          MakeCursor          PROTO((unsigned int));
+void          MapWindow           PROTO(());
+void          NameWindow          PROTO((char *));
+Display      *OpenDisplay         PROTO((char *, int *));
+int           PNGit               PROTO(());
+int           PPMit               PROTO(());
+void          PSConnect           PROTO((Layout *, Gobjects *, FILE *));
+int           PSFrame             PROTO((Layout *, FILE *));
+void          PSHistogram         PROTO((Layout *, Gobjects *, FILE *));
+void          PSLabels            PROTO((Layout *, FILE *));
+int           PSObjects           PROTO((Layout *, FILE *));
+void          PSPoints            PROTO((Layout *, Gobjects *, FILE *));
+void          PSXErrors           PROTO((Layout *, Gobjects *, FILE *));
+void          PSYErrors           PROTO((Layout *, Gobjects *, FILE *));
+int           PSit                PROTO((int));
+void          PositionPicture     PROTO((Layout *));
+void          QuitX               PROTO((Display *, char *, char *));
+int           Reconfig            PROTO((XEvent *));
+void          Refresh             PROTO((int));
+void          Remap               PROTO((Layout *, Matrix  *));
+int           Resize              PROTO(());
+int           SetFont             PROTO(());
+int           SetLimits           PROTO(());
+void          SetNormalHints      PROTO(());
+int           SetSection          PROTO((int SwitchSection));
+void          SetUpDisplay        PROTO((int *, char **));
+void          SetUpWindow         PROTO((int *, char **));
+void          SetWMHints          PROTO((Icon *));
+void          TopWindow           PROTO((Icon *));
+int           cursor              PROTO(());
+int           get_argument        PROTO((int, char **, char *));
+void          hh_hms              PROTO((char *, double, double, char));
+int           remove_argument     PROTO((int, int *, char **));
 
-# if (OLDPROTO) 
-/***** Prototypes for image ***************/
+int SetRotFont PROTO((char *name, int size));
+void InitRotFonts PROTO(());
+int DrawRotText PROTO((int x, int y, char *string, int pos, double angle));
+int DrawRotBitmap PROTO((int x, int y, int dx, int dy, char *bitmap, int mode, double angle, double scale));
+char *GetRotFont PROTO((int *size));
+int RotStrlen PROTO((char *c));
+void PSRotText PROTO((FILE *f, int x, int y, char *string, int pos, double angle));
+void PSDumpRotSegment PROTO((FILE *f, char *segment, int *Nseg));
+void PSSetFont PROTO((FILE *f, int size));
+void MakeGC ();
 
-void          PositionPictures    PROTO((Layout *, Graphic *));
-void          CreateColorbar      PROTO((Layout *, Graphic *));
+int EventLoop ();
+void CloseDisplay ();
+
+void DrawPtext (Layout *layout);
+void FlushDisplay ();
+void AxisTickScale (Axis *axis, double *major, double *minor);
+void DrawFrame (Layout *layout);
+void DrawTick (int fx, int fy, int dfx, int dfy, int P, double min, double max, double value, int mode, int naxis);
+void FreeObjectData (Gobjects *object);
+void PSPtext (Layout *layout, FILE *f);
+void PSTick (FILE *f, double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis);
+
+/******************* XGRAPH **
+void          StatusBox           PROTO((Graphic *, Layout *));
+void          ResetColorbar       PROTO((Graphic *, Layout *, double, double));
+void          Reorient            PROTO((Graphic *, Layout *, XButtonEvent *));
+void          PaintOverlay        PROTO((Graphic *, Layout *, int));
+void          MakeGC              PROTO((Graphic *));
+void          InvertButton        PROTO((Graphic *, Button *));
+void          FlashButton         PROTO((Graphic *, Button *));
+void          DrawButton          PROTO((Graphic *, Button *));
+void          DrawBitmap          PROTO((Graphic *, int, int, int, int, char *, int));
+void          DragColorbar        PROTO((Graphic *, Layout *, XButtonEvent *));
+void          CrossHairs          PROTO((Graphic *, Layout *));
+void          CreateZoom          PROTO((Layout *, Graphic *, double, double));
 void          CreatePicture       PROTO((Layout *, Graphic *));
-void          CreateZoom          PROTO((Layout *, Graphic *, double, double));
-void          Remap               PROTO((Layout *, Matrix  *));
-int           NewPicture          PROTO((Graphic *, Layout *));
-void          Reorient            PROTO((Graphic *, Layout *, XButtonEvent *));
-int           UpdatePointer       PROTO((Graphic *, Layout *, XMotionEvent *));
-void          CrossHairs          PROTO((Graphic *, Layout *));
-int           LoadOverlay         PROTO((Graphic *, Layout *));
-int           SaveOverlay         PROTO((Graphic *, Layout *));
-int           CSaveOverlay         PROTO((Graphic *, Layout *));
-int           EraseOverlay        PROTO((Graphic *, Layout *));
-void          StatusBox           PROTO((Graphic *, Layout *));
-void          PaintOverlay        PROTO((Graphic *, Layout *, int));
-
-/***** Prototypes for action ***************/
-
-int           CheckPipe           PROTO((Graphic *, Layout *));
-void          DefineLayout        PROTO((Layout *, Graphic *, int, char **));
-int           EventLoop           PROTO((Graphic *, Layout *));
-int           InPicture           PROTO((XButtonEvent *, Picture *));
-int           InterpretKeys       PROTO((Graphic *, Layout *, XEvent *));
-int           InterpretPresses    PROTO((Graphic *, Layout *, XButtonEvent *));
-int           Reconfig            PROTO((Graphic *, Layout *, XEvent *));
-void          Refresh             PROTO((Graphic *, Layout *, int));
-int           Stop                PROTO((Graphic *, Layout *));
-int           PSit                PROTO((Graphic *, Layout *));
-int           get_argument        PROTO((int, char **, char *));
-int           remove_argument     PROTO((int, int *, char **));
-void          DragColorbar        PROTO((Graphic *, Layout *, XButtonEvent *));
-void          ResetColorbar       PROTO((Graphic *, Layout *, double, double));
-void          MakeColormap        PROTO((Graphic *, Layout *, int, char **));
-
-/***** Prototypes for button ***************/
-
-Button       *CheckButtons        PROTO((XButtonEvent *, Layout *));
-void          DrawButton          PROTO((Graphic *, Button *));
-void          FlashButton         PROTO((Graphic *, Button *));
-int           InButton            PROTO((XButtonEvent *, Button *));
-void          InvertButton        PROTO((Graphic *, Button *));
-int           greycolors          PROTO((Graphic *, Layout *));
 int           rainbow             PROTO((Graphic *, Layout *));
 int           puns                PROTO((Graphic *, Layout *));
+int           greycolors          PROTO((Graphic *, Layout *));
+int           UpdatePointer       PROTO((Graphic *, Layout *, XMotionEvent *));
+int           ToggleDEG           PROTO((Graphic *, Layout *));
+int           Stop                PROTO((Graphic *, Layout *));
+int           SaveOverlay         PROTO((Graphic *, Layout *));
+int           Rescale             PROTO((Graphic *, Layout *));
+int           RecenterRescale     PROTO((Graphic *, Layout *));
 int           Recenter            PROTO((Graphic *, Layout *));
-int           RecenterRescale     PROTO((Graphic *, Layout *));
-int           Rescale             PROTO((Graphic *, Layout *));
-int           ToggleDEG           PROTO((Graphic *, Layout *));
+int           Overlay3            PROTO((Graphic *, Layout *));
+int           Overlay2            PROTO((Graphic *, Layout *));
+int           Overlay1            PROTO((Graphic *, Layout *));
 int           Overlay0            PROTO((Graphic *, Layout *));
-int           Overlay1            PROTO((Graphic *, Layout *));
-int           Overlay2            PROTO((Graphic *, Layout *));
-int           Overlay3            PROTO((Graphic *, Layout *));
-
-/***** Prototypes for xtools ***************/
-
-void          CheckColors         PROTO((Graphic *, int *, char **));
-void          CheckDisplayName    PROTO((int *, char **, char *));
-void          CheckFontName       PROTO((int *, char **, char *));
-void          CheckGeometry       PROTO((int *, char **, Graphic *));
-void          CloseDisplay        PROTO((Graphic *));
-void          CreateWindow        PROTO((Graphic *, Window, int, long));
-void          DrawBitmap          PROTO((Graphic *, int, int, int, int, char *, int));
-unsigned long GetColor            PROTO((Display *, char *, Colormap, unsigned long));
-void          LoadFont            PROTO((Graphic *, int *, char **, char *));
-void          MakeCursor          PROTO((Graphic *, unsigned int));
-void          MakeGC              PROTO((Graphic *));
-void          MapWindow           PROTO((Graphic *));
-void          NameWindow          PROTO((Graphic *, char *));
-Display      *OpenDisplay         PROTO((char *, int *));
-void          QuitX               PROTO((Display *, char *, char *));
-void          SetNormalHints      PROTO((Graphic *));
-Display      *SetUpDisplay        PROTO((Graphic *, int *, char **));
-void          SetUpWindow         PROTO((Graphic *, int *, char **));
-void          SetWMHints          PROTO((Graphic *, Icon *));
-void          TopWindow           PROTO((Graphic *, Icon *));
-
-void          hh_hms              PROTO((char *, double, double, char));
-# endif 
-
-Display *SetUpDisplay (int *, char **);
-Display *OpenDisplay (char *, int *);
-void CheckDisplayName (int *, char **, char *);
-void CheckColors (int *, char **);
-void SetUpWindow (int *, char **);
-void CheckGeometry (int *, char **);
-void TopWindow (Icon *);
-void QuitX (Display *, char *, char *);
-void CreateWindow (Window, int, long);
-void MakeCursor (unsigned int);
-void CheckFontName (int *, char **, char *);
-void LoadFont (int *, char **, char *);
-void SetNormalHints ();
-void SetWMHints (Icon *);
-void NameWindow (char *);
-void MapWindow ();
-void MakeColormap (int, char **);
-void DefineLayout (int, char **);
-void PositionPicture (Layout *);
-void DrawFrame (Layout *);
-int DrawObjects (Layout *);
-int DrawObjectN (Layout *, Gobjects *);
-void DrawConnect (Layout *, Gobjects *);
-void DrawHistogram (Layout *, Gobjects *);
-void DrawPoints (Layout *, Gobjects *);
-void DrawXErrors (Layout *, Gobjects *);
-void DrawYErrors (Layout *, Gobjects *);
-void DrawLabels (Layout *);
-void Refresh (int);
-int CheckPipe ();
-int PSit (int);
-int PSObjects (Layout *, FILE *);
-void PSConnect (Layout *, Gobjects *, FILE *);
-void PSHistogram (Layout *, Gobjects *, FILE *);
-void PSPoints (Layout *, Gobjects *, FILE *);
-void PSXErrors (Layout *, Gobjects *, FILE *);
-void PSYErrors (Layout *, Gobjects *, FILE *);
-int LoadObject ();
-int LoadVectorData (Layout *, int, char *);
-int SetLimits ();
-int LoadLabels ();
-int SetFont ();
-int cursor ();
-int ErasePlot ();
-int Reconfig (XEvent *);
-int LoadBox ();
-int PSFrame (Layout *, FILE *);
-void PSLabels (Layout *, FILE *);
+int           NewPicture          PROTO((Graphic *, Layout *));
+int           LoadOverlay         PROTO((Graphic *, Layout *));
+int           InterpretPresses    PROTO((Graphic *, Layout *, XButtonEvent *));
+int           InterpretKeys       PROTO((Graphic *, Layout *, XEvent *));
+int           EventLoop           PROTO((Graphic *, Layout *));
+int           EraseOverlay        PROTO((Graphic *, Layout *));
+int           CSaveOverlay        PROTO((Graphic *, Layout *));
+*/
Index: /trunk/Ohana/src/kapa/include/structures.h
===================================================================
--- /trunk/Ohana/src/kapa/include/structures.h	(revision 4768)
+++ /trunk/Ohana/src/kapa/include/structures.h	(revision 4769)
@@ -1,28 +1,2 @@
-/** this list must match the one in mana/include/package.h, and equiv */
-# define NGRAPHCOLORS 23
-static char GRAPHCOLORS[NGRAPHCOLORS][2][15] = {
-{"black",    "0.00 0.00 0.00"}, 
-{"white",    "1.00 1.00 1.00"}, 
-{"red",      "1.00 0.00 0.00"}, 
-{"pink",     "1.00 0.75 0.80"}, 
-{"orange",   "1.00 0.65 0.00"}, 
-{"yellow",   "1.00 1.00 0.00"}, 
-{"wheat",    "0.96 0.87 0.70"}, 
-{"gold",     "1.00 0.84 0.00"}, 
-{"green",    "0.00 1.00 0.00"}, 
-{"darkgreen","0.00 0.40 0.00"}, 
-{"blue",     "0.00 0.00 1.00"}, 
-{"skyblue",  "0.53 0.81 0.92"}, 
-{"indigo",   "0.56 0.16 0.87"}, 
-{"violet",   "1.00 0.00 0.00"},
-{"grey10",   "0.10 0.10 0.10"},
-{"grey20",   "0.20 0.20 0.20"},
-{"grey30",   "0.30 0.30 0.30"},
-{"grey40",   "0.40 0.40 0.40"},
-{"grey50",   "0.50 0.50 0.50"},
-{"grey60",   "0.60 0.60 0.60"},
-{"grey70",   "0.70 0.70 0.70"},
-{"grey80",   "0.80 0.80 0.80"},
-{"grey90",   "0.90 0.90 0.90"}};
 
 /**************** Graphic carries X info around ****************/
@@ -40,5 +14,5 @@
   unsigned long  fore;
   unsigned long  back;
-  unsigned long  color[NGRAPHCOLORS];
+  unsigned long  *color;
 } Graphic;
 
Index: /trunk/Ohana/src/kapa/setup/CheckColors.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/CheckColors.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/CheckColors.c	(revision 4769)
@@ -6,9 +6,8 @@
   char *temp_name;
   int N;
-  unsigned long temp_color;
 
   graphic.fore = BlackPixel (graphic.display, graphic.screen);
   temp_name = XGetDefault (graphic.display, argv[0], "Foreground");
-  if (N = get_argument (*argc, argv, "-fg")) {
+  if ((N = get_argument (*argc, argv, "-fg"))) {
     if (N + 1 < *argc) {
       temp_name = argv[N+1];
@@ -23,5 +22,5 @@
   graphic.back = WhitePixel (graphic.display, graphic.screen);
   temp_name = XGetDefault (graphic.display, argv[0], "Background");
-  if (N = get_argument (*argc, argv, "-bg")) {
+  if ((N = get_argument (*argc, argv, "-bg"))) {
     if (N + 1 < *argc) {
       temp_name = argv[N+1];
Index: /trunk/Ohana/src/kapa/setup/CheckDisplayName.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/CheckDisplayName.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/CheckDisplayName.c	(revision 4769)
@@ -7,5 +7,5 @@
 
   display_name[0] = 0;
-  if (N = get_argument (*argc, argv, "-d")) {
+  if ((N = get_argument (*argc, argv, "-d"))) {
     if (N + 1 < *argc) {
       strcpy (display_name, argv[N + 1]);
@@ -18,5 +18,5 @@
   }
 
-  if (N = get_argument (*argc, argv, "-display")) {
+  if ((N = get_argument (*argc, argv, "-display"))) {
     if (N + 1 < *argc) {
       strcpy (display_name, argv[N + 1]);
Index: /trunk/Ohana/src/kapa/setup/CheckFontName.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/CheckFontName.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/CheckFontName.c	(revision 4769)
@@ -6,5 +6,5 @@
   int N;
 
-  if (N = get_argument (*argc, argv, "-font")) {
+  if ((N = get_argument (*argc, argv, "-font"))) {
     if (N + 1 < *argc) {
       strcpy (fontname, argv[N + 1]);
@@ -16,5 +16,5 @@
     }
   }   
-  if (N = get_argument (*argc, argv, "-fn")) {
+  if ((N = get_argument (*argc, argv, "-fn"))) {
     if (N + 1 < *argc) {
       strcpy (fontname, argv[N + 1]);
Index: /trunk/Ohana/src/kapa/setup/CheckGeometry.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/CheckGeometry.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/CheckGeometry.c	(revision 4769)
@@ -10,5 +10,5 @@
   
   temp_name = XGetDefault (graphic.display, argv[0], "geometry");
-  if (N = get_argument (*argc, argv, "-geom")) {
+  if ((N = get_argument (*argc, argv, "-geom"))) {
     if (N + 1 < *argc) {
       temp_name = argv[N+1];
@@ -29,9 +29,7 @@
     if (status & WidthValue) {
       dX = dx;
-      MAX (dX, MIN_WIDTH);
     }
     if (status & HeightValue) {
       dY = dy;
-      MAX (dY, MIN_HEIGHT);
     }
     if (status & XNegative) X  = DisplayWidth  (graphic.display, graphic.screen) - dX + X;
Index: /trunk/Ohana/src/kapa/setup/DefineLayout.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/DefineLayout.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/DefineLayout.c	(revision 4769)
@@ -5,9 +5,7 @@
 void DefineLayout (int argc, char **argv) {
 
-  int i, j, status, N, offset, FOREGROUND;
-  Visual *visual = CopyFromParent;
+  int i, status, N, FOREGROUND;
   struct sockaddr_un Address;
   char temp[100];
-  double PADx, PADy;
   
   if ((N = get_argument (argc, argv, "-debug"))) {
@@ -33,5 +31,5 @@
     Address.sun_family = AF_UNIX;
     sock = socket (AF_UNIX, SOCK_STREAM, 0);
-    status = connect (sock, &Address, sizeof (Address));
+    status = connect (sock, (struct sockaddr *) &Address, sizeof (Address));
     if (status < 0) {
       fprintf (stderr, "kapa - unsuccessful connection: %d\n", status);
@@ -39,5 +37,5 @@
     }
     fcntl (sock, F_SETFL, O_NONBLOCK);  
-    sprintf (temp, "rm -f %s\0", argv[1]);
+    sprintf (temp, "rm -f %s", argv[1]);
     system (temp);
   }
Index: /trunk/Ohana/src/kapa/setup/MakeColormap.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/MakeColormap.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/MakeColormap.c	(revision 4769)
@@ -1,3 +1,44 @@
 # include "Ximage.h"
+
+/* this list must match the one in mana/include/package.h, and equiv
+ * we need to define library calls to the kapa and kii packages which mana
+ * and other programs would link against.  This would allow them to have 
+ * access to the list of available colors.  Or... we need to have mana, etc
+ * query kapa/kii about it list of colors...
+ */
+
+# define NGRAPHCOLORS 23
+static char GRAPHCOLORS[NGRAPHCOLORS][2][15] = {
+{"black",    "0.00 0.00 0.00"}, 
+{"white",    "1.00 1.00 1.00"}, 
+{"red",      "1.00 0.00 0.00"}, 
+{"pink",     "1.00 0.75 0.80"}, 
+{"orange",   "1.00 0.65 0.00"}, 
+{"yellow",   "1.00 1.00 0.00"}, 
+{"wheat",    "0.96 0.87 0.70"}, 
+{"gold",     "1.00 0.84 0.00"}, 
+{"green",    "0.00 1.00 0.00"}, 
+{"darkgreen","0.00 0.40 0.00"}, 
+{"blue",     "0.00 0.00 1.00"}, 
+{"skyblue",  "0.53 0.81 0.92"}, 
+{"indigo",   "0.56 0.16 0.87"}, 
+{"violet",   "1.00 0.00 0.00"},
+{"grey10",   "0.10 0.10 0.10"},
+{"grey20",   "0.20 0.20 0.20"},
+{"grey30",   "0.30 0.30 0.30"},
+{"grey40",   "0.40 0.40 0.40"},
+{"grey50",   "0.50 0.50 0.50"},
+{"grey60",   "0.60 0.60 0.60"},
+{"grey70",   "0.70 0.70 0.70"},
+{"grey80",   "0.80 0.80 0.80"},
+{"grey90",   "0.90 0.90 0.90"}};
+
+int GetColormapSize () {
+  return (NGRAPHCOLORS);
+}
+
+char *GetRGBString (int N) {
+  return (GRAPHCOLORS[N][1]);
+}
 
 void MakeColormap (int argc, char **argv) {
@@ -6,4 +47,5 @@
   char *temp_name;
 
+  ALLOCATE (graphic.color, unsigned long, NGRAPHCOLORS);
 
   for (i = 0; i < NGRAPHCOLORS; i++) {
Index: /trunk/Ohana/src/kapa/setup/MakeGC.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/MakeGC.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/MakeGC.c	(revision 4769)
@@ -4,5 +4,4 @@
 void MakeGC () {
 
-  GC gc;
   XGCValues gcvalues;
 
Index: /trunk/Ohana/src/kapa/setup/OpenDisplay.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/OpenDisplay.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/OpenDisplay.c	(revision 4769)
@@ -5,5 +5,4 @@
 
   Display *display;
-  char *tmp;
   
   display = XOpenDisplay (display_name);
Index: /trunk/Ohana/src/kapa/setup/SetUpDisplay.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/SetUpDisplay.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/SetUpDisplay.c	(revision 4769)
@@ -2,5 +2,5 @@
 
 /************** SetUpDisplay *************/
-Display *SetUpDisplay (int *argc, char **argv) {
+void SetUpDisplay (int *argc, char **argv) {
 
   char display_name[120];
Index: /trunk/Ohana/src/kapa/setup/TopWindow.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/TopWindow.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/TopWindow.c	(revision 4769)
@@ -4,5 +4,4 @@
 void TopWindow (Icon *icon) {
 
-  int screen;
   Window rootwindow;
 
Index: /trunk/Ohana/src/kapa/setup/Ximage.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/Ximage.c	(revision 4768)
+++ /trunk/Ohana/src/kapa/setup/Ximage.c	(revision 4769)
@@ -1,9 +1,5 @@
 # include "Ximage.h"
 
-main (argc, argv)
-int argc;
-char *argv[];
-
-{
+int main (int argc, char **argv) {
   
   SetUpDisplay (&argc, argv);
@@ -15,5 +11,5 @@
   XFreeFont (graphic.display, graphic.font); 
   CloseDisplay ();
-
+  exit (0);
 }
 
