]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/paper-def.hh
release: 1.2.15
[lilypond.git] / lily / include / paper-def.hh
1 /*
2   paper-def.hh -- declare Paper_def
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef PAPER_DEF_HH
11 #define PAPER_DEF_HH
12 #include "lily-proto.hh"
13 #include "lily-guile.hh"
14 #include "real.hh"
15
16 #include "moment.hh"
17 #include "array.hh"
18 #include "interval.hh"
19 #include "music-output-def.hh"
20
21 /** 
22
23   Symbols, dimensions and constants pertaining to visual output.
24
25   This struct takes care of all kinds of symbols, dimensions and
26   constants. Most of them are related to the point-size of the fonts,
27   so therefore, the lookup table for symbols is also in here.
28
29   TODO: 
30   
31   add support for multiple fontsizes 
32
33   remove all utility funcs 
34   
35
36   add support for other len->wid conversions.
37
38
39   Interesting variables:
40   
41   /// The distance between lines
42   interline
43   
44 */
45 class Paper_def : public Music_output_def 
46 {
47   Hash_table<int, Lookup *> *lookup_p_tab_p_;
48   static int default_count_i_;
49
50 protected:
51   VIRTUAL_COPY_CONS(Music_output_def);
52
53 public:    
54   virtual ~Paper_def ();
55
56   Array<Interval> shape_int_a_;
57   Real get_realvar (SCM symbol) const;
58   Real get_var (String id) const;
59
60   SCM get_scm_var (SCM sym) const;
61   
62   void reinit ();
63   Paper_def ();
64   void set_lookup (int, Lookup*);
65
66   Paper_def (Paper_def const&);
67   /** The distance between beams of multiplicity_i
68       JUNKME
69   */
70   Real interbeam_f (int multiplicity_i) const;
71
72   Interval line_dimensions_int (int) const;
73
74   void print () const;
75
76   Lookup const * lookup_l (int sz) const;       // TODO naming
77
78   /** convert a duration to an idealspacing
79     influence using the geometric_ and  paratime_signatures.
80     */
81   Real length_mom_to_dist (Moment, Real) const;
82   
83   Real arithmetic_constant (Moment minimal_mom) const;
84   Real arithmetic_spacing (Moment mom,Real constant) const;
85
86   virtual int get_next_default_count () const;
87   static void reset_default_count();
88
89   void output_settings (Paper_outputter*) const;
90   Paper_outputter* paper_outputter_p (Paper_stream*, Scope*, String) const;
91   Paper_stream* paper_stream_p () const;
92   String base_output_str () const;
93
94   // urg
95   friend int yyparse (void*);
96 };
97
98 #endif // Paper_def_HH