]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.0.16.jcn1: geile pats
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 15 Oct 1998 14:27:35 +0000 (17:27 +0300)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 15 Oct 1998 14:27:35 +0000 (17:27 +0300)
pl 16.jcn1
- dashed-slur through scheme

pl 15.jcn4
- more scheme hacks

pl 15.jcn3
- try at scheme in Atom

pl 15.jcn2 # rest of
- graphical-lisp-element + silly half hook-up with autuplet

34 files changed:
NEWS
VERSION
configure.in
init/declarations.ly
init/scm.ly [new file with mode: 0644]
lily/atom.cc
lily/auto-plet-engraver.cc
lily/engraver.cc
lily/graphical-lisp-element.cc [new file with mode: 0644]
lily/include/atom.hh
lily/include/auto-plet-engraver.hh
lily/include/engraver.hh
lily/include/graphical-lisp-element.hh [new file with mode: 0644]
lily/include/lily-guile.hh
lily/include/lily-proto.hh
lily/include/lookup.hh
lily/include/paper-outputter.hh
lily/include/ps-lookup.hh
lily/include/score-element-info.hh
lily/include/score-engraver.hh
lily/include/tex-lookup.hh
lily/lily-guile.cc [new file with mode: 0644]
lily/lookup.cc
lily/main.cc
lily/my-lily-lexer.cc
lily/paper-outputter.cc
lily/parser.yy
lily/ps-lookup.cc
lily/ps-outputter.cc
lily/score-element-info.cc
lily/score-engraver.cc
lily/tex-lookup.cc
lily/tex-outputter.cc
make/STATE-VECTOR

diff --git a/NEWS b/NEWS
index 4473e4ea12588d4a6701e8127bfe863b0b23e072..2dd704fb089073bc1d5c94463dc46a34f7e7663c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,15 @@
+pl 16.jcn1
+       - dashed-slur through scheme
+
+pl 15.jcn4
+       - more scheme hacks
+
+pl 15.jcn3
+       - try at scheme in Atom
+
+pl 15.jcn2 # rest of
+       - graphical-lisp-element + silly half hook-up with autuplet
+
 pl 16
        - read property ydirection and tieYDirection for tie direction.
        - bf: slur over rest.
diff --git a/VERSION b/VERSION
index 2021fd4c576b3e4f23b7d0a755ba7df0cab0a942..b9c75efb2e220741e46b58769edaf4468b1157c9 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=0
 PATCH_LEVEL=16
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 69f89668978f00cbe8f7d7413cd3738b8f3dc412..6209c8af22b971ac835a73ddcef9967c89308408 100644 (file)
@@ -42,7 +42,7 @@ AC_STEPMAKE_MSGFMT
 AC_STEPMAKE_TEXMF
 # AC_STEPMAKE_TEXMF_DIRS
 AC_STEPMAKE_YODL
-
+AC_CHECK_LIB(guile, scm_shell)
 
 dnl should check out -print
 dnl huh?
index d28a53c62f9492fbed5052b790879b471cfd9577..c1bc0fd333b3e8ac2e9f5ee5944390a40fd266f1 100644 (file)
@@ -35,5 +35,7 @@ nobreak = { \penalty = -10000; }
 
 \include "property.ly"
 
+\include "scm.ly"
+
 % music = "\melodic\relative c"
 
diff --git a/init/scm.ly b/init/scm.ly
new file mode 100644 (file)
index 0000000..0c56301
--- /dev/null
@@ -0,0 +1,30 @@
+\scm "
+
+(define (add-column p) (display \"adding column (in guile): \") (display p) (newline))
+
+(define
+  (control->string c)
+  (string-append
+    (string-append (number->string (car c)) \" \")
+    (string-append (number->string (cadr c)) \" \")))
+
+(define 
+  (dashed-slur-ps thick dash l)
+  (string-append 
+    (apply string-append (map control->string l)) 
+    (number->string thick) 
+   \" [ 0 \" (number->string dash) \" ] 0 draw_dashed_slur\"))
+
+(define 
+  (dashed-slur-tex thick dash l)
+  (string-append 
+    \"\\embedded_ps{\"
+    (dashed-slur-ps thick dash l)
+   \"}\"))
+
+(define 
+  (dashed-slur o thick dash l) 
+  ((eval-string (string-append \"dashed-slur-\" o)) thick dash l))
+
+";
+
index 76b59197d39219634b934a0f5761588a76705558..3f79970b7154d1ad8f369db4c40ec088a7e7cfd8 100644 (file)
@@ -76,12 +76,14 @@ Atom::Atom ()
     But Atom is used as a simple type *everywhere*,
     and we don't have virtual contructors.
    */
+  lambda_ = 0;
   str_ = global_lookup_l->unknown_str ();
 }
 
 Atom::Atom (String s, Box b)
   :  dim_ (b)
 {
+  lambda_ = 0;
   str_ = s;
 }
 
index 8812f6245c4e728e5563f31faffcbc0612a9d0ca..3ed45b2a46eb6390d17a60a4e1bf0f847f0b708d 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "auto-plet-engraver.hh"
 #include "command-request.hh"
-#include "slur.hh"
+#include "graphical-lisp-element.hh"
 #include "note-column.hh"
 
 bool
@@ -27,12 +27,11 @@ Tuplet_engraver::do_try_request (Request *r)
   return true;
 }
 
-
 void
 Tuplet_engraver::do_process_requests ()
 {
   int stopcount =0;
-  Link_array<Slur> start_arr;
+  Link_array<Graphical_lisp_element> start_arr;
   
   for (int i=0; i < bracket_req_arr_.size (); i++)
     {
@@ -40,16 +39,17 @@ Tuplet_engraver::do_process_requests ()
        stopcount++;
       if (bracket_req_arr_[i]->spantype == Span_req::START)
        {
-         Slur *sp =new Slur;
-         start_arr.push  (sp);
-         announce_element (Score_element_info (sp, bracket_req_arr_[i]));
+         Graphical_lisp_element* glep = new Graphical_lisp_element ("tuplet");
+         start_arr.push  (glep);
+// lots of stuff does info->elem_l_->is_type ()
+//       announce_element (Score_element_info (glep, bracket_req_arr_[i]));
        }
     }
 
   for (; stopcount--; )
     {
-      Slur *sp = started_span_p_arr_.pop ();
-      stop_now_span_p_arr_.push (sp);
+      Graphical_lisp_element* glep = started_span_p_arr_.pop ();
+      stop_now_span_p_arr_.push (glep);
     }
 
   for (int i=0; i < start_arr.size (); i++)
@@ -63,7 +63,8 @@ Tuplet_engraver::acknowledge_element (Score_element_info i)
     {
       Note_column *nc = (Note_column*)i.elem_l_->access_Item ();
       for (int j =0; j  <started_span_p_arr_.size (); j++)
-       started_span_p_arr_[j]->add_column (nc);
+//     started_span_p_arr_[j]->add_column (nc);
+       started_span_p_arr_[j]->call ("add-column", (void*)nc);
     }
 }
 
index ecad05587023cc8ee2a188e9357a5bb31168b3d7..3ecd606e926d24265882f807ab0be7976b215273 100644 (file)
@@ -26,13 +26,18 @@ Engraver::announce_element (Score_element_info i)
   daddy_grav_l()->announce_element (i);
 }
 
-
 void
 Engraver::typeset_element (Score_element*p)
 {
   daddy_grav_l()->typeset_element (p);
 }
 
+void
+Engraver::typeset_element (Graphical_lisp_element*p)
+{
+  daddy_grav_l ()->typeset_element (p);
+}
+
 Paper_def*
 Engraver::paper() const
 {
diff --git a/lily/graphical-lisp-element.cc b/lily/graphical-lisp-element.cc
new file mode 100644 (file)
index 0000000..8b9fdef
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+  graphical-lisp-element.cc -- implement Graphical_lisp_element
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "graphical-lisp-element.hh"
+#include "string.hh"
+#include "debug.hh"
+
+#undef IMPLEMENT_STATIC_NAME
+#define IMPLEMENT_STATIC_NAME(c)\
+char const* c::static_name ()\
+{ return type_str_.ch_C (); }\
+size_t c::static_class_size () { return sizeof (c); }
+
+IMPLEMENT_IS_TYPE_B (Graphical_lisp_element);
+
+Graphical_lisp_element::Graphical_lisp_element (String str)
+{
+  type_str_ = str;
+}
+
+void*
+Graphical_lisp_element::access (String str)
+{
+  SCM scm;
+//  scm = gh_cons (gh_str02scm (str.ch_C ()));
+//  scm = gh_cons (gh_symbol2scm (str.ch_C ()));
+  return 0;
+}
+
+void
+Graphical_lisp_element::call (String str, void* p)
+{
+//  gh_apply (str.ch_C (), SCM_EOL);
+//  gh_apply (str.ch_C (), SCM_EOL);
+
+// mm, common lisp only?
+//  String ptr = to_str (" \\%x", p);
+  String ptr = to_str (" '%x", p);
+  str = "(" + str + ptr + ")";
+  gh_eval_str (str.ch_l ());
+//  gh_eval_str ("(add-column 0)");
+}
index 0d88e7ce315cbba217a753c552fdc4c15f32e6f1..fcd434f0ab4f3e0226c2a375edf394f80001f17f 100644 (file)
@@ -9,17 +9,18 @@
 #ifndef ATOM_HH
 #define ATOM_HH
 
+#include "lily-guile.hh"
 #include "string.hh"
 #include "box.hh"
 #include "lily-proto.hh"
 
-
 /// a symbol which can be translated, and freely copied
 class Atom {
   Offset off_;
 public:
   String str_;
   String font_;
+  SCM lambda_;
   Box dim_;
 
   Offset offset () const;
index a8cafb9c7c414d1c558836a6fb28daf4a688608f..14b1fefcc44c731637cc15015dae3ace065bf973 100644 (file)
@@ -23,8 +23,8 @@ public:
 protected:
   Link_array<Bracket_req> bracket_req_arr_;
 
-  Link_array<Slur> started_span_p_arr_;
-  Link_array<Slur> stop_now_span_p_arr_;
+  Link_array<Graphical_lisp_element> started_span_p_arr_;
+  Link_array<Graphical_lisp_element> stop_now_span_p_arr_;
 
   virtual void do_removal_processing ();
   virtual void acknowledge_element (Score_element_info);
index a8086af1f556cc3d09b79d9b6bff25830c0e4dd4..04fc21baa5f1e4314fb566380943e0a61b1fdf9e 100644 (file)
@@ -36,6 +36,7 @@ protected:
     Invoke walker method to typeset element. Default: pass on to daddy.
     */
   virtual void typeset_element (Score_element*elem_p);
+  virtual void typeset_element (Graphical_lisp_element*);
     
   /**
     take note of item/spanner
diff --git a/lily/include/graphical-lisp-element.hh b/lily/include/graphical-lisp-element.hh
new file mode 100644 (file)
index 0000000..036b727
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+  graphical-lisp-element.hh -- declare Graphical_lisp_element
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+
+#ifndef GRAPHICAL_LISP_ELEMENT_HH
+#define GRAPHICAL_LISP_ELEMENT_HH
+
+#include "lily-guile.hh"
+#include "lily-proto.hh"
+#include "string.hh"
+
+#define virtual
+#define static
+#include "virtual-methods.hh"
+
+class Graphical_lisp_element 
+{
+public:
+  DECLARE_MY_RUNTIME_TYPEINFO;
+
+  Graphical_lisp_element (String);
+
+  void* access (String);
+  void call (String, void*);
+
+private:
+  String type_str_;
+};
+
+#undef virtual
+#undef static
+
+#endif // GRAPHICAL_LISP_ELEMENT_HH
+
index 1ea707038e2bb00c1e42cabce794287d8e1992c2..845a2a1f87d4912c2a6d5c1976624291350901c8 100644 (file)
 
 #include "config.hh"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef HAVE_LIBGUILE
 extern "C" { 
 #include <guile/gh.h> 
@@ -18,4 +22,17 @@ extern "C" {
 #else
 typedef long SCM;
 #endif
+
+SCM gh_append (SCM a, SCM b);
+SCM gh_eval (SCM a);
+SCM gh_func_o (char const* name);
+SCM gh_lambda_o ();
+SCM gh_list1 (SCM a);
+SCM gh_list2(SCM a, SCM b);
+SCM gh_quote ();
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif // LILY_GUILE_HH
index b7af83ec1620ba502e2518e234f8b0dfa390ec75..184eec14c0f3f928978279667f83b918551c19bd 100644 (file)
@@ -77,6 +77,7 @@ struct Element_group_item;
 struct Engraver_group_engraver;
 struct General_script_def;
 struct Graphical_element;
+struct Graphical_lisp_element;
 struct Graphical_axis_group;
 struct Mark_req;
 struct Music_output;
index 7efe60bb7e5c03fa4d4d06e7a2c32455c0a887ba..493b1b735e16e4064562c7a79ad56afe6f342756 100644 (file)
@@ -40,7 +40,7 @@ public:
   Atom beam (Real,Real, Real) const;
   virtual String character_str (int i) const;
   Atom clef (String) const;
-  virtual Atom dashed_slur (Array<Offset> controls, Real thick, Real dash) const = 0;
+  virtual Atom dashed_slur (Array<Offset> controls, Real thick, Real dash) const;
   Atom dots () const;
   Atom dynamic (String) const;
   Atom fill (Box b) const;
index 5fa1204b2f5c18088a1d896bb4f0c267f597c36c..0c6ff778dfce363f0c7079b6bc14c90fedd798e6 100644 (file)
@@ -24,7 +24,7 @@ public:
   virtual ~Paper_outputter ();
 
   virtual void output_molecule (Molecule const *, Offset, char const *)=0;
-  void output_molecule (Molecule const *, Offset, char const *, String);
+  void output_molecule (Molecule const *, Offset, char const *, String, String);
   virtual void start_line ()=0;
   virtual void stop_line ()=0;
   virtual void switch_to_font (String fontname)=0;
index 2eb9ed025a934d6b8a8e58ffcac6ceaf3a6fad84..0b6481be6dd0c44a9edeae484d9918f98f90956b 100644 (file)
@@ -22,7 +22,6 @@ public:
   virtual Atom afm_find (String s) const;
   virtual Atom* atom_p (String, int, Box) const;
   virtual String character_str (int i) const;
-  virtual Atom dashed_slur (Array<Offset> controls, Real thick, Real dash) const;
   virtual Atom hairpin (Real width, bool decresc, bool continued) const;
   virtual Lookup* lookup_p (Lookup const&) const;
   virtual Lookup* lookup_p (Symtables const&) const;
index 95d69a0d484a2929bdbb6433e15a95a83ad44b92..34a5a497168ef1b3cdf5f9dc1fce859cdc9c0fd1 100644 (file)
   */
 struct Score_element_info {
     Score_element * elem_l_;
+    Graphical_lisp_element * lisp_l_;
     Request*req_l_;
     Array<Engraver*> origin_grav_l_arr_;
 
     Score_element_info (Score_element*, Request*);
+    Score_element_info (Graphical_lisp_element*, Request*);
     Score_element_info();
 };
 
index 5d59fc06f7d1c399984f88b8c7a105d7a7469f6e..2f7883bb418c58102f28504e86331062233c3505 100644 (file)
@@ -53,6 +53,7 @@ protected:
   virtual void announce_element (Score_element_info);
   virtual void do_announces();
   virtual void typeset_element (Score_element*elem_p);
+  virtual void typeset_element (Graphical_lisp_element*elem_p);
   virtual void do_pre_move_processing();
   virtual void do_add_processing ();
 };
index cdb9839fcc5f3c685b0b4648be8a2e42e0892816..2341c4484c74bbcb0bc306f240cedb7f62d94f1f 100644 (file)
@@ -22,7 +22,6 @@ public:
 
   virtual Atom afm_find (String s) const;
   virtual String character_str (int i) const;
-  virtual Atom dashed_slur (Array<Offset> controls, Real thick, Real dash) const;
   virtual Atom* atom_p (String, int, Box) const;
   Atom embed (Atom a) const;
   virtual Atom hairpin (Real width, bool decresc, bool continued) const;
diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc
new file mode 100644 (file)
index 0000000..a5c47bd
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+  lily-guile.cc -- implement assorted guile functions
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "lily-guile.hh"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SCM
+gh_append (SCM a, SCM b)
+{
+  return gh_call2 (gh_eval_str ("append"), a, b);
+}
+
+SCM
+gh_list1 (SCM a)
+{
+  return gh_call1 (gh_eval_str ("list"), a);
+}
+
+SCM
+gh_list2(SCM a, SCM b)
+{
+  return gh_call2 (gh_eval_str ("list"), a, b);
+}
+
+SCM
+gh_quote ()
+{
+  return gh_eval_str ("'quote");
+}
+
+SCM
+gh_eval (SCM a)
+{
+  return gh_call1 (gh_eval_str ("eval"), a);
+}
+
+SCM
+gh_lambda_o ()
+{
+  return gh_eval_str ("'(lambda (o))");
+}
+
+SCM
+gh_func_o (char const* name)
+{
+  char buf[200];
+  snprintf (buf, 200, "'(%s o)", name);
+  return gh_eval_str (buf);
+}
+
+#ifdef __cplusplus
+}
+#endif
index 8ba88483f5f080c3bf4fdf17d0a2274863318bf8..7f67472b141f8cde8201cfe75a1c47997c5430f7 100644 (file)
@@ -20,6 +20,7 @@
 #include "paper-def.hh"
 #include "string-convert.hh"
 #include "main.hh"
+#include "lily-guile.hh"
 
 Lookup::Lookup ()
 {
@@ -150,6 +151,58 @@ Lookup::clef (String st) const
   return afm_find (String ("clefs") + String ("-") + st);
 }
 
+Atom
+Lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
+{
+  assert (controls.size () == 8);
+
+  Real dx = controls[3].x () - controls[0].x ();
+  Real dy = controls[3].y () - controls[0].y ();
+
+  Atom a;
+  a.font_ = font_;
+  a.dim_[X_AXIS] = Interval (0, dx);
+  a.dim_[Y_AXIS] = Interval (0 <? dy,  0 >? dy);
+
+#ifndef HAVE_LIBGUILE
+
+  String ps;
+  for (int i = 1; i < 4; i++)
+    ps += String_convert::double_str (controls[i].x ()) + " "
+      + String_convert::double_str (controls[i].y ()) + " ";
+
+  ps += String_convert::double_str (controls[0].x ()) + " "
+    + String_convert::double_str (controls[0].y ()) + " ";
+
+  ps += String_convert::double_str (thick) + " ";
+  Real on = dash > 1? thick * dash - thick : 0;
+  Real off = 2 * thick;
+  ps += "[" + String_convert::double_str (on) + " ";
+  ps += String_convert::double_str (off) + "] ";
+  ps += String_convert::int_str (0) + " ";
+  ps += "draw_dashed_slur ";
+
+  a.str_ = ps;
+
+#else // HAVE_LIBGUILE
+
+  // (lambda (o) (dashed-slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2))))
+  a.lambda_ = 
+    gh_append (gh_lambda_o (), 
+    gh_list1 (gh_append (gh_func_o ("dashed-slur"),
+    gh_cons (gh_double2scm (thick), gh_cons (gh_double2scm (dash),
+    gh_list1 (gh_list2 (gh_quote (),
+    gh_cons (gh_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())),
+    gh_cons (gh_list2 (gh_double2scm (controls[1].x ()), gh_double2scm (controls[1].y ())),
+    gh_cons (gh_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())),
+    gh_cons (gh_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())),
+    SCM_EOL)))))))))));
+
+#endif // HAVE_LIBGUILE
+
+  return a;
+}
+
 Atom
 Lookup::dots () const
 {
index 87af66cfe98a04db6f1ca30bc3cdc02ce891e352..74543baf2cc819e3f34afd6f0e6e59f628b9aa72 100644 (file)
@@ -10,6 +10,8 @@
 #include <iostream.h>
 #include <assert.h>
 #include <locale.h>
+#include "lily-guile.hh"
+
 #include "proto.hh"
 #include "dimensions.hh"
 #include "plist.hh"
@@ -186,19 +188,9 @@ identify ()
   *mlog << get_version_str () << endl;
 }
 
-void 
-guile_init ()
-{
-#ifdef   HAVE_LIBGUILE
-   gh_eval_str ("(define (add-column p) (display \"adding column (in guile): \") (display p) (newline))");
-#endif
-}
-
-int
+void
 main_prog (int argc, char **argv)
 {
-  guile_init ();
-  
   // facilitate binary distributions
   char const *env_lily = getenv ("LILYPONDPREFIX");
   String prefix_directory;
@@ -251,6 +243,7 @@ main_prog (int argc, char **argv)
        case 't':
          experimental_features_global_b = true;
          global_lookup_l = &ps_lookup;
+         *mlog << "*** enabling experimental features, you're on your own now ***\n";
          break;
        case 'o':
          outname_str = oparser.optional_argument_ch_C_;
@@ -336,8 +329,18 @@ main_prog (int argc, char **argv)
        default_outname_base_global = outname_str;
       do_one_file (i, default_outname_base_global);
     }
+}
 
+int
+main (int argc, char **argv)
+{
+#ifdef HAVE_LIBGUILE
+  gh_enter (argc, argv, (void(*)())main_prog);
+  return exit_status_i_;
+#else
+  main_prog (argc, argv);
   return exit_status_i_;
+#endif
 }
 
 /*
@@ -377,19 +380,3 @@ distill_inname_str (String name_str, String& ext_r)
   return str;
 }
 
-
-#ifdef HAVE_LIBGUILE
-int
-main (int argc, char **argv)
-{
-  gh_enter (argc, argv, (void(*)())main_prog);
-  return exit_status_i_;
-}
-
-#else
-int main (int argc, char **argv)
-{
-  return main_prog (argc, argv);
-}
-
-#endif
index 82948a3067447e6fe31c043f95d8257895575015..4c7d05a9a22ca8b6b561a2eb8965319592e72f29 100644 (file)
@@ -55,6 +55,7 @@ static Keyword_ent the_key_tab[]={
   {"pt", PT_T},
   {"relative", RELATIVE},
   {"remove", REMOVE},
+  {"scm", SCHEME},
   {"score", SCORE},
   {"script", SCRIPT},
   {"shape", SHAPE},
index 1e8d450c7b31b2969df751f4e66dbf555371b6c5..2ecf72a5ca87e62a968b1bfa35490ba9c4d5ccc5 100644 (file)
@@ -27,7 +27,7 @@ Paper_outputter::~Paper_outputter ()
 }
 
 void
-Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm, String s)
+Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm, String s, String output_str)
 {
   if (check_debug)
     *outstream_l_ << String ("\n%start: ") << nm << "\n";
@@ -44,7 +44,15 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm, St
   
       a.push (global_lookup_l->print_dimen (a_off.y()));
       a.push (global_lookup_l->print_dimen (a_off.x()));
-      a.push (i->str_);
+      if (i->lambda_)
+        {
+         SCM str_scm = gh_call1 (gh_eval (i->lambda_), gh_eval_str ("'ps"));
+         char* c = gh_scm2newstr (str_scm, NULL);
+         a.push (String (c));
+         free (c);
+       }
+      else
+       a.push (i->str_);
       r += global_lookup_l->substitute_args (s, a);
       *outstream_l_ << r;
     }
index 428fff3c373f0611941608fd4249e2dd61eb881e..c73b8b812bf7819623c1ed5b2fd08609a476685f 100644 (file)
@@ -10,6 +10,7 @@
 */
 
 #include <iostream.h>
+#include "lily-guile.hh"
 #include "notename-table.hh"
 #include "scalar.hh"
 #include "translation-property.hh"
@@ -195,6 +196,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %token PT_T
 %token RELATIVE
 %token REMOVE
+%token SCHEME /* token vs typedef;  can't be named SCM */
 %token SCORE
 %token SCRIPT
 %token SHAPE
@@ -321,8 +323,18 @@ toplevel_expression:
                        Midi_def_identifier ($1, MIDI_IDENTIFIER);
                THIS->lexer_p_->set_identifier ("$defaultmidi", id)
        }
+       | embedded_scm { 
+       }
        ;
 
+embedded_scm:
+       SCHEME STRING ';' {
+       #ifdef HAVE_LIBGUILE
+               gh_eval_str ($2->ch_C ());
+       #endif
+               delete $2;
+       };
+
 check_version:
        VERSION STRING ';'              {
                Mudela_version ver (*$2);
index 8d160b1f88a50e98a77d873d832413bc73d9b61b..e0978b7b455f3551874dac4d2674567273c7b7ff 100644 (file)
@@ -62,40 +62,6 @@ Ps_lookup::character_str (int i) const
   return to_str (i, "(\\%03o)");
 }
 
-Atom
-Ps_lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
-{
-  assert (controls.size () == 8);
-
-  String ps;
-  
-  Real dx = controls[3].x () - controls[0].x ();
-  Real dy = controls[3].y () - controls[0].y ();
-
-  for (int i = 1; i < 4; i++)
-    ps += String_convert::double_str (controls[i].x ()) + " "
-      + String_convert::double_str (controls[i].y ()) + " ";
-
-  ps += String_convert::double_str (controls[0].x ()) + " "
-    + String_convert::double_str (controls[0].y ()) + " ";
-
-  ps += String_convert::double_str (thick) + " ";
-  Real on = dash > 1? thick * dash - thick : 0;
-  Real off = 2 * thick;
-  ps += "[" + String_convert::double_str (on) + " ";
-  ps += String_convert::double_str (off) + "] ";
-  ps += String_convert::int_str (0) + " ";
-  ps += "draw_dashed_slur ";
-
-  Atom a;
-  a.str_ = ps;
-  
-  a.dim_[X_AXIS] = Interval (0, dx);
-  a.dim_[Y_AXIS] = Interval (0 <? dy,  0 >? dy);
-  a.font_ = font_;
-  return a;
-}
-
 Atom
 Ps_lookup::hairpin (Real width, bool decresc, bool continued) const
 {
index d0ad70ef39045c954d357af0b5a73dc3328238b2..4600f9b40df1d75f59346a79b145e0f0e5c8e199 100644 (file)
@@ -14,6 +14,8 @@
 #include "array.hh"
 #include "string-convert.hh"
 #include "debug.hh"
+#include "lookup.hh"
+#include "main.hh"
 
 Ps_outputter::Ps_outputter (Paper_stream *s)
   :Paper_outputter (s)
@@ -62,7 +64,7 @@ Ps_outputter::output_molecule (Molecule const*m, Offset o, char const *nm)
   if (check_debug)
     *outstream_l_ << String ("\n%start: ") << nm << "\n";
 
-  Paper_outputter::output_molecule (m, o, nm, "% % {%}placebox \n");
+  Paper_outputter::output_molecule (m, o, nm, "% % {%}placebox \n", "'ps");
 }
 
 void
index a0c6f68e8552a8047866cc42351ec8da649d5f2b..8288c16cc1ee1bde71f30e32c6f93ec1fb8fe93b 100644 (file)
 Score_element_info::Score_element_info (Score_element*s_l, Request*r_l)
 {
   elem_l_ = s_l;
+  lisp_l_ = 0;
+  req_l_ = r_l;
+}
+
+Score_element_info::Score_element_info (Graphical_lisp_element*g_l, Request*r_l)
+{
+  elem_l_ = 0;
+  lisp_l_ = g_l;
   req_l_ = r_l;
 }
 
 Score_element_info::Score_element_info()
 {
   elem_l_ = 0;
+  lisp_l_ = 0;
   req_l_ = 0;
 }
 
index 1b30731fd710d69d6e5f80516fb1e6adf5433d2d..1c43b8c59e9b0b39810090572a2ff09be0793026 100644 (file)
@@ -16,6 +16,7 @@
 #include "score-column.hh"
 #include "command-request.hh"
 #include "paper-def.hh"
+#include "graphical-lisp-element.hh"
 
 
 Score_engraver::Score_engraver()
@@ -117,7 +118,14 @@ Score_engraver::do_announces()
 void
 Score_engraver::typeset_element (Score_element *elem_p)
 {
-  elem_p_arr_.push(elem_p);
+  elem_p_arr_.push (elem_p);
+}
+
+void
+Score_engraver::typeset_element (Graphical_lisp_element* elem_p)
+{
+  *mlog << "not typesetting: " << elem_p->static_name () << "\n";
+  delete elem_p;
 }
 
 void
@@ -131,9 +139,7 @@ Score_engraver::typeset_all()
          Spanner *s = elem_p->access_Spanner ();
          pscore_p_->typeset_unbroken_spanner (s);
 
-
-
-                 /*
+           /*
            do something sensible if spanner not 
            spanned on 2 items.
           */
@@ -228,7 +234,6 @@ Score_engraver::get_staff_info() const
 }
 
 
-
 Music_output*
 Score_engraver::get_output_p ()
 {
index 4f10886e117fb6b6564d5ea1618df7e1a0cc76fa..2e774352af472fc7373d149cbc78b326dbea32c3 100644 (file)
@@ -63,12 +63,6 @@ Tex_lookup::character_str (int i) const
   return Lookup::character_str (i);
 }
 
-Atom
-Tex_lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
-{
-  return embed (Ps_lookup::dashed_slur (controls, thick, dash));
-}
-
 Atom
 Tex_lookup::embed (Atom a) const
 {
index 89ebf316237399c3cc5afa0fc84c70e44b287b3e..df6a43268a56d5d49f3546a3241bfded5a5327a5 100644 (file)
@@ -60,7 +60,7 @@ Tex_outputter::output_molecule (Molecule const*m, Offset o, char const *nm)
   if (check_debug)
     *outstream_l_ << String ("\n%start: ") << nm << "\n";
 
-  Paper_outputter::output_molecule (m, o, nm, "\\placebox{%}{%}{%}");
+  Paper_outputter::output_molecule (m, o, nm, "\\placebox{%}{%}{%}", "'tex");
 }
 
 void
index 010ed0a6f9f41dede4e7456fd1dd31c32c040e0e..966c59a4a2462253af89baedb3603464a609e8ae 100644 (file)
 1.0.15
 1.0.15.uu1
 1.0.16
+1.0.16.jcn1