Canvas Draw

Check-in [53ca1af25d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Simplified build logic, combined libraries
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | v1.1.0
Files: files | file ages | folders
SHA1: 53ca1af25dfdd3bad74ac36e6f432f2a9bc09fc4
User & Date: murphy 2011-12-25 02:43:03
Context
2011-12-25
02:45
Updated CHICKEN release information file check-in: 48e70fb1d1 user: murphy tags: trunk
02:43
Simplified build logic, combined libraries check-in: 53ca1af25d user: murphy tags: trunk, v1.1.0
2011-04-22
15:47
Added .release-info file check-in: 05124adbf1 user: murphy tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to chicken/canvas-draw-base.scm.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
...
546
547
548
549
550
551
552
553
554
(require-library lolevel data-structures srfi-1 srfi-4 srfi-13)

(module canvas-draw-base
	(canvas? canvas->pointer pointer->canvas
	 context? context->pointer pointer->context
	 state? state->pointer pointer->state
	 context-capabilities
	 use-context+ make-canvas call-with-canvas
	 canvas-context
	 canvas-simulate!
	 canvas-attribute canvas-attribute-set!
	 canvas-state canvas-state-set!
	 canvas-clear! canvas-flush
	 canvas-size
	 canvas-mm->px canvas-px->mm
	 canvas-origin canvas-origin-set!
	 canvas-transform canvas-transform-set!
	 canvas-transform-compose!
	 canvas-transform-translate!
	 canvas-transform-scale!
	 canvas-transform-rotate!
	 canvas-foreground canvas-foreground-set!
	 canvas-background canvas-background-set!
	 canvas-write-mode canvas-write-mode-set!
	 canvas-clip-mode canvas-clip-mode-set!
	 canvas-clip-area canvas-clip-area-set!)
	(import
		scheme chicken foreign
		lolevel data-structures srfi-1 srfi-4 srfi-13)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n")

(define *canvas-tag* "cdCanvas")
................................................................................
	(letrec ([canvas-clip-area/raw (foreign-lambda void "cdfCanvasGetClipArea" nonnull-canvas (c-pointer double) (c-pointer double) (c-pointer double) (c-pointer double))])
		(lambda (canvas)
			(let-location ([x0 double 0] [x1 double 0] [y0 double 0] [y1 double 0])
				(canvas-clip-area/raw canvas (location x0) (location x1) (location y0) (location y1))
				(values x0 x1 y0 y1)))))

;; }}}

)
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<
<
1




























2
3
4
5
6
7
8
...
518
519
520
521
522
523
524


;; -*- mode: Scheme; tab-width: 2; -*- ;;





























;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n")

(define *canvas-tag* "cdCanvas")
................................................................................
	(letrec ([canvas-clip-area/raw (foreign-lambda void "cdfCanvasGetClipArea" nonnull-canvas (c-pointer double) (c-pointer double) (c-pointer double) (c-pointer double))])
		(lambda (canvas)
			(let-location ([x0 double 0] [x1 double 0] [y0 double 0] [y1 double 0])
				(canvas-clip-area/raw canvas (location x0) (location x1) (location y0) (location y1))
				(values x0 x1 y0 y1)))))

;; }}}


Changes to chicken/canvas-draw-cgm.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-cgm
	(context:cgm)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdcgm.h>\n")

................................................................................

;; {{{ Context types

(define context:cgm
	(foreign-value "CD_CGM" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdcgm.h>\n")

................................................................................

;; {{{ Context types

(define context:cgm
	(foreign-value "CD_CGM" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-client.scm.

1
2
3
4
5
6
7
8
9
10
11
12
13
...
101
102
103
104
105
106
107
108
109
(require-library canvas-draw-base)

(module canvas-draw-client
	(context:image context:double-buffer
	 canvas-image/rgb canvas-image-put/rgb! canvas-image-put/rgba!)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdirgb.h>\n")

................................................................................
			(lambda (canvas x y width height)
				(let ([data (make-blob (* 3 width height))])
					(canvas-image/rgb/raw canvas x y width height data)
					data)))
		canvas-image-put/rgb!))

;; }}}

)
|
<
<
<
<
<







 







<
<
1





2
3
4
5
6
7
8
..
96
97
98
99
100
101
102


;; -*- mode: Scheme; tab-width: 2; -*- ;;






;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdirgb.h>\n")

................................................................................
			(lambda (canvas x y width height)
				(let ([data (make-blob (* 3 width height))])
					(canvas-image/rgb/raw canvas x y width height data)
					data)))
		canvas-image-put/rgb!))

;; }}}


Changes to chicken/canvas-draw-clipboard.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-clipboard
	(context:clipboard)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdclipbd.h>\n")

................................................................................

;; {{{ Context types

(define context:clipboard
	(foreign-value "CD_CLIPBOARD" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdclipbd.h>\n")

................................................................................

;; {{{ Context types

(define context:clipboard
	(foreign-value "CD_CLIPBOARD" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-debug.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-debug
	(context:debug)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cddebug.h>\n")

................................................................................

;; {{{ Context types

(define context:debug
	(foreign-value "CD_DEBUG" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cddebug.h>\n")

................................................................................

;; {{{ Context types

(define context:debug
	(foreign-value "CD_DEBUG" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-dgn.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-dgn
	(context:dgn)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cddgn.h>\n")

................................................................................

;; {{{ Context types

(define context:dgn
	(foreign-value "CD_DGN" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cddgn.h>\n")

................................................................................

;; {{{ Context types

(define context:dgn
	(foreign-value "CD_DGN" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-dxf.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-dxf
	(context:dxf)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cddxf.h>\n")

................................................................................

;; {{{ Context types

(define context:dxf
	(foreign-value "CD_DXF" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cddxf.h>\n")

................................................................................

;; {{{ Context types

(define context:dxf
	(foreign-value "CD_DXF" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-emf.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-emf
	(context:emf)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdemf.h>\n")

................................................................................

;; {{{ Context types

(define context:emf
	(foreign-value "CD_EMF" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdemf.h>\n")

................................................................................

;; {{{ Context types

(define context:emf
	(foreign-value "CD_EMF" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-gl.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-gl
	(context:gl)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdgl.h>\n")

................................................................................

;; {{{ Context types

(define context:gl
	(foreign-value "CD_GL" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdgl.h>\n")

................................................................................

;; {{{ Context types

(define context:gl
	(foreign-value "CD_GL" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-iup.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
31
32
33
34
35
36
37
38
39
(require-library canvas-draw-base)

(module canvas-draw-iup
	(context:iup make-canvas-action make-cells-draw-cb)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdiup.h>\n")

................................................................................

(define (make-cells-draw-cb proc)
	(let ([wrap (pointer->canvas #t)])
		(lambda (handle i j x-min x-max y-min y-max canvas)
			(call-with-canvas (wrap canvas) (cut proc handle i j x-min x-max y-min y-max <>)))))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
27
28
29
30
31
32
33


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdiup.h>\n")

................................................................................

(define (make-cells-draw-cb proc)
	(let ([wrap (pointer->canvas #t)])
		(lambda (handle i j x-min x-max y-min y-max canvas)
			(call-with-canvas (wrap canvas) (cut proc handle i j x-min x-max y-min y-max <>)))))

;; }}}


Changes to chicken/canvas-draw-metafile.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-metafile
	(context:metafile)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdmf.h>\n")

................................................................................

;; {{{ Context types

(define context:metafile
	(foreign-value "CD_METAFILE" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdmf.h>\n")

................................................................................

;; {{{ Context types

(define context:metafile
	(foreign-value "CD_METAFILE" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-native.scm.

1
2
3
4
5
6
7
8
9
10
11
12
13
..
39
40
41
42
43
44
45
46
47
(require-library canvas-draw-base)

(module canvas-draw-native
	(context:native-window
	 screen-size)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdnative.h>\n")

................................................................................
;; }}}

;; {{{ Library initialization

(foreign-code "cdInitContextPlus();")

;; }}}

)
|
<
<
<
<
<







 







<
<
1





2
3
4
5
6
7
8
..
34
35
36
37
38
39
40


;; -*- mode: Scheme; tab-width: 2; -*- ;;






;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdnative.h>\n")

................................................................................
;; }}}

;; {{{ Library initialization

(foreign-code "cdInitContextPlus();")

;; }}}


Changes to chicken/canvas-draw-pdf.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-pdf
	(context:pdf)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdpdf.h>\n")

................................................................................

;; {{{ Context types

(define context:pdf
	(foreign-value "CD_PDF" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdpdf.h>\n")

................................................................................

;; {{{ Context types

(define context:pdf
	(foreign-value "CD_PDF" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-picture.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-picture
	(context:picture)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdpicture.h>\n")

................................................................................

;; {{{ Context types

(define context:picture
	(foreign-value "CD_PICTURE" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdpicture.h>\n")

................................................................................

;; {{{ Context types

(define context:picture
	(foreign-value "CD_PICTURE" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-play.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
23
24
25
26
27
28
29
30
31
(require-library canvas-draw-base)

(module canvas-draw-play
	(canvas-play!)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n")

(include "canvas-draw-types.scm")
................................................................................

(define (canvas-play! canvas context x0 x1 y0 y1 data)
	(let ([canvas-play/data! (if (string? data) canvas-play/string! canvas-play/ptr!)])
		(unless (zero? (canvas-play/data! canvas context x0 x1 y0 y1 data))
			(error 'canvas-play! "failed to replay graphics"))))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
19
20
21
22
23
24
25


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n")

(include "canvas-draw-types.scm")
................................................................................

(define (canvas-play! canvas context x0 x1 y0 y1 data)
	(let ([canvas-play/data! (if (string? data) canvas-play/string! canvas-play/ptr!)])
		(unless (zero? (canvas-play/data! canvas context x0 x1 y0 y1 data))
			(error 'canvas-play! "failed to replay graphics"))))

;; }}}


Changes to chicken/canvas-draw-primitives.scm.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
...
730
731
732
733
734
735
736
737
738
(require-library data-structures srfi-4 canvas-draw-base)

(module canvas-draw-primitives
	(canvas-pixel!
	 canvas-mark!
	 canvas-mark-type canvas-mark-type-set!
	 canvas-mark-size canvas-mark-size-set!
	 canvas-line! canvas-rectangle! canvas-arc!
	 canvas-line-style canvas-line-style-set!
	 canvas-line-width canvas-line-width-set!
	 canvas-line-join canvas-line-join-set!
	 canvas-line-cap canvas-line-cap-set!
	 canvas-box! canvas-sector! canvas-chord!
	 canvas-background-opacity canvas-background-opacity-set!
	 canvas-fill-mode canvas-fill-mode-set!
	 canvas-interior-style canvas-interior-style-set!
	 canvas-text!
	 canvas-font canvas-font-set!
	 canvas-text-alignment canvas-text-alignment-set!
	 canvas-text-orientation canvas-text-orientation-set!
	 canvas-font-dimensions canvas-text-size canvas-text-box
	 call-with-canvas-in-mode canvas-path-set!
	 canvas-vertex!)
	(import scheme chicken foreign data-structures srfi-4 canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n")

(include "canvas-draw-types.scm")
................................................................................
	  			[(assq path-action path-actions) => cdr]
	  			[else (error 'canvas-path-set! "unknown path action" path-action)])))))

(define canvas-vertex!
	(foreign-lambda void "cdfCanvasVertex" nonnull-canvas double double))

;; }}}

)
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<
<
1























2
3
4
5
6
7
8
...
707
708
709
710
711
712
713


;; -*- mode: Scheme; tab-width: 2; -*- ;;
























;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n")

(include "canvas-draw-types.scm")
................................................................................
	  			[(assq path-action path-actions) => cdr]
	  			[else (error 'canvas-path-set! "unknown path action" path-action)])))))

(define canvas-vertex!
	(foreign-lambda void "cdfCanvasVertex" nonnull-canvas double double))

;; }}}


Changes to chicken/canvas-draw-printer.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-printer
	(context:printer)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdprint.h>\n")

................................................................................

;; {{{ Context types

(define context:printer
	(foreign-value "CD_PRINTER" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdprint.h>\n")

................................................................................

;; {{{ Context types

(define context:printer
	(foreign-value "CD_PRINTER" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-ps.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-ps
	(context:ps)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdps.h>\n")

................................................................................

;; {{{ Context types

(define context:ps
	(foreign-value "CD_PS" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdps.h>\n")

................................................................................

;; {{{ Context types

(define context:ps
	(foreign-value "CD_PS" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-server.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
20
21
22
23
24
25
26
27
28
(require-library canvas-draw-base)

(module canvas-draw-server
	(context:image context:double-buffer)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdimage.h>\n"
	"#include <cddbuf.h>\n")
................................................................................
(define context:image
	(foreign-value "CD_IMAGE" nonnull-context))

(define context:double-buffer
	(foreign-value "CD_DBUFFER" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
16
17
18
19
20
21
22


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdimage.h>\n"
	"#include <cddbuf.h>\n")
................................................................................
(define context:image
	(foreign-value "CD_IMAGE" nonnull-context))

(define context:double-buffer
	(foreign-value "CD_DBUFFER" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-svg.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-svg
	(context:svg)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdsvg.h>\n")

................................................................................

;; {{{ Context types

(define context:svg
	(foreign-value "CD_SVG" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdsvg.h>\n")

................................................................................

;; {{{ Context types

(define context:svg
	(foreign-value "CD_SVG" nonnull-context))

;; }}}


Changes to chicken/canvas-draw-wmf.scm.

1
2
3
4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
(require-library canvas-draw-base)

(module canvas-draw-wmf
	(context:wmf)
	(import scheme chicken foreign canvas-draw-base)

;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdwmf.h>\n")

................................................................................

;; {{{ Context types

(define context:wmf
	(foreign-value "CD_WMF" nonnull-context))

;; }}}

)
|
<
<
<
<







 







<
<
1




2
3
4
5
6
7
8
..
12
13
14
15
16
17
18


;; -*- mode: Scheme; tab-width: 2; -*- ;;





;; {{{ Data types

(foreign-declare
	"#include <cd.h>\n"
	"#include <cdwmf.h>\n")

................................................................................

;; {{{ Context types

(define context:wmf
	(foreign-value "CD_WMF" nonnull-context))

;; }}}


Changes to chicken/canvas-draw.scm.



1






























2






















3













































































































4
5
6
7
8
9
10
11
12
13


(require-library






























	canvas-draw-base canvas-draw-primitives canvas-draw-play)




































































































































(module canvas-draw
	()
	(import scheme chicken)
	(reexport
		(except canvas-draw-base
		        canvas->pointer pointer->canvas
		        context->pointer pointer->context
		        state->pointer pointer->state)
		canvas-draw-primitives
		canvas-draw-play))
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
;; -*- mode: Scheme; tab-width: 2; -*- ;;

(require-library lolevel data-structures srfi-1 srfi-4 srfi-13)

(module canvas-draw-base
	(canvas? canvas->pointer pointer->canvas
	 context? context->pointer pointer->context
	 state? state->pointer pointer->state
	 context-capabilities
	 use-context+ make-canvas call-with-canvas
	 canvas-context
	 canvas-simulate!
	 canvas-attribute canvas-attribute-set!
	 canvas-state canvas-state-set!
	 canvas-clear! canvas-flush
	 canvas-size
	 canvas-mm->px canvas-px->mm
	 canvas-origin canvas-origin-set!
	 canvas-transform canvas-transform-set!
	 canvas-transform-compose!
	 canvas-transform-translate!
	 canvas-transform-scale!
	 canvas-transform-rotate!
	 canvas-foreground canvas-foreground-set!
	 canvas-background canvas-background-set!
	 canvas-write-mode canvas-write-mode-set!
	 canvas-clip-mode canvas-clip-mode-set!
	 canvas-clip-area canvas-clip-area-set!)
	(import
		scheme chicken foreign
		lolevel data-structures srfi-1 srfi-4 srfi-13)
	(include "canvas-draw-base.scm"))

(module canvas-draw-primitives
	(canvas-pixel!
	 canvas-mark!
	 canvas-mark-type canvas-mark-type-set!
	 canvas-mark-size canvas-mark-size-set!
	 canvas-line! canvas-rectangle! canvas-arc!
	 canvas-line-style canvas-line-style-set!
	 canvas-line-width canvas-line-width-set!
	 canvas-line-join canvas-line-join-set!
	 canvas-line-cap canvas-line-cap-set!
	 canvas-box! canvas-sector! canvas-chord!
	 canvas-background-opacity canvas-background-opacity-set!
	 canvas-fill-mode canvas-fill-mode-set!
	 canvas-interior-style canvas-interior-style-set!
	 canvas-text!
	 canvas-font canvas-font-set!
	 canvas-text-alignment canvas-text-alignment-set!
	 canvas-text-orientation canvas-text-orientation-set!
	 canvas-font-dimensions canvas-text-size canvas-text-box
	 call-with-canvas-in-mode canvas-path-set!
	 canvas-vertex!)
	(import scheme chicken foreign data-structures srfi-4 canvas-draw-base)
	(include "canvas-draw-primitives.scm"))

(module canvas-draw-play
	(canvas-play!)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-play.scm"))

(module canvas-draw-picture
	(context:picture)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-picture.scm"))

(module canvas-draw-client
	(context:image context:double-buffer
	 canvas-image/rgb canvas-image-put/rgb! canvas-image-put/rgba!)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-client.scm"))

(module canvas-draw-ps
	(context:ps)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-ps.scm"))

(module canvas-draw-svg
	(context:svg)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-svg.scm"))

(module canvas-draw-metafile
	(context:metafile)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-metafile.scm"))

(module canvas-draw-cgm
	(context:cgm)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-cgm.scm"))

(module canvas-draw-dgn
	(context:dgn)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-dgn.scm"))

(module canvas-draw-dxf
	(context:dxf)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-dxf.scm"))

(module canvas-draw-emf
	(context:emf)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-emf.scm"))

(module canvas-draw-wmf
	(context:wmf)
	(import scheme chicken foreign canvas-draw-base)
	(include "canvas-draw-wmf.scm"))

(cond-expand
 [disable-canvas-draw-iup]
 [else
	(module canvas-draw-iup
		(context:iup make-canvas-action make-cells-draw-cb)
		(import scheme chicken foreign canvas-draw-base)
		(include "canvas-draw-iup.scm"))])

(cond-expand
 [disable-canvas-draw-gl]
 [else
	(module canvas-draw-gl
		(context:gl)
		(import scheme chicken foreign canvas-draw-base)
		(include "canvas-draw-gl.scm"))])

(cond-expand
 [disable-canvas-draw-native]
 [else
	(module canvas-draw-native
		(context:native-window
		 screen-size)
		(import scheme chicken foreign canvas-draw-base)
		(include "canvas-draw-native.scm"))
	(module canvas-draw-server
		(context:image context:double-buffer)
		(import scheme chicken foreign canvas-draw-base)
		(include "canvas-draw-server.scm"))
	(module canvas-draw-clipboard
		(context:clipboard)
		(import scheme chicken foreign canvas-draw-base)
		(include "canvas-draw-clipboard.scm"))
	(module canvas-draw-printer
		(context:printer)
		(import scheme chicken foreign canvas-draw-base)
		(include "canvas-draw-printer.scm"))])

(cond-expand
 [disable-canvas-draw-pdf]
 [else
	(module canvas-draw-pdf
		(context:pdf)
		(import scheme chicken foreign canvas-draw-base)
		(include "canvas-draw-pdf.scm"))])

(cond-expand
 [enable-canvas-draw-debug
	(module canvas-draw-debug
		(context:debug)
		(import scheme chicken foreign canvas-draw-base)
		(include "canvas-draw-debug.scm"))]
 [else])

(module canvas-draw
	()
	(import scheme chicken)
	(reexport
		(except canvas-draw-base
		        canvas->pointer pointer->canvas
		        context->pointer pointer->context
		        state->pointer pointer->state)
		canvas-draw-primitives
		canvas-draw-play))

Changes to chicken/canvas-draw.setup.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49


50
51
52
53
54
55
56
57
58
59

60
61
62


63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79


80
81
82
83
84
85
86
87

88
89
90


91
92
93


94
95

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128


129
130

131
132
133






134
135

136
137
138

139
140
141
142
143
144
145
146
147
148


149
150
151
152
153
154
155
156

157



158
159

160
161

162
163
164
165
166
167
168
169
170
171


172
173
174
175
176
177


178


179
180
181
182
183
184
185
186
187
188




189









190
191
192
193
194
195
196



197
198
199
200
201

202
203

204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293

294
295

296
297
298
299
300
301
302
303
304
305
306

307
308
309

310
311
312
313
314
315
316
317
318
319
320

321
322
323

324
325
326
327
328
329
330
331
332
333
334

335
336
337




338
339
340
341
342
343
344
345
346
347
348

349
350
351

352
353
354
355
356
357
358
359
360
361

362
363
364
365
366
367
368

;; -*- mode: Scheme; tab-width: 2; -*- ;;
(cond-expand
 [no-library-checks
	(define-syntax check-libraries
		(syntax-rules ()
			[(check-libraries #f [lib fun] ...)
			 #f]
			[(check-libraries [lib fun] ...)
			 #t]))]
 [else
	(define-syntax check-libraries
		(syntax-rules ()
			[(check-libraries #f [lib fun] ...)
			 (and (find-library lib fun) ...)]
			[(check-libraries [lib fun] ...)
			 (and (find-library lib fun) ...)]))])

(if (check-libraries ["cd" "cdCreateCanvas"])
	(begin
		(compile -s -O2 -d1 "canvas-draw-base.scm" -j canvas-draw-base "-lcd")
		(compile -c -O2 -d1 "canvas-draw-base.scm" -j canvas-draw-base -unit canvas-draw-base)
		(compile -s -O2 -d0 "canvas-draw-base.import.scm")
		
		(install-extension

		 'canvas-draw-base
		 '("canvas-draw-base.so" "canvas-draw-base.o" "canvas-draw-base.import.so" "canvas-draw-types.scm")
		 '((version 1.0.0)
			 (static "canvas-draw-base.o")
			 (static-options "-lcd")))
		
		(compile -s -O2 -d1 "canvas-draw-primitives.scm" -j canvas-draw-primitives "-lcd")
		(compile -c -O2 -d1 "canvas-draw-primitives.scm" -j canvas-draw-primitives -unit canvas-draw-primitives)
		(compile -s -O2 -d0 "canvas-draw-primitives.import.scm")
		
		(install-extension
		 'canvas-draw-primitives
		 '("canvas-draw-primitives.so" "canvas-draw-primitives.o" "canvas-draw-primitives.import.so" "canvas-draw-types.scm")
		 '((version 1.0.0)
			 (static "canvas-draw-primitives.o")
			 (static-options "-lcd")))
		
		(compile -s -O2 -d1 "canvas-draw-play.scm" -j canvas-draw-play "-lcd")
		(compile -c -O2 -d1 "canvas-draw-play.scm" -j canvas-draw-play -unit canvas-draw-play)
		(compile -s -O2 -d0 "canvas-draw-play.import.scm")
		
		(install-extension
		 'canvas-draw-play
		 '("canvas-draw-play.so" "canvas-draw-play.o" "canvas-draw-play.import.so" "canvas-draw-types.scm")
		 '((version 1.0.0)


			 (static "canvas-draw-play.o")
			 (static-options "-lcd")))
		
		(if (check-libraries ["iupcd" "cdContextIup"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-iup.scm" -j canvas-draw-iup "-liupcd")
				(compile -c -O2 -d1 "canvas-draw-iup.scm" -j canvas-draw-iup -unit canvas-draw-iup)
				(compile -s -O2 -d0 "canvas-draw-iup.import.scm")
				
				(install-extension

				 'canvas-draw-iup
				 '("canvas-draw-iup.so" "canvas-draw-iup.o" "canvas-draw-iup.import.so")
				 '((version 1.0.0)


					 (static "canvas-draw-iup.o")
					 (static-options "-liupcd"))))
			(warning "CD IUP driver not found, some bindings cannot be compiled"))
		
		(cond
			[(check-libraries
				#f
				["cdx11" "cdContextNativeWindow"]
				["cdcontextplus" "cdInitContextPlus"])
			 (compile -s -O2 -d1 "canvas-draw-native.scm" -j canvas-draw-native "-lcdx11 -lcdcontextplus")
			 (compile -c -O2 -d1 "canvas-draw-native.scm" -j canvas-draw-native -unit canvas-draw-native)
			 (compile -s -O2 -d0 "canvas-draw-native.import.scm")
			 
			 (install-extension
				'canvas-draw-native
				'("canvas-draw-native.so" "canvas-draw-native.o" "canvas-draw-native.import.so")
				'((version 1.0.0)


					(static "canvas-draw-native.o")
					(static-options "-lcdx11 -lcdcontextplus")))]
			[(check-libraries
				#f
				["cd" "cdContextNativeWindow"]
				["cdcontextplus" "cdInitContextPlus"])
			 (compile -s -O2 -d1 "canvas-draw-native.scm" -j canvas-draw-native "-lcd -lcdcontextplus")
			 (compile -c -O2 -d1 "canvas-draw-native.scm" -j canvas-draw-native -unit canvas-draw-native)

			 (compile -s -O2 -d0 "canvas-draw-native.import.scm")
			 
			 (install-extension


				'canvas-draw-native
				'("canvas-draw-native.so" "canvas-draw-native.o" "canvas-draw-native.import.so")
				'((version 1.0.0)


					(static "canvas-draw-native.o")
					(static-options "-lcd -lcdcontextplus")))]

			[else
			 (warning "CD native window driver not found, some bindings cannot be compiled")])
		
		(if (check-libraries ["cdgl" "cdContextGL"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-gl.scm" -j canvas-draw-gl "-lcdgl")
				(compile -c -O2 -d1 "canvas-draw-gl.scm" -j canvas-draw-gl -unit canvas-draw-gl)
				(compile -s -O2 -d0 "canvas-draw-gl.import.scm")
				
				(install-extension
				 'canvas-draw-gl
				 '("canvas-draw-gl.so" "canvas-draw-gl.o" "canvas-draw-gl.import.so")
				 '((version 1.0.0)
					 (static "canvas-draw-gl.o")
					 (static-options "-lcdgl"))))
			(warning "CD OpenGL driver not found, some bindings cannot be compiled"))
		
		(cond
			[(check-libraries #f ["cdx11" "cdContextClipboard"])
			 (compile -s -O2 -d1 "canvas-draw-clipboard.scm" -j canvas-draw-clipboard "-lcdx11")
			 (compile -c -O2 -d1 "canvas-draw-clipboard.scm" -j canvas-draw-clipboard -unit canvas-draw-clipboard)
			 (compile -s -O2 -d0 "canvas-draw-clipboard.import.scm")
			 
			 (install-extension
				'canvas-draw-clipboard
				'("canvas-draw-clipboard.so" "canvas-draw-clipboard.o" "canvas-draw-clipboard.import.so")
				'((version 1.0.0)
					(static "canvas-draw-clipboard.o")
					(static-options "-lcdx11")))]
			[(check-libraries ["cd" "cdContextClipboard"])
			 (compile -s -O2 -d1 "canvas-draw-clipboard.scm" -j canvas-draw-clipboard "-lcd")
			 (compile -c -O2 -d1 "canvas-draw-clipboard.scm" -j canvas-draw-clipboard -unit canvas-draw-clipboard)
			 (compile -s -O2 -d0 "canvas-draw-clipboard.import.scm")


			 
			 (install-extension

				'canvas-draw-clipboard
				'("canvas-draw-clipboard.so" "canvas-draw-clipboard.o" "canvas-draw-clipboard.import.so")
				'((version 1.0.0)






					(static "canvas-draw-clipboard.o")
					(static-options "-lcd")))]

			[else
			 (warning "CD clipboard driver not found, some bindings cannot be compiled")])
		

		(cond
			[(check-libraries #f ["cdx11" "cdContextPrinter"])
			 (compile -s -O2 -d1 "canvas-draw-printer.scm" -j canvas-draw-printer "-lcdx11")
			 (compile -c -O2 -d1 "canvas-draw-printer.scm" -j canvas-draw-printer -unit canvas-draw-printer)
			 (compile -s -O2 -d0 "canvas-draw-printer.import.scm")
			 
			 (install-extension
				'canvas-draw-printer
				'("canvas-draw-printer.so" "canvas-draw-printer.o" "canvas-draw-printer.import.so")
				'((version 1.0.0)


					(static "canvas-draw-printer.o")
					(static-options "-lcdx11")))]
			[(check-libraries ["cd" "cdContextPrinter"])
			 (compile -s -O2 -d1 "canvas-draw-printer.scm" -j canvas-draw-printer "-lcd")
			 (compile -c -O2 -d1 "canvas-draw-printer.scm" -j canvas-draw-printer -unit canvas-draw-printer)
			 (compile -s -O2 -d0 "canvas-draw-printer.import.scm")
			 
			 (install-extension

				'canvas-draw-printer



				'("canvas-draw-printer.so" "canvas-draw-printer.o" "canvas-draw-printer.import.so")
				'((version 1.0.0)

					(static "canvas-draw-printer.o")
					(static-options "-lcd")))]

			[else
			 (warning "CD printer driver not found, some bindings cannot be compiled")])
		
		(if (check-libraries ["cd" "cdContextPicture"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-picture.scm" -j canvas-draw-picture "-lcd")
				(compile -c -O2 -d1 "canvas-draw-picture.scm" -j canvas-draw-picture -unit canvas-draw-picture)
				(compile -s -O2 -d0 "canvas-draw-picture.import.scm")
				
				(install-extension


				 'canvas-draw-picture
				 '("canvas-draw-picture.so" "canvas-draw-picture.o" "canvas-draw-picture.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-picture.o")
				   (static-options "-lcd"))))
			(warning "CD picture driver not found, some bindings cannot be compiled"))


		


		(cond
			[(check-libraries #f ["cdx11" "cdContextImage"])
			 (compile -s -O2 -d1 "canvas-draw-server.scm" -j canvas-draw-server "-lcdx11")
			 (compile -c -O2 -d1 "canvas-draw-server.scm" -j canvas-draw-server -unit canvas-draw-server)
			 (compile -s -O2 -d0 "canvas-draw-server.import.scm")
			 
			 (install-extension
				'canvas-draw-server
				'("canvas-draw-server.so" "canvas-draw-server.o" "canvas-draw-server.import.so")
				'((version 1.0.0)




					(static "canvas-draw-server.o")









					(static-options "-lcdx11")))]
			[(check-libraries ["cd" "cdContextImage"])
			 (compile -s -O2 -d1 "canvas-draw-server.scm" -j canvas-draw-server "-lcd")
			 (compile -c -O2 -d1 "canvas-draw-server.scm" -j canvas-draw-server -unit canvas-draw-server)
			 (compile -s -O2 -d0 "canvas-draw-server.import.scm")
			 
			 (install-extension



				'canvas-draw-server
				'("canvas-draw-server.so" "canvas-draw-server.o" "canvas-draw-server.import.so")
				'((version 1.0.0)
					(static "canvas-draw-server.o")
					(static-options "-lcd")))]

			[else
			 (warning "CD server image driver not found, some bindings cannot be compiled")])

		
		(if (check-libraries ["cd" "cdContextImageRGB"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-client.scm" -j canvas-draw-client "-lcd")
				(compile -c -O2 -d1 "canvas-draw-client.scm" -j canvas-draw-client -unit canvas-draw-client)
				(compile -s -O2 -d0 "canvas-draw-client.import.scm")
				
				(install-extension
				 'canvas-draw-client
				 '("canvas-draw-client.so" "canvas-draw-client.o" "canvas-draw-client.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-client.o")
				   (static-options "-lcd"))))
			(warning "CD client image driver not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["cdpdf" "cdContextPDF"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-pdf.scm" -j canvas-draw-pdf "-lcdpdf")
				(compile -c -O2 -d1 "canvas-draw-pdf.scm" -j canvas-draw-pdf -unit canvas-draw-pdf)
				(compile -s -O2 -d0 "canvas-draw-pdf.import.scm")
				
				(install-extension
				 'canvas-draw-pdf
				 '("canvas-draw-pdf.so" "canvas-draw-pdf.o" "canvas-draw-pdf.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-pdf.o")
				   (static-options "-lcdpdf"))))
			(warning "CD PDF driver not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["cd" "cdContextPS"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-ps.scm" -j canvas-draw-ps "-lcd")
				(compile -c -O2 -d1 "canvas-draw-ps.scm" -j canvas-draw-ps -unit canvas-draw-ps)
				(compile -s -O2 -d0 "canvas-draw-ps.import.scm")
				
				(install-extension
				 'canvas-draw-ps
				 '("canvas-draw-ps.so" "canvas-draw-ps.o" "canvas-draw-ps.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-ps.o")
				   (static-options "-lcd"))))
			(warning "CD PostScript driver not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["cd" "cdContextSVG"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-svg.scm" -j canvas-draw-svg "-lcd")
				(compile -c -O2 -d1 "canvas-draw-svg.scm" -j canvas-draw-svg -unit canvas-draw-svg)
				(compile -s -O2 -d0 "canvas-draw-svg.import.scm")
				
				(install-extension
				 'canvas-draw-svg
				 '("canvas-draw-svg.so" "canvas-draw-svg.o" "canvas-draw-svg.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-svg.o")
				   (static-options "-lcd"))))
			(warning "CD SVG driver not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["cd" "cdContextMetafile"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-metafile.scm" -j canvas-draw-metafile "-lcd")
				(compile -c -O2 -d1 "canvas-draw-metafile.scm" -j canvas-draw-metafile -unit canvas-draw-metafile)
				(compile -s -O2 -d0 "canvas-draw-metafile.import.scm")
				
				(install-extension
				 'canvas-draw-metafile
				 '("canvas-draw-metafile.so" "canvas-draw-metafile.o" "canvas-draw-metafile.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-metafile.o")
				   (static-options "-lcd"))))
			(warning "CD metafile driver not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["cd" "cdContextDebug"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-debug.scm" -j canvas-draw-debug "-lcd")
				(compile -c -O2 -d1 "canvas-draw-debug.scm" -j canvas-draw-debug -unit canvas-draw-debug)
				(compile -s -O2 -d0 "canvas-draw-debug.import.scm")
				
				(install-extension
				 'canvas-draw-debug
				 '("canvas-draw-debug.so" "canvas-draw-debug.o" "canvas-draw-debug.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-debug.o")
				   (static-options "-lcd"))))
			(warning "CD debug driver not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["cd" "cdContextCGM"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-cgm.scm" -j canvas-draw-cgm "-lcd")
				(compile -c -O2 -d1 "canvas-draw-cgm.scm" -j canvas-draw-cgm -unit canvas-draw-cgm)
				(compile -s -O2 -d0 "canvas-draw-cgm.import.scm")

				
				(install-extension

				 'canvas-draw-cgm
				 '("canvas-draw-cgm.so" "canvas-draw-cgm.o" "canvas-draw-cgm.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-cgm.o")
				   (static-options "-lcd"))))
			(warning "CD CGM driver not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["cd" "cdContextDGN"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-dgn.scm" -j canvas-draw-dgn "-lcd")
				(compile -c -O2 -d1 "canvas-draw-dgn.scm" -j canvas-draw-dgn -unit canvas-draw-dgn)

				(compile -s -O2 -d0 "canvas-draw-dgn.import.scm")
				
				(install-extension

				 'canvas-draw-dgn
				 '("canvas-draw-dgn.so" "canvas-draw-dgn.o" "canvas-draw-dgn.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-dgn.o")
				   (static-options "-lcd"))))
			(warning "CD DGN driver not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["cd" "cdContextDXF"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-dxf.scm" -j canvas-draw-dxf "-lcd")
				(compile -c -O2 -d1 "canvas-draw-dxf.scm" -j canvas-draw-dxf -unit canvas-draw-dxf)

				(compile -s -O2 -d0 "canvas-draw-dxf.import.scm")
				
				(install-extension

				 'canvas-draw-dxf
				 '("canvas-draw-dxf.so" "canvas-draw-dxf.o" "canvas-draw-dxf.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-dxf.o")
				   (static-options "-lcd"))))
			(warning "CD DXF driver not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["cd" "cdContextEMF"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-emf.scm" -j canvas-draw-emf "-lcd")
				(compile -c -O2 -d1 "canvas-draw-emf.scm" -j canvas-draw-emf -unit canvas-draw-emf)

				(compile -s -O2 -d0 "canvas-draw-emf.import.scm")
				
				(install-extension




				 'canvas-draw-emf
				 '("canvas-draw-emf.so" "canvas-draw-emf.o" "canvas-draw-emf.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-emf.o")
				   (static-options "-lcd"))))
			(warning "CD EMF driver not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["cd" "cdContextWMF"])
			(begin
				(compile -s -O2 -d1 "canvas-draw-wmf.scm" -j canvas-draw-wmf "-lcd")
				(compile -c -O2 -d1 "canvas-draw-wmf.scm" -j canvas-draw-wmf -unit canvas-draw-wmf)

				(compile -s -O2 -d0 "canvas-draw-wmf.import.scm")
				
				(install-extension

				 'canvas-draw-wmf
				 '("canvas-draw-wmf.so" "canvas-draw-wmf.o" "canvas-draw-wmf.import.so")
				 '((version 1.0.0)
				   (static "canvas-draw-wmf.o")
				   (static-options "-lcd"))))
			(warning "CD WMF driver not found, some bindings cannot be compiled"))
		
		(compile -s -O2 -d1 "canvas-draw.scm" -j canvas-draw)
		(compile -c -O2 -d1 "canvas-draw.scm" -j canvas-draw -unit canvas-draw)
		(compile -s -O2 -d0 "canvas-draw.import.scm")

		
		(install-extension
		 'canvas-draw
		 '("canvas-draw.so" "canvas-draw.o" "canvas-draw.import.so")
		 '((version 1.0.0)
			 (static "canvas-draw.o"))))
	(error "CD not found, none of the bindings can be compiled"))


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
>
|
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
|
<
<
>
>
|
<
<
<
<
<
<
<
<
<
>
|
<
<
>
>
|
<
<
<
|
<
<
<
<
<
<
<
<
<
|
<
<
>
>
|
<
<
<
<
<
<
<
>
|
<
<
>
>
|
<
<
>
>
|
<
>
|
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
|
<
<
<
<
<
<
|
<
<
|
<
<
<
<
<
>
>
|
<
>
|
<
<
>
>
>
>
>
>
|
<
>
|
<
<
>
|
<
<
<
<
<
<
|
<
<
>
>
|
<
<
<
<
<
<
<
>
|
>
>
>
|
<
>
|
<
>
|
<
<
<
<
<
<
<
<
<
>
>
|
<
<
|
<
<
>
>
|
>
>
|
<
<
<
<
<
<
|
<
<
>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
<
<
<
<
<
<
>
>
>
|
<
<
<
<
>
|
<
>
|
<
<
|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
|
<
<
|
<
<
<
<
<
<
<
|
<
<
|
<
<
|
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
|
<
<
|
<
<
<
<
<
<
<
|
>
|
<
>
|
<
<
<
<
<
<
<
<
<
<
>
|
<
<
>
|
<
<
<
<
<
<
<
<
<
<
>
|
<
<
>
|
<
<
<
<
<
<
<
<
<
<
>
|
<
<
>
>
>
>
|
<
<
<
<
<
<
<
<
<
<
>
|
<
<
>
|
<
<
<
<
<
<
<
<
|
>
|
|
|
|
|
|
<
>
1















2







3
4










5










6


7
8
9









10
11


12
13
14



15









16


17
18
19







20
21


22
23
24


25
26
27

28
29









30






31






32


33





34
35
36

37
38


39
40
41
42
43
44
45

46
47


48
49






50


51
52
53







54
55
56
57
58
59

60
61

62
63









64
65
66


67


68
69
70
71
72
73






74


75
76
77
78
79
80
81
82
83
84
85
86
87
88
89






90
91
92
93




94
95

96
97


98
99
100













101


102


103







104


105


106







107













108













109


110


111







112
113
114

115
116










117
118


119
120










121
122


123
124










125
126


127
128
129
130
131










132
133


134
135








136
137
138
139
140
141
142
143

144
;; -*- mode: Scheme; tab-width: 2; -*- ;;























(define modules
	`(-j canvas-draw










		-j canvas-draw-base -j canvas-draw-primitives -j canvas-draw-play










		-j canvas-draw-picture -j canvas-draw-client


		-j canvas-draw-ps -j canvas-draw-svg -j canvas-draw-metafile
		-j canvas-draw-cgm -j canvas-draw-dgn -j canvas-draw-dxf
		-j canvas-draw-emf -j canvas-draw-wmf









		,@(cond-expand
			 [disable-canvas-draw-iup


				'()]
			 [else
				'(-j canvas-draw-iup)])



		,@(cond-expand









			 [disable-canvas-draw-gl


				'()]
			 [else
				'(-j canvas-draw-gl)])







		,@(cond-expand
			 [disable-canvas-draw-native


				'()]
			 [else
				'(-j canvas-draw-native -j canvas-draw-server


					-j canvas-draw-clipboard -j canvas-draw-printer)])
		,@(cond-expand
			 [disable-canvas-draw-pdf

				'()]
			 [else









				'(-j canvas-draw-pdf)])






		,@(cond-expand






			 [enable-canvas-draw-debug


				'(-j canvas-draw-debug)]





			 [else
				'()])))


(define import-libraries
	`("canvas-draw.import.scm"


		"canvas-draw-base.import.scm" "canvas-draw-primitives.import.scm" "canvas-draw-play.import.scm"
		"canvas-draw-picture.import.scm" "canvas-draw-client.import.scm"
		"canvas-draw-ps.import.scm" "canvas-draw-svg.import.scm" "canvas-draw-metafile.import.scm"
		"canvas-draw-cgm.import.scm" "canvas-draw-dgn.import.scm" "canvas-draw-dxf.import.scm"
		"canvas-draw-emf.import.scm" "canvas-draw-wmf.import.scm"
		,@(cond-expand
			 [disable-canvas-draw-iup

				'()]
			 [else


				'("canvas-draw-iup.import.scm")])
		,@(cond-expand






			 [disable-canvas-draw-gl


				'()]
			 [else
				'("canvas-draw-gl.import.scm")])







		,@(cond-expand
			 [disable-canvas-draw-native
				'()]
			 [else
				'("canvas-draw-native.import.scm" "canvas-draw-server.import.scm"
					"canvas-draw-clipboard.import.scm" "canvas-draw-printer.import.scm")])

		,@(cond-expand
			 [disable-canvas-draw-pdf

				'()]
			 [else









				'("canvas-draw-pdf.import.scm")])
		,@(cond-expand
			 [enable-canvas-draw-debug


				'("canvas-draw-debug.import.scm")]


			 [else
				'()])))

(define native-libraries
	`("-lcd"
		,@(cond-expand






			 [disable-canvas-draw-iup


				'()]
			 [else
				'("-liupcd")])
		,@(cond-expand
			 [disable-canvas-draw-gl
				'()]
			 [else
				'("-lcdgl")])
		,@(cond-expand
			 [disable-canvas-draw-native
				'()]
			 [else
				(append
				 (if (find-library "cdx11" "cdContextNativeWindow")
						 '("-lcdx11") '())






				 (if (find-library "cdcontextplus" "cdInitContextPlus")
						 '("-lcdcontextplus") '()))])
		,@(cond-expand
			 [disable-canvas-draw-pdf




				'()]
			 [else

				'("-lcdpdf")])))



(compile -s -O2 -d1 "canvas-draw.scm" ,@modules ,@native-libraries)
(compile -c -O2 -d1 "canvas-draw.scm" -unit canvas-draw)
(compile -s -O2 -d0 "canvas-draw.import.scm")













(compile -s -O2 -d0 "canvas-draw-base.import.scm")


(compile -s -O2 -d0 "canvas-draw-primitives.import.scm")


(compile -s -O2 -d0 "canvas-draw-play.import.scm")







(compile -s -O2 -d0 "canvas-draw-picture.import.scm")


(compile -s -O2 -d0 "canvas-draw-client.import.scm")


(compile -s -O2 -d0 "canvas-draw-ps.import.scm")







(compile -s -O2 -d0 "canvas-draw-svg.import.scm")













(compile -s -O2 -d0 "canvas-draw-metafile.import.scm")













(compile -s -O2 -d0 "canvas-draw-cgm.import.scm")


(compile -s -O2 -d0 "canvas-draw-dgn.import.scm")


(compile -s -O2 -d0 "canvas-draw-dxf.import.scm")







(compile -s -O2 -d0 "canvas-draw-emf.import.scm")
(compile -s -O2 -d0 "canvas-draw-wmf.import.scm")


(cond-expand
 [disable-canvas-draw-iup]










 [else
	(compile -s -O2 -d0 "canvas-draw-iup.import.scm")])


(cond-expand
 [disable-canvas-draw-gl]










 [else
	(compile -s -O2 -d0 "canvas-draw-gl.import.scm")])


(cond-expand
 [disable-canvas-draw-native]










 [else
	(compile -s -O2 -d0 "canvas-draw-native.import.scm")


	(compile -s -O2 -d0 "canvas-draw-server.import.scm")
	(compile -s -O2 -d0 "canvas-draw-clipboard.import.scm")
	(compile -s -O2 -d0 "canvas-draw-printer.import.scm")])
(cond-expand
 [disable-canvas-draw-pdf]










 [else
	(compile -s -O2 -d0 "canvas-draw-pdf.import.scm")])


(cond-expand
 [enable-canvas-draw-debug








	(compile -s -O2 -d0 "canvas-draw-debug.import.scm")]
 [else])

(install-extension
 'canvas-draw
 `("canvas-draw.so" "canvas-draw.o" "canvas-draw-types.scm" ,@import-libraries)
 `((version 1.1.0)
	 (static "canvas-draw-base.o")

	 (static-options ,(string-intersperse native-libraries))))