CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Jan Nieuwenhuizen <[EMAIL PROTECTED]>   05/05/13 15:45:33

Modified files:
        stepmake       : aclocal.m4 
        scm            : lily.scm backend-library.scm 
        lily           : slur.cc main.cc GNUmakefile 
        flower/include : string.hh 
        flower         : string.cc file-path.cc file-name.cc 
        Documentation/pictures: GNUmakefile 
        .              : ChangeLog 
Added files:
        ly             : Welcome_to_LilyPond.ly 
        Documentation/pictures: lilypond-48.xpm 

Log message:
        * Documentation/pictures/lilypond-48.xpm: New file.
        
        * flower/file-path.cc (to_string): Bugfix: use PATHSEP.
        
        * ly/Welcome_to_LilyPond.ly: New file.
        
        * lily/main.cc (main): Only identify if we have a terminal.
        
        * scm/backend-library.scm (postscript->png)
        (postscript->pdf): Fix file name quoting for GS/MINGW (ie,
        non-/bin/sh).

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/stepmake/aclocal.m4.diff?tr1=1.142&tr2=1.143&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/lily.scm.diff?tr1=1.335&tr2=1.336&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/backend-library.scm.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ly/Welcome_to_LilyPond.ly?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/slur.cc.diff?tr1=1.215&tr2=1.216&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/main.cc.diff?tr1=1.249&tr2=1.250&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/GNUmakefile.diff?tr1=1.45&tr2=1.46&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/flower/include/string.hh.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/flower/string.cc.diff?tr1=1.50&tr2=1.51&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/flower/file-path.cc.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/flower/file-name.cc.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/Documentation/pictures/lilypond-48.xpm?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/Documentation/pictures/GNUmakefile.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3609&tr2=1.3610&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3609 lilypond/ChangeLog:1.3610
--- lilypond/ChangeLog:1.3609   Fri May 13 12:50:12 2005
+++ lilypond/ChangeLog  Fri May 13 15:45:33 2005
@@ -1,3 +1,17 @@
+2005-05-13  Jan Nieuwenhuizen  <[EMAIL PROTECTED]>
+
+       * Documentation/pictures/lilypond-48.xpm: New file.
+
+       * flower/file-path.cc (to_string): Bugfix: use PATHSEP.
+
+       * ly/Welcome_to_LilyPond.ly: New file.
+
+       * lily/main.cc (main): Only identify if we have a terminal.
+
+       * scm/backend-library.scm (postscript->png)
+       (postscript->pdf): Fix file name quoting for GS/MINGW (ie,
+       non-/bin/sh).
+
 2005-05-13  Heikki Junes  <[EMAIL PROTECTED]>
 
        * Documentation/topdocs/AUTHORS.texi: polish, update.
@@ -36,6 +50,8 @@
 
 2005-05-12  Jan Nieuwenhuizen  <[EMAIL PROTECTED]>
 
+       * stepmake/aclocal.m4: Typo.
+
        * flower/string.cc (substitute): Take two strings or two
        characters.  Update callers.
 
Index: lilypond/Documentation/pictures/GNUmakefile
diff -u lilypond/Documentation/pictures/GNUmakefile:1.6 
lilypond/Documentation/pictures/GNUmakefile:1.7
--- lilypond/Documentation/pictures/GNUmakefile:1.6     Mon Jul 28 08:07:44 2003
+++ lilypond/Documentation/pictures/GNUmakefile Fri May 13 15:45:33 2005
@@ -6,12 +6,36 @@
 OUTPNG_FILES = $(addprefix $(outdir)/,$(XPM_FILES:.xpm=.png))
 
 EXTRA_DIST_FILES= $(XPM_FILES)
-# OUT_DIST_FILES = $(package-icon)
+OUT_DIST_FILES = $(icon) #$(package-icon)
+
+icon = $(outdir)/lilypond.ico
+ICON_SIZES=48 32 16
+
+#$(outdir)/lilypond.ico: platte-lucht-kikker-ly-48.xpm
 
 include $(depth)/make/stepmake.make
 
-default: # $(package-icon)
-local-dist: # $(package-icon)
+default: $(icon)
+local-dist: $(icon) # $(package-icon)
+
+$(outdir)/%.ico: $(ICON_SIZES:%=$(outdir)/\%-%.png) 
$(ICON_SIZES:%=$(outdir)/\%-%-8.png)
+       #convert +adjoin $^ $@
+       icotool --output=$@ --create $^
+
+# cancel default rule that breaks transparency
+$(outdir)/%.png: %.xpm
+
+$(outdir)/%-48.png: %-48.xpm
+       convert -sample 48 -depth 24 $< $@
+                  
+$(outdir)/%-32.png: %-48.xpm
+       convert -depth 24 -sample 32 $< $@
+
+$(outdir)/%-16.png: %-48.xpm
+       convert -depth 24 -sample 16 $< $@
+
+$(outdir)/%-8.png: $(outdir)/%.png
+       convert -depth 8 $< $@
 
 xgifs: $(OUTGIF_FILES)
 pngs: $(OUTPNG_FILES)
Index: lilypond/flower/file-name.cc
diff -u lilypond/flower/file-name.cc:1.7 lilypond/flower/file-name.cc:1.8
--- lilypond/flower/file-name.cc:1.7    Thu May 12 11:32:49 2005
+++ lilypond/flower/file-name.cc        Fri May 13 15:45:33 2005
@@ -48,6 +48,21 @@
 }
 #endif /* __CYGWIN__ */
 
+#ifdef __MINGW32__
+/** Use slash as directory separator.  On Windows, they can pretty
+    much be exchanged.  */
+static String
+slashify (String file_name)
+{
+  if (file_name.index ('/'))
+    return file_name;
+  file_name.substitute ('\\', '/');
+  file_name.substitute ("\"", "\\\"");
+  file_name.substitute ("\'", "\\\'");
+  return file_name;
+}
+#endif /* __MINGW32__ */
+
 /* Join components to full file_name. */
 String
 File_name::to_string () const
@@ -78,7 +93,7 @@
   file_name = dos_to_posix (file_name);
 #endif
 #ifdef __MINGW32__
-  file_name.substitute ('\\', '/');
+  file_name = slashify (file_name);
 #endif
 
   int i = file_name.index (ROOTSEP);
Index: lilypond/flower/file-path.cc
diff -u lilypond/flower/file-path.cc:1.30 lilypond/flower/file-path.cc:1.31
--- lilypond/flower/file-path.cc:1.30   Thu Mar 10 14:36:16 2005
+++ lilypond/flower/file-path.cc        Fri May 13 15:45:33 2005
@@ -169,7 +169,7 @@
     {
       s = s + elem (i);
       if (i < n - 1)
-       s += ":";
+       s += ::to_string (PATHSEP);
     }
   return s;
 }
Index: lilypond/flower/include/string.hh
diff -u lilypond/flower/include/string.hh:1.33 
lilypond/flower/include/string.hh:1.34
--- lilypond/flower/include/string.hh:1.33      Thu May 12 11:32:49 2005
+++ lilypond/flower/include/string.hh   Fri May 13 15:45:33 2005
@@ -144,8 +144,8 @@
   /// convert to a double
   double to_double () const;
 
-  void substitute (String find, String replace);
-  void substitute (char find, char replace);
+  String substitute (String find, String replace);
+  String substitute (char find, char replace);
 };
 
 /*
Index: lilypond/flower/string.cc
diff -u lilypond/flower/string.cc:1.50 lilypond/flower/string.cc:1.51
--- lilypond/flower/string.cc:1.50      Thu May 12 11:32:49 2005
+++ lilypond/flower/string.cc   Fri May 13 15:45:33 2005
@@ -382,17 +382,26 @@
 }
 #endif
 
-void
+String
 String::substitute (String find, String replace)
 {
-  int n = replace.length ();
-  for (int i = index (find); i > - 1; i = index (find))
-    *this = left_string (i) + find + right_string (length () - i - n);
+  int n = find.length ();
+  int m = replace.length ();
+  for (int i = index (find), j = 0; i > -1;
+       i = right_string (length () - j).index (find))
+    {
+      *this = left_string (i + j)
+       + replace
+       + right_string (length () - j - i - n);
+      j += i + m;
+    }
+  return *this;
 }
 
-void
+String
 String::substitute (char find, char replace)
 {
   for (int i = index (find); i > - 1; i = index (find))
     (*this)[i] = replace;
+  return *this;
 }
Index: lilypond/lily/GNUmakefile
diff -u lilypond/lily/GNUmakefile:1.45 lilypond/lily/GNUmakefile:1.46
--- lilypond/lily/GNUmakefile:1.45      Thu May 12 11:32:49 2005
+++ lilypond/lily/GNUmakefile   Fri May 13 15:45:33 2005
@@ -31,8 +31,10 @@
 $(outdir)/lilypond: $(outdir)/lilypond.rc.o
 
 $(outdir)/lilypond.rc.o: $(outdir)/lilypond.ico
-$(outdir)/lilypond.ico: $(abs-srcdir)/Documentation/pictures/lelie-logo.xpm
-       convert $< $@ 
+$(builddir)/Documentation/pictures/$(outbase)/lilypond.ico:
+       $(MAKE) -C $(abs-srcdir)/Documentation/pictures
+$(outdir)/lilypond.ico: 
$(builddir)/Documentation/pictures/$(outbase)/lilypond.ico
+       cp $< $@ 
 endif
 
 ETAGS_FLAGS += --regex='{c++}/^LY_DEFINE *(\([^,]+\)/\1/'
@@ -45,7 +47,6 @@
 $(outdir)/lily-lexer.o: $(outdir)/parser.hh
 $(outdir)/lexer.o: $(outdir)/parser.hh $(outdir)/version.hh
 
-
 $(outdir)/general-scheme.o: $(outdir)/version.hh
 $(outdir)/kpath.o: $(outdir)/version.hh
 $(outdir)/lily-guile.o: $(outdir)/version.hh
Index: lilypond/lily/main.cc
diff -u lilypond/lily/main.cc:1.249 lilypond/lily/main.cc:1.250
--- lilypond/lily/main.cc:1.249 Thu May 12 11:32:49 2005
+++ lilypond/lily/main.cc       Fri May 13 15:45:33 2005
@@ -596,9 +596,8 @@
   setup_localisation ();
   setup_paths ();
   parse_argv (argc, argv);
-  /* FIXME: this still needs a terminal even when using gui-main after
-     booting guile.  Maybe use a --quiet command line switch?  */
-  identify (stderr);
+  if (isatty (STDIN_FILENO))
+    identify (stderr);
 
   scm_boot_guile (argc, argv, main_with_guile, 0);
 
Index: lilypond/lily/slur.cc
diff -u lilypond/lily/slur.cc:1.215 lilypond/lily/slur.cc:1.216
--- lilypond/lily/slur.cc:1.215 Wed May  4 10:35:56 2005
+++ lilypond/lily/slur.cc       Fri May 13 15:45:32 2005
@@ -60,10 +60,7 @@
   Real staff_thick = Staff_symbol_referencer::line_thickness (me);
   Real base_thick = robust_scm2double (me->get_property ("thickness"), 1);
   Real thick = base_thick * staff_thick;
-
-  Real ss = Staff_symbol_referencer::staff_space (me);
   Bezier one = get_curve (me);
-
   Stencil a;
 
   /*
Index: lilypond/scm/backend-library.scm
diff -u lilypond/scm/backend-library.scm:1.22 
lilypond/scm/backend-library.scm:1.23
--- lilypond/scm/backend-library.scm:1.22       Tue May 10 21:38:51 2005
+++ lilypond/scm/backend-library.scm    Fri May 13 15:45:32 2005
@@ -42,9 +42,9 @@
  -dNOPAUSE\
  -dBATCH\
  -sDEVICE=pdfwrite\
- -sOutputFile='~a'\
+ -sOutputFile=~S\
  -c .setpdfwrite\
- -f'~a'\
+ -f ~S\
 "
                      (sanitize-command-option papersizename)
                      pdf-name
@@ -65,7 +65,7 @@
                           (format "~a/scripts/lilypond-ps2png.py" prefix)
                           "lilypond-ps2png"))
         (cmd (format #f
-                     "~a --resolution=~S --papersize=~a~a '~a'"
+                     "~a --resolution=~S --papersize=~a~a ~S"
                      (if (file-exists? ps2png-source)
                          (format "python ~a" ps2png-source)
                          "lilypond-ps2png")
Index: lilypond/scm/lily.scm
diff -u lilypond/scm/lily.scm:1.335 lilypond/scm/lily.scm:1.336
--- lilypond/scm/lily.scm:1.335 Thu May 12 11:32:49 2005
+++ lilypond/scm/lily.scm       Fri May 13 15:45:32 2005
@@ -342,11 +342,11 @@
   (let* ((base (basename (car files) ".ly"))
         (log-name (string-append base ".log"))
         (log-file (open-file log-name "w")))
-    (display "# -*-compilation-*-" log-file)
-    (newline log-file)
-    ;; Ugh, this opens a terminal
-    (ly:message (_ "Redirecting output to ~a...") log-name)
+    ;; Ugh, his opens a terminal
+    ;; Do this when invoked using --quiet, --log or something?
+    ;; (ly:message (_ "Redirecting output to ~a...") log-name)
     (ly:port-move (fileno (current-error-port)) log-file)
+    (ly:message "# -*-compilation-*-")
     (if (null? (lilypond-all files))
        (exit 0)
        (begin
@@ -354,31 +354,15 @@
          (exit 1)))))
 
 (define (gui-no-files-handler)
-  (let* ((input (string-append
-                (string-regexp-substitute
-                 "share/lilypond/" "share/doc/lilypond-"
-                 (getenv "LILYPONDPREFIX"))
-                "-1/input"))
-        (ly (string-append input "/" "Welcome to LilyPond.ly"))
-        (cmd (get-editor-command ly 0 0)))
-    (system cmd)))
-
-
-;; Mingw
-;; #(Windows XP HOSTNAME build 2600 5.01 Service Pack 1 i686)
-
-;; Cygwin
-;; #(CYGWIN_NT-5.1 Hostname 1.5.12(0.116/4/2) 2004-11-10 08:34 i686)
-
-;; Debian
-;; #(Linux hostname 2.4.27-1-686 #1 Fri Sep 3 06:28:00 UTC 2004 i686)
-
-(case (string->symbol
-       (string-downcase
-       (car (string-tokenize (vector-ref (uname) 0) char-set:letter))))
-  ((linux) #t)
-  ;; On mingw, use gui-main
-  ((windows) (define lilypond-main gui-main)))
-
-;;(if (ly:get-option 'quiet)
-;;    (define lilypond-main gui-main))
+  (let* ((ly (string-append (ly:effective-prefix) "/ly/"))
+        ;; FIXME: soft-code, localize
+        (welcome-ly (string-append ly "Welcome_to_LilyPond.ly"))
+        (cmd (get-editor-command welcome-ly 0 0)))
+    (ly:message (_ "Invoking `~a'...") cmd)
+    (system cmd)
+    (exit 1)))
+
+;; If no TTY and not using safe, assume running from GUI.
+(or (isatty? (current-input-port))
+    (ly:get-option 'safe)
+    (define lilypond-main gui-main))
Index: lilypond/stepmake/aclocal.m4
diff -u lilypond/stepmake/aclocal.m4:1.142 lilypond/stepmake/aclocal.m4:1.143
--- lilypond/stepmake/aclocal.m4:1.142  Thu May 12 11:32:49 2005
+++ lilypond/stepmake/aclocal.m4        Fri May 13 15:45:32 2005
@@ -1175,14 +1175,23 @@
        LN_S='cp -r' # Cygwin symbolic links do not work for native apps.
        program_suffix=.exe
        INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
-    elif test "$MINGW" == "yes"; then
+    elif test "$MINGW32" == "yes"; then
        LN='cp -r'
        LN_S='cp -r'
        program_suffix=.exe
        INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
        PATHSEP=';'
     fi
-    
+
+    AC_SUBST(LN)
+    AC_SUBST(LN_S)
+    AC_SUBST(INSTALL)
+    AC_DEFINE_UNQUOTED(DIRSEP, ['${DIRSEP}'])
+    AC_DEFINE_UNQUOTED(PATHSEP, ['${PATHSEP}'])
+    AC_SUBST(DIRSEP)
+    AC_SUBST(PATHSEP)
+    AC_SUBST(program_suffix)
+
     AC_MSG_CHECKING([for some flavor of Windows])
     if test "$CYGWIN$MINGW32" == "nono"; then
         PLATFORM_WINDOWS=no


_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to