]> git.donarmstrong.com Git - lilypond.git/blob - src/item.cc
4a8ea949d6c9a3c392e267f25639221f9b220886
[lilypond.git] / src / item.cc
1 #include "pstaff.hh"
2 #include "pscore.hh"
3 #include "symbol.hh"
4 #include "molecule.hh"
5 #include "pcol.hh"
6
7 void
8 Item::translate(Offset O)
9 {
10     offset_ += O;
11 }
12
13 void
14 Item::postprocess()
15 {
16     // default: do nothing
17 }
18
19
20 void
21 Item::preprocess()
22 {
23     // default: do nothing
24 }
25
26 String
27 Item::TeXstring() const
28 {
29     Item * me = (Item*) this;
30     output->translate(offset_); // ugh?
31     me ->offset_ = Offset(0,0); // URRGGH!
32     return output->TeXstring();
33 }
34
35 Interval
36 Item::width() const
37 {
38     Interval i =output->extent().x ;
39     return i+=offset_.x;
40 }
41
42 Interval
43 Item::height() const
44 {
45     Interval i =output->extent().y;
46     return i+=offset_.y;
47 }
48
49 Item::~Item()
50 {
51     delete output;
52 }
53
54 Item::Item()
55 {
56     pcol_ = 0;
57     output = 0;
58     pstaff_ = 0;
59 }
60 void
61 Item::print() const
62 {
63 #ifndef NPRINT
64     if (output)
65         output->print();
66 #endif
67 }
68
69 Paperdef*
70 Item::paper()  const
71 {
72     assert(pstaff_);
73     return pstaff_->pscore_->paper_;
74 }
75