]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/symbol.hh
e1e24b25e068b45dfbe405471e0649be60187ef9
[lilypond.git] / lily / include / symbol.hh
1 /*
2   symbol.hh -- declare Symbol, Atom
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #ifndef SYMBOL_HH
10 #define SYMBOL_HH
11
12 #include "string.hh"
13 #include "boxes.hh"
14 #include "lily-proto.hh"
15
16 struct Symbol {
17     String tex;
18     Box dim;
19
20     Symbol (String, Box);
21     Symbol();
22     String str()const;          // for printing.
23 };
24
25
26 /// a symbol which can be translated, and freely copied
27 struct Atom {
28     Offset off_;
29     Symbol sym_;
30
31     /* *************** */
32     
33     void translate(Offset o) {
34         off_ += o;
35     }
36     void translate_x(Real r){ 
37         off_.x += r;
38     }
39     void translate_y(Real r) {
40         off_.y += r;
41     }
42     
43     /// how big is #this#?
44     Box extent() const;
45     Atom(Symbol s);
46
47     void print() const;
48
49     String TeX_string() const;
50 };
51 #endif