]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/rest-collision.cc (force_shift_callback): rewrite using
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 27 Oct 2002 01:05:55 +0000 (01:05 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 27 Oct 2002 01:05:55 +0000 (01:05 +0000)
-done property.

* scm/grob-property-description.scm (rest-collision-done): add property.

* lilypond.vim: add file (<hjunes@cc.hut.fi>)

.cvsignore
ChangeLog
lily/include/rest-collision.hh
lily/rest-collision.cc
lilypond.vim [new file with mode: 0644]
scm/grob-property-description.scm
scm/translator-property-description.scm

index a9116890cd25176b22ff044706a05458ec6795a9..1743a72e0da9886de9f97ddb3987f92c1e1f79f8 100644 (file)
@@ -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
index cd91ed1eb3c34368356f930d10a731552c0c0452..06e65eb9033af0321d6717ce0d50fd8d030f9562 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-10-27  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * 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 (<hjunes@cc.hut.fi>)
+
 2002-10-23  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * input/regression/multi-measure-rest-center.ly: new file.
index b49e58dbc4bfbd67e9f1e4822d74753210e2f120..adb5ed2a6e0204801767cb618361b49fd8d0acf7 100644 (file)
@@ -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
index 0292881cb4e64b09aa4bdde35c761867bf33984f..3950585da3e54cbb1c808c7a4d47c1aa2fabfbc1 100644 (file)
@@ -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<Grob> rests;
   Link_array<Grob> 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 (file)
index 0000000..73c9120
--- /dev/null
@@ -0,0 +1,64 @@
+" Vim syntax file
+" Language:    LilyPond
+" Maintainer:  Heikki Junes <hjunes@cc.hut.fi>
+" 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 <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  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
index 1bf46866c2b966d8d33ad91a23d0f6a34e3180b1..732f15759466fcbe9481933e751f41e91c4fe13c 100644 (file)
@@ -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.")
index 27d871442fbdaff28391f208e94e25ce0d104ca2..546cfbb8637b0a156ff66395cd18647fa75cbd1b 100644 (file)
@@ -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