From 5a19cfcbebeb144bce8a9c397788641239fde570 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 7 Nov 2000 13:03:22 +0000 Subject: [PATCH] Fixing repository --- .../test/Makefile | 36 +++ .../test/t1.config | 3 + .../test/t1lib.log | 3 + .../test/test.ml | 256 ++++++++++++++++++ .../test/test.ps | 0 .../test/test.xml | 123 +++++++++ 6 files changed, 421 insertions(+) create mode 100644 helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/Makefile create mode 100644 helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1.config create mode 100644 helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1lib.log create mode 100644 helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ml create mode 100644 helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ps create mode 100644 helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.xml diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/Makefile b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/Makefile new file mode 100644 index 000000000..788db50a7 --- /dev/null +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/Makefile @@ -0,0 +1,36 @@ +LABLGTK_DIR = /usr/lib/ocaml/lablgtk +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 + +all: test +opt: test.opt + +test: test.cmo + $(OCAMLC) -custom -o test lablgtk.cma gtkInit.cmo \ + $(LABLGTK_MATHVIEW_DIR)/lablgtkmathview.cma \ + test.cmo \ + -cclib "-lstr -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk \ + -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm \ + -L/usr/local/lib/gtkmathview -lgtkmathview \ + $(LABLGTK_MATHVIEW_DIR)/ml_gtk_mathview.o" + +test.opt: test.cmx + $(OCAMLOPT) -o test.opt lablgtk.cmxa gtkInit.cmx \ + $(LABLGTK_MATHVIEW_DIR)/lablgtkmathview.cmxa \ + test.cmx \ + -cclib "-lstr -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk \ + -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm \ + -L/usr/local/lib/gtkmathview -lgtkmathview \ + $(LABLGTK_MATHVIEW_DIR)/ml_gtk_mathview.o" + +.SUFFIXES: .ml .mli .cmo .cmi .cmx +.ml.cmo: + $(OCAMLC) -c $< +.mli.cmi: + $(OCAMLC) -c $< +.ml.cmx: + $(OCAMLOPT) -c $< + +clean: + rm -f *.cm[iox] *.o test test.opt diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1.config b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1.config new file mode 100644 index 000000000..afb669e95 --- /dev/null +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1.config @@ -0,0 +1,3 @@ +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.2.0/test/t1lib.log b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1lib.log new file mode 100644 index 000000000..d3fcd8ae6 --- /dev/null +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/t1lib.log @@ -0,0 +1,3 @@ +(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.2.0/test/test.ml b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ml new file mode 100644 index 000000000..731acea33 --- /dev/null +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ml @@ -0,0 +1,256 @@ +(******************************************************************************) +(* Claudio Sacerdoti Coen *) +(* 25/09/2000 *) +(* *) +(* This is a simple test for the OCaml (LablGtk indeed) binding of the *) +(* MathView widget *) +(******************************************************************************) + +(* Callbacks *) +let jump node = +(* + print_string ("jump: " ^ s ^ "\n") ; + flush stdout +*) () +;; + +let selection_changed node = +(* + print_string ("jump: " ^ s ^ "\n") ; + flush stdout +*) () +;; + +let clicked node = +(* + 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" ; + 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 + None -> "NO SELECTION" + | Some s -> s + in + print_string ("get_selection: " ^ selection ^ "\n") ; + flush stdout +*) () +;; + +let unload mathview () = + !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") ; + flush stdout +;; + +let get_height mathview () = + print_string ("get_height: " ^ string_of_int (!mathview#get_height) ^ "\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" ; + flush stdout +;; + +let set_adjustments mathview () = + let adj1 = GData.adjustment () in + let adj2 = GData.adjustment () in + !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" ; + flush stdout +;; + +let get_hadjustment mathview () = + 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 + 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 + 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"; + flush stdout +;; + +let get_frame mathview () = + 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 ; + 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 +(* 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_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) ; +(* Main Loop *) +main_window#show () ; +GMain.Main.main () +;; diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ps b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ps new file mode 100644 index 000000000..e69de29bb diff --git a/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.xml b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.xml new file mode 100644 index 000000000..b0f8c1563 --- /dev/null +++ b/helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.xml @@ -0,0 +1,123 @@ + + + + + + + + a + + x + + + + b + + + + x + 2 + + + + + p + + x + + + + q + + + + d + x + = + + + a2 + + + ln + + + ( + + x2 + + + + p + + x + + + + q + + ) + + + + + + + + + + 2 + + b + + - + + a + + p + + + + + + 4 + + q + + - + + p + 2 + + + + + + + arctg + + + + + 2 + + x + + + + p + + + + + 4 + + q + + - + + p + 2 + + + + + + + + + c + + -- 2.39.2