[cairo-commit] cairo-ocaml/src ocairo_gtkcairo.ml,1.1.1.1,1.2 ocairo_gtkcairo.mli,1.1.1.1,1.2

Olivier Andrieu commit at pdx.freedesktop.org
Wed Dec 3 14:17:54 PST 2003


Committed by: oandrieu

Update of /cvs/cairo/cairo-ocaml/src
In directory pdx:/tmp/cvs-serv9809/src

Modified Files:
	ocairo_gtkcairo.ml ocairo_gtkcairo.mli 
Log Message:
support redraw signal of GtkCairo

Index: ocairo_gtkcairo.ml
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ocairo_gtkcairo.ml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** ocairo_gtkcairo.ml	18 Nov 2003 19:02:26 -0000	1.1.1.1
--- ocairo_gtkcairo.ml	3 Dec 2003 22:17:52 -0000	1.2
***************
*** 7,14 ****
  external get_cairo : [>`gtkcairo] Gtk.obj -> Cairo.t = "ml_cairo_gtkcairo_get_cairo"
  
  class cairo obj = 
    object
!     inherit GObj.widget_full (obj : [> gtkcairo] Gtk.obj)
  
      method event = new GObj.event_ops obj
      method cairo = new Ocairo.cairo (get_cairo obj)
--- 7,31 ----
  external get_cairo : [>`gtkcairo] Gtk.obj -> Cairo.t = "ml_cairo_gtkcairo_get_cairo"
  
+ let redraw_sig = {
+   GtkSignal.name       = "redraw" ;
+   GtkSignal.classe     = `gtkcairo ;
+   GtkSignal.marshaller = 
+   let m = GtkSignal.marshal1 Gobject.Data.pointer "GtkCairo::redraw" in
+   fun cb ->
+     m (function 
+       | None -> raise Gpointer.Null 
+       | Some cairo -> cb (Obj.magic cairo : Cairo.t)) }
+ 
+ class cairo_signals obj = 
+   object (self)
+     inherit GObj.widget_signals_impl obj
+     method redraw = self#connect redraw_sig
+   end
+ 
  class cairo obj = 
    object
!     inherit GObj.widget (obj : [> gtkcairo] Gtk.obj)
  
+     method connect = new cairo_signals obj
      method event = new GObj.event_ops obj
      method cairo = new Ocairo.cairo (get_cairo obj)

Index: ocairo_gtkcairo.mli
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ocairo_gtkcairo.mli,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** ocairo_gtkcairo.mli	18 Nov 2003 19:02:26 -0000	1.1.1.1
--- ocairo_gtkcairo.mli	3 Dec 2003 22:17:52 -0000	1.2
***************
*** 1,13 ****
  type gtkcairo = [Gtk.widget | `gtkcairo]
- val init : unit
  
  external get_cairo : [> `gtkcairo ] Gtk.obj -> Cairo.t
    = "ml_cairo_gtkcairo_get_cairo"
  
  class cairo :
    ([> gtkcairo ] as 'a) Gtk.obj ->
    object
!     inherit GObj.widget_full
      val obj : 'a Gtk.obj
      method event : GObj.event_ops
      method cairo : Ocairo.cairo
--- 1,20 ----
  type gtkcairo = [Gtk.widget | `gtkcairo]
  
  external get_cairo : [> `gtkcairo ] Gtk.obj -> Cairo.t
    = "ml_cairo_gtkcairo_get_cairo"
  
+ class cairo_signals :
+   [> gtkcairo ] Gtk.obj ->
+   object
+     inherit GObj.widget_signals
+     method redraw : callback:(Cairo.t -> unit) -> GtkSignal.id
+   end
+ 
  class cairo :
    ([> gtkcairo ] as 'a) Gtk.obj ->
    object
!     inherit GObj.widget
      val obj : 'a Gtk.obj
+     method connect : cairo_signals
      method event : GObj.event_ops
      method cairo : Ocairo.cairo





More information about the cairo-commit mailing list