Commits

Anonymous committed 8afd942

BTextView class ready

  • Participants
  • Parent commits 5966f0f

Comments (0)

Files changed (12)

File BButtonML.cpp

 	unsetHooks();
 	printf("BButton constructor 1\n");
 }
+BButtonML::BButtonML(const char * name, const char * label, BMessage* message, int flags)
+	:BButton(name, label, message, flags)
+{
+	unsetHooks();
+	printf("BButton constructor 2\n");
+}
+BButtonML::BButtonML(const char * label, BMessage* message)
+	:BButton(label, message)
+{
+	unsetHooks();
+	printf("BButton constructor 1\n");
+}
 BButtonML::BButtonML(BMessage* archive)
 	:BButton(archive)
 {
 {
 	return bbutton_constructor_1_native(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
 }
-CAMLprim value bbutton_constructor_2(value v_archive)
+CAMLprim value bbutton_constructor_2(value v_name, value v_label, value v_message, value v_flags)
+{
+	CAMLparam4(v_name, v_label, v_message, v_flags);
+	BButtonML *res = new BButtonML(String_val(v_name), String_val(v_label), (BMessage*)v_message, view_flags_of_val(v_flags));
+	CAMLreturn((value)res);
+}
+CAMLprim value bbutton_constructor_3(value v_label, value v_message)
+{
+	CAMLparam2(v_label, v_message);
+	BButtonML *res = new BButtonML(String_val(v_label), (BMessage*)v_message);
+	CAMLreturn((value)res);
+}
+CAMLprim value bbutton_constructor_4(value v_archive)
 {
 	CAMLparam1(v_archive);
 	BButtonML *res = new BButtonML((BMessage*)v_archive);

File BButtonML.hpp

 {
 public:
 	BButtonML(BRect frame,const char * name,const char * label,BMessage* message,int resizingMode,int flags);
+	BButtonML(const char* name, const char* label, BMessage* message, int flags);
+	BButtonML(const char* label, BMessage* message);
 	BButtonML(BMessage* archive);
 	void AttachedToWindow();
 	void setAttachedToWindow(value cb_AttachedToWindow);

File BTextViewML.cpp

 {
 	unsetHooks();
 }
+BTextViewML::BTextViewML(const char * name, int flags)
+	:BTextView(name, flags)
+{
+	unsetHooks();
+}
+BTextViewML::BTextViewML(const char * name, BFont* font, rgb_color* color, int flags)
+	:BTextView(name, font, color, flags)
+{
+	unsetHooks();
+}
 BTextViewML::BTextViewML(BMessage* archive)
 	:BTextView(archive)
 {
 CAMLprim value btextview_constructor_1(value v_frame, value v_name, value v_textRect, value v_resizingMode, value v_flags)
 {
 	CAMLparam5(v_frame, v_name, v_textRect, v_resizingMode, v_flags);
-	BTextViewML *res = new BTextViewML(*((BRect*)v_frame), String_val(v_name), *((BRect*)v_textRect), Int_val(v_resizingMode), Int_val(v_flags));
+	BTextViewML *res = new BTextViewML(*((BRect*)v_frame), String_val(v_name), *((BRect*)v_textRect), resizingMode_of_val(v_resizingMode), view_flags_of_val(v_flags));
 	CAMLreturn((value)res);
 }
 CAMLprim value btextview_constructor_2_native(value v_frame, value v_name, value v_textRect, value v_font, value v_color, value v_resizingMode, value v_flags)
 {
 	CAMLparam5(v_frame, v_name, v_textRect, v_font, v_color);
 	CAMLxparam2(v_resizingMode, v_flags);
-	BTextViewML *res = new BTextViewML(*((BRect*)v_frame), String_val(v_name), *((BRect*)v_textRect), (BFont*)v_font, (rgb_color*)v_color, Int_val(v_resizingMode), Int_val(v_flags));
+	BTextViewML *res = new BTextViewML(*((BRect*)v_frame), String_val(v_name), *((BRect*)v_textRect), (BFont*)v_font, (rgb_color*)v_color, resizingMode_of_val(v_resizingMode), view_flags_of_val(v_flags));
 	CAMLreturn((value)res);
 }
 CAMLprim value btextview_constructor_2_bytecode(value* argv, int argn)
 {
 	return btextview_constructor_2_native(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]);
 }
-CAMLprim value btextview_constructor_3(value v_archive)
+CAMLprim value btextview_constructor_3(value v_name, value v_flags)
+{
+	CAMLparam2(v_name, v_flags);
+	BTextViewML *res = new BTextViewML(String_val(v_name), view_flags_of_val(v_flags));
+	CAMLreturn((value)res);
+}
+CAMLprim value btextview_constructor_4(value v_name, value v_font, value v_color, value v_flags)
+{
+	CAMLparam4(v_name, v_font, v_color, v_flags);
+	BTextViewML *res = new BTextViewML(String_val(v_name), (BFont*)v_font, (rgb_color*)v_color, view_flags_of_val(v_flags));
+	CAMLreturn((value)res);
+}
+CAMLprim value btextview_constructor_5(value v_archive)
 {
 	CAMLparam1(v_archive);
 	BTextViewML *res = new BTextViewML((BMessage*)v_archive);

File BTextViewML.hpp

 #ifndef BTEXTVIEWML_H
 #define BTEXTVIEWML_H
 #include <interface/TextView.h>
-#include "HaikuML.h"
+#include "BeapiML.hpp"
 extern "C" {
 #include "HaikuML.h"
 }
 public:
 	BTextViewML(BRect frame,const char * name,BRect textRect,int resizingMode,int flags);
 	BTextViewML(BRect frame,const char * name,BRect textRect,BFont* font,rgb_color* color,int resizingMode,int flags);
+	BTextViewML(const char* name, int flags);
+	BTextViewML(const char* name, BFont* font, rgb_color* color, int flags);
 	BTextViewML(BMessage* archive);
 	void AttachedToWindow();
 	void setAttachedToWindow(value cb_AttachedToWindow);

File BWindowML.cpp

 CAMLprim value bwindow_constructor_1(value v_frame, value v_title, value v_type, value v_flags, value v_workspaces)
 {
 	CAMLparam5(v_frame, v_title, v_type, v_flags, v_workspaces);
-	BWindowML *res = new BWindowML(*((BRect*)v_frame), String_val(v_title), window_type_of_val(v_type), /*Int_val(v_flags)*/0, B_CURRENT_WORKSPACE/*Int_val(v_workspaces)*/);
+	BWindowML *res = new BWindowML(*((BRect*)v_frame), String_val(v_title), window_type_of_val(v_type), view_flags_of_val(v_flags), B_CURRENT_WORKSPACE/*Int_val(v_workspaces)*/);
 	CAMLreturn((value)res);
 }
 CAMLprim value bwindow_constructor_2_native(value v_frame, value v_title, value v_look, value v_feel, value v_flags, value v_workspaces)
 {
 	CAMLparam5(v_frame, v_title, v_look, v_feel, v_flags);
 	CAMLxparam1(v_workspaces);
-	BWindowML *res = new BWindowML(*((BRect*)v_frame), String_val(v_title), (window_look)v_look, (window_feel)v_feel, Int_val(v_flags), Int_val(v_workspaces));
+	BWindowML *res = new BWindowML(*((BRect*)v_frame), String_val(v_title), (window_look)v_look, (window_feel)v_feel, view_flags_of_val(v_flags), Int_val(v_workspaces));
 	CAMLreturn((value)res);
 }
 CAMLprim value bwindow_constructor_2_bytecode(value* argv, int argn)
 	CAMLparam1(v_tabview);
 	CAMLreturn((value)((BView*)((BTabView*)v_tabview)));
 }
+CAMLprim value bview_of_btextview(value v_textview)
+{
+	CAMLparam1(v_textview);
+	CAMLreturn((value)((BView*)((BTextView*)v_textview)));
+}
 CAMLprim value blayout_of_bgrouplayout(value v_layout)
 {
 	CAMLparam1(v_layout);
 #include <interface/Button.h>
 #include <interface/GroupLayout.h>
 #include <interface/Screen.h>
+#include <interface/TextView.h>
 #include <interface/View.h>
 #include <interface/Window.h>
 extern "C" {
 	ocamlmklib -o bWindow bWindow.cmx
 
 hello_world : all
-	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
+	ocamlopt -I . -cclib -lroot -cclib -lbe bWindow.cmxa bView.cmxa bTextView.cmxa bTabView.cmxa bTab.cmxa bRect.cmxa bGroupLayout.cmxa bButton.cmxa bMessage.cmxa bApplication.cmxa beapi.cmxa caller.ml -o caller.opt
 	"bbutton_constructor_1_bytecode"
 	"bbutton_constructor_1_native"
 external bbutton_constructor_2 :
+	string -> string -> Beapi.bmessage -> int -> Beapi.bbutton =
+	"bbutton_constructor_2"
+external bbutton_constructor_3 :
+	string -> Beapi.bmessage -> Beapi.bbutton =
+	"bbutton_constructor_3"
+external bbutton_constructor_4 :
 	Beapi.bmessage -> Beapi.bbutton =
-	"bbutton_constructor_2"
+	"bbutton_constructor_4"
 external bbutton_setAttachedToWindow :
 	Beapi.bbutton -> 'a -> unit =
 	"bbutton_setAttachedToWindow"
 	let bbutton ?archive ?frame ?label ?resizingMode ?message ?flags ?name () =
 		match archive, frame, label, resizingMode, message, flags, name with
 		| None, Some frame, Some label, Some resizingMode, Some message, Some flags, Some name -> bbutton_constructor_1 frame name label message resizingMode flags
-		| Some archive, None, None, None, None, None, None -> bbutton_constructor_2 archive
+		| None, None, Some label, None, Some message, Some flags, Some name -> bbutton_constructor_2 name label message flags
+		| None, None, Some label, None, Some message, None, None -> bbutton_constructor_3 label message
+		| Some archive, None, None, None, None, None, None -> bbutton_constructor_4 archive
 		| _, _, _, _, _, _, _ -> invalid_arg "Wrong arg in BButton.constructor"
 
 

File bTextView.ml

 	"btextview_constructor_2_bytecode"
 	"btextview_constructor_2_native"
 external btextview_constructor_3 :
+	string -> int -> Beapi.btextview =
+	"btextview_constructor_3"
+external btextview_constructor_4 :
+	string -> Beapi.bfont -> Beapi.rgb_color -> int -> Beapi.btextview =
+	"btextview_constructor_4"
+external btextview_constructor_5 :
 	Beapi.bmessage -> Beapi.btextview =
-	"btextview_constructor_3"
+	"btextview_constructor_5"
 external btextview_setAttachedToWindow :
-	Beapi.btextview -> 'a -> unit =
+	Beapi.btextview -> (unit -> unit) -> unit =
 	"btextview_setAttachedToWindow"
 external btextview_setDetachedFromWindow :
-	Beapi.btextview -> 'a -> unit =
+	Beapi.btextview -> (unit -> unit) -> unit =
 	"btextview_setDetachedFromWindow"
 external btextview_setDraw :
-	Beapi.btextview -> 'a -> unit =
+	Beapi.btextview -> (Beapi.brect -> unit) -> unit =
 	"btextview_setDraw"
 external btextview_setFrameResized :
-	Beapi.btextview -> 'a -> unit =
+	Beapi.btextview -> (float -> float -> unit) -> unit =
 	"btextview_setFrameResized"
 external btextview_setKeyDown :
-	Beapi.btextview -> 'a -> unit =
+	Beapi.btextview -> (string -> int -> unit) -> unit =
 	"btextview_setKeyDown"
 external btextview_setMessageReceived :
-	Beapi.btextview -> 'a -> unit =
+	Beapi.btextview -> (Beapi.bmessage -> unit) -> unit =
 	"btextview_setMessageReceived"
 external btextview_setMouseDown :
-	Beapi.btextview -> 'a -> unit =
+	Beapi.btextview -> (Beapi.bpoint -> unit) -> unit =
 	"btextview_setMouseDown"
 external btextview_setMouseMoved :
-	Beapi.btextview -> 'a -> unit =
+	Beapi.btextview -> (Beapi.bpoint -> int -> Beapi.bmessage -> unit) -> unit =
 	"btextview_setMouseMoved"
 external btextview_setPulse :
-	Beapi.btextview -> 'a -> unit =
+	Beapi.btextview -> (unit -> unit) -> unit =
 	"btextview_setPulse"
 external btextview_setWindowActivated :
-	Beapi.btextview -> 'a -> unit =
+	Beapi.btextview -> (bool -> unit) -> unit =
 	"btextview_setWindowActivated"
 external btextview_AcceptsDrop :
 	Beapi.btextview -> Beapi.bmessage -> bool =
 		match archive, font, frame, textRect, color, resizingMode, flags, name with
 		| None, None, Some frame, Some textRect, None, Some resizingMode, Some flags, Some name -> btextview_constructor_1 frame name textRect resizingMode flags
 		| None, Some font, Some frame, Some textRect, Some color, Some resizingMode, Some flags, Some name -> btextview_constructor_2 frame name textRect font color resizingMode flags
-		| Some archive, None, None, None, None, None, None, None -> btextview_constructor_3 archive
-		| None, None, None, None, None, None, None, None -> invalid_arg "Wrong arg in BTextView.constructor"
+		| None, None, None, None, None, None, Some flags, Some name -> btextview_constructor_3 name flags
+		| None, Some font, None, None, Some color, None, Some flags, Some name -> btextview_constructor_4 name font color flags
+		| Some archive, None, None, None, None, None, None, None -> btextview_constructor_5 archive
+		| _, _, _, _, _, _, _, _-> invalid_arg "Wrong arg in BTextView.constructor"
 
 
 	let setAttachedToWindow ~self ~cb () =
 	let setWindowActivated ~self ~cb () =
 		btextview_setWindowActivated self cb
 
-	let btextview_AcceptsDrop ~self ~archive () =
+	let accepts_drop ~self ~archive () =
 		btextview_AcceptsDrop self archive
 
-	let btextview_AcceptsPaste ~self ~clipboard () =
+	let accepts_paste ~self ~clipboard () =
 		btextview_AcceptsPaste self clipboard
 
-	let btextview_Archive ~self ~archive ~deep () =
+	let archive ~self ~archive ~deep () =
 		btextview_Archive self archive deep
 
-	let btextview_CanEndLine ~self ~offset () =
+	let can_end_line ~self ~offset () =
 		btextview_CanEndLine self offset
 
-	let btextview_Cut ~self ~clipboard () =
+	let cut ~self ~clipboard () =
 		btextview_Cut self clipboard
 
-	let btextview_Copy ~self ~clipboard () =
+	let copy ~self ~clipboard () =
 		btextview_Copy self clipboard
 
-	let btextview_Paste ~self ~clipboard () =
+	let paste ~self ~clipboard () =
 		btextview_Paste self clipboard
 
-	let btextview_Clear ~self () =
+	let clear ~self () =
 		btextview_Clear self
 
-	let btextview_DisallowChar ~self ~aChar () =
+	let disallow_char ~self ~aChar () =
 		btextview_DisallowChar self aChar
 
-	let btextview_AllowChar ~self ~aChar () =
+	let allow_char ~self ~aChar () =
 		btextview_AllowChar self aChar
 
-	let btextview_FindWord ~self ~offset ~start ~finish () =
+	let find_word ~self ~offset ~start ~finish () =
 		btextview_FindWord self offset start finish
 
-	let btextview_GetDragParameters ~self ~drag ~bitmap ~point ~handler () =
+	let get_drag_parameters ~self ~drag ~bitmap ~point ~handler () =
 		btextview_GetDragParameters self drag bitmap point handler
 
-	let btextview_GetSelection ~self ~start ~finish () =
+	let get_selection ~self ~start ~finish () =
 		btextview_GetSelection self start finish
 
-	let btextview_GetTextRegion ~self ~start ~finish ~region () =
+	let get_text_region ~self ~start ~finish ~region () =
 		btextview_GetTextRegion self start finish region
 
-	let btextview_GoToLine ~self ~index () =
+	let go_to_line ~self ~index () =
 		btextview_GoToLine self index
 
-	let btextview_CurrentLine ~self () =
+	let current_line ~self () =
 		btextview_CurrentLine self
 
-	let btextview_CountLines ~self () =
+	let count_lines ~self () =
 		btextview_CountLines self
 
-	let btextview_HideTyping ~self ~flag () =
+	let hide_typing ~self ~flag () =
 		btextview_HideTyping self flag
 
-	let btextview_IsTypingHidden ~self () =
+	let is_typing_hidden ~self () =
 		btextview_IsTypingHidden self
 
 	let insert ~self ?text ?runs ?length ?offset () =
 		| Some text, Some runs, None, None -> btextview_Insert_1 self text runs
 		| Some text, Some runs, Some length, None -> btextview_Insert_2 self text length runs
 		| Some text, Some runs, Some length, Some offset -> btextview_Insert_3 self offset text length runs
-		| None, None, None, None -> invalid_arg "Wrong arg in BTextView.Insert"
+		| _, _, _, _-> invalid_arg "Wrong arg in BTextView.Insert"
 
 
 	let delete ~self ?finish ?start () =
 		match finish, start with
 		| None, None -> btextview_Delete_1 self 
 		| Some finish, Some start -> btextview_Delete_2 self start finish
-		| None, None -> invalid_arg "Wrong arg in BTextView.Delete"
+		| _, _-> invalid_arg "Wrong arg in BTextView.Delete"
 
 
-	let btextview_InsertText ~self ~text ~length ~offset ~runs () =
+	let insert_text ~self ~text ~length ~offset ~runs () =
 		btextview_InsertText self text length offset runs
 
-	let btextview_DeleteText ~self ~start ~finish () =
+	let delete_text ~self ~start ~finish () =
 		btextview_DeleteText self start finish
 
-	let lineAt ~self ?point ?offset () =
+	let line_at ~self ?point ?offset () =
 		match point, offset with
 		| None, Some offset -> btextview_LineAt_1 self offset
 		| Some point, None -> btextview_LineAt_2 self point
-		| None, None -> invalid_arg "Wrong arg in BTextView.LineAt"
+		| _, _-> invalid_arg "Wrong arg in BTextView.LineAt"
 
 
-	let btextview_PointAt ~self ~offset ~height () =
+	let point_at ~self ~offset ~height () =
 		btextview_PointAt self offset height
 
-	let offsetAt ~self ?point ?offset () =
+	let offset_at ~self ?point ?offset () =
 		match point, offset with
 		| None, Some offset -> btextview_OffsetAt_1 self offset
 		| Some point, None -> btextview_OffsetAt_2 self point
-		| None, None -> invalid_arg "Wrong arg in BTextView.OffsetAt"
+		| _, _-> invalid_arg "Wrong arg in BTextView.OffsetAt"
 
 
-	let btextview_LineHeight ~self ~index () =
+	let line_height ~self ~index () =
 		btextview_LineHeight self index
 
-	let btextview_TextHeight ~self ~firstIndex ~lastIndex () =
+	let text_height ~self ~firstIndex ~lastIndex () =
 		btextview_TextHeight self firstIndex lastIndex
 
-	let btextview_LineWidth ~self ~index () =
+	let line_width ~self ~index () =
 		btextview_LineWidth self index
 
-	let btextview_MakeEditable ~self ~flag () =
+	let make_editable ~self ~flag () =
 		btextview_MakeEditable self flag
 
-	let btextview_IsEditable ~self () =
+	let is_editable ~self () =
 		btextview_IsEditable self
 
-	let btextview_MakeFocus ~self ~flag () =
+	let make_focus ~self ~flag () =
 		btextview_MakeFocus self flag
 
-	let btextview_MakeResizable ~self ~resizable ~containerView () =
+	let make_resizable ~self ~resizable ~containerView () =
 		btextview_MakeResizable self resizable containerView
 
-	let btextview_IsResizable ~self () =
+	let is_resizable ~self () =
 		btextview_IsResizable self
 
-	let btextview_MakeSelectable ~self ~flag () =
+	let make_selectable ~self ~flag () =
 		btextview_MakeSelectable self flag
 
-	let btextview_IsSelectable ~self () =
+	let is_selectable ~self () =
 		btextview_IsSelectable self
 
-	let btextview_ScrollToOffset ~self ~offset () =
+	let scroll_to_offset ~self ~offset () =
 		btextview_ScrollToOffset self offset
 
-	let btextview_ScrollToSelection ~self () =
+	let scroll_to_selection ~self () =
 		btextview_ScrollToSelection self
 
-	let btextview_Select ~self ~start ~finish () =
+	let select ~self ~start ~finish () =
 		btextview_Select self start finish
 
-	let btextview_SelectAll ~self () =
+	let select_all ~self () =
 		btextview_SelectAll self
 
-	let btextview_SetAlignment ~self ~where () =
+	let set_alignment ~self ~where () =
 		btextview_SetAlignment self where
 
-	let btextview_Alignment ~self () =
+	let alignment ~self () =
 		btextview_Alignment self
 
-	let btextview_SetAutoindent ~self ~flag () =
+	let set_autoindent ~self ~flag () =
 		btextview_SetAutoindent self flag
 
-	let btextview_DoesAutoindent ~self () =
+	let does_autoindent ~self () =
 		btextview_DoesAutoindent self
 
-	let btextview_SetColorSpace ~self ~space () =
+	let set_color_space ~self ~space () =
 		btextview_SetColorSpace self space
 
-	let btextview_ColorSpace ~self () =
+	let color_space ~self () =
 		btextview_ColorSpace self
 
-	let btextview_SetDoesUndo ~self ~sayIt () =
+	let set_does_undo ~self ~sayIt () =
 		btextview_SetDoesUndo self sayIt
 
-	let btextview_DoesUndo ~self () =
+	let does_undo ~self () =
 		btextview_DoesUndo self
 
-	let btextview_UndoState ~self ~isRedo () =
+	let undo_state ~self ~isRedo () =
 		btextview_UndoState self isRedo
 
-	let btextview_Undo ~self ~clipboard () =
+	let undo ~self ~clipboard () =
 		btextview_Undo self clipboard
 
-	let setFontAndColor ~self ?font ?finish ?color ?start ?properties () =
+	let set_font_and_color ~self ?font ?finish ?color ?start ?properties () =
 		match font, finish, color, start, properties with
 		| Some font, Some finish, Some color, Some start, Some properties -> btextview_SetFontAndColor_1 self start finish font properties color
 		| Some font, None, Some color, None, Some properties -> btextview_SetFontAndColor_2 self font properties color
-		| None, None, None, None, None -> invalid_arg "Wrong arg in BTextView.SetFontAndColor"
+		| _, _, _, _, _-> invalid_arg "Wrong arg in BTextView.SetFontAndColor"
 
 
-	let getFontAndColor ~self ?font ?sameProperties ?sameColor ?color ?offset () =
+	let get_font_and_color ~self ?font ?sameProperties ?sameColor ?color ?offset () =
 		match font, sameProperties, sameColor, color, offset with
 		| Some font, None, None, Some color, Some offset -> btextview_GetFontAndColor_1 self offset font color
 		| Some font, Some sameProperties, Some sameColor, Some color, None -> btextview_GetFontAndColor_2 self font sameProperties color sameColor
-		| None, None, None, None, None -> invalid_arg "Wrong arg in BTextView.GetFontAndColor"
+		| _, _, _, _, _-> invalid_arg "Wrong arg in BTextView.GetFontAndColor"
 
 
-	let btextview_SetMaxBytes ~self ~max () =
+	let set_max_bytes ~self ~max () =
 		btextview_SetMaxBytes self max
 
-	let btextview_MaxBytes ~self () =
+	let max_bytes ~self () =
 		btextview_MaxBytes self
 
-	let btextview_SetRunArray ~self ~start ~finish ~runs () =
+	let set_run_array ~self ~start ~finish ~runs () =
 		btextview_SetRunArray self start finish runs
 
-	let btextview_RunArray ~self ~start ~finish ~length () =
+	let run_array ~self ~start ~finish ~length () =
 		btextview_RunArray self start finish length
 
-	let btextview_SetStylable ~self ~stylable () =
+	let set_stylable ~self ~stylable () =
 		btextview_SetStylable self stylable
 
-	let btextview_IsStylable ~self () =
+	let is_stylable ~self () =
 		btextview_IsStylable self
 
-	let btextview_SetTabWidth ~self ~width () =
+	let set_tab_width ~self ~width () =
 		btextview_SetTabWidth self width
 
-	let btextview_TabWidth ~self () =
+	let tab_width ~self () =
 		btextview_TabWidth self
 
-	let setText ~self ?text ?runs ?file ?length ?offset () =
+	let set_text ~self ?text ?runs ?file ?length ?offset () =
 		match text, runs, file, length, offset with
 		| Some text, Some runs, None, None, None -> btextview_SetText_1 self text runs
 		| Some text, Some runs, None, Some length, None -> btextview_SetText_2 self text length runs
 		| None, Some runs, Some file, Some length, Some offset -> btextview_SetText_3 self file offset length runs
-		| None, None, None, None, None -> invalid_arg "Wrong arg in BTextView.SetText"
+		| _, _, _, _, _-> invalid_arg "Wrong arg in BTextView.SetText"
 
 
-	let btextview_SetTextRect ~self ~rect () =
+	let set_text_rect ~self ~rect () =
 		btextview_SetTextRect self rect
 
-	let btextview_TextRect ~self () =
+	let text_rect ~self () =
 		btextview_TextRect self
 
-	let btextview_SetWordWrap ~self ~flag () =
+	let set_word_wrap ~self ~flag () =
 		btextview_SetWordWrap self flag
 
-	let btextview_DoesWordWrap ~self () =
+	let does_word_wrap ~self () =
 		btextview_DoesWordWrap self
 
-	let btextview_Text ~self () =
+	let text ~self () =
 		btextview_Text self
 
-	let btextview_GetText ~self ~offset ~length ~buffer () =
+	let get_text ~self ~offset ~length ~buffer () =
 		btextview_GetText self offset length buffer
 
-	let btextview_ByteAt ~self ~offset () =
+	let byte_at ~self ~offset () =
 		btextview_ByteAt self offset
 
-	let btextview_TextLength ~self () =
+	let text_length ~self () =
 		btextview_TextLength self
 
+
+
+
+
+class btextview ?archive ?font ?frame ?textRect ?color ?resizingMode ?flags ?name ?external_pointer () =
+  object (self)
+    val pointer =
+      match external_pointer with
+      | Some p -> p
+      | None ->
+          match archive, font, frame, textRect,
+            color, resizingMode, flags, name with
+          | None, None, Some frame, Some textRect,
+            None, Some resizingMode, Some flags, Some name ->
+              btextview_constructor_1 frame name textRect resizingMode flags
+          | None, Some font, Some frame, Some textRect,
+            Some color, Some resizingMode, Some flags, Some name ->
+              btextview_constructor_2 frame name textRect
+                                      font color resizingMode flags
+          | None, None, None, None, None, None, Some flags, Some name ->
+              btextview_constructor_3 name flags
+          | None, Some font, None, None, Some color,
+            None, Some flags, Some name ->
+              btextview_constructor_4 name font color flags
+          | Some archive, None, None, None, None, None, None, None ->
+              btextview_constructor_5 archive
+          | _, _, _, _, _, _, _, _->
+              invalid_arg "Wrong arg in BTextView.constructor"
+    method get_pointer = pointer
+
+    method setAttachedToWindow cb =
+      btextview_setAttachedToWindow pointer cb
+
+    method setDetachedFromWindow cb =
+      btextview_setDetachedFromWindow pointer cb
+
+    method setDraw cb =
+      btextview_setDraw pointer cb
+
+    method setFrameResized cb =
+      btextview_setFrameResized pointer cb
+
+    method setKeyDown cb =
+      btextview_setKeyDown pointer cb
+
+    method setMessageReceived cb =
+      btextview_setMessageReceived pointer cb
+
+    method setMouseDown cb =
+      btextview_setMouseDown pointer cb
+
+    method setMouseMoved cb =
+      btextview_setMouseMoved pointer cb
+
+    method setPulse cb =
+      btextview_setPulse pointer cb
+
+    method setWindowActivated cb =
+      btextview_setWindowActivated pointer cb
+
+    method accepts_drop ~archive =
+      btextview_AcceptsDrop pointer archive
+
+    method accepts_paste ~clipboard =
+      btextview_AcceptsPaste pointer clipboard
+
+    method archive ~archive ~deep =
+      btextview_Archive pointer archive deep
+
+    method can_end_line ~offset =
+      btextview_CanEndLine pointer offset
+
+    method cut ~clipboard =
+      btextview_Cut pointer clipboard
+
+    method copy ~clipboard =
+      btextview_Copy pointer clipboard
+
+    method paste ~clipboard =
+      btextview_Paste pointer clipboard
+
+    method clear =
+      btextview_Clear pointer
+
+    method disallow_char ~aChar =
+      btextview_DisallowChar pointer aChar
+
+    method allow_char ~aChar =
+      btextview_AllowChar pointer aChar
+
+    method find_word ~offset ~start ~finish =
+      btextview_FindWord pointer offset start finish
+
+    method get_drag_parameters ~drag ~bitmap ~point ~handler =
+      btextview_GetDragParameters pointer drag bitmap point handler
+
+    method get_selection ~start ~finish =
+      btextview_GetSelection pointer start finish
+
+    method get_text_region ~start ~finish ~region =
+      btextview_GetTextRegion pointer start finish region
+
+    method go_to_line ~index =
+      btextview_GoToLine pointer index
+
+    method current_line =
+      btextview_CurrentLine pointer
+
+    method count_lines =
+      btextview_CountLines pointer
+
+    method hide_typing ~flag =
+      btextview_HideTyping pointer flag
+
+    method is_typing_hidden =
+      btextview_IsTypingHidden pointer
+
+    method insert ?text ?runs ?length ?offset () =
+      match text, runs, length, offset with
+      | Some text, Some runs, None, None ->
+          btextview_Insert_1 pointer text runs
+      | Some text, Some runs, Some length, None ->
+          btextview_Insert_2 pointer text length runs
+      | Some text, Some runs, Some length, Some offset ->
+          btextview_Insert_3 pointer offset text length runs
+      | _, _, _, _-> invalid_arg "Wrong arg in BTextView.Insert"
+
+
+    method delete ?finish ?start () =
+      match finish, start with
+      | None, None -> btextview_Delete_1 pointer 
+      | Some finish, Some start -> btextview_Delete_2 pointer start finish
+      | _, _-> invalid_arg "Wrong arg in BTextView.Delete"
+
+
+    method insert_text ~text ~length ~offset ~runs =
+      btextview_InsertText pointer text length offset runs
+
+    method delete_text ~start ~finish =
+      btextview_DeleteText pointer start finish
+
+    method line_at ?point ?offset () =
+      match point, offset with
+      | None, Some offset -> btextview_LineAt_1 pointer offset
+      | Some point, None -> btextview_LineAt_2 pointer point
+      | _, _-> invalid_arg "Wrong arg in BTextView.LineAt"
+
+
+    method point_at ~offset ~height =
+      btextview_PointAt pointer offset height
+
+    method offset_at ?point ?offset () =
+      match point, offset with
+      | None, Some offset -> btextview_OffsetAt_1 pointer offset
+      | Some point, None -> btextview_OffsetAt_2 pointer point
+      | _, _-> invalid_arg "Wrong arg in BTextView.OffsetAt"
+
+
+    method line_height ~index =
+      btextview_LineHeight pointer index
+
+    method text_height ~firstIndex ~lastIndex =
+      btextview_TextHeight pointer firstIndex lastIndex
+
+    method line_width ~index =
+      btextview_LineWidth pointer index
+
+    method make_editable ~flag =
+      btextview_MakeEditable pointer flag
+
+    method is_editable =
+      btextview_IsEditable pointer
+
+    method make_focus ~flag =
+      btextview_MakeFocus pointer flag
+
+    method make_resizable ~resizable ~containerView =
+      btextview_MakeResizable pointer resizable containerView
+
+    method is_resizable =
+      btextview_IsResizable pointer
+
+    method make_selectable ~flag =
+      btextview_MakeSelectable pointer flag
+
+    method is_selectable =
+      btextview_IsSelectable pointer
+
+    method scroll_to_offset ~offset =
+      btextview_ScrollToOffset pointer offset
+
+    method scroll_to_selection =
+      btextview_ScrollToSelection pointer
+
+    method select ~start ~finish =
+      btextview_Select pointer start finish
+
+    method select_all =
+      btextview_SelectAll pointer
+
+    method set_alignment ~where =
+      btextview_SetAlignment pointer where
+
+    method alignment =
+      btextview_Alignment pointer
+
+    method set_autoindent ~flag =
+      btextview_SetAutoindent pointer flag
+
+    method does_autoindent =
+      btextview_DoesAutoindent pointer
+
+    method set_color_space ~space =
+      btextview_SetColorSpace pointer space
+
+    method color_space =
+      btextview_ColorSpace pointer
+
+    method set_does_undo ~sayIt =
+      btextview_SetDoesUndo pointer sayIt
+
+    method does_undo =
+      btextview_DoesUndo pointer
+
+    method undo_state ~isRedo =
+      btextview_UndoState pointer isRedo
+
+    method undo ~clipboard =
+      btextview_Undo pointer clipboard
+
+    method set_font_and_color ?font ?finish ?color ?start ?properties () =
+      match font, finish, color, start, properties with
+      | Some font, Some finish, Some color, Some start, Some properties ->
+          btextview_SetFontAndColor_1 pointer start finish font properties color
+      | Some font, None, Some color, None, Some properties ->
+          btextview_SetFontAndColor_2 pointer font properties color
+      | _, _, _, _, _-> invalid_arg "Wrong arg in BTextView.SetFontAndColor"
+
+
+    method get_font_and_color ?font ?sameProperties
+                              ?sameColor ?color ?offset () =
+      match font, sameProperties, sameColor, color, offset with
+      | Some font, None, None, Some color, Some offset ->
+          btextview_GetFontAndColor_1 pointer offset font color
+      | Some font, Some sameProperties, Some sameColor, Some color, None ->
+          btextview_GetFontAndColor_2 pointer font sameProperties
+                                      color sameColor
+      | _, _, _, _, _-> invalid_arg "Wrong arg in BTextView.GetFontAndColor"
+
+
+    method set_max_bytes ~max =
+      btextview_SetMaxBytes pointer max
+
+    method max_bytes =
+      btextview_MaxBytes pointer
+
+    method set_run_array ~start ~finish ~runs =
+      btextview_SetRunArray pointer start finish runs
+
+    method run_array ~start ~finish ~length =
+      btextview_RunArray pointer start finish length
+
+    method set_stylable ~stylable =
+      btextview_SetStylable pointer stylable
+
+    method is_stylable =
+      btextview_IsStylable pointer
+
+    method set_tab_width ~width =
+      btextview_SetTabWidth pointer width
+
+    method tab_width =
+      btextview_TabWidth pointer
+
+    method set_text ?text ?runs ?file ?length ?offset () =
+      match text, runs, file, length, offset with
+      | Some text, Some runs, None, None, None ->
+          btextview_SetText_1 pointer text runs
+      | Some text, Some runs, None, Some length, None ->
+          btextview_SetText_2 pointer text length runs
+      | None, Some runs, Some file, Some length, Some offset ->
+          btextview_SetText_3 pointer file offset length runs
+      | _, _, _, _, _ ->
+          invalid_arg "Wrong arg in BTextView.SetText"
+
+
+    method set_text_rect ~rect =
+      btextview_SetTextRect pointer rect
+
+    method text_rect =
+      btextview_TextRect pointer
+
+    method set_word_wrap ~flag =
+      btextview_SetWordWrap pointer flag
+
+    method does_word_wrap =
+      btextview_DoesWordWrap pointer
+
+    method text =
+      btextview_Text pointer
+
+    method get_text ~offset ~length ~buffer =
+      btextview_GetText pointer offset length buffer
+
+    method byte_at ~offset =
+      btextview_ByteAt pointer offset
+
+    method text_length =
+      btextview_TextLength pointer
+    method to_bview =
+      Beapi.bview_of_btextview pointer
+end
 external bview_of_btabview :
 	btabview -> bview =
 	"bview_of_btabview"
+external bview_of_btextview :
+	btextview -> bview =
+	"bview_of_btextview"
 external blayout_of_bgrouplayout :
 	bgrouplayout -> blayout =
 	"blayout_of_bgrouplayout"
           ~layout:(Beapi.blayout_of_bgrouplayout home_tab_layout#get_pointer)
           ~name:"Home" ~flags:Beapi.b_WILL_DRAW () in
       self#add_tab ~target:home_tab_view ~tab:(BTab.null ()) () ;
-      (*let file_tab_view =
-        BView.bview ~frame:frame ~name:"File"
-                    ~resizingMode:Beapi.b_FOLLOW_ALL_SIDES
-                    ~flags:Beapi.b_WILL_DRAW () in
+      let file_tab_layout =
+        new BGroupLayout.bgrouplayout ~orientation:Beapi.B_HORIZONTAL
+                                      ~spacing:1.0 () in
+      let file_tab_view =
+        BView.bview ~name:"File"
+          ~layout:(Beapi.blayout_of_bgrouplayout file_tab_layout#get_pointer)
+          ~flags:Beapi.b_WILL_DRAW () in
       self#add_tab ~target:file_tab_view ~tab:(BTab.null ()) () ;
+      let insert_tab_layout =
+        new BGroupLayout.bgrouplayout ~orientation:Beapi.B_HORIZONTAL
+                                      ~spacing:1.0 () in
       let insert_tab_view =
-        BView.bview ~frame:frame ~name:"Insert"
-                    ~resizingMode:Beapi.b_FOLLOW_ALL_SIDES
-                    ~flags:Beapi.b_WILL_DRAW () in
-      self#add_tab ~target:insert_tab_view ~tab:(BTab.null ()) () ;*)
+        BView.bview
+          ~layout:(Beapi.blayout_of_bgrouplayout insert_tab_layout#get_pointer)
+          ~name:"Insert" ~flags:Beapi.b_WILL_DRAW () in
+      self#add_tab ~target:insert_tab_view ~tab:(BTab.null ()) () ;
       let button =
-        BButton.bbutton ~frame:home_tab_layout#frame
-                        ~name:"Hello" ~label:"Hello"
+        BButton.bbutton ~label:"Hello"
                         ~message:(BMessage.bmessage ~command:1 ())
-                        ~resizingMode:Beapi.b_FOLLOW_NONE
-                        ~flags:Beapi.b_WILL_DRAW () in
+                        () in
 
       ignore
         (home_tab_layout#add_view ~child:(Beapi.bview_of_bbutton button) ())
     val message_received = fun message -> print_endline "button clicked"
     initializer
       self#setMessageReceived message_received ;
-      let layout =
+      let window_layout =
         new BGroupLayout.bgrouplayout ~orientation:Beapi.B_VERTICAL
                                       ~spacing:0.0 () in
       self#set_layout
-        ~layout:(Beapi.blayout_of_bgrouplayout layout#get_pointer) ;
+        ~layout:(Beapi.blayout_of_bgrouplayout window_layout#get_pointer) ;
       let tabs = new ribbon_tabs in
-      layout#add_view ~child:(Beapi.bview_of_btabview tabs#get_pointer) () ;
+      window_layout#add_view
+        ~child:(Beapi.bview_of_btabview tabs#get_pointer) () ;
+      let secondary_layout =
+        new BGroupLayout.bgrouplayout ~orientation:Beapi.B_HORIZONTAL
+                                      ~spacing:1.0 () in
+      let secondary_view =
+        BView.bview ~name:"secondary"
+          ~layout:(Beapi.blayout_of_bgrouplayout secondary_layout#get_pointer)
+          ~flags:Beapi.b_WILL_DRAW () in
+      let secondary_button =
+        BButton.bbutton ~label:"Secondary"
+                        ~message:(BMessage.bmessage ~command:1 ())
+                         () in
+      secondary_layout#add_view
+        ~child:(Beapi.bview_of_bbutton secondary_button) () ;
+      window_layout#add_view ~child:secondary_view () ;
       let button =
-        BButton.bbutton ~frame:frame
-                        ~name:"Hello2" ~label:"Hello3"
+        BButton.bbutton ~label:"Hello3"
                         ~message:(BMessage.bmessage ~command:1 ())
-                        ~resizingMode:Beapi.b_FOLLOW_NONE
-                        ~flags:Beapi.b_WILL_DRAW () in
-      ignore (layout#add_view ~child:(Beapi.bview_of_bbutton button) ()) ;
+                         () in
+      let textview = new
+        BTextView.btextview
+          ~name:"TestText"
+          ~flags:(Beapi.b_WILL_DRAW + Beapi.b_PULSE_NEEDED) () in
+      window_layout#add_view ~child:(textview#to_bview) () ;
+      ignore
+        (window_layout#add_view ~child:(Beapi.bview_of_bbutton button) ()) ;
 end
 
 class hello_haiku =