Commits

Anonymous committed aec9574

BGroupLayout class ready.

Comments (0)

Files changed (2)

BGroupLayoutML.cpp

 
 extern "C"
 {
+CAMLprim value bgrouplayout_constructor_1(value v_orientation, value v_spacing)
+{
+	CAMLparam2(v_orientation, v_spacing);
+	BGroupLayoutML* res = new BGroupLayoutML(orientation_of_val(v_orientation), Double_val(v_spacing));
+	CAMLreturn((value)res);
+}
+CAMLprim value bgrouplayout_constructor_2(value v_from)
+{
+	CAMLparam1(v_from);
+	BGroupLayoutML* res = new BGroupLayoutML((BMessage*)v_from);
+	CAMLreturn((value)res);
+}
+CAMLprim value bgrouplayout_delete(value v_self)
+{
+	CAMLparam1(v_self);
+	delete (BGroupLayoutML*)v_self;
+	CAMLreturn(Val_unit);
+}
 CAMLprim value bgrouplayout_setItemArchived(value v_self, value v_cb)
 {
 	CAMLparam2(v_self, v_cb);
 external bgrouplayout_constructor_2 :
 	Beapi.bmessage -> Beapi.bgrouplayout =
 	"bgrouplayout_constructor_2"
+external bgrouplayout_delete :
+	Beapi.bgrouplayout -> unit =
+	"bgrouplayout_delete"
+
+external bgrouplayout_setItemArchived :
+	Beapi.bgrouplayout -> (Beapi.bmessage -> Beapi.blayoutitem -> int -> Beapi.status_t) -> unit =
+	"bgrouplayout_setItemArchived"
+external bgrouplayout_setItemUnarchived :
+	Beapi.bgrouplayout -> (Beapi.bmessage -> Beapi.blayoutitem -> int -> Beapi.status_t) -> unit =
+	"bgrouplayout_setItemUnarchived"
+external bgrouplayout_setAncestorVisibilityChanged :
+	Beapi.bgrouplayout -> (bool -> unit) -> unit =
+	"bgrouplayout_setAncestorVisibilityChanged"
+external bgrouplayout_setItemAdded :
+	Beapi.bgrouplayout -> (Beapi.blayoutitem -> int -> bool) -> unit =
+	"bgrouplayout_setItemAdded"
+external bgrouplayout_setItemRemoved :
+	Beapi.bgrouplayout -> (Beapi.blayoutitem -> int -> unit) -> unit =
+	"bgrouplayout_setItemRemoved"
+external bgrouplayout_setOwnerChanged :
+	Beapi.bgrouplayout -> (Beapi.bview -> unit) -> unit =
+	"bgrouplayout_setOwnerChanged"
+external bgrouplayout_setHasMultiColumnItems :
+	Beapi.bgrouplayout -> (unit -> bool) -> unit =
+	"bgrouplayout_setHasMultiColumnItems"
+external bgrouplayout_setHasMultiRowItems :
+	Beapi.bgrouplayout -> (unit -> bool) -> unit =
+	"bgrouplayout_setHasMultiRowItems"
+external bgrouplayout_setAttachedToLayout :
+	Beapi.bgrouplayout -> (unit -> unit) -> unit =
+	"bgrouplayout_setAttachedToLayout"
+external bgrouplayout_setDetachedFromLayout :
+	Beapi.bgrouplayout -> (Beapi.blayout -> unit) -> unit =
+	"bgrouplayout_setDetachedFromLayout"
+
+
 external bgrouplayout_Orientation :
-	Beapi.bgrouplayout -> unit =
+	Beapi.bgrouplayout -> Beapi.orientation =
 	"bgrouplayout_Orientation"
 external bgrouplayout_SetOrientation :
 	Beapi.bgrouplayout -> Beapi.orientation -> unit =
 	Beapi.bgrouplayout -> Beapi.blayoutitem -> bool =
 	"bgrouplayout_AddItem_3"
 external bgrouplayout_AddItem_4 :
-	Beapi.bgrouplayout -> int -> Beapi.blayoutitem =
+	Beapi.bgrouplayout -> int -> Beapi.blayoutitem -> bool =
 	"bgrouplayout_AddItem_4"
 external bgrouplayout_AlignLayoutWith :
 	Beapi.bgrouplayout -> Beapi.btwodimensionallayout -> Beapi.orientation -> unit =
 external bgrouplayout_PrepareItems :
 	Beapi.bgrouplayout -> Beapi.orientation -> unit =
 	"bgrouplayout_PrepareItems"
+
+
+
+
+class bgrouplayout ?orientation ?spacing ?from ?external_pointer () =
+  object (self)
+    val pointer =
+      match external_pointer with
+      | Some p -> p
+      | None ->
+          (match orientation, spacing, from with
+           | Some orientation, Some spacing, None ->
+               bgrouplayout_constructor_1 orientation spacing
+           | None, None, Some from ->
+               bgrouplayout_constructor_2 from
+           | _, _, _ -> invalid_arg "Wrong arg in BGroupLayout constructor")
+    method get_pointer = pointer
+
+    method setItemArchived cb =
+      bgrouplayout_setItemArchived pointer cb
+    method setItemUnarchived cb =
+      bgrouplayout_setItemUnarchived pointer cb
+    method setAncestorVisibilityChanged cb =
+      bgrouplayout_setAncestorVisibilityChanged pointer cb
+    method setItemAdded cb =
+      bgrouplayout_setItemAdded pointer cb
+    method setItemRemoved cb =
+      bgrouplayout_setItemRemoved pointer cb
+    method setOwnerChanged cb =
+      bgrouplayout_setOwnerChanged pointer cb
+    method setHasMultiColumnItems cb =
+      bgrouplayout_setHasMultiColumnItems pointer cb
+    method setHasMultiRowItems cb =
+      bgrouplayout_setHasMultiRowItems pointer cb
+    method setAttachedToLayout cb =
+      bgrouplayout_setAttachedToLayout pointer cb
+    method setDetachedFromLayout cb =
+      bgrouplayout_setDetachedFromLayout pointer cb
+
+    method orientation =
+      bgrouplayout_Orientation pointer
+    method set_orientation ~orientation =
+      bgrouplayout_SetOrientation pointer orientation
+    method add_view ?index ?weight ~child =
+      match index, weight with
+      | None, None -> bgrouplayout_AddView_1 pointer child
+      | Some index, None -> bgrouplayout_AddView_2 pointer index child
+      | None, Some weight -> bgrouplayout_AddView_3 pointer child weight
+      | Some index, Some weight -> bgrouplayout_AddView_4 pointer index child weight
+    method add_item ?index ?weight ~item =
+      match index, weight with
+      | None, Some weight -> bgrouplayout_AddItem_1 pointer item weight
+      | Some index, Some weight -> bgrouplayout_AddItem_2 pointer index item weight
+      | None, None -> bgrouplayout_AddItem_3 pointer item
+      | Some index, None -> bgrouplayout_AddItem_4 pointer index item
+    method align_layout_with ~other ~orientation =
+      bgrouplayout_AlignLayoutWith pointer other orientation
+    method alignment =
+      bgrouplayout_Alignment pointer
+    method archive ~into ~deep =
+      bgrouplayout_Archive pointer into deep
+    method base_alignment =
+      bgrouplayout_BaseAlignment pointer
+    method base_min_size =
+      bgrouplayout_BaseMinSize pointer
+    method base_preferred_size =
+      bgrouplayout_BasePreferredSize pointer
+    method frame =
+      bgrouplayout_Frame pointer
+(*    method getHeightForWidth =
+	Beapi.bgrouplayout -> float -> (float*float*float) =
+      bgrouplayout_GetHeightForWidth pointer
+    method get_insets =
+	Beapi.bgrouplayout -> (float*float*float*float)=
+      bgrouplayout_GetInsets pointer *)
+    method has_height_for_width =
+      bgrouplayout_HasHeightForWidth pointer
+    method invalidate_layout ~children =
+      bgrouplayout_InvalidateLayout pointer children
+    method is_visible =
+      bgrouplayout_IsVisible pointer
+    method item_weight ~index =
+      bgrouplayout_ItemWeight pointer index
+    method layout =
+      bgrouplayout_Layout pointer
+    method max_size =
+      bgrouplayout_MaxSize pointer
+    method min_size =
+      bgrouplayout_MinSize pointer
+    method preferred_size =
+      bgrouplayout_PreferredSize pointer
+    method set_explicit_alignment ~alignment =
+      bgrouplayout_SetExplicitAlignment pointer alignment
+    method set_explicit_max_size ~size =
+      bgrouplayout_SetExplicitMaxSize pointer size
+    method set_explicit_min_size ~size =
+      bgrouplayout_SetExplicitMinSize pointer size
+    method set_explicit_preferred_size ~size =
+      bgrouplayout_SetExplicitPreferredSize pointer size
+    method set_frame ~frame =
+      bgrouplayout_SetFrame pointer frame
+    method set_insets ~left ~top ~right ~bottom =
+      bgrouplayout_SetInsets pointer left top right bottom
+    method set_item_weight ~index ~weight =
+      bgrouplayout_SetItemWeight pointer index weight
+    method set_spacing ~spacing =
+      bgrouplayout_SetSpacing pointer spacing
+    method set_visible ~visible =
+      bgrouplayout_SetVisible pointer visible
+    method spacing =
+      bgrouplayout_Spacing pointer
+    method owner =
+      bgrouplayout_Owner pointer
+    method target_view =
+      bgrouplayout_TargetView pointer
+    method view =
+      bgrouplayout_View pointer
+    method remove_view ~child =
+      bgrouplayout_RemoveView pointer child
+    method remove_item ~item =
+      bgrouplayout_RemoveItem_1 pointer item
+    method remove_item_at ~index =
+      bgrouplayout_RemoveItem_2 pointer index
+    method item_at ~index =
+      bgrouplayout_ItemAt pointer index
+    method count_items =
+      bgrouplayout_CountItems pointer
+    method index_of_item ~item =
+      bgrouplayout_IndexOfItem pointer item
+    method index_of_view ~child =
+      bgrouplayout_IndexOfView pointer child
+    method relayout ~immediate =
+      bgrouplayout_Relayout pointer immediate
+    method layout_items ~force =
+      bgrouplayout_LayoutItems pointer force
+    method layout_data =
+      bgrouplayout_LayoutData pointer
+    method set_layout_data ~data =
+      bgrouplayout_SetLayoutData pointer data
+    method align_in_frame ~frame =
+      bgrouplayout_AlignInFrame pointer frame
+    method get_column_row_constraints ~orientation ~index ~constraints =
+      bgrouplayout_GetColumnRowConstraints pointer orientation index constraints
+    method get_item_dimensions ~item ~dimensions =
+      bgrouplayout_GetItemDimensions pointer item dimensions
+    method internal_count_columns =
+      bgrouplayout_InternalCountColumns pointer
+    method internal_count_rows =
+      bgrouplayout_InternalCountRows pointer
+end