]> matita.cs.unibo.it Git - helm.git/blob - helm/gTopLevel/termViewer.mli
ported to latest lablgtkmathview
[helm.git] / helm / gTopLevel / termViewer.mli
1 (* Copyright (C) 2000-2002, HELM Team.
2  * 
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  * 
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * 
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://cs.unibo.it/helm/.
24  *)
25
26 (******************************************************************************)
27 (*                                                                            *)
28 (*                               PROJECT HELM                                 *)
29 (*                                                                            *)
30 (*                Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>               *)
31 (*                                 29/01/2003                                 *)
32 (*                                                                            *)
33 (*                                                                            *)
34 (******************************************************************************)
35
36 type mml_of_cic_sequent =
37  Cic.metasenv ->
38  int * Cic.context * Cic.term ->
39  Gdome.document *
40   ((Cic.id, Cic.term) Hashtbl.t *
41    (Cic.id, Cic.id option) Hashtbl.t *
42    (string, Cic.hypothesis) Hashtbl.t)
43
44 type mml_of_cic_object =
45   explode_all:bool ->
46   UriManager.uri ->
47   Cic.annobj ->
48   (string, string) Hashtbl.t ->
49   (string, Cic2acic.anntypes) Hashtbl.t -> Gdome.document
50
51 (** A widget to render sequents **)
52
53 class sequent_viewer :
54   mml_of_cic_sequent:mml_of_cic_sequent ->
55   Gtk_mathview.math_view Gtk.obj ->
56   object
57     inherit GMathViewAux.multi_selection_math_view
58
59     (* returns the list of selected terms         *)
60     (* selections which are not terms are ignored *)
61     method get_selected_terms : Cic.term list
62
63     (* returns the list of selected hypotheses         *)
64     (* selections which are not hypotheses are ignored *)
65     method get_selected_hypotheses : Cic.hypothesis list
66
67     method load_sequent : Cic.metasenv -> Cic.conjecture -> unit
68   end
69
70 val sequent_viewer :
71   mml_of_cic_sequent:mml_of_cic_sequent ->
72   ?hadjustment:GData.adjustment ->
73   ?vadjustment:GData.adjustment ->
74   ?font_size:int ->
75   ?log_verbosity:int ->
76   ?width:int ->
77   ?height:int ->
78   ?packing:(GObj.widget -> unit) ->
79   ?show:bool ->
80   unit -> sequent_viewer
81
82 (** A widget to render proofs **)
83
84 class proof_viewer :
85   mml_of_cic_object:mml_of_cic_object ->
86   Gtk_mathview.math_view Gtk.obj ->
87   object
88     inherit GMathViewAux.single_selection_math_view
89
90     (* the new current sequent becomes the one obtained *)
91     (* perforating the proof where the selection is     *)
92     method make_sequent_of_selected_term : unit
93
94     (* the new current sequent becomes the one obtained *)
95     (* focusing the proof on the selected metavariable  *)
96     method focus_sequent_of_selected_term : unit
97
98     (* load_proof also returns the annotated cic term and the *)
99     (* ids_to_inner_types and ids_to_inner_sorts maps.        *)
100     method load_proof :
101      UriManager.uri -> Cic.obj ->
102       Cic.annobj * (Cic.id, Cic2acic.anntypes) Hashtbl.t *
103        (Cic.id, string) Hashtbl.t
104
105   end
106
107 val proof_viewer :
108   mml_of_cic_object:mml_of_cic_object ->
109   ?hadjustment:GData.adjustment ->
110   ?vadjustment:GData.adjustment ->
111   ?font_size:int ->
112   ?log_verbosity:int ->
113   ?width:int ->
114   ?height:int ->
115   ?packing:(GObj.widget -> unit) ->
116   ?show:bool ->
117   unit -> proof_viewer
118