home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
tools
/
placeicons
/
placeicons.c
< prev
Wrap
C/C++ Source or Header
|
1995-01-25
|
1KB
|
60 lines
#include <stdio.h>
#define XDELTA (90) /* Horizontal distance between icons */
#define YDELTA (35) /* Vertical distance between icons */
#define XOFFSET (16) /* Horizontal offset from left window edge */
#define YOFFSET (10) /* Vertical offset from top of window */
#define ACROSS (6) /* Number of icons across */
main (argc, argv)
int argc;
char *argv[];
{
int xoffset = XOFFSET;
int xdelta = XDELTA;
int yoffset = YOFFSET;
int ydelta = YDELTA;
int across = ACROSS;
int xpos = 0;
int ypos = 0;
int ch;
int i = 0;
extern int optind;
extern char *optarg;
char fname[256];
while ((ch = getopt (argc, argv, "x:X:y:Y:N:?")) != EOF)
{
switch (ch)
{
case 'x':
xdelta = atoi (optarg);
break;
case 'X':
xoffset = atoi (optarg);
break;
case 'y':
ydelta = atoi (optarg);
break;
case 'Y':
yoffset = atoi (optarg);
break;
case 'N':
across = atoi (optarg);
break;
case '?':
printf ("placeicon -x <xdelta> -X <xoffset> -y <ydelta> -Y <yoffset> -N <# across> <files>\n");
exit (1);
break;
}
}
while ((gets (fname) != NULL))
{
xpos = ((i % across) * xdelta) + xoffset;
ypos = ((i / across) * ydelta) + yoffset;
printf ("IconPos \"%s\" %d %d\n", fname, xpos, ypos);
i++;
}
exit (0);
}