matitaExcPp.cmx buildTimeConf.cmx matitaGui.cmi
matitaInit.cmo: matitaExcPp.cmi buildTimeConf.cmo matitaInit.cmi
matitaInit.cmx: matitaExcPp.cmx buildTimeConf.cmx matitaInit.cmi
-matitaMathView.cmo: virtuals.cmi matitaTypes.cmi matitaScript.cmi \
- matitaMisc.cmi matitaGuiTypes.cmi matitaGtkMisc.cmi matitaExcPp.cmi \
- lablGraphviz.cmi cicMathView.cmi buildTimeConf.cmo \
- applyTransformation.cmi matitaMathView.cmi
-matitaMathView.cmx: virtuals.cmx matitaTypes.cmx matitaScript.cmx \
- matitaMisc.cmx matitaGuiTypes.cmi matitaGtkMisc.cmx matitaExcPp.cmx \
- lablGraphviz.cmx cicMathView.cmx buildTimeConf.cmx \
- applyTransformation.cmx matitaMathView.cmi
+matitaMathView.cmo: virtuals.cmi matitaTypes.cmi matitaMisc.cmi \
+ matitaGuiTypes.cmi matitaGtkMisc.cmi matitaExcPp.cmi lablGraphviz.cmi \
+ cicMathView.cmi buildTimeConf.cmo applyTransformation.cmi \
+ matitaMathView.cmi
+matitaMathView.cmx: virtuals.cmx matitaTypes.cmx matitaMisc.cmx \
+ matitaGuiTypes.cmi matitaGtkMisc.cmx matitaExcPp.cmx lablGraphviz.cmx \
+ cicMathView.cmx buildTimeConf.cmx applyTransformation.cmx \
+ matitaMathView.cmi
matitaMisc.cmo: matitaGuiTypes.cmi buildTimeConf.cmo matitaMisc.cmi
matitaMisc.cmx: matitaGuiTypes.cmi buildTimeConf.cmx matitaMisc.cmi
matita.cmo: predefined_virtuals.cmi matitaTypes.cmi matitaScript.cmi \
matita.cmx: predefined_virtuals.cmx matitaTypes.cmx matitaScript.cmx \
matitaMathView.cmx matitaInit.cmx matitaGui.cmx matitaGtkMisc.cmx \
buildTimeConf.cmx
-matitaScript.cmo: virtuals.cmi matitaTypes.cmi matitaGtkMisc.cmi \
- matitaEngine.cmi cicMathView.cmi buildTimeConf.cmo matitaScript.cmi
-matitaScript.cmx: virtuals.cmx matitaTypes.cmx matitaGtkMisc.cmx \
- matitaEngine.cmx cicMathView.cmx buildTimeConf.cmx matitaScript.cmi
+matitaScript.cmo: virtuals.cmi matitaTypes.cmi matitaMathView.cmi \
+ matitaGtkMisc.cmi matitaEngine.cmi cicMathView.cmi buildTimeConf.cmo \
+ matitaScript.cmi
+matitaScript.cmx: virtuals.cmx matitaTypes.cmx matitaMathView.cmx \
+ matitaGtkMisc.cmx matitaEngine.cmx cicMathView.cmx buildTimeConf.cmx \
+ matitaScript.cmi
matitaTypes.cmo: matitaTypes.cmi
matitaTypes.cmx: matitaTypes.cmi
predefined_virtuals.cmo: virtuals.cmi predefined_virtuals.cmi
matitaInit.cmi:
matitaMathView.cmi: matitaTypes.cmi matitaGuiTypes.cmi
matitaMisc.cmi: matitaGuiTypes.cmi
-matitaScript.cmi: matitaTypes.cmi
+matitaScript.cmi:
matitaTypes.cmi:
predefined_virtuals.cmi:
virtuals.cmi:
matitaExcPp.cmx buildTimeConf.cmx matitaGui.cmi
matitaInit.cmo: matitaExcPp.cmi buildTimeConf.cmx matitaInit.cmi
matitaInit.cmx: matitaExcPp.cmx buildTimeConf.cmx matitaInit.cmi
-matitaMathView.cmo: virtuals.cmi matitaTypes.cmi matitaScript.cmi \
- matitaMisc.cmi matitaGuiTypes.cmi matitaGtkMisc.cmi matitaExcPp.cmi \
- lablGraphviz.cmi cicMathView.cmi buildTimeConf.cmx \
- applyTransformation.cmi matitaMathView.cmi
-matitaMathView.cmx: virtuals.cmx matitaTypes.cmx matitaScript.cmx \
- matitaMisc.cmx matitaGuiTypes.cmi matitaGtkMisc.cmx matitaExcPp.cmx \
- lablGraphviz.cmx cicMathView.cmx buildTimeConf.cmx \
- applyTransformation.cmx matitaMathView.cmi
+matitaMathView.cmo: virtuals.cmi matitaTypes.cmi matitaMisc.cmi \
+ matitaGuiTypes.cmi matitaGtkMisc.cmi matitaExcPp.cmi lablGraphviz.cmi \
+ cicMathView.cmi buildTimeConf.cmx applyTransformation.cmi \
+ matitaMathView.cmi
+matitaMathView.cmx: virtuals.cmx matitaTypes.cmx matitaMisc.cmx \
+ matitaGuiTypes.cmi matitaGtkMisc.cmx matitaExcPp.cmx lablGraphviz.cmx \
+ cicMathView.cmx buildTimeConf.cmx applyTransformation.cmx \
+ matitaMathView.cmi
matitaMisc.cmo: matitaGuiTypes.cmi buildTimeConf.cmx matitaMisc.cmi
matitaMisc.cmx: matitaGuiTypes.cmi buildTimeConf.cmx matitaMisc.cmi
matita.cmo: predefined_virtuals.cmi matitaTypes.cmi matitaScript.cmi \
matita.cmx: predefined_virtuals.cmx matitaTypes.cmx matitaScript.cmx \
matitaMathView.cmx matitaInit.cmx matitaGui.cmx matitaGtkMisc.cmx \
buildTimeConf.cmx
-matitaScript.cmo: virtuals.cmi matitaTypes.cmi matitaGtkMisc.cmi \
- matitaEngine.cmi cicMathView.cmi buildTimeConf.cmx matitaScript.cmi
-matitaScript.cmx: virtuals.cmx matitaTypes.cmx matitaGtkMisc.cmx \
- matitaEngine.cmx cicMathView.cmx buildTimeConf.cmx matitaScript.cmi
+matitaScript.cmo: virtuals.cmi matitaTypes.cmi matitaMathView.cmi \
+ matitaGtkMisc.cmi matitaEngine.cmi cicMathView.cmi buildTimeConf.cmx \
+ matitaScript.cmi
+matitaScript.cmx: virtuals.cmx matitaTypes.cmx matitaMathView.cmx \
+ matitaGtkMisc.cmx matitaEngine.cmx cicMathView.cmx buildTimeConf.cmx \
+ matitaScript.cmi
matitaTypes.cmo: matitaTypes.cmi
matitaTypes.cmx: matitaTypes.cmi
predefined_virtuals.cmo: virtuals.cmi predefined_virtuals.cmi
matitaInit.cmi:
matitaMathView.cmi: matitaTypes.cmi matitaGuiTypes.cmi
matitaMisc.cmi: matitaGuiTypes.cmi
-matitaScript.cmi: matitaTypes.cmi
+matitaScript.cmi:
matitaTypes.cmi:
predefined_virtuals.cmi:
virtuals.cmi:
matitaGtkMisc.mli \
virtuals.mli \
cicMathView.mli \
- matitaScript.mli \
predefined_virtuals.mli \
matitaMathView.mli \
+ matitaScript.mli \
matitaGui.mli \
$(NULL)
CMLI = \
open MatitaGuiTypes
open GtkSourceView2
-let matita_script_current = ref (fun _ -> assert false);;
+let matita_script_current = ref (fun _ -> (assert false : < advance: ?statement:string -> unit -> unit; grafite_status: GrafiteTypes.status; setGoal: int option -> unit >));;
let register_matita_script_current f = matita_script_current := f;;
+let get_matita_script_current () = !matita_script_current ();;
type document_element = string
(GrafiteAst.Tactic (loc,
Some (GrafiteAst.Reduce (loc, kind, pat)),
GrafiteAst.Semicolon loc)) in
- (!matita_script_current ())#advance ~statement () in
+ (get_matita_script_current ())#advance ~statement () in
connect_menu_item copy gui#copy;
connect_menu_item normalize (reduction_action `Normalize);
connect_menu_item simplify (reduction_action `Simpl);
else string_of_dom_node node
method private string_of_cic_sequent ~output_type cic_sequent =
- let script = !matita_script_current () in
+ let script = get_matita_script_current () in
let metasenv =
if script#onGoingProof () then script#proofMetasenv else [] in
let map_unicode_to_tex =
GrafiteTypes.status -> NCic.metasenv -> NCic.metasenv ->
NCic.substitution -> string -> unit
-val register_matita_script_current: (unit -> < advance: unit; onGoingProf: bool; metasenv: NCic.metasenv >) -> unit
+(* CSC: these functions should completely disappear; bad design;
+ the object type is MatitaScript.script *)
+val register_matita_script_current: (unit -> < advance: ?statement:string -> unit -> unit; grafite_status: GrafiteTypes.status; setGoal: int option -> unit >) -> unit
+val get_matita_script_current: unit -> < advance: ?statement:string -> unit -> unit; grafite_status: GrafiteTypes.status; setGoal: int option -> unit >
let s =
MatitaScript.script
~source_view:gui#sourceView
- ~mathviewer:(MatitaMathView.mathViewer ())
~urichooser:(fun uris ->
try
MatitaGui.interactive_uri_choice ~selection_mode:`SINGLE
(** inherit from this class if you want to access current script *)
class scriptAccessor =
object (self)
- method private script = MatitaScript.current ()
+ method private script = get_matita_script_current ()
end
let cicBrowsers = ref []
let module Pp = GraphvizPp.Dot in
let filename, oc = Filename.open_temp_file "matita" ".dot" in
let fmt = Format.formatter_of_out_channel oc in
- let status = (MatitaScript.current ())#grafite_status in
+ let status = (get_matita_script_current ())#grafite_status in
Pp.header
~name:"Hints"
~graph_type:"graph"
~name:"Coercions"
~node_attrs:["fontsize", "9"; "width", ".4"; "height", ".4"]
~edge_attrs:["fontsize", "10"] fmt;
- let status = (MatitaScript.current ())#grafite_status in
+ let status = (get_matita_script_current ())#grafite_status in
NCicCoercion.generate_dot_file status fmt;
Pp.trailer fmt;
Pp.raw "@." fmt;
method private _loadTermNCic term m s c =
let d = 0 in
let m = (0,([],c,term))::m in
- let status = (MatitaScript.current ())#grafite_status in
+ let status = (get_matita_script_current ())#grafite_status in
mathView#nload_sequent status m s d;
self#_showMath
sequentsViewer ~notebook:gui#main#sequentsNotebook ~cicMathView ()
let sequentsViewer_instance = MatitaMisc.singleton default_sequentsViewer
-let mathViewer () =
- object(self)
- method private get_browser reuse =
- if reuse then
- (match !cicBrowsers with
- | [] -> cicBrowser ()
- | b :: _ -> (b :> MatitaGuiTypes.cicBrowser))
- else
- (cicBrowser ())
- method show_entry ?(reuse=false) t = (self#get_browser reuse)#load t
-
- end
+(** @param reuse if set reused last opened cic browser otherwise
+* opens a new one. default is false *)
+let show_entry ?(reuse=false) t =
+ let browser =
+ if reuse then
+ (match !cicBrowsers with
+ [] -> cicBrowser ()
+ | b :: _ -> (b :> MatitaGuiTypes.cicBrowser))
+ else
+ cicBrowser ()
+ in
+ browser#load t
+;;
let refresh_all_browsers () =
List.iter (fun b -> b#refresh ~force:false ()) !cicBrowsers
(** {2 Singleton instances} *)
val sequentsViewer_instance: unit -> MatitaGuiTypes.sequentsViewer
-val mathViewer: unit -> MatitaTypes.mathViewer
(** {2 Global changes} *)
val refresh_all_browsers: unit -> unit (** act on all cicBrowsers *)
val update_font_sizes: unit -> unit
- (** {3 Clipboard & Selection handling} *)
+(** {2 Rendering in a browser} *)
+
+(** @param reuse if set reused last opened cic browser otherwise
+* opens a new one. default is false *)
+val show_entry: ?reuse:bool -> MatitaTypes.mathViewer_entry -> unit
+
+(** {2 Clipboard & Selection handling} *)
val has_selection: unit -> bool
with Not_found -> s
type guistuff = {
- mathviewer:MatitaTypes.mathViewer;
urichooser: NReference.reference list -> NReference.reference list;
ask_confirmation: title:string -> message:string -> [`YES | `NO | `CANCEL];
}
NotationPt.Cast (t,NotationPt.Implicit `JustOne))
(* XXX use the metasenv, if possible *)
in
- guistuff.mathviewer#show_entry (`NCic (t,ctx,m,s));
+ MatitaMathView.show_entry (`NCic (t,ctx,m,s));
[status, parsed_text], "", parsed_text_length
| TA.NIntroGuess _loc ->
let names_ref = ref [] in
fun () -> incr i; !i
class script ~(source_view: GSourceView2.source_view)
- ~(mathviewer: MatitaTypes.mathViewer)
~set_star
~ask_confirmation
~urichooser
val scriptId = fresh_script_id ()
val guistuff = {
- mathviewer = mathviewer;
urichooser = urichooser;
ask_confirmation = ask_confirmation;
}
let _script = ref None
-let script ~source_view ~mathviewer ~urichooser ~ask_confirmation ~set_star ()
+let script ~source_view ~urichooser ~ask_confirmation ~set_star ()
=
- let s = new script
- ~source_view ~mathviewer ~ask_confirmation ~urichooser ~set_star ()
- in
+ let s = new script ~source_view ~ask_confirmation ~urichooser ~set_star () in
_script := Some s;
s
let current () = match !_script with None -> assert false | Some s -> s
+let _ =
+ CicMathView.register_matita_script_current (current :> unit -> < advance: ?statement:string -> unit -> unit; grafite_status: GrafiteTypes.status; setGoal: int option -> unit >)
+;;
* "*") on the side of a script name *)
val script:
source_view:GSourceView2.source_view ->
- mathviewer: MatitaTypes.mathViewer->
urichooser: (NReference.reference list -> NReference.reference list) ->
ask_confirmation:
(title:string -> message:string -> [`YES | `NO | `CANCEL]) ->
| "about:grammar" -> `About `Grammar
| _ -> (* only about entries supported ATM *)
raise (Invalid_argument "entry_of_string")
-
-class type mathViewer =
- object
- (** @param reuse if set reused last opened cic browser otherwise
- * opens a new one. default is false
- *)
- method show_entry: ?reuse:bool -> mathViewer_entry -> unit
- end
val string_of_entry : mathViewer_entry -> string
val entry_of_string : string -> mathViewer_entry
-
-class type mathViewer =
- object
- method show_entry : ?reuse:bool -> mathViewer_entry -> unit
- end