distclean: clean
rm -f configure config.cache config.status config.log Makefile
+ cd $(TESTDIR); make distclean
include .depend
fi
AC_MSG_CHECKING(for the ocaml library dir)
-OCAML_ROOT=`ocamlc -v | grep "^Standard" | sed 's/^.*: *//'`
-AC_MSG_RESULT($OCAML_ROOT)
+OCAML_LIB_DIR=`ocamlc -v | grep "^Standard" | sed 's/^.*: *//'`
+AC_MSG_RESULT($OCAML_LIB_DIR)
-AC_CHECK_FILE($OCAML_ROOT/lablgtk/gtk.ml,
+AC_CHECK_FILE($OCAML_LIB_DIR/lablgtk/gtk.ml,
RES="yes"
- LABLGTK_LIB_DIR=$OCAML_ROOT/lablgtk,
+ LABLGTK_LIB_DIR=$OCAML_LIB_DIR/lablgtk,
RES="no"
)
if test $RES = "no"; then
RES=""
AC_CACHE_VAL(lablgtkmathview_cv_LABLGTK_LIB_DIR,
- echo "In which directory can I find the lablgtk library? (I haven't found it in the usual location $OCAML_ROOT/lablgtk)"
+ echo "In which directory can I find the lablgtk library? (I haven't found it in the usual location $OCAML_LIB_DIR/lablgtk)"
read lablgtkmathview_cv_LABLGTK_LIB_DIR
RES="Asked"
)
AC_CACHE_SAVE
fi
-AC_CHECK_FILE($OCAML_ROOT/mlminidom/minidom.mli,
+AC_CHECK_FILE($OCAML_LIB_DIR/mlminidom/minidom.mli,
RES="yes"
- MLMINIDOM_LIB_DIR=$OCAML_ROOT/mlminidom,
+ MLMINIDOM_LIB_DIR=$OCAML_LIB_DIR/mlminidom,
RES="no"
)
if test $RES = "no"; then
RES=""
AC_CACHE_VAL(lablgtkmathview_cv_MLMINIDOM_LIB_DIR,
- echo "In which directory can I find the mlminidom library? (I haven't found it in the usual location $OCAML_ROOT/mlminidom)"
+ echo "In which directory can I find the mlminidom library? (I haven't found it in the usual location $OCAML_LIB_DIR/mlminidom)"
read lablgtkmathview_cv_MLMINIDOM_LIB_DIR
RES="Asked"
)
fi
AC_SUBST(LABLGTKMATHVIEW_VERSION)
-AC_SUBST(OCAML_ROOT)
+AC_SUBST(OCAML_LIB_DIR)
AC_SUBST(LABLGTK_LIB_DIR)
AC_SUBST(MLMINIDOM_LIB_DIR)
-AC_OUTPUT([Makefile])
+AC_OUTPUT([
+ Makefile
+ test/Makefile
+])
* For details, send a mail to the author.
*)
-open Gaux
+(*open Gaux*)
open Gtk
open Gtk_mathview
open GtkBase
open GtkMathView
open GObj
+open Misc
exception ErrorLoadingFile of string;;
exception ErrorWritingFile of string;;
method get_hadjustment = new GData.adjustment (MathView.get_hadjustment obj)
method get_vadjustment = new GData.adjustment (MathView.get_vadjustment obj)
method get_buffer = MathView.get_buffer obj
- method get_frame = new GBin.frame (MathView.get_frame obj)
+ method get_frame = new GFrame.frame (MathView.get_frame obj)
method set_font_size = MathView.set_font_size obj
method get_font_size = MathView.get_font_size obj
method set_anti_aliasing = MathView.set_anti_aliasing obj
open Gtk_mathview
open Tags
open GtkBase
-open Gpointer
+open Misc
-external mDOMNode_of_boxed_option :
- Gpointer.boxed option -> Minidom.mDOMNode =
- "ml_gtk_math_view_mDOMNode_of_bodex_option"
+external mDOMNode_of_boxed :
+ Misc.pointer -> Minidom.mDOMNode =
+ "ml_gtk_math_view_mDOMNode_of_boxed"
-external mDOMNode_option_of_boxed_option :
- Gpointer.boxed option -> Minidom.mDOMNode option =
- "ml_gtk_math_view_mDOMNode_option_of_bodex_option"
+external mDOMNode_option_of_boxed :
+ Misc.pointer -> Minidom.mDOMNode option =
+ "ml_gtk_math_view_mDOMNode_option_of_boxed"
let o_mDOMNode_of_mDOMNode node = new Ominidom.o_mDOMNode node
open GtkSignal
let clicked : ([>`math_view],_) t =
- let marshal_clicked f _ =
- function
- [GtkArgv.POINTER node] -> f (o_mDOMNode_of_mDOMNode (mDOMNode_of_boxed_option node))
+ let marshal_clicked f argv =
+ match GtkArgv.get_pointer argv ~pos:0 with
+ Some p -> f (o_mDOMNode_of_mDOMNode (mDOMNode_of_boxed (Obj.magic p)))
| _ -> invalid_arg "GtkMathView.MathView.Signals.marshal_clicked"
in
{ name = "clicked"; marshaller = marshal_clicked }
let jump : ([>`math_view],_) t =
- let marshal_jump f _ =
- function
- [GtkArgv.POINTER node] -> f (o_mDOMNode_of_mDOMNode (mDOMNode_of_boxed_option node))
+ let marshal_jump f argv =
+ match GtkArgv.get_pointer argv ~pos:0 with
+ Some p -> f (o_mDOMNode_of_mDOMNode (mDOMNode_of_boxed (Obj.magic p)))
| _ -> invalid_arg "GtkMathView.MathView.Signals.marshal_jump"
in
{ name = "jump"; marshaller = marshal_jump }
let selection_changed : ([>`math_view],_) t =
- let marshal_selection_changed f _ =
- function
- [GtkArgv.POINTER node] -> f (o_mDOMNode_option_of_mDOMNode_option (mDOMNode_option_of_boxed_option node))
- | _ -> invalid_arg "GtkMathView.MathView.Signals.marshal_selection_changed"
+ let marshal_selection_changed f argv =
+ match GtkArgv.get_pointer argv ~pos:0 with
+ Some p ->f (o_mDOMNode_option_of_mDOMNode_option (mDOMNode_option_of_boxed (Obj.magic p)))
+ | None -> f None
in
{ name = "selection_changed"; marshaller = marshal_selection_changed }
end
#include <caml/callback.h>
#include <caml/fail.h>
-#include <gtkmathview/gtkmathview.h>
+#include <gtkmathview.h>
#include <ml_gtk.h>
#include <wrappers.h>
#include <gtk_tags.h>
#include <minidom.h>
-#include "minidom/ml_minidom.h"
+#include "mlminidom/ml_minidom.h"
/* <CSC/>: Next row should be put in a .h of lablgtk. */
#define GtkAdjustment_val(val) check_cast(GTK_ADJUSTMENT,val)
+/* <LUCA/>: Next rows too */
+
+extern value Val_GtkObject_sink();
+
+#define Val_GtkAny(w) Val_GtkObject((GtkObject*)w)
+#define Val_GtkAny_sink(w) Val_GtkObject_sink((GtkObject*)w)
+#define Val_GtkWidget Val_GtkAny
+#define Val_GtkWidget_sink Val_GtkAny_sink
#define GtkMathView_val(val) check_cast(GTK_MATH_VIEW,val)
CAMLreturn (result);
}
-
-value ml_gtk_math_view_mDOMNode_of_bodex_option (value arg1)
+value ml_gtk_math_view_mDOMNode_of_boxed (value arg1)
{
CAMLparam1(arg1);
mDOMNodeRef nr;
- CAMLlocal1 (tmp);
CAMLlocal1 (optval);
CAMLlocal1 (res);
- if (arg1==Val_int(0)) {
- assert(0);
- } else {
- tmp = Field(arg1, 0);
- nr = (mDOMNodeRef) Field(tmp, 1);
- }
+ nr = (mDOMNodeRef) Field(arg1, 1);
optval = Val_mDOMNodeRef(nr);
if (optval==Val_int(0)) {
assert(0);
CAMLreturn(res);
}
-value ml_gtk_math_view_mDOMNode_option_of_bodex_option (value arg1)
+value ml_gtk_math_view_mDOMNode_option_of_boxed (value arg1)
{
CAMLparam1(arg1);
mDOMNodeRef nr;
- CAMLlocal1 (tmp);
- if (arg1==Val_int(0)) {
- nr=NULL;
- } else {
- tmp = Field(arg1, 0);
- nr = (mDOMNodeRef) Field(tmp, 1);
- }
+ nr = (mDOMNodeRef) Field(arg1, 1);
- CAMLreturn(Val_mDOMNodeRef(nr));
+ CAMLreturn(Val_mDOMNodeRef(nr));
}
(* Widget creation *)
let main_window = GWindow.window ~title:"GtkMathView test" () in
let vbox = GPack.vbox ~packing:main_window#add () in
-let sw = GBin.scrolled_window ~width:50 ~height:50 ~packing:vbox#pack () in
+let sw = GFrame.scrolled_window ~width:50 ~height:50 ~packing:vbox#pack () in
let mathview= GMathView.math_view ~packing:sw#add ~width:50 ~height:50 () in
let table = GPack.table ~rows:6 ~columns:5 ~packing:vbox#pack () in
let button_gtk=GButton.button ~label:"activate Gtk fonts" ~packing:(table#attach ~left:0 ~top:0) () in