IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4769


Ignore:
Timestamp:
Aug 15, 2005, 3:00:59 PM (21 years ago)
Author:
eugene
Message:

cleanup errors caught by Wall,Werror

Location:
trunk/Ohana/src/kapa
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa/Makefile

    r3465 r4769  
    44
    55default: $(PROGRAM)
    6 CC      =       gcc -g -Wall
    76
    87INC     =       $(HOME)/include
  • trunk/Ohana/src/kapa/doc/Changes.log

    r4477 r4769  
     1
     2kapa-1-2:
     3        cleaned up complaints from -Wall -Werror.  mostly defining
     4          prototypes, removing unused variables, pushing Graphcolors
     5          into the MakeColormap function
    16
    27kapa-1-1:
  • trunk/Ohana/src/kapa/event/FlushDisplay.c

    r2473 r4769  
    1414  if (!reftimeset) {
    1515    flush = TRUE;
    16     gettimeofday (&reftime, (struct timeval *) NULL);
     16    gettimeofday (&reftime, NULL);
    1717  }
    1818
    19   gettimeofday (&now, (struct timeval *) NULL);
     19  gettimeofday (&now, NULL);
    2020  dtime = DTIME (now, reftime);
    2121
  • trunk/Ohana/src/kapa/event/PositionPicture.c

    r2473 r4769  
    44
    55  int fontsize, bump, Nc;
    6   double PADx, PADy, Dx, Dy, dPx, dPy;
     6  double PADx, PADy, Dx, Dy;
    77  double PXm, PXp, PYm, PYp;
    88  double X0, Y0, dX, dY;
     
    6464  layout[0].label[LABELX1].y = layout[0].axis[2].fy - bump;
    6565
    66   sprintf (string, "%4g\0", layout[0].axis[1].min);
     66  sprintf (string, "%4g", layout[0].axis[1].min);
    6767  Nc = strlen (string);
    68   sprintf (string, "%4g\0", layout[0].axis[1].max);
     68  sprintf (string, "%4g", layout[0].axis[1].max);
    6969  Nc = MAX (Nc, strlen (string));
    7070
     
    7373  layout[0].label[LABELY0].x = layout[0].axis[1].fx - bump;
    7474
    75   sprintf (string, "%4g\0", layout[0].axis[1].min);
     75  sprintf (string, "%4g", layout[0].axis[1].min);
    7676  Nc = strlen (string);
    77   sprintf (string, "%4g\0", layout[0].axis[1].max);
     77  sprintf (string, "%4g", layout[0].axis[1].max);
    7878  Nc = MAX (Nc, strlen (string));
    7979
  • trunk/Ohana/src/kapa/event/SetSection.c

    r2473 r4769  
    9292int ListSection () {
    9393 
    94   int i, status, Nbytes, NewSection, ThisSection, MoveSection;
     94  int i, status, Nbytes, ThisSection;
    9595  char buffer[128], name[128];
    96   double x, y, dx, dy;
    9796
    9897  SCAN;
  • trunk/Ohana/src/kapa/graph/DrawFrame.c

    r2473 r4769  
    4747}
    4848
    49 DrawTick (int fx, int fy, int dfx, int dfy,
    50           int P, double min, double max,
    51           double value, int mode, int naxis) {
     49void DrawTick (int fx, int fy, int dfx, int dfy,
     50               int P, double min, double max,
     51               double value, int mode, int naxis) {
    5252 
    5353  int x, y, dx, dy, pos, dir, fontsize;
    54   double tmp, size, n;
     54  double size, n;
    5555  char string[64], *fontname;
    5656
     
    9292    y = fy + (value-min)*dfy/(max - min) + dy;
    9393    if (fabs(value/(max-min)) < 0.001) { value = 0.0; }
    94     sprintf (string, "%4g\0", value);
     94    sprintf (string, "%4g", value);
    9595    DrawRotText (x, y, string, pos, 0.0);
    9696  }
     
    9999
    100100
    101 AxisTickScale (Axis *axis, double *major, double *minor) {
     101void AxisTickScale (Axis *axis, double *major, double *minor) {
    102102
    103103  double range, lrange, factor, mantis, fmantis, power;
  • trunk/Ohana/src/kapa/graph/DrawObjects.c

    r2473 r4769  
    2121    DrawObjectN (layout, &layout[0].objects[i]);
    2222  }   
    23 
     23  return (TRUE);
    2424}
    2525
     
    2929  static unsigned char dash[2] = {5,10};
    3030  static unsigned char dot[2] = {3,3};
    31   int ltype, lweight;
     31  int lweight;
    3232 
    3333  lweight = MAX (0, MIN (10, object[0].lweight));
     
    7474  XSetLineAttributes (graphic.display, graphic.gc, 0, LineSolid, CapNotLast, JoinMiter);
    7575  XSetForeground (graphic.display, graphic.gc, graphic.fore);
     76  return (TRUE);
    7677}
    7778
  • trunk/Ohana/src/kapa/graph/DrawPtext.c

    r2473 r4769  
    33void DrawPtext (Layout *layout) {
    44 
    5   int i, width, pos, x, y, size;
     5  int i, x, y, size;
    66  double angle;
    77  char *fontname;
  • trunk/Ohana/src/kapa/graph/DrawRotString.c

    r2473 r4769  
    1010
    1111  char *c, *bitmap, basefont[64];
    12   int i, dy, dx, N, X, Y, X1, Y1, code;
     12  int i, dy, dx, N, X, Y, code;
    1313  int dX, Xoff, dY, Yoff, YoffBase, basesize;
    1414  double cs, sn;
     
    1616  /* strip leading whitespace */
    1717  for (c = string; (*c == ' ') || (*c == '\t'); c++);
    18   if (*c == 0) return;
     18  if (*c == 0) return (FALSE);
    1919 
    2020  /* compute string length */
     
    9797  }
    9898  SetRotFont (basefont, basesize);
    99 }
    100 
    101 int DrawRotBitmap (x, y, dx, dy, bitmap, mode, angle, scale)
    102 int         x, y, dx, dy;
    103 char        bitmap[];
    104 int         mode;
    105 double      angle, scale;
    106 {
     99  return (TRUE);
     100}
     101
     102int DrawRotBitmap (int x, int y, int dx, int dy, char *bitmap, int mode, double angle, double scale) {
    107103
    108104  int ii, jj, byte_line, byte, bit, flag;
    109105  unsigned long int fore, back;
    110106  double i, j, cs, sn, rscale, tmp;
    111   int Xt, Yt, X, Y, X0, X1, X2, Y0, Y1, Y2, x0, y0;
     107  int X, Y, X0, X1, X2, Y0, Y1, Y2, x0, y0;
    112108
    113109  if (mode) {
     
    214210  }
    215211  XSetForeground (graphic.display, graphic.gc, graphic.fore);
    216 }
    217 
    218 InitRotFonts () {
     212  return (TRUE);
     213}
     214
     215void InitRotFonts () {
    219216
    220217  int i, Nhardwired;
     
    448445
    449446
    450 PSDumpRotSegment (FILE *f, char *segment, int *Nseg) {
     447void PSDumpRotSegment (FILE *f, char *segment, int *Nseg) {
    451448  fprintf (f, "(%s) show\n", segment);
    452449  bzero (segment, *Nseg);
     
    454451}
    455452
    456 PSSetFont (FILE *f, int size) {
     453void PSSetFont (FILE *f, int size) {
    457454  if (!strcmp (currentname, "times"))
    458455    fprintf (f, "/Times-Roman findfont %d scalefont setfont\n", size);
  • trunk/Ohana/src/kapa/graph/LoadObject.c

    r2473 r4769  
    4343 
    4444  /* force valid ranges */
    45   if ((layout[0].objects[N].color > NGRAPHCOLORS) || (layout[0].objects[N].color < 0))
     45  if ((layout[0].objects[N].color > GetColormapSize()) || (layout[0].objects[N].color < 0))
    4646    layout[0].objects[N].color = 0;
    4747
     
    182182}
    183183
    184 FreeObjectData (Gobjects *object) {
     184void FreeObjectData (Gobjects *object) {
    185185
    186186  if (object[0].x != (float *) NULL) free (object[0].x);
  • trunk/Ohana/src/kapa/graph/LoadPtext.c

    r2473 r4769  
    44 
    55  char buffer[256], *c;
    6   int N, status, Nbytes, mode, size;
     6  int N, status, size;
    77  double tmp, L;
    88  Layout *layout;
  • trunk/Ohana/src/kapa/graph/PNGit.c

    r2473 r4769  
    11# include "Ximage.h"
    22# include <png.h>
    3 # define NPALETTE NGRAPHCOLORS
    43
    54int PNGit () {
     
    87  png_structp png_ptr;
    98  png_infop info_ptr;
    10   png_color palette[NPALETTE];
    11   int pchoice[NPALETTE];
     9  png_color *palette;
     10  int *pchoice;
    1211  XColor color;
    1312  png_byte **rows;
    1413  int dx, dy;
    1514  int i, j, k, found;
     15  int Npalette;
    1616  XImage *tmpimage;
    1717  unsigned long pixel;
    1818  char filename[1024];
    1919  int Nbytes, status;
     20
     21  Npalette = GetColormapSize ();
     22  ALLOCATE (pchoice, int, Npalette);
     23  ALLOCATE (palette, png_color, Npalette);
    2024
    2125  dx = graphic.dx;
     
    3539
    3640  /* define the palette */
    37   for (i = 0; i < NPALETTE; i++) {
     41  for (i = 0; i < Npalette; i++) {
    3842    color.pixel = graphic.color[i];
    3943    XQueryColor (graphic.display, graphic.colormap, &color);
     
    4751  if (f == (FILE *) NULL) {
    4852    fprintf (stderr, "can't open output file %s\n", "Xgraph.png");
     53    free (pchoice);
     54    free (palette);
    4955    return (TRUE);  /* true because otherwise it quits kapa! */
    5056  }
     
    5460    fclose (f);
    5561    fprintf (stderr, "can't get png structure\n");
     62    free (pchoice);
     63    free (palette);
    5664    return (TRUE);
    5765  }
     
    6270    fclose (f);
    6371    fprintf (stderr, "can't get png info structure\n");
     72    free (pchoice);
     73    free (palette);
    6474    return (TRUE);
    6575  }
     
    6979    fclose (f);
    7080    fprintf (stderr, "can't get png return\n");
     81    free (pchoice);
     82    free (palette);
    7183    return (TRUE);
    7284  }
     
    8092  /* 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); */
    8193
    82   png_set_PLTE (png_ptr, info_ptr, palette, NPALETTE);
     94  png_set_PLTE (png_ptr, info_ptr, palette, Npalette);
    8395 
    8496  png_write_info (png_ptr, info_ptr);
     
    104116      for (i = 0; i < dx; i++) {
    105117        pixel = XGetPixel (tmpimage, i, j);
    106         for (found = k = 0; (k < NPALETTE) && !found; k++) {
     118        for (found = k = 0; (k < Npalette) && !found; k++) {
    107119          if (pixel == pchoice[k]) {
    108120            found = TRUE;
     
    133145
    134146  fclose (f);
     147  free (pchoice);
     148  free (palette);
    135149  return (TRUE);
    136150
  • trunk/Ohana/src/kapa/graph/PSFrame.c

    r2473 r4769  
    44int PSFrame (Layout *layout, FILE *f) {
    55 
    6   int i, j, P, IsLabel, fontsize;
     6  int i, P, IsLabel, fontsize;
    77  double fx, fy, dfx, dfy, range, major, minor, first, next;
    88  char *fontname;
     
    4646    }
    4747  }
     48  return (TRUE);
    4849}
    4950
    50 PSTick (FILE *f, double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis) {
     51void PSTick (FILE *f, double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis) {
    5152 
    5253  int pos, dir, fontsize;
     
    6869  DrawLine (x, y, dx, dy);
    6970
    70 # ifdef IN_AND_OUT_TICKS
    71 # define SPACE 0.03
    72 # else
    73 # define SPACE 0.01
    74 # endif
    75 
    7671  if (mode == 1) {
    7772    fontname = GetRotFont (&fontsize);
     
    8782    y = fy + (value-min)*dfy/(max - min) + dy;
    8883    if (fabs(value) < 1e-14) { value = 0.0; }
    89     sprintf (string, "%g\0", value);
     84    sprintf (string, "%g", value);
    9085    PSRotText (f, (int)x, (int)y, string, pos, 0.0);
    9186  }
    92  
    9387}
    9488
  • trunk/Ohana/src/kapa/graph/PSLabels.c

    r2473 r4769  
    33void PSLabels (Layout *layout, FILE *f) {
    44 
    5   int dX, dY, Xoff;
    6   int i, width, pos, x, y, size;
     5  int i, pos, x, y, size;
    76  double angle;
    87  char *fontname;
    9   double cs, sn;
    108
    119  fontname = GetRotFont (&size);
  • trunk/Ohana/src/kapa/graph/PSObjects.c

    r2473 r4769  
    9090int PSObjects (Layout *layout, FILE *f) {
    9191 
    92   int i, ltype;
     92  int i;
    9393  double lweight;
    9494  static char dash[] = "5";
     
    111111    lweight = MAX (0, MIN (10, layout[0].objects[i].lweight));
    112112    fprintf (f, "%.1f setlinewidth\n", lweight);
    113     fprintf (f, "%s setrgbcolor\n", GRAPHCOLORS[layout[0].objects[i].color][1]);
     113    fprintf (f, "%s setrgbcolor\n", GetRGBString(layout[0].objects[i].color));
    114114
    115115    switch (layout[0].objects[i].style) {
     
    134134    fprintf (f, "0.00 0.00 0.00 setrgbcolor\n");
    135135  }
     136  return (TRUE);
    136137}
    137138
  • trunk/Ohana/src/kapa/graph/PSPtext.c

    r2473 r4769  
    33void PSPtext (Layout *layout, FILE *f) {
    44
    5   int i, width, pos, x, y, size;
     5  int i, x, y, size;
    66  double angle;
    77  char *fontname;
  • trunk/Ohana/src/kapa/graph/cursor.c

    r2473 r4769  
    66  XEvent          event;
    77  KeySym          keysym;
    8   int             status, xstatus, value;
     8  int             status, value;
    99  XComposeStatus  composestatus;
    1010  char            string[10], line[35];
     
    7979        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;
    8080        if ((value > 0) && (isdigit(string[0]) || isalpha(string[0]))) {
    81           sprintf (line, "%c %12.6f %12.6f \0", string[0], x, y);
     81          sprintf (line, "%c %12.6f %12.6f ", string[0], x, y);
    8282          write (sock, line, 32);
    8383        }
  • trunk/Ohana/src/kapa/include/prototypes.h

    r2473 r4769  
     1Button       *CheckButtons        PROTO((XButtonEvent *, Layout *));
     2void          CheckColors         PROTO((int *, char **));
     3void          CheckDisplayName    PROTO((int *, char **, char *));
     4void          CheckFontName       PROTO((int *, char **, char *));
     5void          CheckGeometry       PROTO((int *, char **));
     6int           CheckPipe           PROTO(());
     7void          CreateWindow        PROTO((Window, int, long));
     8void          DefineLayout        PROTO((int, char **));
     9void          DrawConnect         PROTO((Layout *, Gobjects *));
     10void          DrawFrame           PROTO((Layout *));
     11void          DrawHistogram       PROTO((Layout *, Gobjects *));
     12void          DrawLabels          PROTO((Layout *));
     13int           DrawObjectN         PROTO((Layout *, Gobjects *));
     14int           DrawObjects         PROTO((Layout *));
     15void          DrawPoints          PROTO((Layout *, Gobjects *));
     16void          DrawXErrors         PROTO((Layout *, Gobjects *));
     17void          DrawYErrors         PROTO((Layout *, Gobjects *));
     18int           ErasePlot           PROTO(());
     19unsigned long GetColor            PROTO((Display *, char *, Colormap, unsigned long));
     20int           GetColormapSize     PROTO(());
     21char         *GetRGBString        PROTO((int N));
     22int           InButton            PROTO((XButtonEvent *, Button *));
     23int           InPicture           PROTO((XButtonEvent *, Picture *));
     24int           ListSection         PROTO(());
     25int           LoadBox             PROTO(());
     26void          LoadFont            PROTO((int *, char **, char *));
     27int           LoadLabels          PROTO(());
     28int           LoadObject          PROTO(());
     29int           LoadPtext           PROTO(());
     30int           LoadVectorData      PROTO((Layout *, int, char *));
     31void          MakeColormap        PROTO((int, char **));
     32void          MakeCursor          PROTO((unsigned int));
     33void          MapWindow           PROTO(());
     34void          NameWindow          PROTO((char *));
     35Display      *OpenDisplay         PROTO((char *, int *));
     36int           PNGit               PROTO(());
     37int           PPMit               PROTO(());
     38void          PSConnect           PROTO((Layout *, Gobjects *, FILE *));
     39int           PSFrame             PROTO((Layout *, FILE *));
     40void          PSHistogram         PROTO((Layout *, Gobjects *, FILE *));
     41void          PSLabels            PROTO((Layout *, FILE *));
     42int           PSObjects           PROTO((Layout *, FILE *));
     43void          PSPoints            PROTO((Layout *, Gobjects *, FILE *));
     44void          PSXErrors           PROTO((Layout *, Gobjects *, FILE *));
     45void          PSYErrors           PROTO((Layout *, Gobjects *, FILE *));
     46int           PSit                PROTO((int));
     47void          PositionPicture     PROTO((Layout *));
     48void          QuitX               PROTO((Display *, char *, char *));
     49int           Reconfig            PROTO((XEvent *));
     50void          Refresh             PROTO((int));
     51void          Remap               PROTO((Layout *, Matrix  *));
     52int           Resize              PROTO(());
     53int           SetFont             PROTO(());
     54int           SetLimits           PROTO(());
     55void          SetNormalHints      PROTO(());
     56int           SetSection          PROTO((int SwitchSection));
     57void          SetUpDisplay        PROTO((int *, char **));
     58void          SetUpWindow         PROTO((int *, char **));
     59void          SetWMHints          PROTO((Icon *));
     60void          TopWindow           PROTO((Icon *));
     61int           cursor              PROTO(());
     62int           get_argument        PROTO((int, char **, char *));
     63void          hh_hms              PROTO((char *, double, double, char));
     64int           remove_argument     PROTO((int, int *, char **));
    165
    2 # if (OLDPROTO)
    3 /***** Prototypes for image ***************/
     66int SetRotFont PROTO((char *name, int size));
     67void InitRotFonts PROTO(());
     68int DrawRotText PROTO((int x, int y, char *string, int pos, double angle));
     69int DrawRotBitmap PROTO((int x, int y, int dx, int dy, char *bitmap, int mode, double angle, double scale));
     70char *GetRotFont PROTO((int *size));
     71int RotStrlen PROTO((char *c));
     72void PSRotText PROTO((FILE *f, int x, int y, char *string, int pos, double angle));
     73void PSDumpRotSegment PROTO((FILE *f, char *segment, int *Nseg));
     74void PSSetFont PROTO((FILE *f, int size));
     75void MakeGC ();
    476
    5 void          PositionPictures    PROTO((Layout *, Graphic *));
    6 void          CreateColorbar      PROTO((Layout *, Graphic *));
     77int EventLoop ();
     78void CloseDisplay ();
     79
     80void DrawPtext (Layout *layout);
     81void FlushDisplay ();
     82void AxisTickScale (Axis *axis, double *major, double *minor);
     83void DrawFrame (Layout *layout);
     84void DrawTick (int fx, int fy, int dfx, int dfy, int P, double min, double max, double value, int mode, int naxis);
     85void FreeObjectData (Gobjects *object);
     86void PSPtext (Layout *layout, FILE *f);
     87void PSTick (FILE *f, double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis);
     88
     89/******************* XGRAPH **
     90void          StatusBox           PROTO((Graphic *, Layout *));
     91void          ResetColorbar       PROTO((Graphic *, Layout *, double, double));
     92void          Reorient            PROTO((Graphic *, Layout *, XButtonEvent *));
     93void          PaintOverlay        PROTO((Graphic *, Layout *, int));
     94void          MakeGC              PROTO((Graphic *));
     95void          InvertButton        PROTO((Graphic *, Button *));
     96void          FlashButton         PROTO((Graphic *, Button *));
     97void          DrawButton          PROTO((Graphic *, Button *));
     98void          DrawBitmap          PROTO((Graphic *, int, int, int, int, char *, int));
     99void          DragColorbar        PROTO((Graphic *, Layout *, XButtonEvent *));
     100void          CrossHairs          PROTO((Graphic *, Layout *));
     101void          CreateZoom          PROTO((Layout *, Graphic *, double, double));
    7102void          CreatePicture       PROTO((Layout *, Graphic *));
    8 void          CreateZoom          PROTO((Layout *, Graphic *, double, double));
    9 void          Remap               PROTO((Layout *, Matrix  *));
    10 int           NewPicture          PROTO((Graphic *, Layout *));
    11 void          Reorient            PROTO((Graphic *, Layout *, XButtonEvent *));
    12 int           UpdatePointer       PROTO((Graphic *, Layout *, XMotionEvent *));
    13 void          CrossHairs          PROTO((Graphic *, Layout *));
    14 int           LoadOverlay         PROTO((Graphic *, Layout *));
    15 int           SaveOverlay         PROTO((Graphic *, Layout *));
    16 int           CSaveOverlay         PROTO((Graphic *, Layout *));
    17 int           EraseOverlay        PROTO((Graphic *, Layout *));
    18 void          StatusBox           PROTO((Graphic *, Layout *));
    19 void          PaintOverlay        PROTO((Graphic *, Layout *, int));
    20 
    21 /***** Prototypes for action ***************/
    22 
    23 int           CheckPipe           PROTO((Graphic *, Layout *));
    24 void          DefineLayout        PROTO((Layout *, Graphic *, int, char **));
    25 int           EventLoop           PROTO((Graphic *, Layout *));
    26 int           InPicture           PROTO((XButtonEvent *, Picture *));
    27 int           InterpretKeys       PROTO((Graphic *, Layout *, XEvent *));
    28 int           InterpretPresses    PROTO((Graphic *, Layout *, XButtonEvent *));
    29 int           Reconfig            PROTO((Graphic *, Layout *, XEvent *));
    30 void          Refresh             PROTO((Graphic *, Layout *, int));
    31 int           Stop                PROTO((Graphic *, Layout *));
    32 int           PSit                PROTO((Graphic *, Layout *));
    33 int           get_argument        PROTO((int, char **, char *));
    34 int           remove_argument     PROTO((int, int *, char **));
    35 void          DragColorbar        PROTO((Graphic *, Layout *, XButtonEvent *));
    36 void          ResetColorbar       PROTO((Graphic *, Layout *, double, double));
    37 void          MakeColormap        PROTO((Graphic *, Layout *, int, char **));
    38 
    39 /***** Prototypes for button ***************/
    40 
    41 Button       *CheckButtons        PROTO((XButtonEvent *, Layout *));
    42 void          DrawButton          PROTO((Graphic *, Button *));
    43 void          FlashButton         PROTO((Graphic *, Button *));
    44 int           InButton            PROTO((XButtonEvent *, Button *));
    45 void          InvertButton        PROTO((Graphic *, Button *));
    46 int           greycolors          PROTO((Graphic *, Layout *));
    47103int           rainbow             PROTO((Graphic *, Layout *));
    48104int           puns                PROTO((Graphic *, Layout *));
     105int           greycolors          PROTO((Graphic *, Layout *));
     106int           UpdatePointer       PROTO((Graphic *, Layout *, XMotionEvent *));
     107int           ToggleDEG           PROTO((Graphic *, Layout *));
     108int           Stop                PROTO((Graphic *, Layout *));
     109int           SaveOverlay         PROTO((Graphic *, Layout *));
     110int           Rescale             PROTO((Graphic *, Layout *));
     111int           RecenterRescale     PROTO((Graphic *, Layout *));
    49112int           Recenter            PROTO((Graphic *, Layout *));
    50 int           RecenterRescale     PROTO((Graphic *, Layout *));
    51 int           Rescale             PROTO((Graphic *, Layout *));
    52 int           ToggleDEG           PROTO((Graphic *, Layout *));
     113int           Overlay3            PROTO((Graphic *, Layout *));
     114int           Overlay2            PROTO((Graphic *, Layout *));
     115int           Overlay1            PROTO((Graphic *, Layout *));
    53116int           Overlay0            PROTO((Graphic *, Layout *));
    54 int           Overlay1            PROTO((Graphic *, Layout *));
    55 int           Overlay2            PROTO((Graphic *, Layout *));
    56 int           Overlay3            PROTO((Graphic *, Layout *));
    57 
    58 /***** Prototypes for xtools ***************/
    59 
    60 void          CheckColors         PROTO((Graphic *, int *, char **));
    61 void          CheckDisplayName    PROTO((int *, char **, char *));
    62 void          CheckFontName       PROTO((int *, char **, char *));
    63 void          CheckGeometry       PROTO((int *, char **, Graphic *));
    64 void          CloseDisplay        PROTO((Graphic *));
    65 void          CreateWindow        PROTO((Graphic *, Window, int, long));
    66 void          DrawBitmap          PROTO((Graphic *, int, int, int, int, char *, int));
    67 unsigned long GetColor            PROTO((Display *, char *, Colormap, unsigned long));
    68 void          LoadFont            PROTO((Graphic *, int *, char **, char *));
    69 void          MakeCursor          PROTO((Graphic *, unsigned int));
    70 void          MakeGC              PROTO((Graphic *));
    71 void          MapWindow           PROTO((Graphic *));
    72 void          NameWindow          PROTO((Graphic *, char *));
    73 Display      *OpenDisplay         PROTO((char *, int *));
    74 void          QuitX               PROTO((Display *, char *, char *));
    75 void          SetNormalHints      PROTO((Graphic *));
    76 Display      *SetUpDisplay        PROTO((Graphic *, int *, char **));
    77 void          SetUpWindow         PROTO((Graphic *, int *, char **));
    78 void          SetWMHints          PROTO((Graphic *, Icon *));
    79 void          TopWindow           PROTO((Graphic *, Icon *));
    80 
    81 void          hh_hms              PROTO((char *, double, double, char));
    82 # endif
    83 
    84 Display *SetUpDisplay (int *, char **);
    85 Display *OpenDisplay (char *, int *);
    86 void CheckDisplayName (int *, char **, char *);
    87 void CheckColors (int *, char **);
    88 void SetUpWindow (int *, char **);
    89 void CheckGeometry (int *, char **);
    90 void TopWindow (Icon *);
    91 void QuitX (Display *, char *, char *);
    92 void CreateWindow (Window, int, long);
    93 void MakeCursor (unsigned int);
    94 void CheckFontName (int *, char **, char *);
    95 void LoadFont (int *, char **, char *);
    96 void SetNormalHints ();
    97 void SetWMHints (Icon *);
    98 void NameWindow (char *);
    99 void MapWindow ();
    100 void MakeColormap (int, char **);
    101 void DefineLayout (int, char **);
    102 void PositionPicture (Layout *);
    103 void DrawFrame (Layout *);
    104 int DrawObjects (Layout *);
    105 int DrawObjectN (Layout *, Gobjects *);
    106 void DrawConnect (Layout *, Gobjects *);
    107 void DrawHistogram (Layout *, Gobjects *);
    108 void DrawPoints (Layout *, Gobjects *);
    109 void DrawXErrors (Layout *, Gobjects *);
    110 void DrawYErrors (Layout *, Gobjects *);
    111 void DrawLabels (Layout *);
    112 void Refresh (int);
    113 int CheckPipe ();
    114 int PSit (int);
    115 int PSObjects (Layout *, FILE *);
    116 void PSConnect (Layout *, Gobjects *, FILE *);
    117 void PSHistogram (Layout *, Gobjects *, FILE *);
    118 void PSPoints (Layout *, Gobjects *, FILE *);
    119 void PSXErrors (Layout *, Gobjects *, FILE *);
    120 void PSYErrors (Layout *, Gobjects *, FILE *);
    121 int LoadObject ();
    122 int LoadVectorData (Layout *, int, char *);
    123 int SetLimits ();
    124 int LoadLabels ();
    125 int SetFont ();
    126 int cursor ();
    127 int ErasePlot ();
    128 int Reconfig (XEvent *);
    129 int LoadBox ();
    130 int PSFrame (Layout *, FILE *);
    131 void PSLabels (Layout *, FILE *);
     117int           NewPicture          PROTO((Graphic *, Layout *));
     118int           LoadOverlay         PROTO((Graphic *, Layout *));
     119int           InterpretPresses    PROTO((Graphic *, Layout *, XButtonEvent *));
     120int           InterpretKeys       PROTO((Graphic *, Layout *, XEvent *));
     121int           EventLoop           PROTO((Graphic *, Layout *));
     122int           EraseOverlay        PROTO((Graphic *, Layout *));
     123int           CSaveOverlay        PROTO((Graphic *, Layout *));
     124*/
  • trunk/Ohana/src/kapa/include/structures.h

    r3465 r4769  
    1 /** this list must match the one in mana/include/package.h, and equiv */
    2 # define NGRAPHCOLORS 23
    3 static char GRAPHCOLORS[NGRAPHCOLORS][2][15] = {
    4 {"black",    "0.00 0.00 0.00"},
    5 {"white",    "1.00 1.00 1.00"},
    6 {"red",      "1.00 0.00 0.00"},
    7 {"pink",     "1.00 0.75 0.80"},
    8 {"orange",   "1.00 0.65 0.00"},
    9 {"yellow",   "1.00 1.00 0.00"},
    10 {"wheat",    "0.96 0.87 0.70"},
    11 {"gold",     "1.00 0.84 0.00"},
    12 {"green",    "0.00 1.00 0.00"},
    13 {"darkgreen","0.00 0.40 0.00"},
    14 {"blue",     "0.00 0.00 1.00"},
    15 {"skyblue",  "0.53 0.81 0.92"},
    16 {"indigo",   "0.56 0.16 0.87"},
    17 {"violet",   "1.00 0.00 0.00"},
    18 {"grey10",   "0.10 0.10 0.10"},
    19 {"grey20",   "0.20 0.20 0.20"},
    20 {"grey30",   "0.30 0.30 0.30"},
    21 {"grey40",   "0.40 0.40 0.40"},
    22 {"grey50",   "0.50 0.50 0.50"},
    23 {"grey60",   "0.60 0.60 0.60"},
    24 {"grey70",   "0.70 0.70 0.70"},
    25 {"grey80",   "0.80 0.80 0.80"},
    26 {"grey90",   "0.90 0.90 0.90"}};
    271
    282/**************** Graphic carries X info around ****************/
     
    4014  unsigned long  fore;
    4115  unsigned long  back;
    42   unsigned long  color[NGRAPHCOLORS];
     16  unsigned long  *color;
    4317} Graphic;
    4418
  • trunk/Ohana/src/kapa/setup/CheckColors.c

    r2473 r4769  
    66  char *temp_name;
    77  int N;
    8   unsigned long temp_color;
    98
    109  graphic.fore = BlackPixel (graphic.display, graphic.screen);
    1110  temp_name = XGetDefault (graphic.display, argv[0], "Foreground");
    12   if (N = get_argument (*argc, argv, "-fg")) {
     11  if ((N = get_argument (*argc, argv, "-fg"))) {
    1312    if (N + 1 < *argc) {
    1413      temp_name = argv[N+1];
     
    2322  graphic.back = WhitePixel (graphic.display, graphic.screen);
    2423  temp_name = XGetDefault (graphic.display, argv[0], "Background");
    25   if (N = get_argument (*argc, argv, "-bg")) {
     24  if ((N = get_argument (*argc, argv, "-bg"))) {
    2625    if (N + 1 < *argc) {
    2726      temp_name = argv[N+1];
  • trunk/Ohana/src/kapa/setup/CheckDisplayName.c

    r2473 r4769  
    77
    88  display_name[0] = 0;
    9   if (N = get_argument (*argc, argv, "-d")) {
     9  if ((N = get_argument (*argc, argv, "-d"))) {
    1010    if (N + 1 < *argc) {
    1111      strcpy (display_name, argv[N + 1]);
     
    1818  }
    1919
    20   if (N = get_argument (*argc, argv, "-display")) {
     20  if ((N = get_argument (*argc, argv, "-display"))) {
    2121    if (N + 1 < *argc) {
    2222      strcpy (display_name, argv[N + 1]);
  • trunk/Ohana/src/kapa/setup/CheckFontName.c

    r2473 r4769  
    66  int N;
    77
    8   if (N = get_argument (*argc, argv, "-font")) {
     8  if ((N = get_argument (*argc, argv, "-font"))) {
    99    if (N + 1 < *argc) {
    1010      strcpy (fontname, argv[N + 1]);
     
    1616    }
    1717  }   
    18   if (N = get_argument (*argc, argv, "-fn")) {
     18  if ((N = get_argument (*argc, argv, "-fn"))) {
    1919    if (N + 1 < *argc) {
    2020      strcpy (fontname, argv[N + 1]);
  • trunk/Ohana/src/kapa/setup/CheckGeometry.c

    r2473 r4769  
    1010 
    1111  temp_name = XGetDefault (graphic.display, argv[0], "geometry");
    12   if (N = get_argument (*argc, argv, "-geom")) {
     12  if ((N = get_argument (*argc, argv, "-geom"))) {
    1313    if (N + 1 < *argc) {
    1414      temp_name = argv[N+1];
     
    2929    if (status & WidthValue) {
    3030      dX = dx;
    31       MAX (dX, MIN_WIDTH);
    3231    }
    3332    if (status & HeightValue) {
    3433      dY = dy;
    35       MAX (dY, MIN_HEIGHT);
    3634    }
    3735    if (status & XNegative) X  = DisplayWidth  (graphic.display, graphic.screen) - dX + X;
  • trunk/Ohana/src/kapa/setup/DefineLayout.c

    r2473 r4769  
    55void DefineLayout (int argc, char **argv) {
    66
    7   int i, j, status, N, offset, FOREGROUND;
    8   Visual *visual = CopyFromParent;
     7  int i, status, N, FOREGROUND;
    98  struct sockaddr_un Address;
    109  char temp[100];
    11   double PADx, PADy;
    1210 
    1311  if ((N = get_argument (argc, argv, "-debug"))) {
     
    3331    Address.sun_family = AF_UNIX;
    3432    sock = socket (AF_UNIX, SOCK_STREAM, 0);
    35     status = connect (sock, &Address, sizeof (Address));
     33    status = connect (sock, (struct sockaddr *) &Address, sizeof (Address));
    3634    if (status < 0) {
    3735      fprintf (stderr, "kapa - unsuccessful connection: %d\n", status);
     
    3937    }
    4038    fcntl (sock, F_SETFL, O_NONBLOCK); 
    41     sprintf (temp, "rm -f %s\0", argv[1]);
     39    sprintf (temp, "rm -f %s", argv[1]);
    4240    system (temp);
    4341  }
  • trunk/Ohana/src/kapa/setup/MakeColormap.c

    r2473 r4769  
    11# include "Ximage.h"
     2
     3/* this list must match the one in mana/include/package.h, and equiv
     4 * we need to define library calls to the kapa and kii packages which mana
     5 * and other programs would link against.  This would allow them to have
     6 * access to the list of available colors.  Or... we need to have mana, etc
     7 * query kapa/kii about it list of colors...
     8 */
     9
     10# define NGRAPHCOLORS 23
     11static char GRAPHCOLORS[NGRAPHCOLORS][2][15] = {
     12{"black",    "0.00 0.00 0.00"},
     13{"white",    "1.00 1.00 1.00"},
     14{"red",      "1.00 0.00 0.00"},
     15{"pink",     "1.00 0.75 0.80"},
     16{"orange",   "1.00 0.65 0.00"},
     17{"yellow",   "1.00 1.00 0.00"},
     18{"wheat",    "0.96 0.87 0.70"},
     19{"gold",     "1.00 0.84 0.00"},
     20{"green",    "0.00 1.00 0.00"},
     21{"darkgreen","0.00 0.40 0.00"},
     22{"blue",     "0.00 0.00 1.00"},
     23{"skyblue",  "0.53 0.81 0.92"},
     24{"indigo",   "0.56 0.16 0.87"},
     25{"violet",   "1.00 0.00 0.00"},
     26{"grey10",   "0.10 0.10 0.10"},
     27{"grey20",   "0.20 0.20 0.20"},
     28{"grey30",   "0.30 0.30 0.30"},
     29{"grey40",   "0.40 0.40 0.40"},
     30{"grey50",   "0.50 0.50 0.50"},
     31{"grey60",   "0.60 0.60 0.60"},
     32{"grey70",   "0.70 0.70 0.70"},
     33{"grey80",   "0.80 0.80 0.80"},
     34{"grey90",   "0.90 0.90 0.90"}};
     35
     36int GetColormapSize () {
     37  return (NGRAPHCOLORS);
     38}
     39
     40char *GetRGBString (int N) {
     41  return (GRAPHCOLORS[N][1]);
     42}
    243
    344void MakeColormap (int argc, char **argv) {
     
    647  char *temp_name;
    748
     49  ALLOCATE (graphic.color, unsigned long, NGRAPHCOLORS);
    850
    951  for (i = 0; i < NGRAPHCOLORS; i++) {
  • trunk/Ohana/src/kapa/setup/MakeGC.c

    r2473 r4769  
    44void MakeGC () {
    55
    6   GC gc;
    76  XGCValues gcvalues;
    87
  • trunk/Ohana/src/kapa/setup/OpenDisplay.c

    r2473 r4769  
    55
    66  Display *display;
    7   char *tmp;
    87 
    98  display = XOpenDisplay (display_name);
  • trunk/Ohana/src/kapa/setup/SetUpDisplay.c

    r2473 r4769  
    22
    33/************** SetUpDisplay *************/
    4 Display *SetUpDisplay (int *argc, char **argv) {
     4void SetUpDisplay (int *argc, char **argv) {
    55
    66  char display_name[120];
  • trunk/Ohana/src/kapa/setup/TopWindow.c

    r2473 r4769  
    44void TopWindow (Icon *icon) {
    55
    6   int screen;
    76  Window rootwindow;
    87
  • trunk/Ohana/src/kapa/setup/Ximage.c

    r2473 r4769  
    11# include "Ximage.h"
    22
    3 main (argc, argv)
    4 int argc;
    5 char *argv[];
    6 
    7 {
     3int main (int argc, char **argv) {
    84 
    95  SetUpDisplay (&argc, argv);
     
    1511  XFreeFont (graphic.display, graphic.font);
    1612  CloseDisplay ();
    17 
     13  exit (0);
    1814}
    1915
Note: See TracChangeset for help on using the changeset viewer.