]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/output-def.hh
* lily/output-def.cc (assign_context_def): use set_variable().
[lilypond.git] / lily / include / output-def.hh
1 /*
2   music-output-def.hh -- declare Output_def
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef MUSIC_OUTPUT_DEF_HH
10 #define MUSIC_OUTPUT_DEF_HH
11
12 #include "string.hh"
13 #include "lily-proto.hh"
14 #include "lily-guile.hh"
15 #include "virtual-methods.hh"
16 #include "smobs.hh"
17 #include "input.hh"
18
19 /*
20   Output settings for a block of music.
21
22   This devolved into a rather empty class. The distinction between
23   various instances is made in the parser, which creates
24   midi/paper/bookpaper blocks depending on the keyword read.
25
26   The data structure is set up as recursive: the definitions not
27   supplied in paper are looked up in bookpaper. This is done through
28   the parent_ field of Output_def. However, such nesting is limited to
29   two levels,
30
31   * first because the parser hard-codes the different types
32   of output block.
33
34   * Second, because the prime benefit of multiple levels
35   (eg. bookpaper containing paper for a score, containing paper of a
36   \score embedded in \markup) requires scaling the Stencils (eg. the
37   one coming from score at markup level)
38   
39  */
40 class Output_def   
41 {
42 public:
43   VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def);
44   DECLARE_SMOBS (Output_def,);
45 public:
46   SCM scope_;
47   Output_def * parent_;
48   Input input_origin_;
49
50   Output_def (Output_def const&);
51   Output_def ();
52   virtual void derived_mark ();
53   
54   /*
55     variables.
56    */
57   SCM c_variable (String id) const;
58   SCM lookup_variable (SCM sym) const;
59   void set_variable (SCM sym, SCM val);
60   Real get_dimension (SCM symbol) const;
61 };
62
63 void assign_context_def (Output_def *m, SCM transdef);
64 SCM find_context_def (Output_def const *m, SCM name);
65
66 int get_tempo (Output_def*def, Moment moment);
67 void set_tempo (Output_def*def, Moment moment, int count_per_minute_i);
68
69 Interval line_dimensions_int (Output_def*def, int);
70  
71
72 Font_metric *select_encoded_font (Output_def *paper, SCM input_encoding, SCM chain);
73 Font_metric *select_font (Output_def *paper, SCM chain);
74
75 DECLARE_UNSMOB (Output_def, output_def);
76
77
78 Font_metric *find_scaled_font (Output_def * od,
79                                Font_metric *f, Real m, SCM input_enc_name);
80 Output_def *scale_output_def (Output_def *def, Real scale);
81 Real output_scale (Output_def*);
82
83 #endif /* MUSIC_OUTPUT_DEF_HH */