]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/global-context.hh
2fcbfca2982cc7ff770d9a862dd36fe43efa122a
[lilypond.git] / lily / include / global-context.hh
1 /*
2   global-context.hh -- declare Global_context
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef GLOBAL_CONTEXT_HH
10 #define GLOBAL_CONTEXT_HH
11
12 #include "context.hh"
13 #include "pqueue.hh"
14
15 class Global_context : public virtual Context
16 {
17   PQueue<Moment> extra_mom_pq_;
18   Output_def *output_def_;
19
20   DECLARE_CLASSNAME(Global_context);
21
22   friend class Output_def;
23 public:
24   Global_context (Output_def *);
25   int get_moments_left () const;
26   Moment sneaky_insert_extra_moment (Moment);
27   void add_moment_to_process (Moment);
28   void run_iterator_on_me (Music_iterator *);
29   virtual Context *get_score_context () const;
30
31   void apply_finalizations ();
32   void add_finalization (SCM);
33
34   DECLARE_LISTENER (prepare);
35   virtual SCM get_output ();
36   virtual Output_def *get_output_def () const;
37   virtual Moment now_mom () const;
38   virtual Context *get_default_interpreter ();
39
40   Moment previous_moment () const;
41 protected:
42   Moment prev_mom_;
43   Moment now_mom_;
44 };
45
46 SCM ly_format_output (SCM);
47 Global_context *unsmob_global_context (SCM x);
48
49 #endif // GLOBAL_CONTEXT_HH