]> git.donarmstrong.com Git - lilypond.git/commitdiff
(output): revert: only allow a single output
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 24 Dec 2004 22:52:43 +0000 (22:52 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 24 Dec 2004 22:52:43 +0000 (22:52 +0000)
format.

ChangeLog
flower/include/parse-afm.hh
lily/main.cc
lily/paper-book.cc
ly/engraver-init.ly

index 42ce849f9c24e227843459b00cc342de9f6c6904..bf8e2f3a6d29ccc5ac9b6bc7283b55f15ca18dd1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-12-24  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/paper-book.cc (output): revert: only allow a single output
+       format.
+
        * lily/include/pango-font.hh: new file.
 
        * lily/pango-font.cc: new file.
index 34162dbbe27a977279ea7aabe0a6e14c67e071ce..3b2d30b577bd0fcee65ee8e78d60dca2e0a99b8e 100644 (file)
 
 #include <cstdio>
 
-
-/* your basic constants */
-#define TRUE 1
-#define FALSE 0
-#define EOL '\n'                /* end-of-line indicator */
-#define MAX_NAME 4096           /* max length for identifiers */
 #define BOOL int
 #define FLAGS int
 
 
 
-/* Flags that can be AND'ed together to specify exactly what
- * information from the AFM file should be saved.
- */
-#define P_G    0x01    /* 0000 0001 */   /* Global Font Info      */
-#define P_W    0x02    /* 0000 0010 */   /* Character Widths ONLY */
-#define P_M    0x06    /* 0000 0110 */   /* All Char Metric Info  */
-#define P_P    0x08    /* 0000 1000 */   /* Pair Kerning Info     */
-#define P_T    0x10    /* 0001 0000 */   /* Track Kerning Info    */
-#define P_C    0x20    /* 0010 0000 */   /* Composite Char Info   */
-
-
-/* Commonly used flags
- */
-#define P_GW\
-       (P_G | P_W) 
-#define P_GM\
-       (P_G | P_M)
-#define P_GMP\
-       (P_G | P_M | P_P)
-#define P_GMK\
-       (P_G | P_M | P_P | P_T) 
-#define P_GALL\
-       (P_G | P_M | P_P | P_T | P_C)
-
-
 /* Possible return codes from the parseFile procedure.
  * 
  * ok means there were no problems parsing the file.
index fd1ed22fa9da363bb24a18814d1285072017b066..be54c91bba1ea53541662eb32eb740eae25ce12e 100644 (file)
@@ -44,7 +44,8 @@ String init_name_global;
 bool no_layout_global_b = false;
 
 /* Selected output format.
-   One of tex, ps, scm, as. */
+   One of tex, ps, scm, as.
+*/
 String output_format_global = "ps";
 
 /* Current output name. */
@@ -253,16 +254,10 @@ prepend_load_path (String dir)
 static void
 determine_output_options ()
 {
-  bool found_gnome = false;
-  bool found_svg = false;
-  bool found_tex = false;
-  SCM formats = ly_output_formats ();
-  for (SCM s = formats; scm_is_pair (s); s = scm_cdr (s)) 
-    {
-      found_gnome = found_gnome || ly_scm2string(scm_car (s)) == "gnome";
-      found_svg = found_gnome || ly_scm2string(scm_car (s)) == "svg";
-      found_tex = found_tex || (ly_scm2string (scm_car (s)) == "tex");
-    }
+  bool found_gnome = (output_format_global == "gnome");
+  bool found_svg = (output_format_global == "svg");
+  bool found_tex = (output_format_global == "tex");
+
 
   if (make_pdf || make_png)
     {
index 446725543b34f5952ddd2ae023058328a075bd7c..8ce6188fa5d13e0c54f82a18dd2d5af48667c467 100644 (file)
@@ -98,21 +98,6 @@ dump_fields ()
   return fields;
 }
 
-LY_DEFINE (ly_output_formats, "ly:output-formats",
-          0, 0, 0, (),
-          "Formats passed to --format as a list of strings, "
-          "used for the output.")
-{
-  Array<String> output_formats = split_string (output_format_global, ',');
-
-  SCM lst = SCM_EOL;
-  int output_formats_count = output_formats.size ();
-  for (int i = 0; i < output_formats_count; i ++)
-    lst = scm_cons (scm_makfrom0str (output_formats[i].to_str0 ()), lst);
-  
-  return lst; 
-}
-
 void
 Paper_book::post_processing (SCM module,
                             SCM file_name)
@@ -154,59 +139,55 @@ Paper_book::output (String outname)
   /* Generate all stencils to trigger font loads.  */
   pages ();
   
-  SCM formats = ly_output_formats ();
-  for (SCM s = formats; scm_is_pair (s); s = scm_cdr (s)) 
-    {
-      String format = ly_scm2string (scm_car (s));
-      String file_name = outname;
+  String format = output_format_global;
+  String file_name = outname;
       
-      if (file_name != "-")
-       file_name += "." + format;
+  if (file_name != "-")
+    file_name += "." + format;
       
-      Paper_outputter *out = get_paper_outputter (file_name, format);
+  Paper_outputter *out = get_paper_outputter (file_name, format);
   
-      SCM scopes = SCM_EOL;
-      if (ly_c_module_p (header_))
-       scopes = scm_cons (header_, scopes);
+  SCM scopes = SCM_EOL;
+  if (ly_c_module_p (header_))
+    scopes = scm_cons (header_, scopes);
   
-      String mod_nm = "scm framework-" + format;
+  String mod_nm = "scm framework-" + format;
 
-      SCM mod = scm_c_resolve_module (mod_nm.to_str0 ());
-      if (make_pages)
-       {
-         SCM func = scm_c_module_lookup (mod, "output-framework");
-
-         func = scm_variable_ref (func);
-         scm_apply_0 (func, scm_list_n (out->self_scm (),
-                                        self_scm (),
-                                        scopes,
-                                        dump_fields (),
-                                        scm_makfrom0str (outname.to_str0 ()),
-                                        SCM_UNDEFINED));
-         out->close ();
-         scm_gc_unprotect_object (out->self_scm ());
-         post_processing (mod, scm_makfrom0str (file_name.to_str0 ()));
-       }
+  SCM mod = scm_c_resolve_module (mod_nm.to_str0 ());
+  if (make_pages)
+    {
+      SCM func = scm_c_module_lookup (mod, "output-framework");
+
+      func = scm_variable_ref (func);
+      scm_apply_0 (func, scm_list_n (out->self_scm (),
+                                    self_scm (),
+                                    scopes,
+                                    dump_fields (),
+                                    scm_makfrom0str (outname.to_str0 ()),
+                                    SCM_UNDEFINED));
+      out->close ();
+      scm_gc_unprotect_object (out->self_scm ());
+      post_processing (mod, scm_makfrom0str (file_name.to_str0 ()));
+    }
       
-      if (make_preview)
-       {
-         String file_name = outname + ".preview." + format;
-         Paper_outputter *out = get_paper_outputter (file_name, format);
+  if (make_preview)
+    {
+      String file_name = outname + ".preview." + format;
+      Paper_outputter *out = get_paper_outputter (file_name, format);
   
-         SCM func = scm_c_module_lookup (mod, "output-preview-framework");
-         func = scm_variable_ref (func);
-         scm_apply_0 (func, scm_list_n (out->self_scm (),
-                                        self_scm (),
-                                        scopes,
-                                        dump_fields (),
-                                        scm_makfrom0str (outname.to_str0 ()),
-                                        SCM_UNDEFINED));
-
-         out->close ();
-         scm_gc_unprotect_object (out->self_scm ());
-
-         post_processing (mod, scm_makfrom0str (file_name.to_str0 ()));
-       }
+      SCM func = scm_c_module_lookup (mod, "output-preview-framework");
+      func = scm_variable_ref (func);
+      scm_apply_0 (func, scm_list_n (out->self_scm (),
+                                    self_scm (),
+                                    scopes,
+                                    dump_fields (),
+                                    scm_makfrom0str (outname.to_str0 ()),
+                                    SCM_UNDEFINED));
+
+      out->close ();
+      scm_gc_unprotect_object (out->self_scm ());
+
+      post_processing (mod, scm_makfrom0str (file_name.to_str0 ()));
     }
   progress_indication ("\n");
 }
@@ -226,29 +207,24 @@ Paper_book::classic_output (String outname)
     scopes = scm_cons (score_systems_[0].header_, scopes);
   //end ugh
 
-  Array<String> output_formats = split_string (output_format_global, ',');
-
-  for (int i = 0; i < output_formats.size (); i++)
-    {
-      String format = output_formats[i];
-      String mod_nm = "scm framework-" + format;
+  String format = output_format_global;
+  String mod_nm = "scm framework-" + format;
       
-      SCM mod = scm_c_resolve_module (mod_nm.to_str0 ());
-      SCM func = scm_c_module_lookup (mod, "output-classic-framework");
+  SCM mod = scm_c_resolve_module (mod_nm.to_str0 ());
+  SCM func = scm_c_module_lookup (mod, "output-classic-framework");
 
-      func = scm_variable_ref (func);
+  func = scm_variable_ref (func);
       
-      Paper_outputter *out = get_paper_outputter (outname + "." + format,
-                                                 format);
+  Paper_outputter *out = get_paper_outputter (outname + "." + format,
+                                             format);
 
-      scm_apply_0 (func, scm_list_n (out->self_scm (), self_scm (), scopes,
-                                    dump_fields (),
-                                    scm_makfrom0str (outname.to_str0 ()),
-                                    SCM_UNDEFINED));
+  scm_apply_0 (func, scm_list_n (out->self_scm (), self_scm (), scopes,
+                                dump_fields (),
+                                scm_makfrom0str (outname.to_str0 ()),
+                                SCM_UNDEFINED));
 
-      scm_gc_unprotect_object (out->self_scm ());
-      progress_indication ("\n");
-    }
+  scm_gc_unprotect_object (out->self_scm ());
+  progress_indication ("\n");
 }
 
 LY_DEFINE (ly_paper_book_pages, "ly:paper-book-pages",
index e056216422b8329a2406463d4df20ecf08ab0bba..d480dcf14336f0420885ed7293e6edc44eac0843 100644 (file)
 \context {
        \type "Engraver_group_engraver"
        \name Staff
-
        
        \consists "Output_property_engraver"    
-       
        \consists "Bar_engraver"
 % Bar_engraver must be first so default bars aren't overwritten
 % with empty ones.
        
        \consists "Font_size_engraver"
-       
        \consists "Volta_engraver"
        \consists "Separating_line_group_engraver"      
        \consists "Dot_column_engraver"