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
(* 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
;;
<!ENTITY int "∫">
]>
-<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>∫</m:mo>
<m:mo>⁡</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>⁢</m:mo>
<m:mi>x</m:mi>