2005-07-11 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/lookup.cc (filled_box): express filled_box with
+ round_filled_box
+
* scm/midi.scm (paper-book-write-midis): new function. Write all
performances in numbered MIDI files.
Stencil
Lookup::filled_box (Box b)
{
- SCM at = (scm_list_n (ly_symbol2scm ("filledbox"),
- scm_make_real (-b[X_AXIS][LEFT]),
- scm_make_real (b[X_AXIS][RIGHT]),
- scm_make_real (-b[Y_AXIS][DOWN]),
- scm_make_real (b[Y_AXIS][UP]),
- SCM_UNDEFINED));
-
- return Stencil (b, at);
+ return round_filled_box (b, 0.0);
}
/*
String f = ly_scm2string (format);
+ String output_name = "<unknown>";
+
+ SCM port_name = scm_port_filename (port);
+ if (scm_is_string (port_name))
+ output_name = ly_scm2string (port_name);
+
message (_f ("Layout output to `%s'...",
- ly_scm2string (scm_port_filename (port)).to_str0 ()));
+ output_name.to_str0 ()));
progress_indication ("\n");
Paper_outputter *po = new Paper_outputter (port, f);
#include "protected-scm.hh"
-static Protected_scm heads;
+static Protected_scm heads = SCM_EOL;
void register_stencil_head (SCM symbol)
{
dashed-slur
dot
draw-line
- filledbox
glyph-string
named-glyph
polygon
--- /dev/null
+(define-module (scm framework-socket)
+ #:export (output-framework)
+ )
+
+(use-modules (ice-9 regex)
+ (ice-9 string-fun)
+ (ice-9 format)
+ (guile)
+ (srfi srfi-1)
+ (ice-9 pretty-print)
+ (srfi srfi-13)
+ (lily))
+
+(define-public (output-framework channel book scopes fields )
+ (let*
+ (
+ (ctor-arg (if (string? channel)
+ (open-output-file (format "~a.socket" channel))
+ channel))
+ (outputter (ly:make-paper-outputter
+ ctor-arg
+ "socket")))
+
+ (for-each
+ (lambda (page)
+ (ly:outputter-dump-stencil outputter page))
+ (ly:paper-book-pages book))))
+
+
+(define-public output-classic-framework output-framework)
+
+
+(define-public (convert-to-ps . args) #t)
+(define-public (convert-to-pdf . args) #t)
+(define-public (convert-to-png . args) #t)
+(define-public (convert-to-dvi . args) #t)
+(define-public (convert-to-tex . args) #t)
(set-path-def props def)
props))
-;; FIXME: naming
-(define (filledbox breapth width depth height)
- (make <gnome-canvas-rect>
- #:parent (canvas-root)
- #:x1 (- breapth) #:y1 depth #:x2 width #:y2 (- height)
- #:fill-color "black"
- #:join-style 'miter))
;; FIXME: the framework-gnome backend needs to see every item that
;; gets created. All items created here must should be put in a group
placebox
bezier-sandwich
embedded-ps
- filledbox
round-filled-box
text
polygon
(define (embedded-ps string)
string)
-;; FIXME: use draw_round_box
-(define (filledbox breapth width depth height)
- (string-append (ly:numbers->string (list breapth width depth height))
- " draw_box"))
(define (glyph-string
postscript-font-name
--- /dev/null
+
+(define-module (scm output-socket)
+ #:re-export (quote)
+ )
+
+(use-modules (guile)
+ (srfi srfi-1)
+ (srfi srfi-13)
+ (lily))
+
+(define (dummy . rest)
+ "")
+
+(for-each
+ (lambda (x)
+ (module-define! (current-module)
+ x
+ dummy))
+
+ (ly:all-stencil-expressions))
+
+(define-public (named-glyph font glyph)
+ (format "~a ~a glyphshow" glyph
+ (ly:font-name font)))
+
+(define-public (placebox x y s)
+ (format "place at ~a ~a: ~a\n" x y s))
+
+(define-public (round-filled-box x y width height blotdiam)
+ (format "~a ~a ~a ~a ~a draw_round_box"
+ x y width height blotdiam
+ ))
+
+(define-public (glyph-string
+ postscript-font-name
+ size cid?
+ x-y-named-glyphs)
+
+ (format "~a ~a text: ~a " postscript-font-name size
+ (string-join (map (lambda (xyn) (caddr xyn))
+ x-y-named-glyphs))))
(define (dashed-line thick on off dx dy)
(draw-line thick 0 0 dx dy `(style . ,(format "stroke-dasharray:~a,~a;" on off))))
-(define (filledbox breapth width depth height)
- (round-filled-box breapth width depth height 0))
-
(define (named-glyph font name)
(dispatch
`(fontify ,font ,(entity 'tspan
repeat-slash
placebox
bezier-sandwich
- filledbox
round-filled-box
text
setcolor
(define (bezier-sandwich lst thick)
(embedded-ps (list 'bezier-sandwich `(quote ,lst) thick)))
-(define (filledbox breapth width depth height)
- (if (and #f (defined? 'ps-testing))
- (embedded-ps
- (string-append (ly:numbers->string (list breapth width depth height))
- " draw_box" ))
- (string-append "\\lyvrule{"
- (ly:number->string (- breapth)) "}{"
- (ly:number->string (+ breapth width)) "}{"
- (ly:number->string depth) "}{"
- (ly:number->string height) "}")))
(define (round-filled-box x y width height blotdiam)
(embedded-ps (list 'round-filled-box x y width height blotdiam)))
"Make a filled box."
(ly:make-stencil
- (list 'filledbox (- (car xext)) (cdr xext)
- (- (car yext)) (cdr yext))
+ (list 'round-filled-box (- (car xext)) (cdr xext)
+ (- (car yext)) (cdr yext) 0.0)
xext yext))
(define-public (make-circle-stencil radius thickness fill)