diff --git a/bepascal/Jamfile b/bepascal/Jamfile new file mode 100644 index 0000000..8e8f3fb --- /dev/null +++ b/bepascal/Jamfile @@ -0,0 +1,13 @@ +SubDir BEPASCAL_TOP ; + +SubInclude BEPASCAL_TOP source bepascal cpp ; +SubInclude BEPASCAL_TOP source bepascal pas ; + +DISTRIB_DIR = distrib ; + +MakeZip pas_sources.zip : source/bepascal/pas ; +MakeZip cpp_sources.zip : source/bepascal/cpp ; +MakeZip bin_bepascal.zip : source/bepascal/pas lib ; +MakeZip demos.zip : demos ; +MakeZip docs.zip : docs ; + diff --git a/bepascal/Jamrules b/bepascal/Jamrules new file mode 100644 index 0000000..0a3c01c --- /dev/null +++ b/bepascal/Jamrules @@ -0,0 +1,36 @@ +rule UserObject +{ + switch $(2) + { + case *.pp : fpc $(1) : $(2) ; + } +} + +rule fpc +{ + echo $(1) ; + echo $(2) ; + Depends $(1) : $(2) ; + PPUFILES += $(2)u ; + Clean clean : $(2)u ; + echo $(2)u ; + echo $(LOCATE_TARGET) ; + echo $(PPUFILES) ; +} + +actions fpc +{ + fpc -g -S2 $(2) +} + +rule MakeZip +{ + Depends all : $(1) ; + Clean clean : $(DISTRIB_DIR)/$(1) ; +} + +actions MakeZip +{ + mkdir $(DISTRIB_DIR) + zip $(DISTRIB_DIR)/$(1) -r $(2) +} \ No newline at end of file diff --git a/bepascal/demos/demo/compile b/bepascal/demos/demo/compile new file mode 100644 index 0000000..7888a0e --- /dev/null +++ b/bepascal/demos/demo/compile @@ -0,0 +1,8 @@ +#!/bin/sh +if [ ! -d units ] + then mkdir units +fi + +ppc386 -FE./ -FU./units ./sources/main.pp -oBPDemo +mergeres ./sources/Resource.rsrc BPDemo +mimeset BPCalculator diff --git a/bepascal/demos/demo/demo b/bepascal/demos/demo/demo new file mode 100644 index 0000000..9372cef --- /dev/null +++ b/bepascal/demos/demo/demo @@ -0,0 +1,8 @@ +### pe Group File +./sources/button_view.pp +./sources/common.pp +./sources/edit_view.pp +./sources/main.pp +./sources/main_window.pp +../BiPolar/TestApp/source/mainwindow.pas +./sources/other_view.pp diff --git a/bepascal/demos/demo/sources/button_view.pp b/bepascal/demos/demo/sources/button_view.pp new file mode 100644 index 0000000..7e9145f --- /dev/null +++ b/bepascal/demos/demo/sources/button_view.pp @@ -0,0 +1,141 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit button_view; + +{$M+} +interface +uses + classes,beobj, application, message, _beep, roster, SysUtils,interfacedefs, + archivable, handler, rect, window, view, graphicdefs, dataio,box, + invoker, messenger, Control, Button,listview,listitem,outlinelistview,common; + + +type + TButton_View = class(BView) + public + constructor Create(frame : BRect; name : PChar; resizingMode, flags : Cardinal); + Button1: BButton; + Button2: BButton; + Button3: BButton; + + ListView1 : BListView; + ItemString : BStringItem; + outlineListView : BOutlineListView; + Box1 : BBox; + Box2 : BBox; + + end; + +implementation + +constructor TButton_View.Create(frame : BRect; name : PChar; resizingMode, flags : Cardinal); +Var + aRect2 : BRect; + mess : BMessage; + rgb : RGB_color; + +begin + inherited; + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + // Button 1 + aRect2 := BRect.Create(20, 20, 100, 30); + mess := BMessage.Create(MSG_BUTTON_BASE+1); + Button1 := BButton.Create(aRect2, 'Button 1', 'Button 1', mess, B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Button1.SetViewColor(rgb); + AddChild(Button1, nil); + aRect2.Free; + + // Button 2 + aRect2 := BRect.Create(20, 20+30, 100, 30+30); + mess := BMessage.Create(MSG_BUTTON_BASE+2); + Button2 := BButton.Create(aRect2, 'Add Item', 'Add Item', mess, B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Button2.SetViewColor(rgb); + AddChild(Button2, nil); + aRect2.Free; + + // Button 3 + aRect2 := BRect.Create(20, 20+60, 100, 30+60); + mess := BMessage.Create(MSG_BUTTON_BASE+3); + Button3 := BButton.Create(aRect2, 'Add Outline', 'Add Outline', mess, B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Button3.SetViewColor(rgb); + AddChild(Button3, nil); + aRect2.Free; + + // Box for ListView + aRect2 := BRect.Create(120, 30, 250, 300); + Box1 := BBox.Create(aRect2, 'Box1', B_FOLLOW_LEFT or B_FOLLOW_TOP, + B_WILL_DRAW or B_NAVIGABLE, B_PLAIN_BORDER); + Box1.SetLabel('BListView'); + Box1.SetBorder(B_FANCY_BORDER); + AddChild(Box1, nil); + aRect2.Free; + + // ListView1 + aRect2 := BRect.Create(10, 15, 120, 250); + ListView1 := BListView.create(aRect2,'toto', + B_SINGLE_SELECTION_LIST, + B_FOLLOW_LEFT or B_FOLLOW_TOP, + B_WILL_DRAW or B_NAVIGABLE or B_FRAME_EVENTS); + Box1.AddChild(ListView1, nil); + aRect2.Free; + + +{ ItemString := BStringItem.create('test 1',0,true); + ListView1.AddItem(ItemString); + ItemString := BStringItem.create('test 2',1,true); + ListView1.AddItem(ItemString); +} + + // Box for OutLineListItem + aRect2 := BRect.Create(260, 30, 400, 300); + Box2 := BBox.Create(aRect2, 'Box1', B_FOLLOW_LEFT or B_FOLLOW_TOP, + B_WILL_DRAW or B_NAVIGABLE, B_PLAIN_BORDER); + Box2.SetLabel('BOutlineListView '); + Box2.SetBorder(B_FANCY_BORDER); + AddChild(Box2, nil); + aRect2.Free; + + // Outlinelistitem + aRect2 := BRect.Create(10, 15, 120, 250); + outlineListView := BOutlineListView.create(aRect2,'toto', + B_SINGLE_SELECTION_LIST, + B_FOLLOW_LEFT or B_FOLLOW_TOP, + B_WILL_DRAW or B_NAVIGABLE or B_FRAME_EVENTS); + Box2.AddChild(outlineListView, nil); + aRect2.Free; + + + ItemString := BStringItem.create('test 1',0,true); + outlineListView.AddItem(ItemString); + ItemString := BStringItem.create('test 1.1',1,true); + outlineListView.AddItem(ItemString); + ItemString := BStringItem.create('test 1.2',1,true); + outlineListView.AddItem(ItemString); + ItemString := BStringItem.create('test 2',0,true); + outlineListView.AddItem(ItemString); + ItemString := BStringItem.create('test 2.1',1,true); + outlineListView.AddItem(ItemString); + ItemString := BStringItem.create('test 3',0,true); + outlineListView.AddItem(ItemString); + + +end; + +end. diff --git a/bepascal/demos/demo/sources/common.pp b/bepascal/demos/demo/sources/common.pp new file mode 100644 index 0000000..4440e0a --- /dev/null +++ b/bepascal/demos/demo/sources/common.pp @@ -0,0 +1,13 @@ +unit common; +interface +const + MSG_TEST_APP_BASE = 79000; + MSG_BUTTON_BASE = MSG_TEST_APP_BASE + 100; + MSG_CHECKBOX_BASE = MSG_TEST_APP_BASE + 200; + MSG_RADIOBUTTON_BASE = MSG_TEST_APP_BASE + 300; + MSG_STRINGVIEW_BASE = MSG_TEST_APP_BASE + 400; + MSG_MENU_BASE = MSG_TEST_APP_BASE + 500; + MSG_STATUSBAR_BASE = MSG_TEST_APP_BASE + 600; + +implementation +end. diff --git a/bepascal/demos/demo/sources/edit_view.pp b/bepascal/demos/demo/sources/edit_view.pp new file mode 100644 index 0000000..91d8777 --- /dev/null +++ b/bepascal/demos/demo/sources/edit_view.pp @@ -0,0 +1,155 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit edit_view; + +{$M+} +interface +uses + classes,beobj, application, message, _beep, roster, SysUtils,interfacedefs, + archivable, handler, rect, window, view, graphicdefs, dataio,box, scrollview, + invoker, messenger, Control,textview,font,textcontrol,radiobutton,common; + + +type + TEdit_View = class(BView) + public + constructor Create(frame : BRect; name : PChar; resizingMode, flags : Cardinal); + + aTextView : BTextView; + Edit : BTextControl; + + afont : Bfont; + Box1 : BBox; + Box2 : BBox; + Box3 : BBox; + Box4 : BBox; + RadioButton1, + RadioButton2 : BRadioButton; + RadioButton3, + RadioButton4 : BRadioButton; + scroll_vert :BscrollView; + end; + +implementation + +constructor TEdit_View.Create(frame : BRect; name : PChar; resizingMode, flags : Cardinal); +Var + aRect2,aRect3 : BRect; + mess : BMessage; + rgb : RGB_color; + +begin + inherited; + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + + // Box for textview + aRect2 := BRect.Create(20, 20, 200, 300); + Box2 := BBox.Create(aRect2, 'Box1', B_FOLLOW_LEFT or B_FOLLOW_TOP, + B_WILL_DRAW or B_NAVIGABLE, B_PLAIN_BORDER); + Box2.SetLabel('BTextView '); + Box2.SetBorder(B_FANCY_BORDER); + AddChild(Box2, nil); + aRect2.Free; + + // textView + aRect2 := BRect.Create(10, 15, 160, 260); + aRect3 := BRect.Create(0, 0, 140, 500-160); + aTextView := BTextView.Create(aRect2, 'Test2',aRect3, B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + + scroll_vert:=BscrollView.create('scroll1',aTextView,B_FOLLOW_ALL, B_WILL_DRAW or B_PULSE_NEEDED or B_FRAME_EVENTS,true,true,B_PLAIN_BORDER); + Box2.addchild(scroll_vert,nil); + + aTextView.setStylable(true); + aRect2.Free; + aRect3.Free; + + // Box for TextControl + aRect2 := BRect.Create(220, 20, 400, 300); + Box1 := BBox.Create(aRect2, 'Box1', B_FOLLOW_LEFT or B_FOLLOW_TOP, + B_WILL_DRAW or B_NAVIGABLE, B_PLAIN_BORDER); + Box1.SetLabel('BTextControl '); + Box1.SetBorder(B_FANCY_BORDER); + AddChild(Box1, nil); + aRect2.Free; + + mess := BMessage.Create(77780); + aRect2 := BRect.Create(10, 15, 150, 20); + Edit:=BTextControl.Create(aRect2,' Zone_calcul',' ','',mess,B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Edit.setdivider(0); + Edit.setalignment(B_ALIGN_LEFT,B_ALIGN_LEFT); + //Edit.SetEnabled(false); + Box1.AddChild(Edit,nil); + aRect2.Free; + + // Box for Textalignement + aRect2 := BRect.Create(10, 40, 150, 100); + Box3 := BBox.Create(aRect2, 'Box1', B_FOLLOW_LEFT or B_FOLLOW_TOP, + B_WILL_DRAW or B_NAVIGABLE, B_PLAIN_BORDER); + Box3.SetLabel('setalignment '); + Box3.SetBorder(B_FANCY_BORDER); + Box1.AddChild(Box3, nil); + aRect2.Free; + + // RadioButton1 + mess := BMessage.Create(MSG_RADIOBUTTON_BASE + 1); + aRect2 := BRect.Create(10, 14, 120, 24); + RadioButton1 := BRadioButton.Create(aRect2, 'RB1', 'B_ALIGN_LEFT', mess, + B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Box3.AddChild(RadioButton1, nil); + RadioButton1.SetValue(1); + aRect2.Free; + + // RadioButton2 + mess := BMessage.Create(MSG_RADIOBUTTON_BASE + 2); + aRect2 := BRect.Create(10, 34, 120, 54); + RadioButton2 := BRadioButton.Create(aRect2, 'RB2', 'B_ALIGN_RIGHT', mess, + B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Box3.AddChild(RadioButton2, nil); + aRect2.Free; + + // Box for SetEnabled + aRect2 := BRect.Create(10, 120, 150, 180); + Box4 := BBox.Create(aRect2, 'Box1', B_FOLLOW_LEFT or B_FOLLOW_TOP, + B_WILL_DRAW or B_NAVIGABLE, B_PLAIN_BORDER); + Box4.SetLabel('SetEnabled '); + Box4.SetBorder(B_FANCY_BORDER); + Box1.AddChild(Box4, nil); + aRect2.Free; + + // RadioButton3 + mess := BMessage.Create(MSG_RADIOBUTTON_BASE + 3); + aRect2 := BRect.Create(10, 14, 120, 24); + RadioButton3 := BRadioButton.Create(aRect2, 'RB1', 'SetEnabled(true)', mess, + B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Box4.AddChild(RadioButton3, nil); + RadioButton3.SetValue(1); + aRect2.Free; + + // RadioButton4 + mess := BMessage.Create(MSG_RADIOBUTTON_BASE + 4); + aRect2 := BRect.Create(10, 34, 120, 54); + RadioButton4 := BRadioButton.Create(aRect2, 'RB2', 'SetEnabled(false)', mess, + B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Box4.AddChild(RadioButton4, nil); + aRect2.Free; + +end; + +end. diff --git a/bepascal/demos/demo/sources/main.pp b/bepascal/demos/demo/sources/main.pp new file mode 100644 index 0000000..808d960 --- /dev/null +++ b/bepascal/demos/demo/sources/main.pp @@ -0,0 +1,82 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +program Main; + +{$M+} +uses + beobj, application, message, _beep, roster, SysUtils, + archivable, handler, rect, window, view, graphicdefs, dataio, + invoker, messenger, Control, Button,stringview,textcontrol,checkbox, + main_window; + +type + TMonApplication = class(BApplication) + public + procedure ReadyToRun; override; + function QuitRequested : boolean; override; + end; + + + + + + +function TMonApplication.QuitRequested : boolean; +begin + Result := inherited; + be_app.Free; +end; + +procedure TMonApplication.ReadyToRun; +var + Mess : BMessage; +begin + inherited; + Mess := BMessage.Create; + try + Mess.What := 7777; + be_roster.Broadcast(Mess); + finally + Mess.Free; + end; +end; + + + +var + aRect : BRect; + win : TMyWindow; + +begin + TMonApplication.Create; + try + aRect := BRect.Create(20, 20, 740, 500); + win := TMyWindow.Create(aRect, 'BP Demo', B_TITLED_WINDOW, B_NOT_RESIZABLE or B_NOT_ZOOMABLE or B_QUIT_ON_WINDOW_CLOSE, B_CURRENT_WORKSPACE); + win.Show; + be_app.Run; + be_app.HideCursor; + be_app.ShowCursor; + finally + aRect.Free; + win.Free; + end; +end. + + diff --git a/bepascal/demos/demo/sources/main_window.pp b/bepascal/demos/demo/sources/main_window.pp new file mode 100644 index 0000000..a50c558 --- /dev/null +++ b/bepascal/demos/demo/sources/main_window.pp @@ -0,0 +1,219 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit main_window; + +interface +{$M+} +uses + beobj, application, message, _beep, roster, SysUtils,appdefs, + archivable, handler, rect, window, view, graphicdefs, dataio, interfacedefs,textView,alert, + invoker, messenger, Control, Button,stringview,textcontrol,checkbox,TabView,listitem, + menu, menubar, + button_view,edit_view,common,other_view; + + +Type +TMyWindow = class(BWindow) + private + aView : BView; + TabView : BTabView; + Tab1 : BTab; + Tab2 : BTab; + + + public + constructor Create(aFrame : BRect; title : PChar; atype, aFlags, aWorkspaces : Cardinal); override; + destructor Destroy; override; + procedure MessageReceived(amessage : BMessage); override; + VButton : TButton_View; + VEdit : TEdit_View; + Explain : BStringView; + VOther : TOther_View; + end; + +Const Message1='Message : '; + +implementation + +constructor TMyWindow.Create(aFrame :BRect; title : PChar; atype, aFlags, aWorkspaces : Cardinal); +var + aRect : BRect; + aRect2 : BRect; + mess : BMessage; + i : Integer; + S : pchar; + + menu : BMenu; + menubar : BMenuBar; + sepItem, sepItem2 : BSeparatorItem; + item : BMenuItem; + item1 : BMenuItem; + +begin + inherited; + try + try + // menu + + aRect2 := BRect.Create(0,0,300,300); + menubar := BMenuBar.Create(aRect2, 'Bonjour', B_FOLLOW_LEFT_RIGHT or B_FOLLOW_TOP, B_ITEMS_IN_COLUMN, True); + AddChild(menubar, nil); + aRect2.Free; + Menu := BMenu.Create('File', B_ITEMS_IN_COLUMN); + item := BMenuItem.Create('Open', BMessage.Create(MSG_MENU_BASE+1), 'o'{#0}, 0); + item1 := BMenuItem.Create('Close', BMessage.Create(MSG_MENU_BASE+2), 'z'{#0}, 0); + + Menu.AddItem(item); + Menu.AddSeparatorItem; + Menu.AddItem(item1); + + MenuBar.AddItem(Menu); + + // Create the main View + aRect := BRect.Create(0, 0, 1000, 600); + aView := BView.Create(aRect, 'Test', B_FOLLOW_ALL, B_WILL_DRAW); + aView.SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + self.AddChild(aView, nil); + aRect.Free; + + // Show text Message + aRect:= BRect.Create(20, 400, 200, 420); + Explain := BStringView.Create(aRect,'explain','Message : ',B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + aView.AddChild(Explain, nil); + aRect.Free; + + + // TabView + aRect:= BRect.Create(20, 25, 700, 400); + TabView:=BTabview.Create(aRect,'test', + B_WIDTH_AS_USUAL, + B_FOLLOW_TOP, + B_FULL_UPDATE_ON_RESIZE or B_WILL_DRAW or B_NAVIGABLE_JUMP or B_FRAME_EVENTS or B_NAVIGABLE); + aView.AddChild(TabView, nil); + aRect.Free; + + // Button + aRect:= BRect.Create(0, 0, 700, 500); + VButton := TButton_View.Create(aRect, 'Test 1', B_FOLLOW_ALL, B_NAVIGABLE); + aRect.Free; + + Tab1:=BTab.create(VButton); + Tab1.SetLabel('BButton & BListView'); + + TabView.AddTab(VButton,Tab1); + + // Edit + aRect:= BRect.Create(0, 0, 700, 500); + VEdit := TEdit_View.Create(aRect, 'Test 1', B_FOLLOW_ALL, B_NAVIGABLE); + aRect.Free; + + Tab1:=BTab.create(VEdit); + Tab1.SetLabel('BeditText'); + + TabView.AddTab(VEdit,Tab1); + + // Other + aRect:= BRect.Create(0, 0, 700, 500); + VOther := TOther_View.Create(aRect, 'Test 1', B_FOLLOW_ALL, B_NAVIGABLE); + aRect.Free; + + Tab1:=BTab.create(VOther); + Tab1.SetLabel('Other'); + + TabView.AddTab(VOther,Tab1); + + + TabView.Select(0); + + finally + end; + finally + end; + +end; + +destructor TMyWindow.Destroy; +begin + inherited; +end; + + + +procedure TMyWindow.MessageReceived(aMessage : BMessage); +Var S : String; + p : pchar; + Alert : BAlert; +begin + inherited; + Case aMessage.what of + MSG_BUTTON_BASE+1 : Begin + Explain.SetText(Message1+'button 1 clic'); + End; + MSG_BUTTON_BASE+2 : Begin + Explain.SetText(Message1+'button Add Item click'); + VButton.ItemString := BStringItem.create('new Item',0,true); + VButton.ListView1.AddItem(VButton.ItemString); + End; + MSG_BUTTON_BASE+3 : Begin + Explain.SetText(Message1+'button Add OutlineListItem clic'); + VButton.ItemString := BStringItem.create('New Item',0,true); + VButton.outlineListView.AddItem(VButton.ItemString); + End; + MSG_BUTTON_BASE+4 : Begin + VOther.StatusBar1.Update(10, nil, nil); + S:='Position: '+FloatToStr(VOther.StatusBar1.CurrentValue)+' \ '+FloatToStr(VOther.StatusBar1.MaxValue); + p:=stralloc(length(s)+1); + strpcopy(p,s); + VOther.Value.SetText(p); + strdispose(p); + End; + MSG_BUTTON_BASE+5 : Begin + VOther.StatusBar1.Update(-10, nil, nil); + S:='Position: '+FloatToStr(VOther.StatusBar1.CurrentValue)+' \ '+FloatToStr(VOther.StatusBar1.MaxValue); + p:=stralloc(length(s)+1); + strpcopy(p,s); + VOther.Value.SetText(p); + strdispose(p); + End; + MSG_BUTTON_BASE+6 : Begin + Alert:=BAlert.Create('Attention','You have request a alert ?','Help','Cancel','OK',B_WIDTH_AS_USUAL,B_WARNING_ALERT); + Alert.go; + End; + MSG_RADIOBUTTON_BASE + 1 : Begin + VEdit.Edit.setalignment(B_ALIGN_LEFT,B_ALIGN_LEFT); + End; + MSG_RADIOBUTTON_BASE + 2 : Begin + VEdit.Edit.setalignment(B_ALIGN_RIGHT,B_ALIGN_RIGHT); + End; + MSG_RADIOBUTTON_BASE + 3 : Begin + VEdit.Edit.SetEnabled(true); + End; + MSG_RADIOBUTTON_BASE + 4 : Begin + VEdit.Edit.SetEnabled(false); + End; + MSG_MENU_BASE +2 : Begin + quit; + End; + end; +end; + +end. + + diff --git a/bepascal/demos/demo/sources/other_view.pp b/bepascal/demos/demo/sources/other_view.pp new file mode 100644 index 0000000..f6d0b6c --- /dev/null +++ b/bepascal/demos/demo/sources/other_view.pp @@ -0,0 +1,112 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit other_view; + +{$M+} +interface +uses + classes,beobj, application, message, _beep, roster, SysUtils,interfacedefs, + archivable, handler, rect, window, view, graphicdefs, dataio,box, scrollview,statusbar,button,stringview, + invoker, messenger, Control,textview,font,textcontrol,radiobutton,common; + + +type + Tother_View = class(BView) + public + constructor Create(frame : BRect; name : PChar; resizingMode, flags : Cardinal); + + Box1 : BBox; + Box2 : BBox; + StatusBar1 : BStatusBar; + Button1: BButton; + Button2: BButton; + Button3: BButton; + Value : BStringView; + end; + +implementation + +constructor Tother_View.Create(frame : BRect; name : PChar; resizingMode, flags : Cardinal); +Var + aRect2,aRect3 : BRect; + mess : BMessage; + rgb : RGB_color; + +begin + inherited; + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + + // Box for Statusbar + aRect2 := BRect.Create(20, 20, 200, 300); + Box2 := BBox.Create(aRect2, 'Box1', B_FOLLOW_LEFT or B_FOLLOW_TOP, + B_WILL_DRAW or B_NAVIGABLE, B_PLAIN_BORDER); + Box2.SetLabel('BStatusBar '); + Box2.SetBorder(B_FANCY_BORDER); + AddChild(Box2, nil); + aRect2.Free; + + // StatusBar1 + aRect2 := BRect.Create(20, 20, 170, 200); + StatusBar1 := BStatusBar.Create(aRect2, 'SB1', 'StatusBar1', 'Trailing Label'); + Box2.AddChild(StatusBar1, nil); + aRect2.Free; + + // Button 1 + aRect2 := BRect.Create(20, 60, 100, 70); + mess := BMessage.Create(MSG_BUTTON_BASE+4); + Button1 := BButton.Create(aRect2, 'Button 1', 'Inc', mess, B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Button1.SetViewColor(rgb); + Box2.AddChild(Button1, nil); + aRect2.Free; + + // Button 2 + aRect2 := BRect.Create(20, 60+30, 100, 70+30); + mess := BMessage.Create(MSG_BUTTON_BASE+5); + Button2 := BButton.Create(aRect2, 'Add Item', 'Dec', mess, B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Button2.SetViewColor(rgb); + Box2.AddChild(Button2, nil); + aRect2.Free; + + // Show text Message + aRect2:= BRect.Create(20, 120, 100, 130); + Value := BStringView.Create(aRect2,'explain','Position : ',B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Box2.AddChild(Value, nil); + aRect2.Free; + + // Box for Alert + aRect2 := BRect.Create(220, 20, 350, 300); + Box1 := BBox.Create(aRect2, 'Box1', B_FOLLOW_LEFT or B_FOLLOW_TOP, + B_WILL_DRAW or B_NAVIGABLE, B_PLAIN_BORDER); + Box1.SetLabel('BAlert'); + Box1.SetBorder(B_FANCY_BORDER); + AddChild(Box1, nil); + aRect2.Free; + + // Button 3 + aRect2 := BRect.Create(20, 20, 100, 30); + mess := BMessage.Create(MSG_BUTTON_BASE+6); + Button3 := BButton.Create(aRect2, 'Add Item', 'Alert', mess, B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); + Button3.SetViewColor(rgb); + Box1.AddChild(Button3, nil); + aRect2.Free; + +end; + +end. diff --git a/bepascal/source/bepascal/cpp/Jamfile b/bepascal/source/bepascal/cpp/Jamfile new file mode 100644 index 0000000..3e6defd --- /dev/null +++ b/bepascal/source/bepascal/cpp/Jamfile @@ -0,0 +1,154 @@ +SubDir BEPASCAL_TOP source bepascal cpp ; + +## OpenBeOS Generic Jamfile v1.0 ## + +## Fill in this file to specify the project being created, and the referenced +## Jamfile-engine will do all of the hard work for you. This handles both +## Intel and PowerPC builds of the (Open)BeOS. + +## Application Specific Settings --------------------------------------------- + +# Specify the name of the binary +# If the name has spaces, you must quote it: "My App" +NAME = libbepascal.so ; + +# Specify the type of binary +# APP: Application +# SHARED: Shared library or add-on +# STATIC: Static library archive +# DRIVER: Kernel Driver +TYPE = SHARED ; + +# Specify the source files to use +# Full paths or paths relative to the Jamfile can be included. +# All files, regardless of directory, will have their object +# files created in the common object directory. +# Note that this means this Jamfile will not work correctly +# if two source files with the same name (source.c or source.cpp) +# are included from different directories. +# Ex: SRCS = file1.cpp file2.cpp file3.cpp ; +SRCS = src/be/bepas_kernel/beobj.cpp + src/be/app/Application.cpp + src/be/app/Clipboard.cpp + src/be/app/Handler.cpp + src/be/app/Invoker.cpp + src/be/app/Looper.cpp + src/be/app/Message.cpp + src/be/app/Messenger.cpp + src/be/app/Roster.cpp + src/be/device/Joystick.cpp + src/be/device/SerialPort.cpp + src/be/interface/Alert.cpp + src/be/interface/Box.cpp + src/be/interface/Button.cpp + src/be/interface/CheckBox.cpp + src/be/interface/Control.cpp + src/be/interface/Font.cpp + src/be/interface/ListItem.cpp + src/be/interface/ListView.cpp + src/be/interface/Menu.cpp + src/be/interface/MenuBar.cpp + src/be/interface/MenuItem.cpp + src/be/interface/OutlineListView.cpp + src/be/interface/Point.cpp + src/be/interface/Rect.cpp + src/be/interface/RadioButton.cpp + src/be/interface/ScrollBar.cpp + src/be/interface/ScrollView.cpp + src/be/interface/StatusBar.cpp + src/be/interface/StringView.cpp + src/be/interface/TabView.cpp + src/be/interface/TextControl.cpp + src/be/interface/TextView.cpp + src/be/interface/View.cpp + src/be/interface/Window.cpp + src/be/mail/E-mail.cpp + src/be/storage/Volume.cpp + src/be/storage/VolumeRoster.cpp + src/be/support/Archivable.cpp + src/be/support/DataIO.cpp + src/be/support/Flattenable.cpp + src/be/support/List.cpp + src/be/support/String.cpp + src/hey/hey.cpp ; + +# Specify the resource files to use +# Full path or a relative path to the resource file can be used. +RSRCS = ; + +# Specify additional libraries to link against +# There are two acceptable forms of library specifications +# - if your library follows the naming pattern of: +# libXXX.so or libXXX.a you can simply specify XXX +# library: libbe.so entry: be +# +# - if your library does not follow the standard library +# naming scheme you need to specify the path to the library +# and it's name +# library: my_lib.a entry: my_lib.a or path/my_lib.a +LIBS = be mail device ; + +# Specify additional paths to directories following the standard +# libXXX.so or libXXX.a naming scheme. You can specify full paths +# or paths relative to the Jamfile. The paths included may not +# be recursive, so include all of the paths where libraries can +# be found. Directories where source files are found are +# automatically included. +LIBPATHS = ; + +# Additional paths to look for system headers +# These use the form: #include
+# source file directories are NOT auto-included here +SYSTEM_INCLUDE_PATHS = $(SEARCH_SOURCE)/include/be/app + $(SEARCH_SOURCE)/include/be/bepas_kernel + $(SEARCH_SOURCE)/include/be/interface + $(SEARCH_SOURCE)/include/be/support + $(SEARCH_SOURCE)/include/hey ; + +# Additional paths to look for local headers +# thes use the form: #include "header" +# source file directories are automatically included +LOCAL_INCLUDE_PATHS = ; + +# Specify the level of optimization that you desire +# NONE, SOME, FULL +OPTIMIZE = ; + +# Specify any preprocessor symbols to be defined. The symbols will not +# have their values set automatically; you must supply the value (if any) +# to use. For example, setting DEFINES to "DEBUG=1" will cause the +# compiler option "-DDEBUG=1" to be used. Setting DEFINES to "DEBUG" +# would pass "-DDEBUG" on the compiler's command line. +DEFINES = ; + +# Specify special warning levels +# if unspecified default warnings will be used +# NONE = supress all warnings +# ALL = enable all warnings +WARNINGS = ; + +# Specify whether image symbols will be created +# so that stack crawls in the debugger are meaningful +# if TRUE symbols will be created +SYMBOLS = ; + +# Specify debug settings +# if TRUE will allow application to be run from a source-level +# debugger. Note that this will disable all optimzation. +DEBUGGER = ; + +# Specify additional compiler flags for all files +COMPILER_FLAGS = ; + +# Specify additional linker flags +LINKER_FLAGS = ; + +# (for TYPE == DRIVER only) Specify desired location of driver in the /dev +# hierarchy. Used by the driverinstall rule. E.g., DRIVER_PATH = video/usb will +# instruct the driverinstall rule to place a symlink to your driver's binary in +# ~/add-ons/kernel/drivers/dev/video/usb, so that your driver will appear at +# /dev/video/usb when loaded. Default is "misc". +DRIVER_PATH = ; + +## Include the Jamfile-engine +include $(BUILDHOME)/etc/Jamfile-engine ; diff --git a/bepascal/source/bepascal/cpp/include/be/app/application.h b/bepascal/source/bepascal/cpp/include/be/app/application.h new file mode 100644 index 0000000..9446f8c --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/app/application.h @@ -0,0 +1,56 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _APPLICATION_H_ +#define _APPLICATION_H_ + +#include +#include +#include + +// #include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +class BPApplication : public BApplication, public virtual BPLooper +{ + public: + BPApplication(TPasObject PasObject, const char *signature); + BPApplication(TPasObject PasObject, const char *signature, + status_t *error); + virtual void AppActivated(bool active); + virtual void ReadyToRun(void); + virtual bool QuitRequested(void); + virtual void MessageReceived(BMessage *message); + virtual void DispatchMessage(BMessage *message, BHandler *target); + virtual void AppActivated_hookCall(bool active); + virtual void ReadyToRun_hookCall(void); + private: +}; + +#endif /* _APPLICATION_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/app/handler.h b/bepascal/source/bepascal/cpp/include/be/app/handler.h new file mode 100644 index 0000000..eba51dd --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/app/handler.h @@ -0,0 +1,41 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _HANDLER_H_ +#define _HANDLER_H_ + +#include + +#include + +// definition of callback function in BHandler + +typedef void (*BHandler_MessageReceived_hook) (TPasObject PasObject, TCPlusObject message); + +class BPHandler : public BHandler, public virtual BPasObject +{ + public: + BPHandler(TPasObject PasObject, const char *name = NULL); + BPHandler(TPasObject PasObject, BMessage *archive); + virtual ~BPHandler(void); + virtual void MessageReceived(BMessage *message); + virtual void MessageReceived_hookCall(BMessage *message); + private: +}; + +#endif /* _HANDLER_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/app/looper.h b/bepascal/source/bepascal/cpp/include/be/app/looper.h new file mode 100644 index 0000000..4722c59 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/app/looper.h @@ -0,0 +1,46 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _LOOPER_H_ +#define _LOOPER_H_ + +#include +#include + +#include + +#include + +#include + +class BPLooper : public BLooper, public virtual BPHandler +{ + public: + BPLooper(TPasObject PasObject, const char *name = NULL, + int32 priority = B_NORMAL_PRIORITY, + int32 portCapacity = B_LOOPER_PORT_DEFAULT_CAPACITY); + virtual ~BPLooper(); + virtual void DispatchMessage(BMessage *message, BHandler *target); + virtual bool QuitRequested(void); + virtual void MessageReceived(BMessage *message); + virtual void DispatchMessage_hookCall(BMessage *message, BHandler *target); + virtual bool QuitRequested_hookCall(void); + private: +}; + +#endif /* _LOOPER_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/app/message.h b/bepascal/source/bepascal/cpp/include/be/app/message.h new file mode 100644 index 0000000..3acc37c --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/app/message.h @@ -0,0 +1,38 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _MESSAGE_H_ +#define _MESSAGE_H_ + +#include +#include + +#include + +#include + +class BPMessage : public BMessage, private BPasObject +{ + public: + BPMessage(TPasObject PasObject); + BPMessage(TPasObject PasObject, uint32 what); + BPMessage(TPasObject PasObject, TCPlusObject message); + private: +}; + +#endif /* _MESSAGE_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/app/roster.h b/bepascal/source/bepascal/cpp/include/be/app/roster.h new file mode 100644 index 0000000..db1a1f3 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/app/roster.h @@ -0,0 +1,24 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _ROSTER_H_ +#define _ROSTER_H_ + +#include + +#endif /* _ROSTER_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/bepas_kernel/beobj.h b/bepascal/source/bepascal/cpp/include/be/bepas_kernel/beobj.h new file mode 100644 index 0000000..cad0ad4 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/bepas_kernel/beobj.h @@ -0,0 +1,38 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _BEOBJ_H_ +#define _BEOBJ_H_ + +typedef void* TPasObject; +typedef void* TCPlusObject; + +typedef char *(*BPasObject_GetPasClassName_hook)(TPasObject PasObject); + +class BPasObject +{ + public: + BPasObject(TPasObject PasObject); + TPasObject GetPasObject(void) const; + virtual ~BPasObject(void); + char *GetPasClassName(void); + private: + TPasObject FPasObject; +}; + +#endif /* _BEOBJ_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/interface/control.h b/bepascal/source/bepascal/cpp/include/be/interface/control.h new file mode 100644 index 0000000..55a8f9c --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/interface/control.h @@ -0,0 +1,51 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _CONTROL_H_ +#define _CONTROL_H_ + +#include + +#include "view.h" + +typedef void (*BControl_SetEnabled_hook) (TPasObject PasObject, bool enabled); +typedef void (*BControl_SetValue_hook) (TPasObject PasObject, int32 value); + +class BPControl : public BControl, virtual public BPView +{ + public: + // + BPControl(TPasObject PasObject, + BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizeMask, + uint32 flags); + BPControl(TPasObject PasObject, BMessage *message); + virtual void MessageReceived(BMessage *message); + virtual void Draw(BRect updateRect); + virtual void AttachedToWindow(void); + virtual void SetEnabled(bool enabled); + virtual void SetValue(int32 value); + virtual void SetEnabled_hookCall(bool enabled); + virtual void SetValue_hookCall(int32 value); + private: +}; + +#endif /* _CONTROL_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/interface/font.h b/bepascal/source/bepascal/cpp/include/be/interface/font.h new file mode 100644 index 0000000..fcadc30 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/interface/font.h @@ -0,0 +1,33 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _FONT_H_ +#define _FONT_H_ + +#include "Font.h" +#include "Rect.h" +#include + +class BPFont : public BFont, public BPasObject +{ + public: + BPFont(TPasObject PasObject); + BPFont(TPasObject PasObject, const BFont &font); +}; + +#endif _FONT_H_ /* _FONT_H_ */ diff --git a/bepascal/source/bepascal/cpp/include/be/interface/listview.h b/bepascal/source/bepascal/cpp/include/be/interface/listview.h new file mode 100644 index 0000000..c56b20f --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/interface/listview.h @@ -0,0 +1,79 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _LISTVIEW_H_ +#define _LISTVIEW_H_ + +#include +#include + +#include +#include + +#include +#include + +class BPListView : public BListView, virtual public BPView +{ + +public: + BPListView(TPasObject PasObject,BRect frame, + const char *name, + list_view_type type = B_SINGLE_SELECTION_LIST, + uint32 resizeMask = B_FOLLOW_LEFT | + B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | + B_NAVIGABLE); + BPListView(TPasObject PasObject,BMessage *data); +static BArchivable *Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; +virtual void Draw(BRect updateRect); +virtual void MessageReceived(BMessage *msg); +virtual void MouseDown(BPoint where); +virtual void KeyDown(const char *bytes, int32 numBytes); +//virtual void MakeFocus(bool state = true); +virtual void FrameResized(float newWidth, float newHeight); +virtual void AttachedToWindow(); +//virtual void FrameMoved(BPoint new_position); + +/*virtual BHandler *ResolveSpecifier(BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property);*/ + +//virtual status_t Perform(perform_code d, void *arg); + +virtual void WindowActivated(bool state); +virtual void MouseUp(BPoint pt); +virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); +virtual void DetachedFromWindow(); + +//virtual void ResizeToPreferred(); +//virtual void GetPreferredSize(float *width, float *height); +virtual void AllAttached(); +virtual void AllDetached(); + + bool InitiateDrag(BPoint pt, int32 itemIndex, + bool initialySelected); + void SelectionChanged(); + +protected: +}; + +#endif /* _LISTVIEW_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/interface/menu.h b/bepascal/source/bepascal/cpp/include/be/interface/menu.h new file mode 100644 index 0000000..dfa75f9 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/interface/menu.h @@ -0,0 +1,43 @@ +#ifndef _MENU_H_ +#define _MENU_H_ + +#include "Menu.h" +#include "menu.h" +#include "Messenger.h" +#include "view.h" +#include + +class BPMenu : public BMenu, virtual public BPView +{ + public: + BPMenu(TPasObject PasObject, const char *name, menu_layout layout = B_ITEMS_IN_COLUMN); + BPMenu(TPasObject PasObject, const char *name, float width, float height); + BPMenu(TPasObject PasObject, BMessage *archive); + BPMenu(TPasObject PasObject, BRect frame, const char *name, uint32 resizingMode, uint32 flags, menu_layout layout, bool resizeToFit); + virtual void MessageReceived(BMessage *message); + virtual void Draw(BRect updateRect); + virtual void AttachedToWindow(void); + virtual void MakeDefault(bool flag); + virtual void WindowActivated(bool active); + + virtual void AllAttached(void); + virtual void AllDetached(void); + virtual void DetachedFromWindow(void); + virtual void DrawAfterChildren(BRect updateRect); + virtual void FrameMoved(BPoint parentPoint); + virtual void FrameResized(float width, float height); + virtual void GetPreferredSize(float *width, float *height); + virtual void ResizeToPreferred(void); + virtual void KeyDown(const char *bytes, int32 numBytes); + virtual void KeyUp(const char *bytes, int32 numBytes); + virtual void MouseDown(BPoint point); + virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message); + virtual void MouseUp(BPoint point); + virtual void Pulse(void); +// virtual void TargetedByScrollView(BScrollView *scroller); + virtual void SetEnabled(bool enabled); + virtual void SetValue(int32 value); + private: +}; + +#endif /* _MENU_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/interface/menubar.h b/bepascal/source/bepascal/cpp/include/be/interface/menubar.h new file mode 100644 index 0000000..cd7e414 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/interface/menubar.h @@ -0,0 +1,43 @@ +#ifndef _MENUBAR_H_ +#define _MENUBAR_H_ + +#include "MenuBar.h" +#include "menu.h" +#include + +class BPMenuBar : public BMenuBar, virtual public BPMenu +{ + public: + BPMenuBar(TPasObject PasObject, BRect frame, const char *name, + uint32 resizingMode = B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, + menu_layout layout = B_ITEMS_IN_COLUMN, bool resizeToFit = true); + BPMenuBar(TPasObject PasObject, const char *name, float width, float height); + BPMenuBar(TPasObject PasObject, BMessage *archive); + BPMenuBar(TPasObject PasObject, BRect frame, const char *name, uint32 resizingMode, uint32 flags, menu_layout layout, bool resizeToFit); + virtual void MessageReceived(BMessage *message); + virtual void Draw(BRect updateRect); + virtual void AttachedToWindow(void); + virtual void MakeDefault(bool flag); + virtual void WindowActivated(bool active); + + virtual void AllAttached(void); + virtual void AllDetached(void); + virtual void DetachedFromWindow(void); + virtual void DrawAfterChildren(BRect updateRect); + virtual void FrameMoved(BPoint parentPoint); + virtual void FrameResized(float width, float height); + virtual void GetPreferredSize(float *width, float *height); + virtual void ResizeToPreferred(void); + virtual void KeyDown(const char *bytes, int32 numBytes); + virtual void KeyUp(const char *bytes, int32 numBytes); + virtual void MouseDown(BPoint point); + virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message); + virtual void MouseUp(BPoint point); + virtual void Pulse(void); +// virtual void TargetedByScrollView(BScrollView *scroller); + virtual void SetEnabled(bool enabled); + virtual void SetValue(int32 value); + private: +}; + +#endif /* _MENU_H_ */ diff --git a/bepascal/source/bepascal/cpp/include/be/interface/menuitem.h b/bepascal/source/bepascal/cpp/include/be/interface/menuitem.h new file mode 100644 index 0000000..b36e7e3 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/interface/menuitem.h @@ -0,0 +1,51 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _MENUITEM_H_ +#define _MENUITEM_H_ + +#include +#include +#include + +class BPMenuItem : public BMenuItem, virtual public BPasObject +{ + public: + BPMenuItem(TPasObject PasObject, const char *label, BMessage *message, char shortcut = 0, uint32 modifiers = 0); + BPMenuItem(TPasObject PasObject, BMenu *submenu, BMessage *message = NULL); + BPMenuItem(TPasObject PasObejct, BMessage *data); + virtual void Draw(void); + virtual void DrawContent(void); + virtual void GetContentSize(float *width, float *height); + virtual void TruncateLabel(float max, char *new_label); + virtual void Highlight(bool on); + bool IsSelected() const; + BPoint ContentLocation() const; + private: +}; + +class BPSeparatorItem : public BSeparatorItem, virtual public BPMenuItem +{ + public: + BPSeparatorItem(TPasObject PasObject); + BPSeparatorItem(TPasObject PasObject, BMessage *data); + virtual void Draw(void); + virtual void DrawContent(void); +}; + +#endif /* _MENUITEM_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/interface/point.h b/bepascal/source/bepascal/cpp/include/be/interface/point.h new file mode 100644 index 0000000..481ada5 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/interface/point.h @@ -0,0 +1,34 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _POINT_H_ +#define _POINT_H_ + +#include + +#include + +class BPPoint : public BPoint, public BPasObject +{ + public: + BPPoint(TPasObject PasObject, float x, float y); + BPPoint(TPasObject PasObject, const BPoint& point); + BPPoint(TPasObject PasObject); +}; + +#endif _POINT_H_ /* _POINT_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/interface/rect.h b/bepascal/source/bepascal/cpp/include/be/interface/rect.h new file mode 100644 index 0000000..03b0fad --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/interface/rect.h @@ -0,0 +1,37 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _RECT_H_ +#define _RECT_H_ + +#include +#include + +#include +#include + +class BPRect : public BRect, public BPasObject +{ + public: + BPRect(TPasObject PasObject); + BPRect(TPasObject PasObject, const BRect & rect); + BPRect(TPasObject PasObject, float l, float t, float r, float b); + BPRect(TPasObject PasObject, BPoint leftTop, BPoint rightBottom); +}; + +#endif _RECT_H_ /* _RECT_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/interface/view.h b/bepascal/source/bepascal/cpp/include/be/interface/view.h new file mode 100644 index 0000000..7ab677f --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/interface/view.h @@ -0,0 +1,78 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _VIEW_H_ +#define _VIEW_H_ + +#include + +#include + +#include +#include + +class BPView : public BView, public virtual BPHandler +{ + public: + BPView(TPasObject PasObject, + BRect frame, + const char *name, + uint32 resizingMode, + uint32 flags); + BPView(TPasObject PasObject, BMessage *archive); + virtual void MessageReceived(BMessage *message); + virtual void AllAttached(void); + virtual void AttachedToWindow(void); + virtual void AllDetached(void); + virtual void DetachedFromWindow(void); + virtual void Draw(BRect updateRect); + virtual void DrawAfterChildren(BRect updateRect); + virtual void FrameMoved(BPoint parentPoint); + virtual void FrameResized(float width, float height); + virtual void GetPreferredSize(float *width, float *height); + virtual void ResizeToPreferred(void); + virtual void KeyDown(const char *bytes, int32 numBytes); + virtual void KeyUp(const char *bytes, int32 numBytes); + virtual void MouseDown(BPoint point); + virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message); + virtual void MouseUp(BPoint point); + virtual void Pulse(void); +// virtual void TargetedByScrollView(BScrollView *scroller); + virtual void WindowActivated(bool active); + virtual void Draw_hookCall(BRect updateRect); + virtual void AttachedToWindow_hookCall(void); + virtual void AllAttached_hookCall(void); + virtual void AllDetached_hookCall(void); + virtual void DetachedFromWindow_hookCall(void); + virtual void DrawAfterChildren_hookCall(BRect updateRect); + virtual void FrameMoved_hookCall(BPoint parentPoint); + virtual void FrameResized_hookCall(float width, float height); + virtual void GetPreferredSize_hookCall(float *width, float *height); + virtual void ResizeToPreferred_hookCall(void); + virtual void KeyDown_hookCall(const char *bytes, int32 numBytes); + virtual void KeyUp_hookCall(const char *bytes, int32 numBytes); + virtual void MouseDown_hookCall(BPoint point); + virtual void MouseMoved_hookCall(BPoint point, uint32 transit, const BMessage *message); + virtual void MouseUp_hookCall(BPoint point); + virtual void Pulse_hookCall(void); +// virtual void TargetedByScrollView_hookCall(BScrollView *scroller); + virtual void WindowActivated_hookCall(bool active); + private: +}; + +#endif /* _VIEW_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/interface/window.h b/bepascal/source/bepascal/cpp/include/be/interface/window.h new file mode 100644 index 0000000..72ef636 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/interface/window.h @@ -0,0 +1,46 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., s59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _WINDOW_H_ +#define _WINDOW_H_ + +#include + +#include + +#include +#include +#include + +class BPWindow : public BWindow, public BPLooper +{ + public: + BPWindow(TPasObject PasObject, + BRect frame, + const char *title, + window_type type, + uint32 flags, + uint32 workspaces = B_CURRENT_WORKSPACE); + virtual void MessageReceived(BMessage *message); + virtual void DispatchMessage(BMessage *message, BHandler *target); + virtual bool QuitRequested(void); + virtual void WindowActivated(bool active); + private: +}; + +#endif /* _WINDOW_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/be/support/archivable.h b/bepascal/source/bepascal/cpp/include/be/support/archivable.h new file mode 100644 index 0000000..0af6221 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/be/support/archivable.h @@ -0,0 +1,42 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _ARCHIVABLE_H_ +#define _ARCHIVABLE_H_ + +#include + +#include + +#include + + +class _EXPORT BPArchivable : public BArchivable, private BPasObject +{ + public: + BPArchivable(TPasObject PasObject); + BPArchivable(TPasObject PasObject, BMessage *from); + ~BPArchivable(void); +virtual status_t Archive(BMessage *into, bool deep = true) const; +virtual status_t ArchiveFromPascal(BMessage *into, bool deep = true); +static BArchivable *Instantiate(BMessage *from); + + private: +}; + +#endif /* _ARCHIVABLE_H_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/include/hey/hey.h b/bepascal/source/bepascal/cpp/include/hey/hey.h new file mode 100644 index 0000000..0c39cd6 --- /dev/null +++ b/bepascal/source/bepascal/cpp/include/hey/hey.h @@ -0,0 +1,21 @@ +#ifndef HEY_H +#define HEY_H + +#include + +__declspec(dllexport) int32 HeyInterpreterThreadHook(void* arg); + +__declspec(dllexport) status_t Hey(BMessenger* target, const char* arg, BMessage* reply); +__declspec(dllexport) bool isSpace(char c); +__declspec(dllexport) status_t Hey(BMessenger* target, char* argv[], int32* argx, int32 argc, BMessage* reply); +__declspec(dllexport) status_t add_specifier(BMessage *to_message, char *argv[], int32 *argx, int32 argc); +__declspec(dllexport) status_t add_data(BMessage *to_message, char *argv[], int32 *argx); +__declspec(dllexport) status_t add_with(BMessage *to_message, char *argv[], int32 *argx, int32 argc); +__declspec(dllexport) void add_message_contents(BList *textlist, BMessage *msg, int32 level); +__declspec(dllexport) char *get_datatype_string(int32 type); +__declspec(dllexport) char *format_data(int32 type, char *ptr, long size); +__declspec(dllexport) void print_message(BMessage *message); +__declspec(dllexport) char *id_to_string(long ID, char *here); +__declspec(dllexport) bool is_valid_char(uint8 c); + +#endif diff --git a/bepascal/source/bepascal/cpp/src/be/app/Application.cpp b/bepascal/source/bepascal/cpp/src/be/app/Application.cpp new file mode 100644 index 0000000..80bb816 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/app/Application.cpp @@ -0,0 +1,174 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _APPLICATION_CPP_ +#define _APPLICATION_CPP_ + +#include +#include +#include + +#include + +// #include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +// definition of callback function in BApplication +typedef void (*BApplication_AppActivated_hook) (TPasObject PasObject, bool active); +typedef void (*BApplication_ReadyToRun_hook) (TPasObject PasObject); +// typedef bool (*BApplication_QuitRequested_hook) (TPasObject PasObject); +// typedef void (*BApplication_MessageReceived_hook) (TPasObject PasObject, TCPlusObject message); + +#if defined(__cplusplus) +extern "C" { +#endif + +BApplication_AppActivated_hook Application_AppActivated_hook; +BApplication_ReadyToRun_hook Application_ReadyToRun_hook; +//BApplication_QuitRequested_hook Application_QuitRequested_hook; +//BApplication_MessageReceived_hook Application_MessageReceived_hook; + +BMessenger *be_app_messengerCPlus; + +#if defined(__cplusplus) +} +#endif + +BPApplication::BPApplication(TPasObject PasObject, const char *signature) + : BApplication(signature), BPHandler(PasObject), BPLooper(PasObject), + BPasObject(PasObject) +{ + be_app_messengerCPlus = &be_app_messenger; +} + +BPApplication::BPApplication(TPasObject PasObject, const char *signature, + status_t *error) : BApplication(signature, error), + BPHandler(PasObject), + BPLooper(PasObject), + BPasObject(PasObject) +{ + be_app_messengerCPlus = &be_app_messenger; +} + +void BPApplication::AppActivated(bool active) +{ + AppActivated_hookCall(active); + BApplication::AppActivated(active); +} + +void BPApplication::AppActivated_hookCall(bool active) +{ + Application_AppActivated_hook(GetPasObject(), active); +} + +void BPApplication::ReadyToRun(void) +{ + ReadyToRun_hookCall(); + BApplication::ReadyToRun(); +} + +void BPApplication::ReadyToRun_hookCall(void) +{ + Application_ReadyToRun_hook(GetPasObject()); +} + +bool BPApplication::QuitRequested(void) +{ + return QuitRequested_hookCall(); +// return BApplication::QuitRequested(); +} + +void BPApplication::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BApplication::MessageReceived(message); +} + +void BPApplication::DispatchMessage(BMessage *message, BHandler *target) +{ + DispatchMessage_hookCall(message, target); +// message->PrintToStream(); + BApplication::DispatchMessage(message, target); +} + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BApplication_Create_1(TPasObject PasObject) +{ + return new BPApplication(PasObject, "application/x-vnd.RuBe"); +} + +TCPlusObject BApplication_Create_2(TPasObject PasObject, const char *Signature) +{ + return new BPApplication(PasObject, Signature); +} + +TCPlusObject BApplication_Create_3(TPasObject PasObject, const char *Signature, + status_t *error) +{ + return new BPApplication(PasObject, Signature, error); +} + +void BApplication_Free(TCPlusObject Application) +{ + delete Application; +} + +void BApplication_HideCursor(TCPlusObject Application) +{ + reinterpret_cast(Application)->HideCursor(); +} + +void BApplication_ShowCursor(TCPlusObject Application) +{ + reinterpret_cast(Application)->ShowCursor(); +} + +thread_id BApplication_Run(TCPlusObject Application) +{ + return reinterpret_cast(Application)->Run(); +} + +void BApplication_Quit(TCPlusObject Application) +{ + reinterpret_cast(Application)->Quit(); +} + +status_t BApplication_GetAppInfo(TCPlusObject Application,app_info *info) +{ + reinterpret_cast(Application)->GetAppInfo(info); +} + + +#if defined(__cplusplus) +} +#endif + +#endif /* _APPLICATION_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/app/Clipboard.cpp b/bepascal/source/bepascal/cpp/src/be/app/Clipboard.cpp new file mode 100644 index 0000000..548832a --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/app/Clipboard.cpp @@ -0,0 +1,273 @@ +#ifndef _CLIPBOARD_CPP_ +#define _CLIPBOARD_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Clipboard.cpp + * DATE: Fri Sep 27 23:26:07 2002 + * DESCR: + ***********************************************************************/ +#include "Clipboard.h" + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Method: BClipboard::BClipboard() + * Descr: + */ +TCPlusObject BClipboard_Create(const char *name, + bool transient) +{ + return new BClipboard(name, + transient); +} + + +/* + * Method: BClipboard::~BClipboard() + * Descr: + */ +void BClipboard_Free(BClipboard *Clipboard) +{ + delete Clipboard; +} + + +/* + * Method: BClipboard::Name() + * Descr: + */ +const char * +BClipboard_Name(BClipboard *Clipboard) +{ + return Clipboard->Name(); +} + + +/* + * Method: BClipboard::LocalCount() + * Descr: + */ +uint32 +BClipboard_LocalCount(BClipboard *Clipboard) +{ + return Clipboard->LocalCount(); +} + + +/* + * Method: BClipboard::SystemCount() + * Descr: + */ +uint32 +BClipboard_SystemCount(BClipboard *Clipboard) +{ + return Clipboard->SystemCount(); +} + + +/* + * Method: BClipboard::StartWatching() + * Descr: + */ +status_t +BClipboard_StartWatching(BClipboard *Clipboard, BMessenger target) +{ + return Clipboard->StartWatching(target); +} + + +/* + * Method: BClipboard::StopWatching() + * Descr: + */ +status_t +BClipboard_StopWatching(BClipboard *Clipboard, BMessenger target) +{ + return Clipboard->StopWatching(target); +} + + +/* + * Method: BClipboard::Lock() + * Descr: + */ +bool +BClipboard_Lock(BClipboard *Clipboard) +{ + return Clipboard->Lock(); +} + + +/* + * Method: BClipboard::Unlock() + * Descr: + */ +void +BClipboard_Unlock(BClipboard *Clipboard) +{ + Clipboard->Unlock(); +} + + +/* + * Method: BClipboard::IsLocked() + * Descr: + */ +bool +BClipboard_IsLocked(BClipboard *Clipboard) +{ + return Clipboard->IsLocked(); +} + + +/* + * Method: BClipboard::Clear() + * Descr: + */ +status_t +BClipboard_Clear(BClipboard *Clipboard) +{ + return Clipboard->Clear(); +} + + +/* + * Method: BClipboard::Commit() + * Descr: + */ +status_t +BClipboard_Commit(BClipboard *Clipboard) +{ + return Clipboard->Commit(); +} + + +/* + * Method: BClipboard::Revert() + * Descr: + */ +status_t +BClipboard_Revert(BClipboard *Clipboard) +{ + return Clipboard->Revert(); +} + + +/* + * Method: BClipboard::DataSource() + * Descr: + */ +BMessenger +BClipboard_DataSource(BClipboard *Clipboard) +{ + return Clipboard->DataSource(); +} + + +/* + * Method: BClipboard::Data() + * Descr: + */ +BMessage * +BClipboard_Data(BClipboard *Clipboard) +{ + return Clipboard->Data(); +} + + +/* + * Method: BClipboard::BClipboard() + * Descr: + */ +/*TCPlusObject BClipboard_Create(TPasObject PasObject, const BClipboard &) +{ + return new BPClipboard(PasObject, ); +}*/ + + +/* + * Method: BClipboard::operator=() + * Descr: + */ +/*BClipboard & +BClipboard_operator=(BClipboard *Clipboard, const BClipboard &) +{ + return Clipboard->operator=(); +}*/ + + +/* + * Method: BClipboard::_ReservedClipboard1() + * Descr: + */ +/*void +BClipboard__ReservedClipboard1(BClipboard *Clipboard) +{ + Clipboard->_ReservedClipboard1(); +}*/ + + +/* + * Method: BClipboard::_ReservedClipboard2() + * Descr: + */ +/*void +BClipboard__ReservedClipboard2(BClipboard *Clipboard) +{ + Clipboard->_ReservedClipboard2(); +}*/ + + +/* + * Method: BClipboard::_ReservedClipboard3() + * Descr: + */ +/*void +BClipboard__ReservedClipboard3(BClipboard *Clipboard) +{ + Clipboard->_ReservedClipboard3(); +}*/ + + +/* + * Method: BClipboard::AssertLocked() + * Descr: + */ +/*bool +BClipboard_AssertLocked(BClipboard *Clipboard) +{ + return Clipboard->AssertLocked(); +}*/ + + +/* + * Method: BClipboard::DownloadFromSystem() + * Descr: + */ +/*status_t +BClipboard_DownloadFromSystem(BClipboard *Clipboard, bool force) +{ + return Clipboard->DownloadFromSystem(force); +}*/ + + +/* + * Method: BClipboard::UploadToSystem() + * Descr: + */ +/*status_t +BClipboard_UploadToSystem(BClipboard *Clipboard) +{ + return Clipboard->UploadToSystem(); +}*/ + +#if defined(__cplusplus) +} +#endif + +#endif /* _CLIPBOARD_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/app/Handler.cpp b/bepascal/source/bepascal/cpp/src/be/app/Handler.cpp new file mode 100644 index 0000000..1ab1574 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/app/Handler.cpp @@ -0,0 +1,78 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _HANDLER_CPP_ +#define _HANDLER_CPP_ + +#include + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +BHandler_MessageReceived_hook Handler_MessageReceived_hook; + +#if defined(__cplusplus) +} +#endif + +BPHandler::BPHandler(TPasObject PasObject, const char *name) + : BHandler(name), BPasObject(PasObject) +{ + +} + +BPHandler::BPHandler(TPasObject PasObject, BMessage *archive) + : BHandler(archive), BPasObject(PasObject) +{ + +} + +BPHandler::~BPHandler() +{ +} + +void BPHandler::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BHandler::MessageReceived(message); +} + +void BPHandler::MessageReceived_hookCall(BMessage *message) +{ + Handler_MessageReceived_hook(GetPasObject(), message); +} + + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BHandler_Create(TPasObject PasObject, const char *name) +{ + return new BPHandler(PasObject, name); +} + +#if defined(__cplusplus) +} +#endif + +#endif /* _HANDLER_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/app/Invoker.cpp b/bepascal/source/bepascal/cpp/src/be/app/Invoker.cpp new file mode 100644 index 0000000..97a71ac --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/app/Invoker.cpp @@ -0,0 +1,352 @@ +#ifndef _INVOKER_CPP_ +#define _INVOKER_CPP_ +/*********************************************************************** + * AUTHOR: nobody + * FILE: Invoker.cpp + * DATE: Sat Nov 30 01:48:14 2002 + * DESCR: + ***********************************************************************/ +#include "Invoker.h" + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * Method: BInvoker::BInvoker + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BInvoker_Create(TPasObject PasObject) +{ + return new BInvoker(); +} + + +/*********************************************************************** + * Method: BInvoker::BInvoker + * Params: BMessage *message, const BHandler *handler, const BLooper *looper + * Effects: + ***********************************************************************/ +TCPlusObject BInvoker_Create_1 +(TPasObject PasObject, BMessage *message, const BHandler *handler, const BLooper *looper) +{ + return new BInvoker(message, handler, looper); +} + + +/*********************************************************************** + * Method: BInvoker::BInvoker + * Params: BMessage *message, BMessenger target + * Effects: + ***********************************************************************/ +TCPlusObject BInvoker_Create_2 +(TPasObject PasObject, BMessage *message, BMessenger target) +{ + return new BInvoker(message, target); +} + + +/*********************************************************************** + * Method: BInvoker::~BInvoker + * Params: + * Effects: + ***********************************************************************/ +void BInvoker_Free(BInvoker *Invoker) +{ + delete Invoker; +} + + +/*********************************************************************** + * Method: BInvoker::SetMessage + * Params: BMessage *message + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BInvoker_SetMessage(BInvoker *Invoker, BMessage *message) +{ + return Invoker->SetMessage(message); +} + + +/*********************************************************************** + * Method: BInvoker::Message + * Params: + * Returns: BMessage * + * Effects: + ***********************************************************************/ +BMessage * +BInvoker_Message(BInvoker *Invoker) +{ + return Invoker->Message(); +} + + +/*********************************************************************** + * Method: BInvoker::Command + * Params: + * Returns: uint32 + * Effects: + ***********************************************************************/ +uint32 +BInvoker_Command(BInvoker *Invoker) +{ + return Invoker->Command(); +} + + +/*********************************************************************** + * Method: BInvoker::SetTarget + * Params: const BHandler *h, const BLooper *loop + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BInvoker_SetTarget(BInvoker *Invoker, const BHandler *h, const BLooper *loop) +{ + return Invoker->SetTarget(h, loop); +} + + +/*********************************************************************** + * Method: BInvoker::SetTarget + * Params: BMessenger messenger + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BInvoker_SetTarget_1 +(BInvoker *Invoker, BMessenger messenger) +{ + return Invoker->SetTarget(messenger); +} + + +/*********************************************************************** + * Method: BInvoker::IsTargetLocal + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BInvoker_IsTargetLocal(BInvoker *Invoker) +{ + return Invoker->IsTargetLocal(); +} + + +/*********************************************************************** + * Method: BInvoker::Target + * Params: BLooper **looper + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BInvoker_Target(BInvoker *Invoker, BLooper **looper) +{ + return Invoker->Target(looper); +} + + +/*********************************************************************** + * Method: BInvoker::Messenger + * Params: + * Returns: BMessenger + * Effects: + ***********************************************************************/ +BMessenger +BInvoker_Messenger(BInvoker *Invoker) +{ + return Invoker->Messenger(); +} + + +/*********************************************************************** + * Method: BInvoker::SetHandlerForReply + * Params: BHandler *handler + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BInvoker_SetHandlerForReply(BInvoker *Invoker, BHandler *handler) +{ + return Invoker->SetHandlerForReply(handler); +} + + +/*********************************************************************** + * Method: BInvoker::HandlerForReply + * Params: + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BInvoker_HandlerForReply(BInvoker *Invoker) +{ + return Invoker->HandlerForReply(); +} + + +/*********************************************************************** + * Method: BInvoker::Invoke + * Params: BMessage *msg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BInvoker_Invoke(BInvoker *Invoker, BMessage *msg) +{ + return Invoker->Invoke(msg); +} + + +/*********************************************************************** + * Method: BInvoker::InvokeNotify + * Params: BMessage *msg, uint32 kind + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BInvoker_InvokeNotify_1 +(BInvoker *Invoker, BMessage *msg, uint32 kind) +{ + return Invoker->InvokeNotify(msg, kind); +} + + +/*********************************************************************** + * Method: BInvoker::SetTimeout + * Params: bigtime_t timeout + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BInvoker_SetTimeout(BInvoker *Invoker, bigtime_t timeout) +{ + return Invoker->SetTimeout(timeout); +} + + +/*********************************************************************** + * Method: BInvoker::Timeout + * Params: + * Returns: bigtime_t + * Effects: + ***********************************************************************/ +bigtime_t +BInvoker_Timeout(BInvoker *Invoker) +{ + return Invoker->Timeout(); +} + +// protected +/*********************************************************************** + * Method: BInvoker::InvokeKind + * Params: bool *notify + * Returns: uint32 + * Effects: + ***********************************************************************/ +/* uint32 +BInvoker_InvokeKind(BInvoker *Invoker, bool *notify) +{ + return Invoker->InvokeKind(notify); +} +*/ + +/*********************************************************************** + * Method: BInvoker::BeginInvokeNotify + * Params: uint32 kind + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BInvoker_BeginInvokeNotify(BInvoker *Invoker, uint32 kind) +{ + Invoker->BeginInvokeNotify(kind); +} +*/ + +/*********************************************************************** + * Method: BInvoker::EndInvokeNotify + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BInvoker_EndInvokeNotify(BInvoker *Invoker) +{ + Invoker->EndInvokeNotify(); +} +*/ + +///*********************************************************************** +// * Method: BInvoker::_ReservedInvoker1 +// * Params: +// * Returns: void +// * Effects: +// ***********************************************************************/ +//void +//BInvoker__ReservedInvoker1(BInvoker *Invoker) +//{ +// Invoker->_ReservedInvoker1(); +//} +// +// +///*********************************************************************** +// * Method: BInvoker::_ReservedInvoker2 +// * Params: +// * Returns: void +// * Effects: +// ***********************************************************************/ +//void +//BInvoker__ReservedInvoker2(BInvoker *Invoker) +//{ +// Invoker->_ReservedInvoker2(); +//} +// +// +///*********************************************************************** +// * Method: BInvoker::_ReservedInvoker3 +// * Params: +// * Returns: void +// * Effects: +// ***********************************************************************/ +//void +//BInvoker__ReservedInvoker3(BInvoker *Invoker) +//{ +// Invoker->_ReservedInvoker3(); +//} +// +// +///*********************************************************************** +// * Method: BInvoker::BInvoker +// * Params: const BInvoker & +// * Effects: +// ***********************************************************************/ +//TCPlusObject BInvoker_Create(TPasObject PasObject, const BInvoker &) +//{ +// return new BPInvoker(PasObject, ); +//} +// +// +///*********************************************************************** +// * Method: BInvoker::operator= +// * Params: const BInvoker & +// * Returns: BInvoker & +// * Effects: +// ***********************************************************************/ +//BInvoker & +//BInvoker_operator=(BInvoker *Invoker, const BInvoker &) +//{ +// return Invoker->operator=(); +//} + +#if defined(__cplusplus) +} +#endif + +#endif /* _INVOKER_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/app/Looper.cpp b/bepascal/source/bepascal/cpp/src/be/app/Looper.cpp new file mode 100644 index 0000000..2c9d04e --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/app/Looper.cpp @@ -0,0 +1,131 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _LOOPER_CPP_ +#define _LOOPER_CPP_ + +#include +#include + +#include + +#include + +#include +#include + +// definition of callback function in BLooper + +typedef void (*BLooper_DispatchMessage_hook) (TPasObject PasObject, + TCPlusObject message, + TCPlusObject target); +typedef bool(*BLooper_QuitRequested_hook) (TPasObject PasObject); + +#if defined(__cplusplus) +extern "C" { +#endif + +BLooper_DispatchMessage_hook Looper_DispatchMessage_hook; +BLooper_QuitRequested_hook Looper_QuitRequested_hook; + +#if defined(__cplusplus) +} +#endif + +BPLooper::BPLooper(TPasObject PasObject, const char *name = NULL, + int32 priority = B_NORMAL_PRIORITY, + int32 portCapacity = B_LOOPER_PORT_DEFAULT_CAPACITY) + : BLooper(name, priority, portCapacity), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ +} + +BPLooper::~BPLooper() +{ +} + +void BPLooper::DispatchMessage(BMessage *message, BHandler *target) +{ + DispatchMessage_hookCall(message, target); + BLooper::DispatchMessage(message, target); +} + +void BPLooper::DispatchMessage_hookCall(BMessage *message, BHandler *target) +{ + Looper_DispatchMessage_hook(GetPasObject(), message, target); +} + +bool BPLooper::QuitRequested(void) +{ + QuitRequested_hookCall(); + return Looper_QuitRequested_hook(GetPasObject()); +} + +bool BPLooper::QuitRequested_hookCall(void) +{ + return Looper_QuitRequested_hook(GetPasObject()); +} + +void BPLooper::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BLooper::MessageReceived(message); +} + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BLooper_Create(TPasObject PasObject, const char *name, + int32 priority, + int32 portCapacity) +{ + return new BPLooper(PasObject, name, priority, portCapacity); +} + +status_t BLooper_GetSupportedSuites(TCPlusObject Looper, BMessage *message) +{ + return reinterpret_cast(Looper)->GetSupportedSuites(message); +} + +bool BLooper_LockLooper(TCPlusObject Looper) +{ + return reinterpret_cast(Looper)->LockLooper(); +} + +status_t BLooper_LockLooperWithTimeout(TCPlusObject Looper, bigtime_t timeout) +{ + return reinterpret_cast(Looper)->LockLooperWithTimeout(timeout); +} + +void BLooper_UnlockLooper(TCPlusObject Looper) +{ + reinterpret_cast(Looper)->UnlockLooper(); +} + +status_t BLooper_PostMessage_2(TCPlusObject Looper, uint32 command) +{ + return reinterpret_cast(Looper)->PostMessage(command); +} + +#if defined(__cplusplus) +} +#endif + +#endif /* _LOOPER_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/app/Message.cpp b/bepascal/source/bepascal/cpp/src/be/app/Message.cpp new file mode 100644 index 0000000..3a24faf --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/app/Message.cpp @@ -0,0 +1,247 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _MESSAGE_CPP_ +#define _MESSAGE_CPP_ + +#include +#include + +#include + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif +// No hook in BMessage +#if defined(__cplusplus) +} +#endif + +BPMessage::BPMessage(TPasObject PasObject) + : BMessage(), BPasObject(PasObject) +{ + +} + +BPMessage::BPMessage(TPasObject PasObject, uint32 what) + : BMessage(what), BPasObject(PasObject) +{ + +} + + BPMessage::BPMessage(TPasObject PasObject, TCPlusObject message) + : BMessage(reinterpret_cast(message)), BPasObject(PasObject) +{ +// Attention, problème potentiel avec le reinterpret_cast de la référence +// A tester ! +// Je ne suis pas sur de la correspondance entre le C++ et le pascal +} + + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BMessage_Create_1(TPasObject PasObject) +{ + return new BPMessage(PasObject); +} + +TCPlusObject BMessage_Create_2(TPasObject PasObject, uint32 what) +{ + return new BPMessage(PasObject, what); +} + + TCPlusObject BMessage_Create_3(TPasObject PasObject, TCPlusObject message) +{ + return new BPMessage(PasObject, message); +} + +void BMessage_Free(TCPlusObject message) +{ + delete message; +} + +uint32 BMessage_Getwhat(TCPlusObject message) +{ + return reinterpret_cast(message)->what; +} + +void BMessage_Setwhat(TCPlusObject message, uint32 what) +{ + reinterpret_cast(message)->what = what; +} + +status_t BMessage_AddData(TCPlusObject message, const char *name, + type_code type, + const void *data, + ssize_t fixedSize = true, + int32 numItems = 1) +{ + return reinterpret_cast(message)->AddData(name, type, data, + fixedSize, numItems); +} + +status_t BMessage_AddBool(TCPlusObject message, const char *name, bool aBool) +{ + return reinterpret_cast(message)->AddBool(name, aBool); +} + +status_t BMessage_AddInt8(TCPlusObject message, const char *name, int8 anInt8) +{ + return reinterpret_cast(message)->AddInt8(name, anInt8); +} + +status_t BMessage_FindInt8(TCPlusObject message,const char *name, int8 *value) +{ + return reinterpret_cast(message)->FindInt8(name, value); +} + + +status_t BMessage_AddInt16(TCPlusObject message, const char *name, int16 anInt16) +{ + return reinterpret_cast(message)->AddInt16(name, anInt16); +} + +status_t BMessage_AddInt32(TCPlusObject message, const char *name, int32 anInt32) +{ + return reinterpret_cast(message)->AddInt32(name, anInt32); +} + +status_t BMessage_AddInt64(TCPlusObject message, const char *name, int64 anInt64) +{ + return reinterpret_cast(message)->AddInt64(name, anInt64); +} + +status_t BMessage_AddFloat(TCPlusObject message, const char *name, float aFloat) +{ + return reinterpret_cast(message)->AddFloat(name, aFloat); +} + +status_t BMessage_AddDouble(TCPlusObject message, const char *name, double aDouble) +{ + return reinterpret_cast(message)->AddDouble(name, aDouble); +} + +status_t BMessage_AddString(TCPlusObject message, const char *name, const char *string) +{ + return reinterpret_cast(message)->AddString(name, string); +} + +status_t BMessage_FindString(TCPlusObject message,const char *name, const char **str) +{ + return reinterpret_cast(message)->FindString(name, str); +} + + +status_t BMessage_AddMessage(TCPlusObject message, const char *name, const TCPlusObject amessage) +{ + return reinterpret_cast(message)->AddMessage(name, reinterpret_cast(amessage)); +} + +int32 BMessage_CountNames(TCPlusObject message, type_code type) +{ + return reinterpret_cast(message)->CountNames(type); +} + +bool BMessage_HasSpecifiers(TCPlusObject message) +{ + return reinterpret_cast(message)->HasSpecifiers(); +} + +bool BMessage_IsSystem(TCPlusObject message) +{ + return reinterpret_cast(message)->IsSystem(); +} + +status_t BMessage_MakeEmpty(TCPlusObject message) +{ + return reinterpret_cast(message)->MakeEmpty(); +} + +bool BMessage_IsEmpty(TCPlusObject message) +{ + return reinterpret_cast(message)->IsEmpty(); +} + +status_t BMessage_RemoveName(TCPlusObject message, const char *name) +{ + return reinterpret_cast(message)->RemoveName(name); +} + +void BMessage_PrintToStream(TCPlusObject message) +{ + reinterpret_cast(message)->PrintToStream(); +} + +status_t BMessage_RemoveData(TCPlusObject message, const char *name, int32 index = 0) +{ + return reinterpret_cast(message)->RemoveData(name, index); +} + +bool BMessage_WasDelivered(TCPlusObject message) +{ + return reinterpret_cast(message)->WasDelivered(); +} + +bool BMessage_IsSourceRemote(TCPlusObject message) +{ + return reinterpret_cast(message)->IsSourceRemote(); +} + +bool BMessage_IsSourceWaiting(TCPlusObject message) +{ + return reinterpret_cast(message)->IsSourceWaiting(); +} + +bool BMessage_IsReply(TCPlusObject message) +{ + return reinterpret_cast(message)->IsReply(); +} + +const BMessage *BMessage_Previous(TCPlusObject message) +{ + return reinterpret_cast(message)->Previous(); +} + +bool BMessage_WasDropped(TCPlusObject message) +{ + return reinterpret_cast(message)->WasDropped(); +} + +/*********************************************************************** + * Method: BMessage::operator= + * Params: const BMessage &msg + * Returns: BMessage & + * Effects: + ***********************************************************************/ +BMessage & +BMessage_operator_equal(BMessage *Message, const BMessage &msg) +{ + return Message->operator=(msg); +} + +#if defined(__cplusplus) +} +#endif + + +#endif /* _MESSAGE_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/app/Messenger.cpp b/bepascal/source/bepascal/cpp/src/be/app/Messenger.cpp new file mode 100644 index 0000000..06fe52b --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/app/Messenger.cpp @@ -0,0 +1,280 @@ +#ifndef _MESSENGER_CPP_ +#define _MESSENGER_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Messenger.cpp + * DATE: Sat Nov 30 02:32:17 2002 + * DESCR: + ***********************************************************************/ + +#include "Messenger.h" +#include "Application.h" +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * Method: BMessenger::BMessenger + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BMessenger_Create(TPasObject PasObject) +{ + return new BMessenger(); +} + + +/*********************************************************************** + * Method: BMessenger::BMessenger + * Params: const char *mime_sig, team_id team, status_t *perr + * Effects: + ***********************************************************************/ +TCPlusObject BMessenger_Create_1 +(TPasObject PasObject, const char *mime_sig, team_id team, status_t *perr) +{ + return new BMessenger(mime_sig, team, perr); +} + + +/*********************************************************************** + * Method: BMessenger::BMessenger + * Params: const BHandler *handler, const BLooper *looper, status_t *perr + * Effects: + ***********************************************************************/ +TCPlusObject BMessenger_Create_2 +(TPasObject PasObject, const BHandler *handler, const BLooper *looper, status_t *perr) +{ + return new BMessenger(handler, looper, perr); +} + + +/*********************************************************************** + * Method: BMessenger::BMessenger + * Params: const BMessenger &from + * Effects: + ***********************************************************************/ +TCPlusObject BMessenger_Create_3 +(TPasObject PasObject, const BMessenger &from) +{ + return new BMessenger(from); +} + + +/*********************************************************************** + * Method: BMessenger::~BMessenger + * Params: + * Effects: + ***********************************************************************/ +void BMessenger_Free(BMessenger *Messenger) +{ + delete Messenger; +} + + +/*********************************************************************** + * Method: BMessenger::IsTargetLocal + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMessenger_IsTargetLocal(BMessenger *Messenger) +{ + return Messenger->IsTargetLocal(); +} + + +/*********************************************************************** + * Method: BMessenger::Target + * Params: BLooper **looper + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BMessenger_Target(BMessenger *Messenger, BLooper **looper) +{ + return Messenger->Target(looper); +} + + +/*********************************************************************** + * Method: BMessenger::LockTarget + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMessenger_LockTarget(BMessenger *Messenger) +{ + return Messenger->LockTarget(); +} + + +/*********************************************************************** + * Method: BMessenger::LockTargetWithTimeout + * Params: bigtime_t timeout + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMessenger_LockTargetWithTimeout_1 +(BMessenger *Messenger, bigtime_t timeout) +{ + return Messenger->LockTargetWithTimeout(timeout); +} + + +/*********************************************************************** + * Method: BMessenger::SendMessage + * Params: uint32 command, BHandler *reply_to + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMessenger_SendMessage(BMessenger *Messenger, uint32 command, BHandler *reply_to) +{ + return Messenger->SendMessage(command, reply_to); +} + + +/*********************************************************************** + * Method: BMessenger::SendMessage + * Params: BMessage *a_message, BHandler *reply_to, bigtime_t timeout + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMessenger_SendMessage_1 +(BMessenger *Messenger, BMessage *a_message, BHandler *reply_to, bigtime_t timeout) +{ + return Messenger->SendMessage(a_message, reply_to, timeout); +} + + +/*********************************************************************** + * Method: BMessenger::SendMessage + * Params: BMessage *a_message, BMessenger reply_to, bigtime_t timeout + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMessenger_SendMessage_2 +(BMessenger *Messenger, BMessage *a_message, BMessenger reply_to, bigtime_t timeout) +{ + return Messenger->SendMessage(a_message, reply_to, timeout); +} + + +/*********************************************************************** + * Method: BMessenger::SendMessage + * Params: uint32 command, BMessage *reply + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMessenger_SendMessage_3 +(BMessenger *Messenger, uint32 command, BMessage *reply) +{ + return Messenger->SendMessage(command, reply); +} + + +/*********************************************************************** + * Method: BMessenger::SendMessage + * Params: BMessage *a_message, BMessage *reply, bigtime_t send_timeout, bigtime_t reply_timeout + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMessenger_SendMessage_4 +(BMessenger *Messenger, BMessage *a_message, BMessage *reply, bigtime_t send_timeout, bigtime_t reply_timeout) +{ + return Messenger->SendMessage(a_message, reply, send_timeout, reply_timeout); +} + + +///*********************************************************************** +// * Method: BMessenger::operator= +// * Params: const BMessenger &from +// * Returns: BMessenger & +// * Effects: +// ***********************************************************************/ +//BMessenger & +//BMessenger_operator=(BMessenger *Messenger, const BMessenger &from) +//{ +// return Messenger->operator=(from); +//} +// +// +///*********************************************************************** +// * Method: BMessenger::operator== +// * Params: const BMessenger &other +// * Returns: bool +// * Effects: +// ***********************************************************************/ +//bool +//BMessenger_operator==_1 +//(BMessenger *Messenger, const BMessenger &other) const +//{ +// return Messenger->operator==(other); +//} + + +/*********************************************************************** + * Method: BMessenger::IsValid + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMessenger_IsValid(BMessenger *Messenger) +{ + return Messenger->IsValid(); +} + + +/*********************************************************************** + * Method: BMessenger::Team + * Params: + * Returns: team_id + * Effects: + ***********************************************************************/ +team_id +BMessenger_Team(BMessenger *Messenger) +{ + return Messenger->Team(); +} + + +///*********************************************************************** +// * Method: BMessenger::BMessenger +// * Params: team_id team, port_id port, int32 token, bool preferred +// * Effects: +// ***********************************************************************/ +//TCPlusObject BMessenger_Create_4(TPasObject PasObject, team_id team, port_id port, int32 token, bool preferred) +//{ +// return new BMessenger(team, port, token, preferred); +//} + + +///*********************************************************************** +// * Method: BMessenger::InitData +// * Params: const char *mime_sig, team_id team, status_t *perr +// * Returns: void +// * Effects: +// ***********************************************************************/ +//void +//BMessenger_InitData(BMessenger *Messenger, const char *mime_sig, team_id team, status_t *perr) +//{ +// Messenger->InitData(mime_sig, team, perr); +//} + + +#if defined(__cplusplus) +} +#endif + +#endif /* _MESSENGER_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/app/Roster.cpp b/bepascal/source/bepascal/cpp/src/be/app/Roster.cpp new file mode 100644 index 0000000..8aaffde --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/app/Roster.cpp @@ -0,0 +1,744 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _ROSTER_CPP_ +#define _ROSTER_CPP_ + +#include +#include + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +const TCPlusObject Get_be_roster(void) +{ + // Pas très propre ! Si quelqu'un a mieux... + return TCPlusObject(be_roster); +} + +TCPlusObject BRoster_Create(TPasObject PasObject) +{ + return new BRoster(); +} + +void BRoster_Destroy(TPasObject PasObject) +{ + delete PasObject; +} + +//status_t BRoster_Broadcast(TCPlusObject Roster, TCPlusObject *message) +//{ +// return reinterpret_cast(Roster)->Broadcast(reinterpret_cast(message)); +//} + +/*********************************************************************** + * Method: BRoster::IsRunning + * Params: const char *mime_sig + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BRoster_IsRunning(BRoster *Roster, const char *mime_sig) +{ + return Roster->IsRunning(mime_sig); +} + + +/*********************************************************************** + * Method: BRoster::IsRunning + * Params: entry_ref *ref + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BRoster_IsRunning_1 +(BRoster *Roster, entry_ref *ref) +{ + return Roster->IsRunning(ref); +} + + +/*********************************************************************** + * Method: BRoster::TeamFor + * Params: const char *mime_sig + * Returns: team_id + * Effects: + ***********************************************************************/ +team_id +BRoster_TeamFor(BRoster *Roster, const char *mime_sig) +{ + return Roster->TeamFor(mime_sig); +} + + +/*********************************************************************** + * Method: BRoster::TeamFor + * Params: entry_ref *ref + * Returns: team_id + * Effects: + ***********************************************************************/ +team_id +BRoster_TeamFor_1 +(BRoster *Roster, entry_ref *ref) +{ + return Roster->TeamFor(ref); +} + + +/*********************************************************************** + * Method: BRoster::GetAppList + * Params: BList *team_id_list + * Returns: void + * Effects: + ***********************************************************************/ +void +BRoster_GetAppList(BRoster *Roster, BList *team_id_list) +{ + Roster->GetAppList(team_id_list); +} + + +/*********************************************************************** + * Method: BRoster::GetAppList + * Params: const char *sig, BList *team_id_list + * Returns: void + * Effects: + ***********************************************************************/ +void +BRoster_GetAppList_1 +(BRoster *Roster, const char *sig, BList *team_id_list) +{ + Roster->GetAppList(sig, team_id_list); +} + + +/*********************************************************************** + * Method: BRoster::GetAppInfo + * Params: const char *sig, app_info *info + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_GetAppInfo(BRoster *Roster, const char *sig, app_info *info) +{ + return Roster->GetAppInfo(sig, info); +} + + +/*********************************************************************** + * Method: BRoster::GetAppInfo + * Params: entry_ref *ref, app_info *info + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_GetAppInfo_1 +(BRoster *Roster, entry_ref *ref, app_info *info) +{ + return Roster->GetAppInfo(ref, info); +} + + +/*********************************************************************** + * Method: BRoster::GetRunningAppInfo + * Params: team_id team, app_info *info + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_GetRunningAppInfo(BRoster *Roster, team_id team, app_info *info) +{ + return Roster->GetRunningAppInfo(team, info); +} + + +/*********************************************************************** + * Method: BRoster::GetActiveAppInfo + * Params: app_info *info + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_GetActiveAppInfo(BRoster *Roster, app_info *info) +{ + return Roster->GetActiveAppInfo(info); +} + + +/*********************************************************************** + * Method: BRoster::FindApp + * Params: const char *mime_type, entry_ref *app + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_FindApp(BRoster *Roster, const char *mime_type, entry_ref *app) +{ + return Roster->FindApp(mime_type, app); +} + + +/*********************************************************************** + * Method: BRoster::FindApp + * Params: entry_ref *ref, entry_ref *app + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_FindApp_1 +(BRoster *Roster, entry_ref *ref, entry_ref *app) +{ + return Roster->FindApp(ref, app); +} + + +/*********************************************************************** + * Method: BRoster::Broadcast + * Params: BMessage *msg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_Broadcast(BRoster *Roster, BMessage *msg) +{ + return Roster->Broadcast(msg); +} + + +/*********************************************************************** + * Method: BRoster::Broadcast + * Params: BMessage *msg, BMessenger reply_to + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_Broadcast_1 +(BRoster *Roster, BMessage *msg, BMessenger reply_to) +{ + return Roster->Broadcast(msg, reply_to); +} + + +/*********************************************************************** + * Method: BRoster::StopWatching + * Params: BMessenger target + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_StopWatching(BRoster *Roster, BMessenger target) +{ + return Roster->StopWatching(target); +} + + +/*********************************************************************** + * Method: BRoster::ActivateApp + * Params: team_id team + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_ActivateApp(BRoster *Roster, team_id team) +{ + return Roster->ActivateApp(team); +} + + +/*********************************************************************** + * Method: BRoster::Launch + * Params: const char *mime_type, BMessage *initial_msgs, team_id *app_team + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_Launch(BRoster *Roster, const char *mime_type, BMessage *initial_msgs, team_id *app_team) +{ + return Roster->Launch(mime_type, initial_msgs, app_team); +} + + +/*********************************************************************** + * Method: BRoster::Launch + * Params: const char *mime_type, BList *message_list, team_id *app_team + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_Launch_1 +(BRoster *Roster, const char *mime_type, BList *message_list, team_id *app_team) +{ + return Roster->Launch(mime_type, message_list, app_team); +} + + +/*********************************************************************** + * Method: BRoster::Launch + * Params: const char *mime_type, int argc, char **args, team_id *app_team + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_Launch_2 +(BRoster *Roster, const char *mime_type, int argc, char **args, team_id *app_team) +{ + return Roster->Launch(mime_type, argc, args, app_team); +} + + +/*********************************************************************** + * Method: BRoster::Launch + * Params: const entry_ref *ref, const BMessage *initial_message, team_id *app_team + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_Launch_3 +(BRoster *Roster, const entry_ref *ref, const BMessage *initial_message, team_id *app_team) +{ + return Roster->Launch(ref, initial_message, app_team); +} + + +/*********************************************************************** + * Method: BRoster::Launch + * Params: const entry_ref *ref, const BList *message_list, team_id *app_team + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_Launch_4 +(BRoster *Roster, const entry_ref *ref, const BList *message_list, team_id *app_team) +{ + return Roster->Launch(ref, message_list, app_team); +} + + +/*********************************************************************** + * Method: BRoster::Launch + * Params: const entry_ref *ref, int argc, const char *const *args, team_id *app_team + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRoster_Launch_5 +(BRoster *Roster, const entry_ref *ref, int argc, const char *const *args, team_id *app_team) +{ + return Roster->Launch(ref, argc, args, app_team); +} + + +/*********************************************************************** + * Method: BRoster::GetRecentDocuments + * Params: BMessage *refList, int32 maxCount, const char *ofType, const char *openedByAppSig + * Returns: void + * Effects: + ***********************************************************************/ +void +BRoster_GetRecentDocuments(BRoster *Roster, BMessage *refList, int32 maxCount, const char *ofType, const char *openedByAppSig) +{ + Roster->GetRecentDocuments(refList, maxCount, ofType, openedByAppSig); +} + + +/*********************************************************************** + * Method: BRoster::GetRecentDocuments + * Params: BMessage *refList, int32 maxCount, const char *ofTypeList[], int32 ofTypeListCount, const char *openedByAppSig + * Returns: void + * Effects: + ***********************************************************************/ +void +BRoster_GetRecentDocuments_1 +(BRoster *Roster, BMessage *refList, int32 maxCount, const char *ofTypeList[], int32 ofTypeListCount, const char *openedByAppSig) +{ +// Roster->GetRecentDocuments(refList, maxCount, ofTypeList[], ofTypeListCount, openedByAppSig); +} + + +/*********************************************************************** + * Method: BRoster::GetRecentFolders + * Params: BMessage *refList, int32 maxCount, const char *openedByAppSig + * Returns: void + * Effects: + ***********************************************************************/ +void +BRoster_GetRecentFolders(BRoster *Roster, BMessage *refList, int32 maxCount, const char *openedByAppSig) +{ + Roster->GetRecentFolders(refList, maxCount, openedByAppSig); +} + + +/*********************************************************************** + * Method: BRoster::GetRecentApps + * Params: BMessage *refList, int32 maxCount + * Returns: void + * Effects: + ***********************************************************************/ +void +BRoster_GetRecentApps(BRoster *Roster, BMessage *refList, int32 maxCount) +{ + Roster->GetRecentApps(refList, maxCount); +} + + +/*********************************************************************** + * Method: BRoster::AddToRecentDocuments + * Params: const entry_ref *doc, const char *appSig + * Returns: void + * Effects: + ***********************************************************************/ +void +BRoster_AddToRecentDocuments(BRoster *Roster, const entry_ref *doc, const char *appSig) +{ + Roster->AddToRecentDocuments(doc, appSig); +} + + +/*********************************************************************** + * Method: BRoster::AddToRecentFolders + * Params: const entry_ref *folder, const char *appSig + * Returns: void + * Effects: + ***********************************************************************/ +void +BRoster_AddToRecentFolders(BRoster *Roster, const entry_ref *folder, const char *appSig) +{ + Roster->AddToRecentFolders(folder, appSig); +} + +/*********************************************************************** + * Method: BRoster::_StartWatching + * Params: mtarget t, BMessenger *roster_mess, uint32 what, BMessenger notify, uint32 event_mask + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BRoster__StartWatching(BRoster *Roster, mtarget t, BMessenger *roster_mess, uint32 what, BMessenger notify, uint32 event_mask) const +{ + return Roster->_StartWatching(t, roster_mess, what, notify, event_mask); +} +*/ + +/*********************************************************************** + * Method: BRoster::_StopWatching + * Params: mtarget t, BMessenger *roster_mess, uint32 what, BMessenger notify + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BRoster__StopWatching(BRoster *Roster, mtarget t, BMessenger *roster_mess, uint32 what, BMessenger notify) const +{ + return Roster->_StopWatching(t, roster_mess, what, notify); +} +*/ + +/*********************************************************************** + * Method: BRoster::AddApplication + * Params: const char *mime_sig, entry_ref *ref, uint32 flags, team_id team, thread_id thread, port_id port, bool full_reg + * Returns: uint32 + * Effects: + ***********************************************************************/ +/*uint32 +BRoster_AddApplication(BRoster *Roster, const char *mime_sig, entry_ref *ref, uint32 flags, team_id team, thread_id thread, port_id port, bool full_reg) const +{ + return Roster->AddApplication(mime_sig, ref, flags, team, thread, port, full_reg); +} +*/ + +/*********************************************************************** + * Method: BRoster::SetSignature + * Params: team_id team, const char *mime_sig + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRoster_SetSignature(BRoster *Roster, team_id team, const char *mime_sig) const +{ + Roster->SetSignature(team, mime_sig); +} +*/ + +/*********************************************************************** + * Method: BRoster::SetThread + * Params: team_id team, thread_id tid + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRoster_SetThread(BRoster *Roster, team_id team, thread_id tid) const +{ + Roster->SetThread(team, tid); +} +*/ + +/*********************************************************************** + * Method: BRoster::SetThreadAndTeam + * Params: uint32 entry_token, thread_id tid, team_id team + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRoster_SetThreadAndTeam_1 +(BRoster *Roster, uint32 entry_token, thread_id tid, team_id team) const +{ + Roster->SetThreadAndTeam(entry_token, tid, team); +} +*/ + +/*********************************************************************** + * Method: BRoster::CompleteRegistration + * Params: team_id team, thread_id, port_id port + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRoster_CompleteRegistration(BRoster *Roster, team_id team, thread_id, port_id port) const +{ + Roster->CompleteRegistration(team, , port); +} +*/ + +/*********************************************************************** + * Method: BRoster::IsAppPreRegistered + * Params: entry_ref *ref, team_id team, app_info *info + * Returns: bool + * Effects: + ***********************************************************************/ +/*bool +BRoster_IsAppPreRegistered(BRoster *Roster, entry_ref *ref, team_id team, app_info *info) const +{ + return Roster->IsAppPreRegistered(ref, team, info); +} +*/ + +/*********************************************************************** + * Method: BRoster::RemovePreRegApp + * Params: uint32 entry_token + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRoster_RemovePreRegApp(BRoster *Roster, uint32 entry_token) const +{ + Roster->RemovePreRegApp(entry_token); +} +*/ + +/*********************************************************************** + * Method: BRoster::RemoveApp + * Params: team_id team + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRoster_RemoveApp(BRoster *Roster, team_id team) const +{ + Roster->RemoveApp(team); +} +*/ + +/*********************************************************************** + * Method: BRoster::xLaunchAppPrivate + * Params: const char *mime_sig, const entry_ref *ref, BList *msg_list, int cargs, char **args, team_id *app_team + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BRoster_xLaunchAppPrivate(BRoster *Roster, const char *mime_sig, const entry_ref *ref, BList *msg_list, int cargs, char **args, team_id *app_team) const +{ + return Roster->xLaunchAppPrivate(mime_sig, ref, msg_list, cargs, args, app_team); +} +*/ + +/*********************************************************************** + * Method: BRoster::UpdateActiveApp + * Params: team_id team + * Returns: bool + * Effects: + ***********************************************************************/ +/*bool +BRoster_UpdateActiveApp(BRoster *Roster, team_id team) const +{ + return Roster->UpdateActiveApp(team); +} +*/ + +/*********************************************************************** + * Method: BRoster::SetAppFlags + * Params: team_id team, uint32 flags + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRoster_SetAppFlags(BRoster *Roster, team_id team, uint32 flags) const +{ + Roster->SetAppFlags(team, flags); +} +*/ + +/*********************************************************************** + * Method: BRoster::DumpRoster + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRoster_DumpRoster(BRoster *Roster) const +{ + Roster->DumpRoster(); +} +*/ + +/*********************************************************************** + * Method: BRoster::resolve_app + * Params: const char *in_type, const entry_ref *ref, entry_ref *app_ref, char *app_sig, uint32 *app_flags, bool *was_document + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BRoster_resolve_app(BRoster *Roster, const char *in_type, const entry_ref *ref, entry_ref *app_ref, char *app_sig, uint32 *app_flags, bool *was_document) const +{ + return Roster->resolve_app(in_type, ref, app_ref, app_sig, app_flags, was_document); +} +*/ + +/*********************************************************************** + * Method: BRoster::translate_ref + * Params: const entry_ref *ref, BMimeType *app_meta, entry_ref *app_ref, BFile *app_file, char *app_sig, bool *was_document + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BRoster_translate_ref(BRoster *Roster, const entry_ref *ref, BMimeType *app_meta, entry_ref *app_ref, BFile *app_file, char *app_sig, bool *was_document) const +{ + return Roster->translate_ref(ref, app_meta, app_ref, app_file, app_sig, was_document); +} +*/ + +/*********************************************************************** + * Method: BRoster::translate_type + * Params: const char *mime_type, BMimeType *meta, entry_ref *app_ref, BFile *app_file, char *app_sig + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BRoster_translate_type(BRoster *Roster, const char *mime_type, BMimeType *meta, entry_ref *app_ref, BFile *app_file, char *app_sig) const +{ + return Roster->translate_type(mime_type, meta, app_ref, app_file, app_sig); +} +*/ + +/*********************************************************************** + * Method: BRoster::sniff_file + * Params: const entry_ref *file, BNodeInfo *finfo, char *mime_type + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BRoster_sniff_file(BRoster *Roster, const entry_ref *file, BNodeInfo *finfo, char *mime_type) const +{ + return Roster->sniff_file(file, finfo, mime_type); +} +*/ + +/*********************************************************************** + * Method: BRoster::is_wildcard + * Params: const char *sig + * Returns: bool + * Effects: + ***********************************************************************/ +/*bool +BRoster_is_wildcard(BRoster *Roster, const char *sig) const +{ + return Roster->is_wildcard(sig); +} +*/ + +/*********************************************************************** + * Method: BRoster::get_unique_supporting_app + * Params: const BMessage *apps, char *out_sig + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BRoster_get_unique_supporting_app(BRoster *Roster, const BMessage *apps, char *out_sig) const +{ + return Roster->get_unique_supporting_app(apps, out_sig); +} +*/ + +/*********************************************************************** + * Method: BRoster::get_random_supporting_app + * Params: const BMessage *apps, char *out_sig + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BRoster_get_random_supporting_app(BRoster *Roster, const BMessage *apps, char *out_sig) const +{ + return Roster->get_random_supporting_app(apps, out_sig); +} +*/ + +/*********************************************************************** + * Method: BRoster::build_arg_vector + * Params: char **args, int *pargs, const entry_ref *app_ref, const entry_ref *doc_ref + * Returns: char ** + * Effects: + ***********************************************************************/ +/*char ** +BRoster_build_arg_vector(BRoster *Roster, char **args, int *pargs, const entry_ref *app_ref, const entry_ref *doc_ref) const +{ + return Roster->build_arg_vector(args, pargs, app_ref, doc_ref); +} +*/ + +/*********************************************************************** + * Method: BRoster::send_to_running + * Params: team_id tema, const entry_ref *app_ref, int cargs, char **args, const BList *msg_list, const entry_ref *ref + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BRoster_send_to_running(BRoster *Roster, team_id tema, const entry_ref *app_ref, int cargs, char **args, const BList *msg_list, const entry_ref *ref) const +{ + return Roster->send_to_running(tema, app_ref, cargs, args, msg_list, ref); +} +*/ + +/*********************************************************************** + * Method: BRoster::InitMessengers + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRoster_InitMessengers(BRoster *Roster) +{ + Roster->InitMessengers(); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _ROSTER_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/bepas_kernel/beobj.cpp b/bepascal/source/bepascal/cpp/src/be/bepas_kernel/beobj.cpp new file mode 100644 index 0000000..76fbe59 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/bepas_kernel/beobj.cpp @@ -0,0 +1,51 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _BEOBJ_CPP_ +#define _BEOBJ_CPP_ + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +BPasObject_GetPasClassName_hook PasObject_GetPasClassName_hook; + +#if defined(__cplusplus) +} +#endif + +BPasObject::BPasObject(TPasObject PasObject) +{ + FPasObject = PasObject; +} + +TPasObject BPasObject::GetPasObject(void) const +{ + return FPasObject; +} + +BPasObject::~BPasObject(){} + +char *BPasObject::GetPasClassName(void) +{ + return PasObject_GetPasClassName_hook(FPasObject); +} + +#endif /* _BEOBJ_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/device/Joystick.cpp b/bepascal/source/bepascal/cpp/src/be/device/Joystick.cpp new file mode 100644 index 0000000..d433767 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/device/Joystick.cpp @@ -0,0 +1,419 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _JOYSTICK_CPP_ +#define _JOYSTICK_CPP_ + + +#include "Joystick.h" + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Method: BJoystick::BJoystick() + * Descr: + */ +TCPlusObject BJoystick_Create() +{ + return new BJoystick(); +} + + +/* + * Method: BJoystick::~BJoystick() + * Descr: + */ +void BJoystick_Free(BJoystick *Joystick) +{ + delete Joystick; +} + + +/* + * Method: BJoystick::Open() + * Descr: + */ +status_t +BJoystick_Open(BJoystick *Joystick, const char *portName) +{ + return Joystick->Open(portName); +} + + +/* + * Method: BJoystick::Open() + * Descr: + */ +status_t +BJoystick_Open_1 +(BJoystick *Joystick, const char *portName, + bool enter_enhanced) +{ + return Joystick->Open(portName, + enter_enhanced); +} + + +/* + * Method: BJoystick::Close() + * Descr: + */ +void +BJoystick_Close(BJoystick *Joystick) +{ + Joystick->Close(); +} + + +/* + * Method: BJoystick::Update() + * Descr: + */ +status_t +BJoystick_Update(BJoystick *Joystick) +{ + return Joystick->Update(); +} + + +/* + * Method: BJoystick::SetMaxLatency() + * Descr: + */ +status_t +BJoystick_SetMaxLatency(BJoystick *Joystick, bigtime_t max_latency) +{ + return Joystick->SetMaxLatency(max_latency); +} + + +/* + * Method: BJoystick::CountDevices() + * Descr: + */ +int32 +BJoystick_CountDevices(BJoystick *Joystick) +{ + return Joystick->CountDevices(); +} + + +/* + * Method: BJoystick::GetDeviceName() + * Descr: + */ +status_t +BJoystick_GetDeviceName(BJoystick *Joystick, int32 n, + char *name, + size_t bufSize) +{ + return Joystick->GetDeviceName(n, + name, + bufSize); +} + + +/* + * Method: BJoystick::EnterEnhancedMode() + * Descr: + */ +bool +BJoystick_EnterEnhancedMode(BJoystick *Joystick, const entry_ref *ref) +{ + return Joystick->EnterEnhancedMode(ref); +} + + +/* + * Method: BJoystick::CountSticks() + * Descr: + */ +int32 +BJoystick_CountSticks(BJoystick *Joystick) +{ + return Joystick->CountSticks(); +} + + +/* + * Method: BJoystick::CountAxes() + * Descr: + */ +int32 +BJoystick_CountAxes(BJoystick *Joystick) +{ + return Joystick->CountAxes(); +} + + +/* + * Method: BJoystick::CountHats() + * Descr: + */ +int32 +BJoystick_CountHats(BJoystick *Joystick) +{ + return Joystick->CountHats(); +} + + +/* + * Method: BJoystick::CountButtons() + * Descr: + */ +int32 +BJoystick_CountButtons(BJoystick *Joystick) +{ + return Joystick->CountButtons(); +} + + +/* + * Method: BJoystick::GetAxisValues() + * Descr: + */ +status_t +BJoystick_GetAxisValues(BJoystick *Joystick, int16 *out_values, + int32 for_stick) +{ + return Joystick->GetAxisValues(out_values, + for_stick); +} + + +/* + * Method: BJoystick::GetHatValues() + * Descr: + */ +status_t +BJoystick_GetHatValues(BJoystick *Joystick, uint8 *out_hats, + int32 for_stick) +{ + return Joystick->GetHatValues(out_hats, + for_stick); +} + + +/* + * Method: BJoystick::ButtonValues() + * Descr: + */ +uint32 +BJoystick_ButtonValues(BJoystick *Joystick, int32 for_stick) +{ + return Joystick->ButtonValues(for_stick); +} + + +/* + * Method: BJoystick::GetAxisNameAt() + * Descr: + */ +status_t +BJoystick_GetAxisNameAt(BJoystick *Joystick, int32 index, + BString *out_name) +{ + return Joystick->GetAxisNameAt(index, + out_name); +} + + +/* + * Method: BJoystick::GetHatNameAt() + * Descr: + */ +status_t +BJoystick_GetHatNameAt(BJoystick *Joystick, int32 index, + BString *out_name) +{ + return Joystick->GetHatNameAt(index, + out_name); +} + + +/* + * Method: BJoystick::GetButtonNameAt() + * Descr: + */ +status_t +BJoystick_GetButtonNameAt(BJoystick *Joystick, int32 index, + BString *out_name) +{ + return Joystick->GetButtonNameAt(index, + out_name); +} + + +/* + * Method: BJoystick::GetControllerModule() + * Descr: + */ +status_t +BJoystick_GetControllerModule(BJoystick *Joystick, BString *out_name) +{ + return Joystick->GetControllerModule(out_name); +} + + +/* + * Method: BJoystick::GetControllerName() + * Descr: + */ +status_t +BJoystick_GetControllerName(BJoystick *Joystick, BString *out_name) +{ + return Joystick->GetControllerName(out_name); +} + + +/* + * Method: BJoystick::IsCalibrationEnabled() + * Descr: + */ +bool +BJoystick_IsCalibrationEnabled(BJoystick *Joystick) +{ + return Joystick->IsCalibrationEnabled(); +} + + +/* + * Method: BJoystick::EnableCalibration() + * Descr: + */ +status_t +BJoystick_EnableCalibration(BJoystick *Joystick, bool calibrates) +{ + return Joystick->EnableCalibration(calibrates); +} + + +/* + * Method: BJoystick::Calibrate() + * Descr: + */ +/* +void +BJoystick_Calibrate(BJoystick *Joystick, struct _extended_joystick *reading) +{ + Joystick->Calibrate(reading); +} + +*/ +/* + * Method: BJoystick::gather_enhanced_info() + * Descr: + */ +/*status_t +BJoystick_gather_enhanced_info(BJoystick *Joystick, const entry_ref *ref) +{ + return Joystick->gather_enhanced_info(ref); +} +*/ + +/* + * Method: BJoystick::save_config() + * Descr: + */ +/*status_t +BJoystick_save_config(BJoystick *Joystick, const entry_ref *ref) +{ + return Joystick->save_config(ref); +} +*/ + +/* + * Method: BJoystick::_ReservedJoystick1() + * Descr: + */ +/*void +BJoystick__ReservedJoystick1(BJoystick *Joystick) +{ + Joystick->_ReservedJoystick1(); +} +*/ + +/* + * Method: BJoystick::_ReservedJoystick2() + * Descr: + */ +/*void +BJoystick__ReservedJoystick2(BJoystick *Joystick) +{ + Joystick->_ReservedJoystick2(); +} +*/ + +/* + * Method: BJoystick::_ReservedJoystick3() + * Descr: + */ +/*void +BJoystick__ReservedJoystick3(BJoystick *Joystick) +{ + Joystick->_ReservedJoystick3(); +} +*/ + +/* + * Method: BJoystick::_Reserved_Joystick_4() + * Descr: + */ +/*status_t +BJoystick__Reserved_Joystick_4(BJoystick *Joystick, void *, + ...) +{ + return Joystick->_Reserved_Joystick_4(, + ); +} +*/ + +/* + * Method: BJoystick::_Reserved_Joystick_5() + * Descr: + */ +/*status_t +BJoystick__Reserved_Joystick_5(BJoystick *Joystick, void *, + ...) +{ + return Joystick->_Reserved_Joystick_5(, + ); +} +*/ + +/* + * Method: BJoystick::_Reserved_Joystick_6() + * Descr: + */ +/*status_t +BJoystick__Reserved_Joystick_6(BJoystick *Joystick, void *, + ...) +{ + return Joystick->_Reserved_Joystick_6(, + ); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _JOYSTICK_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/device/SerialPort.cpp b/bepascal/source/bepascal/cpp/src/be/device/SerialPort.cpp new file mode 100644 index 0000000..0f08fff --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/device/SerialPort.cpp @@ -0,0 +1,441 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _SERIALPORT_CPP_ +#define _SERIALPORT_CPP_ + +#include "SerialPort.h" + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Method: BSerialPort::BSerialPort() + * Descr: + */ +TCPlusObject BSerialPort_Create() +{ + return new BSerialPort(); +} + + +/* + * Method: BSerialPort::~BSerialPort() + * Descr: + */ +void BSerialPort_Free(BSerialPort *SerialPort) +{ + delete SerialPort; +} + + +/* + * Method: BSerialPort::Open() + * Descr: + */ +status_t +BSerialPort_Open(BSerialPort *SerialPort, const char *portName) +{ + return SerialPort->Open(portName); +} + + +/* + * Method: BSerialPort::Close() + * Descr: + */ +void +BSerialPort_Close(BSerialPort *SerialPort) +{ + SerialPort->Close(); +} + + +/* + * Method: BSerialPort::Read() + * Descr: + */ +ssize_t +BSerialPort_Read(BSerialPort *SerialPort, void *buf, + size_t count) +{ + return SerialPort->Read(buf, + count); +} + + +/* + * Method: BSerialPort::Write() + * Descr: + */ +ssize_t +BSerialPort_Write(BSerialPort *SerialPort, const void *buf, + size_t count) +{ + return SerialPort->Write(buf, + count); +} + + +/* + * Method: BSerialPort::SetBlocking() + * Descr: + */ +void +BSerialPort_SetBlocking(BSerialPort *SerialPort, bool Blocking) +{ + SerialPort->SetBlocking(Blocking); +} + + +/* + * Method: BSerialPort::SetTimeout() + * Descr: + */ +status_t +BSerialPort_SetTimeout(BSerialPort *SerialPort, bigtime_t microSeconds) +{ + return SerialPort->SetTimeout(microSeconds); +} + + +/* + * Method: BSerialPort::SetDataRate() + * Descr: + */ +status_t +BSerialPort_SetDataRate(BSerialPort *SerialPort, data_rate bitsPerSecond) +{ + return SerialPort->SetDataRate(bitsPerSecond); +} + + +/* + * Method: BSerialPort::DataRate() + * Descr: + */ +data_rate +BSerialPort_DataRate(BSerialPort *SerialPort) +{ + return SerialPort->DataRate(); +} + + +/* + * Method: BSerialPort::SetDataBits() + * Descr: + */ +void +BSerialPort_SetDataBits(BSerialPort *SerialPort, data_bits numBits) +{ + SerialPort->SetDataBits(numBits); +} + + +/* + * Method: BSerialPort::DataBits() + * Descr: + */ +data_bits +BSerialPort_DataBits(BSerialPort *SerialPort, void) +{ + return SerialPort->DataBits(); +} + + +/* + * Method: BSerialPort::SetStopBits() + * Descr: + */ +void +BSerialPort_SetStopBits(BSerialPort *SerialPort, stop_bits numBits) +{ + SerialPort->SetStopBits(numBits); +} + + +/* + * Method: BSerialPort::StopBits() + * Descr: + */ +stop_bits +BSerialPort_StopBits(BSerialPort *SerialPort, void) +{ + return SerialPort->StopBits(); +} + + +/* + * Method: BSerialPort::SetParityMode() + * Descr: + */ +void +BSerialPort_SetParityMode(BSerialPort *SerialPort, parity_mode which) +{ + SerialPort->SetParityMode(which); +} + + +/* + * Method: BSerialPort::ParityMode() + * Descr: + */ +parity_mode +BSerialPort_ParityMode(BSerialPort *SerialPort, void) +{ + return SerialPort->ParityMode(); +} + + +/* + * Method: BSerialPort::ClearInput() + * Descr: + */ +void +BSerialPort_ClearInput(BSerialPort *SerialPort, void) +{ + SerialPort->ClearInput(); +} + + +/* + * Method: BSerialPort::ClearOutput() + * Descr: + */ +void +BSerialPort_ClearOutput(BSerialPort *SerialPort, void) +{ + SerialPort->ClearOutput(); +} + + +/* + * Method: BSerialPort::SetFlowControl() + * Descr: + */ +void +BSerialPort_SetFlowControl(BSerialPort *SerialPort, uint32 method) +{ + SerialPort->SetFlowControl(method); +} + + +/* + * Method: BSerialPort::FlowControl() + * Descr: + */ +uint32 +BSerialPort_FlowControl(BSerialPort *SerialPort) +{ + return SerialPort->FlowControl(); +} + + +/* + * Method: BSerialPort::SetDTR() + * Descr: + */ +status_t +BSerialPort_SetDTR(BSerialPort *SerialPort, bool asserted) +{ + return SerialPort->SetDTR(asserted); +} + + +/* + * Method: BSerialPort::SetRTS() + * Descr: + */ +status_t +BSerialPort_SetRTS(BSerialPort *SerialPort, bool asserted) +{ + return SerialPort->SetRTS(asserted); +} + + +/* + * Method: BSerialPort::NumCharsAvailable() + * Descr: + */ +status_t +BSerialPort_NumCharsAvailable(BSerialPort *SerialPort, int32 *wait_until_this_many) +{ + return SerialPort->NumCharsAvailable(wait_until_this_many); +} + + +/* + * Method: BSerialPort::IsCTS() + * Descr: + */ +bool +BSerialPort_IsCTS(BSerialPort *SerialPort) +{ + return SerialPort->IsCTS(); +} + + +/* + * Method: BSerialPort::IsDSR() + * Descr: + */ +bool +BSerialPort_IsDSR(BSerialPort *SerialPort) +{ + return SerialPort->IsDSR(); +} + + +/* + * Method: BSerialPort::IsRI() + * Descr: + */ +bool +BSerialPort_IsRI(BSerialPort *SerialPort) +{ + return SerialPort->IsRI(); +} + + +/* + * Method: BSerialPort::IsDCD() + * Descr: + */ +bool +BSerialPort_IsDCD(BSerialPort *SerialPort) +{ + return SerialPort->IsDCD(); +} + + +/* + * Method: BSerialPort::WaitForInput() + * Descr: + */ +ssize_t +BSerialPort_WaitForInput(BSerialPort *SerialPort) +{ + return SerialPort->WaitForInput(); +} + + +/* + * Method: BSerialPort::CountDevices() + * Descr: + */ +int32 +BSerialPort_CountDevices(BSerialPort *SerialPort) +{ + return SerialPort->CountDevices(); +} + + +/* + * Method: BSerialPort::GetDeviceName() + * Descr: + */ +status_t +BSerialPort_GetDeviceName(BSerialPort *SerialPort, int32 n, + char *name, + size_t bufSize) +{ + return SerialPort->GetDeviceName(n, + name, + bufSize); +} + +#if defined(__cplusplus) +} +#endif + + +/* + * Method: BSerialPort::ScanDevices() + * Descr: + */ +/* private function ! +void +BSerialPort_ScanDevices(BSerialPort *SerialPort) +{ + SerialPort->ScanDevices(); +}*/ + + +/* + * Method: BSerialPort::_ReservedSerialPort1() + * Descr: + */ +/* private function ! +void +BSerialPort__ReservedSerialPort1(BSerialPort *SerialPort) +{ + SerialPort->_ReservedSerialPort1(); +}*/ + + +/* + * Method: BSerialPort::_ReservedSerialPort2() + * Descr: + */ +/* private function ! +void +BSerialPort__ReservedSerialPort2(BSerialPort *SerialPort) +{ + SerialPort->_ReservedSerialPort2(); +}*/ + + +/* + * Method: BSerialPort::_ReservedSerialPort3() + * Descr: + */ +/* private function ! +void +BSerialPort__ReservedSerialPort3(BSerialPort *SerialPort) +{ + SerialPort->_ReservedSerialPort3(); +}*/ + + +/* + * Method: BSerialPort::_ReservedSerialPort4() + * Descr: + */ +/* private function ! +void +BSerialPort__ReservedSerialPort4(BSerialPort *SerialPort) +{ + SerialPort->_ReservedSerialPort4(); +}*/ + + +/* + * Method: BSerialPort::DriverControl() + * Descr: + */ +/* private function ! +int +BSerialPort_DriverControl(BSerialPort *SerialPort) +{ + return SerialPort->DriverControl(); +}*/ + +#endif /* _SERIALPORT_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/interface/Alert.cpp b/bepascal/source/bepascal/cpp/src/be/interface/Alert.cpp new file mode 100644 index 0000000..27bb834 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/Alert.cpp @@ -0,0 +1,534 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2003 Olivier Coursiere + Eric Jourde + Oscar Lesta + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef _ALERT_CPP_ +#define _ALERT_CPP_ + +#include +#include "window.h" +#include "looper.h" +#include + +/*----------------------------------------------------------------*/ +/*----- BAlert class ---------------------------------------------*/ + +class BPAlert : public BAlert, public virtual BPWindow // Is this OK? or should be public virtual? +{ +public: + BPAlert(TPasObject PasObject, + const char *title, + const char *text, + const char *button1, + const char *button2 = NULL, + const char *button3 = NULL, + button_width width = B_WIDTH_AS_USUAL, + alert_type type = B_INFO_ALERT); + BPAlert(TPasObject PasObject, + const char *title, + const char *text, + const char *button1, + const char *button2, + const char *button3, + button_width width, + button_spacing spacing, + alert_type type = B_INFO_ALERT); + BPAlert(TPasObject PasObject, BMessage *data); + +//virtual ~BAlert(); + +/* Archiving */ +static BArchivable *Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +/* BAlert guts */ + void SetShortcut(int32 button_index, char key); + char Shortcut(int32 button_index) const; + + int32 Go(); + status_t Go(BInvoker *invoker); + +virtual void MessageReceived(BMessage *an_event); +virtual void FrameResized(float new_width, float new_height); + BButton *ButtonAt(int32 index) const; + BTextView *TextView() const; +/* +virtual BHandler *ResolveSpecifier(BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property); +virtual status_t GetSupportedSuites(BMessage *data); +*/ +virtual void DispatchMessage(BMessage *msg, BHandler *handler); +virtual void Quit(); +virtual bool QuitRequested(); + +static BPoint AlertPosition(float width, float height); + +/*----- Private or reserved -----------------------------------------*/ +//virtual status_t Perform(perform_code d, void *arg); + +private: +/* +friend class _BAlertFilter_; + +virtual void _ReservedAlert1(); +virtual void _ReservedAlert2(); +virtual void _ReservedAlert3(); + + void InitObject(const char *text, + const char *button1, + const char *button2 = NULL, + const char *button3 = NULL, + button_width width = B_WIDTH_AS_USUAL, + button_spacing spacing = B_EVEN_SPACING, + alert_type type = B_INFO_ALERT); + BBitmap *InitIcon(); + + sem_id fAlertSem; + int32 fAlertVal; + BButton *fButtons[3]; + BTextView *fTextView; + char fKeys[3]; + alert_type fMsgType; + button_width fButtonWidth; + BInvoker *fInvoker; + uint32 _reserved[4]; +*/ +}; +/*-------------------------------------------------------------*/ +/*-------------------------------------------------------------*/ + +BPAlert::BPAlert(TPasObject PasObject, + const char *title, + const char *text, + const char *button1, + const char *button2 = NULL, + const char *button3 = NULL, + button_width width = B_WIDTH_AS_USUAL, + alert_type type = B_INFO_ALERT) + : BAlert(title, text, button1, button2, button3, width, type), + BPWindow(PasObject, BRect(), title, B_UNTYPED_WINDOW, 0, 0), + +// oco or Baldur : +// why this doesn't work? compiler says: +// BPWindow doesn't have a BPLooper member. The same with BPArchivable. + +// BPLooper(PasObject), + BPHandler(PasObject, title), +// BPArchivable(PasObject), + BPasObject(PasObject) +{ + +} + +BPAlert::BPAlert(TPasObject PasObject, + const char *title, + const char *text, + const char *button1, + const char *button2, + const char *button3, + button_width width, + button_spacing spacing, + alert_type type = B_INFO_ALERT) + : BAlert(title, text, button1, button2, button3, width, spacing, type), + BPWindow(PasObject, BRect(), title, B_UNTYPED_WINDOW, 0, 0), +// BPLooper(PasObject), + BPHandler(PasObject, title), +// BPArchivable(PasObject), + BPasObject(PasObject) +{ + +} + +BPAlert::BPAlert(TPasObject PasObject, BMessage *data) + : BAlert(data), +// UGLY HACK!!! FIX ME!!! (should be "BPWindow(PasObject, data)" ) + BPWindow(PasObject, BRect(), "Ugly_Hack!", B_UNTYPED_WINDOW, 0, 0), +// BPLooper(PasObject), + BPHandler(PasObject), +// BPArchivable(PasObject), + BPasObject(PasObject) +{ + +} + +void +BPAlert::SetShortcut(int32 button_index, char key) +{ + BAlert::SetShortcut(button_index, key); +} + + +char +BPAlert::Shortcut(int32 button_index) const +{ + return BAlert::Shortcut(button_index); +} + + +int32 +BPAlert::Go(void) +{ + return BAlert::Go(); +} + +status_t +BPAlert::Go(BInvoker *invoker) +{ + return BAlert::Go(invoker); +} + +void +BPAlert::MessageReceived(BMessage *an_event) +{ + BAlert::MessageReceived(an_event); +} + +void +BPAlert::FrameResized(float new_width, float new_height) +{ + BAlert::FrameResized(new_width, new_height); +} + +void +BPAlert::DispatchMessage(BMessage *msg, BHandler *handler) +{ + BAlert::DispatchMessage(msg, handler); +} + +void +BPAlert::Quit(void) +{ + BAlert::Quit(); +} + +bool +BPAlert::QuitRequested(void) +{ + BAlert::QuitRequested(); +} + + +/*-------------------------------------------------------------*/ + +#if defined(__cplusplus) +extern "C" { +#endif + +/*----------------------------------------------------------------*/ + +/* + * Method: BAlert::BAlert() + * Descr: + */ +TCPlusObject BAlert_Create(TPasObject PasObject, const char *title, const char *text, const char *button1, const char *button2, const char *button3, button_width width, alert_type type) +{ + return new BPAlert(PasObject, title, text, button1, button2, button3, width, type); +} + + +/* + * Method: BAlert::BAlert() + * Descr: + */ +TCPlusObject BAlert_Create_1 +(TPasObject PasObject, const char *title, const char *text, const char *button1, const char *button2, const char *button3, button_width width, button_spacing spacing, alert_type type) +{ + return new BPAlert(PasObject, title, text, button1, button2, button3, width, spacing, type); +} + +/* + * Method: BAlert::BAlert() + * Descr: + */ +TCPlusObject BAlert_Create_2(TPasObject PasObject, BMessage *data) +{ + return new BPAlert(PasObject, data); +} + + +/* + * Method: BAlert::~BAlert() + * Descr: + */ +TCPlusObject BAlert_Free(BAlert *Alert) +{ + delete Alert; +} + + +/* + * Method: BAlert::Instantiate() + * Descr: + */ +BArchivable * +BAlert_Instantiate(BAlert *Alert, BMessage *data) +{ + return Alert->Instantiate(data); +} + + +/* + * Method: BAlert::Archive() + * Descr: + */ +status_t +BAlert_Archive(BAlert *Alert, BMessage *data, bool deep) +{ + return Alert->Archive(data, deep); +} + + +/* + * Method: BAlert::SetShortcut() + * Descr: + */ +void +BAlert_SetShortcut(BAlert *Alert, int32 button_index, char key) +{ + Alert->SetShortcut(button_index, key); +} + + +/* + * Method: BAlert::Shortcut() + * Descr: + */ +char +BAlert_Shortcut(BAlert *Alert, int32 button_index) +{ + return Alert->Shortcut(button_index); +} + + +/* + * Method: BAlert::Go() + * Descr: + */ +int32 +BAlert_Go(BAlert *Alert) +{ + return Alert->Go(); +} + + +/* + * Method: BAlert::Go() + * Descr: + */ +status_t +BAlert_Go_1 +(BAlert *Alert, BInvoker *invoker) +{ + return Alert->Go(invoker); +} + + +/* + * Method: BAlert::MessageReceived() + * Descr: + */ +void +BAlert_MessageReceived(BAlert *Alert, BMessage *an_event) +{ + Alert->MessageReceived(an_event); +} + + +/* + * Method: BAlert::FrameResized() + * Descr: + */ +void +BAlert_FrameResized(BAlert *Alert, float new_width, float new_height) +{ + Alert->FrameResized(new_width, new_height); +} + + +/* + * Method: BAlert::ButtonAt() + * Descr: + */ +BButton * +BAlert_ButtonAt(BAlert *Alert, int32 index) +{ + return Alert->ButtonAt(index); +} + + +/* + * Method: BAlert::TextView() + * Descr: + */ +BTextView * +BAlert_TextView(BAlert *Alert) +{ + return Alert->TextView(); +} + + +/* + * Method: BAlert::ResolveSpecifier() + * Descr: + */ +BHandler * +BAlert_ResolveSpecifier(BAlert *Alert, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return Alert->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/* + * Method: BAlert::GetSupportedSuites() + * Descr: + */ +status_t +BAlert_GetSupportedSuites(BAlert *Alert, BMessage *data) +{ + return Alert->GetSupportedSuites(data); +} + + +/* + * Method: BAlert::DispatchMessage() + * Descr: + */ +void +BAlert_DispatchMessage(BAlert *Alert, BMessage *msg, BHandler *handler) +{ + Alert->DispatchMessage(msg, handler); +} + + +/* + * Method: BAlert::Quit() + * Descr: + */ +void +BAlert_Quit(BAlert *Alert) +{ + Alert->Quit(); +} + + +/* + * Method: BAlert::QuitRequested() + * Descr: + */ +bool +BAlert_QuitRequested(BAlert *Alert) +{ + return Alert->QuitRequested(); +} + + +/* + * Method: BAlert::AlertPosition() + * Descr: + */ +BPoint +BAlert_AlertPosition(BAlert *Alert, float width, float height) +{ + return Alert->AlertPosition(width, height); +} + + +/* + * Method: BAlert::Perform() + * Descr: + */ +/* +status_t +BAlert_Perform(BAlert *Alert, perform_code d, void *arg) +{ + return Alert->Perform(d, arg); +} +*/ + +/* + * Method: BAlert::_ReservedAlert1() + * Descr: + */ +/* +void +BAlert__ReservedAlert1(BAlert *Alert) +{ + Alert->_ReservedAlert1(); +} +*/ + +/* + * Method: BAlert::_ReservedAlert2() + * Descr: + */ +/* +void +BAlert__ReservedAlert2(BAlert *Alert) +{ + Alert->_ReservedAlert2(); +} +*/ + +/* + * Method: BAlert::_ReservedAlert3() + * Descr: + */ +/* +void +BAlert__ReservedAlert3(BAlert *Alert) +{ + Alert->_ReservedAlert3(); +} +*/ + +/* + * Method: BAlert::InitObject() + * Descr: + */ +/* +void +BAlert_InitObject(BAlert *Alert, const char *text, const char *button1, const char *button2, const char *button3, button_width width, button_spacing spacing, alert_type type) +{ + Alert->InitObject(text, button1, button2, button3, width, spacing, type); +} +*/ + +/* + * Method: BAlert::InitIcon() + * Descr: + */ +/* +BBitmap * +BAlert_InitIcon(BAlert *Alert) +{ + return Alert->InitIcon(); +} +*/ + +/*----------------------------------------------------------------*/ + +#if defined(__cplusplus) +} +#endif + +/*----------------------------------------------------------------*/ + +#endif /* _ALERT_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/interface/Box.cpp b/bepascal/source/bepascal/cpp/src/be/interface/Box.cpp new file mode 100644 index 0000000..e0fa48e --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/Box.cpp @@ -0,0 +1,676 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2003 Olivier Coursiere + Eric Jourde + Oscar Lesta + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _BOX_CPP_ +#define _BOX_CPP_ + +#include "Box.h" + +#include "view.h" +#include + + +class BPBox : public BBox, virtual public BPView +{ +public: + BPBox(TPasObject PasObject, + BRect bounds, + const char *name = NULL, + uint32 resizeFlags = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP, + border_style border = B_FANCY_BORDER); + +// virtual ~BBox(void); + +/* Archiving */ + BPBox(TPasObject PasObject, BMessage *data); + + static BArchivable *Instantiate(BMessage *data); +// virtual status_t Archive(BMessage *data, bool deep = true) const; + +/* BBox guts */ + virtual void SetBorder(border_style style); + border_style Border() const; + + void SetLabel(const char *label); + status_t SetLabel(BView *view_label); + + const char *Label() const; + BView *LabelView() const; + + virtual void Draw(BRect bounds); + virtual void AttachedToWindow(); + virtual void DetachedFromWindow(); + virtual void AllAttached(); + virtual void AllDetached(); + virtual void FrameResized(float new_width, float new_height); + virtual void MessageReceived(BMessage *msg); + virtual void MouseDown(BPoint pt); + virtual void MouseUp(BPoint pt); + virtual void WindowActivated(bool state); + virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); + virtual void FrameMoved(BPoint new_position); +/* + virtual BHandler *ResolveSpecifier(BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property); +*/ + virtual void ResizeToPreferred(); + virtual void GetPreferredSize(float *width, float *height); +// virtual void MakeFocus(bool state = true); +// virtual status_t GetSupportedSuites(BMessage *data); + +/*----- Private or reserved -----------------------------------------*/ + +// virtual status_t Perform(perform_code d, void *arg); + +private: +/* + virtual void _ReservedBox1(); + virtual void _ReservedBox2(); + + BBox &operator=(const BBox &); + + void InitObject(BMessage *data = NULL); + void DrawPlain(); + void DrawFancy(); + void ClearAnyLabel(); + + char *fLabel; + BRect fBounds; + border_style fStyle; + BView *fLabelView; + uint32 _reserved[1]; +*/ +}; + +BPBox::BPBox(TPasObject PasObject, + BRect bounds, + const char *name = NULL, + uint32 resizeFlags = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP, + border_style border = B_FANCY_BORDER) + : + BBox(bounds, name, resizeFlags, flags, border), + BPView(PasObject, bounds, name, resizeFlags, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + +BPBox::BPBox(TPasObject PasObject, BMessage *archive) + : + BBox(archive), + BPView(PasObject, archive), + BPHandler(PasObject, archive), + BPasObject(PasObject) +{ + +} + +void +BPBox::SetBorder(border_style style) +{ + BBox::SetBorder(style); +} + + +border_style +BPBox::Border(void) const +{ + return BBox::Border(); +} + +void +BPBox::SetLabel(const char *label) +{ + BBox::SetLabel(label); +} + +status_t +BPBox::SetLabel(BView *view_label) +{ + return BBox::SetLabel(view_label); +} + +void +BPBox::Draw(BRect bounds) +{ + BBox::Draw(bounds); +} + +void +BPBox::AttachedToWindow(void) +{ + BBox::AttachedToWindow(); +} + +void +BPBox::DetachedFromWindow(void) +{ + BBox::DetachedFromWindow(); +} + +void +BPBox::AllAttached(void) +{ + BBox::AllAttached(); +} + +void +BPBox::AllDetached(void) +{ + BBox::AllDetached(); +} + +void +BPBox::FrameResized(float new_width, float new_height) +{ + BBox::FrameResized(new_width, new_height); +} + +void +BPBox::MessageReceived(BMessage *msg) +{ + BBox::MessageReceived(msg); +} + +void +BPBox::MouseDown(BPoint pt) +{ + BBox::MouseDown(pt); +} + +void +BPBox::MouseUp(BPoint pt) +{ + BBox::MouseUp(pt); +} + +void +BPBox::WindowActivated(bool state) +{ + BBox::WindowActivated(state); +} + +void +BPBox::MouseMoved(BPoint pt, uint32 code, const BMessage *msg) +{ + BBox::MouseMoved(pt, code, msg); +} + +void +BPBox::FrameMoved(BPoint new_position) +{ + BBox::FrameMoved(new_position); +} + +void +BPBox::ResizeToPreferred(void) +{ + BBox::ResizeToPreferred(); +} + +void +BPBox::GetPreferredSize(float *width, float *height) +{ + BBox::GetPreferredSize(width, height); +} + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Box.cpp + * DATE: Tue Jan 21 00:15:28 2003 + * DESCR: + ***********************************************************************/ + +/* + * Method: BBox::~BBox() + * Descr: + */ + +void BBox_Free(BBox *Box) +{ + delete Box; +} + +/* + * Method: BBox::BBox() + * Descr: + */ + +TCPlusObject BBox_Create(TPasObject PasObject, BRect frame, + const char *name, + uint32 resizeMask, + uint32 flags, + border_style border) +{ + return new BPBox(PasObject, + frame, + name, + resizeMask, + flags, + border); +} + +/* + * Method: BBox::BBox() + * Descr: + */ + +TCPlusObject BBox_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPBox(PasObject, data); +} + +/* + * Method: BBox::Instantiate() + * Descr: + */ +BArchivable * +BBox_Instantiate(BBox *Box, BMessage *data) +{ + return Box->Instantiate(data); +} + + +/* + * Method: BBox::Archive() + * Descr: + */ +status_t +BBox_Archive(BBox *Box, BMessage *data, bool deep) +{ + return Box->Archive(data, deep); +} + + +/* + * Method: BBox::SetBorder() + * Descr: + */ +void +BBox_SetBorder(BBox *Box, border_style style) +{ + Box->SetBorder(style); +} + + +/* + * Method: BBox::Border() + * Descr: + */ +border_style +BBox_Border(BBox *Box) +{ + return Box->Border(); +} + + +/* + * Method: BBox::SetLabel() + * Descr: + */ +void +BBox_SetLabel(BBox *Box, const char *label) +{ + Box->SetLabel(label); +} + + +/* + * Method: BBox::SetLabel() + * Descr: + */ +status_t +BBox_SetLabel_1 +(BBox *Box, BView *view_label) +{ + return Box->SetLabel(view_label); +} + + +/* + * Method: BBox::Label() + * Descr: + */ +const char * +BBox_Label(BBox *Box) +{ + return Box->Label(); +} + + +/* + * Method: BBox::LabelView() + * Descr: + */ +BView * +BBox_LabelView_1(BBox *Box) +{ + return Box->LabelView(); +} + + +/* + * Method: BBox::Draw() + * Descr: + */ +void +BBox_Draw(BBox *Box, BRect bounds) +{ + Box->Draw(bounds); +} + + +/* + * Method: BBox::AttachedToWindow() + * Descr: + */ +void +BBox_AttachedToWindow(BBox *Box) +{ + Box->AttachedToWindow(); +} + + +/* + * Method: BBox::DetachedFromWindow() + * Descr: + */ +void +BBox_DetachedFromWindow(BBox *Box) +{ + Box->DetachedFromWindow(); +} + + +/* + * Method: BBox::AllAttached() + * Descr: + */ +void +BBox_AllAttached(BBox *Box) +{ + Box->AllAttached(); +} + + +/* + * Method: BBox::AllDetached() + * Descr: + */ +void +BBox_AllDetached(BBox *Box) +{ + Box->AllDetached(); +} + + +/* + * Method: BBox::FrameResized() + * Descr: + */ +void +BBox_FrameResized(BBox *Box, float new_width, + float new_height) +{ + Box->FrameResized(new_width, new_height); +} + + +/* + * Method: BBox::MessageReceived() + * Descr: + */ +void +BBox_MessageReceived(BBox *Box, BMessage *msg) +{ + Box->MessageReceived(msg); +} + + +/* + * Method: BBox::MouseDown() + * Descr: + */ +void +BBox_MouseDown(BBox *Box, BPoint pt) +{ + Box->MouseDown(pt); +} + + +/* + * Method: BBox::MouseUp() + * Descr: + */ +void +BBox_MouseUp(BBox *Box, BPoint pt) +{ + Box->MouseUp(pt); +} + + +/* + * Method: BBox::WindowActivated() + * Descr: + */ +void +BBox_WindowActivated(BBox *Box, bool state) +{ + Box->WindowActivated(state); +} + + +/* + * Method: BBox::MouseMoved() + * Descr: + */ +void +BBox_MouseMoved(BBox *Box, BPoint pt, + uint32 code, + const BMessage *msg) +{ + Box->MouseMoved(pt, code, msg); +} + + +/* + * Method: BBox::FrameMoved() + * Descr: + */ +void +BBox_FrameMoved(BBox *Box, BPoint new_position) +{ + Box->FrameMoved(new_position); +} + + +/* + * Method: BBox::ResolveSpecifier() + * Descr: + */ +BHandler * +BBox_ResolveSpecifier(BBox *Box, BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property) +{ + return Box->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/* + * Method: BBox::ResizeToPreferred() + * Descr: + */ +void +BBox_ResizeToPreferred(BBox *Box) +{ + Box->ResizeToPreferred(); +} + + +/* + * Method: BBox::GetPreferredSize() + * Descr: + */ +void +BBox_GetPreferredSize(BBox *Box, float *width, + float *height) +{ + Box->GetPreferredSize(width, height); +} + + +/* + * Method: BBox::MakeFocus() + * Descr: + */ +void +BBox_MakeFocus(BBox *Box, bool state) +{ + Box->MakeFocus(state); +} + + +/* + * Method: BBox::GetSupportedSuites() + * Descr: + */ +status_t +BBox_GetSupportedSuites(BBox *Box, BMessage *data) +{ + return Box->GetSupportedSuites(data); +} + + +/* + * Method: BBox::Perform() + * Descr: + */ +status_t +BBox_Perform(BBox *Box, perform_code d, + void *arg) +{ + return Box->Perform(d, arg); +} + + +/* + * Method: BBox::_ReservedBox1() + * Descr: + */ +/* +void +BBox__ReservedBox1(BBox *Box) +{ + Box->_ReservedBox1(); +} +*/ + +/* + * Method: BBox::_ReservedBox2() + * Descr: + */ +/* +void +BBox__ReservedBox2(BBox *Box) +{ + Box->_ReservedBox2(); +} +*/ + +/* + * Method: BBox::operator=() + * Descr: + */ +/* +BBox & +BBox_operator=(BBox *Box, const BBox &) +{ + return Box->operator=(); +} +*/ + + +/* + * Method: BBox::InitObject() + * Descr: + */ +/* +void +BBox_InitObject(BBox *Box, BMessage *data) +{ + Box->InitObject(data); +} +*/ + +/* + * Method: BBox::DrawPlain() + * Descr: + */ +/* +void +BBox_DrawPlain(BBox *Box) +{ + Box->DrawPlain(); +} +*/ + +/* + * Method: BBox::DrawFancy() + * Descr: + */ +/* +void +BBox_DrawFancy(BBox *Box) +{ + Box->DrawFancy(); +} +*/ + +/* + * Method: BBox::ClearAnyLabel() + * Descr: + */ +/* +void +BBox_ClearAnyLabel(BBox *Box) +{ + Box->ClearAnyLabel(); +} +*/ + +#if defined(__cplusplus) +} +#endif + +#endif /* _BOX_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/interface/Button.cpp b/bepascal/source/bepascal/cpp/src/be/interface/Button.cpp new file mode 100644 index 0000000..8e6f23f --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/Button.cpp @@ -0,0 +1,686 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _BUTTON_CPP_ +#define _BUTTON_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Button.cpp + * DATE: Tue Dec 3 00:28:35 2002 + * DESCR: + ***********************************************************************/ +#include "Button.h" + +#include "control.h" +#include + +typedef void (*BButton_MakeDefault_hook) (TPasObject PasObject, bool flag); + +#if defined(__cplusplus) +extern "C" { +#endif + +BButton_MakeDefault_hook Button_MakeDefault_hook; + +#if defined(__cplusplus) +} +#endif + +class BPButton : public BButton, virtual public BPControl +{ + public: + // + BPButton(TPasObject PasObject, + BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizeMask, + uint32 flags); + BPButton(TPasObject PasObject, BMessage *archive); + virtual void MessageReceived(BMessage *message); + virtual void Draw(BRect updateRect); + virtual void AttachedToWindow(void); + virtual void MakeDefault(bool flag); + virtual void WindowActivated(bool active); + + virtual void AllAttached(void); + virtual void AllDetached(void); + virtual void DetachedFromWindow(void); + virtual void DrawAfterChildren(BRect updateRect); + virtual void FrameMoved(BPoint parentPoint); + virtual void FrameResized(float width, float height); + virtual void GetPreferredSize(float *width, float *height); + virtual void ResizeToPreferred(void); + virtual void KeyDown(const char *bytes, int32 numBytes); + virtual void KeyUp(const char *bytes, int32 numBytes); + virtual void MouseDown(BPoint point); + virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message); + virtual void MouseUp(BPoint point); + virtual void Pulse(void); +// virtual void TargetedByScrollView(BScrollView *scroller); + virtual void SetEnabled(bool enabled); + virtual void SetValue(int32 value); + private: +}; + +BPButton::BPButton(TPasObject PasObject, BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizeMask, + uint32 flags) + : + BButton(frame, name, label, message, + resizeMask, flags), + BPControl(PasObject, frame, name, label, message, + resizeMask, flags), + BPView(PasObject, frame, name, resizeMask, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + +BPButton::BPButton(TPasObject PasObject, BMessage *archive) + :BButton(archive), + BPControl(PasObject, archive), + BPView(PasObject, archive), + BPHandler(PasObject, archive), + BPasObject(PasObject) +{ + +} + +void BPButton::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BButton::MessageReceived(message); +} + +void BPButton::Draw(BRect updateRect) +{ + BButton::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPButton::AttachedToWindow(void) +{ + BButton::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + +void BPButton::MakeDefault(bool flag) +{ +// Button_MakeDefault_hook(GetPasObject(), flag); +} + +void BPButton::WindowActivated(bool active) +{ + BButton::WindowActivated(active); +} + +void BPButton::AllAttached(void) +{ + BButton::AllAttached(); +} + +void BPButton::AllDetached(void) +{ + BButton::AllDetached(); +} + +void BPButton::DetachedFromWindow(void) +{ + BButton::DetachedFromWindow(); +} + +void BPButton::DrawAfterChildren(BRect updateRect) +{ + BButton::DrawAfterChildren(updateRect); +} + +void BPButton::FrameMoved(BPoint parentPoint) +{ + BButton::FrameMoved(parentPoint); +} + +void BPButton::FrameResized(float width, float height) +{ + BButton::FrameResized(width, height); +} + +void BPButton::GetPreferredSize(float *width, float *height) +{ + BButton::GetPreferredSize(width, height); +} + +void BPButton::ResizeToPreferred(void) +{ + BButton::ResizeToPreferred(); +} + +void BPButton::KeyDown(const char *bytes, int32 numBytes) +{ + BButton::KeyDown(bytes, numBytes); +} + +void BPButton::KeyUp(const char *bytes, int32 numBytes) +{ + BButton::KeyUp(bytes, numBytes); +} + +void BPButton::MouseDown(BPoint point) +{ + BButton::MouseDown(point); +} + +void BPButton::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BButton::MouseMoved(point, transit, message); +} + +void BPButton::MouseUp(BPoint point) +{ + BButton::MouseUp(point); +} + +void BPButton::Pulse(void) +{ + BButton::Pulse(); +} + +//void BPButton::TargetedByScrollView(BScrollView *scroller) +//{ +// BButton::TargetedByScrollView(scroller); +//} + +void BPButton::SetEnabled(bool enabled) +{ + BButton::SetEnabled(enabled); +} + +void BPButton::SetValue(int32 value) +{ + BButton::SetValue(value); +} + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * Method: BButton::~BButton + * Params: + * Effects: + ***********************************************************************/ +void BButton_Free(BButton *Button) +{ + delete Button; +} + + +/*********************************************************************** + * Method: BButton::BButton + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BButton_Create(TPasObject PasObject, BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizeMask, + uint32 flags) +{ + return new BPButton(PasObject, frame, name, label, message, resizeMask, flags); +} + +/*********************************************************************** + * Method: BButton::BButton + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BButton_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPButton(PasObject, data); +} + +/*********************************************************************** + * Method: BButton::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BButton_Instantiate(BButton *Button, BMessage *data) +{ + return Button->Instantiate(data); +} + + +/*********************************************************************** + * Method: BButton::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BButton_Archive(BButton *Button, BMessage *data, bool deep) +{ + return Button->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BButton::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_Draw(BButton *Button, BRect updateRect) +{ + Button->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BButton::MouseDown + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_MouseDown(BButton *Button, BPoint where) +{ + Button->MouseDown(where); +} + + +/*********************************************************************** + * Method: BButton::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_AttachedToWindow(BButton *Button) +{ + Button->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BButton::KeyDown + * Params: const char *bytes, int32 numBytes + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_KeyDown(BButton *Button, const char *bytes, int32 numBytes) +{ + Button->KeyDown(bytes, numBytes); +} + + +/*********************************************************************** + * Method: BButton::MakeDefault + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_MakeDefault(BButton *Button, bool state) +{ + Button->MakeDefault(state); +} + + +/*********************************************************************** + * Method: BButton::SetLabel + * Params: const char *text + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_SetLabel(BButton *Button, const char *text) +{ + Button->SetLabel(text); +} + + +/*********************************************************************** + * Method: BButton::IsDefault + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BButton_IsDefault(BButton *Button) +{ + return Button->IsDefault(); +} + + +/*********************************************************************** + * Method: BButton::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_MessageReceived(BButton *Button, BMessage *msg) +{ + Button->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BButton::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_WindowActivated(BButton *Button, bool state) +{ + Button->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BButton::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_MouseUp(BButton *Button, BPoint pt) +{ + Button->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BButton::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_MouseMoved(BButton *Button, BPoint pt, uint32 code, const BMessage *msg) +{ + Button->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BButton::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_DetachedFromWindow(BButton *Button) +{ + Button->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BButton::SetValue + * Params: int32 value + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_SetValue(BButton *Button, int32 value) +{ + Button->SetValue(value); +} + + +/*********************************************************************** + * Method: BButton::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_GetPreferredSize(BButton *Button, float *width, float *height) +{ + Button->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BButton::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_ResizeToPreferred(BButton *Button) +{ + Button->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BButton::Invoke + * Params: BMessage *msg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BButton_Invoke(BButton *Button, BMessage *msg) +{ + return Button->Invoke(msg); +} + + +/*********************************************************************** + * Method: BButton::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_FrameMoved(BButton *Button, BPoint new_position) +{ + Button->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BButton::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_FrameResized(BButton *Button, float new_width, float new_height) +{ + Button->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BButton::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_MakeFocus(BButton *Button, bool state) +{ + Button->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BButton::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_AllAttached(BButton *Button) +{ + Button->AllAttached(); +} + + +/*********************************************************************** + * Method: BButton::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BButton_AllDetached(BButton *Button) +{ + Button->AllDetached(); +} + + +/*********************************************************************** + * Method: BButton::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BButton_ResolveSpecifier(BButton *Button, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return Button->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BButton::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BButton_GetSupportedSuites(BButton *Button, BMessage *data) +{ + return Button->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BButton::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BButton_Perform(BButton *Button, perform_code d, void *arg) +{ + return Button->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BButton::_ReservedButton1 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BButton__ReservedButton1(BButton *Button) +{ + Button->_ReservedButton1(); +} +*/ + + +/*********************************************************************** + * Method: BButton::_ReservedButton2 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BButton__ReservedButton2(BButton *Button) +{ + Button->_ReservedButton2(); +} +*/ + +/*********************************************************************** + * Method: BButton::_ReservedButton3 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BButton__ReservedButton3(BButton *Button) +{ + Button->_ReservedButton3(); +} +*/ + +/*********************************************************************** + * Method: BButton::operator= + * Params: const BButton & + * Returns: BButton & + * Effects: + ***********************************************************************/ +/*BButton & +BButton_operator=(BButton *Button, const BButton &) +{ + return Button->operator=(); +} +*/ + + +/*********************************************************************** + * Method: BButton::DrawDefault + * Params: BRect bounds, bool enabled + * Returns: BRect + * Effects: + ***********************************************************************/ +/*BRect +BButton_DrawDefault(BButton *Button, BRect bounds, bool enabled) +{ + return Button->DrawDefault(bounds, enabled); +} +*/ + +/*********************************************************************** + * Method: BButton::Execute + * Params: + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BButton_Execute(BButton *Button) +{ + return Button->Execute(); +} +*/ + +#if defined(__cplusplus) +} +#endif + +#endif /* _BUTTON_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/interface/CheckBox.cpp b/bepascal/source/bepascal/cpp/src/be/interface/CheckBox.cpp new file mode 100644 index 0000000..3c7b132 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/CheckBox.cpp @@ -0,0 +1,627 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _CHECKBOX_CPP_ +#define _CHECKBOX_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Button.cpp + * DATE: Tue Dec 3 00:28:35 2002 + * DESCR: + ***********************************************************************/ +#include "CheckBox.h" + +#include "control.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(__cplusplus) +} +#endif + +class BPCheckBox : public BCheckBox, virtual public BPControl { + +public: + BPCheckBox(TPasObject PasObject, BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizeMask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); +//virtual ~BCheckBox(); + +/* Archiving */ + BPCheckBox(TPasObject PasObject, BMessage *data); +//static BArchivable *Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +virtual void Draw(BRect updateRect); +virtual void AttachedToWindow(); +virtual void MouseDown(BPoint where); + +virtual void MessageReceived(BMessage *msg); +virtual void WindowActivated(bool state); +virtual void KeyDown(const char *bytes, int32 numBytes); +virtual void MouseUp(BPoint pt); +virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); +virtual void DetachedFromWindow(); +virtual void SetValue(int32 value); +virtual void GetPreferredSize(float *width, float *height); +virtual void ResizeToPreferred(); +//virtual status_t Invoke(BMessage *msg = NULL); +virtual void FrameMoved(BPoint new_position); +virtual void FrameResized(float new_width, float new_height); + +/*virtual BHandler *ResolveSpecifier(BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property); +*/ +//virtual status_t GetSupportedSuites(BMessage *data); + +//virtual void MakeFocus(bool state = true); +virtual void AllAttached(); +virtual void AllDetached(); + + +/*----- Private or reserved -----------------------------------------*/ +//virtual status_t Perform(perform_code d, void *arg); + +private: +}; + +BPCheckBox::BPCheckBox(TPasObject PasObject, + BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 rmask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE) + : + BCheckBox(frame,name,label, + message,rmask,flags), + BPControl(PasObject, frame, name, label, message, + rmask, flags), + BPView(PasObject, frame, name, rmask, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + +BPCheckBox::BPCheckBox(TPasObject PasObject, BMessage *archive) + :BCheckBox(archive), + BPControl(PasObject, archive), + BPView(PasObject, archive), + BPHandler(PasObject, archive), + BPasObject(PasObject) +{ + +} + +void BPCheckBox::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BCheckBox::MessageReceived(message); +} + +void BPCheckBox::Draw(BRect updateRect) +{ + BCheckBox::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPCheckBox::AttachedToWindow(void) +{ + BCheckBox::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + +void BPCheckBox::WindowActivated(bool active) +{ + BCheckBox::WindowActivated(active); +} + +void BPCheckBox::KeyDown(const char *bytes, int32 numBytes) +{ + BCheckBox::KeyDown(bytes, numBytes); +} + + +void BPCheckBox::AllAttached(void) +{ + BCheckBox::AllAttached(); +} + +void BPCheckBox::AllDetached(void) +{ + BCheckBox::AllDetached(); +} + +void BPCheckBox::DetachedFromWindow(void) +{ + BCheckBox::DetachedFromWindow(); +} + + +void BPCheckBox::FrameMoved(BPoint parentPoint) +{ + BCheckBox::FrameMoved(parentPoint); +} + +void BPCheckBox::FrameResized(float width, float height) +{ + BCheckBox::FrameResized(width, height); +} + +void BPCheckBox::GetPreferredSize(float *width, float *height) +{ + BCheckBox::GetPreferredSize(width, height); +} + +void BPCheckBox::ResizeToPreferred(void) +{ + BCheckBox::ResizeToPreferred(); +} + + + +void BPCheckBox::MouseDown(BPoint point) +{ + BCheckBox::MouseDown(point); +} + +void BPCheckBox::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BCheckBox::MouseMoved(point, transit, message); +} + +void BPCheckBox::MouseUp(BPoint point) +{ + BCheckBox::MouseUp(point); +} + + +//void BPButton::TargetedByScrollView(BScrollView *scroller) +//{ +// BButton::TargetedByScrollView(scroller); +//} + + +void BPCheckBox::SetValue(int32 value) +{ + BCheckBox::SetValue(value); +} + + + +#if defined(__cplusplus) +extern "C" { +#endif + + + +/*********************************************************************** + * AUTHOR: nobody + * FILE: CheckBox.cpp + * DATE: Thu Jan 16 20:29:31 2003 + * DESCR: + ***********************************************************************/ + +/*********************************************************************** + * Method: BCheckBox::~BCheckBox + * Params: + * Effects: + ***********************************************************************/ +void BCheckBox_FREE(BCheckBox *CheckBox) +{ + delete CheckBox; +} + +TCPlusObject BCheckBox_Create(TPasObject PasObject, BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizeMask , + uint32 flags ) +{ + return new BPCheckBox( PasObject, frame, + name, + label, + message, + resizeMask , + flags ); +} + + +/*********************************************************************** + * Method: BCheckBox::BCheckBox + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BCheckBox_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPCheckBox(PasObject, data); +} + + +/*********************************************************************** + * Method: BCheckBox::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BCheckBox_Instantiate(BCheckBox *CheckBox, BMessage *data) +{ + return CheckBox->Instantiate(data); +} + + +/*********************************************************************** + * Method: BCheckBox::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BCheckBox_Archive(BCheckBox *CheckBox, BMessage *data, bool deep) +{ + return CheckBox->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BCheckBox::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_Draw(BCheckBox *CheckBox, BRect updateRect) +{ + CheckBox->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BCheckBox::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_AttachedToWindow(BCheckBox *CheckBox) +{ + CheckBox->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BCheckBox::MouseDown + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_MouseDown(BCheckBox *CheckBox, BPoint where) +{ + CheckBox->MouseDown(where); +} + + +/*********************************************************************** + * Method: BCheckBox::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_MessageReceived(BCheckBox *CheckBox, BMessage *msg) +{ + CheckBox->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BCheckBox::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_WindowActivated(BCheckBox *CheckBox, bool state) +{ + CheckBox->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BCheckBox::KeyDown + * Params: const char *bytes, int32 numBytes + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_KeyDown(BCheckBox *CheckBox, const char *bytes, int32 numBytes) +{ + CheckBox->KeyDown(bytes, numBytes); +} + + +/*********************************************************************** + * Method: BCheckBox::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_MouseUp(BCheckBox *CheckBox, BPoint pt) +{ + CheckBox->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BCheckBox::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_MouseMoved(BCheckBox *CheckBox, BPoint pt, uint32 code, const BMessage *msg) +{ + CheckBox->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BCheckBox::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_DetachedFromWindow(BCheckBox *CheckBox) +{ + CheckBox->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BCheckBox::SetValue + * Params: int32 value + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_SetValue(BCheckBox *CheckBox, int32 value) +{ + CheckBox->SetValue(value); +} + + +/*********************************************************************** + * Method: BCheckBox::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_GetPreferredSize(BCheckBox *CheckBox, float *width, float *height) +{ + CheckBox->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BCheckBox::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_ResizeToPreferred(BCheckBox *CheckBox) +{ + CheckBox->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BCheckBox::Invoke + * Params: BMessage *msg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BCheckBox_Invoke(BCheckBox *CheckBox, BMessage *msg) +{ + return CheckBox->Invoke(msg); +} + + +/*********************************************************************** + * Method: BCheckBox::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_FrameMoved(BCheckBox *CheckBox, BPoint new_position) +{ + CheckBox->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BCheckBox::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_FrameResized(BCheckBox *CheckBox, float new_width, float new_height) +{ + CheckBox->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BCheckBox::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BCheckBox_ResolveSpecifier(BCheckBox *CheckBox, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return CheckBox->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BCheckBox::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BCheckBox_GetSupportedSuites(BCheckBox *CheckBox, BMessage *data) +{ + return CheckBox->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BCheckBox::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_MakeFocus(BCheckBox *CheckBox, bool state) +{ + CheckBox->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BCheckBox::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_AllAttached(BCheckBox *CheckBox) +{ + CheckBox->AllAttached(); +} + + +/*********************************************************************** + * Method: BCheckBox::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BCheckBox_AllDetached(BCheckBox *CheckBox) +{ + CheckBox->AllDetached(); +} + + +/*********************************************************************** + * Method: BCheckBox::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BCheckBox_Perform(BCheckBox *CheckBox, perform_code d, void *arg) +{ + return CheckBox->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BCheckBox::_ReservedCheckBox1 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BCheckBox__ReservedCheckBox1(BCheckBox *CheckBox) +{ + CheckBox->_ReservedCheckBox1(); +} +*/ + +/*********************************************************************** + * Method: BCheckBox::_ReservedCheckBox2 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BCheckBox__ReservedCheckBox2(BCheckBox *CheckBox) +{ + CheckBox->_ReservedCheckBox2(); +} + +*/ +/*********************************************************************** + * Method: BCheckBox::_ReservedCheckBox3 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BCheckBox__ReservedCheckBox3(BCheckBox *CheckBox) +{ + CheckBox->_ReservedCheckBox3(); +} +*/ + +/*********************************************************************** + * Method: BCheckBox::operator= + * Params: const BCheckBox & + * Returns: BCheckBox & + * Effects: + ***********************************************************************/ +/*BCheckBox & +BCheckBox_operator=(BCheckBox *CheckBox, const BCheckBox &) +{ + return CheckBox->operator=(); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _CHECKBOX_CPP_ */ + diff --git a/bepascal/source/bepascal/cpp/src/be/interface/Control.cpp b/bepascal/source/bepascal/cpp/src/be/interface/Control.cpp new file mode 100644 index 0000000..f20c710 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/Control.cpp @@ -0,0 +1,560 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _CONTROL_CPP_ +#define _CONTROL_CPP_ + +#include "Control.h" +#include "Rect.h" +#include "View.h" +#include "Message.h" + +#include + +#include "view.h" +#include "control.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +BControl_SetEnabled_hook Control_SetEnabled_hook; +BControl_SetValue_hook Control_SetValue_hook; + +#if defined(__cplusplus) +} +#endif + + +BPControl::BPControl(TPasObject PasObject, BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizeMask, + uint32 flags) + : + BControl(frame, name, label, message, + resizeMask, flags), + BPView(PasObject, frame, name, resizeMask, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + +BPControl::BPControl(TPasObject PasObject, BMessage *message): + BControl(message), + BPView(PasObject, message), + BPHandler(PasObject, message), + BPasObject(PasObject) +{ +} + +void BPControl::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BControl::MessageReceived(message); +} + +void BPControl::Draw(BRect updateRect) +{ + BControl::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPControl::AttachedToWindow(void) +{ + BControl::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + +void BPControl::SetEnabled(bool enabled) +{ + SetEnabled_hookCall(enabled); +} + +void BPControl::SetEnabled_hookCall(bool enabled) +{ + Control_SetEnabled_hook(GetPasObject(), enabled); +} + +void BPControl::SetValue(int32 value) +{ + SetValue_hookCall(value); +} + +void BPControl::SetValue_hookCall(int32 value) +{ + Control_SetValue_hook(GetPasObject(), value); +} + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Method: BControl::BControl() + * Descr: + */ +TCPlusObject BControl_Create(TPasObject PasObject, BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizeMask, + uint32 flags) +{ + return new BPControl(PasObject, frame, + name, + label, + message, + resizeMask, + flags); +} + + +/* + * Method: BControl::~BControl() + * Descr: +*/ + +void BControl_Free(BControl *Control) +{ + delete Control; +} + + +/* + * Method: BControl::BControl() + * Descr: + */ +/*TCPlusObject BControl_Create(TPasObject PasObject, BMessage *data) +{ + return new BPControl(PasObject, data); +} +*/ + + +/* + * Method: BControl::Instantiate() + * Descr: + */ +BArchivable * +BControl_Instantiate(BControl *Control, BMessage *data) +{ + return Control->Instantiate(data); +} + + +/* + * Method: BControl::Archive() + * Descr: + */ +status_t +BControl_Archive(BControl *Control, BMessage *data, + bool deep) +{ + return Control->Archive(data, + deep); +} + + +/* + * Method: BControl::WindowActivated() + * Descr: + */ +void +BControl_WindowActivated(BControl *Control, bool state) +{ + Control->WindowActivated(state); +} + + +/* + * Method: BControl::AttachedToWindow() + * Descr: + */ +void +BControl_AttachedToWindow(BControl *Control) +{ + Control->AttachedToWindow(); +} + + +/* + * Method: BControl::MessageReceived() + * Descr: + */ +void +BControl_MessageReceived(BControl *Control, BMessage *msg) +{ + Control->MessageReceived(msg); +} + + +/* + * Method: BControl::MakeFocus() + * Descr: + */ +void +BControl_MakeFocus(BControl *Control, bool state) +{ + Control->MakeFocus(state); +} + + +/* + * Method: BControl::KeyDown() + * Descr: + */ +void +BControl_KeyDown(BControl *Control, const char *bytes, + int32 numBytes) +{ + Control->KeyDown(bytes, + numBytes); +} + + +/* + * Method: BControl::MouseDown() + * Descr: + */ +void +BControl_MouseDown(BControl *Control, BPoint pt) +{ + Control->MouseDown(pt); +} + + +/* + * Method: BControl::MouseUp() + * Descr: + */ +void +BControl_MouseUp(BControl *Control, BPoint pt) +{ + Control->MouseUp(pt); +} + + +/* + * Method: BControl::MouseMoved() + * Descr: + */ +void +BControl_MouseMoved(BControl *Control, BPoint pt, + uint32 code, + const BMessage *msg) +{ + Control->MouseMoved(pt, + code, + msg); +} + + +/* + * Method: BControl::DetachedFromWindow() + * Descr: + */ +void +BControl_DetachedFromWindow(BControl *Control) +{ + Control->DetachedFromWindow(); +} + + +/* + * Method: BControl::SetLabel() + * Descr: + */ +void +BControl_SetLabel(BControl *Control, const char *text) +{ + Control->SetLabel(text); +} + + +/* + * Method: BControl::Label() + * Descr: + */ +const char * +BControl_Label(BControl *Control) +{ + return Control->Label(); +} + + +/* + * Method: BControl::SetValue() + * Descr: + */ +void +BControl_SetValue(BControl *Control, int32 value) +{ + Control->SetValue(value); +} + + +/* + * Method: BControl::Value() + * Descr: + */ +int32 +BControl_Value(BControl *Control) +{ + return Control->Value(); +} + + +/* + * Method: BControl::SetEnabled() + * Descr: + */ +void +BControl_SetEnabled(BControl *Control, bool on) +{ + Control->SetEnabled(on); +} + + +/* + * Method: BControl::IsEnabled() + * Descr: + */ +bool +BControl_IsEnabled(BControl *Control) +{ + return Control->IsEnabled(); +} + + +/* + * Method: BControl::GetPreferredSize() + * Descr: + */ +void +BControl_GetPreferredSize(BControl *Control, float *width, + float *height) +{ + Control->GetPreferredSize(width, + height); +} + + +/* + * Method: BControl::ResizeToPreferred() + * Descr: + */ +void +BControl_ResizeToPreferred(BControl *Control) +{ + Control->ResizeToPreferred(); +} + + +/* + * Method: BControl::Invoke() + * Descr: + */ +status_t +BControl_Invoke(BControl *Control, BMessage *msg) +{ + return Control->Invoke(msg); +} + + +/* + * Method: BControl::ResolveSpecifier() + * Descr: + */ +BHandler * +BControl_ResolveSpecifier(BControl *Control, BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property) +{ + return Control->ResolveSpecifier(msg, + index, + specifier, + form, + property); +} + + +/* + * Method: BControl::GetSupportedSuites() + * Descr: + */ +status_t +BControl_GetSupportedSuites(BControl *Control, BMessage *data) +{ + return Control->GetSupportedSuites(data); +} + + +/* + * Method: BControl::AllAttached() + * Descr: + */ +void +BControl_AllAttached(BControl *Control) +{ + Control->AllAttached(); +} + + +/* + * Method: BControl::AllDetached() + * Descr: + */ +void +BControl_AllDetached(BControl *Control) +{ + Control->AllDetached(); +} + + +/* + * Method: BControl::Perform() + * Descr: + */ +status_t +BControl_Perform(BControl *Control, perform_code d, + void *arg) +{ + return Control->Perform(d, + arg); +} + + +/* + * Method: BControl::IsFocusChanging() + * Descr: + */ +/*bool +BControl_IsFocusChanging(BControl *Control) +{ + return Control->IsFocusChanging(); +}*/ + + +/* + * Method: BControl::IsTracking() + * Descr: + */ +/*bool +BControl_IsTracking(BControl *Control) +{ + return Control->IsTracking(); +}*/ + + +/* + * Method: BControl::SetTracking() + * Descr: + */ +/*void +BControl_SetTracking(BControl *Control, bool state) +{ + Control->SetTracking(state); +}*/ + + +/* + * Method: BControl::SetValueNoUpdate() + * Descr: + */ +/*void +BControl_SetValueNoUpdate(BControl *Control, int32 value) +{ + Control->SetValueNoUpdate(value); +}*/ + + +/* + * Method: BControl::_ReservedControl1() + * Descr: + */ +/*void +BControl__ReservedControl1(BControl *Control) +{ + Control->_ReservedControl1(); +}*/ + + +/* + * Method: BControl::_ReservedControl2() + * Descr: + */ +/*void +BControl__ReservedControl2(BControl *Control) +{ + Control->_ReservedControl2(); +}*/ + + +/* + * Method: BControl::_ReservedControl3() + * Descr: + */ +/*void +BControl__ReservedControl3(BControl *Control) +{ + Control->_ReservedControl3(); +}*/ + + +/* + * Method: BControl::_ReservedControl4() + * Descr: + */ +/*void +BControl__ReservedControl4(BControl *Control) +{ + Control->_ReservedControl4(); +}*/ + + +/* + * Method: BControl::operator=() + * Descr: + */ +/*BControl & +BControl_operator=(BControl *Control, const BControl &) +{ + return Control->operator=(); +}*/ + + +/* + * Method: BControl::InitData() + * Descr: + */ +/*void +BControl_InitData(BControl *Control, BMessage *data) +{ + Control->InitData(data); +}*/ + +#if defined(__cplusplus) +} +#endif + +#endif /* _CONTROL_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/interface/Font.cpp b/bepascal/source/bepascal/cpp/src/be/interface/Font.cpp new file mode 100644 index 0000000..51fc423 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/Font.cpp @@ -0,0 +1,692 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _FONT_CPP_ +#define _FONT_CPP_ + + +#include "Font.h" +#include "font.h" +#include "Rect.h" +#include + + + +BPFont::BPFont(TPasObject PasObject, const BFont &font) : BFont( font), BPasObject(PasObject) +{ +} + +BPFont::BPFont(TPasObject PasObject) : BFont(), BPasObject(PasObject) +{ +} + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Font.cpp + * DATE: Wed Jan 29 20:08:34 2003 + * DESCR: + ***********************************************************************/ +#include "Font.h" + +/*********************************************************************** + * Method: BFont::BFont + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BFont_Create(TPasObject PasObject) +{ + return new BPFont(PasObject); +} + + +/*********************************************************************** + * Method: BFont::BFont + * Params: const BFont &font + * Effects: + ***********************************************************************/ +TCPlusObject BFont_Create_1 +(TPasObject PasObject, const BFont &font) +{ + return new BPFont(PasObject, font); +} + + +/*********************************************************************** + * Method: BFont::BFont + * Params: const BFont *font + * Effects: + ***********************************************************************/ +TCPlusObject BFont_Create_2 +(TPasObject PasObject, const BFont *font) +{ + return new BPFont(PasObject, font); +} + +void BFont_Free +(BFont *font) +{ + //delete font; +} + + +/*********************************************************************** + * Method: BFont::SetFamilyAndStyle + * Params: const font_family family, const font_style style + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BFont_SetFamilyAndStyle(BFont *Font, const font_family family, const font_style style) +{ + //return Font->SetFamilyAndStyle(family, style); +} + + +/*********************************************************************** + * Method: BFont::SetFamilyAndStyle + * Params: uint32 code + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetFamilyAndStyle_1 +(BFont *Font, uint32 code) +{ + //Font->SetFamilyAndStyle(code); +} + + +/*********************************************************************** + * Method: BFont::SetFamilyAndFace + * Params: const font_family family, uint16 face + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BFont_SetFamilyAndFace(BFont *Font, const font_family family, uint16 face) +{ + return Font->SetFamilyAndFace(family, face); +} + + +/*********************************************************************** + * Method: BFont::SetSize + * Params: float size + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetSize(BFont *Font, float size) +{ + Font->SetSize(size); +} + + +/*********************************************************************** + * Method: BFont::SetShear + * Params: float shear + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetShear(BFont *Font, float shear) +{ + Font->SetShear(shear); +} + + +/*********************************************************************** + * Method: BFont::SetRotation + * Params: float rotation + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetRotation(BFont *Font, float rotation) +{ + Font->SetRotation(rotation); +} + + +/*********************************************************************** + * Method: BFont::SetSpacing + * Params: uint8 spacing + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetSpacing(BFont *Font, uint8 spacing) +{ + Font->SetSpacing(spacing); +} + + +/*********************************************************************** + * Method: BFont::SetEncoding + * Params: uint8 encoding + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetEncoding(BFont *Font, uint8 encoding) +{ + Font->SetEncoding(encoding); +} + + +/*********************************************************************** + * Method: BFont::SetFace + * Params: uint16 face + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetFace(BFont *Font, uint16 face) +{ + Font->SetFace(face); +} + + +/*********************************************************************** + * Method: BFont::SetFlags + * Params: uint32 flags + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetFlags(BFont *Font, uint32 flags) +{ + Font->SetFlags(flags); +} + + +/*********************************************************************** + * Method: BFont::GetFamilyAndStyle + * Params: font_family *family, font_style *style + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetFamilyAndStyle(BFont *Font, font_family *family, font_style *style) +{ + //Font->GetFamilyAndStyle(family, style); +} + + +/*********************************************************************** + * Method: BFont::FamilyAndStyle + * Params: + * Returns: uint32 + * Effects: + ***********************************************************************/ +uint32 +BFont_FamilyAndStyle(BFont *Font) +{ + // return Font->FamilyAndStyle(); +} + + +/*********************************************************************** + * Method: BFont::Size + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BFont_Size(BFont *Font) +{ + return Font->Size(); +} + + +/*********************************************************************** + * Method: BFont::Shear + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BFont_Shear(BFont *Font) +{ + return Font->Shear(); +} + + +/*********************************************************************** + * Method: BFont::Rotation + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BFont_Rotation(BFont *Font) +{ + return Font->Rotation(); +} + + +/*********************************************************************** + * Method: BFont::Spacing + * Params: + * Returns: uint8 + * Effects: + ***********************************************************************/ +uint8 +BFont_Spacing(BFont *Font) +{ + return Font->Spacing(); +} + + +/*********************************************************************** + * Method: BFont::Encoding + * Params: + * Returns: uint8 + * Effects: + ***********************************************************************/ +uint8 +BFont_Encoding(BFont *Font) +{ + return Font->Encoding(); +} + + +/*********************************************************************** + * Method: BFont::Face + * Params: + * Returns: uint16 + * Effects: + ***********************************************************************/ +uint16 +BFont_Face(BFont *Font) +{ + return Font->Face(); +} + + +/*********************************************************************** + * Method: BFont::Flags + * Params: + * Returns: uint32 + * Effects: + ***********************************************************************/ +uint32 +BFont_Flags(BFont *Font) +{ + return Font->Flags(); +} + + +/*********************************************************************** + * Method: BFont::Direction + * Params: + * Returns: font_direction + * Effects: + ***********************************************************************/ +font_direction +BFont_Direction(BFont *Font) +{ + return Font->Direction(); +} + + +/*********************************************************************** + * Method: BFont::IsFixed + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BFont_IsFixed(BFont *Font) +{ + return Font->IsFixed(); +} + + +/*********************************************************************** + * Method: BFont::IsFullAndHalfFixed + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BFont_IsFullAndHalfFixed(BFont *Font) +{ + return Font->IsFullAndHalfFixed(); +} + + +/*********************************************************************** + * Method: BFont::BoundingBox + * Params: + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BFont_BoundingBox(BFont *Font) +{ + return Font->BoundingBox(); +} + + +/*********************************************************************** + * Method: BFont::Blocks + * Params: + * Returns: unicode_block + * Effects: + ***********************************************************************/ +unicode_block +BFont_Blocks(BFont *Font) +{ + return Font->Blocks(); +} + + +/*********************************************************************** + * Method: BFont::FileFormat + * Params: + * Returns: font_file_format + * Effects: + ***********************************************************************/ +font_file_format +BFont_FileFormat(BFont *Font) +{ + return Font->FileFormat(); +} + + +/*********************************************************************** + * Method: BFont::CountTuned + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BFont_CountTuned(BFont *Font) +{ + return Font->CountTuned(); +} + + +/*********************************************************************** + * Method: BFont::GetTunedInfo + * Params: int32 index, tuned_font_info *info + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetTunedInfo(BFont *Font, int32 index, tuned_font_info *info) +{ + Font->GetTunedInfo(index, info); +} + + +/*********************************************************************** + * Method: BFont::TruncateString + * Params: BString *in_out, uint32 mode, float width + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_TruncateString(BFont *Font, BString *in_out, uint32 mode, float width) +{ + Font->TruncateString(in_out, mode, width); +} + + +/*********************************************************************** + * Method: BFont::GetTruncatedStrings + * Params: const char *stringArray[], int32 numStrings, uint32 mode, float width, BString resultArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetTruncatedStrings(BFont *Font, const char *stringArray[], int32 numStrings, uint32 mode, float width, BString resultArray[]) +{ + Font->GetTruncatedStrings(stringArray, numStrings, mode, width, resultArray); +} + + +/*********************************************************************** + * Method: BFont::GetTruncatedStrings + * Params: const char *stringArray[], int32 numStrings, uint32 mode, float width, char *resultArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetTruncatedStrings_1 +(BFont *Font, const char *stringArray[], int32 numStrings, uint32 mode, float width, char *resultArray[]) +{ + Font->GetTruncatedStrings(stringArray, numStrings, mode, width, resultArray); +} + + +/*********************************************************************** + * Method: BFont::StringWidth + * Params: const char *string + * Returns: float + * Effects: + ***********************************************************************/ +float +BFont_StringWidth(BFont *Font, const char *string) +{ + return Font->StringWidth(string); +} + + +/*********************************************************************** + * Method: BFont::StringWidth + * Params: const char *string, int32 length + * Returns: float + * Effects: + ***********************************************************************/ +float +BFont_StringWidth_1 +(BFont *Font, const char *string, int32 length) +{ + return Font->StringWidth(string, length); +} + + +/*********************************************************************** + * Method: BFont::GetStringWidths + * Params: const char *stringArray[], const int32 lengthArray[], int32 numStrings, float widthArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetStringWidths(BFont *Font, const char *stringArray[], const int32 lengthArray[], int32 numStrings, float widthArray[]) +{ + Font->GetStringWidths(stringArray, lengthArray, numStrings, widthArray); +} + + +/*********************************************************************** + * Method: BFont::GetEscapements + * Params: const char charArray[], int32 numChars, float escapementArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetEscapements(BFont *Font, const char charArray[], int32 numChars, float escapementArray[]) +{ + Font->GetEscapements(charArray, numChars, escapementArray); +} + + +/*********************************************************************** + * Method: BFont::GetEscapements + * Params: const char charArray[], int32 numChars, escapement_delta *delta, float escapementArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetEscapements_1 +(BFont *Font, const char charArray[], int32 numChars, escapement_delta *delta, float escapementArray[]) +{ + Font->GetEscapements(charArray, numChars, delta, escapementArray); +} + + +/*********************************************************************** + * Method: BFont::GetEscapements + * Params: const char charArray[], int32 numChars, escapement_delta *delta, BPoint escapementArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetEscapements_2 +(BFont *Font, const char charArray[], int32 numChars, escapement_delta *delta, BPoint escapementArray[]) +{ + Font->GetEscapements(charArray, numChars, delta, escapementArray); +} + + +/*********************************************************************** + * Method: BFont::GetEscapements + * Params: const char charArray[], int32 numChars, escapement_delta *delta, BPoint escapementArray[], BPoint offsetArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetEscapements_3 +(BFont *Font, const char charArray[], int32 numChars, escapement_delta *delta, BPoint escapementArray[], BPoint offsetArray[]) +{ + Font->GetEscapements(charArray, numChars, delta, escapementArray, offsetArray); +} + + +/*********************************************************************** + * Method: BFont::GetEdges + * Params: const char charArray[], int32 numBytes, edge_info edgeArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetEdges(BFont *Font, const char charArray[], int32 numBytes, edge_info edgeArray[]) +{ + Font->GetEdges(charArray, numBytes, edgeArray); +} + + +/*********************************************************************** + * Method: BFont::GetHeight + * Params: font_height *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetHeight(BFont *Font, font_height *height) +{ + Font->GetHeight(height); +} + + +/*********************************************************************** + * Method: BFont::GetBoundingBoxesAsGlyphs + * Params: const char charArray[], int32 numChars, font_metric_mode mode, BRect boundingBoxArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetBoundingBoxesAsGlyphs(BFont *Font, const char charArray[], int32 numChars, font_metric_mode mode, BRect boundingBoxArray[]) +{ + Font->GetBoundingBoxesAsGlyphs(charArray, numChars, mode, boundingBoxArray); +} + + +/*********************************************************************** + * Method: BFont::GetBoundingBoxesAsString + * Params: const char charArray[], int32 numChars, font_metric_mode mode, escapement_delta *delta, BRect boundingBoxArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetBoundingBoxesAsString(BFont *Font, const char charArray[], int32 numChars, font_metric_mode mode, escapement_delta *delta, BRect boundingBoxArray[]) +{ + Font->GetBoundingBoxesAsString(charArray, numChars, mode, delta, boundingBoxArray); +} + + +/*********************************************************************** + * Method: BFont::GetBoundingBoxesForStrings + * Params: const char *stringArray[], int32 numStrings, font_metric_mode mode, escapement_delta deltas[], BRect boundingBoxArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetBoundingBoxesForStrings(BFont *Font, const char *stringArray[], int32 numStrings, font_metric_mode mode, escapement_delta deltas[], BRect boundingBoxArray[]) +{ + Font->GetBoundingBoxesForStrings(stringArray, numStrings, mode, deltas, boundingBoxArray); +} + + +/*********************************************************************** + * Method: BFont::GetGlyphShapes + * Params: const char charArray[], int32 numChars, BShape *glyphShapeArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetGlyphShapes(BFont *Font, const char charArray[], int32 numChars, BShape *glyphShapeArray[]) +{ + Font->GetGlyphShapes(charArray, numChars, glyphShapeArray); +} + + +/*********************************************************************** + * Method: BFont::GetHasGlyphs + * Params: const char charArray[], int32 numChars, bool hasArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetHasGlyphs(BFont *Font, const char charArray[], int32 numChars, bool hasArray[]) +{ + Font->GetHasGlyphs(charArray, numChars, hasArray); +} + + + +/*********************************************************************** + * Method: BFont::PrintToStream + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_PrintToStream(BFont *Font) +{ + Font->PrintToStream(); +} + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _FONT_CPP_ */ + diff --git a/bepascal/source/bepascal/cpp/src/be/interface/ListItem.cpp b/bepascal/source/bepascal/cpp/src/be/interface/ListItem.cpp new file mode 100644 index 0000000..53a5743 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/ListItem.cpp @@ -0,0 +1,503 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _LISTITEM_CPP_ +#define _LISTITEM_CPP_ +/*********************************************************************** + * AUTHOR: nobody + * FILE: StringView.cpp + * DATE: Mon Jan 13 21:52:29 2003 + * DESCR: + ***********************************************************************/ +#include "ListItem.h" +#include + + + +typedef void (*BListItem_DrawItem_hook) (TPasObject PasObject, TCPlusObject owner, TCPlusObject frame, bool complete ); +typedef void (*BListString_DrawItem_hook) (TPasObject PasObject, TCPlusObject owner, TCPlusObject frame, bool complete ); + +typedef void (*BListItem_Update_hook) (TPasObject PasObject, TCPlusObject owner, TCPlusObject font); +typedef void (*BListString_Update_hook) (TPasObject PasObject, TCPlusObject owner, TCPlusObject font); + + +#if defined(__cplusplus) +extern "C" { +#endif + +BListItem_DrawItem_hook ListItem_DrawItem_hook; +BListString_DrawItem_hook ListString_DrawItem_hook; +BListItem_Update_hook ListItem_Update_hook; +BListString_Update_hook ListString_Update_hook; + +#if defined(__cplusplus) +} +#endif +//////////////////////////////////////// +// BPListItem +//////////////////////////////////////// +class BPListItem : public BListItem, virtual public BPasObject +{ + public: + BPListItem(TPasObject PasObject,BMessage *data); + BPListItem(TPasObject PasObject,uint32 outlineLevel = 0, bool expanded = true); + + virtual void DrawItem(BView *owner, BRect frame, bool complete = false); + virtual void Update(BView *owner, const BFont *font); + private: +}; + + + +BPListItem::BPListItem(TPasObject PasObject,BMessage *data) + :BListItem(data), + BPasObject(PasObject) + +{ +} + +BPListItem::BPListItem(TPasObject PasObject, uint32 outlineLevel = 0, bool expanded = true) + :BListItem(outlineLevel,expanded), + BPasObject(PasObject) +{ +} + +void BPListItem::Update(BView *owner, const BFont *font) +{ + ListItem_Update_hook(GetPasObject(), &owner, &font); +} + +void BPListItem::DrawItem(BView *owner, BRect frame, bool complete = false) +{ + //BListItem::DrawItem(owner, frame, complete); + ListItem_DrawItem_hook(GetPasObject(), &owner, &frame, complete); +} + + +//////////////////////////////////////// +// BPStringItem +//////////////////////////////////////// + +class BPStringItem : public BStringItem , virtual public BPasObject +{ + public: + BPStringItem(TPasObject PasObject,const char *text,uint32 outlineLevel = 0, bool expanded = true); + BPStringItem(TPasObject PasObject,BMessage *data); + virtual void DrawItem(BView *owner, BRect frame, bool complete = false); + virtual void Update(BView *owner, const BFont *font); + private: +}; + +BPStringItem::BPStringItem(TPasObject PasObject,const char *text,uint32 outlineLevel = 0, bool expanded = true) + :BStringItem(text,outlineLevel,expanded), + //BPListItem(PasObject,outlineLevel,expanded), + BPasObject(PasObject) +{ +} + +BPStringItem::BPStringItem(TPasObject PasObject,BMessage *data) + :BStringItem(data), + //BPListItem(PasObject), + BPasObject(PasObject) +{ +} + +void BPStringItem::DrawItem(BView *owner, BRect frame, bool complete = false) +{ + BStringItem::DrawItem(owner, frame, complete); + ListString_DrawItem_hook(GetPasObject(), &owner, &frame, complete); + +} + +void BPStringItem::Update(BView *owner, const BFont *font) +{ + BStringItem::Update(owner, font); + ListString_Update_hook(GetPasObject(), &owner, &font); +} + +#if defined(__cplusplus) +extern "C" { +#endif + + + +/*********************************************************************** + * AUTHOR: nobody + * FILE: ListItem.cpp + * DATE: Mon Feb 3 20:25:49 2003 + * DESCR: + ***********************************************************************/ + + + + +TCPlusObject BListItem_Create(TPasObject PasObject, uint32 outlineLevel, bool expanded) +{ + return new BPListItem(PasObject, outlineLevel, expanded); +} + + +/*********************************************************************** + * Method: BListItem::BListItem + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BListItem_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPListItem(PasObject, data); +} + + +/*********************************************************************** + * Method: BListItem::~BListItem + * Params: + * Effects: + ***********************************************************************/ +void BListItem_Free(BListItem *ListItem) +{ + delete ListItem; +} + + +/*********************************************************************** + * Method: BListItem::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BListItem_Archive(BListItem *ListItem, BMessage *data, bool deep) +{ + return ListItem->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BListItem::Height + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BListItem_Height(BListItem *ListItem) +{ + return ListItem->Height(); +} + + +/*********************************************************************** + * Method: BListItem::Width + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BListItem_Width(BListItem *ListItem) +{ + return ListItem->Width(); +} + + +/*********************************************************************** + * Method: BListItem::IsSelected + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListItem_IsSelected(BListItem *ListItem) +{ + return ListItem->IsSelected(); +} + + +/*********************************************************************** + * Method: BListItem::Select + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListItem_Select(BListItem *ListItem) +{ + ListItem->Select(); +} + + +/*********************************************************************** + * Method: BListItem::Deselect + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListItem_Deselect(BListItem *ListItem) +{ + ListItem->Deselect(); +} + + +/*********************************************************************** + * Method: BListItem::SetEnabled + * Params: bool on + * Returns: void + * Effects: + ***********************************************************************/ +void +BListItem_SetEnabled(BListItem *ListItem, bool on) +{ + ListItem->SetEnabled(on); +} + + +/*********************************************************************** + * Method: BListItem::IsEnabled + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListItem_IsEnabled(BListItem *ListItem) +{ + return ListItem->IsEnabled(); +} + + +/*********************************************************************** + * Method: BListItem::SetHeight + * Params: float height + * Returns: void + * Effects: + ***********************************************************************/ +void +BListItem_SetHeight(BListItem *ListItem, float height) +{ + ListItem->SetHeight(height); +} + + +/*********************************************************************** + * Method: BListItem::SetWidth + * Params: float width + * Returns: void + * Effects: + ***********************************************************************/ +void +BListItem_SetWidth(BListItem *ListItem, float width) +{ + ListItem->SetWidth(width); +} + + +/*********************************************************************** + * Method: BListItem::Update + * Params: BView *owner, const BFont *font + * Returns: void + * Effects: + ***********************************************************************/ +void +BListItem_Update(BListItem *ListItem, BView *owner, const BFont *font) +{ + ListItem->Update(owner, font); +} + + +/*********************************************************************** + * Method: BListItem::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BListItem_Perform(BListItem *ListItem, perform_code d, void *arg) +{ + return ListItem->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BListItem::IsExpanded + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListItem_IsExpanded(BListItem *ListItem) +{ + return ListItem->IsExpanded(); +} + + +/*********************************************************************** + * Method: BListItem::SetExpanded + * Params: bool expanded + * Returns: void + * Effects: + ***********************************************************************/ +void +BListItem_SetExpanded(BListItem *ListItem, bool expanded) +{ + ListItem->SetExpanded(expanded); +} + + +/*********************************************************************** + * Method: BListItem::OutlineLevel + * Params: + * Returns: uint32 + * Effects: + ***********************************************************************/ +uint32 +BListItem_OutlineLevel(BListItem *ListItem) +{ + return ListItem->OutlineLevel(); +} + + +void BListItem_DrawItem(BListItem *ListItem, BView *owner, BRect frame, bool complete) +{ + ListItem->DrawItem(owner, frame, complete); +} + +TCPlusObject BStringItem_Create(TPasObject PasObject, const char *text, uint32 outlineLevel, bool expanded) +{ + return new BPStringItem(PasObject, text, outlineLevel, expanded); +} + + +/*********************************************************************** + * Method: BStringItem::~BStringItem + * Params: + * Effects: + ***********************************************************************/ +void BStringItem_Free(BStringItem *StringItem) +{ + return StringItem->~BStringItem(); +} + + +/*********************************************************************** + * Method: BStringItem::BStringItem + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BStringItem_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPStringItem(PasObject, data); +} + + +/*********************************************************************** + * Method: BStringItem::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BStringItem_Instantiate(BStringItem *StringItem, BMessage *data) +{ + return StringItem->Instantiate(data); +} + + +/*********************************************************************** + * Method: BStringItem::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BStringItem_Archive(BStringItem *StringItem, BMessage *data, bool deep) +{ + return StringItem->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BStringItem::DrawItem + * Params: BView *owner, BRect frame, bool complete + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringItem_DrawItem(BStringItem *StringItem, BView *owner, BRect frame, bool complete) +{ + StringItem->DrawItem(owner, frame, complete); +} + + +/*********************************************************************** + * Method: BStringItem::SetText + * Params: const char *text + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringItem_SetText(BStringItem *StringItem, const char *text) +{ + StringItem->SetText(text); +} + + +/*********************************************************************** + * Method: BStringItem::Text + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BStringItem_Text(BStringItem *StringItem) +{ + return StringItem->Text(); +} + + +/*********************************************************************** + * Method: BStringItem::Update + * Params: BView *owner, const BFont *font + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringItem_Update(BStringItem *StringItem, BView *owner, const BFont *font) +{ + StringItem->Update(owner, font); +} + + +/*********************************************************************** + * Method: BStringItem::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BStringItem_Perform(BStringItem *StringItem, perform_code d, void *arg) +{ + return StringItem->Perform(d, arg); +} + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _LISTITEM_CPP_ */ + diff --git a/bepascal/source/bepascal/cpp/src/be/interface/ListView.cpp b/bepascal/source/bepascal/cpp/src/be/interface/ListView.cpp new file mode 100644 index 0000000..3fe59df --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/ListView.cpp @@ -0,0 +1,1031 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _LISTVIEW_CPP_ +#define _LISTVIEW_CPP_ + +#include "ListView.h" +#include "view.h" +#include +#include + + +typedef void (*BListItem_SelectionChanged_hook) (TPasObject PasObject); +typedef void (*BListString_InitiateDrag_hook) (TPasObject PasObject, TCPlusObject pt, int32 itemIndex, bool initialySelected ); + + +#if defined(__cplusplus) +extern "C" { +#endif + +BListItem_SelectionChanged_hook ListItem_SelectionChanged_hook; +BListString_InitiateDrag_hook ListString_InitiateDrag_hook; +#if defined(__cplusplus) +} +#endif + + +BPListView::BPListView(TPasObject PasObject,BMessage *data) + :BListView(data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} + +BPListView::BPListView(TPasObject PasObject,BRect frame, + const char *name, + list_view_type type = B_SINGLE_SELECTION_LIST, + uint32 resizeMask = B_FOLLOW_LEFT | + B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | + B_NAVIGABLE) + :BListView(frame,name,type,resizeMask,flags), + BPView(PasObject, BRect(0,0,0,0), name, 0, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ +} + + +void BPListView::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BListView::MessageReceived(message); +} + +void BPListView::Draw(BRect updateRect) +{ + BListView::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPListView::AttachedToWindow(void) +{ + //BTextView::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + + +void BPListView::AllAttached(void) +{ + //AllAttached_hookCall(); + BListView::AllAttached(); +} + +void BPListView::AllDetached(void) +{ + //AllDetached_hookCall(); + BListView::AllDetached(); +} + + +void BPListView::WindowActivated(bool active) +{ + BListView::WindowActivated(active); +} + +void BPListView::KeyDown(const char *bytes, int32 numBytes) +{ + BListView::KeyDown(bytes, numBytes); +} + + +void BPListView::FrameResized(float width, float height) +{ + FrameResized_hookCall(width, height); + BListView::FrameResized(width, height); +} + +void BPListView::DetachedFromWindow(void) +{ + BListView::DetachedFromWindow(); +} + + + +void BPListView::MouseDown(BPoint point) +{ + BListView::MouseDown(point); +} + +void BPListView::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BListView::MouseMoved(point, transit, message); +} + +void BPListView::MouseUp(BPoint point) +{ + BListView::MouseUp(point); +} + +bool BPListView::InitiateDrag(BPoint pt, int32 itemIndex,bool initialySelected) +{ + ListString_InitiateDrag_hook(GetPasObject(), &pt, itemIndex, initialySelected); +} + +void BPListView::SelectionChanged() +{ + BListView::SelectionChanged(); + ListItem_SelectionChanged_hook(GetPasObject()); +} + + + + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BListView_Create(TPasObject PasObject,BRect frame, + const char *name, + list_view_type type = B_SINGLE_SELECTION_LIST, + uint32 resizeMask = B_FOLLOW_LEFT | + B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | + B_NAVIGABLE) +{ + return new BPListView(PasObject,frame,name,type,resizeMask,flags); +} + +/*********************************************************************** + * Method: BListView::BListView + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BListView_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPListView(PasObject, data); +} + + +/*********************************************************************** + * Method: BListView::~BListView + * Params: + * Effects: + ***********************************************************************/ +void BListView_Free(BListView *ListView) +{ + delete ListView; +} + + +/*********************************************************************** + * Method: BListView::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BListView_Instantiate(BListView *ListView, BMessage *data) +{ + return ListView->Instantiate(data); +} + + +/*********************************************************************** + * Method: BListView::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BListView_Archive(BListView *ListView, BMessage *data, bool deep) +{ + return ListView->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BListView::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_Draw(BListView *ListView, BRect updateRect) +{ + ListView->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BListView::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_MessageReceived(BListView *ListView, BMessage *msg) +{ + ListView->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BListView::MouseDown + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_MouseDown(BListView *ListView, BPoint where) +{ + ListView->MouseDown(where); +} + + +/*********************************************************************** + * Method: BListView::KeyDown + * Params: const char *bytes, int32 numBytes + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_KeyDown(BListView *ListView, const char *bytes, int32 numBytes) +{ + ListView->KeyDown(bytes, numBytes); +} + + +/*********************************************************************** + * Method: BListView::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_MakeFocus(BListView *ListView, bool state) +{ + ListView->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BListView::FrameResized + * Params: float newWidth, float newHeight + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_FrameResized(BListView *ListView, float newWidth, float newHeight) +{ + ListView->FrameResized(newWidth, newHeight); +} + + +/*********************************************************************** + * Method: BListView::TargetedByScrollView + * Params: BScrollView *scroller + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_TargetedByScrollView(BListView *ListView, BScrollView *scroller) +{ + ListView->TargetedByScrollView(scroller); +} + + +/*********************************************************************** + * Method: BListView::ScrollTo + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_ScrollTo(BListView *ListView, BPoint where) +{ + ListView->ScrollTo(where); +} + + +/*********************************************************************** + * Method: BListView::AddItem + * Params: BListItem *item + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_AddItem(BListView *ListView, BListItem *item) +{ + return ListView->AddItem(item); +} + + +/*********************************************************************** + * Method: BListView::AddItem + * Params: BListItem *item, int32 atIndex + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_AddItem_1 +(BListView *ListView, BListItem *item, int32 atIndex) +{ + return ListView->AddItem(item, atIndex); +} + + +/*********************************************************************** + * Method: BListView::AddList + * Params: BList *newItems + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_AddList(BListView *ListView, BList *newItems) +{ + return ListView->AddList(newItems); +} + + +/*********************************************************************** + * Method: BListView::AddList + * Params: BList *newItems, int32 atIndex + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_AddList_1 +(BListView *ListView, BList *newItems, int32 atIndex) +{ + return ListView->AddList(newItems, atIndex); +} + + +/*********************************************************************** + * Method: BListView::RemoveItem + * Params: BListItem *item + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_RemoveItem(BListView *ListView, BListItem *item) +{ + return ListView->RemoveItem(item); +} + + +/*********************************************************************** + * Method: BListView::RemoveItem + * Params: int32 index + * Returns: BListItem * + * Effects: + ***********************************************************************/ +BListItem * +BListView_RemoveItem_1 +(BListView *ListView, int32 index) +{ + return ListView->RemoveItem(index); +} + + +/*********************************************************************** + * Method: BListView::RemoveItems + * Params: int32 index, int32 count + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_RemoveItems_2 +(BListView *ListView, int32 index, int32 count) +{ + return ListView->RemoveItems(index, count); +} + + +/*********************************************************************** + * Method: BListView::SetSelectionMessage + * Params: BMessage *message + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_SetSelectionMessage(BListView *ListView, BMessage *message) +{ + ListView->SetSelectionMessage(message); +} + + +/*********************************************************************** + * Method: BListView::SetInvocationMessage + * Params: BMessage *message + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_SetInvocationMessage(BListView *ListView, BMessage *message) +{ + ListView->SetInvocationMessage(message); +} + + +/*********************************************************************** + * Method: BListView::SelectionMessage + * Params: + * Returns: BMessage * + * Effects: + ***********************************************************************/ +BMessage * +BListView_SelectionMessage(BListView *ListView) +{ + return ListView->SelectionMessage(); +} + + +/*********************************************************************** + * Method: BListView::SelectionCommand + * Params: + * Returns: uint32 + * Effects: + ***********************************************************************/ +uint32 +BListView_SelectionCommand(BListView *ListView) +{ + return ListView->SelectionCommand(); +} + + +/*********************************************************************** + * Method: BListView::InvocationMessage + * Params: + * Returns: BMessage * + * Effects: + ***********************************************************************/ +BMessage * +BListView_InvocationMessage(BListView *ListView) +{ + return ListView->InvocationMessage(); +} + + +/*********************************************************************** + * Method: BListView::InvocationCommand + * Params: + * Returns: uint32 + * Effects: + ***********************************************************************/ +uint32 +BListView_InvocationCommand(BListView *ListView) +{ + return ListView->InvocationCommand(); +} + + +/*********************************************************************** + * Method: BListView::SetListType + * Params: list_view_type type + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_SetListType(BListView *ListView, list_view_type type) +{ + ListView->SetListType(type); +} + + +/*********************************************************************** + * Method: BListView::ListType + * Params: + * Returns: list_view_type + * Effects: + ***********************************************************************/ +list_view_type +BListView_ListType(BListView *ListView) +{ + return ListView->ListType(); +} + + +/*********************************************************************** + * Method: BListView::ItemAt + * Params: int32 index + * Returns: BListItem * + * Effects: + ***********************************************************************/ +BListItem * +BListView_ItemAt(BListView *ListView, int32 index) +{ + return ListView->ItemAt(index); +} + + +/*********************************************************************** + * Method: BListView::IndexOf + * Params: BPoint point + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BListView_IndexOf(BListView *ListView, BPoint point) +{ + return ListView->IndexOf(point); +} + + +/*********************************************************************** + * Method: BListView::IndexOf + * Params: BListItem *item + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BListView_IndexOf_1 +(BListView *ListView, BListItem *item) +{ + return ListView->IndexOf(item); +} + + +/*********************************************************************** + * Method: BListView::FirstItem + * Params: + * Returns: BListItem * + * Effects: + ***********************************************************************/ +BListItem * +BListView_FirstItem(BListView *ListView) +{ + return ListView->FirstItem(); +} + + +/*********************************************************************** + * Method: BListView::LastItem + * Params: + * Returns: BListItem * + * Effects: + ***********************************************************************/ +BListItem * +BListView_LastItem(BListView *ListView) +{ + return ListView->LastItem(); +} + + +/*********************************************************************** + * Method: BListView::HasItem + * Params: BListItem *item + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_HasItem(BListView *ListView, BListItem *item) +{ + return ListView->HasItem(item); +} + + +/*********************************************************************** + * Method: BListView::CountItems + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BListView_CountItems(BListView *ListView) +{ + return ListView->CountItems(); +} + + +/*********************************************************************** + * Method: BListView::MakeEmpty + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_MakeEmpty(BListView *ListView) +{ + ListView->MakeEmpty(); +} + + +/*********************************************************************** + * Method: BListView::IsEmpty + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_IsEmpty(BListView *ListView) +{ + return ListView->IsEmpty(); +} + + +/*********************************************************************** + * Method: BListView::Items + * Params: + * Returns: const BListItem ** + * Effects: + ***********************************************************************/ +const BListItem ** +BListView_Items(BListView *ListView) +{ + return ListView->Items(); +} + + +/*********************************************************************** + * Method: BListView::InvalidateItem + * Params: int32 index + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_InvalidateItem(BListView *ListView, int32 index) +{ + ListView->InvalidateItem(index); +} + + +/*********************************************************************** + * Method: BListView::ScrollToSelection + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_ScrollToSelection(BListView *ListView) +{ + ListView->ScrollToSelection(); +} + + +/*********************************************************************** + * Method: BListView::Select + * Params: int32 index, bool extend + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_Select(BListView *ListView, int32 index, bool extend) +{ + ListView->Select(index, extend); +} + + +/*********************************************************************** + * Method: BListView::Select + * Params: int32 from, int32 to, bool extend + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_Select_1 +(BListView *ListView, int32 from, int32 to, bool extend) +{ + ListView->Select(from, to, extend); +} + + +/*********************************************************************** + * Method: BListView::IsItemSelected + * Params: int32 index + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_IsItemSelected(BListView *ListView, int32 index) +{ + return ListView->IsItemSelected(index); +} + + +/*********************************************************************** + * Method: BListView::CurrentSelection + * Params: int32 index + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BListView_CurrentSelection(BListView *ListView, int32 index) +{ + return ListView->CurrentSelection(index); +} + + +/*********************************************************************** + * Method: BListView::Invoke + * Params: BMessage *msg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BListView_Invoke(BListView *ListView, BMessage *msg) +{ + return ListView->Invoke(msg); +} + + +/*********************************************************************** + * Method: BListView::DeselectAll + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_DeselectAll(BListView *ListView) +{ + ListView->DeselectAll(); +} + + +/*********************************************************************** + * Method: BListView::DeselectExcept + * Params: int32 except_from, int32 except_to + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_DeselectExcept(BListView *ListView, int32 except_from, int32 except_to) +{ + ListView->DeselectExcept(except_from, except_to); +} + + +/*********************************************************************** + * Method: BListView::Deselect + * Params: int32 index + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_Deselect(BListView *ListView, int32 index) +{ + ListView->Deselect(index); +} + + +/*********************************************************************** + * Method: BListView::SelectionChanged + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_SelectionChanged(BListView *ListView) +{ + ListView->SelectionChanged(); +} + + +/*********************************************************************** + * Method: BListView::SwapItems + * Params: int32 a, int32 b + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_SwapItems(BListView *ListView, int32 a, int32 b) +{ + return ListView->SwapItems(a, b); +} + + +/*********************************************************************** + * Method: BListView::MoveItem + * Params: int32 from, int32 to + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_MoveItem(BListView *ListView, int32 from, int32 to) +{ + return ListView->MoveItem(from, to); +} + + +/*********************************************************************** + * Method: BListView::ReplaceItem + * Params: int32 index, BListItem *item + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_ReplaceItem(BListView *ListView, int32 index, BListItem *item) +{ + return ListView->ReplaceItem(index, item); +} + + +/*********************************************************************** + * Method: BListView::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_AttachedToWindow(BListView *ListView) +{ + ListView->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BListView::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_FrameMoved(BListView *ListView, BPoint new_position) +{ + ListView->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BListView::ItemFrame + * Params: int32 index + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BListView_ItemFrame(BListView *ListView, int32 index) +{ + return ListView->ItemFrame(index); +} + + +/*********************************************************************** + * Method: BListView::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BListView_ResolveSpecifier(BListView *ListView, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return ListView->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BListView::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BListView_GetSupportedSuites(BListView *ListView, BMessage *data) +{ + return ListView->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BListView::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BListView_Perform(BListView *ListView, perform_code d, void *arg) +{ + return ListView->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BListView::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_WindowActivated(BListView *ListView, bool state) +{ + ListView->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BListView::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_MouseUp(BListView *ListView, BPoint pt) +{ + ListView->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BListView::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_MouseMoved(BListView *ListView, BPoint pt, uint32 code, const BMessage *msg) +{ + ListView->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BListView::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_DetachedFromWindow(BListView *ListView) +{ + ListView->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BListView::InitiateDrag + * Params: BPoint pt, int32 itemIndex, bool initialySelected + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BListView_InitiateDrag(BListView *ListView, BPoint pt, int32 itemIndex, bool initialySelected) +{ + return ListView->InitiateDrag(pt, itemIndex, initialySelected); +} + + +/*********************************************************************** + * Method: BListView::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_ResizeToPreferred(BListView *ListView) +{ + ListView->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BListView::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_GetPreferredSize(BListView *ListView, float *width, float *height) +{ + ListView->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BListView::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_AllAttached(BListView *ListView) +{ + ListView->AllAttached(); +} + + +/*********************************************************************** + * Method: BListView::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BListView_AllDetached(BListView *ListView) +{ + ListView->AllDetached(); +} + +#if defined(__cplusplus) +} +#endif + +#endif /* _LISTVIEW_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/interface/Menu.cpp b/bepascal/source/bepascal/cpp/src/be/interface/Menu.cpp new file mode 100644 index 0000000..449aa52 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/Menu.cpp @@ -0,0 +1,925 @@ +#ifndef _MENU_CPP_ +#define _MENU_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Menu.cpp + * DATE: Sat Jan 11 16:55:14 2003 + * DESCR: + ***********************************************************************/ + +#include "Menu.h" +#include "menu.h" +#include "Messenger.h" +#include "view.h" +#include + +#include "MenuItem.h" + + +BPMenu::BPMenu(TPasObject PasObject, const char *name, menu_layout layout = B_ITEMS_IN_COLUMN) + :BMenu(name, layout), + BPView(PasObject, BRect(0, 0, 0, 0), "", 0, 0), + BPHandler(PasObject), + BPasObject(PasObject) +{ +} + +BPMenu::BPMenu(TPasObject PasObject, const char *name, float width, float height) + :BMenu(name, width, height), + BPView(PasObject, BRect(0, 0, 0, 0), "", 0, 0), + BPHandler(PasObject), + BPasObject(PasObject) +{ +} + +BPMenu::BPMenu(TPasObject PasObject, BMessage *archive) + :BMenu(archive), + BPView(PasObject, BRect(0, 0, 0, 0), "", 0, 0), + BPHandler(PasObject), + BPasObject(PasObject) +{ +} + +BPMenu::BPMenu(TPasObject PasObject, BRect frame, const char *name, uint32 resizingMode, uint32 flags, menu_layout layout, bool resizeToFit) + :BMenu(frame, name, resizingMode, flags, layout, resizeToFit), + BPView(PasObject, BRect(0, 0, 0, 0), "", 0, 0), + BPHandler(PasObject), + BPasObject(PasObject) +{ +} + +void BPMenu::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BMenu::MessageReceived(message); +} + +void BPMenu::AllAttached(void) +{ +// AllAttached_hookCall(message); +} + +void BPMenu::AttachedToWindow(void) +{ + BMenu::AttachedToWindow(); +// AttachedToWindow_hookCall(); +} + +void BPMenu::AllDetached(void) +{ +// View_AllDetached_hook(GetPasObject()); +} + +void BPMenu::DetachedFromWindow(void) +{ +// View_DetachedFromWindow_hook(GetPasObject()); +} + +void BPMenu::Draw(BRect updateRect) +{ + BMenu::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPMenu::DrawAfterChildren(BRect updateRect) +{ +// View_DrawAfterChildren_hook(GetPasObject(), &updateRect); +} + +void BPMenu::FrameMoved(BPoint parentPoint) +{ +// View_FrameMoved_hook(GetPasObject(), &parentPoint); +} + +void BPMenu::FrameResized(float width, float height) +{ +// View_FrameResized_hook(GetPasObject(), width, height); +} + +void BPMenu::GetPreferredSize(float *width, float *height) +{ +// View_GetPreferredSize_hook(GetPasObject(), width, height); +} + +void BPMenu::ResizeToPreferred(void) +{ +// View_ResizeToPreferred_hook(GetPasObject()); +} + +void BPMenu::KeyDown(const char *bytes, int32 numBytes) +{ +// View_KeyDown_hook(GetPasObject(), bytes, numBytes); +} + +void BPMenu::KeyUp(const char *bytes, int32 numBytes) +{ +// View_KeyUp_hook(GetPasObject(), bytes, numBytes); +} + +void BPMenu::MouseDown(BPoint point) +{ +// View_MouseDown_hook(GetPasObject(), &point); +} + +void BPMenu::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ +// View_MouseMoved_hook(GetPasObject(), &point, transit, &message); +} + +void BPMenu::MouseUp(BPoint point) +{ +// View_MouseUp_hook(GetPasObject(), &point); +} + +void BPMenu::Pulse(void) +{ +// View_Pulse_hook(GetPasObject()); +} + +//void BPMenu::TargetedByScrollView(BScrollView *scroller) +//{ +// View_TargetedByScrollView(GetPasObject(), scroller); +//} + +void BPMenu::WindowActivated(bool active) +{ +// View_WindowActivated_hook(GetPasObject(), active); +} + +void BPMenu::SetEnabled(bool enabled) +{ +} + +void BPMenu::SetValue(int32 value) +{ +} + +void BPMenu::MakeDefault(bool) +{ + +} + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * Method: BMenu::BMenu + * Params: const char *title, menu_layout layout + * Effects: + ***********************************************************************/ +TCPlusObject BMenu_Create(TPasObject PasObject, const char *title, menu_layout layout) +{ + return new BPMenu(PasObject, title, layout); +} + + +/*********************************************************************** + * Method: BMenu::BMenu + * Params: const char *title, float width, float height + * Effects: + ***********************************************************************/ +TCPlusObject BMenu_Create_1 +(TPasObject PasObject, const char *title, float width, float height) +{ + return new BPMenu(PasObject, title, width, height); +} + + +/*********************************************************************** + * Method: BMenu::~BMenu + * Params: + * Effects: + ***********************************************************************/ +void BMenu_Free(BMenu *Menu) +{ + delete Menu; +} + + +/*********************************************************************** + * Method: BMenu::BMenu + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BMenu_Create_2(TPasObject PasObject, BMessage *data) +{ + return new BPMenu(PasObject, data); +} + + +/*********************************************************************** + * Method: BMenu::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BMenu_Instantiate(BMenu *Menu, BMessage *data) +{ + return Menu->Instantiate(data); +} + + +/*********************************************************************** + * Method: BMenu::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMenu_Archive(BMenu *Menu, BMessage *data, bool deep) +{ + return Menu->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BMenu::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_AttachedToWindow(BMenu *Menu) +{ + Menu->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BMenu::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_DetachedFromWindow(BMenu *Menu) +{ + Menu->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BMenu::AddItem + * Params: BMenuItem *item + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_AddItem(BMenu *Menu, BMenuItem *item) +{ + return Menu->AddItem(item); +} + + +/*********************************************************************** + * Method: BMenu::AddItem + * Params: BMenuItem *item, int32 index + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_AddItem_1 +(BMenu *Menu, BMenuItem *item, int32 index) +{ + return Menu->AddItem(item, index); +} + + +/*********************************************************************** + * Method: BMenu::AddItem + * Params: BMenuItem *item, BRect frame + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_AddItem_2 +(BMenu *Menu, BMenuItem *item, BRect frame) +{ + return Menu->AddItem(item, frame); +} + + +/*********************************************************************** + * Method: BMenu::AddItem + * Params: BMenu *menu + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_AddItem_3 +(BMenu *Menu, BMenu *menu) +{ + return Menu->AddItem(menu); +} + + +/*********************************************************************** + * Method: BMenu::AddItem + * Params: BMenu *menu, int32 index + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_AddItem_4 +(BMenu *Menu, BMenu *menu, int32 index) +{ + return Menu->AddItem(menu, index); +} + + +/*********************************************************************** + * Method: BMenu::AddItem + * Params: BMenu *menu, BRect frame + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_AddItem_5 +(BMenu *Menu, BMenu *menu, BRect frame) +{ + return Menu->AddItem(menu, frame); +} + + +/*********************************************************************** + * Method: BMenu::AddList + * Params: BList *list, int32 index + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_AddList(BMenu *Menu, BList *list, int32 index) +{ + return Menu->AddList(list, index); +} + + +/*********************************************************************** + * Method: BMenu::AddSeparatorItem + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_AddSeparatorItem(BMenu *Menu) +{ + return Menu->AddSeparatorItem(); +} + + +/*********************************************************************** + * Method: BMenu::RemoveItem + * Params: BMenuItem *item + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_RemoveItem(BMenu *Menu, BMenuItem *item) +{ + return Menu->RemoveItem(item); +} + + +/*********************************************************************** + * Method: BMenu::RemoveItem + * Params: int32 index + * Returns: BMenuItem * + * Effects: + ***********************************************************************/ +BMenuItem * +BMenu_RemoveItem_1 +(BMenu *Menu, int32 index) +{ + return Menu->RemoveItem(index); +} + + +/*********************************************************************** + * Method: BMenu::RemoveItems + * Params: int32 index, int32 count, bool del + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_RemoveItems_2 +(BMenu *Menu, int32 index, int32 count, bool del) +{ + return Menu->RemoveItems(index, count, del); +} + + +/*********************************************************************** + * Method: BMenu::RemoveItem + * Params: BMenu *menu + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_RemoveItem_2(BMenu *Menu, BMenu *menu) +{ + return Menu->RemoveItem(menu); +} + + +/*********************************************************************** + * Method: BMenu::ItemAt + * Params: int32 index + * Returns: BMenuItem * + * Effects: + ***********************************************************************/ +BMenuItem * +BMenu_ItemAt(BMenu *Menu, int32 index) +{ + return Menu->ItemAt(index); +} + + +/*********************************************************************** + * Method: BMenu::SubmenuAt + * Params: int32 index + * Returns: BMenu * + * Effects: + ***********************************************************************/ +BMenu * +BMenu_SubmenuAt(BMenu *Menu, int32 index) +{ + return Menu->SubmenuAt(index); +} + + +/*********************************************************************** + * Method: BMenu::CountItems + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BMenu_CountItems(BMenu *Menu) +{ + return Menu->CountItems(); +} + + +/*********************************************************************** + * Method: BMenu::IndexOf + * Params: BMenuItem *item + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BMenu_IndexOf(BMenu *Menu, BMenuItem *item) +{ + return Menu->IndexOf(item); +} + + +/*********************************************************************** + * Method: BMenu::IndexOf + * Params: BMenu *menu + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BMenu_IndexOf_1 +(BMenu *Menu, BMenu *menu) +{ + return Menu->IndexOf(menu); +} + + +/*********************************************************************** + * Method: BMenu::FindItem + * Params: uint32 command + * Returns: BMenuItem * + * Effects: + ***********************************************************************/ +BMenuItem * +BMenu_FindItem(BMenu *Menu, uint32 command) +{ + return Menu->FindItem(command); +} + + +/*********************************************************************** + * Method: BMenu::FindItem + * Params: const char *name + * Returns: BMenuItem * + * Effects: + ***********************************************************************/ +BMenuItem * +BMenu_FindItem_1 +(BMenu *Menu, const char *name) +{ + return Menu->FindItem(name); +} + + +/*********************************************************************** + * Method: BMenu::SetTargetForItems + * Params: BHandler *target + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMenu_SetTargetForItems(BMenu *Menu, BHandler *target) +{ + return Menu->SetTargetForItems(target); +} + + +/*********************************************************************** + * Method: BMenu::SetTargetForItems + * Params: BMessenger messenger + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMenu_SetTargetForItems_1 +(BMenu *Menu, BMessenger messenger) +{ + return Menu->SetTargetForItems(messenger); +} + + +/*********************************************************************** + * Method: BMenu::SetEnabled + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_SetEnabled(BMenu *Menu, bool state) +{ + Menu->SetEnabled(state); +} + + +/*********************************************************************** + * Method: BMenu::SetRadioMode + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_SetRadioMode(BMenu *Menu, bool state) +{ + Menu->SetRadioMode(state); +} + + +/*********************************************************************** + * Method: BMenu::SetTriggersEnabled + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_SetTriggersEnabled(BMenu *Menu, bool state) +{ + Menu->SetTriggersEnabled(state); +} + + +/*********************************************************************** + * Method: BMenu::SetMaxContentWidth + * Params: float max + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_SetMaxContentWidth(BMenu *Menu, float max) +{ + Menu->SetMaxContentWidth(max); +} + + +/*********************************************************************** + * Method: BMenu::SetLabelFromMarked + * Params: bool on + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_SetLabelFromMarked(BMenu *Menu, bool on) +{ + Menu->SetLabelFromMarked(on); +} + + +/*********************************************************************** + * Method: BMenu::IsLabelFromMarked + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_IsLabelFromMarked(BMenu *Menu) +{ + return Menu->IsLabelFromMarked(); +} + + +/*********************************************************************** + * Method: BMenu::IsEnabled + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_IsEnabled(BMenu *Menu) +{ + return Menu->IsEnabled(); +} + + +/*********************************************************************** + * Method: BMenu::IsRadioMode + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_IsRadioMode(BMenu *Menu) +{ + return Menu->IsRadioMode(); +} + + +/*********************************************************************** + * Method: BMenu::AreTriggersEnabled + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_AreTriggersEnabled(BMenu *Menu) +{ + return Menu->AreTriggersEnabled(); +} + + +/*********************************************************************** + * Method: BMenu::IsRedrawAfterSticky + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenu_IsRedrawAfterSticky(BMenu *Menu) +{ + return Menu->IsRedrawAfterSticky(); +} + + +/*********************************************************************** + * Method: BMenu::MaxContentWidth + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BMenu_MaxContentWidth(BMenu *Menu) +{ + return Menu->MaxContentWidth(); +} + + +/*********************************************************************** + * Method: BMenu::FindMarked + * Params: + * Returns: BMenuItem * + * Effects: + ***********************************************************************/ +BMenuItem * +BMenu_FindMarked(BMenu *Menu) +{ + return Menu->FindMarked(); +} + + +/*********************************************************************** + * Method: BMenu::Supermenu + * Params: + * Returns: BMenu * + * Effects: + ***********************************************************************/ +BMenu * +BMenu_Supermenu(BMenu *Menu) +{ + return Menu->Supermenu(); +} + + +/*********************************************************************** + * Method: BMenu::Superitem + * Params: + * Returns: BMenuItem * + * Effects: + ***********************************************************************/ +BMenuItem * +BMenu_Superitem(BMenu *Menu) +{ + return Menu->Superitem(); +} + + +/*********************************************************************** + * Method: BMenu::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_MessageReceived(BMenu *Menu, BMessage *msg) +{ + Menu->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BMenu::KeyDown + * Params: const char *bytes, int32 numBytes + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_KeyDown(BMenu *Menu, const char *bytes, int32 numBytes) +{ + Menu->KeyDown(bytes, numBytes); +} + + +/*********************************************************************** + * Method: BMenu::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_Draw(BMenu *Menu, BRect updateRect) +{ + Menu->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BMenu::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_GetPreferredSize(BMenu *Menu, float *width, float *height) +{ + Menu->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BMenu::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_ResizeToPreferred(BMenu *Menu) +{ + Menu->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BMenu::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_FrameMoved(BMenu *Menu, BPoint new_position) +{ + Menu->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BMenu::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_FrameResized(BMenu *Menu, float new_width, float new_height) +{ + Menu->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BMenu::InvalidateLayout + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_InvalidateLayout(BMenu *Menu) +{ + Menu->InvalidateLayout(); +} + + +/*********************************************************************** + * Method: BMenu::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BMenu_ResolveSpecifier(BMenu *Menu, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return Menu->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BMenu::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMenu_GetSupportedSuites(BMenu *Menu, BMessage *data) +{ + return Menu->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BMenu::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMenu_Perform(BMenu *Menu, perform_code d, void *arg) +{ + return Menu->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BMenu::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_MakeFocus(BMenu *Menu, bool state) +{ + Menu->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BMenu::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_AllAttached(BMenu *Menu) +{ + Menu->AllAttached(); +} + + +/*********************************************************************** + * Method: BMenu::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenu_AllDetached(BMenu *Menu) +{ + Menu->AllDetached(); +} + + +/*********************************************************************** + * Method: BMenu::BMenu + * Params: BRect frame, const char *viewName, uint32 resizeMask, uint32 flags, menu_layout layout, bool resizeToFit + * Effects: + ***********************************************************************/ +TCPlusObject BMenu_Create_3(TPasObject PasObject, BRect frame, const char *viewName, uint32 resizeMask, uint32 flags, menu_layout layout, bool resizeToFit) +{ + return new BPMenu(PasObject, frame, viewName, resizeMask, flags, layout, resizeToFit); +} + +#if defined(__cplusplus) +} +#endif + +#endif /* _MENU_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/interface/MenuBar.cpp b/bepascal/source/bepascal/cpp/src/be/interface/MenuBar.cpp new file mode 100644 index 0000000..de1f41f --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/MenuBar.cpp @@ -0,0 +1,642 @@ +#ifndef _MENUBAR_CPP_ +#define _MENUBAR_CPP_ + +#include "MenuBar.h" +#include "menubar.h" +#include + +BPMenuBar::BPMenuBar(TPasObject PasObject, BRect frame, const char *name, + uint32 resizingMode = B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, + menu_layout layout = B_ITEMS_IN_COLUMN, bool resizeToFit = true) + :BMenuBar(frame, name, resizingMode, layout, resizeToFit), + BPMenu(PasObject, name, layout), + BPView(PasObject, BRect(0, 0, 0, 0), "", 0, 0), + BPHandler(PasObject), + BPasObject(PasObject) +{ +} + +BPMenuBar::BPMenuBar(TPasObject PasObject, BMessage *archive) + :BMenuBar(archive), + BPMenu(PasObject, archive), + BPView(PasObject, BRect(0, 0, 0, 0), "", 0, 0), + BPHandler(PasObject), + BPasObject(PasObject) +{ +} + +void BPMenuBar::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BMenuBar::MessageReceived(message); +} + +void BPMenuBar::AllAttached(void) +{ + BMenuBar::AllAttached(); +// AllAttached_hookCall(message); +} + +void BPMenuBar::AttachedToWindow(void) +{ + BMenuBar::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + +void BPMenuBar::AllDetached(void) +{ + BMenuBar::AllDetached(); +// View_AllDetached_hook(GetPasObject()); +} + +void BPMenuBar::DetachedFromWindow(void) +{ + BMenuBar::DetachedFromWindow(); +// View_DetachedFromWindow_hook(GetPasObject()); +} + +void BPMenuBar::Draw(BRect updateRect) +{ + BMenuBar::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPMenuBar::DrawAfterChildren(BRect updateRect) +{ + BMenuBar::DrawAfterChildren(updateRect); +// View_DrawAfterChildren_hook(GetPasObject(), &updateRect); +} + +void BPMenuBar::FrameMoved(BPoint parentPoint) +{ + BMenuBar::FrameMoved(parentPoint); +// View_FrameMoved_hook(GetPasObject(), &parentPoint); +} + +void BPMenuBar::FrameResized(float width, float height) +{ + BMenuBar::FrameResized(width, height); +// View_FrameResized_hook(GetPasObject(), width, height); +} + +void BPMenuBar::GetPreferredSize(float *width, float *height) +{ + BMenuBar::GetPreferredSize(width, height); +// View_GetPreferredSize_hook(GetPasObject(), width, height); +} + +void BPMenuBar::ResizeToPreferred(void) +{ + BMenuBar::ResizeToPreferred(); +// View_ResizeToPreferred_hook(GetPasObject()); +} + +void BPMenuBar::KeyDown(const char *bytes, int32 numBytes) +{ + BMenuBar::KeyDown(bytes, numBytes); +// View_KeyDown_hook(GetPasObject(), bytes, numBytes); +} + +void BPMenuBar::KeyUp(const char *bytes, int32 numBytes) +{ + BMenuBar::KeyUp(bytes, numBytes); +// View_KeyUp_hook(GetPasObject(), bytes, numBytes); +} + +void BPMenuBar::MouseDown(BPoint point) +{ + BMenuBar::MouseDown(point); +// View_MouseDown_hook(GetPasObject(), &point); +} + +void BPMenuBar::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BMenuBar::MouseMoved(point, transit, message); +// View_MouseMoved_hook(GetPasObject(), &point, transit, &message); +} + +void BPMenuBar::MouseUp(BPoint point) +{ + BMenuBar::MouseUp(point); +// View_MouseUp_hook(GetPasObject(), &point); +} + +void BPMenuBar::Pulse(void) +{ + BMenuBar::Pulse(); +// View_Pulse_hook(GetPasObject()); +} + +//void BPMenu::TargetedByScrollView(BScrollView *scroller) +//{ +// View_TargetedByScrollView(GetPasObject(), scroller); +//} + +void BPMenuBar::WindowActivated(bool active) +{ + BMenuBar::WindowActivated(active); +// View_WindowActivated_hook(GetPasObject(), active); +} + +void BPMenuBar::SetEnabled(bool enabled) +{ + BMenuBar::SetEnabled(enabled); +} + +void BPMenuBar::SetValue(int32 value) +{ + +} + +void BPMenuBar::MakeDefault(bool flag) +{ + +} + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * AUTHOR: nobody + * FILE: MenuBar.cpp + * DATE: Sun Jan 12 01:25:37 2003 + * DESCR: + ***********************************************************************/ + +TCPlusObject BMenuBar_Create(TPasObject PasObject, BRect frame, const char *name, + uint32 resizingMode = B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, + menu_layout layout = B_ITEMS_IN_COLUMN, bool resizeToFit = true) +{ + return new BPMenuBar(PasObject, frame, name, resizingMode, layout, resizeToFit); +} + +/*********************************************************************** + * Method: BMenuBar::BMenuBar + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BMenuBar_Create_2(TPasObject PasObject, BMessage *data) +{ + return new BPMenuBar(PasObject, data); +} + + +/*********************************************************************** + * Method: BMenuBar::~BMenuBar + * Params: + * Effects: + ***********************************************************************/ +void BMenuBar_Free(BMenuBar *MenuBar) +{ + delete MenuBar; +} + + +/*********************************************************************** + * Method: BMenuBar::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BMenuBar_Instantiate(BMenuBar *MenuBar, BMessage *data) +{ + return MenuBar->Instantiate(data); +} + + +/*********************************************************************** + * Method: BMenuBar::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMenuBar_Archive(BMenuBar *MenuBar, BMessage *data, bool deep) +{ + return MenuBar->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BMenuBar::SetBorder + * Params: menu_bar_border border + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_SetBorder(BMenuBar *MenuBar, menu_bar_border border) +{ + MenuBar->SetBorder(border); +} + + +/*********************************************************************** + * Method: BMenuBar::Border + * Params: + * Returns: menu_bar_border + * Effects: + ***********************************************************************/ +menu_bar_border +BMenuBar_Border(BMenuBar *MenuBar) +{ + return MenuBar->Border(); +} + + +/*********************************************************************** + * Method: BMenuBar::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_Draw(BMenuBar *MenuBar, BRect updateRect) +{ + MenuBar->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BMenuBar::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_AttachedToWindow(BMenuBar *MenuBar) +{ + MenuBar->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BMenuBar::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_DetachedFromWindow(BMenuBar *MenuBar) +{ + MenuBar->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BMenuBar::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_MessageReceived(BMenuBar *MenuBar, BMessage *msg) +{ + MenuBar->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BMenuBar::MouseDown + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_MouseDown(BMenuBar *MenuBar, BPoint where) +{ + MenuBar->MouseDown(where); +} + + +/*********************************************************************** + * Method: BMenuBar::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_WindowActivated(BMenuBar *MenuBar, bool state) +{ + MenuBar->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BMenuBar::MouseUp + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_MouseUp(BMenuBar *MenuBar, BPoint where) +{ + MenuBar->MouseUp(where); +} + + +/*********************************************************************** + * Method: BMenuBar::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_FrameMoved(BMenuBar *MenuBar, BPoint new_position) +{ + MenuBar->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BMenuBar::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_FrameResized(BMenuBar *MenuBar, float new_width, float new_height) +{ + MenuBar->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BMenuBar::Show + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_Show(BMenuBar *MenuBar) +{ + MenuBar->Show(); +} + + +/*********************************************************************** + * Method: BMenuBar::Hide + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_Hide(BMenuBar *MenuBar) +{ + MenuBar->Hide(); +} + + +/*********************************************************************** + * Method: BMenuBar::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BMenuBar_ResolveSpecifier(BMenuBar *MenuBar, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return MenuBar->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BMenuBar::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMenuBar_GetSupportedSuites(BMenuBar *MenuBar, BMessage *data) +{ + return MenuBar->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BMenuBar::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_ResizeToPreferred(BMenuBar *MenuBar) +{ + MenuBar->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BMenuBar::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_GetPreferredSize(BMenuBar *MenuBar, float *width, float *height) +{ + MenuBar->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BMenuBar::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_MakeFocus(BMenuBar *MenuBar, bool state) +{ + MenuBar->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BMenuBar::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_AllAttached(BMenuBar *MenuBar) +{ + MenuBar->AllAttached(); +} + + +/*********************************************************************** + * Method: BMenuBar::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuBar_AllDetached(BMenuBar *MenuBar) +{ + MenuBar->AllDetached(); +} + + +/*********************************************************************** + * Method: BMenuBar::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMenuBar_Perform(BMenuBar *MenuBar, perform_code d, void *arg) +{ + return MenuBar->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BMenuBar::_ReservedMenuBar1 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BMenuBar__ReservedMenuBar1(BMenuBar *MenuBar) +{ + MenuBar->_ReservedMenuBar1(); +} +*/ + +/*********************************************************************** + * Method: BMenuBar::_ReservedMenuBar2 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BMenuBar__ReservedMenuBar2(BMenuBar *MenuBar) +{ + MenuBar->_ReservedMenuBar2(); +} +*/ + +/*********************************************************************** + * Method: BMenuBar::_ReservedMenuBar3 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BMenuBar__ReservedMenuBar3(BMenuBar *MenuBar) +{ + MenuBar->_ReservedMenuBar3(); +} +*/ + +/*********************************************************************** + * Method: BMenuBar::_ReservedMenuBar4 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BMenuBar__ReservedMenuBar4(BMenuBar *MenuBar) +{ + MenuBar->_ReservedMenuBar4(); +} +*/ + +/*********************************************************************** + * Method: BMenuBar::operator= + * Params: const BMenuBar & + * Returns: BMenuBar & + * Effects: + ***********************************************************************/ +/*BMenuBar & +BMenuBar_operator=(BMenuBar *MenuBar, const BMenuBar &) +{ + return MenuBar->operator=(); +} +*/ + +/*********************************************************************** + * Method: BMenuBar::StartMenuBar + * Params: int32 menuIndex, bool sticky, bool show_menu, BRect *special_rect + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BMenuBar_StartMenuBar(BMenuBar *MenuBar, int32 menuIndex, bool sticky, bool show_menu, BRect *special_rect) +{ + MenuBar->StartMenuBar(menuIndex, sticky, show_menu, special_rect); +} +*/ + +/*********************************************************************** + * Method: BMenuBar::TrackTask + * Params: void *arg + * Returns: long + * Effects: + ***********************************************************************/ +/*long +BMenuBar_TrackTask(BMenuBar *MenuBar, void *arg) +{ + return MenuBar->TrackTask(arg); +} +*/ + +/*********************************************************************** + * Method: BMenuBar::Track + * Params: int32 *action, int32 startIndex, bool showMenu + * Returns: BMenuItem * + * Effects: + ***********************************************************************/ +/*BMenuItem * +BMenuBar_Track(BMenuBar *MenuBar, int32 *action, int32 startIndex, bool showMenu) +{ + return MenuBar->Track(action, startIndex, showMenu); +} +*/ + +/*********************************************************************** + * Method: BMenuBar::StealFocus + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BMenuBar_StealFocus(BMenuBar *MenuBar) +{ + MenuBar->StealFocus(); +} +*/ + +/*********************************************************************** + * Method: BMenuBar::RestoreFocus + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BMenuBar_RestoreFocus(BMenuBar *MenuBar) +{ + MenuBar->RestoreFocus(); +} +*/ + +/*********************************************************************** + * Method: BMenuBar::InitData + * Params: menu_layout layout + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BMenuBar_InitData(BMenuBar *MenuBar, menu_layout layout) +{ + MenuBar->InitData(layout); +} +*/ + +#if defined(__cplusplus) +} +#endif + +#endif /* _MENUBAR_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/interface/MenuItem.cpp b/bepascal/source/bepascal/cpp/src/be/interface/MenuItem.cpp new file mode 100644 index 0000000..351007f --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/MenuItem.cpp @@ -0,0 +1,433 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _MENUITEM_CPP_ +#define _MENUITEM_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: MenuItem.cpp + * DATE: Sat Jan 11 18:24:08 2003 + * DESCR: + ***********************************************************************/ +#include "MenuItem.h" +#include "menuitem.h" +#include + +BPMenuItem::BPMenuItem(TPasObject PasObject, const char *label, BMessage *message, char shortcut = 0, uint32 modifiers = 0) + :BMenuItem(label, message, shortcut, modifiers), + BPasObject(PasObject) +{ +} + +BPMenuItem::BPMenuItem(TPasObject PasObject, BMenu *submenu, BMessage *message = NULL) + :BMenuItem(submenu, message), + BPasObject(PasObject) +{ +} + +BPMenuItem::BPMenuItem(TPasObject PasObject, BMessage *data) + :BMenuItem(data), + BPasObject(PasObject) +{ +} + +void BPMenuItem::Draw(void) +{ + BMenuItem::Draw(); +} + +void BPMenuItem::DrawContent(void) +{ + BMenuItem::DrawContent(); +} + +void BPMenuItem::GetContentSize(float *width, float *height) +{ + BMenuItem::GetContentSize(width, height); +} + +void BPMenuItem::TruncateLabel(float max, char *new_label) +{ + BMenuItem::TruncateLabel(max, new_label); +} + +void BPMenuItem::Highlight(bool on) +{ + BMenuItem::Highlight(on); +} + +bool BPMenuItem::IsSelected() const +{ + return BMenuItem::IsSelected(); +} + +BPoint BPMenuItem::ContentLocation() const +{ + return BMenuItem::ContentLocation(); +} + +BPSeparatorItem::BPSeparatorItem(TPasObject PasObject) + :BSeparatorItem(), + BPMenuItem(PasObject, "", NULL), + BPasObject(PasObject) +{ +} + +BPSeparatorItem::BPSeparatorItem(TPasObject PasObject, BMessage *data) + :BSeparatorItem(data), + BPMenuItem(PasObject, data), + BPasObject(PasObject) +{ +} + +void BPSeparatorItem::Draw(void) +{ + BSeparatorItem::Draw(); +} + +void BPSeparatorItem::DrawContent(void) +{ + BSeparatorItem::DrawContent(); +} + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * Method: BMenuItem::BMenuItem + * Params: const char *label, BMessage *message, char shortcut, uint32 modifiers + * Effects: + ***********************************************************************/ +TCPlusObject BMenuItem_Create(TPasObject PasObject, const char *label, BMessage *message, char shortcut, uint32 modifiers) +{ + return new BPMenuItem(PasObject, label, message, shortcut, modifiers); +} + + +/*********************************************************************** + * Method: BMenuItem::BMenuItem + * Params: BMenu *menu, BMessage *message + * Effects: + ***********************************************************************/ +TCPlusObject BMenuItem_Create_1 +(TPasObject PasObject, BMenu *menu, BMessage *message) +{ + return new BPMenuItem(PasObject, menu, message); +} + + +/*********************************************************************** + * Method: BMenuItem::BMenuItem + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BMenuItem_Create_2 +(TPasObject PasObject, BMessage *data) +{ + return new BPMenuItem(PasObject, data); +} + + +/*********************************************************************** + * Method: BMenuItem::~BMenuItem + * Params: + * Effects: + ***********************************************************************/ +void BMenuItem_Free(BMenuItem *MenuItem) +{ + delete MenuItem; +} + + +/*********************************************************************** + * Method: BMenuItem::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BMenuItem_Instantiate(BMenuItem *MenuItem, BMessage *data) +{ + return MenuItem->Instantiate(data); +} + + +/*********************************************************************** + * Method: BMenuItem::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMenuItem_Archive(BMenuItem *MenuItem, BMessage *data, bool deep) +{ + return MenuItem->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BMenuItem::SetLabel + * Params: const char *name + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuItem_SetLabel(BMenuItem *MenuItem, const char *name) +{ + MenuItem->SetLabel(name); +} + + +/*********************************************************************** + * Method: BMenuItem::SetEnabled + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuItem_SetEnabled(BMenuItem *MenuItem, bool state) +{ + MenuItem->SetEnabled(state); +} + + +/*********************************************************************** + * Method: BMenuItem::SetMarked + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuItem_SetMarked(BMenuItem *MenuItem, bool state) +{ + MenuItem->SetMarked(state); +} + + +/*********************************************************************** + * Method: BMenuItem::SetTrigger + * Params: char ch + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuItem_SetTrigger(BMenuItem *MenuItem, char ch) +{ + MenuItem->SetTrigger(ch); +} + + +/*********************************************************************** + * Method: BMenuItem::SetShortcut + * Params: char ch, uint32 modifiers + * Returns: void + * Effects: + ***********************************************************************/ +void +BMenuItem_SetShortcut(BMenuItem *MenuItem, char ch, uint32 modifiers) +{ + MenuItem->SetShortcut(ch, modifiers); +} + + +/*********************************************************************** + * Method: BMenuItem::Label + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BMenuItem_Label(BMenuItem *MenuItem) +{ + return MenuItem->Label(); +} + + +/*********************************************************************** + * Method: BMenuItem::IsEnabled + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenuItem_IsEnabled(BMenuItem *MenuItem) +{ + return MenuItem->IsEnabled(); +} + + +/*********************************************************************** + * Method: BMenuItem::IsMarked + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BMenuItem_IsMarked(BMenuItem *MenuItem) +{ + return MenuItem->IsMarked(); +} + + +/*********************************************************************** + * Method: BMenuItem::Trigger + * Params: + * Returns: char + * Effects: + ***********************************************************************/ +char +BMenuItem_Trigger(BMenuItem *MenuItem) +{ + return MenuItem->Trigger(); +} + + +/*********************************************************************** + * Method: BMenuItem::Shortcut + * Params: uint32 *modifiers + * Returns: char + * Effects: + ***********************************************************************/ +char +BMenuItem_Shortcut(BMenuItem *MenuItem, uint32 *modifiers) +{ + return MenuItem->Shortcut(modifiers); +} + + +/*********************************************************************** + * Method: BMenuItem::Submenu + * Params: + * Returns: BMenu * + * Effects: + ***********************************************************************/ +BMenu * +BMenuItem_Submenu(BMenuItem *MenuItem) +{ + return MenuItem->Submenu(); +} + + +/*********************************************************************** + * Method: BMenuItem::Menu + * Params: + * Returns: BMenu * + * Effects: + ***********************************************************************/ +BMenu * +BMenuItem_Menu(BMenuItem *MenuItem) +{ + return MenuItem->Menu(); +} + + +/*********************************************************************** + * Method: BMenuItem::Frame + * Params: + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BMenuItem_Frame(BMenuItem *MenuItem) +{ + return MenuItem->Frame(); +} + + +/*********************************************************************** + * Method: BSeparatorItem::BSeparatorItem + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BSeparatorItem_Create(TPasObject PasObject) +{ + return new BPSeparatorItem(PasObject); +} + + +/*********************************************************************** + * Method: BSeparatorItem::BSeparatorItem + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BSeparatorItem_Create_1 +(TPasObject PasObject, BMessage *data) +{ + return new BPSeparatorItem(PasObject, data); +} + + +/*********************************************************************** + * Method: BSeparatorItem::~BSeparatorItem + * Params: + * Effects: + ***********************************************************************/ +void BSeparatorItem_Free(BSeparatorItem *SeparatorItem) +{ + delete SeparatorItem; +} + + +/*********************************************************************** + * Method: BSeparatorItem::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BSeparatorItem_Archive(BSeparatorItem *SeparatorItem, BMessage *data, bool deep) +{ + return SeparatorItem->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BSeparatorItem::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BSeparatorItem_Instantiate(BSeparatorItem *SeparatorItem, BMessage *data) +{ + return SeparatorItem->Instantiate(data); +} + + +/*********************************************************************** + * Method: BSeparatorItem::SetEnabled + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BSeparatorItem_SetEnabled(BSeparatorItem *SeparatorItem, bool state) +{ + SeparatorItem->SetEnabled(state); +} + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _MENUITEM_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/interface/OutlineListView.cpp b/bepascal/source/bepascal/cpp/src/be/interface/OutlineListView.cpp new file mode 100644 index 0000000..fb2e931 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/OutlineListView.cpp @@ -0,0 +1,755 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _OUTLINELISTVIEW_CPP_ +#define _OUTLINELISTVIEW_CPP_ + +#include "OutlineListView.h" +#include "view.h" +#include +#include "listview.h" + + + + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(__cplusplus) +} +#endif + +class BPOutlineListView : public BOutlineListView, virtual public BPListView +{ +public: + BPOutlineListView(TPasObject PasObject,BRect frame, + const char * name, + list_view_type type = B_SINGLE_SELECTION_LIST, + uint32 resizeMask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS + | B_NAVIGABLE); + BPOutlineListView(TPasObject PasObject,BMessage *data); + +static BArchivable *Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +virtual void MouseDown(BPoint where); +virtual void KeyDown(const char *bytes, int32 numBytes); +//virtual void FrameMoved(BPoint new_position); +virtual void FrameResized(float new_width, float new_height); +virtual void MouseUp(BPoint where); + + +//virtual void ResizeToPreferred(); +//virtual void GetPreferredSize(float *width, float *height); +//virtual void MakeFocus(bool state = true); +virtual void AllAttached(); +virtual void AllDetached(); +virtual void DetachedFromWindow(); + + + +//virtual bool DoMiscellaneous(MiscCode code, MiscData * data); +virtual void MessageReceived(BMessage *); +}; + + +BPOutlineListView::BPOutlineListView(TPasObject PasObject,BMessage *data) + :BOutlineListView(data), + BPListView(PasObject, data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} + +BPOutlineListView::BPOutlineListView(TPasObject PasObject,BRect frame, + const char * name, + list_view_type type = B_SINGLE_SELECTION_LIST, + uint32 resizeMask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS + | B_NAVIGABLE) + :BOutlineListView(frame,name,type,resizeMask,flags), + BPListView(PasObject, frame,name,type,resizeMask,flags), + BPView(PasObject, frame,name,resizeMask,flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ +} + + +void BPOutlineListView::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BOutlineListView::MessageReceived(message); +} + + + + +void BPOutlineListView::AllAttached(void) +{ + //AllAttached_hookCall(); + BOutlineListView::AllAttached(); +} + +void BPOutlineListView::AllDetached(void) +{ + //AllDetached_hookCall(); + BOutlineListView::AllDetached(); +} + + + +void BPOutlineListView::KeyDown(const char *bytes, int32 numBytes) +{ + BOutlineListView::KeyDown(bytes, numBytes); +} + + +void BPOutlineListView::FrameResized(float width, float height) +{ + FrameResized_hookCall(width, height); + BOutlineListView::FrameResized(width, height); +} + +void BPOutlineListView::DetachedFromWindow(void) +{ + BOutlineListView::DetachedFromWindow(); +} + + + +void BPOutlineListView::MouseDown(BPoint point) +{ + BOutlineListView::MouseDown(point); +} + + +void BPOutlineListView::MouseUp(BPoint point) +{ + BOutlineListView::MouseUp(point); +} + + + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * AUTHOR: nobody + * FILE: OutlineListView.cpp + * DATE: Tue Mar 4 20:12:11 2003 + * DESCR: + ***********************************************************************/ + +/*********************************************************************** + * Method: BOutlineListView::BOutlineListView + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BOutlineListView_Create(TPasObject PasObject,BRect frame, + const char * name, + list_view_type type = B_SINGLE_SELECTION_LIST, + uint32 resizeMask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS + | B_NAVIGABLE) +{ + return new BPOutlineListView(PasObject, frame,name,type,resizeMask,flags); +} + +TCPlusObject BOutlineListView_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPOutlineListView(PasObject, data); +} + + +/*********************************************************************** + * Method: BOutlineListView::~BOutlineListView + * Params: + * Effects: + ***********************************************************************/ +void BOutlineListView_Free(BOutlineListView *OutlineListView) +{ + delete OutlineListView; +} + + +/*********************************************************************** + * Method: BOutlineListView::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BOutlineListView_Instantiate(BOutlineListView *OutlineListView, BMessage *data) +{ + return OutlineListView->Instantiate(data); +} + + +/*********************************************************************** + * Method: BOutlineListView::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BOutlineListView_Archive(BOutlineListView *OutlineListView, BMessage *data, bool deep) +{ + return OutlineListView->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BOutlineListView::MouseDown + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_MouseDown(BOutlineListView *OutlineListView, BPoint where) +{ + OutlineListView->MouseDown(where); +} + + +/*********************************************************************** + * Method: BOutlineListView::KeyDown + * Params: const char *bytes, int32 numBytes + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_KeyDown(BOutlineListView *OutlineListView, const char *bytes, int32 numBytes) +{ + OutlineListView->KeyDown(bytes, numBytes); +} + + +/*********************************************************************** + * Method: BOutlineListView::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_FrameMoved(BOutlineListView *OutlineListView, BPoint new_position) +{ + OutlineListView->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BOutlineListView::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_FrameResized(BOutlineListView *OutlineListView, float new_width, float new_height) +{ + OutlineListView->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BOutlineListView::MouseUp + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_MouseUp(BOutlineListView *OutlineListView, BPoint where) +{ + OutlineListView->MouseUp(where); +} + + +/*********************************************************************** + * Method: BOutlineListView::AddUnder + * Params: BListItem *item, BListItem *underItem + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BOutlineListView_AddUnder(BOutlineListView *OutlineListView, BListItem *item, BListItem *underItem) +{ + return OutlineListView->AddUnder(item, underItem); +} + + +/*********************************************************************** + * Method: BOutlineListView::AddItem + * Params: BListItem *item + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BOutlineListView_AddItem(BOutlineListView *OutlineListView, BListItem *item) +{ + return OutlineListView->AddItem(item); +} + + +/*********************************************************************** + * Method: BOutlineListView::AddItem + * Params: BListItem *item, int32 fullListIndex + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BOutlineListView_AddItem_1 +(BOutlineListView *OutlineListView, BListItem *item, int32 fullListIndex) +{ + return OutlineListView->AddItem(item, fullListIndex); +} + + +/*********************************************************************** + * Method: BOutlineListView::AddList + * Params: BList *newItems + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BOutlineListView_AddList(BOutlineListView *OutlineListView, BList *newItems) +{ + return OutlineListView->AddList(newItems); +} + + +/*********************************************************************** + * Method: BOutlineListView::AddList + * Params: BList *newItems, int32 fullListIndex + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BOutlineListView_AddList_1 +(BOutlineListView *OutlineListView, BList *newItems, int32 fullListIndex) +{ + return OutlineListView->AddList(newItems, fullListIndex); +} + + +/*********************************************************************** + * Method: BOutlineListView::RemoveItem + * Params: BListItem *item + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BOutlineListView_RemoveItem(BOutlineListView *OutlineListView, BListItem *item) +{ + return OutlineListView->RemoveItem(item); +} + + +/*********************************************************************** + * Method: BOutlineListView::RemoveItem + * Params: int32 fullListIndex + * Returns: BListItem * + * Effects: + ***********************************************************************/ +BListItem * +BOutlineListView_RemoveItem_1 +(BOutlineListView *OutlineListView, int32 fullListIndex) +{ + return OutlineListView->RemoveItem(fullListIndex); +} + + +/*********************************************************************** + * Method: BOutlineListView::RemoveItems + * Params: int32 fullListIndex, int32 count + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BOutlineListView_RemoveItems +(BOutlineListView *OutlineListView, int32 fullListIndex, int32 count) +{ + return OutlineListView->RemoveItems(fullListIndex, count); +} + + +/*********************************************************************** + * Method: BOutlineListView::FullListItemAt + * Params: int32 fullListIndex + * Returns: BListItem * + * Effects: + ***********************************************************************/ +BListItem * +BOutlineListView_FullListItemAt(BOutlineListView *OutlineListView, int32 fullListIndex) +{ + return OutlineListView->FullListItemAt(fullListIndex); +} + + +/*********************************************************************** + * Method: BOutlineListView::FullListIndexOf + * Params: BPoint point + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BOutlineListView_FullListIndexOf(BOutlineListView *OutlineListView, BPoint point) +{ + return OutlineListView->FullListIndexOf(point); +} + + +/*********************************************************************** + * Method: BOutlineListView::FullListIndexOf + * Params: BListItem *item + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BOutlineListView_FullListIndexOf_1 +(BOutlineListView *OutlineListView, BListItem *item) +{ + return OutlineListView->FullListIndexOf(item); +} + + +/*********************************************************************** + * Method: BOutlineListView::FullListFirstItem + * Params: + * Returns: BListItem * + * Effects: + ***********************************************************************/ +BListItem * +BOutlineListView_FullListFirstItem(BOutlineListView *OutlineListView) +{ + return OutlineListView->FullListFirstItem(); +} + + +/*********************************************************************** + * Method: BOutlineListView::FullListLastItem + * Params: + * Returns: BListItem * + * Effects: + ***********************************************************************/ +BListItem * +BOutlineListView_FullListLastItem(BOutlineListView *OutlineListView) +{ + return OutlineListView->FullListLastItem(); +} + + +/*********************************************************************** + * Method: BOutlineListView::FullListHasItem + * Params: BListItem *item + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BOutlineListView_FullListHasItem(BOutlineListView *OutlineListView, BListItem *item) +{ + return OutlineListView->FullListHasItem(item); +} + + +/*********************************************************************** + * Method: BOutlineListView::FullListCountItems + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BOutlineListView_FullListCountItems(BOutlineListView *OutlineListView) +{ + return OutlineListView->FullListCountItems(); +} + + +/*********************************************************************** + * Method: BOutlineListView::FullListCurrentSelection + * Params: int32 index + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BOutlineListView_FullListCurrentSelection(BOutlineListView *OutlineListView, int32 index) +{ + return OutlineListView->FullListCurrentSelection(index); +} + + +/*********************************************************************** + * Method: BOutlineListView::MakeEmpty + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_MakeEmpty(BOutlineListView *OutlineListView) +{ + OutlineListView->MakeEmpty(); +} + + +/*********************************************************************** + * Method: BOutlineListView::FullListIsEmpty + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BOutlineListView_FullListIsEmpty(BOutlineListView *OutlineListView) +{ + return OutlineListView->FullListIsEmpty(); +} + + +/*********************************************************************** + * Method: BOutlineListView::Superitem + * Params: const BListItem *item + * Returns: BListItem * + * Effects: + ***********************************************************************/ +BListItem * +BOutlineListView_Superitem(BOutlineListView *OutlineListView, const BListItem *item) +{ + return OutlineListView->Superitem(item); +} + + +/*********************************************************************** + * Method: BOutlineListView::Expand + * Params: BListItem *item + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_Expand(BOutlineListView *OutlineListView, BListItem *item) +{ + OutlineListView->Expand(item); +} + + +/*********************************************************************** + * Method: BOutlineListView::Collapse + * Params: BListItem *item + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_Collapse(BOutlineListView *OutlineListView, BListItem *item) +{ + OutlineListView->Collapse(item); +} + + +/*********************************************************************** + * Method: BOutlineListView::IsExpanded + * Params: int32 fullListIndex + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BOutlineListView_IsExpanded(BOutlineListView *OutlineListView, int32 fullListIndex) +{ + return OutlineListView->IsExpanded(fullListIndex); +} + + +/*********************************************************************** + * Method: BOutlineListView::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BOutlineListView_ResolveSpecifier(BOutlineListView *OutlineListView, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return OutlineListView->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BOutlineListView::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BOutlineListView_GetSupportedSuites(BOutlineListView *OutlineListView, BMessage *data) +{ + return OutlineListView->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BOutlineListView::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BOutlineListView_Perform(BOutlineListView *OutlineListView, perform_code d, void *arg) +{ + return OutlineListView->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BOutlineListView::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_ResizeToPreferred(BOutlineListView *OutlineListView) +{ + OutlineListView->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BOutlineListView::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_GetPreferredSize(BOutlineListView *OutlineListView, float *width, float *height) +{ + OutlineListView->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BOutlineListView::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_MakeFocus(BOutlineListView *OutlineListView, bool state) +{ + OutlineListView->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BOutlineListView::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_AllAttached(BOutlineListView *OutlineListView) +{ + OutlineListView->AllAttached(); +} + + +/*********************************************************************** + * Method: BOutlineListView::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_AllDetached(BOutlineListView *OutlineListView) +{ + OutlineListView->AllDetached(); +} + + +/*********************************************************************** + * Method: BOutlineListView::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BOutlineListView_DetachedFromWindow(BOutlineListView *OutlineListView) +{ + OutlineListView->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BOutlineListView::CountItemsUnder + * Params: BListItem *under, bool oneLevelOnly + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BOutlineListView_CountItemsUnder(BOutlineListView *OutlineListView, BListItem *under, bool oneLevelOnly) +{ + return OutlineListView->CountItemsUnder(under, oneLevelOnly); +} + + +/*********************************************************************** + * Method: BOutlineListView::ItemUnderAt + * Params: BListItem *underItem, bool oneLevelOnly, int32 index + * Returns: BListItem * + * Effects: + ***********************************************************************/ +BListItem * +BOutlineListView_ItemUnderAt(BOutlineListView *OutlineListView, BListItem *underItem, bool oneLevelOnly, int32 index) +{ + return OutlineListView->ItemUnderAt(underItem, oneLevelOnly, index); +} + + +/*********************************************************************** + * Method: BOutlineListView::DoMiscellaneous + * Params: MiscCode code, MiscData *data + * Returns: bool + * Effects: + ***********************************************************************/ +/*bool +BOutlineListView_DoMiscellaneous(BOutlineListView *OutlineListView, MiscCode code, MiscData *data) +{ + return OutlineListView->DoMiscellaneous(code, data); +} +*/ + +/*********************************************************************** + * Method: BOutlineListView::MessageReceived + * Params: BMessage * + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BOutlineListView_MessageReceived(BOutlineListView *OutlineListView, BMessage *) +{ + OutlineListView->MessageReceived(); +}*/ + + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _OUTLINELISTVIEW_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/interface/Point.cpp b/bepascal/source/bepascal/cpp/src/be/interface/Point.cpp new file mode 100644 index 0000000..a1fd6a8 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/Point.cpp @@ -0,0 +1,84 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _POINT_CPP_ +#define _POINT_CPP_ + +#include +#include + +#include +#include + +BPPoint::BPPoint(TPasObject PasObject, float x, float y) : BPoint(x, y), BPasObject(PasObject) +{ +} + +BPPoint::BPPoint(TPasObject PasObject, const BPoint& point) : BPoint(point), BPasObject(PasObject) +{ +} + +BPPoint::BPPoint(TPasObject PasObject) : BPoint(), BPasObject(PasObject) +{ +} + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BPoint_Create_1(TPasObject PasObject, float x, float y) +{ + return new BPPoint(PasObject, x, y); +} + +TCPlusObject BPoint_Create_2(TPasObject PasObject, const BPoint& point) +{ + return new BPPoint(PasObject, point); +} + +TCPlusObject BPoint_Create_3(TPasObject PasObject) +{ + return new BPPoint(PasObject); +} + +void BPoint_Free(TCPlusObject Point) +{ + delete Point; +} + +void BPoint_ConstrainTo(TCPlusObject Point, BRect rect) +{ + reinterpret_cast(Point)->ConstrainTo(rect); +} + +void BPoint_PrintToStream(TCPlusObject Point) +{ + reinterpret_cast(Point)->PrintToStream(); +} + +void BPoint_Set(TCPlusObject Point, float x, float y) +{ + reinterpret_cast(Point)->Set(x, y); +} + +#if defined(__cplusplus) +} +#endif + + +#endif _POINT_CPP_ /* _POINT_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/interface/RadioButton.cpp b/bepascal/source/bepascal/cpp/src/be/interface/RadioButton.cpp new file mode 100644 index 0000000..a411770 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/RadioButton.cpp @@ -0,0 +1,628 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2003 Olivier Coursiere + Eric Jourde + Oscar Lesta + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _RADIOBUTTON_CPP_ +#define _RADIOBUTTON_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: RadioButton.cpp + * DATE: Mon Jan 20 02:30:54 2003 + * DESCR: + ***********************************************************************/ +#include "RadioButton.h" + +#include "control.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(__cplusplus) +} +#endif + +class BPRadioButton : public BRadioButton, virtual public BPControl { + +public: + BPRadioButton(TPasObject PasObject, + BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizMask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + //virtual ~BRadioButton(); + +/* Archiving */ + BPRadioButton(TPasObject PasObject, BMessage *data); + + //static BArchivable *Instantiate(BMessage *data); + //virtual status_t Archive(BMessage *data, bool deep = true) const; + virtual void Draw(BRect updateRect); + virtual void MouseDown(BPoint where); + virtual void AttachedToWindow(); + virtual void KeyDown(const char *bytes, int32 numBytes); + virtual void SetValue(int32 value); + virtual void GetPreferredSize(float *width, float *height); + virtual void ResizeToPreferred(); + //virtual status_t Invoke(BMessage *msg = NULL); + + virtual void MessageReceived(BMessage *msg); + virtual void WindowActivated(bool state); + virtual void MouseUp(BPoint pt); + virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); + virtual void DetachedFromWindow(); + virtual void FrameMoved(BPoint new_position); + virtual void FrameResized(float new_width, float new_height); +/* + virtual BHandler *ResolveSpecifier(BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property); +*/ + //virtual void MakeFocus(bool state = true); + virtual void AllAttached(); +// virtual void AllDetached(); +// virtual status_t GetSupportedSuites(BMessage *data); + + +/*----- Private or reserved -----------------------------------------*/ +//virtual status_t Perform(perform_code d, void *arg); + +private: + /*friend status_t _init_interface_kit_(); + + virtual void _ReservedRadioButton1(); + virtual void _ReservedRadioButton2(); + + BRadioButton &operator=(const BRadioButton &); + static BBitmap *sBitmaps[2][3]; + + bool fOutlined; + uint32 _reserved[2];*/ +}; + +BPRadioButton::BPRadioButton(TPasObject PasObject, + BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 rmask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE) + : + BRadioButton(frame,name,label, + message,rmask,flags), + BPControl(PasObject, frame, name, label, message, + rmask, flags), + BPView(PasObject, frame, name, rmask, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + + +BPRadioButton::BPRadioButton(TPasObject PasObject, BMessage *archive) + :BRadioButton(archive), + BPControl(PasObject, archive), + BPView(PasObject, archive), + BPHandler(PasObject, archive), + BPasObject(PasObject) +{ + +} + + +void BPRadioButton::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BRadioButton::MessageReceived(message); +} + +void BPRadioButton::Draw(BRect updateRect) +{ + BRadioButton::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPRadioButton::AttachedToWindow(void) +{ + BRadioButton::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + +void BPRadioButton::WindowActivated(bool active) +{ + BRadioButton::WindowActivated(active); +} + +void BPRadioButton::KeyDown(const char *bytes, int32 numBytes) +{ + BRadioButton::KeyDown(bytes, numBytes); +} + + +void BPRadioButton::AllAttached(void) +{ + BRadioButton::AllAttached(); +} +/* +void BPRadioButton::AllDetached(void) +{ + BRadioButton::AllDetached(); +} +*/ +void BPRadioButton::DetachedFromWindow(void) +{ + BRadioButton::DetachedFromWindow(); +} + + +void BPRadioButton::FrameMoved(BPoint parentPoint) +{ + BRadioButton::FrameMoved(parentPoint); +} + +void BPRadioButton::FrameResized(float width, float height) +{ + BRadioButton::FrameResized(width, height); +} + +void BPRadioButton::GetPreferredSize(float *width, float *height) +{ + BRadioButton::GetPreferredSize(width, height); +} + +void BPRadioButton::ResizeToPreferred(void) +{ + BRadioButton::ResizeToPreferred(); +} + + +void BPRadioButton::MouseDown(BPoint point) +{ + BRadioButton::MouseDown(point); +} + +void BPRadioButton::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BRadioButton::MouseMoved(point, transit, message); +} + +void BPRadioButton::MouseUp(BPoint point) +{ + BRadioButton::MouseUp(point); +} + + +//void BPButton::TargetedByScrollView(BScrollView *scroller) +//{ +// BButton::TargetedByScrollView(scroller); +//} + + +void BPRadioButton::SetValue(int32 value) +{ + BRadioButton::SetValue(value); +} + + + +#if defined(__cplusplus) +extern "C" { +#endif + + +/*********************************************************************** + * Method: BRadioButton::~BRadioButton + * Params: + * Effects: + ***********************************************************************/ +void BRadioButton_FREE(BRadioButton *RadioButton) +{ + delete RadioButton; +} + +TCPlusObject BRadioButton_Create(TPasObject PasObject, BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizeMask , + uint32 flags ) +{ + return new BPRadioButton( PasObject, frame, + name, + label, + message, + resizeMask , + flags ); +} + + +/*********************************************************************** + * Method: BRadioButton::BRadioButton + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BRadioButton_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPRadioButton(PasObject, data); +} + + +/*********************************************************************** + * Method: BRadioButton::~BRadioButton + * Params: + * Effects: + ***********************************************************************/ +/*BRadioButton_~BRadioButton(BRadioButton *RadioButton) +{ + return RadioButton->~BRadioButton(); +} +*/ + +/*********************************************************************** + * Method: BRadioButton::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BRadioButton_Instantiate(BRadioButton *RadioButton, BMessage *data) +{ + return RadioButton->Instantiate(data); +} + + +/*********************************************************************** + * Method: BRadioButton::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRadioButton_Archive(BRadioButton *RadioButton, BMessage *data, bool deep) +{ + return RadioButton->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BRadioButton::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_Draw(BRadioButton *RadioButton, BRect updateRect) +{ + RadioButton->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BRadioButton::MouseDown + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_MouseDown(BRadioButton *RadioButton, BPoint where) +{ + RadioButton->MouseDown(where); +} + + +/*********************************************************************** + * Method: BRadioButton::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_AttachedToWindow(BRadioButton *RadioButton) +{ + RadioButton->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BRadioButton::KeyDown + * Params: const char *bytes, int32 numBytes + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_KeyDown(BRadioButton *RadioButton, const char *bytes, int32 numBytes) +{ + RadioButton->KeyDown(bytes, numBytes); +} + + +/*********************************************************************** + * Method: BRadioButton::SetValue + * Params: int32 value + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_SetValue(BRadioButton *RadioButton, int32 value) +{ + RadioButton->SetValue(value); +} + + +/*********************************************************************** + * Method: BRadioButton::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_GetPreferredSize(BRadioButton *RadioButton, float *width, float *height) +{ + RadioButton->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BRadioButton::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_ResizeToPreferred(BRadioButton *RadioButton) +{ + RadioButton->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BRadioButton::Invoke + * Params: BMessage *msg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRadioButton_Invoke(BRadioButton *RadioButton, BMessage *msg) +{ + return RadioButton->Invoke(msg); +} + + +/*********************************************************************** + * Method: BRadioButton::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_MessageReceived(BRadioButton *RadioButton, BMessage *msg) +{ + RadioButton->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BRadioButton::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_WindowActivated(BRadioButton *RadioButton, bool state) +{ + RadioButton->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BRadioButton::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_MouseUp(BRadioButton *RadioButton, BPoint pt) +{ + RadioButton->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BRadioButton::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_MouseMoved(BRadioButton *RadioButton, BPoint pt, uint32 code, const BMessage *msg) +{ + RadioButton->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BRadioButton::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_DetachedFromWindow(BRadioButton *RadioButton) +{ + RadioButton->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BRadioButton::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_FrameMoved(BRadioButton *RadioButton, BPoint new_position) +{ + RadioButton->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BRadioButton::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_FrameResized(BRadioButton *RadioButton, float new_width, float new_height) +{ + RadioButton->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BRadioButton::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BRadioButton_ResolveSpecifier(BRadioButton *RadioButton, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return RadioButton->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BRadioButton::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_MakeFocus(BRadioButton *RadioButton, bool state) +{ + RadioButton->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BRadioButton::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_AllAttached(BRadioButton *RadioButton) +{ + RadioButton->AllAttached(); +} + + +/*********************************************************************** + * Method: BRadioButton::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_AllDetached(BRadioButton *RadioButton) +{ + RadioButton->AllDetached(); +} + + +/*********************************************************************** + * Method: BRadioButton::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRadioButton_GetSupportedSuites(BRadioButton *RadioButton, BMessage *data) +{ + return RadioButton->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BRadioButton::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRadioButton_Perform(BRadioButton *RadioButton, perform_code d, void *arg) +{ + return RadioButton->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BRadioButton::_ReservedRadioButton1 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRadioButton__ReservedRadioButton1(BRadioButton *RadioButton) +{ + RadioButton->_ReservedRadioButton1(); +} +*/ + +/*********************************************************************** + * Method: BRadioButton::_ReservedRadioButton2 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRadioButton__ReservedRadioButton2(BRadioButton *RadioButton) +{ + RadioButton->_ReservedRadioButton2(); +} +*/ + +/*********************************************************************** + * Method: BRadioButton::operator= + * Params: const BRadioButton & + * Returns: BRadioButton & + * Effects: + ***********************************************************************/ +/*BRadioButton & +BRadioButton_operator=(BRadioButton *RadioButton, const BRadioButton &) +{ + return RadioButton->operator=(); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _RADIOBUTTON_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/interface/Rect.cpp b/bepascal/source/bepascal/cpp/src/be/interface/Rect.cpp new file mode 100644 index 0000000..b8ecb01 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/Rect.cpp @@ -0,0 +1,84 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _RECT_CPP_ +#define _RECT_CPP_ + +#include +#include + +#include +#include + +BPRect::BPRect(TPasObject PasObject) : BRect(), BPasObject(PasObject) +{ +} + +BPRect::BPRect(TPasObject PasObject, const BRect & rect) : BRect(rect), BPasObject(PasObject) +{ +} + +BPRect::BPRect(TPasObject PasObject, float l, float t, float r, float b) : BRect(l, t, r, b), BPasObject(PasObject) +{ +} + +BPRect::BPRect(TPasObject PasObject, BPoint leftTop, BPoint rightBottom) : BRect(leftTop, rightBottom), BPasObject(PasObject) +{ +} + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BRect_Create_1(TPasObject PasObject) +{ + return new BPRect(PasObject); +} + +TCPlusObject BRect_Create_2(TPasObject PasObject, const BRect& rect) +{ + return new BPRect(PasObject, rect); +} + +TCPlusObject BRect_Create_3(TPasObject PasObject, float l, float t, float r, float b) +{ + return new BPRect(PasObject, l, t, r, b); +} + +TCPlusObject BRect_Create_4(TPasObject PasObject, BPoint leftTop, BPoint rightBottom) +{ + return new BPRect(PasObject, leftTop, rightBottom); +} + +void BRect_Free(TCPlusObject rect) +{ + delete rect; +} + +void BRect_PrintToStream(TCPlusObject rect) +{ + reinterpret_cast(rect)->PrintToStream(); +} + + +#if defined(__cplusplus) +} +#endif + + +#endif _RECT_CPP_ /* _RECT_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/interface/ScrollBar.cpp b/bepascal/source/bepascal/cpp/src/be/interface/ScrollBar.cpp new file mode 100644 index 0000000..3b8238f --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/ScrollBar.cpp @@ -0,0 +1,635 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _SCROLLBAR_CPP_ +#define _SCROLLBAR_CPP_ +/*********************************************************************** + * AUTHOR: nobody + * FILE: StringView.cpp + * DATE: Mon Jan 13 21:52:29 2003 + * DESCR: + ***********************************************************************/ +#include "ScrollBar.h" +#include "view.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(__cplusplus) +} +#endif + +class BPScrollBar : public BScrollBar,virtual public BPView { + +public: + BPScrollBar(TPasObject PasObject, + BRect frame, + const char *name, + BView *target, + float min, + float max, + orientation direction); + BPScrollBar(TPasObject PasObject,BMessage *data); + +//static BArchivable *Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +virtual void AttachedToWindow(); + +virtual void MessageReceived(BMessage *msg); +virtual void MouseDown(BPoint pt); +virtual void MouseUp(BPoint pt); +virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); +virtual void Draw(BRect updateRect); +virtual void FrameMoved(BPoint new_position); +virtual void FrameResized(float new_width, float new_height); + +virtual void AllAttached(); +virtual void AllDetached(); + +private: + +}; + +BPScrollBar::BPScrollBar(TPasObject PasObject, + BRect frame, + const char *name, + BView *target, + float min, + float max, + orientation direction) + : + BScrollBar( frame, + name, + target, + min, + max, + direction), + BPView(PasObject, BRect(0,0,0,0), name, 0, 0), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + +BPScrollBar::BPScrollBar(TPasObject PasObject, BMessage *data) + :BScrollBar(data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} + +void BPScrollBar::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BScrollBar::MessageReceived(message); +} + +void BPScrollBar::Draw(BRect updateRect) +{ + BScrollBar::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPScrollBar::AttachedToWindow(void) +{ + BScrollBar::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + + +void BPScrollBar::AllAttached(void) +{ + BScrollBar::AllAttached(); +} + +void BPScrollBar::AllDetached(void) +{ + BScrollBar::AllDetached(); +} + + + +void BPScrollBar::FrameMoved(BPoint parentPoint) +{ + BScrollBar::FrameMoved(parentPoint); +} + +void BPScrollBar::FrameResized(float width, float height) +{ + BScrollBar::FrameResized(width, height); +} + + + + +void BPScrollBar::MouseDown(BPoint point) +{ + BScrollBar::MouseDown(point); +} + +void BPScrollBar::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BScrollBar::MouseMoved(point, transit, message); +} + +void BPScrollBar::MouseUp(BPoint point) +{ + BScrollBar::MouseUp(point); +} + + + + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * AUTHOR: nobody + * FILE: ScrollBar.cpp + * DATE: Sun Feb 2 15:49:13 2003 + * DESCR: + ***********************************************************************/ + +/*********************************************************************** + * Method: BScrollBar::BScrollBar + * Params: BRect frame, const char *name, BView *target, float min, float max, orientation direction + * Effects: + ***********************************************************************/ +TCPlusObject BScrollBar_Create(TPasObject PasObject, BRect frame, const char *name, BView *target, float min, float max, orientation direction) +{ + return new BPScrollBar(PasObject, frame, name, target, min, max, direction); +} + + +/*********************************************************************** + * Method: BScrollBar::BScrollBar + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BScrollBar_Create_1 +(TPasObject PasObject, BMessage *data) +{ + return new BPScrollBar(PasObject, data); +} + + +/*********************************************************************** + * Method: BScrollBar::~BScrollBar + * Params: + * Effects: + ***********************************************************************/ +void BScrollBar_Free(BScrollBar *ScrollBar) +{ + delete ScrollBar; +} + + +/*********************************************************************** + * Method: BScrollBar::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BScrollBar_Instantiate(BScrollBar *ScrollBar, BMessage *data) +{ + return ScrollBar->Instantiate(data); +} + + +/*********************************************************************** + * Method: BScrollBar::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollBar_Archive(BScrollBar *ScrollBar, BMessage *data, bool deep) +{ + return ScrollBar->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BScrollBar::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_AttachedToWindow(BScrollBar *ScrollBar) +{ + ScrollBar->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BScrollBar::SetValue + * Params: float value + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetValue(BScrollBar *ScrollBar, float value) +{ + ScrollBar->SetValue(value); +} + + +/*********************************************************************** + * Method: BScrollBar::Value + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BScrollBar_Value(BScrollBar *ScrollBar) +{ + return ScrollBar->Value(); +} + + +/*********************************************************************** + * Method: BScrollBar::SetProportion + * Params: float + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetProportion(BScrollBar *ScrollBar, float value) +{ + ScrollBar->SetProportion(value); +} + + +/*********************************************************************** + * Method: BScrollBar::Proportion + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BScrollBar_Proportion(BScrollBar *ScrollBar) +{ + return ScrollBar->Proportion(); +} + + +/*********************************************************************** + * Method: BScrollBar::ValueChanged + * Params: float newValue + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_ValueChanged(BScrollBar *ScrollBar, float newValue) +{ + ScrollBar->ValueChanged(newValue); +} + + +/*********************************************************************** + * Method: BScrollBar::SetRange + * Params: float min, float max + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetRange(BScrollBar *ScrollBar, float min, float max) +{ + ScrollBar->SetRange(min, max); +} + + +/*********************************************************************** + * Method: BScrollBar::GetRange + * Params: float *min, float *max + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_GetRange(BScrollBar *ScrollBar, float *min, float *max) +{ + ScrollBar->GetRange(min, max); +} + + +/*********************************************************************** + * Method: BScrollBar::SetSteps + * Params: float smallStep, float largeStep + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetSteps(BScrollBar *ScrollBar, float smallStep, float largeStep) +{ + ScrollBar->SetSteps(smallStep, largeStep); +} + + +/*********************************************************************** + * Method: BScrollBar::GetSteps + * Params: float *smallStep, float *largeStep + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_GetSteps(BScrollBar *ScrollBar, float *smallStep, float *largeStep) +{ + ScrollBar->GetSteps(smallStep, largeStep); +} + + +/*********************************************************************** + * Method: BScrollBar::SetTarget + * Params: BView *target + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetTarget(BScrollBar *ScrollBar, BView *target) +{ + ScrollBar->SetTarget(target); +} + + +/*********************************************************************** + * Method: BScrollBar::SetTarget + * Params: const char *targetName + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetTarget_1 +(BScrollBar *ScrollBar, const char *targetName) +{ + ScrollBar->SetTarget(targetName); +} + + +/*********************************************************************** + * Method: BScrollBar::Target + * Params: + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BScrollBar_Target(BScrollBar *ScrollBar) +{ + return ScrollBar->Target(); +} + + +/*********************************************************************** + * Method: BScrollBar::Orientation + * Params: + * Returns: orientation + * Effects: + ***********************************************************************/ +orientation +BScrollBar_Orientation(BScrollBar *ScrollBar) +{ + return ScrollBar->Orientation(); +} + + +/*********************************************************************** + * Method: BScrollBar::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_MessageReceived(BScrollBar *ScrollBar, BMessage *msg) +{ + ScrollBar->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BScrollBar::MouseDown + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_MouseDown(BScrollBar *ScrollBar, BPoint pt) +{ + ScrollBar->MouseDown(pt); +} + + +/*********************************************************************** + * Method: BScrollBar::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_MouseUp(BScrollBar *ScrollBar, BPoint pt) +{ + ScrollBar->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BScrollBar::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_MouseMoved(BScrollBar *ScrollBar, BPoint pt, uint32 code, const BMessage *msg) +{ + ScrollBar->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BScrollBar::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_DetachedFromWindow(BScrollBar *ScrollBar) +{ + ScrollBar->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BScrollBar::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_Draw(BScrollBar *ScrollBar, BRect updateRect) +{ + ScrollBar->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BScrollBar::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_FrameMoved(BScrollBar *ScrollBar, BPoint new_position) +{ + ScrollBar->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BScrollBar::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_FrameResized(BScrollBar *ScrollBar, float new_width, float new_height) +{ + ScrollBar->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BScrollBar::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BScrollBar_ResolveSpecifier(BScrollBar *ScrollBar, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return ScrollBar->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BScrollBar::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_ResizeToPreferred(BScrollBar *ScrollBar) +{ + ScrollBar->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BScrollBar::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_GetPreferredSize(BScrollBar *ScrollBar, float *width, float *height) +{ + ScrollBar->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BScrollBar::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_MakeFocus(BScrollBar *ScrollBar, bool state) +{ + ScrollBar->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BScrollBar::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_AllAttached(BScrollBar *ScrollBar) +{ + ScrollBar->AllAttached(); +} + + +/*********************************************************************** + * Method: BScrollBar::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_AllDetached(BScrollBar *ScrollBar) +{ + ScrollBar->AllDetached(); +} + + +/*********************************************************************** + * Method: BScrollBar::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollBar_GetSupportedSuites(BScrollBar *ScrollBar, BMessage *data) +{ + return ScrollBar->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BScrollBar::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollBar_Perform(BScrollBar *ScrollBar, perform_code d, void *arg) +{ + return ScrollBar->Perform(d, arg); +} + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* SCROLLBAR_CPP */ + diff --git a/bepascal/source/bepascal/cpp/src/be/interface/ScrollView.cpp b/bepascal/source/bepascal/cpp/src/be/interface/ScrollView.cpp new file mode 100644 index 0000000..53dfcd6 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/ScrollView.cpp @@ -0,0 +1,592 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _SCROLLVIEW_CPP_ +#define _SCROLLVIEW_CPP_ +/*********************************************************************** + * AUTHOR: nobody + * FILE: StringView.cpp + * DATE: Mon Jan 13 21:52:29 2003 + * DESCR: + ***********************************************************************/ +#include "ScrollView.h" +#include "view.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(__cplusplus) +} +#endif + +class BPScrollView : public BScrollView, virtual public BPView { + +public: + BPScrollView( + TPasObject PasObject, + const char *name, + BView *target, + uint32 resizeMask = B_FOLLOW_LEFT | + B_FOLLOW_TOP, + uint32 flags = 0, + bool horizontal = false, + bool vertical = false, + border_style border = B_FANCY_BORDER); + BPScrollView(TPasObject PasObject,BMessage *data); +//virtual ~BScrollView(); +static BArchivable *Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +virtual void Draw(BRect updateRect); +virtual void AttachedToWindow(); + + +virtual void MessageReceived(BMessage *msg); +virtual void MouseDown(BPoint pt); +virtual void WindowActivated(bool state); +virtual void MouseUp(BPoint pt); +virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); +virtual void DetachedFromWindow(); +virtual void AllAttached(); +virtual void AllDetached(); +//virtual void FrameMoved(BPoint new_position); +virtual void FrameResized(float new_width, float new_height); + + +//virtual void ResizeToPreferred(); +//virtual void GetPreferredSize(float *width, float *height); +//virtual void MakeFocus(bool state = true); + +/*----- Private or reserved -----------------------------------------*/ + +private: +}; + +BPScrollView::BPScrollView(TPasObject PasObject, + const char *name, + BView *target, + uint32 resizeMask = B_FOLLOW_LEFT | + B_FOLLOW_TOP, + uint32 flags = 0, + bool horizontal = false, + bool vertical = false, + border_style border = B_FANCY_BORDER) + : + BScrollView(name, + target, + resizeMask, + flags, + horizontal, + vertical, + border), + BPView(PasObject, BRect(0,0,0,0), name, 0, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + + + +BPScrollView::BPScrollView(TPasObject PasObject, BMessage *data) + :BScrollView(data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} + + + + +void BPScrollView::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BScrollView::MessageReceived(message); +} + +void BPScrollView::Draw(BRect updateRect) +{ + BScrollView::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPScrollView::AttachedToWindow(void) +{ + //BTextView::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + + +void BPScrollView::AllAttached(void) +{ + BScrollView::AllAttached(); +} + +void BPScrollView::AllDetached(void) +{ + BScrollView::AllDetached(); +} + + +void BPScrollView::WindowActivated(bool active) +{ + BScrollView::WindowActivated(active); +} + + + +void BPScrollView::FrameResized(float width, float height) +{ + BScrollView::FrameResized(width, height); +} + +void BPScrollView::DetachedFromWindow(void) +{ + BScrollView::DetachedFromWindow(); +} + + + +void BPScrollView::MouseDown(BPoint point) +{ + BScrollView::MouseDown(point); +} + +void BPScrollView::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BScrollView::MouseMoved(point, transit, message); +} + +void BPScrollView::MouseUp(BPoint point) +{ + BScrollView::MouseUp(point); +} + + +#if defined(__cplusplus) +extern "C" { +#endif + + +/*********************************************************************** + * AUTHOR: nobody + * FILE: ScrollView.cpp + * DATE: Sun Feb 2 20:53:19 2003 + * DESCR: + ***********************************************************************/ + +/*********************************************************************** + * Method: BScrollView::BScrollView + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BScrollView_Create(TPasObject PasObject, + const char *name, + BView *target, + uint32 resizeMask = B_FOLLOW_LEFT | + B_FOLLOW_TOP, + uint32 flags = 0, + bool horizontal = false, + bool vertical = false, + border_style border = B_FANCY_BORDER) +{ + return new BPScrollView(PasObject, name,target,resizeMask,flags,horizontal,vertical,border); +} + +TCPlusObject BScrollView_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPScrollView(PasObject, data); +} + + +/*********************************************************************** + * Method: BScrollView::~BScrollView + * Params: + * Effects: + ***********************************************************************/ +void BScrollView_Free(BScrollView *ScrollView) +{ + delete ScrollView; +} + + +/*********************************************************************** + * Method: BScrollView::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BScrollView_Instantiate(BScrollView *ScrollView, BMessage *data) +{ + return ScrollView->Instantiate(data); +} + + +/*********************************************************************** + * Method: BScrollView::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollView_Archive(BScrollView *ScrollView, BMessage *data, bool deep) +{ + return ScrollView->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BScrollView::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_Draw(BScrollView *ScrollView, BRect updateRect) +{ + ScrollView->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BScrollView::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_AttachedToWindow(BScrollView *ScrollView) +{ + ScrollView->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BScrollView::ScrollBar + * Params: orientation flag + * Returns: BScrollBar * + * Effects: + ***********************************************************************/ +BScrollBar * +BScrollView_ScrollBar(BScrollView *ScrollView, orientation flag) +{ + return ScrollView->ScrollBar(flag); +} + + +/*********************************************************************** + * Method: BScrollView::SetBorder + * Params: border_style border + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_SetBorder(BScrollView *ScrollView, border_style border) +{ + ScrollView->SetBorder(border); +} + + +/*********************************************************************** + * Method: BScrollView::Border + * Params: + * Returns: border_style + * Effects: + ***********************************************************************/ +border_style +BScrollView_Border(BScrollView *ScrollView) +{ + return ScrollView->Border(); +} + + +/*********************************************************************** + * Method: BScrollView::SetBorderHighlighted + * Params: bool state + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollView_SetBorderHighlighted(BScrollView *ScrollView, bool state) +{ + return ScrollView->SetBorderHighlighted(state); +} + + +/*********************************************************************** + * Method: BScrollView::IsBorderHighlighted + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BScrollView_IsBorderHighlighted(BScrollView *ScrollView) +{ + return ScrollView->IsBorderHighlighted(); +} + + +/*********************************************************************** + * Method: BScrollView::SetTarget + * Params: BView *new_target + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_SetTarget(BScrollView *ScrollView, BView *new_target) +{ + ScrollView->SetTarget(new_target); +} + + +/*********************************************************************** + * Method: BScrollView::Target + * Params: + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BScrollView_Target(BScrollView *ScrollView) +{ + return ScrollView->Target(); +} + + +/*********************************************************************** + * Method: BScrollView::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_MessageReceived(BScrollView *ScrollView, BMessage *msg) +{ + ScrollView->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BScrollView::MouseDown + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_MouseDown(BScrollView *ScrollView, BPoint pt) +{ + ScrollView->MouseDown(pt); +} + + +/*********************************************************************** + * Method: BScrollView::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_WindowActivated(BScrollView *ScrollView, bool state) +{ + ScrollView->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BScrollView::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_MouseUp(BScrollView *ScrollView, BPoint pt) +{ + ScrollView->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BScrollView::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_MouseMoved(BScrollView *ScrollView, BPoint pt, uint32 code, const BMessage *msg) +{ + ScrollView->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BScrollView::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_DetachedFromWindow(BScrollView *ScrollView) +{ + ScrollView->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BScrollView::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_AllAttached(BScrollView *ScrollView) +{ + ScrollView->AllAttached(); +} + + +/*********************************************************************** + * Method: BScrollView::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_AllDetached(BScrollView *ScrollView) +{ + ScrollView->AllDetached(); +} + + +/*********************************************************************** + * Method: BScrollView::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_FrameMoved(BScrollView *ScrollView, BPoint new_position) +{ + ScrollView->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BScrollView::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_FrameResized(BScrollView *ScrollView, float new_width, float new_height) +{ + ScrollView->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BScrollView::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BScrollView_ResolveSpecifier(BScrollView *ScrollView, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return ScrollView->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BScrollView::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_ResizeToPreferred(BScrollView *ScrollView) +{ + ScrollView->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BScrollView::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_GetPreferredSize(BScrollView *ScrollView, float *width, float *height) +{ + ScrollView->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BScrollView::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_MakeFocus(BScrollView *ScrollView, bool state) +{ + ScrollView->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BScrollView::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollView_GetSupportedSuites(BScrollView *ScrollView, BMessage *data) +{ + return ScrollView->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BScrollView::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollView_Perform(BScrollView *ScrollView, perform_code d, void *arg) +{ + return ScrollView->Perform(d, arg); +} + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _SSCROLLVIEW_CPP_ */ + diff --git a/bepascal/source/bepascal/cpp/src/be/interface/StatusBar.cpp b/bepascal/source/bepascal/cpp/src/be/interface/StatusBar.cpp new file mode 100644 index 0000000..f99835f --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/StatusBar.cpp @@ -0,0 +1,657 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _STATUSBAR_CPP_ +#define _STATUSBAR_CPP_ +/*********************************************************************** + * AUTHOR: nobody + * FILE: StringView.cpp + * DATE: Mon Jan 13 21:52:29 2003 + * DESCR: + ***********************************************************************/ +#include "StatusBar.h" +#include "view.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(__cplusplus) +} +#endif + +class BPStatusBar : public BStatusBar, virtual BPView +{ + +public: + BPStatusBar(TPasObject PasObject, + BRect frame, + const char *name, + const char *label = NULL, + const char *trailing_label = NULL); + BPStatusBar(TPasObject PasObject,BMessage *data); + +//static BArchivable *Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +virtual void AttachedToWindow(); +virtual void MessageReceived(BMessage *msg); +virtual void Draw(BRect updateRect); +virtual void MouseDown(BPoint pt); +virtual void MouseUp(BPoint pt); +//virtual void WindowActivated(bool state); +virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); +//virtual void DetachedFromWindow(); +virtual void FrameMoved(BPoint new_position); +virtual void FrameResized(float new_width, float new_height); + +virtual void AllAttached(); +virtual void AllDetached(); + +private: +}; + +BPStatusBar::BPStatusBar(TPasObject PasObject, + BRect frame, + const char *name, + const char *label = NULL, + const char *trailing_label = NULL) + :BStatusBar( + frame, + name, + label , + trailing_label ), + BPView(PasObject, BRect(0,0,0,0), name, 0, 0), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ +} + +BPStatusBar::BPStatusBar(TPasObject PasObject,BMessage *data) + :BStatusBar(data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} + +void BPStatusBar::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BStatusBar::MessageReceived(message); +} + +void BPStatusBar::Draw(BRect updateRect) +{ + BStatusBar::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPStatusBar::AttachedToWindow(void) +{ + BStatusBar::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + + +void BPStatusBar::AllAttached(void) +{ + BStatusBar::AllAttached(); +} + +void BPStatusBar::AllDetached(void) +{ + BStatusBar::AllDetached(); +} + + + +void BPStatusBar::FrameMoved(BPoint parentPoint) +{ + BStatusBar::FrameMoved(parentPoint); +} + +void BPStatusBar::FrameResized(float width, float height) +{ + BStatusBar::FrameResized(width, height); +} + + + + +void BPStatusBar::MouseDown(BPoint point) +{ + BStatusBar::MouseDown(point); +} + +void BPStatusBar::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BStatusBar::MouseMoved(point, transit, message); +} + +void BPStatusBar::MouseUp(BPoint point) +{ + BStatusBar::MouseUp(point); +} + +#if defined(__cplusplus) +extern "C" { +#endif + + + + +/*********************************************************************** + * Method: BStatusBar::BStatusBar + * Params: BRect frame, const char *name, const char *label, const char *trailing_label + * Effects: + ***********************************************************************/ +TCPlusObject BStatusBar_Create(TPasObject PasObject, BRect frame, const char *name, const char *label, const char *trailing_label) +{ + return new BPStatusBar(PasObject, frame, name, label, trailing_label); +} + + +/*********************************************************************** + * Method: BStatusBar::BStatusBar + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BStatusBar_Create_1 +(TPasObject PasObject, BMessage *data) +{ + return new BPStatusBar(PasObject, data); +} + + +/*********************************************************************** + * Method: BStatusBar::~BStatusBar + * Params: + * Effects: + ***********************************************************************/ +void BStatusBar_Free(BStatusBar *StatusBar) +{ + delete StatusBar; +} + + +/*********************************************************************** + * Method: BStatusBar::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BStatusBar_Instantiate(BStatusBar *StatusBar, BMessage *data) +{ + return StatusBar->Instantiate(data); +} + + +/*********************************************************************** + * Method: BStatusBar::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BStatusBar_Archive(BStatusBar *StatusBar, BMessage *data, bool deep) +{ + return StatusBar->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BStatusBar::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_AttachedToWindow(BStatusBar *StatusBar) +{ + StatusBar->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BStatusBar::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_MessageReceived(BStatusBar *StatusBar, BMessage *msg) +{ + StatusBar->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BStatusBar::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_Draw(BStatusBar *StatusBar, BRect updateRect) +{ + StatusBar->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BStatusBar::SetBarColor + * Params: rgb_color color + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_SetBarColor(BStatusBar *StatusBar, rgb_color color) +{ + StatusBar->SetBarColor(color); +} + + +/*********************************************************************** + * Method: BStatusBar::SetBarHeight + * Params: float height + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_SetBarHeight(BStatusBar *StatusBar, float height) +{ + StatusBar->SetBarHeight(height); +} + + +/*********************************************************************** + * Method: BStatusBar::SetText + * Params: const char *str + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_SetText(BStatusBar *StatusBar, const char *str) +{ + StatusBar->SetText(str); +} + + +/*********************************************************************** + * Method: BStatusBar::SetTrailingText + * Params: const char *str + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_SetTrailingText(BStatusBar *StatusBar, const char *str) +{ + StatusBar->SetTrailingText(str); +} + + +/*********************************************************************** + * Method: BStatusBar::SetMaxValue + * Params: float max + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_SetMaxValue(BStatusBar *StatusBar, float max) +{ + StatusBar->SetMaxValue(max); +} + + +/*********************************************************************** + * Method: BStatusBar::Update + * Params: float delta, const char *main_text, const char *trailing_text + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_Update(BStatusBar *StatusBar, float delta, const char *main_text, const char *trailing_text) +{ + StatusBar->Update(delta, main_text, trailing_text); +} + + +/*********************************************************************** + * Method: BStatusBar::Reset + * Params: const char *label, const char *trailing_label + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_Reset(BStatusBar *StatusBar, const char *label, const char *trailing_label) +{ + StatusBar->Reset(label, trailing_label); +} + + +/*********************************************************************** + * Method: BStatusBar::CurrentValue + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BStatusBar_CurrentValue(BStatusBar *StatusBar) +{ + return StatusBar->CurrentValue(); +} + + +/*********************************************************************** + * Method: BStatusBar::MaxValue + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BStatusBar_MaxValue(BStatusBar *StatusBar) +{ + return StatusBar->MaxValue(); +} + + +/*********************************************************************** + * Method: BStatusBar::BarColor + * Params: + * Returns: rgb_color + * Effects: + ***********************************************************************/ +rgb_color +BStatusBar_BarColor(BStatusBar *StatusBar) +{ + return StatusBar->BarColor(); +} + + +/*********************************************************************** + * Method: BStatusBar::BarHeight + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BStatusBar_BarHeight(BStatusBar *StatusBar) +{ + return StatusBar->BarHeight(); +} + + +/*********************************************************************** + * Method: BStatusBar::Text + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BStatusBar_Text(BStatusBar *StatusBar) +{ + return StatusBar->Text(); +} + + +/*********************************************************************** + * Method: BStatusBar::TrailingText + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BStatusBar_TrailingText(BStatusBar *StatusBar) +{ + return StatusBar->TrailingText(); +} + + +/*********************************************************************** + * Method: BStatusBar::Label + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BStatusBar_Label(BStatusBar *StatusBar) +{ + return StatusBar->Label(); +} + + +/*********************************************************************** + * Method: BStatusBar::TrailingLabel + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BStatusBar_TrailingLabel(BStatusBar *StatusBar) +{ + return StatusBar->TrailingLabel(); +} + + +/*********************************************************************** + * Method: BStatusBar::MouseDown + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_MouseDown(BStatusBar *StatusBar, BPoint pt) +{ + StatusBar->MouseDown(pt); +} + + +/*********************************************************************** + * Method: BStatusBar::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_MouseUp(BStatusBar *StatusBar, BPoint pt) +{ + StatusBar->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BStatusBar::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_WindowActivated(BStatusBar *StatusBar, bool state) +{ + StatusBar->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BStatusBar::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_MouseMoved(BStatusBar *StatusBar, BPoint pt, uint32 code, const BMessage *msg) +{ + StatusBar->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BStatusBar::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_DetachedFromWindow(BStatusBar *StatusBar) +{ + StatusBar->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BStatusBar::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_FrameMoved(BStatusBar *StatusBar, BPoint new_position) +{ + StatusBar->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BStatusBar::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_FrameResized(BStatusBar *StatusBar, float new_width, float new_height) +{ + StatusBar->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BStatusBar::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BStatusBar_ResolveSpecifier(BStatusBar *StatusBar, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return StatusBar->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BStatusBar::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_ResizeToPreferred(BStatusBar *StatusBar) +{ + StatusBar->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BStatusBar::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_GetPreferredSize(BStatusBar *StatusBar, float *width, float *height) +{ + StatusBar->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BStatusBar::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_MakeFocus(BStatusBar *StatusBar, bool state) +{ + StatusBar->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BStatusBar::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_AllAttached(BStatusBar *StatusBar) +{ + StatusBar->AllAttached(); +} + + +/*********************************************************************** + * Method: BStatusBar::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BStatusBar_AllDetached(BStatusBar *StatusBar) +{ + StatusBar->AllDetached(); +} + + +/*********************************************************************** + * Method: BStatusBar::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BStatusBar_GetSupportedSuites(BStatusBar *StatusBar, BMessage *data) +{ + return StatusBar->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BStatusBar::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BStatusBar_Perform(BStatusBar *StatusBar, perform_code d, void *arg) +{ + return StatusBar->Perform(d, arg); +} + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _STATUSBAR_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/interface/StringView.cpp b/bepascal/source/bepascal/cpp/src/be/interface/StringView.cpp new file mode 100644 index 0000000..4d80e87 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/StringView.cpp @@ -0,0 +1,552 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _STRINGVIEW_CPP_ +#define _STRINGVIEW_CPP_ +/*********************************************************************** + * AUTHOR: nobody + * FILE: StringView.cpp + * DATE: Mon Jan 13 21:52:29 2003 + * DESCR: + ***********************************************************************/ +#include "StringView.h" +#include "view.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(__cplusplus) +} +#endif + +class BPStringView : public BStringView, virtual public BPView +{ + +public: + BPStringView(TPasObject PasObject, + BRect bounds, + const char *name, + const char *text, + uint32 resizeFlags, + uint32 flags); + BPStringView(TPasObject PasObject, BMessage *archive); + + virtual void AttachedToWindow(void); + virtual void Draw(BRect updateRect); + virtual void MessageReceived(BMessage *message); + virtual void MouseDown(BPoint point); + virtual void MouseUp(BPoint point); + virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message); + virtual void FrameMoved(BPoint parentPoint); + virtual void FrameResized(float width, float height); + virtual void AllAttached(void); + virtual void AllDetached(void); + private: +}; + +BPStringView::BPStringView(TPasObject PasObject, + BRect bounds, + const char *name, + const char *text, + uint32 resizeFlags, + uint32 flags) + : + BStringView( bounds, + name, + text, + resizeFlags, + flags), + BPView(PasObject, BRect(0,0,0,0), name, 0, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + +BPStringView::BPStringView(TPasObject PasObject, BMessage *data) + :BStringView(data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} + +void BPStringView::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BStringView::MessageReceived(message); +} + +void BPStringView::Draw(BRect updateRect) +{ + BStringView::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPStringView::AttachedToWindow(void) +{ + BStringView::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + + +void BPStringView::AllAttached(void) +{ + BStringView::AllAttached(); +} + +void BPStringView::AllDetached(void) +{ + BStringView::AllDetached(); +} + + + +void BPStringView::FrameMoved(BPoint parentPoint) +{ + BStringView::FrameMoved(parentPoint); +} + +void BPStringView::FrameResized(float width, float height) +{ + BStringView::FrameResized(width, height); +} + + + + +void BPStringView::MouseDown(BPoint point) +{ + BStringView::MouseDown(point); +} + +void BPStringView::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BStringView::MouseMoved(point, transit, message); +} + +void BPStringView::MouseUp(BPoint point) +{ + BStringView::MouseUp(point); +} + + + + + + + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BStringView_Create(TPasObject PasObject, + BRect bounds, + const char *name, + const char *text, + uint32 resizeFlags, + uint32 flags) +{ + return new BPStringView(PasObject,bounds, + name, + text, + resizeFlags, + flags); +} +/*********************************************************************** + * Method: BStringView::BStringView + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BStringView_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPStringView(PasObject, data); +} + + +/*********************************************************************** + * Method: BStringView::~BStringView + * Params: + * Effects: + ***********************************************************************/ +void BStringView_Free(BStringView *StringView) +{ + delete StringView; +} + + +/*********************************************************************** + * Method: BStringView::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BStringView_Instantiate(BStringView *StringView, BMessage *data) +{ + return StringView->Instantiate(data); +} + + +/*********************************************************************** + * Method: BStringView::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BStringView_Archive(BStringView *StringView, BMessage *data, bool deep) +{ + return StringView->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BStringView::SetText + * Params: const char *text + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_SetText(BStringView *StringView, const char *text) +{ + StringView->SetText(text); +} + + +/*********************************************************************** + * Method: BStringView::Text + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BStringView_Text(BStringView *StringView) +{ + return StringView->Text(); +} + + +/*********************************************************************** + * Method: BStringView::SetAlignment + * Params: alignment flag + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_SetAlignment(BStringView *StringView, alignment flag) +{ + StringView->SetAlignment(flag); +} + + +/*********************************************************************** + * Method: BStringView::Alignment + * Params: + * Returns: alignment + * Effects: + ***********************************************************************/ +alignment +BStringView_Alignment(BStringView *StringView) +{ + return StringView->Alignment(); +} + + +/*********************************************************************** + * Method: BStringView::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_AttachedToWindow(BStringView *StringView) +{ + StringView->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BStringView::Draw + * Params: BRect bounds + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_Draw(BStringView *StringView, BRect bounds) +{ + StringView->Draw(bounds); +} + + +/*********************************************************************** + * Method: BStringView::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_MessageReceived(BStringView *StringView, BMessage *msg) +{ + StringView->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BStringView::MouseDown + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_MouseDown(BStringView *StringView, BPoint pt) +{ + StringView->MouseDown(pt); +} + + +/*********************************************************************** + * Method: BStringView::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_MouseUp(BStringView *StringView, BPoint pt) +{ + StringView->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BStringView::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_MouseMoved(BStringView *StringView, BPoint pt, uint32 code, const BMessage *msg) +{ + StringView->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BStringView::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_DetachedFromWindow(BStringView *StringView) +{ + StringView->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BStringView::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_FrameMoved(BStringView *StringView, BPoint new_position) +{ + StringView->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BStringView::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_FrameResized(BStringView *StringView, float new_width, float new_height) +{ + StringView->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BStringView::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BStringView_ResolveSpecifier(BStringView *StringView, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return StringView->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BStringView::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_ResizeToPreferred(BStringView *StringView) +{ + StringView->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BStringView::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_GetPreferredSize(BStringView *StringView, float *width, float *height) +{ + StringView->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BStringView::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_MakeFocus(BStringView *StringView, bool state) +{ + StringView->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BStringView::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_AllAttached(BStringView *StringView) +{ + StringView->AllAttached(); +} + + +/*********************************************************************** + * Method: BStringView::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BStringView_AllDetached(BStringView *StringView) +{ + StringView->AllDetached(); +} + + +/*********************************************************************** + * Method: BStringView::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BStringView_GetSupportedSuites(BStringView *StringView, BMessage *data) +{ + return StringView->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BStringView::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BStringView_Perform(BStringView *StringView, perform_code d, void *arg) +{ + return StringView->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BStringView::_ReservedStringView1 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BStringView__ReservedStringView1(BStringView *StringView) +{ + StringView->_ReservedStringView1(); +} + +*/ +/*********************************************************************** + * Method: BStringView::_ReservedStringView2 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BStringView__ReservedStringView2(BStringView *StringView) +{ + StringView->_ReservedStringView2(); +} +*/ + +/*********************************************************************** + * Method: BStringView::_ReservedStringView3 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BStringView__ReservedStringView3(BStringView *StringView) +{ + StringView->_ReservedStringView3(); +} + +*/ +/*********************************************************************** + * Method: BStringView::operator= + * Params: const BStringView & + * Returns: BStringView & + * Effects: + ***********************************************************************/ +/*BStringView & +BStringView_operator=(BStringView *StringView, const BStringView &) +{ + return StringView->operator=(); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _STRINGVIEW_CPP_ */ + diff --git a/bepascal/source/bepascal/cpp/src/be/interface/TabView.cpp b/bepascal/source/bepascal/cpp/src/be/interface/TabView.cpp new file mode 100644 index 0000000..3e9fc5c --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/TabView.cpp @@ -0,0 +1,1180 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _TABVIEW_CPP_ +#define _TABVIEW_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: TabView.cpp + * DATE: Wed Feb 12 20:21:37 2003 + * DESCR: + ***********************************************************************/ +#include "TabView.h" +#include +#include + +typedef void (*BTabView_AddTab_hook) (TPasObject PasObject, TCPlusObject target, TCPlusObject tab); +typedef void (*BTabView_Draw_hook) (TPasObject PasObject, TCPlusObject updateRect); +typedef void (*BTabView_DrawBox_hook) (TPasObject PasObject, TCPlusObject selfTabRect); +typedef BRect (*BTabView_DrawTabs_hook) (TPasObject PasObject); +typedef void (*BTabView_MakeFocus_hook) (TPasObject PasObject, bool focused); +typedef BTab * (*BTabView_RemoveTab_hook) (TPasObject PasObject, int32 tab_index); +typedef void (*BTabView_Select_hook) (TPasObject PasObject, int32 tab); +typedef void (*BTabView_SetFocusTab_hook) (TPasObject PasObject, int32 tab, bool focused); +typedef void (*BTabView_SetTabHeight_hook) (TPasObject PasObject, float height); +typedef void (*BTabView_SetTabWidth_hook) (TPasObject PasObject, button_width width); +typedef BTab * (*BTabView_TabAt_hook) (TPasObject PasObject, int32 tab_index); +typedef BRect (*BTabView_TabFrame_hook) (TPasObject PasObject, int32 tab_index); + + + +#if defined(__cplusplus) +extern "C" { +#endif + +BTabView_AddTab_hook TabView_AddTab_hook; +BTabView_Draw_hook TabView_Draw_hook; +BTabView_DrawBox_hook TabView_DrawBox_hook; +BTabView_DrawTabs_hook TabView_DrawTabs_hook; +BTabView_MakeFocus_hook TabView_MakeFocus_hook; +BTabView_RemoveTab_hook TabView_RemoveTab_hook; +BTabView_Select_hook TabView_Select_hook; +BTabView_SetFocusTab_hook TabView_SetFocusTab_hook; +BTabView_SetTabHeight_hook TabView_SetTabHeight_hook; +BTabView_SetTabWidth_hook TabView_SetTabWidth_hook; +BTabView_TabAt_hook TabView_TabAt_hook; +BTabView_TabFrame_hook TabView_TabFrame_hook; + + +#if defined(__cplusplus) +} +#endif + +class BPTab :public BTab , virtual public BPasObject { +public: + BPTab(TPasObject PasObject,BView* contents=NULL); + BPTab(TPasObject PasObject,BMessage* data); +virtual void DrawLabel(BView* owner, BRect tabFrame); +virtual void DrawTab(BView* owner, BRect tabFrame, tab_position,bool full=true); +}; + +BPTab::BPTab(TPasObject PasObject,BView* contents=NULL) + :BTab(contents), + BPasObject(PasObject) +{ +} + + +BPTab::BPTab(TPasObject PasObject,BMessage* data) + :BTab(data), + BPasObject(PasObject) +{ +} + +void BPTab::DrawLabel(BView* owner, BRect tabFrame) +{ + BTab::DrawLabel(owner, tabFrame); +} + +void BPTab::DrawTab(BView* owner, BRect tabFrame, tab_position value, bool full) +{ + BTab::DrawTab(owner, tabFrame, value, full); +} + + + +class BPTabView : public BTabView, virtual public BPView { +public: + BPTabView(TPasObject PasObject,BRect frame, const char *name, + button_width width=B_WIDTH_AS_USUAL, + uint32 resizingMode = B_FOLLOW_ALL, + uint32 flags = B_FULL_UPDATE_ON_RESIZE | + B_WILL_DRAW | B_NAVIGABLE_JUMP | + B_FRAME_EVENTS | B_NAVIGABLE); + + BPTabView(TPasObject PasObject,BMessage*); +static BArchivable* Instantiate(BMessage*); +//virtual status_t Archive(BMessage*, bool deep=true) const; +//virtual status_t Perform(perform_code d, void *arg); + +virtual void WindowActivated(bool state); +virtual void AttachedToWindow(); +virtual void AllAttached(); +virtual void AllDetached(); +virtual void DetachedFromWindow(); + +virtual void MessageReceived(BMessage *msg); +virtual void FrameResized(float w,float h); +virtual void KeyDown(const char * bytes, int32 n); +virtual void MouseDown(BPoint point); +virtual void MouseUp(BPoint point); +virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); +virtual void Pulse(); + +/* int32 FocusTab() const; + + virtual void BPTabView::AddTab(BView *target, BTab *tab); + virtual void Draw(BRect updateRect); + virtual void DrawBox(BRect selfTabRect); + virtual BRect DrawTabs(void); + virtual void MakeFocus(bool focused); + virtual BTab * RemoveTab(int32 tab_index); + virtual void Select(int32 tab); + virtual void SetFocusTab(int32 tab, bool focused); + virtual void SetTabHeight(float height); + virtual void SetTabWidth(button_width width); + virtual BTab * TabAt(int32 tab_index); + virtual BRect TabFrame(int32 tab_index); +*/ + +/*----- Private or reserved -----------------------------------------*/ +private: +}; + +BPTabView::BPTabView(TPasObject PasObject,BRect frame, const char *name, + button_width width=B_WIDTH_AS_USUAL, + uint32 resizingMode = B_FOLLOW_ALL, + uint32 flags = B_FULL_UPDATE_ON_RESIZE | + B_WILL_DRAW | B_NAVIGABLE_JUMP | + B_FRAME_EVENTS | B_NAVIGABLE) + :BTabView(frame, name, + width, + resizingMode, + flags), + BPView(PasObject, frame, name, resizingMode, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ +} + + +BPTabView::BPTabView(TPasObject PasObject, BMessage *data) + :BTabView(data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} +/* +void BPTabView::AddTab(BView *target, BTab *tab) +{ + BTabView::AddTab(target,tab); + //TabView_AddTab_hook(GetPasObject(), target, tab); +} + +void BPTabView::Draw(BRect updateRect) +{ + BTabView::Draw(updateRect); + TabView_Draw_hook(GetPasObject(), &updateRect); +} + +void BPTabView::DrawBox(BRect selfTabRect) +{ + BTabView::DrawBox(selfTabRect); + //TabView_DrawBox_hook(GetPasObject(), &selfTabRect); +} + +BRect BPTabView::DrawTabs(void) +{ + BTabView::DrawTabs(); + return TabView_DrawTabs_hook(GetPasObject()); +} + +void BPTabView::MakeFocus(bool focused) +{ + BTabView::MakeFocus(focused); + TabView_MakeFocus_hook(GetPasObject(), focused); +} + +BTab * BPTabView::RemoveTab(int32 tab_index) +{ + TabView_RemoveTab_hook(GetPasObject(), tab_index); + return BTabView::RemoveTab(tab_index); +} + +void BPTabView::Select(int32 tab) +{ + TabView_Select_hook(GetPasObject(), tab); + BTabView::Select(tab); +} + +void BPTabView::SetFocusTab(int32 tab, bool focused) +{ + TabView_SetFocusTab_hook(GetPasObject(), tab, focused); +} + +void BPTabView::SetTabHeight(float height) +{ + TabView_SetTabHeight_hook(GetPasObject(), height); +} + +void BPTabView::SetTabWidth(button_width width) +{ + TabView_SetTabWidth_hook(GetPasObject(), width); +} + +BTab * BPTabView::TabAt(int32 tab_index) +{ + return TabView_TabAt_hook(GetPasObject(), tab_index); +} + +BRect BPTabView::TabFrame(int32 tab_index) +{ + return TabView_TabFrame_hook(GetPasObject(), tab_index); +} +*/ + + + + +void BPTabView::Pulse(void) +{ + Pulse_hookCall(); + + BTabView::Pulse(); +} + + + +void BPTabView::MessageReceived(BMessage *message) +{ +// MessageReceived_hookCall(message); + BTabView::MessageReceived(message); +} + + +void BPTabView::AttachedToWindow(void) +{ + BTabView::AttachedToWindow(); +// AttachedToWindow_hookCall(); +} + + + +void BPTabView::AllAttached(void) +{ + //AllAttached_hookCall(); + BTabView::AllAttached(); +} + +void BPTabView::AllDetached(void) +{ + //AllDetached_hookCall(); + BTabView::AllDetached(); +} + + +void BPTabView::WindowActivated(bool active) +{ + BTabView::WindowActivated(active); +} + +void BPTabView::KeyDown(const char *bytes, int32 numBytes) +{ + BTabView::KeyDown(bytes, numBytes); +} + + +void BPTabView::FrameResized(float width, float height) +{ +// FrameResized_hookCall(width, height); + BTabView::FrameResized(width, height); +} + +void BPTabView::DetachedFromWindow(void) +{ + BTabView::DetachedFromWindow(); +} + + + +void BPTabView::MouseDown(BPoint point) +{ + BTabView::MouseDown(point); +} + +void BPTabView::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BTabView::MouseMoved(point, transit, message); +} + +void BPTabView::MouseUp(BPoint point) +{ + BTabView::MouseUp(point); +} + + + + +#if defined(__cplusplus) +extern "C" { +#endif + + + + +/*********************************************************************** + * Method: BTab::BTab + * Params: BView *contents + * Effects: + ***********************************************************************/ +TCPlusObject BTab_Create(TPasObject PasObject, BView *contents) +{ + return new BPTab(PasObject, contents); +} + + +/*********************************************************************** + * Method: BTab::~BTab + * Params: + * Effects: + ***********************************************************************/ +void BTab_Free(BTab *Tab) +{ + delete Tab; +} + + +/*********************************************************************** + * Method: BTab::BTab + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BTab_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPTab(PasObject, data); +} + + +/*********************************************************************** + * Method: BTab::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BTab_Instantiate(BTab *Tab, BMessage *data) +{ + return Tab->Instantiate(data); +} + + +/*********************************************************************** + * Method: BTab::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTab_Archive(BTab *Tab, BMessage *data, bool deep) +{ + return Tab->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BTab::Perform + * Params: uint32 d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTab_Perform(BTab *Tab, uint32 d, void *arg) +{ + return Tab->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BTab::Label + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BTab_Label(BTab *Tab) +{ + return Tab->Label(); +} + + +/*********************************************************************** + * Method: BTab::SetLabel + * Params: const char *label + * Returns: void + * Effects: + ***********************************************************************/ +void +BTab_SetLabel(BTab *Tab, const char *label) +{ + Tab->SetLabel(label); +} + + +/*********************************************************************** + * Method: BTab::IsSelected + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTab_IsSelected(BTab *Tab) +{ + return Tab->IsSelected(); +} + + +/*********************************************************************** + * Method: BTab::Select + * Params: BView *owner + * Returns: void + * Effects: + ***********************************************************************/ +void +BTab_Select(BTab *Tab, BView *owner) +{ + Tab->Select(owner); +} + + +/*********************************************************************** + * Method: BTab::Deselect + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTab_Deselect(BTab *Tab) +{ + Tab->Deselect(); +} + + +/*********************************************************************** + * Method: BTab::SetEnabled + * Params: bool on + * Returns: void + * Effects: + ***********************************************************************/ +void +BTab_SetEnabled(BTab *Tab, bool on) +{ + Tab->SetEnabled(on); +} + + +/*********************************************************************** + * Method: BTab::IsEnabled + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTab_IsEnabled(BTab *Tab) +{ + return Tab->IsEnabled(); +} + + +/*********************************************************************** + * Method: BTab::MakeFocus + * Params: bool infocus + * Returns: void + * Effects: + ***********************************************************************/ +void +BTab_MakeFocus(BTab *Tab, bool infocus) +{ + Tab->MakeFocus(infocus); +} + + +/*********************************************************************** + * Method: BTab::IsFocus + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTab_IsFocus(BTab *Tab) +{ + return Tab->IsFocus(); +} + + +/*********************************************************************** + * Method: BTab::SetView + * Params: BView *contents + * Returns: void + * Effects: + ***********************************************************************/ +void +BTab_SetView(BTab *Tab, BView *contents) +{ + Tab->SetView(contents); +} + + +/*********************************************************************** + * Method: BTab::View + * Params: + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BTab_View(BTab *Tab) +{ + return Tab->View(); +} + + +/*********************************************************************** + * Method: BTab::DrawFocusMark + * Params: BView *owner, BRect tabFrame + * Returns: void + * Effects: + ***********************************************************************/ +void +BTab_DrawFocusMark(BTab *Tab, BView *owner, BRect tabFrame) +{ + Tab->DrawFocusMark(owner, tabFrame); +} + + +/*********************************************************************** + * Method: BTab::DrawLabel + * Params: BView *owner, BRect tabFrame + * Returns: void + * Effects: + ***********************************************************************/ +void +BTab_DrawLabel(BTab *Tab, BView *owner, BRect tabFrame) +{ + Tab->DrawLabel(owner, tabFrame); +} + + +/*********************************************************************** + * Method: BTab::DrawTab + * Params: BView *owner, BRect tabFrame, tab_position, bool full + * Returns: void + * Effects: + ***********************************************************************/ +void +BTab_DrawTab(BTab *Tab, BView *owner, BRect tabFrame, int tab_position, bool full) +{ + //Tab->DrawTab(owner, tabFrame,tab_position , full); +} + + + +/*********************************************************************** + * Method: BTabView::~BTabView + * Params: + * Effects: + ***********************************************************************/ +void BTabView_Free(BTabView *TabView) +{ + delete TabView; +} + + +/*********************************************************************** + * Method: BTabView::BTabView + * Params: BMessage * + * Effects: + ***********************************************************************/ +TCPlusObject BTabView_Create_1(TPasObject PasObject, BMessage *msg) +{ + return new BPTabView(PasObject, msg); +} + +TCPlusObject BTabView_Create(TPasObject PasObject,BRect frame, const char *name, + button_width width=B_WIDTH_AS_USUAL, + uint32 resizingMode = B_FOLLOW_ALL, + uint32 flags = B_FULL_UPDATE_ON_RESIZE | + B_WILL_DRAW | B_NAVIGABLE_JUMP | + B_FRAME_EVENTS | B_NAVIGABLE) +{ + return new BPTabView( PasObject, frame, name, + width, + resizingMode, + flags ); +} + + + +/*********************************************************************** + * Method: BTabView::Instantiate + * Params: BMessage * + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BTabView_Instantiate(BTabView *TabView, BMessage *msg) +{ + return TabView->Instantiate(msg); +} + + +/*********************************************************************** + * Method: BTabView::Archive + * Params: BMessage *, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTabView_Archive(BTabView *TabView, BMessage *msg, bool deep) +{ + return TabView->Archive(msg, deep); +} + + +/*********************************************************************** + * Method: BTabView::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTabView_Perform(BTabView *TabView, perform_code d, void *arg) +{ + return TabView->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BTabView::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_WindowActivated(BTabView *TabView, bool state) +{ + TabView->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BTabView::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_AttachedToWindow(BTabView *TabView) +{ + TabView->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BTabView::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_AllAttached(BTabView *TabView) +{ + TabView->AllAttached(); +} + + +/*********************************************************************** + * Method: BTabView::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_AllDetached(BTabView *TabView) +{ + TabView->AllDetached(); +} + + +/*********************************************************************** + * Method: BTabView::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_DetachedFromWindow(BTabView *TabView) +{ + TabView->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BTabView::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_MessageReceived(BTabView *TabView, BMessage *msg) +{ + TabView->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BTabView::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_FrameMoved(BTabView *TabView, BPoint new_position) +{ + TabView->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BTabView::FrameResized + * Params: float w, float h + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_FrameResized(BTabView *TabView, float w, float h) +{ + TabView->FrameResized(w, h); +} + + +/*********************************************************************** + * Method: BTabView::KeyDown + * Params: const char *bytes, int32 n + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_KeyDown(BTabView *TabView, const char *bytes, int32 n) +{ + TabView->KeyDown(bytes, n); +} + + +/*********************************************************************** + * Method: BTabView::MouseDown + * Params: BPoint + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_MouseDown(BTabView *TabView, BPoint point) +{ + TabView->MouseDown(point); +} + + +/*********************************************************************** + * Method: BTabView::MouseUp + * Params: BPoint + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_MouseUp(BTabView *TabView, BPoint point) +{ + TabView->MouseUp(point); +} + + +/*********************************************************************** + * Method: BTabView::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_MouseMoved(BTabView *TabView, BPoint pt, uint32 code, const BMessage *msg) +{ + TabView->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BTabView::Pulse + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_Pulse(BTabView *TabView) +{ + TabView->Pulse(); +} + + +/*********************************************************************** + * Method: BTabView::Select + * Params: int32 tabIndex + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_Select(BTabView *TabView, int32 tabIndex) +{ + TabView->Select(tabIndex); +} + + +/*********************************************************************** + * Method: BTabView::Selection + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTabView_Selection_1 +(BTabView *TabView) +{ + return TabView->Selection(); +} + + +/*********************************************************************** + * Method: BTabView::MakeFocus + * Params: bool focusState + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_MakeFocus(BTabView *TabView, bool focusState) +{ + TabView->MakeFocus(focusState); +} + + +/*********************************************************************** + * Method: BTabView::SetFocusTab + * Params: int32 tabIndex, bool focusState + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_SetFocusTab(BTabView *TabView, int32 tabIndex, bool focusState) +{ + TabView->SetFocusTab(tabIndex, focusState); +} + + +/*********************************************************************** + * Method: BTabView::FocusTab + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTabView_FocusTab(BTabView *TabView) +{ + return TabView->FocusTab(); +} + + +/*********************************************************************** + * Method: BTabView::Draw + * Params: BRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_Draw(BTabView *TabView, BRect point) +{ + TabView->Draw(point); +} + + +/*********************************************************************** + * Method: BTabView::DrawTabs + * Params: + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BTabView_DrawTabs_1 +(BTabView *TabView) +{ + return TabView->DrawTabs(); +} + + +/*********************************************************************** + * Method: BTabView::DrawBox + * Params: BRect selectedTabFrame + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_DrawBox(BTabView *TabView, BRect selectedTabFrame) +{ + TabView->DrawBox(selectedTabFrame); +} + + +/*********************************************************************** + * Method: BTabView::TabFrame + * Params: int32 tabIndex + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BTabView_TabFrame(BTabView *TabView, int32 tabIndex) +{ + return TabView->TabFrame(tabIndex); +} + + +/*********************************************************************** + * Method: BTabView::SetFlags + * Params: uint32 flags + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_SetFlags(BTabView *TabView, uint32 flags) +{ + TabView->SetFlags(flags); +} + + +/*********************************************************************** + * Method: BTabView::SetResizingMode + * Params: uint32 mode + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_SetResizingMode(BTabView *TabView, uint32 mode) +{ + TabView->SetResizingMode(mode); +} + + +/*********************************************************************** + * Method: BTabView::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_GetPreferredSize(BTabView *TabView, float *width, float *height) +{ + TabView->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BTabView::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_ResizeToPreferred(BTabView *TabView) +{ + TabView->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BTabView::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BTabView_ResolveSpecifier(BTabView *TabView, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return TabView->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BTabView::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTabView_GetSupportedSuites(BTabView *TabView, BMessage *data) +{ + return TabView->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BTabView::AddTab + * Params: BView *tabContents, BTab *tab + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_AddTab(BTabView *TabView, BView *tabContents, BTab *tab) +{ + TabView->AddTab(tabContents, tab); +} + + +/*********************************************************************** + * Method: BTabView::RemoveTab + * Params: int32 tabIndex + * Returns: BTab * + * Effects: + ***********************************************************************/ +BTab * +BTabView_RemoveTab(BTabView *TabView, int32 tabIndex) +{ + return TabView->RemoveTab(tabIndex); +} + + +/*********************************************************************** + * Method: BTabView::RemoveTab + * Params: int32 tabIndex + * Returns: BTab * + * Effects: + ***********************************************************************/ +BTab * +BTabView_RemoveTab_1 +(BTabView *TabView, int32 tabIndex) +{ + return TabView->RemoveTab(tabIndex); +} + + +/*********************************************************************** + * Method: BTabView::TabAt + * Params: int32 tabIndex + * Returns: BTab * + * Effects: + ***********************************************************************/ +BTab * +BTabView_TabAt(BTabView *TabView, int32 tabIndex) +{ + return TabView->TabAt(tabIndex); +} + + +/*********************************************************************** + * Method: BTabView::SetTabWidth + * Params: button_width s + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_SetTabWidth(BTabView *TabView, button_width s) +{ + TabView->SetTabWidth(s); +} + + +/*********************************************************************** + * Method: BTabView::TabWidth + * Params: + * Returns: button_width + * Effects: + ***********************************************************************/ +button_width +BTabView_TabWidth(BTabView *TabView) +{ + return TabView->TabWidth(); +} + + +/*********************************************************************** + * Method: BTabView::SetTabHeight + * Params: float height + * Returns: void + * Effects: + ***********************************************************************/ +void +BTabView_SetTabHeight(BTabView *TabView, float height) +{ + TabView->SetTabHeight(height); +} + + +/*********************************************************************** + * Method: BTabView::TabHeight + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BTabView_TabHeight(BTabView *TabView) +{ + return TabView->TabHeight(); +} + + +/*********************************************************************** + * Method: BTabView::ContainerView + * Params: + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BTabView_ContainerView(BTabView *TabView) +{ + return TabView->ContainerView(); +} + + +/*********************************************************************** + * Method: BTabView::CountTabs + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTabView_CountTabs(BTabView *TabView) +{ + return TabView->CountTabs(); +} + + +/*********************************************************************** + * Method: BTabView::ViewForTab + * Params: int32 tabIndex + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BTabView_ViewForTab(BTabView *TabView, int32 tabIndex) +{ + return TabView->ViewForTab(tabIndex); +} + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _TABVIEW_CPP_ */ + diff --git a/bepascal/source/bepascal/cpp/src/be/interface/TextControl.cpp b/bepascal/source/bepascal/cpp/src/be/interface/TextControl.cpp new file mode 100644 index 0000000..c1cb8f9 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/TextControl.cpp @@ -0,0 +1,807 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _TEXTCONTROL_CPP_ +#define _TEXTCONTROL_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Button.cpp + * DATE: Tue Dec 3 00:28:35 2002 + * DESCR: + ***********************************************************************/ +#include "TextControl.h" + +#include "control.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(__cplusplus) +} +#endif + +class BPTextControl : public BTextControl, virtual public BPControl { + +public: + BPTextControl(TPasObject PasObject, + BRect frame, + const char *name, + const char *label, + const char *initial_text, + BMessage *message, + uint32 rmask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); +//virtual ~BPTextControl(); + + BPTextControl(TPasObject PasObject,BMessage *data); + +static BArchivable *Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +//virtual void SetText(const char *text); + const char *Text() const; + +virtual void SetValue(int32 value); +//virtual status_t Invoke(BMessage *msg = NULL); + + BTextView *TextView() const; + +//virtual void SetModificationMessage(BMessage *message); + BMessage *ModificationMessage() const; + +//virtual void SetAlignment(alignment label, alignment text); + void GetAlignment(alignment *label, alignment *text) const; +//virtual void SetDivider(float dividing_line); + float Divider() const; + +virtual void Draw(BRect updateRect); +virtual void MouseDown(BPoint where); +virtual void AttachedToWindow(); +//virtual void MakeFocus(bool focusState = true); +virtual void SetEnabled(bool state); +virtual void FrameMoved(BPoint new_position); +virtual void FrameResized(float new_width, float new_height); +virtual void WindowActivated(bool active); + +virtual void GetPreferredSize(float *width, float *height); +virtual void ResizeToPreferred(); + +virtual void MessageReceived(BMessage *msg); +/*virtual BHandler *ResolveSpecifier(BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property); +*/ +virtual void MouseUp(BPoint pt); +virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); +virtual void DetachedFromWindow(); + +virtual void AllAttached(); +virtual void AllDetached(); +//virtual status_t GetSupportedSuites(BMessage *data); +//virtual void SetFlags(uint32 flags); + + +/*----- Private or reserved -----------------------------------------*/ +//virtual status_t Perform(perform_code d, void *arg); + +private: +}; + + + +BPTextControl::BPTextControl(TPasObject PasObject, + BRect frame, + const char *name, + const char *label, + const char *initial_text, + BMessage *message, + uint32 rmask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE) + : + BTextControl(frame,name,label,initial_text, + message,rmask,flags), + BPControl(PasObject, frame, name, label, message, + rmask, flags), + BPView(PasObject, frame, name, rmask, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + +BPTextControl::BPTextControl(TPasObject PasObject, BMessage *archive) + :BTextControl(archive), + BPControl(PasObject, archive), + BPView(PasObject, archive), + BPHandler(PasObject, archive), + BPasObject(PasObject) +{ + +} + +void BPTextControl::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BTextControl::MessageReceived(message); +} + +void BPTextControl::Draw(BRect updateRect) +{ + BTextControl::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPTextControl::AttachedToWindow(void) +{ + BTextControl::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + +void BPTextControl::WindowActivated(bool active) +{ + BTextControl::WindowActivated(active); +} + +void BPTextControl::AllAttached(void) +{ + BTextControl::AllAttached(); +} + +void BPTextControl::AllDetached(void) +{ + BTextControl::AllDetached(); +} + +void BPTextControl::DetachedFromWindow(void) +{ + BTextControl::DetachedFromWindow(); +} + + +void BPTextControl::FrameMoved(BPoint parentPoint) +{ + BTextControl::FrameMoved(parentPoint); +} + +void BPTextControl::FrameResized(float width, float height) +{ + BTextControl::FrameResized(width, height); +} + +void BPTextControl::GetPreferredSize(float *width, float *height) +{ + BTextControl::GetPreferredSize(width, height); +} + +void BPTextControl::ResizeToPreferred(void) +{ + BTextControl::ResizeToPreferred(); +} + + + +void BPTextControl::MouseDown(BPoint point) +{ + BTextControl::MouseDown(point); +} + +void BPTextControl::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BTextControl::MouseMoved(point, transit, message); +} + +void BPTextControl::MouseUp(BPoint point) +{ + BTextControl::MouseUp(point); +} + + +//void BPButton::TargetedByScrollView(BScrollView *scroller) +//{ +// BButton::TargetedByScrollView(scroller); +//} + +void BPTextControl::SetEnabled(bool enabled) +{ + BTextControl::SetEnabled(enabled); +} + +void BPTextControl::SetValue(int32 value) +{ + BTextControl::SetValue(value); +} + + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * AUTHOR: nobody + * FILE: TextControl.cpp + * DATE: Tue Jan 14 21:35:44 2003 + * DESCR: + ***********************************************************************/ + +/*********************************************************************** + * Method: BTextControl::~BTextControl + * Params: + * Effects: + ***********************************************************************/ +void BTextControl_Free(BTextControl *TextControl) +{ + delete TextControl; +} + +TCPlusObject BTextControl_Create(TPasObject PasObject, BRect frame, + const char *name, + const char *label, + const char *initial_text, + BMessage *message, + uint32 resizeMask, + uint32 flags) +{ + return new BPTextControl(PasObject, frame, name, label,initial_text, message, resizeMask, flags); +} + +/*********************************************************************** + * Method: BTextControl::BTextControl + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BTextControl_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPTextControl(PasObject, data); +} + + +/*********************************************************************** + * Method: BTextControl::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BTextControl_Instantiate(BTextControl *TextControl, BMessage *data) +{ + return TextControl->Instantiate(data); +} + + +/*********************************************************************** + * Method: BTextControl::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTextControl_Archive(BTextControl *TextControl, BMessage *data, bool deep) +{ + return TextControl->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BTextControl::SetText + * Params: const char *text + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_SetText(BTextControl *TextControl, const char *text) +{ + TextControl->SetText(text); +} + + +/*********************************************************************** + * Method: BTextControl::Text + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BTextControl_Text(BTextControl *TextControl) +{ + return TextControl->Text(); +} + + +/*********************************************************************** + * Method: BTextControl::SetValue + * Params: int32 value + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_SetValue(BTextControl *TextControl, int32 value) +{ + TextControl->SetValue(value); +} + + +/*********************************************************************** + * Method: BTextControl::Invoke + * Params: BMessage *msg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTextControl_Invoke(BTextControl *TextControl, BMessage *msg) +{ + return TextControl->Invoke(msg); +} + + +/*********************************************************************** + * Method: BTextControl::TextView + * Params: + * Returns: BTextView * + * Effects: + ***********************************************************************/ +BTextView * +BTextControl_TextView(BTextControl *TextControl) +{ + return TextControl->TextView(); +} + + +/*********************************************************************** + * Method: BTextControl::SetModificationMessage + * Params: BMessage *message + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_SetModificationMessage(BTextControl *TextControl, BMessage *message) +{ + TextControl->SetModificationMessage(message); +} + + +/*********************************************************************** + * Method: BTextControl::ModificationMessage + * Params: + * Returns: BMessage * + * Effects: + ***********************************************************************/ +BMessage * +BTextControl_ModificationMessage(BTextControl *TextControl) +{ + return TextControl->ModificationMessage(); +} + + +/*********************************************************************** + * Method: BTextControl::SetAlignment + * Params: alignment label, alignment text + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_SetAlignment(BTextControl *TextControl, alignment label, alignment text) +{ + TextControl->SetAlignment(label, text); +} + + +/*********************************************************************** + * Method: BTextControl::GetAlignment + * Params: alignment *label, alignment *text + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_GetAlignment(BTextControl *TextControl, alignment *label, alignment *text) +{ + TextControl->GetAlignment(label, text); +} + + +/*********************************************************************** + * Method: BTextControl::SetDivider + * Params: float dividing_line + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_SetDivider(BTextControl *TextControl, float dividing_line) +{ + TextControl->SetDivider(dividing_line); +} + + +/*********************************************************************** + * Method: BTextControl::Divider + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BTextControl_Divider(BTextControl *TextControl) +{ + return TextControl->Divider(); +} + + +/*********************************************************************** + * Method: BTextControl::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_Draw(BTextControl *TextControl, BRect updateRect) +{ + TextControl->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BTextControl::MouseDown + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_MouseDown(BTextControl *TextControl, BPoint where) +{ + TextControl->MouseDown(where); +} + + +/*********************************************************************** + * Method: BTextControl::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_AttachedToWindow(BTextControl *TextControl) +{ + TextControl->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BTextControl::MakeFocus + * Params: bool focusState + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_MakeFocus(BTextControl *TextControl, bool focusState) +{ + TextControl->MakeFocus(focusState); +} + + +/*********************************************************************** + * Method: BTextControl::SetEnabled + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_SetEnabled(BTextControl *TextControl, bool state) +{ + TextControl->SetEnabled(state); +} + + +/*********************************************************************** + * Method: BTextControl::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_FrameMoved(BTextControl *TextControl, BPoint new_position) +{ + TextControl->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BTextControl::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_FrameResized(BTextControl *TextControl, float new_width, float new_height) +{ + TextControl->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BTextControl::WindowActivated + * Params: bool active + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_WindowActivated(BTextControl *TextControl, bool active) +{ + TextControl->WindowActivated(active); +} + + +/*********************************************************************** + * Method: BTextControl::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_GetPreferredSize(BTextControl *TextControl, float *width, float *height) +{ + TextControl->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BTextControl::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_ResizeToPreferred(BTextControl *TextControl) +{ + TextControl->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BTextControl::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_MessageReceived(BTextControl *TextControl, BMessage *msg) +{ + TextControl->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BTextControl::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BTextControl_ResolveSpecifier(BTextControl *TextControl, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return TextControl->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BTextControl::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_MouseUp(BTextControl *TextControl, BPoint pt) +{ + TextControl->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BTextControl::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_MouseMoved(BTextControl *TextControl, BPoint pt, uint32 code, const BMessage *msg) +{ + TextControl->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BTextControl::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_DetachedFromWindow(BTextControl *TextControl) +{ + TextControl->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BTextControl::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_AllAttached(BTextControl *TextControl) +{ + TextControl->AllAttached(); +} + + +/*********************************************************************** + * Method: BTextControl::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_AllDetached(BTextControl *TextControl) +{ + TextControl->AllDetached(); +} + + +/*********************************************************************** + * Method: BTextControl::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTextControl_GetSupportedSuites(BTextControl *TextControl, BMessage *data) +{ + return TextControl->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BTextControl::SetFlags + * Params: uint32 flags + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextControl_SetFlags(BTextControl *TextControl, uint32 flags) +{ + TextControl->SetFlags(flags); +} + + +/*********************************************************************** + * Method: BTextControl::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTextControl_Perform(BTextControl *TextControl, perform_code d, void *arg) +{ + return TextControl->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BTextControl::_ReservedTextControl1 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BTextControl__ReservedTextControl1(BTextControl *TextControl) +{ + TextControl->_ReservedTextControl1(); +} +*/ + +/*********************************************************************** + * Method: BTextControl::_ReservedTextControl2 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BTextControl__ReservedTextControl2(BTextControl *TextControl) +{ + TextControl->_ReservedTextControl2(); +} +*/ + +/*********************************************************************** + * Method: BTextControl::_ReservedTextControl3 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BTextControl__ReservedTextControl3(BTextControl *TextControl) +{ + TextControl->_ReservedTextControl3(); +} + +*/ +/*********************************************************************** + * Method: BTextControl::_ReservedTextControl4 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BTextControl__ReservedTextControl4(BTextControl *TextControl) +{ + TextControl->_ReservedTextControl4(); +} +*/ + +/*********************************************************************** + * Method: BTextControl::operator= + * Params: const BTextControl & + * Returns: BTextControl & + * Effects: + ***********************************************************************/ +/*BTextControl & +BTextControl_operator=(BTextControl *TextControl, const BTextControl &) +{ + return TextControl->operator=(); +} +*/ + +/*********************************************************************** + * Method: BTextControl::CommitValue + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BTextControl_CommitValue(BTextControl *TextControl) +{ + TextControl->CommitValue(); +} +*/ + +/*********************************************************************** + * Method: BTextControl::InitData + * Params: const char *label, const char *initial_text, BMessage *data + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BTextControl_InitData(BTextControl *TextControl, const char *label, const char *initial_text, BMessage *data) +{ + TextControl->InitData(label, initial_text, data); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _TextControl_CPP_ */ + diff --git a/bepascal/source/bepascal/cpp/src/be/interface/TextView.cpp b/bepascal/source/bepascal/cpp/src/be/interface/TextView.cpp new file mode 100644 index 0000000..83329e6 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/TextView.cpp @@ -0,0 +1,1684 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _TEXTVIEW_CPP_ +#define _TEXTVIEW_CPP_ +/*********************************************************************** + * AUTHOR: nobody + * FILE: StringView.cpp + * DATE: Mon Jan 13 21:52:29 2003 + * DESCR: + ***********************************************************************/ +#include "TextView.h" +#include "view.h" +#include + + + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(__cplusplus) +} +#endif + +class BPTextView : public BTextView, virtual public BPView { +public: + BPTextView(TPasObject PasObject, + BRect frame, + const char *name, + BRect textRect, + uint32 resizeMask, + uint32 flags = B_WILL_DRAW | B_PULSE_NEEDED); + BPTextView(TPasObject PasObject, + BRect frame, + const char *name, + BRect textRect, + const BFont *initialFont, + const rgb_color *initialColor, + uint32 resizeMask, + uint32 flags); + BPTextView(TPasObject PasObject,BMessage *data); + +static BArchivable* Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +virtual void AttachedToWindow(); +virtual void DetachedFromWindow(); +virtual void Draw(BRect inRect); +virtual void MouseDown(BPoint where); +virtual void MouseUp(BPoint where); +virtual void MouseMoved(BPoint where, + uint32 code, + const BMessage *message); +virtual void WindowActivated(bool state); +virtual void KeyDown(const char *bytes, int32 numBytes); +virtual void Pulse(); +virtual void FrameResized(float width, float height); +//virtual void MakeFocus(bool focusState = true); +virtual void MessageReceived(BMessage *message); +/*virtual BHandler* ResolveSpecifier(BMessage *message, + int32 index, + BMessage *specifier, + int32 form, + const char *property);*/ +//virtual status_t GetSupportedSuites(BMessage *data); +//virtual status_t Perform(perform_code d, void *arg); + + void SetText(const char *inText, + const text_run_array *inRuns = NULL); + void SetText(const char *inText, + int32 inLength, + const text_run_array *inRuns = NULL); + void SetText(BFile *inFile, + int32 startOffset, + int32 inLength, + const text_run_array *inRuns = NULL); + + void Insert(const char *inText, + const text_run_array *inRuns = NULL); + void Insert(const char *inText, + int32 inLength, + const text_run_array *inRuns = NULL); + void Insert(int32 startOffset, + const char *inText, + int32 inLength, + const text_run_array *inRuns = NULL); + + void Delete(); + void Delete(int32 startOffset, int32 endOffset); + + const char* Text() const; + int32 TextLength() const; + void GetText(int32 offset, + int32 length, + char *buffer) const; + uchar ByteAt(int32 offset) const; + + int32 CountLines() const; + int32 CurrentLine() const; + void GoToLine(int32 lineNum); + +//virtual void Cut(BClipboard *clipboard); +//virtual void Copy(BClipboard *clipboard); +//virtual void Paste(BClipboard *clipboard); + void Clear(); + +//virtual bool AcceptsPaste(BClipboard *clipboard); +//virtual bool AcceptsDrop(const BMessage *inMessage); + +//virtual void Select(int32 startOffset, int32 endOffset); + void SelectAll(); + void GetSelection(int32 *outStart, int32 *outEnd) const; + + void SetFontAndColor(const BFont *inFont, + uint32 inMode = B_FONT_ALL, + const rgb_color *inColor = NULL); + void SetFontAndColor(int32 startOffset, + int32 endOffset, + const BFont *inFont, + uint32 inMode = B_FONT_ALL, + const rgb_color *inColor = NULL); + + void GetFontAndColor(int32 inOffset, + BFont *outFont, + rgb_color *outColor = NULL) const; + void GetFontAndColor(BFont *outFont, + uint32 *outMode, + rgb_color *outColor = NULL, + bool *outEqColor = NULL) const; + + void SetRunArray(int32 startOffset, + int32 endOffset, + const text_run_array *inRuns); + text_run_array* RunArray(int32 startOffset, + int32 endOffset, + int32 *outSize = NULL) const; + + int32 LineAt(int32 offset) const; + int32 LineAt(BPoint point) const; + BPoint PointAt(int32 inOffset, float *outHeight = NULL) const; + int32 OffsetAt(BPoint point) const; + int32 OffsetAt(int32 line) const; + +/*virtual void FindWord(int32 inOffset, + int32 *outFromOffset, + int32 *outToOffset); + +virtual bool CanEndLine(int32 offset); +*/ + float LineWidth(int32 lineNum = 0) const; + float LineHeight(int32 lineNum = 0) const; + float TextHeight(int32 startLine, int32 endLine) const; + + void GetTextRegion(int32 startOffset, + int32 endOffset, + BRegion *outRegion) const; + +//virtual void ScrollToOffset(int32 inOffset); + void ScrollToSelection(); + + void Highlight(int32 startOffset, int32 endOffset); + + void SetTextRect(BRect rect); + BRect TextRect() const; + void SetStylable(bool stylable); + bool IsStylable() const; + void SetTabWidth(float width); + float TabWidth() const; + void MakeSelectable(bool selectable = true); + bool IsSelectable() const; + void MakeEditable(bool editable = true); + bool IsEditable() const; + void SetWordWrap(bool wrap); + bool DoesWordWrap() const; + void SetMaxBytes(int32 max); + int32 MaxBytes() const; + void DisallowChar(uint32 aChar); + void AllowChar(uint32 aChar); + void SetAlignment(alignment flag); + alignment Alignment() const; + void SetAutoindent(bool state); + bool DoesAutoindent() const; + void SetColorSpace(color_space colors); + color_space ColorSpace() const; + void MakeResizable(bool resize, BView *resizeView = NULL); + bool IsResizable() const; + void SetDoesUndo(bool undo); + bool DoesUndo() const; + void HideTyping(bool enabled); + bool IsTypingHidden(void) const; + +//virtual void ResizeToPreferred(); +//virtual void GetPreferredSize(float *width, float *height); +virtual void AllAttached(); +virtual void AllDetached(); + +static void* FlattenRunArray(const text_run_array *inArray, + int32 *outSize = NULL); +static text_run_array* UnflattenRunArray(const void *data, + int32 *outSize = NULL); + private : +}; + +BPTextView::BPTextView(TPasObject PasObject, + BRect frame, + const char *name, + BRect textRect, + uint32 resizeMask, + uint32 flags = B_WILL_DRAW | B_PULSE_NEEDED) + : + BTextView( frame, + name, + textRect, + resizeMask, + flags), + BPView(PasObject, BRect(0,0,0,0), name, 0, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + +BPTextView::BPTextView(TPasObject PasObject, + BRect frame, + const char *name, + BRect textRect, + const BFont *initialFont, + const rgb_color *initialColor, + uint32 resizeFlags, + uint32 flags) + : + BTextView( frame, + name, + textRect, + initialFont, + initialColor, + resizeFlags, + flags), + BPView(PasObject, BRect(0,0,0,0), name, 0, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + + +BPTextView::BPTextView(TPasObject PasObject, BMessage *data) + :BTextView(data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} + +void BPTextView::Pulse(void) +{ + Pulse_hookCall(); + + BTextView::Pulse(); +} + + +void BPTextView::KeyDown(const char *bytes, int32 numBytes) +{ + KeyDown_hookCall(bytes,numBytes); + BTextView::KeyDown(bytes,numBytes); +} + + + + +void BPTextView::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BTextView::MessageReceived(message); +} + +void BPTextView::Draw(BRect updateRect) +{ + BTextView::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPTextView::AttachedToWindow(void) +{ + //BTextView::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + + +void BPTextView::AllAttached(void) +{ + //AllAttached_hookCall(); + BTextView::AllAttached(); +} + +void BPTextView::AllDetached(void) +{ + //AllDetached_hookCall(); + BTextView::AllDetached(); +} + + +void BPTextView::WindowActivated(bool active) +{ + BTextView::WindowActivated(active); +} + + + +void BPTextView::FrameResized(float width, float height) +{ + FrameResized_hookCall(width, height); + BTextView::FrameResized(width, height); +} + +void BPTextView::DetachedFromWindow(void) +{ + BTextView::DetachedFromWindow(); +} + + + +void BPTextView::MouseDown(BPoint point) +{ + BTextView::MouseDown(point); +} + +void BPTextView::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BTextView::MouseMoved(point, transit, message); +} + +void BPTextView::MouseUp(BPoint point) +{ + BTextView::MouseUp(point); +} + + + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * Method: BTextView::BTextView + * Params: BRect frame, const char *name, BRect textRect, const BFont *initialFont, const rgb_color *initialColor, uint32 resizeMask, uint32 flags + * Effects: + ***********************************************************************/ +TCPlusObject BTextView_Create(TPasObject PasObject, + BRect frame, + const char *name, + BRect textRect, + uint32 resizeMask, + uint32 flags ) + +{ + return new BPTextView(PasObject, frame, name, textRect, resizeMask, flags); +} + +TCPlusObject BTextView_Create_1(TPasObject PasObject, BRect frame, const char *name, BRect textRect, const BFont *initialFont, const rgb_color *initialColor, uint32 resizeMask, uint32 flags) +{ + return new BPTextView(PasObject, frame, name, textRect, initialFont, initialColor, resizeMask, flags); +} + + +/*********************************************************************** + * Method: BTextView::BTextView + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BTextView_Create_2 +(TPasObject PasObject, BMessage *data) +{ + return new BPTextView(PasObject, data); +} + + +/*********************************************************************** + * Method: BTextView::~BTextView + * Params: + * Effects: + ***********************************************************************/ +void BTextView_FREE(BTextView *TextView) +{ + delete TextView; +} + + +/*********************************************************************** + * Method: BTextView::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BTextView_Instantiate(BTextView *TextView, BMessage *data) +{ + return TextView->Instantiate(data); +} + + +/*********************************************************************** + * Method: BTextView::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTextView_Archive(BTextView *TextView, BMessage *data, bool deep) +{ + return TextView->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BTextView::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_AttachedToWindow(BTextView *TextView) +{ + TextView->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BTextView::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_DetachedFromWindow(BTextView *TextView) +{ + TextView->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BTextView::Draw + * Params: BRect inRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Draw(BTextView *TextView, BRect inRect) +{ + TextView->Draw(inRect); +} + + +/*********************************************************************** + * Method: BTextView::MouseDown + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MouseDown(BTextView *TextView, BPoint where) +{ + TextView->MouseDown(where); +} + + +/*********************************************************************** + * Method: BTextView::MouseUp + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MouseUp(BTextView *TextView, BPoint where) +{ + TextView->MouseUp(where); +} + + +/*********************************************************************** + * Method: BTextView::MouseMoved + * Params: BPoint where, uint32 code, const BMessage *message + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MouseMoved(BTextView *TextView, BPoint where, uint32 code, const BMessage *message) +{ + TextView->MouseMoved(where, code, message); +} + + +/*********************************************************************** + * Method: BTextView::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_WindowActivated(BTextView *TextView, bool state) +{ + TextView->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BTextView::KeyDown + * Params: const char *bytes, int32 numBytes + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_KeyDown(BTextView *TextView, const char *bytes, int32 numBytes) +{ + TextView->KeyDown(bytes, numBytes); +} + + +/*********************************************************************** + * Method: BTextView::Pulse + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Pulse(BTextView *TextView) +{ + TextView->Pulse(); +} + + +/*********************************************************************** + * Method: BTextView::FrameResized + * Params: float width, float height + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_FrameResized(BTextView *TextView, float width, float height) +{ + TextView->FrameResized(width, height); +} + + +/*********************************************************************** + * Method: BTextView::MakeFocus + * Params: bool focusState + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MakeFocus(BTextView *TextView, bool focusState) +{ + TextView->MakeFocus(focusState); +} + + +/*********************************************************************** + * Method: BTextView::MessageReceived + * Params: BMessage *message + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MessageReceived(BTextView *TextView, BMessage *message) +{ + TextView->MessageReceived(message); +} + + +/*********************************************************************** + * Method: BTextView::ResolveSpecifier + * Params: BMessage *message, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BTextView_ResolveSpecifier(BTextView *TextView, BMessage *message, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return TextView->ResolveSpecifier(message, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BTextView::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTextView_GetSupportedSuites(BTextView *TextView, BMessage *data) +{ + return TextView->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BTextView::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTextView_Perform(BTextView *TextView, perform_code d, void *arg) +{ + return TextView->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BTextView::SetText + * Params: const char *inText, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetText(BTextView *TextView, const char *inText, const text_run_array *inRuns) +{ + TextView->SetText(inText, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::SetText + * Params: const char *inText, int32 inLength, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetText_1 +(BTextView *TextView, const char *inText, int32 inLength, const text_run_array *inRuns) +{ + TextView->SetText(inText, inLength, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::SetText + * Params: BFile *inFile, int32 startOffset, int32 inLength, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetText_2 +(BTextView *TextView, BFile *inFile, int32 startOffset, int32 inLength, const text_run_array *inRuns) +{ + TextView->SetText(inFile, startOffset, inLength, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::Insert + * Params: const char *inText, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Insert(BTextView *TextView, const char *inText, const text_run_array *inRuns) +{ + TextView->Insert(inText, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::Insert + * Params: const char *inText, int32 inLength, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Insert_1 +(BTextView *TextView, const char *inText, int32 inLength, const text_run_array *inRuns) +{ + TextView->Insert(inText, inLength, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::Insert + * Params: int32 startOffset, const char *inText, int32 inLength, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Insert_2 +(BTextView *TextView, int32 startOffset, const char *inText, int32 inLength, const text_run_array *inRuns) +{ + TextView->Insert(startOffset, inText, inLength, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::Delete + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Delete(BTextView *TextView) +{ + TextView->Delete(); +} + + +/*********************************************************************** + * Method: BTextView::Delete + * Params: int32 startOffset, int32 endOffset + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Delete_1 +(BTextView *TextView, int32 startOffset, int32 endOffset) +{ + TextView->Delete(startOffset, endOffset); +} + + +/*********************************************************************** + * Method: BTextView::Text + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BTextView_Text(BTextView *TextView) +{ + return TextView->Text(); +} + + +/*********************************************************************** + * Method: BTextView::TextLength + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_TextLength +(BTextView *TextView) +{ + return TextView->TextLength(); +} + + +/*********************************************************************** + * Method: BTextView::GetText + * Params: int32 offset, int32 length, char *buffer + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetText(BTextView *TextView, int32 offset, int32 length, char *buffer) +{ + TextView->GetText(offset, length, buffer); +} + + +/*********************************************************************** + * Method: BTextView::ByteAt + * Params: int32 offset + * Returns: uchar + * Effects: + ***********************************************************************/ +uchar +BTextView_ByteAt(BTextView *TextView, int32 offset) +{ + return TextView->ByteAt(offset); +} + + +/*********************************************************************** + * Method: BTextView::CountLines + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_CountLines(BTextView *TextView) +{ + return TextView->CountLines(); +} + + +/*********************************************************************** + * Method: BTextView::CurrentLine + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_CurrentLine(BTextView *TextView) +{ + return TextView->CurrentLine(); +} + + +/*********************************************************************** + * Method: BTextView::GoToLine + * Params: int32 lineNum + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GoToLine(BTextView *TextView, int32 lineNum) +{ + TextView->GoToLine(lineNum); +} + + +/*********************************************************************** + * Method: BTextView::Cut + * Params: BClipboard *clipboard + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Cut(BTextView *TextView, BClipboard *clipboard) +{ + TextView->Cut(clipboard); +} + + +/*********************************************************************** + * Method: BTextView::Copy + * Params: BClipboard *clipboard + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Copy(BTextView *TextView, BClipboard *clipboard) +{ + TextView->Copy(clipboard); +} + + +/*********************************************************************** + * Method: BTextView::Paste + * Params: BClipboard *clipboard + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Paste(BTextView *TextView, BClipboard *clipboard) +{ + TextView->Paste(clipboard); +} + + +/*********************************************************************** + * Method: BTextView::Clear + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Clear(BTextView *TextView) +{ + TextView->Clear(); +} + + +/*********************************************************************** + * Method: BTextView::AcceptsPaste + * Params: BClipboard *clipboard + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_AcceptsPaste(BTextView *TextView, BClipboard *clipboard) +{ + return TextView->AcceptsPaste(clipboard); +} + + +/*********************************************************************** + * Method: BTextView::AcceptsDrop + * Params: const BMessage *inMessage + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_AcceptsDrop(BTextView *TextView, const BMessage *inMessage) +{ + return TextView->AcceptsDrop(inMessage); +} + + +/*********************************************************************** + * Method: BTextView::Select + * Params: int32 startOffset, int32 endOffset + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Select(BTextView *TextView, int32 startOffset, int32 endOffset) +{ + TextView->Select(startOffset, endOffset); +} + + +/*********************************************************************** + * Method: BTextView::SelectAll + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SelectAll +(BTextView *TextView) +{ + TextView->SelectAll(); +} + + +/*********************************************************************** + * Method: BTextView::GetSelection + * Params: int32 *outStart, int32 *outEnd + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetSelection(BTextView *TextView, int32 *outStart, int32 *outEnd) +{ + TextView->GetSelection(outStart, outEnd); +} + + +/*********************************************************************** + * Method: BTextView::SetFontAndColor + * Params: const BFont *inFont, uint32 inMode, const rgb_color *inColor + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetFontAndColor(BTextView *TextView, const BFont *inFont, uint32 inMode, const rgb_color *inColor) +{ + TextView->SetFontAndColor(inFont, inMode, inColor); +} + + +/*********************************************************************** + * Method: BTextView::SetFontAndColor + * Params: int32 startOffset, int32 endOffset, const BFont *inFont, uint32 inMode, const rgb_color *inColor + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetFontAndColor_1 +(BTextView *TextView, int32 startOffset, int32 endOffset, const BFont *inFont, uint32 inMode, const rgb_color *inColor) +{ + TextView->SetFontAndColor(startOffset, endOffset, inFont, inMode, inColor); +} + + +/*********************************************************************** + * Method: BTextView::GetFontAndColor + * Params: int32 inOffset, BFont *outFont, rgb_color *outColor + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetFontAndColor(BTextView *TextView, int32 inOffset, BFont *outFont, rgb_color *outColor) +{ + TextView->GetFontAndColor(inOffset, outFont, outColor); +} + + +/*********************************************************************** + * Method: BTextView::GetFontAndColor + * Params: BFont *outFont, uint32 *outMode, rgb_color *outColor, bool *outEqColor + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetFontAndColor_1 +(BTextView *TextView, BFont *outFont, uint32 *outMode, rgb_color *outColor, bool *outEqColor) +{ + TextView->GetFontAndColor(outFont, outMode, outColor, outEqColor); +} + + +/*********************************************************************** + * Method: BTextView::SetRunArray + * Params: int32 startOffset, int32 endOffset, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetRunArray(BTextView *TextView, int32 startOffset, int32 endOffset, const text_run_array *inRuns) +{ + TextView->SetRunArray(startOffset, endOffset, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::RunArray + * Params: int32 startOffset, int32 endOffset, int32 *outSize + * Returns: text_run_array * + * Effects: + ***********************************************************************/ +text_run_array * +BTextView_RunArray(BTextView *TextView, int32 startOffset, int32 endOffset, int32 *outSize) +{ + return TextView->RunArray(startOffset, endOffset, outSize); +} + + +/*********************************************************************** + * Method: BTextView::LineAt + * Params: int32 offset + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_LineAt(BTextView *TextView, int32 offset) +{ + return TextView->LineAt(offset); +} + + +/*********************************************************************** + * Method: BTextView::LineAt + * Params: BPoint point + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_LineAt_1 +(BTextView *TextView, BPoint point) +{ + return TextView->LineAt(point); +} + + +/*********************************************************************** + * Method: BTextView::PointAt + * Params: int32 inOffset, float *outHeight + * Returns: BPoint + * Effects: + ***********************************************************************/ +BPoint +BTextView_PointAt(BTextView *TextView, int32 inOffset, float *outHeight) +{ + return TextView->PointAt(inOffset, outHeight); +} + + +/*********************************************************************** + * Method: BTextView::OffsetAt + * Params: BPoint point + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_OffsetAt(BTextView *TextView, BPoint point) +{ + return TextView->OffsetAt(point); +} + + +/*********************************************************************** + * Method: BTextView::OffsetAt + * Params: int32 line + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_OffsetAt_1 +(BTextView *TextView, int32 line) +{ + return TextView->OffsetAt(line); +} + + +/*********************************************************************** + * Method: BTextView::FindWord + * Params: int32 inOffset, int32 *outFromOffset, int32 *outToOffset + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_FindWord(BTextView *TextView, int32 inOffset, int32 *outFromOffset, int32 *outToOffset) +{ + TextView->FindWord(inOffset, outFromOffset, outToOffset); +} + + +/*********************************************************************** + * Method: BTextView::CanEndLine + * Params: int32 offset + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_CanEndLine(BTextView *TextView, int32 offset) +{ + return TextView->CanEndLine(offset); +} + + +/*********************************************************************** + * Method: BTextView::LineWidth + * Params: int32 lineNum + * Returns: float + * Effects: + ***********************************************************************/ +float +BTextView_LineWidth(BTextView *TextView, int32 lineNum) +{ + return TextView->LineWidth(lineNum); +} + + +/*********************************************************************** + * Method: BTextView::LineHeight + * Params: int32 lineNum + * Returns: float + * Effects: + ***********************************************************************/ +float +BTextView_LineHeight(BTextView *TextView, int32 lineNum) +{ + return TextView->LineHeight(lineNum); +} + + +/*********************************************************************** + * Method: BTextView::TextHeight + * Params: int32 startLine, int32 endLine + * Returns: float + * Effects: + ***********************************************************************/ +float +BTextView_TextHeight(BTextView *TextView, int32 startLine, int32 endLine) +{ + return TextView->TextHeight(startLine, endLine); +} + + +/*********************************************************************** + * Method: BTextView::GetTextRegion + * Params: int32 startOffset, int32 endOffset, BRegion *outRegion + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetTextRegion(BTextView *TextView, int32 startOffset, int32 endOffset, BRegion *outRegion) +{ + TextView->GetTextRegion(startOffset, endOffset, outRegion); +} + + +/*********************************************************************** + * Method: BTextView::ScrollToOffset + * Params: int32 inOffset + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_ScrollToOffset(BTextView *TextView, int32 inOffset) +{ + TextView->ScrollToOffset(inOffset); +} + + +/*********************************************************************** + * Method: BTextView::ScrollToSelection + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_ScrollToSelection(BTextView *TextView) +{ + TextView->ScrollToSelection(); +} + + +/*********************************************************************** + * Method: BTextView::Highlight + * Params: int32 startOffset, int32 endOffset + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Highlight(BTextView *TextView, int32 startOffset, int32 endOffset) +{ + TextView->Highlight(startOffset, endOffset); +} + + +/*********************************************************************** + * Method: BTextView::SetTextRect + * Params: BRect rect + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetTextRect(BTextView *TextView, BRect rect) +{ + TextView->SetTextRect(rect); +} + + +/*********************************************************************** + * Method: BTextView::TextRect + * Params: + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BTextView_TextRect(BTextView *TextView) +{ + return TextView->TextRect(); +} + + +/*********************************************************************** + * Method: BTextView::SetStylable + * Params: bool stylable + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetStylable(BTextView *TextView, bool stylable) +{ + TextView->SetStylable(stylable); +} + + +/*********************************************************************** + * Method: BTextView::IsStylable + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_IsStylable(BTextView *TextView) +{ + return TextView->IsStylable(); +} + + +/*********************************************************************** + * Method: BTextView::SetTabWidth + * Params: float width + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetTabWidth(BTextView *TextView, float width) +{ + TextView->SetTabWidth(width); +} + + +/*********************************************************************** + * Method: BTextView::TabWidth + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BTextView_TabWidth(BTextView *TextView) +{ + return TextView->TabWidth(); +} + + +/*********************************************************************** + * Method: BTextView::MakeSelectable + * Params: bool selectable + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MakeSelectable(BTextView *TextView, bool selectable) +{ + TextView->MakeSelectable(selectable); +} + + +/*********************************************************************** + * Method: BTextView::IsSelectable + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_IsSelectable(BTextView *TextView) +{ + return TextView->IsSelectable(); +} + + +/*********************************************************************** + * Method: BTextView::MakeEditable + * Params: bool editable + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MakeEditable(BTextView *TextView, bool editable) +{ + TextView->MakeEditable(editable); +} + + +/*********************************************************************** + * Method: BTextView::IsEditable + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_IsEditable(BTextView *TextView) +{ + return TextView->IsEditable(); +} + + +/*********************************************************************** + * Method: BTextView::SetWordWrap + * Params: bool wrap + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetWordWrap(BTextView *TextView, bool wrap) +{ + TextView->SetWordWrap(wrap); +} + + +/*********************************************************************** + * Method: BTextView::DoesWordWrap + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_DoesWordWrap(BTextView *TextView) +{ + return TextView->DoesWordWrap(); +} + + +/*********************************************************************** + * Method: BTextView::SetMaxBytes + * Params: int32 max + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetMaxBytes(BTextView *TextView, int32 max) +{ + TextView->SetMaxBytes(max); +} + + +/*********************************************************************** + * Method: BTextView::MaxBytes + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_MaxBytes(BTextView *TextView) +{ + return TextView->MaxBytes(); +} + + +/*********************************************************************** + * Method: BTextView::DisallowChar + * Params: uint32 aChar + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_DisallowChar(BTextView *TextView, uint32 aChar) +{ + TextView->DisallowChar(aChar); +} + + +/*********************************************************************** + * Method: BTextView::AllowChar + * Params: uint32 aChar + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_AllowChar(BTextView *TextView, uint32 aChar) +{ + TextView->AllowChar(aChar); +} + + +/*********************************************************************** + * Method: BTextView::SetAlignment + * Params: alignment flag + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetAlignment(BTextView *TextView, alignment flag) +{ + TextView->SetAlignment(flag); +} + + +/*********************************************************************** + * Method: BTextView::Alignment + * Params: + * Returns: alignment + * Effects: + ***********************************************************************/ +alignment +BTextView_Alignment(BTextView *TextView) +{ + return TextView->Alignment(); +} + + +/*********************************************************************** + * Method: BTextView::SetAutoindent + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetAutoindent(BTextView *TextView, bool state) +{ + TextView->SetAutoindent(state); +} + + +/*********************************************************************** + * Method: BTextView::DoesAutoindent + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_DoesAutoindent(BTextView *TextView) +{ + return TextView->DoesAutoindent(); +} + + +/*********************************************************************** + * Method: BTextView::SetColorSpace + * Params: color_space colors + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetColorSpace(BTextView *TextView, color_space colors) +{ + TextView->SetColorSpace(colors); +} + + +/*********************************************************************** + * Method: BTextView::ColorSpace + * Params: + * Returns: color_space + * Effects: + ***********************************************************************/ +color_space +BTextView_ColorSpace(BTextView *TextView) +{ + return TextView->ColorSpace(); +} + + +/*********************************************************************** + * Method: BTextView::MakeResizable + * Params: bool resize, BView *resizeView + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MakeResizable(BTextView *TextView, bool resize, BView *resizeView) +{ + TextView->MakeResizable(resize, resizeView); +} + + +/*********************************************************************** + * Method: BTextView::IsResizable + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_IsResizable(BTextView *TextView) +{ + return TextView->IsResizable(); +} + + +/*********************************************************************** + * Method: BTextView::SetDoesUndo + * Params: bool undo + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetDoesUndo(BTextView *TextView, bool undo) +{ + TextView->SetDoesUndo(undo); +} + + +/*********************************************************************** + * Method: BTextView::DoesUndo + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_DoesUndo(BTextView *TextView) +{ + return TextView->DoesUndo(); +} + + +/*********************************************************************** + * Method: BTextView::HideTyping + * Params: bool enabled + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_HideTyping(BTextView *TextView, bool enabled) +{ + TextView->HideTyping(enabled); +} + + +/*********************************************************************** + * Method: BTextView::IsTypingHidden + * Params: void + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_IsTypingHidden(BTextView *TextView, void) +{ + return TextView->IsTypingHidden(); +} + + +/*********************************************************************** + * Method: BTextView::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_ResizeToPreferred(BTextView *TextView) +{ + TextView->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BTextView::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetPreferredSize(BTextView *TextView, float *width, float *height) +{ + TextView->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BTextView::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_AllAttached(BTextView *TextView) +{ + TextView->AllAttached(); +} + + +/*********************************************************************** + * Method: BTextView::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_AllDetached(BTextView *TextView) +{ + TextView->AllDetached(); +} + + +/*********************************************************************** + * Method: BTextView::FlattenRunArray + * Params: const text_run_array *inArray, int32 *outSize + * Returns: void * + * Effects: + ***********************************************************************/ +void * +BTextView_FlattenRunArray(BTextView *TextView, const text_run_array *inArray, int32 *outSize) +{ + TextView->FlattenRunArray(inArray, outSize); +} + + +/*********************************************************************** + * Method: BTextView::UnflattenRunArray + * Params: const void *data, int32 *outSize + * Returns: text_run_array * + * Effects: + ***********************************************************************/ +text_run_array * +BTextView_UnflattenRunArray(BTextView *TextView, const void *data, int32 *outSize) +{ + return TextView->UnflattenRunArray(data, outSize); +} + + + +/*void +BTextView_InsertText(BTextView *TextView, const char *inText, int32 inLength, int32 inOffset, const text_run_array *inRuns) +{ + TextView->InsertText(inText, inLength, inOffset, inRuns); +} + + +void +BTextView_DeleteText(BTextView *TextView, int32 fromOffset, int32 toOffset) +{ + TextView->DeleteText(fromOffset, toOffset); +} +*/ + + +void +BTextView_Undo(BTextView *TextView, BClipboard *clipboard) +{ + TextView->Undo(clipboard); +} + + +#if defined(__cplusplus) +} +#endif + +#endif /* _TEXTVIEW_CPP_ */ + diff --git a/bepascal/source/bepascal/cpp/src/be/interface/View.cpp b/bepascal/source/bepascal/cpp/src/be/interface/View.cpp new file mode 100644 index 0000000..0364df1 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/View.cpp @@ -0,0 +1,580 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _VIEW_CPP_ +#define _VIEW_CPP_ + +#include + +#include + +#include +#include +#include + +// definition of callback function in BView +typedef void (*BView_AllAttached_hook) (TPasObject PasObject); +typedef void (*BView_AllDetached_hook) (TPasObject PasObject); +typedef void (*BView_AttachedToWindow_hook) (TPasObject PasObject); +typedef void (*BView_DetachedFromWindow_hook) (TPasObject PasObject); +typedef void (*BView_Draw_hook) (TPasObject PasObject, TCPlusObject updateRect); +typedef void (*BView_DrawAfterChildren_hook) (TPasObject PasObject, TCPlusObject updateRect); +typedef void (*BView_FrameMoved_hook) (TPasObject PasObject, TCPlusObject parentPoint); +typedef void (*BView_FrameResized_hook) (TPasObject PasObject, float width, float height); +typedef void (*BView_GetPreferredSize_hook) (TPasObject PasObject, float *width, float *height); +typedef void (*BView_ResizeToPreferred_hook) (TPasObject PasObject); +typedef void (*BView_KeyDown_hook) (TPasObject PasObject, const char *bytes, int32 numBytes); +typedef void (*BView_KeyUp_hook) (TPasObject PasObject, const char *bytes, int32 numBytes); +typedef void (*BView_MouseDown_hook) (TPasObject PasObject, TCPlusObject point); +typedef void (*BView_MouseMoved_hook) (TPasObject PasObject, TCPlusObject point, uint32 transit, TCPlusObject message); +typedef void (*BView_MouseUp_hook) (TPasObject PasObject, TCPlusObject point); +typedef void (*BView_Pulse_hook) (TPasObject PasObject); +typedef void (*BView_TargetedByScrollView_hook) (TPasObject PasObject, TCPlusObject scroller); +typedef void (*BView_WindowActivated_hook) (TPasObject PasObject, bool active); + +#if defined(__cplusplus) +extern "C" { +#endif + +uint32 _B_FOLLOW_NONE = B_FOLLOW_NONE; +uint32 _B_FOLLOW_ALL_SIDES = B_FOLLOW_ALL_SIDES; +uint32 _B_FOLLOW_ALL = B_FOLLOW_ALL; + +uint32 _B_FOLLOW_LEFT = B_FOLLOW_LEFT; +uint32 _B_FOLLOW_RIGHT = B_FOLLOW_RIGHT; +uint32 _B_FOLLOW_LEFT_RIGHT = B_FOLLOW_LEFT_RIGHT; +uint32 _B_FOLLOW_H_CENTER = B_FOLLOW_H_CENTER; + +uint32 _B_FOLLOW_TOP = B_FOLLOW_TOP; +uint32 _B_FOLLOW_BOTTOM = B_FOLLOW_BOTTOM; +uint32 _B_FOLLOW_TOP_BOTTOM = B_FOLLOW_TOP_BOTTOM; +uint32 _B_FOLLOW_V_CENTER = B_FOLLOW_V_CENTER; + +BView_AllAttached_hook View_AllAttached_hook; +BView_AllDetached_hook View_AllDetached_hook; +BView_AttachedToWindow_hook View_AttachedToWindow_hook; +BView_DetachedFromWindow_hook View_DetachedFromWindow_hook; +BView_Draw_hook View_Draw_hook; +BView_DrawAfterChildren_hook View_DrawAfterChildren_hook; +BView_FrameMoved_hook View_FrameMoved_hook; +BView_FrameResized_hook View_FrameResized_hook; +BView_GetPreferredSize_hook View_GetPreferredSize_hook; +BView_ResizeToPreferred_hook View_ResizeToPreferred_hook; +BView_KeyDown_hook View_KeyDown_hook; +BView_KeyUp_hook View_KeyUp_hook; +BView_MouseDown_hook View_MouseDown_hook; +BView_MouseMoved_hook View_MouseMoved_hook; +BView_MouseUp_hook View_MouseUp_hook; +BView_Pulse_hook View_Pulse_hook; +BView_TargetedByScrollView_hook View_TargetedByScrollView_hook; +BView_WindowActivated_hook View_WindowActivated_hook; + +#if defined(__cplusplus) +} +#endif + +BPView::BPView(TPasObject PasObject, + BRect frame, + const char *name, + uint32 resizingMode, + uint32 flags) + : BView(frame, name, resizingMode, flags), + BPHandler(PasObject), + BPasObject(PasObject) +{ +} + +BPView::BPView(TPasObject PasObject, BMessage *archive) + : BView(archive), + BPHandler(PasObject), + BPasObject(PasObject) +{ +} + +void BPView::MessageReceived(BMessage *message) +{ + BPHandler::MessageReceived_hookCall(message); + BView::MessageReceived(message); +} + +void BPView::AllAttached(void) +{ + AllAttached_hookCall(); +} + +void BPView::AllAttached_hookCall(void) +{ + View_AllAttached_hook(GetPasObject()); +} + +void BPView::AttachedToWindow(void) +{ + BView::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + +void BPView::AttachedToWindow_hookCall(void) +{ + View_AttachedToWindow_hook(GetPasObject()); +} + +void BPView::AllDetached(void) +{ + AllDetached_hookCall(); +} + +void BPView::AllDetached_hookCall(void) +{ + View_AllDetached_hook(GetPasObject()); +} + +void BPView::DetachedFromWindow(void) +{ + DetachedFromWindow_hookCall(); +} + +void BPView::DetachedFromWindow_hookCall(void) +{ + View_DetachedFromWindow_hook(GetPasObject()); +} + +void BPView::Draw(BRect updateRect) +{ + BView::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPView::Draw_hookCall(BRect updateRect) +{ + View_Draw_hook(GetPasObject(), &updateRect); +} + +void BPView::DrawAfterChildren(BRect updateRect) +{ + DrawAfterChildren_hookCall(updateRect); +} + +void BPView::DrawAfterChildren_hookCall(BRect updateRect) +{ + View_DrawAfterChildren_hook(GetPasObject(), &updateRect); +} + +void BPView::FrameMoved(BPoint parentPoint) +{ + FrameMoved_hookCall(parentPoint); +} + +void BPView::FrameMoved_hookCall(BPoint parentPoint) +{ + View_FrameMoved_hook(GetPasObject(), &parentPoint); +} + +void BPView::FrameResized(float width, float height) +{ + FrameResized_hookCall(width, height); +} + +void BPView::FrameResized_hookCall(float width, float height) +{ + View_FrameResized_hook(GetPasObject(), width, height); +} + +void BPView::GetPreferredSize(float *width, float *height) +{ + GetPreferredSize_hookCall(width, height); +} + +void BPView::GetPreferredSize_hookCall(float *width, float *height) +{ + View_GetPreferredSize_hook(GetPasObject(), width, height); +} + +void BPView::ResizeToPreferred(void) +{ + ResizeToPreferred_hookCall(); +} + +void BPView::ResizeToPreferred_hookCall(void) +{ + View_ResizeToPreferred_hook(GetPasObject()); +} + +void BPView::KeyDown(const char *bytes, int32 numBytes) +{ + KeyDown_hookCall(bytes, numBytes); +} + +void BPView::KeyDown_hookCall(const char *bytes, int32 numBytes) +{ + View_KeyDown_hook(GetPasObject(), bytes, numBytes); +} + +void BPView::KeyUp(const char *bytes, int32 numBytes) +{ + KeyUp_hookCall(bytes, numBytes); +} + +void BPView::KeyUp_hookCall(const char *bytes, int32 numBytes) +{ + View_KeyUp_hook(GetPasObject(), bytes, numBytes); +} + +void BPView::MouseDown(BPoint point) +{ + MouseDown_hookCall(point); +} + +void BPView::MouseDown_hookCall(BPoint point) +{ + View_MouseDown_hook(GetPasObject(), &point); +} + +void BPView::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + MouseMoved_hookCall(point, transit, message); +} + +void BPView::MouseMoved_hookCall(BPoint point, uint32 transit, const BMessage *message) +{ + View_MouseMoved_hook(GetPasObject(), &point, transit, &message); +} + +void BPView::MouseUp(BPoint point) +{ + MouseUp_hookCall(point); +} + +void BPView::MouseUp_hookCall(BPoint point) +{ + View_MouseUp_hook(GetPasObject(), &point); +} + +void BPView::Pulse(void) +{ + Pulse_hookCall(); +} + +void BPView::Pulse_hookCall(void) +{ + View_Pulse_hook(GetPasObject()); +} + +//void BPView::TargetedByScrollView(BScrollView *scroller) +//{ +// View_TargetedByScrollView(GetPasObject(), scroller); +//} + +void BPView::WindowActivated(bool active) +{ + WindowActivated_hookCall(active); +} + +void BPView::WindowActivated_hookCall(bool active) +{ + View_WindowActivated_hook(GetPasObject(), active); +} + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BView_Create_1(TPasObject PasObject, + BRect frame, + const char *name, + uint32 resizingMode, + uint32 flags) +{ + return new BPView(PasObject, frame, name, resizingMode, flags); +} + +void BView_Free(TCPlusObject View) +{ + delete View; +} + +/*********************************************************************** + * Method: BView::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BView_Instantiate(BView *View, BMessage *data) +{ + return View->Instantiate(data); +} + + +/*********************************************************************** + * Method: BView::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BView_Archive(BView *View, BMessage *data, + bool deep) +{ + return View->Archive(data, + deep); +} + +// TODO : implement hook functions +/*********************************************************************** + * Method: BView::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BView_AttachedToWindow(BView *View) +{ + View->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BView::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BView_AllAttached(BView *View) +{ + View->AllAttached(); +} + + +/*********************************************************************** + * Method: BView::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BView_DetachedFromWindow(BView *View) +{ + View->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BView::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BView_AllDetached(BView *View) +{ + View->AllDetached(); +} + +// END TODO implement hook functions + +/*********************************************************************** + * Method: BView::AddChild + * Params: BView *child, BView *before + * Returns: void + * Effects: + ***********************************************************************/ +void +BView_AddChild(BView *View, BView *child, + BView *before) +{ + View->AddChild(child, + before); +} + + +/*********************************************************************** + * Method: BView::RemoveChild + * Params: BView *child + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BView_RemoveChild(BView *View, BView *child) +{ + return View->RemoveChild(child); +} + + +/*********************************************************************** + * Method: BView::CountChildren + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BView_CountChildren(BView *View) +{ + return View->CountChildren(); +} + + +/*********************************************************************** + * Method: BView::ChildAt + * Params: int32 index + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BView_ChildAt(BView *View, int32 index) +{ + return View->ChildAt(index); +} + + +/*********************************************************************** + * Method: BView::NextSibling + * Params: + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BView_NextSibling(BView *View) +{ + return View->NextSibling(); +} + + +/*********************************************************************** + * Method: BView::PreviousSibling + * Params: + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BView_PreviousSibling(BView *View) +{ + return View->PreviousSibling(); +} + + +/*********************************************************************** + * Method: BView::RemoveSelf + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BView_RemoveSelf(BView *View) +{ + return View->RemoveSelf(); +} + + +/*********************************************************************** + * Method: BView::Window + * Params: + * Returns: BWindow * + * Effects: + ***********************************************************************/ +BWindow * +BView_Window(BView *View) +{ + return View->Window(); +} + + +// TODO : implement hook function + +/*********************************************************************** + * Method: BView::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BView_Draw(BView *View, BRect updateRect) +{ + View->Draw(updateRect); +} + +// END TODO implement hook function + +/*********************************************************************** + * Method: BView::SetViewColor + * Params: rgb_color c + * Returns: void + * Effects: + ***********************************************************************/ +void +BView_SetViewColor(BView *View, rgb_color c) +{ + View->SetViewColor(c); +} + + +/*********************************************************************** + * Method: BView::ViewColor + * Params: + * Returns: rgb_color + * Effects: + ***********************************************************************/ +rgb_color +BView_ViewColor(BView *View) +{ + return View->ViewColor(); +} + +/*********************************************************************** + * Method: BView::Show + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BView_Show(BView *View) +{ + View->Show(); +} + + +/*********************************************************************** + * Method: BView::Hide + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BView_Hide(BView *View) +{ + View->Hide(); +} + + +/*********************************************************************** + * Method: BView::IsHidden + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BView_IsHidden(BView *View) +{ + return View->IsHidden(); +} + +#if defined(__cplusplus) +} +#endif + +#endif /* _VIEW_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/interface/Window.cpp b/bepascal/source/bepascal/cpp/src/be/interface/Window.cpp new file mode 100644 index 0000000..c76be05 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/Window.cpp @@ -0,0 +1,2103 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _WINDOW_CPP_ +#define _WINDOW_CPP_ + +#include + +#include + +#include +#include +#include + +// definition of callback function in BWindow +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(__cplusplus) +} +#endif + +BPWindow::BPWindow(TPasObject PasObject, + BRect frame, + const char *title, + window_type type, + uint32 flags, + uint32 workspaces = B_CURRENT_WORKSPACE) + : BWindow(frame, title, type, flags, workspaces), + BPLooper(PasObject), + BPHandler(PasObject, title), + BPasObject(PasObject) +{ +} + +void BPWindow::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BWindow::MessageReceived(message); +// message->PrintToStream(); +} + +void BPWindow::DispatchMessage(BMessage *message, BHandler *target) +{ + DispatchMessage_hookCall(message, target); + BWindow::DispatchMessage(message, target); +} + +bool BPWindow::QuitRequested(void) +{ + return QuitRequested_hookCall(); +} + +void BPWindow::WindowActivated(bool active) +{ + BWindow::WindowActivated(active); +} + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BWindow_Create_1(TPasObject PasObject, + BRect frame, + const char *title, + window_type type, + uint32 flags, + uint32 workspaces) +{ + return new BPWindow(PasObject, frame, title, type, flags, workspaces); +} + +void BWindow_Free(TCPlusObject Window) +{ + delete Window; +} + +void BWindow_Show(TCPlusObject Window) +{ + reinterpret_cast(Window)->Show(); +} + +void BWindow_Hide(TCPlusObject Window) +{ + reinterpret_cast(Window)->Hide(); +} + +void BWindow_AddChild(BWindow* Window, BView* aView, BView* sibling) +{ + Window->AddChild(aView, sibling); +} + +bool BWindow_RemoveChild(BWindow* Window, BView* aView) +{ + return Window->RemoveChild(aView); +} + +BView* BWindow_ChildAt(BWindow* Window, int32 index) +{ + return Window->ChildAt(index); +} + +int32 BWindow_CountChildren(BWindow* Window, void) +{ + return Window->CountChildren(); +} + +//********************************* + +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/*********************************************************************** + * Method: BWindow::BWindow + * Params: BRect frame, const char *title, window_type type, uint32 flags, uint32 workspace + * Effects: + ***********************************************************************/ +TCPlusObject BWindow_Create(TPasObject PasObject, BRect frame, const char *title, window_type type, uint32 flags, uint32 workspace) +{ + return new BPWindow(PasObject, frame, title, type, flags, workspace); +} + + +/*********************************************************************** + * Method: BWindow::BWindow + * Params: BRect frame, const char *title, window_look look, window_feel feel, uint32 flags, uint32 workspace + * Effects: + ***********************************************************************/ +/*TCPlusObject BWindow_Create_1 +(TPasObject PasObject, BRect frame, const char *title, window_look look, window_feel feel, uint32 flags, uint32 workspace) +{ + return new BPWindow(PasObject, frame, title, look, feel, flags, workspace); +} +*/ + +/*********************************************************************** + * Method: BWindow::BWindow + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BWindow_Create_2(TPasObject PasObject, BMessage *data) +{ +// return new BPWindow(PasObject, data); +} + + +/*********************************************************************** + * Method: BWindow::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BWindow_Instantiate(BWindow *Window, BMessage *data) +{ + return Window->Instantiate(data); +} + + +/*********************************************************************** + * Method: BWindow::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_Archive(BWindow *Window, BMessage *data, bool deep) +{ + return Window->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BWindow::Quit + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_Quit(BWindow *Window) +{ + Window->Quit(); +} + + +/*********************************************************************** + * Method: BWindow::AddChild + * Params: BView *child, BView *before + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_AddChild(BWindow *Window, BView *child, BView *before) +{ + Window->AddChild(child, before); +} +*/ + +/*********************************************************************** + * Method: BWindow::RemoveChild + * Params: BView *child + * Returns: bool + * Effects: + ***********************************************************************/ +/*bool +BWindow_RemoveChild(BWindow *Window, BView *child) +{ + return Window->RemoveChild(child); +} +*/ + + +/*********************************************************************** + * Method: BWindow::CountChildren + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +/*int32 +BWindow_CountChildren(BWindow *Window) +{ + return Window->CountChildren(); +} +*/ + + +/*********************************************************************** + * Method: BWindow::ChildAt + * Params: int32 index + * Returns: BView * + * Effects: + ***********************************************************************/ +/*BView * +BWindow_ChildAt(BWindow *Window, int32 index) +{ + return Window->ChildAt(index); +} +*/ + +/*********************************************************************** + * Method: BWindow::DispatchMessage + * Params: BMessage *message, BHandler *handler + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_DispatchMessage(BWindow *Window, BMessage *message, BHandler *handler) +{ + Window->DispatchMessage(message, handler); +} + + +/*********************************************************************** + * Method: BWindow::MessageReceived + * Params: BMessage *message + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_MessageReceived(BWindow *Window, BMessage *message) +{ + Window->MessageReceived(message); +} + + +/*********************************************************************** + * Method: BWindow::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_FrameMoved(BWindow *Window, BPoint new_position) +{ + Window->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BWindow::WorkspacesChanged + * Params: uint32 old_ws, uint32 new_ws + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_WorkspacesChanged(BWindow *Window, uint32 old_ws, uint32 new_ws) +{ + Window->WorkspacesChanged(old_ws, new_ws); +} + + +/*********************************************************************** + * Method: BWindow::WorkspaceActivated + * Params: int32 ws, bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_WorkspaceActivated(BWindow *Window, int32 ws, bool state) +{ + Window->WorkspaceActivated(ws, state); +} + + +/*********************************************************************** + * Method: BWindow::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_FrameResized(BWindow *Window, float new_width, float new_height) +{ + Window->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BWindow::Minimize + * Params: bool minimize + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_Minimize(BWindow *Window, bool minimize) +{ + Window->Minimize(minimize); +} + + +/*********************************************************************** + * Method: BWindow::Zoom + * Params: BPoint rec_position, float rec_width, float rec_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_Zoom(BWindow *Window, BPoint rec_position, float rec_width, float rec_height) +{ + Window->Zoom(rec_position, rec_width, rec_height); +} + + +/*********************************************************************** + * Method: BWindow::Zoom + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_Zoom_1 +(BWindow *Window) +{ + Window->Zoom(); +} + + +/*********************************************************************** + * Method: BWindow::SetZoomLimits + * Params: float max_h, float max_v + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_SetZoomLimits(BWindow *Window, float max_h, float max_v) +{ + Window->SetZoomLimits(max_h, max_v); +} + + +/*********************************************************************** + * Method: BWindow::ScreenChanged + * Params: BRect screen_size, color_space depth + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_ScreenChanged(BWindow *Window, BRect screen_size, color_space depth) +{ + Window->ScreenChanged(screen_size, depth); +} + + +/*********************************************************************** + * Method: BWindow::SetPulseRate + * Params: bigtime_t rate + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_SetPulseRate(BWindow *Window, bigtime_t rate) +{ + Window->SetPulseRate(rate); +} + + +/*********************************************************************** + * Method: BWindow::PulseRate + * Params: + * Returns: bigtime_t + * Effects: + ***********************************************************************/ +bigtime_t +BWindow_PulseRate(BWindow *Window) +{ + return Window->PulseRate(); +} + + +/*********************************************************************** + * Method: BWindow::AddShortcut + * Params: uint32 key, uint32 modifiers, BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_AddShortcut(BWindow *Window, uint32 key, uint32 modifiers, BMessage *msg) +{ + Window->AddShortcut(key, modifiers, msg); +} + + +/*********************************************************************** + * Method: BWindow::AddShortcut + * Params: uint32 key, uint32 modifiers, BMessage *msg, BHandler *target + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_AddShortcut_1 +(BWindow *Window, uint32 key, uint32 modifiers, BMessage *msg, BHandler *target) +{ + Window->AddShortcut(key, modifiers, msg, target); +} + + +/*********************************************************************** + * Method: BWindow::RemoveShortcut + * Params: uint32 key, uint32 modifiers + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_RemoveShortcut(BWindow *Window, uint32 key, uint32 modifiers) +{ + Window->RemoveShortcut(key, modifiers); +} + + +/*********************************************************************** + * Method: BWindow::SetDefaultButton + * Params: BButton *button + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_SetDefaultButton(BWindow *Window, BButton *button) +{ + Window->SetDefaultButton(button); +} + + +/*********************************************************************** + * Method: BWindow::DefaultButton + * Params: + * Returns: BButton * + * Effects: + ***********************************************************************/ +BButton * +BWindow_DefaultButton(BWindow *Window) +{ + return Window->DefaultButton(); +} + + +/*********************************************************************** + * Method: BWindow::MenusBeginning + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_MenusBeginning(BWindow *Window) +{ + Window->MenusBeginning(); +} + + +/*********************************************************************** + * Method: BWindow::MenusEnded + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_MenusEnded(BWindow *Window) +{ + Window->MenusEnded(); +} + + +/*********************************************************************** + * Method: BWindow::NeedsUpdate + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BWindow_NeedsUpdate(BWindow *Window) +{ + return Window->NeedsUpdate(); +} + + +/*********************************************************************** + * Method: BWindow::UpdateIfNeeded + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_UpdateIfNeeded(BWindow *Window) +{ + Window->UpdateIfNeeded(); +} + + +/*********************************************************************** + * Method: BWindow::FindView + * Params: const char *view_name + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BWindow_FindView(BWindow *Window, const char *view_name) +{ + return Window->FindView(view_name); +} + + +/*********************************************************************** + * Method: BWindow::FindView + * Params: BPoint + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BWindow_FindView_1 +(BWindow *Window, BPoint aPoint) +{ + return Window->FindView(aPoint); +} + + +/*********************************************************************** + * Method: BWindow::CurrentFocus + * Params: + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BWindow_CurrentFocus(BWindow *Window) +{ + return Window->CurrentFocus(); +} + + +/*********************************************************************** + * Method: BWindow::Activate + * Params: bool + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_Activate(BWindow *Window, bool) +{ + Window->Activate(); +} + + +/*********************************************************************** + * Method: BWindow::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_WindowActivated(BWindow *Window, bool state) +{ + Window->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BWindow::ConvertToScreen + * Params: BPoint *pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_ConvertToScreen_3(BWindow *Window, BPoint *pt) +{ + Window->ConvertToScreen(pt); +} + + +/*********************************************************************** + * Method: BWindow::ConvertToScreen + * Params: BPoint pt + * Returns: BPoint + * Effects: + ***********************************************************************/ +BPoint +BWindow_ConvertToScreen_1 +(BWindow *Window, BPoint pt) +{ + return Window->ConvertToScreen(pt); +} + + +/*********************************************************************** + * Method: BWindow::ConvertFromScreen + * Params: BPoint *pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_ConvertFromScreen(BWindow *Window, BPoint *pt) +{ + Window->ConvertFromScreen(pt); +} + + +/*********************************************************************** + * Method: BWindow::ConvertFromScreen + * Params: BPoint pt + * Returns: BPoint + * Effects: + ***********************************************************************/ +BPoint +BWindow_ConvertFromScreen_1 +(BWindow *Window, BPoint pt) +{ + return Window->ConvertFromScreen(pt); +} + + +/*********************************************************************** + * Method: BWindow::ConvertToScreen + * Params: BRect *rect + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_ConvertToScreen_2(BWindow *Window, BRect *rect) +{ + Window->ConvertToScreen(rect); +} + + +/*********************************************************************** + * Method: BWindow::ConvertToScreen + * Params: BRect rect + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BWindow_ConvertToScreen_5 +(BWindow *Window, BRect rect) +{ + return Window->ConvertToScreen(rect); +} + + +/*********************************************************************** + * Method: BWindow::ConvertFromScreen + * Params: BRect *rect + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_ConvertFromScreen_6(BWindow *Window, BRect *rect) +{ + Window->ConvertFromScreen(rect); +} + + +/*********************************************************************** + * Method: BWindow::ConvertFromScreen + * Params: BRect rect + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BWindow_ConvertFromScreen_7 +(BWindow *Window, BRect rect) +{ + return Window->ConvertFromScreen(rect); +} + + +/*********************************************************************** + * Method: BWindow::MoveBy + * Params: float dx, float dy + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_MoveBy(BWindow *Window, float dx, float dy) +{ + Window->MoveBy(dx, dy); +} + + +/*********************************************************************** + * Method: BWindow::MoveTo + * Params: BPoint + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_MoveTo(BWindow *Window, BPoint aPoint) +{ + Window->MoveTo(aPoint); +} + + +/*********************************************************************** + * Method: BWindow::MoveTo + * Params: float x, float y + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_MoveTo_1 +(BWindow *Window, float x, float y) +{ + Window->MoveTo(x, y); +} + + +/*********************************************************************** + * Method: BWindow::ResizeBy + * Params: float dx, float dy + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_ResizeBy(BWindow *Window, float dx, float dy) +{ + Window->ResizeBy(dx, dy); +} + + +/*********************************************************************** + * Method: BWindow::ResizeTo + * Params: float width, float height + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_ResizeTo(BWindow *Window, float width, float height) +{ + Window->ResizeTo(width, height); +} + + +/*********************************************************************** + * Method: BWindow::Show + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_Show(BWindow *Window) +{ + Window->Show(); +} +*/ + +/*********************************************************************** + * Method: BWindow::Hide + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_Hide(BWindow *Window) +{ + Window->Hide(); +} +*/ + + +/*********************************************************************** + * Method: BWindow::IsHidden + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BWindow_IsHidden(BWindow *Window) +{ + return Window->IsHidden(); +} + + +/*********************************************************************** + * Method: BWindow::IsMinimized + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BWindow_IsMinimized(BWindow *Window) +{ + return Window->IsMinimized(); +} + + +/*********************************************************************** + * Method: BWindow::Flush + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_Flush(BWindow *Window) +{ + Window->Flush(); +} + + +/*********************************************************************** + * Method: BWindow::Sync + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_Sync(BWindow *Window) +{ + Window->Sync(); +} + + +/*********************************************************************** + * Method: BWindow::SendBehind + * Params: const BWindow *window + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_SendBehind(BWindow *Window, const BWindow *window) +{ + return Window->SendBehind(window); +} + + +/*********************************************************************** + * Method: BWindow::DisableUpdates + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_DisableUpdates(BWindow *Window) +{ + Window->DisableUpdates(); +} + + +/*********************************************************************** + * Method: BWindow::EnableUpdates + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_EnableUpdates(BWindow *Window) +{ + Window->EnableUpdates(); +} + + +/*********************************************************************** + * Method: BWindow::BeginViewTransaction + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_BeginViewTransaction(BWindow *Window) +{ + Window->BeginViewTransaction(); +} + + +/*********************************************************************** + * Method: BWindow::EndViewTransaction + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_EndViewTransaction(BWindow *Window) +{ + Window->EndViewTransaction(); +} + + +/*********************************************************************** + * Method: BWindow::Bounds + * Params: + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BWindow_Bounds(BWindow *Window) +{ + return Window->Bounds(); +} + + +/*********************************************************************** + * Method: BWindow::Frame + * Params: + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BWindow_Frame(BWindow *Window) +{ + return Window->Frame(); +} + + +/*********************************************************************** + * Method: BWindow::Title + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BWindow_Title(BWindow *Window) +{ + return Window->Title(); +} + + +/*********************************************************************** + * Method: BWindow::SetTitle + * Params: const char *title + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_SetTitle(BWindow *Window, const char *title) +{ + Window->SetTitle(title); +} + + +/*********************************************************************** + * Method: BWindow::IsFront + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BWindow_IsFront(BWindow *Window) +{ + return Window->IsFront(); +} + + +/*********************************************************************** + * Method: BWindow::IsActive + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BWindow_IsActive(BWindow *Window) +{ + return Window->IsActive(); +} + + +/*********************************************************************** + * Method: BWindow::SetKeyMenuBar + * Params: BMenuBar *bar + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_SetKeyMenuBar(BWindow *Window, BMenuBar *bar) +{ + Window->SetKeyMenuBar(bar); +} + + +/*********************************************************************** + * Method: BWindow::KeyMenuBar + * Params: + * Returns: BMenuBar * + * Effects: + ***********************************************************************/ +BMenuBar * +BWindow_KeyMenuBar(BWindow *Window) +{ + return Window->KeyMenuBar(); +} + + +/*********************************************************************** + * Method: BWindow::SetSizeLimits + * Params: float min_h, float max_h, float min_v, float max_v + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_SetSizeLimits(BWindow *Window, float min_h, float max_h, float min_v, float max_v) +{ + Window->SetSizeLimits(min_h, max_h, min_v, max_v); +} + + +/*********************************************************************** + * Method: BWindow::GetSizeLimits + * Params: float *min_h, float *max_h, float *min_v, float *max_v + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_GetSizeLimits(BWindow *Window, float *min_h, float *max_h, float *min_v, float *max_v) +{ + Window->GetSizeLimits(min_h, max_h, min_v, max_v); +} + + +/*********************************************************************** + * Method: BWindow::Workspaces + * Params: + * Returns: uint32 + * Effects: + ***********************************************************************/ +uint32 +BWindow_Workspaces(BWindow *Window) +{ + return Window->Workspaces(); +} + + +/*********************************************************************** + * Method: BWindow::SetWorkspaces + * Params: uint32 + * Returns: void + * Effects: + ***********************************************************************/ +void +BWindow_SetWorkspaces(BWindow *Window, uint32 index) +{ + Window->SetWorkspaces(index); +} + + +/*********************************************************************** + * Method: BWindow::LastMouseMovedView + * Params: + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BWindow_LastMouseMovedView(BWindow *Window) +{ + return Window->LastMouseMovedView(); +} + + +/*********************************************************************** + * Method: BWindow::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BWindow_ResolveSpecifier(BWindow *Window, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return Window->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BWindow::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_GetSupportedSuites(BWindow *Window, BMessage *data) +{ + return Window->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BWindow::AddToSubset + * Params: BWindow *window + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_AddToSubset(BWindow *Window, BWindow *window) +{ + return Window->AddToSubset(window); +} + + +/*********************************************************************** + * Method: BWindow::RemoveFromSubset + * Params: BWindow *window + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_RemoveFromSubset(BWindow *Window, BWindow *window) +{ + return Window->RemoveFromSubset(window); +} + + +/*********************************************************************** + * Method: BWindow::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_Perform(BWindow *Window, perform_code d, void *arg) +{ + return Window->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BWindow::SetType + * Params: window_type type + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_SetType(BWindow *Window, window_type type) +{ + return Window->SetType(type); +} + + +/*********************************************************************** + * Method: BWindow::Type + * Params: + * Returns: window_type + * Effects: + ***********************************************************************/ +window_type +BWindow_Type(BWindow *Window) +{ + return Window->Type(); +} + + +/*********************************************************************** + * Method: BWindow::SetLook + * Params: window_look look + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_SetLook(BWindow *Window, window_look look) +{ + return Window->SetLook(look); +} + + +/*********************************************************************** + * Method: BWindow::Look + * Params: + * Returns: window_look + * Effects: + ***********************************************************************/ +window_look +BWindow_Look(BWindow *Window) +{ + return Window->Look(); +} + + +/*********************************************************************** + * Method: BWindow::SetFeel + * Params: window_feel feel + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_SetFeel(BWindow *Window, window_feel feel) +{ + return Window->SetFeel(feel); +} + + +/*********************************************************************** + * Method: BWindow::Feel + * Params: + * Returns: window_feel + * Effects: + ***********************************************************************/ +window_feel +BWindow_Feel(BWindow *Window) +{ + return Window->Feel(); +} + + +/*********************************************************************** + * Method: BWindow::SetFlags + * Params: uint32 + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_SetFlags(BWindow *Window, uint32 Flags) +{ + return Window->SetFlags(Flags); +} + + +/*********************************************************************** + * Method: BWindow::Flags + * Params: + * Returns: uint32 + * Effects: + ***********************************************************************/ +uint32 +BWindow_Flags(BWindow *Window) +{ + return Window->Flags(); +} + + +/*********************************************************************** + * Method: BWindow::IsModal + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BWindow_IsModal(BWindow *Window) +{ + return Window->IsModal(); +} + + +/*********************************************************************** + * Method: BWindow::IsFloating + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BWindow_IsFloating(BWindow *Window) +{ + return Window->IsFloating(); +} + + +/*********************************************************************** + * Method: BWindow::SetWindowAlignment + * Params: window_alignment mode, int32 h, int32 hOffset, int32 width, int32 widthOffset, int32 v, int32 vOffset, int32 height, int32 heightOffset + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_SetWindowAlignment(BWindow *Window, window_alignment mode, int32 h, int32 hOffset, int32 width, int32 widthOffset, int32 v, int32 vOffset, int32 height, int32 heightOffset) +{ + return Window->SetWindowAlignment(mode, h, hOffset, width, widthOffset, v, vOffset, height, heightOffset); +} + + +/*********************************************************************** + * Method: BWindow::GetWindowAlignment + * Params: window_alignment *mode, int32 *h, int32 *hOffset, int32 *width, int32 *widthOffset, int32 *v, int32 *vOffset, int32 *height, int32 *heightOffset + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BWindow_GetWindowAlignment(BWindow *Window, window_alignment *mode, int32 *h, int32 *hOffset, int32 *width, int32 *widthOffset, int32 *v, int32 *vOffset, int32 *height, int32 *heightOffset) +{ + return Window->GetWindowAlignment(mode, h, hOffset, width, widthOffset, v, vOffset, height, heightOffset); +} + + +/*********************************************************************** + * Method: BWindow::QuitRequested + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BWindow_QuitRequested(BWindow *Window) +{ + return Window->QuitRequested(); +} + + +/*********************************************************************** + * Method: BWindow::Run + * Params: + * Returns: thread_id + * Effects: + ***********************************************************************/ +thread_id +BWindow_Run(BWindow *Window) +{ + return Window->Run(); +} + + +/*********************************************************************** + * Method: BWindow::_ReservedWindow1 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow__ReservedWindow1(BWindow *Window) +{ + Window->_ReservedWindow1(); +} +*/ + +/*********************************************************************** + * Method: BWindow::_ReservedWindow2 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow__ReservedWindow2(BWindow *Window) +{ + Window->_ReservedWindow2(); +} +*/ + +/*********************************************************************** + * Method: BWindow::_ReservedWindow3 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow__ReservedWindow3(BWindow *Window) +{ + Window->_ReservedWindow3(); +} +*/ + +/*********************************************************************** + * Method: BWindow::_ReservedWindow4 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow__ReservedWindow4(BWindow *Window) +{ + Window->_ReservedWindow4(); +} +*/ + +/*********************************************************************** + * Method: BWindow::_ReservedWindow5 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow__ReservedWindow5(BWindow *Window) +{ + Window->_ReservedWindow5(); +} +*/ + +/*********************************************************************** + * Method: BWindow::_ReservedWindow6 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow__ReservedWindow6(BWindow *Window) +{ + Window->_ReservedWindow6(); +} +*/ + +/*********************************************************************** + * Method: BWindow::_ReservedWindow7 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow__ReservedWindow7(BWindow *Window) +{ + Window->_ReservedWindow7(); +} +*/ + +/*********************************************************************** + * Method: BWindow::_ReservedWindow8 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow__ReservedWindow8(BWindow *Window) +{ + Window->_ReservedWindow8(); +} +*/ + +/*********************************************************************** + * Method: BWindow::BWindow + * Params: + * Effects: + ***********************************************************************/ +/*TCPlusObject BWindow_Create(TPasObject PasObject) +{ + return new BPWindow(PasObject); +} +*/ + +/*********************************************************************** + * Method: BWindow::BWindow + * Params: BWindow & + * Effects: + ***********************************************************************/ +/*TCPlusObject BWindow_Create_1 +(TPasObject PasObject, BWindow &) +{ + return new BPWindow(PasObject, ); +} +*/ + +/*********************************************************************** + * Method: BWindow::operator= + * Params: BWindow & + * Returns: BWindow & + * Effects: + ***********************************************************************/ +/*BWindow & +BWindow_operator=(BWindow *Window, BWindow &) +{ + return Window->operator=(); +} +*/ + +/*********************************************************************** + * Method: BWindow::BWindow + * Params: BRect frame, color_space depth, uint32 bitmapFlags, int32 rowBytes + * Effects: + ***********************************************************************/ +/*TCPlusObject BWindow_Create(TPasObject PasObject, BRect frame, color_space depth, uint32 bitmapFlags, int32 rowBytes) +{ + return new BPWindow(PasObject, frame, depth, bitmapFlags, rowBytes); +} +*/ + +/*********************************************************************** + * Method: BWindow::InitData + * Params: BRect frame, const char *title, window_look look, window_feel feel, uint32 flags, uint32 workspace + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_InitData(BWindow *Window, BRect frame, const char *title, window_look look, window_feel feel, uint32 flags, uint32 workspace) +{ + Window->InitData(frame, title, look, feel, flags, workspace); +} +*/ + +/*********************************************************************** + * Method: BWindow::ArchiveChildren + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BWindow_ArchiveChildren(BWindow *Window, BMessage *data, bool deep) +{ + return Window->ArchiveChildren(data, deep); +} +*/ + +/*********************************************************************** + * Method: BWindow::UnarchiveChildren + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +/*status_t +BWindow_UnarchiveChildren(BWindow *Window, BMessage *data) +{ + return Window->UnarchiveChildren(data); +} +*/ + +/*********************************************************************** + * Method: BWindow::BitmapClose + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_BitmapClose(BWindow *Window) +{ + Window->BitmapClose(); +} +*/ + +/*********************************************************************** + * Method: BWindow::task_looper + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_task_looper(BWindow *Window) +{ + Window->task_looper(); +} +*/ + +/*********************************************************************** + * Method: BWindow::start_drag + * Params: BMessage *msg, int32 token, BPoint offset, BRect track_rect, BHandler *reply_to + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_start_drag(BWindow *Window, BMessage *msg, int32 token, BPoint offset, BRect track_rect, BHandler *reply_to) +{ + Window->start_drag(msg, token, offset, track_rect, reply_to); +} +*/ + +/*********************************************************************** + * Method: BWindow::start_drag + * Params: BMessage *msg, int32 token, BPoint offset, int32 bitmap_token, drawing_mode dragMode, BHandler *reply_to + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_start_drag_1 +(BWindow *Window, BMessage *msg, int32 token, BPoint offset, int32 bitmap_token, drawing_mode dragMode, BHandler *reply_to) +{ + Window->start_drag(msg, token, offset, bitmap_token, dragMode, reply_to); +} +*/ + +/*********************************************************************** + * Method: BWindow::view_builder + * Params: BView *a_view + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_view_builder(BWindow *Window, BView *a_view) +{ + Window->view_builder(a_view); +} +*/ + +/*********************************************************************** + * Method: BWindow::attach_builder + * Params: BView *a_view + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_attach_builder(BWindow *Window, BView *a_view) +{ + Window->attach_builder(a_view); +} +*/ + +/*********************************************************************** + * Method: BWindow::detach_builder + * Params: BView *a_view + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_detach_builder(BWindow *Window, BView *a_view) +{ + Window->detach_builder(a_view); +} +*/ + +/*********************************************************************** + * Method: BWindow::get_server_token + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +/*int32 +BWindow_get_server_token(BWindow *Window) const +{ + return Window->get_server_token(); +} +*/ + +/*********************************************************************** + * Method: BWindow::extract_drop + * Params: BMessage *an_event, BHandler **target + * Returns: BMessage * + * Effects: + ***********************************************************************/ +/*BMessage * +BWindow_extract_drop(BWindow *Window, BMessage *an_event, BHandler **target) +{ + return Window->extract_drop(an_event, target); +} +*/ + +/*********************************************************************** + * Method: BWindow::movesize + * Params: uint32 opcode, float h, float v + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_movesize(BWindow *Window, uint32 opcode, float h, float v) +{ + Window->movesize(opcode, h, v); +} +*/ + +/*********************************************************************** + * Method: BWindow::ReadMessageFromPort + * Params: bigtime_t tout + * Returns: BMessage * + * Effects: + ***********************************************************************/ +/*BMessage * +BWindow_ReadMessageFromPort(BWindow *Window, bigtime_t tout) +{ + return Window->ReadMessageFromPort(tout); +} +*/ + +/*********************************************************************** + * Method: BWindow::MessagesWaiting + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +/*int32 +BWindow_MessagesWaiting(BWindow *Window) +{ + return Window->MessagesWaiting(); +} +*/ + +/*********************************************************************** + * Method: BWindow::handle_activate + * Params: BMessage *an_event + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_handle_activate(BWindow *Window, BMessage *an_event) +{ + Window->handle_activate(an_event); +} +*/ + +/*********************************************************************** + * Method: BWindow::do_view_frame + * Params: BMessage *an_event + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_do_view_frame(BWindow *Window, BMessage *an_event) +{ + Window->do_view_frame(an_event); +} +*/ + +/*********************************************************************** + * Method: BWindow::do_value_change + * Params: BMessage *an_event, BHandler *handler + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_do_value_change(BWindow *Window, BMessage *an_event, BHandler *handler) +{ + Window->do_value_change(an_event, handler); +} +*/ + +/*********************************************************************** + * Method: BWindow::do_mouse_down + * Params: BMessage *an_event, BView *target + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_do_mouse_down(BWindow *Window, BMessage *an_event, BView *target) +{ + Window->do_mouse_down(an_event, target); +} +*/ + +/*********************************************************************** + * Method: BWindow::do_mouse_moved + * Params: BMessage *an_event, BView *target + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_do_mouse_moved(BWindow *Window, BMessage *an_event, BView *target) +{ + Window->do_mouse_moved(an_event, target); +} +*/ + +/*********************************************************************** + * Method: BWindow::do_key_down + * Params: BMessage *an_event, BHandler *handler + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_do_key_down(BWindow *Window, BMessage *an_event, BHandler *handler) +{ + Window->do_key_down(an_event, handler); +} +*/ + +/*********************************************************************** + * Method: BWindow::do_key_up + * Params: BMessage *an_event, BHandler *handler + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_do_key_up(BWindow *Window, BMessage *an_event, BHandler *handler) +{ + Window->do_key_up(an_event, handler); +} +*/ + +/*********************************************************************** + * Method: BWindow::do_menu_event + * Params: BMessage *an_event + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_do_menu_event(BWindow *Window, BMessage *an_event) +{ + Window->do_menu_event(an_event); +} +*/ + +/*********************************************************************** + * Method: BWindow::do_draw_views + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_do_draw_views(BWindow *Window) +{ + Window->do_draw_views(); +} +*/ + +/*********************************************************************** + * Method: BWindow::ConvertToMessage + * Params: void *raw, int32 code + * Returns: BMessage * + * Effects: + ***********************************************************************/ +/*BMessage * +BWindow_ConvertToMessage(BWindow *Window, void *raw, int32 code) +{ + return Window->ConvertToMessage(raw, code); +} +*/ + +/*********************************************************************** + * Method: BWindow::allocShortcut + * Params: uint32 key, uint32 modifiers + * Returns: _cmd_key_ * + * Effects: + ***********************************************************************/ +/*_cmd_key_ * +BWindow_allocShortcut(BWindow *Window, uint32 key, uint32 modifiers) +{ + return Window->allocShortcut(key, modifiers); +} +*/ + +/*********************************************************************** + * Method: BWindow::FindShortcut + * Params: uint32 key, uint32 modifiers + * Returns: _cmd_key_ * + * Effects: + ***********************************************************************/ +/*_cmd_key_ * +BWindow_FindShortcut(BWindow *Window, uint32 key, uint32 modifiers) +{ + return Window->FindShortcut(key, modifiers); +} +*/ + +/*********************************************************************** + * Method: BWindow::AddShortcut + * Params: uint32 key, uint32 modifiers, BMenuItem *item + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_AddShortcut(BWindow *Window, uint32 key, uint32 modifiers, BMenuItem *item) +{ + Window->AddShortcut(key, modifiers, item); +} +*/ + +/*********************************************************************** + * Method: BWindow::post_message + * Params: BMessage *message + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_post_message(BWindow *Window, BMessage *message) +{ + Window->post_message(message); +} +*/ + +/*********************************************************************** + * Method: BWindow::SetLocalTitle + * Params: const char *new_title + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_SetLocalTitle(BWindow *Window, const char *new_title) +{ + Window->SetLocalTitle(new_title); +} +*/ + +/*********************************************************************** + * Method: BWindow::enable_pulsing + * Params: bool enable + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_enable_pulsing(BWindow *Window, bool enable) +{ + Window->enable_pulsing(enable); +} +*/ + +/*********************************************************************** + * Method: BWindow::determine_target + * Params: BMessage *msg, BHandler *target, bool pref + * Returns: BHandler * + * Effects: + ***********************************************************************/ +/*BHandler * +BWindow_determine_target(BWindow *Window, BMessage *msg, BHandler *target, bool pref) +{ + return Window->determine_target(msg, target, pref); +} +*/ + +/*********************************************************************** + * Method: BWindow::kb_navigate + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_kb_navigate(BWindow *Window) +{ + Window->kb_navigate(); +} +*/ + +/*********************************************************************** + * Method: BWindow::navigate_to_next + * Params: int32 direction, bool group + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_navigate_to_next(BWindow *Window, int32 direction, bool group) +{ + Window->navigate_to_next(direction, group); +} +*/ + +/*********************************************************************** + * Method: BWindow::set_focus + * Params: BView *focus, bool notify_input_server + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_set_focus(BWindow *Window, BView *focus, bool notify_input_server) +{ + Window->set_focus(focus, notify_input_server); +} +*/ + +/*********************************************************************** + * Method: BWindow::InUpdate + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +/*bool +BWindow_InUpdate(BWindow *Window) +{ + return Window->InUpdate(); +} +*/ + +/*********************************************************************** + * Method: BWindow::DequeueAll + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_DequeueAll(BWindow *Window) +{ + Window->DequeueAll(); +} +*/ + +/*********************************************************************** + * Method: BWindow::find_token_and_handler + * Params: BMessage *msg, int32 *token, BHandler **handler + * Returns: bool + * Effects: + ***********************************************************************/ +/*bool +BWindow_find_token_and_handler(BWindow *Window, BMessage *msg, int32 *token, BHandler **handler) +{ + return Window->find_token_and_handler(msg, token, handler); +} +*/ + +/*********************************************************************** + * Method: BWindow::compose_type + * Params: window_look look, window_feel feel + * Returns: window_type + * Effects: + ***********************************************************************/ +/*window_type +BWindow_compose_type(BWindow *Window, window_look look, window_feel feel) const +{ + return Window->compose_type(look, feel); +} +*/ + +/*********************************************************************** + * Method: BWindow::decompose_type + * Params: window_type type, window_look *look, window_feel *feel + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_decompose_type(BWindow *Window, window_type type, window_look *look, window_feel *feel) const +{ + Window->decompose_type(type, look, feel); +} +*/ + +/*********************************************************************** + * Method: BWindow::SetIsFilePanel + * Params: bool panel + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_SetIsFilePanel(BWindow *Window, bool panel) +{ + Window->SetIsFilePanel(panel); +} +*/ + +/*********************************************************************** + * Method: BWindow::IsFilePanel + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +/*bool +BWindow_IsFilePanel(BWindow *Window) const +{ + return Window->IsFilePanel(); +} +*/ + +/*********************************************************************** + * Method: BWindow::AddFloater + * Params: BWindow *a_floating_window + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_AddFloater(BWindow *Window, BWindow *a_floating_window) +{ + Window->AddFloater(a_floating_window); +} +*/ + +/*********************************************************************** + * Method: BWindow::RemoveFloater + * Params: BWindow *a_floating_window + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BWindow_RemoveFloater(BWindow *Window, BWindow *a_floating_window) +{ + Window->RemoveFloater(a_floating_window); +} +*/ + +/*********************************************************************** + * Method: BWindow::WindowType + * Params: + * Returns: window_type + * Effects: + ***********************************************************************/ +/*window_type +BWindow_WindowType(BWindow *Window) const +{ + return Window->WindowType(); +} +*/ +//********************************* + +#if defined(__cplusplus) +} +#endif + +#endif /* _WINDOW_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/mail/E-mail.cpp b/bepascal/source/bepascal/cpp/src/be/mail/E-mail.cpp new file mode 100644 index 0000000..1df020d --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/mail/E-mail.cpp @@ -0,0 +1,277 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef _MAIL_CPP_ +#define _MAIL_CPP_ + +#include "E-mail.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + + +/* + * Method: BMailMessage::BMailMessage() + * Descr: + */ +TCPlusObject BMailMessage_Create() +{ + return new BMailMessage(); +} + +void BMail_Free(BMailMessage *Mail) +{ + delete Mail; +} +/* + * Method: BMailMessage::AddContent() + * Descr: + */ +status_t +BMailMessage_AddContent(BMailMessage *MailMessage, const char *text, + int32 length, + uint32 encoding, + bool clobber) +{ + return MailMessage->AddContent(text, + length, + encoding, + clobber); +} + + +/* + * Method: BMailMessage::AddContent() + * Descr: + */ +status_t +BMailMessage_AddContent_1 +(BMailMessage *MailMessage, const char *text, + int32 length, + const char *encoding, + bool clobber) +{ + return MailMessage->AddContent(text, + length, + encoding, + clobber); +} + + +/* + * Method: BMailMessage::AddEnclosure() + * Descr: + */ +status_t +BMailMessage_AddEnclosure(BMailMessage *MailMessage, entry_ref *ref, + bool clobber) +{ + return MailMessage->AddEnclosure(ref, + clobber); +} + + +/* + * Method: BMailMessage::AddEnclosure() + * Descr: + */ +status_t +BMailMessage_AddEnclosure_1 +(BMailMessage *MailMessage, const char *path, + bool clobber) +{ + return MailMessage->AddEnclosure(path, + clobber); +} + + +/* + * Method: BMailMessage::AddEnclosure() + * Descr: + */ +status_t +BMailMessage_AddEnclosure_2 +(BMailMessage *MailMessage, const char *MIME_type, + void *data, + int32 len, + bool clobber) +{ + return MailMessage->AddEnclosure(MIME_type, + data, + len, + clobber); +} + + +/* + * Method: BMailMessage::AddHeaderField() + * Descr: + */ +status_t +BMailMessage_AddHeaderField(BMailMessage *MailMessage, uint32 encoding, + const char *field_name, + const char *str, + bool clobber) +{ + return MailMessage->AddHeaderField(encoding, + field_name, + str, + clobber); +} + + +/* + * Method: BMailMessage::AddHeaderField() + * Descr: + */ +status_t +BMailMessage_AddHeaderField_1 +(BMailMessage *MailMessage, const char *field_name, + const char *str, + bool clobber) +{ + return MailMessage->AddHeaderField(field_name, + str, + clobber); +} + + +/* + * Method: BMailMessage::Send() + * Descr: + */ +status_t +BMailMessage_Send(BMailMessage *MailMessage, bool send_now, + bool remove_when_I_have_completed_sending_this_message_to_your_preferred_SMTP_server) +{ + return MailMessage->Send(send_now, + remove_when_I_have_completed_sending_this_message_to_your_preferred_SMTP_server); +} + + +/* + * Method: BMailMessage::concatinate() + * Descr: + */ +/*int32 +BMailMessage_concatinate(BMailMessage *MailMessage, char **, + int32, + char *) +{ + return MailMessage->concatinate(, + , + ); +} +*/ + +/* + * Method: BMailMessage::count_fields() + * Descr: + */ +/*int32 +BMailMessage_count_fields(BMailMessage *MailMessage, char *name) +{ + return MailMessage->count_fields(name); +} + +*/ +/* + * Method: BMailMessage::find_field() + * Descr: + */ +/*status_t +BMailMessage_find_field(BMailMessage *MailMessage, char *, + type_code *, + char **, + void **, + int32 *, + uint32 *, + char **, + bool *, + int32) +{ + return MailMessage->find_field(, + , + , + , + , + , + , + , + ); +} +*/ + +/* + * Method: BMailMessage::find_field() + * Descr: + */ +/*BList * +BMailMessage_find_field_1 +(BMailMessage *MailMessage, const char *) +{ + return MailMessage->find_field(); +} +*/ + +/* + * Method: BMailMessage::get_field_name() + * Descr: + */ +/*status_t +BMailMessage_get_field_name(BMailMessage *MailMessage, char **, + int32) +{ + return MailMessage->get_field_name(, + ); +} +*/ + +/* + * Method: BMailMessage::set_field() + * Descr: + */ +/*status_t +BMailMessage_set_field(BMailMessage *MailMessage, const char *, + type_code, + const char *, + const void *, + int32, + uint32, + const char *, + bool) +{ + return MailMessage->set_field(, + , + , + , + , + , + , + ); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _MAIL_CPP_ */ + + diff --git a/bepascal/source/bepascal/cpp/src/be/storage/FilePanel.cpp b/bepascal/source/bepascal/cpp/src/be/storage/FilePanel.cpp new file mode 100644 index 0000000..b80dbd0 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/storage/FilePanel.cpp @@ -0,0 +1,435 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _FILEPANEL_CPP_ +#define _FILEPANEL_CPP_ + + +/*********************************************************************** + * AUTHOR: + * FILE: FilePanel.cpp + * DATE: Thu Feb 13 22:49:35 2003 + * DESCR: + ***********************************************************************/ +#include "FilePanel.h" +#include + + +class BPFilePanel : public BFilePanel, public virtual BPasObject +{ + +public: + BPFilePanel(TPasObject PasObject, + file_panel_mode mode = B_OPEN_PANEL, + BMessenger *target = 0, + const entry_ref *start_directory = 0, + uint32 node_flavors = 0, + bool allow_multiple_selection = true, + BMessage *message = 0, + BRefFilter * = 0, + bool modal = false, + bool hide_when_done = true); + + ~BPFilePanel(); +}; + +BPFilePanel::BPFilePanel(TPasObject PasObject, + file_panel_mode mode = B_OPEN_PANEL, + BMessenger *target = 0, + const entry_ref *start_directory = 0, + uint32 node_flavors = 0, + bool allow_multiple_selection = true, + BMessage *message = 0, + BRefFilter *reg = 0, + bool modal = false, + bool hide_when_done = true) + :BFilePanel(mode,target,start_directory,node_flavors,allow_multiple_selection, message, reg,modal, hide_when_done ), + BPasObject(PasObject) +{ +} + +BPFilePanel::~BPFilePanel() +{ +} + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * Method: BFilePanel::BFilePanel + * Params: file_panel_mode mode, BMessenger *target, const entry_ref *start_directory, uint32 node_flavors, bool allow_multiple_selection, BMessage *message, BRefFilter *, bool modal, bool hide_when_done + * Effects: + ***********************************************************************/ +TCPlusObject BFilePanel_Create(TPasObject PasObject, file_panel_mode mode, BMessenger *target, const entry_ref *start_directory, uint32 node_flavors, bool allow_multiple_selection, BMessage *message, BRefFilter *reg, bool modal, bool hide_when_done) +{ +// return new BPFilePanel(PasObject, mode, target, start_directory, node_flavors, allow_multiple_selection, message, reg, modal, hide_when_done); + return new BPFilePanel(PasObject, mode, target, 0, 0, false, 0, 0, true, true); +} + + +/*********************************************************************** + * Method: BFilePanel::~BFilePanel + * Params: + * Effects: + ***********************************************************************/ +void BFilePanel_Free(BFilePanel *FilePanel) +{ + delete FilePanel; +} + + +/*********************************************************************** + * Method: BFilePanel::Show + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_Show(BFilePanel *FilePanel) +{ + FilePanel->Show(); +} + + +/*********************************************************************** + * Method: BFilePanel::Hide + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_Hide(BFilePanel *FilePanel) +{ + FilePanel->Hide(); +} + + +/*********************************************************************** + * Method: BFilePanel::IsShowing + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BFilePanel_IsShowing(BFilePanel *FilePanel) +{ + return FilePanel->IsShowing(); +} + + +/*********************************************************************** + * Method: BFilePanel::WasHidden + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_WasHidden(BFilePanel *FilePanel) +{ + FilePanel->WasHidden(); +} + + +/*********************************************************************** + * Method: BFilePanel::SelectionChanged + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SelectionChanged(BFilePanel *FilePanel) +{ + FilePanel->SelectionChanged(); +} + + +/*********************************************************************** + * Method: BFilePanel::SendMessage + * Params: const BMessenger *, BMessage * + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SendMessage(BFilePanel *FilePanel, const BMessenger *messenger, BMessage *msg) +{ + FilePanel->SendMessage(messenger, msg); +} + + +/*********************************************************************** + * Method: BFilePanel::Window + * Params: + * Returns: BWindow * + * Effects: + ***********************************************************************/ +BWindow * +BFilePanel_Window(BFilePanel *FilePanel) +{ + return FilePanel->Window(); +} + + +/*********************************************************************** + * Method: BFilePanel::Messenger + * Params: + * Returns: BMessenger + * Effects: + ***********************************************************************/ +/*BMessenger +BFilePanel_Messenger(BFilePanel *FilePanel) +{ + return FilePanel->Messenger(); +}*/ + + +/*********************************************************************** + * Method: BFilePanel::RefFilter + * Params: + * Returns: BRefFilter * + * Effects: + ***********************************************************************/ +BRefFilter * +BFilePanel_RefFilter(BFilePanel *FilePanel) +{ + return FilePanel->RefFilter(); +} + + +/*********************************************************************** + * Method: BFilePanel::GetPanelDirectory + * Params: entry_ref * + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_GetPanelDirectory(BFilePanel *FilePanel, entry_ref *ref) +{ + FilePanel->GetPanelDirectory(ref); +} + + +/*********************************************************************** + * Method: BFilePanel::PanelMode + * Params: + * Returns: file_panel_mode + * Effects: + ***********************************************************************/ +file_panel_mode +BFilePanel_PanelMode(BFilePanel *FilePanel) +{ +// return FilePanel->PanelMode(); +} + + +/*********************************************************************** + * Method: BFilePanel::SetTarget + * Params: BMessenger + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BFilePanel_SetTarget(BFilePanel *FilePanel, BMessenger *mess) +{ + FilePanel->SetTarget(mess); +}*/ + + +/*********************************************************************** + * Method: BFilePanel::SetMessage + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SetMessage(BFilePanel *FilePanel, BMessage *msg) +{ + FilePanel->SetMessage(msg); +} + + +/*********************************************************************** + * Method: BFilePanel::SetRefFilter + * Params: BRefFilter *filter + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SetRefFilter(BFilePanel *FilePanel, BRefFilter *filter) +{ + FilePanel->SetRefFilter(filter); +} + + +/*********************************************************************** + * Method: BFilePanel::SetSaveText + * Params: const char *text + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SetSaveText(BFilePanel *FilePanel, const char *text) +{ + FilePanel->SetSaveText(text); +} + + +/*********************************************************************** + * Method: BFilePanel::SetButtonLabel + * Params: file_panel_button, const char *label + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SetButtonLabel(BFilePanel *FilePanel, file_panel_button z, const char *label) +{ + FilePanel->SetButtonLabel(z, label); +} + + +/*********************************************************************** + * Method: BFilePanel::SetPanelDirectory + * Params: const BEntry *new_directory + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SetPanelDirectory(BFilePanel *FilePanel, const BEntry *new_directory) +{ + FilePanel->SetPanelDirectory(new_directory); +} + + +/*********************************************************************** + * Method: BFilePanel::SetPanelDirectory + * Params: const BDirectory *new_directory + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SetPanelDirectory_1 +(BFilePanel *FilePanel, const BDirectory *new_directory) +{ + FilePanel->SetPanelDirectory(new_directory); +} + + +/*********************************************************************** + * Method: BFilePanel::SetPanelDirectory + * Params: const entry_ref *new_directory + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SetPanelDirectory_2 +(BFilePanel *FilePanel, const entry_ref *new_directory) +{ + FilePanel->SetPanelDirectory(new_directory); +} + + +/*********************************************************************** + * Method: BFilePanel::SetPanelDirectory + * Params: const char *new_directory + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SetPanelDirectory_3 +(BFilePanel *FilePanel, const char *new_directory) +{ + FilePanel->SetPanelDirectory(new_directory); +} + + +/*********************************************************************** + * Method: BFilePanel::SetHideWhenDone + * Params: bool + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_SetHideWhenDone(BFilePanel *FilePanel, bool z) +{ + FilePanel->SetHideWhenDone(z); +} + + +/*********************************************************************** + * Method: BFilePanel::HidesWhenDone + * Params: void + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BFilePanel_HidesWhenDone(BFilePanel *FilePanel, void) +{ + return FilePanel->HidesWhenDone(); +} + + +/*********************************************************************** + * Method: BFilePanel::Refresh + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_Refresh(BFilePanel *FilePanel) +{ + FilePanel->Refresh(); +} + + +/*********************************************************************** + * Method: BFilePanel::Rewind + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BFilePanel_Rewind(BFilePanel *FilePanel) +{ + FilePanel->Rewind(); +} + + +/*********************************************************************** + * Method: BFilePanel::GetNextSelectedRef + * Params: entry_ref * + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BFilePanel_GetNextSelectedRef(BFilePanel *FilePanel, entry_ref *ref) +{ + return FilePanel->GetNextSelectedRef(ref); +} + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _FILEPANEL_CPP_ */ + + + diff --git a/bepascal/source/bepascal/cpp/src/be/storage/Path.cpp b/bepascal/source/bepascal/cpp/src/be/storage/Path.cpp new file mode 100644 index 0000000..1f08fbc --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/storage/Path.cpp @@ -0,0 +1,392 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _PATH_CPP_ +#define _PATH_CPP_ + +/*********************************************************************** + * AUTHOR: + * FILE: Entry.cpp + * DATE: Wed Jul 2 22:28:34 2003 + * DESCR: + ***********************************************************************/ +#include +#include +#include + +class BPPath:public BPath , public virtual BPasObject { +public: + BPPath(TPasObject PasObject); + BPPath(TPasObject PasObject,const char *dir, const char *leaf = NULL,bool normalize = false); +// BPPath(const BDirectory *dir, const char *leaf, bool normalize = false); + BPPath(TPasObject PasObject,const BPath &path); + BPPath(TPasObject PasObject,const BEntry *entry); + BPPath(TPasObject PasObject,const entry_ref *ref); + +virtual ~BPPath(); +}; + +BPPath::BPPath(TPasObject PasObject) + :BPath(), + BPasObject(PasObject) +{ +} + +BPPath::BPPath(TPasObject PasObject,const char *dir, const char *leaf = NULL, + bool normalize = false) + :BPath(dir, leaf ,normalize), + BPasObject(PasObject) +{ +} + +BPPath::BPPath(TPasObject PasObject, const BPath &path) + :BPath(path), + BPasObject(PasObject) +{ +} + +BPPath::BPPath(TPasObject PasObject,const BEntry *entry) + :BPath(entry), + BPasObject(PasObject) +{ +} + +BPPath::BPPath(TPasObject PasObject,const entry_ref *ref) + :BPath(ref), + BPasObject(PasObject) +{ +} + + +BPPath::~BPPath() +{ +} + +#if defined(__cplusplus) +extern "C" { +#endif + + +/*********************************************************************** + * Method: BPath::BPath + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BPath_Create(TPasObject PasObject) +{ + return new BPPath(PasObject); +} + + +/*********************************************************************** + * Method: BPath::BPath + * Params: const char *dir, const char *leaf, bool normalize + * Effects: + ***********************************************************************/ +TCPlusObject BPath_Create_1 +(TPasObject PasObject, const char *dir, const char *leaf, bool normalize) +{ + return new BPPath(PasObject, dir, leaf, normalize); +} + + +/*********************************************************************** + * Method: BPath::BPath + * Params: const BDirectory *dir, const char *leaf, bool normalize + * Effects: + ***********************************************************************/ +/*TCPlusObject BPath_Create_2 +(TPasObject PasObject, const BDirectory *dir, const char *leaf, bool normalize) +{ + return new BPPath(PasObject, dir, leaf, normalize); +} +*/ + +/*********************************************************************** + * Method: BPath::BPath + * Params: const BPath &path + * Effects: + ***********************************************************************/ +TCPlusObject BPath_Create_3 +(TPasObject PasObject, const BPath &path) +{ + return new BPPath(PasObject, path); +} + + +/*********************************************************************** + * Method: BPath::BPath + * Params: const BEntry *entry + * Effects: + ***********************************************************************/ +TCPlusObject BPath_Create_4 +(TPasObject PasObject, const BEntry *entry) +{ + return new BPPath(PasObject, entry); +} + + +/*********************************************************************** + * Method: BPath::BPath + * Params: const entry_ref *ref + * Effects: + ***********************************************************************/ +TCPlusObject BPath_Create_5 +(TPasObject PasObject, const entry_ref *ref) +{ + return new BPPath(PasObject, ref); +} + + +/*********************************************************************** + * Method: BPath::~BPath + * Params: + * Effects: + ***********************************************************************/ +void BPath_Free(BPath *Path) +{ + delete Path; +} + + +/*********************************************************************** + * Method: BPath::InitCheck + * Params: + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BPath_InitCheck(BPath *Path) +{ + return Path->InitCheck(); +} + + +/*********************************************************************** + * Method: BPath::SetTo + * Params: const char *path, const char *leaf, bool normalize + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BPath_SetTo(BPath *Path, const char *path, const char *leaf, bool normalize) +{ + return Path->SetTo(path, leaf, normalize); +} + + +/*********************************************************************** + * Method: BPath::SetTo + * Params: const BDirectory *dir, const char *path, bool normalize + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BPath_SetTo_1 +(BPath *Path, const BDirectory *dir, const char *path, bool normalize) +{ + return Path->SetTo(dir, path, normalize); +} + + +/*********************************************************************** + * Method: BPath::SetTo + * Params: const BEntry *entry + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BPath_SetTo_2 +(BPath *Path, const BEntry *entry) +{ + return Path->SetTo(entry); +} + + +/*********************************************************************** + * Method: BPath::SetTo + * Params: const entry_ref *ref + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BPath_SetTo_3 +(BPath *Path, const entry_ref *ref) +{ + return Path->SetTo(ref); +} + + +/*********************************************************************** + * Method: BPath::Append + * Params: const char *path, bool normalize + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BPath_Append(BPath *Path, const char *path, bool normalize) +{ + return Path->Append(path, normalize); +} + + +/*********************************************************************** + * Method: BPath::Unset + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BPath_Unset(BPath *Path) +{ + Path->Unset(); +} + + +/*********************************************************************** + * Method: BPath::Path + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BPath_Path(BPath *Path) +{ + const char * test; + test=Path->Path(); + return Path->Path(); +} + + +/*********************************************************************** + * Method: BPath::Leaf + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BPath_Leaf(BPath *Path) +{ + return Path->Leaf(); +} + + +/*********************************************************************** + * Method: BPath::GetParent + * Params: BPath * + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BPath_GetParent(BPath *Path) +{ + return Path->GetParent(Path); +} + + + + + +/*********************************************************************** + * Method: BPath::IsFixedSize + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BPath_IsFixedSize(BPath *Path) +{ + return Path->IsFixedSize(); +} + + +/*********************************************************************** + * Method: BPath::TypeCode + * Params: + * Returns: type_code + * Effects: + ***********************************************************************/ +type_code +BPath_TypeCode(BPath *Path) +{ + return Path->TypeCode(); +} + + +/*********************************************************************** + * Method: BPath::FlattenedSize + * Params: + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BPath_FlattenedSize(BPath *Path) +{ + return Path->FlattenedSize(); +} + + +/*********************************************************************** + * Method: BPath::Flatten + * Params: void *buffer, ssize_t size + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BPath_Flatten(BPath *Path, void *buffer, ssize_t size) +{ + return Path->Flatten(buffer, size); +} + + +/*********************************************************************** + * Method: BPath::AllowsTypeCode + * Params: type_code code + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BPath_AllowsTypeCode(BPath *Path, type_code code) +{ + return Path->AllowsTypeCode(code); +} + + +/*********************************************************************** + * Method: BPath::Unflatten + * Params: type_code c, const void *buf, ssize_t size + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BPath_Unflatten(BPath *Path, type_code c, const void *buf, ssize_t size) +{ + return Path->Unflatten(c, buf, size); +} + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _PATH_CPP_ */ + + diff --git a/bepascal/source/bepascal/cpp/src/be/storage/Volume.cpp b/bepascal/source/bepascal/cpp/src/be/storage/Volume.cpp new file mode 100644 index 0000000..ece703a --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/storage/Volume.cpp @@ -0,0 +1,398 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef _VOLUME_CPP_ +#define _VOLUME_CPP_ + +#include "Volume.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Method: BVolume::BVolume() + * Descr: + */ +TCPlusObject BVolume_Create(TPasObject PasObject) +{ + return new BVolume(); +} + + +/* + * Method: BVolume::BVolume() + * Descr: + */ +TCPlusObject BVolume_Create_1 +(TPasObject PasObject, dev_t dev) +{ + return new BVolume( dev); +} + + +/* + * Method: BVolume::BVolume() + * Descr: + */ +TCPlusObject BVolume_Create_2 +(TPasObject PasObject, const BVolume &vol) +{ + return new BVolume( vol); +} + + +/* + * Method: BVolume::~BVolume() + * Descr: + */ +void BVolume_BVolume(BVolume *Volume) +{ + delete Volume; +} + + +/* + * Method: BVolume::InitCheck() + * Descr: + */ +status_t +BVolume_InitCheck(BVolume *Volume) +{ + return Volume->InitCheck(); +} + + +/* + * Method: BVolume::SetTo() + * Descr: + */ +status_t +BVolume_SetTo(BVolume *Volume, dev_t dev) +{ + return Volume->SetTo(dev); +} + + +/* + * Method: BVolume::Unset() + * Descr: + */ +void +BVolume_Unset(BVolume *Volume, void) +{ + Volume->Unset(); +} + + +/* + * Method: BVolume::Device() + * Descr: + */ +dev_t +BVolume_Device(BVolume *Volume) +{ + return Volume->Device(); +} + + +/* + * Method: BVolume::GetRootDirectory() + * Descr: + */ +status_t +BVolume_GetRootDirectory(BVolume *Volume, BDirectory *dir) +{ + return Volume->GetRootDirectory(dir); +} + + +/* + * Method: BVolume::Capacity() + * Descr: + */ +off_t +BVolume_Capacity(BVolume *Volume) +{ + return Volume->Capacity(); +} + + +/* + * Method: BVolume::FreeBytes() + * Descr: + */ +off_t +BVolume_FreeBytes(BVolume *Volume) +{ + return Volume->FreeBytes(); +} + + +/* + * Method: BVolume::GetName() + * Descr: + */ +status_t +BVolume_GetName(BVolume *Volume, char *name) +{ + return Volume->GetName(name); +} + + +/* + * Method: BVolume::SetName() + * Descr: + */ +status_t +BVolume_SetName(BVolume *Volume, const char *name) +{ + return Volume->SetName(name); +} + + +/* + * Method: BVolume::GetIcon() + * Descr: + */ +status_t +BVolume_GetIcon(BVolume *Volume, BBitmap *icon, + icon_size which) +{ + return Volume->GetIcon(icon, + which); +} + + +/* + * Method: BVolume::IsRemovable() + * Descr: + */ +bool +BVolume_IsRemovable(BVolume *Volume) +{ + return Volume->IsRemovable(); +} + + +/* + * Method: BVolume::IsReadOnly() + * Descr: + */ +bool +BVolume_IsReadOnly(BVolume *Volume) +{ + return Volume->IsReadOnly(); +} + + +/* + * Method: BVolume::IsPersistent() + * Descr: + */ +bool +BVolume_IsPersistent(BVolume *Volume) +{ + return Volume->IsPersistent(); +} + + +/* + * Method: BVolume::IsShared() + * Descr: + */ +bool +BVolume_IsShared(BVolume *Volume) +{ + return Volume->IsShared(); +} + + +/* + * Method: BVolume::KnowsMime() + * Descr: + */ +bool +BVolume_KnowsMime(BVolume *Volume) +{ + return Volume->KnowsMime(); +} + + +/* + * Method: BVolume::KnowsAttr() + * Descr: + */ +bool +BVolume_KnowsAttr(BVolume *Volume) +{ + return Volume->KnowsAttr(); +} + + +/* + * Method: BVolume::KnowsQuery() + * Descr: + */ +bool +BVolume_KnowsQuery(BVolume *Volume) +{ + return Volume->KnowsQuery(); +} + + +/* + * Method: BVolume::operator==() + * Descr: + */ +/*bool +BVolume_operator==(BVolume *Volume, const BVolume &vol) +{ + return Volume->operator==(vol); +} +*/ + +/* + * Method: BVolume::operator!=() + * Descr: + */ + /* +bool +BVolume_operator!=(BVolume *Volume, const BVolume &vol) +{ + return Volume->operator!=(vol); +} +*/ + +/* + * Method: BVolume::operator=() + * Descr: + */ + /* +BVolume & +BVolume_operator=(BVolume *Volume, const BVolume &vol) +{ + return Volume->operator=(vol); +} +*/ + + +/* + * Method: BVolume::_TurnUpTheVolume1() + * Descr: + */ +/* +void +BVolume__TurnUpTheVolume1(BVolume *Volume) +{ + Volume->_TurnUpTheVolume1(); +} +*/ + +/* + * Method: BVolume::_TurnUpTheVolume2() + * Descr: + */ + /* +void +BVolume__TurnUpTheVolume2(BVolume *Volume) +{ + Volume->_TurnUpTheVolume2(); +} +*/ + +/* + * Method: BVolume::_TurnUpTheVolume3() + * Descr: + */ + /* +void +BVolume__TurnUpTheVolume3(BVolume *Volume) +{ + Volume->_TurnUpTheVolume3(); +} +*/ + +/* + * Method: BVolume::_TurnUpTheVolume4() + * Descr: + */ + /* +void +BVolume__TurnUpTheVolume4(BVolume *Volume) +{ + Volume->_TurnUpTheVolume4(); +} +*/ + +/* + * Method: BVolume::_TurnUpTheVolume5() + * Descr: + */ + /* +void +BVolume__TurnUpTheVolume5(BVolume *Volume) +{ + Volume->_TurnUpTheVolume5(); +} +*/ + +/* + * Method: BVolume::_TurnUpTheVolume6() + * Descr: + */ + /* +void +BVolume__TurnUpTheVolume6(BVolume *Volume) +{ + Volume->_TurnUpTheVolume6(); +} +*/ + +/* + * Method: BVolume::_TurnUpTheVolume7() + * Descr: + */ + /* +void +BVolume__TurnUpTheVolume7(BVolume *Volume) +{ + Volume->_TurnUpTheVolume7(); +} + +*/ +/* + * Method: BVolume::_TurnUpTheVolume8() + * Descr: + */ + /* +void +BVolume__TurnUpTheVolume8(BVolume *Volume) +{ + Volume->_TurnUpTheVolume8(); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _VOLUME_CPP_ */ + + + diff --git a/bepascal/source/bepascal/cpp/src/be/storage/VolumeRoster.cpp b/bepascal/source/bepascal/cpp/src/be/storage/VolumeRoster.cpp new file mode 100644 index 0000000..c000950 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/storage/VolumeRoster.cpp @@ -0,0 +1,121 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef _VOLUMEROSTER_CPP_ +#define _VOLUMEROSTER_CPP_ + +#include "VolumeRoster.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Method: BVolumeRoster::BVolumeRoster() + * Descr: + */ +TCPlusObject BVolumeRoster_Create(TPasObject PasObject) +{ + return new BVolumeRoster(); +} + + +/* + * Method: BVolumeRoster::~BVolumeRoster() + * Descr: + */ +void BVolumeRoster_Free(BVolumeRoster *VolumeRoster) +{ + delete VolumeRoster; +} + + +/* + * Method: BVolumeRoster::GetNextVolume() + * Descr: + */ +status_t +BVolumeRoster_GetNextVolume(BVolumeRoster *VolumeRoster, BVolume *vol) +{ + return VolumeRoster->GetNextVolume(vol); +} + + +/* + * Method: BVolumeRoster::Rewind() + * Descr: + */ +void +BVolumeRoster_Rewind(BVolumeRoster *VolumeRoster) +{ + VolumeRoster->Rewind(); +} + + +/* + * Method: BVolumeRoster::GetBootVolume() + * Descr: + */ +status_t +BVolumeRoster_GetBootVolume(BVolumeRoster *VolumeRoster, BVolume *vol) +{ + return VolumeRoster->GetBootVolume(vol); +} + + +/* + * Method: BVolumeRoster::StartWatching() + * Descr: + */ +status_t +BVolumeRoster_StartWatching(BVolumeRoster *VolumeRoster, BMessenger msngr) +{ + return VolumeRoster->StartWatching(msngr); +} + + +/* + * Method: BVolumeRoster::StopWatching() + * Descr: + */ +void +BVolumeRoster_StopWatching(BVolumeRoster *VolumeRoster, void) +{ + VolumeRoster->StopWatching(); +} + + +/* + * Method: BVolumeRoster::Messenger() + * Descr: + */ +BMessenger +BVolumeRoster_Messenger(BVolumeRoster *VolumeRoster, void) +{ + return VolumeRoster->Messenger(); +} + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _VOLUMEROSTER_CPP_ */ + diff --git a/bepascal/source/bepascal/cpp/src/be/support/Archivable.cpp b/bepascal/source/bepascal/cpp/src/be/support/Archivable.cpp new file mode 100644 index 0000000..e7e3c0f --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/support/Archivable.cpp @@ -0,0 +1,115 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _ARCHIVABLE_CPP_ +#define _ARCHIVABLE_CPP_ + +#include + +#include +#include +#include + +typedef TCPlusObject (*BArchivable_Instantiate_hook) (BMessage *from); +typedef status_t (*BArchivable_Archive_hook)(TPasObject PasObject, BMessage *into, bool deep); + +#if defined(__cplusplus) +extern "C" { +#endif + +BArchivable_Instantiate_hook Archivable_Instantiate_hook; +BArchivable_Archive_hook Archivable_Archive_hook; + +#if defined(__cplusplus) +} +#endif + +BPArchivable::BPArchivable(TPasObject PasObject) + : BArchivable(), BPasObject(PasObject) +{ + +} + +BPArchivable::BPArchivable(TPasObject PasObject, BMessage *from) + : BArchivable(from), BPasObject(PasObject) +{ + +} + +BPArchivable::~BPArchivable(void) +{ +} + +status_t BPArchivable::Archive(BMessage *into, bool deep = true) const +{ + if (GetPasObject() != NULL) + { + // Demande l'archivage de l'objet Pascal + return BArchivable::Archive(into, deep); + } + else + { + into->AddString("class", "BPArchivable"); + return BArchivable::Archive(into, deep); + } +} + +status_t BPArchivable::ArchiveFromPascal(BMessage *into, bool deep = true) +{ + into->AddString("class", "BPArchivable"); + return BArchivable::Archive(into, deep); +} + +BArchivable *BPArchivable::Instantiate(BMessage *from) +{ + // Appel à la fonction de création de l'objet pascal correspondant + // au contenu du message +// return new BPArchivable(, from); + if (validate_instantiation(from, "BPArchivable")) + return reinterpret_cast(Archivable_Instantiate_hook(from)); + return NULL; +} + +#if defined(__cplusplus) +extern "C" { +#endif + +TCPlusObject BArchivable_Create_1(TPasObject PasObject) +{ + return new BPArchivable(PasObject); +} + +TCPlusObject BArchivable_Create_2(TPasObject PasObject, TCPlusObject from) +{ + return new BPArchivable(PasObject, reinterpret_cast(from)); +} + +status_t BArchivable_Archive(TCPlusObject archivable, TCPlusObject into, bool deep = true) +{ + // On ajoute BPArchivable dans l'entrée class du message + // pour que l'API BeOS appelle BPArchivable pour instancier + // les objets pascal qui supportent BArchivable. + reinterpret_cast(into)->AddString("class", "BPArchivable"); + return reinterpret_cast(archivable)->ArchiveFromPascal(reinterpret_cast(into), deep); +} + +#if defined(__cplusplus) +} +#endif + +#endif /* _ARCHIVABLE_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/support/DataIO.cpp b/bepascal/source/bepascal/cpp/src/be/support/DataIO.cpp new file mode 100644 index 0000000..bced38e --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/support/DataIO.cpp @@ -0,0 +1,385 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * Method: BDataIO::BDataIO + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BDataIO_Create_1(TPasObject PasObject) +{ +// return new BDataIO(PasObject); + return NULL; +} + + +/*********************************************************************** + * Method: BDataIO::~BDataIO + * Params: + * Effects: + ***********************************************************************/ +void BDataIO_Free(BDataIO *DataIO) +{ + delete DataIO; +} + +/*********************************************************************** + * Method: BDataIO::BDataIO + * Params: const BDataIO & + * Effects: + ***********************************************************************/ +TCPlusObject BDataIO_Create_2(TPasObject PasObject, const BDataIO &) +{ +// return new BPDataIO(PasObject, ); + return NULL; +} + +/*********************************************************************** + * Method: BDataIO::operator= + * Params: const BDataIO & + * Returns: BDataIO & + * Effects: + ***********************************************************************/ +/*BDataIO & +BDataIO_operator=(BDataIO *DataIO, const BDataIO &) +{ + return DataIO->operator=(); +}*/ + + +/*********************************************************************** + * Method: BPositionIO::BPositionIO + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BPositionIO_Create(TPasObject PasObject) +{ +// return new BPositionIO(PasObject); + return NULL; +} + + +/*********************************************************************** + * Method: BPositionIO::~BPositionIO + * Params: + * Effects: + ***********************************************************************/ +void BPositionIO_Free(BPositionIO *PositionIO) +{ + delete PositionIO; +} + + +/*********************************************************************** + * Method: BPositionIO::Read + * Params: void *buffer, size_t size + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BPositionIO_Read(BPositionIO *PositionIO, void *buffer, size_t size) +{ + return PositionIO->Read(buffer, size); +} + + +/*********************************************************************** + * Method: BPositionIO::Write + * Params: const void *buffer, size_t size + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BPositionIO_Write(BPositionIO *PositionIO, const void *buffer, size_t size) +{ + return PositionIO->Write(buffer, size); +} + + +/*********************************************************************** + * Method: BPositionIO::SetSize + * Params: off_t size + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BPositionIO_SetSize(BPositionIO *PositionIO, off_t size) +{ + return PositionIO->SetSize(size); +} + +/*********************************************************************** + * Method: BMallocIO::BMallocIO + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BMallocIO_Create(TPasObject PasObject) +{ + return new BMallocIO(); +} + + +/*********************************************************************** + * Method: BMallocIO::~BMallocIO + * Params: + * Effects: + ***********************************************************************/ +void BMallocIO_Free(BMallocIO *MallocIO) +{ + delete MallocIO; +} + + +/*********************************************************************** + * Method: BMallocIO::ReadAt + * Params: off_t pos, void *buffer, size_t size + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BMallocIO_ReadAt(BMallocIO *MallocIO, off_t pos, void *buffer, size_t size) +{ + return MallocIO->ReadAt(pos, buffer, size); +} + + +/*********************************************************************** + * Method: BMallocIO::WriteAt + * Params: off_t pos, const void *buffer, size_t size + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BMallocIO_WriteAt(BMallocIO *MallocIO, off_t pos, const void *buffer, size_t size) +{ + return MallocIO->WriteAt(pos, buffer, size); +} + + +/*********************************************************************** + * Method: BMallocIO::Seek + * Params: off_t pos, uint32 seek_mode + * Returns: off_t + * Effects: + ***********************************************************************/ +off_t +BMallocIO_Seek(BMallocIO *MallocIO, off_t pos, uint32 seek_mode) +{ + return MallocIO->Seek(pos, seek_mode); +} + + +/*********************************************************************** + * Method: BMallocIO::Position + * Params: + * Returns: off_t + * Effects: + ***********************************************************************/ +off_t +BMallocIO_Position(BMallocIO *MallocIO) +{ + return MallocIO->Position(); +} + + +/*********************************************************************** + * Method: BMallocIO::SetSize + * Params: off_t size + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMallocIO_SetSize(BMallocIO *MallocIO, off_t size) +{ + return MallocIO->SetSize(size); +} + + +/*********************************************************************** + * Method: BMallocIO::SetBlockSize + * Params: size_t blocksize + * Returns: void + * Effects: + ***********************************************************************/ +void +BMallocIO_SetBlockSize(BMallocIO *MallocIO, size_t blocksize) +{ + MallocIO->SetBlockSize(blocksize); +} + + +/*********************************************************************** + * Method: BMallocIO::Buffer + * Params: + * Returns: const void * + * Effects: + ***********************************************************************/ +const void * +BMallocIO_Buffer(BMallocIO *MallocIO) +{ + return MallocIO->Buffer(); +} + + +/*********************************************************************** + * Method: BMallocIO::BufferLength + * Params: + * Returns: size_t + * Effects: + ***********************************************************************/ +size_t +BMallocIO_BufferLength_1(BMallocIO *MallocIO) +{ + return MallocIO->BufferLength(); +} + +/*********************************************************************** + * Method: BMallocIO::operator= + * Params: const BMallocIO & + * Returns: BMallocIO & + * Effects: + ***********************************************************************/ +/*BMallocIO & +BMallocIO_operator=(BMallocIO *MallocIO, const BMallocIO &) +{ + return MallocIO->operator=(); +}*/ + + +/*********************************************************************** + * Method: BMemoryIO::BMemoryIO + * Params: void *p, size_t len + * Effects: + ***********************************************************************/ +TCPlusObject BMemoryIO_Create(TPasObject PasObject, void *p, size_t len) +{ + return new BMemoryIO(p, len); +} + + +/*********************************************************************** + * Method: BMemoryIO::BMemoryIO + * Params: const void *p, size_t len + * Effects: + ***********************************************************************/ +TCPlusObject BMemoryIO_Create_1 +(TPasObject PasObject, const void *p, size_t len) +{ + return new BMemoryIO(p, len); +} + + +/*********************************************************************** + * Method: BMemoryIO::~BMemoryIO + * Params: + * Effects: + ***********************************************************************/ +void BMemoryIO_Free(BMemoryIO *MemoryIO) +{ + delete MemoryIO; +} + + +/*********************************************************************** + * Method: BMemoryIO::ReadAt + * Params: off_t pos, void *buffer, size_t size + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BMemoryIO_ReadAt(BMemoryIO *MemoryIO, off_t pos, void *buffer, size_t size) +{ + return MemoryIO->ReadAt(pos, buffer, size); +} + + +/*********************************************************************** + * Method: BMemoryIO::WriteAt + * Params: off_t pos, const void *buffer, size_t size + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BMemoryIO_WriteAt(BMemoryIO *MemoryIO, off_t pos, const void *buffer, size_t size) +{ + return MemoryIO->WriteAt(pos, buffer, size); +} + + +/*********************************************************************** + * Method: BMemoryIO::Seek + * Params: off_t pos, uint32 seek_mode + * Returns: off_t + * Effects: + ***********************************************************************/ +off_t +BMemoryIO_Seek(BMemoryIO *MemoryIO, off_t pos, uint32 seek_mode) +{ + return MemoryIO->Seek(pos, seek_mode); +} + + +/*********************************************************************** + * Method: BMemoryIO::Position + * Params: + * Returns: off_t + * Effects: + ***********************************************************************/ +off_t +BMemoryIO_Position(BMemoryIO *MemoryIO) +{ + return MemoryIO->Position(); +} + + +/*********************************************************************** + * Method: BMemoryIO::SetSize + * Params: off_t size + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BMemoryIO_SetSize(BMemoryIO *MemoryIO, off_t size) +{ + return MemoryIO->SetSize(size); +} + +/*********************************************************************** + * Method: BMemoryIO::operator= + * Params: const BMemoryIO & + * Returns: BMemoryIO & + * Effects: + ***********************************************************************/ +/*BMemoryIO & +BMemoryIO_operator=(BMemoryIO *MemoryIO, const BMemoryIO &) +{ + return MemoryIO->operator=(); +}*/ + +#if defined(__cplusplus) +} +#endif + diff --git a/bepascal/source/bepascal/cpp/src/be/support/Flattenable.cpp b/bepascal/source/bepascal/cpp/src/be/support/Flattenable.cpp new file mode 100644 index 0000000..a2a48fb --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/support/Flattenable.cpp @@ -0,0 +1,89 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursière + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef _FLATTENABLE_CPP_ +#define _FLATTENABLE_CPP_ + +#include "Flattenable.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif +/*********************************************************************** + * AUTHOR: + * FILE: Flattenable.cpp + * DATE: Thu Jan 23 21:06:42 2003 + * DESCR: + ***********************************************************************/ + +/*********************************************************************** + * Method: BFlattenable::AllowsTypeCode + * Params: type_code code + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BFlattenable_AllowsTypeCode(BFlattenable *Flattenable, type_code code) +{ + return Flattenable->AllowsTypeCode(code); +} + + +/*********************************************************************** + * Method: BFlattenable::~BFlattenable + * Params: + * Effects: + ***********************************************************************/ +void BFlattenable_Free(BFlattenable *Flattenable) +{ + delete Flattenable; +} + +bool BFlattenable_IsFixedSize(BFlattenable *Flattenable) +{ + return Flattenable->IsFixedSize(); +} + +type_code BFlattenable_TypeCode(BFlattenable *Flattenable) +{ + return Flattenable->TypeCode(); +} + +ssize_t BFlattenable_FlattenedSize(BFlattenable *Flattenable) +{ + return Flattenable->FlattenedSize(); +} + +status_t BFlattenable_Flatten(BFlattenable *Flattenable,void *buffer, ssize_t size) +{ + return Flattenable->Flatten(buffer,size); +} + +status_t BFlattenable_Unflatten(BFlattenable *Flattenable,type_code c, const void *buf, ssize_t size) +{ + return Flattenable->Unflatten(c,buf,size); +} + + +#if defined(__cplusplus) +} +#endif + +#endif /* _FLATTENABLE_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/support/List.cpp b/bepascal/source/bepascal/cpp/src/be/support/List.cpp new file mode 100644 index 0000000..20358e8 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/support/List.cpp @@ -0,0 +1,346 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef _LIST_CPP_ +#define _LIST_CPP_ + +#include "List.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Method: BList::BList() + * Descr: + */ +TCPlusObject BList_Create( int32 itemsPerBlock) +{ + return new BList( itemsPerBlock); +} + + +/* + * Method: BList::BList() + * Descr: + */ +/*TCPlusObject BList_Create_1 +(TPasObject PasObject, const BList &) +{ + return new BPList(PasObject, ); +} +*/ + +/* + * Method: BList::~BList() + * Descr: + */ +void BList_Free(BList *List) +{ + delete List; +} + + +/* + * Method: BList::operator=() + * Descr: + */ +/*BList & +BList_operator=(BList *List, const BList &from) +{ + return List->operator=(from); +} +*/ + +/* + * Method: BList::AddItem() + * Descr: + */ +bool +BList_AddItem(BList *List, void *item) +{ + return List->AddItem(item); +} + + +/* + * Method: BList::AddItem() + * Descr: + */ +bool +BList_AddItem_1 +(BList *List, void *item, + int32 atIndex) +{ + return List->AddItem(item, + atIndex); +} + + +/* + * Method: BList::AddList() + * Descr: + */ +bool +BList_AddList(BList *List, BList *newItems) +{ + return List->AddList(newItems); +} + + +/* + * Method: BList::AddList() + * Descr: + */ +bool +BList_AddList_1 +(BList *List, BList *newItems, + int32 atIndex) +{ + return List->AddList(newItems, + atIndex); +} + + +/* + * Method: BList::RemoveItem() + * Descr: + */ +bool +BList_RemoveItem(BList *List, void *item) +{ + return List->RemoveItem(item); +} + + +/* + * Method: BList::RemoveItem() + * Descr: + */ +void * +BList_RemoveItem_1 +(BList *List, int32 index) +{ + return List->RemoveItem(index); +} + + +/* + * Method: BList::RemoveItems() + * Descr: + */ +bool +BList_RemoveItems_2 +(BList *List, int32 index, + int32 count) +{ + return List->RemoveItems(index, + count); +} + + +/* + * Method: BList::ReplaceItem() + * Descr: + */ +bool +BList_ReplaceItem(BList *List, int32 index, + void *newItem) +{ + return List->ReplaceItem(index, + newItem); +} + + +/* + * Method: BList::MakeEmpty() + * Descr: + */ +void +BList_MakeEmpty(BList *List) +{ + List->MakeEmpty(); +} + + +/* + * Method: BList::SwapItems() + * Descr: + */ +bool +BList_SwapItems(BList *List, int32 indexA, + int32 indexB) +{ + return List->SwapItems(indexA, + indexB); +} + + +/* + * Method: BList::MoveItem() + * Descr: + */ +bool +BList_MoveItem(BList *List, int32 fromIndex, + int32 toIndex) +{ + return List->MoveItem(fromIndex, + toIndex); +} + + +/* + * Method: BList::ItemAt() + * Descr: + */ +void * +BList_ItemAt(BList *List, int32 at) +{ + return List->ItemAt(at); +} + + +/* + * Method: BList::ItemAtFast() + * Descr: + */ +void * +BList_ItemAtFast_1 +(BList *List, int32 at) +{ + return List->ItemAtFast(at); +} + + +/* + * Method: BList::FirstItem() + * Descr: + */ +void * +BList_FirstItem(BList *List) +{ + return List->FirstItem(); +} + + +/* + * Method: BList::LastItem() + * Descr: + */ +void * +BList_LastItem(BList *List) +{ + return List->LastItem(); +} + + +/* + * Method: BList::Items() + * Descr: + */ +void * +BList_Items(BList *List) +{ + return List->Items(); +} + + +/* + * Method: BList::HasItem() + * Descr: + */ +bool +BList_HasItem(BList *List, void *item) +{ + return List->HasItem(item); +} + + +/* + * Method: BList::IndexOf() + * Descr: + */ +int32 +BList_IndexOf(BList *List, void *item) +{ + return List->IndexOf(item); +} + + +/* + * Method: BList::CountItems() + * Descr: + */ +int32 +BList_CountItems(BList *List) +{ + return List->CountItems(); +} + + +/* + * Method: BList::IsEmpty() + * Descr: + */ +bool +BList_IsEmpty(BList *List) +{ + return List->IsEmpty(); +} + + +/* + * Method: BList::_ReservedList1() + * Descr: + */ +/*void +BList__ReservedList1(BList *List) +{ + List->_ReservedList1(); +} +*/ + +/* + * Method: BList::_ReservedList2() + * Descr: + */ +/*void +BList__ReservedList2(BList *List) +{ + List->_ReservedList2(); +} +*/ + +/* + * Method: BList::Resize() + * Descr: + */ +/*void +BList_Resize(BList *List, int32 count) +{ + List->Resize(count); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _LIST_CPP_ */ + + diff --git a/bepascal/source/bepascal/cpp/src/be/support/String.cpp b/bepascal/source/bepascal/cpp/src/be/support/String.cpp new file mode 100644 index 0000000..3ca4f16 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/support/String.cpp @@ -0,0 +1,1751 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef _STRING_CPP_ +#define _STRING_CPP_ + +#include "String.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Method: BString::BString() + * Descr: + */ +TCPlusObject BString_Create() +{ + return new BString(); +} + + +/* + * Method: BString::BString() + * Descr: + */ +TCPlusObject BString_Create_1 +(TPasObject PasObject, const char *value) +{ + return new BString(value); +} + + +/* + * Method: BString::BString() + * Descr: + */ +/*TCPlusObject BString_Create_2 +(TPasObject PasObject, const BString &) +{ + return new BPString(PasObject, ); +} +*/ + +/* + * Method: BString::BString() + * Descr: + */ +/*TCPlusObject BString_Create_3 +(TPasObject PasObject, const char *, + int32 maxLength) +{ + return new BPString(PasObject, , + maxLength); +} + +*/ +/* + * Method: BString::~BString() + * Descr: + */ +void BString_Free(BString *String) +{ + delete String; +} + + +/* + * Method: BString::CountChars() + * Descr: + */ + +const char *BString_String(BString *String) +{ + return String->String(); +} + +int32 +BString_Length(BString *String) +{ + return String->Length(); +} + +int32 +BString_CountChars(BString *String) +{ + return String->CountChars(); +} + + +/* + * Method: BString::operator=() + * Descr: + */ +/*BString & +BString_operator=(BString *String, const BString &) +{ + return String->operator=(); +} +*/ + +/* + * Method: BString::operator=() + * Descr: + */ +/*BString & +BString_operator=_1 +(BString *String, const char *) +{ + return String->operator=(); +} +*/ + +/* + * Method: BString::operator=() + * Descr: + */ +/*BString & +BString_operator=_2 +(BString *String, char) +{ + return String->operator=(); +} + +*/ +/* + * Method: BString::SetTo() + * Descr: + */ +BString & +BString_SetTo(BString *String, const char *value, + int32 length) +{ + return String->SetTo(value,length); +} + + +/* + * Method: BString::SetTo() + * Descr: + */ +BString & +BString_SetTo_1 +(BString *String, const BString &from) +{ + return String->SetTo(from); +} + + +/* + * Method: BString::Adopt() + * Descr: + */ +BString & +BString_Adopt(BString *String, BString &from) +{ + return String->Adopt(from); +} + + +/* + * Method: BString::SetTo() + * Descr: + */ +BString & +BString_SetTo_2(BString *String, const BString &value, + int32 length) +{ + return String->SetTo(value, + length); +} + + +/* + * Method: BString::Adopt() + * Descr: + */ +BString & +BString_Adopt_1(BString *String, BString &from, + int32 length) +{ + return String->Adopt(from, + length); +} + + +/* + * Method: BString::SetTo() + * Descr: + */ +BString & +BString_SetTo_3(BString *String, char value, + int32 count) +{ + return String->SetTo(value, + count); +} + + +/* + * Method: BString::CopyInto() + * Descr: + */ +BString & +BString_CopyInto(BString *String, BString &into, + int32 fromOffset, + int32 length) +{ + return String->CopyInto(into, + fromOffset, + length); +} + + +/* + * Method: BString::CopyInto() + * Descr: + */ +void +BString_CopyInto_1 +(BString *String, char *into, + int32 fromOffset, + int32 length) +{ + String->CopyInto(into, + fromOffset, + length); +} + + +/* + * Method: BString::operator+=() + * Descr: + */ +/*BString & +BString_operator+=(BString *String, const char *) +{ + return String->operator+=(); +} +*/ + +/* + * Method: BString::operator+=() + * Descr: + */ +/*BString & +BString_operator+=_1 +(BString *String, char) +{ + return String->operator+=(); +} +*/ + +/* + * Method: BString::Append() + * Descr: + */ +BString & +BString_Append(BString *String, const BString &value, + int32 length) +{ + return String->Append(value, + length); +} + + +/* + * Method: BString::Append() + * Descr: + */ +BString & +BString_Append_1 +(BString *String, const char *value, + int32 length) +{ + return String->Append(value, + length); +} + + +/* + * Method: BString::Append() + * Descr: + */ +BString & +BString_Append_2 +(BString *String, char value, + int32 count) +{ + return String->Append(value, + count); +} + + +/* + * Method: BString::Prepend() + * Descr: + */ +BString & +BString_Prepend(BString *String, const char *value) +{ + return String->Prepend(value); +} + + +/* + * Method: BString::Prepend() + * Descr: + */ +BString & +BString_Prepend_1 +(BString *String, const BString &value) +{ + return String->Prepend(value); +} + + +/* + * Method: BString::Prepend() + * Descr: + */ +BString & +BString_Prepend_2 +(BString *String, const char *value, + int32 length) +{ + return String->Prepend(value,length); +} + + +/* + * Method: BString::Prepend() + * Descr: + */ +BString & +BString_Prepend_3 +(BString *String, const BString &value, + int32 length) +{ + return String->Prepend(value,length + ); +} + + +/* + * Method: BString::Prepend() + * Descr: + */ +BString & +BString_Prepend_4 +(BString *String, char value, + int32 count) +{ + return String->Prepend(value, + count); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert(BString *String, const char *value, + int32 pos) +{ + return String->Insert(value, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_1 +(BString *String, const char *value, + int32 length, + int32 pos) +{ + return String->Insert(value, + length, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_2 +(BString *String, const char *value, + int32 fromOffset, + int32 length, + int32 pos) +{ + return String->Insert(value, + fromOffset, + length, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_3 +(BString *String, const BString &value, + int32 pos) +{ + return String->Insert(value, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_4 +(BString *String, const BString &value, + int32 length, + int32 pos) +{ + return String->Insert(value, + length, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_5 +(BString *String, const BString &value, + int32 fromOffset, + int32 length, + int32 pos) +{ + return String->Insert(value, + fromOffset, + length, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_6 +(BString *String, char value, + int32 count, + int32 pos) +{ + return String->Insert(value, + count, + pos); +} + + +/* + * Method: BString::Truncate() + * Descr: + */ +BString & +BString_Truncate(BString *String, int32 newLength, + bool lazy) +{ +#ifdef B_BEOS_VERSION_DANO + // Dano's Truncate doesn't have the 'lazy' parameter + return String->Truncate(newLength); +#else + return String->Truncate(newLength, lazy); +#endif +} + + + +/* + * Method: BString::Remove() + * Descr: + */ +BString & +BString_Remove(BString *String, int32 from, + int32 length) +{ + return String->Remove(from, + length); +} + + +/* + * Method: BString::RemoveFirst() + * Descr: + */ +BString & +BString_RemoveFirst_1 +(BString *String, const BString &value) +{ + return String->RemoveFirst(value); +} + + +/* + * Method: BString::RemoveLast() + * Descr: + */ +BString & +BString_RemoveLast(BString *String, const BString &value) +{ + return String->RemoveLast(value); +} + + +/* + * Method: BString::RemoveAll() + * Descr: + */ +BString & +BString_RemoveAll(BString *String, const BString &value) +{ + return String->RemoveAll(value); +} + + +/* + * Method: BString::RemoveFirst() + * Descr: + */ +BString & +BString_RemoveFirst(BString *String, const char *value) +{ + return String->RemoveFirst(value); +} + + +/* + * Method: BString::RemoveLast() + * Descr: + */ +BString & +BString_RemoveLast_1(BString *String, const char *value) +{ + return String->RemoveLast(value); +} + + +/* + * Method: BString::RemoveAll() + * Descr: + */ +BString & +BString_RemoveAll_1(BString *String, const char *value) +{ + return String->RemoveAll(value); +} + + +/* + * Method: BString::RemoveSet() + * Descr: + */ +BString & +BString_RemoveSet(BString *String, const char *setOfCharsToRemove) +{ + return String->RemoveSet(setOfCharsToRemove); +} + + +/* + * Method: BString::MoveInto() + * Descr: + */ +BString & +BString_MoveInto(BString *String, BString &into, + int32 from, + int32 length) +{ + return String->MoveInto(into, + from, + length); +} + + +/* + * Method: BString::MoveInto() + * Descr: + */ +void +BString_MoveInto_1 +(BString *String, char *into, + int32 from, + int32 length) +{ + String->MoveInto(into, + from, + length); +} + + +/* + * Method: BString::operator<() + * Descr: + */ +/*bool +BString_operator<(BString *String, const char *) const +{ + return String->operator<(); +} +*/ + +/* + * Method: BString::operator<=() + * Descr: + */ +/*bool +BString_operator<=_1 +(BString *String, const char *) const +{ + return String->operator<=(); +} +*/ + +/* + * Method: BString::operator==() + * Descr: + */ +/*bool +BString_operator==(BString *String, const char *) const +{ + return String->operator==(); +} +*/ + +/* + * Method: BString::operator>=() + * Descr: + */ +/*bool +BString_operator>=(BString *String, const char *) const +{ + return String->operator>=(); +} +*/ + +/* + * Method: BString::operator>() + * Descr: + */ +/*bool +BString_operator>(BString *String, const char *) const +{ + return String->operator>(); +} +*/ + +/* + * Method: BString::Compare() + * Descr: + */ +int +BString_Compare(BString *String, const BString &value) +{ + return String->Compare(value); +} + + +/* + * Method: BString::Compare() + * Descr: + */ +int +BString_Compare_1 +(BString *String, const char *value) +{ + return String->Compare(value); +} + + +/* + * Method: BString::Compare() + * Descr: + */ +int +BString_Compare_2 +(BString *String, const BString &value, + int32 n) +{ + return String->Compare(value, + n); +} + + +/* + * Method: BString::Compare() + * Descr: + */ +int +BString_Compare_3 +(BString *String, const char *value, + int32 n) +{ + return String->Compare(value, + n); +} + + +/* + * Method: BString::ICompare() + * Descr: + */ +int +BString_ICompare(BString *String, const BString &value) +{ + return String->ICompare(value); +} + + +/* + * Method: BString::ICompare() + * Descr: + */ +int +BString_ICompare_1 +(BString *String, const char *value) +{ + return String->ICompare(value); +} + + +/* + * Method: BString::ICompare() + * Descr: + */ +int +BString_ICompare_2 +(BString *String, const BString &value, + int32 n) +{ + return String->ICompare(value, + n); +} + + +/* + * Method: BString::ICompare() + * Descr: + */ +int +BString_ICompare_3 +(BString *String, const char *value, + int32 n) +{ + return String->ICompare(value, + n); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst(BString *String, const BString &value) +{ + return String->FindFirst(value); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst_1 +(BString *String, const char *value) +{ + return String->FindFirst(value); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst_2 +(BString *String, const BString &value, + int32 fromOffset) +{ + return String->FindFirst(value, + fromOffset); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst_3 +(BString *String, const char *value, + int32 fromOffset) +{ + return String->FindFirst(value, + fromOffset); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst_4 +(BString *String, char value) +{ + return String->FindFirst(value); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst_5 +(BString *String, char value, + int32 fromOffset) +{ + return String->FindFirst(value, + fromOffset); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast(BString *String, const BString &value) +{ + return String->FindLast(value); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast_1 +(BString *String, const char *value) +{ + return String->FindLast(value); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast_2 +(BString *String, const BString &value, + int32 beforeOffset) +{ + return String->FindLast(value, + beforeOffset); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast_3 +(BString *String, const char *value, + int32 beforeOffset) +{ + return String->FindLast(value, + beforeOffset); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast_4 +(BString *String, char value) +{ + return String->FindLast(value); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast_5 +(BString *String, char value, + int32 fromOffset) +{ + return String->FindLast(value, + fromOffset); +} + + +/* + * Method: BString::IFindFirst() + * Descr: + */ +int32 +BString_IFindFirst(BString *String, const BString &value) +{ + return String->IFindFirst(value); +} + + +/* + * Method: BString::IFindFirst() + * Descr: + */ +int32 +BString_IFindFirst_1 +(BString *String, const char *value) +{ + return String->IFindFirst(value); +} + + +/* + * Method: BString::IFindFirst() + * Descr: + */ +int32 +BString_IFindFirst_2 +(BString *String, const BString &value, + int32 fromOffset) +{ + return String->IFindFirst(value, + fromOffset); +} + + +/* + * Method: BString::IFindFirst() + * Descr: + */ +int32 +BString_IFindFirst_3 +(BString *String, const char *value, + int32 fromOffset) +{ + return String->IFindFirst(value, + fromOffset); +} + + +/* + * Method: BString::IFindLast() + * Descr: + */ +int32 +BString_IFindLast(BString *String, const BString &value) +{ + return String->IFindLast(value); +} + + +/* + * Method: BString::IFindLast() + * Descr: + */ +int32 +BString_IFindLast_1 +(BString *String, const char *value) +{ + return String->IFindLast(value); +} + + +/* + * Method: BString::IFindLast() + * Descr: + */ +int32 +BString_IFindLast_2 +(BString *String, const BString &value, + int32 beforeOffset) +{ + return String->IFindLast(value, + beforeOffset); +} + + +/* + * Method: BString::IFindLast() + * Descr: + */ +int32 +BString_IFindLast_3 +(BString *String, const char *value, + int32 beforeOffset) +{ + return String->IFindLast(value, + beforeOffset); +} + + +/* + * Method: BString::ReplaceFirst() + * Descr: + */ +BString & +BString_ReplaceFirst(BString *String, char replaceThis, + char withThis) +{ + return String->ReplaceFirst(replaceThis, + withThis); +} + + +/* + * Method: BString::ReplaceLast() + * Descr: + */ +BString & +BString_ReplaceLast(BString *String, char replaceThis, + char withThis) +{ + return String->ReplaceLast(replaceThis, + withThis); +} + + +/* + * Method: BString::ReplaceAll() + * Descr: + */ +BString & +BString_ReplaceAll(BString *String, char replaceThis, + char withThis, + int32 fromOffset) +{ + return String->ReplaceAll(replaceThis, + withThis, + fromOffset); +} + + +/* + * Method: BString::Replace() + * Descr: + */ +BString & +BString_Replace(BString *String, char replaceThis, + char withThis, + int32 maxReplaceCount, + int32 fromOffset) +{ + return String->Replace(replaceThis, + withThis, + maxReplaceCount, + fromOffset); +} + + +/* + * Method: BString::ReplaceFirst() + * Descr: + */ +BString & +BString_ReplaceFirst_1 +(BString *String, const char *replaceThis, + const char *withThis) +{ + return String->ReplaceFirst(replaceThis, + withThis); +} + + +/* + * Method: BString::ReplaceLast() + * Descr: + */ +BString & +BString_ReplaceLast_1(BString *String, const char *replaceThis, + const char *withThis) +{ + return String->ReplaceLast(replaceThis, + withThis); +} + + +/* + * Method: BString::ReplaceAll() + * Descr: + */ +BString & +BString_ReplaceAll_1(BString *String, const char *replaceThis, + const char *withThis, + int32 fromOffset) +{ + return String->ReplaceAll(replaceThis, + withThis, + fromOffset); +} + + +/* + * Method: BString::Replace() + * Descr: + */ +BString & +BString_Replace_1(BString *String, const char *replaceThis, + const char *withThis, + int32 maxReplaceCount, + int32 fromOffset) +{ + return String->Replace(replaceThis, + withThis, + maxReplaceCount, + fromOffset); +} + + +/* + * Method: BString::IReplaceFirst() + * Descr: + */ +BString & +BString_IReplaceFirst(BString *String, char replaceThis, + char withThis) +{ + return String->IReplaceFirst(replaceThis, + withThis); +} + + +/* + * Method: BString::IReplaceLast() + * Descr: + */ +BString & +BString_IReplaceLast(BString *String, char replaceThis, + char withThis) +{ + return String->IReplaceLast(replaceThis, + withThis); +} + + +/* + * Method: BString::IReplaceAll() + * Descr: + */ +BString & +BString_IReplaceAll(BString *String, char replaceThis, + char withThis, + int32 fromOffset) +{ + return String->IReplaceAll(replaceThis, + withThis, + fromOffset); +} + + +/* + * Method: BString::IReplace() + * Descr: + */ +BString & +BString_IReplace(BString *String, char replaceThis, + char withThis, + int32 maxReplaceCount, + int32 fromOffset) +{ + return String->IReplace(replaceThis, + withThis, + maxReplaceCount, + fromOffset); +} + + +/* + * Method: BString::IReplaceFirst() + * Descr: + */ +BString & +BString_IReplaceFirst_1 +(BString *String, const char *replaceThis, + const char *withThis) +{ + return String->IReplaceFirst(replaceThis, + withThis); +} + + +/* + * Method: BString::IReplaceLast() + * Descr: + */ +BString & +BString_IReplaceLast_1(BString *String, const char *replaceThis, + const char *withThis) +{ + return String->IReplaceLast(replaceThis, + withThis); +} + + +/* + * Method: BString::IReplaceAll() + * Descr: + */ +BString & +BString_IReplaceAll_1(BString *String, const char *replaceThis, + const char *withThis, + int32 fromOffset) +{ + return String->IReplaceAll(replaceThis, + withThis, + fromOffset); +} + + +/* + * Method: BString::IReplace() + * Descr: + */ +BString & +BString_IReplace_1(BString *String, const char *replaceThis, + const char *withThis, + int32 maxReplaceCount, + int32 fromOffset) +{ + return String->IReplace(replaceThis, + withThis, + maxReplaceCount, + fromOffset); +} + + +/* + * Method: BString::ReplaceSet() + * Descr: + */ +BString & +BString_ReplaceSet(BString *String, const char *setOfChars, + char with) +{ + return String->ReplaceSet(setOfChars, + with); +} + + +/* + * Method: BString::ReplaceSet() + * Descr: + */ +BString & +BString_ReplaceSet_1 +(BString *String, const char *setOfChars, + const char *with) +{ + return String->ReplaceSet(setOfChars, + with); +} + + +/* + * Method: BString::operator[]() + * Descr: + */ +/*char & +BString_operator[](BString *String, int32 index) +{ + return String->operator[](index); +} +*/ + +/* + * Method: BString::LockBuffer() + * Descr: + */ +char * +BString_LockBuffer(BString *String, int32 maxLength) +{ + return String->LockBuffer(maxLength); +} + + +/* + * Method: BString::UnlockBuffer() + * Descr: + */ +BString & +BString_UnlockBuffer(BString *String, int32 length) +{ + return String->UnlockBuffer(length); +} + + +/* + * Method: BString::ToLower() + * Descr: + */ +BString & +BString_ToLower(BString *String) +{ + return String->ToLower(); +} + + +/* + * Method: BString::ToUpper() + * Descr: + */ +BString & +BString_ToUpper(BString *String) +{ + return String->ToUpper(); +} + + +/* + * Method: BString::Capitalize() + * Descr: + */ +BString & +BString_Capitalize(BString *String) +{ + return String->Capitalize(); +} + + +/* + * Method: BString::CapitalizeEachWord() + * Descr: + */ +BString & +BString_CapitalizeEachWord_1 +(BString *String) +{ + return String->CapitalizeEachWord(); +} + + +/* + * Method: BString::CharacterEscape() + * Descr: + */ +BString & +BString_CharacterEscape(BString *String, const char *original, + const char *setOfCharsToEscape, + char escapeWith) +{ + return String->CharacterEscape(original, + setOfCharsToEscape, + escapeWith); +} + + +/* + * Method: BString::CharacterEscape() + * Descr: + */ +BString & +BString_CharacterEscape_1 +(BString *String, const char *setOfCharsToEscape, + char escapeWith) +{ + return String->CharacterEscape(setOfCharsToEscape, + escapeWith); +} + + +/* + * Method: BString::CharacterDeescape() + * Descr: + */ +BString & +BString_CharacterDeescape(BString *String, const char *original, + char escapeChar) +{ + return String->CharacterDeescape(original, + escapeChar); +} + + +/* + * Method: BString::CharacterDeescape() + * Descr: + */ +BString & +BString_CharacterDeescape_1 +(BString *String, char escapeChar) +{ + return String->CharacterDeescape(escapeChar); +} + + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<(BString *String, const char *) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_1 +(BString *String, const BString &) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_2 +(BString *String, char) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_3 +(BString *String, int) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_4 +(BString *String, unsigned int) +{ + return String->operator<<(); +} + +*/ +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_5 +(BString *String, uint32) +{ + return String->operator<<(); +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_6 +(BString *String, int32) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_7 +(BString *String, uint64) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_8 +(BString *String, int64) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_9 +(BString *String, float) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::_Init() + * Descr: + */ +/*void +BString__Init(BString *String, const char *value, + int32 lenght) +{ + String->_Init(value,lenght + ); +} +*/ + +/* + * Method: BString::_DoAssign() + * Descr: + */ +/*void +BString__DoAssign(BString *String, const char *value, + int32 lenght) +{ + String->_DoAssign(value,lenght + ); +} +*/ + +/* + * Method: BString::_DoAppend() + * Descr: + */ +/*void +BString__DoAppend(BString *String, const char *, + int32) +{ + String->_DoAppend(, + ); +} + +*/ +/* + * Method: BString::_GrowBy() + * Descr: + */ +/*char * +BString__GrowBy(BString *String, int32) +{ + return String->_GrowBy(); +} +*/ + +/* + * Method: BString::_OpenAtBy() + * Descr: + */ +/*char * +BString__OpenAtBy(BString *String, int32, + int32) +{ + return String->_OpenAtBy(, + ); +} +*/ + +/* + * Method: BString::_ShrinkAtBy() + * Descr: + */ +/*char * +BString__ShrinkAtBy(BString *String, int32, + int32) +{ + return String->_ShrinkAtBy(, + ); +} +*/ + +/* + * Method: BString::_DoPrepend() + * Descr: + */ +/*void +BString__DoPrepend(BString *String, const char *, + int32) +{ + String->_DoPrepend(, + ); +} +*/ + +/* + * Method: BString::_FindAfter() + * Descr: + */ +/*int32 +BString__FindAfter(BString *String, const char *, + int32, + int32) const +{ + return String->_FindAfter(, + , + ); +} +*/ + +/* + * Method: BString::_IFindAfter() + * Descr: + */ +/*int32 +BString__IFindAfter(BString *String, const char *, + int32, + int32) const +{ + return String->_IFindAfter(, + , + ); +} + +*/ +/* + * Method: BString::_ShortFindAfter() + * Descr: + */ +/*int32 +BString__ShortFindAfter(BString *String, const char *, + int32) const +{ + return String->_ShortFindAfter(, + ); +} +*/ + +/* + * Method: BString::_FindBefore() + * Descr: + */ +/*int32 +BString__FindBefore(BString *String, const char *, + int32, + int32) const +{ + return String->_FindBefore(, + , + ); +} +*/ + +/* + * Method: BString::_IFindBefore() + * Descr: + */ +/*int32 +BString__IFindBefore(BString *String, const char *, + int32, + int32) const +{ + return String->_IFindBefore(, + , + ); +} +*/ + +/* + * Method: BString::_SetLength() + * Descr: + */ +/*void +BString__SetLength(BString *String, int32) +{ + String->_SetLength(); +} +*/ + +/* + * Method: BString::_SetUsingAsCString() + * Descr: + */ +/*void +BString__SetUsingAsCString(BString *String, bool) +{ + String->_SetUsingAsCString(); +} +*/ + +/* + * Method: BString::_AssertNotUsingAsCString() + * Descr: + */ +/*void +BString__AssertNotUsingAsCString(BString *String) const +{ + String->_AssertNotUsingAsCString(); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _STRING_CPP_ */ + + diff --git a/bepascal/source/bepascal/cpp/src/hey/hey.cpp b/bepascal/source/bepascal/cpp/src/hey/hey.cpp new file mode 100644 index 0000000..116b4a8 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/hey/hey.cpp @@ -0,0 +1,1340 @@ +// hey +// a small scripting utility +// written by Attila Mezei (attila.mezei@mail.datanet.hu) +// contributions by Sander Stoks, Peter Folk, Chris Herborth, Marco Nelissen, Scott Lindsey and others +// +// public domain, use it at your own risk +// +// 1.2.6: syntax extended by Sander Stoks to allow: +// "hey Application let Specifier do ..." +// allowing you to send messages directly to other handlers than the app itself. +// In cooperation with the new Application defined commands (note that some +// Be classes, e.g. BWindow, publish commands as well) this allows, for example: +// "hey NetPositive let Window 0 do MoveBy BPoint[10,10]" +// Note that this is partly redundant, since +// "hey NetPositive let Window 0 do get Title" +// duplicates "hey NetPositive get Title of Window 0" +// But with the old system, +// "hey NetPositive MoveBy of Window 0 with data=BPoint[10,10]" +// couldn't work ("MoveBy" is not defined by the Application itself). +// +// 1.2.5: value_info is supported in BPropertyInfo. This means when you send GETSUITES (B_GET_SUPPORTED_SUITES) +// the value info is printed after the property infos, like this: +// "messages" (B_PROPERTY_INFO_TYPE) : +// property commands specifiers +// -------------------------------------------------------------------------------- +// Suites B_GET_PROPERTY DIRECT +// Messenger B_GET_PROPERTY DIRECT +// InternalName B_GET_PROPERTY DIRECT +// +// name value kind +// -------------------------------------------------------------------------------- +// Backup 0x6261636B ('back') COMMAND +// Usage: This command backs up your hard drive. +// Abort 0x61626F72 ('abor') COMMAND +// Usage: Stops the current operation... +// Type Code 0x74797065 ('type') TYPE CODE +// Usage: Type code info... +// +// You can also use the application defined commands (as the verb) with hey: +// hey MyBackupApp Backup "Maui" +// +// 1.2.4: the syntax is extended by Peter Folk to contain: +// do the x of y -3 of z '"1"' +// I.e. "do" => B_EXECUTE_PROPERTY, optional "the" makes direct specifiers +// more like english, bare reverse-index-specifiers are now handled, and +// named specifiers can contain only digits by quoting it (but make sure the +// shell passed the quotes through). +// +// Hey(target,const char*,reply) was previously limited to 100 tokens. It +// now uses a vector<> so it's only limited by available memory. +// +// Also, the archive name is now Y2K compliant =) +// +// 1.2.3: new option: -s for silent processing (no reply or errors printed) AM +// +// 1.2.2: Fixes by Marco Nelissen (marcone@xs4all.nl) +// - fixed parsing of negative numbers +// - fixed "with" syntax, which was broken (after a create, "with" would be taken as a specifier) +// +// 1.2.1: compiled for x86, R4 with minor modifications at BPropertyInfo +// +// 1.2.0: the syntax is extended by Sander Stoks (sander@adamation.com) to contain +// with name= [and name= [...]] +// at the end of the command which will add additional data to the scripting message. E.g: +// hey Becasso create Canvas with name=MyCanvas and size=BRect(100,100,300,300) +// Also a small interpreter is included. +// +// Detailed printout of B_PROPERTY_INFO in BMessages. Better than BPropertyInfo::PrintToStream(). +// Also prints usage info for a property if defined. +// +// 1.1.1: minor change from chrish@qnx.com to return -1 if an error is +// sent back in the reply message; also added B_COUNT_PROPERTIES support +// +// The range specifier sent to the target was 1 greater than it should've been. Fixed. +// +// 'hey' made the assumption that the first thread in a team will be the +// application thread (and therefore have the application's name). +// This was not always the case. Fix from Scott Lindsey . +// +//v1.1.0: Flattened BPropertyInfo is printed if found in the reply of B_GET_SUPPORTED_SUITES +// 1,2,3 and 4 character message constant is supported (e.g. '1', '12', '123', '1234') +// Alpha is sent with rgb_color +// +//v1.0.0 First public release + + +#include "hey.h" +#include +#include +#include +#include +#include +#include + +const char VERSION[]="v1.2.6"; + +#define DEBUG_HEY 0 // 1: prints the script message to be sent to the target application, 0: prints only the reply + + +// test, these should be zero for normal operation +#define TEST_VALUEINFO 0 + + +// flag for silent mode +bool silent; + + +int main(int argc, char *argv[]) +{ + BApplication app("application/x-amezei-hey"); + + if (argc < 2) { + fprintf(stderr, "hey %s, written by Attila Mezei (attila.mezei@mail.datanet.hu)\n" \ + "usage: hey [-s] [let do] >* [to ] [with name= [and name=]*]\n" \ + "where : DO|GET|SET|COUNT|CREATE|DELETE|GETSUITES|QUIT|SAVE|LOAD|'what'\n" \ + " : [the] [ | name | \"name\" | '\"name\"' ]\n" \ + " : int | -int | '['int']' | '['-int']' | '['startint to end']'\n" \ + " : \"string\" | | | bool(value) | int8(value)\n" \ + " | int16(value) | int32(value) | float(value) | double(value)\n" \ + " | BPoint(x,y) | BRect(l,t,r,b) | rgb_color(r,g,b,a) | file(path)\n" \ + "options: -s: silent\n\n", VERSION); + // Updated Usage string to reflect "do", "the", bare -index, and '"name"' changes below + // -- pfolk@uni.uiuc.edu 1999-11-03 + + return -1; + } + + int32 argapp = 1; + silent=false; + + if(strcmp(argv[1], "-s")==0 || strcmp(argv[1], "-S")==0){ + silent=true; + argapp++; + } + + // find the application + BMessenger the_application; + BList team_list; + team_id teamid; + app_info appinfo; + + be_roster->GetAppList(&team_list); + for(int32 i=0;iGetRunningAppInfo(teamid, &appinfo); + if(strcmp(appinfo.signature, argv[argapp])==0){ + the_application=BMessenger(appinfo.signature); + break; + }else{ + if(strcmp(appinfo.ref.name, argv[argapp])==0){ + the_application=BMessenger(0, teamid); + break; + } + } + } + + if(!the_application.IsValid()){ + if(!silent) fprintf(stderr, "Cannot find the application (%s)\n", argv[argapp]); + return -1; + } + + if (argc < 3) { + if(!silent) fprintf(stderr, "Cannot find the verb!\n"); + return -1; + } + + + BMessage the_reply; + int32 argx = argapp+1; +// const char *test_string = "set File of Window Sample to file(/boot/home/media/images/BeLogo.psd)"; +// status_t err = Hey(&the_application, test_string, &the_reply); + status_t err = Hey(&the_application, argv, &argx, argc, &the_reply); + + if (err!=B_OK) { + if(!silent) fprintf(stderr, "Error when sending message to %s!\n", argv[argapp]); + return -1; + } else { + if(the_reply.what==(uint32)B_MESSAGE_NOT_UNDERSTOOD || the_reply.what==(uint32)B_ERROR){ // I do it myself + if(the_reply.HasString("message")){ + if(!silent) printf("%s (error 0x%8lX)\n", the_reply.FindString("message"), the_reply.FindInt32("error")); + }else{ + if(!silent) printf("error 0x%8lX\n", the_reply.FindInt32("error")); + } + }else{ + if(!silent){ + printf("Reply "); + print_message(&the_reply); + printf("\n"); + } + } + } + + return 0; +} + + +int32 HeyInterpreterThreadHook(void* arg) +{ + if (arg) { + BMessage environment(*(BMessage*) arg); + char* prompt = "Hey"; + if (environment.HasString("prompt")) environment.FindString("prompt", (const char **)&prompt); + printf("%s> ", prompt); + + BMessenger target; + if (environment.HasMessenger("Target")) environment.FindMessenger("Target", &target); + + char command[1024]; + status_t err; + BMessage reply; + while (gets(command)) { + reply.MakeEmpty(); + err = Hey(&target, command, &reply); + if (!err) { + print_message(&reply); + } else { + printf("Error!\n"); + } + printf("%s> ", prompt); + } + + return 0; + + } else { + return 1; + } +} + +status_t Hey(BMessenger* target, const char* arg, BMessage* reply) +{ + vector argv; // number of tokens is now limited only by memory -- pfolk@uni.uiuc.edu 1999-11-03 + char* tokens = new char[strlen(arg)*2]; + char* currentToken = tokens; + int32 tokenNdex = 0; + int32 argNdex = 0; + bool inquotes = false; + + while (arg[argNdex] != 0) { // for each character in arg + if (arg[argNdex] == '\"') inquotes = !inquotes; + if (!inquotes && isSpace(arg[argNdex])) { // if the character is white space + if (tokenNdex!=0) { // close off currentToken token + currentToken[tokenNdex] = 0; + argv.push_back(currentToken); + currentToken += tokenNdex+1; + tokenNdex=0; + argNdex++; + } else { // just skip the whitespace + argNdex++; + } + } else { // copy char into current token + currentToken[tokenNdex] = arg[argNdex]; + tokenNdex++; + argNdex++; + } + } + + if (tokenNdex!=0) { // close off currentToken token + currentToken[tokenNdex] = 0; + argv.push_back(currentToken); + } + argv.push_back(NULL); + + int32 argx = 0; + status_t ret = Hey(target, argv.begin(), &argx, argv.size()-1, reply); + // This used to be "return Hey(...);"---so tokens wasn't delete'd. -- pfolk@uni.uiuc.edu 1999-11-03 + delete tokens; + return ret; +} + +bool isSpace(char c) +{ + switch (c) { + case ' ': + case '\t': + return true; + + default: + return false; + } +} + +status_t Hey(BMessenger* target, char* argv[], int32* argx, int32 argc, BMessage* reply) +{ + bool direct_what = false; + BMessage the_message; + if(strcasecmp(argv[*argx], "let")==0){ // added "let" -- sander@adamation.com 31may2000 + BMessage get_target (B_GET_PROPERTY); + get_target.AddSpecifier ("Messenger"); + // parse the specifiers + (*argx)++; + status_t result=B_OK; + while((result=add_specifier(&get_target, argv, argx, argc))==B_OK){}; + + if(result!=B_ERROR){ // bad syntax + if(!silent) fprintf(stderr, "Bad specifier syntax!\n"); + return result; + } + BMessage msgr; + if (target && target->IsValid()) { + result = target->SendMessage(&get_target, &msgr); + if (result!=B_OK) return result; + result = msgr.FindMessenger ("result", target); + if (result!=B_OK) { + if (!silent) fprintf(stderr, "Couldn't retrieve the BMessenger!\n"); + return result; + } + } + if (!argv[*argx]) { + if (!silent) fprintf(stderr, "Syntax error - forgot \"do\"?\n"); + return B_ERROR; + } + } + if(strcasecmp(argv[*argx], "do")==0){ // added "do" -- pfolk@uni.uiuc.edu 1999-11-03 + the_message.what=B_EXECUTE_PROPERTY; + }else if(strcasecmp(argv[*argx], "get")==0){ + the_message.what=B_GET_PROPERTY; + }else if(strcasecmp(argv[*argx], "set")==0){ + the_message.what=B_SET_PROPERTY; + }else if(strcasecmp(argv[*argx], "create")==0){ + the_message.what=B_CREATE_PROPERTY; + }else if(strcasecmp(argv[*argx], "delete")==0){ + the_message.what=B_DELETE_PROPERTY; + }else if(strcasecmp(argv[*argx], "quit")==0){ + the_message.what=B_QUIT_REQUESTED; + }else if(strcasecmp(argv[*argx], "save")==0){ + the_message.what=B_SAVE_REQUESTED; + }else if(strcasecmp(argv[*argx], "load")==0){ + the_message.what=B_REFS_RECEIVED; + }else if(strcasecmp(argv[*argx], "count")==0){ + the_message.what=B_COUNT_PROPERTIES; + }else if(strcasecmp(argv[*argx], "getsuites")==0){ + the_message.what=B_GET_SUPPORTED_SUITES; + }else{ + switch(strlen(argv[*argx])){ // can be a message constant if 1,2,3 or 4 chars + case 1: + the_message.what=(int32)argv[*argx][0]; + break; + case 2: + the_message.what=(((int32)argv[*argx][0])<<8)|(((int32)argv[*argx][1])); + break; + case 3: + the_message.what=(((int32)argv[*argx][0])<<16)|(((int32)argv[*argx][1])<<8)|(((int32)argv[*argx][2])); + break; + case 4: + the_message.what=(((int32)argv[*argx][0])<<24)|(((int32)argv[*argx][1])<<16)|(((int32)argv[*argx][2])<<8)|(((int32)argv[*argx][3])); + break; + default: + // maybe this is a user defined command, ask for the supported suites + bool found=false; + if (target && target->IsValid()) { + BMessage rply; + BMessage req(B_GET_SUPPORTED_SUITES); + if(target->SendMessage(&req, &rply)==B_OK){ + // if all goes well, rply contains all kinds of property infos + int32 j=0; + void *voidptr; + int32 sizefound; + BPropertyInfo propinfo; + const value_info *vinfo; + int32 vinfo_index, vinfo_count; + +// const char *str; +// while (rply.FindString("suites", j++, &str) == B_OK) +// printf ("Suite %ld: %s\n", j, str); +// +// j = 0; + while(rply.FindData("messages", B_PROPERTY_INFO_TYPE, j++, (const void **)&voidptr, &sizefound)==B_OK && !found){ + if(propinfo.Unflatten(B_PROPERTY_INFO_TYPE, (const void *)voidptr, sizefound)==B_OK){ + vinfo=propinfo.Values(); + vinfo_index=0; + vinfo_count=propinfo.CountValues(); +#if TEST_VALUEINFO>0 + value_info vinfo[10]={ {"Backup", 'back', B_COMMAND_KIND, "This command backs up your hard drive."}, + {"Abort", 'abor', B_COMMAND_KIND, "Stops the current operation..."}, + {"Type Code", 'type', B_TYPE_CODE_KIND, "Type code info..."} + }; + vinfo_count=3; +#endif + + while(vinfo_index0 + printf("FOUND COMMAND \"%s\" = %lX\n", vinfo[vinfo_index].name, the_message.what); +#endif + break; + } + vinfo_index++; + } + + } + } + } + } + + + if(!found){ + if(!silent) fprintf(stderr, "Bad verb (\"%s\")\n", argv[*argx]); + return -1; + } + } + direct_what = true; + } + + status_t result=B_OK; + (*argx)++; + + // One exception: Single data item at end of line. + if (direct_what && *argx == argc - 1 && argv[*argx] != NULL) { + add_data(&the_message, argv, argx); + } + else { + // parse the specifiers + if(the_message.what!=B_REFS_RECEIVED){ // LOAD has no specifier + while((result=add_specifier(&the_message, argv, argx, argc))==B_OK){}; + + if(result!=B_ERROR){ // bad syntax + if(!silent) fprintf(stderr, "Bad specifier syntax!\n"); + return result; + } + } + } + + // if verb is SET or LOAD, there should be a to + if((the_message.what==B_SET_PROPERTY || the_message.what==B_REFS_RECEIVED) && argv[*argx]!=NULL){ + if(strcasecmp(argv[*argx], "to")==0){ + (*argx)++; + } + result=add_data(&the_message, argv, argx); + if(result!=B_OK){ + if(result==B_FILE_NOT_FOUND){ + if(!silent) fprintf(stderr, "File not found!\n"); + }else{ + if(!silent) fprintf(stderr, "Invalid 'to...' value format!\n"); + } + return result; + } + } + + add_with(&the_message, argv, argx, argc); + +#if DEBUG_HEY>0 + fprintf(stderr, "Send "); + print_message(&the_message); + fprintf(stderr, "\n"); +#endif + + if (target && target->IsValid()) { + if (reply) { + result = target->SendMessage(&the_message, reply); + } else { + result = target->SendMessage(&the_message); + } + } + return result; +} + +// There can be a with =() [and = ...] +// I treat "and" just the same as "with", it's just to make the script syntax more English-like. +status_t add_with(BMessage *to_message, char *argv[], int32 *argx, int32 argc) +{ + status_t result=B_OK; + if(*argx < argc - 1 && argv[++(*argx)]!=NULL){ + // printf ("argv[%ld] = %s\n", *argx, argv[*argx]); + if(strcasecmp(argv[*argx], "with")==0){ + // printf ("\"with\" detected!\n"); + (*argx)++; + bool done = false; + do + { + result=add_data(to_message, argv, argx); + if(result!=B_OK){ + if(result==B_FILE_NOT_FOUND){ + if(!silent) fprintf(stderr, "File not found!\n"); + }else{ + if(!silent) fprintf(stderr, "Invalid 'with...' value format!\n"); + } + return result; + } + (*argx)++; + // printf ("argc = %d, argv[%d] = %s\n", argc, *argx, argv[*argx]); + if (*argx < argc - 1 && strcasecmp(argv[*argx], "and")==0) + { + (*argx)++; + } + else + done = true; + } while (!done); + } + } + return result; +} + +// returns B_OK if successful +// B_ERROR if no more specifiers +// B_BAD_SCRIPT_SYNTAX if syntax error +status_t add_specifier(BMessage *to_message, char *argv[], int32 *argx, int32 argc) +{ + + char *property=argv[*argx]; + + if(property==NULL) return B_ERROR; // no more specifiers + + (*argx)++; + + if(strcasecmp(property, "do")==0){ // Part of the "hey App let Specifier do Verb". + return B_ERROR; // no more specifiers + } + + if(strcasecmp(property, "to")==0){ // it is the 'to' string!!! + return B_ERROR; // no more specifiers + } + + if(strcasecmp(property, "with")==0){ // it is the 'with' string!!! + *argx -= 2; + add_with (to_message, argv, argx, argc); + return B_ERROR; // no more specifiers + } + + if(strcasecmp(property, "of")==0){ // skip "of", read real property + property=argv[*argx]; + if(property==NULL) return B_BAD_SCRIPT_SYNTAX; // bad syntax + (*argx)++; + } + + if(strcasecmp(property, "the")==0){ // skip "the", read real property -- pfolk@uni.uiuc.edu 1999-11-03 + property=argv[*argx]; + if(property==NULL) return B_BAD_SCRIPT_SYNTAX; // bad syntax + (*argx)++; + } + + // decide the specifier + + char *specifier=NULL; + if(to_message->what==B_CREATE_PROPERTY) // create is always direct. without this, a "with" would be taken as a specifier + (*argx)--; + else + specifier=argv[*argx]; + if(specifier==NULL){ // direct specifier + to_message->AddSpecifier(property); + return B_ERROR; // no more specifiers + } + + (*argx)++; + + if(strcasecmp(specifier, "of")==0){ // direct specifier + to_message->AddSpecifier(property); + return B_OK; + } + + if(strcasecmp(specifier, "to")==0){ // direct specifier + to_message->AddSpecifier(property); + return B_ERROR; // no more specifiers + } + + + if(specifier[0]=='['){ // index, reverse index or range + char *end; + int32 ix1, ix2; + if(specifier[1]=='-'){ // reverse index + ix1=strtoul(specifier+2, &end, 10); + BMessage revspec(B_REVERSE_INDEX_SPECIFIER); + revspec.AddString("property", property); + revspec.AddInt32("index", ix1); + to_message->AddSpecifier(&revspec); + }else{ // index or range + ix1=strtoul(specifier+1, &end, 10); + if(end[0]==']'){ // it was an index + to_message->AddSpecifier(property, ix1); + return B_OK; + }else{ + specifier=argv[*argx]; + if(specifier==NULL){ + // I was wrong, it was just an index + to_message->AddSpecifier(property, ix1); + return B_OK; + } + (*argx)++; + if(strcasecmp(specifier, "to")==0){ + specifier=argv[*argx]; + if(specifier==NULL){ + return B_BAD_SCRIPT_SYNTAX; // wrong syntax + } + (*argx)++; + ix2=strtoul(specifier, &end, 10); + to_message->AddSpecifier(property, ix1, ix2-ix1>0 ? ix2-ix1 : 1); + return B_OK; + }else{ + return B_BAD_SCRIPT_SYNTAX; // wrong syntax + } + } + } + }else{ // name specifier + // if it contains only digits, it will be an index... + bool index_spec=true; + bool reverse = specifier[0]=='-'; + // accept bare reverse-index-specs -- pfolk@uni.uiuc.edu 1999-11-03 + size_t speclen = strlen(specifier); + for (int32 i=(reverse?1:0); i<(int32)speclen; ++i){ + if(specifier[i]<'0' || specifier[i]>'9'){ + index_spec=false; + break; + } + } + + if(index_spec){ + if (reverse) + { + // Copied from above -- pfolk@uni.uiuc.edu 1999-11-03 + BMessage revspec(B_REVERSE_INDEX_SPECIFIER); + revspec.AddString("property", property); + revspec.AddInt32("index", atol(specifier+1)); + to_message->AddSpecifier(&revspec); + } + else to_message->AddSpecifier(property, atol(specifier)); + }else{ + // Allow any name by counting an initial " as a literal-string indicator + // -- pfolk@uni.uiuc.edu 1999-11-03 + if(specifier[0]=='\"') + { + if (specifier[speclen-1]=='\"') + specifier[speclen-1]='\0'; + ++specifier; + --speclen; + } + to_message->AddSpecifier(property, specifier); + } + + } + + return B_OK; +} + + +status_t add_data(BMessage *to_message, char *argv[], int32 *argx) +{ + char *valuestring=argv[*argx]; + + if(valuestring==NULL) return B_ERROR; + + // try to interpret it as an integer or float + bool contains_only_digits=true; + bool is_floating_point=false; + for(int32 i=0;i<(int32)strlen(valuestring);i++){ + if(i!=0 || valuestring[i]!='-') { + if(valuestring[i]<'0' || valuestring[i]>'9'){ + if(valuestring[i]=='.'){ + is_floating_point=true; + }else{ + contains_only_digits=false; + break; + } + } + } + } + //printf("%d %d\n", contains_only_digits,is_floating_point); + if(contains_only_digits){ + if(is_floating_point){ + to_message->AddFloat("data", atof(valuestring)); + return B_OK; + }else{ + to_message->AddInt32("data", atol(valuestring)); + return B_OK; + } + } + + // if true or false, it is bool + if(strcasecmp(valuestring, "true")==0){ + to_message->AddBool("data", true); + return B_OK; + }else if(strcasecmp(valuestring, "false")==0){ + to_message->AddBool("data", false); + return B_OK; + } + + // Add support for "=()" here: + // The type is then added under the name "name". + + #define MAX_NAME_LENGTH 128 + char curname[MAX_NAME_LENGTH]; + strcpy (curname, "data"); // This is the default. + + char *s = valuestring; + while (*++s && *s != '=') + // Look for a '=' character... + ; + if (*s == '=') // We found a = + { + *s = 0; + strcpy (curname, valuestring); // Use the new + valuestring = s + 1; // Reposition the valuestring ptr. + } + + // must begin with a type( value ) + if(strncasecmp(valuestring, "int8", strlen("int8"))==0){ + to_message->AddInt8(curname, atol(valuestring+strlen("int8("))); + return B_OK; + }else if(strncasecmp(valuestring, "int16", strlen("int16"))==0){ + to_message->AddInt16(curname, atol(valuestring+strlen("int16("))); + return B_OK; + }else if(strncasecmp(valuestring, "int32", strlen("int32"))==0){ + to_message->AddInt32(curname, atol(valuestring+strlen("int32("))); + return B_OK; + }else if(strncasecmp(valuestring, "int64", strlen("int64"))==0){ + to_message->AddInt64(curname, atol(valuestring+strlen("int64("))); + return B_OK; + }else if(strncasecmp(valuestring, "bool", strlen("bool"))==0){ + if(strncasecmp(valuestring+strlen("bool("), "true", 4)==0){ + to_message->AddBool(curname, true); + }else if(strncasecmp(valuestring+strlen("bool("), "false", 5)==0){ + to_message->AddBool(curname, false); + }else{ + to_message->AddBool(curname, atol(valuestring+strlen("bool("))==0 ? false : true); + } + return B_OK; + }else if(strncasecmp(valuestring, "float", strlen("float"))==0){ + to_message->AddFloat(curname, atof(valuestring+strlen("float("))); + return B_OK; + }else if(strncasecmp(valuestring, "double", strlen("double"))==0){ + to_message->AddDouble(curname, atof(valuestring+strlen("double("))); + return B_OK; + }else if(strncasecmp(valuestring, "BPoint", strlen("BPoint"))==0){ + float x,y; + x=atof(valuestring+strlen("BPoint(")); + if(strchr(valuestring, ',')){ + y=atof(strchr(valuestring, ',')+1); + }else if(strchr(valuestring, ' ')){ + y=atof(strchr(valuestring, ' ')+1); + }else{ // bad syntax + y=0.0f; + } + to_message->AddPoint(curname, BPoint(x,y)); + return B_OK; + }else if(strncasecmp(valuestring, "BRect", strlen("BRect"))==0){ + float l=0.0f, t=0.0f, r=0.0f, b=0.0f; + char *ptr; + l=atof(valuestring+strlen("BRect(")); + ptr=strchr(valuestring, ','); + if(ptr){ + t=atof(ptr+1); + ptr=strchr(ptr+1, ','); + if(ptr){ + r=atof(ptr+1); + ptr=strchr(ptr+1, ','); + if(ptr){ + b=atof(ptr+1); + } + } + } + + to_message->AddRect(curname, BRect(l,t,r,b)); + return B_OK; + }else if(strncasecmp(valuestring, "rgb_color", strlen("rgb_color"))==0){ + rgb_color clr; + char *ptr; + clr.red=atol(valuestring+strlen("rgb_color(")); + ptr=strchr(valuestring, ','); + if(ptr){ + clr.green=atol(ptr+1); + ptr=strchr(ptr+1, ','); + if(ptr){ + clr.blue=atol(ptr+1); + ptr=strchr(ptr+1, ','); + if(ptr){ + clr.alpha=atol(ptr+1); + } + } + } + + to_message->AddData(curname, B_RGB_COLOR_TYPE, &clr, sizeof(rgb_color)); + return B_OK; + }else if(strncasecmp(valuestring, "file", strlen("file"))==0){ + entry_ref file_ref; + + // remove the last ] or ) + if(valuestring[strlen(valuestring)-1]==')' || valuestring[strlen(valuestring)-1]==']'){ + valuestring[strlen(valuestring)-1]=0; + } + + if(get_ref_for_path(valuestring+5, &file_ref)!=B_OK){ + return B_FILE_NOT_FOUND; + } + + // check if the ref is valid + BEntry entry; + if(entry.SetTo(&file_ref)!=B_OK) return B_FILE_NOT_FOUND; + //if(!entry.Exists()) return B_FILE_NOT_FOUND; + + // add both ways, refsreceived needs it as "refs" while scripting needs "data" + to_message->AddRef("refs", &file_ref); + to_message->AddRef(curname, &file_ref); + return B_OK; + }else{ // it is string + // does it begin with a quote? + if(valuestring[0]=='\"'){ + if(valuestring[strlen(valuestring)-1]=='\"') valuestring[strlen(valuestring)-1]=0; + to_message->AddString(curname, valuestring+1); + }else{ + to_message->AddString(curname, valuestring); + } + return B_OK; + } + + return B_OK; +} + + + +void print_message(BMessage *message) +{ + + BList textlist; + add_message_contents(&textlist, message, 0); + + + printf("BMessage(%s):\n", get_datatype_string(message->what)); + for(int32 i=0;iCountNames(B_ANY_TYPE); + for(i=0;iGetInfo(B_ANY_TYPE, i, &namefound, &typefound); + j=0; + + while(msg->FindData(namefound, typefound, j++, (const void **)&voidptr, &sizefound)==B_OK){ + datatype=get_datatype_string(typefound); + content=format_data(typefound, (char*)voidptr, sizefound); + textline=(char*)malloc(20+level*4+strlen(namefound)+strlen(datatype)+strlen(content)); + memset(textline, 32, 20+level*4); + sprintf(textline+level*4, "\"%s\" (%s) : %s", namefound, datatype, content); + textlist->AddItem(textline); + delete [] datatype; + delete [] content; + + if(typefound==B_MESSAGE_TYPE){ + msg->FindMessage(namefound, j-1, &a_message); + add_message_contents(textlist, &a_message, level+1); + }else + if(typefound==B_RAW_TYPE && strcmp(namefound, "_previous_")==0){ + if(a_message.Unflatten((const char *)voidptr)==B_OK){ + add_message_contents(textlist, &a_message, level+1); + } + } + } + + } + +} + + + +char *get_datatype_string(int32 type) +{ + char *str=new char[128]; + + switch(type){ + case B_ANY_TYPE: strcpy(str, "B_ANY_TYPE"); break; + case B_ASCII_TYPE: strcpy(str, "B_ASCII_TYPE"); break; + case B_BOOL_TYPE: strcpy(str, "B_BOOL_TYPE"); break; + case B_CHAR_TYPE: strcpy(str, "B_CHAR_TYPE"); break; + case B_COLOR_8_BIT_TYPE: strcpy(str, "B_COLOR_8_BIT_TYPE"); break; + case B_DOUBLE_TYPE: strcpy(str, "B_DOUBLE_TYPE"); break; + case B_FLOAT_TYPE: strcpy(str, "B_FLOAT_TYPE"); break; + case B_GRAYSCALE_8_BIT_TYPE: strcpy(str, "B_GRAYSCALE_8_BIT_TYPE"); break; + case B_INT64_TYPE: strcpy(str, "B_INT64_TYPE"); break; + case B_INT32_TYPE: strcpy(str, "B_INT32_TYPE"); break; + case B_INT16_TYPE: strcpy(str, "B_INT16_TYPE"); break; + case B_INT8_TYPE: strcpy(str, "B_INT8_TYPE"); break; + case B_MESSAGE_TYPE: strcpy(str, "B_MESSAGE_TYPE"); break; + case B_MESSENGER_TYPE: strcpy(str, "B_MESSENGER_TYPE"); break; + case B_MIME_TYPE: strcpy(str, "B_MIME_TYPE"); break; + case B_MONOCHROME_1_BIT_TYPE: strcpy(str, "B_MONOCHROME_1_BIT_TYPE"); break; + case B_OBJECT_TYPE: strcpy(str, "B_OBJECT_TYPE"); break; + case B_OFF_T_TYPE: strcpy(str, "B_OFF_T_TYPE"); break; + case B_PATTERN_TYPE: strcpy(str, "B_PATTERN_TYPE"); break; + case B_POINTER_TYPE: strcpy(str, "B_POINTER_TYPE"); break; + case B_POINT_TYPE: strcpy(str, "B_POINT_TYPE"); break; + case B_RAW_TYPE: strcpy(str, "B_RAW_TYPE"); break; + case B_RECT_TYPE: strcpy(str, "B_RECT_TYPE"); break; + case B_REF_TYPE: strcpy(str, "B_REF_TYPE"); break; + case B_RGB_32_BIT_TYPE: strcpy(str, "B_RGB_32_BIT_TYPE"); break; + case B_RGB_COLOR_TYPE: strcpy(str, "B_RGB_COLOR_TYPE"); break; + case B_SIZE_T_TYPE: strcpy(str, "B_SIZE_T_TYPE"); break; + case B_SSIZE_T_TYPE : strcpy(str, "B_SSIZE_T_TYPE"); break; + case B_STRING_TYPE: strcpy(str, "B_STRING_TYPE"); break; + case B_TIME_TYPE : strcpy(str, "B_TIME_TYPE"); break; + case B_UINT64_TYPE : strcpy(str, "B_UINT64_TYPE"); break; + case B_UINT32_TYPE: strcpy(str, "B_UINT32_TYPE"); break; + case B_UINT16_TYPE : strcpy(str, "B_UINT16_TYPE"); break; + case B_UINT8_TYPE : strcpy(str, "B_UINT8_TYPE"); break; + case B_PROPERTY_INFO_TYPE: strcpy(str, "B_PROPERTY_INFO_TYPE"); break; + // message constants: + case B_ABOUT_REQUESTED : strcpy(str, "B_ABOUT_REQUESTED"); break; + case B_WINDOW_ACTIVATED : strcpy(str, "B_WINDOW_ACTIVATED"); break; + case B_ARGV_RECEIVED : strcpy(str, "B_ARGV_RECEIVED"); break; + case B_QUIT_REQUESTED : strcpy(str, "B_QUIT_REQUESTED"); break; + case B_CANCEL : strcpy(str, "B_CANCEL"); break; + case B_KEY_DOWN : strcpy(str, "B_KEY_DOWN"); break; + case B_KEY_UP : strcpy(str, "B_KEY_UP"); break; + case B_MINIMIZE : strcpy(str, "B_MINIMIZE"); break; + case B_MOUSE_DOWN : strcpy(str, "B_MOUSE_DOWN"); break; + case B_MOUSE_MOVED : strcpy(str, "B_MOUSE_MOVED"); break; + case B_MOUSE_ENTER_EXIT : strcpy(str, "B_MOUSE_ENTER_EXIT"); break; + case B_MOUSE_UP : strcpy(str, "B_MOUSE_UP"); break; + case B_PULSE : strcpy(str, "B_PULSE"); break; + case B_READY_TO_RUN : strcpy(str, "B_READY_TO_RUN"); break; + case B_REFS_RECEIVED : strcpy(str, "B_REFS_RECEIVED"); break; + case B_SCREEN_CHANGED : strcpy(str, "B_SCREEN_CHANGED"); break; + case B_VALUE_CHANGED : strcpy(str, "B_VALUE_CHANGED"); break; + case B_VIEW_MOVED : strcpy(str, "B_VIEW_MOVED"); break; + case B_VIEW_RESIZED : strcpy(str, "B_VIEW_RESIZED"); break; + case B_WINDOW_MOVED : strcpy(str, "B_WINDOW_MOVED"); break; + case B_WINDOW_RESIZED : strcpy(str, "B_WINDOW_RESIZED"); break; + case B_WORKSPACES_CHANGED : strcpy(str, "B_WORKSPACES_CHANGED"); break; + case B_WORKSPACE_ACTIVATED : strcpy(str, "B_WORKSPACE_ACTIVATED"); break; + case B_ZOOM : strcpy(str, "B_ZOOM"); break; + case _APP_MENU_ : strcpy(str, "_APP_MENU_"); break; + case _BROWSER_MENUS_ : strcpy(str, "_BROWSER_MENUS_"); break; + case _MENU_EVENT_ : strcpy(str, "_MENU_EVENT_"); break; + case _QUIT_ : strcpy(str, "_QUIT_"); break; + case _VOLUME_MOUNTED_ : strcpy(str, "_VOLUME_MOUNTED_"); break; + case _VOLUME_UNMOUNTED_ : strcpy(str, "_VOLUME_UNMOUNTED_"); break; + case _MESSAGE_DROPPED_ : strcpy(str, "_MESSAGE_DROPPED_"); break; + case _MENUS_DONE_ : strcpy(str, "_MENUS_DONE_"); break; + case _SHOW_DRAG_HANDLES_ : strcpy(str, "_SHOW_DRAG_HANDLES_"); break; + case B_SET_PROPERTY : strcpy(str, "B_SET_PROPERTY"); break; + case B_GET_PROPERTY : strcpy(str, "B_GET_PROPERTY"); break; + case B_CREATE_PROPERTY : strcpy(str, "B_CREATE_PROPERTY"); break; + case B_DELETE_PROPERTY : strcpy(str, "B_DELETE_PROPERTY"); break; + case B_COUNT_PROPERTIES : strcpy(str, "B_COUNT_PROPERTIES"); break; + case B_EXECUTE_PROPERTY : strcpy(str, "B_EXECUTE_PROPERTY"); break; + case B_GET_SUPPORTED_SUITES : strcpy(str, "B_GET_SUPPORTED_SUITES"); break; + case B_CUT : strcpy(str, "B_CUT"); break; + case B_COPY : strcpy(str, "B_COPY"); break; + case B_PASTE : strcpy(str, "B_PASTE"); break; + case B_SELECT_ALL : strcpy(str, "B_SELECT_ALL"); break; + case B_SAVE_REQUESTED : strcpy(str, "B_SAVE_REQUESTED"); break; + case B_MESSAGE_NOT_UNDERSTOOD : strcpy(str, "B_MESSAGE_NOT_UNDERSTOOD"); break; + case B_NO_REPLY : strcpy(str, "B_NO_REPLY"); break; + case B_REPLY : strcpy(str, "B_REPLY"); break; + case B_SIMPLE_DATA : strcpy(str, "B_SIMPLE_DATA"); break; + //case B_MIME_DATA : strcpy(str, "B_MIME_DATA"); break; + case B_ARCHIVED_OBJECT : strcpy(str, "B_ARCHIVED_OBJECT"); break; + case B_UPDATE_STATUS_BAR : strcpy(str, "B_UPDATE_STATUS_BAR"); break; + case B_RESET_STATUS_BAR : strcpy(str, "B_RESET_STATUS_BAR"); break; + case B_NODE_MONITOR : strcpy(str, "B_NODE_MONITOR"); break; + case B_QUERY_UPDATE : strcpy(str, "B_QUERY_UPDATE"); break; + case B_BAD_SCRIPT_SYNTAX: strcpy(str, "B_BAD_SCRIPT_SYNTAX"); break; + + // specifiers: + case B_NO_SPECIFIER : strcpy(str, "B_NO_SPECIFIER"); break; + case B_DIRECT_SPECIFIER : strcpy(str, "B_DIRECT_SPECIFIER"); break; + case B_INDEX_SPECIFIER : strcpy(str, "B_INDEX_SPECIFIER"); break; + case B_REVERSE_INDEX_SPECIFIER : strcpy(str, "B_REVERSE_INDEX_SPECIFIER"); break; + case B_RANGE_SPECIFIER : strcpy(str, "B_RANGE_SPECIFIER"); break; + case B_REVERSE_RANGE_SPECIFIER : strcpy(str, "B_REVERSE_RANGE_SPECIFIER"); break; + case B_NAME_SPECIFIER : strcpy(str, "B_NAME_SPECIFIER"); break; + + case B_ERROR : strcpy(str, "B_ERROR"); break; + + default: // unknown + id_to_string(type, str); + break; + } + + return str; + +} + + +char *format_data(int32 type, char *ptr, long size) +{ + char idtext[32]; + char *str; + float *fptr; + double *dptr; +// BRect *brptr; + long i; + entry_ref aref; + BEntry entry; + BPath path; + int64 i64; + int32 i32; + int16 i16; + int8 i8; + uint64 ui64; + uint32 ui32; + uint16 ui16; + uint8 ui8; + BMessage anothermsg; + BPropertyInfo propinfo; + const property_info *pinfo; + int32 pinfo_index; + const value_info *vinfo; + int32 vinfo_index, vinfo_count; + char *tempstr; + + + if(size<=0L){ + str=new char; + *str=0; + return str; + } + + switch(type){ + case B_MIME_TYPE: + case B_ASCII_TYPE: + case B_STRING_TYPE: + if(size>512) size=512; + str=new char[size+4]; + *str='\"'; + strncpy(str+1, ptr, size); + strcat(str, "\""); + break; + case B_POINTER_TYPE: + str=new char[64]; + sprintf(str, "%p", *(void**)ptr); + break; + + case B_REF_TYPE: + str=new char[1024]; + anothermsg.AddData("myref", B_REF_TYPE, ptr, size); + anothermsg.FindRef("myref", &aref); + if(entry.SetTo(&aref)==B_OK){ + entry.GetPath(&path); + strcpy(str, path.Path()); + }else{ + strcpy(str, "invalid entry_ref"); + } + break; + + case B_SSIZE_T_TYPE: + case B_INT64_TYPE: + str=new char[64]; + i64=*(int64*)ptr; + sprintf(str, "%Ld (0x%LX)", i64, i64); + break; + + case B_SIZE_T_TYPE: + case B_INT32_TYPE: + str=new char[64]; + i32=*(int32*)ptr; + sprintf(str, "%ld (0x%08lX)", i32, i32); + break; + + case B_INT16_TYPE: + str=new char[64]; + i16=*(int16*)ptr; + sprintf(str, "%d (0x%04X)", i16, i16); + break; + + case B_CHAR_TYPE: + case B_INT8_TYPE: + str=new char[64]; + i8=*(int8*)ptr; + sprintf(str, "%d (0x%02X)", i8, i8); + break; + + case B_UINT64_TYPE: + str=new char[64]; + ui64=*(uint64*)ptr; + sprintf(str, "%Lu (0x%LX)", ui64, ui64); + break; + + case B_UINT32_TYPE: + str=new char[64]; + ui32=*(uint32*)ptr; + sprintf(str, "%lu (0x%08lX)", ui32, ui32); + break; + + case B_UINT16_TYPE: + str=new char[64]; + ui16=*(uint16*)ptr; + sprintf(str, "%u (0x%04X)", ui16, ui16); + break; + + case B_UINT8_TYPE: + str=new char[64]; + ui8=*(uint8*)ptr; + sprintf(str, "%u (0x%02X)", ui8, ui8); + break; + + case B_BOOL_TYPE: + str=new char[10]; + if(*ptr){ + strcpy(str, "TRUE"); + }else{ + strcpy(str, "FALSE"); + } + break; + + case B_FLOAT_TYPE: + str=new char[40]; + fptr=(float*)ptr; + sprintf(str, "%.3f", *fptr); + break; + + case B_DOUBLE_TYPE: + str=new char[40]; + dptr=(double*)ptr; + sprintf(str, "%.3f", *dptr); + break; + + case B_RECT_TYPE: + str=new char[200]; + fptr=(float*)ptr; + sprintf(str, "BRect(%.1f, %.1f, %.1f, %.1f)", fptr[0], fptr[1], fptr[2], fptr[3]); + break; + + case B_POINT_TYPE: + str=new char[200]; + fptr=(float*)ptr; + sprintf(str, "BPoint(%.1f, %.1f)", fptr[0], fptr[1]); + break; + + case B_RGB_COLOR_TYPE: + str=new char[64]; + sprintf(str, "Red=%u Green=%u Blue=%u Alpha=%u", ((uint8*)ptr)[0], ((uint8*)ptr)[1], ((uint8*)ptr)[2], ((uint8*)ptr)[3] ); + break; + + case B_COLOR_8_BIT_TYPE: + str=new char[size*6+4]; + *str=0; + for(i=0;i "); break; + } + } + strcat(str, "\n"); + + // is there usage info? + if(pinfo[pinfo_index].usage){ + strcat(str, " Usage: "); + strcat(str, pinfo[pinfo_index].usage); + strcat(str, "\n"); + } + + + pinfo_index++; // take next propertyinfo + } + + + // handle value infos.... + vinfo=propinfo.Values(); + vinfo_index=0; + vinfo_count=propinfo.CountValues(); +#if TEST_VALUEINFO>0 + value_info vinfo[10]={ {"Backup", 'back', B_COMMAND_KIND, "This command backs up your hard drive."}, + {"Abort", 'abor', B_COMMAND_KIND, "Stops the current operation..."}, + {"Type Code", 'type', B_TYPE_CODE_KIND, "Type code info..."} + }; + vinfo_count=3; +#endif + + if(vinfo && vinfo_count>0){ + sprintf(str+strlen(str), "\n name value kind\n--------------------------------------------------------------------------------\n"); + + while(vinfo_index>24)&255; + uint8 digit1=(ID>>16)&255; + uint8 digit2=(ID>>8)&255; + uint8 digit3=(ID)&255; + bool itsvalid=false; + + if(digit0==0){ + if(digit1==0){ + if(digit2==0){ + // 1 digits + if(is_valid_char(digit3) ) itsvalid=TRUE; + sprintf(here, "'%c'", digit3); + }else{ + // 2 digits + if(is_valid_char(digit2) && is_valid_char(digit3) ) itsvalid=TRUE; + sprintf(here, "'%c%c'", digit2, digit3); + } + }else{ + // 3 digits + if(is_valid_char(digit1) && is_valid_char(digit2) && is_valid_char(digit3) ) itsvalid=TRUE; + sprintf(here, "'%c%c%c'", digit1, digit2, digit3); + } + }else{ + // 4 digits + if(is_valid_char(digit0) && is_valid_char(digit1) && is_valid_char(digit2) && is_valid_char(digit3) ) itsvalid=TRUE; + sprintf(here, "'%c%c%c%c'", digit0, digit1, digit2, digit3); + } + + if(!itsvalid){ + sprintf(here, "%ldL", ID); + } + + return here; +} + + +bool is_valid_char(uint8 c) +{ + return (c>=32 && c<128); +} + diff --git a/bepascal/source/bepascal/pas/src/be/app/appdefs.pp b/bepascal/source/bepascal/pas/src/be/app/appdefs.pp new file mode 100644 index 0000000..4ed57d1 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/app/appdefs.pp @@ -0,0 +1,374 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit appdefs; + +interface + +const + // System Messages Codes + _B_ABOUT_REQUESTED : array[0..3] of Char = ('_', 'A', 'B', 'R'); + _B_WINDOW_ACTIVATED : array[0..3] of Char = ('_', 'A', 'C', 'T'); + _B_APP_ACTIVATED : array[0..3] of Char = ('_', 'A', 'C', 'T'); //* Same as B_WINDOW_ACTIVATED */ + _B_ARGV_RECEIVED : array[0..3] of Char = ('_', 'A', 'R', 'G'); + _B_QUIT_REQUESTED : array[0..3] of Char = ('_', 'Q', 'R', 'Q'); + _B_CLOSE_REQUESTED : array[0..3] of Char = ('_', 'Q', 'R', 'Q'); //* Obsolete; use B_QUIT_REQUESTED */ + _B_CANCEL : array[0..3] of Char = ('_', 'C', 'N', 'C'); + _B_KEY_DOWN : array[0..3] of Char = ('_', 'K', 'Y', 'D'); + _B_KEY_UP : array[0..3] of Char = ('_', 'K', 'Y', 'U'); + _B_UNMAPPED_KEY_DOWN : array[0..3] of Char = ('_', 'U', 'K', 'D'); + _B_UNMAPPED_KEY_UP : array[0..3] of Char = ('_', 'U', 'K', 'U'); + _B_MODIFIERS_CHANGED : array[0..3] of Char = ('_', 'M', 'C', 'H'); + _B_MINIMIZE : array[0..3] of Char = ('_', 'W', 'M', 'N'); + _B_MOUSE_DOWN : array[0..3] of Char = ('_', 'M', 'D', 'N'); + _B_MOUSE_MOVED : array[0..3] of Char = ('_', 'M', 'M', 'V'); + _B_MOUSE_ENTER_EXIT : array[0..3] of Char = ('_', 'M', 'E', 'X'); + _B_MOUSE_UP : array[0..3] of Char = ('_', 'M', 'U', 'P'); + _B_MOUSE_WHEEL_CHANGED : array[0..3] of Char = ('_', 'M', 'W', 'C'); + _B_OPEN_IN_WORKSPACE : array[0..3] of Char = ('_', 'O', 'W', 'S'); + _B_PRINTER_CHANGED : array[0..3] of Char = ('_', 'P', 'C', 'H'); + _B_PULSE : array[0..3] of Char = ('_', 'P', 'U', 'L'); + _B_READY_TO_RUN : array[0..3] of Char = ('_', 'R', 'T', 'R'); + _B_REFS_RECEIVED : array[0..3] of Char = ('_', 'R', 'R', 'C'); + _B_RELEASE_OVERLAY_LOCK : array[0..3] of Char = ('_', 'R', 'O', 'V'); + _B_ACQUIRE_OVERLAY_LOCK : array[0..3] of Char = ('_', 'A', 'O', 'V'); + _B_SCREEN_CHANGED : array[0..3] of Char = ('_', 'S', 'C', 'H'); + _B_VALUE_CHANGED : array[0..3] of Char = ('_', 'V', 'C', 'H'); + _B_VIEW_MOVED : array[0..3] of Char = ('_', 'V', 'M', 'V'); + _B_VIEW_RESIZED : array[0..3] of Char = ('_', 'V', 'R', 'S'); + _B_WINDOW_MOVED : array[0..3] of Char = ('_', 'W', 'M', 'V'); + _B_WINDOW_RESIZED : array[0..3] of Char = ('_', 'W', 'R', 'S'); + _B_WORKSPACES_CHANGED : array[0..3] of Char = ('_', 'W', 'C', 'G'); + _B_WORKSPACE_ACTIVATED : array[0..3] of Char = ('_', 'W', 'A', 'C'); + _B_ZOOM : array[0..3] of Char = ('_', 'W', 'Z', 'M'); + __APP_MENU_ : array[0..3] of Char = ('_', 'A', 'M', 'N'); + __BROWSER_MENUS_ : array[0..3] of Char = ('_', 'B', 'R', 'M'); + __MENU_EVENT_ : array[0..3] of Char = ('_', 'M', 'E', 'V'); + __PING_ : array[0..3] of Char = ('_', 'P', 'B', 'L'); + __QUIT_ : array[0..3] of Char = ('_', 'Q', 'I', 'T'); + __VOLUME_MOUNTED_ : array[0..3] of Char = ('_', 'N', 'V', 'L'); + __VOLUME_UNMOUNTED_ : array[0..3] of Char = ('_', 'V', 'R', 'M'); + __MESSAGE_DROPPED_ : array[0..3] of Char = ('_', 'M', 'D', 'P'); + __DISPOSE_DRAG_ : array[0..3] of Char = ('_', 'D', 'P', 'D'); + __MENUS_DONE_ : array[0..3] of Char = ('_', 'M', 'N', 'D'); + __SHOW_DRAG_HANDLES_ : array[0..3] of Char = ('_', 'S', 'D', 'H'); + __EVENTS_PENDING_ : array[0..3] of Char = ('_', 'E', 'V', 'P'); + __UPDATE_ : array[0..3] of Char = ('_', 'U', 'P', 'D'); + __UPDATE_IF_NEEDED_ : array[0..3] of Char = ('_', 'U', 'P', 'N'); + __PRINTER_INFO_ : array[0..3] of Char = ('_', 'P', 'I', 'N'); + __SETUP_PRINTER_ : array[0..3] of Char = ('_', 'S', 'U', 'P'); + __SELECT_PRINTER_ : array[0..3] of Char = ('_', 'P', 'S', 'L'); + + // Other Commands + _B_SET_PROPERTY : array[0..3] of Char = ('P', 'S', 'E', 'T'); + _B_GET_PROPERTY : array[0..3] of Char = ('P', 'G', 'E', 'T'); + _B_CREATE_PROPERTY : array[0..3] of Char = ('P', 'C', 'R', 'T'); + _B_DELETE_PROPERTY : array[0..3] of Char = ('P', 'D', 'E', 'L'); + _B_COUNT_PROPERTIES : array[0..3] of Char = ('P', 'C', 'N', 'T'); + _B_EXECUTE_PROPERTY : array[0..3] of Char = ('P', 'E', 'X', 'E'); + _B_GET_SUPPORTED_SUITES : array[0..3] of Char = ('S', 'U', 'I', 'T'); + _B_UNDO : array[0..3] of Char = ('U', 'N', 'D', 'O'); + _B_CUT : array[0..3] of Char = ('C', 'C', 'U', 'T'); + _B_COPY : array[0..3] of Char = ('C', 'O', 'P', 'Y'); + _B_PASTE : array[0..3] of Char = ('P', 'S', 'T', 'E'); + _B_SELECT_ALL : array[0..3] of Char = ('S', 'A', 'L', 'L'); + _B_SAVE_REQUESTED : array[0..3] of Char = ('S', 'A', 'V', 'E'); + _B_MESSAGE_NOT_UNDERSTOOD : array[0..3] of Char = ('M', 'N', 'O', 'T'); + _B_NO_REPLY : array[0..3] of Char = ('N', 'O', 'N', 'E'); + _B_REPLY : array[0..3] of Char = ('R', 'P', 'L', 'Y'); + _B_SIMPLE_DATA : array[0..3] of Char = ('D', 'A', 'T', 'A'); + _B_MIME_DATA : array[0..3] of Char = ('M', 'I', 'M', 'E'); + _B_ARCHIVED_OBJECT : array[0..3] of Char = ('A', 'R', 'C', 'V'); + _B_UPDATE_STATUS_BAR : array[0..3] of Char = ('S', 'B', 'U', 'P'); + _B_RESET_STATUS_BAR : array[0..3] of Char = ('S', 'B', 'R', 'S'); + _B_NODE_MONITOR : array[0..3] of Char = ('N', 'D', 'M', 'N'); + _B_QUERY_UPDATE : array[0..3] of Char = ('Q', 'U', 'P', 'D'); + _B_ENDORSABLE : array[0..3] of Char = ('E', 'N', 'D', 'O'); + _B_COPY_TARGET : array[0..3] of Char = ('D', 'D', 'C', 'P'); + _B_MOVE_TARGET : array[0..3] of Char = ('D', 'D', 'M', 'V'); + _B_TRASH_TARGET : array[0..3] of Char = ('D', 'D', 'R', 'M'); + _B_LINK_TARGET : array[0..3] of Char = ('D', 'D', 'L', 'N'); + _B_INPUT_DEVICES_CHANGED : array[0..3] of Char = ('I', 'D', 'C', 'H'); + _B_INPUT_METHOD_EVENT : array[0..3] of Char = ('I', 'M', 'E', 'V'); + _B_WINDOW_MOVE_TO : array[0..3] of Char = ('W', 'D', 'M', 'T'); + _B_WINDOW_MOVE_BY : array[0..3] of Char = ('W', 'D', 'M', 'B'); + _B_SILENT_RELAUNCH : array[0..3] of Char = ('A', 'R', 'E', 'L'); + _B_OBSERVER_NOTICE_CHANGE : array[0..3] of Char = ('N', 'T', 'C', 'H'); + _B_CONTROL_INVOKED : array[0..3] of Char = ('C', 'I', 'V', 'K'); + _B_CONTROL_MODIFIED : array[0..3] of Char = ('C', 'M', 'O', 'D'); + + //* Media Kit reserves all reserved codes starting in 'TRI' */ + +var + B_ABOUT_REQUESTED : Cardinal; + B_WINDOW_ACTIVATED : Cardinal; + B_APP_ACTIVATED : Cardinal; + B_ARGV_RECEIVED : Cardinal; + B_QUIT_REQUESTED : Cardinal; + B_CLOSE_REQUESTED : Cardinal; + B_CANCEL : Cardinal; + B_KEY_DOWN : Cardinal; + B_KEY_UP : Cardinal; + B_UNMAPPED_KEY_DOWN : Cardinal; + B_UNMAPPED_KEY_UP : Cardinal; + B_MODIFIERS_CHANGED : Cardinal; + B_MINIMIZE : Cardinal; + B_MOUSE_DOWN : Cardinal; + B_MOUSE_MOVED : Cardinal; + B_MOUSE_ENTER_EXIT : Cardinal; + B_MOUSE_UP : Cardinal; + B_MOUSE_WHEEL_CHANGED : Cardinal; + B_OPEN_IN_WORKSPACE : Cardinal; + B_PRINTER_CHANGED : Cardinal; + B_PULSE : Cardinal; + B_READY_TO_RUN : Cardinal; + B_REFS_RECEIVED : Cardinal; + B_RELEASE_OVERLAY_LOCK : Cardinal; + B_ACQUIRE_OVERLAY_LOCK : Cardinal; + B_SCREEN_CHANGED : Cardinal; + B_VALUE_CHANGED : Cardinal; + B_VIEW_MOVED : Cardinal; + B_VIEW_RESIZED : Cardinal; + B_WINDOW_MOVED : Cardinal; + B_WINDOW_RESIZED : Cardinal; + B_WORKSPACES_CHANGED : Cardinal; + B_WORKSPACE_ACTIVATED : Cardinal; + B_ZOOM : Cardinal; + _APP_MENU_ : Cardinal; + _BROWSER_MENUS_ : Cardinal; + _MENU_EVENT_ : Cardinal; + _PING_ : Cardinal; + _QUIT_ : Cardinal; + _VOLUME_MOUNTED_ : Cardinal; + _VOLUME_UNMOUNTED_ : Cardinal; + _MESSAGE_DROPPED_ : Cardinal; + _DISPOSE_DRAG_ : Cardinal; + _MENUS_DONE_ : Cardinal; + _SHOW_DRAG_HANDLES_ : Cardinal; + _EVENTS_PENDING_ : Cardinal; + _UPDATE_ : Cardinal; + _UPDATE_IF_NEEDED_ : Cardinal; + _PRINTER_INFO_ : Cardinal; + _SETUP_PRINTER_ : Cardinal; + _SELECT_PRINTER_ : Cardinal; + + // Other Commands + B_SET_PROPERTY : Cardinal; + B_GET_PROPERTY : Cardinal; + B_CREATE_PROPERTY : Cardinal; + B_DELETE_PROPERTY : Cardinal; + B_COUNT_PROPERTIES : Cardinal; + B_EXECUTE_PROPERTY : Cardinal; + B_GET_SUPPORTED_SUITES : Cardinal; + B_UNDO : Cardinal; + B_CUT : Cardinal; + B_COPY : Cardinal; + B_PASTE : Cardinal; + B_SELECT_ALL : Cardinal; + B_SAVE_REQUESTED : Cardinal; + B_MESSAGE_NOT_UNDERSTOOD : Cardinal; + B_NO_REPLY : Cardinal; + B_REPLY : Cardinal; + B_SIMPLE_DATA : Cardinal; + B_MIME_DATA : Cardinal; + B_ARCHIVED_OBJECT : Cardinal; + B_UPDATE_STATUS_BAR : Cardinal; + B_RESET_STATUS_BAR : Cardinal; + B_NODE_MONITOR : Cardinal; + B_QUERY_UPDATE : Cardinal; + B_ENDORSABLE : Cardinal; + B_COPY_TARGET : Cardinal; + B_MOVE_TARGET : Cardinal; + B_TRASH_TARGET : Cardinal; + B_LINK_TARGET : Cardinal; + B_INPUT_DEVICES_CHANGED : Cardinal; + B_INPUT_METHOD_EVENT : Cardinal; + B_WINDOW_MOVE_TO : Cardinal; + B_WINDOW_MOVE_BY : Cardinal; + B_SILENT_RELAUNCH : Cardinal; + B_OBSERVER_NOTICE_CHANGE : Cardinal; + B_CONTROL_INVOKED : Cardinal; + B_CONTROL_MODIFIED : Cardinal; + +implementation + +FUNCTION Power(X,Y:Word):LongInt; +VAR Temp,Teller : LongInt; +BEGIN + TEMP:=1; + FOR Teller:=1 TO Y DO TEMP:=TEMP*X; + Power:=Temp; +END; { Power } + + +FUNCTION Hex2Dec(Hex:STRING):LongInt; +VAR T1,T2,Dec : LongInt; + Error : Boolean; + +BEGIN + Error:=False; + T1:=0;T2:=0;DEC:=0; + FOR T1:=1 TO LENGTH(Hex) DO + BEGIN + T2:=Length(Hex)-T1; + CASE Hex[T1] OF + '0' : DEC:=DEC+0; + '1' : DEC:=DEC+Power(16,T2); + '2' : DEC:=DEC+2*Power(16,T2); + '3' : DEC:=DEC+3*Power(16,T2); + '4' : DEC:=DEC+4*Power(16,T2); + '5' : DEC:=DEC+5*Power(16,T2); + '6' : DEC:=DEC+6*Power(16,T2); + '7' : DEC:=DEC+7*Power(16,T2); + '8' : DEC:=DEC+8*Power(16,T2); + '9' : DEC:=DEC+9*Power(16,T2); + 'A','a' : DEC:=DEC+10*Power(16,T2); + 'B','b' : DEC:=DEC+11*Power(16,T2); + 'C','c' : DEC:=DEC+12*Power(16,T2); + 'D','d' : DEC:=DEC+13*Power(16,T2); + 'E','e' : DEC:=DEC+14*Power(16,T2); + 'F','f' : DEC:=DEC+15*Power(16,T2); + ELSE Error:=True; + END; + END; + Hex2Dec:=Dec; + IF Error THEN Hex2Dec:=0; +END; + +FUNCTION Dec2Hex(DEC:LONGINT):STRING; + +VAR H1:INTEGER; + Hex,HexDigit:STRING; + +BEGIN + HexDigit:='0123456789ABCDEF'; + HEX:=''; + REPEAT + H1:=DEC MOD 16; + DEC:=DEC DIV 16; + Hex:=CONCAT(Hexdigit[H1+1],Hex); + UNTIL DEC<1; + Dec2Hex:=Hex; +END; { Dec2Hex } + +function trans( S : Array of char): cardinal; +var nd : array[0..3] of integer; + Nh :array[0..3] of string; + Hexa : string; + i : Integer; +begin + for i:=0 to 3 do nd[i]:=ord(S[i]); + for i:=0 to 3 do Nh[i]:=dec2hex(nd[i]); + hexa:=nh[0]+nh[1]+nh[2]+nh[3]; + result:=hex2dec(hexa); +end; + + +initialization + // System Messages Codes + B_ABOUT_REQUESTED := trans(_B_ABOUT_REQUESTED); + B_WINDOW_ACTIVATED := trans(_B_WINDOW_ACTIVATED); + B_APP_ACTIVATED := trans(_B_APP_ACTIVATED); + B_ARGV_RECEIVED := trans(_B_ARGV_RECEIVED); + B_QUIT_REQUESTED := trans(_B_QUIT_REQUESTED); + B_CLOSE_REQUESTED := trans(_B_CLOSE_REQUESTED); + B_CANCEL := trans(_B_CANCEL); + B_KEY_DOWN := trans(_B_KEY_DOWN); + B_KEY_UP := trans(_B_KEY_UP); + B_UNMAPPED_KEY_DOWN := trans(_B_UNMAPPED_KEY_DOWN); + B_UNMAPPED_KEY_UP := trans(_B_UNMAPPED_KEY_UP); + B_MODIFIERS_CHANGED := trans(_B_MODIFIERS_CHANGED); + B_MINIMIZE := trans(_B_MINIMIZE); + B_MOUSE_DOWN := trans(_B_MOUSE_DOWN); + B_MOUSE_MOVED := trans(_B_MOUSE_MOVED); + B_MOUSE_ENTER_EXIT := trans(_B_MOUSE_ENTER_EXIT); + B_MOUSE_UP := trans(_B_MOUSE_UP); + B_MOUSE_WHEEL_CHANGED := trans(_B_MOUSE_WHEEL_CHANGED); + B_OPEN_IN_WORKSPACE := trans(_B_OPEN_IN_WORKSPACE); + B_PRINTER_CHANGED := trans(_B_PRINTER_CHANGED); + B_PULSE := trans(_B_PULSE); + B_READY_TO_RUN := trans(_B_READY_TO_RUN); + B_REFS_RECEIVED := trans(_B_REFS_RECEIVED); + B_RELEASE_OVERLAY_LOCK := trans(_B_RELEASE_OVERLAY_LOCK); + B_ACQUIRE_OVERLAY_LOCK := trans(_B_ACQUIRE_OVERLAY_LOCK); + B_SCREEN_CHANGED := trans(_B_SCREEN_CHANGED); + B_VALUE_CHANGED := trans(_B_VALUE_CHANGED); + B_VIEW_MOVED := trans(_B_VIEW_MOVED); + B_VIEW_RESIZED := trans(_B_VIEW_RESIZED); + B_WINDOW_MOVED := trans(_B_WINDOW_MOVED); + B_WINDOW_RESIZED := trans(_B_WINDOW_RESIZED); + B_WORKSPACES_CHANGED := trans(_B_WORKSPACES_CHANGED); + B_WORKSPACE_ACTIVATED := trans(_B_WORKSPACE_ACTIVATED); + B_ZOOM := trans(_B_ZOOM); + _APP_MENU_ := trans(__APP_MENU_); + _BROWSER_MENUS_ := trans(__BROWSER_MENUS_); + _MENU_EVENT_ := trans(__MENU_EVENT_); + _PING_ := trans(__PING_); + _QUIT_ := trans(__QUIT_); + _VOLUME_MOUNTED_ := trans(__VOLUME_MOUNTED_); + _VOLUME_UNMOUNTED_ := trans(__VOLUME_UNMOUNTED_); + _MESSAGE_DROPPED_ := trans(__MESSAGE_DROPPED_); + _DISPOSE_DRAG_ := trans(__DISPOSE_DRAG_); + _MENUS_DONE_ := trans(__MENUS_DONE_); + _SHOW_DRAG_HANDLES_ := trans(__SHOW_DRAG_HANDLES_); + _EVENTS_PENDING_ := trans(__EVENTS_PENDING_); + _UPDATE_ := trans(__UPDATE_); + _UPDATE_IF_NEEDED_ := trans(__UPDATE_IF_NEEDED_); + _PRINTER_INFO_ := trans(__PRINTER_INFO_); + _SETUP_PRINTER_ := trans(__SETUP_PRINTER_); + _SELECT_PRINTER_ := trans(__SELECT_PRINTER_); + + // Other Commands + B_SET_PROPERTY := trans(_B_SET_PROPERTY); + B_GET_PROPERTY := trans(_B_GET_PROPERTY); + B_CREATE_PROPERTY := trans(_B_CREATE_PROPERTY); + B_DELETE_PROPERTY := trans(_B_DELETE_PROPERTY); + B_COUNT_PROPERTIES := trans(_B_COUNT_PROPERTIES); + B_EXECUTE_PROPERTY := trans(_B_EXECUTE_PROPERTY); + B_GET_SUPPORTED_SUITES := trans(_B_GET_SUPPORTED_SUITES); + B_UNDO := trans(_B_UNDO); + B_CUT := trans(_B_CUT); + B_COPY := trans(_B_COPY); + B_PASTE := trans(_B_PASTE); + B_SELECT_ALL := trans(_B_SELECT_ALL); + B_SAVE_REQUESTED := trans(_B_SAVE_REQUESTED); + B_MESSAGE_NOT_UNDERSTOOD := trans(_B_MESSAGE_NOT_UNDERSTOOD); + B_NO_REPLY := trans(_B_NO_REPLY); + B_REPLY := trans(_B_REPLY); + B_SIMPLE_DATA := trans(_B_SIMPLE_DATA); + B_MIME_DATA := trans(_B_MIME_DATA); + B_ARCHIVED_OBJECT := trans(_B_ARCHIVED_OBJECT); + B_UPDATE_STATUS_BAR := trans(_B_UPDATE_STATUS_BAR); + B_RESET_STATUS_BAR := trans(_B_RESET_STATUS_BAR); + B_NODE_MONITOR := trans(_B_NODE_MONITOR); + B_QUERY_UPDATE := trans(_B_QUERY_UPDATE); + B_ENDORSABLE := trans(_B_ENDORSABLE); + B_COPY_TARGET := trans(_B_COPY_TARGET); + B_MOVE_TARGET := trans(_B_MOVE_TARGET); + B_TRASH_TARGET := trans(_B_TRASH_TARGET); + B_LINK_TARGET := trans(_B_LINK_TARGET); + B_INPUT_DEVICES_CHANGED := trans(_B_INPUT_DEVICES_CHANGED); + B_INPUT_METHOD_EVENT := trans(_B_INPUT_METHOD_EVENT); + B_WINDOW_MOVE_TO := trans(_B_WINDOW_MOVE_TO); + B_WINDOW_MOVE_BY := trans(_B_WINDOW_MOVE_BY); + B_SILENT_RELAUNCH := trans(_B_SILENT_RELAUNCH); + B_OBSERVER_NOTICE_CHANGE := trans(_B_OBSERVER_NOTICE_CHANGE); + B_CONTROL_INVOKED := trans(_B_CONTROL_INVOKED); + B_CONTROL_MODIFIED := trans(_B_CONTROL_MODIFIED); + +end. diff --git a/bepascal/source/bepascal/pas/src/be/app/application.pp b/bepascal/source/bepascal/pas/src/be/app/application.pp new file mode 100644 index 0000000..7d28ea4 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/app/application.pp @@ -0,0 +1,190 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit Application; + +interface + +uses + beobj, looper, appdefs, supportdefs, message, os, fdblib,roster; + +type + BApplication = class(BLooper) + private + public + constructor Create; override; + constructor Create(Signature : PChar); virtual; + constructor Create(Signature : PChar; error : PStatus_t); virtual; + destructor Destroy; override; + procedure ShowCursor; + procedure HideCursor; + function Run : Thread_id; + procedure Quit; + function GeAppInfo(var info : AppInfo ): Status_t; + // Hook functions + procedure AppActivated(Active : boolean); virtual; + procedure ReadyToRun; virtual; + end; + +function BApplication_Create(AObject : TObject) : TCPlusObject; cdecl; external BePascalLibName name 'BApplication_Create_1'; +function BApplication_Create(AObject : TObject; Signature : PChar) : TCPlusObject; cdecl; external BePascalLibName name 'BApplication_Create_2'; +function BApplication_Create(AObject : TObject; Signature : PChar; error : PStatus_t) : TCPlusObject; cdecl; external BePascalLibName name 'BApplication_Create_3'; +procedure BApplication_Free(Application : TCPlusObject); cdecl; external BePascalLibName; +procedure BApplication_HideCursor(Application : TCPlusObject); cdecl; external BePascalLibName; +procedure BApplication_ShowCursor(Application : TCPlusObject); cdecl; external BePascalLibName; +function BApplication_Run(Application : TCPlusObject) : Thread_id; cdecl; external BePascalLibName; +procedure BApplication_Quit(Application : TCPlusObject); cdecl; external BePascalLibName; +function BApplication_GeAppInfo(Application : TCPlusObject; var info : AppInfo ) : Status_t; cdecl; external BePascalLibName name 'BApplication_GetAppInfo'; +function get_be_app_messenger : TCPlusObject; cdecl; external BePascalLibName name 'get_be_app_messenger'; + +var + be_app : BApplication; + +implementation + +uses + Messenger; + +var + Application_AppActivated_hook : Pointer; cvar; external; + Application_ReadyToRun_hook : Pointer; cvar; external; + + // start BApplication +constructor BApplication.Create; +begin + inherited; + CPlusObject := BApplication_Create(Self, PChar('application/x-vnd.BePascal')); + be_app := Self; + be_app_BMessenger := BMessenger.Wrap(be_app_messengerCPlus); +end; + +constructor BApplication.Create(Signature : PChar); +begin + inherited Create; + CPlusObject := BApplication_Create(Self, Signature); + be_app := Self; + be_app_BMessenger := BMessenger.Wrap(be_app_messengerCPlus); +end; + +constructor BApplication.Create(Signature : PChar; error : PStatus_t); +begin + inherited Create; + CPlusObject := BApplication_Create(Self, Signature, error); + be_app := Self; + be_app_BMessenger := BMessenger.Wrap(be_app_messengerCPlus); +end; + +destructor BApplication.Destroy; +begin + if CPlusObject <> nil then + BApplication_Free(CPlusObject); + if Assigned(be_app_BMessenger) then + be_app_BMessenger.UnWrap; + inherited; +end; + +// Hook functions + +procedure Application_AppActivated_hook_func(Application : BApplication; Active : boolean); cdecl; +begin + if Application <> nil then + Application.AppActivated(Active); +end; + +procedure BApplication.AppActivated(Active : boolean); +begin +{$IFDEF DEBUG} + SendText(Active); + if Active then + SendText('Application activée !') + else + SendText('Application désactivée !'); +{$ENDIF} +end; + +procedure Application_ReadyToRun_hook_func(Application : BApplication); cdecl; +begin +{$IFDEF DEBUG} + SendText('Hook ReadyToRun !'); +{$ENDIF} + if Application <> nil then + Application.ReadyToRun; +end; + +procedure Application_MessageReceived_hook_func(Application : BApplication; aMessage : TCPlusObject); cdecl; +var + Message : BMessage; +begin +{$IFDEF DEBUG} + SendText('Hook MessageReceived !'); +{$ENDIF} + Message := BMessage.Wrap(aMessage); + try + if Application <> nil then + Application.MessageReceived(Message); + finally + Message.UnWrap; + end; +end; + +procedure BApplication.ReadyToRun; +begin +{$IFDEF DEBUG} + SendText('Prêt à démarer !'); +{$ENDIF} +end; + +procedure BApplication.ShowCursor; +begin + BApplication_ShowCursor(CPlusObject); +end; + +procedure BApplication.HideCursor; +begin + BApplication_HideCursor(CPlusObject); +end; + +function BApplication.Run : Thread_id; +begin + Result := BApplication_Run(CPlusObject); +end; + +procedure BApplication.Quit; +begin + BApplication_Quit(CPlusObject); +end; + +function BApplication.GeAppInfo(var info : AppInfo ): Status_t; +begin + Result:=BApplication_GeAppInfo(CPlusObject,info) ; +end; + + + // end BApplication + +initialization + be_app := nil; + Application_AppActivated_hook := @Application_AppActivated_hook_func; + Application_ReadyToRun_hook := @Application_ReadyToRun_hook_func; + +finalization + Application_AppActivated_hook := nil; + Application_ReadyToRun_hook := nil; + be_app := nil; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/app/handler.pp b/bepascal/source/bepascal/pas/src/be/app/handler.pp new file mode 100644 index 0000000..78c21a7 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/app/handler.pp @@ -0,0 +1,80 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit handler; + +interface + +uses + beobj, archivable, message, fdblib; + +type + BHandler = class(BArchivable) + public + procedure MessageReceived(aMessage : BMessage); virtual; + end; + +implementation + +uses + SysUtils; + +var + Handler_MessageReceived_hook : Pointer; cvar; external; + +procedure BHandler.MessageReceived(aMessage : BMessage); +begin +{$IFDEF DEBUG} + SendText(ClassName + '.MessageReceived'); + SendText('Message reçue'); + aMessage.PrintToStream; +{$ENDIF} +end; + +procedure Handler_MessageReceived_hook_func(Handler : BHandler; aMessage : TCPlusObject); cdecl; +var + Message : BMessage; +begin + try +{$IFDEF DEBUG} + SendText('Hook MessageReceived !'); +{$ENDIF} + Message := BMessage.Wrap(aMessage); + try + if Handler <> nil then + Handler.MessageReceived(Message); + finally + Message.UnWrap; + end; + except + on e : exception do + begin +{$IFDEF DEBUG} + SendText(e.Message + 'Handler_MessageReceived'); +{$ENDIF} + end; + end +end; + +initialization + Handler_MessageReceived_hook := @Handler_MessageReceived_hook_func; + +finalization + Handler_MessageReceived_hook := nil; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/app/invoker.pp b/bepascal/source/bepascal/pas/src/be/app/invoker.pp new file mode 100644 index 0000000..ede00c8 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/app/invoker.pp @@ -0,0 +1,271 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit invoker; + +interface + +uses + beobj, Message, Handler, Looper, SupportDefs, Messenger; + +type + BInvoker = class(TBeObject) + private + public + constructor Create; override; + constructor Create(aMessage : BMessage; handler : BHandler; looper : BLooper); + constructor Create(aMessage : BMessage; aTarget : BMessenger); + destructor Destroy; override; + function SeBMessage(aMessage : BMessage) : Status_t; + function Message : BMessage; + function Command : Cardinal; + function SetTarget(h : BHandler; loop : BLooper) : Status_t; + function SetTarget(aMessenger : BMessenger) : Status_t; + function IsTargetLocal : boolean; + function Target(looper : BLooper) : BHandler; + function Messenger : BMessenger; + function SeBHandlerForReply(handler : BHandler) : Status_t; + function HandlerForReply : BHandler; + function Invoke(msg : BMessage) : Status_t; +// function InvokeNotify(msg : BMessage; kind : Cardinal) : Status_t; + function SetTimeout(aTimeout : Bigtime_t) : Status_t; + function Timeout : Bigtime_t; +// function InvokeKind(notify : boolean) : Cardinal; +// procedure BeginInvokeNotify(kind : Cardinal); +// procedure EndInvokeNotify; +// procedure _ReservedInvoker1; +// procedure _ReservedInvoker2; +// procedure _ReservedInvoker3; + constructor Create(aInvoker : BInvoker); +// function operator=( : BInvoker) : BInvoker; +// procedure BMessage *fMessage; +// procedure BMessenger fMessenger; +// procedure BHandler *fReplyTo; +// procedure uint32 fTimeout; +// procedure uint32 fNotifyKind; +// procedure uint32 _reserved[2]; + end; + +function BInvoker_Create(AObject : TBeObject) : TCplusObject; cdecl; external BePascalLibName name 'BInvoker_Create'; +function BInvoker_Create(AObject : TBeObject; message : TCplusObject; handler : TCplusObject; looper : TCPlusObject) : TCplusObject; cdecl; external BePascalLibName name 'BInvoker_Create_1'; +function BInvoker_Create(AObject : TBeObject; message : TCplusObject; target : TCplusObject) : TCplusObject; cdecl; external BePascalLibName name 'BInvoker_Create_2'; +procedure BInvoker_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_Free'; +function BInvoker_SeBMessage(AObject : TCPlusObject; message : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BInvoker_SetMessage'; +function BInvoker_Message(AObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BInvoker_Message'; +function BInvoker_Command(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BInvoker_Command'; +function BInvoker_SetTarget(AObject : TCPlusObject; h : TCPlusObject; loop : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BInvoker_SetTarget'; +function BInvoker_SetTarget(AObject : TCPlusObject; messenger : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BInvoker_SetTarget_1'; +function BInvoker_IsTargetLocal(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BInvoker_IsTargetLocal'; +function BInvoker_Target(AObject : TCPlusObject; looper : TCplusObject) : BHandler; cdecl; external BePascalLibName name 'BInvoker_Target'; +function BInvoker_Messenger(AObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BInvoker_Messenger'; +function BInvoker_SeBHandlerForReply(AObject : TCPlusObject; handler : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BInvoker_SetHandlerForReply'; +function BInvoker_HandlerForReply(AObject : TCPlusObject) : BHandler; cdecl; external BePascalLibName name 'BInvoker_HandlerForReply'; +function BInvoker_Invoke(AObject : TCPlusObject; msg : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BInvoker_Invoke'; +//function BInvoker_InvokeNotify(AObject : TCPlusObject; msg : TCplusObject; kind : Cardinal) : Status_t; cdecl; external BePascalLibName name 'BInvoker_InvokeNotify'; +function BInvoker_SetTimeout(AObject : TCPlusObject; timeout : Bigtime_t) : Status_t; cdecl; external BePascalLibName name 'BInvoker_SetTimeout'; +function BInvoker_Timeout(AObject : TCPlusObject) : Bigtime_t; cdecl; external BePascalLibName name 'BInvoker_Timeout'; +//function BInvoker_InvokeKind(AObject : TCPlusObject; notify : boolean) : Cardinal; cdecl; external BePascalLibName name 'BInvoker_InvokeKind'; +//procedure BInvoker_BeginInvokeNotify(AObject : TCPlusObject; kind : Cardinal); cdecl; external BePascalLibName name 'BInvoker_BeginInvokeNotify'; +//procedure BInvoker_EndInvokeNotify(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_EndInvokeNotify'; +//procedure BInvoker__ReservedInvoker1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker__ReservedInvoker1'; +//procedure BInvoker__ReservedInvoker2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker__ReservedInvoker2'; +//procedure BInvoker__ReservedInvoker3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker__ReservedInvoker3'; +function BInvoker_Create(AObject : TBeObject; aInvoker : TCPlusObject) : TCplusObject; cdecl; external BePascalLibName name 'BInvoker_Create'; +//function BInvoker_operator=(AObject : TCPlusObject; : BInvoker) : BInvoker; cdecl; external BePascalLibName name 'BInvoker_operator='; +//procedure BInvoker_BMessage *fMessage(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_BMessage *fMessage'; +//procedure BInvoker_BMessenger fMessenger(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_BMessenger fMessenger'; +//procedure BInvoker_BHandler *fReplyTo(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_BHandler *fReplyTo'; +//procedure BInvoker_uint32 fTimeout(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_uint32 fTimeout'; +//procedure BInvoker_uint32 fNotifyKind(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_uint32 fNotifyKind'; +//procedure BInvoker_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_uint32 _reserved[2]'; + +implementation + +constructor BInvoker.Create; +begin + BInvoker_Create(Self); +end; + +constructor BInvoker.Create(aMessage : BMessage; handler : BHandler; looper : BLooper); +begin + CPlusObject := BInvoker_Create(Self, aMessage.CPlusObject, handler, looper); +end; + +constructor BInvoker.Create(aMessage : BMessage; aTarget : BMessenger); +begin + CPlusObject := BInvoker_Create(Self, aMessage.CPlusObject, aTarget.CPlusObject); +end; + +destructor BInvoker.Destroy; +begin + BInvoker_Free(CPlusObject); +end; + +function BInvoker.SeBMessage(aMessage : BMessage) : Status_t; +begin + Result := BInvoker_SeBMessage(CPlusObject, aMessage.CPlusObject); +end; + +function BInvoker.Message : BMessage; +begin + Result := BMessage.Wrap(BInvoker_Message(CPlusObject)); +end; + +function BInvoker.Command : Cardinal; +begin + Result := BInvoker_Command(CPlusObject); +end; + +function BInvoker.SetTarget(h : BHandler; loop : BLooper) : Status_t; +begin + if loop <> nil then + begin + Result := BInvoker_SetTarget(CPlusObject, h.CPlusObject, loop.CPlusObject); + end + else if h <> nil then + begin +// Result := BInvoker_SetTarget(CPlusObject, h.CPlusObject, nil); + end + else + begin + Result := BInvoker_SetTarget(CPlusObject, nil, nil); + end; +end; + +function BInvoker.SetTarget(aMessenger : BMessenger) : Status_t; +begin + Result := BInvoker_SetTarget(CPlusObject, aMessenger.CPlusObject); +end; + +function BInvoker.IsTargetLocal : boolean; +begin + Result := BInvoker_IsTargetLocal(CPlusObject); +end; + +function BInvoker.Target(looper : BLooper) : BHandler; +begin + Result := BInvoker_Target(CPlusObject, looper.CPlusObject); +end; + +function BInvoker.Messenger : BMessenger; +begin + Result := BMessenger.Wrap(BInvoker_Messenger(CPlusObject)); +end; + +function BInvoker.SeBHandlerForReply(handler : BHandler) : Status_t; +begin + Result := BInvoker_SeBHandlerForReply(CPlusObject, handler.CPlusObject); +end; + +function BInvoker.HandlerForReply : BHandler; +begin + Result := BInvoker_HandlerForReply(CPlusObject); +end; + +function BInvoker.Invoke(msg : BMessage) : Status_t; +begin + Result := BInvoker_Invoke(CPlusObject, msg.CPlusObject); +end; + +//function BInvoker.InvokeNotify(msg : BMessage; kind : Cardinal) : Status_t; +//begin +// BInvoker_InvokeNotify(CPlusObject, msg.CPlusObject, kind); +//end; + +function BInvoker.SetTimeout(aTimeout : Bigtime_t) : Status_t; +begin + Result := BInvoker_SetTimeout(CPlusObject, timeout); +end; + +function BInvoker.Timeout : Bigtime_t; +begin + Result := BInvoker_Timeout(CPlusObject); +end; + +//function BInvoker.InvokeKind(notify : boolean) : Cardinal; +//begin +// BInvoker_InvokeKind(CPlusObject, notify); +//end; +// +//procedure BInvoker.BeginInvokeNotify(kind : Cardinal); +//begin +// BInvoker_BeginInvokeNotify(CPlusObject, kind); +//end; +// +//procedure BInvoker.EndInvokeNotify; +//begin +// BInvoker_EndInvokeNotify(CPlusObject); +//end; + +//procedure BInvoker._ReservedInvoker1; +//begin +// BInvoker__ReservedInvoker1(CPlusObject); +//end; +// +//procedure BInvoker._ReservedInvoker2; +//begin +// BInvoker__ReservedInvoker2(CPlusObject); +//end; +// +//procedure BInvoker._ReservedInvoker3; +//begin +// BInvoker__ReservedInvoker3(CPlusObject); +//end; + +constructor BInvoker.Create(ainvoker : BInvoker); +begin + BInvoker_Create(Self, aInvoker); +end; + +//function BInvoker.operator=( : BInvoker) : BInvoker; +//begin +// BInvoker_operator=(CPlusObject, ); +//end; + +//procedure BInvoker.BMessage *fMessage; +//begin +// BInvoker_BMessage *fMessage(CPlusObject); +//end; +// +//procedure BInvoker.BMessenger fMessenger; +//begin +// BInvoker_BMessenger fMessenger(CPlusObject); +//end; +// +//procedure BInvoker.BHandler *fReplyTo; +//begin +// BInvoker_BHandler *fReplyTo(CPlusObject); +//end; +// +//procedure BInvoker.uint32 fTimeout; +//begin +// BInvoker_uint32 fTimeout(CPlusObject); +//end; +// +//procedure BInvoker.uint32 fNotifyKind; +//begin +// BInvoker_uint32 fNotifyKind(CPlusObject); +//end; +// +//procedure BInvoker.uint32 _reserved[2]; +//begin +// BInvoker_uint32 _reserved[2](CPlusObject); +//end; + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/app/looper.pp b/bepascal/source/bepascal/pas/src/be/app/looper.pp new file mode 100644 index 0000000..c436ae7 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/app/looper.pp @@ -0,0 +1,103 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit looper; + +interface + +uses + beobj, handler, message, os, SupportDefs; + +const + B_LOOPER_PORT_DEFAULT_CAPACITY = 100; + +type + BLooper = class(BHandler) + private + public + procedure DispatchMessage(aMessage : BMessage; aTarget : BHandler); virtual; + function QuitRequested() : boolean; virtual; + function GetSupportedSuites(aMessage : BMessage) : Status_t; + function PostMessage(command : Cardinal) : Status_t; + end; + +//function BLooper_Create(AObject : TObject); +function BLooper_GetSupportedSuites(Looper : TCplusObject; aMessage : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BLooper_GetSupportedSuites'; +function BLooper_PostMessage(Looper : TCPlusObject; command : Cardinal) : Status_t; cdecl; external BePascalLibName name 'BLooper_PostMessage_2'; + +implementation + +var + Looper_DispatchMessage_hook : Pointer; cvar; external; + Looper_QuitRequested_hook : Pointer; cvar; external; + +procedure BLooper.DispatchMessage(aMessage : BMessage; aTarget : BHandler); +begin +end; + +function BLooper.QuitRequested() : boolean; +begin + Result := True; +end; + +function BLooper.GetSupportedSuites(aMessage : BMessage) : Status_t; +begin + result := BLooper_GetSupportedSuites(CPlusObject, aMessage.CPlusObject); +end; + +function BLooper.PostMessage(command : Cardinal) : Status_t; +begin + result := BLooper_PostMessage(CPlusObject, command); +end; + +// hooks + +procedure Looper_DispatchMessage_hook_func(Looper : BLooper; + aMessage : TCPlusObject; aTarget : TCPlusObject); cdecl; +var + Message : BMessage; + Target : BHandler; +begin + Message := BMessage.Wrap(aMessage); + try + Target := BHandler.Wrap(aTarget); + try + Looper.DispatchMessage(Message, Target); + finally + Target.UnWrap; + end; + finally + Message.UnWrap; + end; +end; + +function Looper_QuitRequested_hook_func(Looper : BLooper) : boolean; cdecl; +begin + if Looper <> nil then + Result := Looper.QuitRequested(); +end; + +initialization + Looper_DispatchMessage_hook := @Looper_DispatchMessage_hook_func; + Looper_QuitRequested_hook := @Looper_QuitRequested_hook_func; + +finalization + Looper_DispatchMessage_hook := nil; + Looper_QuitRequested_hook := nil; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/app/message.pp b/bepascal/source/bepascal/pas/src/be/app/message.pp new file mode 100644 index 0000000..ac41465 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/app/message.pp @@ -0,0 +1,281 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit message; + +interface + +uses + beobj, supportdefs, typeconstants; + +const + B_NO_SPECIFIER = 0; + B_DIRECT_SPECIFIER = 1; + B_INDEX_SPECIFIER = 2; + B_REVERSE_INDEX_SPECIFIER = 3; + B_RANGE_SPECIFIER = 4; + B_REVERSE_RANGE_SPECIFIER = 5; + B_NAME_SPECIFIER = 6; + B_ID_SPECIFIER = 7; + + B_SPECIFIERS_END = 128; + + B_FIELD_NAME_LENGTH = 255; + B_PROPERTY_NAME_LENGTH = 255; + +type + BMessage = class(TBeObject) + private + function GetWhat : Cardinal; + procedure SetWhat(aWhat : Cardinal); + public + constructor Create; override; + constructor Create(Command : Cardinal); virtual; + constructor Create(var Message : BMessage); virtual; + destructor Destroy; override; + function AddData(const Name : PChar; aType : Type_Code; const Data : Pointer; FixedSize : Cardinal; NumItems : Integer) : Status_t; + function AddBool(const Name : PChar; aBool : boolean) : Status_t; + function AddInt8(const Name : PChar; anInt8 : Shortint) : Status_t; + function FindInt8(const Name : PChar; var anInt8 : Shortint) : Status_t; + function AddInt16(const Name : PChar; anInt16 : Smallint) : Status_t; + function AddInt32(const Name : PChar; anInt32 : Integer) : Status_t; + function AddInt64(const Name : PChar; anInt64 : int64) : Status_t; + function AddFloat(const Name : PChar; aFloat : Single) : Status_t; + function AddDouble(const Name : PChar; aDouble : Double) : Status_t; + function AddString(const Name : PChar; aString : PChar) : Status_t; + function FindString(const Name : PChar; var aString : PChar) : Status_t; + function AddMessage(const Name : PChar; aMessage : TCPlusObject) : Status_t; + function CountNames(aType : Type_Code) : Integer; + function HasSpecifiers : boolean; + function IsSystem : boolean; + function MakeEmpty : Status_t; + function IsEmpty : boolean; + function RemoveName(const Name : PChar) : Status_t; + procedure PrintToStream; + function RemoveData(const name : PChar; index : Integer) : Status_t; + function WasDelivered : boolean; + function IsSourceRemote : boolean; + function IsSourceWaiting : boolean; + function IsReply : boolean; + function Previous : BMessage; + function WasDropped : boolean; + property What : Cardinal read GetWhat write SetWhat; + end; + +function BMessage_Create(AObject : TObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMessage_Create_1'; +function BMessage_Create(AObject : TObject; command : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BMessage_Create_2'; +function BMessage_Create(AObject : TObject; var Message : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMessage_Create_3'; +procedure BMessage_Free(Message : TCPlusObject); cdecl; external BePascalLibName; +function BMessage_GetWhat(Message : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BMessage_Getwhat'; +procedure BMessage_SetWhat(Message : TCPlusObject; What : Cardinal); cdecl; external BePascalLibName name 'BMessage_Setwhat'; +function BMessage_AddData(Message : TCPlusObject; const Name : PChar; aType : Type_Code; const Data : Pointer; FixedSize : Cardinal; NumItems : Integer) : Status_t; cdecl; external BePascalLibName; +function BMessage_AddBool(Message : TCPlusObject; const Name : PChar; aBool : boolean) : Status_t; cdecl; external BePascalLibName; +function BMessage_AddInt8(Message : TCPlusObject; const Name : PChar; anInt8 : Shortint) : Status_t; cdecl; external BePascalLibName; +function BMessage_FindInt8(Message : TCPlusObject; const Name : PChar; var anInt8 : Shortint) : Status_t; cdecl; external BePascalLibName; +function BMessage_AddInt16(Message : TCPlusObject; const Name : PChar; anInt16 : Smallint) : Status_t; cdecl; external BePascalLibName; +function BMessage_AddInt32(Message : TCPlusObject; const Name : PChar; anInt32 : Integer) : Status_t; cdecl; external BePascalLibName; +function BMessage_AddInt64(Message : TCPlusObject; const Name : PChar; anInt64 : int64) : Status_t; cdecl; external BePascalLibName; +function BMessage_AddFloat(Message : TCPlusObject; const Name : PChar; aFloat : Single) : Status_t; cdecl; external BePascalLibName; +function BMessage_AddDouble(Message : TCPlusObject; const Name : PChar; aDouble : Double) : Status_t; cdecl; external BePascalLibName; +function BMessage_AddString(Message : TCPlusObject; const Name : PChar; aString : PChar) : Status_t; cdecl; external BePascalLibName; +function BMessage_FindString(Message : TCPlusObject; const Name : PChar;var aString : PChar) : Status_t; cdecl; external BePascalLibName; +function BMessage_AddMessage(Message : TCPlusObject; const Name : PChar; aMessage : TCPlusObject) : Status_t; cdecl; external BePascalLibName; +function BMessage_CountNames(Message : TCPlusObject; aType : Type_Code) : Integer; cdecl; external BePascalLibName; +function BMessage_HasSpecifiers(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName; +function BMessage_IsSystem(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName; +function BMessage_MakeEmpty(Message : TCPlusObject) : Status_t; cdecl; external BePascalLibName; +function BMessage_IsEmpty(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName; +function BMessage_RemoveName(Message : TCPlusObject; const Name : PChar) : Status_t; cdecl; external BePascalLibName; +procedure BMessage_PrintToStream(Message : TCPlusObject); cdecl; external BePascalLibName; +function BMessage_RemoveData(Message : TCPlusObject; const name : PChar; index : Integer) : Status_t; cdecl; external BePascalLibName; +function BMessage_WasDelivered(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName; +function BMessage_IsSourceRemote(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName; +function BMessage_IsSourceWaiting(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName; +function BMessage_IsReply(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName; +function BMessage_Previous(Message : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName; +function BMessage_WasDropped(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName; + +implementation + + // start BMessage +constructor BMessage.Create; +begin + inherited Create; + CPlusObject := BMessage_Create(Self); +end; + +constructor BMessage.Create(Command : Cardinal); +begin + inherited Create; + CPlusObject := BMessage_Create(Self, Command); +end; + +constructor BMessage.Create(var Message : BMessage); +begin + inherited Create; + CPlusObject := BMessage_Create(Self, Message.FCPlusObject); +end; + +destructor BMessage.Destroy; +begin + if CPlusObject <> nil then + BMessage_Free(CPlusObject); + inherited; +end; + +function BMessage.GetWhat : Cardinal; +begin + Result := BMessage_GetWhat(CPlusObject); +end; + +procedure BMessage.SetWhat(aWhat : Cardinal); +begin + BMessage_SetWhat(CPlusObject, aWhat); +end; + +function BMessage.AddData(const Name : PChar; aType : Type_Code; const Data : Pointer; FixedSize : Cardinal; NumItems : Integer) : Status_t; +begin + result := BMessage_AddData(CPlusObject, Name, aType, Data, FixedSize, NumItems); +end; + +function BMessage.AddBool(const Name : PChar; aBool : boolean) : Status_t; +begin + result := BMessage_AddBool(CPlusObject, Name, aBool); +end; + +function BMessage.AddInt8(const Name : PChar; anInt8 : Shortint) : Status_t; +begin + result := BMessage_AddInt8(CPlusObject, Name, anInt8); +end; + +function BMessage.FindInt8(const Name : PChar; var anInt8 : Shortint) : Status_t; +begin + result := BMessage_FindInt8(CPlusObject, Name, anInt8); +end; + +function BMessage.AddInt16(const Name : PChar; anInt16 : Smallint) : Status_t; +begin + result := BMessage_AddInt16(CPlusObject, Name, anInt16); +end; + +function BMessage.AddInt32(const Name : PChar; anInt32 : Integer) : Status_t; +begin + result := BMessage_AddInt32(CPlusObject, Name, anInt32); +end; + +function BMessage.AddInt64(const Name : PChar; anInt64 : int64) : Status_t; +begin + result := BMessage_AddInt64(CPlusObject, Name, anInt64); +end; + +function BMessage.AddFloat(const Name : PChar; aFloat : Single) : Status_t; +begin + result := BMessage_AddFloat(CPlusObject, Name, aFloat); +end; + +function BMessage.AddDouble(const Name : PChar; aDouble : Double) : Status_t; +begin + result := BMessage_AddDouble(CPlusObject, Name, aDouble); +end; + +function BMessage.AddString(const Name : PChar; aString : PChar) : Status_t; +begin + result := BMessage_AddString(CPlusObject, Name, aString); +end; + +function BMessage.FindString(const Name : PChar;var aString : PChar) : Status_t; +begin + result := BMessage_FindString(CPlusObject, Name, aString); +end; + +function BMessage.AddMessage(const Name : PChar; aMessage : TCPlusObject) : Status_t; +begin + result := BMessage_AddMessage(CPlusObject, Name, aMessage); +end; + +function BMessage.CountNames(aType : Type_Code) : Integer; +begin + result := BMessage_CountNames(CPlusObject, aType); +end; + +function BMessage.HasSpecifiers : boolean; +begin + result := BMessage_HasSpecifiers(CPlusObject); +end; + +function BMessage.IsSystem : boolean; +begin + result := BMessage_IsSystem(CPlusObject); +end; + +function BMessage.MakeEmpty : Status_t; +begin + result := BMessage_MakeEmpty(CPlusObject); +end; + +function BMessage.IsEmpty : boolean; +begin + result := BMessage_IsEmpty(CPlusObject); +end; + +function BMessage.RemoveName(const Name : PChar) : Status_t; +begin + result := BMessage_RemoveName(CPlusObject, Name); +end; + +procedure BMessage.PrintToStream; +begin + BMessage_PrintToStream(CPlusObject); +end; + +function BMessage.RemoveData(const name : PChar; index : Integer) : Status_t; +begin + result := BMessage_RemoveData(CPlusObject, name, index); +end; + +function BMessage.WasDelivered : boolean; +begin + result := BMessage_WasDelivered(CPlusObject); +end; + +function BMessage.IsSourceRemote : boolean; +begin + result := BMessage_IsSourceRemote(CPlusObject); +end; + +function BMessage.IsSourceWaiting : boolean; +begin + result := BMessage_IsSourceWaiting(CPlusObject); +end; + +function BMessage.IsReply : boolean; +begin + result := BMessage_IsReply(CPlusObject); +end; + +function BMessage.Previous : BMessage; +begin + result := BMessage.Wrap(BMessage_Previous(CPlusObject)); +end; + +function BMessage.WasDropped : boolean; +begin + result := BMessage_WasDropped(CPlusObject); +end; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/app/messenger.pp b/bepascal/source/bepascal/pas/src/be/app/messenger.pp new file mode 100644 index 0000000..87ae9bf --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/app/messenger.pp @@ -0,0 +1,249 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit messenger; + +interface + +uses + beobj, os, Handler, Looper, Message, SupportDefs; + +type + BMessenger = class(TBeObject) + private + public + constructor Create; override; + constructor Create(mime_sig : PChar; aTeam : Team_id; perr : PStatus_t); + constructor Create(handler : BHandler; looper : BLooper; perr : PStatus_t); + constructor Create(from : BMessenger); + destructor Destroy; override; + function IsTargetLocal : boolean; + function Target(looper : BLooper) : BHandler; + function LockTarget : boolean; +// function LockTargetWithTimeout(timeout : Bigtime_t) : Status_t; + function SendMessage(command : Cardinal; reply_to : BHandler) : Status_t; + function SendMessage(a_message : BMessage; reply_to : BHandler; timeout : Bigtime_t) : Status_t; + function SendMessage(a_message : BMessage; reply_to : BMessenger; timeout : Bigtime_t) : Status_t; + function SendMessage(command : Cardinal; reply : BMessage) : Status_t; + function SendMessage(a_message : BMessage; reply : BMessage; send_timeout : Bigtime_t; reply_timeout : Bigtime_t) : Status_t; +// function operator=(from : BMessenger) : BMessenger; +// function operator==(other : BMessenger) : boolean; + function IsValid : boolean; + function Team : Team_id; +// constructor Create(aTeam : Team_id; port : TPort_id; token : integer; preferred : boolean); +// procedure InitData(mime_sig : PChar; aTeam : Team_id; perr : PStatus_t); +// procedure port_id fPort; +// procedure int32 fHandlerToken; +// procedure team_id fTeam; +// procedure int32 extra0; +// procedure int32 extra1; +// procedure bool fPreferredTarget; +// procedure bool extra2; +// procedure bool extra3; +// procedure bool extra4; + end; + +function BMessenger_Create(AObject : TBeObject) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create'; +function BMessenger_Create(AObject : TBeObject; mime_sig : PChar; team : Team_id; perr : PStatus_t) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create_1'; +function BMessenger_Create(AObject : TBeObject; handler : BHandler; looper : BLooper; perr : PStatus_t) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create_2'; +function BMessenger_Create(AObject : TBeObject; from : BMessenger) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create_3'; +procedure BMessenger_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_Free'; +function BMessenger_IsTargetLocal(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMessenger_IsTargetLocal'; +function BMessenger_Target(AObject : TCPlusObject; looper : TCplusObject) : BHandler; cdecl; external BePascalLibName name 'BMessenger_Target'; +function BMessenger_LockTarget(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMessenger_LockTarget'; +//function BMessenger_LockTargetWithTimeout(AObject : TCPlusObject; timeout : Bigtime_t) : Status_t; cdecl; external BePascalLibName name 'BMessenger_LockTargetWithTimeout'; +function BMessenger_SendMessage(AObject : TCPlusObject; command : Cardinal; reply_to : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage'; +function BMessenger_SendMessage_1(AObject : TCPlusObject; a_message : TCplusObject; reply_to : TCplusObject; timeout : Bigtime_t) : Status_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_1'; +// How to handle this ? (remove the comment to see what to fix) +function BMessenger_SendMessage_2(AObject : TCPlusObject; a_message : TCplusObject; reply_to : TCplusObject; timeout : Bigtime_t) : Status_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_2'; +function BMessenger_SendMessage_3(AObject : TCPlusObject; command : Cardinal; reply : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_3'; +function BMessenger_SendMessage_4(AObject : TCPlusObject; a_message : TCplusObject; reply : TCplusObject; send_timeout : Bigtime_t; reply_timeout : Bigtime_t) : Status_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_4'; +//function BMessenger_operator=(AObject : TCPlusObject; from : BMessenger) : BMessenger; cdecl; external BePascalLibName name 'BMessenger_operator='; +//function BMessenger_operator==(AObject : TCPlusObject; other : BMessenger) : boolean; cdecl; external BePascalLibName name 'BMessenger_operator=='; +function BMessenger_IsValid(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMessenger_IsValid'; +function BMessenger_Team(AObject : TCPlusObject) : Team_id; cdecl; external BePascalLibName name 'BMessenger_Team'; +//function BMessenger_Create(AObject : TBeObject; team : Team_id; port : TPort_id; token : integer; preferred : boolean) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create'; +//procedure BMessenger_InitData(AObject : TCPlusObject; mime_sig : PChar; team : Team_id; perr : PStatus_t); cdecl; external BePascalLibName name 'BMessenger_InitData'; +//procedure BMessenger_port_id fPort(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_port_id fPort'; +//procedure BMessenger_int32 fHandlerToken(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_int32 fHandlerToken'; +//procedure BMessenger_team_id fTeam(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_team_id fTeam'; +//procedure BMessenger_int32 extra0(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_int32 extra0'; +//procedure BMessenger_int32 extra1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_int32 extra1'; +//procedure BMessenger_bool fPreferredTarget(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_bool fPreferredTarget'; +//procedure BMessenger_bool extra2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_bool extra2'; +//procedure BMessenger_bool extra3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_bool extra3'; +//procedure BMessenger_bool extra4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_bool extra4'; + +var + be_app_BMessenger : BMessenger; + be_app_messengerCPlus : TCPlusObject; cvar; external; + +implementation + +constructor BMessenger.Create; +begin + BMessenger_Create(Self); +end; + +constructor BMessenger.Create(mime_sig : PChar; aTeam : Team_id; perr : PStatus_t); +begin + CPlusObject := BMessenger_Create(Self, mime_sig, aTeam, perr); +end; + +constructor BMessenger.Create(handler : BHandler; looper : BLooper; perr : PStatus_t); +begin + CPlusObject := BMessenger_Create(Self, handler, looper, perr); +end; + +constructor BMessenger.Create(from : BMessenger); +begin + CPlusObject := BMessenger_Create(Self, from); +end; + +destructor BMessenger.Destroy; +begin + BMessenger_Free(CPlusObject); +end; + +function BMessenger.IsTargetLocal : boolean; +begin + Result := BMessenger_IsTargetLocal(CPlusObject); +end; + +function BMessenger.Target(looper : BLooper) : BHandler; +begin + Result := BMessenger_Target(CPlusObject, looper.CPlusObject); +end; + +function BMessenger.LockTarget : boolean; +begin + Result := BMessenger_LockTarget(CPlusObject); +end; + +//function BMessenger.LockTargetWithTimeout(timeout : Bigtime_t) : Status_t; +//begin +// BMessenger_LockTargetWithTimeout(CPlusObject, timeout); +//end; + +function BMessenger.SendMessage(command : Cardinal; reply_to : BHandler) : Status_t; +begin + Result := BMessenger_SendMessage(CPlusObject, command, reply_to.CPlusObject); +end; + +function BMessenger.SendMessage(a_message : BMessage; reply_to : BHandler; timeout : Bigtime_t) : Status_t; +begin + Result := BMessenger_SendMessage_1(CPlusObject, a_message.CPlusObject, reply_to.CPlusObject, timeout); +end; + +function BMessenger.SendMessage(a_message : BMessage; reply_to : BMessenger; timeout : Bigtime_t) : Status_t; +begin + Result := BMessenger_SendMessage_2(CPlusObject, a_message.CPlusObject, reply_to.CPlusObject, timeout); +end; + +function BMessenger.SendMessage(command : Cardinal; reply : BMessage) : Status_t; +begin + Result := BMessenger_SendMessage_3(CPlusObject, command, reply.CPlusObject); +end; + +function BMessenger.SendMessage(a_message : BMessage; reply : BMessage; send_timeout : Bigtime_t; reply_timeout : Bigtime_t) : Status_t; +begin + Result := BMessenger_SendMessage_4(CPlusObject, a_message.CPlusObject, reply.CPlusObject, send_timeout, reply_timeout); +end; + +//function BMessenger.operator=(from : BMessenger) : BMessenger; +//begin +// BMessenger_operator=(CPlusObject, from); +//end; +// +//function BMessenger.operator==(other : BMessenger) : boolean; +//begin +// BMessenger_operator==(CPlusObject, other); +//end; + +function BMessenger.IsValid : boolean; +begin + Result := BMessenger_IsValid(CPlusObject); +end; + +function BMessenger.Team : Team_id; +begin + Result := BMessenger_Team(CPlusObject); +end; + +//constructor BMessenger.Create(aTeam : Team_id; port : TPort_id; token : integer; preferred : boolean); +//begin +// CPlusObject := BMessenger_Create(Self, aTeam, port, token, preferred); +//end; + +//procedure BMessenger.InitData(mime_sig : PChar; aTeam : Team_id; perr : PStatus_t); +//begin +// BMessenger_InitData(CPlusObject, mime_sig, aTeam, perr); +//end; + +//procedure BMessenger.port_id fPort; +//begin +// BMessenger_port_id fPort(CPlusObject); +//end; +// +//procedure BMessenger.int32 fHandlerToken; +//begin +// BMessenger_int32 fHandlerToken(CPlusObject); +//end; +// +//procedure BMessenger.team_id fTeam; +//begin +// BMessenger_team_id fTeam(CPlusObject); +//end; +// +//procedure BMessenger.int32 extra0; +//begin +// BMessenger_int32 extra0(CPlusObject); +//end; +// +//procedure BMessenger.int32 extra1; +//begin +// BMessenger_int32 extra1(CPlusObject); +//end; +// +//procedure BMessenger.bool fPreferredTarget; +//begin +// BMessenger_bool fPreferredTarget(CPlusObject); +//end; +// +//procedure BMessenger.bool extra2; +//begin +// BMessenger_bool extra2(CPlusObject); +//end; +// +//procedure BMessenger.bool extra3; +//begin +// BMessenger_bool extra3(CPlusObject); +//end; +// +//procedure BMessenger.bool extra4; +//begin +// BMessenger_bool extra4(CPlusObject); +//end; + +initialization + be_app_BMessenger := nil; + +finalization + be_app_BMessenger := nil; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/app/roster.pp b/bepascal/source/bepascal/pas/src/be/app/roster.pp new file mode 100644 index 0000000..12c150b --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/app/roster.pp @@ -0,0 +1,343 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit Roster; + +interface + +uses + beobj, appdefs, supportdefs, OS, Entry, StorageDefs, List, Messenger, + message; + +type + PTEntryRef = ^EntryRef; + + AppInfoProc = procedure; + + AppInfo = record + thread : Thread_id; + team : Team_id; + port : Port_id; + flags : Cardinal; + ref : EntryRef; + signature : Array[0..B_MIME_TYPE_LENGTH] of Char; + end; + + BRoster = class(TBeObject) + private + public + constructor Create; override; + destructor Destroy; override; +//***************** + function IsRunning(mime_sig : PChar) : boolean; + function IsRunning(var ref : EntryRef) : boolean; + function TeamFor(mime_sig : PChar) : Team_id; + function TeamFor(var ref : EntryRef) : Team_id; + procedure GetAppList(team_id_list : BList); + procedure GetAppList(sig : PChar; team_id_list : BList); + function GeAppInfo(sig : PChar; var info : AppInfo) : Status_t; + function GeAppInfo(var ref : EntryRef; var info : AppInfo) : Status_t; + function GetRunningAppInfo(team : Team_id; var info : AppInfo) : Status_t; + function GetActiveAppInfo(var info : AppInfo) : Status_t; + function FindApp(mime_type : PChar; var app : EntryRef) : Status_t; + function FindApp(var ref : EntryRef; var app : EntryRef) : Status_t; + function Broadcast(msg : BMessage) : Status_t; + function Broadcast(msg : BMessage; reply_to : BMessenger) : Status_t; + function StopWatching(target : BMessenger) : Status_t; + function ActivateApp(team : Team_id) : Status_t; + function Launch(mime_type : PChar; initial_msgs : BMessage; var app_team : Team_id) : Status_t; + function Launch(mime_type : PChar; message_list : BList; var app_team : Team_id) : Status_t; + function Launch(mime_type : PChar; argc : integer; args : PChar; var app_team : Team_id) : Status_t; + function Launch(var ref : EntryRef; initial_message : BMessage; var app_team : Team_id) : Status_t; + function Launch(var ref : EntryRef; message_list : BList; var app_team : Team_id) : Status_t; + function Launch(var ref : EntryRef; argc : integer; args : PChar; var app_team : Team_id) : Status_t; + procedure GetRecentDocuments(refList : BMessage; maxCount : integer; ofType : PChar; openedByAppSig : PChar); + procedure GetRecentDocuments(refList : BMessage; maxCount : integer; ofTypeList : PChar; ofTypeListCount : integer; openedByAppSig : PChar); + procedure GetRecentFolders(refList : BMessage; maxCount : integer; openedByAppSig : PChar); + procedure GetRecentApps(refList : BMessage; maxCount : integer); + procedure AddToRecentDocuments(var doc : EntryRef; appSig : PChar); + procedure AddToRecentFolders(var folder : EntryRef; appSig : PChar); +// private +// procedure enum mtarget { MAIN_MESSENGER, MIME_MESSENGER, USE_GIVEN }; +{ function _StartWatching(t : ; roster_mess : BMessenger; what : Cardinal; notify : BMessenger; event_mask : Cardinal) : Status_t; + function _StopWatching(t : ; roster_mess : BMessenger; what : Cardinal; notify : BMessenger) : Status_t; + function AddApplication(mime_sig : PChar; ref : ^EntryRef; flags : Cardinal; team : Team_id; thread : TThread_id; port : TPort_id; full_reg : boolean) : Cardinal; + procedure SetSignature(team : Team_id; mime_sig : PChar); + procedure SetThread(team : Team_id; tid : TThread_id); + procedure SetThreadAndTeam(entry_token : Cardinal; tid : TThread_id; team : Team_id); + procedure CompleteRegistration(team : Team_id; : TThread_id; port : TPort_id); + function IsAppPreRegistered(ref : ^BEntryRef; team : Team_id; info : ^AppInfo) : boolean; + procedure RemovePreRegApp(entry_token : Cardinal); + procedure RemoveApp(team : Team_id); + function xLaunchAppPrivate(mime_sig : PChar; ref : ^BEntryRef; msg_list : BList; cargs : integer; args : PChar; app_team : ^Team_id) : Status_t; + function UpdateActiveApp(team : Team_id) : boolean; + procedure SetAppFlags(team : Team_id; flags : Cardinal); + procedure DumpRoster; + function resolve_app(in_type : PChar; ref : ^BEntryRef; app_ref : ^BEntryRef; app_sig : PChar; app_flags : Cardinal; was_document : boolean) : Status_t; + function translate_ref(ref : ^BEntryRef; app_meta : TBMimeType; app_ref : ^BEntryRef; app_file : TBFile; app_sig : PChar; was_document : boolean) : Status_t; + function translate_type(mime_type : PChar; meta : TBMimeType; app_ref : ^BEntryRef; app_file : TBFile; app_sig : PChar) : Status_t; + function sniff_file(file : ^BEntryRef; finfo : TBNodeInfo; mime_type : PChar) : Status_t; + function is_wildcard(sig : PChar) : boolean; + function get_unique_supporting_app(apps : BMessage; out_sig : PChar) : Status_t; + function get_random_supporting_app(apps : BMessage; out_sig : PChar) : Status_t; + function build_arg_vector(args : PChar; pargs : integer; app_ref : ^BEntryRef; doc_ref : ^BEntryRef) : PChar; + function send_to_running(tema : Team_id; app_ref : ^BEntryRef; cargs : integer; args : PChar; msg_list : BList; ref : ^BEntryRef) : Status_t; + procedure IniBMessengers; + procedure BMessenger fMess; + procedure BMessenger fMimeMess; + procedure uint32 _fReserved[3]; +} + end; + +function Get_be_roster : TCPlusObject; cdecl; external BePascalLibName; +function BRoster_Create(AObject : TObject) : TCPlusObject; cdecl; external BePascalLibName; +procedure BRoster_Destroy(CPlusObject : TCPlusObject); cdecl; external BePascalLibName; + +//function app_info_Create(AObject : TBeObject); cdecl; external BePascalLibName name 'app_info_Create'; +//procedure app_info_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_Free'; +//procedure app_info_thread_id thread(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_thread_id thread'; +//procedure app_info_team_id team(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_team_id team'; +//procedure app_info_port_id port(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_port_id port'; +//procedure app_info_uint32 flags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_uint32 flags'; +//procedure app_info_entry_ref ref(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_entry_ref ref'; +//procedure app_info_char signature[B_MIME_TYPE_LENGTH](AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_char signature[B_MIME_TYPE_LENGTH]'; +//function BRoster_Create(AObject : TBeObject); cdecl; external BePascalLibName name 'BRoster_Create'; +//procedure BRoster_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_Free'; +function BRoster_IsRunning(AObject : TCPlusObject; mime_sig : PChar) : boolean; cdecl; external BePascalLibName name 'BRoster_IsRunning'; +function BRoster_IsRunning(AObject : TCPlusObject; var ref : EntryRef) : boolean; cdecl; external BePascalLibName name 'BRoster_IsRunning'; +function BRoster_TeamFor(AObject : TCPlusObject; mime_sig : PChar) : Team_id; cdecl; external BePascalLibName name 'BRoster_TeamFor'; +function BRoster_TeamFor(AObject : TCPlusObject; var ref : EntryRef) : Team_id; cdecl; external BePascalLibName name 'BRoster_TeamFor'; +procedure BRoster_GetAppList(AObject : TCPlusObject; team_id_list : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_GetAppList'; +procedure BRoster_GetAppList(AObject : TCPlusObject; sig : PChar; team_id_list : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_GetAppList'; +function BRoster_GeAppInfo(AObject : TCPlusObject; sig : PChar; var info : AppInfo) : Status_t; cdecl; external BePascalLibName name 'BRoster_GetAppInfo'; +function BRoster_GeAppInfo(AObject : TCPlusObject; var ref : EntryRef; var info : AppInfo) : Status_t; cdecl; external BePascalLibName name 'BRoster_GetAppInfo'; +function BRoster_GetRunningAppInfo(AObject : TCPlusObject; team : Team_id; var info : AppInfo) : Status_t; cdecl; external BePascalLibName name 'BRoster_GetRunningAppInfo'; +function BRoster_GetActiveAppInfo(AObject : TCPlusObject; var info : AppInfo) : Status_t; cdecl; external BePascalLibName name 'BRoster_GetActiveAppInfo'; +function BRoster_FindApp(AObject : TCPlusObject; mime_type : PChar; var app : EntryRef) : Status_t; cdecl; external BePascalLibName name 'BRoster_FindApp'; +function BRoster_FindApp_1(AObject : TCPlusObject; var ref : EntryRef; var app : EntryRef) : Status_t; cdecl; external BePascalLibName name 'BRoster_FindApp'; +function BRoster_Broadcast(aRoster : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRoster_Broadcast'; +function BRoster_Broadcast_1(AObject : TCPlusObject; msg : TCPlusObject; reply_to : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRoster_Broadcast'; +function BRoster_StopWatching(AObject : TCPlusObject; target : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRoster_StopWatching'; +function BRoster_ActivateApp(AObject : TCPlusObject; team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_ActivateApp'; +function BRoster_Launch(AObject : TCPlusObject; mime_type : PChar; initial_msgs : TCPlusObject; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch'; +function BRoster_Launch_1(AObject : TCPlusObject; mime_type : PChar; message_list : TCPlusObject; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch'; +function BRoster_Launch_2(AObject : TCPlusObject; mime_type : PChar; argc : integer; args : PChar; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch'; +function BRoster_Launch_3(AObject : TCPlusObject; var ref : EntryRef; initial_message : BMessage; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch'; +function BRoster_Launch_4(AObject : TCPlusObject; var ref : EntryRef; message_list : BList; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch'; +function BRoster_Launch_5(AObject : TCPlusObject; var ref : EntryRef; argc : integer; args : PChar; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch'; +procedure BRoster_GetRecentDocuments(AObject : TCPlusObject; refList : TCPlusObject; maxCount : integer; ofType : PChar; openedByAppSig : PChar); cdecl; external BePascalLibName name 'BRoster_GetRecentDocuments'; +procedure BRoster_GetRecentDocuments(AObject : TCPlusObject; refList : TCPlusObject; maxCount : integer; ofTypeList : PChar; ofTypeListCount : integer; openedByAppSig : PChar); cdecl; external BePascalLibName name 'BRoster_GetRecentDocuments'; +procedure BRoster_GetRecentFolders(AObject : TCPlusObject; refList : TCPlusObject; maxCount : integer; openedByAppSig : PChar); cdecl; external BePascalLibName name 'BRoster_GetRecentFolders'; +procedure BRoster_GetRecentApps(AObject : TCPlusObject; refList : TCPlusObject; maxCount : integer); cdecl; external BePascalLibName name 'BRoster_GetRecentApps'; +procedure BRoster_AddToRecentDocuments(AObject : TCPlusObject; var doc : EntryRef; appSig : PChar); cdecl; external BePascalLibName name 'BRoster_AddToRecentDocuments'; +procedure BRoster_AddToRecentFolders(AObject : TCPlusObject; var folder : EntryRef; appSig : PChar); cdecl; external BePascalLibName name 'BRoster_AddToRecentFolders'; +// procedure BRoster_enum mtarget { MAIN_MESSENGER, MIME_MESSENGER, USE_GIVEN }(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_enum mtarget { MAIN_MESSENGER, MIME_MESSENGER, USE_GIVEN }'; +{function BRoster__StartWatching(AObject : TCPlusObject; t : ; roster_mess : TCPlusObject; what : Cardinal; notify : TCPlusObject; event_mask : Cardinal) : Status_t; cdecl; external BePascalLibName name 'BRoster__StartWatching'; +function BRoster__StopWatching(AObject : TCPlusObject; t : ; roster_mess : TCPlusObject; what : Cardinal; notify : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRoster__StopWatching'; +function BRoster_AddApplication(AObject : TCPlusObject; mime_sig : PChar; ref : ^BEntryRef; flags : Cardinal; team : Team_id; thread : TThread_id; port : TPort_id; full_reg : boolean) : Cardinal; cdecl; external BePascalLibName name 'BRoster_AddApplication'; +procedure BRoster_SetSignature(AObject : TCPlusObject; team : Team_id; mime_sig : PChar); cdecl; external BePascalLibName name 'BRoster_SetSignature'; +procedure BRoster_SetThread(AObject : TCPlusObject; team : Team_id; tid : TThread_id); cdecl; external BePascalLibName name 'BRoster_SetThread'; +procedure BRoster_SetThreadAndTeam(AObject : TCPlusObject; entry_token : Cardinal; tid : TThread_id; team : Team_id); cdecl; external BePascalLibName name 'BRoster_SetThreadAndTeam'; +procedure BRoster_CompleteRegistration(AObject : TCPlusObject; team : Team_id; : TThread_id; port : TPort_id); cdecl; external BePascalLibName name 'BRoster_CompleteRegistration'; +function BRoster_IsAppPreRegistered(AObject : TCPlusObject; ref : ^BEntryRef; team : Team_id; info : ^AppInfo) : boolean; cdecl; external BePascalLibName name 'BRoster_IsAppPreRegistered'; +procedure BRoster_RemovePreRegApp(AObject : TCPlusObject; entry_token : Cardinal); cdecl; external BePascalLibName name 'BRoster_RemovePreRegApp'; +procedure BRoster_RemoveApp(AObject : TCPlusObject; team : Team_id); cdecl; external BePascalLibName name 'BRoster_RemoveApp'; +function BRoster_xLaunchAppPrivate(AObject : TCPlusObject; mime_sig : PChar; ref : ^BEntryRef; msg_list : TCPlusObject; cargs : integer; args : PChar; app_team : ^Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_xLaunchAppPrivate'; +function BRoster_UpdateActiveApp(AObject : TCPlusObject; team : Team_id) : boolean; cdecl; external BePascalLibName name 'BRoster_UpdateActiveApp'; +procedure BRoster_SetAppFlags(AObject : TCPlusObject; team : Team_id; flags : Cardinal); cdecl; external BePascalLibName name 'BRoster_SetAppFlags'; +procedure BRoster_DumpRoster(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_DumpRoster'; +function BRoster_resolve_app(AObject : TCPlusObject; in_type : PChar; ref : ^BEntryRef; app_ref : ^BEntryRef; app_sig : PChar; app_flags : Cardinal; was_document : boolean) : Status_t; cdecl; external BePascalLibName name 'BRoster_resolve_app'; +function BRoster_translate_ref(AObject : TCPlusObject; ref : ^BEntryRef; app_meta : TCPlusObject; app_ref : ^BEntryRef; app_file : TCPlusObject; app_sig : PChar; was_document : boolean) : Status_t; cdecl; external BePascalLibName name 'BRoster_translate_ref'; +function BRoster_translate_type(AObject : TCPlusObject; mime_type : PChar; meta : TCPlusObject; app_ref : ^BEntryRef; app_file : TCPlusObject; app_sig : PChar) : Status_t; cdecl; external BePascalLibName name 'BRoster_translate_type'; +function BRoster_sniff_file(AObject : TCPlusObject; file : ^BEntryRef; finfo : TCPlusObject; mime_type : PChar) : Status_t; cdecl; external BePascalLibName name 'BRoster_sniff_file'; +function BRoster_is_wildcard(AObject : TCPlusObject; sig : PChar) : boolean; cdecl; external BePascalLibName name 'BRoster_is_wildcard'; +function BRoster_get_unique_supporting_app(AObject : TCPlusObject; apps : BMessage; out_sig : PChar) : Status_t; cdecl; external BePascalLibName name 'BRoster_get_unique_supporting_app'; +function BRoster_get_random_supporting_app(AObject : TCPlusObject; apps : BMessage; out_sig : PChar) : Status_t; cdecl; external BePascalLibName name 'BRoster_get_random_supporting_app'; +function BRoster_build_arg_vector(AObject : TCPlusObject; args : PChar; pargs : integer; app_ref : ^BEntryRef; doc_ref : ^BEntryRef) : PChar; cdecl; external BePascalLibName name 'BRoster_build_arg_vector'; +function BRoster_send_to_running(AObject : TCPlusObject; tema : Team_id; app_ref : ^BEntryRef; cargs : integer; args : PChar; msg_list : BList; ref : ^BEntryRef) : Status_t; cdecl; external BePascalLibName name 'BRoster_send_to_running'; +procedure BRoster_IniBMessengers(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_IniBMessengers'; +procedure BRoster_BMessenger fMess(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_BMessenger fMess'; +procedure BRoster_BMessenger fMimeMess(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_BMessenger fMimeMess'; +procedure BRoster_uint32 _fReserved[3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_uint32 _fReserved[3]'; +} + +var + be_roster : BRoster; + +implementation + +constructor BRoster.Create; +begin + inherited; + CPlusObject := BRoster_Create(Self); + be_roster := Self; +end; + +destructor BRoster.Destroy; +begin + BRoster_Destroy(CPlusObject); + inherited; +end; + +function BRoster.IsRunning(mime_sig : PChar) : boolean; +begin + Result := BRoster_IsRunning(CPlusObject, mime_sig); +end; + +function BRoster.IsRunning(var ref : EntryRef) : boolean; +begin + Result := BRoster_IsRunning(CPlusObject, ref); +end; + +function BRoster.TeamFor(mime_sig : PChar) : Team_id; +begin + Result := BRoster_TeamFor(CPlusObject, mime_sig); +end; + +function BRoster.TeamFor(var ref : EntryRef) : Team_id; +begin + Result := BRoster_TeamFor(CPlusObject, ref); +end; + +procedure BRoster.GetAppList(team_id_list : BList); +begin + BRoster_GetAppList(CPlusObject, team_id_list.CPlusObject); +end; + +procedure BRoster.GetAppList(sig : PChar; team_id_list : BList); +begin + BRoster_GetAppList(CPlusObject, sig, team_id_list.CPlusObject); +end; + +function BRoster.GeAppInfo(sig : PChar; var info : AppInfo) : Status_t; +begin + Result := BRoster_GeAppInfo(CPlusObject, sig, info); +end; + +function BRoster.GeAppInfo(var ref : EntryRef; var info : AppInfo) : Status_t; +begin + Result := BRoster_GeAppInfo(CPlusObject, ref, info); +end; + +function BRoster.GetRunningAppInfo(team : Team_id; var info : AppInfo) : Status_t; +begin + Result := BRoster_GetRunningAppInfo(CPlusObject, team, info); +end; + +function BRoster.GetActiveAppInfo(var info : AppInfo) : Status_t; +begin + Result := BRoster_GetActiveAppInfo(CPlusObject, info); +end; + +function BRoster.FindApp(mime_type : PChar; var app : EntryRef) : Status_t; +begin + Result := BRoster_FindApp(CPlusObject, mime_type, app); +end; + +function BRoster.FindApp(var ref : EntryRef; var app : EntryRef) : Status_t; +begin + Result := BRoster_FindApp_1(CPlusObject, ref, app); +end; + +function BRoster.Broadcast(msg : BMessage) : Status_t; +begin + Result := BRoster_Broadcast(CPlusObject, msg.CPlusObject); +end; + +function BRoster.Broadcast(msg : BMessage; reply_to : BMessenger) : Status_t; +begin + Result := BRoster_Broadcast_1(CPlusObject, msg.CPlusObject, reply_to.CPlusObject); +end; + +function BRoster.StopWatching(target : BMessenger) : Status_t; +begin + Result := BRoster_StopWatching(CPlusObject, target.CPlusObject); +end; + +function BRoster.ActivateApp(team : Team_id) : Status_t; +begin + Result := BRoster_ActivateApp(CPlusObject, team); +end; + +function BRoster.Launch(mime_type : PChar; initial_msgs : BMessage; var app_team : Team_id) : Status_t; +begin + Result := BRoster_Launch(CPlusObject, mime_type, initial_msgs.CPlusObject, app_team); +end; + +function BRoster.Launch(mime_type : PChar; message_list : BList; var app_team : Team_id) : Status_t; +begin + Result := BRoster_Launch_1(CPlusObject, mime_type, message_list.CPlusObject, app_team); +end; + +function BRoster.Launch(mime_type : PChar; argc : integer; args : PChar; var app_team : Team_id) : Status_t; +begin + Result := BRoster_Launch_2(CPlusObject, mime_type, argc, args, app_team); +end; + +function BRoster.Launch(var ref : EntryRef; initial_message : BMessage; var app_team : Team_id) : Status_t; +begin + Result := BRoster_Launch_3(CPlusObject, ref, initial_message, app_team); +end; + +function BRoster.Launch(var ref : EntryRef; message_list : BList; var app_team : Team_id) : Status_t; +begin + Result := BRoster_Launch_4(CPlusObject, ref, message_list, app_team); +end; + +function BRoster.Launch(var ref : EntryRef; argc : integer; args : PChar; var app_team : Team_id) : Status_t; +begin + Result := BRoster_Launch_5(CPlusObject, ref, argc, args, app_team); +end; + +procedure BRoster.GetRecentDocuments(refList : BMessage; maxCount : integer; ofType : PChar; openedByAppSig : PChar); +begin + BRoster_GetRecentDocuments(CPlusObject, refList.CPlusObject, maxCount, ofType, openedByAppSig); +end; + +procedure BRoster.GetRecentDocuments(refList : BMessage; maxCount : integer; ofTypeList : PChar; ofTypeListCount : integer; openedByAppSig : PChar); +begin + BRoster_GetRecentDocuments(CPlusObject, refList.CPlusObject, maxCount, ofTypeList, ofTypeListCount, openedByAppSig); +end; + +procedure BRoster.GetRecentFolders(refList : BMessage; maxCount : integer; openedByAppSig : PChar); +begin + BRoster_GetRecentFolders(CPlusObject, refList.CPlusObject, maxCount, openedByAppSig); +end; + +procedure BRoster.GetRecentApps(refList : BMessage; maxCount : integer); +begin + BRoster_GetRecentApps(CPlusObject, refList.CPlusObject, maxCount); +end; + +procedure BRoster.AddToRecentDocuments(var doc : EntryRef; appSig : PChar); +begin + BRoster_AddToRecentDocuments(CPlusObject, doc, appSig); +end; + +procedure BRoster.AddToRecentFolders(var folder : EntryRef; appSig : PChar); +begin + BRoster_AddToRecentFolders(CPlusObject, folder, appSig); +end; + +initialization + be_roster := BRoster.Wrap(Get_be_roster); + +finalization + be_roster.UnWrap; + be_roster := nil; +end. diff --git a/bepascal/source/bepascal/pas/src/be/bepas_kernel/beobj.pp b/bepascal/source/bepascal/pas/src/be/bepas_kernel/beobj.pp new file mode 100644 index 0000000..92e1141 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/bepas_kernel/beobj.pp @@ -0,0 +1,126 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit beobj; + +interface + +{$M+} + +uses + fdblib; + +// FreePascal use ld on BeOS (like on LINUX) to link to libraries. +// ld use the environment variable BELIBRARIES to find libraries. + +const + BePascalLibName = 'bepascal'; + +type + // BePascal types + TCPlusObject = Pointer; + THandle = Pointer; + + TBeObject = class(TObject) + private + procedure Debug; + protected + FCPlusObject : TCPlusObject; + public + constructor Create; virtual; + constructor CreatePas; virtual; + constructor Wrap(ACPlusObject : TCPlusObject); virtual; + destructor UnWrap; virtual; + property CPlusObject : TCPlusObject read FCPlusObject write FCPlusObject; + end; + +implementation + +uses + SysUtils; + +var + PasObject_GetPasClassName_hook : Pointer; cvar; external; + +function PasObject_GetPasClassName_hook_func(PasObject : TBeObject) : PChar; +begin + if PasObject <> nil then + Result := StrPCopy(Result, PasObject.ClassName) + else + Result := ''; +end; + + // Not really a useful function. Un jour peut être... +function BPasObject_GetPasObject(ACPlusObject : TCPlusObject) : TObject; cdecl; external BePascalLibName name 'BPasObject_GetPasObject'; + + // start TBeObject +constructor TBeObject.Create; +begin + inherited; + Debug; +end; + + // Constructeur utilisé pour créer une instance Pascal à partir d'un objet C++. + // Nécessaire notamment pour encapsuler les objets C++ passé en paramètre des + // fonctions de hook. +constructor TBeObject.Wrap(ACPlusObject : TCPlusObject); +begin + Self.CPlusObject := ACPlusObject; + Debug; +end; + +constructor TBeObject.CreatePas; +begin + Create; +end; + +procedure TBeObject.Debug; +var + size : cardinal; +begin +{$IFDEF DEBUG} + size := 0; + size := SizeOf(Self.ClassType); + SendText('Instance de ' + Self.ClassName + '(' + HexStr(longint(pointer(Self)), 8) + ')' + + '(' + IntToStr(size) + ')' + + ' '); +{$ENDIF} +end; + // Destructeur utilisé pour libérer l'objet pascal sans + // détruire l'objet C++ correspondant. Utile pour + // libérer la mémoire coté pascal dans le cas d'objets + // C++ qui ne sont pas propriété de l'application + // (cas des messages passés aux fonctions de rappel) +destructor TBeObject.UnWrap; +begin +{$IFDEF DEBUG} + SendText('UnWrap'); +{$ENDIF} + // On passe CPlusObject à nil pour éviter de libérer + // l'objet C++ lors de l'appel de free + Self.CPlusObject := nil; +end; + + // end TBeObject + +initialization + PasObject_GetPasClassName_hook := @PasObject_GetPasClassName_hook_func; + +finalization + PasObject_GetPasClassName_hook := nil; +end. diff --git a/bepascal/source/bepascal/pas/src/be/device/joystick.pp b/bepascal/source/bepascal/pas/src/be/device/joystick.pp new file mode 100644 index 0000000..6ac1563 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/device/joystick.pp @@ -0,0 +1,220 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit joystick; + +interface + +uses + beobj, SupportDefs, os; + +type + BJoystick = class(TBeObject) + private + public + constructor Create; override; + destructor Destroy; override; + function Open(portName : PChar) : Status_t; + procedure Close; + function Open_1(portName : PChar; enter_enhanced : boolean):Status_t; + + function Update: Status_t; + function SetMaxLatency( max_latency:TBigtime_t): Status_t; + function CountDevices : Cardinal; + function GetDeviceName( n : Integer; name : PChar; bufSize: Tsize_t): Status_t; + + function CountSticks: Cardinal; + function CountAxes:Cardinal; + function CountHats:Cardinal; + function CountButtons:Cardinal; + function GetAxisValues( out_values : Integer; for_stick : cardinal): Status_t; + function ButtonValues(for_stick: cardinal):Cardinal; + function IsCalibrationEnabled:boolean; + function EnableCalibration (calibrates : boolean): Status_t; + +//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean; +// function GetAxisNameAt(index: cardinal; BString *out_name): Status_t; +// function GetHatNameAt( index: cardinal,BString *out_name): Status_t; +// function GetButtonNameAt( index: cardinal,BString *out_name): Status_t; c +// function GetControllerModule( BString *out_name): Status_t; +// function GetControllerName( BString *out_name): Status_t; +// function GetHatValues( uint8 *out_hats;for_stick: cardinal): Status_t; + + end; + + + +function BJoystick_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BJoystick_Create'; +procedure BJoystick_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BJoystick_Free'; + +function BJoystick_Open(AObject : TCPlusObject; portName : PChar):Status_t ; cdecl; external BePascalLibName name 'BJoystick_Open'; +function BJoystick_Open_1(AObject : TCPlusObject; portName : PChar; enter_enhanced : boolean):Status_t; cdecl; external BePascalLibName name 'BJoystick_Open_1'; +procedure BJoystick_Close(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BJoystick_Close'; +function BJoystick_Update(AObject : TCPlusObject): Status_t; cdecl; external BePascalLibName name 'BJoystick_Update'; +function BJoystick_SetMaxLatency(AObject : TCPlusObject; max_latency:TBigtime_t): Status_t; cdecl; external BePascalLibName name 'BJoystick_SetMaxLatency'; +function BJoystick_CountDevices(AObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountDevices'; +function BJoystick_GetDeviceName(AObject : TCPlusObject; n : Integer; name : PChar; bufSize: Tsize_t): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetDeviceName'; + +function BJoystick_CountSticks(BAObject : TCPlusObject): Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountSticks'; +function BJoystick_CountAxes(BAObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountAxes'; +function BJoystick_CountHats(BAObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountHats'; +function BJoystick_CountButtons(BAObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountButtons'; +function BJoystick_GetAxisValues(BAObject : TCPlusObject; out_values : Integer; for_stick : cardinal): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetAxisValues'; +function BJoystick_ButtonValues(BAObject : TCPlusObject;for_stick: cardinal):Cardinal; cdecl; external BePascalLibName name 'BJoystick_ButtonValues'; +function BJoystick_IsCalibrationEnabled(BAObject : TCPlusObject):boolean; cdecl; external BePascalLibName name 'BJoystick_IsCalibrationEnabled'; +function BJoystick_EnableCalibration(BAObject : TCPlusObject;calibrates : boolean): Status_t; cdecl; external BePascalLibName name 'BJoystick_EnableCalibration'; + +//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean; cdecl; external BePascalLibName name 'BJoystick_EnterEnhancedMode'; +//function BJoystick_GetHatValues(BAObject : TCPlusObject, uint8 *out_hats;for_stick: cardinal): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetHatValues'; +//function BJoystick_GetAxisNameAt(BAObject : TCPlusObject;index: cardinal; BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetAxisNameAt'; +//function BJoystick_GetHatNameAt(BAObject : TCPlusObject; index: cardinal, BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetHatNameAt'; +//function BJoystick_GetButtonNameAt(BAObject : TCPlusObject; index: cardinal,BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetButtonNameAt'; +//function BJoystick_GetControllerModule(BAObject : TCPlusObject, BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetControllerModule'; +//function BJoystick_GetControllerName(BAObject : TCPlusObject, BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetControllerName'; + + +implementation + + + +constructor BJoystick.Create; +begin + inherited; + CPlusObject := BJoystick_Create(Self); +end; + +destructor BJoystick.Destroy; +begin + if CPlusObject <> nil then + BJoystick_Free(CPlusObject); + inherited; +end; + + +function BJoystick.Open(portName : PChar) : Status_t; +begin + result := BJoystick_Open(CPlusObject, portName); +end; + +function BJoystick.Open_1( portName : PChar; enter_enhanced : boolean):Status_t; +begin + result := BJoystick_Open_1(CPlusObject, portName , enter_enhanced); +end; + + +procedure BJoystick.Close; +begin + BJoystick_Close(CPlusObject); +end; + +function BJoystick.Update: Status_t; +begin + result:=BJoystick_Update(CPlusObject); +end; + +function BJoystick.SetMaxLatency(max_latency:TBigtime_t): Status_t; +begin + result:=BJoystick_SetMaxLatency(CPlusObject, max_latency); +end; + +function BJoystick.CountDevices :Cardinal; +begin + result:=BJoystick_CountDevices(CPlusObject); +end; + +function BJoystick.GetDeviceName( n : Integer; name : PChar; bufSize: Tsize_t): Status_t; +begin + result:=BJoystick_GetDeviceName(CPlusObject, n, name, bufSize ); +end; + +//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean; + +function BJoystick.CountSticks: Cardinal; +begin + result:=BJoystick_CountSticks(CPlusObject); +end; + +function BJoystick.CountAxes:Cardinal; +begin + result:=BJoystick_CountAxes(CPlusObject); +end; + +function BJoystick.CountHats:Cardinal; +begin + result:=BJoystick_CountHats(CPlusObject); +end; + +function BJoystick.CountButtons:Cardinal; +begin + result:=BJoystick_CountButtons(CPlusObject); +end; + +function BJoystick.GetAxisValues( out_values : Integer; for_stick : cardinal): Status_t; +begin + result:=BJoystick_GetAxisValues(CPlusObject, out_values, for_stick); +end; + +//function BJoystick.GetHatValues( uint8 *out_hats ; for_stick: cardinal): Status_t; +//begin +// result:=BJoystick_GetHatValues( out_hats,for_stick); +//end; + +function BJoystick.ButtonValues(for_stick: cardinal):Cardinal; +begin + result:=BJoystick_ButtonValues(CPlusObject,for_stick); +end; + +//function BJoystick.GetAxisNameAt(index: cardinal; BString *out_name): Status_t; +//begin +// result:=BJoystick_GetAxisNameAt(CPlusObject,index,out_name); +//end; + +//function BJoystick.GetHatNameAt( index: cardinal,BString *out_name): Status_t; +//begin +// result:=BJoystick_GetHatNameAt(CPlusObject, index,out_name); +//end; + +//function BJoystick.GetButtonNameAt( index: cardinal,BString *out_name): Status_t; +//begin +// result:=BJoystick_GetButtonNameAt(CPlusObject, index,out_name); +//end; + +//function BJoystick.GetControllerModule( BString *out_name): Status_t; +//begin +// result:=BJoystick_GetControllerModule(CPlusObject, out_name); +//end; + +//function BJoystick.GetControllerName( BString: *out_name): Status_t; +//begin +// result:=BJoystick_GetControllerName(CPlusObject, out_name); +//end; + +function BJoystick.IsCalibrationEnabled:boolean; +begin + result:=BJoystick_IsCalibrationEnabled(CPlusObject); +end; + +function BJoystick.EnableCalibration( calibrates : boolean): Status_t; +begin + result:=BJoystick_EnableCalibration(CPlusObject, calibrates); +end; + + +end. + + + diff --git a/bepascal/source/bepascal/pas/src/be/device/serialport.pp b/bepascal/source/bepascal/pas/src/be/device/serialport.pp new file mode 100644 index 0000000..886c75c --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/device/serialport.pp @@ -0,0 +1,277 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit serialport; + +interface + +uses + beobj, SupportDefs, os; + +type + // Pascal enum start at 0 (like in C++). We are lucky because we can't + // initialize enum values yet (?) in FreePascal ;-) + DataRate = (B_0_BPS, B_50_BPS, B_75_BPS, B_110_BPS, B_134_BPS, + B_150_BPS, B_200_BPS, B_300_BPS, B_600_BPS, B_1200_BPS, + B_1800_BPS, B_2400_BPS, B_4800_BPS, B_9600_BPS, B_19200_BPS, + B_38400_BPS, B_57600_BPS, B_115200_BPS, + B_230400_BPS, B_31250_BPS); + + DataBits = (B_DATA_BITS_7, B_DATA_BITS_8); + + StopBits = (B_STOP_BITS_1, B_STOP_BITS_2); + + ParityMode = (B_NO_PARITY, B_ODD_PARITY, B_EVEN_PARITY); + +const + B_NOFLOW_CONTROL = 0; + B_HARDWARE_CONTROL = 1; + B_SOFTWARE_CONTROL = 2; + +type + BSerialPort = class(TBeObject) + private + public + constructor Create; override; + destructor Destroy; override; + function Open(portName : PChar) : Status_t; + procedure Close; + + function Read(buf : PChar; count : Size_t) : TSSize_t; + function Write(const buf : PChar; count : Size_t) : TSSize_t; + + procedure SetBlocking(Blocking : boolean); + function SetTimeout(microSeconds : TBigtime_t) : Status_t; + function SeDataRate(bitsPerSecond : DataRate) : Status_t; + function GeDataRate : DataRate; + procedure SeDataBits(numBits : DataBits); + function GeDataBits : DataBits; + procedure SeStopBits(numBits : StopBits); + function GeStopBits : StopBits; + procedure SeParityMode(numBits : ParityMode); + function GeParityMode : ParityMode; + procedure ClearInput; + procedure ClearOutput; + + procedure SetFlowControl(method : Cardinal); + function GetFlowControl : Cardinal; + function SetDTR(asserted : boolean) : Status_t; + function SetRTS(asserted : boolean) : Status_t; + function NumCharsAvailable(var wait_until_this_many : integer) : Status_t; + + function IsCTS : boolean; + function IsDSR : boolean; + function IsRI : boolean; + function IsDCD : boolean; + function WaitForInput : TSSize_t; + + function CountDevices : integer; + function GetDeviceName(n : integer; name : PChar; bufSize : Size_t) : Status_t; + + property DataRate : DataRate read GeDataRate write SeDataRate; + property DataBits : DataBits read GeDataBits write SeDataBits; + property StopBits : StopBits read GeStopBits write SeStopBits; + property ParityMode : ParityMode read GeParityMode write SeParityMode; + end; + +function BSerialPort_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BSerialPort_Create'; +procedure BSerialPort_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_Free'; +function BSerialPort_Open(AObject : TCPlusObject; portName : PChar) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_Open'; +procedure BSerialPort_Close(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_Close'; +function BSerialPort_Read(AObject : TCPlusObject; buf : PChar; count : Size_t) : TSSize_t; cdecl; external BePascalLibName name 'BSerialPort_Read'; +function BSerialPort_Write(AObject : TCPlusObject; const buf : PChar; count : Size_t) : TSSize_t; cdecl; external BePascalLibName name 'BSerialPort_Write'; +procedure BSerialPort_SetBlocking(AObject : TCPlusObject; Blocking : boolean); cdecl; external BePascalLibName name 'BSerialPort_SetBlocking'; +function BSerialPort_SetTimeout(AObject : TCPlusObject; microSeconds : TBigtime_t) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SetTimeout'; +function BSerialPort_SeDataRate(AObject : TCPlusObject; bitsPerSecond : DataRate) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SeDataRate'; +function BSerialPort_DataRate(AObject : TCPlusObject) : DataRate; cdecl; external BePascalLibName name 'BSerialPort_DataRate'; +procedure BSerialPort_SeDataBits(AObject : TCPlusObject; numBits : DataBits); cdecl; external BePascalLibName name 'BSerialPort_SeDataBits'; +function BSerialPort_DataBits(AObject : TCPlusObject) : DataBits; cdecl; external BePascalLibName name 'BSerialPort_DataBits'; +procedure BSerialPort_SeStopBits(AObject : TCPlusObject; numBits : StopBits); cdecl; external BePascalLibName name 'BSerialPort_SeStopBits'; +function BSerialPort_StopBits(AObject : TCPlusObject) : StopBits; cdecl; external BePascalLibName name 'BSerialPort_StopBits'; +procedure BSerialPort_SeParityMode(AObject : TCPlusObject; numBits : ParityMode); cdecl; external BePascalLibName name 'BSerialPort_SeParityMode'; +function BSerialPort_ParityMode(AObject : TCPlusObject) : ParityMode; cdecl; external BePascalLibName name 'BSerialPort_ParityMode'; +procedure BSerialPort_ClearInput(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_ClearInput'; +procedure BSerialPort_ClearOutput(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_ClearOutput'; +procedure BSerialPort_SetFlowControl(AObject : TCPlusObject; method : Cardinal); cdecl; external BePascalLibName name 'BSerialPort_SetFlowControl'; +function BSerialPort_FlowControl(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BSerialPort_FlowControl'; +function BSerialPort_SetDTR(AObject : TCPlusObject; asserted : boolean) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SetDTR'; +function BSerialPort_SetRTS(AObject : TCPlusObject; asserted : boolean) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SetRTS'; +function BSerialPort_NumCharsAvailable(AObject : TCPlusObject; var wait_until_this_many : integer) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_NumCharsAvailable'; +function BSerialPort_IsCTS(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsCTS'; +function BSerialPort_IsDSR(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsDSR'; +function BSerialPort_IsRI(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsRI'; +function BSerialPort_IsDCD(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsDCD'; +function BSerialPort_WaitForInput(AObject : TCPlusObject) : TSSize_t; cdecl; external BePascalLibName name 'BSerialPort_WaitForInput'; +function BSerialPort_CountDevices(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BSerialPort_CountDevices'; +function BSerialPort_GetDeviceName(AObject : TCPlusObject; n : integer; name : PChar; bufSize : Size_t): Status_t; cdecl; external BePascalLibName name 'BSerialPort_GetDeviceName'; + +implementation + +constructor BSerialPort.Create; +begin + inherited; + CPlusObject := BSerialPort_Create(Self); +end; + +destructor BSerialPort.Destroy; +begin + if CPlusObject <> nil then + BSerialPort_Free(CPlusObject); + inherited; +end; + +function BSerialPort.Open(portName : PChar) : Status_t; +begin + result := BSerialPort_Open(CPlusObject, portName); +end; + +procedure BSerialPort.Close; +begin + BSerialPort_Close(CPlusObject); +end; + +function BSerialPort.Read(buf : PChar; count : Size_t) : TSSize_t; +begin + Result := BSerialPort_Read(CPlusObject, buf, count); +end; + +function BSerialPort.Write(const buf : PChar; count : Size_t) : TSSize_t; +begin + Result := BSerialPort_Write(CPlusObject, buf, count); +end; + +procedure BSerialPort.SetBlocking(Blocking : boolean); +begin + BSerialPort_SetBlocking(CPlusObject, Blocking); +end; + +function BSerialPort.SetTimeout(microSeconds : TBigtime_t) : Status_t; +begin + Result := BSerialPort_SetTimeout(CPlusObject, microSeconds); +end; + +function BSerialPort.SeDataRate(bitsPerSecond : DataRate) : Status_t; +begin + Result := BSerialPort_SeDataRate(CPlusObject, bitsPerSecond); +end; + +function BSerialPort.GeDataRate : DataRate; +begin + Result := BSerialPort_DataRate(CPlusObject); +end; + +procedure BSerialPort.SeDataBits(numBits : DataBits); +begin + BSerialPort_SeDataBits(CPlusObject, numBits); +end; + +function BSerialPort.GeDataBits : DataBits; +begin + Result := BSerialPort_DataBits(CPlusObject); +end; + +procedure BSerialPort.SeStopBits(numBits : StopBits); +begin + BSerialPort_SeStopBits(CPlusObject, numBits); +end; + +function BSerialPort.GeStopBits : StopBits; +begin + Result := BSerialPort_StopBits(CPlusObject); +end; + +procedure BSerialPort.SeParityMode(numBits : ParityMode); +begin + BSerialPort_SeParityMode(CPlusObject, numBits); +end; + +function BSerialPort.GeParityMode : ParityMode; +begin + Result := BSerialPort_ParityMode(CPlusObject); +end; + +procedure BSerialPort.ClearInput; +begin + BSerialPort_ClearInput(CPlusObject); +end; + +procedure BSerialPort.ClearOutput; +begin + BSerialPort_ClearOutput(CPlusObject); +end; + +procedure BSerialPort.SetFlowControl(method : Cardinal); +begin + BSerialPort_SetFlowControl(CPlusobject, method); +end; + +function BSerialPort.GetFlowControl : Cardinal; +begin + Result := BSerialPort_FlowControl(CPlusObject); +end; + +function BSerialPort.SetDTR(asserted : boolean) : Status_t; +begin + Result := BSerialPort_SetDTR(CPlusObject, asserted); +end; + +function BSerialPort.SetRTS(asserted : boolean) : Status_t; +begin + Result := BSerialPort_SetRTS(CPlusObject, asserted); +end; + +function BSerialPort.NumCharsAvailable(var wait_until_this_many : integer) : Status_t; +begin + Result := BSerialPort_NumCharsAvailable(CPlusObject, wait_until_this_many); +end; + +function BSerialPort.IsCTS : boolean; +begin + Result := BSerialPort_IsCTS(CPlusObject); +end; + +function BSerialPort.IsDSR : boolean; +begin + Result := BSerialPort_IsDSR(CPlusObject); +end; + +function BSerialPort.IsRI : boolean; +begin + Result := BSerialPort_IsRI(CPlusObject); +end; + +function BSerialPort.IsDCD : boolean; +begin + Result := BSerialPort_IsDCD(CPlusObject); +end; + +function BSerialPort.WaitForInput : TSSize_t; +begin + Result := BSerialPort_WaitForInput(CPlusObject); +end; + +function BSerialPort.CountDevices : integer; +begin + Result := BSerialPort_CountDevices(CPlusObject); +end; + +function BSerialPort.GetDeviceName(n : integer; name : PChar; bufSize : Size_t) : Status_t; +begin + Result := BSerialPort_GetDeviceName(CPlusObject, n, name, bufSize); +end; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/alert.pp b/bepascal/source/bepascal/pas/src/be/interface/alert.pp new file mode 100644 index 0000000..e8c50fd --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/alert.pp @@ -0,0 +1,199 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2003 Olivier Coursiere + Eric Jourde + Oscar Lesta + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit Alert; + +interface + +uses + BeObj, Archivable, Button, InterfaceDefs, Invoker, Handler, + Message, Rect, SupportDefs, TextView, Window; + +type +{ enum for flavors of alert } +// enum alert_type + Alert_Type = (B_EMPTY_ALERT, B_INFO_ALERT, B_IDEA_ALERT, B_WARNING_ALERT, + B_STOP_ALERT); + +//enum button_spacing + Button_Spacing = (B_EVEN_SPACING, B_OFFSET_SPACING); + + BAlert = class(BWindow) + private + public + // Here we have this name colition: type --> kind + constructor Create(title : PChar; text : PChar; button1 : PChar; + button2 : PChar; button3 : PChar; width : Button_Width; + kind{type} : Alert_Type); + constructor Create(title : PChar; text : PChar; button1 : PChar; + button2 : PChar; button3 : PChar; width : Button_Width; + spacing : Button_Spacing; kind{type} : Alert_Type); + constructor Create(data : BMessage); + + destructor Destroy; override; + + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure SetShortcut(button_index : integer; key : Char); + function Shortcut(button_index : integer) : Char; + function Go : integer; + function Go(invoker : BInvoker) : Status_t; + procedure MessageReceived(an_event : BMessage); override; + procedure FrameResized(new_width : double; new_height : double); + function ButtonAt(index : integer) : BButton; + function TextView : BTextView; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + procedure DispatchMessage(msg : BMessage; handler : BHandler); override; + procedure Quit; + function QuitRequested : boolean; override; + function AlertPosition(width : double; height : double) : BPoint; + end; + +function BAlert_Create(AObject : TBeObject; title : PChar; text : PChar; button1 : PChar; button2 : PChar; button3 : PChar; width : Button_Width;kind{type} : Alert_Type) : TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create'; +function BAlert_Create_1(AObject : TBeObject; title : PChar; text : PChar;button1 : PChar; button2 : PChar; button3 : PChar; width : Button_Width; spacing : Button_Spacing; kind{type} : Alert_Type) : TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create_1'; +function BAlert_Create_2(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create_2'; + +procedure BAlert_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_Free'; + +function BAlert_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BAlert_Instantiate'; +function BAlert_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BAlert_Archive'; +procedure BAlert_SetShortcut(AObject : TCPlusObject; button_index : integer; key : Char); cdecl; external BePascalLibName name 'BAlert_SetShortcut'; +function BAlert_Shortcut(AObject : TCPlusObject; button_index : integer) : Char; cdecl; external BePascalLibName name 'BAlert_Shortcut'; +function BAlert_Go(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BAlert_Go'; +function BAlert_Go(AObject : TCPlusObject; invoker : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BAlert_Go'; +procedure BAlert_MessageReceived(AObject : TCPlusObject; an_event : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_MessageReceived'; +procedure BAlert_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BAlert_FrameResized'; +function BAlert_ButtonAt(AObject : TCPlusObject; index : integer) : BButton; cdecl; external BePascalLibName name 'BAlert_ButtonAt'; +function BAlert_TextView(AObject : TCPlusObject) : BTextView; cdecl; external BePascalLibName name 'BAlert_TextView'; +function BAlert_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BAlert_ResolveSpecifier'; +function BAlert_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BAlert_GetSupportedSuites'; +procedure BAlert_DispatchMessage(AObject : TCPlusObject; msg : TCPlusObject; handler : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_DispatchMessage'; +procedure BAlert_Quit(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_Quit'; +function BAlert_QuitRequested(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BAlert_QuitRequested'; +function BAlert_AlertPosition(AObject : TCPlusObject; width : double; height : double) : BPoint; cdecl; external BePascalLibName name 'BAlert_AlertPosition'; + +implementation + +constructor BAlert.Create(title : PChar; text : PChar; button1 : PChar; + button2 : PChar; button3 : PChar; width : Button_Width; + kind{type} : Alert_Type); +begin + CPlusObject := BAlert_Create(Self, title, text, button1, button2, button3, + width, kind); +end; + +constructor BAlert.Create(title : PChar; text : PChar; button1 : PChar; button2 : PChar; button3 : PChar; width : Button_Width; spacing : Button_Spacing; kind{type} : Alert_Type); +begin + CPlusObject := BAlert_Create_1(Self, title, text, button1, button2, button3, + width, spacing, kind{type}); +end; + +constructor BAlert.Create(data : BMessage); +begin + CPlusObject := BAlert_Create_2(Self, data.CPlusObject); +end; + +destructor BAlert.Destroy; +begin + BAlert_Free(CPlusObject); +end; + +function BAlert.Instantiate(data : BMessage) : BArchivable; +begin + Result := BAlert_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BAlert.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BAlert_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BAlert.SetShortcut(button_index : integer; key : Char); +begin + BAlert_SetShortcut(CPlusObject, button_index, key); +end; + +function BAlert.Shortcut(button_index : integer) : Char; +begin + Result := BAlert_Shortcut(CPlusObject, button_index); +end; + +function BAlert.Go : integer; +begin + Result := BAlert_Go(CPlusObject); +end; + +function BAlert.Go(invoker : BInvoker) : Status_t; +begin + Result := BAlert_Go(CPlusObject, invoker.CPlusObject); +end; + +procedure BAlert.MessageReceived(an_event : BMessage); +begin + BAlert_MessageReceived(CPlusObject, an_event.CPlusObject); +end; + +procedure BAlert.FrameResized(new_width : double; new_height : double); +begin + BAlert_FrameResized(CPlusObject, new_width, new_height); +end; + +function BAlert.ButtonAt(index : integer) : BButton; +begin + Result := BAlert_ButtonAt(CPlusObject, index); +end; + +function BAlert.TextView : BTextView; +begin + Result := BAlert_TextView(CPlusObject); +end; + +function BAlert.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BAlert_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +function BAlert.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BAlert_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +procedure BAlert.DispatchMessage(msg : BMessage; handler : BHandler); +begin + BAlert_DispatchMessage(CPlusObject, msg.CPlusObject, handler.CPlusObject); +end; + +procedure BAlert.Quit; +begin + BAlert_Quit(CPlusObject); +end; + +function BAlert.QuitRequested : boolean; +begin + Result := BAlert_QuitRequested(CPlusObject); +end; + +function BAlert.AlertPosition(width : double; height : double) : BPoint; +begin + Result := BAlert_AlertPosition(CPlusObject, width, height); +end; + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/box.pp b/bepascal/source/bepascal/pas/src/be/interface/box.pp new file mode 100644 index 0000000..ea623ca --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/box.pp @@ -0,0 +1,262 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2003 Olivier Coursiere + Eric Jourde + Oscar Lesta + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit box; + +interface + +uses + BeObj, Archivable, Control, Handler, Message, Rect, SupportDefs, + InterfaceDefs, View; + +type + + BBox = class(BView) + private + public + constructor Create(Frame : BRect; Name : PChar; ResizingMode, Flags : Cardinal; BorderStyle : border_style); + constructor Create(data : BMessage); + destructor Destroy; override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure SetBorder(style : border_style); + function Border : border_style; + procedure SetLabel(aLabel : PChar); + function SetLabel(view_label : BView) : Status_t; + // Conflicting Name: Label is a reserved word in Pascal. + // I will use: GetLabel + function GetLabel : PChar; + + function LabelView : BView; + procedure Draw(bounds : BRect); override; + procedure AttachedToWindow; override; + procedure DetachedFromWindow; override; + procedure AllAttached; override; + procedure AllDetached; override; + procedure FrameResized(new_width : double; new_height : double); override; + procedure MessageReceived(msg : BMessage); override; + procedure MouseDown(pt : BPoint); override; + procedure MouseUp(pt : BPoint); override; + procedure WindowActivated(state : boolean); override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); override; + procedure FrameMoved(new_position : BPoint); override; + function ResolveSpecifier(msg : BMessage; index : integer; + specifier : BMessage; form : integer; + properti : PChar) : BHandler; + procedure ResizeToPreferred; override; + procedure GetPreferredSize(width : double; height : double); + procedure MakeFocus(state : boolean); + function GetSupportedSuites(data : BMessage) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + end; + +function BBox_Create(AObject : TBeObject; Frame : TCPlusObject;Name : PChar; ResizingMode, Flags : Cardinal; BorderStyle : border_style) : TCPlusObject; cdecl; external BePascalLibName name 'BBox_Create'; + +function BBox_Create_1(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BBox_Create_1'; +procedure BBox_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_Free'; +function BBox_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BBox_Instantiate'; +function BBox_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BBox_Archive'; +procedure BBox_SetBorder(AObject : TCPlusObject; style : border_style); cdecl; external BePascalLibName name 'BBox_SetBorder'; +function BBox_Border(AObject : TCPlusObject) : border_style; cdecl; external BePascalLibName name 'BBox_Border'; + +// Conflicting name Label --> aLabel. +procedure BBox_SetLabel(AObject : TCPlusObject; aLabel : PChar); cdecl; external BePascalLibName name 'BBox_SetLabel'; + +function BBox_SetLabel(AObject : TCPlusObject; view_label : BView) : Status_t; cdecl; external BePascalLibName name 'BBox_SetLabel'; +function BBox_Label(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BBox_Label'; + +function BBox_LabelView(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BBox_LabelView_1'; + +procedure BBox_Draw(AObject : TCPlusObject; bounds : BRect); cdecl; external BePascalLibName name 'BBox_Draw'; +procedure BBox_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_AttachedToWindow'; +procedure BBox_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_DetachedFromWindow'; +procedure BBox_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_AllAttached'; +procedure BBox_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_AllDetached'; +procedure BBox_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BBox_FrameResized'; +procedure BBox_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BBox_MessageReceived'; +procedure BBox_MouseDown(AObject : TCPlusObject; pt : BPoint); cdecl; external BePascalLibName name 'BBox_MouseDown'; +procedure BBox_MouseUp(AObject : TCPlusObject; pt : BPoint); cdecl; external BePascalLibName name 'BBox_MouseUp'; +procedure BBox_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BBox_WindowActivated'; +procedure BBox_MouseMoved(AObject : TCPlusObject; pt : BPoint; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BBox_MouseMoved'; +procedure BBox_FrameMoved(AObject : TCPlusObject; new_position : BPoint); cdecl; external BePascalLibName name 'BBox_FrameMoved'; +function BBox_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BBox_ResolveSpecifier'; +procedure BBox_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_ResizeToPreferred'; +procedure BBox_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BBox_GetPreferredSize'; +procedure BBox_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BBox_MakeFocus'; +function BBox_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BBox_GetSupportedSuites'; +function BBox_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BBox_Perform'; + + +implementation + + +constructor BBox.Create(Frame : BRect; Name : PChar; ResizingMode, Flags : Cardinal; BorderStyle : border_style); +begin + CreatePas; + CPlusObject := BBox_Create(Self, Frame.CPlusObject, Name, ResizingMode, Flags, BorderStyle); +end; + +constructor BBox.Create(data : BMessage); +begin + CreatePas; + CPlusObject := BBox_Create_1(Self, data.CPlusObject); +end; + +destructor BBox.Destroy; +begin + BBox_Free(CPlusObject); + inherited; +end; + +function BBox.Instantiate(data : BMessage) : BArchivable; +begin + Result := BBox_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BBox.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BBox_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BBox.SetBorder(style : border_style); +begin + BBox_SetBorder(CPlusObject, style); +end; + +function BBox.Border : border_style; +begin + Result := BBox_Border(CPlusObject); +end; + +procedure BBox.SetLabel(aLabel : PChar); +begin + BBox_SetLabel(CPlusObject, aLabel); +end; + +function BBox.SetLabel(view_label : BView) : Status_t; +begin + Result := BBox_SetLabel(CPlusObject, view_label{.CPlusObject}); +end; + +// Conflicting Name: Label is a reserved word in Pascal. +// I will use: GetLabel +function BBox.GetLabel : PChar; +begin + Result := BBox_Label(CPlusObject); +end; + + +function BBox.LabelView : BView; +begin + Result := BBox_LabelView(CPlusObject); +end; + + +procedure BBox.Draw(bounds : BRect); +begin + BBox_Draw(CPlusObject, bounds{.CPlusObject}); +end; + +procedure BBox.AttachedToWindow; +begin + BBox_AttachedToWindow(CPlusObject); +end; + +procedure BBox.DetachedFromWindow; +begin + BBox_DetachedFromWindow(CPlusObject); +end; + +procedure BBox.AllAttached; +begin + BBox_AllAttached(CPlusObject); +end; + +procedure BBox.AllDetached; +begin + BBox_AllDetached(CPlusObject); +end; + +procedure BBox.FrameResized(new_width : double; new_height : double); +begin + BBox_FrameResized(CPlusObject, new_width, new_height); +end; + +procedure BBox.MessageReceived(msg : BMessage); +begin + BBox_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BBox.MouseDown(pt : BPoint); +begin + BBox_MouseDown(CPlusObject, pt{.CPlusObject}); +end; + +procedure BBox.MouseUp(pt : BPoint); +begin + BBox_MouseUp(CPlusObject, pt{.CPlusObject}); +end; + +procedure BBox.WindowActivated(state : boolean); +begin + BBox_WindowActivated(CPlusObject, state); +end; + +procedure BBox.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin + BBox_MouseMoved(CPlusObject, pt{.CPlusObject}, code, msg); +end; + +procedure BBox.FrameMoved(new_position : BPoint); +begin + BBox_FrameMoved(CPlusObject, new_position{.CPlusObject}); +end; + +function BBox.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BBox_ResolveSpecifier(CPlusObject, msg{.CPlusObject}, index, specifier{.CPlusObject}, form, properti); +end; + +procedure BBox.ResizeToPreferred; +begin + BBox_ResizeToPreferred(CPlusObject); +end; + +procedure BBox.GetPreferredSize(width : double; height : double); +begin + BBox_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BBox.MakeFocus(state : boolean); +begin + BBox_MakeFocus(CPlusObject, state); +end; + +function BBox.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BBox_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BBox.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BBox_Perform(CPlusObject, d, arg); +end; + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/button.pp b/bepascal/source/bepascal/pas/src/be/interface/button.pp new file mode 100644 index 0000000..a951ec8 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/button.pp @@ -0,0 +1,265 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit button; + +interface + +uses + beobj, Control, Message, Archivable, SupportDefs, Rect, Handler; + +type + BButton = class(BControl) + private + public + destructor Destroy; override; + constructor Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal); virtual; + constructor Create(data : BMessage); override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure Draw(updateRect : BRect); override; + procedure MouseDown(where : BPoint); override; + procedure AttachedToWindow; override; + procedure KeyDown(bytes : PChar; numBytes : integer); override; + // Hook functions + procedure MakeDefault(state : boolean); virtual; + procedure SetLabel(text : PChar); + function IsDefault : boolean; + procedure MessageReceived(msg : BMessage); override; + procedure WindowActivated(state : boolean); override; + procedure MouseUp(pt : BPoint); override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); override; + procedure DetachedFromWindow; override; + procedure SetValue(aValue : integer); + procedure GetPreferredSize(width : double; height : double); + procedure ResizeToPreferred; override; + function Invoke(msg : BMessage) : Status_t; + procedure FrameMoved(new_position : BPoint); override; + procedure FrameResized(new_width : double; new_height : double); override; + procedure MakeFocus(state : boolean); override; + procedure AllAttached; override; + procedure AllDetached; override; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; +// procedure _ReservedButton1; +// procedure _ReservedButton2; +// procedure _ReservedButton3; +// function operator=( : BButton) : BButton; +// function DrawDefault(bounds : BRect; enabled : boolean) : BRect; +// function Execute : Status_t; +// procedure float fCachedWidth; +// procedure bool fDrawAsDefault; +// procedure uint32 _reserved[3]; +// procedure MakeDefault(flag : boolean); virtual; + end; + +procedure BButton_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_Free'; +function BButton_Create(AObject : TBeObject; frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BButton_Create'; +function BButton_Create(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BButton_Create'; +function BButton_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BButton_Instantiate'; +function BButton_Archive(AObject : TCPlusObject; data : TCplusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BButton_Archive'; +procedure BButton_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BButton_Draw'; +procedure BButton_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BButton_MouseDown'; +procedure BButton_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_AttachedToWindow'; +procedure BButton_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BButton_KeyDown'; +procedure BButton_MakeDefault(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BButton_MakeDefault'; +procedure BButton_SetLabel(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BButton_SetLabel'; +function BButton_IsDefault(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BButton_IsDefault'; +procedure BButton_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BButton_MessageReceived'; +procedure BButton_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BButton_WindowActivated'; +procedure BButton_MouseUp(AObject : TCPlusObject; pt : TCplusObject); cdecl; external BePascalLibName name 'BButton_MouseUp'; +procedure BButton_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : BMessage); cdecl; external BePascalLibName name 'BButton_MouseMoved'; +procedure BButton_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_DetachedFromWindow'; +procedure BButton_SetValue(AObject : TCPlusObject; aValue : integer); cdecl; external BePascalLibName name 'BButton_SetValue'; +procedure BButton_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BButton_GetPreferredSize'; +procedure BButton_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_ResizeToPreferred'; +function BButton_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BButton_Invoke'; +procedure BButton_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BButton_FrameMoved'; +procedure BButton_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BButton_FrameResized'; +procedure BButton_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BButton_MakeFocus'; +procedure BButton_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_AllAttached'; +procedure BButton_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_AllDetached'; +function BButton_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BButton_ResolveSpecifier'; +function BButton_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BButton_GetSupportedSuites'; +function BButton_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BButton_Perform'; + +implementation + +var + Button_MakeDefault_hook : Pointer; cvar; external; + +destructor BButton.Destroy; +begin + BButton_Free(CPlusObject); + inherited; +end; + +constructor BButton.Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal); +begin + CreatePas; + CPlusObject := BButton_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags); +end; + +constructor BButton.Create(data : BMessage); +begin + CreatePas; + CPlusObject := BButton_Create(Self, data.CPlusObject); +end; + +function BButton.Instantiate(data : BMessage) : BArchivable; +begin + Result := BButton_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BButton.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BButton_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BButton.Draw(updateRect : BRect); +begin + +end; + +procedure BButton.MouseDown(where : BPoint); +begin + +end; + +procedure BButton.AttachedToWindow; +begin + +end; + +procedure BButton.KeyDown(bytes : PChar; numBytes : integer); +begin + +end; + +procedure BButton.MakeDefault(state : boolean); +begin + +end; + +procedure BButton.SetLabel(text : PChar); +begin + BButton_SetLabel(CPlusObject, text); +end; + +function BButton.IsDefault : boolean; +begin + Result := BButton_IsDefault(CPlusObject); +end; + +procedure BButton.MessageReceived(msg : BMessage); +begin +// BButton_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BButton.WindowActivated(state : boolean); +begin +// BButton_WindowActivated(CPlusObject, state); +end; + +procedure BButton.MouseUp(pt : BPoint); +begin +// BButton_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BButton.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin +// BButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BButton.DetachedFromWindow; +begin +// BButton_DetachedFromWindow(CPlusObject); +end; + +procedure BButton.SetValue(aValue : integer); +begin +// BButton_SetValue(CPlusObject, aValue); +end; + +procedure BButton.GetPreferredSize(width : double; height : double); +begin +// BButton_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BButton.ResizeToPreferred; +begin +// BButton_ResizeToPreferred(CPlusObject); +end; + +function BButton.Invoke(msg : BMessage) : Status_t; +begin + Result := BButton_Invoke(CPlusObject, msg.CPlusObject); +end; + +procedure BButton.FrameMoved(new_position : BPoint); +begin +// BButton_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BButton.FrameResized(new_width : double; new_height : double); +begin +// BButton_FrameResized(CPlusObject, new_width, new_height); +end; + +procedure BButton.MakeFocus(state : boolean); +begin + BButton_MakeFocus(CPlusObject, state); +end; + +procedure BButton.AllAttached; +begin +// BButton_AllAttached(CPlusObject); +end; + +procedure BButton.AllDetached; +begin +// BButton_AllDetached(CPlusObject); +end; + +function BButton.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BButton_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +function BButton.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BButton_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BButton.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BButton_Perform(CPlusObject, d, arg); +end; + + +procedure Button_MakeDefault_hook_func(Button : BButton; flag : boolean); cdecl; +begin + if Button <> nil then + Button.MakeDefault(flag); +end; + +initialization + Button_MakeDefault_hook := @Button_MakeDefault_hook_func; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/checkbox.pp b/bepascal/source/bepascal/pas/src/be/interface/checkbox.pp new file mode 100644 index 0000000..67cf109 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/checkbox.pp @@ -0,0 +1,250 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit checkbox; + +interface + +uses + beobj, Control, Message, Archivable, SupportDefs, Rect, Handler; + +type BCheckBox = class(BControl) + private + public + destructor Destroy;override; + constructor Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal); virtual; + constructor Create(data : BMessage) ;override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure Draw(updateRect : BRect);override; + procedure AttachedToWindow;override; + procedure MouseDown(where : BPoint);override; + procedure MessageReceived(msg : BMessage);override; + procedure WindowActivated(state : boolean);override; + procedure KeyDown(bytes : PChar; numBytes : integer);override; + procedure MouseUp(pt : BPoint);override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override; + procedure DetachedFromWindow;override; + procedure SetValue(avalue : integer); + procedure GetPreferredSize(width : double; height : double); + procedure ResizeToPreferred;override; + function Invoke(msg : BMessage) : Status_t; + procedure FrameMoved(new_position : BPoint);override; + procedure FrameResized(new_width : double; new_height : double);override; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + procedure MakeFocus(state : boolean);override; + procedure AllAttached;override; + procedure AllDetached;override; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + end; + +procedure BCheckBox_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_FREE'; +function BCheckBox_Create(AObject : TBeObject; frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BCheckBox_Create'; +function BCheckBox_Create_1(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BCheckBox_Create_1'; +function BCheckBox_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BCheckBox_Instantiate'; +function BCheckBox_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BCheckBox_Archive'; +procedure BCheckBox_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_Draw'; +procedure BCheckBox_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_AttachedToWindow'; +procedure BCheckBox_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_MouseDown'; +procedure BCheckBox_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_MessageReceived'; +procedure BCheckBox_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BCheckBox_WindowActivated'; +procedure BCheckBox_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BCheckBox_KeyDown'; +procedure BCheckBox_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_MouseUp'; +procedure BCheckBox_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : BMessage); cdecl; external BePascalLibName name 'BCheckBox_MouseMoved'; +procedure BCheckBox_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_DetachedFromWindow'; +procedure BCheckBox_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BCheckBox_SetValue'; +procedure BCheckBox_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BCheckBox_GetPreferredSize'; +procedure BCheckBox_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_ResizeToPreferred'; +function BCheckBox_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BCheckBox_Invoke'; +procedure BCheckBox_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_FrameMoved'; +procedure BCheckBox_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BCheckBox_FrameResized'; +function BCheckBox_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BCheckBox_ResolveSpecifier'; +function BCheckBox_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BCheckBox_GetSupportedSuites'; +procedure BCheckBox_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BCheckBox_MakeFocus'; +procedure BCheckBox_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_AllAttached'; +procedure BCheckBox_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_AllDetached'; +function BCheckBox_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BCheckBox_Perform'; + +implementation + +destructor BCheckBox.Destroy; +begin + BCheckBox_Free(CPlusObject); + inherited; +end; + +constructor BCheckBox.Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal); +begin + CreatePas; + CPlusObject := BCheckBox_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags); +end; + +constructor BCheckBox.Create(data : BMessage) ; +begin + CreatePas; + CPlusObject := BCheckBox_Create_1(Self, data.CPlusObject); +end; + +function BCheckBox.Instantiate(data : BMessage) : BArchivable; +begin + Result := BCheckBox_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BCheckBox.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BCheckBox_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BCheckBox.Draw(updateRect : BRect); +begin + //BCheckBox_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure BCheckBox.AttachedToWindow; +begin + //BCheckBox_AttachedToWindow(CPlusObject); +end; + +procedure BCheckBox.MouseDown(where : BPoint); +begin + //BCheckBox_MouseDown(CPlusObject, where.CPlusObject); +end; + +procedure BCheckBox.MessageReceived(msg : BMessage); +begin + //BCheckBox_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BCheckBox.WindowActivated(state : boolean); +begin + // BCheckBox_WindowActivated(CPlusObject, state); +end; + +procedure BCheckBox.KeyDown(bytes : PChar; numBytes : integer); +begin + //BCheckBox_KeyDown(CPlusObject, bytes, numBytes); +end; + +procedure BCheckBox.MouseUp(pt : BPoint); +begin + //BCheckBox_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BCheckBox.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin + //BCheckBox_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BCheckBox.DetachedFromWindow; +begin + //BCheckBox_DetachedFromWindow(CPlusObject); +end; + +procedure BCheckBox.SetValue(avalue : integer); +begin + BCheckBox_SetValue(CPlusObject, avalue); +end; + +procedure BCheckBox.GetPreferredSize(width : double; height : double); +begin + BCheckBox_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BCheckBox.ResizeToPreferred; +begin + BCheckBox_ResizeToPreferred(CPlusObject); +end; + +function BCheckBox.Invoke(msg : BMessage) : Status_t; +begin + Result := BCheckBox_Invoke(CPlusObject, msg.CPlusObject); +end; + +procedure BCheckBox.FrameMoved(new_position : BPoint); +begin + BCheckBox_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BCheckBox.FrameResized(new_width : double; new_height : double); +begin + BCheckBox_FrameResized(CPlusObject, new_width, new_height); +end; + +function BCheckBox.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BCheckBox_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +function BCheckBox.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BCheckBox_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +procedure BCheckBox.MakeFocus(state : boolean); +begin + BCheckBox_MakeFocus(CPlusObject, state); +end; + +procedure BCheckBox.AllAttached; +begin + BCheckBox_AllAttached(CPlusObject); +end; + +procedure BCheckBox.AllDetached; +begin + BCheckBox_AllDetached(CPlusObject); +end; + +function BCheckBox.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BCheckBox_Perform(CPlusObject, d, arg); +end; + +{procedure ._ReservedCheckBox1; +begin + BCheckBox__ReservedCheckBox1(CPlusObject); +end; + +procedure ._ReservedCheckBox2; +begin + BCheckBox__ReservedCheckBox2(CPlusObject); +end; + +procedure ._ReservedCheckBox3; +begin + BCheckBox__ReservedCheckBox3(CPlusObject); +end; + +function .operator=( : ) : ; +begin + Result := BCheckBox_operator=(CPlusObject, ); +end; + +procedure .bool fOutlined; +begin + BCheckBox_bool fOutlined(CPlusObject); +end; + +procedure .uint32 _reserved[2]; +begin + BCheckBox_uint32 _reserved[2](CPlusObject); +end; + +} +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/control.pp b/bepascal/source/bepascal/pas/src/be/interface/control.pp new file mode 100644 index 0000000..641d5f4 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/control.pp @@ -0,0 +1,333 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit control; + +interface + +uses + beobj, View, Message, Archivable, Rect, Handler, SupportDefs, Invoker; + +type + BControl = class(BView) + private + protected + FInvoker : BInvoker; + function GeBInvoker : BInvoker; + public + constructor Create(frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal); virtual; + destructor Destroy; override; + constructor Create(data : BMessage); virtual; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure WindowActivated(state : boolean); override; + procedure AttachedToWindow; override; + procedure MessageReceived(msg : BMessage); override; + procedure MakeFocus(state : boolean); virtual; + procedure KeyDown(bytes : PChar; numBytes : integer); override; + procedure MouseDown(pt : BPoint); override; + procedure MouseUp(pt : BPoint); override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); override; + procedure DetachedFromWindow; override; + procedure SetLabel(text : PChar); + function Labl : PChar; + procedure SetValue(aValue : integer); + function Value : integer; + procedure SetEnabled(aOn : boolean); + function IsEnabled : boolean; + procedure GetPreferredSize(width : double; height : double); + procedure ResizeToPreferred; override; + function Invoke(msg : BMessage) : Status_t; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti{;-)} : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + procedure AllAttached; override; + procedure AllDetached; override; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + property Invoker : BInvoker read GeBInvoker; + end; + +//function BControl_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BControl_Create'; +function BControl_Create(AObject : TBeObject; frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BControl_Create'; +procedure BControl_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_Free'; +function BControl_Create(AObject : TBeObject; data : TCplusObject) : TCplusObject; cdecl; external BePascalLibName name 'BControl_Create'; +function BControl_Instantiate(AObject : TCPlusObject; data : TCplusObject) : BArchivable; cdecl; external BePascalLibName name 'BControl_Instantiate'; +function BControl_Archive(AObject : TCPlusObject; data : TCplusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BControl_Archive'; +procedure BControl_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BControl_WindowActivated'; +procedure BControl_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_AttachedToWindow'; +procedure BControl_MessageReceived(AObject : TCPlusObject; msg : TCplusObject); cdecl; external BePascalLibName name 'BControl_MessageReceived'; +procedure BControl_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BControl_MakeFocus'; +procedure BControl_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BControl_KeyDown'; +procedure BControl_MouseDown(AObject : TCPlusObject; pt : TCplusObject); cdecl; external BePascalLibName name 'BControl_MouseDown'; +procedure BControl_MouseUp(AObject : TCPlusObject; pt : TCplusObject); cdecl; external BePascalLibName name 'BControl_MouseUp'; +procedure BControl_MouseMoved(AObject : TCPlusObject; pt : TCplusObject; code : Cardinal; msg : TCplusObject); cdecl; external BePascalLibName name 'BControl_MouseMoved'; +procedure BControl_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_DetachedFromWindow'; +procedure BControl_SetLabel(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BControl_SetLabel'; +function BControl_Labl(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BControl_Label'; +procedure BControl_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BControl_SetValue'; +function BControl_Value(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BControl_Value'; +procedure BControl_SetEnabled(AObject : TCPlusObject; aOn : boolean); cdecl; external BePascalLibName name 'BControl_SetEnabled'; +function BControl_IsEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BControl_IsEnabled'; +procedure BControl_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BControl_GetPreferredSize'; +procedure BControl_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_ResizeToPreferred'; +function BControl_Invoke(AObject : TCPlusObject; msg : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BControl_Invoke'; +function BControl_ResolveSpecifier(AObject : TCPlusObject; msg : TCplusObject; index : integer; specifier : TCplusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BControl_ResolveSpecifier'; +function BControl_GetSupportedSuites(AObject : TCPlusObject; data : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BControl_GetSupportedSuites'; +procedure BControl_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_AllAttached'; +procedure BControl_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_AllDetached'; +function BControl_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BControl_Perform'; +procedure BControl_InitData(AObject : TCPlusObject; data : TCplusObject); cdecl; external BePascalLibName name 'BControl_InitData'; + +implementation + +constructor BControl.Create(frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal); +begin + CPlusObject := BControl_Create(Self, frame, name, aLabel, message, resizingMode, flags); +end; + +destructor BControl.Destroy; +begin + if FInvoker <> nil then + FInvoker.UnWrap; + BControl_Free(CPlusObject); +end; + +constructor BControl.Create(data : BMessage); +begin + CPlusObject := BControl_Create(Self, data.CPlusObject); +end; + +function BControl.Instantiate(data : BMessage) : BArchivable; +begin + Result := BControl_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BControl.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BControl_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BControl.WindowActivated(state : boolean); +begin +// BControl_WindowActivated(CPlusObject, state); +end; + +procedure BControl.AttachedToWindow; +begin +// BControl_AttachedToWindow(CPlusObject); +end; + +procedure BControl.MessageReceived(msg : BMessage); +begin +// BControl_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BControl.MakeFocus(state : boolean); +begin +// BControl_MakeFocus(CPlusObject, state); +end; + +procedure BControl.KeyDown(bytes : PChar; numBytes : integer); +begin +// BControl_KeyDown(CPlusObject, bytes, numBytes); +end; + +procedure BControl.MouseDown(pt : BPoint); +begin +// BControl_MouseDown(CPlusObject, pt.CPlusObject); +end; + +procedure BControl.MouseUp(pt : BPoint); +begin +// BControl_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BControl.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin +// BControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BControl.DetachedFromWindow; +begin +// BControl_DetachedFromWindow(CPlusObject); +end; + +procedure BControl.SetLabel(text : PChar); +begin + BControl_SetLabel(CPlusObject, text); +end; + +function BControl.Labl : PChar; +begin + Result := BControl_Labl(CPlusObject); +end; + +procedure BControl.SetValue(aValue : integer); +begin + BControl_SetValue(CPlusObject, aValue); +end; + +function BControl.Value : integer; +begin + Result := BControl_Value(CPlusObject); +end; + +procedure BControl.SetEnabled(aOn : boolean); +begin + BControl_SetEnabled(CPlusObject, aOn); +end; + +function BControl.IsEnabled : boolean; +begin + Result := BControl_IsEnabled(CPlusObject); +end; + +procedure BControl.GetPreferredSize(width : double; height : double); +begin +// BControl_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BControl.ResizeToPreferred; +begin +// BControl_ResizeToPreferred(CPlusObject); +end; + +function BControl.Invoke(msg : BMessage) : Status_t; +begin + Result := BControl_Invoke(CPlusObject, msg.CPlusObject); +end; + +function BControl.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BControl_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +function BControl.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BControl_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +procedure BControl.AllAttached; +begin +// BControl_AllAttached(CPlusObject); +end; + +procedure BControl.AllDetached; +begin +// BControl_AllDetached(CPlusObject); +end; + +function BControl.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := bControl_Perform(CPlusObject, d, arg); +end; + +//function BControl.IsFocusChanging : boolean; +//begin +// Result := BControl_IsFocusChanging(CPlusObject); +//end; +// +//function BControl.IsTracking : boolean; +//begin +// Result := BControl_IsTracking(CPlusObject); +//end; +// +//procedure BControl.SetTracking(state : boolean); +//begin +// BControl_SetTracking(CPlusObject, state); +//end; +// +//procedure BControl.SetValueNoUpdate(aValue : integer); +//begin +// BControl_SetValueNoUpdate(CPlusObject, aValue); +//end; + +//procedure BControl._ReservedControl1; +//begin +// BControl__ReservedControl1(CPlusObject); +//end; +// +//procedure BControl._ReservedControl2; +//begin +// BControl__ReservedControl2(CPlusObject); +//end; +// +//procedure BControl._ReservedControl3; +//begin +// BControl__ReservedControl3(CPlusObject); +//end; +// +//procedure BControl._ReservedControl4; +//begin +// BControl__ReservedControl4(CPlusObject); +//end; + +//function BControl.operator=( : BControl) : BControl; +//begin +// Result := BControl_operator=(CPlusObject, ); +//end; + +//procedure BControl.InitData(data : BMessage); +//begin +// BControl_InitData(CPlusObject, data.CPlusObject); +//end; + +//procedure BControl.char *fLabel; +//begin +// BControl_char *fLabel(CPlusObject); +//end; +// +//procedure BControl.int32 fValue; +//begin +// BControl_int32 fValue(CPlusObject); +//end; +// +//procedure BControl.bool fEnabled; +//begin +// BControl_bool fEnabled(CPlusObject); +//end; +// +//procedure BControl.bool fFocusChanging; +//begin +// BControl_bool fFocusChanging(CPlusObject); +//end; +// +//procedure BControl.bool fTracking; +//begin +// BControl_bool fTracking(CPlusObject); +//end; +// +//procedure BControl.bool fWantsNav; +//begin +// BControl_bool fWantsNav(CPlusObject); +//end; +// +//procedure BControl.uint32 _reserved[4]; +//begin +// BControl_uint32 _reserved[4](CPlusObject); +//end; + +function BControl.GeBInvoker : BInvoker; +begin + if FInvoker = nil then + begin + Result := BInvoker.Wrap(CPlusObject); + end; + Result := FInvoker; +end; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/font.pp b/bepascal/source/bepascal/pas/src/be/interface/font.pp new file mode 100644 index 0000000..5df64bd --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/font.pp @@ -0,0 +1,493 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit font; + +interface + +uses + beobj,flattenable,interfacedefs,supportdefs,rect,bstring; + +type + font_which= ( + font_which_nil, + B_PLAIN_FONT, + B_BOLD_FONT, + B_FIXED_FONT, + B_SYMBOL_FONT, + B_SERIF_FONT +); + +const + B__NUM_FONT = 5; + // Attention this is hexadecimal; need conversion !!!! + B_ITALIC_FACE = $0001; + B_UNDERSCORE_FACE = $0002; + B_NEGATIVE_FACE = $0004; + B_OUTLINED_FACE = $0008; + B_STRIKEOUT_FACE = $0010; + B_BOLD_FACE = $0020; + B_REGULAR_FACE = $0040; + +type + +font_metric_mode = ( + B_SCREEN_METRIC, + B_PRINTING_METRIC); + + font_file_format =( + B_TRUETYPE_WINDOWS , + B_POSTSCRIPT_TYPE1_WINDOWS); + + +const B_FONT_FAMILY_LENGTH= 63; + +type FONT_FAMILY = array[0..B_FONT_FAMILY_LENGTH] of char; + +const B_FONT_STYLE_LENGTH= 63; + +type font_style = array[0..B_FONT_STYLE_LENGTH ] of char; + +type +escapement_delta = record + nonspace : real; + space: real; +end; +edge_info = record + left: real; + right: real; +end; +tuned_font_info = record + size : real; + shear: real ; + rotation : real; + flags: cardinal; + face : integer; +end; + + + +font_height = record + ascent: real; + descent: real; + leading: real; +end; + +font_direction =( + B_FONT_LEFT_TO_RIGHT , + B_FONT_RIGHT_TO_LEFT +); + + + +type + BFont = class(TBeObject) + private + public + constructor Create; + constructor Create(font : BFont);virtual; + destructor Destroy;override; + function SetFamilyAndStyle(family : Font_FAMILY; style : Font_style) : Status_t; + procedure SetFamilyAndStyle(code : Cardinal); + function SetFamilyAndFace(family : Font_FAMILY; aface : integer) : Status_t; + procedure SetSize(asize : single); + procedure SetShear(ashear : single); + procedure SetRotation(arotation : single); + procedure SetSpacing(aspacing : integer); + procedure SetEncoding(aencoding : integer); + procedure SetFace(aface :integer ); + procedure SetFlags(aflags : Cardinal); + procedure GetFamilyAndStyle(family : Font_FAMILY; style : Font_style); + function FamilyAndStyle : Cardinal; + function Size : single; + function Shear : single; + function Rotation : single; + function Spacing : integer; + function Encoding : integer; + function Face : integer; + function Flags : Cardinal; + function Direction : Font_direction; + function IsFixed : boolean; + function IsFullAndHalfFixed : boolean; + function BoundingBox : BRect; +// function Blocks : ; + function FileFormat : Font_file_format; + function CountTuned : integer; + procedure GetTunedInfo(index : integer; info : tuned_font_info); + procedure TruncateString(in_out : TString; mode : Cardinal; width : single); +// procedure GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : Pchar); +// procedure GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); + function StringWidth(astring : PChar) : single; + function StringWidth(astring : PChar; length : integer) : single; +// procedure GetStringWidths(stringArray : PChar; lengthArray : integer; numStrings : integer; widthArray : single); +// procedure GetEscapements(charArray : ; numChars : integer; escapementArray : single); +// procedure GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : single); + // procedure GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint); + // procedure GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint; offsetArray : TPoint); + // procedure GetEdges(charArray : ; numBytes : integer; edgeArray : ); + procedure GetHeight(height : Font_height); + // procedure GetBoundingBoxesAsGlyphs(charArray : ; numChars : integer; mode : ; boundingBoxArray : BRect); + // procedure GetBoundingBoxesAsString(charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : BRect); + // procedure GetBoundingBoxesForStrings(stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : BRect); +// procedure GetGlyphShapes(charArray : ; numChars : integer; glyphShapeArray : ); + // procedure GetHasGlyphs(charArray : ; numChars : integer; hasArray : boolean); + procedure PrintToStream; + end; + +{procedure edge_info_float left(AObject : TCPlusObject); cdecl; external BePascalLibName name 'edge_info_float left'; +procedure edge_info_float right(AObject : TCPlusObject); cdecl; external BePascalLibName name 'edge_info_float right'; +procedure font_height_float ascent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_height_float ascent'; +procedure font_height_float descent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_height_float descent'; +procedure font_height_float leading(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_height_float leading'; +procedure escapement_delta_float nonspace(AObject : TCPlusObject); cdecl; external BePascalLibName name 'escapement_delta_float nonspace'; +procedure escapement_delta_float space(AObject : TCPlusObject); cdecl; external BePascalLibName name 'escapement_delta_float space'; +procedure font_cache_info_int32 sheared_font_penalty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 sheared_font_penalty'; +procedure font_cache_info_int32 rotated_font_penalty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 rotated_font_penalty'; +procedure font_cache_info_float oversize_threshold(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_float oversize_threshold'; +procedure font_cache_info_int32 oversize_penalty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 oversize_penalty'; +procedure font_cache_info_int32 cache_size(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 cache_size'; +procedure font_cache_info_float spacing_size_threshold(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_float spacing_size_threshold'; +procedure tuned_font_info_float size(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_float size'; +procedure tuned_font_info_float shear(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_float shear'; +procedure tuned_font_info_float rotation(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_float rotation'; +procedure tuned_font_info_uint32 flags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_uint32 flags'; +procedure tuned_font_info_uint16 face(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_uint16 face'; +} + +function BFont_Create(AObject : TBeObject): TCPlusObject; cdecl; external BePascalLibName name 'BFont_Create'; +function BFont_Create(AObject : TBeObject; font : BFont): TCPlusObject; cdecl; external BePascalLibName name 'BFont_Create_1'; +procedure BFont_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_Free'; +function BFont_SetFamilyAndStyle(AObject : TCPlusObject; family : Font_family; style : Font_style) : Status_t; cdecl; external BePascalLibName name 'BFont_SetFamilyAndStyle'; +procedure BFont_SetFamilyAndStyle(AObject : TCPlusObject; code : Cardinal); cdecl; external BePascalLibName name 'BFont_SetFamilyAndStyle'; +function BFont_SetFamilyAndFace(AObject : TCPlusObject; family : Font_family; face : integer) : Status_t; cdecl; external BePascalLibName name 'BFont_SetFamilyAndFace'; +procedure BFont_SetSize(AObject : TCPlusObject; size : single); cdecl; external BePascalLibName name 'BFont_SetSize'; +procedure BFont_SetShear(AObject : TCPlusObject; shear : single); cdecl; external BePascalLibName name 'BFont_SetShear'; +procedure BFont_SetRotation(AObject : TCPlusObject; rotation : single); cdecl; external BePascalLibName name 'BFont_SetRotation'; +procedure BFont_SetSpacing(AObject : TCPlusObject; spacing : integer); cdecl; external BePascalLibName name 'BFont_SetSpacing'; +procedure BFont_SetEncoding(AObject : TCPlusObject; encoding : integer); cdecl; external BePascalLibName name 'BFont_SetEncoding'; +procedure BFont_SetFace(AObject : TCPlusObject; face :integer ); cdecl; external BePascalLibName name 'BFont_SetFace'; +procedure BFont_SetFlags(AObject : TCPlusObject; flags : Cardinal); cdecl; external BePascalLibName name 'BFont_SetFlags'; +procedure BFont_GetFamilyAndStyle(AObject : TCPlusObject; family : Font_family; style : Font_style); cdecl; external BePascalLibName name 'BFont_GetFamilyAndStyle'; +function BFont_FamilyAndStyle(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BFont_FamilyAndStyle'; +function BFont_Size(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BFont_Size'; +function BFont_Shear(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BFont_Shear'; +function BFont_Rotation(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BFont_Rotation'; +function BFont_Spacing(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_Spacing'; +function BFont_Encoding(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_Encoding'; +function BFont_Face(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_Face'; +function BFont_Flags(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BFont_Flags'; +function BFont_Direction(AObject : TCPlusObject) : Font_direction; cdecl; external BePascalLibName name 'BFont_Direction'; +function BFont_IsFixed(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BFont_IsFixed'; +function BFont_IsFullAndHalfFixed(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BFont_IsFullAndHalfFixed'; +function BFont_BoundingBox(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BFont_BoundingBox'; +//function BFont_Blocks(AObject : TCPlusObject) : ; cdecl; external BePascalLibName name 'BFont_Blocks'; +function BFont_FileFormat(AObject : TCPlusObject) :Font_file_format ; cdecl; external BePascalLibName name 'BFont_FileFormat'; +function BFont_CountTuned(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_CountTuned'; +procedure BFont_GetTunedInfo(AObject : TCPlusObject; index : integer; info : tuned_font_info); cdecl; external BePascalLibName name 'BFont_GetTunedInfo'; +procedure BFont_TruncateString(AObject : TCPlusObject; in_out : TCPlusObject; mode : Cardinal; width : single); cdecl; external BePascalLibName name 'BFont_TruncateString'; +//procedure BFont_GetTruncatedStrings(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : ); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings'; +//procedure BFont_GetTruncatedStrings(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings'; +function BFont_StringWidth(AObject : TCPlusObject; astring : PChar) : single; cdecl; external BePascalLibName name 'BFont_StringWidth'; +function BFont_StringWidth(AObject : TCPlusObject; astring : PChar; length : integer) : single; cdecl; external BePascalLibName name 'BFont_StringWidth'; +//procedure BFont_GetStringWidths(AObject : TCPlusObject; stringArray : PChar; lengthArray : ; numStrings : integer; widthArray : single); cdecl; external BePascalLibName name 'BFont_GetStringWidths'; +//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; escapementArray : single); cdecl; external BePascalLibName name 'BFont_GetEscapements'; +//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; escapementArray : single); cdecl; external BePascalLibName name 'BFont_GetEscapements'; +//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; escapementArray : TPoint); cdecl; external BePascalLibName name 'BFont_GetEscapements'; +//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; escapementArray : TPoint; offsetArray : TPoint); cdecl; external BePascalLibName name 'BFont_GetEscapements'; +//procedure BFont_GetEdges(AObject : TCPlusObject; charArray : ; numBytes : integer; edgeArray : ); cdecl; external BePascalLibName name 'BFont_GetEdges'; +procedure BFont_GetHeight(AObject : TCPlusObject; height :Font_height ); cdecl; external BePascalLibName name 'BFont_GetHeight'; + +{procedure BFont_GetBoundingBoxesAsGlyphs(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; boundingBoxArray : BRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesAsGlyphs'; +procedure BFont_GetBoundingBoxesAsString(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : BRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesAsString'; +procedure BFont_GetBoundingBoxesForStrings(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : BRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesForStrings'; +procedure BFont_GetGlyphShapes(AObject : TCPlusObject; charArray : ; numChars : integer; glyphShapeArray : ); cdecl; external BePascalLibName name 'BFont_GetGlyphShapes'; +procedure BFont_GetHasGlyphs(AObject : TCPlusObject; charArray : ; numChars : integer; hasArray : boolean); cdecl; external BePascalLibName name 'BFont_GetHasGlyphs'; +function BFont_operator=(AObject : TCPlusObject; font : ) : ; cdecl; external BePascalLibName name 'BFont_operator='; +function BFont_operator==(AObject : TCPlusObject; font : ) : boolean; cdecl; external BePascalLibName name 'BFont_operator=='; +function BFont_operator!=(AObject : TCPlusObject; font : ) : boolean; cdecl; external BePascalLibName name 'BFont_operator!='; +} +procedure BFont_PrintToStream(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_PrintToStream'; +{procedure BFont_uint16 fFamilyID(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint16 fFamilyID'; +procedure BFont_uint16 fStyleID(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint16 fStyleID'; +procedure BFont_float fSize(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_float fSize'; +procedure BFont_float fShear(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_float fShear'; +procedure BFont_float fRotation(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_float fRotation'; +procedure BFont_uint8 fSpacing(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint8 fSpacing'; +procedure BFont_uint8 fEncoding(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint8 fEncoding'; +procedure BFont_uint16 fFace(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint16 fFace'; +procedure BFont_uint32 fFlags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint32 fFlags'; +procedure BFont_font_height fHeight(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_font_height fHeight'; +procedure BFont_int32 fPrivateFlags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_int32 fPrivateFlags'; +procedure BFont_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint32 _reserved[2]'; +procedure BFont_SetPacket(AObject : TCPlusObject; packet : Pointer); cdecl; external BePascalLibName name 'BFont_SetPacket'; +procedure BFont_GetTruncatedStrings64(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings64'; +procedure BFont_GetTruncatedStrings64(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : ); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings64'; +procedure BFont__GetEscapements_(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; mode : ; escapements : single; offsets : single); cdecl; external BePascalLibName name 'BFont__GetEscapements_'; +procedure BFont__GetBoundingBoxes_(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; string_escapement : boolean; delta : ; boundingBoxArray : BRect); cdecl; external BePascalLibName name 'BFont__GetBoundingBoxes_'; +} +implementation + + +constructor BFont.Create; +begin + inherited Create; + CPlusObject := BFont_Create(Self); +end; + +constructor BFont.Create(font : BFont); +begin + inherited Create; + CPlusObject := BFont_Create(Self, font); +end; + +destructor BFont.Destroy; +begin + if CPlusObject <> nil then + BFont_Free(CPlusObject); + inherited; +end; + +function BFont.SetFamilyAndStyle(family : Font_family; style :Font_style ) : Status_t; +begin + Result := BFont_SetFamilyAndStyle(CPlusObject, family, style); +end; + +procedure BFont.SetFamilyAndStyle(code : Cardinal); +begin + BFont_SetFamilyAndStyle(CPlusObject, code); +end; + +function BFont.SetFamilyAndFace(family : Font_family; aface : integer) : Status_t; +begin + Result := BFont_SetFamilyAndFace(CPlusObject, family, aface); +end; + +procedure BFont.SetSize(asize : single); +begin + BFont_SetSize(CPlusObject, asize); +end; + +procedure BFont.SetShear(ashear : single); +begin + BFont_SetShear(CPlusObject, ashear); +end; + +procedure BFont.SetRotation(arotation : single); +begin + BFont_SetRotation(CPlusObject, arotation); +end; + +procedure BFont.SetSpacing(aspacing : integer); +begin + BFont_SetSpacing(CPlusObject, aspacing); +end; + +procedure BFont.SetEncoding(aencoding : integer); +begin + BFont_SetEncoding(CPlusObject, aencoding); +end; + +procedure BFont.SetFace(aface : integer); +begin + BFont_SetFace(CPlusObject, aface); +end; + +procedure BFont.SetFlags(aflags : Cardinal); +begin + BFont_SetFlags(CPlusObject, aflags); +end; + +procedure BFont.GetFamilyAndStyle(family : Font_family; style :Font_style ); +begin + BFont_GetFamilyAndStyle(CPlusObject, family, style); +end; + +function BFont.FamilyAndStyle : Cardinal; +begin + Result := BFont_FamilyAndStyle(CPlusObject); +end; + +function BFont.Size : single; +begin + Result := BFont_Size(CPlusObject); +end; + +function BFont.Shear : single; +begin + Result := BFont_Shear(CPlusObject); +end; + +function BFont.Rotation : single; +begin + Result := BFont_Rotation(CPlusObject); +end; + +function BFont.Spacing : integer; +begin + Result := BFont_Spacing(CPlusObject); +end; + +function BFont.Encoding : integer; +begin + Result := BFont_Encoding(CPlusObject); +end; + +function BFont.Face : integer; +begin + Result := BFont_Face(CPlusObject); +end; + +function BFont.Flags : Cardinal; +begin + Result := BFont_Flags(CPlusObject); +end; + +function BFont.Direction : Font_direction; +begin + Result := BFont_Direction(CPlusObject); +end; + +function BFont.IsFixed : boolean; +begin + Result := BFont_IsFixed(CPlusObject); +end; + +function BFont.IsFullAndHalfFixed : boolean; +begin + Result := BFont_IsFullAndHalfFixed(CPlusObject); +end; + +function BFont.BoundingBox : BRect; +begin + Result := BFont_BoundingBox(CPlusObject); +end; + +{function BFont.Blocks : ; +begin + Result := BFont_Blocks(CPlusObject); +end; +} +function BFont.FileFormat : Font_file_format; +begin + Result := BFont_FileFormat(CPlusObject); +end; + +function BFont.CountTuned : integer; +begin + Result := BFont_CountTuned(CPlusObject); +end; + +procedure BFont.GetTunedInfo(index : integer; info : tuned_font_info); +begin + BFont_GetTunedInfo(CPlusObject, index, info); +end; + +procedure BFont.TruncateString(in_out : TString; mode : Cardinal; width : single); +begin + BFont_TruncateString(CPlusObject, in_out.CPlusObject, mode, width); +end; + +{procedure BFont.GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : ); +begin + BFont_GetTruncatedStrings(CPlusObject, stringArray, numStrings, mode, width, resultArray.CPlusObject); +end; + +procedure BFont.GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); +begin + BFont_GetTruncatedStrings(CPlusObject, stringArray, numStrings, mode, width, resultArray); +end; +} + +function BFont.StringWidth(astring : PChar) : single; +begin + Result := BFont_StringWidth(CPlusObject, astring); +end; + +function BFont.StringWidth(astring : PChar; length : integer) : single; +begin + Result := BFont_StringWidth(CPlusObject, astring, length); +end; + +{procedure BFont.GetStringWidths(stringArray : PChar; lengthArray : integer ; numStrings : integer; widthArray : single); +begin + BFont_GetStringWidths(CPlusObject, stringArray, lengthArray, numStrings, widthArray); +end; + +procedure BFont.GetEscapements(charArray : PChar; numChars : integer; escapementArray : single); +begin + BFont_GetEscapements(CPlusObject, charArray, numChars, escapementArray); +end; + +procedure BFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : single); +begin + BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray); +end; + +procedure BFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint); +begin + BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray.CPlusObject); +end; + +procedure BFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint; offsetArray : TPoint); +begin + BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray.CPlusObject, offsetArray.CPlusObject); +end; + +procedure BFont.GetEdges(charArray : ; numBytes : integer; edgeArray : ); +begin + BFont_GetEdges(CPlusObject, charArray, numBytes, edgeArray); +end; +} +procedure BFont.GetHeight(height :Font_height ); +begin + BFont_GetHeight(CPlusObject, height); +end; + +{ +procedure BFont.GetBoundingBoxesAsGlyphs(charArray : ; numChars : integer; mode : ; boundingBoxArray : BRect); +begin + BFont_GetBoundingBoxesAsGlyphs(CPlusObject, charArray, numChars, mode, boundingBoxArray.CPlusObject); +end; + +procedure BFont.GetBoundingBoxesAsString(charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : BRect); +begin + BFont_GetBoundingBoxesAsString(CPlusObject, charArray, numChars, mode, delta, boundingBoxArray.CPlusObject); +end; + +procedure BFont.GetBoundingBoxesForStrings(stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : BRect); +begin + BFont_GetBoundingBoxesForStrings(CPlusObject, stringArray, numStrings, mode, deltas, boundingBoxArray.CPlusObject); +end; + +procedure BFont.GetGlyphShapes(charArray : ; numChars : integer; glyphShapeArray : ); +begin + BFont_GetGlyphShapes(CPlusObject, charArray, numChars, glyphShapeArray.CPlusObject); +end; + +procedure BFont.GetHasGlyphs(charArray : ; numChars : integer; hasArray : boolean); +begin + BFont_GetHasGlyphs(CPlusObject, charArray, numChars, hasArray); +end; +} +procedure BFont.PrintToStream; +begin + BFont_PrintToStream(CPlusObject); +end; + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/graphicdefs.pp b/bepascal/source/bepascal/pas/src/be/interface/graphicdefs.pp new file mode 100644 index 0000000..3eef06a --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/graphicdefs.pp @@ -0,0 +1,20 @@ +unit graphicdefs; + +interface + +{$PACKRECORDS C} + +type + RGB_color = record + red : byte; + green : byte; + blue : byte; + alpha : byte; + end; + Color_space = Cardinal; + +implementation + +initialization + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/interfacedefs.pp b/bepascal/source/bepascal/pas/src/be/interface/interfacedefs.pp new file mode 100644 index 0000000..4d53a10 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/interfacedefs.pp @@ -0,0 +1,60 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNSS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit interfacedefs; + +interface + +uses graphicdefs,beobj; + +type + Alignment = (B_ALIGN_LEFT, + B_ALIGN_RIGHT, + B_ALIGN_CENTER); + + + color_which =(Tcolor_nil, + B_PANEL_BACKGROUND_COLOR , + B_MENU_BACKGROUND_COLOR , + B_MENU_SELECTION_BACKGROUND_COLOR , + B_MENU_ITEM_TEXT_COLOR , + B_MENU_SELECTED_ITEM_TEXT_COLOR , + B_WINDOW_TAB_COLOR , + B_KEYBOARD_NAVIGATION_COLOR , + B_DESKTOP_COLOR ); + + orientation =( + B_HORIZONTAL, + B_VERTICAL); + + border_style =( + B_PLAIN_BORDER, + B_FANCY_BORDER, + B_NO_BORDER); + + Button_width = ( + B_WIDTH_AS_USUAL, + B_WIDTH_FROM_WIDSET, + B_WIDTH_FROM_LABEL); + +function ui_color(which : color_which) : rgb_color; cdecl; external 'be' name 'ui_color__F11color_which'; +function Ttint_color(color : rgb_color; which :color_which) : rgb_color;cdecl; external 'be' name 'tint_color__FG9rgb_colorf'; + +implementation + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/listitem.pp b/bepascal/source/bepascal/pas/src/be/interface/listitem.pp new file mode 100644 index 0000000..ae53466 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/listitem.pp @@ -0,0 +1,352 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit listitem; + +interface + +uses + beobj, interfacedefs,view,Message, Archivable, SupportDefs, Rect, Handler,font; + +type + BListItem = class(TBeObject) + private + public + constructor Create(aoutlineLevel : longint; expanded : boolean );virtual; + constructor Create(data : BMessage); + destructor Destroy;override; + function Archive(data : BMessage; deep : boolean) : Status_t; + function Height : double; + function Width : double; + function IsSelected : boolean; + procedure Select; + procedure Deselect; + procedure SetEnabled(aon : boolean); + function IsEnabled : boolean; + procedure SetHeight(aheight : double); + procedure SetWidth(awidth : double); + procedure DrawItem(owner : BView; bounds : BRect; complete : boolean); + procedure Update(owner : BView; font : BFont); + // function Perform(d : TPerform_code; var arg : Pointer) : Status_t; + function IsExpanded : boolean; + procedure SetExpanded(expanded : boolean); + function OutlineLevel : Cardinal; + function HasSubitems : boolean; + end; + +type + BStringItem = class(BListItem) + private + public + constructor Create( atext: pchar;aoutlineLevel : longint; expanded : boolean);virtual; + destructor Destroy;override; + constructor Create(data : BMessage); + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure DrawItem(owner : BView; frame : BRect; complete : boolean); + procedure SetText( atext : PChar); + function Text : PChar; + procedure Update(owner : BView; font : BFont); +// function Perform(d : TPerform_code; arg : Pointer) : Status_t; + end; + +function BListItem_Create(AObject : TBeObject;outlineLevel : longint; expanded : boolean): TCPlusObject; cdecl; external BePascalLibName name 'BListItem_Create'; +function BListItem_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BListItem_Create_1'; +procedure BListItem_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListItem_Free'; +function BListItem_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BListItem_Archive'; +function BListItem_Height(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BListItem_Height'; +function BListItem_Width(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BListItem_Width'; +function BListItem_IsSelected(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListItem_IsSelected'; +procedure BListItem_Select(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListItem_Select'; +procedure BListItem_Deselect(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListItem_Deselect'; +procedure BListItem_SetEnabled(AObject : TCPlusObject; aon : boolean); cdecl; external BePascalLibName name 'BListItem_SetEnabled'; +function BListItem_IsEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListItem_IsEnabled'; +procedure BListItem_SetHeight(AObject : TCPlusObject; aheight : double); cdecl; external BePascalLibName name 'BListItem_SetHeight'; +procedure BListItem_SetWidth(AObject : TCPlusObject; awidth : double); cdecl; external BePascalLibName name 'BListItem_SetWidth'; +procedure BListItem_Update(AObject : TCPlusObject; owner : TCPlusObject; font : TCPlusObject); cdecl; external BePascalLibName name 'BListItem_Update'; +function BListItem_Perform(AObject : TCPlusObject; d : TCPlusObject; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BListItem_Perform'; +function BListItem_IsExpanded(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListItem_IsExpanded'; +procedure BListItem_SetExpanded(AObject : TCPlusObject; expanded : boolean); cdecl; external BePascalLibName name 'BListItem_SetExpanded'; +function BListItem_OutlineLevel(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BListItem_OutlineLevel'; + +//function BListItem_HasSubitems(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListItem_HasSubitems'; +procedure BListItem_DrawItem(AObject : TCPlusObject; owner : TCPlusObject; bounds : TCPlusObject; complete : boolean); cdecl; external BePascalLibName name 'BListItem_DrawItem'; + +function BStringItem_Create(AObject : TBeObject ;text: pchar;lineLevel : longint; expanded : boolean): TCPlusObject; cdecl; external BePascalLibName name 'BStringItem_Create'; +procedure BStringItem_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringItem_Free'; +function BStringItem_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BStringItem_Create'; +function BStringItem_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BStringItem_Instantiate'; +function BStringItem_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BStringItem_Archive'; +procedure BStringItem_DrawItem(AObject : TCPlusObject; owner : TCPlusObject; frame : TCPlusObject; complete : boolean); cdecl; external BePascalLibName name 'BStringItem_DrawItem'; +procedure BStringItem_SetText(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BStringItem_SetText'; +function BStringItem_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStringItem_Text'; +procedure BStringItem_Update(AObject : TCPlusObject; owner : TCPlusObject; font : TCPlusObject); cdecl; external BePascalLibName name 'BStringItem_Update'; +function BStringItem_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BStringItem_Perform'; + +implementation + +var + + ListItem_DrawItem_hook : Pointer; cvar; external; + ListString_DrawItem_hook : Pointer; cvar; external; + ListItem_Update_hook : Pointer; cvar; external; + ListString_Update_hook : Pointer; cvar; external; + +constructor BListItem.Create(aoutlineLevel : longint; expanded : boolean ); +begin + CreatePas; + CPlusObject := BListItem_Create(Self,aoutlineLevel , expanded ); +end; + +constructor BListItem.Create(data : BMessage); +begin + CreatePas; + CPlusObject := BListItem_Create(Self, data.CPlusObject); +end; + +destructor BListItem.Destroy; +begin + BListItem_Free(CPlusObject); + inherited; +end; + +function BListItem.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BListItem_Archive(CPlusObject, data.CPlusObject, deep); +end; + +function BListItem.Height : double; +begin + Result := BListItem_Height(CPlusObject); +end; + +function BListItem.Width : double; +begin + Result := BListItem_Width(CPlusObject); +end; + +function BListItem.IsSelected : boolean; +begin + Result := BListItem_IsSelected(CPlusObject); +end; + +procedure BListItem.Select; +begin + BListItem_Select(CPlusObject); +end; + +procedure BListItem.Deselect; +begin + BListItem_Deselect(CPlusObject); +end; + +procedure BListItem.SetEnabled(aon : boolean); +begin + BListItem_SetEnabled(CPlusObject, aon); +end; + +function BListItem.IsEnabled : boolean; +begin + Result := BListItem_IsEnabled(CPlusObject); +end; + +procedure BListItem.SetHeight(aheight : double); +begin + BListItem_SetHeight(CPlusObject, aheight); +end; + +procedure BListItem.SetWidth(awidth : double); +begin + BListItem_SetWidth(CPlusObject, awidth); +end; + +procedure BListItem.DrawItem(owner : BView; bounds : BRect; complete : boolean); +begin + //BListItem_DrawItem(CPlusObject, owner.CPlusObject, bounds.CPlusObject, complete); +end; + +procedure BListItem.Update(owner : BView; font : BFont); +begin + // BListItem_Update(CPlusObject, owner.CPlusObject, font); +end; + +{function BListItem.Perform(d : TPerform_code; var arg : Pointer) : Status_t; +begin + Result := BListItem_Perform(CPlusObject, d, arg); +end; +} +function BListItem.IsExpanded : boolean; +begin + Result := BListItem_IsExpanded(CPlusObject); +end; + +procedure BListItem.SetExpanded(expanded : boolean); +begin + BListItem_SetExpanded(CPlusObject, expanded); +end; + +function BListItem.OutlineLevel : Cardinal; +begin + Result := BListItem_OutlineLevel(CPlusObject); +end; + +function BListItem.HasSubitems : boolean; +begin + // Result := BListItem_HasSubitems(CPlusObject); +end; + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// BStringItem +// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +constructor BStringItem.Create( atext: pchar;aoutlineLevel : longint; expanded : boolean); +begin + CreatePas; + CPlusObject := BStringItem_Create(Self,atext,aoutlineLevel,expanded); +end; + +destructor BStringItem.Destroy; +begin + BStringItem_Free(CPlusObject); + inherited; +end; + +constructor BStringItem.Create(data : BMessage); +begin + CreatePas; + CPlusObject := BStringItem_Create(Self, data.CPlusObject); +end; + +function BStringItem.Instantiate(data : BMessage) : BArchivable; +begin + Result := BStringItem_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BStringItem.Archive(data : BMessage; deep : boolean) : Status_t; +begin + //Result := BStringItem_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BStringItem.DrawItem(owner : BView; frame : BRect; complete : boolean); +begin + //BStringItem_DrawItem(CPlusObject, owner.CPlusObject, frame.CPlusObject, complete); +end; + +procedure BStringItem.SetText( atext : PChar); +begin + BStringItem_SetText(CPlusObject, atext); +end; + +function BStringItem.Text : PChar; +begin + Result := BStringItem_Text(CPlusObject); +end; + +procedure BStringItem.Update(owner : BView; font : BFont); +begin + //BStringItem_Update(CPlusObject, owner.CPlusObject, font); +end; + +{function BStringItem.Perform(d : TPerform_code; arg : Pointer) : Status_t; +begin + Result := BStringItem_Perform(CPlusObject, d, arg); +end; +} + +procedure ListItem_DrawItem_hook_func(Liste : BListItem;owner : TCPlusObject; bounds : TCPlusObject; complete : boolean); cdecl; +var Rect : BRect; + ow : BView; + +begin + Rect:=BRect.Wrap(bounds); + ow:=BView.Wrap(owner); + try + if Liste <> nil then + begin + Liste.DrawItem(ow ,Rect, complete ); + end; + finally + Rect.UnWrap; + ow.UnWrap; + end; +end; + +procedure ListString_DrawItem_hook_func(Liste : BStringItem;owner : TCPlusObject; bounds : TCPlusObject; complete : boolean); cdecl; +var Rect : BRect; + ow : BView; +begin + Rect:=BRect.Wrap(bounds); + ow:=BView.Wrap(owner); + try + if Liste <> nil then + begin + Liste.DrawItem(ow ,Rect, complete ); + end; + finally + Rect.UnWrap; + ow.UnWrap; + end; +end; + +procedure ListItem_Update_hook_func(Liste : BListItem;owner : TCPlusObject; font : TCPlusObject); cdecl; +var afont: BFont; + ow : BView; +begin + afont:=BFont.Wrap(font); + ow:=BView.Wrap(owner); + try + if Liste <> nil then + begin + + Liste.Update(ow ,afont ); + end; + finally + afont.UnWrap; + ow.UnWrap; + end; +end; + +procedure ListString_Update_hook_func(Liste : BStringItem;owner : TCPlusObject; font : TCPlusObject); cdecl; +var afont: BFont; + ow : BView; +begin + afont:=BFont.Wrap(font); + ow:=BView.Wrap(owner); + try + if Liste <> nil then + begin + Liste.Update(ow ,afont ); + end; + finally + afont.UnWrap; + ow.UnWrap; + end; +end; + + +initialization + + ListItem_DrawItem_hook := @ListItem_DrawItem_hook_func; + ListString_DrawItem_hook := @ListString_DrawItem_hook_func; + ListItem_Update_hook := @ListItem_Update_hook_func; + ListString_Update_hook := @ListString_Update_hook_func; + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/listview.pp b/bepascal/source/bepascal/pas/src/be/interface/listview.pp new file mode 100644 index 0000000..6755420 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/listview.pp @@ -0,0 +1,559 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit listview; + +interface + +uses + beobj, view, message, archivable, SupportDefs, rect, list, + handler, messenger,interfacedefs,font,graphicdefs,scrollview,listitem; + +type +list_view_type =( + B_SINGLE_SELECTION_LIST, + B_MULTIPLE_SELECTION_LIST +); + + +type + BListView = class(BView) + private + public + constructor Create(frame : BRect; name : pchar; atype : list_view_type; resizeMask: longint; flags : longint); virtual; + constructor Create(data : BMessage); + destructor Destroy;override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure Draw(updateRect : BRect);override; + procedure MessageReceived(msg : BMessage);override; + procedure MouseDown(where : BPoint);override; + procedure KeyDown(bytes : PChar; numBytes : integer);override; + procedure MakeFocus(state : boolean); + procedure FrameResized(newWidth : double; newHeight : double);override; + procedure TargetedByScrollView(scroller : BScrollView); + procedure ScrollTo(x : double; y : double); + procedure ScrollTo(where : BPoint); + function AddItem(item : BListItem) : boolean; + function AddItem(item : BListItem; atIndex : integer) : boolean; + function AddList(newItems : BList) : boolean; + function AddList(newItems : BList; atIndex : integer) : boolean; + function RemoveItem(item : BListItem) : boolean; + function RemoveItem(index : integer) : BListItem; + function RemoveItems(index : integer; count : integer) : boolean; + procedure SetSelectionMessage(message : BMessage); + procedure SetInvocationMessage(message : BMessage); + function SelectionMessage : BMessage; + function SelectionCommand : Cardinal; + function InvocationMessage : BMessage; + function InvocationCommand : Cardinal; + procedure SetListType(atype : list_view_type); + function ListType : list_view_type; + function ItemAt(index : integer) : BListItem; + function IndexOf(point : BPoint) : integer; + function IndexOf(item : BListItem) : integer; + function FirstItem : BListItem; + function LastItem : BListItem; + function HasItem(item : BListItem) : boolean; + function CountItems : integer; + procedure MakeEmpty; + function IsEmpty : boolean; + function Items : BListView; + procedure InvalidateItem(index : integer); + procedure ScrollToSelection; + procedure Select(index : integer; extend : boolean); + procedure Select(from : integer; ato : integer; extend : boolean); + function IsItemSelected(index : integer) : boolean; + function CurrentSelection(index : integer) : integer; + function Invoke(msg : BMessage) : Status_t; + procedure DeselectAll; + procedure DeselectExcept(except_from : integer; except_to : integer); + procedure Deselect(index : integer); + procedure SelectionChanged; virtual; + function SwapItems(a : integer; b : integer) : boolean; + function MoveItem(from : integer; ato : integer) : boolean; + function ReplaceItem(index : integer; item : BListItem) : boolean; + procedure AttachedToWindow;override; + procedure FrameMoved(new_position : BPoint);override; + function ItemFrame(index : integer) : BRect; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + procedure WindowActivated(state : boolean);override; + procedure MouseUp(pt : BPoint);override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override; + procedure DetachedFromWindow;override; + function InitiateDrag(pt : BPoint; itemIndex : integer; initialySelected : boolean) : boolean; + procedure ResizeToPreferred;override; + procedure GetPreferredSize(width : double; height : double); + procedure AllAttached;override; + procedure AllDetached;override; +// procedure enum MiscCode { B_NO_OP, B_REPLACE_OP, B_MOVE_OP, B_SWAP_OP }; + end; + + +function BListView_Create(AObject : TBeObject;frame : TCPlusObject; name : pchar; atype : list_view_type; resizeMask: longint; flags : longint): TCPlusObject; cdecl; external BePascalLibName name 'BListView_Create'; +function BListView_Create(AObject : TBeObject;data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BListView_Create_1'; +procedure BListView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_Free'; +function BListView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BListView_Instantiate'; +function BListView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BListView_Archive'; +procedure BListView_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BListView_Draw'; +procedure BListView_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BListView_MessageReceived'; +procedure BListView_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BListView_MouseDown'; +procedure BListView_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BListView_KeyDown'; +procedure BListView_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BListView_MakeFocus'; +procedure BListView_FrameResized(AObject : TCPlusObject; newWidth : double; newHeight : double); cdecl; external BePascalLibName name 'BListView_FrameResized'; +procedure BListView_TargetedByScrollView(AObject : TCPlusObject; scroller : TCPlusObject); cdecl; external BePascalLibName name 'BListView_TargetedByScrollView'; +procedure BListView_ScrollTo(AObject : TCPlusObject; x : double; y : double); cdecl; external BePascalLibName name 'BListView_ScrollTo'; +procedure BListView_ScrollTo(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BListView_ScrollTo'; +function BListView_AddItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_AddItem'; +function BListView_AddItem(AObject : TCPlusObject; item : TCPlusObject; atIndex : integer) : boolean; cdecl; external BePascalLibName name 'BListView_AddItem'; +function BListView_AddList(AObject : TCPlusObject; newItems : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_AddList'; +function BListView_AddList(AObject : TCPlusObject; newItems : TCPlusObject; atIndex : integer) : boolean; cdecl; external BePascalLibName name 'BListView_AddList'; +function BListView_RemoveItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_RemoveItem'; +function BListView_RemoveItem(AObject : TCPlusObject; index : integer) : BListItem; cdecl; external BePascalLibName name 'BListView_RemoveItem_1'; +function BListView_RemoveItems(AObject : TCPlusObject; index : integer; count : integer) : boolean; cdecl; external BePascalLibName name 'BListView_RemoveItems_2'; +procedure BListView_SetSelectionMessage(AObject : TCPlusObject; message : TCPlusObject); cdecl; external BePascalLibName name 'BListView_SetSelectionMessage'; +procedure BListView_SetInvocationMessage(AObject : TCPlusObject; message : TCPlusObject); cdecl; external BePascalLibName name 'BListView_SetInvocationMessage'; +function BListView_SelectionMessage(AObject : TCPlusObject) : BMessage; cdecl; external BePascalLibName name 'BListView_SelectionMessage'; +function BListView_SelectionCommand(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BListView_SelectionCommand'; +function BListView_InvocationMessage(AObject : TCPlusObject) : BMessage; cdecl; external BePascalLibName name 'BListView_InvocationMessage'; +function BListView_InvocationCommand(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BListView_InvocationCommand'; +procedure BListView_SetListType(AObject : TCPlusObject; atype : list_view_type); cdecl; external BePascalLibName name 'BListView_SetListType'; +function BListView_ListType(AObject : TCPlusObject) : list_view_type; cdecl; external BePascalLibName name 'BListView_ListType'; +function BListView_ItemAt(AObject : TCPlusObject; index : integer) : BListItem; cdecl; external BePascalLibName name 'BListView_ItemAt'; +function BListView_IndexOf(AObject : TCPlusObject; point : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BListView_IndexOf'; +function BListView_IndexOf_1(AObject : TCPlusObject; item : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BListView_IndexOf'; +function BListView_FirstItem(AObject : TCPlusObject) : BListItem; cdecl; external BePascalLibName name 'BListView_FirstItem'; +function BListView_LastItem(AObject : TCPlusObject) : BListItem; cdecl; external BePascalLibName name 'BListView_LastItem'; +function BListView_HasItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_HasItem'; +function BListView_CountItems(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BListView_CountItems'; +procedure BListView_MakeEmpty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_MakeEmpty'; +function BListView_IsEmpty(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_IsEmpty'; +function BListView_Items(AObject : TCPlusObject) : BListView; cdecl; external BePascalLibName name 'BListView_Items'; +procedure BListView_InvalidateItem(AObject : TCPlusObject; index : integer); cdecl; external BePascalLibName name 'BListView_InvalidateItem'; +procedure BListView_ScrollToSelection(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_ScrollToSelection'; +procedure BListView_Select(AObject : TCPlusObject; index : integer; extend : boolean); cdecl; external BePascalLibName name 'BListView_Select'; +procedure BListView_Select(AObject : TCPlusObject; from : integer; ato : integer; extend : boolean); cdecl; external BePascalLibName name 'BListView_Select'; +function BListView_IsItemSelected(AObject : TCPlusObject; index : integer) : boolean; cdecl; external BePascalLibName name 'BListView_IsItemSelected'; +function BListView_CurrentSelection(AObject : TCPlusObject; index : integer) : integer; cdecl; external BePascalLibName name 'BListView_CurrentSelection'; +function BListView_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BListView_Invoke'; +procedure BListView_DeselectAll(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_DeselectAll'; +procedure BListView_DeselectExcept(AObject : TCPlusObject; except_from : integer; except_to : integer); cdecl; external BePascalLibName name 'BListView_DeselectExcept'; +procedure BListView_Deselect(AObject : TCPlusObject; index : integer); cdecl; external BePascalLibName name 'BListView_Deselect'; +procedure BListView_SelectionChanged(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_SelectionChanged'; +function BListView_SwapItems(AObject : TCPlusObject; a : integer; b : integer) : boolean; cdecl; external BePascalLibName name 'BListView_SwapItems'; +function BListView_MoveItem(AObject : TCPlusObject; from : integer; ato : integer) : boolean; cdecl; external BePascalLibName name 'BListView_MoveItem'; +function BListView_ReplaceItem(AObject : TCPlusObject; index : integer; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_ReplaceItem'; +procedure BListView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_AttachedToWindow'; +procedure BListView_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BListView_FrameMoved'; +function BListView_ItemFrame(AObject : TCPlusObject; index : integer) : BRect; cdecl; external BePascalLibName name 'BListView_ItemFrame'; +function BListView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BListView_ResolveSpecifier'; +function BListView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BListView_GetSupportedSuites'; +function BListView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BListView_Perform'; +procedure BListView_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BListView_WindowActivated'; +procedure BListView_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BListView_MouseUp'; +procedure BListView_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BListView_MouseMoved'; +procedure BListView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_DetachedFromWindow'; +function BListView_InitiateDrag(AObject : TCPlusObject; pt : TCPlusObject; itemIndex : integer; initialySelected : boolean) : boolean; cdecl; external BePascalLibName name 'BListView_InitiateDrag'; +procedure BListView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_ResizeToPreferred'; +procedure BListView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BListView_GetPreferredSize'; +procedure BListView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_AllAttached'; +procedure BListView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_AllDetached'; +//procedure BListView_enum MiscCode { B_NO_OP, B_REPLACE_OP, B_MOVE_OP, B_SWAP_OP }(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_enum MiscCode { B_NO_OP, B_REPLACE_OP, B_MOVE_OP, B_SWAP_OP }'; +//procedure Replace_int32 index(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Replace_int32 index'; +//procedure Replace_BListItem *item(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Replace_BListItem *item'; +//procedure Move_int32 from(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Move_int32 from'; +//procedure Move_int32 to(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Move_int32 to'; +//procedure Swap_int32 a(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Swap_int32 a'; +//procedure Swap_int32 b(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Swap_int32 b'; + +implementation +var + ListItem_SelectionChanged_hook: Pointer; cvar; external; + ListString_InitiateDrag_hook: Pointer; cvar; external; + +constructor BListView.Create(frame : BRect; name : pchar; atype : list_view_type; resizeMask: longint; flags : longint); +begin + CreatePas; + CPlusObject := BListView_Create(Self,frame.CPlusObject,name,atype,resizeMask,flags); +end; + +constructor BListView.Create(data : BMessage); +begin + CreatePas; + CPlusObject := BListView_Create(Self,data.CPlusObject); +end; + +destructor BListView.Destroy; +begin + BListView_Free(CPlusObject); + inherited; +end; + +function BListView.Instantiate(data : BMessage) : BArchivable; +begin + Result := BListView_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BListView.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BListView_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BListView.Draw(updateRect : BRect); +begin + //BListView_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure BListView.MessageReceived(msg : BMessage); +begin + //BListView_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BListView.MouseDown(where : BPoint); +begin + //BListView_MouseDown(CPlusObject, where.CPlusObject); +end; + +procedure BListView.KeyDown(bytes : PChar; numBytes : integer); +begin + //BListView_KeyDown(CPlusObject, bytes, numBytes); +end; + +procedure BListView.MakeFocus(state : boolean); +begin + //BListView_MakeFocus(CPlusObject, state); +end; + +procedure BListView.FrameResized(newWidth : double; newHeight : double); +begin + //BListView_FrameResized(CPlusObject, newWidth, newHeight); +end; + +procedure BListView.TargetedByScrollView(scroller : BScrollView); +begin + BListView_TargetedByScrollView(CPlusObject, scroller.CPlusObject); +end; + +procedure BListView.ScrollTo(x : double; y : double); +begin + BListView_ScrollTo(CPlusObject, x, y); +end; + +procedure BListView.ScrollTo(where : BPoint); +begin + BListView_ScrollTo(CPlusObject, where.CPlusObject); +end; + +function BListView.AddItem(item : BListItem) : boolean; +begin + Result := BListView_AddItem(CPlusObject, item.CPlusObject); +end; + +function BListView.AddItem(item : BListItem; atIndex : integer) : boolean; +begin + Result := BListView_AddItem(CPlusObject, item.CPlusObject, atIndex); +end; + +function BListView.AddList(newItems : BList) : boolean; +begin + Result := BListView_AddList(CPlusObject, newItems.CPlusObject); +end; + +function BListView.AddList(newItems : BList; atIndex : integer) : boolean; +begin + Result := BListView_AddList(CPlusObject, newItems.CPlusObject, atIndex); +end; + +function BListView.RemoveItem(item : BListItem) : boolean; +begin + Result := BListView_RemoveItem(CPlusObject, item.CPlusObject); +end; + +function BListView.RemoveItem(index : integer) : BListItem; +begin + Result := BListView_RemoveItem(CPlusObject, index); +end; + +function BListView.RemoveItems(index : integer; count : integer) : boolean; +begin + Result := BListView_RemoveItems(CPlusObject, index, count); +end; + +procedure BListView.SetSelectionMessage(message : BMessage); +begin + BListView_SetSelectionMessage(CPlusObject, message.CPlusObject); +end; + +procedure BListView.SetInvocationMessage(message : BMessage); +begin + BListView_SetInvocationMessage(CPlusObject, message.CPlusObject); +end; + +function BListView.SelectionMessage : BMessage; +begin + Result := BListView_SelectionMessage(CPlusObject); +end; + +function BListView.SelectionCommand : Cardinal; +begin + Result := BListView_SelectionCommand(CPlusObject); +end; + +function BListView.InvocationMessage : BMessage; +begin + Result := BListView_InvocationMessage(CPlusObject); +end; + +function BListView.InvocationCommand : Cardinal; +begin + Result := BListView_InvocationCommand(CPlusObject); +end; + +procedure BListView.SetListType(atype : list_view_type); +begin + BListView_SetListType(CPlusObject, atype); +end; + +function BListView.ListType : list_view_type; +begin + Result := BListView_ListType(CPlusObject); +end; + +function BListView.ItemAt(index : integer) : BListItem; +begin + Result := BListView_ItemAt(CPlusObject, index); +end; + +function BListView.IndexOf(point : BPoint) : integer; +begin + Result := BListView_IndexOf(CPlusObject, point.CPlusObject); +end; + +function BListView.IndexOf(item : BListItem) : integer; +begin + Result := BListView_IndexOf(CPlusObject, item.CPlusObject); +end; + +function BListView.FirstItem : BListItem; +begin + Result := BListView_FirstItem(CPlusObject); +end; + +function BListView.LastItem : BListItem; +begin + Result := BListView_LastItem(CPlusObject); +end; + +function BListView.HasItem(item : BListItem) : boolean; +begin + Result := BListView_HasItem(CPlusObject, item.CPlusObject); +end; + +function BListView.CountItems : integer; +begin + Result := BListView_CountItems(CPlusObject); +end; + +procedure BListView.MakeEmpty; +begin + BListView_MakeEmpty(CPlusObject); +end; + +function BListView.IsEmpty : boolean; +begin + Result := BListView_IsEmpty(CPlusObject); +end; + +function BListView.Items : BListView; +begin + Result := BListView_Items(CPlusObject); +end; + +procedure BListView.InvalidateItem(index : integer); +begin + BListView_InvalidateItem(CPlusObject, index); +end; + +procedure BListView.ScrollToSelection; +begin + BListView_ScrollToSelection(CPlusObject); +end; + +procedure BListView.Select(index : integer; extend : boolean); +begin + BListView_Select(CPlusObject, index, extend); +end; + +procedure BListView.Select(from : integer; ato : integer; extend : boolean); +begin + BListView_Select(CPlusObject, from, ato, extend); +end; + +function BListView.IsItemSelected(index : integer) : boolean; +begin + Result := BListView_IsItemSelected(CPlusObject, index); +end; + +function BListView.CurrentSelection(index : integer) : integer; +begin + Result := BListView_CurrentSelection(CPlusObject, index); +end; + +function BListView.Invoke(msg : BMessage) : Status_t; +begin + Result := BListView_Invoke(CPlusObject, msg.CPlusObject); +end; + +procedure BListView.DeselectAll; +begin + BListView_DeselectAll(CPlusObject); +end; + +procedure BListView.DeselectExcept(except_from : integer; except_to : integer); +begin + BListView_DeselectExcept(CPlusObject, except_from, except_to); +end; + +procedure BListView.Deselect(index : integer); +begin + BListView_Deselect(CPlusObject, index); +end; + +procedure BListView.SelectionChanged; +begin + //BListView_SelectionChanged(CPlusObject); +end; + +function BListView.SwapItems(a : integer; b : integer) : boolean; +begin + Result := BListView_SwapItems(CPlusObject, a, b); +end; + +function BListView.MoveItem(from : integer; ato : integer) : boolean; +begin + Result := BListView_MoveItem(CPlusObject, from, ato); +end; + +function BListView.ReplaceItem(index : integer; item : BListItem) : boolean; +begin + Result := BListView_ReplaceItem(CPlusObject, index, item.CPlusObject); +end; + +procedure BListView.AttachedToWindow; +begin + //BListView_AttachedToWindow(CPlusObject); +end; + +procedure BListView.FrameMoved(new_position : BPoint); +begin + //BListView_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +function BListView.ItemFrame(index : integer) : BRect; +begin + Result := BListView_ItemFrame(CPlusObject, index); +end; + +function BListView.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BListView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +function BListView.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BListView_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BListView.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BListView_Perform(CPlusObject, d, arg); +end; + +procedure BListView.WindowActivated(state : boolean); +begin + //BListView_WindowActivated(CPlusObject, state); +end; + +procedure BListView.MouseUp(pt : BPoint); +begin + //BListView_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BListView.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin + //BListView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BListView.DetachedFromWindow; +begin + //BListView_DetachedFromWindow(CPlusObject); +end; + +function BListView.InitiateDrag(pt : BPoint; itemIndex : integer; initialySelected : boolean) : boolean; +begin + Result := BListView_InitiateDrag(CPlusObject, pt.CPlusObject, itemIndex, initialySelected); +end; + +procedure BListView.ResizeToPreferred; +begin + //BListView_ResizeToPreferred(CPlusObject); +end; + +procedure BListView.GetPreferredSize(width : double; height : double); +begin + // BListView_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BListView.AllAttached; +begin + //BListView_AllAttached(CPlusObject); +end; + +procedure BListView.AllDetached; +begin + //BListView_AllDetached(CPlusObject); +end; + +procedure ListItem_SelectionChanged_hook_func(Liste : BListView); cdecl; +begin + try + if Liste <> nil then + begin + Liste.SelectionChanged; + end; + finally + end; +end; + +procedure ListString_InitiateDrag_hook_func(Liste : BListView); cdecl; +begin + try + if Liste <> nil then + begin + Liste.SelectionChanged; + end; + finally + end; +end; + +initialization + ListItem_SelectionChanged_hook:=@ListItem_SelectionChanged_hook_func; + ListString_InitiateDrag_hook:=@ListString_InitiateDrag_hook_func; +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/menu.pp b/bepascal/source/bepascal/pas/src/be/interface/menu.pp new file mode 100644 index 0000000..4e5b7d4 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/menu.pp @@ -0,0 +1,1945 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit menu; + +interface + +uses + beobj, view, message, archivable, SupportDefs, rect, list, + handler, messenger, fdblib; + +type + Menu_Info = record + font_size : Double; +{ float font_size; + font_family f_family; + font_style f_style; + rgb_color background_color; + int32 separator; + bool click_to_open; + bool triggers_always_shown;} + end; + PMenu_Info = ^Menu_Info; +type + Menu_Layout = (B_ITEMS_IN_ROW, B_ITEMS_IN_COLUMN, B_ITEMS_IN_MATRIX); + Add_State = (B_INITIAL_ADD, B_PROCESSING, B_ABORT); +type + Menu_Tracking_Hook = function() : Status_t; cdecl; +type + bMenuItem = class; + BMenu = class(BView) + private + public +// constructor Create; override; + constructor Create(title : PChar; width : double; height : double); + constructor Create(title : PChar; layout : Menu_Layout); + destructor Destroy; override; +// constructor Create(data : BMessage); + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure AttachedToWindow; override; + procedure DetachedFromWindow; override; + + function AddItem(item : bMenuItem) : boolean; + function AddItem(item : bMenuItem; index : integer) : boolean; + function AddItem(item : bMenuItem; frame : BRect) : boolean; + function AddItem(menu : BMenu; index : integer) : boolean; + function AddItem(menu : BMenu; frame : BRect) : boolean; + function AddItem(menu : BMenu) : boolean; + + function AddList(list : BList; index : integer) : boolean; + function AddSeparatorItem : boolean; + function RemoveItem(item : bMenuItem) : boolean; + function RemoveItem(index : integer) : bMenuItem; + function RemoveItems(index : integer; count : integer; del : boolean) : boolean; + function RemoveItem(menu : BMenu) : boolean; + function ItemAt(index : integer) : bMenuItem; + function SubmenuAt(index : integer) : BMenu; + function CountItems : integer; + function IndexOf(item : bMenuItem) : integer; + function IndexOf(menu : BMenu) : integer; + function FindItem(command : Cardinal) : bMenuItem; + function FindItem(name : PChar) : bMenuItem; + function SetTargetForItems(target : BHandler) : Status_t; + function SetTargetForItems(messenger : BMessenger) : Status_t; + procedure SetEnabled(state : boolean); + procedure SetRadioMode(state : boolean); + procedure SetTriggersEnabled(state : boolean); + procedure SetMaxContentWidth(max : double); + procedure SetLabelFromMarked(aOn : boolean); + function IsLabelFromMarked : boolean; + function IsEnabled : boolean; + function IsRadioMode : boolean; + function AreTriggersEnabled : boolean; + function IsRedrawAfterSticky : boolean; + function MaxContentWidth : double; + function FindMarked : bMenuItem; + function Supermenu : BMenu; + function Superitem : bMenuItem; + procedure MessageReceived(msg : BMessage); override; + procedure KeyDown(bytes : PChar; numBytes : integer); override; + procedure Draw(updateRect : BRect); override; + procedure GetPreferredSize(width : double; height : double); + procedure ResizeToPreferred; override; + procedure FrameMoved(new_position : BPoint); override; + procedure FrameResized(new_width : double; new_height : double); override; + procedure InvalidateLayout; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; aProperty : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + procedure MakeFocus(state : boolean); + procedure AllAttached; override; + procedure AllDetached; override; +{ constructor Create(frame : BRect; viewName : PChar; resizeMask : Cardinal; flags : Cardinal; layout : BMenu_Layout; resizeToFit : boolean); + function ScreenLocation : BPoint; + procedure SetItemMargins(left : double; top : double; right : double; bottom : double); + procedure GetItemMargins(left : double; top : double; right : double; bottom : double); + function Layout : TMenu_Layout; + procedure Show; + procedure Show(selectFirstItem : boolean); + procedure Hide; + function Track(start_opened : boolean; special_rect : BRect) : bMenuItem; +} +// procedure enum add_state { B_INITIAL_ADD, B_PROCESSING, B_ABORT }; +{ function AddDynamicItem(s : TAdd_State) : boolean; + procedure DrawBackground(update : BRect); + procedure SetTrackingHook(func : TMenu_Tracking_Hook; state : Pointer); +} +{ procedure _ReservedMenu3; + procedure _ReservedMenu4; + procedure _ReservedMenu5; + procedure _ReservedMenu6; + function operator=( : TMenu) : TMenu; + procedure InitData(data : BMessage); + function _show(selectFirstItem : boolean) : boolean; + procedure _hide; + function _track(action : integer; start : integer) : bMenuItem; + function _AddItem(item : bMenuItem; index : integer) : boolean; + function RemoveItems(index : integer; count : integer; item : bMenuItem; del : boolean) : boolean; + procedure LayoutItems(index : integer); + procedure ComputeLayout(index : integer; bestFit : boolean; moveItems : boolean; width : double; height : double); + function Bump(current : BRect; extent : BPoint; index : integer) : BRect; + function ItemLocInRect(frame : BRect) : BPoint; + function CalcFrame(where : BPoint; scrollOn : boolean) : BRect; + function ScrollMenu(bounds : BRect; loc : BPoint; fast : boolean) : boolean; + procedure ScrollIntoView(item : bMenuItem); + procedure DrawItems(updateRect : BRect); + function State(item : bMenuItem) : integer; + procedure InvokeItem(item : bMenuItem; now : boolean); + function OverSuper(loc : BPoint) : boolean; + function OverSubmenu(item : bMenuItem; loc : BPoint) : boolean; + function MenuWindow : TMenuWindow; + procedure DeleteMenuWindow; + function HitTestItems(where : BPoint; slop : BPoint) : bMenuItem; + function Superbounds : BRect; + procedure CacheFontInfo; + procedure ItemMarked(item : bMenuItem); + procedure Install(target : TWindow); + procedure Uninstall; + procedure SelectItem(m : bMenuItem; showSubmenu : Cardinal; selectFirstItem : boolean); + function CurrentSelection : bMenuItem; + function SelectNextItem(item : bMenuItem; forward : boolean) : boolean; + function NextItem(item : bMenuItem; forward : boolean) : bMenuItem; + function IsItemVisible(item : bMenuItem) : boolean; + procedure SetIgnoreHidden(on : boolean); + procedure SetStickyMode(on : boolean); + function IsStickyMode : boolean; + procedure CalcTriggers; + function ChooseTrigger(title : PChar; chars : BList) : PChar; + procedure UpdateWindowViewSize(upWind : boolean); + function IsStickyPrefOn : boolean; + procedure RedrawAfterSticky(bounds : BRect); + function OkToProceed( : bMenuItem) : boolean; + function ParseMsg(msg : BMessage; sindex : ^integer; spec : BMessage; form : ^integer; prop : PChar; tmenu : TMenu; titem : bMenuItem; user_data : ^integer; reply : BMessage) : Status_t; + function DoMenuMsg(next : bMenuItem; tar : TMenu; m : BMessage; r : BMessage; spec : BMessage; f : integer) : Status_t; + function DoMenuItemMsg(next : bMenuItem; tar : TMenu; m : BMessage; r : BMessage; spec : BMessage; f : integer) : Status_t; + function DoEnabledMsg(ti : bMenuItem; tm : TMenu; m : BMessage; r : BMessage) : Status_t; + function DoLabelMsg(ti : bMenuItem; tm : TMenu; m : BMessage; r : BMessage) : Status_t; + function DoMarkMsg(ti : bMenuItem; tm : TMenu; m : BMessage; r : BMessage) : Status_t; + function DoDeleteMsg(ti : bMenuItem; tm : TMenu; m : BMessage; r : BMessage) : Status_t; + function DoCreateMsg(ti : bMenuItem; tm : TMenu; m : BMessage; r : BMessage; menu : boolean) : Status_t; + procedure menu_info sMenuInfo; + procedure bool sSwapped; + procedure BMenuItem *fChosenItem; + procedure BList fItems; + procedure BRect fPad; + procedure BMenuItem *fSelected; + procedure BMenuWindow *fCachedMenuWindow; + procedure BMenu *fSuper; + procedure BMenuItem *fSuperitem; + procedure BRect fSuperbounds; + procedure float fAscent; + procedure float fDescent; + procedure float fFontHeight; + procedure uint32 fState; + procedure menu_layout fLayout; + procedure BRect *fExtraRect; + procedure float fMaxContentWidth; + procedure BPoint *fInitMatrixSize; + procedure _ExtraMenuData_ *fExtraMenuData; + procedure uint32 _reserved[2]; + procedure char fTrigger; + procedure bool fResizeToFit; + procedure bool fUseCachedMenuLayout; + procedure bool fEnabled; + procedure bool fDynamicName; + procedure bool fRadioMode; + procedure bool fTrackNewBounds; + procedure bool fStickyMode; + procedure bool fIgnoreHidden; + procedure bool fTriggerEnabled; + procedure bool fRedrawAfterSticky; + procedure bool fAttachAborted;} + end; + + bMenuItem = class(TBeObject) + private + public + constructor Create; override; + constructor Create(aMenu : BMenu; message : BMessage); virtual; + constructor Create(data : BMessage); virtual; + constructor Create(aLabel : PChar; message : BMessage; aShortcut : Char; modifiers : Cardinal); virtual; + destructor Destroy; override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure SetLabel(name : PChar); + procedure SetEnabled(state : boolean); + procedure SetMarked(state : boolean); + procedure SetTrigger(ch : Char); + procedure SetShortcut(ch : Char; modifiers : Cardinal); +// function aLabel : PChar; + function IsEnabled : boolean; + function IsMarked : boolean; + function Trigger : Char; +// function Shortcut(modifiers : Cardinal) : Char; + function Submenu : BMenu; + function Menu : BMenu; + function Frame : BRect; +{ procedure GetContentSize(width : double; height : double); + procedure TruncateLabel(max : double; new_label : PChar); + procedure DrawContent; + procedure Draw; + procedure Highlight(aOn : boolean); + function IsSelected : boolean; + function ContentLocation : BPoint; + procedure _ReservedMenuItem2; + procedure _ReservedMenuItem3; + procedure _ReservedMenuItem4; + constructor Create(MenuItem : bMenuItem); + function operator=(MenuItem : bMenuItem) : bMenuItem; + procedure InitData; + procedure InitMenuData(menu : BMenu); + procedure Install(window : TWindow); + function Invoke(msg : BMessage) : Status_t; + procedure Uninstall; + procedure SetSuper(super : BMenu); + procedure Select(on : boolean); + procedure DrawMarkSymbol; + procedure DrawShortcutSymbol; + procedure DrawSubmenuSymbol; + procedure DrawControlChar(control : PChar); + procedure SetSysTrigger(ch : Char); + procedure char *fLabel; + procedure BMenu *fSubmenu; + procedure BWindow *fWindow; + procedure BMenu *fSuper; + procedure BRect fBounds; + procedure uint32 fModifiers; + procedure float fCachedWidth; + procedure int16 fTriggerIndex; + procedure char fUserTrigger; + procedure char fSysTrigger; + procedure char fShortcutChar; + procedure bool fMark; + procedure bool fEnabled; + procedure bool fSelected; + procedure uint32 _reserved[4]; +} + end; +type + BSeparatorItem = class(bMenuItem) + private + public + constructor Create; override; + constructor Create(data : BMessage); override; + destructor Destroy; override; + function Archive(data : BMessage; deep : boolean) : Status_t; + function Instantiate(data : BMessage) : BArchivable; + procedure SetEnabled(state : boolean); +{ procedure GetContentSize(width : double; height : double); + procedure Draw; + procedure _ReservedSeparatorItem1; + procedure _ReservedSeparatorItem2; + function operator=( : BSeparatorItem) : BSeparatorItem; + procedure uint32 _reserved[1]; +} + end; + +//function BMenuItem_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMenuItem_Create'; +function BMenuItem_Create(AObject : TBeObject; aLabel : PChar; message : TCPlusObject; shortcut : Char; modifiers : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BMenuItem_Create'; +function BMenuItem_Create(AObject : TBeObject; menu : TCPlusObject; message : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMenuItem_Create_1'; +function BMenuItem_Create(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMenuItem_Create_2'; +procedure BMenuItem_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_Free'; +function BMenuItem_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BMenuItem_Instantiate'; +function BMenuItem_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BMenuItem_Archive'; +procedure BMenuItem_SetLabel(AObject : TCPlusObject; name : PChar); cdecl; external BePascalLibName name 'BMenuItem_SetLabel'; +procedure BMenuItem_SetEnabled(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenuItem_SetEnabled'; +procedure BMenuItem_SetMarked(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenuItem_SetMarked'; +procedure BMenuItem_SetTrigger(AObject : TCPlusObject; ch : Char); cdecl; external BePascalLibName name 'BMenuItem_SetTrigger'; +procedure BMenuItem_SetShortcut(AObject : TCPlusObject; ch : Char; modifiers : Cardinal); cdecl; external BePascalLibName name 'BMenuItem_SetShortcut'; +function BMenuItem_Label(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BMenuItem_Label'; +function BMenuItem_IsEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenuItem_IsEnabled'; +function BMenuItem_IsMarked(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenuItem_IsMarked'; +function BMenuItem_Trigger(AObject : TCPlusObject) : Char; cdecl; external BePascalLibName name 'BMenuItem_Trigger'; +function BMenuItem_Shortcut(AObject : TCPlusObject; modifiers : Cardinal) : Char; cdecl; external BePascalLibName name 'BMenuItem_Shortcut'; +function BMenuItem_Submenu(AObject : TCPlusObject) : BMenu; cdecl; external BePascalLibName name 'BMenuItem_Submenu'; +function BMenuItem_Menu(AObject : TCPlusObject) : BMenu; cdecl; external BePascalLibName name 'BMenuItem_Menu'; +function BMenuItem_Frame(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BMenuItem_Frame'; +{procedure BMenuItem_GetContentSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BMenuItem_GetContentSize'; +procedure BMenuItem_TruncateLabel(AObject : TCPlusObject; max : double; new_label : PChar); cdecl; external BePascalLibName name 'BMenuItem_TruncateLabel'; +procedure BMenuItem_DrawContent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_DrawContent'; +procedure BMenuItem_Draw(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_Draw'; +procedure BMenuItem_Highlight(AObject : TCPlusObject; aOn : boolean); cdecl; external BePascalLibName name 'BMenuItem_Highlight'; +function BMenuItem_IsSelected(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenuItem_IsSelected'; +function BMenuItem_ContentLocation(AObject : TCPlusObject) : BPoint; cdecl; external BePascalLibName name 'BMenuItem_ContentLocation'; +procedure BMenuItem__ReservedMenuItem2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem__ReservedMenuItem2'; +procedure BMenuItem__ReservedMenuItem3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem__ReservedMenuItem3'; +procedure BMenuItem__ReservedMenuItem4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem__ReservedMenuItem4'; +function BMenuItem_Create(AObject : TBeObject; : bMenuItem) : TCPlusObject; cdecl; external BePascalLibName name 'BMenuItem_Create'; +function BMenuItem_operator=(AObject : TCPlusObject; : bMenuItem) : bMenuItem; cdecl; external BePascalLibName name 'BMenuItem_operator='; +procedure BMenuItem_InitData(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_InitData'; +procedure BMenuItem_InitMenuData(AObject : TCPlusObject; menu : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_InitMenuData'; +procedure BMenuItem_Install(AObject : TCPlusObject; window : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_Install'; +function BMenuItem_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenuItem_Invoke'; +procedure BMenuItem_Uninstall(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_Uninstall'; +procedure BMenuItem_SetSuper(AObject : TCPlusObject; super : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_SetSuper'; +procedure BMenuItem_Select(AObject : TCPlusObject; on : boolean); cdecl; external BePascalLibName name 'BMenuItem_Select'; +procedure BMenuItem_DrawMarkSymbol(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_DrawMarkSymbol'; +procedure BMenuItem_DrawShortcutSymbol(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_DrawShortcutSymbol'; +procedure BMenuItem_DrawSubmenuSymbol(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_DrawSubmenuSymbol'; +procedure BMenuItem_DrawControlChar(AObject : TCPlusObject; control : PChar); cdecl; external BePascalLibName name 'BMenuItem_DrawControlChar'; +procedure BMenuItem_SetSysTrigger(AObject : TCPlusObject; ch : Char); cdecl; external BePascalLibName name 'BMenuItem_SetSysTrigger'; +procedure BMenuItem_char *fLabel(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_char *fLabel'; +procedure BMenuItem_BMenu *fSubmenu(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_BMenu *fSubmenu'; +procedure BMenuItem_BWindow *fWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_BWindow *fWindow'; +procedure BMenuItem_BMenu *fSuper(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_BMenu *fSuper'; +procedure BMenuItem_BRect fBounds(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_BRect fBounds'; +procedure BMenuItem_uint32 fModifiers(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_uint32 fModifiers'; +procedure BMenuItem_float fCachedWidth(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_float fCachedWidth'; +procedure BMenuItem_int16 fTriggerIndex(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_int16 fTriggerIndex'; +procedure BMenuItem_char fUserTrigger(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_char fUserTrigger'; +procedure BMenuItem_char fSysTrigger(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_char fSysTrigger'; +procedure BMenuItem_char fShortcutChar(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_char fShortcutChar'; +procedure BMenuItem_bool fMark(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_bool fMark'; +procedure BMenuItem_bool fEnabled(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_bool fEnabled'; +procedure BMenuItem_bool fSelected(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_bool fSelected'; +procedure BMenuItem_uint32 _reserved[4](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuItem_uint32 _reserved[4]'; +} +function BSeparatorItem_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BSeparatorItem_Create'; +function BSeparatorItem_Create(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BSeparatorItem_Create_1'; +procedure BSeparatorItem_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSeparatorItem_Free'; +function BSeparatorItem_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BSeparatorItem_Archive'; +function BSeparatorItem_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BSeparatorItem_Instantiate'; +procedure BSeparatorItem_SetEnabled(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BSeparatorItem_SetEnabled'; +procedure BSeparatorItem_GetContentSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BSeparatorItem_GetContentSize'; +//procedure BSeparatorItem_Draw(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSeparatorItem_Draw'; +{procedure BSeparatorItem__ReservedSeparatorItem1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSeparatorItem__ReservedSeparatorItem1'; +procedure BSeparatorItem__ReservedSeparatorItem2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSeparatorItem__ReservedSeparatorItem2'; +function BSeparatorItem_operator=(AObject : TCPlusObject; : BSeparatorItem) : BSeparatorItem; cdecl; external BePascalLibName name 'BSeparatorItem_operator='; +procedure BSeparatorItem_uint32 _reserved[1](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSeparatorItem_uint32 _reserved[1]'; +} + +//procedure menu_info_float font_size(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_float font_size'; +//procedure menu_info_font_family f_family(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_font_family f_family'; +//procedure menu_info_font_style f_style(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_font_style f_style'; +//procedure menu_info_rgb_color background_color(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_rgb_color background_color'; +//procedure menu_info_int32 separator(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_int32 separator'; +//procedure menu_info_bool click_to_open(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_bool click_to_open'; +//procedure menu_info_bool triggers_always_shown(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_bool triggers_always_shown'; +//function BMenu_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create'; +function BMenu_Create(AObject : TBeObject; title : PChar; layout : Integer) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create'; +function BMenu_Create(AObject : TBeObject; title : PChar; width : double; height : double) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create_1'; +procedure BMenu_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_Free'; +function BMenu_Create(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create_3'; +function BMenu_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BMenu_Instantiate'; +function BMenu_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BMenu_Archive'; +procedure BMenu_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_AttachedToWindow'; +procedure BMenu_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_DetachedFromWindow'; +function BMenu_AddItem_1(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem'; +function BMenu_AddItem_2(AObject : TCPlusObject; item : TCPlusObject; index : integer) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem_1'; +function BMenu_AddItem_3(AObject : TCPlusObject; item : TCPlusObject; frame : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem_2'; +function BMenu_AddItem_4(AObject : TCPlusObject; menu : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem_3'; +function BMenu_AddItem_5(AObject : TCPlusObject; menu : TCPlusObject; index : integer) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem_4'; +function BMenu_AddItem_6(AObject : TCPlusObject; menu : TCPlusObject; frame : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem_5'; +function BMenu_AddList(AObject : TCPlusObject; list : TCPlusObject; index : integer) : boolean; cdecl; external BePascalLibName name 'BMenu_AddList'; +function BMenu_AddSeparatorItem(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AddSeparatorItem'; +function BMenu_RemoveItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_RemoveItem'; +function BMenu_RemoveItem(AObject : TCPlusObject; index : integer) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_RemoveItem_1'; +function BMenu_RemoveItems(AObject : TCPlusObject; index : integer; count : integer; del : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu_RemoveItems_2'; +//function BMenu_RemoveItem(AObject : TCPlusObject; menu : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_RemoveItem'; +function BMenu_ItemAt(AObject : TCPlusObject; index : integer) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_ItemAt'; +function BMenu_SubmenuAt(AObject : TCPlusObject; index : integer) : BMenu; cdecl; external BePascalLibName name 'BMenu_SubmenuAt'; +function BMenu_CountItems(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BMenu_CountItems'; +function BMenu_IndexOf(AObject : TCPlusObject; item : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BMenu_IndexOf'; +//function BMenu_IndexOf(AObject : TCPlusObject; menu : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BMenu_IndexOf'; +function BMenu_FindItem(AObject : TCPlusObject; command : Cardinal) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_FindItem'; +function BMenu_FindItem(AObject : TCPlusObject; name : PChar) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_FindItem'; +function BMenu_SetTargetForItems(AObject : TCPlusObject; target : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenu_SetTargetForItems'; +//function BMenu_SetTargetForItems(AObject : TCPlusObject; messenger : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenu_SetTargetForItems'; +procedure BMenu_SetEnabled(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenu_SetEnabled'; +procedure BMenu_SetRadioMode(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenu_SetRadioMode'; +procedure BMenu_SetTriggersEnabled(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenu_SetTriggersEnabled'; +procedure BMenu_SetMaxContentWidth(AObject : TCPlusObject; max : double); cdecl; external BePascalLibName name 'BMenu_SetMaxContentWidth'; +procedure BMenu_SetLabelFromMarked(AObject : TCPlusObject; aOn : boolean); cdecl; external BePascalLibName name 'BMenu_SetLabelFromMarked'; +function BMenu_IsLabelFromMarked(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsLabelFromMarked'; +function BMenu_IsEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsEnabled'; +function BMenu_IsRadioMode(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsRadioMode'; +function BMenu_AreTriggersEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AreTriggersEnabled'; +function BMenu_IsRedrawAfterSticky(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsRedrawAfterSticky'; +function BMenu_MaxContentWidth(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BMenu_MaxContentWidth'; +function BMenu_FindMarked(AObject : TCPlusObject) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_FindMarked'; +function BMenu_Supermenu(AObject : TCPlusObject) : BMenu; cdecl; external BePascalLibName name 'BMenu_Supermenu'; +function BMenu_Superitem(AObject : TCPlusObject) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_Superitem'; +procedure BMenu_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_MessageReceived'; +procedure BMenu_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BMenu_KeyDown'; +procedure BMenu_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_Draw'; +procedure BMenu_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BMenu_GetPreferredSize'; +procedure BMenu_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_ResizeToPreferred'; +procedure BMenu_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_FrameMoved'; +procedure BMenu_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BMenu_FrameResized'; +procedure BMenu_InvalidateLayout(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_InvalidateLayout'; +function BMenu_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; aProperty : PChar) : BHandler; cdecl; external BePascalLibName name 'BMenu_ResolveSpecifier'; +function BMenu_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenu_GetSupportedSuites'; +function BMenu_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BMenu_Perform'; +procedure BMenu_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenu_MakeFocus'; +procedure BMenu_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_AllAttached'; +procedure BMenu_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_AllDetached'; +function BMenu_Create(AObject : TBeObject; frame : TCPlusObject; viewName : PChar; resizeMask : Cardinal; flags : Cardinal; layout : Menu_Layout; resizeToFit : boolean) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create'; +function BMenu_ScreenLocation(AObject : TCPlusObject) : BPoint; cdecl; external BePascalLibName name 'BMenu_ScreenLocation'; +procedure BMenu_SetItemMargins(AObject : TCPlusObject; left : double; top : double; right : double; bottom : double); cdecl; external BePascalLibName name 'BMenu_SetItemMargins'; +procedure BMenu_GetItemMargins(AObject : TCPlusObject; left : double; top : double; right : double; bottom : double); cdecl; external BePascalLibName name 'BMenu_GetItemMargins'; +function BMenu_Layout(AObject : TCPlusObject) : Menu_Layout; cdecl; external BePascalLibName name 'BMenu_Layout'; +procedure BMenu_Show(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_Show'; +procedure BMenu_Show(AObject : TCPlusObject; selectFirstItem : boolean); cdecl; external BePascalLibName name 'BMenu_Show'; +procedure BMenu_Hide(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_Hide'; +function BMenu_Track(AObject : TCPlusObject; start_opened : boolean; special_rect : TCPlusObject) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_Track'; +//procedure BMenu_enum add_state { B_INITIAL_ADD, B_PROCESSING, B_ABORT }(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_enum add_state { B_INITIAL_ADD, B_PROCESSING, B_ABORT }'; +function BMenu_AddDynamicItem(AObject : TCPlusObject; s : Add_State) : boolean; cdecl; external BePascalLibName name 'BMenu_AddDynamicItem'; +procedure BMenu_DrawBackground(AObject : TCPlusObject; update : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_DrawBackground'; +procedure BMenu_SetTrackingHook(AObject : TCPlusObject; func : Menu_Tracking_Hook; state : Pointer); cdecl; external BePascalLibName name 'BMenu_SetTrackingHook'; +{procedure BMenu__ReservedMenu3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__ReservedMenu3'; +procedure BMenu__ReservedMenu4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__ReservedMenu4'; +procedure BMenu__ReservedMenu5(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__ReservedMenu5'; +procedure BMenu__ReservedMenu6(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__ReservedMenu6'; +function BMenu_operator=(AObject : TCPlusObject; : TMenu) : TMenu; cdecl; external BePascalLibName name 'BMenu_operator='; +procedure BMenu_InitData(AObject : TCPlusObject; data : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_InitData'; +function BMenu__show(AObject : TCPlusObject; selectFirstItem : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu__show'; +procedure BMenu__hide(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__hide'; +function BMenu__track(AObject : TCPlusObject; action : integer; start : integer) : bMenuItem; cdecl; external BePascalLibName name 'BMenu__track'; +function BMenu__AddItem(AObject : TCPlusObject; item : TCPlusObject; index : integer) : boolean; cdecl; external BePascalLibName name 'BMenu__AddItem'; +function BMenu_RemoveItems(AObject : TCPlusObject; index : integer; count : integer; item : TCPlusObject; del : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu_RemoveItems'; +procedure BMenu_LayoutItems(AObject : TCPlusObject; index : integer); cdecl; external BePascalLibName name 'BMenu_LayoutItems'; +procedure BMenu_ComputeLayout(AObject : TCPlusObject; index : integer; bestFit : boolean; moveItems : boolean; width : double; height : double); cdecl; external BePascalLibName name 'BMenu_ComputeLayout'; +function BMenu_Bump(AObject : TCPlusObject; current : TCPlusObject; extent : TCPlusObject; index : integer) : BRect; cdecl; external BePascalLibName name 'BMenu_Bump'; +function BMenu_ItemLocInRect(AObject : TCPlusObject; frame : TCPlusObject) : BPoint; cdecl; external BePascalLibName name 'BMenu_ItemLocInRect'; +function BMenu_CalcFrame(AObject : TCPlusObject; where : TCPlusObject; scrollOn : boolean) : BRect; cdecl; external BePascalLibName name 'BMenu_CalcFrame'; +function BMenu_ScrollMenu(AObject : TCPlusObject; bounds : TCPlusObject; loc : TCPlusObject; fast : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu_ScrollMenu'; +procedure BMenu_ScrollIntoView(AObject : TCPlusObject; item : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_ScrollIntoView'; +procedure BMenu_DrawItems(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_DrawItems'; +function BMenu_State(AObject : TCPlusObject; item : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BMenu_State'; +procedure BMenu_InvokeItem(AObject : TCPlusObject; item : TCPlusObject; now : boolean); cdecl; external BePascalLibName name 'BMenu_InvokeItem'; +function BMenu_OverSuper(AObject : TCPlusObject; loc : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_OverSuper'; +function BMenu_OverSubmenu(AObject : TCPlusObject; item : TCPlusObject; loc : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_OverSubmenu'; +function BMenu_MenuWindow(AObject : TCPlusObject) : TMenuWindow; cdecl; external BePascalLibName name 'BMenu_MenuWindow'; +procedure BMenu_DeleteMenuWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_DeleteMenuWindow'; +function BMenu_HitTestItems(AObject : TCPlusObject; where : TCPlusObject; slop : TCPlusObject) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_HitTestItems'; +function BMenu_Superbounds(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BMenu_Superbounds'; +procedure BMenu_CacheFontInfo(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_CacheFontInfo'; +procedure BMenu_ItemMarked(AObject : TCPlusObject; item : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_ItemMarked'; +procedure BMenu_Install(AObject : TCPlusObject; target : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_Install'; +procedure BMenu_Uninstall(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_Uninstall'; +procedure BMenu_SelectItem(AObject : TCPlusObject; m : TCPlusObject; showSubmenu : Cardinal; selectFirstItem : boolean); cdecl; external BePascalLibName name 'BMenu_SelectItem'; +function BMenu_CurrentSelection(AObject : TCPlusObject) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_CurrentSelection'; +function BMenu_SelectNextItem(AObject : TCPlusObject; item : TCPlusObject; forward : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu_SelectNextItem'; +function BMenu_NextItem(AObject : TCPlusObject; item : TCPlusObject; forward : boolean) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_NextItem'; +function BMenu_IsItemVisible(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsItemVisible'; +procedure BMenu_SetIgnoreHidden(AObject : TCPlusObject; on : boolean); cdecl; external BePascalLibName name 'BMenu_SetIgnoreHidden'; +procedure BMenu_SetStickyMode(AObject : TCPlusObject; on : boolean); cdecl; external BePascalLibName name 'BMenu_SetStickyMode'; +function BMenu_IsStickyMode(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsStickyMode'; +procedure BMenu_CalcTriggers(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_CalcTriggers'; +function BMenu_ChooseTrigger(AObject : TCPlusObject; title : PChar; chars : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BMenu_ChooseTrigger'; +procedure BMenu_UpdateWindowViewSize(AObject : TCPlusObject; upWind : boolean); cdecl; external BePascalLibName name 'BMenu_UpdateWindowViewSize'; +function BMenu_IsStickyPrefOn(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsStickyPrefOn'; +procedure BMenu_RedrawAfterSticky(AObject : TCPlusObject; bounds : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_RedrawAfterSticky'; +function BMenu_OkToProceed(AObject : TCPlusObject; : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_OkToProceed'; +function BMenu_ParseMsg(AObject : TCPlusObject; msg : TCPlusObject; sindex : ^integer; spec : TCPlusObject; form : ^integer; prop : PChar; tmenu : TCPlusObject; titem : TCPlusObject; user_data : ^integer; reply : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenu_ParseMsg'; +function BMenu_DoMenuMsg(AObject : TCPlusObject; next : TCPlusObject; tar : TCPlusObject; m : TCPlusObject; r : TCPlusObject; spec : TCPlusObject; f : integer) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoMenuMsg'; +function BMenu_DoMenuItemMsg(AObject : TCPlusObject; next : TCPlusObject; tar : TCPlusObject; m : TCPlusObject; r : TCPlusObject; spec : TCPlusObject; f : integer) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoMenuItemMsg'; +function BMenu_DoEnabledMsg(AObject : TCPlusObject; ti : TCPlusObject; tm : TCPlusObject; m : TCPlusObject; r : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoEnabledMsg'; +function BMenu_DoLabelMsg(AObject : TCPlusObject; ti : TCPlusObject; tm : TCPlusObject; m : TCPlusObject; r : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoLabelMsg'; +function BMenu_DoMarkMsg(AObject : TCPlusObject; ti : TCPlusObject; tm : TCPlusObject; m : TCPlusObject; r : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoMarkMsg'; +function BMenu_DoDeleteMsg(AObject : TCPlusObject; ti : TCPlusObject; tm : TCPlusObject; m : TCPlusObject; r : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoDeleteMsg'; +function BMenu_DoCreateMsg(AObject : TCPlusObject; ti : TCPlusObject; tm : TCPlusObject; m : TCPlusObject; r : TCPlusObject; menu : boolean) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoCreateMsg'; +procedure BMenu_menu_info sMenuInfo(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_menu_info sMenuInfo'; +procedure BMenu_bool sSwapped(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool sSwapped'; +procedure BMenu_BMenuItem *fChosenItem(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BMenuItem *fChosenItem'; +procedure BMenu_BList fItems(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BList fItems'; +procedure BMenu_BRect fPad(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BRect fPad'; +procedure BMenu_BMenuItem *fSelected(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BMenuItem *fSelected'; +procedure BMenu_BMenuWindow *fCachedMenuWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BMenuWindow *fCachedMenuWindow'; +procedure BMenu_BMenu *fSuper(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BMenu *fSuper'; +procedure BMenu_BMenuItem *fSuperitem(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BMenuItem *fSuperitem'; +procedure BMenu_BRect fSuperbounds(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BRect fSuperbounds'; +procedure BMenu_float fAscent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_float fAscent'; +procedure BMenu_float fDescent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_float fDescent'; +procedure BMenu_float fFontHeight(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_float fFontHeight'; +procedure BMenu_uint32 fState(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_uint32 fState'; +procedure BMenu_menu_layout fLayout(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_menu_layout fLayout'; +procedure BMenu_BRect *fExtraRect(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BRect *fExtraRect'; +procedure BMenu_float fMaxContentWidth(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_float fMaxContentWidth'; +procedure BMenu_BPoint *fInitMatrixSize(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BPoint *fInitMatrixSize'; +procedure BMenu__ExtraMenuData_ *fExtraMenuData(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__ExtraMenuData_ *fExtraMenuData'; +procedure BMenu_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_uint32 _reserved[2]'; +procedure BMenu_char fTrigger(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_char fTrigger'; +procedure BMenu_bool fResizeToFit(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fResizeToFit'; +procedure BMenu_bool fUseCachedMenuLayout(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fUseCachedMenuLayout'; +procedure BMenu_bool fEnabled(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fEnabled'; +procedure BMenu_bool fDynamicName(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fDynamicName'; +procedure BMenu_bool fRadioMode(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fRadioMode'; +procedure BMenu_bool fTrackNewBounds(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fTrackNewBounds'; +procedure BMenu_bool fStickyMode(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fStickyMode'; +procedure BMenu_bool fIgnoreHidden(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fIgnoreHidden'; +procedure BMenu_bool fTriggerEnabled(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fTriggerEnabled'; +procedure BMenu_bool fRedrawAfterSticky(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fRedrawAfterSticky'; +procedure BMenu_bool fAttachAborted(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fAttachAborted'; +} +//----------------------------------- + +//procedure menu_info_float font_size(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_float font_size'; +//procedure menu_info_font_family f_family(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_font_family f_family'; +//procedure menu_info_font_style f_style(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_font_style f_style'; +//procedure menu_info_rgb_color background_color(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_rgb_color background_color'; +//procedure menu_info_int32 separator(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_int32 separator'; +//procedure menu_info_bool click_to_open(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_bool click_to_open'; +//procedure menu_info_bool triggers_always_shown(AObject : TCPlusObject); cdecl; external BePascalLibName name 'menu_info_bool triggers_always_shown'; +{function BMenu_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create'; +function BMenu_Create(AObject : TBeObject; title : PChar; width : double; height : double) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create'; +procedure BMenu_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_Free'; +function BMenu_Create(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create'; +function BMenu_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BMenu_Instantiate'; +function BMenu_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BMenu_Archive'; +procedure BMenu_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_AttachedToWindow'; +procedure BMenu_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_DetachedFromWindow'; +function BMenu_AddItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem'; +function BMenu_AddItem(AObject : TCPlusObject; item : TCPlusObject; index : integer) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem'; +function BMenu_AddItem(AObject : TCPlusObject; item : TCPlusObject; frame : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem'; +} +//function BMenu_AddItem(AObject : TCPlusObject; menu : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem'; +//function BMenu_AddItem(AObject : TCPlusObject; menu : TCPlusObject; index : integer) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem'; +//function BMenu_AddItem(AObject : TCPlusObject; menu : TCPlusObject; frame : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AddItem'; +{function BMenu_AddList(AObject : TCPlusObject; list : BList; index : integer) : boolean; cdecl; external BePascalLibName name 'BMenu_AddList'; +function BMenu_AddSeparatorItem(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AddSeparatorItem'; +function BMenu_RemoveItem(AObject : TCPlusObject; item : bMenuItem) : boolean; cdecl; external BePascalLibName name 'BMenu_RemoveItem'; +function BMenu_RemoveItem(AObject : TCPlusObject; index : integer) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_RemoveItem'; +function BMenu_RemoveItems(AObject : TCPlusObject; index : integer; count : integer; del : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu_RemoveItems'; +function BMenu_RemoveItem(AObject : TCPlusObject; menu : BMenu) : boolean; cdecl; external BePascalLibName name 'BMenu_RemoveItem'; +function BMenu_ItemAt(AObject : TCPlusObject; index : integer) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_ItemAt'; +function BMenu_SubmenuAt(AObject : TCPlusObject; index : integer) : BMenu; cdecl; external BePascalLibName name 'BMenu_SubmenuAt'; +function BMenu_CountItems(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BMenu_CountItems'; +function BMenu_IndexOf(AObject : TCPlusObject; item : bMenuItem) : integer; cdecl; external BePascalLibName name 'BMenu_IndexOf'; +function BMenu_IndexOf(AObject : TCPlusObject; menu : BMenu) : integer; cdecl; external BePascalLibName name 'BMenu_IndexOf'; +function BMenu_FindItem(AObject : TCPlusObject; command : Cardinal) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_FindItem'; +function BMenu_FindItem(AObject : TCPlusObject; name : PChar) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_FindItem'; +function BMenu_SetTargetForItems(AObject : TCPlusObject; target : BHandler) : Status_t; cdecl; external BePascalLibName name 'BMenu_SetTargetForItems'; +function BMenu_SetTargetForItems(AObject : TCPlusObject; messenger : TMessenger) : Status_t; cdecl; external BePascalLibName name 'BMenu_SetTargetForItems'; +procedure BMenu_SetEnabled(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenu_SetEnabled'; +procedure BMenu_SetRadioMode(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenu_SetRadioMode'; +procedure BMenu_SetTriggersEnabled(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenu_SetTriggersEnabled'; +procedure BMenu_SetMaxContentWidth(AObject : TCPlusObject; max : double); cdecl; external BePascalLibName name 'BMenu_SetMaxContentWidth'; +procedure BMenu_SetLabelFromMarked(AObject : TCPlusObject; aOn : boolean); cdecl; external BePascalLibName name 'BMenu_SetLabelFromMarked'; +function BMenu_IsLabelFromMarked(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsLabelFromMarked'; +function BMenu_IsEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsEnabled'; +function BMenu_IsRadioMode(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsRadioMode'; +function BMenu_AreTriggersEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_AreTriggersEnabled'; +function BMenu_IsRedrawAfterSticky(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsRedrawAfterSticky'; +function BMenu_MaxContentWidth(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BMenu_MaxContentWidth'; +function BMenu_FindMarked(AObject : TCPlusObject) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_FindMarked'; +function BMenu_Supermenu(AObject : TCPlusObject) : BMenu; cdecl; external BePascalLibName name 'BMenu_Supermenu'; +function BMenu_Superitem(AObject : TCPlusObject) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_Superitem'; +procedure BMenu_MessageReceived(AObject : TCPlusObject; msg : BMessage); cdecl; external BePascalLibName name 'BMenu_MessageReceived'; +procedure BMenu_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BMenu_KeyDown'; +procedure BMenu_Draw(AObject : TCPlusObject; updateRect : BRect); cdecl; external BePascalLibName name 'BMenu_Draw'; +procedure BMenu_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BMenu_GetPreferredSize'; +procedure BMenu_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_ResizeToPreferred'; +procedure BMenu_FrameMoved(AObject : TCPlusObject; new_position : BPoint); cdecl; external BePascalLibName name 'BMenu_FrameMoved'; +procedure BMenu_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BMenu_FrameResized'; +procedure BMenu_InvalidateLayout(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_InvalidateLayout'; +function BMenu_ResolveSpecifier(AObject : TCPlusObject; msg : BMessage; index : integer; specifier : BMessage; form : integer; aProperty : PChar) : BHandler; cdecl; external BePascalLibName name 'BMenu_ResolveSpecifier'; +function BMenu_GetSupportedSuites(AObject : TCPlusObject; data : BMessage) : Status_t; cdecl; external BePascalLibName name 'BMenu_GetSupportedSuites'; +function BMenu_Perform(AObject : TCPlusObject; d : BPerform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BMenu_Perform'; +procedure BMenu_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenu_MakeFocus'; +procedure BMenu_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_AllAttached'; +procedure BMenu_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_AllDetached'; +function BMenu_Create(AObject : TBeObject; frame : BRect; viewName : PChar; resizeMask : Cardinal; flags : Cardinal; layout : TMenu_Layout; resizeToFit : boolean) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create'; +function BMenu_ScreenLocation(AObject : TCPlusObject) : BPoint; cdecl; external BePascalLibName name 'BMenu_ScreenLocation'; +procedure BMenu_SetItemMargins(AObject : TCPlusObject; left : double; top : double; right : double; bottom : double); cdecl; external BePascalLibName name 'BMenu_SetItemMargins'; +procedure BMenu_GetItemMargins(AObject : TCPlusObject; left : double; top : double; right : double; bottom : double); cdecl; external BePascalLibName name 'BMenu_GetItemMargins'; +function BMenu_Layout(AObject : TCPlusObject) : TMenu_Layout; cdecl; external BePascalLibName name 'BMenu_Layout'; +procedure BMenu_Show(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_Show'; +procedure BMenu_Show(AObject : TCPlusObject; selectFirstItem : boolean); cdecl; external BePascalLibName name 'BMenu_Show'; +procedure BMenu_Hide(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_Hide'; +function BMenu_Track(AObject : TCPlusObject; start_opened : boolean; special_rect : BRect) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_Track'; +} +//procedure BMenu_enum add_state { B_INITIAL_ADD, B_PROCESSING, B_ABORT }(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_enum add_state { B_INITIAL_ADD, B_PROCESSING, B_ABORT }'; +{function BMenu_AddDynamicItem(AObject : TCPlusObject; s : TAdd_State) : boolean; cdecl; external BePascalLibName name 'BMenu_AddDynamicItem'; +procedure BMenu_DrawBackground(AObject : TCPlusObject; update : BRect); cdecl; external BePascalLibName name 'BMenu_DrawBackground'; +procedure BMenu_SetTrackingHook(AObject : TCPlusObject; func : TMenu_Tracking_Hook; state : Pointer); cdecl; external BePascalLibName name 'BMenu_SetTrackingHook'; +procedure BMenu__ReservedMenu3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__ReservedMenu3'; +procedure BMenu__ReservedMenu4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__ReservedMenu4'; +procedure BMenu__ReservedMenu5(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__ReservedMenu5'; +procedure BMenu__ReservedMenu6(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__ReservedMenu6'; +function BMenu_operator=(AObject : TCPlusObject; : BMenu) : BMenu; cdecl; external BePascalLibName name 'BMenu_operator='; +procedure BMenu_InitData(AObject : TCPlusObject; data : BMessage); cdecl; external BePascalLibName name 'BMenu_InitData'; +function BMenu__show(AObject : TCPlusObject; selectFirstItem : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu__show'; +procedure BMenu__hide(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__hide'; +function BMenu__track(AObject : TCPlusObject; action : integer; start : integer) : bMenuItem; cdecl; external BePascalLibName name 'BMenu__track'; +function BMenu__AddItem(AObject : TCPlusObject; item : bMenuItem; index : integer) : boolean; cdecl; external BePascalLibName name 'BMenu__AddItem'; +function BMenu_RemoveItems(AObject : TCPlusObject; index : integer; count : integer; item : bMenuItem; del : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu_RemoveItems'; +procedure BMenu_LayoutItems(AObject : TCPlusObject; index : integer); cdecl; external BePascalLibName name 'BMenu_LayoutItems'; +procedure BMenu_ComputeLayout(AObject : TCPlusObject; index : integer; bestFit : boolean; moveItems : boolean; width : double; height : double); cdecl; external BePascalLibName name 'BMenu_ComputeLayout'; +function BMenu_Bump(AObject : TCPlusObject; current : BRect; extent : BPoint; index : integer) : BRect; cdecl; external BePascalLibName name 'BMenu_Bump'; +function BMenu_ItemLocInRect(AObject : TCPlusObject; frame : BRect) : BPoint; cdecl; external BePascalLibName name 'BMenu_ItemLocInRect'; +function BMenu_CalcFrame(AObject : TCPlusObject; where : BPoint; scrollOn : boolean) : BRect; cdecl; external BePascalLibName name 'BMenu_CalcFrame'; +function BMenu_ScrollMenu(AObject : TCPlusObject; bounds : BRect; loc : BPoint; fast : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu_ScrollMenu'; +procedure BMenu_ScrollIntoView(AObject : TCPlusObject; item : bMenuItem); cdecl; external BePascalLibName name 'BMenu_ScrollIntoView'; +procedure BMenu_DrawItems(AObject : TCPlusObject; updateRect : BRect); cdecl; external BePascalLibName name 'BMenu_DrawItems'; +function BMenu_State(AObject : TCPlusObject; item : bMenuItem) : integer; cdecl; external BePascalLibName name 'BMenu_State'; +procedure BMenu_InvokeItem(AObject : TCPlusObject; item : bMenuItem; now : boolean); cdecl; external BePascalLibName name 'BMenu_InvokeItem'; +function BMenu_OverSuper(AObject : TCPlusObject; loc : BPoint) : boolean; cdecl; external BePascalLibName name 'BMenu_OverSuper'; +function BMenu_OverSubmenu(AObject : TCPlusObject; item : bMenuItem; loc : BPoint) : boolean; cdecl; external BePascalLibName name 'BMenu_OverSubmenu'; +function BMenu_MenuWindow(AObject : TCPlusObject) : TMenuWindow; cdecl; external BePascalLibName name 'BMenu_MenuWindow'; +procedure BMenu_DeleteMenuWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_DeleteMenuWindow'; +function BMenu_HitTestItems(AObject : TCPlusObject; where : BPoint; slop : BPoint) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_HitTestItems'; +function BMenu_Superbounds(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BMenu_Superbounds'; +procedure BMenu_CacheFontInfo(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_CacheFontInfo'; +procedure BMenu_ItemMarked(AObject : TCPlusObject; item : bMenuItem); cdecl; external BePascalLibName name 'BMenu_ItemMarked'; +procedure BMenu_Install(AObject : TCPlusObject; target : TWindow); cdecl; external BePascalLibName name 'BMenu_Install'; +procedure BMenu_Uninstall(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_Uninstall'; +procedure BMenu_SelectItem(AObject : TCPlusObject; m : bMenuItem; showSubmenu : Cardinal; selectFirstItem : boolean); cdecl; external BePascalLibName name 'BMenu_SelectItem'; +function BMenu_CurrentSelection(AObject : TCPlusObject) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_CurrentSelection'; +function BMenu_SelectNextItem(AObject : TCPlusObject; item : bMenuItem; forward : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu_SelectNextItem'; +function BMenu_NextItem(AObject : TCPlusObject; item : bMenuItem; forward : boolean) : bMenuItem; cdecl; external BePascalLibName name 'BMenu_NextItem'; +function BMenu_IsItemVisible(AObject : TCPlusObject; item : bMenuItem) : boolean; cdecl; external BePascalLibName name 'BMenu_IsItemVisible'; +procedure BMenu_SetIgnoreHidden(AObject : TCPlusObject; aOn : boolean); cdecl; external BePascalLibName name 'BMenu_SetIgnoreHidden'; +procedure BMenu_SetStickyMode(AObject : TCPlusObject; aOn : boolean); cdecl; external BePascalLibName name 'BMenu_SetStickyMode'; +function BMenu_IsStickyMode(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsStickyMode'; +procedure BMenu_CalcTriggers(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_CalcTriggers'; +function BMenu_ChooseTrigger(AObject : TCPlusObject; title : PChar; chars : BList) : PChar; cdecl; external BePascalLibName name 'BMenu_ChooseTrigger'; +procedure BMenu_UpdateWindowViewSize(AObject : TCPlusObject; upWind : boolean); cdecl; external BePascalLibName name 'BMenu_UpdateWindowViewSize'; +function BMenu_IsStickyPrefOn(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMenu_IsStickyPrefOn'; +procedure BMenu_RedrawAfterSticky(AObject : TCPlusObject; bounds : BRect); cdecl; external BePascalLibName name 'BMenu_RedrawAfterSticky'; +function BMenu_OkToProceed(AObject : TCPlusObject; : bMenuItem) : boolean; cdecl; external BePascalLibName name 'BMenu_OkToProceed'; +function BMenu_ParseMsg(AObject : TCPlusObject; msg : BMessage; sindex : ^integer; spec : BMessage; form : ^integer; prop : PChar; BMenu : TMenu; titem : bMenuItem; user_data : ^integer; reply : BMessage) : Status_t; cdecl; external BePascalLibName name 'BMenu_ParseMsg'; +function BMenu_DoMenuMsg(AObject : TCPlusObject; next : bMenuItem; tar : BMenu; m : BMessage; r : BMessage; spec : BMessage; f : integer) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoMenuMsg'; +function BMenu_DoMenuItemMsg(AObject : TCPlusObject; next : bMenuItem; tar : BMenu; m : BMessage; r : BMessage; spec : BMessage; f : integer) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoMenuItemMsg'; +function BMenu_DoEnabledMsg(AObject : TCPlusObject; ti : bMenuItem; tm : BMenu; m : BMessage; r : BMessage) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoEnabledMsg'; +function BMenu_DoLabelMsg(AObject : TCPlusObject; ti : bMenuItem; tm : BMenu; m : BMessage; r : BMessage) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoLabelMsg'; +function BMenu_DoMarkMsg(AObject : TCPlusObject; ti : bMenuItem; tm : BMenu; m : BMessage; r : BMessage) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoMarkMsg'; +function BMenu_DoDeleteMsg(AObject : TCPlusObject; ti : bMenuItem; tm : BMenu; m : BMessage; r : BMessage) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoDeleteMsg'; +function BMenu_DoCreateMsg(AObject : TCPlusObject; ti : bMenuItem; tm : BMenu; m : BMessage; r : BMessage; menu : boolean) : Status_t; cdecl; external BePascalLibName name 'BMenu_DoCreateMsg'; +procedure BMenu_menu_info sMenuInfo(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_menu_info sMenuInfo'; +procedure BMenu_bool sSwapped(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool sSwapped'; +procedure BMenu_BMenuItem *fChosenItem(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BMenuItem *fChosenItem'; +procedure BMenu_BList fItems(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BList fItems'; +procedure BMenu_BRect fPad(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BRect fPad'; +procedure BMenu_BMenuItem *fSelected(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BMenuItem *fSelected'; +procedure BMenu_BMenuWindow *fCachedMenuWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BMenuWindow *fCachedMenuWindow'; +procedure BMenu_BMenu *fSuper(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BMenu *fSuper'; +procedure BMenu_BMenuItem *fSuperitem(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BMenuItem *fSuperitem'; +procedure BMenu_BRect fSuperbounds(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BRect fSuperbounds'; +procedure BMenu_float fAscent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_float fAscent'; +procedure BMenu_float fDescent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_float fDescent'; +procedure BMenu_float fFontHeight(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_float fFontHeight'; +procedure BMenu_uint32 fState(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_uint32 fState'; +procedure BMenu_menu_layout fLayout(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_menu_layout fLayout'; +procedure BMenu_BRect *fExtraRect(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BRect *fExtraRect'; +procedure BMenu_float fMaxContentWidth(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_float fMaxContentWidth'; +procedure BMenu_BPoint *fInitMatrixSize(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_BPoint *fInitMatrixSize'; +procedure BMenu__ExtraMenuData_ *fExtraMenuData(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu__ExtraMenuData_ *fExtraMenuData'; +procedure BMenu_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_uint32 _reserved[2]'; +procedure BMenu_char fTrigger(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_char fTrigger'; +procedure BMenu_bool fResizeToFit(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fResizeToFit'; +procedure BMenu_bool fUseCachedMenuLayout(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fUseCachedMenuLayout'; +procedure BMenu_bool fEnabled(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fEnabled'; +procedure BMenu_bool fDynamicName(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fDynamicName'; +procedure BMenu_bool fRadioMode(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fRadioMode'; +procedure BMenu_bool fTrackNewBounds(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fTrackNewBounds'; +procedure BMenu_bool fStickyMode(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fStickyMode'; +procedure BMenu_bool fIgnoreHidden(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fIgnoreHidden'; +procedure BMenu_bool fTriggerEnabled(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fTriggerEnabled'; +procedure BMenu_bool fRedrawAfterSticky(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fRedrawAfterSticky'; +procedure BMenu_bool fAttachAborted(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_bool fAttachAborted'; +} + +implementation + +{procedure PMenu_Info.float font_size; +begin + menu_info_float font_size(CPlusObject); +end; + +procedure PMenu_Info.font_family f_family; +begin + menu_info_font_family f_family(CPlusObject); +end; + +procedure PMenu_Info.font_style f_style; +begin + menu_info_font_style f_style(CPlusObject); +end; + +procedure PMenu_Info.rgb_color background_color; +begin + menu_info_rgb_color background_color(CPlusObject); +end; + +procedure PMenu_Info.int32 separator; +begin + menu_info_int32 separator(CPlusObject); +end; + +procedure PMenu_Info.bool click_to_open; +begin + menu_info_bool click_to_open(CPlusObject); +end; + +procedure PMenu_Info.bool triggers_always_shown; +begin + menu_info_bool triggers_always_shown(CPlusObject); +end; +} +{constructor BMenu.Create; +begin + CPlusObject := BMenu_Create_0(Self); +end; +} + +constructor BMenu.Create(title : PChar; width : double; height : double); +begin + CPlusObject := BMenu_Create(Self, title, width, height); +end; + +constructor BMenu.Create(title : PChar; layout : Menu_Layout); +begin +// CPlusObject := BMenu_Create(Self, title, 0); + + case layout of + B_ITEMS_IN_ROW : CPlusObject := BMenu_Create(Self, title, 0); + B_ITEMS_IN_COLUMN : CPlusObject := BMenu_Create(Self, title, 1); + B_ITEMS_IN_MATRIX : CPlusObject := BMenu_Create(Self, title, 2); + end; +end; + + +destructor BMenu.Destroy; +begin + BMenu_Free(CPlusObject); +end; + +{constructor BMenu.Create(data : BMessage); +begin + CPlusObject := BMenu_Create(Self, data.CPlusObject); +end; +} + +function BMenu.Instantiate(data : BMessage) : BArchivable; +begin + Result := BMenu_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BMenu.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BMenu_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BMenu.AttachedToWindow; +begin +// BMenu_AttachedToWindow(CPlusObject); +end; + +procedure BMenu.DetachedFromWindow; +begin +// BMenu_DetachedFromWindow(CPlusObject); +end; + + +function BMenu.AddItem(item : bMenuItem) : boolean; +begin + SendText('function BMenu.AddItem(item : bMenuItem) : boolean;'); + Result := BMenu_AddItem_1(CPlusObject, item.CPlusObject); +end; + +function BMenu.AddItem(item : bMenuItem; index : integer) : boolean; +begin + SendText('function BMenu.AddItem(item : bMenuItem; index : integer) : boolean;'); + Result := BMenu_AddItem_2(CPlusObject, item.CPlusObject, index); +end; + +function BMenu.AddItem(item : bMenuItem; frame : BRect) : boolean; +begin + SendText('ici'); + SendText('function BMenu.AddItem(item : bMenuItem; frame : BRect) : boolean;'); + frame.PrintToStream; + SendText('toto'); + Result := BMenu_AddItem_3(CPlusObject, item.CPlusObject, frame.CPlusObject); +end; + +function BMenu.AddItem(menu : BMenu) : boolean; +begin + SendText('function BMenu.AddItem(menu : BMenu) : boolean;'); + SendText('Bonjour'); + Result := BMenu_AddItem_4(CPlusObject, menu.CPlusObject); +end; + +function BMenu.AddItem(menu : BMenu; index : integer) : boolean; +begin + SendText('function BMenu.AddItem(menu : BMenu; index : integer) : boolean;'); + Result := BMenu_AddItem_5(CPlusObject, menu.CPlusObject, index); +end; + +function BMenu.AddItem(menu : BMenu; frame : BRect) : boolean; +begin + SendText('function BMenu.AddItem(menu : BMenu; frame : BRect) : boolean;'); + Result := BMenu_AddItem_6(CPlusObject, menu.CPlusObject, frame.CPlusObject); +end; + + +{function BMenu.AddItem(item : bMenuItem) : boolean; +begin + SendText('function BMenu.AddItem(item : bMenuItem) : boolean;'); + Result := BMenu_AddItem_1(CPlusObject, item.CPlusObject); +end; + +function BMenu.AddItem(item : bMenuItem; index : integer) : boolean; +begin + SendText('function BMenu.AddItem(item : bMenuItem; index : integer) : boolean;'); + Result := BMenu_AddItem_2(CPlusObject, item.CPlusObject, index); +end; + +function BMenu.AddItem(item : bMenuItem; frame : BRect) : boolean; +begin + SendText('ici'); + SendText('function BMenu.AddItem(item : bMenuItem; frame : BRect) : boolean;'); + frame.PrintToStream; + SendText('toto'); + Result := BMenu_AddItem_3(CPlusObject, item.CPlusObject, frame.CPlusObject); +end; + +function BMenu.AddItem(menu : BMenu) : boolean; +begin + SendText('function BMenu.AddItem(menu : BMenu) : boolean;'); + SendText('Bonjour'); + Result := BMenu_AddItem_4(CPlusObject, menu.CPlusObject); +end; + +function BMenu.AddItem(menu : BMenu; index : integer) : boolean; +begin + SendText('function BMenu.AddItem(menu : BMenu; index : integer) : boolean;'); + Result := BMenu_AddItem_5(CPlusObject, menu.CPlusObject, index); +end; + +function BMenu.AddItem(menu : BMenu; frame : BRect) : boolean; +begin + SendText('function BMenu.AddItem(menu : BMenu; frame : BRect) : boolean;'); + Result := BMenu_AddItem_6(CPlusObject, menu.CPlusObject, frame.CPlusObject); +end; +} + +function BMenu.AddList(list : BList; index : integer) : boolean; +begin + Result := BMenu_AddList(CPlusObject, list.CPlusObject, index); +end; + +function BMenu.AddSeparatorItem : boolean; +begin + Result := BMenu_AddSeparatorItem(CPlusObject); +end; + +function BMenu.RemoveItem(item : bMenuItem) : boolean; +begin + Result := BMenu_RemoveItem(CPlusObject, item.CPlusObject); +end; + +function BMenu.RemoveItem(index : integer) : bMenuItem; +begin + Result := BMenu_RemoveItem(CPlusObject, index); +end; + +function BMenu.RemoveItems(index : integer; count : integer; del : boolean) : boolean; +begin + Result := BMenu_RemoveItems(CPlusObject, index, count, del); +end; + +function BMenu.RemoveItem(menu : BMenu) : boolean; +begin + Result := BMenu_RemoveItem(CPlusObject, menu.CPlusObject); +end; + +function BMenu.ItemAt(index : integer) : bMenuItem; +begin + Result := BMenu_ItemAt(CPlusObject, index); +end; + +function BMenu.SubmenuAt(index : integer) : BMenu; +begin + Result := BMenu_SubmenuAt(CPlusObject, index); +end; + +function BMenu.CountItems : integer; +begin + Result := BMenu_CountItems(CPlusObject); +end; + +function BMenu.IndexOf(item : bMenuItem) : integer; +begin + Result := BMenu_IndexOf(CPlusObject, item.CPlusObject); +end; + +function BMenu.IndexOf(menu : BMenu) : integer; +begin + Result := BMenu_IndexOf(CPlusObject, menu.CPlusObject); +end; + +function BMenu.FindItem(command : Cardinal) : bMenuItem; +begin + Result := BMenu_FindItem(CPlusObject, command); +end; + +function BMenu.FindItem(name : PChar) : bMenuItem; +begin + Result := BMenu_FindItem(CPlusObject, name); +end; + +function BMenu.SetTargetForItems(target : BHandler) : Status_t; +begin + Result := BMenu_SetTargetForItems(CPlusObject, target.CPlusObject); +end; + +function BMenu.SetTargetForItems(messenger : BMessenger) : Status_t; +begin + Result := BMenu_SetTargetForItems(CPlusObject, messenger.CPlusObject); +end; + +procedure BMenu.SetEnabled(state : boolean); +begin +// BMenu_SetEnabled(CPlusObject, state); +end; + +procedure BMenu.SetRadioMode(state : boolean); +begin + BMenu_SetRadioMode(CPlusObject, state); +end; + +procedure BMenu.SetTriggersEnabled(state : boolean); +begin + BMenu_SetTriggersEnabled(CPlusObject, state); +end; + +procedure BMenu.SetMaxContentWidth(max : double); +begin + BMenu_SetMaxContentWidth(CPlusObject, max); +end; + +procedure BMenu.SetLabelFromMarked(aOn : boolean); +begin + BMenu_SetLabelFromMarked(CPlusObject, aOn); +end; + +function BMenu.IsLabelFromMarked : boolean; +begin + Result := BMenu_IsLabelFromMarked(CPlusObject); +end; + +function BMenu.IsEnabled : boolean; +begin + Result := BMenu_IsEnabled(CPlusObject); +end; + +function BMenu.IsRadioMode : boolean; +begin + Result := BMenu_IsRadioMode(CPlusObject); +end; + +function BMenu.AreTriggersEnabled : boolean; +begin + Result := BMenu_AreTriggersEnabled(CPlusObject); +end; + +function BMenu.IsRedrawAfterSticky : boolean; +begin + Result := BMenu_IsRedrawAfterSticky(CPlusObject); +end; + +function BMenu.MaxContentWidth : double; +begin + Result := BMenu_MaxContentWidth(CPlusObject); +end; + +function BMenu.FindMarked : bMenuItem; +begin + Result := BMenu_FindMarked(CPlusObject); +end; + +function BMenu.Supermenu : BMenu; +begin + Result := BMenu_Supermenu(CPlusObject); +end; + +function BMenu.Superitem : bMenuItem; +begin + Result := BMenu_Superitem(CPlusObject); +end; + +procedure BMenu.MessageReceived(msg : BMessage); +begin +// BMenu_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BMenu.KeyDown(bytes : PChar; numBytes : integer); +begin +// BMenu_KeyDown(CPlusObject, bytes, numBytes); +end; + +procedure BMenu.Draw(updateRect : BRect); +begin +// BMenu_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure BMenu.GetPreferredSize(width : double; height : double); +begin +// BMenu_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BMenu.ResizeToPreferred; +begin +// BMenu_ResizeToPreferred(CPlusObject); +end; + +procedure BMenu.FrameMoved(new_position : BPoint); +begin +// BMenu_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BMenu.FrameResized(new_width : double; new_height : double); +begin +// BMenu_FrameResized(CPlusObject, new_width, new_height); +end; + +procedure BMenu.InvalidateLayout; +begin + BMenu_InvalidateLayout(CPlusObject); +end; + +function BMenu.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; aProperty : PChar) : BHandler; +begin + Result := BMenu_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, aProperty); +end; + +function BMenu.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BMenu_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BMenu.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BMenu_Perform(CPlusObject, d, arg); +end; + +procedure BMenu.MakeFocus(state : boolean); +begin +// BMenu_MakeFocus(CPlusObject, state); +end; + +procedure BMenu.AllAttached; +begin +// BMenu_AllAttached(CPlusObject); +end; + +procedure BMenu.AllDetached; +begin +// BMenu_AllDetached(CPlusObject); +end; + +{ +constructor BMenu.Create(frame : BRect; viewName : PChar; resizeMask : Cardinal; flags : Cardinal; layout : TMenu_Layout; resizeToFit : boolean); +begin + CPlusObject := BMenu_Create(Self, frame.CPlusObject, viewName, resizeMask, flags, layout, resizeToFit); +end; + +function BMenu.ScreenLocation : BPoint; +begin + Result := BMenu_ScreenLocation(CPlusObject); +end; + +procedure BMenu.SetItemMargins(left : double; top : double; right : double; bottom : double); +begin + BMenu_SetItemMargins(CPlusObject, left, top, right, bottom); +end; + +procedure BMenu.GetItemMargins(left : double; top : double; right : double; bottom : double); +begin + BMenu_GetItemMargins(CPlusObject, left, top, right, bottom); +end; + +function BMenu.Layout : TMenu_Layout; +begin + Result := BMenu_Layout(CPlusObject); +end; + +procedure BMenu.Show; +begin + BMenu_Show(CPlusObject); +end; + +procedure BMenu.Show(selectFirstItem : boolean); +begin + BMenu_Show(CPlusObject, selectFirstItem); +end; + +procedure BMenu.Hide; +begin + BMenu_Hide(CPlusObject); +end; + +function BMenu.Track(start_opened : boolean; special_rect : BRect) : bMenuItem; +begin + Result := BMenu_Track(CPlusObject, start_opened, special_rect.CPlusObject); +end; +} + +//procedure BMenu.enum add_state { B_INITIAL_ADD, B_PROCESSING, B_ABORT }; +//begin +// BMenu_enum add_state { B_INITIAL_ADD, B_PROCESSING, B_ABORT }(CPlusObject); +//end; + +{ +function BMenu.AddDynamicItem(s : TAdd_State) : boolean; +begin + Result := BMenu_AddDynamicItem(CPlusObject, s); +end; + +procedure BMenu.DrawBackground(update : BRect); +begin + BMenu_DrawBackground(CPlusObject, update.CPlusObject); +end; + +procedure BMenu.SetTrackingHook(func : TMenu_Tracking_Hook; state : Pointer); +begin + BMenu_SetTrackingHook(CPlusObject, func, state); +end; + +procedure BMenu._ReservedMenu3; +begin + BMenu__ReservedMenu3(CPlusObject); +end; + +procedure BMenu._ReservedMenu4; +begin + BMenu__ReservedMenu4(CPlusObject); +end; + +procedure BMenu._ReservedMenu5; +begin + BMenu__ReservedMenu5(CPlusObject); +end; + +procedure BMenu._ReservedMenu6; +begin + BMenu__ReservedMenu6(CPlusObject); +end; + +function BMenu.operator=( : BMenu) : BMenu; +begin + Result := BMenu_operator=(CPlusObject, ); +end; + +procedure BMenu.InitData(data : BMessage); +begin + BMenu_InitData(CPlusObject, data.CPlusObject); +end; + +function BMenu._show(selectFirstItem : boolean) : boolean; +begin + Result := BMenu__show(CPlusObject, selectFirstItem); +end; + +procedure BMenu._hide; +begin + BMenu__hide(CPlusObject); +end; + +function BMenu._track(action : integer; start : integer) : bMenuItem; +begin + Result := BMenu__track(CPlusObject, action, start); +end; + +function BMenu._AddItem(item : bMenuItem; index : integer) : boolean; +begin + Result := BMenu__AddItem(CPlusObject, item.CPlusObject, index); +end; + +function BMenu.RemoveItems(index : integer; count : integer; item : bMenuItem; del : boolean) : boolean; +begin + Result := BMenu_RemoveItems(CPlusObject, index, count, item.CPlusObject, del); +end; + +procedure BMenu.LayoutItems(index : integer); +begin + BMenu_LayoutItems(CPlusObject, index); +end; + +procedure BMenu.ComputeLayout(index : integer; bestFit : boolean; moveItems : boolean; width : double; height : double); +begin + BMenu_ComputeLayout(CPlusObject, index, bestFit, moveItems, width, height); +end; + +function BMenu.Bump(current : BRect; extent : BPoint; index : integer) : BRect; +begin + Result := BMenu_Bump(CPlusObject, current.CPlusObject, extent.CPlusObject, index); +end; + +function BMenu.ItemLocInRect(frame : BRect) : BPoint; +begin + Result := BMenu_ItemLocInRect(CPlusObject, frame.CPlusObject); +end; + +function BMenu.CalcFrame(where : BPoint; scrollOn : boolean) : BRect; +begin + Result := BMenu_CalcFrame(CPlusObject, where.CPlusObject, scrollOn); +end; + +function BMenu.ScrollMenu(bounds : BRect; loc : BPoint; fast : boolean) : boolean; +begin + Result := BMenu_ScrollMenu(CPlusObject, bounds.CPlusObject, loc.CPlusObject, fast); +end; + +procedure BMenu.ScrollIntoView(item : bMenuItem); +begin + BMenu_ScrollIntoView(CPlusObject, item.CPlusObject); +end; + +procedure BMenu.DrawItems(updateRect : BRect); +begin + BMenu_DrawItems(CPlusObject, updateRect.CPlusObject); +end; + +function BMenu.State(item : bMenuItem) : integer; +begin + Result := BMenu_State(CPlusObject, item.CPlusObject); +end; + +procedure BMenu.InvokeItem(item : bMenuItem; now : boolean); +begin + BMenu_InvokeItem(CPlusObject, item.CPlusObject, now); +end; + +function BMenu.OverSuper(loc : BPoint) : boolean; +begin + Result := BMenu_OverSuper(CPlusObject, loc.CPlusObject); +end; + +function BMenu.OverSubmenu(item : bMenuItem; loc : BPoint) : boolean; +begin + Result := BMenu_OverSubmenu(CPlusObject, item.CPlusObject, loc.CPlusObject); +end; + +function BMenu.MenuWindow : TMenuWindow; +begin + Result := BMenu_MenuWindow(CPlusObject); +end; + +procedure BMenu.DeleteMenuWindow; +begin + BMenu_DeleteMenuWindow(CPlusObject); +end; + +function BMenu.HitTestItems(where : BPoint; slop : BPoint) : bMenuItem; +begin + Result := BMenu_HitTestItems(CPlusObject, where.CPlusObject, slop.CPlusObject); +end; + +function BMenu.Superbounds : BRect; +begin + Result := BMenu_Superbounds(CPlusObject); +end; + +procedure BMenu.CacheFontInfo; +begin + BMenu_CacheFontInfo(CPlusObject); +end; + +procedure BMenu.ItemMarked(item : bMenuItem); +begin + BMenu_ItemMarked(CPlusObject, item.CPlusObject); +end; + +procedure BMenu.Install(target : TWindow); +begin + BMenu_Install(CPlusObject, target.CPlusObject); +end; + +procedure BMenu.Uninstall; +begin + BMenu_Uninstall(CPlusObject); +end; + +procedure BMenu.SelectItem(m : bMenuItem; showSubmenu : Cardinal; selectFirstItem : boolean); +begin + BMenu_SelectItem(CPlusObject, m.CPlusObject, showSubmenu, selectFirstItem); +end; + +function BMenu.CurrentSelection : bMenuItem; +begin + Result := BMenu_CurrentSelection(CPlusObject); +end; + +function BMenu.SelectNextItem(item : bMenuItem; forward : boolean) : boolean; +begin + Result := BMenu_SelectNextItem(CPlusObject, item.CPlusObject, forward); +end; + +function BMenu.NextItem(item : bMenuItem; forward : boolean) : bMenuItem; +begin + Result := BMenu_NextItem(CPlusObject, item.CPlusObject, forward); +end; + +function BMenu.IsItemVisible(item : bMenuItem) : boolean; +begin + Result := BMenu_IsItemVisible(CPlusObject, item.CPlusObject); +end; + +procedure BMenu.SetIgnoreHidden(aOn : boolean); +begin + BMenu_SetIgnoreHidden(CPlusObject, aOn); +end; + +procedure BMenu.SetStickyMode(aOn : boolean); +begin + BMenu_SetStickyMode(CPlusObject, aOn); +end; + +function BMenu.IsStickyMode : boolean; +begin + Result := BMenu_IsStickyMode(CPlusObject); +end; + +procedure BMenu.CalcTriggers; +begin + BMenu_CalcTriggers(CPlusObject); +end; + +function BMenu.ChooseTrigger(title : PChar; chars : BList) : PChar; +begin + Result := BMenu_ChooseTrigger(CPlusObject, title, chars.CPlusObject); +end; + +procedure BMenu.UpdateWindowViewSize(upWind : boolean); +begin + BMenu_UpdateWindowViewSize(CPlusObject, upWind); +end; + +function BMenu.IsStickyPrefOn : boolean; +begin + Result := BMenu_IsStickyPrefOn(CPlusObject); +end; + +procedure BMenu.RedrawAfterSticky(bounds : BRect); +begin + BMenu_RedrawAfterSticky(CPlusObject, bounds.CPlusObject); +end; + +function BMenu.OkToProceed( : bMenuItem) : boolean; +begin + Result := BMenu_OkToProceed(CPlusObject, .CPlusObject); +end; + +function BMenu.ParseMsg(msg : BMessage; sindex : ^integer; spec : BMessage; form : ^integer; prop : PChar; BMenu : BMenu; titem : bMenuItem; user_data : ^integer; reply : BMessage) : Status_t; +begin + Result := BMenu_ParseMsg(CPlusObject, msg.CPlusObject, sindex, spec.CPlusObject, form, prop, BMenu.CPlusObject, titem.CPlusObject, user_data, reply.CPlusObject); +end; + +function BMenu.DoMenuMsg(next : bMenuItem; tar : BMenu; m : BMessage; r : BMessage; spec : BMessage; f : integer) : Status_t; +begin + Result := BMenu_DoMenuMsg(CPlusObject, next.CPlusObject, tar.CPlusObject, m.CPlusObject, r.CPlusObject, spec.CPlusObject, f); +end; + +function BMenu.DoMenuItemMsg(next : bMenuItem; tar : BMenu; m : BMessage; r : BMessage; spec : BMessage; f : integer) : Status_t; +begin + Result := BMenu_DoMenuItemMsg(CPlusObject, next.CPlusObject, tar.CPlusObject, m.CPlusObject, r.CPlusObject, spec.CPlusObject, f); +end; + +function BMenu.DoEnabledMsg(ti : bMenuItem; tm : BMenu; m : BMessage; r : BMessage) : Status_t; +begin + Result := BMenu_DoEnabledMsg(CPlusObject, ti.CPlusObject, tm.CPlusObject, m.CPlusObject, r.CPlusObject); +end; + +function BMenu.DoLabelMsg(ti : bMenuItem; tm : BMenu; m : BMessage; r : BMessage) : Status_t; +begin + Result := BMenu_DoLabelMsg(CPlusObject, ti.CPlusObject, tm.CPlusObject, m.CPlusObject, r.CPlusObject); +end; + +function BMenu.DoMarkMsg(ti : bMenuItem; tm : BMenu; m : BMessage; r : BMessage) : Status_t; +begin + Result := BMenu_DoMarkMsg(CPlusObject, ti.CPlusObject, tm.CPlusObject, m.CPlusObject, r.CPlusObject); +end; + +function BMenu.DoDeleteMsg(ti : bMenuItem; tm : BMenu; m : BMessage; r : BMessage) : Status_t; +begin + Result := BMenu_DoDeleteMsg(CPlusObject, ti.CPlusObject, tm.CPlusObject, m.CPlusObject, r.CPlusObject); +end; + +function BMenu.DoCreateMsg(ti : bMenuItem; tm : BMenu; m : BMessage; r : BMessage; menu : boolean) : Status_t; +begin + Result := BMenu_DoCreateMsg(CPlusObject, ti.CPlusObject, tm.CPlusObject, m.CPlusObject, r.CPlusObject, menu); +end; + +procedure BMenu.menu_info sMenuInfo; +begin + BMenu_menu_info sMenuInfo(CPlusObject); +end; + +procedure BMenu.bool sSwapped; +begin + BMenu_bool sSwapped(CPlusObject); +end; + +procedure BMenu.BMenuItem *fChosenItem; +begin + BMenu_BMenuItem *fChosenItem(CPlusObject); +end; + +procedure BMenu.BList fItems; +begin + BMenu_BList fItems(CPlusObject); +end; + +procedure BMenu.BRect fPad; +begin + BMenu_BRect fPad(CPlusObject); +end; + +procedure BMenu.BMenuItem *fSelected; +begin + BMenu_BMenuItem *fSelected(CPlusObject); +end; + +procedure BMenu.BMenuWindow *fCachedMenuWindow; +begin + BMenu_BMenuWindow *fCachedMenuWindow(CPlusObject); +end; + +procedure BMenu.BMenu *fSuper; +begin + BMenu_BMenu *fSuper(CPlusObject); +end; + +procedure BMenu.BMenuItem *fSuperitem; +begin + BMenu_BMenuItem *fSuperitem(CPlusObject); +end; + +procedure BMenu.BRect fSuperbounds; +begin + BMenu_BRect fSuperbounds(CPlusObject); +end; + +procedure BMenu.float fAscent; +begin + BMenu_float fAscent(CPlusObject); +end; + +procedure BMenu.float fDescent; +begin + BMenu_float fDescent(CPlusObject); +end; + +procedure BMenu.float fFontHeight; +begin + BMenu_float fFontHeight(CPlusObject); +end; + +procedure BMenu.uint32 fState; +begin + BMenu_uint32 fState(CPlusObject); +end; + +procedure BMenu.menu_layout fLayout; +begin + BMenu_menu_layout fLayout(CPlusObject); +end; + +procedure BMenu.BRect *fExtraRect; +begin + BMenu_BRect *fExtraRect(CPlusObject); +end; + +procedure BMenu.float fMaxContentWidth; +begin + BMenu_float fMaxContentWidth(CPlusObject); +end; + +procedure BMenu.BPoint *fInitMatrixSize; +begin + BMenu_BPoint *fInitMatrixSize(CPlusObject); +end; + +procedure BMenu._ExtraMenuData_ *fExtraMenuData; +begin + BMenu__ExtraMenuData_ *fExtraMenuData(CPlusObject); +end; + +procedure BMenu.uint32 _reserved[2]; +begin + BMenu_uint32 _reserved[2](CPlusObject); +end; + +procedure BMenu.char fTrigger; +begin + BMenu_char fTrigger(CPlusObject); +end; + +procedure BMenu.bool fResizeToFit; +begin + BMenu_bool fResizeToFit(CPlusObject); +end; + +procedure BMenu.bool fUseCachedMenuLayout; +begin + BMenu_bool fUseCachedMenuLayout(CPlusObject); +end; + +procedure BMenu.bool fEnabled; +begin + BMenu_bool fEnabled(CPlusObject); +end; + +procedure BMenu.bool fDynamicName; +begin + BMenu_bool fDynamicName(CPlusObject); +end; + +procedure BMenu.bool fRadioMode; +begin + BMenu_bool fRadioMode(CPlusObject); +end; + +procedure BMenu.bool fTrackNewBounds; +begin + BMenu_bool fTrackNewBounds(CPlusObject); +end; + +procedure BMenu.bool fStickyMode; +begin + BMenu_bool fStickyMode(CPlusObject); +end; + +procedure BMenu.bool fIgnoreHidden; +begin + BMenu_bool fIgnoreHidden(CPlusObject); +end; + +procedure BMenu.bool fTriggerEnabled; +begin + BMenu_bool fTriggerEnabled(CPlusObject); +end; + +procedure BMenu.bool fRedrawAfterSticky; +begin + BMenu_bool fRedrawAfterSticky(CPlusObject); +end; + +procedure BMenu.bool fAttachAborted; +begin + BMenu_bool fAttachAborted(CPlusObject); +end; +} + +constructor bMenuItem.Create; +begin +// CPlusObject := BMenuItem_Create(Self); +end; + +constructor bMenuItem.Create(aMenu : BMenu; message : BMessage); +begin + CPlusObject := BMenuItem_Create(Self, menu.CPlusObject, message.CPlusObject); +end; + +constructor bMenuItem.Create(data : BMessage); +begin + CPlusObject := BMenuItem_Create(Self, data.CPlusObject); +end; + +constructor bMenuItem.Create(aLabel : PChar; message : BMessage; aShortcut : Char; modifiers : Cardinal); +begin + CPlusObject := BMenuItem_Create(Self, aLabel, message.CPlusObject, aShortcut, modifiers); +end; + +destructor bMenuItem.Destroy; +begin + BMenuItem_Free(CPlusObject); + inherited; +end; + +function bMenuItem.Instantiate(data : BMessage) : BArchivable; +begin + Result := BMenuItem_Instantiate(CPlusObject, data.CPlusObject); +end; + +function bMenuItem.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BMenuItem_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure bMenuItem.SetLabel(name : PChar); +begin + BMenuItem_SetLabel(CPlusObject, name); +end; + +procedure bMenuItem.SetEnabled(state : boolean); +begin +// BMenuItem_SetEnabled(CPlusObject, state); +end; + +procedure bMenuItem.SetMarked(state : boolean); +begin + BMenuItem_SetMarked(CPlusObject, state); +end; + +procedure bMenuItem.SetTrigger(ch : Char); +begin + BMenuItem_SetTrigger(CPlusObject, ch); +end; + +procedure bMenuItem.SetShortcut(ch : Char; modifiers : Cardinal); +begin + BMenuItem_SetShortcut(CPlusObject, ch, modifiers); +end; + +{function bMenuItem.aLabel : PChar; +begin + Result := BMenuItem_Label(CPlusObject); +end; +} + +function bMenuItem.IsEnabled : boolean; +begin + Result := BMenuItem_IsEnabled(CPlusObject); +end; + +function bMenuItem.IsMarked : boolean; +begin + Result := BMenuItem_IsMarked(CPlusObject); +end; + +function bMenuItem.Trigger : Char; +begin + Result := BMenuItem_Trigger(CPlusObject); +end; + +{function bMenuItem.Shortcut(modifiers : Cardinal) : Char; +begin + Result := BMenuItem_Shortcut(CPlusObject, modifiers); +end;} + +function bMenuItem.Submenu : BMenu; +begin + Result := BMenuItem_Submenu(CPlusObject); +end; + +function bMenuItem.Menu : BMenu; +begin + Result := BMenuItem_Menu(CPlusObject); +end; + +function bMenuItem.Frame : BRect; +begin + Result := BMenuItem_Frame(CPlusObject); +end; + +{ +procedure bMenuItem.GetContentSize(width : double; height : double); +begin + BMenuItem_GetContentSize(CPlusObject, width, height); +end; + +procedure bMenuItem.TruncateLabel(max : double; new_label : PChar); +begin + BMenuItem_TruncateLabel(CPlusObject, max, new_label); +end; + +procedure bMenuItem.DrawContent; +begin +// BMenuItem_DrawContent(CPlusObject); +end; + +procedure bMenuItem.Draw; +begin +// BMenuItem_Draw(CPlusObject); +end; + +procedure bMenuItem.Highlight(aOn : boolean); +begin + BMenuItem_Highlight(CPlusObject, aOn); +end; + +function bMenuItem.IsSelected : boolean; +begin + Result := BMenuItem_IsSelected(CPlusObject); +end; + +function bMenuItem.ContentLocation : BPoint; +begin + Result := BMenuItem_ContentLocation(CPlusObject); +end; + +procedure bMenuItem._ReservedMenuItem2; +begin + BMenuItem__ReservedMenuItem2(CPlusObject); +end; + +procedure bMenuItem._ReservedMenuItem3; +begin + BMenuItem__ReservedMenuItem3(CPlusObject); +end; + +procedure bMenuItem._ReservedMenuItem4; +begin + BMenuItem__ReservedMenuItem4(CPlusObject); +end; + +constructor bMenuItem.Create( : bMenuItem) : TCPlusObject; +begin + CPlusObject := BMenuItem_Create(Self, ); +end; + +function bMenuItem.operator=( : bMenuItem) : bMenuItem; +begin + Result := BMenuItem_operator=(CPlusObject, ); +end; + +procedure bMenuItem.InitData; +begin + BMenuItem_InitData(CPlusObject); +end; + +procedure bMenuItem.IniBMenuData(menu : BMenu); +begin + BMenuItem_InitMenuData(CPlusObject, menu.CPlusObject); +end; + +procedure bMenuItem.Install(window : TWindow); +begin + BMenuItem_Install(CPlusObject, window.CPlusObject); +end; + +function bMenuItem.Invoke(msg : BMessage) : Status_t; +begin + Result := BMenuItem_Invoke(CPlusObject, msg.CPlusObject); +end; + +procedure bMenuItem.Uninstall; +begin + BMenuItem_Uninstall(CPlusObject); +end; + +procedure bMenuItem.SetSuper(super : BMenu); +begin + BMenuItem_SetSuper(CPlusObject, super.CPlusObject); +end; + +procedure bMenuItem.Select(on : boolean); +begin + BMenuItem_Select(CPlusObject, on); +end; + +procedure bMenuItem.DrawMarkSymbol; +begin + BMenuItem_DrawMarkSymbol(CPlusObject); +end; + +procedure bMenuItem.DrawShortcutSymbol; +begin + BMenuItem_DrawShortcutSymbol(CPlusObject); +end; + +procedure bMenuItem.DrawSubmenuSymbol; +begin + BMenuItem_DrawSubmenuSymbol(CPlusObject); +end; + +procedure bMenuItem.DrawControlChar(control : PChar); +begin + BMenuItem_DrawControlChar(CPlusObject, control); +end; + +procedure bMenuItem.SetSysTrigger(ch : Char); +begin + BMenuItem_SetSysTrigger(CPlusObject, ch); +end; + +procedure bMenuItem.char *fLabel; +begin + BMenuItem_char *fLabel(CPlusObject); +end; + +procedure bMenuItem.BMenu *fSubmenu; +begin + BMenuItem_BMenu *fSubmenu(CPlusObject); +end; + +procedure bMenuItem.BWindow *fWindow; +begin + BMenuItem_BWindow *fWindow(CPlusObject); +end; + +procedure bMenuItem.BMenu *fSuper; +begin + BMenuItem_BMenu *fSuper(CPlusObject); +end; + +procedure bMenuItem.BRect fBounds; +begin + BMenuItem_BRect fBounds(CPlusObject); +end; + +procedure bMenuItem.uint32 fModifiers; +begin + BMenuItem_uint32 fModifiers(CPlusObject); +end; + +procedure bMenuItem.float fCachedWidth; +begin + BMenuItem_float fCachedWidth(CPlusObject); +end; + +procedure bMenuItem.int16 fTriggerIndex; +begin + BMenuItem_int16 fTriggerIndex(CPlusObject); +end; + +procedure bMenuItem.char fUserTrigger; +begin + BMenuItem_char fUserTrigger(CPlusObject); +end; + +procedure bMenuItem.char fSysTrigger; +begin + BMenuItem_char fSysTrigger(CPlusObject); +end; + +procedure bMenuItem.char fShortcutChar; +begin + BMenuItem_char fShortcutChar(CPlusObject); +end; + +procedure bMenuItem.bool fMark; +begin + BMenuItem_bool fMark(CPlusObject); +end; + +procedure bMenuItem.bool fEnabled; +begin + BMenuItem_bool fEnabled(CPlusObject); +end; + +procedure bMenuItem.bool fSelected; +begin + BMenuItem_bool fSelected(CPlusObject); +end; + +procedure bMenuItem.uint32 _reserved[4]; +begin + BMenuItem_uint32 _reserved[4](CPlusObject); +end; +} + +constructor BSeparatorItem.Create; +begin + CPlusObject := BSeparatorItem_Create(Self); +end; + +constructor BSeparatorItem.Create(data : BMessage); +begin + CPlusObject := BSeparatorItem_Create(Self, data.CPlusObject); +end; + +destructor BSeparatorItem.Destroy; +begin + BSeparatorItem_Free(CPlusObject); + inherited; +end; + +function BSeparatorItem.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BSeparatorItem_Archive(CPlusObject, data.CPlusObject, deep); +end; + +function BSeparatorItem.Instantiate(data : BMessage) : BArchivable; +begin + Result := BSeparatorItem_Instantiate(CPlusObject, data.CPlusObject); +end; + +procedure BSeparatorItem.SetEnabled(state : boolean); +begin +// BSeparatorItem_SetEnabled(CPlusObject, state); +end; + +{ +procedure BSeparatorItem.GetContentSize(width : double; height : double); +begin + BSeparatorItem_GetContentSize(CPlusObject, width, height); +end; + +procedure BSeparatorItem.Draw; +begin +// BSeparatorItem_Draw(CPlusObject); +end; + +procedure BSeparatorItem._ReservedSeparatorItem1; +begin + BSeparatorItem__ReservedSeparatorItem1(CPlusObject); +end; + +procedure BSeparatorItem._ReservedSeparatorItem2; +begin + BSeparatorItem__ReservedSeparatorItem2(CPlusObject); +end; + +function BSeparatorItem.operator=( : BSeparatorItem) : BSeparatorItem; +begin + Result := BSeparatorItem_operator=(CPlusObject, ); +end; + +procedure BSeparatorItem.uint32 _reserved[1]; +begin + BSeparatorItem_uint32 _reserved[1](CPlusObject); +end; +} + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/menubar.pp b/bepascal/source/bepascal/pas/src/be/interface/menubar.pp new file mode 100644 index 0000000..5f790be --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/menubar.pp @@ -0,0 +1,310 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit menubar; + +interface + +uses + beobj, menu, SupportDefs, Message, Rect, archivable, handler; + +type + Menu_Bar_Border = (B_BORDER_FRAME, + B_BORDER_CONTENTS, + B_BORDER_EACH_ITEM); + BMenuBar = class(BMenu) + private + public + constructor Create(frame : BRect; viewName : PChar; resizingMode : Cardinal; layout : Menu_Layout; resizeToFit : boolean); + constructor Create; override; + destructor Destroy; override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure SetBorder(aBorder : Menu_Bar_Border); + function Border : Menu_Bar_Border; + procedure Draw(updateRect : BRect); override; + procedure AttachedToWindow; override; + procedure DetachedFromWindow; override; + procedure MessageReceived(msg : BMessage); override; + procedure MouseDown(where : BPoint); override; + procedure WindowActivated(state : boolean); override; + procedure MouseUp(where : BPoint); override; + procedure FrameMoved(new_position : BPoint); override; + procedure FrameResized(new_width : double; new_height : double); override; + procedure Show; + procedure Hide; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; aProperty : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + procedure ResizeToPreferred; override; + procedure GetPreferredSize(width : double; height : double); + procedure MakeFocus(state : boolean); + procedure AllAttached; override; + procedure AllDetached; override; + end; + +function BMenuBar_Create(AObject : TBeObject; frame : TCPlusObject; viewName : PChar; resizingMode : Cardinal; layout : Integer; resizeToFit : boolean) : TCPlusObject; cdecl; external BePascalLibName name 'BMenuBar_Create'; +//function BMenuBar_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMenuBar_Create'; +procedure BMenuBar_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_Free'; +function BMenuBar_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BMenuBar_Instantiate'; +function BMenuBar_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BMenuBar_Archive'; +procedure BMenuBar_SetBorder(AObject : TCPlusObject; aBorder : Menu_Bar_Border); cdecl; external BePascalLibName name 'BMenuBar_SetBorder'; +function BMenuBar_Border(AObject : TCPlusObject) : Menu_Bar_Border; cdecl; external BePascalLibName name 'BMenuBar_Border'; +procedure BMenuBar_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_Draw'; +procedure BMenuBar_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_AttachedToWindow'; +procedure BMenuBar_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_DetachedFromWindow'; +procedure BMenuBar_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_MessageReceived'; +procedure BMenuBar_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_MouseDown'; +procedure BMenuBar_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenuBar_WindowActivated'; +procedure BMenuBar_MouseUp(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_MouseUp'; +procedure BMenuBar_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_FrameMoved'; +procedure BMenuBar_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BMenuBar_FrameResized'; +procedure BMenuBar_Show(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_Show'; +procedure BMenuBar_Hide(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_Hide'; +function BMenuBar_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; aProperty : PChar) : BHandler; cdecl; external BePascalLibName name 'BMenuBar_ResolveSpecifier'; +function BMenuBar_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenuBar_GetSupportedSuites'; +procedure BMenuBar_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_ResizeToPreferred'; +procedure BMenuBar_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BMenuBar_GetPreferredSize'; +procedure BMenuBar_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenuBar_MakeFocus'; +procedure BMenuBar_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_AllAttached'; +procedure BMenuBar_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_AllDetached'; + +implementation + +constructor BMenuBar.Create(frame : BRect; viewName : PChar; resizingMode : Cardinal; layout : Menu_Layout; resizeToFit : boolean); +begin + CPlusObject := BMenuBar_Create(Self, frame.CPlusObject, viewName, resizingMode, 0, resizeToFit); +end; + +constructor BMenuBar.Create; +begin + CreatePas; +// CPlusObject := BMenuBar_Create_1(Self); +end; + +destructor BMenuBar.Destroy; +begin + BMenuBar_Free(CPlusObject); +end; + +function BMenuBar.Instantiate(data : BMessage) : BArchivable; +begin + Result := BMenuBar_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BMenuBar.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BMenuBar_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BMenuBar.SetBorder(aBorder : Menu_Bar_Border); +begin + BMenuBar_SetBorder(CPlusObject, aBorder); +end; + +function BMenuBar.Border : Menu_Bar_Border; +begin + Result := BMenuBar_Border(CPlusObject); +end; + +procedure BMenuBar.Draw(updateRect : BRect); +begin +// BMenuBar_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure BMenuBar.AttachedToWindow; +begin +// BMenuBar_AttachedToWindow(CPlusObject); +end; + +procedure BMenuBar.DetachedFromWindow; +begin +// BMenuBar_DetachedFromWindow(CPlusObject); +end; + +procedure BMenuBar.MessageReceived(msg : BMessage); +begin +// BMenuBar_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BMenuBar.MouseDown(where : BPoint); +begin +// BMenuBar_MouseDown(CPlusObject, where.CPlusObject); +end; + +procedure BMenuBar.WindowActivated(state : boolean); +begin +// BMenuBar_WindowActivated(CPlusObject, state); +end; + +procedure BMenuBar.MouseUp(where : BPoint); +begin +// BMenuBar_MouseUp(CPlusObject, where.CPlusObject); +end; + +procedure BMenuBar.FrameMoved(new_position : BPoint); +begin +// BMenuBar_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BMenuBar.FrameResized(new_width : double; new_height : double); +begin +// BMenuBar_FrameResized(CPlusObject, new_width, new_height); +end; + +procedure BMenuBar.Show; +begin + BMenuBar_Show(CPlusObject); +end; + +procedure BMenuBar.Hide; +begin + BMenuBar_Hide(CPlusObject); +end; + +function BMenuBar.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; aProperty : PChar) : BHandler; +begin + Result := BMenuBar_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, aProperty); +end; + +function BMenuBar.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BMenuBar_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +procedure BMenuBar.ResizeToPreferred; +begin +// BMenuBar_ResizeToPreferred(CPlusObject); +end; + +procedure BMenuBar.GetPreferredSize(width : double; height : double); +begin +// BMenuBar_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BMenuBar.MakeFocus(state : boolean); +begin +// BMenuBar_MakeFocus(CPlusObject, state); +end; + +procedure BMenuBar.AllAttached; +begin +// BMenuBar_AllAttached(CPlusObject); +end; + +procedure BMenuBar.AllDetached; +begin +// BMenuBar_AllDetached(CPlusObject); +end; + +{function BMenuBar.Perform(d : TPerform_code; arg : Pointer) : Status_t; +begin + Result := BMenuBar_Perform(CPlusObject, d, arg); +end; + +procedure BMenuBar._ReservedMenuBar1; +begin + BMenuBar__ReservedMenuBar1(CPlusObject); +end; + +procedure BMenuBar._ReservedMenuBar2; +begin + BMenuBar__ReservedMenuBar2(CPlusObject); +end; + +procedure BMenuBar._ReservedMenuBar3; +begin + BMenuBar__ReservedMenuBar3(CPlusObject); +end; + +procedure BMenuBar._ReservedMenuBar4; +begin + BMenuBar__ReservedMenuBar4(CPlusObject); +end; + +function BMenuBar.operator=( : BMenuBar) : BMenuBar; +begin + Result := BMenuBar_operator=(CPlusObject, ); +end; + +procedure BMenuBar.StarBMenuBar(menuIndex : integer; sticky : boolean; show_menu : boolean; special_rect : BRect); +begin + BMenuBar_StarBMenuBar(CPlusObject, menuIndex, sticky, show_menu, special_rect.CPlusObject); +end; + +function BMenuBar.TrackTask(arg : Pointer) : integer; +begin + Result := BMenuBar_TrackTask(CPlusObject, arg); +end; + +function BMenuBar.Track(action : ^integer; startIndex : integer; showMenu : boolean) : TMenuItem; +begin + Result := BMenuBar_Track(CPlusObject, action, startIndex, showMenu); +end; + +procedure BMenuBar.StealFocus; +begin + BMenuBar_StealFocus(CPlusObject); +end; + +procedure BMenuBar.RestoreFocus; +begin + BMenuBar_RestoreFocus(CPlusObject); +end; + +procedure BMenuBar.InitData(layout : BMenu_Layout); +begin + BMenuBar_InitData(CPlusObject, layout); +end; + +procedure BMenuBar.menu_bar_border fBorder; +begin + BMenuBar_menu_bar_border fBorder(CPlusObject); +end; + +procedure BMenuBar.thread_id fTrackingPID; +begin + BMenuBar_thread_id fTrackingPID(CPlusObject); +end; + +procedure BMenuBar.int32 fPrevFocusToken; +begin + BMenuBar_int32 fPrevFocusToken(CPlusObject); +end; + +procedure BMenuBar.sem_id fMenuSem; +begin + BMenuBar_sem_id fMenuSem(CPlusObject); +end; + +procedure BMenuBar.BRect *fLastBounds; +begin + BMenuBar_BRect *fLastBounds(CPlusObject); +end; + +procedure BMenuBar.uint32 _reserved[2]; +begin + BMenuBar_uint32 _reserved[2](CPlusObject); +end; + +procedure BMenuBar.bool fTracking; +begin + BMenuBar_bool fTracking(CPlusObject); +end; +} + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/outlinelistview.pp b/bepascal/source/bepascal/pas/src/be/interface/outlinelistview.pp new file mode 100644 index 0000000..ed215b3 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/outlinelistview.pp @@ -0,0 +1,357 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit outlinelistview; + +interface + +uses + beobj, view, message, archivable, SupportDefs, rect, list, + handler, messenger,interfacedefs,font,graphicdefs,scrollview,listitem,listview; + +type + BOutlineListView = class(BListView) + private + public + constructor Create(frame : BRect; name : pchar; atype : List_view_type; resizeMask: longint; flags : longint); override; + constructor Create(data : BMessage); + destructor Destroy;override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure MouseDown(where : BPoint);override; + procedure KeyDown(bytes : PChar; numBytes : integer);override; + procedure FrameMoved(new_position : BPoint);override; + procedure FrameResized(new_width : double; new_height : double);override; + procedure MouseUp(where : BPoint);override; + function AddUnder(item : BListItem; underItem : BListItem) : boolean; + function AddItem(item : BListItem) : boolean; + function AddItem(item : BListItem; fullListIndex : integer) : boolean; + function AddList(newItems : BList) : boolean; + function AddList(newItems : BList; fullListIndex : integer) : boolean; + function RemoveItem(item : BListItem) : boolean; + function RemoveItem(fullListIndex : integer) : BListItem; + function RemoveItems(fullListIndex : integer; count : integer) : boolean; + function FullListItemAt(fullListIndex : integer) : BListItem; + function FullListIndexOf(point : BPoint) : integer; + function FullListIndexOf(item : BListItem) : integer; + function FullListFirstItem : BListItem; + function FullListLastItem : BListItem; + function FullListHasItem(item : BListItem) : boolean; + function FullListCountItems : integer; + function FullListCurrentSelection(index : integer) : integer; + procedure MakeEmpty; + function FullListIsEmpty : boolean; + function Superitem(item : BListItem) : BListItem; + procedure Expand(item : BListItem); + procedure Collapse(item : BListItem); + function IsExpanded(fullListIndex : integer) : boolean; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + procedure ResizeToPreferred;override; + procedure GetPreferredSize(width : double; height : double); + procedure MakeFocus(state : boolean); + procedure AllAttached;override; + procedure AllDetached;override; + procedure DetachedFromWindow;override; + function CountItemsUnder(under : BListItem; oneLevelOnly : boolean) : integer; + function ItemUnderAt(underItem : BListItem; oneLevelOnly : boolean; index : integer) : BListItem; +// function DoMiscellaneous(code : ; data : ) : boolean; +// procedure MessageReceived( : BMessage); + end; + +function BOutlineListView_Create(AObject : TBeObject; frame : TCPlusObject; name : pchar; atype : list_view_type; resizeMask: longint; flags : longint):TCPlusObject; cdecl; external BePascalLibName name 'BOutlineListView_Create'; +function BOutlineListView_Create_1(AObject : TBeObject;data : TCPlusObject):TCPlusObject; cdecl; external BePascalLibName name 'BOutlineListView_Create_1'; +procedure BOutlineListView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_Free'; +function BOutlineListView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BOutlineListView_Instantiate'; +function BOutlineListView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BOutlineListView_Archive'; +procedure BOutlineListView_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_MouseDown'; +procedure BOutlineListView_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BOutlineListView_KeyDown'; +procedure BOutlineListView_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_FrameMoved'; +procedure BOutlineListView_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BOutlineListView_FrameResized'; +procedure BOutlineListView_MouseUp(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_MouseUp'; +function BOutlineListView_AddUnder(AObject : TCPlusObject; item : TCPlusObject; underItem : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_AddUnder'; +function BOutlineListView_AddItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_AddItem'; +function BOutlineListView_AddItem(AObject : TCPlusObject; item : TCPlusObject; fullListIndex : integer) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_AddItem'; +function BOutlineListView_AddList(AObject : TCPlusObject; newItems : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_AddList'; +function BOutlineListView_AddList(AObject : TCPlusObject; newItems : TCPlusObject; fullListIndex : integer) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_AddList'; +function BOutlineListView_RemoveItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_RemoveItem'; +function BOutlineListView_RemoveItem_1(AObject : TCPlusObject; fullListIndex : integer) : TCPlusObject; cdecl; external BePascalLibName name 'BOutlineListView_RemoveItem_1'; +function BOutlineListView_RemoveItems(AObject : TCPlusObject; fullListIndex : integer; count : integer) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_RemoveItems'; +function BOutlineListView_FullListItemAt(AObject : TCPlusObject; fullListIndex : integer) : BListItem; cdecl; external BePascalLibName name 'BOutlineListView_FullListItemAt'; +function BOutlineListView_FullListIndexOf(AObject : TCPlusObject; point : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BOutlineListView_FullListIndexOf'; +function BOutlineListView_FullListIndexOf_1(AObject : TCPlusObject; item : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BOutlineListView_FullListIndexOf_1'; +function BOutlineListView_FullListFirstItem(AObject : TCPlusObject) : BListItem; cdecl; external BePascalLibName name 'BOutlineListView_FullListFirstItem'; +function BOutlineListView_FullListLastItem(AObject : TCPlusObject) : BListItem; cdecl; external BePascalLibName name 'BOutlineListView_FullListLastItem'; +function BOutlineListView_FullListHasItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_FullListHasItem'; +function BOutlineListView_FullListCountItems(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BOutlineListView_FullListCountItems'; +function BOutlineListView_FullListCurrentSelection(AObject : TCPlusObject; index : integer) : integer; cdecl; external BePascalLibName name 'BOutlineListView_FullListCurrentSelection'; +procedure BOutlineListView_MakeEmpty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_MakeEmpty'; +function BOutlineListView_FullListIsEmpty(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_FullListIsEmpty'; +function BOutlineListView_Superitem(AObject : TCPlusObject; item : TCPlusObject) : BListItem; cdecl; external BePascalLibName name 'BOutlineListView_Superitem'; +procedure BOutlineListView_Expand(AObject : TCPlusObject; item : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_Expand'; +procedure BOutlineListView_Collapse(AObject : TCPlusObject; item : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_Collapse'; +function BOutlineListView_IsExpanded(AObject : TCPlusObject; fullListIndex : integer) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_IsExpanded'; +function BOutlineListView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BOutlineListView_ResolveSpecifier'; +function BOutlineListView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BOutlineListView_GetSupportedSuites'; +function BOutlineListView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BOutlineListView_Perform'; +procedure BOutlineListView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_ResizeToPreferred'; +procedure BOutlineListView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BOutlineListView_GetPreferredSize'; +procedure BOutlineListView_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BOutlineListView_MakeFocus'; +procedure BOutlineListView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_AllAttached'; +procedure BOutlineListView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_AllDetached'; +procedure BOutlineListView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_DetachedFromWindow'; +function BOutlineListView_CountItemsUnder(AObject : TCPlusObject; under : TCPlusObject; oneLevelOnly : boolean) : integer; cdecl; external BePascalLibName name 'BOutlineListView_CountItemsUnder'; +function BOutlineListView_ItemUnderAt(AObject : TCPlusObject; underItem : TCPlusObject; oneLevelOnly : boolean; index : integer) : BListItem; cdecl; external BePascalLibName name 'BOutlineListView_ItemUnderAt'; +//function BOutlineListView_DoMiscellaneous(AObject : TCPlusObject; code : ; data : ) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_DoMiscellaneous'; +//procedure BOutlineListView_MessageReceived(AObject : TCPlusObject; : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_MessageReceived'; + +implementation + + +constructor BOutlineListView.Create(frame : BRect; name : pchar; atype : list_view_type; resizeMask: longint; flags : longint); +begin + CreatePas; + CPlusObject := BOutlineListView_Create(Self,frame.CPlusObject,name,atype,resizeMask,flags); +end; + +constructor BOutlineListView.Create(data : BMessage); +begin + CreatePas; + CPlusObject := BOutlineListView_Create_1(Self,data.CPlusObject); +end; + +destructor BOutlineListView.Destroy; +begin + BOutlineListView_Free(CPlusObject); + inherited; +end; + +function BOutlineListView.Instantiate(data : BMessage) : BArchivable; +begin + Result := BOutlineListView_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BOutlineListView.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BOutlineListView_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BOutlineListView.MouseDown(where : BPoint); +begin +// BOutlineListView_MouseDown(CPlusObject, where.CPlusObject); +end; + +procedure BOutlineListView.KeyDown(bytes : PChar; numBytes : integer); +begin + // BOutlineListView_KeyDown(CPlusObject, bytes, numBytes); +end; + +procedure BOutlineListView.FrameMoved(new_position : BPoint); +begin +// BOutlineListView_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BOutlineListView.FrameResized(new_width : double; new_height : double); +begin +// BOutlineListView_FrameResized(CPlusObject, new_width, new_height); +end; + +procedure BOutlineListView.MouseUp(where : BPoint); +begin +// BOutlineListView_MouseUp(CPlusObject, where.CPlusObject); +end; + +function BOutlineListView.AddUnder(item : BListItem; underItem : BListItem) : boolean; +begin + Result := BOutlineListView_AddUnder(CPlusObject, item.CPlusObject, underItem.CPlusObject); +end; + +function BOutlineListView.AddItem(item : BListItem) : boolean; +begin + Result := BOutlineListView_AddItem(CPlusObject, item.CPlusObject); +end; + +function BOutlineListView.AddItem(item : BListItem; fullListIndex : integer) : boolean; +begin + Result := BOutlineListView_AddItem(CPlusObject, item.CPlusObject, fullListIndex); +end; + +function BOutlineListView.AddList(newItems : BList) : boolean; +begin + Result := BOutlineListView_AddList(CPlusObject, newItems.CPlusObject); +end; + +function BOutlineListView.AddList(newItems : BList; fullListIndex : integer) : boolean; +begin + Result := BOutlineListView_AddList(CPlusObject, newItems.CPlusObject, fullListIndex); +end; + +function BOutlineListView.RemoveItem(item : BListItem) : boolean; +begin + Result := BOutlineListView_RemoveItem(CPlusObject, item.CPlusObject); +end; + +function BOutlineListView.RemoveItem(fullListIndex : integer) : BListItem; +begin +// Result := BOutlineListView_RemoveItem_1(CPlusObject, fullListIndex); +end; + +function BOutlineListView.RemoveItems(fullListIndex : integer; count : integer) : boolean; +begin + Result := BOutlineListView_RemoveItems(CPlusObject, fullListIndex, count); +end; + +function BOutlineListView.FullListItemAt(fullListIndex : integer) : BListItem; +begin + Result := BOutlineListView_FullListItemAt(CPlusObject, fullListIndex); +end; + +function BOutlineListView.FullListIndexOf(point : BPoint) : integer; +begin + Result := BOutlineListView_FullListIndexOf(CPlusObject, point.CPlusObject); +end; + +function BOutlineListView.FullListIndexOf(item : BListItem) : integer; +begin + Result := BOutlineListView_FullListIndexOf(CPlusObject, item.CPlusObject); +end; + +function BOutlineListView.FullListFirstItem : BListItem; +begin + Result := BOutlineListView_FullListFirstItem(CPlusObject); +end; + +function BOutlineListView.FullListLastItem : BListItem; +begin + Result := BOutlineListView_FullListLastItem(CPlusObject); +end; + +function BOutlineListView.FullListHasItem(item : BListItem) : boolean; +begin + Result := BOutlineListView_FullListHasItem(CPlusObject, item.CPlusObject); +end; + +function BOutlineListView.FullListCountItems : integer; +begin + Result := BOutlineListView_FullListCountItems(CPlusObject); +end; + +function BOutlineListView.FullListCurrentSelection(index : integer) : integer; +begin + Result := BOutlineListView_FullListCurrentSelection(CPlusObject, index); +end; + +procedure BOutlineListView.MakeEmpty; +begin + BOutlineListView_MakeEmpty(CPlusObject); +end; + +function BOutlineListView.FullListIsEmpty : boolean; +begin + Result := BOutlineListView_FullListIsEmpty(CPlusObject); +end; + +function BOutlineListView.Superitem(item : BListItem) : BListItem; +begin + Result := BOutlineListView_Superitem(CPlusObject, item); +end; + +procedure BOutlineListView.Expand(item : BListItem); +begin + BOutlineListView_Expand(CPlusObject, item.CPlusObject); +end; + +procedure BOutlineListView.Collapse(item : BListItem); +begin + BOutlineListView_Collapse(CPlusObject, item.CPlusObject); +end; + +function BOutlineListView.IsExpanded(fullListIndex : integer) : boolean; +begin + Result := BOutlineListView_IsExpanded(CPlusObject, fullListIndex); +end; + +function BOutlineListView.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BOutlineListView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +function BOutlineListView.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BOutlineListView_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BOutlineListView.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BOutlineListView_Perform(CPlusObject, d, arg); +end; + +procedure BOutlineListView.ResizeToPreferred; +begin + BOutlineListView_ResizeToPreferred(CPlusObject); +end; + +procedure BOutlineListView.GetPreferredSize(width : double; height : double); +begin + BOutlineListView_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BOutlineListView.MakeFocus(state : boolean); +begin + BOutlineListView_MakeFocus(CPlusObject, state); +end; + +procedure BOutlineListView.AllAttached; +begin + BOutlineListView_AllAttached(CPlusObject); +end; + +procedure BOutlineListView.AllDetached; +begin + BOutlineListView_AllDetached(CPlusObject); +end; + +procedure BOutlineListView.DetachedFromWindow; +begin + BOutlineListView_DetachedFromWindow(CPlusObject); +end; + +function BOutlineListView.CountItemsUnder(under : BListItem; oneLevelOnly : boolean) : integer; +begin + Result := BOutlineListView_CountItemsUnder(CPlusObject, under.CPlusObject, oneLevelOnly); +end; + +function BOutlineListView.ItemUnderAt(underItem : BListItem; oneLevelOnly : boolean; index : integer) : BListItem; +begin + Result := BOutlineListView_ItemUnderAt(CPlusObject, underItem.CPlusObject, oneLevelOnly, index); +end; + +{function BOutlineListView.DoMiscellaneous(code : ; data : ) : boolean; +begin + Result := BOutlineListView_DoMiscellaneous(CPlusObject, code, data); +end; + +procedure BOutlineListView.MessageReceived( : BMessage); +begin + BOutlineListView_MessageReceived(CPlusObject, .CPlusObject); +end; +} + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/radiobutton.pp b/bepascal/source/bepascal/pas/src/be/interface/radiobutton.pp new file mode 100644 index 0000000..0ffb90b --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/radiobutton.pp @@ -0,0 +1,270 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2003 Olivier Coursiere + Eric Jourde + Oscar Lesta + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit radiobutton; + +interface + +uses + beobj, Control, Message, Archivable, SupportDefs, Rect, Handler; + +type + BRadioButton = class(BControl) + private + public + constructor Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal); virtual; + constructor Create(data : BMessage); override; + destructor Destroy; override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure Draw(updateRect : BRect); override; + procedure MouseDown(where : BPoint); override; + procedure AttachedToWindow; override; + procedure KeyDown(bytes : PChar; numBytes : integer); override; + procedure SetValue(aValue : integer); + procedure GetPreferredSize(width : double; height : double); + procedure ResizeToPreferred; override; + function Invoke(msg : BMessage) : Status_t; + procedure MessageReceived(msg : BMessage); override; + procedure WindowActivated(state : boolean); override; + procedure MouseUp(pt : BPoint); override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); override; + procedure DetachedFromWindow; override; + procedure FrameMoved(new_position : BPoint); override; + procedure FrameResized(new_width : double; new_height : double); override; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + procedure MakeFocus(state : boolean); override; + procedure AllAttached; override; + procedure AllDetached; override; + function GetSupportedSuites(data : BMessage) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; +// procedure _ReservedRadioButton1; +// procedure _ReservedRadioButton2; +// function operator=( : BRadioButton) : BRadioButton; +// procedure BBitmap *sBitmaps[2][3]; +// procedure bool fOutlined; +// procedure uint32 _reserved[2]; + end; + +function BRadioButton_Create(AObject : TBeObject; frame : TCPlusObject; + name, aLabel : PChar; message : TCPlusObject; + resizingMode, flags : Cardinal) : TCPlusObject; + cdecl; external BePascalLibName name 'BRadioButton_Create'; +function BRadioButton_Create_1(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRadioButton_Create_1'; + +procedure BRadioButton_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_FREE'; + +function BRadioButton_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BRadioButton_Instantiate'; +function BRadioButton_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Archive'; +procedure BRadioButton_Draw(AObject : TCPlusObject; updateRect : BRect); cdecl; external BePascalLibName name 'BRadioButton_Draw'; +procedure BRadioButton_MouseDown(AObject : TCPlusObject; where : BPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseDown'; +procedure BRadioButton_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AttachedToWindow'; +procedure BRadioButton_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BRadioButton_KeyDown'; +procedure BRadioButton_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BRadioButton_SetValue'; +procedure BRadioButton_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BRadioButton_GetPreferredSize'; +procedure BRadioButton_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_ResizeToPreferred'; +function BRadioButton_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Invoke'; +procedure BRadioButton_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_MessageReceived'; +procedure BRadioButton_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BRadioButton_WindowActivated'; +procedure BRadioButton_MouseUp(AObject : TCPlusObject; pt : BPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseUp'; +procedure BRadioButton_MouseMoved(AObject : TCPlusObject; pt : BPoint; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_MouseMoved'; +procedure BRadioButton_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_DetachedFromWindow'; +procedure BRadioButton_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_FrameMoved'; +procedure BRadioButton_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BRadioButton_FrameResized'; +function BRadioButton_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BRadioButton_ResolveSpecifier'; +procedure BRadioButton_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BRadioButton_MakeFocus'; +procedure BRadioButton_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AllAttached'; +procedure BRadioButton_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AllDetached'; +function BRadioButton_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_GetSupportedSuites'; +function BRadioButton_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Perform'; +//procedure BRadioButton__ReservedRadioButton1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton__ReservedRadioButton1'; +//procedure BRadioButton__ReservedRadioButton2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton__ReservedRadioButton2'; +//function BRadioButton_operator=(AObject : TCPlusObject; : BRadioButton) : BRadioButton; cdecl; external BePascalLibName name 'BRadioButton_operator='; +//procedure BRadioButton_BBitmap *sBitmaps[2][3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_BBitmap *sBitmaps[2][3]'; +//procedure BRadioButton_bool fOutlined(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_bool fOutlined'; +//procedure BRadioButton_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_uint32 _reserved[2]'; + +implementation + +constructor BRadioButton.Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal); +begin + CreatePas; + CPlusObject := BRadioButton_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags); +end; + +constructor BRadioButton.Create(data : BMessage); +begin + CreatePas; + CPlusObject := BRadioButton_Create_1(Self, data.CPlusObject); +end; + +destructor BRadioButton.Destroy; +begin + BRadioButton_Free(CPlusObject); + inherited; +end; + +function BRadioButton.Instantiate(data : BMessage) : BArchivable; +begin + Result := BRadioButton_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BRadioButton.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BRadioButton_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BRadioButton.Draw(updateRect : BRect); +begin +// BRadioButton_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure BRadioButton.MouseDown(where : BPoint); +begin +// BRadioButton_MouseDown(CPlusObject, where.CPlusObject); +end; + +procedure BRadioButton.AttachedToWindow; +begin +// BRadioButton_AttachedToWindow(CPlusObject); +end; + +procedure BRadioButton.KeyDown(bytes : PChar; numBytes : integer); +begin +// BRadioButton_KeyDown(CPlusObject, bytes, numBytes); +end; + +procedure BRadioButton.SetValue(aValue : integer); +begin + BRadioButton_SetValue(CPlusObject, aValue); +end; + +procedure BRadioButton.GetPreferredSize(width : double; height : double); +begin + BRadioButton_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BRadioButton.ResizeToPreferred; +begin + BRadioButton_ResizeToPreferred(CPlusObject); +end; + +function BRadioButton.Invoke(msg : BMessage) : Status_t; +begin + Result := BRadioButton_Invoke(CPlusObject, msg.CPlusObject); +end; + +procedure BRadioButton.MessageReceived(msg : BMessage); +begin +// BRadioButton_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BRadioButton.WindowActivated(state : boolean); +begin +// BRadioButton_WindowActivated(CPlusObject, state); +end; + +procedure BRadioButton.MouseUp(pt : BPoint); +begin +// BRadioButton_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BRadioButton.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin +// BRadioButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BRadioButton.DetachedFromWindow; +begin +// BRadioButton_DetachedFromWindow(CPlusObject); +end; + +procedure BRadioButton.FrameMoved(new_position : BPoint); +begin +// BRadioButton_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BRadioButton.FrameResized(new_width : double; new_height : double); +begin +// BRadioButton_FrameResized(CPlusObject, new_width, new_height); +end; + +function BRadioButton.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BRadioButton_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +procedure BRadioButton.MakeFocus(state : boolean); +begin + BRadioButton_MakeFocus(CPlusObject, state); +end; + +procedure BRadioButton.AllAttached; +begin +// BRadioButton_AllAttached(CPlusObject); +end; + +procedure BRadioButton.AllDetached; +begin +// BRadioButton_AllDetached(CPlusObject); +end; + +function BRadioButton.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BRadioButton_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BRadioButton.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BRadioButton_Perform(CPlusObject, d, arg); +end; + +{ +procedure BRadioButton._ReservedRadioButton1; +begin + BRadioButton__ReservedRadioButton1(CPlusObject); +end; + +procedure BRadioButton._ReservedRadioButton2; +begin + BRadioButton__ReservedRadioButton2(CPlusObject); +end; + +function BRadioButton.operator=( : BRadioButton) : BRadioButton; +begin + Result := BRadioButton_operator=(CPlusObject, ); +end; + +procedure BRadioButton.BBitmap *sBitmaps[2][3]; +begin + BRadioButton_BBitmap *sBitmaps[2][3](CPlusObject); +end; + +procedure BRadioButton.bool fOutlined; +begin + BRadioButton_bool fOutlined(CPlusObject); +end; + +procedure BRadioButton.uint32 _reserved[2]; +begin + BRadioButton_uint32 _reserved[2](CPlusObject); +end; +} + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/rect.pp b/bepascal/source/bepascal/pas/src/be/interface/rect.pp new file mode 100644 index 0000000..231d7f4 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/rect.pp @@ -0,0 +1,144 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit rect; + +interface + +uses + beobj; + +type + // BPoint and BRect are defined in the same unit to avoid circular reference + BPoint = class; + BRect = class(TBeObject) + public + constructor Create; override; + constructor Create(rect : BRect); virtual; // Problème de référence circulaire avec BPoint + constructor Create(l, t, r, b : single); virtual; + constructor Create(leftTop, rightBottom : BPoint); virtual; + destructor Destroy; override; + procedure PrintToStream; + end; + +function BRect_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_1'; +function BRect_Create(AObject : TBeObject; rect : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_2'; +function BRect_Create(AObject : TBeObject; l, t, r, b : single) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_3'; +function BRect_Create(AObject : TBeObject; leftTop, rightBottom : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_4'; +procedure BRect_Free(rect : TCPlusObject); cdecl; external BePascalLibName name 'BRect_Free'; +procedure BRect_PrintToStream(Rect : TCPlusObject); cdecl; external bePascalLibName name 'BRect_PrintToStream'; + +type + BPoint = class(TBeObject) + public + constructor Create; override; + constructor Create(x, y : single); virtual; + constructor Create(point : BPoint); virtual; + destructor Destroy; override; + procedure ConstrainTo(Rect : BRect); + procedure PrintToStream; + procedure Sept(x, y : single); + end; + +function BPoint_Create(AObject : TBeObject; x, y : single) : TCPlusObject; cdecl; external BePascalLibName name 'BPoint_Create_1'; +function BPoint_Create(AObject : TBeObject; point : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BPoint_Create_2'; +function BPoint_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BPoint_Create_3'; +procedure BPoint_Free(Point : TCPlusObject); cdecl; external BePascalLibName name 'BPoint_Free'; +procedure BPoint_ConstrainTo(Point : TCPlusObject; Rect : TCPlusObject); cdecl; external BePascalLibName name 'BPoint_ConstrainTo'; +procedure BPoint_PrintToStream(Point : TCPlusObject); cdecl; external bePascalLibName name 'BPoint_PrintToStream'; +procedure BPoint_Set(Point : TCPlusObject; x, y : single); cdecl; external BePascalLibName name 'BPoint_Set'; + +implementation + +constructor BRect.Create; +begin + inherited Create; + CPlusObject := BRect_Create(Self); +end; + +constructor BRect.Create(rect : BRect); +begin + inherited Create; + CPlusObject := BRect_Create(Self, rect.CPlusObject); +end; + +constructor BRect.Create(l, t, r, b : single); +begin + inherited Create; + CPlusObject := BRect_Create(Self, l, t, r, b); +end; + +constructor BRect.Create(leftTop, rightBottom : BPoint); +begin + inherited Create; + CPlusObject := BRect_Create(Self, leftTop.CPlusObject, rightBottom.CPlusObject); +end; + +destructor BRect.Destroy; +begin + BRect_Free(CPlusObject); + inherited Destroy; +end; + +procedure BRect.PrintToStream; +begin + BRect_PrintToStream(CPlusObject); +end; + +constructor BPoint.Create(x, y : single); +begin + inherited Create; + CPlusObject := BPoint_Create(Self, x, y); +end; + +constructor BPoint.Create(point : BPoint); +begin + inherited Create; + CPlusObject := BPoint_Create(Self, point.CPlusObject) +end; + +constructor BPoint.Create; +begin + inherited Create; + CPlusObject := BPoint_Create(Self); +end; + +destructor BPoint.Destroy; +begin + BPoint_Free(CPlusObject); + inherited; +end; + +procedure BPoint.ConstrainTo(Rect : BRect); +begin + BPoint_ConstrainTo(CPlusObject, Rect.CPlusObject); +end; + +procedure BPoint.PrintToStream; +begin + BPoint_PrintToStream(CPlusObject); +end; + +procedure BPoint.Sept(x, y : single); +begin + BPoint_Set(CPlusObject, x, y); +end; + +initialization + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/scrollbar.pp b/bepascal/source/bepascal/pas/src/be/interface/scrollbar.pp new file mode 100644 index 0000000..fb9caac --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/scrollbar.pp @@ -0,0 +1,284 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit scrollbar; + +interface + +uses + beobj,view,rect,interfacedefs,Message,Archivable,SupportDefs,Handler; + +type + BScrollBar = class(BView) + private + public + constructor Create(frame : BRect; name : pchar; atarget : BView; min,max : real; direction : orientation); + constructor Create_1(data : BMessage); + destructor Destroy;override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure AttachedToWindow;override; + procedure SetValue(avalue : double); + function Value : double; + procedure SetProportion( avalue: double); + function Proportion : double; + procedure ValueChanged(newValue : double); + procedure SetRange(min : double; max : double); + procedure GetRange(min : double; max : double); + procedure SetSteps(smallStep : double; largeStep : double); + procedure GetSteps(smallStep : double; largeStep : double); + procedure SetTarget(atarget : BView); + procedure SetTarget(targetName : PChar); + function Target : BView; + function GetOrientation : Orientation; + procedure MessageReceived(msg : BMessage);override; + procedure MouseDown(pt : BPoint);override; + procedure MouseUp(pt : BPoint);override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override; + procedure DetachedFromWindow;override; + procedure Draw(updateRect : BRect);override; + procedure FrameMoved(new_position : BPoint);override; + procedure FrameResized(new_width : double; new_height : double);override; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + procedure ResizeToPreferred;override; + procedure GetPreferredSize(width : double; height : double); + procedure MakeFocus(state : boolean); + procedure AllAttached;override; + procedure AllDetached;override; + function GetSupportedSuites(data : BMessage) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + end; + +function BScrollBar_Create(AObject : TBeObject;frame : TCPlusObject; name : pchar; target : TCPlusObject; min,max : real; direction : Orientation): TCPlusObject; cdecl; external BePascalLibName name 'BScrollBar_Create'; +function BScrollBar_Create_1(AObject : TBeObject; data : TCPlusObject):TCPlusObject; cdecl; external BePascalLibName name 'BScrollBar_Create_1'; +procedure BScrollBar_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_Free'; +function BScrollBar_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BScrollBar_Instantiate'; +function BScrollBar_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BScrollBar_Archive'; +procedure BScrollBar_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_AttachedToWindow'; +procedure BScrollBar_SetValue(AObject : TCPlusObject; value : double); cdecl; external BePascalLibName name 'BScrollBar_SetValue'; +function BScrollBar_Value(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BScrollBar_Value'; +procedure BScrollBar_SetProportion(AObject : TCPlusObject; avalue: double); cdecl; external BePascalLibName name 'BScrollBar_SetProportion'; +function BScrollBar_Proportion(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BScrollBar_Proportion'; +procedure BScrollBar_ValueChanged(AObject : TCPlusObject; newValue : double); cdecl; external BePascalLibName name 'BScrollBar_ValueChanged'; +procedure BScrollBar_SetRange(AObject : TCPlusObject; min : double; max : double); cdecl; external BePascalLibName name 'BScrollBar_SetRange'; +procedure BScrollBar_GetRange(AObject : TCPlusObject; min : double; max : double); cdecl; external BePascalLibName name 'BScrollBar_GetRange'; +procedure BScrollBar_SetSteps(AObject : TCPlusObject; smallStep : double; largeStep : double); cdecl; external BePascalLibName name 'BScrollBar_SetSteps'; +procedure BScrollBar_GetSteps(AObject : TCPlusObject; smallStep : double; largeStep : double); cdecl; external BePascalLibName name 'BScrollBar_GetSteps'; +procedure BScrollBar_SetTarget(AObject : TCPlusObject; target : BView); cdecl; external BePascalLibName name 'BScrollBar_SetTarget'; +procedure BScrollBar_SetTarget(AObject : TCPlusObject; targetName : PChar); cdecl; external BePascalLibName name 'BScrollBar_SetTarget'; +function BScrollBar_Target(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BScrollBar_Target'; +function BScrollBar_Orientation(AObject : TCPlusObject) : Orientation; cdecl; external BePascalLibName name 'BScrollBar_Orientation'; +procedure BScrollBar_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_MessageReceived'; +procedure BScrollBar_MouseDown(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_MouseDown'; +procedure BScrollBar_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_MouseUp'; +procedure BScrollBar_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : BMessage); cdecl; external BePascalLibName name 'BScrollBar_MouseMoved'; +procedure BScrollBar_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_DetachedFromWindow'; +procedure BScrollBar_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_Draw'; +procedure BScrollBar_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_FrameMoved'; +procedure BScrollBar_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BScrollBar_FrameResized'; +function BScrollBar_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BScrollBar_ResolveSpecifier'; +procedure BScrollBar_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_ResizeToPreferred'; +procedure BScrollBar_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BScrollBar_GetPreferredSize'; +procedure BScrollBar_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BScrollBar_MakeFocus'; +procedure BScrollBar_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_AllAttached'; +procedure BScrollBar_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_AllDetached'; +function BScrollBar_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BScrollBar_GetSupportedSuites'; +function BScrollBar_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BScrollBar_Perform'; + +implementation + +constructor BScrollBar.Create(frame : BRect; name : pchar; atarget : BView; min,max : real; direction : Orientation); +begin + CreatePas; + CPlusObject := BScrollBar_Create(Self,frame.CPlusObject, name, target.CPlusObject,min,max, direction ); +end; + +constructor BScrollBar.Create_1(data : BMessage); +begin + CreatePas; + CPlusObject := BScrollBar_Create_1(Self, data.CPlusObject); +end; + +destructor BScrollBar.Destroy; +begin + BScrollBar_Free(CPlusObject); + inherited; +end; + +function BScrollBar.Instantiate(data : BMessage) : BArchivable; +begin + Result := BScrollBar_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BScrollBar.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BScrollBar_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BScrollBar.AttachedToWindow; +begin + // BScrollBar_AttachedToWindow(CPlusObject); +end; + +procedure BScrollBar.SetValue(avalue : double); +begin + BScrollBar_SetValue(CPlusObject, avalue); +end; + +function BScrollBar.Value : double; +begin + Result := BScrollBar_Value(CPlusObject); +end; + +procedure BScrollBar.SetProportion( avalue: double); +begin + BScrollBar_SetProportion(CPlusObject, avalue); +end; + +function BScrollBar.Proportion : double; +begin + Result := BScrollBar_Proportion(CPlusObject); +end; + +procedure BScrollBar.ValueChanged(newValue : double); +begin + BScrollBar_ValueChanged(CPlusObject, newValue); +end; + +procedure BScrollBar.SetRange(min : double; max : double); +begin + BScrollBar_SetRange(CPlusObject, min, max); +end; + +procedure BScrollBar.GetRange(min : double; max : double); +begin + BScrollBar_GetRange(CPlusObject, min, max); +end; + +procedure BScrollBar.SetSteps(smallStep : double; largeStep : double); +begin + BScrollBar_SetSteps(CPlusObject, smallStep, largeStep); +end; + +procedure BScrollBar.GetSteps(smallStep : double; largeStep : double); +begin + BScrollBar_GetSteps(CPlusObject, smallStep, largeStep); +end; + +procedure BScrollBar.SetTarget(atarget : BView); +begin + BScrollBar_SetTarget(CPlusObject, target.CPlusObject); +end; + +procedure BScrollBar.SetTarget(targetName : PChar); +begin + BScrollBar_SetTarget(CPlusObject, targetName); +end; + +function BScrollBar.Target : BView; +begin + Result := BScrollBar_Target(CPlusObject); +end; + +function BScrollBar.GetOrientation : Orientation; +begin + Result := BScrollBar_Orientation(CPlusObject); +end; + +procedure BScrollBar.MessageReceived(msg : BMessage); +begin + // BScrollBar_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BScrollBar.MouseDown(pt : BPoint); +begin +// BScrollBar_MouseDown(CPlusObject, pt.CPlusObject); +end; + +procedure BScrollBar.MouseUp(pt : BPoint); +begin +// BScrollBar_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BScrollBar.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin +// BScrollBar_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BScrollBar.DetachedFromWindow; +begin + // BScrollBar_DetachedFromWindow(CPlusObject); +end; + +procedure BScrollBar.Draw(updateRect : BRect); +begin + //BScrollBar_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure BScrollBar.FrameMoved(new_position : BPoint); +begin +// BScrollBar_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BScrollBar.FrameResized(new_width : double; new_height : double); +begin +// BScrollBar_FrameResized(CPlusObject, new_width, new_height); +end; + +function BScrollBar.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BScrollBar_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +procedure BScrollBar.ResizeToPreferred; +begin +// BScrollBar_ResizeToPreferred(CPlusObject); +end; + +procedure BScrollBar.GetPreferredSize(width : double; height : double); +begin + BScrollBar_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BScrollBar.MakeFocus(state : boolean); +begin + BScrollBar_MakeFocus(CPlusObject, state); +end; + +procedure BScrollBar.AllAttached; +begin + BScrollBar_AllAttached(CPlusObject); +end; + +procedure BScrollBar.AllDetached; +begin + BScrollBar_AllDetached(CPlusObject); +end; + +function BScrollBar.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BScrollBar_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BScrollBar.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BScrollBar_Perform(CPlusObject, d, arg); +end; + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/scrollview.pp b/bepascal/source/bepascal/pas/src/be/interface/scrollview.pp new file mode 100644 index 0000000..89e525d --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/scrollview.pp @@ -0,0 +1,259 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit scrollview; + +interface + +uses + beobj, view, message, archivable, SupportDefs, rect, list, + handler, messenger,interfacedefs,font,graphicdefs,scrollbar; + +type + BScrollView = class(BView) + private + public + constructor Create(name : pchar; + atarget :BView; + resizeMask : longint; + flags : longint; + horizontal, + vertical : boolean; + aborder :border_style ); virtual; + destructor Destroy;override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure Draw(updateRect : BRect);override; + procedure AttachedToWindow;override; + function ScrollBar(flag : Orientation) : BScrollBar; + procedure SetBorder(aborder : border_style); + function Border : border_style; + function SetBorderHighlighted(state : boolean) : Status_t; + function IsBorderHighlighted : boolean; + procedure SetTarget(new_target : BView); + function Target : BView; + procedure MessageReceived(msg : BMessage);override; + procedure MouseDown(pt : BPoint);override; + procedure WindowActivated(state : boolean);override; + procedure MouseUp(pt : BPoint);override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override; + procedure DetachedFromWindow;override; + procedure AllAttached;override; + procedure AllDetached;override; + procedure FrameMoved(new_position : BPoint);override; + procedure FrameResized(new_width : double; new_height : double);override; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + procedure ResizeToPreferred;override; + procedure GetPreferredSize(width : double; height : double); + procedure MakeFocus(state : boolean); + function GetSupportedSuites(data : BMessage) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + end; + +function BScrollView_Create(AObject : TBeObject;name : pchar;target :TCPlusObject; resizeMask : longint; flags : longint;horizontal,vertical : boolean;border :border_style ):TCPlusObject; cdecl; external BePascalLibName name 'BScrollView_Create'; +//function BScrollView_Create_1(AObject : TBeObject):TCPlusObject; cdecl; external BePascalLibName name 'BScrollView_Create_1'; +procedure BScrollView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_Free'; +function BScrollView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BScrollView_Instantiate'; +function BScrollView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BScrollView_Archive'; +procedure BScrollView_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_Draw'; +procedure BScrollView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_AttachedToWindow'; +function BScrollView_ScrollBar(AObject : TCPlusObject; flag : Orientation) : BScrollBar; cdecl; external BePascalLibName name 'BScrollView_ScrollBar'; +procedure BScrollView_SetBorder(AObject : TCPlusObject; border : border_style); cdecl; external BePascalLibName name 'BScrollView_SetBorder'; +function BScrollView_Border(AObject : TCPlusObject) : border_style; cdecl; external BePascalLibName name 'BScrollView_Border'; +function BScrollView_SetBorderHighlighted(AObject : TCPlusObject; state : boolean) : Status_t; cdecl; external BePascalLibName name 'BScrollView_SetBorderHighlighted'; +function BScrollView_IsBorderHighlighted(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BScrollView_IsBorderHighlighted'; +procedure BScrollView_SetTarget(AObject : TCPlusObject; new_target : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_SetTarget'; +function BScrollView_Target(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BScrollView_Target'; +procedure BScrollView_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MessageReceived'; +procedure BScrollView_MouseDown(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MouseDown'; +procedure BScrollView_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BScrollView_WindowActivated'; +procedure BScrollView_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MouseUp'; +procedure BScrollView_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MouseMoved'; +procedure BScrollView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_DetachedFromWindow'; +procedure BScrollView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_AllAttached'; +procedure BScrollView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_AllDetached'; +procedure BScrollView_FrameMoved(AObject : TCPlusObject; new_position : BPoint); cdecl; external BePascalLibName name 'BScrollView_FrameMoved'; +procedure BScrollView_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BScrollView_FrameResized'; +function BScrollView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BScrollView_ResolveSpecifier'; +procedure BScrollView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_ResizeToPreferred'; +procedure BScrollView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BScrollView_GetPreferredSize'; +procedure BScrollView_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BScrollView_MakeFocus'; +function BScrollView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BScrollView_GetSupportedSuites'; +function BScrollView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BScrollView_Perform'; + +implementation + +constructor BScrollView.Create(name : pchar; + atarget :BView; + resizeMask : longint; + flags : longint; + horizontal, + vertical : boolean; + aborder :border_style ); +begin + CreatePas; + CPlusObject := BScrollView_Create(Self,name,atarget.CplusObject,resizeMask,flags,horizontal,vertical,aborder); + +end; + + + +destructor BScrollView.Destroy; +begin + BScrollView_Free(CPlusObject); + inherited; +end; + +function BScrollView.Instantiate(data : BMessage) : BArchivable; +begin + Result := BScrollView_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BScrollView.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BScrollView_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BScrollView.Draw(updateRect : BRect); +begin +// BScrollView_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure BScrollView.AttachedToWindow; +begin + //BScrollView_AttachedToWindow(CPlusObject); +end; + +function BScrollView.ScrollBar(flag : Orientation) : BScrollBar; +begin + Result := BScrollView_ScrollBar(CPlusObject, flag); +end; + +procedure BScrollView.SetBorder(aborder : border_style); +begin + BScrollView_SetBorder(CPlusObject, aborder); +end; + +function BScrollView.Border : border_style; +begin + Result := BScrollView_Border(CPlusObject); +end; + +function BScrollView.SetBorderHighlighted(state : boolean) : Status_t; +begin + Result := BScrollView_SetBorderHighlighted(CPlusObject, state); +end; + +function BScrollView.IsBorderHighlighted : boolean; +begin + Result := BScrollView_IsBorderHighlighted(CPlusObject); +end; + +procedure BScrollView.SetTarget(new_target : BView); +begin + BScrollView_SetTarget(CPlusObject, new_target.CPlusObject); +end; + +function BScrollView.Target : BView; +begin + Result := BScrollView_Target(CPlusObject); +end; + +procedure BScrollView.MessageReceived(msg : BMessage); +begin + inherited; + //BScrollView_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BScrollView.MouseDown(pt : BPoint); +begin +// BScrollView_MouseDown(CPlusObject, pt.CPlusObject); +end; + +procedure BScrollView.WindowActivated(state : boolean); +begin + //BScrollView_WindowActivated(CPlusObject, state); +end; + +procedure BScrollView.MouseUp(pt : BPoint); +begin + //BScrollView_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BScrollView.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin + //BScrollView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BScrollView.DetachedFromWindow; +begin + //BScrollView_DetachedFromWindow(CPlusObject); +end; + +procedure BScrollView.AllAttached; +begin + //BScrollView_AllAttached(CPlusObject); +end; + +procedure BScrollView.AllDetached; +begin + //BScrollView_AllDetached(CPlusObject); +end; + +procedure BScrollView.FrameMoved(new_position : BPoint); +begin +// BScrollView_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BScrollView.FrameResized(new_width : double; new_height : double); +begin + //BScrollView_FrameResized(CPlusObject, new_width, new_height); +end; + +function BScrollView.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BScrollView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +procedure BScrollView.ResizeToPreferred; +begin + BScrollView_ResizeToPreferred(CPlusObject); +end; + +procedure BScrollView.GetPreferredSize(width : double; height : double); +begin + BScrollView_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BScrollView.MakeFocus(state : boolean); +begin + BScrollView_MakeFocus(CPlusObject, state); +end; + +function BScrollView.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BScrollView_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BScrollView.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BScrollView_Perform(CPlusObject, d, arg); +end; + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/statusbar.pp b/bepascal/source/bepascal/pas/src/be/interface/statusbar.pp new file mode 100644 index 0000000..c0f4e94 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/statusbar.pp @@ -0,0 +1,303 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit statusbar; + +interface + +uses + beobj, view, message, archivable, SupportDefs, rect, list, + handler, messenger,interfacedefs,font,graphicdefs; + +type + BStatusBar = class(BView) + private + public + constructor Create( frame : BRect; + name : pchar; + alabel : Pchar; + trailing_label : Pchar);virtual; + constructor Create(data : BMessage);virtual; + destructor Destroy;override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure AttachedToWindow;override; + procedure MessageReceived(msg : BMessage);override; + procedure Draw(updateRect : BRect);override; + procedure SetBarColor(color : rgb_color); + procedure SetBarHeight(height : double); + procedure SetText(str : PChar); + procedure SetTrailingText(str : PChar); + procedure SetMaxValue(max : double); + procedure Update(delta : single; main_text : PChar; trailing_text : PChar); + procedure Reset(alabel : PChar; trailing_label : PChar); + function CurrentValue : double; + function MaxValue : double; + function BarColor : rgb_color; + function BarHeight : double; + function Text : PChar; + function TrailingText : PChar; + function GetLabel : PChar; + function TrailingLabel : PChar; + procedure MouseDown(pt : BPoint);override; + procedure MouseUp(pt : BPoint);override; + procedure WindowActivated(state : boolean);override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override; + procedure DetachedFromWindow;override; + procedure FrameMoved(new_position : BPoint);override; + procedure FrameResized(new_width : double; new_height : double);override; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + procedure ResizeToPreferred;override; + procedure GetPreferredSize(width : double; height : double); + procedure MakeFocus(state : boolean); + procedure AllAttached;override; + procedure AllDetached;override; + + end; + +function BStatusBar_Create(AObject : TBeObject;frame : TCPlusObject; + name : pchar; + slabel : Pchar; + trailing_label : Pchar): TCPlusObject; cdecl; external BePascalLibName name 'BStatusBar_Create'; +function BStatusBar_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BStatusBar_Create'; +procedure BStatusBar_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_Free'; +function BStatusBar_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BStatusBar_Instantiate'; +function BStatusBar_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BStatusBar_Archive'; +procedure BStatusBar_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_AttachedToWindow'; +procedure BStatusBar_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_MessageReceived'; +procedure BStatusBar_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_Draw'; +procedure BStatusBar_SetBarColor(AObject : TCPlusObject; color : rgb_color); cdecl; external BePascalLibName name 'BStatusBar_SetBarColor'; +procedure BStatusBar_SetBarHeight(AObject : TCPlusObject; height : double); cdecl; external BePascalLibName name 'BStatusBar_SetBarHeight'; +procedure BStatusBar_SetText(AObject : TCPlusObject; str : PChar); cdecl; external BePascalLibName name 'BStatusBar_SetText'; +procedure BStatusBar_SetTrailingText(AObject : TCPlusObject; str : PChar); cdecl; external BePascalLibName name 'BStatusBar_SetTrailingText'; +procedure BStatusBar_SetMaxValue(AObject : TCPlusObject; max : double); cdecl; external BePascalLibName name 'BStatusBar_SetMaxValue'; +procedure BStatusBar_Update(AObject : TCPlusObject; delta : single; main_text : PChar; trailing_text : PChar); cdecl; external BePascalLibName name 'BStatusBar_Update'; +procedure BStatusBar_Reset(AObject : TCPlusObject; alabel : PChar; trailing_label : PChar); cdecl; external BePascalLibName name 'BStatusBar_Reset'; +function BStatusBar_CurrentValue(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BStatusBar_CurrentValue'; +function BStatusBar_MaxValue(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BStatusBar_MaxValue'; +function BStatusBar_BarColor(AObject : TCPlusObject) : rgb_color; cdecl; external BePascalLibName name 'BStatusBar_BarColor'; +function BStatusBar_BarHeight(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BStatusBar_BarHeight'; +function BStatusBar_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStatusBar_Text'; +function BStatusBar_TrailingText(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStatusBar_TrailingText'; +function BStatusBar_Label(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStatusBar_Label'; +function BStatusBar_TrailingLabel(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStatusBar_TrailingLabel'; +procedure BStatusBar_MouseDown(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_MouseDown'; +procedure BStatusBar_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_MouseUp'; +procedure BStatusBar_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BStatusBar_WindowActivated'; +procedure BStatusBar_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : BMessage); cdecl; external BePascalLibName name 'BStatusBar_MouseMoved'; +procedure BStatusBar_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_DetachedFromWindow'; +procedure BStatusBar_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_FrameMoved'; +procedure BStatusBar_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BStatusBar_FrameResized'; +function BStatusBar_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BStatusBar_ResolveSpecifier'; +procedure BStatusBar_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_ResizeToPreferred'; +procedure BStatusBar_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BStatusBar_GetPreferredSize'; +procedure BStatusBar_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BStatusBar_MakeFocus'; +procedure BStatusBar_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_AllAttached'; +procedure BStatusBar_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_AllDetached'; +function BStatusBar_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BStatusBar_GetSupportedSuites'; + +implementation + +constructor BStatusBar.Create(frame : BRect; + name : pchar; + alabel : Pchar; + trailing_label : Pchar); +begin + CreatePas; + CPlusObject := BStatusBar_Create(Self,frame.CPlusObject,name,alabel,trailing_label); +end; + +constructor BStatusBar.Create(data : BMessage); +begin + CreatePas; + CPlusObject := BStatusBar_Create(Self, data.CPlusObject); +end; + +destructor BStatusBar.Destroy; +begin + BStatusBar_Free(CPlusObject); + inherited; +end; + +function BStatusBar.Instantiate(data : BMessage) : BArchivable; +begin + Result := BStatusBar_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BStatusBar.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BStatusBar_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BStatusBar.AttachedToWindow; +begin + //BStatusBar_AttachedToWindow(CPlusObject); +end; + +procedure BStatusBar.MessageReceived(msg : BMessage); +begin + //BStatusBar_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BStatusBar.Draw(updateRect : BRect); +begin +// BStatusBar_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure BStatusBar.SetBarColor(color : rgb_color); +begin + BStatusBar_SetBarColor(CPlusObject, color); +end; + +procedure BStatusBar.SetBarHeight(height : double); +begin + BStatusBar_SetBarHeight(CPlusObject, height); +end; + +procedure BStatusBar.SetText(str : PChar); +begin + BStatusBar_SetText(CPlusObject, str); +end; + +procedure BStatusBar.SetTrailingText(str : PChar); +begin + BStatusBar_SetTrailingText(CPlusObject, str); +end; + +procedure BStatusBar.SetMaxValue(max : double); +begin + BStatusBar_SetMaxValue(CPlusObject, max); +end; + +procedure BStatusBar.Update(delta : single; main_text : PChar; trailing_text : PChar); +begin + BStatusBar_Update(CPlusObject, delta, main_text, trailing_text); +end; + +procedure BStatusBar.Reset(alabel : PChar; trailing_label : PChar); +begin + BStatusBar_Reset(CPlusObject, alabel, trailing_label); +end; + +function BStatusBar.CurrentValue : double; +begin + Result := BStatusBar_CurrentValue(CPlusObject); +end; + +function BStatusBar.MaxValue : double; +begin + Result := BStatusBar_MaxValue(CPlusObject); +end; + +function BStatusBar.BarColor : rgb_color; +begin + Result := BStatusBar_BarColor(CPlusObject); +end; + +function BStatusBar.BarHeight : double; +begin + Result := BStatusBar_BarHeight(CPlusObject); +end; + +function BStatusBar.Text : PChar; +begin + Result := BStatusBar_Text(CPlusObject); +end; + +function BStatusBar.TrailingText : PChar; +begin + Result := BStatusBar_TrailingText(CPlusObject); +end; + +function BStatusBar.GetLabel : PChar; +begin + Result := BStatusBar_Label(CPlusObject); +end; + +function BStatusBar.TrailingLabel : PChar; +begin + Result := BStatusBar_TrailingLabel(CPlusObject); +end; + +procedure BStatusBar.MouseDown(pt : BPoint); +begin +// BStatusBar_MouseDown(CPlusObject, pt.CPlusObject); +end; + +procedure BStatusBar.MouseUp(pt : BPoint); +begin +// BStatusBar_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BStatusBar.WindowActivated(state : boolean); +begin +// BStatusBar_WindowActivated(CPlusObject, state); +end; + +procedure BStatusBar.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin +// BStatusBar_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BStatusBar.DetachedFromWindow; +begin +// BStatusBar_DetachedFromWindow(CPlusObject); +end; + +procedure BStatusBar.FrameMoved(new_position : BPoint); +begin +// BStatusBar_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BStatusBar.FrameResized(new_width : double; new_height : double); +begin +// BStatusBar_FrameResized(CPlusObject, new_width, new_height); +end; + +function BStatusBar.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin +// Result := BStatusBar_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +procedure BStatusBar.ResizeToPreferred; +begin + BStatusBar_ResizeToPreferred(CPlusObject); +end; + +procedure BStatusBar.GetPreferredSize(width : double; height : double); +begin + BStatusBar_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BStatusBar.MakeFocus(state : boolean); +begin + BStatusBar_MakeFocus(CPlusObject, state); +end; + +procedure BStatusBar.AllAttached; +begin + BStatusBar_AllAttached(CPlusObject); +end; + +procedure BStatusBar.AllDetached; +begin + BStatusBar_AllDetached(CPlusObject); +end; + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/stringview.pp b/bepascal/source/bepascal/pas/src/be/interface/stringview.pp new file mode 100644 index 0000000..d792c10 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/stringview.pp @@ -0,0 +1,262 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit stringview; + +interface + +uses + beobj, interfacedefs,view,Message, Archivable, SupportDefs, Rect, Handler; + +type + BStringView = class(BView) + private + public + constructor Create(bounds : BRect; name : pchar; texte : pchar; resizeflags, flags : cardinal); virtual; + destructor Destroy; override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure SetText(texte : PChar); + function Text : PChar; + procedure SeAlignment(flag : Alignment); + function GetAlignment : Alignment; + procedure AttachedToWindow; override; + procedure Draw(bounds : BRect); override; + procedure MessageReceived(msg : BMessage);override; + procedure MouseDown(pt : BPoint);override; + procedure MouseUp(pt : BPoint);override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override; + procedure DetachedFromWindow;override; + procedure FrameMoved(new_position : BPoint);override; + procedure FrameResized(new_width : double; new_height : double);override; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + procedure ResizeToPreferred;override; + procedure GetPreferredSize(width : double; height : double); + procedure MakeFocus(state : boolean); + procedure AllAttached;override; + procedure AllDetached;override; + function GetSupportedSuites(data : BMessage) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; +// procedure _ReservedStringView1; +// procedure _ReservedStringView2; +// procedure _ReservedStringView3; +// function operator=( : BStringView) : BStringView; +// procedure char *fText; +// procedure alignment fAlign; +// procedure uint32 _reserved[3]; + end; + +function BStringView_Create(AObject : TBeObject;bounds : TCPlusObject; name : pchar; texte : pchar; resizeflags, flags : cardinal): TCPlusObject; cdecl; external BePascalLibName name 'BStringView_Create'; +procedure BStringView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_Free'; +function BStringView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BStringView_Instantiate'; +function BStringView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BStringView_Archive'; +procedure BStringView_SetText(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BStringView_SetText'; +function BStringView_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStringView_Text'; +procedure BStringView_SeAlignment(AObject : TCPlusObject; flag : Alignment); cdecl; external BePascalLibName name 'BStringView_SetAlignment'; +function BStringView_Alignment(AObject : TCPlusObject) : Alignment; cdecl; external BePascalLibName name 'BStringView_Alignment'; +procedure BStringView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_AttachedToWindow'; +procedure BStringView_Draw(AObject : TCPlusObject; bounds : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_Draw'; +procedure BStringView_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_MessageReceived'; +procedure BStringView_MouseDown(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_MouseDown'; +procedure BStringView_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_MouseUp'; +procedure BStringView_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_MouseMoved'; +procedure BStringView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_DetachedFromWindow'; +procedure BStringView_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_FrameMoved'; +procedure BStringView_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BStringView_FrameResized'; +function BStringView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BStringView_ResolveSpecifier'; +procedure BStringView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_ResizeToPreferred'; +procedure BStringView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BStringView_GetPreferredSize'; +procedure BStringView_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BStringView_MakeFocus'; +procedure BStringView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_AllAttached'; +procedure BStringView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_AllDetached'; +function BStringView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BStringView_GetSupportedSuites'; +function BStringView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BStringView_Perform'; +//procedure BStringView__ReservedStringView1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView__ReservedStringView1'; +//procedure BStringView__ReservedStringView2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView__ReservedStringView2'; +//procedure BStringView__ReservedStringView3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView__ReservedStringView3'; +//function BStringView_operator=(AObject : TCPlusObject; : BStringView) : BStringView; cdecl; external BePascalLibName name 'BStringView_operator='; +//procedure BStringView_char *fText(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_char *fText'; +//procedure BStringView_alignment fAlign(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_alignment fAlign'; +//procedure BStringView_uint32 _reserved[3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_uint32 _reserved[3]'; + +implementation + +constructor BStringView.Create(bounds : BRect; name : pchar; texte : pchar; resizeflags, flags : cardinal); +begin + CreatePas; + CPlusObject := BStringView_Create(Self,bounds.CPlusObject,name,texte,resizeflags, flags); +end; + +destructor BStringView.Destroy; +begin + BStringView_Free(CPlusObject); + inherited; +end; + +function BStringView.Instantiate(data : BMessage) : BArchivable; +begin + Result := BStringView_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BStringView.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BStringView_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BStringView.SetText(texte : PChar); +begin + BStringView_SetText(CPlusObject, texte); +end; + +function BStringView.Text : PChar; +begin + Result := BStringView_Text(CPlusObject); +end; + +procedure BStringView.SeAlignment(flag : Alignment); +begin + BStringView_SeAlignment(CPlusObject, flag); +end; + +function BStringView.getAlignment : Alignment; +begin + Result := BStringView_Alignment(CPlusObject); +end; + +procedure BStringView.AttachedToWindow; +begin +// BStringView_AttachedToWindow(CPlusObject); +end; + +procedure BStringView.Draw(bounds : BRect); +begin + // BStringView_Draw(CPlusObject, bounds.CPlusObject); +end; + +procedure BStringView.MessageReceived(msg : BMessage); +begin + //BStringView_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BStringView.MouseDown(pt : BPoint); +begin + //BStringView_MouseDown(CPlusObject, pt.CPlusObject); +end; + +procedure BStringView.MouseUp(pt : BPoint); +begin + //BStringView_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BStringView.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin + //BStringView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BStringView.DetachedFromWindow; +begin + //BStringView_DetachedFromWindow(CPlusObject); +end; + +procedure BStringView.FrameMoved(new_position : BPoint); +begin + //BStringView_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BStringView.FrameResized(new_width : double; new_height : double); +begin + //BStringView_FrameResized(CPlusObject, new_width, new_height); +end; + +function BStringView.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + // Result := BStringView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +procedure BStringView.ResizeToPreferred; +begin + //BStringView_ResizeToPreferred(CPlusObject); +end; + +procedure BStringView.GetPreferredSize(width : double; height : double); +begin + BStringView_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BStringView.MakeFocus(state : boolean); +begin + BStringView_MakeFocus(CPlusObject, state); +end; + +procedure BStringView.AllAttached; +begin + //BStringView_AllAttached(CPlusObject); +end; + +procedure BStringView.AllDetached; +begin + //BStringView_AllDetached(CPlusObject); +end; + +function BStringView.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BStringView_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BStringView.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + //Result := BStringView_Perform(CPlusObject, d, arg); +end; + +{procedure BStringView._ReservedStringView1; +begin + BStringView__ReservedStringView1(CPlusObject); +end; + +procedure BStringView._ReservedStringView2; +begin + BStringView__ReservedStringView2(CPlusObject); +end; + +procedure BStringView._ReservedStringView3; +begin + BStringView__ReservedStringView3(CPlusObject); +end; + +function BStringView.operator=( : BStringView) : BStringView; +begin + Result := BStringView_operator=(CPlusObject, ); +end; + +procedure BStringView.char *fText; +begin + BStringView_char *fText(CPlusObject); +end; + +procedure BStringView.alignment fAlign; +begin + BStringView_alignment fAlign(CPlusObject); +end; + +procedure BStringView.uint32 _reserved[3]; +begin + BStringView_uint32 _reserved[3](CPlusObject); +end; +} + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/tabview.pp b/bepascal/source/bepascal/pas/src/be/interface/tabview.pp new file mode 100644 index 0000000..c0055d0 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/tabview.pp @@ -0,0 +1,606 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit tabview; + +interface + +uses + beobj, interfacedefs,view,Message, Archivable, SupportDefs, Rect, Handler,font; + +const + B_TAB_FIRST = 999; + B_TAB_FRONT=1; + B_TAB_ANY=2; +type + BTab = class(TBeObject) + private + public + constructor Create(View : BView);virtual; + constructor Create_1(data : BMessage);virtual; + destructor Destroy;override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + function Perform(d : Cardinal; arg : Pointer) : Status_t; + function GetLabel : PChar; + procedure SetLabel(alabel : PChar); + function IsSelected : boolean; + procedure Select(owner : BView); + procedure Deselect; + procedure SetEnabled(aon : boolean); + function IsEnabled : boolean; + procedure MakeFocus(infocus : boolean); + function IsFocus : boolean; + procedure SeBView(contents : BView); + function GeBView : BView; + procedure DrawFocusMark(owner : BView; tabFrame : BRect); + procedure DrawLabel(owner : BView; tabFrame : BRect); + procedure DrawTab(owner : BView; tabFrame : BRect; position : byte; full : boolean); + end; + + +type + BTabView = class(BView) + private + public + destructor Destroy;override; + constructor Create(frame : BRect; name : Pchar; width : button_width; resizingMode : cardinal; flags : cardinal);virtual; + constructor Create(msg : BMessage);virtual; + function Instantiate( msg: BMessage) : BArchivable; + function Archive( msg : BMessage; deep : boolean) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + procedure WindowActivated(state : boolean);override; + procedure AttachedToWindow;override; + procedure AllAttached;override; + procedure AllDetached;override; + procedure DetachedFromWindow;override; + procedure MessageReceived(msg : BMessage);override; + procedure FrameMoved(new_position : BPoint);override; + procedure FrameResized(w : double; h : double);override; + procedure KeyDown(bytes : PChar; n : integer);override; + procedure MouseDown( pt: BPoint);override; + procedure MouseUp( pt: BPoint);override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override; + procedure Pulse;override; + procedure Select(tabIndex : integer); + function Selection : integer; + procedure MakeFocus(focusState : boolean); + procedure SetFocusTab(tabIndex : integer; focusState : boolean); + function FocusTab : integer; + procedure Draw( rect: BRect);override; + function DrawTabs : BRect; + procedure DrawBox(selectedTabFrame : BRect); + function TabFrame(tabIndex : integer) : BRect; + procedure SetFlags(flags : Cardinal); + procedure SetResizingMode(mode : Cardinal); + procedure GetPreferredSize(width : double; height : double); + procedure ResizeToPreferred;override; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + procedure AddTab(tabContents : BView; tab : BTab); + function RemoveTab(tabIndex : integer) : BTab; + function TabAt(tabIndex : integer) : BTab; + procedure SetTabWidth(s : button_width); + function TabWidth : button_width; + procedure SetTabHeight(height : double); + function TabHeight : double; + function ContainerView : BView; + function CountTabs : integer; + function ViewForTab(tabIndex : integer) : BView; + end; + +function BTab_Create(AObject : TBeObject;View : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTab_Create'; +procedure BTab_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTab_Free'; +function BTab_Create_1(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTab_Create_1'; +function BTab_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BTab_Instantiate'; +function BTab_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BTab_Archive'; +function BTab_Perform(AObject : TCPlusObject; d : Cardinal; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BTab_Perform'; +function BTab_Label(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BTab_Label'; +procedure BTab_SetLabel(AObject : TCPlusObject; alabel : PChar); cdecl; external BePascalLibName name 'BTab_SetLabel'; +function BTab_IsSelected(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTab_IsSelected'; +procedure BTab_Select(AObject : TCPlusObject; owner : TCPlusObject); cdecl; external BePascalLibName name 'BTab_Select'; +procedure BTab_Deselect(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTab_Deselect'; +procedure BTab_SetEnabled(AObject : TCPlusObject; aon : boolean); cdecl; external BePascalLibName name 'BTab_SetEnabled'; +function BTab_IsEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTab_IsEnabled'; +procedure BTab_MakeFocus(AObject : TCPlusObject; infocus : boolean); cdecl; external BePascalLibName name 'BTab_MakeFocus'; +function BTab_IsFocus(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTab_IsFocus'; +procedure BTab_SeBView(AObject : TCPlusObject; contents : TCPlusObject); cdecl; external BePascalLibName name 'BTab_SetView'; +function BTab_View(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BTab_View'; +procedure BTab_DrawFocusMark(AObject : TCPlusObject; owner : TCPlusObject; tabFrame : TCPlusObject); cdecl; external BePascalLibName name 'BTab_DrawFocusMark'; +procedure BTab_DrawLabel(AObject : TCPlusObject; owner : TCPlusObject; tabFrame : TCPlusObject); cdecl; external BePascalLibName name 'BTab_DrawLabel'; +procedure BTab_DrawTab(AObject : TCPlusObject; owner : TCPlusObject; tabFrame : TCPlusObject; position : byte; full : boolean); cdecl; external BePascalLibName name 'BTab_DrawTab'; + +procedure BTabView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_Free'; +function BTabView_Create(AObject : TBeObject;frame : TCPlusObject; name : Pchar; width : Integer; resizingMode : cardinal; flags : cardinal): TCPlusObject; cdecl; external BePascalLibName name 'BTabView_Create'; +function BTabView_Create_1(AObject : TBeObject; msg : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTabView_Create_1'; +function BTabView_Instantiate(AObject : TCPlusObject; msg : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BTabView_Instantiate'; +function BTabView_Archive(AObject : TCPlusObject; msg : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BTabView_Archive'; +function BTabView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BTabView_Perform'; +procedure BTabView_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BTabView_WindowActivated'; +procedure BTabView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_AttachedToWindow'; +procedure BTabView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_AllAttached'; +procedure BTabView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_AllDetached'; +procedure BTabView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_DetachedFromWindow'; +procedure BTabView_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_MessageReceived'; +procedure BTabView_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_FrameMoved'; +procedure BTabView_FrameResized(AObject : TCPlusObject; w : double; h : double); cdecl; external BePascalLibName name 'BTabView_FrameResized'; +procedure BTabView_KeyDown(AObject : TCPlusObject; bytes : PChar; n : integer); cdecl; external BePascalLibName name 'BTabView_KeyDown'; +procedure BTabView_MouseDown(AObject : TCPlusObject; pt: TCPlusObject); cdecl; external BePascalLibName name 'BTabView_MouseDown'; +procedure BTabView_MouseUp(AObject : TCPlusObject; pt: TCPlusObject); cdecl; external BePascalLibName name 'BTabView_MouseUp'; +procedure BTabView_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_MouseMoved'; +procedure BTabView_Pulse(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_Pulse'; +procedure BTabView_Select(AObject : TCPlusObject; tabIndex : integer); cdecl; external BePascalLibName name 'BTabView_Select'; +//function BTabView_Selection(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTabView_Selection'; +procedure BTabView_MakeFocus(AObject : TCPlusObject; focusState : boolean); cdecl; external BePascalLibName name 'BTabView_MakeFocus'; +procedure BTabView_SetFocusTab(AObject : TCPlusObject; tabIndex : integer; focusState : boolean); cdecl; external BePascalLibName name 'BTabView_SetFocusTab'; +function BTabView_FocusTab(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTabView_FocusTab'; +procedure BTabView_Draw(AObject : TCPlusObject; rect : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_Draw'; +//function BTabView_DrawTabs(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BTabView_DrawTabs'; +procedure BTabView_DrawBox(AObject : TCPlusObject; selectedTabFrame : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_DrawBox'; +function BTabView_TabFrame(AObject : TCPlusObject; tabIndex : integer) : BRect; cdecl; external BePascalLibName name 'BTabView_TabFrame'; +procedure BTabView_SetFlags(AObject : TCPlusObject; flags : Cardinal); cdecl; external BePascalLibName name 'BTabView_SetFlags'; +procedure BTabView_SetResizingMode(AObject : TCPlusObject; mode : Cardinal); cdecl; external BePascalLibName name 'BTabView_SetResizingMode'; +procedure BTabView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BTabView_GetPreferredSize'; +procedure BTabView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_ResizeToPreferred'; +function BTabView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properto : PChar) : BHandler; cdecl; external BePascalLibName name 'BTabView_ResolveSpecifier'; +function BTabView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BTabView_GetSupportedSuites'; +procedure BTabView_AddTab(AObject : TCPlusObject; tabContents : TCPlusObject; tab : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_AddTab'; +function BTabView_RemoveTab(AObject : TCPlusObject; tabIndex : integer) : BTab; cdecl; external BePascalLibName name 'BTabView_RemoveTab'; +function BTabView_TabAt(AObject : TCPlusObject; tabIndex : integer) : BTab; cdecl; external BePascalLibName name 'BTabView_TabAt'; +procedure BTabView_SetTabWidth(AObject : TCPlusObject; s : button_width); cdecl; external BePascalLibName name 'BTabView_SetTabWidth'; +function BTabView_TabWidth(AObject : TCPlusObject) : button_width; cdecl; external BePascalLibName name 'BTabView_TabWidth'; +procedure BTabView_SetTabHeight(AObject : TCPlusObject; height : double); cdecl; external BePascalLibName name 'BTabView_SetTabHeight'; +function BTabView_TabHeight(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BTabView_TabHeight'; +function BTabView_ContainerView(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BTabView_ContainerView'; +function BTabView_CountTabs(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTabView_CountTabs'; +function BTabView_ViewForTab(AObject : TCPlusObject; tabIndex : integer) : BView; cdecl; external BePascalLibName name 'BTabView_ViewForTab'; + +implementation + +var + TabView_AddTab_hook : Pointer; cvar; external; + TabView_Draw_hook : Pointer; cvar; external; + TabView_DrawBox_hook : Pointer; cvar; external; + TabView_DrawTabs_hook : Pointer; cvar; external; + TabView_MakeFocus_hook : Pointer; cvar; external; + TabView_RemoveTab_hook : Pointer; cvar; external; + TabView_Select_hook: Pointer; cvar; external; + TabView_SetFocusTab_hook : Pointer; cvar; external; + TabView_SetTabHeight_hook : Pointer; cvar; external; + TabView_SetTabWidth_hook : Pointer; cvar; external; + TabView_TabAt_hook : Pointer; cvar; external; + TabView_TabFrame_hook : Pointer; cvar; external; + + +constructor BTab.Create(View : BView); +begin + CreatePas; + CPlusObject := BTab_Create(Self,View.CPlusObject); +end; + +destructor BTab.Destroy; +begin + BTab_Free(CPlusObject); + inherited; +end; + +constructor BTab.Create_1(data : BMessage); +begin + CreatePas; + CPlusObject := BTab_Create_1(Self, data.CPlusObject); +end; + +function BTab.Instantiate(data : BMessage) : BArchivable; +begin + Result := BTab_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BTab.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BTab_Archive(CPlusObject, data.CPlusObject, deep); +end; + +function BTab.Perform(d : Cardinal; arg : Pointer) : Status_t; +begin + Result := BTab_Perform(CPlusObject, d, arg); +end; + +function BTab.GetLabel : PChar; +begin + Result := BTab_Label(CPlusObject); +end; + +procedure BTab.SetLabel(alabel : PChar); +begin + BTab_SetLabel(CPlusObject, alabel); +end; + +function BTab.IsSelected : boolean; +begin + Result := BTab_IsSelected(CPlusObject); +end; + +procedure BTab.Select(owner : BView); +begin + BTab_Select(CPlusObject, owner.CPlusObject); +end; + +procedure BTab.Deselect; +begin + BTab_Deselect(CPlusObject); +end; + +procedure BTab.SetEnabled(aon : boolean); +begin + BTab_SetEnabled(CPlusObject, aon); +end; + +function BTab.IsEnabled : boolean; +begin + Result := BTab_IsEnabled(CPlusObject); +end; + +procedure BTab.MakeFocus(infocus : boolean); +begin + BTab_MakeFocus(CPlusObject, infocus); +end; + +function BTab.IsFocus : boolean; +begin + Result := BTab_IsFocus(CPlusObject); +end; + +procedure BTab.SeBView(contents : BView); +begin + BTab_SeBView(CPlusObject, contents.CPlusObject); +end; + +function BTab.GeBView : BView; +begin + Result := BTab_View(CPlusObject); +end; + +procedure BTab.DrawFocusMark(owner : BView; tabFrame : BRect); +begin + BTab_DrawFocusMark(CPlusObject, owner.CPlusObject, tabFrame.CPlusObject); +end; + +procedure BTab.DrawLabel(owner : BView; tabFrame : BRect); +begin + BTab_DrawLabel(CPlusObject, owner.CPlusObject, tabFrame.CPlusObject); +end; + +procedure BTab.DrawTab(owner : BView; tabFrame : BRect; position: byte; full : boolean); +begin + BTab_DrawTab(CPlusObject, owner.CPlusObject, tabFrame.CPlusObject, position, full); +end; + + +//--------------------BTabView + +destructor BTabView.Destroy; +begin + BTabView_Free(CPlusObject); + inherited; +end; + +constructor BTabView.Create( frame : BRect; name : Pchar; width : button_width; resizingMode : cardinal; flags : cardinal); +begin + createPas; + CPlusObject := BTabView_Create(Self, frame.CPlusObject, name, Integer(width),resizingMode,flags); +end; + + +constructor BTabView.Create( msg: BMessage); +begin + createPas; + CPlusObject := BTabView_Create_1(Self, msg.CPlusObject); +end; + +function BTabView.Instantiate( msg : BMessage) : BArchivable; +begin + Result := BTabView_Instantiate(CPlusObject, msg.CPlusObject); +end; + +function BTabView.Archive( msg : BMessage; deep : boolean) : Status_t; +begin + Result := BTabView_Archive(CPlusObject, msg.CPlusObject, deep); +end; + +function BTabView.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + // Result := BTabView_Perform(CPlusObject, d, arg); +end; + +procedure BTabView.WindowActivated(state : boolean); +begin + //BTabView_WindowActivated(CPlusObject, state); +end; + +procedure BTabView.AttachedToWindow; +begin + //BTabView_AttachedToWindow(CPlusObject); +end; + +procedure BTabView.AllAttached; +begin + //BTabView_AllAttached(CPlusObject); +end; + +procedure BTabView.AllDetached; +begin + //BTabView_AllDetached(CPlusObject); +end; + +procedure BTabView.DetachedFromWindow; +begin +// BTabView_DetachedFromWindow(CPlusObject); +end; + +procedure BTabView.MessageReceived(msg : BMessage); +begin + // BTabView_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure BTabView.FrameMoved(new_position : BPoint); +begin + //BTabView_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BTabView.FrameResized(w : double; h : double); +begin +// BTabView_FrameResized(CPlusObject, w, h); +end; + +procedure BTabView.KeyDown(bytes : PChar; n : integer); +begin + // BTabView_KeyDown(CPlusObject, bytes, n); +end; + +procedure BTabView.MouseDown( pt: BPoint); +begin + //BTabView_MouseDown(CPlusObject, pt.CPlusObject); +end; + +procedure BTabView.MouseUp( pt: BPoint); +begin + //BTabView_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BTabView.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin + //BTabView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BTabView.Pulse; +begin + // BTabView_Pulse(CPlusObject); +end; + +procedure BTabView.Select(tabIndex : integer); +begin + BTabView_Select(CPlusObject, tabIndex); +end; + +function BTabView.Selection : integer; +begin +// Result := BTabView_Selection(CPlusObject); +end; + +procedure BTabView.MakeFocus(focusState : boolean); +begin + BTabView_MakeFocus(CPlusObject, focusState); +end; + +procedure BTabView.SetFocusTab(tabIndex : integer; focusState : boolean); +begin + BTabView_SetFocusTab(CPlusObject, tabIndex, focusState); +end; + +function BTabView.FocusTab : integer; +begin + Result := BTabView_FocusTab(CPlusObject); +end; + +procedure BTabView.Draw( rect: BRect); +begin + // BTabView_Draw(CPlusObject, rect.CPlusObject); +end; + +function BTabView.DrawTabs : BRect; +begin +// Result := BTabView_DrawTabs(CPlusObject); +end; + +procedure BTabView.DrawBox(selectedTabFrame : BRect); +begin + //BTabView_DrawBox(CPlusObject, selectedTabFrame.CPlusObject); +end; + +function BTabView.TabFrame(tabIndex : integer) : BRect; +begin + Result := BTabView_TabFrame(CPlusObject, tabIndex); +end; + +procedure BTabView.SetFlags(flags : Cardinal); +begin + BTabView_SetFlags(CPlusObject, flags); +end; + +procedure BTabView.SetResizingMode(mode : Cardinal); +begin + BTabView_SetResizingMode(CPlusObject, mode); +end; + +procedure BTabView.GetPreferredSize(width : double; height : double); +begin +// BTabView_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BTabView.ResizeToPreferred; +begin + // BTabView_ResizeToPreferred(CPlusObject); +end; + +function BTabView.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + //Result := BTabView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +function BTabView.GetSupportedSuites(data : BMessage) : Status_t; +begin + //Result := BTabView_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +procedure BTabView.AddTab(tabContents : BView; tab : BTab); +begin + BTabView_AddTab(CPlusObject, tabContents.CPlusObject, tab.CPlusObject); +end; + +function BTabView.RemoveTab(tabIndex : integer) : BTab; +begin + Result := BTabView_RemoveTab(CPlusObject, tabIndex); +end; + + +function BTabView.TabAt(tabIndex : integer) : BTab; +begin + Result := BTabView_TabAt(CPlusObject, tabIndex); +end; + +procedure BTabView.SetTabWidth(s : button_width); +begin + BTabView_SetTabWidth(CPlusObject, s); +end; + +function BTabView.TabWidth : button_width; +begin + Result := BTabView_TabWidth(CPlusObject); +end; + +procedure BTabView.SetTabHeight(height : double); +begin + BTabView_SetTabHeight(CPlusObject, height); +end; + +function BTabView.TabHeight : double; +begin + Result := BTabView_TabHeight(CPlusObject); +end; + +function BTabView.ContainerView : BView; +begin + Result := BTabView_ContainerView(CPlusObject); +end; + +function BTabView.CountTabs : integer; +begin + Result := BTabView_CountTabs(CPlusObject); +end; + +function BTabView.ViewForTab(tabIndex : integer) : BView; +begin + Result := BTabView_ViewForTab(CPlusObject, tabIndex); +end; + + +//////////////////////////////////////////////////////////////////////////// +// Hook +//////////////////////////////////////////////////////////////////////////// + +procedure BTabView_AddTab_hook_func(tabw : BTabView; target : TCPlusObject; tab : TCPlusObject); cdecl; +Var targetv : BView; + tabtab : BTab; +begin + targetv:=BView.Wrap(target); + tabtab:=BTab.Wrap(tab); + if Tabw <> nil Then Tabw.AddTab(targetv,tabtab); + targetv.UnWrap; + tabtab.UNWrap; +end; + +procedure BTabView_Draw_hook_func(tabw : BTabView; updaterect : TCPlusObject);cdecl; +var rect : BRect; +begin + rect:=BRect.Wrap(updaterect); + if tabw <> nil then tabw.draw(rect); + rect.UnWrap; +end; + +procedure BTabView_DrawBox_hook_func(tabw : BTabView; updaterect : TCPlusObject);cdecl; +var rect : BRect; +begin + rect:=BRect.Wrap(updaterect); + if tabw <> nil then tabw.drawBox(rect); + rect.UnWrap; +end; + +procedure BTabView_DrawTabs_hook_func(tabw : BTabView);cdecl; +begin + if tabw <> nil then tabw.drawTabs; +end; + +procedure BTabView_MakeFocus_hook_func;cdecl; +begin +end; + +procedure BTabView_RemoveTab_hook_func;cdecl; +begin +end; + +procedure BTabView_Select_hook_func;cdecl; +begin +end; + +procedure BTabView_SetFocusTab_hook_func;cdecl; +begin +end; + +procedure BTabView_SetTabHeight_hook_func;cdecl; +begin +end; + +procedure BTabView_SetTabWidth_hook_func;cdecl; +begin +end; + +procedure BTabView_TabAt_hook_func;cdecl; +begin +end; + +procedure BTabView_TabFrame_hook_func;cdecl; +begin +end; + + +initialization + + {TabView_AddTab_hook := @BTabView_AddTab_hook_func; + TabView_Draw_hook :=@BTabView_Draw_hook_func; + TabView_DrawBox_hook :=@BTabView_DrawBox_hook_func; + TabView_DrawTabs_hook :=@BTabView_DrawTabs_hook_func; + TabView_MakeFocus_hook :=@BTabView_MakeFocus_hook_func; + TabView_RemoveTab_hook :=@BTabView_RemoveTab_hook_func; + TabView_Select_hook:=@BTabView_Select_hook_func; + TabView_SetFocusTab_hook :=@BTabView_SetFocusTab_hook_func; + TabView_SetTabHeight_hook :=@BTabView_SetTabHeight_hook_func; + TabView_SetTabWidth_hook :=@BTabView_SetTabWidth_hook_func; + TabView_TabAt_hook :=@BTabView_TabAt_hook_func; + TabView_TabFrame_hook :=@BTabView_TabFrame_hook_func; + } +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/textcontrol.pp b/bepascal/source/bepascal/pas/src/be/interface/textcontrol.pp new file mode 100644 index 0000000..ad4dd92 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/textcontrol.pp @@ -0,0 +1,434 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + Oscar Lesta + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit TextControl; + +interface + +uses + beobj, Control, Message, Archivable, SupportDefs, Rect, Handler,interfacedefs; + +type + BTextControl = class(BControl) + private + public + destructor Destroy;override; + constructor Create(frame : BRect; name, aLabel,initial : PChar; message : BMessage; resizingMode, flags : Cardinal); virtual; + constructor Create(data : BMessage);override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure SetText(texte : PChar); + function Text : PChar; + procedure SetValue(valu : integer); + function Invoke(msg : BMessage) : Status_t; + function TextView : BTextControl; + procedure SetModificationMessage(message : BMessage); + function ModificationMessage : BMessage; + procedure SetAlignment(alabel : Alignment; texte : Alignment); + procedure GeAlignment(alabel : Alignment; texte : Alignment); + procedure SetDivider(dividing_line : single); + function Divider : single; + procedure Draw(updateRect : BRect);override; + procedure MouseDown(where : BPoint);override; + procedure AttachedToWindow;override; + procedure MakeFocus(focusState : boolean);override; + procedure SetEnabled(state : boolean); + procedure FrameMoved(new_position : BPoint);override; + procedure FrameResized(new_width : double; new_height : double);override; + procedure WindowActivated(active : boolean);override; + procedure GetPreferredSize(width : double; height : double); + procedure ResizeToPreferred;override; + procedure MessageReceived(msg : BMessage);override; + function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + procedure MouseUp(pt : BPoint);override; + procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override; + procedure DetachedFromWindow;override; + procedure AllAttached;override; + procedure AllDetached;override; + function GetSupportedSuites(data : BMessage) : Status_t; + procedure SetFlags(flags : Cardinal); + function Perform(d : Perform_code; arg : Pointer) : Status_t; + { procedure _ReservedTextControl1; + procedure _ReservedTextControl2; + procedure _ReservedTextControl3; + procedure _ReservedTextControl4; + function operator=( : BTextControl) : BTextControl; + procedure CommitValue; + procedure InitData(label : PChar; initial_text : PChar; data : BMessage); + procedure _BTextInput_ *fText; + procedure char *fLabel; + procedure BMessage *fModificationMessage; + procedure alignment fLabelAlign; + procedure float fDivider; + procedure uint16 fPrevWidth; + procedure uint16 fPrevHeight; + procedure uint32 _reserved[3]; + procedure uint32 _more_reserved[4]; + procedure bool fClean; + procedure bool fSkipSetFlags; + procedure bool fUnusedBool1; + procedure bool fUnusedBool2; + } + end; + +procedure BTextControl_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_Free'; +function BTextControl_Create(AObject : TBeObject; frame : TCPlusObject; name, aLabel ,initial: PChar; message : TCPlusObject; resizingMode, flags : Cardinal): TCPlusObject; cdecl; external BePascalLibName name 'BTextControl_Create'; +function BTextControl_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTextControl_Create_1'; +function BTextControl_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BTextControl_Instantiate'; +function BTextControl_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BTextControl_Archive'; +procedure BTextControl_SetText(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BTextControl_SetText'; +function BTextControl_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BTextControl_Text'; +procedure BTextControl_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BTextControl_SetValue'; +function BTextControl_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BTextControl_Invoke'; +function BTextControl_TextView(AObject : TCPlusObject) : BTextControl; cdecl; external BePascalLibName name 'BTextControl_TextView'; +procedure BTextControl_SetModificationMessage(AObject : TCPlusObject; message : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_SetModificationMessage'; +function BTextControl_ModificationMessage(AObject : TCPlusObject) : BMessage; cdecl; external BePascalLibName name 'BTextControl_ModificationMessage'; +procedure BTextControl_SeAlignment(AObject : TCPlusObject; alabel : Alignment; texte : Alignment); cdecl; external BePascalLibName name 'BTextControl_SetAlignment'; +procedure BTextControl_GeAlignment(AObject : TCPlusObject; alabel : Alignment; texte : Alignment); cdecl; external BePascalLibName name 'BTextControl_GetAlignment'; +procedure BTextControl_SetDivider(AObject : TCPlusObject; dividing_line : single); cdecl; external BePascalLibName name 'BTextControl_SetDivider'; +function BTextControl_Divider(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BTextControl_Divider'; +procedure BTextControl_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_Draw'; +procedure BTextControl_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_MouseDown'; +procedure BTextControl_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_AttachedToWindow'; +procedure BTextControl_MakeFocus(AObject : TCPlusObject; focusState : boolean); cdecl; external BePascalLibName name 'BTextControl_MakeFocus'; +procedure BTextControl_SetEnabled(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BTextControl_SetEnabled'; +procedure BTextControl_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_FrameMoved'; +procedure BTextControl_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BTextControl_FrameResized'; +procedure BTextControl_WindowActivated(AObject : TCPlusObject; active : boolean); cdecl; external BePascalLibName name 'BTextControl_WindowActivated'; +procedure BTextControl_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BTextControl_GetPreferredSize'; +procedure BTextControl_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_ResizeToPreferred'; +procedure BTextControl_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_MessageReceived'; +function BTextControl_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BTextControl_ResolveSpecifier'; +procedure BTextControl_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_MouseUp'; +procedure BTextControl_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_MouseMoved'; +procedure BTextControl_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_DetachedFromWindow'; +procedure BTextControl_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_AllAttached'; +procedure BTextControl_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_AllDetached'; +function BTextControl_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BTextControl_GetSupportedSuites'; +procedure BTextControl_SetFlags(AObject : TCPlusObject; flags : Cardinal); cdecl; external BePascalLibName name 'BTextControl_SetFlags'; +function BTextControl_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BTextControl_Perform'; + + + +{procedure BTextControl__ReservedTextControl1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl__ReservedTextControl1'; +procedure BTextControl__ReservedTextControl2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl__ReservedTextControl2'; +procedure BTextControl__ReservedTextControl3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl__ReservedTextControl3'; +procedure BTextControl__ReservedTextControl4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl__ReservedTextControl4'; +function BTextControl_operator=(AObject : TCPlusObject; : BTextControl) : BTextControl; cdecl; external BePascalLibName name 'BTextControl_operator='; +procedure BTextControl_CommitValue(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_CommitValue'; +procedure BTextControl_InitData(AObject : TCPlusObject; label : PChar; initial_text : PChar; data : BMessage); cdecl; external BePascalLibName name 'BTextControl_InitData'; +procedure BTextControl__BTextInput_ *fText(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl__BTextInput_ *fText'; +procedure BTextControl_char *fLabel(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_char *fLabel'; +procedure BTextControl_BMessage *fModificationMessage(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_BMessage *fModificationMessage'; +procedure BTextControl_alignment fLabelAlign(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_alignment fLabelAlign'; +procedure BTextControl_float fDivider(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_float fDivider'; +procedure BTextControl_uint16 fPrevWidth(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_uint16 fPrevWidth'; +procedure BTextControl_uint16 fPrevHeight(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_uint16 fPrevHeight'; +procedure BTextControl_uint32 _reserved[3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_uint32 _reserved[3]'; +procedure BTextControl_uint32 _more_reserved[4](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_uint32 _more_reserved[4]'; +procedure BTextControl_bool fClean(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_bool fClean'; +procedure BTextControl_bool fSkipSetFlags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_bool fSkipSetFlags'; +procedure BTextControl_bool fUnusedBool1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_bool fUnusedBool1'; +procedure BTextControl_bool fUnusedBool2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_bool fUnusedBool2'; +} +implementation + +destructor BTextControl.Destroy; +begin + BTextControl_Free(CPlusObject); + inherited; +end; + +constructor BTextControl.Create(frame : BRect; name, aLabel,initial : PChar; message : BMessage; resizingMode, flags : Cardinal); +begin + CreatePas; + CPlusObject := BTextControl_Create(Self, frame.CPlusObject, name, aLabel,initial, message.CPlusObject, resizingMode, flags); +end; + + +constructor BTextControl.Create(data : BMessage); +begin + CreatePas; + CPlusObject := BTextControl_Create(Self, data.CPlusObject); +end; + +function BTextControl.Instantiate(data : BMessage) : BArchivable; +begin + Result := BTextControl_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BTextControl.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BTextControl_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BTextControl.SetText(texte : PChar); +begin + BTextControl_SetText(CPlusObject, texte); +end; + +function BTextControl.Text : PChar; +begin + Result := BTextControl_Text(CPlusObject); +end; + +procedure BTextControl.SetValue(valu : integer); +begin + BTextControl_SetValue(CPlusObject, valu); +end; + +function BTextControl.Invoke(msg : BMessage) : Status_t; +begin + Result := BTextControl_Invoke(CPlusObject, msg.CPlusObject); +end; + +function BTextControl.TextView : BTextControl; +begin + Result := BTextControl_TextView(CPlusObject); +end; + +procedure BTextControl.SetModificationMessage(message : BMessage); +begin + BTextControl_SetModificationMessage(CPlusObject, message.CPlusObject); +end; + +function BTextControl.ModificationMessage : BMessage; +begin + Result := BTextControl_ModificationMessage(CPlusObject); +end; + +procedure BTextControl.SetAlignment(alabel : Alignment; texte : Alignment); +begin + BTextControl_SeAlignment(CPlusObject, alabel, texte); +end; + +procedure BTextControl.GeAlignment(alabel : Alignment; texte : Alignment); +begin + BTextControl_GeAlignment(CPlusObject, alabel, texte); +end; + +procedure BTextControl.SetDivider(dividing_line : single); +begin + BTextControl_SetDivider(CPlusObject, dividing_line); +end; + +function BTextControl.Divider : single; +begin + Result := BTextControl_Divider(CPlusObject); +end; + +procedure BTextControl.Draw(updateRect : BRect); +begin +end; + +procedure BTextControl.MouseDown(where : BPoint); +begin +end; + +procedure BTextControl.AttachedToWindow; +begin +end; + +procedure BTextControl.MakeFocus(focusState : boolean); +begin + BTextControl_MakeFocus(CPlusObject, focusState); +end; + +procedure BTextControl.SetEnabled(state : boolean); +begin + BTextControl_SetEnabled(CPlusObject, state); +end; + +procedure BTextControl.FrameMoved(new_position : BPoint); +begin +end; + +procedure BTextControl.FrameResized(new_width : double; new_height : double); +begin +// BTextControl_FrameResized(CPlusObject, new_width, new_height); +end; + +procedure BTextControl.WindowActivated(active : boolean); +begin + //BTextControl_WindowActivated(CPlusObject, active); +end; + +procedure BTextControl.GetPreferredSize(width : double; height : double); +begin + //BTextControl_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BTextControl.ResizeToPreferred; +begin + //BTextControl_ResizeToPreferred(CPlusObject); +end; + +procedure BTextControl.MessageReceived(msg : BMessage); +begin + //BTextControl_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +function BTextControl.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + Result := BTextControl_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +procedure BTextControl.MouseUp(pt : BPoint); +begin + //BTextControl_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure BTextControl.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +begin + //BTextControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure BTextControl.DetachedFromWindow; +begin + //BTextControl_DetachedFromWindow(CPlusObject); +end; + +procedure BTextControl.AllAttached; +begin + //BTextControl_AllAttached(CPlusObject); +end; + +procedure BTextControl.AllDetached; +begin + //BTextControl_AllDetached(CPlusObject); +end; + +function BTextControl.GetSupportedSuites(data : BMessage) : Status_t; +begin + + Result := BTextControl_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +procedure BTextControl.SetFlags(flags : Cardinal); +begin + BTextControl_SetFlags(CPlusObject, flags); +end; + +function BTextControl.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BTextControl_Perform(CPlusObject, d, arg); +end; + +{procedure BTextControl._ReservedTextControl1; +begin + BTextControl__ReservedTextControl1(CPlusObject); +end; + +procedure BTextControl._ReservedTextControl2; +begin + BTextControl__ReservedTextControl2(CPlusObject); +end; + +procedure BTextControl._ReservedTextControl3; +begin + BTextControl__ReservedTextControl3(CPlusObject); +end; + +procedure BTextControl._ReservedTextControl4; +begin + BTextControl__ReservedTextControl4(CPlusObject); +end; + +function BTextControl.operator=( : BTextControl) : BTextControl; +begin + Result := BTextControl_operator=(CPlusObject, ); +end; + +procedure BTextControl.CommitValue; +begin + BTextControl_CommitValue(CPlusObject); +end; + +procedure BTextControl.InitData(label : PChar; initial_text : PChar; data : BMessage); +begin + BTextControl_InitData(CPlusObject, label, initial_text, data.CPlusObject); +end; + +procedure BTextControl._BTextInput_ *fText; +begin + BTextControl__BTextInput_ *fText(CPlusObject); +end; + +procedure BTextControl.char *fLabel; +begin + BTextControl_char *fLabel(CPlusObject); +end; + +procedure BTextControl.BMessage *fModificationMessage; +begin + BTextControl_BMessage *fModificationMessage(CPlusObject); +end; + +procedure BTextControl.alignment fLabelAlign; +begin + BTextControl_alignment fLabelAlign(CPlusObject); +end; + +procedure BTextControl.float fDivider; +begin + BTextControl_float fDivider(CPlusObject); +end; + +procedure BTextControl.uint16 fPrevWidth; +begin + BTextControl_uint16 fPrevWidth(CPlusObject); +end; + +procedure BTextControl.uint16 fPrevHeight; +begin + BTextControl_uint16 fPrevHeight(CPlusObject); +end; + +procedure BTextControl.uint32 _reserved[3]; +begin + BTextControl_uint32 _reserved[3](CPlusObject); +end; + +procedure BTextControl.uint32 _more_reserved[4]; +begin + BTextControl_uint32 _more_reserved[4](CPlusObject); +end; + +procedure BTextControl.bool fClean; +begin + BTextControl_bool fClean(CPlusObject); +end; + +procedure BTextControl.bool fSkipSetFlags; +begin + BTextControl_bool fSkipSetFlags(CPlusObject); +end; + +procedure BTextControl.bool fUnusedBool1; +begin + BTextControl_bool fUnusedBool1(CPlusObject); +end; + +procedure BTextControl.bool fUnusedBool2; +begin + BTextControl_bool fUnusedBool2(CPlusObject); +end; +} + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/textview.pp b/bepascal/source/bepascal/pas/src/be/interface/textview.pp new file mode 100644 index 0000000..ce828b5 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/textview.pp @@ -0,0 +1,850 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit textview; + +interface + +uses + beobj, view, message, archivable, SupportDefs, rect, list, + handler, messenger,interfacedefs,font,graphicdefs; +type + text_run = Record + offset : LongInt; + font : BFont; + color : RGB_color; +end; + +type + text_run_array = Record + count : LongInt; + runs : Array[1..1] of text_run ; + end; + +type +undo_state =(undo_state_nil, + B_UNDO_UNAVAILABLE, + B_UNDO_TYPING, + B_UNDO_CUT, + B_UNDO_PASTE, + B_UNDO_CLEAR, + B_UNDO_DROP); + +type + BTextView = class(BView) + private + public + constructor Create(frame : BRect; name : pchar;atexBRect: BRect ; resizeMask, flags : cardinal); virtual; +// constructor Create(bounds : BRect; name : pchar; texte : pchar; resizeflags, flags : cardinal); virtual; + constructor Create(data : BMessage);virtual; + destructor Destroy;override; + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure AttachedToWindow;override; + procedure DetachedFromWindow;override; + procedure Draw(inRect : BRect);override; + procedure MouseDown(where : BPoint);override; + procedure MouseUp(where : BPoint);override; + procedure MouseMoved(where : BPoint; code : Cardinal; message : BMessage);override; + procedure WindowActivated(state : boolean);override; + procedure KeyDown(bytes : PChar; numBytes : integer);override; + procedure Pulse;override; + procedure FrameResized(width : double; height : double);override; + procedure MakeFocus(focusState : boolean); + procedure MessageReceived(message : BMessage);override; + function ResolveSpecifier(message : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + procedure SetText(inText : PChar; var inRuns : text_run_array); + procedure SetText(inText : PChar; inLength : integer; var inRuns : text_run_array); +// procedure SetText(inFile : TFile; startOffset : integer; inLength : integer; var inRuns : text_run_array); + procedure Insert(inText : PChar; var inRuns : text_run_array); + procedure Insert(inText : PChar; inLength : integer; var inRuns : text_run_array); + procedure Insert(startOffset : integer; inText : PChar; inLength : integer;var inRuns : text_run_array); + procedure Delete; + procedure Delete(startOffset : integer; endOffset : integer); + function aText : PChar; + function TextLength : integer; + procedure GetText(offset : integer; length : integer; buffer : PChar); + function ByteAt(offset : integer) : PChar; + function CountLines : integer; + function CurrentLine : integer; + procedure GoToLine(lineNum : integer); +{ procedure Cut(clipboard : TClipboard); + procedure Copy(clipboard : TClipboard); + procedure Paste(clipboard : TClipboard); + procedure Clear; + function AcceptsPaste(clipboard : TClipboard) : boolean; +} function AcceptsDrop(inMessage : BMessage) : boolean; + procedure Select(startOffset : integer; endOffset : integer); + procedure SelectAll; +// procedure GetSelection(outStart : integer; outEnd : integer); + procedure SetFontAndColor(inFont : BFont; inMode : Cardinal; var inColor : RGB_color); +// procedure SeBFontAndColor(inFont : BFont; inMode : Cardinal); +// procedure SeBFontAndColor(inFont : BFont); + procedure SeTFontAndColor(startOffset : Cardinal; endOffset : Cardinal; inFont : BFont; inMode : Cardinal; var inColor : RGB_color); + procedure GeTFontAndColor(inOffset : integer; ouBFont : BFont; outColor : RGB_color); + procedure GeTFontAndColor(ouBFont : BFont; outMode : integer; outColor : RGB_color; outEqColor : boolean); +{ procedure SetRunArray(startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array); + function RunArray(startOffset : integer; endOffset : integer; outSize : ^integer) : text_run_array; +} function LineAt(offset : integer) : integer; + function LineAt(point : BPoint) : integer; + function PointAt(inOffset : integer; outHeight : double) : BPoint; + function OffsetAt(point : BPoint) : integer; + function OffsetAt(line : integer) : integer; + procedure FindWord(inOffset : integer; outFromOffset : integer; outToOffset : integer); + function CanEndLine(offset : integer) : boolean; + function LineWidth(lineNum : integer) : double; + function LineHeight(lineNum : integer) : double; + function TextHeight(startLine : integer; endLine : integer) : double; +// procedure GetTextRegion(startOffset : integer; endOffset : integer; outRegion : TRegion); + procedure ScrollToOffset(inOffset : integer); + procedure ScrollToSelection; + procedure Highlight(startOffset : integer; endOffset : integer); + procedure SetTexBRect(rect : BRect); + function TexBRect : BRect; + procedure SetStylable(stylable : boolean); + function IsStylable : boolean; + procedure SetTabWidth(width : double); + function TabWidth : double; + procedure MakeSelectable(selectable : boolean); + function IsSelectable : boolean; + procedure MakeEditable(editable : boolean); + function IsEditable : boolean; + procedure SetWordWrap(awrap : boolean); + function DoesWordWrap : boolean; + procedure SetMaxBytes(max : integer); + function MaxBytes : integer; + procedure DisallowChar(aChar : Cardinal); + procedure AllowChar(aChar : Cardinal); + procedure Sealignment(flag : alignment); + function GetAlignment : alignment; + procedure SetAutoindent(state : boolean); + function DoesAutoindent : boolean; +{ procedure SetColorSpace(colors : TColor_Space); + function ColorSpace : TColor_Space; +} procedure MakeResizable(resize : boolean; resizeView : BView); + function IsResizable : boolean; + procedure SetDoesUndo(undo : boolean); + function DoesUndo : boolean; + procedure HideTyping(enabled : boolean); + function IsTypingHidden : boolean; + procedure ResizeToPreferred;override; + procedure GetPreferredSize(width : double; height : double);virtual; + procedure AllAttached;override; + procedure AllDetached;override; +{ function FlattenRunArray(inArray : Ttext_tun_array; outSize : ^integer) : Pointer; + function UnflattenRunArray(data : Pointer; outSize : ^integer) : text_run_array; + procedure InsertText(inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array); +} + // procedure Undo(clipboard : TClipboard); +// procedure GetDragParameters(drag : BMessage; bitmap : TBitmap; point : BPoint; handler : BHandler); +// procedure InitObject(atexBRect : BRect; initialFont : BFont; initialColor : RGB_color); + end; + +function BTextView_Create(AObject : TBeObject;frame : TCPlusObject; name : pchar; atexBRect: TCPlusObject ; resizeMask, flags : cardinal): TCPlusObject; cdecl; external BePascalLibName name 'BTextView_Create'; + +function BTextView_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTextView_Create_1'; +procedure BTextView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_FREE'; +function BTextView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BTextView_Instantiate'; +function BTextView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BTextView_Archive'; +procedure BTextView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_AttachedToWindow'; +procedure BTextView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_DetachedFromWindow'; +procedure BTextView_Draw(AObject : TCPlusObject; inRect : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Draw'; +procedure BTextView_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MouseDown'; +procedure BTextView_MouseUp(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MouseUp'; +procedure BTextView_MouseMoved(AObject : TCPlusObject; where : TCPlusObject; code : Cardinal; message : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MouseMoved'; +procedure BTextView_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BTextView_WindowActivated'; +procedure BTextView_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BTextView_KeyDown'; +procedure BTextView_Pulse(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Pulse'; +procedure BTextView_FrameResized(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BTextView_FrameResized'; +procedure BTextView_MakeFocus(AObject : TCPlusObject; focusState : boolean); cdecl; external BePascalLibName name 'BTextView_MakeFocus'; +procedure BTextView_MessageReceived(AObject : TCPlusObject; message : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MessageReceived'; +function BTextView_ResolveSpecifier(AObject : TCPlusObject; message : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BTextView_ResolveSpecifier'; +function BTextView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BTextView_GetSupportedSuites'; +function BTextView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BTextView_Perform'; +procedure BTextView_SetText(AObject : TCPlusObject; inText : PChar;var inRuns : text_run_array); cdecl; external BePascalLibName name 'BTextView_SetText'; +procedure BTextView_SetText(AObject : TCPlusObject; inText : PChar; inLength : integer;var inRuns : text_run_array); cdecl; external BePascalLibName name 'BTextView_SetText_1'; +//procedure BTextView_SetText(AObject : TCPlusObject; inFile : TFile; startOffset : integer; inLength : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_SetText'; +procedure BTextView_Insert(AObject : TCPlusObject; inText : PChar;var inRuns : text_run_array); cdecl; external BePascalLibName name 'BTextView_Insert'; +procedure BTextView_Insert(AObject : TCPlusObject; inText : PChar; inLength : integer;var inRuns : text_run_array); cdecl; external BePascalLibName name 'BTextView_Insert_1'; +procedure BTextView_Insert(AObject : TCPlusObject; startOffset : integer; inText : PChar; inLength : integer;var inRuns : text_run_array); cdecl; external BePascalLibName name 'BTextView_Insert_2'; +procedure BTextView_Delete(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Delete'; +procedure BTextView_Delete(AObject : TCPlusObject; startOffset : integer; endOffset : integer); cdecl; external BePascalLibName name 'BTextView_Delete_1'; +function BTextView_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BTextView_Text'; +function BTextView_TextLength(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_TextLength'; +procedure BTextView_GetText(AObject : TCPlusObject; offset : integer; length : integer; buffer : PChar); cdecl; external BePascalLibName name 'BTextView_GetText'; +function BTextView_ByteAt(AObject : TCPlusObject; offset : integer) : PChar; cdecl; external BePascalLibName name 'BTextView_ByteAt'; +function BTextView_CountLines(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_CountLines'; +function BTextView_CurrentLine(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_CurrentLine'; +procedure BTextView_GoToLine(AObject : TCPlusObject; lineNum : integer); cdecl; external BePascalLibName name 'BTextView_GoToLine'; +//procedure BTextView_Cut(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Cut'; +//procedure BTextView_Copy(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Copy'; +//procedure BTextView_Paste(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Paste'; +procedure BTextView_Clear(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Clear'; +//function BTextView_AcceptsPaste(AObject : TCPlusObject; clipboard : TClipboard) : boolean; cdecl; external BePascalLibName name 'BTextView_AcceptsPaste'; +function BTextView_AcceptsDrop(AObject : TCPlusObject; inMessage : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_AcceptsDrop'; +procedure BTextView_Select(AObject : TCPlusObject; startOffset : integer; endOffset : integer); cdecl; external BePascalLibName name 'BTextView_Select'; +procedure BTextView_SelectAll(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_SelectAll'; +//procedure BTextView_GetSelection(AObject : TCPlusObject; outStart : ^integer; outEnd : ^integer); cdecl; external BePascalLibName name 'BTextView_GetSelection'; +procedure BTextView_SeBFontAndColor(AObject : TCPlusObject; inFont : TCPlusObject; inMode : Cardinal; var inColor : RGB_color); cdecl; external BePascalLibName name 'BTextView_SetFontAndColor'; +//procedure BTextView_SeBFontAndColor(AObject : TCPlusObject; inFont : TCPlusObject; inMode : Cardinal); cdecl; external BePascalLibName name 'BTextView_SeBFontAndColor_1'; +//procedure BTextView_SeBFontAndColor(AObject : TCPlusObject; inFont : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_SeBFontAndColor_1'; +procedure BTextView_SeBFontAndColor(AObject : TCPlusObject; startOffset : cardinal; endOffset : cardinal; inFont : TCPlusObject; inMode : Cardinal; var inColor : RGB_color); cdecl; external BePascalLibName name 'BTextView_SetFontAndColor_1'; +procedure BTextView_GeBFontAndColor(AObject : TCPlusObject; inOffset : cardinal; ouBFont : TCPlusObject; outColor : RGB_color); cdecl; external BePascalLibName name 'BTextView_GetFontAndColor'; +procedure BTextView_GeBFontAndColor(AObject : TCPlusObject; ouBFont : TCPlusObject; outMode : integer; outColor : RGB_color; outEqColor : boolean); cdecl; external BePascalLibName name 'BTextView_GetFontAndColor_1'; +//procedure BTextView_SetRunArray(AObject : TCPlusObject; startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_SetRunArray'; +//function BTextView_RunArray(AObject : TCPlusObject; startOffset : integer; endOffset : integer; outSize : ^integer) : text_run_array; cdecl; external BePascalLibName name 'BTextView_RunArray'; +function BTextView_LineAt(AObject : TCPlusObject; offset : integer) : integer; cdecl; external BePascalLibName name 'BTextView_LineAt'; +function BTextView_LineAt(AObject : TCPlusObject; point : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_LineAt_1'; +function BTextView_PointAt(AObject : TCPlusObject; inOffset : integer; outHeight : double) : BPoint; cdecl; external BePascalLibName name 'BTextView_PointAt'; +function BTextView_OffsetAt(AObject : TCPlusObject; point : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_OffsetAt'; +function BTextView_OffsetAt(AObject : TCPlusObject; line : integer) : integer; cdecl; external BePascalLibName name 'BTextView_OffsetAt_1'; +procedure BTextView_FindWord(AObject : TCPlusObject; inOffset : integer; outFromOffset : integer; outToOffset : integer); cdecl; external BePascalLibName name 'BTextView_FindWord'; +function BTextView_CanEndLine(AObject : TCPlusObject; offset : integer) : boolean; cdecl; external BePascalLibName name 'BTextView_CanEndLine'; +function BTextView_LineWidth(AObject : TCPlusObject; lineNum : integer) : double; cdecl; external BePascalLibName name 'BTextView_LineWidth'; +function BTextView_LineHeight(AObject : TCPlusObject; lineNum : integer) : double; cdecl; external BePascalLibName name 'BTextView_LineHeight'; +function BTextView_TextHeight(AObject : TCPlusObject; startLine : integer; endLine : integer) : double; cdecl; external BePascalLibName name 'BTextView_TextHeight'; +//procedure BTextView_GetTextRegion(AObject : TCPlusObject; startOffset : integer; endOffset : integer; outRegion : TRegion); cdecl; external BePascalLibName name 'BTextView_GetTextRegion'; +procedure BTextView_ScrollToOffset(AObject : TCPlusObject; inOffset : integer); cdecl; external BePascalLibName name 'BTextView_ScrollToOffset'; +procedure BTextView_ScrollToSelection(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_ScrollToSelection'; +procedure BTextView_Highlight(AObject : TCPlusObject; startOffset : integer; endOffset : integer); cdecl; external BePascalLibName name 'BTextView_Highlight'; +procedure BTextView_SetTexBRect(AObject : TCPlusObject; rect : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_SetTextRect'; +function BTextView_TexBRect(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BTextView_TextRect'; +procedure BTextView_SetStylable(AObject : TCPlusObject; stylable : boolean); cdecl; external BePascalLibName name 'BTextView_SetStylable'; +function BTextView_IsStylable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsStylable'; +procedure BTextView_SetTabWidth(AObject : TCPlusObject; width : double); cdecl; external BePascalLibName name 'BTextView_SetTabWidth'; +function BTextView_TabWidth(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BTextView_TabWidth'; +procedure BTextView_MakeSelectable(AObject : TCPlusObject; selectable : boolean); cdecl; external BePascalLibName name 'BTextView_MakeSelectable'; +function BTextView_IsSelectable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsSelectable'; +procedure BTextView_MakeEditable(AObject : TCPlusObject; editable : boolean); cdecl; external BePascalLibName name 'BTextView_MakeEditable'; +function BTextView_IsEditable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsEditable'; +procedure BTextView_SetWordWrap(AObject : TCPlusObject; wrap : boolean); cdecl; external BePascalLibName name 'BTextView_SetWordWrap'; +function BTextView_DoesWordWrap(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_DoesWordWrap'; +procedure BTextView_SetMaxBytes(AObject : TCPlusObject; max : integer); cdecl; external BePascalLibName name 'BTextView_SetMaxBytes'; +function BTextView_MaxBytes(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_MaxBytes'; +procedure BTextView_DisallowChar(AObject : TCPlusObject; aChar : Cardinal); cdecl; external BePascalLibName name 'BTextView_DisallowChar'; +procedure BTextView_AllowChar(AObject : TCPlusObject; aChar : Cardinal); cdecl; external BePascalLibName name 'BTextView_AllowChar'; +procedure BTextView_Sealignment(AObject : TCPlusObject; flag : alignment); cdecl; external BePascalLibName name 'BTextView_SetAlignment'; +function BTextView_Alignment(AObject : TCPlusObject) : alignment; cdecl; external BePascalLibName name 'BTextView_Alignment'; +procedure BTextView_SetAutoindent(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BTextView_SetAutoindent'; +function BTextView_DoesAutoindent(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_DoesAutoindent'; +//procedure BTextView_SetColorSpace(AObject : TCPlusObject; colors : TColor_Space); cdecl; external BePascalLibName name 'BTextView_SetColorSpace'; +//function BTextView_ColorSpace(AObject : TCPlusObject) : TColor_Space; cdecl; external BePascalLibName name 'BTextView_ColorSpace'; +procedure BTextView_MakeResizable(AObject : TCPlusObject; resize : boolean; resizeView : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MakeResizable'; +function BTextView_IsResizable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsResizable'; +procedure BTextView_SetDoesUndo(AObject : TCPlusObject; undo : boolean); cdecl; external BePascalLibName name 'BTextView_SetDoesUndo'; +function BTextView_DoesUndo(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_DoesUndo'; +procedure BTextView_HideTyping(AObject : TCPlusObject; enabled : boolean); cdecl; external BePascalLibName name 'BTextView_HideTyping'; +function BTextView_IsTypingHidden(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsTypingHidden'; +procedure BTextView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_ResizeToPreferred'; +procedure BTextView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BTextView_GetPreferredSize'; +procedure BTextView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_AllAttached'; +procedure BTextView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_AllDetached'; +//function BTextView_FlattenRunArray(AObject : TCPlusObject; inArray : Ttext_tun_array; outSize : ^integer) : Pointer; cdecl; external BePascalLibName name 'BTextView_FlattenRunArray'; +//function BTextView_UnflattenRunArray(AObject : TCPlusObject; data : Pointer; outSize : ^integer) : text_run_array; cdecl; external BePascalLibName name 'BTextView_UnflattenRunArray'; +//procedure BTextView_InsertText(AObject : TCPlusObject; inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_InsertText'; +//procedure BTextView_Undo(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Undo'; +//function BTextView_UndoState(AObject : TCPlusObject; isRedo : boolean) : Tunde_state; cdecl; external BePascalLibName name 'BTextView_UndoState'; +//procedure BTextView_GetDragParameters(AObject : TCPlusObject; drag : BMessage; bitmap : TBitmap; point : BPoint; handler : BHandler); cdecl; external BePascalLibName name 'BTextView_GetDragParameters'; +procedure BTextView__ReservedTextView3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView3'; +procedure BTextView__ReservedTextView4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView4'; +procedure BTextView__ReservedTextView5(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView5'; +procedure BTextView__ReservedTextView6(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView6'; +procedure BTextView__ReservedTextView7(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView7'; +procedure BTextView__ReservedTextView8(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView8'; +procedure BTextView__ReservedTextView9(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView9'; +procedure BTextView__ReservedTextView10(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView10'; +procedure BTextView__ReservedTextView11(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView11'; +procedure BTextView__ReservedTextView12(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView12'; +//procedure BTextView_InitObject(AObject : TCPlusObject; texBRect : BRect; initialFont : BFont; initialColor : RGB_color); cdecl; external BePascalLibName name 'BTextView_InitObject'; +procedure BTextView_HandleBackspace(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_HandleBackspace'; +procedure BTextView_HandleArrowKey(AObject : TCPlusObject; inArrowKey : Cardinal); cdecl; external BePascalLibName name 'BTextView_HandleArrowKey'; +procedure BTextView_HandleDelete(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_HandleDelete'; +procedure BTextView_HandlePageKey(AObject : TCPlusObject; inPageKey : Cardinal); cdecl; external BePascalLibName name 'BTextView_HandlePageKey'; +procedure BTextView_HandleAlphaKey(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BTextView_HandleAlphaKey'; +procedure BTextView_Refresh(AObject : TCPlusObject; fromOffset : integer; toOffset : integer; erase : boolean; scroll : boolean); cdecl; external BePascalLibName name 'BTextView_Refresh'; +//procedure BTextView_RecalLineBreaks(AObject : TCPlusObject; startLine : ^integer; endLine : ^integer); cdecl; external BePascalLibName name 'BTextView_RecalLineBreaks'; +function BTextView_FindLineBreak(AObject : TCPlusObject; fromOffset : integer; outAscent : double; outDescent : double; ioWidth : double) : integer; cdecl; external BePascalLibName name 'BTextView_FindLineBreak'; +function BTextView_StyledWidth(AObject : TCPlusObject; fromOffset : integer; length : integer; outAscent : double; outDescent : double) : double; cdecl; external BePascalLibName name 'BTextView_StyledWidth'; +function BTextView_ActualTabWidth(AObject : TCPlusObject; location : double) : double; cdecl; external BePascalLibName name 'BTextView_ActualTabWidth'; +//procedure BTextView_DoInsertText(AObject : TCPlusObject; inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array; outResult : ); cdecl; external BePascalLibName name 'BTextView_DoInsertText'; +//procedure BTextView_DoDeleteText(AObject : TCPlusObject; fromOffset : integer; toOffset : integer; outResult : ); cdecl; external BePascalLibName name 'BTextView_DoDeleteText'; +procedure BTextView_DrawLines(AObject : TCPlusObject; startLine : integer; endLine : integer; startOffset : integer; erase : boolean); cdecl; external BePascalLibName name 'BTextView_DrawLines'; +procedure BTextView_DrawCaret(AObject : TCPlusObject; offset : integer); cdecl; external BePascalLibName name 'BTextView_DrawCaret'; +procedure BTextView_InvertCaret(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_InvertCaret'; +procedure BTextView_DragCaret(AObject : TCPlusObject; offset : integer); cdecl; external BePascalLibName name 'BTextView_DragCaret'; +procedure BTextView_StopMouseTracking(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_StopMouseTracking'; +function BTextView_PerformMouseUp(AObject : TCPlusObject; where : BPoint) : boolean; cdecl; external BePascalLibName name 'BTextView_PerformMouseUp'; +function BTextView_PerformMouseMoved(AObject : TCPlusObject; where : BPoint; code : Cardinal) : boolean; cdecl; external BePascalLibName name 'BTextView_PerformMouseMoved'; +procedure BTextView_TrackMouse(AObject : TCPlusObject; where : BPoint; message : BMessage; force : boolean); cdecl; external BePascalLibName name 'BTextView_TrackMouse'; +procedure BTextView_TrackDrag(AObject : TCPlusObject; where : BPoint); cdecl; external BePascalLibName name 'BTextView_TrackDrag'; +procedure BTextView_InitiateDrag(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_InitiateDrag'; +function BTextView_MessageDropped(AObject : TCPlusObject; inMessage : BMessage; where : BPoint; offset : BPoint) : boolean; cdecl; external BePascalLibName name 'BTextView_MessageDropped'; +procedure BTextView_UpdateScrollbars(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_UpdateScrollbars'; +procedure BTextView_AutoResize(AObject : TCPlusObject; doredraw : boolean); cdecl; external BePascalLibName name 'BTextView_AutoResize'; +procedure BTextView_NewOffscreen(AObject : TCPlusObject; padding : double); cdecl; external BePascalLibName name 'BTextView_NewOffscreen'; +procedure BTextView_DeleteOffscreen(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_DeleteOffscreen'; +procedure BTextView_Activate(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Activate'; +procedure BTextView_Deactivate(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Deactivate'; +//procedure BTextView_NormalizeFont(AObject : TCPlusObject; font : BFont); cdecl; external BePascalLibName name 'BTextView_NormalizeFont'; +function BTextView_CharClassification(AObject : TCPlusObject; offset : integer) : Cardinal; cdecl; external BePascalLibName name 'BTextView_CharClassification'; +function BTextView_NextInitialByte(AObject : TCPlusObject; offset : integer) : integer; cdecl; external BePascalLibName name 'BTextView_NextInitialByte'; +function BTextView_PreviousInitialByte(AObject : TCPlusObject; offset : integer) : integer; cdecl; external BePascalLibName name 'BTextView_PreviousInitialByte'; +//function BTextView_GetProperty(AObject : TCPlusObject; specifier : BMessage; form : integer; property : PChar; reply : BMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_GetProperty'; +function BTextView_SetProperty(AObject : TCPlusObject; specifier : BMessage; form : integer; properti : PChar; reply : BMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_SetProperty'; +function BTextView_CountProperties(AObject : TCPlusObject; specifier : BMessage; form : integer; properti : PChar; reply : BMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_CountProperties'; +procedure BTextView_HandleInputMethodChanged(AObject : TCPlusObject; message : BMessage); cdecl; external BePascalLibName name 'BTextView_HandleInputMethodChanged'; +procedure BTextView_HandleInputMethodLocationRequest(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_HandleInputMethodLocationRequest'; +procedure BTextView_CancelInputMethod(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_CancelInputMethod'; +procedure BTextView_LockWidthBuffer(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_LockWidthBuffer'; +procedure BTextView_UnlockWidthBuffer(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_UnlockWidthBuffer'; + +implementation + + +constructor BTextView.Create(frame : BRect; name : pchar;atexBRect: BRect ; resizeMask, flags : cardinal); +begin + CreatePas; + CPlusObject := BTextView_Create(Self, frame.CplusObject,name,atexBRect.CPlusObject,resizeMask,flags); +end; + +constructor BTextView.Create(data : BMessage); +begin + CreatePas; + CPlusObject := BTextView_Create(Self, data.CPlusObject); +end; + +destructor BTextView.Destroy; +begin + BTextView_Free(CPlusObject); + inherited; +end; + +function BTextView.Instantiate(data : BMessage) : BArchivable; +begin + Result := BTextView_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BTextView.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BTextView_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BTextView.AttachedToWindow; +begin +// BTextView_AttachedToWindow(CPlusObject); +end; + +procedure BTextView.DetachedFromWindow; +begin +// BTextView_DetachedFromWindow(CPlusObject); +end; + +procedure BTextView.Draw(inRect : BRect); +begin + // BTextView_Draw(CPlusObject, inRect.CPlusObject); +end; + +procedure BTextView.MouseDown(where : BPoint); +begin +// BTextView_MouseDown(CPlusObject, where.CPlusObject); +end; + +procedure BTextView.MouseUp(where : BPoint); +begin + //BTextView_MouseUp(CPlusObject, where.CPlusObject); +end; + +procedure BTextView.MouseMoved(where : BPoint; code : Cardinal; message : BMessage); +begin + //BTextView_MouseMoved(CPlusObject, where.CPlusObject, code, message); +end; + +procedure BTextView.WindowActivated(state : boolean); +begin + //BTextView_WindowActivated(CPlusObject, state); +end; + +procedure BTextView.KeyDown(bytes : PChar; numBytes : integer); +begin + //writeln('keydown textview'); + //BTextView_KeyDown(CPlusObject, bytes, numBytes); +end; + +procedure BTextView.Pulse; +begin + //BTextView_Pulse(CPlusObject); +end; + +procedure BTextView.FrameResized(width : double; height : double); +begin + // BTextView_FrameResized(CPlusObject, width, height); +end; + +procedure BTextView.MakeFocus(focusState : boolean); +begin + BTextView_MakeFocus(CPlusObject, focusState); +end; + +procedure BTextView.MessageReceived(message : BMessage); +begin + inherited; +// BTextView_MessageReceived(CPlusObject, message.CPlusObject); +end; + +function BTextView.ResolveSpecifier(message : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; +begin + //Result := BTextView_ResolveSpecifier(CPlusObject, message.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +function BTextView.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BTextView_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BTextView.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BTextView_Perform(CPlusObject, d, arg); +end; + +procedure BTextView.SetText(inText : PChar; var inRuns : text_run_array); +begin + BTextView_SetText(CPlusObject, inText, inRuns); +end; + +procedure BTextView.SetText(inText : PChar; inLength : integer; var inRuns : text_run_array); +begin + BTextView_SetText(CPlusObject, inText, inLength, inRuns); +end; + +{procedure BTextView.SetText(inFile : TFile; startOffset : integer; inLength : integer; inRuns : text_run_array); +begin + BTextView_SetText(CPlusObject, inFile.CPlusObject, startOffset, inLength, inRuns); +end; +} +procedure BTextView.Insert(inText : PChar;var inRuns : text_run_array); +begin + BTextView_Insert(CPlusObject, inText, inRuns); +end; + +procedure BTextView.Insert(inText : PChar; inLength : integer; var inRuns : text_run_array); +begin + BTextView_Insert(CPlusObject, inText, inLength, inRuns); +end; + +procedure BTextView.Insert(startOffset : integer; inText : PChar; inLength : integer; var inRuns : text_run_array); +begin + BTextView_Insert(CPlusObject, startOffset, inText, inLength, inRuns); +end; + +procedure BTextView.Delete; +begin + BTextView_Delete(CPlusObject); +end; + +procedure BTextView.Delete(startOffset : integer; endOffset : integer); +begin + BTextView_Delete(CPlusObject, startOffset, endOffset); +end; + +function BTextView.aText : PChar; +begin + Result := BTextView_Text(CPlusObject); +end; + +function BTextView.TextLength : integer; +begin + Result := BTextView_TextLength(CPlusObject); +end; + +procedure BTextView.GetText(offset : integer; length : integer; buffer : PChar); +begin + BTextView_GetText(CPlusObject, offset, length, buffer); +end; + +function BTextView.ByteAt(offset : integer) : PChar; +begin + Result := BTextView_ByteAt(CPlusObject, offset); +end; + +function BTextView.CountLines : integer; +begin + Result := BTextView_CountLines(CPlusObject); +end; + +function BTextView.CurrentLine : integer; +begin + Result := BTextView_CurrentLine(CPlusObject); +end; + +procedure BTextView.GoToLine(lineNum : integer); +begin + BTextView_GoToLine(CPlusObject, lineNum); +end; + +{procedure BTextView.Cut(clipboard : TClipboard); +begin + BTextView_Cut(CPlusObject, clipboard.CPlusObject); +end; + +procedure BTextView.Copy(clipboard : TClipboard); +begin + BTextView_Copy(CPlusObject, clipboard.CPlusObject); +end; + +procedure BTextView.Paste(clipboard : TClipboard); +begin + BTextView_Paste(CPlusObject, clipboard.CPlusObject); +end; + +procedure BTextView.Clear; +begin + BTextView_Clear(CPlusObject); +end; + +function BTextView.AcceptsPaste(clipboard : TClipboard) : boolean; +begin + Result := BTextView_AcceptsPaste(CPlusObject, clipboard.CPlusObject); +end; +} +function BTextView.AcceptsDrop(inMessage : BMessage) : boolean; +begin + Result := BTextView_AcceptsDrop(CPlusObject, inMessage); +end; + +procedure BTextView.Select(startOffset : integer; endOffset : integer); +begin + BTextView_Select(CPlusObject, startOffset, endOffset); +end; + +procedure BTextView.SelectAll; +begin + BTextView_SelectAll(CPlusObject); +end; + +{procedure BTextView.GetSelection(outStart : integer; outEnd : integer); +begin + BTextView_GetSelection(CPlusObject, outStart, outEnd); +end; +} +procedure BTextView.SeTFontAndColor(inFont : BFont; inMode : Cardinal; var inColor : RGB_color); +begin + BTextView_SeBFontAndColor(CPlusObject, inFont.CPlusObject, inMode, inColor); +end; + +//procedure BTextView.SeBFontAndColor(inFont : BFont; inMode : Cardinal); +//begin +// BTextView_SeBFontAndColor(CPlusObject, inFont.CPlusObject, inMode); +//end; + +//procedure BTextView.SeBFontAndColor(inFont : BFont); +//begin +// BTextView_SeBFontAndColor(CPlusObject, inFont.CPlusObject); +//end; + +procedure BTextView.SetFontAndColor(startOffset : cardinal; endOffset : cardinal; inFont : BFont; inMode : Cardinal; var inColor : RGB_color); +begin + BTextView_SeBFontAndColor(CPlusObject, startOffset, endOffset, inFont.CPlusObject, inMode, inColor); +end; + +procedure BTextView.GetFontAndColor(inOffset : integer; ouBFont : BFont; outColor : RGB_color); +begin + BTextView_GeBFontAndColor(CPlusObject, inOffset, ouBFont.CPlusObject, outColor); +end; + +procedure BTextView.GetFontAndColor(ouBFont : BFont; outMode : integer; outColor : RGB_color; outEqColor : boolean); +begin + BTextView_GeBFontAndColor(CPlusObject, ouBFont.CPlusObject, outMode, outColor, outEqColor); +end; +{ +procedure BTextView.SetRunArray(startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array); +begin + BTextView_SetRunArray(CPlusObject, startOffset, endOffset, inRuns); +end; + +function BTextView.RunArray(startOffset : integer; endOffset : integer; outSize : ^integer) : text_run_array; +begin + Result := BTextView_RunArray(CPlusObject, startOffset, endOffset, outSize); +end; +} +function BTextView.LineAt(offset : integer) : integer; +begin + Result := BTextView_LineAt(CPlusObject, offset); +end; + +function BTextView.LineAt(point : BPoint) : integer; +begin + Result := BTextView_LineAt(CPlusObject, point.CPlusObject); +end; + +function BTextView.PointAt(inOffset : integer; outHeight : double) : BPoint; +begin + Result := BTextView_PointAt(CPlusObject, inOffset, outHeight); +end; + +function BTextView.OffsetAt(point : BPoint) : integer; +begin + Result := BTextView_OffsetAt(CPlusObject, point.CPlusObject); +end; + +function BTextView.OffsetAt(line : integer) : integer; +begin + Result := BTextView_OffsetAt(CPlusObject, line); +end; + +procedure BTextView.FindWord(inOffset : integer; outFromOffset : integer; outToOffset : integer); +begin + BTextView_FindWord(CPlusObject, inOffset, outFromOffset, outToOffset); +end; + +function BTextView.CanEndLine(offset : integer) : boolean; +begin + Result := BTextView_CanEndLine(CPlusObject, offset); +end; + +function BTextView.LineWidth(lineNum : integer) : double; +begin + Result := BTextView_LineWidth(CPlusObject, lineNum); +end; + +function BTextView.LineHeight(lineNum : integer) : double; +begin + Result := BTextView_LineHeight(CPlusObject, lineNum); +end; + +function BTextView.TextHeight(startLine : integer; endLine : integer) : double; +begin + Result := BTextView_TextHeight(CPlusObject, startLine, endLine); +end; + +{procedure BTextView.GetTextRegion(startOffset : integer; endOffset : integer; outRegion : TRegion); +begin + BTextView_GetTextRegion(CPlusObject, startOffset, endOffset, outRegion.CPlusObject); +end; +} +procedure BTextView.ScrollToOffset(inOffset : integer); +begin + BTextView_ScrollToOffset(CPlusObject, inOffset); +end; + +procedure BTextView.ScrollToSelection; +begin + BTextView_ScrollToSelection(CPlusObject); +end; + +procedure BTextView.Highlight(startOffset : integer; endOffset : integer); +begin + BTextView_Highlight(CPlusObject, startOffset, endOffset); +end; + +procedure BTextView.SetTexBRect(rect : BRect); +begin + BTextView_SetTexBRect(CPlusObject, rect.CPlusObject); +end; + +function BTextView.TexBRect : BRect; +begin + Result := BTextView_TexBRect(CPlusObject); +end; + +procedure BTextView.SetStylable(stylable : boolean); +begin + BTextView_SetStylable(CPlusObject, stylable); +end; + +function BTextView.IsStylable : boolean; +begin + Result := BTextView_IsStylable(CPlusObject); +end; + +procedure BTextView.SetTabWidth(width : double); +begin + BTextView_SetTabWidth(CPlusObject, width); +end; + +function BTextView.TabWidth : double; +begin + Result := BTextView_TabWidth(CPlusObject); +end; + +procedure BTextView.MakeSelectable(selectable : boolean); +begin + BTextView_MakeSelectable(CPlusObject, selectable); +end; + +function BTextView.IsSelectable : boolean; +begin + Result := BTextView_IsSelectable(CPlusObject); +end; + +procedure BTextView.MakeEditable(editable : boolean); +begin + BTextView_MakeEditable(CPlusObject, editable); +end; + +function BTextView.IsEditable : boolean; +begin + Result := BTextView_IsEditable(CPlusObject); +end; + +procedure BTextView.SetWordWrap(awrap : boolean); +begin + BTextView_SetWordWrap(CPlusObject, awrap); +end; + +function BTextView.DoesWordWrap : boolean; +begin + Result := BTextView_DoesWordWrap(CPlusObject); +end; + +procedure BTextView.SetMaxBytes(max : integer); +begin + BTextView_SetMaxBytes(CPlusObject, max); +end; + +function BTextView.MaxBytes : integer; +begin + Result := BTextView_MaxBytes(CPlusObject); +end; + +procedure BTextView.DisallowChar(aChar : Cardinal); +begin + BTextView_DisallowChar(CPlusObject, aChar); +end; + +procedure BTextView.AllowChar(aChar : Cardinal); +begin + BTextView_AllowChar(CPlusObject, aChar); +end; + +procedure BTextView.Sealignment(flag : alignment); +begin + BTextView_Sealignment(CPlusObject, flag); +end; + +function BTextView.getAlignment : alignment; +begin + Result := BTextView_Alignment(CPlusObject); +end; + +procedure BTextView.SetAutoindent(state : boolean); +begin + BTextView_SetAutoindent(CPlusObject, state); +end; + +function BTextView.DoesAutoindent : boolean; +begin + Result := BTextView_DoesAutoindent(CPlusObject); +end; + +{procedure BTextView.SetColorSpace(colors : TColor_Space); +begin + BTextView_SetColorSpace(CPlusObject, colors); +end; + +function BTextView.ColorSpace : TColor_Space; +begin + Result := BTextView_ColorSpace(CPlusObject); +end; +} +procedure BTextView.MakeResizable(resize : boolean; resizeView : BView); +begin + BTextView_MakeResizable(CPlusObject, resize, resizeView.CPlusObject); +end; + +function BTextView.IsResizable : boolean; +begin + Result := BTextView_IsResizable(CPlusObject); +end; + +procedure BTextView.SetDoesUndo(undo : boolean); +begin + BTextView_SetDoesUndo(CPlusObject, undo); +end; + +function BTextView.DoesUndo : boolean; +begin + Result := BTextView_DoesUndo(CPlusObject); +end; + +procedure BTextView.HideTyping(enabled : boolean); +begin + BTextView_HideTyping(CPlusObject, enabled); +end; + +function BTextView.IsTypingHidden : boolean; +begin + Result := BTextView_IsTypingHidden(CPlusObject); +end; + +procedure BTextView.ResizeToPreferred; +begin + BTextView_ResizeToPreferred(CPlusObject); +end; + +procedure BTextView.GetPreferredSize(width : double; height : double); +begin + BTextView_GetPreferredSize(CPlusObject, width, height); +end; + +procedure BTextView.AllAttached; +begin + BTextView_AllAttached(CPlusObject); +end; + +procedure BTextView.AllDetached; +begin + BTextView_AllDetached(CPlusObject); +end; + +{function BTextView.FlattenRunArray(inArray : Ttext_tun_array; outSize : integer) : Pointer; +begin + Result := BTextView_FlattenRunArray(CPlusObject, inArray, outSize); +end; + + +function BTextView.UnflattenRunArray(data : Pointer; outSize : integer) : text_run_array; +begin + Result := BTextView_UnflattenRunArray(CPlusObject, data, outSize); +end; + +procedure BTextView.InsertText(inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array); +begin + BTextView_InsertText(CPlusObject, inText, inLength, inOffset, inRuns); +end; +} + +{procedure BTextView.Undo(clipboard : TClipboard); +begin + BTextView_Undo(CPlusObject, clipboard.CPlusObject); +end; + +function BTextView.UndoState(isRedo : boolean) : undo_state; +begin + Result := BTextView_UndoState(CPlusObject, isRedo); +end; + +procedure BTextView.GetDragParameters(drag : BMessage; bitmap : TBitmap; point : BPoint; handler : BHandler); +begin + BTextView_GetDragParameters(CPlusObject, drag.CPlusObject, bitmap.CPlusObject, point.CPlusObject, handler.CPlusObject); +end; +} + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/view.pp b/bepascal/source/bepascal/pas/src/be/interface/view.pp new file mode 100644 index 0000000..7a33d47 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/view.pp @@ -0,0 +1,544 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + 24/5/2003 : Eric : Add Show,Hide,IsHidden +} + +unit View; + +interface + +uses + beobj, handler, rect, os, application, appdefs, message, + graphicdefs, fdblib; + +type +// TWindow = class(TBeObject); + BView = class(BHandler) + public + constructor Create(frame : BRect; name : PChar; resizingMode, flags : Cardinal); + destructor Destroy; override; + // hook functions + procedure AllAttached; virtual; + procedure AllDetached; virtual; + procedure AttachedToWindow; virtual; + procedure DetachedFromWindow; virtual; + procedure Draw(updateRect : BRect); virtual; + procedure DrawAfterChildren(updateRect : BRect); virtual; + procedure FrameMoved(parenBPoint : BPoint); virtual; + procedure FrameResized(width, height : double); virtual; + procedure GetPreferredSize(var width : double; var height : double); virtual; + procedure ResizeToPreferred; virtual; + procedure KeyDown(bytes : PChar; numBytes : integer); virtual; + procedure KeyUp(bytes : PChar; numBytes : integer); virtual; + procedure MouseDown(point : BPoint); virtual; + procedure MouseMoved(point : BPoint; transit : Cardinal; message : BMessage); virtual; + procedure MouseUp(point : BPoint); virtual; + procedure Pulse; virtual; +// procedure TargetedByScrollView(scroller : TScrollView); virtual; // Need BScrollView + procedure WindowActivated(active : boolean); virtual; + procedure MessageReceived(aMessage : BMessage); override; + // End hook functions + function RemoveSelf : boolean; + procedure AddChild(aView, before : BView); + function RemoveChild(aView : BView) : boolean; + function CountChildren : integer; + function ChildAt(index : integer) : BView; + function NextSibling : BView; + function PreviousSibling : BView; +// function Window : TWindow; + procedure SetViewColor(rgb_color : RGB_color); + procedure Show; + procedure Hide; + function IsHidden : Boolean; + end; + +function BView_Create(AObject : TObject; frame : TCPlusObject; name : PChar; + resizingMode, flags : cardinal) : TCplusObject; cdecl; external BePascalLibName name 'BView_Create_1'; +procedure BView_Free(CPlusObject : TCPlusObject); cdecl; external BePascalLibName name 'BView_Free'; +function BView_RemoveSelf(CPlusObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BView_RemoveSelf'; +procedure BView_AddChild(CPlusObject : TCPlusObject; aView : TCPlusObject; before : TCPlusObject); cdecl; external BePascalLibName name 'BView_AddChild'; +function BView_RemoveChild(CPlusObject : TCPlusObject; aView : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BView_RemoveChild'; +function BView_CountChildren(CPlusObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BView_CountChildren'; +function BView_NextSibling(CPlusObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BView_NextSibling'; +function BView_PreviousSibling(CPlusObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BView_NextSibling'; +function BView_ChildAt(CPlusObject : TCPlusObject; index : integer) : TCPlusObject; cdecl; external BePascalLibName name 'BView_ChildAt'; +function BView_Window(CPlusObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BView_Window'; +procedure BView_Draw(CPlusObject : TCPlusObject; aRect : TCPlusObject); cdecl; external BePascalLibName name 'BView_Draw'; +procedure BView_SeBViewColor(CPlusObject : TCPlusObject; c : RGB_color); cdecl; external BePascalLibName name 'BView_SetViewColor'; +procedure BView_Show(CPlusObject : TCPlusObject); cdecl; external BePascalLibName name 'BView_Show'; +procedure BView_Hide(CPlusObject : TCPlusObject); cdecl; external BePascalLibName name 'BView_Hide'; +function BView_IsHidden(CPlusObject : TCPlusObject) : Boolean; cdecl; external BePascalLibName name 'BView_IsHidden'; + +var + // resizingMode mask + B_FOLLOW_NONE : Cardinal; + B_FOLLOW_ALL_SIDES : Cardinal; + + B_FOLLOW_ALL : Cardinal; + + B_FOLLOW_LEFT : Cardinal; + B_FOLLOW_RIGHT : Cardinal; + B_FOLLOW_LEFT_RIGHT : Cardinal; + B_FOLLOW_H_CENTER : Cardinal; + + B_FOLLOW_TOP : Cardinal; + B_FOLLOW_BOTTOM : Cardinal; + B_FOLLOW_TOP_BOTTOM : Cardinal; + B_FOLLOW_V_CENTER : Cardinal; + +const + // flags + B_FULL_UPDATE_ON_RESIZE : Cardinal = $80000000;//31; + _B_RESERVED1_ : Cardinal = $40000000;//30; + B_WILL_DRAW : Cardinal = $20000000;//29; + B_PULSE_NEEDED : Cardinal = $10000000;//28; + B_NAVIGABLE_JUMP : Cardinal = $08000000;//27; + B_FRAME_EVENTS : Cardinal = $04000000;//26; + B_NAVIGABLE : Cardinal = $02000000;//25; + B_SUBPIXEL_PRECISE : Cardinal = $00800000;//24; + B_DRAW_ON_CHILDREN : Cardinal = $00400000;//23; + _B_RESERVED7_ : Cardinal = $00200000;//22; + + B_FONT_FAMILY_AND_STYLE = 1; + B_FONT_SIZE = 2; + B_FONT_SHEAR = 4; + B_FONT_ROTATION = 8; + B_FONT_SPACING = 16; + B_FONT_ENCODING = 32; + B_FONT_FACE = 64; + B_FONT_FLAGS = 128; + B_FONT_ALL = 255; + +implementation + +var + View_AllAttached_hook : Pointer; cvar; external; + View_AllDetached_hook : Pointer; cvar; external; + View_AttachedToWindow_hook : Pointer; cvar; external; + View_DetachedFromWindow_hook : Pointer; cvar; external; + View_Draw_hook : Pointer; cvar; external; + View_DrawAfterChildren_hook : Pointer; cvar; external; + View_FrameMoved_hook : Pointer; cvar; external; + View_FrameResized_hook : Pointer; cvar; external; + View_GetPreferredSize_hook : Pointer; cvar; external; + View_ResizeToPreferred_hook : Pointer; cvar; external; + View_KeyDown_hook : Pointer; cvar; external; + View_KeyUp_hook : Pointer; cvar; external; + View_MouseDown_hook : Pointer; cvar; external; + View_MouseMoved_hook : Pointer; cvar; external; + View_MouseUp_hook : Pointer; cvar; external; + View_Pulse_hook : Pointer; cvar; external; + View_TargetedByScrollView_hook : Pointer; cvar; external; + View_WindowActivated_hook : Pointer; cvar; external; + +// View hook functions +{ + View_AllAttached_hook + View_AllDetached_hook + View_AttachedToWindow_hook + View_DetachedFromWindow_hook + View_Draw_hook + View_DrawAfterChildren_hook + View_FrameMoved_hook + View_FrameResized_hook + View_GetPreferredSize_hook + View_ResizeToPreferred_hook + View_KeyDown_hook + View_KeyUp_hook + View_MouseDown_hook + View_MouseMoved_hook + View_MouseUp_hook + View_Pulse_hook + View_TargetedByScrollView_hook + View_WindowActivated_hook} + + +constructor BView.Create(frame : BRect; name : PChar; resizingMode, flags : Cardinal); +begin + inherited Create; + CPlusObject := BView_Create(Self, frame.CPlusObject, name, resizingMode, flags); +end; + +destructor BView.Destroy; +begin + BView_Free(Self.CPlusObject); + inherited; +end; + +// Hook functions +procedure BView.AllAttached; +begin +end; + +procedure BView.AllDetached; +begin +end; + +procedure BView.AttachedToWindow; +begin +end; + +procedure BView.DetachedFromWindow; +begin +end; + +procedure BView.Draw(updateRect : BRect); +begin + SendText('Drawing view'); + +end; + +procedure BView.DrawAfterChildren(updateRect : BRect); +begin +end; + +procedure BView.FrameMoved(parenBPoint : BPoint); +begin +end; + +procedure BView.FrameResized(width, height : double); +begin +end; + +procedure BView.GetPreferredSize(var width : double; var height : double); +begin +end; + +procedure BView.ResizeToPreferred; +begin +end; + +procedure BView.KeyDown(bytes : PChar; numBytes : integer); +begin +end; + +procedure BView.KeyUp(bytes : PChar; numBytes : integer); +begin +end; + +procedure BView.MouseDown(point : BPoint); +begin +end; + +procedure BView.MouseMoved(point : BPoint; transit : Cardinal; message : BMessage); +begin +end; + +procedure BView.MouseUp(point : BPoint); +begin +end; + +procedure BView.Pulse; +begin +end; + +// procedure BView.TargetedByScrollView(); // Need BScrollView +//begin +//end; + +procedure BView.WindowActivated(active : boolean); +begin +end; + +procedure BView.MessageReceived(aMessage : BMessage); +begin + inherited; +end; + +function BView.RemoveSelf : boolean; +begin + Result := BView_RemoveSelf(Self.CPlusObject); +end; + +procedure BView.AddChild(aView, before : BView); +begin + if before <> nil then + BView_AddChild(Self.CPlusObject, aView.CPlusObject, before.CPlusObject) + else + BView_AddChild(Self.CPlusObject, aView.CPlusObject, nil); +end; + +function BView.RemoveChild(aView : BView) : boolean; +begin + Result := BView_RemoveChild(Self.CPlusObject, aView); +end; + +function BView.CountChildren : integer; +begin + Result := BView_CountChildren(Self.CPlusObject); +end; + +function BView.ChildAt(index : integer) : BView; +begin + Result := BView.Wrap(BView_ChildAt(Self.CPlusObject, index)); +end; + +function BView.NextSibling : BView; +begin + Result := BView.Wrap(BView_NextSibling(Self.CPlusObject)); +end; + +function BView.PreviousSibling : BView; +begin + Result := BView.Wrap(BView_PreviousSibling(Self.CPlusObject)); +end; + +{function BView.Window : TWindow; +begin + Result := TWindow.Wrap(BView_Window(Self.CPlusObject)); +end;} + +procedure BView.SetViewColor(rgb_color : RGB_color); +begin + BView_SeBViewColor(Self.CPlusObject, rgb_color); +end; + +procedure BView.Show; +begin + BView_Show(Self.CPlusObject); +end; + +procedure BView.Hide; +begin + BView_Hide(Self.CPlusObject); +end; + +function BView.IsHidden : Boolean; +begin + Result:=BView_IsHidden(Self.CPlusObject); +end; + +//////////////////////////////////////////////////////////////////////// +// Hook functions +//////////////////////////////////////////////////////////////////////// +procedure View_AllAttached_hook_func(View : BView); cdecl; +begin + if View <> nil then + View.AllAttached; +end; + +procedure View_AllDetached_hook_func(View : BView); cdecl; +begin + if View <> nil then + View.AllDetached; +end; + +procedure View_AttachedToWindow_hook_func(View : BView); cdecl; +begin + if View <> nil then + View.AttachedToWindow; +end; + +procedure View_DetachedFromWindow_hook_func(View : BView); cdecl; +begin + if View <> nil then + View.DetachedFromWindow; +end; + +procedure View_Draw_hook_func(View : BView; aRect : TCPlusObject); cdecl; +var + Rect : BRect; +begin + Rect := BRect.Wrap(aRect); + try + if View <> nil then + View.Draw(Rect); + finally + Rect.UnWrap; + end; +end; + +procedure View_DrawAfterChildren_hook_func(View : BView; aRect : TCPlusObject); cdecl; +var + Rect : BRect; +begin + Rect := BRect.Wrap(aRect); + try + if View <> nil then + View.DrawAfterChildren(Rect); + finally + Rect.UnWrap; + end; +end; + +procedure View_FrameMoved_hook_func(View : BView; aPoint : TCPlusObject); cdecl; +var + Point : BPoint; +begin + Point := BPoint.Wrap(aPoint); + try + if View <> nil then + View.FrameMoved(Point); + finally + Point.UnWrap; + end; +end; + +procedure View_FrameResized_hook_func(View : BView; width, height : double); cdecl; +begin + if View <> nil then + View.FrameResized(width, height); +end; + +procedure View_GetPreferredSize_hook_func(View : BView; var width, height : double); cdecl; +begin + if View <> nil then + View.GetPreferredSize(width, height); +end; + +procedure View_ResizeToPreferred_hook_func(View : BView); cdecl; +begin + if View <> nil then + View.ResizeToPreferred; +end; + +procedure View_KeyDown_hook_func(View : BView; bytes : PChar; numBytes : integer); cdecl; +begin + if View <> nil then + View.KeyDown(bytes, numBytes); +end; + +procedure View_KeyUp_hook_func(View : BView; bytes : PChar; numBytes : integer); cdecl; +begin + if View <> nil then + View.KeyUp(bytes, numBytes); +end; + +procedure View_MouseDown_hook_func(View : BView; aPoint : TCPlusObject); cdecl; +var + Point : BPoint; +begin + Point := BPoint.Wrap(aPoint); + try + if View <> nil then + View.MouseDown(Point); + finally + Point.UnWrap; + end; +end; + +procedure View_MouseMoved_hook_func(View : BView; aPoint : TCPlusObject; transit : Cardinal; aMessage : TCPlusObject); cdecl; +var + Point : BPoint; + Message : BMessage; +begin + Point := BPoint.Wrap(aPoint); + try + Message := BMessage.Wrap(aMessage); + try + if View <> nil then + View.MouseMoved(Point, transit, Message); + finally + Message.UnWrap; + end; + finally + Point.UnWrap; + end; +end; + +procedure View_MouseUp_hook_func(View : BView; aPoint : TCPlusObject); cdecl; +var + Point : BPoint; +begin + Point := BPoint.Wrap(aPoint); + try + if View <> nil then + View.MouseDown(Point); + finally + Point.UnWrap; + end; +end; + +procedure View_Pulse_hook_func(View : BView); cdecl; +begin + if View <> nil then + View.Pulse; +end; + +//procedure View_TargetedByScrollView_hook_func(View : BView; scroller : TScrollView); cdecl; +//var +// ScrollView : TScrollView; +//begin +// ScrollView := TScrollView.Wrap(scroller); +// try +// if View <> nil then +// View.TargetedByScrollView(ScrollView); +// finally +// ScrollView.UnWrap; +// end; +//end; + +procedure View_WindowActivated_hook_func(View : BView; active : boolean); cdecl; +begin + if View <> nil then + View.WindowActivated(active); +end; + +var + _B_FOLLOW_NONE : Cardinal; cvar; external; + _B_FOLLOW_ALL_SIDES : Cardinal; cvar; external; + + _B_FOLLOW_ALL : Cardinal; cvar; external; + + _B_FOLLOW_LEFT : Cardinal; cvar; external; + _B_FOLLOW_RIGHT : Cardinal; cvar; external; + _B_FOLLOW_LEFT_RIGHT : Cardinal; cvar; external; + _B_FOLLOW_H_CENTER : Cardinal; cvar; external; + + _B_FOLLOW_TOP : Cardinal; cvar; external; + _B_FOLLOW_BOTTOM : Cardinal; cvar; external; + _B_FOLLOW_TOP_BOTTOM : Cardinal; cvar; external; + _B_FOLLOW_V_CENTER : Cardinal; cvar; external; + +initialization + B_FOLLOW_NONE := _B_FOLLOW_NONE; + B_FOLLOW_ALL_SIDES := _B_FOLLOW_ALL_SIDES; + + B_FOLLOW_ALL := _B_FOLLOW_ALL; + + B_FOLLOW_LEFT := _B_FOLLOW_LEFT; + B_FOLLOW_RIGHT := _B_FOLLOW_RIGHT; + B_FOLLOW_LEFT_RIGHT := _B_FOLLOW_LEFT_RIGHT; + B_FOLLOW_H_CENTER := _B_FOLLOW_H_CENTER; + + B_FOLLOW_TOP := _B_FOLLOW_TOP; + B_FOLLOW_BOTTOM := _B_FOLLOW_BOTTOM; + B_FOLLOW_TOP_BOTTOM := _B_FOLLOW_TOP_BOTTOM; + B_FOLLOW_V_CENTER := _B_FOLLOW_V_CENTER; + + // Connecting hook functions + View_AllAttached_hook := @View_AllAttached_hook_func; + View_AllDetached_hook := @View_AllDetached_hook_func; + View_AttachedToWindow_hook := @View_AttachedToWindow_hook_func; + View_DetachedFromWindow_hook := @View_DetachedFromWindow_hook_func; + View_Draw_hook := @View_Draw_hook_func; + View_DrawAfterChildren_hook := @View_DrawAfterChildren_hook_func; + View_FrameMoved_hook := @View_FrameMoved_hook_func; + View_FrameResized_hook := @View_FrameResized_hook_func; + View_GetPreferredSize_hook := @View_GetPreferredSize_hook_func; + View_ResizeToPreferred_hook := @View_ResizeToPreferred_hook_func; + View_KeyDown_hook := @View_KeyDown_hook_func; + View_KeyUp_hook := @View_KeyUp_hook_func; + View_MouseDown_hook := @View_MouseDown_hook_func; + View_MouseMoved_hook := @View_MouseMoved_hook_func; + View_MouseUp_hook := @View_MouseUp_hook_func; + View_Pulse_hook := @View_Pulse_hook_func; +// View_TargetedByScrollView_hook := @View_TargetedByScrollView_hook_func; + View_WindowActivated_hook := @View_WindowActivated_hook_func; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/interface/window.pp b/bepascal/source/bepascal/pas/src/be/interface/window.pp new file mode 100644 index 0000000..b849730 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/interface/window.pp @@ -0,0 +1,1367 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit Window; + +interface + +uses + beobj, looper, rect, os, application, view, message, handler, appdefs, + button, archivable, supportDefs, GraphicDefs; + +const + // window_type + B_UNTYPED_WINDOW = 0; + B_TITLED_WINDOW = 1; + B_MODAL_WINDOW = 3; + B_DOCUMENT_WINDOW = 11; + B_BORDERED_WINDOW = 20; + B_FLOATING_WINDOW = 21; + + // window_look + B_BORDERED_WINDOW_LOOK = 20; + B_NO_BORDER_WINDOW_LOOK = 19; + B_TITLED_WINDOW_LOOK = 1; + B_DOCUMENT_WINDOW_LOOK = 11; + B_MODAL_WINDOW_LOOK = 3; + B_FLOATING_WINDOW_LOOK = 7; + + // window_feel + B_NORMAL_WINDOW_FEEL = 0; + B_MODAL_SUBSET_WINDOW_FEEL = 2; + B_MODAL_APP_WINDOW_FEEL = 1; + B_MODAL_ALL_WINDOW_FEEL = 3; + B_FLOATING_SUBSET_WINDOW_FEEL = 5; + B_FLOATING_APP_WINDOW_FEEL = 4; + B_FLOATING_ALL_WINDOW_FEEL = 6; + + // flags + B_NOT_MOVABLE = $00000001; + B_NOT_CLOSABLE = $00000020; + B_NOT_ZOOMABLE = $00000040; + B_NOT_MINIMIZABLE = $00004000; + B_NOT_RESIZABLE = $00000002; + B_NOT_H_RESIZABLE = $00000004; + B_NOT_V_RESIZABLE = $00000008; + B_AVOID_FRONT = $00000080; + B_AVOID_FOCUS = $00002000; + B_WILL_ACCEPT_FIRST_CLICK = $00000010; + B_OUTLINE_RESIZE = $00001000; + B_NO_WORKSPACE_ACTIVATION = $00000100; + B_NOT_ANCHORED_ON_ACTIVATE = $00020000; + B_ASYNCHRONOUS_CONTROLS = $00080000; + B_QUIT_ON_WINDOW_CLOSE = $00100000; + + B_CURRENT_WORKSPACE = 0; + B_ALL_WORKSPACES = $ffffffff; + +type + PCardinal = ^Cardinal; +// PInteger = ^Integer; + BWindow = class(BLooper) + public + constructor Create(aFrame : BRect; aTitle : PChar; aNewType, SomeFlags, AWorkspaces : Cardinal); virtual; + destructor Destroy; override; + procedure Show; + procedure Hide; + procedure AddChild(aView : BView; sibling : BView); + function QuitRequested : boolean; override; + function RemoveChild(aView : BView) : boolean; + // New + // constructor Create; + // constructor Create(frame : TRect; title : PChar; look : PCardinal; feel : Cardinal; flags : Cardinal; workspace : Cardinal); + // destructor Destroy; + // constructor Create(data : TMessage); + function Instantiate(data : BMessage) : BArchivable; + function Archive(data : BMessage; deep : boolean) : Status_t; + procedure Quit; +// procedure Close; + // procedure AddChild(child : TView; before : TView); + // function RemoveChild(child : TView) : boolean; + function CountChildren : integer; + function ChildAt(index : integer) : BView; + procedure DispatchMessage(message : BMessage; handler : BHandler); override; + procedure MessageReceived(message : BMessage); override; + procedure FrameMoved(new_position : BPoint); + procedure WorkspacesChanged(old_ws : Cardinal; new_ws : Cardinal); + procedure WorkspaceActivated(ws : integer; state : boolean); + procedure FrameResized(new_width : double; new_height : double); + procedure Minimize(aMinimize : boolean); + procedure Zoom(rec_position : BPoint; rec_width : double; rec_height : double); + procedure Zoom; + procedure SetZoomLimits(max_h : double; max_v : double); + procedure ScreenChanged(screen_size : BRect; depth : Color_Space); + procedure SetPulseRate(rate : Bigtime_t); + function PulseRate : Bigtime_t; + procedure AddShortcut(key : Cardinal; modifiers : Cardinal; msg : BMessage); + procedure AddShortcut(key : Cardinal; modifiers : Cardinal; msg : BMessage; target : BHandler); + procedure RemoveShortcut(key : Cardinal; modifiers : Cardinal); + procedure SetDefaultButton(button : BButton); + function DefaultButton : BButton; + procedure MenusBeginning; + procedure MenusEnded; + function NeedsUpdate : boolean; + procedure UpdateIfNeeded; + function FindView(view_name : PChar) : BView; + function FindView(aPoint : BPoint) : BView; + function CurrentFocus : BView; + procedure Activate(aValue : boolean); + procedure WindowActivated(state : boolean); +// procedure ConvertToScreen(var pt : TPoint); overload; + function ConvertToScreen(pt : BPoint) : BPoint; overload; +// procedure ConvertFromScreen(var pt : TPoint); + function ConvertFromScreen(pt : BPoint) : BPoint; +// procedure ConvertToScreen(var rect : TRect); +// function ConvertToScreen(rect : TRect) : TRect; +// procedure ConvertFromScreen(var rect : TRect); +// function ConvertFromScreen(rect : TRect) : TRect; + procedure MoveBy(dx : double; dy : double); + procedure MoveTo(aPoint : BPoint); + procedure MoveTo(x : double; y : double); + procedure ResizeBy(dx : double; dy : double); + procedure ResizeTo(width : double; height : double); + // procedure Show; + // procedure Hide; + function IsHidden : boolean; + function IsMinimized : boolean; + procedure Flush; + procedure Sync; + function SendBehind(window : BWindow) : Status_t; + procedure DisableUpdates; + procedure EnableUpdates; + procedure BeginViewTransaction; + procedure EndViewTransaction; + function Bounds : BRect; + function GetFrame : BRect; + function GetTitle : PChar; + procedure SetTitle(title : PChar); + function IsFront : boolean; + function IsActive : boolean; +// procedure SetKeyMenuBar(bar : TMenuBar); +// function KeyMenuBar : TMenuBar; + procedure SetSizeLimits(min_h : double; max_h : double; min_v : double; max_v : double); + procedure GetSizeLimits(min_h : double; max_h : double; min_v : double; max_v : double); + function Workspaces : Cardinal; + procedure SetWorkspaces(aWorkspace : Cardinal); + function LastMouseMovedView : BView; + function ResolveSpecifier(msg :BMessage; index : integer; specifier : BMessage; form : integer; aProperty : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : Status_t; + function AddToSubset(window : BWindow) : Status_t; + function RemoveFromSubset(window : BWindow) : Status_t; + function Perform(d : Perform_code; arg : Pointer) : Status_t; + function SetType(aType : Cardinal) : Status_t; + function GetType : Cardinal; + function SetLook(look : PCardinal) : Status_t; + function GetLook : PCardinal; + function SetFeel(feel : Cardinal) : Status_t; + function GetFeel : Cardinal; + function SetFlags(aFlags : Cardinal) : Status_t; + function GetFlags : Cardinal; + function IsModal : boolean; + function IsFloating : boolean; + function SetWindowAlignment(mode : Cardinal; h : integer; hOffset : integer; width : integer; widthOffset : integer; v : integer; vOffset : integer; height : integer; heightOffset : integer) : Status_t; + function GetWindowAlignment(mode : PCardinal; var h : integer; var hOffset : integer; var width : integer; var widthOffset : integer; var v : integer; var vOffset : integer; var height : integer; var heightOffset : integer) : Status_t; +// function QuitRequested : boolean; + function Run : Thread_id; + end; + +function BWindow_Create(AObject : TObject; frame : TCPlusObject; title : PChar; + atype, flags, workspaces : cardinal) : TCplusObject; cdecl; external BePascalLibName name 'BWindow_Create_1'; +procedure BWindow_Free(CPlusObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_Free'; +procedure BWindow_Show(CPlusObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_Show'; +procedure BWindow_Hide(CPlusObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_Hide'; +procedure BWindow_AddChild(CPlusObject : TCPlusObject; aView : TCPlusObject; sibling : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_AddChild'; +function BWindow_RemoveChild(CPlusObject : TCPlusObject; aView : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_RemoveChild'; + +// New +//function BWindow_Create(AObject : TBeObject; data : TMessage); cdecl; external BePascalLibName name 'BWindow_Create'; +function BWindow_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BWindow_Instantiate'; +function BWindow_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BWindow_Archive'; +procedure BWindow_Quit(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_Quit'; +//procedure BWindow_Close(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_Close'; +//procedure BWindow_AddChild(AObject : TCPlusObject; child : TCPlusObject; before : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_AddChild'; +function BWindow_RemoveChild(AObject : TCPlusObject; child : BView) : boolean; cdecl; external BePascalLibName name 'BWindow_RemoveChild'; +function BWindow_CountChildren(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BWindow_CountChildren'; +function BWindow_ChildAt(AObject : TCPlusObject; index : integer) : BView; cdecl; external BePascalLibName name 'BWindow_ChildAt'; +procedure BWindow_DispatchMessage(AObject : TCPlusObject; message : BMessage; handler : BHandler); cdecl; external BePascalLibName name 'BWindow_DispatchMessage'; +procedure BWindow_MessageReceived(AObject : TCPlusObject; message : BMessage); cdecl; external BePascalLibName name 'BWindow_MessageReceived'; +procedure BWindow_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_FrameMoved'; +procedure BWindow_WorkspacesChanged(AObject : TCPlusObject; old_ws : Cardinal; new_ws : Cardinal); cdecl; external BePascalLibName name 'BWindow_WorkspacesChanged'; +procedure BWindow_WorkspaceActivated(AObject : TCPlusObject; ws : integer; state : boolean); cdecl; external BePascalLibName name 'BWindow_WorkspaceActivated'; +procedure BWindow_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BWindow_FrameResized'; +procedure BWindow_Minimize(AObject : TCPlusObject; minimize : boolean); cdecl; external BePascalLibName name 'BWindow_Minimize'; +procedure BWindow_Zoom(AObject : TCPlusObject; rec_position : TCPlusObject; rec_width : double; rec_height : double); cdecl; external BePascalLibName name 'BWindow_Zoom'; +procedure BWindow_Zoom(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_Zoom'; +procedure BWindow_SetZoomLimits(AObject : TCPlusObject; max_h : double; max_v : double); cdecl; external BePascalLibName name 'BWindow_SetZoomLimits'; +procedure BWindow_ScreenChanged(AObject : TCPlusObject; screen_size : TCPlusObject; depth : Color_Space); cdecl; external BePascalLibName name 'BWindow_ScreenChanged'; +procedure BWindow_SetPulseRate(AObject : TCPlusObject; rate : Bigtime_t); cdecl; external BePascalLibName name 'BWindow_SetPulseRate'; +function BWindow_PulseRate(AObject : TCPlusObject) : Bigtime_t; cdecl; external BePascalLibName name 'BWindow_PulseRate'; +procedure BWindow_AddShortcut(AObject : TCPlusObject; key : Cardinal; modifiers : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_AddShortcut'; +procedure BWindow_AddShortcut(AObject : TCPlusObject; key : Cardinal; modifiers : Cardinal; msg : TCPlusObject; target : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_AddShortcut'; +procedure BWindow_RemoveShortcut(AObject : TCPlusObject; key : Cardinal; modifiers : Cardinal); cdecl; external BePascalLibName name 'BWindow_RemoveShortcut'; +procedure BWindow_SetDefaultButton(AObject : TCPlusObject; button : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_SetDefaultButton'; +function BWindow_DefaultButton(AObject : TCPlusObject) : BButton; cdecl; external BePascalLibName name 'BWindow_DefaultButton'; +procedure BWindow_MenusBeginning(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_MenusBeginning'; +procedure BWindow_MenusEnded(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_MenusEnded'; +function BWindow_NeedsUpdate(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_NeedsUpdate'; +procedure BWindow_UpdateIfNeeded(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_UpdateIfNeeded'; +function BWindow_FindView(AObject : TCPlusObject; view_name : PChar) : BView; cdecl; external BePascalLibName name 'BWindow_FindView'; +function BWindow_FindView(AObject : TCPlusObject; aPoint : BPoint) : BView; cdecl; external BePascalLibName name 'BWindow_FindView'; +function BWindow_CurrentFocus(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BWindow_CurrentFocus'; +procedure BWindow_Activate(AObject : TCPlusObject; aState : boolean); cdecl; external BePascalLibName name 'BWindow_Activate'; +procedure BWindow_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BWindow_WindowActivated'; +//procedure BWindow_ConvertToScreen(AObject : TCPlusObject; var pt : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_ConvertToScreen'; +function BWindow_ConvertToScreen(AObject : TCPlusObject; pt : TCPlusObject) : BPoint; cdecl; external BePascalLibName name 'BWindow_ConvertToScreen_1'; +//procedure BWindow_ConvertFromScreen(AObject : TCPlusObject; var pt : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_ConvertFromScreen'; +function BWindow_ConvertFromScreen(AObject : TCPlusObject; pt : TCPlusObject) : BPoint; cdecl; external BePascalLibName name 'BWindow_ConvertFromScreen_1'; +//procedure BWindow_ConvertToScreen(AObject : TCPlusObject; var rect : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_ConvertToScreen'; +//function BWindow_ConvertToScreen(AObject : TCPlusObject; rect : TCPlusObject) : TRect; cdecl; external BePascalLibName name 'BWindow_ConvertToScreen'; +//procedure BWindow_ConvertFromScreen(AObject : TCPlusObject; var rect : TRect); cdecl; external BePascalLibName name 'BWindow_ConvertFromScreen'; +//function BWindow_ConvertFromScreen(AObject : TCPlusObject; rect : TRect) : TRect; cdecl; external BePascalLibName name 'BWindow_ConvertFromScreen'; +procedure BWindow_MoveBy(AObject : TCPlusObject; dx : double; dy : double); cdecl; external BePascalLibName name 'BWindow_MoveBy'; +procedure BWindow_MoveTo(AObject : TCPlusObject; aPoint : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_MoveTo'; +procedure BWindow_MoveTo(AObject : TCPlusObject; x : double; y : double); cdecl; external BePascalLibName name 'BWindow_MoveTo'; +procedure BWindow_ResizeBy(AObject : TCPlusObject; dx : double; dy : double); cdecl; external BePascalLibName name 'BWindow_ResizeBy'; +procedure BWindow_ResizeTo(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BWindow_ResizeTo'; +//procedure BWindow_Show(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_Show'; +//procedure BWindow_Hide(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_Hide'; +function BWindow_IsHidden(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_IsHidden'; +function BWindow_IsMinimized(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_IsMinimized'; +procedure BWindow_Flush(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_Flush'; +procedure BWindow_Sync(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_Sync'; +function BWindow_SendBehind(AObject : TCPlusObject; window : BWindow) : Status_t; cdecl; external BePascalLibName name 'BWindow_SendBehind'; +procedure BWindow_DisableUpdates(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_DisableUpdates'; +procedure BWindow_EnableUpdates(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_EnableUpdates'; +procedure BWindow_BeginViewTransaction(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BeginViewTransaction'; +procedure BWindow_EndViewTransaction(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_EndViewTransaction'; +function BWindow_Bounds(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BWindow_Bounds'; +function BWindow_Frame(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BWindow_Frame'; +function BWindow_Title(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BWindow_Title'; +procedure BWindow_SetTitle(AObject : TCPlusObject; title : PChar); cdecl; external BePascalLibName name 'BWindow_SetTitle'; +function BWindow_IsFront(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_IsFront'; +function BWindow_IsActive(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_IsActive'; +//procedure BWindow_SetKeyMenuBar(AObject : TCPlusObject; bar : TMenuBar); cdecl; external BePascalLibName name 'BWindow_SetKeyMenuBar'; +//function BWindow_KeyMenuBar(AObject : TCPlusObject) : TMenuBar; cdecl; external BePascalLibName name 'BWindow_KeyMenuBar'; +procedure BWindow_SetSizeLimits(AObject : TCPlusObject; min_h : double; max_h : double; min_v : double; max_v : double); cdecl; external BePascalLibName name 'BWindow_SetSizeLimits'; +procedure BWindow_GetSizeLimits(AObject : TCPlusObject; min_h : double; max_h : double; min_v : double; max_v : double); cdecl; external BePascalLibName name 'BWindow_GetSizeLimits'; +function BWindow_Workspaces(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BWindow_Workspaces'; +procedure BWindow_SetWorkspaces(AObject : TCPlusObject; Workspaces : Cardinal); cdecl; external BePascalLibName name 'BWindow_SetWorkspaces'; +function BWindow_LastMouseMovedView(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BWindow_LastMouseMovedView'; +function BWindow_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; aProperty : PChar) : BHandler; cdecl; external BePascalLibName name 'BWindow_ResolveSpecifier'; +function BWindow_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BWindow_GetSupportedSuites'; +function BWindow_AddToSubset(AObject : TCPlusObject; window : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BWindow_AddToSubset'; +function BWindow_RemoveFromSubset(AObject : TCPlusObject; window : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BWindow_RemoveFromSubset'; +function BWindow_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BWindow_Perform'; +function BWindow_SetType(AObject : TCPlusObject; aType : Cardinal) : Status_t; cdecl; external BePascalLibName name 'BWindow_SetType'; +function BWindow_Type(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BWindow_Type'; +function BWindow_SetLook(AObject : TCPlusObject; look : PCardinal) : Status_t; cdecl; external BePascalLibName name 'BWindow_SetLook'; +function BWindow_Look(AObject : TCPlusObject) : PCardinal; cdecl; external BePascalLibName name 'BWindow_Look'; +function BWindow_SetFeel(AObject : TCPlusObject; feel : Cardinal) : Status_t; cdecl; external BePascalLibName name 'BWindow_SetFeel'; +function BWindow_Feel(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BWindow_Feel'; +function BWindow_SetFlags(AObject : TCPlusObject; aFlags : Cardinal) : Status_t; cdecl; external BePascalLibName name 'BWindow_SetFlags'; +function BWindow_Flags(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BWindow_Flags'; +function BWindow_IsModal(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_IsModal'; +function BWindow_IsFloating(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_IsFloating'; +function BWindow_SetWindowAlignment(AObject : TCPlusObject; mode : Cardinal; h : integer; hOffset : integer; width : integer; widthOffset : integer; v : integer; vOffset : integer; height : integer; heightOffset : integer) : Status_t; cdecl; external BePascalLibName name 'BWindow_SetWindowAlignment'; +function BWindow_GetWindowAlignment(AObject : TCPlusObject; mode : PCardinal; var h : integer; var hOffset : integer; var width : integer; widthOffset : integer; var v : integer; var vOffset : integer; var height : integer; var heightOffset : integer) : Status_t; cdecl; external BePascalLibName name 'BWindow_GetWindowAlignment'; +function BWindow_QuitRequested(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_QuitRequested'; +function BWindow_Run(AObject : TCPlusObject) : Thread_id; cdecl; external BePascalLibName name 'BWindow_Run'; +procedure BWindow_BLooper(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BLooper inherited'; +//procedure BWindow__ReservedWindow1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__ReservedWindow1'; +//procedure BWindow__ReservedWindow2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__ReservedWindow2'; +//procedure BWindow__ReservedWindow3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__ReservedWindow3'; +//procedure BWindow__ReservedWindow4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__ReservedWindow4'; +//procedure BWindow__ReservedWindow5(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__ReservedWindow5'; +//procedure BWindow__ReservedWindow6(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__ReservedWindow6'; +//procedure BWindow__ReservedWindow7(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__ReservedWindow7'; +//procedure BWindow__ReservedWindow8(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__ReservedWindow8'; +//function BWindow_Create(AObject : TBeObject); cdecl; external BePascalLibName name 'BWindow_Create'; +//function BWindow_Create(AObject : TBeObject; : TWindow); cdecl; external BePascalLibName name 'BWindow_Create'; +//function BWindow_operator=(AObject : TCPlusObject; : TWindow) : TWindow; cdecl; external BePascalLibName name 'BWindow_operator='; +//function BWindow_Create(AObject : TBeObject; frame : TRect; depth : TColor_Space; bitmapFlags : Cardinal; rowBytes : integer); cdecl; external BePascalLibName name 'BWindow_Create'; +//procedure BWindow_InitData(AObject : TCPlusObject; frame : TRect; title : PChar; look : PCadinal; feel : Cardinal; flags : Cardinal; workspace : Cardinal); cdecl; external BePascalLibName name 'BWindow_InitData'; +//function BWindow_ArchiveChildren(AObject : TCPlusObject; data : TMessage; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BWindow_ArchiveChildren'; +//function BWindow_UnarchiveChildren(AObject : TCPlusObject; data : TMessage) : TStatus_t; cdecl; external BePascalLibName name 'BWindow_UnarchiveChildren'; +//procedure BWindow_BitmapClose(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BitmapClose'; +//procedure BWindow_task_looper(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_task_looper'; +//procedure BWindow_start_drag(AObject : TCPlusObject; msg : TMessage; token : integer; offset : TPoint; track_rect : TRect; reply_to : THandler); cdecl; external BePascalLibName name 'BWindow_start_drag'; +//procedure BWindow_start_drag(AObject : TCPlusObject; msg : TMessage; token : integer; offset : TPoint; bitmap_token : integer; dragMode : TDrawing_Mode; reply_to : THandler); cdecl; external BePascalLibName name 'BWindow_start_drag'; +//procedure BWindow_view_builder(AObject : TCPlusObject; a_view : TView); cdecl; external BePascalLibName name 'BWindow_view_builder'; +//procedure BWindow_attach_builder(AObject : TCPlusObject; a_view : TView); cdecl; external BePascalLibName name 'BWindow_attach_builder'; +//procedure BWindow_detach_builder(AObject : TCPlusObject; a_view : TView); cdecl; external BePascalLibName name 'BWindow_detach_builder'; +//function BWindow_get_server_token(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BWindow_get_server_token'; +//function BWindow_extract_drop(AObject : TCPlusObject; an_event : TMessage; target : THandler) : TMessage; cdecl; external BePascalLibName name 'BWindow_extract_drop'; +//procedure BWindow_movesize(AObject : TCPlusObject; opcode : Cardinal; h : double; v : double); cdecl; external BePascalLibName name 'BWindow_movesize'; +//function BWindow_ReadMessageFromPort(AObject : TCPlusObject; tout : TBigtime_t) : TMessage; cdecl; external BePascalLibName name 'BWindow_ReadMessageFromPort'; +//function BWindow_MessagesWaiting(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BWindow_MessagesWaiting'; +//procedure BWindow_handle_activate(AObject : TCPlusObject; an_event : TMessage); cdecl; external BePascalLibName name 'BWindow_handle_activate'; +//procedure BWindow_do_view_frame(AObject : TCPlusObject; an_event : TMessage); cdecl; external BePascalLibName name 'BWindow_do_view_frame'; +//procedure BWindow_do_value_change(AObject : TCPlusObject; an_event : TMessage; handler : THandler); cdecl; external BePascalLibName name 'BWindow_do_value_change'; +//procedure BWindow_do_mouse_down(AObject : TCPlusObject; an_event : TMessage; target : TView); cdecl; external BePascalLibName name 'BWindow_do_mouse_down'; +//procedure BWindow_do_mouse_moved(AObject : TCPlusObject; an_event : TMessage; target : TView); cdecl; external BePascalLibName name 'BWindow_do_mouse_moved'; +//procedure BWindow_do_key_down(AObject : TCPlusObject; an_event : TMessage; handler : THandler); cdecl; external BePascalLibName name 'BWindow_do_key_down'; +//procedure BWindow_do_key_up(AObject : TCPlusObject; an_event : TMessage; handler : THandler); cdecl; external BePascalLibName name 'BWindow_do_key_up'; +//procedure BWindow_do_menu_event(AObject : TCPlusObject; an_event : TMessage); cdecl; external BePascalLibName name 'BWindow_do_menu_event'; +//procedure BWindow_do_draw_views(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_do_draw_views'; +//function BWindow_ConvertToMessage(AObject : TCPlusObject; raw : Pointer; code : integer) : TMessage; cdecl; external BePascalLibName name 'BWindow_ConvertToMessage'; +//function BWindow_allocShortcut(AObject : TCPlusObject; key : Cardinal; modifiers : Cardinal) : TCmd_Key; cdecl; external BePascalLibName name 'BWindow_allocShortcut'; +//function BWindow_FindShortcut(AObject : TCPlusObject; key : Cardinal; modifiers : Cardinal) : TCmd_Key; cdecl; external BePascalLibName name 'BWindow_FindShortcut'; +//procedure BWindow_AddShortcut(AObject : TCPlusObject; key : Cardinal; modifiers : Cardinal; item : TMenuItem); cdecl; external BePascalLibName name 'BWindow_AddShortcut'; +//procedure BWindow_post_message(AObject : TCPlusObject; message : TMessage); cdecl; external BePascalLibName name 'BWindow_post_message'; +//procedure BWindow_SetLocalTitle(AObject : TCPlusObject; new_title : PChar); cdecl; external BePascalLibName name 'BWindow_SetLocalTitle'; +//procedure BWindow_enable_pulsing(AObject : TCPlusObject; enable : boolean); cdecl; external BePascalLibName name 'BWindow_enable_pulsing'; +//function BWindow_determine_target(AObject : TCPlusObject; msg : TMessage; target : THandler; pref : boolean) : THandler; cdecl; external BePascalLibName name 'BWindow_determine_target'; +//procedure BWindow_kb_navigate(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_kb_navigate'; +//procedure BWindow_navigate_to_next(AObject : TCPlusObject; direction : integer; group : boolean); cdecl; external BePascalLibName name 'BWindow_navigate_to_next'; +//procedure BWindow_set_focus(AObject : TCPlusObject; focus : TView; notify_input_server : boolean); cdecl; external BePascalLibName name 'BWindow_set_focus'; +//function BWindow_InUpdate(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_InUpdate'; +//procedure BWindow_DequeueAll(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_DequeueAll'; +//function BWindow_find_token_and_handler(AObject : TCPlusObject; msg : TMessage; token : ^integer; handler : THandler) : boolean; cdecl; external BePascalLibName name 'BWindow_find_token_and_handler'; +//function BWindow_compose_type(AObject : TCPlusObject; look : PCadinal; feel : Cardinal) : Cardinal; cdecl; external BePascalLibName name 'BWindow_compose_type'; +//procedure BWindow_decompose_type(AObject : TCPlusObject; type : Cardinal; look : PCardinal; feel : PCardinal); cdecl; external BePascalLibName name 'BWindow_decompose_type'; +//procedure BWindow_SetIsFilePanel(AObject : TCPlusObject; panel : boolean); cdecl; external BePascalLibName name 'BWindow_SetIsFilePanel'; +//function BWindow_IsFilePanel(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_IsFilePanel'; +//procedure BWindow_AddFloater(AObject : TCPlusObject; a_floating_window : TWindow); cdecl; external BePascalLibName name 'BWindow_AddFloater'; +//procedure BWindow_RemoveFloater(AObject : TCPlusObject; a_floating_window : TWindow); cdecl; external BePascalLibName name 'BWindow_RemoveFloater'; +//function BWindow_WindowType(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BWindow_WindowType'; +//procedure BWindow_char *fTitle(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_char *fTitle'; +//procedure BWindow_int32 server_token(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_int32 server_token'; +//procedure BWindow_char fInUpdate(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_char fInUpdate'; +//procedure BWindow_char f_active(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_char f_active'; +//procedure BWindow_short fShowLevel(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_short fShowLevel'; +//procedure BWindow_uint32 fFlags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_uint32 fFlags'; +//procedure BWindow_port_id send_port(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_port_id send_port'; +//procedure BWindow_port_id receive_port(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_port_id receive_port'; +//procedure BWindow_BView *top_view(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BView *top_view'; +//procedure BWindow_BView *fFocus(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BView *fFocus'; +//procedure BWindow_BView *fLastMouseMovedView(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BView *fLastMouseMovedView'; +//procedure BWindow__BSession_ *a_session(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__BSession_ *a_session'; +//procedure BWindow_BMenuBar *fKeyMenuBar(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BMenuBar *fKeyMenuBar'; +//procedure BWindow_BButton *fDefaultButton(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BButton *fDefaultButton'; +//procedure BWindow_BList accelList(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BList accelList'; +//procedure BWindow_int32 top_view_token(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_int32 top_view_token'; +//procedure BWindow_bool pulse_enabled(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_bool pulse_enabled'; +//procedure BWindow_bool fViewsNeedPulse(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_bool fViewsNeedPulse'; +//procedure BWindow_bool fIsFilePanel(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_bool fIsFilePanel'; +//procedure BWindow_bool fUnused1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_bool fUnused1'; +//procedure BWindow_bigtime_t pulse_rate(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_bigtime_t pulse_rate'; +//procedure BWindow_bool fWaitingForMenu(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_bool fWaitingForMenu'; +//procedure BWindow_bool fOffscreen(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_bool fOffscreen'; +//procedure BWindow_sem_id fMenuSem(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_sem_id fMenuSem'; +//procedure BWindow_float fMaxZoomH(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_float fMaxZoomH'; +//procedure BWindow_float fMaxZoomV(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_float fMaxZoomV'; +//procedure BWindow_float fMinWindH(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_float fMinWindH'; +//procedure BWindow_float fMinWindV(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_float fMinWindV'; +//procedure BWindow_float fMaxWindH(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_float fMaxWindH'; +//procedure BWindow_float fMaxWindV(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_float fMaxWindV'; +//procedure BWindow_BRect fFrame(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BRect fFrame'; +//procedure BWindow_window_look fLook(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_window_look fLook'; +//procedure BWindow__view_attr_ *fCurDrawViewState(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__view_attr_ *fCurDrawViewState'; +//procedure BWindow_window_feel fFeel(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_window_feel fFeel'; +//procedure BWindow_int32 fLastViewToken(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_int32 fLastViewToken'; +//procedure BWindow__CEventPort_ *fEventPort(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow__CEventPort_ *fEventPort'; +//procedure BWindow_BMessageRunner *fPulseRunner(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BMessageRunner *fPulseRunner'; +//procedure BWindow_BRect fCurrentFrame(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_BRect fCurrentFrame'; +//procedure BWindow_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_uint32 _reserved[2]'; +//procedure BWindow_uint32 _more_reserved[4](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BWindow_uint32 _more_reserved[4]'; +// +implementation + +function BWindow.QuitRequested : boolean; +begin + Result := inherited; + be_app.PostMessage(B_QUIT_REQUESTED); +end; + +constructor BWindow.Create(aFrame : BRect; aTitle : PChar; aNewType, SomeFlags, aWorkspaces : Cardinal); +begin + inherited Create; + CPlusObject := BWindow_Create(Self, aFrame.CPlusObject, aTitle, aNewType, SomeFlags, aWorkspaces); +end; + +destructor BWindow.Destroy; +begin + BWindow_Free(CPlusObject); + inherited; +end; + +procedure BWindow.Show; +begin + BWindow_Show(Self.CPlusObject); +end; + +procedure BWindow.Hide; +begin + BWindow_Hide(Self.CPlusObject); +end; + +procedure BWindow.AddChild(aView : BView; sibling : BView); +begin + BWindow_AddChild(Self.CPlusObject, aView.CPlusObject, nil{sibling.CPlusObject}); +end; + +function BWindow.RemoveChild(aView : BView) : boolean; +begin + result := BWindow_RemoveChild(Self.CPlusObject, aView.CPlusObject); +end; + +function BWindow.Instantiate(data : BMessage) : BArchivable; +begin + Result := BWindow_Instantiate(CPlusObject, data.CPlusObject); +end; + +function BWindow.Archive(data : BMessage; deep : boolean) : Status_t; +begin + Result := BWindow_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure BWindow.Quit; +begin + BWindow_Quit(CPlusObject); +end; + +//procedure TWindow.Close; +//begin +// BWindow_Close(CPlusObject); +//end; + +//procedure TWindow.AddChild(child : TView; before : TView); +//begin +// BWindow_AddChild(CPlusObject, child.CPlusObject, before.CPlusObject); +//end; + +//function TWindow.RemoveChild(child : TView) : boolean; +//begin +// Result := BWindow_RemoveChild(CPlusObject, child.CPlusObject); +//end; + +function BWindow.CountChildren : integer; +begin + Result := BWindow_CountChildren(CPlusObject); +end; + +function BWindow.ChildAt(index : integer) : BView; +begin + Result := BWindow_ChildAt(CPlusObject, index); +end; + +procedure BWindow.DispatchMessage(message : BMessage; handler : BHandler); +begin + +end; + +procedure BWindow.MessageReceived(message : BMessage); +begin + +end; + +procedure BWindow.FrameMoved(new_position : BPoint); +begin + BWindow_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure BWindow.WorkspacesChanged(old_ws : Cardinal; new_ws : Cardinal); +begin + BWindow_WorkspacesChanged(CPlusObject, old_ws, new_ws); +end; + +procedure BWindow.WorkspaceActivated(ws : integer; state : boolean); +begin + BWindow_WorkspaceActivated(CPlusObject, ws, state); +end; + +procedure BWindow.FrameResized(new_width : double; new_height : double); +begin + BWindow_FrameResized(CPlusObject, new_width, new_height); +end; + +procedure BWindow.Minimize(aMinimize : boolean); +begin + BWindow_Minimize(CPlusObject, aMinimize); +end; + +procedure BWindow.Zoom(rec_position : BPoint; rec_width : double; rec_height : double); +begin + BWindow_Zoom(CPlusObject, rec_position.CPlusObject, rec_width, rec_height); +end; + +procedure BWindow.Zoom; +begin + BWindow_Zoom(CPlusObject); +end; + +procedure BWindow.SetZoomLimits(max_h : double; max_v : double); +begin + BWindow_SetZoomLimits(CPlusObject, max_h, max_v); +end; + +procedure BWindow.ScreenChanged(screen_size : BRect; depth : Color_Space); +begin + BWindow_ScreenChanged(CPlusObject, screen_size.CPlusObject, depth); +end; + +procedure BWindow.SetPulseRate(rate : Bigtime_t); +begin + BWindow_SetPulseRate(CPlusObject, rate); +end; + +function BWindow.PulseRate : Bigtime_t; +begin + Result := BWindow_PulseRate(CPlusObject); +end; + +procedure BWindow.AddShortcut(key : Cardinal; modifiers : Cardinal; msg : BMessage); +begin + BWindow_AddShortcut(CPlusObject, key, modifiers, msg.CPlusObject); +end; + +procedure BWindow.AddShortcut(key : Cardinal; modifiers : Cardinal; msg : BMessage; target : BHandler); +begin + BWindow_AddShortcut(CPlusObject, key, modifiers, msg.CPlusObject, target.CPlusObject); +end; + +procedure BWindow.RemoveShortcut(key : Cardinal; modifiers : Cardinal); +begin + BWindow_RemoveShortcut(CPlusObject, key, modifiers); +end; + +procedure BWindow.SetDefaultButton(button : BButton); +begin + BWindow_SetDefaultButton(CPlusObject, button.CPlusObject); +end; + +function BWindow.DefaultButton : BButton; +begin + Result := BWindow_DefaultButton(CPlusObject); +end; + +procedure BWindow.MenusBeginning; +begin + BWindow_MenusBeginning(CPlusObject); +end; + +procedure BWindow.MenusEnded; +begin + BWindow_MenusEnded(CPlusObject); +end; + +function BWindow.NeedsUpdate : boolean; +begin +// Result := BWindow_NeedsUpdate(CPlusObject); + Result := True; +end; + +procedure BWindow.UpdateIfNeeded; +begin + BWindow_UpdateIfNeeded(CPlusObject); +end; + +function BWindow.FindView(view_name : PChar) : BView; +begin + Result := BWindow_FindView(CPlusObject, view_name); +end; + +function BWindow.FindView(aPoint : BPoint) : BView; +begin + Result := BWindow_FindView(CPlusObject, aPoint.CPlusObject); +end; + +function BWindow.CurrentFocus : BView; +begin + Result := BWindow_CurrentFocus(CPlusObject); +end; + +procedure BWindow.Activate(aValue : boolean); +begin + BWindow_Activate(CPlusObject, aValue); +end; + +procedure BWindow.WindowActivated(state : boolean); +begin +// BWindow_WindowActivated(CPlusObject, state); +end; + +//procedure TWindow.ConvertToScreen(pt : TPoint); +//begin +// BWindow_ConvertToScreen(CPlusObject, pt.CPlusObject); +//end; + +function BWindow.ConvertToScreen(pt : BPoint) : BPoint; +begin + Result := BWindow_ConvertToScreen(CPlusObject, pt.CPlusObject); +end; + +//procedure TWindow.ConvertFromScreen(pt : TPoint); +//begin +// BWindow_ConvertFromScreen(CPlusObject, pt.CPlusObject); +//end; + +function BWindow.ConvertFromScreen(pt : BPoint) : BPoint; +begin + Result := BWindow_ConvertFromScreen(CPlusObject, pt.CPlusObject); +end; + +//procedure TWindow.ConvertToScreen(rect : TRect); +//begin +// BWindow_ConvertToScreen(CPlusObject, rect.CPlusObject); +//end; + +//function TWindow.ConvertToScreen(rect : TRect) : TRect; +//begin +// Result := BWindow_ConvertToScreen(CPlusObject, rect.CPlusObject); +//end; + +//procedure TWindow.ConvertFromScreen(rect : TRect); +//begin +// BWindow_ConvertFromScreen(CPlusObject, rect.CPlusObject); +//end; + +//function TWindow.ConvertFromScreen(rect : TRect) : TRect; +//begin +// Result := BWindow_ConvertFromScreen(CPlusObject, rect.CPlusObject); +//end; + +procedure BWindow.MoveBy(dx : double; dy : double); +begin + BWindow_MoveBy(CPlusObject, dx, dy); +end; + +procedure BWindow.MoveTo(aPoint : BPoint); +begin + BWindow_MoveTo(CPlusObject, aPoint.CPlusObject); +end; + +procedure BWindow.MoveTo(x : double; y : double); +begin + BWindow_MoveTo(CPlusObject, x, y); +end; + +procedure BWindow.ResizeBy(dx : double; dy : double); +begin + BWindow_ResizeBy(CPlusObject, dx, dy); +end; + +procedure BWindow.ResizeTo(width : double; height : double); +begin + BWindow_ResizeTo(CPlusObject, width, height); +end; + +//procedure TWindow.Show; +//begin +// BWindow_Show(CPlusObject); +//end; + +//procedure TWindow.Hide; +//begin +// BWindow_Hide(CPlusObject); +//end; + +function BWindow.IsHidden : boolean; +begin + Result := BWindow_IsHidden(CPlusObject); +end; + +function BWindow.IsMinimized : boolean; +begin + Result := BWindow_IsMinimized(CPlusObject); +end; + +procedure BWindow.Flush; +begin + BWindow_Flush(CPlusObject); +end; + +procedure BWindow.Sync; +begin + BWindow_Sync(CPlusObject); +end; + +function BWindow.SendBehind(window : BWindow) : Status_t; +begin + Result := BWindow_SendBehind(CPlusObject, window); +end; + +procedure BWindow.DisableUpdates; +begin + BWindow_DisableUpdates(CPlusObject); +end; + +procedure BWindow.EnableUpdates; +begin + BWindow_EnableUpdates(CPlusObject); +end; + +procedure BWindow.BeginViewTransaction; +begin + BWindow_BeginViewTransaction(CPlusObject); +end; + +procedure BWindow.EndViewTransaction; +begin + BWindow_EndViewTransaction(CPlusObject); +end; + +function BWindow.Bounds : BRect; +begin + Result := BWindow_Bounds(CPlusObject); +end; + +function BWindow.GetFrame : BRect; +begin + Result := BWindow_Frame(CPlusObject); +end; + +function BWindow.GetTitle : PChar; +begin + Result := BWindow_Title(CPlusObject); +end; + +procedure BWindow.SetTitle(title : PChar); +begin + BWindow_SetTitle(CPlusObject, title); +end; + +function BWindow.IsFront : boolean; +begin + Result := BWindow_IsFront(CPlusObject); +end; + +function BWindow.IsActive : boolean; +begin + Result := BWindow_IsActive(CPlusObject); +end; + +//procedure TWindow.SetKeyMenuBar(bar : TMenuBar); +//begin +// BWindow_SetKeyMenuBar(CPlusObject, bar.CPlusObject); +//end; + +//function TWindow.KeyMenuBar : TMenuBar; +//begin +// Result := BWindow_KeyMenuBar(CPlusObject); +//end; + +procedure BWindow.SetSizeLimits(min_h : double; max_h : double; min_v : double; max_v : double); +begin + BWindow_SetSizeLimits(CPlusObject, min_h, max_h, min_v, max_v); +end; + +procedure BWindow.GetSizeLimits(min_h : double; max_h : double; min_v : double; max_v : double); +begin + BWindow_GetSizeLimits(CPlusObject, min_h, max_h, min_v, max_v); +end; + +function BWindow.Workspaces : Cardinal; +begin + Result := BWindow_Workspaces(CPlusObject); +end; + +procedure BWindow.SetWorkspaces(aWorkspace : Cardinal); +begin + BWindow_SetWorkspaces(CPlusObject, aWorkspace); +end; + +function BWindow.LastMouseMovedView : BView; +begin + Result := BWindow_LastMouseMovedView(CPlusObject); +end; + +function BWindow.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; aProperty : PChar) : BHandler; +begin + Result := BWindow_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, aProperty); +end; + +function BWindow.GetSupportedSuites(data : BMessage) : Status_t; +begin + Result := BWindow_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function BWindow.AddToSubset(window : BWindow) : Status_t; +begin + Result := BWindow_AddToSubset(CPlusObject, window.CPlusObject); +end; + +function BWindow.RemoveFromSubset(window : BWindow) : Status_t; +begin + Result := BWindow_RemoveFromSubset(CPlusObject, window.CPlusObject); +end; + +function BWindow.Perform(d : Perform_code; arg : Pointer) : Status_t; +begin + Result := BWindow_Perform(CPlusObject, d, arg); +end; + +function BWindow.SetType(aType : Cardinal) : Status_t; +begin + Result := BWindow_SetType(CPlusObject, aType); +end; + +function BWindow.GetType : Cardinal; +begin + Result := BWindow_Type(CPlusObject); +end; + +function BWindow.SetLook(look : PCardinal) : Status_t; +begin + Result := BWindow_SetLook(CPlusObject, look); +end; + +function BWindow.GetLook : PCardinal; +begin + Result := BWindow_Look(CPlusObject); +end; + +function BWindow.SetFeel(feel : Cardinal) : Status_t; +begin + Result := BWindow_SetFeel(CPlusObject, feel); +end; + +function BWindow.GetFeel : Cardinal; +begin + Result := BWindow_Feel(CPlusObject); +end; + +function BWindow.SetFlags(aFlags : Cardinal) : Status_t; +begin + Result := BWindow_SetFlags(CPlusObject, aFlags); +end; + +function BWindow.GetFlags : Cardinal; +begin + Result := BWindow_Flags(CPlusObject); +end; + +function BWindow.IsModal : boolean; +begin + Result := BWindow_IsModal(CPlusObject); +end; + +function BWindow.IsFloating : boolean; +begin + Result := BWindow_IsFloating(CPlusObject); +end; + +function BWindow.SetWindowAlignment(mode : Cardinal; h : integer; hOffset : integer; width : integer; widthOffset : integer; v : integer; vOffset : integer; height : integer; heightOffset : integer) : Status_t; +begin + Result := BWindow_SetWindowAlignment(CPlusObject, mode, h, hOffset, width, widthOffset, v, vOffset, height, heightOffset); +end; + +function BWindow.GetWindowAlignment(mode : PCardinal; var h : integer; var hOffset : integer; var width : integer; var widthOffset : integer; var v : integer; var vOffset : integer; var height : integer; var heightOffset : integer) : Status_t; +begin + Result := BWindow_GetWindowAlignment(CPlusObject, mode, h, hOffset, width, widthOffset, v, vOffset, height, heightOffset); +end; + +function BWindow.Run : Thread_id; +begin + Result := BWindow_Run(CPlusObject); +end; + +//procedure TWindow.BLooper; +//begin +// BWindow_BLooper inherited(CPlusObject); +//end; + +//procedure TWindow._ReservedWindow1; +//begin +// BWindow__ReservedWindow1(CPlusObject); +//end; +// +//procedure TWindow._ReservedWindow2; +//begin +// BWindow__ReservedWindow2(CPlusObject); +//end; +// +//procedure TWindow._ReservedWindow3; +//begin +// BWindow__ReservedWindow3(CPlusObject); +//end; +// +//procedure TWindow._ReservedWindow4; +//begin +// BWindow__ReservedWindow4(CPlusObject); +//end; +// +//procedure TWindow._ReservedWindow5; +//begin +// BWindow__ReservedWindow5(CPlusObject); +//end; +// +//procedure TWindow._ReservedWindow6; +//begin +// BWindow__ReservedWindow6(CPlusObject); +//end; +// +//procedure TWindow._ReservedWindow7; +//begin +// BWindow__ReservedWindow7(CPlusObject); +//end; +// +//procedure TWindow._ReservedWindow8; +//begin +// BWindow__ReservedWindow8(CPlusObject); +//end; +// +//constructor TWindow.Create; +//begin +// CPlusObject := BWindow_Create(Self); +//end; +// +//constructor TWindow.Create( : TWindow); +//begin +// CPlusObject := BWindow_Create(Self, .CPlusObject); +//end; +// +//function TWindow.operator=( : TWindow) : TWindow; +//begin +// Result := BWindow_operator=(CPlusObject, .CPlusObject); +//end; +// +//constructor TWindow.Create(frame : TRect; depth : TColor_Space; bitmapFlags : Cardinal; rowBytes : integer); +//begin +// CPlusObject := BWindow_Create(Self, frame.CPlusObject, depth, bitmapFlags, rowBytes); +//end; +// +//procedure TWindow.InitData(frame : TRect; title : PChar; look : PCadinal; feel : Cardinal; flags : Cardinal; workspace : Cardinal); +//begin +// BWindow_InitData(CPlusObject, frame.CPlusObject, title, look, feel, flags, workspace); +//end; +// +//function TWindow.ArchiveChildren(data : TMessage; deep : boolean) : TStatus_t; +//begin +// Result := BWindow_ArchiveChildren(CPlusObject, data.CPlusObject, deep); +//end; +// +//function TWindow.UnarchiveChildren(data : TMessage) : TStatus_t; +//begin +// Result := BWindow_UnarchiveChildren(CPlusObject, data.CPlusObject); +//end; +// +//procedure TWindow.BitmapClose; +//begin +// BWindow_BitmapClose(CPlusObject); +//end; +// +//procedure TWindow.task_looper; +//begin +// BWindow_task_looper(CPlusObject); +//end; +// +//procedure TWindow.start_drag(msg : TMessage; token : integer; offset : TPoint; track_rect : TRect; reply_to : THandler); +//begin +// BWindow_start_drag(CPlusObject, msg.CPlusObject, token, offset.CPlusObject, track_rect.CPlusObject, reply_to.CPlusObject); +//end; +// +//procedure TWindow.start_drag(msg : TMessage; token : integer; offset : TPoint; bitmap_token : integer; dragMode : TDrawing_Mode; reply_to : THandler); +//begin +// BWindow_start_drag(CPlusObject, msg.CPlusObject, token, offset.CPlusObject, bitmap_token, dragMode, reply_to.CPlusObject); +//end; +// +//procedure TWindow.view_builder(a_view : TView); +//begin +// BWindow_view_builder(CPlusObject, a_view.CPlusObject); +//end; +// +//procedure TWindow.attach_builder(a_view : TView); +//begin +// BWindow_attach_builder(CPlusObject, a_view.CPlusObject); +//end; +// +//procedure TWindow.detach_builder(a_view : TView); +//begin +// BWindow_detach_builder(CPlusObject, a_view.CPlusObject); +//end; +// +//function TWindow.get_server_token : integer; +//begin +// Result := BWindow_get_server_token(CPlusObject); +//end; +// +//function TWindow.extract_drop(an_event : TMessage; target : THandler) : TMessage; +//begin +// Result := BWindow_extract_drop(CPlusObject, an_event.CPlusObject, target.CPlusObject); +//end; +// +//procedure TWindow.movesize(opcode : Cardinal; h : double; v : double); +//begin +// BWindow_movesize(CPlusObject, opcode, h, v); +//end; +// +//function TWindow.ReadMessageFromPort(tout : TBigtime_t) : TMessage; +//begin +// Result := BWindow_ReadMessageFromPort(CPlusObject, tout); +//end; +// +//function TWindow.MessagesWaiting : integer; +//begin +// Result := BWindow_MessagesWaiting(CPlusObject); +//end; +// +//procedure TWindow.handle_activate(an_event : TMessage); +//begin +// BWindow_handle_activate(CPlusObject, an_event.CPlusObject); +//end; +// +//procedure TWindow.do_view_frame(an_event : TMessage); +//begin +// BWindow_do_view_frame(CPlusObject, an_event.CPlusObject); +//end; +// +//procedure TWindow.do_value_change(an_event : TMessage; handler : THandler); +//begin +// BWindow_do_value_change(CPlusObject, an_event.CPlusObject, handler.CPlusObject); +//end; +// +//procedure TWindow.do_mouse_down(an_event : TMessage; target : TView); +//begin +// BWindow_do_mouse_down(CPlusObject, an_event.CPlusObject, target.CPlusObject); +//end; +// +//procedure TWindow.do_mouse_moved(an_event : TMessage; target : TView); +//begin +// BWindow_do_mouse_moved(CPlusObject, an_event.CPlusObject, target.CPlusObject); +//end; +// +//procedure TWindow.do_key_down(an_event : TMessage; handler : THandler); +//begin +// BWindow_do_key_down(CPlusObject, an_event.CPlusObject, handler.CPlusObject); +//end; +// +//procedure TWindow.do_key_up(an_event : TMessage; handler : THandler); +//begin +// BWindow_do_key_up(CPlusObject, an_event.CPlusObject, handler.CPlusObject); +//end; +// +//procedure TWindow.do_menu_event(an_event : TMessage); +//begin +// BWindow_do_menu_event(CPlusObject, an_event.CPlusObject); +//end; +// +//procedure TWindow.do_draw_views; +//begin +// BWindow_do_draw_views(CPlusObject); +//end; +// +//function TWindow.ConvertToMessage(raw : Pointer; code : integer) : TMessage; +//begin +// Result := BWindow_ConvertToMessage(CPlusObject, raw, code); +//end; +// +//function TWindow.allocShortcut(key : Cardinal; modifiers : Cardinal) : TCmd_Key; +//begin +// Result := BWindow_allocShortcut(CPlusObject, key, modifiers); +//end; +// +//function TWindow.FindShortcut(key : Cardinal; modifiers : Cardinal) : TCmd_Key; +//begin +// Result := BWindow_FindShortcut(CPlusObject, key, modifiers); +//end; +// +//procedure TWindow.AddShortcut(key : Cardinal; modifiers : Cardinal; item : TMenuItem); +//begin +// BWindow_AddShortcut(CPlusObject, key, modifiers, item.CPlusObject); +//end; +// +//procedure TWindow.post_message(message : TMessage); +//begin +// BWindow_post_message(CPlusObject, message.CPlusObject); +//end; +// +//procedure TWindow.SetLocalTitle(new_title : PChar); +//begin +// BWindow_SetLocalTitle(CPlusObject, new_title); +//end; +// +//procedure TWindow.enable_pulsing(enable : boolean); +//begin +// BWindow_enable_pulsing(CPlusObject, enable); +//end; +// +//function TWindow.determine_target(msg : TMessage; target : THandler; pref : boolean) : THandler; +//begin +// Result := BWindow_determine_target(CPlusObject, msg.CPlusObject, target.CPlusObject, pref); +//end; +// +//procedure TWindow.kb_navigate; +//begin +// BWindow_kb_navigate(CPlusObject); +//end; +// +//procedure TWindow.navigate_to_next(direction : integer; group : boolean); +//begin +// BWindow_navigate_to_next(CPlusObject, direction, group); +//end; +// +//procedure TWindow.set_focus(focus : TView; notify_input_server : boolean); +//begin +// BWindow_set_focus(CPlusObject, focus.CPlusObject, notify_input_server); +//end; +// +//function TWindow.InUpdate : boolean; +//begin +// Result := BWindow_InUpdate(CPlusObject); +//end; +// +//procedure TWindow.DequeueAll; +//begin +// BWindow_DequeueAll(CPlusObject); +//end; +// +//function TWindow.find_token_and_handler(msg : TMessage; token : ^integer; handler : THandler) : boolean; +//begin +// Result := BWindow_find_token_and_handler(CPlusObject, msg.CPlusObject, token, handler.CPlusObject); +//end; +// +//function TWindow.compose_type(look : PCadinal; feel : Cardinal) : Cardinal; +//begin +// Result := BWindow_compose_type(CPlusObject, look, feel); +//end; +// +//procedure TWindow.decompose_type(type : Cardinal; look : PCardinal; feel : PCardinal); +//begin +// BWindow_decompose_type(CPlusObject, type, look, feel); +//end; +// +//procedure TWindow.SetIsFilePanel(panel : boolean); +//begin +// BWindow_SetIsFilePanel(CPlusObject, panel); +//end; +// +//function TWindow.IsFilePanel : boolean; +//begin +// Result := BWindow_IsFilePanel(CPlusObject); +//end; +// +//procedure TWindow.AddFloater(a_floating_window : TWindow); +//begin +// BWindow_AddFloater(CPlusObject, a_floating_window.CPlusObject); +//end; +// +//procedure TWindow.RemoveFloater(a_floating_window : TWindow); +//begin +// BWindow_RemoveFloater(CPlusObject, a_floating_window.CPlusObject); +//end; +// +//function TWindow.WindowType : Cardinal; +//begin +// Result := BWindow_WindowType(CPlusObject); +//end; +// +//procedure TWindow.char *fTitle; +//begin +// BWindow_char *fTitle(CPlusObject); +//end; +// +//procedure TWindow.int32 server_token; +//begin +// BWindow_int32 server_token(CPlusObject); +//end; +// +//procedure TWindow.char fInUpdate; +//begin +// BWindow_char fInUpdate(CPlusObject); +//end; +// +//procedure TWindow.char f_active; +//begin +// BWindow_char f_active(CPlusObject); +//end; +// +//procedure TWindow.short fShowLevel; +//begin +// BWindow_short fShowLevel(CPlusObject); +//end; +// +//procedure TWindow.uint32 fFlags; +//begin +// BWindow_uint32 fFlags(CPlusObject); +//end; +// +//procedure TWindow.port_id send_port; +//begin +// BWindow_port_id send_port(CPlusObject); +//end; +// +//procedure TWindow.port_id receive_port; +//begin +// BWindow_port_id receive_port(CPlusObject); +//end; +// +//procedure TWindow.BView *top_view; +//begin +// BWindow_BView *top_view(CPlusObject); +//end; +// +//procedure TWindow.BView *fFocus; +//begin +// BWindow_BView *fFocus(CPlusObject); +//end; +// +//procedure TWindow.BView *fLastMouseMovedView; +//begin +// BWindow_BView *fLastMouseMovedView(CPlusObject); +//end; +// +//procedure TWindow._BSession_ *a_session; +//begin +// BWindow__BSession_ *a_session(CPlusObject); +//end; +// +//procedure TWindow.BMenuBar *fKeyMenuBar; +//begin +// BWindow_BMenuBar *fKeyMenuBar(CPlusObject); +//end; +// +//procedure TWindow.BButton *fDefaultButton; +//begin +// BWindow_BButton *fDefaultButton(CPlusObject); +//end; +// +//procedure TWindow.BList accelList; +//begin +// BWindow_BList accelList(CPlusObject); +//end; +// +//procedure TWindow.int32 top_view_token; +//begin +// BWindow_int32 top_view_token(CPlusObject); +//end; +// +//procedure TWindow.bool pulse_enabled; +//begin +// BWindow_bool pulse_enabled(CPlusObject); +//end; +// +//procedure TWindow.bool fViewsNeedPulse; +//begin +// BWindow_bool fViewsNeedPulse(CPlusObject); +//end; +// +//procedure TWindow.bool fIsFilePanel; +//begin +// BWindow_bool fIsFilePanel(CPlusObject); +//end; +// +//procedure TWindow.bool fUnused1; +//begin +// BWindow_bool fUnused1(CPlusObject); +//end; +// +//procedure TWindow.bigtime_t pulse_rate; +//begin +// BWindow_bigtime_t pulse_rate(CPlusObject); +//end; +// +//procedure TWindow.bool fWaitingForMenu; +//begin +// BWindow_bool fWaitingForMenu(CPlusObject); +//end; +// +//procedure TWindow.bool fOffscreen; +//begin +// BWindow_bool fOffscreen(CPlusObject); +//end; +// +//procedure TWindow.sem_id fMenuSem; +//begin +// BWindow_sem_id fMenuSem(CPlusObject); +//end; +// +//procedure TWindow.float fMaxZoomH; +//begin +// BWindow_float fMaxZoomH(CPlusObject); +//end; +// +//procedure TWindow.float fMaxZoomV; +//begin +// BWindow_float fMaxZoomV(CPlusObject); +//end; +// +//procedure TWindow.float fMinWindH; +//begin +// BWindow_float fMinWindH(CPlusObject); +//end; +// +//procedure TWindow.float fMinWindV; +//begin +// BWindow_float fMinWindV(CPlusObject); +//end; +// +//procedure TWindow.float fMaxWindH; +//begin +// BWindow_float fMaxWindH(CPlusObject); +//end; +// +//procedure TWindow.float fMaxWindV; +//begin +// BWindow_float fMaxWindV(CPlusObject); +//end; +// +//procedure TWindow.BRect fFrame; +//begin +// BWindow_BRect fFrame(CPlusObject); +//end; +// +//procedure TWindow.window_look fLook; +//begin +// BWindow_window_look fLook(CPlusObject); +//end; +// +//procedure TWindow._view_attr_ *fCurDrawViewState; +//begin +// BWindow__view_attr_ *fCurDrawViewState(CPlusObject); +//end; +// +//procedure TWindow.window_feel fFeel; +//begin +// BWindow_window_feel fFeel(CPlusObject); +//end; +// +//procedure TWindow.int32 fLastViewToken; +//begin +// BWindow_int32 fLastViewToken(CPlusObject); +//end; +// +//procedure TWindow._CEventPort_ *fEventPort; +//begin +// BWindow__CEventPort_ *fEventPort(CPlusObject); +//end; +// +//procedure TWindow.BMessageRunner *fPulseRunner; +//begin +// BWindow_BMessageRunner *fPulseRunner(CPlusObject); +//end; +// +//procedure TWindow.BRect fCurrentFrame; +//begin +// BWindow_BRect fCurrentFrame(CPlusObject); +//end; +// +//{procedure TWindow.uint32 _reserved[2]; +//begin +// BWindow_uint32 _reserved[2](CPlusObject); +//end; +// +//procedure TWindow.uint32 _more_reserved[4]; +//begin +// BWindow_uint32 _more_reserved[4](CPlusObject); +//end;} + + +initialization + +end. diff --git a/bepascal/source/bepascal/pas/src/be/kernel/os.pp b/bepascal/source/bepascal/pas/src/be/kernel/os.pp new file mode 100644 index 0000000..f0f87aa --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/kernel/os.pp @@ -0,0 +1,92 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit os; + +interface + +uses + SupportDefs; + +const + B_LOW_LATENCY = 5; + B_LOW_PRIORITY = 5; + B_NORMAL_PRIORITY = 10; + B_DISPLAY_PRIORITY = 15; + B_URGENT_DISPLAY_PRIORITY = 20; + B_REAL_TIME_DISPLAY_PRIORITY = 100; + B_URGENT_PRIORITY = 110; + B_REAL_TIME_PRIORITY = 120; + +const + B_OS_NAME_LENGTH = 32; + B_PAGE_SIZE = 4096; + B_INFINITE_TIMEOUT = 9223372036854775807; + +type + Area_id = Longint; + Port_id = Longint; + Sem_id = Longint; + Thread_id = Longint; + Team_id = Longint; + +const + B_NO_LOCK = 0; + B_LAZY_LOCK = 1; + B_FULL_LOCK = 2; + B_CONTIGUOUS = 3; + B_LOMEM = 4; + + B_ANY_ADDRESS = 0; + B_EXACT_ADDRESS = 1; + B_BASE_ADDRESS = 2; + B_CLONE_ADDRESS = 3; + B_ANY_KERNEL_ADDRESS = 4; + + B_READ_AREA = 1; + B_WRITE_AREA = 2; + +// area +type + Area_Info = record + area : Area_id; + name : array [0..B_OS_NAME_LENGTH] of char; + size : Size_t; + lock : Cardinal; + protection : Cardinal; + team : Team_id; + ram_size : Cardinal; + copy_count : Cardinal; + in_count : Cardinal; + out_count : Cardinal; + address : Pointer; + end; + +// Semaphores +type + Sem_Info = record + sem : Sem_id; + team : Team_id; + name : array [0..B_OS_NAME_LENGTH] of char; + count : integer; + latest_holder : Thread_id; + end; + +implementation + +end. diff --git a/bepascal/source/bepascal/pas/src/be/mail/email.pp b/bepascal/source/bepascal/pas/src/be/mail/email.pp new file mode 100644 index 0000000..ce4d034 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/mail/email.pp @@ -0,0 +1,125 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit Email; + +interface + +uses + beobj, SupportDefs, os,utf8; + +// null because begin at 1 form e-mail.h +type mail_flags =(B_Mail_null,B_MAIL_PENDING,B_MAIL_SENT,B_MAIL_SAVE); + +Const + B_MAIL_ATTR_NAME='MAIL:name'; + B_MAIL_ATTR_STATUS='MAIL:status'; + B_MAIL_ATTR_PRIORITY='MAIL:priority'; + B_MAIL_ATTR_TO='MAIL:to'; + B_MAIL_ATTR_CC='MAIL:cc'; + B_MAIL_ATTR_FROM='MAIL:from'; + B_MAIL_ATTR_SUBJECT='MAIL:subject'; + B_MAIL_ATTR_REPLY='MAIL:reply'; + B_MAIL_ATTR_WHEN='MAIL:when'; + B_MAIL_ATTR_FLAGS='MAIL:flags'; + B_MAIL_ATTR_RECIPIENTS='MAIL:recipients'; + B_MAIL_ATTR_MIME='MAIL:mime'; + B_MAIL_ATTR_HEADER='MAIL:header_length'; + B_MAIL_ATTR_CONTENT='MAIL:content_length'; + + +type BEMail = class(TbeObject) + private + public + constructor Create; override; + destructor Destroy; override; + + function Add_Content(text : PChar;length: cardinal;encoding : TCharSet; clobber : boolean) : Status_t; + function Add_Content(text : PChar;length: cardinal;encoding : Pchar; clobber : boolean) : Status_t; + function AddEnclosure( path : Pchar; clobber:boolean) : Status_t; + function AddEnclosure(MIME_type : Pchar;data : pointer;len : cardinal; clobber:boolean) : Status_t; + function AddHeaderField( encoding: TCharSet; field_name : Pchar; str : PChar;clobber:boolean) : Status_t; + function AddHeaderField( field_name : Pchar; str : PChar;clobber:boolean) : Status_t; + function Send( send_now : boolean; remove_when_I_have_completed_sending_this_message_to_your_preferred_SMTP_server : boolean) : Status_t; +end; + +function BMailMessage_Create() : TCPlusObject;cdecl; external BePascalLibName name 'BMailMessage_Create'; +procedure BMail_Free(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BMail_Free'; +function BMailMessage_AddContent(AObject : TCPlusObject;text : PChar;length: cardinal;encoding : cardinal; clobber : boolean) : Status_t;cdecl; external BePascalLibName name 'BMailMessage_AddContent'; +function BMailMessage_AddContent_1(AObject : TCPlusObject;text : PChar;length: cardinal;encoding : Pchar; clobber : boolean) : Status_t;cdecl; external BePascalLibName name 'BMailMessage_AddContent_1'; +//function BMailMessage_AddEnclosure(AObject : TCPlusObject; entry_ref *ref, bool clobber) : Status_t;cdecl; external BePascalLibName name 'BMailMessage_AddEnclosure'; +function BMailMessage_AddEnclosure_1(AObject : TCPlusObject; path : Pchar; clobber:boolean) : Status_t;cdecl; external BePascalLibName name 'BMailMessage_AddEnclosure_1'; +function BMailMessage_AddEnclosure_2(AObject : TCPlusObject; MIME_type : Pchar;data : pointer;len : cardinal; clobber:boolean) : Status_t;cdecl; external BePascalLibName name 'BMailMessage_AddEnclosure_2'; +function BMailMessage_AddHeaderField(AObject : TCPlusObject; encoding: cardinal; field_name : Pchar; str : PChar;clobber:boolean) : Status_t;cdecl; external BePascalLibName name 'BMailMessage_AddHeaderField'; +function BMailMessage_AddHeaderField_1(AObject : TCPlusObject; field_name : Pchar; str : PChar;clobber:boolean) : Status_t;cdecl; external BePascalLibName name 'BMailMessage_AddHeaderField_1'; +function BMailMessage_Send(AObject : TCPlusObject; send_now : boolean; remove_when_I_have_completed_sending_this_message_to_your_preferred_SMTP_server : boolean) : Status_t;cdecl; external BePascalLibName name 'BMailMessage_Send'; + + +implementation + +constructor BEMail.Create; +begin + inherited; + CPlusObject := BMailMessage_Create(); +end; + +destructor BEMail.Destroy; +begin + if CPlusObject <> nil then + BMail_Free(CPlusObject); + inherited; +end; + +function BEMail.Add_Content(text : PChar;length: cardinal;encoding : TCharSet; clobber : boolean) : Status_t; +begin + result:=BMailMessage_AddContent(CPlusObject,text,length,cardinal(encoding),clobber ); +end; + +function BEMail.Add_Content(text : PChar;length: cardinal;encoding : Pchar; clobber : boolean) : Status_t; +begin + result:=BMailMessage_AddContent_1(CPlusObject,text,length,encoding,clobber ); +end; + +function BEMail.AddEnclosure( path : Pchar; clobber:boolean) : Status_t; +begin + result:=BMailMessage_AddEnclosure_1(CPlusObject,path,clobber); +end; + +function BEMail.AddEnclosure(MIME_type : Pchar;data : pointer;len : cardinal; clobber:boolean) : Status_t; +begin + result:=BMailMessage_AddEnclosure_2(CPlusObject,MIME_type,data,len,clobber); +end; + +function BEMail.AddHeaderField( encoding: TCharSet; field_name : Pchar; str : PChar;clobber:boolean) : Status_t; +begin + result:=BMailMessage_AddHeaderField(CPlusObject, cardinal(encoding), field_name , str,clobber); +end; + +function BEMail.AddHeaderField( field_name : Pchar; str : PChar;clobber:boolean) : Status_t; +begin + result:=BMailMessage_AddHeaderField_1(CPlusObject, field_name, str,clobber) ; +end; + +function BEMail.Send( send_now : boolean; remove_when_I_have_completed_sending_this_message_to_your_preferred_SMTP_server : boolean) : Status_t; +begin + result:=BMailMessage_Send(CPlusObject, send_now, remove_when_I_have_completed_sending_this_message_to_your_preferred_SMTP_server ); +end; + + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/storage/entry.pp b/bepascal/source/bepascal/pas/src/be/storage/entry.pp new file mode 100644 index 0000000..7d00862 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/storage/entry.pp @@ -0,0 +1,35 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit Entry; + +interface + +uses + beobj, StorageDefs; + +type + EntryRef = record + device : dev_t; + directory : ino_t; + name : PChar; + end; + +implementation + +end. diff --git a/bepascal/source/bepascal/pas/src/be/storage/filepanel.pp b/bepascal/source/bepascal/pas/src/be/storage/filepanel.pp new file mode 100644 index 0000000..ba9b94f --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/storage/filepanel.pp @@ -0,0 +1,281 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit filepanel; + +interface + +uses + beobj,classes,os,Entry,StorageDefs,message,messenger,window,supportdefs; + +type + BRefFilter = class + private + public + procedure Filter; + end; + +type + file_panel_mode =( + B_OPEN_PANEL, + B_SAVE_PANEL +); + +type + file_panel_button =( + B_CANCEL_BUTTON, + B_DEFAULT_BUTTON +); + +type + BFilePanel = class(TBeObject) + private + public + constructor Create( mode :file_panel_mode; + target : BMessenger; + const start_directory : entryref; + node_flavors : integer; + allow_multiple_selection : boolean; + message : BMessage ; + filter : BRefFilter; + modal , + hide_when_done : boolean); + destructor Destroy; override; + procedure Show; + procedure Hide; + function IsShowing : boolean; + procedure WasHidden; + procedure SelectionChanged; + procedure SendMessage( Messager: BMessenger ; Message : BMessage); + function Window : BWindow; + function Messenger : BMessenger; + function RefFilter : BRefFilter; + procedure GetPanelDirectory( entry: EntryRef); + function PanelMode : file_panel_mode; + procedure SetTarget( Mess: BMessenger); + procedure SetMessage(msg : BMessage); + procedure SetRefFilter(filter : BRefFilter); + procedure SetSaveText(text : PChar); + procedure SetButtonLabel( button: file_panel_button; alabel : PChar); +{ procedure SetPanelDirectory(new_directory : ); + procedure SetPanelDirectory(new_directory : ); +} + procedure SetPanelDirectory(new_directory : EntryRef); + procedure SetPanelDirectory(new_directory : PChar); + + procedure SetHideWhenDone( ahide: boolean); + function HidesWhenDone : boolean; + procedure Refresh; + procedure Rewind; + function GetNextSelectedRef(var ref : EntryRef) : Status_t; + end; + +procedure BRefFilter_Filter(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRefFilter_Filter'; +function BFilePanel_Create(AObject : TBeObject; + mode :file_panel_mode; + target : BMessenger; + const start_directory : entryref; + node_flavors : integer; + allow_multiple_selection : boolean; + message : BMessage ; + filter : BRefFilter; + modal , + hide_when_done : boolean) : TCPlusObject; cdecl; external BePascalLibName name 'BFilePanel_Create'; + +procedure BFilePanel_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_Free'; +procedure BFilePanel_Show(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_Show'; +procedure BFilePanel_Hide(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_Hide'; +function BFilePanel_IsShowing(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BFilePanel_IsShowing'; +procedure BFilePanel_WasHidden(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_WasHidden'; +procedure BFilePanel_SelectionChanged(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_SelectionChanged'; +procedure BFilePanel_SendMessage(AObject : TCPlusObject; mess :TCPlusObject ; message : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_SendMessage'; +function BFilePanel_Window(AObject : TCPlusObject) : BWindow; cdecl; external BePascalLibName name 'BFilePanel_Window'; +//function BFilePanel_Messenger(AObject : TCPlusObject) : BMessenger; cdecl; external BePascalLibName name 'BFilePanel_Messenger'; +function BFilePanel_RefFilter(AObject : TCPlusObject) : BRefFilter; cdecl; external BePascalLibName name 'BFilePanel_RefFilter'; +procedure BFilePanel_GetPanelDirectory(AObject : TCPlusObject; entry: EntryRef); cdecl; external BePascalLibName name 'BFilePanel_GetPanelDirectory'; +function BFilePanel_PanelMode(AObject : TCPlusObject) : BRefFilter; cdecl; external BePascalLibName name 'BFilePanel_PanelMode'; +//procedure BFilePanel_SetTarget(AObject : TCPlusObject; Mess : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_SetTarget'; +procedure BFilePanel_SetMessage(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_SetMessage'; +procedure BFilePanel_SetRefFilter(AObject : TCPlusObject; filter : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_SetRefFilter'; +procedure BFilePanel_SetSaveText(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BFilePanel_SetSaveText'; +procedure BFilePanel_SetButtonLabel(AObject : TCPlusObject; button: file_panel_button; alabel : PChar); cdecl; external BePascalLibName name 'BFilePanel_SetButtonLabel'; +{procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : ); cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory'; +procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : ); cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory'; +}procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : EntryRef); cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory'; +procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : PChar); cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory'; +procedure BFilePanel_SetHideWhenDone(AObject : TCPlusObject; hiden: boolean); cdecl; external BePascalLibName name 'BFilePanel_SetHideWhenDone'; +function BFilePanel_HidesWhenDone(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BFilePanel_HidesWhenDone'; +procedure BFilePanel_Refresh(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_Refresh'; +procedure BFilePanel_Rewind(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_Rewind'; +function BFilePanel_GetNextSelectedRef(AObject : TCPlusObject; var entry : EntryRef) : Status_t; cdecl; external BePascalLibName name 'BFilePanel_GetNextSelectedRef'; + +implementation + +procedure BRefFilter.Filter; +begin +// BRefFilter_Filter(CPlusObject); +end; + +constructor BFilePanel.Create( mode :file_panel_mode; + target : BMessenger; + const start_directory : entryref; + node_flavors : integer; + allow_multiple_selection : boolean; + message : BMessage ; + filter : BRefFilter; + modal : boolean; + hide_when_done : boolean); +begin + CreatePas; + CPlusObject := BFilePanel_Create(Self,mode,target,start_directory,node_flavors,allow_multiple_selection,message,filter,modal,hide_when_done); +end; + +destructor BFilePanel.Destroy; +begin + BFilePanel_Free(CPlusObject); + inherited; +end; + +procedure BFilePanel.Show; +begin + BFilePanel_Show(CPlusObject); +end; + +procedure BFilePanel.Hide; +begin + BFilePanel_Hide(CPlusObject); +end; + +function BFilePanel.IsShowing : boolean; +begin + Result := BFilePanel_IsShowing(CPlusObject); +end; + +procedure BFilePanel.WasHidden; +begin + BFilePanel_WasHidden(CPlusObject); +end; + +procedure BFilePanel.SelectionChanged; +begin + BFilePanel_SelectionChanged(CPlusObject); +end; + +procedure BFilePanel.SendMessage( Messager: BMessenger ; Message : BMessage); +begin + BFilePanel_SendMessage(CPlusObject,Messager , Message.CPlusObject); +end; + +function BFilePanel.Window : BWindow; +begin + Result := BFilePanel_Window(CPlusObject); +end; + +function BFilePanel.Messenger : BMessenger; +begin +// Result := BFilePanel_Messenger(CPlusObject); +end; + +function BFilePanel.RefFilter : BRefFilter; +begin + Result := BFilePanel_RefFilter(CPlusObject); +end; + +procedure BFilePanel.GetPanelDirectory(entry : EntryRef); +begin + BFilePanel_GetPanelDirectory(CPlusObject, entry); +end; + +function BFilePanel.PanelMode :file_panel_mode ; +begin +// Result := BFilePanel_PanelMode(CPlusObject); +end; + +procedure BFilePanel.SetTarget(Mess : BMessenger); +begin +// BFilePanel_SetTarget(CPlusObject, Mess.CPlusObject); +end; + +procedure BFilePanel.SetMessage(msg : BMessage); +begin + BFilePanel_SetMessage(CPlusObject, msg.CPlusObject); +end; + +procedure BFilePanel.SetRefFilter(filter : BRefFilter); +begin +// BFilePanel_SetRefFilter(CPlusObject, filter.CPlusObject); +end; + +procedure BFilePanel.SetSaveText(text : PChar); +begin + BFilePanel_SetSaveText(CPlusObject, text); +end; + +procedure BFilePanel.SetButtonLabel( button: file_panel_button; alabel : PChar); +begin + BFilePanel_SetButtonLabel(CPlusObject,button , alabel); +end; + +{procedure BFilePanel.SetPanelDirectory(new_directory : ); +begin + BFilePanel_SetPanelDirectory(CPlusObject, new_directory); +end; + +procedure BFilePanel.SetPanelDirectory(new_directory : ); +begin + BFilePanel_SetPanelDirectory(CPlusObject, new_directory); +end; +} +procedure BFilePanel.SetPanelDirectory(new_directory :EntryRef); +begin + BFilePanel_SetPanelDirectory(CPlusObject, new_directory); +end; + +procedure BFilePanel.SetPanelDirectory(new_directory : PChar); +begin + BFilePanel_SetPanelDirectory(CPlusObject, new_directory); +end; + +procedure BFilePanel.SetHideWhenDone( ahide: boolean); +begin + BFilePanel_SetHideWhenDone(CPlusObject, ahide); +end; + +function BFilePanel.HidesWhenDone : boolean; +begin + Result := BFilePanel_HidesWhenDone(CPlusObject); +end; + +procedure BFilePanel.Refresh; +begin + BFilePanel_Refresh(CPlusObject); +end; + +procedure BFilePanel.Rewind; +begin + BFilePanel_Rewind(CPlusObject); +end; + +function BFilePanel.GetNextSelectedRef(var ref: EntryRef) : Status_t; +begin + Result := BFilePanel_GetNextSelectedRef(CPlusObject, ref); +end; + + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/storage/path.pp b/bepascal/source/bepascal/pas/src/be/storage/path.pp new file mode 100644 index 0000000..20ffb50 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/storage/path.pp @@ -0,0 +1,163 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit path; + +interface + +uses + beobj,classes,entry,storagedefs,SupportDefs; + +type + BPath = class(TBeObject) + private + public + constructor Create; + constructor Create(dir : PChar; aleaf : PChar; normalize : boolean); +// constructor Create(dir : BDirectory; leaf : PChar; normalize : boolean); + constructor Create(apath : BPath); + constructor Create(entry : BEntry); + constructor Create_1(ref : EntryRef); + destructor Destroy; override; + function InitCheck : Status_t; + function SetTo(apath : PChar; aleaf : PChar; normalize : boolean) : Status_t; +// function SetTo(dir : BDirectory; path : PChar; normalize : boolean) : Status_t; + function SetTo(entry : BEntry) : Status_t; + function SetTo_1(ref : PEntryRef) : Status_t; + function Append(apath : PChar; normalize : boolean) : Status_t; + procedure Unset; + function Path : PChar; + function Leaf : PChar; + function GetParent(aPath: BPath) : Status_t; + end; + +function BPath_Create(AObject : TBeObject):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create'; +function BPath_Create(AObject : TBeObject; dir : PChar; leaf : PChar; normalize : boolean):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create'; +//function BPath_Create(AObject : TBeObject; dir : BDirectory; leaf : PChar; normalize : boolean):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create'; +function BPath_Create(AObject : TBeObject; path : BPath):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create'; +function BPath_Create(AObject : TBeObject; entry : BEntry):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create'; +function BPath_Create(AObject : TBeObject; ref : EntryRef):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create'; +procedure BPath_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPath_Free'; +function BPath_InitCheck(AObject : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BPath_InitCheck'; +function BPath_SetTo(AObject : TCPlusObject; path : PChar; leaf : PChar; normalize : boolean) : Status_t; cdecl; external BePascalLibName name 'BPath_SetTo'; +//function BPath_SetTo(AObject : TCPlusObject; dir : BDirectory; path : PChar; normalize : boolean) : Status_t; cdecl; external BePascalLibName name 'BPath_SetTo'; +function BPath_SetTo(AObject : TCPlusObject; entry : BEntry) : Status_t; cdecl; external BePascalLibName name 'BPath_SetTo'; +function BPath_SetTo_3(AObject : TCPlusObject; ref : PEntryRef) : Status_t; cdecl; external BePascalLibName name 'BPath_SetTo_3'; +function BPath_Append(AObject : TCPlusObject; path : PChar; normalize : boolean) : Status_t; cdecl; external BePascalLibName name 'BPath_Append'; +procedure BPath_Unset(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPath_Unset'; +function BPath_Path(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BPath_Path'; +function BPath_Leaf(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BPath_Leaf'; +function BPath_GetParent(AObject : TCPlusObject; aPath : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BPath_GetParent'; + +implementation + +constructor BPath.Create; +begin + CreatePas; + CPlusObject := BPath_Create(Self); +end; + +constructor BPath.Create(dir : PChar; aleaf : PChar; normalize : boolean); +begin + CreatePas; + CPlusObject := BPath_Create(Self, dir, aleaf, normalize); +end; + +{constructor BPath.Create(dir : BDirectory; aleaf : PChar; normalize : boolean); +begin + CreatePas; + CPlusObject := BPath_Create(Self, dir, aleaf, normalize); +end; +} +constructor BPath.Create(apath : BPath); +begin + CreatePas; + CPlusObject := BPath_Create(Self, apath); +end; + +constructor BPath.Create(entry : BEntry); +begin + CreatePas; + CPlusObject := BPath_Create(Self, entry); +end; + +constructor BPath.Create_1(ref : EntryRef); +begin + CreatePas; + CPlusObject := BPath_Create(Self, ref); +end; + +destructor BPath.Destroy; +begin + BPath_Free(CPlusObject); + inherited; +end; + +function BPath.InitCheck : Status_t; +begin + Result := BPath_InitCheck(CPlusObject); +end; + +function BPath.SetTo(apath : PChar; aleaf : PChar; normalize : boolean) : Status_t; +begin + Result := BPath_SetTo(CPlusObject, apath, aleaf, normalize); +end; + +{function BPath.SetTo(dir : BDirectory; path : PChar; normalize : boolean) : Status_t; +begin + Result := BPath_SetTo(CPlusObject, dir, path, normalize); +end; +} +function BPath.SetTo(entry : BEntry) : Status_t; +begin + Result := BPath_SetTo(CPlusObject, entry); +end; + +function BPath.SetTo_1(ref : PEntryRef) : Status_t; +begin + Result := BPath_SetTo_3(CPlusObject, ref); +end; + +function BPath.Append(apath : PChar; normalize : boolean) : Status_t; +begin + Result := BPath_Append(CPlusObject,apath, normalize); +end; + +procedure BPath.Unset; +begin + BPath_Unset(CPlusObject); +end; + +function BPath.Path : PChar; +begin + Result := BPath_Path(CPlusObject); +end; + +function BPath.Leaf : PChar; +begin + Result := BPath_Leaf(CPlusObject); +end; + +function BPath.GetParent( aPath: BPath) : Status_t; +begin + Result := BPath_GetParent(CPlusObject, aPath.CPlusObject); +end; + + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/storage/storagedefs.pp b/bepascal/source/bepascal/pas/src/be/storage/storagedefs.pp new file mode 100644 index 0000000..c96d4ad --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/storage/storagedefs.pp @@ -0,0 +1,52 @@ +unit StorageDefs; + +interface + +const + // from sys/param.h + NAME_MAX = 256; + // from limits.h + PATH_MAX = 1024; + MAXPATHLEN = PATH_MAX; + B_FILE_NAME_LENGTH = NAME_MAX; + B_PATH_NAME_LENGTH = MAXPATHLEN; + B_ATTR_NAME_LENGTH = B_FILE_NAME_LENGTH - 1; + B_MIME_TYPE_LENGTH = B_ATTR_NAME_LENGTH - 15; +// B_MAX_SYMLINKS = SYMLINK_MAX; + + // from fcntl.h + O_RDONLY = 0; + O_WRONLY = 1; + O_RDWR = 2; + O_RWMASK = 3; + + O_EXCL = $0100; + O_CREAT = $0200; + O_TRUNC = $0400; + O_APPEND = $0800; + + // from StorageDefs.h + B_READ_ONLY = O_RDONLY; + B_WRITE_ONLY = O_WRONLY; + B_READ_WRITE = O_RDWR; + + B_FAIL_IF_EXISTS = O_EXCL; + B_CREATE_FILE = O_CREAT; + B_ERASE_FILE = O_TRUNC; + B_OPEN_AT_END = O_APPEND; + + // Node flavor + B_FILE_NODE = $01; + B_SYMLINK_NODE = $02; + B_DIRECTORY_NODE = $04; + B_ANY_NODE = $07; + +type + // from types.h + dev_t = integer; + ino_t = int64; + + +implementation + +end. diff --git a/bepascal/source/bepascal/pas/src/be/storage/volume.pp b/bepascal/source/bepascal/pas/src/be/storage/volume.pp new file mode 100644 index 0000000..997b049 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/storage/volume.pp @@ -0,0 +1,169 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit Volume; + +interface + +uses + beobj, SupportDefs, os; + +type + BVolume = class(TBeObject) + public + constructor Create; override; + destructor Destroy; override; + + function InitCheck : Status_t; + function SetTo(dev : Dev_t) : Status_t; + procedure Unset; + function Device : Dev_t; + function Capacity : Off_t; + function FreeBytes : Off_t; + function GetName( name : pchar ):Status_t; + function SetName( name : pchar ):Status_t; + function IsRemovable : boolean; + function IsReadOnly : boolean; + function IsPersistent : boolean; + function IsShared : boolean; + function KnowsMime : boolean; + function KnowsAttr : boolean; + function KnowsQuery : boolean; + + end; + + +function BVolume_Create: TCPlusObject;cdecl; external BePascalLibName name 'BVolume_Create'; +function BVolume_Create_1(dev :Dev_t ): TCPlusObject;cdecl; external BePascalLibName name 'BVolume_Create_1'; +function BVolume_Create_2(vol : TCPlusObject ): TCPlusObject;cdecl; external BePascalLibName name 'BVolume_Create_2'; +procedure BVolume_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BVolume_BVolume'; + +function BVolume_InitCheck(AObject : TCPlusObject) : Status_t;cdecl; external BePascalLibName name 'BVolume_InitCheck'; +function BVolume_SetTo(AObject : TCPlusObject; dev :Dev_t ): Status_t;cdecl; external BePascalLibName name 'BVolume_SetTo'; +procedure BVolume_Unset(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolume_Unset'; +function BVolume_Device(AObject : TCPlusObject) : Dev_t;cdecl; external BePascalLibName name 'BVolume_Device'; +//status_t BVolume_GetRootDirectory(BVolume *Volume, BDirectory *dir) +function BVolume_Capacity(AObject : TCPlusObject) : Off_t;cdecl; external BePascalLibName name 'BVolume_Capacity'; +function BVolume_FreeBytes(AObject : TCPlusObject) : Off_t;cdecl; external BePascalLibName name 'BVolume_FreeBytes'; +function BVolume_GetName(AObject : TCPlusObject; name : pchar ): Status_t;cdecl; external BePascalLibName name 'BVolume_GetName'; +function BVolume_SetName(AObject : TCPlusObject; name : pchar ): Status_t;cdecl; external BePascalLibName name 'BVolume_SetName'; +//status_t BVolume_GetIcon(BVolume *Volume, BBitmap *icon, icon_size which) +function BVolume_IsRemovable(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_IsRemovable'; + +function BVolume_IsReadOnly(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_IsReadOnly'; +function BVolume_IsPersistent(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_IsPersistent'; +function BVolume_IsShared(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_IsShared'; +function BVolume_KnowsMime(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_KnowsMime'; +function BVolume_KnowsAttr(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_KnowsAttr'; +function BVolume_KnowsQuery(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_KnowsQuery'; + + + + +implementation + +constructor BVolume.Create; +begin + inherited; + CPlusObject:=BVolume_Create; +end; + + +destructor BVolume.Destroy; +begin + if CPlusObject <> nil then BVolume_Free(CPlusObject); + inherited; +end; + +function BVolume.InitCheck: Status_t; +begin + result:=BVolume_InitCheck(CPlusObject); +end; + +function BVolume.SetTo(dev : Dev_t) : Status_t; +begin + result:=BVolume_SetTo(CPlusObject,dev); +end; + +procedure BVolume.Unset; +begin + BVolume_Unset(CPlusObject); +end; + +function BVolume.Device : Dev_t; +begin + result:=BVolume_Device(CPlusObject); +end; + +function BVolume.Capacity : Off_t; +begin + result:=BVolume_Capacity(CPlusObject); +end; + +function BVolume.FreeBytes : Off_t; +begin + result:=BVolume_FreeBytes(CPlusObject); +end; + +function BVolume.GetName( name : pchar ):Status_t; +begin + result:=BVolume_GetName(CPlusObject,name); +end; + +function BVolume.SetName( name : pchar ):Status_t; +begin + result:=BVolume_SetName(CPlusObject,name); +end; + +function BVolume.IsRemovable : boolean; +begin + result:=BVolume_IsRemovable(CPlusObject); +end; + +function BVolume.IsReadOnly : boolean; +begin + result:=BVolume_IsReadOnly(CPlusObject); +end; + +function BVolume.IsPersistent : boolean; +begin + result:=BVolume_IsPersistent(CPlusObject); +end; + +function BVolume.IsShared : boolean; +begin + result:=BVolume_IsShared(CPlusObject); +end; + +function BVolume.KnowsMime : boolean; +begin + result:=BVolume_KnowsMime(CPlusObject); +end; + +function BVolume.KnowsAttr : boolean; +begin + result:=BVolume_KnowsAttr(CPlusObject); +end; + +function BVolume.KnowsQuery : boolean; +begin + result:=BVolume_KnowsQuery(CPlusObject); +end; + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/storage/volumeroster.pp b/bepascal/source/bepascal/pas/src/be/storage/volumeroster.pp new file mode 100644 index 0000000..15c3cda --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/storage/volumeroster.pp @@ -0,0 +1,95 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit volumeroster; + +interface + +uses + beobj, SupportDefs, os , Volume; + +type + BVolumeRoster = class(TBeObject) + private + public + constructor Create; override; + destructor Destroy; override; + + function GetNextVolume(val : TVolume): Status_t; + procedure Rewind; + function GetBootVolume( vol: TVolume ):Status_t; + //function StartWatching( msngr : TMessenger): Status_t; + procedure StopWatching; + end; + + +function BVolumeRoster_Create(AObject : TBeObject): TCPlusObject;cdecl; external BePascalLibName name 'BVolumeRoster_Create'; +procedure BVolumeRoster_Free(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolumeRoster_Free'; + +function BVolumeRoster_GetNextVolume(AObject : TCPlusObject;vol : TCPlusObject): Status_t;cdecl; external BePascalLibName name 'BVolumeRoster_GetNextVolume'; +procedure BVolumeRoster_Rewind(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolumeRoster_Rewind'; +function BVolumeRoster_GetBootVolume(AObject : TCPlusObject; vol: TCPlusObject ):Status_t;cdecl; external BePascalLibName name 'BVolumeRoster_GetBootVolume'; +//function BVolumeRoster_StartWatching(AObject : TCPlusObject; msngr : TMessenger): Status_t;cdecl; external BePascalLibName name 'BVolumeRoster_StartWatching'; +procedure BVolumeRoster_StopWatching(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolumeRoster_StopWatching'; + + + + +implementation + + +constructor BVolumeRoster.Create; +begin + inherited; + CPlusObject := BVolumeRoster_Create(Self); +end; + +destructor BVolumeRoster.Destroy; +begin + if CPlusObject <> nil then + BVolumeRoster_Free(CPlusObject); + inherited; + +end; + +function BVolumeRoster.GetNextVolume(val : TVolume): Status_t; +begin + result:=BVolumeRoster_GetNextVolume(CPlusObject,val.CPlusObject); +end; + +procedure BVolumeRoster.Rewind; +begin + BVolumeRoster_Rewind(CPlusObject); +end; + +function BVolumeRoster.GetBootVolume( vol: TVolume ):Status_t; +begin + result:=BVolumeRoster_GetBootVolume(CPlusObject,vol.CPlusObject); +end; + +//function BVolumeRoster.StartWatching( msngr : TMessenger): Status_t; +//begin +// result:=BVolumeRoster_StartWatching(CPlusObject,msngr); +//end; + +procedure BVolumeRoster.StopWatching; +begin + BVolumeRoster_StopWatching(CPlusObject); +end; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/support/_beep.pp b/bepascal/source/bepascal/pas/src/be/support/_beep.pp new file mode 100644 index 0000000..680d5ae --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/support/_beep.pp @@ -0,0 +1,32 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit _beep; + +interface + +uses + supportdefs; + + // beep is a simple function. We can link to libbe.so. + // beep__Fv is the mangled name of the function in libbe.so. +function beep : Status_t; cdecl; external 'be' name 'beep__Fv'; + +implementation + +end. \ No newline at end of file diff --git a/bepascal/source/bepascal/pas/src/be/support/archivable.pp b/bepascal/source/bepascal/pas/src/be/support/archivable.pp new file mode 100644 index 0000000..e6d9642 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/support/archivable.pp @@ -0,0 +1,53 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit Archivable; + +interface + +uses + beobj, message, supportdefs; + +type + BArchivable = class(TBeObject) + private + public + end; + +function BArchivable_Create(AObject : TObject) : TCPlusObject; cdecl; external BePascalLibName name 'BApplication_Create_1'; +function BArchivable_Create(AObject : TObject; from : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BApplication_Create_1'; +function BArchivable_Archive(archivable : TCPlusObject; into : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BApplication_Create_1'; + +implementation + +var + Archivable_Instantiate_hook : Pointer; cvar; external; + Archivable_Archive_hook : Pointer; cvar; external; + +function Archivable_Instantiate_hook_func(from : TCPlusObject) : TCPlusObject; +begin +end; + +function Archivable_Archive_hook_func(into : TCPlusObject; deep : boolean) : TCPlusObject; +begin +end; + +initialization + Archivable_Instantiate_hook := @Archivable_Instantiate_hook_func; + Archivable_Archive_hook := @Archivable_Archive_hook_func; +end. \ No newline at end of file diff --git a/bepascal/source/bepascal/pas/src/be/support/bstring.pp b/bepascal/source/bepascal/pas/src/be/support/bstring.pp new file mode 100644 index 0000000..111a90d --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/support/bstring.pp @@ -0,0 +1,510 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit BString; + +interface + +uses + beobj, SupportDefs, os; + +type + TString = class(TBeObject) + private + public + constructor Create; override; + // constructor Create(value : PChar); override; + destructor Destroy; override; + + function CountChars : integer; + function length : integer; + function String_pchar : PChar; + + // Affectation + procedure SetTo(value:PChar; lenght : cardinal); + procedure SetTo( from: TString); + procedure SetTo( value:TString; length1: cardinal); + procedure Adopt( from:TString); + end; + + +function BString_Create(AObject : TBeObject):TCPlusObject; cdecl; external BePascalLibName name 'BString_Create'; +function BString_Create(AObject : TBeObject;value : PChar):TCPlusObject; cdecl; external BePascalLibName name 'BString_Create_1'; +procedure BString_Free(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BString_Free'; +function BString_CountChars(AObject : TCPlusObject): cardinal;cdecl; external BePascalLibName name 'BString_CountChars'; +function BString_Length(AObject : TCPlusObject): cardinal;cdecl; external BePascalLibName name 'BString_Length'; +function BString_String(AObject : TCPlusObject): Pchar;cdecl; external BePascalLibName name 'BString_String'; + +procedure BString_SetTo(AObject : TCPlusObject;value:Pchar;length:cardinal);cdecl; external BePascalLibName name 'BString_SetTo'; +procedure BString_SetTo_1(AObject : TCPlusObject; from: TBeObject);cdecl; external BePascalLibName name 'BString_SetTo_1'; +procedure BString_SetTo_2(AObject : TCPlusObject; value:TBeObject;length: cardinal);cdecl; external BePascalLibName name 'BString_SetTo_2'; + +procedure BString_Adopt(AObject : TCPlusObject; from:TBeObject);cdecl; external BePascalLibName name 'BString_Adopt'; + + +{ + +BString & +BString_Adopt_1(BString *String, BString &from, + int32 length) + +BString & +BString_SetTo_3(BString *String, char value, + int32 count) + + +BString & +BString_CopyInto(BString *String, BString &into, + int32 fromOffset, + int32 length) + + +void +BString_CopyInto_1 +(BString *String, char *into, + int32 fromOffset, + int32 length) + + +BString & +BString_Append(BString *String, const BString &value, + int32 length) + +BString & +BString_Append_1 +(BString *String, const char *value, + int32 length) + +BString & +BString_Append_2 +(BString *String, char value, + int32 count) + +BString & +BString_Prepend(BString *String, const char *value) + +BString & +BString_Prepend_1 +(BString *String, const BString &value) + +BString & +BString_Prepend_2 +(BString *String, const char *value, + int32 length) + +BString & +BString_Prepend_3 +(BString *String, const BString &value, + int32 length) + +BString & +BString_Prepend_4 +(BString *String, char value, + int32 count) + +BString & +BString_Insert(BString *String, const char *value, + int32 pos) + +BString & +BString_Insert_1 +(BString *String, const char *value, + int32 length, + int32 pos) + +BString & +BString_Insert_2 +(BString *String, const char *value, + int32 fromOffset, + int32 length, + int32 pos) + +BString & +BString_Insert_3 +(BString *String, const BString &value, + int32 pos) + +BString & +BString_Insert_4 +(BString *String, const BString &value, + int32 length, + int32 pos) + +BString & +BString_Insert_5 +(BString *String, const BString &value, + int32 fromOffset, + int32 length, + int32 pos) + +BString & +BString_Insert_6 +(BString *String, char value, + int32 count, + int32 pos) + +BString & +BString_Truncate(BString *String, int32 newLength, + bool lazy) + +BString & +BString_Remove(BString *String, int32 from, + int32 length) + +BString & +BString_RemoveFirst_1 +(BString *String, const BString &value) + +BString & +BString_RemoveLast(BString *String, const BString &value) + +BString & +BString_RemoveAll(BString *String, const BString &value) + +BString & +BString_RemoveFirst(BString *String, const char *value) + +BString & +BString_RemoveLast_1(BString *String, const char *value) + +BString & +BString_RemoveAll_1(BString *String, const char *value) + +BString & +BString_RemoveSet(BString *String, const char *setOfCharsToRemove) + +BString & +BString_MoveInto(BString *String, BString &into, + int32 from, + int32 length) + +void +BString_MoveInto_1 +(BString *String, char *into, + int32 from, + int32 length) + +int +BString_Compare(BString *String, const BString &value) + +int +BString_Compare_1 +(BString *String, const char *value) + +int +BString_Compare_2 +(BString *String, const BString &value, + int32 n) + +int +BString_Compare_3 +(BString *String, const char *value, + int32 n) + +int +BString_ICompare(BString *String, const BString &value) + +int +BString_ICompare_1 +(BString *String, const char *value) + +int +BString_ICompare_2 +(BString *String, const BString &value, + int32 n) + +int +BString_ICompare_3 +(BString *String, const char *value, + int32 n) + +int32 +BString_FindFirst(BString *String, const BString &value) + +int32 +BString_FindFirst_1 +(BString *String, const char *value) + +int32 +BString_FindFirst_2 +(BString *String, const BString &value, + int32 fromOffset) + +int32 +BString_FindFirst_3 +(BString *String, const char *value, + int32 fromOffset) + +int32 +BString_FindFirst_4 +(BString *String, char value) + +int32 +BString_FindFirst_5 +(BString *String, char value, + int32 fromOffset) + +int32 +BString_FindLast(BString *String, const BString &value) + +int32 +BString_FindLast_1 +(BString *String, const char *value) + +int32 +BString_FindLast_2 +(BString *String, const BString &value, + int32 beforeOffset) + +int32 +BString_FindLast_3 +(BString *String, const char *value, + int32 beforeOffset) + +int32 +BString_FindLast_4 +(BString *String, char value) + +int32 +BString_FindLast_5 +(BString *String, char value, + int32 fromOffset) + +int32 +BString_IFindFirst(BString *String, const BString &value) + +int32 +BString_IFindFirst_1 +(BString *String, const char *value) + +int32 +BString_IFindFirst_2 +(BString *String, const BString &value, + int32 fromOffset) + +int32 +BString_IFindFirst_3 +(BString *String, const char *value, + int32 fromOffset) + +int32 +BString_IFindLast(BString *String, const BString &value) + +int32 +BString_IFindLast_1 +(BString *String, const char *value) + +int32 +BString_IFindLast_2 +(BString *String, const BString &value, + int32 beforeOffset) + +int32 +BString_IFindLast_3 +(BString *String, const char *value, + int32 beforeOffset) + +BString & +BString_ReplaceFirst(BString *String, char replaceThis, + char withThis) + +BString & +BString_ReplaceLast(BString *String, char replaceThis, + char withThis) + +BString & +BString_ReplaceAll(BString *String, char replaceThis, + char withThis, + int32 fromOffset) + +BString & +BString_Replace(BString *String, char replaceThis, + char withThis, + int32 maxReplaceCount, + int32 fromOffset) + +BString & +BString_ReplaceFirst_1 +(BString *String, const char *replaceThis, + const char *withThis) + +BString & +BString_ReplaceLast_1(BString *String, const char *replaceThis, + const char *withThis) + +BString & +BString_ReplaceAll_1(BString *String, const char *replaceThis, + const char *withThis, + int32 fromOffset) + +BString & +BString_Replace_1(BString *String, const char *replaceThis, + const char *withThis, + int32 maxReplaceCount, + int32 fromOffset) + +BString & +BString_IReplaceFirst(BString *String, char replaceThis, + char withThis) + +BString & +BString_IReplaceLast(BString *String, char replaceThis, + char withThis) + +BString & +BString_IReplaceAll(BString *String, char replaceThis, + char withThis, + int32 fromOffset) + +BString & +BString_IReplace(BString *String, char replaceThis, + char withThis, + int32 maxReplaceCount, + int32 fromOffset) + +BString & +BString_IReplaceFirst_1 +(BString *String, const char *replaceThis, + const char *withThis) + +BString & +BString_IReplaceLast_1(BString *String, const char *replaceThis, + const char *withThis) + +BString & +BString_IReplaceAll_1(BString *String, const char *replaceThis, + const char *withThis, + int32 fromOffset) + +BString & +BString_IReplace_1(BString *String, const char *replaceThis, + const char *withThis, + int32 maxReplaceCount, + int32 fromOffset) + +BString & +BString_ReplaceSet(BString *String, const char *setOfChars, + char with) + +BString & +BString_ReplaceSet_1 +(BString *String, const char *setOfChars, + const char *with) + +char * +BString_LockBuffer(BString *String, int32 maxLength) + +BString & +BString_UnlockBuffer(BString *String, int32 length) + +BString & +BString_ToLower(BString *String) + +BString & +BString_ToUpper(BString *String) + +BString & +BString_Capitalize(BString *String) + +BString & +BString_CapitalizeEachWord_1 +(BString *String) + +BString & +BString_CharacterEscape(BString *String, const char *original, + const char *setOfCharsToEscape, + char escapeWith) + +BString & +BString_CharacterEscape_1 +(BString *String, const char *setOfCharsToEscape, + char escapeWith) + +BString & +BString_CharacterDeescape(BString *String, const char *original, + char escapeChar) + +BString & +BString_CharacterDeescape_1 +(BString *String, char escapeChar) +} + + +implementation + + +constructor TString.Create; +begin + inherited; + CPlusObject := BString_Create(Self); +end; + +{constructor TString.Create_1(value:PChar); +begin + inherited; + CPlusObject := BString_Create_1(Self,value); +end; +} +destructor TString.Destroy; +begin + if CPlusObject <> nil then + BString_Free(CPlusObject); + inherited; + +end; + +function TString.CountChars : integer; +begin + result:=BString_CountChars(CPlusObject); +end; + +function TString.length : integer; +begin + result:=BString_Length(CPlusObject); +end; + +function TString.String_pchar : PChar; +begin + result:=BString_String(CPlusObject); +end; + +procedure TString.SetTo(value:PChar; lenght : cardinal); +begin + BString_SetTo(CPlusObject,value,lenght); +end; + + +procedure TString.SetTo( from: TString); +begin + BString_SetTo_1(CPlusObject, from); +end; + +procedure TString.SetTo( value:TString;length1: cardinal); +begin + BString_SetTo_2(CPlusObject, value,length1); +end; + +procedure TString.Adopt( from:TString); +begin + BString_Adopt(CPlusObject, from); +end; + + + +end. + diff --git a/bepascal/source/bepascal/pas/src/be/support/dataio.pp b/bepascal/source/bepascal/pas/src/be/support/dataio.pp new file mode 100644 index 0000000..bb9d1ce --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/support/dataio.pp @@ -0,0 +1,629 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit dataio; + +interface + +uses + beobj, supportdefs; + +type + BDataIO = class(TBeObject) + private + public + constructor Create; override; + destructor Destroy; override; + function Read(buffer : Pointer; size : Size_t) : SSize_t; virtual; abstract; + function Write(buffer : Pointer; size : Size_t) : SSize_t; virtual; abstract; +{ procedure _ReservedDataIO1; + procedure _ReservedDataIO2; + procedure _ReservedDataIO3; + procedure _ReservedDataIO4; + procedure _ReservedDataIO5; + procedure _ReservedDataIO6; + procedure _ReservedDataIO7; + procedure _ReservedDataIO8; + procedure _ReservedDataIO9; + procedure _ReservedDataIO10; + procedure _ReservedDataIO11; + procedure _ReservedDataIO12; +} + constructor Create(DataIO : BDataIO); +// function operator=( : BDataIO) : BDataIO; +// procedure int32 _reserved[2]; + end; +type + TPositionIO = class(BDataIO) + private + public + constructor Create; override; + destructor Destroy; override; +// function Read(buffer : Pointer; size : Size_t) : SSize_t; override; +// function Write(buffer : Pointer; size : Size_t) : SSize_t; override; + function ReadAt(pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; virtual; abstract; + function WriteAt(pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; virtual; abstract; + function Seek(aposition : off_t; seek_mode : Cardinal) : off_t; virtual; abstract; +// function Position : off_t; virtual; + function SetSize(size : off_t) : Status_t; virtual; +{ procedure _ReservedPositionIO1; + procedure _ReservedPositionIO2; + procedure _ReservedPositionIO3; + procedure _ReservedPositionIO4; + procedure _ReservedPositionIO5; + procedure _ReservedPositionIO6; + procedure _ReservedPositionIO7; + procedure _ReservedPositionIO8; + procedure _ReservedPositionIO9; + procedure _ReservedPositionIO10; + procedure _ReservedPositionIO11; + procedure _ReservedPositionIO12; +} +// procedure int32 _reserved[2]; + end; +type + TMallocIO = class(TPositionIO) + private + public + constructor Create; override; + destructor Destroy; override; + function ReadAt(pos : off_t; abuffer : Pointer; size : Size_t) : SSize_t; override; + function WriteAt(pos : off_t; abuffer : Pointer; size : Size_t) : SSize_t; override; + function Seek(pos : off_t; seek_mode : Cardinal) : off_t; override; +// function Position : off_t; override; + function SetSize(size : off_t) : Status_t; override; + procedure SetBlockSize(blocksize : Size_t); virtual; + function Buffer : Pointer; +// function BufferLength : Size_t; +{ procedure _ReservedMallocIO1; + procedure _ReservedMallocIO2; +} +// constructor Create(MallocIO : TMallocIO); +// function operator=( : TMallocIO) : TMallocIO; +{ function fBlockSize : Size_t; + function fMallocSize : Size_t; + function fLength : Size_t; + function fData : PChar; + function fPosition : off_t; +} +// procedure _reserved[1] : integer; + end; +type + TMemoryIO = class(TPositionIO) + private + public + constructor Create; override; + constructor Create(p : Pointer; len : Size_t); virtual; + destructor Destroy; override; + function ReadAt(pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; override; + function WriteAt(pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; override; + function Seek(pos : off_t; seek_mode : Cardinal) : off_t; override; +// function Position : off_t; override; + function SetSize(size : off_t) : Status_t; override; +{ procedure _ReservedMemoryIO1; + procedure _ReservedMemoryIO2; +} + constructor Create(MemoryIO : TMemoryIO); +// function operator=(MemoryIO : TMemoryIO) : TMemoryIO; +{ function fReadOnly : boolean; + function fBuf : PChar; + function fLen : Size_t; + function fPhys : Size_t; + function fPos : Size_t; +} +// function _reserved[1] : int32; + end; + +function BDataIO_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BDataIO_Create_1'; +procedure BDataIO_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO_Free'; +//function BDataIO_Read(AObject : TCPlusObject; buffer : Pointer; size : Size_t) : SSize_t; cdecl; external BePascalLibName name 'BDataIO_Read'; +//function BDataIO_Write(AObject : TCPlusObject; buffer : Pointer; size : Size_t) : SSize_t; cdecl; external BePascalLibName name 'BDataIO_Write'; +{procedure BDataIO__ReservedDataIO1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO1'; +procedure BDataIO__ReservedDataIO2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO2'; +procedure BDataIO__ReservedDataIO3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO3'; +procedure BDataIO__ReservedDataIO4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO4'; +procedure BDataIO__ReservedDataIO5(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO5'; +procedure BDataIO__ReservedDataIO6(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO6'; +procedure BDataIO__ReservedDataIO7(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO7'; +procedure BDataIO__ReservedDataIO8(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO8'; +procedure BDataIO__ReservedDataIO9(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO9'; +procedure BDataIO__ReservedDataIO10(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO10'; +procedure BDataIO__ReservedDataIO11(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO11'; +procedure BDataIO__ReservedDataIO12(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO__ReservedDataIO12'; +} +function BDataIO_Create(AObject : TBeObject; DataIO : BDataIO) : TCPlusObject; cdecl; external BePascalLibName name 'BDataIO_Create_2'; +//function BDataIO_operator=(AObject : TCPlusObject; : BDataIO) : BDataIO; cdecl; external BePascalLibName name 'BDataIO_operator='; +//procedure BDataIO_int32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BDataIO_int32 _reserved[2]'; +function BPositionIO_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BPositionIO_Create'; +procedure BPositionIO_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO_Free'; +function BPositionIO_Read(AObject : TCPlusObject; buffer : Pointer; size : Size_t) : SSize_t; cdecl; external BePascalLibName name 'BPositionIO_Read'; +function BPositionIO_Write(AObject : TCPlusObject; buffer : Pointer; size : Size_t) : SSize_t; cdecl; external BePascalLibName name 'BPositionIO_Write'; +function BPositionIO_ReadAt(AObject : TCPlusObject; pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; cdecl; external BePascalLibName name 'BPositionIO_ReadAt'; +function BPositionIO_WriteAt(AObject : TCPlusObject; pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; cdecl; external BePascalLibName name 'BPositionIO_WriteAt'; +function BPositionIO_Seek(AObject : TCPlusObject; position : off_t; seek_mode : Cardinal) : off_t; cdecl; external BePascalLibName name 'BPositionIO_Seek'; +//function BPositionIO_Position(AObject : TCPlusObject) : off_t; cdecl; external BePascalLibName name 'BPositionIO_Position'; +function BPositionIO_SetSize(AObject : TCPlusObject; size : off_t) : Status_t; cdecl; external BePascalLibName name 'BPositionIO_SetSize'; +{procedure BPositionIO__ReservedPositionIO1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO1'; +procedure BPositionIO__ReservedPositionIO2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO2'; +procedure BPositionIO__ReservedPositionIO3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO3'; +procedure BPositionIO__ReservedPositionIO4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO4'; +procedure BPositionIO__ReservedPositionIO5(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO5'; +procedure BPositionIO__ReservedPositionIO6(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO6'; +procedure BPositionIO__ReservedPositionIO7(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO7'; +procedure BPositionIO__ReservedPositionIO8(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO8'; +procedure BPositionIO__ReservedPositionIO9(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO9'; +procedure BPositionIO__ReservedPositionIO10(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO10'; +procedure BPositionIO__ReservedPositionIO11(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO11'; +procedure BPositionIO__ReservedPositionIO12(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO__ReservedPositionIO12'; +} +//procedure BPositionIO_int32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPositionIO_int32 _reserved[2]'; +function BMallocIO_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMallocIO_Create'; +procedure BMallocIO_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMallocIO_Free'; +function BMallocIO_ReadAt(AObject : TCPlusObject; pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; cdecl; external BePascalLibName name 'BMallocIO_ReadAt'; +function BMallocIO_WriteAt(AObject : TCPlusObject; pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; cdecl; external BePascalLibName name 'BMallocIO_WriteAt'; +function BMallocIO_Seek(AObject : TCPlusObject; pos : off_t; seek_mode : Cardinal) : off_t; cdecl; external BePascalLibName name 'BMallocIO_Seek'; +//function BMallocIO_Position(AObject : TCPlusObject) : off_t; cdecl; external BePascalLibName name 'BMallocIO_Position'; +function BMallocIO_SetSize(AObject : TCPlusObject; size : off_t) : Status_t; cdecl; external BePascalLibName name 'BMallocIO_SetSize'; +procedure BMallocIO_SetBlockSize(AObject : TCPlusObject; blocksize : Size_t); cdecl; external BePascalLibName name 'BMallocIO_SetBlockSize'; +function BMallocIO_Buffer(AObject : TCPlusObject) : Pointer; cdecl; external BePascalLibName name 'BMallocIO_Buffer'; +//function BMallocIO_BufferLength(AObject : TCPlusObject) : Size_t; cdecl; external BePascalLibName name 'BMallocIO_BufferLength'; +{procedure BMallocIO__ReservedMallocIO1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMallocIO__ReservedMallocIO1'; +procedure BMallocIO__ReservedMallocIO2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMallocIO__ReservedMallocIO2'; +} +//function BMallocIO_Create(AObject : TBeObject; MallocIO : TMallocIO) : TCPlusObject; cdecl; external BePascalLibName name 'BMallocIO_Create'; +//function BMallocIO_operator=(AObject : TCPlusObject; MallocIO : TMallocIO) : TMallocIO; cdecl; external BePascalLibName name 'BMallocIO_operator='; +{procedure BMallocIO_size_t fBlockSize(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMallocIO_size_t fBlockSize'; +procedure BMallocIO_size_t fMallocSize(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMallocIO_size_t fMallocSize'; +procedure BMallocIO_size_t fLength(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMallocIO_size_t fLength'; +procedure BMallocIO_char *fData(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMallocIO_char *fData'; +procedure BMallocIO_off_t fPosition(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMallocIO_off_t fPosition'; +procedure BMallocIO_int32 _reserved[1](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMallocIO_int32 _reserved[1]'; +} +function BMemoryIO_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMemoryIO_Create'; +function BMemoryIO_Create(AObject : TBeObject; p : Pointer; len : Size_t) : TCPlusObject; cdecl; external BePascalLibName name 'BMemoryIO_Create_1'; +procedure BMemoryIO_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMemoryIO_Free'; +function BMemoryIO_ReadAt(AObject : TCPlusObject; pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; cdecl; external BePascalLibName name 'BMemoryIO_ReadAt'; +function BMemoryIO_WriteAt(AObject : TCPlusObject; pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; cdecl; external BePascalLibName name 'BMemoryIO_WriteAt'; +function BMemoryIO_Seek(AObject : TCPlusObject; pos : off_t; seek_mode : Cardinal) : off_t; cdecl; external BePascalLibName name 'BMemoryIO_Seek'; +function BMemoryIO_Position(AObject : TCPlusObject) : off_t; cdecl; external BePascalLibName name 'BMemoryIO_Position'; +function BMemoryIO_SetSize(AObject : TCPlusObject; size : off_t) : Status_t; cdecl; external BePascalLibName name 'BMemoryIO_SetSize'; +{procedure BMemoryIO__ReservedMemoryIO1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMemoryIO__ReservedMemoryIO1'; +procedure BMemoryIO__ReservedMemoryIO2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMemoryIO__ReservedMemoryIO2'; +} +function BMemoryIO_Create(AObject : TBeObject; MemoryIO : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMemoryIO_Create'; +//function BMemoryIO_operator=(AObject : TCPlusObject; : TMemoryIO) : TMemoryIO; cdecl; external BePascalLibName name 'BMemoryIO_operator='; +{procedure BMemoryIO_bool fReadOnly(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMemoryIO_bool fReadOnly'; +procedure BMemoryIO_char *fBuf(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMemoryIO_char *fBuf'; +procedure BMemoryIO_size_t fLen(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMemoryIO_size_t fLen'; +procedure BMemoryIO_size_t fPhys(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMemoryIO_size_t fPhys'; +procedure BMemoryIO_size_t fPos(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMemoryIO_size_t fPos'; +procedure BMemoryIO_int32 _reserved[1](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMemoryIO_int32 _reserved[1]'; +} + +implementation + +constructor BDataIO.Create; +begin + inherited; + CPlusObject := BDataIO_Create(Self); +end; + +destructor BDataIO.Destroy; +begin + if CPlusObject <> nil then + BDataIO_Free(CPlusObject); + inherited; +end; + +{procedure BDataIO._ReservedDataIO1; +begin + BDataIO__ReservedDataIO1(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO2; +begin + BDataIO__ReservedDataIO2(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO3; +begin + BDataIO__ReservedDataIO3(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO4; +begin + BDataIO__ReservedDataIO4(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO5; +begin + BDataIO__ReservedDataIO5(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO6; +begin + BDataIO__ReservedDataIO6(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO7; +begin + BDataIO__ReservedDataIO7(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO8; +begin + BDataIO__ReservedDataIO8(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO9; +begin + BDataIO__ReservedDataIO9(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO10; +begin + BDataIO__ReservedDataIO10(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO11; +begin + BDataIO__ReservedDataIO11(CPlusObject); +end; + +procedure BDataIO._ReservedDataIO12; +begin + BDataIO__ReservedDataIO12(CPlusObject); +end; +} + +constructor BDataIO.Create(DataIO : BDataIO); +begin + inherited Create; + CPlusObject := BDataIO_Create(Self, DataIO); +end; + +{function BDataIO.operator=( : BDataIO) : BDataIO; +begin + BDataIO_operator=(CPlusObject, ); +end; +} + +{procedure BDataIO.int32 _reserved[2]; +begin + BDataIO_int32 _reserved[2](CPlusObject); +end; +} + +constructor TPositionIO.Create; +begin + CPlusObject := BPositionIO_Create(Self); +end; + +destructor TPositionIO.Destroy; +begin + BPositionIO_Free(CPlusObject); +end; + +{function TPositionIO.Read(buffer : Pointer; size : Size_t) : SSize_t; +begin + Result := BPositionIO_Read(CPlusObject, buffer, size); +end; + +function TPositionIO.Write(buffer : Pointer; size : Size_t) : SSize_t; +begin + Result := BPositionIO_Write(CPlusObject, buffer, size); +end; +} + +{function TPositionIO.ReadAt(pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; +begin + Result := BPositionIO_ReadAt(CPlusObject, pos, buffer, size); +end; + +function TPositionIO.WriteAt(pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; +begin + Result := BPositionIO_WriteAt(CPlusObject, pos, buffer, size); +end; + +function TPositionIO.Seek(aposition : off_t; seek_mode : Cardinal) : off_t; +begin + Result := BPositionIO_Seek(CPlusObject, aposition, seek_mode); +end; +} + +{function TPositionIO.Position : off_t; +begin + Result := BPositionIO_Position(CPlusObject); +end; +} + +function TPositionIO.SetSize(size : off_t) : Status_t; +begin + Result := BPositionIO_SetSize(CPlusObject, size); +end; + +{procedure TPositionIO._ReservedPositionIO1; +begin + BPositionIO__ReservedPositionIO1(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO2; +begin + BPositionIO__ReservedPositionIO2(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO3; +begin + BPositionIO__ReservedPositionIO3(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO4; +begin + BPositionIO__ReservedPositionIO4(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO5; +begin + BPositionIO__ReservedPositionIO5(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO6; +begin + BPositionIO__ReservedPositionIO6(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO7; +begin + BPositionIO__ReservedPositionIO7(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO8; +begin + BPositionIO__ReservedPositionIO8(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO9; +begin + BPositionIO__ReservedPositionIO9(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO10; +begin + BPositionIO__ReservedPositionIO10(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO11; +begin + BPositionIO__ReservedPositionIO11(CPlusObject); +end; + +procedure TPositionIO._ReservedPositionIO12; +begin + BPositionIO__ReservedPositionIO12(CPlusObject); +end; +} + +{procedure TPositionIO.int32 _reserved[2]; +begin + BPositionIO_int32 _reserved[2](CPlusObject); +end; +} + +constructor TMallocIO.Create; +begin + CPlusObject := BMallocIO_Create(Self); +end; + +destructor TMallocIO.Destroy; +begin + BMallocIO_Free(CPlusObject); +end; + +function TMallocIO.ReadAt(pos : off_t; abuffer : Pointer; size : Size_t) : SSize_t; +begin + Result := BMallocIO_ReadAt(CPlusObject, pos, abuffer, size); +end; + +function TMallocIO.WriteAt(pos : off_t; abuffer : Pointer; size : Size_t) : SSize_t; +begin + Result := BMallocIO_WriteAt(CPlusObject, pos, abuffer, size); +end; + +function TMallocIO.Seek(pos : off_t; seek_mode : Cardinal) : off_t; +begin + Result := BMallocIO_Seek(CPlusObject, pos, seek_mode); +end; + +{function TMallocIO.Position : off_t; +begin + Result := BMallocIO_Position(CPlusObject); +end; +} + +function TMallocIO.SetSize(size : off_t) : Status_t; +begin + Result := BMallocIO_SetSize(CPlusObject, size); +end; + +procedure TMallocIO.SetBlockSize(blocksize : Size_t); +begin + BMallocIO_SetBlockSize(CPlusObject, blocksize); +end; + +function TMallocIO.Buffer : Pointer; +begin + Result := BMallocIO_Buffer(CPlusObject); +end; + +{function TMallocIO.BufferLength : Size_t; +begin + Result := BMallocIO_BufferLength(CPlusObject); +end; +} + + +{procedure TMallocIO._ReservedMallocIO1; +begin + BMallocIO__ReservedMallocIO1(CPlusObject); +end; + +procedure TMallocIO._ReservedMallocIO2; +begin + BMallocIO__ReservedMallocIO2(CPlusObject); +end; +} + +//constructor TMallocIO.Create(MallocIO : TMallocIO); +//begin +// CPlusObject := BMallocIO_Create(Self, MallocIO); +//end; + +{function TMallocIO.operator=( : TMallocIO) : TMallocIO; +begin + BMallocIO_operator=(CPlusObject, ); +end; +} + +{function TMallocIO.fBlockSize : Size_t; +begin + Result := BMallocIO_fBlockSize(CPlusObject); +end; + +function TMallocIO.fMallocSize : Size_t; +begin + Result := BMallocIO_size_t fMallocSize(CPlusObject); +end; + +function TMallocIO.fLength : Size_t; +begin + BMallocIO_size_t fLength(CPlusObject); +end; + +function TMallocIO.fData : PChar; +begin + Result := BMallocIO_char *fData(CPlusObject); +end; + +function TMallocIO.fPosition : off_t; +begin + Result := BMallocIO_fPosition(CPlusObject); +end; +} + +{procedure TMallocIO.int32 _reserved[1]; +begin + BMallocIO_int32 _reserved[1](CPlusObject); +end; +} + +constructor TMemoryIO.Create; +begin + CPlusObject := BMemoryIO_Create(Self); +end; + + +constructor TMemoryIO.Create(p : Pointer; len : Size_t); +begin + CPlusObject := BMemoryIO_Create(Self, p, len); +end; + +destructor TMemoryIO.Destroy; +begin + BMemoryIO_Free(CPlusObject); +end; + +function TMemoryIO.ReadAt(pos : off_t; buffer : Pointer; size : Size_t) : SSize_t; +begin + Result := BMemoryIO_ReadAt(CPlusObject, pos, buffer, size); +end; + +function TMemoryIO.WriteAt(pos : off_t; buffer : Pointer; size :Size_t) :SSize_t; +begin + Result := BMemoryIO_WriteAt(CPlusObject, pos, buffer, size); +end; + +function TMemoryIO.Seek(pos : off_t; seek_mode : Cardinal) : off_t; +begin + Result := BMemoryIO_Seek(CPlusObject, pos, seek_mode); +end; + +{function TMemoryIO.Position : off_t; +begin + Result := BMemoryIO_Position(CPlusObject); +end; +} + +function TMemoryIO.SetSize(size : off_t) : Status_t; +begin + Result := BMemoryIO_SetSize(CPlusObject, size); +end; + +{procedure TMemoryIO._ReservedMemoryIO1; +begin + BMemoryIO__ReservedMemoryIO1(CPlusObject); +end; + +procedure TMemoryIO._ReservedMemoryIO2; +begin + BMemoryIO__ReservedMemoryIO2(CPlusObject); +end; +} + +constructor TMemoryIO.Create(MemoryIO : TMemoryIO); +begin + CPlusObject := BMemoryIO_Create(Self, MemoryIO.CPlusObject); +end; + +{function TMemoryIO.operator=( : TMemoryIO) : TMemoryIO; +begin + BMemoryIO_operator=(CPlusObject, ); +end; +} + +{procedure TMemoryIO.bool fReadOnly; +begin + BMemoryIO_bool fReadOnly(CPlusObject); +end; + +procedure TMemoryIO.char *fBuf; +begin + BMemoryIO_char *fBuf(CPlusObject); +end; + +procedure TMemoryIO.size_t fLen; +begin + BMemoryIO_size_t fLen(CPlusObject); +end; + +procedure TMemoryIO.size_t fPhys; +begin + BMemoryIO_size_t fPhys(CPlusObject); +end; + +procedure TMemoryIO.size_t fPos; +begin + BMemoryIO_size_t fPos(CPlusObject); +end; + +procedure TMemoryIO.int32 _reserved[1]; +begin + BMemoryIO_int32 _reserved[1](CPlusObject); +end; +} + +end. diff --git a/bepascal/source/bepascal/pas/src/be/support/flattenable.pp b/bepascal/source/bepascal/pas/src/be/support/flattenable.pp new file mode 100644 index 0000000..d775a60 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/support/flattenable.pp @@ -0,0 +1,96 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursière + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit Flattenable; + +interface + +uses + beobj, SupportDefs, os; + +type + BFlattenable = class(TBeObject) + private + public + constructor Create; override; + destructor Destroy; override; + + function IsFixedSize : boolean; + function TypeCode : Type_code; + function Flatten( buffer :pointer; size : ssize_t) : Status_t; + function AllowsTypeCode( code : Type_code) : boolean; + function Unflatten(c :Type_code ; buf :pointer ; size: ssize_t) : Status_t; + + end; + + +procedure BFlattenable_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFlattenable_Free'; + +function BFlattenable_IsFixedSize(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BFlattenable_IsFixedSize'; +function BFlattenable_TypeCode(AObject : TCPlusObject) : Type_code;cdecl; external BePascalLibName name 'BFlattenable_TypeCode'; +function BFlattenable_Flatten( AObject : TCPlusObject;buffer :pointer; size : ssize_t) : Status_t;cdecl; external BePascalLibName name 'BFlattenable_Flatten'; +function BFlattenable_AllowsTypeCode( AObject : TCPlusObject;code : Type_code) : boolean;cdecl; external BePascalLibName name 'BFlattenable_AllowsTypeCode'; +function BFlattenable_Unflatten(AObject : TCPlusObject;c :Type_code ; buf :pointer ; size: ssize_t) : Status_t;cdecl; external BePascalLibName name 'BFlattenable_Unflatten'; + + +implementation + + + +constructor BFlattenable.Create; +begin + CreatePas; + CPlusObject:=self; +end; + + +destructor BFlattenable.Destroy; +begin + if CPlusObject <> nil then + BFlattenable_Free(CPlusObject); + inherited; +end; + +function BFlattenable.IsFixedSize : boolean; +begin + result:=BFlattenable_IsFixedSize(CPlusObject); +end; + +function BFlattenable.TypeCode : Type_code; +begin + result:=BFlattenable_TypeCode(CPlusObject); +end; + +function BFlattenable.Flatten( buffer :pointer; size : ssize_t) : Status_t; +begin + result:=BFlattenable_Flatten(CPlusObject,buffer,size); +end; + +function BFlattenable.AllowsTypeCode( code : Type_code) : boolean; +begin + result:=BFlattenable_AllowsTypeCode(CPlusObject,code); +end; + +function BFlattenable.Unflatten(c :Type_code ; buf :pointer ; size: ssize_t) : Status_t; +begin + result:=BFlattenable_Unflatten(CPlusObject,c,buf,size); +end; + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/support/list.pp b/bepascal/source/bepascal/pas/src/be/support/list.pp new file mode 100644 index 0000000..06bfe0f --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/support/list.pp @@ -0,0 +1,187 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit List; + +interface + +uses + beobj, SupportDefs, os; + +type + BList = class(TBeObject) + private + public + constructor Create; override; + destructor Destroy; override; + + function AddItem(item : pointer): boolean; + function AddItem(item : pointer; atindex : cardinal): boolean; + function AddList(newitem : TCPlusObject): boolean; + function ItemAt(at : cardinal): pointer; + function ItemAtFast(at : cardinal): pointer; + function RemoveItem(item : pointer) : boolean; + function RemoveItem(index : cardinal) : boolean; + function RemoveItems(index,count : cardinal) : boolean; + procedure MakeEmpty; + function FirstItem : pointer; + function LastItem : pointer; + function HasItem (item : pointer) : boolean; + function IndexOf(item : pointer) : cardinal; + function CountItems : cardinal; + function IsEmpty : boolean; + function ReplaceItem(index : cardinal; newItem : pointer): boolean; + function SwapItems(IndexA,IndexB : cardinal) : boolean; + function MoveItem(FromIndex,ToIndex : cardinal) : boolean; + end; + + +function BList_Create( itemsPerBlock: cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BList_Create'; +procedure BList_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BList_Free'; + +function BList_AddItem(AObject : TCPlusObject; item : pointer):boolean;cdecl; external BePascalLibName name 'BList_AddItem'; +function BList_AddItem(AObject : TCPlusObject; item : pointer; atIndex : cardinal):boolean;cdecl; external BePascalLibName name 'BList_AddItem_1'; +function BList_AddList(AObject : TCPlusObject; newitem : TCPlusObject): boolean;cdecl; external BePascalLibName name 'BList_AddList'; +function BList_ItemAt(AObject : TCPlusObject; at : cardinal) : pointer;cdecl; external BePascalLibName name 'BList_ItemAt'; +function BList_ItemAtFast(AObject : TCPlusObject; at : cardinal) : pointer;cdecl; external BePascalLibName name 'BList_ItemAtFast_1'; +function BList_RemoveItem(AObject : TCPlusObject; item : pointer): boolean;cdecl; external BePascalLibName name 'BList_RemoveItem'; +function BList_RemoveItem(AObject : TCPlusObject; index : cardinal): boolean;cdecl; external BePascalLibName name 'BList_RemoveItem_1'; +function BList_RemoveItems(AObject : TCPlusObject; index,count : cardinal): boolean;cdecl; external BePascalLibName name 'BList_RemoveItems_2'; +procedure BList_MakeEmpty(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BList_MakeEmpty'; +function BList_FirstItem(AObject : TCPlusObject): pointer; cdecl; external BePascalLibName name 'BList_FirstItem'; +function BList_LastItem(AObject : TCPlusObject): pointer; cdecl; external BePascalLibName name 'BList_LastItem'; +function BList_HasItem(AObject : TCPlusObject; item : pointer) : boolean; cdecl; external BePascalLibName name 'BList_HasItem'; +function BList_IndexOf(AObject : TCPlusObject; item : pointer) : cardinal;cdecl; external BePascalLibName name 'BList_IndexOf'; +function BList_CountItems(AObject : TCPlusObject) : cardinal;cdecl; external BePascalLibName name 'BList_CountItems'; +function BList_IsEmpty(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BList_IsEmpty'; + +function BList_ReplaceItem(AObject : TCPlusObject; index : cardinal; newItem: pointer): boolean;cdecl; external BePascalLibName name 'BList_ReplaceItem'; +function BList_SwapItems(AObject : TCPlusObject; indexA : cardinal; indexB : cardinal) : boolean;cdecl; external BePascalLibName name 'BList_SwapItems'; +function BList_MoveItem(AObject : TCPlusObject; fromindex : cardinal; Toindex : cardinal) : boolean;cdecl; external BePascalLibName name 'BList_MoveItem'; + + +implementation + + + +constructor BList.Create; +begin + inherited; + CPlusObject:=BList_Create( 10); // we can't made a parametre under a constructor -> error : init with 10 items per blocks +end; + + +destructor BList.Destroy; +begin + if CPlusObject <> nil then + BList_Free(CPlusObject); + inherited; +end; + +function BList.AddItem(item : pointer): boolean; +begin + result := BList_AddItem(CPlusObject, item ); +end; + +function BList.AddItem(item : pointer; atindex : cardinal): boolean; +begin + result := BList_AddItem(CPlusObject, item , atindex); +end; + +function BList.AddList(newitem : TCPlusObject): boolean; +begin + result:=BList_AddList(CPlusObject, newitem ); +end; + + +function BList.ItemAt(at : cardinal): pointer; +begin + result:=BList_ItemAt(CPlusObject, at ); +end; + +function BList.ItemAtFast(at : cardinal): pointer; +begin + result:=BList_ItemAtFast(CPlusObject, at ); +end; + +function BList.RemoveItem(item : pointer) : boolean; +begin + result:=BList_RemoveItem(CPlusObject, item); +end; + +function BList.RemoveItem(index : cardinal) : boolean; +begin + result:=BList_RemoveItem(CPlusObject, index); +end; + +function BList.RemoveItems(index,count : cardinal) : boolean; +begin + result:=BList_RemoveItems(CPlusObject, index,count); +end; + +procedure BList.MakeEmpty; +begin + BList_MakeEmpty(CPlusObject); +end; + +function BList.FirstItem : pointer; +begin + result:=BList_FirstItem(CPlusObject); +end; + +function BList.LastItem : pointer; +begin + result:=BList_LastItem(CPlusObject); +end; + +function BList.HasItem(item : pointer) : boolean; +begin + result:=BList_HasItem(CPlusObject,item); +end; + +function BList.IndexOf(item : pointer) : cardinal; +begin + result:=BList_IndexOf(CPlusObject,item); +end; + +function BList.CountItems : cardinal; +begin + result:=BList_CountItems(CPlusObject); +end; + +function BList.IsEmpty : boolean; +begin + result:=BList_IsEmpty(CPlusObject); +end; + +function BList.ReplaceItem(index : cardinal; newItem : pointer): boolean; +begin + result:=BList_ReplaceItem(CPlusObject, index , newItem); +end; + +function BList.SwapItems(IndexA,IndexB : cardinal) : boolean; +begin + result:=BList_SwapItems(CPlusObject,indexA,indexB); +end; + +function BList.MoveItem(FromIndex,ToIndex : cardinal) : boolean; +begin + result:=BList_MoveItem(CPlusObject,Fromindex,Toindex); +end; + +end. diff --git a/bepascal/source/bepascal/pas/src/be/support/supportdefs.pp b/bepascal/source/bepascal/pas/src/be/support/supportdefs.pp new file mode 100644 index 0000000..658c674 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/support/supportdefs.pp @@ -0,0 +1,49 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit SupportDefs; + +interface + +type + // Descriptive formats + Status_t = Longint; + Bigtime_t = int64; + Type_code = Cardinal; + Perform_code = Cardinal; + // For Storage kit + // TODO : move these declarations in a different unit (but which one ?). + // C++ declarations are in /boot/develop/headers/posix/sys/types.h, + // not in SupportDefs.h + Dev_t = Longint; + Off_t = int64; + + // pointer types for FreePascal : to make life easier + PStatus_t = ^Status_t; + + // TODO : import other functions ! + + // import from stddef.h + Size_t = Cardinal; + SSize_t = Longint; + +implementation + + +end. diff --git a/bepascal/source/bepascal/pas/src/be/support/typeconstants.pp b/bepascal/source/bepascal/pas/src/be/support/typeconstants.pp new file mode 100644 index 0000000..fea6278 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/support/typeconstants.pp @@ -0,0 +1,67 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit TypeConstants; + +interface + +const + B_ANY_TYPE = 'ANYT'; + B_BOOL_TYPE = 'BOOL'; + B_CHAR_TYPE = 'CHAR'; + B_COLOR_8_BIT_TYPE = 'CLRB'; + B_DOUBLE_TYPE = 'DBLE'; + B_FLOAT_TYPE = 'FLOT'; + B_GRAYSCALE_8_BIT_TYPE = 'GRYB'; + B_INT64_TYPE = 'LLNG'; + B_INT32_TYPE = 'LONG'; + B_INT16_TYPE = 'SHRT'; + B_INT8_TYPE = 'BYTE'; + B_MESSAGE_TYPE = 'MSGG'; + B_MESSENGER_TYPE = 'MSNG'; + B_MIME_TYPE = 'MIME'; + B_MONOCHROME_1_BIT_TYPE = 'MNOB'; + B_OBJECT_TYPE = 'OPTR'; + B_OFF_T_TYPE = 'OFFT'; + B_PATTERN_TYPE = 'PATN'; + B_POINTER_TYPE = 'PNTR'; + B_POINT_TYPE = 'BPNT'; + B_RAW_TYPE = 'RAWT'; + B_RECT_TYPE = 'RECT'; + B_REF_TYPE = 'RREF'; + B_RGB_32_BIT_TYPE = 'RGBB'; + B_RGB_COLOR_TYPE = 'RGBC'; + B_SIZE_T_TYPE = 'SIZT'; + B_SSIZE_T_TYPE = 'SSZT'; + B_STRING_TYPE = 'CSTR'; + B_TIME_TYPE = 'TIME'; + B_UINT64_TYPE = 'ULLG'; + B_UINT32_TYPE = 'ULNG'; + B_UINT16_TYPE = 'USHT'; + B_UINT8_TYPE = 'UBYT'; + B_MEDIA_PARAMETER_TYPE = 'BMCT'; + B_MEDIA_PARAMETER_WEB_TYPE = 'BMCW'; + B_MEDIA_PARAMETER_GROUP_TYPE= 'BMCG'; + B_ATOM_TYPE = 'ATOM'; + B_ATOMREF_TYPE = 'ATMR'; + // deprecated, do not use + B_ASCII_TYPE = 'TEXT'; // use B_STRING_TYPE instead + +implementation + +end. \ No newline at end of file diff --git a/bepascal/source/bepascal/pas/src/hey/hei.pp b/bepascal/source/bepascal/pas/src/hey/hei.pp new file mode 100644 index 0000000..12179eb --- /dev/null +++ b/bepascal/source/bepascal/pas/src/hey/hei.pp @@ -0,0 +1,46 @@ +unit hei; + +interface + +uses + beobj, Messenger, Message, SupportDefs, Roster; + +function Hey(atarget : TMessenger; aarg : string; areply : TMessage) : TStatus_t; + +implementation + +function Hey2(target : TCPlusObject; arg : PChar; reply : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'Hey__FP10BMessengerPCcP8BMessage';//'Hey__FP10BMessengerPPcPllP8BMessage'; + +function Hey(atarget : TMessenger; aarg : string; areply : TMessage) : TStatus_t; +var + local : string; +begin + local := aarg + #0; + Result := Hey2(atarget.CPlusObject, @local[1], areply.CPlusObject); +end; + +var + List : TList; +begin + List := TList.Create; + try + be_roster.GetAppList(List); + SendText(IntToStr(List.CountItems)); + for i := 0 to List.CountItems - 1 do + begin + SendText('begin'); + Team_id := TTeam_id(List.ItemAt(i)); + SendText(' ' + IntToStr(Team_id)); + be_roster.GetRunningAppInfo(Team_id, AppInfo); + SendText(' ' + PChar(AppInfo.Signature)); + SendText(' ' + IntToStr(AppInfo.team)); + SendText(' ' + AppInfo.ref.name); + SendText('end'); + end; + finally + List.Free; + end; +end; + + +end.