]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitaMathView.mli
Added $Id$ to every .ml file.
[helm.git] / helm / matita / matitaMathView.mli
index 8b5ca89acd1ced41d4f1aacf172244044021c260..ea0c077d842ef2c7ca9731df7f4d4395b79fb277 100644 (file)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2004, 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/
  *)
 
-  (** multi selection gtkMathView which handle mactions and hyperlinks. Mactions
-  * are handled internally. Hyperlinks are handled by calling an user provided
-  * callback *)
-class type clickable_math_view =
-  object
-    inherit GMathViewAux.multi_selection_math_view
-
-      (** set hyperlink callback. None disable hyperlink handling *)
-    method set_href_callback: (UriManager.uri -> unit) option -> unit
-  end
-
-class type proof_viewer =
-  object
-    inherit clickable_math_view
-
-    method load_proof: StatefulProofEngine.proof_status -> unit
-  end
-
-class type sequent_viewer =
-  object
-    inherit clickable_math_view
-
-      (** @return the list of selected terms. Selections which are not terms are
-      * ignored *)
-    method get_selected_terms: Cic.term list
-
-      (** @return the list of selected hypothese. Selections which are not
-      * hypotheses are ignored *)
-    method get_selected_hypotheses: Cic.hypothesis list
-
-      (** load a sequent and render it into parent widget *)
-    method load_sequent: Cic.metasenv -> int -> unit
-  end
-
-class type sequents_viewer =
-  object
-    method reset: unit
-    method load_sequents: Cic.metasenv -> unit
-    method goto_sequent: int -> unit  (* to be called _after_ load_sequents *)
-  end
-
-class type cicBrowser =
-  object
-    method load_uri: UriManager.uri -> unit
-  end
-
 (** {2 Constructors} *)
 
-val proof_viewer:
+  (** meta constructor *)
+type 'widget constructor =
   ?hadjustment:GData.adjustment ->
   ?vadjustment:GData.adjustment ->
   ?font_size:int ->
@@ -81,34 +36,52 @@ val proof_viewer:
   ?packing:(GObj.widget -> unit) ->
   ?show:bool ->
   unit ->
-    proof_viewer
+    'widget
 
-val sequent_viewer:
-  ?hadjustment:GData.adjustment ->
-  ?vadjustment:GData.adjustment ->
-  ?font_size:int ->
-  ?log_verbosity:int ->
-  ?width:int ->
-  ?height:int ->
-  ?packing:(GObj.widget -> unit) ->
-  ?show:bool ->
-  unit ->
-    sequent_viewer
+val clickableMathView:  MatitaGuiTypes.clickableMathView constructor
 
-val sequents_viewer:
+val cicMathView:        MatitaGuiTypes.cicMathView constructor
+
+val sequentsViewer:
   notebook:GPack.notebook ->
-  sequent_viewer:sequent_viewer ->
-  set_goal:(int -> unit) ->
+  cicMathView:MatitaGuiTypes.cicMathView ->
   unit ->
-    sequents_viewer
+    MatitaGuiTypes.sequentsViewer
+
+val cicBrowser: unit -> MatitaGuiTypes.cicBrowser
+
+(** {2 MathView wide functions} *)
+(* TODO ZACK consider exporting here a single function which return a list of
+ * MatitaGuiTypes.clickableMathView and act on them externally ... *)
+
+val increase_font_size:   unit -> unit
+val decrease_font_size:   unit -> unit
+val reset_font_size:      unit -> unit
+
+val refresh_all_browsers: unit -> unit  (** act on all cicBrowsers *)
+val update_font_sizes:    unit -> unit
+
+  (** {3 Clipboard & Selection handling} *)
+
+val has_selection: unit -> bool
+
+  (** fills the clipboard with the current selection
+   * @raise Failure "no selection" *)
+val copy_selection: unit -> unit
+val has_clipboard: unit -> bool (** clipboard is not empty *)
+val empty_clipboard: unit -> unit (** empty the clipboard *)
+
+  (** @raise Failure "empty clipboard" *)
+val paste_clipboard: MatitaGuiTypes.paste_kind -> string
+
+(** {2 Singleton instances} *)
 
-val cicBrowser: unit -> cicBrowser
+val cicMathView_instance: unit -> MatitaGuiTypes.cicMathView
+val sequentsViewer_instance:  unit -> MatitaGuiTypes.sequentsViewer
 
-val mathViewer: unit -> MatitaTypes.mathViewer
+val mathViewer:               unit -> MatitaTypes.mathViewer
 
-(** {2 Singletons} *)
+(** {2 Initialization} *)
 
-  (** singleton proof_viewer instance.
-  * Uses singleton GUI instance *)
-val proof_viewer_instance: unit -> proof_viewer
+val set_gui: MatitaGuiTypes.gui -> unit