]> matita.cs.unibo.it Git - helm.git/commitdiff
* removed *-config script invocations, now using pkg-config
authorLuca Padovani <luca.padovani@unito.it>
Thu, 19 Jun 2003 13:11:30 +0000 (13:11 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Thu, 19 Jun 2003 13:11:30 +0000 (13:11 +0000)
helm/DEVEL/lablgtkmathview/Makefile.in
helm/DEVEL/lablgtkmathview/configure.in
helm/DEVEL/lablgtkmathview/test/test.ml
helm/DEVEL/lablgtkmathview/test/test.xml

index ab9224ae8a39e868ed5bd71d24571c544476d737..da6e3ce0dba394445f2679f6f8b18b45366c01ae 100644 (file)
@@ -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
index c1f6be6c9265701d2be127b80dde40db5b96a334..dd11f14e115ea80c204508dd12ed12907fa22580 100644 (file)
@@ -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
index ca9abd84bbab42645173c0b57e0a0347c5874fdf..936f962b596016dbbb8941c459e5b11a2c0395f4 100644 (file)
 (*                             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
 ;;
 
index 97506d16d0287018d544de90152751d386ba6ac1..a29bcdac0b271abffe96c26c7649aaddba9ce3eb 100644 (file)
@@ -6,7 +6,7 @@
  <!ENTITY int "&#x0222B;">
 ]>
 
-<m:math display="block" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<m:math display="block" xmlns:helm="http://www.cs.unibo.it/helm" xmlns:m="http://www.w3.org/1998/Math/MathML">
   <m:mrow helm:xref="SELECTION OK">
     <m:mo>&int;</m:mo>
     <m:mo>&ApplyFunction;</m:mo>
        </m:mrow>
       </m:maction>
       <m:mrow>
-        <m:msup>
+        <m:msup helm:xref="A">
          <m:mi>x</m:mi>
          <m:mn>2</m:mn>
        </m:msup>
        <m:mo>+</m:mo>
-       <m:mrow>
+       <m:mrow helm:xref="B">
          <m:mi>p</m:mi>
          <m:mo>&InvisibleTimes;</m:mo>
          <m:mi>x</m:mi>