
int args (int *argc, char **argv);

void bDrawOverlay (Layout *layout, int N);

int SetColormap (Graphic *graphic, Layout *layout, char *name);
void FlushDisplay (Display *display);
int Recenter (Graphic *graphic, Layout *layout);
void DrawOverlay (Graphic *graphic, Layout *layout, int N, FILE *f, int extra);
int cursor (Graphic *graphic, Layout *layout);
int PSit (Graphic *graphic, Layout *layout, int Raw);
int JPEGit (Graphic *graphic, Layout *layout);
int JPEGit24 (Graphic *graphic, Layout *layout);
int Resize (Graphic *graphic, Layout *layout);
int Center (Graphic *graphic, Layout *layout);
int LoadTickmarks (Graphic *graphic, Layout *layout);
void PaintTickmarks (Graphic *graphic, Layout *layout);
void Screen_to_Image (double *x1, double *y1, double x2, double y2, Layout *layout);
void Image_to_Screen (double *x1, double *y1, double x2, double y2, Layout *layout);
void UpdateStatusBox (Graphic *graphic, Layout *layout, double x, double y, double z, int mode);
void Remap8 (Graphic *graphic, Layout *layout, Matrix *matrix);
void Remap16 (Graphic *graphic, Layout *layout, Matrix *matrix);
void Remap24 (Graphic *graphic, Layout *layout, Matrix *matrix);
void Remap32 (Graphic *graphic, Layout *layout, Matrix *matrix);
void CheckVisual (Graphic *graphic, int *argc, char **argv);
void CreateZoom8 (Layout *layout, Graphic *graphic, double x, double y);
void CreateZoom16 (Layout *layout, Graphic *graphic, double x, double y);
void CreateZoom24 (Layout *layout, Graphic *graphic, double x, double y);
void CreateZoom32 (Layout *layout, Graphic *graphic, double x, double y);

void ConvertPixmap8  (Layout *layout, FILE *f);
void ConvertPixmap16 (Layout *layout, FILE *f);
void ConvertPixmap24 (Layout *layout, FILE *f);
void ConvertPixmap32 (Layout *layout, FILE *f);


/***** Prototypes for image ***************/

void          PositionPictures    PROTO((Layout *, Graphic *));
void          CreateColorbar      PROTO((Layout *, Graphic *));
void          CreatePicture       PROTO((Layout *, Graphic *));
void          CreateZoom          PROTO((Layout *, Graphic *, double, double));
void          Remap               PROTO((Graphic *, Layout *, Matrix  *));
int           NewPicture          PROTO((Graphic *, Layout *));
void          Reorient            PROTO((Graphic *, Layout *, double, double, int));
void          ReorientOnButton    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));
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           Recenter            PROTO((Graphic *, Layout *));
int           RecenterRescale     PROTO((Graphic *, Layout *));
int           Rescale             PROTO((Graphic *, Layout *));
int           ToggleDEG           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 *));
void          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));
