CVSROOT: /cvsroot/lilypond
Module name: lilypond
Branch:
Changes by: Han-Wen Nienhuys <[EMAIL PROTECTED]> 05/04/27 09:12:33
Modified files:
. : ChangeLog
lily : all-font-metrics.cc beaming-info.cc
font-select.cc general-scheme.cc lily-guile.cc
main.cc pango-select.cc
scm : define-grobs.scm
Log message:
* lily/lily-guile.cc (ly_chain_assoc): remove.
* lily/general-scheme.cc (LY_DEFINE): export ly:chain_assoc_get
(LY_DEFINE): recurse, iso. calling ly_chain_assoc.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3508&tr2=1.3509&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/all-font-metrics.cc.diff?tr1=1.87&tr2=1.88&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/beaming-info.cc.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/font-select.cc.diff?tr1=1.43&tr2=1.44&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/general-scheme.cc.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/lily-guile.cc.diff?tr1=1.210&tr2=1.211&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/main.cc.diff?tr1=1.241&tr2=1.242&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/pango-select.cc.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-grobs.scm.diff?tr1=1.192&tr2=1.193&r1=text&r2=text
Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3508 lilypond/ChangeLog:1.3509
--- lilypond/ChangeLog:1.3508 Tue Apr 26 14:04:15 2005
+++ lilypond/ChangeLog Wed Apr 27 09:12:29 2005
@@ -1,5 +1,14 @@
+2005-04-27 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+
+ * lily/lily-guile.cc (ly_chain_assoc): remove.
+
+ * lily/general-scheme.cc (LY_DEFINE): export ly:chain_assoc_get
+ (LY_DEFINE): recurse, iso. calling ly_chain_assoc.
+
2005-04-26 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+ * lily/beaming-info.cc: remove infinity_i
+
* scripts/abc2ly.py (out_filename): fix thinko with \version.
2005-04-26 Graham Percival <[EMAIL PROTECTED]>
Index: lilypond/lily/all-font-metrics.cc
diff -u lilypond/lily/all-font-metrics.cc:1.87
lilypond/lily/all-font-metrics.cc:1.88
--- lilypond/lily/all-font-metrics.cc:1.87 Tue Apr 26 14:04:15 2005
+++ lilypond/lily/all-font-metrics.cc Wed Apr 27 09:12:33 2005
@@ -74,7 +74,8 @@
SCM val;
if (!pango_dict_->try_retrieve (key, &val))
{
- progress_indication ("[" + String (pango_fn));
+ if (be_verbose_global)
+ progress_indication ("[" + String (pango_fn));
Pango_font *pf = new Pango_font (pango_ft2_fontmap_,
RIGHT,
Index: lilypond/lily/beaming-info.cc
diff -u lilypond/lily/beaming-info.cc:1.18 lilypond/lily/beaming-info.cc:1.19
--- lilypond/lily/beaming-info.cc:1.18 Wed Mar 16 19:19:15 2005
+++ lilypond/lily/beaming-info.cc Wed Apr 27 09:12:33 2005
@@ -22,13 +22,12 @@
beams_i_drul_[RIGHT] = i;
}
-const int infinity_i = INT_MAX; // guh.
-const int at_beat = 1<<15;
+const int at_beat = 1 << 15;
int
Beaming_info_list::best_splitpoint_index (Moment &beat_length, bool subdivide)
const
{
- int minden = infinity_i;
+ int minden = INT_MAX;
int minidx = -1;
Moment beat_pos;
Index: lilypond/lily/font-select.cc
diff -u lilypond/lily/font-select.cc:1.43 lilypond/lily/font-select.cc:1.44
--- lilypond/lily/font-select.cc:1.43 Thu Mar 10 14:36:13 2005
+++ lilypond/lily/font-select.cc Wed Apr 27 09:12:33 2005
@@ -102,15 +102,13 @@
Font_metric *
select_encoded_font (Output_def *layout, SCM chain)
{
- SCM name = ly_chain_assoc (ly_symbol2scm ("font-name"), chain);
+ SCM name = ly_chain_assoc_get (ly_symbol2scm ("font-name"), chain,
SCM_BOOL_F);
- if (!scm_is_pair (name) || !scm_is_string (scm_cdr (name)))
+ if (!scm_is_string (name))
{
SCM fonts = layout->lookup_variable (ly_symbol2scm ("fonts"));
name = properties_to_font_size_family (fonts, chain);
}
- else
- name = scm_cdr (name);
#if HAVE_PANGO_FT2
if (scm_is_string (name)
@@ -122,10 +120,9 @@
#endif
if (scm_is_string (name))
{
- SCM mag = ly_chain_assoc (ly_symbol2scm ("font-magnification"), chain);
- Real rmag = (scm_is_pair (mag)
- ? robust_scm2double (scm_cdr (mag), 1.0)
- : 1);
+ Real rmag =
+ robust_scm2double (ly_chain_assoc_get (ly_symbol2scm
("font-magnification"), chain, SCM_BOOL_F),
+ 1.0);
Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
return find_scaled_font (layout, fm, rmag);
@@ -135,11 +132,9 @@
SCM base_size = scm_slot_ref (name, ly_symbol2scm ("default-size"));
SCM vec = scm_slot_ref (name, ly_symbol2scm ("size-vector"));
- SCM font_size = ly_chain_assoc (ly_symbol2scm ("font-size"), chain);
- Real req = 0;
- if (scm_is_pair (font_size))
- req = scm_to_double (scm_cdr (font_size));
-
+ Real req = robust_scm2double (ly_chain_assoc_get (ly_symbol2scm
("font-size"), chain, SCM_BOOL_F),
+ 0.0);
+
return get_font_by_mag_step (layout, req, vec,
scm_to_double (base_size));
}
Index: lilypond/lily/general-scheme.cc
diff -u lilypond/lily/general-scheme.cc:1.16
lilypond/lily/general-scheme.cc:1.17
--- lilypond/lily/general-scheme.cc:1.16 Tue Apr 12 22:49:28 2005
+++ lilypond/lily/general-scheme.cc Wed Apr 27 09:12:33 2005
@@ -271,3 +271,20 @@
}
+
+LY_DEFINE (ly_chain_assoc_get, "ly:chain-assoc-get",
+ 2, 1, 0, (SCM key, SCM achain, SCM dfault),
+ "Return value for @var{key} from a list of alists @var{achain}.
Return @var{dfault} "
+ "if no entry is found, or #f if not specified. ")
+{
+ if (scm_is_pair (achain))
+ {
+ SCM handle = scm_assoc (key, scm_car (achain));
+ if (scm_is_pair (handle))
+ return scm_cdr (handle);
+ else
+ return ly_chain_assoc_get (key, scm_cdr (achain), dfault);
+ }
+ else
+ return dfault == SCM_UNDEFINED ? SCM_BOOL_F : dfault;
+}
Index: lilypond/lily/lily-guile.cc
diff -u lilypond/lily/lily-guile.cc:1.210 lilypond/lily/lily-guile.cc:1.211
--- lilypond/lily/lily-guile.cc:1.210 Tue Apr 12 22:49:28 2005
+++ lilypond/lily/lily-guile.cc Wed Apr 27 09:12:33 2005
@@ -325,35 +325,7 @@
return src;
}
-SCM
-ly_chain_assoc_get (SCM key, SCM achain, SCM dfault)
-{
- if (scm_is_pair (achain))
- {
- SCM handle = scm_assoc (key, scm_car (achain));
- if (scm_is_pair (handle))
- return scm_cdr (handle);
- else
- return ly_chain_assoc (key, scm_cdr (achain));
- }
- else
- return dfault;
-}
-SCM
-ly_chain_assoc (SCM key, SCM achain)
-{
- if (scm_is_pair (achain))
- {
- SCM handle = scm_assoc (key, scm_car (achain));
- if (scm_is_pair (handle))
- return handle;
- else
- return ly_chain_assoc (key, scm_cdr (achain));
- }
- else
- return SCM_BOOL_F;
-}
/* looks the key up in the cdrs of the alist-keys
- ignoring the car and ignoring non-pair keys.
Index: lilypond/lily/main.cc
diff -u lilypond/lily/main.cc:1.241 lilypond/lily/main.cc:1.242
--- lilypond/lily/main.cc:1.241 Tue Apr 12 22:49:28 2005
+++ lilypond/lily/main.cc Wed Apr 27 09:12:33 2005
@@ -133,6 +133,10 @@
static Long_option_init options_static[]
= {
{_i ("BACK"), "backend", 'b', _i ("use backend BACK (gnome, ps [default],\n
scm, svg, tex, texstr)")},
+
+ {_i ("SYM=VAL"), "define-default", 'd',
+ _i ("define a default Scheme setting.")},
+
{_i ("EXPR"), "evaluate", 'e', _i ("set scheme option, for help use\n
-e '(ly:option-usage)'")},
/* Bug in option parser: --output =foe is taken as an abbreviation
for --output-format. */
@@ -473,6 +477,10 @@
make_print = false;
break;
+ case 'd':
+
+ break;
+
case 'v':
notice ();
exit (0);
Index: lilypond/lily/pango-select.cc
diff -u lilypond/lily/pango-select.cc:1.15 lilypond/lily/pango-select.cc:1.16
--- lilypond/lily/pango-select.cc:1.15 Wed Apr 13 14:41:27 2005
+++ lilypond/lily/pango-select.cc Wed Apr 27 09:12:33 2005
@@ -15,12 +15,12 @@
PangoFontDescription *
properties_to_pango_description (SCM chain, Real text_size)
{
- SCM name = ly_chain_assoc (ly_symbol2scm ("font-name"), chain);
+ SCM name = ly_chain_assoc_get (ly_symbol2scm ("font-name"), chain,
SCM_BOOL_F);
PangoFontDescription *description = 0;
- if (scm_is_pair (name) && scm_is_string (scm_cdr (name)))
+ if (scm_is_string (name))
{
- String name_str = ly_scm2string (scm_cdr (name));
+ String name_str = ly_scm2string (name);
description = pango_font_description_from_string (name_str.to_str0 ());
}
else
Index: lilypond/scm/define-grobs.scm
diff -u lilypond/scm/define-grobs.scm:1.192 lilypond/scm/define-grobs.scm:1.193
--- lilypond/scm/define-grobs.scm:1.192 Thu Apr 21 15:59:44 2005
+++ lilypond/scm/define-grobs.scm Wed Apr 27 09:12:33 2005
@@ -508,6 +508,9 @@
. (
(print-function . ,Grid_line_interface::print)
(X-extent-callback . ,Grid_line_interface::width_callback)
+ (self-alignment-X . ,CENTER)
+ (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self
+ ,Self_alignment_interface::centered_on_parent))
(layer . 0)
(meta . ((interfaces . (grid-line-interface)))
)))
_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs