From: Stefano Zacchiroli Date: Thu, 29 Jul 2004 15:55:46 +0000 (+0000) Subject: (pre-)porting to gtkmathview 0.6.3 && ocaml 3.08 X-Git-Tag: V_0_6_3_2~9 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=5c99f78f510b49bc1bcf95d430c98bb18826c63f;p=helm.git (pre-)porting to gtkmathview 0.6.3 && ocaml 3.08 --- diff --git a/helm/DEVEL/lablgtkmathview/.depend b/helm/DEVEL/lablgtkmathview/.depend index 186c66f3a..23cd75664 100644 --- a/helm/DEVEL/lablgtkmathview/.depend +++ b/helm/DEVEL/lablgtkmathview/.depend @@ -1,14 +1,12 @@ -gMathView.cmo: gtkMathView.cmo gtk_mathview.cmo ogtkMathViewProps.cmo \ - gMathView.cmi -gMathView.cmx: gtkMathView.cmx gtk_mathview.cmx ogtkMathViewProps.cmx \ - gMathView.cmi -gMathViewAux.cmo: gMathView.cmi gtkMathView.cmo gMathViewAux.cmi -gMathViewAux.cmx: gMathView.cmx gtkMathView.cmx gMathViewAux.cmi +gMathViewAux.cmo: gMathView.cmi gMathViewAux.cmi +gMathViewAux.cmx: gMathView.cmx gMathViewAux.cmi +gMathView.cmo: gtkMathView.cmo gtk_mathview.cmo gMathView.cmi +gMathView.cmx: gtkMathView.cmx gtk_mathview.cmx gMathView.cmi gtkMathView.cmo: gtkMathViewProps.cmo gtk_mathview.cmo gtkMathView.cmx: gtkMathViewProps.cmx gtk_mathview.cmx gtkMathViewProps.cmo: gtk_mathview.cmo gtkMathViewProps.cmx: gtk_mathview.cmx ogtkMathViewProps.cmo: gtkMathViewProps.cmo ogtkMathViewProps.cmx: gtkMathViewProps.cmx -gMathView.cmi: gtk_mathview.cmo gMathViewAux.cmi: gMathView.cmi gtk_mathview.cmo +gMathView.cmi: gtk_mathview.cmo diff --git a/helm/DEVEL/lablgtkmathview/configure.in b/helm/DEVEL/lablgtkmathview/configure.in index 26cd3f9b7..ce9762595 100644 --- a/helm/DEVEL/lablgtkmathview/configure.in +++ b/helm/DEVEL/lablgtkmathview/configure.in @@ -4,7 +4,7 @@ PACKAGE=lablgtkmathview LABLGTKMATHVIEW_MAJOR_VERSION=0 LABLGTKMATHVIEW_MINOR_VERSION=6 -LABLGTKMATHVIEW_MICRO_VERSION=2 +LABLGTKMATHVIEW_MICRO_VERSION=3 LABLGTKMATHVIEW_VERSION=$LABLGTKMATHVIEW_MAJOR_VERSION.$LABLGTKMATHVIEW_MINOR_VERSION.$LABLGTKMATHVIEW_MICRO_VERSION VERSION=$LABLGTKMATHVIEW_VERSION diff --git a/helm/DEVEL/lablgtkmathview/debian/changelog b/helm/DEVEL/lablgtkmathview/debian/changelog index dbe12c1fe..efa57b5bd 100644 --- a/helm/DEVEL/lablgtkmathview/debian/changelog +++ b/helm/DEVEL/lablgtkmathview/debian/changelog @@ -1,3 +1,17 @@ +lablgtkmathview (0.6.3-1) unstable; urgency=low + + * new upstream release + - bindings for gtkmathview 0.6.3 + * rebuilt with ocaml 3.08 + * debian/control + - bumped ocaml deps to 3.08 + - bumped lablgtk deps to >= 2.4.0 + - bumped gdome deps to >= 0.2.1-3 (1st version rebuilt with 3.08) + - bumped gtkmathview deps to >= 0.6.3 (needed by this binding) + - bumped stadards version to 3.6.1.1 + + -- Stefano Zacchiroli Thu, 29 Jul 2004 11:51:56 +0200 + lablgtkmathview (0.5.1-4) unstable; urgency=low * ported to latest lablgtk2 (2.2.0+20040113) cvs snapshot diff --git a/helm/DEVEL/lablgtkmathview/debian/control b/helm/DEVEL/lablgtkmathview/debian/control index c5c5dce27..0eab01423 100644 --- a/helm/DEVEL/lablgtkmathview/debian/control +++ b/helm/DEVEL/lablgtkmathview/debian/control @@ -2,13 +2,13 @@ Source: lablgtkmathview Section: devel Priority: optional Maintainer: Stefano Zacchiroli -Build-Depends: debhelper (>> 4.0.0), ocaml-3.07, ocaml-findlib (>= 0.8-5), liblablgtk2-ocaml-dev (>= 2.2.0+20040113), libgdome2-ocaml-dev (>= 0.2.1), libgtkmathview-dev (>= 0.5.1), pkg-config, autoconf -Standards-Version: 3.6.1.0 +Build-Depends: debhelper (>> 4.0.0), ocaml-3.08, ocaml-findlib, liblablgtk2-ocaml-dev (>= 2.4.0), libgdome2-ocaml-dev (>= 0.2.1-3), libgtkmathview-dev (>= 0.6.3), pkg-config, autoconf +Standards-Version: 3.6.1.1 Package: liblablgtkmathview-ocaml Architecture: any Section: libs -Depends: ocaml-base-3.07, liblablgtk2-ocaml (>= 2.2.0), libgdome2-ocaml (>= 0.2.1), ${shlibs:Depends}, ${misc:Depends} +Depends: ocaml-base-3.08, liblablgtk2-ocaml (>= 2.4.0), libgdome2-ocaml (>= 0.2.1-3), ${shlibs:Depends}, ${misc:Depends} Description: OCaml bindings for libgtkmathview, a GTK widget to render MathML This is the Ocaml binding for the GtkMathView widget, that is currently available in the libgtkmathview0 package. @@ -18,7 +18,7 @@ Description: OCaml bindings for libgtkmathview, a GTK widget to render MathML Package: liblablgtkmathview-ocaml-dev Architecture: any Section: libdevel -Depends: ocaml-3.07, liblablgtk2-ocaml-dev (>= 2.2.0), libgtkmathview0 (>= 0.5.1), liblablgtkmathview-ocaml (= ${Source-Version}), ocaml-findlib (>= 0.8-5), libgdome2-ocaml-dev (>= 0.2.1), libgtkmathview-dev (>= 0.5.1), ${misc:Depends} +Depends: ocaml-3.08, liblablgtk2-ocaml-dev (>= 2.4.0), libgtkmathview0 (>= 0.6.3), liblablgtkmathview-ocaml (= ${Source-Version}), ocaml-findlib, libgdome2-ocaml-dev (>= 0.2.1-3), libgtkmathview-dev (>= 0.6.3), ${misc:Depends} Description: OCaml bindings for libgtkmathview, a GTK widget to render MathML These are the Ocaml bindings for the GtkMathView widget, that is currently available in the libgtkmathview0 package. diff --git a/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml-dev.dirs b/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml-dev.dirs index c02750493..7e66c4fb5 100644 --- a/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml-dev.dirs +++ b/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml-dev.dirs @@ -1,2 +1,2 @@ -usr/lib/ocaml/3.07 -usr/lib/ocaml/3.07/stublibs +usr/lib/ocaml/3.08 +usr/lib/ocaml/3.08/stublibs diff --git a/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml.dirs b/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml.dirs index 35dced577..f552f091a 100644 --- a/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml.dirs +++ b/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml.dirs @@ -1 +1 @@ -usr/lib/ocaml/3.07 +usr/lib/ocaml/3.08 diff --git a/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml.install b/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml.install index 9edf8ab5d..6657f706e 100644 --- a/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml.install +++ b/helm/DEVEL/lablgtkmathview/debian/liblablgtkmathview-ocaml.install @@ -1,2 +1,2 @@ -usr/lib/ocaml/3.07/lablgtkmathview/*.so -usr/lib/ocaml/3.07/stublibs/* +usr/lib/ocaml/3.08/lablgtkmathview/*.so +usr/lib/ocaml/3.08/stublibs/* diff --git a/helm/DEVEL/lablgtkmathview/gMathView.ml b/helm/DEVEL/lablgtkmathview/gMathView.ml index 751674bbe..57a6aa9a6 100644 --- a/helm/DEVEL/lablgtkmathview/gMathView.ml +++ b/helm/DEVEL/lablgtkmathview/gMathView.ml @@ -40,7 +40,7 @@ let option_element_of_option = | Some v -> Some (new Gdome.element v) class math_view_skel obj = object - inherit GContainer.container (obj : Gtk_mathview.math_view obj) + inherit GObj.widget (obj : Gtk_mathview.math_view obj) method freeze = MathView.freeze obj method thaw = MathView.thaw obj method load_uri ~filename = @@ -56,15 +56,14 @@ class math_view_skel obj = object method structure_changed element = MathView.structure_changed obj ((element : Gdome.element)#as_Element) method attribute_changed element ~name = MathView.attribute_changed obj ((element : Gdome.element)#as_Element) ((name : Gdome.domString)#as_DOMString) method get_bounding_box = MathView.get_bounding_box obj - method get_width = MathView.get_width obj - method get_height = MathView.get_height obj + method get_size = MathView.get_size obj method get_top = MathView.get_top obj method set_top x y = MathView.set_top obj x y method set_adjustments adj1 adj2 = MathView.set_adjustments obj (GData.as_adjustment adj1) (GData.as_adjustment adj2) - method get_hadjustment = new GData.adjustment (MathView.get_hadjustment obj) - method get_vadjustment = new GData.adjustment (MathView.get_vadjustment obj) + method get_adjustments = + let hadj, vadj = MathView.get_adjustments obj in + new GData.adjustment hadj, new GData.adjustment vadj method get_buffer = MathView.get_buffer obj - method get_drawing_area = new GMisc.drawing_area (MathView.get_drawing_area obj) method set_font_size = MathView.set_font_size obj method get_font_size = MathView.get_font_size obj method set_log_verbosity = MathView.set_log_verbosity obj @@ -72,8 +71,8 @@ class math_view_skel obj = object end class math_view_signals obj = object - inherit GContainer.container_signals_impl obj - inherit math_view_sigs + inherit GObj.widget_signals_impl obj + inherit math_view__g_meta_dom_sigs end class math_view obj = object @@ -82,7 +81,7 @@ class math_view obj = object end let math_view ?hadjustment ?vadjustment ?font_size ?log_verbosity = - GtkBase.Container.make_params ~cont:( + GtkBase.Widget.size_params ~cont:( OgtkMathViewProps.pack_return (fun p -> OgtkMathViewProps.set_params (new math_view (MathView.create p)) ~font_size ~log_verbosity)) [] ;; diff --git a/helm/DEVEL/lablgtkmathview/gMathView.mli b/helm/DEVEL/lablgtkmathview/gMathView.mli index 62b31d35d..9ec204d51 100644 --- a/helm/DEVEL/lablgtkmathview/gMathView.mli +++ b/helm/DEVEL/lablgtkmathview/gMathView.mli @@ -26,9 +26,9 @@ exception ErrorWritingFile of string exception ErrorLoadingDOM class math_view_signals : - ([> `container | `gtk | `mathview | `widget] as 'b) Gtk.obj -> + ([> `gtk | `mathview_gmetadom | `widget] as 'b) Gtk.obj -> object ('a) - inherit GContainer.container_signals + inherit GObj.widget_signals val after: bool val obj: 'b Gtk.obj method click : @@ -48,18 +48,15 @@ class math_view_signals : class math_view_skel : (Gtk_mathview.math_view Gtk.obj as 'a)-> object - inherit GContainer.container + inherit GObj.widget method freeze : unit method thaw : unit method get_buffer : Gdk.pixmap method get_font_size : int - method get_drawing_area : GMisc.drawing_area - method get_hadjustment : GData.adjustment - method get_height : int + method get_adjustments : GData.adjustment * GData.adjustment + method get_size : int * int method get_log_verbosity : int method get_top : int * int - method get_vadjustment : GData.adjustment - method get_width : int method load_uri : filename:string -> unit method load_root : root:Gdome.element -> unit method set_adjustments : GData.adjustment -> GData.adjustment -> unit @@ -89,7 +86,6 @@ val math_view : ?vadjustment:GData.adjustment -> ?font_size:int -> ?log_verbosity:int -> - ?border_width:int -> ?width:int -> ?height:int -> ?packing:(GObj.widget -> unit) -> ?show:bool -> unit -> math_view diff --git a/helm/DEVEL/lablgtkmathview/gMathViewAux.ml b/helm/DEVEL/lablgtkmathview/gMathViewAux.ml index d59732cb2..01465cb0a 100644 --- a/helm/DEVEL/lablgtkmathview/gMathViewAux.ml +++ b/helm/DEVEL/lablgtkmathview/gMathViewAux.ml @@ -189,9 +189,10 @@ class single_selection_math_view obj = ;; let single_selection_math_view ?hadjustment ?vadjustment ?font_size ?log_verbosity = - GtkBase.Container.make_params ~cont:( + GtkBase.Widget.size_params ~cont:( OgtkMathViewProps.pack_return - (fun p -> OgtkMathViewProps.set_params (new single_selection_math_view (GtkMathViewProps.MathView.create p)) ~font_size ~log_verbosity)) [] + (fun p -> OgtkMathViewProps.set_params (new single_selection_math_view + (GtkMathViewProps.MathView_GMetaDOM.create p)) ~font_size ~log_verbosity)) [] ;; class multi_selection_math_view_signals obj @@ -283,7 +284,8 @@ class multi_selection_math_view obj = ;; let multi_selection_math_view ?hadjustment ?vadjustment ?font_size ?log_verbosity = - GtkBase.Container.make_params ~cont:( + GtkBase.Widget.size_params ~cont:( OgtkMathViewProps.pack_return - (fun p -> OgtkMathViewProps.set_params (new multi_selection_math_view (GtkMathViewProps.MathView.create p)) ~font_size ~log_verbosity)) [] + (fun p -> OgtkMathViewProps.set_params (new multi_selection_math_view + (GtkMathViewProps.MathView_GMetaDOM.create p)) ~font_size ~log_verbosity)) [] ;; diff --git a/helm/DEVEL/lablgtkmathview/gMathViewAux.mli b/helm/DEVEL/lablgtkmathview/gMathViewAux.mli index d8eb283cc..58a8d17b9 100644 --- a/helm/DEVEL/lablgtkmathview/gMathViewAux.mli +++ b/helm/DEVEL/lablgtkmathview/gMathViewAux.mli @@ -22,7 +22,7 @@ *) class single_selection_math_view_signals : - ([> `container | `gtk | `mathview | `widget] as 'b) Gtk.obj -> + ([> `gtk | `mathview_gmetadom | `widget] as 'b) Gtk.obj -> ((Gdome.element option -> unit) -> unit) -> object inherit GMathView.math_view_signals @@ -44,7 +44,6 @@ val single_selection_math_view : ?vadjustment:GData.adjustment -> ?font_size:int -> ?log_verbosity:int -> - ?border_width:int -> ?width:int -> ?height:int -> ?packing:(GObj.widget -> unit) -> @@ -68,7 +67,6 @@ val multi_selection_math_view : ?vadjustment:GData.adjustment -> ?font_size:int -> ?log_verbosity:int -> - ?border_width:int -> ?width:int -> ?height:int -> ?packing:(GObj.widget -> unit) -> diff --git a/helm/DEVEL/lablgtkmathview/gtkMathView.ml b/helm/DEVEL/lablgtkmathview/gtkMathView.ml index e337bdf10..6d2db8849 100644 --- a/helm/DEVEL/lablgtkmathview/gtkMathView.ml +++ b/helm/DEVEL/lablgtkmathview/gtkMathView.ml @@ -33,63 +33,58 @@ external _gtkmathview_init : unit -> unit = "ml_gtk_mathview_init" let () = _gtkmathview_init () module MathView = struct - include MathView - external freeze : [>`mathview] obj -> unit = + include MathView_GMetaDOM + external freeze : [>`mathview_gmetadom] obj -> unit = "ml_gtk_math_view_freeze" - external thaw : [>`mathview] obj -> unit = + external thaw : [>`mathview_gmetadom] obj -> unit = "ml_gtk_math_view_thaw" - external load_uri : [>`mathview] obj -> filename:string -> bool = + external load_uri : [>`mathview_gmetadom] obj -> filename:string -> bool = "ml_gtk_math_view_load_uri" - external load_root : [>`mathview] obj -> root:[> `Element] GdomeT.t -> bool = + external load_root : [>`mathview_gmetadom] obj -> root:[> `Element] GdomeT.t -> bool = "ml_gtk_math_view_load_root" - external unload : [>`mathview] obj -> unit = + external unload : [>`mathview_gmetadom] obj -> unit = "ml_gtk_math_view_unload" external select : - [>`mathview] obj -> [> `Element] GdomeT.t -> unit = + [>`mathview_gmetadom] obj -> [> `Element] GdomeT.t -> unit = "ml_gtk_math_view_select" external unselect : - [>`mathview] obj -> [> `Element] GdomeT.t -> unit = + [>`mathview_gmetadom] obj -> [> `Element] GdomeT.t -> unit = "ml_gtk_math_view_unselect" external is_selected : - [>`mathview] obj -> [> `Element] GdomeT.t -> bool = + [>`mathview_gmetadom] obj -> [> `Element] GdomeT.t -> bool = "ml_gtk_math_view_is_selected" external structure_changed : - [>`mathview] obj -> [> `Element] GdomeT.t -> unit = + [>`mathview_gmetadom] obj -> [> `Element] GdomeT.t -> unit = "ml_gtk_math_view_structure_changed" external attribute_changed : - [>`mathview] obj -> [> `Element] GdomeT.t -> name:TDOMString.t -> unit = + [>`mathview_gmetadom] obj -> [> `Element] GdomeT.t -> name:TDOMString.t -> unit = "ml_gtk_math_view_attribute_changed" external get_bounding_box : - [>`mathview] obj -> (int * int * int) = + [>`mathview_gmetadom] obj -> (int * int * int) = "ml_gtk_math_view_get_bounding_box" external get_element_at : - [> `mathview] obj -> int -> int -> TElement.t option = + [> `mathview_gmetadom] obj -> int -> int -> TElement.t option = "ml_gtk_math_view_get_element_at" (* beginning of prop-like methods *) - external get_width : [>`mathview] obj -> int = - "ml_gtk_math_view_get_width" - external get_height : [>`mathview] obj -> int = - "ml_gtk_math_view_get_height" - external get_top : [>`mathview] obj -> (int * int) = + external get_size : [>`mathview_gmetadom] obj -> int * int = + "ml_gtk_math_view_get_size" + external get_top : [>`mathview_gmetadom] obj -> (int * int) = "ml_gtk_math_view_get_top" - external set_top : [>`mathview] obj -> int -> int -> unit = + external set_top : [>`mathview_gmetadom] obj -> int -> int -> unit = "ml_gtk_math_view_set_top" - external set_adjustments : [>`mathview] obj -> Gtk.adjustment obj -> Gtk.adjustment obj -> unit = + external set_adjustments : [>`mathview_gmetadom] obj -> Gtk.adjustment obj -> Gtk.adjustment obj -> unit = "ml_gtk_math_view_set_adjustments" - external get_hadjustment : [>`mathview] obj -> Gtk.adjustment obj = - "ml_gtk_math_view_get_hadjustment" - external get_vadjustment : [>`mathview] obj -> Gtk.adjustment obj = - "ml_gtk_math_view_get_vadjustment" - external get_buffer : [>`mathview] obj -> Gdk.pixmap = + external get_adjustments : [>`mathview_gmetadom] obj -> + Gtk.adjustment obj * Gtk.adjustment obj = + "ml_gtk_math_view_get_adjustments" + external get_buffer : [>`mathview_gmetadom] obj -> Gdk.pixmap = "ml_gtk_math_view_get_buffer" - external get_drawing_area : [>`mathview] obj -> Gtk.drawing_area obj = - "ml_gtk_math_view_get_drawing_area" - external set_font_size : [>`mathview] obj -> int -> unit = + external set_font_size : [>`mathview_gmetadom] obj -> int -> unit = "ml_gtk_math_view_set_font_size" - external get_font_size : [>`mathview] obj -> int = + external get_font_size : [>`mathview_gmetadom] obj -> int = "ml_gtk_math_view_get_font_size" - external set_log_verbosity : [>`mathview] obj -> int -> unit = + external set_log_verbosity : [>`mathview_gmetadom] obj -> int -> unit = "ml_gtk_math_view_set_log_verbosity" - external get_log_verbosity : [>`mathview] obj -> int = + external get_log_verbosity : [>`mathview_gmetadom] obj -> int = "ml_gtk_math_view_get_log_verbosity" end diff --git a/helm/DEVEL/lablgtkmathview/gtkMathView.props b/helm/DEVEL/lablgtkmathview/gtkMathView.props index fba5f3c94..cd4c5b190 100644 --- a/helm/DEVEL/lablgtkmathview/gtkMathView.props +++ b/helm/DEVEL/lablgtkmathview/gtkMathView.props @@ -16,6 +16,10 @@ external gdome_element_option_of_boxed_option : "ml_gtk_math_view_gdome_element_option_of_boxed_option" ;; +external model_event_of_boxed_option model_event : + Gpointer.boxed -> TElement.t option * gint * gint * gint = + "ml_gtk_math_view_model_event_of_boxed" + let option_element_of_option = function None -> None @@ -26,6 +30,11 @@ let option_element_of_boxed_option x = option_element_of_option (gdome_element_option_of_boxed_option x) ;; +let model_event_of_boxed model_event = + let id,x,y,state = model_event_of_boxed_option model_event in + option_element_of_boxed_option id,x,y,state +;; + let gdome_element_option_conv = {Gobject.kind = `POINTER ; Gobject.proj = @@ -35,6 +44,16 @@ let gdome_element_option_conv = Gobject.inj = (function element -> assert false) } + +let gtk_math_view_model_event_conv = + {Gobject.kind = `POINTER ; + Gobject.proj = + (function + `POINTER model_event -> model_event_of_boxed model_event + | _ -> failwith "gtk_math_view_model_event_conv") ; + Gobject.inj = + (function element -> assert false) + } } oheader { @@ -61,15 +80,15 @@ let pack_return create p ?packing ?show () = conversions { GdomeElement_option "gdome_element_option_conv" + GtkMathViewModelEvent "gtk_math_view_model_event_conv" } classes { GtkAdjustment "Gtk.adjustment obj" - GtkDrawingArea "Gtk.drawing_area obj" } -class MathView type "math_view obj" set wrapsig : EventBox { +class MathView_GMetaDOM type "math_view obj" set wrapsig : Widget { (* "width" gint : Read "height" gint : Read @@ -83,10 +102,10 @@ class MathView type "math_view obj" set wrapsig : EventBox { "log-verbosity" gint : Read / Write / Construct "root-element" GdomeElement_option : Read *) - signal click: GdomeElement_option gint - signal select_begin: GdomeElement_option gint - signal select_over: GdomeElement_option gint - signal select_end: GdomeElement_option gint + signal click: GtkMathViewModelEvent + signal select_begin: GtkMathViewModelEvent + signal select_over: GtkMathViewModelEvent + signal select_end: GtkMathViewModelEvent signal select_abort - signal element_over: GdomeElement_option gint + signal element_over: GtkMathViewModelEvent } diff --git a/helm/DEVEL/lablgtkmathview/gtk_mathview.ml b/helm/DEVEL/lablgtkmathview/gtk_mathview.ml index a5d366194..f5b8c5ef6 100644 --- a/helm/DEVEL/lablgtkmathview/gtk_mathview.ml +++ b/helm/DEVEL/lablgtkmathview/gtk_mathview.ml @@ -21,4 +21,4 @@ * For details, send a mail to the author. *) -type math_view = [Gtk.event_box|`mathview] +type math_view = [Gtk.widget|`mathview_gmetadom] diff --git a/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c b/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c index 41175584d..f8141f9eb 100644 --- a/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c +++ b/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c @@ -97,15 +97,16 @@ ML_2 (gtk_math_view_unselect, GtkMathView_val, Element_val, Unit) ML_2 (gtk_math_view_is_selected, GtkMathView_val, Element_val, Val_bool) /* ML_2 (gtk_math_view_new,GtkAdjustment_val, GtkAdjustment_val, Val_GtkWidget_sink) -*/ 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_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_drawing_area, 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_log_verbosity, GtkMathView_val, Int_val, Unit) @@ -123,10 +124,35 @@ value ml_gtk_math_view_get_element_at (value arg1, value arg2, value arg3) CAMLreturn (result); } +value ml_gtk_math_view_get_adjustments(value arg1) +{ + CAMLparam1(arg1); + CAMLlocal1(result); + GtkAdjustment* hadj; + GtkAdjustment* vadj; + gtk_math_view_get_adjustments(GtkMathView_val (arg1), &hadj, &vadj); + result = alloc(2, 0); + Store_field(result, 0, Val_GtkWidget(hadj)); + Store_field(result, 1, Val_GtkWidget(vadj)); + CAMLreturn(result); +} + +value ml_gtk_math_view_get_size (value arg1) +{ + CAMLparam1(arg1); + CAMLlocal1(result); + int width, height; + gtk_math_view_get_size(GtkMathView_val (arg1), &width, &height); + result = alloc(1, 0); + Store_field(result, 0, Val_int(width)); + Store_field(result, 1, Val_int(height)); + CAMLreturn (result); +} + value ml_gtk_math_view_get_bounding_box (value arg1) { CAMLparam1(arg1); - CAMLlocal1 (result); + CAMLlocal1(result); int width, height, depth; GtkMathViewBoundingBox gbox; gtk_math_view_get_bounding_box(GtkMathView_val (arg1), &gbox); @@ -140,7 +166,7 @@ value ml_gtk_math_view_get_bounding_box (value arg1) value ml_gtk_math_view_get_top (value arg1) { CAMLparam1(arg1); - CAMLlocal1 (result); + CAMLlocal1(result); int x, y; gtk_math_view_get_top(GtkMathView_val (arg1), &x, &y); result = alloc(2, 0); @@ -204,3 +230,22 @@ value ml_gtk_math_view_gdome_element_option_of_boxed_option (value arg1) CAMLreturn(res); } + +value ml_gtk_math_view_model_event_of_boxed_option (value arg1) +{ + CAMLparam1(arg1); + GdomeElement* nr; + CAMLlocal1 (valnr); + CAMLlocal1 (res); + + assert(arg1 != Val_int(0)); + GtkMathViewModelEvent* event = (GtkMathViewModelEvent*) Field(Field(arg1,0),1); + res = alloc(4, 0); + Store_field(res, 0, Val_option_ptr(event->id, Val_Element_ref)); + Store_field(res, 1, Val_int(event->x)); + Store_field(res, 2, Val_int(event->y)); + Store_field(res, 3, Val_int(event->state)); + + CAMLreturn(res); +} + diff --git a/helm/DEVEL/lablgtkmathview/test/Makefile.in b/helm/DEVEL/lablgtkmathview/test/Makefile.in index 29ab71ffc..1b4d01991 100644 --- a/helm/DEVEL/lablgtkmathview/test/Makefile.in +++ b/helm/DEVEL/lablgtkmathview/test/Makefile.in @@ -1,5 +1,5 @@ -PACKAGE = @PACKAGE@ -MLFLAGS = -predicates "init" +PACKAGE = @PACKAGE@ lablgtk2.init +MLFLAGS = OCAMLC = ocamlfind ocamlc $(MLFLAGS) OCAMLOPT = ocamlfind ocamlopt $(MLFLAGS) TMPDIR = .test diff --git a/helm/DEVEL/lablgtkmathview/test/test.ml b/helm/DEVEL/lablgtkmathview/test/test.ml index 1c077846b..3561c551c 100644 --- a/helm/DEVEL/lablgtkmathview/test/test.ml +++ b/helm/DEVEL/lablgtkmathview/test/test.ml @@ -227,13 +227,9 @@ let unload mathview () = flush stdout ;; -let get_width mathview () = - print_string ("width: " ^ string_of_int (mathview#get_width) ^ "\n") ; - flush stdout -;; - -let get_height mathview () = - print_string ("height: " ^ string_of_int (mathview#get_height) ^ "\n") ; +let get_size mathview () = + let width, height = mathview#get_size in + print_string ("width: " ^ string_of_int width ^ ", height: " ^ string_of_int height ^ "\n") ; flush stdout ;; @@ -259,20 +255,14 @@ let set_adjustments mathview () = flush stdout ;; -let get_hadjustment mathview () = - let adj = mathview#get_hadjustment in - adj#set_value ((adj#lower +. adj#upper) /. 2.0) ; +let get_adjustments mathview () = + let hadj, vadj = mathview#get_adjustments in + hadj#set_value ((hadj#lower +. hadj#upper) /. 2.0) ; + vadj#set_value ((vadj#lower +. vadj#upper) /. 2.0) ; print_string "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 "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 @@ -320,14 +310,6 @@ let get_element_at mathview () = ;; *) -let get_drawing_area mathview () = - begin - let da = mathview#get_drawing_area in - print_string ("don't know what to do with the drawing area\n") - end ; - flush stdout -;; - let _ = (GtkMain.Main.init ()) ;; @@ -343,13 +325,11 @@ let button_selection = GButton.button ~label:"get_selection" ~packing:(table#att let button_set_selection = GButton.button ~label:"set_selection" ~packing:(table#attach ~left:4 ~top:0) () in let button_add_selection = GButton.button ~label:"add_selection" ~packing:(table#attach ~left:3 ~top:3) () in let button_reset_selections = GButton.button ~label:"reset_selections" ~packing:(table#attach ~left:4 ~top:3) () 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_size = GButton.button ~label:"get_size" ~packing:(table#attach ~left:0 ~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_adjustments = GButton.button ~label:"get_adjustments" ~packing:(table#attach ~left:0 ~top:2) () in let button_get_buffer = GButton.button ~label:"get_buffer" ~packing:(table#attach ~left:2 ~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 @@ -357,7 +337,6 @@ let button_set_log_verbosity = GButton.button ~label:"set_log_verbosity" ~packin let button_get_log_verbosity = GButton.button ~label:"get_log_verbosity" ~packing:(table#attach ~left:1 ~top:4) () in let button_load_dom = GButton.button ~label:"load from DOM" ~packing:(table#attach ~left:2 ~top:5) () in (* let button_get_element_at = GButton.button ~label:"get_element_at" ~packing:(table#attach ~left:3 ~top:5) () in *) -let button_get_drawing_area = GButton.button ~label:"get_drawing_area" ~packing:(table#attach ~left:4 ~top:5) () in (* Signals connection *) ignore(button_load#connect#clicked (load_uri mathview)) ; ignore(button_unload#connect#clicked (unload mathview)) ; @@ -365,13 +344,11 @@ ignore(button_selection#connect#clicked (test_get_selection mathview)) ; ignore(button_set_selection#connect#clicked (test_set_selection mathview)) ; ignore(button_add_selection#connect#clicked (test_add_selection mathview)) ; ignore(button_reset_selections#connect#clicked (test_reset_selections mathview)) ; -ignore(button_get_width#connect#clicked (get_width mathview)) ; -ignore(button_get_height#connect#clicked (get_height mathview)) ; +ignore(button_get_size#connect#clicked (get_size 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_adjustments#connect#clicked (get_adjustments mathview)) ; ignore(button_get_buffer#connect#clicked (get_buffer mathview)) ; ignore(button_set_font_size#connect#clicked (set_font_size mathview)) ; ignore(button_get_font_size#connect#clicked (get_font_size mathview)) ; @@ -382,7 +359,6 @@ ignore(mathview#connect#selection_changed (selection_changed mathview)); ignore(mathview#connect#element_over (element_over mathview)) ; ignore(button_load_dom#connect#clicked (load_doc mathview)) ; (* ignore(button_get_element_at#connect#clicked (get_element_at mathview)) ; *) -ignore(button_get_drawing_area#connect#clicked (get_drawing_area mathview)) ; (* Main Loop *) main_window#show () ; GMain.Main.main ()