Commits

Anonymous committed e510caa

Minor changes

Comments (0)

Files changed (10)

BApplicationML.cpp

 	:BApplication(signature)
 {
 	unsetHooks();
+#ifdef BAPPLICATIONML_DEBUG
 	printf("BApplication constructor 1\n");
+#endif
 }
 BApplicationML::BApplicationML(const char * signature, status_t* error)
 	:BApplication(signature, error)
 {
 	unsetHooks();
+#ifdef BAPPLICATIONML_DEBUG
 	printf("BApplication constructor 2\n");
+#endif
 }
 BApplicationML::BApplicationML(BMessage* archive)
 	:BApplication(archive)
 {
 	unsetHooks();
+#ifdef BAPPLICATIONML_DEBUG
 	printf("BApplication constructor 3\n");
+#endif
 }
 void
 BApplicationML::unsetHooks()
 void
 BApplicationML::AboutRequested()
 {
+#ifdef BAPPLICATIONML_DEBUG
 	printf("BApplication AboutRequested\n");
+#endif
 	if (closure_AboutRequested)
 	{
 		caml_callback(closure_AboutRequested, Val_unit);
 void
 BApplicationML::AppActivated(bool active)
 {
+#ifdef BAPPLICATIONML_DEBUG
 	printf("BApplication AppActivated\n");
+#endif
 	if (closure_AppActivated)
 	{
 		value arglist [] = { Val_bool(active) };
 void
 BApplicationML::ArgvReceived(int argc, char** argv)
 {
+#ifdef BAPPLICATIONML_DEBUG
 	printf("BApplication ArgvReceived\n");
+#endif
 	if (closure_ArgvReceived)
 	{
 		value arglist [] = { Val_int(argc), (value)argv };
 void
 BApplicationML::Pulse()
 {
+#ifdef BAPPLICATIONML_DEBUG
 	printf("BApplication Pulse\n");
+#endif
 	if (closure_Pulse)
 	{
 		caml_callback(closure_Pulse, Val_unit);
 bool
 BApplicationML::QuitRequested()
 {
+#ifdef BAPPLICATIONML_DEBUG
 	printf("BApplication QuitRequested\n");
+#endif
 	if (closure_QuitRequested)
 	{
 		return caml_callback(closure_QuitRequested, Val_unit);
 void
 BApplicationML::ReadyToRun()
 {
+#ifdef BAPPLICATIONML_DEBUG
 	printf("BApplication ReadyToRun\n");
+#endif
 	if (closure_ReadyToRun)
 	{
 		caml_callback(closure_ReadyToRun, Val_unit);
 void
 BApplicationML::RefsReceived(BMessage* message)
 {
+#ifdef BAPPLICATIONML_DEBUG
 	printf("BApplication RefsReceived\n");
+#endif
 	if (closure_RefsReceived)
 	{
 		value arglist [] = { (value)message };

BGroupLayoutML.cpp

-#include "BGroupLayout.h"
+#include "BGroupLayoutML.h"
 BGroupLayoutML::BGroupLayoutML(enum orientation orientation,
                         float spacing) :
 		BGroupLayout(orientation, spacing)
 	unsetHooks();
 }
 
-void unsetHooks()
+void
+BGroupLayoutML::unsetHooks()
 {
 	closure_ItemArchived = 0;
 	closure_ItemUnarchived = 0;
 		return caml_callbackN(closure_ItemArchived, 3, arglist);
 	} else
 	{
-		return BWindow::ItemArchived(into, item, index);
+		return BGroupLayout::ItemArchived(into, item, index);
 	}
 }
 void
 {
 	if (closure_ItemUnarchived)
 	{
-		value arglist [] = { (value)into, (value)item, Val_int(index) };
+		value arglist [] = { (value)from, (value)item, Val_int(index) };
 		return caml_callbackN(closure_ItemUnarchived, 3, arglist);
 	} else
 	{
-		return BWindow::ItemUnarchived(into, item, index);
+		return BGroupLayout::ItemUnarchived(from, item, index);
 	}
 }
 void
 {
 	if (closure_AncestorVisibilityChanged)
 	{
-		value arglist [] = { (value)into, (value)item, Val_int(index) };
-		caml_callbackN(closure_AncestorVisibilityChanged, 3, arglist);
+		value arglist [] = { Val_bool(shown) };
+		caml_callbackN(closure_AncestorVisibilityChanged, 1, arglist);
 	} else
 	{
-		BWindow::AncestorVisibilityChanged(into, item, index);
+		BGroupLayout::AncestorVisibilityChanged(shown);
 	}
 }
 void
-BGroupLayoutML::setAncestorVisibilityChanges(value cb)
+BGroupLayoutML::setAncestorVisibilityChanged(value cb)
 {
-	closure_AncestorVisibilityChanges = cb;
+	closure_AncestorVisibilityChanged = cb;
 }
 bool
 BGroupLayoutML::ItemAdded(BLayoutItem *item, int32 atIndex)
 {
 	if (closure_ItemAdded)
 	{
-		value arglist [] = { (value)into, (value)item, Val_int(index) };
-		return caml_callbackN(closure_ItemAdded, 3, arglist);
+		value arglist [] = { (value)item, Val_int(atIndex) };
+		return caml_callbackN(closure_ItemAdded, 2, arglist);
 	} else
 	{
-		return BWindow::ItemAdded(into, item, index);
+		return BGroupLayout::ItemAdded(item, atIndex);
 	}
 }
 void
 {
 	if (closure_ItemRemoved)
 	{
-		value arglist [] = { (value)into, (value)item, Val_int(index) };
-		caml_callbackN(closure_ItemRemoved, 3, arglist);
+		value arglist [] = { (value)item, Val_int(fromIndex) };
+		caml_callbackN(closure_ItemRemoved, 2, arglist);
 	} else
 	{
-		BWindow::ItemRemoved(into, item, index);
+		BGroupLayout::ItemRemoved(item, fromIndex);
 	}
 }
 void
 {
 	if (closure_OwnerChanged)
 	{
-		value arglist [] = { (value)into, (value)item, Val_int(index) };
-		caml_callbackN(closure_OwnerChanged, 3, arglist);
+		value arglist [] = { (value)was };
+		caml_callbackN(closure_OwnerChanged, 1, arglist);
 	} else
 	{
-		BWindow::OwnerChanged(into, item, index);
+		BGroupLayout::OwnerChanged(was);
 	}
 }
 void
 {
 	if (closure_HasMultiColumnItems)
 	{
-		value arglist [] = { (value)into, (value)item, Val_int(index) };
-		return caml_callbackN(closure_HasMultiColumnItems, 3, arglist);
+		return caml_callback(closure_HasMultiColumnItems, Val_unit);
 	} else
 	{
-		return BWindow::HasMultiColumnItems(into, item, index);
+		return BGroupLayout::HasMultiColumnItems();
 	}
 }
 void
 {
 	if (closure_HasMultiRowItems)
 	{
-		value arglist [] = { (value)into, (value)item, Val_int(index) };
-		return caml_callbackN(closure_HasMultiRowItems, 3, arglist);
+		return caml_callback(closure_HasMultiRowItems, Val_unit);
 	} else
 	{
-		return BWindow::HasMultiRowItems(into, item, index);
+		return BGroupLayout::HasMultiRowItems();
 	}
 }
 void
 {
 	if (closure_AttachedToLayout)
 	{
-		value arglist [] = { (value)into, (value)item, Val_int(index) };
-		caml_callbackN(closure_AttachedToLayout, 3, arglist);
+		caml_callback(closure_AttachedToLayout, Val_unit);
 	} else
 	{
-		BWindow::AttachedToLayout(into, item, index);
+		BGroupLayout::AttachedToLayout();
 	}
 }
 void
 {
 	if (closure_DetachedFromLayout)
 	{
-		value arglist [] = { (value)into, (value)item, Val_int(index) };
-		caml_callbackN(closure_DetachedFromLayout, 3, arglist);
+		value arglist [] = { (value)layout };
+		caml_callbackN(closure_DetachedFromLayout, 1, arglist);
 	} else
 	{
-		BWindow::DetachedFromLayout(into, item, index);
+		BGroupLayout::DetachedFromLayout(layout);
 	}
 }
 void
 	((BGroupLayoutML*)v_self)->setDetachedFromLayout(v_cb);
 	CAMLreturn(Val_unit);
 }
-CAMLprim value bgroupview_AddItem_1(value v_self, value v_item, value v_weight)
+CAMLprim value bgrouplayout_AddItem_1(value v_self, value v_item, value v_weight)
 {
 	CAMLparam3(v_self, v_item, v_weight);
-	bool res = ((BGroupLayout*)v_self)->AddItem((BLayoutItem*)v_item, Double_val(weight));
+	bool res = ((BGroupLayout*)v_self)->AddItem((BLayoutItem*)v_item, Double_val(v_weight));
 	CAMLreturn(Val_bool(res));
 }
-CAMLprim value bgroupview_AddItem_2(value v_self, value v_index, value v_item, value v_weight)
+CAMLprim value bgrouplayout_AddItem_2(value v_self, value v_index, value v_item, value v_weight)
 {
 	CAMLparam4(v_self, v_index, v_item, v_weight);
-	bool res = ((BGroupLayout*)v_self)->AddItem(Int_val(v_index), (BLayoutItem*)v_item, Double_val(weight));
+	bool res = ((BGroupLayout*)v_self)->AddItem(Int_val(v_index), (BLayoutItem*)v_item, Double_val(v_weight));
 	CAMLreturn(Val_bool(res));
 }
-CAMLprim value bgroupview_AddItem_3(value v_self, value v_item)
+CAMLprim value bgrouplayout_AddItem_3(value v_self, value v_item)
 {
 	CAMLparam2(v_self, v_item);
 	bool res = ((BGroupLayout*)v_self)->AddItem((BLayoutItem*)v_item);
 	CAMLreturn(Val_bool(res));
 }
-CAMLprim value bgroupview_AddItem_4(value v_self, value v_item)
+CAMLprim value bgrouplayout_AddItem_4(value v_self, value v_item)
 {
 	CAMLparam2(v_self, v_item);
 	bool res = ((BGroupLayout*)v_self)->AddItem((BLayoutItem*)v_item);
 	CAMLreturn(Val_bool(res));
 }
-CAMLprim value bgroupview_AddView_1(value v_self, value v_child)
+CAMLprim value bgrouplayout_AddView_1(value v_self, value v_child)
 {
 	CAMLparam2(v_self, v_child);
 	BLayoutItem* res = ((BGroupLayout*)v_self)->AddView((BView*)v_child);
 	CAMLreturn((value)res);
 }
-CAMLprim value bgroupview_AddView_2(value v_self, value v_index, value v_child)
+CAMLprim value bgrouplayout_AddView_2(value v_self, value v_index, value v_child)
 {
 	CAMLparam3(v_self, v_index, v_child);
 	BLayoutItem* res = ((BGroupLayout*)v_self)->AddView(Int_val(v_index), (BView*)v_child);
 	CAMLreturn((value)res);
 }
-CAMLprim value bgroupview_AddView_3(value v_self, value v_child, value v_weight)
+CAMLprim value bgrouplayout_AddView_3(value v_self, value v_child, value v_weight)
 {
 	CAMLparam3(v_self, v_child, v_weight);
 	BLayoutItem* res = ((BGroupLayout*)v_self)->AddView((BView*)v_child, Double_val(v_weight));
 	CAMLreturn((value)res);
 }
-CAMLprim value bgroupview_AddView_4(value v_self, value v_index, value v_child, value v_weight)
+CAMLprim value bgrouplayout_AddView_4(value v_self, value v_index, value v_child, value v_weight)
 {
 	CAMLparam4(v_self, v_index, v_child, v_weight);
 	BLayoutItem* res = ((BGroupLayout*)v_self)->AddView(Int_val(v_index), (BView*)v_child, Double_val(v_weight));
 	CAMLreturn((value)res);
 }
-void 	CAMLprim value bgroupview_AlignLayoutWith (BTwoDimensionalLayout *other, enum orientation orientation)
-BAlignment 	CAMLprim value bgroupview_Alignment ()
-status_t 	CAMLprim value bgroupview_Archive (BMessage *into, bool deep=true) const
-BAlignment 	CAMLprim value bgroupview_BaseAlignment ()
-BSize 	CAMLprim value bgroupview_BaseMinSize ()
-BSize 	CAMLprim value bgroupview_BasePreferredSize ()
-CAMLprim value bgroupview_Frame(value v_self)
+CAMLprim value bgrouplayout_AlignLayoutWith(value v_self, value v_other, value v_orientation)
+{
+	CAMLparam3(v_self, v_other, v_orientation);
+	((BGroupLayout*)v_self)->AlignLayoutWith((BTwoDimensionalLayout*)v_other, orientation_of_val(v_orientation));
+	CAMLreturn(Val_unit);
+}
+CAMLprim value bgrouplayout_Alignment(value v_self)
+{
+	CAMLparam1(v_self);
+	BAlignment pre_res = ((BGroupLayout*)v_self)->Alignment();
+	BAlignment* res = new BAlignment(pre_res);
+	CAMLreturn((value)res);
+}
+CAMLprim value bgrouplayout_Archive(value v_self, value v_into, value v_deep)
+{
+	CAMLparam3(v_self, v_into, v_deep);
+	status_t res = ((BGroupLayout*)v_self)->Archive((BMessage*)v_into, Bool_val(v_deep));
+	CAMLreturn(val_of_status_t(res));
+}
+CAMLprim value bgrouplayout_BaseAlignment(value v_self)
+{
+	CAMLparam1(v_self);
+	BAlignment pre_res = ((BGroupLayout*)v_self)->BaseAlignment();
+	BAlignment* res = new BAlignment(pre_res);
+	CAMLreturn((value)res);
+}
+CAMLprim value bgrouplayout_BaseMinSize(value v_self)
+{
+	CAMLparam1(v_self);
+	BSize pre_res = ((BGroupLayout*)v_self)->BaseMinSize();
+	BSize* res = new BSize(pre_res);
+	CAMLreturn((value)res);
+}
+CAMLprim value bgrouplayout_BasePreferredSize(value v_self)
+{
+	CAMLparam1(v_self);
+	BSize pre_res = ((BGroupLayout*)v_self)->BasePreferredSize();
+	BSize* res = new BSize(pre_res);
+	CAMLreturn((value)res);
+}
+CAMLprim value bgrouplayout_Frame(value v_self)
 {
 	CAMLparam1(v_self);
 	BRect pre_res = ((BGroupLayout*)v_self)->Frame();
 	BRect* res = new BRect(pre_res);
 	CAMLreturn((value)res);
 }
-void 	CAMLprim value bgroupview_GetHeightForWidth (float width, float *min, float *max, float *preferred)
-void 	CAMLprim value bgroupview_GetInsets (float *left, float *top, float *right, float *bottom) const
-bool 	CAMLprim value bgroupview_HasHeightForWidth ()
-void 	CAMLprim value bgroupview_InvalidateLayout (bool children=false)
-bool 	CAMLprim value bgroupview_IsVisible ()
-float 	CAMLprim value bgroupview_ItemWeight (int32 index) const
-BLayout * 	CAMLprim value bgroupview_Layout () const
-BSize 	CAMLprim value bgroupview_MaxSize ()
-BSize 	CAMLprim value bgroupview_MinSize ()
-orientation 	CAMLprim value bgroupview_Orientation () const
-status_t 	CAMLprim value bgroupview_Perform (perform_code d, void *arg)
-BSize 	CAMLprim value bgroupview_PreferredSize ()
-void 	CAMLprim value bgroupview_SetExplicitAlignment (BAlignment alignment)
-void 	CAMLprim value bgroupview_SetExplicitMaxSize (BSize size)
-void 	CAMLprim value bgroupview_SetExplicitMinSize (BSize size)
-void 	CAMLprim value bgroupview_SetExplicitPreferredSize (BSize size)
-void 	CAMLprim value bgroupview_SetFrame (BRect frame)
-void 	CAMLprim value bgroupview_SetInsets (float left, float top, float right, float bottom)
-void 	CAMLprim value bgroupview_SetItemWeight (int32 index, float weight)
-void 	CAMLprim value bgroupview_SetSpacing (float spacing)
-void 	CAMLprim value bgroupview_SetVisible (bool visible)
-float 	CAMLprim value bgroupview_Spacing () const
-BView * 	CAMLprim value bgroupview_Owner () const
-BView * 	CAMLprim value bgroupview_TargetView () const
-BView * 	CAMLprim value bgroupview_View ()
-bool 	CAMLprim value bgroupview_RemoveView (BView *child)
-bool 	CAMLprim value bgroupview_RemoveItem_1 (BLayoutItem *item)
-BLayoutItem * 	CAMLprim value bgroupview_RemoveItem_2 (int32 index)
-BLayoutItem * 	CAMLprim value bgroupview_ItemAt (int32 index) const
-int32 	CAMLprim value bgroupview_CountItems () const
-int32 	CAMLprim value bgroupview_IndexOfItem (const BLayoutItem *item) const
-int32 	CAMLprim value bgroupview_IndexOfView (BView *child) const
-void 	CAMLprim value bgroupview_Relayout (bool immediate=false)
-void 	CAMLprim value bgroupview_LayoutItems (bool force=false)
-void * 	CAMLprim value bgroupview_LayoutData () const
-void 	CAMLprim value bgroupview_SetLayoutData (void *data)
-void 	CAMLprim value bgroupview_AlignInFrame (BRect frame)
-void 	CAMLprim value bgroupview_DerivedLayoutItems ()
-void 	CAMLprim value bgroupview_GetColumnRowConstraints (enum orientation orientation, int32 index, ColumnRowConstraints *constraints)
-void 	CAMLprim value bgroupview_GetItemDimensions (BLayoutItem *item, Dimensions *dimensions)
-int32 	CAMLprim value bgroupview_InternalCountColumns ()
-int32 	CAMLprim value bgroupview_InternalCountRows ()
-CAMLprim value bgroupview_PrepareItems(value v_self, value v_orientation)
+/*void 	CAMLprim value bgrouplayout_GetHeightForWidth (float width, float *min, float *max, float *preferred)
+void 	CAMLprim value bgrouplayout_GetInsets (float *left, float *top, float *right, float *bottom) const*/
+CAMLprim value bgrouplayout_HasHeightForWidth(value v_self)
+{
+	CAMLparam1(v_self);
+	bool res = ((BGroupLayout*)v_self)->HasHeightForWidth();
+	CAMLreturn(Val_bool(res));
+}
+//void 	CAMLprim value bgrouplayout_InvalidateLayout (bool children=false)
+//bool 	CAMLprim value bgrouplayout_IsVisible ()
+//float 	CAMLprim value bgrouplayout_ItemWeight (int32 index) const
+//BLayout * 	CAMLprim value bgrouplayout_Layout () const
+CAMLprim value bgrouplayout_MaxSize(value v_self)
+{
+	CAMLparam1(v_self);
+	BSize pre_res = ((BGroupLayout*)v_self)->MaxSize();
+	BSize* res = new BSize(pre_res);
+	CAMLreturn((value)res);
+}
+CAMLprim value bgrouplayout_MinSize(value v_self)
+{
+	CAMLparam1(v_self);
+	BSize pre_res = ((BGroupLayout*)v_self)->MinSize();
+	BSize* res = new BSize(pre_res);
+	CAMLreturn((value)res);
+}
+CAMLprim value bgrouplayout_Orientation(value v_self)
+{
+	CAMLparam1(v_self);
+	orientation res = ((BGroupLayout*)v_self)->Orientation();
+	CAMLreturn(val_of_orientation(res));
+}
+//status_t 	CAMLprim value bgrouplayout_Perform (perform_code d, void *arg)
+CAMLprim value bgrouplayout_PreferredSize(value v_self)
+{
+	CAMLparam1(v_self);
+	BSize pre_res = ((BGroupLayout*)v_self)->PreferredSize();
+	BSize* res = new BSize(pre_res);
+	CAMLreturn((value)res);
+}
+//void 	CAMLprim value bgrouplayout_SetExplicitAlignment (BAlignment alignment)
+//void 	CAMLprim value bgrouplayout_SetExplicitMaxSize (BSize size)
+//void 	CAMLprim value bgrouplayout_SetExplicitMinSize (BSize size)
+//void 	CAMLprim value bgrouplayout_SetExplicitPreferredSize (BSize size)
+CAMLprim value bgrouplayout_SetFrame(value v_self, value v_frame)
+{
+	CAMLparam2(v_self, v_frame);
+	((BGroupLayout*)v_self)->SetFrame(*(BRect*)v_frame);
+	CAMLreturn(Val_unit);
+}
+//void 	CAMLprim value bgrouplayout_SetInsets (float left, float top, float right, float bottom)
+//void 	CAMLprim value bgrouplayout_SetItemWeight (int32 index, float weight)
+//void 	CAMLprim value bgrouplayout_SetSpacing (float spacing)
+//void 	CAMLprim value bgrouplayout_SetVisible (bool visible)
+//float 	CAMLprim value bgrouplayout_Spacing () const
+//BView * 	CAMLprim value bgrouplayout_Owner () const
+//BView * 	CAMLprim value bgrouplayout_TargetView () const
+//BView * 	CAMLprim value bgrouplayout_View ()
+//bool 	CAMLprim value bgrouplayout_RemoveView (BView *child)
+//bool 	CAMLprim value bgrouplayout_RemoveItem_1 (BLayoutItem *item)
+//BLayoutItem * 	CAMLprim value bgrouplayout_RemoveItem_2 (int32 index)
+//BLayoutItem * 	CAMLprim value bgrouplayout_ItemAt (int32 index) const
+//int32 	CAMLprim value bgrouplayout_CountItems () const
+//int32 	CAMLprim value bgrouplayout_IndexOfItem (const BLayoutItem *item) const
+//int32 	CAMLprim value bgrouplayout_IndexOfView (BView *child) const
+//void 	CAMLprim value bgrouplayout_Relayout (bool immediate=false)
+//void 	CAMLprim value bgrouplayout_LayoutItems (bool force=false)
+CAMLprim value bgrouplayout_LayoutData(value v_self)
+{
+	CAMLparam1(v_self);
+	void* res = ((BGroupLayout*)v_self)->LayoutData();
+	CAMLreturn((value)res);
+}
+CAMLprim value bgrouplayout_SetLayoutData(value v_self, value v_data)
+{
+	CAMLparam2(v_self, v_data);
+	((BGroupLayout*)v_self)->SetLayoutData((void*)v_data);
+	CAMLreturn(Val_unit);
+}
+CAMLprim value bgrouplayout_AlignInFrame(value v_self, value v_frame)
+{
+	CAMLparam2(v_self, v_frame);
+	((BGroupLayout*)v_self)->AlignInFrame(*(BRect*)v_frame);
+	CAMLreturn(Val_unit);
+}
+/*PROTECTED CAMLprim value bgrouplayout_DerivedLayoutItems(value v_self)
+{
+	CAMLparam1(v_self);
+	((BGroupLayout*)v_self)->DerivedLayoutItems();
+	CAMLreturn(Val_unit);
+}*/
+//void 	CAMLprim value bgrouplayout_GetColumnRowConstraints (enum orientation orientation, int32 index, ColumnRowConstraints *constraints)
+//void 	CAMLprim value bgrouplayout_GetItemDimensions (BLayoutItem *item, Dimensions *dimensions)
+//int32 	CAMLprim value bgrouplayout_InternalCountColumns ()
+/* PROTECTED CAMLprim value bgrouplayout_InternalCountRows(value v_self)
+{
+	CAMLparam1(v_self);
+	int32 res = ((BGroupLayout*)v_self)->InternalCountRows();
+	CAMLreturn(Val_int(res));
+}
+CAMLprim value bgrouplayout_PrepareItems(value v_self, value v_orientation)
 {
 	CAMLparam2(v_self, v_orientation);
 	((BGroupLayout*)v_self)->PrepareItems(orientation_of_val(v_orientation));
 	CAMLreturn(Val_unit);
+}*/
 }
-}
 public:
 	BGroupLayoutML(enum orientation orientation,
 			float spacing);
-	BGroupLayout(BMessage* from);
-	virtual		~BGroupLayout();
+	BGroupLayoutML(BMessage* from);
+	~BGroupLayoutML();
 
-	virtual status_t ItemArchived(BMessage *into, BLayoutItem *item, int32 index) const;
+	status_t ItemArchived(BMessage *into, BLayoutItem *item, int32 index) const;
 	void setItemArchived(value cb);
-	virtual status_t ItemUnarchived(const BMessage *from, BLayoutItem *item, int32 index);
+	status_t ItemUnarchived(const BMessage *from, BLayoutItem *item, int32 index);
 	void setItemUnarchived(value cb);
-	virtual void AncestorVisibilityChanged(bool shown);
-	void setAncestorVisibilityChanges(value cb);
-	virtual bool 	ItemAdded (BLayoutItem *item, int32 atIndex)
+	void AncestorVisibilityChanged(bool shown);
+	void setAncestorVisibilityChanged(value cb);
+	bool ItemAdded (BLayoutItem *item, int32 atIndex);
 	void setItemAdded(value cb);
-	virtual void 	ItemRemoved (BLayoutItem *item, int32 fromIndex)
+	void ItemRemoved (BLayoutItem *item, int32 fromIndex);
 	void setItemRemoved(value cb);
-	virtual void 	OwnerChanged (BView *was)
+	void OwnerChanged (BView *was);
 	void setOwnerChanged(value cb);
 
-	virtual bool HasMultiColumnItems();
+	bool HasMultiColumnItems();
 	void setHasMultiColumnItems(value cb);
-	virtual bool HasMultiRowItems();
+	bool HasMultiRowItems();
 	void setHasMultiRowItems(value cb);
-	virtual void AttachedToLayout();
+	void AttachedToLayout();
 	void setAttachedToLayout(value cb);
-	virtual void DetachedFromLayout(BLayout *layout);
+	void DetachedFromLayout(BLayout *layout);
 	void setDetachedFromLayout(value cb);
+
+	void unsetHooks();
 private:
 	value closure_ItemArchived;
 	value closure_ItemUnarchived;
 	:BView(frame, name, resizingMode, flags)
 {
 	unsetHooks();
+#ifdef BVIEWML_DEBUG
 	printf("BView constructor 1\n");
+#endif
 }
 BViewML::BViewML(BMessage* archive)
 	:BView(archive)
 {
 	unsetHooks();
+#ifdef BVIEWML_DEBUG
 	printf("BView constructor 2\n");
+#endif
 }
 void
 BViewML::unsetHooks()
 void
 BViewML::AttachedToWindow()
 {
+#ifdef BVIEWML_DEBUG
 	printf("BView AttachedToWindow\n");
+#endif
 	if (closure_AttachedToWindow)
 	{
 		caml_callback(closure_AttachedToWindow, Val_unit);
 void
 BViewML::AllAttached()
 {
+#ifdef BVIEWML_DEBUG
 	printf("BView AllAttached\n");
+#endif
 	if (closure_AllAttached)
 	{
 		caml_callback(closure_AllAttached, Val_unit);
 void
 BViewML::DetachedFromWindow()
 {
+#ifdef BVIEWML_DEBUG
 	printf("BView DetachedFromWindow\n");
+#endif
 	if (closure_DetachedFromWindow)
 	{
 		caml_callback(closure_DetachedFromWindow, Val_unit);
 void
 BViewML::AllDetached()
 {
+#ifdef BVIEWML_DEBUG
 	printf("BView AllDetached\n");
+#endif
 	if (closure_AllDetached)
 	{
 		caml_callback(closure_AllDetached, Val_unit);
 void
 BViewML::Draw(BRect updateRect)
 {
+#ifdef BVIEWML_DEBUG
 	printf("BView Draw\n");
+#endif
 	if (closure_Draw)
 	{
 		value arglist [] = { (value)&updateRect };
 	:BWindow(frame, title, type, flags, workspaces)
 {
 	unsetHooks();
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow constructor 1\n");
+#endif
 }
 BWindowML::BWindowML(BRect frame, const char * title, window_look look, window_feel feel, int flags, int workspaces)
 	:BWindow(frame, title, look, feel, flags, workspaces)
 {
 	unsetHooks();
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow constructor 2\n");
+#endif
 }
 BWindowML::BWindowML(BMessage* archive)
 	:BWindow(archive)
 {
 	unsetHooks();
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow constructor 3\n");
+#endif
 }
 void
 BWindowML::unsetHooks()
 void
 BWindowML::FrameMoved(BPoint* origin)
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow FrameMoved\n");
+#endif
 	if (closure_FrameMoved)
 	{
 		value arglist [] = { (value)origin };
 void
 BWindowML::FrameResized(float width, float height)
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow FrameResized\n");
+#endif
 	if (closure_FrameResized)
 	{
 		value arglist [] = { caml_copy_double(width), caml_copy_double(height) };
 void
 BWindowML::MenusBeginning()
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow MenusBeginnig\n");
+#endif
 	if (closure_MenusBeginning)
 	{
 		caml_callback(closure_MenusBeginning, Val_unit);
 void
 BWindowML::MenusEnded()
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow MenusEnded\n");
+#endif
 	if (closure_MenusEnded)
 	{
 		caml_callback(closure_MenusEnded, Val_unit);
 void
 BWindowML::MessageReceived(BMessage* message)
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow MessageReceived\n");
+#endif
 	if (closure_MessageReceived)
 	{
 		value arglist [] = { (value)message };
 void
 BWindowML::ScreenChanged(BRect frame, color_space mode)
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow ScreenChanged\n");
+#endif
 	if (closure_ScreenChanged)
 	{
 		value arglist [] = { (value)&frame, (value)mode };
 void
 BWindowML::WindowActivated(bool active)
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow WindowActivated\n");
+#endif
 	if (closure_WindowActivated)
 	{
 		value arglist [] = { Val_bool(active) };
 void
 BWindowML::WorkspaceActivated(int workspace, bool active)
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow WorkspaceActivated\n");
+#endif
 	if (closure_WorkspaceActivated)
 	{
 		value arglist [] = { Val_int(workspace), Val_bool(active) };
 void
 BWindowML::WorkspacesChanged(int oldWorkspaces, int newWorkspaces)
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow WorkspacesChanged\n");
+#endif
 	if (closure_WorkspacesChanged)
 	{
 		value arglist [] = { Val_int(oldWorkspaces), Val_int(newWorkspaces) };
 void
 BWindowML::Zoom()
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow Zoom 1\n");
+#endif
 	if (closure_Zoom_1)
 	{
 		caml_callback(closure_Zoom_1, Val_unit);
 void
 BWindowML::Zoom(BPoint origin, float width, float height)
 {
+#ifdef BWINDOWML_DEBUG
 	printf("BWindow Zoom 2\n");
+#endif
 	if (closure_Zoom_2)
 	{
 		value arglist [] = { (value)&origin, (value)width, (value)height };
 	default: return B_TITLED_WINDOW;
 	}
 }
+orientation orientation_of_val(value v_orientation)
+{
+	switch(Int_val(v_orientation))
+	{
+	case 0: return B_HORIZONTAL;
+	case 1: return B_VERTICAL;
+	}
+}
+value val_of_orientation(orientation v_orientation)
+{
+	switch(v_orientation)
+	{
+	case B_HORIZONTAL: return Val_int(0);
+	case B_VERTICAL: return Val_int(1);
+	}
+}
+status_t status_t_of_val(value v_status)
+{
+	return Int_val(v_status);
+}
+value val_of_status_t(value v_status)
+{
+	return Val_int(v_status);
+}
 #ifndef BEAPIML_H
 #define BEAPIML_H
 #include <interface/Button.h>
+#include <interface/GroupLayout.h>
 #include <interface/Screen.h>
 #include <interface/View.h>
 #include <interface/Window.h>
 button_width button_width_of_val(value v_width);
 value val_of_button_width(button_width width);
 window_type window_type_of_val(value v_type);
+orientation orientation_of_val(value v_orientation);
+value val_of_orientation(orientation v_orientation);
+value val_of_status_t(status_t v_status);
+status_t status_t_of_val(value v_status);
 
 #endif
 	ocamlmklib -o bWindow bWindow.cmx
 
 hello_world : all
-	ocamlopt -I . -cclib -lroot -cclib -lbe bWindow.cmxa bView.cmxa bTabView.cmxa bTab.cmxa bRect.cmxa bButton.cmxa bMessage.cmxa bApplication.cmxa beapi.cmxa caller.ml -o caller.opt
+	ocamlopt -I . -cclib -lroot -cclib -lbe bWindow.cmxa bView.cmxa bTabView.cmxa bTab.cmxa bRect.cmxa bGroupLayout.cmxa bButton.cmxa bMessage.cmxa bApplication.cmxa beapi.cmxa caller.ml -o caller.opt
 	Beapi.bmessage -> Beapi.bgrouplayout =
 	"bgrouplayout_constructor_2"
 external bgrouplayout_Orientation :
-	Beapi.bgrouplayout -> Beapi.orientation -> unit =
+	Beapi.bgrouplayout -> unit =
 	"bgrouplayout_Orientation"
 external bgrouplayout_SetOrientation :
-	Beapi.bgrouplayout -> =
+	Beapi.bgrouplayout -> Beapi.orientation -> unit =
 	"bgrouplayout_SetOrientation"
 external bgrouplayout_AddView_1 :
 	Beapi.bgrouplayout -> Beapi.bview -> Beapi.blayoutitem =
 type pointer
 
+type balignment
 type bapplication
 type bbitmap
 type bbutton
 type bfile
 type bflattenable
 type bfont
+type bgrouplayout
 type bhandler
+type blayout
+type blayoutitem
 type bmenu
 type bmenubar
 type bmessage
 type bpoint
 type brect
 type bregion
+type bsize
 type bstring
 type btab
 type btabview
 type btextview
+type btwodimensionallayout
 type bview
 type bwindow
 
 	| B_CMY32
 	| B_CMYA32
 	| B_CMYK32
+type column_row_constraints
+type dimensions
 type entry_ref
+type orientation =
+	| B_HORIZONTAL
+	| B_VERTICAL
 type rgb_color
 type status_t
 type ssize_t