class math_view_signals obj = object
inherit GContainer.container_signals obj
- method clicked = GtkSignal.connect ~sgn:MathView.Signals.clicked 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.marshaller = new_marshaller }
+ in
+ GtkSignal.connect ~sgn:new_clicked obj ~after
method selection_changed =
- GtkSignal.connect ~sgn:MathView.Signals.selection_changed obj ~after
+ let module S = GtkSignal in
+ let new_selection_changed =
+ let new_marshaller f x y =
+ MathView.Signals.selection_changed.S.marshaller
+ (function None -> f None | Some e -> f (Some (new Gdome.element e))) x y
+ in
+ { S.name = "selection_changed"; S.marshaller = new_marshaller }
+ in
+ GtkSignal.connect ~sgn:new_selection_changed obj ~after
method element_changed =
- GtkSignal.connect ~sgn:MathView.Signals.element_changed obj ~after
+ 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.marshaller = new_marshaller }
+ in
+ GtkSignal.connect ~sgn:new_element_changed obj ~after
end
class math_view obj = object
method load ~filename =
if not (MathView.load obj ~filename) then raise (ErrorLoadingFile filename)
method load_tree ~dom =
- if not (MathView.load_tree obj ~dom) then raise ErrorLoadingDOM
+ if not (MathView.load_tree 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 get_selection =
+ match MathView.get_selection obj with
+ None -> None
+ | Some element -> Some (new Gdome.element element)
+ method set_selection element =
+ let element =
+ match element with
+ None -> None
+ | Some element -> Some ((element : Gdome.element)#as_Element)
+ in
+ MathView.set_selection obj element
method get_width = MathView.get_width obj
method get_height = MathView.get_height obj
method get_top = MathView.get_top obj
if not result then raise (ErrorWritingFile filename)
method get_font_manager_type = MathView.get_font_manager_type obj
method set_font_manager_type ~fm_type = MathView.set_font_manager_type obj ~fm_type
- method get_element = MathView.get_element obj
+ method get_element =
+ match MathView.get_element obj with
+ None -> None
+ | Some element -> Some (new Gdome.element element)
method action_get_selected = MathView.action_get_selected obj
method action_set_selected = MathView.action_set_selected obj
- method get_action = MathView.get_action obj
+ method get_action =
+ match MathView.get_action obj with
+ None -> None
+ | Some ac -> Some (new Gdome.element ac)
method action_toggle = MathView.action_toggle obj
end