]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/mark-engraver.cc
release: 1.3.78
[lilypond.git] / lily / mark-engraver.cc
index 7f79b1d2103ab0ef9ccab32710c84dc1f8c15081..0f2df8fcdf5e3b05744eb83ad47bbdfe92d6e83d 100644 (file)
@@ -8,9 +8,8 @@
 
 #include <ctype.h>
 #include "bar.hh"
-#include "clef-item.hh"
 #include "command-request.hh"
-#include "dimension-cache.hh"
+#include "staff-symbol.hh"
 #include "engraver-group-engraver.hh"
 #include "engraver.hh"
 #include "lily-guile.hh"
@@ -19,8 +18,7 @@
 #include "protected-scm.hh"
 #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"
 
 /**
@@ -33,12 +31,10 @@ public:
   VIRTUAL_COPY_CONS(Translator);
   Mark_engraver ();
 protected:
-  Text_item* text_p_;
-  Protected_scm visibility_lambda_;
+  Item* text_p_;
   Protected_scm staffs_;
   
 protected:
-  virtual void do_creation_processing ();
   virtual void do_pre_move_processing ();
   virtual void acknowledge_element (Score_element_info);
   void create_items(Request*);
@@ -60,31 +56,21 @@ Mark_engraver::Mark_engraver ()
   staffs_ = SCM_EOL;
 }
 
-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)
 {
   Score_element * s = inf.elem_l_;
-  if (dynamic_cast<Staff_symbol*> (s))
+  if (Staff_symbol::has_interface (s))
     {
-      staffs_ = gh_cons (inf.elem_l_->self_scm_, staffs_);
+      staffs_ = gh_cons (inf.elem_l_->self_scm (), staffs_);
     }
-  else if (text_p_ && dynamic_cast<Bar*> (s))
+  else if (text_p_ && Bar::has_interface (s))
     {
       /*
        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);
     }
@@ -95,7 +81,7 @@ Mark_engraver::do_pre_move_processing ()
 {
   if (text_p_)
     {
-      text_p_->set_elt_pointer("side-support-elements" , staffs_);
+      text_p_->set_elt_property("side-support-elements" , staffs_);
       typeset_element (text_p_);
       text_p_ =0;
     }
@@ -107,13 +93,16 @@ 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
-  Group_interface (text_p_, "interfaces").add_thing (ly_symbol2scm ("Mark"));
-  Side_position_interface staffside(text_p_);
-  staffside.set_axis (Y_AXIS);
 
+  SCM s = get_property ("basicMarkProperties");
+  text_p_ = new Item (s);
+
+
+  Side_position::set_axis (text_p_, Y_AXIS);
+
+  /*
+    -> Generic props.
+   */
   SCM prop = get_property ("markDirection");
   if (!isdir_b (prop))
     {
@@ -133,11 +122,8 @@ 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));
+  announce_element (text_p_, rq);
 }
 
 
@@ -175,9 +161,11 @@ Mark_engraver::do_process_music ()
       /*
        automatic marks.
        */
-      SCM m = (mark_req_l_->mark_label_ == SCM_UNDEFINED)
-       ? get_property ("rehearsalMark")
-       : SCM(mark_req_l_->mark_label_);
+      
+      SCM m = mark_req_l_->get_mus_property ("label");
+      if (gh_string_p (m)) 
+       m =  get_property ("rehearsalMark");
+;
       
       if (gh_number_p (m))
        {