]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/property-engraver.cc
release: 1.5.24
[lilypond.git] / lily / property-engraver.cc
index 044f9613c4d459d7f110613362187144cf4f2341..3488f5e88074ad09ab4154ce592bde625a9446fb 100644 (file)
 #include "translator-group.hh"
 
 /*
-  JUNKME: should use pushproperty everywhere.
-  
+  This is deprecated, since revert/override should be used
  */
 class Property_engraver : public Engraver
 {
-  /*
-    UGH. Junk Dictionary
-  */
   Scheme_hash_table *prop_dict_;       // junkme
   void apply_properties (SCM, Grob*, Translator_group *origin);
 
@@ -32,8 +28,7 @@ protected:
   virtual void finalize ();
 public:
   ~Property_engraver ();
-  Property_engraver ();
-  VIRTUAL_COPY_CONS (Translator);
+  TRANSLATOR_DECLARATIONS(Property_engraver);
 };
 
 
@@ -59,7 +54,7 @@ Property_engraver::initialize ()
 {
   prop_dict_ = new Scheme_hash_table;
 
-  SCM plist = get_property (ly_symbol2scm ("Generic_property_list"));
+  SCM plist = get_property ("Generic_property_list");
   for (; gh_pair_p (plist); plist = ly_cdr (plist))
     {
       SCM elt_props = ly_car (plist);
@@ -70,19 +65,19 @@ Property_engraver::initialize ()
 void
 Property_engraver::acknowledge_grob (Grob_info i)
 {
SCM ifs = i.elem_l_->get_grob_property ("interfaces");
 SCM ifs = i.grob_l_->get_grob_property ("interfaces");
   SCM props;
   for (; gh_pair_p (ifs); ifs = ly_cdr (ifs))
     {      
       if (prop_dict_->try_retrieve (ly_car (ifs), &props))
        {
-         apply_properties (props,i.elem_l_, i.origin_trans_l_->daddy_trans_l_);
+         apply_properties (props,i.grob_l_, i.origin_trans_l_->daddy_trans_l_);
        }
     }
 
   if (prop_dict_->try_retrieve (ly_symbol2scm ("all"), &props))
     {
-      apply_properties (props, i.elem_l_, i.origin_trans_l_->daddy_trans_l_);
+      apply_properties (props, i.grob_l_, i.origin_trans_l_->daddy_trans_l_);
     }
 }
 
@@ -100,21 +95,21 @@ Property_engraver::apply_properties (SCM p, Grob *e, Translator_group*origin)
       
       SCM entry = ly_car (p);
       SCM prop_sym = ly_car (entry);
-      SCM type_p   = gh_cadr (entry);
-      SCM elt_prop_sym = gh_caddr (entry);
+      SCM type_p   = ly_cadr (entry);
+      SCM elt_prop_sym = ly_caddr (entry);
 
       SCM preset = scm_assq (elt_prop_sym, e->mutable_property_alist_);
       if (preset != SCM_BOOL_F)
        continue;
   
-      SCM val = get_property (prop_sym);
+      SCM val = internal_get_property (prop_sym);
 
       if (val == SCM_EOL)
        ;                       // Not defined in context.
       else if (gh_apply (type_p, scm_list_n (val, SCM_UNDEFINED))
               == SCM_BOOL_T)   // defined and  right type: do it
        {
-         e->set_grob_property (elt_prop_sym, val);
+         e->internal_set_grob_property (elt_prop_sym, val);
 
          SCM meta = e->get_grob_property ("meta");
          SCM name = scm_assoc (ly_symbol2scm ("name"), meta);
@@ -152,4 +147,14 @@ Property_engraver::apply_properties (SCM p, Grob *e, Translator_group*origin)
     }
 }
 
-ADD_THIS_TRANSLATOR (Property_engraver);
+
+ENTER_DESCRIPTION(Property_engraver,
+/* descr */       "This is a engraver that converts property settings into
+back-end grob-property settings. Example: Voice.stemLength will set
+#'length in all Stem objects.
+
+Due to CPU and memory requirements, the use of this engraver is deprecated.",
+/* creats*/       "",
+/* acks  */       "grob-interface",
+/* reads */       "Generic_property_list",
+/* write */       "");