]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/item.hh
release: 1.1.1
[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--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8 #ifndef ITEM_HH
9 #define ITEM_HH
10
11
12 #include "box.hh"
13 #include "string.hh"
14 #include "score-element.hh"
15 #include "drul-array.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 class Item : public virtual Score_element {
28 public:
29   Link_array<Spanner> attached_span_l_arr_;
30   Drul_array<Item*> broken_to_drul_;
31   Item *unbroken_original_l_;
32
33   /// should be put in a breakable col.
34   bool breakable_b_;
35   Direction break_status_dir_;
36   int break_priority_i_;
37   
38   /// nobreak = 0, pre = -1, post = 1
39   Direction break_status_dir() const;
40   Item * find_prebroken_piece (Direction) const;
41   Item * find_prebroken_piece (Line_of_score*) const;    
42
43   Item();
44   Real hpos_f() const;
45   DECLARE_MY_RUNTIME_TYPEINFO;
46   virtual Line_of_score * line_l() const;
47   virtual Paper_column * column_l () const;
48     
49   static int left_right_compare (Item const *, Item const*);
50   
51   Item (Item const &);
52 protected:
53   virtual void do_unlink ();
54   virtual void do_junk_links();
55   virtual void  do_breakable_col_processing();
56   virtual void handle_prebroken_dependencies();
57   virtual void do_print() const;
58   virtual bool linked_b() const;
59
60   void copy_breakable_items();
61 };
62
63
64
65 #endif