From d5a9a41d9db0f0a046c5c2f9f2130f61aab0097e Mon Sep 17 00:00:00 2001 From: Luca Padovani Date: Thu, 19 Jun 2003 13:11:30 +0000 Subject: [PATCH] * removed *-config script invocations, now using pkg-config --- helm/DEVEL/lablgtkmathview/Makefile.in | 4 +- helm/DEVEL/lablgtkmathview/configure.in | 11 ++++-- helm/DEVEL/lablgtkmathview/test/test.ml | 49 +++++++++++++++++++++++- helm/DEVEL/lablgtkmathview/test/test.xml | 6 +-- 4 files changed, 60 insertions(+), 10 deletions(-) diff --git a/helm/DEVEL/lablgtkmathview/Makefile.in b/helm/DEVEL/lablgtkmathview/Makefile.in index ab9224ae8..da6e3ce0d 100644 --- a/helm/DEVEL/lablgtkmathview/Makefile.in +++ b/helm/DEVEL/lablgtkmathview/Makefile.in @@ -18,8 +18,8 @@ DOC_FILES = AUTHORS COPYING ChangeLog NEWS README LICENSE REQUIRES = gdome2 lablgtk PREDICATES = SHARED_LIBS = \ - `gdome-config --libs` \ - $(shell gtkmathview-config --libs | sed 's/-rdynamic//g') \ + $(GDOME_LIBS) \ + $(shell $(GTKMATHVIEW_LIBS) | sed 's/-rdynamic//g') \ -lmlgdome OCAMLFIND = ocamlfind diff --git a/helm/DEVEL/lablgtkmathview/configure.in b/helm/DEVEL/lablgtkmathview/configure.in index c1f6be6c9..dd11f14e1 100644 --- a/helm/DEVEL/lablgtkmathview/configure.in +++ b/helm/DEVEL/lablgtkmathview/configure.in @@ -8,10 +8,13 @@ LABLGTKMATHVIEW_MICRO_VERSION=3 LABLGTKMATHVIEW_VERSION=$LABLGTKMATHVIEW_MAJOR_VERSION.$LABLGTKMATHVIEW_MINOR_VERSION.$LABLGTKMATHVIEW_MICRO_VERSION VERSION=$LABLGTKMATHVIEW_VERSION -AC_CHECK_PROG(HAVE_GTKMATHVIEW, gtkmathview-config, yes, no) -if test $HAVE_GTKMATHVIEW = "no"; then - AC_MSG_ERROR(could not find gtkmathview configuration script, please make sure gtkmathview is installed) -fi +PKG_CHECK_MODULES(GDOME, gdome2 >= 0.7.0,, AC_MSG_ERROR(could not find Gdome2)) +AC_SUBST(GDOME_CFLAGS) +AC_SUBST(GDOME_LIBS) + +PKG_CHECK_MODULES(GTKMATHVIEW, gtkmathview,, AC_MSG_ERROR(could not find gtkmathview)) +AC_SUBST(GTKMATHVIEW_CFLAGS) +AC_SUBST(GTKMATHVIEW_LIBS) AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no) if test $HAVE_OCAMLC = "no"; then diff --git a/helm/DEVEL/lablgtkmathview/test/test.ml b/helm/DEVEL/lablgtkmathview/test/test.ml index ca9abd84b..936f962b5 100644 --- a/helm/DEVEL/lablgtkmathview/test/test.ml +++ b/helm/DEVEL/lablgtkmathview/test/test.ml @@ -29,15 +29,62 @@ (* MathView widget *) (******************************************************************************) +let helmns = Gdome.domString "http://www.cs.unibo.it/helm";; + +(* +let choose_selection mmlwidget (element : Gdome.element option) = + let module G = Gdome in + let rec aux element = + if element#hasAttributeNS + ~namespaceURI:Misc.helmns + ~localName:(G.domString "xref") + then + mmlwidget#set_selection (Some element) + else + try + match element#get_parentNode with + None -> assert false + (*CSC: OCAML DIVERGES! + | Some p -> aux (new G.element_of_node p) + *) + | Some p -> aux (new Gdome.element_of_node p) + with + GdomeInit.DOMCastException _ -> + prerr_endline + "******* trying to select above the document root ********" + in + match element with + Some x -> aux x + | None -> mmlwidget#set_selection None +;; +*) + (* Callbacks *) let selection_changed mathview (element : Gdome.element option) = + let rec aux element = + if element#hasAttributeNS + ~namespaceURI:helmns + ~localName:(Gdome.domString "xref") + then + mathview#set_selection (Some element) + else + try + match element#get_parentNode with + None -> mathview#set_selection None + | Some p -> aux (new Gdome.element_of_node p) + with + GdomeInit.DOMCastException _ -> + prerr_endline "******* trying to select above the document root ********" + in print_endline ("selection_changed: " ^ (match element with None -> "selection_changed on nothing" | Some element -> element#get_tagName#to_string ) ) ; - mathview#set_selection element; + match element with + None -> () + | Some el -> aux el; flush stdout ;; diff --git a/helm/DEVEL/lablgtkmathview/test/test.xml b/helm/DEVEL/lablgtkmathview/test/test.xml index 97506d16d..a29bcdac0 100644 --- a/helm/DEVEL/lablgtkmathview/test/test.xml +++ b/helm/DEVEL/lablgtkmathview/test/test.xml @@ -6,7 +6,7 @@ ]> - + @@ -24,12 +24,12 @@ - + x 2 + - + p x -- 2.39.2