From 0d9d6be5c3d0800c30af3db0d76101dc54743464 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 7 Nov 2000 18:54:06 +0000 Subject: [PATCH] Test finished, but some bugs still remaining --- .../ml_gtk_mathview.c | 4 +- .../test/Makefile | 11 +++- .../test/t1lib.log | 3 -- .../test/test.ml | 51 ++++++++++++++----- 4 files changed, 51 insertions(+), 18 deletions(-) diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/ml_gtk_mathview.c b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/ml_gtk_mathview.c index 3286f9054..184977e5e 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/ml_gtk_mathview.c +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/ml_gtk_mathview.c @@ -81,11 +81,13 @@ value ml_gtk_math_view_mDOMNode_of_bodex_option (value arg1) CAMLparam1(arg1); mDOMNodeRef nr; + CAMLlocal1 (tmp); if (arg1==Val_int(0)) { nr = NULL; } else { - nr = (mDOMNodeRef) Field(arg1, 0); + tmp = Field(arg1, 0); + nr = (mDOMNodeRef) Field(tmp, 1); } CAMLreturn((value) nr); diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/Makefile b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/Makefile index 788db50a7..ffc2b4771 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/Makefile +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/Makefile @@ -1,7 +1,10 @@ LABLGTK_DIR = /usr/lib/ocaml/lablgtk LABLGTK_MATHVIEW_DIR = .. -OCAMLC = ocamlc -I $(LABLGTK_DIR) -I $(LABLGTK_MATHVIEW_DIR) -I mlmathview -OCAMLOPT = ocamlopt -I $(LABLGTK_DIR) -I $(LABLGTK_MATHVIEW_DIR) -I mlmathview +MINIDOM_DIR = ../minidom +OCAMLC = ocamlc -I $(LABLGTK_DIR) -I $(LABLGTK_MATHVIEW_DIR) \ + -I $(MINIDOM_DIR) -I mlmathview +OCAMLOPT = ocamlopt -I $(LABLGTK_DIR) -I $(LABLGTK_MATHVIEW_DIR) \ + -I $(MINIDOM_DIR) -I mlmathview all: test opt: test.opt @@ -9,6 +12,8 @@ opt: test.opt test: test.cmo $(OCAMLC) -custom -o test lablgtk.cma gtkInit.cmo \ $(LABLGTK_MATHVIEW_DIR)/lablgtkmathview.cma \ + $(MINIDOM_DIR)/minidom.cmo \ + -cclib "$(MINIDOM_DIR)/ml_minidom.o" \ test.cmo \ -cclib "-lstr -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk \ -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm \ @@ -18,6 +23,8 @@ test: test.cmo test.opt: test.cmx $(OCAMLOPT) -o test.opt lablgtk.cmxa gtkInit.cmx \ $(LABLGTK_MATHVIEW_DIR)/lablgtkmathview.cmxa \ + $(MINIDOM_DIR)/minidom.cmx \ + -cclib "$(MINIDOM_DIR)/ml_minidom.o" \ test.cmx \ -cclib "-lstr -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk \ -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm \ diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1lib.log b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1lib.log index d3fcd8ae6..e69de29bb 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1lib.log +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1lib.log @@ -1,3 +0,0 @@ -(W) T1_AAInit(): Unsupported AA specification: level=2, bpp=0 -(W) T1_AAInit(): Unsupported AA specification: level=2, bpp=0 -(W) T1_AAInit(): Unsupported AA specification: level=2, bpp=0 diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ml b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ml index 731acea33..aeb2a6010 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ml +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ml @@ -8,26 +8,53 @@ (* Callbacks *) let jump node = -(* - print_string ("jump: " ^ s ^ "\n") ; - flush stdout -*) () + let module M = Minidom in + print_string ("jump: " ^ + (match + M.node_get_attribute_ns node + (M.mDOMString_of_string "xlink") + (M.mDOMString_of_string "href") + with + None -> "DOES NOT WORKS (if you have clicked on the hyperlink)!!!!!" + | Some s -> M.string_of_mDOMString s + ) ^ "\n"); + print_string ("jump: " ^ + (match + M.node_get_attribute node + (M.mDOMString_of_string "href") + with + None -> "DOES NOT WORKS (if you have clicked on the hyperlink)!!!!!" + | Some s -> M.string_of_mDOMString s + ) ^ "\n"); + flush stdout ;; let selection_changed node = -(* - print_string ("jump: " ^ s ^ "\n") ; - flush stdout -*) () + let module M = Minidom in + print_string ("selection_changed: " ^ + (match + M.node_get_name node + with + None -> "selection_changed on nothing (???)" + | Some s -> "selection changed on " ^ M.string_of_mDOMString s + ) ^ "\n"); + flush stdout ;; + let clicked node = -(* - print_string "clicked: IT WORKS\n" ; - flush stdout -*) () + let module M = Minidom in + print_string ("clicked: " ^ + (match + M.node_get_name node + with + None -> "Nothing clicked (???)" + | Some s -> M.string_of_mDOMString s ^ " clicked" + ) ^ "\n"); + flush stdout ;; + let activate_t1 mathview sw () = sw#remove !mathview#coerce ; mathview := -- 2.39.2