]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/item.hh
release: 1.3.71
[lilypond.git] / lily / include / item.hh
1 /*
2   item.hh -- declare Item
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8 #ifndef ITEM_HH
9 #define ITEM_HH
10
11
12 #include "box.hh"
13 #include "score-element.hh"
14 #include "drul-array.hh"
15 #include "protected-scm.hh"
16
17 /**
18   A horizontally fixed size element of the score.
19
20   Item is the datastructure for printables whose width is known
21   before the spacing is calculated
22
23   NB. This doesn't mean an Item has to initialize the output field before
24   spacing calculation. 
25   
26   
27   Element properties
28   
29   visibility-lambda -- a function that takes the break
30   direction and returns a (transparent, empty) cons
31
32   breakable -- boolean indicating if this is a breakable item (clef,
33   barline, key sig, etc.)
34
35    */
36 class Item : public Score_element
37 {
38   Drul_array<Item*> broken_to_drul_;
39
40 public:
41   VIRTUAL_COPY_CONS(Score_element);
42   Item (SCM);
43   Item (Item const &);
44
45   static bool breakable_b (Score_element*me);
46   bool broken_b () const;
47   
48   Direction break_status_dir () const;
49   
50   Item * find_prebroken_piece (Direction) const;
51   Score_element * find_broken_piece (Line_of_score*) const;    
52
53   virtual Line_of_score * line_l() const;
54   virtual Paper_column * column_l () const;
55   virtual void handle_prebroken_dependencies ();
56 protected:
57   virtual void discretionary_processing ();
58   void copy_breakable_items();
59 };
60
61
62
63 #endif