]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/context.cc
* scm/define-context-properties.scm (Module): change definition of
[lilypond.git] / lily / context.cc
index 3a4a875ec1f05cde55eaced15f517b577fdbd4db..75b378c8f3126926416c119d82e49ff04b09a648 100644 (file)
@@ -21,16 +21,15 @@ bool
 Context::is_removable () const
 {
   return context_list_ == SCM_EOL && ! iterator_count_ &&
-         !dynamic_cast<Score_context const*> (this)
-    ;
+         !dynamic_cast<Score_context const*> (this);
 }
 
 void
 Context::check_removal ()
 {
-  for (SCM p = context_list_; ly_c_pair_p (p); p = ly_cdr (p))
+  for (SCM p = context_list_; scm_is_pair (p); p = scm_cdr (p))
     {
-      Context *trg =  unsmob_context (ly_car (p));
+      Context *trg =  unsmob_context (scm_car (p));
 
       trg->check_removal ();
       if (trg->is_removable ())
@@ -175,8 +174,8 @@ Context::find_create_context (SCM n, String id,
 SCM
 Context::default_child_context_name () const
 {
-  return ly_c_pair_p (accepts_list_)
-    ? ly_car (scm_last_pair (accepts_list_))
+  return scm_is_pair (accepts_list_)
+    ? scm_car (scm_last_pair (accepts_list_))
     : SCM_EOL;
 }
 
@@ -184,7 +183,7 @@ Context::default_child_context_name () const
 bool
 Context::is_bottom_context () const
 {
-  return !ly_c_symbol_p (default_child_context_name ());
+  return !scm_is_symbol (default_child_context_name ());
 }
 
 Context*
@@ -245,7 +244,7 @@ bool
 Context::is_alias (SCM sym) const
 {
   if (sym == ly_symbol2scm ("Bottom")
-      && !ly_c_pair_p (accepts_list_))
+      && !scm_is_pair (accepts_list_))
     return true;
   if (sym == unsmob_context_def (definition_)->get_context_name ())
     return true;
@@ -309,9 +308,9 @@ find_context_below (Context * where,
   
   Context * found = 0;
   for (SCM s = where->children_contexts ();
-       !found && ly_c_pair_p (s); s = ly_cdr (s))
+       !found && scm_is_pair (s); s = scm_cdr (s))
     {
-      Context * tr = unsmob_context (ly_car (s));
+      Context * tr = unsmob_context (scm_car (s));
 
       found = find_context_below (tr, type, id);
     }
@@ -325,19 +324,25 @@ Context::properties_as_alist () const
   return properties_dict ()->to_alist ();
 }
 
-String
-Context::context_name () const
+SCM
+Context::context_name_symbol () const
 {
   Context_def * td = unsmob_context_def (definition_ );
-  return ly_symbol2string (td->get_context_name ());
+  return td->get_context_name ();
 }
 
+String
+Context::context_name () const
+{
+  return  ly_symbol2string (context_name_symbol ());
+}
 
 Score_context*
 Context::get_score_context () const
 {
-  if (Score_context *sc =dynamic_cast<Score_context*> ((Context*)this))
+  if (Score_context *sc =dynamic_cast<Score_context*> ((Context*) this))
     return sc;
+  
   else if (daddy_context_)
     return daddy_context_->get_score_context ();
   else
@@ -365,7 +370,7 @@ Context::now_mom () const
 int
 Context::print_smob (SCM s, SCM port, scm_print_state *)
 {
-  Context *sc = (Context *) ly_cdr (s);
+  Context *sc = (Context *) SCM_CELL_WORD_1 (s);
      
   scm_puts ("#<", port);
   scm_puts (classname (sc), port);