]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/item.hh
release: 1.1.24
[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 #include "protected-scm.hh"
17
18 /**
19   A horizontally fixed size element of the score.
20
21   Item is the datastructure for printables whose width is known
22   before the spacing is calculated
23
24   NB. This doesn't mean an Item has to initialize the output field before
25   spacing calculation. 
26   
27 */
28 class Item : public virtual Score_element {
29   void do_break ();
30   void try_visibility_lambda ();
31
32 public:
33   Link_array<Spanner> attached_span_l_arr_;
34   Drul_array<Item*> broken_to_drul_;
35   Item *unbroken_original_l_;
36
37   /**
38      
39      visibility_lambda :: int -> (bool . bool)
40      
41      @in
42      break direction
43      
44      @out
45      (transparent, empty) cons
46      
47    */
48   Protected_scm visibility_lambda_;
49   /// should be put in a breakable col.
50   bool breakable_b_;
51   Direction break_status_dir_;
52   int break_priority_i_;
53   
54   /// nobreak = 0, pre = -1, post = 1
55   Direction break_status_dir() const;
56   Item * find_prebroken_piece (Direction) const;
57   Item * find_prebroken_piece (Line_of_score*) const;    
58
59   Item();
60   Real hpos_f() const;
61   
62   virtual Line_of_score * line_l() const;
63   virtual Paper_column * column_l () const;
64     
65   static int left_right_compare (Item const *, Item const*);
66   
67   Item (Item const &);
68 protected:
69   virtual void do_unlink ();
70   virtual void do_junk_links();
71   virtual void  do_breakable_col_processing();
72   virtual void handle_prebroken_dependencies();
73   virtual void do_print() const;
74   virtual bool linked_b() const;
75
76   virtual void handle_prebroken_dependents ();
77
78   void copy_breakable_items();
79 };
80
81
82
83 #endif