]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/system.hh
Run grand-replace for 2012
[lilypond.git] / lily / include / system.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 1996--2012 Han-Wen Nienhuys
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 SYSTEM_HH
21 #define SYSTEM_HH
22
23 #include "column-x-positions.hh"
24 #include "spanner.hh"
25 #include "skyline.hh"
26
27 /*
28   If you keep following offset reference points, you will always end
29   up at the root object. This root object is called @ref{System}, and it
30   represents a system (i.e. a line of music).
31 */
32 class System : public Spanner
33 {
34   int rank_;
35   vector<Simple_spacer> simple_spacers_;
36   Grob_array *all_elements_;
37   void init_elements ();
38   friend class Paper_score;     // ugh.
39   Paper_score *pscore_; // ugh.
40
41 public:
42   Paper_score *paper_score () const;
43   Grob *get_vertical_alignment ();
44   Grob *get_extremal_staff (Direction dir, Interval const &);
45   Grob * get_neighboring_staff (Direction dir, Grob *vertical_axis_group, Interval_t<int> bounds);
46   Grob *get_pure_bound (Direction dir, int start, int end);
47   Grob *get_maybe_pure_bound (Direction dir, bool pure, int start, int end);
48   int get_rank () const;
49   vector<Simple_spacer> get_simple_spacers (Real line_len, Real indent, bool ragged);
50   void gen_simple_spacers (Real line_len, Real indent, bool ragged);
51   vector<Real> get_footnote_heights_in_range (vsize st, vsize end);
52   vector<Real> get_in_note_heights_in_range (vsize st, vsize end);
53   vector<Real> internal_get_note_heights_in_range (vsize st, vsize end, bool foot);
54   vector<Grob *> get_footnote_grobs_in_range (vsize st, vsize end);
55   vsize num_footnotes ();
56   void do_break_substitution_and_fixup_refpoints ();
57   void post_processing ();
58   SCM get_paper_system ();
59   SCM get_paper_systems ();
60   SCM get_broken_system_grobs ();
61   SCM get_broken_footnote_stencils ();
62
63   DECLARE_SCHEME_CALLBACK (footnotes_before_line_breaking, (SCM));
64   DECLARE_SCHEME_CALLBACK (footnotes_after_line_breaking, (SCM));
65   DECLARE_SCHEME_CALLBACK (calc_pure_relevant_grobs, (SCM));
66   DECLARE_SCHEME_CALLBACK (height, (SCM));
67   DECLARE_SCHEME_CALLBACK (calc_pure_height, (SCM, SCM, SCM));
68   DECLARE_SCHEME_CALLBACK (get_staves, (SCM));
69   DECLARE_SCHEME_CALLBACK (get_spaceable_staves, (SCM));
70   DECLARE_SCHEME_CALLBACK (get_nonspaceable_staves, (SCM));
71
72   System (SCM);
73   System (System const &);
74
75   int element_count () const;
76   int spanner_count () const;
77
78   void break_into_pieces (vector<Column_x_positions> const &);
79   DECLARE_GROB_INTERFACE ();
80
81   vector<Item *> broken_col_range (Item const *, Item const *) const;
82   vector<Grob *> used_columns () const;
83   Paper_column *column (vsize i) const;
84
85   void add_column (Paper_column *);
86   void typeset_grob (Grob *);
87   void pre_processing ();
88
89   Interval begin_of_line_pure_height (vsize start, vsize end);
90   Interval rest_of_line_pure_height (vsize start, vsize end);
91   Interval pure_refpoint_extent (vsize start, vsize end);
92   void collect_labels (Grob const *, SCM *);
93
94 protected:
95   virtual void derived_mark () const;
96   virtual Grob *clone () const;
97
98 private:
99   Interval part_of_line_pure_height (vsize start, vsize end, bool begin);
100 };
101
102 void set_loose_columns (System *which, Column_x_positions const *posns);
103
104 #endif /* SYSTEM_HH */
105