[cairo-commit] cairo-ocaml/src cairo_gtkcairo.ml, NONE, 1.1 cairo_gtkcairo.mli, NONE, 1.1 cairo_lablgtk.ml, NONE, 1.1 Makefile, 1.4, 1.5 cairo_lablgtk.mli, 1.1.1.1, 1.2 ocairo.ml, 1.6, NONE ocairo.mli, 1.6, NONE ocairo_gtkcairo.ml, 1.2, NONE ocairo_gtkcairo.mli, 1.2, NONE ocairo_lablgtk.ml, 1.1.1.1, NONE ocairo_lablgtk.mli, 1.1.1.1, NONE

Olivier Andrieu commit at pdx.freedesktop.org
Wed Mar 24 02:39:27 PST 2004


Committed by: oandrieu

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

Modified Files:
	Makefile cairo_lablgtk.mli 
Added Files:
	cairo_gtkcairo.ml cairo_gtkcairo.mli cairo_lablgtk.ml 
Removed Files:
	ocairo.ml ocairo.mli ocairo_gtkcairo.ml ocairo_gtkcairo.mli 
	ocairo_lablgtk.ml ocairo_lablgtk.mli 
Log Message:
removed OO API

--- NEW FILE: cairo_gtkcairo.ml ---

type gtkcairo = [Gtk.widget | `gtkcairo]

external gtkcairo_init : unit -> unit = "ml_cairo_gtkcairo_init"
let init = gtkcairo_init ()

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 = get_cairo obj
    method queue_draw =
      GtkBase.Widget.queue_draw obj
  end

let cairo =
  GtkBase.Widget.size_params []
    ~cont:(fun pl ?packing ?show () ->
      GObj.pack_return 
	(new cairo (GtkObject.make "GtkCairo" pl))
	~packing ~show)

--- NEW FILE: cairo_gtkcairo.mli ---
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 : Cairo.t
    method queue_draw : unit
  end

val cairo :
  ?width:int ->
  ?height:int ->
  ?packing:(GObj.widget -> unit) ->
  ?show:bool ->
  unit -> cairo

--- NEW FILE: cairo_lablgtk.ml ---

external image_of_pixbuf : GdkPixbuf.pixbuf -> Cairo.image = "cairo_lablgtk_of_pixbuf"
external shuffle_pixels  : GdkPixbuf.pixbuf -> unit = "cairo_lablgtk_shuffle_pixels"

external surface_create_for_drawable : 
    [> `drawable] Gobject.obj ->
    Cairo.format -> Cairo.surface = "cairo_lablgtk_surface_create_for_drawable"
external set_target_drawable :
    Cairo.t -> [> `drawable] Gobject.obj -> unit 
      = "cairo_lablgtk_set_target_drawable"

let create ?target () =
  let c = Cairo.create () in
  begin match target with
  | None -> ()
  | Some d -> set_target_drawable c d end ;
  c

Index: Makefile
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** a/Makefile	22 Feb 2004 22:41:26 -0000	1.4
--- b/Makefile	24 Mar 2004 10:39:24 -0000	1.5
***************
*** 24,28 ****
  cairo_SRC = cairo_channel.mli cairo.mli cairo.ml \
              cairo_bigarray.mli cairo_bigarray.ml \
-             ocairo.mli ocairo.ml \
  	    ml_cairo_status.c ml_cairo_channel.c \
              ml_cairo.c ml_cairo_bigarr.c ml_cairo_path.c
--- 24,27 ----
***************
*** 35,40 ****
  	$(OCAMLMKLIB) -o cairo -oc mlcairo $^ $(CAIRO_LIBS)
  
! lablgtk_SRC = cairo_lablgtk.mli ocairo_lablgtk.mli ocairo_lablgtk.ml \
!               ml_cairo_lablgtk.c
  
  cairo_lablgtk.cma : $(call mlobjs,$(lablgtk_SRC))
--- 34,38 ----
  	$(OCAMLMKLIB) -o cairo -oc mlcairo $^ $(CAIRO_LIBS)
  
! lablgtk_SRC = cairo_lablgtk.mli cairo_lablgtk.ml ml_cairo_lablgtk.c
  
  cairo_lablgtk.cma : $(call mlobjs,$(lablgtk_SRC))
***************
*** 45,49 ****
  	$(OCAMLMKLIB) -o cairo_lablgtk -oc mlcairo_lablgtk $^
  
! gtkcairo_SRC = ocairo_gtkcairo.mli ocairo_gtkcairo.ml ml_cairo_gtkcairo.c
  
  gtkcairo.cma : $(call mlobjs,$(gtkcairo_SRC))
--- 43,47 ----
  	$(OCAMLMKLIB) -o cairo_lablgtk -oc mlcairo_lablgtk $^
  
! gtkcairo_SRC = cairo_gtkcairo.mli cairo_gtkcairo.ml ml_cairo_gtkcairo.c
  
  gtkcairo.cma : $(call mlobjs,$(gtkcairo_SRC))
***************
*** 75,83 ****
              ln -s $(INSTALLDIR)/$$lib $(DESTDIR)$(OCAMLLIB)/stublibs ; done ; fi
  
! DOCFILES = cairo_channel.mli cairo.mli ocairo.mli cairo_bigarray.mli
  ifdef LABLGTKDIR
! DOCFILES += cairo_lablgtk.mli ocairo_lablgtk.mli
  ifdef GTKCAIRO_CFLAGS
! DOCFILES += ocairo_gtkcairo.mli
  endif
  endif
--- 73,81 ----
              ln -s $(INSTALLDIR)/$$lib $(DESTDIR)$(OCAMLLIB)/stublibs ; done ; fi
  
! DOCFILES = cairo_channel.mli cairo.mli cairo_bigarray.mli
  ifdef LABLGTKDIR
! DOCFILES += cairo_lablgtk.mli
  ifdef GTKCAIRO_CFLAGS
! DOCFILES += cairo_gtkcairo.mli
  endif
  endif

Index: cairo_lablgtk.mli
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/cairo_lablgtk.mli,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** a/cairo_lablgtk.mli	18 Nov 2003 19:02:26 -0000	1.1.1.1
--- b/cairo_lablgtk.mli	24 Mar 2004 10:39:24 -0000	1.2
***************
*** 9,10 ****
--- 9,12 ----
      Cairo.t -> [> `drawable] Gobject.obj -> unit 
        = "cairo_lablgtk_set_target_drawable"
+ 
+ val create : ?target:[> `drawable] Gobject.obj -> unit -> Cairo.t

--- ocairo.ml DELETED ---

--- ocairo.mli DELETED ---

--- ocairo_gtkcairo.ml DELETED ---

--- ocairo_gtkcairo.mli DELETED ---

--- ocairo_lablgtk.ml DELETED ---

--- ocairo_lablgtk.mli DELETED ---





More information about the cairo-commit mailing list