]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/mark-engraver.cc
patch::: 1.3.63.uu1: Re: Lilypond?
[lilypond.git] / lily / mark-engraver.cc
index 0c2b543d465c02acc38006f2e221b4e11bf55466..019e36736182f5aed63a32140826215c47a87983 100644 (file)
@@ -6,9 +6,8 @@
  (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-
+#include <ctype.h>
 #include "bar.hh"
-#include "clef-item.hh"
 #include "command-request.hh"
 #include "dimension-cache.hh"
 #include "engraver-group-engraver.hh"
@@ -20,7 +19,8 @@
 #include "side-position-interface.hh"
 #include "staff-symbol-referencer.hh"
 #include "staff-symbol.hh"
-#include "text-item.hh"
+#include "item.hh"
+#include "group-interface.hh"
 
 /**
   put stuff over or next to  bars.  Examples: bar numbers, marginal notes,
@@ -32,8 +32,7 @@ public:
   VIRTUAL_COPY_CONS(Translator);
   Mark_engraver ();
 protected:
-  Text_item* text_p_;
-  Protected_scm visibility_lambda_;
+  Item* text_p_;
   Protected_scm staffs_;
   
 protected:
@@ -62,15 +61,9 @@ Mark_engraver::Mark_engraver ()
 void
 Mark_engraver::do_creation_processing ()
 {
-  String t = "markVisibilityFunction";
-  SCM proc = get_property (t);
-
-  if (gh_procedure_p (proc))
-    visibility_lambda_ = proc;
 }
 
 
-
 void
 Mark_engraver::acknowledge_element (Score_element_info inf)
 {
@@ -83,7 +76,7 @@ Mark_engraver::acknowledge_element (Score_element_info inf)
     {
       /*
        Ugh. Figure out how to do this right at beginning of line, (without
-       creating class Bar_script : public Text_item).
+       creating class Bar_script : public Item).
       */
       text_p_->set_parent (s, X_AXIS);
     }
@@ -94,7 +87,7 @@ Mark_engraver::do_pre_move_processing ()
 {
   if (text_p_)
     {
-      text_p_->set_elt_property ("side-support" , staffs_);
+      text_p_->set_elt_pointer("side-support-elements" , staffs_);
       typeset_element (text_p_);
       text_p_ =0;
     }
@@ -106,12 +99,17 @@ Mark_engraver::create_items (Request *rq)
 {
   if (text_p_)
     return;
-  
-  text_p_ = new Text_item;
-  text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh
+
+  SCM s = get_property ("basicMarkProperties");
+  text_p_ = new Item (s);
+
+  Group_interface (text_p_, "interfaces").add_thing (ly_symbol2scm ("Mark"));
   Side_position_interface staffside(text_p_);
   staffside.set_axis (Y_AXIS);
 
+  /*
+    -> Generic props.
+   */
   SCM prop = get_property ("markDirection");
   if (!isdir_b (prop))
     {
@@ -131,9 +129,6 @@ Mark_engraver::create_items (Request *rq)
                            gh_double2scm(paper_l ()->get_var ("interline")));
     }
 
-  if (gh_procedure_p (visibility_lambda_))
-      text_p_->set_elt_property ("visibility-lambda",
-                                visibility_lambda_);
   
   announce_element (Score_element_info (text_p_, rq));
 }
@@ -206,8 +201,17 @@ Mark_engraver::do_process_music ()
       
       text_p_->set_elt_property ("text",
                                 ly_str02scm ( t.ch_C()));
-      SCM st = ly_str02scm ((t.index_any_i ("0123456789")  >= 0 )
-                           ? "mark" : "large");
+
+      String style = "mark";
+      for (int i=0; i < t.length_i(); i++)
+       {
+         if (!isdigit(t[i])) 
+           {
+             style = "large";
+             break;
+           }
+       }
+      SCM st = ly_str02scm (style.ch_C());
       text_p_->set_elt_property ("style",  st);
     }
 }