Commits

Reid van Melle committed 6da23a0

Major progress with various automatic conversions; also wrapper several fixed-point routines

  • Participants
  • Parent commits f5330c4

Comments (0)

Files changed (15)

+- implement struct types for points, colors, vertices, knots
 - inherit container interface methods
 - inherit actor methods
 - switch to more vanilla ocaml makefile
 examples/pong.native
 examples/ripples.native
 tests/test-effect.native
-#tests/test-project.native
+tests/test-project.native
 <clutterEnums.*> or <clutterProps.*> or <oclutterProps.*>: use_gtk
 <pangolibEnums.*>: use_gtk
 <clutterEllipse.*> or <clutterTimeline.*> or <clutterData.*>: use_gtk
-<clutter.*>: use_gtk
+<clutter.*> or <structs.*>: use_gtk
 <ml_clutter.*>: use_gtk2
 <ml_texture.*>: use_gtk2
 

clutter/clutter.ml

 type 'a obj = 'a Gobject.obj
 type +'a event
 (*type color*)
-type geometry
 type coords
 type coglhandle
+type vertex = {vx:int; vy:int; vz:int}
+type actorbox = {x1:int; y1:int; x2:int; y2:int}
+type knot = {x:int; y:int}
+type geometry = {left:int; top:int; width:int; height:int}
 
 type actor =    [`actor]
 type container = [`container]
     fun sgn ~callback -> GtkSignal.connect obj ~sgn ~after ~callback
 end
     
-module Geometry = struct
-  type t
-end;;
-
-(** ClutterVertex object *)
-module Vertex = struct
-  type t
-  external x : t -> int = "ml_clutter_vertex_get_x"
-  external y : t -> int = "ml_clutter_vertex_get_y"
-  external z : t -> int = "ml_clutter_vertex_get_z"
-  external set_x : t -> int -> unit = "ml_clutter_vertex_set_x"
-  external set_y : t -> int -> unit = "ml_clutter_vertex_set_y"
-  external set_z : t -> int -> unit = "ml_clutter_vertex_set_z"
-  external create : x:int -> y:int -> z:int -> t = "ml_clutter_vertex_new"
-end;;
-
-class vertex obj = object
-  method as_vertex : Vertex.t = obj
-  method x = Vertex.x obj
-  method y = Vertex.y obj
-  method z = Vertex.z obj    
-  method set_x = Vertex.set_x obj
-  method set_y = Vertex.set_y obj
-  method set_z = Vertex.set_z obj
-end
-
-let vertex ~x ~y ~z =
-  let k = Vertex.create ~x ~y ~z in
-  new vertex k
-
-(** ClutterActorBox object *)
-module ActorBox = struct
-  type t
-end;;
-    
-(**
-   ClutterKnot wrapper object
-*)
-module Knot = struct
-  type t
-  external x : t -> int = "ml_clutter_knot_get_x"
-  external y : t -> int = "ml_clutter_knot_get_y"
-  external set_x : t -> int -> unit = "ml_clutter_knot_set_x"
-  external set_y : t -> int -> unit = "ml_clutter_knot_set_y"
-  external create : x:int -> y:int -> t = "ml_clutter_knot_new"
-end;;
-
-class knot obj = object
-  method as_knot : Knot.t = obj
-  method x = Knot.x obj
-  method y = Knot.y obj
-  method set_x = Knot.set_x obj
-  method set_y = Knot.set_y obj
-end
-
-let knot ~x ~y =
-  let k = Knot.create ~x ~y in
-  new knot k
 
 (**
    ClutterColor wrapper object
 *)
 module Color = struct
-  type t
+  type t = Gpointer.boxed
   external red : t -> int = "ml_clutter_color_get_red"
   external green : t -> int = "ml_clutter_color_get_green"
   external blue : t -> int = "ml_clutter_color_get_blue"
     let c = create ~red ~green ~blue ~alpha in
     new color c
 
+  let as_color (c : color) = c#as_color
+  let wrap_color w = new color w
+  let unwrap_color w = w#as_color
+  (*let conv_color_option =
+    { kind = `POINTER;
+      proj = (function `POINTER c -> may_map ~f:wrap_color c
+		| _ -> failwith "GObj.get_object");
+      inj = (fun c -> `POINTER (may_map ~f:unwrap_color c)) }*)
+  let conv_color =
+    { Gobject.kind = `POINTER;
+      proj = (function `POINTER (Some c) -> wrap_color c
+		| `POINTER None -> raise Gpointer.Null
+		| _ -> failwith "GObj.get_object");
+      inj = (fun c -> `POINTER (Some (unwrap_color c))) }
+      
 end;;
 
 module Alpha = struct

clutter/clutter.props

 }
 
 conversions {
+  ClutterUnit "int"
+  ClutterKnot "Structs.conv_knot"
+  ClutterColor "Clutter.Color.conv_color"
 }
 
 boxed {
   ClutterEvent "Clutter.Event.any"
-  ClutterVertex "Clutter.Vertex.t"
-  ClutterGeometry "Clutter.Geometry.t"
-  ClutterColor "Clutter.Color.t"
-  ClutterKnot "Clutter.Knot.t"
+  ClutterVertex "Clutter.vertex"
+  ClutterGeometry "Clutter.geometry"
+  (*ClutterColor "Clutter.Color.t"*)
+  (*ClutterKnot "Clutter.knot"*)
+  ClutterActorBox "Clutter.actorbox"
 }
 
 classes {
   ClutterStage "Clutter.stage obj"
   ClutterGroup "Clutter.group obj"
 }
-(*   ClutterAlpha "Clutter.alpha obj"
-  ClutterBehaviour "Clutter.behaviour obj"
-  ClutterTimeline "Clutter.timeline obj" *)
 
 class Actor abstract set wrap wrapsig : Object {
+  "allocation"               ClutterActorBox       : Read
+  "anchor-x"                 gint                  : Read / Write
+  "anchor-y"                 gint                  : Read / Write
   "clip"                     ClutterGeometry       : Read / Write
   "depth"                    gint                  : Read / Write
+  "fixed-position-set"       gboolean              : Read / Write
+  "fixed-x"                  ClutterUnit           : Read / Write
+  "fixed-y"                  ClutterUnit           : Read / Write
   "has-clip"                 gboolean              : Read
   "height"                   gint                  : Read / Write
+  "min-height"               ClutterUnit           : Read / Write
+  "min-height-set"           gboolean              : Read / Write
+  "min-width"                ClutterUnit           : Read / Write
+  "min-width-set"            gboolean              : Read / Write
   "name"                     string                : Read / Write
+  "natural-height"           ClutterUnit           : Read / Write
+  "natural-height-set"       gboolean              : Read / Write
+  "natural-width"            ClutterUnit           : Read / Write
+  "natural-width-set"        gboolean              : Read / Write
   "opacity"                  guchar                : Read / Write
   "reactive"                 gboolean              : Read / Write
+  "request-mode"             ClutterRequestMode    : Read / Write
   "rotation-angle-x"         gdouble               : Read / Write
   "rotation-angle-y"         gdouble               : Read / Write
   "rotation-angle-z"         gdouble               : Read / Write
   "rotation-center-z"        ClutterVertex         : Read / Write
   "scale-x"                  gdouble               : Read / Write
   "scale-y"                  gdouble               : Read / Write
+  "show-on-set-parent"       gboolean              : Read / Write
   "visible"                  gboolean              : Read / Write
   "width"                    gint                  : Read / Write
   "x"                        gint                  : Read / Write
   "y"                        gint                  : Read / Write
-  signal button_press_event : ClutterEvent (* gpointer *) -> bool
-  signal button_release_event : ClutterEvent (*gpointer*) -> bool
-  signal captured_event : ClutterEvent (*gpointer*) -> bool
-  signal destroy : (*gpointer*)
+  signal button_press_event : ClutterEvent -> bool
+  signal button_release_event : ClutterEvent -> bool
+  signal captured_event : ClutterEvent -> bool
+  signal destroy
   signal enter_event : ClutterEvent -> bool
   signal event : ClutterEvent -> bool
   signal focus_in : ClutterActor
   method get_stage : "Clutter.actor"
   method set_scale : "xscale:float -> yscale:float -> unit"
   method is_scaled : "bool"
-  method apply_transform_to_point : "Clutter.Vertex.t -> Clutter.Vertex.t -> unit"
+  method apply_transform_to_point : "Clutter.vertex -> Clutter.vertex -> unit"
   method transform_stage_point : "x:int -> y:int -> (int*int)"
-  method apply_relative_transform_to_point : "ancestor:Clutter.actor -> point:Clutter.Vertex.t -> vertex:Clutter.Vertex.t -> unit"
+  method apply_relative_transform_to_point : "ancestor:Clutter.actor -> point:Clutter.vertex -> vertex:Clutter.vertex -> unit"
   method get_transformed_position : "int*int"
   method get_transformed_size : "int*int"
   method get_paint_opacity : "int"
-  method get_abs_allocation_vertices : "Clutter.Vertex.t * Clutter.Vertex.t * Clutter.Vertex.t * Clutter.Vertex.t"
-  method box_get_from_vertices : "Clutter.Vertex.t -> Clutter.Vertex.t -> Clutter.Vertex.t -> Clutter.Vertex.t -> Clutter.ActorBox.t"
+  method get_abs_allocation_vertices : "Clutter.vertex * Clutter.vertex * Clutter.vertex * Clutter.vertex"
+  method box_get_from_vertices : "Clutter.vertex -> Clutter.vertex -> Clutter.vertex -> Clutter.vertex -> Clutter.actorbox"
   method set_anchor_point : "x:int -> y:int -> unit"
   method get_anchor_point : "int*int"
   method set_anchor_point_from_gravity : "ClutterEnums.gravity_type -> unit"

clutter/clutterActor.ml

   method set_anchor_point_from_gravity =
     Actor.set_anchor_point_from_gravity obj
   method as_actor = obj
-  (*method apply_transform_to_point = Actor.apply_transform_to_point obj
+  method apply_transform_to_point = Actor.apply_transform_to_point obj
   method get_abs_allocation_vertices = Actor.get_abs_allocation_vertices obj
-  method raise_top = Actor.raise_top obj*)
+  method raise_top = Actor.raise_top obj
   method show = Actor.show obj
   method show_all = Actor.show_all obj
   method set_position = Actor.set_position obj

clutter/clutterEllipse.ml

 end
 
 let make_ellipse ~create ~cx ~cy =
-  let knot = Knot.create ~x:cx ~y:cy in
+  (*let knot = Structs.Knot.create ~x:cx ~y:cy in*)
+  let knot = {Clutter.x=cx; y=cy} in
   BehaviourEllipse.make_params ~center:knot ~cont:
+  (*BehaviourEllipse.make_params ~cont:*)
     (fun pl () ->
        let (e : #ellipse_skel) = create pl in
        e)

clutter/clutterProps.ml

 
 module PrivateProps = struct
   let alpha = {name="alpha"; conv=(gobject : Clutter.alpha obj data_conv)}
-  let color =
-    {name="color"; conv=(unsafe_pointer : Clutter.Color.t data_conv)}
+  let color = {name="color"; conv=Clutter.Color.conv_color}
   let height = {name="height"; conv=int}
   let width = {name="width"; conv=int}
 end
 module Actor = struct
   let cast w : Clutter.actor obj = try_cast w "ClutterActor"
   module P = struct
+    let allocation : ([>`actor],_) property =
+      {name="allocation"; conv=(unsafe_pointer : Clutter.actorbox data_conv)}
+    let anchor_x : ([>`actor],_) property = {name="anchor-x"; conv=int}
+    let anchor_y : ([>`actor],_) property = {name="anchor-y"; conv=int}
     let clip : ([>`actor],_) property =
-      {name="clip"; conv=(unsafe_pointer : Clutter.Geometry.t data_conv)}
+      {name="clip"; conv=(unsafe_pointer : Clutter.geometry data_conv)}
     let depth : ([>`actor],_) property = {name="depth"; conv=int}
+    let fixed_position_set : ([>`actor],_) property =
+      {name="fixed-position-set"; conv=boolean}
+    let fixed_x : ([>`actor],_) property = {name="fixed-x"; conv=int}
+    let fixed_y : ([>`actor],_) property = {name="fixed-y"; conv=int}
     let has_clip : ([>`actor],_) property = {name="has-clip"; conv=boolean}
     let height : ([>`actor],_) property = PrivateProps.height
+    let min_height : ([>`actor],_) property = {name="min-height"; conv=int}
+    let min_height_set : ([>`actor],_) property =
+      {name="min-height-set"; conv=boolean}
+    let min_width : ([>`actor],_) property = {name="min-width"; conv=int}
+    let min_width_set : ([>`actor],_) property =
+      {name="min-width-set"; conv=boolean}
     let name : ([>`actor],_) property = {name="name"; conv=string}
+    let natural_height : ([>`actor],_) property =
+      {name="natural-height"; conv=int}
+    let natural_height_set : ([>`actor],_) property =
+      {name="natural-height-set"; conv=boolean}
+    let natural_width : ([>`actor],_) property =
+      {name="natural-width"; conv=int}
+    let natural_width_set : ([>`actor],_) property =
+      {name="natural-width-set"; conv=boolean}
     let opacity : ([>`actor],_) property = {name="opacity"; conv=uchar}
     let reactive : ([>`actor],_) property = {name="reactive"; conv=boolean}
     let rotation_angle_x : ([>`actor],_) property =
       {name="rotation-angle-z"; conv=double}
     let rotation_center_x : ([>`actor],_) property =
       {name="rotation-center-x";
-       conv=(unsafe_pointer : Clutter.Vertex.t data_conv)}
+       conv=(unsafe_pointer : Clutter.vertex data_conv)}
     let rotation_center_y : ([>`actor],_) property =
       {name="rotation-center-y";
-       conv=(unsafe_pointer : Clutter.Vertex.t data_conv)}
+       conv=(unsafe_pointer : Clutter.vertex data_conv)}
     let rotation_center_z : ([>`actor],_) property =
       {name="rotation-center-z";
-       conv=(unsafe_pointer : Clutter.Vertex.t data_conv)}
+       conv=(unsafe_pointer : Clutter.vertex data_conv)}
     let scale_x : ([>`actor],_) property = {name="scale-x"; conv=double}
     let scale_y : ([>`actor],_) property = {name="scale-y"; conv=double}
+    let show_on_set_parent : ([>`actor],_) property =
+      {name="show-on-set-parent"; conv=boolean}
     let visible : ([>`actor],_) property = {name="visible"; conv=boolean}
     let width : ([>`actor],_) property = PrivateProps.width
     let x : ([>`actor],_) property = {name="x"; conv=int}
     = "ml_clutter_actor_set_scale"
   external is_scaled : [>`actor] obj -> bool = "ml_clutter_actor_is_scaled"
   external apply_transform_to_point :
-    [>`actor] obj -> Clutter.Vertex.t -> Clutter.Vertex.t -> unit
+    [>`actor] obj -> Clutter.vertex -> Clutter.vertex -> unit
     = "ml_clutter_actor_apply_transform_to_point"
   external transform_stage_point :
     [>`actor] obj -> x:int -> y:int -> (int*int)
     = "ml_clutter_actor_transform_stage_point"
   external apply_relative_transform_to_point :
     [>`actor] obj ->
-    ancestor:Clutter.actor -> point:Clutter.Vertex.t -> vertex:Clutter.Vertex.t -> unit
+    ancestor:Clutter.actor -> point:Clutter.vertex -> vertex:Clutter.vertex -> unit
     = "ml_clutter_actor_apply_relative_transform_to_point"
   external get_transformed_position : [>`actor] obj -> int*int
     = "ml_clutter_actor_get_transformed_position"
     = "ml_clutter_actor_get_paint_opacity"
   external get_abs_allocation_vertices :
     [>`actor] obj ->
-    Clutter.Vertex.t * Clutter.Vertex.t * Clutter.Vertex.t * Clutter.Vertex.t
+    Clutter.vertex * Clutter.vertex * Clutter.vertex * Clutter.vertex
     = "ml_clutter_actor_get_abs_allocation_vertices"
   external box_get_from_vertices :
     [>`actor] obj ->
-    Clutter.Vertex.t -> Clutter.Vertex.t -> Clutter.Vertex.t -> Clutter.Vertex.t -> Clutter.ActorBox.t
+    Clutter.vertex -> Clutter.vertex -> Clutter.vertex -> Clutter.vertex -> Clutter.actorbox
     = "ml_clutter_actor_box_get_from_vertices"
   external set_anchor_point : [>`actor] obj -> x:int -> y:int -> unit
     = "ml_clutter_actor_set_anchor_point"
   external set_anchor_point_from_gravity :
     [>`actor] obj -> ClutterEnums.gravity_type -> unit
     = "ml_clutter_actor_set_anchor_point_from_gravity"
-  let make_params ~cont pl ?clip ?depth ?height ?name ?opacity ?reactive
-      ?rotation_angle_x ?rotation_angle_y ?rotation_angle_z
+  let make_params ~cont pl ?anchor_x ?anchor_y ?clip ?depth
+      ?fixed_position_set ?fixed_x ?fixed_y ?height ?min_height
+      ?min_height_set ?min_width ?min_width_set ?name ?natural_height
+      ?natural_height_set ?natural_width ?natural_width_set ?opacity
+      ?reactive ?rotation_angle_x ?rotation_angle_y ?rotation_angle_z
       ?rotation_center_x ?rotation_center_y ?rotation_center_z ?scale_x
-      ?scale_y ?visible ?width ?x ?y =
+      ?scale_y ?show_on_set_parent ?visible ?width ?x ?y =
     let pl = (
+      may_cons P.anchor_x anchor_x (
+      may_cons P.anchor_y anchor_y (
       may_cons P.clip clip (
       may_cons P.depth depth (
+      may_cons P.fixed_position_set fixed_position_set (
+      may_cons P.fixed_x fixed_x (
+      may_cons P.fixed_y fixed_y (
       may_cons P.height height (
+      may_cons P.min_height min_height (
+      may_cons P.min_height_set min_height_set (
+      may_cons P.min_width min_width (
+      may_cons P.min_width_set min_width_set (
       may_cons P.name name (
+      may_cons P.natural_height natural_height (
+      may_cons P.natural_height_set natural_height_set (
+      may_cons P.natural_width natural_width (
+      may_cons P.natural_width_set natural_width_set (
       may_cons P.opacity opacity (
       may_cons P.reactive reactive (
       may_cons P.rotation_angle_x rotation_angle_x (
       may_cons P.rotation_center_z rotation_center_z (
       may_cons P.scale_x scale_x (
       may_cons P.scale_y scale_y (
+      may_cons P.show_on_set_parent show_on_set_parent (
       may_cons P.visible visible (
       may_cons P.width width (
       may_cons P.x x (
-      may_cons P.y y pl)))))))))))))))))) in
+      may_cons P.y y pl)))))))))))))))))))))))))))))))) in
     cont pl
 end
 
   let cast w : Clutter.rectangle obj = try_cast w "ClutterRectangle"
   module P = struct
     let border_color : ([>`rectangle],_) property =
-      {name="border-color";
-       conv=(unsafe_pointer : Clutter.Color.t data_conv)}
+      {name="border-color"; conv=Clutter.Color.conv_color}
     let border_width : ([>`rectangle],_) property =
       {name="border-width"; conv=uint}
     let color : ([>`rectangle],_) property = PrivateProps.color
     let angle_tilt_z : ([>`behaviourellipse],_) property =
       {name="angle-tilt-z"; conv=double}
     let center : ([>`behaviourellipse],_) property =
-      {name="center"; conv=(unsafe_pointer : Clutter.Knot.t data_conv)}
+      {name="center"; conv=Structs.conv_knot}
     let direction : ([>`behaviourellipse],_) property =
       {name="direction"; conv=ClutterEnums.rotate_direction_type_conv}
     let height : ([>`behaviourellipse],_) property = PrivateProps.height

clutter/ml_actor.c

     ml_global_root_destroy(clos);
 }
 
+CAMLprim value ml_clutter_actor_get_abs_allocation_vertices(value _a) {
+  CAMLparam1(_a);
+  CAMLlocal5(result,v1,v2,v3,v4);
+  ClutterActor* a = ClutterActor_val(_a);
+  ClutterVertex    v[4];  
+  clutter_actor_get_abs_allocation_vertices (a, v);
+  result = caml_alloc(4,0);
+  v1 = caml_alloc(3,0);
+  v2 = caml_alloc(3,0);
+  v3 = caml_alloc(3,0);
+  v4 = caml_alloc(3,0);
+  value*          values[4] = {&v1,&v2,&v3,&v4};
+  Store_field(result, 0, v1);
+  Store_field(result, 1, v2);
+  Store_field(result, 2, v3);
+  Store_field(result, 3, v4);
+  int i;
+  for (i=0; i<4; i++) {
+    Store_field(*values[i], 0, Val_int(v[i].x));
+    Store_field(*values[i], 1, Val_int(v[i].y));
+    Store_field(*values[i], 2, Val_int(v[i].z));
+  }
+  CAMLreturn(result);
+}
+
+CAMLprim value ml_clutter_actor_apply_transform_to_point(value _a, value _point, value _vertex) {
+  CAMLparam3(_a, _point, _vertex);
+  ClutterActor* a = ClutterActor_val(_a);
+  ClutterVertex point = { Triple(_point, Int_val, Int_val, Int_val) };
+  ClutterVertex vertex = { Triple(_vertex, Int_val, Int_val, Int_val) };
+  clutter_actor_apply_transform_to_point(a, &point, &vertex);
+  CAMLreturn(Val_unit);
+}
+
+ML_1(clutter_actor_raise_top, ClutterActor_val, Unit);
 ML_1(clutter_actor_show_all, ClutterActor_val, Unit);
 ML_1(clutter_actor_show, ClutterActor_val, Unit);
 ML_1(clutter_actor_get_width, ClutterActor_val, Val_int);

clutter/ml_clutter.c

 #define GObject_val(val) ((GObject*)Pointer_val(val))
 ML_1 (g_object_ref, GObject_val, Unit)
 
+// FIXED
+
+double clutter_fixed_to_float(int x) { return CLUTTER_FIXED_TO_FLOAT(x); }
+int clutter_fixed_to_int(int x) { return CLUTTER_FIXED_TO_INT(x); }
+int clutter_int_to_fixed(int x) { return CLUTTER_INT_TO_FIXED(x); }
+ML_1(clutter_fixed_to_float, Int_val, copy_double);
+ML_1(clutter_fixed_to_int, Int_val, Val_int);
+ML_1(clutter_int_to_fixed, Int_val, Val_int);
+
 // ClutterVertex
 #define ClutterVertex_val(val) ((ClutterVertex *)Pointer_val(val))
 #define Val_ClutterVertex(val) (Val_pointer(val))

clutter/oclutterProps.ml

 
 class virtual actor_props = object (self)
   method private virtual obj : _ obj
+  method set_anchor_x = set Actor.P.anchor_x self#obj
+  method set_anchor_y = set Actor.P.anchor_y self#obj
   method set_clip = set Actor.P.clip self#obj
   method set_depth = set Actor.P.depth self#obj
+  method set_fixed_position_set = set Actor.P.fixed_position_set self#obj
+  method set_fixed_x = set Actor.P.fixed_x self#obj
+  method set_fixed_y = set Actor.P.fixed_y self#obj
   method set_height = set Actor.P.height self#obj
+  method set_min_height = set Actor.P.min_height self#obj
+  method set_min_height_set = set Actor.P.min_height_set self#obj
+  method set_min_width = set Actor.P.min_width self#obj
+  method set_min_width_set = set Actor.P.min_width_set self#obj
   method set_name = set Actor.P.name self#obj
+  method set_natural_height = set Actor.P.natural_height self#obj
+  method set_natural_height_set = set Actor.P.natural_height_set self#obj
+  method set_natural_width = set Actor.P.natural_width self#obj
+  method set_natural_width_set = set Actor.P.natural_width_set self#obj
   method set_opacity = set Actor.P.opacity self#obj
   method set_reactive = set Actor.P.reactive self#obj
   method set_rotation_angle_x = set Actor.P.rotation_angle_x self#obj
   method set_rotation_center_z = set Actor.P.rotation_center_z self#obj
   method set_scale_x = set Actor.P.scale_x self#obj
   method set_scale_y = set Actor.P.scale_y self#obj
+  method set_show_on_set_parent = set Actor.P.show_on_set_parent self#obj
   method set_visible = set Actor.P.visible self#obj
   method set_width = set Actor.P.width self#obj
   method set_x = set Actor.P.x self#obj
   method set_y = set Actor.P.y self#obj
+  method allocation = get Actor.P.allocation self#obj
+  method anchor_x = get Actor.P.anchor_x self#obj
+  method anchor_y = get Actor.P.anchor_y self#obj
   method clip = get Actor.P.clip self#obj
   method depth = get Actor.P.depth self#obj
+  method fixed_position_set = get Actor.P.fixed_position_set self#obj
+  method fixed_x = get Actor.P.fixed_x self#obj
+  method fixed_y = get Actor.P.fixed_y self#obj
   method has_clip = get Actor.P.has_clip self#obj
   method height = get Actor.P.height self#obj
+  method min_height = get Actor.P.min_height self#obj
+  method min_height_set = get Actor.P.min_height_set self#obj
+  method min_width = get Actor.P.min_width self#obj
+  method min_width_set = get Actor.P.min_width_set self#obj
   method name = get Actor.P.name self#obj
+  method natural_height = get Actor.P.natural_height self#obj
+  method natural_height_set = get Actor.P.natural_height_set self#obj
+  method natural_width = get Actor.P.natural_width self#obj
+  method natural_width_set = get Actor.P.natural_width_set self#obj
   method opacity = get Actor.P.opacity self#obj
   method reactive = get Actor.P.reactive self#obj
   method rotation_angle_x = get Actor.P.rotation_angle_x self#obj
   method rotation_center_z = get Actor.P.rotation_center_z self#obj
   method scale_x = get Actor.P.scale_x self#obj
   method scale_y = get Actor.P.scale_y self#obj
+  method show_on_set_parent = get Actor.P.show_on_set_parent self#obj
   method visible = get Actor.P.visible self#obj
   method width = get Actor.P.width self#obj
   method x = get Actor.P.x self#obj

clutter/wrappers.h

 
 /* Use with care: needs the argument index */
 #define Ignore(x)
+#define Insert(x) (x),
+#define Split(x,f,g) f(x), g(x) Ignore
+#define Split3(x,f,g,h) f(x), g(x), h(x) Ignore
+#define Pair(x,f,g) f(Field(x,0)), g(Field(x,1)) Ignore
+#define Triple(x,f,g,h) f(Field(x,0)), g(Field(x,1)), h(Field(x,2))
 
 #define Make_Extractor(name,conv1,field,conv2) \
 CAMLprim value ml_##name##_##field (value val) \

examples/actor1.ml

 
 open Printf
+open Clutter
   
 let _ =
   let stage = ClutterStage.get_default () in
   actor#set_position ~x:100 ~y:100;
   actor#set_rotation `Z_AXIS ~angle:180. ~x:(actor#width / 2)
     ~y:(actor#height / 2) ~z:0;
+  let v1,v2,v3,v4 = stage#get_abs_allocation_vertices in
+  printf "v1.x=%d v1.y=%d v1.z=%d\n%!" v1.vx v1.vy v1.vz;
+  printf "v2.x=%d v2.y=%d v2.z=%d\n%!" v2.vx v2.vy v2.vz;
+  printf "v3.x=%d v3.y=%d v3.z=%d\n%!" v3.vx v3.vy v3.vz;
+  printf "v4.x=%d v4.y=%d v4.z=%d\n%!" v4.vx v4.vy v4.vz;
   stage#show_all;
   Clutter.main ()
   

tests/test-effect.ml

 let _ =
   let stage_color = Color.rgba (0xcc,0xcc,0xcc,0xff) in
   let rect_color = Color.rgba (0,0,0,0xdd) in
+  let red = Color.rgba (0xff,0,0,0xff) in
 
   let timeline = ClutterTimeline.timeline ~duration:5000 () in
   timeline#set_loop true;
 
   let _ = stage#connect#button_press_event
     (fun _ -> printf "got a button press\n%!"; Clutter.quit (); true) in
-  stage#set_color stage_color#as_color;
+  stage#set_color stage_color;
   stage#set_use_fog true;
   stage#set_size ~width:800 ~height:600;
   stage#show_all;
 
   let actor = ClutterRectangle.rectangle ~width:50 ~height:50 ~x:50 ~y:10
-    ~color:rect_color#obj () in
+    ~color:rect_color () in
   stage#add_actor actor#as_actor; (* container operation *)
 
   let _ = tmpl#fade actor#as_actor 0x22
   actor#show;
   
 
-  let actor = ClutterRectangle.rectangle ~color:rect_color#obj ~width:50
+  let actor = ClutterRectangle.rectangle ~color:rect_color ~width:50
     ~height:50 ~x:750 ~y:70 () in
   stage#add_actor actor#as_actor;
   let _ = tmpl#depth actor#as_actor ~depth:(-500)
     ~done_cb:(fun _ -> printf "depth done\n%!") in
   actor#show;
 
-  let actor = ClutterRectangle.rectangle ~color:rect_color#obj ~width:50
+  let actor = ClutterRectangle.rectangle ~color:rect_color ~width:50
     ~height:50 ~x:50 ~y:140 () in
   stage#add_actor actor#as_actor;
   let _ = tmpl#move actor#as_actor ~x:750 ~y:140
     ~done_cb:(fun _ -> printf "move done\n%!") in
   actor#show;
 
-  let actor = ClutterRectangle.rectangle ~color:rect_color#obj ~width:50
+  let actor = ClutterRectangle.rectangle ~color:red ~width:50
     ~height:50 ~x:750 ~y:210 () in
   stage#add_actor actor#as_actor;
   let _ = tmpl#path actor#as_actor ~knots:[|(750,210); (350,210)|]
     ~done_cb:(fun _ -> printf "path done\n%!") in
   actor#show;
 
-  let actor = ClutterRectangle.rectangle ~color:rect_color#obj ~width:50
+  let actor = ClutterRectangle.rectangle ~color:rect_color ~width:50
     ~height:50 ~x:50 ~y:280 () in
   stage#add_actor actor#as_actor;
   actor#set_anchor_point_from_gravity `GRAVITY_CENTER;
     ~done_cb:(fun _ -> printf "scale done\n%!") in
   actor#show;
 
-  let actor = ClutterRectangle.rectangle ~color:rect_color#obj ~width:50
+  let actor = ClutterRectangle.rectangle ~color:rect_color ~width:50
     ~height:50 ~x:750 ~y:350 () in
   stage#add_actor actor#as_actor;
   let _ = tmpl#rotate actor#as_actor ~axis:`Z_AXIS ~angle:180.

tests/test-project.ml

   let v1,v2,v3,v4 = rect#get_abs_allocation_vertices in
   let points = List.map
     (fun v ->
-       let r = ClutterRectangle.rectangle ~color:blue#obj ~width:5 ~height:5
+       let r = ClutterRectangle.rectangle ~color:blue ~width:5 ~height:5
 	 ~x:0 ~y:0 () in
        group#add r#as_actor;
-       r#set_position ~x:((Fixed.to_int v#x) - r#width / 2)
-	 ~y:((Fixed.to_int v#y) - r#height / 2);
+       r#set_position ~x:((Fixed.to_int v.vx) - r#width / 2)
+	 ~y:((Fixed.to_int v.vy) - r#height / 2);
        r#raise_top;
        r#show;
        r
     ) [v1;v2;v3;v4] in
-  v1#set_x (Fixed.from_int (rect#width / 2));
-  v1#set_y (Fixed.from_int (rect#height / 2));
-  v1#set_z 0;
+  let v1 = { vx = (Fixed.from_int (rect#width / 2));
+	     vy = (Fixed.from_int (rect#height / 2));
+	     vz = 0 } in
 
-  rect#apply_transform_to_point v1#obj v2#obj;
-  let r = ClutterRectangle.rectangle ~color:blue#obj ~width:5 ~height:5 ~x:0
+  rect#apply_transform_to_point v1 v2;
+  let r = ClutterRectangle.rectangle ~color:blue ~width:5 ~height:5 ~x:0
     ~y:0 () in
   group#add r#as_actor;
-  r#set_position ~x:((Fixed.to_int v2#x) - r#width / 2)
-    ~y:((Fixed.to_int v2#y) - r#height / 2);
+  r#set_position ~x:((Fixed.to_int v2.vx) - r#width / 2)
+    ~y:((Fixed.to_int v2.vy) - r#height / 2);
   r#raise_top;
   r#show;
   Array.of_list (List.append points [r])
   Array.iteri
     (fun i v ->
        let r = points.(i) in
-       r#set_position ~x:((Fixed.to_int v#x) - r#width / 2)
-	 ~y:((Fixed.to_int v#y) - r#height / 2)
+       r#set_position ~x:((Fixed.to_int v.vx) - r#width / 2)
+	 ~y:((Fixed.to_int v.vy) - r#height / 2)
     ) vertices;
-  v1#set_x (Fixed.from_int (rect#width / 2));
-  v1#set_y (Fixed.from_int (rect#height / 2));
-  v1#set_z 0;
-  rect#apply_transform_to_point v1#obj v2#obj;
+  let v1 = { vx = (Fixed.from_int (rect#width / 2));
+	     vy = (Fixed.from_int (rect#height / 2));
+	     vz = 0 } in
+  rect#apply_transform_to_point v1 v2;
   let r = points.(4) in
-  points.(4)#set_position ~x:((Fixed.to_int v2#x) - r#width / 2)
-    ~y:((Fixed.to_int v2#y) - r#height / 2)
+  points.(4)#set_position ~x:((Fixed.to_int v2.vx) - r#width / 2)
+    ~y:((Fixed.to_int v2.vy) - r#height / 2)
   
 let on_event rect points stage =
   let dragging = ref None in
   and white = Color.rgba (0xff, 0xff, 0xff, 0xff) in
 
   let main_stage = ClutterStage.get_default () in
-  main_stage#set_color stage_color#obj;
+  main_stage#set_color stage_color;
   main_stage#set_size ~width:640 ~height:480;
   
-  let rect = ClutterRectangle.rectangle ~color:white#obj
+  let rect = ClutterRectangle.rectangle ~color:white
     ~width:320 ~height:240 ~x:180 ~y:120 () in
   rect#set_rotation `Y_AXIS ~angle:60. ~x:0 ~y:0 ~z:0;
   main_stage#add_actor rect#as_actor;
 
   let label = ClutterLabel.label ~font_name:"Mono 8pt"
-    ~text:"Drag the blue rectangles" ~color:white#obj ~x:10 ~y:10 () in
+    ~text:"Drag the blue rectangles" ~color:white ~x:10 ~y:10 () in
   
   main_stage#add_actor label#as_actor;