]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/global-context.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / global-context.cc
index 8807ea36bc5ceaa0d26dd38b0584315a0d9ee91e..6e2d26a58a2fceb00cafeb3cb767b5c16f88395f 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "global-context.hh"
 #include <cstdio>
 using namespace std;
 
-#include "warn.hh"
-#include "music.hh"
-#include "music-iterator.hh"
-#include "score-context.hh"
 #include "context-def.hh"
-#include "output-def.hh"
+#include "international.hh"
 #include "lilypond-key.hh"
+#include "music-iterator.hh"
+#include "music.hh"
+#include "output-def.hh"
+#include "score-context.hh"
+#include "warn.hh"
 
 Global_context::Global_context (Output_def *o, Moment final, Object_key *key)
   : Context (new Lilypond_context_key (key,
@@ -27,6 +28,8 @@ Global_context::Global_context (Output_def *o, Moment final, Object_key *key)
   output_def_ = o;
   final_mom_ = final;
   definition_ = find_context_def (o, ly_symbol2scm ("Global"));
+  unique_count_ = 0;
+  unique_ = 0;
 
   Context_def *globaldef = unsmob_context_def (definition_);
   if (!globaldef)
@@ -51,7 +54,7 @@ Global_context::add_moment_to_process (Moment m)
   if (m < now_mom_)
     programming_error ("trying to freeze in time");
 
-  for (int i = 0; i < extra_mom_pq_.size (); i++)
+  for (vsize i = 0; i < extra_mom_pq_.size (); i++)
     if (extra_mom_pq_[i] == m)
       return;
   extra_mom_pq_.insert (m);
@@ -203,3 +206,9 @@ Global_context::get_default_interpreter ()
   else
     return Context::get_default_interpreter ();
 }
+
+int
+Global_context::new_unique ()
+{
+  return ++unique_count_;
+}