/[geocaml]/geocaml/src/main.ml
ViewVC logotype

Diff of /geocaml/src/main.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by adoniec, Fri Apr 4 13:46:25 2003 UTC revision 1.8 by gmariano, Tue Sep 2 15:06:31 2003 UTC
# Line 6  type to_open = SOURCE | INTERACTIVE_MODE Line 6  type to_open = SOURCE | INTERACTIVE_MODE
6    
7  let toopen = ref INTERACTIVE_MODE  let toopen = ref INTERACTIVE_MODE
8    
9  let todo = ref EMPTY  (* Par défaut, affichage graphique *)
10    
11    let todo = ref DRAWING
12    
13  let sources = ref ""  let sources = ref ""
14    
# Line 22  let draw () = Line 24  let draw () =
24    while true do f#action() done    while true do f#action() done
25    
26  let draw2 () =  let draw2 () =
27    let f = new Drawing.figure (!xwin,!ywin) in    let
28    Geom.draw_figure Geom.my_figure f;      f = new Drawing.figure (!xwin,!ywin)
29      in
30        Geom.draw_figure Geom.my_figure f
31        ;
32    f    f
33    
34  let redraw f =  let redraw f =
# Line 73  let rec analyse_stdin f = Line 78  let rec analyse_stdin f =
78      | e -> (print_mess_error "Erreur !" (Abrlex.treat_exception e);flush stdout;analyse_stdin f)      | e -> (print_mess_error "Erreur !" (Abrlex.treat_exception e);flush stdout;analyse_stdin f)
79    
80    
 let make_postcript () =  
   let channel = open_out ((!sources)^".xml") in  
   output_string channel Xml.version;  
   (*output_string channel Xml.doctype;*)  
   Xmlexpansed.open_balise "figure" "" channel;  
   Geom.write_figure2 Geom.my_figure channel;  
   Xmlexpansed.close_balise "figure" channel;  
   close_out channel;  
   Sys.command ("./postcript.sh "^(!sources)^".xml");()  
81            
82  let write_xml () =  let write_xml () =
83    let channel = open_out ((!sources)^".xml") in    let channel = open_out ((!sources)^".xml") in
# Line 93  let write_xml () = Line 89  let write_xml () =
89    close_out channel    close_out channel
90    
91  let options_list =  let options_list =
92    [("--hwin",Arg.Int (fun y -> ywin := y),"définit la hauteur de la fenêtre graphique");    [
93     ("--lwin",Arg.Int (fun x -> xwin := x),"définit la largeur de la fenêtre graphique");      ("--hwin",
94     ("--ps",Arg.Unit(fun () -> todo := PS),"génère un fichier Postcript");       Arg.Int (fun y -> ywin := y),
95     ("--tex",Arg.Unit(fun () -> todo := LATEX),"génère un fichier LaTeX");       "définit la hauteur de la fenêtre graphique")
96     ("--xml",Arg.Unit(fun () -> todo := XML),"génère un fichier XML");      ;
97     ("--gr",Arg.Unit(fun () -> todo := DRAWING),"utilise l'affichage graphique")]      ("--lwin",
98         Arg.Int (fun x -> xwin := x),"définit la largeur de la fenêtre graphique")
99        ;
100        ("--ps",
101         Arg.Unit(fun () -> todo := PS),"génère un fichier Postcript")
102        ;
103        ("--tex",
104         Arg.Unit(fun () -> todo := LATEX),"génère un fichier LaTeX")
105        ;
106        ("--xml",
107         Arg.Unit(fun () -> todo := XML),"génère un fichier XML")
108        ;
109        ("--gr",
110         Arg.Unit(fun () -> todo := DRAWING),"utilise l'affichage graphique")]
111    
112  let use_message = "Usage : "^Sys.argv.(0)^"[options] fichier source"  let use_message = "Usage : "^Sys.argv.(0)^"[options] fichier source"
113    
# Line 131  let main() = Line 140  let main() =
140      );      );
141      match !todo with      match !todo with
142      | DRAWING -> draw ()      | DRAWING -> draw ()
143      | PS -> make_postcript ()      | PS -> GeoPs.make_postcript sources (* GeoPs.output/write !? *)
144      | XML -> write_xml ()      | XML -> write_xml () (* GeoXml.write/write !? *)
145      | LATEX -> ()      | LATEX -> ()
146      | EMPTY -> ()      | EMPTY -> ()
147    end    end

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26