]> git.donarmstrong.com Git - lilypond.git/commitdiff
Excise object keys from Contexts.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 10 Jan 2007 15:51:22 +0000 (16:51 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 10 Jan 2007 15:51:22 +0000 (16:51 +0100)
12 files changed:
lily/book.cc
lily/context-def.cc
lily/context.cc
lily/engraver.cc
lily/global-context-scheme.cc
lily/global-context.cc
lily/include/context-def.hh
lily/include/context.hh
lily/include/global-context.hh
lily/include/score.hh
lily/score-scheme.cc
lily/score.cc

index e8f1ee4ae204b13f7657587df4da2dde396248ca..06b3ea217febeb634fb49b8bb6fb14b79cd0e492 100644 (file)
@@ -144,7 +144,7 @@ Book::process (Output_def *default_paper,
       if (Score *score = unsmob_score (scm_car (s)))
        {
          SCM outputs = score
-           ->book_rendering (paper_book->paper_, default_layout, key);
+           ->book_rendering (paper_book->paper_, default_layout);
 
          while (scm_is_pair (outputs))
            {
index 8b28c5cde89f30baaa6a5f7a2ac65fb71c9498eb..a5c13305d42f574c48e561cb6c81c601c4ec9867 100644 (file)
@@ -261,9 +261,9 @@ Context_def::get_translator_names (SCM user_mod) const
 }
 
 Context *
-Context_def::instantiate (SCM ops, Object_key const *key)
+Context_def::instantiate (SCM ops)
 {
-  Context *context = new Context (key);
+  Context *context = new Context ();
 
   context->definition_ = self_scm ();
   context->definition_mods_ = ops;
index 53bca3b07bb8ebbf6a148cd0ec2f7898cb9b856e..15bd3c5fb84a0a8c03deae29d0a9119fe8bf3a05 100644 (file)
@@ -48,6 +48,7 @@ Context::check_removal ()
 
 Context::Context (Context const &src)
 {
+  (void) src;
   assert (false);
 }
 
@@ -68,7 +69,7 @@ Context::add_context (Context *child)
 }
 
 
-Context::Context (Object_key const *key)
+Context::Context ()
 {
   daddy_context_ = 0;
   aliases_ = SCM_EOL;
@@ -259,7 +260,6 @@ Context::create_context_from_event (SCM sev)
   SCM ops = ev->get_property ("ops");
   SCM type_scm = ev->get_property ("type");
   string type = ly_symbol2string (type_scm);
-  Object_key const *key = 0;
   
   vector<Context_def*> path
     = unsmob_context_def (definition_)->path_to_acceptable_context (type_scm, get_output_def ());
@@ -270,7 +270,7 @@ Context::create_context_from_event (SCM sev)
     }
   Context_def *cdef = path[0];
   
-  Context *new_context = cdef->instantiate (ops, key);
+  Context *new_context = cdef->instantiate (ops);
 
   new_context->id_string_ = id;
   
index f5fe392b1309b3f26427708f05805df0bd50f204..365eefe006aeff6e836762887da0e3fc64b709e6 100644 (file)
@@ -112,6 +112,7 @@ Engraver::internal_make_grob (SCM symbol, SCM cause, char const *name, char cons
   (void) file;
   (void) fun;
   (void) line;
+  (void) name;
   
   SCM props = updated_grob_properties (context (), symbol);
 
index e4a941d8072fd031b49d25c5dc8361c146a8c595..1cb52c8620367b12ab52a5be211f618146611497 100644 (file)
@@ -50,20 +50,18 @@ LY_DEFINE (ly_make_global_translator, "ly:make-global-translator",
 }
 
 LY_DEFINE (ly_make_global_context, "ly:make-global-context",
-          1, 1, 0, (SCM output_def, SCM key),
+          1, 0, 0, (SCM output_def),
           "Set up a global interpretation context, using the output\n"
           "block @var{output_def}.\n"
           "The context is returned.\n"
-
-          "\n\nOptionally, this routine takes an Object-key to\n"
-          "to uniquely identify the Score block containing it.\n")
+          )
 {
   Output_def *odef = unsmob_output_def (output_def);
 
   SCM_ASSERT_TYPE (odef, output_def, SCM_ARG1, __FUNCTION__,
                   "Output definition");
 
-  Global_context *glob = new Global_context (odef, unsmob_key (key));
+  Global_context *glob = new Global_context (odef);
 
   if (!glob)
     {
@@ -123,7 +121,7 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression",
 }
 
 LY_DEFINE (ly_run_translator, "ly:run-translator",
-          2, 1, 0, (SCM mus, SCM output_def, SCM key),
+          2, 1, 0, (SCM mus, SCM output_def),
           "Process @var{mus} according to @var{output_def}. \n"
           "An interpretation context is set up,\n"
           "and @var{mus} is interpreted with it.  \n"
@@ -132,7 +130,7 @@ LY_DEFINE (ly_run_translator, "ly:run-translator",
           "Optionally, this routine takes an Object-key to\n"
           "to uniquely identify the Score block containing it.\n")
 {
-  SCM glob = ly_make_global_context (output_def, key);
+  SCM glob = ly_make_global_context (output_def);
   ly_make_global_translator (glob);
   ly_interpret_music_expression (mus, glob);
   return glob;
index 6bfbe20454419979de18853231929f2d4b52c4d1..095f1f46a74a3207df04785cfcb722e70e602099 100644 (file)
@@ -20,10 +20,8 @@ using namespace std;
 #include "output-def.hh"
 #include "warn.hh"
 
-Global_context::Global_context (Output_def *o, Object_key *key)
-  : Context (new Lilypond_context_key (key,
-                                      Moment (0),
-                                      "Global", "", 0))
+Global_context::Global_context (Output_def *o)
+  : Context ()
 {
   output_def_ = o;
   definition_ = find_context_def (o, ly_symbol2scm ("Global"));
index 5d133ddbf44b2a367aefa727dd92bcbe39b40ead..dd4df4c802061b355fe7ae44b2c104b20c67753a 100644 (file)
@@ -50,7 +50,7 @@ public:
 
   vector<Context_def*> path_to_acceptable_context (SCM type_string,
                                                      Output_def *) const;
-  Context *instantiate (SCM extra_ops, Object_key const *);
+  Context *instantiate (SCM extra_ops);
 
   SCM to_alist () const;
   static SCM make_scm ();
index a8866708f201d27e32abdd3d03734cd9409a0f24..2cb0280ea128cb59076f7ce1d07463358fd007c2 100644 (file)
@@ -38,7 +38,6 @@ protected:
   SCM definition_;
   /* Additions to the Context_def, given by \with */
   SCM definition_mods_;
-  //  Context_key_manager key_manager_;
   
   SCM properties_scm_;
   SCM context_list_;
@@ -60,15 +59,11 @@ protected:
   friend class Context_def;
   // UGH! initialises implementation_
   friend SCM ly_make_global_translator (SCM);
-  void clear_key_disambiguations ();
 
   DECLARE_LISTENER (set_property_from_event);
   DECLARE_LISTENER (unset_property_from_event);
   
 public:
-  Object_key const *get_grob_key (string name);
-  Object_key const *get_context_key (string name, string id);
-
   string id_string () const { return id_string_; }
   SCM children_contexts () const { return context_list_; }
   SCM default_child_context_name () const;
@@ -82,7 +77,7 @@ public:
 
   Translator_group *implementation () const { return implementation_; }
   Context *get_parent_context () const;
-  Context (Object_key const *);
+  Context ();
 
   /* properties:  */
   SCM internal_get_property (SCM name_sym) const;
index bbb3095a11a43141ffbb35cf36347e8da8ae732e..540d96654bb9296e3d9f2bdf934bd271d9afd998 100644 (file)
@@ -21,7 +21,7 @@ class Global_context : public virtual Context
 
   friend class Output_def;
 public:
-  Global_context (Output_def *, Object_key *key);
+  Global_context (Output_def *);
   int get_moments_left () const;
   Moment sneaky_insert_extra_moment (Moment);
   void add_moment_to_process (Moment);
index a5279d25b694f23bbe8104638f58cefde4f8d21f..d4f26da4d22c5227b87aae787cf2e0904dda3fb1 100644 (file)
@@ -38,12 +38,12 @@ public:
   SCM get_music () const;
   void add_output_def (Output_def *def);
   void set_music (SCM music);
-  SCM book_rendering (Output_def *, Output_def *, Object_key *);
+  SCM book_rendering (Output_def *, Output_def *);
 };
 
 DECLARE_UNSMOB (Score, score);
 
 SCM ly_render_output (SCM, SCM);
-SCM ly_run_translator (SCM, SCM, SCM);
+SCM ly_run_translator (SCM, SCM);
 
 #endif /* SCORE_HH */
index 8bad81c6181c7c11cd9aad3a1ae23241511aaecc..b20b292dfd2a25bf40393132cc5258106e8afe5f 100644 (file)
@@ -74,7 +74,7 @@ LY_DEFINE (ly_score_error_p, "ly:score-error?",
 }
 
 LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
-          2, 1, 0, (SCM score, SCM layout, SCM key),
+          2, 0, 0, (SCM score, SCM layout),
           "Run @var{score} through @var{layout}, an output definition, "
           "scaled to correct output-scale already, "
           "return a list of layout-lines. "
@@ -107,8 +107,7 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
      itself. */
   score_def->parent_ = od;
 
-  SCM context = ly_run_translator (sc->get_music (), score_def->self_scm (),
-                                  key);
+  SCM context = ly_run_translator (sc->get_music (), score_def->self_scm ());
   SCM output = ly_format_output (context);
 
   scm_remember_upto_here_1 (prot);
index ff3aa638203bebb44dd9c3a1d24abd9bc6f98530..b5753c0ad7ae4b852ecf4f4c9c70dd83fb9baa4d 100644 (file)
@@ -114,8 +114,7 @@ Score::Score (Score const &s)
 */
 SCM
 Score::book_rendering (Output_def *layoutbook,
-                      Output_def *default_def,
-                      Object_key *book_key)
+                      Output_def *default_def)
 {
   if (error_found_)
     return SCM_EOL;
@@ -131,9 +130,6 @@ Score::book_rendering (Output_def *layoutbook,
 
   int outdef_count = defs_.size ();
 
-  Object_key *key = new Lilypond_general_key (book_key, user_key_, 0);
-  SCM scm_key = key->unprotect ();
-
   for (int i = 0; !i || i < outdef_count; i++)
     {
       Output_def *def = outdef_count ? defs_[i] : default_def;
@@ -148,7 +144,7 @@ Score::book_rendering (Output_def *layoutbook,
        }
 
       /* TODO: fix or junk --no-layout.  */
-      SCM context = ly_run_translator (music_, def->self_scm (), scm_key);
+      SCM context = ly_run_translator (music_, def->self_scm ());
       if (dynamic_cast<Global_context *> (unsmob_context (context)))
        {
          SCM s = ly_format_output (context);
@@ -160,7 +156,6 @@ Score::book_rendering (Output_def *layoutbook,
       scm_remember_upto_here_1 (scaled);
     }
 
-  scm_remember_upto_here_1 (scm_key);
   scm_remember_upto_here_1 (scaled_bookdef);
   return outputs;
 }