]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitaScript.mli
ocaml 3.09 transition
[helm.git] / helm / matita / matitaScript.mli
index b1d32eb999774158c6ee6efd0007cc1442b6e28c..35ae43ebb7e5c6d2622a7d950045f019c3931a8a 100644 (file)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2005, HELM Team.
+(* Copyright (C) 2004-2005, HELM Team.
  * 
  * This file is part of HELM, an Hypertextual, Electronic
  * Library of Mathematics, developed at the Computer Science
  * http://helm.cs.unibo.it/
  *)
 
-  (** script failures (e.g. going before the beginning or after the end of the
-  * script) *)
-exception Script_failure of string
-
 class type script =
-  object
-      (** script window used by this script *)
-    method win: MatitaGeneratedGui.scriptWin
+object
+
+  method locked_mark : Gtk.text_mark
+  method locked_tag : GText.tag
+
+  (** @return current status *)
+  method status: MatitaTypes.status
+    
+  (** {2 Observers} *)
+
+  method addObserver : (MatitaTypes.status -> unit) -> unit
+
+  (** {2 History} *)
+
+  method advance : ?statement:string -> unit -> unit
+  method retract : unit -> unit
+  method goto: [`Top | `Bottom | `Cursor] -> unit -> unit
+  method reset: unit -> unit
+  method template: unit -> unit
+
+  (** {2 Load/save} *)
+
+  method assignFileName : string -> unit (* to the current active file *)
+  method loadFromFile : string -> unit
+  method saveToFile : unit -> unit
+  method filename : string
+
+  (** {2 Current proof} (if any) *)
+
+  (** @return true if there is an ongoing proof, false otherise *)
+  method onGoingProof: unit -> bool
+
+(*   method proofStatus: ProofEngineTypes.status |+* @raise Statement_error +| *)
+  method proofMetasenv: Cic.metasenv          (** @raise Statement_error *)
+  method proofContext: Cic.context            (** @raise Statement_error *)
+  method proofConclusion: Cic.term            (** @raise Statement_error *)
+  method stack: Continuationals.Stack.t       (** @raise Statement_error *)
+
+  method setGoal: int -> unit
+  method goal: int
+
+  (** end of script, true if the whole script has been executed *)
+  method eos: bool
+
+  (** misc *)
+  method clean_dirty_lock: unit
+  
+  (* debug *)
+  method dump : unit -> unit
 
-      (** fill text buffer reading a script from a file *)
-    method loadFrom: string -> unit
+end
 
-      (** adds a tactical at current script execution point and execute it. Used
-      * when the user uses buttons or console instead of directly editing the
-      * script *)
-    method advance: string -> MatitaTypes.command_outcome
-  end
+  (** @param set_star callback used to set the modified symbol (usually a star
+   * "*") on the side of a script name *)
+val script: 
+  source_view:GSourceView.source_view -> 
+  init:MatitaTypes.status -> 
+  mathviewer: MatitaTypes.mathViewer-> 
+  urichooser: (UriManager.uri list -> UriManager.uri list) -> 
+  develcreator: (containing:string option -> unit) ->
+  ask_confirmation: 
+    (title:string -> message:string -> [`YES | `NO | `CANCEL]) -> 
+  set_star: (string -> bool -> unit) ->
+  unit -> 
+    script
 
-val script: interpreter:MatitaTypes.interpreter -> script
+(* each time script above is called an internal ref is set, instance will return
+ * the value of this ref *)
+(* TODO Zack: orrible solution until we found a better one for having a single
+ * access point for the script *)
+val current: unit -> script