+2004-05-28 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/include/output-def.hh: new file, move from
+ music-output-def.hh
+
2004-05-27 Jan Nieuwenhuizen <janneke@gnu.org>
* scm/output-gnome.scm: Describe feta-cork hack.
2004-05-27 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/include/book-paper-def.hh: derive from Output_def
+
+ * lily/include/paper-def.hh: move all functionality out of class.
+ Junk header.
+
+ * lily/include/music-output-def.hh: rename Music_output_def to
+ Output_def.
+
+ * input/wilhelmus.ly: only set space for Paper formatting.
+
+ * lily/include/midi-def.hh: remove file, remove class.
+ Move functions to Music-output-def.
+
* lily/music-output-def.cc (Music_output_def): remove separate
translator table. Lookup translators in scope directly. This
obviates Context suffix for context identifiers, i.e.
For normal staves, a specialized @internalsref{Staff} context is
available, which does the same: staves containing nothing (or only
multi measure rests) are removed. The context definition is stored in
-@code{\RemoveEmptyStaff} variable. Observe how the second staff
+@code{\RemoveEmptyStaffContext} variable. Observe how the second staff
in this example disappears in the second line
>>
\paper {
linewidth = 6.\cm
- \context { \RemoveEmptyStaff }
+ \context { \RemoveEmptyStaffContext }
}
}
@end lilypond
interscoreline = 1.0
indent = 0.0 \cm
\context {
- \LyricsContext
+ \Lyrics
\override SeparationItem #'padding = #2
minimumVerticalExtent = ##f
}
\context {
- \ScoreContext
+ \Score
\remove "Bar_number_engraver"
}
}
#(define (prepend-grob-property grob-name
grob-prop entry)
(lambda (context)
- (ly:context-pushpop-property context grob-name grob-prop
- (cons
- entry
- (assoc-get grob-prop (car (ly:context-property context grob-name)))))))
+ (let*
+ ((grob-def (ly:context-property context grob-name)))
+ (if (pair? grob-def)
+ (ly:context-pushpop-property context grob-name grob-prop
+ (cons
+ entry
+ (assoc-get grob-prop (car grob-def))))))))
#(define (set-extra-space grob-name entry value)
(prepend-grob-property grob-name 'space-alist
}
>>
\paper {}
-% \midi {}
+ \midi {}
}
%%% Local variables:
#include "item.hh"
#include "stencil.hh"
#include "accidental-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "pitch.hh"
/*
#include "group-interface.hh"
#include "axis-group-interface.hh"
#include "hara-kiri-group-spanner.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
MAKE_SCHEME_CALLBACK (Align_interface,alignment_callback,2);
SCM
#include "note-head.hh"
#include "item.hh"
#include "font-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "lookup.hh"
/*
+/*
+ apply-context-iterator.cc -- implement Apply_context_iterator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+*/
+
#include "simple-music-iterator.hh"
#include "context.hh"
#include "music.hh"
+#include "input.hh"
/**
Iterate a property.
{
SCM proc = get_music ()->get_property ("procedure");
- scm_call_1 (proc, get_outlet ()->self_scm ());
+ if (ly_c_procedure_p (proc))
+ scm_call_1 (proc, get_outlet ()->self_scm ());
+ else
+ get_music ()->origin ()->warning (_("\\applycontext argument is not a procedure"));
Simple_music_iterator::process (m);
}
*/
#include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "arpeggio.hh"
#include "grob.hh"
#include "stem.hh"
#include "font-interface.hh"
#include "stencil.hh"
#include "lily-guile.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "misc.hh"
class Balloon_interface
#include "bar-line.hh"
#include "string.hh"
#include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "font-interface.hh"
#include "all-font-metrics.hh"
#include "lily-guile.hh"
#include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "side-position-interface.hh"
#include "item.hh"
#include "moment.hh"
#include "staff-symbol-referencer.hh"
#include "beam.hh"
#include "stem.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "group-interface.hh"
#include "align-interface.hh"
#include "misc.hh"
#include "least-squares.hh"
#include "stem.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "lookup.hh"
#include "group-interface.hh"
#include "staff-symbol-referencer.hh"
/*
- book-paper-def.cc -- implement Book_paper_def
+ book-paper-def.cc -- implement Book_output_def
source file of the GNU LilyPond music typesetter
*/
#include "ly-module.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "dimensions.hh"
#include "book-paper-def.hh"
#include "ly-smobs.icc"
#include "virtual-font-metric.hh"
#include "scaled-font-metric.hh"
-IMPLEMENT_SMOBS (Book_paper_def);
-IMPLEMENT_DEFAULT_EQUAL_P (Book_paper_def);
-
-Book_paper_def::Book_paper_def ()
+Book_output_def::Book_output_def ()
{
output_scale_ = 1.0;
scaled_fonts_ = SCM_EOL;
- scope_ = SCM_EOL;
- smobify_self ();
scaled_fonts_ = scm_c_make_hash_table (11);
- scope_ = ly_make_anonymous_module (false);
}
-Book_paper_def::Book_paper_def (Book_paper_def const & src)
+Real
+Book_output_def::output_scale () const
+{
+ return output_scale_;
+}
+
+Book_output_def::Book_output_def (Book_output_def const & src)
+ : Output_def (src)
{
output_scale_ = src.output_scale_;
- scope_ = SCM_EOL;
scaled_fonts_ = SCM_EOL;
- smobify_self ();
- scope_= ly_make_anonymous_module (false);
- if (is_module (src.scope_))
- ly_import_module (scope_, src.scope_);
-
scaled_fonts_ = scm_c_make_hash_table (11); // copying is not done with live defs. hopefully.
}
-Book_paper_def::~Book_paper_def ()
+void
+Book_output_def::derived_mark ()
{
+ scm_gc_mark (scaled_fonts_);
}
-SCM
-Book_paper_def::mark_smob (SCM m)
-{
- Book_paper_def *mo = (Book_paper_def*) SCM_CELL_WORD_1 (m);
- scm_gc_mark (mo->scope_);
- return mo->scaled_fonts_;
-}
-
-int
-Book_paper_def::print_smob (SCM s, SCM p, scm_print_state*)
-{
- (void) s;
- scm_puts ("#<Book_paper>", p);
- return 1;
-}
Font_metric*
-Book_paper_def::find_scaled_font (Font_metric *f, Real m, SCM input_enc_name)
+Book_output_def::find_scaled_font (Font_metric *f, Real m, SCM input_enc_name)
{
Real lookup_mag = m;
if (!dynamic_cast<Virtual_font_metric*> (f))
- lookup_mag /= output_scale_;
+ lookup_mag /= output_scale ();
SCM sizes = scm_hashq_ref (scaled_fonts_, f->self_scm (), SCM_BOOL_F);
if (sizes != SCM_BOOL_F)
{
if (!ly_c_symbol_p (input_enc_name))
{
-#if 0
- /* FIXME.*/
SCM var = ly_module_lookup (scope_, ly_symbol2scm ("inputencoding"));
- input_enc_name = scm_variable_ref (var);
-
-#endif
- input_enc_name = ly_symbol2scm ("latin1");
+ if (var != SCM_BOOL_F)
+ input_enc_name = scm_variable_ref (var);
+ if (!ly_c_symbol_p (input_enc_name))
+ input_enc_name = ly_symbol2scm ("latin1");
}
val = Modified_font_metric::make_scaled_font_metric (input_enc_name,
return unsmob_metrics (val);
}
-Paper_def *
-Book_paper_def::scale_paper (Paper_def *pd) const
+Output_def*
+Book_output_def::scale_paper (Output_def *pd) const
{
SCM proc = ly_scheme_function ("scale-paper");
SCM new_pap = scm_call_2 (proc, pd->self_scm (), self_scm ());
scm_gc_protect_object (new_pap);
- Paper_def *p = unsmob_paper (new_pap);
+ Output_def *p = unsmob_output_def (new_pap);
- p->bookpaper_ = (Book_paper_def*) this;
+ p->parent_ = (Output_def*) this;
return p;
}
(SCM size),
"Make a paperbook, for staff space SIZE, which is in INTERNAL_UNIT.")
{
- Book_paper_def *bp = new Book_paper_def ;
+ Book_output_def *bp = new Book_output_def ;
SCM_ASSERT_TYPE (ly_c_number_p (size), size,
SCM_ARG1, __FUNCTION__, "number");
return scm_gc_unprotect_object (bp->self_scm ());
}
+Book_output_def *
+unsmob_book_output_def (SCM bp)
+{
+ return dynamic_cast<Book_output_def*> (unsmob_output_def (bp));
+}
+
LY_DEFINE (ly_bookpaper_fonts, "ly:bookpaper-fonts",
1, 0, 0,
(SCM bp),
"Return fonts scaled up BP")
{
- Book_paper_def *b = unsmob_book_paper_def (bp);
+ Book_output_def *b = unsmob_book_output_def (bp);
SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "bookpaper");
(SCM bp),
"Get outputscale for BP.")
{
- Book_paper_def *b = unsmob_book_paper_def (bp);
+ Book_output_def *b = unsmob_book_output_def (bp);
SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "bookpaper");
return scm_make_real (b->output_scale_);
}
-SCM
-Book_paper_def::lookup_variable (SCM sym) const
-{
- SCM var = ly_module_lookup (scope_, sym);
-
- return scm_variable_ref (var);
-}
-
-SCM
-Book_paper_def::c_variable (String s) const
-{
- return lookup_variable (ly_symbol2scm (s.to_str0 ()));
-}
-
-LY_DEFINE (ly_book_paper_def_scope, "ly:bookpaper-def-scope",
+LY_DEFINE (ly_book_output_def_scope, "ly:bookpaper-def-scope",
1, 0,0, (SCM def),
"Get the variable scope inside @var{def}.")
{
- Book_paper_def *op = unsmob_book_paper_def (def);
+ Book_output_def *op = unsmob_book_output_def (def);
SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
return op->scope_;
}
#include "ly-module.hh"
#include "main.hh"
#include "music-iterator.hh"
-#include "music-output-def.hh"
+#include "output-def.hh"
#include "music-output.hh"
#include "music.hh"
#include "page.hh"
#include "paper-book.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "score.hh"
#include "warn.hh"
}
void
-Book::process (String outname, Music_output_def *default_def, SCM header)
+Book::process (String outname, Output_def *default_def, SCM header)
{
Paper_book *paper_book = new Paper_book ();
paper_book->bookpaper_ = bookpaper_;
int score_count = scores_.size ();
for (int i = 0; i < score_count; i++)
{
- Paper_def *paper = 0;
+ Output_def *paper = 0;
SCM systems = scores_[i]->book_rendering (outname,
bookpaper_,
default_def, &paper);
/* FIXME: WIP, this is a hack. Return first page as stencil. */
SCM
-Book::to_stencil (Music_output_def *default_def, SCM header)
+Book::to_stencil (Output_def *default_def, SCM header)
{
Paper_book *paper_book = new Paper_book ();
paper_book->bookpaper_ = bookpaper_;
int score_count = scores_.size ();
for (int i = 0; i < score_count; i++)
{
- Paper_def *paper = 0;
+ Output_def *paper = 0;
SCM systems = scores_[i]->book_rendering ("<markup>",
bookpaper_,
default_def,
#include "paper-column.hh"
#include "break-algorithm.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "system.hh"
#include "paper-score.hh"
#include "paper-column.hh"
#include "lily-guile.hh"
#include "break-align-interface.hh"
#include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-column.hh"
#include "group-interface.hh"
#include "align-interface.hh"
#include "breathing-sign.hh"
#include "string.hh"
#include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "lookup.hh"
#include "dimensions.hh"
#include "engraver.hh"
#include "chord-name.hh"
#include "event.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "font-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "dimensions.hh"
#include "item.hh"
#include "pitch.hh"
#include "chord-name.hh"
#include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "font-interface.hh"
#include "grob.hh"
#include "paper-column.hh"
#include "lookup.hh"
#include "box.hh"
#include "interval.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "warn.hh"
#include <ctype.h>
#include "rhythmic-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "event.hh"
#include "dots.hh"
#include "dot-column.hh"
#include "context-def.hh"
#include "translator-group.hh"
#include "warn.hh"
-#include "music-output-def.hh"
+#include "output-def.hh"
#include "ly-smobs.icc"
#include "score-context.hh"
Link_array<Context_def>
-Context_def::path_to_acceptable_context (SCM type_sym, Music_output_def* odef) const
+Context_def::path_to_acceptable_context (SCM type_sym, Output_def* odef) const
{
assert (ly_c_symbol_p (type_sym));
Link_array<Context_def> accepteds;
for (SCM s = accepted; ly_c_pair_p (s); s = ly_cdr (s))
{
- Context_def *t = unsmob_context_def (odef->find_context_def (ly_car (s)));
+ Context_def *t = unsmob_context_def (find_context_def (odef, ly_car (s)));
if (!t)
continue;
accepteds.push (t);
#include "context-def.hh"
#include "context.hh"
#include "warn.hh"
-#include "music-output-def.hh"
+#include "output-def.hh"
#include "scm-hash.hh"
#include "main.hh"
#include "ly-smobs.icc"
if (!is_bottom_context ())
{
SCM nm = default_child_context_name ();
- SCM st = get_output_def ()->find_context_def (nm);
+ SCM st = find_context_def (get_output_def (), nm);
Context_def *t = unsmob_context_def (st);
if (!t)
return 0;
}
-Music_output_def *
+Output_def *
Context::get_output_def () const
{
return (daddy_context_)
#include "dots.hh"
#include "item.hh"
#include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "font-interface.hh"
#include "lookup.hh"
#include "staff-symbol-referencer.hh"
#include "font-metric.hh"
#include "font-interface.hh"
#include "grob.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "warn.hh"
#include "book-paper-def.hh"
#include "all-font-metrics.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "font-interface.hh"
#include "warn.hh"
"in the alist chain @var{chain}.\n"
"(An alist chain is a list of alists, containing grob properties).\n")
{
- Paper_def *pap = unsmob_paper (paper);
+ Output_def *pap = unsmob_output_def (paper);
SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
Font_metric *fm = select_font (pap, chain);
(SCM paper, SCM name),
"Return the paper variable @var{name}.")
{
- Paper_def *pap = unsmob_paper (paper);
+ Output_def *pap = unsmob_output_def (paper);
SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
return scm_make_real (pap->get_dimension (name));
}
design size is specced in advance.
*/
Font_metric*
-get_font_by_design_size (Paper_def* paper, Real requested,
+get_font_by_design_size (Output_def* paper, Real requested,
SCM font_vector, SCM input_encoding_name)
{
int n = SCM_VECTOR_LENGTH (font_vector);
}
Font_metric *fm = unsmob_metrics (scm_force (SCM_VECTOR_REF (font_vector, i)));
- return paper->bookpaper_->find_scaled_font (fm, requested / size, input_encoding_name);
+ return dynamic_cast<Book_output_def*> (paper->parent_)
+ // ugh.
+ ->find_scaled_font (fm, requested / size, input_encoding_name);
}
Font_metric*
-get_font_by_mag_step (Paper_def* paper, Real requested_step,
+get_font_by_mag_step (Output_def* paper, Real requested_step,
SCM font_vector, Real default_size, SCM input_encoding_name)
{
return get_font_by_design_size (paper,
Font_metric *
-select_encoded_font (Paper_def *paper, SCM chain, SCM encoding_name)
+select_encoded_font (Output_def *paper, SCM chain, SCM encoding_name)
{
SCM name = ly_assoc_chain (ly_symbol2scm ("font-name"), chain);
Font_metric * fm = all_fonts_global->find_font (ly_scm2string (name));
- return paper->bookpaper_->find_scaled_font (fm, rmag, encoding_name);
+ return dynamic_cast<Book_output_def*> (paper->parent_)
+ ->find_scaled_font (fm, rmag, encoding_name);
}
else if (scm_instance_p (name))
{
}
Font_metric *
-select_font (Paper_def *paper, SCM chain)
+select_font (Output_def *paper, SCM chain)
{
return select_encoded_font (paper, chain, SCM_EOL);
}
#include "global-context.hh"
#include "score-context.hh"
#include "context-def.hh"
-#include "music-output-def.hh"
+#include "output-def.hh"
#include "grace-fixup.hh"
-Global_context::Global_context (Music_output_def *o, Moment final)
+Global_context::Global_context (Output_def *o, Moment final)
{
output_def_ = o;
final_mom_ = final;
- definition_ = o->find_context_def (ly_symbol2scm ("Global"));
+ definition_ = find_context_def (o, ly_symbol2scm ("Global"));
unsmob_context_def (definition_)->apply_default_property_operations (this);
accepts_list_ = scm_list_1 (ly_symbol2scm ("Score"));
}
-Music_output_def*
+Output_def*
Global_context::get_output_def () const
{
return output_def_;
if (!get_score_context ())
{
SCM key = ly_symbol2scm ("Score");
- Context_def * t = unsmob_context_def (get_output_def ()
- ->find_context_def (key));
+ Context_def * t = unsmob_context_def (find_context_def (get_output_def (), key));
if (!t)
error (_f ("can't find `%s' context", "Score"));
#include "main.hh"
#include "paper-column.hh"
#include "paper-score.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "simple-spacer.hh"
#include "system.hh"
cp.cols_ = line;
Interval line_dims
- = pscore_->paper_->line_dimensions_int (optimal_paths[start_idx].line_);
+ = line_dimensions_int (pscore_->paper_, optimal_paths[start_idx].line_);
Simple_spacer * sp = generate_spacing_problem (line, line_dims);
bool last_line = break_idx == breaks.size ()-1;
bool ragged = ragged_right
#include "group-interface.hh"
#include "misc.hh"
#include "paper-score.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "grob.hh"
#include "spanner.hh"
#include "item.hh"
#include "warn.hh"
#include "spanner.hh"
#include "item.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "system.hh"
return ly_interval2scm (e);
}
-Paper_def*
+Output_def*
Grob::get_paper () const
{
return pscore_ ? pscore_->paper_ : 0;
#include "spanner.hh"
#include "font-interface.hh"
#include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "warn.hh"
#include "paper-column.hh"
#include "lookup.hh"
#include "lookup.hh"
#include "group-interface.hh"
#include "directional-element-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "staff-symbol-referencer.hh"
struct Horizontal_bracket
/*
- book-paper-def.hh -- declare Book_paper_def
+ book-paper-def.hh -- declare Book_output_def
source file of the GNU LilyPond music typesetter
#define BOOK_PAPER_DEF_HH
#include "lily-proto.hh"
-#include "smobs.hh"
-#include "virtual-methods.hh"
+#include "output-def.hh"
-class Book_paper_def
+class Book_output_def : public Output_def
{
- DECLARE_SMOBS (Book_paper_def, Music_output_def);
-
public:
- VIRTUAL_COPY_CONSTRUCTOR (Book_paper_def, Book_paper_def);
- Book_paper_def (Book_paper_def const &);
- SCM scope_;
+ VIRTUAL_COPY_CONSTRUCTOR (Output_def, Book_output_def);
+ Book_output_def (Book_output_def const &);
SCM scaled_fonts_;
Real output_scale_;
+ Real output_scale () const;
- Book_paper_def ();
- SCM c_variable (String id) const;
- SCM lookup_variable (SCM sym) const;
+ Book_output_def ();
+ virtual void derived_mark ();
Font_metric *find_scaled_font (Font_metric *f, Real m, SCM input_enc_name);
- Paper_def *scale_paper (Paper_def *pd) const;
+ Output_def *scale_paper (Output_def *pd) const;
};
-DECLARE_UNSMOB (Book_paper_def, book_paper_def);
+
+Book_output_def *unsmob_book_output_def (SCM bp);
#endif /* BOOK_PAPER_DEF_HH */
public:
SCM header_;
- Book_paper_def *bookpaper_;
+ Book_output_def *bookpaper_;
Link_array<Score> scores_;
Book ();
- void process (String outname, Music_output_def*, SCM header);
- SCM to_stencil (Music_output_def*, SCM header);
+ void process (String outname, Output_def*, SCM header);
+ SCM to_stencil (Output_def*, SCM header);
};
DECLARE_UNSMOB (Book, book);
void set_acceptor (SCM accepts, bool add);
Link_array<Context_def> path_to_acceptable_context (SCM type_string,
- Music_output_def*) const;
+ Output_def*) const;
Context * instantiate (SCM extra_ops);
SCM to_alist () const;
Global_context * get_global_context () const;
virtual Score_context * get_score_context () const;
- virtual Music_output_def *get_output_def () const;
+ virtual Output_def *get_output_def () const;
virtual Moment now_mom () const;
virtual Context *get_default_interpreter ();
Context *find_create_context (SCM context_name,
String id, SCM ops);
Link_array<Context> path_to_acceptable_context (SCM alias,
- Music_output_def*) const;
+ Output_def*) const;
};
class Global_context : public virtual Context
{
PQueue<Moment> extra_mom_pq_;
- Music_output_def* output_def_;
+ Output_def* output_def_;
- friend class Music_output_def;
+ friend class Output_def;
public:
- Global_context (Music_output_def*, Moment final);
+ Global_context (Output_def*, Moment final);
int get_moments_left () const;
Moment sneaky_insert_extra_moment (Moment);
void add_moment_to_process (Moment);
virtual void prepare (Moment);
virtual void one_time_step ();
virtual void finish ();
- virtual Music_output_def* get_output_def () const;
+ virtual Output_def* get_output_def () const;
virtual Moment now_mom () const;
virtual Context *get_default_interpreter ();
/*
related classes.
*/
- Paper_def *get_paper () const;
+ Output_def *get_paper () const;
/**
add a dependency. It may be the 0 pointer, in which case, it is ignored.
class Bezier;
class Bezier_bow;
class Book;
-class Book_paper_def;
+class Book_output_def;
class Break_algorithm;
class Change_iterator;
class Change_translator;
class Lyric_phrasing_engraver;
class Mensural_ligature_engraver;
class Midi_chunk;
-class Midi_def;
class Midi_duration;
class Midi_dynamic;
class Midi_header;
class Music_iterator;
class Music_list;
class Music_output;
-class Music_output_def;
+class Output_def;
class Music_sequence;
class Music_wrapper;
class Music_wrapper_iterator;
class Output_property;
class Paper_book;
class Paper_column;
-class Paper_def;
+class Output_def;
class Paper_line;
class Paper_outputter;
class Paper_score;
+++ /dev/null
-/*
- midi-def.hh -- declare Midi_def
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2004 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-
-#ifndef MIDI_DEF_HH
-#define MIDI_DEF_HH
-
-#include "lily-proto.hh"
-#include "real.hh"
-#include "string.hh"
-#include "moment.hh"
-#include "music-output-def.hh"
-
-/**
- definitions for midi output. Rather empty
- */
-class Midi_def : public Music_output_def
-{
- static int score_count_;
-
-public:
- Midi_def ();
- VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Midi_def);
-
- int get_tempo (Moment moment);
- void set_tempo (Moment moment, int count_per_minute_i);
-};
-
-#endif /* MIDI_DEF_HH */
+++ /dev/null
-/*
- music-output-def.hh -- declare Music_output_def
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#ifndef MUSIC_OUTPUT_DEF_HH
-#define MUSIC_OUTPUT_DEF_HH
-
-#include "string.hh"
-#include "lily-proto.hh"
-#include "lily-guile.hh"
-#include "virtual-methods.hh"
-#include "smobs.hh"
-#include "input.hh"
-
-/**
- Definition of how to output lilypond.
- */
-class Music_output_def
-{
-public:
- Input input_origin_;
- SCM scope_;
-
- void assign_context_def (SCM transdef);
- SCM find_context_def (SCM name) const;
-
- Music_output_def (Music_output_def const&);
- Music_output_def ();
- VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Music_output_def);
-
- Context *get_group_translator (String type) const;
- String outname_string () ;
- SCM c_variable (String id) const;
- SCM lookup_variable (SCM sym) const;
- void set_variable (SCM, SCM sym);
- DECLARE_SMOBS (Music_output_def,);
-};
-
-DECLARE_UNSMOB (Music_output_def, music_output_def);
-
-#endif /* MUSIC_OUTPUT_DEF_HH */
SCM ly_parser_bookify (SCM, SCM);
SCM ly_parser_scorify (SCM, SCM);
-Music_output_def *get_paper (My_lily_parser *parser);
-Book_paper_def *get_bookpaper (My_lily_parser *parser);
+Output_def *get_paper (My_lily_parser *parser);
+Output_def *get_midi (My_lily_parser *parser);
+Book_output_def *get_bookpaper (My_lily_parser *parser);
#endif /* MY_LILY_PARSER_HH */
--- /dev/null
+/*
+ music-output-def.hh -- declare Output_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#ifndef MUSIC_OUTPUT_DEF_HH
+#define MUSIC_OUTPUT_DEF_HH
+
+#include "string.hh"
+#include "lily-proto.hh"
+#include "lily-guile.hh"
+#include "virtual-methods.hh"
+#include "smobs.hh"
+#include "input.hh"
+
+/**
+ Definition of how to output lilypond.
+ */
+class Output_def
+{
+public:
+ VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def);
+ DECLARE_SMOBS (Output_def,);
+public:
+ Output_def * parent_;
+ Input input_origin_;
+ SCM scope_;
+
+ Output_def (Output_def const&);
+ Output_def ();
+ virtual void derived_mark ();
+
+ /*
+ variables.
+ */
+ SCM c_variable (String id) const;
+ SCM lookup_variable (SCM sym) const;
+ void set_variable (SCM sym, SCM val);
+ Real get_dimension (SCM symbol) const;
+};
+
+void assign_context_def (Output_def *m, SCM transdef);
+SCM find_context_def (Output_def const *m, SCM name);
+
+int get_tempo (Output_def*def, Moment moment);
+void set_tempo (Output_def*def, Moment moment, int count_per_minute_i);
+
+Interval line_dimensions_int (Output_def*def, int);
+
+
+Font_metric *select_encoded_font (Output_def *paper, SCM input_encoding, SCM chain);
+Font_metric *select_font (Output_def *paper, SCM chain);
+
+DECLARE_UNSMOB (Output_def, output_def);
+
+#endif /* MUSIC_OUTPUT_DEF_HH */
DECLARE_SMOBS (Page, );
public:
- Paper_def *paper_; // todo: make private?
- Book_paper_def * bookpaper () const;
+ Output_def *paper_; // todo: make private?
+ Book_output_def * bookpaper () const;
static int page_count_;
static Real MIN_COVERAGE_;
int number_;
Real top_margin_;
Real bottom_margin_;
- Page (Paper_def*, int);
+ Page (Output_def*, int);
/* available area for text. */
Real text_height () const;
SCM lines_;
SCM header_;
SCM global_header_;
- Paper_def *paper_;
+ Output_def *paper_;
Score_lines () ;
void gc_mark ();
SCM tagline_;
public:
Array<Score_lines> score_lines_;
- Book_paper_def *bookpaper_;
+ Book_output_def *bookpaper_;
Paper_book ();
-/*
- paper-def.hh -- declare Paper_def
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef PAPER_DEF_HH
-#define PAPER_DEF_HH
-
-
-#include "lily-proto.hh"
-#include "lily-guile.hh"
-#include "real.hh"
-#include "array.hh"
-#include "interval.hh"
-#include "music-output-def.hh"
-
-
-/**
-
- Symbols, dimensions and constants pertaining to visual output.
-
- This struct takes care of all kinds of symbols, dimensions and
- constants. Most of them are related to the point-size of the fonts,
- so therefore, the lookup table for symbols is also in here.
-
- TODO:
-
- add support for multiple fontsizes
-
- remove all utility funcs
-
-
- add support for other len->wid conversions.
-
-
- Interesting variables:
-
- /// The distance between lines
- interline
-
-*/
-class Paper_def : public Music_output_def
-{
-protected:
- VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Paper_def);
-
-public:
- Book_paper_def * bookpaper_;
- static int score_count_;
-
- Paper_def ();
- Paper_def (Paper_def const&);
- virtual ~Paper_def ();
-
- Paper_outputter* get_paper_outputter (String) const;
- SCM font_descriptions () const;
- void reinit ();
- Interval line_dimensions_int (int) const;
- void output_settings (Paper_outputter*) const;
- Font_metric *find_scaled_font (Font_metric *fm, Real mag, SCM enc_name);
- Real get_dimension (SCM symbol) const;
-
- friend int yyparse (void*);
-};
-
-Paper_def * unsmob_paper (SCM x);
-Font_metric *select_encoded_font (Paper_def *paper, SCM input_encoding, SCM chain);
-Font_metric *select_font (Paper_def *paper, SCM chain);
-
-#endif /* PAPER_DEF_HH */
String filename_;
void output_expr (SCM expr, Offset o);
- void output_metadata (Book_paper_def*, SCM);
- void output_music_output_def (Music_output_def* odef);
+ void output_metadata (Output_def *, SCM);
+ void output_music_output_def (Output_def* odef);
public:
Paper_outputter (String nm);
void dump_scheme (SCM);
void output_scheme (SCM scm);
void output_stencil (Stencil);
- void output_header (Book_paper_def*, SCM, int, bool);
+ void output_header (Output_def*, SCM, int, bool);
void output_line (SCM, Offset*, bool);
void output_page (Page*, bool);
};
+Paper_outputter* get_paper_outputter (String);
+
#endif /* PAPER_OUTPUTTER_HH */
class Paper_score : public Music_output
{
public:
- Paper_def *paper_;
+ Output_def *paper_;
System *system_;
Paper_score ();
Link_array<Audio_staff> audio_staffs_;
Cons<Audio_element> *audio_elem_p_list_;
- Midi_def *midi_;
+ Output_def *midi_;
};
#endif /* PERFORMANCE_HH */
DECLARE_SMOBS (Score, foo);
public:
- Link_array<Music_output_def> defs_;
+ Link_array<Output_def> defs_;
SCM music_;
SCM header_;
Score ();
Score (Score const&);
- SCM book_rendering (String, Book_paper_def*, Music_output_def*, Paper_def**);
+ SCM book_rendering (String, Book_output_def*, Output_def*, Output_def**);
};
DECLARE_UNSMOB (Score, score);
SCM internal_get_property (SCM symbol) const;
- virtual Music_output_def *get_output_def () const;
+ virtual Output_def *get_output_def () const;
virtual Translator_group* get_daddy_translator ()const;
virtual Moment now_mom () const;
virtual bool try_music (Music *req);
#include "item.hh"
#include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "font-interface.hh"
#include "staff-symbol-referencer.hh"
#include "lookup.hh"
#include "grob.hh"
#include "staff-symbol-referencer.hh"
#include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
Stencil
#include "item.hh"
#include "spanner.hh"
#include "line-spanner.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-column.hh"
#include "staff-symbol-referencer.hh"
#include "font-interface.hh"
#include "lookup.hh"
#include "stencil.hh"
#include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "lyric-extender.hh"
#include "note-head.hh"
#include "group-interface.hh"
#include "box.hh"
#include "lookup.hh"
#include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-column.hh"
#include "spanner.hh"
#include "item.hh"
#include "lily-guile.hh"
#include "lily-version.hh"
#include "main.hh"
-#include "midi-def.hh"
#include "misc.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "string.hh"
#include "warn.hh"
*/
-#include "paper-def.hh"
+#include "output-def.hh"
#include "spanner.hh"
#include "measure-grouping-spanner.hh"
#include "lookup.hh"
#include "rhythmic-head.hh"
#include "note-head.hh"
#include "staff-symbol-referencer.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "font-interface.hh"
/*
#include "lookup.hh"
#include "staff-symbol-referencer.hh"
#include "note-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "warn.hh"
/*
/*
- midi-def.cc -- implement Midi_def
+ midi-def.cc -- implement midi output def functions
source file of the GNU LilyPond music typesetter
*/
#include <math.h>
+
#include "misc.hh"
-#include "midi-def.hh"
-#include "performance.hh"
+#include "output-def.hh"
+#include "moment.hh"
#include "warn.hh"
#include "scm-hash.hh"
-Midi_def::Midi_def ()
-{
- // ugh
- set_tempo (Moment (Rational (1, 4)), 60);
-}
+
int
-Midi_def::get_tempo (Moment one_beat_mom)
+get_tempo (Output_def * def,
+ Moment one_beat_mom)
{
SCM wis = ly_symbol2scm ("whole-in-seconds");
- Moment *w = unsmob_moment (lookup_variable (wis));
+ Moment *w = unsmob_moment (def->lookup_variable (wis));
Moment wholes_per_min = Moment (60);
if (!w)
}
void
-Midi_def::set_tempo (Moment one_beat_mom, int beats_per_minute_i)
+set_tempo (Output_def * def,
+ Moment one_beat_mom,
+ int beats_per_minute_i)
{
Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60);
Moment m = Moment (1)/Moment (beats_per_second * one_beat_mom);
- set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());
+ def->set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());
}
#include "multi-measure-rest.hh"
#include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-column.hh" // urg
#include "font-interface.hh"
#include "rest.hh"
/*
- music-output-def.cc -- implement Music_output_def
+ music-output-def.cc -- implement Output_def
source file of the GNU LilyPond music typesetter
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "scm-hash.hh"
+#include "book-paper-def.hh"
#include "context-def.hh"
#include "file-path.hh"
#include "global-context.hh"
#include "lily-guile.hh"
#include "ly-module.hh"
#include "main.hh"
-#include "music-output-def.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
+#include "output-def.hh"
+#include "scm-hash.hh"
#include "warn.hh"
#include "ly-smobs.icc"
-Music_output_def::Music_output_def ()
+Output_def::Output_def ()
{
scope_ = SCM_EOL;
+ parent_ = 0;
smobify_self ();
scope_ = ly_make_anonymous_module (false);
}
-Music_output_def::~Music_output_def ()
+Output_def::~Output_def ()
{
}
-Music_output_def::Music_output_def (Music_output_def const &s)
+Output_def::Output_def (Output_def const &s)
{
scope_ = SCM_EOL;
+ parent_ = 0;
smobify_self ();
scope_= ly_make_anonymous_module (false);
}
-IMPLEMENT_SMOBS (Music_output_def);
-IMPLEMENT_DEFAULT_EQUAL_P (Music_output_def);
+IMPLEMENT_SMOBS (Output_def);
+IMPLEMENT_DEFAULT_EQUAL_P (Output_def);
-#include "paper-def.hh"
-#include "book-paper-def.hh"
SCM
-Music_output_def::mark_smob (SCM m)
+Output_def::mark_smob (SCM m)
{
- Music_output_def * mo = (Music_output_def*) SCM_CELL_WORD_1 (m);
+ Output_def * mo = (Output_def*) SCM_CELL_WORD_1 (m);
/*
FIXME: why is this necessary?
all bookpaper_ should be protected by themselves.
*/
- Paper_def *pd = dynamic_cast<Paper_def*>(mo);
- if (pd && pd->bookpaper_)
- scm_gc_mark (pd->bookpaper_->self_scm ());
+ if (mo->parent_)
+ scm_gc_mark (mo->parent_->self_scm ());
+
+ mo->derived_mark ();
return mo->scope_;
}
void
-Music_output_def::assign_context_def (SCM transdef)
+Output_def::derived_mark () {}
+
+void
+assign_context_def (Output_def * m, SCM transdef)
{
Context_def *tp = unsmob_context_def (transdef);
assert (tp);
if (tp)
{
SCM sym = tp->get_context_name ();
- scm_module_define (scope_, sym, transdef);
+ scm_module_define (m->scope_, sym, transdef);
}
}
find the translator for NAME. NAME must be a symbol.
*/
SCM
-Music_output_def::find_context_def (SCM name) const
+find_context_def (Output_def const *m, SCM name)
{
- SCM var = ly_module_lookup (scope_, name);
-
- if (var != SCM_BOOL_F)
- {
- var = scm_variable_ref (var);
- Context_def *cd = (unsmob_context_def (var));
- return cd ? cd->self_scm () : SCM_EOL;
- }
- else
- return SCM_EOL;
+ Context_def *cd = unsmob_context_def (m->lookup_variable (name));
+ return cd ? cd->self_scm () : SCM_EOL;
}
int
-Music_output_def::print_smob (SCM s, SCM p, scm_print_state *)
+Output_def::print_smob (SCM s, SCM p, scm_print_state *)
{
- Music_output_def * def = unsmob_music_output_def (s);
+ Output_def * def = unsmob_output_def (s);
scm_puts ("#< ", p);
scm_puts (classname (def), p);
return 1;
}
+Real
+Output_def::get_dimension (SCM s) const
+{
+ SCM val = lookup_variable (s);
+ return ly_scm2double (val);
+}
+
+
SCM
-Music_output_def::lookup_variable (SCM sym) const
+Output_def::lookup_variable (SCM sym) const
{
SCM var = ly_module_lookup (scope_, sym);
-
- return scm_variable_ref (var);
+ if (SCM_VARIABLEP (var))
+ return SCM_VARIABLE_REF (var);
+
+ if (parent_)
+ return parent_->lookup_variable (sym);
+
+ return SCM_EOL;
}
SCM
-Music_output_def::c_variable (String s) const
+Output_def::c_variable (String s) const
{
return lookup_variable (ly_symbol2scm (s.to_str0 ()));
}
void
-Music_output_def::set_variable (SCM sym, SCM val)
+Output_def::set_variable (SCM sym, SCM val)
{
scm_module_define (scope_, sym, val);
}
-LY_DEFINE (ly_paper_lookup, "ly:paper-lookup",
- 2, 0,0, (SCM pap, SCM sym),
+LY_DEFINE (ly_paper_lookup, "ly:output-def-lookup",
+ 2, 0, 0, (SCM pap, SCM sym),
"Lookup @var{sym} in @var{pap}. "
"Return the value or @code{'()} if undefined.")
{
- Music_output_def *op = unsmob_music_output_def (pap);
- SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Paper");
+ Output_def *op = unsmob_output_def (pap);
+ SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Output_def");
SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
- SCM var = ly_module_lookup (op->scope_, sym);
- if (SCM_VARIABLEP (var))
- return SCM_VARIABLE_REF (var);
- else
- return SCM_EOL;
+ return op->lookup_variable (sym);
}
LY_DEFINE (ly_output_def_scope, "ly:output-def-scope",
1, 0,0, (SCM def),
"Get the variable scope inside @var{def}.")
{
- Music_output_def *op = unsmob_music_output_def (def);
+ Output_def *op = unsmob_output_def (def);
SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
return op->scope_;
}
+
+LY_DEFINE (ly_output_def_parent, "ly:output-def-parent",
+ 1, 0, 0, (SCM def),
+ "Get the parent output-def of @var{def}.")
+{
+ Output_def *op = unsmob_output_def (def);
+ SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
+ return op->parent_ ? op->parent_->self_scm () : SCM_EOL;
+}
+
+
LY_DEFINE (ly_output_def_clone, "ly:output-def-clone",
1, 0, 0, (SCM def),
"Clone @var{def}.")
{
- Music_output_def *op = unsmob_music_output_def (def);
+ Output_def *op = unsmob_output_def (def);
SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
SCM s = op->clone ()->self_scm ();
scm_gc_unprotect_object (s);
(SCM output_def),
"Return the description of translators in @var{output-def}.")
{
- Music_output_def *id = unsmob_music_output_def (output_def);
+ Output_def *id = unsmob_output_def (output_def);
SCM al =ly_module_to_alist (id->scope_);
}
+
+#include "interval.hh"
+
+/* FIXME. This is broken until we have a generic way of
+ putting lists inside the \paper block. */
+Interval
+line_dimensions_int (Output_def *def, int n)
+{
+ Real lw = def->get_dimension (ly_symbol2scm ("linewidth"));
+ Real ind = n ? 0.0 : def->get_dimension (ly_symbol2scm ("indent"));
+
+ return Interval (ind, lw);
+}
+
+LY_DEFINE (ly_paper_def_p, "ly:paper-def?",
+ 1, 0, 0, (SCM def),
+ "Is @var{def} a paper definition?")
+{
+ return ly_bool2scm (unsmob_output_def (def));
+}
void
My_lily_lexer::set_identifier (SCM name, SCM s)
{
- assert (ly_c_string_p (name));
+ SCM sym = name;
+ if (ly_c_string_p (name))
+ sym = scm_string_to_symbol (name);
- if (lookup_keyword (ly_scm2string (name)) >= 0)
+ if (ly_c_symbol_p (sym))
{
- warning (_f ("Identifier name is a keyword: `%s'", SCM_STRING_CHARS (name)));
- }
+ if (lookup_keyword (ly_symbol2string (sym)) >= 0)
+ {
+ warning (_f ("Identifier name is a keyword: `%s'", SCM_SYMBOL_CHARS (sym)));
+ }
- SCM sym = scm_string_to_symbol (name);
- SCM mod = ly_car (scopes_);
+ SCM mod = ly_car (scopes_);
- scm_module_define (mod, sym, s);
+ scm_module_define (mod, sym, s);
+ }
+
+ else
+ {
+ programming_error ("Identifier is not a symbol.");
+ }
}
My_lily_lexer::~My_lily_lexer ()
#include "main.hh"
#include "my-lily-lexer.hh"
#include "my-lily-parser.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "parray.hh"
#include "parser.hh"
#include "scm-hash.hh"
return SCM_UNSPECIFIED;
}
-Music_output_def*
+Output_def*
get_paper (My_lily_parser *parser)
{
SCM id = parser->lexer_->lookup_identifier ("$defaultpaper");
- Music_output_def *paper = unsmob_music_output_def (id);
- return paper ? paper->clone () : new Paper_def;
+ Output_def *paper = unsmob_output_def (id);
+ paper = paper ? paper->clone () : new Output_def;
+ paper->set_variable (ly_symbol2scm ("is-paper"), SCM_BOOL_T);
+ return paper;
}
-Book_paper_def*
+Output_def*
+get_midi (My_lily_parser *parser)
+{
+ SCM id = parser->lexer_->lookup_identifier ("$defaultmidi");
+ Output_def *paper = unsmob_output_def (id);
+ paper = paper ? paper->clone () : new Output_def;
+ paper->set_variable (ly_symbol2scm ("is-midi"), SCM_BOOL_T);
+ return paper;
+}
+
+
+Book_output_def*
get_bookpaper (My_lily_parser *parser)
{
SCM id = parser->lexer_->lookup_identifier ("$defaultbookpaper");
- Book_paper_def *paper = unsmob_book_paper_def (id);
- return paper->clone ();
+ Book_output_def *paper = unsmob_book_output_def (id);
+
+ paper = paper ? dynamic_cast<Book_output_def*> (paper->clone ()) : new Book_output_def;
+ paper->set_variable (ly_symbol2scm ("is-bookpaper"), SCM_BOOL_T);
+ return paper;
}
if (score->defs_.is_empty ())
{
- Music_output_def *paper = get_paper (parser);
+ Output_def *paper = get_paper (parser);
default_rendering (score->music_, paper->self_scm (),
get_bookpaper (parser)->self_scm (),
header, os);
{
My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
Book *book = unsmob_book (book_smob);
- Book_paper_def *bp = unsmob_book_paper_def (parser->lexer_->lookup_identifier ("$defaultbookpaper"));
+ Book_output_def *bp = unsmob_book_output_def (parser->lexer_->lookup_identifier ("$defaultbookpaper"));
SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "Lilypond parser");
SCM_ASSERT_TYPE (book, book_smob, SCM_ARG2, __FUNCTION__, "Book");
if (*c)
outname.base_ += "-" + to_string (*c);
(*c)++;
- Music_output_def *paper = get_paper (parser);
+ Output_def *paper = get_paper (parser);
book->process (outname.to_string (), paper, header);
scm_gc_unprotect_object (paper->self_scm ());
return SCM_UNDEFINED;
#include "note-column.hh"
#include "note-head.hh"
#include "rhythmic-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "axis-group-interface.hh"
#include "item.hh"
#include "stem.hh"
#include "note-column.hh"
#include "stem.hh"
#include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "group-interface.hh"
#include "staff-symbol-referencer.hh"
#include "rest.hh"
#include "rhythmic-head.hh"
#include "staff-symbol-referencer.hh"
#include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
/*
Note_head contains the code for printing note heads.
#include <ctype.h>
#include "rhythmic-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "event.hh"
#include "dots.hh"
#include "dot-column.hh"
#include "separation-item.hh"
#include "staff-spacing.hh"
#include "accidental-placement.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
/*
#include "spanner.hh"
#include "font-interface.hh"
#include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "warn.hh"
#include "paper-column.hh"
#include "staff-symbol-referencer.hh"
Interval span_points;
Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
- Paper_def * paper = me->get_paper ();
+ Output_def * paper = me->get_paper ();
Drul_array<bool> broken;
#include "dimensions.hh"
#include "ly-module.hh"
#include "page.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-outputter.hh"
#include "paper-line.hh"
#include "stencil.hh"
int Page::page_count_ = 0;
Real Page::MIN_COVERAGE_ = 0.66;
-Book_paper_def *
+Book_output_def *
Page::bookpaper () const
{
- return paper_->bookpaper_;
+ return dynamic_cast<Book_output_def*> ( paper_->parent_);
}
-Page::Page (Paper_def *paper, int number)
+Page::Page (Output_def *paper, int number)
{
copyright_ = SCM_EOL;
footer_ = SCM_EOL;
#include "main.hh"
#include "page.hh"
#include "paper-book.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-outputter.hh"
#include "paper-line.hh"
#include "paper-score.hh"
/* Generate all stencils to trigger font loads. */
SCM pages = this->pages ();
- Paper_def *paper = score_lines_[0].paper_;
- Paper_outputter *out = paper->get_paper_outputter (outname);
+ Output_def *paper = score_lines_[0].paper_;
+ Paper_outputter *out = get_paper_outputter (outname);
int page_count = scm_ilength (pages);
- out->output_header (paper->bookpaper_, scopes (0), page_count, false);
+
+ out->output_header (paper->parent_, scopes (0), page_count, false);
for (SCM s = pages; s != SCM_EOL; s = ly_cdr (s))
{
Paper_book::classic_output (String outname)
{
int count = score_lines_.size ();
- Paper_def * p = score_lines_.top ().paper_;
- Paper_outputter *out = p->get_paper_outputter (outname);
- out->output_header (p->bookpaper_, scopes (count - 1), 0, true);
+ Paper_outputter *out = get_paper_outputter (outname);
+
+ Output_def * p = score_lines_.top ().paper_;
+ while (p && p->parent_)
+ p = p->parent_;
+
+ out->output_header (p, scopes (count - 1), 0, true);
SCM top_lines = score_lines_.top ().lines_;
Paper_line *first = unsmob_paper_line (scm_vector_ref (top_lines,
}
}
- Paper_def *paper = score_lines_[0].paper_;
+ Output_def *paper = score_lines_[0].paper_;
SCM scopes = this->scopes (0);
SCM make_tagline = paper->c_variable ("make-tagline");
{
init ();
Page::page_count_ = 0;
- Paper_def *paper = score_lines_[0].paper_;
+ Output_def *paper = score_lines_[0].paper_;
Page *page = new Page (paper, 1);
Real text_height = page->text_height ();
#include "text-item.hh"
#include "lookup.hh"
#include "font-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
-/*
- paper-def.cc -- implement Paper_def
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#include <math.h>
-
-#include "book-paper-def.hh"
-#include "virtual-font-metric.hh"
-#include "all-font-metrics.hh"
-#include "string.hh"
-#include "misc.hh"
-#include "paper-def.hh"
-#include "warn.hh"
-#include "scaled-font-metric.hh"
-#include "main.hh"
-#include "scm-hash.hh"
-#include "paper-outputter.hh"
-#include "ly-module.hh"
-
-/*
- This is an almost empty thing. The only substantial thing this class
- handles is scaling up and down to real-world dimensions (internally
- dimensions are against global staff-space.)
- */
-
-Paper_def::Paper_def ()
-{
- bookpaper_ = 0;
-}
-
-Paper_def::Paper_def (Paper_def const&src)
- : Music_output_def (src)
-{
- /* Do not remove this statement, scm_make_hash_table may trigger GC. */
- bookpaper_ = 0;
-}
-
-Paper_def::~Paper_def ()
-{
-}
-
-Real
-Paper_def::get_dimension (SCM s) const
-{
- SCM val = lookup_variable (s);
- return ly_scm2double (val);
-}
-
-/* FIXME. This is broken until we have a generic way of
- putting lists inside the \paper block. */
-Interval
-Paper_def::line_dimensions_int (int n) const
-{
- Real lw = get_dimension (ly_symbol2scm ("linewidth"));
- Real ind = n? 0.0:get_dimension (ly_symbol2scm ("indent"));
-
- return Interval (ind, lw);
-}
-
-Paper_outputter*
-Paper_def::get_paper_outputter (String outname) const
-{
- progress_indication (_f ("paper output to `%s'...",
- outname == "-" ? String ("<stdout>") : outname));
- return new Paper_outputter (outname);
-
-}
-
-Paper_def*
-unsmob_paper (SCM x)
-{
- return dynamic_cast<Paper_def*> (unsmob_music_output_def (x));
-}
-
-
-LY_DEFINE (ly_paper_def_p, "ly:paper-def?",
- 1, 0, 0, (SCM def),
- "Is @var{def} a paper definition?")
-{
- Paper_def *op = dynamic_cast<Paper_def*> (unsmob_music_output_def (def));
-
- bool pap = op;
- return ly_bool2scm (pap);
-}
#include "main.hh"
#include "page.hh"
#include "paper-book.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-line.hh"
#include "paper-outputter.hh"
#include "file-name.hh"
}
void
-Paper_outputter::output_metadata (Book_paper_def *paper, SCM scopes)
+Paper_outputter::output_metadata (Output_def *paper, SCM scopes)
{
SCM fields = SCM_EOL;
for (int i = dump_header_fieldnames_global.size (); i--; )
}
void
-Paper_outputter::output_header (Book_paper_def * bookpaper,
-
+Paper_outputter::output_header (Output_def * bookpaper,
SCM scopes,
int page_count,
bool is_classic)
}
void
-Paper_outputter::output_music_output_def (Music_output_def *odef)
+Paper_outputter::output_music_output_def (Output_def *odef)
{
output_scheme (scm_list_2 (ly_symbol2scm ("output-paper-def"),
odef->self_scm ()));
(void*) this, Offset (0,0));
}
+Paper_outputter*
+get_paper_outputter (String outname)
+{
+ progress_indication (_f ("paper output to `%s'...",
+ outname == "-" ? String ("<stdout>") : outname));
+ return new Paper_outputter (outname);
+
+}
#include "warn.hh"
#include "font-metric.hh"
#include "spanner.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "system.hh"
#include "paper-column.hh"
#include "paper-score.hh"
#include "lilypond-input-version.hh"
#include "ly-module.hh"
#include "main.hh"
-#include "midi-def.hh"
#include "misc.hh"
#include "music-list.hh"
#include "music-sequence.hh"
#include "my-lily-lexer.hh"
#include "my-lily-parser.hh"
#include "paper-book.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "scm-hash.hh"
#include "scm-option.hh"
#include "score.hh"
%union {
Book *book;
- Book_paper_def *bookpaper;
- Music_output_def *outputdef;
+ Book_output_def *bookpaper;
+ Output_def *outputdef;
SCM scm;
String *string;
Music *music;
}
| output_def {
SCM id = SCM_EOL;
- if (dynamic_cast<Paper_def*> ($1))
- id = scm_makfrom0str ("$defaultpaper");
- else if (dynamic_cast<Midi_def*> ($1))
- id = scm_makfrom0str ("$defaultmidi");
+ if ($1->c_variable ("is-paper") == SCM_BOOL_T)
+ id = ly_symbol2scm ("$defaultpaper");
+ else if ($1->c_variable ("is-midi") == SCM_BOOL_T)
+ id = ly_symbol2scm ("$defaultmidi");
+ else if ($1->c_variable ("is-book-paper") == SCM_BOOL_T)
+ id = ly_symbol2scm ("$defaultbookpaper");
+
THIS->lexer_->set_identifier (id, $1->self_scm ());
scm_gc_unprotect_object ($1->self_scm ());
}
| book_paper_block {
- THIS->lexer_->set_identifier (scm_makfrom0str ("$defaultbookpaper"), $1->self_scm ());
+ THIS->lexer_->set_identifier (ly_symbol2scm ("$defaultbookpaper"), $1->self_scm ());
scm_gc_unprotect_object ($1->self_scm ());
}
;
;
book_paper_head:
BOOKPAPER '{' {
- $$ = unsmob_book_paper_def (THIS->lexer_->lookup_identifier ("$defaultbookpaper"))->clone ();
+ $$ = get_bookpaper (THIS);
THIS->lexer_->add_scope ($$->scope_);
}
;
{
$$ = new Book;
$$->set_spot (THIS->here_input ());
- $$->bookpaper_ = unsmob_book_paper_def (THIS->lexer_->lookup_identifier ("$defaultbookpaper"))->clone ();
+ $$->bookpaper_ = dynamic_cast<Book_output_def*> (unsmob_book_output_def (THIS->lexer_->lookup_identifier ("$defaultbookpaper"))->clone ());
scm_gc_unprotect_object ($$->bookpaper_->self_scm ());
}
| book_body book_paper_block {
music_output_def_head:
MIDI {
- Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultmidi"));
-
-
- Midi_def *p = 0;
- if (id)
- p = dynamic_cast<Midi_def*> (id->clone ());
- else
- p = new Midi_def;
-
+ Output_def *p = get_midi (THIS);
$$ = p;
THIS->lexer_->add_scope (p->scope_);
}
| PAPER {
- Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"));
- Paper_def *p = 0;
- if (id)
- p = dynamic_cast<Paper_def*> (id->clone ());
- else
- p = new Paper_def;
+ Output_def* p = get_paper (THIS);
+
THIS->lexer_->add_scope (p->scope_);
$$ = p;
}
| music_output_def_head '{' MUSIC_OUTPUT_DEF_IDENTIFIER {
scm_gc_unprotect_object ($1->self_scm ());
- Music_output_def *o = unsmob_music_output_def ($3);
+ Output_def *o = unsmob_output_def ($3);
o->input_origin_.set_spot (THIS->here_input ());
$$ = o;
THIS->lexer_->remove_scope ();
}
| music_output_def_body context_def_spec_block {
- $$->assign_context_def ($2);
+ assign_context_def ($$, $2);
}
| music_output_def_body tempo_event {
/*
junk this ? there already is tempo stuff in
music.
*/
- int m = ly_scm2int ( $2->get_property ("metronome-count"));
+ int m = ly_scm2int ($2->get_property ("metronome-count"));
Duration *d = unsmob_duration ($2->get_property ("tempo-unit"));
- Midi_def *md = dynamic_cast<Midi_def*> ($$);
- if (md)
- md->set_tempo (d->get_length (), m);
+ set_tempo ($$, d->get_length (), m);
scm_gc_unprotect_object ($2->self_scm ());
}
| music_output_def_body error {
Book *book = new Book;
book->scores_.push (score);
- Music_output_def *paper = get_paper (THIS);
+ Output_def *paper = get_paper (THIS);
book->bookpaper_ = get_bookpaper (THIS);
SCM s = book->to_stencil (paper, THIS->header_);
} else if (unsmob_duration (sid)) {
*destination = unsmob_duration (sid)->smobbed_copy ();
return DURATION_IDENTIFIER;
- } else if (unsmob_music_output_def (sid)) {
- Music_output_def *p = unsmob_music_output_def (sid);
+ } else if (unsmob_output_def (sid)) {
+ Output_def *p = unsmob_output_def (sid);
p = p->clone ();
*destination = p->self_scm ();
#include "file-name.hh"
#include "lily-version.hh"
#include "main.hh"
-#include "midi-def.hh"
#include "midi-item.hh"
#include "midi-stream.hh"
#include "performance.hh"
#include "note-column.hh"
#include "stem.hh"
#include "rhythmic-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "rest.hh"
#include "group-interface.hh"
#include "staff-symbol-referencer.hh"
*/
#include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "font-interface.hh"
#include "rest.hh"
#include "dots.hh"
#include "score-engraver.hh"
#include "paper-score.hh"
#include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "axis-group-interface.hh"
#include "context-def.hh"
#include "staff-spacing.hh"
pscore_ = new Paper_score;
- pscore_->paper_ = dynamic_cast<Paper_def*> (get_output_def ());
+ pscore_->paper_ = dynamic_cast<Output_def*> (get_output_def ());
SCM props = updated_grob_properties (context (), ly_symbol2scm ("System"));
*/
#include "score-performer.hh"
-#include "midi-def.hh"
#include "audio-column.hh"
#include "audio-item.hh"
#include "performance.hh"
#include "string-convert.hh"
#include "warn.hh"
#include "context-def.hh"
+#include "output-def.hh"
int
Score_performer::get_tempo () const
{
- return performance_->midi_->get_tempo (Moment (Rational (1, 4)));
+ return ::get_tempo (performance_->midi_, Moment (Rational (1, 4)));
}
Score_performer::initialize ()
{
performance_ = new Performance;
- performance_->midi_ = dynamic_cast<Midi_def*> (get_output_def ());
+ performance_->midi_ = get_output_def ();
Translator_group::initialize ();
}
#include "ly-smobs.icc"
#include "main.hh"
#include "music-iterator.hh"
-#include "music-output-def.hh"
+#include "output-def.hh"
#include "music-output.hh"
#include "music.hh"
#include "paper-book.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-score.hh"
#include "scm-hash.hh"
#include "score.hh"
"and @var{mus} is interpreted with it. "
"The context is returned in its final state.")
{
- Music_output_def *odef = unsmob_music_output_def (output_def);
+ Output_def *odef = unsmob_output_def (output_def);
Music *music = unsmob_music (mus);
SCM_ASSERT_TYPE (music, mus, SCM_ARG1, __FUNCTION__, "Music");
SCM book_outputdef,
SCM header, SCM outname)
{
- Book_paper_def *bpd = unsmob_book_paper_def (book_outputdef);
- if (bpd && unsmob_paper (outdef))
+ Book_output_def *bpd = unsmob_book_output_def (book_outputdef);
+ if (bpd && unsmob_output_def (outdef))
/* FIXME: memory leak */
- outdef = bpd->scale_paper (unsmob_paper (outdef))->self_scm ();
+ outdef = bpd->scale_paper (unsmob_output_def (outdef))->self_scm ();
SCM context = ly_run_translator (music, outdef);
SCM
Score::book_rendering (String outname,
- Book_paper_def* paperbook,
- Music_output_def *default_def,
- Paper_def **paper)
+ Book_output_def* paperbook,
+ Output_def *default_def,
+ Output_def **paper)
{
SCM out = scm_makfrom0str (outname.to_str0 ());
SCM systems = SCM_EOL;
int outdef_count = defs_.size ();
for (int i = 0; !i || i < outdef_count; i++)
{
- Music_output_def *def = outdef_count ? defs_[i] : default_def;
- if (Paper_def * pd = dynamic_cast<Paper_def*> (def))
+ Output_def *def = outdef_count ? defs_[i] : default_def;
+ if (Output_def * pd = dynamic_cast<Output_def*> (def))
{
def = paperbook->scale_paper (pd);
}
- if (!(no_paper_global_b && dynamic_cast<Paper_def*> (def)))
+ if (!(no_paper_global_b && dynamic_cast<Output_def*> (def)))
{
SCM context = ly_run_translator (music_, def->self_scm ());
if (Global_context *g = dynamic_cast<Global_context*>
#include "script.hh"
#include "font-interface.hh"
#include "side-position-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "item.hh"
#include "stencil.hh"
#include "lookup.hh"
#include "separating-group-spanner.hh"
#include "separation-item.hh"
#include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "dimensions.hh"
#include "group-interface.hh"
#include "separating-group-spanner.hh"
#include "separation-item.hh"
#include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "engraver.hh"
#include "axis-group-interface.hh"
#include "note-spacing.hh"
*/
#include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "slur-bezier-bow.hh"
Slur_bezier_bow::Slur_bezier_bow (Array<Offset> encompass, Direction dir,
#include "group-interface.hh"
#include "slur.hh"
#include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "note-column.hh"
#include "stem.hh"
#include "paper-column.hh"
#include "main.hh"
#include "system.hh"
#include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-score.hh"
#include "paper-column.hh"
#include "item.hh"
#include "span-bar.hh"
#include "font-interface.hh"
#include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "stencil.hh"
#include "warn.hh"
#include "axis-group-interface.hh"
#include "score.hh"
#include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "side-position-interface.hh"
#include "engraver.hh"
#include "moment.hh"
#include "staff-symbol-referencer.hh"
#include "staff-symbol.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "libc-extension.hh"
#include "lookup.hh"
#include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "stencil.hh"
#include "warn.hh"
#include "item.hh"
#include "directional-element-interface.hh"
#include "item.hh"
#include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "staff-symbol-referencer.hh"
#include "stem-tremolo.hh"
#include "stem.hh"
#include "note-head.hh"
#include "stem.hh"
#include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "rhythmic-head.hh"
#include "font-interface.hh"
#include "stencil.hh"
#include "staff-symbol.hh"
#include "group-interface.hh"
#include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "spanner.hh"
class System_start_delimiter_engraver : public Engraver
#include "axis-group-interface.hh"
#include "system-start-delimiter.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "stencil.hh"
#include "font-interface.hh"
#include "all-font-metrics.hh"
#include "system.hh"
#include "main.hh"
#include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-outputter.hh"
#include "paper-score.hh"
#include "string.hh"
#include <stdio.h>
#include "rhythmic-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "event.hh"
#include "dots.hh"
#include "dot-column.hh"
#include "text-item.hh"
#include "font-interface.hh"
#include "virtual-font-metric.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "scaled-font-metric.hh"
MAKE_SCHEME_CALLBACK (Text_item, interpret_string, 4)
SCM
Text_item::interpret_string (SCM paper, SCM props, SCM encoding, SCM markup)
{
- Paper_def *pap = unsmob_paper (paper);
+ Output_def *pap = unsmob_output_def (paper);
SCM_ASSERT_TYPE(pap, paper, SCM_ARG1, __FUNCTION__, "Paper definition");
SCM_ASSERT_TYPE(ly_c_string_p (markup), markup, SCM_ARG3, __FUNCTION__, "string");
#include "spanner.hh"
#include "font-interface.hh"
#include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "warn.hh"
#include "paper-column.hh"
#include "staff-symbol-referencer.hh"
/* Ugh, must be same as Hairpin::print. */
Grob *common = spanner->get_bound (LEFT)->common_refpoint (spanner->get_bound (RIGHT), X_AXIS);
- Paper_def * paper = me->get_paper ();
+ Output_def * paper = me->get_paper ();
SCM flare = me->get_property ("bracket-flare");
SCM shorten = me->get_property ("shorten-pair");
#include "spanner.hh"
#include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "tie.hh"
#include "rhythmic-head.hh"
#include "bezier.hh"
#include "stencil.hh"
#include "text-item.hh"
#include "time-signature.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "font-interface.hh"
#include "warn.hh"
#include "staff-symbol-referencer.hh"
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "music-output-def.hh"
+#include "output-def.hh"
#include "translator-group.hh"
#include "translator.hh"
#include "warn.hh"
return daddy_context_->now_mom ();
}
-Music_output_def *
+Output_def *
Translator::get_output_def () const
{
return daddy_context_->get_output_def ();
#include "warn.hh"
#include "font-interface.hh"
#include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "text-item.hh"
#include "tuplet-bracket.hh"
#include "stem.hh"
SCM number = me->get_property ("text");
- Paper_def *pap = me->get_paper ();
+ Output_def *pap = me->get_paper ();
Stencil num;
if (ly_c_string_p (number) && number_visibility)
{
#include "staff-symbol-referencer.hh"
#include "font-interface.hh"
#include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "paper-column.hh"
/*
#include "lookup.hh"
#include "staff-symbol-referencer.hh"
#include "note-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "bezier.hh"
#include "warn.hh"
#include "virtual-font-metric.hh"
#include "all-font-metrics.hh"
#include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
/*
#include "line-interface.hh"
#include "stencil.hh"
#include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
#include "text-item.hh"
#include "volta-bracket.hh"
#include "group-interface.hh"
(strcmp (cs,":|")!=0 && strcmp (cs,"|:")!=0 && strcmp (cs,"|.")!=0
&& strcmp (cs,":|:")!=0 && strcmp (cs,".|")!=0);
- Paper_def * paper =me->get_paper ();
+ Output_def * paper =me->get_paper ();
Real half_space = 0.5;
Item * bound = dynamic_cast<Spanner*> (me)->get_bound (LEFT);
\version "2.3.2"
+
\bookpaper {
+#(define-public is-bookpaper #t)
#(define-public (book-title paper scopes)
"Generate book title from header strings."
%
#(define-public $defaultbookpaper (ly:make-bookpaper 1.7573))
-
+
\include "book-paper-defaults.ly"
#(set-default-paper-size "a4")
(paper (ly:grob-paper grob))
(text (interpret-markup
paper
- (ly:grob-alist-chain grob (ly:paper-lookup paper 'text-font-defaults))
+ (ly:grob-alist-chain grob (ly:output-def-lookup paper 'text-font-defaults))
letter)))
(let ((x (/ (- (cdr (ly:stencil-extent slur 0))
(plain (font-command font #f))
(designsize (ly:font-design-size font))
(magnification (* (ly:font-magnification font)))
- (ops (ly:paper-lookup paper 'outputscale))
+ (ops (ly:output-def-lookup paper 'outputscale))
(scaling (* ops magnification designsize)))
(string-append
"%%Creator: " creator " " time-stamp "\n"
"%%Pages: " (number->string page-count) "\n"
"%%PageOrder: Ascend\n"
- "%%DocumentPaperSizes: " (ly:paper-lookup paper 'papersize) "\n"
+ "%%DocumentPaperSizes: " (ly:output-def-lookup paper 'papersize) "\n"
;;(string-append "GNU LilyPond (" (lilypond-version) "), ")
;; (strftime "%c" (localtime (current-time))))
;; FIXME: duplicated in every backend
(define-public (page-properties paper)
(list (append `((linewidth . ,(ly:paper-get-number
paper 'linewidth)))
- (ly:paper-lookup paper 'text-font-defaults))))
+ (ly:output-def-lookup paper 'text-font-defaults))))
(define-public (plain-header paper page-number)
(let ((props (page-properties paper) ))
(let*
((scale (ly:bookpaper-outputscale bookpap))
(new-pap (ly:output-def-clone pap))
- (dim-vars (ly:paper-lookup pap 'dimension-variables))
+ (dim-vars (ly:output-def-lookup pap 'dimension-variables))
(scope (ly:output-def-scope new-pap)))
(for-each
(lambda (v)
(module-define! scope v
- (/ (ly:paper-lookup pap v) scale)))
+ (/ (ly:output-def-lookup pap v) scale)))
dim-vars)
ly:paper-line-number
ly:paper-line-stencil
ly:paper-line?
- ly:paper-lookup
+ ly:output-def-lookup
ly:parse-string
ly:parser-parse-string
ly:parser-print-book
else:
return m.group (0)
- return re.sub (r'\\([a-zA-Z]+)Context\b', func, str)
+ str = re.sub (r'\\([a-zA-Z]+)Context\b', func, str)
+
+ str = re.sub ('ly:paper-lookup', 'ly:output-def-lookup', str)
+ return str
conversions.append (((2, 3, 2), conv,
'''\\FooContext -> \\Foo'''))
indent = 0.0\mm''',
NOTIME : r'''
\context {
- \StaffContext
+ \Staff
\remove Time_signature_engraver
}''',
QUOTE : r'''