From 7531912f61e055a4d4ad65e2a3a4ff3dbd5933ca Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 27 Oct 2002 01:05:55 +0000 Subject: [PATCH] * lily/rest-collision.cc (force_shift_callback): rewrite using -done property. * scm/grob-property-description.scm (rest-collision-done): add property. * lilypond.vim: add file () --- .cvsignore | 7 +++ ChangeLog | 9 ++++ lily/include/rest-collision.hh | 2 +- lily/rest-collision.cc | 39 ++++++++------- lilypond.vim | 64 +++++++++++++++++++++++++ scm/grob-property-description.scm | 1 + scm/translator-property-description.scm | 14 +++++- 7 files changed, 116 insertions(+), 20 deletions(-) create mode 100644 lilypond.vim diff --git a/.cvsignore b/.cvsignore index a9116890cd..1743a72e0d 100644 --- a/.cvsignore +++ b/.cvsignore @@ -19,6 +19,7 @@ .gdbinit GNUmakefile TAGS +a afm autom4te.cache config.cache @@ -27,8 +28,12 @@ config.log config.make config.status configure +conv.py +fetchmail-5.9.0-21.i386.rpm fonts +foo.hh l +lilypond-internals.texi log ls-R ly2dvi.dir @@ -39,3 +44,5 @@ share stepmake tfm tfm.[0-9] +to-xml.texidoc +xml.py diff --git a/ChangeLog b/ChangeLog index cd91ed1eb3..06e65eb903 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-10-27 Han-Wen Nienhuys + + * lily/rest-collision.cc (force_shift_callback): rewrite using + -done property. + + * scm/grob-property-description.scm (rest-collision-done): add property. + + * lilypond.vim: add file () + 2002-10-23 Han-Wen Nienhuys * input/regression/multi-measure-rest-center.ly: new file. diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh index b49e58dbc4..adb5ed2a6e 100644 --- a/lily/include/rest-collision.hh +++ b/lily/include/rest-collision.hh @@ -23,6 +23,6 @@ public: static bool has_interface (Grob*); DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis)); - static SCM do_shift (Grob*,SCM); + static SCM do_shift (Grob*); }; #endif // REST_COLLISION_HH diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 0292881cb4..3950585da3 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -29,17 +29,11 @@ Rest_collision::force_shift_callback (SCM element_smob, SCM axis) Grob * rc = unsmob_grob (them->get_grob_property ("rest-collision")); - if (rc) + if (rc && !to_boolean (rc->get_grob_property ("rest-collision-done"))) { - /* - Done: destruct pointers, so we do the shift only once. - - TODO: use rest-collision-done - */ - SCM elts = rc->get_grob_property ("elements"); - rc->set_grob_property ("elements", SCM_EOL); + rc->set_grob_property ("rest-collision-done", SCM_BOOL_T); - do_shift (rc, elts); + do_shift (rc); } return gh_double2scm (0.0); @@ -52,7 +46,8 @@ Rest_collision::add_column (Grob*me,Grob *p) Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), p); /* - only add callback for the rests, since we don't move anything else. + only add callback for the rests, since we don't move anything + else. (not?) */ @@ -83,11 +78,10 @@ head_characteristic (Grob * col) for more than two voices. */ SCM -Rest_collision::do_shift (Grob *me, SCM elts) +Rest_collision::do_shift (Grob *me) { - /* - ugh. -> score elt type - */ + SCM elts = me->get_grob_property ("elements"); + Link_array rests; Link_array notes; @@ -144,9 +138,20 @@ Rest_collision::do_shift (Grob *me, SCM elts) for (; i > display_count; i--) { Grob* r = unsmob_grob (rests[i-1]->get_grob_property ("rest")); +#if 1 if (r) r->suicide (); rests[i-1]->suicide (); +#else + if (r) + { + + r->set_grob_property ("transparent", gh_bool2scm(1)); + r = unsmob_grob (r->get_grob_property ("dot")); + if (r) + r->set_grob_property ("transparent", gh_bool2scm(1)); + } +#endif } } else @@ -239,7 +244,7 @@ Rest_collision::do_shift (Grob *me, SCM elts) ADD_INTERFACE (Rest_collision,"rest-collision-interface", - "Move around ordinary rests (not multi-measure-rests) to avoid -conflicts.", - "maximum-rest-count minimum-distance elements"); + "Move around ordinary rests (not multi-measure-rests) to avoid " +"conflicts.", + "maximum-rest-count minimum-distance rest-collision-done elements"); diff --git a/lilypond.vim b/lilypond.vim new file mode 100644 index 0000000000..73c9120d31 --- /dev/null +++ b/lilypond.vim @@ -0,0 +1,64 @@ +" Vim syntax file +" Language: LilyPond +" Maintainer: Heikki Junes +" Created: Oct 17, 2002 +" Last Change: Oct 17, 2002 +" Version: 6.1-1 +" Latest: +" http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lilypond.vim + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Match also parethesis of angle type +set mps+=<:> + +syn cluster lilyMatchGroup contains=lilyMatcher,lilyString,lilyComment,lilyStatement,lilyNote,lilyNumber,lilyEquation,lilySlur,lilySpecial + +syn region lilyMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{<>}]" end="}" contains=@lilyMatchGroup fold +syn region lilyMatcher matchgroup=Delimiter start="\[" end="]" contains=@lilyMatchGroup fold +syn region lilyMatcher matchgroup=Delimiter start="<" skip="\\\\\|\\[{<>}]" end=">" contains=@lilyMatchGroup fold + +syn region lilyString start=/"/ end=/"/ skip=/\\"/ +syn region lilyComment start="%{" skip="%$" end="%}" +syn region lilyComment start="%\([^{]\|$\)" end="$" + +syn match lilyStatement "[-_^]\?\\\a\+" +syn match lilyNote "\<\(\(\(bb\|as[ae]s\|[ae]s\|eses\|[a-h]\([ei]s\)\{,2}\)\([,']\)\{,4}\([?!]\)\?\|[srR]\)\(\(128\|6\?4\|3\?2\|16\?\|8\|\\breve\)[.]*\)\?\)\(\A\|\n\)"me=e-1 +syn match lilyNumber "[-_^.]\?\d\+[.]\?" +syn match lilyEquation "\(#['`]\)\?\(\a*[-]\)*\a*\s*=\s*\(#[#'`]\?\)\?\a*" +syn match lilySlur "[(~)]" +syn match lilySlur "\\[()]" +syn match lilySpecial "\\[\\]" + +" Rest of syntax highlighting rules start here +" +" " Define the default highlighting. +" " For version 5.7 and earlier: only when not done already +" " For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_lily_syn_inits") + if version < 508 + let did_lily_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink Delimiter Identifier + + HiLink lilyString String + HiLink lilyComment Comment + + HiLink lilyNote Identifier + HiLink lilyNumber Constant + HiLink lilyStatement Statement + HiLink lilySpecial Special + HiLink lilySlur ModeMsg + + delcommand HiLink +endif diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 1bf46866c2..732f157594 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -571,6 +571,7 @@ columns. (grob-property-description 'collision-done boolean? "") (grob-property-description 'rest ly:grob? "the staff symbol grob that we're in.") (grob-property-description 'rest-collision ly:grob? "rest collision that a rest is in.") +(grob-property-description 'rest-collision-done boolean? "Is this rest collision processed yet?") (grob-property-description 'staff-support boolean? " JUNKME.") (grob-property-description 'script-molecule pair? "index code for script.") diff --git a/scm/translator-property-description.scm b/scm/translator-property-description.scm index 27d871442f..546cfbb863 100644 --- a/scm/translator-property-description.scm +++ b/scm/translator-property-description.scm @@ -151,7 +151,11 @@ key signatures after the bar lines: a queue of (END-MOMENT . GROB) conses. This is for internal (C++) use only. Use at your own risk. This property contains the grobs for which END-MOMENT >= NOW. ") -(translator-property-description 'centralCPosition number? "Place of the central C. Usually determined by looking at clefPosition and clefGlyph.") + +(translator-property-description 'centralCPosition number? "Place of +the central C, measured in half staffspaces. Usually determined by +looking at clefPosition and clefGlyph.") + (translator-property-description 'changeMoment moment-pair? "duration that voices are examined for differences, when @@ -163,7 +167,13 @@ into one staff.") (translator-property-description 'clefGlyph string? "Name of the symbol within the music font") (translator-property-description 'clefOctavation integer? "Add this much extra octavation. Values of 7 and -7 are common.") -(translator-property-description 'clefPosition number? "Where should the center of the symbol go?") + +(translator-property-description 'clefPosition number? "Where should +the center of the clef symbol go? On systems with an odd number of +stafflines, the value 0 puts the clef on the middle staffline; a +positive value shifts it up, a negative value shifts it down. The +unit of this distance is the half staff space.") + (translator-property-description 'combineParts boolean? "try to combine parts?") (translator-property-description 'connectArpeggios boolean? " If set, connect all arpeggios that are found. In this way, you can make -- 2.39.2