+++ /dev/null
-requires="helm-xml gdome2"
-version="0.0.1"
-archive(byte)="hgdome.cma"
-archive(native)="hgdome.cmxa"
MODULES = \
extlib \
xml \
- hgdome \
registry \
syntax_extensions \
thread \
+++ /dev/null
-domMisc.cmi:
-xml2Gdome.cmi:
-domMisc.cmo: domMisc.cmi
-domMisc.cmx: domMisc.cmi
-xml2Gdome.cmo: xml2Gdome.cmi
-xml2Gdome.cmx: xml2Gdome.cmi
+++ /dev/null
-domMisc.cmi:
-xml2Gdome.cmi:
-domMisc.cmo: domMisc.cmi
-domMisc.cmx: domMisc.cmi
-xml2Gdome.cmo: xml2Gdome.cmi
-xml2Gdome.cmx: xml2Gdome.cmi
+++ /dev/null
-PACKAGE = hgdome
-
-# modules which have both a .ml and a .mli
-INTERFACE_FILES = \
- domMisc.mli \
- xml2Gdome.mli \
- $(NULL)
-
-IMPLEMENTATION_FILES = $(INTERFACE_FILES:%.mli=%.ml)
-
-include ../../Makefile.defs
-include ../Makefile.common
+++ /dev/null
-(* Copyright (C) 2000-2002, HELM Team.
- *
- * This file is part of HELM, an Hypertextual, Electronic
- * Library of Mathematics, developed at the Computer Science
- * Department, University of Bologna, Italy.
- *
- * HELM is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * HELM is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HELM; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- *
- * For details, see the HELM World-Wide-Web page,
- * http://cs.unibo.it/helm/.
- *)
-
-(******************************************************************************)
-(* *)
-(* PROJECT HELM *)
-(* *)
-(* Claudio Sacerdoti Coen <sacerdot@cs.unibo.it> *)
-(* 06/01/2002 *)
-(* *)
-(* *)
-(******************************************************************************)
-
-(* $Id$ *)
-
-let domImpl = Gdome.domImplementation ()
-let helm_ns = Gdome.domString "http://www.cs.unibo.it/helm"
-let xlink_ns = Gdome.domString "http://www.w3.org/1999/xlink"
-let mathml_ns = Gdome.domString "http://www.w3.org/1998/Math/MathML"
-let boxml_ns = Gdome.domString "http://helm.cs.unibo.it/2003/BoxML"
-
+++ /dev/null
-(* Copyright (C) 2000-2002, HELM Team.
- *
- * This file is part of HELM, an Hypertextual, Electronic
- * Library of Mathematics, developed at the Computer Science
- * Department, University of Bologna, Italy.
- *
- * HELM is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * HELM is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HELM; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- *
- * For details, see the HELM World-Wide-Web page,
- * http://cs.unibo.it/helm/.
- *)
-
-(******************************************************************************)
-(* *)
-(* PROJECT HELM *)
-(* *)
-(* Claudio Sacerdoti Coen <sacerdot@cs.unibo.it> *)
-(* 15/01/2003 *)
-(* *)
-(* *)
-(******************************************************************************)
-
-val domImpl : Gdome.domImplementation
-
-val helm_ns : Gdome.domString (** HELM namespace *)
-val xlink_ns : Gdome.domString (** XLink namespace *)
-val mathml_ns : Gdome.domString (** MathML namespace *)
-val boxml_ns : Gdome.domString (** BoxML namespace *)
-
+++ /dev/null
-(* Copyright (C) 2000-2002, HELM Team.
- *
- * This file is part of HELM, an Hypertextual, Electronic
- * Library of Mathematics, developed at the Computer Science
- * Department, University of Bologna, Italy.
- *
- * HELM is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * HELM is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HELM; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- *
- * For details, see the HELM World-Wide-Web page,
- * http://cs.unibo.it/helm/.
- *)
-
-(* $Id$ *)
-
-let document_of_xml (domImplementation : Gdome.domImplementation) strm =
- let module G = Gdome in
- let module X = Xml in
- let rec update_namespaces ((defaultns,bindings) as namespaces) =
- function
- [] -> namespaces
- | (None,"xmlns",value)::tl ->
- update_namespaces (Some (Gdome.domString value),bindings) tl
- | (prefix,name,value)::tl when prefix = Some "xmlns" ->
- update_namespaces (defaultns,(name,Gdome.domString value)::bindings) tl
- | _::tl -> update_namespaces namespaces tl in
- let rec namespace_of_prefix (defaultns,bindings) =
- function
- None -> None
- | Some "xmlns" -> Some (Gdome.domString "xml-ns")
- | Some p' ->
- try
- Some (List.assoc p' bindings)
- with
- Not_found ->
- raise
- (Failure ("The prefix " ^ p' ^ " is not bound to any namespace")) in
- let get_qualified_name p n =
- match p with
- None -> Gdome.domString n
- | Some p' -> Gdome.domString (p' ^ ":" ^ n) in
- let root_prefix,root_name,root_attributes,root_content =
- ignore (Stream.next strm) ; (* to skip the <?xml ...?> declaration *)
- ignore (Stream.next strm) ; (* to skip the DOCTYPE declaration *)
- match Stream.next strm with
- X.Empty(p,n,l) -> p,n,l,[<>]
- | X.NEmpty(p,n,l,c) -> p,n,l,c
- | _ -> assert false
- in
- let namespaces = update_namespaces (None,[]) root_attributes in
- let namespaceURI = namespace_of_prefix namespaces root_prefix in
- let document =
- domImplementation#createDocument ~namespaceURI
- ~qualifiedName:(get_qualified_name root_prefix root_name)
- ~doctype:None
- in
- let rec aux namespaces (node : Gdome.node) =
- parser
- [< 'X.Str a ; s >] ->
- let textnode = document#createTextNode ~data:(Gdome.domString a) in
- ignore (node#appendChild ~newChild:(textnode :> Gdome.node)) ;
- aux namespaces node s
- | [< 'X.Empty(p,n,l) ; s >] ->
- let namespaces' = update_namespaces namespaces l in
- let namespaceURI = namespace_of_prefix namespaces' p in
- let element =
- document#createElementNS ~namespaceURI
- ~qualifiedName:(get_qualified_name p n)
- in
- List.iter
- (function (p,n,v) ->
- if p = None then
- element#setAttribute ~name:(Gdome.domString n)
- ~value:(Gdome.domString v)
- else
- let namespaceURI = namespace_of_prefix namespaces' p in
- element#setAttributeNS
- ~namespaceURI
- ~qualifiedName:(get_qualified_name p n)
- ~value:(Gdome.domString v)
- ) l ;
- ignore
- (node#appendChild
- ~newChild:(element : Gdome.element :> Gdome.node)) ;
- aux namespaces node s
- | [< 'X.NEmpty(p,n,l,c) ; s >] ->
- let namespaces' = update_namespaces namespaces l in
- let namespaceURI = namespace_of_prefix namespaces' p in
- let element =
- document#createElementNS ~namespaceURI
- ~qualifiedName:(get_qualified_name p n)
- in
- List.iter
- (function (p,n,v) ->
- if p = None then
- element#setAttribute ~name:(Gdome.domString n)
- ~value:(Gdome.domString v)
- else
- let namespaceURI = namespace_of_prefix namespaces' p in
- element#setAttributeNS ~namespaceURI
- ~qualifiedName:(get_qualified_name p n)
- ~value:(Gdome.domString v)
- ) l ;
- ignore (node#appendChild ~newChild:(element :> Gdome.node)) ;
- aux namespaces' (element :> Gdome.node) c ;
- aux namespaces node s
- | [< >] -> ()
- in
- let root = document#get_documentElement in
- List.iter
- (function (p,n,v) ->
- if p = None then
- root#setAttribute ~name:(Gdome.domString n)
- ~value:(Gdome.domString v)
- else
- let namespaceURI = namespace_of_prefix namespaces p in
- root#setAttributeNS ~namespaceURI
- ~qualifiedName:(get_qualified_name p n)
- ~value:(Gdome.domString v)
- ) root_attributes ;
- aux namespaces (root : Gdome.element :> Gdome.node) root_content ;
- document
-;;
+++ /dev/null
-(* Copyright (C) 2000-2002, HELM Team.
- *
- * This file is part of HELM, an Hypertextual, Electronic
- * Library of Mathematics, developed at the Computer Science
- * Department, University of Bologna, Italy.
- *
- * HELM is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * HELM is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HELM; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- *
- * For details, see the HELM World-Wide-Web page,
- * http://cs.unibo.it/helm/.
- *)
-
-val document_of_xml :
- Gdome.domImplementation -> Xml.token Stream.t -> Gdome.document
helm-ng_cic_content \
helm-grafite_parser \
helm-content_pres \
-helm-hgdome \
helm-ng_paramodulation \
helm-ng_tactics \
"
let mpres_document pres_box =
Xml.add_xml_declaration (CicNotationPres.print_box pres_box)
-let nmml_of_cic_sequent status metasenv subst sequent =
- let content_sequent,ids_to_refs =
- NTermCicContent.nmap_sequent status ~metasenv ~subst sequent in
- let pres_sequent =
- Sequent2pres.nsequent2pres ids_to_refs subst content_sequent in
- let xmlpres = mpres_document pres_sequent in
- Xml2Gdome.document_of_xml DomMisc.domImpl xmlpres
-
let ntxt_of_cic_sequent ~map_unicode_to_tex size status metasenv subst sequent =
let content_sequent,ids_to_refs =
NTermCicContent.nmap_sequent status ~metasenv ~subst sequent in
BoxPp.render_to_string ~map_unicode_to_tex
(function x::_ -> x | _ -> assert false) size pres_sequent
-let nmml_of_cic_object status obj =
- let cobj,ids_to_nrefs = NTermCicContent.nmap_obj status obj in
- let pres_sequent = Content2pres.ncontent2pres ~ids_to_nrefs cobj in
- let xmlpres = mpres_document pres_sequent in
- Xml2Gdome.document_of_xml DomMisc.domImpl xmlpres
-;;
-
let ntxt_of_cic_object ~map_unicode_to_tex size status obj =
let cobj,ids_to_nrefs = NTermCicContent.nmap_obj status obj in
let pres_sequent = Content2pres.ncontent2pres ~ids_to_nrefs cobj in
(* *)
(***************************************************************************)
-val nmml_of_cic_sequent:
- #NCicCoercion.status ->
- NCic.metasenv -> NCic.substitution -> (* metasenv, substitution *)
- int * NCic.conjecture -> (* sequent *)
- Gdome.document (* Math ML *)
-
val ntxt_of_cic_sequent:
map_unicode_to_tex:bool -> int ->
#NCicCoercion.status ->
int * NCic.conjecture -> (* sequent *)
string (* text *)
-val nmml_of_cic_object: #NCicCoercion.status -> NCic.obj -> Gdome.document
-
val ntxt_of_cic_object:
map_unicode_to_tex:bool -> int -> #NCicCoercion.status -> NCic.obj -> string
grafite_status,cmd
let eval_macro_screenshot (status : GrafiteTypes.status) name =
+ assert false (* MATITA 1.0
let _,_,metasenv,subst,_ = status#obj in
let sequent = List.hd metasenv in
let mathml =
Filename.quote (name^".png")));
HLog.debug ("generated " ^ name ^ ".png");
status, `New []
+ *)
;;
let eval_ast ?do_heavy_checks status (text,prefix_len,ast) =
method load_root : root:string -> unit
method remove_selections: unit
- method set_selection: Gdome.element option -> unit
- method get_selections: Gdome.element list
+ method set_selection: unit option -> unit
+ method get_selections: unit list
method set_font_size: int -> unit
let distance = sqrt (((x2 -. x1) ** 2.) +. ((y2 -. y1) ** 2.)) in
(distance < 4.)
+(*
let mathml_ns = Gdome.domString "http://www.w3.org/1998/Math/MathML"
let xlink_ns = Gdome.domString "http://www.w3.org/1999/xlink"
let helm_ns = Gdome.domString "http://www.cs.unibo.it/helm"
let empty_boxml = lazy (
domImpl#createDocument ~namespaceURI:(Some DomMisc.boxml_ns)
~qualifiedName:(Gdome.domString "box") ~doctype:None)
+ *)
(** shown for goals closed by side effects *)
let closed_goal_mathml = lazy "chiuso per side effect..."
+(*
(* ids_to_terms should not be passed here, is just for debugging *)
let find_root_id annobj id ids_to_father_ids ids_to_terms ids_to_inner_types =
assert false (* MATITA 1.0
has_maction (new Gdome.element_of_node node)
| _ -> false
;;
+*)
class clickableMathView obj =
let text_width = 80 in
~stop:(self#buffer#get_iter `END);
self#buffer#insert root
method remove_selections = (() : unit)
- method set_selection = (fun _ -> () : Gdome.element option -> unit)
- method get_selections = (assert false : Gdome.element list)
+ method set_selection = (fun _ -> () : unit option -> unit)
+ method get_selections = (assert false : unit list)
method set_font_size font_size =
self#misc#modify_font_by_name
(sprintf "%s %d" BuildTimeConf.script_font font_size)