]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/context-property.cc (make_item_from_properties):
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 11 Nov 2004 20:43:17 +0000 (20:43 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 11 Nov 2004 20:43:17 +0000 (20:43 +0000)
* lily/context.cc (add_context)[TWEAK]: Tweak registration behind
#ifdef.

* scm/define-context-properties.scm
(all-internal-translation-properties): Add tweakRank and tweakCount.

* lily/grob.cc:
* scm/define-grob-properties.scm (all-internal-grob-properties):
Add tweak-rank and tweak-count.

ChangeLog
lily/context-property.cc
lily/context-selector.cc
lily/context.cc
lily/grob-selector.cc
lily/grob.cc
scm/define-context-properties.scm
scm/define-grob-properties.scm

index 37ef5bc981eb78272290e93cac34ee3d46bb63f5..b8385f2b838be90afe9e0c47b89f8ef540349d8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2004-11-11  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * lily/context-property.cc (make_item_from_properties):
+       * lily/context.cc (add_context)[TWEAK]: Tweak registration behind
+       #ifdef.
+
+       * scm/define-context-properties.scm
+       (all-internal-translation-properties): Add tweakRank and tweakCount.
+
+       * lily/grob.cc: 
+       * scm/define-grob-properties.scm (all-internal-grob-properties):
+       Add tweak-rank and tweak-count.
+
 2004-11-10  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scm/output-gnome.scm (string->utf8-string, char->utf8-string):
index 8d5923c1321443f848f64a976fb26f996b050290..d1e1c9f60d452597d40f38bcd1f2a0200c321be4 100644 (file)
@@ -202,8 +202,9 @@ make_item_from_properties (Translator *tr, SCM x, SCM cause)
   
   SCM props = updated_grob_properties (context, x);
   Item *it = new Item (props);
+#ifdef TWEAK 
   Grob_selector::register_grob (context, it);
-
+#endif
   dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
 
   return it;
index c9d34a727f3a911838e596b1e2946a1d78092fc3..fa583e91a99d6ec2be7709c061e91c91d5ba50d0 100644 (file)
@@ -20,14 +20,14 @@ Context_selector::register_context (Context *context)
   int count = 0;
   if (Context *first = retrieve_context (identify_context (context, 0)))
     {
-      count = robust_scm2int (first->get_property ("max"), 0);
+      count = robust_scm2int (first->get_property ("tweakCount"), 0);
       count++;
       SCM s = scm_int2num (count);
-      first->set_property ("max", s);
-      context->set_property ("count", s);
+      first->set_property ("tweakCount", s);
+      context->set_property ("tweakRank", s);
   }
-  /* FIXME: must alway set count, for get_property () not to segfault.  */
-  context->set_property ("count", scm_int2num (count));
+  /* FIXME: must alway set rank, for get_property () not to segfault.  */
+  context->set_property ("tweakRank", scm_int2num (count));
   store_context (identify_context (context, count), context);
 }
 
@@ -45,7 +45,7 @@ Context_selector::identify_context (Context *context)
 {
   return
     identify_context (context,
-                     robust_scm2int (context->get_property ("count"), 0));
+                     robust_scm2int (context->get_property ("tweakRank"), 0));
 }
 
 void
index 3dd2c482e24becffc71031c35ba3121fe7bcd816..f53b319799e789fb9d7804750fba2171e126ff75 100644 (file)
@@ -63,8 +63,9 @@ Context::add_context (Context *t)
   if (!t->init_)
     {
       t->init_ = true;
+#ifdef TWEAK 
       Context_selector::register_context (t);
-        
+#endif  
       scm_gc_unprotect_object (ts);
       Context_def *td = unsmob_context_def (t->definition_);
 
index 3742b1f5f2845ebc7c3a73e68346fbd81577bd21..3758133e7331f83dd3fc39fbc0589639c8ceef5d 100644 (file)
@@ -26,21 +26,19 @@ Grob_selector::register_grob (Context *context, Grob *grob)
   Moment m = context->now_mom ();
   if (Grob *first = retrieve_grob (identify_grob (context, m, grob, 0)))
     {
-      count = robust_scm2int (first->get_property ("max"), 0);
+      count = robust_scm2int (first->get_property ("tweak-count"), 0);
       count++;
       SCM s = scm_int2num (count);
-      first->set_property ("max", s);
-      grob->set_property ("count", s);
+      first->set_property ("tweak-count", s);
+      grob->set_property ("tweak-rank", s);
     }
   grob->set_property ("context", context->self_scm ());
   SCM grob_id = identify_grob (context, m, grob, count);
   store_grob (grob_id, grob);
-#ifdef TWEAK 
   SCM tweak = ly_assoc_get (grob_id, tweaks_, SCM_BOOL_F);
   if (tweak != SCM_BOOL_F)
     grob->set_property (ly_symbol2string (scm_car (tweak)).to_str0 (),
                        scm_cadr (tweak));
-#endif  
 }
 
 SCM
@@ -59,7 +57,7 @@ Grob_selector::identify_grob (Grob *grob)
   return identify_grob (unsmob_context (grob->get_property ("context")),
                        Paper_column::when_mom (((Item*) grob)->get_column ()),
                        grob,
-                       robust_scm2int (grob->get_property ("count"), 0));
+                       robust_scm2int (grob->get_property ("tweak-rank"), 0));
 }
 
 void
index 0fd567d56699df79e662a6a3256a731261f3aa09..7786f4d3b1e05fb4d805a85f5900625fdc392706 100644 (file)
@@ -712,7 +712,7 @@ ADD_INTERFACE (Grob, "grob-interface",
               "context staff-symbol interfaces dependencies X-extent Y-extent extra-X-extent "
               "meta layer before-line-breaking-callback "
               "after-line-breaking-callback extra-Y-extent minimum-X-extent "
-              "minimum-Y-extent transparent "
+              "minimum-Y-extent transparent tweak-count tweak-rank"
               );
 
 
index 247cf7932b3b127ddc21508c693f92add91b5dfc..d41d0797b36c34891462463ec65b21ed2f557c6d 100644 (file)
@@ -494,6 +494,8 @@ event types that should be duplicated for @code{\\quote} commands.")
      (instrumentSupport ,grob-list? "list of grobs to attach instrument name
 to.")
      (tieMelismaBusy ,boolean? "Signal whether a tie is present.")
+     (tweakCount ,number? "Number of otherwise unique Contexts.")
+     (tweakRank ,number? "Identify otherwise unique Contexts.")
      )
    ))
 
index d38ce94d100e0742704bcb58bedbe14d2b4f8d71..757d91279fb4abe2e09865c5c099f725a1ff7b71 100644 (file)
@@ -527,6 +527,8 @@ function is to protect objects from being garbage collected.")
      (center-element ,ly:grob? "grob which will be at the center of
 the group after aligning (when using
 Align_interface::center_on_element).")
+     (tweak-count ,number? "Number of otherwise unique Grobs.")
+     (tweak-rank ,number? "Identify otherwise unique Grobs.")
      (direction-source ,ly:grob? "in case side-relative-direction is
 set, which grob to get the direction from .")
      (dot ,ly:grob? "reference to Dots object.")