exception ErrorLoadingFile of string;;
exception ErrorWritingFile of string;;
+exception ErrorLoadingDOM;;
exception NoSelection;;
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 =
+ let module S = GtkSignal in
+ let new_clicked =
+ let new_marshaller f x y =
+ MathView.Signals.clicked.S.marshaller
+ (fun e -> f (new Gdome.element e)) x y
+ in
+ { S.name = "clicked"; S.classe = `math_view;
+ S.marshaller = new_marshaller }
+ in
+ GtkSignal.connect ~sgn:new_clicked obj ~after
+ method press_move =
+ let module S = GtkSignal in
+ let new_press_move =
+ let new_marshaller f x y =
+ MathView.Signals.press_move.S.marshaller
+ (fun x y ->
+ let option_element_of_option v =
+ match v with
+ None -> None
+ | Some v' -> Some (new Gdome.element v')
+ in
+ f (option_element_of_option x) (option_element_of_option y)) x y
+ in
+ { S.name = "press_move"; S.classe = `math_view;
+ S.marshaller = new_marshaller }
+ in
+ GtkSignal.connect ~sgn:new_press_move obj ~after
+ method element_changed =
+ let module S = GtkSignal in
+ let new_element_changed =
+ let new_marshaller f x y =
+ MathView.Signals.element_changed.S.marshaller
+ (function None -> f None | Some e -> f (Some (new Gdome.element e))) x y
+ in
+ { S.name = "element_changed"; S.classe = `math_view;
+ S.marshaller = new_marshaller }
+ in
+ GtkSignal.connect ~sgn:new_element_changed obj ~after
end
-class math_view obj = object
+class math_view_skel obj = object
inherit GContainer.container (obj : Gtk_mathview.math_view obj)
- method connect = new math_view_signals obj
- method load ~filename =
- if not (MathView.load obj ~filename) then raise (ErrorLoadingFile filename)
+ method freeze = MathView.freeze obj
+ method thaw = MathView.thaw obj
+ method load_uri ~filename =
+ if not (MathView.load_uri obj ~filename) then raise (ErrorLoadingFile filename)
+ method load_doc ~dom =
+ if not (MathView.load_doc obj ~dom:((dom : Gdome.document)#as_Document)) then
+ raise ErrorLoadingDOM
method unload = MathView.unload obj
- method get_selection = MathView.get_selection obj
- method set_selection (node : Ominidom.o_mDOMNode option) = MathView.set_selection obj node
+ method select element = MathView.select obj ((element : Gdome.element)#as_Element)
+ method unselect element = MathView.unselect obj ((element : Gdome.element)#as_Element)
+ method is_selected element = MathView.is_selected obj ((element : Gdome.element)#as_Element)
method get_width = MathView.get_width obj
method get_height = MathView.get_height obj
method get_top = MathView.get_top 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_transparency = MathView.set_transparency obj
+ method get_transparency = MathView.get_transparency obj
method set_log_verbosity = MathView.set_log_verbosity obj
method get_log_verbosity = MathView.get_log_verbosity obj
method export_to_postscript
method set_font_manager_type ~fm_type = MathView.set_font_manager_type obj ~fm_type
end
+class math_view obj = object
+ inherit math_view_skel (obj : Gtk_mathview.math_view obj)
+ method connect = new math_view_signals obj
+end
+
let math_view ?adjustmenth ?adjustmentv ?font_size ?font_manager ?border_width
?width ?height ?packing ?show () =
let w =