]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 14 Nov 2004 18:03:03 +0000 (18:03 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 14 Nov 2004 18:03:03 +0000 (18:03 +0000)
lily/context-property.cc
lily/context-selector.cc [deleted file]
lily/context.cc
lily/grob-selector.cc [deleted file]
lily/include/context-selector.hh [deleted file]
lily/include/grob-selector.hh [deleted file]
lily/lily-parser.cc
lily/tweak-registration.cc

index 0e9a0e129a4462a41fcd2459508dd5beb7096ae7..e9f1a1ee069feba0430e6bdb7dc385f60a8d98db 100644 (file)
@@ -206,9 +206,6 @@ make_item_from_properties (Engraver *tr, SCM x, SCM cause, const char * name)
   Item *it = new Item (props, key);
   scm_gc_unprotect_object (key->self_scm ());
 
-#ifdef TWEAK 
-  Grob_selector::register_grob (context, it);
-#endif
   dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
 
   return it;
diff --git a/lily/context-selector.cc b/lily/context-selector.cc
deleted file mode 100644 (file)
index 2a90b8d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  context-selector.cc -- implement Context selection.
-
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include "context-selector.hh"
-#include "context.hh"
-#include "scm-hash.hh"
-
-Scheme_hash_table *Context_selector::contexts_ = 0;
-
-void
-Context_selector::register_context (Context *context)
-{
-  int count = 0;
-  if (Context *first = retrieve_context (identify_context (context, 0)))
-    {
-      count = robust_scm2int (first->get_property ("tweakCount"), 0);
-      count++;
-      SCM s = scm_int2num (count);
-      first->set_property ("tweakCount", s);
-      context->set_property ("tweakRank", s);
-  }
-  /* 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);
-}
-
-SCM
-Context_selector::identify_context (Context *context, int count)
-{
-  /* TODO: start time, parent-context-at-start */
-  return scm_list_3 (scm_makfrom0str (context->context_name ().to_str0 ()),
-                    scm_makfrom0str (context->id_string ().to_str0 ()),
-                    scm_int2num (count));
-}
-
-SCM
-Context_selector::identify_context (Context *context)
-{
-  return
-    identify_context (context,
-                     robust_scm2int (context->get_property ("tweakRank"), 0));
-}
-
-void
-Context_selector::store_context (SCM context_id, Context *context)
-{
-  contexts_->set (ly_to_symbol (context_id), context->self_scm ());
-}
-
-Context *
-Context_selector::retrieve_context (SCM context_id)
-{
-  return unsmob_context (contexts_->get (ly_to_symbol (context_id)));
-}
-
-void
-Context_selector::set_tweaks (SCM tweaks)
-{
-  (void) tweaks;
-  contexts_ = new Scheme_hash_table ();
-  //tweaks_ = tweaks;
-}
-
index c06b9288ca77963cccffd30164204c4c4f1019be..82eaba0adf1b5c87c7ff8f6027f6105e07845167 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "object-key.hh"
 #include "context-def.hh"
-#include "context-selector.hh"
 #include "context.hh"
 #include "ly-smobs.icc"
 #include "main.hh"
@@ -65,9 +64,7 @@ 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_);
 
diff --git a/lily/grob-selector.cc b/lily/grob-selector.cc
deleted file mode 100644 (file)
index bc45d90..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-  grob-selector.cc -- implement Grob selection.
-
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include "context-selector.hh"
-#include "context.hh"
-#include "grob-selector.hh"
-#include "grob.hh"
-#include "paper-column.hh"
-#include "scm-hash.hh"
-#include "warn.hh"
-
-Scheme_hash_table *Grob_selector::grobs_ = 0;
-Protected_scm Grob_selector::tweaks_ = SCM_EOL;
-
-void
-Grob_selector::register_grob (Context *context, Grob *grob)
-{
-  int count = 0;
-  Moment m = context->now_mom ();
-  if (Grob *first = retrieve_grob (identify_grob (context, m, grob, 0)))
-    {
-      count = robust_scm2int (first->get_property ("tweak-count"), 0);
-      count++;
-      SCM s = scm_int2num (count);
-      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);
-  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));
-}
-
-SCM
-Grob_selector::identify_grob (Context *context, Moment m, Grob *grob, int count)
-{
-  return scm_list_4 (Context_selector::identify_context (context),
-                    scm_makfrom0str (m.to_string ().to_str0 ()),
-                    scm_makfrom0str (grob->name ().to_str0 ()),
-                    scm_int2num (count));
-}
-
-SCM
-Grob_selector::identify_grob (Grob *grob)
-{
-  Moment m;
-  return identify_grob (unsmob_context (grob->get_property ("context")),
-                       Paper_column::when_mom (((Item*) grob)->get_column ()),
-                       grob,
-                       robust_scm2int (grob->get_property ("tweak-rank"), 0));
-}
-
-void
-Grob_selector::store_grob (SCM grob_id, Grob *grob)
-{
-  grobs_->set (ly_to_symbol (grob_id), grob->self_scm ());
-}
-
-Grob *
-Grob_selector::retrieve_grob (SCM grob_id)
-{
-  return unsmob_grob (grobs_->get (ly_to_symbol (grob_id)));
-}
-
-void
-Grob_selector::set_tweaks (SCM tweaks)
-{
-  grobs_ = new Scheme_hash_table ();
-  tweaks_ = tweaks;
-}
-
-LY_DEFINE (ly_grob_id, "ly:grob-id",
-          1, 0, 0, (SCM grob_scm),
-          "Return grob id.")
-{
-  Grob *grob = unsmob_grob (grob_scm);
-  SCM_ASSERT_TYPE (grob, grob_scm, SCM_ARG1, __FUNCTION__, "grob");
-  return Grob_selector::identify_grob (grob);
-}
diff --git a/lily/include/context-selector.hh b/lily/include/context-selector.hh
deleted file mode 100644 (file)
index b18ebd1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  context-selector.hh -- declare Context_selector
-
-  source file of the LilyPond music typesetter
-  
-  (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-#ifndef CONTEXT_SELECTOR_HH
-#define CONTEXT_SELECTOR_HH
-
-#include "lily-guile.hh"
-#include "lily-proto.hh"
-
-/**
- * Context_selector:
- * @register_context: register new #CONTEXT.
- #
- **/
-class Context_selector
-{
-  static Scheme_hash_table *contexts_;
-
-public:
-  static void register_context (Context *context);
-  static SCM identify_context (Context *context, int count);
-  static SCM identify_context (Context *context);
-  static Context *retrieve_context (SCM context_id);
-  static void store_context (SCM context_id, Context *context);
-  static void set_tweaks (SCM tweaks);
-};
-
-#endif /* CONTEXT_SELECTOR_HH */
-
diff --git a/lily/include/grob-selector.hh b/lily/include/grob-selector.hh
deleted file mode 100644 (file)
index a235ef3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  grob-selector.hh -- declare Grob_selector
-
-  source file of the LilyPond music typesetter
-  
-  (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-#ifndef GROB_SELECTOR_HH
-#define GROB_SELECTOR_HH
-
-#include "lily-guile.hh"
-#include "lily-proto.hh"
-#include "protected-scm.hh"
-
-/**
- * Grob_selector:
- * @register_grob: register new #GROB.
- #
- **/
-class Grob_selector
-{
-  static Scheme_hash_table *grobs_;
-  static Protected_scm tweaks_;
-
-public:
-  static void register_grob (Context *context, Grob *grob);
-  static SCM identify_grob (Context *context, Moment m, Grob *grob, int count);
-  static SCM identify_grob (Grob *grob);
-  static Grob *retrieve_grob (SCM grob_id);
-  static void store_grob (SCM grob_id, Grob *grob);
-  static void set_tweaks (SCM tweaks);
-};
-
-#endif /* GROB_SELECTOR_HH */
index 1f031bcce83ce8ee1e10bea3c8ac6d8c758f5786..8d1c582c898d9b727bbdc4bd6f4f5809e9e29e7e 100644 (file)
@@ -10,8 +10,6 @@
 
 #include "book.hh"
 #include "lilypond-key.hh"
-#include "context-selector.hh"
-#include "grob-selector.hh"
 #include "file-name.hh"
 #include "file-path.hh"
 #include "lily-version.hh"
index ae8482941a66186014418eb589f092f8215edcbf..7f929b0a1058b3c5f4996bf2de87a2cb89f8f586 100644 (file)
@@ -121,7 +121,7 @@ Tweak_registry  * global_registry_;
 void
 init_global_tweak_registry()
 {
-  global_registry_ = new Tweak_registry();
+  //  global_registry_ = new Tweak_registry();
 }
 
 ADD_SCM_INIT_FUNC(init_global_tweak_registry,init_global_tweak_registry);