]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/item.hh
release: 0.1.8
[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 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8 #ifndef ITEM_HH
9 #define ITEM_HH
10
11
12 #include "boxes.hh"
13 #include "string.hh"
14 #include "score-elem.hh"
15
16 /**
17   A horizontally fixed size element of the score.
18
19   Item is the datastructure for printables whose width is known
20   before the spacing is calculated
21
22   NB. This doesn't mean an Item has to initialize the output field before
23   spacing calculation. 
24   
25 */
26 class Item : public virtual Score_elem {
27 public:
28     /// indirection to the column it is in
29     PCol * pcol_l_;
30     
31     Item * broken_to_a_[2];
32
33     /// should be put in a breakable col.
34     bool breakable_b_;
35     int break_status_i_;
36     /// nobreak = 0, pre = -1, post = 1
37     int break_status_i()const;
38     Item * find_prebroken_piece (PCol*)const;
39     Item * find_prebroken_piece (Line_of_score*)const;    
40
41     virtual Item *item() { return this; }
42     Item();
43     Real hpos_f() const;
44     DECLARE_MY_RUNTIME_TYPEINFO;
45     virtual Line_of_score * line_l() const;
46     
47 protected:
48     virtual void  do_breakable_col_processing();
49     virtual void handle_prebroken_dependencies();
50     virtual void do_print()const;
51
52     void copy_breakable_items();
53 };
54
55
56
57 #endif