]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob-property.cc
* lily/context-def.cc (path_to_acceptable_context): bugfix, depth
[lilypond.git] / lily / grob-property.cc
index fc24bc184cfd84d25f6380667c531812335e2ee9..67401f226e881a1e19fccf28377aec6d8f309bd6 100644 (file)
@@ -1,8 +1,8 @@
 /*
   Implement storage and manipulation of grob properties.
- */
+*/
 
-#include <string.h>
+#include <cstring>
 #include <math.h>
 
 #include "main.hh"
 #include "group-interface.hh"
 #include "misc.hh"
 #include "paper-score.hh"
-#include "paper-def.hh"
-#include "grob.hh"
+#include "output-def.hh"
 #include "spanner.hh"
 #include "item.hh"
 #include "misc.hh"
 #include "item.hh"
 
-
 SCM
 Grob::get_property_alist_chain (SCM def) const
 {
@@ -27,25 +25,22 @@ Grob::get_property_alist_chain (SCM def) const
                     SCM_UNDEFINED);
 }
 
-
-
 /*
   This special add_thing routine is slightly more efficient than
 
-    set_prop (name,cons (thing, get_prop (name)))
+  set_prop (name, cons (thing, get_prop (name)))
 
   since it can reuse the handle returned by scm_assq ().
 */
 void
-Grob::add_to_list_property (SCM sym, SCM thing) 
+Grob::add_to_list_property (SCM sym, SCM thing)
 {
   SCM handle
-    = scm_sloppy_assq (sym, mutable_property_alist_)
-    ;
+    = scm_sloppy_assq (sym, mutable_property_alist_);
 
   if (handle != SCM_BOOL_F)
     {
-      scm_set_cdr_x (handle, scm_cons (thing, ly_cdr (handle)));
+      scm_set_cdr_x (handle, scm_cons (thing, scm_cdr (handle)));
     }
   else
     {
@@ -54,25 +49,24 @@ Grob::add_to_list_property (SCM sym, SCM thing)
        mutable prop list.
       */
       handle = scm_sloppy_assq (sym, immutable_property_alist_);
-      SCM tail = (handle != SCM_BOOL_F) ? ly_cdr (handle) : SCM_EOL;
+      SCM tail = (handle != SCM_BOOL_F) ? scm_cdr (handle) : SCM_EOL;
       SCM val = scm_cons (thing, tail);
 
       mutable_property_alist_ = scm_cons (scm_cons (sym, val),
-                                        mutable_property_alist_);
+                                         mutable_property_alist_);
     }
 }
 
-
 extern void check_interfaces_for_property (Grob const *me, SCM sym);
 
 void
 Grob::internal_set_property (SCM s, SCM v)
 {
   /* Perhaps we simply do the assq_set, but what the heck. */
-  if (!live ())
+  if (!is_live ())
     return;
 
-  if (internal_type_checking_global_b)
+  if (do_internal_type_checking_global)
     {
       if (!type_check_assignment (s, v, ly_symbol2scm ("backend-type?")))
        abort ();
@@ -82,26 +76,25 @@ Grob::internal_set_property (SCM s, SCM v)
   mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, s, v);
 }
 
-
 SCM
 Grob::internal_get_property (SCM sym) const
 {
   SCM s = scm_sloppy_assq (sym, mutable_property_alist_);
   if (s != SCM_BOOL_F)
-    return ly_cdr (s);
+    return scm_cdr (s);
 
   s = scm_sloppy_assq (sym, immutable_property_alist_);
-  
-  if (internal_type_checking_global_b && ly_pair_p (s))
+
+  if (do_internal_type_checking_global && scm_is_pair (s))
     {
-      if (!type_check_assignment (sym, ly_cdr (s),
+      if (!type_check_assignment (sym, scm_cdr (s),
                                  ly_symbol2scm ("backend-type?")))
        abort ();
 
       check_interfaces_for_property (this, sym);
     }
 
-  return (s == SCM_BOOL_F) ? SCM_EOL : ly_cdr (s); 
+  return (s == SCM_BOOL_F) ? SCM_EOL : scm_cdr (s);
 }
 
 void
@@ -111,9 +104,8 @@ Grob::substitute_mutable_properties (SCM crit, SCM orig)
   mutable_property_alist_ = substitute_mutable_property_alist (orig);
 }
 
-
 bool
-Grob::live () const
+Grob::is_live () const
 {
   return immutable_property_alist_ != SCM_EOL;
 }