]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/lookup.cc (filled_box): express filled_box with
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 11 Jul 2005 20:41:04 +0000 (20:41 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 11 Jul 2005 20:41:04 +0000 (20:41 +0000)
round_filled_box

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

12 files changed:
ChangeLog
lily/lookup.cc
lily/paper-outputter-scheme.cc
lily/stencil-expression.cc
scm/define-stencil-commands.scm
scm/framework-socket.scm [new file with mode: 0644]
scm/output-gnome.scm
scm/output-ps.scm
scm/output-socket.scm [new file with mode: 0644]
scm/output-svg.scm
scm/output-tex.scm
scm/stencil.scm

index 982c3c2aac962f5731f03279a0c23abc63078601..1602dd7508c322fbce6ea849e84c9ac80f7d2d9b 100644 (file)
--- 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.
 
index cd5f3b8b50d6136e8c1674f11626962c4f34b6b0..cab5cc84414f3739233378ef2821a08d16f610b8 100644 (file)
@@ -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);
 }
 
 /*
index 81d1fcd29a73c482414817e3d0ae7e29ca7e29ec..fe9c0a82cedb039b84cc94b45cdf4aaaad150d03 100644 (file)
@@ -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);
index d4f5d96011f34a4f167da9e2e8579d3ea7ad6b9e..06fe314fd0e5e043fe9cc604149e3711257e172c 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "protected-scm.hh"
 
-static Protected_scm heads;
+static Protected_scm heads = SCM_EOL;
 
 void register_stencil_head (SCM symbol)
 {
index f47015b6f0f77d68fc07aeba61091182b68e8172..3ebd854a8f8b30d52a2688b6701e335489340f41 100644 (file)
@@ -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 (file)
index 0000000..a2a000e
--- /dev/null
@@ -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)
index 011811b64e1ec013e65f990cbb4a591f79947dc9..eddab1e1a33822deb1452efed0d36e422263f46e 100644 (file)
@@ -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
index fe168a103ffca1302e729a9f21d02881d7ed09ae..9c2e6908e7eca1d968f89c89db3ec0b493336a72 100644 (file)
@@ -34,7 +34,6 @@
            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
diff --git a/scm/output-socket.scm b/scm/output-socket.scm
new file mode 100644 (file)
index 0000000..54bf5d1
--- /dev/null
@@ -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))))
index 402c14c405a14b372e5d9670f615f6c3ae5b0147..0b0ec7e66bad31fdd10baa3abedf9d6f34426be2 100644 (file)
 (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
index baee6e7f2d68f40939ddb56929198e438e3b0500..690ed6d2d9b08a07b798a5f8499345535da72214 100644 (file)
@@ -33,7 +33,6 @@
            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)))
index 81e1d9a40c28253fcd3d5b5d0b88774340f02480..7d93738ef15f439bc862cff29f9831f003d72fbf 100644 (file)
@@ -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)