Substantial infrastructure upheaval. I've separated the drawing API

as seen by the back ends from the one implemented by the front end,
and shoved a piece of middleware (drawing.c) in between to permit
interchange of multiple kinds of the latter. I've also added a
number of functions to the drawing API to permit printing as well as
on-screen drawing, and retired print.py in favour of integrated
printing done by means of that API.

The immediate visible change is that print.py is dead, and each
puzzle now does its own printing: where you would previously have
typed `print.py solo 2x3', you now type `solo --print 2x3' and it
should work in much the same way.

Advantages of the new mechanism available right now:
 - Map is now printable, because the new print function can make use
   of the output from the existing game ID decoder rather than me
   having to replicate all those fiddly algorithms in Python.
 - the new print functions can cope with non-initial game states,
   which means each puzzle supporting --print also supports
   --with-solutions.
 - there's also a --scale option permitting users to adjust the size
   of the printed puzzles.

Advantages which will be available at some point:
 - the new API should permit me to implement native printing
   mechanisms on Windows and OS X.

[originally from svn r6190]
This commit is contained in:
Simon Tatham
2005-08-18 17:50:14 +00:00
parent ca6950b0f7
commit af59dcf685
34 changed files with 3759 additions and 1663 deletions

46
Recipe
View File

@ -14,7 +14,7 @@
!makefile osx Makefile.osx
WINDOWS = windows user32.lib gdi32.lib comctl32.lib comdlg32.lib
COMMON = midend misc malloc random version
COMMON = midend drawing misc malloc random version
NET = net tree234 dsf
NETSLIDE = netslide tree234
MINES = mines tree234
@ -28,26 +28,28 @@ ALL = list NET NETSLIDE cube fifteen sixteen rect pattern solo twiddle
+ MINES samegame FLIP guess PEGS dominosa UNTANGLE blackbox SLANT
+ lightup MAP
net : [X] gtk COMMON NET
netslide : [X] gtk COMMON NETSLIDE
cube : [X] gtk COMMON cube
fifteen : [X] gtk COMMON fifteen
sixteen : [X] gtk COMMON sixteen
rect : [X] gtk COMMON rect
pattern : [X] gtk COMMON pattern
solo : [X] gtk COMMON solo
twiddle : [X] gtk COMMON twiddle
mines : [X] gtk COMMON MINES
samegame : [X] gtk COMMON samegame
flip : [X] gtk COMMON FLIP
guess : [X] gtk COMMON guess
pegs : [X] gtk COMMON PEGS
dominosa : [X] gtk COMMON dominosa
untangle : [X] gtk COMMON UNTANGLE
blackbox : [X] gtk COMMON blackbox
slant : [X] gtk COMMON SLANT
lightup : [X] gtk COMMON lightup
map : [X] gtk COMMON MAP
GTK = gtk printing ps
net : [X] GTK COMMON NET
netslide : [X] GTK COMMON NETSLIDE
cube : [X] GTK COMMON cube
fifteen : [X] GTK COMMON fifteen
sixteen : [X] GTK COMMON sixteen
rect : [X] GTK COMMON rect
pattern : [X] GTK COMMON pattern
solo : [X] GTK COMMON solo
twiddle : [X] GTK COMMON twiddle
mines : [X] GTK COMMON MINES
samegame : [X] GTK COMMON samegame
flip : [X] GTK COMMON FLIP
guess : [X] GTK COMMON guess
pegs : [X] GTK COMMON PEGS
dominosa : [X] GTK COMMON dominosa
untangle : [X] GTK COMMON UNTANGLE
blackbox : [X] GTK COMMON blackbox
slant : [X] GTK COMMON SLANT
lightup : [X] GTK COMMON lightup
map : [X] GTK COMMON MAP
# Auxiliary command-line programs.
solosolver : [U] solo[STANDALONE_SOLVER] malloc
@ -123,7 +125,7 @@ Puzzles.dmg: Puzzles
# it in the Makefile because it will be worse than useless if it
# ever fails to compile, so it's important that it should actually
# be built on a regular basis.
nullgame : [X] gtk COMMON nullgame
nullgame : [X] GTK COMMON nullgame
nullgame : [G] WINDOWS COMMON nullgame
# Version management.