Commit 99474310 authored by Florian Ernst's avatar Florian Ernst

Imported Upstream version 8.0.0

parent fb38951e
This diff is collapsed.
/*
* @(#)Abacus.h
*
* Copyright 1994 - 2012 David A. Bagley, bagleyd@tux.org
* Copyright 1994 - 2014 David A. Bagley, bagleyd@tux.org
*
* Abacus demo and neat pointers from
* Copyright 1991 - 1998 Luis Fernandes, elf@ee.ryerson.ca
......@@ -49,6 +49,7 @@
#define XtNhighlightRailColor ((char *) "highlightRailColor")
#define XtNbumpSound ((char *) "bumpSound")
#define XtNmoveSound ((char *) "moveSound")
#define XtNdripSound ((char *) "dripSound")
#define XtNsound ((char *) "sound")
#define XtNdelay ((char *) "delay")
#define XtNscript ((char *) "script")
......@@ -131,6 +132,7 @@
#define XtCHighlightRailColor ((char *) "HighlightRailColor")
#define XtCBumpSound ((char *) "BumpSound")
#define XtCMoveSound ((char *) "MoveSound")
#define XtCDripSound ((char *) "DripSound")
#define XtCSound ((char *) "Sound")
#define XtCDelay ((char *) "Delay")
#define XtCScript ((char *) "Script")
......@@ -339,6 +341,7 @@ typedef struct {
#define MAX_MODES 7
#define TEACH_STRING0 "Enter calculation X+Y, X-Y, X*Y, X/Y, Xv, or Xu where X positive and result positive."
#define TEACH_STRING1 "Press enter to go through calculation steps."
#define ZERO_STRING "0.0"
typedef struct _AbacusRec *AbacusWidget;
typedef struct _AbacusRec *AbacusDemoWidget;
......
......@@ -275,6 +275,8 @@ static Expression parseExpression;
#endif
#ifdef WINVER
/* Some versions have, some do not, change to 1 if you do not */
#if 0
static double
pow(double x, double y)
{
......@@ -287,6 +289,7 @@ cbrt(double x) /* -inf < x < inf */
return ((x < 0.0) ? -pow(-x, 1.0 / 3.0) : pow(x, 1.0 / 3.0));
}
#endif
#endif
static double
powInt(int base, int y)
......@@ -410,7 +413,7 @@ convertFromInteger(char *outputString, int base, int x)
placesBase = logInt(number, base);
fractDigits -= (placesBase + 1);
/* rounder */
number += (pow((double) base, -fractDigits) / 2.0);
number += (int) (pow((double) base, -fractDigits) / 2.0);
/* Convert Integer Part */
if (number < 1.0) {
......@@ -420,9 +423,9 @@ convertFromInteger(char *outputString, int base, int x)
placesBase = logInt(number, base);
factor = pow((double) base, (double) placesBase);
for (; placesBase >= 0; placesBase--) {
digit = (int) (number / factor);
digit = (short unsigned int) (number / factor);
outputString[l++] = DIGIT_TO_CHAR(digit);
number -= factor * digit;
number -= (int) (factor * digit);
factor /= base;
}
}
......@@ -468,7 +471,7 @@ convertFromDouble(char *outputString, int base, double x)
placesBase = logInt(number, base);
factor = pow((double) base, (double) placesBase);
for (; placesBase >= 0; placesBase--) {
digit = (int) (number / factor);
digit = (short unsigned int) (number / factor);
outputString[l++] = DIGIT_TO_CHAR(digit);
number -= factor * digit;
factor /= base;
......@@ -479,7 +482,7 @@ convertFromDouble(char *outputString, int base, double x)
outputString[l++] = decimalPoint;
for (placesBase = 1; placesBase <= fractDigits;
placesBase++) {
digit = (int) (number / factor);
digit = (short unsigned int) (number / factor);
outputString[l++] = DIGIT_TO_CHAR(digit);
number -= factor * digit;
factor /= base;
......@@ -534,7 +537,7 @@ formatToDisplay (char *string, double z, int base)
short unsigned int periods = 0;
convertFromDouble(string, base, z);
length = strlen(string);
length = (int) strlen(string);
while (i <= length) {
if (string[i] == '\0' && periods == 0) {
j = length;
......@@ -1088,7 +1091,7 @@ void
convertStringToAbacus(AbacusWidget w, char *string, int aux)
{
int decimal = 0;
int num, factor, i, sign = 0, len = strlen(string);
int num, factor, i, sign = 0, len = (int) strlen(string);
AbacusWidget *wap = &w, wa;
if (aux == 1 && w->abacus.leftAux != NULL)
......@@ -1098,8 +1101,10 @@ convertStringToAbacus(AbacusWidget w, char *string, int aux)
wa = *wap;
if (aux == 0) {
clearRails(w);
#ifndef WINVER
} else {
clearAuxRails(w, aux);
#endif
}
while (string[decimal] != '\0' && string[decimal] != decimalPoint)
decimal++;
......@@ -1166,14 +1171,14 @@ addBackAnomaly(char * buf, int anomaly, int shift, int base)
void
zeroFractionalPart(char * buf)
{
unsigned int i;
unsigned int i;
for (i = 0; i < strlen(buf); i++) {
if (buf[i] == '.') {
buf[i + 1] = '\0';
return;
}
for (i = 0; i < strlen(buf); i++) {
if (buf[i] == '.') {
buf[i + 1] = '\0';
return;
}
}
}
char *strAddChar(char *buf, char c)
......
/*
* @(#)AbacusM.c
*
* Copyright 1994 - 2009 David A. Bagley, bagleyd@tux.org
* Copyright 1994 - 2013 David A. Bagley, bagleyd@tux.org
*
* All rights reserved.
*
......@@ -145,16 +145,15 @@ char2Int(char character)
char
int2Char(int digit)
{
char charValue = (char) digit;
char charValue = (char) (digit + '0');
charValue += '0';
/* ASCII or EBCDIC */
if (charValue > '9' || charValue < '0') {
charValue += ('A' - '9' - 1);
charValue = (char) (digit + 'A' - '9' - 1);
if (charValue > 'I')
charValue += ('J' - 'I' - 1);
charValue = (char) (digit + 'J' - 'I' - 1);
if (charValue > 'R')
charValue += ('S' - 'R' - 1);
charValue = (char) (digit + 'S' - 'R' - 1);
}
return charValue;
}
......@@ -237,7 +236,7 @@ string2Int(char *buf, int base, char decimalPoint)
if (buf[position] == '-') {
return 0;
}
last = strlen(buf);
last = (int) strlen(buf);
for (; position < last; position++) {
if (buf[position] == decimalPoint) {
break;
......@@ -326,7 +325,7 @@ dividePieces(char *buf, int base, int pieces, int mult, int places,
void
shiftDecimal(char *buf, char *aBuf, int shift, int place, char decimalPoint)
{
int size = strlen(aBuf);
int size = (int) strlen(aBuf);
int loc = 0, i = 0, integerDigits;
#ifdef DEBUG
......@@ -370,7 +369,7 @@ shiftDecimal(char *buf, char *aBuf, int shift, int place, char decimalPoint)
void
addStrings(char *buf, char *aBuf, char *bBuf, int base, char decimalPoint)
{
int aEnd = strlen(aBuf), bEnd = strlen(bBuf); /* zeros included */
int aEnd = (int) strlen(aBuf), bEnd = (int) strlen(bBuf); /* zeros included */
int aDecimal = aEnd, bDecimal = bEnd;
int aSign = ((aBuf[0] == '-') ? 1 : 0);
int bSign = ((bBuf[0] == '-') ? 1 : 0);
......@@ -451,7 +450,7 @@ addStrings(char *buf, char *aBuf, char *bBuf, int base, char decimalPoint)
} else
(void) strcpy(buf, bBuf);
}
i = strlen(buf) - 1;
i = (int) strlen(buf) - 1;
while (buf[i] == '0' && buf[i - 1] != decimalPoint)
i--;
buf[i + 1] = '\0';
......@@ -475,7 +474,7 @@ convertString(char * buf, char * inbuf, int base, int displayBase,
#ifdef DEBUG
(void) printf("convertString: inbuf %s\n", inbuf);
#endif
last = strlen(inbuf);
last = (int) strlen(inbuf);
negative = (inbuf[0] == '-');
for (i = (negative) ? 1 : 0; i < last; i++) {
if (inbuf[i] == decimalPoint) {
......@@ -577,7 +576,7 @@ sizeofRoman(int base, Boolean romanNumerals, Boolean ancientRoman)
if (!romanNumerals)
return 0;
romanWidth = ((base < 8) ? base : base / 2 - 1) *
((sizeof(roman) + 1) / 2);
((((int) sizeof (roman)) + 1) / 2);
romanWidth *= ((ancientRoman) ? 6 : 1);
return romanWidth + 12 + MAX_ROMANFRACT;
}
......
/*
* @(#)AbacusP.h
*
* Copyright 1994 - 2013 David A. Bagley, bagleyd@tux.org
* Copyright 1994 - 2014 David A. Bagley, bagleyd@tux.org
*
* Abacus demo and neat pointers from
* Copyright 1991 - 1998 Luis Fernandes, elf@ee.ryerson.ca
......@@ -58,7 +58,7 @@ extern void initializeAbacus(AbacusWidget w, HBRUSH brush);
extern void exposeAbacus(AbacusWidget w);
extern void hideAbacus(AbacusWidget w);
extern void selectAbacus(AbacusWidget w, const int x, const int y);
extern void releaseAbacus(AbacusWidget w);
extern void releaseAbacus(AbacusWidget w, const int x, const int y);
extern void clearAbacus(AbacusWidget w);
extern void complementAbacus(AbacusWidget w);
extern void incrementAbacus(AbacusWidget w);
......@@ -131,6 +131,9 @@ extern AbacusClassRec abacusClassRec;
#ifndef MOVESOUND
#define MOVESOUND "move"
#endif
#ifndef DRIPSOUND
#define DRIPSOUND "drip"
#endif
#define MAX_DECKS 2
#define PLACE_SETTING 2
......@@ -214,7 +217,7 @@ typedef struct _AbacusPart {
int leftAuxRails, rightAuxRails;
int aux, deck, rail, number;
int pressOffsetX, pressOffsetY;
Position width, midHeight, midBarY, railWidth;
Position width, middleBarHeight, middleBarPositionY, railWidth;
Point frameSize, beadSize;
Point pos, delta, offset;
Boolean sign, minusSign, romanNumerals, group, decimalComma;
......@@ -240,13 +243,13 @@ typedef struct _AbacusPart {
struct _AbacusPart *leftAux, *rightAux;
#ifdef WINVER
char format[STRING_SIZE], museum[COUNTRY_SIZE];
char bumpSound[STRING_SIZE], moveSound[STRING_SIZE];
char bumpSound[STRING_SIZE], moveSound[STRING_SIZE], dripSound[STRING_SIZE];
char aString[STRING_SIZE], bString[STRING_SIZE];
char cString[STRING_SIZE], rString[STRING_SIZE];
char sString[STRING_SIZE];
char helperBuffer[STRING_SIZE];
#else
char *format, *museum, *bumpSound, *moveSound;
char *format, *museum, *bumpSound, *moveSound, *dripSound;
char *aString, *bString, *cString, *rString, *sString;
char *teachBuffer;
int menu, pixmapSize;
......@@ -325,7 +328,6 @@ extern int convertBaseToBottom(int base);
extern int rootInt(int i, int n);
extern void clearRails(AbacusWidget w);
extern void clearAuxRails(AbacusWidget w, int aux);
extern void addBackAnomaly(char * buf, int anomaly, int shift, int base);
extern void zeroFractionalPart(char * buf);
extern void convertStringToAbacus(AbacusWidget w, char *string, int aux);
......@@ -335,6 +337,8 @@ extern void convertFromDouble(char *outputString, int base, double x);
#ifdef WINVER
extern void drawDemoText(const char* line, int i);
extern void drawTeachText(const char* line, int i);
#else
extern void clearAuxRails(AbacusWidget w, int aux);
#endif
#endif /* _AbacusP_h */
/*
* @(#)AbacusT.c
*
* Copyright 2009 - 2012 David A. Bagley, bagleyd@tux.org
* Copyright 2009 - 2013 David A. Bagley, bagleyd@tux.org
*
* All rights reserved.
*
......@@ -349,6 +349,9 @@ static void drawLineText(AbacusWidget w, char* line, int i)
w->core.height + w->abacusDemo.fontHeight * i - 1,
line, (signed) strlen(line));
#else
if (w == NULL) {
return;
}
drawTeachText(line, i);
#endif
#else
......@@ -372,7 +375,7 @@ static int getDecimalStringPosition(char * string)
/* Position of decimal point in int array */
static int arrayLen(int * array)
{
unsigned int i = 0;
int i = 0;
while (array[i] != -2) {
i++;
......@@ -383,7 +386,7 @@ static int arrayLen(int * array)
/* Position of decimal point in int array */
static int getDecimalArrayPosition(int * array)
{
unsigned int i = 0;
int i = 0;
while (array[i] != -2) {
if (array[i] == -1)
......@@ -498,7 +501,7 @@ static void trimStringBuffer(char *string)
int last;
contractStringBuffer(string);
last = strlen(string) - 1;
last = (int) strlen(string) - 1;
if (string[last] == '.')
string[last] = '\0';
}
......@@ -525,7 +528,7 @@ static void stripDecimal(char * string) {
}
if (found == 0)
return;
length = strlen(string);
length = (int) strlen(string);
for (i = found; i < length; i++)
string[i - found] = string[i];
string[length - found] = '\0';
......@@ -538,7 +541,7 @@ static void stripStringBuffer(char *string, int len, int steps)
trimStringBuffer(string);
stripDecimal(string);
length = strlen(string);
length = (int) strlen(string);
if (len >= 0) {
if (length >= len)
string[length - len] = '\0';
......@@ -552,7 +555,7 @@ static void stripStringBuffer(char *string, int len, int steps)
}
}
#ifdef OLD_DEBUG
(void) printf("stripStringBuffer: %s %d\n", string, strlen(string));
(void) printf("stripStringBuffer: %s %d\n", string, (int) strlen(string));
#endif
}
#endif
......@@ -588,54 +591,54 @@ static void shiftStringBuffer(char * string, int shift)
int offset = getDecimalStringPosition(string);
int newOffset, i, j, k;
j = strlen(string);
j = (int) strlen(string);
if (offset != j)
for (i = 0; i < j - offset; i++) {
string[offset + i] = string[offset + i + 1];
}
j = strlen(string);
j = (int) strlen(string);
if (offset >= j) {
while (j > 1 && string[j - 1] == '0') {
string[j - 1] = string[j];
}
}
if (offset == 1 && string[0] == '0') {
while (strlen(string) > 1 &&
while (((int) strlen(string)) > 1 &&
string[0] == '0') {
j = strlen(string);
j = (int) strlen(string);
for (i = 1; i <= j; i++) {
string[i - 1] = string[i];
}
offset--;
}
}
if (string[0] == '0' && strlen(string) == 1) {
if (string[0] == '0' && ((int) strlen(string)) == 1) {
return;
}
newOffset = offset + shift;
if (newOffset <= 0) {
for (i = 0; i < -newOffset; i++) {
j = strlen(string);
j = (int) strlen(string);
for (k = j; k >= 0; k--) {
string[k + 1] = string[k];
}
string[0] = '0';
}
j = strlen(string);
j = (int) strlen(string);
for (i = j; i >= 0; i--) {
string[i + 2] = string[i];
}
string[0] = '0';
string[1] = '.';
} else if (newOffset >= (int) strlen(string)) {
newOffset -= strlen(string);
newOffset -= (int) strlen(string);
for (i = 0; i < newOffset; i++) {
j = strlen(string);
j = (int) strlen(string);
string[j] = '0';
string[j + 1] = '\0';
}
} else {
for (i = strlen(string); i >= newOffset; i--) {
for (i = (int) strlen(string); i >= newOffset; i--) {
string[i + 1] = string[i];
}
string[newOffset] = '.';
......@@ -830,7 +833,7 @@ static int nextCharPosition(AbacusWidget w, int step, int carryStep, int aux,
AbacusWidget *wap = &w, wa;
if ((int) strlen(string) == getDecimalStringPosition(string))
count = strlen(string); /* no decimal point */
count = (int) strlen(string); /* no decimal point */
if (aux == 1 && w->abacus.leftAux != NULL)
wap = (AbacusWidget *) w->abacus.leftAux;
else if (aux == 2 && w->abacus.rightAux != NULL)
......@@ -905,7 +908,7 @@ static int placeGroup(int *intGroup)
static int andAbove(char * string, int place, int base)
{
int i, value = 0, factor = 1, pos;
int runover = decimalOffsetString(string, place) - strlen(string);
int runover = decimalOffsetString(string, place) - (int) strlen(string);
int newPlace = place;
if (runover > 0)
......@@ -931,7 +934,7 @@ static int andAbove(char * string, int place, int base)
static int andAbovePlaces(char * string, int place)
{
int i, j, pos = 0;
int runover = decimalOffsetString(string, place) - strlen(string);
int runover = decimalOffsetString(string, place) - (int) strlen(string);
int newPlace = place;
Boolean decimalValue = False;
Boolean intValue = False;
......@@ -945,7 +948,7 @@ static int andAbovePlaces(char * string, int place)
}
}
/* Handle numbers < 1 */
for (j = 0; j < strlen(string); j++) {
for (j = 0; j < (int) strlen(string); j++) {
if (string[j] == '0') {
if (decimalValue)
i--;
......@@ -1088,7 +1091,7 @@ static int multDivSteps(AbacusWidget w, char * aString, char * bString)
{
/* decimal included */
return divSteps(w, aString, bString, w->abacus.decimalPosition) *
(strlen(bString) - 1);
((int) strlen(bString) - 1);
}
/* Number of subtraction steps for each multiplication in division */
......@@ -1123,7 +1126,7 @@ static double headDivisor(AbacusWidget w, char * string)
static void rootGroup(AbacusWidget w, char* string, int root, int** group)
{
int decimal = getDecimalStringPosition(string);
int length = strlen(string);
int length = (int) strlen(string);
int nIntegral = decimal;
int nDecimal = length - decimal - 1;
int i, j, k, b, n;
......@@ -1135,7 +1138,7 @@ static void rootGroup(AbacusWidget w, char* string, int root, int** group)
n = nIntegral + nDecimal + 1;
if (*group != NULL)
free(*group);
*group = (int *) malloc(sizeof (int) * n + 1);
*group = (int *) malloc(sizeof (int) * (size_t) (n + 1));
for (i = 0; i < nIntegral; i++) {
k = i * root + (decimal + root - 1) % root;
(*group)[i] = 0;
......@@ -1604,7 +1607,7 @@ static Boolean nextPositionDivision(AbacusWidget w,
w->abacus.bString);
int topFactor = w->abacus.decks[TOP].factor;
int bottomNumber = w->abacus.decks[BOTTOM].number;
int bCount = strlen(w->abacus.bString) - 1;
int bCount = (int) strlen(w->abacus.bString) - 1;
Boolean rightToLeft = w->abacus.rightToLeftAdd;
int bOffset, rOffset;
int aPlace, bPlace, rPlace, rDigit;
......@@ -1904,7 +1907,7 @@ static Boolean nextPositionPOField(AbacusWidget w,
}
/* A little tricky as this is reentrant */
void teachStepRoot(AbacusWidget w)
static void teachStepRoot(AbacusWidget w)
{
char buffer2[120] = "";
char buffer3[120] = "";
......@@ -2377,9 +2380,9 @@ void teachStep(AbacusWidget w, char * buffer, int aux)
if (w->abacus.op == '+' || w->abacus.op == '-') {
convertStringToAbacus(w, w->abacus.aString, aux);
if (w->abacus.leftAux != NULL)
convertStringToAbacus(w, (char *) "0.0", 1);
convertStringToAbacus(w, (char *) ZERO_STRING, 1);
if (w->abacus.rightAux != NULL)
convertStringToAbacus(w, (char *) "0.0", 2);
convertStringToAbacus(w, (char *) ZERO_STRING, 2);
a = convertToDecimal(base, w->abacus.aString);
b = convertToDecimal(base, w->abacus.bString);
if (w->abacus.op == '-' && b > a) {
......@@ -2408,7 +2411,7 @@ void teachStep(AbacusWidget w, char * buffer, int aux)
} else if (w->abacus.op == '*') {
if (strlen(w->abacus.aString) == 0)
return;
convertStringToAbacus(w, (char *) "0.0", 0);
convertStringToAbacus(w, (char *) ZERO_STRING, 0);
if (w->abacus.leftAux != NULL)
convertStringToAbacus(w, w->abacus.aString, 1);
a = convertToDecimal(base, w->abacus.aString);
......@@ -2443,7 +2446,7 @@ void teachStep(AbacusWidget w, char * buffer, int aux)
} else if (w->abacus.op == '/') {
if (strlen(w->abacus.aString) == 0)
return;
convertStringToAbacus(w, (char *) "0.0", 2);
convertStringToAbacus(w, (char *) ZERO_STRING, 2);
convertStringToAbacus(w, w->abacus.aString, 0);
a = convertToDecimal(base, w->abacus.aString);
if (w->abacus.rightAux != NULL)
......@@ -2495,9 +2498,9 @@ void teachStep(AbacusWidget w, char * buffer, int aux)
stringGroup(w->abacus.intGroup, group, w->abacus.op);
convertStringToAbacus(w, w->abacus.aString, aux);
if (w->abacus.leftAux != NULL)
convertStringToAbacus(w, (char *) "0.0", 1);
convertStringToAbacus(w, (char *) ZERO_STRING, 1);
if (w->abacus.rightAux != NULL)
convertStringToAbacus(w, (char *) "0.0", 2);
convertStringToAbacus(w, (char *) ZERO_STRING, 2);
a = convertToDecimal(base, w->abacus.aString);
(void) sprintf(buffer1, "%s root of %s, grouping digits yields (%s)",
((w->abacus.op == 'v') ? "Square" : "Cube"),
......
Copyright 1994 - 2013 David A. Bagley, bagleyd@tux.org
Copyright 1994 - 2014 David A. Bagley, bagleyd@tux.org
All Rights Reserved
......
[Mar 18, 2014] V8.0.0:
Added drip sound for format change.
Moving the decimal point needs a select and a release to a different
point on "tape". Now behavior more consistent with a real abacus.
Also consistent with Android, as a big finger moving beads would
too easily move decimal point.
Scalable frame.
[Jan 20, 2014] V7.7.3: Not released
Reorganized pixmaps directory.
[Jan 10, 2013] V7.7.1:
Fixed draw of diamond beads when vertical.
Added scrolls to help dialogs where needed.
......@@ -161,8 +170,8 @@
here also.
Changed pointer from crosshair to hand2.
gs has problems reading the distributed postscript file. In pixmaps
directory, I now distribute gif files in case there are others like
me who have trouble reading it. As of now, these are not installed
directory, I now distribute gif [now png] files in case there are others
like me who have trouble reading it. As of now, these are not installed
automatically.
[Dec 24, 2007] V7.3.3:
Constants changed.
......
......@@ -30,9 +30,8 @@ Basic Installation
@make
win32/Makefile (MinGW users only):
You may want to set parameters in Makefile (like
COPT=-02 -mno-cygwin).
win32/Makefile (MinGW gcc only):
You may want to set parameters in Makefile for target triplet.
cd win32
make
......
......@@ -3,7 +3,7 @@
#endif
XCOMM @(#)Imakefile
XCOMM
XCOMM Copyright 1994 - 2010 David A. Bagley, bagleyd@tux.org
XCOMM Copyright 1994 - 2014 David A. Bagley, bagleyd@tux.org
XCOMM
XCOMM All Rights Reserved
XCOMM
......@@ -222,7 +222,7 @@ XCOMM READPATH = /usr/share/games/$(GROUP)
DEFINES = -DHAVE_FCNTL_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 \
$(XMDEF) $(XPMDEF) $(EDITRESDEF) $(SOUNDDEF) $(SLEEPDEF) $(RANDDEF) \
-DSOUNDPATH=\"$(READPATH)\" -DSOUNDEXT=\".au\" \
-DBUMPSOUND=\"bump\" -DMOVESOUND=\"move\" \
-DBUMPSOUND=\"bump\" -DMOVESOUND=\"move\" \ -DDRIPSOUND=\"drip\" \
$(XMINC) $(XPMINC) -DLEE_ABACUS
LOCAL_LIBRARIES = $(XMLIB) $(XTOOLLIB) $(XLIB) $(XPMLIB) $(EDITRESLIB) -lm
# -lICE -lSM
......@@ -230,7 +230,7 @@ LOCAL_LIBRARIES = $(XMLIB) $(XTOOLLIB) $(XLIB) $(XPMLIB) $(EDITRESLIB) -lm
HDRS = $(WIDGET)P.h $(WIDGET).h \
xwin.h file.h timer.h rngs.h \
sound.h version.h \
pixmaps/$(wIDGET).xbm pixmaps/$(wIDGET).xpm
pixmaps/*/$(wIDGET).xbm pixmaps/*/$(wIDGET).xpm
COREOBJS = $(WIDGET)$(O)$(S)$(WIDGET)D$(O)$(S)$(WIDGET)C$(O)$(S)\
$(WIDGET)M$(O)$(S)$(WIDGET)T$(O)
......
# @(#)Makefile.in
#
# Copyright 1997 - 2013 David A. Bagley, bagleyd@tux.org
# Copyright 1997 - 2014 David A. Bagley, bagleyd@tux.org
#
# All Rights Reserved
#
......@@ -94,7 +94,7 @@ ECHO = echo
# Assumes a directory of /usr/local/share/games/$(GROUP) if -DDEMOPATH not set.
DEFINES = \
-DSOUNDPATH=\"$(readdir)\" -DSOUNDEXT=\".au\" \
-DBUMPSOUND=\"bump\" -DMOVESOUND=\"move\" \
-DBUMPSOUND=\"bump\" -DMOVESOUND=\"move\" -DDRIPSOUND=\"drip\" \
-DDEMOPATH=\"$(readdir)\"
DEFS = @DEFS@ $(DEFINES)
# -DDEBUG
......@@ -139,7 +139,7 @@ A=
HDRS = $(WIDGET)P.h $(WIDGET).h \
xwin.h file.h timer.h rngs.h \
sound.h version.h \
pixmaps/$(wIDGET).xbm pixmaps/$(wIDGET).xpm
pixmaps/*/$(wIDGET).xbm pixmaps/*/$(wIDGET).xpm
COREOBJS = $(WIDGET)$(O)$(S)$(WIDGET)D$(O)$(S)$(WIDGET)C$(O)$(S)\
$(WIDGET)M$(O)$(S)$(WIDGET)T$(O)
......@@ -157,7 +157,7 @@ all : $(PROG) $(WIDGET).ad
constpixmaps :
@ $(ECHO) "USE with -DCONSTPIXMAPS"
for pix in pixmaps/*.xpm; do\
for pix in pixmaps/*/*.xpm; do\
base=`basename $$pix`;\
sed 's/static char/static const char/' $$pix > $$base;\
done
......@@ -197,6 +197,7 @@ install : $(PROG)$(E)
cd ..
$(INSTALL_DATA) bump.au $(DESTDIR)$(readdir)/bump.au
$(INSTALL_DATA) move.au $(DESTDIR)$(readdir)/move.au
$(INSTALL_DATA) drip.au $(DESTDIR)$(readdir)/drip.au
@ $(ECHO) "$@ COMPLETE"
@ $(ECHO) ""
@ $(ECHO) "To use $(R)$(M)$(wIDGET) from a menu, you may want to install the"
......@@ -213,6 +214,7 @@ uninstall :
done
$(RM) $(DESTDIR)$(readdir)/bump.au
$(RM) $(DESTDIR)$(readdir)/move.au
$(RM) $(DESTDIR)$(readdir)/drip.au
install-games : $(PROG)$(E)
$(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)
......@@ -236,14 +238,10 @@ uninstall-games :
# Gnome and KDE
install-png :
$(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/pixmaps/png/hicolor/16x16/apps
$(INSTALL_DATA) pixmaps/mini.$(wIDGET).png $(DESTDIR)$(datadir)/pixmaps/png/hicolor/16x16/apps/$(wIDGET).png
$(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/pixmaps/png/hicolor/22x22/apps
$(INSTALL_DATA) pixmaps/small.$(wIDGET).png $(DESTDIR)$(datadir)/pixmaps/png/hicolor/22x22/apps/$(wIDGET).png
$(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/pixmaps/png/hicolor/32x32/apps
$(INSTALL_DATA) pixmaps/normal.$(wIDGET).png $(DESTDIR)$(datadir)/pixmaps/png/hicolor/32x32/apps/$(wIDGET).png
$(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/pixmaps/png/hicolor/48x48/apps
$(INSTALL_DATA) pixmaps/big.$(wIDGET).png $(DESTDIR)$(datadir)/pixmaps/png/hicolor/48x48/apps/$(wIDGET).png
for i in 16x16 22x22 32x32 48x48; do\
$(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/pixmaps/png/hicolor/$$i/apps;\
$(INSTALL_DATA) pixmaps/$$i/$(wIDGET).png $(DESTDIR)$(datadir)/pixmaps/png/hicolor/$$i/apps/$(wIDGET).png;\
done
$(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/pixmaps/png/hicolor/all/apps
$(LN_S) $(DESTDIR)$(datadir)/pixmaps/png/hicolor/16x16/apps/$(wIDGET).png $(DESTDIR)$(datadir)/pixmaps/png/hicolor/all/apps/mini.$(wIDGET).png
$(LN_S) $(DESTDIR)$(datadir)/pixmaps/png/hicolor/22x22/apps/$(wIDGET).png $(DESTDIR)$(datadir)/pixmaps/png/hicolor/all/apps/small.$(wIDGET).png
......@@ -255,6 +253,9 @@ uninstall-png :
$(RM) $(DESTDIR)$(datadir)/pixmaps/png/hicolor/all/apps/small.$(wIDGET).png
$(RM) $(DESTDIR)$(datadir)/pixmaps/png/hicolor/all/apps/normal.$(wIDGET).png
$(RM) $(DESTDIR)$(datadir)/pixmaps/png/hicolor/all/apps/big.$(wIDGET).png
for i in 16x16 22x22 32x32 48x48; do\
$(RM) $(DESTDIR)$(datadir)/pixmaps/png/hicolor/$$i/apps/$(wIDGET).png;\
done
$(RM) $(DESTDIR)$(datadir)/pixmaps/png/hicolor/16x16/apps/$(wIDGET).png
$(RM) $(DESTDIR)$(datadir)/pixmaps/png/hicolor/22x22/apps/$(wIDGET).png
$(RM) $(DESTDIR)$(datadir)/pixmaps/png/hicolor/32x32/apps/$(wIDGET).png
......@@ -263,10 +264,10 @@ uninstall-png :
#CDE
install-xpm :
$(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/dt/pixmaps
$(INSTALL_DATA) pixmaps/$(wIDGET).t.xpm $(DESTDIR)$(datadir)/dt/pixmaps/$(wIDGET).t.pm
$(INSTALL_DATA) pixmaps/$(wIDGET).s.xpm $(DESTDIR)$(datadir)/dt/pixmaps/$(wIDGET).s.pm
$(INSTALL_DATA) pixmaps/$(wIDGET).m.xpm $(DESTDIR)$(datadir)/dt/pixmaps/$(wIDGET).m.pm
$(INSTALL_DATA) pixmaps/$(wIDGET).l.xpm $(DESTDIR)$(datadir)/dt/pixmaps/$(wIDGET).l.pm
$(INSTALL_DATA) pixmaps/16x16/$(wIDGET).xpm $(DESTDIR)$(datadir)/dt/pixmaps/$(wIDGET).t.pm
$(INSTALL_DATA) pixmaps/24x24/$(wIDGET).xpm $(DESTDIR)$(datadir)/dt/pixmaps/$(wIDGET).s.pm
$(INSTALL_DATA) pixmaps/32x32/$(wIDGET).xpm $(DESTDIR)$(datadir)/dt/pixmaps/$(wIDGET).m.pm
$(INSTALL_DATA) pixmaps/48x48/$(wIDGET).xpm $(DESTDIR)$(datadir)/dt/pixmaps/$(wIDGET).l.pm
uninstall-xpm :
$(RM) $(DESTDIR)$(datadir)/dt/pixmaps/$(wIDGET).t.pm
......@@ -277,10 +278,10 @@ uninstall-xpm :
#CDE HOME directory
install-xpm-home :
$(srcdir)/mkinstalldirs $(HOME)/.dt/pixmaps
$(INSTALL_DATA) pixmaps/$(wIDGET).t.xpm $(HOME)/.dt/pixmaps/$(wIDGET).t.pm
$(INSTALL_DATA) pixmaps/$(wIDGET).s.xpm $(HOME)/.dt/pixmaps/$(wIDGET).s.pm
$(INSTALL_DATA) pixmaps/$(wIDGET).m.xpm $(HOME)/.dt/pixmaps/$(wIDGET).m.pm
$(INSTALL_DATA) pixmaps/$(wIDGET).l.xpm $(HOME)/.dt/pixmaps/$(wIDGET).l.pm
$(INSTALL_DATA) pixmaps/16x16/$(wIDGET).xpm $(HOME)/.dt/pixmaps/$(wIDGET).t.pm
$(INSTALL_DATA) pixmaps/24x24/$(wIDGET).xpm $(HOME)/.dt/pixmaps/$(wIDGET).s.pm
$(INSTALL_DATA) pixmaps/32x32/$(wIDGET).xpm $(HOME)/.dt/pixmaps/$(wIDGET).m.pm
$(INSTALL_DATA) pixmaps/64x64/$(wIDGET).xpm $(HOME)/.dt/pixmaps/$(wIDGET).l.pm
uninstall-xpm-home :
$(RM) $(HOME)/.dt/pixmaps/$(wIDGET).t.pm
......@@ -373,7 +374,7 @@ dbx :
clean :
$(RM) *.o *.exe* core *~ *% *.bak make.log MakeOut Makefile.dep \
$(PROG) $(PROG).errs $(PROG).1.html $(PROG)._man $(wIDGET)*.xpm
$(PROG) $(PROG).errs $(PROG).1.html $(PROG)._man
cd win32 ; make -f Makefile clean
distclean : clean
......@@ -389,13 +390,8 @@ PACKAGE=$(VER)/$(WIDGET).h $(VER)/$(WIDGET)P.h \
$(VER)/xwin.h $(VER)/file.h $(VER)/timer.h $(VER)/rngs.h \
$(VER)/sound.h $(VER)/version.h \
$(VER)/pixmaps/mouse-l.xbm $(VER)/pixmaps/mouse-r.xbm \