]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/output-def.hh
Run grand replace for 2015.
[lilypond.git] / lily / include / output-def.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
6   LilyPond is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10
11   LilyPond is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef OUTPUT_DEF_HH
21 #define OUTPUT_DEF_HH
22
23 #include "lily-proto.hh"
24 #include "virtual-methods.hh"
25 #include "smobs.hh"
26 #include "input.hh"
27
28 /*
29   Output settings for a block of music.
30
31   This devolved into a rather empty class. The distinction between
32   various instances is made in the parser, which creates
33   midi/layout/paper blocks depending on the keyword read.
34
35   The data structure is set up as recursive: the definitions not
36   supplied in layout are looked up in paper. This is done through
37   the parent_ field of Output_def. However, such nesting is limited to
38   two levels,
39
40   * first because the parser hard-codes the different types
41   of output block.
42
43   * Second, because the prime benefit of multiple levels
44   (eg. paper containing layout for a score, containing layout of a
45   \score embedded in \markup) requires scaling the Stencils (eg. the
46   one coming from score at markup level)
47   
48  */
49 class Output_def : public Smob<Output_def>
50 {
51 public:
52   int print_smob (SCM, scm_print_state *);
53   SCM mark_smob ();
54   static const char type_p_name_[];
55   virtual ~Output_def ();
56   VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def);
57
58   SCM scope_;
59   Output_def *parent_;
60   
61   Input input_origin_;
62
63   Output_def (Output_def const&);
64   Output_def ();
65
66   /*
67     variables.
68    */
69   SCM c_variable (const string &id) const;
70   SCM lookup_variable (SCM sym) const;
71   void set_variable (SCM sym, SCM val);
72   void normalize ();
73   Real get_dimension (SCM symbol) const;
74 };
75 SCM get_font_table (Output_def *def);
76 void assign_context_def (Output_def *m, SCM transdef);
77 SCM find_context_def (Output_def const *m, SCM name);
78
79 Interval line_dimensions_int (Output_def *def, int);
80  
81
82 Font_metric *select_encoded_font (Output_def *layout, SCM chain);
83 Font_metric *select_font (Output_def *layout, SCM chain);
84
85
86
87 Font_metric* find_pango_font (Output_def *layout,  SCM descr, Real factor);
88 Font_metric *find_scaled_font (Output_def *od, Font_metric *f,
89                                Real magnification);
90 Output_def *scale_output_def (Output_def *def, Real scale);
91
92 Real output_scale (Output_def*);
93
94 #endif /* OUTPUT_DEF_HH */