From: fred Date: Sun, 24 Mar 2002 20:00:16 +0000 (+0000) Subject: lilypond-0.1.22 X-Git-Tag: release/1.5.59~3736 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=59d8421c3e67fa461d62feda580d747f110c0a0d;p=lilypond.git lilypond-0.1.22 --- diff --git a/bin/Makefile b/bin/Makefile index 4b3c40476d..7850aabe65 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -4,24 +4,26 @@ depth = .. include $(depth)/make/Include.make # list of distribution files: -SCRIPTS = clearlily cpgento make-patch lily.efence \ - make-version release conflily clean-fonts -PERL_SCRIPTS_IN = $(wildcard *.in) -PERL_SCRIPTS = $(addprefix $(outdir)/, $(PERL_SCRIPTS_IN:.in=)) +PERL_SCRIPTS_IN = $(wildcard *.pl) +PERL_SCRIPTS = $(addprefix $(outdir)/, $(PERL_SCRIPTS_IN:.pl=)) +SH_SCRIPTS_IN = $(wildcard *.sh) +SH_SCRIPTS = $(addprefix $(outdir)/, $(SH_SCRIPTS_IN:.sh=)) PYTHON_SCRIPTS_IN = $(wildcard *.py) PYTHON_SCRIPTS = $(addprefix $(outdir)/, $(PYTHON_SCRIPTS_IN:.py=)) -EXTRA_DISTFILES = $(SCRIPTS) $(PERL_SCRIPTS_IN) $(PYTHON_SCRIPTS_IN) -# +EXTRA_DISTFILES = $(SH_SCRIPTS_IN) $(PERL_SCRIPTS_IN) $(PYTHON_SCRIPTS_IN) -all: $(PERL_SCRIPTS) $(PYTHON_SCRIPTS) -$(outdir)/%: %.in -# cd .. && CONFIG_FILES=bin/$(notdir $@) CONFIG_HEADERS= ./config.status -# mv $(< :.in=) $@ -# this nukes make/out/Configure_variables.make. +all: $(PERL_SCRIPTS) $(PYTHON_SCRIPTS) $(SH_SCRIPTS) + +$(outdir)/%: %.pl sed 's!@PERL@!$(PERL)!' < $< > $@ chmod 755 $@ +#FIXME. Check for bash? +$(outdir)/%: %.sh + sed 's!@SH@!$(SH)!' < $< > $@ + chmod 755 $@ + $(outdir)/%: %.py sed 's!@PYTHON@!$(PYTHON)!' < $< > $@ chmod 755 $@ diff --git a/bin/clean-diaper.sh b/bin/clean-diaper.sh new file mode 100644 index 0000000000..284346da82 --- /dev/null +++ b/bin/clean-diaper.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# unclobber current dir. +rm -vf *.aux *.log `grep -li "^% Creator: GNU LilyPond" *.out` *.orig *~ +rm -vf `grep -li "Creator: mi2mu" *.midi.ly` +rm -vf `grep -li "Creator: GNU LilyPond" *.midi` +rm -vf `find -name 'core'` +rm -vf `find -name *.orig` +rm -vf `find -name *.rej` + +# docxx mess +rm -vf *dvi +rm -vf *.class HIER*.html dxxgifs.tex gifs.db icon?.gif logo.gif down.gif \ + aindex.html index.html diff --git a/bin/make-website.pl b/bin/make-website.pl new file mode 100644 index 0000000000..1d690e23ad --- /dev/null +++ b/bin/make-website.pl @@ -0,0 +1,356 @@ +#!@PERL@ -w +# -*-Perl-*- + + +# stupid script to generate WWW site. The WWW site is my +# test-suite for LilyPond, I usually don't distribute versions that +# fail to make the website + +use FileHandle; +use Getopt::Long; + +my $lily_version; +my $footstr; +my $mw_id = ""; +my $id_str = "make-website 0.4"; +my $TAR="tar"; +my $MAKE="make"; + +sub get_version +{ + my ($vstr)=(""); + open V, "$depth/VERSION"; + while () { + s/#.*$//g; + next if (/^ *$/); + s/^/\$/; + s/= *(.*)$/=\"$1\";/; + $vstr .= $_; + } + eval ($vstr); + + $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL"; + + # stupid checks. + $lily_version= $lily_version; + + close V; +} + +sub set_html_footer +{ + my $MAILADDRESS=$ENV{MAILADDRESS}; + my @pw=(getpwuid($<)); + my $username=$pw[6]; + + $footstr = + "\n
Please take me back to the index\n +of LilyPond -- The GNU Project Music typesetter +
+ +This page was built using " . $id_str . " from lilypond-" + . $lily_version . + " by

+


$username <" . $MAILADDRESS .">
+

"; +} + + +# do something, check return status +sub my_system +{ + my (@cmds) = @_; + foreach $cmd (@cmds) { + my ($ignoreret)=0; + if ( $cmd =~ /^-/ ) { + $ignoreret = 1; + $cmd = substr ($cmd, 1); + } + + my $ret = ( system ($cmd)); + if ($ret) { + if ($ignoreret) { + print STDERR "ignoring failed command \`$cmd\' (status $ret)\n"; + }else { + print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n"; + exit 2; + } + } + } +} + + +local $base="lilypond/"; + +local @examples=("twinkle-pop", + "wtk1-fugue2", + "standchen-16", + "standchen-20", + "wtk1-prelude1", + "toccata-fuga-E", + "scsii-menuetto", + "cadenza", + "gallina", + "twinkle", + "collisions", + "font", + #"scales", + "rhythm", + "multi" ); + + +sub gen_html +{ + print "generating HTML\n"; + my_system "$MAKE -kC .. html"; +} + +sub gen_examples +{ + print "generating examples: \n"; + my @todo=(); + foreach $a (@examples) { + push @todo, "out/$a.ps.gz", "out/$a.gif", "out/$a.ly.txt"; + } + + my_system ("$MAKE -C .. " . join(' ', @todo)); +} + +my @texstuff = ("mudela-man", "mudela-course"); + +sub gen_manuals +{ + print "generating TeX doco list\n"; + open HTMLLIST, ">tex_manuals.html"; + print HTMLLIST "PostScript Manuals\n" ; + print HTMLLIST "

LilyPond manuals (in PostScript)

"; + print HTMLLIST ""; + + print HTMLLIST ""; + close HTMLLIST; + + my_system( "$MAKE -C .. " . join(' ', @todo)); +} + +sub gen_list +{ + print "generating HTML list\n"; + open HTMLLIST, ">example_output.html"; + + print HTMLLIST "Rendered Examples\n +These example files are taken from the LilyPond distribution. +LilyPond currently only outputs TeX and MIDI. The pictures and +PostScript files were generated using TeX, Ghostscript and some +graphics tools. The papersize used for these examples is A4. The GIF +files have been scaled to eliminate aliasing."; + + + + foreach $a (@examples) + { + $name=$a; print HTMLLIST "

example file: $name

\n\n"; + + open IF, "$depth/input/$a.ly"; + input_record_separator IF "\n}"; + + $desc = <IF>; + close IF; + + print HTMLLIST "$desc\n"; + + $inputf="$a.ly.txt"; + $giff="$a.gif"; + $jpegf="$a.jpeg"; + $pngf = "$a.png"; + $psf="$a.ps.gz"; + $midif="$a.midi"; + + print HTMLLIST ""; + } + print HTMLLIST ""; + close HTMLLIST; +} + +sub edit_html +{ + print STDERR "adding footer\n"; + + OUTER: + foreach $a (<*.html>) { + open H, "$a"; + my $sep=""; + input_record_separator H $sep; + my $file=""; + + while () { + if (/$mw_id/) { + close H; + next OUTER; + } + $file .= $_; + + } + close H; + + my $subst = $footstr; + $subst .= $back if (! $a =~ /index.html/ ); + $file =~ s/$sep/$subst$sep/g ; + $file =~ s/\.gif/\.$image/g; + $file =~ s!(.*)!LilyPond WWW: $1!g; + open H, ">$a"; + print H $mw_id; + + print H $file; + close H; + } +} + +sub copy_txt_file +{ + my ($f) = @_; + my $d = $f; + $d =~ s!^.*\/!!; + if (! $f =~ /.txt$/) { + $d = "$f.txt"; + } + print, $d; +} + +sub top_of_NEWS +{ + open NEWS, "NEWS.txt"; + input_record_separator NEWS "****"; + $desc = ; + chop ($desc); + close NEWS; + + return $desc; +} + +sub edit_index +{ + $ton = top_of_NEWS(); + $ton = "\n\n$ton\n\n"; + open INDEX, "index.html"; + input_record_separator NEWS undef; + $index = ; + close INDEX; + $index =~ s/top_of_NEWS/$ton/; + open INDEX, ">index.html"; + print INDEX $index; + close INDEX; +} + + +sub copy_files +{ + print "copying files\n"; + my_system "ln -s $depth/out ./docxx" if ( ! -x "docxx" ) ; + my_system "cp $depth/TODO ./TODO.txt", + "cp $depth/ANNOUNCE ./ANNOUNCE.txt", + "cp $depth/NEWS ./NEWS.txt", + "cp $depth/DEDICATION ./DEDICATION.txt"; + my_system "make -C .. gifs"; + +} + +sub set_images +{ + for $a (<*.gif>) { + if ($opt_png) { + my_system "gif2png -d $a"; + } + if ($opt_jpeg) { + my $b=$a; + $b =~ s/.gif/.jpeg/; + my_system "cjpeg -o $b $a"; + } + } +} + +sub docxx_update +{ + open BANNER, ">/tmp/lilybanner.html"; + my $ban = $footstr; + $ban =~ s!index.html!../index.html!g; + print BANNER $ban; + close BANNER; + my_system "BANNEROPT=\"-B /tmp/lilybanner.html\" $depth/bin/out/make-docxx"; +} + +sub do_tar +{ + print "tarring.\n"; + $files = join (' ', < *.html *.$image *.ps.gz *.txt *.midi docxx/*>); + my_system + "-$TAR zvhcf website.tar.gz $files;", +# "gzip -f9 website.tar;"; +} + +sub identify +{ + print STDERR "This is " . $id_str . "\n"; + +} +sub main +{ + identify; + GetOptions("jpeg", "gif", "png", "noexamples"); + + local $image="gif" ; + $image = "png" if ($opt_png); + $image = "jpeg" if ($opt_jpeg); + + $depth = "../"; + my $cwd; + chomp($cwd = `pwd`); + die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/)); + get_version; + print "lily v. " . $lily_version . "\n"; + set_html_footer; + + + $depth = "../../"; + + chdir ("out"); + $ENV{"TEXINPUTS"} .= ":$depth/input/:"; + $ENV{"LILYINCLUDE"} = "$depth/input/"; + + + gen_html; + copy_files; + + if (! $opt_noexamples) { + gen_examples; + gen_list; + gen_manuals; + } + set_images; + + edit_html; + edit_index; + docxx_update; + do_tar; +} + +main; diff --git a/flower/include/string.hh b/flower/include/string.hh index 9e60bf9858..69226f075b 100644 --- a/flower/include/string.hh +++ b/flower/include/string.hh @@ -83,10 +83,7 @@ public: Byte const* byte_C() const; char* ch_l(); Byte* byte_l(); -#if 0 - /// deprecated; use ch_C() - operator char const*() const { return ch_C(); } -#endif + String &operator =(String const & source); /// concatenate s diff --git a/lily/molecule.cc b/lily/molecule.cc index 4dfe7d6c13..f054a28021 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -40,10 +40,10 @@ Molecule::translate (Offset o) } void -Molecule::translate (Real x,Axis a) +Molecule::translate_axis (Real x,Axis a) { for (iter_top (ats,c); c.ok(); c++) - c->translate (x,a); + c->translate_axis (x,a); } void @@ -66,7 +66,7 @@ Molecule::add_at_edge (Axis a, Direction d, Molecule const &m) } Real offset = extent ()[a][d] - m.extent ()[a][-d]; Molecule toadd (m); - toadd.translate (offset, a); + toadd.translate_axis (offset, a); add (toadd); } diff --git a/lily/note-head.cc b/lily/note-head.cc new file mode 100644 index 0000000000..529e28d895 --- /dev/null +++ b/lily/note-head.cc @@ -0,0 +1,87 @@ +/* + notehead.cc -- implement Note_head + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "misc.hh" +#include "dots.hh" +#include "note-head.hh" +#include "dimen.hh" +#include "debug.hh" +#include "paper-def.hh" +#include "lookup.hh" +#include "molecule.hh" +#include "musical-request.hh" + + +Note_head::Note_head () +{ + x_dir_ = CENTER; + staff_size_i_= 8; // UGH + position_i_ = 0; + extremal_i_ = 0; +} + +void +Note_head::do_pre_processing () +{ + // 8 ball looks the same as 4 ball: + if (balltype_i_ > 2) + balltype_i_ = 2; + if (dots_l_) // move into Rhythmic_head? + dots_l_->position_i_ = position_i_; +} + +IMPLEMENT_IS_TYPE_B1(Note_head,Rhythmic_head); + + +int +Note_head::compare (Note_head *const &a, Note_head * const &b) +{ + return a->position_i_ - b->position_i_; +} + +Interval +Note_head::do_width () const +{ + Atom a = paper ()->lookup_l()->ball (balltype_i_); + Interval i = a.dim_[X_AXIS]; + i+= x_dir_ * i.length (); + return i; +} + +Molecule* +Note_head::brew_molecule_p() const +{ + Molecule*out = 0; + Paper_def *p = paper(); + Real inter_f = p->internote_f (); + + // ugh + int streepjes_i = abs(position_i_) < staff_size_i_/2 + ? 0 + : (abs(position_i_) - staff_size_i_/2) /2; + + Atom s = p->lookup_l()->ball (balltype_i_); + out = new Molecule (Atom (s)); + out->translate_axis (x_dir_ * s.dim_[X_AXIS].length (), X_AXIS); + + if (streepjes_i) + { + int dir = sign (position_i_); + + Atom streepje = p->lookup_l()->streepjes (balltype_i_, dir* streepjes_i); + + Molecule sm; + sm.add (streepje); + if (position_i_ % 2) + sm.translate_axis (-inter_f* dir, Y_AXIS); + out->add (sm); + } + + out->translate_axis (inter_f*position_i_, Y_AXIS); + return out; +} diff --git a/lily/scoreline.cc b/lily/scoreline.cc index 9a6438a5ed..4a2df191c4 100644 --- a/lily/scoreline.cc +++ b/lily/scoreline.cc @@ -73,7 +73,7 @@ Line_of_score::set_breaking (Array const &breaking) for (int i=0; i < curline.size(); i++) { - curline[i]->translate(config[i],X_AXIS); + curline[i]->translate_axis (config[i],X_AXIS); curline[i]->line_l_ = (Line_of_score*)line_l; } } diff --git a/make/Variables.make b/make/Variables.make index c1a022fa19..abcc2dde58 100644 --- a/make/Variables.make +++ b/make/Variables.make @@ -200,12 +200,6 @@ STRIPDEBUG=true DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES) DOCDIR=$(depth)/$(outdir) -# .hh should be first. Don't know why -# take some trouble to auto ignore sources and obsolete stuff. -progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v '$(OUTDIR_NAME)') \ - $(shell $(FIND) ./ -name '*.cc' |egrep -v '$(OUTDIR_NAME)') \ - - pod2html=pod2html pod2groff=pod2man --center="LilyPond documentation" --section="0"\ --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@ @@ -220,6 +214,3 @@ endif DO_STRIP=true -docxx-opts=-S -k -p -docxx=doc++ -