From e00969c6e6a12d68caa6f991dfdae6aefe59c1c8 Mon Sep 17 00:00:00 2001 From: jetsoni Date: Sun, 21 Dec 2003 21:14:31 +0000 Subject: [PATCH] Removed old source tree. --- bepascal/bepascal/Jamfile | 151 - bepascal/bepascal/be/AppKit.cpp | 25 - bepascal/bepascal/be/Be.cpp | 24 - bepascal/bepascal/be/app/Application.cpp | 170 - bepascal/bepascal/be/app/Clipboard.cpp | 273 -- bepascal/bepascal/be/app/Handler.cpp | 78 - bepascal/bepascal/be/app/Invoker.cpp | 352 -- bepascal/bepascal/be/app/Looper.cpp | 131 - bepascal/bepascal/be/app/Message.cpp | 2273 ----------- bepascal/bepascal/be/app/Messenger.cpp | 280 -- bepascal/bepascal/be/app/Roster.cpp | 744 ---- bepascal/bepascal/be/app/appdefs.pp | 302 -- bepascal/bepascal/be/app/application.h | 56 - bepascal/bepascal/be/app/application.pp | 182 - bepascal/bepascal/be/app/handler.h | 41 - bepascal/bepascal/be/app/handler.pp | 80 - bepascal/bepascal/be/app/invoker.pp | 271 -- bepascal/bepascal/be/app/looper.h | 46 - bepascal/bepascal/be/app/looper.pp | 103 - bepascal/bepascal/be/app/message.h | 38 - bepascal/bepascal/be/app/message.pp | 281 -- bepascal/bepascal/be/app/messenger.pp | 249 -- bepascal/bepascal/be/app/roster.h | 24 - bepascal/bepascal/be/app/roster.pp | 340 -- bepascal/bepascal/be/bepas_kernel/beobj.cpp | 51 - bepascal/bepascal/be/bepas_kernel/beobj.h | 38 - bepascal/bepascal/be/bepas_kernel/beobj.pp | 126 - bepascal/bepascal/be/device/Joystick.cpp | 419 --- bepascal/bepascal/be/device/Joystick.pp | 220 -- bepascal/bepascal/be/device/SerialPort.cpp | 441 --- bepascal/bepascal/be/device/serialport.pp | 277 -- bepascal/bepascal/be/hey/hey.cpp | 1340 ------- bepascal/bepascal/be/hey/hey.h | 21 - bepascal/bepascal/be/hey/hey.pp | 70 - bepascal/bepascal/be/interface/Alert.cpp | 534 --- bepascal/bepascal/be/interface/Bitmap.cpp | 809 ---- bepascal/bepascal/be/interface/Box.cpp | 676 ---- bepascal/bepascal/be/interface/Button.cpp | 686 ---- bepascal/bepascal/be/interface/CheckBox.cpp | 627 ---- bepascal/bepascal/be/interface/Control.cpp | 560 --- bepascal/bepascal/be/interface/Font.cpp | 692 ---- bepascal/bepascal/be/interface/ListItem.cpp | 503 --- bepascal/bepascal/be/interface/ListView.cpp | 1031 ----- bepascal/bepascal/be/interface/Menu.cpp | 925 ----- bepascal/bepascal/be/interface/MenuBar.cpp | 642 ---- bepascal/bepascal/be/interface/MenuItem.cpp | 433 --- .../bepascal/be/interface/OutlineListView.cpp | 755 ---- bepascal/bepascal/be/interface/Point.cpp | 84 - .../bepascal/be/interface/RadioButton.cpp | 628 ---- bepascal/bepascal/be/interface/Rect.cpp | 84 - bepascal/bepascal/be/interface/ScrollBar.cpp | 635 ---- bepascal/bepascal/be/interface/ScrollView.cpp | 592 --- bepascal/bepascal/be/interface/StatusBar.cpp | 657 ---- bepascal/bepascal/be/interface/StringView.cpp | 552 --- bepascal/bepascal/be/interface/TabView.cpp | 1180 ------ .../bepascal/be/interface/TextControl.cpp | 807 ---- bepascal/bepascal/be/interface/TextView.cpp | 1684 --------- bepascal/bepascal/be/interface/View.cpp | 542 --- bepascal/bepascal/be/interface/Window.cpp | 2103 ----------- bepascal/bepascal/be/interface/alert.pp | 317 -- bepascal/bepascal/be/interface/bitmap.pp | 550 --- bepascal/bepascal/be/interface/box.pp | 360 -- bepascal/bepascal/be/interface/button.pp | 330 -- bepascal/bepascal/be/interface/checkbox.pp | 262 -- bepascal/bepascal/be/interface/control.h | 51 - bepascal/bepascal/be/interface/control.pp | 366 -- bepascal/bepascal/be/interface/font.h | 33 - bepascal/bepascal/be/interface/font.pp | 494 --- bepascal/bepascal/be/interface/graphicdefs.pp | 314 -- .../bepascal/be/interface/interfacedefs.pp | 60 - bepascal/bepascal/be/interface/listitem.pp | 352 -- bepascal/bepascal/be/interface/listview.h | 79 - bepascal/bepascal/be/interface/listview.pp | 548 --- bepascal/bepascal/be/interface/menu.h | 43 - bepascal/bepascal/be/interface/menu.pp | 1945 ---------- bepascal/bepascal/be/interface/menubar.h | 43 - bepascal/bepascal/be/interface/menubar.pp | 350 -- bepascal/bepascal/be/interface/menuitem.h | 51 - .../bepascal/be/interface/outlinelistview.pp | 357 -- bepascal/bepascal/be/interface/point.h | 34 - bepascal/bepascal/be/interface/point.pp.arch | 72 - bepascal/bepascal/be/interface/radiobutton.pp | 270 -- bepascal/bepascal/be/interface/rect.h | 37 - bepascal/bepascal/be/interface/rect.pp | 144 - bepascal/bepascal/be/interface/scrollbar.pp | 284 -- bepascal/bepascal/be/interface/scrollview.pp | 259 -- bepascal/bepascal/be/interface/statusbar.pp | 303 -- bepascal/bepascal/be/interface/stringview.pp | 262 -- bepascal/bepascal/be/interface/tabview.pp | 603 --- bepascal/bepascal/be/interface/textcontrol.pp | 434 --- bepascal/bepascal/be/interface/textview.pp | 850 ----- bepascal/bepascal/be/interface/view.h | 78 - bepascal/bepascal/be/interface/view.pp | 519 --- bepascal/bepascal/be/interface/window.h | 46 - bepascal/bepascal/be/interface/window.pp | 1367 ------- bepascal/bepascal/be/kernel/os.pp | 92 - bepascal/bepascal/be/mail/E-mail.cpp | 277 -- bepascal/bepascal/be/mail/Email.pp | 125 - bepascal/bepascal/be/storage/Volume.cpp | 398 -- bepascal/bepascal/be/storage/Volume.pp | 169 - bepascal/bepascal/be/storage/VolumeRoster.cpp | 121 - bepascal/bepascal/be/storage/VolumeRoster.pp | 95 - bepascal/bepascal/be/storage/entry.pp | 35 - bepascal/bepascal/be/storage/storagedefs.pp | 52 - bepascal/bepascal/be/support/Archivable.cpp | 115 - bepascal/bepascal/be/support/BString.pp | 510 --- bepascal/bepascal/be/support/DataIO.cpp | 385 -- bepascal/bepascal/be/support/Flattenable.cpp | 89 - bepascal/bepascal/be/support/List.cpp | 346 -- bepascal/bepascal/be/support/String.cpp | 1751 --------- bepascal/bepascal/be/support/_beep.pp | 32 - bepascal/bepascal/be/support/archivable.h | 42 - bepascal/bepascal/be/support/archivable.pp | 53 - bepascal/bepascal/be/support/bstring.pp | 510 --- bepascal/bepascal/be/support/dataio.pp | 629 ---- bepascal/bepascal/be/support/flattenable.pp | 96 - bepascal/bepascal/be/support/list.pp | 187 - bepascal/bepascal/be/support/supportdefs.pp | 49 - bepascal/bepascal/be/support/typeconstants.pp | 67 - bepascal/bepascal/bepascal/bepascal.proj | Bin 21311 -> 0 bytes bepascal/bepascal/codegen/README | 2 - bepascal/bepascal/codegen/apireader.pp | 642 ---- bepascal/bepascal/codegen/codegen.pp | 54 - bepascal/bepascal/codegen/codewrite.pp | 80 - bepascal/bepascal/codegen/hooks.xml | 396 -- bepascal/bepascal/codegen/sourcewrite.pp | 140 - bepascal/bepascal/codegen/typemap.txt | 93 - bepascal/bepascal/codegen/typmap.pp | 51 - bepascal/bepascal/headertoxml/README | 4 - bepascal/bepascal/headertoxml/headertoxml.pp | 221 -- bepascal/bepascal/hookgen/README.txt | 32 - bepascal/bepascal/hookgen/hookgen.pp | 704 ---- bepascal/bepascal/hookgen/hooks.xml | 592 --- bepascal/bepascal/hookgen/typemap.txt | 26 - bepascal/bepascal/hookgen/typenum.pp | 48 - bepascal/bepascal/makefile | 166 - bepascal/bepascal/stubgen.so/COPYING | 340 -- .../stubgen.so/Example Usage for OpenBeOS.txt | 3 - bepascal/bepascal/stubgen.so/Makefile | 90 - bepascal/bepascal/stubgen.so/README | 147 - bepascal/bepascal/stubgen.so/README.fpc | 3 - bepascal/bepascal/stubgen.so/getopt.c | 826 ---- bepascal/bepascal/stubgen.so/getopt.h | 130 - bepascal/bepascal/stubgen.so/lex.yy.c | 2652 ------------- bepascal/bepascal/stubgen.so/lexer.l | 522 --- bepascal/bepascal/stubgen.so/lib.c | 2 - bepascal/bepascal/stubgen.so/main.c | 736 ---- bepascal/bepascal/stubgen.so/parser.y | 1784 --------- bepascal/bepascal/stubgen.so/pathname.c | 86 - bepascal/bepascal/stubgen.so/pathname.h | 70 - bepascal/bepascal/stubgen.so/stubgen.pp | 49 - .../stubgen.so/stubgen_proj/stubgen.proj | Bin 12807 -> 0 bytes bepascal/bepascal/stubgen.so/table.c | 441 --- bepascal/bepascal/stubgen.so/table.h | 119 - bepascal/bepascal/stubgen.so/util.c | 147 - bepascal/bepascal/stubgen.so/util.h | 63 - bepascal/bepascal/stubgen.so/y.tab.c | 3309 ----------------- bepascal/bepascal/stubgen.so/y.tab.h | 60 - bepascal/bepascal/stubgen/COPYING | 340 -- .../stubgen/Example Usage for OpenBeOS.txt | 3 - bepascal/bepascal/stubgen/Makefile | 90 - bepascal/bepascal/stubgen/README | 147 - bepascal/bepascal/stubgen/getopt.c | 826 ---- bepascal/bepascal/stubgen/getopt.h | 130 - bepascal/bepascal/stubgen/lex.yy.c | 2652 ------------- bepascal/bepascal/stubgen/lexer.l | 522 --- bepascal/bepascal/stubgen/main.c | 888 ----- bepascal/bepascal/stubgen/parser.y | 1784 --------- bepascal/bepascal/stubgen/pathname.c | 86 - bepascal/bepascal/stubgen/pathname.h | 70 - bepascal/bepascal/stubgen/table.c | 498 --- bepascal/bepascal/stubgen/table.h | 121 - bepascal/bepascal/stubgen/util.c | 147 - bepascal/bepascal/stubgen/util.h | 63 - bepascal/bepascal/stubgen/y.tab.c | 3309 ----------------- bepascal/bepascal/stubgen/y.tab.h | 60 - bepascal/bepascal/test_app/hello.pp | 198 - bepascal/bepascal/test_app/test.pp | 40 - bepascal/bepascal/test_app/toto.pp | 30 - 179 files changed, 73464 deletions(-) delete mode 100644 bepascal/bepascal/Jamfile delete mode 100644 bepascal/bepascal/be/AppKit.cpp delete mode 100644 bepascal/bepascal/be/Be.cpp delete mode 100644 bepascal/bepascal/be/app/Application.cpp delete mode 100644 bepascal/bepascal/be/app/Clipboard.cpp delete mode 100644 bepascal/bepascal/be/app/Handler.cpp delete mode 100644 bepascal/bepascal/be/app/Invoker.cpp delete mode 100644 bepascal/bepascal/be/app/Looper.cpp delete mode 100644 bepascal/bepascal/be/app/Message.cpp delete mode 100644 bepascal/bepascal/be/app/Messenger.cpp delete mode 100644 bepascal/bepascal/be/app/Roster.cpp delete mode 100644 bepascal/bepascal/be/app/appdefs.pp delete mode 100644 bepascal/bepascal/be/app/application.h delete mode 100644 bepascal/bepascal/be/app/application.pp delete mode 100644 bepascal/bepascal/be/app/handler.h delete mode 100644 bepascal/bepascal/be/app/handler.pp delete mode 100644 bepascal/bepascal/be/app/invoker.pp delete mode 100644 bepascal/bepascal/be/app/looper.h delete mode 100644 bepascal/bepascal/be/app/looper.pp delete mode 100644 bepascal/bepascal/be/app/message.h delete mode 100644 bepascal/bepascal/be/app/message.pp delete mode 100644 bepascal/bepascal/be/app/messenger.pp delete mode 100644 bepascal/bepascal/be/app/roster.h delete mode 100644 bepascal/bepascal/be/app/roster.pp delete mode 100644 bepascal/bepascal/be/bepas_kernel/beobj.cpp delete mode 100644 bepascal/bepascal/be/bepas_kernel/beobj.h delete mode 100644 bepascal/bepascal/be/bepas_kernel/beobj.pp delete mode 100644 bepascal/bepascal/be/device/Joystick.cpp delete mode 100644 bepascal/bepascal/be/device/Joystick.pp delete mode 100644 bepascal/bepascal/be/device/SerialPort.cpp delete mode 100644 bepascal/bepascal/be/device/serialport.pp delete mode 100644 bepascal/bepascal/be/hey/hey.cpp delete mode 100644 bepascal/bepascal/be/hey/hey.h delete mode 100644 bepascal/bepascal/be/hey/hey.pp delete mode 100644 bepascal/bepascal/be/interface/Alert.cpp delete mode 100644 bepascal/bepascal/be/interface/Bitmap.cpp delete mode 100644 bepascal/bepascal/be/interface/Box.cpp delete mode 100644 bepascal/bepascal/be/interface/Button.cpp delete mode 100644 bepascal/bepascal/be/interface/CheckBox.cpp delete mode 100644 bepascal/bepascal/be/interface/Control.cpp delete mode 100644 bepascal/bepascal/be/interface/Font.cpp delete mode 100644 bepascal/bepascal/be/interface/ListItem.cpp delete mode 100644 bepascal/bepascal/be/interface/ListView.cpp delete mode 100644 bepascal/bepascal/be/interface/Menu.cpp delete mode 100644 bepascal/bepascal/be/interface/MenuBar.cpp delete mode 100644 bepascal/bepascal/be/interface/MenuItem.cpp delete mode 100644 bepascal/bepascal/be/interface/OutlineListView.cpp delete mode 100644 bepascal/bepascal/be/interface/Point.cpp delete mode 100644 bepascal/bepascal/be/interface/RadioButton.cpp delete mode 100644 bepascal/bepascal/be/interface/Rect.cpp delete mode 100644 bepascal/bepascal/be/interface/ScrollBar.cpp delete mode 100644 bepascal/bepascal/be/interface/ScrollView.cpp delete mode 100644 bepascal/bepascal/be/interface/StatusBar.cpp delete mode 100644 bepascal/bepascal/be/interface/StringView.cpp delete mode 100644 bepascal/bepascal/be/interface/TabView.cpp delete mode 100644 bepascal/bepascal/be/interface/TextControl.cpp delete mode 100644 bepascal/bepascal/be/interface/TextView.cpp delete mode 100644 bepascal/bepascal/be/interface/View.cpp delete mode 100644 bepascal/bepascal/be/interface/Window.cpp delete mode 100644 bepascal/bepascal/be/interface/alert.pp delete mode 100644 bepascal/bepascal/be/interface/bitmap.pp delete mode 100644 bepascal/bepascal/be/interface/box.pp delete mode 100644 bepascal/bepascal/be/interface/button.pp delete mode 100644 bepascal/bepascal/be/interface/checkbox.pp delete mode 100644 bepascal/bepascal/be/interface/control.h delete mode 100644 bepascal/bepascal/be/interface/control.pp delete mode 100644 bepascal/bepascal/be/interface/font.h delete mode 100644 bepascal/bepascal/be/interface/font.pp delete mode 100644 bepascal/bepascal/be/interface/graphicdefs.pp delete mode 100644 bepascal/bepascal/be/interface/interfacedefs.pp delete mode 100644 bepascal/bepascal/be/interface/listitem.pp delete mode 100644 bepascal/bepascal/be/interface/listview.h delete mode 100644 bepascal/bepascal/be/interface/listview.pp delete mode 100644 bepascal/bepascal/be/interface/menu.h delete mode 100644 bepascal/bepascal/be/interface/menu.pp delete mode 100644 bepascal/bepascal/be/interface/menubar.h delete mode 100644 bepascal/bepascal/be/interface/menubar.pp delete mode 100644 bepascal/bepascal/be/interface/menuitem.h delete mode 100644 bepascal/bepascal/be/interface/outlinelistview.pp delete mode 100644 bepascal/bepascal/be/interface/point.h delete mode 100644 bepascal/bepascal/be/interface/point.pp.arch delete mode 100644 bepascal/bepascal/be/interface/radiobutton.pp delete mode 100644 bepascal/bepascal/be/interface/rect.h delete mode 100644 bepascal/bepascal/be/interface/rect.pp delete mode 100644 bepascal/bepascal/be/interface/scrollbar.pp delete mode 100644 bepascal/bepascal/be/interface/scrollview.pp delete mode 100644 bepascal/bepascal/be/interface/statusbar.pp delete mode 100644 bepascal/bepascal/be/interface/stringview.pp delete mode 100644 bepascal/bepascal/be/interface/tabview.pp delete mode 100644 bepascal/bepascal/be/interface/textcontrol.pp delete mode 100644 bepascal/bepascal/be/interface/textview.pp delete mode 100644 bepascal/bepascal/be/interface/view.h delete mode 100644 bepascal/bepascal/be/interface/view.pp delete mode 100644 bepascal/bepascal/be/interface/window.h delete mode 100644 bepascal/bepascal/be/interface/window.pp delete mode 100644 bepascal/bepascal/be/kernel/os.pp delete mode 100644 bepascal/bepascal/be/mail/E-mail.cpp delete mode 100644 bepascal/bepascal/be/mail/Email.pp delete mode 100644 bepascal/bepascal/be/storage/Volume.cpp delete mode 100644 bepascal/bepascal/be/storage/Volume.pp delete mode 100644 bepascal/bepascal/be/storage/VolumeRoster.cpp delete mode 100644 bepascal/bepascal/be/storage/VolumeRoster.pp delete mode 100644 bepascal/bepascal/be/storage/entry.pp delete mode 100644 bepascal/bepascal/be/storage/storagedefs.pp delete mode 100644 bepascal/bepascal/be/support/Archivable.cpp delete mode 100644 bepascal/bepascal/be/support/BString.pp delete mode 100644 bepascal/bepascal/be/support/DataIO.cpp delete mode 100644 bepascal/bepascal/be/support/Flattenable.cpp delete mode 100644 bepascal/bepascal/be/support/List.cpp delete mode 100644 bepascal/bepascal/be/support/String.cpp delete mode 100644 bepascal/bepascal/be/support/_beep.pp delete mode 100644 bepascal/bepascal/be/support/archivable.h delete mode 100644 bepascal/bepascal/be/support/archivable.pp delete mode 100644 bepascal/bepascal/be/support/bstring.pp delete mode 100644 bepascal/bepascal/be/support/dataio.pp delete mode 100644 bepascal/bepascal/be/support/flattenable.pp delete mode 100644 bepascal/bepascal/be/support/list.pp delete mode 100644 bepascal/bepascal/be/support/supportdefs.pp delete mode 100644 bepascal/bepascal/be/support/typeconstants.pp delete mode 100644 bepascal/bepascal/bepascal/bepascal.proj delete mode 100644 bepascal/bepascal/codegen/README delete mode 100644 bepascal/bepascal/codegen/apireader.pp delete mode 100644 bepascal/bepascal/codegen/codegen.pp delete mode 100644 bepascal/bepascal/codegen/codewrite.pp delete mode 100644 bepascal/bepascal/codegen/hooks.xml delete mode 100644 bepascal/bepascal/codegen/sourcewrite.pp delete mode 100644 bepascal/bepascal/codegen/typemap.txt delete mode 100644 bepascal/bepascal/codegen/typmap.pp delete mode 100644 bepascal/bepascal/headertoxml/README delete mode 100644 bepascal/bepascal/headertoxml/headertoxml.pp delete mode 100644 bepascal/bepascal/hookgen/README.txt delete mode 100644 bepascal/bepascal/hookgen/hookgen.pp delete mode 100644 bepascal/bepascal/hookgen/hooks.xml delete mode 100644 bepascal/bepascal/hookgen/typemap.txt delete mode 100644 bepascal/bepascal/hookgen/typenum.pp delete mode 100644 bepascal/bepascal/makefile delete mode 100644 bepascal/bepascal/stubgen.so/COPYING delete mode 100644 bepascal/bepascal/stubgen.so/Example Usage for OpenBeOS.txt delete mode 100644 bepascal/bepascal/stubgen.so/Makefile delete mode 100644 bepascal/bepascal/stubgen.so/README delete mode 100644 bepascal/bepascal/stubgen.so/README.fpc delete mode 100644 bepascal/bepascal/stubgen.so/getopt.c delete mode 100644 bepascal/bepascal/stubgen.so/getopt.h delete mode 100644 bepascal/bepascal/stubgen.so/lex.yy.c delete mode 100644 bepascal/bepascal/stubgen.so/lexer.l delete mode 100644 bepascal/bepascal/stubgen.so/lib.c delete mode 100644 bepascal/bepascal/stubgen.so/main.c delete mode 100644 bepascal/bepascal/stubgen.so/parser.y delete mode 100644 bepascal/bepascal/stubgen.so/pathname.c delete mode 100644 bepascal/bepascal/stubgen.so/pathname.h delete mode 100644 bepascal/bepascal/stubgen.so/stubgen.pp delete mode 100644 bepascal/bepascal/stubgen.so/stubgen_proj/stubgen.proj delete mode 100644 bepascal/bepascal/stubgen.so/table.c delete mode 100644 bepascal/bepascal/stubgen.so/table.h delete mode 100644 bepascal/bepascal/stubgen.so/util.c delete mode 100644 bepascal/bepascal/stubgen.so/util.h delete mode 100644 bepascal/bepascal/stubgen.so/y.tab.c delete mode 100644 bepascal/bepascal/stubgen.so/y.tab.h delete mode 100644 bepascal/bepascal/stubgen/COPYING delete mode 100644 bepascal/bepascal/stubgen/Example Usage for OpenBeOS.txt delete mode 100644 bepascal/bepascal/stubgen/Makefile delete mode 100644 bepascal/bepascal/stubgen/README delete mode 100644 bepascal/bepascal/stubgen/getopt.c delete mode 100644 bepascal/bepascal/stubgen/getopt.h delete mode 100644 bepascal/bepascal/stubgen/lex.yy.c delete mode 100644 bepascal/bepascal/stubgen/lexer.l delete mode 100644 bepascal/bepascal/stubgen/main.c delete mode 100644 bepascal/bepascal/stubgen/parser.y delete mode 100644 bepascal/bepascal/stubgen/pathname.c delete mode 100644 bepascal/bepascal/stubgen/pathname.h delete mode 100644 bepascal/bepascal/stubgen/table.c delete mode 100644 bepascal/bepascal/stubgen/table.h delete mode 100644 bepascal/bepascal/stubgen/util.c delete mode 100644 bepascal/bepascal/stubgen/util.h delete mode 100644 bepascal/bepascal/stubgen/y.tab.c delete mode 100644 bepascal/bepascal/stubgen/y.tab.h delete mode 100644 bepascal/bepascal/test_app/hello.pp delete mode 100644 bepascal/bepascal/test_app/test.pp delete mode 100644 bepascal/bepascal/test_app/toto.pp diff --git a/bepascal/bepascal/Jamfile b/bepascal/bepascal/Jamfile deleted file mode 100644 index b42dbb1..0000000 --- a/bepascal/bepascal/Jamfile +++ /dev/null @@ -1,151 +0,0 @@ -## 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 = be/bepas_kernel/beobj.cpp - be/app/Application.cpp - be/app/Clipboard.cpp - be/app/Handler.cpp - be/app/Invoker.cpp - be/app/Looper.cpp - be/app/Message.cpp - be/app/Messenger.cpp - be/app/Roster.cpp - be/device/Joystick.cpp - be/device/SerialPort.cpp - be/hey/hey.cpp - be/interface/Alert.cpp - be/interface/Box.cpp - be/interface/Button.cpp - be/interface/CheckBox.cpp - be/interface/Control.cpp - be/interface/Font.cpp - be/interface/ListItem.cpp - be/interface/ListView.cpp - be/interface/Menu.cpp - be/interface/MenuBar.cpp - be/interface/MenuItem.cpp - be/interface/OutlineListView.cpp - be/interface/Point.cpp - be/interface/Rect.cpp - be/interface/RadioButton.cpp - be/interface/ScrollBar.cpp - be/interface/ScrollView.cpp - be/interface/StatusBar.cpp - be/interface/StringView.cpp - be/interface/TabView.cpp - be/interface/TextControl.cpp - be/interface/TextView.cpp - be/interface/View.cpp - be/interface/Window.cpp - be/mail/E-mail.cpp - be/storage/Volume.cpp - be/storage/VolumeRoster.cpp - be/support/Archivable.cpp - be/support/DataIO.cpp - be/support/Flattenable.cpp - be/support/List.cpp - be/support/String.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 = be/app - be/bepas_kernel - be/interface - be/support ; - -# 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 = NONE ; - -# 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 = "DEBUG" ; - -# Specify special warning levels -# if unspecified default warnings will be used -# NONE = supress all warnings -# ALL = enable all warnings -WARNINGS = ALL ; - -# Specify whether image symbols will be created -# so that stack crawls in the debugger are meaningful -# if TRUE symbols will be created -SYMBOLS = TRUE ; - -# Specify debug settings -# if TRUE will allow application to be run from a source-level -# debugger. Note that this will disable all optimzation. -DEBUGGER = TRUE ; - -# 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/bepascal/be/AppKit.cpp b/bepascal/bepascal/be/AppKit.cpp deleted file mode 100644 index e2869e9..0000000 --- a/bepascal/bepascal/be/AppKit.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* 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 _APPKIT_CPP_ -#define _APPKIT_CPP_ - -#include -#include - -#endif /* _APPKIT_CPP_ */ \ No newline at end of file diff --git a/bepascal/bepascal/be/Be.cpp b/bepascal/bepascal/be/Be.cpp deleted file mode 100644 index c879736..0000000 --- a/bepascal/bepascal/be/Be.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* 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 _BE_CPP_ -#define _BE_CPP_ - -#include - -#endif /* _BE_CPP_ */ \ No newline at end of file diff --git a/bepascal/bepascal/be/app/Application.cpp b/bepascal/bepascal/be/app/Application.cpp deleted file mode 100644 index 711bdeb..0000000 --- a/bepascal/bepascal/be/app/Application.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* 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(); -} - - - -#if defined(__cplusplus) -} -#endif - -#endif /* _APPLICATION_CPP_ */ \ No newline at end of file diff --git a/bepascal/bepascal/be/app/Clipboard.cpp b/bepascal/bepascal/be/app/Clipboard.cpp deleted file mode 100644 index 548832a..0000000 --- a/bepascal/bepascal/be/app/Clipboard.cpp +++ /dev/null @@ -1,273 +0,0 @@ -#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/bepascal/be/app/Handler.cpp b/bepascal/bepascal/be/app/Handler.cpp deleted file mode 100644 index 1ab1574..0000000 --- a/bepascal/bepascal/be/app/Handler.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* 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/bepascal/be/app/Invoker.cpp b/bepascal/bepascal/be/app/Invoker.cpp deleted file mode 100644 index 97a71ac..0000000 --- a/bepascal/bepascal/be/app/Invoker.cpp +++ /dev/null @@ -1,352 +0,0 @@ -#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/bepascal/be/app/Looper.cpp b/bepascal/bepascal/be/app/Looper.cpp deleted file mode 100644 index 2c9d04e..0000000 --- a/bepascal/bepascal/be/app/Looper.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* 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/bepascal/be/app/Message.cpp b/bepascal/bepascal/be/app/Message.cpp deleted file mode 100644 index 346f69e..0000000 --- a/bepascal/bepascal/be/app/Message.cpp +++ /dev/null @@ -1,2273 +0,0 @@ -/* 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(BMessage *message) -{ - return message->what; -} - -void BMessage_Setwhat(BMessage *message, uint32 what) -{ - 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); -} - -/*********************************************************************** - * Method: BMessage::GetInfo - * Params: type_code typeRequested, int32 which, char **name, type_code *typeReturned, int32 *count - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_GetInfo(BMessage *Message, type_code typeRequested, int32 which, char **name, type_code *typeReturned, int32 *count) -{ - return Message->GetInfo(typeRequested, which, name, typeReturned, count); -} - - -/*********************************************************************** - * Method: BMessage::GetInfo - * Params: const char *name, type_code *type, int32 *c - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_GetInfo_1 -(BMessage *Message, const char *name, type_code *type, int32 *c) -{ - return Message->GetInfo(name, type, c); -} - - -/*********************************************************************** - * Method: BMessage::GetInfo - * Params: const char *name, type_code *type, bool *fixed_size - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_GetInfo_2 -(BMessage *Message, const char *name, type_code *type, bool *fixed_size) -{ - return Message->GetInfo(name, type, fixed_size); -} - - -/*********************************************************************** - * Method: BMessage::CountNames - * Params: type_code type - * Returns: int32 - * Effects: - ***********************************************************************/ -int32 -BMessage_CountNames(BMessage *Message, type_code type) -{ - return Message->CountNames(type); -} - - -/*********************************************************************** - * Method: BMessage::IsEmpty - * Params: - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_IsEmpty(BMessage *Message) -{ - return Message->IsEmpty(); -} - - -/*********************************************************************** - * Method: BMessage::IsSystem - * Params: - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_IsSystem(BMessage *Message) -{ - return Message->IsSystem(); -} - - -/*********************************************************************** - * Method: BMessage::IsReply - * Params: - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_IsReply(BMessage *Message) -{ - return Message->IsReply(); -} - - -/*********************************************************************** - * Method: BMessage::PrintToStream - * Params: - * Returns: void - * Effects: - ***********************************************************************/ -void -BMessage_PrintToStream(BMessage *Message) -{ - Message->PrintToStream(); -} - - -/*********************************************************************** - * Method: BMessage::Rename - * Params: const char *old_entry, const char *new_entry - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_Rename(BMessage *Message, const char *old_entry, const char *new_entry) -{ - return Message->Rename(old_entry, new_entry); -} - - -/*********************************************************************** - * Method: BMessage::WasDelivered - * Params: - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_WasDelivered(BMessage *Message) -{ - return Message->WasDelivered(); -} - - -/*********************************************************************** - * Method: BMessage::IsSourceWaiting - * Params: - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_IsSourceWaiting(BMessage *Message) -{ - return Message->IsSourceWaiting(); -} - - -/*********************************************************************** - * Method: BMessage::IsSourceRemote - * Params: - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_IsSourceRemote(BMessage *Message) -{ - return Message->IsSourceRemote(); -} - - -/*********************************************************************** - * Method: BMessage::ReturnAddress - * Params: - * Returns: BMessenger - * Effects: - ***********************************************************************/ -BMessenger -BMessage_ReturnAddress(BMessage *Message) -{ - return Message->ReturnAddress(); -} - - -/*********************************************************************** - * Method: BMessage::Previous - * Params: - * Returns: const BMessage * - * Effects: - ***********************************************************************/ -const BMessage * -BMessage_Previous(BMessage *Message) -{ - return Message->Previous(); -} - - -/*********************************************************************** - * Method: BMessage::WasDropped - * Params: - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_WasDropped(BMessage *Message) -{ - return Message->WasDropped(); -} - - -/*********************************************************************** - * Method: BMessage::DropPoint - * Params: BPoint *offset - * Returns: BPoint - * Effects: - ***********************************************************************/ -BPoint -BMessage_DropPoint(BMessage *Message, BPoint *offset) -{ - return Message->DropPoint(offset); -} - - -/*********************************************************************** - * Method: BMessage::SendReply - * Params: uint32 command, BHandler *reply_to - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_SendReply(BMessage *Message, uint32 command, BHandler *reply_to) -{ - return Message->SendReply(command, reply_to); -} - - -/*********************************************************************** - * Method: BMessage::SendReply - * Params: BMessage *the_reply, BHandler *reply_to, bigtime_t timeout - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_SendReply_1 -(BMessage *Message, BMessage *the_reply, BHandler *reply_to, bigtime_t timeout) -{ - return Message->SendReply(the_reply, reply_to, timeout); -} - - -/*********************************************************************** - * Method: BMessage::SendReply - * Params: BMessage *the_reply, BMessenger reply_to, bigtime_t timeout - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_SendReply_2 -(BMessage *Message, BMessage *the_reply, BMessenger reply_to, bigtime_t timeout) -{ - return Message->SendReply(the_reply, reply_to, timeout); -} - - -/*********************************************************************** - * Method: BMessage::SendReply - * Params: uint32 command, BMessage *reply_to_reply - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_SendReply_3 -(BMessage *Message, uint32 command, BMessage *reply_to_reply) -{ - return Message->SendReply(command, reply_to_reply); -} - - -/*********************************************************************** - * Method: BMessage::SendReply - * Params: BMessage *the_reply, BMessage *reply_to_reply, bigtime_t send_timeout, bigtime_t reply_timeout - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_SendReply_4 -(BMessage *Message, BMessage *the_reply, BMessage *reply_to_reply, bigtime_t send_timeout, bigtime_t reply_timeout) -{ - return Message->SendReply(the_reply, reply_to_reply, send_timeout, reply_timeout); -} - - -/*********************************************************************** - * Method: BMessage::FlattenedSize - * Params: - * Returns: ssize_t - * Effects: - ***********************************************************************/ -ssize_t -BMessage_FlattenedSize(BMessage *Message) -{ - return Message->FlattenedSize(); -} - - -/*********************************************************************** - * Method: BMessage::Flatten - * Params: char *buffer, ssize_t size - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_Flatten(BMessage *Message, char *buffer, ssize_t size) -{ - return Message->Flatten(buffer, size); -} - - -/*********************************************************************** - * Method: BMessage::Flatten - * Params: BDataIO *stream, ssize_t *size - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_Flatten_1 -(BMessage *Message, BDataIO *stream, ssize_t *size) -{ - return Message->Flatten(stream, size); -} - - -/*********************************************************************** - * Method: BMessage::Unflatten - * Params: const char *flat_buffer - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_Unflatten(BMessage *Message, const char *flat_buffer) -{ - return Message->Unflatten(flat_buffer); -} - - -/*********************************************************************** - * Method: BMessage::Unflatten - * Params: BDataIO *stream - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_Unflatten_1 -(BMessage *Message, BDataIO *stream) -{ - return Message->Unflatten(stream); -} - - -/*********************************************************************** - * Method: BMessage::AddSpecifier - * Params: const char *property - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddSpecifier(BMessage *Message, const char *property) -{ - return Message->AddSpecifier(property); -} - - -/*********************************************************************** - * Method: BMessage::AddSpecifier - * Params: const char *property, int32 index - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddSpecifier_1 -(BMessage *Message, const char *property, int32 index) -{ - return Message->AddSpecifier(property, index); -} - - -/*********************************************************************** - * Method: BMessage::AddSpecifier - * Params: const char *property, int32 index, int32 range - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddSpecifier_2 -(BMessage *Message, const char *property, int32 index, int32 range) -{ - return Message->AddSpecifier(property, index, range); -} - - -/*********************************************************************** - * Method: BMessage::AddSpecifier - * Params: const char *property, const char *name - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddSpecifier_3 -(BMessage *Message, const char *property, const char *name) -{ - return Message->AddSpecifier(property, name); -} - - -/*********************************************************************** - * Method: BMessage::AddSpecifier - * Params: const BMessage *specifier - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddSpecifier_4 -(BMessage *Message, const BMessage *specifier) -{ - return Message->AddSpecifier(specifier); -} - - -/*********************************************************************** - * Method: BMessage::SetCurrentSpecifier - * Params: int32 index - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_SetCurrentSpecifier(BMessage *Message, int32 index) -{ - return Message->SetCurrentSpecifier(index); -} - - -/*********************************************************************** - * Method: BMessage::GetCurrentSpecifier - * Params: int32 *index, BMessage *specifier, int32 *form, const char **property - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_GetCurrentSpecifier(BMessage *Message, int32 *index, BMessage *specifier, int32 *form, const char **property) -{ - return Message->GetCurrentSpecifier(index, specifier, form, property); -} - - -/*********************************************************************** - * Method: BMessage::HasSpecifiers - * Params: - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasSpecifiers(BMessage *Message) -{ - return Message->HasSpecifiers(); -} - - -/*********************************************************************** - * Method: BMessage::PopSpecifier - * Params: - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_PopSpecifier(BMessage *Message) -{ - return Message->PopSpecifier(); -} - - -/*********************************************************************** - * Method: BMessage::AddRect - * Params: const char *name, BRect a_rect - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddRect(BMessage *Message, const char *name, BRect a_rect) -{ - return Message->AddRect(name, a_rect); -} - - -/*********************************************************************** - * Method: BMessage::AddPoint - * Params: const char *name, BPoint a_point - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddPoint(BMessage *Message, const char *name, BPoint a_point) -{ - return Message->AddPoint(name, a_point); -} - - -/*********************************************************************** - * Method: BMessage::AddString - * Params: const char *name, const char *a_string - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddString(BMessage *Message, const char *name, const char *a_string) -{ - return Message->AddString(name, a_string); -} - - -/*********************************************************************** - * Method: BMessage::AddString - * Params: const char *name, const BString &a_string - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddString_1 -(BMessage *Message, const char *name, const BString &a_string) -{ - return Message->AddString(name, a_string); -} - - -/*********************************************************************** - * Method: BMessage::AddInt8 - * Params: const char *name, int8 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddInt8(BMessage *Message, const char *name, int8 val) -{ - return Message->AddInt8(name, val); -} - - -/*********************************************************************** - * Method: BMessage::AddInt16 - * Params: const char *name, int16 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddInt16(BMessage *Message, const char *name, int16 val) -{ - return Message->AddInt16(name, val); -} - - -/*********************************************************************** - * Method: BMessage::AddInt32 - * Params: const char *name, int32 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddInt32(BMessage *Message, const char *name, int32 val) -{ - return Message->AddInt32(name, val); -} - - -/*********************************************************************** - * Method: BMessage::AddInt64 - * Params: const char *name, int64 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddInt64(BMessage *Message, const char *name, int64 val) -{ - return Message->AddInt64(name, val); -} - - -/*********************************************************************** - * Method: BMessage::AddBool - * Params: const char *name, bool a_boolean - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddBool(BMessage *Message, const char *name, bool a_boolean) -{ - return Message->AddBool(name, a_boolean); -} - - -/*********************************************************************** - * Method: BMessage::AddFloat - * Params: const char *name, float a_float - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddFloat(BMessage *Message, const char *name, float a_float) -{ - return Message->AddFloat(name, a_float); -} - - -/*********************************************************************** - * Method: BMessage::AddDouble - * Params: const char *name, double a_double - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddDouble(BMessage *Message, const char *name, double a_double) -{ - return Message->AddDouble(name, a_double); -} - - -/*********************************************************************** - * Method: BMessage::AddPointer - * Params: const char *name, const void *ptr - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddPointer(BMessage *Message, const char *name, const void *ptr) -{ - return Message->AddPointer(name, ptr); -} - - -/*********************************************************************** - * Method: BMessage::AddMessenger - * Params: const char *name, BMessenger messenger - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddMessenger(BMessage *Message, const char *name, BMessenger messenger) -{ - return Message->AddMessenger(name, messenger); -} - - -/*********************************************************************** - * Method: BMessage::AddRef - * Params: const char *name, const entry_ref *ref - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddRef(BMessage *Message, const char *name, const entry_ref *ref) -{ - return Message->AddRef(name, ref); -} - - -/*********************************************************************** - * Method: BMessage::AddMessage - * Params: const char *name, const BMessage *msg - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddMessage(BMessage *Message, const char *name, const BMessage *msg) -{ - return Message->AddMessage(name, msg); -} - - -/*********************************************************************** - * Method: BMessage::AddFlat - * Params: const char *name, BFlattenable *obj, int32 count - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddFlat(BMessage *Message, const char *name, BFlattenable *obj, int32 count) -{ - return Message->AddFlat(name, obj, count); -} - - -/*********************************************************************** - * Method: BMessage::AddData - * Params: const char *name, type_code type, const void *data, ssize_t numBytes, bool is_fixed_size, int32 count - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_AddData(BMessage *Message, const char *name, type_code type, const void *data, ssize_t numBytes, bool is_fixed_size, int32 count) -{ - return Message->AddData(name, type, data, numBytes, is_fixed_size, count); -} - - -/*********************************************************************** - * Method: BMessage::RemoveData - * Params: const char *name, int32 index - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_RemoveData(BMessage *Message, const char *name, int32 index) -{ - return Message->RemoveData(name, index); -} - - -/*********************************************************************** - * Method: BMessage::RemoveName - * Params: const char *name - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_RemoveName(BMessage *Message, const char *name) -{ - return Message->RemoveName(name); -} - - -/*********************************************************************** - * Method: BMessage::MakeEmpty - * Params: - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_MakeEmpty(BMessage *Message) -{ - return Message->MakeEmpty(); -} - - -/*********************************************************************** - * Method: BMessage::FindRect - * Params: const char *name, BRect *rect - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindRect(BMessage *Message, const char *name, BRect *rect) -{ - return Message->FindRect(name, rect); -} - - -/*********************************************************************** - * Method: BMessage::FindRect - * Params: const char *name, int32 index, BRect *rect - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindRect_1 -(BMessage *Message, const char *name, int32 index, BRect *rect) -{ - return Message->FindRect(name, index, rect); -} - - -/*********************************************************************** - * Method: BMessage::FindPoint - * Params: const char *name, BPoint *pt - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindPoint(BMessage *Message, const char *name, BPoint *pt) -{ - return Message->FindPoint(name, pt); -} - - -/*********************************************************************** - * Method: BMessage::FindPoint - * Params: const char *name, int32 index, BPoint *pt - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindPoint_1 -(BMessage *Message, const char *name, int32 index, BPoint *pt) -{ - return Message->FindPoint(name, index, pt); -} - - -/*********************************************************************** - * Method: BMessage::FindString - * Params: const char *name, const char **str - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindString(BMessage *Message, const char *name, const char **str) -{ - return Message->FindString(name, str); -} - - -/*********************************************************************** - * Method: BMessage::FindString - * Params: const char *name, int32 index, const char **str - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindString_1 -(BMessage *Message, const char *name, int32 index, const char **str) -{ - return Message->FindString(name, index, str); -} - - -/*********************************************************************** - * Method: BMessage::FindString - * Params: const char *name, BString *str - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindString_2 -(BMessage *Message, const char *name, BString *str) -{ - return Message->FindString(name, str); -} - - -/*********************************************************************** - * Method: BMessage::FindString - * Params: const char *name, int32 index, BString *str - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindString_3 -(BMessage *Message, const char *name, int32 index, BString *str) -{ - return Message->FindString(name, index, str); -} - - -/*********************************************************************** - * Method: BMessage::FindInt8 - * Params: const char *name, int8 *value - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindInt8(BMessage *Message, const char *name, int8 *value) -{ - return Message->FindInt8(name, value); -} - - -/*********************************************************************** - * Method: BMessage::FindInt8 - * Params: const char *name, int32 index, int8 *val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindInt8_1 -(BMessage *Message, const char *name, int32 index, int8 *val) -{ - return Message->FindInt8(name, index, val); -} - - -/*********************************************************************** - * Method: BMessage::FindInt16 - * Params: const char *name, int16 *value - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindInt16(BMessage *Message, const char *name, int16 *value) -{ - return Message->FindInt16(name, value); -} - - -/*********************************************************************** - * Method: BMessage::FindInt16 - * Params: const char *name, int32 index, int16 *val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindInt16_1 -(BMessage *Message, const char *name, int32 index, int16 *val) -{ - return Message->FindInt16(name, index, val); -} - - -/*********************************************************************** - * Method: BMessage::FindInt32 - * Params: const char *name, int32 *value - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindInt32(BMessage *Message, const char *name, int32 *value) -{ - return Message->FindInt32(name, value); -} - - -/*********************************************************************** - * Method: BMessage::FindInt32 - * Params: const char *name, int32 index, int32 *val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindInt32_1 -(BMessage *Message, const char *name, int32 index, int32 *val) -{ - return Message->FindInt32(name, index, val); -} - - -/*********************************************************************** - * Method: BMessage::FindInt64 - * Params: const char *name, int64 *value - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindInt64(BMessage *Message, const char *name, int64 *value) -{ - return Message->FindInt64(name, value); -} - - -/*********************************************************************** - * Method: BMessage::FindInt64 - * Params: const char *name, int32 index, int64 *val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindInt64_1 -(BMessage *Message, const char *name, int32 index, int64 *val) -{ - return Message->FindInt64(name, index, val); -} - - -/*********************************************************************** - * Method: BMessage::FindBool - * Params: const char *name, bool *value - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindBool(BMessage *Message, const char *name, bool *value) -{ - return Message->FindBool(name, value); -} - - -/*********************************************************************** - * Method: BMessage::FindBool - * Params: const char *name, int32 index, bool *value - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindBool_1 -(BMessage *Message, const char *name, int32 index, bool *value) -{ - return Message->FindBool(name, index, value); -} - - -/*********************************************************************** - * Method: BMessage::FindFloat - * Params: const char *name, float *f - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindFloat(BMessage *Message, const char *name, float *f) -{ - return Message->FindFloat(name, f); -} - - -/*********************************************************************** - * Method: BMessage::FindFloat - * Params: const char *name, int32 index, float *f - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindFloat_1 -(BMessage *Message, const char *name, int32 index, float *f) -{ - return Message->FindFloat(name, index, f); -} - - -/*********************************************************************** - * Method: BMessage::FindDouble - * Params: const char *name, double *d - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindDouble(BMessage *Message, const char *name, double *d) -{ - return Message->FindDouble(name, d); -} - - -/*********************************************************************** - * Method: BMessage::FindDouble - * Params: const char *name, int32 index, double *d - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindDouble_1 -(BMessage *Message, const char *name, int32 index, double *d) -{ - return Message->FindDouble(name, index, d); -} - - -/*********************************************************************** - * Method: BMessage::FindPointer - * Params: const char *name, void **ptr - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindPointer(BMessage *Message, const char *name, void **ptr) -{ - return Message->FindPointer(name, ptr); -} - - -/*********************************************************************** - * Method: BMessage::FindPointer - * Params: const char *name, int32 index, void **ptr - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindPointer_1 -(BMessage *Message, const char *name, int32 index, void **ptr) -{ - return Message->FindPointer(name, index, ptr); -} - - -/*********************************************************************** - * Method: BMessage::FindMessenger - * Params: const char *name, BMessenger *m - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindMessenger(BMessage *Message, const char *name, BMessenger *m) -{ - return Message->FindMessenger(name, m); -} - - -/*********************************************************************** - * Method: BMessage::FindMessenger - * Params: const char *name, int32 index, BMessenger *m - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindMessenger_1 -(BMessage *Message, const char *name, int32 index, BMessenger *m) -{ - return Message->FindMessenger(name, index, m); -} - - -/*********************************************************************** - * Method: BMessage::FindRef - * Params: const char *name, entry_ref *ref - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindRef(BMessage *Message, const char *name, entry_ref *ref) -{ - return Message->FindRef(name, ref); -} - - -/*********************************************************************** - * Method: BMessage::FindRef - * Params: const char *name, int32 index, entry_ref *ref - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindRef_1 -(BMessage *Message, const char *name, int32 index, entry_ref *ref) -{ - return Message->FindRef(name, index, ref); -} - - -/*********************************************************************** - * Method: BMessage::FindMessage - * Params: const char *name, BMessage *msg - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindMessage(BMessage *Message, const char *name, BMessage *msg) -{ - return Message->FindMessage(name, msg); -} - - -/*********************************************************************** - * Method: BMessage::FindMessage - * Params: const char *name, int32 index, BMessage *msg - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindMessage_1 -(BMessage *Message, const char *name, int32 index, BMessage *msg) -{ - return Message->FindMessage(name, index, msg); -} - - -/*********************************************************************** - * Method: BMessage::FindFlat - * Params: const char *name, BFlattenable *obj - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindFlat(BMessage *Message, const char *name, BFlattenable *obj) -{ - return Message->FindFlat(name, obj); -} - - -/*********************************************************************** - * Method: BMessage::FindFlat - * Params: const char *name, int32 index, BFlattenable *obj - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindFlat_1 -(BMessage *Message, const char *name, int32 index, BFlattenable *obj) -{ - return Message->FindFlat(name, index, obj); -} - - -/*********************************************************************** - * Method: BMessage::FindData - * Params: const char *name, type_code type, const void **data, ssize_t *numBytes - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindData(BMessage *Message, const char *name, type_code type, const void **data, ssize_t *numBytes) -{ - return Message->FindData(name, type, data, numBytes); -} - - -/*********************************************************************** - * Method: BMessage::FindData - * Params: const char *name, type_code type, int32 index, const void **data, ssize_t *numBytes - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_FindData_1 -(BMessage *Message, const char *name, type_code type, int32 index, const void **data, ssize_t *numBytes) -{ - return Message->FindData(name, type, index, data, numBytes); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceRect - * Params: const char *name, BRect a_rect - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceRect(BMessage *Message, const char *name, BRect a_rect) -{ - return Message->ReplaceRect(name, a_rect); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceRect - * Params: const char *name, int32 index, BRect a_rect - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceRect_1 -(BMessage *Message, const char *name, int32 index, BRect a_rect) -{ - return Message->ReplaceRect(name, index, a_rect); -} - - -/*********************************************************************** - * Method: BMessage::ReplacePoint - * Params: const char *name, BPoint a_point - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplacePoint(BMessage *Message, const char *name, BPoint a_point) -{ - return Message->ReplacePoint(name, a_point); -} - - -/*********************************************************************** - * Method: BMessage::ReplacePoint - * Params: const char *name, int32 index, BPoint a_point - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplacePoint_1 -(BMessage *Message, const char *name, int32 index, BPoint a_point) -{ - return Message->ReplacePoint(name, index, a_point); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceString - * Params: const char *name, const char *string - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceString(BMessage *Message, const char *name, const char *string) -{ - return Message->ReplaceString(name, string); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceString - * Params: const char *name, int32 index, const char *string - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceString_1 -(BMessage *Message, const char *name, int32 index, const char *string) -{ - return Message->ReplaceString(name, index, string); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceString - * Params: const char *name, const BString &string - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceString_2 -(BMessage *Message, const char *name, const BString &string) -{ - return Message->ReplaceString(name, string); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceString - * Params: const char *name, int32 index, const BString &string - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceString_3 -(BMessage *Message, const char *name, int32 index, const BString &string) -{ - return Message->ReplaceString(name, index, string); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceInt8 - * Params: const char *name, int8 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceInt8(BMessage *Message, const char *name, int8 val) -{ - return Message->ReplaceInt8(name, val); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceInt8 - * Params: const char *name, int32 index, int8 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceInt8_1 -(BMessage *Message, const char *name, int32 index, int8 val) -{ - return Message->ReplaceInt8(name, index, val); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceInt16 - * Params: const char *name, int16 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceInt16(BMessage *Message, const char *name, int16 val) -{ - return Message->ReplaceInt16(name, val); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceInt16 - * Params: const char *name, int32 index, int16 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceInt16_1 -(BMessage *Message, const char *name, int32 index, int16 val) -{ - return Message->ReplaceInt16(name, index, val); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceInt32 - * Params: const char *name, int32 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceInt32(BMessage *Message, const char *name, int32 val) -{ - return Message->ReplaceInt32(name, val); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceInt32 - * Params: const char *name, int32 index, int32 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceInt32_1 -(BMessage *Message, const char *name, int32 index, int32 val) -{ - return Message->ReplaceInt32(name, index, val); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceInt64 - * Params: const char *name, int64 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceInt64(BMessage *Message, const char *name, int64 val) -{ - return Message->ReplaceInt64(name, val); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceInt64 - * Params: const char *name, int32 index, int64 val - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceInt64_1 -(BMessage *Message, const char *name, int32 index, int64 val) -{ - return Message->ReplaceInt64(name, index, val); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceBool - * Params: const char *name, bool a_bool - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceBool(BMessage *Message, const char *name, bool a_bool) -{ - return Message->ReplaceBool(name, a_bool); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceBool - * Params: const char *name, int32 index, bool a_bool - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceBool_1 -(BMessage *Message, const char *name, int32 index, bool a_bool) -{ - return Message->ReplaceBool(name, index, a_bool); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceFloat - * Params: const char *name, float a_float - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceFloat(BMessage *Message, const char *name, float a_float) -{ - return Message->ReplaceFloat(name, a_float); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceFloat - * Params: const char *name, int32 index, float a_float - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceFloat_1 -(BMessage *Message, const char *name, int32 index, float a_float) -{ - return Message->ReplaceFloat(name, index, a_float); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceDouble - * Params: const char *name, double a_double - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceDouble(BMessage *Message, const char *name, double a_double) -{ - return Message->ReplaceDouble(name, a_double); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceDouble - * Params: const char *name, int32 index, double a_double - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceDouble_1 -(BMessage *Message, const char *name, int32 index, double a_double) -{ - return Message->ReplaceDouble(name, index, a_double); -} - - -/*********************************************************************** - * Method: BMessage::ReplacePointer - * Params: const char *name, const void *ptr - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplacePointer(BMessage *Message, const char *name, const void *ptr) -{ - return Message->ReplacePointer(name, ptr); -} - - -/*********************************************************************** - * Method: BMessage::ReplacePointer - * Params: const char *name, int32 index, const void *ptr - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplacePointer_1 -(BMessage *Message, const char *name, int32 index, const void *ptr) -{ - return Message->ReplacePointer(name, index, ptr); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceMessenger - * Params: const char *name, BMessenger messenger - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceMessenger(BMessage *Message, const char *name, BMessenger messenger) -{ - return Message->ReplaceMessenger(name, messenger); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceMessenger - * Params: const char *name, int32 index, BMessenger msngr - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceMessenger_1 -(BMessage *Message, const char *name, int32 index, BMessenger msngr) -{ - return Message->ReplaceMessenger(name, index, msngr); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceRef - * Params: const char *name, const entry_ref *ref - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceRef(BMessage *Message, const char *name, const entry_ref *ref) -{ - return Message->ReplaceRef(name, ref); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceRef - * Params: const char *name, int32 index, const entry_ref *ref - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceRef_1 -(BMessage *Message, const char *name, int32 index, const entry_ref *ref) -{ - return Message->ReplaceRef(name, index, ref); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceMessage - * Params: const char *name, const BMessage *msg - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceMessage(BMessage *Message, const char *name, const BMessage *msg) -{ - return Message->ReplaceMessage(name, msg); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceMessage - * Params: const char *name, int32 index, const BMessage *msg - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceMessage_1 -(BMessage *Message, const char *name, int32 index, const BMessage *msg) -{ - return Message->ReplaceMessage(name, index, msg); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceFlat - * Params: const char *name, BFlattenable *obj - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceFlat(BMessage *Message, const char *name, BFlattenable *obj) -{ - return Message->ReplaceFlat(name, obj); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceFlat - * Params: const char *name, int32 index, BFlattenable *obj - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceFlat_1 -(BMessage *Message, const char *name, int32 index, BFlattenable *obj) -{ - return Message->ReplaceFlat(name, index, obj); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceData - * Params: const char *name, type_code type, const void *data, ssize_t data_size - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceData(BMessage *Message, const char *name, type_code type, const void *data, ssize_t data_size) -{ - return Message->ReplaceData(name, type, data, data_size); -} - - -/*********************************************************************** - * Method: BMessage::ReplaceData - * Params: const char *name, type_code type, int32 index, const void *data, ssize_t data_size - * Returns: status_t - * Effects: - ***********************************************************************/ -status_t -BMessage_ReplaceData_1 -(BMessage *Message, const char *name, type_code type, int32 index, const void *data, ssize_t data_size) -{ - return Message->ReplaceData(name, type, index, data, data_size); -} - - -/*********************************************************************** - * Method: BMessage::operator new - * Params: size_t size - * Returns: void * - * Effects: - ***********************************************************************/ -/*void * -BMessage_operator new(BMessage *Message, size_t size) -{ - Message->operator new(size); -} -*/ - - -/*********************************************************************** - * Method: BMessage::operator delete - * Params: void *ptr, size_t size - * Returns: void - * Effects: - ***********************************************************************/ -/*void -BMessage_operator delete(BMessage *Message, void *ptr, size_t size) -{ - Message->operator delete(ptr, size); -} -*/ - -/*********************************************************************** - * Method: BMessage::HasRect - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasRect(BMessage *Message, const char *name, int32 n) -{ - return Message->HasRect(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasPoint - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasPoint(BMessage *Message, const char *name, int32 n) -{ - return Message->HasPoint(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasString - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasString(BMessage *Message, const char *name, int32 n) -{ - return Message->HasString(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasInt8 - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasInt8(BMessage *Message, const char *name, int32 n) -{ - return Message->HasInt8(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasInt16 - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasInt16(BMessage *Message, const char *name, int32 n) -{ - return Message->HasInt16(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasInt32 - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasInt32(BMessage *Message, const char *name, int32 n) -{ - return Message->HasInt32(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasInt64 - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasInt64(BMessage *Message, const char *name, int32 n) -{ - return Message->HasInt64(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasBool - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasBool(BMessage *Message, const char *name, int32 n) -{ - return Message->HasBool(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasFloat - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasFloat(BMessage *Message, const char *name, int32 n) -{ - return Message->HasFloat(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasDouble - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasDouble(BMessage *Message, const char *name, int32 n) -{ - return Message->HasDouble(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasPointer - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasPointer(BMessage *Message, const char *name, int32 n) -{ - return Message->HasPointer(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasMessenger - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasMessenger(BMessage *Message, const char *name, int32 n) -{ - return Message->HasMessenger(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasRef - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasRef(BMessage *Message, const char *name, int32 n) -{ - return Message->HasRef(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasMessage - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasMessage(BMessage *Message, const char *name, int32 n) -{ - return Message->HasMessage(name, n); -} - - -/*********************************************************************** - * Method: BMessage::HasFlat - * Params: const char *, const BFlattenable * - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasFlat(BMessage *Message, const char *name, const BFlattenable *flatten) -{ - return Message->HasFlat(name, flatten); -} - - -/*********************************************************************** - * Method: BMessage::HasFlat - * Params: const char *, int32, const BFlattenable * - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasFlat_1 -(BMessage *Message, const char *name, int32 index, const BFlattenable *flatten) -{ - return Message->HasFlat(name, index, flatten); -} - - -/*********************************************************************** - * Method: BMessage::HasData - * Params: const char *, type_code, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_HasData(BMessage *Message, const char *name, type_code code, int32 n) -{ - return Message->HasData(name, code, n); -} - - -/*********************************************************************** - * Method: BMessage::FindRect - * Params: const char *, int32 n - * Returns: BRect - * Effects: - ***********************************************************************/ -BRect -BMessage_FindRect_2(BMessage *Message, const char *name, int32 n) -{ - return Message->FindRect(name, n); -} - - -/*********************************************************************** - * Method: BMessage::FindPoint - * Params: const char *, int32 n - * Returns: BPoint - * Effects: - ***********************************************************************/ -BPoint -BMessage_FindPoint_2(BMessage *Message, const char *name, int32 n) -{ - return Message->FindPoint(name, n); -} - - -/*********************************************************************** - * Method: BMessage::FindString - * Params: const char *, int32 n - * Returns: const char * - * Effects: - ***********************************************************************/ -const char * -BMessage_FindString_4(BMessage *Message, const char *name, int32 n) -{ - return Message->FindString(name, n); -} - - -/*********************************************************************** - * Method: BMessage::FindInt8 - * Params: const char *, int32 n - * Returns: int8 - * Effects: - ***********************************************************************/ -int8 -BMessage_FindInt8_2(BMessage *Message, const char *name, int32 n) -{ - return Message->FindInt8(name, n); -} - - -/*********************************************************************** - * Method: BMessage::FindInt16 - * Params: const char *, int32 n - * Returns: int16 - * Effects: - ***********************************************************************/ -int16 -BMessage_FindInt16_2(BMessage *Message, const char *name, int32 n) -{ - return Message->FindInt16(name, n); -} - - -/*********************************************************************** - * Method: BMessage::FindInt32 - * Params: const char *, int32 n - * Returns: int32 - * Effects: - ***********************************************************************/ -int32 -BMessage_FindInt32_2(BMessage *Message, const char *name, int32 n) -{ - return Message->FindInt32(name, n); -} - - -/*********************************************************************** - * Method: BMessage::FindInt64 - * Params: const char *, int32 n - * Returns: int64 - * Effects: - ***********************************************************************/ -int64 -BMessage_FindInt64_2(BMessage *Message, const char *name, int32 n) -{ - return Message->FindInt64(name, n); -} - - -/*********************************************************************** - * Method: BMessage::FindBool - * Params: const char *, int32 n - * Returns: bool - * Effects: - ***********************************************************************/ -bool -BMessage_FindBool_2(BMessage *Message, const char *name, int32 n) -{ - return Message->FindBool(name, n); -} - - -/*********************************************************************** - * Method: BMessage::FindFloat - * Params: const char *, int32 n - * Returns: float - * Effects: - ***********************************************************************/ -float -BMessage_FindFloat_2(BMessage *Message, const char *name, int32 n) -{ - return Message->FindFloat(name, n); -} - - -/*********************************************************************** - * Method: BMessage::FindDouble - * Params: const char *, int32 n - * Returns: double - * Effects: - ***********************************************************************/ -double -BMessage_FindDouble_2(BMessage *Message, const char *name, int32 n) -{ - return Message->FindDouble(name, n); -} - -#if defined(__cplusplus) -} -#endif - - -#endif /* _MESSAGE_CPP_ */ \ No newline at end of file diff --git a/bepascal/bepascal/be/app/Messenger.cpp b/bepascal/bepascal/be/app/Messenger.cpp deleted file mode 100644 index 06fe52b..0000000 --- a/bepascal/bepascal/be/app/Messenger.cpp +++ /dev/null @@ -1,280 +0,0 @@ -#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/bepascal/be/app/Roster.cpp b/bepascal/bepascal/be/app/Roster.cpp deleted file mode 100644 index 8aaffde..0000000 --- a/bepascal/bepascal/be/app/Roster.cpp +++ /dev/null @@ -1,744 +0,0 @@ -/* 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/bepascal/be/app/appdefs.pp b/bepascal/bepascal/be/app/appdefs.pp deleted file mode 100644 index 5997848..0000000 --- a/bepascal/bepascal/be/app/appdefs.pp +++ /dev/null @@ -1,302 +0,0 @@ -{ 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 - -initialization - // System Messages Codes - B_ABOUT_REQUESTED := Cardinal(_B_ABOUT_REQUESTED); - B_WINDOW_ACTIVATED := Cardinal(_B_WINDOW_ACTIVATED); - B_APP_ACTIVATED := Cardinal(_B_APP_ACTIVATED); - B_ARGV_RECEIVED := Cardinal(_B_ARGV_RECEIVED); - B_QUIT_REQUESTED := Cardinal(_B_QUIT_REQUESTED); - B_CLOSE_REQUESTED := Cardinal(_B_CLOSE_REQUESTED); - B_CANCEL := Cardinal(_B_CANCEL); - B_KEY_DOWN := Cardinal(_B_KEY_DOWN); - B_KEY_UP := Cardinal(_B_KEY_UP); - B_UNMAPPED_KEY_DOWN := Cardinal(_B_UNMAPPED_KEY_DOWN); - B_UNMAPPED_KEY_UP := Cardinal(_B_UNMAPPED_KEY_UP); - B_MODIFIERS_CHANGED := Cardinal(_B_MODIFIERS_CHANGED); - B_MINIMIZE := Cardinal(_B_MINIMIZE); - B_MOUSE_DOWN := Cardinal(_B_MOUSE_DOWN); - B_MOUSE_MOVED := Cardinal(_B_MOUSE_MOVED); - B_MOUSE_ENTER_EXIT := Cardinal(_B_MOUSE_ENTER_EXIT); - B_MOUSE_UP := Cardinal(_B_MOUSE_UP); - B_MOUSE_WHEEL_CHANGED := Cardinal(_B_MOUSE_WHEEL_CHANGED); - B_OPEN_IN_WORKSPACE := Cardinal(_B_OPEN_IN_WORKSPACE); - B_PRINTER_CHANGED := Cardinal(_B_PRINTER_CHANGED); - B_PULSE := Cardinal(_B_PULSE); - B_READY_TO_RUN := Cardinal(_B_READY_TO_RUN); - B_REFS_RECEIVED := Cardinal(_B_REFS_RECEIVED); - B_RELEASE_OVERLAY_LOCK := Cardinal(_B_RELEASE_OVERLAY_LOCK); - B_ACQUIRE_OVERLAY_LOCK := Cardinal(_B_ACQUIRE_OVERLAY_LOCK); - B_SCREEN_CHANGED := Cardinal(_B_SCREEN_CHANGED); - B_VALUE_CHANGED := Cardinal(_B_VALUE_CHANGED); - B_VIEW_MOVED := Cardinal(_B_VIEW_MOVED); - B_VIEW_RESIZED := Cardinal(_B_VIEW_RESIZED); - B_WINDOW_MOVED := Cardinal(_B_WINDOW_MOVED); - B_WINDOW_RESIZED := Cardinal(_B_WINDOW_RESIZED); - B_WORKSPACES_CHANGED := Cardinal(_B_WORKSPACES_CHANGED); - B_WORKSPACE_ACTIVATED := Cardinal(_B_WORKSPACE_ACTIVATED); - B_ZOOM := Cardinal(_B_ZOOM); - _APP_MENU_ := Cardinal(__APP_MENU_); - _BROWSER_MENUS_ := Cardinal(__BROWSER_MENUS_); - _MENU_EVENT_ := Cardinal(__MENU_EVENT_); - _PING_ := Cardinal(__PING_); - _QUIT_ := Cardinal(__QUIT_); - _VOLUME_MOUNTED_ := Cardinal(__VOLUME_MOUNTED_); - _VOLUME_UNMOUNTED_ := Cardinal(__VOLUME_UNMOUNTED_); - _MESSAGE_DROPPED_ := Cardinal(__MESSAGE_DROPPED_); - _DISPOSE_DRAG_ := Cardinal(__DISPOSE_DRAG_); - _MENUS_DONE_ := Cardinal(__MENUS_DONE_); - _SHOW_DRAG_HANDLES_ := Cardinal(__SHOW_DRAG_HANDLES_); - _EVENTS_PENDING_ := Cardinal(__EVENTS_PENDING_); - _UPDATE_ := Cardinal(__UPDATE_); - _UPDATE_IF_NEEDED_ := Cardinal(__UPDATE_IF_NEEDED_); - _PRINTER_INFO_ := Cardinal(__PRINTER_INFO_); - _SETUP_PRINTER_ := Cardinal(__SETUP_PRINTER_); - _SELECT_PRINTER_ := Cardinal(__SELECT_PRINTER_); - - // Other Commands - B_SET_PROPERTY := Cardinal(_B_SET_PROPERTY); - B_GET_PROPERTY := Cardinal(_B_GET_PROPERTY); - B_CREATE_PROPERTY := Cardinal(_B_CREATE_PROPERTY); - B_DELETE_PROPERTY := Cardinal(_B_DELETE_PROPERTY); - B_COUNT_PROPERTIES := Cardinal(_B_COUNT_PROPERTIES); - B_EXECUTE_PROPERTY := Cardinal(_B_EXECUTE_PROPERTY); - B_GET_SUPPORTED_SUITES := Cardinal(_B_GET_SUPPORTED_SUITES); - B_UNDO := Cardinal(_B_UNDO); - B_CUT := Cardinal(_B_CUT); - B_COPY := Cardinal(_B_COPY); - B_PASTE := Cardinal(_B_PASTE); - B_SELECT_ALL := Cardinal(_B_SELECT_ALL); - B_SAVE_REQUESTED := Cardinal(_B_SAVE_REQUESTED); - B_MESSAGE_NOT_UNDERSTOOD := Cardinal(_B_MESSAGE_NOT_UNDERSTOOD); - B_NO_REPLY := Cardinal(_B_NO_REPLY); - B_REPLY := Cardinal(_B_REPLY); - B_SIMPLE_DATA := Cardinal(_B_SIMPLE_DATA); - B_MIME_DATA := Cardinal(_B_MIME_DATA); - B_ARCHIVED_OBJECT := Cardinal(_B_ARCHIVED_OBJECT); - B_UPDATE_STATUS_BAR := Cardinal(_B_UPDATE_STATUS_BAR); - B_RESET_STATUS_BAR := Cardinal(_B_RESET_STATUS_BAR); - B_NODE_MONITOR := Cardinal(_B_NODE_MONITOR); - B_QUERY_UPDATE := Cardinal(_B_QUERY_UPDATE); - B_ENDORSABLE := Cardinal(_B_ENDORSABLE); - B_COPY_TARGET := Cardinal(_B_COPY_TARGET); - B_MOVE_TARGET := Cardinal(_B_MOVE_TARGET); - B_TRASH_TARGET := Cardinal(_B_TRASH_TARGET); - B_LINK_TARGET := Cardinal(_B_LINK_TARGET); - B_INPUT_DEVICES_CHANGED := Cardinal(_B_INPUT_DEVICES_CHANGED); - B_INPUT_METHOD_EVENT := Cardinal(_B_INPUT_METHOD_EVENT); - B_WINDOW_MOVE_TO := Cardinal(_B_WINDOW_MOVE_TO); - B_WINDOW_MOVE_BY := Cardinal(_B_WINDOW_MOVE_BY); - B_SILENT_RELAUNCH := Cardinal(_B_SILENT_RELAUNCH); - B_OBSERVER_NOTICE_CHANGE := Cardinal(_B_OBSERVER_NOTICE_CHANGE); - B_CONTROL_INVOKED := Cardinal(_B_CONTROL_INVOKED); - B_CONTROL_MODIFIED := Cardinal(_B_CONTROL_MODIFIED); - -end. \ No newline at end of file diff --git a/bepascal/bepascal/be/app/application.h b/bepascal/bepascal/be/app/application.h deleted file mode 100644 index 9446f8c..0000000 --- a/bepascal/bepascal/be/app/application.h +++ /dev/null @@ -1,56 +0,0 @@ -/* 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/bepascal/be/app/application.pp b/bepascal/bepascal/be/app/application.pp deleted file mode 100644 index 7e98d64..0000000 --- a/bepascal/bepascal/be/app/application.pp +++ /dev/null @@ -1,182 +0,0 @@ -{ 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; - -type - TApplication = class(TLooper) - 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 : TThread_id; - procedure Quit; - // 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) : TThread_id; cdecl; external BePascalLibName; -procedure BApplication_Quit(Application : TCPlusObject); cdecl; external BePascalLibName; -function get_be_app_messenger : TCPlusObject; cdecl; external BePascalLibName name 'get_be_app_messenger'; - -var - be_app : TApplication; - -implementation - -uses - Messenger; - -var - Application_AppActivated_hook : Pointer; cvar; external; - Application_ReadyToRun_hook : Pointer; cvar; external; - - // start TApplication -constructor TApplication.Create; -begin - inherited; - CPlusObject := BApplication_Create(Self, PChar('application/x-vnd.BePascal')); - be_app := Self; - be_app_TMessenger := TMessenger.Wrap(be_app_messengerCPlus); -end; - -constructor TApplication.Create(Signature : PChar); -begin - inherited Create; - CPlusObject := BApplication_Create(Self, Signature); - be_app := Self; - be_app_TMessenger := TMessenger.Wrap(be_app_messengerCPlus); -end; - -constructor TApplication.Create(Signature : PChar; error : PStatus_t); -begin - inherited Create; - CPlusObject := BApplication_Create(Self, Signature, error); - be_app := Self; - be_app_TMessenger := TMessenger.Wrap(be_app_messengerCPlus); -end; - -destructor TApplication.Destroy; -begin - if CPlusObject <> nil then - BApplication_Free(CPlusObject); - if Assigned(be_app_TMessenger) then - be_app_TMessenger.UnWrap; - inherited; -end; - -// Hook functions - -procedure Application_AppActivated_hook_func(Application : TApplication; Active : boolean); cdecl; -begin - if Application <> nil then - Application.AppActivated(Active); -end; - -procedure TApplication.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 : TApplication); cdecl; -begin -{$IFDEF DEBUG} - SendText('Hook ReadyToRun !'); -{$ENDIF} - if Application <> nil then - Application.ReadyToRun; -end; - -procedure Application_MessageReceived_hook_func(Application : TApplication; aMessage : TCPlusObject); cdecl; -var - Message : TMessage; -begin -{$IFDEF DEBUG} - SendText('Hook MessageReceived !'); -{$ENDIF} - Message := TMessage.Wrap(aMessage); - try - if Application <> nil then - Application.MessageReceived(Message); - finally - Message.UnWrap; - end; -end; - -procedure TApplication.ReadyToRun; -begin -{$IFDEF DEBUG} - SendText('Prêt à démarer !'); -{$ENDIF} -end; - -procedure TApplication.ShowCursor; -begin - BApplication_ShowCursor(CPlusObject); -end; - -procedure TApplication.HideCursor; -begin - BApplication_HideCursor(CPlusObject); -end; - -function TApplication.Run : TThread_id; -begin - Result := BApplication_Run(CPlusObject); -end; - -procedure TApplication.Quit; -begin - BApplication_Quit(CPlusObject); -end; - - // end TApplication - -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/bepascal/be/app/handler.h b/bepascal/bepascal/be/app/handler.h deleted file mode 100644 index eba51dd..0000000 --- a/bepascal/bepascal/be/app/handler.h +++ /dev/null @@ -1,41 +0,0 @@ -/* 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/bepascal/be/app/handler.pp b/bepascal/bepascal/be/app/handler.pp deleted file mode 100644 index 543421c..0000000 --- a/bepascal/bepascal/be/app/handler.pp +++ /dev/null @@ -1,80 +0,0 @@ -{ 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 - THandler = class(TArchivable) - public - procedure MessageReceived(aMessage : TMessage); virtual; - end; - -implementation - -uses - SysUtils; - -var - Handler_MessageReceived_hook : Pointer; cvar; external; - -procedure THandler.MessageReceived(aMessage : TMessage); -begin -{$IFDEF DEBUG} - SendText(ClassName + '.MessageReceived'); - SendText('Message reçue'); - aMessage.PrintToStream; -{$ENDIF} -end; - -procedure Handler_MessageReceived_hook_func(Handler : THandler; aMessage : TCPlusObject); cdecl; -var - Message : TMessage; -begin - try -{$IFDEF DEBUG} - SendText('Hook MessageReceived !'); -{$ENDIF} - Message := TMessage.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/bepascal/be/app/invoker.pp b/bepascal/bepascal/be/app/invoker.pp deleted file mode 100644 index dbcc7d3..0000000 --- a/bepascal/bepascal/be/app/invoker.pp +++ /dev/null @@ -1,271 +0,0 @@ -{ 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 - TInvoker = class(TBeObject) - private - public - constructor Create; override; - constructor Create(aMessage : TMessage; handler : THandler; looper : TLooper); - constructor Create(aMessage : TMessage; aTarget : TMessenger); - destructor Destroy; override; - function SetMessage(aMessage : TMessage) : TStatus_t; - function Message : TMessage; - function Command : Cardinal; - function SetTarget(h : THandler; loop : TLooper) : TStatus_t; - function SetTarget(aMessenger : TMessenger) : TStatus_t; - function IsTargetLocal : boolean; - function Target(looper : TLooper) : THandler; - function Messenger : TMessenger; - function SetHandlerForReply(handler : THandler) : TStatus_t; - function HandlerForReply : THandler; - function Invoke(msg : TMessage) : TStatus_t; -// function InvokeNotify(msg : TMessage; kind : Cardinal) : TStatus_t; - function SetTimeout(aTimeout : TBigtime_t) : TStatus_t; - function Timeout : TBigtime_t; -// function InvokeKind(notify : boolean) : Cardinal; -// procedure BeginInvokeNotify(kind : Cardinal); -// procedure EndInvokeNotify; -// procedure _ReservedInvoker1; -// procedure _ReservedInvoker2; -// procedure _ReservedInvoker3; - constructor Create(aInvoker : TInvoker); -// function operator=( : TInvoker) : TInvoker; -// 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_SetMessage(AObject : TCPlusObject; message : TCplusObject) : TStatus_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) : TStatus_t; cdecl; external BePascalLibName name 'BInvoker_SetTarget'; -function BInvoker_SetTarget(AObject : TCPlusObject; messenger : TCplusObject) : TStatus_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) : THandler; cdecl; external BePascalLibName name 'BInvoker_Target'; -function BInvoker_Messenger(AObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BInvoker_Messenger'; -function BInvoker_SetHandlerForReply(AObject : TCPlusObject; handler : TCplusObject) : TStatus_t; cdecl; external BePascalLibName name 'BInvoker_SetHandlerForReply'; -function BInvoker_HandlerForReply(AObject : TCPlusObject) : THandler; cdecl; external BePascalLibName name 'BInvoker_HandlerForReply'; -function BInvoker_Invoke(AObject : TCPlusObject; msg : TCplusObject) : TStatus_t; cdecl; external BePascalLibName name 'BInvoker_Invoke'; -//function BInvoker_InvokeNotify(AObject : TCPlusObject; msg : TCplusObject; kind : Cardinal) : TStatus_t; cdecl; external BePascalLibName name 'BInvoker_InvokeNotify'; -function BInvoker_SetTimeout(AObject : TCPlusObject; timeout : TBigtime_t) : TStatus_t; cdecl; external BePascalLibName name 'BInvoker_SetTimeout'; -function BInvoker_Timeout(AObject : TCPlusObject) : TBigtime_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; : TInvoker) : TInvoker; 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 TInvoker.Create; -begin - BInvoker_Create(Self); -end; - -constructor TInvoker.Create(aMessage : TMessage; handler : THandler; looper : TLooper); -begin - CPlusObject := BInvoker_Create(Self, aMessage.CPlusObject, handler, looper); -end; - -constructor TInvoker.Create(aMessage : TMessage; aTarget : TMessenger); -begin - CPlusObject := BInvoker_Create(Self, aMessage.CPlusObject, aTarget.CPlusObject); -end; - -destructor TInvoker.Destroy; -begin - BInvoker_Free(CPlusObject); -end; - -function TInvoker.SetMessage(aMessage : TMessage) : TStatus_t; -begin - Result := BInvoker_SetMessage(CPlusObject, aMessage.CPlusObject); -end; - -function TInvoker.Message : TMessage; -begin - Result := TMessage.Wrap(BInvoker_Message(CPlusObject)); -end; - -function TInvoker.Command : Cardinal; -begin - Result := BInvoker_Command(CPlusObject); -end; - -function TInvoker.SetTarget(h : THandler; loop : TLooper) : TStatus_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 TInvoker.SetTarget(aMessenger : TMessenger) : TStatus_t; -begin - Result := BInvoker_SetTarget(CPlusObject, aMessenger.CPlusObject); -end; - -function TInvoker.IsTargetLocal : boolean; -begin - Result := BInvoker_IsTargetLocal(CPlusObject); -end; - -function TInvoker.Target(looper : TLooper) : THandler; -begin - Result := BInvoker_Target(CPlusObject, looper.CPlusObject); -end; - -function TInvoker.Messenger : TMessenger; -begin - Result := TMessenger.Wrap(BInvoker_Messenger(CPlusObject)); -end; - -function TInvoker.SetHandlerForReply(handler : THandler) : TStatus_t; -begin - Result := BInvoker_SetHandlerForReply(CPlusObject, handler.CPlusObject); -end; - -function TInvoker.HandlerForReply : THandler; -begin - Result := BInvoker_HandlerForReply(CPlusObject); -end; - -function TInvoker.Invoke(msg : TMessage) : TStatus_t; -begin - Result := BInvoker_Invoke(CPlusObject, msg.CPlusObject); -end; - -//function TInvoker.InvokeNotify(msg : TMessage; kind : Cardinal) : TStatus_t; -//begin -// BInvoker_InvokeNotify(CPlusObject, msg.CPlusObject, kind); -//end; - -function TInvoker.SetTimeout(aTimeout : TBigtime_t) : TStatus_t; -begin - Result := BInvoker_SetTimeout(CPlusObject, timeout); -end; - -function TInvoker.Timeout : TBigtime_t; -begin - Result := BInvoker_Timeout(CPlusObject); -end; - -//function TInvoker.InvokeKind(notify : boolean) : Cardinal; -//begin -// BInvoker_InvokeKind(CPlusObject, notify); -//end; -// -//procedure TInvoker.BeginInvokeNotify(kind : Cardinal); -//begin -// BInvoker_BeginInvokeNotify(CPlusObject, kind); -//end; -// -//procedure TInvoker.EndInvokeNotify; -//begin -// BInvoker_EndInvokeNotify(CPlusObject); -//end; - -//procedure TInvoker._ReservedInvoker1; -//begin -// BInvoker__ReservedInvoker1(CPlusObject); -//end; -// -//procedure TInvoker._ReservedInvoker2; -//begin -// BInvoker__ReservedInvoker2(CPlusObject); -//end; -// -//procedure TInvoker._ReservedInvoker3; -//begin -// BInvoker__ReservedInvoker3(CPlusObject); -//end; - -constructor TInvoker.Create(ainvoker : TInvoker); -begin - BInvoker_Create(Self, aInvoker); -end; - -//function TInvoker.operator=( : TInvoker) : TInvoker; -//begin -// BInvoker_operator=(CPlusObject, ); -//end; - -//procedure TInvoker.BMessage *fMessage; -//begin -// BInvoker_BMessage *fMessage(CPlusObject); -//end; -// -//procedure TInvoker.BMessenger fMessenger; -//begin -// BInvoker_BMessenger fMessenger(CPlusObject); -//end; -// -//procedure TInvoker.BHandler *fReplyTo; -//begin -// BInvoker_BHandler *fReplyTo(CPlusObject); -//end; -// -//procedure TInvoker.uint32 fTimeout; -//begin -// BInvoker_uint32 fTimeout(CPlusObject); -//end; -// -//procedure TInvoker.uint32 fNotifyKind; -//begin -// BInvoker_uint32 fNotifyKind(CPlusObject); -//end; -// -//procedure TInvoker.uint32 _reserved[2]; -//begin -// BInvoker_uint32 _reserved[2](CPlusObject); -//end; - - -end. diff --git a/bepascal/bepascal/be/app/looper.h b/bepascal/bepascal/be/app/looper.h deleted file mode 100644 index 4722c59..0000000 --- a/bepascal/bepascal/be/app/looper.h +++ /dev/null @@ -1,46 +0,0 @@ -/* 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/bepascal/be/app/looper.pp b/bepascal/bepascal/be/app/looper.pp deleted file mode 100644 index 03e3cb4..0000000 --- a/bepascal/bepascal/be/app/looper.pp +++ /dev/null @@ -1,103 +0,0 @@ -{ 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 - TLooper = class(THandler) - private - public - procedure DispatchMessage(aMessage : TMessage; aTarget : THandler); virtual; - function QuitRequested() : boolean; virtual; - function GetSupportedSuites(aMessage : TMessage) : TStatus_t; - function PostMessage(command : Cardinal) : TStatus_t; - end; - -//function BLooper_Create(AObject : TObject); -function BLooper_GetSupportedSuites(Looper : TCplusObject; aMessage : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BLooper_GetSupportedSuites'; -function BLooper_PostMessage(Looper : TCPlusObject; command : Cardinal) : TStatus_t; cdecl; external BePascalLibName name 'BLooper_PostMessage_2'; - -implementation - -var - Looper_DispatchMessage_hook : Pointer; cvar; external; - Looper_QuitRequested_hook : Pointer; cvar; external; - -procedure TLooper.DispatchMessage(aMessage : TMessage; aTarget : THandler); -begin -end; - -function TLooper.QuitRequested() : boolean; -begin - Result := True; -end; - -function TLooper.GetSupportedSuites(aMessage : TMessage) : TStatus_t; -begin - result := BLooper_GetSupportedSuites(CPlusObject, aMessage.CPlusObject); -end; - -function TLooper.PostMessage(command : Cardinal) : TStatus_t; -begin - result := BLooper_PostMessage(CPlusObject, command); -end; - -// hooks - -procedure Looper_DispatchMessage_hook_func(Looper : TLooper; - aMessage : TCPlusObject; aTarget : TCPlusObject); cdecl; -var - Message : TMessage; - Target : THandler; -begin - Message := TMessage.Wrap(aMessage); - try - Target := THandler.Wrap(aTarget); - try - Looper.DispatchMessage(Message, Target); - finally - Target.UnWrap; - end; - finally - Message.UnWrap; - end; -end; - -function Looper_QuitRequested_hook_func(Looper : TLooper) : 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. \ No newline at end of file diff --git a/bepascal/bepascal/be/app/message.h b/bepascal/bepascal/be/app/message.h deleted file mode 100644 index 3acc37c..0000000 --- a/bepascal/bepascal/be/app/message.h +++ /dev/null @@ -1,38 +0,0 @@ -/* 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/bepascal/be/app/message.pp b/bepascal/bepascal/be/app/message.pp deleted file mode 100644 index eb90890..0000000 --- a/bepascal/bepascal/be/app/message.pp +++ /dev/null @@ -1,281 +0,0 @@ -{ 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 - TMessage = class(TBeObject) - private - function GetWhat : Cardinal; - procedure SetWhat(aWhat : Cardinal); - public - constructor Create; override; - constructor Create(Command : Cardinal); virtual; - constructor Create(var Message : TMessage); virtual; - destructor Destroy; override; - function AddData(const Name : PChar; aType : TType_Code; const Data : Pointer; FixedSize : Cardinal; NumItems : Integer) : TStatus_t; - function AddBool(const Name : PChar; aBool : boolean) : TStatus_t; - function AddInt8(const Name : PChar; anInt8 : Shortint) : TStatus_t; - function FindInt8(const Name : PChar; var anInt8 : Shortint) : TStatus_t; - function AddInt16(const Name : PChar; anInt16 : Smallint) : TStatus_t; - function AddInt32(const Name : PChar; anInt32 : Integer) : TStatus_t; - function AddInt64(const Name : PChar; anInt64 : int64) : TStatus_t; - function AddFloat(const Name : PChar; aFloat : Single) : TStatus_t; - function AddDouble(const Name : PChar; aDouble : Double) : TStatus_t; - function AddString(const Name : PChar; aString : PChar) : TStatus_t; - function FindString(const Name : PChar; var aString : PChar) : TStatus_t; - function AddMessage(const Name : PChar; aMessage : TCPlusObject) : TStatus_t; - function CountNames(aType : TType_Code) : Integer; - function HasSpecifiers : boolean; - function IsSystem : boolean; - function MakeEmpty : TStatus_t; - function IsEmpty : boolean; - function RemoveName(const Name : PChar) : TStatus_t; - procedure PrintToStream; - function RemoveData(const name : PChar; index : Integer) : TStatus_t; - function WasDelivered : boolean; - function IsSourceRemote : boolean; - function IsSourceWaiting : boolean; - function IsReply : boolean; - function Previous : TMessage; - 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 : TType_Code; const Data : Pointer; FixedSize : Cardinal; NumItems : Integer) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_AddBool(Message : TCPlusObject; const Name : PChar; aBool : boolean) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_AddInt8(Message : TCPlusObject; const Name : PChar; anInt8 : Shortint) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_FindInt8(Message : TCPlusObject; const Name : PChar; var anInt8 : Shortint) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_AddInt16(Message : TCPlusObject; const Name : PChar; anInt16 : Smallint) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_AddInt32(Message : TCPlusObject; const Name : PChar; anInt32 : Integer) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_AddInt64(Message : TCPlusObject; const Name : PChar; anInt64 : int64) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_AddFloat(Message : TCPlusObject; const Name : PChar; aFloat : Single) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_AddDouble(Message : TCPlusObject; const Name : PChar; aDouble : Double) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_AddString(Message : TCPlusObject; const Name : PChar; aString : PChar) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_FindString(Message : TCPlusObject; const Name : PChar;var aString : PChar) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_AddMessage(Message : TCPlusObject; const Name : PChar; aMessage : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_CountNames(Message : TCPlusObject; aType : TType_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) : TStatus_t; cdecl; external BePascalLibName; -function BMessage_IsEmpty(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName; -function BMessage_RemoveName(Message : TCPlusObject; const Name : PChar) : TStatus_t; cdecl; external BePascalLibName; -procedure BMessage_PrintToStream(Message : TCPlusObject); cdecl; external BePascalLibName; -function BMessage_RemoveData(Message : TCPlusObject; const name : PChar; index : Integer) : TStatus_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 TMessage -constructor TMessage.Create; -begin - inherited Create; - CPlusObject := BMessage_Create(Self); -end; - -constructor TMessage.Create(Command : Cardinal); -begin - inherited Create; - CPlusObject := BMessage_Create(Self, Command); -end; - -constructor TMessage.Create(var Message : TMessage); -begin - inherited Create; - CPlusObject := BMessage_Create(Self, Message.FCPlusObject); -end; - -destructor TMessage.Destroy; -begin - if CPlusObject <> nil then - BMessage_Free(CPlusObject); - inherited; -end; - -function TMessage.GetWhat : Cardinal; -begin - Result := BMessage_GetWhat(CPlusObject); -end; - -procedure TMessage.SetWhat(aWhat : Cardinal); -begin - BMessage_SetWhat(CPlusObject, aWhat); -end; - -function TMessage.AddData(const Name : PChar; aType : TType_Code; const Data : Pointer; FixedSize : Cardinal; NumItems : Integer) : TStatus_t; -begin - result := BMessage_AddData(CPlusObject, Name, aType, Data, FixedSize, NumItems); -end; - -function TMessage.AddBool(const Name : PChar; aBool : boolean) : TStatus_t; -begin - result := BMessage_AddBool(CPlusObject, Name, aBool); -end; - -function TMessage.AddInt8(const Name : PChar; anInt8 : Shortint) : TStatus_t; -begin - result := BMessage_AddInt8(CPlusObject, Name, anInt8); -end; - -function TMessage.FindInt8(const Name : PChar; var anInt8 : Shortint) : TStatus_t; -begin - result := BMessage_FindInt8(CPlusObject, Name, anInt8); -end; - -function TMessage.AddInt16(const Name : PChar; anInt16 : Smallint) : TStatus_t; -begin - result := BMessage_AddInt16(CPlusObject, Name, anInt16); -end; - -function TMessage.AddInt32(const Name : PChar; anInt32 : Integer) : TStatus_t; -begin - result := BMessage_AddInt32(CPlusObject, Name, anInt32); -end; - -function TMessage.AddInt64(const Name : PChar; anInt64 : int64) : TStatus_t; -begin - result := BMessage_AddInt64(CPlusObject, Name, anInt64); -end; - -function TMessage.AddFloat(const Name : PChar; aFloat : Single) : TStatus_t; -begin - result := BMessage_AddFloat(CPlusObject, Name, aFloat); -end; - -function TMessage.AddDouble(const Name : PChar; aDouble : Double) : TStatus_t; -begin - result := BMessage_AddDouble(CPlusObject, Name, aDouble); -end; - -function TMessage.AddString(const Name : PChar; aString : PChar) : TStatus_t; -begin - result := BMessage_AddString(CPlusObject, Name, aString); -end; - -function TMessage.FindString(const Name : PChar;var aString : PChar) : TStatus_t; -begin - result := BMessage_FindString(CPlusObject, Name, aString); -end; - -function TMessage.AddMessage(const Name : PChar; aMessage : TCPlusObject) : TStatus_t; -begin - result := BMessage_AddMessage(CPlusObject, Name, aMessage); -end; - -function TMessage.CountNames(aType : TType_Code) : Integer; -begin - result := BMessage_CountNames(CPlusObject, aType); -end; - -function TMessage.HasSpecifiers : boolean; -begin - result := BMessage_HasSpecifiers(CPlusObject); -end; - -function TMessage.IsSystem : boolean; -begin - result := BMessage_IsSystem(CPlusObject); -end; - -function TMessage.MakeEmpty : TStatus_t; -begin - result := BMessage_MakeEmpty(CPlusObject); -end; - -function TMessage.IsEmpty : boolean; -begin - result := BMessage_IsEmpty(CPlusObject); -end; - -function TMessage.RemoveName(const Name : PChar) : TStatus_t; -begin - result := BMessage_RemoveName(CPlusObject, Name); -end; - -procedure TMessage.PrintToStream; -begin - BMessage_PrintToStream(CPlusObject); -end; - -function TMessage.RemoveData(const name : PChar; index : Integer) : TStatus_t; -begin - result := BMessage_RemoveData(CPlusObject, name, index); -end; - -function TMessage.WasDelivered : boolean; -begin - result := BMessage_WasDelivered(CPlusObject); -end; - -function TMessage.IsSourceRemote : boolean; -begin - result := BMessage_IsSourceRemote(CPlusObject); -end; - -function TMessage.IsSourceWaiting : boolean; -begin - result := BMessage_IsSourceWaiting(CPlusObject); -end; - -function TMessage.IsReply : boolean; -begin - result := BMessage_IsReply(CPlusObject); -end; - -function TMessage.Previous : TMessage; -begin - result := TMessage.Wrap(BMessage_Previous(CPlusObject)); -end; - -function TMessage.WasDropped : boolean; -begin - result := BMessage_WasDropped(CPlusObject); -end; - -end. \ No newline at end of file diff --git a/bepascal/bepascal/be/app/messenger.pp b/bepascal/bepascal/be/app/messenger.pp deleted file mode 100644 index 05ce7cb..0000000 --- a/bepascal/bepascal/be/app/messenger.pp +++ /dev/null @@ -1,249 +0,0 @@ -{ 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 - TMessenger = class(TBeObject) - private - public - constructor Create; override; - constructor Create(mime_sig : PChar; aTeam : TTeam_id; var err : TStatus_t); - constructor Create(handler : THandler; looper : TLooper; var err : TStatus_t); - constructor Create(from : TMessenger); - destructor Destroy; override; - function IsTargetLocal : boolean; - function Target(looper : TLooper) : THandler; - function LockTarget : boolean; -// function LockTargetWithTimeout(timeout : TBigtime_t) : TStatus_t; - function SendMessage(command : Cardinal; reply_to : THandler) : TStatus_t; - function SendMessage(a_message : TMessage; reply_to : THandler; timeout : TBigtime_t) : TStatus_t; - function SendMessage(a_message : TMessage; reply_to : TMessenger; timeout : TBigtime_t) : TStatus_t; - function SendMessage(command : Cardinal; reply : TMessage) : TStatus_t; - function SendMessage(a_message : TMessage; reply : TMessage; send_timeout : TBigtime_t; reply_timeout : TBigtime_t) : TStatus_t; -// function operator=(from : TMessenger) : TMessenger; -// function operator==(other : TMessenger) : boolean; - function IsValid : boolean; - function Team : TTeam_id; -// constructor Create(aTeam : TTeam_id; port : TPort_id; token : integer; preferred : boolean); -// procedure InitData(mime_sig : PChar; aTeam : TTeam_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 : TTeam_id; var err : TStatus_t) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create_1'; -function BMessenger_Create(AObject : TBeObject; handler : THandler; looper : TLooper; var err : TStatus_t) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create_2'; -function BMessenger_Create(AObject : TBeObject; from : TMessenger) : 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) : THandler; cdecl; external BePascalLibName name 'BMessenger_Target'; -function BMessenger_LockTarget(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMessenger_LockTarget'; -//function BMessenger_LockTargetWithTimeout(AObject : TCPlusObject; timeout : TBigtime_t) : TStatus_t; cdecl; external BePascalLibName name 'BMessenger_LockTargetWithTimeout'; -function BMessenger_SendMessage(AObject : TCPlusObject; command : Cardinal; reply_to : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage'; -function BMessenger_SendMessage_1(AObject : TCPlusObject; a_message : TCplusObject; reply_to : TCplusObject; timeout : TBigtime_t) : TStatus_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 : TBigtime_t) : TStatus_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_2'; -function BMessenger_SendMessage_3(AObject : TCPlusObject; command : Cardinal; reply : TCplusObject) : TStatus_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_3'; -function BMessenger_SendMessage_4(AObject : TCPlusObject; a_message : TCplusObject; reply : TCplusObject; send_timeout : TBigtime_t; reply_timeout : TBigtime_t) : TStatus_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_4'; -//function BMessenger_operator=(AObject : TCPlusObject; from : TMessenger) : TMessenger; cdecl; external BePascalLibName name 'BMessenger_operator='; -//function BMessenger_operator==(AObject : TCPlusObject; other : TMessenger) : boolean; cdecl; external BePascalLibName name 'BMessenger_operator=='; -function BMessenger_IsValid(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMessenger_IsValid'; -function BMessenger_Team(AObject : TCPlusObject) : TTeam_id; cdecl; external BePascalLibName name 'BMessenger_Team'; -//function BMessenger_Create(AObject : TBeObject; team : TTeam_id; port : TPort_id; token : integer; preferred : boolean) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create'; -//procedure BMessenger_InitData(AObject : TCPlusObject; mime_sig : PChar; team : TTeam_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_TMessenger : TMessenger; - be_app_messengerCPlus : TCPlusObject; cvar; external; - -implementation - -constructor TMessenger.Create; -begin - BMessenger_Create(Self); -end; - -constructor TMessenger.Create(mime_sig : PChar; aTeam : TTeam_id; var err : TStatus_t); -begin - CPlusObject := BMessenger_Create(Self, mime_sig, aTeam, err); -end; - -constructor TMessenger.Create(handler : THandler; looper : TLooper; var err : TStatus_t); -begin - CPlusObject := BMessenger_Create(Self, handler, looper, err); -end; - -constructor TMessenger.Create(from : TMessenger); -begin - CPlusObject := BMessenger_Create(Self, from); -end; - -destructor TMessenger.Destroy; -begin - BMessenger_Free(CPlusObject); -end; - -function TMessenger.IsTargetLocal : boolean; -begin - Result := BMessenger_IsTargetLocal(CPlusObject); -end; - -function TMessenger.Target(looper : TLooper) : THandler; -begin - Result := BMessenger_Target(CPlusObject, looper.CPlusObject); -end; - -function TMessenger.LockTarget : boolean; -begin - Result := BMessenger_LockTarget(CPlusObject); -end; - -//function TMessenger.LockTargetWithTimeout(timeout : TBigtime_t) : TStatus_t; -//begin -// BMessenger_LockTargetWithTimeout(CPlusObject, timeout); -//end; - -function TMessenger.SendMessage(command : Cardinal; reply_to : THandler) : TStatus_t; -begin - Result := BMessenger_SendMessage(CPlusObject, command, reply_to.CPlusObject); -end; - -function TMessenger.SendMessage(a_message : TMessage; reply_to : THandler; timeout : TBigtime_t) : TStatus_t; -begin - Result := BMessenger_SendMessage_1(CPlusObject, a_message.CPlusObject, reply_to.CPlusObject, timeout); -end; - -function TMessenger.SendMessage(a_message : TMessage; reply_to : TMessenger; timeout : TBigtime_t) : TStatus_t; -begin - Result := BMessenger_SendMessage_2(CPlusObject, a_message.CPlusObject, reply_to.CPlusObject, timeout); -end; - -function TMessenger.SendMessage(command : Cardinal; reply : TMessage) : TStatus_t; -begin - Result := BMessenger_SendMessage_3(CPlusObject, command, reply.CPlusObject); -end; - -function TMessenger.SendMessage(a_message : TMessage; reply : TMessage; send_timeout : TBigtime_t; reply_timeout : TBigtime_t) : TStatus_t; -begin - Result := BMessenger_SendMessage_4(CPlusObject, a_message.CPlusObject, reply.CPlusObject, send_timeout, reply_timeout); -end; - -//function TMessenger.operator=(from : TMessenger) : TMessenger; -//begin -// BMessenger_operator=(CPlusObject, from); -//end; -// -//function TMessenger.operator==(other : TMessenger) : boolean; -//begin -// BMessenger_operator==(CPlusObject, other); -//end; - -function TMessenger.IsValid : boolean; -begin - Result := BMessenger_IsValid(CPlusObject); -end; - -function TMessenger.Team : TTeam_id; -begin - Result := BMessenger_Team(CPlusObject); -end; - -//constructor TMessenger.Create(aTeam : TTeam_id; port : TPort_id; token : integer; preferred : boolean); -//begin -// CPlusObject := BMessenger_Create(Self, aTeam, port, token, preferred); -//end; - -//procedure TMessenger.InitData(mime_sig : PChar; aTeam : TTeam_id; perr : PStatus_t); -//begin -// BMessenger_InitData(CPlusObject, mime_sig, aTeam, perr); -//end; - -//procedure TMessenger.port_id fPort; -//begin -// BMessenger_port_id fPort(CPlusObject); -//end; -// -//procedure TMessenger.int32 fHandlerToken; -//begin -// BMessenger_int32 fHandlerToken(CPlusObject); -//end; -// -//procedure TMessenger.team_id fTeam; -//begin -// BMessenger_team_id fTeam(CPlusObject); -//end; -// -//procedure TMessenger.int32 extra0; -//begin -// BMessenger_int32 extra0(CPlusObject); -//end; -// -//procedure TMessenger.int32 extra1; -//begin -// BMessenger_int32 extra1(CPlusObject); -//end; -// -//procedure TMessenger.bool fPreferredTarget; -//begin -// BMessenger_bool fPreferredTarget(CPlusObject); -//end; -// -//procedure TMessenger.bool extra2; -//begin -// BMessenger_bool extra2(CPlusObject); -//end; -// -//procedure TMessenger.bool extra3; -//begin -// BMessenger_bool extra3(CPlusObject); -//end; -// -//procedure TMessenger.bool extra4; -//begin -// BMessenger_bool extra4(CPlusObject); -//end; - -initialization - be_app_TMessenger := nil; - -finalization - be_app_TMessenger := nil; - -end. diff --git a/bepascal/bepascal/be/app/roster.h b/bepascal/bepascal/be/app/roster.h deleted file mode 100644 index db1a1f3..0000000 --- a/bepascal/bepascal/be/app/roster.h +++ /dev/null @@ -1,24 +0,0 @@ -/* 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/bepascal/be/app/roster.pp b/bepascal/bepascal/be/app/roster.pp deleted file mode 100644 index f660d4f..0000000 --- a/bepascal/bepascal/be/app/roster.pp +++ /dev/null @@ -1,340 +0,0 @@ -{ 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 = ^TEntryRef; - TAppInfoProc = procedure; - TAppInfo = record - thread : TThread_id; - team : TTeam_id; - port : TPort_id; - flags : Cardinal; - ref : TEntryRef; - signature : Array[0..B_MIME_TYPE_LENGTH] of Char; - end; - TRoster = class(TBeObject) - private - public - constructor Create; override; - destructor Destroy; override; -//***************** - function IsRunning(mime_sig : PChar) : boolean; - function IsRunning(var ref : TEntryRef) : boolean; - function TeamFor(mime_sig : PChar) : TTeam_id; - function TeamFor(var ref : TEntryRef) : TTeam_id; - procedure GetAppList(team_id_list : TList); - procedure GetAppList(sig : PChar; team_id_list : TList); - function GetAppInfo(sig : PChar; var info : TAppInfo) : TStatus_t; - function GetAppInfo(var ref : TEntryRef; var info : TAppInfo) : TStatus_t; - function GetRunningAppInfo(team : TTeam_id; var info : TAppInfo) : TStatus_t; - function GetActiveAppInfo(var info : TAppInfo) : TStatus_t; - function FindApp(mime_type : PChar; var app : TEntryRef) : TStatus_t; - function FindApp(var ref : TEntryRef; var app : TEntryRef) : TStatus_t; - function Broadcast(msg : TMessage) : TStatus_t; - function Broadcast(msg : TMessage; reply_to : TMessenger) : TStatus_t; - function StopWatching(target : TMessenger) : TStatus_t; - function ActivateApp(team : TTeam_id) : TStatus_t; - function Launch(mime_type : PChar; initial_msgs : TMessage; var app_team : TTeam_id) : TStatus_t; - function Launch(mime_type : PChar; message_list : TList; var app_team : TTeam_id) : TStatus_t; - function Launch(mime_type : PChar; argc : integer; args : PChar; var app_team : TTeam_id) : TStatus_t; - function Launch(var ref : TEntryRef; initial_message : TMessage; var app_team : TTeam_id) : TStatus_t; - function Launch(var ref : TEntryRef; message_list : TList; var app_team : TTeam_id) : TStatus_t; - function Launch(var ref : TEntryRef; argc : integer; args : PChar; var app_team : TTeam_id) : TStatus_t; - procedure GetRecentDocuments(refList : TMessage; maxCount : integer; ofType : PChar; openedByAppSig : PChar); - procedure GetRecentDocuments(refList : TMessage; maxCount : integer; ofTypeList : PChar; ofTypeListCount : integer; openedByAppSig : PChar); - procedure GetRecentFolders(refList : TMessage; maxCount : integer; openedByAppSig : PChar); - procedure GetRecentApps(refList : TMessage; maxCount : integer); - procedure AddToRecentDocuments(var doc : TEntryRef; appSig : PChar); - procedure AddToRecentFolders(var folder : TEntryRef; appSig : PChar); -// private -// procedure enum mtarget { MAIN_MESSENGER, MIME_MESSENGER, USE_GIVEN }; -{ function _StartWatching(t : ; roster_mess : TMessenger; what : Cardinal; notify : TMessenger; event_mask : Cardinal) : TStatus_t; - function _StopWatching(t : ; roster_mess : TMessenger; what : Cardinal; notify : TMessenger) : TStatus_t; - function AddApplication(mime_sig : PChar; ref : ^TEntryRef; flags : Cardinal; team : TTeam_id; thread : TThread_id; port : TPort_id; full_reg : boolean) : Cardinal; - procedure SetSignature(team : TTeam_id; mime_sig : PChar); - procedure SetThread(team : TTeam_id; tid : TThread_id); - procedure SetThreadAndTeam(entry_token : Cardinal; tid : TThread_id; team : TTeam_id); - procedure CompleteRegistration(team : TTeam_id; : TThread_id; port : TPort_id); - function IsAppPreRegistered(ref : ^TEntryRef; team : TTeam_id; info : ^TAppInfo) : boolean; - procedure RemovePreRegApp(entry_token : Cardinal); - procedure RemoveApp(team : TTeam_id); - function xLaunchAppPrivate(mime_sig : PChar; ref : ^TEntryRef; msg_list : TList; cargs : integer; args : PChar; app_team : ^TTeam_id) : TStatus_t; - function UpdateActiveApp(team : TTeam_id) : boolean; - procedure SetAppFlags(team : TTeam_id; flags : Cardinal); - procedure DumpRoster; - function resolve_app(in_type : PChar; ref : ^TEntryRef; app_ref : ^TEntryRef; app_sig : PChar; app_flags : Cardinal; was_document : boolean) : TStatus_t; - function translate_ref(ref : ^TEntryRef; app_meta : TBMimeType; app_ref : ^TEntryRef; app_file : TBFile; app_sig : PChar; was_document : boolean) : TStatus_t; - function translate_type(mime_type : PChar; meta : TBMimeType; app_ref : ^TEntryRef; app_file : TBFile; app_sig : PChar) : TStatus_t; - function sniff_file(file : ^TEntryRef; finfo : TBNodeInfo; mime_type : PChar) : TStatus_t; - function is_wildcard(sig : PChar) : boolean; - function get_unique_supporting_app(apps : TMessage; out_sig : PChar) : TStatus_t; - function get_random_supporting_app(apps : TMessage; out_sig : PChar) : TStatus_t; - function build_arg_vector(args : PChar; pargs : integer; app_ref : ^TEntryRef; doc_ref : ^TEntryRef) : PChar; - function send_to_running(tema : TTeam_id; app_ref : ^TEntryRef; cargs : integer; args : PChar; msg_list : TList; ref : ^TEntryRef) : TStatus_t; - procedure InitMessengers; - 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 : TEntryRef) : boolean; cdecl; external BePascalLibName name 'BRoster_IsRunning'; -function BRoster_TeamFor(AObject : TCPlusObject; mime_sig : PChar) : TTeam_id; cdecl; external BePascalLibName name 'BRoster_TeamFor'; -function BRoster_TeamFor(AObject : TCPlusObject; var ref : TEntryRef) : TTeam_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_GetAppInfo(AObject : TCPlusObject; sig : PChar; var info : TAppInfo) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_GetAppInfo'; -function BRoster_GetAppInfo(AObject : TCPlusObject; var ref : TEntryRef; var info : TAppInfo) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_GetAppInfo'; -function BRoster_GetRunningAppInfo(AObject : TCPlusObject; team : TTeam_id; var info : TAppInfo) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_GetRunningAppInfo'; -function BRoster_GetActiveAppInfo(AObject : TCPlusObject; var info : TAppInfo) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_GetActiveAppInfo'; -function BRoster_FindApp(AObject : TCPlusObject; mime_type : PChar; var app : TEntryRef) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_FindApp'; -function BRoster_FindApp_1(AObject : TCPlusObject; var ref : TEntryRef; var app : TEntryRef) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_FindApp'; -function BRoster_Broadcast(aRoster : TCPlusObject; msg : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_Broadcast'; -function BRoster_Broadcast_1(AObject : TCPlusObject; msg : TCPlusObject; reply_to : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_Broadcast'; -function BRoster_StopWatching(AObject : TCPlusObject; target : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_StopWatching'; -function BRoster_ActivateApp(AObject : TCPlusObject; team : TTeam_id) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_ActivateApp'; -function BRoster_Launch(AObject : TCPlusObject; mime_type : PChar; initial_msgs : TCPlusObject; var app_team : TTeam_id) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_Launch'; -function BRoster_Launch_1(AObject : TCPlusObject; mime_type : PChar; message_list : TCPlusObject; var app_team : TTeam_id) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_Launch'; -function BRoster_Launch_2(AObject : TCPlusObject; mime_type : PChar; argc : integer; args : PChar; var app_team : TTeam_id) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_Launch'; -function BRoster_Launch_3(AObject : TCPlusObject; var ref : TEntryRef; initial_message : TMessage; var app_team : TTeam_id) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_Launch'; -function BRoster_Launch_4(AObject : TCPlusObject; var ref : TEntryRef; message_list : TList; var app_team : TTeam_id) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_Launch'; -function BRoster_Launch_5(AObject : TCPlusObject; var ref : TEntryRef; argc : integer; args : PChar; var app_team : TTeam_id) : TStatus_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 : TEntryRef; appSig : PChar); cdecl; external BePascalLibName name 'BRoster_AddToRecentDocuments'; -procedure BRoster_AddToRecentFolders(AObject : TCPlusObject; var folder : TEntryRef; 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) : TStatus_t; cdecl; external BePascalLibName name 'BRoster__StartWatching'; -function BRoster__StopWatching(AObject : TCPlusObject; t : ; roster_mess : TCPlusObject; what : Cardinal; notify : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BRoster__StopWatching'; -function BRoster_AddApplication(AObject : TCPlusObject; mime_sig : PChar; ref : ^TEntryRef; flags : Cardinal; team : TTeam_id; thread : TThread_id; port : TPort_id; full_reg : boolean) : Cardinal; cdecl; external BePascalLibName name 'BRoster_AddApplication'; -procedure BRoster_SetSignature(AObject : TCPlusObject; team : TTeam_id; mime_sig : PChar); cdecl; external BePascalLibName name 'BRoster_SetSignature'; -procedure BRoster_SetThread(AObject : TCPlusObject; team : TTeam_id; tid : TThread_id); cdecl; external BePascalLibName name 'BRoster_SetThread'; -procedure BRoster_SetThreadAndTeam(AObject : TCPlusObject; entry_token : Cardinal; tid : TThread_id; team : TTeam_id); cdecl; external BePascalLibName name 'BRoster_SetThreadAndTeam'; -procedure BRoster_CompleteRegistration(AObject : TCPlusObject; team : TTeam_id; : TThread_id; port : TPort_id); cdecl; external BePascalLibName name 'BRoster_CompleteRegistration'; -function BRoster_IsAppPreRegistered(AObject : TCPlusObject; ref : ^TEntryRef; team : TTeam_id; info : ^TAppInfo) : 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 : TTeam_id); cdecl; external BePascalLibName name 'BRoster_RemoveApp'; -function BRoster_xLaunchAppPrivate(AObject : TCPlusObject; mime_sig : PChar; ref : ^TEntryRef; msg_list : TCPlusObject; cargs : integer; args : PChar; app_team : ^TTeam_id) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_xLaunchAppPrivate'; -function BRoster_UpdateActiveApp(AObject : TCPlusObject; team : TTeam_id) : boolean; cdecl; external BePascalLibName name 'BRoster_UpdateActiveApp'; -procedure BRoster_SetAppFlags(AObject : TCPlusObject; team : TTeam_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 : ^TEntryRef; app_ref : ^TEntryRef; app_sig : PChar; app_flags : Cardinal; was_document : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_resolve_app'; -function BRoster_translate_ref(AObject : TCPlusObject; ref : ^TEntryRef; app_meta : TCPlusObject; app_ref : ^TEntryRef; app_file : TCPlusObject; app_sig : PChar; was_document : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_translate_ref'; -function BRoster_translate_type(AObject : TCPlusObject; mime_type : PChar; meta : TCPlusObject; app_ref : ^TEntryRef; app_file : TCPlusObject; app_sig : PChar) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_translate_type'; -function BRoster_sniff_file(AObject : TCPlusObject; file : ^TEntryRef; finfo : TCPlusObject; mime_type : PChar) : TStatus_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 : TMessage; out_sig : PChar) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_get_unique_supporting_app'; -function BRoster_get_random_supporting_app(AObject : TCPlusObject; apps : TMessage; out_sig : PChar) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_get_random_supporting_app'; -function BRoster_build_arg_vector(AObject : TCPlusObject; args : PChar; pargs : integer; app_ref : ^TEntryRef; doc_ref : ^TEntryRef) : PChar; cdecl; external BePascalLibName name 'BRoster_build_arg_vector'; -function BRoster_send_to_running(AObject : TCPlusObject; tema : TTeam_id; app_ref : ^TEntryRef; cargs : integer; args : PChar; msg_list : TList; ref : ^TEntryRef) : TStatus_t; cdecl; external BePascalLibName name 'BRoster_send_to_running'; -procedure BRoster_InitMessengers(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_InitMessengers'; -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 : TRoster; - -implementation - -constructor TRoster.Create; -begin - inherited; - CPlusObject := BRoster_Create(Self); - be_roster := Self; -end; - -destructor TRoster.Destroy; -begin - BRoster_Destroy(CPlusObject); - inherited; -end; - -function TRoster.IsRunning(mime_sig : PChar) : boolean; -begin - Result := BRoster_IsRunning(CPlusObject, mime_sig); -end; - -function TRoster.IsRunning(var ref : TEntryRef) : boolean; -begin - Result := BRoster_IsRunning(CPlusObject, ref); -end; - -function TRoster.TeamFor(mime_sig : PChar) : TTeam_id; -begin - Result := BRoster_TeamFor(CPlusObject, mime_sig); -end; - -function TRoster.TeamFor(var ref : TEntryRef) : TTeam_id; -begin - Result := BRoster_TeamFor(CPlusObject, ref); -end; - -procedure TRoster.GetAppList(team_id_list : TList); -begin - BRoster_GetAppList(CPlusObject, team_id_list.CPlusObject); -end; - -procedure TRoster.GetAppList(sig : PChar; team_id_list : TList); -begin - BRoster_GetAppList(CPlusObject, sig, team_id_list.CPlusObject); -end; - -function TRoster.GetAppInfo(sig : PChar; var info : TAppInfo) : TStatus_t; -begin - Result := BRoster_GetAppInfo(CPlusObject, sig, info); -end; - -function TRoster.GetAppInfo(var ref : TEntryRef; var info : TAppInfo) : TStatus_t; -begin - Result := BRoster_GetAppInfo(CPlusObject, ref, info); -end; - -function TRoster.GetRunningAppInfo(team : TTeam_id; var info : TAppInfo) : TStatus_t; -begin - Result := BRoster_GetRunningAppInfo(CPlusObject, team, info); -end; - -function TRoster.GetActiveAppInfo(var info : TAppInfo) : TStatus_t; -begin - Result := BRoster_GetActiveAppInfo(CPlusObject, info); -end; - -function TRoster.FindApp(mime_type : PChar; var app : TEntryRef) : TStatus_t; -begin - Result := BRoster_FindApp(CPlusObject, mime_type, app); -end; - -function TRoster.FindApp(var ref : TEntryRef; var app : TEntryRef) : TStatus_t; -begin - Result := BRoster_FindApp_1(CPlusObject, ref, app); -end; - -function TRoster.Broadcast(msg : TMessage) : TStatus_t; -begin - Result := BRoster_Broadcast(CPlusObject, msg.CPlusObject); -end; - -function TRoster.Broadcast(msg : TMessage; reply_to : TMessenger) : TStatus_t; -begin - Result := BRoster_Broadcast_1(CPlusObject, msg.CPlusObject, reply_to.CPlusObject); -end; - -function TRoster.StopWatching(target : TMessenger) : TStatus_t; -begin - Result := BRoster_StopWatching(CPlusObject, target.CPlusObject); -end; - -function TRoster.ActivateApp(team : TTeam_id) : TStatus_t; -begin - Result := BRoster_ActivateApp(CPlusObject, team); -end; - -function TRoster.Launch(mime_type : PChar; initial_msgs : TMessage; var app_team : TTeam_id) : TStatus_t; -begin - Result := BRoster_Launch(CPlusObject, mime_type, initial_msgs.CPlusObject, app_team); -end; - -function TRoster.Launch(mime_type : PChar; message_list : TList; var app_team : TTeam_id) : TStatus_t; -begin - Result := BRoster_Launch_1(CPlusObject, mime_type, message_list.CPlusObject, app_team); -end; - -function TRoster.Launch(mime_type : PChar; argc : integer; args : PChar; var app_team : TTeam_id) : TStatus_t; -begin - Result := BRoster_Launch_2(CPlusObject, mime_type, argc, args, app_team); -end; - -function TRoster.Launch(var ref : TEntryRef; initial_message : TMessage; var app_team : TTeam_id) : TStatus_t; -begin - Result := BRoster_Launch_3(CPlusObject, ref, initial_message, app_team); -end; - -function TRoster.Launch(var ref : TEntryRef; message_list : TList; var app_team : TTeam_id) : TStatus_t; -begin - Result := BRoster_Launch_4(CPlusObject, ref, message_list, app_team); -end; - -function TRoster.Launch(var ref : TEntryRef; argc : integer; args : PChar; var app_team : TTeam_id) : TStatus_t; -begin - Result := BRoster_Launch_5(CPlusObject, ref, argc, args, app_team); -end; - -procedure TRoster.GetRecentDocuments(refList : TMessage; maxCount : integer; ofType : PChar; openedByAppSig : PChar); -begin - BRoster_GetRecentDocuments(CPlusObject, refList.CPlusObject, maxCount, ofType, openedByAppSig); -end; - -procedure TRoster.GetRecentDocuments(refList : TMessage; maxCount : integer; ofTypeList : PChar; ofTypeListCount : integer; openedByAppSig : PChar); -begin - BRoster_GetRecentDocuments(CPlusObject, refList.CPlusObject, maxCount, ofTypeList, ofTypeListCount, openedByAppSig); -end; - -procedure TRoster.GetRecentFolders(refList : TMessage; maxCount : integer; openedByAppSig : PChar); -begin - BRoster_GetRecentFolders(CPlusObject, refList.CPlusObject, maxCount, openedByAppSig); -end; - -procedure TRoster.GetRecentApps(refList : TMessage; maxCount : integer); -begin - BRoster_GetRecentApps(CPlusObject, refList.CPlusObject, maxCount); -end; - -procedure TRoster.AddToRecentDocuments(var doc : TEntryRef; appSig : PChar); -begin - BRoster_AddToRecentDocuments(CPlusObject, doc, appSig); -end; - -procedure TRoster.AddToRecentFolders(var folder : TEntryRef; appSig : PChar); -begin - BRoster_AddToRecentFolders(CPlusObject, folder, appSig); -end; - -initialization - be_roster := TRoster.Wrap(Get_be_roster); - -finalization - be_roster.UnWrap; - be_roster := nil; -end. diff --git a/bepascal/bepascal/be/bepas_kernel/beobj.cpp b/bepascal/bepascal/be/bepas_kernel/beobj.cpp deleted file mode 100644 index 76fbe59..0000000 --- a/bepascal/bepascal/be/bepas_kernel/beobj.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* 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/bepascal/be/bepas_kernel/beobj.h b/bepascal/bepascal/be/bepas_kernel/beobj.h deleted file mode 100644 index cad0ad4..0000000 --- a/bepascal/bepascal/be/bepas_kernel/beobj.h +++ /dev/null @@ -1,38 +0,0 @@ -/* 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/bepascal/be/bepas_kernel/beobj.pp b/bepascal/bepascal/be/bepas_kernel/beobj.pp deleted file mode 100644 index 92e1141..0000000 --- a/bepascal/bepascal/be/bepas_kernel/beobj.pp +++ /dev/null @@ -1,126 +0,0 @@ -{ 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/bepascal/be/device/Joystick.cpp b/bepascal/bepascal/be/device/Joystick.cpp deleted file mode 100644 index d433767..0000000 --- a/bepascal/bepascal/be/device/Joystick.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/* 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/bepascal/be/device/Joystick.pp b/bepascal/bepascal/be/device/Joystick.pp deleted file mode 100644 index 7d5d63e..0000000 --- a/bepascal/bepascal/be/device/Joystick.pp +++ /dev/null @@ -1,220 +0,0 @@ -{ 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 - TJoystick = class(TBeObject) - private - public - constructor Create; override; - destructor Destroy; override; - function Open(portName : PChar) : TStatus_t; - procedure Close; - function Open_1(portName : PChar; enter_enhanced : boolean):TStatus_t; - - function Update: TStatus_t; - function SetMaxLatency( max_latency:TBigtime_t): TStatus_t; - function CountDevices : Cardinal; - function GetDeviceName( n : Integer; name : PChar; bufSize: Tsize_t): TStatus_t; - - function CountSticks: Cardinal; - function CountAxes:Cardinal; - function CountHats:Cardinal; - function CountButtons:Cardinal; - function GetAxisValues( out_values : Integer; for_stick : cardinal): TStatus_t; - function ButtonValues(for_stick: cardinal):Cardinal; - function IsCalibrationEnabled:boolean; - function EnableCalibration (calibrates : boolean): TStatus_t; - -//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean; -// function GetAxisNameAt(index: cardinal; BString *out_name): TStatus_t; -// function GetHatNameAt( index: cardinal,BString *out_name): TStatus_t; -// function GetButtonNameAt( index: cardinal,BString *out_name): TStatus_t; c -// function GetControllerModule( BString *out_name): TStatus_t; -// function GetControllerName( BString *out_name): TStatus_t; -// function GetHatValues( uint8 *out_hats;for_stick: cardinal): TStatus_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):TStatus_t ; cdecl; external BePascalLibName name 'BJoystick_Open'; -function BJoystick_Open_1(AObject : TCPlusObject; portName : PChar; enter_enhanced : boolean):TStatus_t; cdecl; external BePascalLibName name 'BJoystick_Open_1'; -procedure BJoystick_Close(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BJoystick_Close'; -function BJoystick_Update(AObject : TCPlusObject): TStatus_t; cdecl; external BePascalLibName name 'BJoystick_Update'; -function BJoystick_SetMaxLatency(AObject : TCPlusObject; max_latency:TBigtime_t): TStatus_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): TStatus_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): TStatus_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): TStatus_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): TStatus_t; cdecl; external BePascalLibName name 'BJoystick_GetHatValues'; -//function BJoystick_GetAxisNameAt(BAObject : TCPlusObject;index: cardinal; BString *out_name): TStatus_t; cdecl; external BePascalLibName name 'BJoystick_GetAxisNameAt'; -//function BJoystick_GetHatNameAt(BAObject : TCPlusObject; index: cardinal, BString *out_name): TStatus_t; cdecl; external BePascalLibName name 'BJoystick_GetHatNameAt'; -//function BJoystick_GetButtonNameAt(BAObject : TCPlusObject; index: cardinal,BString *out_name): TStatus_t; cdecl; external BePascalLibName name 'BJoystick_GetButtonNameAt'; -//function BJoystick_GetControllerModule(BAObject : TCPlusObject, BString *out_name): TStatus_t; cdecl; external BePascalLibName name 'BJoystick_GetControllerModule'; -//function BJoystick_GetControllerName(BAObject : TCPlusObject, BString *out_name): TStatus_t; cdecl; external BePascalLibName name 'BJoystick_GetControllerName'; - - -implementation - - - -constructor TJoystick.Create; -begin - inherited; - CPlusObject := BJoystick_Create(Self); -end; - -destructor TJoystick.Destroy; -begin - if CPlusObject <> nil then - BJoystick_Free(CPlusObject); - inherited; -end; - - -function TJoystick.Open(portName : PChar) : TStatus_t; -begin - result := BJoystick_Open(CPlusObject, portName); -end; - -function TJoystick.Open_1( portName : PChar; enter_enhanced : boolean):TStatus_t; -begin - result := BJoystick_Open_1(CPlusObject, portName , enter_enhanced); -end; - - -procedure TJoystick.Close; -begin - BJoystick_Close(CPlusObject); -end; - -function TJoystick.Update: TStatus_t; -begin - result:=BJoystick_Update(CPlusObject); -end; - -function TJoystick.SetMaxLatency(max_latency:TBigtime_t): TStatus_t; -begin - result:=BJoystick_SetMaxLatency(CPlusObject, max_latency); -end; - -function TJoystick.CountDevices :Cardinal; -begin - result:=BJoystick_CountDevices(CPlusObject); -end; - -function TJoystick.GetDeviceName( n : Integer; name : PChar; bufSize: Tsize_t): TStatus_t; -begin - result:=BJoystick_GetDeviceName(CPlusObject, n, name, bufSize ); -end; - -//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean; - -function TJoystick.CountSticks: Cardinal; -begin - result:=BJoystick_CountSticks(CPlusObject); -end; - -function TJoystick.CountAxes:Cardinal; -begin - result:=BJoystick_CountAxes(CPlusObject); -end; - -function TJoystick.CountHats:Cardinal; -begin - result:=BJoystick_CountHats(CPlusObject); -end; - -function TJoystick.CountButtons:Cardinal; -begin - result:=BJoystick_CountButtons(CPlusObject); -end; - -function TJoystick.GetAxisValues( out_values : Integer; for_stick : cardinal): TStatus_t; -begin - result:=BJoystick_GetAxisValues(CPlusObject, out_values, for_stick); -end; - -//function TJoystick.GetHatValues( uint8 *out_hats ; for_stick: cardinal): TStatus_t; -//begin -// result:=BJoystick_GetHatValues( out_hats,for_stick); -//end; - -function TJoystick.ButtonValues(for_stick: cardinal):Cardinal; -begin - result:=BJoystick_ButtonValues(CPlusObject,for_stick); -end; - -//function TJoystick.GetAxisNameAt(index: cardinal; BString *out_name): TStatus_t; -//begin -// result:=BJoystick_GetAxisNameAt(CPlusObject,index,out_name); -//end; - -//function TJoystick.GetHatNameAt( index: cardinal,BString *out_name): TStatus_t; -//begin -// result:=BJoystick_GetHatNameAt(CPlusObject, index,out_name); -//end; - -//function TJoystick.GetButtonNameAt( index: cardinal,BString *out_name): TStatus_t; -//begin -// result:=BJoystick_GetButtonNameAt(CPlusObject, index,out_name); -//end; - -//function TJoystick.GetControllerModule( BString *out_name): TStatus_t; -//begin -// result:=BJoystick_GetControllerModule(CPlusObject, out_name); -//end; - -//function TJoystick.GetControllerName( BString: *out_name): TStatus_t; -//begin -// result:=BJoystick_GetControllerName(CPlusObject, out_name); -//end; - -function TJoystick.IsCalibrationEnabled:boolean; -begin - result:=BJoystick_IsCalibrationEnabled(CPlusObject); -end; - -function TJoystick.EnableCalibration( calibrates : boolean): TStatus_t; -begin - result:=BJoystick_EnableCalibration(CPlusObject, calibrates); -end; - - -end. - - - diff --git a/bepascal/bepascal/be/device/SerialPort.cpp b/bepascal/bepascal/be/device/SerialPort.cpp deleted file mode 100644 index 0f08fff..0000000 --- a/bepascal/bepascal/be/device/SerialPort.cpp +++ /dev/null @@ -1,441 +0,0 @@ -/* 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/bepascal/be/device/serialport.pp b/bepascal/bepascal/be/device/serialport.pp deleted file mode 100644 index 51e97ba..0000000 --- a/bepascal/bepascal/be/device/serialport.pp +++ /dev/null @@ -1,277 +0,0 @@ -{ 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 ;-) - TDataRate = (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); - - TDataBits = (B_DATA_BITS_7, B_DATA_BITS_8); - - TStopBits = (B_STOP_BITS_1, B_STOP_BITS_2); - - TParityMode = (B_NO_PARITY, B_ODD_PARITY, B_EVEN_PARITY); - -const - B_NOFLOW_CONTROL = 0; - B_HARDWARE_CONTROL = 1; - B_SOFTWARE_CONTROL = 2; - -type - TSerialPort = class(TBeObject) - private - public - constructor Create; override; - destructor Destroy; override; - function Open(portName : PChar) : TStatus_t; - procedure Close; - - function Read(buf : PChar; count : TSize_t) : TSSize_t; - function Write(const buf : PChar; count : TSize_t) : TSSize_t; - - procedure SetBlocking(Blocking : boolean); - function SetTimeout(microSeconds : TBigtime_t) : TStatus_t; - function SetDataRate(bitsPerSecond : TDataRate) : TStatus_t; - function GetDataRate : TDataRate; - procedure SetDataBits(numBits : TDataBits); - function GetDataBits : TDataBits; - procedure SetStopBits(numBits : TStopBits); - function GetStopBits : TStopBits; - procedure SetParityMode(numBits : TParityMode); - function GetParityMode : TParityMode; - procedure ClearInput; - procedure ClearOutput; - - procedure SetFlowControl(method : Cardinal); - function GetFlowControl : Cardinal; - function SetDTR(asserted : boolean) : TStatus_t; - function SetRTS(asserted : boolean) : TStatus_t; - function NumCharsAvailable(var wait_until_this_many : integer) : TStatus_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 : TSize_t) : TStatus_t; - - property DataRate : TDataRate read GetDataRate write SetDataRate; - property DataBits : TDataBits read GetDataBits write SetDataBits; - property StopBits : TStopBits read GetStopBits write SetStopBits; - property ParityMode : TParityMode read GetParityMode write SetParityMode; - 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) : TStatus_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 : TSize_t) : TSSize_t; cdecl; external BePascalLibName name 'BSerialPort_Read'; -function BSerialPort_Write(AObject : TCPlusObject; const buf : PChar; count : TSize_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) : TStatus_t; cdecl; external BePascalLibName name 'BSerialPort_SetTimeout'; -function BSerialPort_SetDataRate(AObject : TCPlusObject; bitsPerSecond : TDataRate) : TStatus_t; cdecl; external BePascalLibName name 'BSerialPort_SetDataRate'; -function BSerialPort_DataRate(AObject : TCPlusObject) : TDataRate; cdecl; external BePascalLibName name 'BSerialPort_DataRate'; -procedure BSerialPort_SetDataBits(AObject : TCPlusObject; numBits : TDataBits); cdecl; external BePascalLibName name 'BSerialPort_SetDataBits'; -function BSerialPort_DataBits(AObject : TCPlusObject) : TDataBits; cdecl; external BePascalLibName name 'BSerialPort_DataBits'; -procedure BSerialPort_SetStopBits(AObject : TCPlusObject; numBits : TStopBits); cdecl; external BePascalLibName name 'BSerialPort_SetStopBits'; -function BSerialPort_StopBits(AObject : TCPlusObject) : TStopBits; cdecl; external BePascalLibName name 'BSerialPort_StopBits'; -procedure BSerialPort_SetParityMode(AObject : TCPlusObject; numBits : TParityMode); cdecl; external BePascalLibName name 'BSerialPort_SetParityMode'; -function BSerialPort_ParityMode(AObject : TCPlusObject) : TParityMode; 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) : TStatus_t; cdecl; external BePascalLibName name 'BSerialPort_SetDTR'; -function BSerialPort_SetRTS(AObject : TCPlusObject; asserted : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BSerialPort_SetRTS'; -function BSerialPort_NumCharsAvailable(AObject : TCPlusObject; var wait_until_this_many : integer) : TStatus_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 : TSize_t): TStatus_t; cdecl; external BePascalLibName name 'BSerialPort_GetDeviceName'; - -implementation - -constructor TSerialPort.Create; -begin - inherited; - CPlusObject := BSerialPort_Create(Self); -end; - -destructor TSerialPort.Destroy; -begin - if CPlusObject <> nil then - BSerialPort_Free(CPlusObject); - inherited; -end; - -function TSerialPort.Open(portName : PChar) : TStatus_t; -begin - result := BSerialPort_Open(CPlusObject, portName); -end; - -procedure TSerialPort.Close; -begin - BSerialPort_Close(CPlusObject); -end; - -function TSerialPort.Read(buf : PChar; count : TSize_t) : TSSize_t; -begin - Result := BSerialPort_Read(CPlusObject, buf, count); -end; - -function TSerialPort.Write(const buf : PChar; count : TSize_t) : TSSize_t; -begin - Result := BSerialPort_Write(CPlusObject, buf, count); -end; - -procedure TSerialPort.SetBlocking(Blocking : boolean); -begin - BSerialPort_SetBlocking(CPlusObject, Blocking); -end; - -function TSerialPort.SetTimeout(microSeconds : TBigtime_t) : TStatus_t; -begin - Result := BSerialPort_SetTimeout(CPlusObject, microSeconds); -end; - -function TSerialPort.SetDataRate(bitsPerSecond : TDataRate) : TStatus_t; -begin - Result := BSerialPort_SetDataRate(CPlusObject, bitsPerSecond); -end; - -function TSerialPort.GetDataRate : TDataRate; -begin - Result := BSerialPort_DataRate(CPlusObject); -end; - -procedure TSerialPort.SetDataBits(numBits : TDataBits); -begin - BSerialPort_SetDataBits(CPlusObject, numBits); -end; - -function TSerialPort.GetDataBits : TDataBits; -begin - Result := BSerialPort_DataBits(CPlusObject); -end; - -procedure TSerialPort.SetStopBits(numBits : TStopBits); -begin - BSerialPort_SetStopBits(CPlusObject, numBits); -end; - -function TSerialPort.GetStopBits : TStopBits; -begin - Result := BSerialPort_StopBits(CPlusObject); -end; - -procedure TSerialPort.SetParityMode(numBits : TParityMode); -begin - BSerialPort_SetParityMode(CPlusObject, numBits); -end; - -function TSerialPort.GetParityMode : TParityMode; -begin - Result := BSerialPort_ParityMode(CPlusObject); -end; - -procedure TSerialPort.ClearInput; -begin - BSerialPort_ClearInput(CPlusObject); -end; - -procedure TSerialPort.ClearOutput; -begin - BSerialPort_ClearOutput(CPlusObject); -end; - -procedure TSerialPort.SetFlowControl(method : Cardinal); -begin - BSerialPort_SetFlowControl(CPlusobject, method); -end; - -function TSerialPort.GetFlowControl : Cardinal; -begin - Result := BSerialPort_FlowControl(CPlusObject); -end; - -function TSerialPort.SetDTR(asserted : boolean) : TStatus_t; -begin - Result := BSerialPort_SetDTR(CPlusObject, asserted); -end; - -function TSerialPort.SetRTS(asserted : boolean) : TStatus_t; -begin - Result := BSerialPort_SetRTS(CPlusObject, asserted); -end; - -function TSerialPort.NumCharsAvailable(var wait_until_this_many : integer) : TStatus_t; -begin - Result := BSerialPort_NumCharsAvailable(CPlusObject, wait_until_this_many); -end; - -function TSerialPort.IsCTS : boolean; -begin - Result := BSerialPort_IsCTS(CPlusObject); -end; - -function TSerialPort.IsDSR : boolean; -begin - Result := BSerialPort_IsDSR(CPlusObject); -end; - -function TSerialPort.IsRI : boolean; -begin - Result := BSerialPort_IsRI(CPlusObject); -end; - -function TSerialPort.IsDCD : boolean; -begin - Result := BSerialPort_IsDCD(CPlusObject); -end; - -function TSerialPort.WaitForInput : TSSize_t; -begin - Result := BSerialPort_WaitForInput(CPlusObject); -end; - -function TSerialPort.CountDevices : integer; -begin - Result := BSerialPort_CountDevices(CPlusObject); -end; - -function TSerialPort.GetDeviceName(n : integer; name : PChar; bufSize : TSize_t) : TStatus_t; -begin - Result := BSerialPort_GetDeviceName(CPlusObject, n, name, bufSize); -end; - -end. diff --git a/bepascal/bepascal/be/hey/hey.cpp b/bepascal/bepascal/be/hey/hey.cpp deleted file mode 100644 index 116b4a8..0000000 --- a/bepascal/bepascal/be/hey/hey.cpp +++ /dev/null @@ -1,1340 +0,0 @@ -// 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/bepascal/be/hey/hey.h b/bepascal/bepascal/be/hey/hey.h deleted file mode 100644 index 0c39cd6..0000000 --- a/bepascal/bepascal/be/hey/hey.h +++ /dev/null @@ -1,21 +0,0 @@ -#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/bepascal/be/hey/hey.pp b/bepascal/bepascal/be/hey/hey.pp deleted file mode 100644 index 9df3e58..0000000 --- a/bepascal/bepascal/be/hey/hey.pp +++ /dev/null @@ -1,70 +0,0 @@ -unit hey; - -interface - -uses - beobj, SysUtils, Messenger, Message, SupportDefs, Roster, OS, List, fdblib; - -type - BHey = class - public - class function Hey(atarget : TMessenger; aarg : string; areply : TMessage) : TStatus_t; - class function Hey(AppName : string; aarg : string; areply : TMessage) : TStatus_t; - class function GetMessenger(AppName : string) : TMessenger; - end; - -implementation - -function InternalHey(target : TCPlusObject; arg : PChar; reply : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'Hey__FP10BMessengerPCcP8BMessage';//'Hey__FP10BMessengerPPcPllP8BMessage'; - -class function BHey.Hey(AppName : string; aArg : string; aReply : TMessage) : TStatus_t; -var - Messenger : TMessenger; -begin - Messenger := BHey.GetMessenger(AppName); - if Messenger <> nil then - Result := BHey.Hey(Messenger, aArg, aReply); -end; - -class function BHey.Hey(atarget : TMessenger; aarg : string; areply : TMessage) : TStatus_t; -var - local : string; -begin - local := aarg + #0; - Result := InternalHey(atarget.CPlusObject, @local[1], areply.CPlusObject); -end; - -class function BHey.GetMessenger(AppName : string) : TMessenger; -var - List : TList; - i : integer; - Team_id : TTeam_id; - AppInfo : TAppInfo; - Status_t : TStatus_t; -begin - Result := nil; - List := TList.Create; - try - be_roster.GetAppList(List); - for i := 0 to List.CountItems - 1 do - begin - Team_id := TTeam_id(List.ItemAt(i)); - be_roster.GetRunningAppInfo(Team_id, AppInfo); - if AppName = PChar(AppInfo.Signature) then - begin - Result := TMessenger.Create(PChar(AppInfo.Signature), -1, Status_t); - Break; - end - else if PChar(AppInfo.ref.name) = AppName then - begin - Result := TMessenger.Create(0, Team_id, Status_t); - Break; - end; - end; - finally - List.Free; - end; -end; - - -end. diff --git a/bepascal/bepascal/be/interface/Alert.cpp b/bepascal/bepascal/be/interface/Alert.cpp deleted file mode 100644 index 27bb834..0000000 --- a/bepascal/bepascal/be/interface/Alert.cpp +++ /dev/null @@ -1,534 +0,0 @@ -/* 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/bepascal/be/interface/Bitmap.cpp b/bepascal/bepascal/be/interface/Bitmap.cpp deleted file mode 100644 index 087826d..0000000 --- a/bepascal/bepascal/be/interface/Bitmap.cpp +++ /dev/null @@ -1,809 +0,0 @@ -/* 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 _BITMAP_CPP -#define _BITMAP_CPP - -#include "Bitmap.h" - -#include "view.h" -#include -#include - -/*----------------------------------------------------------------*/ -/*----- BBitmap class --------------------------------------------*/ -class BPBitmap : public BBitmap, public BPArchivable -{ -public: - BPBitmap(TPasObject PasObject, - BRect bounds, - uint32 flags, - color_space depth, - int32 bytesPerRow=B_ANY_BYTES_PER_ROW, - screen_id screenID=B_MAIN_SCREEN_ID); - BPBitmap(TPasObject PasObject, - BRect bounds, - color_space depth, - bool accepts_views = false, - bool need_contiguous = false); - BPBitmap(TPasObject PasObject, - const BBitmap* source, - bool accepts_views = false, - bool need_contiguous = false); - BPBitmap(TPasObject PasObject, BMessage *data); - -//virtual ~BBitmap(); - -/* Archiving */ -static BArchivable *Instantiate(BMessage *data); -//virtual status_t Archive(BMessage *data, bool deep = true) const; - - status_t InitCheck() const; - bool IsValid() const; - - status_t LockBits(uint32 *state=NULL); - void UnlockBits(); - - area_id Area() const; - void * Bits() const; - int32 BitsLength() const; - int32 BytesPerRow() const; - color_space ColorSpace() const; - BRect Bounds() const; - - void SetBits(const void *data, - int32 length, - int32 offset, - color_space cs); - - status_t GetOverlayRestrictions(overlay_restrictions *restrict) const; - -/* to mimic a BWindow */ -virtual void AddChild(BView *view); -virtual bool RemoveChild(BView *view); - int32 CountChildren() const; - BView *ChildAt(int32 index) const; - BView *FindView(const char *view_name) const; - BView *FindView(BPoint point) const; - bool Lock(); - void Unlock(); - bool IsLocked() const; - -virtual status_t Perform(perform_code d, void *arg); - -/*----- Private or reserved -----------------------------------------*/ -private: -/* -friend class BView; -friend class BApplication; -friend void _IMPEXP_BE _get_screen_bitmap_(BBitmap *,BRect,bool); - -virtual void _ReservedBitmap1(); -virtual void _ReservedBitmap2(); -virtual void _ReservedBitmap3(); - - BBitmap(const BBitmap &); - BBitmap &operator=(const BBitmap &); - - char *get_shared_pointer() const; - void set_bits(long offset, char *data, long length); - void set_bits_24(long offset, char *data, long length); - void set_bits_24_local_gray(long offset, char *data, long len); - void set_bits_24_local_256(long offset, uchar *data, long len); - void set_bits_24_24(long offset, char *data, long length, - bool big_endian_dst); - void set_bits_8_24(long offset, char *data, long length, - bool big_endian_dst); - void set_bits_gray_24(long offset, char *data, long length, - bool big_endian_dst); - int32 get_server_token() const; - void InitObject( BRect frame, color_space depth, - uint32 flags, int32 bytesPerRow, screen_id screenID); - void AssertPtr(); - - void *fBasePtr; - int32 fSize; - color_space fType; - BRect fBound; - int32 fRowBytes; - BWindow *fWindow; - int32 fServerToken; - int32 fToken; - uint8 unused; - area_id fArea; - area_id fOrigArea; - uint32 fFlags; - status_t fInitError; -*/ -}; -/*-------------------------------------------------------------*/ -/*-------------------------------------------------------------*/ - -BPBitmap::BPBitmap(TPasObject PasObject, - BRect bounds, - uint32 flags, - color_space depth, - int32 bytesPerRow = B_ANY_BYTES_PER_ROW, - screen_id screenID = B_MAIN_SCREEN_ID) - : BBitmap(bounds, flags, depth, bytesPerRow, screenID), - BPArchivable(PasObject)//, -// BPasObject(PasObject) -{ - -} - -BPBitmap::BPBitmap(TPasObject PasObject, - BRect bounds, - color_space depth, - bool accepts_views = false, - bool need_contiguous = false) - : BBitmap(bounds, depth, accepts_views, need_contiguous), - BPArchivable(PasObject)//, -// BPasObject(PasObject) -{ - -} - -BPBitmap::BPBitmap(TPasObject PasObject, - const BBitmap* source, - bool accepts_views = false, - bool need_contiguous = false) - : BBitmap(source, accepts_views, need_contiguous), - BPArchivable(PasObject)//, -// BPasObject(PasObject) -{ - -} - -BPBitmap::BPBitmap(TPasObject PasObject, BMessage *data) - : BBitmap(data), - BPArchivable(PasObject)//, -// BPasObject(PasObject) -{ - -} - -status_t -BPBitmap::InitCheck(void) const -{ - return BBitmap::InitCheck(); -} - -bool -BPBitmap::IsValid(void) const -{ - return BBitmap::IsValid(); -} - -status_t -BPBitmap::LockBits(uint32 *state=NULL) -{ - return BBitmap::LockBits(state); -} - -void -BPBitmap::UnlockBits(void) -{ - BBitmap::UnlockBits(); -} - -area_id -BPBitmap::Area(void) const -{ - return BBitmap::Area(); -} - -void * -BPBitmap::Bits(void) const -{ - return BBitmap::Bits(); -} - -int32 -BPBitmap::BitsLength(void) const -{ - return BBitmap::BitsLength(); -} - -int32 -BPBitmap::BytesPerRow(void) const -{ - return BBitmap::BytesPerRow(); -} - -color_space -BPBitmap::ColorSpace(void) const -{ - return BBitmap::ColorSpace(); -} - -BRect -BPBitmap::Bounds(void) const -{ - return BBitmap::Bounds(); -} - -void -BPBitmap::SetBits(const void *data, int32 length, int32 offset, color_space cs) -{ - BBitmap::SetBits(data, length, offset, cs); -} - -status_t -BPBitmap::GetOverlayRestrictions(overlay_restrictions *restrict) const -{ - return BBitmap::GetOverlayRestrictions(restrict); -} - -void -BPBitmap::AddChild(BView *view) -{ - BBitmap::AddChild(view); -} - -bool -BPBitmap::RemoveChild(BView *view) -{ - BBitmap::RemoveChild(view); -} - -int32 -BPBitmap::CountChildren(void) const -{ - return BBitmap::CountChildren(); -} - -bool -BPBitmap::Lock(void) -{ - return BBitmap::Lock(); -} - -void -BPBitmap::Unlock(void) -{ - BBitmap::Unlock(); -} - -bool -BPBitmap::IsLocked(void) const -{ - return BBitmap::IsLocked(); -} - -status_t -BPBitmap::Perform(perform_code d, void *arg) -{ - return BBitmap::Perform(d, arg); -} - -/*-------------------------------------------------------------*/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/* - * Method: BBitmap::BBitmap - * Descr: - */ -TCPlusObject BBitmap_Create(TPasObject PasObject, BRect bounds, uint32 flags, color_space depth, int32 bytesPerRow, screen_id screenID) -{ - return new BPBitmap(PasObject, bounds, flags, depth, bytesPerRow, screenID); -} - -/* - * Method: BBitmap::BBitmap - * Descr: - */ -TCPlusObject BBitmap_Create_1 -(TPasObject PasObject, BRect bounds, color_space depth, bool accepts_views, bool need_contiguous) -{ - return new BPBitmap(PasObject, bounds, depth, accepts_views, need_contiguous); -} - - -/* - * Method: BBitmap::BBitmap - * Descr: - */ -TCPlusObject BBitmap_Create_2 -(TPasObject PasObject, const BBitmap *source, bool accepts_views, bool need_contiguous) -{ - return new BPBitmap(PasObject, source, accepts_views, need_contiguous); -} - - -/* BBitmap(BMessage *data); - * Method: BBitmap::BBitmap - * Descr: - */ -TCPlusObject BBitmap_Create_3(TPasObject PasObject, BMessage *data) -{ - return new BPBitmap(PasObject, data); -} - - -/* - * Method: BBitmap::~BBitmap - * Descr: - */ -void BBitmap_Free(BBitmap *Bitmap) -{ - delete Bitmap; -} - - -/* - * Method: BBitmap::Instantiate - * Descr: - */ -BArchivable * -BBitmap_Instantiate(BBitmap *Bitmap, BMessage *data) -{ - return Bitmap->Instantiate(data); -} - - -/* - * Method: BBitmap::Archive - * Descr: - */ -status_t -BBitmap_Archive(BBitmap *Bitmap, BMessage *data, bool deep) -{ - return Bitmap->Archive(data, deep); -} - - -/* - * Method: BBitmap::InitCheck - * Descr: - */ -status_t -BBitmap_InitCheck(BBitmap *Bitmap) -{ - return Bitmap->InitCheck(); -} - - -/* - * Method: BBitmap::IsValid - * Descr: - */ -bool -BBitmap_IsValid(BBitmap *Bitmap) -{ - return Bitmap->IsValid(); -} - - -/* - * Method: BBitmap::LockBits - * Descr: - */ -status_t -BBitmap_LockBits(BBitmap *Bitmap, uint32 *state) -{ - return Bitmap->LockBits(state); -} - - -/* - * Method: BBitmap::UnlockBits - * Descr: - */ -void -BBitmap_UnlockBits(BBitmap *Bitmap) -{ - Bitmap->UnlockBits(); -} - - -/* - * Method: BBitmap::Area - * Descr: - */ -area_id -BBitmap_Area(BBitmap *Bitmap) -{ - return Bitmap->Area(); -} - - -/* - * Method: BBitmap::Bits - * Descr: - */ -void * -BBitmap_Bits(BBitmap *Bitmap) -{ - Bitmap->Bits(); -} - - -/* - * Method: BBitmap::BitsLength - * Descr: - */ -int32 -BBitmap_BitsLength_1 -(BBitmap *Bitmap) -{ - return Bitmap->BitsLength(); -} - - -/* - * Method: BBitmap::BytesPerRow - * Descr: - */ -int32 -BBitmap_BytesPerRow(BBitmap *Bitmap) -{ - return Bitmap->BytesPerRow(); -} - - -/* - * Method: BBitmap::ColorSpace - * Descr: - */ -color_space -BBitmap_ColorSpace(BBitmap *Bitmap) -{ - return Bitmap->ColorSpace(); -} - - -/* - * Method: BBitmap::Bounds - * Descr: - */ -BRect -BBitmap_Bounds(BBitmap *Bitmap) -{ - return Bitmap->Bounds(); -} - - -/* - * Method: BBitmap::SetBits - * Descr: - */ -void -BBitmap_SetBits(BBitmap *Bitmap, const void *data, int32 length, int32 offset, color_space cs) -{ - Bitmap->SetBits(data, length, offset, cs); -} - - -/* - * Method: BBitmap::GetOverlayRestrictions - * Descr: - */ -status_t -BBitmap_GetOverlayRestrictions(BBitmap *Bitmap, overlay_restrictions *restrict) -{ - return Bitmap->GetOverlayRestrictions(restrict); -} - - -/* - * Method: BBitmap::AddChild - * Descr: - */ -void -BBitmap_AddChild(BBitmap *Bitmap, BView *view) -{ - Bitmap->AddChild(view); -} - - -/* - * Method: BBitmap::RemoveChild - * Descr: - */ -bool -BBitmap_RemoveChild(BBitmap *Bitmap, BView *view) -{ - return Bitmap->RemoveChild(view); -} - - -/* - * Method: BBitmap::CountChildren - * Descr: - */ -int32 -BBitmap_CountChildren(BBitmap *Bitmap) -{ - return Bitmap->CountChildren(); -} - - -/* - * Method: BBitmap::ChildAt - * Descr: - */ -BView * -BBitmap_ChildAt(BBitmap *Bitmap, int32 index) -{ - return Bitmap->ChildAt(index); -} - - -/* - * Method: BBitmap::FindView - * Descr: - */ -BView * -BBitmap_FindView(BBitmap *Bitmap, const char *view_name) -{ - return Bitmap->FindView(view_name); -} - - -/* - * Method: BBitmap::FindView - * Descr: - */ -BView * -BBitmap_FindView_1 -(BBitmap *Bitmap, BPoint point) -{ - return Bitmap->FindView(point); -} - - -/* - * Method: BBitmap::Lock - * Descr: - */ -bool -BBitmap_Lock(BBitmap *Bitmap) -{ - return Bitmap->Lock(); -} - - -/* - * Method: BBitmap::Unlock - * Descr: - */ - -void -BBitmap_Unlock(BBitmap *Bitmap) -{ - Bitmap->Unlock(); -} - - -/* - * Method: BBitmap::IsLocked - * Descr: - */ - -bool -BBitmap_IsLocked(BBitmap *Bitmap) -{ - return Bitmap->IsLocked(); -} - - -/* - * Method: BBitmap::Perform - * Descr: - */ - -status_t -BBitmap_Perform(BBitmap *Bitmap, perform_code d, void *arg) -{ - return Bitmap->Perform(d, arg); -} - - -/* - * Method: BBitmap::_ReservedBitmap1 - * Descr: - */ -/* -void -BBitmap__ReservedBitmap1(BBitmap *Bitmap) -{ - Bitmap->_ReservedBitmap1(); -} -*/ - -/* - * Method: BBitmap::_ReservedBitmap2 - * Descr: - */ -/* -void -BBitmap__ReservedBitmap2(BBitmap *Bitmap) -{ - Bitmap->_ReservedBitmap2(); -} -*/ - -/* - * Method: BBitmap::_ReservedBitmap3 - * Descr: - */ -/* -void -BBitmap__ReservedBitmap3(BBitmap *Bitmap) -{ - Bitmap->_ReservedBitmap3(); -} -*/ - -/* - * Method: BBitmap::operator= - * Descr: - */ -/* -BBitmap & -BBitmap_operator=(BBitmap *Bitmap, const BBitmap &) -{ - return Bitmap->operator=(); -} -*/ - -/* - * Method: BBitmap::get_shared_pointer - * Descr: - */ -/* -char * -BBitmap_get_shared_pointer(BBitmap *Bitmap) const -{ - return Bitmap->get_shared_pointer(); -} -*/ - -/* - * Method: BBitmap::set_bits - * Descr: - */ -/* -void -BBitmap_set_bits(BBitmap *Bitmap, long offset, char *data, long length) -{ - Bitmap->set_bits(offset, data, length); -} -*/ - -/* - * Method: BBitmap::set_bits_24 - * Descr: - */ -/* -void -BBitmap_set_bits_24_1 -(BBitmap *Bitmap, long offset, char *data, long length) -{ - Bitmap->set_bits_24(offset, data, length); -} -*/ - -/* - * Method: BBitmap::set_bits_24_local_gray - * Descr: - */ -/* -void -BBitmap_set_bits_24_local_gray_2 -(BBitmap *Bitmap, long offset, char *data, long len) -{ - Bitmap->set_bits_24_local_gray(offset, data, len); -} -*/ - -/* - * Method: BBitmap::set_bits_24_local_256 - * Descr: - */ -/* -void -BBitmap_set_bits_24_local_256(BBitmap *Bitmap, long offset, uchar *data, long len) -{ - Bitmap->set_bits_24_local_256(offset, data, len); -} -*/ - -/* - * Method: BBitmap::set_bits_24_24 - * Descr: - */ -/* -void -BBitmap_set_bits_24_24(BBitmap *Bitmap, long offset, char *data, long length, bool big_endian_dst) -{ - Bitmap->set_bits_24_24(offset, data, length, big_endian_dst); -} -*/ - -/* - * Method: BBitmap::set_bits_8_24 - * Descr: - */ -/* -void -BBitmap_set_bits_8_24(BBitmap *Bitmap, long offset, char *data, long length, bool big_endian_dst) -{ - Bitmap->set_bits_8_24(offset, data, length, big_endian_dst); -} -*/ - -/* - * Method: BBitmap::set_bits_gray_24 - * Descr: - */ -/* -void -BBitmap_set_bits_gray_24(BBitmap *Bitmap, long offset, char *data, long length, bool big_endian_dst) -{ - Bitmap->set_bits_gray_24(offset, data, length, big_endian_dst); -} -*/ - -/* - * Method: BBitmap::get_server_token - * Descr: - */ -/* -int32 -BBitmap_get_server_token(BBitmap *Bitmap) const -{ - return Bitmap->get_server_token(); -} -*/ - -/* - * Method: BBitmap::InitObject - * Descr: - */ -/* -void -BBitmap_InitObject(BBitmap *Bitmap, BRect frame, color_space depth, uint32 flags, int32 bytesPerRow, screen_id screenID) -{ - Bitmap->InitObject(frame, depth, flags, bytesPerRow, screenID); -} -*/ - -/* - * Method: BBitmap::AssertPtr - * Descr: - */ -/* -void -BBitmap_AssertPtr(BBitmap *Bitmap) -{ - Bitmap->AssertPtr(); -} -*/ - -#if defined(__cplusplus) -} -#endif - -#endif /* _BITMAP_H */ diff --git a/bepascal/bepascal/be/interface/Box.cpp b/bepascal/bepascal/be/interface/Box.cpp deleted file mode 100644 index e0fa48e..0000000 --- a/bepascal/bepascal/be/interface/Box.cpp +++ /dev/null @@ -1,676 +0,0 @@ -/* 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/bepascal/be/interface/Button.cpp b/bepascal/bepascal/be/interface/Button.cpp deleted file mode 100644 index 8e6f23f..0000000 --- a/bepascal/bepascal/be/interface/Button.cpp +++ /dev/null @@ -1,686 +0,0 @@ -/* 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/bepascal/be/interface/CheckBox.cpp b/bepascal/bepascal/be/interface/CheckBox.cpp deleted file mode 100644 index 3c7b132..0000000 --- a/bepascal/bepascal/be/interface/CheckBox.cpp +++ /dev/null @@ -1,627 +0,0 @@ -/* 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/bepascal/be/interface/Control.cpp b/bepascal/bepascal/be/interface/Control.cpp deleted file mode 100644 index f20c710..0000000 --- a/bepascal/bepascal/be/interface/Control.cpp +++ /dev/null @@ -1,560 +0,0 @@ -/* 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/bepascal/be/interface/Font.cpp b/bepascal/bepascal/be/interface/Font.cpp deleted file mode 100644 index 51fc423..0000000 --- a/bepascal/bepascal/be/interface/Font.cpp +++ /dev/null @@ -1,692 +0,0 @@ -/* 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/bepascal/be/interface/ListItem.cpp b/bepascal/bepascal/be/interface/ListItem.cpp deleted file mode 100644 index 53a5743..0000000 --- a/bepascal/bepascal/be/interface/ListItem.cpp +++ /dev/null @@ -1,503 +0,0 @@ -/* 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/bepascal/be/interface/ListView.cpp b/bepascal/bepascal/be/interface/ListView.cpp deleted file mode 100644 index 3fe59df..0000000 --- a/bepascal/bepascal/be/interface/ListView.cpp +++ /dev/null @@ -1,1031 +0,0 @@ -/* 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/bepascal/be/interface/Menu.cpp b/bepascal/bepascal/be/interface/Menu.cpp deleted file mode 100644 index 449aa52..0000000 --- a/bepascal/bepascal/be/interface/Menu.cpp +++ /dev/null @@ -1,925 +0,0 @@ -#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/bepascal/be/interface/MenuBar.cpp b/bepascal/bepascal/be/interface/MenuBar.cpp deleted file mode 100644 index de1f41f..0000000 --- a/bepascal/bepascal/be/interface/MenuBar.cpp +++ /dev/null @@ -1,642 +0,0 @@ -#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/bepascal/be/interface/MenuItem.cpp b/bepascal/bepascal/be/interface/MenuItem.cpp deleted file mode 100644 index 351007f..0000000 --- a/bepascal/bepascal/be/interface/MenuItem.cpp +++ /dev/null @@ -1,433 +0,0 @@ -/* 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/bepascal/be/interface/OutlineListView.cpp b/bepascal/bepascal/be/interface/OutlineListView.cpp deleted file mode 100644 index fb2e931..0000000 --- a/bepascal/bepascal/be/interface/OutlineListView.cpp +++ /dev/null @@ -1,755 +0,0 @@ -/* 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/bepascal/be/interface/Point.cpp b/bepascal/bepascal/be/interface/Point.cpp deleted file mode 100644 index a1fd6a8..0000000 --- a/bepascal/bepascal/be/interface/Point.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* 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/bepascal/be/interface/RadioButton.cpp b/bepascal/bepascal/be/interface/RadioButton.cpp deleted file mode 100644 index a411770..0000000 --- a/bepascal/bepascal/be/interface/RadioButton.cpp +++ /dev/null @@ -1,628 +0,0 @@ -/* 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/bepascal/be/interface/Rect.cpp b/bepascal/bepascal/be/interface/Rect.cpp deleted file mode 100644 index b8ecb01..0000000 --- a/bepascal/bepascal/be/interface/Rect.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* 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/bepascal/be/interface/ScrollBar.cpp b/bepascal/bepascal/be/interface/ScrollBar.cpp deleted file mode 100644 index 3b8238f..0000000 --- a/bepascal/bepascal/be/interface/ScrollBar.cpp +++ /dev/null @@ -1,635 +0,0 @@ -/* 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/bepascal/be/interface/ScrollView.cpp b/bepascal/bepascal/be/interface/ScrollView.cpp deleted file mode 100644 index 53dfcd6..0000000 --- a/bepascal/bepascal/be/interface/ScrollView.cpp +++ /dev/null @@ -1,592 +0,0 @@ -/* 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/bepascal/be/interface/StatusBar.cpp b/bepascal/bepascal/be/interface/StatusBar.cpp deleted file mode 100644 index f99835f..0000000 --- a/bepascal/bepascal/be/interface/StatusBar.cpp +++ /dev/null @@ -1,657 +0,0 @@ -/* 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/bepascal/be/interface/StringView.cpp b/bepascal/bepascal/be/interface/StringView.cpp deleted file mode 100644 index 4d80e87..0000000 --- a/bepascal/bepascal/be/interface/StringView.cpp +++ /dev/null @@ -1,552 +0,0 @@ -/* 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/bepascal/be/interface/TabView.cpp b/bepascal/bepascal/be/interface/TabView.cpp deleted file mode 100644 index 3e9fc5c..0000000 --- a/bepascal/bepascal/be/interface/TabView.cpp +++ /dev/null @@ -1,1180 +0,0 @@ -/* 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/bepascal/be/interface/TextControl.cpp b/bepascal/bepascal/be/interface/TextControl.cpp deleted file mode 100644 index c1cb8f9..0000000 --- a/bepascal/bepascal/be/interface/TextControl.cpp +++ /dev/null @@ -1,807 +0,0 @@ -/* 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/bepascal/be/interface/TextView.cpp b/bepascal/bepascal/be/interface/TextView.cpp deleted file mode 100644 index 83329e6..0000000 --- a/bepascal/bepascal/be/interface/TextView.cpp +++ /dev/null @@ -1,1684 +0,0 @@ -/* 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/bepascal/be/interface/View.cpp b/bepascal/bepascal/be/interface/View.cpp deleted file mode 100644 index 034df3a..0000000 --- a/bepascal/bepascal/be/interface/View.cpp +++ /dev/null @@ -1,542 +0,0 @@ -/* 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(); -} - -#if defined(__cplusplus) -} -#endif - -#endif /* _VIEW_CPP_ */ \ No newline at end of file diff --git a/bepascal/bepascal/be/interface/Window.cpp b/bepascal/bepascal/be/interface/Window.cpp deleted file mode 100644 index c76be05..0000000 --- a/bepascal/bepascal/be/interface/Window.cpp +++ /dev/null @@ -1,2103 +0,0 @@ -/* 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/bepascal/be/interface/alert.pp b/bepascal/bepascal/be/interface/alert.pp deleted file mode 100644 index 7eb6b5b..0000000 --- a/bepascal/bepascal/be/interface/alert.pp +++ /dev/null @@ -1,317 +0,0 @@ -{ 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 - TAlert_Type = (B_EMPTY_ALERT, B_INFO_ALERT, B_IDEA_ALERT, B_WARNING_ALERT, - B_STOP_ALERT); - -//enum button_spacing - TButton_Spacing = (B_EVEN_SPACING, B_OFFSET_SPACING); - - TAlert = class(TWindow) - private - public - // Here we have this name colition: type --> kind - constructor Create(title : PChar; text : PChar; button1 : PChar; - button2 : PChar; button3 : PChar; width : TButton_Width; - kind{type} : TAlert_Type); - constructor Create(title : PChar; text : PChar; button1 : PChar; - button2 : PChar; button3 : PChar; width : TButton_Width; - spacing : TButton_Spacing; kind{type} : TAlert_Type); - constructor Create(data : TMessage); - - destructor Destroy; override; - - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure SetShortcut(button_index : integer; key : Char); - function Shortcut(button_index : integer) : Char; - function Go : integer; - function Go(invoker : TInvoker) : TStatus_t; - procedure MessageReceived(an_event : TMessage); override; - procedure FrameResized(new_width : double; new_height : double); - function ButtonAt(index : integer) : TButton; - function TextView : TTextView; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - procedure DispatchMessage(msg : TMessage; handler : THandler); override; - procedure Quit; - function QuitRequested : boolean; override; - function AlertPosition(width : double; height : double) : TPoint; -{ - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - - procedure _ReservedAlert1; - procedure _ReservedAlert2; - procedure _ReservedAlert3; - - procedure InitObject(text : PChar; button1 : PChar; button2 : PChar; button3 : PChar; width : TButton_Width; spacing : TButton_Spacing; type : TAlert_Type); - function InitIcon : TBitmap; - procedure sem_id fAlertSem; - procedure int32 fAlertVal; - procedure BButton *fButtons[3]; - procedure BTextView *fTextView; - procedure char fKeys[3]; - procedure alert_type fMsgType; - procedure button_width fButtonWidth; - procedure BInvoker *fInvoker; - procedure uint32 _reserved[4]; -} - end; - -function BAlert_Create(AObject : TBeObject; title : PChar; text : PChar; - button1 : PChar; button2 : PChar; button3 : PChar; width : TButton_Width; - kind{type} : TAlert_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 : TButton_Width; - spacing : TButton_Spacing; kind{type} : TAlert_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) : TArchivable; cdecl; external BePascalLibName name 'BAlert_Instantiate'; -function BAlert_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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) : TStatus_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) : TButton; cdecl; external BePascalLibName name 'BAlert_ButtonAt'; -function BAlert_TextView(AObject : TCPlusObject) : TTextView; cdecl; external BePascalLibName name 'BAlert_TextView'; -function BAlert_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : THandler; cdecl; external BePascalLibName name 'BAlert_ResolveSpecifier'; -function BAlert_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_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) : TPoint; cdecl; external BePascalLibName name 'BAlert_AlertPosition'; -{ -function BAlert_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BAlert_Perform'; -procedure BAlert__ReservedAlert1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert__ReservedAlert1'; -procedure BAlert__ReservedAlert2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert__ReservedAlert2'; -procedure BAlert__ReservedAlert3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert__ReservedAlert3'; -procedure BAlert_InitObject(AObject : TCPlusObject; text : PChar; button1 : PChar; button2 : PChar; button3 : PChar; width : TButton_Width; spacing : TButton_Spacing; type : TAlert_Type); cdecl; external BePascalLibName name 'BAlert_InitObject'; -function BAlert_InitIcon(AObject : TCPlusObject) : TBitmap; cdecl; external BePascalLibName name 'BAlert_InitIcon'; -procedure BAlert_sem_id fAlertSem(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_sem_id fAlertSem'; -procedure BAlert_int32 fAlertVal(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_int32 fAlertVal'; -procedure BAlert_BButton *fButtons[3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_BButton *fButtons[3]'; -procedure BAlert_BTextView *fTextView(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_BTextView *fTextView'; -procedure BAlert_char fKeys[3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_char fKeys[3]'; -procedure BAlert_alert_type fMsgType(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_alert_type fMsgType'; -procedure BAlert_button_width fButtonWidth(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_button_width fButtonWidth'; -procedure BAlert_BInvoker *fInvoker(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_BInvoker *fInvoker'; -procedure BAlert_uint32 _reserved[4](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_uint32 _reserved[4]'; -} -implementation - -constructor TAlert.Create(title : PChar; text : PChar; button1 : PChar; - button2 : PChar; button3 : PChar; width : TButton_Width; - kind{type} : TAlert_Type); -begin - CPlusObject := BAlert_Create(Self, title, text, button1, button2, button3, - width, kind); -end; - -constructor TAlert.Create(title : PChar; text : PChar; button1 : PChar; button2 : PChar; button3 : PChar; width : TButton_Width; spacing : TButton_Spacing; kind{type} : TAlert_Type); -begin - CPlusObject := BAlert_Create_1(Self, title, text, button1, button2, button3, - width, spacing, kind{type}); -end; - -constructor TAlert.Create(data : TMessage); -begin - CPlusObject := BAlert_Create_2(Self, data.CPlusObject); -end; - -destructor TAlert.Destroy; -begin - BAlert_Free(CPlusObject); -end; - -function TAlert.Instantiate(data : TMessage) : TArchivable; -begin - Result := BAlert_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TAlert.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BAlert_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TAlert.SetShortcut(button_index : integer; key : Char); -begin - BAlert_SetShortcut(CPlusObject, button_index, key); -end; - -function TAlert.Shortcut(button_index : integer) : Char; -begin - Result := BAlert_Shortcut(CPlusObject, button_index); -end; - -function TAlert.Go : integer; -begin - Result := BAlert_Go(CPlusObject); -end; - -function TAlert.Go(invoker : TInvoker) : TStatus_t; -begin - Result := BAlert_Go(CPlusObject, invoker.CPlusObject); -end; - -procedure TAlert.MessageReceived(an_event : TMessage); -begin - BAlert_MessageReceived(CPlusObject, an_event.CPlusObject); -end; - -procedure TAlert.FrameResized(new_width : double; new_height : double); -begin - BAlert_FrameResized(CPlusObject, new_width, new_height); -end; - -function TAlert.ButtonAt(index : integer) : TButton; -begin - Result := BAlert_ButtonAt(CPlusObject, index); -end; - -function TAlert.TextView : TTextView; -begin - Result := BAlert_TextView(CPlusObject); -end; - -function TAlert.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BAlert_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -function TAlert.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BAlert_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -procedure TAlert.DispatchMessage(msg : TMessage; handler : THandler); -begin - BAlert_DispatchMessage(CPlusObject, msg.CPlusObject, handler.CPlusObject); -end; - -procedure TAlert.Quit; -begin - BAlert_Quit(CPlusObject); -end; - -function TAlert.QuitRequested : boolean; -begin - Result := BAlert_QuitRequested(CPlusObject); -end; - -function TAlert.AlertPosition(width : double; height : double) : TPoint; -begin - Result := BAlert_AlertPosition(CPlusObject, width, height); -end; - -{ -function TAlert.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BAlert_Perform(CPlusObject, d, arg); -end; - -procedure TAlert._ReservedAlert1; -begin - BAlert__ReservedAlert1(CPlusObject); -end; - -procedure TAlert._ReservedAlert2; -begin - BAlert__ReservedAlert2(CPlusObject); -end; - -procedure TAlert._ReservedAlert3; -begin - BAlert__ReservedAlert3(CPlusObject); -end; - -procedure TAlert.InitObject(text : PChar; button1 : PChar; button2 : PChar; button3 : PChar; width : TButton_Width; spacing : TButton_Spacing; type : TAlert_Type); -begin - BAlert_InitObject(CPlusObject, text, button1, button2, button3, width, spacing, type); -end; - -function TAlert.InitIcon : TBitmap; -begin - Result := BAlert_InitIcon(CPlusObject); -end; - -procedure TAlert.sem_id fAlertSem; -begin - BAlert_sem_id fAlertSem(CPlusObject); -end; - -procedure TAlert.int32 fAlertVal; -begin - BAlert_int32 fAlertVal(CPlusObject); -end; - -procedure TAlert.BButton *fButtons[3]; -begin - BAlert_BButton *fButtons[3](CPlusObject); -end; - -procedure TAlert.BTextView *fTextView; -begin - BAlert_BTextView *fTextView(CPlusObject); -end; - -procedure TAlert.char fKeys[3]; -begin - BAlert_char fKeys[3](CPlusObject); -end; - -procedure TAlert.alert_type fMsgType; -begin - BAlert_alert_type fMsgType(CPlusObject); -end; - -procedure TAlert.button_width fButtonWidth; -begin - BAlert_button_width fButtonWidth(CPlusObject); -end; - -procedure TAlert.BInvoker *fInvoker; -begin - BAlert_BInvoker *fInvoker(CPlusObject); -end; - -procedure TAlert.uint32 _reserved[4]; -begin - BAlert_uint32 _reserved[4](CPlusObject); -end; -} - -end. diff --git a/bepascal/bepascal/be/interface/bitmap.pp b/bepascal/bepascal/be/interface/bitmap.pp deleted file mode 100644 index d004b05..0000000 --- a/bepascal/bepascal/be/interface/bitmap.pp +++ /dev/null @@ -1,550 +0,0 @@ -{ 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 Bitmap; - -interface - -uses - BeObj, Archivable, GraphicDefs, Message, OS, Rect, SupportDefs, View; - -type -// PCardinal = ^Cardinal; - - TBitmap = class(TArchivable) - private - public - // I will change "bounds" to "frame" in these constructors... - // they clash with the Bounds function. - // Also "bytesPerWow" --> "bytes_per_row" - constructor Create(frame : TRect; flags : Cardinal; depth : TColor_Space; - bytes_per_row : Integer; screenID : TScreenID); - constructor Create(frame : TRect; depth : TColor_Space; - accepts_views : boolean; need_contiguous : boolean); - constructor Create(source : TBitmap; accepts_views : boolean; - need_contiguous : boolean); - constructor Create(data : TMessage); - - destructor Destroy; override; - - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - function InitCheck : TStatus_t; - function IsValid : boolean; - function LockBits(state : PCardinal) : TStatus_t; - procedure UnlockBits; - function Area : TArea_ID; - function Bits : Pointer; - function BitsLength : Integer; - function BytesPerRow : Integer; - function ColorSpace : TColor_Space; - function Bounds : TRect; - procedure SetBits(data : Pointer; length : integer; offset : integer; - cs : TColor_Space); - function GetOverlayRestrictions(restrict : TOverlayRestrictions) - : TStatus_t; - procedure AddChild(view : TView); - function RemoveChild(view : TView) : boolean; - function CountChildren : integer; - function ChildAt(index : integer) : TView; - function FindView(view_name : PChar) : TView; - function FindView(point : TPoint) : TView; - function Lock : boolean; - procedure Unlock; - function IsLocked : boolean; - - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -{ - procedure _ReservedBitmap1; - procedure _ReservedBitmap2; - procedure _ReservedBitmap3; - constructor Create( : TBitmap); - function operator=( : TBitmap) : TBitmap; - function get_shared_pointer : PChar; - procedure set_bits(offset : integer; data : PChar; length : integer); - procedure set_bits_24(offset : integer; data : PChar; length : integer); - procedure set_bits_24_local_gray(offset : integer; data : PChar; len : integer); - procedure set_bits_24_local_256(offset : integer; data : PByte; len : integer); - procedure set_bits_24_24(offset : integer; data : PChar; length : integer; big_endian_dst : boolean); - procedure set_bits_8_24(offset : integer; data : PChar; length : integer; big_endian_dst : boolean); - procedure set_bits_gray_24(offset : integer; data : PChar; length : integer; big_endian_dst : boolean); - function get_server_token : integer; - procedure InitObject(frame : TRect; depth : TColor_Space; flags : Cardinal; bytesPerRow : integer; screenID : TScreenID); - procedure AssertPtr; - procedure void *fBasePtr; - procedure int32 fSize; - procedure color_space fType; - procedure BRect fBound; - procedure int32 fRowBytes; - procedure BWindow *fWindow; - procedure int32 fServerToken; - procedure int32 fToken; - procedure uint8 unused; - procedure area_id fArea; - procedure area_id fOrigArea; - procedure uint32 fFlags; - procedure status_t fInitError; -} - end; - -function BBitmap_Create(AObject : TBeObject; bounds : TCPlusObject; - flags : Cardinal; depth : TColor_Space; bytesPerRow : Integer; - screenID : TScreenID) : TCPlusObject; cdecl; - external BePascalLibName name 'BBitmap_Create'; - -function BBitmap_Create_1(AObject : TBeObject; bounds : TCPlusObject; - depth : TColor_Space; accepts_views : boolean; need_contiguous : boolean) - : TCPlusObject; cdecl; external BePascalLibName name 'BBitmap_Create_1'; - -function BBitmap_Create_2(AObject : TBeObject; source : TBitmap; - accepts_views : boolean; need_contiguous : boolean) : TCPlusObject; cdecl; - external BePascalLibName name 'BBitmap_Create_2'; - -function BBitmap_Create_3(AObject : TBeObject; data : TCPlusObject) - : TCPlusObject; cdecl; external BePascalLibName name 'BBitmap_Create_3'; - - -procedure BBitmap_Free(AObject : TCPlusObject); cdecl; - external BePascalLibName name 'BBitmap_Free'; - - -function BBitmap_Instantiate(AObject : TCPlusObject; data : {TMessage}TCPlusObject) - : TArchivable; cdecl; external BePascalLibName name 'BBitmap_Instantiate'; - -function BBitmap_Archive(AObject : TCPlusObject; data : {TMessage}TCPlusObject; - deep : boolean) : TStatus_t; cdecl; - external BePascalLibName name 'BBitmap_Archive'; - -function BBitmap_InitCheck(AObject : TCPlusObject) : TStatus_t; cdecl; - external BePascalLibName name 'BBitmap_InitCheck'; - -function BBitmap_IsValid(AObject : TCPlusObject) : boolean; cdecl; - external BePascalLibName name 'BBitmap_IsValid'; - -function BBitmap_LockBits(AObject : TCPlusObject; state : PCardinal) - : TStatus_t; cdecl; external BePascalLibName name 'BBitmap_LockBits'; - -procedure BBitmap_UnlockBits(AObject : TCPlusObject); cdecl; - external BePascalLibName name 'BBitmap_UnlockBits'; - -function BBitmap_Area(AObject : TCPlusObject) : TArea_ID; cdecl; - external BePascalLibName name 'BBitmap_Area'; - -function BBitmap_Bits(AObject : TCPlusObject) : Pointer; cdecl; - external BePascalLibName name 'BBitmap_Bits'; - -function BBitmap_BitsLength(AObject : TCPlusObject) : integer; cdecl; - external BePascalLibName name 'BBitmap_BitsLength'; - -function BBitmap_BytesPerRow(AObject : TCPlusObject) : integer; cdecl; - external BePascalLibName name 'BBitmap_BytesPerRow'; - -function BBitmap_ColorSpace(AObject : TCPlusObject) : TColor_Space; cdecl; - external BePascalLibName name 'BBitmap_ColorSpace'; - -function BBitmap_Bounds(AObject : TCPlusObject) : TRect; cdecl; - external BePascalLibName name 'BBitmap_Bounds'; - -procedure BBitmap_SetBits(AObject : TCPlusObject; data : Pointer; - length : integer; offset : integer; cs : TColor_Space); cdecl; - external BePascalLibName name 'BBitmap_SetBits'; - -function BBitmap_GetOverlayRestrictions(AObject : TCPlusObject; - restrict : TOverlayRestrictions) : TStatus_t; cdecl; - external BePascalLibName name 'BBitmap_GetOverlayRestrictions'; - -procedure BBitmap_AddChild(AObject : TCPlusObject; view : {TView}TCPlusObject); cdecl; - external BePascalLibName name 'BBitmap_AddChild'; - -function BBitmap_RemoveChild(AObject : TCPlusObject; view : {TView}TCPlusObject) - : boolean; cdecl; external BePascalLibName name 'BBitmap_RemoveChild'; - -function BBitmap_CountChildren(AObject : TCPlusObject) : integer; cdecl; - external BePascalLibName name 'BBitmap_CountChildren'; - -function BBitmap_ChildAt(AObject : TCPlusObject; index : integer) : TView; - cdecl; external BePascalLibName name 'BBitmap_ChildAt'; - -function BBitmap_FindView(AObject : TCPlusObject; view_name : PChar) : TView; - cdecl; external BePascalLibName name 'BBitmap_FindView'; - -function BBitmap_FindView(AObject : TCPlusObject; point : TPoint{TCPlusObject}) - : TView; cdecl; external BePascalLibName name 'BBitmap_FindView'; - -function BBitmap_Lock(AObject : TCPlusObject) : boolean; cdecl; - external BePascalLibName name 'BBitmap_Lock'; - -procedure BBitmap_Unlock(AObject : TCPlusObject); cdecl; - external BePascalLibName name 'BBitmap_Unlock'; - -function BBitmap_IsLocked(AObject : TCPlusObject) : boolean; cdecl; - external BePascalLibName name 'BBitmap_IsLocked'; - -function BBitmap_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BBitmap_Perform'; - -{ -procedure BBitmap__ReservedBitmap1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap__ReservedBitmap1'; -procedure BBitmap__ReservedBitmap2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap__ReservedBitmap2'; -procedure BBitmap__ReservedBitmap3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap__ReservedBitmap3'; -function BBitmap_Create(AObject : TBeObject; : TBitmap); cdecl; external BePascalLibName name 'BBitmap_Create'; -function BBitmap_operator=(AObject : TCPlusObject; : TBitmap) : TBitmap; cdecl; external BePascalLibName name 'BBitmap_operator='; -function BBitmap_get_shared_pointer(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BBitmap_get_shared_pointer'; -procedure BBitmap_set_bits(AObject : TCPlusObject; offset : integer; data : PChar; length : integer); cdecl; external BePascalLibName name 'BBitmap_set_bits'; -procedure BBitmap_set_bits_24(AObject : TCPlusObject; offset : integer; data : PChar; length : integer); cdecl; external BePascalLibName name 'BBitmap_set_bits_24'; -procedure BBitmap_set_bits_24_local_gray(AObject : TCPlusObject; offset : integer; data : PChar; len : integer); cdecl; external BePascalLibName name 'BBitmap_set_bits_24_local_gray'; -procedure BBitmap_set_bits_24_local_256(AObject : TCPlusObject; offset : integer; data : PByte; len : integer); cdecl; external BePascalLibName name 'BBitmap_set_bits_24_local_256'; -procedure BBitmap_set_bits_24_24(AObject : TCPlusObject; offset : integer; data : PChar; length : integer; big_endian_dst : boolean); cdecl; external BePascalLibName name 'BBitmap_set_bits_24_24'; -procedure BBitmap_set_bits_8_24(AObject : TCPlusObject; offset : integer; data : PChar; length : integer; big_endian_dst : boolean); cdecl; external BePascalLibName name 'BBitmap_set_bits_8_24'; -procedure BBitmap_set_bits_gray_24(AObject : TCPlusObject; offset : integer; data : PChar; length : integer; big_endian_dst : boolean); cdecl; external BePascalLibName name 'BBitmap_set_bits_gray_24'; -function BBitmap_get_server_token(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BBitmap_get_server_token'; -procedure BBitmap_InitObject(AObject : TCPlusObject; frame : TCPlusObject; depth : TColor_Space; flags : Cardinal; bytesPerRow : integer; screenID : TScreenID); cdecl; external BePascalLibName name 'BBitmap_InitObject'; -procedure BBitmap_AssertPtr(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_AssertPtr'; -procedure BBitmap_void *fBasePtr(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_void *fBasePtr'; -procedure BBitmap_int32 fSize(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_int32 fSize'; -procedure BBitmap_color_space fType(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_color_space fType'; -procedure BBitmap_BRect fBound(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_BRect fBound'; -procedure BBitmap_int32 fRowBytes(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_int32 fRowBytes'; -procedure BBitmap_BWindow *fWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_BWindow *fWindow'; -procedure BBitmap_int32 fServerToken(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_int32 fServerToken'; -procedure BBitmap_int32 fToken(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_int32 fToken'; -procedure BBitmap_uint8 unused(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_uint8 unused'; -procedure BBitmap_area_id fArea(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_area_id fArea'; -procedure BBitmap_area_id fOrigArea(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_area_id fOrigArea'; -procedure BBitmap_uint32 fFlags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_uint32 fFlags'; -procedure BBitmap_status_t fInitError(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBitmap_status_t fInitError'; -} - -implementation - -{ -- NOTE! - I will change "bounds" to "frame" in these constructors... - they clash with the Bounds function. - - Also "bytesPerWow" --> "bytes_per_row" -} - -// BBitmap(BRect bounds, uint32 flags, color_space depth, -// int32 bytesPerRow=B_ANY_BYTES_PER_ROW, screen_id screenID=B_MAIN_SCREEN_ID); -constructor TBitmap.Create(frame{bounds} : TRect; flags : Cardinal; - depth : TColor_Space; bytes_per_row : Integer; screenID : TScreenID); -begin - CPlusObject := BBitmap_Create(Self, frame, flags, depth, bytes_per_row, - screenID); -end; - -// BBitmap(BRect bounds, color_space depth, bool accepts_views = false, -// bool need_contiguous = false); -constructor TBitmap.Create(frame{bounds} : TRect; depth : TColor_Space; - accepts_views : boolean; need_contiguous : Boolean); -begin - CPlusObject := BBitmap_Create_1(Self, frame.CPlusObject, depth, - accepts_views, need_contiguous); -end; - -// BBitmap(const BBitmap* source, bool accepts_views = false, -// bool need_contiguous = false); -constructor TBitmap.Create(source : TBitmap; accepts_views : Boolean; - need_contiguous : Boolean); -begin - CPlusObject := BBitmap_Create_2(Self, source, accepts_views, need_contiguous); -end; - -// BBitmap(BMessage *data); -constructor TBitmap.Create(data : TMessage); -begin - CPlusObject := BBitmap_Create_3(Self, data.CPlusObject); -end; - -destructor TBitmap.Destroy; -begin - BBitmap_Free(CPlusObject); - inherited; -end; - -function TBitmap.Instantiate(data : TMessage) : TArchivable; -begin - Result := BBitmap_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TBitmap.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BBitmap_Archive(CPlusObject, data.CPlusObject, deep); -end; - -function TBitmap.InitCheck : TStatus_t; -begin - Result := BBitmap_InitCheck(CPlusObject); -end; - -function TBitmap.IsValid : boolean; -begin - Result := BBitmap_IsValid(CPlusObject); -end; - -function TBitmap.LockBits(state : PCardinal) : TStatus_t; -begin - Result := BBitmap_LockBits(CPlusObject, state); -end; - -procedure TBitmap.UnlockBits; -begin - BBitmap_UnlockBits(CPlusObject); -end; - -function TBitmap.Area : TArea_ID; -begin - Result := BBitmap_Area(CPlusObject); -end; - -function TBitmap.Bits : Pointer; -begin - Result := BBitmap_Bits(CPlusObject); -end; - -function TBitmap.BitsLength : integer; -begin - Result := BBitmap_BitsLength(CPlusObject); -end; - -function TBitmap.BytesPerRow : integer; -begin - Result := BBitmap_BytesPerRow(CPlusObject); -end; - -function TBitmap.ColorSpace : TColor_Space; -begin - Result := BBitmap_ColorSpace(CPlusObject); -end; - -function TBitmap.Bounds : TRect; -begin - Result := BBitmap_Bounds(CPlusObject); -end; - -procedure TBitmap.SetBits(data : Pointer; length : integer; offset : integer; cs : TColor_Space); -begin - BBitmap_SetBits(CPlusObject, data, length, offset, cs); -end; - -function TBitmap.GetOverlayRestrictions(restrict : TOverlayRestrictions) : TStatus_t; -begin - Result := BBitmap_GetOverlayRestrictions(CPlusObject, restrict); -end; - -procedure TBitmap.AddChild(view : TView); -begin - BBitmap_AddChild(CPlusObject, view.CPlusObject); -end; - -function TBitmap.RemoveChild(view : TView) : boolean; -begin - Result := BBitmap_RemoveChild(CPlusObject, view.CPlusObject); -end; - -function TBitmap.CountChildren : integer; -begin - Result := BBitmap_CountChildren(CPlusObject); -end; - -function TBitmap.ChildAt(index : integer) : TView; -begin - Result := BBitmap_ChildAt(CPlusObject, index); -end; - -function TBitmap.FindView(view_name : PChar) : TView; -begin - Result := BBitmap_FindView(CPlusObject, view_name); -end; - -function TBitmap.FindView(point : TPoint) : TView; -begin - Result := BBitmap_FindView(CPlusObject, point.CPlusObject); -end; - -function TBitmap.Lock : boolean; -begin - Result := BBitmap_Lock(CPlusObject); -end; - -procedure TBitmap.Unlock; -begin - BBitmap_Unlock(CPlusObject); -end; - -function TBitmap.IsLocked : boolean; -begin - Result := BBitmap_IsLocked(CPlusObject); -end; - - -function TBitmap.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BBitmap_Perform(CPlusObject, d, arg); -end; - - -{ -procedure TBitmap._ReservedBitmap1; -begin - BBitmap__ReservedBitmap1(CPlusObject); -end; - -procedure TBitmap._ReservedBitmap2; -begin - BBitmap__ReservedBitmap2(CPlusObject); -end; - -procedure TBitmap._ReservedBitmap3; -begin - BBitmap__ReservedBitmap3(CPlusObject); -end; - -constructor TBitmap.Create( : TBitmap); -begin - CPlusObject := BBitmap_Create(Self, ); -end; - -function TBitmap.operator=( : TBitmap) : TBitmap; -begin - Result := BBitmap_operator=(CPlusObject, ); -end; - -function TBitmap.get_shared_pointer : PChar; -begin - Result := BBitmap_get_shared_pointer(CPlusObject); -end; - -procedure TBitmap.set_bits(offset : integer; data : PChar; length : integer); -begin - BBitmap_set_bits(CPlusObject, offset, data, length); -end; - -procedure TBitmap.set_bits_24(offset : integer; data : PChar; length : integer); -begin - BBitmap_set_bits_24(CPlusObject, offset, data, length); -end; - -procedure TBitmap.set_bits_24_local_gray(offset : integer; data : PChar; len : integer); -begin - BBitmap_set_bits_24_local_gray(CPlusObject, offset, data, len); -end; - -procedure TBitmap.set_bits_24_local_256(offset : integer; data : PByte; len : integer); -begin - BBitmap_set_bits_24_local_256(CPlusObject, offset, data, len); -end; - -procedure TBitmap.set_bits_24_24(offset : integer; data : PChar; length : integer; big_endian_dst : boolean); -begin - BBitmap_set_bits_24_24(CPlusObject, offset, data, length, big_endian_dst); -end; - -procedure TBitmap.set_bits_8_24(offset : integer; data : PChar; length : integer; big_endian_dst : boolean); -begin - BBitmap_set_bits_8_24(CPlusObject, offset, data, length, big_endian_dst); -end; - -procedure TBitmap.set_bits_gray_24(offset : integer; data : PChar; length : integer; big_endian_dst : boolean); -begin - BBitmap_set_bits_gray_24(CPlusObject, offset, data, length, big_endian_dst); -end; - -function TBitmap.get_server_token : integer; -begin - Result := BBitmap_get_server_token(CPlusObject); -end; - -procedure TBitmap.InitObject(frame : TRect; depth : TColor_Space; flags : Cardinal; bytesPerRow : integer; screenID : TScreenID); -begin - BBitmap_InitObject(CPlusObject, frame.CPlusObject, depth, flags, bytesPerRow, screenID); -end; - -procedure TBitmap.AssertPtr; -begin - BBitmap_AssertPtr(CPlusObject); -end; - -procedure TBitmap.void *fBasePtr; -begin - BBitmap_void *fBasePtr(CPlusObject); -end; - -procedure TBitmap.int32 fSize; -begin - BBitmap_int32 fSize(CPlusObject); -end; - -procedure TBitmap.color_space fType; -begin - BBitmap_color_space fType(CPlusObject); -end; - -procedure TBitmap.BRect fBound; -begin - BBitmap_BRect fBound(CPlusObject); -end; - -procedure TBitmap.int32 fRowBytes; -begin - BBitmap_int32 fRowBytes(CPlusObject); -end; - -procedure TBitmap.BWindow *fWindow; -begin - BBitmap_BWindow *fWindow(CPlusObject); -end; - -procedure TBitmap.int32 fServerToken; -begin - BBitmap_int32 fServerToken(CPlusObject); -end; - -procedure TBitmap.int32 fToken; -begin - BBitmap_int32 fToken(CPlusObject); -end; - -procedure TBitmap.uint8 unused; -begin - BBitmap_uint8 unused(CPlusObject); -end; - -procedure TBitmap.area_id fArea; -begin - BBitmap_area_id fArea(CPlusObject); -end; - -procedure TBitmap.area_id fOrigArea; -begin - BBitmap_area_id fOrigArea(CPlusObject); -end; - -procedure TBitmap.uint32 fFlags; -begin - BBitmap_uint32 fFlags(CPlusObject); -end; - -procedure TBitmap.status_t fInitError; -begin - BBitmap_status_t fInitError(CPlusObject); -end; -} - -end. \ No newline at end of file diff --git a/bepascal/bepascal/be/interface/box.pp b/bepascal/bepascal/be/interface/box.pp deleted file mode 100644 index 58fec38..0000000 --- a/bepascal/bepascal/be/interface/box.pp +++ /dev/null @@ -1,360 +0,0 @@ -{ 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 - - TBox = class(TView) - private - public - constructor Create(Frame : TRect; Name : PChar; ResizingMode, - Flags : Cardinal; BorderStyle : Tborder_style); - constructor Create(data : TMessage); - destructor Destroy; override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure SetBorder(style : Tborder_style); - function Border : Tborder_style; - procedure SetLabel(aLabel : PChar); - function SetLabel(view_label : TView) : TStatus_t; - // Conflicting Name: Label is a reserved word in Pascal. - // I will use: GetLabel - function GetLabel : PChar; - - function LabelView : TView; - procedure Draw(bounds : TRect); 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 : TMessage); override; - procedure MouseDown(pt : TPoint); override; - procedure MouseUp(pt : TPoint); override; - procedure WindowActivated(state : boolean); override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); override; - procedure FrameMoved(new_position : TPoint); override; - function ResolveSpecifier(msg : TMessage; index : integer; - specifier : TMessage; form : integer; - properti : PChar) : THandler; - procedure ResizeToPreferred; override; - procedure GetPreferredSize(width : double; height : double); - procedure MakeFocus(state : boolean); - function GetSupportedSuites(data : TMessage) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -// procedure _ReservedBox1; -// procedure _ReservedBox2; -// function operator=( : TBox) : TBox; -// procedure InitObject(data : TMessage); -// procedure DrawPlain; -// procedure DrawFancy; -// procedure ClearAnyLabel; -// procedure char *fLabel; -// procedure BRect fBounds; -// procedure border_style fStyle; -// procedure BView *fLabelView; -// procedure uint32 _reserved[1]; - end; - -function BBox_Create(AObject : TBeObject; - Frame : TCPlusObject; - Name : PChar; - ResizingMode, Flags : Cardinal; - BorderStyle : Tborder_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) : TArchivable; cdecl; external BePascalLibName name 'BBox_Instantiate'; -function BBox_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BBox_Archive'; -procedure BBox_SetBorder(AObject : TCPlusObject; style : Tborder_style); cdecl; external BePascalLibName name 'BBox_SetBorder'; -function BBox_Border(AObject : TCPlusObject) : Tborder_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 : TView) : TStatus_t; cdecl; external BePascalLibName name 'BBox_SetLabel'; -function BBox_Label(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BBox_Label'; - -function BBox_LabelView(AObject : TCPlusObject) : TView; cdecl; external BePascalLibName name 'BBox_LabelView_1'; - -procedure BBox_Draw(AObject : TCPlusObject; bounds : TRect); 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 : TPoint); cdecl; external BePascalLibName name 'BBox_MouseDown'; -procedure BBox_MouseUp(AObject : TCPlusObject; pt : TPoint); 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 : TPoint; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BBox_MouseMoved'; -procedure BBox_FrameMoved(AObject : TCPlusObject; new_position : TPoint); cdecl; external BePascalLibName name 'BBox_FrameMoved'; -function BBox_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; 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) : TStatus_t; cdecl; external BePascalLibName name 'BBox_GetSupportedSuites'; -function BBox_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BBox_Perform'; -{ -procedure BBox__ReservedBox1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox__ReservedBox1'; -procedure BBox__ReservedBox2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox__ReservedBox2'; -function BBox_operator=(AObject : TCPlusObject; : TBox) : TBox; cdecl; external BePascalLibName name 'BBox_operator='; -procedure BBox_InitObject(AObject : TCPlusObject; data : TMessage); cdecl; external BePascalLibName name 'BBox_InitObject'; -procedure BBox_DrawPlain(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_DrawPlain'; -procedure BBox_DrawFancy(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_DrawFancy'; -procedure BBox_ClearAnyLabel(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_ClearAnyLabel'; -procedure BBox_char *fLabel(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_char *fLabel'; - -procedure BBox_BRect fBounds(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_BRect fBounds'; - -procedure BBox_border_style fStyle(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_border_style fStyle'; -procedure BBox_BView *fLabelView(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_BView *fLabelView'; -procedure BBox_uint32 _reserved[1](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_uint32 _reserved[1]'; -} - -implementation - - -constructor TBox.Create(Frame : TRect; Name : PChar; ResizingMode, Flags : Cardinal; BorderStyle : Tborder_style); -begin - CreatePas; - CPlusObject := BBox_Create(Self, Frame.CPlusObject, Name, ResizingMode, Flags, BorderStyle); -end; - -constructor TBox.Create(data : TMessage); -begin - CreatePas; - CPlusObject := BBox_Create_1(Self, data.CPlusObject); -end; - -destructor TBox.Destroy; -begin - BBox_Free(CPlusObject); - inherited; -end; - -function TBox.Instantiate(data : TMessage) : TArchivable; -begin - Result := BBox_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TBox.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BBox_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TBox.SetBorder(style : Tborder_style); -begin - BBox_SetBorder(CPlusObject, style); -end; - -function TBox.Border : Tborder_style; -begin - Result := BBox_Border(CPlusObject); -end; - -procedure TBox.SetLabel(aLabel : PChar); -begin - BBox_SetLabel(CPlusObject, aLabel); -end; - -function TBox.SetLabel(view_label : TView) : TStatus_t; -begin - Result := BBox_SetLabel(CPlusObject, view_label{.CPlusObject}); -end; - -// Conflicting Name: Label is a reserved word in Pascal. -// I will use: GetLabel -function TBox.GetLabel : PChar; -begin - Result := BBox_Label(CPlusObject); -end; - - -function TBox.LabelView : TView; -begin - Result := BBox_LabelView(CPlusObject); -end; - - -procedure TBox.Draw(bounds : TRect); -begin - BBox_Draw(CPlusObject, bounds{.CPlusObject}); -end; - -procedure TBox.AttachedToWindow; -begin - BBox_AttachedToWindow(CPlusObject); -end; - -procedure TBox.DetachedFromWindow; -begin - BBox_DetachedFromWindow(CPlusObject); -end; - -procedure TBox.AllAttached; -begin - BBox_AllAttached(CPlusObject); -end; - -procedure TBox.AllDetached; -begin - BBox_AllDetached(CPlusObject); -end; - -procedure TBox.FrameResized(new_width : double; new_height : double); -begin - BBox_FrameResized(CPlusObject, new_width, new_height); -end; - -procedure TBox.MessageReceived(msg : TMessage); -begin - BBox_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TBox.MouseDown(pt : TPoint); -begin - BBox_MouseDown(CPlusObject, pt{.CPlusObject}); -end; - -procedure TBox.MouseUp(pt : TPoint); -begin - BBox_MouseUp(CPlusObject, pt{.CPlusObject}); -end; - -procedure TBox.WindowActivated(state : boolean); -begin - BBox_WindowActivated(CPlusObject, state); -end; - -procedure TBox.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin - BBox_MouseMoved(CPlusObject, pt{.CPlusObject}, code, msg); -end; - -procedure TBox.FrameMoved(new_position : TPoint); -begin - BBox_FrameMoved(CPlusObject, new_position{.CPlusObject}); -end; - -function TBox.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BBox_ResolveSpecifier(CPlusObject, msg{.CPlusObject}, index, specifier{.CPlusObject}, form, properti); -end; - -procedure TBox.ResizeToPreferred; -begin - BBox_ResizeToPreferred(CPlusObject); -end; - -procedure TBox.GetPreferredSize(width : double; height : double); -begin - BBox_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TBox.MakeFocus(state : boolean); -begin - BBox_MakeFocus(CPlusObject, state); -end; - -function TBox.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BBox_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TBox.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BBox_Perform(CPlusObject, d, arg); -end; - -{ -procedure TBox._ReservedBox1; -begin - BBox__ReservedBox1(CPlusObject); -end; - -procedure TBox._ReservedBox2; -begin - BBox__ReservedBox2(CPlusObject); -end; - -function TBox.operator=( : TBox) : TBox; -begin - Result := BBox_operator=(CPlusObject, ); -end; -} - -{ -procedure TBox.InitObject(data : TMessage); -begin - BBox_InitObject(CPlusObject, data.CPlusObject); -end; - -procedure TBox.DrawPlain; -begin - BBox_DrawPlain(CPlusObject); -end; - -procedure TBox.DrawFancy; -begin - BBox_DrawFancy(CPlusObject); -end; - -procedure TBox.ClearAnyLabel; -begin - BBox_ClearAnyLabel(CPlusObject); -end; -} - -{ -procedure TBox.char *fLabel; -begin - BBox_char *fLabel(CPlusObject); -end; - -procedure TBox.BRect fBounds; -begin - BBox_BRect fBounds(CPlusObject); -end; - -procedure TBox.border_style fStyle; -begin - BBox_border_style fStyle(CPlusObject); -end; - -procedure TBox.BView *fLabelView; -begin - BBox_BView *fLabelView(CPlusObject); -end; - -procedure TBox.uint32 _reserved[1]; -begin - BBox_uint32 _reserved[1](CPlusObject); -end; -} - -end. \ No newline at end of file diff --git a/bepascal/bepascal/be/interface/button.pp b/bepascal/bepascal/be/interface/button.pp deleted file mode 100644 index f386bd6..0000000 --- a/bepascal/bepascal/be/interface/button.pp +++ /dev/null @@ -1,330 +0,0 @@ -{ 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 - TButton = class(TControl) - private - public - destructor Destroy; override; - constructor Create(frame : TRect; name, aLabel : PChar; message : TMessage; resizingMode, flags : Cardinal); virtual; - constructor Create(data : TMessage); override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure Draw(updateRect : TRect); override; - procedure MouseDown(where : TPoint); 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 : TMessage); override; - procedure WindowActivated(state : boolean); override; - procedure MouseUp(pt : TPoint); override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); override; - procedure DetachedFromWindow; override; - procedure SetValue(aValue : integer); - procedure GetPreferredSize(width : double; height : double); - procedure ResizeToPreferred; override; - function Invoke(msg : TMessage) : TStatus_t; - procedure FrameMoved(new_position : TPoint); override; - procedure FrameResized(new_width : double; new_height : double); override; - procedure MakeFocus(state : boolean); override; - procedure AllAttached; override; - procedure AllDetached; override; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -// procedure _ReservedButton1; -// procedure _ReservedButton2; -// procedure _ReservedButton3; -// function operator=( : TButton) : TButton; -// function DrawDefault(bounds : TRect; enabled : boolean) : TRect; -// function Execute : TStatus_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) : TArchivable; cdecl; external BePascalLibName name 'BButton_Instantiate'; -function BButton_Archive(AObject : TCPlusObject; data : TCplusObject; deep : boolean) : TStatus_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 : TMessage); 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) : TStatus_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) : THandler; cdecl; external BePascalLibName name 'BButton_ResolveSpecifier'; -function BButton_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BButton_GetSupportedSuites'; -function BButton_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BButton_Perform'; -//procedure BButton__ReservedButton1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton__ReservedButton1'; -//procedure BButton__ReservedButton2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton__ReservedButton2'; -//procedure BButton__ReservedButton3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton__ReservedButton3'; -//function BButton_operator=(AObject : TCPlusObject; : TButton) : TButton; cdecl; external BePascalLibName name 'BButton_operator='; -//function BButton_DrawDefault(AObject : TCPlusObject; bounds : TCPlusObject; enabled : boolean) : TRect; cdecl; external BePascalLibName name 'BButton_DrawDefault'; -//function BButton_Execute(AObject : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BButton_Execute'; -//procedure BButton_float fCachedWidth(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_float fCachedWidth'; -//procedure BButton_bool fDrawAsDefault(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_bool fDrawAsDefault'; -//procedure BButton_uint32 _reserved[3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_uint32 _reserved[3]'; - -//var -// procedure BButton_MakeDefault_hook(Button : TButton; flag : boolean); cdecl; external BePascalLibName name 'BButton_MakeDefault'; - -implementation - -var - Button_MakeDefault_hook : Pointer; cvar; external; - -destructor TButton.Destroy; -begin - BButton_Free(CPlusObject); - inherited; -end; - -constructor TButton.Create(frame : TRect; name, aLabel : PChar; message : TMessage; resizingMode, flags : Cardinal); -begin - CreatePas; - CPlusObject := BButton_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags); -end; - -constructor TButton.Create(data : TMessage); -begin - CreatePas; - CPlusObject := BButton_Create(Self, data.CPlusObject); -end; - -function TButton.Instantiate(data : TMessage) : TArchivable; -begin - Result := BButton_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TButton.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BButton_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TButton.Draw(updateRect : TRect); -begin - -end; - -procedure TButton.MouseDown(where : TPoint); -begin - -end; - -procedure TButton.AttachedToWindow; -begin - -end; - -procedure TButton.KeyDown(bytes : PChar; numBytes : integer); -begin - -end; - -procedure TButton.MakeDefault(state : boolean); -begin - -end; - -procedure TButton.SetLabel(text : PChar); -begin - BButton_SetLabel(CPlusObject, text); -end; - -function TButton.IsDefault : boolean; -begin - Result := BButton_IsDefault(CPlusObject); -end; - -procedure TButton.MessageReceived(msg : TMessage); -begin -// BButton_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TButton.WindowActivated(state : boolean); -begin -// BButton_WindowActivated(CPlusObject, state); -end; - -procedure TButton.MouseUp(pt : TPoint); -begin -// BButton_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TButton.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin -// BButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TButton.DetachedFromWindow; -begin -// BButton_DetachedFromWindow(CPlusObject); -end; - -procedure TButton.SetValue(aValue : integer); -begin -// BButton_SetValue(CPlusObject, aValue); -end; - -procedure TButton.GetPreferredSize(width : double; height : double); -begin -// BButton_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TButton.ResizeToPreferred; -begin -// BButton_ResizeToPreferred(CPlusObject); -end; - -function TButton.Invoke(msg : TMessage) : TStatus_t; -begin - Result := BButton_Invoke(CPlusObject, msg.CPlusObject); -end; - -procedure TButton.FrameMoved(new_position : TPoint); -begin -// BButton_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TButton.FrameResized(new_width : double; new_height : double); -begin -// BButton_FrameResized(CPlusObject, new_width, new_height); -end; - -procedure TButton.MakeFocus(state : boolean); -begin - BButton_MakeFocus(CPlusObject, state); -end; - -procedure TButton.AllAttached; -begin -// BButton_AllAttached(CPlusObject); -end; - -procedure TButton.AllDetached; -begin -// BButton_AllDetached(CPlusObject); -end; - -function TButton.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BButton_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -function TButton.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BButton_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TButton.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BButton_Perform(CPlusObject, d, arg); -end; - -{procedure TButton._ReservedButton1; -begin - BButton__ReservedButton1(CPlusObject); -end; - -procedure TButton._ReservedButton2; -begin - BButton__ReservedButton2(CPlusObject); -end; - -procedure TButton._ReservedButton3; -begin - BButton__ReservedButton3(CPlusObject); -end;} - -{function TButton.operator=( : TButton) : TButton; -begin - Result := BButton_operator=(CPlusObject, ); -end; -} - -{function TButton.DrawDefault(bounds : TRect; enabled : boolean) : TRect; -begin - Result := BButton_DrawDefault(CPlusObject, bounds.CPlusObject, enabled); -end; - -function TButton.Execute : TStatus_t; -begin - Result := BButton_Execute(CPlusObject); -end;} - -{procedure TButton.float fCachedWidth; -begin - BButton_float fCachedWidth(CPlusObject); -end; -} - -{procedure TButton.bool fDrawAsDefault; -begin - BButton_bool fDrawAsDefault(CPlusObject); -end; -} - -{procedure TButton.uint32 _reserved[3]; -begin - BButton_uint32 _reserved[3](CPlusObject); -end; -} - -{procedure TButton.MakeDefault(flag : boolean); -begin -end; -} - -procedure Button_MakeDefault_hook_func(Button : TButton; 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/bepascal/be/interface/checkbox.pp b/bepascal/bepascal/be/interface/checkbox.pp deleted file mode 100644 index e61ca71..0000000 --- a/bepascal/bepascal/be/interface/checkbox.pp +++ /dev/null @@ -1,262 +0,0 @@ -{ 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 TCheckBox = class(TControl) - private - public - destructor Destroy;override; - constructor Create(frame : TRect; name, aLabel : PChar; message : TMessage; resizingMode, flags : Cardinal); virtual; - constructor Create(data : TMessage) ;override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure Draw(updateRect : TRect);override; - procedure AttachedToWindow;override; - procedure MouseDown(where : TPoint);override; - procedure MessageReceived(msg : TMessage);override; - procedure WindowActivated(state : boolean);override; - procedure KeyDown(bytes : PChar; numBytes : integer);override; - procedure MouseUp(pt : TPoint);override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);override; - procedure DetachedFromWindow;override; - procedure SetValue(avalue : integer); - procedure GetPreferredSize(width : double; height : double); - procedure ResizeToPreferred;override; - function Invoke(msg : TMessage) : TStatus_t; - procedure FrameMoved(new_position : TPoint);override; - procedure FrameResized(new_width : double; new_height : double);override; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - procedure MakeFocus(state : boolean);override; - procedure AllAttached;override; - procedure AllDetached;override; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - // procedure _ReservedCheckBox1; - //procedure _ReservedCheckBox2; - //procedure _ReservedCheckBox3; - //function operator=( : ) : ; - // procedure bool fOutlined; - //procedure uint32 _reserved[2]; - 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) : TArchivable; cdecl; external BePascalLibName name 'BCheckBox_Instantiate'; -function BCheckBox_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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 : TMessage); 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) : TStatus_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) : THandler; cdecl; external BePascalLibName name 'BCheckBox_ResolveSpecifier'; -function BCheckBox_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_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 : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BCheckBox_Perform'; -//procedure BCheckBox__ReservedCheckBox1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox__ReservedCheckBox1'; -//procedure BCheckBox__ReservedCheckBox2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox__ReservedCheckBox2'; -//procedure BCheckBox__ReservedCheckBox3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox__ReservedCheckBox3'; -//function BCheckBox_operator=(AObject : TCPlusObject; : ) : ; cdecl; external BePascalLibName name 'BCheckBox_operator='; -//procedure BCheckBox_bool fOutlined(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_bool fOutlined'; -//procedure BCheckBox_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_uint32 _reserved[2]'; - -implementation - -destructor TCheckBox.Destroy; -begin - BCheckBox_Free(CPlusObject); - inherited; -end; - -constructor TCheckBox.Create(frame : TRect; name, aLabel : PChar; message : TMessage; resizingMode, flags : Cardinal); -begin - CreatePas; - CPlusObject := BCheckBox_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags); -end; - -constructor TCheckBox.Create(data : TMessage) ; -begin - CreatePas; - CPlusObject := BCheckBox_Create_1(Self, data.CPlusObject); -end; - -function TCheckBox.Instantiate(data : TMessage) : TArchivable; -begin - Result := BCheckBox_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TCheckBox.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BCheckBox_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TCheckBox.Draw(updateRect : TRect); -begin - //BCheckBox_Draw(CPlusObject, updateRect.CPlusObject); -end; - -procedure TCheckBox.AttachedToWindow; -begin - //BCheckBox_AttachedToWindow(CPlusObject); -end; - -procedure TCheckBox.MouseDown(where : TPoint); -begin - //BCheckBox_MouseDown(CPlusObject, where.CPlusObject); -end; - -procedure TCheckBox.MessageReceived(msg : TMessage); -begin - //BCheckBox_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TCheckBox.WindowActivated(state : boolean); -begin - // BCheckBox_WindowActivated(CPlusObject, state); -end; - -procedure TCheckBox.KeyDown(bytes : PChar; numBytes : integer); -begin - //BCheckBox_KeyDown(CPlusObject, bytes, numBytes); -end; - -procedure TCheckBox.MouseUp(pt : TPoint); -begin - //BCheckBox_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TCheckBox.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin - //BCheckBox_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TCheckBox.DetachedFromWindow; -begin - //BCheckBox_DetachedFromWindow(CPlusObject); -end; - -procedure TCheckBox.SetValue(avalue : integer); -begin - BCheckBox_SetValue(CPlusObject, avalue); -end; - -procedure TCheckBox.GetPreferredSize(width : double; height : double); -begin - BCheckBox_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TCheckBox.ResizeToPreferred; -begin - BCheckBox_ResizeToPreferred(CPlusObject); -end; - -function TCheckBox.Invoke(msg : TMessage) : TStatus_t; -begin - Result := BCheckBox_Invoke(CPlusObject, msg.CPlusObject); -end; - -procedure TCheckBox.FrameMoved(new_position : TPoint); -begin - BCheckBox_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TCheckBox.FrameResized(new_width : double; new_height : double); -begin - BCheckBox_FrameResized(CPlusObject, new_width, new_height); -end; - -function TCheckBox.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BCheckBox_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -function TCheckBox.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BCheckBox_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -procedure TCheckBox.MakeFocus(state : boolean); -begin - BCheckBox_MakeFocus(CPlusObject, state); -end; - -procedure TCheckBox.AllAttached; -begin - BCheckBox_AllAttached(CPlusObject); -end; - -procedure TCheckBox.AllDetached; -begin - BCheckBox_AllDetached(CPlusObject); -end; - -function TCheckBox.Perform(d : TPerform_code; arg : Pointer) : TStatus_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/bepascal/be/interface/control.h b/bepascal/bepascal/be/interface/control.h deleted file mode 100644 index 55a8f9c..0000000 --- a/bepascal/bepascal/be/interface/control.h +++ /dev/null @@ -1,51 +0,0 @@ -/* 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/bepascal/be/interface/control.pp b/bepascal/bepascal/be/interface/control.pp deleted file mode 100644 index 110398e..0000000 --- a/bepascal/bepascal/be/interface/control.pp +++ /dev/null @@ -1,366 +0,0 @@ -{ 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 - TControl = class(TView) - private - protected - FInvoker : TInvoker; - function GetInvoker : TInvoker; - public - constructor Create(frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal); virtual; - destructor Destroy; override; - constructor Create(data : TMessage); virtual; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure WindowActivated(state : boolean); override; - procedure AttachedToWindow; override; - procedure MessageReceived(msg : TMessage); override; - procedure MakeFocus(state : boolean); virtual; - procedure KeyDown(bytes : PChar; numBytes : integer); override; - procedure MouseDown(pt : TPoint); override; - procedure MouseUp(pt : TPoint); override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); 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 : TMessage) : TStatus_t; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti{;-)} : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - procedure AllAttached; override; - procedure AllDetached; override; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -// function IsFocusChanging : boolean; -// function IsTracking : boolean; -// procedure SetTracking(state : boolean); -// procedure SetValueNoUpdate(aValue : integer); -// procedure _ReservedControl1; -// procedure _ReservedControl2; -// procedure _ReservedControl3; -// procedure _ReservedControl4; -// function operator=( : TControl) : TControl; -// procedure InitData(data : TMessage); -// procedure char *fLabel; -// procedure int32 fValue; -// procedure bool fEnabled; -// procedure bool fFocusChanging; -// procedure bool fTracking; -// procedure bool fWantsNav; -// procedure uint32 _reserved[4]; - property Invoker : TInvoker read GetInvoker; - 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) : TArchivable; cdecl; external BePascalLibName name 'BControl_Instantiate'; -function BControl_Archive(AObject : TCPlusObject; data : TCplusObject; deep : boolean) : TStatus_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) : TStatus_t; cdecl; external BePascalLibName name 'BControl_Invoke'; -function BControl_ResolveSpecifier(AObject : TCPlusObject; msg : TCplusObject; index : integer; specifier : TCplusObject; form : integer; properti : PChar) : THandler; cdecl; external BePascalLibName name 'BControl_ResolveSpecifier'; -function BControl_GetSupportedSuites(AObject : TCPlusObject; data : TCplusObject) : TStatus_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 : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BControl_Perform'; -//function BControl_IsFocusChanging(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BControl_IsFocusChanging'; -//function BControl_IsTracking(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BControl_IsTracking'; -//procedure BControl_SetTracking(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BControl_SetTracking'; -//procedure BControl_SetValueNoUpdate(AObject : TCPlusObject; aValue : integer); cdecl; external BePascalLibName name 'BControl_SetValueNoUpdate'; -//procedure BControl__ReservedControl1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl__ReservedControl1'; -//procedure BControl__ReservedControl2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl__ReservedControl2'; -//procedure BControl__ReservedControl3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl__ReservedControl3'; -//procedure BControl__ReservedControl4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl__ReservedControl4'; -//function BControl_operator=(AObject : TCPlusObject; : TControl) : TControl; cdecl; external BePascalLibName name 'BControl_operator='; -procedure BControl_InitData(AObject : TCPlusObject; data : TCplusObject); cdecl; external BePascalLibName name 'BControl_InitData'; -//procedure BControl_char *fLabel(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_char *fLabel'; -//procedure BControl_int32 fValue(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_int32 fValue'; -//procedure BControl_bool fEnabled(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_bool fEnabled'; -//procedure BControl_bool fFocusChanging(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_bool fFocusChanging'; -//procedure BControl_bool fTracking(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_bool fTracking'; -//procedure BControl_bool fWantsNav(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_bool fWantsNav'; -//procedure BControl_uint32 _reserved[4](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_uint32 _reserved[4]'; - -implementation - -constructor TControl.Create(frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal); -begin - CPlusObject := BControl_Create(Self, frame, name, aLabel, message, resizingMode, flags); -end; - -destructor TControl.Destroy; -begin - if FInvoker <> nil then - FInvoker.UnWrap; - BControl_Free(CPlusObject); -end; - -constructor TControl.Create(data : TMessage); -begin - CPlusObject := BControl_Create(Self, data.CPlusObject); -end; - -function TControl.Instantiate(data : TMessage) : TArchivable; -begin - Result := BControl_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TControl.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BControl_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TControl.WindowActivated(state : boolean); -begin -// BControl_WindowActivated(CPlusObject, state); -end; - -procedure TControl.AttachedToWindow; -begin -// BControl_AttachedToWindow(CPlusObject); -end; - -procedure TControl.MessageReceived(msg : TMessage); -begin -// BControl_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TControl.MakeFocus(state : boolean); -begin -// BControl_MakeFocus(CPlusObject, state); -end; - -procedure TControl.KeyDown(bytes : PChar; numBytes : integer); -begin -// BControl_KeyDown(CPlusObject, bytes, numBytes); -end; - -procedure TControl.MouseDown(pt : TPoint); -begin -// BControl_MouseDown(CPlusObject, pt.CPlusObject); -end; - -procedure TControl.MouseUp(pt : TPoint); -begin -// BControl_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TControl.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin -// BControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TControl.DetachedFromWindow; -begin -// BControl_DetachedFromWindow(CPlusObject); -end; - -procedure TControl.SetLabel(text : PChar); -begin - BControl_SetLabel(CPlusObject, text); -end; - -function TControl.Labl : PChar; -begin - Result := BControl_Labl(CPlusObject); -end; - -procedure TControl.SetValue(aValue : integer); -begin - BControl_SetValue(CPlusObject, aValue); -end; - -function TControl.Value : integer; -begin - Result := BControl_Value(CPlusObject); -end; - -procedure TControl.SetEnabled(aOn : boolean); -begin - BControl_SetEnabled(CPlusObject, aOn); -end; - -function TControl.IsEnabled : boolean; -begin - Result := BControl_IsEnabled(CPlusObject); -end; - -procedure TControl.GetPreferredSize(width : double; height : double); -begin -// BControl_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TControl.ResizeToPreferred; -begin -// BControl_ResizeToPreferred(CPlusObject); -end; - -function TControl.Invoke(msg : TMessage) : TStatus_t; -begin - Result := BControl_Invoke(CPlusObject, msg.CPlusObject); -end; - -function TControl.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BControl_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -function TControl.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BControl_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -procedure TControl.AllAttached; -begin -// BControl_AllAttached(CPlusObject); -end; - -procedure TControl.AllDetached; -begin -// BControl_AllDetached(CPlusObject); -end; - -function TControl.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BControl_Perform(CPlusObject, d, arg); -end; - -//function TControl.IsFocusChanging : boolean; -//begin -// Result := BControl_IsFocusChanging(CPlusObject); -//end; -// -//function TControl.IsTracking : boolean; -//begin -// Result := BControl_IsTracking(CPlusObject); -//end; -// -//procedure TControl.SetTracking(state : boolean); -//begin -// BControl_SetTracking(CPlusObject, state); -//end; -// -//procedure TControl.SetValueNoUpdate(aValue : integer); -//begin -// BControl_SetValueNoUpdate(CPlusObject, aValue); -//end; - -//procedure TControl._ReservedControl1; -//begin -// BControl__ReservedControl1(CPlusObject); -//end; -// -//procedure TControl._ReservedControl2; -//begin -// BControl__ReservedControl2(CPlusObject); -//end; -// -//procedure TControl._ReservedControl3; -//begin -// BControl__ReservedControl3(CPlusObject); -//end; -// -//procedure TControl._ReservedControl4; -//begin -// BControl__ReservedControl4(CPlusObject); -//end; - -//function TControl.operator=( : TControl) : TControl; -//begin -// Result := BControl_operator=(CPlusObject, ); -//end; - -//procedure TControl.InitData(data : TMessage); -//begin -// BControl_InitData(CPlusObject, data.CPlusObject); -//end; - -//procedure TControl.char *fLabel; -//begin -// BControl_char *fLabel(CPlusObject); -//end; -// -//procedure TControl.int32 fValue; -//begin -// BControl_int32 fValue(CPlusObject); -//end; -// -//procedure TControl.bool fEnabled; -//begin -// BControl_bool fEnabled(CPlusObject); -//end; -// -//procedure TControl.bool fFocusChanging; -//begin -// BControl_bool fFocusChanging(CPlusObject); -//end; -// -//procedure TControl.bool fTracking; -//begin -// BControl_bool fTracking(CPlusObject); -//end; -// -//procedure TControl.bool fWantsNav; -//begin -// BControl_bool fWantsNav(CPlusObject); -//end; -// -//procedure TControl.uint32 _reserved[4]; -//begin -// BControl_uint32 _reserved[4](CPlusObject); -//end; - -function TControl.GetInvoker : TInvoker; -begin - if FInvoker = nil then - begin - Result := TInvoker.Wrap(CPlusObject); - end; - Result := FInvoker; -end; - -end. diff --git a/bepascal/bepascal/be/interface/font.h b/bepascal/bepascal/be/interface/font.h deleted file mode 100644 index fcadc30..0000000 --- a/bepascal/bepascal/be/interface/font.h +++ /dev/null @@ -1,33 +0,0 @@ -/* 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/bepascal/be/interface/font.pp b/bepascal/bepascal/be/interface/font.pp deleted file mode 100644 index 366ab06..0000000 --- a/bepascal/bepascal/be/interface/font.pp +++ /dev/null @@ -1,494 +0,0 @@ -{ 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 - Tfont_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 - -Tfont_metric_mode = ( - B_SCREEN_METRIC, - B_PRINTING_METRIC); - - Tfont_file_format =( - B_TRUETYPE_WINDOWS , - B_POSTSCRIPT_TYPE1_WINDOWS -); - - -const B_FONT_FAMILY_LENGTH= 63; - -type TFONT_FAMILY = array[0..B_FONT_FAMILY_LENGTH] of char; - -const B_FONT_STYLE_LENGTH= 63; - -type Tfont_style = array[0..B_FONT_STYLE_LENGTH ] of char; - -type -Tescapement_delta = record - nonspace : real; - space: real; -end; -Tedge_info = record - left: real; - right: real; -end; -Ttuned_font_info = record - size : real; - shear: real ; - rotation : real; - flags: cardinal; - face : integer; -end; - - - -Tfont_height = record - ascent: real; - descent: real; - leading: real; -end; - -Tfont_direction =( - B_FONT_LEFT_TO_RIGHT , - B_FONT_RIGHT_TO_LEFT -); - - - -type - TFont = class(TBeObject) - private - public - constructor Create; - constructor Create(font : TFont);virtual; - destructor Destroy;override; - function SetFamilyAndStyle(family : TFONT_FAMILY; style : Tfont_style) : TStatus_t; - procedure SetFamilyAndStyle(code : Cardinal); - function SetFamilyAndFace(family : TFONT_FAMILY; aface : integer) : TStatus_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 : TFONT_FAMILY; style : Tfont_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 : Tfont_direction; - function IsFixed : boolean; - function IsFullAndHalfFixed : boolean; - function BoundingBox : TRect; -// function Blocks : ; - function FileFormat : Tfont_file_format; - function CountTuned : integer; - procedure GetTunedInfo(index : integer; info : Ttuned_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 : Tfont_height); - // procedure GetBoundingBoxesAsGlyphs(charArray : ; numChars : integer; mode : ; boundingBoxArray : TRect); - // procedure GetBoundingBoxesAsString(charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : TRect); - // procedure GetBoundingBoxesForStrings(stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : TRect); -// 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 : TFont): 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 : Tfont_family; style : Tfont_style) : TStatus_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 : Tfont_family; face : integer) : TStatus_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 : Tfont_family; style : Tfont_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) : Tfont_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) : TRect; cdecl; external BePascalLibName name 'BFont_BoundingBox'; -//function BFont_Blocks(AObject : TCPlusObject) : ; cdecl; external BePascalLibName name 'BFont_Blocks'; -function BFont_FileFormat(AObject : TCPlusObject) :Tfont_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 : Ttuned_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 :Tfont_height ); cdecl; external BePascalLibName name 'BFont_GetHeight'; - -{procedure BFont_GetBoundingBoxesAsGlyphs(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; boundingBoxArray : TRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesAsGlyphs'; -procedure BFont_GetBoundingBoxesAsString(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : TRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesAsString'; -procedure BFont_GetBoundingBoxesForStrings(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : TRect); 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 : TRect); cdecl; external BePascalLibName name 'BFont__GetBoundingBoxes_'; -} -implementation - - -constructor TFont.Create; -begin - inherited Create; - CPlusObject := BFont_Create(Self); -end; - -constructor TFont.Create(font : TFont); -begin - inherited Create; - CPlusObject := BFont_Create(Self, font); -end; - -destructor TFont.Destroy; -begin - if CPlusObject <> nil then - BFont_Free(CPlusObject); - inherited; -end; - -function TFont.SetFamilyAndStyle(family : Tfont_family; style :Tfont_style ) : TStatus_t; -begin - Result := BFont_SetFamilyAndStyle(CPlusObject, family, style); -end; - -procedure TFont.SetFamilyAndStyle(code : Cardinal); -begin - BFont_SetFamilyAndStyle(CPlusObject, code); -end; - -function TFont.SetFamilyAndFace(family : Tfont_family; aface : integer) : TStatus_t; -begin - Result := BFont_SetFamilyAndFace(CPlusObject, family, aface); -end; - -procedure TFont.SetSize(asize : single); -begin - BFont_SetSize(CPlusObject, asize); -end; - -procedure TFont.SetShear(ashear : single); -begin - BFont_SetShear(CPlusObject, ashear); -end; - -procedure TFont.SetRotation(arotation : single); -begin - BFont_SetRotation(CPlusObject, arotation); -end; - -procedure TFont.SetSpacing(aspacing : integer); -begin - BFont_SetSpacing(CPlusObject, aspacing); -end; - -procedure TFont.SetEncoding(aencoding : integer); -begin - BFont_SetEncoding(CPlusObject, aencoding); -end; - -procedure TFont.SetFace(aface : integer); -begin - BFont_SetFace(CPlusObject, aface); -end; - -procedure TFont.SetFlags(aflags : Cardinal); -begin - BFont_SetFlags(CPlusObject, aflags); -end; - -procedure TFont.GetFamilyAndStyle(family : Tfont_family; style :Tfont_style ); -begin - BFont_GetFamilyAndStyle(CPlusObject, family, style); -end; - -function TFont.FamilyAndStyle : Cardinal; -begin - Result := BFont_FamilyAndStyle(CPlusObject); -end; - -function TFont.Size : single; -begin - Result := BFont_Size(CPlusObject); -end; - -function TFont.Shear : single; -begin - Result := BFont_Shear(CPlusObject); -end; - -function TFont.Rotation : single; -begin - Result := BFont_Rotation(CPlusObject); -end; - -function TFont.Spacing : integer; -begin - Result := BFont_Spacing(CPlusObject); -end; - -function TFont.Encoding : integer; -begin - Result := BFont_Encoding(CPlusObject); -end; - -function TFont.Face : integer; -begin - Result := BFont_Face(CPlusObject); -end; - -function TFont.Flags : Cardinal; -begin - Result := BFont_Flags(CPlusObject); -end; - -function TFont.Direction : Tfont_direction; -begin - Result := BFont_Direction(CPlusObject); -end; - -function TFont.IsFixed : boolean; -begin - Result := BFont_IsFixed(CPlusObject); -end; - -function TFont.IsFullAndHalfFixed : boolean; -begin - Result := BFont_IsFullAndHalfFixed(CPlusObject); -end; - -function TFont.BoundingBox : TRect; -begin - Result := BFont_BoundingBox(CPlusObject); -end; - -{function TFont.Blocks : ; -begin - Result := BFont_Blocks(CPlusObject); -end; -} -function TFont.FileFormat : Tfont_file_format; -begin - Result := BFont_FileFormat(CPlusObject); -end; - -function TFont.CountTuned : integer; -begin - Result := BFont_CountTuned(CPlusObject); -end; - -procedure TFont.GetTunedInfo(index : integer; info : Ttuned_font_info); -begin - BFont_GetTunedInfo(CPlusObject, index, info); -end; - -procedure TFont.TruncateString(in_out : TString; mode : Cardinal; width : single); -begin - BFont_TruncateString(CPlusObject, in_out.CPlusObject, mode, width); -end; - -{procedure TFont.GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : ); -begin - BFont_GetTruncatedStrings(CPlusObject, stringArray, numStrings, mode, width, resultArray.CPlusObject); -end; - -procedure TFont.GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); -begin - BFont_GetTruncatedStrings(CPlusObject, stringArray, numStrings, mode, width, resultArray); -end; -} - -function TFont.StringWidth(astring : PChar) : single; -begin - Result := BFont_StringWidth(CPlusObject, astring); -end; - -function TFont.StringWidth(astring : PChar; length : integer) : single; -begin - Result := BFont_StringWidth(CPlusObject, astring, length); -end; - -{procedure TFont.GetStringWidths(stringArray : PChar; lengthArray : integer ; numStrings : integer; widthArray : single); -begin - BFont_GetStringWidths(CPlusObject, stringArray, lengthArray, numStrings, widthArray); -end; - -procedure TFont.GetEscapements(charArray : PChar; numChars : integer; escapementArray : single); -begin - BFont_GetEscapements(CPlusObject, charArray, numChars, escapementArray); -end; - -procedure TFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : single); -begin - BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray); -end; - -procedure TFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint); -begin - BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray.CPlusObject); -end; - -procedure TFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint; offsetArray : TPoint); -begin - BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray.CPlusObject, offsetArray.CPlusObject); -end; - -procedure TFont.GetEdges(charArray : ; numBytes : integer; edgeArray : ); -begin - BFont_GetEdges(CPlusObject, charArray, numBytes, edgeArray); -end; -} -procedure TFont.GetHeight(height :Tfont_height ); -begin - BFont_GetHeight(CPlusObject, height); -end; - -{ -procedure TFont.GetBoundingBoxesAsGlyphs(charArray : ; numChars : integer; mode : ; boundingBoxArray : TRect); -begin - BFont_GetBoundingBoxesAsGlyphs(CPlusObject, charArray, numChars, mode, boundingBoxArray.CPlusObject); -end; - -procedure TFont.GetBoundingBoxesAsString(charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : TRect); -begin - BFont_GetBoundingBoxesAsString(CPlusObject, charArray, numChars, mode, delta, boundingBoxArray.CPlusObject); -end; - -procedure TFont.GetBoundingBoxesForStrings(stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : TRect); -begin - BFont_GetBoundingBoxesForStrings(CPlusObject, stringArray, numStrings, mode, deltas, boundingBoxArray.CPlusObject); -end; - -procedure TFont.GetGlyphShapes(charArray : ; numChars : integer; glyphShapeArray : ); -begin - BFont_GetGlyphShapes(CPlusObject, charArray, numChars, glyphShapeArray.CPlusObject); -end; - -procedure TFont.GetHasGlyphs(charArray : ; numChars : integer; hasArray : boolean); -begin - BFont_GetHasGlyphs(CPlusObject, charArray, numChars, hasArray); -end; -} -procedure TFont.PrintToStream; -begin - BFont_PrintToStream(CPlusObject); -end; - - -end. diff --git a/bepascal/bepascal/be/interface/graphicdefs.pp b/bepascal/bepascal/be/interface/graphicdefs.pp deleted file mode 100644 index 7eeefb3..0000000 --- a/bepascal/bepascal/be/interface/graphicdefs.pp +++ /dev/null @@ -1,314 +0,0 @@ -unit GraphicDefs; -{ - (Manual) Translation of Be's GraphicDefs.h - - Ok, if TBitmap doesn't work, the error its most likely to be in this unit. - - What this unit needs? that someone take a look at the points marked with: - -// Check/Confirm This one, please. - - I'm not too sure about how to translate the enums, and also not sure about - the values of the index on a set. Excuse (and fix!) my ignorace :) - - Maybe I also screwed up a little the integer types too, be warned :^P - --- BiPolar. -} -interface - -uses - SupportDefs; - -{$PACKRECORDS C} - - -type - // This one must be find a better place. - PCardinal = ^Cardinal; - -(*----------------------------------------------------------------*) -type - { TPattern = pattern } - TPattern = record - Data : array [0..7] of Byte; // uint8 - end; - -// How we do 'export' these global const? -// Check/Confirm This one, please. - -var {const} - B_SOLID_HIGH : TPattern; cvar; external; - B_MIXED_COLORS : TPattern; cvar; external; - B_SOLID_LOW : TPattern; cvar; external; - -(*----------------------------------------------------------------*) -type - { I do prefer TRGBColor but... oh well... } - TRGB_Color = record - Red, - Green, - Blue, - Alpha : Byte; - end; - -(*----------------------------------------------------------------*) -var -{const} - //extern const rgb_color B_TRANSPARENT_COLOR; - B_TRANSPARENT_COLOR : TRGB_Color; cvar; external; - //extern const uint8 B_TRANSPARENT_MAGIC_CMAP8; - B_TRANSPARENT_MAGIC_CMAP8 : Byte; cvar; external; - //extern const uint16 B_TRANSPARENT_MAGIC_RGBA15; - B_TRANSPARENT_MAGIC_RGBA15 : Word; cvar; external; - //extern const uint16 B_TRANSPARENT_MAGIC_RGBA15_BIG; - B_TRANSPARENT_MAGIC_RGBA15_BIG : Word; cvar; external; - //extern const uint32 B_TRANSPARENT_MAGIC_RGBA32; - B_TRANSPARENT_MAGIC_RGBA32 : Cardinal; cvar; external; - //extern const uint32 B_TRANSPARENT_MAGIC_RGBA32_BIG; - B_TRANSPARENT_MAGIC_RGBA32_BIG : Cardinal; cvar; external; - //extern const uint8 B_TRANSPARENT_8_BIT; - B_TRANSPARENT_8_BIT : Byte; cvar; external; - //extern const rgb_color B_TRANSPARENT_32_BIT; - B_TRANSPARENT_32_BIT : TRGB_Color; cvar; external; - -(*----------------------------------------------------------------*) -type - - TColorMap = record - ID : Integer; // int32 - ColorList: array [0..255] of TRGB_Color; - InversionMap : array [0..255] of Byte; // uint8 - IndexMap : array [0..32767] of Byte; // uint8 - end; - - { TOverlayRectLimits = overlay_rect_limits } - TOverlayRectLimits = record - HorizontalAlignment, - VerticalAlignment, - WidthAlignment, - HeightAlignment, - MinWidth, - MaxWidth, - MinHeight, - MaxHeight : Word; // uint16 - Reserved : array [0..7] of Cardinal; // uint32 - end; - - { TOverlayRestrictions = overlay_restrictions } - TOverlayRestrictions = record - Source, - Destination : TOverlayRectLimits; - MinWidthScale, - MaxWidthScale, - MinHeightScale, - MaxHeightScale : Double; // float - Reserved : array [0..7] of Cardinal; // uint32 - end; - -(*----------------------------------------------------------------*) - -//struct screen_id { int32 id; }; - TScreenID = record - ID : Integer - end; - -//extern const struct screen_id B_MAIN_SCREEN_ID; -var -{const} - B_MAIN_SCREEN_ID : TScreenID; cvar; external; - -(*----------------------------------------------------------------*) -type - - TColor_Space = Cardinal; // or is just word? - -const - - B_NO_COLOR_SPACE = $0000; // byte in memory order, high bit first - - // linear color space (little endian is the default) - B_RGB32 = $0008; // B[7:0] G[7:0] R[7:0] -[7:0] - B_RGBA32 = $2008; // B[7:0] G[7:0] R[7:0] A[7:0] - B_RGB24 = $0003; // B[7:0] G[7:0] R[7:0] - B_RGB16 = $0005; // G[2:0],B[4:0] R[4:0],G[5:3] - B_RGB15 = $0010; // G[2:0],B[4:0] -[0],R[4:0],G[4:3] - B_RGBA15 = $2010; // G[2:0],B[4:0] A[0],R[4:0],G[4:3] - B_CMAP8 = $0004; // D[7:0] - B_GRAY8 = $0002; // Y[7:0] - B_GRAY1 = $0001; // Y0[0],Y1[0],Y2[0],Y3[0],Y4[0],Y5[0],Y6[0],Y7[0] - - // big endian version, when the encoding is not endianess independant - B_RGB32_BIG = $1008; // -[7:0] R[7:0] G[7:0] B[7:0] - B_RGBA32_BIG = $3008; // A[7:0] R[7:0] G[7:0] B[7:0] - B_RGB24_BIG = $1003; // R[7:0] G[7:0] B[7:0] - B_RGB16_BIG = $1005; // R[4:0],G[5:3] G[2:0],B[4:0] - B_RGB15_BIG = $1010; // -[0],R[4:0],G[4:3] G[2:0],B[4:0] - B_RGBA15_BIG = $3010; // A[0],R[4:0],G[4:3] G[2:0],B[4:0] - - // little-endian declarations, for completness - B_RGB32_LITTLE = B_RGB32; - B_RGBA32_LITTLE = B_RGBA32; - B_RGB24_LITTLE = B_RGB24; - B_RGB16_LITTLE = B_RGB16; - B_RGB15_LITTLE = B_RGB15; - B_RGBA15_LITTLE = B_RGBA15; - - // non linear color space -- note that these are here for exchange purposes; - // a BBitmap or BView may not necessarily support all these color spaces. - - // Loss/Saturation points are Y 16-235 (absoulte); Cb/Cr 16-240 (center 128) - - B_YCbCr422 = $4000; // Y0[7:0] Cb0[7:0] Y1[7:0] Cr0[7:0] Y2[7:0]... - // Cb2[7:0] Y3[7:0] Cr2[7:0] - B_YCbCr411 = $4001; // Cb0[7:0] Y0[7:0] Cr0[7:0] Y1[7:0] Cb4[7:0]... - // Y2[7:0] Cr4[7:0] Y3[7:0] Y4[7:0] Y5[7:0]... - // Y6[7:0] Y7[7:0] - B_YCbCr444 = $4003; // Y0[7:0] Cb0[7:0] Cr0[7:0] - B_YCbCr420 = $4004; // Non-interlaced only, Cb0 Y0 Y1 Cb2 Y2 Y3 on even scan lines ... - // Cr0 Y0 Y1 Cr2 Y2 Y3 on odd scan lines - - // Extrema points are Y 0 - 207 (absolute) U -91 - 91 (offset 128) V -127 - 127 (offset 128) - // note that YUV byte order is different from YCbCr - // USE YCbCr, not YUV, when that's what you mean! - B_YUV422 = $4020; // U0[7:0] Y0[7:0] V0[7:0] Y1[7:0] ... - // U2[7:0] Y2[7:0] V2[7:0] Y3[7:0] - B_YUV411 = $4021; // U0[7:0] Y0[7:0] Y1[7:0] V0[7:0] Y2[7:0] Y3[7:0] - // U4[7:0] Y4[7:0] Y5[7:0] V4[7:0] Y6[7:0] Y7[7:0] - B_YUV444 = $4023; // U0[7:0] Y0[7:0] V0[7:0] U1[7:0] Y1[7:0] V1[7:0] - B_YUV420 = $4024; // Non-interlaced only, U0 Y0 Y1 U2 Y2 Y3 on even scan lines ... - // V0 Y0 Y1 V2 Y2 Y3 on odd scan lines - B_YUV9 = $402C; // planar? 410? - B_YUV12 = $402D; // planar? 420? - - B_UVL24 = $4030; // U0[7:0] V0[7:0] L0[7:0] ... - B_UVL32 = $4031; // U0[7:0] V0[7:0] L0[7:0] X0[7:0]... - B_UVLA32 = $6031; // U0[7:0] V0[7:0] L0[7:0] A0[7:0]... - - B_LAB24 = $4032; // L0[7:0] a0[7:0] b0[7:0] ... (a is not alpha!) - B_LAB32 = $4033; // L0[7:0] a0[7:0] b0[7:0] X0[7:0] ... (b is not alpha!) - B_LABA32 = $6033; // L0[7:0] a0[7:0] b0[7:0] A0[7:0] ... (A is alpha) - - // red is at hue = 0 - B_HSI24 = $4040; // H[7:0] S[7:0] I[7:0] - B_HSI32 = $4041; // H[7:0] S[7:0] I[7:0] X[7:0] - B_HSIA32 = $6041; // H[7:0] S[7:0] I[7:0] A[7:0] - - B_HSV24 = $4042; // H[7:0] S[7:0] V[7:0] - B_HSV32 = $4043; // H[7:0] S[7:0] V[7:0] X[7:0] - B_HSVA32 = $6043; // H[7:0] S[7:0] V[7:0] A[7:0] - - B_HLS24 = $4044; // H[7:0] L[7:0] S[7:0] - B_HLS32 = $4045; // H[7:0] L[7:0] S[7:0] X[7:0] - B_HLSA32 = $6045; // H[7:0] L[7:0] S[7:0] A[7:0] - - B_CMY24 = $C001; // C[7:0] M[7:0] Y[7:0] No gray removal done - B_CMY32 = $C002; // C[7:0] M[7:0] Y[7:0] X[7:0] No gray removal done - B_CMYA32 = $E002; // C[7:0] M[7:0] Y[7:0] A[7:0] No gray removal done - B_CMYK32 = $C003; // C[7:0] M[7:0] Y[7:0] K[7:0] - - // compatibility declarations - B_MONOCHROME_1_BIT = B_GRAY1; - B_GRAYSCALE_8_BIT = B_GRAY8; - B_COLOR_8_BIT = B_CMAP8; - B_RGB_32_BIT = B_RGB32; - B_RGB_16_BIT = B_RGB15; - B_BIG_RGB_32_BIT = B_RGB32_BIG; - B_BIG_RGB_16_BIT = B_RGB15_BIG; - - -// Find out whether a specific color space is supported by BBitmaps. -// Support_flags will be set to what kinds of support are available. -// If support_flags is set to 0, false will be returned. -const - - B_VIEWS_SUPPORT_DRAW_BITMAP = $1; - B_BITMAPS_SUPPORT_ATTACHED_VIEWS = $2; - -// Check/Confirm This one, please. -function BitmapsSupportSpace(space : TColor_Space; support_flags : PCardinal) - : boolean; cdecl; external 'be' name 'bitmaps_support_space'; -function GetPixelSizeFor(space : TColor_Space; pixel_chunk : TStatus_t; - row_alignment : TStatus_t; pixels_per_chunk : TStatus_t) - : TStatus_t; cdecl; external 'be' name 'get_pixel_size_for'; - -{ -_IMPEXP_BE bool bitmaps_support_space(color_space space, uint32 * support_flags); - -// "pixel_chunk" is the native increment from one pixel starting on an integral -// byte to the next. -// "row_alignment" is the native alignment for pixel scanline starts. -// "pixels_per_chunk" is the number of pixels in a pixel_chunk. For instance, -// B_GRAY1 sets pixel_chunk to 1, row_alignment to 4 and pixels_per_chunk to 8, -// whereas B_RGB24 sets pixel_chunk to 3, row_alignment to 4 and -// pixels_per_chunk to 1. - -_IMPEXP_BE status_t get_pixel_size_for(color_space space, size_t * pixel_chunk, - size_t * row_alignment, size_t * pixels_per_chunk); -} - -(*----------------------------------------------------------------*) -type - - BufferOrientation = (B_BUFFER_TOP_TO_BOTTOM, B_BUFFER_BOTTOM_TO_TOP); - -// Check/Confirm This one, please. - BufferLayout = (B_BUFFER_NONINTERLEAVED); // B_BUFFER_NONINTERLEAVED = 1 - -(*----------------------------------------------------------------*) - - DrawingMode = (B_OP_COPY, B_OP_OVER, B_OP_ERASE, B_OP_INVERT, B_OP_ADD, - B_OP_SUBTRACT, B_OP_BLEND, B_OP_MIN, B_OP_MAX, - B_OP_SELECT, B_OP_ALPHA); - - -// Check/Confirm This one, please. - -// this was: -// enum source_alpha { -// B_PIXEL_ALPHA=0, -// B_CONSTANT_ALPHA -// }; -// -// enum alpha_function { -// B_ALPHA_OVERLAY=0, -// B_ALPHA_COMPOSITE -// }; - - SourceAlpha = (B_PIXEL_ALPHA, B_CONSTANT_ALPHA); - AlphaFunction = (B_ALPHA_OVERLAY, B_ALPHA_COMPOSITE); - -const - - B_8_BIT_640x480 = $00000001; - B_8_BIT_800x600 = $00000002; - B_8_BIT_1024x768 = $00000004; - B_8_BIT_1280x1024 = $00000008; - B_8_BIT_1600x1200 = $00000010; - B_16_BIT_640x480 = $00000020; - B_16_BIT_800x600 = $00000040; - B_16_BIT_1024x768 = $00000080; - B_16_BIT_1280x1024 = $00000100; - B_16_BIT_1600x1200 = $00000200; - B_32_BIT_640x480 = $00000400; - B_32_BIT_800x600 = $00000800; - B_32_BIT_1024x768 = $00001000; - B_32_BIT_1280x1024 = $00002000; - B_32_BIT_1600x1200 = $00004000; - B_8_BIT_1152x900 = $00008000; - B_16_BIT_1152x900 = $00010000; - B_32_BIT_1152x900 = $00020000; - B_15_BIT_640x480 = $00040000; - B_15_BIT_800x600 = $00080000; - B_15_BIT_1024x768 = $00100000; - B_15_BIT_1280x1024 = $00200000; - B_15_BIT_1600x1200 = $00400000; - B_15_BIT_1152x900 = $00800000; - - // do not use B_FAKE_DEVICE--it will go away! - B_FAKE_DEVICE = $40000000; - B_8_BIT_640x400 = $80000000; // (int) - -implementation - -end. \ No newline at end of file diff --git a/bepascal/bepascal/be/interface/interfacedefs.pp b/bepascal/bepascal/be/interface/interfacedefs.pp deleted file mode 100644 index 6722b9b..0000000 --- a/bepascal/bepascal/be/interface/interfacedefs.pp +++ /dev/null @@ -1,60 +0,0 @@ -{ 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 interfacedefs; - -interface - -uses graphicdefs,beobj; - -type - TAlignment = (B_ALIGN_LEFT, - B_ALIGN_RIGHT, - B_ALIGN_CENTER); - - - Tcolor_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 ); - - Torientation =( - B_HORIZONTAL, - B_VERTICAL); - - Tborder_style =( - B_PLAIN_BORDER, - B_FANCY_BORDER, - B_NO_BORDER); - - TButton_width = ( - B_WIDTH_AS_USUAL, - B_WIDTH_FROM_WIDSET, - B_WIDTH_FROM_LABEL); - -function ui_color(which : Tcolor_which) : Trgb_color; cdecl; external 'be' name 'ui_color__F11color_which'; -function Ttint_color(color : Trgb_color; which :Tcolor_which) : Trgb_color;cdecl; external 'be' name 'tint_color__FG9rgb_colorf'; - -implementation - -end. diff --git a/bepascal/bepascal/be/interface/listitem.pp b/bepascal/bepascal/be/interface/listitem.pp deleted file mode 100644 index 3d41dbb..0000000 --- a/bepascal/bepascal/be/interface/listitem.pp +++ /dev/null @@ -1,352 +0,0 @@ -{ 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 - TListItem = class(TBeObject) - private - public - constructor Create(aoutlineLevel : longint; expanded : boolean );virtual; - constructor Create(data : TMessage); - destructor Destroy;override; - function Archive(data : TMessage; deep : boolean) : TStatus_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 : TView; bounds : TRect; complete : boolean); - procedure Update(owner : TView; font : TFont); - // function Perform(d : TPerform_code; var arg : Pointer) : TStatus_t; - function IsExpanded : boolean; - procedure SetExpanded(expanded : boolean); - function OutlineLevel : Cardinal; - function HasSubitems : boolean; - end; - -type - TStringItem = class(TListItem) - private - public - constructor Create( atext: pchar;aoutlineLevel : longint; expanded : boolean);virtual; - destructor Destroy;override; - constructor Create(data : TMessage); - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure DrawItem(owner : TView; frame : TRect; complete : boolean); - procedure SetText( atext : PChar); - function Text : PChar; - procedure Update(owner : TView; font : TFont); -// function Perform(d : TPerform_code; arg : Pointer) : TStatus_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) : TStatus_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) : TStatus_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) : TArchivable; cdecl; external BePascalLibName name 'BStringItem_Instantiate'; -function BStringItem_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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 : TPerform_code; arg : Pointer) : TStatus_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 TListItem.Create(aoutlineLevel : longint; expanded : boolean ); -begin - CreatePas; - CPlusObject := BListItem_Create(Self,aoutlineLevel , expanded ); -end; - -constructor TListItem.Create(data : TMessage); -begin - CreatePas; - CPlusObject := BListItem_Create(Self, data.CPlusObject); -end; - -destructor TListItem.Destroy; -begin - BListItem_Free(CPlusObject); - inherited; -end; - -function TListItem.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BListItem_Archive(CPlusObject, data.CPlusObject, deep); -end; - -function TListItem.Height : double; -begin - Result := BListItem_Height(CPlusObject); -end; - -function TListItem.Width : double; -begin - Result := BListItem_Width(CPlusObject); -end; - -function TListItem.IsSelected : boolean; -begin - Result := BListItem_IsSelected(CPlusObject); -end; - -procedure TListItem.Select; -begin - BListItem_Select(CPlusObject); -end; - -procedure TListItem.Deselect; -begin - BListItem_Deselect(CPlusObject); -end; - -procedure TListItem.SetEnabled(aon : boolean); -begin - BListItem_SetEnabled(CPlusObject, aon); -end; - -function TListItem.IsEnabled : boolean; -begin - Result := BListItem_IsEnabled(CPlusObject); -end; - -procedure TListItem.SetHeight(aheight : double); -begin - BListItem_SetHeight(CPlusObject, aheight); -end; - -procedure TListItem.SetWidth(awidth : double); -begin - BListItem_SetWidth(CPlusObject, awidth); -end; - -procedure TListItem.DrawItem(owner : TView; bounds : TRect; complete : boolean); -begin - //BListItem_DrawItem(CPlusObject, owner.CPlusObject, bounds.CPlusObject, complete); -end; - -procedure TListItem.Update(owner : TView; font : TFont); -begin - // BListItem_Update(CPlusObject, owner.CPlusObject, font); -end; - -{function TListItem.Perform(d : TPerform_code; var arg : Pointer) : TStatus_t; -begin - Result := BListItem_Perform(CPlusObject, d, arg); -end; -} -function TListItem.IsExpanded : boolean; -begin - Result := BListItem_IsExpanded(CPlusObject); -end; - -procedure TListItem.SetExpanded(expanded : boolean); -begin - BListItem_SetExpanded(CPlusObject, expanded); -end; - -function TListItem.OutlineLevel : Cardinal; -begin - Result := BListItem_OutlineLevel(CPlusObject); -end; - -function TListItem.HasSubitems : boolean; -begin - // Result := BListItem_HasSubitems(CPlusObject); -end; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// TStringItem -// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -constructor TStringItem.Create( atext: pchar;aoutlineLevel : longint; expanded : boolean); -begin - CreatePas; - CPlusObject := BStringItem_Create(Self,atext,aoutlineLevel,expanded); -end; - -destructor TStringItem.Destroy; -begin - BStringItem_Free(CPlusObject); - inherited; -end; - -constructor TStringItem.Create(data : TMessage); -begin - CreatePas; - CPlusObject := BStringItem_Create(Self, data.CPlusObject); -end; - -function TStringItem.Instantiate(data : TMessage) : TArchivable; -begin - Result := BStringItem_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TStringItem.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - //Result := BStringItem_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TStringItem.DrawItem(owner : TView; frame : TRect; complete : boolean); -begin - //BStringItem_DrawItem(CPlusObject, owner.CPlusObject, frame.CPlusObject, complete); -end; - -procedure TStringItem.SetText( atext : PChar); -begin - BStringItem_SetText(CPlusObject, atext); -end; - -function TStringItem.Text : PChar; -begin - Result := BStringItem_Text(CPlusObject); -end; - -procedure TStringItem.Update(owner : TView; font : TFont); -begin - //BStringItem_Update(CPlusObject, owner.CPlusObject, font); -end; - -{function TStringItem.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BStringItem_Perform(CPlusObject, d, arg); -end; -} - -procedure ListItem_DrawItem_hook_func(Liste : TListItem;owner : TCPlusObject; bounds : TCPlusObject; complete : boolean); cdecl; -var Rect : TRect; - ow : TView; - -begin - Rect:=TRect.Wrap(bounds); - ow:=TView.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 : TStringItem;owner : TCPlusObject; bounds : TCPlusObject; complete : boolean); cdecl; -var Rect : TRect; - ow : TView; -begin - Rect:=TRect.Wrap(bounds); - ow:=TView.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 : TListItem;owner : TCPlusObject; font : TCPlusObject); cdecl; -var afont: TFont; - ow : TView; -begin - afont:=TFont.Wrap(font); - ow:=TView.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 : TStringItem;owner : TCPlusObject; font : TCPlusObject); cdecl; -var afont: TFont; - ow : TView; -begin - afont:=TFont.Wrap(font); - ow:=TView.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/bepascal/be/interface/listview.h b/bepascal/bepascal/be/interface/listview.h deleted file mode 100644 index c56b20f..0000000 --- a/bepascal/bepascal/be/interface/listview.h +++ /dev/null @@ -1,79 +0,0 @@ -/* 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/bepascal/be/interface/listview.pp b/bepascal/bepascal/be/interface/listview.pp deleted file mode 100644 index 5f0e0e1..0000000 --- a/bepascal/bepascal/be/interface/listview.pp +++ /dev/null @@ -1,548 +0,0 @@ -{ 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 -Tlist_view_type =( - B_SINGLE_SELECTION_LIST, - B_MULTIPLE_SELECTION_LIST -); - - -type - TListView = class(TView) - private - public - constructor Create(frame : TRect; name : pchar; atype : Tlist_view_type; resizeMask: longint; flags : longint); virtual; - constructor Create(data : TMessage); - destructor Destroy;override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure Draw(updateRect : TRect);override; - procedure MessageReceived(msg : TMessage);override; - procedure MouseDown(where : TPoint);override; - procedure KeyDown(bytes : PChar; numBytes : integer);override; - procedure MakeFocus(state : boolean); - procedure FrameResized(newWidth : double; newHeight : double);override; - procedure TargetedByScrollView(scroller : TScrollView); - procedure ScrollTo(x : double; y : double); - procedure ScrollTo(where : TPoint); - function AddItem(item : TListItem) : boolean; - function AddItem(item : TListItem; atIndex : integer) : boolean; - function AddList(newItems : TList) : boolean; - function AddList(newItems : TList; atIndex : integer) : boolean; - function RemoveItem(item : TListItem) : boolean; - function RemoveItem(index : integer) : TListItem; - function RemoveItems(index : integer; count : integer) : boolean; - procedure SetSelectionMessage(message : TMessage); - procedure SetInvocationMessage(message : TMessage); - function SelectionMessage : TMessage; - function SelectionCommand : Cardinal; - function InvocationMessage : TMessage; - function InvocationCommand : Cardinal; - procedure SetListType(atype : TList_view_type); - function ListType : TList_view_type; - function ItemAt(index : integer) : TListItem; - function IndexOf(point : TPoint) : integer; - function IndexOf(item : TListItem) : integer; - function FirstItem : TListItem; - function LastItem : TListItem; - function HasItem(item : TListItem) : boolean; - function CountItems : integer; - procedure MakeEmpty; - function IsEmpty : boolean; - function Items : TListView; - 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 : TMessage) : TStatus_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 : TListItem) : boolean; - procedure AttachedToWindow;override; - procedure FrameMoved(new_position : TPoint);override; - function ItemFrame(index : integer) : TRect; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - procedure WindowActivated(state : boolean);override; - procedure MouseUp(pt : TPoint);override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);override; - procedure DetachedFromWindow;override; - function InitiateDrag(pt : TPoint; 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 : Tlist_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) : TArchivable; cdecl; external BePascalLibName name 'BListView_Instantiate'; -function BListView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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) : TListItem; 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) : TMessage; cdecl; external BePascalLibName name 'BListView_SelectionMessage'; -function BListView_SelectionCommand(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BListView_SelectionCommand'; -function BListView_InvocationMessage(AObject : TCPlusObject) : TMessage; cdecl; external BePascalLibName name 'BListView_InvocationMessage'; -function BListView_InvocationCommand(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BListView_InvocationCommand'; -procedure BListView_SetListType(AObject : TCPlusObject; atype : TList_view_type); cdecl; external BePascalLibName name 'BListView_SetListType'; -function BListView_ListType(AObject : TCPlusObject) : TList_view_type; cdecl; external BePascalLibName name 'BListView_ListType'; -function BListView_ItemAt(AObject : TCPlusObject; index : integer) : TListItem; 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) : TListItem; cdecl; external BePascalLibName name 'BListView_FirstItem'; -function BListView_LastItem(AObject : TCPlusObject) : TListItem; 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) : TListView; 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) : TStatus_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) : TRect; cdecl; external BePascalLibName name 'BListView_ItemFrame'; -function BListView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : THandler; cdecl; external BePascalLibName name 'BListView_ResolveSpecifier'; -function BListView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BListView_GetSupportedSuites'; -function BListView_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_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 TListView.Create(frame : TRect; name : pchar; atype : Tlist_view_type; resizeMask: longint; flags : longint); -begin - CreatePas; - CPlusObject := BListView_Create(Self,frame.CPlusObject,name,atype,resizeMask,flags); -end; - -constructor TListView.Create(data : TMessage); -begin - CreatePas; - CPlusObject := BListView_Create(Self,data.CPlusObject); -end; - -destructor TListView.Destroy; -begin - BListView_Free(CPlusObject); - inherited; -end; - -function TListView.Instantiate(data : TMessage) : TArchivable; -begin - Result := BListView_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TListView.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BListView_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TListView.Draw(updateRect : TRect); -begin - //BListView_Draw(CPlusObject, updateRect.CPlusObject); -end; - -procedure TListView.MessageReceived(msg : TMessage); -begin - //BListView_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TListView.MouseDown(where : TPoint); -begin - //BListView_MouseDown(CPlusObject, where.CPlusObject); -end; - -procedure TListView.KeyDown(bytes : PChar; numBytes : integer); -begin - //BListView_KeyDown(CPlusObject, bytes, numBytes); -end; - -procedure TListView.MakeFocus(state : boolean); -begin - //BListView_MakeFocus(CPlusObject, state); -end; - -procedure TListView.FrameResized(newWidth : double; newHeight : double); -begin - //BListView_FrameResized(CPlusObject, newWidth, newHeight); -end; - -procedure TListView.TargetedByScrollView(scroller : TScrollView); -begin - BListView_TargetedByScrollView(CPlusObject, scroller.CPlusObject); -end; - -procedure TListView.ScrollTo(x : double; y : double); -begin - BListView_ScrollTo(CPlusObject, x, y); -end; - -procedure TListView.ScrollTo(where : TPoint); -begin - BListView_ScrollTo(CPlusObject, where.CPlusObject); -end; - -function TListView.AddItem(item : TListItem) : boolean; -begin - Result := BListView_AddItem(CPlusObject, item.CPlusObject); -end; - -function TListView.AddItem(item : TListItem; atIndex : integer) : boolean; -begin - Result := BListView_AddItem(CPlusObject, item.CPlusObject, atIndex); -end; - -function TListView.AddList(newItems : TList) : boolean; -begin - Result := BListView_AddList(CPlusObject, newItems.CPlusObject); -end; - -function TListView.AddList(newItems : TList; atIndex : integer) : boolean; -begin - Result := BListView_AddList(CPlusObject, newItems.CPlusObject, atIndex); -end; - -function TListView.RemoveItem(item : TListItem) : boolean; -begin - Result := BListView_RemoveItem(CPlusObject, item.CPlusObject); -end; - -function TListView.RemoveItem(index : integer) : TListItem; -begin - Result := BListView_RemoveItem(CPlusObject, index); -end; - -function TListView.RemoveItems(index : integer; count : integer) : boolean; -begin - Result := BListView_RemoveItems(CPlusObject, index, count); -end; - -procedure TListView.SetSelectionMessage(message : TMessage); -begin - BListView_SetSelectionMessage(CPlusObject, message.CPlusObject); -end; - -procedure TListView.SetInvocationMessage(message : TMessage); -begin - BListView_SetInvocationMessage(CPlusObject, message.CPlusObject); -end; - -function TListView.SelectionMessage : TMessage; -begin - Result := BListView_SelectionMessage(CPlusObject); -end; - -function TListView.SelectionCommand : Cardinal; -begin - Result := BListView_SelectionCommand(CPlusObject); -end; - -function TListView.InvocationMessage : TMessage; -begin - Result := BListView_InvocationMessage(CPlusObject); -end; - -function TListView.InvocationCommand : Cardinal; -begin - Result := BListView_InvocationCommand(CPlusObject); -end; - -procedure TListView.SetListType(atype : TList_view_type); -begin - BListView_SetListType(CPlusObject, atype); -end; - -function TListView.ListType : TList_view_type; -begin - Result := BListView_ListType(CPlusObject); -end; - -function TListView.ItemAt(index : integer) : TListItem; -begin - Result := BListView_ItemAt(CPlusObject, index); -end; - -function TListView.IndexOf(point : TPoint) : integer; -begin - Result := BListView_IndexOf(CPlusObject, point.CPlusObject); -end; - -function TListView.IndexOf(item : TListItem) : integer; -begin - Result := BListView_IndexOf(CPlusObject, item.CPlusObject); -end; - -function TListView.FirstItem : TListItem; -begin - Result := BListView_FirstItem(CPlusObject); -end; - -function TListView.LastItem : TListItem; -begin - Result := BListView_LastItem(CPlusObject); -end; - -function TListView.HasItem(item : TListItem) : boolean; -begin - Result := BListView_HasItem(CPlusObject, item.CPlusObject); -end; - -function TListView.CountItems : integer; -begin - Result := BListView_CountItems(CPlusObject); -end; - -procedure TListView.MakeEmpty; -begin - BListView_MakeEmpty(CPlusObject); -end; - -function TListView.IsEmpty : boolean; -begin - Result := BListView_IsEmpty(CPlusObject); -end; - -function TListView.Items : TListView; -begin - Result := BListView_Items(CPlusObject); -end; - -procedure TListView.InvalidateItem(index : integer); -begin - BListView_InvalidateItem(CPlusObject, index); -end; - -procedure TListView.ScrollToSelection; -begin - BListView_ScrollToSelection(CPlusObject); -end; - -procedure TListView.Select(index : integer; extend : boolean); -begin - BListView_Select(CPlusObject, index, extend); -end; - -procedure TListView.Select(from : integer; ato : integer; extend : boolean); -begin - BListView_Select(CPlusObject, from, ato, extend); -end; - -function TListView.IsItemSelected(index : integer) : boolean; -begin - Result := BListView_IsItemSelected(CPlusObject, index); -end; - -function TListView.CurrentSelection(index : integer) : integer; -begin - Result := BListView_CurrentSelection(CPlusObject, index); -end; - -function TListView.Invoke(msg : TMessage) : TStatus_t; -begin - Result := BListView_Invoke(CPlusObject, msg.CPlusObject); -end; - -procedure TListView.DeselectAll; -begin - BListView_DeselectAll(CPlusObject); -end; - -procedure TListView.DeselectExcept(except_from : integer; except_to : integer); -begin - BListView_DeselectExcept(CPlusObject, except_from, except_to); -end; - -procedure TListView.Deselect(index : integer); -begin - BListView_Deselect(CPlusObject, index); -end; - -procedure TListView.SelectionChanged; -begin - //BListView_SelectionChanged(CPlusObject); -end; - -function TListView.SwapItems(a : integer; b : integer) : boolean; -begin - Result := BListView_SwapItems(CPlusObject, a, b); -end; - -function TListView.MoveItem(from : integer; ato : integer) : boolean; -begin - Result := BListView_MoveItem(CPlusObject, from, ato); -end; - -function TListView.ReplaceItem(index : integer; item : TListItem) : boolean; -begin - Result := BListView_ReplaceItem(CPlusObject, index, item.CPlusObject); -end; - -procedure TListView.AttachedToWindow; -begin - //BListView_AttachedToWindow(CPlusObject); -end; - -procedure TListView.FrameMoved(new_position : TPoint); -begin - //BListView_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -function TListView.ItemFrame(index : integer) : TRect; -begin - Result := BListView_ItemFrame(CPlusObject, index); -end; - -function TListView.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BListView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -function TListView.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BListView_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TListView.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BListView_Perform(CPlusObject, d, arg); -end; - -procedure TListView.WindowActivated(state : boolean); -begin - //BListView_WindowActivated(CPlusObject, state); -end; - -procedure TListView.MouseUp(pt : TPoint); -begin - //BListView_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TListView.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin - //BListView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TListView.DetachedFromWindow; -begin - //BListView_DetachedFromWindow(CPlusObject); -end; - -function TListView.InitiateDrag(pt : TPoint; itemIndex : integer; initialySelected : boolean) : boolean; -begin - Result := BListView_InitiateDrag(CPlusObject, pt.CPlusObject, itemIndex, initialySelected); -end; - -procedure TListView.ResizeToPreferred; -begin - //BListView_ResizeToPreferred(CPlusObject); -end; - -procedure TListView.GetPreferredSize(width : double; height : double); -begin - // BListView_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TListView.AllAttached; -begin - //BListView_AllAttached(CPlusObject); -end; - -procedure TListView.AllDetached; -begin - //BListView_AllDetached(CPlusObject); -end; - -procedure ListItem_SelectionChanged_hook_func(Liste : TListView); cdecl; - -begin - try - if Liste <> nil then - begin - Liste.SelectionChanged; - end; - finally - end; -end; - -initialization - ListItem_SelectionChanged_hook:=@ListItem_SelectionChanged_hook_func; -end. diff --git a/bepascal/bepascal/be/interface/menu.h b/bepascal/bepascal/be/interface/menu.h deleted file mode 100644 index dfa75f9..0000000 --- a/bepascal/bepascal/be/interface/menu.h +++ /dev/null @@ -1,43 +0,0 @@ -#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/bepascal/be/interface/menu.pp b/bepascal/bepascal/be/interface/menu.pp deleted file mode 100644 index bf5d28b..0000000 --- a/bepascal/bepascal/be/interface/menu.pp +++ /dev/null @@ -1,1945 +0,0 @@ -{ 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 - TMenu_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 = ^TMenu_Info; -type - TMenu_Layout = (B_ITEMS_IN_ROW, B_ITEMS_IN_COLUMN, B_ITEMS_IN_MATRIX); - TAdd_State = (B_INITIAL_ADD, B_PROCESSING, B_ABORT); -type - TMenu_Tracking_Hook = function() : TStatus_t; cdecl; -type - TMenuItem = class; - TMenu = class(TView) - private - public -// constructor Create; override; - constructor Create(title : PChar; width : double; height : double); - constructor Create(title : PChar; layout : TMenu_Layout); - destructor Destroy; override; -// constructor Create(data : TMessage); - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure AttachedToWindow; override; - procedure DetachedFromWindow; override; - - function AddItem(item : TMenuItem) : boolean; - function AddItem(item : TMenuItem; index : integer) : boolean; - function AddItem(item : TMenuItem; frame : TRect) : boolean; - function AddItem(menu : TMenu; index : integer) : boolean; - function AddItem(menu : TMenu; frame : TRect) : boolean; - function AddItem(menu : TMenu) : boolean; - - function AddList(list : TList; index : integer) : boolean; - function AddSeparatorItem : boolean; - function RemoveItem(item : TMenuItem) : boolean; - function RemoveItem(index : integer) : TMenuItem; - function RemoveItems(index : integer; count : integer; del : boolean) : boolean; - function RemoveItem(menu : TMenu) : boolean; - function ItemAt(index : integer) : TMenuItem; - function SubmenuAt(index : integer) : TMenu; - function CountItems : integer; - function IndexOf(item : TMenuItem) : integer; - function IndexOf(menu : TMenu) : integer; - function FindItem(command : Cardinal) : TMenuItem; - function FindItem(name : PChar) : TMenuItem; - function SetTargetForItems(target : THandler) : TStatus_t; - function SetTargetForItems(messenger : TMessenger) : TStatus_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 : TMenuItem; - function Supermenu : TMenu; - function Superitem : TMenuItem; - procedure MessageReceived(msg : TMessage); override; - procedure KeyDown(bytes : PChar; numBytes : integer); override; - procedure Draw(updateRect : TRect); override; - procedure GetPreferredSize(width : double; height : double); - procedure ResizeToPreferred; override; - procedure FrameMoved(new_position : TPoint); override; - procedure FrameResized(new_width : double; new_height : double); override; - procedure InvalidateLayout; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; aProperty : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - procedure MakeFocus(state : boolean); - procedure AllAttached; override; - procedure AllDetached; override; -{ constructor Create(frame : TRect; viewName : PChar; resizeMask : Cardinal; flags : Cardinal; layout : TMenu_Layout; resizeToFit : boolean); - function ScreenLocation : TPoint; - 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 : TRect) : TMenuItem; -} -// procedure enum add_state { B_INITIAL_ADD, B_PROCESSING, B_ABORT }; -{ function AddDynamicItem(s : TAdd_State) : boolean; - procedure DrawBackground(update : TRect); - procedure SetTrackingHook(func : TMenu_Tracking_Hook; state : Pointer); -} -{ procedure _ReservedMenu3; - procedure _ReservedMenu4; - procedure _ReservedMenu5; - procedure _ReservedMenu6; - function operator=( : TMenu) : TMenu; - procedure InitData(data : TMessage); - function _show(selectFirstItem : boolean) : boolean; - procedure _hide; - function _track(action : integer; start : integer) : TMenuItem; - function _AddItem(item : TMenuItem; index : integer) : boolean; - function RemoveItems(index : integer; count : integer; item : TMenuItem; del : boolean) : boolean; - procedure LayoutItems(index : integer); - procedure ComputeLayout(index : integer; bestFit : boolean; moveItems : boolean; width : double; height : double); - function Bump(current : TRect; extent : TPoint; index : integer) : TRect; - function ItemLocInRect(frame : TRect) : TPoint; - function CalcFrame(where : TPoint; scrollOn : boolean) : TRect; - function ScrollMenu(bounds : TRect; loc : TPoint; fast : boolean) : boolean; - procedure ScrollIntoView(item : TMenuItem); - procedure DrawItems(updateRect : TRect); - function State(item : TMenuItem) : integer; - procedure InvokeItem(item : TMenuItem; now : boolean); - function OverSuper(loc : TPoint) : boolean; - function OverSubmenu(item : TMenuItem; loc : TPoint) : boolean; - function MenuWindow : TMenuWindow; - procedure DeleteMenuWindow; - function HitTestItems(where : TPoint; slop : TPoint) : TMenuItem; - function Superbounds : TRect; - procedure CacheFontInfo; - procedure ItemMarked(item : TMenuItem); - procedure Install(target : TWindow); - procedure Uninstall; - procedure SelectItem(m : TMenuItem; showSubmenu : Cardinal; selectFirstItem : boolean); - function CurrentSelection : TMenuItem; - function SelectNextItem(item : TMenuItem; forward : boolean) : boolean; - function NextItem(item : TMenuItem; forward : boolean) : TMenuItem; - function IsItemVisible(item : TMenuItem) : boolean; - procedure SetIgnoreHidden(on : boolean); - procedure SetStickyMode(on : boolean); - function IsStickyMode : boolean; - procedure CalcTriggers; - function ChooseTrigger(title : PChar; chars : TList) : PChar; - procedure UpdateWindowViewSize(upWind : boolean); - function IsStickyPrefOn : boolean; - procedure RedrawAfterSticky(bounds : TRect); - function OkToProceed( : TMenuItem) : boolean; - function ParseMsg(msg : TMessage; sindex : ^integer; spec : TMessage; form : ^integer; prop : PChar; tmenu : TMenu; titem : TMenuItem; user_data : ^integer; reply : TMessage) : TStatus_t; - function DoMenuMsg(next : TMenuItem; tar : TMenu; m : TMessage; r : TMessage; spec : TMessage; f : integer) : TStatus_t; - function DoMenuItemMsg(next : TMenuItem; tar : TMenu; m : TMessage; r : TMessage; spec : TMessage; f : integer) : TStatus_t; - function DoEnabledMsg(ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; - function DoLabelMsg(ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; - function DoMarkMsg(ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; - function DoDeleteMsg(ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; - function DoCreateMsg(ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage; menu : boolean) : TStatus_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; - - TMenuItem = class(TBeObject) - private - public - constructor Create; override; - constructor Create(aMenu : TMenu; message : TMessage); virtual; - constructor Create(data : TMessage); virtual; - constructor Create(aLabel : PChar; message : TMessage; aShortcut : Char; modifiers : Cardinal); virtual; - destructor Destroy; override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_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 : TMenu; - function Menu : TMenu; - function Frame : TRect; -{ 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 : TPoint; - procedure _ReservedMenuItem2; - procedure _ReservedMenuItem3; - procedure _ReservedMenuItem4; - constructor Create(MenuItem : TMenuItem); - function operator=(MenuItem : TMenuItem) : TMenuItem; - procedure InitData; - procedure InitMenuData(menu : TMenu); - procedure Install(window : TWindow); - function Invoke(msg : TMessage) : TStatus_t; - procedure Uninstall; - procedure SetSuper(super : TMenu); - 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 - TSeparatorItem = class(TMenuItem) - private - public - constructor Create; override; - constructor Create(data : TMessage); override; - destructor Destroy; override; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - function Instantiate(data : TMessage) : TArchivable; - procedure SetEnabled(state : boolean); -{ procedure GetContentSize(width : double; height : double); - procedure Draw; - procedure _ReservedSeparatorItem1; - procedure _ReservedSeparatorItem2; - function operator=( : TSeparatorItem) : TSeparatorItem; - 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) : TArchivable; cdecl; external BePascalLibName name 'BMenuItem_Instantiate'; -function BMenuItem_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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) : TMenu; cdecl; external BePascalLibName name 'BMenuItem_Submenu'; -function BMenuItem_Menu(AObject : TCPlusObject) : TMenu; cdecl; external BePascalLibName name 'BMenuItem_Menu'; -function BMenuItem_Frame(AObject : TCPlusObject) : TRect; 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) : TPoint; 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; : TMenuItem) : TCPlusObject; cdecl; external BePascalLibName name 'BMenuItem_Create'; -function BMenuItem_operator=(AObject : TCPlusObject; : TMenuItem) : TMenuItem; 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) : TStatus_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) : TStatus_t; cdecl; external BePascalLibName name 'BSeparatorItem_Archive'; -function BSeparatorItem_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : TArchivable; 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; : TSeparatorItem) : TSeparatorItem; 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) : TArchivable; cdecl; external BePascalLibName name 'BMenu_Instantiate'; -function BMenu_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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) : TMenuItem; 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) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_ItemAt'; -function BMenu_SubmenuAt(AObject : TCPlusObject; index : integer) : TMenu; 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) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_FindItem'; -function BMenu_FindItem(AObject : TCPlusObject; name : PChar) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_FindItem'; -function BMenu_SetTargetForItems(AObject : TCPlusObject; target : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_SetTargetForItems'; -//function BMenu_SetTargetForItems(AObject : TCPlusObject; messenger : TCPlusObject) : TStatus_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) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_FindMarked'; -function BMenu_Supermenu(AObject : TCPlusObject) : TMenu; cdecl; external BePascalLibName name 'BMenu_Supermenu'; -function BMenu_Superitem(AObject : TCPlusObject) : TMenuItem; 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) : THandler; cdecl; external BePascalLibName name 'BMenu_ResolveSpecifier'; -function BMenu_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_GetSupportedSuites'; -function BMenu_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_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 : TMenu_Layout; resizeToFit : boolean) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create'; -function BMenu_ScreenLocation(AObject : TCPlusObject) : TPoint; 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 : TCPlusObject) : TMenuItem; 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 : TCPlusObject); 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; : 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) : TMenuItem; 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) : TRect; cdecl; external BePascalLibName name 'BMenu_Bump'; -function BMenu_ItemLocInRect(AObject : TCPlusObject; frame : TCPlusObject) : TPoint; cdecl; external BePascalLibName name 'BMenu_ItemLocInRect'; -function BMenu_CalcFrame(AObject : TCPlusObject; where : TCPlusObject; scrollOn : boolean) : TRect; 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) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_HitTestItems'; -function BMenu_Superbounds(AObject : TCPlusObject) : TRect; 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) : TMenuItem; 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) : TMenuItem; 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) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_ParseMsg'; -function BMenu_DoMenuMsg(AObject : TCPlusObject; next : TCPlusObject; tar : TCPlusObject; m : TCPlusObject; r : TCPlusObject; spec : TCPlusObject; f : integer) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoMenuMsg'; -function BMenu_DoMenuItemMsg(AObject : TCPlusObject; next : TCPlusObject; tar : TCPlusObject; m : TCPlusObject; r : TCPlusObject; spec : TCPlusObject; f : integer) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoMenuItemMsg'; -function BMenu_DoEnabledMsg(AObject : TCPlusObject; ti : TCPlusObject; tm : TCPlusObject; m : TCPlusObject; r : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoEnabledMsg'; -function BMenu_DoLabelMsg(AObject : TCPlusObject; ti : TCPlusObject; tm : TCPlusObject; m : TCPlusObject; r : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoLabelMsg'; -function BMenu_DoMarkMsg(AObject : TCPlusObject; ti : TCPlusObject; tm : TCPlusObject; m : TCPlusObject; r : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoMarkMsg'; -function BMenu_DoDeleteMsg(AObject : TCPlusObject; ti : TCPlusObject; tm : TCPlusObject; m : TCPlusObject; r : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoDeleteMsg'; -function BMenu_DoCreateMsg(AObject : TCPlusObject; ti : TCPlusObject; tm : TCPlusObject; m : TCPlusObject; r : TCPlusObject; menu : boolean) : TStatus_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) : TArchivable; cdecl; external BePascalLibName name 'BMenu_Instantiate'; -function BMenu_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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 : TList; 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 : TMenuItem) : boolean; cdecl; external BePascalLibName name 'BMenu_RemoveItem'; -function BMenu_RemoveItem(AObject : TCPlusObject; index : integer) : TMenuItem; 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 : TMenu) : boolean; cdecl; external BePascalLibName name 'BMenu_RemoveItem'; -function BMenu_ItemAt(AObject : TCPlusObject; index : integer) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_ItemAt'; -function BMenu_SubmenuAt(AObject : TCPlusObject; index : integer) : TMenu; cdecl; external BePascalLibName name 'BMenu_SubmenuAt'; -function BMenu_CountItems(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BMenu_CountItems'; -function BMenu_IndexOf(AObject : TCPlusObject; item : TMenuItem) : integer; cdecl; external BePascalLibName name 'BMenu_IndexOf'; -function BMenu_IndexOf(AObject : TCPlusObject; menu : TMenu) : integer; cdecl; external BePascalLibName name 'BMenu_IndexOf'; -function BMenu_FindItem(AObject : TCPlusObject; command : Cardinal) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_FindItem'; -function BMenu_FindItem(AObject : TCPlusObject; name : PChar) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_FindItem'; -function BMenu_SetTargetForItems(AObject : TCPlusObject; target : THandler) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_SetTargetForItems'; -function BMenu_SetTargetForItems(AObject : TCPlusObject; messenger : TMessenger) : TStatus_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) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_FindMarked'; -function BMenu_Supermenu(AObject : TCPlusObject) : TMenu; cdecl; external BePascalLibName name 'BMenu_Supermenu'; -function BMenu_Superitem(AObject : TCPlusObject) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_Superitem'; -procedure BMenu_MessageReceived(AObject : TCPlusObject; msg : TMessage); 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 : TRect); 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 : TPoint); 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 : TMessage; index : integer; specifier : TMessage; form : integer; aProperty : PChar) : THandler; cdecl; external BePascalLibName name 'BMenu_ResolveSpecifier'; -function BMenu_GetSupportedSuites(AObject : TCPlusObject; data : TMessage) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_GetSupportedSuites'; -function BMenu_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_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 : TRect; viewName : PChar; resizeMask : Cardinal; flags : Cardinal; layout : TMenu_Layout; resizeToFit : boolean) : TCPlusObject; cdecl; external BePascalLibName name 'BMenu_Create'; -function BMenu_ScreenLocation(AObject : TCPlusObject) : TPoint; 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 : TRect) : TMenuItem; 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 : TRect); 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; : TMenu) : TMenu; cdecl; external BePascalLibName name 'BMenu_operator='; -procedure BMenu_InitData(AObject : TCPlusObject; data : TMessage); 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) : TMenuItem; cdecl; external BePascalLibName name 'BMenu__track'; -function BMenu__AddItem(AObject : TCPlusObject; item : TMenuItem; index : integer) : boolean; cdecl; external BePascalLibName name 'BMenu__AddItem'; -function BMenu_RemoveItems(AObject : TCPlusObject; index : integer; count : integer; item : TMenuItem; 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 : TRect; extent : TPoint; index : integer) : TRect; cdecl; external BePascalLibName name 'BMenu_Bump'; -function BMenu_ItemLocInRect(AObject : TCPlusObject; frame : TRect) : TPoint; cdecl; external BePascalLibName name 'BMenu_ItemLocInRect'; -function BMenu_CalcFrame(AObject : TCPlusObject; where : TPoint; scrollOn : boolean) : TRect; cdecl; external BePascalLibName name 'BMenu_CalcFrame'; -function BMenu_ScrollMenu(AObject : TCPlusObject; bounds : TRect; loc : TPoint; fast : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu_ScrollMenu'; -procedure BMenu_ScrollIntoView(AObject : TCPlusObject; item : TMenuItem); cdecl; external BePascalLibName name 'BMenu_ScrollIntoView'; -procedure BMenu_DrawItems(AObject : TCPlusObject; updateRect : TRect); cdecl; external BePascalLibName name 'BMenu_DrawItems'; -function BMenu_State(AObject : TCPlusObject; item : TMenuItem) : integer; cdecl; external BePascalLibName name 'BMenu_State'; -procedure BMenu_InvokeItem(AObject : TCPlusObject; item : TMenuItem; now : boolean); cdecl; external BePascalLibName name 'BMenu_InvokeItem'; -function BMenu_OverSuper(AObject : TCPlusObject; loc : TPoint) : boolean; cdecl; external BePascalLibName name 'BMenu_OverSuper'; -function BMenu_OverSubmenu(AObject : TCPlusObject; item : TMenuItem; loc : TPoint) : 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 : TPoint; slop : TPoint) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_HitTestItems'; -function BMenu_Superbounds(AObject : TCPlusObject) : TRect; cdecl; external BePascalLibName name 'BMenu_Superbounds'; -procedure BMenu_CacheFontInfo(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenu_CacheFontInfo'; -procedure BMenu_ItemMarked(AObject : TCPlusObject; item : TMenuItem); 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 : TMenuItem; showSubmenu : Cardinal; selectFirstItem : boolean); cdecl; external BePascalLibName name 'BMenu_SelectItem'; -function BMenu_CurrentSelection(AObject : TCPlusObject) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_CurrentSelection'; -function BMenu_SelectNextItem(AObject : TCPlusObject; item : TMenuItem; forward : boolean) : boolean; cdecl; external BePascalLibName name 'BMenu_SelectNextItem'; -function BMenu_NextItem(AObject : TCPlusObject; item : TMenuItem; forward : boolean) : TMenuItem; cdecl; external BePascalLibName name 'BMenu_NextItem'; -function BMenu_IsItemVisible(AObject : TCPlusObject; item : TMenuItem) : 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 : TList) : 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 : TRect); cdecl; external BePascalLibName name 'BMenu_RedrawAfterSticky'; -function BMenu_OkToProceed(AObject : TCPlusObject; : TMenuItem) : boolean; cdecl; external BePascalLibName name 'BMenu_OkToProceed'; -function BMenu_ParseMsg(AObject : TCPlusObject; msg : TMessage; sindex : ^integer; spec : TMessage; form : ^integer; prop : PChar; tmenu : TMenu; titem : TMenuItem; user_data : ^integer; reply : TMessage) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_ParseMsg'; -function BMenu_DoMenuMsg(AObject : TCPlusObject; next : TMenuItem; tar : TMenu; m : TMessage; r : TMessage; spec : TMessage; f : integer) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoMenuMsg'; -function BMenu_DoMenuItemMsg(AObject : TCPlusObject; next : TMenuItem; tar : TMenu; m : TMessage; r : TMessage; spec : TMessage; f : integer) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoMenuItemMsg'; -function BMenu_DoEnabledMsg(AObject : TCPlusObject; ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoEnabledMsg'; -function BMenu_DoLabelMsg(AObject : TCPlusObject; ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoLabelMsg'; -function BMenu_DoMarkMsg(AObject : TCPlusObject; ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoMarkMsg'; -function BMenu_DoDeleteMsg(AObject : TCPlusObject; ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; cdecl; external BePascalLibName name 'BMenu_DoDeleteMsg'; -function BMenu_DoCreateMsg(AObject : TCPlusObject; ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage; menu : boolean) : TStatus_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 TMenu.Create; -begin - CPlusObject := BMenu_Create_0(Self); -end; -} - -constructor TMenu.Create(title : PChar; width : double; height : double); -begin - CPlusObject := BMenu_Create(Self, title, width, height); -end; - -constructor TMenu.Create(title : PChar; layout : TMenu_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 TMenu.Destroy; -begin - BMenu_Free(CPlusObject); -end; - -{constructor TMenu.Create(data : TMessage); -begin - CPlusObject := BMenu_Create(Self, data.CPlusObject); -end; -} - -function TMenu.Instantiate(data : TMessage) : TArchivable; -begin - Result := BMenu_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TMenu.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BMenu_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TMenu.AttachedToWindow; -begin -// BMenu_AttachedToWindow(CPlusObject); -end; - -procedure TMenu.DetachedFromWindow; -begin -// BMenu_DetachedFromWindow(CPlusObject); -end; - - -function TMenu.AddItem(item : TMenuItem) : boolean; -begin - SendText('function TMenu.AddItem(item : TMenuItem) : boolean;'); - Result := BMenu_AddItem_1(CPlusObject, item.CPlusObject); -end; - -function TMenu.AddItem(item : TMenuItem; index : integer) : boolean; -begin - SendText('function TMenu.AddItem(item : TMenuItem; index : integer) : boolean;'); - Result := BMenu_AddItem_2(CPlusObject, item.CPlusObject, index); -end; - -function TMenu.AddItem(item : TMenuItem; frame : TRect) : boolean; -begin - SendText('ici'); - SendText('function TMenu.AddItem(item : TMenuItem; frame : TRect) : boolean;'); - frame.PrintToStream; - SendText('toto'); - Result := BMenu_AddItem_3(CPlusObject, item.CPlusObject, frame.CPlusObject); -end; - -function TMenu.AddItem(menu : TMenu) : boolean; -begin - SendText('function TMenu.AddItem(menu : TMenu) : boolean;'); - SendText('Bonjour'); - Result := BMenu_AddItem_4(CPlusObject, menu.CPlusObject); -end; - -function TMenu.AddItem(menu : TMenu; index : integer) : boolean; -begin - SendText('function TMenu.AddItem(menu : TMenu; index : integer) : boolean;'); - Result := BMenu_AddItem_5(CPlusObject, menu.CPlusObject, index); -end; - -function TMenu.AddItem(menu : TMenu; frame : TRect) : boolean; -begin - SendText('function TMenu.AddItem(menu : TMenu; frame : TRect) : boolean;'); - Result := BMenu_AddItem_6(CPlusObject, menu.CPlusObject, frame.CPlusObject); -end; - - -{function TMenu.AddItem(item : TMenuItem) : boolean; -begin - SendText('function TMenu.AddItem(item : TMenuItem) : boolean;'); - Result := BMenu_AddItem_1(CPlusObject, item.CPlusObject); -end; - -function TMenu.AddItem(item : TMenuItem; index : integer) : boolean; -begin - SendText('function TMenu.AddItem(item : TMenuItem; index : integer) : boolean;'); - Result := BMenu_AddItem_2(CPlusObject, item.CPlusObject, index); -end; - -function TMenu.AddItem(item : TMenuItem; frame : TRect) : boolean; -begin - SendText('ici'); - SendText('function TMenu.AddItem(item : TMenuItem; frame : TRect) : boolean;'); - frame.PrintToStream; - SendText('toto'); - Result := BMenu_AddItem_3(CPlusObject, item.CPlusObject, frame.CPlusObject); -end; - -function TMenu.AddItem(menu : TMenu) : boolean; -begin - SendText('function TMenu.AddItem(menu : TMenu) : boolean;'); - SendText('Bonjour'); - Result := BMenu_AddItem_4(CPlusObject, menu.CPlusObject); -end; - -function TMenu.AddItem(menu : TMenu; index : integer) : boolean; -begin - SendText('function TMenu.AddItem(menu : TMenu; index : integer) : boolean;'); - Result := BMenu_AddItem_5(CPlusObject, menu.CPlusObject, index); -end; - -function TMenu.AddItem(menu : TMenu; frame : TRect) : boolean; -begin - SendText('function TMenu.AddItem(menu : TMenu; frame : TRect) : boolean;'); - Result := BMenu_AddItem_6(CPlusObject, menu.CPlusObject, frame.CPlusObject); -end; -} - -function TMenu.AddList(list : TList; index : integer) : boolean; -begin - Result := BMenu_AddList(CPlusObject, list.CPlusObject, index); -end; - -function TMenu.AddSeparatorItem : boolean; -begin - Result := BMenu_AddSeparatorItem(CPlusObject); -end; - -function TMenu.RemoveItem(item : TMenuItem) : boolean; -begin - Result := BMenu_RemoveItem(CPlusObject, item.CPlusObject); -end; - -function TMenu.RemoveItem(index : integer) : TMenuItem; -begin - Result := BMenu_RemoveItem(CPlusObject, index); -end; - -function TMenu.RemoveItems(index : integer; count : integer; del : boolean) : boolean; -begin - Result := BMenu_RemoveItems(CPlusObject, index, count, del); -end; - -function TMenu.RemoveItem(menu : TMenu) : boolean; -begin - Result := BMenu_RemoveItem(CPlusObject, menu.CPlusObject); -end; - -function TMenu.ItemAt(index : integer) : TMenuItem; -begin - Result := BMenu_ItemAt(CPlusObject, index); -end; - -function TMenu.SubmenuAt(index : integer) : TMenu; -begin - Result := BMenu_SubmenuAt(CPlusObject, index); -end; - -function TMenu.CountItems : integer; -begin - Result := BMenu_CountItems(CPlusObject); -end; - -function TMenu.IndexOf(item : TMenuItem) : integer; -begin - Result := BMenu_IndexOf(CPlusObject, item.CPlusObject); -end; - -function TMenu.IndexOf(menu : TMenu) : integer; -begin - Result := BMenu_IndexOf(CPlusObject, menu.CPlusObject); -end; - -function TMenu.FindItem(command : Cardinal) : TMenuItem; -begin - Result := BMenu_FindItem(CPlusObject, command); -end; - -function TMenu.FindItem(name : PChar) : TMenuItem; -begin - Result := BMenu_FindItem(CPlusObject, name); -end; - -function TMenu.SetTargetForItems(target : THandler) : TStatus_t; -begin - Result := BMenu_SetTargetForItems(CPlusObject, target.CPlusObject); -end; - -function TMenu.SetTargetForItems(messenger : TMessenger) : TStatus_t; -begin - Result := BMenu_SetTargetForItems(CPlusObject, messenger.CPlusObject); -end; - -procedure TMenu.SetEnabled(state : boolean); -begin -// BMenu_SetEnabled(CPlusObject, state); -end; - -procedure TMenu.SetRadioMode(state : boolean); -begin - BMenu_SetRadioMode(CPlusObject, state); -end; - -procedure TMenu.SetTriggersEnabled(state : boolean); -begin - BMenu_SetTriggersEnabled(CPlusObject, state); -end; - -procedure TMenu.SetMaxContentWidth(max : double); -begin - BMenu_SetMaxContentWidth(CPlusObject, max); -end; - -procedure TMenu.SetLabelFromMarked(aOn : boolean); -begin - BMenu_SetLabelFromMarked(CPlusObject, aOn); -end; - -function TMenu.IsLabelFromMarked : boolean; -begin - Result := BMenu_IsLabelFromMarked(CPlusObject); -end; - -function TMenu.IsEnabled : boolean; -begin - Result := BMenu_IsEnabled(CPlusObject); -end; - -function TMenu.IsRadioMode : boolean; -begin - Result := BMenu_IsRadioMode(CPlusObject); -end; - -function TMenu.AreTriggersEnabled : boolean; -begin - Result := BMenu_AreTriggersEnabled(CPlusObject); -end; - -function TMenu.IsRedrawAfterSticky : boolean; -begin - Result := BMenu_IsRedrawAfterSticky(CPlusObject); -end; - -function TMenu.MaxContentWidth : double; -begin - Result := BMenu_MaxContentWidth(CPlusObject); -end; - -function TMenu.FindMarked : TMenuItem; -begin - Result := BMenu_FindMarked(CPlusObject); -end; - -function TMenu.Supermenu : TMenu; -begin - Result := BMenu_Supermenu(CPlusObject); -end; - -function TMenu.Superitem : TMenuItem; -begin - Result := BMenu_Superitem(CPlusObject); -end; - -procedure TMenu.MessageReceived(msg : TMessage); -begin -// BMenu_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TMenu.KeyDown(bytes : PChar; numBytes : integer); -begin -// BMenu_KeyDown(CPlusObject, bytes, numBytes); -end; - -procedure TMenu.Draw(updateRect : TRect); -begin -// BMenu_Draw(CPlusObject, updateRect.CPlusObject); -end; - -procedure TMenu.GetPreferredSize(width : double; height : double); -begin -// BMenu_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TMenu.ResizeToPreferred; -begin -// BMenu_ResizeToPreferred(CPlusObject); -end; - -procedure TMenu.FrameMoved(new_position : TPoint); -begin -// BMenu_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TMenu.FrameResized(new_width : double; new_height : double); -begin -// BMenu_FrameResized(CPlusObject, new_width, new_height); -end; - -procedure TMenu.InvalidateLayout; -begin - BMenu_InvalidateLayout(CPlusObject); -end; - -function TMenu.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; aProperty : PChar) : THandler; -begin - Result := BMenu_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, aProperty); -end; - -function TMenu.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BMenu_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TMenu.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BMenu_Perform(CPlusObject, d, arg); -end; - -procedure TMenu.MakeFocus(state : boolean); -begin -// BMenu_MakeFocus(CPlusObject, state); -end; - -procedure TMenu.AllAttached; -begin -// BMenu_AllAttached(CPlusObject); -end; - -procedure TMenu.AllDetached; -begin -// BMenu_AllDetached(CPlusObject); -end; - -{ -constructor TMenu.Create(frame : TRect; 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 TMenu.ScreenLocation : TPoint; -begin - Result := BMenu_ScreenLocation(CPlusObject); -end; - -procedure TMenu.SetItemMargins(left : double; top : double; right : double; bottom : double); -begin - BMenu_SetItemMargins(CPlusObject, left, top, right, bottom); -end; - -procedure TMenu.GetItemMargins(left : double; top : double; right : double; bottom : double); -begin - BMenu_GetItemMargins(CPlusObject, left, top, right, bottom); -end; - -function TMenu.Layout : TMenu_Layout; -begin - Result := BMenu_Layout(CPlusObject); -end; - -procedure TMenu.Show; -begin - BMenu_Show(CPlusObject); -end; - -procedure TMenu.Show(selectFirstItem : boolean); -begin - BMenu_Show(CPlusObject, selectFirstItem); -end; - -procedure TMenu.Hide; -begin - BMenu_Hide(CPlusObject); -end; - -function TMenu.Track(start_opened : boolean; special_rect : TRect) : TMenuItem; -begin - Result := BMenu_Track(CPlusObject, start_opened, special_rect.CPlusObject); -end; -} - -//procedure TMenu.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 TMenu.AddDynamicItem(s : TAdd_State) : boolean; -begin - Result := BMenu_AddDynamicItem(CPlusObject, s); -end; - -procedure TMenu.DrawBackground(update : TRect); -begin - BMenu_DrawBackground(CPlusObject, update.CPlusObject); -end; - -procedure TMenu.SetTrackingHook(func : TMenu_Tracking_Hook; state : Pointer); -begin - BMenu_SetTrackingHook(CPlusObject, func, state); -end; - -procedure TMenu._ReservedMenu3; -begin - BMenu__ReservedMenu3(CPlusObject); -end; - -procedure TMenu._ReservedMenu4; -begin - BMenu__ReservedMenu4(CPlusObject); -end; - -procedure TMenu._ReservedMenu5; -begin - BMenu__ReservedMenu5(CPlusObject); -end; - -procedure TMenu._ReservedMenu6; -begin - BMenu__ReservedMenu6(CPlusObject); -end; - -function TMenu.operator=( : TMenu) : TMenu; -begin - Result := BMenu_operator=(CPlusObject, ); -end; - -procedure TMenu.InitData(data : TMessage); -begin - BMenu_InitData(CPlusObject, data.CPlusObject); -end; - -function TMenu._show(selectFirstItem : boolean) : boolean; -begin - Result := BMenu__show(CPlusObject, selectFirstItem); -end; - -procedure TMenu._hide; -begin - BMenu__hide(CPlusObject); -end; - -function TMenu._track(action : integer; start : integer) : TMenuItem; -begin - Result := BMenu__track(CPlusObject, action, start); -end; - -function TMenu._AddItem(item : TMenuItem; index : integer) : boolean; -begin - Result := BMenu__AddItem(CPlusObject, item.CPlusObject, index); -end; - -function TMenu.RemoveItems(index : integer; count : integer; item : TMenuItem; del : boolean) : boolean; -begin - Result := BMenu_RemoveItems(CPlusObject, index, count, item.CPlusObject, del); -end; - -procedure TMenu.LayoutItems(index : integer); -begin - BMenu_LayoutItems(CPlusObject, index); -end; - -procedure TMenu.ComputeLayout(index : integer; bestFit : boolean; moveItems : boolean; width : double; height : double); -begin - BMenu_ComputeLayout(CPlusObject, index, bestFit, moveItems, width, height); -end; - -function TMenu.Bump(current : TRect; extent : TPoint; index : integer) : TRect; -begin - Result := BMenu_Bump(CPlusObject, current.CPlusObject, extent.CPlusObject, index); -end; - -function TMenu.ItemLocInRect(frame : TRect) : TPoint; -begin - Result := BMenu_ItemLocInRect(CPlusObject, frame.CPlusObject); -end; - -function TMenu.CalcFrame(where : TPoint; scrollOn : boolean) : TRect; -begin - Result := BMenu_CalcFrame(CPlusObject, where.CPlusObject, scrollOn); -end; - -function TMenu.ScrollMenu(bounds : TRect; loc : TPoint; fast : boolean) : boolean; -begin - Result := BMenu_ScrollMenu(CPlusObject, bounds.CPlusObject, loc.CPlusObject, fast); -end; - -procedure TMenu.ScrollIntoView(item : TMenuItem); -begin - BMenu_ScrollIntoView(CPlusObject, item.CPlusObject); -end; - -procedure TMenu.DrawItems(updateRect : TRect); -begin - BMenu_DrawItems(CPlusObject, updateRect.CPlusObject); -end; - -function TMenu.State(item : TMenuItem) : integer; -begin - Result := BMenu_State(CPlusObject, item.CPlusObject); -end; - -procedure TMenu.InvokeItem(item : TMenuItem; now : boolean); -begin - BMenu_InvokeItem(CPlusObject, item.CPlusObject, now); -end; - -function TMenu.OverSuper(loc : TPoint) : boolean; -begin - Result := BMenu_OverSuper(CPlusObject, loc.CPlusObject); -end; - -function TMenu.OverSubmenu(item : TMenuItem; loc : TPoint) : boolean; -begin - Result := BMenu_OverSubmenu(CPlusObject, item.CPlusObject, loc.CPlusObject); -end; - -function TMenu.MenuWindow : TMenuWindow; -begin - Result := BMenu_MenuWindow(CPlusObject); -end; - -procedure TMenu.DeleteMenuWindow; -begin - BMenu_DeleteMenuWindow(CPlusObject); -end; - -function TMenu.HitTestItems(where : TPoint; slop : TPoint) : TMenuItem; -begin - Result := BMenu_HitTestItems(CPlusObject, where.CPlusObject, slop.CPlusObject); -end; - -function TMenu.Superbounds : TRect; -begin - Result := BMenu_Superbounds(CPlusObject); -end; - -procedure TMenu.CacheFontInfo; -begin - BMenu_CacheFontInfo(CPlusObject); -end; - -procedure TMenu.ItemMarked(item : TMenuItem); -begin - BMenu_ItemMarked(CPlusObject, item.CPlusObject); -end; - -procedure TMenu.Install(target : TWindow); -begin - BMenu_Install(CPlusObject, target.CPlusObject); -end; - -procedure TMenu.Uninstall; -begin - BMenu_Uninstall(CPlusObject); -end; - -procedure TMenu.SelectItem(m : TMenuItem; showSubmenu : Cardinal; selectFirstItem : boolean); -begin - BMenu_SelectItem(CPlusObject, m.CPlusObject, showSubmenu, selectFirstItem); -end; - -function TMenu.CurrentSelection : TMenuItem; -begin - Result := BMenu_CurrentSelection(CPlusObject); -end; - -function TMenu.SelectNextItem(item : TMenuItem; forward : boolean) : boolean; -begin - Result := BMenu_SelectNextItem(CPlusObject, item.CPlusObject, forward); -end; - -function TMenu.NextItem(item : TMenuItem; forward : boolean) : TMenuItem; -begin - Result := BMenu_NextItem(CPlusObject, item.CPlusObject, forward); -end; - -function TMenu.IsItemVisible(item : TMenuItem) : boolean; -begin - Result := BMenu_IsItemVisible(CPlusObject, item.CPlusObject); -end; - -procedure TMenu.SetIgnoreHidden(aOn : boolean); -begin - BMenu_SetIgnoreHidden(CPlusObject, aOn); -end; - -procedure TMenu.SetStickyMode(aOn : boolean); -begin - BMenu_SetStickyMode(CPlusObject, aOn); -end; - -function TMenu.IsStickyMode : boolean; -begin - Result := BMenu_IsStickyMode(CPlusObject); -end; - -procedure TMenu.CalcTriggers; -begin - BMenu_CalcTriggers(CPlusObject); -end; - -function TMenu.ChooseTrigger(title : PChar; chars : TList) : PChar; -begin - Result := BMenu_ChooseTrigger(CPlusObject, title, chars.CPlusObject); -end; - -procedure TMenu.UpdateWindowViewSize(upWind : boolean); -begin - BMenu_UpdateWindowViewSize(CPlusObject, upWind); -end; - -function TMenu.IsStickyPrefOn : boolean; -begin - Result := BMenu_IsStickyPrefOn(CPlusObject); -end; - -procedure TMenu.RedrawAfterSticky(bounds : TRect); -begin - BMenu_RedrawAfterSticky(CPlusObject, bounds.CPlusObject); -end; - -function TMenu.OkToProceed( : TMenuItem) : boolean; -begin - Result := BMenu_OkToProceed(CPlusObject, .CPlusObject); -end; - -function TMenu.ParseMsg(msg : TMessage; sindex : ^integer; spec : TMessage; form : ^integer; prop : PChar; tmenu : TMenu; titem : TMenuItem; user_data : ^integer; reply : TMessage) : TStatus_t; -begin - Result := BMenu_ParseMsg(CPlusObject, msg.CPlusObject, sindex, spec.CPlusObject, form, prop, tmenu.CPlusObject, titem.CPlusObject, user_data, reply.CPlusObject); -end; - -function TMenu.DoMenuMsg(next : TMenuItem; tar : TMenu; m : TMessage; r : TMessage; spec : TMessage; f : integer) : TStatus_t; -begin - Result := BMenu_DoMenuMsg(CPlusObject, next.CPlusObject, tar.CPlusObject, m.CPlusObject, r.CPlusObject, spec.CPlusObject, f); -end; - -function TMenu.DoMenuItemMsg(next : TMenuItem; tar : TMenu; m : TMessage; r : TMessage; spec : TMessage; f : integer) : TStatus_t; -begin - Result := BMenu_DoMenuItemMsg(CPlusObject, next.CPlusObject, tar.CPlusObject, m.CPlusObject, r.CPlusObject, spec.CPlusObject, f); -end; - -function TMenu.DoEnabledMsg(ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; -begin - Result := BMenu_DoEnabledMsg(CPlusObject, ti.CPlusObject, tm.CPlusObject, m.CPlusObject, r.CPlusObject); -end; - -function TMenu.DoLabelMsg(ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; -begin - Result := BMenu_DoLabelMsg(CPlusObject, ti.CPlusObject, tm.CPlusObject, m.CPlusObject, r.CPlusObject); -end; - -function TMenu.DoMarkMsg(ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; -begin - Result := BMenu_DoMarkMsg(CPlusObject, ti.CPlusObject, tm.CPlusObject, m.CPlusObject, r.CPlusObject); -end; - -function TMenu.DoDeleteMsg(ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage) : TStatus_t; -begin - Result := BMenu_DoDeleteMsg(CPlusObject, ti.CPlusObject, tm.CPlusObject, m.CPlusObject, r.CPlusObject); -end; - -function TMenu.DoCreateMsg(ti : TMenuItem; tm : TMenu; m : TMessage; r : TMessage; menu : boolean) : TStatus_t; -begin - Result := BMenu_DoCreateMsg(CPlusObject, ti.CPlusObject, tm.CPlusObject, m.CPlusObject, r.CPlusObject, menu); -end; - -procedure TMenu.menu_info sMenuInfo; -begin - BMenu_menu_info sMenuInfo(CPlusObject); -end; - -procedure TMenu.bool sSwapped; -begin - BMenu_bool sSwapped(CPlusObject); -end; - -procedure TMenu.BMenuItem *fChosenItem; -begin - BMenu_BMenuItem *fChosenItem(CPlusObject); -end; - -procedure TMenu.BList fItems; -begin - BMenu_BList fItems(CPlusObject); -end; - -procedure TMenu.BRect fPad; -begin - BMenu_BRect fPad(CPlusObject); -end; - -procedure TMenu.BMenuItem *fSelected; -begin - BMenu_BMenuItem *fSelected(CPlusObject); -end; - -procedure TMenu.BMenuWindow *fCachedMenuWindow; -begin - BMenu_BMenuWindow *fCachedMenuWindow(CPlusObject); -end; - -procedure TMenu.BMenu *fSuper; -begin - BMenu_BMenu *fSuper(CPlusObject); -end; - -procedure TMenu.BMenuItem *fSuperitem; -begin - BMenu_BMenuItem *fSuperitem(CPlusObject); -end; - -procedure TMenu.BRect fSuperbounds; -begin - BMenu_BRect fSuperbounds(CPlusObject); -end; - -procedure TMenu.float fAscent; -begin - BMenu_float fAscent(CPlusObject); -end; - -procedure TMenu.float fDescent; -begin - BMenu_float fDescent(CPlusObject); -end; - -procedure TMenu.float fFontHeight; -begin - BMenu_float fFontHeight(CPlusObject); -end; - -procedure TMenu.uint32 fState; -begin - BMenu_uint32 fState(CPlusObject); -end; - -procedure TMenu.menu_layout fLayout; -begin - BMenu_menu_layout fLayout(CPlusObject); -end; - -procedure TMenu.BRect *fExtraRect; -begin - BMenu_BRect *fExtraRect(CPlusObject); -end; - -procedure TMenu.float fMaxContentWidth; -begin - BMenu_float fMaxContentWidth(CPlusObject); -end; - -procedure TMenu.BPoint *fInitMatrixSize; -begin - BMenu_BPoint *fInitMatrixSize(CPlusObject); -end; - -procedure TMenu._ExtraMenuData_ *fExtraMenuData; -begin - BMenu__ExtraMenuData_ *fExtraMenuData(CPlusObject); -end; - -procedure TMenu.uint32 _reserved[2]; -begin - BMenu_uint32 _reserved[2](CPlusObject); -end; - -procedure TMenu.char fTrigger; -begin - BMenu_char fTrigger(CPlusObject); -end; - -procedure TMenu.bool fResizeToFit; -begin - BMenu_bool fResizeToFit(CPlusObject); -end; - -procedure TMenu.bool fUseCachedMenuLayout; -begin - BMenu_bool fUseCachedMenuLayout(CPlusObject); -end; - -procedure TMenu.bool fEnabled; -begin - BMenu_bool fEnabled(CPlusObject); -end; - -procedure TMenu.bool fDynamicName; -begin - BMenu_bool fDynamicName(CPlusObject); -end; - -procedure TMenu.bool fRadioMode; -begin - BMenu_bool fRadioMode(CPlusObject); -end; - -procedure TMenu.bool fTrackNewBounds; -begin - BMenu_bool fTrackNewBounds(CPlusObject); -end; - -procedure TMenu.bool fStickyMode; -begin - BMenu_bool fStickyMode(CPlusObject); -end; - -procedure TMenu.bool fIgnoreHidden; -begin - BMenu_bool fIgnoreHidden(CPlusObject); -end; - -procedure TMenu.bool fTriggerEnabled; -begin - BMenu_bool fTriggerEnabled(CPlusObject); -end; - -procedure TMenu.bool fRedrawAfterSticky; -begin - BMenu_bool fRedrawAfterSticky(CPlusObject); -end; - -procedure TMenu.bool fAttachAborted; -begin - BMenu_bool fAttachAborted(CPlusObject); -end; -} - -constructor TMenuItem.Create; -begin -// CPlusObject := BMenuItem_Create(Self); -end; - -constructor TMenuItem.Create(aMenu : TMenu; message : TMessage); -begin - CPlusObject := BMenuItem_Create(Self, menu.CPlusObject, message.CPlusObject); -end; - -constructor TMenuItem.Create(data : TMessage); -begin - CPlusObject := BMenuItem_Create(Self, data.CPlusObject); -end; - -constructor TMenuItem.Create(aLabel : PChar; message : TMessage; aShortcut : Char; modifiers : Cardinal); -begin - CPlusObject := BMenuItem_Create(Self, aLabel, message.CPlusObject, aShortcut, modifiers); -end; - -destructor TMenuItem.Destroy; -begin - BMenuItem_Free(CPlusObject); - inherited; -end; - -function TMenuItem.Instantiate(data : TMessage) : TArchivable; -begin - Result := BMenuItem_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TMenuItem.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BMenuItem_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TMenuItem.SetLabel(name : PChar); -begin - BMenuItem_SetLabel(CPlusObject, name); -end; - -procedure TMenuItem.SetEnabled(state : boolean); -begin -// BMenuItem_SetEnabled(CPlusObject, state); -end; - -procedure TMenuItem.SetMarked(state : boolean); -begin - BMenuItem_SetMarked(CPlusObject, state); -end; - -procedure TMenuItem.SetTrigger(ch : Char); -begin - BMenuItem_SetTrigger(CPlusObject, ch); -end; - -procedure TMenuItem.SetShortcut(ch : Char; modifiers : Cardinal); -begin - BMenuItem_SetShortcut(CPlusObject, ch, modifiers); -end; - -{function TMenuItem.aLabel : PChar; -begin - Result := BMenuItem_Label(CPlusObject); -end; -} - -function TMenuItem.IsEnabled : boolean; -begin - Result := BMenuItem_IsEnabled(CPlusObject); -end; - -function TMenuItem.IsMarked : boolean; -begin - Result := BMenuItem_IsMarked(CPlusObject); -end; - -function TMenuItem.Trigger : Char; -begin - Result := BMenuItem_Trigger(CPlusObject); -end; - -{function TMenuItem.Shortcut(modifiers : Cardinal) : Char; -begin - Result := BMenuItem_Shortcut(CPlusObject, modifiers); -end;} - -function TMenuItem.Submenu : TMenu; -begin - Result := BMenuItem_Submenu(CPlusObject); -end; - -function TMenuItem.Menu : TMenu; -begin - Result := BMenuItem_Menu(CPlusObject); -end; - -function TMenuItem.Frame : TRect; -begin - Result := BMenuItem_Frame(CPlusObject); -end; - -{ -procedure TMenuItem.GetContentSize(width : double; height : double); -begin - BMenuItem_GetContentSize(CPlusObject, width, height); -end; - -procedure TMenuItem.TruncateLabel(max : double; new_label : PChar); -begin - BMenuItem_TruncateLabel(CPlusObject, max, new_label); -end; - -procedure TMenuItem.DrawContent; -begin -// BMenuItem_DrawContent(CPlusObject); -end; - -procedure TMenuItem.Draw; -begin -// BMenuItem_Draw(CPlusObject); -end; - -procedure TMenuItem.Highlight(aOn : boolean); -begin - BMenuItem_Highlight(CPlusObject, aOn); -end; - -function TMenuItem.IsSelected : boolean; -begin - Result := BMenuItem_IsSelected(CPlusObject); -end; - -function TMenuItem.ContentLocation : TPoint; -begin - Result := BMenuItem_ContentLocation(CPlusObject); -end; - -procedure TMenuItem._ReservedMenuItem2; -begin - BMenuItem__ReservedMenuItem2(CPlusObject); -end; - -procedure TMenuItem._ReservedMenuItem3; -begin - BMenuItem__ReservedMenuItem3(CPlusObject); -end; - -procedure TMenuItem._ReservedMenuItem4; -begin - BMenuItem__ReservedMenuItem4(CPlusObject); -end; - -constructor TMenuItem.Create( : TMenuItem) : TCPlusObject; -begin - CPlusObject := BMenuItem_Create(Self, ); -end; - -function TMenuItem.operator=( : TMenuItem) : TMenuItem; -begin - Result := BMenuItem_operator=(CPlusObject, ); -end; - -procedure TMenuItem.InitData; -begin - BMenuItem_InitData(CPlusObject); -end; - -procedure TMenuItem.InitMenuData(menu : TMenu); -begin - BMenuItem_InitMenuData(CPlusObject, menu.CPlusObject); -end; - -procedure TMenuItem.Install(window : TWindow); -begin - BMenuItem_Install(CPlusObject, window.CPlusObject); -end; - -function TMenuItem.Invoke(msg : TMessage) : TStatus_t; -begin - Result := BMenuItem_Invoke(CPlusObject, msg.CPlusObject); -end; - -procedure TMenuItem.Uninstall; -begin - BMenuItem_Uninstall(CPlusObject); -end; - -procedure TMenuItem.SetSuper(super : TMenu); -begin - BMenuItem_SetSuper(CPlusObject, super.CPlusObject); -end; - -procedure TMenuItem.Select(on : boolean); -begin - BMenuItem_Select(CPlusObject, on); -end; - -procedure TMenuItem.DrawMarkSymbol; -begin - BMenuItem_DrawMarkSymbol(CPlusObject); -end; - -procedure TMenuItem.DrawShortcutSymbol; -begin - BMenuItem_DrawShortcutSymbol(CPlusObject); -end; - -procedure TMenuItem.DrawSubmenuSymbol; -begin - BMenuItem_DrawSubmenuSymbol(CPlusObject); -end; - -procedure TMenuItem.DrawControlChar(control : PChar); -begin - BMenuItem_DrawControlChar(CPlusObject, control); -end; - -procedure TMenuItem.SetSysTrigger(ch : Char); -begin - BMenuItem_SetSysTrigger(CPlusObject, ch); -end; - -procedure TMenuItem.char *fLabel; -begin - BMenuItem_char *fLabel(CPlusObject); -end; - -procedure TMenuItem.BMenu *fSubmenu; -begin - BMenuItem_BMenu *fSubmenu(CPlusObject); -end; - -procedure TMenuItem.BWindow *fWindow; -begin - BMenuItem_BWindow *fWindow(CPlusObject); -end; - -procedure TMenuItem.BMenu *fSuper; -begin - BMenuItem_BMenu *fSuper(CPlusObject); -end; - -procedure TMenuItem.BRect fBounds; -begin - BMenuItem_BRect fBounds(CPlusObject); -end; - -procedure TMenuItem.uint32 fModifiers; -begin - BMenuItem_uint32 fModifiers(CPlusObject); -end; - -procedure TMenuItem.float fCachedWidth; -begin - BMenuItem_float fCachedWidth(CPlusObject); -end; - -procedure TMenuItem.int16 fTriggerIndex; -begin - BMenuItem_int16 fTriggerIndex(CPlusObject); -end; - -procedure TMenuItem.char fUserTrigger; -begin - BMenuItem_char fUserTrigger(CPlusObject); -end; - -procedure TMenuItem.char fSysTrigger; -begin - BMenuItem_char fSysTrigger(CPlusObject); -end; - -procedure TMenuItem.char fShortcutChar; -begin - BMenuItem_char fShortcutChar(CPlusObject); -end; - -procedure TMenuItem.bool fMark; -begin - BMenuItem_bool fMark(CPlusObject); -end; - -procedure TMenuItem.bool fEnabled; -begin - BMenuItem_bool fEnabled(CPlusObject); -end; - -procedure TMenuItem.bool fSelected; -begin - BMenuItem_bool fSelected(CPlusObject); -end; - -procedure TMenuItem.uint32 _reserved[4]; -begin - BMenuItem_uint32 _reserved[4](CPlusObject); -end; -} - -constructor TSeparatorItem.Create; -begin - CPlusObject := BSeparatorItem_Create(Self); -end; - -constructor TSeparatorItem.Create(data : TMessage); -begin - CPlusObject := BSeparatorItem_Create(Self, data.CPlusObject); -end; - -destructor TSeparatorItem.Destroy; -begin - BSeparatorItem_Free(CPlusObject); - inherited; -end; - -function TSeparatorItem.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BSeparatorItem_Archive(CPlusObject, data.CPlusObject, deep); -end; - -function TSeparatorItem.Instantiate(data : TMessage) : TArchivable; -begin - Result := BSeparatorItem_Instantiate(CPlusObject, data.CPlusObject); -end; - -procedure TSeparatorItem.SetEnabled(state : boolean); -begin -// BSeparatorItem_SetEnabled(CPlusObject, state); -end; - -{ -procedure TSeparatorItem.GetContentSize(width : double; height : double); -begin - BSeparatorItem_GetContentSize(CPlusObject, width, height); -end; - -procedure TSeparatorItem.Draw; -begin -// BSeparatorItem_Draw(CPlusObject); -end; - -procedure TSeparatorItem._ReservedSeparatorItem1; -begin - BSeparatorItem__ReservedSeparatorItem1(CPlusObject); -end; - -procedure TSeparatorItem._ReservedSeparatorItem2; -begin - BSeparatorItem__ReservedSeparatorItem2(CPlusObject); -end; - -function TSeparatorItem.operator=( : TSeparatorItem) : TSeparatorItem; -begin - Result := BSeparatorItem_operator=(CPlusObject, ); -end; - -procedure TSeparatorItem.uint32 _reserved[1]; -begin - BSeparatorItem_uint32 _reserved[1](CPlusObject); -end; -} - -end. diff --git a/bepascal/bepascal/be/interface/menubar.h b/bepascal/bepascal/be/interface/menubar.h deleted file mode 100644 index cd7e414..0000000 --- a/bepascal/bepascal/be/interface/menubar.h +++ /dev/null @@ -1,43 +0,0 @@ -#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/bepascal/be/interface/menubar.pp b/bepascal/bepascal/be/interface/menubar.pp deleted file mode 100644 index 41b2c37..0000000 --- a/bepascal/bepascal/be/interface/menubar.pp +++ /dev/null @@ -1,350 +0,0 @@ -{ 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 - TMenu_Bar_Border = (B_BORDER_FRAME, - B_BORDER_CONTENTS, - B_BORDER_EACH_ITEM); - TMenuBar = class(TMenu) - private - public - constructor Create(frame : TRect; viewName : PChar; resizingMode : Cardinal; layout : TMenu_Layout; resizeToFit : boolean); - constructor Create; override; - destructor Destroy; override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure SetBorder(aBorder : TMenu_Bar_Border); - function Border : TMenu_Bar_Border; - procedure Draw(updateRect : TRect); override; - procedure AttachedToWindow; override; - procedure DetachedFromWindow; override; - procedure MessageReceived(msg : TMessage); override; - procedure MouseDown(where : TPoint); override; - procedure WindowActivated(state : boolean); override; - procedure MouseUp(where : TPoint); override; - procedure FrameMoved(new_position : TPoint); override; - procedure FrameResized(new_width : double; new_height : double); override; - procedure Show; - procedure Hide; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; aProperty : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - procedure ResizeToPreferred; override; - procedure GetPreferredSize(width : double; height : double); - procedure MakeFocus(state : boolean); - procedure AllAttached; override; - procedure AllDetached; override; -{ function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - procedure _ReservedMenuBar1; - procedure _ReservedMenuBar2; - procedure _ReservedMenuBar3; - procedure _ReservedMenuBar4; - function operator=( : TMenuBar) : TMenuBar; - procedure StartMenuBar(menuIndex : integer; sticky : boolean; show_menu : boolean; special_rect : TRect); - function TrackTask(arg : Pointer) : integer; - function Track(action : ^integer; startIndex : integer; showMenu : boolean) : TMenuItem; - procedure StealFocus; - procedure RestoreFocus; - procedure InitData(layout : TMenu_Layout); - procedure menu_bar_border fBorder; - procedure thread_id fTrackingPID; - procedure int32 fPrevFocusToken; - procedure sem_id fMenuSem; - procedure BRect *fLastBounds; - procedure uint32 _reserved[2]; - procedure bool fTracking; -} - 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) : TArchivable; cdecl; external BePascalLibName name 'BMenuBar_Instantiate'; -function BMenuBar_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BMenuBar_Archive'; -procedure BMenuBar_SetBorder(AObject : TCPlusObject; aBorder : TMenu_Bar_Border); cdecl; external BePascalLibName name 'BMenuBar_SetBorder'; -function BMenuBar_Border(AObject : TCPlusObject) : TMenu_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) : THandler; cdecl; external BePascalLibName name 'BMenuBar_ResolveSpecifier'; -function BMenuBar_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_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'; -{function BMenuBar_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BMenuBar_Perform'; -procedure BMenuBar__ReservedMenuBar1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar__ReservedMenuBar1'; -procedure BMenuBar__ReservedMenuBar2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar__ReservedMenuBar2'; -procedure BMenuBar__ReservedMenuBar3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar__ReservedMenuBar3'; -procedure BMenuBar__ReservedMenuBar4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar__ReservedMenuBar4'; -function BMenuBar_operator=(AObject : TCPlusObject; : TMenuBar) : TMenuBar; cdecl; external BePascalLibName name 'BMenuBar_operator='; -procedure BMenuBar_StartMenuBar(AObject : TCPlusObject; menuIndex : integer; sticky : boolean; show_menu : boolean; special_rect : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_StartMenuBar'; -function BMenuBar_TrackTask(AObject : TCPlusObject; arg : Pointer) : integer; cdecl; external BePascalLibName name 'BMenuBar_TrackTask'; -function BMenuBar_Track(AObject : TCPlusObject; action : ^integer; startIndex : integer; showMenu : boolean) : TMenuItem; cdecl; external BePascalLibName name 'BMenuBar_Track'; -procedure BMenuBar_StealFocus(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_StealFocus'; -procedure BMenuBar_RestoreFocus(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_RestoreFocus'; -procedure BMenuBar_InitData(AObject : TCPlusObject; layout : TMenu_Layout); cdecl; external BePascalLibName name 'BMenuBar_InitData'; -procedure BMenuBar_menu_bar_border fBorder(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_menu_bar_border fBorder'; -procedure BMenuBar_thread_id fTrackingPID(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_thread_id fTrackingPID'; -procedure BMenuBar_int32 fPrevFocusToken(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_int32 fPrevFocusToken'; -procedure BMenuBar_sem_id fMenuSem(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_sem_id fMenuSem'; -procedure BMenuBar_BRect *fLastBounds(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_BRect *fLastBounds'; -procedure BMenuBar_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_uint32 _reserved[2]'; -procedure BMenuBar_bool fTracking(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_bool fTracking'; -} - -implementation - -constructor TMenuBar.Create(frame : TRect; viewName : PChar; resizingMode : Cardinal; layout : TMenu_Layout; resizeToFit : boolean); -begin - CPlusObject := BMenuBar_Create(Self, frame.CPlusObject, viewName, resizingMode, 0, resizeToFit); -end; - -constructor TMenuBar.Create; -begin - CreatePas; -// CPlusObject := BMenuBar_Create_1(Self); -end; - -destructor TMenuBar.Destroy; -begin - BMenuBar_Free(CPlusObject); -end; - -function TMenuBar.Instantiate(data : TMessage) : TArchivable; -begin - Result := BMenuBar_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TMenuBar.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BMenuBar_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TMenuBar.SetBorder(aBorder : TMenu_Bar_Border); -begin - BMenuBar_SetBorder(CPlusObject, aBorder); -end; - -function TMenuBar.Border : TMenu_Bar_Border; -begin - Result := BMenuBar_Border(CPlusObject); -end; - -procedure TMenuBar.Draw(updateRect : TRect); -begin -// BMenuBar_Draw(CPlusObject, updateRect.CPlusObject); -end; - -procedure TMenuBar.AttachedToWindow; -begin -// BMenuBar_AttachedToWindow(CPlusObject); -end; - -procedure TMenuBar.DetachedFromWindow; -begin -// BMenuBar_DetachedFromWindow(CPlusObject); -end; - -procedure TMenuBar.MessageReceived(msg : TMessage); -begin -// BMenuBar_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TMenuBar.MouseDown(where : TPoint); -begin -// BMenuBar_MouseDown(CPlusObject, where.CPlusObject); -end; - -procedure TMenuBar.WindowActivated(state : boolean); -begin -// BMenuBar_WindowActivated(CPlusObject, state); -end; - -procedure TMenuBar.MouseUp(where : TPoint); -begin -// BMenuBar_MouseUp(CPlusObject, where.CPlusObject); -end; - -procedure TMenuBar.FrameMoved(new_position : TPoint); -begin -// BMenuBar_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TMenuBar.FrameResized(new_width : double; new_height : double); -begin -// BMenuBar_FrameResized(CPlusObject, new_width, new_height); -end; - -procedure TMenuBar.Show; -begin - BMenuBar_Show(CPlusObject); -end; - -procedure TMenuBar.Hide; -begin - BMenuBar_Hide(CPlusObject); -end; - -function TMenuBar.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; aProperty : PChar) : THandler; -begin - Result := BMenuBar_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, aProperty); -end; - -function TMenuBar.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BMenuBar_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -procedure TMenuBar.ResizeToPreferred; -begin -// BMenuBar_ResizeToPreferred(CPlusObject); -end; - -procedure TMenuBar.GetPreferredSize(width : double; height : double); -begin -// BMenuBar_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TMenuBar.MakeFocus(state : boolean); -begin -// BMenuBar_MakeFocus(CPlusObject, state); -end; - -procedure TMenuBar.AllAttached; -begin -// BMenuBar_AllAttached(CPlusObject); -end; - -procedure TMenuBar.AllDetached; -begin -// BMenuBar_AllDetached(CPlusObject); -end; - -{function TMenuBar.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BMenuBar_Perform(CPlusObject, d, arg); -end; - -procedure TMenuBar._ReservedMenuBar1; -begin - BMenuBar__ReservedMenuBar1(CPlusObject); -end; - -procedure TMenuBar._ReservedMenuBar2; -begin - BMenuBar__ReservedMenuBar2(CPlusObject); -end; - -procedure TMenuBar._ReservedMenuBar3; -begin - BMenuBar__ReservedMenuBar3(CPlusObject); -end; - -procedure TMenuBar._ReservedMenuBar4; -begin - BMenuBar__ReservedMenuBar4(CPlusObject); -end; - -function TMenuBar.operator=( : TMenuBar) : TMenuBar; -begin - Result := BMenuBar_operator=(CPlusObject, ); -end; - -procedure TMenuBar.StartMenuBar(menuIndex : integer; sticky : boolean; show_menu : boolean; special_rect : TRect); -begin - BMenuBar_StartMenuBar(CPlusObject, menuIndex, sticky, show_menu, special_rect.CPlusObject); -end; - -function TMenuBar.TrackTask(arg : Pointer) : integer; -begin - Result := BMenuBar_TrackTask(CPlusObject, arg); -end; - -function TMenuBar.Track(action : ^integer; startIndex : integer; showMenu : boolean) : TMenuItem; -begin - Result := BMenuBar_Track(CPlusObject, action, startIndex, showMenu); -end; - -procedure TMenuBar.StealFocus; -begin - BMenuBar_StealFocus(CPlusObject); -end; - -procedure TMenuBar.RestoreFocus; -begin - BMenuBar_RestoreFocus(CPlusObject); -end; - -procedure TMenuBar.InitData(layout : TMenu_Layout); -begin - BMenuBar_InitData(CPlusObject, layout); -end; - -procedure TMenuBar.menu_bar_border fBorder; -begin - BMenuBar_menu_bar_border fBorder(CPlusObject); -end; - -procedure TMenuBar.thread_id fTrackingPID; -begin - BMenuBar_thread_id fTrackingPID(CPlusObject); -end; - -procedure TMenuBar.int32 fPrevFocusToken; -begin - BMenuBar_int32 fPrevFocusToken(CPlusObject); -end; - -procedure TMenuBar.sem_id fMenuSem; -begin - BMenuBar_sem_id fMenuSem(CPlusObject); -end; - -procedure TMenuBar.BRect *fLastBounds; -begin - BMenuBar_BRect *fLastBounds(CPlusObject); -end; - -procedure TMenuBar.uint32 _reserved[2]; -begin - BMenuBar_uint32 _reserved[2](CPlusObject); -end; - -procedure TMenuBar.bool fTracking; -begin - BMenuBar_bool fTracking(CPlusObject); -end; -} - -end. diff --git a/bepascal/bepascal/be/interface/menuitem.h b/bepascal/bepascal/be/interface/menuitem.h deleted file mode 100644 index b36e7e3..0000000 --- a/bepascal/bepascal/be/interface/menuitem.h +++ /dev/null @@ -1,51 +0,0 @@ -/* 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/bepascal/be/interface/outlinelistview.pp b/bepascal/bepascal/be/interface/outlinelistview.pp deleted file mode 100644 index 7c08e27..0000000 --- a/bepascal/bepascal/be/interface/outlinelistview.pp +++ /dev/null @@ -1,357 +0,0 @@ -{ 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 - TOutlineListView = class(TListView) - private - public - constructor Create(frame : TRect; name : pchar; atype : Tlist_view_type; resizeMask: longint; flags : longint); override; - constructor Create(data : TMessage); - destructor Destroy;override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure MouseDown(where : TPoint);override; - procedure KeyDown(bytes : PChar; numBytes : integer);override; - procedure FrameMoved(new_position : TPoint);override; - procedure FrameResized(new_width : double; new_height : double);override; - procedure MouseUp(where : TPoint);override; - function AddUnder(item : TListItem; underItem : TListItem) : boolean; - function AddItem(item : TListItem) : boolean; - function AddItem(item : TListItem; fullListIndex : integer) : boolean; - function AddList(newItems : TList) : boolean; - function AddList(newItems : TList; fullListIndex : integer) : boolean; - function RemoveItem(item : TListItem) : boolean; - function RemoveItem(fullListIndex : integer) : TListItem; - function RemoveItems(fullListIndex : integer; count : integer) : boolean; - function FullListItemAt(fullListIndex : integer) : TListItem; - function FullListIndexOf(point : TPoint) : integer; - function FullListIndexOf(item : TListItem) : integer; - function FullListFirstItem : TListItem; - function FullListLastItem : TListItem; - function FullListHasItem(item : TListItem) : boolean; - function FullListCountItems : integer; - function FullListCurrentSelection(index : integer) : integer; - procedure MakeEmpty; - function FullListIsEmpty : boolean; - function Superitem(item : TListItem) : TListItem; - procedure Expand(item : TListItem); - procedure Collapse(item : TListItem); - function IsExpanded(fullListIndex : integer) : boolean; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_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 : TListItem; oneLevelOnly : boolean) : integer; - function ItemUnderAt(underItem : TListItem; oneLevelOnly : boolean; index : integer) : TListItem; -// function DoMiscellaneous(code : ; data : ) : boolean; -// procedure MessageReceived( : TMessage); - end; - -function BOutlineListView_Create(AObject : TBeObject; frame : TCPlusObject; name : pchar; atype : Tlist_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) : TArchivable; cdecl; external BePascalLibName name 'BOutlineListView_Instantiate'; -function BOutlineListView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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) : TListItem; 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) : TListItem; cdecl; external BePascalLibName name 'BOutlineListView_FullListFirstItem'; -function BOutlineListView_FullListLastItem(AObject : TCPlusObject) : TListItem; 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) : TListItem; 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) : THandler; cdecl; external BePascalLibName name 'BOutlineListView_ResolveSpecifier'; -function BOutlineListView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BOutlineListView_GetSupportedSuites'; -function BOutlineListView_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_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) : TListItem; 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 TOutlineListView.Create(frame : TRect; name : pchar; atype : Tlist_view_type; resizeMask: longint; flags : longint); -begin - CreatePas; - CPlusObject := BOutlineListView_Create(Self,frame.CPlusObject,name,atype,resizeMask,flags); -end; - -constructor TOutlineListView.Create(data : TMessage); -begin - CreatePas; - CPlusObject := BOutlineListView_Create_1(Self,data.CPlusObject); -end; - -destructor TOutlineListView.Destroy; -begin - BOutlineListView_Free(CPlusObject); - inherited; -end; - -function TOutlineListView.Instantiate(data : TMessage) : TArchivable; -begin - Result := BOutlineListView_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TOutlineListView.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BOutlineListView_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TOutlineListView.MouseDown(where : TPoint); -begin -// BOutlineListView_MouseDown(CPlusObject, where.CPlusObject); -end; - -procedure TOutlineListView.KeyDown(bytes : PChar; numBytes : integer); -begin - // BOutlineListView_KeyDown(CPlusObject, bytes, numBytes); -end; - -procedure TOutlineListView.FrameMoved(new_position : TPoint); -begin -// BOutlineListView_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TOutlineListView.FrameResized(new_width : double; new_height : double); -begin -// BOutlineListView_FrameResized(CPlusObject, new_width, new_height); -end; - -procedure TOutlineListView.MouseUp(where : TPoint); -begin -// BOutlineListView_MouseUp(CPlusObject, where.CPlusObject); -end; - -function TOutlineListView.AddUnder(item : TListItem; underItem : TListItem) : boolean; -begin - Result := BOutlineListView_AddUnder(CPlusObject, item.CPlusObject, underItem.CPlusObject); -end; - -function TOutlineListView.AddItem(item : TListItem) : boolean; -begin - Result := BOutlineListView_AddItem(CPlusObject, item.CPlusObject); -end; - -function TOutlineListView.AddItem(item : TListItem; fullListIndex : integer) : boolean; -begin - Result := BOutlineListView_AddItem(CPlusObject, item.CPlusObject, fullListIndex); -end; - -function TOutlineListView.AddList(newItems : TList) : boolean; -begin - Result := BOutlineListView_AddList(CPlusObject, newItems.CPlusObject); -end; - -function TOutlineListView.AddList(newItems : TList; fullListIndex : integer) : boolean; -begin - Result := BOutlineListView_AddList(CPlusObject, newItems.CPlusObject, fullListIndex); -end; - -function TOutlineListView.RemoveItem(item : TListItem) : boolean; -begin - Result := BOutlineListView_RemoveItem(CPlusObject, item.CPlusObject); -end; - -function TOutlineListView.RemoveItem(fullListIndex : integer) : TListItem; -begin -// Result := BOutlineListView_RemoveItem_1(CPlusObject, fullListIndex); -end; - -function TOutlineListView.RemoveItems(fullListIndex : integer; count : integer) : boolean; -begin - Result := BOutlineListView_RemoveItems(CPlusObject, fullListIndex, count); -end; - -function TOutlineListView.FullListItemAt(fullListIndex : integer) : TListItem; -begin - Result := BOutlineListView_FullListItemAt(CPlusObject, fullListIndex); -end; - -function TOutlineListView.FullListIndexOf(point : TPoint) : integer; -begin - Result := BOutlineListView_FullListIndexOf(CPlusObject, point.CPlusObject); -end; - -function TOutlineListView.FullListIndexOf(item : TListItem) : integer; -begin - Result := BOutlineListView_FullListIndexOf(CPlusObject, item.CPlusObject); -end; - -function TOutlineListView.FullListFirstItem : TListItem; -begin - Result := BOutlineListView_FullListFirstItem(CPlusObject); -end; - -function TOutlineListView.FullListLastItem : TListItem; -begin - Result := BOutlineListView_FullListLastItem(CPlusObject); -end; - -function TOutlineListView.FullListHasItem(item : TListItem) : boolean; -begin - Result := BOutlineListView_FullListHasItem(CPlusObject, item.CPlusObject); -end; - -function TOutlineListView.FullListCountItems : integer; -begin - Result := BOutlineListView_FullListCountItems(CPlusObject); -end; - -function TOutlineListView.FullListCurrentSelection(index : integer) : integer; -begin - Result := BOutlineListView_FullListCurrentSelection(CPlusObject, index); -end; - -procedure TOutlineListView.MakeEmpty; -begin - BOutlineListView_MakeEmpty(CPlusObject); -end; - -function TOutlineListView.FullListIsEmpty : boolean; -begin - Result := BOutlineListView_FullListIsEmpty(CPlusObject); -end; - -function TOutlineListView.Superitem(item : TListItem) : TListItem; -begin - Result := BOutlineListView_Superitem(CPlusObject, item); -end; - -procedure TOutlineListView.Expand(item : TListItem); -begin - BOutlineListView_Expand(CPlusObject, item.CPlusObject); -end; - -procedure TOutlineListView.Collapse(item : TListItem); -begin - BOutlineListView_Collapse(CPlusObject, item.CPlusObject); -end; - -function TOutlineListView.IsExpanded(fullListIndex : integer) : boolean; -begin - Result := BOutlineListView_IsExpanded(CPlusObject, fullListIndex); -end; - -function TOutlineListView.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BOutlineListView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -function TOutlineListView.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BOutlineListView_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TOutlineListView.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BOutlineListView_Perform(CPlusObject, d, arg); -end; - -procedure TOutlineListView.ResizeToPreferred; -begin - BOutlineListView_ResizeToPreferred(CPlusObject); -end; - -procedure TOutlineListView.GetPreferredSize(width : double; height : double); -begin - BOutlineListView_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TOutlineListView.MakeFocus(state : boolean); -begin - BOutlineListView_MakeFocus(CPlusObject, state); -end; - -procedure TOutlineListView.AllAttached; -begin - BOutlineListView_AllAttached(CPlusObject); -end; - -procedure TOutlineListView.AllDetached; -begin - BOutlineListView_AllDetached(CPlusObject); -end; - -procedure TOutlineListView.DetachedFromWindow; -begin - BOutlineListView_DetachedFromWindow(CPlusObject); -end; - -function TOutlineListView.CountItemsUnder(under : TListItem; oneLevelOnly : boolean) : integer; -begin - Result := BOutlineListView_CountItemsUnder(CPlusObject, under.CPlusObject, oneLevelOnly); -end; - -function TOutlineListView.ItemUnderAt(underItem : TListItem; oneLevelOnly : boolean; index : integer) : TListItem; -begin - Result := BOutlineListView_ItemUnderAt(CPlusObject, underItem.CPlusObject, oneLevelOnly, index); -end; - -{function TOutlineListView.DoMiscellaneous(code : ; data : ) : boolean; -begin - Result := BOutlineListView_DoMiscellaneous(CPlusObject, code, data); -end; - -procedure TOutlineListView.MessageReceived( : TMessage); -begin - BOutlineListView_MessageReceived(CPlusObject, .CPlusObject); -end; -} - - -end. diff --git a/bepascal/bepascal/be/interface/point.h b/bepascal/bepascal/be/interface/point.h deleted file mode 100644 index 481ada5..0000000 --- a/bepascal/bepascal/be/interface/point.h +++ /dev/null @@ -1,34 +0,0 @@ -/* 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/bepascal/be/interface/point.pp.arch b/bepascal/bepascal/be/interface/point.pp.arch deleted file mode 100644 index 6253dd8..0000000 --- a/bepascal/bepascal/be/interface/point.pp.arch +++ /dev/null @@ -1,72 +0,0 @@ -unit Point; - -interface - -uses - beobj, rect; - -type -// TRect = class; - TPoint = class(TBeObject) - public - constructor Create(x, y : single); virtual; - constructor Create(point : TPoint); virtual; - constructor Create; override; - destructor Destroy; override; - procedure ConstrainTo(Rect : TRect); - 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 TPoint.Create(x, y : single); -begin - inherited Create; - CPlusObject := BPoint_Create(Self, x, y); -end; - -constructor TPoint.Create(point : TPoint); -begin - inherited Create; - CPlusObject := BPoint_Create(Self, point.CPlusObject) -end; - -constructor TPoint.Create; -begin - inherited Create; - CPlusObject := BPoint_Create(Self); -end; - -destructor TPoint.Destroy; -begin - BPoint_Free(CPlusObject); - inherited; -end; - -procedure TPoint.ConstrainTo(Rect : TRect); -begin - BPoint_ConstrainTo(CPlusObject, Rect.CPlusObject); -end; - -procedure TPoint.PrintToStream; -begin - BPoint_PrintToStream(CPlusObject); -end; - -procedure TPoint.Sept(x, y : single); -begin - BPoint_Set(CPlusObject, x, y); -end; - -initialization - -end. \ No newline at end of file diff --git a/bepascal/bepascal/be/interface/radiobutton.pp b/bepascal/bepascal/be/interface/radiobutton.pp deleted file mode 100644 index 67d99cd..0000000 --- a/bepascal/bepascal/be/interface/radiobutton.pp +++ /dev/null @@ -1,270 +0,0 @@ -{ 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 - TRadioButton = class(TControl) - private - public - constructor Create(frame : TRect; name, aLabel : PChar; message : TMessage; resizingMode, flags : Cardinal); virtual; - constructor Create(data : TMessage); override; - destructor Destroy; override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure Draw(updateRect : TRect); override; - procedure MouseDown(where : TPoint); 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 : TMessage) : TStatus_t; - procedure MessageReceived(msg : TMessage); override; - procedure WindowActivated(state : boolean); override; - procedure MouseUp(pt : TPoint); override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); override; - procedure DetachedFromWindow; override; - procedure FrameMoved(new_position : TPoint); override; - procedure FrameResized(new_width : double; new_height : double); override; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - procedure MakeFocus(state : boolean); override; - procedure AllAttached; override; - procedure AllDetached; override; - function GetSupportedSuites(data : TMessage) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -// procedure _ReservedRadioButton1; -// procedure _ReservedRadioButton2; -// function operator=( : TRadioButton) : TRadioButton; -// 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) : TArchivable; cdecl; external BePascalLibName name 'BRadioButton_Instantiate'; -function BRadioButton_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BRadioButton_Archive'; -procedure BRadioButton_Draw(AObject : TCPlusObject; updateRect : TRect); cdecl; external BePascalLibName name 'BRadioButton_Draw'; -procedure BRadioButton_MouseDown(AObject : TCPlusObject; where : TPoint); 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) : TStatus_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 : TPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseUp'; -procedure BRadioButton_MouseMoved(AObject : TCPlusObject; pt : TPoint; 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) : THandler; 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) : TStatus_t; cdecl; external BePascalLibName name 'BRadioButton_GetSupportedSuites'; -function BRadioButton_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_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; : TRadioButton) : TRadioButton; 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 TRadioButton.Create(frame : TRect; name, aLabel : PChar; message : TMessage; resizingMode, flags : Cardinal); -begin - CreatePas; - CPlusObject := BRadioButton_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags); -end; - -constructor TRadioButton.Create(data : TMessage); -begin - CreatePas; - CPlusObject := BRadioButton_Create_1(Self, data.CPlusObject); -end; - -destructor TRadioButton.Destroy; -begin - BRadioButton_Free(CPlusObject); - inherited; -end; - -function TRadioButton.Instantiate(data : TMessage) : TArchivable; -begin - Result := BRadioButton_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TRadioButton.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BRadioButton_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TRadioButton.Draw(updateRect : TRect); -begin -// BRadioButton_Draw(CPlusObject, updateRect.CPlusObject); -end; - -procedure TRadioButton.MouseDown(where : TPoint); -begin -// BRadioButton_MouseDown(CPlusObject, where.CPlusObject); -end; - -procedure TRadioButton.AttachedToWindow; -begin -// BRadioButton_AttachedToWindow(CPlusObject); -end; - -procedure TRadioButton.KeyDown(bytes : PChar; numBytes : integer); -begin -// BRadioButton_KeyDown(CPlusObject, bytes, numBytes); -end; - -procedure TRadioButton.SetValue(aValue : integer); -begin - BRadioButton_SetValue(CPlusObject, aValue); -end; - -procedure TRadioButton.GetPreferredSize(width : double; height : double); -begin - BRadioButton_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TRadioButton.ResizeToPreferred; -begin - BRadioButton_ResizeToPreferred(CPlusObject); -end; - -function TRadioButton.Invoke(msg : TMessage) : TStatus_t; -begin - Result := BRadioButton_Invoke(CPlusObject, msg.CPlusObject); -end; - -procedure TRadioButton.MessageReceived(msg : TMessage); -begin -// BRadioButton_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TRadioButton.WindowActivated(state : boolean); -begin -// BRadioButton_WindowActivated(CPlusObject, state); -end; - -procedure TRadioButton.MouseUp(pt : TPoint); -begin -// BRadioButton_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TRadioButton.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin -// BRadioButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TRadioButton.DetachedFromWindow; -begin -// BRadioButton_DetachedFromWindow(CPlusObject); -end; - -procedure TRadioButton.FrameMoved(new_position : TPoint); -begin -// BRadioButton_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TRadioButton.FrameResized(new_width : double; new_height : double); -begin -// BRadioButton_FrameResized(CPlusObject, new_width, new_height); -end; - -function TRadioButton.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BRadioButton_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -procedure TRadioButton.MakeFocus(state : boolean); -begin - BRadioButton_MakeFocus(CPlusObject, state); -end; - -procedure TRadioButton.AllAttached; -begin -// BRadioButton_AllAttached(CPlusObject); -end; - -procedure TRadioButton.AllDetached; -begin -// BRadioButton_AllDetached(CPlusObject); -end; - -function TRadioButton.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BRadioButton_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TRadioButton.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BRadioButton_Perform(CPlusObject, d, arg); -end; - -{ -procedure TRadioButton._ReservedRadioButton1; -begin - BRadioButton__ReservedRadioButton1(CPlusObject); -end; - -procedure TRadioButton._ReservedRadioButton2; -begin - BRadioButton__ReservedRadioButton2(CPlusObject); -end; - -function TRadioButton.operator=( : TRadioButton) : TRadioButton; -begin - Result := BRadioButton_operator=(CPlusObject, ); -end; - -procedure TRadioButton.BBitmap *sBitmaps[2][3]; -begin - BRadioButton_BBitmap *sBitmaps[2][3](CPlusObject); -end; - -procedure TRadioButton.bool fOutlined; -begin - BRadioButton_bool fOutlined(CPlusObject); -end; - -procedure TRadioButton.uint32 _reserved[2]; -begin - BRadioButton_uint32 _reserved[2](CPlusObject); -end; -} - -end. diff --git a/bepascal/bepascal/be/interface/rect.h b/bepascal/bepascal/be/interface/rect.h deleted file mode 100644 index 03b0fad..0000000 --- a/bepascal/bepascal/be/interface/rect.h +++ /dev/null @@ -1,37 +0,0 @@ -/* 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/bepascal/be/interface/rect.pp b/bepascal/bepascal/be/interface/rect.pp deleted file mode 100644 index 9948550..0000000 --- a/bepascal/bepascal/be/interface/rect.pp +++ /dev/null @@ -1,144 +0,0 @@ -{ 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 - // TPoint and TRect are defined in the same unit to avoid circular reference - TPoint = class; - TRect = class(TBeObject) - public - constructor Create; override; - constructor Create(rect : TRect); virtual; // Problème de référence circulaire avec TPoint - constructor Create(l, t, r, b : single); virtual; - constructor Create(leftTop, rightBottom : TPoint); 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 - TPoint = class(TBeObject) - public - constructor Create; override; - constructor Create(x, y : single); virtual; - constructor Create(point : TPoint); virtual; - destructor Destroy; override; - procedure ConstrainTo(Rect : TRect); - 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 TRect.Create; -begin - inherited Create; - CPlusObject := BRect_Create(Self); -end; - -constructor TRect.Create(rect : TRect); -begin - inherited Create; - CPlusObject := BRect_Create(Self, rect.CPlusObject); -end; - -constructor TRect.Create(l, t, r, b : single); -begin - inherited Create; - CPlusObject := BRect_Create(Self, l, t, r, b); -end; - -constructor TRect.Create(leftTop, rightBottom : TPoint); -begin - inherited Create; - CPlusObject := BRect_Create(Self, leftTop.CPlusObject, rightBottom.CPlusObject); -end; - -destructor TRect.Destroy; -begin - BRect_Free(CPlusObject); - inherited Destroy; -end; - -procedure TRect.PrintToStream; -begin - BRect_PrintToStream(CPlusObject); -end; - -constructor TPoint.Create(x, y : single); -begin - inherited Create; - CPlusObject := BPoint_Create(Self, x, y); -end; - -constructor TPoint.Create(point : TPoint); -begin - inherited Create; - CPlusObject := BPoint_Create(Self, point.CPlusObject) -end; - -constructor TPoint.Create; -begin - inherited Create; - CPlusObject := BPoint_Create(Self); -end; - -destructor TPoint.Destroy; -begin - BPoint_Free(CPlusObject); - inherited; -end; - -procedure TPoint.ConstrainTo(Rect : TRect); -begin - BPoint_ConstrainTo(CPlusObject, Rect.CPlusObject); -end; - -procedure TPoint.PrintToStream; -begin - BPoint_PrintToStream(CPlusObject); -end; - -procedure TPoint.Sept(x, y : single); -begin - BPoint_Set(CPlusObject, x, y); -end; - -initialization - -end. \ No newline at end of file diff --git a/bepascal/bepascal/be/interface/scrollbar.pp b/bepascal/bepascal/be/interface/scrollbar.pp deleted file mode 100644 index e70a54b..0000000 --- a/bepascal/bepascal/be/interface/scrollbar.pp +++ /dev/null @@ -1,284 +0,0 @@ -{ 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 - TScrollBar = class(TView) - private - public - constructor Create(frame : TRect; name : pchar; atarget : TView; min,max : real; direction : Torientation); - constructor Create_1(data : TMessage); - destructor Destroy;override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_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 : TView); - procedure SetTarget(targetName : PChar); - function Target : TView; - function Orientation : TOrientation; - procedure MessageReceived(msg : TMessage);override; - procedure MouseDown(pt : TPoint);override; - procedure MouseUp(pt : TPoint);override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);override; - procedure DetachedFromWindow;override; - procedure Draw(updateRect : TRect);override; - procedure FrameMoved(new_position : TPoint);override; - procedure FrameResized(new_width : double; new_height : double);override; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - procedure ResizeToPreferred;override; - procedure GetPreferredSize(width : double; height : double); - procedure MakeFocus(state : boolean); - procedure AllAttached;override; - procedure AllDetached;override; - function GetSupportedSuites(data : TMessage) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - end; - -function BScrollBar_Create(AObject : TBeObject;frame : TCPlusObject; name : pchar; target : TCPlusObject; min,max : real; direction : Torientation): 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) : TArchivable; cdecl; external BePascalLibName name 'BScrollBar_Instantiate'; -function BScrollBar_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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 : TView); cdecl; external BePascalLibName name 'BScrollBar_SetTarget'; -procedure BScrollBar_SetTarget(AObject : TCPlusObject; targetName : PChar); cdecl; external BePascalLibName name 'BScrollBar_SetTarget'; -function BScrollBar_Target(AObject : TCPlusObject) : TView; cdecl; external BePascalLibName name 'BScrollBar_Target'; -function BScrollBar_Orientation(AObject : TCPlusObject) : TOrientation; 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 : TMessage); 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) : THandler; 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) : TStatus_t; cdecl; external BePascalLibName name 'BScrollBar_GetSupportedSuites'; -function BScrollBar_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BScrollBar_Perform'; - -implementation - -constructor TScrollBar.Create(frame : TRect; name : pchar; atarget : TView; min,max : real; direction : Torientation); -begin - CreatePas; - CPlusObject := BScrollBar_Create(Self,frame.CPlusObject, name, target.CPlusObject,min,max, direction ); -end; - -constructor TScrollBar.Create_1(data : TMessage); -begin - CreatePas; - CPlusObject := BScrollBar_Create_1(Self, data.CPlusObject); -end; - -destructor TScrollBar.Destroy; -begin - BScrollBar_Free(CPlusObject); - inherited; -end; - -function TScrollBar.Instantiate(data : TMessage) : TArchivable; -begin - Result := BScrollBar_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TScrollBar.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BScrollBar_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TScrollBar.AttachedToWindow; -begin - // BScrollBar_AttachedToWindow(CPlusObject); -end; - -procedure TScrollBar.SetValue(avalue : double); -begin - BScrollBar_SetValue(CPlusObject, avalue); -end; - -function TScrollBar.Value : double; -begin - Result := BScrollBar_Value(CPlusObject); -end; - -procedure TScrollBar.SetProportion( avalue: double); -begin - BScrollBar_SetProportion(CPlusObject, avalue); -end; - -function TScrollBar.Proportion : double; -begin - Result := BScrollBar_Proportion(CPlusObject); -end; - -procedure TScrollBar.ValueChanged(newValue : double); -begin - BScrollBar_ValueChanged(CPlusObject, newValue); -end; - -procedure TScrollBar.SetRange(min : double; max : double); -begin - BScrollBar_SetRange(CPlusObject, min, max); -end; - -procedure TScrollBar.GetRange(min : double; max : double); -begin - BScrollBar_GetRange(CPlusObject, min, max); -end; - -procedure TScrollBar.SetSteps(smallStep : double; largeStep : double); -begin - BScrollBar_SetSteps(CPlusObject, smallStep, largeStep); -end; - -procedure TScrollBar.GetSteps(smallStep : double; largeStep : double); -begin - BScrollBar_GetSteps(CPlusObject, smallStep, largeStep); -end; - -procedure TScrollBar.SetTarget(atarget : TView); -begin - BScrollBar_SetTarget(CPlusObject, target.CPlusObject); -end; - -procedure TScrollBar.SetTarget(targetName : PChar); -begin - BScrollBar_SetTarget(CPlusObject, targetName); -end; - -function TScrollBar.Target : TView; -begin - Result := BScrollBar_Target(CPlusObject); -end; - -function TScrollBar.Orientation : TOrientation; -begin - Result := BScrollBar_Orientation(CPlusObject); -end; - -procedure TScrollBar.MessageReceived(msg : TMessage); -begin - // BScrollBar_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TScrollBar.MouseDown(pt : TPoint); -begin -// BScrollBar_MouseDown(CPlusObject, pt.CPlusObject); -end; - -procedure TScrollBar.MouseUp(pt : TPoint); -begin -// BScrollBar_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TScrollBar.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin -// BScrollBar_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TScrollBar.DetachedFromWindow; -begin - // BScrollBar_DetachedFromWindow(CPlusObject); -end; - -procedure TScrollBar.Draw(updateRect : TRect); -begin - //BScrollBar_Draw(CPlusObject, updateRect.CPlusObject); -end; - -procedure TScrollBar.FrameMoved(new_position : TPoint); -begin -// BScrollBar_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TScrollBar.FrameResized(new_width : double; new_height : double); -begin -// BScrollBar_FrameResized(CPlusObject, new_width, new_height); -end; - -function TScrollBar.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BScrollBar_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -procedure TScrollBar.ResizeToPreferred; -begin -// BScrollBar_ResizeToPreferred(CPlusObject); -end; - -procedure TScrollBar.GetPreferredSize(width : double; height : double); -begin - BScrollBar_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TScrollBar.MakeFocus(state : boolean); -begin - BScrollBar_MakeFocus(CPlusObject, state); -end; - -procedure TScrollBar.AllAttached; -begin - BScrollBar_AllAttached(CPlusObject); -end; - -procedure TScrollBar.AllDetached; -begin - BScrollBar_AllDetached(CPlusObject); -end; - -function TScrollBar.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BScrollBar_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TScrollBar.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BScrollBar_Perform(CPlusObject, d, arg); -end; - - -end. diff --git a/bepascal/bepascal/be/interface/scrollview.pp b/bepascal/bepascal/be/interface/scrollview.pp deleted file mode 100644 index a2e1dd0..0000000 --- a/bepascal/bepascal/be/interface/scrollview.pp +++ /dev/null @@ -1,259 +0,0 @@ -{ 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 - TScrollView = class(TView) - private - public - constructor Create(name : pchar; - atarget :TView; - resizeMask : longint; - flags : longint; - horizontal, - vertical : boolean; - aborder :Tborder_style ); virtual; - destructor Destroy;override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure Draw(updateRect : TRect);override; - procedure AttachedToWindow;override; - function ScrollBar(flag : TOrientation) : TScrollBar; - procedure SetBorder(aborder : Tborder_style); - function Border : Tborder_style; - function SetBorderHighlighted(state : boolean) : TStatus_t; - function IsBorderHighlighted : boolean; - procedure SetTarget(new_target : TView); - function Target : TView; - procedure MessageReceived(msg : TMessage);override; - procedure MouseDown(pt : TPoint);override; - procedure WindowActivated(state : boolean);override; - procedure MouseUp(pt : TPoint);override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);override; - procedure DetachedFromWindow;override; - procedure AllAttached;override; - procedure AllDetached;override; - procedure FrameMoved(new_position : TPoint);override; - procedure FrameResized(new_width : double; new_height : double);override; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - procedure ResizeToPreferred;override; - procedure GetPreferredSize(width : double; height : double); - procedure MakeFocus(state : boolean); - function GetSupportedSuites(data : TMessage) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - end; - -function BScrollView_Create(AObject : TBeObject;name : pchar;target :TCPlusObject; resizeMask : longint; flags : longint;horizontal,vertical : boolean;border :Tborder_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) : TArchivable; cdecl; external BePascalLibName name 'BScrollView_Instantiate'; -function BScrollView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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 : TOrientation) : TScrollBar; cdecl; external BePascalLibName name 'BScrollView_ScrollBar'; -procedure BScrollView_SetBorder(AObject : TCPlusObject; border : Tborder_style); cdecl; external BePascalLibName name 'BScrollView_SetBorder'; -function BScrollView_Border(AObject : TCPlusObject) : Tborder_style; cdecl; external BePascalLibName name 'BScrollView_Border'; -function BScrollView_SetBorderHighlighted(AObject : TCPlusObject; state : boolean) : TStatus_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) : TView; 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 : TPoint); 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) : THandler; 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) : TStatus_t; cdecl; external BePascalLibName name 'BScrollView_GetSupportedSuites'; -function BScrollView_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BScrollView_Perform'; - -implementation - -constructor TScrollView.Create(name : pchar; - atarget :TView; - resizeMask : longint; - flags : longint; - horizontal, - vertical : boolean; - aborder :Tborder_style ); -begin - CreatePas; - CPlusObject := BScrollView_Create(Self,name,atarget.CplusObject,resizeMask,flags,horizontal,vertical,aborder); - -end; - - - -destructor TScrollView.Destroy; -begin - BScrollView_Free(CPlusObject); - inherited; -end; - -function TScrollView.Instantiate(data : TMessage) : TArchivable; -begin - Result := BScrollView_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TScrollView.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BScrollView_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TScrollView.Draw(updateRect : TRect); -begin -// BScrollView_Draw(CPlusObject, updateRect.CPlusObject); -end; - -procedure TScrollView.AttachedToWindow; -begin - //BScrollView_AttachedToWindow(CPlusObject); -end; - -function TScrollView.ScrollBar(flag : TOrientation) : TScrollBar; -begin - Result := BScrollView_ScrollBar(CPlusObject, flag); -end; - -procedure TScrollView.SetBorder(aborder : Tborder_style); -begin - BScrollView_SetBorder(CPlusObject, aborder); -end; - -function TScrollView.Border : Tborder_style; -begin - Result := BScrollView_Border(CPlusObject); -end; - -function TScrollView.SetBorderHighlighted(state : boolean) : TStatus_t; -begin - Result := BScrollView_SetBorderHighlighted(CPlusObject, state); -end; - -function TScrollView.IsBorderHighlighted : boolean; -begin - Result := BScrollView_IsBorderHighlighted(CPlusObject); -end; - -procedure TScrollView.SetTarget(new_target : TView); -begin - BScrollView_SetTarget(CPlusObject, new_target.CPlusObject); -end; - -function TScrollView.Target : TView; -begin - Result := BScrollView_Target(CPlusObject); -end; - -procedure TScrollView.MessageReceived(msg : TMessage); -begin - inherited; - //BScrollView_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TScrollView.MouseDown(pt : TPoint); -begin -// BScrollView_MouseDown(CPlusObject, pt.CPlusObject); -end; - -procedure TScrollView.WindowActivated(state : boolean); -begin - //BScrollView_WindowActivated(CPlusObject, state); -end; - -procedure TScrollView.MouseUp(pt : TPoint); -begin - //BScrollView_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TScrollView.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin - //BScrollView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TScrollView.DetachedFromWindow; -begin - //BScrollView_DetachedFromWindow(CPlusObject); -end; - -procedure TScrollView.AllAttached; -begin - //BScrollView_AllAttached(CPlusObject); -end; - -procedure TScrollView.AllDetached; -begin - //BScrollView_AllDetached(CPlusObject); -end; - -procedure TScrollView.FrameMoved(new_position : TPoint); -begin -// BScrollView_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TScrollView.FrameResized(new_width : double; new_height : double); -begin - //BScrollView_FrameResized(CPlusObject, new_width, new_height); -end; - -function TScrollView.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BScrollView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -procedure TScrollView.ResizeToPreferred; -begin - BScrollView_ResizeToPreferred(CPlusObject); -end; - -procedure TScrollView.GetPreferredSize(width : double; height : double); -begin - BScrollView_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TScrollView.MakeFocus(state : boolean); -begin - BScrollView_MakeFocus(CPlusObject, state); -end; - -function TScrollView.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BScrollView_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TScrollView.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BScrollView_Perform(CPlusObject, d, arg); -end; - - -end. diff --git a/bepascal/bepascal/be/interface/statusbar.pp b/bepascal/bepascal/be/interface/statusbar.pp deleted file mode 100644 index 022c388..0000000 --- a/bepascal/bepascal/be/interface/statusbar.pp +++ /dev/null @@ -1,303 +0,0 @@ -{ 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 - TStatusBar = class(TView) - private - public - constructor Create( frame : TRect; - name : pchar; - alabel : Pchar; - trailing_label : Pchar);virtual; - constructor Create(data : TMessage);virtual; - destructor Destroy;override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure AttachedToWindow;override; - procedure MessageReceived(msg : TMessage);override; - procedure Draw(updateRect : TRect);override; - procedure SetBarColor(color : trgb_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 : trgb_color; - function BarHeight : double; - function Text : PChar; - function TrailingText : PChar; - function GetLabel : PChar; - function TrailingLabel : PChar; - procedure MouseDown(pt : TPoint);override; - procedure MouseUp(pt : TPoint);override; - procedure WindowActivated(state : boolean);override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);override; - procedure DetachedFromWindow;override; - procedure FrameMoved(new_position : TPoint);override; - procedure FrameResized(new_width : double; new_height : double);override; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - 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) : TArchivable; cdecl; external BePascalLibName name 'BStatusBar_Instantiate'; -function BStatusBar_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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 : trgb_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) : trgb_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 : TMessage); 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) : THandler; 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) : TStatus_t; cdecl; external BePascalLibName name 'BStatusBar_GetSupportedSuites'; - -implementation - -constructor TStatusBar.Create(frame : TRect; - name : pchar; - alabel : Pchar; - trailing_label : Pchar); -begin - CreatePas; - CPlusObject := BStatusBar_Create(Self,frame.CPlusObject,name,alabel,trailing_label); -end; - -constructor TStatusBar.Create(data : TMessage); -begin - CreatePas; - CPlusObject := BStatusBar_Create(Self, data.CPlusObject); -end; - -destructor TStatusBar.Destroy; -begin - BStatusBar_Free(CPlusObject); - inherited; -end; - -function TStatusBar.Instantiate(data : TMessage) : TArchivable; -begin - Result := BStatusBar_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TStatusBar.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BStatusBar_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TStatusBar.AttachedToWindow; -begin - //BStatusBar_AttachedToWindow(CPlusObject); -end; - -procedure TStatusBar.MessageReceived(msg : TMessage); -begin - //BStatusBar_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TStatusBar.Draw(updateRect : TRect); -begin -// BStatusBar_Draw(CPlusObject, updateRect.CPlusObject); -end; - -procedure TStatusBar.SetBarColor(color : trgb_color); -begin - BStatusBar_SetBarColor(CPlusObject, color); -end; - -procedure TStatusBar.SetBarHeight(height : double); -begin - BStatusBar_SetBarHeight(CPlusObject, height); -end; - -procedure TStatusBar.SetText(str : PChar); -begin - BStatusBar_SetText(CPlusObject, str); -end; - -procedure TStatusBar.SetTrailingText(str : PChar); -begin - BStatusBar_SetTrailingText(CPlusObject, str); -end; - -procedure TStatusBar.SetMaxValue(max : double); -begin - BStatusBar_SetMaxValue(CPlusObject, max); -end; - -procedure TStatusBar.Update(delta : single; main_text : PChar; trailing_text : PChar); -begin - BStatusBar_Update(CPlusObject, delta, main_text, trailing_text); -end; - -procedure TStatusBar.Reset(alabel : PChar; trailing_label : PChar); -begin - BStatusBar_Reset(CPlusObject, alabel, trailing_label); -end; - -function TStatusBar.CurrentValue : double; -begin - Result := BStatusBar_CurrentValue(CPlusObject); -end; - -function TStatusBar.MaxValue : double; -begin - Result := BStatusBar_MaxValue(CPlusObject); -end; - -function TStatusBar.BarColor : trgb_color; -begin - Result := BStatusBar_BarColor(CPlusObject); -end; - -function TStatusBar.BarHeight : double; -begin - Result := BStatusBar_BarHeight(CPlusObject); -end; - -function TStatusBar.Text : PChar; -begin - Result := BStatusBar_Text(CPlusObject); -end; - -function TStatusBar.TrailingText : PChar; -begin - Result := BStatusBar_TrailingText(CPlusObject); -end; - -function TStatusBar.GetLabel : PChar; -begin - Result := BStatusBar_Label(CPlusObject); -end; - -function TStatusBar.TrailingLabel : PChar; -begin - Result := BStatusBar_TrailingLabel(CPlusObject); -end; - -procedure TStatusBar.MouseDown(pt : TPoint); -begin -// BStatusBar_MouseDown(CPlusObject, pt.CPlusObject); -end; - -procedure TStatusBar.MouseUp(pt : TPoint); -begin -// BStatusBar_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TStatusBar.WindowActivated(state : boolean); -begin -// BStatusBar_WindowActivated(CPlusObject, state); -end; - -procedure TStatusBar.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin -// BStatusBar_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TStatusBar.DetachedFromWindow; -begin -// BStatusBar_DetachedFromWindow(CPlusObject); -end; - -procedure TStatusBar.FrameMoved(new_position : TPoint); -begin -// BStatusBar_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TStatusBar.FrameResized(new_width : double; new_height : double); -begin -// BStatusBar_FrameResized(CPlusObject, new_width, new_height); -end; - -function TStatusBar.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin -// Result := BStatusBar_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -procedure TStatusBar.ResizeToPreferred; -begin - BStatusBar_ResizeToPreferred(CPlusObject); -end; - -procedure TStatusBar.GetPreferredSize(width : double; height : double); -begin - BStatusBar_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TStatusBar.MakeFocus(state : boolean); -begin - BStatusBar_MakeFocus(CPlusObject, state); -end; - -procedure TStatusBar.AllAttached; -begin - BStatusBar_AllAttached(CPlusObject); -end; - -procedure TStatusBar.AllDetached; -begin - BStatusBar_AllDetached(CPlusObject); -end; - - -end. diff --git a/bepascal/bepascal/be/interface/stringview.pp b/bepascal/bepascal/be/interface/stringview.pp deleted file mode 100644 index 86e5de2..0000000 --- a/bepascal/bepascal/be/interface/stringview.pp +++ /dev/null @@ -1,262 +0,0 @@ -{ 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 - TStringView = class(TView) - private - public - constructor Create(bounds : TRect; name : pchar; texte : pchar; resizeflags, flags : cardinal); virtual; - destructor Destroy; override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure SetText(texte : PChar); - function Text : PChar; - procedure SetAlignment(flag : TAlignment); - function Alignment : TAlignment; - procedure AttachedToWindow; override; - procedure Draw(bounds : TRect); override; - procedure MessageReceived(msg : TMessage);override; - procedure MouseDown(pt : TPoint);override; - procedure MouseUp(pt : TPoint);override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);override; - procedure DetachedFromWindow;override; - procedure FrameMoved(new_position : TPoint);override; - procedure FrameResized(new_width : double; new_height : double);override; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - procedure ResizeToPreferred;override; - procedure GetPreferredSize(width : double; height : double); - procedure MakeFocus(state : boolean); - procedure AllAttached;override; - procedure AllDetached;override; - function GetSupportedSuites(data : TMessage) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -// procedure _ReservedStringView1; -// procedure _ReservedStringView2; -// procedure _ReservedStringView3; -// function operator=( : TStringView) : TStringView; -// 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) : TArchivable; cdecl; external BePascalLibName name 'BStringView_Instantiate'; -function BStringView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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_SetAlignment(AObject : TCPlusObject; flag : TAlignment); cdecl; external BePascalLibName name 'BStringView_SetAlignment'; -function BStringView_Alignment(AObject : TCPlusObject) : TAlignment; 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) : THandler; 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) : TStatus_t; cdecl; external BePascalLibName name 'BStringView_GetSupportedSuites'; -function BStringView_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_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; : TStringView) : TStringView; 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 TStringView.Create(bounds : TRect; name : pchar; texte : pchar; resizeflags, flags : cardinal); -begin - CreatePas; - CPlusObject := BStringView_Create(Self,bounds.CPlusObject,name,texte,resizeflags, flags); -end; - -destructor TStringView.Destroy; -begin - BStringView_Free(CPlusObject); - inherited; -end; - -function TStringView.Instantiate(data : TMessage) : TArchivable; -begin - Result := BStringView_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TStringView.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BStringView_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TStringView.SetText(texte : PChar); -begin - BStringView_SetText(CPlusObject, texte); -end; - -function TStringView.Text : PChar; -begin - Result := BStringView_Text(CPlusObject); -end; - -procedure TStringView.SetAlignment(flag : TAlignment); -begin - BStringView_SetAlignment(CPlusObject, flag); -end; - -function TStringView.Alignment : TAlignment; -begin - Result := BStringView_Alignment(CPlusObject); -end; - -procedure TStringView.AttachedToWindow; -begin -// BStringView_AttachedToWindow(CPlusObject); -end; - -procedure TStringView.Draw(bounds : TRect); -begin - // BStringView_Draw(CPlusObject, bounds.CPlusObject); -end; - -procedure TStringView.MessageReceived(msg : TMessage); -begin - //BStringView_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TStringView.MouseDown(pt : TPoint); -begin - //BStringView_MouseDown(CPlusObject, pt.CPlusObject); -end; - -procedure TStringView.MouseUp(pt : TPoint); -begin - //BStringView_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TStringView.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin - //BStringView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TStringView.DetachedFromWindow; -begin - //BStringView_DetachedFromWindow(CPlusObject); -end; - -procedure TStringView.FrameMoved(new_position : TPoint); -begin - //BStringView_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TStringView.FrameResized(new_width : double; new_height : double); -begin - //BStringView_FrameResized(CPlusObject, new_width, new_height); -end; - -function TStringView.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - // Result := BStringView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -procedure TStringView.ResizeToPreferred; -begin - //BStringView_ResizeToPreferred(CPlusObject); -end; - -procedure TStringView.GetPreferredSize(width : double; height : double); -begin - BStringView_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TStringView.MakeFocus(state : boolean); -begin - BStringView_MakeFocus(CPlusObject, state); -end; - -procedure TStringView.AllAttached; -begin - //BStringView_AllAttached(CPlusObject); -end; - -procedure TStringView.AllDetached; -begin - //BStringView_AllDetached(CPlusObject); -end; - -function TStringView.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BStringView_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TStringView.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - //Result := BStringView_Perform(CPlusObject, d, arg); -end; - -{procedure TStringView._ReservedStringView1; -begin - BStringView__ReservedStringView1(CPlusObject); -end; - -procedure TStringView._ReservedStringView2; -begin - BStringView__ReservedStringView2(CPlusObject); -end; - -procedure TStringView._ReservedStringView3; -begin - BStringView__ReservedStringView3(CPlusObject); -end; - -function TStringView.operator=( : TStringView) : TStringView; -begin - Result := BStringView_operator=(CPlusObject, ); -end; - -procedure TStringView.char *fText; -begin - BStringView_char *fText(CPlusObject); -end; - -procedure TStringView.alignment fAlign; -begin - BStringView_alignment fAlign(CPlusObject); -end; - -procedure TStringView.uint32 _reserved[3]; -begin - BStringView_uint32 _reserved[3](CPlusObject); -end; -} - -end. diff --git a/bepascal/bepascal/be/interface/tabview.pp b/bepascal/bepascal/be/interface/tabview.pp deleted file mode 100644 index 9fc1aed..0000000 --- a/bepascal/bepascal/be/interface/tabview.pp +++ /dev/null @@ -1,603 +0,0 @@ -{ 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 - TTab = class(TBeObject) - private - public - constructor Create(View : TView);virtual; - constructor Create_1(data : TMessage);virtual; - destructor Destroy;override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - function Perform(d : Cardinal; arg : Pointer) : TStatus_t; - function GetLabel : PChar; - procedure SetLabel(alabel : PChar); - function IsSelected : boolean; - procedure Select(owner : TView); - procedure Deselect; - procedure SetEnabled(aon : boolean); - function IsEnabled : boolean; - procedure MakeFocus(infocus : boolean); - function IsFocus : boolean; - procedure SetView(contents : TView); - function GetView : TView; - procedure DrawFocusMark(owner : TView; tabFrame : TRect); - procedure DrawLabel(owner : TView; tabFrame : TRect); - procedure DrawTab(owner : TView; tabFrame : TRect; position : byte; full : boolean); - end; - - -type - TTabView = class(TView) - private - public - destructor Destroy;override; - constructor Create(frame : TRect; name : Pchar; width : Tbutton_width; resizingMode : cardinal; flags : cardinal);virtual; - constructor Create(msg : TMessage);virtual; - function Instantiate( msg: TMessage) : TArchivable; - function Archive( msg : TMessage; deep : boolean) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - procedure WindowActivated(state : boolean);override; - procedure AttachedToWindow;override; - procedure AllAttached;override; - procedure AllDetached;override; - procedure DetachedFromWindow;override; - procedure MessageReceived(msg : TMessage);override; - procedure FrameMoved(new_position : TPoint);override; - procedure FrameResized(w : double; h : double);override; - procedure KeyDown(bytes : PChar; n : integer);override; - procedure MouseDown( pt: TPoint);override; - procedure MouseUp( pt: TPoint);override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);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: TRect);override; - function DrawTabs : TRect; - procedure DrawBox(selectedTabFrame : TRect); - function TabFrame(tabIndex : integer) : TRect; - procedure SetFlags(flags : Cardinal); - procedure SetResizingMode(mode : Cardinal); - procedure GetPreferredSize(width : double; height : double); - procedure ResizeToPreferred;override; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - procedure AddTab(tabContents : TView; tab : TTab); - function RemoveTab(tabIndex : integer) : TTab; - function TabAt(tabIndex : integer) : TTab; - procedure SetTabWidth(s : Tbutton_width); - function TabWidth : Tbutton_width; - procedure SetTabHeight(height : double); - function TabHeight : double; - function ContainerView : TView; - function CountTabs : integer; - function ViewForTab(tabIndex : integer) : TView; - 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) : TArchivable; cdecl; external BePascalLibName name 'BTab_Instantiate'; -function BTab_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BTab_Archive'; -function BTab_Perform(AObject : TCPlusObject; d : Cardinal; arg : Pointer) : TStatus_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_SetView(AObject : TCPlusObject; contents : TCPlusObject); cdecl; external BePascalLibName name 'BTab_SetView'; -function BTab_View(AObject : TCPlusObject) : TView; 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) : TArchivable; cdecl; external BePascalLibName name 'BTabView_Instantiate'; -function BTabView_Archive(AObject : TCPlusObject; msg : TCPlusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BTabView_Archive'; -function BTabView_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_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) : TRect; 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) : TRect; 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) : THandler; cdecl; external BePascalLibName name 'BTabView_ResolveSpecifier'; -function BTabView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_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) : TTab; cdecl; external BePascalLibName name 'BTabView_RemoveTab'; -function BTabView_TabAt(AObject : TCPlusObject; tabIndex : integer) : TTab; cdecl; external BePascalLibName name 'BTabView_TabAt'; -procedure BTabView_SetTabWidth(AObject : TCPlusObject; s : Tbutton_width); cdecl; external BePascalLibName name 'BTabView_SetTabWidth'; -function BTabView_TabWidth(AObject : TCPlusObject) : Tbutton_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) : TView; 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) : TView; 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 TTab.Create(View : TView); -begin - CreatePas; - CPlusObject := BTab_Create(Self,View.CPlusObject); -end; - -destructor TTab.Destroy; -begin - BTab_Free(CPlusObject); - inherited; -end; - -constructor TTab.Create_1(data : TMessage); -begin - CreatePas; - CPlusObject := BTab_Create_1(Self, data.CPlusObject); -end; - -function TTab.Instantiate(data : TMessage) : TArchivable; -begin - Result := BTab_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TTab.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BTab_Archive(CPlusObject, data.CPlusObject, deep); -end; - -function TTab.Perform(d : Cardinal; arg : Pointer) : TStatus_t; -begin - Result := BTab_Perform(CPlusObject, d, arg); -end; - -function TTab.GetLabel : PChar; -begin - Result := BTab_Label(CPlusObject); -end; - -procedure TTab.SetLabel(alabel : PChar); -begin - BTab_SetLabel(CPlusObject, alabel); -end; - -function TTab.IsSelected : boolean; -begin - Result := BTab_IsSelected(CPlusObject); -end; - -procedure TTab.Select(owner : TView); -begin - BTab_Select(CPlusObject, owner.CPlusObject); -end; - -procedure TTab.Deselect; -begin - BTab_Deselect(CPlusObject); -end; - -procedure TTab.SetEnabled(aon : boolean); -begin - BTab_SetEnabled(CPlusObject, aon); -end; - -function TTab.IsEnabled : boolean; -begin - Result := BTab_IsEnabled(CPlusObject); -end; - -procedure TTab.MakeFocus(infocus : boolean); -begin - BTab_MakeFocus(CPlusObject, infocus); -end; - -function TTab.IsFocus : boolean; -begin - Result := BTab_IsFocus(CPlusObject); -end; - -procedure TTab.SetView(contents : TView); -begin - BTab_SetView(CPlusObject, contents.CPlusObject); -end; - -function TTab.GetView : TView; -begin - Result := BTab_View(CPlusObject); -end; - -procedure TTab.DrawFocusMark(owner : TView; tabFrame : TRect); -begin - BTab_DrawFocusMark(CPlusObject, owner.CPlusObject, tabFrame.CPlusObject); -end; - -procedure TTab.DrawLabel(owner : TView; tabFrame : TRect); -begin - BTab_DrawLabel(CPlusObject, owner.CPlusObject, tabFrame.CPlusObject); -end; - -procedure TTab.DrawTab(owner : TView; tabFrame : TRect; position: byte; full : boolean); -begin - BTab_DrawTab(CPlusObject, owner.CPlusObject, tabFrame.CPlusObject, position, full); -end; - - -//--------------------TTabView - -destructor TTabView.Destroy; -begin - BTabView_Free(CPlusObject); - inherited; -end; - -constructor TTabView.Create( frame : TRect; name : Pchar; width : Tbutton_width; resizingMode : cardinal; flags : cardinal); -begin - createPas; - CPlusObject := BTabView_Create(Self, frame.CPlusObject, name, Integer(width),resizingMode,flags); -end; - - -constructor TTabView.Create( msg: TMessage); -begin - createPas; - CPlusObject := BTabView_Create_1(Self, msg.CPlusObject); -end; - -function TTabView.Instantiate( msg : TMessage) : TArchivable; -begin - Result := BTabView_Instantiate(CPlusObject, msg.CPlusObject); -end; - -function TTabView.Archive( msg : TMessage; deep : boolean) : TStatus_t; -begin - Result := BTabView_Archive(CPlusObject, msg.CPlusObject, deep); -end; - -function TTabView.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - // Result := BTabView_Perform(CPlusObject, d, arg); -end; - -procedure TTabView.WindowActivated(state : boolean); -begin - //BTabView_WindowActivated(CPlusObject, state); -end; - -procedure TTabView.AttachedToWindow; -begin - //BTabView_AttachedToWindow(CPlusObject); -end; - -procedure TTabView.AllAttached; -begin - //BTabView_AllAttached(CPlusObject); -end; - -procedure TTabView.AllDetached; -begin - //BTabView_AllDetached(CPlusObject); -end; - -procedure TTabView.DetachedFromWindow; -begin -// BTabView_DetachedFromWindow(CPlusObject); -end; - -procedure TTabView.MessageReceived(msg : TMessage); -begin - // BTabView_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -procedure TTabView.FrameMoved(new_position : TPoint); -begin - //BTabView_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TTabView.FrameResized(w : double; h : double); -begin -// BTabView_FrameResized(CPlusObject, w, h); -end; - -procedure TTabView.KeyDown(bytes : PChar; n : integer); -begin - // BTabView_KeyDown(CPlusObject, bytes, n); -end; - -procedure TTabView.MouseDown( pt: TPoint); -begin - //BTabView_MouseDown(CPlusObject, pt.CPlusObject); -end; - -procedure TTabView.MouseUp( pt: TPoint); -begin - //BTabView_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TTabView.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin - //BTabView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TTabView.Pulse; -begin - // BTabView_Pulse(CPlusObject); -end; - -procedure TTabView.Select(tabIndex : integer); -begin - BTabView_Select(CPlusObject, tabIndex); -end; - -function TTabView.Selection : integer; -begin -// Result := BTabView_Selection(CPlusObject); -end; - -procedure TTabView.MakeFocus(focusState : boolean); -begin - BTabView_MakeFocus(CPlusObject, focusState); -end; - -procedure TTabView.SetFocusTab(tabIndex : integer; focusState : boolean); -begin - BTabView_SetFocusTab(CPlusObject, tabIndex, focusState); -end; - -function TTabView.FocusTab : integer; -begin - Result := BTabView_FocusTab(CPlusObject); -end; - -procedure TTabView.Draw( rect: TRect); -begin - // BTabView_Draw(CPlusObject, rect.CPlusObject); -end; - -function TTabView.DrawTabs : TRect; -begin -// Result := BTabView_DrawTabs(CPlusObject); -end; - -procedure TTabView.DrawBox(selectedTabFrame : TRect); -begin - //BTabView_DrawBox(CPlusObject, selectedTabFrame.CPlusObject); -end; - -function TTabView.TabFrame(tabIndex : integer) : TRect; -begin - Result := BTabView_TabFrame(CPlusObject, tabIndex); -end; - -procedure TTabView.SetFlags(flags : Cardinal); -begin - BTabView_SetFlags(CPlusObject, flags); -end; - -procedure TTabView.SetResizingMode(mode : Cardinal); -begin - BTabView_SetResizingMode(CPlusObject, mode); -end; - -procedure TTabView.GetPreferredSize(width : double; height : double); -begin -// BTabView_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TTabView.ResizeToPreferred; -begin - // BTabView_ResizeToPreferred(CPlusObject); -end; - -function TTabView.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - //Result := BTabView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -function TTabView.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - //Result := BTabView_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -procedure TTabView.AddTab(tabContents : TView; tab : TTab); -begin - BTabView_AddTab(CPlusObject, tabContents.CPlusObject, tab.CPlusObject); -end; - -function TTabView.RemoveTab(tabIndex : integer) : TTab; -begin - Result := BTabView_RemoveTab(CPlusObject, tabIndex); -end; - - -function TTabView.TabAt(tabIndex : integer) : TTab; -begin - Result := BTabView_TabAt(CPlusObject, tabIndex); -end; - -procedure TTabView.SetTabWidth(s : Tbutton_width); -begin - BTabView_SetTabWidth(CPlusObject, s); -end; - -function TTabView.TabWidth : Tbutton_width; -begin - Result := BTabView_TabWidth(CPlusObject); -end; - -procedure TTabView.SetTabHeight(height : double); -begin - BTabView_SetTabHeight(CPlusObject, height); -end; - -function TTabView.TabHeight : double; -begin - Result := BTabView_TabHeight(CPlusObject); -end; - -function TTabView.ContainerView : TView; -begin - Result := BTabView_ContainerView(CPlusObject); -end; - -function TTabView.CountTabs : integer; -begin - Result := BTabView_CountTabs(CPlusObject); -end; - -function TTabView.ViewForTab(tabIndex : integer) : TView; -begin - Result := BTabView_ViewForTab(CPlusObject, tabIndex); -end; - -// Hook - -procedure BTabView_AddTab_hook_func(tabw : TTabView; target : TCPlusObject; tab : TCPlusObject); cdecl; -Var targetv : TView; - tabtab : TTab; -begin - targetv:=TView.Wrap(target); - tabtab:=TTab.Wrap(tab); - if Tabw <> nil Then Tabw.AddTab(targetv,tabtab); - targetv.UnWrap; - tabtab.UNWrap; -end; - -procedure BTabView_Draw_hook_func(tabw : TTabView; updaterect : TCPlusObject);cdecl; -var rect : TRect; -begin - rect:=TRect.Wrap(updaterect); - if tabw <> nil then tabw.draw(rect); - rect.UnWrap; -end; - -procedure BTabView_DrawBox_hook_func(tabw : TTabView; updaterect : TCPlusObject);cdecl; -var rect : TRect; -begin - rect:=TRect.Wrap(updaterect); - if tabw <> nil then tabw.drawBox(rect); - rect.UnWrap; -end; - -procedure BTabView_DrawTabs_hook_func(tabw : TTabView);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/bepascal/be/interface/textcontrol.pp b/bepascal/bepascal/be/interface/textcontrol.pp deleted file mode 100644 index 60b8c6e..0000000 --- a/bepascal/bepascal/be/interface/textcontrol.pp +++ /dev/null @@ -1,434 +0,0 @@ -{ 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 - TTextControl = class(TControl) - private - public - destructor Destroy;override; - constructor Create(frame : TRect; name, aLabel,initial : PChar; message : TMessage; resizingMode, flags : Cardinal); virtual; - constructor Create(data : TMessage);override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure SetText(texte : PChar); - function Text : PChar; - procedure SetValue(valu : integer); - function Invoke(msg : TMessage) : TStatus_t; - function TextView : TTextControl; - procedure SetModificationMessage(message : TMessage); - function ModificationMessage : TMessage; - procedure SetAlignment(alabel : TAlignment; texte : TAlignment); - procedure GetAlignment(alabel : TAlignment; texte : TAlignment); - procedure SetDivider(dividing_line : single); - function Divider : single; - procedure Draw(updateRect : TRect);override; - procedure MouseDown(where : TPoint);override; - procedure AttachedToWindow;override; - procedure MakeFocus(focusState : boolean);override; - procedure SetEnabled(state : boolean); - procedure FrameMoved(new_position : TPoint);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 : TMessage);override; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - procedure MouseUp(pt : TPoint);override; - procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);override; - procedure DetachedFromWindow;override; - procedure AllAttached;override; - procedure AllDetached;override; - function GetSupportedSuites(data : TMessage) : TStatus_t; - procedure SetFlags(flags : Cardinal); - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - { procedure _ReservedTextControl1; - procedure _ReservedTextControl2; - procedure _ReservedTextControl3; - procedure _ReservedTextControl4; - function operator=( : TTextControl) : TTextControl; - procedure CommitValue; - procedure InitData(label : PChar; initial_text : PChar; data : TMessage); - 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) : TArchivable; cdecl; external BePascalLibName name 'BTextControl_Instantiate'; -function BTextControl_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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) : TStatus_t; cdecl; external BePascalLibName name 'BTextControl_Invoke'; -function BTextControl_TextView(AObject : TCPlusObject) : TTextControl; cdecl; external BePascalLibName name 'BTextControl_TextView'; -procedure BTextControl_SetModificationMessage(AObject : TCPlusObject; message : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_SetModificationMessage'; -function BTextControl_ModificationMessage(AObject : TCPlusObject) : TMessage; cdecl; external BePascalLibName name 'BTextControl_ModificationMessage'; -procedure BTextControl_SetAlignment(AObject : TCPlusObject; alabel : TAlignment; texte : TAlignment); cdecl; external BePascalLibName name 'BTextControl_SetAlignment'; -procedure BTextControl_GetAlignment(AObject : TCPlusObject; alabel : TAlignment; texte : TAlignment); 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) : THandler; 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) : TStatus_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 : TPerform_code; arg : Pointer) : TStatus_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; : TTextControl) : TTextControl; 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 : TMessage); 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 TTextControl.Destroy; -begin - BTextControl_Free(CPlusObject); - inherited; -end; - -constructor TTextControl.Create(frame : TRect; name, aLabel,initial : PChar; message : TMessage; resizingMode, flags : Cardinal); -begin - CreatePas; - CPlusObject := BTextControl_Create(Self, frame.CPlusObject, name, aLabel,initial, message.CPlusObject, resizingMode, flags); -end; - - -constructor TTextControl.Create(data : TMessage); -begin - CreatePas; - CPlusObject := BTextControl_Create(Self, data.CPlusObject); -end; - -function TTextControl.Instantiate(data : TMessage) : TArchivable; -begin - Result := BTextControl_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TTextControl.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BTextControl_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TTextControl.SetText(texte : PChar); -begin - BTextControl_SetText(CPlusObject, texte); -end; - -function TTextControl.Text : PChar; -begin - Result := BTextControl_Text(CPlusObject); -end; - -procedure TTextControl.SetValue(valu : integer); -begin - BTextControl_SetValue(CPlusObject, valu); -end; - -function TTextControl.Invoke(msg : TMessage) : TStatus_t; -begin - Result := BTextControl_Invoke(CPlusObject, msg.CPlusObject); -end; - -function TTextControl.TextView : TTextControl; -begin - Result := BTextControl_TextView(CPlusObject); -end; - -procedure TTextControl.SetModificationMessage(message : TMessage); -begin - BTextControl_SetModificationMessage(CPlusObject, message.CPlusObject); -end; - -function TTextControl.ModificationMessage : TMessage; -begin - Result := BTextControl_ModificationMessage(CPlusObject); -end; - -procedure TTextControl.SetAlignment(alabel : TAlignment; texte : TAlignment); -begin - BTextControl_SetAlignment(CPlusObject, alabel, texte); -end; - -procedure TTextControl.GetAlignment(alabel : TAlignment; texte : TAlignment); -begin - BTextControl_GetAlignment(CPlusObject, alabel, texte); -end; - -procedure TTextControl.SetDivider(dividing_line : single); -begin - BTextControl_SetDivider(CPlusObject, dividing_line); -end; - -function TTextControl.Divider : single; -begin - Result := BTextControl_Divider(CPlusObject); -end; - -procedure TTextControl.Draw(updateRect : TRect); -begin -end; - -procedure TTextControl.MouseDown(where : TPoint); -begin -end; - -procedure TTextControl.AttachedToWindow; -begin -end; - -procedure TTextControl.MakeFocus(focusState : boolean); -begin - BTextControl_MakeFocus(CPlusObject, focusState); -end; - -procedure TTextControl.SetEnabled(state : boolean); -begin - BTextControl_SetEnabled(CPlusObject, state); -end; - -procedure TTextControl.FrameMoved(new_position : TPoint); -begin -end; - -procedure TTextControl.FrameResized(new_width : double; new_height : double); -begin -// BTextControl_FrameResized(CPlusObject, new_width, new_height); -end; - -procedure TTextControl.WindowActivated(active : boolean); -begin - //BTextControl_WindowActivated(CPlusObject, active); -end; - -procedure TTextControl.GetPreferredSize(width : double; height : double); -begin - //BTextControl_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TTextControl.ResizeToPreferred; -begin - //BTextControl_ResizeToPreferred(CPlusObject); -end; - -procedure TTextControl.MessageReceived(msg : TMessage); -begin - //BTextControl_MessageReceived(CPlusObject, msg.CPlusObject); -end; - -function TTextControl.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - Result := BTextControl_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -procedure TTextControl.MouseUp(pt : TPoint); -begin - //BTextControl_MouseUp(CPlusObject, pt.CPlusObject); -end; - -procedure TTextControl.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); -begin - //BTextControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); -end; - -procedure TTextControl.DetachedFromWindow; -begin - //BTextControl_DetachedFromWindow(CPlusObject); -end; - -procedure TTextControl.AllAttached; -begin - //BTextControl_AllAttached(CPlusObject); -end; - -procedure TTextControl.AllDetached; -begin - //BTextControl_AllDetached(CPlusObject); -end; - -function TTextControl.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - - Result := BTextControl_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -procedure TTextControl.SetFlags(flags : Cardinal); -begin - BTextControl_SetFlags(CPlusObject, flags); -end; - -function TTextControl.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BTextControl_Perform(CPlusObject, d, arg); -end; - -{procedure TTextControl._ReservedTextControl1; -begin - BTextControl__ReservedTextControl1(CPlusObject); -end; - -procedure TTextControl._ReservedTextControl2; -begin - BTextControl__ReservedTextControl2(CPlusObject); -end; - -procedure TTextControl._ReservedTextControl3; -begin - BTextControl__ReservedTextControl3(CPlusObject); -end; - -procedure TTextControl._ReservedTextControl4; -begin - BTextControl__ReservedTextControl4(CPlusObject); -end; - -function TTextControl.operator=( : TTextControl) : TTextControl; -begin - Result := BTextControl_operator=(CPlusObject, ); -end; - -procedure TTextControl.CommitValue; -begin - BTextControl_CommitValue(CPlusObject); -end; - -procedure TTextControl.InitData(label : PChar; initial_text : PChar; data : TMessage); -begin - BTextControl_InitData(CPlusObject, label, initial_text, data.CPlusObject); -end; - -procedure TTextControl._BTextInput_ *fText; -begin - BTextControl__BTextInput_ *fText(CPlusObject); -end; - -procedure TTextControl.char *fLabel; -begin - BTextControl_char *fLabel(CPlusObject); -end; - -procedure TTextControl.BMessage *fModificationMessage; -begin - BTextControl_BMessage *fModificationMessage(CPlusObject); -end; - -procedure TTextControl.alignment fLabelAlign; -begin - BTextControl_alignment fLabelAlign(CPlusObject); -end; - -procedure TTextControl.float fDivider; -begin - BTextControl_float fDivider(CPlusObject); -end; - -procedure TTextControl.uint16 fPrevWidth; -begin - BTextControl_uint16 fPrevWidth(CPlusObject); -end; - -procedure TTextControl.uint16 fPrevHeight; -begin - BTextControl_uint16 fPrevHeight(CPlusObject); -end; - -procedure TTextControl.uint32 _reserved[3]; -begin - BTextControl_uint32 _reserved[3](CPlusObject); -end; - -procedure TTextControl.uint32 _more_reserved[4]; -begin - BTextControl_uint32 _more_reserved[4](CPlusObject); -end; - -procedure TTextControl.bool fClean; -begin - BTextControl_bool fClean(CPlusObject); -end; - -procedure TTextControl.bool fSkipSetFlags; -begin - BTextControl_bool fSkipSetFlags(CPlusObject); -end; - -procedure TTextControl.bool fUnusedBool1; -begin - BTextControl_bool fUnusedBool1(CPlusObject); -end; - -procedure TTextControl.bool fUnusedBool2; -begin - BTextControl_bool fUnusedBool2(CPlusObject); -end; -} - -end. diff --git a/bepascal/bepascal/be/interface/textview.pp b/bepascal/bepascal/be/interface/textview.pp deleted file mode 100644 index dc8f144..0000000 --- a/bepascal/bepascal/be/interface/textview.pp +++ /dev/null @@ -1,850 +0,0 @@ -{ 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 - Ttext_run = Record - offset : LongInt; - font : TFont; - color : Trgb_color; -end; - -type - Ttext_run_array = Record - count : LongInt; - runs : Array[1..1] of Ttext_run ; - end; - -type -Tundo_state =(undo_state_nil, - B_UNDO_UNAVAILABLE, - B_UNDO_TYPING, - B_UNDO_CUT, - B_UNDO_PASTE, - B_UNDO_CLEAR, - B_UNDO_DROP); - -type - TTextView = class(TView) - private - public - constructor Create(frame : TRect; name : pchar;atextRect: TRect ; resizeMask, flags : cardinal); virtual; -// constructor Create(bounds : TRect; name : pchar; texte : pchar; resizeflags, flags : cardinal); virtual; - constructor Create(data : TMessage);virtual; - destructor Destroy;override; - function Instantiate(data : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure AttachedToWindow;override; - procedure DetachedFromWindow;override; - procedure Draw(inRect : TRect);override; - procedure MouseDown(where : TPoint);override; - procedure MouseUp(where : TPoint);override; - procedure MouseMoved(where : TPoint; code : Cardinal; message : TMessage);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 : TMessage);override; - function ResolveSpecifier(message : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - procedure SetText(inText : PChar; var inRuns : Ttext_run_array); - procedure SetText(inText : PChar; inLength : integer; var inRuns : Ttext_run_array); -// procedure SetText(inFile : TFile; startOffset : integer; inLength : integer; var inRuns : Ttext_run_array); - procedure Insert(inText : PChar; var inRuns : Ttext_run_array); - procedure Insert(inText : PChar; inLength : integer; var inRuns : Ttext_run_array); - procedure Insert(startOffset : integer; inText : PChar; inLength : integer;var inRuns : Ttext_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 : TMessage) : boolean; - procedure Select(startOffset : integer; endOffset : integer); - procedure SelectAll; -// procedure GetSelection(outStart : integer; outEnd : integer); - procedure SetFontAndColor(inFont : TFont; inMode : Cardinal; var inColor : TRGB_color); -// procedure SetFontAndColor(inFont : TFont; inMode : Cardinal); -// procedure SetFontAndColor(inFont : TFont); - procedure SetFontAndColor(startOffset : Cardinal; endOffset : Cardinal; inFont : TFont; inMode : Cardinal; var inColor : Trgb_color); - procedure GetFontAndColor(inOffset : integer; outFont : TFont; outColor : Trgb_color); - procedure GetFontAndColor(outFont : TFont; outMode : integer; outColor : Trgb_color; outEqColor : boolean); -{ procedure SetRunArray(startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array); - function RunArray(startOffset : integer; endOffset : integer; outSize : ^integer) : Ttext_run_array; -} function LineAt(offset : integer) : integer; - function LineAt(point : TPoint) : integer; - function PointAt(inOffset : integer; outHeight : double) : TPoint; - function OffsetAt(point : TPoint) : 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 SetTextRect(rect : TRect); - function TextRect : TRect; - 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 SetAlignment(flag : Talignment); - function Alignment : Talignment; - procedure SetAutoindent(state : boolean); - function DoesAutoindent : boolean; -{ procedure SetColorSpace(colors : TColor_Space); - function ColorSpace : TColor_Space; -} procedure MakeResizable(resize : boolean; resizeView : TView); - 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) : Ttext_run_array; - procedure InsertText(inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array); -} - // procedure Undo(clipboard : TClipboard); -// procedure GetDragParameters(drag : TMessage; bitmap : TBitmap; point : TPoint; handler : THandler); -// procedure InitObject(atextRect : TRect; initialFont : TFont; initialColor : Trgb_color); - end; - -function BTextView_Create(AObject : TBeObject;frame : TCPlusObject; name : pchar; atextRect: 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) : TArchivable; cdecl; external BePascalLibName name 'BTextView_Instantiate'; -function BTextView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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) : THandler; cdecl; external BePascalLibName name 'BTextView_ResolveSpecifier'; -function BTextView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BTextView_GetSupportedSuites'; -function BTextView_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BTextView_Perform'; -procedure BTextView_SetText(AObject : TCPlusObject; inText : PChar;var inRuns : Ttext_run_array); cdecl; external BePascalLibName name 'BTextView_SetText'; -procedure BTextView_SetText(AObject : TCPlusObject; inText : PChar; inLength : integer;var inRuns : Ttext_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 : Ttext_run_array); cdecl; external BePascalLibName name 'BTextView_Insert'; -procedure BTextView_Insert(AObject : TCPlusObject; inText : PChar; inLength : integer;var inRuns : Ttext_run_array); cdecl; external BePascalLibName name 'BTextView_Insert_1'; -procedure BTextView_Insert(AObject : TCPlusObject; startOffset : integer; inText : PChar; inLength : integer;var inRuns : Ttext_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_SetFontAndColor(AObject : TCPlusObject; inFont : TCPlusObject; inMode : Cardinal; var inColor : Trgb_color); cdecl; external BePascalLibName name 'BTextView_SetFontAndColor'; -//procedure BTextView_SetFontAndColor(AObject : TCPlusObject; inFont : TCPlusObject; inMode : Cardinal); cdecl; external BePascalLibName name 'BTextView_SetFontAndColor_1'; -//procedure BTextView_SetFontAndColor(AObject : TCPlusObject; inFont : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_SetFontAndColor_1'; -procedure BTextView_SetFontAndColor(AObject : TCPlusObject; startOffset : cardinal; endOffset : cardinal; inFont : TCPlusObject; inMode : Cardinal; var inColor : Trgb_color); cdecl; external BePascalLibName name 'BTextView_SetFontAndColor_1'; -procedure BTextView_GetFontAndColor(AObject : TCPlusObject; inOffset : cardinal; outFont : TCPlusObject; outColor : Trgb_color); cdecl; external BePascalLibName name 'BTextView_GetFontAndColor'; -procedure BTextView_GetFontAndColor(AObject : TCPlusObject; outFont : TCPlusObject; outMode : integer; outColor : Trgb_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) : Ttext_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) : TPoint; 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_SetTextRect(AObject : TCPlusObject; rect : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_SetTextRect'; -function BTextView_TextRect(AObject : TCPlusObject) : TRect; 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_SetAlignment(AObject : TCPlusObject; flag : Talignment); cdecl; external BePascalLibName name 'BTextView_SetAlignment'; -function BTextView_Alignment(AObject : TCPlusObject) : Talignment; 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) : Ttext_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 : TMessage; bitmap : TBitmap; point : TPoint; handler : THandler); 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; textRect : TRect; initialFont : TFont; initialColor : Trgb_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 : TPoint) : boolean; cdecl; external BePascalLibName name 'BTextView_PerformMouseUp'; -function BTextView_PerformMouseMoved(AObject : TCPlusObject; where : TPoint; code : Cardinal) : boolean; cdecl; external BePascalLibName name 'BTextView_PerformMouseMoved'; -procedure BTextView_TrackMouse(AObject : TCPlusObject; where : TPoint; message : TMessage; force : boolean); cdecl; external BePascalLibName name 'BTextView_TrackMouse'; -procedure BTextView_TrackDrag(AObject : TCPlusObject; where : TPoint); cdecl; external BePascalLibName name 'BTextView_TrackDrag'; -procedure BTextView_InitiateDrag(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_InitiateDrag'; -function BTextView_MessageDropped(AObject : TCPlusObject; inMessage : TMessage; where : TPoint; offset : TPoint) : 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 : TFont); 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 : TMessage; form : integer; property : PChar; reply : TMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_GetProperty'; -function BTextView_SetProperty(AObject : TCPlusObject; specifier : TMessage; form : integer; properti : PChar; reply : TMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_SetProperty'; -function BTextView_CountProperties(AObject : TCPlusObject; specifier : TMessage; form : integer; properti : PChar; reply : TMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_CountProperties'; -procedure BTextView_HandleInputMethodChanged(AObject : TCPlusObject; message : TMessage); 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 TTextView.Create(frame : TRect; name : pchar;atextRect: TRect ; resizeMask, flags : cardinal); -begin - CreatePas; - CPlusObject := BTextView_Create(Self, frame.CplusObject,name,atextRect.CPlusObject,resizeMask,flags); -end; - -constructor TTextView.Create(data : TMessage); -begin - CreatePas; - CPlusObject := BTextView_Create(Self, data.CPlusObject); -end; - -destructor TTextView.Destroy; -begin - BTextView_Free(CPlusObject); - inherited; -end; - -function TTextView.Instantiate(data : TMessage) : TArchivable; -begin - Result := BTextView_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TTextView.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BTextView_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TTextView.AttachedToWindow; -begin -// BTextView_AttachedToWindow(CPlusObject); -end; - -procedure TTextView.DetachedFromWindow; -begin -// BTextView_DetachedFromWindow(CPlusObject); -end; - -procedure TTextView.Draw(inRect : TRect); -begin - // BTextView_Draw(CPlusObject, inRect.CPlusObject); -end; - -procedure TTextView.MouseDown(where : TPoint); -begin -// BTextView_MouseDown(CPlusObject, where.CPlusObject); -end; - -procedure TTextView.MouseUp(where : TPoint); -begin - //BTextView_MouseUp(CPlusObject, where.CPlusObject); -end; - -procedure TTextView.MouseMoved(where : TPoint; code : Cardinal; message : TMessage); -begin - //BTextView_MouseMoved(CPlusObject, where.CPlusObject, code, message); -end; - -procedure TTextView.WindowActivated(state : boolean); -begin - //BTextView_WindowActivated(CPlusObject, state); -end; - -procedure TTextView.KeyDown(bytes : PChar; numBytes : integer); -begin - //writeln('keydown textview'); - //BTextView_KeyDown(CPlusObject, bytes, numBytes); -end; - -procedure TTextView.Pulse; -begin - //BTextView_Pulse(CPlusObject); -end; - -procedure TTextView.FrameResized(width : double; height : double); -begin - // BTextView_FrameResized(CPlusObject, width, height); -end; - -procedure TTextView.MakeFocus(focusState : boolean); -begin - BTextView_MakeFocus(CPlusObject, focusState); -end; - -procedure TTextView.MessageReceived(message : TMessage); -begin - inherited; -// BTextView_MessageReceived(CPlusObject, message.CPlusObject); -end; - -function TTextView.ResolveSpecifier(message : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; -begin - //Result := BTextView_ResolveSpecifier(CPlusObject, message.CPlusObject, index, specifier.CPlusObject, form, properti); -end; - -function TTextView.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BTextView_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TTextView.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BTextView_Perform(CPlusObject, d, arg); -end; - -procedure TTextView.SetText(inText : PChar; var inRuns : Ttext_run_array); -begin - BTextView_SetText(CPlusObject, inText, inRuns); -end; - -procedure TTextView.SetText(inText : PChar; inLength : integer; var inRuns : Ttext_run_array); -begin - BTextView_SetText(CPlusObject, inText, inLength, inRuns); -end; - -{procedure TTextView.SetText(inFile : TFile; startOffset : integer; inLength : integer; inRuns : Ttext_run_array); -begin - BTextView_SetText(CPlusObject, inFile.CPlusObject, startOffset, inLength, inRuns); -end; -} -procedure TTextView.Insert(inText : PChar;var inRuns : Ttext_run_array); -begin - BTextView_Insert(CPlusObject, inText, inRuns); -end; - -procedure TTextView.Insert(inText : PChar; inLength : integer; var inRuns : Ttext_run_array); -begin - BTextView_Insert(CPlusObject, inText, inLength, inRuns); -end; - -procedure TTextView.Insert(startOffset : integer; inText : PChar; inLength : integer; var inRuns : Ttext_run_array); -begin - BTextView_Insert(CPlusObject, startOffset, inText, inLength, inRuns); -end; - -procedure TTextView.Delete; -begin - BTextView_Delete(CPlusObject); -end; - -procedure TTextView.Delete(startOffset : integer; endOffset : integer); -begin - BTextView_Delete(CPlusObject, startOffset, endOffset); -end; - -function TTextView.aText : PChar; -begin - Result := BTextView_Text(CPlusObject); -end; - -function TTextView.TextLength : integer; -begin - Result := BTextView_TextLength(CPlusObject); -end; - -procedure TTextView.GetText(offset : integer; length : integer; buffer : PChar); -begin - BTextView_GetText(CPlusObject, offset, length, buffer); -end; - -function TTextView.ByteAt(offset : integer) : PChar; -begin - Result := BTextView_ByteAt(CPlusObject, offset); -end; - -function TTextView.CountLines : integer; -begin - Result := BTextView_CountLines(CPlusObject); -end; - -function TTextView.CurrentLine : integer; -begin - Result := BTextView_CurrentLine(CPlusObject); -end; - -procedure TTextView.GoToLine(lineNum : integer); -begin - BTextView_GoToLine(CPlusObject, lineNum); -end; - -{procedure TTextView.Cut(clipboard : TClipboard); -begin - BTextView_Cut(CPlusObject, clipboard.CPlusObject); -end; - -procedure TTextView.Copy(clipboard : TClipboard); -begin - BTextView_Copy(CPlusObject, clipboard.CPlusObject); -end; - -procedure TTextView.Paste(clipboard : TClipboard); -begin - BTextView_Paste(CPlusObject, clipboard.CPlusObject); -end; - -procedure TTextView.Clear; -begin - BTextView_Clear(CPlusObject); -end; - -function TTextView.AcceptsPaste(clipboard : TClipboard) : boolean; -begin - Result := BTextView_AcceptsPaste(CPlusObject, clipboard.CPlusObject); -end; -} -function TTextView.AcceptsDrop(inMessage : TMessage) : boolean; -begin - Result := BTextView_AcceptsDrop(CPlusObject, inMessage); -end; - -procedure TTextView.Select(startOffset : integer; endOffset : integer); -begin - BTextView_Select(CPlusObject, startOffset, endOffset); -end; - -procedure TTextView.SelectAll; -begin - BTextView_SelectAll(CPlusObject); -end; - -{procedure TTextView.GetSelection(outStart : integer; outEnd : integer); -begin - BTextView_GetSelection(CPlusObject, outStart, outEnd); -end; -} -procedure TTextView.SetFontAndColor(inFont : TFont; inMode : Cardinal; var inColor : Trgb_color); -begin - BTextView_SetFontAndColor(CPlusObject, inFont.CPlusObject, inMode, inColor); -end; - -//procedure TTextView.SetFontAndColor(inFont : TFont; inMode : Cardinal); -//begin -// BTextView_SetFontAndColor(CPlusObject, inFont.CPlusObject, inMode); -//end; - -//procedure TTextView.SetFontAndColor(inFont : TFont); -//begin -// BTextView_SetFontAndColor(CPlusObject, inFont.CPlusObject); -//end; - -procedure TTextView.SetFontAndColor(startOffset : cardinal; endOffset : cardinal; inFont : TFont; inMode : Cardinal; var inColor : Trgb_color); -begin - BTextView_SetFontAndColor(CPlusObject, startOffset, endOffset, inFont.CPlusObject, inMode, inColor); -end; - -procedure TTextView.GetFontAndColor(inOffset : integer; outFont : TFont; outColor : Trgb_color); -begin - BTextView_GetFontAndColor(CPlusObject, inOffset, outFont.CPlusObject, outColor); -end; - -procedure TTextView.GetFontAndColor(outFont : TFont; outMode : integer; outColor : Trgb_color; outEqColor : boolean); -begin - BTextView_GetFontAndColor(CPlusObject, outFont.CPlusObject, outMode, outColor, outEqColor); -end; -{ -procedure TTextView.SetRunArray(startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array); -begin - BTextView_SetRunArray(CPlusObject, startOffset, endOffset, inRuns); -end; - -function TTextView.RunArray(startOffset : integer; endOffset : integer; outSize : ^integer) : Ttext_run_array; -begin - Result := BTextView_RunArray(CPlusObject, startOffset, endOffset, outSize); -end; -} -function TTextView.LineAt(offset : integer) : integer; -begin - Result := BTextView_LineAt(CPlusObject, offset); -end; - -function TTextView.LineAt(point : TPoint) : integer; -begin - Result := BTextView_LineAt(CPlusObject, point.CPlusObject); -end; - -function TTextView.PointAt(inOffset : integer; outHeight : double) : TPoint; -begin - Result := BTextView_PointAt(CPlusObject, inOffset, outHeight); -end; - -function TTextView.OffsetAt(point : TPoint) : integer; -begin - Result := BTextView_OffsetAt(CPlusObject, point.CPlusObject); -end; - -function TTextView.OffsetAt(line : integer) : integer; -begin - Result := BTextView_OffsetAt(CPlusObject, line); -end; - -procedure TTextView.FindWord(inOffset : integer; outFromOffset : integer; outToOffset : integer); -begin - BTextView_FindWord(CPlusObject, inOffset, outFromOffset, outToOffset); -end; - -function TTextView.CanEndLine(offset : integer) : boolean; -begin - Result := BTextView_CanEndLine(CPlusObject, offset); -end; - -function TTextView.LineWidth(lineNum : integer) : double; -begin - Result := BTextView_LineWidth(CPlusObject, lineNum); -end; - -function TTextView.LineHeight(lineNum : integer) : double; -begin - Result := BTextView_LineHeight(CPlusObject, lineNum); -end; - -function TTextView.TextHeight(startLine : integer; endLine : integer) : double; -begin - Result := BTextView_TextHeight(CPlusObject, startLine, endLine); -end; - -{procedure TTextView.GetTextRegion(startOffset : integer; endOffset : integer; outRegion : TRegion); -begin - BTextView_GetTextRegion(CPlusObject, startOffset, endOffset, outRegion.CPlusObject); -end; -} -procedure TTextView.ScrollToOffset(inOffset : integer); -begin - BTextView_ScrollToOffset(CPlusObject, inOffset); -end; - -procedure TTextView.ScrollToSelection; -begin - BTextView_ScrollToSelection(CPlusObject); -end; - -procedure TTextView.Highlight(startOffset : integer; endOffset : integer); -begin - BTextView_Highlight(CPlusObject, startOffset, endOffset); -end; - -procedure TTextView.SetTextRect(rect : TRect); -begin - BTextView_SetTextRect(CPlusObject, rect.CPlusObject); -end; - -function TTextView.TextRect : TRect; -begin - Result := BTextView_TextRect(CPlusObject); -end; - -procedure TTextView.SetStylable(stylable : boolean); -begin - BTextView_SetStylable(CPlusObject, stylable); -end; - -function TTextView.IsStylable : boolean; -begin - Result := BTextView_IsStylable(CPlusObject); -end; - -procedure TTextView.SetTabWidth(width : double); -begin - BTextView_SetTabWidth(CPlusObject, width); -end; - -function TTextView.TabWidth : double; -begin - Result := BTextView_TabWidth(CPlusObject); -end; - -procedure TTextView.MakeSelectable(selectable : boolean); -begin - BTextView_MakeSelectable(CPlusObject, selectable); -end; - -function TTextView.IsSelectable : boolean; -begin - Result := BTextView_IsSelectable(CPlusObject); -end; - -procedure TTextView.MakeEditable(editable : boolean); -begin - BTextView_MakeEditable(CPlusObject, editable); -end; - -function TTextView.IsEditable : boolean; -begin - Result := BTextView_IsEditable(CPlusObject); -end; - -procedure TTextView.SetWordWrap(awrap : boolean); -begin - BTextView_SetWordWrap(CPlusObject, awrap); -end; - -function TTextView.DoesWordWrap : boolean; -begin - Result := BTextView_DoesWordWrap(CPlusObject); -end; - -procedure TTextView.SetMaxBytes(max : integer); -begin - BTextView_SetMaxBytes(CPlusObject, max); -end; - -function TTextView.MaxBytes : integer; -begin - Result := BTextView_MaxBytes(CPlusObject); -end; - -procedure TTextView.DisallowChar(aChar : Cardinal); -begin - BTextView_DisallowChar(CPlusObject, aChar); -end; - -procedure TTextView.AllowChar(aChar : Cardinal); -begin - BTextView_AllowChar(CPlusObject, aChar); -end; - -procedure TTextView.SetAlignment(flag : Talignment); -begin - BTextView_SetAlignment(CPlusObject, flag); -end; - -function TTextView.Alignment : Talignment; -begin - Result := BTextView_Alignment(CPlusObject); -end; - -procedure TTextView.SetAutoindent(state : boolean); -begin - BTextView_SetAutoindent(CPlusObject, state); -end; - -function TTextView.DoesAutoindent : boolean; -begin - Result := BTextView_DoesAutoindent(CPlusObject); -end; - -{procedure TTextView.SetColorSpace(colors : TColor_Space); -begin - BTextView_SetColorSpace(CPlusObject, colors); -end; - -function TTextView.ColorSpace : TColor_Space; -begin - Result := BTextView_ColorSpace(CPlusObject); -end; -} -procedure TTextView.MakeResizable(resize : boolean; resizeView : TView); -begin - BTextView_MakeResizable(CPlusObject, resize, resizeView.CPlusObject); -end; - -function TTextView.IsResizable : boolean; -begin - Result := BTextView_IsResizable(CPlusObject); -end; - -procedure TTextView.SetDoesUndo(undo : boolean); -begin - BTextView_SetDoesUndo(CPlusObject, undo); -end; - -function TTextView.DoesUndo : boolean; -begin - Result := BTextView_DoesUndo(CPlusObject); -end; - -procedure TTextView.HideTyping(enabled : boolean); -begin - BTextView_HideTyping(CPlusObject, enabled); -end; - -function TTextView.IsTypingHidden : boolean; -begin - Result := BTextView_IsTypingHidden(CPlusObject); -end; - -procedure TTextView.ResizeToPreferred; -begin - BTextView_ResizeToPreferred(CPlusObject); -end; - -procedure TTextView.GetPreferredSize(width : double; height : double); -begin - BTextView_GetPreferredSize(CPlusObject, width, height); -end; - -procedure TTextView.AllAttached; -begin - BTextView_AllAttached(CPlusObject); -end; - -procedure TTextView.AllDetached; -begin - BTextView_AllDetached(CPlusObject); -end; - -{function TTextView.FlattenRunArray(inArray : Ttext_tun_array; outSize : integer) : Pointer; -begin - Result := BTextView_FlattenRunArray(CPlusObject, inArray, outSize); -end; - - -function TTextView.UnflattenRunArray(data : Pointer; outSize : integer) : Ttext_run_array; -begin - Result := BTextView_UnflattenRunArray(CPlusObject, data, outSize); -end; - -procedure TTextView.InsertText(inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array); -begin - BTextView_InsertText(CPlusObject, inText, inLength, inOffset, inRuns); -end; -} - -{procedure TTextView.Undo(clipboard : TClipboard); -begin - BTextView_Undo(CPlusObject, clipboard.CPlusObject); -end; - -function TTextView.UndoState(isRedo : boolean) : Tundo_state; -begin - Result := BTextView_UndoState(CPlusObject, isRedo); -end; - -procedure TTextView.GetDragParameters(drag : TMessage; bitmap : TBitmap; point : TPoint; handler : THandler); -begin - BTextView_GetDragParameters(CPlusObject, drag.CPlusObject, bitmap.CPlusObject, point.CPlusObject, handler.CPlusObject); -end; -} - - -end. diff --git a/bepascal/bepascal/be/interface/view.h b/bepascal/bepascal/be/interface/view.h deleted file mode 100644 index 7ab677f..0000000 --- a/bepascal/bepascal/be/interface/view.h +++ /dev/null @@ -1,78 +0,0 @@ -/* 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/bepascal/be/interface/view.pp b/bepascal/bepascal/be/interface/view.pp deleted file mode 100644 index 0714208..0000000 --- a/bepascal/bepascal/be/interface/view.pp +++ /dev/null @@ -1,519 +0,0 @@ -{ 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 View; - -interface - -uses - beobj, handler, rect, os, application, appdefs, message, - graphicdefs, fdblib; - -type -// TWindow = class(TBeObject); - TView = class(THandler) - public - constructor Create(frame : TRect; 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 : TRect); virtual; - procedure DrawAfterChildren(updateRect : TRect); virtual; - procedure FrameMoved(parentPoint : TPoint); 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 : TPoint); virtual; - procedure MouseMoved(point : TPoint; transit : Cardinal; message : TMessage); virtual; - procedure MouseUp(point : TPoint); virtual; - procedure Pulse; virtual; -// procedure TargetedByScrollView(scroller : TScrollView); virtual; // Need BScrollView - procedure WindowActivated(active : boolean); virtual; - procedure MessageReceived(aMessage : TMessage); override; - // End hook functions - function RemoveSelf : boolean; - procedure AddChild(aView, before : TView); - function RemoveChild(aView : TView) : boolean; - function CountChildren : integer; - function ChildAt(index : integer) : TView; - function NextSibling : TView; - function PreviousSibling : TView; -// function Window : TWindow; - procedure SetViewColor(rgb_color : TRGB_color); - 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_SetViewColor(CPlusObject : TCPlusObject; c : TRGB_color); cdecl; external BePascalLibName name 'BView_SetViewColor'; - -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 TView.Create(frame : TRect; name : PChar; resizingMode, flags : Cardinal); -begin - inherited Create; - CPlusObject := BView_Create(Self, frame.CPlusObject, name, resizingMode, flags); -end; - -destructor TView.Destroy; -begin - BView_Free(Self.CPlusObject); - inherited; -end; - -// Hook functions -procedure TView.AllAttached; -begin -end; - -procedure TView.AllDetached; -begin -end; - -procedure TView.AttachedToWindow; -begin -end; - -procedure TView.DetachedFromWindow; -begin -end; - -procedure TView.Draw(updateRect : TRect); -begin - SendText('Drawing view'); - -end; - -procedure TView.DrawAfterChildren(updateRect : TRect); -begin -end; - -procedure TView.FrameMoved(parentPoint : TPoint); -begin -end; - -procedure TView.FrameResized(width, height : double); -begin -end; - -procedure TView.GetPreferredSize(var width : double; var height : double); -begin -end; - -procedure TView.ResizeToPreferred; -begin -end; - -procedure TView.KeyDown(bytes : PChar; numBytes : integer); -begin -end; - -procedure TView.KeyUp(bytes : PChar; numBytes : integer); -begin -end; - -procedure TView.MouseDown(point : TPoint); -begin -end; - -procedure TView.MouseMoved(point : TPoint; transit : Cardinal; message : TMessage); -begin -end; - -procedure TView.MouseUp(point : TPoint); -begin -end; - -procedure TView.Pulse; -begin -end; - -// procedure TView.TargetedByScrollView(); // Need BScrollView -//begin -//end; - -procedure TView.WindowActivated(active : boolean); -begin -end; - -procedure TView.MessageReceived(aMessage : TMessage); -begin - inherited; -end; - -function TView.RemoveSelf : boolean; -begin - Result := BView_RemoveSelf(Self.CPlusObject); -end; - -procedure TView.AddChild(aView, before : TView); -begin - if before <> nil then - BView_AddChild(Self.CPlusObject, aView.CPlusObject, before.CPlusObject) - else - BView_AddChild(Self.CPlusObject, aView.CPlusObject, nil); -end; - -function TView.RemoveChild(aView : TView) : boolean; -begin - Result := BView_RemoveChild(Self.CPlusObject, aView); -end; - -function TView.CountChildren : integer; -begin - Result := BView_CountChildren(Self.CPlusObject); -end; - -function TView.ChildAt(index : integer) : TView; -begin - Result := TView.Wrap(BView_ChildAt(Self.CPlusObject, index)); -end; - -function TView.NextSibling : TView; -begin - Result := TView.Wrap(BView_NextSibling(Self.CPlusObject)); -end; - -function TView.PreviousSibling : TView; -begin - Result := TView.Wrap(BView_PreviousSibling(Self.CPlusObject)); -end; - -{function TView.Window : TWindow; -begin - Result := TWindow.Wrap(BView_Window(Self.CPlusObject)); -end;} - -procedure TView.SetViewColor(rgb_color : TRGB_color); -begin - BView_SetViewColor(Self.CPlusObject, rgb_color); -end; - -// Hook functions -procedure View_AllAttached_hook_func(View : TView); cdecl; -begin - if View <> nil then - View.AllAttached; -end; - -procedure View_AllDetached_hook_func(View : TView); cdecl; -begin - if View <> nil then - View.AllDetached; -end; - -procedure View_AttachedToWindow_hook_func(View : TView); cdecl; -begin - if View <> nil then - View.AttachedToWindow; -end; - -procedure View_DetachedFromWindow_hook_func(View : TView); cdecl; -begin - if View <> nil then - View.DetachedFromWindow; -end; - -procedure View_Draw_hook_func(View : TView; aRect : TCPlusObject); cdecl; -var - Rect : TRect; -begin - Rect := TRect.Wrap(aRect); - try - if View <> nil then - View.Draw(Rect); - finally - Rect.UnWrap; - end; -end; - -procedure View_DrawAfterChildren_hook_func(View : TView; aRect : TCPlusObject); cdecl; -var - Rect : TRect; -begin - Rect := TRect.Wrap(aRect); - try - if View <> nil then - View.DrawAfterChildren(Rect); - finally - Rect.UnWrap; - end; -end; - -procedure View_FrameMoved_hook_func(View : TView; aPoint : TCPlusObject); cdecl; -var - Point : TPoint; -begin - Point := TPoint.Wrap(aPoint); - try - if View <> nil then - View.FrameMoved(Point); - finally - Point.UnWrap; - end; -end; - -procedure View_FrameResized_hook_func(View : TView; width, height : double); cdecl; -begin - if View <> nil then - View.FrameResized(width, height); -end; - -procedure View_GetPreferredSize_hook_func(View : TView; var width, height : double); cdecl; -begin - if View <> nil then - View.GetPreferredSize(width, height); -end; - -procedure View_ResizeToPreferred_hook_func(View : TView); cdecl; -begin - if View <> nil then - View.ResizeToPreferred; -end; - -procedure View_KeyDown_hook_func(View : TView; bytes : PChar; numBytes : integer); cdecl; -begin - if View <> nil then - View.KeyDown(bytes, numBytes); -end; - -procedure View_KeyUp_hook_func(View : TView; bytes : PChar; numBytes : integer); cdecl; -begin - if View <> nil then - View.KeyUp(bytes, numBytes); -end; - -procedure View_MouseDown_hook_func(View : TView; aPoint : TCPlusObject); cdecl; -var - Point : TPoint; -begin - Point := TPoint.Wrap(aPoint); - try - if View <> nil then - View.MouseDown(Point); - finally - Point.UnWrap; - end; -end; - -procedure View_MouseMoved_hook_func(View : TView; aPoint : TCPlusObject; transit : Cardinal; aMessage : TCPlusObject); cdecl; -var - Point : TPoint; - Message : TMessage; -begin - Point := TPoint.Wrap(aPoint); - try - Message := TMessage.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 : TView; aPoint : TCPlusObject); cdecl; -var - Point : TPoint; -begin - Point := TPoint.Wrap(aPoint); - try - if View <> nil then - View.MouseDown(Point); - finally - Point.UnWrap; - end; -end; - -procedure View_Pulse_hook_func(View : TView); cdecl; -begin - if View <> nil then - View.Pulse; -end; - -//procedure View_TargetedByScrollView_hook_func(View : TView; 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 : TView; 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/bepascal/be/interface/window.h b/bepascal/bepascal/be/interface/window.h deleted file mode 100644 index 72ef636..0000000 --- a/bepascal/bepascal/be/interface/window.h +++ /dev/null @@ -1,46 +0,0 @@ -/* 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/bepascal/be/interface/window.pp b/bepascal/bepascal/be/interface/window.pp deleted file mode 100644 index e13efe0..0000000 --- a/bepascal/bepascal/be/interface/window.pp +++ /dev/null @@ -1,1367 +0,0 @@ -{ 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; - TWindow = class(TLooper) - public - constructor Create(aFrame : TRect; aTitle : PChar; aNewType, SomeFlags, AWorkspaces : Cardinal); virtual; - destructor Destroy; override; - procedure Show; - procedure Hide; - procedure AddChild(aView : TView; sibling : TView); - function QuitRequested : boolean; override; - function RemoveChild(aView : TView) : 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 : TMessage) : TArchivable; - function Archive(data : TMessage; deep : boolean) : TStatus_t; - procedure Quit; -// procedure Close; - // procedure AddChild(child : TView; before : TView); - // function RemoveChild(child : TView) : boolean; - function CountChildren : integer; - function ChildAt(index : integer) : TView; - procedure DispatchMessage(message : TMessage; handler : THandler); override; - procedure MessageReceived(message : TMessage); override; - procedure FrameMoved(new_position : TPoint); - 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 : TPoint; rec_width : double; rec_height : double); - procedure Zoom; - procedure SetZoomLimits(max_h : double; max_v : double); - procedure ScreenChanged(screen_size : TRect; depth : TColor_Space); - procedure SetPulseRate(rate : TBigtime_t); - function PulseRate : TBigtime_t; - procedure AddShortcut(key : Cardinal; modifiers : Cardinal; msg : TMessage); - procedure AddShortcut(key : Cardinal; modifiers : Cardinal; msg : TMessage; target : THandler); - procedure RemoveShortcut(key : Cardinal; modifiers : Cardinal); - procedure SetDefaultButton(button : TButton); - function DefaultButton : TButton; - procedure MenusBeginning; - procedure MenusEnded; - function NeedsUpdate : boolean; - procedure UpdateIfNeeded; - function FindView(view_name : PChar) : TView; - function FindView(aPoint : TPoint) : TView; - function CurrentFocus : TView; - procedure Activate(aValue : boolean); - procedure WindowActivated(state : boolean); -// procedure ConvertToScreen(var pt : TPoint); overload; - function ConvertToScreen(pt : TPoint) : TPoint; overload; -// procedure ConvertFromScreen(var pt : TPoint); - function ConvertFromScreen(pt : TPoint) : TPoint; -// 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 : TPoint); - 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 : TWindow) : TStatus_t; - procedure DisableUpdates; - procedure EnableUpdates; - procedure BeginViewTransaction; - procedure EndViewTransaction; - function Bounds : TRect; - function GetFrame : TRect; - 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 : TView; - function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; aProperty : PChar) : THandler; - function GetSupportedSuites(data : TMessage) : TStatus_t; - function AddToSubset(window : TWindow) : TStatus_t; - function RemoveFromSubset(window : TWindow) : TStatus_t; - function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; - function SetType(aType : Cardinal) : TStatus_t; - function GetType : Cardinal; - function SetLook(look : PCardinal) : TStatus_t; - function GetLook : PCardinal; - function SetFeel(feel : Cardinal) : TStatus_t; - function GetFeel : Cardinal; - function SetFlags(aFlags : Cardinal) : TStatus_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) : TStatus_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) : TStatus_t; -// function QuitRequested : boolean; - function Run : TThread_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) : TArchivable; cdecl; external BePascalLibName name 'BWindow_Instantiate'; -function BWindow_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_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 : TView) : 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) : TView; cdecl; external BePascalLibName name 'BWindow_ChildAt'; -procedure BWindow_DispatchMessage(AObject : TCPlusObject; message : TMessage; handler : THandler); cdecl; external BePascalLibName name 'BWindow_DispatchMessage'; -procedure BWindow_MessageReceived(AObject : TCPlusObject; message : TMessage); 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 : TColor_Space); cdecl; external BePascalLibName name 'BWindow_ScreenChanged'; -procedure BWindow_SetPulseRate(AObject : TCPlusObject; rate : TBigtime_t); cdecl; external BePascalLibName name 'BWindow_SetPulseRate'; -function BWindow_PulseRate(AObject : TCPlusObject) : TBigtime_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) : TButton; 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) : TView; cdecl; external BePascalLibName name 'BWindow_FindView'; -function BWindow_FindView(AObject : TCPlusObject; aPoint : TPoint) : TView; cdecl; external BePascalLibName name 'BWindow_FindView'; -function BWindow_CurrentFocus(AObject : TCPlusObject) : TView; 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) : TPoint; 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) : TPoint; 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 : TWindow) : TStatus_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) : TRect; cdecl; external BePascalLibName name 'BWindow_Bounds'; -function BWindow_Frame(AObject : TCPlusObject) : TRect; 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) : TView; cdecl; external BePascalLibName name 'BWindow_LastMouseMovedView'; -function BWindow_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; aProperty : PChar) : THandler; cdecl; external BePascalLibName name 'BWindow_ResolveSpecifier'; -function BWindow_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BWindow_GetSupportedSuites'; -function BWindow_AddToSubset(AObject : TCPlusObject; window : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BWindow_AddToSubset'; -function BWindow_RemoveFromSubset(AObject : TCPlusObject; window : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BWindow_RemoveFromSubset'; -function BWindow_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BWindow_Perform'; -function BWindow_SetType(AObject : TCPlusObject; aType : Cardinal) : TStatus_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) : TStatus_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) : TStatus_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) : TStatus_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) : TStatus_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) : TStatus_t; cdecl; external BePascalLibName name 'BWindow_GetWindowAlignment'; -function BWindow_QuitRequested(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BWindow_QuitRequested'; -function BWindow_Run(AObject : TCPlusObject) : TThread_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 TWindow.QuitRequested : boolean; -begin - Result := inherited; - be_app.PostMessage(B_QUIT_REQUESTED); -end; - -constructor TWindow.Create(aFrame : TRect; aTitle : PChar; aNewType, SomeFlags, aWorkspaces : Cardinal); -begin - inherited Create; - CPlusObject := BWindow_Create(Self, aFrame.CPlusObject, aTitle, aNewType, SomeFlags, aWorkspaces); -end; - -destructor TWindow.Destroy; -begin - BWindow_Free(CPlusObject); - inherited; -end; - -procedure TWindow.Show; -begin - BWindow_Show(Self.CPlusObject); -end; - -procedure TWindow.Hide; -begin - BWindow_Hide(Self.CPlusObject); -end; - -procedure TWindow.AddChild(aView : TView; sibling : TView); -begin - BWindow_AddChild(Self.CPlusObject, aView.CPlusObject, nil{sibling.CPlusObject}); -end; - -function TWindow.RemoveChild(aView : TView) : boolean; -begin - result := BWindow_RemoveChild(Self.CPlusObject, aView.CPlusObject); -end; - -function TWindow.Instantiate(data : TMessage) : TArchivable; -begin - Result := BWindow_Instantiate(CPlusObject, data.CPlusObject); -end; - -function TWindow.Archive(data : TMessage; deep : boolean) : TStatus_t; -begin - Result := BWindow_Archive(CPlusObject, data.CPlusObject, deep); -end; - -procedure TWindow.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 TWindow.CountChildren : integer; -begin - Result := BWindow_CountChildren(CPlusObject); -end; - -function TWindow.ChildAt(index : integer) : TView; -begin - Result := BWindow_ChildAt(CPlusObject, index); -end; - -procedure TWindow.DispatchMessage(message : TMessage; handler : THandler); -begin - -end; - -procedure TWindow.MessageReceived(message : TMessage); -begin - -end; - -procedure TWindow.FrameMoved(new_position : TPoint); -begin - BWindow_FrameMoved(CPlusObject, new_position.CPlusObject); -end; - -procedure TWindow.WorkspacesChanged(old_ws : Cardinal; new_ws : Cardinal); -begin - BWindow_WorkspacesChanged(CPlusObject, old_ws, new_ws); -end; - -procedure TWindow.WorkspaceActivated(ws : integer; state : boolean); -begin - BWindow_WorkspaceActivated(CPlusObject, ws, state); -end; - -procedure TWindow.FrameResized(new_width : double; new_height : double); -begin - BWindow_FrameResized(CPlusObject, new_width, new_height); -end; - -procedure TWindow.Minimize(aMinimize : boolean); -begin - BWindow_Minimize(CPlusObject, aMinimize); -end; - -procedure TWindow.Zoom(rec_position : TPoint; rec_width : double; rec_height : double); -begin - BWindow_Zoom(CPlusObject, rec_position.CPlusObject, rec_width, rec_height); -end; - -procedure TWindow.Zoom; -begin - BWindow_Zoom(CPlusObject); -end; - -procedure TWindow.SetZoomLimits(max_h : double; max_v : double); -begin - BWindow_SetZoomLimits(CPlusObject, max_h, max_v); -end; - -procedure TWindow.ScreenChanged(screen_size : TRect; depth : TColor_Space); -begin - BWindow_ScreenChanged(CPlusObject, screen_size.CPlusObject, depth); -end; - -procedure TWindow.SetPulseRate(rate : TBigtime_t); -begin - BWindow_SetPulseRate(CPlusObject, rate); -end; - -function TWindow.PulseRate : TBigtime_t; -begin - Result := BWindow_PulseRate(CPlusObject); -end; - -procedure TWindow.AddShortcut(key : Cardinal; modifiers : Cardinal; msg : TMessage); -begin - BWindow_AddShortcut(CPlusObject, key, modifiers, msg.CPlusObject); -end; - -procedure TWindow.AddShortcut(key : Cardinal; modifiers : Cardinal; msg : TMessage; target : THandler); -begin - BWindow_AddShortcut(CPlusObject, key, modifiers, msg.CPlusObject, target.CPlusObject); -end; - -procedure TWindow.RemoveShortcut(key : Cardinal; modifiers : Cardinal); -begin - BWindow_RemoveShortcut(CPlusObject, key, modifiers); -end; - -procedure TWindow.SetDefaultButton(button : TButton); -begin - BWindow_SetDefaultButton(CPlusObject, button.CPlusObject); -end; - -function TWindow.DefaultButton : TButton; -begin - Result := BWindow_DefaultButton(CPlusObject); -end; - -procedure TWindow.MenusBeginning; -begin - BWindow_MenusBeginning(CPlusObject); -end; - -procedure TWindow.MenusEnded; -begin - BWindow_MenusEnded(CPlusObject); -end; - -function TWindow.NeedsUpdate : boolean; -begin -// Result := BWindow_NeedsUpdate(CPlusObject); - Result := True; -end; - -procedure TWindow.UpdateIfNeeded; -begin - BWindow_UpdateIfNeeded(CPlusObject); -end; - -function TWindow.FindView(view_name : PChar) : TView; -begin - Result := BWindow_FindView(CPlusObject, view_name); -end; - -function TWindow.FindView(aPoint : TPoint) : TView; -begin - Result := BWindow_FindView(CPlusObject, aPoint.CPlusObject); -end; - -function TWindow.CurrentFocus : TView; -begin - Result := BWindow_CurrentFocus(CPlusObject); -end; - -procedure TWindow.Activate(aValue : boolean); -begin - BWindow_Activate(CPlusObject, aValue); -end; - -procedure TWindow.WindowActivated(state : boolean); -begin -// BWindow_WindowActivated(CPlusObject, state); -end; - -//procedure TWindow.ConvertToScreen(pt : TPoint); -//begin -// BWindow_ConvertToScreen(CPlusObject, pt.CPlusObject); -//end; - -function TWindow.ConvertToScreen(pt : TPoint) : TPoint; -begin - Result := BWindow_ConvertToScreen(CPlusObject, pt.CPlusObject); -end; - -//procedure TWindow.ConvertFromScreen(pt : TPoint); -//begin -// BWindow_ConvertFromScreen(CPlusObject, pt.CPlusObject); -//end; - -function TWindow.ConvertFromScreen(pt : TPoint) : TPoint; -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 TWindow.MoveBy(dx : double; dy : double); -begin - BWindow_MoveBy(CPlusObject, dx, dy); -end; - -procedure TWindow.MoveTo(aPoint : TPoint); -begin - BWindow_MoveTo(CPlusObject, aPoint.CPlusObject); -end; - -procedure TWindow.MoveTo(x : double; y : double); -begin - BWindow_MoveTo(CPlusObject, x, y); -end; - -procedure TWindow.ResizeBy(dx : double; dy : double); -begin - BWindow_ResizeBy(CPlusObject, dx, dy); -end; - -procedure TWindow.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 TWindow.IsHidden : boolean; -begin - Result := BWindow_IsHidden(CPlusObject); -end; - -function TWindow.IsMinimized : boolean; -begin - Result := BWindow_IsMinimized(CPlusObject); -end; - -procedure TWindow.Flush; -begin - BWindow_Flush(CPlusObject); -end; - -procedure TWindow.Sync; -begin - BWindow_Sync(CPlusObject); -end; - -function TWindow.SendBehind(window : TWindow) : TStatus_t; -begin - Result := BWindow_SendBehind(CPlusObject, window); -end; - -procedure TWindow.DisableUpdates; -begin - BWindow_DisableUpdates(CPlusObject); -end; - -procedure TWindow.EnableUpdates; -begin - BWindow_EnableUpdates(CPlusObject); -end; - -procedure TWindow.BeginViewTransaction; -begin - BWindow_BeginViewTransaction(CPlusObject); -end; - -procedure TWindow.EndViewTransaction; -begin - BWindow_EndViewTransaction(CPlusObject); -end; - -function TWindow.Bounds : TRect; -begin - Result := BWindow_Bounds(CPlusObject); -end; - -function TWindow.GetFrame : TRect; -begin - Result := BWindow_Frame(CPlusObject); -end; - -function TWindow.GetTitle : PChar; -begin - Result := BWindow_Title(CPlusObject); -end; - -procedure TWindow.SetTitle(title : PChar); -begin - BWindow_SetTitle(CPlusObject, title); -end; - -function TWindow.IsFront : boolean; -begin - Result := BWindow_IsFront(CPlusObject); -end; - -function TWindow.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 TWindow.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 TWindow.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 TWindow.Workspaces : Cardinal; -begin - Result := BWindow_Workspaces(CPlusObject); -end; - -procedure TWindow.SetWorkspaces(aWorkspace : Cardinal); -begin - BWindow_SetWorkspaces(CPlusObject, aWorkspace); -end; - -function TWindow.LastMouseMovedView : TView; -begin - Result := BWindow_LastMouseMovedView(CPlusObject); -end; - -function TWindow.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; aProperty : PChar) : THandler; -begin - Result := BWindow_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, aProperty); -end; - -function TWindow.GetSupportedSuites(data : TMessage) : TStatus_t; -begin - Result := BWindow_GetSupportedSuites(CPlusObject, data.CPlusObject); -end; - -function TWindow.AddToSubset(window : TWindow) : TStatus_t; -begin - Result := BWindow_AddToSubset(CPlusObject, window.CPlusObject); -end; - -function TWindow.RemoveFromSubset(window : TWindow) : TStatus_t; -begin - Result := BWindow_RemoveFromSubset(CPlusObject, window.CPlusObject); -end; - -function TWindow.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; -begin - Result := BWindow_Perform(CPlusObject, d, arg); -end; - -function TWindow.SetType(aType : Cardinal) : TStatus_t; -begin - Result := BWindow_SetType(CPlusObject, aType); -end; - -function TWindow.GetType : Cardinal; -begin - Result := BWindow_Type(CPlusObject); -end; - -function TWindow.SetLook(look : PCardinal) : TStatus_t; -begin - Result := BWindow_SetLook(CPlusObject, look); -end; - -function TWindow.GetLook : PCardinal; -begin - Result := BWindow_Look(CPlusObject); -end; - -function TWindow.SetFeel(feel : Cardinal) : TStatus_t; -begin - Result := BWindow_SetFeel(CPlusObject, feel); -end; - -function TWindow.GetFeel : Cardinal; -begin - Result := BWindow_Feel(CPlusObject); -end; - -function TWindow.SetFlags(aFlags : Cardinal) : TStatus_t; -begin - Result := BWindow_SetFlags(CPlusObject, aFlags); -end; - -function TWindow.GetFlags : Cardinal; -begin - Result := BWindow_Flags(CPlusObject); -end; - -function TWindow.IsModal : boolean; -begin - Result := BWindow_IsModal(CPlusObject); -end; - -function TWindow.IsFloating : boolean; -begin - Result := BWindow_IsFloating(CPlusObject); -end; - -function TWindow.SetWindowAlignment(mode : Cardinal; h : integer; hOffset : integer; width : integer; widthOffset : integer; v : integer; vOffset : integer; height : integer; heightOffset : integer) : TStatus_t; -begin - Result := BWindow_SetWindowAlignment(CPlusObject, mode, h, hOffset, width, widthOffset, v, vOffset, height, heightOffset); -end; - -function TWindow.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) : TStatus_t; -begin - Result := BWindow_GetWindowAlignment(CPlusObject, mode, h, hOffset, width, widthOffset, v, vOffset, height, heightOffset); -end; - -function TWindow.Run : TThread_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/bepascal/be/kernel/os.pp b/bepascal/bepascal/be/kernel/os.pp deleted file mode 100644 index 15a8590..0000000 --- a/bepascal/bepascal/be/kernel/os.pp +++ /dev/null @@ -1,92 +0,0 @@ -{ 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 - TArea_id = Longint; - TPort_id = Longint; - TSem_id = Longint; - TThread_id = Longint; - TTeam_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 - TArea_Info = record - area : TArea_id; - name : array [0..B_OS_NAME_LENGTH] of char; - size : TSize_t; - lock : Cardinal; - protection : Cardinal; - team : TTeam_id; - ram_size : Cardinal; - copy_count : Cardinal; - in_count : Cardinal; - out_count : Cardinal; - address : Pointer; - end; - -// Semaphores -type - TSem_Info = record - sem : TSem_id; - team : TTeam_id; - name : array [0..B_OS_NAME_LENGTH] of char; - count : integer; - latest_holder : TThread_id; - end; - -implementation - -end. \ No newline at end of file diff --git a/bepascal/bepascal/be/mail/E-mail.cpp b/bepascal/bepascal/be/mail/E-mail.cpp deleted file mode 100644 index 1df020d..0000000 --- a/bepascal/bepascal/be/mail/E-mail.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* 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/bepascal/be/mail/Email.pp b/bepascal/bepascal/be/mail/Email.pp deleted file mode 100644 index 9f9dd80..0000000 --- a/bepascal/bepascal/be/mail/Email.pp +++ /dev/null @@ -1,125 +0,0 @@ -{ 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 TEMail = class(TbeObject) - private - public - constructor Create; override; - destructor Destroy; override; - - function Add_Content(text : PChar;length: cardinal;encoding : TCharSet; clobber : boolean) : TStatus_t; - function Add_Content(text : PChar;length: cardinal;encoding : Pchar; clobber : boolean) : TStatus_t; - function AddEnclosure( path : Pchar; clobber:boolean) : TStatus_t; - function AddEnclosure(MIME_type : Pchar;data : pointer;len : cardinal; clobber:boolean) : TStatus_t; - function AddHeaderField( encoding: TCharSet; field_name : Pchar; str : PChar;clobber:boolean) : TStatus_t; - function AddHeaderField( field_name : Pchar; str : PChar;clobber:boolean) : TStatus_t; - function Send( send_now : boolean; remove_when_I_have_completed_sending_this_message_to_your_preferred_SMTP_server : boolean) : TStatus_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) : TStatus_t;cdecl; external BePascalLibName name 'BMailMessage_AddContent'; -function BMailMessage_AddContent_1(AObject : TCPlusObject;text : PChar;length: cardinal;encoding : Pchar; clobber : boolean) : TStatus_t;cdecl; external BePascalLibName name 'BMailMessage_AddContent_1'; -//function BMailMessage_AddEnclosure(AObject : TCPlusObject; entry_ref *ref, bool clobber) : TStatus_t;cdecl; external BePascalLibName name 'BMailMessage_AddEnclosure'; -function BMailMessage_AddEnclosure_1(AObject : TCPlusObject; path : Pchar; clobber:boolean) : TStatus_t;cdecl; external BePascalLibName name 'BMailMessage_AddEnclosure_1'; -function BMailMessage_AddEnclosure_2(AObject : TCPlusObject; MIME_type : Pchar;data : pointer;len : cardinal; clobber:boolean) : TStatus_t;cdecl; external BePascalLibName name 'BMailMessage_AddEnclosure_2'; -function BMailMessage_AddHeaderField(AObject : TCPlusObject; encoding: cardinal; field_name : Pchar; str : PChar;clobber:boolean) : TStatus_t;cdecl; external BePascalLibName name 'BMailMessage_AddHeaderField'; -function BMailMessage_AddHeaderField_1(AObject : TCPlusObject; field_name : Pchar; str : PChar;clobber:boolean) : TStatus_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) : TStatus_t;cdecl; external BePascalLibName name 'BMailMessage_Send'; - - -implementation - -constructor TEmail.Create; -begin - inherited; - CPlusObject := BMailMessage_Create(); -end; - -destructor TEmail.Destroy; -begin - if CPlusObject <> nil then - BMail_Free(CPlusObject); - inherited; -end; - -function TEmail.Add_Content(text : PChar;length: cardinal;encoding : TCharSet; clobber : boolean) : TStatus_t; -begin - result:=BMailMessage_AddContent(CPlusObject,text,length,cardinal(encoding),clobber ); -end; - -function TEmail.Add_Content(text : PChar;length: cardinal;encoding : Pchar; clobber : boolean) : TStatus_t; -begin - result:=BMailMessage_AddContent_1(CPlusObject,text,length,encoding,clobber ); -end; - -function TEmail.AddEnclosure( path : Pchar; clobber:boolean) : TStatus_t; -begin - result:=BMailMessage_AddEnclosure_1(CPlusObject,path,clobber); -end; - -function TEmail.AddEnclosure(MIME_type : Pchar;data : pointer;len : cardinal; clobber:boolean) : TStatus_t; -begin - result:=BMailMessage_AddEnclosure_2(CPlusObject,MIME_type,data,len,clobber); -end; - -function TEmail.AddHeaderField( encoding: TCharSet; field_name : Pchar; str : PChar;clobber:boolean) : TStatus_t; -begin - result:=BMailMessage_AddHeaderField(CPlusObject, cardinal(encoding), field_name , str,clobber); -end; - -function TEmail.AddHeaderField( field_name : Pchar; str : PChar;clobber:boolean) : TStatus_t; -begin - result:=BMailMessage_AddHeaderField_1(CPlusObject, field_name, str,clobber) ; -end; - -function TEmail.Send( send_now : boolean; remove_when_I_have_completed_sending_this_message_to_your_preferred_SMTP_server : boolean) : TStatus_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/bepascal/be/storage/Volume.cpp b/bepascal/bepascal/be/storage/Volume.cpp deleted file mode 100644 index ece703a..0000000 --- a/bepascal/bepascal/be/storage/Volume.cpp +++ /dev/null @@ -1,398 +0,0 @@ -/* 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/bepascal/be/storage/Volume.pp b/bepascal/bepascal/be/storage/Volume.pp deleted file mode 100644 index f07854f..0000000 --- a/bepascal/bepascal/be/storage/Volume.pp +++ /dev/null @@ -1,169 +0,0 @@ -{ 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 - TVolume = class(TBeObject) - public - constructor Create; override; - destructor Destroy; override; - - function InitCheck : Tstatus_t; - function SetTo(dev : Tdev_t) : Tstatus_t; - procedure Unset; - function Device : Tdev_t; - function Capacity : Toff_t; - function FreeBytes : Toff_t; - function GetName( name : pchar ):Tstatus_t; - function SetName( name : pchar ):Tstatus_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 :Tdev_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) : Tstatus_t;cdecl; external BePascalLibName name 'BVolume_InitCheck'; -function BVolume_SetTo(AObject : TCPlusObject; dev :Tdev_t ): Tstatus_t;cdecl; external BePascalLibName name 'BVolume_SetTo'; -procedure BVolume_Unset(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolume_Unset'; -function BVolume_Device(AObject : TCPlusObject) : TDev_t;cdecl; external BePascalLibName name 'BVolume_Device'; -//status_t BVolume_GetRootDirectory(BVolume *Volume, BDirectory *dir) -function BVolume_Capacity(AObject : TCPlusObject) : Toff_t;cdecl; external BePascalLibName name 'BVolume_Capacity'; -function BVolume_FreeBytes(AObject : TCPlusObject) : Toff_t;cdecl; external BePascalLibName name 'BVolume_FreeBytes'; -function BVolume_GetName(AObject : TCPlusObject; name : pchar ): Tstatus_t;cdecl; external BePascalLibName name 'BVolume_GetName'; -function BVolume_SetName(AObject : TCPlusObject; name : pchar ): Tstatus_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 TVolume.Create; -begin - inherited; - CPlusObject:=BVolume_Create; -end; - - -destructor TVolume.Destroy; -begin - if CPlusObject <> nil then BVolume_Free(CPlusObject); - inherited; -end; - -function TVolume.InitCheck: Tstatus_t; -begin - result:=BVolume_InitCheck(CPlusObject); -end; - -function TVolume.SetTo(dev : Tdev_t) : Tstatus_t; -begin - result:=BVolume_SetTo(CPlusObject,dev); -end; - -procedure TVolume.Unset; -begin - BVolume_Unset(CPlusObject); -end; - -function TVolume.Device : Tdev_t; -begin - result:=BVolume_Device(CPlusObject); -end; - -function TVolume.Capacity : Toff_t; -begin - result:=BVolume_Capacity(CPlusObject); -end; - -function TVolume.FreeBytes : Toff_t; -begin - result:=BVolume_FreeBytes(CPlusObject); -end; - -function TVolume.GetName( name : pchar ):Tstatus_t; -begin - result:=BVolume_GetName(CPlusObject,name); -end; - -function TVolume.SetName( name : pchar ):Tstatus_t; -begin - result:=BVolume_SetName(CPlusObject,name); -end; - -function TVolume.IsRemovable : boolean; -begin - result:=BVolume_IsRemovable(CPlusObject); -end; - -function TVolume.IsReadOnly : boolean; -begin - result:=BVolume_IsReadOnly(CPlusObject); -end; - -function TVolume.IsPersistent : boolean; -begin - result:=BVolume_IsPersistent(CPlusObject); -end; - -function TVolume.IsShared : boolean; -begin - result:=BVolume_IsShared(CPlusObject); -end; - -function TVolume.KnowsMime : boolean; -begin - result:=BVolume_KnowsMime(CPlusObject); -end; - -function TVolume.KnowsAttr : boolean; -begin - result:=BVolume_KnowsAttr(CPlusObject); -end; - -function TVolume.KnowsQuery : boolean; -begin - result:=BVolume_KnowsQuery(CPlusObject); -end; - - -end. diff --git a/bepascal/bepascal/be/storage/VolumeRoster.cpp b/bepascal/bepascal/be/storage/VolumeRoster.cpp deleted file mode 100644 index c000950..0000000 --- a/bepascal/bepascal/be/storage/VolumeRoster.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* 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/bepascal/be/storage/VolumeRoster.pp b/bepascal/bepascal/be/storage/VolumeRoster.pp deleted file mode 100644 index 46b3c77..0000000 --- a/bepascal/bepascal/be/storage/VolumeRoster.pp +++ /dev/null @@ -1,95 +0,0 @@ -{ 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 - TVolumeRoster = class(TBeObject) - private - public - constructor Create; override; - destructor Destroy; override; - - function GetNextVolume(val : TVolume): Tstatus_t; - procedure Rewind; - function GetBootVolume( vol: TVolume ):Tstatus_t; - //function StartWatching( msngr : TMessenger): Tstatus_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): Tstatus_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 ):Tstatus_t;cdecl; external BePascalLibName name 'BVolumeRoster_GetBootVolume'; -//function BVolumeRoster_StartWatching(AObject : TCPlusObject; msngr : TMessenger): Tstatus_t;cdecl; external BePascalLibName name 'BVolumeRoster_StartWatching'; -procedure BVolumeRoster_StopWatching(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolumeRoster_StopWatching'; - - - - -implementation - - -constructor TVolumeRoster.Create; -begin - inherited; - CPlusObject := BVolumeRoster_Create(Self); -end; - -destructor TVolumeRoster.Destroy; -begin - if CPlusObject <> nil then - BVolumeRoster_Free(CPlusObject); - inherited; - -end; - -function TVolumeRoster.GetNextVolume(val : TVolume): Tstatus_t; -begin - result:=BVolumeRoster_GetNextVolume(CPlusObject,val.CPlusObject); -end; - -procedure TVolumeRoster.Rewind; -begin - BVolumeRoster_Rewind(CPlusObject); -end; - -function TVolumeRoster.GetBootVolume( vol: TVolume ):Tstatus_t; -begin - result:=BVolumeRoster_GetBootVolume(CPlusObject,vol.CPlusObject); -end; - -//function TVolumeRoster.StartWatching( msngr : TMessenger): Tstatus_t; -//begin -// result:=BVolumeRoster_StartWatching(CPlusObject,msngr); -//end; - -procedure TVolumeRoster.StopWatching; -begin - BVolumeRoster_StopWatching(CPlusObject); -end; - -end. diff --git a/bepascal/bepascal/be/storage/entry.pp b/bepascal/bepascal/be/storage/entry.pp deleted file mode 100644 index cc633ee..0000000 --- a/bepascal/bepascal/be/storage/entry.pp +++ /dev/null @@ -1,35 +0,0 @@ -{ 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 - TEntryRef = record - device : dev_t; - directory : ino_t; - name : PChar; - end; - -implementation - -end. diff --git a/bepascal/bepascal/be/storage/storagedefs.pp b/bepascal/bepascal/be/storage/storagedefs.pp deleted file mode 100644 index c96d4ad..0000000 --- a/bepascal/bepascal/be/storage/storagedefs.pp +++ /dev/null @@ -1,52 +0,0 @@ -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/bepascal/be/support/Archivable.cpp b/bepascal/bepascal/be/support/Archivable.cpp deleted file mode 100644 index e7e3c0f..0000000 --- a/bepascal/bepascal/be/support/Archivable.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* 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/bepascal/be/support/BString.pp b/bepascal/bepascal/be/support/BString.pp deleted file mode 100644 index 111a90d..0000000 --- a/bepascal/bepascal/be/support/BString.pp +++ /dev/null @@ -1,510 +0,0 @@ -{ 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/bepascal/be/support/DataIO.cpp b/bepascal/bepascal/be/support/DataIO.cpp deleted file mode 100644 index bced38e..0000000 --- a/bepascal/bepascal/be/support/DataIO.cpp +++ /dev/null @@ -1,385 +0,0 @@ -/* 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/bepascal/be/support/Flattenable.cpp b/bepascal/bepascal/be/support/Flattenable.cpp deleted file mode 100644 index a2a48fb..0000000 --- a/bepascal/bepascal/be/support/Flattenable.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* 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/bepascal/be/support/List.cpp b/bepascal/bepascal/be/support/List.cpp deleted file mode 100644 index 20358e8..0000000 --- a/bepascal/bepascal/be/support/List.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/* 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/bepascal/be/support/String.cpp b/bepascal/bepascal/be/support/String.cpp deleted file mode 100644 index 3ca4f16..0000000 --- a/bepascal/bepascal/be/support/String.cpp +++ /dev/null @@ -1,1751 +0,0 @@ -/* 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/bepascal/be/support/_beep.pp b/bepascal/bepascal/be/support/_beep.pp deleted file mode 100644 index be35e42..0000000 --- a/bepascal/bepascal/be/support/_beep.pp +++ /dev/null @@ -1,32 +0,0 @@ -{ 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 : TStatus_t; cdecl; external 'be' name 'beep__Fv'; - -implementation - -end. \ No newline at end of file diff --git a/bepascal/bepascal/be/support/archivable.h b/bepascal/bepascal/be/support/archivable.h deleted file mode 100644 index 0af6221..0000000 --- a/bepascal/bepascal/be/support/archivable.h +++ /dev/null @@ -1,42 +0,0 @@ -/* 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/bepascal/be/support/archivable.pp b/bepascal/bepascal/be/support/archivable.pp deleted file mode 100644 index 322f458..0000000 --- a/bepascal/bepascal/be/support/archivable.pp +++ /dev/null @@ -1,53 +0,0 @@ -{ 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 - TArchivable = 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) : TStatus_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/bepascal/be/support/bstring.pp b/bepascal/bepascal/be/support/bstring.pp deleted file mode 100644 index 111a90d..0000000 --- a/bepascal/bepascal/be/support/bstring.pp +++ /dev/null @@ -1,510 +0,0 @@ -{ 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/bepascal/be/support/dataio.pp b/bepascal/bepascal/be/support/dataio.pp deleted file mode 100644 index 954fdc5..0000000 --- a/bepascal/bepascal/be/support/dataio.pp +++ /dev/null @@ -1,629 +0,0 @@ -{ 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 - TDataIO = class(TBeObject) - private - public - constructor Create; override; - destructor Destroy; override; - function Read(buffer : Pointer; size : TSize_t) : TSSize_t; virtual; abstract; - function Write(buffer : Pointer; size : TSize_t) : TSSize_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 : TDataIO); -// function operator=( : TDataIO) : TDataIO; -// procedure int32 _reserved[2]; - end; -type - TPositionIO = class(TDataIO) - private - public - constructor Create; override; - destructor Destroy; override; -// function Read(buffer : Pointer; size : TSize_t) : TSSize_t; override; -// function Write(buffer : Pointer; size : TSize_t) : TSSize_t; override; - function ReadAt(pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; virtual; abstract; - function WriteAt(pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; virtual; abstract; - function Seek(aposition : Toff_t; seek_mode : Cardinal) : Toff_t; virtual; abstract; -// function Position : Toff_t; virtual; - function SetSize(size : Toff_t) : TStatus_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 : Toff_t; abuffer : Pointer; size : TSize_t) : TSSize_t; override; - function WriteAt(pos : Toff_t; abuffer : Pointer; size : TSize_t) : TSSize_t; override; - function Seek(pos : Toff_t; seek_mode : Cardinal) : Toff_t; override; -// function Position : Toff_t; override; - function SetSize(size : Toff_t) : TStatus_t; override; - procedure SetBlockSize(blocksize : TSize_t); virtual; - function Buffer : Pointer; -// function BufferLength : TSize_t; -{ procedure _ReservedMallocIO1; - procedure _ReservedMallocIO2; -} -// constructor Create(MallocIO : TMallocIO); -// function operator=( : TMallocIO) : TMallocIO; -{ function fBlockSize : TSize_t; - function fMallocSize : TSize_t; - function fLength : TSize_t; - function fData : PChar; - function fPosition : Toff_t; -} -// procedure _reserved[1] : integer; - end; -type - TMemoryIO = class(TPositionIO) - private - public - constructor Create; override; - constructor Create(p : Pointer; len : TSize_t); virtual; - destructor Destroy; override; - function ReadAt(pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; override; - function WriteAt(pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; override; - function Seek(pos : Toff_t; seek_mode : Cardinal) : Toff_t; override; -// function Position : Toff_t; override; - function SetSize(size : Toff_t) : TStatus_t; override; -{ procedure _ReservedMemoryIO1; - procedure _ReservedMemoryIO2; -} - constructor Create(MemoryIO : TMemoryIO); -// function operator=(MemoryIO : TMemoryIO) : TMemoryIO; -{ function fReadOnly : boolean; - function fBuf : PChar; - function fLen : TSize_t; - function fPhys : TSize_t; - function fPos : TSize_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 : TSize_t) : TSSize_t; cdecl; external BePascalLibName name 'BDataIO_Read'; -//function BDataIO_Write(AObject : TCPlusObject; buffer : Pointer; size : TSize_t) : TSSize_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 : TDataIO) : TCPlusObject; cdecl; external BePascalLibName name 'BDataIO_Create_2'; -//function BDataIO_operator=(AObject : TCPlusObject; : TDataIO) : TDataIO; 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 : TSize_t) : TSSize_t; cdecl; external BePascalLibName name 'BPositionIO_Read'; -function BPositionIO_Write(AObject : TCPlusObject; buffer : Pointer; size : TSize_t) : TSSize_t; cdecl; external BePascalLibName name 'BPositionIO_Write'; -function BPositionIO_ReadAt(AObject : TCPlusObject; pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; cdecl; external BePascalLibName name 'BPositionIO_ReadAt'; -function BPositionIO_WriteAt(AObject : TCPlusObject; pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; cdecl; external BePascalLibName name 'BPositionIO_WriteAt'; -function BPositionIO_Seek(AObject : TCPlusObject; position : Toff_t; seek_mode : Cardinal) : Toff_t; cdecl; external BePascalLibName name 'BPositionIO_Seek'; -//function BPositionIO_Position(AObject : TCPlusObject) : Toff_t; cdecl; external BePascalLibName name 'BPositionIO_Position'; -function BPositionIO_SetSize(AObject : TCPlusObject; size : Toff_t) : TStatus_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 : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; cdecl; external BePascalLibName name 'BMallocIO_ReadAt'; -function BMallocIO_WriteAt(AObject : TCPlusObject; pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; cdecl; external BePascalLibName name 'BMallocIO_WriteAt'; -function BMallocIO_Seek(AObject : TCPlusObject; pos : Toff_t; seek_mode : Cardinal) : Toff_t; cdecl; external BePascalLibName name 'BMallocIO_Seek'; -//function BMallocIO_Position(AObject : TCPlusObject) : Toff_t; cdecl; external BePascalLibName name 'BMallocIO_Position'; -function BMallocIO_SetSize(AObject : TCPlusObject; size : Toff_t) : TStatus_t; cdecl; external BePascalLibName name 'BMallocIO_SetSize'; -procedure BMallocIO_SetBlockSize(AObject : TCPlusObject; blocksize : TSize_t); cdecl; external BePascalLibName name 'BMallocIO_SetBlockSize'; -function BMallocIO_Buffer(AObject : TCPlusObject) : Pointer; cdecl; external BePascalLibName name 'BMallocIO_Buffer'; -//function BMallocIO_BufferLength(AObject : TCPlusObject) : TSize_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 : TSize_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 : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; cdecl; external BePascalLibName name 'BMemoryIO_ReadAt'; -function BMemoryIO_WriteAt(AObject : TCPlusObject; pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; cdecl; external BePascalLibName name 'BMemoryIO_WriteAt'; -function BMemoryIO_Seek(AObject : TCPlusObject; pos : Toff_t; seek_mode : Cardinal) : Toff_t; cdecl; external BePascalLibName name 'BMemoryIO_Seek'; -function BMemoryIO_Position(AObject : TCPlusObject) : Toff_t; cdecl; external BePascalLibName name 'BMemoryIO_Position'; -function BMemoryIO_SetSize(AObject : TCPlusObject; size : Toff_t) : TStatus_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 TDataIO.Create; -begin - inherited; - CPlusObject := BDataIO_Create(Self); -end; - -destructor TDataIO.Destroy; -begin - if CPlusObject <> nil then - BDataIO_Free(CPlusObject); - inherited; -end; - -{procedure TDataIO._ReservedDataIO1; -begin - BDataIO__ReservedDataIO1(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO2; -begin - BDataIO__ReservedDataIO2(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO3; -begin - BDataIO__ReservedDataIO3(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO4; -begin - BDataIO__ReservedDataIO4(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO5; -begin - BDataIO__ReservedDataIO5(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO6; -begin - BDataIO__ReservedDataIO6(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO7; -begin - BDataIO__ReservedDataIO7(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO8; -begin - BDataIO__ReservedDataIO8(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO9; -begin - BDataIO__ReservedDataIO9(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO10; -begin - BDataIO__ReservedDataIO10(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO11; -begin - BDataIO__ReservedDataIO11(CPlusObject); -end; - -procedure TDataIO._ReservedDataIO12; -begin - BDataIO__ReservedDataIO12(CPlusObject); -end; -} - -constructor TDataIO.Create(DataIO : TDataIO); -begin - inherited Create; - CPlusObject := BDataIO_Create(Self, DataIO); -end; - -{function TDataIO.operator=( : TDataIO) : TDataIO; -begin - BDataIO_operator=(CPlusObject, ); -end; -} - -{procedure TDataIO.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 : TSize_t) : TSSize_t; -begin - Result := BPositionIO_Read(CPlusObject, buffer, size); -end; - -function TPositionIO.Write(buffer : Pointer; size : TSize_t) : TSSize_t; -begin - Result := BPositionIO_Write(CPlusObject, buffer, size); -end; -} - -{function TPositionIO.ReadAt(pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; -begin - Result := BPositionIO_ReadAt(CPlusObject, pos, buffer, size); -end; - -function TPositionIO.WriteAt(pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; -begin - Result := BPositionIO_WriteAt(CPlusObject, pos, buffer, size); -end; - -function TPositionIO.Seek(aposition : Toff_t; seek_mode : Cardinal) : Toff_t; -begin - Result := BPositionIO_Seek(CPlusObject, aposition, seek_mode); -end; -} - -{function TPositionIO.Position : Toff_t; -begin - Result := BPositionIO_Position(CPlusObject); -end; -} - -function TPositionIO.SetSize(size : Toff_t) : TStatus_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 : Toff_t; abuffer : Pointer; size : TSize_t) : TSSize_t; -begin - Result := BMallocIO_ReadAt(CPlusObject, pos, abuffer, size); -end; - -function TMallocIO.WriteAt(pos : Toff_t; abuffer : Pointer; size : TSize_t) : TSSize_t; -begin - Result := BMallocIO_WriteAt(CPlusObject, pos, abuffer, size); -end; - -function TMallocIO.Seek(pos : Toff_t; seek_mode : Cardinal) : Toff_t; -begin - Result := BMallocIO_Seek(CPlusObject, pos, seek_mode); -end; - -{function TMallocIO.Position : Toff_t; -begin - Result := BMallocIO_Position(CPlusObject); -end; -} - -function TMallocIO.SetSize(size : Toff_t) : TStatus_t; -begin - Result := BMallocIO_SetSize(CPlusObject, size); -end; - -procedure TMallocIO.SetBlockSize(blocksize : TSize_t); -begin - BMallocIO_SetBlockSize(CPlusObject, blocksize); -end; - -function TMallocIO.Buffer : Pointer; -begin - Result := BMallocIO_Buffer(CPlusObject); -end; - -{function TMallocIO.BufferLength : TSize_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 : TSize_t; -begin - Result := BMallocIO_fBlockSize(CPlusObject); -end; - -function TMallocIO.fMallocSize : TSize_t; -begin - Result := BMallocIO_size_t fMallocSize(CPlusObject); -end; - -function TMallocIO.fLength : TSize_t; -begin - BMallocIO_size_t fLength(CPlusObject); -end; - -function TMallocIO.fData : PChar; -begin - Result := BMallocIO_char *fData(CPlusObject); -end; - -function TMallocIO.fPosition : Toff_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 : TSize_t); -begin - CPlusObject := BMemoryIO_Create(Self, p, len); -end; - -destructor TMemoryIO.Destroy; -begin - BMemoryIO_Free(CPlusObject); -end; - -function TMemoryIO.ReadAt(pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; -begin - Result := BMemoryIO_ReadAt(CPlusObject, pos, buffer, size); -end; - -function TMemoryIO.WriteAt(pos : Toff_t; buffer : Pointer; size : TSize_t) : TSSize_t; -begin - Result := BMemoryIO_WriteAt(CPlusObject, pos, buffer, size); -end; - -function TMemoryIO.Seek(pos : Toff_t; seek_mode : Cardinal) : Toff_t; -begin - Result := BMemoryIO_Seek(CPlusObject, pos, seek_mode); -end; - -{function TMemoryIO.Position : Toff_t; -begin - Result := BMemoryIO_Position(CPlusObject); -end; -} - -function TMemoryIO.SetSize(size : Toff_t) : TStatus_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/bepascal/be/support/flattenable.pp b/bepascal/bepascal/be/support/flattenable.pp deleted file mode 100644 index fa8e705..0000000 --- a/bepascal/bepascal/be/support/flattenable.pp +++ /dev/null @@ -1,96 +0,0 @@ -{ 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 - TFlattenable = class(TBeObject) - private - public - constructor Create; override; - destructor Destroy; override; - - function IsFixedSize : boolean; - function TypeCode : Ttype_code; - function Flatten( buffer :pointer; size : Tssize_t) : Tstatus_t; - function AllowsTypeCode( code : Ttype_code) : boolean; - function Unflatten(c :Ttype_code ; buf :pointer ; size: Tssize_t) : Tstatus_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) : Ttype_code;cdecl; external BePascalLibName name 'BFlattenable_TypeCode'; -function BFlattenable_Flatten( AObject : TCPlusObject;buffer :pointer; size : Tssize_t) : Tstatus_t;cdecl; external BePascalLibName name 'BFlattenable_Flatten'; -function BFlattenable_AllowsTypeCode( AObject : TCPlusObject;code : Ttype_code) : boolean;cdecl; external BePascalLibName name 'BFlattenable_AllowsTypeCode'; -function BFlattenable_Unflatten(AObject : TCPlusObject;c :Ttype_code ; buf :pointer ; size: Tssize_t) : Tstatus_t;cdecl; external BePascalLibName name 'BFlattenable_Unflatten'; - - -implementation - - - -constructor TFlattenable.Create; -begin - CreatePas; - CPlusObject:=self; -end; - - -destructor TFlattenable.Destroy; -begin - if CPlusObject <> nil then - BFlattenable_Free(CPlusObject); - inherited; -end; - -function TFlattenable.IsFixedSize : boolean; -begin - result:=BFlattenable_IsFixedSize(CPlusObject); -end; - -function TFlattenable.TypeCode : Ttype_code; -begin - result:=BFlattenable_TypeCode(CPlusObject); -end; - -function TFlattenable.Flatten( buffer :pointer; size : Tssize_t) : Tstatus_t; -begin - result:=BFlattenable_Flatten(CPlusObject,buffer,size); -end; - -function TFlattenable.AllowsTypeCode( code : Ttype_code) : boolean; -begin - result:=BFlattenable_AllowsTypeCode(CPlusObject,code); -end; - -function TFlattenable.Unflatten(c :Ttype_code ; buf :pointer ; size: Tssize_t) : Tstatus_t; -begin - result:=BFlattenable_Unflatten(CPlusObject,c,buf,size); -end; - - -end. diff --git a/bepascal/bepascal/be/support/list.pp b/bepascal/bepascal/be/support/list.pp deleted file mode 100644 index 80535ea..0000000 --- a/bepascal/bepascal/be/support/list.pp +++ /dev/null @@ -1,187 +0,0 @@ -{ 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 - TList = 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 TList.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 TList.Destroy; -begin - if CPlusObject <> nil then - BList_Free(CPlusObject); - inherited; -end; - -function TList.AddItem(item : pointer): boolean; -begin - result := BList_AddItem(CPlusObject, item ); -end; - -function TList.AddItem(item : pointer; atindex : cardinal): boolean; -begin - result := BList_AddItem(CPlusObject, item , atindex); -end; - -function TList.AddList(newitem : TCPlusObject): boolean; -begin - result:=BList_AddList(CPlusObject, newitem ); -end; - - -function TList.ItemAt(at : cardinal): pointer; -begin - result:=BList_ItemAt(CPlusObject, at ); -end; - -function TList.ItemAtFast(at : cardinal): pointer; -begin - result:=BList_ItemAtFast(CPlusObject, at ); -end; - -function TList.RemoveItem(item : pointer) : boolean; -begin - result:=BList_RemoveItem(CPlusObject, item); -end; - -function TList.RemoveItem(index : cardinal) : boolean; -begin - result:=BList_RemoveItem(CPlusObject, index); -end; - -function TList.RemoveItems(index,count : cardinal) : boolean; -begin - result:=BList_RemoveItems(CPlusObject, index,count); -end; - -procedure TList.MakeEmpty; -begin - BList_MakeEmpty(CPlusObject); -end; - -function TList.FirstItem : pointer; -begin - result:=BList_FirstItem(CPlusObject); -end; - -function TList.LastItem : pointer; -begin - result:=BList_LastItem(CPlusObject); -end; - -function TList.HasItem(item : pointer) : boolean; -begin - result:=BList_HasItem(CPlusObject,item); -end; - -function TList.IndexOf(item : pointer) : cardinal; -begin - result:=BList_IndexOf(CPlusObject,item); -end; - -function TList.CountItems : cardinal; -begin - result:=BList_CountItems(CPlusObject); -end; - -function TList.IsEmpty : boolean; -begin - result:=BList_IsEmpty(CPlusObject); -end; - -function TList.ReplaceItem(index : cardinal; newItem : pointer): boolean; -begin - result:=BList_ReplaceItem(CPlusObject, index , newItem); -end; - -function TList.SwapItems(IndexA,IndexB : cardinal) : boolean; -begin - result:=BList_SwapItems(CPlusObject,indexA,indexB); -end; - -function TList.MoveItem(FromIndex,ToIndex : cardinal) : boolean; -begin - result:=BList_MoveItem(CPlusObject,Fromindex,Toindex); -end; - -end. diff --git a/bepascal/bepascal/be/support/supportdefs.pp b/bepascal/bepascal/be/support/supportdefs.pp deleted file mode 100644 index 21c0032..0000000 --- a/bepascal/bepascal/be/support/supportdefs.pp +++ /dev/null @@ -1,49 +0,0 @@ -{ 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 - TStatus_t = Longint; - TBigtime_t = int64; - TType_code = Cardinal; - TPerform_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 - TDev_t = Longint; - Toff_t = int64; - - // pointer types for FreePascal : to make life easier - PStatus_t = ^TStatus_t; - - // TODO : import other functions ! - - // import from stddef.h - TSize_t = Cardinal; - TSSize_t = Longint; - -implementation - - -end. \ No newline at end of file diff --git a/bepascal/bepascal/be/support/typeconstants.pp b/bepascal/bepascal/be/support/typeconstants.pp deleted file mode 100644 index fea6278..0000000 --- a/bepascal/bepascal/be/support/typeconstants.pp +++ /dev/null @@ -1,67 +0,0 @@ -{ 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/bepascal/bepascal/bepascal.proj b/bepascal/bepascal/bepascal/bepascal.proj deleted file mode 100644 index 68f7a9c3dbef87decf1c06e378b25788405ef712..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21311 zcmeHP4Qw366`qYR#10NP!6wch*_4nU(z8RU_-PQ>v7N*uPEI+K1PXE1cWZme-R*U6 zofuKnRZD5gkDx6osVY^dO4SxBL{$}{id3i#p-2>{Ky4t1Ru!tM=%7)BR9ZQu-8vMj3uw_OjrYqwY-zCx^j%M*hfeSYnMg$ z$TbPeIDp?;6_?9aCESP19~o>j(6VnQtA^wX|*( zTKjc+I8Bm_2Mfm|mCsKTFd$|GJo0A27@01JjDttU=$|eq1agMp(XX3@*1}x{ThF#m zJ4_ORKdn*j&Rgc4ddj{hz-zkQNq8tqOA9R~4lrmteE9HLavDcg%`H+UT)u_6X8cm# z^5hz)_r$BO(poi(9pAWK)F1lca;Gc1^$rwK&)V3pJB#$}cJx7+u}eF!>~%2ZXnSnk zT1U-x6*rvt%m$)oc>V}})*#auT0WmKQkrd;xz>?*_F!C07ap;rf~MiYmCm83mOE#j zS>v?e`D>z{Xed1a2InFF75Bu)(U!H&EvNs~& zn{2Z%`tfWgjDAdAO;A&ozA+b zGFG+jq9c7oOp@1Wg}+n5%TR@5mp7XdUhM3Y1Q=EGQiIq_2ngM+Zfz?EYO-bUVxBL& z#F%0gtf?`i$>LB>4_pcYm`{3+HuJNtC4b+n=Qe`P)}Gx7I_GL`&*!_+hHY92OCKok zc!`d|PM$pZ(Of)N6#T=*Z5CUeN~I85#bOYr!_4N5jBf47Q}AD46d=V1@Vu!OJ{sHu??H9QYSIJAeoVN27ws_WCTPAvT*bE9otYJyCt92Y(0Tv zUfMK^P=g)G9!!m(_#i#N`7e)8My|Vt#~G-1lxmMI+&5E0W>#-anYjUDkWShu^TWiH zmTB>VHw+h^gea;T7O{GSMccI8;IKBRyL^gMBS9Azbd7HKlr?j^H7jT2203y036p5F zT52Sd2OPN#1^JbNyn&CA)={ln{Cu`#5NhMLh^=*7#A5AfM1qLrw9Mv?j6CI18DZkJ)2&dR8F=~Sd)(YXH3h_MZ z`c9*u6$*M5Z`{OL9Qv=N0jPUHeYw~7=8V~|WpMOXAOScT-B5B#l}nRD1cnkz4(XYU zk7_(;;tl)&4(?p)>2`I|i8W^n8ov39#kRL6d*l;L!h;S#3$Lsw(*3Ee^Bww?lP;c7 z-DMl9H^+Ed>rFv|J7KeXGB*-c?q5s(cjkVn|M9Z^0w4o(9!R^+ZQ>> zA+AS)4^z6Dyt$!%y!Q0Vc?M0QK^^Vh&{SM6 z?qd*%Fj|8;$gVB2HaCys{c)Q&FK#>uQ}a|`pyQm?s;;7XhY@C zHP@UbdU{S?z-yzhn$u`HR!+GNu90N-{DUVa$?oZ(S10QwJG|IA3f_F#(a#v!LG#L0 zuDuXFJ*OQ%mmOtxrpdV%?@VsMeJvEO0Wx^9*W-KiC1ESf6oIqaxY?H%nfA2zv%2ZG7U2o}mPxhzm!Au&}FS{|T zzr(#We(d$PVbw1AALs7u&ZeA$*HV$njaeGMO z@Qk`dp6&IiY(fCQS!V3sQwyDaE1J*J*YNMRxD+2QZ$A5acAgVM{TE+Z;}8wq)6+w0 z^I3cf=#XWgNN*8Kk|RnzMwViX)yS8Z$`JaMQBQJHhDfP3K|sLbhwS%a9Q)C^oP{sz z=}bjZ0ruHi~fzb{ZcM zwOF5(h9Bc~9O?k6vf;0wrqb|DD9#tdx)pH>vm0lH6h_~p+~8}@2L9?t{GM0ajT2Q zWbybEX9a2`%yt3F7fDthpz?X(`C~l&iO0Nyn;Va*{~RBcl^(empb_N;i0!%C7Q#jV z|8-zaAAV9I&1McVfPX*?u@J>e_?(W!3+Awu(&H&Jt$TCp$^sf$mX3^(?>99o%?C^LzKTB>B19<33_TQ$A(c18MINR*cfiESnamE?9NIAoI<7e$ z-4GKRe@kUE?5bs1=R;a9js0pcySo{y`7=1B>EX%270^FC{_Lup78hB?V;J81g1`aYMepCNLIrwo9HI^Cvg-c~i~M8m0JMt`LLBS*ZM0!RRiB2@bAzS2#wjIT;|4F= z;}9FqNP<3nBLV(%Xh&Fz&`aHSSAhRc6Ms1)Y$FJNR04#O((Qd7&%I_v;g9e&Uxu!~ zg)ZBuTVz*j`krfw26(8mZ-+_QvSEkn??EG%HV?w|J_ftS`%v35Gl5;7z`X2(bX$UF|#I_2=_XIZ0cotjj_caK%PBiGJP+aOe@fgCxIG| zemjQr)c%d;h%6NsUXqIYJD+e0K zO&QI$^&I^%h%8g+5+Kw1_VyIwt;fOCdgNKeoP&(T?+4MC;(J1BCJ^R(!ej~#Dzl61 zTEdyDv4k^MV~KQpC`-KrBGg9WxSZ=BMdO;oBXP}FNSBq3T1nid5|zX>DPny^kRR<{~VO}jEjSe&YvB> z^H3MSmt}%M^oXw*s%&A^koweK7pA03+RqKb)c~W`v#*y7^<<`jDqctBOGI>#`=Vj z+=JlwYd9aqPJ*ws!K4rL|E)@nBiR^nEEW&J&L6P>083>XfPsCvXzb8Rz?0BHehj^1 z*v1E1x(|UB_=J<; z7&^4{3^*>=p_ig@9I8Xah<7d`8Dppp$+SM-)$5S3!>K%q^^dZ|T<^j+9dwFGYXMIV zu2`zQQ_OS30j_O>R9GD++wC5caj=4;z!>iq7bQ8I&zqLb4+3pg%~9ZOh+h7JE`3kx zpa8CaC+7PcT!-$t+WCKZ;P1EvE_?Bki9USrlY={q@Om_j3dM)M4C~$@2TEVUb^v<= zo`Q8PdFqX5ql5-bw1P~yXW~Tup}|-1-_ZPF3>z;E>e1K;6*kHDr!pg)TggN5(;Gns zqX{&I$0Wp#(#hY7s$1!OTXh=q0FZufjEKooC!>iNsyRvBGPFzrDlLo2-Jc|;doB`? z`lusCqh_xCmJhPh>7z2I)wrA-7(}BJ?^UnZWNMY@x#Ir;&UKBq~FD+ z2Kjp!>#GNk*CPkWAFHd6Ca(K!0osaXjJm1?ce42`Mjh{5(9A{Y0;2JEffK#RpCC>i HXMq0z47&3F diff --git a/bepascal/bepascal/codegen/README b/bepascal/bepascal/codegen/README deleted file mode 100644 index d97afb9..0000000 --- a/bepascal/bepascal/codegen/README +++ /dev/null @@ -1,2 +0,0 @@ -This tool read XML description of BeAPIs and generate pascal and C/C++ source code -to access this API from pascal source code diff --git a/bepascal/bepascal/codegen/apireader.pp b/bepascal/bepascal/codegen/apireader.pp deleted file mode 100644 index b522e1d..0000000 --- a/bepascal/bepascal/codegen/apireader.pp +++ /dev/null @@ -1,642 +0,0 @@ -{ 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 apireader; - -{$H+} // use AnsiStrings - -interface - -uses - Classes, SysUtils, xmlread, dom; - -const - ImportFuncString = ' cdecl; external BePascalLibName name ''%s_%s'';'; - -type - TNode = class(TObject) - private - function GetCount : integer; - function GetNode(Index : integer) : TNode; - protected - FNode : TDOMNode; - FChildren : TStringList; - public - constructor Create(Node : TDOMNode); virtual; - destructor Destroy; override; - procedure Start; virtual; - procedure Middle; virtual; - procedure Ends; virtual; - property Count : integer read GetCount; - property Nodes[Index : integer] : TNode read GetNode; - end; - TClassess = class; - TDocument = class(TNode) - private - function GetClasses(Index : integer) : TClassess; - protected - public - constructor Create(Node : TDOMNode); override; - procedure Start; override; - procedure Middle; override; - procedure Ends; override; - property Classes[Index : integer] : TClassess read GetClasses; - end; - TClasse = class; - TClassess = class(TNode) - private - function GetClasse(Index : integer) : TClasse; - protected - public - constructor Create(Node : TDOMNode); override; - procedure Start; override; - procedure Middle; override; - procedure Ends; override; - property Classes[Index : integer] : TClasse read GetClasse; - end; - TNamedItem = class(TNode) - private - protected - function GetName : string; - public - property Name : string read GetName; - end; - TFunction = class; - TClasse = class(TNamedItem) - private - function GetFunction(Index : integer) : TFunction; - protected - function GetAncestor : string; - public - constructor Create(Node : TDOMNode); override; - procedure Start; override; - procedure Ends; override; - property Ancestor : string read GetAncestor; - property Functions[Index : integer] : TFunction read GetFunction; - end; - TResultType = class; - TParam = class; - TFunction = class(TNamedItem) - private - FResultType : TResultType; - FClasse : TClasse; - BodyPas : string; - function GetParam(Index : integer) : TParam; - protected - public - constructor Create(Node : TDOMNode); override; - destructor Destroy; override; - function IsConstructor : boolean; - function IsDestructor : boolean; - function HasParams : boolean; - function ProcName : string; - function ProcNameInObject : string; - function SelfParam : string; - function SelfParamImpl : string; - procedure Start; override; - procedure Ends; override; - property ResultType : TResultType read FResultType; - property Params[Index : integer] : TParam read GetParam; - property Classe : TClasse read FClasse; - end; - TTypedItem = class(TNamedItem) - private - protected - function GetType : string; - public - function IsObject : boolean; - property Typ : string read GetType; - end; - TParam = class(TTypedItem) - private - FFunction : TFunction; - protected - public - procedure Middle; override; - property ParentFunction : TFunction read FFunction; - end; - TResultType = class(TNode) - private - protected - function GetType : string; - public - property Typ : string read GetType; - end; - -implementation - -uses - sourcewrite, typmap; - -// Debug proc -procedure NodeInfo(Node : TDOMNode); -begin - WriteLn(Node.NodeName + ',' + Node.NodeValue + ',' + IntToStr(Node.NodeType)); -end; - -constructor TNode.Create(Node : TDOMNode); -begin - inherited Create; - FNode := Node; -end; - -destructor TNode.Destroy; -var - i : integer; -begin - if FChildren <> nil then - begin - for i := 0 to FChildren.Count - 1 do - begin - if FChildren.Objects[i] <> nil then - FChildren.Objects[i].Free; - end; - FChildren.Free; - end; - inherited; -end; - -function TNode.GetCount : integer; -begin - if FChildren <> nil then - Result := FChildren.Count - else - Result := 0; -end; - -function TNode.GetNode(Index : integer) : TNode; -begin - Result := FChildren.Objects[Index] as TNode; -end; - -procedure TNode.Start; -begin - Write('Start : '); - if FNode <> nil then - NodeInfo(FNode); -end; - -procedure TNode.Middle; -var - i : integer; -begin - Write('Middle : '); - if FNode <> nil then - begin - NodeInfo(FNode); - for i := 0 to Count - 1 do - begin - Nodes[i].Start; - Nodes[i].Middle; - Nodes[i].Ends; - end; - end; -end; - -procedure TNode.Ends; -begin - Write('Ends : '); - if FNode <> nil then - NodeInfo(FNode); -end; - -constructor TDocument.Create(Node : TDOMNode); -var - i : integer; - aClasses : TClassess; - List : TStringList; -begin - if Node.HasChildNodes then - begin - List := TStringList.Create; - for i := 0 to Node.ChildNodes.count - 1 do - begin - aClasses := TClassess.Create(Node.ChildNodes.Item[i]); - List.AddObject(IntToStr(i), aClasses); - end; - FChildren := List; - end; -end; - -function TDocument.GetClasses(Index : integer) : TClassess; -begin - Result := FChildren.Objects[Index] as TClassess; -end; - -procedure TDocument.Start; -begin -end; - -procedure TDocument.Middle; -var - i : integer; -begin - for i := 0 to Count - 1 do - begin - Classes[i].Start; - Classes[i].Middle; - Classes[i].Ends; - end; -end; - -procedure TDocument.Ends; -begin -end; - -constructor TClassess.Create(Node : TDOMNode); -var - i : integer; - aClasse : TClasse; - List : TStringList; -begin - inherited; - if Node.HasChildNodes then - begin - List := TStringList.Create; - for i := 0 to Node.ChildNodes.count - 1 do - begin - aClasse := TClasse.Create(Node.ChildNodes.Item[i]); - List.AddObject(aClasse.Name, aClasse); - end; - FChildren := List; - end; -end; - -function TClassess.GetClasse(Index : integer) : TClasse; -begin - Result := FChildren.Objects[Index] as TClasse; -end; - -function TNamedItem.GetName : string; -var - DomNode : TDOMNode; -begin - DomNode := FNode.Attributes.GetNamedItem('NAME'); - if DomNode <> nil then - begin - Result := DomNode.NodeValue; - end; -end; - -procedure TClassess.Start; -begin - SourceWriter.Pas.Add(''); -end; - -procedure TClassess.Middle; -var - i : integer; -begin - for i := 0 to Count - 1 do - begin - Nodes[i].Start; - Nodes[i].Middle; - Nodes[i].Ends; - end; -end; - -procedure TClassess.Ends; -begin -end; - -constructor TClasse.Create(Node : TDOMNode); -var - i : integer; - aFunc : TFunction; - List : TStringList; -begin - inherited; - if Node.HasChildNodes then - begin - List := TStringList.Create; - for i := 0 to Node.ChildNodes.count - 1 do - begin - aFunc := TFunction.Create(Node.ChildNodes.Item[i]); - aFunc.FClasse := Self; - WriteLn(aFunc.Name); - WriteLn(''); - List.AddObject(aFunc.Name, aFunc); - end; - FChildren := List; - end; -end; - -function TClasse.GetAncestor : string; -begin - if FNode.Attributes.GetNamedItem('ANCESTOR') <> nil then - Result := FNode.Attributes.GetNamedItem('ANCESTOR').NodeValue - else - Result := ''; -end; - -function TClasse.GetFunction(Index : integer) : TFunction; -begin - Result := FChildren.Objects[Index] as TFunction; -end; - -procedure TClasse.Start; -begin - with SourceWriter.InterfacePas do - begin - Add('type'); - Add(Format(' %s = class(%s)', [CppToPas(Name + ' *'), CppToPas(Ancestor + ' *')])); - Add(' private'); - Add(' public'); - end; -end; - -procedure TClasse.Ends; -begin - with SourceWriter.InterfacePas do - begin - Add(' end;'); - end; -end; - -constructor TFunction.Create(Node : TDOMNode); -var - i : integer; - aParam : TParam; - List : TStringList; -begin - inherited; - if Node.HasChildNodes then - begin - List := TStringList.Create; - for i := 0 to Node.ChildNodes.count - 1 do - begin - if Node.ChildNodes.Item[i].Attributes.GetNamedItem('NAME') <> nil then - begin - aParam := TParam.Create(Node.ChildNodes.Item[i]); - aParam.FFunction := Self; - WriteLn('Param : ' + aParam.Name + '; ' + 'Type : ' + aParam.Typ); - List.AddObject(aParam.Name, aParam); - end - else - begin - FResultType := TResultType.Create(Node.ChildNodes.Item[i]); - WriteLn('ResultType : ' + FResultType.Typ); - end; - end; - FChildren := List; - end; -end; - -destructor TFunction.Destroy; -begin - if Assigned(FResultType) then - FResultType.Free; - inherited; -end; - -function TFunction.IsConstructor : boolean; -begin - Result := (Name = Classe.Name); -end; - -function TFunction.IsDestructor : boolean; -begin - Result := (Name[1] = '~'); -end; - -function TFunction.GetParam(Index : integer) : TParam; -begin - Result := FChildren.Objects[Index] as TParam; -end; - -function TFunction.HasParams : boolean; -begin - Result := (Count > 0); -end; - -function TFunction.ProcName : string; -begin - if IsConstructor then - Result := 'Create' - else if IsDestructor then - Result := 'Free' - else - Result := Name; -end; - -function TFunction.ProcNameInObject : string; -begin - if IsConstructor then - Result := 'Create' - else if IsDestructor then - Result := 'Destroy' - else - Result := Name; -end; - -function TFunction.SelfParam : string; -begin - if IsConstructor then - Result := '(AObject : TBeObject; ' - else - Result := '(AObject : TCPlusObject; ' -end; - -function TFunction.SelfParamImpl : string; -begin - if IsConstructor then - Result := '(Self, ' - else - Result := '(CPlusObject, ' -end; - -procedure TFunction.Start; -var - EndChar : string; -begin - WriteLn('Function Start'); - if HasParams then - EndChar := '(' - else - EndChar := ''; - with SourceWriter.InterfacePas do - begin - if IsConstructor then - Add(Format(' constructor %s%s', [ProcNameInObject, EndChar])) - else if IsDestructor then - Add(Format(' destructor %s%s', [ProcNameInObject, EndChar])) - else if (ResultType.Typ = '') or (ResultType.Typ = 'void') then - Add(Format(' procedure %s%s', [Name, EndChar])) - else - Add(Format(' function %s%s', [Name, EndChar])); - end; - // Import of C functions - with SourceWriter.ImportFuncsPas do - begin - if ((ResultType.Typ = '') or (ResultType.Typ = 'void')) and - not IsConstructor then - Add(Format('procedure %s_%s%s', [Classe.Name, ProcName, SelfParam])) - else - Add(Format('function %s_%s%s', [Classe.Name, ProcName, SelfParam])); - end; - with SourceWriter.ImplementationPas do - begin - if (ResultType.Typ = '') or (ResultType.Typ = 'void') then - begin - if IsConstructor then - Add(Format('constructor %s.%s%s', [CppToPas(Classe.Name + ' *'), ProcNameInObject, EndChar])) - else if IsDestructor then - Add(Format('destructor %s.%s%s', [CppToPas(Classe.Name + ' *'), ProcNameInObject, EndChar])) - else - Add(Format('procedure %s.%s%s', [CppToPas(Classe.Name + ' *'), ProcName, EndChar])); - end - else - Add(Format('function %s.%s%s', [CppToPas(Classe.Name + ' *'), ProcName, EndChar])); - end; - // Implementation body - if IsConstructor then - BodyPas := Format(' CPlusObject := %s_%s%s', [Classe.Name, ProcName, SelfParamImpl]) - else if (ResultType.Typ = '') or (ResultType.Typ = 'void') then - BodyPas := Format(' %s_%s%s', [Classe.Name, ProcName, SelfParamImpl]) - else - BodyPas := Format(' Result := %s_%s%s', [Classe.Name, ProcName, SelfParamImpl]); -end; - -procedure TFunction.Ends; -var - EndChar : string; - procedure DeleteLastSep(List : TStringList); - var - s : string; - begin - // Delete the last '; ' - s := List.Strings[List.Count - 1]; - System.Delete(s, Length(s) - 1, 2); - List.Strings[List.Count - 1] := s; - end; - procedure AddLastSep(List : TStringList); - var - s : string; - begin - if not((ResultType.Typ = '') or (ResultType.Typ = 'void')) then - begin - WriteLn(ResultType.Typ); - WriteLn(Name); - s := Format('%s%s : %s;', [List.Strings[List.Count - 1], EndChar, CppToPas(ResultType.Typ)]); - List.Strings[List.Count - 1] := s; - end - else if IsConstructor then - begin - WriteLn(ResultType.Typ); - WriteLn(Name); - s := Format('%s%s;', [List.Strings[List.Count - 1], EndChar]); - List.Strings[List.Count - 1] := s; - end - else - List.Strings[List.Count - 1] := Format('%s%s;', [List.Strings[List.Count - 1], EndChar]); - end; -var - s : string; -begin - WriteLn('Function ends'); - if hasParams then - begin - EndChar := ')'; - DeleteLastSep(SourceWriter.InterfacePas); - end - else - begin - EndChar := ''; - end; - AddLastSep(SourceWriter.InterfacePas); - // Import C functions - EndChar := ')'; - DeleteLastSep(SourceWriter.ImportFuncsPas); - AddLastSep(SourceWriter.ImportFuncsPas); - with SourceWriter.ImportFuncsPas do - begin - s := Format('%s' + ImportFuncString, [Strings[Count - 1], Classe.Name, ProcName]); - Strings[Count - 1] := s; - end; - - if hasParams then - begin - EndChar := ')'; - DeleteLastSep(SourceWriter.ImplementationPas); - end - else - begin - EndChar := ''; - end; - AddLastSep(SourceWriter.ImplementationPas); - SourceWriter.ImplementationPas.Add('begin'); - System.Delete(BodyPas, Length(BodyPas) - 1, 2); - SourceWriter.ImplementationPas.Add(BodyPas + ');'); - SourceWriter.ImplementationPas.Add('end;'); - SourceWriter.ImplementationPas.Add(''); -end; - -function TTypedItem.GetType : string; -begin - Result := FNode.Attributes.GetNamedItem('TYPE').NodeValue; -end; - -function TTypedItem.IsObject : boolean; -begin - // The first letter is a 'B' -> this is an object ! - Result := (Typ[1] = 'B'); -end; - -procedure TParam.Middle; - procedure WriteParamImport(List : TStringList); - var - s : string; - begin - WriteLn('WriteParamImport'); - WriteLn(List.Strings[List.Count - 1]); - if IsObject then - begin - WriteLn('IsObject'); - s := Format('%s%s : %s; ', [List.Strings[List.Count - 1], Name, 'TCPlusObject']); - end - else - s := Format('%s%s : %s; ', [List.Strings[List.Count - 1], Name, CppToPas(Typ)]); - List.Strings[List.Count - 1] := s; - WriteLn(List.Strings[List.Count - 1]); - end; - procedure WriteParam(List : TStringList); - var - s : string; - begin - WriteLn(List.Strings[List.Count - 1]); - s := Format('%s%s : %s; ', [List.Strings[List.Count - 1], Name, CppToPas(Typ)]); - List.Strings[List.Count - 1] := s; - WriteLn(List.Strings[List.Count - 1]); - end; -begin - WriteLn('Param Middle'); - WriteParam(SourceWriter.InterfacePas); - WriteParamImport(SourceWriter.ImportFuncsPas); - WriteParam(SourceWriter.ImplementationPas); - if IsObject then - ParentFunction.BodyPas := Format('%s%s.CPlusObject, ', [ParentFunction.BodyPas, Name]) - else - ParentFunction.BodyPas := Format('%s%s, ', [ParentFunction.BodyPas, Name]); -end; - -function TResultType.GetType : string; -begin - Result := FNode.Attributes.GetNamedItem('TYPE').NodeValue; -end; - -end. diff --git a/bepascal/bepascal/codegen/codegen.pp b/bepascal/bepascal/codegen/codegen.pp deleted file mode 100644 index b5d6644..0000000 --- a/bepascal/bepascal/codegen/codegen.pp +++ /dev/null @@ -1,54 +0,0 @@ -{ 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 -} -program codegen; - -{$H+} // use AnsiStrings - -uses - dom, xmlread, apireader, typmap, codewrite, SysUtils; - -var - aDoc : TXMLDocument; - HooksDoc : TXMLDocument; - Classes, Hooks : TDocument; - SrcGen : TSourceGen; -begin - if ParamCount > 0 then - begin - ReadXMLFile(aDoc, Paramstr(1)); - ReadXMLFile(HooksDoc, 'hooks.xml'); - Classes := TDocument.Create(aDoc); - try - Hooks := TDocument.Create(HooksDoc); - try - SrcGen := TSourceGen.Create(Classes, Hooks, StringReplace(Paramstr(1), '.xml', '', [])); - try - SrcGen.Gen; - WriteLn('After gen'); - finally - SrcGen.Free; - end; - finally - Hooks.Free; - end; - finally - Classes.Free; - end; - end; - -end. diff --git a/bepascal/bepascal/codegen/codewrite.pp b/bepascal/bepascal/codegen/codewrite.pp deleted file mode 100644 index caec720..0000000 --- a/bepascal/bepascal/codegen/codewrite.pp +++ /dev/null @@ -1,80 +0,0 @@ -{ 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 codewrite; - -interface - -{$H+} // use AnsiStrings - -uses - Classes, SysUtils, apireader, sourcewrite; - -type - TSourceGen = class(TObject) - private - FClasses : TDocument; - FHooks : TDocument; - protected - procedure Enum(Node : TNode); - public - constructor Create(Classes, Hooks : TDocument; FileName : string); virtual; - destructor Destroy; override; - procedure Gen; - end; - -implementation - -constructor TSourceGen.Create(Classes, Hooks : TDocument; FileName : string); -begin - inherited Create; - FClasses := Classes; - FHooks := Hooks; - SourceWriter := TSourceWriter.Create(FileName); -end; - -destructor TSourceGen.Destroy; -begin - SourceWriter.Free; - inherited; -end; - -procedure TSourceGen.Gen; -begin - Enum(FClasses); -end; - -procedure TSourceGen.Enum(Node : TNode); -var - i : integer; -begin - if Node <> nil then - begin - for i := 0 to Node.Count - 1 do - begin - Node.Start; - WriteLn('Before Enum'); - Node.Middle; - WriteLn('After enum'); - Node.Ends; - end; - end; -end; - - -end. diff --git a/bepascal/bepascal/codegen/hooks.xml b/bepascal/bepascal/codegen/hooks.xml deleted file mode 100644 index f12a1c1..0000000 --- a/bepascal/bepascal/codegen/hooks.xml +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bepascal/bepascal/codegen/sourcewrite.pp b/bepascal/bepascal/codegen/sourcewrite.pp deleted file mode 100644 index 5f580e3..0000000 --- a/bepascal/bepascal/codegen/sourcewrite.pp +++ /dev/null @@ -1,140 +0,0 @@ -{ 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 sourcewrite; - -{$H+} // use AnsiStrings - -interface - -uses - SysUtils, Classes, apireader; - -const - Eol = #10; - CLicense = -'/* BePascal - A pascal wrapper around the BeOS API ' + Eol + -' Copyright (C) 2002 Olivier Coursiere ' + Eol + -' Eric Jourde ' + Eol + -' ' + Eol + -' This library is free software; you can redistribute it and/or ' + Eol + -' modify it under the terms of the GNU Library General Public ' + Eol + -' License as published by the Free Software Foundation; either ' + Eol + -' version 2 of the License, or (at your option) any later version. ' + Eol + -' ' + Eol + -' This library is distributed in the hope that it will be useful, ' + Eol + -' but WITHOUT ANY WARRANTY; without even the implied warranty of ' + Eol + -' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ' + Eol + -' Library General Public License for more details. ' + Eol + -' ' + Eol + -' You should have received a copy of the GNU Library General Public ' + Eol + -' License along with this library; if not, write to the Free ' + Eol + -' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ' + Eol + -'*/ '; - PasLicense = -'{ BePascal - A pascal wrapper around the BeOS API ' + Eol + -' Copyright (C) 2002 Olivier Coursiere ' + Eol + -' Eric Jourde ' + Eol + -' ' + Eol + -' This library is free software; you can redistribute it and/or ' + Eol + -' modify it under the terms of the GNU Library General Public ' + Eol + -' License as published by the Free Software Foundation; either ' + Eol + -' version 2 of the License, or (at your option) any later version. ' + Eol + -' ' + Eol + -' This library is distributed in the hope that it will be useful, ' + Eol + -' but WITHOUT ANY WARRANTY; without even the implied warranty of ' + Eol + -' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ' + Eol + -' Library General Public License for more details. ' + Eol + -' ' + Eol + -' You should have received a copy of the GNU Library General Public ' + Eol + -' License along with this library; if not, write to the Free ' + Eol + -' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ' + Eol + -'} '; - -type - TSourceWriter = class(TObject) - private - FH : TStringList; - FCpp : TStringList; - FPas : TStringList; - FFileName : string; - FHooks : TDocument; - FInterfacePas : TStringList; - FImplementationPas : TStringList; - FImportFuncsPas : TStringList; - public - constructor Create(FileName : string); virtual; - destructor Destroy; override; - property H : TStringList read FH; - property Cpp : TStringList read FCpp; - property Pas : TStringList read FPas; - property Hooks : TDocument read FHooks write FHooks; - property InterfacePas : TStringList read FInterfacePas; - property ImplementationPas : TStringList read FImplementationPas; - property ImportFuncsPas : TStringList read FImportFuncsPas; - end; - -var - SourceWriter : TSourceWriter; - -implementation - -constructor TSourceWriter.Create(FileName : string); -begin - inherited Create; - FFileName := FileName; - FH := TStringList.Create; - FH.Add(CLicense); - FCpp := TStringList.Create; - FCpp.Add(CLicense); - FPas := TStringList.Create; - FPas.Add(PasLicense); - FPas.Add('unit ' + LowerCase(FFileName) + ';'); - FPas.Add(''); - FPas.Add('interface'); - FPas.Add(''); - FPas.Add('uses'); - FPas.Add(' beobj;'); - FInterfacePas := TStringList.Create; - FImplementationPas := TStringList.Create; - FImportFuncsPas := TStringList.Create; -end; - -destructor TSourceWriter.Destroy; -begin - // Writing files - FH.SaveToFile(FFileName + '.h'); - FH.Free; - FCpp.SaveToFile(FFileName + '.cpp'); - FCpp.Free; - FPas.Add(FInterfacePas.Text); - FPas.Add(FImportFuncsPas.Text); - FPas.Add('implementation'); - FPas.Add(''); - FPas.Add(FImplementationPas.Text); - // write the end of pascal unit - FPas.Add('end.'); - FPas.SaveToFile(LowerCase(FFileName) + '.pp'); - FPas.Free; - FInterfacePas.Free; - FImplementationPas.Free; - FImportFuncsPas.Free; - inherited; -end; - -end. diff --git a/bepascal/bepascal/codegen/typemap.txt b/bepascal/bepascal/codegen/typemap.txt deleted file mode 100644 index a93edfc..0000000 --- a/bepascal/bepascal/codegen/typemap.txt +++ /dev/null @@ -1,93 +0,0 @@ -_cmd_key_ *=TCmd_Key -add_state=TAdd_State -BArchivable *=TArchivable -BButton &=TButton -BButton *=TButton -BControl &=TControl -BControl *=TControl -BDataIO &=TDataIO -BDataIO *=TDataIO -BHandler **=THandler -BHandler *=THandler -bigtime_t=TBigtime_t -BInvoker &=TInvoker -BInvoker *=TInvoker -BList *=TList -BLooper **=TLooper -BMallocIO &=TMallocIO -BMallocIO *=TMallocIO -BMemoryIO &=TMemoryIO -BMemoryIO *=TMemoryIO -BMenu &=TMenu -BMenu **=TMenu -BMenu *=TMenu -BMenuBar *=TMenuBar -BMenuItem **=TMenuItem -BMenuItem *=TMenuItem -BMenuWindow *=TMenuWindow -BMessage *=TMessage -BMessenger &=TMessenger -BMessenger *=TMessenger -BMessenger=TMessenger -bool *=boolean -bool=boolean -BPoint *=TPoint -BPoint=TPoint -BPositionIO *=TPositionIO -BRect *=TRect -BRect=TRect -BSerialPort *=TSerialPort -BView *=TView -BWindow &=TWindow -BWindow *=TWindow -char *=PChar -color_space=TColor_Space -const BButton &=TButton -const BControl &=TControl -const BDataIO &=TDataIO -const BHandler *=THandler -const BInvoker &=TInvoker -const BLooper *=TLooper -const BMallocIO &=TMallocIO -const BMemoryIO &=TMemoryIO -const BMenu &=TMenu -const BMessage *=TMessage -const BMessenger &=TMessenger -const BWindow *=TWindow -const char **=PChar -const char *=PChar -const void *=Pointer -data_bits=TDatabits -data_rate=TDataRate -drawing_mode=TDrawing_Mode -float *=double -float=double -int *=integer -int32 *=^integer -int32=integer -int=integer -long=integer -menu_info *=PMenu_Info -menu_layout=TMenu_Layout -menu_tracking_hook=TMenu_Tracking_Hook -off_t=Toff_t -parity_mode=TParityMode -perform_code=TPerform_code -port_id=TPort_id -size_t=TSize_t -ssize_t=TSSize_t -status_t *=PStatus_t -status_t=TStatus_t -stop_bits=TStopbits -team_id=TTeam_id -thread_id=TThread_id -uint32=Cardinal -void *=Pointer -void= -window_alignment *=PCardinal -window_alignment=Cardinal -window_feel *=PCardinal -window_feel=Cardinal -window_look *=PCardinal -window_look=PCardinal -window_type=Cardinal diff --git a/bepascal/bepascal/codegen/typmap.pp b/bepascal/bepascal/codegen/typmap.pp deleted file mode 100644 index 83fa180..0000000 --- a/bepascal/bepascal/codegen/typmap.pp +++ /dev/null @@ -1,51 +0,0 @@ -unit typmap; - -interface - -uses - SysUtils, Classes; - -function CppToPas(CppType : string) : string; -function PasToCpp(PasType : string) : string; - -implementation - -const - TypMapFileName = 'typemap.txt'; -var - aTypMap : TStringList; - NewTypMap : TStringList; - -function CppToPas(CppType : string) : string; -var - i : integer; -begin - Result := aTypMap.Values[CppType]; - if Result = '' then - begin - if not NewTypMap.Find(CppType + '=', i) then - NewTypMap.Add(CppType + '='); - end; -end; - -function PasToCpp(PasType : string) : string; -begin - // To implement if necessary - Result := ''; -end; - -initialization - aTypMap := TStringList.Create; - aTypMap.LoadFromFile(TypMapFileName); - aTypMap.Sorted := True; - NewTypMap := TStringList.Create; - NewTypMap.Sorted := True; - -finalization -// WriteLn(aTypMap.Text); - aTypMap.SaveToFile(TypMapFileName); - aTypMap.Free; - NewTypMap.SaveToFile(TypMapFileName + '.new'); - NewTypMap.Free; - -end. diff --git a/bepascal/bepascal/headertoxml/README b/bepascal/bepascal/headertoxml/README deleted file mode 100644 index 45503ef..0000000 --- a/bepascal/bepascal/headertoxml/README +++ /dev/null @@ -1,4 +0,0 @@ -This tool use libstubgen.so to parse C++ headers and generate -the corresponding XML description. - -This tool is part of the BeFPC poject. \ No newline at end of file diff --git a/bepascal/bepascal/headertoxml/headertoxml.pp b/bepascal/bepascal/headertoxml/headertoxml.pp deleted file mode 100644 index 0201f63..0000000 --- a/bepascal/bepascal/headertoxml/headertoxml.pp +++ /dev/null @@ -1,221 +0,0 @@ -{ headertoxml - A tool from the befpc project - 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 -} -program headertoxml; - -{ - - - - - - - - - - - - -} - -{$H+} // use AnsiStrings - -uses - Classes, SysUtils, stubgen; - -const - Eol = #10; - -function Convert(s : string) : string; -begin - Result := StringReplace(s, '&', '&', [rfReplaceAll]); -end; - -type - TXMLWriter = class(TObject) - private - FFileName : string; - FLevel : integer; - FList : TStringList; - procedure StartTag(TagName : string); - procedure EndTags; - public - constructor Create(FileName : string); - destructor Destroy; override; - procedure StartClasses; - procedure EndClasses; - procedure StartClasse(Elem : PSyntaxelem); - procedure EndClasse; - procedure StartFunction(Elem : PSyntaxelem); - procedure EndFunction; - procedure StartParams; - procedure EndParams; - procedure StartParam(Elem : PArgument); - procedure StartResult(aType : PChar); - end; - -constructor TXMLWriter.Create(FileName : string); -begin - inherited Create; - FLevel := 0; - FList := TStringList.Create; - FFileName := ChangeFileExt(FileName, '.xml'); -end; - -destructor TXMLWriter.Destroy; -begin - FList.SaveToFile(FFileName); - FList.Free; - inherited; -end; - -procedure TXMLWriter.StartTag(TagName : string); -begin - Inc(FLevel); -end; - -procedure TXMLWriter.EndTags; -var - i : integer; -begin - for i := 0 to FLevel - 1 do - begin -// Write - end; -end; - -procedure TXMLWriter.StartClasses; -begin - FList.Add(''); -end; - -procedure TXMLWriter.EndClasses; -begin - FList.Add(''); -end; - -procedure TXMLWriter.StartClasse(Elem : PSyntaxelem); -begin - if Elem <> nil then - FList.Add(Format('', [Elem^.aName])) - else - WriteLn('Classe nil'); -end; - -procedure TXMLWriter.EndClasse; -begin - FList.Add(''); -end; - -procedure TXMLWriter.StartFunction(Elem : PSyntaxelem); -begin - FList.Add(Format('', [Elem^.aName])); -end; - -procedure TXMLWriter.EndFunction; -begin - FList.Add(''); -end; - -procedure TXMLWriter.StartParams; -begin - FList.Add(''); -end; - -procedure TXMLWriter.EndParams; -begin - FList.Add(''); -end; - -procedure TXMLWriter.StartParam(Elem : PArgument); -begin - if (Elem^.aType <> 'void') or (Elem^.aName <> '') then - FList.Add(Format('', [Elem^.aName, Convert(Elem^.aType)])); -end; - -procedure TXMLWriter.StartResult(aType : PChar); -begin - if aType <> nil then - FList.Add(Format('', [Convert(aType)])); -end; - -var - Elem : PSyntaxelem; - fic : PChar; - s : string; - XMLWriter : TXMLWriter; - Current : PSyntaxelem; - CurrentArg : PArgument; -begin - WriteLn('Bonjour !'); - if ParamCount > 0 then - begin - WriteLn(Paramstr(1)); - init_tables; - s := Paramstr(1) + #0; - UniqueString(s); - fic := PChar(s); - Elem := scan(fic); - XMLWriter := TXMLWriter.Create(s); - try - XMLWriter.StartClasses; - while Elem <> nil do - begin - if Elem <> nil then - WriteLn(Elem^.aName); - XMLWriter.StartClasse(Elem); - XMLWriter.StartFunction(Elem^.children); - CurrentArg := Elem^.args; - if CurrentArg <> nil then - begin - XMLWriter.StartParam(CurrentArg); - while CurrentArg^.Next <> nil do - begin - CurrentArg := CurrentArg^.Next; - XMLWriter.StartParam(CurrentArg); - end; - end; - XMLWriter.StartResult(Elem^.ret_type); - XMLWriter.EndFunction; - Current := Elem^.children; - while Current^.next <> nil do - begin - Current := Current^.next; - XMLWriter.StartFunction(Current); - CurrentArg := Current^.args; - if CurrentArg <> nil then - begin - XMLWriter.StartParam(CurrentArg); - while CurrentArg^.next <> nil do - begin - CurrentArg := CurrentArg^.next; - XMLWriter.StartParam(CurrentArg); - end; - end; - XMLWriter.StartResult(Current^.ret_type); - XMLWriter.EndFunction; - end; - XMLWriter.EndClasse; - Elem := Elem^.next; - end; - XMLWriter.EndClasses; - finally - XMLWriter.Free; - end; - free_tables; - end; -end. diff --git a/bepascal/bepascal/hookgen/README.txt b/bepascal/bepascal/hookgen/README.txt deleted file mode 100644 index aec38f1..0000000 --- a/bepascal/bepascal/hookgen/README.txt +++ /dev/null @@ -1,32 +0,0 @@ -HookGen -======= - -HookGen is a developper tool written in pascal. It is designed to -generate pascal and C++ source files needed to implement -BeOS hooks functions in BePascal. This tool work with a description -of the BeOS hooks functions stored in a XML file. - -Files -===== - -README.txt : this file ! - -hookgen.pp : the main program ! - -typenum.pp : this tool read hook.xml and write a file with all C++ types. - hookgen use the result file to translate a C++ type in a - pascal type. - -hooks.xml : XML description of BeOS hook functions - -typemap.txt : the type map needed to convert C++ types to pascal types. - -Installation -============ - -Compile kookgen.pp et typenum.pp with the -S2 option : - - fpc -S2 hookgen.pp - fpc -S2 typenum.pp - -(only tested with fpc 1.06) \ No newline at end of file diff --git a/bepascal/bepascal/hookgen/hookgen.pp b/bepascal/bepascal/hookgen/hookgen.pp deleted file mode 100644 index 61436b2..0000000 --- a/bepascal/bepascal/hookgen/hookgen.pp +++ /dev/null @@ -1,704 +0,0 @@ -program hookgen; - -{$H+} // use AnsiStrings - -uses - Classes, SysUtils, xmlread, DOM; - -const - Eol = #10; - StartExternalC = '#if defined(__cplusplus)' + Eol + - 'extern "C" {' + Eol+ - '#endif' + Eol; - - EndExternalC = '#if defined(__cplusplus)' + Eol + - '}' + Eol + - '#endif'; - -type - TSourceWriter = class(TObject) - private - FH : TStringList; - FCpp : TStringList; - FPas : TStringList; - FTypMap : TStringList; - FFileName : string; - public - constructor Create(FileName : string); virtual; - destructor Destroy; override; - property H : TStringList read FH; - property Cpp : TStringList read FCpp; - property Pas : TStringList read FPas; - property TypMap : TStringList read FTypMap; - end; - -constructor TSourceWriter.Create(FileName : string); -begin - inherited Create; - FFileName := FileName; - FH := TStringList.Create; - FCpp := TStringList.Create; - FPas := TStringList.Create; - FTypMap := TStringList.Create; - FTypMap.LoadFromFile('typemap.txt'); -end; - -destructor TSourceWriter.Destroy; -begin - // .h not used yet -// FH.SaveToFile(FFileName + '.h'); - FH.Free; - FCpp.SaveToFile(FFileName + '.cpp'); - FCpp.Free; - FPas.SaveToFile(FFileName + '.pas'); - FPas.Free; - FTypMap.Free; - inherited; -end; - -type - TClasse = class; - TFunction = class(TObject) - private - FName : string; - FParent : TClasse; - FParams : TStringList; - FResultType : string; - function CommaIfNotEmpty(s : string) : string; - public - constructor Create(Parent : TClasse; FunctionName : string); virtual; - destructor Destroy; override; - function GetPascalParams(TypMap : TStringList) : string; - function GetCppParams(StartWithComma : boolean) : string; - function GetCppParamNames(StartWithComma : boolean) : string; - function ProcOrFunc(TypMap : TStringList) : string; - function PascalMethDecl(TypMap : TStringList) : string; - function PascalMethImpl(TypMap : TStringList) : string; - function PascalResultType(TypMap : TStringList) : string; - function PascalHookVar(TypMap : TStringList) : string; - function PascalInit(TypMap : TStringList) : string; - function PascalHookImpl(TypMap : TStringList) : string; - function PascalHookDecl(TypMap : TStringList) : string; - function CppTypedef : string; - function CppVarDecl : string; - function CppClassDecl : string; - function CppHookImpl : string; - property Name : string read FName write FName; - property Params : TStringList read FParams write FParams; - property ResultType : string read FResultType write FResultType; - end; - - TClasse = class(TObject) - private - FTypeName : string; - FAncestor : string; - FHookFunctions : TStringList; - function GetName : string; - function GetAncestorName : string; - public - constructor Create(ClasseName : string); virtual; - destructor Destroy; override; - property TypeName : string read FTypeName write FTypeName; - property Name : string read GetName; - property Ancestor : string read FAncestor write FAncestor; - property AncestorName : string read GetAncestorName; - property HookFunctions : TStringList read FHookFunctions write FHookFunctions; - function PascalClasse(TypMap : TStringList) : string; - function PascalHookVar(TypMap : TStringList) : string; - function PascalHookDecl(TypMap : TStringList) : string; - function PascalHookImpl(TypMap : TStringList) : string; - function PascalInit(TypMap : TStringList) : string; - function PascalMethImpl(TypMap : TStringList) : string; - function CppTypedef : string; - function CppVarDecl : string; - function CppClassDecl : string; - function CppHookImpl : string; - end; - -// TFunction --------------------------------------------------------- - -constructor TFunction.Create(Parent : TClasse; FunctionName : string); -begin - inherited Create; - FName := FunctionName; - FParams := TStringList.Create; - FParent := Parent; -end; - -destructor TFunction.Destroy; -begin - FParams.Free; - inherited; -end; - -function TFunction.CommaIfNotEmpty(s : string) : string; -begin - if s <> '' then - Result := '; ' - else - Result := ''; -end; - -function TFunction.GetPascalParams(TypMap : TStringList) : string; - function FormatParams : string; - var - i : integer; - begin - Result := ''; - for i := 0 to FParams.Count - 1 do - begin - if i > 0 then - Result := Result + '; '; - if FParams.Names[i] <> '' then - Result := Result + Format('%s : %s', [FParams.Names[i], TypMap.Values[FParams.Values[FParams.Names[i]]] ]); - end; - end; -begin - if FParams.Count = 0 then - Result := '' - else - begin - Result := Format('%s', [FormatParams]); - end; -end; - -function TFunction.ProcOrFunc(TypMap : TStringList) : string; -begin - if ResultType = 'void' then - Result := 'procedure' - else - Result := 'function'; -end; - -function TFunction.PascalResultType(TypMap : TStringList) : string; -begin - if ResultType = 'void' then - Result := '' - else - Result := ' : ' + TypMap.Values[ResultType]; -end; - -function TFunction.PascalMethDecl(TypMap : TStringList) : string; -begin - Result := Format(' %s %s(%s)%s; virtual;', [ProcOrFunc(TypMap), - Name, GetPascalParams(TypMap), - PascalResultType(TypMap)]); -end; - -function TFunction.PascalMethImpl(TypMap : TStringList) : string; -begin - Result := Format('%s T%s.%s(%s)%s;' + Eol, [ProcOrFunc(TypMap), - FParent.Name, Name, GetPascalParams(TypMap), - PascalResultType(TypMap)]); - Result := Result + 'begin' + Eol; - Result := Result + 'end;' + Eol; -end; - -function TFunction.PascalHookVar(TypMap : TStringList) : string; -begin - Result := Format(' %s_%s_hook : Pointer; cvar; external;', [FParent.Name, Name]); -end; - -function TFunction.PascalInit(TypMap : TStringList) : string; -begin - Result := Format(' %s_%s_hook := @%s_%s_hook_func;', [FParent.Name, Name, FParent.Name, Name]); -end; - -function TFunction.PascalHookDecl(TypMap : TStringList) : string; -begin - Result := ''; - Result := Format(' %s %s_%s_hook(%s : %s%s%s)%s;', - [ProcOrFunc(TypMap), FParent.TypeName, Name, FParent.Name, 'T' + FParent.Name, - CommaIfNotEmpty(GetPascalParams(TypMap)), GetPascalParams(TypMap), - PascalResultType(TypMap)]) + - Format(' cdecl; external BePascalLibName name ''%s_%s'';', - [FParent.TypeName, Name]); -end; - -function TFunction.PascalHookImpl(TypMap : TStringList) : string; -var - Indent : integer; - function Indentation : string; - var - i : integer; - begin - for i := 0 to Indent - 1 do - Result := Result + ' '; - end; -var - i : integer; - s : string; - VarTypName : string; - VarList : TStringList; - aParamList : TStringList; -begin - VarList := TStringList.Create; - aParamList := TStringList.Create; - try - Indent := 1; - Result := Format('%s %s_%s_hook_func(%s : %s%s%s)%s; cdecl;', - [ProcOrFunc(TypMap), FParent.Name, Name, - FParent.Name, 'T' + FParent.Name, - CommaIfNotEmpty(GetPascalParams(TypMap)), GetPascalParams(TypMap), - PascalResultType(TypMap)]) + Eol; - Result := Result + 'var' + Eol + '%s'; - Result := Result + 'begin' + Eol; - - for i := 0 to FParams.Count - 1 do - begin - s := FParams.Values[FParams.Names[i]]; - Delete(s, 2, Length(s) - 1); - if (FParams[i] <> 'void') and (s = 'B') then - begin - VarTypName := FParams.Values[FParams.Names[i]]; - VarList.Add(Format(' a%s : %s;', [FParams.Names[i], TypMap.Values[VarTypName]])); - aParamList.Add('a' + FParams.Names[i]); - Result := Result + Format('%sa%s := %s.Wrap(%s);' + Eol + '%stry' + Eol, - [Indentation, FParams.Names[i], - TypMap.Values[VarTypName], FParams.Names[i], - Indentation]); - Inc(Indent); - end; - end; - - Result := Result + Format('%sif %s <> nil then', [Indentation, FParent.Name]) + Eol; - Result := Result + Format('%s %s.%s(%s);', [Indentation, FParent.Name, Name, '%s']) + Eol; - - for i := 0 to FParams.Count - 1 do - begin - s := FParams.Values[FParams.Names[i]]; - Delete(s, 2, Length(s) - 1); - if (FParams[i] <> 'void') and (s = 'B') then - begin - Dec(Indent); - VarTypName := FParams.Values[FParams.Names[i]]; - Result := Result + Indentation + 'finally' + Eol; - Result := Result + Format(' %sa%s.UnWrap;' + Eol, - [Indentation, FParams.Names[i]]); - Result := Result + Indentation + 'end;' + Eol; - end; - end; - Result := Result + 'end;' + Eol; - if aParamList.Count = 0 then - s := '' - else - s := aParamList.CommaText; - Result := Format(Result, [VarList.Text, s]); - finally - aParamList.Free; - VarList.Free; - end; -end; - -function TFunction.GetCppParams(StartWithComma : boolean) : string; - function FormatParams : string; - var - i : integer; - begin - Result := ''; - for i := 0 to FParams.Count - 1 do - begin - if (i > 0) then - Result := Result + ', '; - if FParams.Names[i] <> '' then - Result := Result + Format('%s %s', [FParams.Values[FParams.Names[i]], FParams.Names[i] ]); - end; - end; -begin - if FParams.Count = 0 then - Result := '' - else - begin - if (FormatParams <> '') and StartWithComma then - Result := Format(', %s', [FormatParams]) - else if FormatParams <> '' then - Result := Format('%s', [FormatParams]) - else if StartWithComma then - Result := '' - else - Result := 'void'; - end; -end; - -function TFunction.GetCppParamNames(StartWithComma : boolean) : string; - function FormatParamNames : string; - var - i : integer; - begin - Result := ''; - for i := 0 to FParams.Count - 1 do - begin - if (i > 0) then - Result := Result + ', '; - if FParams.Names[i] <> '' then - Result := Result + Format('%s', [FParams.Names[i] ]); - end; - end; -begin - if FParams.Count = 0 then - Result := '' - else - begin - if (FormatParamNames <> '') and StartWithComma then - Result := Format(', %s', [FormatParamNames]) - else if FormatParamNames <> '' then - Result := Format('%s', [FormatParamNames]) - else if StartWithComma then - Result := '' - else - Result := 'void'; - end; -end; - -function TFunction.CppTypedef : string; -begin - Result := Format('typedef %s (*%s_%s_hook) (TPasObject PasObject%s);', - [ResultType, FParent.TypeName, Name, GetCppParams(True)]); -end; - -function TFunction.CppVarDecl : string; -begin - Result := Format('%s_%s_hook %s_%s_hook;', [FParent.TypeName, Name, FParent.Name, Name]); -end; - -function TFunction.CppClassDecl : string; -begin - Result := Format(' virtual %s %s(%s);', [ResultType, Name, GetCppParams(False)]); -end; - -function TFunction.CppHookImpl : string; -begin - Result := Format('%s BP%s::%s(%s)', - [ResultType, FParent.Name, Name, GetCppParams(False)]) + Eol; - Result := Result + '{' + Eol; - if ResultType <> 'void' then - Result := Result + Format(' return %s_%s_hook(GetPasObject()%s);', - [FParent.Name, Name, GetCppParamNames(True)]) - else - Result := Result + Format(' %s_%s_hook(GetPasObject()%s);', - [FParent.Name, Name, GetCppParamNames(True)]); - Result := Result + Eol + '}' + Eol; -end; - -// TClasse ------------------------------------- - -constructor TClasse.Create(ClasseName : string); -begin - inherited Create; - FTypeName := ClasseName; - FHookFunctions := TStringList.Create; -end; - -destructor TClasse.Destroy; -var - i : integer; -begin - for i := 0 to FHookFunctions.Count - 1 do - FHookFunctions.Objects[i].Free; - FHookFunctions.Free; - inherited; -end; - -function TClasse.GetName : string; -begin - Result := TypeName; - // Delete the first letter in the C++ type name - Delete(Result, 1, 1); -end; - -function TClasse.GetAncestorName : string; -begin - Result := Ancestor; - // Delete the first letter in the C++ type name - Delete(Result, 1, 1); -end; - -function TClasse.PascalClasse(TypMap : TStringList) : string; -var - i : integer; -begin - // We add ' *' to the ancestor to find the corresponding type in the type map - Result := Format(' T%s = class(%s)', [Name, TypMap.Values[Self.Ancestor + ' *']]); - Result := Result + Eol + ' // Hook functions'; - for i := 0 to HookFunctions.Count - 1 do - begin - Result := Result + Eol + TFunction(Self.HookFunctions.Objects[i]).PascalMethDecl(TypMap); - end; - Result := Result + Eol + ' end;'; - WriteLn(Result); -end; - -function TClasse.PascalHookVar(TypMap : TStringList) : string; -var - i : integer; -begin - Result := 'var'; - for i := 0 to HookFunctions.Count - 1 do - begin - Result := Result + Eol + TFunction(Self.HookFunctions.Objects[i]).PascalHookVar(TypMap); - end; - WriteLn(Result); -end; - -function TClasse.PascalInit(TypMap : TStringList) : string; -var - i : integer; -begin - Result := 'initialization' + Eol; - for i := 0 to HookFunctions.Count - 1 do - begin - Result := Result + TFunction(Self.HookFunctions.Objects[i]).PascalInit(TypMap) + Eol; - end; - WriteLn(Result); -end; - -function TClasse.PascalHookDecl(TypMap : TStringList) : string; -var - i : integer; -begin - Result := 'var' + Eol; - for i := 0 to HookFunctions.Count - 1 do - begin - Result := Result + TFunction(Self.HookFunctions.Objects[i]).PascalHookDecl(TypMap) + Eol; - end; -end; - -function TClasse.PascalHookImpl(TypMap : TStringList) : string; -var - i : integer; -begin - Result := ''; - for i := 0 to HookFunctions.Count - 1 do - begin - Result := Result + TFunction(Self.HookFunctions.Objects[i]).PascalHookImpl(TypMap) + Eol; - end; -end; - -function TClasse.PascalMethImpl(TypMap : TStringList) : string; -var - i : integer; -begin - Result := ''; - for i := 0 to HookFunctions.Count - 1 do - begin - Result := Result + TFunction(Self.HookFunctions.Objects[i]).PascalMethImpl(TypMap) + Eol; - end; -end; - -function TClasse.CppTypedef : string; -var - i : integer; -begin - Result := ''; - for i := 0 to HookFunctions.Count - 1 do - begin - Result := Result + TFunction(Self.HookFunctions.Objects[i]).CppTypedef + Eol; - end; -end; - -function TClasse.CppVarDecl : string; -var - i : integer; -begin - Result := ''; - for i := 0 to HookFunctions.Count - 1 do - begin - Result := Result + TFunction(Self.HookFunctions.Objects[i]).CppVarDecl + Eol; - end; -end; - -function TClasse.CppClassDecl : string; -var - i : integer; -begin - Result := Format('class BP%s : public %s, public BP%s', - [Name, TypeName, AncestorName]) + Eol; - Result := Result + '{' + Eol; - Result := Result + ' public:' + Eol; - Result := Result + ' // ' + Eol; - for i := 0 to HookFunctions.Count - 1 do - begin - Result := Result + TFunction(Self.HookFunctions.Objects[i]).CppClassDecl + Eol; - end; - Result := Result + ' private:' + Eol; - Result := Result + '}' + Eol; -end; - -function TClasse.CppHookImpl : string; -var - i : integer; -begin - Result := ''; - for i := 0 to HookFunctions.Count - 1 do - begin - Result := Result + TFunction(Self.HookFunctions.Objects[i]).CppHookImpl + Eol; - end; -end; - -//**************************************************************************************** - -procedure NodeInfo(Node : TDOMNode); -begin - WriteLn(Node.NodeName + ',' + Node.NodeValue + ',' + IntToStr(Node.NodeType)); -end; - -function HandleParams(Node : TDOMNode; Parent : TClasse) : TFunction; -var - paramtmp : TDOMNode; -begin - Result := TFunction.Create(Parent, Node.Attributes.GetNamedItem('NAME').NodeValue); - paramtmp := Node.FirstChild.FirstChild; - Result.Params.Values[paramtmp.Attributes.GetNamedItem('NAME').NodeValue] := paramtmp.Attributes.GetNamedItem('TYPE').NodeValue; - while paramtmp.NextSibling <> nil do - begin - paramtmp := paramtmp.NextSibling; - Result.Params.Values[paramtmp.Attributes.GetNamedItem('NAME').NodeValue] := paramtmp.Attributes.GetNamedItem('TYPE').NodeValue; - end; - Result.ResultType := Node.FindNode('RESULT').Attributes.GetNamedItem('TYPE').NodeValue; - WriteLn('FunctionName : ' + Result.Name); - WriteLn(Result.Params.Text); - WriteLn('Result = ' + Result.ResultType); - WriteLn(''); -end; - -function HandleClasse(Node : TDOMNode) : TClasse; -var - hooktmp : TDOMNode; -begin - Result := TClasse.Create(Node.Attributes.GetNamedItem('NAME').NodeValue); - if Node.Attributes.GetNamedItem('ANCESTOR') <> nil then - Result.Ancestor := Node.Attributes.GetNamedItem('ANCESTOR').NodeValue; - hooktmp := Node.FirstChild.FirstChild; - Result.HookFunctions.AddObject(hooktmp.Attributes.GetNamedItem('NAME').NodeValue, HandleParams(hooktmp, Result)); - while hooktmp.NextSibling <> nil do - begin - hooktmp := hooktmp.NextSibling; - Result.HookFunctions.AddObject(hooktmp.Attributes.GetNamedItem('NAME').NodeValue, HandleParams(hooktmp, Result)); - end; - WriteLn('ClasseName : ' + Result.TypeName); - WriteLn(Result.HookFunctions.Text); -end; - -procedure LoadParams(ListeClasses : TStringList); -var - i : integer; -begin - if ParamCount > 0 then - begin - for i := 0 to ParamCount do - begin - ListeClasses.Add(Paramstr(i)); - end; - end; -end; - -procedure LoadClassesList(ClassesList : TStringList); -var - ADoc : TXMLDocument; - tmp : TDOMNode; - classe : TClasse; -begin - ReadXMLFile(ADoc, 'hooks.xml'); - try - NodeInfo(ADoc); - // root -> BEOSAPI - NodeInfo(ADoc.DocumentElement); - // -> CLASSES - NodeInfo(ADoc.DocumentElement.FirstChild); - // -> CLASSE - NodeInfo(ADoc.DocumentElement.FirstChild.FirstChild); - // -> CLASSE NAME= - NodeInfo(ADoc.DocumentElement.FirstChild.FirstChild.Attributes.GetNamedItem('NAME')); - tmp := ADoc.DocumentElement.FirstChild.FirstChild; - Classe := HandleClasse(tmp); - ClassesList.AddObject(Classe.TypeName, Classe); - while tmp.NextSibling <> nil do - begin - tmp := tmp.NextSibling; - Classe := HandleClasse(tmp); - ClassesList.AddObject(Classe.TypeName, Classe); - end; - // -> HOOKS - NodeInfo(ADoc.DocumentElement.FirstChild.FirstChild.FirstChild); - // -> HOOKFUNCTION - NodeInfo(ADoc.DocumentElement.FirstChild.FirstChild.FirstChild.FirstChild); - NodeInfo(ADoc.DocumentElement.FirstChild.FirstChild.FirstChild.FirstChild.FirstChild); - finally - ADoc.Free; - end; -end; - -procedure FileGeneration(ClassesList, ListeParams : TStringList); -var - srcWriter : TSourceWriter; - a, i : integer; -begin - // ------------------------------- - // Generating source files - // ------------------------------- - - WriteLn(''); - - for i := 0 to ListeParams.Count - 1 do - begin - if ClassesList.IndexOf(ListeParams[i]) <> - 1 then - begin - a := ClassesList.IndexOf(ListeParams[i]); - srcWriter := TSourceWriter.Create(TClasse(ClassesList.objects[a]).Name); - try - with srcWriter.Pas do - begin - Add('type'); - Add(TClasse(ClassesList.objects[a]).PascalClasse(srcWriter.TypMap)); - Add(''); - Add(TClasse(ClassesList.Objects[a]).PascalHookDecl(srcWriter.TypMap)); - Add('implementation' + Eol); - Add(TClasse(ClassesList.objects[a]).PascalHookVar(srcWriter.TypMap)); - Add(''); - Add(TClasse(ClassesList.objects[a]).PascalMethImpl(srcWriter.TypMap)); - Add(TClasse(ClassesList.objects[a]).PascalHookImpl(srcWriter.TypMap)); - Add(TClasse(ClassesList.objects[a]).PascalInit(srcWriter.TypMap)); - - Add('end.'); - end; - with srcWriter.Cpp do - begin - Add(TClasse(ClassesList.Objects[a]).CppTypedef); - Add(StartExternalC); - Add(TClasse(ClassesList.Objects[a]).CppVarDecl); - Add(EndExternalC); - Add(''); - Add(TClasse(ClassesList.Objects[a]).CppClassDecl); - Add(TClasse(ClassesList.Objects[a]).CppHookImpl); - end; - finally - srcWriter.Free; - end; - end; - end; -end; - -//**************************************************************************************** - -var - ClassesList : TStringList; - ListeParams : TStringList; - i : integer; -begin - ListeParams := TStringList.Create; - try - LoadParams(ListeParams); - - ClassesList := TStringList.Create; - try - LoadClassesList(ClassesList); - FileGeneration(ClassesList, ListeParams); - finally - for i := 0 to ClassesList.Count - 1 do - ClassesList.Objects[i].Free; - ClassesList.Free; - end; - finally - ListeParams.Free; - end; -end. diff --git a/bepascal/bepascal/hookgen/hooks.xml b/bepascal/bepascal/hookgen/hooks.xml deleted file mode 100644 index 5d541f8..0000000 --- a/bepascal/bepascal/hookgen/hooks.xml +++ /dev/null @@ -1,592 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bepascal/bepascal/hookgen/typemap.txt b/bepascal/bepascal/hookgen/typemap.txt deleted file mode 100644 index cf1f171..0000000 --- a/bepascal/bepascal/hookgen/typemap.txt +++ /dev/null @@ -1,26 +0,0 @@ -BMessage *=TMessage -BHandler *=THandler -void= -bool=boolean -BHandler **=^THandler -filter_result= -int32=integer -char **=^PChar -BPoint *=TPoint -float=double -BRect=TRect -color_space= -uint32=cardinal -BPoint=TPoint -float *=^double -char *=PChar -BScrollView *=TScrollView -BView *=TView -BFont *=TFont -tab_position= -BTab *=TTab -button_width= -BClipboard *=TClipboard -int32 *=^integer -BBitmap **=^TBitmap -text_run_array= diff --git a/bepascal/bepascal/hookgen/typenum.pp b/bepascal/bepascal/hookgen/typenum.pp deleted file mode 100644 index 0cb2f24..0000000 --- a/bepascal/bepascal/hookgen/typenum.pp +++ /dev/null @@ -1,48 +0,0 @@ -program typenum; - -uses - SysUtils, Classes, xmlread, DOM; - -procedure NodeInfo(Node : TDOMNode); -begin - WriteLn(Node.NodeName + ',' + Node.NodeValue + ',' + IntToStr(Node.NodeType)); -end; - -var - ADoc : TXMLDocument; - TypeList : TStringList; - classeNode, fonction : TDOMNode; - list : TDOMNodeList; - i : integer; -begin - ReadXMLFile(ADoc, 'hooks.xml'); - TypeList := TStringList.Create; - try - classeNode := ADoc.FirstChild.FirstChild.FirstChild; - NodeInfo(classeNode); - while classeNode <> nil do - begin - fonction := classeNode.FirstChild.FirstChild; - Write('Toto : '); - NodeInfo(fonction); - while fonction <> nil do - begin - list := fonction.FirstChild.ChildNodes; - WriteLn(IntToStr(list.Count)); - for i := 0 to list.Count - 1 do - begin - WriteLn(list.item[i].NodeValue + ';' + list.item[i].NodeName); - TypeList.Values[list.item[i].Attributes.GetNamedItem('TYPE').NodeValue] := ''; - end; - NodeInfo(fonction.FindNode('RESULT')); - TypeList.Values[fonction.FindNode('RESULT').Attributes.GetNamedItem('TYPE').NodeValue] := ''; - fonction := fonction.NextSibling; - end; - classeNode := classeNode.NextSibling; - end; - finally - TypeList.SaveToFile('typemap.txt'); - list.Release; - TypeList.Free; - end; -end. \ No newline at end of file diff --git a/bepascal/bepascal/makefile b/bepascal/bepascal/makefile deleted file mode 100644 index 9c8a38a..0000000 --- a/bepascal/bepascal/makefile +++ /dev/null @@ -1,166 +0,0 @@ -## BeOS Generic Makefile v2.2 ## - -## Fill in this file to specify the project being created, and the referenced -## makefile-engine will do all of the hard work for you. This handles both -## Intel and PowerPC builds of the BeOS. - -## Application Specific Settings --------------------------------------------- - -# specify the name of the binary -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 - -# add support for new Pe and Eddie features -# to fill in generic makefile - -#%{ -# @src->@ - -# specify the source files to use -# full paths or paths relative to the makefile can be included -# all files, regardless of directory, will have their object -# files created in the common object directory. -# Note that this means this makefile will not work correctly -# if two source files with the same name (source.c or source.cpp) -# are included from different directories. Also note that spaces -# in folder names do not work well with this makefile. -SRCS= be/bepas_kernel/beobj.cpp \ - be/app/Application.cpp \ - be/app/Clipboard.cpp \ - be/app/Handler.cpp \ - be/app/Invoker.cpp \ - be/app/Looper.cpp \ - be/app/Message.cpp \ - be/app/Messenger.cpp \ - be/app/Roster.cpp \ - be/device/Joystick.cpp \ - be/device/SerialPort.cpp \ - be/hey/hey.cpp \ - be/interface/Alert.cpp \ - be/interface/Box.cpp \ - be/interface/Button.cpp \ - be/interface/CheckBox.cpp \ - be/interface/Control.cpp \ - be/interface/Font.cpp \ - be/interface/ListItem.cpp \ - be/interface/ListView.cpp \ - be/interface/Menu.cpp \ - be/interface/MenuBar.cpp \ - be/interface/MenuItem.cpp \ - be/interface/OutlineListView.cpp \ - be/interface/Point.cpp \ - be/interface/Rect.cpp \ - be/interface/RadioButton.cpp \ - be/interface/ScrollBar.cpp \ - be/interface/ScrollView.cpp \ - be/interface/StatusBar.cpp \ - be/interface/StringView.cpp \ - be/interface/TabView.cpp \ - be/interface/TextControl.cpp \ - be/interface/TextView.cpp \ - be/interface/View.cpp \ - be/interface/Window.cpp \ - be/mail/E-mail.cpp \ - be/storage/Volume.cpp \ - be/storage/VolumeRoster.cpp \ - be/support/Archivable.cpp \ - be/support/DataIO.cpp \ - be/support/Flattenable.cpp \ - be/support/List.cpp \ - be/support/String.cpp - -# specify the resource files to use -# full path or a relative path to the resource file can be used. -RSRCS= - -# @<-src@ -#%} - -# end support for Pe and Eddie - -# 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 device mail - -# 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 makefile. 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 -# thes use the form: #include
-# source file directories are NOT auto-included here -SYSTEM_INCLUDE_PATHS = be/app \ - be/bepas_kernel \ - be/interface \ - be/support - -# 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=NONE - -# 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 =ALL - -# 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 = - -# specify the version of this particular item -# (for example, -app 3 4 0 d 0 -short 340 -long "340 "`echo -n -e '\302\251'`"1999 GNU GPL") -# This may also be specified in a resource. -APP_VERSION = - -# (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 makefile-engine -include $(BUILDHOME)/etc/makefile-engine diff --git a/bepascal/bepascal/stubgen.so/COPYING b/bepascal/bepascal/stubgen.so/COPYING deleted file mode 100644 index 60549be..0000000 --- a/bepascal/bepascal/stubgen.so/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/bepascal/bepascal/stubgen.so/Example Usage for OpenBeOS.txt b/bepascal/bepascal/stubgen.so/Example Usage for OpenBeOS.txt deleted file mode 100644 index 402cfb8..0000000 --- a/bepascal/bepascal/stubgen.so/Example Usage for OpenBeOS.txt +++ /dev/null @@ -1,3 +0,0 @@ -Example usage for OpenBeOS project: - -stubgen -s -g -a *.h diff --git a/bepascal/bepascal/stubgen.so/Makefile b/bepascal/bepascal/stubgen.so/Makefile deleted file mode 100644 index 6194d9d..0000000 --- a/bepascal/bepascal/stubgen.so/Makefile +++ /dev/null @@ -1,90 +0,0 @@ -# -# FILE: Makefile -# AUTH: Michael John Radwin -# -# DESC: stubgen makefile -# modified from O'Reilly's lex & yacc, Second Edition -# -# DATE: Wed Aug 14 18:11:18 US/Eastern 1996 -# $Id: Makefile,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ -# -# Copyright (c) 1996-1998 Michael John Radwin -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -# --- User-definable stuff. Edit if you know what you're doing. --- # - -# Choose your compiler. I like Sun's cc compiler because I use dbx for -# debugging, but you might want gcc. -CC = gcc -Wall -#CC = cc - -# You'll need to use a lexer that supports the exclusive start state -# mechanism (the '%x' directive). GNU Flex does this just fine. -LEX = flex -#LEX = lex - -# You should be able to use any of the 3 common flavors of yacc: -# AT&T Yacc, Berkeley Yacc, or GNU Bison. We've tested with bison. -#YACC = yacc -d -YACC = bison -y -d -#YACC = byacc -d - -# etags is used purely for development purposes. -ETAGS = etags - -# for Sun cc, we don't like incremental linking. -#LFLAGS = -xildoff - -# for a lex other than GNU Flex, we must link with the -ll library. -#LFLAGS = -ll - -# Debug settings are on. Having the SGDEBUG macro defined will make -# generate 'stubgen.log' files on each execution of stubgen, which are -# useful for debugging, but probably annoying. -CFLAGS = -g -DSGDEBUG -#CFLAGS = -O - -# --- You probably shouldn't edit anything below this line. --- # -OFILES = y.tab.o lex.yy.o table.o util.o pathname.o main.o getopt.o -SRCFILES = lexer.l parser.y table.[ch] util.[ch] pathname.[ch] main.c - -all: stubgen - -stubgen: $(OFILES) - $(CC) $(CFLAGS) -o $@ $(OFILES) $(LFLAGS) $(LIBS) - chmod 0755 $@ - -y.output: parser.y - $(YACC) -v parser.y - -lex.yy.c: lexer.l y.tab.h - $(LEX) lexer.l - -y.tab.h y.tab.c: parser.y - $(YACC) parser.y - -tags: TAGS -TAGS: $(SRCFILES) - $(ETAGS) $(SRCFILES) - -clean: - rm -f $(OFILES) TAGS - rm -f y.tab.h y.tab.c lex.yy.c y.output stubgen.log - rm -f win32/stubgen.plg win32/stubgen.ncb win32/stubgen.opt - rm -f win32/stubgen.pdb win32/stubgen.ilk - rm -f win32/stubgen.mak win32/stubgen.bsc win32/stubgen.log - rm -rf win32/Debug win32/debug diff --git a/bepascal/bepascal/stubgen.so/README b/bepascal/bepascal/stubgen.so/README deleted file mode 100644 index 435a1ce..0000000 --- a/bepascal/bepascal/stubgen.so/README +++ /dev/null @@ -1,147 +0,0 @@ -stubgen README file -Michael John Radwin -$Id: README,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - - -Description ------------ -Welcome to stubgen version 2.05 (build 1086). - -stubgen is a C++ development tool that keeps code files in sync with -their associated headers. When it finds a member function declaration -in a header file that doesn't have a corresponding implementation, it -creates an empty skeleton with descriptive comment headers. stubgen has -several options, but see the "Brief Example" section below for an idea -of what it can do. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2 of the License, or (at your -option) any later version. - -This program 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 -General Public License for more details. - - -Brief Example -------------- -Suppose you have the following header file Point.h: - - class Point { - public: - Point(int x, int y); - void addTo(const Point& other); - - int xValue, yValue; - }; - -Running "stubgen -s Point.h" would produce the following file: - - /*********************************************** - * AUTHOR: Michael John Radwin - * FILE: Point.cpp - * DATE: Mon Apr 20 17:39:05 1998 - * DESCR: - ***********************************************/ - #include "Point.h" - - /* - * Method: Point::Point() - * Descr: - */ - Point::Point(int x, int y) - { - } - - /* - * Method: Point::addTo() - * Descr: - */ - void - Point::addTo(const Point& other) - { - } - - -Supported Platforms -------------------- -I've successfully built stubgen on the following platforms, using the -GNU tools make, gcc, bison, and flex: - - SPARC Solaris (2.5 and 2.6) - SunOS 4.1.3 - SGI IRIX 5.3 - RS6000 AIX 3.2 - MS Windows NT 4.0 (using GNU bison/flex and MSVC++ 5.0) - - -Home Page ---------- -Check out the stubgen home page and download the current source code at: - - http://www.radwin.org/michael/projects/stubgen/ - - -Files ------ -The following files are included in this distribution: - - COPYING - the GNU general public license - ChangeLog - a listing of changes made on various versions. - Makefile - a makefile for building stubgen on unix - README - this file - etc/ - debugging routines for use with the -d option - getopt.[ch] - GNU getopts (for Win32) - lexer.l - flex source, generates tokens - main.c - code generation routines - parser.y - yacc source, parses header and code files - pathname.[ch] - dirname() and basename() routines - stubgen.1 - nroff-able man page - table.[ch] - data structures used in parsing - util.[ch] - utilities, logging routines, used in parsing - test/ - test header files for stubgen - win32/ - MS Visual C++ 5.0 project (Win32 console app) - - -Building --------- -1. ensure that your system has 'flex' installed. -2. ensure that your system has 'yacc', 'byacc', or 'bison' installed. -3. edit 'Makefile' and pick your favorite CC, LEX, YACC, LFLAGS and CFLAGS -4. run 'make' - -We assume that flex, bison, and cc/gcc are in your path. - -For win32, there's no need to build. You'll find stubgen.exe in the -directory .\win32. - - -Installing ----------- -There is no fancy installation procedure. Since the binary doesn't -depend on any other files, copy it to /usr/local/bin or wherever you -choose. You may wish to copy stubgen.1 to /usr/local/man/man1 or some -similar directory. - - -Acknowledgments ----------------- -stubgen borrows code from: - -Jutta Degener's 1995 ANSI C grammar (based on Jeff Lee's 1985 -implementation): -ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z -http://www.lysator.liu.se/c/ANSI-C-grammar-l.html -http://www.lysator.liu.se/c/ANSI-C-grammar-y.html - -Graham D. Parrington's Stub Generator for the Arjuna project at the -University of Newcastle upon Tyne: -http://arjuna.ncl.ac.uk/ - - -Copyright ---------- -stubgen is Copyright (c) 1996-1998 Michael John Radwin, under the terms -of the GNU General Public License. See COPYING for more. diff --git a/bepascal/bepascal/stubgen.so/README.fpc b/bepascal/bepascal/stubgen.so/README.fpc deleted file mode 100644 index e6d0d27..0000000 --- a/bepascal/bepascal/stubgen.so/README.fpc +++ /dev/null @@ -1,3 +0,0 @@ -libstubgen is a shared object that export the stubgen's parser. - -stubgen.pp is the pascal unit to use this library. diff --git a/bepascal/bepascal/stubgen.so/getopt.c b/bepascal/bepascal/stubgen.so/getopt.c deleted file mode 100644 index d87c250..0000000 --- a/bepascal/bepascal/stubgen.so/getopt.c +++ /dev/null @@ -1,826 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -#define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -#include -#include -#endif /* GNU C library. */ - -#ifdef VMS -#include -#if HAVE_STRING_H - 0 -#include -#endif -#endif - -#if defined (WIN32) && !defined (__CYGWIN32__) -/* It's not Unix, really. See? Capital letters. */ -#include -#define getpid() GetCurrentProcessId() -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -#ifdef HAVE_LIBINTL_H -# include -# define _(msgid) gettext (msgid) -#else -# define _(msgid) (msgid) -#endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = NULL; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* XXX 1003.2 says this must be 1 before any call. */ -int optind = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return EOF with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -#include -#define my_index strchr -#else - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -char *getenv (); - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -#if !defined (__STDC__) || !__STDC__ -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -#endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -static const char *nonoption_flags; -static int nonoption_flags_len; - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined (__STDC__) && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined (__STDC__) && __STDC__ -static const char *_getopt_initialize (const char *); -#endif -static const char * -_getopt_initialize (optstring) - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind = 1; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - - if (posixly_correct == NULL) - { - /* Bash 2.0 puts a special variable in the environment for each - command it runs, specifying which ARGV elements are the results of - file name wildcard expansion and therefore should not be - considered as options. */ - char var[100]; - sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); - nonoption_flags = getenv (var); - if (nonoption_flags == NULL) - nonoption_flags_len = 0; - else - nonoption_flags_len = strlen (nonoption_flags); - } - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns `EOF'. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (optind == 0) - { - optstring = _getopt_initialize (optstring); - optind = 1; /* Don't scan ARGV[0], the program name. */ - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. */ -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && nonoption_flags[optind] == '1')) - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return EOF; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return EOF; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if (nameend - nextchar == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* _LIBC or not __GNU_LIBRARY__. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == EOF) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/bepascal/bepascal/stubgen.so/getopt.h b/bepascal/bepascal/stubgen.so/getopt.h deleted file mode 100644 index 0de1881..0000000 --- a/bepascal/bepascal/stubgen.so/getopt.h +++ /dev/null @@ -1,130 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if defined (__STDC__) && __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* _GETOPT_H */ diff --git a/bepascal/bepascal/stubgen.so/lex.yy.c b/bepascal/bepascal/stubgen.so/lex.yy.c deleted file mode 100644 index b998e53..0000000 --- a/bepascal/bepascal/stubgen.so/lex.yy.c +++ /dev/null @@ -1,2652 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/haiku/befpc/bepascal/bepascal/stubgen.so/lex.yy.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 112 -#define YY_END_OF_BUFFER 113 -static yyconst short int yy_accept[320] = - { 0, - 0, 0, 0, 0, 0, 0, 113, 111, 110, 1, - 86, 111, 4, 92, 85, 111, 80, 81, 90, 89, - 77, 88, 84, 91, 46, 46, 78, 74, 93, 79, - 94, 97, 43, 82, 83, 95, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 75, 96, 76, 87, 103, 104, 102, 103, - 108, 109, 107, 108, 1, 73, 0, 51, 0, 58, - 68, 59, 0, 0, 56, 64, 54, 65, 55, 66, - 0, 49, 2, 3, 57, 50, 45, 0, 46, 0, - 46, 98, 63, 70, 72, 71, 62, 43, 60, 43, - - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 61, - 69, 100, 101, 105, 106, 47, 67, 99, 0, 49, - 3, 49, 0, 50, 45, 0, 48, 44, 53, 52, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 36, 43, 43, 43, 27, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 101, 106, 0, 49, - 0, 49, 0, 50, 48, 44, 7, 34, 43, 43, - - 43, 43, 43, 43, 13, 43, 43, 43, 43, 43, - 37, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 42, - 43, 0, 49, 25, 14, 43, 43, 43, 43, 43, - 43, 40, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 35, 43, 43, 43, 43, 33, 43, 43, 12, - 43, 17, 43, 43, 26, 43, 43, 41, 43, 8, - 28, 23, 43, 43, 43, 43, 43, 32, 43, 38, - 5, 11, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 22, 43, 43, 31, 43, 43, 43, 10, 43, - - 43, 24, 43, 43, 43, 21, 43, 29, 43, 9, - 15, 16, 39, 6, 19, 20, 18, 30, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 6, 1, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 20, 21, 22, - 23, 24, 25, 1, 26, 26, 26, 26, 27, 28, - 29, 29, 29, 29, 29, 30, 29, 29, 29, 29, - 29, 29, 29, 29, 31, 29, 29, 32, 29, 29, - 33, 34, 35, 36, 29, 1, 37, 38, 39, 40, - - 41, 42, 43, 44, 45, 29, 29, 46, 47, 48, - 49, 50, 29, 51, 52, 53, 54, 55, 56, 57, - 58, 29, 59, 60, 61, 62, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[63] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 4, 1, - 1, 1, 1, 1, 1, 4, 4, 4, 5, 5, - 5, 5, 1, 1, 1, 1, 4, 4, 4, 4, - 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, - 1, 1 - } ; - -static yyconst short int yy_base[330] = - { 0, - 0, 0, 60, 61, 62, 66, 468, 469, 469, 0, - 444, 65, 469, 443, 63, 431, 469, 469, 441, 61, - 469, 58, 69, 77, 85, 79, 443, 469, 53, 439, - 67, 469, 0, 469, 469, 438, 406, 75, 81, 45, - 62, 411, 409, 403, 55, 406, 60, 414, 84, 91, - 86, 91, 469, 84, 469, 469, 469, 469, 469, 106, - 469, 469, 469, 129, 0, 469, 138, 469, 451, 469, - 469, 469, 71, 142, 469, 469, 469, 469, 469, 441, - 436, 129, 469, 0, 469, 135, 164, 171, 157, 0, - 182, 469, 428, 469, 469, 469, 427, 0, 469, 396, - - 411, 410, 398, 399, 398, 389, 388, 102, 392, 395, - 114, 391, 385, 390, 380, 394, 119, 396, 390, 383, - 388, 141, 383, 378, 378, 121, 382, 375, 151, 469, - 469, 469, 0, 469, 0, 469, 469, 469, 189, 469, - 0, 197, 216, 469, 191, 201, 214, 216, 469, 469, - 376, 373, 371, 370, 380, 185, 382, 372, 372, 376, - 379, 374, 369, 0, 370, 375, 370, 0, 359, 354, - 355, 361, 361, 354, 356, 350, 348, 351, 351, 358, - 349, 352, 348, 342, 354, 356, 0, 0, 222, 231, - 239, 469, 245, 248, 469, 238, 0, 0, 340, 338, - - 337, 332, 341, 341, 0, 341, 334, 331, 335, 334, - 0, 343, 328, 342, 341, 336, 331, 323, 321, 332, - 327, 332, 324, 313, 110, 320, 324, 323, 311, 0, - 311, 253, 261, 0, 0, 322, 312, 311, 319, 320, - 310, 0, 317, 315, 309, 304, 300, 299, 312, 311, - 293, 0, 301, 297, 277, 282, 0, 265, 268, 0, - 256, 0, 265, 256, 0, 251, 250, 0, 253, 0, - 0, 0, 256, 259, 246, 252, 235, 0, 246, 0, - 0, 0, 233, 243, 236, 241, 235, 229, 223, 214, - 202, 0, 214, 200, 0, 207, 166, 173, 0, 165, - - 159, 0, 152, 132, 126, 0, 133, 0, 129, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 469, 307, - 312, 317, 322, 327, 329, 334, 157, 339, 344 - } ; - -static yyconst short int yy_def[330] = - { 0, - 319, 1, 320, 320, 321, 321, 319, 319, 319, 322, - 319, 323, 319, 319, 319, 324, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 325, 319, 319, 319, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 322, 319, 323, 319, 323, 319, - 319, 319, 324, 324, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 326, 319, 319, 319, 319, 319, 327, - 319, 319, 319, 319, 319, 319, 319, 325, 319, 325, - - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 319, - 319, 319, 328, 319, 329, 319, 319, 319, 319, 319, - 326, 319, 319, 319, 319, 319, 319, 327, 319, 319, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 328, 329, 319, 319, - 319, 319, 319, 319, 319, 319, 325, 325, 325, 325, - - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 319, 319, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 0, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319 - } ; - -static yyconst short int yy_nxt[532] = - { 0, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 33, 33, 33, 33, - 33, 33, 34, 8, 35, 36, 37, 33, 38, 39, - 40, 41, 33, 33, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 33, 33, 33, 53, 54, - 55, 56, 58, 58, 62, 59, 59, 63, 62, 68, - 71, 63, 78, 76, 93, 94, 60, 60, 64, 136, - 79, 80, 64, 77, 81, 72, 82, 82, 83, 96, - 97, 114, 107, 84, 86, 115, 91, 91, 69, 85, - - 86, 108, 87, 87, 74, 88, 130, 109, 89, 89, - 117, 88, 110, 118, 89, 89, 90, 132, 101, 88, - 102, 104, 133, 103, 89, 88, 105, 120, 121, 106, - 89, 123, 89, 126, 124, 128, 122, 127, 89, 129, - 134, 90, 68, 131, 319, 135, 82, 82, 125, 258, - 73, 159, 142, 142, 160, 139, 140, 259, 140, 163, - 148, 143, 144, 170, 144, 181, 164, 171, 318, 139, - 140, 69, 182, 317, 140, 143, 144, 176, 316, 86, - 144, 87, 87, 146, 315, 146, 89, 89, 147, 147, - 88, 177, 314, 145, 145, 185, 186, 86, 313, 91, - - 91, 189, 89, 189, 88, 312, 190, 190, 88, 145, - 89, 89, 89, 311, 142, 142, 310, 145, 147, 147, - 145, 145, 88, 191, 192, 202, 192, 89, 193, 203, - 193, 147, 147, 194, 194, 89, 145, 191, 192, 190, - 190, 195, 192, 195, 145, 196, 196, 309, 190, 190, - 308, 232, 307, 232, 306, 195, 233, 233, 140, 195, - 140, 196, 194, 194, 305, 194, 194, 196, 196, 196, - 233, 233, 140, 304, 303, 144, 140, 144, 233, 233, - 302, 301, 300, 196, 299, 298, 297, 296, 192, 144, - 192, 196, 295, 144, 294, 293, 292, 291, 290, 289, - - 288, 287, 192, 286, 285, 284, 192, 57, 57, 57, - 57, 57, 61, 61, 61, 61, 61, 65, 283, 65, - 65, 65, 67, 67, 67, 67, 67, 73, 73, 282, - 73, 73, 98, 98, 141, 281, 141, 141, 141, 187, - 280, 187, 187, 187, 188, 279, 188, 188, 188, 278, - 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, - 267, 266, 265, 264, 263, 262, 261, 260, 257, 256, - 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, - 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, - 235, 234, 231, 230, 229, 228, 227, 226, 225, 224, - - 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, - 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, - 201, 200, 199, 198, 197, 184, 183, 180, 179, 178, - 175, 174, 173, 172, 169, 168, 167, 166, 165, 162, - 161, 158, 157, 156, 155, 154, 153, 152, 151, 150, - 149, 138, 137, 319, 119, 116, 113, 112, 111, 100, - 99, 95, 92, 75, 74, 70, 66, 319, 7, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319 - } ; - -static yyconst short int yy_chk[532] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 4, 5, 3, 4, 5, 6, 12, - 15, 6, 22, 20, 29, 29, 3, 4, 5, 73, - 22, 22, 6, 20, 23, 15, 23, 23, 24, 31, - 31, 45, 40, 24, 26, 45, 26, 26, 12, 24, - - 25, 40, 25, 25, 73, 26, 54, 41, 26, 26, - 47, 25, 41, 47, 25, 25, 25, 60, 38, 26, - 38, 39, 60, 38, 26, 25, 39, 49, 49, 39, - 25, 50, 26, 51, 50, 52, 49, 51, 25, 52, - 64, 25, 67, 54, 74, 64, 82, 82, 50, 225, - 74, 108, 86, 86, 108, 82, 82, 225, 82, 111, - 327, 86, 86, 117, 86, 126, 111, 117, 309, 82, - 82, 67, 126, 307, 82, 86, 86, 122, 305, 87, - 86, 87, 87, 88, 304, 88, 89, 89, 88, 88, - 87, 122, 303, 87, 87, 129, 129, 91, 301, 91, - - 91, 139, 89, 139, 87, 300, 139, 139, 91, 87, - 89, 91, 91, 298, 142, 142, 297, 87, 146, 146, - 145, 145, 91, 142, 142, 156, 142, 91, 143, 156, - 143, 147, 147, 143, 143, 91, 145, 142, 142, 189, - 189, 147, 142, 147, 145, 148, 148, 296, 190, 190, - 294, 191, 293, 191, 291, 147, 191, 191, 190, 147, - 190, 148, 193, 193, 290, 194, 194, 196, 196, 148, - 232, 232, 190, 289, 288, 194, 190, 194, 233, 233, - 287, 286, 285, 196, 284, 283, 279, 277, 233, 194, - 233, 196, 276, 194, 275, 274, 273, 269, 267, 266, - - 264, 263, 233, 261, 259, 258, 233, 320, 320, 320, - 320, 320, 321, 321, 321, 321, 321, 322, 256, 322, - 322, 322, 323, 323, 323, 323, 323, 324, 324, 255, - 324, 324, 325, 325, 326, 254, 326, 326, 326, 328, - 253, 328, 328, 328, 329, 251, 329, 329, 329, 250, - 249, 248, 247, 246, 245, 244, 243, 241, 240, 239, - 238, 237, 236, 231, 229, 228, 227, 226, 224, 223, - 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, - 212, 210, 209, 208, 207, 206, 204, 203, 202, 201, - 200, 199, 186, 185, 184, 183, 182, 181, 180, 179, - - 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, - 167, 166, 165, 163, 162, 161, 160, 159, 158, 157, - 155, 154, 153, 152, 151, 128, 127, 125, 124, 123, - 121, 120, 119, 118, 116, 115, 114, 113, 112, 110, - 109, 107, 106, 105, 104, 103, 102, 101, 100, 97, - 93, 81, 80, 69, 48, 46, 44, 43, 42, 37, - 36, 30, 27, 19, 16, 14, 11, 7, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "lexer.l" -#define INITIAL 0 -#line 2 "lexer.l" -/* - * FILE: lexer.l - * AUTH: Michael John Radwin - * - * DESC: stubgen lexer. Portions borrowed from Newcastle - * University's Arjuna project (http://arjuna.ncl.ac.uk/), and - * Jeff Lee's ANSI Grammar - * (ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z) - * - * DATE: Thu Aug 15 13:10:06 EDT 1996 - * $Id: lex.yy.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Modification history: - * $Log: not supported by cvs2svn $ - * Revision 1.1 2001/11/07 10:06:07 ithamar - * Added stubgen to CVS - * - * Revision 1.33 1998/07/27 19:16:57 mradwin - * added some c++ keywords - * need to handle typename, using, and namespace - * - * Revision 1.32 1998/05/11 19:49:11 mradwin - * Version 2.03 (updated copyright information). - * - * Revision 1.31 1998/04/07 23:39:55 mradwin - * changed error-handling code significantly. functions - * like count() are now contributing to linebuf so we get correct - * parse error messages during lineno == 1 and other situations. - * also, instead of calling fatal() for collect*() functions, - * we return -1 and let the parser recover more gracefully. - * - * Revision 1.30 1998/01/12 19:39:11 mradwin - * modified rcsid - * - * Revision 1.29 1997/11/13 22:37:31 mradwin - * changed char[] to char * to make non-gcc compilers - * a little happier. We need to #define const to nothing - * for other compilers as well. - * - * Revision 1.28 1997/11/13 21:29:30 mradwin - * moved code from parser.y to main.c - * - * Revision 1.27 1997/11/13 21:10:17 mradwin - * renamed stubgen.[ly] to parser.y lexer.l - * - * Revision 1.26 1997/11/11 03:52:06 mradwin - * changed fatal() - * - * Revision 1.25 1997/11/05 03:02:02 mradwin - * Modified logging routines. - * - * Revision 1.24 1997/11/01 23:12:43 mradwin - * greatly improved error-recovery. errors no longer spill over - * into other files because the yyerror state is properly reset. - * - * Revision 1.23 1997/10/26 23:16:32 mradwin - * changed inform_user and fatal functions to use varargs - * - * Revision 1.22 1997/10/26 22:46:48 mradwin - * support macros within comments, etc. - * - * Revision 1.21 1997/10/16 19:42:48 mradwin - * added support for elipses, static member/array initializers, - * and bitfields. - * - * Revision 1.20 1997/10/16 17:36:06 mradwin - * Fixed compiler warning on win32 from and isspace() - * - * Revision 1.19 1997/10/16 17:12:59 mradwin - * handle extern "C" blocks better now, and support multi-line - * macros. still need error-checking. - * - * Revision 1.18 1997/10/15 22:09:06 mradwin - * changed tons of names. stubelem -> sytaxelem, - * stubin -> infile, stubout -> outfile, stublog -> logfile. - * - * Revision 1.17 1997/10/15 21:45:13 mradwin - * rearranged table.[ch] and util.[ch] so that util pkg - * knows nothing about syntaxelems. - * - * Revision 1.16 1997/10/15 17:42:37 mradwin - * added support for 'extern "C" { ... }' blocks. - * - * Revision 1.15 1997/09/05 19:17:06 mradwin - * works for scanning old versions, except for parameter - * names that differ between .H and .C files. - * - * Revision 1.14 1997/09/05 16:37:41 mradwin - * rcsid - * - * Revision 1.13 1997/09/05 16:34:36 mradwin - * GPL-ized code. - * - * Revision 1.12 1997/09/05 16:13:18 mradwin - * changed email address to acm.org - * - * Revision 1.11 1996/09/12 14:44:49 mjr - * Added throw decl recognition (great, another 4 bytes in syntaxelem) - * and cleaned up the grammar so that const_opt appears in far fewer - * places. const_opt is by default 0 as well, so we don't need to - * pass it as an arg to new_elem(). - * - * I also added a fix to a potential bug with the MINIT and INLIN - * exclusive start states. I think they could have been confused - * by braces within comments, so now I'm grabbing comments in those - * states as well. - * - * Revision 1.10 1996/09/12 03:46:10 mjr - * No concrete changes in code. Just added some sanity by - * factoring out code into util.[ch] and putting some prototypes - * that were in table.h into stubgen.y where they belong. - * - * Revision 1.9 1996/09/01 20:59:48 mjr - * Added collectMemberInitList() function, which is similar - * to collectInlineDef() and also the exclusive state MINIT - * - * Revision 1.8 1996/08/23 05:09:19 mjr - * fixed up some more portability things - * - * Revision 1.7 1996/08/22 02:43:47 mjr - * added parse error message (using O'Reilly p. 274) - * - * Revision 1.6 1996/08/21 18:33:50 mjr - * removed the buffer for inlines. we don't care anyway. - * now we can't overflow on inlines! - * - * Revision 1.5 1996/08/21 17:40:56 mjr - * added some cpp directives for porting to WIN32 - * - * Revision 1.4 1996/08/19 17:01:33 mjr - * no echo now - * - * Revision 1.3 1996/08/15 21:24:58 mjr - * *** empty log message *** - */ -#line 163 "lexer.l" -#include -#include -#include -#include "table.h" -#include "util.h" - -#ifdef WIN32 -/* definitions of exit, malloc, realloc, and free */ -#include -#endif - -#if 0 /* #ifdef WIN32 */ -#include "y_tab.h" -#else -#include "y.tab.h" -#endif - -#ifdef __cplusplus -#define STUB_INPUT() yyinput() -#else -#define STUB_INPUT() input() -#endif - -/* when we return a string, duplicate it so we can free it later. - we always allocate memory so we can uniformly free() it. */ -#define RETURN_STR(x) tokens_seen++; yylval.string = strdup(yytext); return(x) - -/* make that nasty union a value that will bus error if we misinterpret - the value as a pointer */ -#define RETURN_VAL(x) tokens_seen++; yylval.flag = 37; return(x) - -static const char rcsid[] = "$Id: lex.yy.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $"; - -static void count(); -static void comment(); -static void macro(); - -char linebuf[1024]; /* null-terminated at beginning of each file */ -int lineno; /* set to 1 at beginning of each file */ -int column; /* set to 0 at beginning of each file */ -int tokens_seen; /* set to 0 at beginning of each file */ - -#define INLIN 1 -#define MINIT 2 - -#line 787 "lex.yy.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 208 "lexer.l" - -#line 940 "lex.yy.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 320 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 469 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 209 "lexer.l" -{ /* - * for debugging purposes, we grab an entire - * line and buffer it, then grab tokens out of - * it. This lets us have more informative - * error messages. See yyerror() in parser.y - */ - strncpy(linebuf, yytext+1, 1024); - lineno++; - column = 0; - yyless(1); /* give back everything but \n */ - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 220 "lexer.l" -{ comment(); } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 222 "lexer.l" -{ count(); } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 223 "lexer.l" -{ macro(); /* was #.* { count(); } */ } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 225 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 226 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 227 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 228 "lexer.l" -{ count(); RETURN_VAL(EXTERN); } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 229 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 230 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 231 "lexer.l" -{ count(); RETURN_VAL(STRUCT); } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 232 "lexer.l" -{ count(); RETURN_VAL(UNION); } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 233 "lexer.l" -{ count(); RETURN_VAL(ENUM); } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 234 "lexer.l" -{ count(); RETURN_VAL(CONST); } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 235 "lexer.l" -{ count(); RETURN_VAL(TEMPLATE); } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 237 "lexer.l" -{ count(); tokens_seen++; /* FIXME */ } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 238 "lexer.l" -{ count(); tokens_seen++; /* FIXME */ } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 239 "lexer.l" -{ count(); RETURN_VAL(CLASS); /* FIXME */ } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 241 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 242 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 244 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 245 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 246 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 247 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 248 "lexer.l" -{ count(); RETURN_VAL(CLASS); } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 249 "lexer.l" -{ count(); RETURN_VAL(DELETE); } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 250 "lexer.l" -{ count(); RETURN_VAL(NEW); } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 251 "lexer.l" -{ count(); RETURN_VAL(FRIEND); } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 252 "lexer.l" -{ count(); RETURN_VAL(OPERATOR); } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 253 "lexer.l" -{ count(); RETURN_VAL(PROTECTED); } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 254 "lexer.l" -{ count(); RETURN_VAL(PRIVATE); } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 255 "lexer.l" -{ count(); RETURN_VAL(PUBLIC); } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 256 "lexer.l" -{ count(); RETURN_VAL(THROW); } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 258 "lexer.l" -{ count(); RETURN_STR(CHAR); } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 259 "lexer.l" -{ count(); RETURN_STR(SHORT); } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 260 "lexer.l" -{ count(); RETURN_STR(INT); } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 261 "lexer.l" -{ count(); RETURN_STR(LONG); } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 262 "lexer.l" -{ count(); RETURN_STR(SIGNED); } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 263 "lexer.l" -{ count(); RETURN_STR(UNSIGNED); } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 264 "lexer.l" -{ count(); RETURN_STR(FLOAT); } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 265 "lexer.l" -{ count(); RETURN_STR(DOUBLE); } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 266 "lexer.l" -{ count(); RETURN_STR(VOID); } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 268 "lexer.l" -{ count(); RETURN_STR(IDENTIFIER); } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 270 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 271 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 272 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 273 "lexer.l" -{ count(); RETURN_STR(CONSTANT); /* 'fontlck */ } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 275 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 276 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 277 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 279 "lexer.l" -{ count(); RETURN_STR(STRING_LITERAL); /* "fontlck */ } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 281 "lexer.l" -{ count(); RETURN_VAL(RIGHT_ASSIGN); } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 282 "lexer.l" -{ count(); RETURN_VAL(LEFT_ASSIGN); } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 283 "lexer.l" -{ count(); RETURN_VAL(ADD_ASSIGN); } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 284 "lexer.l" -{ count(); RETURN_VAL(SUB_ASSIGN); } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 285 "lexer.l" -{ count(); RETURN_VAL(MUL_ASSIGN); } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 286 "lexer.l" -{ count(); RETURN_VAL(DIV_ASSIGN); } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 287 "lexer.l" -{ count(); RETURN_VAL(MOD_ASSIGN); } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 288 "lexer.l" -{ count(); RETURN_VAL(AND_ASSIGN); } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 289 "lexer.l" -{ count(); RETURN_VAL(XOR_ASSIGN); } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 290 "lexer.l" -{ count(); RETURN_VAL(OR_ASSIGN); } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 291 "lexer.l" -{ count(); RETURN_VAL(RIGHT_OP); } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 292 "lexer.l" -{ count(); RETURN_VAL(LEFT_OP); } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 293 "lexer.l" -{ count(); RETURN_VAL(INC_OP); } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 294 "lexer.l" -{ count(); RETURN_VAL(DEC_OP); } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 295 "lexer.l" -{ count(); RETURN_VAL(PTR_OP); } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 296 "lexer.l" -{ count(); RETURN_VAL(MEM_PTR_OP); } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 297 "lexer.l" -{ count(); RETURN_VAL(AND_OP); } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 298 "lexer.l" -{ count(); RETURN_VAL(OR_OP); } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 299 "lexer.l" -{ count(); RETURN_VAL(LE_OP); } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 300 "lexer.l" -{ count(); RETURN_VAL(GE_OP); } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 301 "lexer.l" -{ count(); RETURN_VAL(EQ_OP); } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 302 "lexer.l" -{ count(); RETURN_VAL(NE_OP); } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 303 "lexer.l" -{ count(); RETURN_VAL(';'); } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 304 "lexer.l" -{ count(); RETURN_VAL('{'); } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 305 "lexer.l" -{ count(); RETURN_VAL('}'); } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 306 "lexer.l" -{ count(); RETURN_VAL(','); } - YY_BREAK -case 78: -YY_RULE_SETUP -#line 307 "lexer.l" -{ count(); RETURN_VAL(':'); } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 308 "lexer.l" -{ count(); RETURN_VAL('='); } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 309 "lexer.l" -{ count(); RETURN_VAL('('); } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 310 "lexer.l" -{ count(); RETURN_VAL(')'); } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 311 "lexer.l" -{ count(); RETURN_VAL('['); } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 312 "lexer.l" -{ count(); RETURN_VAL(']'); } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 313 "lexer.l" -{ count(); RETURN_VAL('.'); } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 314 "lexer.l" -{ count(); RETURN_VAL('&'); } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 315 "lexer.l" -{ count(); RETURN_VAL('!'); } - YY_BREAK -case 87: -YY_RULE_SETUP -#line 316 "lexer.l" -{ count(); RETURN_VAL('~'); } - YY_BREAK -case 88: -YY_RULE_SETUP -#line 317 "lexer.l" -{ count(); RETURN_VAL('-'); } - YY_BREAK -case 89: -YY_RULE_SETUP -#line 318 "lexer.l" -{ count(); RETURN_VAL('+'); } - YY_BREAK -case 90: -YY_RULE_SETUP -#line 319 "lexer.l" -{ count(); RETURN_VAL('*'); } - YY_BREAK -case 91: -YY_RULE_SETUP -#line 320 "lexer.l" -{ count(); RETURN_VAL('/'); } - YY_BREAK -case 92: -YY_RULE_SETUP -#line 321 "lexer.l" -{ count(); RETURN_VAL('%'); } - YY_BREAK -case 93: -YY_RULE_SETUP -#line 322 "lexer.l" -{ count(); RETURN_VAL('<'); } - YY_BREAK -case 94: -YY_RULE_SETUP -#line 323 "lexer.l" -{ count(); RETURN_VAL('>'); } - YY_BREAK -case 95: -YY_RULE_SETUP -#line 324 "lexer.l" -{ count(); RETURN_VAL('^'); } - YY_BREAK -case 96: -YY_RULE_SETUP -#line 325 "lexer.l" -{ count(); RETURN_VAL('|'); } - YY_BREAK -case 97: -YY_RULE_SETUP -#line 326 "lexer.l" -{ count(); RETURN_VAL('?'); } - YY_BREAK -case 98: -YY_RULE_SETUP -#line 327 "lexer.l" -{ count(); RETURN_VAL(CLCL); } - YY_BREAK -case 99: -YY_RULE_SETUP -#line 328 "lexer.l" -{ count(); RETURN_VAL(ELIPSIS); } - YY_BREAK -case 100: -YY_RULE_SETUP -#line 330 "lexer.l" -{ comment(); } - YY_BREAK -case 101: -YY_RULE_SETUP -#line 331 "lexer.l" -{ count(); } - YY_BREAK -case 102: -YY_RULE_SETUP -#line 332 "lexer.l" -{ macro(); /* was #.* { count(); } */ } - YY_BREAK -case 103: -#line 334 "lexer.l" -case 104: -YY_RULE_SETUP -#line 334 "lexer.l" -{ RETURN_VAL((int) yytext[0]); } - YY_BREAK -case 105: -YY_RULE_SETUP -#line 336 "lexer.l" -{ comment(); } - YY_BREAK -case 106: -YY_RULE_SETUP -#line 337 "lexer.l" -{ count(); } - YY_BREAK -case 107: -YY_RULE_SETUP -#line 338 "lexer.l" -{ macro(); /* was #.* { count(); } */ } - YY_BREAK -case 108: -#line 340 "lexer.l" -case 109: -YY_RULE_SETUP -#line 340 "lexer.l" -{ RETURN_VAL((int) yytext[0]); } - YY_BREAK -case 110: -YY_RULE_SETUP -#line 342 "lexer.l" -{ count(); } - YY_BREAK -case 111: -YY_RULE_SETUP -#line 343 "lexer.l" -{ count(); /* ignore bad characters */ } - YY_BREAK -case 112: -YY_RULE_SETUP -#line 345 "lexer.l" -ECHO; - YY_BREAK -#line 1587 "lex.yy.c" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(INLIN): -case YY_STATE_EOF(MINIT): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 320 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 320 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 319); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 345 "lexer.l" - - -/* - * called when EOF is encountered. Return 1 so the scanner will return - * the zero token to report end-of-file. - */ -int yywrap() -{ - return(1); -} - -static void comment() -{ - int c1 = 0, c2 = STUB_INPUT(); - - linebuf[column] = c2; - column++; - for(;;) { - if (c2 == EOF) - break; - if (c1 == '*' && c2 == '/') - break; - if (c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - } - - c1 = c2; - c2 = STUB_INPUT(); - linebuf[column] = c2; - column++; - } -} - - -static void macro() -{ - int c1 = 0, c2 = STUB_INPUT(), nonws = 0; - - log_printf("MACRO reading begining...\n#"); - log_printf("%c", c2); - - linebuf[column] = c2; - column++; - for(;;) { - if (c2 == EOF) - break; - if (!isspace(c1)) - nonws = c1; - if (nonws == '\\' && c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - } else if (c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - break; - } - - c1 = c2; - c2 = STUB_INPUT(); - linebuf[column] = c2; - log_printf("%c", c2); - column++; - } - log_printf("MACRO reading done.\n"); -} - - -static void count() -{ - int i; - - if (lineno == 1) - strcat(linebuf, yytext); - - for (i = 0; yytext[i] != '\0'; i++) - if (yytext[i] == '\n') - column = 0; - else if (yytext[i] == '\t') - column += 8 - (column % 8); - else - column++; - - /* equiv to fprintf(yyout, "%s", yytext); */ - /* ECHO; */ -} - -/* - * Collect the contents of inline functions, reading them char by char. - * thanks to the arjuna stubgen project for this one - */ -int collectInlineDef() -{ - int bracelevel = 1; - int token; - - /* the magic of exclusive start states makes it all possible */ - BEGIN INLIN; - - while (bracelevel > 0) { - token = yylex(); - column++; -/* fprintf(stderr, "INLIN: read token %c\n", token); */ - if (token > 0) { - /* Assume single char */ - switch (token) { - case '{': - bracelevel++; - break; - case '}': - bracelevel--; - if (bracelevel == 0) - { - column--; - unput(token); - break; - } - break; - case '\n': - column = 0; - lineno++; - break; - } - } else { - /* fatal error: Unexpected EOF reading inline function */ - return -1; - } - } - - /* we now return you to your regularly scheduled start state */ - BEGIN 0; - - return 0; -} - - -/* - * hmmm... looks familiar. more control-y programming. - */ -int collectMemberInitList() -{ - int token; - int insideList = 1; - - /* the magic of exclusive start states makes it all possible */ - BEGIN MINIT; - - while(insideList) { - token = yylex(); - column++; -/* fprintf(stderr, "MINIT: read token %c\n", token); */ - if (token > 0) { - /* Assume single char */ - switch (token) - { - case '{': - insideList = 0; - unput(token); - break; - case '\n': - column = 0; - lineno++; - break; - } - } else { - /* fatal error: Unexpected EOF reading member initialization */ - return -1; - } - } - - /* we now return you to your regularly scheduled start state */ - BEGIN 0; - - return 0; -} diff --git a/bepascal/bepascal/stubgen.so/lexer.l b/bepascal/bepascal/stubgen.so/lexer.l deleted file mode 100644 index d311389..0000000 --- a/bepascal/bepascal/stubgen.so/lexer.l +++ /dev/null @@ -1,522 +0,0 @@ -%{ -/* - * FILE: lexer.l - * AUTH: Michael John Radwin - * - * DESC: stubgen lexer. Portions borrowed from Newcastle - * University's Arjuna project (http://arjuna.ncl.ac.uk/), and - * Jeff Lee's ANSI Grammar - * (ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z) - * - * DATE: Thu Aug 15 13:10:06 EDT 1996 - * $Id: lexer.l,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Modification history: - * $Log: not supported by cvs2svn $ - * Revision 1.1 2001/11/07 10:06:07 ithamar - * Added stubgen to CVS - * - * Revision 1.33 1998/07/27 19:16:57 mradwin - * added some c++ keywords - * need to handle typename, using, and namespace - * - * Revision 1.32 1998/05/11 19:49:11 mradwin - * Version 2.03 (updated copyright information). - * - * Revision 1.31 1998/04/07 23:39:55 mradwin - * changed error-handling code significantly. functions - * like count() are now contributing to linebuf so we get correct - * parse error messages during lineno == 1 and other situations. - * also, instead of calling fatal() for collect*() functions, - * we return -1 and let the parser recover more gracefully. - * - * Revision 1.30 1998/01/12 19:39:11 mradwin - * modified rcsid - * - * Revision 1.29 1997/11/13 22:37:31 mradwin - * changed char[] to char * to make non-gcc compilers - * a little happier. We need to #define const to nothing - * for other compilers as well. - * - * Revision 1.28 1997/11/13 21:29:30 mradwin - * moved code from parser.y to main.c - * - * Revision 1.27 1997/11/13 21:10:17 mradwin - * renamed stubgen.[ly] to parser.y lexer.l - * - * Revision 1.26 1997/11/11 03:52:06 mradwin - * changed fatal() - * - * Revision 1.25 1997/11/05 03:02:02 mradwin - * Modified logging routines. - * - * Revision 1.24 1997/11/01 23:12:43 mradwin - * greatly improved error-recovery. errors no longer spill over - * into other files because the yyerror state is properly reset. - * - * Revision 1.23 1997/10/26 23:16:32 mradwin - * changed inform_user and fatal functions to use varargs - * - * Revision 1.22 1997/10/26 22:46:48 mradwin - * support macros within comments, etc. - * - * Revision 1.21 1997/10/16 19:42:48 mradwin - * added support for elipses, static member/array initializers, - * and bitfields. - * - * Revision 1.20 1997/10/16 17:36:06 mradwin - * Fixed compiler warning on win32 from and isspace() - * - * Revision 1.19 1997/10/16 17:12:59 mradwin - * handle extern "C" blocks better now, and support multi-line - * macros. still need error-checking. - * - * Revision 1.18 1997/10/15 22:09:06 mradwin - * changed tons of names. stubelem -> sytaxelem, - * stubin -> infile, stubout -> outfile, stublog -> logfile. - * - * Revision 1.17 1997/10/15 21:45:13 mradwin - * rearranged table.[ch] and util.[ch] so that util pkg - * knows nothing about syntaxelems. - * - * Revision 1.16 1997/10/15 17:42:37 mradwin - * added support for 'extern "C" { ... }' blocks. - * - * Revision 1.15 1997/09/05 19:17:06 mradwin - * works for scanning old versions, except for parameter - * names that differ between .H and .C files. - * - * Revision 1.14 1997/09/05 16:37:41 mradwin - * rcsid - * - * Revision 1.13 1997/09/05 16:34:36 mradwin - * GPL-ized code. - * - * Revision 1.12 1997/09/05 16:13:18 mradwin - * changed email address to acm.org - * - * Revision 1.11 1996/09/12 14:44:49 mjr - * Added throw decl recognition (great, another 4 bytes in syntaxelem) - * and cleaned up the grammar so that const_opt appears in far fewer - * places. const_opt is by default 0 as well, so we don't need to - * pass it as an arg to new_elem(). - * - * I also added a fix to a potential bug with the MINIT and INLIN - * exclusive start states. I think they could have been confused - * by braces within comments, so now I'm grabbing comments in those - * states as well. - * - * Revision 1.10 1996/09/12 03:46:10 mjr - * No concrete changes in code. Just added some sanity by - * factoring out code into util.[ch] and putting some prototypes - * that were in table.h into stubgen.y where they belong. - * - * Revision 1.9 1996/09/01 20:59:48 mjr - * Added collectMemberInitList() function, which is similar - * to collectInlineDef() and also the exclusive state MINIT - * - * Revision 1.8 1996/08/23 05:09:19 mjr - * fixed up some more portability things - * - * Revision 1.7 1996/08/22 02:43:47 mjr - * added parse error message (using O'Reilly p. 274) - * - * Revision 1.6 1996/08/21 18:33:50 mjr - * removed the buffer for inlines. we don't care anyway. - * now we can't overflow on inlines! - * - * Revision 1.5 1996/08/21 17:40:56 mjr - * added some cpp directives for porting to WIN32 - * - * Revision 1.4 1996/08/19 17:01:33 mjr - * no echo now - * - * Revision 1.3 1996/08/15 21:24:58 mjr - * *** empty log message *** - */ -%} - -D [0-9] -L [a-zA-Z_] -H [a-fA-F0-9] -E [Ee][+-]?{D}+ -FS (f|F|l|L) -IS (u|U|l|L)* - -%{ -#include -#include -#include -#include "table.h" -#include "util.h" - -#ifdef WIN32 -/* definitions of exit, malloc, realloc, and free */ -#include -#endif - -#if 0 /* #ifdef WIN32 */ -#include "y_tab.h" -#else -#include "y.tab.h" -#endif - -#ifdef __cplusplus -#define STUB_INPUT() yyinput() -#else -#define STUB_INPUT() input() -#endif - -/* when we return a string, duplicate it so we can free it later. - we always allocate memory so we can uniformly free() it. */ -#define RETURN_STR(x) tokens_seen++; yylval.string = strdup(yytext); return(x) - -/* make that nasty union a value that will bus error if we misinterpret - the value as a pointer */ -#define RETURN_VAL(x) tokens_seen++; yylval.flag = 37; return(x) - -static const char rcsid[] = "$Id: lexer.l,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $"; - -static void count(); -static void comment(); -static void macro(); - -char linebuf[1024]; /* null-terminated at beginning of each file */ -int lineno; /* set to 1 at beginning of each file */ -int column; /* set to 0 at beginning of each file */ -int tokens_seen; /* set to 0 at beginning of each file */ - -%} - -%x INLIN MINIT -%% -\n.* { /* - * for debugging purposes, we grab an entire - * line and buffer it, then grab tokens out of - * it. This lets us have more informative - * error messages. See yyerror() in parser.y - */ - strncpy(linebuf, yytext+1, 1024); - lineno++; - column = 0; - yyless(1); /* give back everything but \n */ - } -"/*" { comment(); } - -"//".* { count(); } -"#" { macro(); /* was #.* { count(); } */ } - -"static" { count(); tokens_seen++; } -"volatile" { count(); tokens_seen++; } -"auto" { count(); tokens_seen++; } -"extern" { count(); RETURN_VAL(EXTERN); } -"register" { count(); tokens_seen++; } -"typedef" { count(); tokens_seen++; } -"struct" { count(); RETURN_VAL(STRUCT); } -"union" { count(); RETURN_VAL(UNION); } -"enum" { count(); RETURN_VAL(ENUM); } -"const" { count(); RETURN_VAL(CONST); } -"template" { count(); RETURN_VAL(TEMPLATE); } - -"typename" { count(); tokens_seen++; /* FIXME */ } -"using" { count(); tokens_seen++; /* FIXME */ } -"namespace" { count(); RETURN_VAL(CLASS); /* FIXME */ } - -"dllexport" { count(); tokens_seen++; } -"dllimport" { count(); tokens_seen++; } - -"explicit" { count(); tokens_seen++; } -"mutable" { count(); tokens_seen++; } -"inline" { count(); tokens_seen++; } -"virtual" { count(); tokens_seen++; } -"class" { count(); RETURN_VAL(CLASS); } -"delete" { count(); RETURN_VAL(DELETE); } -"new" { count(); RETURN_VAL(NEW); } -"friend" { count(); RETURN_VAL(FRIEND); } -"operator" { count(); RETURN_VAL(OPERATOR); } -"protected" { count(); RETURN_VAL(PROTECTED); } -"private" { count(); RETURN_VAL(PRIVATE); } -"public" { count(); RETURN_VAL(PUBLIC); } -"throw" { count(); RETURN_VAL(THROW); } - -"char" { count(); RETURN_STR(CHAR); } -"short" { count(); RETURN_STR(SHORT); } -"int" { count(); RETURN_STR(INT); } -"long" { count(); RETURN_STR(LONG); } -"signed" { count(); RETURN_STR(SIGNED); } -"unsigned" { count(); RETURN_STR(UNSIGNED); } -"float" { count(); RETURN_STR(FLOAT); } -"double" { count(); RETURN_STR(DOUBLE); } -"void" { count(); RETURN_STR(VOID); } - -{L}({L}|{D})* { count(); RETURN_STR(IDENTIFIER); } - -0[xX]{H}+{IS}? { count(); RETURN_STR(CONSTANT); } -0{D}+{IS}? { count(); RETURN_STR(CONSTANT); } -{D}+{IS}? { count(); RETURN_STR(CONSTANT); } -'(\\.|[^\\'])+' { count(); RETURN_STR(CONSTANT); /* 'fontlck */ } - -{D}+{E}{FS}? { count(); RETURN_STR(CONSTANT); } -{D}*"."{D}+({E})?{FS}? { count(); RETURN_STR(CONSTANT); } -{D}+"."{D}*({E})?{FS}? { count(); RETURN_STR(CONSTANT); } - -\"(\\.|[^\\"])*\" { count(); RETURN_STR(STRING_LITERAL); /* "fontlck */ } - -">>=" { count(); RETURN_VAL(RIGHT_ASSIGN); } -"<<=" { count(); RETURN_VAL(LEFT_ASSIGN); } -"+=" { count(); RETURN_VAL(ADD_ASSIGN); } -"-=" { count(); RETURN_VAL(SUB_ASSIGN); } -"*=" { count(); RETURN_VAL(MUL_ASSIGN); } -"/=" { count(); RETURN_VAL(DIV_ASSIGN); } -"%=" { count(); RETURN_VAL(MOD_ASSIGN); } -"&=" { count(); RETURN_VAL(AND_ASSIGN); } -"^=" { count(); RETURN_VAL(XOR_ASSIGN); } -"|=" { count(); RETURN_VAL(OR_ASSIGN); } -">>" { count(); RETURN_VAL(RIGHT_OP); } -"<<" { count(); RETURN_VAL(LEFT_OP); } -"++" { count(); RETURN_VAL(INC_OP); } -"--" { count(); RETURN_VAL(DEC_OP); } -"->" { count(); RETURN_VAL(PTR_OP); } -"->*" { count(); RETURN_VAL(MEM_PTR_OP); } -"&&" { count(); RETURN_VAL(AND_OP); } -"||" { count(); RETURN_VAL(OR_OP); } -"<=" { count(); RETURN_VAL(LE_OP); } -">=" { count(); RETURN_VAL(GE_OP); } -"==" { count(); RETURN_VAL(EQ_OP); } -"!=" { count(); RETURN_VAL(NE_OP); } -";" { count(); RETURN_VAL(';'); } -"{" { count(); RETURN_VAL('{'); } -"}" { count(); RETURN_VAL('}'); } -"," { count(); RETURN_VAL(','); } -":" { count(); RETURN_VAL(':'); } -"=" { count(); RETURN_VAL('='); } -"(" { count(); RETURN_VAL('('); } -")" { count(); RETURN_VAL(')'); } -"[" { count(); RETURN_VAL('['); } -"]" { count(); RETURN_VAL(']'); } -"." { count(); RETURN_VAL('.'); } -"&" { count(); RETURN_VAL('&'); } -"!" { count(); RETURN_VAL('!'); } -"~" { count(); RETURN_VAL('~'); } -"-" { count(); RETURN_VAL('-'); } -"+" { count(); RETURN_VAL('+'); } -"*" { count(); RETURN_VAL('*'); } -"/" { count(); RETURN_VAL('/'); } -"%" { count(); RETURN_VAL('%'); } -"<" { count(); RETURN_VAL('<'); } -">" { count(); RETURN_VAL('>'); } -"^" { count(); RETURN_VAL('^'); } -"|" { count(); RETURN_VAL('|'); } -"?" { count(); RETURN_VAL('?'); } -"::" { count(); RETURN_VAL(CLCL); } -"..." { count(); RETURN_VAL(ELIPSIS); } - -"/*" { comment(); } -"//".* { count(); } -"#" { macro(); /* was #.* { count(); } */ } -. | -\n { RETURN_VAL((int) yytext[0]); } - -"/*" { comment(); } -"//".* { count(); } -"#" { macro(); /* was #.* { count(); } */ } -. | -\n { RETURN_VAL((int) yytext[0]); } - -[ \t\v\f] { count(); } -. { count(); /* ignore bad characters */ } - -%% - -/* - * called when EOF is encountered. Return 1 so the scanner will return - * the zero token to report end-of-file. - */ -int yywrap() -{ - return(1); -} - -static void comment() -{ - int c1 = 0, c2 = STUB_INPUT(); - - linebuf[column] = c2; - column++; - for(;;) { - if (c2 == EOF) - break; - if (c1 == '*' && c2 == '/') - break; - if (c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - } - - c1 = c2; - c2 = STUB_INPUT(); - linebuf[column] = c2; - column++; - } -} - - -static void macro() -{ - int c1 = 0, c2 = STUB_INPUT(), nonws = 0; - - log_printf("MACRO reading begining...\n#"); - log_printf("%c", c2); - - linebuf[column] = c2; - column++; - for(;;) { - if (c2 == EOF) - break; - if (!isspace(c1)) - nonws = c1; - if (nonws == '\\' && c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - } else if (c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - break; - } - - c1 = c2; - c2 = STUB_INPUT(); - linebuf[column] = c2; - log_printf("%c", c2); - column++; - } - log_printf("MACRO reading done.\n"); -} - - -static void count() -{ - int i; - - if (lineno == 1) - strcat(linebuf, yytext); - - for (i = 0; yytext[i] != '\0'; i++) - if (yytext[i] == '\n') - column = 0; - else if (yytext[i] == '\t') - column += 8 - (column % 8); - else - column++; - - /* equiv to fprintf(yyout, "%s", yytext); */ - /* ECHO; */ -} - -/* - * Collect the contents of inline functions, reading them char by char. - * thanks to the arjuna stubgen project for this one - */ -int collectInlineDef() -{ - int bracelevel = 1; - int token; - - /* the magic of exclusive start states makes it all possible */ - BEGIN INLIN; - - while (bracelevel > 0) { - token = yylex(); - column++; -/* fprintf(stderr, "INLIN: read token %c\n", token); */ - if (token > 0) { - /* Assume single char */ - switch (token) { - case '{': - bracelevel++; - break; - case '}': - bracelevel--; - if (bracelevel == 0) - { - column--; - unput(token); - break; - } - break; - case '\n': - column = 0; - lineno++; - break; - } - } else { - /* fatal error: Unexpected EOF reading inline function */ - return -1; - } - } - - /* we now return you to your regularly scheduled start state */ - BEGIN 0; - - return 0; -} - - -/* - * hmmm... looks familiar. more control-y programming. - */ -int collectMemberInitList() -{ - int token; - int insideList = 1; - - /* the magic of exclusive start states makes it all possible */ - BEGIN MINIT; - - while(insideList) { - token = yylex(); - column++; -/* fprintf(stderr, "MINIT: read token %c\n", token); */ - if (token > 0) { - /* Assume single char */ - switch (token) - { - case '{': - insideList = 0; - unput(token); - break; - case '\n': - column = 0; - lineno++; - break; - } - } else { - /* fatal error: Unexpected EOF reading member initialization */ - return -1; - } - } - - /* we now return you to your regularly scheduled start state */ - BEGIN 0; - - return 0; -} diff --git a/bepascal/bepascal/stubgen.so/lib.c b/bepascal/bepascal/stubgen.so/lib.c deleted file mode 100644 index 328a7ff..0000000 --- a/bepascal/bepascal/stubgen.so/lib.c +++ /dev/null @@ -1,2 +0,0 @@ -#include "main.c" - diff --git a/bepascal/bepascal/stubgen.so/main.c b/bepascal/bepascal/stubgen.so/main.c deleted file mode 100644 index 7869fe0..0000000 --- a/bepascal/bepascal/stubgen.so/main.c +++ /dev/null @@ -1,736 +0,0 @@ -/* - * FILE: main.c - * AUTH: Michael John Radwin - * - * DESC: stubgen code generation routines - * - * DATE: Thu Nov 13 13:28:23 PST 1997 - * $Id: main.c,v 1.3 2002-11-19 23:28:01 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "table.h" -#include "util.h" -#include "pathname.h" -#include -#include -#include -#include -#include - -#ifdef WIN32 -#include /* defintion of GetUserName(), BOOL, etc. */ -#include -#include /* defintion of alloca() */ -#include "getopt.h" /* use GNU getopt */ -#else /* !WIN32 */ -#include -#endif /* WIN32 */ - -/* protos */ -static void debug_printf(syntaxelem_t *); -static void generate_skel(syntaxelem_t *); -static void print_function(syntaxelem_t *); -static void function_hdr(syntaxelem_t *); -static void file_hdr(); -static void scan_and_generate(FILE *); -static void scan_existing_skeleton(); - -/* duplicating variable names from stubgen.pl */ -static const char *OPTS = "hqrivgae:cdbfsn"; -int opt_h = 0, opt_q = 0, opt_r = 0, opt_i = 0; -int opt_v = 0, opt_g = 0, opt_a = 0; -int opt_c = 0, opt_d = 0; -int opt_b = 0, opt_f = 0, opt_s = 0, opt_n = 0; -char *opt_e = "cpp"; - -int using_stdio = 0; -static int new_functions = 0, fileOpened = 0, fileExisted = 0; -static int inform_indent = 0; - -#ifdef SGDEBUG -static const char *logfilename = "stubgen.log"; -#endif /* SGDEBUG */ - -FILE *outfile = NULL; -static char *inPath = NULL, *outPath = NULL; -char *currentFile = ""; -static const char *lots_of_stars = - "***********************************************************************"; -static const char *progname = "stubgen"; -static const char rcsid[] = "$Id: main.c,v 1.3 2002-11-19 23:28:01 ocoursiere Exp $"; -static const char *progver = "2.05"; - -static const char *copyright = - "Copyright (c) 1996-1998 Michael John Radwin"; - -static const char *version_info = -"Distributed under the GNU General Public License.\n\ -See http://www.radwin.org/michael/projects/stubgen/ for more information.\n"; - -static const char *usage = -"usage: %s [-hqrivgacd] [-e ext] [-{bfsn}] [infiles]\n\ - OPTIONS\n\ - -h Display usage information.\n\ - -q Quiet mode, no status information while generating code.\n\ - -r Make RCS-style file headers.\n\ - -i Don't put the #include \"my_file.H\" directive in my_file.cpp\n\ - -v Display version information.\n\ - -g Generate dummy return statements for functions.\n\ - -a Split function arguments over multiple lines.\n\ - -c Print debugging output with cerrs (#include ).\n\ - -d Print debugging output with dprintfs (#include ).\n\ - -e ext Generate source files with extension '.ext' (default '.cpp').\n\ -\n\ - METHOD HEADER STYLES\n\ - -b Block method headers (default).\n\ - -f Full method headers: like block, but less asterisks.\n\ - -s Simple method headers: only \"Method\" and \"Descr\" fields.\n\ - -n No method headers.\n"; - - -static void generate_skel(syntaxelem_t *elt) -{ - syntaxelem_t *e; - - log_printf("generate_skel called: %s\n", elt->name); - if (elt->kind != CLASS_KIND && elt->kind != STRUCT_KIND) - return; - - inform_user("%*s==> %s %s", inform_indent, "", - (elt->kind == CLASS_KIND ? "class " : "struct"), - elt->name); - if (inform_indent == 0) - inform_user(" (file %s)", inPath); - else - inform_user(" (nested class)"); - inform_user("\n"); - inform_indent += 4; - - for (e = elt->children; e != NULL; e = e->next) { - if (e->kind == FUNC_KIND) { - char *arg_str = args_to_string(e->args, 0); - log_printf(">>>>>>> generating %s: %s %s::%s(%s) %s\n", - string_kind(e->kind), - e->ret_type, elt->name, e->name, arg_str, - (e->const_flag) ? "const" : ""); - free(arg_str); - print_se(e); - print_function(e); - e->kind = DONE_FUNC_KIND; - } else if (e->kind == CLASS_KIND || e->kind == STRUCT_KIND) { - /* nested class */ - char *tmp_str = (char *) malloc(strlen(elt->name) + strlen(e->name) + 3); - sprintf(tmp_str, "%s::%s", elt->name, e->name); - free(e->name); - e->name = tmp_str; - - log_printf(">>>>>>> generating NESTED %s: %s\n", - string_kind(e->kind), e->name); - print_se(e); - generate_skel(e); - } else { - log_printf("------> ignoring %s: %s\n", - string_kind(e->kind), e->name); - } - } - - inform_indent -= 4; - inform_user("%*s==> %s %s", inform_indent, "", - (elt->kind == CLASS_KIND ? "class " : "struct"), - elt->name); - if (inform_indent == 0) - inform_user(" (%d functions appended to %s)", new_functions, outPath); - else - inform_user(" (end nested class)"); - inform_user("\n"); - - elt->kind = DONE_CLASS_KIND; -} - - - -static void print_function(syntaxelem_t *elt) -{ - syntaxelem_t *e; - - if (find_skeleton(elt)) { - log_printf("find_skeleton() returned true for this elt:\n"); - print_se(elt); - return; - } - - new_functions++; - if (!fileOpened) { - fileOpened = 1; - - if (using_stdio) { - fileExisted = 0; - } else { - /* test for existence */ - outfile = fopen(outPath, "r"); - if (outfile != NULL) { - fileExisted = 1; - fclose(outfile); - } - - /* do the fopen */ - log_printf("writing to %s\n", outPath); - outfile = fopen(outPath, "a"); - if (outfile == NULL) { - /* open failed */ - fatal(1, "%s: cannot open %s\n", progname, outPath); - } - } - - if (!fileExisted) file_hdr(); - } - - inform_user("%*s%s\n", inform_indent, "", elt->name); - function_hdr(elt); - for (e = elt->parent; e != NULL; e = e->parent) { - if (e->templ) { - fprintf(outfile, "%s\n", e->templ); - break; - } - } - - { /* scope for local vars */ - char *arg_str; - - fprintf(outfile, "%s%s%s::%s(", - elt->ret_type, (strcmp(elt->ret_type, "") ? "\n" : ""), - elt->parent->name, elt->name); - - arg_str = args_to_string( - elt->args, - opt_a ? strlen(elt->parent->name) + strlen(elt->name) + 3 : 0); - - fprintf(outfile, "%s)", arg_str); - free(arg_str); - - if (elt->throw_decl) - fprintf(outfile, " %s", elt->throw_decl); - - if (elt->const_flag) - fprintf(outfile, " const"); - - fprintf(outfile, "\n{\n"); - } - - debug_printf(elt); - fprintf(outfile, "}\n\n\n"); -} - -static void function_hdr(syntaxelem_t *elt) -{ - if (opt_n) - return; - - fprintf(outfile, "/%s\n", (opt_b ? lots_of_stars : "*")); - fprintf(outfile, " * Method: %s::%s%s\n", elt->parent->name, elt->name, - (opt_s ? "()" : "")); - - if (opt_s) { - fprintf(outfile, " * Descr: \n"); - - } else { - char *arg_str = args_to_string(elt->args, 0); - fprintf(outfile, " * Params: %s\n", arg_str); - if (strcmp(elt->ret_type, "")) - fprintf(outfile, " * Returns: %s\n", elt->ret_type); - fprintf(outfile, " * Effects: \n"); - free(arg_str); - } - - fprintf(outfile, " %s/\n", (opt_b ? lots_of_stars : "*")); -} - -#ifdef WIN32 -static BOOL win32_fullname(const char *login, char *dest) -{ - WCHAR wszLogin[256]; /* Unicode user name */ - struct _USER_INFO_10 *ui; /* User structure */ - - /* Convert ASCII user name to Unicode. */ - MultiByteToWideChar(CP_ACP, 0, login, - strlen(login)+1, wszLogin, sizeof(wszLogin)); - - /* Look up the user on the DC. This function only works for - * Windows NT, and not Windows 95. */ - if (NetUserGetInfo(NULL, (LPWSTR) &wszLogin, 10, (LPBYTE *) &ui)) - return FALSE; - - /* Convert the Unicode full name to ASCII. */ - WideCharToMultiByte(CP_ACP, 0, ui->usri10_full_name, - -1, dest, 256, NULL, NULL); - - return TRUE; -} -#endif /* WIN32 */ - -static char *sg_getlogin() -{ - static char *login; -#ifdef WIN32 - static char login_buffer[256]; - DWORD size; -#endif /* WIN32 */ - static int sg_getlogin_called = 0; - - if (sg_getlogin_called) - return login; - else - sg_getlogin_called = 1; - -#ifdef WIN32 - if ((login = getenv("USERNAME")) == NULL) { - if ((login = getenv("USER")) == NULL) { - size = 255; - login = login_buffer; - if (GetUserName(login_buffer, &size) == FALSE) - login = "nobody"; - } - } -#else /* !WIN32 */ - if ((login = getenv("USER")) == NULL) - if ((login = getlogin()) == NULL) - login = "nobody"; -#endif /* WIN32 */ - - return login; -} - -static char *sg_getfullname(const char *login) -{ - char *fullname; - static char fullname_buffer[256]; -#ifndef WIN32 - char *comma; - struct passwd *pw; -#endif /* WIN32 */ - -#ifdef WIN32 - fullname = fullname_buffer; - - if (win32_fullname(login, fullname_buffer) == FALSE) - fullname = "nobody"; -#else /* !WIN32 */ - if ((fullname = getenv("NAME")) == NULL) { - setpwent(); - pw = getpwnam(login); - if (pw == NULL) { - fullname = "nobody"; - } else { - strncpy(fullname_buffer, pw->pw_gecos, 256); - comma = strchr(fullname_buffer, ','); - if (comma) *comma = '\0'; - fullname = fullname_buffer; - } - endpwent(); - } -#endif /* WIN32 */ - - return fullname; -} - - -static void file_hdr() { - char domain[256], *tmp; - time_t now = time(0); - char *today = ctime(&now); - char *login = sg_getlogin(); - char *fullname = sg_getfullname(login); - - log_printf("login: %s, full name: %s\n", login, fullname); - - domain[0] = '\0'; - if ((tmp = getenv("STUBGEN_DOM")) != NULL) - sprintf(domain, "@%s", tmp); - - if (opt_r) { - fprintf(outfile, "/*\n * FILE: %s\n * AUTH: %s <%s%s>\n", outPath, fullname, login, domain); - /* no '\n' needed with ctime() */ - fprintf(outfile, " *\n * DESC: \n *\n * DATE: %s * %sId$ \n *\n", today, "$"); - fprintf(outfile, " * %sLog$\n", "$"); - fprintf(outfile, " *\n */\n"); - - } else { - fprintf(outfile, "/%s\n", lots_of_stars); - fprintf(outfile, " * AUTHOR: %s <%s%s>\n", fullname, login, domain); - fprintf(outfile, " * FILE: %s\n", outPath); - fprintf(outfile, " * DATE: %s", today); /* no '\n' needed with ctime() */ - fprintf(outfile, " * DESCR: \n"); - fprintf(outfile, " %s/\n", lots_of_stars); - } - - if (!opt_i && !using_stdio) - fprintf(outfile, "#include \"%s\"\n", inPath); - if (opt_c) - fprintf(outfile, "#include \n"); - else if (opt_d) - fprintf(outfile, "#include \n"); - - fprintf(outfile, "\n"); -} - - -static void debug_printf(syntaxelem_t *elt) -{ - /* - * Make a dummy return value if this function is not a - * procedure (returning void) or a ctor (returning ""). - * Don't bother for references because they require an lvalue. - */ - int dummy_ret_val = (opt_g && - strcmp(elt->ret_type, "") != 0 && - strcmp(elt->ret_type, "void") != 0 && - strchr(elt->ret_type, '&') == 0); - /* - * If it's not a pointer type, create a temporary on the stack. - * They'll get warnings "dummy has not yet been assigned a value" - * from the compiler, but that's the best we can do. - * If it's a pointer type, return NULL (we assume it's defined). - */ - if (dummy_ret_val != 0 && strchr(elt->ret_type, '*') == NULL) - fprintf(outfile, " %s dummy;\n\n", elt->ret_type); - - if (opt_c) - fprintf(outfile, " cerr << \"%s::%s()\" << endl;\n", - elt->parent->name, elt->name); - else if (opt_d) - fprintf(outfile, " dprintf((\"%s::%s()\\n\"));\n", - elt->parent->name, elt->name); - - if (dummy_ret_val != 0) - fprintf(outfile, " return %s;\n", - (strchr(elt->ret_type, '*') == NULL) ? "dummy" : "NULL"); -} - -extern char linebuf[]; -extern int lineno; -extern int column; -extern int tokens_seen; -extern int yyparse(); - -static void scan_existing_skeleton() -{ - extern FILE *yyin; - FILE *existing; - - log_printf("checking for existence of %s ...\n", outPath); - if ((existing = fopen(outPath, "r")) == NULL) - return; - - log_printf("%s exists, scanning skeleton...\n", outPath); - inform_user("scanning %s ...\n", outPath); - - lineno = 1; - column = 0; - tokens_seen = 0; - - yyin = existing; - currentFile = outPath; - linebuf[0] = '\0'; - yyparse(); - log_printf("finished yyparse()\n"); - currentFile = ""; - - fclose(existing); - log_printf("done scanning skeleton...\n"); -} - -__declspec(dllexport) syntaxelem_t * scan(char *infile) -{ - extern FILE *yyin; - - syntaxelem_t *elem; - syntaxelem_t *first; - - fileOpened = 0; - lineno = 1; - column = 0; - tokens_seen = 0; - - /* normal interaction on yyin and outfile from now on */ - inform_user("parsing %s ...\n", inPath); - log_printf("parsing %s ...\n", inPath); - yyin = fopen(infile, "r"); - if (yyin == NULL) { - /* open failed */ - fatal(1, "%s: cannot open %s\n", progname, infile); - }; - currentFile = inPath; - linebuf[0] = '\0'; - yyparse(); - log_printf("finished yyparse()\n"); - currentFile = ""; - log_printf("expanding classes...\n"); - // Link all tokens - if (!class_queue_empty()) - { - first = dequeue_class(); - elem = first; - while(!class_queue_empty()) { - elem->next = dequeue_class(); - elem = elem->next; - }; - return first; - } -// while (!class_queue_empty()) { -// syntaxelem_t *elt = dequeue_class(); -// generate_skel(elt); -// } - - log_printf("closing %s\n", outPath); - free(outPath); - outPath = NULL; -// if (fileOpened) { -// fflush(outfile); -// fclose(outfile); -// outfile = NULL; -// } - fclose(yyin); - log_printf("done with %s\n", inPath); -} - -__declspec(dllexport) void scan_and_generate(FILE *infile) -{ - extern FILE *yyin; - - fileOpened = 0; - lineno = 1; - column = 0; - tokens_seen = 0; - - /* normal interaction on yyin and outfile from now on */ - inform_user("parsing %s ...\n", inPath); - log_printf("parsing %s ...\n", inPath); - yyin = infile; - currentFile = inPath; - linebuf[0] = '\0'; - yyparse(); - log_printf("finished yyparse()\n"); - currentFile = ""; - log_printf("expanding classes...\n"); - while (!class_queue_empty()) { - syntaxelem_t *elt = dequeue_class(); - generate_skel(elt); - } - - log_printf("closing %s\n", outPath); - free(outPath); - outPath = NULL; - if (fileOpened) { - fflush(outfile); - fclose(outfile); - outfile = NULL; - } - log_printf("done with %s\n", inPath); -} - -/* - * return a value representing numeric part of the RCS Revision string - * where value == (major * 1000) + minor. - */ -int revision() -{ - static char rcsrev[] = "$Revision: 1.3 $"; - static int value = -1; - char *major_str, *dot; - - if (value != -1) - return value; - - rcsrev[strlen(rcsrev)-2] = '\0'; - - major_str = &rcsrev[11]; - dot = strchr(major_str, '.'); - *dot++ = '\0'; /* tie off major_str and move to minor */ - - value = (atoi(major_str) * 1000) + atoi(dot); - - return value; -} - -#ifndef _MAX_PATH -#define _MAX_PATH 256 -#endif /* !def _MAX_PATH */ - -//int main(int argc, char **argv) -//{ -// extern int optind; -// extern char *optarg; -// int c, err_flag = 0; -// char *ext; -// -//#ifdef SGDEBUG -// char logfilename_buffer[_MAX_PATH]; -//#ifdef WIN32 -// DWORD tmpPathLen; -//#endif /* WIN32 */ -//#endif /* SGDEBUG */ -// -//#ifdef SGDEBUG -//#ifdef WIN32 -// tmpPathLen = GetTempPath(_MAX_PATH, logfilename_buffer); -// if (logfilename_buffer[tmpPathLen - 1] != '\\') -// strcat(logfilename_buffer, "\\"); -//#else /* !WIN32 */ -// strcpy(logfilename_buffer, "/tmp/"); -//#endif /* WIN32 */ -// -// strcat(logfilename_buffer, sg_getlogin()); -// strcat(logfilename_buffer, "-"); -// strcat(logfilename_buffer, logfilename); -// -// if (!log_open(logfilename_buffer)) { -// /* open failed */ -// fatal(1, "%s: cannot write to %s\n", progname, logfilename_buffer); -// } -//#endif /* SGDEBUG */ -// -// while ((c = getopt(argc, argv, OPTS)) != EOF) { -// switch (c) { -// case 'h': -// opt_h = 1; break; -// case 'q': -// opt_q = 1; break; -// case 'v': -// opt_v = 1; break; -// case 'g': -// opt_g = 1; break; -// case 'a': -// opt_a = 1; break; -// case 'e': -// opt_e = optarg; -// if (opt_e[0] == '.') -// opt_e++; -// break; -// case 'r': -// opt_r = 1; break; -// case 'i': -// opt_i = 1; break; -// case 'c': -// if (opt_d) err_flag = 1; -// opt_c = 1; break; -// case 'd': -// if (opt_c) err_flag = 1; -// opt_d = 1; break; -// case 'b': -// if (opt_f || opt_s || opt_n) err_flag = 1; -// opt_b = 1; break; -// case 'f': -// if (opt_b || opt_s || opt_n) err_flag = 1; -// opt_f = 1; break; -// case 's': -// if (opt_f || opt_b || opt_n) err_flag = 1; -// opt_s = 1; break; -// case 'n': -// if (opt_f || opt_s || opt_b) err_flag = 1; -// opt_n = 1; break; -// default: -// err_flag = 1; -// } -// } -// -// if (opt_h || opt_v || err_flag) { -// inform_user("%s version %s (build %d).\n", -// progname, progver, revision()); -// if (opt_h || err_flag) -// fatal(err_flag, usage, progname); -// else -// fatal(0, "%s\n%s", copyright, version_info); -// } -// -// if (!(opt_b || opt_f || opt_s || opt_n)) -// opt_b = 1; -// -// /* done setting options */ -// if (argc == optind) { -// /* read from stdin and stdout */ -// outfile = stdout; -// fprintf(outfile, "/* %s: reading from stdin */\n", progname); -// using_stdio = 1; -// inPath = "stdin"; -// outPath = strdup("stdout"); -// -// opt_q = 1; /* force quiet mode */ -// log_printf("initting...\n"); -// init_tables(); -// scan_and_generate(stdin); -// log_printf("freeing memory...\n"); -// free_tables(); -// -// } else { -// inform_user("%s version %s (build %d).\n", -// progname, progver, revision()); -// -// /* each bloody file from the command line */ -// while (optind < argc) { -// FILE *infile; -// log_printf("working on %s\n", argv[optind]); -// /* open for read */ -// infile = fopen(argv[optind], "r"); -// if (infile == NULL) { -// /* open failed */ -// fatal(1, "%s: cannot open %s\n", progname, argv[optind]); -// } -// -// inPath = basename(argv[optind]); -// outPath = (char *)malloc(strlen(inPath) + strlen(opt_e) + 2); -// strcpy(outPath, inPath); -// -// /* tie off .h, .hh, .hpp, or .hxx extension */ -// if (((ext = strrchr(outPath, '.')) != NULL) && -// (((strlen(ext) == 2) && -// ((ext[1] == 'H') || (ext[1] == 'h'))) || -// (((strlen(ext) == 3) && -// ((ext[1] == 'H') || (ext[1] == 'h')) && -// ((ext[2] == 'H') || (ext[2] == 'h')))) || -// ((strlen(ext) == 4) && -// ((ext[1] == 'H') || (ext[1] == 'h')) && -// ((((ext[2] == 'P') || (ext[2] == 'p')) && -// ((ext[3] == 'P') || (ext[3] == 'p'))) || -// (((ext[2] == 'X') || (ext[2] == 'x')) && -// ((ext[3] == 'X') || (ext[3] == 'x'))))))) -// *ext = '\0'; -// -// assert(opt_e[0] != '.'); -// strcat(outPath, "."); -// strcat(outPath, opt_e); -// -// log_printf("initting...\n"); -// init_tables(); -// scan_existing_skeleton(); -// scan_and_generate(infile); -// log_printf("freeing memory...\n"); -// free_tables(); -// clear_skeleton_queue(); -// fclose(infile); -// optind++; -// } -// } -// -//#ifdef SGDEBUG -// log_flush(); -// log_close(); -//#endif /* SGDEBUG */ -// -// return 0; -//} diff --git a/bepascal/bepascal/stubgen.so/parser.y b/bepascal/bepascal/stubgen.so/parser.y deleted file mode 100644 index bb02b18..0000000 --- a/bepascal/bepascal/stubgen.so/parser.y +++ /dev/null @@ -1,1784 +0,0 @@ -%{ -/* - * FILE: parser.y - * AUTH: Michael John Radwin - * - * DESC: stubgen grammar description. Portions borrowed from - * Newcastle University's Arjuna project (http://arjuna.ncl.ac.uk/), - * and Jeff Lee's ANSI Grammar - * (ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z) - * This grammar is only a subset of the real C++ language. - * - * DATE: Thu Aug 15 13:10:06 EDT 1996 - * $Id: parser.y,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * -------------------------------------------------------------------- - * - * $Log: not supported by cvs2svn $ - * Revision 1.1 2001/11/07 10:06:07 ithamar - * Added stubgen to CVS - * - * Revision 1.72 1998/07/07 00:14:06 mradwin - * removed extra space from throw_decl, cleaned up memory leak - * in ctor skeleton - * - * Revision 1.71 1998/06/11 14:52:09 mradwin - * allow for empty class declarations, such as - * class Element {}; - * also, differentiate structs from classes with - * new STRUCT_KIND tag. - * New version: 2.04 - * - * Revision 1.70 1998/05/11 19:49:11 mradwin - * Version 2.03 (updated copyright information). - * - * Revision 1.69 1998/04/07 23:43:34 mradwin - * changed error-handling code significantly. - * several functions now return a value, and instead of - * calling fatal(), we do a YYABORT or YYERROR to get out - * of the parsing state. - * New version: 2.02. - * - * Revision 1.68 1998/03/28 02:59:41 mradwin - * working on slightly better error recovery; not done yet. - * - * Revision 1.67 1998/03/28 02:34:56 mradwin - * added multi-line function parameters - * also changed pointer and reference (* and &) types so there - * is no trailing space before the parameter name. - * - * Revision 1.66 1998/01/12 19:39:11 mradwin - * modified rcsid - * - * Revision 1.65 1997/11/13 22:50:55 mradwin - * moved copyright from parser.y to main.c - * - * Revision 1.64 1997/11/13 22:40:15 mradwin - * fixed a silly comment bug - * - * Revision 1.63 1997/11/13 22:37:31 mradwin - * changed char[] to char * to make non-gcc compilers - * a little happier. We need to #define const to nothing - * for other compilers as well. - * - * Revision 1.62 97/11/13 21:29:30 21:29:30 mradwin (Michael Radwin) - * moved code from parser.y to main.c - * - * Revision 1.61 1997/11/13 21:10:17 mradwin - * renamed stubgen.[ly] to parser.y lexer.l - * - * Revision 1.60 1997/11/11 04:11:29 mradwin - * fixed command-line flags: invalid options now force usgage. - * - * Revision 1.59 1997/11/11 04:03:56 mradwin - * changed version info - * - * Revision 1.58 1997/11/11 03:54:05 mradwin - * fixed a long-standing bug with -b option. a typo was causing - * the -b flag to be ignored. - * - * Revision 1.57 1997/11/11 03:52:06 mradwin - * changed fatal() - * - * Revision 1.56 1997/11/05 03:02:02 mradwin - * Modified logging routines. - * - * Revision 1.55 1997/11/05 02:14:38 mradwin - * Made some compiler warnings disappear. - * - * Revision 1.54 1997/11/01 23:26:13 mradwin - * new Revision string and usage info - * - * Revision 1.53 1997/11/01 23:12:43 mradwin - * greatly improved error-recovery. errors no longer spill over - * into other files because the yyerror state is properly reset. - * - * Revision 1.52 1997/10/27 01:14:23 mradwin - * fixed constant_value so it supports simple arithmetic. it's - * not as robust as full expressions, but this will handle the - * char buffer[BUFSIZE + 1] problem. - * - * Also removed expansion rules that simply did { $$ = $1; } because - * that action is implicit anyway. - * - * Revision 1.51 1997/10/26 23:16:32 mradwin - * changed inform_user and fatal functions to use varargs - * - * Revision 1.50 1997/10/26 22:27:07 mradwin - * Fixed this bug: - * stubgen dies on the following because the protected section is empty: - * - * class WidgetCsg : public WidgetLens { - * protected: - * - * public: - * virtual ~WidgetCsg() {} - * WidgetCsg(); - * }; - * - * Error: - * stubgen version 2.0-beta $Revision: 1.1 $. - * parse error at line 4, file test.H: - * public: - * ^ - * - * Revision 1.49 1997/10/16 19:42:48 mradwin - * added support for elipses, static member/array initializers, - * and bitfields. - * - * Revision 1.48 1997/10/16 17:35:39 mradwin - * cleaned up usage info - * - * Revision 1.47 1997/10/16 17:12:59 mradwin - * handle extern "C" blocks better now, and support multi-line - * macros. still need error-checking. - * - * Revision 1.46 1997/10/15 22:09:06 mradwin - * changed tons of names. stubelem -> sytaxelem, - * stubin -> infile, stubout -> outfile, stublog -> logfile. - * - * Revision 1.45 1997/10/15 21:33:36 mradwin - * fixed up function_hdr - * - * Revision 1.44 1997/10/15 21:33:02 mradwin - * *** empty log message *** - * - * Revision 1.43 1997/10/15 17:42:37 mradwin - * added support for 'extern "C" { ... }' blocks. - * - * Revision 1.42 1997/09/26 20:59:18 mradwin - * now allow "struct foobar *f" to appear in a parameter - * list or as a variable decl. Had to remove the - * class_or_struct rule and blow up the class_specifier - * description. - * - * Revision 1.41 1997/09/26 19:02:18 mradwin - * fixed memory leak involving template decls in skeleton code. - * Leads me to believe that skel_elemcmp() is flawed, because - * it may rely in parent->templ info. - * - * Revision 1.40 1997/09/26 18:44:22 mradwin - * changed parameter handing from char *'s to an argument type - * to facilitate comparisons between skeleton code - * and header code. Now we can correctly recognize different - * parameter names while still maintaining the same signature. - * - * Revision 1.39 1997/09/26 00:47:29 mradwin - * added better base type support -- recognize things like - * "long long" and "short int" now. - * - * Revision 1.38 1997/09/19 18:16:37 mradwin - * allowed an instance name to come after a class, struct, - * union, or enum. This improves parseability of typedefs - * commonly found in c header files, although true typedefs are - * not understood. - * - * Revision 1.37 1997/09/15 22:38:28 mradwin - * did more revision on the SGDEBUG stuff - * - * Revision 1.36 1997/09/15 19:05:26 mradwin - * allow logging to be compiled out by turning off SGDEBUG - * - * Revision 1.35 1997/09/12 00:58:43 mradwin - * duh, silly me. messed up compilation. - * - * Revision 1.34 1997/09/12 00:57:49 mradwin - * Revision string inserted in usage - * - * Revision 1.33 1997/09/12 00:51:19 mradwin - * string copyright added to code for binary copyright. - * - * Revision 1.32 1997/09/12 00:47:21 mradwin - * some more compactness of grammar with parameter_list_opt - * and also ampersand_opt - * - * Revision 1.31 1997/09/12 00:26:19 mradwin - * better template support, but still poor - * - * Revision 1.30 1997/09/08 23:24:51 mradwin - * changes to error-handling code. - * also got rid of the %type for the top-level rules - * - * Revision 1.30 1997/09/08 23:20:02 mradwin - * some error reporting changes and default values for top-level - * grammar stuff. - * - * Revision 1.29 1997/09/08 17:54:24 mradwin - * cleaned up options and usage info. - * - * Revision 1.28 1997/09/05 19:38:04 mradwin - * changed options for .ext instead of -l or -x - * - * Revision 1.27 1997/09/05 19:17:06 mradwin - * works for scanning old versions, except for parameter - * names that differ between .H and .C files. - * - * Revision 1.26 1997/09/05 16:34:36 mradwin - * GPL-ized code. - * - * Revision 1.25 1997/09/05 16:11:44 mradwin - * some simple cleanup before GPL-izing the code - * - * Revision 1.24 1997/09/04 19:50:34 mradwin - * whoo-hoo! by blowing up the description - * exponentially, it works! - * - * Revision 1.23 1997/03/20 16:05:41 mjr - * renamed syntaxelem to syntaxelem_t, cleaned up throw_decl - * - * Revision 1.22 1996/10/02 15:16:57 mjr - * using pathname.h instead of libgen.h - * - * Revision 1.21 1996/09/12 14:44:49 mjr - * Added throw decl recognition (great, another 4 bytes in syntaxelem) - * and cleaned up the grammar so that const_opt appears in far fewer - * places. const_opt is by default 0 as well, so we don't need to - * pass it as an arg to new_elem(). - * - * I also added a fix to a potential bug with the MINIT and INLIN - * exclusive start states. I think they could have been confused - * by braces within comments, so now I'm grabbing comments in those - * states as well. - * - * Revision 1.20 1996/09/12 04:55:22 mjr - * changed expand strategy. Don't expand while parsing now; - * enqueue as we go along and expand at the end. Eventually - * we'll need to provide similar behavior for when we parse - * .C files - * - * Revision 1.19 1996/09/12 03:46:10 mjr - * No concrete changes in code. Just added some sanity by - * factoring out code into util.[ch] and putting some prototypes - * that were in table.h into stubgen.y where they belong. - * - * Revision 1.18 1996/09/06 14:32:48 mjr - * defined the some_KIND constants for clarity, and made - * expandClass return immediately if it was give something other - * than a CLASS_KIND element. - * - * Revision 1.17 1996/09/06 14:05:44 mjr - * Almost there with expanded operator goodies. Still need - * to get OPERATOR type_name to work. - * - * Revision 1.16 1996/09/04 22:28:09 mjr - * nested classes work and default arguments are now removed - * from the parameter lists. - * - * Revision 1.15 1996/09/04 20:01:57 mjr - * non-functional expanded code. needs work. - * - * Revision 1.14 1996/09/01 21:29:34 mjr - * put the expanded_operator code back in as a useless rule. - * oughta think about fixing it up if possible - * - * Revision 1.13 1996/09/01 20:59:48 mjr - * Added collectMemberInitList() function, which is similar - * to collectInlineDef() and also the exclusive state MINIT - * - * Revision 1.12 1996/08/23 05:09:19 mjr - * fixed up some more portability things - * - * Revision 1.11 1996/08/22 02:43:47 mjr - * added parse error message (using O'Reilly p. 274) - * - * Revision 1.10 1996/08/21 18:33:50 mjr - * added support for template instantiation in the type_name - * rule. surprisingly it didn't cause any shift/reduce conflicts. - * - * Revision 1.9 1996/08/21 17:40:56 mjr - * added some cpp directives for porting to WIN32 - * - * Revision 1.8 1996/08/21 00:00:19 mjr - * approaching stability and usability. command line arguments - * are handled now and the fopens and fcloses appear to work. - * - * Revision 1.7 1996/08/20 20:44:23 mjr - * added initial support for optind but it is incomplete. - * - * Revision 1.6 1996/08/19 17:14:59 mjr - * misordered args, fixed bug - * - * Revision 1.5 1996/08/19 17:11:41 mjr - * RCS got confused with the RCS-style header goodies. - * got it cleaned up now. - * - * Revision 1.4 1996/08/19 17:01:33 mjr - * Removed the expanded code checking and added - * lots of code that duplicates what stubgen.pl did. - * still need options pretty badly - * - * Revision 1.3 1996/08/17 23:21:10 mjr - * added the expanded operator code, cleaned up tabs. - * consider putting all of the expanded code in another - * grammar - this one is getting cluttered. - * - */ -%} - -%{ -#include "table.h" -#include "util.h" -#include -#include -#include - -#ifdef WIN32 -#include /* defintion of alloca */ -#include "getopt.h" /* use GNU getopt */ -#endif /* WIN32 */ - -#ifndef WIN32 -#include -#endif /* WIN32 */ - -/* defined in lexer.l */ -extern int collectInlineDef(); -extern int collectMemberInitList(); - -/* defined here in parser.y */ -static int error_recovery(); -static int yyerror(char *); -static const char rcsid[] = "$Id: parser.y,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $"; - -/* defined in main.c */ -extern FILE *outfile; -extern char *currentFile; -extern int lineno; - -%} - -%union { - char *string; - syntaxelem_t *elt; - arg_t *arg; - int flag; -} - -%token IDENTIFIER CONSTANT STRING_LITERAL -%token CHAR SHORT INT LONG SIGNED UNSIGNED FLOAT DOUBLE VOID -%token NEW DELETE TEMPLATE THROW - -%token PTR_OP INC_OP DEC_OP LEFT_OP RIGHT_OP LE_OP GE_OP EQ_OP NE_OP -%token AND_OP OR_OP MUL_ASSIGN DIV_ASSIGN MOD_ASSIGN ADD_ASSIGN -%token SUB_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN -%token XOR_ASSIGN OR_ASSIGN CLCL MEM_PTR_OP - -%token FRIEND OPERATOR CONST CLASS STRUCT UNION ENUM -%token PROTECTED PRIVATE PUBLIC EXTERN ELIPSIS - -%type simple_type_name simple_signed_type non_reference_type -%type scoped_identifier pointer asterisk -%type type_name binary_operator -%type assignment_operator unary_operator any_operator -%type variable_specifier_list union_specifier -%type constant_value multiple_variable_specifier -%type enum_specifier enumerator_list enumerator -%type template_specifier template_arg template_arg_list -%type template_instance_arg template_instance_arg_list -%type throw_decl throw_list variable_name bitfield_savvy_identifier -%type primary_expression expression -%type multiplicative_expression additive_expression -%type const_opt ampersand_opt -%type class_specifier -%type member_func_specifier function_specifier constructor -%type destructor member_specifier member member_with_access -%type mem_type_specifier member_or_error -%type member_list member_list_opt -%type member_func_inlined type_specifier overloaded_op_specifier -%type member_func_skel member_func_skel_spec -%type constructor_skeleton destructor_skeleton -%type overloaded_op_skeleton function_skeleton -%type variable_or_parameter variable_specifier -%type parameter_list parameter_list_opt unnamed_parameter - - -%start translation_unit -%% - -translation_unit - : declaration - | translation_unit declaration - ; - -declaration - : declaration_specifiers ';' - | EXTERN STRING_LITERAL compound_statement -{ - log_printf("IGNORING extern \"C\" { ... } block.\n"); - free($2); -} - | member_func_inlined -{ - $1->kind = INLINED_KIND; - log_printf("\nBEGIN matched dec : m_f_i rule --"); - print_se($1); - log_printf("END matched dec : m_f_i rule\n"); -} - | function_skeleton -{ - $1->kind = SKEL_KIND; - log_printf("\nBEGIN matched dec : function_skeleton rule --"); - print_se($1); - enqueue_skeleton($1); - log_printf("END matched dec : function_skeleton rule\n"); -} - | ';' - | error -{ - log_printf("declaration : error. Attempting to recover...\n"); - yyerrok; - yyclearin; - if (error_recovery() != 0) { - log_printf("ERROR recovery could not complete -- YYABORT.\n"); - YYABORT; - } - log_printf("ERROR recovery complete.\n"); -} - ; - -declaration_specifiers - : member_specifier -{ - /* the name of the rule "member_specifier" might be misleading, but - * this is either a class, struct, union, enum, global var, global - * prototype, etc.. */ - if ($1->kind == CLASS_KIND || $1->kind == STRUCT_KIND) { - enqueue_class($1); - } else { - log_printf("\nIGNORING dec_spec : mem_spec (%s) --", - string_kind($1->kind)); - print_se($1); - log_printf("END IGNORING dec_spec : mem_spec (%s)\n", - string_kind($1->kind)); - } -} - | forward_decl - ; - -type_specifier - : union_specifier -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), $1, NULL, IGNORE_KIND); -/* print_se(elem); */ - $$ = elem; -} - | enum_specifier -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), $1, NULL, IGNORE_KIND); -/* print_se(elem); */ - $$ = elem; -} - | class_specifier - ; - -ampersand_opt - : /* nothing */ { $$ = 0; } - | '&' { $$ = 1; } - ; - -type_name - : non_reference_type ampersand_opt -{ - char *tmp_str = (char *) malloc(strlen($1) + ($2 ? 2 : 0) + 1); - strcpy(tmp_str, $1); - if ($2) - strcat(tmp_str, " &"); - free($1); - $$ = tmp_str; -} - | CONST non_reference_type ampersand_opt -{ - char *tmp_str = (char *) malloc(strlen($2) + ($3 ? 2 : 0) + 7); - sprintf(tmp_str, "const %s%s", $2, ($3 ? " &" : "")); - free($2); - $$ = tmp_str; -} - ; - -forward_decl - : CLASS IDENTIFIER { free($2); } - | CLASS scoped_identifier { free($2); } - | STRUCT IDENTIFIER { free($2); } - | STRUCT scoped_identifier { free($2); } - ; - -non_reference_type - : scoped_identifier - | IDENTIFIER - | STRUCT IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($2) + 8); - strcpy(tmp_str, "struct "); - strcat(tmp_str, $2); - free($2); - $$ = tmp_str; -} - | scoped_identifier '<' template_instance_arg_list '>' -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s<%s>", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | IDENTIFIER '<' template_instance_arg_list '>' -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s<%s>", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | scoped_identifier '<' template_instance_arg_list '>' pointer -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + strlen($5) + 4); - sprintf(tmp_str, "%s<%s> %s", $1, $3, $5); - free($1); - free($3); - free($5); - $$ = tmp_str; -} - | IDENTIFIER '<' template_instance_arg_list '>' pointer -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + strlen($5) + 4); - sprintf(tmp_str, "%s<%s> %s", $1, $3, $5); - free($1); - free($3); - free($5); - $$ = tmp_str; -} - | scoped_identifier pointer -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 2); - sprintf(tmp_str, "%s %s", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - | IDENTIFIER pointer -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 2); - sprintf(tmp_str, "%s %s", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - | STRUCT IDENTIFIER pointer -{ - char *tmp_str = (char *) malloc(strlen($2) + strlen($3) + 9); - sprintf(tmp_str, "struct %s %s", $2, $3); - free($2); - free($3); - $$ = tmp_str; -} - | simple_signed_type - | simple_signed_type pointer -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 2); - sprintf(tmp_str, "%s %s", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - ; - -simple_signed_type - : simple_type_name - | SIGNED simple_type_name -{ - char *tmp_str = (char *) malloc(strlen($2) + 8); - strcpy(tmp_str,"signed "); - strcat(tmp_str, $2); - free($1); - free($2); - $$ = tmp_str; -} - | UNSIGNED simple_type_name -{ - char *tmp_str = (char *) malloc(strlen($2) + 10); - strcpy(tmp_str,"unsigned "); - strcat(tmp_str, $2); - free($1); - free($2); - $$ = tmp_str; -} - ; - -simple_type_name - : CHAR - | SHORT - | SHORT INT -{ - $$ = strdup("short int"); - free($1); - free($2); -} - | INT - | LONG - | LONG INT -{ - $$ = strdup("long int"); - free($1); - free($2); -} - | LONG LONG -{ - $$ = strdup("long long"); - free($1); - free($2); -} - | LONG LONG INT -{ - $$ = strdup("long long int"); - free($1); - free($2); - free($3); -} - | UNSIGNED - | FLOAT - | DOUBLE - | VOID - ; - -scoped_identifier - : IDENTIFIER CLCL IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s::%s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | scoped_identifier CLCL IDENTIFIER -{ - /* control-Y programming! */ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s::%s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -pointer - : asterisk - | pointer asterisk -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 1); - strcpy(tmp_str,$1); - strcat(tmp_str,$2); - free($1); - free($2); - $$ = tmp_str; -} - ; - -asterisk - : '*' { $$ = strdup("*"); } - | '*' CONST { $$ = strdup("*const "); } - ; - -variable_or_parameter - : type_name bitfield_savvy_identifier -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = $1; - new_arg->name = $2; - new_arg->array = NULL; - new_arg->next = NULL; - $$ = new_arg; -} - | type_name scoped_identifier -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = $1; - new_arg->name = $2; - new_arg->array = NULL; - new_arg->next = NULL; - $$ = new_arg; -} - | variable_or_parameter '[' constant_value ']' -{ - char *old_array = $1->array; - int old_len = old_array ? strlen(old_array) : 0; - $1->array = (char *) malloc(strlen($3) + old_len + 3); - sprintf($1->array, "%s[%s]", old_array ? old_array : "", $3); - free($3); - if (old_array) - free(old_array); - $$ = $1; -} - | variable_or_parameter '[' ']' -{ - char *old_array = $1->array; - int old_len = old_array ? strlen(old_array) : 0; - $1->array = (char *) malloc(old_len + 3); - sprintf($1->array, "%s[]", old_array ? old_array : ""); - if (old_array) - free(old_array); - $$ = $1; -} - ; - -bitfield_savvy_identifier - : IDENTIFIER - | IDENTIFIER ':' CONSTANT { free($3); $$ = $1;} - ; - -variable_name - : bitfield_savvy_identifier - | pointer IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 2); - sprintf(tmp_str, "%s %s", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - | variable_name '[' constant_value ']' -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s[%s]", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | variable_name '[' ']' -{ - char *tmp_str = (char *) malloc(strlen($1) + 3); - strcpy(tmp_str, $1); - strcat(tmp_str, "[]"); - free($1); - $$ = tmp_str; -} - ; - -variable_specifier - : variable_or_parameter - | EXTERN variable_or_parameter { $$ = $2; } - | variable_or_parameter '=' constant_value -{ - free($3); - $$ = $1; -} - ; - -multiple_variable_specifier - : variable_specifier -{ - $$ = args_to_string($1, 0); - free_args($1); -} - | multiple_variable_specifier ',' variable_name -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s, %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -variable_specifier_list - : multiple_variable_specifier ';' -{ - char *tmp_str = (char *) malloc(strlen($1) + 2); - sprintf(tmp_str, "%s;", $1); - free($1); - $$ = tmp_str; -} - | variable_specifier_list multiple_variable_specifier ';' -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 3); - sprintf(tmp_str, "%s\n%s;", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - ; - -parameter_list_opt - : /* nothing */ -{ - $$ = NULL; -} - | parameter_list -{ - $$ = reverse_arg_list($1); -} - | parameter_list ',' ELIPSIS -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = strdup("..."); - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = $1; - $$ = reverse_arg_list(new_arg); -} - | ELIPSIS -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = strdup("..."); - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - $$ = new_arg; -} - ; - -parameter_list - : variable_specifier - | unnamed_parameter - | parameter_list ',' variable_specifier -{ - $3->next = $1; - $$ = $3; -} - | parameter_list ',' unnamed_parameter -{ - $3->next = $1; - $$ = $3; -} - ; - -unnamed_parameter - : type_name -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = $1; - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - $$ = new_arg; -} - | type_name '=' constant_value -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = $1; - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - free($3); - $$ = new_arg; -} - | unnamed_parameter '[' constant_value ']' -{ - char *old_array = $1->array; - int old_len = old_array ? strlen(old_array) : 0; - $1->array = (char *) malloc(strlen($3) + old_len + 3); - sprintf($1->array, "%s[%s]", old_array ? old_array : "", $3); - free($3); - if (old_array) - free(old_array); - $$ = $1; -} - | unnamed_parameter '[' ']' -{ - char *old_array = $1->array; - int old_len = old_array ? strlen(old_array) : 0; - $1->array = (char *) malloc(old_len + 3); - sprintf($1->array, "%s[]", old_array ? old_array : ""); - if (old_array) - free(old_array); - $$ = $1; -} - ; - -function_skeleton - : member_func_skel compound_statement - | constructor_skeleton ':' - { if (collectMemberInitList() != 0) YYERROR; } compound_statement - | template_specifier member_func_skel compound_statement -{ - /* I think this is the correct behavior, but skel_elemcmp is wrong */ - /* $2->templ = $1; */ - free($1); - $$ = $2; -} - | template_specifier constructor_skeleton ':' - { if (collectMemberInitList() != 0) YYERROR; } compound_statement -{ - /* I think this is the correct behavior, but skel_elemcmp is wrong */ - /* $2->templ = $1; */ - free($1); - $$ = $2; -} - ; - -member_func_inlined - : member_func_specifier compound_statement - | constructor ':' - { if (collectMemberInitList() != 0) YYERROR; } compound_statement - ; - -member_func_skel - : member_func_skel_spec const_opt throw_decl -{ - $1->const_flag = $2; - $1->throw_decl = $3; - $$ = $1; -} - | constructor_skeleton - | destructor_skeleton - ; - -member_func_specifier - : function_specifier const_opt throw_decl -{ - $1->const_flag = $2; - $1->throw_decl = $3; - $$ = $1; -} - | constructor - | destructor - ; - - -member_func_skel_spec - : type_name scoped_identifier '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, $2, $4, FUNC_KIND); -/* print_se(elem); */ - $$ = elem; -} - | type_name IDENTIFIER '<' template_instance_arg_list '>' CLCL IDENTIFIER '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, - (char *) malloc(strlen($2) + strlen($4) + strlen($7) + 5), - $9, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", $2, $4, $7); - free($2); - free($4); - free($7); - $$ = elem; -} - | overloaded_op_skeleton - ; - - - -function_specifier - : type_name IDENTIFIER '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, $2, $4, FUNC_KIND); - print_se(elem); - $$ = elem; -} - | overloaded_op_specifier - ; - -overloaded_op_skeleton - : type_name scoped_identifier CLCL OPERATOR any_operator '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, (char *)malloc(strlen($2) + strlen($5) + 12), - $7, FUNC_KIND); - sprintf(elem->name, "%s::operator%s", $2, $5); - free($2); - free($5); -/* print_se(elem); */ - $$ = elem; -} - | scoped_identifier CLCL OPERATOR type_name '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *)malloc(strlen($1) + strlen($4) + 13), - NULL, FUNC_KIND); - sprintf(elem->name, "%s::operator %s", $1, $4); - free($1); - free($4); -/* print_se(elem); */ - $$ = elem; -} - | type_name IDENTIFIER CLCL OPERATOR any_operator '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, (char *)malloc(strlen($2) + strlen($5) + 12), - $7, FUNC_KIND); - sprintf(elem->name, "%s::operator%s", $2, $5); - free($2); - free($5); -/* print_se(elem); */ - $$ = elem; -} - | IDENTIFIER CLCL OPERATOR type_name '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *)malloc(strlen($1) + strlen($4) + 13), - NULL, FUNC_KIND); - sprintf(elem->name, "%s::operator %s", $1, $4); - free($1); - free($4); -/* print_se(elem); */ - $$ = elem; -} - ; - -overloaded_op_specifier - : type_name OPERATOR any_operator '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, (char *)malloc(strlen($3) + 9), - $5, FUNC_KIND); - sprintf(elem->name, "operator%s", $3); - free($3); - print_se(elem); - $$ = elem; -} - | OPERATOR type_name '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), (char *)malloc(strlen($2) + 10), - NULL, FUNC_KIND); - sprintf(elem->name, "operator %s", $2); - free($2); - print_se(elem); - $$ = elem; -} - ; - -const_opt - : /* nothing */ { $$ = 0; } - | CONST { $$ = 1; } - ; - -throw_decl - : /* nothing */ { $$ = NULL; } - | THROW '(' throw_list ')' -{ - char *tmp_str = (char *) malloc(strlen($3) + 8); - sprintf(tmp_str, "throw(%s)", $3); - free($3); - $$ = tmp_str; -} - ; - -throw_list - : type_name - | throw_list ',' type_name -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s, %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -destructor - : '~' IDENTIFIER '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), (char *) malloc(strlen($2) + 2), - NULL, FUNC_KIND); - sprintf(elem->name,"~%s", $2); - free($2); -/* print_se(elem); */ - $$ = elem; -} - ; - -destructor_skeleton - : scoped_identifier CLCL '~' IDENTIFIER '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($4) + 4), - NULL, FUNC_KIND); - sprintf(elem->name,"%s::~%s", $1, $4); - free($1); - free($4); -/* print_se(elem); */ - $$ = elem; -} - | IDENTIFIER CLCL '~' IDENTIFIER '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($4) + 4), - NULL, FUNC_KIND); - sprintf(elem->name,"%s::~%s", $1, $4); - free($1); - free($4); -/* print_se(elem); */ - $$ = elem; -} - | IDENTIFIER '<' template_instance_arg_list '>' CLCL '~' IDENTIFIER '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($3) + strlen($7) + 6), - NULL, FUNC_KIND); - sprintf(elem->name,"%s<%s>::~%s", $1, $3, $7); - free($1); - free($3); - free($7); - $$ = elem; -} - | scoped_identifier '<' template_instance_arg_list '>' CLCL '~' IDENTIFIER '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($3) + strlen($7) + 6), - NULL, FUNC_KIND); - sprintf(elem->name,"%s<%s>::~%s", $1, $3, $7); - free($1); - free($3); - free($7); - $$ = elem; -} - ; - -constructor - : IDENTIFIER '(' parameter_list_opt ')' throw_decl -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), $1, $3, FUNC_KIND); - elem->throw_decl = $5; -/* print_se(elem); */ - $$ = elem; -} - ; - -constructor_skeleton - : scoped_identifier '(' parameter_list_opt ')' throw_decl -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), $1, $3, FUNC_KIND); - elem->throw_decl = $5; -/* print_se(elem); */ - $$ = elem; -} - | IDENTIFIER '<' template_instance_arg_list '>' CLCL IDENTIFIER '(' parameter_list_opt ')' throw_decl -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($3) + strlen($6) + 5), - $8, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", $1, $3, $6); - free($1); - free($3); - free($6); - elem->throw_decl = $10; - $$ = elem; -} - | scoped_identifier '<' template_instance_arg_list '>' CLCL IDENTIFIER '(' parameter_list_opt ')' throw_decl -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($3) + strlen($6) + 5), - $8, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", $1, $3, $6); - free($1); - free($3); - free($6); - elem->throw_decl = $10; - $$ = elem; -} - ; - -compound_statement - : '{' { if (collectInlineDef() != 0) YYERROR; } '}' - ; - -enum_specifier - : ENUM '{' enumerator_list '}' -{ - char *tmp_str = (char *) malloc(strlen($3) + 10); - sprintf(tmp_str, "enum { %s }", $3); - free($3); - $$ = tmp_str; -} - | ENUM IDENTIFIER '{' enumerator_list '}' -{ - char *tmp_str = (char *) malloc(strlen($2) + strlen($4) + 11); - sprintf(tmp_str, "enum %s { %s }", $2, $4); - free($2); - free($4); - $$ = tmp_str; -} - | ENUM IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($2) + 6); - sprintf(tmp_str, "enum %s", $2); - free($2); - $$ = tmp_str; -} - ; - -enumerator_list - : enumerator - | enumerator_list ',' enumerator -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s, %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -enumerator - : IDENTIFIER - | IDENTIFIER '=' constant_value -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 2); - sprintf(tmp_str, "%s=%s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -access_specifier_opt - : /* nothing */ - | access_specifier - ; - -access_specifier_list - : access_specifier ':' - | access_specifier_list access_specifier ':' - ; - -access_specifier - : PUBLIC - | PRIVATE - | PROTECTED - ; - -unary_operator - : '&' { $$ = strdup("&"); } - | '*' { $$ = strdup("*"); } - | '+' { $$ = strdup("+"); } - | '-' { $$ = strdup("-"); } - | '~' { $$ = strdup("~"); } - | '!' { $$ = strdup("!"); } - ; - -binary_operator - : '/' { $$ = strdup("/"); } - | '%' { $$ = strdup("%"); } - | '^' { $$ = strdup("^"); } - | '|' { $$ = strdup("|"); } - | '<' { $$ = strdup("<"); } - | '>' { $$ = strdup(">"); } - | ',' { $$ = strdup(","); } - ; - -assignment_operator - : '=' { $$ = strdup("="); } - | MUL_ASSIGN { $$ = strdup("*="); } - | DIV_ASSIGN { $$ = strdup("/="); } - | MOD_ASSIGN { $$ = strdup("%="); } - | ADD_ASSIGN { $$ = strdup("+="); } - | SUB_ASSIGN { $$ = strdup("-="); } - | LEFT_ASSIGN { $$ = strdup("<<="); } - | RIGHT_ASSIGN { $$ = strdup(">>="); } - | AND_ASSIGN { $$ = strdup("&="); } - | XOR_ASSIGN { $$ = strdup("^="); } - | OR_ASSIGN { $$ = strdup("|="); } - ; - -any_operator - : assignment_operator - | unary_operator - | binary_operator - | NEW { $$ = strdup(" new"); } - | DELETE { $$ = strdup(" delete"); } - | PTR_OP { $$ = strdup("->"); } - | MEM_PTR_OP { $$ = strdup("->*"); } - | INC_OP { $$ = strdup("++"); } - | DEC_OP { $$ = strdup("--"); } - | LEFT_OP { $$ = strdup("<<"); } - | RIGHT_OP { $$ = strdup(">>"); } - | LE_OP { $$ = strdup("<="); } - | GE_OP { $$ = strdup(">="); } - | EQ_OP { $$ = strdup("=="); } - | NE_OP { $$ = strdup("!="); } - | AND_OP { $$ = strdup("&&"); } - | OR_OP { $$ = strdup("||"); } - | '[' ']' { $$ = strdup("[]"); } - | '(' ')' { $$ = strdup("()"); } - ; - -constant_value - : expression - | compound_statement { $$ = strdup("{ ... }"); } - ; - -expression - : additive_expression - ; - -primary_expression - : CONSTANT - | '-' CONSTANT -{ - char *tmp_str = (char *) malloc(strlen($2) + 2); - sprintf(tmp_str, "-%s", $2); - free($2); - $$ = tmp_str; -} - | STRING_LITERAL - | IDENTIFIER - | scoped_identifier - | '(' expression ')' -{ - char *tmp_str = (char *) malloc(strlen($2) + 3); - sprintf(tmp_str, "(%s)", $2); - free($2); - $$ = tmp_str; -} - ; - -multiplicative_expression - : primary_expression - | multiplicative_expression '*' primary_expression -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 4); - sprintf(tmp_str, "%s * %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | multiplicative_expression '/' primary_expression -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 4); - sprintf(tmp_str, "%s / %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | multiplicative_expression '%' primary_expression -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 4); - sprintf(tmp_str, "%s %% %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -additive_expression - : multiplicative_expression - | additive_expression '+' multiplicative_expression -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 4); - sprintf(tmp_str, "%s + %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | additive_expression '-' multiplicative_expression -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 4); - sprintf(tmp_str, "%s - %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - - -union_specifier - : UNION IDENTIFIER '{' variable_specifier_list '}' -{ - char *tmp_str = (char *) malloc(strlen($2) + strlen($4) + 12); - sprintf(tmp_str, "union %s { %s }", $2, $4); - free($2); - free($4); - $$ = tmp_str; -} - | UNION '{' variable_specifier_list '}' -{ - char *tmp_str = (char *) malloc(strlen($3) + 11); - sprintf(tmp_str, "union { %s }", $3); - free($3); - $$ = tmp_str; -} - | UNION IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($2) + 7); - sprintf(tmp_str, "union %s", $2); - free($2); - $$ = tmp_str; -} - ; - -class_specifier - : CLASS IDENTIFIER '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $2, NULL, CLASS_KIND); - tmp_elem->children = reverse_list($4); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | CLASS IDENTIFIER ':' superclass_list '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $2, NULL, CLASS_KIND); - tmp_elem->children = reverse_list($6); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | template_specifier CLASS IDENTIFIER '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $3, NULL, CLASS_KIND); - tmp_elem->children = reverse_list($5); - tmp_elem->templ = $1; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | template_specifier CLASS IDENTIFIER ':' superclass_list '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $3, NULL, CLASS_KIND); - tmp_elem->children = reverse_list($7); - tmp_elem->templ = $1; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | STRUCT '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), "unnamed_struct", - NULL, IGNORE_KIND); - tmp_elem->children = reverse_list($3); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | STRUCT IDENTIFIER '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $2, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list($4); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | STRUCT IDENTIFIER ':' superclass_list '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $2, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list($6); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | template_specifier STRUCT IDENTIFIER '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $3, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list($5); - tmp_elem->templ = $1; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | template_specifier STRUCT IDENTIFIER ':' superclass_list '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $3, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list($7); - tmp_elem->templ = $1; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - ; - -superclass_list - : superclass - | superclass_list ',' superclass - ; - -superclass - : access_specifier_opt type_name { free($2); } - ; - -friend_specifier - : FRIEND member_func_specifier { $2->kind = IGNORE_KIND; } - | FRIEND forward_decl - ; - -member_list_opt - : /* nothing */ { $$ = NULL; } - | member_list - ; - -member_list - : member_with_access -{ - if ($1 != NULL) - $1->next = NULL; - - $$ = $1; -} - | member_list member_with_access -{ - if ($2 != NULL) { - $2->next = $1; - $$ = $2; - } else { - $$ = $1; - } -} - ; - -member_or_error - : member - | error -{ - log_printf("member_with_access : error. Attempting to recover...\n"); - yyerrok; - yyclearin; - if (error_recovery() != 0) { - log_printf("ERROR recovery could not complete -- YYABORT.\n"); - YYABORT; - } - log_printf("ERROR recovery complete.\n"); - $$ = NULL; -} - ; - -member_with_access - : member_or_error - | access_specifier_list member_or_error { $$ = $2; } - ; - -member - : member_specifier ';' - | friend_specifier ';' { $$ = NULL; } - | member_func_inlined { $1->kind = INLINED_KIND; $$ = $1; } - | ';' { $$ = NULL; } - ; - -member_specifier - : multiple_variable_specifier -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), $1, NULL, IGNORE_KIND); -/* print_se(elem); */ - $$ = elem; -} - | member_func_specifier - | EXTERN member_func_specifier { $$ = $2; } - | member_func_specifier '=' CONSTANT { $1->kind = IGNORE_KIND; free($3); $$ = $1; } - | mem_type_specifier - ; - -mem_type_specifier - : type_specifier - | type_specifier IDENTIFIER { free($2); $$ = $1; } - | mem_type_specifier '[' ']' - | mem_type_specifier '[' constant_value ']' -{ - free($3); - $$ = $1; -} - ; - -template_arg - : CLASS IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($2) + 7); - sprintf(tmp_str, "class %s", $2); - free($2); - $$ = tmp_str; -} - | type_name IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 2); - sprintf(tmp_str, "%s %s", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - ; - -template_arg_list - : template_arg - | template_arg_list ',' template_arg -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s, %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -template_instance_arg - : CONSTANT - | type_name - ; - -template_instance_arg_list - : template_instance_arg - | template_instance_arg_list ',' template_instance_arg -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s, %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -template_specifier - : TEMPLATE '<' template_arg_list '>' -{ - char *tmp_str = (char *) malloc(strlen($3) + 12); - sprintf(tmp_str, "template <%s>", $3); - free($3); - $$ = tmp_str; -} - ; - -%% - -static int yyerror(char *s /*UNUSED*/) -{ - if (outfile != NULL) - fflush(outfile); - - return 0; -} - -static int error_recovery() -{ - extern char linebuf[]; - extern int lineno; - extern int column; - extern int tokens_seen; - -#ifdef SGDEBUG - log_printf("parse error at line %d, file %s:\n%s\n%*s\n", - lineno, currentFile, linebuf, column, "^"); - log_flush(); -#endif /* SGDEBUG */ - - if (tokens_seen == 0) { - /* - * if we've seen no tokens but we're in an error, we must have - * hit an EOF, either by stdin, or on a file. Just give up - * now instead of complaining. - */ - return -1; - - } else { - fprintf(stderr, "parse error at line %d, file %s:\n%s\n%*s\n", - lineno, currentFile, linebuf, column, "^"); - } - - linebuf[0] = '\0'; - - for (;;) { - int result = yylex(); - - if (result <= 0) { - /* fatal error: Unexpected EOF during parse error recovery */ - -#ifdef SGDEBUG - log_printf("EOF in error recovery, line %d, file %s\n", - lineno, currentFile); - log_flush(); -#endif /* SGDEBUG */ - - fprintf(stderr, "EOF in error recovery, line %d, file %s\n", - lineno, currentFile); - - return -1; - } - - switch(result) { - case IDENTIFIER: - case CONSTANT: - case STRING_LITERAL: - case CHAR: - case SHORT: - case INT: - case LONG: - case SIGNED: - case UNSIGNED: - case FLOAT: - case DOUBLE: - case VOID: - free(yylval.string); - break; - case (int) '{': - if (collectInlineDef() != 0) - return -1; - result = yylex(); - return 0; - case (int) ';': - return 0; - } - } -} diff --git a/bepascal/bepascal/stubgen.so/pathname.c b/bepascal/bepascal/stubgen.so/pathname.c deleted file mode 100644 index 581299a..0000000 --- a/bepascal/bepascal/stubgen.so/pathname.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * FILE: pathname.c - * AUTH: Michael John Radwin - * - * DESC: two important functions from libgen. Largely influenced - * by the gnu dirutils. - * - * DATE: Tue Oct 1 20:48:28 EDT 1996 - * $Id: pathname.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#ifdef WIN32 -#define PATH_SEPARATOR_STR "\\" -#define PATH_SEPARATOR_CHAR '\\' -#else -#define PATH_SEPARATOR_STR "/" -#define PATH_SEPARATOR_CHAR '/' -#endif - -static const char rcsid[] = "$Id: pathname.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $"; - -static void -strip_trailing_slashes(char *path) -{ - int last = strlen (path) - 1; - while ((last > 0) && (path[last] == PATH_SEPARATOR_CHAR)) - path[last--] = '\0'; -} - -char * -basename(char *path) -{ - char *slash; - - if ((path == NULL) || (path[0] == '\0')) - return "."; - - strip_trailing_slashes(path); - if (path[0] == '\0') - return PATH_SEPARATOR_STR; - - slash = strrchr(path, PATH_SEPARATOR_CHAR); - return (slash) ? slash + 1 : path; -} - -char * -dirname(char *path) -{ - char *slash; - - if ((path == NULL) || (path[0] == '\0')) - return "."; - - strip_trailing_slashes(path); - if (path[0] == '\0') - return PATH_SEPARATOR_STR; - - slash = strrchr(path, PATH_SEPARATOR_CHAR); - if (slash == NULL) - return "."; - - /* Remove any trailing slashes and final element. */ - while (slash > path && *slash == PATH_SEPARATOR_CHAR) - --slash; - slash[1] = 0; - - return path; -} diff --git a/bepascal/bepascal/stubgen.so/pathname.h b/bepascal/bepascal/stubgen.so/pathname.h deleted file mode 100644 index 57fa1cd..0000000 --- a/bepascal/bepascal/stubgen.so/pathname.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * FILE: pathname.h - * AUTH: Michael John Radwin - * - * DESC: two important functions from libgen - * - * DATE: Tue Oct 1 20:47:55 EDT 1996 - * $Id: pathname.h,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __pathname_H__ -#define __pathname_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Given a pointer to a null-terminated character string that contains a - * path name, basename() returns a pointer to the last element of path. - * Trailing ``/'' characters are deleted. In doing this, it may place a - * null byte in the path name after the next to last element, so the - * content of path must be disposable. - * - * If path or *path is zero, pointer to a static constant ``.'' is - * returned. - * - * If path consists entirely of ``/'' characters, the empty string is - * returned. - */ -char * basename(char *path); - -/* - * Given a pointer to a null-terminated character string that contains a - * file system path name, dirname() returns a string that is the parent - * directory of that file. In doing this, it may place a null byte in - * the path name after the next to last element, so the content of path - * must be disposable. The returned string should not be deallocated by - * the caller. Trailing ``/'' characters in the path are not counted as - * part of the path. - * - * If path or *path is zero, a pointer to a static constant ``.'' is - * returned. - * - * dirname() and basename() together yield a complete path name. - * dirname (path) is the directory where basename (path) is found. - */ -char * dirname(char *path); - -#ifdef __cplusplus -} -#endif - -#endif /* __pathname_H__ */ diff --git a/bepascal/bepascal/stubgen.so/stubgen.pp b/bepascal/bepascal/stubgen.so/stubgen.pp deleted file mode 100644 index 4778169..0000000 --- a/bepascal/bepascal/stubgen.so/stubgen.pp +++ /dev/null @@ -1,49 +0,0 @@ -unit stubgen; - -interface - -uses - Classes, SysUtils; - -{$PACKRECORDS C} - -const - IGNORE_KIND = 0; // a variable or forward declaration */ - FUNC_KIND = 1; // a method declaration */ - CLASS_KIND = 2; // a class declaration */ - INLINED_KIND = 3; // a method w/body in a class decl. */ - SKEL_KIND = 4; // a method found in a code file */ - STRUCT_KIND = 5; // a struct declaration that's a class */ - DONE_FUNC_KIND = 11; // a fn that we've finished expanded */ - DONE_CLASS_KIND = 12; // a class that we've finished expanded */ - -type - PArgument = ^TArgument; - TArgument = record - aType : PChar; - aName : PChar; - aArray : PChar; - Next : PArgument; - end; - - PSyntaxelem = ^TSyntaxelem; - TSyntaxelem = record - aName : PChar; - ret_type : PChar; - args : PArgument; - templ : PChar; - parent : PSyntaxelem; - next : PSyntaxelem; - children : PSyntaxelem; - throw_decl : PChar; - const_flag : Longint; - kind : Longint; - end; - -procedure init_tables; cdecl; external 'stubgen' name 'init_tables'; -procedure free_tables; cdecl; external 'stubgen' name 'free_tables'; -function scan(FileName : PChar) : PSyntaxelem; cdecl; external 'stubgen' name 'scan'; - -implementation - -end. \ No newline at end of file diff --git a/bepascal/bepascal/stubgen.so/stubgen_proj/stubgen.proj b/bepascal/bepascal/stubgen.so/stubgen_proj/stubgen.proj deleted file mode 100644 index 8235e98a7ee950ac6db7be9b69a1fbce0229171a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12807 zcmeHOZ;Ts96`zfl#&@|RF1h2JOG35^Bs8tjeBsMM3gScip^-rqLZU*B!tc$_ z+P=hU-8-WO?9t8c{CV%qd%u~TeSSMPcRD@I*zsHGjI+epgTKu<(-p>;dJ8Gze9fUU zawOxJE4W9IcPhA~Ck+F)81g;Hls<*LBb)I`j44FNlvLify;Om(aLcZyN?b2+$4%uq zb@oVV#e=oS!>Cq!1Pqwj0UlM`HP?Ctkq^PcGV{HHLetJRc;vb5rrdScy8874PEf#sVk`~x_D))8_H~3mk8d%QW31(?Y-N!YY=p??-pHD zrZ}$Cod>B4xWLsB>64zLSrNBeyXKJnQXhdn0=y{cP9eXYm?Nsw~xU83IcLN8Ch`C z9&}b0xSQ5Jozz!k-$U>NDVnz*exSi!H;h!FNgSx55EZ*us|y|`#Dp$nMY5g`eX=0N z)!-zSEhY+!fmK}S+H|MbVL56{I%{tGQKfky^-$V$b=T!(d~uVpILMFE03=>g9|~p9 zT6SKy5PEaT06|6tN&%_z*=&ixP}FRRTUG^$$Ndewg@S3pRzm6*qg&zJ*3}*{-3=zSi7C(;!{D}Paucn?zkMSrO`$@iE-xk`r4&s-S)qqxKH)l=Z1Y_-2V;6 z3g?F8g#2_DI)f$?)9R;BjMk3HvI>(3lLM%e4C13cY99gZi}RzkE7;;FT!Ud- z>$+rD#{FMGw}$PIbBFDqxpq8wUWlIh=@-AS9d-8psQ(PUB|VCA6bmi}8$#QMP@cF1 zOwj&g@H~M`=Ri)O9XAGD6zHdX6ZOA;YuNX#z5e3Y=O^hoAeuAC8RTQHjQZl)zcA)g zo!W^%*e%1|ll`^4Y8BA@X5h27Y~i#UE4iHO=?=ZJww7`pcgi`(UiQoi&wYFuIkRGV z+u#rFRPGP#RN|TGnHD2IzDED|9P$nP3%M|^$gtGBUPkDOKAj;&@ii?x7qulo9!H`l zG?ST}3I%KqbLDY5r_-Z3frKoAXCx9iaF|d~X5at_l^J{H`j~(5zW7Z#?R@RQfaimQ z@tc1r5Bnb<1JZ=OK>4I=2|*6WPzS%<`5qKs!39mtP8yZX|cStcKY z&VcO^U%S^5uD$FSJYm=c&gQZ+7P{yiAQAzI!Y<^UW!It diff --git a/bepascal/bepascal/stubgen.so/table.c b/bepascal/bepascal/stubgen.so/table.c deleted file mode 100644 index 58feb5c..0000000 --- a/bepascal/bepascal/stubgen.so/table.c +++ /dev/null @@ -1,441 +0,0 @@ -/* - * FILE: table.c - * AUTH: Michael John Radwin - * - * DESC: stubgen symbol table goodies - * - * DATE: 1996/08/14 22:04:47 - * $Id: table.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "table.h" -#include "util.h" -#include -#include -#include -#include - -static const char rcsid[] = "$Id: table.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $"; - -/* global table */ -static syntaxelem_t etable[NELEMS]; -static int eindex; - -/* initializes all of the tables to default values. */ -void init_tables() -{ - memset(etable, 0, sizeof(syntaxelem_t) * NELEMS); - eindex = 0; - -#if 0 - syntaxelem_t *elt; - - for(elt = etable; elt < &etable[NELEMS]; elt++) { - elt->name = NULL; - elt->ret_type = NULL; - elt->args = NULL; - elt->templ = NULL; - elt->parent = NULL; - elt->children = NULL; - elt->throw_decl = NULL; - elt->const_flag = 0; - elt->kind = 73; - } -#endif -} - -/* recursively frees all syntaxelem_t's. */ -void free_tables() -{ - syntaxelem_t *elt; - - for (elt = etable; elt < &etable[NELEMS]; elt++) { - if (elt->name) { - free(elt->name); - free(elt->ret_type); - free_args(elt->args); - - if (elt->throw_decl) free(elt->throw_decl); - if (elt->templ) free(elt->templ); - } - } -} - -/* recursively frees the argument list and assoicated fields */ -void free_args(arg_t *args) -{ - arg_t *a; - - for (a = args; a != NULL; ) { - arg_t *next_arg = a->next; - free(a->type); - if (a->name) - free(a->name); - if (a->array) - free(a->array); - free(a); - a = next_arg; - } -} - -/* compares two arguments for equality. Returns 0 for equal, - non-zero if they differ. */ -int arg_cmp(arg_t *a1, arg_t *a2) -{ - if (strcmp(a1->type, a2->type) != 0) - return 1; - - if (a1->array) { - if (a2->array) { - if (strcmp(a1->array, a2->array) != 0) - return 1; - } else { - return 1; - } - } else if (a2->array) { - return 1; - } - - return 0; -} - -/* recursively compares two argument lists for equality. - Returns 0 for equal, non-zero if they differ. */ -int args_cmp(arg_t *a1, arg_t *a2) -{ - while (a1 != NULL) { - if (a2 == NULL) - return 1; - - if (arg_cmp(a1, a2) != 0) - return 1; - - a1 = a1->next; - a2 = a2->next; - } - - if (a2 != NULL) - return 1; - - return 0; -} - - -/* provides a string rep of this arglist. conses up new - memory, so client is responsible for freeing it. */ -char * args_to_string(arg_t *args, int indent_length) -{ - arg_t *a; - int len = 0; - char *str; - char *indent_str; - - if (indent_length <= 0) { - indent_str = strdup(", "); - indent_length = 2; - - } else { - indent_length += 2; /* room for ",\n" as well */ - indent_str = (char *) malloc(indent_length + 1); - memset(indent_str, ' ', indent_length); - indent_str[0] = ','; - indent_str[1] = '\n'; - indent_str[indent_length] = '\0'; - } - - for (a = args; a != NULL; a = a->next) { - len += strlen(a->type); /* we always have a type */ - if (a->name) - len += (1 + strlen(a->name)); /* room for ' ' and name */ - if (a->array) - len += strlen(a->array); - if (a != args) - len += indent_length; /* room for ", " */ - } - - str = (char *) malloc(len + 1); - str[0] = '\0'; - - for (a = args; a != NULL; a = a->next) { - if (a != args) - strcat(str, indent_str); - - strcat(str, a->type); - if (a->name) { - if (((a->type)[strlen(a->type)-1] != '*') && - ((a->type)[strlen(a->type)-1] != '&')) - strcat(str, " "); - strcat(str, a->name); - if (a->array) - strcat(str, a->array); /* array hugs variable name */ - } else { - if (a->array) - strcat(str, a->array); /* array hugs type name */ - } - } - - free(indent_str); - return str; -} - -/* compares a skeleton element to a header element for equality of - signatures. this isn't a strict comparison, because the kind and - parent fields ought to be different. returns 0 if equal, non-zero if - different */ -int skel_elemcmp(syntaxelem_t *skel_elem, syntaxelem_t *hdr_elem) -{ - char *tmp_str; - int result; - - assert(hdr_elem->kind == FUNC_KIND); - assert(skel_elem->kind == SKEL_KIND); - assert(hdr_elem->parent != NULL); - - if (skel_elem->const_flag != hdr_elem->const_flag) - return 1; - - /* - * templ and throw_decl are allowed to be NULL, - * so we must not pass them onto strcmp without - * a check first. - */ - if (skel_elem->templ != NULL) { - if (hdr_elem->templ == NULL) - return 1; - else if (strcmp(skel_elem->templ, hdr_elem->templ) != 0) - return 1; - } else if (hdr_elem->templ != NULL) { - return 1; - } - - if (skel_elem->throw_decl != NULL) { - if (hdr_elem->throw_decl == NULL) - return 1; - else if (strcmp(skel_elem->throw_decl, hdr_elem->throw_decl) != 0) - return 1; - } else if (hdr_elem->throw_decl != NULL) { - return 1; - } - - /* - * these two won't differ across files, and they're - * guaranteed not to be NULL. - */ - if (strcmp(skel_elem->ret_type, hdr_elem->ret_type) != 0) - return 1; - - /* now make sure the argument signatures match */ - if (args_cmp(skel_elem->args, hdr_elem->args) != 0) - return 1; - - /* - * the name, of course, is the hard part. we gotta - * look at the parent to make a scoped name. - */ - tmp_str = (char *) malloc(strlen(hdr_elem->parent->name) + - strlen(hdr_elem->name) + 3); - sprintf(tmp_str, "%s::%s", hdr_elem->parent->name, hdr_elem->name); - - result = strcmp(skel_elem->name, tmp_str); - free(tmp_str); - - return result; -} - -/* allocates a new element from the table, filling in the apropriate fields */ -syntaxelem_t * new_elem(char *ret_type, char *name, arg_t *args, int kind) -{ - syntaxelem_t *se; - - if (eindex == NELEMS - 1) { - fatal(2, "Too many symbols. Please mail mjr@acm.org."); - return NULL; - } - - se = &etable[eindex++]; - se->ret_type = ret_type; - se->name = name; - se->args = args; - se->kind = kind; - - return se; -} - - -/* given the head of the list, reverses it and returns the new head */ -syntaxelem_t * reverse_list(syntaxelem_t *head) -{ - syntaxelem_t *elt = head; - syntaxelem_t *prev = NULL; - syntaxelem_t *next; - - while (elt != NULL) { - next = elt->next; - elt->next = prev; - prev = elt; - elt = next; - } - - return prev; -} - -arg_t * reverse_arg_list(arg_t *head) -{ - arg_t *a = head; - arg_t *prev = NULL; - arg_t *next; - - while (a != NULL) { - next = a->next; - a->next = prev; - prev = a; - a = next; - } - - return prev; -} - -const char * string_kind(int some_KIND) -{ - switch(some_KIND) { - case IGNORE_KIND: - return "IGNORE_KIND"; - case FUNC_KIND: - return "FUNC_KIND"; - case CLASS_KIND: - return "CLASS_KIND"; - case STRUCT_KIND: - return "STRUCT_KIND"; - case INLINED_KIND: - return "INLINED_KIND"; - case SKEL_KIND: - return "SKEL_KIND"; - case DONE_FUNC_KIND: - return "DONE_FUNC_KIND"; - case DONE_CLASS_KIND: - return "DONE_CLASS_KIND"; - default: - return "BAD KIND!"; - } -} - - -#ifdef SGDEBUG -void print_se(syntaxelem_t *elt) -{ - char *arg_str = args_to_string(elt->args, 0); - - log_printf("\nSTUBELEM name: %s\n", elt->name); - log_printf(" ret_typ: %s\n", elt->ret_type); - log_printf(" args: %s\n", arg_str); - log_printf(" parent: %s\n", (elt->parent) ? elt->parent->name : "NULL"); - log_printf(" next: %s\n", (elt->next) ? elt->next->name : "NULL"); - log_printf(" const: %d\n", elt->const_flag); - log_printf(" kind: %s\n", string_kind(elt->kind)); - log_printf(" throw: %s\n", (elt->throw_decl)? elt->throw_decl : "NULL"); - log_printf(" templ: %s\n\n", (elt->templ)? elt->templ : "NULL"); - free(arg_str); -} -#endif /* SGDEBUG */ - -/* - * we can't use the 'next' field of syntaxelem_t because it is used to - * chain together methods. Make a slightly bigger struct so we can - * queue these up. - */ -typedef struct _skelnode { - syntaxelem_t *elt; - struct _skelnode *next; -} skelnode_t; - -/* the queue of elements found in the .H file, possibly to be expanded */ -static skelnode_t *exp_head = NULL; -static skelnode_t *exp_tail = NULL; - -void enqueue_class(syntaxelem_t *elt) -{ - skelnode_t *new_class; - - new_class = (skelnode_t *)malloc(sizeof(skelnode_t)); - new_class->elt = elt; - new_class->next = NULL; - - if (exp_head == NULL) - exp_tail = exp_head = new_class; - else { - exp_tail->next = new_class; - exp_tail = new_class; - } -} - -syntaxelem_t * dequeue_class() -{ - skelnode_t *old_head = exp_head; - syntaxelem_t *to_return = exp_head->elt; - - assert(exp_head != NULL); - exp_head = exp_head->next; - free(old_head); - - return to_return; -} - -int class_queue_empty() -{ - return exp_head == NULL; -} - -/* the list of skeletons found in the .C file, already expanded */ -static skelnode_t *skel_head = NULL; - -void enqueue_skeleton(syntaxelem_t *elt) -{ - skelnode_t *new_class; - - new_class = (skelnode_t *)malloc(sizeof(skelnode_t)); - new_class->elt = elt; - new_class->next = skel_head; - - skel_head = new_class; -} - -syntaxelem_t * find_skeleton(syntaxelem_t *elt) -{ - skelnode_t *node; - - /* the order of skel_elemcmp(node->elt, elt) is important. */ - for (node = skel_head; node != NULL; node = node->next) - if (skel_elemcmp(node->elt, elt) == 0) - return node->elt; - - return NULL; -} - -void clear_skeleton_queue() -{ - skelnode_t *node = skel_head; - - while (node != NULL) { - skelnode_t *next_node = node->next; - free(node); - node = next_node; - } - - skel_head = NULL; -} diff --git a/bepascal/bepascal/stubgen.so/table.h b/bepascal/bepascal/stubgen.so/table.h deleted file mode 100644 index 7d0c70f..0000000 --- a/bepascal/bepascal/stubgen.so/table.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * FILE: table.h - * AUTH: Michael John Radwin - * - * DESC: stubgen symbol table goodies - * - * DATE: 1996/08/14 22:04:47 - * $Id: table.h,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TABLE_HEADER -#define TABLE_HEADER - -#ifdef __cplusplus -extern "C" { -#endif - -#define NELEMS 500 /* maximum number of symbols */ - -#define IGNORE_KIND 0 /* a variable or forward declaration */ -#define FUNC_KIND 1 /* a method declaration */ -#define CLASS_KIND 2 /* a class declaration */ -#define INLINED_KIND 3 /* a method w/body in a class decl. */ -#define SKEL_KIND 4 /* a method found in a code file */ -#define STRUCT_KIND 5 /* a struct declaration that's a class */ -#define DONE_FUNC_KIND 11 /* a fn that we've finished expanded */ -#define DONE_CLASS_KIND 12 /* a class that we've finished expanded */ - -/* returns a pointer to a static string */ -const char * string_kind(int some_KIND); - -/* - * Represents a single argument, often used in a list. - */ -typedef struct arg { - char *type; /* type of this arg. may NOT be NULL */ - char *name; /* formal parameter name. may be NULL */ - char *array; /* any array dimensions may be NULL - appended to name. */ - struct arg *next; /* next argument. may be NULL */ -} arg_t; - -/* - * This structure is central to the program. It might have been more - * elegant with an object-oriented approach consisting of the following - * objects: ignore, method, class, inlined, skeleton. - * - * Instead, however, we have a "throw-it-all-in-one" structure that has - * unused pieces of data, depending on the kind field. - * - * A syntaxelem_t is "valid" if the name field is non-NULL. - */ -typedef struct syntaxelem { - char *name; /* name of class or func. may NOT be NULL */ - char *ret_type; /* return type. may NOT be NULL */ - arg_t *args; /* argument list. may be NULL */ - char *templ; /* template declaration. may be NULL */ - struct syntaxelem *parent; /* parent class */ - struct syntaxelem *next; /* next class or member */ - struct syntaxelem *children; /* children of this class */ - char *throw_decl; /* throw() clause. may be NULL */ - int const_flag; /* 1 if the func is const, 0 if not. */ - int kind; /* some_KIND */ -} syntaxelem_t; - -/* defined in table.c */ -__declspec(dllexport) void init_tables(); -__declspec(dllexport) void free_tables(); - -#ifdef SGDEBUG -void print_se(syntaxelem_t *); -#else -#define print_se(arg) -#endif /* SGDEBUG */ - -/* used in scanning */ -arg_t * reverse_arg_list(arg_t *); -void free_args(arg_t *); -syntaxelem_t *new_elem(char *, char *, arg_t *, int); -syntaxelem_t *reverse_list(syntaxelem_t *); - -/* used in generating output. - allocates memory; someone's gotta clean it up! */ -char *args_to_string(arg_t *, int); - -/* used in comparison with existing skeletons*/ -int skel_elemcmp(syntaxelem_t *skel_elem, syntaxelem_t *hdr_elem); -int strict_elemcmp(syntaxelem_t *e1, syntaxelem_t *e2); - -/* list management primitives */ -void enqueue_class(syntaxelem_t *); -syntaxelem_t * dequeue_class(); -int class_queue_empty(); - -void enqueue_skeleton(syntaxelem_t *); -syntaxelem_t * find_skeleton(syntaxelem_t *); -void clear_skeleton_queue(); - -#ifdef __cplusplus -} -#endif - -#endif /* TABLE_HEADER */ diff --git a/bepascal/bepascal/stubgen.so/util.c b/bepascal/bepascal/stubgen.so/util.c deleted file mode 100644 index 8d21322..0000000 --- a/bepascal/bepascal/stubgen.so/util.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * FILE: util.c - * AUTH: Michael John Radwin - * - * DESC: stubgen utility macros and funcs - * - * DATE: Wed Sep 11 23:31:55 EDT 1996 - * $Id: util.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include -#include -#include "util.h" - -static const char rcsid[] = "$Id: util.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $"; - -#ifdef SGDEBUG -static FILE *logfile; - -int log_open(const char *logfilename) -{ - logfile = fopen(logfilename, "w"); - return (logfile != NULL); -} - -void log_flush() -{ - fflush(logfile); -} - -void log_close() -{ - fclose(logfile); - logfile = NULL; -} - -int log_printf(const char *format, ...) -{ - int retval; - va_list ap; - - va_start(ap, format); - retval = vfprintf(logfile, format, ap); - va_end(ap); - - return retval; -} - -int log_vprintf(const char *format, va_list ap) -{ - return vfprintf(logfile, format, ap); -} - -#else -int log_printf(const char *format /*UNUSED*/, ...) -{ - return 0; -} -#endif /* SGDEBUG */ - - -int inform_user(const char *format, ...) -{ - extern int opt_q; - int retval = 0; - va_list ap; - - if (!opt_q) { - va_start(ap, format); - retval = vfprintf(stderr, format, ap); - va_end(ap); - } - - return retval; -} - -void fatal(int status, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - log_vprintf(format, ap); - log_flush(); - log_close(); - (void) vfprintf(stderr, format, ap); - va_end(ap); - - fprintf(stderr, "\n"); - exit(status); -} - -#if 0 /* removeDefaultValues() not needed */ -/* - * modifies s by putting a null char in place of the first trailing space - */ -static void removeTrailingSpaces(char *s) -{ - char *end = s + strlen(s) - 1; - char *orig_end = end; - - while(*end == ' ') end--; - if (end != orig_end) *++end = '\0'; -} - -/* - * this both destructively modifies args and conses up a new string. - * be sure to free it up. - */ -char * removeDefaultValues(char *args) -{ - char *token; - char *new_arglist = (char *) malloc(strlen(args) + 1); - int once = 0; - - strcpy(new_arglist, ""); - token = strtok(args, "="); - - while(token != NULL) { - /* only append a comma if strtok got the comma off the arglist */ - if (once++) strcat(new_arglist, ","); - removeTrailingSpaces(token); - strcat(new_arglist, token); - token = strtok(NULL, ","); /* throw away the constant value */ - token = strtok(NULL, "="); /* grab args up til the next = sign */ - } - - return new_arglist; -} -#endif /* removeDefaultValues() not needed */ diff --git a/bepascal/bepascal/stubgen.so/util.h b/bepascal/bepascal/stubgen.so/util.h deleted file mode 100644 index a7e640e..0000000 --- a/bepascal/bepascal/stubgen.so/util.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * FILE: util.h - * AUTH: Michael John Radwin - * - * DESC: stubgen utility macros and funcs - * - * DATE: Wed Sep 11 23:31:55 EDT 1996 - * $Id: util.h,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef UTIL_HEADER -#define UTIL_HEADER - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -extern int yylex(); - -/* prints a message to the logfile if debugging is enabled */ -int log_printf(const char *format, ...); - -#ifdef SGDEBUG -int log_vprintf(const char *format, va_list ap); -int log_open(const char *filename); -void log_flush(); -void log_close(); -#else -#define log_vprintf(a,b) -#define log_open(arg) -#define log_flush() -#define log_close() -#endif /* SGDEBUG */ - -/* prints a message to stderr if the -q option is not set */ -int inform_user(const char *format, ...); - -/* prints a message to stderr and exits with return value 1 */ -void fatal(int status, const char *format, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* UTIL_HEADER */ diff --git a/bepascal/bepascal/stubgen.so/y.tab.c b/bepascal/bepascal/stubgen.so/y.tab.c deleted file mode 100644 index 6681ab5..0000000 --- a/bepascal/bepascal/stubgen.so/y.tab.c +++ /dev/null @@ -1,3309 +0,0 @@ - -/* A Bison parser, made from parser.y - by GNU Bison version 1.28 */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define IDENTIFIER 257 -#define CONSTANT 258 -#define STRING_LITERAL 259 -#define CHAR 260 -#define SHORT 261 -#define INT 262 -#define LONG 263 -#define SIGNED 264 -#define UNSIGNED 265 -#define FLOAT 266 -#define DOUBLE 267 -#define VOID 268 -#define NEW 269 -#define DELETE 270 -#define TEMPLATE 271 -#define THROW 272 -#define PTR_OP 273 -#define INC_OP 274 -#define DEC_OP 275 -#define LEFT_OP 276 -#define RIGHT_OP 277 -#define LE_OP 278 -#define GE_OP 279 -#define EQ_OP 280 -#define NE_OP 281 -#define AND_OP 282 -#define OR_OP 283 -#define MUL_ASSIGN 284 -#define DIV_ASSIGN 285 -#define MOD_ASSIGN 286 -#define ADD_ASSIGN 287 -#define SUB_ASSIGN 288 -#define LEFT_ASSIGN 289 -#define RIGHT_ASSIGN 290 -#define AND_ASSIGN 291 -#define XOR_ASSIGN 292 -#define OR_ASSIGN 293 -#define CLCL 294 -#define MEM_PTR_OP 295 -#define FRIEND 296 -#define OPERATOR 297 -#define CONST 298 -#define CLASS 299 -#define STRUCT 300 -#define UNION 301 -#define ENUM 302 -#define PROTECTED 303 -#define PRIVATE 304 -#define PUBLIC 305 -#define EXTERN 306 -#define ELIPSIS 307 - -#line 1 "parser.y" - -/* - * FILE: parser.y - * AUTH: Michael John Radwin - * - * DESC: stubgen grammar description. Portions borrowed from - * Newcastle University's Arjuna project (http://arjuna.ncl.ac.uk/), - * and Jeff Lee's ANSI Grammar - * (ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z) - * This grammar is only a subset of the real C++ language. - * - * DATE: Thu Aug 15 13:10:06 EDT 1996 - * $Id: y.tab.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * -------------------------------------------------------------------- - * - * $Log: not supported by cvs2svn $ - * Revision 1.1 2001/11/07 10:06:07 ithamar - * Added stubgen to CVS - * - * Revision 1.72 1998/07/07 00:14:06 mradwin - * removed extra space from throw_decl, cleaned up memory leak - * in ctor skeleton - * - * Revision 1.71 1998/06/11 14:52:09 mradwin - * allow for empty class declarations, such as - * class Element {}; - * also, differentiate structs from classes with - * new STRUCT_KIND tag. - * New version: 2.04 - * - * Revision 1.70 1998/05/11 19:49:11 mradwin - * Version 2.03 (updated copyright information). - * - * Revision 1.69 1998/04/07 23:43:34 mradwin - * changed error-handling code significantly. - * several functions now return a value, and instead of - * calling fatal(), we do a YYABORT or YYERROR to get out - * of the parsing state. - * New version: 2.02. - * - * Revision 1.68 1998/03/28 02:59:41 mradwin - * working on slightly better error recovery; not done yet. - * - * Revision 1.67 1998/03/28 02:34:56 mradwin - * added multi-line function parameters - * also changed pointer and reference (* and &) types so there - * is no trailing space before the parameter name. - * - * Revision 1.66 1998/01/12 19:39:11 mradwin - * modified rcsid - * - * Revision 1.65 1997/11/13 22:50:55 mradwin - * moved copyright from parser.y to main.c - * - * Revision 1.64 1997/11/13 22:40:15 mradwin - * fixed a silly comment bug - * - * Revision 1.63 1997/11/13 22:37:31 mradwin - * changed char[] to char * to make non-gcc compilers - * a little happier. We need to #define const to nothing - * for other compilers as well. - * - * Revision 1.62 97/11/13 21:29:30 21:29:30 mradwin (Michael Radwin) - * moved code from parser.y to main.c - * - * Revision 1.61 1997/11/13 21:10:17 mradwin - * renamed stubgen.[ly] to parser.y lexer.l - * - * Revision 1.60 1997/11/11 04:11:29 mradwin - * fixed command-line flags: invalid options now force usgage. - * - * Revision 1.59 1997/11/11 04:03:56 mradwin - * changed version info - * - * Revision 1.58 1997/11/11 03:54:05 mradwin - * fixed a long-standing bug with -b option. a typo was causing - * the -b flag to be ignored. - * - * Revision 1.57 1997/11/11 03:52:06 mradwin - * changed fatal() - * - * Revision 1.56 1997/11/05 03:02:02 mradwin - * Modified logging routines. - * - * Revision 1.55 1997/11/05 02:14:38 mradwin - * Made some compiler warnings disappear. - * - * Revision 1.54 1997/11/01 23:26:13 mradwin - * new Revision string and usage info - * - * Revision 1.53 1997/11/01 23:12:43 mradwin - * greatly improved error-recovery. errors no longer spill over - * into other files because the yyerror state is properly reset. - * - * Revision 1.52 1997/10/27 01:14:23 mradwin - * fixed constant_value so it supports simple arithmetic. it's - * not as robust as full expressions, but this will handle the - * char buffer[BUFSIZE + 1] problem. - * - * Also removed expansion rules that simply did { $$ = $1; } because - * that action is implicit anyway. - * - * Revision 1.51 1997/10/26 23:16:32 mradwin - * changed inform_user and fatal functions to use varargs - * - * Revision 1.50 1997/10/26 22:27:07 mradwin - * Fixed this bug: - * stubgen dies on the following because the protected section is empty: - * - * class WidgetCsg : public WidgetLens { - * protected: - * - * public: - * virtual ~WidgetCsg() {} - * WidgetCsg(); - * }; - * - * Error: - * stubgen version 2.0-beta $Revision: 1.1 $. - * parse error at line 4, file test.H: - * public: - * ^ - * - * Revision 1.49 1997/10/16 19:42:48 mradwin - * added support for elipses, static member/array initializers, - * and bitfields. - * - * Revision 1.48 1997/10/16 17:35:39 mradwin - * cleaned up usage info - * - * Revision 1.47 1997/10/16 17:12:59 mradwin - * handle extern "C" blocks better now, and support multi-line - * macros. still need error-checking. - * - * Revision 1.46 1997/10/15 22:09:06 mradwin - * changed tons of names. stubelem -> sytaxelem, - * stubin -> infile, stubout -> outfile, stublog -> logfile. - * - * Revision 1.45 1997/10/15 21:33:36 mradwin - * fixed up function_hdr - * - * Revision 1.44 1997/10/15 21:33:02 mradwin - * *** empty log message *** - * - * Revision 1.43 1997/10/15 17:42:37 mradwin - * added support for 'extern "C" { ... }' blocks. - * - * Revision 1.42 1997/09/26 20:59:18 mradwin - * now allow "struct foobar *f" to appear in a parameter - * list or as a variable decl. Had to remove the - * class_or_struct rule and blow up the class_specifier - * description. - * - * Revision 1.41 1997/09/26 19:02:18 mradwin - * fixed memory leak involving template decls in skeleton code. - * Leads me to believe that skel_elemcmp() is flawed, because - * it may rely in parent->templ info. - * - * Revision 1.40 1997/09/26 18:44:22 mradwin - * changed parameter handing from char *'s to an argument type - * to facilitate comparisons between skeleton code - * and header code. Now we can correctly recognize different - * parameter names while still maintaining the same signature. - * - * Revision 1.39 1997/09/26 00:47:29 mradwin - * added better base type support -- recognize things like - * "long long" and "short int" now. - * - * Revision 1.38 1997/09/19 18:16:37 mradwin - * allowed an instance name to come after a class, struct, - * union, or enum. This improves parseability of typedefs - * commonly found in c header files, although true typedefs are - * not understood. - * - * Revision 1.37 1997/09/15 22:38:28 mradwin - * did more revision on the SGDEBUG stuff - * - * Revision 1.36 1997/09/15 19:05:26 mradwin - * allow logging to be compiled out by turning off SGDEBUG - * - * Revision 1.35 1997/09/12 00:58:43 mradwin - * duh, silly me. messed up compilation. - * - * Revision 1.34 1997/09/12 00:57:49 mradwin - * Revision string inserted in usage - * - * Revision 1.33 1997/09/12 00:51:19 mradwin - * string copyright added to code for binary copyright. - * - * Revision 1.32 1997/09/12 00:47:21 mradwin - * some more compactness of grammar with parameter_list_opt - * and also ampersand_opt - * - * Revision 1.31 1997/09/12 00:26:19 mradwin - * better template support, but still poor - * - * Revision 1.30 1997/09/08 23:24:51 mradwin - * changes to error-handling code. - * also got rid of the %type for the top-level rules - * - * Revision 1.30 1997/09/08 23:20:02 mradwin - * some error reporting changes and default values for top-level - * grammar stuff. - * - * Revision 1.29 1997/09/08 17:54:24 mradwin - * cleaned up options and usage info. - * - * Revision 1.28 1997/09/05 19:38:04 mradwin - * changed options for .ext instead of -l or -x - * - * Revision 1.27 1997/09/05 19:17:06 mradwin - * works for scanning old versions, except for parameter - * names that differ between .H and .C files. - * - * Revision 1.26 1997/09/05 16:34:36 mradwin - * GPL-ized code. - * - * Revision 1.25 1997/09/05 16:11:44 mradwin - * some simple cleanup before GPL-izing the code - * - * Revision 1.24 1997/09/04 19:50:34 mradwin - * whoo-hoo! by blowing up the description - * exponentially, it works! - * - * Revision 1.23 1997/03/20 16:05:41 mjr - * renamed syntaxelem to syntaxelem_t, cleaned up throw_decl - * - * Revision 1.22 1996/10/02 15:16:57 mjr - * using pathname.h instead of libgen.h - * - * Revision 1.21 1996/09/12 14:44:49 mjr - * Added throw decl recognition (great, another 4 bytes in syntaxelem) - * and cleaned up the grammar so that const_opt appears in far fewer - * places. const_opt is by default 0 as well, so we don't need to - * pass it as an arg to new_elem(). - * - * I also added a fix to a potential bug with the MINIT and INLIN - * exclusive start states. I think they could have been confused - * by braces within comments, so now I'm grabbing comments in those - * states as well. - * - * Revision 1.20 1996/09/12 04:55:22 mjr - * changed expand strategy. Don't expand while parsing now; - * enqueue as we go along and expand at the end. Eventually - * we'll need to provide similar behavior for when we parse - * .C files - * - * Revision 1.19 1996/09/12 03:46:10 mjr - * No concrete changes in code. Just added some sanity by - * factoring out code into util.[ch] and putting some prototypes - * that were in table.h into stubgen.y where they belong. - * - * Revision 1.18 1996/09/06 14:32:48 mjr - * defined the some_KIND constants for clarity, and made - * expandClass return immediately if it was give something other - * than a CLASS_KIND element. - * - * Revision 1.17 1996/09/06 14:05:44 mjr - * Almost there with expanded operator goodies. Still need - * to get OPERATOR type_name to work. - * - * Revision 1.16 1996/09/04 22:28:09 mjr - * nested classes work and default arguments are now removed - * from the parameter lists. - * - * Revision 1.15 1996/09/04 20:01:57 mjr - * non-functional expanded code. needs work. - * - * Revision 1.14 1996/09/01 21:29:34 mjr - * put the expanded_operator code back in as a useless rule. - * oughta think about fixing it up if possible - * - * Revision 1.13 1996/09/01 20:59:48 mjr - * Added collectMemberInitList() function, which is similar - * to collectInlineDef() and also the exclusive state MINIT - * - * Revision 1.12 1996/08/23 05:09:19 mjr - * fixed up some more portability things - * - * Revision 1.11 1996/08/22 02:43:47 mjr - * added parse error message (using O'Reilly p. 274) - * - * Revision 1.10 1996/08/21 18:33:50 mjr - * added support for template instantiation in the type_name - * rule. surprisingly it didn't cause any shift/reduce conflicts. - * - * Revision 1.9 1996/08/21 17:40:56 mjr - * added some cpp directives for porting to WIN32 - * - * Revision 1.8 1996/08/21 00:00:19 mjr - * approaching stability and usability. command line arguments - * are handled now and the fopens and fcloses appear to work. - * - * Revision 1.7 1996/08/20 20:44:23 mjr - * added initial support for optind but it is incomplete. - * - * Revision 1.6 1996/08/19 17:14:59 mjr - * misordered args, fixed bug - * - * Revision 1.5 1996/08/19 17:11:41 mjr - * RCS got confused with the RCS-style header goodies. - * got it cleaned up now. - * - * Revision 1.4 1996/08/19 17:01:33 mjr - * Removed the expanded code checking and added - * lots of code that duplicates what stubgen.pl did. - * still need options pretty badly - * - * Revision 1.3 1996/08/17 23:21:10 mjr - * added the expanded operator code, cleaned up tabs. - * consider putting all of the expanded code in another - * grammar - this one is getting cluttered. - * - */ -#line 334 "parser.y" - -#include "table.h" -#include "util.h" -#include -#include -#include - -#ifdef WIN32 -#include /* defintion of alloca */ -#include "getopt.h" /* use GNU getopt */ -#endif /* WIN32 */ - -#ifndef WIN32 -#include -#endif /* WIN32 */ - -/* defined in lexer.l */ -extern int collectInlineDef(); -extern int collectMemberInitList(); - -/* defined here in parser.y */ -static int error_recovery(); -static int yyerror(char *); -static const char rcsid[] = "$Id: y.tab.c,v 1.1 2002-09-21 14:12:12 ocoursiere Exp $"; - -/* defined in main.c */ -extern FILE *outfile; -extern char *currentFile; -extern int lineno; - - -#line 366 "parser.y" -typedef union { - char *string; - syntaxelem_t *elt; - arg_t *arg; - int flag; -} YYSTYPE; -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#ifndef const -#define const -#endif -#endif -#endif - - - -#define YYFINAL 463 -#define YYFLAG -32768 -#define YYNTBASE 76 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 307 ? yytranslate[x] : 150) - -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 71, 2, 2, 2, 73, 55, 2, 64, - 65, 58, 69, 63, 70, 2, 72, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 61, 54, 56, - 62, 57, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 59, 2, 60, 74, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 67, 75, 68, 66, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 5, 8, 12, 14, 16, 18, 20, 22, - 24, 26, 28, 30, 31, 33, 36, 40, 43, 46, - 49, 52, 54, 56, 59, 64, 69, 75, 81, 84, - 87, 91, 93, 96, 98, 101, 104, 106, 108, 111, - 113, 115, 118, 121, 125, 127, 129, 131, 133, 137, - 141, 143, 146, 148, 151, 154, 157, 162, 166, 168, - 172, 174, 177, 182, 186, 188, 191, 195, 197, 201, - 204, 208, 209, 211, 215, 217, 219, 221, 225, 229, - 231, 235, 240, 244, 247, 248, 253, 257, 258, 264, - 267, 268, 273, 277, 279, 281, 285, 287, 289, 295, - 306, 308, 314, 316, 325, 332, 341, 348, 355, 360, - 361, 363, 364, 369, 371, 375, 380, 387, 394, 404, - 414, 420, 426, 437, 448, 449, 453, 458, 464, 467, - 469, 473, 475, 479, 480, 482, 485, 489, 491, 493, - 495, 497, 499, 501, 503, 505, 507, 509, 511, 513, - 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, - 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, - 555, 557, 559, 561, 563, 565, 567, 569, 571, 573, - 575, 577, 580, 583, 585, 587, 589, 591, 594, 596, - 598, 600, 604, 606, 610, 614, 618, 620, 624, 628, - 634, 639, 642, 648, 656, 663, 672, 677, 683, 691, - 698, 707, 709, 713, 716, 719, 722, 723, 725, 727, - 730, 732, 734, 736, 739, 742, 745, 747, 749, 751, - 753, 756, 760, 762, 764, 767, 771, 776, 779, 782, - 784, 788, 790, 792, 794, 798 -}; - -static const short yyrhs[] = { 77, - 0, 76, 77, 0, 78, 54, 0, 52, 5, 116, - 0, 101, 0, 98, 0, 54, 0, 1, 0, 143, - 0, 82, 0, 133, 0, 118, 0, 134, 0, 0, - 55, 0, 83, 80, 0, 44, 83, 80, 0, 45, - 3, 0, 45, 86, 0, 46, 3, 0, 46, 86, - 0, 86, 0, 3, 0, 46, 3, 0, 86, 56, - 148, 57, 0, 3, 56, 148, 57, 0, 86, 56, - 148, 57, 87, 0, 3, 56, 148, 57, 87, 0, - 86, 87, 0, 3, 87, 0, 46, 3, 87, 0, - 84, 0, 84, 87, 0, 85, 0, 10, 85, 0, - 11, 85, 0, 6, 0, 7, 0, 7, 8, 0, - 8, 0, 9, 0, 9, 8, 0, 9, 9, 0, - 9, 9, 8, 0, 11, 0, 12, 0, 13, 0, - 14, 0, 3, 40, 3, 0, 86, 40, 3, 0, - 88, 0, 87, 88, 0, 58, 0, 58, 44, 0, - 81, 90, 0, 81, 86, 0, 89, 59, 128, 60, - 0, 89, 59, 60, 0, 3, 0, 3, 61, 4, - 0, 90, 0, 87, 3, 0, 91, 59, 128, 60, - 0, 91, 59, 60, 0, 89, 0, 52, 89, 0, - 89, 62, 128, 0, 92, 0, 93, 63, 91, 0, - 93, 54, 0, 94, 93, 54, 0, 0, 96, 0, - 96, 63, 53, 0, 53, 0, 92, 0, 97, 0, - 96, 63, 92, 0, 96, 63, 97, 0, 81, 0, - 81, 62, 128, 0, 97, 59, 128, 60, 0, 97, - 59, 60, 0, 103, 116, 0, 0, 115, 61, 99, - 116, 0, 149, 103, 116, 0, 0, 149, 115, 61, - 100, 116, 0, 104, 116, 0, 0, 114, 61, 102, - 116, 0, 105, 109, 110, 0, 115, 0, 113, 0, - 106, 109, 110, 0, 114, 0, 112, 0, 81, 86, - 64, 95, 65, 0, 81, 3, 56, 148, 57, 40, - 3, 64, 95, 65, 0, 107, 0, 81, 3, 64, - 95, 65, 0, 108, 0, 81, 86, 40, 43, 127, - 64, 95, 65, 0, 86, 40, 43, 81, 64, 65, - 0, 81, 3, 40, 43, 127, 64, 95, 65, 0, - 3, 40, 43, 81, 64, 65, 0, 81, 43, 127, - 64, 95, 65, 0, 43, 81, 64, 65, 0, 0, - 44, 0, 0, 18, 64, 111, 65, 0, 81, 0, - 111, 63, 81, 0, 66, 3, 64, 65, 0, 86, - 40, 66, 3, 64, 65, 0, 3, 40, 66, 3, - 64, 65, 0, 3, 56, 148, 57, 40, 66, 3, - 64, 65, 0, 86, 56, 148, 57, 40, 66, 3, - 64, 65, 0, 3, 64, 95, 65, 110, 0, 86, - 64, 95, 65, 110, 0, 3, 56, 148, 57, 40, - 3, 64, 95, 65, 110, 0, 86, 56, 148, 57, - 40, 3, 64, 95, 65, 110, 0, 0, 67, 117, - 68, 0, 48, 67, 119, 68, 0, 48, 3, 67, - 119, 68, 0, 48, 3, 0, 120, 0, 119, 63, - 120, 0, 3, 0, 3, 62, 128, 0, 0, 123, - 0, 123, 61, 0, 122, 123, 61, 0, 51, 0, - 50, 0, 49, 0, 55, 0, 58, 0, 69, 0, - 70, 0, 66, 0, 71, 0, 72, 0, 73, 0, - 74, 0, 75, 0, 56, 0, 57, 0, 63, 0, - 62, 0, 30, 0, 31, 0, 32, 0, 33, 0, - 34, 0, 35, 0, 36, 0, 37, 0, 38, 0, - 39, 0, 126, 0, 124, 0, 125, 0, 15, 0, - 16, 0, 19, 0, 41, 0, 20, 0, 21, 0, - 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, - 27, 0, 28, 0, 29, 0, 59, 60, 0, 64, - 65, 0, 129, 0, 116, 0, 132, 0, 4, 0, - 70, 4, 0, 5, 0, 3, 0, 86, 0, 64, - 129, 65, 0, 130, 0, 131, 58, 130, 0, 131, - 72, 130, 0, 131, 73, 130, 0, 131, 0, 132, - 69, 131, 0, 132, 70, 131, 0, 47, 3, 67, - 94, 68, 0, 47, 67, 94, 68, 0, 47, 3, - 0, 45, 3, 67, 138, 68, 0, 45, 3, 61, - 135, 67, 138, 68, 0, 149, 45, 3, 67, 138, - 68, 0, 149, 45, 3, 61, 135, 67, 138, 68, - 0, 46, 67, 138, 68, 0, 46, 3, 67, 138, - 68, 0, 46, 3, 61, 135, 67, 138, 68, 0, - 149, 46, 3, 67, 138, 68, 0, 149, 46, 3, - 61, 135, 67, 138, 68, 0, 136, 0, 135, 63, - 136, 0, 121, 81, 0, 42, 104, 0, 42, 82, - 0, 0, 139, 0, 141, 0, 139, 141, 0, 142, - 0, 1, 0, 140, 0, 122, 140, 0, 143, 54, - 0, 137, 54, 0, 101, 0, 54, 0, 93, 0, - 104, 0, 52, 104, 0, 104, 62, 4, 0, 144, - 0, 79, 0, 79, 3, 0, 144, 59, 60, 0, - 144, 59, 128, 60, 0, 45, 3, 0, 81, 3, - 0, 145, 0, 146, 63, 145, 0, 4, 0, 81, - 0, 147, 0, 148, 63, 147, 0, 17, 56, 146, - 57, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 415, 416, 420, 421, 426, 433, 441, 442, 456, 471, - 475, 482, 489, 493, 494, 498, 507, 517, 518, 519, - 520, 524, 525, 526, 534, 542, 550, 559, 568, 576, - 584, 592, 593, 604, 605, 614, 626, 627, 628, 634, - 635, 636, 642, 648, 655, 656, 657, 658, 662, 670, - 682, 683, 695, 696, 700, 709, 718, 729, 742, 743, - 747, 748, 756, 764, 775, 776, 777, 785, 790, 801, - 808, 819, 823, 827, 836, 848, 849, 850, 855, 863, - 872, 882, 893, 906, 907, 909, 909, 916, 918, 927, - 928, 930, 933, 939, 940, 944, 950, 951, 956, 963, - 975, 981, 988, 992, 1003, 1015, 1026, 1041, 1051, 1064, - 1065, 1069, 1070, 1080, 1081, 1092, 1105, 1117, 1129, 1141, - 1156, 1167, 1175, 1188, 1204, 1205, 1208, 1215, 1223, 1233, - 1234, 1245, 1246, 1257, 1258, 1262, 1263, 1267, 1268, 1269, - 1273, 1274, 1275, 1276, 1277, 1278, 1282, 1283, 1284, 1285, - 1286, 1287, 1288, 1292, 1293, 1294, 1295, 1296, 1297, 1298, - 1299, 1300, 1301, 1302, 1306, 1307, 1308, 1309, 1310, 1311, - 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, - 1322, 1323, 1324, 1328, 1329, 1333, 1337, 1338, 1345, 1346, - 1347, 1348, 1358, 1359, 1367, 1375, 1386, 1387, 1395, 1407, - 1415, 1422, 1432, 1445, 1458, 1472, 1486, 1500, 1513, 1526, - 1540, 1557, 1558, 1562, 1566, 1567, 1571, 1572, 1576, 1583, - 1595, 1596, 1611, 1612, 1616, 1617, 1618, 1619, 1623, 1630, - 1631, 1632, 1633, 1637, 1638, 1639, 1640, 1648, 1655, 1666, - 1667, 1678, 1679, 1683, 1684, 1695 -}; -#endif - - -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) - -static const char * const yytname[] = { "$","error","$undefined.","IDENTIFIER", -"CONSTANT","STRING_LITERAL","CHAR","SHORT","INT","LONG","SIGNED","UNSIGNED", -"FLOAT","DOUBLE","VOID","NEW","DELETE","TEMPLATE","THROW","PTR_OP","INC_OP", -"DEC_OP","LEFT_OP","RIGHT_OP","LE_OP","GE_OP","EQ_OP","NE_OP","AND_OP","OR_OP", -"MUL_ASSIGN","DIV_ASSIGN","MOD_ASSIGN","ADD_ASSIGN","SUB_ASSIGN","LEFT_ASSIGN", -"RIGHT_ASSIGN","AND_ASSIGN","XOR_ASSIGN","OR_ASSIGN","CLCL","MEM_PTR_OP","FRIEND", -"OPERATOR","CONST","CLASS","STRUCT","UNION","ENUM","PROTECTED","PRIVATE","PUBLIC", -"EXTERN","ELIPSIS","';'","'&'","'<'","'>'","'*'","'['","']'","':'","'='","','", -"'('","')'","'~'","'{'","'}'","'+'","'-'","'!'","'/'","'%'","'^'","'|'","translation_unit", -"declaration","declaration_specifiers","type_specifier","ampersand_opt","type_name", -"forward_decl","non_reference_type","simple_signed_type","simple_type_name", -"scoped_identifier","pointer","asterisk","variable_or_parameter","bitfield_savvy_identifier", -"variable_name","variable_specifier","multiple_variable_specifier","variable_specifier_list", -"parameter_list_opt","parameter_list","unnamed_parameter","function_skeleton", -"@1","@2","member_func_inlined","@3","member_func_skel","member_func_specifier", -"member_func_skel_spec","function_specifier","overloaded_op_skeleton","overloaded_op_specifier", -"const_opt","throw_decl","throw_list","destructor","destructor_skeleton","constructor", -"constructor_skeleton","compound_statement","@4","enum_specifier","enumerator_list", -"enumerator","access_specifier_opt","access_specifier_list","access_specifier", -"unary_operator","binary_operator","assignment_operator","any_operator","constant_value", -"expression","primary_expression","multiplicative_expression","additive_expression", -"union_specifier","class_specifier","superclass_list","superclass","friend_specifier", -"member_list_opt","member_list","member_or_error","member_with_access","member", -"member_specifier","mem_type_specifier","template_arg","template_arg_list","template_instance_arg", -"template_instance_arg_list","template_specifier", NULL -}; -#endif - -static const short yyr1[] = { 0, - 76, 76, 77, 77, 77, 77, 77, 77, 78, 78, - 79, 79, 79, 80, 80, 81, 81, 82, 82, 82, - 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 84, 84, 84, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, - 87, 87, 88, 88, 89, 89, 89, 89, 90, 90, - 91, 91, 91, 91, 92, 92, 92, 93, 93, 94, - 94, 95, 95, 95, 95, 96, 96, 96, 96, 97, - 97, 97, 97, 98, 99, 98, 98, 100, 98, 101, - 102, 101, 103, 103, 103, 104, 104, 104, 105, 105, - 105, 106, 106, 107, 107, 107, 107, 108, 108, 109, - 109, 110, 110, 111, 111, 112, 113, 113, 113, 113, - 114, 115, 115, 115, 117, 116, 118, 118, 118, 119, - 119, 120, 120, 121, 121, 122, 122, 123, 123, 123, - 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, - 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 128, 128, 129, 130, 130, 130, 130, - 130, 130, 131, 131, 131, 131, 132, 132, 132, 133, - 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, - 134, 135, 135, 136, 137, 137, 138, 138, 139, 139, - 140, 140, 141, 141, 142, 142, 142, 142, 143, 143, - 143, 143, 143, 144, 144, 144, 144, 145, 145, 146, - 146, 147, 147, 148, 148, 149 -}; - -static const short yyr2[] = { 0, - 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 1, 2, 3, 2, 2, 2, - 2, 1, 1, 2, 4, 4, 5, 5, 2, 2, - 3, 1, 2, 1, 2, 2, 1, 1, 2, 1, - 1, 2, 2, 3, 1, 1, 1, 1, 3, 3, - 1, 2, 1, 2, 2, 2, 4, 3, 1, 3, - 1, 2, 4, 3, 1, 2, 3, 1, 3, 2, - 3, 0, 1, 3, 1, 1, 1, 3, 3, 1, - 3, 4, 3, 2, 0, 4, 3, 0, 5, 2, - 0, 4, 3, 1, 1, 3, 1, 1, 5, 10, - 1, 5, 1, 8, 6, 8, 6, 6, 4, 0, - 1, 0, 4, 1, 3, 4, 6, 6, 9, 9, - 5, 5, 10, 10, 0, 3, 4, 5, 2, 1, - 3, 1, 3, 0, 1, 2, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, - 1, 3, 1, 3, 3, 3, 1, 3, 3, 5, - 4, 2, 5, 7, 6, 8, 4, 5, 7, 6, - 8, 1, 3, 2, 2, 2, 0, 1, 1, 2, - 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, - 2, 3, 1, 1, 2, 3, 4, 2, 2, 1, - 3, 1, 1, 1, 3, 4 -}; - -static const short yydefact[] = { 0, - 8, 23, 37, 38, 40, 41, 0, 45, 46, 47, - 48, 0, 0, 0, 0, 0, 0, 0, 0, 7, - 0, 0, 1, 0, 234, 0, 10, 14, 32, 34, - 22, 65, 68, 229, 6, 5, 0, 230, 110, 110, - 101, 103, 98, 95, 97, 94, 12, 11, 13, 9, - 233, 0, 0, 0, 53, 72, 30, 51, 39, 42, - 43, 45, 35, 36, 0, 23, 0, 0, 22, 14, - 18, 19, 24, 0, 21, 202, 0, 129, 0, 23, - 0, 0, 66, 231, 97, 0, 2, 3, 235, 59, - 0, 56, 55, 15, 16, 33, 0, 0, 72, 29, - 0, 0, 0, 125, 84, 0, 90, 111, 112, 112, - 91, 85, 0, 23, 0, 0, 0, 0, 94, 49, - 0, 0, 242, 243, 244, 0, 54, 0, 75, 80, - 76, 0, 73, 77, 52, 44, 0, 0, 240, 0, - 0, 0, 24, 0, 0, 0, 17, 134, 0, 134, - 0, 31, 222, 0, 0, 0, 140, 139, 138, 0, - 228, 227, 0, 0, 0, 0, 0, 223, 219, 221, - 0, 0, 0, 0, 0, 0, 0, 132, 0, 130, - 4, 59, 56, 0, 0, 0, 0, 72, 168, 169, - 170, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 171, 141, 151, 152, 142, 0, 154, 153, 0, - 145, 143, 144, 146, 147, 148, 149, 150, 166, 167, - 165, 0, 0, 72, 50, 0, 0, 0, 0, 190, - 187, 189, 58, 0, 0, 191, 185, 0, 184, 193, - 197, 186, 67, 59, 0, 61, 69, 0, 232, 0, - 93, 96, 0, 0, 236, 0, 0, 24, 0, 0, - 87, 88, 0, 0, 26, 0, 59, 0, 112, 0, - 0, 238, 239, 246, 0, 0, 109, 0, 0, 135, - 0, 212, 0, 0, 0, 0, 0, 0, 216, 215, - 0, 24, 0, 224, 136, 226, 207, 220, 225, 0, - 0, 70, 201, 0, 0, 0, 0, 127, 116, 0, - 0, 60, 0, 182, 183, 72, 0, 0, 0, 0, - 25, 112, 0, 188, 57, 0, 0, 0, 0, 0, - 62, 0, 126, 0, 92, 86, 237, 134, 0, 134, - 0, 0, 0, 0, 0, 28, 245, 81, 121, 74, - 78, 79, 83, 0, 241, 26, 25, 214, 134, 0, - 203, 0, 208, 18, 24, 0, 137, 0, 200, 71, - 128, 133, 131, 0, 0, 102, 0, 0, 99, 0, - 0, 0, 27, 122, 192, 194, 195, 196, 198, 199, - 64, 0, 114, 0, 0, 0, 0, 0, 89, 107, - 118, 0, 0, 82, 213, 0, 0, 72, 0, 108, - 72, 105, 117, 0, 0, 63, 0, 113, 0, 205, - 0, 210, 72, 0, 204, 209, 0, 0, 0, 72, - 0, 115, 0, 0, 0, 0, 106, 72, 104, 0, - 0, 206, 211, 112, 119, 0, 112, 120, 123, 100, - 124, 0, 0 -}; - -static const short yydefgoto[] = { 22, - 23, 24, 25, 95, 82, 27, 28, 29, 30, 69, - 152, 58, 32, 93, 257, 33, 34, 176, 132, 133, - 134, 35, 264, 352, 162, 263, 37, 38, 39, 40, - 41, 42, 109, 261, 404, 43, 44, 45, 46, 247, - 258, 47, 179, 180, 289, 163, 164, 229, 230, 231, - 232, 248, 249, 250, 251, 252, 48, 49, 291, 292, - 165, 166, 167, 168, 169, 170, 171, 51, 139, 140, - 125, 126, 172 -}; - -static const short yypact[] = { 598, --32768, 138,-32768, 26,-32768, 162, 301, 301,-32768,-32768, --32768, -3, 874, 886, 75, 17, 18, 20, 154,-32768, - 114, 522,-32768, 85, 180, 37,-32768, 140, 161,-32768, - 159, 123,-32768, 172,-32768,-32768, 208, 166, 250, 250, --32768,-32768,-32768,-32768, 222, 243,-32768,-32768,-32768,-32768, - 268, 534, 4, 818, 286, 758, 161,-32768,-32768,-32768, - 340,-32768,-32768,-32768, 830, 212, 347, 294, 223, 140, - 108, 319, 82, 443, 319, 295, 686, 297, 362, 209, - 208, 40, 308,-32768,-32768, 306,-32768,-32768,-32768, 116, - 721, 15,-32768,-32768,-32768, 161, 38, 818, 758, 161, - 33, 56, 8,-32768,-32768, 367,-32768,-32768, 354, 354, --32768,-32768, 71, 234, 371, 372, 373, 208, 316,-32768, - 874, 376,-32768,-32768,-32768, 62,-32768, 874,-32768, 27, --32768, 315, 318, 323,-32768,-32768, 380, 381,-32768, 198, - 383, 818, 161, 322, 385, 818,-32768, 296, 443, 296, - 443, 161,-32768, 660, 386, 29,-32768,-32768,-32768, 673, --32768,-32768, 583, 329, 337, 324, 507,-32768,-32768,-32768, - 341, 163, 686, 393, 61, 391, 362, 344, 175,-32768, --32768, 149, 319, 343, 43, 818, 405, 758,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 351,-32768,-32768, 348, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 350, 59, 758,-32768, 874, 409, 259, 352, 375, --32768,-32768,-32768, 24, 412, 319,-32768, 359,-32768,-32768, - 228, 284,-32768, 361, 32,-32768, 364, 356,-32768, 365, --32768,-32768, 208, 208,-32768, 360, -4, 226, 52, 15, --32768,-32768, 366, 368, 72, 818, 153, 56, 354, 806, - 187,-32768,-32768,-32768, 830, 260,-32768, 262, 874,-32768, - 193,-32768, 363, 232, 370, 425, 431, 64,-32768,-32768, - 267, 230, 378,-32768,-32768,-32768,-32768,-32768,-32768, 433, - 610,-32768,-32768, 158, 190, 56, 362,-32768,-32768, 721, - 274,-32768, 377,-32768,-32768, 758, 721, 382, 394, 397, - 192, 354, 398,-32768,-32768, 24, 24, 24, 24, 24, --32768, 202,-32768, 874,-32768,-32768,-32768, 296, 443, 296, - 443, 208, 399, 407, 45, 161,-32768,-32768,-32768,-32768, --32768, 323,-32768, 402,-32768, 161, 161,-32768, 296, 443, --32768, 443,-32768, 375, 224, 406,-32768, 271,-32768,-32768, --32768,-32768,-32768, 410, 401,-32768, 408, 411,-32768, 413, - 414, 48, 161,-32768,-32768,-32768,-32768,-32768, 228, 228, --32768, 416,-32768, 255, 239, 415, 272, 428,-32768,-32768, --32768, 417, 474,-32768,-32768, 430, 432, 758, 477,-32768, - 758,-32768,-32768, 418, 481,-32768, 874,-32768, 443,-32768, - 443,-32768, 758, 435,-32768,-32768, 436, 438, 439, 758, - 441,-32768, 444, 458, 442, 462,-32768, 758,-32768, 473, - 495,-32768,-32768, 354,-32768, 497, 354,-32768,-32768,-32768, --32768, 503,-32768 -}; - -static const short yypgoto[] = {-32768, - 484,-32768,-32768, 493, 0, 423, 550,-32768, 333, 129, - 2, -51, -10, 468,-32768, -55, -67, 429, -97,-32768, - 292,-32768,-32768,-32768, 42,-32768, 529, -7,-32768,-32768, --32768,-32768, 542, -105,-32768,-32768,-32768, -2, 531, -23, --32768,-32768, 421, 270,-32768,-32768, -124,-32768,-32768,-32768, - -193, -94, 392, 19, 21,-32768,-32768,-32768, -147, 216, --32768, -133,-32768, 440, 447,-32768, 50,-32768, 353,-32768, - 379, -73, 110 -}; - - -#define YYLAST 932 - - -static const short yytable[] = { 26, - 131, 239, 294, 57, 262, 135, 120, 253, 83, 175, - 254, 84, 68, 105, 107, 293, 85, 295, 266, 73, - 76, 26, 78, 290, 238, 290, 240, 241, 242, 277, - 96, 302, 100, 59, 341, 240, 241, 242, 303, 90, - 235, 36, 182, 131, 135, 120, 121, 412, 135, 50, - 424, 117, 65, 124, 233, 130, 348, 181, 240, 241, - 242, 235, 349, 36, 138, 55, 376, 57, 286, 122, - 100, 50, 288, 240, 241, 242, 174, 71, 234, 91, - 236, 57, 91, 74, 77, 320, 79, 244, 278, 55, - 323, 185, 243, 245, 271, 74, 244, 124, 130, 104, - 135, 327, 245, 237, 255, 175, 91, 186, 314, 52, - 413, 355, 321, 425, 312, 57, 86, 83, 275, 244, - 273, 141, 104, 103, 276, 245, 384, 174, 31, 55, - 265, 52, 131, 388, 244, -20, 328, 104, 88, 55, - 245, 124, 150, 72, 75, 124, 300, 141, 151, 83, - 31, 85, 84, 298, 92, 185, 80, 85, 81, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 148, 60, - 61, 186, 174, 359, 149, 174, 187, 53, 131, 188, - 31, 101, 89, 358, 102, 124, 364, 130, 141, 240, - 241, 242, 141, 54, 94, 55, 13, 14, 97, 67, - 405, 56, 407, 135, 240, 241, 242, 115, 310, 187, - 183, 380, 188, 187, 98, 406, 55, 408, 55, 21, - 103, 382, 99, 290, 361, 290, 394, 106, 387, 246, - 246, 392, 104, 130, 103, 329, 416, 317, 417, 345, - 346, 246, 318, 314, 290, 270, 363, 402, 141, 55, - 244, 141, 317, 104, 284, 369, 245, 381, 183, 370, - 285, 401, 145, 141, 142, 244, 55, 142, 104, 55, - 131, 245, 56, 53, 104, 124, 356, -20, 146, 130, - 55, 55, 111, 55, 138, 336, 350, 55, 368, 54, - 150, 55, 351, 108, 369, 443, 151, 444, 372, 337, - 338, 369, 183, 112, 135, 429, 3, 4, 5, 6, - 174, 62, 9, 10, 11, 331, 366, 427, 367, 428, - 437, 276, 276, 439, 276, 130, 113, 148, 409, 127, - 385, 350, 393, 149, 369, 445, 276, 351, 431, 63, - 64, 135, 450, 403, 157, 158, 159, 136, 459, 143, - 456, 461, 339, 340, 396, 397, 398, 144, 145, 399, - 400, 173, 131, 177, 178, 131, 101, 356, 393, 184, - 259, 260, 246, 267, 268, 269, 272, 131, 274, 279, - 280, 281, 282, 283, 131, 120, 287, 235, 301, 305, - 306, 307, 131, 66, 309, 277, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 316, 246, 319, 322, 246, - 324, 330, 325, 326, 141, 334, 332, 130, 335, 347, - 130, 187, 342, 343, 72, 75, 442, 374, 344, 353, - 371, 354, 130, 375, 14, 378, 67, 373, 377, 130, - 419, 386, 128, 153, 246, 80, 389, 130, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 390, 313, 12, - 391, 414, 395, 410, 246, 246, 246, 246, 246, 188, - 246, 411, 420, 418, 421, 426, 434, 422, 423, 438, - 433, 440, 430, 441, 154, 13, 14, 155, 156, 17, - 18, 157, 158, 159, 160, 432, 161, 435, 446, 436, - 447, 448, 463, 449, 451, 87, 454, 153, 21, 80, - -217, 452, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 462, 1, 12, 2, 453, 455, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 114, 457, 12, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 154, 13, - 14, 155, 156, 17, 18, 157, 158, 159, 160, 458, - 161, 460, 147, 70, 13, 14, 15, 16, 17, 18, - 256, 362, 21, 19, -218, 20, 299, 14, 115, 116, - 118, 110, 119, 153, 415, 80, 383, 21, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 315, 1, 12, - 2, 311, 304, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 66, 308, 12, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 154, 13, 14, 155, 156, 17, - 18, 157, 158, 159, 160, 333, 161, 365, 0, 0, - 13, 14, 15, 16, 17, 18, 0, 0, 21, 19, - 0, 20, 0, 14, 357, 67, 0, 0, 0, 0, - 0, 128, 80, 21, 0, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 0, 80, 0, 379, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 0, 66, 0, - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 0, 0, 13, 14, 296, 297, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 13, 14, 0, 67, 0, - 0, 0, 0, 0, 0, 21, 0, 0, 0, 14, - 0, 67, 0, 0, 0, 189, 190, 128, 21, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 66, 212, 0, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 0, 0, 0, 213, 214, 215, 216, 217, - 0, 0, 218, 219, 220, 0, 221, 0, 0, 222, - 223, 224, 225, 226, 227, 228, 0, 0, 0, 0, - 0, 14, 0, 67, 0, 0, 0, 0, 66, 128, - 129, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 66, 123, 0, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 66, 0, 0, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 0, 0, 0, 0, 0, 14, - 0, 67, 0, 0, 0, 0, 0, 128, 360, 0, - 0, 14, 0, 67, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 14, 137, 67, 66, 0, 0, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 66, 0, - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 67 -}; - -static const short yycheck[] = { 0, - 56, 99, 150, 2, 110, 57, 3, 102, 19, 77, - 3, 19, 13, 37, 38, 149, 19, 151, 113, 3, - 3, 22, 3, 148, 98, 150, 3, 4, 5, 3, - 29, 3, 31, 8, 3, 3, 4, 5, 163, 3, - 3, 0, 3, 99, 96, 3, 43, 3, 100, 0, - 3, 52, 56, 54, 40, 56, 61, 81, 3, 4, - 5, 3, 67, 22, 65, 58, 3, 66, 142, 66, - 69, 22, 146, 3, 4, 5, 77, 3, 64, 43, - 43, 80, 43, 67, 67, 43, 67, 64, 62, 58, - 188, 40, 60, 70, 118, 67, 64, 98, 99, 67, - 152, 43, 70, 66, 103, 173, 43, 56, 176, 0, - 66, 40, 186, 66, 54, 114, 3, 128, 57, 64, - 121, 40, 67, 63, 63, 70, 320, 128, 0, 58, - 60, 22, 188, 327, 64, 54, 234, 67, 54, 58, - 70, 142, 61, 15, 16, 146, 154, 40, 67, 160, - 22, 154, 160, 154, 26, 40, 3, 160, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 61, 8, - 9, 56, 173, 279, 67, 176, 61, 40, 234, 64, - 52, 59, 3, 278, 62, 186, 281, 188, 40, 3, - 4, 5, 40, 56, 55, 58, 43, 44, 40, 46, - 348, 64, 350, 255, 3, 4, 5, 45, 46, 61, - 82, 54, 64, 61, 56, 349, 58, 351, 58, 66, - 63, 316, 64, 348, 280, 350, 332, 62, 326, 101, - 102, 40, 67, 234, 63, 236, 370, 63, 372, 263, - 264, 113, 68, 311, 369, 117, 60, 342, 40, 58, - 64, 40, 63, 67, 57, 63, 70, 68, 130, 67, - 63, 60, 40, 40, 56, 64, 58, 56, 67, 58, - 326, 70, 64, 40, 67, 276, 275, 54, 56, 280, - 58, 58, 61, 58, 285, 58, 61, 58, 289, 56, - 61, 58, 67, 44, 63, 429, 67, 431, 67, 72, - 73, 63, 174, 61, 356, 67, 6, 7, 8, 9, - 311, 11, 12, 13, 14, 57, 57, 63, 57, 65, - 418, 63, 63, 421, 63, 326, 59, 61, 352, 44, - 57, 61, 331, 67, 63, 433, 63, 67, 67, 7, - 8, 393, 440, 344, 49, 50, 51, 8, 454, 3, - 448, 457, 69, 70, 336, 337, 338, 64, 40, 339, - 340, 67, 418, 67, 3, 421, 59, 366, 367, 64, - 4, 18, 244, 3, 3, 3, 61, 433, 3, 65, - 63, 59, 3, 3, 440, 3, 65, 3, 3, 61, - 54, 68, 448, 3, 54, 3, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 62, 278, 65, 4, 281, - 60, 3, 65, 64, 40, 4, 65, 418, 60, 60, - 421, 61, 59, 68, 296, 297, 427, 3, 64, 64, - 68, 64, 433, 3, 44, 3, 46, 68, 61, 440, - 40, 65, 52, 1, 316, 3, 65, 448, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 64, 68, 17, - 64, 60, 65, 65, 336, 337, 338, 339, 340, 64, - 342, 65, 65, 64, 64, 60, 3, 65, 65, 3, - 64, 64, 68, 3, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 68, 54, 68, 64, 68, - 65, 64, 0, 65, 64, 22, 65, 1, 66, 3, - 68, 68, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 0, 1, 17, 3, 68, 65, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 3, 65, 17, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 65, - 54, 65, 70, 14, 43, 44, 45, 46, 47, 48, - 103, 280, 66, 52, 68, 54, 154, 44, 45, 46, - 52, 40, 52, 1, 369, 3, 317, 66, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 177, 1, 17, - 3, 173, 163, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 3, 167, 17, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 244, 54, 285, -1, -1, - 43, 44, 45, 46, 47, 48, -1, -1, 66, 52, - -1, 54, -1, 44, 276, 46, -1, -1, -1, -1, - -1, 52, 3, 66, -1, 6, 7, 8, 9, 10, - 11, 12, 13, 14, -1, 3, -1, 68, 6, 7, - 8, 9, 10, 11, 12, 13, 14, -1, 3, -1, - -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, - -1, -1, 43, 44, 45, 46, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 43, 44, -1, 46, -1, - -1, -1, -1, -1, -1, 66, -1, -1, -1, 44, - -1, 46, -1, -1, -1, 15, 16, 52, 66, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 3, 41, -1, 6, 7, 8, 9, 10, 11, 12, - 13, 14, -1, -1, -1, 55, 56, 57, 58, 59, - -1, -1, 62, 63, 64, -1, 66, -1, -1, 69, - 70, 71, 72, 73, 74, 75, -1, -1, -1, -1, - -1, 44, -1, 46, -1, -1, -1, -1, 3, 52, - 53, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, -1, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 3, -1, -1, 6, 7, 8, 9, 10, - 11, 12, 13, 14, -1, -1, -1, -1, -1, 44, - -1, 46, -1, -1, -1, -1, -1, 52, 53, -1, - -1, 44, -1, 46, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 44, 45, 46, 3, -1, -1, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 3, -1, - -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 44, -1, 46, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 46 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/etc/bison.simple" -/* This file comes from bison-1.28. */ - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) || (defined (__BEOS__) && defined (__MWERKS__)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ - -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX yylex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) -{ - register char *t = to; - register char *f = from; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#line 217 "/etc/bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -#ifdef YYPARSE_PARAM -int yyparse (void *); -#else -int yyparse (void); -#endif -#endif - -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -#define YYPOPSTACK (yyvsp--, yyssp--) -#endif - - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; - -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss - 1; - yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif - -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif - - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { -#ifndef YYSTACK_USE_ALLOCA - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif -#endif - } - return 2; - } - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif -#endif /* no yyoverflow */ - - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif - - goto yybackup; - yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - yystate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -yydefault: - - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (yydebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 4: -#line 422 "parser.y" -{ - log_printf("IGNORING extern \"C\" { ... } block.\n"); - free(yyvsp[-1].string); -; - break;} -case 5: -#line 427 "parser.y" -{ - yyvsp[0].elt->kind = INLINED_KIND; - log_printf("\nBEGIN matched dec : m_f_i rule --"); - print_se(yyvsp[0].elt); - log_printf("END matched dec : m_f_i rule\n"); -; - break;} -case 6: -#line 434 "parser.y" -{ - yyvsp[0].elt->kind = SKEL_KIND; - log_printf("\nBEGIN matched dec : function_skeleton rule --"); - print_se(yyvsp[0].elt); - enqueue_skeleton(yyvsp[0].elt); - log_printf("END matched dec : function_skeleton rule\n"); -; - break;} -case 8: -#line 443 "parser.y" -{ - log_printf("declaration : error. Attempting to recover...\n"); - yyerrok; - yyclearin; - if (error_recovery() != 0) { - log_printf("ERROR recovery could not complete -- YYABORT.\n"); - YYABORT; - } - log_printf("ERROR recovery complete.\n"); -; - break;} -case 9: -#line 457 "parser.y" -{ - /* the name of the rule "member_specifier" might be misleading, but - * this is either a class, struct, union, enum, global var, global - * prototype, etc.. */ - if (yyvsp[0].elt->kind == CLASS_KIND || yyvsp[0].elt->kind == STRUCT_KIND) { - enqueue_class(yyvsp[0].elt); - } else { - log_printf("\nIGNORING dec_spec : mem_spec (%s) --", - string_kind(yyvsp[0].elt->kind)); - print_se(yyvsp[0].elt); - log_printf("END IGNORING dec_spec : mem_spec (%s)\n", - string_kind(yyvsp[0].elt->kind)); - } -; - break;} -case 11: -#line 476 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), yyvsp[0].string, NULL, IGNORE_KIND); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 12: -#line 483 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), yyvsp[0].string, NULL, IGNORE_KIND); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 14: -#line 493 "parser.y" -{ yyval.flag = 0; ; - break;} -case 15: -#line 494 "parser.y" -{ yyval.flag = 1; ; - break;} -case 16: -#line 499 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + (yyvsp[0].flag ? 2 : 0) + 1); - strcpy(tmp_str, yyvsp[-1].string); - if (yyvsp[0].flag) - strcat(tmp_str, " &"); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 17: -#line 508 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + (yyvsp[0].flag ? 2 : 0) + 7); - sprintf(tmp_str, "const %s%s", yyvsp[-1].string, (yyvsp[0].flag ? " &" : "")); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 18: -#line 517 "parser.y" -{ free(yyvsp[0].string); ; - break;} -case 19: -#line 518 "parser.y" -{ free(yyvsp[0].string); ; - break;} -case 20: -#line 519 "parser.y" -{ free(yyvsp[0].string); ; - break;} -case 21: -#line 520 "parser.y" -{ free(yyvsp[0].string); ; - break;} -case 24: -#line 527 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 8); - strcpy(tmp_str, "struct "); - strcat(tmp_str, yyvsp[0].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 25: -#line 535 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-3].string) + strlen(yyvsp[-1].string) + 3); - sprintf(tmp_str, "%s<%s>", yyvsp[-3].string, yyvsp[-1].string); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 26: -#line 543 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-3].string) + strlen(yyvsp[-1].string) + 3); - sprintf(tmp_str, "%s<%s>", yyvsp[-3].string, yyvsp[-1].string); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 27: -#line 551 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-4].string) + strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s<%s> %s", yyvsp[-4].string, yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-4].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 28: -#line 560 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-4].string) + strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s<%s> %s", yyvsp[-4].string, yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-4].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 29: -#line 569 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 30: -#line 577 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 31: -#line 585 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 9); - sprintf(tmp_str, "struct %s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 33: -#line 594 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 35: -#line 606 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 8); - strcpy(tmp_str,"signed "); - strcat(tmp_str, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 36: -#line 615 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 10); - strcpy(tmp_str,"unsigned "); - strcat(tmp_str, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 39: -#line 629 "parser.y" -{ - yyval.string = strdup("short int"); - free(yyvsp[-1].string); - free(yyvsp[0].string); -; - break;} -case 42: -#line 637 "parser.y" -{ - yyval.string = strdup("long int"); - free(yyvsp[-1].string); - free(yyvsp[0].string); -; - break;} -case 43: -#line 643 "parser.y" -{ - yyval.string = strdup("long long"); - free(yyvsp[-1].string); - free(yyvsp[0].string); -; - break;} -case 44: -#line 649 "parser.y" -{ - yyval.string = strdup("long long int"); - free(yyvsp[-2].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); -; - break;} -case 49: -#line 663 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s::%s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 50: -#line 671 "parser.y" -{ - /* control-Y programming! */ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s::%s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 52: -#line 684 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 1); - strcpy(tmp_str,yyvsp[-1].string); - strcat(tmp_str,yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 53: -#line 695 "parser.y" -{ yyval.string = strdup("*"); ; - break;} -case 54: -#line 696 "parser.y" -{ yyval.string = strdup("*const "); ; - break;} -case 55: -#line 701 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = yyvsp[-1].string; - new_arg->name = yyvsp[0].string; - new_arg->array = NULL; - new_arg->next = NULL; - yyval.arg = new_arg; -; - break;} -case 56: -#line 710 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = yyvsp[-1].string; - new_arg->name = yyvsp[0].string; - new_arg->array = NULL; - new_arg->next = NULL; - yyval.arg = new_arg; -; - break;} -case 57: -#line 719 "parser.y" -{ - char *old_array = yyvsp[-3].arg->array; - int old_len = old_array ? strlen(old_array) : 0; - yyvsp[-3].arg->array = (char *) malloc(strlen(yyvsp[-1].string) + old_len + 3); - sprintf(yyvsp[-3].arg->array, "%s[%s]", old_array ? old_array : "", yyvsp[-1].string); - free(yyvsp[-1].string); - if (old_array) - free(old_array); - yyval.arg = yyvsp[-3].arg; -; - break;} -case 58: -#line 730 "parser.y" -{ - char *old_array = yyvsp[-2].arg->array; - int old_len = old_array ? strlen(old_array) : 0; - yyvsp[-2].arg->array = (char *) malloc(old_len + 3); - sprintf(yyvsp[-2].arg->array, "%s[]", old_array ? old_array : ""); - if (old_array) - free(old_array); - yyval.arg = yyvsp[-2].arg; -; - break;} -case 60: -#line 743 "parser.y" -{ free(yyvsp[0].string); yyval.string = yyvsp[-2].string;; - break;} -case 62: -#line 749 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 63: -#line 757 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-3].string) + strlen(yyvsp[-1].string) + 3); - sprintf(tmp_str, "%s[%s]", yyvsp[-3].string, yyvsp[-1].string); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 64: -#line 765 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + 3); - strcpy(tmp_str, yyvsp[-2].string); - strcat(tmp_str, "[]"); - free(yyvsp[-2].string); - yyval.string = tmp_str; -; - break;} -case 66: -#line 776 "parser.y" -{ yyval.arg = yyvsp[0].arg; ; - break;} -case 67: -#line 778 "parser.y" -{ - free(yyvsp[0].string); - yyval.arg = yyvsp[-2].arg; -; - break;} -case 68: -#line 786 "parser.y" -{ - yyval.string = args_to_string(yyvsp[0].arg, 0); - free_args(yyvsp[0].arg); -; - break;} -case 69: -#line 791 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s, %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 70: -#line 802 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 2); - sprintf(tmp_str, "%s;", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 71: -#line 809 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[-1].string) + 3); - sprintf(tmp_str, "%s\n%s;", yyvsp[-2].string, yyvsp[-1].string); - free(yyvsp[-2].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 72: -#line 820 "parser.y" -{ - yyval.arg = NULL; -; - break;} -case 73: -#line 824 "parser.y" -{ - yyval.arg = reverse_arg_list(yyvsp[0].arg); -; - break;} -case 74: -#line 828 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = strdup("..."); - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = yyvsp[-2].arg; - yyval.arg = reverse_arg_list(new_arg); -; - break;} -case 75: -#line 837 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = strdup("..."); - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - yyval.arg = new_arg; -; - break;} -case 78: -#line 851 "parser.y" -{ - yyvsp[0].arg->next = yyvsp[-2].arg; - yyval.arg = yyvsp[0].arg; -; - break;} -case 79: -#line 856 "parser.y" -{ - yyvsp[0].arg->next = yyvsp[-2].arg; - yyval.arg = yyvsp[0].arg; -; - break;} -case 80: -#line 864 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = yyvsp[0].string; - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - yyval.arg = new_arg; -; - break;} -case 81: -#line 873 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = yyvsp[-2].string; - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - free(yyvsp[0].string); - yyval.arg = new_arg; -; - break;} -case 82: -#line 883 "parser.y" -{ - char *old_array = yyvsp[-3].arg->array; - int old_len = old_array ? strlen(old_array) : 0; - yyvsp[-3].arg->array = (char *) malloc(strlen(yyvsp[-1].string) + old_len + 3); - sprintf(yyvsp[-3].arg->array, "%s[%s]", old_array ? old_array : "", yyvsp[-1].string); - free(yyvsp[-1].string); - if (old_array) - free(old_array); - yyval.arg = yyvsp[-3].arg; -; - break;} -case 83: -#line 894 "parser.y" -{ - char *old_array = yyvsp[-2].arg->array; - int old_len = old_array ? strlen(old_array) : 0; - yyvsp[-2].arg->array = (char *) malloc(old_len + 3); - sprintf(yyvsp[-2].arg->array, "%s[]", old_array ? old_array : ""); - if (old_array) - free(old_array); - yyval.arg = yyvsp[-2].arg; -; - break;} -case 85: -#line 908 "parser.y" -{ if (collectMemberInitList() != 0) YYERROR; ; - break;} -case 87: -#line 910 "parser.y" -{ - /* I think this is the correct behavior, but skel_elemcmp is wrong */ - /* $2->templ = $1; */ - free(yyvsp[-2].string); - yyval.elt = yyvsp[-1].elt; -; - break;} -case 88: -#line 917 "parser.y" -{ if (collectMemberInitList() != 0) YYERROR; ; - break;} -case 89: -#line 918 "parser.y" -{ - /* I think this is the correct behavior, but skel_elemcmp is wrong */ - /* $2->templ = $1; */ - free(yyvsp[-4].string); - yyval.elt = yyvsp[-3].elt; -; - break;} -case 91: -#line 929 "parser.y" -{ if (collectMemberInitList() != 0) YYERROR; ; - break;} -case 93: -#line 934 "parser.y" -{ - yyvsp[-2].elt->const_flag = yyvsp[-1].flag; - yyvsp[-2].elt->throw_decl = yyvsp[0].string; - yyval.elt = yyvsp[-2].elt; -; - break;} -case 96: -#line 945 "parser.y" -{ - yyvsp[-2].elt->const_flag = yyvsp[-1].flag; - yyvsp[-2].elt->throw_decl = yyvsp[0].string; - yyval.elt = yyvsp[-2].elt; -; - break;} -case 99: -#line 957 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-4].string, yyvsp[-3].string, yyvsp[-1].arg, FUNC_KIND); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 100: -#line 964 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-9].string, - (char *) malloc(strlen(yyvsp[-8].string) + strlen(yyvsp[-6].string) + strlen(yyvsp[-3].string) + 5), - yyvsp[-1].arg, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", yyvsp[-8].string, yyvsp[-6].string, yyvsp[-3].string); - free(yyvsp[-8].string); - free(yyvsp[-6].string); - free(yyvsp[-3].string); - yyval.elt = elem; -; - break;} -case 102: -#line 982 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-4].string, yyvsp[-3].string, yyvsp[-1].arg, FUNC_KIND); - print_se(elem); - yyval.elt = elem; -; - break;} -case 104: -#line 993 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-7].string, (char *)malloc(strlen(yyvsp[-6].string) + strlen(yyvsp[-3].string) + 12), - yyvsp[-1].arg, FUNC_KIND); - sprintf(elem->name, "%s::operator%s", yyvsp[-6].string, yyvsp[-3].string); - free(yyvsp[-6].string); - free(yyvsp[-3].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 105: -#line 1004 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *)malloc(strlen(yyvsp[-5].string) + strlen(yyvsp[-2].string) + 13), - NULL, FUNC_KIND); - sprintf(elem->name, "%s::operator %s", yyvsp[-5].string, yyvsp[-2].string); - free(yyvsp[-5].string); - free(yyvsp[-2].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 106: -#line 1016 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-7].string, (char *)malloc(strlen(yyvsp[-6].string) + strlen(yyvsp[-3].string) + 12), - yyvsp[-1].arg, FUNC_KIND); - sprintf(elem->name, "%s::operator%s", yyvsp[-6].string, yyvsp[-3].string); - free(yyvsp[-6].string); - free(yyvsp[-3].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 107: -#line 1027 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *)malloc(strlen(yyvsp[-5].string) + strlen(yyvsp[-2].string) + 13), - NULL, FUNC_KIND); - sprintf(elem->name, "%s::operator %s", yyvsp[-5].string, yyvsp[-2].string); - free(yyvsp[-5].string); - free(yyvsp[-2].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 108: -#line 1042 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-5].string, (char *)malloc(strlen(yyvsp[-3].string) + 9), - yyvsp[-1].arg, FUNC_KIND); - sprintf(elem->name, "operator%s", yyvsp[-3].string); - free(yyvsp[-3].string); - print_se(elem); - yyval.elt = elem; -; - break;} -case 109: -#line 1052 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), (char *)malloc(strlen(yyvsp[-2].string) + 10), - NULL, FUNC_KIND); - sprintf(elem->name, "operator %s", yyvsp[-2].string); - free(yyvsp[-2].string); - print_se(elem); - yyval.elt = elem; -; - break;} -case 110: -#line 1064 "parser.y" -{ yyval.flag = 0; ; - break;} -case 111: -#line 1065 "parser.y" -{ yyval.flag = 1; ; - break;} -case 112: -#line 1069 "parser.y" -{ yyval.string = NULL; ; - break;} -case 113: -#line 1071 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 8); - sprintf(tmp_str, "throw(%s)", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 115: -#line 1082 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s, %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 116: -#line 1093 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), (char *) malloc(strlen(yyvsp[-2].string) + 2), - NULL, FUNC_KIND); - sprintf(elem->name,"~%s", yyvsp[-2].string); - free(yyvsp[-2].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 117: -#line 1106 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-5].string) + strlen(yyvsp[-2].string) + 4), - NULL, FUNC_KIND); - sprintf(elem->name,"%s::~%s", yyvsp[-5].string, yyvsp[-2].string); - free(yyvsp[-5].string); - free(yyvsp[-2].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 118: -#line 1118 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-5].string) + strlen(yyvsp[-2].string) + 4), - NULL, FUNC_KIND); - sprintf(elem->name,"%s::~%s", yyvsp[-5].string, yyvsp[-2].string); - free(yyvsp[-5].string); - free(yyvsp[-2].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 119: -#line 1130 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-8].string) + strlen(yyvsp[-6].string) + strlen(yyvsp[-2].string) + 6), - NULL, FUNC_KIND); - sprintf(elem->name,"%s<%s>::~%s", yyvsp[-8].string, yyvsp[-6].string, yyvsp[-2].string); - free(yyvsp[-8].string); - free(yyvsp[-6].string); - free(yyvsp[-2].string); - yyval.elt = elem; -; - break;} -case 120: -#line 1142 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-8].string) + strlen(yyvsp[-6].string) + strlen(yyvsp[-2].string) + 6), - NULL, FUNC_KIND); - sprintf(elem->name,"%s<%s>::~%s", yyvsp[-8].string, yyvsp[-6].string, yyvsp[-2].string); - free(yyvsp[-8].string); - free(yyvsp[-6].string); - free(yyvsp[-2].string); - yyval.elt = elem; -; - break;} -case 121: -#line 1157 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), yyvsp[-4].string, yyvsp[-2].arg, FUNC_KIND); - elem->throw_decl = yyvsp[0].string; -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 122: -#line 1168 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), yyvsp[-4].string, yyvsp[-2].arg, FUNC_KIND); - elem->throw_decl = yyvsp[0].string; -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 123: -#line 1176 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-9].string) + strlen(yyvsp[-7].string) + strlen(yyvsp[-4].string) + 5), - yyvsp[-2].arg, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", yyvsp[-9].string, yyvsp[-7].string, yyvsp[-4].string); - free(yyvsp[-9].string); - free(yyvsp[-7].string); - free(yyvsp[-4].string); - elem->throw_decl = yyvsp[0].string; - yyval.elt = elem; -; - break;} -case 124: -#line 1189 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-9].string) + strlen(yyvsp[-7].string) + strlen(yyvsp[-4].string) + 5), - yyvsp[-2].arg, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", yyvsp[-9].string, yyvsp[-7].string, yyvsp[-4].string); - free(yyvsp[-9].string); - free(yyvsp[-7].string); - free(yyvsp[-4].string); - elem->throw_decl = yyvsp[0].string; - yyval.elt = elem; -; - break;} -case 125: -#line 1204 "parser.y" -{ if (collectInlineDef() != 0) YYERROR; ; - break;} -case 127: -#line 1209 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 10); - sprintf(tmp_str, "enum { %s }", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 128: -#line 1216 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-3].string) + strlen(yyvsp[-1].string) + 11); - sprintf(tmp_str, "enum %s { %s }", yyvsp[-3].string, yyvsp[-1].string); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 129: -#line 1224 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 6); - sprintf(tmp_str, "enum %s", yyvsp[0].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 131: -#line 1235 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s, %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 133: -#line 1247 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s=%s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 141: -#line 1273 "parser.y" -{ yyval.string = strdup("&"); ; - break;} -case 142: -#line 1274 "parser.y" -{ yyval.string = strdup("*"); ; - break;} -case 143: -#line 1275 "parser.y" -{ yyval.string = strdup("+"); ; - break;} -case 144: -#line 1276 "parser.y" -{ yyval.string = strdup("-"); ; - break;} -case 145: -#line 1277 "parser.y" -{ yyval.string = strdup("~"); ; - break;} -case 146: -#line 1278 "parser.y" -{ yyval.string = strdup("!"); ; - break;} -case 147: -#line 1282 "parser.y" -{ yyval.string = strdup("/"); ; - break;} -case 148: -#line 1283 "parser.y" -{ yyval.string = strdup("%"); ; - break;} -case 149: -#line 1284 "parser.y" -{ yyval.string = strdup("^"); ; - break;} -case 150: -#line 1285 "parser.y" -{ yyval.string = strdup("|"); ; - break;} -case 151: -#line 1286 "parser.y" -{ yyval.string = strdup("<"); ; - break;} -case 152: -#line 1287 "parser.y" -{ yyval.string = strdup(">"); ; - break;} -case 153: -#line 1288 "parser.y" -{ yyval.string = strdup(","); ; - break;} -case 154: -#line 1292 "parser.y" -{ yyval.string = strdup("="); ; - break;} -case 155: -#line 1293 "parser.y" -{ yyval.string = strdup("*="); ; - break;} -case 156: -#line 1294 "parser.y" -{ yyval.string = strdup("/="); ; - break;} -case 157: -#line 1295 "parser.y" -{ yyval.string = strdup("%="); ; - break;} -case 158: -#line 1296 "parser.y" -{ yyval.string = strdup("+="); ; - break;} -case 159: -#line 1297 "parser.y" -{ yyval.string = strdup("-="); ; - break;} -case 160: -#line 1298 "parser.y" -{ yyval.string = strdup("<<="); ; - break;} -case 161: -#line 1299 "parser.y" -{ yyval.string = strdup(">>="); ; - break;} -case 162: -#line 1300 "parser.y" -{ yyval.string = strdup("&="); ; - break;} -case 163: -#line 1301 "parser.y" -{ yyval.string = strdup("^="); ; - break;} -case 164: -#line 1302 "parser.y" -{ yyval.string = strdup("|="); ; - break;} -case 168: -#line 1309 "parser.y" -{ yyval.string = strdup(" new"); ; - break;} -case 169: -#line 1310 "parser.y" -{ yyval.string = strdup(" delete"); ; - break;} -case 170: -#line 1311 "parser.y" -{ yyval.string = strdup("->"); ; - break;} -case 171: -#line 1312 "parser.y" -{ yyval.string = strdup("->*"); ; - break;} -case 172: -#line 1313 "parser.y" -{ yyval.string = strdup("++"); ; - break;} -case 173: -#line 1314 "parser.y" -{ yyval.string = strdup("--"); ; - break;} -case 174: -#line 1315 "parser.y" -{ yyval.string = strdup("<<"); ; - break;} -case 175: -#line 1316 "parser.y" -{ yyval.string = strdup(">>"); ; - break;} -case 176: -#line 1317 "parser.y" -{ yyval.string = strdup("<="); ; - break;} -case 177: -#line 1318 "parser.y" -{ yyval.string = strdup(">="); ; - break;} -case 178: -#line 1319 "parser.y" -{ yyval.string = strdup("=="); ; - break;} -case 179: -#line 1320 "parser.y" -{ yyval.string = strdup("!="); ; - break;} -case 180: -#line 1321 "parser.y" -{ yyval.string = strdup("&&"); ; - break;} -case 181: -#line 1322 "parser.y" -{ yyval.string = strdup("||"); ; - break;} -case 182: -#line 1323 "parser.y" -{ yyval.string = strdup("[]"); ; - break;} -case 183: -#line 1324 "parser.y" -{ yyval.string = strdup("()"); ; - break;} -case 185: -#line 1329 "parser.y" -{ yyval.string = strdup("{ ... }"); ; - break;} -case 188: -#line 1339 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "-%s", yyvsp[0].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 192: -#line 1349 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 3); - sprintf(tmp_str, "(%s)", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 194: -#line 1360 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s * %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 195: -#line 1368 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s / %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 196: -#line 1376 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s %% %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 198: -#line 1388 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s + %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 199: -#line 1396 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s - %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 200: -#line 1408 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-3].string) + strlen(yyvsp[-1].string) + 12); - sprintf(tmp_str, "union %s { %s }", yyvsp[-3].string, yyvsp[-1].string); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 201: -#line 1416 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 11); - sprintf(tmp_str, "union { %s }", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 202: -#line 1423 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 7); - sprintf(tmp_str, "union %s", yyvsp[0].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 203: -#line 1433 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-3].string, NULL, CLASS_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 204: -#line 1446 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-5].string, NULL, CLASS_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 205: -#line 1459 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-3].string, NULL, CLASS_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - tmp_elem->templ = yyvsp[-5].string; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 206: -#line 1473 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-5].string, NULL, CLASS_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - tmp_elem->templ = yyvsp[-7].string; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 207: -#line 1487 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), "unnamed_struct", - NULL, IGNORE_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 208: -#line 1501 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-3].string, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 209: -#line 1514 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-5].string, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 210: -#line 1527 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-3].string, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - tmp_elem->templ = yyvsp[-5].string; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 211: -#line 1541 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-5].string, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - tmp_elem->templ = yyvsp[-7].string; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 214: -#line 1562 "parser.y" -{ free(yyvsp[0].string); ; - break;} -case 215: -#line 1566 "parser.y" -{ yyvsp[0].elt->kind = IGNORE_KIND; ; - break;} -case 217: -#line 1571 "parser.y" -{ yyval.elt = NULL; ; - break;} -case 219: -#line 1577 "parser.y" -{ - if (yyvsp[0].elt != NULL) - yyvsp[0].elt->next = NULL; - - yyval.elt = yyvsp[0].elt; -; - break;} -case 220: -#line 1584 "parser.y" -{ - if (yyvsp[0].elt != NULL) { - yyvsp[0].elt->next = yyvsp[-1].elt; - yyval.elt = yyvsp[0].elt; - } else { - yyval.elt = yyvsp[-1].elt; - } -; - break;} -case 222: -#line 1597 "parser.y" -{ - log_printf("member_with_access : error. Attempting to recover...\n"); - yyerrok; - yyclearin; - if (error_recovery() != 0) { - log_printf("ERROR recovery could not complete -- YYABORT.\n"); - YYABORT; - } - log_printf("ERROR recovery complete.\n"); - yyval.elt = NULL; -; - break;} -case 224: -#line 1612 "parser.y" -{ yyval.elt = yyvsp[0].elt; ; - break;} -case 226: -#line 1617 "parser.y" -{ yyval.elt = NULL; ; - break;} -case 227: -#line 1618 "parser.y" -{ yyvsp[0].elt->kind = INLINED_KIND; yyval.elt = yyvsp[0].elt; ; - break;} -case 228: -#line 1619 "parser.y" -{ yyval.elt = NULL; ; - break;} -case 229: -#line 1624 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), yyvsp[0].string, NULL, IGNORE_KIND); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 231: -#line 1631 "parser.y" -{ yyval.elt = yyvsp[0].elt; ; - break;} -case 232: -#line 1632 "parser.y" -{ yyvsp[-2].elt->kind = IGNORE_KIND; free(yyvsp[0].string); yyval.elt = yyvsp[-2].elt; ; - break;} -case 235: -#line 1638 "parser.y" -{ free(yyvsp[0].string); yyval.elt = yyvsp[-1].elt; ; - break;} -case 237: -#line 1641 "parser.y" -{ - free(yyvsp[-1].string); - yyval.elt = yyvsp[-3].elt; -; - break;} -case 238: -#line 1649 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 7); - sprintf(tmp_str, "class %s", yyvsp[0].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 239: -#line 1656 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 241: -#line 1668 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s, %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 245: -#line 1685 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s, %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 246: -#line 1696 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 12); - sprintf(tmp_str, "template <%s>", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 543 "/etc/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++yyvsp = yyval; - -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -yyerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); - } - - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - yystate = yyn; - goto yynewstate; - - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { -#ifndef YYSTACK_USE_ALLOCA - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif -#endif - } - return 0; - - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) - { -#ifndef YYSTACK_USE_ALLOCA - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif -#endif - } - return 1; -} -#line 1704 "parser.y" - - -static int yyerror(char *s /*UNUSED*/) -{ - if (outfile != NULL) - fflush(outfile); - - return 0; -} - -static int error_recovery() -{ - extern char linebuf[]; - extern int lineno; - extern int column; - extern int tokens_seen; - -#ifdef SGDEBUG - log_printf("parse error at line %d, file %s:\n%s\n%*s\n", - lineno, currentFile, linebuf, column, "^"); - log_flush(); -#endif /* SGDEBUG */ - - if (tokens_seen == 0) { - /* - * if we've seen no tokens but we're in an error, we must have - * hit an EOF, either by stdin, or on a file. Just give up - * now instead of complaining. - */ - return -1; - - } else { - fprintf(stderr, "parse error at line %d, file %s:\n%s\n%*s\n", - lineno, currentFile, linebuf, column, "^"); - } - - linebuf[0] = '\0'; - - for (;;) { - int result = yylex(); - - if (result <= 0) { - /* fatal error: Unexpected EOF during parse error recovery */ - -#ifdef SGDEBUG - log_printf("EOF in error recovery, line %d, file %s\n", - lineno, currentFile); - log_flush(); -#endif /* SGDEBUG */ - - fprintf(stderr, "EOF in error recovery, line %d, file %s\n", - lineno, currentFile); - - return -1; - } - - switch(result) { - case IDENTIFIER: - case CONSTANT: - case STRING_LITERAL: - case CHAR: - case SHORT: - case INT: - case LONG: - case SIGNED: - case UNSIGNED: - case FLOAT: - case DOUBLE: - case VOID: - free(yylval.string); - break; - case (int) '{': - if (collectInlineDef() != 0) - return -1; - result = yylex(); - return 0; - case (int) ';': - return 0; - } - } -} diff --git a/bepascal/bepascal/stubgen.so/y.tab.h b/bepascal/bepascal/stubgen.so/y.tab.h deleted file mode 100644 index 90828eb..0000000 --- a/bepascal/bepascal/stubgen.so/y.tab.h +++ /dev/null @@ -1,60 +0,0 @@ -typedef union { - char *string; - syntaxelem_t *elt; - arg_t *arg; - int flag; -} YYSTYPE; -#define IDENTIFIER 257 -#define CONSTANT 258 -#define STRING_LITERAL 259 -#define CHAR 260 -#define SHORT 261 -#define INT 262 -#define LONG 263 -#define SIGNED 264 -#define UNSIGNED 265 -#define FLOAT 266 -#define DOUBLE 267 -#define VOID 268 -#define NEW 269 -#define DELETE 270 -#define TEMPLATE 271 -#define THROW 272 -#define PTR_OP 273 -#define INC_OP 274 -#define DEC_OP 275 -#define LEFT_OP 276 -#define RIGHT_OP 277 -#define LE_OP 278 -#define GE_OP 279 -#define EQ_OP 280 -#define NE_OP 281 -#define AND_OP 282 -#define OR_OP 283 -#define MUL_ASSIGN 284 -#define DIV_ASSIGN 285 -#define MOD_ASSIGN 286 -#define ADD_ASSIGN 287 -#define SUB_ASSIGN 288 -#define LEFT_ASSIGN 289 -#define RIGHT_ASSIGN 290 -#define AND_ASSIGN 291 -#define XOR_ASSIGN 292 -#define OR_ASSIGN 293 -#define CLCL 294 -#define MEM_PTR_OP 295 -#define FRIEND 296 -#define OPERATOR 297 -#define CONST 298 -#define CLASS 299 -#define STRUCT 300 -#define UNION 301 -#define ENUM 302 -#define PROTECTED 303 -#define PRIVATE 304 -#define PUBLIC 305 -#define EXTERN 306 -#define ELIPSIS 307 - - -extern YYSTYPE yylval; diff --git a/bepascal/bepascal/stubgen/COPYING b/bepascal/bepascal/stubgen/COPYING deleted file mode 100644 index 60549be..0000000 --- a/bepascal/bepascal/stubgen/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/bepascal/bepascal/stubgen/Example Usage for OpenBeOS.txt b/bepascal/bepascal/stubgen/Example Usage for OpenBeOS.txt deleted file mode 100644 index 402cfb8..0000000 --- a/bepascal/bepascal/stubgen/Example Usage for OpenBeOS.txt +++ /dev/null @@ -1,3 +0,0 @@ -Example usage for OpenBeOS project: - -stubgen -s -g -a *.h diff --git a/bepascal/bepascal/stubgen/Makefile b/bepascal/bepascal/stubgen/Makefile deleted file mode 100644 index 5c5f68c..0000000 --- a/bepascal/bepascal/stubgen/Makefile +++ /dev/null @@ -1,90 +0,0 @@ -# -# FILE: Makefile -# AUTH: Michael John Radwin -# -# DESC: stubgen makefile -# modified from O'Reilly's lex & yacc, Second Edition -# -# DATE: Wed Aug 14 18:11:18 US/Eastern 1996 -# $Id: Makefile,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ -# -# Copyright (c) 1996-1998 Michael John Radwin -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -# --- User-definable stuff. Edit if you know what you're doing. --- # - -# Choose your compiler. I like Sun's cc compiler because I use dbx for -# debugging, but you might want gcc. -CC = gcc -Wall -g -#CC = cc - -# You'll need to use a lexer that supports the exclusive start state -# mechanism (the '%x' directive). GNU Flex does this just fine. -LEX = flex -#LEX = lex - -# You should be able to use any of the 3 common flavors of yacc: -# AT&T Yacc, Berkeley Yacc, or GNU Bison. We've tested with bison. -#YACC = yacc -d -YACC = bison -y -d -#YACC = byacc -d - -# etags is used purely for development purposes. -ETAGS = etags - -# for Sun cc, we don't like incremental linking. -#LFLAGS = -xildoff - -# for a lex other than GNU Flex, we must link with the -ll library. -#LFLAGS = -ll - -# Debug settings are on. Having the SGDEBUG macro defined will make -# generate 'stubgen.log' files on each execution of stubgen, which are -# useful for debugging, but probably annoying. -CFLAGS = -g -DSGDEBUG -#CFLAGS = -O - -# --- You probably shouldn't edit anything below this line. --- # -OFILES = y.tab.o lex.yy.o table.o util.o pathname.o main.o getopt.o -SRCFILES = lexer.l parser.y table.[ch] util.[ch] pathname.[ch] main.c - -all: stubgen - -stubgen: $(OFILES) - $(CC) $(CFLAGS) -o $@ $(OFILES) $(LFLAGS) $(LIBS) - chmod 0755 $@ - -y.output: parser.y - $(YACC) -v parser.y - -lex.yy.c: lexer.l y.tab.h - $(LEX) lexer.l - -y.tab.h y.tab.c: parser.y - $(YACC) parser.y - -tags: TAGS -TAGS: $(SRCFILES) - $(ETAGS) $(SRCFILES) - -clean: - rm -f $(OFILES) TAGS - rm -f y.tab.h y.tab.c lex.yy.c y.output stubgen.log - rm -f win32/stubgen.plg win32/stubgen.ncb win32/stubgen.opt - rm -f win32/stubgen.pdb win32/stubgen.ilk - rm -f win32/stubgen.mak win32/stubgen.bsc win32/stubgen.log - rm -rf win32/Debug win32/debug diff --git a/bepascal/bepascal/stubgen/README b/bepascal/bepascal/stubgen/README deleted file mode 100644 index a886c5f..0000000 --- a/bepascal/bepascal/stubgen/README +++ /dev/null @@ -1,147 +0,0 @@ -stubgen README file -Michael John Radwin -$Id: README,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - - -Description ------------ -Welcome to stubgen version 2.05 (build 1086). - -stubgen is a C++ development tool that keeps code files in sync with -their associated headers. When it finds a member function declaration -in a header file that doesn't have a corresponding implementation, it -creates an empty skeleton with descriptive comment headers. stubgen has -several options, but see the "Brief Example" section below for an idea -of what it can do. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2 of the License, or (at your -option) any later version. - -This program 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 -General Public License for more details. - - -Brief Example -------------- -Suppose you have the following header file Point.h: - - class Point { - public: - Point(int x, int y); - void addTo(const Point& other); - - int xValue, yValue; - }; - -Running "stubgen -s Point.h" would produce the following file: - - /*********************************************** - * AUTHOR: Michael John Radwin - * FILE: Point.cpp - * DATE: Mon Apr 20 17:39:05 1998 - * DESCR: - ***********************************************/ - #include "Point.h" - - /* - * Method: Point::Point() - * Descr: - */ - Point::Point(int x, int y) - { - } - - /* - * Method: Point::addTo() - * Descr: - */ - void - Point::addTo(const Point& other) - { - } - - -Supported Platforms -------------------- -I've successfully built stubgen on the following platforms, using the -GNU tools make, gcc, bison, and flex: - - SPARC Solaris (2.5 and 2.6) - SunOS 4.1.3 - SGI IRIX 5.3 - RS6000 AIX 3.2 - MS Windows NT 4.0 (using GNU bison/flex and MSVC++ 5.0) - - -Home Page ---------- -Check out the stubgen home page and download the current source code at: - - http://www.radwin.org/michael/projects/stubgen/ - - -Files ------ -The following files are included in this distribution: - - COPYING - the GNU general public license - ChangeLog - a listing of changes made on various versions. - Makefile - a makefile for building stubgen on unix - README - this file - etc/ - debugging routines for use with the -d option - getopt.[ch] - GNU getopts (for Win32) - lexer.l - flex source, generates tokens - main.c - code generation routines - parser.y - yacc source, parses header and code files - pathname.[ch] - dirname() and basename() routines - stubgen.1 - nroff-able man page - table.[ch] - data structures used in parsing - util.[ch] - utilities, logging routines, used in parsing - test/ - test header files for stubgen - win32/ - MS Visual C++ 5.0 project (Win32 console app) - - -Building --------- -1. ensure that your system has 'flex' installed. -2. ensure that your system has 'yacc', 'byacc', or 'bison' installed. -3. edit 'Makefile' and pick your favorite CC, LEX, YACC, LFLAGS and CFLAGS -4. run 'make' - -We assume that flex, bison, and cc/gcc are in your path. - -For win32, there's no need to build. You'll find stubgen.exe in the -directory .\win32. - - -Installing ----------- -There is no fancy installation procedure. Since the binary doesn't -depend on any other files, copy it to /usr/local/bin or wherever you -choose. You may wish to copy stubgen.1 to /usr/local/man/man1 or some -similar directory. - - -Acknowledgments ----------------- -stubgen borrows code from: - -Jutta Degener's 1995 ANSI C grammar (based on Jeff Lee's 1985 -implementation): -ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z -http://www.lysator.liu.se/c/ANSI-C-grammar-l.html -http://www.lysator.liu.se/c/ANSI-C-grammar-y.html - -Graham D. Parrington's Stub Generator for the Arjuna project at the -University of Newcastle upon Tyne: -http://arjuna.ncl.ac.uk/ - - -Copyright ---------- -stubgen is Copyright (c) 1996-1998 Michael John Radwin, under the terms -of the GNU General Public License. See COPYING for more. diff --git a/bepascal/bepascal/stubgen/getopt.c b/bepascal/bepascal/stubgen/getopt.c deleted file mode 100644 index d87c250..0000000 --- a/bepascal/bepascal/stubgen/getopt.c +++ /dev/null @@ -1,826 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -#define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -#include -#include -#endif /* GNU C library. */ - -#ifdef VMS -#include -#if HAVE_STRING_H - 0 -#include -#endif -#endif - -#if defined (WIN32) && !defined (__CYGWIN32__) -/* It's not Unix, really. See? Capital letters. */ -#include -#define getpid() GetCurrentProcessId() -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -#ifdef HAVE_LIBINTL_H -# include -# define _(msgid) gettext (msgid) -#else -# define _(msgid) (msgid) -#endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = NULL; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* XXX 1003.2 says this must be 1 before any call. */ -int optind = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return EOF with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -#include -#define my_index strchr -#else - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -char *getenv (); - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -#if !defined (__STDC__) || !__STDC__ -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -#endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -static const char *nonoption_flags; -static int nonoption_flags_len; - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined (__STDC__) && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined (__STDC__) && __STDC__ -static const char *_getopt_initialize (const char *); -#endif -static const char * -_getopt_initialize (optstring) - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind = 1; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - - if (posixly_correct == NULL) - { - /* Bash 2.0 puts a special variable in the environment for each - command it runs, specifying which ARGV elements are the results of - file name wildcard expansion and therefore should not be - considered as options. */ - char var[100]; - sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); - nonoption_flags = getenv (var); - if (nonoption_flags == NULL) - nonoption_flags_len = 0; - else - nonoption_flags_len = strlen (nonoption_flags); - } - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns `EOF'. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (optind == 0) - { - optstring = _getopt_initialize (optstring); - optind = 1; /* Don't scan ARGV[0], the program name. */ - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. */ -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && nonoption_flags[optind] == '1')) - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return EOF; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return EOF; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if (nameend - nextchar == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* _LIBC or not __GNU_LIBRARY__. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == EOF) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/bepascal/bepascal/stubgen/getopt.h b/bepascal/bepascal/stubgen/getopt.h deleted file mode 100644 index 0de1881..0000000 --- a/bepascal/bepascal/stubgen/getopt.h +++ /dev/null @@ -1,130 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if defined (__STDC__) && __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* _GETOPT_H */ diff --git a/bepascal/bepascal/stubgen/lex.yy.c b/bepascal/bepascal/stubgen/lex.yy.c deleted file mode 100644 index 76a7ee3..0000000 --- a/bepascal/bepascal/stubgen/lex.yy.c +++ /dev/null @@ -1,2652 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/haiku/befpc/bepascal/bepascal/stubgen/lex.yy.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 112 -#define YY_END_OF_BUFFER 113 -static yyconst short int yy_accept[320] = - { 0, - 0, 0, 0, 0, 0, 0, 113, 111, 110, 1, - 86, 111, 4, 92, 85, 111, 80, 81, 90, 89, - 77, 88, 84, 91, 46, 46, 78, 74, 93, 79, - 94, 97, 43, 82, 83, 95, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 75, 96, 76, 87, 103, 104, 102, 103, - 108, 109, 107, 108, 1, 73, 0, 51, 0, 58, - 68, 59, 0, 0, 56, 64, 54, 65, 55, 66, - 0, 49, 2, 3, 57, 50, 45, 0, 46, 0, - 46, 98, 63, 70, 72, 71, 62, 43, 60, 43, - - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 61, - 69, 100, 101, 105, 106, 47, 67, 99, 0, 49, - 3, 49, 0, 50, 45, 0, 48, 44, 53, 52, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 36, 43, 43, 43, 27, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 101, 106, 0, 49, - 0, 49, 0, 50, 48, 44, 7, 34, 43, 43, - - 43, 43, 43, 43, 13, 43, 43, 43, 43, 43, - 37, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 42, - 43, 0, 49, 25, 14, 43, 43, 43, 43, 43, - 43, 40, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 35, 43, 43, 43, 43, 33, 43, 43, 12, - 43, 17, 43, 43, 26, 43, 43, 41, 43, 8, - 28, 23, 43, 43, 43, 43, 43, 32, 43, 38, - 5, 11, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 22, 43, 43, 31, 43, 43, 43, 10, 43, - - 43, 24, 43, 43, 43, 21, 43, 29, 43, 9, - 15, 16, 39, 6, 19, 20, 18, 30, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 6, 1, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 20, 21, 22, - 23, 24, 25, 1, 26, 26, 26, 26, 27, 28, - 29, 29, 29, 29, 29, 30, 29, 29, 29, 29, - 29, 29, 29, 29, 31, 29, 29, 32, 29, 29, - 33, 34, 35, 36, 29, 1, 37, 38, 39, 40, - - 41, 42, 43, 44, 45, 29, 29, 46, 47, 48, - 49, 50, 29, 51, 52, 53, 54, 55, 56, 57, - 58, 29, 59, 60, 61, 62, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[63] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 4, 1, - 1, 1, 1, 1, 1, 4, 4, 4, 5, 5, - 5, 5, 1, 1, 1, 1, 4, 4, 4, 4, - 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, - 1, 1 - } ; - -static yyconst short int yy_base[330] = - { 0, - 0, 0, 60, 61, 62, 66, 468, 469, 469, 0, - 444, 65, 469, 443, 63, 431, 469, 469, 441, 61, - 469, 58, 69, 77, 85, 79, 443, 469, 53, 439, - 67, 469, 0, 469, 469, 438, 406, 75, 81, 45, - 62, 411, 409, 403, 55, 406, 60, 414, 84, 91, - 86, 91, 469, 84, 469, 469, 469, 469, 469, 106, - 469, 469, 469, 129, 0, 469, 138, 469, 451, 469, - 469, 469, 71, 142, 469, 469, 469, 469, 469, 441, - 436, 129, 469, 0, 469, 135, 164, 171, 157, 0, - 182, 469, 428, 469, 469, 469, 427, 0, 469, 396, - - 411, 410, 398, 399, 398, 389, 388, 102, 392, 395, - 114, 391, 385, 390, 380, 394, 119, 396, 390, 383, - 388, 141, 383, 378, 378, 121, 382, 375, 151, 469, - 469, 469, 0, 469, 0, 469, 469, 469, 189, 469, - 0, 197, 216, 469, 191, 201, 214, 216, 469, 469, - 376, 373, 371, 370, 380, 185, 382, 372, 372, 376, - 379, 374, 369, 0, 370, 375, 370, 0, 359, 354, - 355, 361, 361, 354, 356, 350, 348, 351, 351, 358, - 349, 352, 348, 342, 354, 356, 0, 0, 222, 231, - 239, 469, 245, 248, 469, 238, 0, 0, 340, 338, - - 337, 332, 341, 341, 0, 341, 334, 331, 335, 334, - 0, 343, 328, 342, 341, 336, 331, 323, 321, 332, - 327, 332, 324, 313, 110, 320, 324, 323, 311, 0, - 311, 253, 261, 0, 0, 322, 312, 311, 319, 320, - 310, 0, 317, 315, 309, 304, 300, 299, 312, 311, - 293, 0, 301, 297, 277, 282, 0, 265, 268, 0, - 256, 0, 265, 256, 0, 251, 250, 0, 253, 0, - 0, 0, 256, 259, 246, 252, 235, 0, 246, 0, - 0, 0, 233, 243, 236, 241, 235, 229, 223, 214, - 202, 0, 214, 200, 0, 207, 166, 173, 0, 165, - - 159, 0, 152, 132, 126, 0, 133, 0, 129, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 469, 307, - 312, 317, 322, 327, 329, 334, 157, 339, 344 - } ; - -static yyconst short int yy_def[330] = - { 0, - 319, 1, 320, 320, 321, 321, 319, 319, 319, 322, - 319, 323, 319, 319, 319, 324, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 325, 319, 319, 319, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 322, 319, 323, 319, 323, 319, - 319, 319, 324, 324, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 326, 319, 319, 319, 319, 319, 327, - 319, 319, 319, 319, 319, 319, 319, 325, 319, 325, - - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 319, - 319, 319, 328, 319, 329, 319, 319, 319, 319, 319, - 326, 319, 319, 319, 319, 319, 319, 327, 319, 319, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 328, 329, 319, 319, - 319, 319, 319, 319, 319, 319, 325, 325, 325, 325, - - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 319, 319, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 0, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319 - } ; - -static yyconst short int yy_nxt[532] = - { 0, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 33, 33, 33, 33, - 33, 33, 34, 8, 35, 36, 37, 33, 38, 39, - 40, 41, 33, 33, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 33, 33, 33, 53, 54, - 55, 56, 58, 58, 62, 59, 59, 63, 62, 68, - 71, 63, 78, 76, 93, 94, 60, 60, 64, 136, - 79, 80, 64, 77, 81, 72, 82, 82, 83, 96, - 97, 114, 107, 84, 86, 115, 91, 91, 69, 85, - - 86, 108, 87, 87, 74, 88, 130, 109, 89, 89, - 117, 88, 110, 118, 89, 89, 90, 132, 101, 88, - 102, 104, 133, 103, 89, 88, 105, 120, 121, 106, - 89, 123, 89, 126, 124, 128, 122, 127, 89, 129, - 134, 90, 68, 131, 319, 135, 82, 82, 125, 258, - 73, 159, 142, 142, 160, 139, 140, 259, 140, 163, - 148, 143, 144, 170, 144, 181, 164, 171, 318, 139, - 140, 69, 182, 317, 140, 143, 144, 176, 316, 86, - 144, 87, 87, 146, 315, 146, 89, 89, 147, 147, - 88, 177, 314, 145, 145, 185, 186, 86, 313, 91, - - 91, 189, 89, 189, 88, 312, 190, 190, 88, 145, - 89, 89, 89, 311, 142, 142, 310, 145, 147, 147, - 145, 145, 88, 191, 192, 202, 192, 89, 193, 203, - 193, 147, 147, 194, 194, 89, 145, 191, 192, 190, - 190, 195, 192, 195, 145, 196, 196, 309, 190, 190, - 308, 232, 307, 232, 306, 195, 233, 233, 140, 195, - 140, 196, 194, 194, 305, 194, 194, 196, 196, 196, - 233, 233, 140, 304, 303, 144, 140, 144, 233, 233, - 302, 301, 300, 196, 299, 298, 297, 296, 192, 144, - 192, 196, 295, 144, 294, 293, 292, 291, 290, 289, - - 288, 287, 192, 286, 285, 284, 192, 57, 57, 57, - 57, 57, 61, 61, 61, 61, 61, 65, 283, 65, - 65, 65, 67, 67, 67, 67, 67, 73, 73, 282, - 73, 73, 98, 98, 141, 281, 141, 141, 141, 187, - 280, 187, 187, 187, 188, 279, 188, 188, 188, 278, - 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, - 267, 266, 265, 264, 263, 262, 261, 260, 257, 256, - 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, - 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, - 235, 234, 231, 230, 229, 228, 227, 226, 225, 224, - - 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, - 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, - 201, 200, 199, 198, 197, 184, 183, 180, 179, 178, - 175, 174, 173, 172, 169, 168, 167, 166, 165, 162, - 161, 158, 157, 156, 155, 154, 153, 152, 151, 150, - 149, 138, 137, 319, 119, 116, 113, 112, 111, 100, - 99, 95, 92, 75, 74, 70, 66, 319, 7, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319 - } ; - -static yyconst short int yy_chk[532] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 4, 5, 3, 4, 5, 6, 12, - 15, 6, 22, 20, 29, 29, 3, 4, 5, 73, - 22, 22, 6, 20, 23, 15, 23, 23, 24, 31, - 31, 45, 40, 24, 26, 45, 26, 26, 12, 24, - - 25, 40, 25, 25, 73, 26, 54, 41, 26, 26, - 47, 25, 41, 47, 25, 25, 25, 60, 38, 26, - 38, 39, 60, 38, 26, 25, 39, 49, 49, 39, - 25, 50, 26, 51, 50, 52, 49, 51, 25, 52, - 64, 25, 67, 54, 74, 64, 82, 82, 50, 225, - 74, 108, 86, 86, 108, 82, 82, 225, 82, 111, - 327, 86, 86, 117, 86, 126, 111, 117, 309, 82, - 82, 67, 126, 307, 82, 86, 86, 122, 305, 87, - 86, 87, 87, 88, 304, 88, 89, 89, 88, 88, - 87, 122, 303, 87, 87, 129, 129, 91, 301, 91, - - 91, 139, 89, 139, 87, 300, 139, 139, 91, 87, - 89, 91, 91, 298, 142, 142, 297, 87, 146, 146, - 145, 145, 91, 142, 142, 156, 142, 91, 143, 156, - 143, 147, 147, 143, 143, 91, 145, 142, 142, 189, - 189, 147, 142, 147, 145, 148, 148, 296, 190, 190, - 294, 191, 293, 191, 291, 147, 191, 191, 190, 147, - 190, 148, 193, 193, 290, 194, 194, 196, 196, 148, - 232, 232, 190, 289, 288, 194, 190, 194, 233, 233, - 287, 286, 285, 196, 284, 283, 279, 277, 233, 194, - 233, 196, 276, 194, 275, 274, 273, 269, 267, 266, - - 264, 263, 233, 261, 259, 258, 233, 320, 320, 320, - 320, 320, 321, 321, 321, 321, 321, 322, 256, 322, - 322, 322, 323, 323, 323, 323, 323, 324, 324, 255, - 324, 324, 325, 325, 326, 254, 326, 326, 326, 328, - 253, 328, 328, 328, 329, 251, 329, 329, 329, 250, - 249, 248, 247, 246, 245, 244, 243, 241, 240, 239, - 238, 237, 236, 231, 229, 228, 227, 226, 224, 223, - 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, - 212, 210, 209, 208, 207, 206, 204, 203, 202, 201, - 200, 199, 186, 185, 184, 183, 182, 181, 180, 179, - - 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, - 167, 166, 165, 163, 162, 161, 160, 159, 158, 157, - 155, 154, 153, 152, 151, 128, 127, 125, 124, 123, - 121, 120, 119, 118, 116, 115, 114, 113, 112, 110, - 109, 107, 106, 105, 104, 103, 102, 101, 100, 97, - 93, 81, 80, 69, 48, 46, 44, 43, 42, 37, - 36, 30, 27, 19, 16, 14, 11, 7, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "lexer.l" -#define INITIAL 0 -#line 2 "lexer.l" -/* - * FILE: lexer.l - * AUTH: Michael John Radwin - * - * DESC: stubgen lexer. Portions borrowed from Newcastle - * University's Arjuna project (http://arjuna.ncl.ac.uk/), and - * Jeff Lee's ANSI Grammar - * (ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z) - * - * DATE: Thu Aug 15 13:10:06 EDT 1996 - * $Id: lex.yy.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Modification history: - * $Log: not supported by cvs2svn $ - * Revision 1.1 2001/11/07 10:06:07 ithamar - * Added stubgen to CVS - * - * Revision 1.33 1998/07/27 19:16:57 mradwin - * added some c++ keywords - * need to handle typename, using, and namespace - * - * Revision 1.32 1998/05/11 19:49:11 mradwin - * Version 2.03 (updated copyright information). - * - * Revision 1.31 1998/04/07 23:39:55 mradwin - * changed error-handling code significantly. functions - * like count() are now contributing to linebuf so we get correct - * parse error messages during lineno == 1 and other situations. - * also, instead of calling fatal() for collect*() functions, - * we return -1 and let the parser recover more gracefully. - * - * Revision 1.30 1998/01/12 19:39:11 mradwin - * modified rcsid - * - * Revision 1.29 1997/11/13 22:37:31 mradwin - * changed char[] to char * to make non-gcc compilers - * a little happier. We need to #define const to nothing - * for other compilers as well. - * - * Revision 1.28 1997/11/13 21:29:30 mradwin - * moved code from parser.y to main.c - * - * Revision 1.27 1997/11/13 21:10:17 mradwin - * renamed stubgen.[ly] to parser.y lexer.l - * - * Revision 1.26 1997/11/11 03:52:06 mradwin - * changed fatal() - * - * Revision 1.25 1997/11/05 03:02:02 mradwin - * Modified logging routines. - * - * Revision 1.24 1997/11/01 23:12:43 mradwin - * greatly improved error-recovery. errors no longer spill over - * into other files because the yyerror state is properly reset. - * - * Revision 1.23 1997/10/26 23:16:32 mradwin - * changed inform_user and fatal functions to use varargs - * - * Revision 1.22 1997/10/26 22:46:48 mradwin - * support macros within comments, etc. - * - * Revision 1.21 1997/10/16 19:42:48 mradwin - * added support for elipses, static member/array initializers, - * and bitfields. - * - * Revision 1.20 1997/10/16 17:36:06 mradwin - * Fixed compiler warning on win32 from and isspace() - * - * Revision 1.19 1997/10/16 17:12:59 mradwin - * handle extern "C" blocks better now, and support multi-line - * macros. still need error-checking. - * - * Revision 1.18 1997/10/15 22:09:06 mradwin - * changed tons of names. stubelem -> sytaxelem, - * stubin -> infile, stubout -> outfile, stublog -> logfile. - * - * Revision 1.17 1997/10/15 21:45:13 mradwin - * rearranged table.[ch] and util.[ch] so that util pkg - * knows nothing about syntaxelems. - * - * Revision 1.16 1997/10/15 17:42:37 mradwin - * added support for 'extern "C" { ... }' blocks. - * - * Revision 1.15 1997/09/05 19:17:06 mradwin - * works for scanning old versions, except for parameter - * names that differ between .H and .C files. - * - * Revision 1.14 1997/09/05 16:37:41 mradwin - * rcsid - * - * Revision 1.13 1997/09/05 16:34:36 mradwin - * GPL-ized code. - * - * Revision 1.12 1997/09/05 16:13:18 mradwin - * changed email address to acm.org - * - * Revision 1.11 1996/09/12 14:44:49 mjr - * Added throw decl recognition (great, another 4 bytes in syntaxelem) - * and cleaned up the grammar so that const_opt appears in far fewer - * places. const_opt is by default 0 as well, so we don't need to - * pass it as an arg to new_elem(). - * - * I also added a fix to a potential bug with the MINIT and INLIN - * exclusive start states. I think they could have been confused - * by braces within comments, so now I'm grabbing comments in those - * states as well. - * - * Revision 1.10 1996/09/12 03:46:10 mjr - * No concrete changes in code. Just added some sanity by - * factoring out code into util.[ch] and putting some prototypes - * that were in table.h into stubgen.y where they belong. - * - * Revision 1.9 1996/09/01 20:59:48 mjr - * Added collectMemberInitList() function, which is similar - * to collectInlineDef() and also the exclusive state MINIT - * - * Revision 1.8 1996/08/23 05:09:19 mjr - * fixed up some more portability things - * - * Revision 1.7 1996/08/22 02:43:47 mjr - * added parse error message (using O'Reilly p. 274) - * - * Revision 1.6 1996/08/21 18:33:50 mjr - * removed the buffer for inlines. we don't care anyway. - * now we can't overflow on inlines! - * - * Revision 1.5 1996/08/21 17:40:56 mjr - * added some cpp directives for porting to WIN32 - * - * Revision 1.4 1996/08/19 17:01:33 mjr - * no echo now - * - * Revision 1.3 1996/08/15 21:24:58 mjr - * *** empty log message *** - */ -#line 163 "lexer.l" -#include -#include -#include -#include "table.h" -#include "util.h" - -#ifdef WIN32 -/* definitions of exit, malloc, realloc, and free */ -#include -#endif - -#if 0 /* #ifdef WIN32 */ -#include "y_tab.h" -#else -#include "y.tab.h" -#endif - -#ifdef __cplusplus -#define STUB_INPUT() yyinput() -#else -#define STUB_INPUT() input() -#endif - -/* when we return a string, duplicate it so we can free it later. - we always allocate memory so we can uniformly free() it. */ -#define RETURN_STR(x) tokens_seen++; yylval.string = strdup(yytext); return(x) - -/* make that nasty union a value that will bus error if we misinterpret - the value as a pointer */ -#define RETURN_VAL(x) tokens_seen++; yylval.flag = 37; return(x) - -static const char rcsid[] = "$Id: lex.yy.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $"; - -static void count(); -static void comment(); -static void macro(); - -char linebuf[1024]; /* null-terminated at beginning of each file */ -int lineno; /* set to 1 at beginning of each file */ -int column; /* set to 0 at beginning of each file */ -int tokens_seen; /* set to 0 at beginning of each file */ - -#define INLIN 1 -#define MINIT 2 - -#line 787 "lex.yy.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 208 "lexer.l" - -#line 940 "lex.yy.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 320 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 469 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 209 "lexer.l" -{ /* - * for debugging purposes, we grab an entire - * line and buffer it, then grab tokens out of - * it. This lets us have more informative - * error messages. See yyerror() in parser.y - */ - strncpy(linebuf, yytext+1, 1024); - lineno++; - column = 0; - yyless(1); /* give back everything but \n */ - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 220 "lexer.l" -{ comment(); } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 222 "lexer.l" -{ count(); } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 223 "lexer.l" -{ macro(); /* was #.* { count(); } */ } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 225 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 226 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 227 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 228 "lexer.l" -{ count(); RETURN_VAL(EXTERN); } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 229 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 230 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 231 "lexer.l" -{ count(); RETURN_VAL(STRUCT); } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 232 "lexer.l" -{ count(); RETURN_VAL(UNION); } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 233 "lexer.l" -{ count(); RETURN_VAL(ENUM); } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 234 "lexer.l" -{ count(); RETURN_VAL(CONST); } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 235 "lexer.l" -{ count(); RETURN_VAL(TEMPLATE); } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 237 "lexer.l" -{ count(); tokens_seen++; /* FIXME */ } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 238 "lexer.l" -{ count(); tokens_seen++; /* FIXME */ } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 239 "lexer.l" -{ count(); RETURN_VAL(CLASS); /* FIXME */ } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 241 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 242 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 244 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 245 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 246 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 247 "lexer.l" -{ count(); tokens_seen++; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 248 "lexer.l" -{ count(); RETURN_VAL(CLASS); } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 249 "lexer.l" -{ count(); RETURN_VAL(DELETE); } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 250 "lexer.l" -{ count(); RETURN_VAL(NEW); } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 251 "lexer.l" -{ count(); RETURN_VAL(FRIEND); } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 252 "lexer.l" -{ count(); RETURN_VAL(OPERATOR); } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 253 "lexer.l" -{ count(); RETURN_VAL(PROTECTED); } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 254 "lexer.l" -{ count(); RETURN_VAL(PRIVATE); } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 255 "lexer.l" -{ count(); RETURN_VAL(PUBLIC); } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 256 "lexer.l" -{ count(); RETURN_VAL(THROW); } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 258 "lexer.l" -{ count(); RETURN_STR(CHAR); } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 259 "lexer.l" -{ count(); RETURN_STR(SHORT); } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 260 "lexer.l" -{ count(); RETURN_STR(INT); } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 261 "lexer.l" -{ count(); RETURN_STR(LONG); } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 262 "lexer.l" -{ count(); RETURN_STR(SIGNED); } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 263 "lexer.l" -{ count(); RETURN_STR(UNSIGNED); } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 264 "lexer.l" -{ count(); RETURN_STR(FLOAT); } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 265 "lexer.l" -{ count(); RETURN_STR(DOUBLE); } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 266 "lexer.l" -{ count(); RETURN_STR(VOID); } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 268 "lexer.l" -{ count(); RETURN_STR(IDENTIFIER); } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 270 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 271 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 272 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 273 "lexer.l" -{ count(); RETURN_STR(CONSTANT); /* 'fontlck */ } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 275 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 276 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 277 "lexer.l" -{ count(); RETURN_STR(CONSTANT); } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 279 "lexer.l" -{ count(); RETURN_STR(STRING_LITERAL); /* "fontlck */ } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 281 "lexer.l" -{ count(); RETURN_VAL(RIGHT_ASSIGN); } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 282 "lexer.l" -{ count(); RETURN_VAL(LEFT_ASSIGN); } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 283 "lexer.l" -{ count(); RETURN_VAL(ADD_ASSIGN); } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 284 "lexer.l" -{ count(); RETURN_VAL(SUB_ASSIGN); } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 285 "lexer.l" -{ count(); RETURN_VAL(MUL_ASSIGN); } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 286 "lexer.l" -{ count(); RETURN_VAL(DIV_ASSIGN); } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 287 "lexer.l" -{ count(); RETURN_VAL(MOD_ASSIGN); } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 288 "lexer.l" -{ count(); RETURN_VAL(AND_ASSIGN); } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 289 "lexer.l" -{ count(); RETURN_VAL(XOR_ASSIGN); } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 290 "lexer.l" -{ count(); RETURN_VAL(OR_ASSIGN); } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 291 "lexer.l" -{ count(); RETURN_VAL(RIGHT_OP); } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 292 "lexer.l" -{ count(); RETURN_VAL(LEFT_OP); } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 293 "lexer.l" -{ count(); RETURN_VAL(INC_OP); } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 294 "lexer.l" -{ count(); RETURN_VAL(DEC_OP); } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 295 "lexer.l" -{ count(); RETURN_VAL(PTR_OP); } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 296 "lexer.l" -{ count(); RETURN_VAL(MEM_PTR_OP); } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 297 "lexer.l" -{ count(); RETURN_VAL(AND_OP); } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 298 "lexer.l" -{ count(); RETURN_VAL(OR_OP); } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 299 "lexer.l" -{ count(); RETURN_VAL(LE_OP); } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 300 "lexer.l" -{ count(); RETURN_VAL(GE_OP); } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 301 "lexer.l" -{ count(); RETURN_VAL(EQ_OP); } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 302 "lexer.l" -{ count(); RETURN_VAL(NE_OP); } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 303 "lexer.l" -{ count(); RETURN_VAL(';'); } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 304 "lexer.l" -{ count(); RETURN_VAL('{'); } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 305 "lexer.l" -{ count(); RETURN_VAL('}'); } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 306 "lexer.l" -{ count(); RETURN_VAL(','); } - YY_BREAK -case 78: -YY_RULE_SETUP -#line 307 "lexer.l" -{ count(); RETURN_VAL(':'); } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 308 "lexer.l" -{ count(); RETURN_VAL('='); } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 309 "lexer.l" -{ count(); RETURN_VAL('('); } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 310 "lexer.l" -{ count(); RETURN_VAL(')'); } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 311 "lexer.l" -{ count(); RETURN_VAL('['); } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 312 "lexer.l" -{ count(); RETURN_VAL(']'); } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 313 "lexer.l" -{ count(); RETURN_VAL('.'); } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 314 "lexer.l" -{ count(); RETURN_VAL('&'); } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 315 "lexer.l" -{ count(); RETURN_VAL('!'); } - YY_BREAK -case 87: -YY_RULE_SETUP -#line 316 "lexer.l" -{ count(); RETURN_VAL('~'); } - YY_BREAK -case 88: -YY_RULE_SETUP -#line 317 "lexer.l" -{ count(); RETURN_VAL('-'); } - YY_BREAK -case 89: -YY_RULE_SETUP -#line 318 "lexer.l" -{ count(); RETURN_VAL('+'); } - YY_BREAK -case 90: -YY_RULE_SETUP -#line 319 "lexer.l" -{ count(); RETURN_VAL('*'); } - YY_BREAK -case 91: -YY_RULE_SETUP -#line 320 "lexer.l" -{ count(); RETURN_VAL('/'); } - YY_BREAK -case 92: -YY_RULE_SETUP -#line 321 "lexer.l" -{ count(); RETURN_VAL('%'); } - YY_BREAK -case 93: -YY_RULE_SETUP -#line 322 "lexer.l" -{ count(); RETURN_VAL('<'); } - YY_BREAK -case 94: -YY_RULE_SETUP -#line 323 "lexer.l" -{ count(); RETURN_VAL('>'); } - YY_BREAK -case 95: -YY_RULE_SETUP -#line 324 "lexer.l" -{ count(); RETURN_VAL('^'); } - YY_BREAK -case 96: -YY_RULE_SETUP -#line 325 "lexer.l" -{ count(); RETURN_VAL('|'); } - YY_BREAK -case 97: -YY_RULE_SETUP -#line 326 "lexer.l" -{ count(); RETURN_VAL('?'); } - YY_BREAK -case 98: -YY_RULE_SETUP -#line 327 "lexer.l" -{ count(); RETURN_VAL(CLCL); } - YY_BREAK -case 99: -YY_RULE_SETUP -#line 328 "lexer.l" -{ count(); RETURN_VAL(ELIPSIS); } - YY_BREAK -case 100: -YY_RULE_SETUP -#line 330 "lexer.l" -{ comment(); } - YY_BREAK -case 101: -YY_RULE_SETUP -#line 331 "lexer.l" -{ count(); } - YY_BREAK -case 102: -YY_RULE_SETUP -#line 332 "lexer.l" -{ macro(); /* was #.* { count(); } */ } - YY_BREAK -case 103: -#line 334 "lexer.l" -case 104: -YY_RULE_SETUP -#line 334 "lexer.l" -{ RETURN_VAL((int) yytext[0]); } - YY_BREAK -case 105: -YY_RULE_SETUP -#line 336 "lexer.l" -{ comment(); } - YY_BREAK -case 106: -YY_RULE_SETUP -#line 337 "lexer.l" -{ count(); } - YY_BREAK -case 107: -YY_RULE_SETUP -#line 338 "lexer.l" -{ macro(); /* was #.* { count(); } */ } - YY_BREAK -case 108: -#line 340 "lexer.l" -case 109: -YY_RULE_SETUP -#line 340 "lexer.l" -{ RETURN_VAL((int) yytext[0]); } - YY_BREAK -case 110: -YY_RULE_SETUP -#line 342 "lexer.l" -{ count(); } - YY_BREAK -case 111: -YY_RULE_SETUP -#line 343 "lexer.l" -{ count(); /* ignore bad characters */ } - YY_BREAK -case 112: -YY_RULE_SETUP -#line 345 "lexer.l" -ECHO; - YY_BREAK -#line 1587 "lex.yy.c" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(INLIN): -case YY_STATE_EOF(MINIT): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 320 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 320 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 319); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 345 "lexer.l" - - -/* - * called when EOF is encountered. Return 1 so the scanner will return - * the zero token to report end-of-file. - */ -int yywrap() -{ - return(1); -} - -static void comment() -{ - int c1 = 0, c2 = STUB_INPUT(); - - linebuf[column] = c2; - column++; - for(;;) { - if (c2 == EOF) - break; - if (c1 == '*' && c2 == '/') - break; - if (c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - } - - c1 = c2; - c2 = STUB_INPUT(); - linebuf[column] = c2; - column++; - } -} - - -static void macro() -{ - int c1 = 0, c2 = STUB_INPUT(), nonws = 0; - - log_printf("MACRO reading begining...\n#"); - log_printf("%c", c2); - - linebuf[column] = c2; - column++; - for(;;) { - if (c2 == EOF) - break; - if (!isspace(c1)) - nonws = c1; - if (nonws == '\\' && c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - } else if (c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - break; - } - - c1 = c2; - c2 = STUB_INPUT(); - linebuf[column] = c2; - log_printf("%c", c2); - column++; - } - log_printf("MACRO reading done.\n"); -} - - -static void count() -{ - int i; - - if (lineno == 1) - strcat(linebuf, yytext); - - for (i = 0; yytext[i] != '\0'; i++) - if (yytext[i] == '\n') - column = 0; - else if (yytext[i] == '\t') - column += 8 - (column % 8); - else - column++; - - /* equiv to fprintf(yyout, "%s", yytext); */ - /* ECHO; */ -} - -/* - * Collect the contents of inline functions, reading them char by char. - * thanks to the arjuna stubgen project for this one - */ -int collectInlineDef() -{ - int bracelevel = 1; - int token; - - /* the magic of exclusive start states makes it all possible */ - BEGIN INLIN; - - while (bracelevel > 0) { - token = yylex(); - column++; -/* fprintf(stderr, "INLIN: read token %c\n", token); */ - if (token > 0) { - /* Assume single char */ - switch (token) { - case '{': - bracelevel++; - break; - case '}': - bracelevel--; - if (bracelevel == 0) - { - column--; - unput(token); - break; - } - break; - case '\n': - column = 0; - lineno++; - break; - } - } else { - /* fatal error: Unexpected EOF reading inline function */ - return -1; - } - } - - /* we now return you to your regularly scheduled start state */ - BEGIN 0; - - return 0; -} - - -/* - * hmmm... looks familiar. more control-y programming. - */ -int collectMemberInitList() -{ - int token; - int insideList = 1; - - /* the magic of exclusive start states makes it all possible */ - BEGIN MINIT; - - while(insideList) { - token = yylex(); - column++; -/* fprintf(stderr, "MINIT: read token %c\n", token); */ - if (token > 0) { - /* Assume single char */ - switch (token) - { - case '{': - insideList = 0; - unput(token); - break; - case '\n': - column = 0; - lineno++; - break; - } - } else { - /* fatal error: Unexpected EOF reading member initialization */ - return -1; - } - } - - /* we now return you to your regularly scheduled start state */ - BEGIN 0; - - return 0; -} diff --git a/bepascal/bepascal/stubgen/lexer.l b/bepascal/bepascal/stubgen/lexer.l deleted file mode 100644 index cf4ae1e..0000000 --- a/bepascal/bepascal/stubgen/lexer.l +++ /dev/null @@ -1,522 +0,0 @@ -%{ -/* - * FILE: lexer.l - * AUTH: Michael John Radwin - * - * DESC: stubgen lexer. Portions borrowed from Newcastle - * University's Arjuna project (http://arjuna.ncl.ac.uk/), and - * Jeff Lee's ANSI Grammar - * (ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z) - * - * DATE: Thu Aug 15 13:10:06 EDT 1996 - * $Id: lexer.l,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Modification history: - * $Log: not supported by cvs2svn $ - * Revision 1.1 2001/11/07 10:06:07 ithamar - * Added stubgen to CVS - * - * Revision 1.33 1998/07/27 19:16:57 mradwin - * added some c++ keywords - * need to handle typename, using, and namespace - * - * Revision 1.32 1998/05/11 19:49:11 mradwin - * Version 2.03 (updated copyright information). - * - * Revision 1.31 1998/04/07 23:39:55 mradwin - * changed error-handling code significantly. functions - * like count() are now contributing to linebuf so we get correct - * parse error messages during lineno == 1 and other situations. - * also, instead of calling fatal() for collect*() functions, - * we return -1 and let the parser recover more gracefully. - * - * Revision 1.30 1998/01/12 19:39:11 mradwin - * modified rcsid - * - * Revision 1.29 1997/11/13 22:37:31 mradwin - * changed char[] to char * to make non-gcc compilers - * a little happier. We need to #define const to nothing - * for other compilers as well. - * - * Revision 1.28 1997/11/13 21:29:30 mradwin - * moved code from parser.y to main.c - * - * Revision 1.27 1997/11/13 21:10:17 mradwin - * renamed stubgen.[ly] to parser.y lexer.l - * - * Revision 1.26 1997/11/11 03:52:06 mradwin - * changed fatal() - * - * Revision 1.25 1997/11/05 03:02:02 mradwin - * Modified logging routines. - * - * Revision 1.24 1997/11/01 23:12:43 mradwin - * greatly improved error-recovery. errors no longer spill over - * into other files because the yyerror state is properly reset. - * - * Revision 1.23 1997/10/26 23:16:32 mradwin - * changed inform_user and fatal functions to use varargs - * - * Revision 1.22 1997/10/26 22:46:48 mradwin - * support macros within comments, etc. - * - * Revision 1.21 1997/10/16 19:42:48 mradwin - * added support for elipses, static member/array initializers, - * and bitfields. - * - * Revision 1.20 1997/10/16 17:36:06 mradwin - * Fixed compiler warning on win32 from and isspace() - * - * Revision 1.19 1997/10/16 17:12:59 mradwin - * handle extern "C" blocks better now, and support multi-line - * macros. still need error-checking. - * - * Revision 1.18 1997/10/15 22:09:06 mradwin - * changed tons of names. stubelem -> sytaxelem, - * stubin -> infile, stubout -> outfile, stublog -> logfile. - * - * Revision 1.17 1997/10/15 21:45:13 mradwin - * rearranged table.[ch] and util.[ch] so that util pkg - * knows nothing about syntaxelems. - * - * Revision 1.16 1997/10/15 17:42:37 mradwin - * added support for 'extern "C" { ... }' blocks. - * - * Revision 1.15 1997/09/05 19:17:06 mradwin - * works for scanning old versions, except for parameter - * names that differ between .H and .C files. - * - * Revision 1.14 1997/09/05 16:37:41 mradwin - * rcsid - * - * Revision 1.13 1997/09/05 16:34:36 mradwin - * GPL-ized code. - * - * Revision 1.12 1997/09/05 16:13:18 mradwin - * changed email address to acm.org - * - * Revision 1.11 1996/09/12 14:44:49 mjr - * Added throw decl recognition (great, another 4 bytes in syntaxelem) - * and cleaned up the grammar so that const_opt appears in far fewer - * places. const_opt is by default 0 as well, so we don't need to - * pass it as an arg to new_elem(). - * - * I also added a fix to a potential bug with the MINIT and INLIN - * exclusive start states. I think they could have been confused - * by braces within comments, so now I'm grabbing comments in those - * states as well. - * - * Revision 1.10 1996/09/12 03:46:10 mjr - * No concrete changes in code. Just added some sanity by - * factoring out code into util.[ch] and putting some prototypes - * that were in table.h into stubgen.y where they belong. - * - * Revision 1.9 1996/09/01 20:59:48 mjr - * Added collectMemberInitList() function, which is similar - * to collectInlineDef() and also the exclusive state MINIT - * - * Revision 1.8 1996/08/23 05:09:19 mjr - * fixed up some more portability things - * - * Revision 1.7 1996/08/22 02:43:47 mjr - * added parse error message (using O'Reilly p. 274) - * - * Revision 1.6 1996/08/21 18:33:50 mjr - * removed the buffer for inlines. we don't care anyway. - * now we can't overflow on inlines! - * - * Revision 1.5 1996/08/21 17:40:56 mjr - * added some cpp directives for porting to WIN32 - * - * Revision 1.4 1996/08/19 17:01:33 mjr - * no echo now - * - * Revision 1.3 1996/08/15 21:24:58 mjr - * *** empty log message *** - */ -%} - -D [0-9] -L [a-zA-Z_] -H [a-fA-F0-9] -E [Ee][+-]?{D}+ -FS (f|F|l|L) -IS (u|U|l|L)* - -%{ -#include -#include -#include -#include "table.h" -#include "util.h" - -#ifdef WIN32 -/* definitions of exit, malloc, realloc, and free */ -#include -#endif - -#if 0 /* #ifdef WIN32 */ -#include "y_tab.h" -#else -#include "y.tab.h" -#endif - -#ifdef __cplusplus -#define STUB_INPUT() yyinput() -#else -#define STUB_INPUT() input() -#endif - -/* when we return a string, duplicate it so we can free it later. - we always allocate memory so we can uniformly free() it. */ -#define RETURN_STR(x) tokens_seen++; yylval.string = strdup(yytext); return(x) - -/* make that nasty union a value that will bus error if we misinterpret - the value as a pointer */ -#define RETURN_VAL(x) tokens_seen++; yylval.flag = 37; return(x) - -static const char rcsid[] = "$Id: lexer.l,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $"; - -static void count(); -static void comment(); -static void macro(); - -char linebuf[1024]; /* null-terminated at beginning of each file */ -int lineno; /* set to 1 at beginning of each file */ -int column; /* set to 0 at beginning of each file */ -int tokens_seen; /* set to 0 at beginning of each file */ - -%} - -%x INLIN MINIT -%% -\n.* { /* - * for debugging purposes, we grab an entire - * line and buffer it, then grab tokens out of - * it. This lets us have more informative - * error messages. See yyerror() in parser.y - */ - strncpy(linebuf, yytext+1, 1024); - lineno++; - column = 0; - yyless(1); /* give back everything but \n */ - } -"/*" { comment(); } - -"//".* { count(); } -"#" { macro(); /* was #.* { count(); } */ } - -"static" { count(); tokens_seen++; } -"volatile" { count(); tokens_seen++; } -"auto" { count(); tokens_seen++; } -"extern" { count(); RETURN_VAL(EXTERN); } -"register" { count(); tokens_seen++; } -"typedef" { count(); tokens_seen++; } -"struct" { count(); RETURN_VAL(STRUCT); } -"union" { count(); RETURN_VAL(UNION); } -"enum" { count(); RETURN_VAL(ENUM); } -"const" { count(); RETURN_VAL(CONST); } -"template" { count(); RETURN_VAL(TEMPLATE); } - -"typename" { count(); tokens_seen++; /* FIXME */ } -"using" { count(); tokens_seen++; /* FIXME */ } -"namespace" { count(); RETURN_VAL(CLASS); /* FIXME */ } - -"dllexport" { count(); tokens_seen++; } -"dllimport" { count(); tokens_seen++; } - -"explicit" { count(); tokens_seen++; } -"mutable" { count(); tokens_seen++; } -"inline" { count(); tokens_seen++; } -"virtual" { count(); tokens_seen++; } -"class" { count(); RETURN_VAL(CLASS); } -"delete" { count(); RETURN_VAL(DELETE); } -"new" { count(); RETURN_VAL(NEW); } -"friend" { count(); RETURN_VAL(FRIEND); } -"operator" { count(); RETURN_VAL(OPERATOR); } -"protected" { count(); RETURN_VAL(PROTECTED); } -"private" { count(); RETURN_VAL(PRIVATE); } -"public" { count(); RETURN_VAL(PUBLIC); } -"throw" { count(); RETURN_VAL(THROW); } - -"char" { count(); RETURN_STR(CHAR); } -"short" { count(); RETURN_STR(SHORT); } -"int" { count(); RETURN_STR(INT); } -"long" { count(); RETURN_STR(LONG); } -"signed" { count(); RETURN_STR(SIGNED); } -"unsigned" { count(); RETURN_STR(UNSIGNED); } -"float" { count(); RETURN_STR(FLOAT); } -"double" { count(); RETURN_STR(DOUBLE); } -"void" { count(); RETURN_STR(VOID); } - -{L}({L}|{D})* { count(); RETURN_STR(IDENTIFIER); } - -0[xX]{H}+{IS}? { count(); RETURN_STR(CONSTANT); } -0{D}+{IS}? { count(); RETURN_STR(CONSTANT); } -{D}+{IS}? { count(); RETURN_STR(CONSTANT); } -'(\\.|[^\\'])+' { count(); RETURN_STR(CONSTANT); /* 'fontlck */ } - -{D}+{E}{FS}? { count(); RETURN_STR(CONSTANT); } -{D}*"."{D}+({E})?{FS}? { count(); RETURN_STR(CONSTANT); } -{D}+"."{D}*({E})?{FS}? { count(); RETURN_STR(CONSTANT); } - -\"(\\.|[^\\"])*\" { count(); RETURN_STR(STRING_LITERAL); /* "fontlck */ } - -">>=" { count(); RETURN_VAL(RIGHT_ASSIGN); } -"<<=" { count(); RETURN_VAL(LEFT_ASSIGN); } -"+=" { count(); RETURN_VAL(ADD_ASSIGN); } -"-=" { count(); RETURN_VAL(SUB_ASSIGN); } -"*=" { count(); RETURN_VAL(MUL_ASSIGN); } -"/=" { count(); RETURN_VAL(DIV_ASSIGN); } -"%=" { count(); RETURN_VAL(MOD_ASSIGN); } -"&=" { count(); RETURN_VAL(AND_ASSIGN); } -"^=" { count(); RETURN_VAL(XOR_ASSIGN); } -"|=" { count(); RETURN_VAL(OR_ASSIGN); } -">>" { count(); RETURN_VAL(RIGHT_OP); } -"<<" { count(); RETURN_VAL(LEFT_OP); } -"++" { count(); RETURN_VAL(INC_OP); } -"--" { count(); RETURN_VAL(DEC_OP); } -"->" { count(); RETURN_VAL(PTR_OP); } -"->*" { count(); RETURN_VAL(MEM_PTR_OP); } -"&&" { count(); RETURN_VAL(AND_OP); } -"||" { count(); RETURN_VAL(OR_OP); } -"<=" { count(); RETURN_VAL(LE_OP); } -">=" { count(); RETURN_VAL(GE_OP); } -"==" { count(); RETURN_VAL(EQ_OP); } -"!=" { count(); RETURN_VAL(NE_OP); } -";" { count(); RETURN_VAL(';'); } -"{" { count(); RETURN_VAL('{'); } -"}" { count(); RETURN_VAL('}'); } -"," { count(); RETURN_VAL(','); } -":" { count(); RETURN_VAL(':'); } -"=" { count(); RETURN_VAL('='); } -"(" { count(); RETURN_VAL('('); } -")" { count(); RETURN_VAL(')'); } -"[" { count(); RETURN_VAL('['); } -"]" { count(); RETURN_VAL(']'); } -"." { count(); RETURN_VAL('.'); } -"&" { count(); RETURN_VAL('&'); } -"!" { count(); RETURN_VAL('!'); } -"~" { count(); RETURN_VAL('~'); } -"-" { count(); RETURN_VAL('-'); } -"+" { count(); RETURN_VAL('+'); } -"*" { count(); RETURN_VAL('*'); } -"/" { count(); RETURN_VAL('/'); } -"%" { count(); RETURN_VAL('%'); } -"<" { count(); RETURN_VAL('<'); } -">" { count(); RETURN_VAL('>'); } -"^" { count(); RETURN_VAL('^'); } -"|" { count(); RETURN_VAL('|'); } -"?" { count(); RETURN_VAL('?'); } -"::" { count(); RETURN_VAL(CLCL); } -"..." { count(); RETURN_VAL(ELIPSIS); } - -"/*" { comment(); } -"//".* { count(); } -"#" { macro(); /* was #.* { count(); } */ } -. | -\n { RETURN_VAL((int) yytext[0]); } - -"/*" { comment(); } -"//".* { count(); } -"#" { macro(); /* was #.* { count(); } */ } -. | -\n { RETURN_VAL((int) yytext[0]); } - -[ \t\v\f] { count(); } -. { count(); /* ignore bad characters */ } - -%% - -/* - * called when EOF is encountered. Return 1 so the scanner will return - * the zero token to report end-of-file. - */ -int yywrap() -{ - return(1); -} - -static void comment() -{ - int c1 = 0, c2 = STUB_INPUT(); - - linebuf[column] = c2; - column++; - for(;;) { - if (c2 == EOF) - break; - if (c1 == '*' && c2 == '/') - break; - if (c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - } - - c1 = c2; - c2 = STUB_INPUT(); - linebuf[column] = c2; - column++; - } -} - - -static void macro() -{ - int c1 = 0, c2 = STUB_INPUT(), nonws = 0; - - log_printf("MACRO reading begining...\n#"); - log_printf("%c", c2); - - linebuf[column] = c2; - column++; - for(;;) { - if (c2 == EOF) - break; - if (!isspace(c1)) - nonws = c1; - if (nonws == '\\' && c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - } else if (c2 == '\n') { - linebuf[0] = '\0'; - column = 0; - lineno++; - break; - } - - c1 = c2; - c2 = STUB_INPUT(); - linebuf[column] = c2; - log_printf("%c", c2); - column++; - } - log_printf("MACRO reading done.\n"); -} - - -static void count() -{ - int i; - - if (lineno == 1) - strcat(linebuf, yytext); - - for (i = 0; yytext[i] != '\0'; i++) - if (yytext[i] == '\n') - column = 0; - else if (yytext[i] == '\t') - column += 8 - (column % 8); - else - column++; - - /* equiv to fprintf(yyout, "%s", yytext); */ - /* ECHO; */ -} - -/* - * Collect the contents of inline functions, reading them char by char. - * thanks to the arjuna stubgen project for this one - */ -int collectInlineDef() -{ - int bracelevel = 1; - int token; - - /* the magic of exclusive start states makes it all possible */ - BEGIN INLIN; - - while (bracelevel > 0) { - token = yylex(); - column++; -/* fprintf(stderr, "INLIN: read token %c\n", token); */ - if (token > 0) { - /* Assume single char */ - switch (token) { - case '{': - bracelevel++; - break; - case '}': - bracelevel--; - if (bracelevel == 0) - { - column--; - unput(token); - break; - } - break; - case '\n': - column = 0; - lineno++; - break; - } - } else { - /* fatal error: Unexpected EOF reading inline function */ - return -1; - } - } - - /* we now return you to your regularly scheduled start state */ - BEGIN 0; - - return 0; -} - - -/* - * hmmm... looks familiar. more control-y programming. - */ -int collectMemberInitList() -{ - int token; - int insideList = 1; - - /* the magic of exclusive start states makes it all possible */ - BEGIN MINIT; - - while(insideList) { - token = yylex(); - column++; -/* fprintf(stderr, "MINIT: read token %c\n", token); */ - if (token > 0) { - /* Assume single char */ - switch (token) - { - case '{': - insideList = 0; - unput(token); - break; - case '\n': - column = 0; - lineno++; - break; - } - } else { - /* fatal error: Unexpected EOF reading member initialization */ - return -1; - } - } - - /* we now return you to your regularly scheduled start state */ - BEGIN 0; - - return 0; -} diff --git a/bepascal/bepascal/stubgen/main.c b/bepascal/bepascal/stubgen/main.c deleted file mode 100644 index 8787c94..0000000 --- a/bepascal/bepascal/stubgen/main.c +++ /dev/null @@ -1,888 +0,0 @@ -/* - * FILE: main.c - * AUTH: Michael John Radwin - * - * DESC: stubgen code generation routines - * - * DATE: Thu Nov 13 13:28:23 PST 1997 - * $Id: main.c,v 1.2 2002-09-26 21:00:30 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -// modified version for the BeFPC project by Olivier Coursière -// Mai-June 2002 - -#include "table.h" -#include "util.h" -#include "pathname.h" -#include -#include -#include -#include -#include - -#ifdef WIN32 -#include /* defintion of GetUserName(), BOOL, etc. */ -#include -#include /* defintion of alloca() */ -#include "getopt.h" /* use GNU getopt */ -#else /* !WIN32 */ -#include -#endif /* WIN32 */ - -/* protos */ -static void debug_printf(syntaxelem_t *); -static void generate_skel(syntaxelem_t *); -static void print_function(syntaxelem_t *, syntaxelem_t *); -static void function_hdr(syntaxelem_t *, syntaxelem_t *); -static void file_hdr(); -static void scan_and_generate(FILE *); -static void scan_existing_skeleton(); - -/* duplicating variable names from stubgen.pl */ -static const char *OPTS = "hqrivgae:cdbfsn"; -int opt_h = 0, opt_q = 0, opt_r = 0, opt_i = 0; -int opt_v = 0, opt_g = 0, opt_a = 0; -int opt_c = 0, opt_d = 0; -int opt_b = 0, opt_f = 0, opt_s = 0, opt_n = 0; -char *opt_e = "cpp"; - -int using_stdio = 0; -static int new_functions = 0, fileOpened = 0, fileExisted = 0; -static int inform_indent = 0; - -#ifdef SGDEBUG -static const char *logfilename = "stubgen.log"; -#endif /* SGDEBUG */ - -FILE *outfile = NULL; -static char *inPath = NULL, *outPath = NULL; -char *currentFile = ""; -static const char *lots_of_stars = - "***********************************************************************"; -static const char *progname = "stubgen"; -static const char rcsid[] = "$Id: main.c,v 1.2 2002-09-26 21:00:30 ocoursiere Exp $"; -static const char *progver = "2.05"; - -static const char *copyright = - "Copyright (c) 1996-1998 Michael John Radwin"; - -static const char *version_info = -"Distributed under the GNU General Public License.\n\ -See http://www.radwin.org/michael/projects/stubgen/ for more information.\n"; - -static const char *usage = -"usage: %s [-hqrivgacd] [-e ext] [-{bfsn}] [infiles]\n\ - OPTIONS\n\ - -h Display usage information.\n\ - -q Quiet mode, no status information while generating code.\n\ - -r Make RCS-style file headers.\n\ - -i Don't put the #include \"my_file.H\" directive in my_file.cpp\n\ - -v Display version information.\n\ - -g Generate dummy return statements for functions.\n\ - -a Split function arguments over multiple lines.\n\ - -c Print debugging output with cerrs (#include ).\n\ - -d Print debugging output with dprintfs (#include ).\n\ - -e ext Generate source files with extension '.ext' (default '.cpp').\n\ -\n\ - METHOD HEADER STYLES\n\ - -b Block method headers (default).\n\ - -f Full method headers: like block, but less asterisks.\n\ - -s Simple method headers: only \"Method\" and \"Descr\" fields.\n\ - -n No method headers.\n"; - -// -static int nbConstructor = 0; - -static char *prec_function_name = ""; - -/* string manipulation functions. Found on the web - added for the BeFPC project -*/ - -#define UP_CASE(ch) ((ch) & 223) /* turn 6'th least sig. bit ON */ -#define LOW_CASE(ch) ((ch) | 32) /* turn 6'th least sig. bit OFF */ - - -/* Return the index (pos) of a char in a string or -1 if not found */ - -int index( s, c) -char *s,c; -{ - unsigned int i = (unsigned int) s + 1; - - while (*s) - if (*s++ == c) - return((unsigned int) s - i); - - return(-1); -} - -// #include // OCoursiere : it appears that this header is just need -// to include a min function - -int min(int Val1, int Val2) -{ - if (Val1 < Val2) - return Val1; - else - return Val2; -} - -/* -Insert a string into another string at a given index position. Note that the -starting position is the index, not the character number like in pascal!. -*/ - -void jzinsstr(fdestin,fsource,fstart) -char *fdestin; -char *fsource; -int fstart; -{ - - int wdlen,wslen; - int w,wlen,wpad; - - wdlen = strlen(fdestin); /* get destination string length */ - wslen = strlen(fsource); /* get source string length */ - - wlen = min(fstart,wdlen); /* don't initially point past destin */ - - wpad = fstart - wlen; /* get extra length to pad */ - - for (w = wlen ; w < fstart ; w ++) /* pad with blanks if neccessary */ - fdestin[w] = ' '; - - /* start at end of string and move characters to the right */ - /* draw it out if necessary; It's hard to follow if you don't */ - - for (w = wdlen + wslen - 1 ; w >= fstart + wslen ; w --) - fdestin[w] = fdestin[w - wslen]; - - for (w = 0 ; w < wslen ; w ++) /* now insert into the dest string */ - fdestin[w+fstart] = *fsource++; - - fdestin[wslen+wdlen+wpad] = 0; /* string is bigger, needs NULL */ -} - - -/* -Return the substring of a string. -Specify the String, the starting position, and the number of chars to copy -*/ -// OCoursiere : the function i need to cut 'B' in class names -char *jzmidstr(fstr,ffrom,flen) -char *fstr; -int ffrom,flen; -{ - static char wstr[256]; /* static work buffer */ - unsigned int wlen,newlen; - - if ((wlen = strlen(fstr)) < (ffrom+1)) /* don't go beyond string */ - return(0); - - strncpy(wstr, fstr + ffrom, flen); /* copy into work storage */ - - newlen = flen - ffrom + 1; - - if (newlen >= flen) - wstr[newlen] = 0; - - return(wstr); - -} - -/* End string manipulation functions */ - -static void generate_skel(syntaxelem_t *elt) -{ - syntaxelem_t *e; - log_printf("generate_skel called: %s\n", elt->name); - if (elt->kind != CLASS_KIND && elt->kind != STRUCT_KIND) - return; - - inform_user("%*s==> %s %s", inform_indent, "", - (elt->kind == CLASS_KIND ? "class " : "struct"), - elt->name); - if (inform_indent == 0) - inform_user(" (file %s)", inPath); - else - inform_user(" (nested class)"); - inform_user("\n"); - inform_indent += 4; - - nbConstructor = 0; - - for (e = elt->children; e != NULL; e = e->next) { - if (e->kind == FUNC_KIND) { - char *arg_str = args_to_string(e->args, 0); - log_printf(">>>>>>> generating %s: %s %s::%s(%s) %s\n", - string_kind(e->kind), - e->ret_type, elt->name, e->name, arg_str, - (e->const_flag) ? "const" : ""); - free(arg_str); - print_se(e); - print_function(e, elt); - e->kind = DONE_FUNC_KIND; - } else if (e->kind == CLASS_KIND || e->kind == STRUCT_KIND) { - /* nested class */ - char *tmp_str = (char *) malloc(strlen(elt->name) + strlen(e->name) + 3); - sprintf(tmp_str, "%s::%s", elt->name, e->name); - free(e->name); - e->name = tmp_str; - - log_printf(">>>>>>> generating NESTED %s: %s\n", - string_kind(e->kind), e->name); - print_se(e); - generate_skel(e); - free(tmp_str); - } else { - log_printf("------> ignoring %s: %s\n", - string_kind(e->kind), e->name); - } - } - - inform_indent -= 4; - inform_user("%*s==> %s %s", inform_indent, "", - (elt->kind == CLASS_KIND ? "class " : "struct"), - elt->name); - if (inform_indent == 0) - inform_user(" (%d functions appended to %s)", new_functions, outPath); - else - inform_user(" (end nested class)"); - inform_user("\n"); - - elt->kind = DONE_CLASS_KIND; -} - -// Adapted to generate C++ glue code for the befpc project -static void print_function(syntaxelem_t *elt, syntaxelem_t *classe) -{ - syntaxelem_t *e; - - char * test = "P"; - - if (find_skeleton(elt)) - { - log_printf("find_skeleton() returned true for this elt:\n"); - print_se(elt); - return; - } - - new_functions++; - if (!fileOpened) - { - fileOpened = 1; - - if (using_stdio) - { - fileExisted = 0; - } - else - { - /* test for existence */ - outfile = fopen(outPath, "r"); - if (outfile != NULL) - { - fileExisted = 1; - fclose(outfile); - } - - /* do the fopen */ - log_printf("writing to %s\n", outPath); - outfile = fopen(outPath, "a"); - if (outfile == NULL) - { - /* open failed */ - fatal(1, "%s: cannot open %s\n", progname, outPath); - } - } - - if (!fileExisted) file_hdr(); - } - - inform_user("%*s%s\n", inform_indent, "", elt->name); - function_hdr(elt, classe); - for (e = elt->parent; e != NULL; e = e->parent) - { - if (e->templ) - { - fprintf(outfile, "%s\n", e->templ); - break; - } - } - - { /* scope for local vars */ - char *arg_str = 0; - char *arg_str_name = 0; - - char *ClassName = 0; - - char *Suffixe = 0; - - // Extract the class name without the 'B' prefix - // (without the first char) - ClassName = jzmidstr(classe->name, 1, strlen(classe->name)); - - if (strncmp(elt->name, prec_function_name, strlen(prec_function_name)) == 0) - { - if (strlen(prec_function_name) > 0) - free(prec_function_name); - prec_function_name = (char *) malloc(strlen(elt->name) + 1); - strcpy(prec_function_name, elt->name); - if (nbConstructor == 0) - { - Suffixe = ""; - } - else - { - Suffixe = (char *) malloc(5); - sprintf(Suffixe, "_%d\n", nbConstructor); - } - - nbConstructor++; - } - else - { - nbConstructor = 0; - if (strlen(prec_function_name) > 0) - free(prec_function_name); - prec_function_name = (char *) malloc(strlen(elt->name) + 1); - strcpy(prec_function_name, elt->name); - if (nbConstructor == 0) - { - Suffixe = ""; - } - else - { - Suffixe = (char *) malloc(5); - sprintf(Suffixe, "_%d", nbConstructor); - } - nbConstructor++; - } - - - if (strncmp(elt->name, classe->name, strlen(elt->name)) == 0) - { - // constructor - fprintf(outfile, "TCPlusObject %s%s%s_Create%s(TPasObject PasObject", - elt->ret_type, (strcmp(elt->ret_type, "") ? "\n" : ""), - classe->name, Suffixe); - // nbConstructor++; - } - else - fprintf(outfile, "%s%s%s_%s%s(%s *%s", - elt->ret_type, (strcmp(elt->ret_type, "") ? "\n" : ""), - elt->parent->name, elt->name, Suffixe, - classe->name, ClassName); - - arg_str = args_to_string( - elt->args, - opt_a ? strlen(elt->parent->name) + strlen(elt->name) + 3 : 0); - - arg_str_name = args_to_string_name( - elt->args, - opt_a ? strlen(elt->parent->name) + strlen(elt->name) + 3 : 0); - - if (elt->args == 0) - fprintf(outfile, "%s)", arg_str); - else - fprintf(outfile, ", %s)", arg_str); - - if (elt->throw_decl) - fprintf(outfile, " %s", elt->throw_decl); - - if (elt->const_flag) - fprintf(outfile, " const"); - - fprintf(outfile, "\n{\n"); - - if (strncmp(elt->name, classe->name, strlen(elt->name)) == 0) - { - char *toto = (char *) malloc(strlen(classe->name) + 100); - strcpy(toto, classe->name); - jzinsstr(toto, test, 1); - fprintf(outfile, " return new %s(PasObject", - toto); - free(toto); - if (elt->args == 0) - fprintf(outfile, ");\n"); - else - fprintf(outfile, ", %s);\n", arg_str_name); - } - - // Generate stub code - else if (strncmp(elt->ret_type, "void", 4) == 0) - // procedure - fprintf(outfile, " %s->%s(%s);\n", ClassName, elt->name, arg_str_name); - else - // function - fprintf(outfile, " return %s->%s(%s);\n", ClassName, elt->name, arg_str_name); - - free(arg_str_name); - free(arg_str); - } - -// debug_printf(elt); - fprintf(outfile, "}\n\n\n"); -} - -static void function_hdr(syntaxelem_t *elt, syntaxelem_t *classe) -{ - if (opt_n) - return; - - fprintf(outfile, "/%s\n", (opt_b ? lots_of_stars : "*")); - fprintf(outfile, " * Method: %s::%s%s\n", elt->parent->name, elt->name, - (opt_s ? "()" : "")); - - if (opt_s) { - fprintf(outfile, " * Descr: \n"); - - } else { - char *arg_str = args_to_string(elt->args, 0); - fprintf(outfile, " * Params: %s\n", arg_str); - if (strcmp(elt->ret_type, "")) - fprintf(outfile, " * Returns: %s\n", elt->ret_type); - fprintf(outfile, " * Effects: \n"); - free(arg_str); - } - - fprintf(outfile, " %s/\n", (opt_b ? lots_of_stars : "*")); -} - -#ifdef WIN32 -static BOOL win32_fullname(const char *login, char *dest) -{ - WCHAR wszLogin[256]; /* Unicode user name */ - struct _USER_INFO_10 *ui; /* User structure */ - - /* Convert ASCII user name to Unicode. */ - MultiByteToWideChar(CP_ACP, 0, login, - strlen(login)+1, wszLogin, sizeof(wszLogin)); - - /* Look up the user on the DC. This function only works for - * Windows NT, and not Windows 95. */ - if (NetUserGetInfo(NULL, (LPWSTR) &wszLogin, 10, (LPBYTE *) &ui)) - return FALSE; - - /* Convert the Unicode full name to ASCII. */ - WideCharToMultiByte(CP_ACP, 0, ui->usri10_full_name, - -1, dest, 256, NULL, NULL); - - return TRUE; -} -#endif /* WIN32 */ - -static char *sg_getlogin() -{ - static char *login; -#ifdef WIN32 - static char login_buffer[256]; - DWORD size; -#endif /* WIN32 */ - static int sg_getlogin_called = 0; - - if (sg_getlogin_called) - return login; - else - sg_getlogin_called = 1; - -#ifdef WIN32 - if ((login = getenv("USERNAME")) == NULL) { - if ((login = getenv("USER")) == NULL) { - size = 255; - login = login_buffer; - if (GetUserName(login_buffer, &size) == FALSE) - login = "nobody"; - } - } -#else /* !WIN32 */ - if ((login = getenv("USER")) == NULL) - if ((login = getlogin()) == NULL) - login = "nobody"; -#endif /* WIN32 */ - - return login; -} - -static char *sg_getfullname(const char *login) -{ - char *fullname; - static char fullname_buffer[256]; -#ifndef WIN32 - char *comma; - struct passwd *pw; -#endif /* WIN32 */ - -#ifdef WIN32 - fullname = fullname_buffer; - - if (win32_fullname(login, fullname_buffer) == FALSE) - fullname = "nobody"; -#else /* !WIN32 */ - if ((fullname = getenv("NAME")) == NULL) { - setpwent(); - pw = getpwnam(login); - if (pw == NULL) { - fullname = "nobody"; - } else { - strncpy(fullname_buffer, pw->pw_gecos, 256); - comma = strchr(fullname_buffer, ','); - if (comma) *comma = '\0'; - fullname = fullname_buffer; - } - endpwent(); - } -#endif /* WIN32 */ - - return fullname; -} - - -static void file_hdr() { - char domain[256], *tmp; - time_t now = time(0); - char *today = ctime(&now); - char *login = sg_getlogin(); - char *fullname = sg_getfullname(login); - - log_printf("login: %s, full name: %s\n", login, fullname); - - domain[0] = '\0'; - if ((tmp = getenv("STUBGEN_DOM")) != NULL) - sprintf(domain, "@%s", tmp); - - if (opt_r) { - fprintf(outfile, "/*\n * FILE: %s\n * AUTH: %s <%s%s>\n", outPath, fullname, login, domain); - /* no '\n' needed with ctime() */ - fprintf(outfile, " *\n * DESC: \n *\n * DATE: %s * %sId$ \n *\n", today, "$"); - fprintf(outfile, " * %sLog$\n", "$"); - fprintf(outfile, " *\n */\n"); - - } else { - fprintf(outfile, "/%s\n", lots_of_stars); - fprintf(outfile, " * AUTHOR: %s <%s%s>\n", fullname, login, domain); - fprintf(outfile, " * FILE: %s\n", outPath); - fprintf(outfile, " * DATE: %s", today); /* no '\n' needed with ctime() */ - fprintf(outfile, " * DESCR: \n"); - fprintf(outfile, " %s/\n", lots_of_stars); - } - - if (!opt_i && !using_stdio) - fprintf(outfile, "#include \"%s\"\n", inPath); - if (opt_c) - fprintf(outfile, "#include \n"); - else if (opt_d) - fprintf(outfile, "#include \n"); - - fprintf(outfile, "\n"); -} - - -static void debug_printf(syntaxelem_t *elt) -{ - /* - * Make a dummy return value if this function is not a - * procedure (returning void) or a ctor (returning ""). - * Don't bother for references because they require an lvalue. - */ - int dummy_ret_val = (opt_g && - strcmp(elt->ret_type, "") != 0 && - strcmp(elt->ret_type, "void") != 0 && - strchr(elt->ret_type, '&') == 0); - /* - * If it's not a pointer type, create a temporary on the stack. - * They'll get warnings "dummy has not yet been assigned a value" - * from the compiler, but that's the best we can do. - * If it's a pointer type, return NULL (we assume it's defined). - */ - if (dummy_ret_val != 0 && strchr(elt->ret_type, '*') == NULL) - fprintf(outfile, " %s dummy;\n\n", elt->ret_type); - - if (opt_c) - fprintf(outfile, " cerr << \"%s::%s()\" << endl;\n", - elt->parent->name, elt->name); - else if (opt_d) - fprintf(outfile, " dprintf((\"%s::%s()\\n\"));\n", - elt->parent->name, elt->name); - - if (dummy_ret_val != 0) - fprintf(outfile, " return %s;\n", - (strchr(elt->ret_type, '*') == NULL) ? "dummy" : "NULL"); -} - -extern char linebuf[]; -extern int lineno; -extern int column; -extern int tokens_seen; -extern int yyparse(); - -static void scan_existing_skeleton() -{ - extern FILE *yyin; - FILE *existing; - - log_printf("checking for existence of %s ...\n", outPath); - if ((existing = fopen(outPath, "r")) == NULL) - return; - - log_printf("%s exists, scanning skeleton...\n", outPath); - inform_user("scanning %s ...\n", outPath); - - lineno = 1; - column = 0; - tokens_seen = 0; - - yyin = existing; - currentFile = outPath; - linebuf[0] = '\0'; - yyparse(); - log_printf("finished yyparse()\n"); - currentFile = ""; - - fclose(existing); - log_printf("done scanning skeleton...\n"); -} - - -static void scan_and_generate(FILE *infile) -{ - extern FILE *yyin; - - fileOpened = 0; - lineno = 1; - column = 0; - tokens_seen = 0; - - /* normal interaction on yyin and outfile from now on */ - inform_user("parsing %s ...\n", inPath); - log_printf("parsing %s ...\n", inPath); - yyin = infile; - currentFile = inPath; - linebuf[0] = '\0'; - yyparse(); - log_printf("finished yyparse()\n"); - currentFile = ""; - log_printf("expanding classes...\n"); - while (!class_queue_empty()) { - syntaxelem_t *elt = dequeue_class(); - generate_skel(elt); - } - - log_printf("closing %s\n", outPath); - free(outPath); - outPath = NULL; - if (fileOpened) { - fflush(outfile); - fclose(outfile); - outfile = NULL; - } - log_printf("done with %s\n", inPath); -} - -/* - * return a value representing numeric part of the RCS Revision string - * where value == (major * 1000) + minor. - */ -int revision() -{ - static char rcsrev[] = "$Revision: 1.2 $"; - static int value = -1; - char *major_str, *dot; - - if (value != -1) - return value; - - rcsrev[strlen(rcsrev)-2] = '\0'; - - major_str = &rcsrev[11]; - dot = strchr(major_str, '.'); - *dot++ = '\0'; /* tie off major_str and move to minor */ - - value = (atoi(major_str) * 1000) + atoi(dot); - - return value; -} - -#ifndef _MAX_PATH -#define _MAX_PATH 256 -#endif /* !def _MAX_PATH */ - -int main(int argc, char **argv) -{ - extern int optind; - extern char *optarg; - int c, err_flag = 0; - char *ext; - -#ifdef SGDEBUG - char logfilename_buffer[_MAX_PATH]; -#ifdef WIN32 - DWORD tmpPathLen; -#endif /* WIN32 */ -#endif /* SGDEBUG */ - -#ifdef SGDEBUG -#ifdef WIN32 - tmpPathLen = GetTempPath(_MAX_PATH, logfilename_buffer); - if (logfilename_buffer[tmpPathLen - 1] != '\\') - strcat(logfilename_buffer, "\\"); -#else /* !WIN32 */ - strcpy(logfilename_buffer, "/tmp/"); -#endif /* WIN32 */ - - strcat(logfilename_buffer, sg_getlogin()); - strcat(logfilename_buffer, "-"); - strcat(logfilename_buffer, logfilename); - - if (!log_open(logfilename_buffer)) { - /* open failed */ - fatal(1, "%s: cannot write to %s\n", progname, logfilename_buffer); - } -#endif /* SGDEBUG */ - - while ((c = getopt(argc, argv, OPTS)) != EOF) { - switch (c) { - case 'h': - opt_h = 1; break; - case 'q': - opt_q = 1; break; - case 'v': - opt_v = 1; break; - case 'g': - opt_g = 1; break; - case 'a': - opt_a = 1; break; - case 'e': - opt_e = optarg; - if (opt_e[0] == '.') - opt_e++; - break; - case 'r': - opt_r = 1; break; - case 'i': - opt_i = 1; break; - case 'c': - if (opt_d) err_flag = 1; - opt_c = 1; break; - case 'd': - if (opt_c) err_flag = 1; - opt_d = 1; break; - case 'b': - if (opt_f || opt_s || opt_n) err_flag = 1; - opt_b = 1; break; - case 'f': - if (opt_b || opt_s || opt_n) err_flag = 1; - opt_f = 1; break; - case 's': - if (opt_f || opt_b || opt_n) err_flag = 1; - opt_s = 1; break; - case 'n': - if (opt_f || opt_s || opt_b) err_flag = 1; - opt_n = 1; break; - default: - err_flag = 1; - } - } - - if (opt_h || opt_v || err_flag) { - inform_user("%s version %s (build %d).\n", - progname, progver, revision()); - if (opt_h || err_flag) - fatal(err_flag, usage, progname); - else - fatal(0, "%s\n%s", copyright, version_info); - } - - if (!(opt_b || opt_f || opt_s || opt_n)) - opt_b = 1; - - /* done setting options */ - if (argc == optind) { - /* read from stdin and stdout */ - outfile = stdout; - fprintf(outfile, "/* %s: reading from stdin */\n", progname); - using_stdio = 1; - inPath = "stdin"; - outPath = strdup("stdout"); - - opt_q = 1; /* force quiet mode */ - log_printf("initting...\n"); - init_tables(); - scan_and_generate(stdin); - log_printf("freeing memory...\n"); - free_tables(); - - } else { - inform_user("%s version %s (build %d).\n", - progname, progver, revision()); - - /* each bloody file from the command line */ - while (optind < argc) { - FILE *infile; - log_printf("working on %s\n", argv[optind]); - /* open for read */ - infile = fopen(argv[optind], "r"); - if (infile == NULL) { - /* open failed */ - fatal(1, "%s: cannot open %s\n", progname, argv[optind]); - } - - inPath = basename(argv[optind]); - outPath = (char *)malloc(strlen(inPath) + strlen(opt_e) + 2); - strcpy(outPath, inPath); - - /* tie off .h, .hh, .hpp, or .hxx extension */ - if (((ext = strrchr(outPath, '.')) != NULL) && - (((strlen(ext) == 2) && - ((ext[1] == 'H') || (ext[1] == 'h'))) || - (((strlen(ext) == 3) && - ((ext[1] == 'H') || (ext[1] == 'h')) && - ((ext[2] == 'H') || (ext[2] == 'h')))) || - ((strlen(ext) == 4) && - ((ext[1] == 'H') || (ext[1] == 'h')) && - ((((ext[2] == 'P') || (ext[2] == 'p')) && - ((ext[3] == 'P') || (ext[3] == 'p'))) || - (((ext[2] == 'X') || (ext[2] == 'x')) && - ((ext[3] == 'X') || (ext[3] == 'x'))))))) - *ext = '\0'; - - assert(opt_e[0] != '.'); - strcat(outPath, "."); - strcat(outPath, opt_e); - - log_printf("initting...\n"); - init_tables(); - scan_existing_skeleton(); - scan_and_generate(infile); - log_printf("freeing memory...\n"); - free_tables(); - clear_skeleton_queue(); - fclose(infile); - optind++; - } - } - -#ifdef SGDEBUG - log_flush(); - log_close(); -#endif /* SGDEBUG */ - - return 0; -} diff --git a/bepascal/bepascal/stubgen/parser.y b/bepascal/bepascal/stubgen/parser.y deleted file mode 100644 index e582a94..0000000 --- a/bepascal/bepascal/stubgen/parser.y +++ /dev/null @@ -1,1784 +0,0 @@ -%{ -/* - * FILE: parser.y - * AUTH: Michael John Radwin - * - * DESC: stubgen grammar description. Portions borrowed from - * Newcastle University's Arjuna project (http://arjuna.ncl.ac.uk/), - * and Jeff Lee's ANSI Grammar - * (ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z) - * This grammar is only a subset of the real C++ language. - * - * DATE: Thu Aug 15 13:10:06 EDT 1996 - * $Id: parser.y,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * -------------------------------------------------------------------- - * - * $Log: not supported by cvs2svn $ - * Revision 1.1 2001/11/07 10:06:07 ithamar - * Added stubgen to CVS - * - * Revision 1.72 1998/07/07 00:14:06 mradwin - * removed extra space from throw_decl, cleaned up memory leak - * in ctor skeleton - * - * Revision 1.71 1998/06/11 14:52:09 mradwin - * allow for empty class declarations, such as - * class Element {}; - * also, differentiate structs from classes with - * new STRUCT_KIND tag. - * New version: 2.04 - * - * Revision 1.70 1998/05/11 19:49:11 mradwin - * Version 2.03 (updated copyright information). - * - * Revision 1.69 1998/04/07 23:43:34 mradwin - * changed error-handling code significantly. - * several functions now return a value, and instead of - * calling fatal(), we do a YYABORT or YYERROR to get out - * of the parsing state. - * New version: 2.02. - * - * Revision 1.68 1998/03/28 02:59:41 mradwin - * working on slightly better error recovery; not done yet. - * - * Revision 1.67 1998/03/28 02:34:56 mradwin - * added multi-line function parameters - * also changed pointer and reference (* and &) types so there - * is no trailing space before the parameter name. - * - * Revision 1.66 1998/01/12 19:39:11 mradwin - * modified rcsid - * - * Revision 1.65 1997/11/13 22:50:55 mradwin - * moved copyright from parser.y to main.c - * - * Revision 1.64 1997/11/13 22:40:15 mradwin - * fixed a silly comment bug - * - * Revision 1.63 1997/11/13 22:37:31 mradwin - * changed char[] to char * to make non-gcc compilers - * a little happier. We need to #define const to nothing - * for other compilers as well. - * - * Revision 1.62 97/11/13 21:29:30 21:29:30 mradwin (Michael Radwin) - * moved code from parser.y to main.c - * - * Revision 1.61 1997/11/13 21:10:17 mradwin - * renamed stubgen.[ly] to parser.y lexer.l - * - * Revision 1.60 1997/11/11 04:11:29 mradwin - * fixed command-line flags: invalid options now force usgage. - * - * Revision 1.59 1997/11/11 04:03:56 mradwin - * changed version info - * - * Revision 1.58 1997/11/11 03:54:05 mradwin - * fixed a long-standing bug with -b option. a typo was causing - * the -b flag to be ignored. - * - * Revision 1.57 1997/11/11 03:52:06 mradwin - * changed fatal() - * - * Revision 1.56 1997/11/05 03:02:02 mradwin - * Modified logging routines. - * - * Revision 1.55 1997/11/05 02:14:38 mradwin - * Made some compiler warnings disappear. - * - * Revision 1.54 1997/11/01 23:26:13 mradwin - * new Revision string and usage info - * - * Revision 1.53 1997/11/01 23:12:43 mradwin - * greatly improved error-recovery. errors no longer spill over - * into other files because the yyerror state is properly reset. - * - * Revision 1.52 1997/10/27 01:14:23 mradwin - * fixed constant_value so it supports simple arithmetic. it's - * not as robust as full expressions, but this will handle the - * char buffer[BUFSIZE + 1] problem. - * - * Also removed expansion rules that simply did { $$ = $1; } because - * that action is implicit anyway. - * - * Revision 1.51 1997/10/26 23:16:32 mradwin - * changed inform_user and fatal functions to use varargs - * - * Revision 1.50 1997/10/26 22:27:07 mradwin - * Fixed this bug: - * stubgen dies on the following because the protected section is empty: - * - * class WidgetCsg : public WidgetLens { - * protected: - * - * public: - * virtual ~WidgetCsg() {} - * WidgetCsg(); - * }; - * - * Error: - * stubgen version 2.0-beta $Revision: 1.1 $. - * parse error at line 4, file test.H: - * public: - * ^ - * - * Revision 1.49 1997/10/16 19:42:48 mradwin - * added support for elipses, static member/array initializers, - * and bitfields. - * - * Revision 1.48 1997/10/16 17:35:39 mradwin - * cleaned up usage info - * - * Revision 1.47 1997/10/16 17:12:59 mradwin - * handle extern "C" blocks better now, and support multi-line - * macros. still need error-checking. - * - * Revision 1.46 1997/10/15 22:09:06 mradwin - * changed tons of names. stubelem -> sytaxelem, - * stubin -> infile, stubout -> outfile, stublog -> logfile. - * - * Revision 1.45 1997/10/15 21:33:36 mradwin - * fixed up function_hdr - * - * Revision 1.44 1997/10/15 21:33:02 mradwin - * *** empty log message *** - * - * Revision 1.43 1997/10/15 17:42:37 mradwin - * added support for 'extern "C" { ... }' blocks. - * - * Revision 1.42 1997/09/26 20:59:18 mradwin - * now allow "struct foobar *f" to appear in a parameter - * list or as a variable decl. Had to remove the - * class_or_struct rule and blow up the class_specifier - * description. - * - * Revision 1.41 1997/09/26 19:02:18 mradwin - * fixed memory leak involving template decls in skeleton code. - * Leads me to believe that skel_elemcmp() is flawed, because - * it may rely in parent->templ info. - * - * Revision 1.40 1997/09/26 18:44:22 mradwin - * changed parameter handing from char *'s to an argument type - * to facilitate comparisons between skeleton code - * and header code. Now we can correctly recognize different - * parameter names while still maintaining the same signature. - * - * Revision 1.39 1997/09/26 00:47:29 mradwin - * added better base type support -- recognize things like - * "long long" and "short int" now. - * - * Revision 1.38 1997/09/19 18:16:37 mradwin - * allowed an instance name to come after a class, struct, - * union, or enum. This improves parseability of typedefs - * commonly found in c header files, although true typedefs are - * not understood. - * - * Revision 1.37 1997/09/15 22:38:28 mradwin - * did more revision on the SGDEBUG stuff - * - * Revision 1.36 1997/09/15 19:05:26 mradwin - * allow logging to be compiled out by turning off SGDEBUG - * - * Revision 1.35 1997/09/12 00:58:43 mradwin - * duh, silly me. messed up compilation. - * - * Revision 1.34 1997/09/12 00:57:49 mradwin - * Revision string inserted in usage - * - * Revision 1.33 1997/09/12 00:51:19 mradwin - * string copyright added to code for binary copyright. - * - * Revision 1.32 1997/09/12 00:47:21 mradwin - * some more compactness of grammar with parameter_list_opt - * and also ampersand_opt - * - * Revision 1.31 1997/09/12 00:26:19 mradwin - * better template support, but still poor - * - * Revision 1.30 1997/09/08 23:24:51 mradwin - * changes to error-handling code. - * also got rid of the %type for the top-level rules - * - * Revision 1.30 1997/09/08 23:20:02 mradwin - * some error reporting changes and default values for top-level - * grammar stuff. - * - * Revision 1.29 1997/09/08 17:54:24 mradwin - * cleaned up options and usage info. - * - * Revision 1.28 1997/09/05 19:38:04 mradwin - * changed options for .ext instead of -l or -x - * - * Revision 1.27 1997/09/05 19:17:06 mradwin - * works for scanning old versions, except for parameter - * names that differ between .H and .C files. - * - * Revision 1.26 1997/09/05 16:34:36 mradwin - * GPL-ized code. - * - * Revision 1.25 1997/09/05 16:11:44 mradwin - * some simple cleanup before GPL-izing the code - * - * Revision 1.24 1997/09/04 19:50:34 mradwin - * whoo-hoo! by blowing up the description - * exponentially, it works! - * - * Revision 1.23 1997/03/20 16:05:41 mjr - * renamed syntaxelem to syntaxelem_t, cleaned up throw_decl - * - * Revision 1.22 1996/10/02 15:16:57 mjr - * using pathname.h instead of libgen.h - * - * Revision 1.21 1996/09/12 14:44:49 mjr - * Added throw decl recognition (great, another 4 bytes in syntaxelem) - * and cleaned up the grammar so that const_opt appears in far fewer - * places. const_opt is by default 0 as well, so we don't need to - * pass it as an arg to new_elem(). - * - * I also added a fix to a potential bug with the MINIT and INLIN - * exclusive start states. I think they could have been confused - * by braces within comments, so now I'm grabbing comments in those - * states as well. - * - * Revision 1.20 1996/09/12 04:55:22 mjr - * changed expand strategy. Don't expand while parsing now; - * enqueue as we go along and expand at the end. Eventually - * we'll need to provide similar behavior for when we parse - * .C files - * - * Revision 1.19 1996/09/12 03:46:10 mjr - * No concrete changes in code. Just added some sanity by - * factoring out code into util.[ch] and putting some prototypes - * that were in table.h into stubgen.y where they belong. - * - * Revision 1.18 1996/09/06 14:32:48 mjr - * defined the some_KIND constants for clarity, and made - * expandClass return immediately if it was give something other - * than a CLASS_KIND element. - * - * Revision 1.17 1996/09/06 14:05:44 mjr - * Almost there with expanded operator goodies. Still need - * to get OPERATOR type_name to work. - * - * Revision 1.16 1996/09/04 22:28:09 mjr - * nested classes work and default arguments are now removed - * from the parameter lists. - * - * Revision 1.15 1996/09/04 20:01:57 mjr - * non-functional expanded code. needs work. - * - * Revision 1.14 1996/09/01 21:29:34 mjr - * put the expanded_operator code back in as a useless rule. - * oughta think about fixing it up if possible - * - * Revision 1.13 1996/09/01 20:59:48 mjr - * Added collectMemberInitList() function, which is similar - * to collectInlineDef() and also the exclusive state MINIT - * - * Revision 1.12 1996/08/23 05:09:19 mjr - * fixed up some more portability things - * - * Revision 1.11 1996/08/22 02:43:47 mjr - * added parse error message (using O'Reilly p. 274) - * - * Revision 1.10 1996/08/21 18:33:50 mjr - * added support for template instantiation in the type_name - * rule. surprisingly it didn't cause any shift/reduce conflicts. - * - * Revision 1.9 1996/08/21 17:40:56 mjr - * added some cpp directives for porting to WIN32 - * - * Revision 1.8 1996/08/21 00:00:19 mjr - * approaching stability and usability. command line arguments - * are handled now and the fopens and fcloses appear to work. - * - * Revision 1.7 1996/08/20 20:44:23 mjr - * added initial support for optind but it is incomplete. - * - * Revision 1.6 1996/08/19 17:14:59 mjr - * misordered args, fixed bug - * - * Revision 1.5 1996/08/19 17:11:41 mjr - * RCS got confused with the RCS-style header goodies. - * got it cleaned up now. - * - * Revision 1.4 1996/08/19 17:01:33 mjr - * Removed the expanded code checking and added - * lots of code that duplicates what stubgen.pl did. - * still need options pretty badly - * - * Revision 1.3 1996/08/17 23:21:10 mjr - * added the expanded operator code, cleaned up tabs. - * consider putting all of the expanded code in another - * grammar - this one is getting cluttered. - * - */ -%} - -%{ -#include "table.h" -#include "util.h" -#include -#include -#include - -#ifdef WIN32 -#include /* defintion of alloca */ -#include "getopt.h" /* use GNU getopt */ -#endif /* WIN32 */ - -#ifndef WIN32 -#include -#endif /* WIN32 */ - -/* defined in lexer.l */ -extern int collectInlineDef(); -extern int collectMemberInitList(); - -/* defined here in parser.y */ -static int error_recovery(); -static int yyerror(char *); -static const char rcsid[] = "$Id: parser.y,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $"; - -/* defined in main.c */ -extern FILE *outfile; -extern char *currentFile; -extern int lineno; - -%} - -%union { - char *string; - syntaxelem_t *elt; - arg_t *arg; - int flag; -} - -%token IDENTIFIER CONSTANT STRING_LITERAL -%token CHAR SHORT INT LONG SIGNED UNSIGNED FLOAT DOUBLE VOID -%token NEW DELETE TEMPLATE THROW - -%token PTR_OP INC_OP DEC_OP LEFT_OP RIGHT_OP LE_OP GE_OP EQ_OP NE_OP -%token AND_OP OR_OP MUL_ASSIGN DIV_ASSIGN MOD_ASSIGN ADD_ASSIGN -%token SUB_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN -%token XOR_ASSIGN OR_ASSIGN CLCL MEM_PTR_OP - -%token FRIEND OPERATOR CONST CLASS STRUCT UNION ENUM -%token PROTECTED PRIVATE PUBLIC EXTERN ELIPSIS - -%type simple_type_name simple_signed_type non_reference_type -%type scoped_identifier pointer asterisk -%type type_name binary_operator -%type assignment_operator unary_operator any_operator -%type variable_specifier_list union_specifier -%type constant_value multiple_variable_specifier -%type enum_specifier enumerator_list enumerator -%type template_specifier template_arg template_arg_list -%type template_instance_arg template_instance_arg_list -%type throw_decl throw_list variable_name bitfield_savvy_identifier -%type primary_expression expression -%type multiplicative_expression additive_expression -%type const_opt ampersand_opt -%type class_specifier -%type member_func_specifier function_specifier constructor -%type destructor member_specifier member member_with_access -%type mem_type_specifier member_or_error -%type member_list member_list_opt -%type member_func_inlined type_specifier overloaded_op_specifier -%type member_func_skel member_func_skel_spec -%type constructor_skeleton destructor_skeleton -%type overloaded_op_skeleton function_skeleton -%type variable_or_parameter variable_specifier -%type parameter_list parameter_list_opt unnamed_parameter - - -%start translation_unit -%% - -translation_unit - : declaration - | translation_unit declaration - ; - -declaration - : declaration_specifiers ';' - | EXTERN STRING_LITERAL compound_statement -{ - log_printf("IGNORING extern \"C\" { ... } block.\n"); - free($2); -} - | member_func_inlined -{ - $1->kind = INLINED_KIND; - log_printf("\nBEGIN matched dec : m_f_i rule --"); - print_se($1); - log_printf("END matched dec : m_f_i rule\n"); -} - | function_skeleton -{ - $1->kind = SKEL_KIND; - log_printf("\nBEGIN matched dec : function_skeleton rule --"); - print_se($1); - enqueue_skeleton($1); - log_printf("END matched dec : function_skeleton rule\n"); -} - | ';' - | error -{ - log_printf("declaration : error. Attempting to recover...\n"); - yyerrok; - yyclearin; - if (error_recovery() != 0) { - log_printf("ERROR recovery could not complete -- YYABORT.\n"); - YYABORT; - } - log_printf("ERROR recovery complete.\n"); -} - ; - -declaration_specifiers - : member_specifier -{ - /* the name of the rule "member_specifier" might be misleading, but - * this is either a class, struct, union, enum, global var, global - * prototype, etc.. */ - if ($1->kind == CLASS_KIND || $1->kind == STRUCT_KIND) { - enqueue_class($1); - } else { - log_printf("\nIGNORING dec_spec : mem_spec (%s) --", - string_kind($1->kind)); - print_se($1); - log_printf("END IGNORING dec_spec : mem_spec (%s)\n", - string_kind($1->kind)); - } -} - | forward_decl - ; - -type_specifier - : union_specifier -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), $1, NULL, IGNORE_KIND); -/* print_se(elem); */ - $$ = elem; -} - | enum_specifier -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), $1, NULL, IGNORE_KIND); -/* print_se(elem); */ - $$ = elem; -} - | class_specifier - ; - -ampersand_opt - : /* nothing */ { $$ = 0; } - | '&' { $$ = 1; } - ; - -type_name - : non_reference_type ampersand_opt -{ - char *tmp_str = (char *) malloc(strlen($1) + ($2 ? 2 : 0) + 1); - strcpy(tmp_str, $1); - if ($2) - strcat(tmp_str, " &"); - free($1); - $$ = tmp_str; -} - | CONST non_reference_type ampersand_opt -{ - char *tmp_str = (char *) malloc(strlen($2) + ($3 ? 2 : 0) + 7); - sprintf(tmp_str, "const %s%s", $2, ($3 ? " &" : "")); - free($2); - $$ = tmp_str; -} - ; - -forward_decl - : CLASS IDENTIFIER { free($2); } - | CLASS scoped_identifier { free($2); } - | STRUCT IDENTIFIER { free($2); } - | STRUCT scoped_identifier { free($2); } - ; - -non_reference_type - : scoped_identifier - | IDENTIFIER - | STRUCT IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($2) + 8); - strcpy(tmp_str, "struct "); - strcat(tmp_str, $2); - free($2); - $$ = tmp_str; -} - | scoped_identifier '<' template_instance_arg_list '>' -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s<%s>", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | IDENTIFIER '<' template_instance_arg_list '>' -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s<%s>", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | scoped_identifier '<' template_instance_arg_list '>' pointer -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + strlen($5) + 4); - sprintf(tmp_str, "%s<%s> %s", $1, $3, $5); - free($1); - free($3); - free($5); - $$ = tmp_str; -} - | IDENTIFIER '<' template_instance_arg_list '>' pointer -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + strlen($5) + 4); - sprintf(tmp_str, "%s<%s> %s", $1, $3, $5); - free($1); - free($3); - free($5); - $$ = tmp_str; -} - | scoped_identifier pointer -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 2); - sprintf(tmp_str, "%s %s", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - | IDENTIFIER pointer -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 2); - sprintf(tmp_str, "%s %s", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - | STRUCT IDENTIFIER pointer -{ - char *tmp_str = (char *) malloc(strlen($2) + strlen($3) + 9); - sprintf(tmp_str, "struct %s %s", $2, $3); - free($2); - free($3); - $$ = tmp_str; -} - | simple_signed_type - | simple_signed_type pointer -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 2); - sprintf(tmp_str, "%s %s", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - ; - -simple_signed_type - : simple_type_name - | SIGNED simple_type_name -{ - char *tmp_str = (char *) malloc(strlen($2) + 8); - strcpy(tmp_str,"signed "); - strcat(tmp_str, $2); - free($1); - free($2); - $$ = tmp_str; -} - | UNSIGNED simple_type_name -{ - char *tmp_str = (char *) malloc(strlen($2) + 10); - strcpy(tmp_str,"unsigned "); - strcat(tmp_str, $2); - free($1); - free($2); - $$ = tmp_str; -} - ; - -simple_type_name - : CHAR - | SHORT - | SHORT INT -{ - $$ = strdup("short int"); - free($1); - free($2); -} - | INT - | LONG - | LONG INT -{ - $$ = strdup("long int"); - free($1); - free($2); -} - | LONG LONG -{ - $$ = strdup("long long"); - free($1); - free($2); -} - | LONG LONG INT -{ - $$ = strdup("long long int"); - free($1); - free($2); - free($3); -} - | UNSIGNED - | FLOAT - | DOUBLE - | VOID - ; - -scoped_identifier - : IDENTIFIER CLCL IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s::%s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | scoped_identifier CLCL IDENTIFIER -{ - /* control-Y programming! */ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s::%s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -pointer - : asterisk - | pointer asterisk -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 1); - strcpy(tmp_str,$1); - strcat(tmp_str,$2); - free($1); - free($2); - $$ = tmp_str; -} - ; - -asterisk - : '*' { $$ = strdup("*"); } - | '*' CONST { $$ = strdup("*const "); } - ; - -variable_or_parameter - : type_name bitfield_savvy_identifier -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = $1; - new_arg->name = $2; - new_arg->array = NULL; - new_arg->next = NULL; - $$ = new_arg; -} - | type_name scoped_identifier -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = $1; - new_arg->name = $2; - new_arg->array = NULL; - new_arg->next = NULL; - $$ = new_arg; -} - | variable_or_parameter '[' constant_value ']' -{ - char *old_array = $1->array; - int old_len = old_array ? strlen(old_array) : 0; - $1->array = (char *) malloc(strlen($3) + old_len + 3); - sprintf($1->array, "%s[%s]", old_array ? old_array : "", $3); - free($3); - if (old_array) - free(old_array); - $$ = $1; -} - | variable_or_parameter '[' ']' -{ - char *old_array = $1->array; - int old_len = old_array ? strlen(old_array) : 0; - $1->array = (char *) malloc(old_len + 3); - sprintf($1->array, "%s[]", old_array ? old_array : ""); - if (old_array) - free(old_array); - $$ = $1; -} - ; - -bitfield_savvy_identifier - : IDENTIFIER - | IDENTIFIER ':' CONSTANT { free($3); $$ = $1;} - ; - -variable_name - : bitfield_savvy_identifier - | pointer IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 2); - sprintf(tmp_str, "%s %s", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - | variable_name '[' constant_value ']' -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s[%s]", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | variable_name '[' ']' -{ - char *tmp_str = (char *) malloc(strlen($1) + 3); - strcpy(tmp_str, $1); - strcat(tmp_str, "[]"); - free($1); - $$ = tmp_str; -} - ; - -variable_specifier - : variable_or_parameter - | EXTERN variable_or_parameter { $$ = $2; } - | variable_or_parameter '=' constant_value -{ - free($3); - $$ = $1; -} - ; - -multiple_variable_specifier - : variable_specifier -{ - $$ = args_to_string($1, 0); - free_args($1); -} - | multiple_variable_specifier ',' variable_name -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s, %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -variable_specifier_list - : multiple_variable_specifier ';' -{ - char *tmp_str = (char *) malloc(strlen($1) + 2); - sprintf(tmp_str, "%s;", $1); - free($1); - $$ = tmp_str; -} - | variable_specifier_list multiple_variable_specifier ';' -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 3); - sprintf(tmp_str, "%s\n%s;", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - ; - -parameter_list_opt - : /* nothing */ -{ - $$ = NULL; -} - | parameter_list -{ - $$ = reverse_arg_list($1); -} - | parameter_list ',' ELIPSIS -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = strdup("..."); - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = $1; - $$ = reverse_arg_list(new_arg); -} - | ELIPSIS -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = strdup("..."); - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - $$ = new_arg; -} - ; - -parameter_list - : variable_specifier - | unnamed_parameter - | parameter_list ',' variable_specifier -{ - $3->next = $1; - $$ = $3; -} - | parameter_list ',' unnamed_parameter -{ - $3->next = $1; - $$ = $3; -} - ; - -unnamed_parameter - : type_name -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = $1; - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - $$ = new_arg; -} - | type_name '=' constant_value -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = $1; - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - free($3); - $$ = new_arg; -} - | unnamed_parameter '[' constant_value ']' -{ - char *old_array = $1->array; - int old_len = old_array ? strlen(old_array) : 0; - $1->array = (char *) malloc(strlen($3) + old_len + 3); - sprintf($1->array, "%s[%s]", old_array ? old_array : "", $3); - free($3); - if (old_array) - free(old_array); - $$ = $1; -} - | unnamed_parameter '[' ']' -{ - char *old_array = $1->array; - int old_len = old_array ? strlen(old_array) : 0; - $1->array = (char *) malloc(old_len + 3); - sprintf($1->array, "%s[]", old_array ? old_array : ""); - if (old_array) - free(old_array); - $$ = $1; -} - ; - -function_skeleton - : member_func_skel compound_statement - | constructor_skeleton ':' - { if (collectMemberInitList() != 0) YYERROR; } compound_statement - | template_specifier member_func_skel compound_statement -{ - /* I think this is the correct behavior, but skel_elemcmp is wrong */ - /* $2->templ = $1; */ - free($1); - $$ = $2; -} - | template_specifier constructor_skeleton ':' - { if (collectMemberInitList() != 0) YYERROR; } compound_statement -{ - /* I think this is the correct behavior, but skel_elemcmp is wrong */ - /* $2->templ = $1; */ - free($1); - $$ = $2; -} - ; - -member_func_inlined - : member_func_specifier compound_statement - | constructor ':' - { if (collectMemberInitList() != 0) YYERROR; } compound_statement - ; - -member_func_skel - : member_func_skel_spec const_opt throw_decl -{ - $1->const_flag = $2; - $1->throw_decl = $3; - $$ = $1; -} - | constructor_skeleton - | destructor_skeleton - ; - -member_func_specifier - : function_specifier const_opt throw_decl -{ - $1->const_flag = $2; - $1->throw_decl = $3; - $$ = $1; -} - | constructor - | destructor - ; - - -member_func_skel_spec - : type_name scoped_identifier '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, $2, $4, FUNC_KIND); -/* print_se(elem); */ - $$ = elem; -} - | type_name IDENTIFIER '<' template_instance_arg_list '>' CLCL IDENTIFIER '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, - (char *) malloc(strlen($2) + strlen($4) + strlen($7) + 5), - $9, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", $2, $4, $7); - free($2); - free($4); - free($7); - $$ = elem; -} - | overloaded_op_skeleton - ; - - - -function_specifier - : type_name IDENTIFIER '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, $2, $4, FUNC_KIND); - print_se(elem); - $$ = elem; -} - | overloaded_op_specifier - ; - -overloaded_op_skeleton - : type_name scoped_identifier CLCL OPERATOR any_operator '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, (char *)malloc(strlen($2) + strlen($5) + 12), - $7, FUNC_KIND); - sprintf(elem->name, "%s::operator%s", $2, $5); - free($2); - free($5); -/* print_se(elem); */ - $$ = elem; -} - | scoped_identifier CLCL OPERATOR type_name '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *)malloc(strlen($1) + strlen($4) + 13), - NULL, FUNC_KIND); - sprintf(elem->name, "%s::operator %s", $1, $4); - free($1); - free($4); -/* print_se(elem); */ - $$ = elem; -} - | type_name IDENTIFIER CLCL OPERATOR any_operator '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, (char *)malloc(strlen($2) + strlen($5) + 12), - $7, FUNC_KIND); - sprintf(elem->name, "%s::operator%s", $2, $5); - free($2); - free($5); -/* print_se(elem); */ - $$ = elem; -} - | IDENTIFIER CLCL OPERATOR type_name '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *)malloc(strlen($1) + strlen($4) + 13), - NULL, FUNC_KIND); - sprintf(elem->name, "%s::operator %s", $1, $4); - free($1); - free($4); -/* print_se(elem); */ - $$ = elem; -} - ; - -overloaded_op_specifier - : type_name OPERATOR any_operator '(' parameter_list_opt ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem($1, (char *)malloc(strlen($3) + 9), - $5, FUNC_KIND); - sprintf(elem->name, "operator%s", $3); - free($3); - print_se(elem); - $$ = elem; -} - | OPERATOR type_name '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), (char *)malloc(strlen($2) + 10), - NULL, FUNC_KIND); - sprintf(elem->name, "operator %s", $2); - free($2); - print_se(elem); - $$ = elem; -} - ; - -const_opt - : /* nothing */ { $$ = 0; } - | CONST { $$ = 1; } - ; - -throw_decl - : /* nothing */ { $$ = NULL; } - | THROW '(' throw_list ')' -{ - char *tmp_str = (char *) malloc(strlen($3) + 8); - sprintf(tmp_str, "throw(%s)", $3); - free($3); - $$ = tmp_str; -} - ; - -throw_list - : type_name - | throw_list ',' type_name -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s, %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -destructor - : '~' IDENTIFIER '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), (char *) malloc(strlen($2) + 2), - NULL, FUNC_KIND); - sprintf(elem->name,"~%s", $2); - free($2); -/* print_se(elem); */ - $$ = elem; -} - ; - -destructor_skeleton - : scoped_identifier CLCL '~' IDENTIFIER '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($4) + 4), - NULL, FUNC_KIND); - sprintf(elem->name,"%s::~%s", $1, $4); - free($1); - free($4); -/* print_se(elem); */ - $$ = elem; -} - | IDENTIFIER CLCL '~' IDENTIFIER '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($4) + 4), - NULL, FUNC_KIND); - sprintf(elem->name,"%s::~%s", $1, $4); - free($1); - free($4); -/* print_se(elem); */ - $$ = elem; -} - | IDENTIFIER '<' template_instance_arg_list '>' CLCL '~' IDENTIFIER '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($3) + strlen($7) + 6), - NULL, FUNC_KIND); - sprintf(elem->name,"%s<%s>::~%s", $1, $3, $7); - free($1); - free($3); - free($7); - $$ = elem; -} - | scoped_identifier '<' template_instance_arg_list '>' CLCL '~' IDENTIFIER '(' ')' -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($3) + strlen($7) + 6), - NULL, FUNC_KIND); - sprintf(elem->name,"%s<%s>::~%s", $1, $3, $7); - free($1); - free($3); - free($7); - $$ = elem; -} - ; - -constructor - : IDENTIFIER '(' parameter_list_opt ')' throw_decl -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), $1, $3, FUNC_KIND); - elem->throw_decl = $5; -/* print_se(elem); */ - $$ = elem; -} - ; - -constructor_skeleton - : scoped_identifier '(' parameter_list_opt ')' throw_decl -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), $1, $3, FUNC_KIND); - elem->throw_decl = $5; -/* print_se(elem); */ - $$ = elem; -} - | IDENTIFIER '<' template_instance_arg_list '>' CLCL IDENTIFIER '(' parameter_list_opt ')' throw_decl -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($3) + strlen($6) + 5), - $8, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", $1, $3, $6); - free($1); - free($3); - free($6); - elem->throw_decl = $10; - $$ = elem; -} - | scoped_identifier '<' template_instance_arg_list '>' CLCL IDENTIFIER '(' parameter_list_opt ')' throw_decl -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen($1) + strlen($3) + strlen($6) + 5), - $8, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", $1, $3, $6); - free($1); - free($3); - free($6); - elem->throw_decl = $10; - $$ = elem; -} - ; - -compound_statement - : '{' { if (collectInlineDef() != 0) YYERROR; } '}' - ; - -enum_specifier - : ENUM '{' enumerator_list '}' -{ - char *tmp_str = (char *) malloc(strlen($3) + 10); - sprintf(tmp_str, "enum { %s }", $3); - free($3); - $$ = tmp_str; -} - | ENUM IDENTIFIER '{' enumerator_list '}' -{ - char *tmp_str = (char *) malloc(strlen($2) + strlen($4) + 11); - sprintf(tmp_str, "enum %s { %s }", $2, $4); - free($2); - free($4); - $$ = tmp_str; -} - | ENUM IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($2) + 6); - sprintf(tmp_str, "enum %s", $2); - free($2); - $$ = tmp_str; -} - ; - -enumerator_list - : enumerator - | enumerator_list ',' enumerator -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s, %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -enumerator - : IDENTIFIER - | IDENTIFIER '=' constant_value -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 2); - sprintf(tmp_str, "%s=%s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -access_specifier_opt - : /* nothing */ - | access_specifier - ; - -access_specifier_list - : access_specifier ':' - | access_specifier_list access_specifier ':' - ; - -access_specifier - : PUBLIC - | PRIVATE - | PROTECTED - ; - -unary_operator - : '&' { $$ = strdup("&"); } - | '*' { $$ = strdup("*"); } - | '+' { $$ = strdup("+"); } - | '-' { $$ = strdup("-"); } - | '~' { $$ = strdup("~"); } - | '!' { $$ = strdup("!"); } - ; - -binary_operator - : '/' { $$ = strdup("/"); } - | '%' { $$ = strdup("%"); } - | '^' { $$ = strdup("^"); } - | '|' { $$ = strdup("|"); } - | '<' { $$ = strdup("<"); } - | '>' { $$ = strdup(">"); } - | ',' { $$ = strdup(","); } - ; - -assignment_operator - : '=' { $$ = strdup("="); } - | MUL_ASSIGN { $$ = strdup("*="); } - | DIV_ASSIGN { $$ = strdup("/="); } - | MOD_ASSIGN { $$ = strdup("%="); } - | ADD_ASSIGN { $$ = strdup("+="); } - | SUB_ASSIGN { $$ = strdup("-="); } - | LEFT_ASSIGN { $$ = strdup("<<="); } - | RIGHT_ASSIGN { $$ = strdup(">>="); } - | AND_ASSIGN { $$ = strdup("&="); } - | XOR_ASSIGN { $$ = strdup("^="); } - | OR_ASSIGN { $$ = strdup("|="); } - ; - -any_operator - : assignment_operator - | unary_operator - | binary_operator - | NEW { $$ = strdup(" new"); } - | DELETE { $$ = strdup(" delete"); } - | PTR_OP { $$ = strdup("->"); } - | MEM_PTR_OP { $$ = strdup("->*"); } - | INC_OP { $$ = strdup("++"); } - | DEC_OP { $$ = strdup("--"); } - | LEFT_OP { $$ = strdup("<<"); } - | RIGHT_OP { $$ = strdup(">>"); } - | LE_OP { $$ = strdup("<="); } - | GE_OP { $$ = strdup(">="); } - | EQ_OP { $$ = strdup("=="); } - | NE_OP { $$ = strdup("!="); } - | AND_OP { $$ = strdup("&&"); } - | OR_OP { $$ = strdup("||"); } - | '[' ']' { $$ = strdup("[]"); } - | '(' ')' { $$ = strdup("()"); } - ; - -constant_value - : expression - | compound_statement { $$ = strdup("{ ... }"); } - ; - -expression - : additive_expression - ; - -primary_expression - : CONSTANT - | '-' CONSTANT -{ - char *tmp_str = (char *) malloc(strlen($2) + 2); - sprintf(tmp_str, "-%s", $2); - free($2); - $$ = tmp_str; -} - | STRING_LITERAL - | IDENTIFIER - | scoped_identifier - | '(' expression ')' -{ - char *tmp_str = (char *) malloc(strlen($2) + 3); - sprintf(tmp_str, "(%s)", $2); - free($2); - $$ = tmp_str; -} - ; - -multiplicative_expression - : primary_expression - | multiplicative_expression '*' primary_expression -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 4); - sprintf(tmp_str, "%s * %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | multiplicative_expression '/' primary_expression -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 4); - sprintf(tmp_str, "%s / %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | multiplicative_expression '%' primary_expression -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 4); - sprintf(tmp_str, "%s %% %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -additive_expression - : multiplicative_expression - | additive_expression '+' multiplicative_expression -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 4); - sprintf(tmp_str, "%s + %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - | additive_expression '-' multiplicative_expression -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 4); - sprintf(tmp_str, "%s - %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - - -union_specifier - : UNION IDENTIFIER '{' variable_specifier_list '}' -{ - char *tmp_str = (char *) malloc(strlen($2) + strlen($4) + 12); - sprintf(tmp_str, "union %s { %s }", $2, $4); - free($2); - free($4); - $$ = tmp_str; -} - | UNION '{' variable_specifier_list '}' -{ - char *tmp_str = (char *) malloc(strlen($3) + 11); - sprintf(tmp_str, "union { %s }", $3); - free($3); - $$ = tmp_str; -} - | UNION IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($2) + 7); - sprintf(tmp_str, "union %s", $2); - free($2); - $$ = tmp_str; -} - ; - -class_specifier - : CLASS IDENTIFIER '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $2, NULL, CLASS_KIND); - tmp_elem->children = reverse_list($4); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | CLASS IDENTIFIER ':' superclass_list '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $2, NULL, CLASS_KIND); - tmp_elem->children = reverse_list($6); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | template_specifier CLASS IDENTIFIER '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $3, NULL, CLASS_KIND); - tmp_elem->children = reverse_list($5); - tmp_elem->templ = $1; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | template_specifier CLASS IDENTIFIER ':' superclass_list '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $3, NULL, CLASS_KIND); - tmp_elem->children = reverse_list($7); - tmp_elem->templ = $1; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | STRUCT '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), "unnamed_struct", - NULL, IGNORE_KIND); - tmp_elem->children = reverse_list($3); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | STRUCT IDENTIFIER '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $2, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list($4); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | STRUCT IDENTIFIER ':' superclass_list '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $2, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list($6); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | template_specifier STRUCT IDENTIFIER '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $3, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list($5); - tmp_elem->templ = $1; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - | template_specifier STRUCT IDENTIFIER ':' superclass_list '{' member_list_opt '}' -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), $3, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list($7); - tmp_elem->templ = $1; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - $$ = tmp_elem; -} - ; - -superclass_list - : superclass - | superclass_list ',' superclass - ; - -superclass - : access_specifier_opt type_name { free($2); } - ; - -friend_specifier - : FRIEND member_func_specifier { $2->kind = IGNORE_KIND; } - | FRIEND forward_decl - ; - -member_list_opt - : /* nothing */ { $$ = NULL; } - | member_list - ; - -member_list - : member_with_access -{ - if ($1 != NULL) - $1->next = NULL; - - $$ = $1; -} - | member_list member_with_access -{ - if ($2 != NULL) { - $2->next = $1; - $$ = $2; - } else { - $$ = $1; - } -} - ; - -member_or_error - : member - | error -{ - log_printf("member_with_access : error. Attempting to recover...\n"); - yyerrok; - yyclearin; - if (error_recovery() != 0) { - log_printf("ERROR recovery could not complete -- YYABORT.\n"); - YYABORT; - } - log_printf("ERROR recovery complete.\n"); - $$ = NULL; -} - ; - -member_with_access - : member_or_error - | access_specifier_list member_or_error { $$ = $2; } - ; - -member - : member_specifier ';' - | friend_specifier ';' { $$ = NULL; } - | member_func_inlined { $1->kind = INLINED_KIND; $$ = $1; } - | ';' { $$ = NULL; } - ; - -member_specifier - : multiple_variable_specifier -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), $1, NULL, IGNORE_KIND); -/* print_se(elem); */ - $$ = elem; -} - | member_func_specifier - | EXTERN member_func_specifier { $$ = $2; } - | member_func_specifier '=' CONSTANT { $1->kind = IGNORE_KIND; free($3); $$ = $1; } - | mem_type_specifier - ; - -mem_type_specifier - : type_specifier - | type_specifier IDENTIFIER { free($2); $$ = $1; } - | mem_type_specifier '[' ']' - | mem_type_specifier '[' constant_value ']' -{ - free($3); - $$ = $1; -} - ; - -template_arg - : CLASS IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($2) + 7); - sprintf(tmp_str, "class %s", $2); - free($2); - $$ = tmp_str; -} - | type_name IDENTIFIER -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($2) + 2); - sprintf(tmp_str, "%s %s", $1, $2); - free($1); - free($2); - $$ = tmp_str; -} - ; - -template_arg_list - : template_arg - | template_arg_list ',' template_arg -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s, %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -template_instance_arg - : CONSTANT - | type_name - ; - -template_instance_arg_list - : template_instance_arg - | template_instance_arg_list ',' template_instance_arg -{ - char *tmp_str = (char *) malloc(strlen($1) + strlen($3) + 3); - sprintf(tmp_str, "%s, %s", $1, $3); - free($1); - free($3); - $$ = tmp_str; -} - ; - -template_specifier - : TEMPLATE '<' template_arg_list '>' -{ - char *tmp_str = (char *) malloc(strlen($3) + 12); - sprintf(tmp_str, "template <%s>", $3); - free($3); - $$ = tmp_str; -} - ; - -%% - -static int yyerror(char *s /*UNUSED*/) -{ - if (outfile != NULL) - fflush(outfile); - - return 0; -} - -static int error_recovery() -{ - extern char linebuf[]; - extern int lineno; - extern int column; - extern int tokens_seen; - -#ifdef SGDEBUG - log_printf("parse error at line %d, file %s:\n%s\n%*s\n", - lineno, currentFile, linebuf, column, "^"); - log_flush(); -#endif /* SGDEBUG */ - - if (tokens_seen == 0) { - /* - * if we've seen no tokens but we're in an error, we must have - * hit an EOF, either by stdin, or on a file. Just give up - * now instead of complaining. - */ - return -1; - - } else { - fprintf(stderr, "parse error at line %d, file %s:\n%s\n%*s\n", - lineno, currentFile, linebuf, column, "^"); - } - - linebuf[0] = '\0'; - - for (;;) { - int result = yylex(); - - if (result <= 0) { - /* fatal error: Unexpected EOF during parse error recovery */ - -#ifdef SGDEBUG - log_printf("EOF in error recovery, line %d, file %s\n", - lineno, currentFile); - log_flush(); -#endif /* SGDEBUG */ - - fprintf(stderr, "EOF in error recovery, line %d, file %s\n", - lineno, currentFile); - - return -1; - } - - switch(result) { - case IDENTIFIER: - case CONSTANT: - case STRING_LITERAL: - case CHAR: - case SHORT: - case INT: - case LONG: - case SIGNED: - case UNSIGNED: - case FLOAT: - case DOUBLE: - case VOID: - free(yylval.string); - break; - case (int) '{': - if (collectInlineDef() != 0) - return -1; - result = yylex(); - return 0; - case (int) ';': - return 0; - } - } -} diff --git a/bepascal/bepascal/stubgen/pathname.c b/bepascal/bepascal/stubgen/pathname.c deleted file mode 100644 index cbbe51a..0000000 --- a/bepascal/bepascal/stubgen/pathname.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * FILE: pathname.c - * AUTH: Michael John Radwin - * - * DESC: two important functions from libgen. Largely influenced - * by the gnu dirutils. - * - * DATE: Tue Oct 1 20:48:28 EDT 1996 - * $Id: pathname.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#ifdef WIN32 -#define PATH_SEPARATOR_STR "\\" -#define PATH_SEPARATOR_CHAR '\\' -#else -#define PATH_SEPARATOR_STR "/" -#define PATH_SEPARATOR_CHAR '/' -#endif - -static const char rcsid[] = "$Id: pathname.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $"; - -static void -strip_trailing_slashes(char *path) -{ - int last = strlen (path) - 1; - while ((last > 0) && (path[last] == PATH_SEPARATOR_CHAR)) - path[last--] = '\0'; -} - -char * -basename(char *path) -{ - char *slash; - - if ((path == NULL) || (path[0] == '\0')) - return "."; - - strip_trailing_slashes(path); - if (path[0] == '\0') - return PATH_SEPARATOR_STR; - - slash = strrchr(path, PATH_SEPARATOR_CHAR); - return (slash) ? slash + 1 : path; -} - -char * -dirname(char *path) -{ - char *slash; - - if ((path == NULL) || (path[0] == '\0')) - return "."; - - strip_trailing_slashes(path); - if (path[0] == '\0') - return PATH_SEPARATOR_STR; - - slash = strrchr(path, PATH_SEPARATOR_CHAR); - if (slash == NULL) - return "."; - - /* Remove any trailing slashes and final element. */ - while (slash > path && *slash == PATH_SEPARATOR_CHAR) - --slash; - slash[1] = 0; - - return path; -} diff --git a/bepascal/bepascal/stubgen/pathname.h b/bepascal/bepascal/stubgen/pathname.h deleted file mode 100644 index 136bce2..0000000 --- a/bepascal/bepascal/stubgen/pathname.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * FILE: pathname.h - * AUTH: Michael John Radwin - * - * DESC: two important functions from libgen - * - * DATE: Tue Oct 1 20:47:55 EDT 1996 - * $Id: pathname.h,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __pathname_H__ -#define __pathname_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Given a pointer to a null-terminated character string that contains a - * path name, basename() returns a pointer to the last element of path. - * Trailing ``/'' characters are deleted. In doing this, it may place a - * null byte in the path name after the next to last element, so the - * content of path must be disposable. - * - * If path or *path is zero, pointer to a static constant ``.'' is - * returned. - * - * If path consists entirely of ``/'' characters, the empty string is - * returned. - */ -char * basename(char *path); - -/* - * Given a pointer to a null-terminated character string that contains a - * file system path name, dirname() returns a string that is the parent - * directory of that file. In doing this, it may place a null byte in - * the path name after the next to last element, so the content of path - * must be disposable. The returned string should not be deallocated by - * the caller. Trailing ``/'' characters in the path are not counted as - * part of the path. - * - * If path or *path is zero, a pointer to a static constant ``.'' is - * returned. - * - * dirname() and basename() together yield a complete path name. - * dirname (path) is the directory where basename (path) is found. - */ -char * dirname(char *path); - -#ifdef __cplusplus -} -#endif - -#endif /* __pathname_H__ */ diff --git a/bepascal/bepascal/stubgen/table.c b/bepascal/bepascal/stubgen/table.c deleted file mode 100644 index 69d0044..0000000 --- a/bepascal/bepascal/stubgen/table.c +++ /dev/null @@ -1,498 +0,0 @@ -/* - * FILE: table.c - * AUTH: Michael John Radwin - * - * DESC: stubgen symbol table goodies - * - * DATE: 1996/08/14 22:04:47 - * $Id: table.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "table.h" -#include "util.h" -#include -#include -#include -#include - -static const char rcsid[] = "$Id: table.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $"; - -/* global table */ -static syntaxelem_t etable[NELEMS]; -static int eindex; - -/* initializes all of the tables to default values. */ -void init_tables() -{ - memset(etable, 0, sizeof(syntaxelem_t) * NELEMS); - eindex = 0; - -#if 0 - syntaxelem_t *elt; - - for(elt = etable; elt < &etable[NELEMS]; elt++) { - elt->name = NULL; - elt->ret_type = NULL; - elt->args = NULL; - elt->templ = NULL; - elt->parent = NULL; - elt->children = NULL; - elt->throw_decl = NULL; - elt->const_flag = 0; - elt->kind = 73; - } -#endif -} - -/* recursively frees all syntaxelem_t's. */ -void free_tables() -{ - syntaxelem_t *elt; - - for (elt = etable; elt < &etable[NELEMS]; elt++) { - if (elt->name) { - free(elt->name); - free(elt->ret_type); - free_args(elt->args); - - if (elt->throw_decl) free(elt->throw_decl); - if (elt->templ) free(elt->templ); - } - } -} - -/* recursively frees the argument list and assoicated fields */ -void free_args(arg_t *args) -{ - arg_t *a; - - for (a = args; a != NULL; ) { - arg_t *next_arg = a->next; - free(a->type); - if (a->name) - free(a->name); - if (a->array) - free(a->array); - free(a); - a = next_arg; - } -} - -/* compares two arguments for equality. Returns 0 for equal, - non-zero if they differ. */ -int arg_cmp(arg_t *a1, arg_t *a2) -{ - if (strcmp(a1->type, a2->type) != 0) - return 1; - - if (a1->array) { - if (a2->array) { - if (strcmp(a1->array, a2->array) != 0) - return 1; - } else { - return 1; - } - } else if (a2->array) { - return 1; - } - - return 0; -} - -/* recursively compares two argument lists for equality. - Returns 0 for equal, non-zero if they differ. */ -int args_cmp(arg_t *a1, arg_t *a2) -{ - while (a1 != NULL) { - if (a2 == NULL) - return 1; - - if (arg_cmp(a1, a2) != 0) - return 1; - - a1 = a1->next; - a2 = a2->next; - } - - if (a2 != NULL) - return 1; - - return 0; -} - -// OCO -/* provides a string rep of this arglist. conses up new - memory, so client is responsible for freeing it. */ -char * args_to_string_name(arg_t *args, int indent_length) -{ - arg_t *a; - int len = 0; - char *str; - char *indent_str; - - if (indent_length <= 0) { - indent_str = strdup(", "); - indent_length = 2; - - } else { - indent_length += 2; /* room for ",\n" as well */ - indent_str = (char *) malloc(indent_length + 1); - memset(indent_str, ' ', indent_length); - indent_str[0] = ','; - indent_str[1] = '\n'; - indent_str[indent_length] = '\0'; - } - - for (a = args; a != NULL; a = a->next) { -// len += strlen(a->type); /* we always have a type */ - if (a->name) - len += (1 + strlen(a->name)); /* room for ' ' and name */ - if (a->array) - len += strlen(a->array); - if (a != args) - len += indent_length; /* room for ", " */ - } - - str = (char *) malloc(len + 1); - str[0] = '\0'; - - for (a = args; a != NULL; a = a->next) { - if (a != args) - strcat(str, indent_str); - -// strcat(str, a->type); - if (a->name) { -// if (((a->type)[strlen(a->type)-1] != '*') && -// ((a->type)[strlen(a->type)-1] != '&')) -// strcat(str, " "); - strcat(str, a->name); - if (a->array) - strcat(str, a->array); /* array hugs variable name */ - } else { -// if (a->array) -// strcat(str, a->array); /* array hugs type name */ - } - } - - free(indent_str); - return str; -} - -/* provides a string rep of this arglist. conses up new - memory, so client is responsible for freeing it. */ -char * args_to_string(arg_t *args, int indent_length) -{ - arg_t *a; - int len = 0; - char *str; - char *indent_str; - - if (indent_length <= 0) { - indent_str = strdup(", "); - indent_length = 2; - - } else { - indent_length += 2; /* room for ",\n" as well */ - indent_str = (char *) malloc(indent_length + 1); - memset(indent_str, ' ', indent_length); - indent_str[0] = ','; - indent_str[1] = '\n'; - indent_str[indent_length] = '\0'; - } - - for (a = args; a != NULL; a = a->next) { - len += strlen(a->type); /* we always have a type */ - if (a->name) - len += (1 + strlen(a->name)); /* room for ' ' and name */ - if (a->array) - len += strlen(a->array); - if (a != args) - len += indent_length; /* room for ", " */ - } - - str = (char *) malloc(len + 1); - str[0] = '\0'; - - for (a = args; a != NULL; a = a->next) { - if (a != args) - strcat(str, indent_str); - - strcat(str, a->type); - if (a->name) { - if (((a->type)[strlen(a->type)-1] != '*') && - ((a->type)[strlen(a->type)-1] != '&')) - strcat(str, " "); - strcat(str, a->name); - if (a->array) - strcat(str, a->array); /* array hugs variable name */ - } else { - if (a->array) - strcat(str, a->array); /* array hugs type name */ - } - } - - free(indent_str); - return str; -} - -/* compares a skeleton element to a header element for equality of - signatures. this isn't a strict comparison, because the kind and - parent fields ought to be different. returns 0 if equal, non-zero if - different */ -int skel_elemcmp(syntaxelem_t *skel_elem, syntaxelem_t *hdr_elem) -{ - char *tmp_str; - int result; - - assert(hdr_elem->kind == FUNC_KIND); - assert(skel_elem->kind == SKEL_KIND); - assert(hdr_elem->parent != NULL); - - if (skel_elem->const_flag != hdr_elem->const_flag) - return 1; - - /* - * templ and throw_decl are allowed to be NULL, - * so we must not pass them onto strcmp without - * a check first. - */ - if (skel_elem->templ != NULL) { - if (hdr_elem->templ == NULL) - return 1; - else if (strcmp(skel_elem->templ, hdr_elem->templ) != 0) - return 1; - } else if (hdr_elem->templ != NULL) { - return 1; - } - - if (skel_elem->throw_decl != NULL) { - if (hdr_elem->throw_decl == NULL) - return 1; - else if (strcmp(skel_elem->throw_decl, hdr_elem->throw_decl) != 0) - return 1; - } else if (hdr_elem->throw_decl != NULL) { - return 1; - } - - /* - * these two won't differ across files, and they're - * guaranteed not to be NULL. - */ - if (strcmp(skel_elem->ret_type, hdr_elem->ret_type) != 0) - return 1; - - /* now make sure the argument signatures match */ - if (args_cmp(skel_elem->args, hdr_elem->args) != 0) - return 1; - - /* - * the name, of course, is the hard part. we gotta - * look at the parent to make a scoped name. - */ - tmp_str = (char *) malloc(strlen(hdr_elem->parent->name) + - strlen(hdr_elem->name) + 3); - sprintf(tmp_str, "%s::%s", hdr_elem->parent->name, hdr_elem->name); - - result = strcmp(skel_elem->name, tmp_str); - free(tmp_str); - - return result; -} - -/* allocates a new element from the table, filling in the apropriate fields */ -syntaxelem_t * new_elem(char *ret_type, char *name, arg_t *args, int kind) -{ - syntaxelem_t *se; - - if (eindex == NELEMS - 1) { - fatal(2, "Too many symbols. Please mail mjr@acm.org."); - return NULL; - } - - se = &etable[eindex++]; - se->ret_type = ret_type; - se->name = name; - se->args = args; - se->kind = kind; - - return se; -} - - -/* given the head of the list, reverses it and returns the new head */ -syntaxelem_t * reverse_list(syntaxelem_t *head) -{ - syntaxelem_t *elt = head; - syntaxelem_t *prev = NULL; - syntaxelem_t *next; - - while (elt != NULL) { - next = elt->next; - elt->next = prev; - prev = elt; - elt = next; - } - - return prev; -} - -arg_t * reverse_arg_list(arg_t *head) -{ - arg_t *a = head; - arg_t *prev = NULL; - arg_t *next; - - while (a != NULL) { - next = a->next; - a->next = prev; - prev = a; - a = next; - } - - return prev; -} - -const char * string_kind(int some_KIND) -{ - switch(some_KIND) { - case IGNORE_KIND: - return "IGNORE_KIND"; - case FUNC_KIND: - return "FUNC_KIND"; - case CLASS_KIND: - return "CLASS_KIND"; - case STRUCT_KIND: - return "STRUCT_KIND"; - case INLINED_KIND: - return "INLINED_KIND"; - case SKEL_KIND: - return "SKEL_KIND"; - case DONE_FUNC_KIND: - return "DONE_FUNC_KIND"; - case DONE_CLASS_KIND: - return "DONE_CLASS_KIND"; - default: - return "BAD KIND!"; - } -} - - -#ifdef SGDEBUG -void print_se(syntaxelem_t *elt) -{ - char *arg_str = args_to_string(elt->args, 0); - - log_printf("\nSTUBELEM name: %s\n", elt->name); - log_printf(" ret_typ: %s\n", elt->ret_type); - log_printf(" args: %s\n", arg_str); - log_printf(" parent: %s\n", (elt->parent) ? elt->parent->name : "NULL"); - log_printf(" next: %s\n", (elt->next) ? elt->next->name : "NULL"); - log_printf(" const: %d\n", elt->const_flag); - log_printf(" kind: %s\n", string_kind(elt->kind)); - log_printf(" throw: %s\n", (elt->throw_decl)? elt->throw_decl : "NULL"); - log_printf(" templ: %s\n\n", (elt->templ)? elt->templ : "NULL"); - free(arg_str); -} -#endif /* SGDEBUG */ - -/* - * we can't use the 'next' field of syntaxelem_t because it is used to - * chain together methods. Make a slightly bigger struct so we can - * queue these up. - */ -typedef struct _skelnode { - syntaxelem_t *elt; - struct _skelnode *next; -} skelnode_t; - -/* the queue of elements found in the .H file, possibly to be expanded */ -static skelnode_t *exp_head = NULL; -static skelnode_t *exp_tail = NULL; - -void enqueue_class(syntaxelem_t *elt) -{ - skelnode_t *new_class; - - new_class = (skelnode_t *)malloc(sizeof(skelnode_t)); - new_class->elt = elt; - new_class->next = NULL; - - if (exp_head == NULL) - exp_tail = exp_head = new_class; - else { - exp_tail->next = new_class; - exp_tail = new_class; - } -} - -syntaxelem_t * dequeue_class() -{ - skelnode_t *old_head = exp_head; - syntaxelem_t *to_return = exp_head->elt; - - assert(exp_head != NULL); - exp_head = exp_head->next; - free(old_head); - - return to_return; -} - -int class_queue_empty() -{ - return exp_head == NULL; -} - -/* the list of skeletons found in the .C file, already expanded */ -static skelnode_t *skel_head = NULL; - -void enqueue_skeleton(syntaxelem_t *elt) -{ - skelnode_t *new_class; - - new_class = (skelnode_t *)malloc(sizeof(skelnode_t)); - new_class->elt = elt; - new_class->next = skel_head; - - skel_head = new_class; -} - -syntaxelem_t * find_skeleton(syntaxelem_t *elt) -{ - skelnode_t *node; - - /* the order of skel_elemcmp(node->elt, elt) is important. */ - for (node = skel_head; node != NULL; node = node->next) - if (skel_elemcmp(node->elt, elt) == 0) - return node->elt; - - return NULL; -} - -void clear_skeleton_queue() -{ - skelnode_t *node = skel_head; - - while (node != NULL) { - skelnode_t *next_node = node->next; - free(node); - node = next_node; - } - - skel_head = NULL; -} diff --git a/bepascal/bepascal/stubgen/table.h b/bepascal/bepascal/stubgen/table.h deleted file mode 100644 index 040d06c..0000000 --- a/bepascal/bepascal/stubgen/table.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * FILE: table.h - * AUTH: Michael John Radwin - * - * DESC: stubgen symbol table goodies - * - * DATE: 1996/08/14 22:04:47 - * $Id: table.h,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TABLE_HEADER -#define TABLE_HEADER - -#ifdef __cplusplus -extern "C" { -#endif - -#define NELEMS 500 /* maximum number of symbols */ - -#define IGNORE_KIND 0 /* a variable or forward declaration */ -#define FUNC_KIND 1 /* a method declaration */ -#define CLASS_KIND 2 /* a class declaration */ -#define INLINED_KIND 3 /* a method w/body in a class decl. */ -#define SKEL_KIND 4 /* a method found in a code file */ -#define STRUCT_KIND 5 /* a struct declaration that's a class */ -#define DONE_FUNC_KIND 11 /* a fn that we've finished expanded */ -#define DONE_CLASS_KIND 12 /* a class that we've finished expanded */ - -/* returns a pointer to a static string */ -const char * string_kind(int some_KIND); - -/* - * Represents a single argument, often used in a list. - */ -typedef struct arg { - char *type; /* type of this arg. may NOT be NULL */ - char *name; /* formal parameter name. may be NULL */ - char *array; /* any array dimensions may be NULL - appended to name. */ - struct arg *next; /* next argument. may be NULL */ -} arg_t; - -/* - * This structure is central to the program. It might have been more - * elegant with an object-oriented approach consisting of the following - * objects: ignore, method, class, inlined, skeleton. - * - * Instead, however, we have a "throw-it-all-in-one" structure that has - * unused pieces of data, depending on the kind field. - * - * A syntaxelem_t is "valid" if the name field is non-NULL. - */ -typedef struct syntaxelem { - char *name; /* name of class or func. may NOT be NULL */ - char *ret_type; /* return type. may NOT be NULL */ - arg_t *args; /* argument list. may be NULL */ - char *templ; /* template declaration. may be NULL */ - struct syntaxelem *parent; /* parent class */ - struct syntaxelem *next; /* next class or member */ - struct syntaxelem *children; /* children of this class */ - char *throw_decl; /* throw() clause. may be NULL */ - int const_flag; /* 1 if the func is const, 0 if not. */ - int kind; /* some_KIND */ -} syntaxelem_t; - -/* defined in table.c */ -void init_tables(); -void free_tables(); - -#ifdef SGDEBUG -void print_se(syntaxelem_t *); -#else -#define print_se(arg) -#endif /* SGDEBUG */ - -/* used in scanning */ -arg_t * reverse_arg_list(arg_t *); -void free_args(arg_t *); -syntaxelem_t *new_elem(char *, char *, arg_t *, int); -syntaxelem_t *reverse_list(syntaxelem_t *); - -/* used in generating output. - allocates memory; someone's gotta clean it up! */ -char *args_to_string(arg_t *, int); - -char * args_to_string_name(arg_t *, int); - -/* used in comparison with existing skeletons*/ -int skel_elemcmp(syntaxelem_t *skel_elem, syntaxelem_t *hdr_elem); -int strict_elemcmp(syntaxelem_t *e1, syntaxelem_t *e2); - -/* list management primitives */ -void enqueue_class(syntaxelem_t *); -syntaxelem_t * dequeue_class(); -int class_queue_empty(); - -void enqueue_skeleton(syntaxelem_t *); -syntaxelem_t * find_skeleton(syntaxelem_t *); -void clear_skeleton_queue(); - -#ifdef __cplusplus -} -#endif - -#endif /* TABLE_HEADER */ diff --git a/bepascal/bepascal/stubgen/util.c b/bepascal/bepascal/stubgen/util.c deleted file mode 100644 index 96de5b0..0000000 --- a/bepascal/bepascal/stubgen/util.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * FILE: util.c - * AUTH: Michael John Radwin - * - * DESC: stubgen utility macros and funcs - * - * DATE: Wed Sep 11 23:31:55 EDT 1996 - * $Id: util.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include -#include -#include "util.h" - -static const char rcsid[] = "$Id: util.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $"; - -#ifdef SGDEBUG -static FILE *logfile; - -int log_open(const char *logfilename) -{ - logfile = fopen(logfilename, "w"); - return (logfile != NULL); -} - -void log_flush() -{ - fflush(logfile); -} - -void log_close() -{ - fclose(logfile); - logfile = NULL; -} - -int log_printf(const char *format, ...) -{ - int retval; - va_list ap; - - va_start(ap, format); - retval = vfprintf(logfile, format, ap); - va_end(ap); - - return retval; -} - -int log_vprintf(const char *format, va_list ap) -{ - return vfprintf(logfile, format, ap); -} - -#else -int log_printf(const char *format /*UNUSED*/, ...) -{ - return 0; -} -#endif /* SGDEBUG */ - - -int inform_user(const char *format, ...) -{ - extern int opt_q; - int retval = 0; - va_list ap; - - if (!opt_q) { - va_start(ap, format); - retval = vfprintf(stderr, format, ap); - va_end(ap); - } - - return retval; -} - -void fatal(int status, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - log_vprintf(format, ap); - log_flush(); - log_close(); - (void) vfprintf(stderr, format, ap); - va_end(ap); - - fprintf(stderr, "\n"); - exit(status); -} - -#if 0 /* removeDefaultValues() not needed */ -/* - * modifies s by putting a null char in place of the first trailing space - */ -static void removeTrailingSpaces(char *s) -{ - char *end = s + strlen(s) - 1; - char *orig_end = end; - - while(*end == ' ') end--; - if (end != orig_end) *++end = '\0'; -} - -/* - * this both destructively modifies args and conses up a new string. - * be sure to free it up. - */ -char * removeDefaultValues(char *args) -{ - char *token; - char *new_arglist = (char *) malloc(strlen(args) + 1); - int once = 0; - - strcpy(new_arglist, ""); - token = strtok(args, "="); - - while(token != NULL) { - /* only append a comma if strtok got the comma off the arglist */ - if (once++) strcat(new_arglist, ","); - removeTrailingSpaces(token); - strcat(new_arglist, token); - token = strtok(NULL, ","); /* throw away the constant value */ - token = strtok(NULL, "="); /* grab args up til the next = sign */ - } - - return new_arglist; -} -#endif /* removeDefaultValues() not needed */ diff --git a/bepascal/bepascal/stubgen/util.h b/bepascal/bepascal/stubgen/util.h deleted file mode 100644 index 04c9187..0000000 --- a/bepascal/bepascal/stubgen/util.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * FILE: util.h - * AUTH: Michael John Radwin - * - * DESC: stubgen utility macros and funcs - * - * DATE: Wed Sep 11 23:31:55 EDT 1996 - * $Id: util.h,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef UTIL_HEADER -#define UTIL_HEADER - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -extern int yylex(); - -/* prints a message to the logfile if debugging is enabled */ -int log_printf(const char *format, ...); - -#ifdef SGDEBUG -int log_vprintf(const char *format, va_list ap); -int log_open(const char *filename); -void log_flush(); -void log_close(); -#else -#define log_vprintf(a,b) -#define log_open(arg) -#define log_flush() -#define log_close() -#endif /* SGDEBUG */ - -/* prints a message to stderr if the -q option is not set */ -int inform_user(const char *format, ...); - -/* prints a message to stderr and exits with return value 1 */ -void fatal(int status, const char *format, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* UTIL_HEADER */ diff --git a/bepascal/bepascal/stubgen/y.tab.c b/bepascal/bepascal/stubgen/y.tab.c deleted file mode 100644 index 76675b7..0000000 --- a/bepascal/bepascal/stubgen/y.tab.c +++ /dev/null @@ -1,3309 +0,0 @@ - -/* A Bison parser, made from parser.y - by GNU Bison version 1.28 */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define IDENTIFIER 257 -#define CONSTANT 258 -#define STRING_LITERAL 259 -#define CHAR 260 -#define SHORT 261 -#define INT 262 -#define LONG 263 -#define SIGNED 264 -#define UNSIGNED 265 -#define FLOAT 266 -#define DOUBLE 267 -#define VOID 268 -#define NEW 269 -#define DELETE 270 -#define TEMPLATE 271 -#define THROW 272 -#define PTR_OP 273 -#define INC_OP 274 -#define DEC_OP 275 -#define LEFT_OP 276 -#define RIGHT_OP 277 -#define LE_OP 278 -#define GE_OP 279 -#define EQ_OP 280 -#define NE_OP 281 -#define AND_OP 282 -#define OR_OP 283 -#define MUL_ASSIGN 284 -#define DIV_ASSIGN 285 -#define MOD_ASSIGN 286 -#define ADD_ASSIGN 287 -#define SUB_ASSIGN 288 -#define LEFT_ASSIGN 289 -#define RIGHT_ASSIGN 290 -#define AND_ASSIGN 291 -#define XOR_ASSIGN 292 -#define OR_ASSIGN 293 -#define CLCL 294 -#define MEM_PTR_OP 295 -#define FRIEND 296 -#define OPERATOR 297 -#define CONST 298 -#define CLASS 299 -#define STRUCT 300 -#define UNION 301 -#define ENUM 302 -#define PROTECTED 303 -#define PRIVATE 304 -#define PUBLIC 305 -#define EXTERN 306 -#define ELIPSIS 307 - -#line 1 "parser.y" - -/* - * FILE: parser.y - * AUTH: Michael John Radwin - * - * DESC: stubgen grammar description. Portions borrowed from - * Newcastle University's Arjuna project (http://arjuna.ncl.ac.uk/), - * and Jeff Lee's ANSI Grammar - * (ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z) - * This grammar is only a subset of the real C++ language. - * - * DATE: Thu Aug 15 13:10:06 EDT 1996 - * $Id: y.tab.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $ - * - * Copyright (c) 1996-1998 Michael John Radwin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * -------------------------------------------------------------------- - * - * $Log: not supported by cvs2svn $ - * Revision 1.1 2001/11/07 10:06:07 ithamar - * Added stubgen to CVS - * - * Revision 1.72 1998/07/07 00:14:06 mradwin - * removed extra space from throw_decl, cleaned up memory leak - * in ctor skeleton - * - * Revision 1.71 1998/06/11 14:52:09 mradwin - * allow for empty class declarations, such as - * class Element {}; - * also, differentiate structs from classes with - * new STRUCT_KIND tag. - * New version: 2.04 - * - * Revision 1.70 1998/05/11 19:49:11 mradwin - * Version 2.03 (updated copyright information). - * - * Revision 1.69 1998/04/07 23:43:34 mradwin - * changed error-handling code significantly. - * several functions now return a value, and instead of - * calling fatal(), we do a YYABORT or YYERROR to get out - * of the parsing state. - * New version: 2.02. - * - * Revision 1.68 1998/03/28 02:59:41 mradwin - * working on slightly better error recovery; not done yet. - * - * Revision 1.67 1998/03/28 02:34:56 mradwin - * added multi-line function parameters - * also changed pointer and reference (* and &) types so there - * is no trailing space before the parameter name. - * - * Revision 1.66 1998/01/12 19:39:11 mradwin - * modified rcsid - * - * Revision 1.65 1997/11/13 22:50:55 mradwin - * moved copyright from parser.y to main.c - * - * Revision 1.64 1997/11/13 22:40:15 mradwin - * fixed a silly comment bug - * - * Revision 1.63 1997/11/13 22:37:31 mradwin - * changed char[] to char * to make non-gcc compilers - * a little happier. We need to #define const to nothing - * for other compilers as well. - * - * Revision 1.62 97/11/13 21:29:30 21:29:30 mradwin (Michael Radwin) - * moved code from parser.y to main.c - * - * Revision 1.61 1997/11/13 21:10:17 mradwin - * renamed stubgen.[ly] to parser.y lexer.l - * - * Revision 1.60 1997/11/11 04:11:29 mradwin - * fixed command-line flags: invalid options now force usgage. - * - * Revision 1.59 1997/11/11 04:03:56 mradwin - * changed version info - * - * Revision 1.58 1997/11/11 03:54:05 mradwin - * fixed a long-standing bug with -b option. a typo was causing - * the -b flag to be ignored. - * - * Revision 1.57 1997/11/11 03:52:06 mradwin - * changed fatal() - * - * Revision 1.56 1997/11/05 03:02:02 mradwin - * Modified logging routines. - * - * Revision 1.55 1997/11/05 02:14:38 mradwin - * Made some compiler warnings disappear. - * - * Revision 1.54 1997/11/01 23:26:13 mradwin - * new Revision string and usage info - * - * Revision 1.53 1997/11/01 23:12:43 mradwin - * greatly improved error-recovery. errors no longer spill over - * into other files because the yyerror state is properly reset. - * - * Revision 1.52 1997/10/27 01:14:23 mradwin - * fixed constant_value so it supports simple arithmetic. it's - * not as robust as full expressions, but this will handle the - * char buffer[BUFSIZE + 1] problem. - * - * Also removed expansion rules that simply did { $$ = $1; } because - * that action is implicit anyway. - * - * Revision 1.51 1997/10/26 23:16:32 mradwin - * changed inform_user and fatal functions to use varargs - * - * Revision 1.50 1997/10/26 22:27:07 mradwin - * Fixed this bug: - * stubgen dies on the following because the protected section is empty: - * - * class WidgetCsg : public WidgetLens { - * protected: - * - * public: - * virtual ~WidgetCsg() {} - * WidgetCsg(); - * }; - * - * Error: - * stubgen version 2.0-beta $Revision: 1.1 $. - * parse error at line 4, file test.H: - * public: - * ^ - * - * Revision 1.49 1997/10/16 19:42:48 mradwin - * added support for elipses, static member/array initializers, - * and bitfields. - * - * Revision 1.48 1997/10/16 17:35:39 mradwin - * cleaned up usage info - * - * Revision 1.47 1997/10/16 17:12:59 mradwin - * handle extern "C" blocks better now, and support multi-line - * macros. still need error-checking. - * - * Revision 1.46 1997/10/15 22:09:06 mradwin - * changed tons of names. stubelem -> sytaxelem, - * stubin -> infile, stubout -> outfile, stublog -> logfile. - * - * Revision 1.45 1997/10/15 21:33:36 mradwin - * fixed up function_hdr - * - * Revision 1.44 1997/10/15 21:33:02 mradwin - * *** empty log message *** - * - * Revision 1.43 1997/10/15 17:42:37 mradwin - * added support for 'extern "C" { ... }' blocks. - * - * Revision 1.42 1997/09/26 20:59:18 mradwin - * now allow "struct foobar *f" to appear in a parameter - * list or as a variable decl. Had to remove the - * class_or_struct rule and blow up the class_specifier - * description. - * - * Revision 1.41 1997/09/26 19:02:18 mradwin - * fixed memory leak involving template decls in skeleton code. - * Leads me to believe that skel_elemcmp() is flawed, because - * it may rely in parent->templ info. - * - * Revision 1.40 1997/09/26 18:44:22 mradwin - * changed parameter handing from char *'s to an argument type - * to facilitate comparisons between skeleton code - * and header code. Now we can correctly recognize different - * parameter names while still maintaining the same signature. - * - * Revision 1.39 1997/09/26 00:47:29 mradwin - * added better base type support -- recognize things like - * "long long" and "short int" now. - * - * Revision 1.38 1997/09/19 18:16:37 mradwin - * allowed an instance name to come after a class, struct, - * union, or enum. This improves parseability of typedefs - * commonly found in c header files, although true typedefs are - * not understood. - * - * Revision 1.37 1997/09/15 22:38:28 mradwin - * did more revision on the SGDEBUG stuff - * - * Revision 1.36 1997/09/15 19:05:26 mradwin - * allow logging to be compiled out by turning off SGDEBUG - * - * Revision 1.35 1997/09/12 00:58:43 mradwin - * duh, silly me. messed up compilation. - * - * Revision 1.34 1997/09/12 00:57:49 mradwin - * Revision string inserted in usage - * - * Revision 1.33 1997/09/12 00:51:19 mradwin - * string copyright added to code for binary copyright. - * - * Revision 1.32 1997/09/12 00:47:21 mradwin - * some more compactness of grammar with parameter_list_opt - * and also ampersand_opt - * - * Revision 1.31 1997/09/12 00:26:19 mradwin - * better template support, but still poor - * - * Revision 1.30 1997/09/08 23:24:51 mradwin - * changes to error-handling code. - * also got rid of the %type for the top-level rules - * - * Revision 1.30 1997/09/08 23:20:02 mradwin - * some error reporting changes and default values for top-level - * grammar stuff. - * - * Revision 1.29 1997/09/08 17:54:24 mradwin - * cleaned up options and usage info. - * - * Revision 1.28 1997/09/05 19:38:04 mradwin - * changed options for .ext instead of -l or -x - * - * Revision 1.27 1997/09/05 19:17:06 mradwin - * works for scanning old versions, except for parameter - * names that differ between .H and .C files. - * - * Revision 1.26 1997/09/05 16:34:36 mradwin - * GPL-ized code. - * - * Revision 1.25 1997/09/05 16:11:44 mradwin - * some simple cleanup before GPL-izing the code - * - * Revision 1.24 1997/09/04 19:50:34 mradwin - * whoo-hoo! by blowing up the description - * exponentially, it works! - * - * Revision 1.23 1997/03/20 16:05:41 mjr - * renamed syntaxelem to syntaxelem_t, cleaned up throw_decl - * - * Revision 1.22 1996/10/02 15:16:57 mjr - * using pathname.h instead of libgen.h - * - * Revision 1.21 1996/09/12 14:44:49 mjr - * Added throw decl recognition (great, another 4 bytes in syntaxelem) - * and cleaned up the grammar so that const_opt appears in far fewer - * places. const_opt is by default 0 as well, so we don't need to - * pass it as an arg to new_elem(). - * - * I also added a fix to a potential bug with the MINIT and INLIN - * exclusive start states. I think they could have been confused - * by braces within comments, so now I'm grabbing comments in those - * states as well. - * - * Revision 1.20 1996/09/12 04:55:22 mjr - * changed expand strategy. Don't expand while parsing now; - * enqueue as we go along and expand at the end. Eventually - * we'll need to provide similar behavior for when we parse - * .C files - * - * Revision 1.19 1996/09/12 03:46:10 mjr - * No concrete changes in code. Just added some sanity by - * factoring out code into util.[ch] and putting some prototypes - * that were in table.h into stubgen.y where they belong. - * - * Revision 1.18 1996/09/06 14:32:48 mjr - * defined the some_KIND constants for clarity, and made - * expandClass return immediately if it was give something other - * than a CLASS_KIND element. - * - * Revision 1.17 1996/09/06 14:05:44 mjr - * Almost there with expanded operator goodies. Still need - * to get OPERATOR type_name to work. - * - * Revision 1.16 1996/09/04 22:28:09 mjr - * nested classes work and default arguments are now removed - * from the parameter lists. - * - * Revision 1.15 1996/09/04 20:01:57 mjr - * non-functional expanded code. needs work. - * - * Revision 1.14 1996/09/01 21:29:34 mjr - * put the expanded_operator code back in as a useless rule. - * oughta think about fixing it up if possible - * - * Revision 1.13 1996/09/01 20:59:48 mjr - * Added collectMemberInitList() function, which is similar - * to collectInlineDef() and also the exclusive state MINIT - * - * Revision 1.12 1996/08/23 05:09:19 mjr - * fixed up some more portability things - * - * Revision 1.11 1996/08/22 02:43:47 mjr - * added parse error message (using O'Reilly p. 274) - * - * Revision 1.10 1996/08/21 18:33:50 mjr - * added support for template instantiation in the type_name - * rule. surprisingly it didn't cause any shift/reduce conflicts. - * - * Revision 1.9 1996/08/21 17:40:56 mjr - * added some cpp directives for porting to WIN32 - * - * Revision 1.8 1996/08/21 00:00:19 mjr - * approaching stability and usability. command line arguments - * are handled now and the fopens and fcloses appear to work. - * - * Revision 1.7 1996/08/20 20:44:23 mjr - * added initial support for optind but it is incomplete. - * - * Revision 1.6 1996/08/19 17:14:59 mjr - * misordered args, fixed bug - * - * Revision 1.5 1996/08/19 17:11:41 mjr - * RCS got confused with the RCS-style header goodies. - * got it cleaned up now. - * - * Revision 1.4 1996/08/19 17:01:33 mjr - * Removed the expanded code checking and added - * lots of code that duplicates what stubgen.pl did. - * still need options pretty badly - * - * Revision 1.3 1996/08/17 23:21:10 mjr - * added the expanded operator code, cleaned up tabs. - * consider putting all of the expanded code in another - * grammar - this one is getting cluttered. - * - */ -#line 334 "parser.y" - -#include "table.h" -#include "util.h" -#include -#include -#include - -#ifdef WIN32 -#include /* defintion of alloca */ -#include "getopt.h" /* use GNU getopt */ -#endif /* WIN32 */ - -#ifndef WIN32 -#include -#endif /* WIN32 */ - -/* defined in lexer.l */ -extern int collectInlineDef(); -extern int collectMemberInitList(); - -/* defined here in parser.y */ -static int error_recovery(); -static int yyerror(char *); -static const char rcsid[] = "$Id: y.tab.c,v 1.1 2002-06-06 22:09:16 ocoursiere Exp $"; - -/* defined in main.c */ -extern FILE *outfile; -extern char *currentFile; -extern int lineno; - - -#line 366 "parser.y" -typedef union { - char *string; - syntaxelem_t *elt; - arg_t *arg; - int flag; -} YYSTYPE; -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#ifndef const -#define const -#endif -#endif -#endif - - - -#define YYFINAL 463 -#define YYFLAG -32768 -#define YYNTBASE 76 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 307 ? yytranslate[x] : 150) - -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 71, 2, 2, 2, 73, 55, 2, 64, - 65, 58, 69, 63, 70, 2, 72, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 61, 54, 56, - 62, 57, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 59, 2, 60, 74, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 67, 75, 68, 66, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 5, 8, 12, 14, 16, 18, 20, 22, - 24, 26, 28, 30, 31, 33, 36, 40, 43, 46, - 49, 52, 54, 56, 59, 64, 69, 75, 81, 84, - 87, 91, 93, 96, 98, 101, 104, 106, 108, 111, - 113, 115, 118, 121, 125, 127, 129, 131, 133, 137, - 141, 143, 146, 148, 151, 154, 157, 162, 166, 168, - 172, 174, 177, 182, 186, 188, 191, 195, 197, 201, - 204, 208, 209, 211, 215, 217, 219, 221, 225, 229, - 231, 235, 240, 244, 247, 248, 253, 257, 258, 264, - 267, 268, 273, 277, 279, 281, 285, 287, 289, 295, - 306, 308, 314, 316, 325, 332, 341, 348, 355, 360, - 361, 363, 364, 369, 371, 375, 380, 387, 394, 404, - 414, 420, 426, 437, 448, 449, 453, 458, 464, 467, - 469, 473, 475, 479, 480, 482, 485, 489, 491, 493, - 495, 497, 499, 501, 503, 505, 507, 509, 511, 513, - 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, - 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, - 555, 557, 559, 561, 563, 565, 567, 569, 571, 573, - 575, 577, 580, 583, 585, 587, 589, 591, 594, 596, - 598, 600, 604, 606, 610, 614, 618, 620, 624, 628, - 634, 639, 642, 648, 656, 663, 672, 677, 683, 691, - 698, 707, 709, 713, 716, 719, 722, 723, 725, 727, - 730, 732, 734, 736, 739, 742, 745, 747, 749, 751, - 753, 756, 760, 762, 764, 767, 771, 776, 779, 782, - 784, 788, 790, 792, 794, 798 -}; - -static const short yyrhs[] = { 77, - 0, 76, 77, 0, 78, 54, 0, 52, 5, 116, - 0, 101, 0, 98, 0, 54, 0, 1, 0, 143, - 0, 82, 0, 133, 0, 118, 0, 134, 0, 0, - 55, 0, 83, 80, 0, 44, 83, 80, 0, 45, - 3, 0, 45, 86, 0, 46, 3, 0, 46, 86, - 0, 86, 0, 3, 0, 46, 3, 0, 86, 56, - 148, 57, 0, 3, 56, 148, 57, 0, 86, 56, - 148, 57, 87, 0, 3, 56, 148, 57, 87, 0, - 86, 87, 0, 3, 87, 0, 46, 3, 87, 0, - 84, 0, 84, 87, 0, 85, 0, 10, 85, 0, - 11, 85, 0, 6, 0, 7, 0, 7, 8, 0, - 8, 0, 9, 0, 9, 8, 0, 9, 9, 0, - 9, 9, 8, 0, 11, 0, 12, 0, 13, 0, - 14, 0, 3, 40, 3, 0, 86, 40, 3, 0, - 88, 0, 87, 88, 0, 58, 0, 58, 44, 0, - 81, 90, 0, 81, 86, 0, 89, 59, 128, 60, - 0, 89, 59, 60, 0, 3, 0, 3, 61, 4, - 0, 90, 0, 87, 3, 0, 91, 59, 128, 60, - 0, 91, 59, 60, 0, 89, 0, 52, 89, 0, - 89, 62, 128, 0, 92, 0, 93, 63, 91, 0, - 93, 54, 0, 94, 93, 54, 0, 0, 96, 0, - 96, 63, 53, 0, 53, 0, 92, 0, 97, 0, - 96, 63, 92, 0, 96, 63, 97, 0, 81, 0, - 81, 62, 128, 0, 97, 59, 128, 60, 0, 97, - 59, 60, 0, 103, 116, 0, 0, 115, 61, 99, - 116, 0, 149, 103, 116, 0, 0, 149, 115, 61, - 100, 116, 0, 104, 116, 0, 0, 114, 61, 102, - 116, 0, 105, 109, 110, 0, 115, 0, 113, 0, - 106, 109, 110, 0, 114, 0, 112, 0, 81, 86, - 64, 95, 65, 0, 81, 3, 56, 148, 57, 40, - 3, 64, 95, 65, 0, 107, 0, 81, 3, 64, - 95, 65, 0, 108, 0, 81, 86, 40, 43, 127, - 64, 95, 65, 0, 86, 40, 43, 81, 64, 65, - 0, 81, 3, 40, 43, 127, 64, 95, 65, 0, - 3, 40, 43, 81, 64, 65, 0, 81, 43, 127, - 64, 95, 65, 0, 43, 81, 64, 65, 0, 0, - 44, 0, 0, 18, 64, 111, 65, 0, 81, 0, - 111, 63, 81, 0, 66, 3, 64, 65, 0, 86, - 40, 66, 3, 64, 65, 0, 3, 40, 66, 3, - 64, 65, 0, 3, 56, 148, 57, 40, 66, 3, - 64, 65, 0, 86, 56, 148, 57, 40, 66, 3, - 64, 65, 0, 3, 64, 95, 65, 110, 0, 86, - 64, 95, 65, 110, 0, 3, 56, 148, 57, 40, - 3, 64, 95, 65, 110, 0, 86, 56, 148, 57, - 40, 3, 64, 95, 65, 110, 0, 0, 67, 117, - 68, 0, 48, 67, 119, 68, 0, 48, 3, 67, - 119, 68, 0, 48, 3, 0, 120, 0, 119, 63, - 120, 0, 3, 0, 3, 62, 128, 0, 0, 123, - 0, 123, 61, 0, 122, 123, 61, 0, 51, 0, - 50, 0, 49, 0, 55, 0, 58, 0, 69, 0, - 70, 0, 66, 0, 71, 0, 72, 0, 73, 0, - 74, 0, 75, 0, 56, 0, 57, 0, 63, 0, - 62, 0, 30, 0, 31, 0, 32, 0, 33, 0, - 34, 0, 35, 0, 36, 0, 37, 0, 38, 0, - 39, 0, 126, 0, 124, 0, 125, 0, 15, 0, - 16, 0, 19, 0, 41, 0, 20, 0, 21, 0, - 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, - 27, 0, 28, 0, 29, 0, 59, 60, 0, 64, - 65, 0, 129, 0, 116, 0, 132, 0, 4, 0, - 70, 4, 0, 5, 0, 3, 0, 86, 0, 64, - 129, 65, 0, 130, 0, 131, 58, 130, 0, 131, - 72, 130, 0, 131, 73, 130, 0, 131, 0, 132, - 69, 131, 0, 132, 70, 131, 0, 47, 3, 67, - 94, 68, 0, 47, 67, 94, 68, 0, 47, 3, - 0, 45, 3, 67, 138, 68, 0, 45, 3, 61, - 135, 67, 138, 68, 0, 149, 45, 3, 67, 138, - 68, 0, 149, 45, 3, 61, 135, 67, 138, 68, - 0, 46, 67, 138, 68, 0, 46, 3, 67, 138, - 68, 0, 46, 3, 61, 135, 67, 138, 68, 0, - 149, 46, 3, 67, 138, 68, 0, 149, 46, 3, - 61, 135, 67, 138, 68, 0, 136, 0, 135, 63, - 136, 0, 121, 81, 0, 42, 104, 0, 42, 82, - 0, 0, 139, 0, 141, 0, 139, 141, 0, 142, - 0, 1, 0, 140, 0, 122, 140, 0, 143, 54, - 0, 137, 54, 0, 101, 0, 54, 0, 93, 0, - 104, 0, 52, 104, 0, 104, 62, 4, 0, 144, - 0, 79, 0, 79, 3, 0, 144, 59, 60, 0, - 144, 59, 128, 60, 0, 45, 3, 0, 81, 3, - 0, 145, 0, 146, 63, 145, 0, 4, 0, 81, - 0, 147, 0, 148, 63, 147, 0, 17, 56, 146, - 57, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 415, 416, 420, 421, 426, 433, 441, 442, 456, 471, - 475, 482, 489, 493, 494, 498, 507, 517, 518, 519, - 520, 524, 525, 526, 534, 542, 550, 559, 568, 576, - 584, 592, 593, 604, 605, 614, 626, 627, 628, 634, - 635, 636, 642, 648, 655, 656, 657, 658, 662, 670, - 682, 683, 695, 696, 700, 709, 718, 729, 742, 743, - 747, 748, 756, 764, 775, 776, 777, 785, 790, 801, - 808, 819, 823, 827, 836, 848, 849, 850, 855, 863, - 872, 882, 893, 906, 907, 909, 909, 916, 918, 927, - 928, 930, 933, 939, 940, 944, 950, 951, 956, 963, - 975, 981, 988, 992, 1003, 1015, 1026, 1041, 1051, 1064, - 1065, 1069, 1070, 1080, 1081, 1092, 1105, 1117, 1129, 1141, - 1156, 1167, 1175, 1188, 1204, 1205, 1208, 1215, 1223, 1233, - 1234, 1245, 1246, 1257, 1258, 1262, 1263, 1267, 1268, 1269, - 1273, 1274, 1275, 1276, 1277, 1278, 1282, 1283, 1284, 1285, - 1286, 1287, 1288, 1292, 1293, 1294, 1295, 1296, 1297, 1298, - 1299, 1300, 1301, 1302, 1306, 1307, 1308, 1309, 1310, 1311, - 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, - 1322, 1323, 1324, 1328, 1329, 1333, 1337, 1338, 1345, 1346, - 1347, 1348, 1358, 1359, 1367, 1375, 1386, 1387, 1395, 1407, - 1415, 1422, 1432, 1445, 1458, 1472, 1486, 1500, 1513, 1526, - 1540, 1557, 1558, 1562, 1566, 1567, 1571, 1572, 1576, 1583, - 1595, 1596, 1611, 1612, 1616, 1617, 1618, 1619, 1623, 1630, - 1631, 1632, 1633, 1637, 1638, 1639, 1640, 1648, 1655, 1666, - 1667, 1678, 1679, 1683, 1684, 1695 -}; -#endif - - -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) - -static const char * const yytname[] = { "$","error","$undefined.","IDENTIFIER", -"CONSTANT","STRING_LITERAL","CHAR","SHORT","INT","LONG","SIGNED","UNSIGNED", -"FLOAT","DOUBLE","VOID","NEW","DELETE","TEMPLATE","THROW","PTR_OP","INC_OP", -"DEC_OP","LEFT_OP","RIGHT_OP","LE_OP","GE_OP","EQ_OP","NE_OP","AND_OP","OR_OP", -"MUL_ASSIGN","DIV_ASSIGN","MOD_ASSIGN","ADD_ASSIGN","SUB_ASSIGN","LEFT_ASSIGN", -"RIGHT_ASSIGN","AND_ASSIGN","XOR_ASSIGN","OR_ASSIGN","CLCL","MEM_PTR_OP","FRIEND", -"OPERATOR","CONST","CLASS","STRUCT","UNION","ENUM","PROTECTED","PRIVATE","PUBLIC", -"EXTERN","ELIPSIS","';'","'&'","'<'","'>'","'*'","'['","']'","':'","'='","','", -"'('","')'","'~'","'{'","'}'","'+'","'-'","'!'","'/'","'%'","'^'","'|'","translation_unit", -"declaration","declaration_specifiers","type_specifier","ampersand_opt","type_name", -"forward_decl","non_reference_type","simple_signed_type","simple_type_name", -"scoped_identifier","pointer","asterisk","variable_or_parameter","bitfield_savvy_identifier", -"variable_name","variable_specifier","multiple_variable_specifier","variable_specifier_list", -"parameter_list_opt","parameter_list","unnamed_parameter","function_skeleton", -"@1","@2","member_func_inlined","@3","member_func_skel","member_func_specifier", -"member_func_skel_spec","function_specifier","overloaded_op_skeleton","overloaded_op_specifier", -"const_opt","throw_decl","throw_list","destructor","destructor_skeleton","constructor", -"constructor_skeleton","compound_statement","@4","enum_specifier","enumerator_list", -"enumerator","access_specifier_opt","access_specifier_list","access_specifier", -"unary_operator","binary_operator","assignment_operator","any_operator","constant_value", -"expression","primary_expression","multiplicative_expression","additive_expression", -"union_specifier","class_specifier","superclass_list","superclass","friend_specifier", -"member_list_opt","member_list","member_or_error","member_with_access","member", -"member_specifier","mem_type_specifier","template_arg","template_arg_list","template_instance_arg", -"template_instance_arg_list","template_specifier", NULL -}; -#endif - -static const short yyr1[] = { 0, - 76, 76, 77, 77, 77, 77, 77, 77, 78, 78, - 79, 79, 79, 80, 80, 81, 81, 82, 82, 82, - 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 84, 84, 84, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, - 87, 87, 88, 88, 89, 89, 89, 89, 90, 90, - 91, 91, 91, 91, 92, 92, 92, 93, 93, 94, - 94, 95, 95, 95, 95, 96, 96, 96, 96, 97, - 97, 97, 97, 98, 99, 98, 98, 100, 98, 101, - 102, 101, 103, 103, 103, 104, 104, 104, 105, 105, - 105, 106, 106, 107, 107, 107, 107, 108, 108, 109, - 109, 110, 110, 111, 111, 112, 113, 113, 113, 113, - 114, 115, 115, 115, 117, 116, 118, 118, 118, 119, - 119, 120, 120, 121, 121, 122, 122, 123, 123, 123, - 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, - 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 128, 128, 129, 130, 130, 130, 130, - 130, 130, 131, 131, 131, 131, 132, 132, 132, 133, - 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, - 134, 135, 135, 136, 137, 137, 138, 138, 139, 139, - 140, 140, 141, 141, 142, 142, 142, 142, 143, 143, - 143, 143, 143, 144, 144, 144, 144, 145, 145, 146, - 146, 147, 147, 148, 148, 149 -}; - -static const short yyr2[] = { 0, - 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 1, 2, 3, 2, 2, 2, - 2, 1, 1, 2, 4, 4, 5, 5, 2, 2, - 3, 1, 2, 1, 2, 2, 1, 1, 2, 1, - 1, 2, 2, 3, 1, 1, 1, 1, 3, 3, - 1, 2, 1, 2, 2, 2, 4, 3, 1, 3, - 1, 2, 4, 3, 1, 2, 3, 1, 3, 2, - 3, 0, 1, 3, 1, 1, 1, 3, 3, 1, - 3, 4, 3, 2, 0, 4, 3, 0, 5, 2, - 0, 4, 3, 1, 1, 3, 1, 1, 5, 10, - 1, 5, 1, 8, 6, 8, 6, 6, 4, 0, - 1, 0, 4, 1, 3, 4, 6, 6, 9, 9, - 5, 5, 10, 10, 0, 3, 4, 5, 2, 1, - 3, 1, 3, 0, 1, 2, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, - 1, 3, 1, 3, 3, 3, 1, 3, 3, 5, - 4, 2, 5, 7, 6, 8, 4, 5, 7, 6, - 8, 1, 3, 2, 2, 2, 0, 1, 1, 2, - 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, - 2, 3, 1, 1, 2, 3, 4, 2, 2, 1, - 3, 1, 1, 1, 3, 4 -}; - -static const short yydefact[] = { 0, - 8, 23, 37, 38, 40, 41, 0, 45, 46, 47, - 48, 0, 0, 0, 0, 0, 0, 0, 0, 7, - 0, 0, 1, 0, 234, 0, 10, 14, 32, 34, - 22, 65, 68, 229, 6, 5, 0, 230, 110, 110, - 101, 103, 98, 95, 97, 94, 12, 11, 13, 9, - 233, 0, 0, 0, 53, 72, 30, 51, 39, 42, - 43, 45, 35, 36, 0, 23, 0, 0, 22, 14, - 18, 19, 24, 0, 21, 202, 0, 129, 0, 23, - 0, 0, 66, 231, 97, 0, 2, 3, 235, 59, - 0, 56, 55, 15, 16, 33, 0, 0, 72, 29, - 0, 0, 0, 125, 84, 0, 90, 111, 112, 112, - 91, 85, 0, 23, 0, 0, 0, 0, 94, 49, - 0, 0, 242, 243, 244, 0, 54, 0, 75, 80, - 76, 0, 73, 77, 52, 44, 0, 0, 240, 0, - 0, 0, 24, 0, 0, 0, 17, 134, 0, 134, - 0, 31, 222, 0, 0, 0, 140, 139, 138, 0, - 228, 227, 0, 0, 0, 0, 0, 223, 219, 221, - 0, 0, 0, 0, 0, 0, 0, 132, 0, 130, - 4, 59, 56, 0, 0, 0, 0, 72, 168, 169, - 170, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 171, 141, 151, 152, 142, 0, 154, 153, 0, - 145, 143, 144, 146, 147, 148, 149, 150, 166, 167, - 165, 0, 0, 72, 50, 0, 0, 0, 0, 190, - 187, 189, 58, 0, 0, 191, 185, 0, 184, 193, - 197, 186, 67, 59, 0, 61, 69, 0, 232, 0, - 93, 96, 0, 0, 236, 0, 0, 24, 0, 0, - 87, 88, 0, 0, 26, 0, 59, 0, 112, 0, - 0, 238, 239, 246, 0, 0, 109, 0, 0, 135, - 0, 212, 0, 0, 0, 0, 0, 0, 216, 215, - 0, 24, 0, 224, 136, 226, 207, 220, 225, 0, - 0, 70, 201, 0, 0, 0, 0, 127, 116, 0, - 0, 60, 0, 182, 183, 72, 0, 0, 0, 0, - 25, 112, 0, 188, 57, 0, 0, 0, 0, 0, - 62, 0, 126, 0, 92, 86, 237, 134, 0, 134, - 0, 0, 0, 0, 0, 28, 245, 81, 121, 74, - 78, 79, 83, 0, 241, 26, 25, 214, 134, 0, - 203, 0, 208, 18, 24, 0, 137, 0, 200, 71, - 128, 133, 131, 0, 0, 102, 0, 0, 99, 0, - 0, 0, 27, 122, 192, 194, 195, 196, 198, 199, - 64, 0, 114, 0, 0, 0, 0, 0, 89, 107, - 118, 0, 0, 82, 213, 0, 0, 72, 0, 108, - 72, 105, 117, 0, 0, 63, 0, 113, 0, 205, - 0, 210, 72, 0, 204, 209, 0, 0, 0, 72, - 0, 115, 0, 0, 0, 0, 106, 72, 104, 0, - 0, 206, 211, 112, 119, 0, 112, 120, 123, 100, - 124, 0, 0 -}; - -static const short yydefgoto[] = { 22, - 23, 24, 25, 95, 82, 27, 28, 29, 30, 69, - 152, 58, 32, 93, 257, 33, 34, 176, 132, 133, - 134, 35, 264, 352, 162, 263, 37, 38, 39, 40, - 41, 42, 109, 261, 404, 43, 44, 45, 46, 247, - 258, 47, 179, 180, 289, 163, 164, 229, 230, 231, - 232, 248, 249, 250, 251, 252, 48, 49, 291, 292, - 165, 166, 167, 168, 169, 170, 171, 51, 139, 140, - 125, 126, 172 -}; - -static const short yypact[] = { 598, --32768, 138,-32768, 26,-32768, 162, 301, 301,-32768,-32768, --32768, -3, 874, 886, 75, 17, 18, 20, 154,-32768, - 114, 522,-32768, 85, 180, 37,-32768, 140, 161,-32768, - 159, 123,-32768, 172,-32768,-32768, 208, 166, 250, 250, --32768,-32768,-32768,-32768, 222, 243,-32768,-32768,-32768,-32768, - 268, 534, 4, 818, 286, 758, 161,-32768,-32768,-32768, - 340,-32768,-32768,-32768, 830, 212, 347, 294, 223, 140, - 108, 319, 82, 443, 319, 295, 686, 297, 362, 209, - 208, 40, 308,-32768,-32768, 306,-32768,-32768,-32768, 116, - 721, 15,-32768,-32768,-32768, 161, 38, 818, 758, 161, - 33, 56, 8,-32768,-32768, 367,-32768,-32768, 354, 354, --32768,-32768, 71, 234, 371, 372, 373, 208, 316,-32768, - 874, 376,-32768,-32768,-32768, 62,-32768, 874,-32768, 27, --32768, 315, 318, 323,-32768,-32768, 380, 381,-32768, 198, - 383, 818, 161, 322, 385, 818,-32768, 296, 443, 296, - 443, 161,-32768, 660, 386, 29,-32768,-32768,-32768, 673, --32768,-32768, 583, 329, 337, 324, 507,-32768,-32768,-32768, - 341, 163, 686, 393, 61, 391, 362, 344, 175,-32768, --32768, 149, 319, 343, 43, 818, 405, 758,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 351,-32768,-32768, 348, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 350, 59, 758,-32768, 874, 409, 259, 352, 375, --32768,-32768,-32768, 24, 412, 319,-32768, 359,-32768,-32768, - 228, 284,-32768, 361, 32,-32768, 364, 356,-32768, 365, --32768,-32768, 208, 208,-32768, 360, -4, 226, 52, 15, --32768,-32768, 366, 368, 72, 818, 153, 56, 354, 806, - 187,-32768,-32768,-32768, 830, 260,-32768, 262, 874,-32768, - 193,-32768, 363, 232, 370, 425, 431, 64,-32768,-32768, - 267, 230, 378,-32768,-32768,-32768,-32768,-32768,-32768, 433, - 610,-32768,-32768, 158, 190, 56, 362,-32768,-32768, 721, - 274,-32768, 377,-32768,-32768, 758, 721, 382, 394, 397, - 192, 354, 398,-32768,-32768, 24, 24, 24, 24, 24, --32768, 202,-32768, 874,-32768,-32768,-32768, 296, 443, 296, - 443, 208, 399, 407, 45, 161,-32768,-32768,-32768,-32768, --32768, 323,-32768, 402,-32768, 161, 161,-32768, 296, 443, --32768, 443,-32768, 375, 224, 406,-32768, 271,-32768,-32768, --32768,-32768,-32768, 410, 401,-32768, 408, 411,-32768, 413, - 414, 48, 161,-32768,-32768,-32768,-32768,-32768, 228, 228, --32768, 416,-32768, 255, 239, 415, 272, 428,-32768,-32768, --32768, 417, 474,-32768,-32768, 430, 432, 758, 477,-32768, - 758,-32768,-32768, 418, 481,-32768, 874,-32768, 443,-32768, - 443,-32768, 758, 435,-32768,-32768, 436, 438, 439, 758, - 441,-32768, 444, 458, 442, 462,-32768, 758,-32768, 473, - 495,-32768,-32768, 354,-32768, 497, 354,-32768,-32768,-32768, --32768, 503,-32768 -}; - -static const short yypgoto[] = {-32768, - 484,-32768,-32768, 493, 0, 423, 550,-32768, 333, 129, - 2, -51, -10, 468,-32768, -55, -67, 429, -97,-32768, - 292,-32768,-32768,-32768, 42,-32768, 529, -7,-32768,-32768, --32768,-32768, 542, -105,-32768,-32768,-32768, -2, 531, -23, --32768,-32768, 421, 270,-32768,-32768, -124,-32768,-32768,-32768, - -193, -94, 392, 19, 21,-32768,-32768,-32768, -147, 216, --32768, -133,-32768, 440, 447,-32768, 50,-32768, 353,-32768, - 379, -73, 110 -}; - - -#define YYLAST 932 - - -static const short yytable[] = { 26, - 131, 239, 294, 57, 262, 135, 120, 253, 83, 175, - 254, 84, 68, 105, 107, 293, 85, 295, 266, 73, - 76, 26, 78, 290, 238, 290, 240, 241, 242, 277, - 96, 302, 100, 59, 341, 240, 241, 242, 303, 90, - 235, 36, 182, 131, 135, 120, 121, 412, 135, 50, - 424, 117, 65, 124, 233, 130, 348, 181, 240, 241, - 242, 235, 349, 36, 138, 55, 376, 57, 286, 122, - 100, 50, 288, 240, 241, 242, 174, 71, 234, 91, - 236, 57, 91, 74, 77, 320, 79, 244, 278, 55, - 323, 185, 243, 245, 271, 74, 244, 124, 130, 104, - 135, 327, 245, 237, 255, 175, 91, 186, 314, 52, - 413, 355, 321, 425, 312, 57, 86, 83, 275, 244, - 273, 141, 104, 103, 276, 245, 384, 174, 31, 55, - 265, 52, 131, 388, 244, -20, 328, 104, 88, 55, - 245, 124, 150, 72, 75, 124, 300, 141, 151, 83, - 31, 85, 84, 298, 92, 185, 80, 85, 81, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 148, 60, - 61, 186, 174, 359, 149, 174, 187, 53, 131, 188, - 31, 101, 89, 358, 102, 124, 364, 130, 141, 240, - 241, 242, 141, 54, 94, 55, 13, 14, 97, 67, - 405, 56, 407, 135, 240, 241, 242, 115, 310, 187, - 183, 380, 188, 187, 98, 406, 55, 408, 55, 21, - 103, 382, 99, 290, 361, 290, 394, 106, 387, 246, - 246, 392, 104, 130, 103, 329, 416, 317, 417, 345, - 346, 246, 318, 314, 290, 270, 363, 402, 141, 55, - 244, 141, 317, 104, 284, 369, 245, 381, 183, 370, - 285, 401, 145, 141, 142, 244, 55, 142, 104, 55, - 131, 245, 56, 53, 104, 124, 356, -20, 146, 130, - 55, 55, 111, 55, 138, 336, 350, 55, 368, 54, - 150, 55, 351, 108, 369, 443, 151, 444, 372, 337, - 338, 369, 183, 112, 135, 429, 3, 4, 5, 6, - 174, 62, 9, 10, 11, 331, 366, 427, 367, 428, - 437, 276, 276, 439, 276, 130, 113, 148, 409, 127, - 385, 350, 393, 149, 369, 445, 276, 351, 431, 63, - 64, 135, 450, 403, 157, 158, 159, 136, 459, 143, - 456, 461, 339, 340, 396, 397, 398, 144, 145, 399, - 400, 173, 131, 177, 178, 131, 101, 356, 393, 184, - 259, 260, 246, 267, 268, 269, 272, 131, 274, 279, - 280, 281, 282, 283, 131, 120, 287, 235, 301, 305, - 306, 307, 131, 66, 309, 277, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 316, 246, 319, 322, 246, - 324, 330, 325, 326, 141, 334, 332, 130, 335, 347, - 130, 187, 342, 343, 72, 75, 442, 374, 344, 353, - 371, 354, 130, 375, 14, 378, 67, 373, 377, 130, - 419, 386, 128, 153, 246, 80, 389, 130, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 390, 313, 12, - 391, 414, 395, 410, 246, 246, 246, 246, 246, 188, - 246, 411, 420, 418, 421, 426, 434, 422, 423, 438, - 433, 440, 430, 441, 154, 13, 14, 155, 156, 17, - 18, 157, 158, 159, 160, 432, 161, 435, 446, 436, - 447, 448, 463, 449, 451, 87, 454, 153, 21, 80, - -217, 452, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 462, 1, 12, 2, 453, 455, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 114, 457, 12, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 154, 13, - 14, 155, 156, 17, 18, 157, 158, 159, 160, 458, - 161, 460, 147, 70, 13, 14, 15, 16, 17, 18, - 256, 362, 21, 19, -218, 20, 299, 14, 115, 116, - 118, 110, 119, 153, 415, 80, 383, 21, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 315, 1, 12, - 2, 311, 304, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 66, 308, 12, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 154, 13, 14, 155, 156, 17, - 18, 157, 158, 159, 160, 333, 161, 365, 0, 0, - 13, 14, 15, 16, 17, 18, 0, 0, 21, 19, - 0, 20, 0, 14, 357, 67, 0, 0, 0, 0, - 0, 128, 80, 21, 0, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 0, 80, 0, 379, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 0, 66, 0, - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 0, 0, 13, 14, 296, 297, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 13, 14, 0, 67, 0, - 0, 0, 0, 0, 0, 21, 0, 0, 0, 14, - 0, 67, 0, 0, 0, 189, 190, 128, 21, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 66, 212, 0, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 0, 0, 0, 213, 214, 215, 216, 217, - 0, 0, 218, 219, 220, 0, 221, 0, 0, 222, - 223, 224, 225, 226, 227, 228, 0, 0, 0, 0, - 0, 14, 0, 67, 0, 0, 0, 0, 66, 128, - 129, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 66, 123, 0, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 66, 0, 0, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 0, 0, 0, 0, 0, 14, - 0, 67, 0, 0, 0, 0, 0, 128, 360, 0, - 0, 14, 0, 67, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 14, 137, 67, 66, 0, 0, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 66, 0, - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 67 -}; - -static const short yycheck[] = { 0, - 56, 99, 150, 2, 110, 57, 3, 102, 19, 77, - 3, 19, 13, 37, 38, 149, 19, 151, 113, 3, - 3, 22, 3, 148, 98, 150, 3, 4, 5, 3, - 29, 3, 31, 8, 3, 3, 4, 5, 163, 3, - 3, 0, 3, 99, 96, 3, 43, 3, 100, 0, - 3, 52, 56, 54, 40, 56, 61, 81, 3, 4, - 5, 3, 67, 22, 65, 58, 3, 66, 142, 66, - 69, 22, 146, 3, 4, 5, 77, 3, 64, 43, - 43, 80, 43, 67, 67, 43, 67, 64, 62, 58, - 188, 40, 60, 70, 118, 67, 64, 98, 99, 67, - 152, 43, 70, 66, 103, 173, 43, 56, 176, 0, - 66, 40, 186, 66, 54, 114, 3, 128, 57, 64, - 121, 40, 67, 63, 63, 70, 320, 128, 0, 58, - 60, 22, 188, 327, 64, 54, 234, 67, 54, 58, - 70, 142, 61, 15, 16, 146, 154, 40, 67, 160, - 22, 154, 160, 154, 26, 40, 3, 160, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 61, 8, - 9, 56, 173, 279, 67, 176, 61, 40, 234, 64, - 52, 59, 3, 278, 62, 186, 281, 188, 40, 3, - 4, 5, 40, 56, 55, 58, 43, 44, 40, 46, - 348, 64, 350, 255, 3, 4, 5, 45, 46, 61, - 82, 54, 64, 61, 56, 349, 58, 351, 58, 66, - 63, 316, 64, 348, 280, 350, 332, 62, 326, 101, - 102, 40, 67, 234, 63, 236, 370, 63, 372, 263, - 264, 113, 68, 311, 369, 117, 60, 342, 40, 58, - 64, 40, 63, 67, 57, 63, 70, 68, 130, 67, - 63, 60, 40, 40, 56, 64, 58, 56, 67, 58, - 326, 70, 64, 40, 67, 276, 275, 54, 56, 280, - 58, 58, 61, 58, 285, 58, 61, 58, 289, 56, - 61, 58, 67, 44, 63, 429, 67, 431, 67, 72, - 73, 63, 174, 61, 356, 67, 6, 7, 8, 9, - 311, 11, 12, 13, 14, 57, 57, 63, 57, 65, - 418, 63, 63, 421, 63, 326, 59, 61, 352, 44, - 57, 61, 331, 67, 63, 433, 63, 67, 67, 7, - 8, 393, 440, 344, 49, 50, 51, 8, 454, 3, - 448, 457, 69, 70, 336, 337, 338, 64, 40, 339, - 340, 67, 418, 67, 3, 421, 59, 366, 367, 64, - 4, 18, 244, 3, 3, 3, 61, 433, 3, 65, - 63, 59, 3, 3, 440, 3, 65, 3, 3, 61, - 54, 68, 448, 3, 54, 3, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 62, 278, 65, 4, 281, - 60, 3, 65, 64, 40, 4, 65, 418, 60, 60, - 421, 61, 59, 68, 296, 297, 427, 3, 64, 64, - 68, 64, 433, 3, 44, 3, 46, 68, 61, 440, - 40, 65, 52, 1, 316, 3, 65, 448, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 64, 68, 17, - 64, 60, 65, 65, 336, 337, 338, 339, 340, 64, - 342, 65, 65, 64, 64, 60, 3, 65, 65, 3, - 64, 64, 68, 3, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 68, 54, 68, 64, 68, - 65, 64, 0, 65, 64, 22, 65, 1, 66, 3, - 68, 68, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 0, 1, 17, 3, 68, 65, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 3, 65, 17, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 65, - 54, 65, 70, 14, 43, 44, 45, 46, 47, 48, - 103, 280, 66, 52, 68, 54, 154, 44, 45, 46, - 52, 40, 52, 1, 369, 3, 317, 66, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 177, 1, 17, - 3, 173, 163, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 3, 167, 17, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 244, 54, 285, -1, -1, - 43, 44, 45, 46, 47, 48, -1, -1, 66, 52, - -1, 54, -1, 44, 276, 46, -1, -1, -1, -1, - -1, 52, 3, 66, -1, 6, 7, 8, 9, 10, - 11, 12, 13, 14, -1, 3, -1, 68, 6, 7, - 8, 9, 10, 11, 12, 13, 14, -1, 3, -1, - -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, - -1, -1, 43, 44, 45, 46, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 43, 44, -1, 46, -1, - -1, -1, -1, -1, -1, 66, -1, -1, -1, 44, - -1, 46, -1, -1, -1, 15, 16, 52, 66, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 3, 41, -1, 6, 7, 8, 9, 10, 11, 12, - 13, 14, -1, -1, -1, 55, 56, 57, 58, 59, - -1, -1, 62, 63, 64, -1, 66, -1, -1, 69, - 70, 71, 72, 73, 74, 75, -1, -1, -1, -1, - -1, 44, -1, 46, -1, -1, -1, -1, 3, 52, - 53, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, -1, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 3, -1, -1, 6, 7, 8, 9, 10, - 11, 12, 13, 14, -1, -1, -1, -1, -1, 44, - -1, 46, -1, -1, -1, -1, -1, 52, 53, -1, - -1, 44, -1, 46, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 44, 45, 46, 3, -1, -1, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 3, -1, - -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 44, -1, 46, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 46 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/etc/bison.simple" -/* This file comes from bison-1.28. */ - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) || (defined (__BEOS__) && defined (__MWERKS__)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ - -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX yylex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) -{ - register char *t = to; - register char *f = from; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#line 217 "/etc/bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -#ifdef YYPARSE_PARAM -int yyparse (void *); -#else -int yyparse (void); -#endif -#endif - -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -#define YYPOPSTACK (yyvsp--, yyssp--) -#endif - - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; - -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss - 1; - yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif - -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif - - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { -#ifndef YYSTACK_USE_ALLOCA - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif -#endif - } - return 2; - } - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif -#endif /* no yyoverflow */ - - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif - - goto yybackup; - yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - yystate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -yydefault: - - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (yydebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 4: -#line 422 "parser.y" -{ - log_printf("IGNORING extern \"C\" { ... } block.\n"); - free(yyvsp[-1].string); -; - break;} -case 5: -#line 427 "parser.y" -{ - yyvsp[0].elt->kind = INLINED_KIND; - log_printf("\nBEGIN matched dec : m_f_i rule --"); - print_se(yyvsp[0].elt); - log_printf("END matched dec : m_f_i rule\n"); -; - break;} -case 6: -#line 434 "parser.y" -{ - yyvsp[0].elt->kind = SKEL_KIND; - log_printf("\nBEGIN matched dec : function_skeleton rule --"); - print_se(yyvsp[0].elt); - enqueue_skeleton(yyvsp[0].elt); - log_printf("END matched dec : function_skeleton rule\n"); -; - break;} -case 8: -#line 443 "parser.y" -{ - log_printf("declaration : error. Attempting to recover...\n"); - yyerrok; - yyclearin; - if (error_recovery() != 0) { - log_printf("ERROR recovery could not complete -- YYABORT.\n"); - YYABORT; - } - log_printf("ERROR recovery complete.\n"); -; - break;} -case 9: -#line 457 "parser.y" -{ - /* the name of the rule "member_specifier" might be misleading, but - * this is either a class, struct, union, enum, global var, global - * prototype, etc.. */ - if (yyvsp[0].elt->kind == CLASS_KIND || yyvsp[0].elt->kind == STRUCT_KIND) { - enqueue_class(yyvsp[0].elt); - } else { - log_printf("\nIGNORING dec_spec : mem_spec (%s) --", - string_kind(yyvsp[0].elt->kind)); - print_se(yyvsp[0].elt); - log_printf("END IGNORING dec_spec : mem_spec (%s)\n", - string_kind(yyvsp[0].elt->kind)); - } -; - break;} -case 11: -#line 476 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), yyvsp[0].string, NULL, IGNORE_KIND); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 12: -#line 483 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), yyvsp[0].string, NULL, IGNORE_KIND); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 14: -#line 493 "parser.y" -{ yyval.flag = 0; ; - break;} -case 15: -#line 494 "parser.y" -{ yyval.flag = 1; ; - break;} -case 16: -#line 499 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + (yyvsp[0].flag ? 2 : 0) + 1); - strcpy(tmp_str, yyvsp[-1].string); - if (yyvsp[0].flag) - strcat(tmp_str, " &"); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 17: -#line 508 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + (yyvsp[0].flag ? 2 : 0) + 7); - sprintf(tmp_str, "const %s%s", yyvsp[-1].string, (yyvsp[0].flag ? " &" : "")); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 18: -#line 517 "parser.y" -{ free(yyvsp[0].string); ; - break;} -case 19: -#line 518 "parser.y" -{ free(yyvsp[0].string); ; - break;} -case 20: -#line 519 "parser.y" -{ free(yyvsp[0].string); ; - break;} -case 21: -#line 520 "parser.y" -{ free(yyvsp[0].string); ; - break;} -case 24: -#line 527 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 8); - strcpy(tmp_str, "struct "); - strcat(tmp_str, yyvsp[0].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 25: -#line 535 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-3].string) + strlen(yyvsp[-1].string) + 3); - sprintf(tmp_str, "%s<%s>", yyvsp[-3].string, yyvsp[-1].string); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 26: -#line 543 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-3].string) + strlen(yyvsp[-1].string) + 3); - sprintf(tmp_str, "%s<%s>", yyvsp[-3].string, yyvsp[-1].string); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 27: -#line 551 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-4].string) + strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s<%s> %s", yyvsp[-4].string, yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-4].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 28: -#line 560 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-4].string) + strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s<%s> %s", yyvsp[-4].string, yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-4].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 29: -#line 569 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 30: -#line 577 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 31: -#line 585 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 9); - sprintf(tmp_str, "struct %s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 33: -#line 594 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 35: -#line 606 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 8); - strcpy(tmp_str,"signed "); - strcat(tmp_str, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 36: -#line 615 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 10); - strcpy(tmp_str,"unsigned "); - strcat(tmp_str, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 39: -#line 629 "parser.y" -{ - yyval.string = strdup("short int"); - free(yyvsp[-1].string); - free(yyvsp[0].string); -; - break;} -case 42: -#line 637 "parser.y" -{ - yyval.string = strdup("long int"); - free(yyvsp[-1].string); - free(yyvsp[0].string); -; - break;} -case 43: -#line 643 "parser.y" -{ - yyval.string = strdup("long long"); - free(yyvsp[-1].string); - free(yyvsp[0].string); -; - break;} -case 44: -#line 649 "parser.y" -{ - yyval.string = strdup("long long int"); - free(yyvsp[-2].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); -; - break;} -case 49: -#line 663 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s::%s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 50: -#line 671 "parser.y" -{ - /* control-Y programming! */ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s::%s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 52: -#line 684 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 1); - strcpy(tmp_str,yyvsp[-1].string); - strcat(tmp_str,yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 53: -#line 695 "parser.y" -{ yyval.string = strdup("*"); ; - break;} -case 54: -#line 696 "parser.y" -{ yyval.string = strdup("*const "); ; - break;} -case 55: -#line 701 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = yyvsp[-1].string; - new_arg->name = yyvsp[0].string; - new_arg->array = NULL; - new_arg->next = NULL; - yyval.arg = new_arg; -; - break;} -case 56: -#line 710 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = yyvsp[-1].string; - new_arg->name = yyvsp[0].string; - new_arg->array = NULL; - new_arg->next = NULL; - yyval.arg = new_arg; -; - break;} -case 57: -#line 719 "parser.y" -{ - char *old_array = yyvsp[-3].arg->array; - int old_len = old_array ? strlen(old_array) : 0; - yyvsp[-3].arg->array = (char *) malloc(strlen(yyvsp[-1].string) + old_len + 3); - sprintf(yyvsp[-3].arg->array, "%s[%s]", old_array ? old_array : "", yyvsp[-1].string); - free(yyvsp[-1].string); - if (old_array) - free(old_array); - yyval.arg = yyvsp[-3].arg; -; - break;} -case 58: -#line 730 "parser.y" -{ - char *old_array = yyvsp[-2].arg->array; - int old_len = old_array ? strlen(old_array) : 0; - yyvsp[-2].arg->array = (char *) malloc(old_len + 3); - sprintf(yyvsp[-2].arg->array, "%s[]", old_array ? old_array : ""); - if (old_array) - free(old_array); - yyval.arg = yyvsp[-2].arg; -; - break;} -case 60: -#line 743 "parser.y" -{ free(yyvsp[0].string); yyval.string = yyvsp[-2].string;; - break;} -case 62: -#line 749 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 63: -#line 757 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-3].string) + strlen(yyvsp[-1].string) + 3); - sprintf(tmp_str, "%s[%s]", yyvsp[-3].string, yyvsp[-1].string); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 64: -#line 765 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + 3); - strcpy(tmp_str, yyvsp[-2].string); - strcat(tmp_str, "[]"); - free(yyvsp[-2].string); - yyval.string = tmp_str; -; - break;} -case 66: -#line 776 "parser.y" -{ yyval.arg = yyvsp[0].arg; ; - break;} -case 67: -#line 778 "parser.y" -{ - free(yyvsp[0].string); - yyval.arg = yyvsp[-2].arg; -; - break;} -case 68: -#line 786 "parser.y" -{ - yyval.string = args_to_string(yyvsp[0].arg, 0); - free_args(yyvsp[0].arg); -; - break;} -case 69: -#line 791 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s, %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 70: -#line 802 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 2); - sprintf(tmp_str, "%s;", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 71: -#line 809 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[-1].string) + 3); - sprintf(tmp_str, "%s\n%s;", yyvsp[-2].string, yyvsp[-1].string); - free(yyvsp[-2].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 72: -#line 820 "parser.y" -{ - yyval.arg = NULL; -; - break;} -case 73: -#line 824 "parser.y" -{ - yyval.arg = reverse_arg_list(yyvsp[0].arg); -; - break;} -case 74: -#line 828 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = strdup("..."); - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = yyvsp[-2].arg; - yyval.arg = reverse_arg_list(new_arg); -; - break;} -case 75: -#line 837 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = strdup("..."); - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - yyval.arg = new_arg; -; - break;} -case 78: -#line 851 "parser.y" -{ - yyvsp[0].arg->next = yyvsp[-2].arg; - yyval.arg = yyvsp[0].arg; -; - break;} -case 79: -#line 856 "parser.y" -{ - yyvsp[0].arg->next = yyvsp[-2].arg; - yyval.arg = yyvsp[0].arg; -; - break;} -case 80: -#line 864 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = yyvsp[0].string; - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - yyval.arg = new_arg; -; - break;} -case 81: -#line 873 "parser.y" -{ - arg_t *new_arg = (arg_t *) malloc(sizeof(arg_t)); - new_arg->type = yyvsp[-2].string; - new_arg->name = NULL; - new_arg->array = NULL; - new_arg->next = NULL; - free(yyvsp[0].string); - yyval.arg = new_arg; -; - break;} -case 82: -#line 883 "parser.y" -{ - char *old_array = yyvsp[-3].arg->array; - int old_len = old_array ? strlen(old_array) : 0; - yyvsp[-3].arg->array = (char *) malloc(strlen(yyvsp[-1].string) + old_len + 3); - sprintf(yyvsp[-3].arg->array, "%s[%s]", old_array ? old_array : "", yyvsp[-1].string); - free(yyvsp[-1].string); - if (old_array) - free(old_array); - yyval.arg = yyvsp[-3].arg; -; - break;} -case 83: -#line 894 "parser.y" -{ - char *old_array = yyvsp[-2].arg->array; - int old_len = old_array ? strlen(old_array) : 0; - yyvsp[-2].arg->array = (char *) malloc(old_len + 3); - sprintf(yyvsp[-2].arg->array, "%s[]", old_array ? old_array : ""); - if (old_array) - free(old_array); - yyval.arg = yyvsp[-2].arg; -; - break;} -case 85: -#line 908 "parser.y" -{ if (collectMemberInitList() != 0) YYERROR; ; - break;} -case 87: -#line 910 "parser.y" -{ - /* I think this is the correct behavior, but skel_elemcmp is wrong */ - /* $2->templ = $1; */ - free(yyvsp[-2].string); - yyval.elt = yyvsp[-1].elt; -; - break;} -case 88: -#line 917 "parser.y" -{ if (collectMemberInitList() != 0) YYERROR; ; - break;} -case 89: -#line 918 "parser.y" -{ - /* I think this is the correct behavior, but skel_elemcmp is wrong */ - /* $2->templ = $1; */ - free(yyvsp[-4].string); - yyval.elt = yyvsp[-3].elt; -; - break;} -case 91: -#line 929 "parser.y" -{ if (collectMemberInitList() != 0) YYERROR; ; - break;} -case 93: -#line 934 "parser.y" -{ - yyvsp[-2].elt->const_flag = yyvsp[-1].flag; - yyvsp[-2].elt->throw_decl = yyvsp[0].string; - yyval.elt = yyvsp[-2].elt; -; - break;} -case 96: -#line 945 "parser.y" -{ - yyvsp[-2].elt->const_flag = yyvsp[-1].flag; - yyvsp[-2].elt->throw_decl = yyvsp[0].string; - yyval.elt = yyvsp[-2].elt; -; - break;} -case 99: -#line 957 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-4].string, yyvsp[-3].string, yyvsp[-1].arg, FUNC_KIND); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 100: -#line 964 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-9].string, - (char *) malloc(strlen(yyvsp[-8].string) + strlen(yyvsp[-6].string) + strlen(yyvsp[-3].string) + 5), - yyvsp[-1].arg, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", yyvsp[-8].string, yyvsp[-6].string, yyvsp[-3].string); - free(yyvsp[-8].string); - free(yyvsp[-6].string); - free(yyvsp[-3].string); - yyval.elt = elem; -; - break;} -case 102: -#line 982 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-4].string, yyvsp[-3].string, yyvsp[-1].arg, FUNC_KIND); - print_se(elem); - yyval.elt = elem; -; - break;} -case 104: -#line 993 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-7].string, (char *)malloc(strlen(yyvsp[-6].string) + strlen(yyvsp[-3].string) + 12), - yyvsp[-1].arg, FUNC_KIND); - sprintf(elem->name, "%s::operator%s", yyvsp[-6].string, yyvsp[-3].string); - free(yyvsp[-6].string); - free(yyvsp[-3].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 105: -#line 1004 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *)malloc(strlen(yyvsp[-5].string) + strlen(yyvsp[-2].string) + 13), - NULL, FUNC_KIND); - sprintf(elem->name, "%s::operator %s", yyvsp[-5].string, yyvsp[-2].string); - free(yyvsp[-5].string); - free(yyvsp[-2].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 106: -#line 1016 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-7].string, (char *)malloc(strlen(yyvsp[-6].string) + strlen(yyvsp[-3].string) + 12), - yyvsp[-1].arg, FUNC_KIND); - sprintf(elem->name, "%s::operator%s", yyvsp[-6].string, yyvsp[-3].string); - free(yyvsp[-6].string); - free(yyvsp[-3].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 107: -#line 1027 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *)malloc(strlen(yyvsp[-5].string) + strlen(yyvsp[-2].string) + 13), - NULL, FUNC_KIND); - sprintf(elem->name, "%s::operator %s", yyvsp[-5].string, yyvsp[-2].string); - free(yyvsp[-5].string); - free(yyvsp[-2].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 108: -#line 1042 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(yyvsp[-5].string, (char *)malloc(strlen(yyvsp[-3].string) + 9), - yyvsp[-1].arg, FUNC_KIND); - sprintf(elem->name, "operator%s", yyvsp[-3].string); - free(yyvsp[-3].string); - print_se(elem); - yyval.elt = elem; -; - break;} -case 109: -#line 1052 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), (char *)malloc(strlen(yyvsp[-2].string) + 10), - NULL, FUNC_KIND); - sprintf(elem->name, "operator %s", yyvsp[-2].string); - free(yyvsp[-2].string); - print_se(elem); - yyval.elt = elem; -; - break;} -case 110: -#line 1064 "parser.y" -{ yyval.flag = 0; ; - break;} -case 111: -#line 1065 "parser.y" -{ yyval.flag = 1; ; - break;} -case 112: -#line 1069 "parser.y" -{ yyval.string = NULL; ; - break;} -case 113: -#line 1071 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 8); - sprintf(tmp_str, "throw(%s)", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 115: -#line 1082 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s, %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 116: -#line 1093 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), (char *) malloc(strlen(yyvsp[-2].string) + 2), - NULL, FUNC_KIND); - sprintf(elem->name,"~%s", yyvsp[-2].string); - free(yyvsp[-2].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 117: -#line 1106 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-5].string) + strlen(yyvsp[-2].string) + 4), - NULL, FUNC_KIND); - sprintf(elem->name,"%s::~%s", yyvsp[-5].string, yyvsp[-2].string); - free(yyvsp[-5].string); - free(yyvsp[-2].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 118: -#line 1118 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-5].string) + strlen(yyvsp[-2].string) + 4), - NULL, FUNC_KIND); - sprintf(elem->name,"%s::~%s", yyvsp[-5].string, yyvsp[-2].string); - free(yyvsp[-5].string); - free(yyvsp[-2].string); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 119: -#line 1130 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-8].string) + strlen(yyvsp[-6].string) + strlen(yyvsp[-2].string) + 6), - NULL, FUNC_KIND); - sprintf(elem->name,"%s<%s>::~%s", yyvsp[-8].string, yyvsp[-6].string, yyvsp[-2].string); - free(yyvsp[-8].string); - free(yyvsp[-6].string); - free(yyvsp[-2].string); - yyval.elt = elem; -; - break;} -case 120: -#line 1142 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-8].string) + strlen(yyvsp[-6].string) + strlen(yyvsp[-2].string) + 6), - NULL, FUNC_KIND); - sprintf(elem->name,"%s<%s>::~%s", yyvsp[-8].string, yyvsp[-6].string, yyvsp[-2].string); - free(yyvsp[-8].string); - free(yyvsp[-6].string); - free(yyvsp[-2].string); - yyval.elt = elem; -; - break;} -case 121: -#line 1157 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), yyvsp[-4].string, yyvsp[-2].arg, FUNC_KIND); - elem->throw_decl = yyvsp[0].string; -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 122: -#line 1168 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), yyvsp[-4].string, yyvsp[-2].arg, FUNC_KIND); - elem->throw_decl = yyvsp[0].string; -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 123: -#line 1176 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-9].string) + strlen(yyvsp[-7].string) + strlen(yyvsp[-4].string) + 5), - yyvsp[-2].arg, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", yyvsp[-9].string, yyvsp[-7].string, yyvsp[-4].string); - free(yyvsp[-9].string); - free(yyvsp[-7].string); - free(yyvsp[-4].string); - elem->throw_decl = yyvsp[0].string; - yyval.elt = elem; -; - break;} -case 124: -#line 1189 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), - (char *) malloc(strlen(yyvsp[-9].string) + strlen(yyvsp[-7].string) + strlen(yyvsp[-4].string) + 5), - yyvsp[-2].arg, FUNC_KIND); - sprintf(elem->name,"%s<%s>::%s", yyvsp[-9].string, yyvsp[-7].string, yyvsp[-4].string); - free(yyvsp[-9].string); - free(yyvsp[-7].string); - free(yyvsp[-4].string); - elem->throw_decl = yyvsp[0].string; - yyval.elt = elem; -; - break;} -case 125: -#line 1204 "parser.y" -{ if (collectInlineDef() != 0) YYERROR; ; - break;} -case 127: -#line 1209 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 10); - sprintf(tmp_str, "enum { %s }", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 128: -#line 1216 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-3].string) + strlen(yyvsp[-1].string) + 11); - sprintf(tmp_str, "enum %s { %s }", yyvsp[-3].string, yyvsp[-1].string); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 129: -#line 1224 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 6); - sprintf(tmp_str, "enum %s", yyvsp[0].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 131: -#line 1235 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s, %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 133: -#line 1247 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s=%s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 141: -#line 1273 "parser.y" -{ yyval.string = strdup("&"); ; - break;} -case 142: -#line 1274 "parser.y" -{ yyval.string = strdup("*"); ; - break;} -case 143: -#line 1275 "parser.y" -{ yyval.string = strdup("+"); ; - break;} -case 144: -#line 1276 "parser.y" -{ yyval.string = strdup("-"); ; - break;} -case 145: -#line 1277 "parser.y" -{ yyval.string = strdup("~"); ; - break;} -case 146: -#line 1278 "parser.y" -{ yyval.string = strdup("!"); ; - break;} -case 147: -#line 1282 "parser.y" -{ yyval.string = strdup("/"); ; - break;} -case 148: -#line 1283 "parser.y" -{ yyval.string = strdup("%"); ; - break;} -case 149: -#line 1284 "parser.y" -{ yyval.string = strdup("^"); ; - break;} -case 150: -#line 1285 "parser.y" -{ yyval.string = strdup("|"); ; - break;} -case 151: -#line 1286 "parser.y" -{ yyval.string = strdup("<"); ; - break;} -case 152: -#line 1287 "parser.y" -{ yyval.string = strdup(">"); ; - break;} -case 153: -#line 1288 "parser.y" -{ yyval.string = strdup(","); ; - break;} -case 154: -#line 1292 "parser.y" -{ yyval.string = strdup("="); ; - break;} -case 155: -#line 1293 "parser.y" -{ yyval.string = strdup("*="); ; - break;} -case 156: -#line 1294 "parser.y" -{ yyval.string = strdup("/="); ; - break;} -case 157: -#line 1295 "parser.y" -{ yyval.string = strdup("%="); ; - break;} -case 158: -#line 1296 "parser.y" -{ yyval.string = strdup("+="); ; - break;} -case 159: -#line 1297 "parser.y" -{ yyval.string = strdup("-="); ; - break;} -case 160: -#line 1298 "parser.y" -{ yyval.string = strdup("<<="); ; - break;} -case 161: -#line 1299 "parser.y" -{ yyval.string = strdup(">>="); ; - break;} -case 162: -#line 1300 "parser.y" -{ yyval.string = strdup("&="); ; - break;} -case 163: -#line 1301 "parser.y" -{ yyval.string = strdup("^="); ; - break;} -case 164: -#line 1302 "parser.y" -{ yyval.string = strdup("|="); ; - break;} -case 168: -#line 1309 "parser.y" -{ yyval.string = strdup(" new"); ; - break;} -case 169: -#line 1310 "parser.y" -{ yyval.string = strdup(" delete"); ; - break;} -case 170: -#line 1311 "parser.y" -{ yyval.string = strdup("->"); ; - break;} -case 171: -#line 1312 "parser.y" -{ yyval.string = strdup("->*"); ; - break;} -case 172: -#line 1313 "parser.y" -{ yyval.string = strdup("++"); ; - break;} -case 173: -#line 1314 "parser.y" -{ yyval.string = strdup("--"); ; - break;} -case 174: -#line 1315 "parser.y" -{ yyval.string = strdup("<<"); ; - break;} -case 175: -#line 1316 "parser.y" -{ yyval.string = strdup(">>"); ; - break;} -case 176: -#line 1317 "parser.y" -{ yyval.string = strdup("<="); ; - break;} -case 177: -#line 1318 "parser.y" -{ yyval.string = strdup(">="); ; - break;} -case 178: -#line 1319 "parser.y" -{ yyval.string = strdup("=="); ; - break;} -case 179: -#line 1320 "parser.y" -{ yyval.string = strdup("!="); ; - break;} -case 180: -#line 1321 "parser.y" -{ yyval.string = strdup("&&"); ; - break;} -case 181: -#line 1322 "parser.y" -{ yyval.string = strdup("||"); ; - break;} -case 182: -#line 1323 "parser.y" -{ yyval.string = strdup("[]"); ; - break;} -case 183: -#line 1324 "parser.y" -{ yyval.string = strdup("()"); ; - break;} -case 185: -#line 1329 "parser.y" -{ yyval.string = strdup("{ ... }"); ; - break;} -case 188: -#line 1339 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "-%s", yyvsp[0].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 192: -#line 1349 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 3); - sprintf(tmp_str, "(%s)", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 194: -#line 1360 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s * %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 195: -#line 1368 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s / %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 196: -#line 1376 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s %% %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 198: -#line 1388 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s + %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 199: -#line 1396 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 4); - sprintf(tmp_str, "%s - %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 200: -#line 1408 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-3].string) + strlen(yyvsp[-1].string) + 12); - sprintf(tmp_str, "union %s { %s }", yyvsp[-3].string, yyvsp[-1].string); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 201: -#line 1416 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 11); - sprintf(tmp_str, "union { %s }", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -case 202: -#line 1423 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 7); - sprintf(tmp_str, "union %s", yyvsp[0].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 203: -#line 1433 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-3].string, NULL, CLASS_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 204: -#line 1446 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-5].string, NULL, CLASS_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 205: -#line 1459 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-3].string, NULL, CLASS_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - tmp_elem->templ = yyvsp[-5].string; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 206: -#line 1473 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-5].string, NULL, CLASS_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - tmp_elem->templ = yyvsp[-7].string; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 207: -#line 1487 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), "unnamed_struct", - NULL, IGNORE_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 208: -#line 1501 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-3].string, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 209: -#line 1514 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-5].string, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 210: -#line 1527 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-3].string, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - tmp_elem->templ = yyvsp[-5].string; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 211: -#line 1541 "parser.y" -{ - syntaxelem_t *child; - /* ret_type, name, args, kind */ - syntaxelem_t *tmp_elem = new_elem(strdup(""), yyvsp[-5].string, NULL, STRUCT_KIND); - tmp_elem->children = reverse_list(yyvsp[-1].elt); - tmp_elem->templ = yyvsp[-7].string; - - for (child = tmp_elem->children; child != NULL; child = child->next) - child->parent = tmp_elem; - -/* print_se(tmp_elem); */ - yyval.elt = tmp_elem; -; - break;} -case 214: -#line 1562 "parser.y" -{ free(yyvsp[0].string); ; - break;} -case 215: -#line 1566 "parser.y" -{ yyvsp[0].elt->kind = IGNORE_KIND; ; - break;} -case 217: -#line 1571 "parser.y" -{ yyval.elt = NULL; ; - break;} -case 219: -#line 1577 "parser.y" -{ - if (yyvsp[0].elt != NULL) - yyvsp[0].elt->next = NULL; - - yyval.elt = yyvsp[0].elt; -; - break;} -case 220: -#line 1584 "parser.y" -{ - if (yyvsp[0].elt != NULL) { - yyvsp[0].elt->next = yyvsp[-1].elt; - yyval.elt = yyvsp[0].elt; - } else { - yyval.elt = yyvsp[-1].elt; - } -; - break;} -case 222: -#line 1597 "parser.y" -{ - log_printf("member_with_access : error. Attempting to recover...\n"); - yyerrok; - yyclearin; - if (error_recovery() != 0) { - log_printf("ERROR recovery could not complete -- YYABORT.\n"); - YYABORT; - } - log_printf("ERROR recovery complete.\n"); - yyval.elt = NULL; -; - break;} -case 224: -#line 1612 "parser.y" -{ yyval.elt = yyvsp[0].elt; ; - break;} -case 226: -#line 1617 "parser.y" -{ yyval.elt = NULL; ; - break;} -case 227: -#line 1618 "parser.y" -{ yyvsp[0].elt->kind = INLINED_KIND; yyval.elt = yyvsp[0].elt; ; - break;} -case 228: -#line 1619 "parser.y" -{ yyval.elt = NULL; ; - break;} -case 229: -#line 1624 "parser.y" -{ - /* ret_type, name, args, kind */ - syntaxelem_t *elem = new_elem(strdup(""), yyvsp[0].string, NULL, IGNORE_KIND); -/* print_se(elem); */ - yyval.elt = elem; -; - break;} -case 231: -#line 1631 "parser.y" -{ yyval.elt = yyvsp[0].elt; ; - break;} -case 232: -#line 1632 "parser.y" -{ yyvsp[-2].elt->kind = IGNORE_KIND; free(yyvsp[0].string); yyval.elt = yyvsp[-2].elt; ; - break;} -case 235: -#line 1638 "parser.y" -{ free(yyvsp[0].string); yyval.elt = yyvsp[-1].elt; ; - break;} -case 237: -#line 1641 "parser.y" -{ - free(yyvsp[-1].string); - yyval.elt = yyvsp[-3].elt; -; - break;} -case 238: -#line 1649 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[0].string) + 7); - sprintf(tmp_str, "class %s", yyvsp[0].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 239: -#line 1656 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + strlen(yyvsp[0].string) + 2); - sprintf(tmp_str, "%s %s", yyvsp[-1].string, yyvsp[0].string); - free(yyvsp[-1].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 241: -#line 1668 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s, %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 245: -#line 1685 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-2].string) + strlen(yyvsp[0].string) + 3); - sprintf(tmp_str, "%s, %s", yyvsp[-2].string, yyvsp[0].string); - free(yyvsp[-2].string); - free(yyvsp[0].string); - yyval.string = tmp_str; -; - break;} -case 246: -#line 1696 "parser.y" -{ - char *tmp_str = (char *) malloc(strlen(yyvsp[-1].string) + 12); - sprintf(tmp_str, "template <%s>", yyvsp[-1].string); - free(yyvsp[-1].string); - yyval.string = tmp_str; -; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 543 "/etc/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++yyvsp = yyval; - -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -yyerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); - } - - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - yystate = yyn; - goto yynewstate; - - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { -#ifndef YYSTACK_USE_ALLOCA - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif -#endif - } - return 0; - - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) - { -#ifndef YYSTACK_USE_ALLOCA - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif -#endif - } - return 1; -} -#line 1704 "parser.y" - - -static int yyerror(char *s /*UNUSED*/) -{ - if (outfile != NULL) - fflush(outfile); - - return 0; -} - -static int error_recovery() -{ - extern char linebuf[]; - extern int lineno; - extern int column; - extern int tokens_seen; - -#ifdef SGDEBUG - log_printf("parse error at line %d, file %s:\n%s\n%*s\n", - lineno, currentFile, linebuf, column, "^"); - log_flush(); -#endif /* SGDEBUG */ - - if (tokens_seen == 0) { - /* - * if we've seen no tokens but we're in an error, we must have - * hit an EOF, either by stdin, or on a file. Just give up - * now instead of complaining. - */ - return -1; - - } else { - fprintf(stderr, "parse error at line %d, file %s:\n%s\n%*s\n", - lineno, currentFile, linebuf, column, "^"); - } - - linebuf[0] = '\0'; - - for (;;) { - int result = yylex(); - - if (result <= 0) { - /* fatal error: Unexpected EOF during parse error recovery */ - -#ifdef SGDEBUG - log_printf("EOF in error recovery, line %d, file %s\n", - lineno, currentFile); - log_flush(); -#endif /* SGDEBUG */ - - fprintf(stderr, "EOF in error recovery, line %d, file %s\n", - lineno, currentFile); - - return -1; - } - - switch(result) { - case IDENTIFIER: - case CONSTANT: - case STRING_LITERAL: - case CHAR: - case SHORT: - case INT: - case LONG: - case SIGNED: - case UNSIGNED: - case FLOAT: - case DOUBLE: - case VOID: - free(yylval.string); - break; - case (int) '{': - if (collectInlineDef() != 0) - return -1; - result = yylex(); - return 0; - case (int) ';': - return 0; - } - } -} diff --git a/bepascal/bepascal/stubgen/y.tab.h b/bepascal/bepascal/stubgen/y.tab.h deleted file mode 100644 index 90828eb..0000000 --- a/bepascal/bepascal/stubgen/y.tab.h +++ /dev/null @@ -1,60 +0,0 @@ -typedef union { - char *string; - syntaxelem_t *elt; - arg_t *arg; - int flag; -} YYSTYPE; -#define IDENTIFIER 257 -#define CONSTANT 258 -#define STRING_LITERAL 259 -#define CHAR 260 -#define SHORT 261 -#define INT 262 -#define LONG 263 -#define SIGNED 264 -#define UNSIGNED 265 -#define FLOAT 266 -#define DOUBLE 267 -#define VOID 268 -#define NEW 269 -#define DELETE 270 -#define TEMPLATE 271 -#define THROW 272 -#define PTR_OP 273 -#define INC_OP 274 -#define DEC_OP 275 -#define LEFT_OP 276 -#define RIGHT_OP 277 -#define LE_OP 278 -#define GE_OP 279 -#define EQ_OP 280 -#define NE_OP 281 -#define AND_OP 282 -#define OR_OP 283 -#define MUL_ASSIGN 284 -#define DIV_ASSIGN 285 -#define MOD_ASSIGN 286 -#define ADD_ASSIGN 287 -#define SUB_ASSIGN 288 -#define LEFT_ASSIGN 289 -#define RIGHT_ASSIGN 290 -#define AND_ASSIGN 291 -#define XOR_ASSIGN 292 -#define OR_ASSIGN 293 -#define CLCL 294 -#define MEM_PTR_OP 295 -#define FRIEND 296 -#define OPERATOR 297 -#define CONST 298 -#define CLASS 299 -#define STRUCT 300 -#define UNION 301 -#define ENUM 302 -#define PROTECTED 303 -#define PRIVATE 304 -#define PUBLIC 305 -#define EXTERN 306 -#define ELIPSIS 307 - - -extern YYSTYPE yylval; diff --git a/bepascal/bepascal/test_app/hello.pp b/bepascal/bepascal/test_app/hello.pp deleted file mode 100644 index 25336bb..0000000 --- a/bepascal/bepascal/test_app/hello.pp +++ /dev/null @@ -1,198 +0,0 @@ -{ 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 -} - -program Hello; - -{$M+} -uses - beobj, application, message, _beep, roster, SysUtils, - archivable, handler, toto, rect, window, view, graphicdefs, dataio, - invoker, messenger, Control, Button; - -type - TMonApplication = class(TApplication) - public - procedure ReadyToRun; override; - procedure MessageReceived(aMessage : TMessage); override; - function QuitRequested : boolean; override; - end; - TMyWindow = class(TWindow) - private - aView : TView; - aButton : TButton; - public - constructor Create(aFrame : TRect; title : PChar; atype, aFlags, aWorkspaces : Cardinal); override; - destructor Destroy; override; - procedure MessageReceived(amessage : TMessage); override; - end; - TMonObjet = class(TObject) - private - FMessage : string; - public - constructor Create; - destructor Destroy; override; - procedure Bonjour(test : string); - published - property Message : string read FMessage write FMessage; - end; - -var - MonObj : TMonObjet; - -constructor TMyWindow.Create(aFrame : TRect; title : PChar; atype, aFlags, aWorkspaces : Cardinal); -var - aRect, aRect2 : TRect; - rgb_color : TRGB_color; - mess : TMessage; -begin - inherited; - aRect := TRect.Create(20, 20, 100, 100); - try - aRect2 := TRect.Create(110, 110, 150, 150); - try - aView := TView.Create(aRect, 'Test', B_FOLLOW_ALL, B_WILL_DRAW); - rgb_color.red := 255; - rgb_color.green := 0; - rgb_color.blue := 0; - rgb_color.alpha := 0; - aView.SetViewColor(rgb_color); - Self.AddChild(aView, nil); - mess := TMessage.Create(77777); - aButton := TButton.Create(aRect2, 'Test2', 'Test2', mess, B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE); - aButton.SetViewColor(rgb_color); - WriteLn('before addchild'); - Self.AddChild(aButton, nil); - WriteLn('after addchild'); -// aButton.Invoker.SetTarget(aView, nil); - if aButton.IsEnabled then - WriteLn('Actif'); - finally - aRect2.Free; - end; - finally - aRect.Free; - end; -end; - -destructor TMyWindow.Destroy; -begin -// aButton.Free; -// aView.Free; - inherited; -end; - -procedure TMyWindow.MessageReceived(aMessage : TMessage); -begin - inherited; - WriteLn('TMyWindow réception'); - WriteLn(Self.ClassName + '.MessageReceived'); -end; - -function TMonApplication.QuitRequested : boolean; -begin - Result := inherited; - be_app.Free; -end; - -procedure TMonApplication.ReadyToRun; -var - Mess : TMessage; -begin - inherited; - if MonObj <> nil then - MonObj.Bonjour('BONJOUR'); - Mess := TMessage.Create; - try - Mess.What := 7777; - be_roster.Broadcast(Mess); - finally - Mess.Free; - end; -end; - -procedure TMonApplication.MessageReceived(aMessage : TMessage); -begin - inherited; - WriteLn(IntToStr(aMessage.What)); -end; - -constructor TMonObjet.Create; -//var -// a, b : string; -// c : longint; -begin - inherited; -// GetLineInfo($A0000DB4, a, b, c); -// Writeln(a + ' ' + b + ' ' + IntToStr(c)); - WriteLn('Constructor'); -end; - -procedure TMonObjet.Bonjour(test : string); -//var -// a, b : string; -// c : longint; -begin -// GetLineInfo($8002AEA5, a, b, c); -// Writeln(a + ' ' + b + ' ' + IntToStr(c)); - WriteLn(test); - beep; - WriteLn('Fin de ' + test); -end; - -destructor TMonObjet.Destroy; -var - point : TPoint; - rect : TRect; -begin - point := TPoint.Create(10, 20); - rect := TRect.Create(10.0, 10.0, 10.0, 20.0); - try - point.PrintToStream; - point.Sept(15, 30); - rect.PrintToStream; - finally - point.PrintToStream; - point.Free; - rect.Free; - end; - WriteLn('The End'); - inherited; -end; - -var - aRect : TRect; - win : TMyWindow; - -begin - beep; - Write('Hello world !' + #13#10); - MonObj := TMonObjet.Create; - TMonApplication.Create; - try - aRect := TRect.Create(20, 20, 200, 200); - win := TMyWindow.Create(aRect, 'Bonjour', 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 - MonObj.Free; - aRect.Free; - win.Free; - end; -end. diff --git a/bepascal/bepascal/test_app/test.pp b/bepascal/bepascal/test_app/test.pp deleted file mode 100644 index 8a8c8ae..0000000 --- a/bepascal/bepascal/test_app/test.pp +++ /dev/null @@ -1,40 +0,0 @@ -{ 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 -} - -program test; - -{$M+} - -type - TTest = class; - TObjet = class(TObject) - private - public - end; - TTest = class(TObject); external; -var - obj : TObjet; -begin - writeln('Bonjour'); - obj := TObjet.Create; - try - writeln('Bonjour'); - finally - obj.Free; - end; -end. \ No newline at end of file diff --git a/bepascal/bepascal/test_app/toto.pp b/bepascal/bepascal/test_app/toto.pp deleted file mode 100644 index 2a6c9ca..0000000 --- a/bepascal/bepascal/test_app/toto.pp +++ /dev/null @@ -1,30 +0,0 @@ -{ 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 toto; - -interface - -implementation - -initialization - Writeln('Init'); -finalization - Writeln('Final'); -end. -