]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/global-context.hh
Run grand-replace (issue 3765)
[lilypond.git] / lily / include / global-context.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
6   LilyPond is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10
11   LilyPond is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef GLOBAL_CONTEXT_HH
21 #define GLOBAL_CONTEXT_HH
22
23 #include "context.hh"
24 #include "pqueue.hh"
25
26 class Global_context : public Context
27 {
28   PQueue<Moment> extra_mom_pq_;
29   Output_def *output_def_;
30
31   DECLARE_CLASSNAME (Global_context);
32
33   friend class Output_def;
34 public:
35   Global_context (Output_def *);
36   int get_moments_left () const;
37   Moment sneaky_insert_extra_moment (Moment);
38   void add_moment_to_process (Moment);
39   void run_iterator_on_me (Music_iterator *);
40   virtual Context *get_score_context () const;
41
42   void apply_finalizations ();
43   void add_finalization (SCM);
44
45   DECLARE_LISTENER (prepare);
46   virtual SCM get_output ();
47   virtual Output_def *get_output_def () const;
48   virtual Moment now_mom () const;
49   virtual Context *get_default_interpreter (const string &context_id = "");
50
51   Moment previous_moment () const;
52 protected:
53   Moment prev_mom_;
54   Moment now_mom_;
55 };
56
57 SCM ly_format_output (SCM);
58 Global_context *unsmob_global_context (SCM x);
59
60 #endif // GLOBAL_CONTEXT_HH