]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/item.hh
Run grand-replace (issue 3765)
[lilypond.git] / lily / include / item.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 #ifndef ITEM_HH
20 #define ITEM_HH
21
22 #include "grob.hh"
23
24 /**
25    A horizontally fixed size element of the score.
26
27    Item is the datastructure for printables whose width is known
28    before the spacing is calculated
29 */
30 class Item : public Grob
31 {
32   Drul_array<Item *> broken_to_drul_;
33
34   DECLARE_CLASSNAME (Item);
35 public:
36   Item (SCM);
37   Item (Item const &);
38
39   virtual Grob *clone () const;
40
41   static bool is_non_musical (Grob *);
42   static bool break_visible (Grob *);
43
44   bool is_broken () const;
45   virtual bool pure_is_visible (int start, int end) const;
46
47   Direction break_status_dir () const;
48
49   Item *find_prebroken_piece (Direction) const;
50   Grob *find_broken_piece (System *) const;
51   virtual System *get_system () const;
52   virtual Paper_column *get_column () const;
53   virtual void handle_prebroken_dependencies ();
54   virtual Interval_t<int> spanned_rank_interval () const;
55   virtual Interval pure_height (Grob *ref, int start, int end);
56   virtual void cache_pure_height (Interval height);
57   DECLARE_GROB_INTERFACE ();
58 protected:
59   virtual void discretionary_processing ();
60   void copy_breakable_items ();
61   virtual void derived_mark () const;
62
63   bool cached_pure_height_valid_;
64   Interval cached_pure_height_;
65 };
66
67 Interval_t<Moment> spanned_time_interval (Item *l, Item *r);
68
69 #endif