[impression/wrapper_canon.ml] Interface beaucoup plus propre

reste a faire marcher le mode livret

darcs-hash:20090529123816-bd074-bee0ef1aa4f8e2f45ec60474559d159b5954746d.gz
This commit is contained in:
Antoine Durand-Gasselin 2009-05-29 14:38:16 +02:00
parent 3d2f3fb290
commit 7469f4787e

View file

@ -9,9 +9,6 @@
* Dependances: libperl4ocaml-dev (>= 0.9.5-2), libwww-mechanize-perl
* Compilation: ocamlfind ocamlc -linkpkg -package unix,perl wrapper_canon.ml
*
*)
(*
#use "topfind";;
#require "perl";;
#require "unix";;
@ -58,20 +55,18 @@ let binding_long_edge = ref true
let _DuplexType() =
if !duplex then if !binding_long_edge then "2" else "1" else "0"
let agrafage = ref true
let piqure = ref false
let _Sort() =
if !piqure then "3" else
if !agrafage then "1" (* "134" *) else "1"
let finition = ref "none"
let _Sort() = match !finition with
"none" -> "0"
| _ -> "1"
let agrafe = ref "NW"
let _StapleType () = List.assoc !agrafe
[ "NW","5"; "NE","6"; "SW","7"; "SE","8"; "N","1"; "S","2"; "W","3"; "E","4"]
let _StapleType () = List.assoc !finition
[ "TopLeft","5"; "TopRight","6"; "BottomLeft","7"; "BottomRight","8";
"Top","1"; "Bottom","2"; "Left","3"; "Right","4"; "none","0"; "book","9"]
let couleur = ref false
let _ColorMode () = if !couleur then "2" else "1"
(** {1: Le formulaire} *)
let fields () =
[ "Url","http://"; "Mode","100"; "ManualNo","0"; "DocPasswd","";
@ -118,12 +113,9 @@ let options = Arg.align
"-two-sided", Arg.Set duplex, " Impression recto/verso";
"-two-sided-short-edge", Arg.Clear binding_long_edge,
" Reliure sur le bord court";
"-Staple", Arg.Set agrafage, " Agrafage du travail d'impression";
"-StapleLocation", Arg.Set_string agrafe,
"AZ Agrafe au NW,NE,SE,SW,N,S,E,W";
"-CNSaddleStitch", Arg.Set piqure, " Mode livret";
"-Monochrom", Arg.Clear couleur, " Impression en noir et blanc";
"-Color", Arg.Set couleur, " Impression en couleurs";
"-Finition", Arg.Set_string finition, "FINITION Finition: none | Top | TopLeft ... | Book";
]
let usage = "Usage: wrapper_canon [OPTIONS] FILE"