]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gTopLevel/termViewer.ml
* this implements the new instantiation for gtkmathview
[helm.git] / helm / gTopLevel / termViewer.ml
index da7b6bdca762df7cb351d9385b0a38d00f9afccb..b782237d0379f24d06f39d56e71940c0f04cb45b 100644 (file)
@@ -65,6 +65,7 @@ class sequent_viewer obj =
   (* returns the list of selected terms         *)
   (* selections which are not terms are ignored *)
   method get_selected_terms =
+   prerr_endline (string_of_int (List.length self#get_selections)) ;
    let selections = self#get_selections in
     list_map_fail
      (function node ->
@@ -73,6 +74,7 @@ class sequent_viewer obj =
           ~namespaceURI:Misc.helmns
           ~localName:(Gdome.domString "xref"))#to_string
        in
+        prerr_endline ("YAHHHHHHHHHH " ^ xpath) ;
         if xpath = "" then assert false (* "ERROR: No xref found!!!" *)
         else
          match current_infos with
@@ -111,11 +113,19 @@ class sequent_viewer obj =
     ApplyStylesheets.mml_of_cic_sequent metasenv sequent
    in
     self#load_doc ~dom:sequent_mml ;
+Misc.domImpl#saveDocumentToFile ~name:"/tmp/pippo" ~doc:sequent_mml () ;
     current_infos <-
      Some (ids_to_terms,ids_to_father_ids,ids_to_hypotheses)
  end
 ;;
 
+let sequent_viewer ?hadjustment ?vadjustment ?font_size ?log_verbosity =
+  GtkBase.Container.make_params ~cont:(
+  OgtkMathViewProps.pack_return
+    (fun p -> OgtkMathViewProps.set_params (new sequent_viewer (GtkMathViewProps.MathView.create p)) ~font_size ~log_verbosity)) []
+;;
+
+(*
 let sequent_viewer ?adjustmenth ?adjustmentv ?font_size ?font_manager
  ?border_width ?width ?height ?packing ?show () =
  let w =
@@ -138,7 +148,7 @@ let sequent_viewer ?adjustmenth ?adjustmentv ?font_size ?font_manager
   end;
   mathview
 ;;
-
+*)
 
 (** A widget to render proofs **)
 
@@ -160,6 +170,7 @@ class proof_viewer obj =
           ~namespaceURI:Misc.helmns
           ~localName:(Gdome.domString "xref"))#to_string
        in
+        prerr_endline ("YAEEEEEEEEEEEEEEEEEEE " ^ xpath) ;
         if xpath = "" then assert false (* "ERROR: No xref found!!!" *)
         else
          begin
@@ -266,6 +277,13 @@ class proof_viewer obj =
  end
 ;;
 
+let proof_viewer ?hadjustment ?vadjustment ?font_size ?log_verbosity =
+  GtkBase.Container.make_params ~cont:(
+  OgtkMathViewProps.pack_return
+    (fun p -> OgtkMathViewProps.set_params (new proof_viewer (GtkMathViewProps.MathView.create p)) ~font_size ~log_verbosity)) []
+;;
+
+(*
 let proof_viewer ?adjustmenth ?adjustmentv ?font_size ?font_manager
  ?border_width ?width ?height ?packing ?show () =
  let w =
@@ -288,6 +306,7 @@ let proof_viewer ?adjustmenth ?adjustmentv ?font_size ?font_manager
   end;
   mathview
 ;;
+*)
 
 let _ =
  Cexpr2pres_hashtbl.init Cexpr2pres.cexpr2pres Cexpr2pres.cexpr2pres_charcount