]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/item.hh
Manual cleanup after unsmob_xxx -> Xxx:unsmob conversion
[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   static Item *unsmob (SCM);
40
41   virtual Grob *clone () const;
42
43   static bool is_non_musical (Grob *);
44   static bool break_visible (Grob *);
45
46   bool is_broken () const;
47   virtual bool pure_is_visible (int start, int end) const;
48
49   Direction break_status_dir () const;
50
51   Item *find_prebroken_piece (Direction) const;
52   Grob *find_broken_piece (System *) const;
53   virtual System *get_system () const;
54   virtual Paper_column *get_column () const;
55   virtual void handle_prebroken_dependencies ();
56   virtual Interval_t<int> spanned_rank_interval () const;
57   virtual Interval pure_height (Grob *ref, int start, int end);
58   virtual void cache_pure_height (Interval height);
59   DECLARE_GROB_INTERFACE ();
60 protected:
61   virtual void discretionary_processing ();
62   void copy_breakable_items ();
63   virtual void derived_mark () const;
64
65   bool cached_pure_height_valid_;
66   Interval cached_pure_height_;
67 };
68
69 Interval_t<Moment> spanned_time_interval (Item *l, Item *r);
70
71 #endif