method show_uri_list ?(reuse=false) ~entry l =
(self#get_browser reuse)#load entry
- method screenshot status sequent metasenv subst (filename as ofn) =
- let mathml =
- ApplyTransformation.nmml_of_cic_sequent status metasenv subst sequent
- in
+ method screenshot status sequents metasenv subst (filename as ofn) =
let w = GWindow.window ~title:"screenshot" () in
let width = 600 in
let height = 2000 in
~show:true ()
in
w#show ();
- m#load_root ~root:mathml#get_documentElement;
- let pixmap = m#get_buffer in
- let pixbuf = GdkPixbuf.create ~width ~height () in
- GdkPixbuf.get_from_drawable ~dest:pixbuf pixmap;
- let filename = filename ^ "-raw.png" in
- GdkPixbuf.save ~filename ~typ:"png" pixbuf;
+ let filenames =
+ HExtlib.list_mapi
+ (fun sequent i ->
+ let mathml =
+ ApplyTransformation.nmml_of_cic_sequent
+ status metasenv subst sequent
+ in
+ m#load_root ~root:mathml#get_documentElement;
+ let pixmap = m#get_buffer in
+ let pixbuf = GdkPixbuf.create ~width ~height () in
+ GdkPixbuf.get_from_drawable ~dest:pixbuf pixmap;
+ let filename =
+ filename ^ "-raw" ^ string_of_int i ^ ".png"
+ in
+ GdkPixbuf.save ~filename ~typ:"png" pixbuf;
+ filename)
+ sequents
+ in
+ let items =
+ List.map (fun x ->
+ Printf.sprintf
+ " '(' -trim -border 3 -bordercolor white %s ')' "
+ (Filename.quote x))
+ filenames
+ in
ignore(Sys.command (Printf.sprintf
- "convert -trim -border 3 -bordercolor white %s %s"
- (Filename.quote filename)
+ "convert %s +append %s"
+ (String.concat (" '(' -gravity center -size 9x150 xc: "^
+ "-draw \"line 5,0 5,48\" "^
+ "-draw \"line 5,52 5,98\" " ^
+ "-draw \"line 5,102 5,150\" " ^ " ')'") items)
(Filename.quote (ofn ^ ".png"))));
+ List.iter Sys.remove filenames;
w#destroy ();
end
| TA.Screenshot (_,name) ->
let status = script#grafite_status in
let _,_,menv,subst,_ = status#obj in
- let sequent = List.hd menv in
let name = Filename.dirname (script#filename) ^ "/" ^ name in
- guistuff.mathviewer#screenshot status sequent menv subst name;
+ guistuff.mathviewer#screenshot status menv menv subst name;
[status, parsed_text], "", parsed_text_length
| TA.NCheck (_,t) ->
let status = script#grafite_status in