Commit 47215bc6 authored by Florian Ernst's avatar Florian Ernst

Imported Upstream version 7.5.5

parent 94c6f67c
David A. Bagley <bagleyd@tux.org>
Thanks to :
Luis Fernandes <elf AT ee.ryerson.ca> - independent xabacus 1.00, initial demo
Sarat Chandran <saratcmahadevan AT yahoo.com> - colaboration on a few ideas
!!!!
! Abacus: Class resource for xabacus
!!!!
Abacus*pixmapSize: 16
!Abacus*pixmapSize: 22
!Abacus*pixmapSize: 24
!Abacus*pixmapSize: 32
!Abacus*pixmapSize: 48
!Abacus*pixmapSize: 64
Abacus*mono: false
Abacus*reverse: false
Abacus*reverseVideo: false
Abacus*foreground: black
Abacus*background: #AEB2C3
Abacus*frameColor: cyan
Abacus*railColor: gold
Abacus*beadColor: DarkRed
Abacus*beadBorder: gray25
Abacus*delay: 50
Abacus*sound: false
Abacus*borderColor: gray25
Abacus*frameColor: wheat4
Abacus*primaryBeadColor: DarkRed
Abacus*leftAuxBeadColor: LimeGreen
Abacus*rightAuxBeadColor: gainsboro
Abacus*secondaryBeadColor: burlywood4
Abacus*highlightBeadColor: magenta
Abacus*primaryRailColor: gold
Abacus*secondaryRailColor: LightSteelBlue1
Abacus*highlightRailColor: Purple
Abacus*bumpSound: @READPATH@/bump.au
!Abacus*bumpSound: @READPATH@/bumpdat.au
Abacus*moveSound: @READPATH@/move.au
!Abacus*bumpSound: ./bump.au
!Abacus*bumpSound: ./bumpdat.au
!Abacus*moveSound: ./move.au
!Abacus*bumpSound: /usr/local/share/games/xabacus/bump.au
!Abacus*bumpSound: /usr/local/share/games/xabacus/bumpdat.au
!Abacus*moveSound: /usr/local/share/games/xabacus/move.au
!Abacus*bumpSound: /usr/share/games/xabacus/bump.au
!Abacus*bumpSound: /usr/share/games/xabacus/bumpdat.au
!Abacus*moveSound: /usr/share/games/xabacus/move.au
Abacus*sound: false
Abacus*delay: 50
Abacus*script: false
Abacus*demo: false
Abacus*demoFont: 9x15bold
......@@ -34,11 +42,33 @@ Abacus*demoPath: @READPATH@
!Abacus*demoPath: .
!Abacus*demoPath: /usr/local/share/games/xabacus
!Abacus*demoPath: /usr/share/games/xabacus
!
Abacus*teach: false
Abacus*rightToLeftAdd: false
Abacus*rightToLeftMult: false
! 3 known examples of Lee Abacus
Abacus*lee: true
Abacus*rails: 13
!Abacus*format: Chinese
Abacus*leftAuxRails: 9
Abacus*rightAuxRails: 9
Abacusko*format: Korean
Abacusko*leftAuxRails: 7
Abacusko*rightAuxRails: 11
Abacuscn*format: Chinese
Abacuscn*leftAuxRails: 7
Abacuscn*rightAuxRails: 13
! Chinese Saun-pan (Suan Pan)
Abacus*vertical: false
! colorScheme 1 color middle (1 or 2)
! 2 color first of group
! 3 both 1 & 2
! 4 color first half (odd color middle)
Abacus*colorScheme: 0
Abacus*slot: false
Abacus*diamond: false
Abacus*railIndex: 0
Abacus*topOrient: true
Abacus*bottomOrient: false
Abacus*topFactor: 5
......@@ -52,26 +82,36 @@ Abacus*bottomPiece: 0
Abacus*topPiecePercent: 0
Abacus*bottomPiecePercent: 0
Abacus*shiftPercent: 2
Abacus*subdeck: 0
Abacus*subbead: 4
Abacus*sign: false
Abacus*decimalPosition: 2
Abacus*groupSize: 3
Abacus*rails: 13
Abacus*group: false
Abacus*decimalComma: false
Abacus*base: 10
Abacus*subbase: 12
Abacus*anomaly: 0
Abacus*shiftAnomaly: 2
Abacus*anomalySq: 0
Abacus*shiftAnomalySq: 2
Abacus*displayBase: 10
Abacus*pressOffset: false
Abacus*romanNumerals: false
! format of Other allows you to fine tune options (or else may be clobbered)
!Abacus*format: Chinese
Abacus*latin: false
Abacus*ancientRoman: false
Abacus*modernRoman: false
! format of Generic allows you to fine tune options (or else may be clobbered)
Abacus*format: Chinese
!Abacus*format: Japanese
!Abacus*format: Korean
!Abacus*format: Roman
!Abacus*format: Russian
Abacus*format: Other
!Abacus*format: Danish
!Abacus*format: Generic
Abacus*museum: --
!
! override the above with these to have different abacii
! override the above with these to have different abaci
! Chinese Saun-pan (Suan Pan)
Abacuscn*format: Chinese
! Japanese post-WWII Soroban
......@@ -96,16 +136,23 @@ Abacusro*topSpaces: 1
Abacusro*bottomSpaces: 1
Abacusro*topPiece: 2
Abacusro*bottomPiece: 6
Abacusro*rails: 9
Abacusro*subdeck: 3
Abacusro*rails: 10
Abacusro*romanNumerals: true
Abacusro*ancientRoman: false
Abacusro*modernRoman: false
Abacusro*latin: false
Abacusro*slot: true
!Abacusro*subbase: 8
Abacusro*format: Roman
Abacusro*romanNumerals: true
! Way of easily figuring out seconds, given hours, minutes, seconds
!Abacusro*anomaly: 4
!Abacusro*shiftAnomaly: 2
!Abacusro*anomalySq: 4
!Abacusro*shiftAnomalySq: 2
!Abacusro*museum: it
!Abacusro*museum: uk
!Abacusro*museum: fr
Abacusro*museum: --
! Russian Schoty
Abacusru*vertical: true
Abacusru*colorScheme: 3
Abacusru*railIndex: 1
Abacusru*bottomFactor: 1
Abacusru*bottomOrient: true
Abacusru*topNumber: 0
......@@ -116,24 +163,67 @@ Abacusru*bottomPiecePercent: 4
Abacusru*shiftPercent: 2
Abacusru*rails: 11
Abacusru*format: Russian
Abacusru*vertical: true
! Chinese base 16 Saun-pan
Abacus16*topFactor: 8
Abacus16*topNumber: 2
Abacus16*bottomNumber: 8
Abacus16*rails: 15
Abacus16*base: 16
Abacus16*displayBase: 16
! Japanese base 20 Soroban or Mesoamerican Nepohualtzintzin
! Georgian Schoty (not to be taken seriously)
Abacusge*vertical: true
Abacusge*colorScheme: 3
Abacusge*railIndex: 1
Abacusge*bottomFactor: 1
Abacusge*bottomOrient: true
Abacusge*topNumber: 0
Abacusge*bottomNumber: 10
Abacusge*topSpaces: 0
Abacusge*bottomPiece: 4
Abacusge*bottomPiecePercent: 4
Abacusge*shiftPercent: 2
Abacusge*base: 20
Abacusge*rails: 11
Abacusge*format: Russian
! Danish School Abacus
Abacusdk*vertical: true
Abacusdk*colorScheme: 4
Abacusdk*railIndex: 1
Abacusdk*bottomFactor: 1
Abacusdk*bottomOrient: false
Abacusdk*topNumber: 0
Abacusdk*bottomNumber: 10
Abacusdk*topSpaces: 0
Abacusdk*decimalPosition: 0
Abacusdk*rails: 10
Abacusdk*group: true
Abacusdk*decimalComma: true
Abacusdk*format: Danish
! Mesoamerican Nepohualtzintzin (similar to Japanese Soroban base 20)
Abacusma*diamond: 1
Abacusma*topNumber: 3
Abacusma*bottomNumber: 4
Abacusma*topSpaces: 1
Abacusma*bottomSpaces: 1
Abacusma*base: 20
Abacusma*displayBase: 20
Abacusma*anomaly: 2
Abacusma*shiftAnomaly: 2
Abacusma*format: Generic
! Babylonian Watch (proposed by author)
Abacusba*topNumber: 1
Abacusba*bottomNumber: 4
Abacusba*topSpaces: 1
Abacusba*bottomSpaces: 1
Abacusba*anomaly: 4
Abacusba*shiftAnomaly: 2
Abacusba*anomalySq: 4
Abacusba*shiftAnomalySq: 2
Abacusba*format: Generic
! Chinese solid-and-broken-bar system
Abacuscn12*topFactor: 3
Abacuscn12*topNumber: 3
Abacuscn12*bottomNumber: 2
Abacuscn12*base: 12
Abacuscn12*displayBase: 12
Abacuscn12*format: Generic
! Japanese base 16 Saun-pan
Abacus16*topFactor: 3
Abacus16*topNumber: 3
Abacus16*bottomNumber: 3
Abacus16*rails: 15
Abacus16*base: 16
Abacus16*displayBase: 10
Abacus16*format: Japanese
This source diff could not be displayed because it is too large. You can view the blob instead.
/*-
# X-BASED ABACUS
#
# Abacus.h
#
###
#
# Copyright (c) 1994 - 2005 David Albert Bagley, bagleyd@tux.org
#
# Abacus demo and neat pointers from
# Copyright (c) 1991 - 1998 Luis Fernandes, elf@ee.ryerson.ca
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and
# that both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of the author not be
# used in advertising or publicity pertaining to distribution of the
# software without specific, written prior permission.
#
# This program is distributed in the hope that it will be "useful",
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
*/
/*
* @(#)Abacus.h
*
* Copyright 1994 - 2009 David A. Bagley, bagleyd@tux.org
*
* Abacus demo and neat pointers from
* Copyright 1991 - 1998 Luis Fernandes, elf@ee.ryerson.ca
*
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear in
* supporting documentation, and that the name of the author not be
* used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
*
* This program is distributed in the hope that it will be "useful",
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/* Public header file for Abacus */
......@@ -42,27 +37,40 @@
#endif
#ifndef WINVER
#define XtNselectCallback ((char *) "selectCallback")
#define XtNmono ((char *) "mono")
#define XtNreverse ((char *) "reverse")
#define XtNframeColor ((char *) "frameColor")
#define XtNrailColor ((char *) "railColor")
#define XtNbeadColor ((char *) "beadColor")
#define XtNbeadBorder ((char *) "beadBorder")
#define XtNdelay ((char *) "delay")
#define XtNsound ((char *) "sound")
#define XtNprimaryBeadColor ((char *) "primaryBeadColor")
#define XtNleftAuxBeadColor ((char *) "leftAuxBeadColor")
#define XtNrightAuxBeadColor ((char *) "rightAuxBeadColor")
#define XtNsecondaryBeadColor ((char *) "secondaryBeadColor")
#define XtNhighlightBeadColor ((char *) "highlightBeadColor")
#define XtNprimaryRailColor ((char *) "primaryRailColor")
#define XtNsecondaryRailColor ((char *) "secondaryRailColor")
#define XtNhighlightRailColor ((char *) "highlightRailColor")
#define XtNbumpSound ((char *) "bumpSound")
#define XtNmoveSound ((char *) "moveSound")
#define XtNbuffer ((char *) "buffer")
#define XtNsound ((char *) "sound")
#define XtNdelay ((char *) "delay")
#define XtNscript ((char *) "script")
#define XtNbuffer ((char *) "buffer")
#define XtNdemo ((char *) "demo")
#define XtNdemoPath ((char *) "demoPath")
#define XtNdemoFont ((char *) "demoFont")
#define XtNdemoForeground ((char *) "demoForeground")
#define XtNdemoBackground ((char *) "demoBackground")
#define XtNteach ((char *) "teach")
#define XtNteachBuffer ((char *) "teachBuffer")
#define XtNrightToLeftAdd ((char *) "rightToLeftAdd")
#define XtNrightToLeftMult ((char *) "rightToLeftMult")
#define XtNlee ((char *) "lee")
#define XtNrails ((char *) "rails")
#define XtNleftAuxRails ((char *) "leftAuxRails")
#define XtNrightAuxRails ((char *) "rightAuxRails")
#define XtNvertical ((char *) "vertical")
#define XtNcolorScheme ((char *) "colorScheme")
#define XtNslot ((char *) "slot")
#define XtNdiamond ((char *) "diamond")
#define XtNrailIndex ((char *) "railIndex")
#define XtNtopOrient ((char *) "topOrient")
#define XtNbottomOrient ((char *) "bottomOrient")
#define XtNtopNumber ((char *) "topNumber")
......@@ -76,19 +84,30 @@
#define XtNtopPiecePercent ((char *) "topPiecePercent")
#define XtNbottomPiecePercent ((char *) "bottomPiecePercent")
#define XtNshiftPercent ((char *) "shiftPercent")
#define XtNsubdeck ((char *) "subdeck")
#define XtNsubbead ((char *) "subbead")
#define XtNsign ((char *) "sign")
#define XtNdecimalPosition ((char *) "decimalPosition")
#define XtNgroup ((char *) "group")
#define XtNgroupSize ((char *) "groupSize")
#define XtNrails ((char *) "rails")
#define XtNdecimalComma ((char *) "decimalComma")
#define XtNbase ((char *) "base")
#define XtNsubbase ((char *) "subbase")
#define XtNanomaly ((char *) "anomaly")
#define XtNshiftAnomaly ((char *) "shiftAnomaly")
#define XtNanomalySq ((char *) "anomalySq")
#define XtNshiftAnomalySq ((char *) "shiftAnomalySq")
#define XtNdisplayBase ((char *) "displayBase")
#define XtNpressOffset ((char *) "pressOffset")
#define XtNromanNumerals ((char *) "romanNumerals")
#define XtNlatin ((char *) "latin")
#define XtNancientRoman ((char *) "ancientRoman")
#define XtNmodernRoman ((char *) "modernRoman")
#define XtNmode ((char *) "mode")
#define XtNformat ((char *) "format")
#define XtNsubmode ((char *) "submode")
#define XtNmuseum ((char *) "museum")
#define XtNversionOnly ((char *) "versionOnly")
#define XtNmenu ((char *) "menu")
#define XtNdeck ((char *) "deck")
#define XtNrail ((char *) "rail")
......@@ -96,27 +115,44 @@
#define XtNframed ((char *) "framed")
#define XtNaux ((char *) "aux")
#define XtNmathBuffer ((char *) "mathBuffer")
#define XtNversionOnly ((char *) "versionOnly")
#define XtNpixmapSize ((char *) "pixmapSize")
#define XtNselectCallback ((char *) "selectCallback")
#define XtNleftAuxAbacus ((char *) "leftAuxAbacus")
#define XtNrightAuxAbacus ((char *) "rightAuxAbacus")
#define XtCMono ((char *) "Mono")
#define XtCReverse ((char *) "Reverse")
#define XtCFrameColor ((char *) "FrameColor")
#define XtCRailColor ((char *) "RailColor")
#define XtCBeadColor ((char *) "BeadColor")
#define XtCBeadBorder ((char *) "BeadBorder")
#define XtCDelay ((char *) "Delay")
#define XtCSound ((char *) "Sound")
#define XtCPrimaryBeadColor ((char *) "PrimaryBeadColor")
#define XtCLeftAuxBeadColor ((char *) "LeftAuxBeadColor")
#define XtCRightAuxBeadColor ((char *) "RightAuxBeadColor")
#define XtCSecondaryBeadColor ((char *) "SecondaryBeadColor")
#define XtCHighlightBeadColor ((char *) "HighlightBeadColor")
#define XtCPrimaryRailColor ((char *) "PrimaryRailColor")
#define XtCSecondaryRailColor ((char *) "SecondaryRailColor")
#define XtCHighlightRailColor ((char *) "HighlightRailColor")
#define XtCBumpSound ((char *) "BumpSound")
#define XtCMoveSound ((char *) "MoveSound")
#define XtCBuffer ((char *) "Buffer")
#define XtCSound ((char *) "Sound")
#define XtCDelay ((char *) "Delay")
#define XtCScript ((char *) "Script")
#define XtCBuffer ((char *) "Buffer")
#define XtCDemo ((char *) "Demo")
#define XtCDemoPath ((char *) "DemoPath")
#define XtCDemoFont ((char *) "DemoFont")
#define XtCDemoForeground ((char *) "DemoForeground")
#define XtCDemoBackground ((char *) "DemoBackground")
#define XtCTeach ((char *) "Teach")
#define XtCTeachBuffer ((char *) "TeachBuffer")
#define XtCRightToLeftAdd ((char *) "RightToLeftAdd")
#define XtCRightToLeftMult ((char *) "RightToLeftMult")
#define XtCLee ((char *) "Lee")
#define XtCRails ((char *) "Rails")
#define XtCLeftAuxRails ((char *) "LeftAuxRails")
#define XtCRightAuxRails ((char *) "RightAuxRails")
#define XtCVertical ((char *) "Vertical")
#define XtCColorScheme ((char *) "ColorScheme")
#define XtCSlot ((char *) "Slot")
#define XtCDiamond ((char *) "Diamond")
#define XtCRailIndex ((char *) "RailIndex")
#define XtCTopOrient ((char *) "TopOrient")
#define XtCBottomOrient ((char *) "BottomOrient")
#define XtCTopNumber ((char *) "TopNumber")
......@@ -130,19 +166,29 @@
#define XtCTopPiecePercent ((char *) "TopPiecePercent")
#define XtCBottomPiecePercent ((char *) "BottomPiecePercent")
#define XtCShiftPercent ((char *) "ShiftPercent")
#define XtCSubdeck ((char *) "Subdeck")
#define XtCSubbead ((char *) "Subbead")
#define XtCSign ((char *) "Sign")
#define XtCDecimalPosition ((char *) "DecimalPosition")
#define XtCGroup ((char *) "Group")
#define XtCGroupSize ((char *) "GroupSize")
#define XtCRails ((char *) "Rails")
#define XtCDecimalComma ((char *) "DecimalComma")
#define XtCBase ((char *) "Base")
#define XtCSubbase ((char *) "Subbase")
#define XtCAnomaly ((char *) "Anomaly")
#define XtCShiftAnomaly ((char *) "ShiftAnomaly")
#define XtCAnomalySq ((char *) "AnomalySq")
#define XtCShiftAnomalySq ((char *) "ShiftAnomalySq")
#define XtCDisplayBase ((char *) "DisplayBase")
#define XtCPressOffset ((char *) "PressOffset")
#define XtCRomanNumerals ((char *) "RomanNumerals")
#define XtCLatin ((char *) "Latin")
#define XtCAncientRoman ((char *) "AncientRoman")
#define XtCModernRoman ((char *) "ModernRoman")
#define XtCMode ((char *) "Mode")
#define XtCFormat ((char *) "Format")
#define XtCSubmode ((char *) "Submode")
#define XtCMuseum ((char *) "Museum")
#define XtCMenu ((char *) "Menu")
#define XtCDeck ((char *) "Deck")
#define XtCRail ((char *) "Rail")
......@@ -150,6 +196,9 @@
#define XtCFramed ((char *) "Framed")
#define XtCAux ((char *) "Aux")
#define XtCMathBuffer ((char *) "MathBuffer")
#define XtCPixmapSize ((char *) "PixmapSize")
#define XtCLeftAuxAbacus ((char *) "LeftAuxAbacus")
#define XtCRightAuxAbacus ((char *) "RightAuxAbacus")
typedef struct _AbacusClassRec *AbacusWidgetClass;
typedef struct _AbacusDemoClassRec *AbacusDemoWidgetClass;
......@@ -160,69 +209,128 @@ typedef struct {
XEvent *event;
int reason;
char *buffer, *mathBuffer;
char *teachBuffer;
int aux, deck, rail, number;
int line;
} abacusCallbackStruct;
#endif
#define ABACUS_BASE_DEFAULT (-12)
#define ABACUS_DEMO_DEFAULT (-11)
#define ABACUS_HIDE (-10)
#define ABACUS_CLEAR_QUERY (-9)
#define ABACUS_CALC (-8)
#define ABACUS_MORE (-7)
#define ABACUS_REPEAT (-6)
#define ABACUS_NEXT (-5)
#define ABACUS_DEMO (-4)
#define ABACUS_CLEAR (-3)
#define ABACUS_SCRIPT (-2)
#define ABACUS_IGNORE (-1)
#define ABACUS_MOVE 0
#define ABACUS_DEC 1
#define ABACUS_INC 2
#define ABACUS_VERTICAL 3
#define ABACUS_ROMANNUMERAL 4
#define ABACUS_SIGN 5
#define ABACUS_QUARTER 6
#define ABACUS_QUARTERPERCENT 7
#define ABACUS_TWELFTH 8
#define ABACUS_ANOMALY 9
#define ABACUS_WATCH 10
#define ABACUS_FORMAT 11
#define ACTION_EXIT 100
#define ACTION_HIDE 101
#define ACTION_BASE_DEFAULT 102
#define ACTION_DEMO_DEFAULT 103
#define ACTION_CLEAR_QUERY 104
#define ACTION_CALC 105
#define ACTION_SCRIPT 106
#define ACTION_MOVE 107
#define ACTION_CLEAR 200
#define ACTION_COMPLEMENT 201
#define ACTION_INCREMENT 202
#define ACTION_DECREMENT 203
#define ACTION_FORMAT 204
#define ACTION_MUSEUM 205
#define ACTION_ROMAN_NUMERAL 206
#define ACTION_GROUP 207
#define ACTION_SIGN 208
#define ACTION_QUARTER 209
#define ACTION_QUARTER_PERCENT 210
#define ACTION_TWELFTH 211
#define ACTION_SUBDECK 212
#define ACTION_EIGHTH 213
#define ACTION_ANOMALY 214
#define ACTION_WATCH 215
#define ACTION_RIGHT_TO_LEFT_ADD 216
#define ACTION_RIGHT_TO_LEFT_MULT 217
#define ACTION_SPEED 218
#define ACTION_SLOW 219
#define ACTION_SOUND 220
#define ACTION_TEACH 221
#define ACTION_CLEAR_NODEMO 222
#define ACTION_VERTICAL 223
#define ACTION_TEACH_LINE 224
#define ACTION_DEMO 300
#define ACTION_NEXT 301
#define ACTION_REPEAT 302
#define ACTION_JUMP 303
#define ACTION_MORE 304
#define ACTION_CHAPTER1 311
#define ACTION_CHAPTER2 312
#define ACTION_CHAPTER3 313
#define ACTION_CHAPTER4 314
#define ACTION_CHAPTER5 315
#define ACTION_CHAPTER6 316
#define ACTION_CHAPTER7 317
#define ACTION_CHAPTER8 318
#define ACTION_DEMO1 331
#define ACTION_DEMO2 332
#define ACTION_DEMO3 333
#define ACTION_DEMO4 334
#define ACTION_TEACH1 351
#define ACTION_TEACH2 352
#define ACTION_TEACH3 353
#define ACTION_DESCRIPTION 900
#define ACTION_FEATURES 901
#define ACTION_REFERENCES 902
#define ACTION_ABOUT 903
#define ACTION_IGNORE 999
#define TEACH_DECK (-9)
#define CALC_DECK (-8)
#define MORE_DECK (-7)
#define JUMP_DECK (-6)
#define REPEAT_DECK (-5)
#define NEXT_DECK (-4)
#define CLEAR_DECK (-3)
#define IGNORE_DECK (-1)
#define MIN_RAILS 1
#define MIN_DEMO_RAILS 3
#define DEFAULT_RAILS 13
#define DEFAULT_TOP_SPACES 2
#define DEFAULT_BOTTOM_SPACES 2
#define DEFAULT_TOP_NUMBER 2
#define DEFAULT_BOTTOM_NUMBER 5
#define DEFAULT_TOP_FACTOR 5
#define DEFAULT_BOTTOM_FACTOR 1
#define DEFAULT_TOP_ORIENT TRUE
#define DEFAULT_BOTTOM_ORIENT FALSE
#define MIN_BASE 2 /* Base 1 is rediculous :) */
#define MAX_BASE 36 /* 10 numbers + 26 letters (ASCII) */
#define DEFAULT_BASE 10
#define DEFAULT_SUBDECKS 3
#define DEFAULT_SUBBEADS 4
#define DEFAULT_SHIFT_PERCENT 2
#define DEFAULT_SHIFT_ANOMALY 2
#define DEFAULT_GROUP_SIZE 3
#define SUBDECK_SPACE 1
#define MAX_MUSEUMS 3
#define IT 0
#define UK 1
#define FR 2
#define COLOR_MIDDLE 1
#define COLOR_FIRST 2
#define COLOR_HALF 4
#define PRIMARY 0
#define LEFTAUX 1
#define RIGHTAUX 2
#define MINRAILS 1
#define MINDEMORAILS 3
#define DEFAULTRAILS 13
#define DEFAULTTOPSPACES 2
#define DEFAULTBOTTOMSPACES 2
#define DEFAULTTOPNUMBER 2
#define DEFAULTBOTTOMNUMBER 5
#define DEFAULTTOPFACTOR 5
#define DEFAULTBOTTOMFACTOR 1
#define DEFAULTTOPORIENT TRUE
#define DEFAULTBOTTOMORIENT FALSE
#define LEFT_AUX 1
#define RIGHT_AUX 2
#ifdef MONOTEST
#define DEFAULTMONO TRUE
#define DEFAULT_MONO TRUE
#else
#define DEFAULTMONO FALSE
#define DEFAULT_MONO FALSE
#endif
#define DEFAULTREVERSE FALSE
#define DEFAULT_REVERSE FALSE
#define CHINESE 0
#define JAPANESE 1
#define KOREAN 2
#define ROMAN 3
#define RUSSIAN 4
#define OTHER 5
#define MAXFORMATS 5
#define MAXMODES 6
#define MINBASE 2 /* Base 1 is rediculous :) */
#define MAXBASE 36 /* 10 numbers + 26 letters (ASCII) */
#define DEFAULTBASE 10
#define DANISH 5
#define GENERIC 6
#define MAX_FORMATS 6
#define MAX_MODES 7
#define QUARTERS 4
#define QUARTERPERCENTS 4
#define TWELFTH 12
#define QUARTER_PERCENTS 4
#define TWELFTHS 12
#define EIGHTHS 8
typedef struct _AbacusRec *AbacusWidget;
typedef struct _AbacusRec *AbacusDemoWidget;
......
/*-
# X-BASED ABACUS
#
# AbacusC.c
#
###
#
# Copyright (c) 1992 - 2005 David Albert Bagley, bagleyd@tux.org
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and
# that both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of the author not be
# used in advertising or publicity pertaining to distribution of the
# software without specific, written prior permission.
#
# This program is distributed in the hope that it will be "useful",
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Taken from a C++ group project where I was a lead contributer
# OOP Group4!
*/
/*
* @(#)AbacusC.c
*
* Copyright 1992 - 2009 David A. Bagley, bagleyd@tux.org
*
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear in
* supporting documentation, and that the name of the author not be
* used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
*
* This program is distributed in the hope that it will be "useful",
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Taken from a C++ group project where I was a lead contributer
* OOP Group4!
*/
/* Methods string infix calculator file for Abacus */
#include "AbacusP.h"
#ifndef WINVER
#include <math.h>
......@@ -52,11 +47,11 @@ $ summation
% mod e.g. 7%2=1 [medium]
& bitwise and [medium]
'
( (
( ( [equate]
) ) [equate]
* multipication [medium]
+ addition [low]
, real imaginary delimitor [numeric]
, [numeric]
- subtraction (not sign change) [low]
. decimal point (or octal pt if in octal, etc.) [numeric]
/ divide e.g. 1/2=0.5 [medium]
......@@ -83,42 +78,42 @@ C hexadecimal 12 [numeric]
D hexadecimal 13 [numeric]
E hexadecimal 14 [numeric]
F hexadecimal 15 [numeric]
G variance (sigma^2)
H hyperbolic
I inverse
J
G 16 [numeric]
H 17 [numeric]
I 18 [numeric]
J 19 [numeric]
K
L logarithm base 2
M memory recall ('M', ('0'-'9' | 'A'-'F'))
N natural logarithm
O bitwise xor [high]
O bitwise xor [high]
P permutation [low]
Q quit [quit]
R "to the root of" e.g. 8R3=2 [high]
S sample variance (s^2)
T square summation
U x^3
T square summation
U x^3
V x^2
W convert from MinSec
W convert from MinSec
X e^x (unfortunately 'e' & 'E' are used already)
Y
Z
Y hyperbolic
Z inverse
[
\ Pascal's div i.e 28\8=3 [medium]
]