Installation
============

0. Installation for the impatients
----------------------------------
- unpack the tar file in e.g. /usr/lib/X11
- cd patience-1.7
- edit the Makefile, check lines 15, 16 and 24
- edit app-default, uncomment line 14
- make install

1. Installation of the executable Tcl program
---------------------------------------------

The choice where the executable program and the associated library
directory will be located, is a matter of taste. For me there are a
few candidates, which are listed in the table below.

 Executable Programm     	 Library directory
 -------------------		 -----------------
 /usr/games/patience        	 /usr/games/lib/patience-1.7
 /usr/bin/X11/patience      	 /usr/lib/X11/patience-1.7
 /usr/local/bin/patience    	 /usr/local/lib/patience-1.7
 /home/krischan/bin/patience	 /home/krischan/patience-1.7

Who ever installs the solitaire, must have write access to both of the
choosen directories. Then the solitaire can be installed by the
following few steps, replacing <binDir> and <libDir> with the
choosen directories.

- Making the directory superior to the choosen library directory
  the current one, e.g. by 'cd /usr/local/lib'
- Download the installations disk by 'tar xvzf /dev/fd0'. That is at least
  the way, it works out at my system. Maybe you must give another name
  like '/dev/floppy' or '/dev/rfd0H1440ds'. If the installation file is
  already on disk or on a mounted cd, you can unpack it with e.g
  'tar xvzf /tmp/patience-1.7.tgz'. Who owns a tar without the handy
  z option for uncompress, must use something like the following:
    gzip -cd /cdrom/longPathName/patience-1.7.tgz | tar xvf -
- Change into the newly created directory: 'cd patience-1.7'
- Using the editor of choise change the 'Makefile'; around
  line 15 set the following variables according to the local machine
  and/or to the personal taste.
  = WISH: This variable contains the complete path of the 
          Tcl/Tk interpreter. You can find it out (in Bourne-, Korn- or
          compliant shells) by means of calling 'type wish'. At my
          system the line goes like 'WISH = /usr/bin/wish'. 
  = LIB_DIR: This is the choosen <libDir>; at my system currently the line
             goes like 'LIB_DIR = /usr/lib/X11/patience-1.7'.
  = BIN_DIR: This is the choosen <binDir>, at my system currently the line
             goes like 'BIN_DIR = /usr/lib/X11/patience-1.7'.
  = CFLAGS: For compiling the extended patience interpreter 'patsh' there
            may be additional include directories, which contain the
            Tcl includefiles.
- Now call 'make patience'; after five to ten seconds everything should be
  ready to take off.
- Default language is german, but you can switch to english in the resource
  file 'app-default'. For this edit the file in the current directory and
  uncomment the line by removing the leading exclamation mark, so that it
  read as the following:
    *patience.sprache: english
- A test game can be started right now by calling './patience'. For playing
  it from every directory without typing the complete path, enter
  'make install'.

2. The extended interpreter
---------------------------

Who likes, can compile a c program 'patsh.c'; this happens by
means of the 'Makefile' and a call of 'make patc'. After
that you install the created program by 'make installc'.

Making 'patc' creates a patience interpreter 'patsh', too; it acts like
the ordinary Tk interpreter 'wish', but is special in two ways:
- The merging of the cards and some central functions for checking the
  rules are implemented in C und therefor they are a little bit faster.
- The ringing of the bell for finding no more hints can be heard, even
  if the program isn't started with a standard out channel attached (this
  happens e.g, if the game is called via a root menu of the window manager).

3. Calling with different names
-------------------------------

If the program has the intern name of a known set of rules
(e.g. canfield), the game will start according to this rules.
Who likes, can play immediate a Canfield or Little Harp solitaire
after execution of the following commands.
  ln -s patience canfield
  ln -s patience klHarfe
This works also with the intern names of other, possible self made
sets of rules.

The name of the wanted set of rules can be given as parameter,
too. The battle solitaire e.g. can be started directly by calling
  patience -name streit

This way it is possible to create a submenu for the window manager,
which starts the game with any set of rules.
In the initialization file ~/.fvwmrc  of the fvwm window mananger
it goes like:

Popup "Patience 1.7"
  Exec "Standard"  exec patience &
  Exec "Kl. Harfe" exec patience -name klHarfe  &
  Exec "Canfield"  exec patience -name canfield &
  Exec "Spinne"    exec patience -name spider   &
  Exec "Streit"    exec patience -name streit   &
EndPopup

4. X-Resourcen
--------------

The program uses a few X resource variables, which can configure the
user interface. The table below is a listing of names, their
default values and their significance.

Resource      Default	  Meaning
background    bisque	  Background color of the playing ground
rot           IndianRed4  Foreground color of Diamonds and Hearts
weiss         gray95	  White background color of cards
grau          gray80	  gray background color of stacks
warteZeit     10	  Default of Games/Wait <n> sec
mitMischComic True	  Default of With comics/Shuffle 
mitBewegComic True	  Default of With comics/Movements
kartenFont    normal	  Default of the card bitmaps
sprache       deutsch	  the language (deutsch or english)

The resources will be looked up at the following places with
increasing priority:
- the defaults given by the program itself, as in the table above;
- the systemwide installed resource file <libDir>/app-default);
- the resource file ~/.Xdefaults configured by the player;
- all resources set by 'xrdb -merge'

In a resourced file every assignment of a value to the resource goes
like this:
  *patience.<resourcename>: <value>
E.g., the Black/White-Font as default for the card bitmaps can be set by
  *patience.kartenFont: sw

5. Known errors
---------------

- When posting a menu with the middle mouse button permanently and
  calling a command from this menu, all mouse events in the playing
  field and in other dialogs are deactivated. (Error in Tk?)
- The tip of the arrow has an incorrect y coordinate for
  compressed piles.
- Battle solitaire: The computer cheats! Sometimes he took cards from the
  reserve pile, although they cannot be moved from there according to the
  rules.

6. Future Improvements
----------------------
- The arrow ignores all events.
- Cards should be moved before the display of the filling of the
  hand, not behind.
- All invisible cards (on the stack, reserve or penalty pile)
  should be deleted from the playing field to speed up the comics for
  dealing or movement of cards.

