From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Date: Mon, 11 Jul 2005 20:41:04 +0000 (+0000)
Subject: * lily/lookup.cc (filled_box): express filled_box with
X-Git-Tag: release/2.7.1~40
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=260073be07f49a5f6f3be8df2af52873843eec60;p=lilypond.git

* lily/lookup.cc (filled_box): express filled_box with
round_filled_box

* lily/paper-outputter-scheme.cc (LY_DEFINE): take port argument.
---

diff --git a/ChangeLog b/ChangeLog
index 982c3c2aac..1602dd7508 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 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.
 
diff --git a/lily/lookup.cc b/lily/lookup.cc
index cd5f3b8b50..cab5cc8441 100644
--- a/lily/lookup.cc
+++ b/lily/lookup.cc
@@ -124,14 +124,7 @@ Lookup::blank (Box b)
 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);
 }
 
 /*
diff --git a/lily/paper-outputter-scheme.cc b/lily/paper-outputter-scheme.cc
index 81d1fcd29a..fe9c0a82ce 100644
--- a/lily/paper-outputter-scheme.cc
+++ b/lily/paper-outputter-scheme.cc
@@ -24,8 +24,14 @@ LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter",
 
   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);
diff --git a/lily/stencil-expression.cc b/lily/stencil-expression.cc
index d4f5d96011..06fe314fd0 100644
--- a/lily/stencil-expression.cc
+++ b/lily/stencil-expression.cc
@@ -12,7 +12,7 @@
 
 #include "protected-scm.hh"
 
-static Protected_scm heads;
+static Protected_scm heads = SCM_EOL;
 
 void register_stencil_head (SCM symbol)
 {
diff --git a/scm/define-stencil-commands.scm b/scm/define-stencil-commands.scm
index f47015b6f0..3ebd854a8f 100644
--- a/scm/define-stencil-commands.scm
+++ b/scm/define-stencil-commands.scm
@@ -17,7 +17,6 @@
        dashed-slur
        dot
        draw-line
-       filledbox
        glyph-string
        named-glyph
        polygon
diff --git a/scm/framework-socket.scm b/scm/framework-socket.scm
new file mode 100644
index 0000000000..a2a000e1e2
--- /dev/null
+++ b/scm/framework-socket.scm
@@ -0,0 +1,37 @@
+(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)
diff --git a/scm/output-gnome.scm b/scm/output-gnome.scm
index 011811b64e..eddab1e1a3 100644
--- a/scm/output-gnome.scm
+++ b/scm/output-gnome.scm
@@ -292,13 +292,6 @@ lilypond -fgnome input/simple-song.ly
     (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
diff --git a/scm/output-ps.scm b/scm/output-ps.scm
index fe168a103f..9c2e6908e7 100644
--- a/scm/output-ps.scm
+++ b/scm/output-ps.scm
@@ -34,7 +34,6 @@
 	    placebox
 	    bezier-sandwich
 	    embedded-ps
-	    filledbox
 	    round-filled-box
 	    text
 	    polygon
@@ -139,10 +138,6 @@
 (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
diff --git a/scm/output-socket.scm b/scm/output-socket.scm
new file mode 100644
index 0000000000..54bf5d1342
--- /dev/null
+++ b/scm/output-socket.scm
@@ -0,0 +1,41 @@
+
+(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))))
diff --git a/scm/output-svg.scm b/scm/output-svg.scm
index 402c14c405..0b0ec7e66b 100644
--- a/scm/output-svg.scm
+++ b/scm/output-svg.scm
@@ -282,9 +282,6 @@
 (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
diff --git a/scm/output-tex.scm b/scm/output-tex.scm
index baee6e7f2d..690ed6d2d9 100644
--- a/scm/output-tex.scm
+++ b/scm/output-tex.scm
@@ -33,7 +33,6 @@
 	    repeat-slash
 	    placebox
 	    bezier-sandwich
-	    filledbox
 	    round-filled-box
 	    text
 	    setcolor
@@ -130,16 +129,6 @@
 (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)))
diff --git a/scm/stencil.scm b/scm/stencil.scm
index 81e1d9a40c..7d93738ef1 100644
--- a/scm/stencil.scm
+++ b/scm/stencil.scm
@@ -53,8 +53,8 @@
   "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)