From 4b993948e0b13d53d00576f9d341fd2e2a4c9c14 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 7 Nov 2000 13:28:40 +0000 Subject: [PATCH] Fixing repository --- .../Makefile | 5 +- .../config.make | 2 +- .../configure.mk | 4 +- .../gMathView.ml | 28 +-- .../gtkMathView.ml | 63 ++---- .../ml_gtk_mathview.c | 55 +---- .../test/Makefile | 2 +- .../test/t1.config | 3 - .../test/t1lib.log | 3 - .../test/test.ml | 189 ++++-------------- .../test/test.ps | 0 11 files changed, 76 insertions(+), 278 deletions(-) delete mode 100644 helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/t1.config delete mode 100644 helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/t1lib.log delete mode 100644 helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/test.ps diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/Makefile b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/Makefile index 57a384903..1195de528 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/Makefile +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/Makefile @@ -1,8 +1,7 @@ # Makefile for lablgtk_mathview. -LABLGTKDIR = /usr/lib/ocaml/lablgtk -MINIDOMDIR = ./minidom -MLFLAGS += -I $(LABLGTKDIR) -I $(MINIDOMDIR) +LABLGTKDIR = /usr/local/lib/ocaml/lablgtk +MLFLAGS += -I $(LABLGTKDIR) TARGETS = ml_gtk_mathview.o lablgtkmathview.cma diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/config.make b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/config.make index d7e9241c5..d50ffb585 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/config.make +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/config.make @@ -9,7 +9,7 @@ RANLIB=ranlib LIBDIR=/usr/lib/ocaml BINDIR=/usr/bin INSTALLDIR=/usr/lib/ocaml/lablgtk/mathview -GTKCFLAGS=-I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/include/libxml -I/usr/include -I/usr/local/include/gtkmathview -I/usr/lib/ocaml/lablgtk +GTKCFLAGS=-I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/lib/ocaml/lablgtk GTKLIBS=-ccopt -L/usr/lib -ccopt -L/usr/X11R6/lib -cclib -lgtk -cclib -lgdk -ccopt -rdynamic -cclib -lgmodule -cclib -lglib -cclib -ldl -cclib -lXi -cclib -lXext -cclib -lX11 -cclib -lm GTKMATHVIEWLIBS=-ccopt -L/usr/local/lib/gtkmathview -cclib -lgtkmathview GNOMELIBS= diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/configure.mk b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/configure.mk index ec5f79995..73cfc3d35 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/configure.mk +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/configure.mk @@ -15,10 +15,10 @@ GETBINDIR = $(GETLIBDIR) | sed -e 's|/lib/[^/]*$$|/bin|' -e 's|/lib$$|/bin|' GETRANLIB = which ranlib 2>/dev/null | sed -e 's|.*/ranlib$$|!|' -e 's/^[^!]*$$/:/' -e 's/!/ranlib/' ifdef USE_GNOME -GTKGETCFLAGS = gtk-config --cflags`" -I"`gnome-config --includedir" "`xml-config --cflags`" "`gtkmathview-config --cflags +GTKGETCFLAGS = gtk-config --cflags`" -I"`gnome-config --includedir GNOMELIBS = `gnome-config --libs gtkxmhtml` else -GTKGETCFLAGS = gtk-config --cflags`" "`xml-config --cflags`" "`gtkmathview-config --cflags +GTKGETCFLAGS = gtk-config --cflags endif GTKGETLIBS = gtk-config --libs diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/gMathView.ml b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/gMathView.ml index 87f0d5035..b79c81244 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/gMathView.ml +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/gMathView.ml @@ -6,14 +6,11 @@ open GtkMathView open GObj exception ErrorLoadingFile of string;; -exception ErrorWritingFile of string;; class math_view_signals obj = object inherit GContainer.container_signals obj - method clicked = GtkSignal.connect ~sgn:MathView.Signals.clicked obj ~after method jump = GtkSignal.connect ~sgn:MathView.Signals.jump obj ~after - method selection_changed = - GtkSignal.connect ~sgn:MathView.Signals.selection_changed obj ~after + method clicked = GtkSignal.connect ~sgn:MathView.Signals.clicked obj ~after end class math_view obj = object @@ -21,13 +18,11 @@ class math_view obj = object method connect = new math_view_signals obj method load ~filename = if not (MathView.load obj ~filename) then raise (ErrorLoadingFile filename) - method unload = MathView.unload obj method get_selection = MathView.get_selection obj - method set_selection = MathView.set_selection obj + method unload = MathView.unload obj + method dump = MathView.dump obj method get_width = MathView.get_width obj method get_height = MathView.get_height obj - method get_top = MathView.get_top obj - method set_top = MathView.set_top obj method set_adjustments = fun adj1 adj2 -> MathView.set_adjustments obj (GData.as_adjustment adj1) @@ -37,26 +32,17 @@ class math_view obj = object method get_buffer = MathView.get_buffer obj method get_frame = new GBin.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 - method get_anti_aliasing = MathView.get_anti_aliasing obj - method set_kerning = MathView.set_kerning obj - method get_kerning = MathView.get_kerning obj - method set_log_verbosity = MathView.set_log_verbosity obj - method get_log_verbosity = MathView.get_log_verbosity obj - method export_to_postscript ~filename = - if not (MathView.export_to_postscript obj ~filename) then - raise (ErrorWritingFile filename) + (*method get_top = MathView.get_top obj + method set_top = MathView.set_top obj*) end -let math_view ?adjustmenth ?adjustmentv ?(use_t1_lib=false) ?border_width - ?width ?height ?packing ?show () +let math_view ?adjustmenth ?adjustmentv ?border_width ?width ?height + ?packing ?show () = let w = MathView.create ?adjustmenth:(may_map ~f:GData.as_adjustment adjustmenth) ?adjustmentv:(may_map ~f:GData.as_adjustment adjustmentv) - ?use_t1_lib () in Container.set w ?border_width ?width ?height; diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/gtkMathView.ml b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/gtkMathView.ml index 62cd5409d..9ed42b8b7 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/gtkMathView.ml +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/gtkMathView.ml @@ -4,33 +4,24 @@ open Tags open GtkBase open Gpointer -external mDOMNode_of_boxed_option : Gpointer.boxed option -> Minidom.mDOMNode = - "ml_gtk_math_view_mDOMNode_of_bodex_option" - module MathView = struct let cast w : math_view obj = Object.try_cast w "GtkMathView" - external create : Gtk.adjustment optobj -> Gtk.adjustment optobj -> bool -> + external create : Gtk.adjustment optobj -> Gtk.adjustment optobj -> math_view obj = "ml_gtk_math_view_new" - let create ~adjustmenth ~adjustmentv ~use_t1_lib () = - create (optboxed adjustmenth) (optboxed adjustmentv) use_t1_lib + let create ~adjustmenth ~adjustmentv () = + create (optboxed adjustmenth) (optboxed adjustmentv) external load : [>`math_view] obj -> filename:string -> bool = "ml_gtk_math_view_load" + external get_selection : [>`math_view] obj -> string option = + "ml_gtk_math_view_get_selection" external unload : [>`math_view] obj -> unit = "ml_gtk_math_view_unload" - (*external dump : [>`math_view] obj -> unit = - "ml_gtk_math_view_dump"*) - external get_selection : [>`math_view] obj -> Minidom.mDOMNode = - "ml_gtk_math_view_get_selection" - external set_selection : [>`math_view] obj -> Minidom.mDOMNode -> unit = - "ml_gtk_math_view_set_selection" + external dump : [>`math_view] obj -> unit = + "ml_gtk_math_view_dump" external get_width : [>`math_view] obj -> int = "ml_gtk_math_view_get_width" external get_height : [>`math_view] obj -> int = "ml_gtk_math_view_get_height" - external get_top : [>`math_view] obj -> (int * int) = - "ml_gtk_math_view_get_top" - external set_top : [>`math_view] obj -> int -> int -> unit = - "ml_gtk_math_view_set_top" external set_adjustments : [>`math_view] obj -> Gtk.adjustment obj -> Gtk.adjustment obj -> unit = "ml_gtk_math_view_set_adjustments" external get_hadjustment : [>`math_view] obj -> Gtk.adjustment obj = @@ -43,48 +34,28 @@ module MathView = struct "ml_gtk_math_view_get_frame" external set_font_size : [>`math_view] obj -> int -> unit = "ml_gtk_math_view_set_font_size" - external get_font_size : [>`math_view] obj -> int = - "ml_gtk_math_view_get_font_size" - external set_anti_aliasing : [>`math_view] obj -> bool -> unit = - "ml_gtk_math_view_set_anti_aliasing" - external get_anti_aliasing : [>`math_view] obj -> bool = - "ml_gtk_math_view_get_anti_aliasing" - external set_kerning : [>`math_view] obj -> bool -> unit = - "ml_gtk_math_view_set_kerning" - external get_kerning : [>`math_view] obj -> bool = - "ml_gtk_math_view_get_kerning" - external set_log_verbosity : [>`math_view] obj -> int -> unit = - "ml_gtk_math_view_set_log_verbosity" - external get_log_verbosity : [>`math_view] obj -> int = - "ml_gtk_math_view_get_log_verbosity" - external export_to_postscript : [>`math_view] obj -> filename:string -> bool = - "ml_gtk_math_view_export_to_postscript" + (*external get_top : [>`math_view] obj -> (int * int) = + "ml_gtk_math_view_get_top" + external set_top : [>`math_view] obj -> int -> int -> unit = + "ml_gtk_math_view_set_top"*) module Signals = struct open GtkSignal - let clicked : ([>`math_view],_) t = - let marshal_clicked f _ = - function - [GtkArgv.POINTER node] -> f (mDOMNode_of_boxed_option node) - | _ -> 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 (mDOMNode_of_boxed_option node) + [GtkArgv.STRING (Some str)] -> f str | _ -> invalid_arg "GtkMathView.MathView.Signals.marshal_jump" in { name = "jump"; marshaller = marshal_jump } - let selection_changed : ([>`math_view],_) t = - let marshal_selection_changed f _ = + let clicked : ([>`math_view],_) t = + let marshal_clicked f _ = function - [GtkArgv.POINTER node] -> f (mDOMNode_of_boxed_option node) - | _ -> invalid_arg "GtkMathView.MathView.Signals.marshal_selection_changed" + [] -> f () + | _ -> invalid_arg "GtkMathView.MathView.Signals.marshal_clicked" in - { name = "selection_changed"; marshaller = marshal_selection_changed } + { name = "clicked"; marshaller = marshal_clicked } end end diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/ml_gtk_mathview.c b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/ml_gtk_mathview.c index 3286f9054..b16f68e50 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/ml_gtk_mathview.c +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/ml_gtk_mathview.c @@ -15,54 +15,25 @@ #include #include -#include "minidom/ml_minidom.h" - /* : Next row should be put in a .h of lablgtk. */ #define GtkAdjustment_val(val) check_cast(GTK_ADJUSTMENT,val) #define GtkMathView_val(val) check_cast(GTK_MATH_VIEW,val) -ML_3 (gtk_math_view_new,GtkAdjustment_val, GtkAdjustment_val, Bool_val, Val_GtkWidget_sink) +ML_2 (gtk_math_view_new,GtkAdjustment_val, GtkAdjustment_val,Val_GtkWidget_sink) ML_2 (gtk_math_view_load, GtkMathView_val, String_val, Val_bool) ML_1 (gtk_math_view_unload, GtkMathView_val, Unit) -/*ML_1 (gtk_math_view_dump, GtkMathView_val, Unit)*/ -ML_1 (gtk_math_view_get_selection, GtkMathView_val, Val_ptr) -ML_2 (gtk_math_view_set_selection, GtkMathView_val, mDOMNode_val, Unit) +ML_1 (gtk_math_view_dump, GtkMathView_val, Unit) ML_1 (gtk_math_view_get_width, GtkMathView_val, Val_int) ML_1 (gtk_math_view_get_height, GtkMathView_val, Val_int) -ML_3 (gtk_math_view_set_top, GtkMathView_val, Int_val, Int_val, Unit) +//ML_3 (gtk_math_view_set_top, GtkMathView_val, Int_val, Int_val, Unit) ML_3 (gtk_math_view_set_adjustments, GtkMathView_val, GtkAdjustment_val, GtkAdjustment_val, Unit) ML_1 (gtk_math_view_get_hadjustment, GtkMathView_val, Val_GtkWidget) ML_1 (gtk_math_view_get_vadjustment, GtkMathView_val, Val_GtkWidget) ML_1 (gtk_math_view_get_buffer, GtkMathView_val, Val_GdkPixmap) ML_1 (gtk_math_view_get_frame, GtkMathView_val, Val_GtkWidget) ML_2 (gtk_math_view_set_font_size, GtkMathView_val, Int_val, Unit) -ML_1 (gtk_math_view_get_font_size, GtkMathView_val, Val_int) -ML_2 (gtk_math_view_set_anti_aliasing, GtkMathView_val, Bool_val, Unit) -ML_1 (gtk_math_view_get_anti_aliasing, GtkMathView_val, Val_bool) -ML_2 (gtk_math_view_set_kerning, GtkMathView_val, Bool_val, Unit) -ML_1 (gtk_math_view_get_kerning, GtkMathView_val, Val_bool) -ML_2 (gtk_math_view_set_log_verbosity, GtkMathView_val, Int_val, Unit) -ML_1 (gtk_math_view_get_log_verbosity, GtkMathView_val, Val_int) - - -value ml_gtk_math_view_export_to_postscript (value arg1, value arg2) -{ - CAMLparam1(arg1); - char *filename; - FILE *fd; - int res; - filename = String_val (arg2); - if ((fd = fopen(filename, "w"))) { - gtk_math_view_export_to_postscript (GtkMathView_val (arg1), fd); - fclose (fd); - res = 1; - } else { - fprintf(stderr, "Error opening file %s for writing\n", filename); - res = 0; - } - CAMLreturn (Val_bool(res)); -} +/* value ml_gtk_math_view_get_top (value arg1) { CAMLparam1(arg1); @@ -74,19 +45,11 @@ value ml_gtk_math_view_get_top (value arg1) Store_field(result, 0, Val_int(y)); CAMLreturn (result); } +*/ - -value ml_gtk_math_view_mDOMNode_of_bodex_option (value arg1) +value ml_gtk_math_view_get_selection (value arg1) { - CAMLparam1(arg1); - - mDOMNodeRef nr; - - if (arg1==Val_int(0)) { - nr = NULL; - } else { - nr = (mDOMNodeRef) Field(arg1, 0); - } - - CAMLreturn((value) nr); + const char *stringa; + stringa = gtk_math_view_get_selection (GtkMathView_val (arg1)); + return Val_option (stringa, Val_string); } diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/Makefile b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/Makefile index 788db50a7..cc5bd50f5 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/Makefile +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/Makefile @@ -1,4 +1,4 @@ -LABLGTK_DIR = /usr/lib/ocaml/lablgtk +LABLGTK_DIR = ../../lablgtk-20000829 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 diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/t1.config b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/t1.config deleted file mode 100644 index afb669e95..000000000 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/t1.config +++ /dev/null @@ -1,3 +0,0 @@ -ENCODING=. -AFM=/usr/share/texmf/fonts/afm/ -TYPE1=/usr/share/texmf/fonts/type1/bluesky/cm/:/usr/X11R6/lib/X11/fonts/Type1/:. diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/t1lib.log b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/t1lib.log deleted file mode 100644 index d3fcd8ae6..000000000 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/t1lib.log +++ /dev/null @@ -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.1.0/test/test.ml b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/test.ml index 731acea33..e914f4d6b 100644 --- a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/test.ml +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/test.ml @@ -7,101 +7,59 @@ (******************************************************************************) (* Callbacks *) -let jump node = -(* +let jump s = print_string ("jump: " ^ s ^ "\n") ; flush stdout -*) () ;; -let selection_changed node = -(* - print_string ("jump: " ^ s ^ "\n") ; - flush stdout -*) () -;; - -let clicked node = -(* +let clicked () = print_string "clicked: IT WORKS\n" ; flush stdout -*) () -;; - -let activate_t1 mathview sw () = - sw#remove !mathview#coerce ; - mathview := - (GMathView.math_view ~packing:sw#add ~width:50 ~height:50 - ~use_t1_lib:true ()) ; - ignore(!mathview#connect#jump jump) ; - ignore(!mathview#connect#clicked clicked) ; - ignore(!mathview#connect#selection_changed selection_changed) ; - print_string "WIDGET RECREATED WITH T1 FONTS ACTIVATED\n" ; ;; let load mathview () = - !mathview#load "test.xml" ; + mathview#load "test.xml" ; print_string "load: SEEMS TO WORK\n" ; flush stdout ;; exception Ok;; let get_selection mathview () = -(* - let selection = - match !mathview#get_selection with - None -> "NO SELECTION" - | Some s -> s - in - print_string ("get_selection: " ^ selection ^ "\n") ; - flush stdout -*) () -;; - -let set_selection mathview () = -(* let selection = - match !mathview#get_selection with + match mathview#get_selection with None -> "NO SELECTION" | Some s -> s in print_string ("get_selection: " ^ selection ^ "\n") ; flush stdout -*) () ;; let unload mathview () = - !mathview#unload ; + mathview#unload ; print_string "unload: SEEMS TO WORK\n" ; flush stdout ;; -let get_width mathview () = - print_string ("get_width: " ^ string_of_int (!mathview#get_width) ^ "\n") ; +let dump mathview () = + mathview#dump ; + print_string "dump: SEEMS TO WORK\n" ; flush stdout ;; -let get_height mathview () = - print_string ("get_height: " ^ string_of_int (!mathview#get_height) ^ "\n") ; +let get_width mathview () = + print_string ("get_width: " ^ string_of_int (mathview#get_width) ^ "\n") ; flush stdout ;; -let get_top mathview () = - let (x,y) = !mathview#get_top in - print_string ("get_top: ("^ string_of_int x ^ "," ^ string_of_int y ^ ")\n") ; - flush stdout -;; - -let set_top mathview () = - !mathview#set_top 0 0; - print_string "set_top: SEEM TO WORK\n" ; +let get_height mathview () = + print_string ("get_height: " ^ string_of_int (mathview#get_height) ^ "\n") ; flush stdout ;; let set_adjustments mathview () = let adj1 = GData.adjustment () in let adj2 = GData.adjustment () in - !mathview#set_adjustments adj1 adj2 ; + mathview#set_adjustments adj1 adj2 ; adj1#set_value ((adj1#lower +. adj1#upper) /. 2.0) ; adj2#set_value ((adj2#lower +. adj2#upper) /. 2.0) ; print_string "set_adjustments: SEEM TO WORK\n" ; @@ -109,21 +67,21 @@ let set_adjustments mathview () = ;; let get_hadjustment mathview () = - let adj = !mathview#get_hadjustment in + let adj = mathview#get_hadjustment in adj#set_value ((adj#lower +. adj#upper) /. 2.0) ; print_string "get_hadjustment: SEEM TO WORK\n" ; flush stdout ;; let get_vadjustment mathview () = - let adj = !mathview#get_vadjustment in + let adj = mathview#get_vadjustment in adj#set_value ((adj#lower +. adj#upper) /. 2.0) ; print_string "get_vadjustment: SEEM TO WORK\n" ; flush stdout ;; let get_buffer mathview () = - let buffer = !mathview#get_buffer in + let buffer = mathview#get_buffer in Gdk.Draw.rectangle buffer (Gdk.GC.create buffer) ~x:0 ~y:0 ~width:50 ~height:50 ~filled:true () ; print_string "get_buffer: SEEMS TO WORK (hint: force the widget redrawing)\n"; @@ -131,125 +89,52 @@ let get_buffer mathview () = ;; let get_frame mathview () = - let frame = !mathview#get_frame in + let frame = mathview#get_frame in frame#set_shadow_type `NONE ; print_string "get_frame: SEEMS TO WORK\n" ; flush stdout ;; let set_font_size mathview () = - !mathview#set_font_size 24 ; + mathview#set_font_size 24 ; print_string "set_font_size: FONT IS NOW 24\n" ; flush stdout ;; -let get_font_size mathview () = - print_string ("get_font_size: " ^ string_of_int (!mathview#get_font_size) ^ "\n") ; - flush stdout -;; - -let set_anti_aliasing mathview () = - !mathview#set_anti_aliasing true ; - print_string "set_anti_aliasing: ON\n" ; - flush stdout -;; - -let get_anti_aliasing mathview () = - print_string ("get_anti_aliasing: " ^ - (match !mathview#get_anti_aliasing with true -> "ON" | false -> "OFF") ^ - "\n") ; - flush stdout -;; - -let set_kerning mathview () = - !mathview#set_kerning true ; - print_string "set_kerning: ON\n" ; - flush stdout -;; - -let get_kerning mathview () = - print_string ("get_kerning: " ^ - (match !mathview#get_kerning with true -> "ON" | false -> "OFF") ^ - "\n") ; - flush stdout -;; - -let set_log_verbosity mathview () = - !mathview#set_log_verbosity 3 ; - print_string "set_log_verbosity: NOW IS 3\n" ; - flush stdout -;; - -let get_log_verbosity mathview () = - print_string ("get_log_verbosity: " ^ - string_of_int !mathview#get_log_verbosity ^ - "\n") ; - flush stdout -;; - -let export_to_postscript mathview () = - !mathview#export_to_postscript "test.ps" ; - print_string "expor_to_postscript: SEEMS TO WORK (hint: look at test.ps)\n"; - flush stdout -;; - (* 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 mathview= ref (GMathView.math_view ~packing:sw#add ~width:50 ~height:50 ()) in -(*let hbox = GPack.hbox ~packing:vbox#pack () in*) -let table = GPack.table ~rows:5 ~columns:5 ~packing:vbox#pack () in -let button_t1=GButton.button ~label:"activate t1 fonts" ~packing:(table#attach ~left:0 ~top:0) () in -let button_load = GButton.button ~label:"load" ~packing:(table#attach ~left:1 ~top:0) () in -let button_unload = GButton.button ~label:"unload" ~packing:(table#attach ~left:2 ~top:0) () in -let button_get_selection = GButton.button ~label:"get_selection" ~packing:(table#attach ~left:3 ~top:0) () in -let button_set_selection = GButton.button ~label:"set_selection" ~packing:(table#attach ~left:4 ~top:0) () in -let button_get_width = GButton.button ~label:"get_width" ~packing:(table#attach ~left:0 ~top:1) () in -let button_get_height = GButton.button ~label:"get_height" ~packing:(table#attach ~left:1 ~top:1) () in -let button_get_top = GButton.button ~label:"get_top" ~packing:(table#attach ~left:2 ~top:1) () in -let button_set_top = GButton.button ~label:"set_top" ~packing:(table#attach ~left:3 ~top:1) () in -let button_set_adjustments = GButton.button ~label:"set_adjustments" ~packing:(table#attach ~left:4 ~top:1) () in -let button_get_hadjustment = GButton.button ~label:"get_hadjustment" ~packing:(table#attach ~left:0 ~top:2) () in -let button_get_vadjustment = GButton.button ~label:"get_vadjustment" ~packing:(table#attach ~left:1 ~top:2) () in -let button_get_buffer = GButton.button ~label:"get_buffer" ~packing:(table#attach ~left:2 ~top:2) () in -let button_get_frame = GButton.button ~label:"get_frame" ~packing:(table#attach ~left:3 ~top:2) () in -let button_set_font_size = GButton.button ~label:"set_font_size" ~packing:(table#attach ~left:4 ~top:2) () in -let button_get_font_size = GButton.button ~label:"get_font_size" ~packing:(table#attach ~left:0 ~top:3) () in -let button_set_anti_aliasing = GButton.button ~label:"set_anti_aliasing" ~packing:(table#attach ~left:1 ~top:3) () in -let button_get_anti_aliasing = GButton.button ~label:"get_anti_aliasing" ~packing:(table#attach ~left:2 ~top:3) () in -let button_set_kerning = GButton.button ~label:"set_kerning" ~packing:(table#attach ~left:3 ~top:3) () in -let button_get_kerning = GButton.button ~label:"get_kerning" ~packing:(table#attach ~left:4 ~top:3) () in -let button_set_log_verbosity = GButton.button ~label:"set_log_verbosity" ~packing:(table#attach ~left:0 ~top:4) () in -let button_get_log_verbosity = GButton.button ~label:"get_log_verbosity" ~packing:(table#attach ~left:1 ~top:4) () in -let button_export_to_postscript = GButton.button ~label:"export_to_postscript" ~packing:(table#attach ~left:2 ~top:4) () in +(*let mathview = GMathView.math_view ~packing:sw#add_with_viewport ~width:50 ~height:50 () in*) +let mathview = GMathView.math_view ~packing:sw#add ~width:50 ~height:50 () in +let hbox = GPack.hbox ~packing:vbox#pack () in +let button_load = GButton.button ~label:"load" ~packing:hbox#pack () in +let button_get_selection = GButton.button ~label:"get_selection" ~packing:hbox#pack () in +let button_unload = GButton.button ~label:"unload" ~packing:hbox#pack () in +let button_dump = GButton.button ~label:"dump" ~packing:hbox#pack () in +let button_get_width = GButton.button ~label:"get_width" ~packing:hbox#pack () in +let button_get_height = GButton.button ~label:"get_height" ~packing:hbox#pack () in +let button_set_adjustments = GButton.button ~label:"set_adjustments" ~packing:hbox#pack () in +let button_get_hadjustment = GButton.button ~label:"get_hadjustment" ~packing:hbox#pack () in +let button_get_vadjustment = GButton.button ~label:"get_vadjustment" ~packing:hbox#pack () in +let button_get_buffer = GButton.button ~label:"get_buffer" ~packing:hbox#pack () in +let button_get_frame = GButton.button ~label:"get_frame" ~packing:hbox#pack () in +let button_set_font_size = GButton.button ~label:"set_font_size" ~packing:hbox#pack () in (* Signals connection *) -ignore(button_t1#connect#clicked (activate_t1 mathview sw)) ; ignore(button_load#connect#clicked (load mathview)) ; -ignore(button_unload#connect#clicked (unload mathview)) ; ignore(button_get_selection#connect#clicked (get_selection mathview)) ; -ignore(button_set_selection#connect#clicked (set_selection mathview)) ; +ignore(button_unload#connect#clicked (unload mathview)) ; +ignore(button_dump#connect#clicked (dump mathview)) ; ignore(button_get_width#connect#clicked (get_width mathview)) ; ignore(button_get_height#connect#clicked (get_height mathview)) ; -ignore(button_get_top#connect#clicked (get_top mathview)) ; -ignore(button_set_top#connect#clicked (set_top mathview)) ; ignore(button_set_adjustments#connect#clicked (set_adjustments mathview)) ; ignore(button_get_hadjustment#connect#clicked (get_hadjustment mathview)) ; ignore(button_get_vadjustment#connect#clicked (get_vadjustment mathview)) ; ignore(button_get_buffer#connect#clicked (get_buffer mathview)) ; ignore(button_get_frame#connect#clicked (get_frame mathview)) ; ignore(button_set_font_size#connect#clicked (set_font_size mathview)) ; -ignore(button_get_font_size#connect#clicked (get_font_size mathview)) ; -ignore(button_set_anti_aliasing#connect#clicked (set_anti_aliasing mathview)) ; -ignore(button_get_anti_aliasing#connect#clicked (get_anti_aliasing mathview)) ; -ignore(button_set_kerning#connect#clicked (set_kerning mathview)) ; -ignore(button_get_kerning#connect#clicked (get_kerning mathview)) ; -ignore(button_set_log_verbosity#connect#clicked (set_log_verbosity mathview)) ; -ignore(button_get_log_verbosity#connect#clicked (get_log_verbosity mathview)) ; -ignore(button_export_to_postscript#connect#clicked (export_to_postscript mathview)) ; -ignore(!mathview#connect#jump jump) ; -ignore(!mathview#connect#clicked clicked) ; -ignore(!mathview#connect#selection_changed selection_changed) ; +ignore(mathview#connect#jump jump) ; +ignore(mathview#connect#clicked clicked) ; (* Main Loop *) main_window#show () ; GMain.Main.main () diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/test.ps b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.1.0/test/test.ps deleted file mode 100644 index e69de29bb..000000000 -- 2.39.2