]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/system-start-delimiter-engraver.cc
* lily/lexer.ll: change is_string -> ly_c_string_p
[lilypond.git] / lily / system-start-delimiter-engraver.cc
index d8045610bd2754a531477974e537f1bfae3f211f..b5988eac2ab31cff528bcc6ac8c0383b248ed19a 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -18,7 +18,7 @@
 class System_start_delimiter_engraver : public Engraver
 {
 public:
-  TRANSLATOR_DECLARATIONS(System_start_delimiter_engraver);
+  TRANSLATOR_DECLARATIONS (System_start_delimiter_engraver);
 
 protected:
   Spanner * delim_;
@@ -42,21 +42,21 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf)
     }
   else if (System_start_delimiter::has_interface (inf.grob_))
     {
-      SCM gl = inf.grob_->get_grob_property ("glyph");
-      SCM my_gl = delim_->get_grob_property ("glyph");
+      SCM gl = inf.grob_->get_property ("glyph");
+      SCM my_gl = delim_->get_property ("glyph");
 
       /*
        UGH UGH
        */
-      if (gh_string_p (gl) && gh_equal_p (gl, scm_makfrom0str  ("brace"))
-         && gh_string_p (my_gl) && gh_equal_p (my_gl, scm_makfrom0str  ("bracket")))
+      if (ly_c_string_p (gl) && is_equal (gl, scm_makfrom0str  ("brace"))
+         && ly_c_string_p (my_gl) && is_equal (my_gl, scm_makfrom0str  ("bracket")))
        inf.grob_->translate_axis (-0.8, X_AXIS); // ugh
-      else if (gh_string_p (gl) && gh_equal_p (gl, scm_makfrom0str  ("bracket"))
-              && gh_string_p (my_gl) && gh_equal_p (my_gl, scm_makfrom0str  ("bracket")))
+      else if (ly_c_string_p (gl) && is_equal (gl, scm_makfrom0str  ("bracket"))
+              && ly_c_string_p (my_gl) && is_equal (my_gl, scm_makfrom0str  ("bracket")))
        {
          inf.grob_->translate_axis ( -0.8, X_AXIS); // ugh
-         inf.grob_->set_grob_property ("arch-height",
-           gh_double2scm(gh_scm2double(inf.grob_->get_grob_property
+         inf.grob_->set_property ("arch-height",
+                                      scm_make_real (ly_scm2double (inf.grob_->get_property
                                        ("arch-height"))+0.5));
        }
     }
@@ -73,7 +73,7 @@ System_start_delimiter_engraver::process_music ()
   if (!delim_)
     {
       SCM delim_name =get_property ("systemStartDelimiter");
-      delim_ = new Spanner (internal_get_property (delim_name));
+      delim_ = make_spanner_from_properties (get_parent_context (), delim_name);
 
       delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
       announce_grob (delim_, SCM_EOL);
@@ -82,11 +82,14 @@ System_start_delimiter_engraver::process_music ()
 void
 System_start_delimiter_engraver::finalize ()
 {
-  delim_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
-  typeset_grob (delim_);
+  if (delim_)
+    {
+      delim_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
+      typeset_grob (delim_);
+    }
 }
 
-ENTER_DESCRIPTION(System_start_delimiter_engraver,
+ENTER_DESCRIPTION (System_start_delimiter_engraver,
 /* descr */       "Creates a system start delimiter (ie. SystemStart@{Bar,Brace,Bracket@} spanner",
 /* creats*/       "SystemStartBar SystemStartBrace SystemStartBracket",
 /* accepts */     "",