]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.0.15.jcn2: pl2 voor riel
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 12 Oct 1998 20:07:58 +0000 (23:07 +0300)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 12 Oct 1998 20:07:58 +0000 (23:07 +0300)
pl 15.jcn2
- autoconf on guile
- graphical-lisp-element + silly half hook-up with autuplet
  (see init/test/tup.ly)

19 files changed:
NEWS
VERSION
configure.in
flower/include/virtual-methods.hh
input/test/tup.ly [new file with mode: 0644]
lily/auto-plet-engraver.cc
lily/engraver.cc
lily/graphical-lisp-element.cc [new file with mode: 0644]
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 [new file with mode: 0644]
lily/include/lily-proto.hh
lily/include/score-element-info.hh
lily/include/score-engraver.hh
lily/main.cc
lily/score-element-info.cc
lily/score-engraver.cc
make/STATE-VECTOR

diff --git a/NEWS b/NEWS
index 68ee27c246577242e63a9d5257f3631980b11352..11fe12c20663e527272fa95826629e0e2d7ed9e6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+pl 15.jcn2
+       - autoconf on guile
+       - graphical-lisp-element + silly half hook-up with autuplet
+         (see init/test/tup.ly)
+
 pl 15.jcn1
        - autoconf on mf,mfont mp,mpost
 
diff --git a/VERSION b/VERSION
index 90ec2ef1100794a7cff2f761b42c5f22243e9cc7..bddde17e0092518d9bde904cb764c9a82f744cfc 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=0
 PATCH_LEVEL=15
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=jcn2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 22893a11fe32865c5a92c14eb857a38af6bbcffa..d4a297075ff149ac74ae6396543b2b29004fc1c4 100644 (file)
@@ -37,7 +37,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 27557117e3c84fc2fe18934968ee38c6495863b7..39795ce1158a86a1f5184885ce7e01506cfa2768 100644 (file)
@@ -35,29 +35,31 @@ static char const *static_name()
   int  yet_another_stupid_function_to_allow_semicolon()
 
 
-#define DECLARE_VIRTUAL_COPY_CONS(T,R)\
+#define DECLARE_VIRTUAL_COPY_CONS(T, R)\
       virtual R *clone() const
-#define IMPLEMENT_VIRTUAL_COPY_CONS(T,R)\
-       R *T::clone() const { return  new T(*this); } \
+#define IMPLEMENT_VIRTUAL_COPY_CONS(T, R)\
+       R *T::clone() const { return  new T(*this); }\
+
     
-#define IMPLEMENT_IS_TYPE_B(D)                                                            \
-    IMPLEMENT_STATIC_NAME(D)\
-  bool D::static_is_type_b (const char *s)                                        \
-{                                                                                 \
-    return s == static_name();                                                    \
-}                                                                                 
-                                                                                  
-#define IMPLEMENT_IS_TYPE_B1(D,B)                                                 \
-       IMPLEMENT_STATIC_NAME(D)\
-  bool D::static_is_type_b (const char *s)                                                \
-{                                                                                 \
-    return s == static_name() || B::static_is_type_b (s);                                 \
-}                                                                                 
-#define IMPLEMENT_IS_TYPE_B2(D, BA, BB)                                                   \
-       IMPLEMENT_STATIC_NAME(D)\
-  bool D::static_is_type_b (const char *s)                                                \
-{                                                                                 \
-    return s == static_name() || BA::static_is_type_b (s) || BB::static_is_type_b (s); \
+#define IMPLEMENT_IS_TYPE_B(D)\
+  IMPLEMENT_STATIC_NAME(D)\
+  bool D::static_is_type_b (const char *s)\
+{\
+  return s == static_name();\
+}
+
+#define IMPLEMENT_IS_TYPE_B1(D, B)\
+  IMPLEMENT_STATIC_NAME(D)\
+  bool D::static_is_type_b (const char *s)\
+{\
+  return s == static_name() || B::static_is_type_b (s);\
+}
+
+#define IMPLEMENT_IS_TYPE_B2(D, BA, BB)\
+  IMPLEMENT_STATIC_NAME(D)\
+  bool D::static_is_type_b (const char *s)\
+{\
+  return s == static_name() || BA::static_is_type_b (s) || BB::static_is_type_b (s);\
 }
 
 #endif 
diff --git a/input/test/tup.ly b/input/test/tup.ly
new file mode 100644 (file)
index 0000000..010e77f
--- /dev/null
@@ -0,0 +1,3 @@
+\score{
+       \notes \type Staff \times 2/3 { a b c }
+}
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 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
+
diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh
new file mode 100644 (file)
index 0000000..2e626b2
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+  lily-guile.hh encapsulate guile
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#ifndef LILY_GUILE_HH
+#define LILY_GUILE_HH
+
+extern "C" { 
+#include <guile/gh.h> 
+}
+
+#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 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 33df5a1c83840b46686a2c2b62abae9da944831b..d6b90e1359a642fce662a98469abc1ca333f2bb6 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"
@@ -24,6 +26,7 @@
 #include "ps-lookup.hh"
 #include "tex-lookup.hh"
 
+
 #if HAVE_GETTEXT
 #include <libintl.h>
 #endif
@@ -185,9 +188,17 @@ identify ()
   *mlog << get_version_str () << endl;
 }
 
-int
-main (int argc, char **argv)
+void
+guile_init ()
 {
+   gh_eval_str ("(define (add-column p) (display \"adding column (in guile): \") (display p) (newline))");
+}
+
+void
+main_prog (int argc, char **argv)
+{
+  guile_init ();
+
   // facilitate binary distributions
   char const *env_lily = getenv ("LILYPONDPREFIX");
   String prefix_directory;
@@ -327,6 +338,13 @@ main (int argc, char **argv)
       do_one_file (i, default_outname_base_global);
     }
 
+//  return exit_status_i_;
+}
+
+int
+main (int argc, char **argv)
+{
+  gh_enter (argc, argv, (void(*)())main_prog);
   return exit_status_i_;
 }
 
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 79dc5319e7b36ac6f8e1fdba934b1f132adefc0e..26f86d5cafadd87d667e98c34941bbe0692f01ff 100644 (file)
 1.0.14.hwn1
 1.0.15
 1.0.15.jcn1
+1.0.15.jcn2