New CVS organisation with new naming convention
This commit is contained in:
154
bepascal/source/bepascal/cpp/Jamfile
Normal file
154
bepascal/source/bepascal/cpp/Jamfile
Normal file
@@ -0,0 +1,154 @@
|
||||
SubDir BEPASCAL_TOP source bepascal cpp ;
|
||||
|
||||
## OpenBeOS Generic Jamfile v1.0 ##
|
||||
|
||||
## Fill in this file to specify the project being created, and the referenced
|
||||
## Jamfile-engine will do all of the hard work for you. This handles both
|
||||
## Intel and PowerPC builds of the (Open)BeOS.
|
||||
|
||||
## Application Specific Settings ---------------------------------------------
|
||||
|
||||
# Specify the name of the binary
|
||||
# If the name has spaces, you must quote it: "My App"
|
||||
NAME = libbepascal.so ;
|
||||
|
||||
# Specify the type of binary
|
||||
# APP: Application
|
||||
# SHARED: Shared library or add-on
|
||||
# STATIC: Static library archive
|
||||
# DRIVER: Kernel Driver
|
||||
TYPE = SHARED ;
|
||||
|
||||
# Specify the source files to use
|
||||
# Full paths or paths relative to the Jamfile can be included.
|
||||
# All files, regardless of directory, will have their object
|
||||
# files created in the common object directory.
|
||||
# Note that this means this Jamfile will not work correctly
|
||||
# if two source files with the same name (source.c or source.cpp)
|
||||
# are included from different directories.
|
||||
# Ex: SRCS = file1.cpp file2.cpp file3.cpp ;
|
||||
SRCS = src/be/bepas_kernel/beobj.cpp
|
||||
src/be/app/Application.cpp
|
||||
src/be/app/Clipboard.cpp
|
||||
src/be/app/Handler.cpp
|
||||
src/be/app/Invoker.cpp
|
||||
src/be/app/Looper.cpp
|
||||
src/be/app/Message.cpp
|
||||
src/be/app/Messenger.cpp
|
||||
src/be/app/Roster.cpp
|
||||
src/be/device/Joystick.cpp
|
||||
src/be/device/SerialPort.cpp
|
||||
src/be/interface/Alert.cpp
|
||||
src/be/interface/Box.cpp
|
||||
src/be/interface/Button.cpp
|
||||
src/be/interface/CheckBox.cpp
|
||||
src/be/interface/Control.cpp
|
||||
src/be/interface/Font.cpp
|
||||
src/be/interface/ListItem.cpp
|
||||
src/be/interface/ListView.cpp
|
||||
src/be/interface/Menu.cpp
|
||||
src/be/interface/MenuBar.cpp
|
||||
src/be/interface/MenuItem.cpp
|
||||
src/be/interface/OutlineListView.cpp
|
||||
src/be/interface/Point.cpp
|
||||
src/be/interface/Rect.cpp
|
||||
src/be/interface/RadioButton.cpp
|
||||
src/be/interface/ScrollBar.cpp
|
||||
src/be/interface/ScrollView.cpp
|
||||
src/be/interface/StatusBar.cpp
|
||||
src/be/interface/StringView.cpp
|
||||
src/be/interface/TabView.cpp
|
||||
src/be/interface/TextControl.cpp
|
||||
src/be/interface/TextView.cpp
|
||||
src/be/interface/View.cpp
|
||||
src/be/interface/Window.cpp
|
||||
src/be/mail/E-mail.cpp
|
||||
src/be/storage/Volume.cpp
|
||||
src/be/storage/VolumeRoster.cpp
|
||||
src/be/support/Archivable.cpp
|
||||
src/be/support/DataIO.cpp
|
||||
src/be/support/Flattenable.cpp
|
||||
src/be/support/List.cpp
|
||||
src/be/support/String.cpp
|
||||
src/hey/hey.cpp ;
|
||||
|
||||
# Specify the resource files to use
|
||||
# Full path or a relative path to the resource file can be used.
|
||||
RSRCS = ;
|
||||
|
||||
# Specify additional libraries to link against
|
||||
# There are two acceptable forms of library specifications
|
||||
# - if your library follows the naming pattern of:
|
||||
# libXXX.so or libXXX.a you can simply specify XXX
|
||||
# library: libbe.so entry: be
|
||||
#
|
||||
# - if your library does not follow the standard library
|
||||
# naming scheme you need to specify the path to the library
|
||||
# and it's name
|
||||
# library: my_lib.a entry: my_lib.a or path/my_lib.a
|
||||
LIBS = be mail device ;
|
||||
|
||||
# Specify additional paths to directories following the standard
|
||||
# libXXX.so or libXXX.a naming scheme. You can specify full paths
|
||||
# or paths relative to the Jamfile. The paths included may not
|
||||
# be recursive, so include all of the paths where libraries can
|
||||
# be found. Directories where source files are found are
|
||||
# automatically included.
|
||||
LIBPATHS = ;
|
||||
|
||||
# Additional paths to look for system headers
|
||||
# These use the form: #include <header>
|
||||
# source file directories are NOT auto-included here
|
||||
SYSTEM_INCLUDE_PATHS = $(SEARCH_SOURCE)/include/be/app
|
||||
$(SEARCH_SOURCE)/include/be/bepas_kernel
|
||||
$(SEARCH_SOURCE)/include/be/interface
|
||||
$(SEARCH_SOURCE)/include/be/support
|
||||
$(SEARCH_SOURCE)/include/hey ;
|
||||
|
||||
# Additional paths to look for local headers
|
||||
# thes use the form: #include "header"
|
||||
# source file directories are automatically included
|
||||
LOCAL_INCLUDE_PATHS = ;
|
||||
|
||||
# Specify the level of optimization that you desire
|
||||
# NONE, SOME, FULL
|
||||
OPTIMIZE = ;
|
||||
|
||||
# Specify any preprocessor symbols to be defined. The symbols will not
|
||||
# have their values set automatically; you must supply the value (if any)
|
||||
# to use. For example, setting DEFINES to "DEBUG=1" will cause the
|
||||
# compiler option "-DDEBUG=1" to be used. Setting DEFINES to "DEBUG"
|
||||
# would pass "-DDEBUG" on the compiler's command line.
|
||||
DEFINES = ;
|
||||
|
||||
# Specify special warning levels
|
||||
# if unspecified default warnings will be used
|
||||
# NONE = supress all warnings
|
||||
# ALL = enable all warnings
|
||||
WARNINGS = ;
|
||||
|
||||
# Specify whether image symbols will be created
|
||||
# so that stack crawls in the debugger are meaningful
|
||||
# if TRUE symbols will be created
|
||||
SYMBOLS = ;
|
||||
|
||||
# Specify debug settings
|
||||
# if TRUE will allow application to be run from a source-level
|
||||
# debugger. Note that this will disable all optimzation.
|
||||
DEBUGGER = ;
|
||||
|
||||
# Specify additional compiler flags for all files
|
||||
COMPILER_FLAGS = ;
|
||||
|
||||
# Specify additional linker flags
|
||||
LINKER_FLAGS = ;
|
||||
|
||||
# (for TYPE == DRIVER only) Specify desired location of driver in the /dev
|
||||
# hierarchy. Used by the driverinstall rule. E.g., DRIVER_PATH = video/usb will
|
||||
# instruct the driverinstall rule to place a symlink to your driver's binary in
|
||||
# ~/add-ons/kernel/drivers/dev/video/usb, so that your driver will appear at
|
||||
# /dev/video/usb when loaded. Default is "misc".
|
||||
DRIVER_PATH = ;
|
||||
|
||||
## Include the Jamfile-engine
|
||||
include $(BUILDHOME)/etc/Jamfile-engine ;
|
||||
56
bepascal/source/bepascal/cpp/include/be/app/application.h
Normal file
56
bepascal/source/bepascal/cpp/include/be/app/application.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _APPLICATION_H_
|
||||
#define _APPLICATION_H_
|
||||
|
||||
#include <Application.h>
|
||||
#include <Archivable.h>
|
||||
#include <Message.h>
|
||||
|
||||
// #include <Control.cpp>
|
||||
|
||||
#include <window.h>
|
||||
#include <view.h>
|
||||
#include <point.h>
|
||||
#include <rect.h>
|
||||
|
||||
#include <roster.h>
|
||||
#include <looper.h>
|
||||
#include <handler.h>
|
||||
#include <archivable.h>
|
||||
#include <message.h>
|
||||
#include <beobj.h>
|
||||
|
||||
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_ */
|
||||
41
bepascal/source/bepascal/cpp/include/be/app/handler.h
Normal file
41
bepascal/source/bepascal/cpp/include/be/app/handler.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _HANDLER_H_
|
||||
#define _HANDLER_H_
|
||||
|
||||
#include <Handler.h>
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
// 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_ */
|
||||
46
bepascal/source/bepascal/cpp/include/be/app/looper.h
Normal file
46
bepascal/source/bepascal/cpp/include/be/app/looper.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _LOOPER_H_
|
||||
#define _LOOPER_H_
|
||||
|
||||
#include <Looper.h>
|
||||
#include <Message.h>
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#include <handler.h>
|
||||
|
||||
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_ */
|
||||
38
bepascal/source/bepascal/cpp/include/be/app/message.h
Normal file
38
bepascal/source/bepascal/cpp/include/be/app/message.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _MESSAGE_H_
|
||||
#define _MESSAGE_H_
|
||||
|
||||
#include <Application.h>
|
||||
#include <Message.h>
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
class BPMessage : public BMessage, private BPasObject
|
||||
{
|
||||
public:
|
||||
BPMessage(TPasObject PasObject);
|
||||
BPMessage(TPasObject PasObject, uint32 what);
|
||||
BPMessage(TPasObject PasObject, TCPlusObject message);
|
||||
private:
|
||||
};
|
||||
|
||||
#endif /* _MESSAGE_H_ */
|
||||
24
bepascal/source/bepascal/cpp/include/be/app/roster.h
Normal file
24
bepascal/source/bepascal/cpp/include/be/app/roster.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _ROSTER_H_
|
||||
#define _ROSTER_H_
|
||||
|
||||
#include <Roster.h>
|
||||
|
||||
#endif /* _ROSTER_H_ */
|
||||
38
bepascal/source/bepascal/cpp/include/be/bepas_kernel/beobj.h
Normal file
38
bepascal/source/bepascal/cpp/include/be/bepas_kernel/beobj.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _BEOBJ_H_
|
||||
#define _BEOBJ_H_
|
||||
|
||||
typedef void* TPasObject;
|
||||
typedef void* TCPlusObject;
|
||||
|
||||
typedef char *(*BPasObject_GetPasClassName_hook)(TPasObject PasObject);
|
||||
|
||||
class BPasObject
|
||||
{
|
||||
public:
|
||||
BPasObject(TPasObject PasObject);
|
||||
TPasObject GetPasObject(void) const;
|
||||
virtual ~BPasObject(void);
|
||||
char *GetPasClassName(void);
|
||||
private:
|
||||
TPasObject FPasObject;
|
||||
};
|
||||
|
||||
#endif /* _BEOBJ_H_ */
|
||||
51
bepascal/source/bepascal/cpp/include/be/interface/control.h
Normal file
51
bepascal/source/bepascal/cpp/include/be/interface/control.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _CONTROL_H_
|
||||
#define _CONTROL_H_
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#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:
|
||||
// <BView_Constructor>
|
||||
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_ */
|
||||
33
bepascal/source/bepascal/cpp/include/be/interface/font.h
Normal file
33
bepascal/source/bepascal/cpp/include/be/interface/font.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _FONT_H_
|
||||
#define _FONT_H_
|
||||
|
||||
#include "Font.h"
|
||||
#include "Rect.h"
|
||||
#include <beobj.h>
|
||||
|
||||
class BPFont : public BFont, public BPasObject
|
||||
{
|
||||
public:
|
||||
BPFont(TPasObject PasObject);
|
||||
BPFont(TPasObject PasObject, const BFont &font);
|
||||
};
|
||||
|
||||
#endif _FONT_H_ /* _FONT_H_ */
|
||||
79
bepascal/source/bepascal/cpp/include/be/interface/listview.h
Normal file
79
bepascal/source/bepascal/cpp/include/be/interface/listview.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _LISTVIEW_H_
|
||||
#define _LISTVIEW_H_
|
||||
|
||||
#include <ListView.h>
|
||||
#include <view.h>
|
||||
|
||||
#include <beobj.h>
|
||||
#include <OS.h>
|
||||
|
||||
#include <handler.h>
|
||||
#include <beobj.h>
|
||||
|
||||
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_ */
|
||||
43
bepascal/source/bepascal/cpp/include/be/interface/menu.h
Normal file
43
bepascal/source/bepascal/cpp/include/be/interface/menu.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef _MENU_H_
|
||||
#define _MENU_H_
|
||||
|
||||
#include "Menu.h"
|
||||
#include "menu.h"
|
||||
#include "Messenger.h"
|
||||
#include "view.h"
|
||||
#include <beobj.h>
|
||||
|
||||
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_ */
|
||||
43
bepascal/source/bepascal/cpp/include/be/interface/menubar.h
Normal file
43
bepascal/source/bepascal/cpp/include/be/interface/menubar.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef _MENUBAR_H_
|
||||
#define _MENUBAR_H_
|
||||
|
||||
#include "MenuBar.h"
|
||||
#include "menu.h"
|
||||
#include <beobj.h>
|
||||
|
||||
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_ */
|
||||
51
bepascal/source/bepascal/cpp/include/be/interface/menuitem.h
Normal file
51
bepascal/source/bepascal/cpp/include/be/interface/menuitem.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _MENUITEM_H_
|
||||
#define _MENUITEM_H_
|
||||
|
||||
#include <Menu.h>
|
||||
#include <MenuItem.h>
|
||||
#include <beobj.h>
|
||||
|
||||
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_ */
|
||||
34
bepascal/source/bepascal/cpp/include/be/interface/point.h
Normal file
34
bepascal/source/bepascal/cpp/include/be/interface/point.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _POINT_H_
|
||||
#define _POINT_H_
|
||||
|
||||
#include <Point.h>
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
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_ */
|
||||
37
bepascal/source/bepascal/cpp/include/be/interface/rect.h
Normal file
37
bepascal/source/bepascal/cpp/include/be/interface/rect.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _RECT_H_
|
||||
#define _RECT_H_
|
||||
|
||||
#include <Point.h>
|
||||
#include <Rect.h>
|
||||
|
||||
#include <rect.h>
|
||||
#include <beobj.h>
|
||||
|
||||
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_ */
|
||||
78
bepascal/source/bepascal/cpp/include/be/interface/view.h
Normal file
78
bepascal/source/bepascal/cpp/include/be/interface/view.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _VIEW_H_
|
||||
#define _VIEW_H_
|
||||
|
||||
#include <View.h>
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
#include <handler.h>
|
||||
#include <beobj.h>
|
||||
|
||||
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_ */
|
||||
46
bepascal/source/bepascal/cpp/include/be/interface/window.h
Normal file
46
bepascal/source/bepascal/cpp/include/be/interface/window.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., s59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _WINDOW_H_
|
||||
#define _WINDOW_H_
|
||||
|
||||
#include <Window.h>
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
#include <looper.h>
|
||||
#include <window.h>
|
||||
#include <beobj.h>
|
||||
|
||||
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_ */
|
||||
42
bepascal/source/bepascal/cpp/include/be/support/archivable.h
Normal file
42
bepascal/source/bepascal/cpp/include/be/support/archivable.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _ARCHIVABLE_H_
|
||||
#define _ARCHIVABLE_H_
|
||||
|
||||
#include <Archivable.h>
|
||||
|
||||
#include <message.h>
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
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_ */
|
||||
21
bepascal/source/bepascal/cpp/include/hey/hey.h
Normal file
21
bepascal/source/bepascal/cpp/include/hey/hey.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef HEY_H
|
||||
#define HEY_H
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
__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
|
||||
174
bepascal/source/bepascal/cpp/src/be/app/Application.cpp
Normal file
174
bepascal/source/bepascal/cpp/src/be/app/Application.cpp
Normal file
@@ -0,0 +1,174 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _APPLICATION_CPP_
|
||||
#define _APPLICATION_CPP_
|
||||
|
||||
#include <Application.h>
|
||||
#include <Archivable.h>
|
||||
#include <Message.h>
|
||||
|
||||
#include <application.h>
|
||||
|
||||
// #include <Control.cpp>
|
||||
|
||||
#include <window.h>
|
||||
#include <view.h>
|
||||
#include <point.h>
|
||||
#include <rect.h>
|
||||
|
||||
#include <handler.h>
|
||||
#include <looper.h>
|
||||
#include <archivable.h>
|
||||
#include <message.h>
|
||||
#include <beobj.h>
|
||||
|
||||
// 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<BApplication*>(Application)->HideCursor();
|
||||
}
|
||||
|
||||
void BApplication_ShowCursor(TCPlusObject Application)
|
||||
{
|
||||
reinterpret_cast<BApplication*>(Application)->ShowCursor();
|
||||
}
|
||||
|
||||
thread_id BApplication_Run(TCPlusObject Application)
|
||||
{
|
||||
return reinterpret_cast<BApplication*>(Application)->Run();
|
||||
}
|
||||
|
||||
void BApplication_Quit(TCPlusObject Application)
|
||||
{
|
||||
reinterpret_cast<BApplication*>(Application)->Quit();
|
||||
}
|
||||
|
||||
status_t BApplication_GetAppInfo(TCPlusObject Application,app_info *info)
|
||||
{
|
||||
reinterpret_cast<BApplication*>(Application)->GetAppInfo(info);
|
||||
}
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _APPLICATION_CPP_ */
|
||||
273
bepascal/source/bepascal/cpp/src/be/app/Clipboard.cpp
Normal file
273
bepascal/source/bepascal/cpp/src/be/app/Clipboard.cpp
Normal file
@@ -0,0 +1,273 @@
|
||||
#ifndef _CLIPBOARD_CPP_
|
||||
#define _CLIPBOARD_CPP_
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: Clipboard.cpp
|
||||
* DATE: Fri Sep 27 23:26:07 2002
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "Clipboard.h"
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#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_ */
|
||||
78
bepascal/source/bepascal/cpp/src/be/app/Handler.cpp
Normal file
78
bepascal/source/bepascal/cpp/src/be/app/Handler.cpp
Normal file
@@ -0,0 +1,78 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _HANDLER_CPP_
|
||||
#define _HANDLER_CPP_
|
||||
|
||||
#include <Handler.h>
|
||||
|
||||
#include <handler.h>
|
||||
#include <beobj.h>
|
||||
|
||||
#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_ */
|
||||
352
bepascal/source/bepascal/cpp/src/be/app/Invoker.cpp
Normal file
352
bepascal/source/bepascal/cpp/src/be/app/Invoker.cpp
Normal file
@@ -0,0 +1,352 @@
|
||||
#ifndef _INVOKER_CPP_
|
||||
#define _INVOKER_CPP_
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: Invoker.cpp
|
||||
* DATE: Sat Nov 30 01:48:14 2002
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "Invoker.h"
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#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_ */
|
||||
131
bepascal/source/bepascal/cpp/src/be/app/Looper.cpp
Normal file
131
bepascal/source/bepascal/cpp/src/be/app/Looper.cpp
Normal file
@@ -0,0 +1,131 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _LOOPER_CPP_
|
||||
#define _LOOPER_CPP_
|
||||
|
||||
#include <Looper.h>
|
||||
#include <Message.h>
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#include <looper.h>
|
||||
#include <handler.h>
|
||||
|
||||
// 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<BLooper*>(Looper)->GetSupportedSuites(message);
|
||||
}
|
||||
|
||||
bool BLooper_LockLooper(TCPlusObject Looper)
|
||||
{
|
||||
return reinterpret_cast<BLooper*>(Looper)->LockLooper();
|
||||
}
|
||||
|
||||
status_t BLooper_LockLooperWithTimeout(TCPlusObject Looper, bigtime_t timeout)
|
||||
{
|
||||
return reinterpret_cast<BLooper*>(Looper)->LockLooperWithTimeout(timeout);
|
||||
}
|
||||
|
||||
void BLooper_UnlockLooper(TCPlusObject Looper)
|
||||
{
|
||||
reinterpret_cast<BLooper*>(Looper)->UnlockLooper();
|
||||
}
|
||||
|
||||
status_t BLooper_PostMessage_2(TCPlusObject Looper, uint32 command)
|
||||
{
|
||||
return reinterpret_cast<BLooper*>(Looper)->PostMessage(command);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LOOPER_CPP_ */
|
||||
247
bepascal/source/bepascal/cpp/src/be/app/Message.cpp
Normal file
247
bepascal/source/bepascal/cpp/src/be/app/Message.cpp
Normal file
@@ -0,0 +1,247 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _MESSAGE_CPP_
|
||||
#define _MESSAGE_CPP_
|
||||
|
||||
#include <Application.h>
|
||||
#include <Message.h>
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#include <message.h>
|
||||
#include <beobj.h>
|
||||
|
||||
#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<BMessage&>(message)), BPasObject(PasObject)
|
||||
{
|
||||
// Attention, problème potentiel avec le reinterpret_cast de la référence
|
||||
// A tester !
|
||||
// Je ne suis pas sur de la correspondance entre le C++ et le pascal
|
||||
}
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
TCPlusObject BMessage_Create_1(TPasObject PasObject)
|
||||
{
|
||||
return new BPMessage(PasObject);
|
||||
}
|
||||
|
||||
TCPlusObject BMessage_Create_2(TPasObject PasObject, uint32 what)
|
||||
{
|
||||
return new BPMessage(PasObject, what);
|
||||
}
|
||||
|
||||
TCPlusObject BMessage_Create_3(TPasObject PasObject, TCPlusObject message)
|
||||
{
|
||||
return new BPMessage(PasObject, message);
|
||||
}
|
||||
|
||||
void BMessage_Free(TCPlusObject message)
|
||||
{
|
||||
delete message;
|
||||
}
|
||||
|
||||
uint32 BMessage_Getwhat(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->what;
|
||||
}
|
||||
|
||||
void BMessage_Setwhat(TCPlusObject message, uint32 what)
|
||||
{
|
||||
reinterpret_cast<BMessage*>(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<BMessage*>(message)->AddData(name, type, data,
|
||||
fixedSize, numItems);
|
||||
}
|
||||
|
||||
status_t BMessage_AddBool(TCPlusObject message, const char *name, bool aBool)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->AddBool(name, aBool);
|
||||
}
|
||||
|
||||
status_t BMessage_AddInt8(TCPlusObject message, const char *name, int8 anInt8)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->AddInt8(name, anInt8);
|
||||
}
|
||||
|
||||
status_t BMessage_FindInt8(TCPlusObject message,const char *name, int8 *value)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->FindInt8(name, value);
|
||||
}
|
||||
|
||||
|
||||
status_t BMessage_AddInt16(TCPlusObject message, const char *name, int16 anInt16)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->AddInt16(name, anInt16);
|
||||
}
|
||||
|
||||
status_t BMessage_AddInt32(TCPlusObject message, const char *name, int32 anInt32)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->AddInt32(name, anInt32);
|
||||
}
|
||||
|
||||
status_t BMessage_AddInt64(TCPlusObject message, const char *name, int64 anInt64)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->AddInt64(name, anInt64);
|
||||
}
|
||||
|
||||
status_t BMessage_AddFloat(TCPlusObject message, const char *name, float aFloat)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->AddFloat(name, aFloat);
|
||||
}
|
||||
|
||||
status_t BMessage_AddDouble(TCPlusObject message, const char *name, double aDouble)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->AddDouble(name, aDouble);
|
||||
}
|
||||
|
||||
status_t BMessage_AddString(TCPlusObject message, const char *name, const char *string)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->AddString(name, string);
|
||||
}
|
||||
|
||||
status_t BMessage_FindString(TCPlusObject message,const char *name, const char **str)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->FindString(name, str);
|
||||
}
|
||||
|
||||
|
||||
status_t BMessage_AddMessage(TCPlusObject message, const char *name, const TCPlusObject amessage)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->AddMessage(name, reinterpret_cast<BMessage*>(amessage));
|
||||
}
|
||||
|
||||
int32 BMessage_CountNames(TCPlusObject message, type_code type)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->CountNames(type);
|
||||
}
|
||||
|
||||
bool BMessage_HasSpecifiers(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->HasSpecifiers();
|
||||
}
|
||||
|
||||
bool BMessage_IsSystem(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->IsSystem();
|
||||
}
|
||||
|
||||
status_t BMessage_MakeEmpty(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->MakeEmpty();
|
||||
}
|
||||
|
||||
bool BMessage_IsEmpty(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->IsEmpty();
|
||||
}
|
||||
|
||||
status_t BMessage_RemoveName(TCPlusObject message, const char *name)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->RemoveName(name);
|
||||
}
|
||||
|
||||
void BMessage_PrintToStream(TCPlusObject message)
|
||||
{
|
||||
reinterpret_cast<BMessage*>(message)->PrintToStream();
|
||||
}
|
||||
|
||||
status_t BMessage_RemoveData(TCPlusObject message, const char *name, int32 index = 0)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->RemoveData(name, index);
|
||||
}
|
||||
|
||||
bool BMessage_WasDelivered(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->WasDelivered();
|
||||
}
|
||||
|
||||
bool BMessage_IsSourceRemote(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->IsSourceRemote();
|
||||
}
|
||||
|
||||
bool BMessage_IsSourceWaiting(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->IsSourceWaiting();
|
||||
}
|
||||
|
||||
bool BMessage_IsReply(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->IsReply();
|
||||
}
|
||||
|
||||
const BMessage *BMessage_Previous(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->Previous();
|
||||
}
|
||||
|
||||
bool BMessage_WasDropped(TCPlusObject message)
|
||||
{
|
||||
return reinterpret_cast<BMessage*>(message)->WasDropped();
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BMessage::operator=
|
||||
* Params: const BMessage &msg
|
||||
* Returns: BMessage &
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
BMessage &
|
||||
BMessage_operator_equal(BMessage *Message, const BMessage &msg)
|
||||
{
|
||||
return Message->operator=(msg);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _MESSAGE_CPP_ */
|
||||
280
bepascal/source/bepascal/cpp/src/be/app/Messenger.cpp
Normal file
280
bepascal/source/bepascal/cpp/src/be/app/Messenger.cpp
Normal file
@@ -0,0 +1,280 @@
|
||||
#ifndef _MESSENGER_CPP_
|
||||
#define _MESSENGER_CPP_
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: Messenger.cpp
|
||||
* DATE: Sat Nov 30 02:32:17 2002
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
|
||||
#include "Messenger.h"
|
||||
#include "Application.h"
|
||||
#include <beobj.h>
|
||||
|
||||
#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_ */
|
||||
744
bepascal/source/bepascal/cpp/src/be/app/Roster.cpp
Normal file
744
bepascal/source/bepascal/cpp/src/be/app/Roster.cpp
Normal file
@@ -0,0 +1,744 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _ROSTER_CPP_
|
||||
#define _ROSTER_CPP_
|
||||
|
||||
#include <Roster.h>
|
||||
#include <Message.h>
|
||||
|
||||
#include <beobj.h>
|
||||
#include <roster.h>
|
||||
|
||||
#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<BRoster*>(Roster)->Broadcast(reinterpret_cast<BMessage*>(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_ */
|
||||
51
bepascal/source/bepascal/cpp/src/be/bepas_kernel/beobj.cpp
Normal file
51
bepascal/source/bepascal/cpp/src/be/bepas_kernel/beobj.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _BEOBJ_CPP_
|
||||
#define _BEOBJ_CPP_
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#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_ */
|
||||
419
bepascal/source/bepascal/cpp/src/be/device/Joystick.cpp
Normal file
419
bepascal/source/bepascal/cpp/src/be/device/Joystick.cpp
Normal file
@@ -0,0 +1,419 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _JOYSTICK_CPP_
|
||||
#define _JOYSTICK_CPP_
|
||||
|
||||
|
||||
#include "Joystick.h"
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#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_ */
|
||||
441
bepascal/source/bepascal/cpp/src/be/device/SerialPort.cpp
Normal file
441
bepascal/source/bepascal/cpp/src/be/device/SerialPort.cpp
Normal file
@@ -0,0 +1,441 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _SERIALPORT_CPP_
|
||||
#define _SERIALPORT_CPP_
|
||||
|
||||
#include "SerialPort.h"
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#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_ */
|
||||
534
bepascal/source/bepascal/cpp/src/be/interface/Alert.cpp
Normal file
534
bepascal/source/bepascal/cpp/src/be/interface/Alert.cpp
Normal file
@@ -0,0 +1,534 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2003 Olivier Coursiere
|
||||
Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef _ALERT_CPP_
|
||||
#define _ALERT_CPP_
|
||||
|
||||
#include <Alert.h>
|
||||
#include "window.h"
|
||||
#include "looper.h"
|
||||
#include <beobj.h>
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
/*----- 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_ */
|
||||
676
bepascal/source/bepascal/cpp/src/be/interface/Box.cpp
Normal file
676
bepascal/source/bepascal/cpp/src/be/interface/Box.cpp
Normal file
@@ -0,0 +1,676 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2003 Olivier Coursiere
|
||||
Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _BOX_CPP_
|
||||
#define _BOX_CPP_
|
||||
|
||||
#include "Box.h"
|
||||
|
||||
#include "view.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
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 <baron>
|
||||
* 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_ */
|
||||
686
bepascal/source/bepascal/cpp/src/be/interface/Button.cpp
Normal file
686
bepascal/source/bepascal/cpp/src/be/interface/Button.cpp
Normal file
@@ -0,0 +1,686 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _BUTTON_CPP_
|
||||
#define _BUTTON_CPP_
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: Button.cpp
|
||||
* DATE: Tue Dec 3 00:28:35 2002
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "Button.h"
|
||||
|
||||
#include "control.h"
|
||||
#include <beobj.h>
|
||||
|
||||
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:
|
||||
// <BView_Constructor>
|
||||
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_ */
|
||||
627
bepascal/source/bepascal/cpp/src/be/interface/CheckBox.cpp
Normal file
627
bepascal/source/bepascal/cpp/src/be/interface/CheckBox.cpp
Normal file
@@ -0,0 +1,627 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _CHECKBOX_CPP_
|
||||
#define _CHECKBOX_CPP_
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: Button.cpp
|
||||
* DATE: Tue Dec 3 00:28:35 2002
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "CheckBox.h"
|
||||
|
||||
#include "control.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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 <baron>
|
||||
* 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_ */
|
||||
|
||||
560
bepascal/source/bepascal/cpp/src/be/interface/Control.cpp
Normal file
560
bepascal/source/bepascal/cpp/src/be/interface/Control.cpp
Normal file
@@ -0,0 +1,560 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _CONTROL_CPP_
|
||||
#define _CONTROL_CPP_
|
||||
|
||||
#include "Control.h"
|
||||
#include "Rect.h"
|
||||
#include "View.h"
|
||||
#include "Message.h"
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#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_ */
|
||||
692
bepascal/source/bepascal/cpp/src/be/interface/Font.cpp
Normal file
692
bepascal/source/bepascal/cpp/src/be/interface/Font.cpp
Normal file
@@ -0,0 +1,692 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _FONT_CPP_
|
||||
#define _FONT_CPP_
|
||||
|
||||
|
||||
#include "Font.h"
|
||||
#include "font.h"
|
||||
#include "Rect.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
|
||||
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 <baron>
|
||||
* 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_ */
|
||||
|
||||
503
bepascal/source/bepascal/cpp/src/be/interface/ListItem.cpp
Normal file
503
bepascal/source/bepascal/cpp/src/be/interface/ListItem.cpp
Normal file
@@ -0,0 +1,503 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _LISTITEM_CPP_
|
||||
#define _LISTITEM_CPP_
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: StringView.cpp
|
||||
* DATE: Mon Jan 13 21:52:29 2003
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "ListItem.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
|
||||
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 <baron>
|
||||
* 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_ */
|
||||
|
||||
1031
bepascal/source/bepascal/cpp/src/be/interface/ListView.cpp
Normal file
1031
bepascal/source/bepascal/cpp/src/be/interface/ListView.cpp
Normal file
File diff suppressed because it is too large
Load Diff
925
bepascal/source/bepascal/cpp/src/be/interface/Menu.cpp
Normal file
925
bepascal/source/bepascal/cpp/src/be/interface/Menu.cpp
Normal file
@@ -0,0 +1,925 @@
|
||||
#ifndef _MENU_CPP_
|
||||
#define _MENU_CPP_
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* 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 <beobj.h>
|
||||
|
||||
#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_ */
|
||||
642
bepascal/source/bepascal/cpp/src/be/interface/MenuBar.cpp
Normal file
642
bepascal/source/bepascal/cpp/src/be/interface/MenuBar.cpp
Normal file
@@ -0,0 +1,642 @@
|
||||
#ifndef _MENUBAR_CPP_
|
||||
#define _MENUBAR_CPP_
|
||||
|
||||
#include "MenuBar.h"
|
||||
#include "menubar.h"
|
||||
#include <beobj.h>
|
||||
|
||||
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 <baron>
|
||||
* 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_ */
|
||||
433
bepascal/source/bepascal/cpp/src/be/interface/MenuItem.cpp
Normal file
433
bepascal/source/bepascal/cpp/src/be/interface/MenuItem.cpp
Normal file
@@ -0,0 +1,433 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _MENUITEM_CPP_
|
||||
#define _MENUITEM_CPP_
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: MenuItem.cpp
|
||||
* DATE: Sat Jan 11 18:24:08 2003
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "MenuItem.h"
|
||||
#include "menuitem.h"
|
||||
#include <beobj.h>
|
||||
|
||||
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_ */
|
||||
@@ -0,0 +1,755 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _OUTLINELISTVIEW_CPP_
|
||||
#define _OUTLINELISTVIEW_CPP_
|
||||
|
||||
#include "OutlineListView.h"
|
||||
#include "view.h"
|
||||
#include <beobj.h>
|
||||
#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 <baron>
|
||||
* 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_ */
|
||||
84
bepascal/source/bepascal/cpp/src/be/interface/Point.cpp
Normal file
84
bepascal/source/bepascal/cpp/src/be/interface/Point.cpp
Normal file
@@ -0,0 +1,84 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _POINT_CPP_
|
||||
#define _POINT_CPP_
|
||||
|
||||
#include <Point.h>
|
||||
#include <Rect.h>
|
||||
|
||||
#include <point.h>
|
||||
#include <beobj.h>
|
||||
|
||||
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<BPoint*>(Point)->ConstrainTo(rect);
|
||||
}
|
||||
|
||||
void BPoint_PrintToStream(TCPlusObject Point)
|
||||
{
|
||||
reinterpret_cast<BPoint*>(Point)->PrintToStream();
|
||||
}
|
||||
|
||||
void BPoint_Set(TCPlusObject Point, float x, float y)
|
||||
{
|
||||
reinterpret_cast<BPoint*>(Point)->Set(x, y);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif _POINT_CPP_ /* _POINT_CPP_ */
|
||||
628
bepascal/source/bepascal/cpp/src/be/interface/RadioButton.cpp
Normal file
628
bepascal/source/bepascal/cpp/src/be/interface/RadioButton.cpp
Normal file
@@ -0,0 +1,628 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2003 Olivier Coursiere
|
||||
Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _RADIOBUTTON_CPP_
|
||||
#define _RADIOBUTTON_CPP_
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: RadioButton.cpp
|
||||
* DATE: Mon Jan 20 02:30:54 2003
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "RadioButton.h"
|
||||
|
||||
#include "control.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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_ */
|
||||
84
bepascal/source/bepascal/cpp/src/be/interface/Rect.cpp
Normal file
84
bepascal/source/bepascal/cpp/src/be/interface/Rect.cpp
Normal file
@@ -0,0 +1,84 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _RECT_CPP_
|
||||
#define _RECT_CPP_
|
||||
|
||||
#include <Point.h>
|
||||
#include <Rect.h>
|
||||
|
||||
#include <rect.h>
|
||||
#include <beobj.h>
|
||||
|
||||
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<BRect*>(rect)->PrintToStream();
|
||||
}
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif _RECT_CPP_ /* _RECT_CPP_ */
|
||||
635
bepascal/source/bepascal/cpp/src/be/interface/ScrollBar.cpp
Normal file
635
bepascal/source/bepascal/cpp/src/be/interface/ScrollBar.cpp
Normal file
@@ -0,0 +1,635 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _SCROLLBAR_CPP_
|
||||
#define _SCROLLBAR_CPP_
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: StringView.cpp
|
||||
* DATE: Mon Jan 13 21:52:29 2003
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "ScrollBar.h"
|
||||
#include "view.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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 <baron>
|
||||
* 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 */
|
||||
|
||||
592
bepascal/source/bepascal/cpp/src/be/interface/ScrollView.cpp
Normal file
592
bepascal/source/bepascal/cpp/src/be/interface/ScrollView.cpp
Normal file
@@ -0,0 +1,592 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _SCROLLVIEW_CPP_
|
||||
#define _SCROLLVIEW_CPP_
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: StringView.cpp
|
||||
* DATE: Mon Jan 13 21:52:29 2003
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "ScrollView.h"
|
||||
#include "view.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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 <baron>
|
||||
* 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_ */
|
||||
|
||||
657
bepascal/source/bepascal/cpp/src/be/interface/StatusBar.cpp
Normal file
657
bepascal/source/bepascal/cpp/src/be/interface/StatusBar.cpp
Normal file
@@ -0,0 +1,657 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _STATUSBAR_CPP_
|
||||
#define _STATUSBAR_CPP_
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: StringView.cpp
|
||||
* DATE: Mon Jan 13 21:52:29 2003
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "StatusBar.h"
|
||||
#include "view.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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_ */
|
||||
552
bepascal/source/bepascal/cpp/src/be/interface/StringView.cpp
Normal file
552
bepascal/source/bepascal/cpp/src/be/interface/StringView.cpp
Normal file
@@ -0,0 +1,552 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _STRINGVIEW_CPP_
|
||||
#define _STRINGVIEW_CPP_
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: StringView.cpp
|
||||
* DATE: Mon Jan 13 21:52:29 2003
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "StringView.h"
|
||||
#include "view.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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_ */
|
||||
|
||||
1180
bepascal/source/bepascal/cpp/src/be/interface/TabView.cpp
Normal file
1180
bepascal/source/bepascal/cpp/src/be/interface/TabView.cpp
Normal file
File diff suppressed because it is too large
Load Diff
807
bepascal/source/bepascal/cpp/src/be/interface/TextControl.cpp
Normal file
807
bepascal/source/bepascal/cpp/src/be/interface/TextControl.cpp
Normal file
@@ -0,0 +1,807 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _TEXTCONTROL_CPP_
|
||||
#define _TEXTCONTROL_CPP_
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: Button.cpp
|
||||
* DATE: Tue Dec 3 00:28:35 2002
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "TextControl.h"
|
||||
|
||||
#include "control.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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 <baron>
|
||||
* 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_ */
|
||||
|
||||
1684
bepascal/source/bepascal/cpp/src/be/interface/TextView.cpp
Normal file
1684
bepascal/source/bepascal/cpp/src/be/interface/TextView.cpp
Normal file
File diff suppressed because it is too large
Load Diff
580
bepascal/source/bepascal/cpp/src/be/interface/View.cpp
Normal file
580
bepascal/source/bepascal/cpp/src/be/interface/View.cpp
Normal file
@@ -0,0 +1,580 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _VIEW_CPP_
|
||||
#define _VIEW_CPP_
|
||||
|
||||
#include <View.h>
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
#include <handler.h>
|
||||
#include <view.h>
|
||||
#include <beobj.h>
|
||||
|
||||
// definition of callback function in BView
|
||||
typedef void (*BView_AllAttached_hook) (TPasObject PasObject);
|
||||
typedef void (*BView_AllDetached_hook) (TPasObject PasObject);
|
||||
typedef void (*BView_AttachedToWindow_hook) (TPasObject PasObject);
|
||||
typedef void (*BView_DetachedFromWindow_hook) (TPasObject PasObject);
|
||||
typedef void (*BView_Draw_hook) (TPasObject PasObject, TCPlusObject updateRect);
|
||||
typedef void (*BView_DrawAfterChildren_hook) (TPasObject PasObject, TCPlusObject updateRect);
|
||||
typedef void (*BView_FrameMoved_hook) (TPasObject PasObject, TCPlusObject parentPoint);
|
||||
typedef void (*BView_FrameResized_hook) (TPasObject PasObject, float width, float height);
|
||||
typedef void (*BView_GetPreferredSize_hook) (TPasObject PasObject, float *width, float *height);
|
||||
typedef void (*BView_ResizeToPreferred_hook) (TPasObject PasObject);
|
||||
typedef void (*BView_KeyDown_hook) (TPasObject PasObject, const char *bytes, int32 numBytes);
|
||||
typedef void (*BView_KeyUp_hook) (TPasObject PasObject, const char *bytes, int32 numBytes);
|
||||
typedef void (*BView_MouseDown_hook) (TPasObject PasObject, TCPlusObject point);
|
||||
typedef void (*BView_MouseMoved_hook) (TPasObject PasObject, TCPlusObject point, uint32 transit, TCPlusObject message);
|
||||
typedef void (*BView_MouseUp_hook) (TPasObject PasObject, TCPlusObject point);
|
||||
typedef void (*BView_Pulse_hook) (TPasObject PasObject);
|
||||
typedef void (*BView_TargetedByScrollView_hook) (TPasObject PasObject, TCPlusObject scroller);
|
||||
typedef void (*BView_WindowActivated_hook) (TPasObject PasObject, bool active);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint32 _B_FOLLOW_NONE = B_FOLLOW_NONE;
|
||||
uint32 _B_FOLLOW_ALL_SIDES = B_FOLLOW_ALL_SIDES;
|
||||
uint32 _B_FOLLOW_ALL = B_FOLLOW_ALL;
|
||||
|
||||
uint32 _B_FOLLOW_LEFT = B_FOLLOW_LEFT;
|
||||
uint32 _B_FOLLOW_RIGHT = B_FOLLOW_RIGHT;
|
||||
uint32 _B_FOLLOW_LEFT_RIGHT = B_FOLLOW_LEFT_RIGHT;
|
||||
uint32 _B_FOLLOW_H_CENTER = B_FOLLOW_H_CENTER;
|
||||
|
||||
uint32 _B_FOLLOW_TOP = B_FOLLOW_TOP;
|
||||
uint32 _B_FOLLOW_BOTTOM = B_FOLLOW_BOTTOM;
|
||||
uint32 _B_FOLLOW_TOP_BOTTOM = B_FOLLOW_TOP_BOTTOM;
|
||||
uint32 _B_FOLLOW_V_CENTER = B_FOLLOW_V_CENTER;
|
||||
|
||||
BView_AllAttached_hook View_AllAttached_hook;
|
||||
BView_AllDetached_hook View_AllDetached_hook;
|
||||
BView_AttachedToWindow_hook View_AttachedToWindow_hook;
|
||||
BView_DetachedFromWindow_hook View_DetachedFromWindow_hook;
|
||||
BView_Draw_hook View_Draw_hook;
|
||||
BView_DrawAfterChildren_hook View_DrawAfterChildren_hook;
|
||||
BView_FrameMoved_hook View_FrameMoved_hook;
|
||||
BView_FrameResized_hook View_FrameResized_hook;
|
||||
BView_GetPreferredSize_hook View_GetPreferredSize_hook;
|
||||
BView_ResizeToPreferred_hook View_ResizeToPreferred_hook;
|
||||
BView_KeyDown_hook View_KeyDown_hook;
|
||||
BView_KeyUp_hook View_KeyUp_hook;
|
||||
BView_MouseDown_hook View_MouseDown_hook;
|
||||
BView_MouseMoved_hook View_MouseMoved_hook;
|
||||
BView_MouseUp_hook View_MouseUp_hook;
|
||||
BView_Pulse_hook View_Pulse_hook;
|
||||
BView_TargetedByScrollView_hook View_TargetedByScrollView_hook;
|
||||
BView_WindowActivated_hook View_WindowActivated_hook;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
BPView::BPView(TPasObject PasObject,
|
||||
BRect frame,
|
||||
const char *name,
|
||||
uint32 resizingMode,
|
||||
uint32 flags)
|
||||
: BView(frame, name, resizingMode, flags),
|
||||
BPHandler(PasObject),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
BPView::BPView(TPasObject PasObject, BMessage *archive)
|
||||
: BView(archive),
|
||||
BPHandler(PasObject),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
void BPView::MessageReceived(BMessage *message)
|
||||
{
|
||||
BPHandler::MessageReceived_hookCall(message);
|
||||
BView::MessageReceived(message);
|
||||
}
|
||||
|
||||
void BPView::AllAttached(void)
|
||||
{
|
||||
AllAttached_hookCall();
|
||||
}
|
||||
|
||||
void BPView::AllAttached_hookCall(void)
|
||||
{
|
||||
View_AllAttached_hook(GetPasObject());
|
||||
}
|
||||
|
||||
void BPView::AttachedToWindow(void)
|
||||
{
|
||||
BView::AttachedToWindow();
|
||||
AttachedToWindow_hookCall();
|
||||
}
|
||||
|
||||
void BPView::AttachedToWindow_hookCall(void)
|
||||
{
|
||||
View_AttachedToWindow_hook(GetPasObject());
|
||||
}
|
||||
|
||||
void BPView::AllDetached(void)
|
||||
{
|
||||
AllDetached_hookCall();
|
||||
}
|
||||
|
||||
void BPView::AllDetached_hookCall(void)
|
||||
{
|
||||
View_AllDetached_hook(GetPasObject());
|
||||
}
|
||||
|
||||
void BPView::DetachedFromWindow(void)
|
||||
{
|
||||
DetachedFromWindow_hookCall();
|
||||
}
|
||||
|
||||
void BPView::DetachedFromWindow_hookCall(void)
|
||||
{
|
||||
View_DetachedFromWindow_hook(GetPasObject());
|
||||
}
|
||||
|
||||
void BPView::Draw(BRect updateRect)
|
||||
{
|
||||
BView::Draw(updateRect);
|
||||
Draw_hookCall(updateRect);
|
||||
}
|
||||
|
||||
void BPView::Draw_hookCall(BRect updateRect)
|
||||
{
|
||||
View_Draw_hook(GetPasObject(), &updateRect);
|
||||
}
|
||||
|
||||
void BPView::DrawAfterChildren(BRect updateRect)
|
||||
{
|
||||
DrawAfterChildren_hookCall(updateRect);
|
||||
}
|
||||
|
||||
void BPView::DrawAfterChildren_hookCall(BRect updateRect)
|
||||
{
|
||||
View_DrawAfterChildren_hook(GetPasObject(), &updateRect);
|
||||
}
|
||||
|
||||
void BPView::FrameMoved(BPoint parentPoint)
|
||||
{
|
||||
FrameMoved_hookCall(parentPoint);
|
||||
}
|
||||
|
||||
void BPView::FrameMoved_hookCall(BPoint parentPoint)
|
||||
{
|
||||
View_FrameMoved_hook(GetPasObject(), &parentPoint);
|
||||
}
|
||||
|
||||
void BPView::FrameResized(float width, float height)
|
||||
{
|
||||
FrameResized_hookCall(width, height);
|
||||
}
|
||||
|
||||
void BPView::FrameResized_hookCall(float width, float height)
|
||||
{
|
||||
View_FrameResized_hook(GetPasObject(), width, height);
|
||||
}
|
||||
|
||||
void BPView::GetPreferredSize(float *width, float *height)
|
||||
{
|
||||
GetPreferredSize_hookCall(width, height);
|
||||
}
|
||||
|
||||
void BPView::GetPreferredSize_hookCall(float *width, float *height)
|
||||
{
|
||||
View_GetPreferredSize_hook(GetPasObject(), width, height);
|
||||
}
|
||||
|
||||
void BPView::ResizeToPreferred(void)
|
||||
{
|
||||
ResizeToPreferred_hookCall();
|
||||
}
|
||||
|
||||
void BPView::ResizeToPreferred_hookCall(void)
|
||||
{
|
||||
View_ResizeToPreferred_hook(GetPasObject());
|
||||
}
|
||||
|
||||
void BPView::KeyDown(const char *bytes, int32 numBytes)
|
||||
{
|
||||
KeyDown_hookCall(bytes, numBytes);
|
||||
}
|
||||
|
||||
void BPView::KeyDown_hookCall(const char *bytes, int32 numBytes)
|
||||
{
|
||||
View_KeyDown_hook(GetPasObject(), bytes, numBytes);
|
||||
}
|
||||
|
||||
void BPView::KeyUp(const char *bytes, int32 numBytes)
|
||||
{
|
||||
KeyUp_hookCall(bytes, numBytes);
|
||||
}
|
||||
|
||||
void BPView::KeyUp_hookCall(const char *bytes, int32 numBytes)
|
||||
{
|
||||
View_KeyUp_hook(GetPasObject(), bytes, numBytes);
|
||||
}
|
||||
|
||||
void BPView::MouseDown(BPoint point)
|
||||
{
|
||||
MouseDown_hookCall(point);
|
||||
}
|
||||
|
||||
void BPView::MouseDown_hookCall(BPoint point)
|
||||
{
|
||||
View_MouseDown_hook(GetPasObject(), &point);
|
||||
}
|
||||
|
||||
void BPView::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
|
||||
{
|
||||
MouseMoved_hookCall(point, transit, message);
|
||||
}
|
||||
|
||||
void BPView::MouseMoved_hookCall(BPoint point, uint32 transit, const BMessage *message)
|
||||
{
|
||||
View_MouseMoved_hook(GetPasObject(), &point, transit, &message);
|
||||
}
|
||||
|
||||
void BPView::MouseUp(BPoint point)
|
||||
{
|
||||
MouseUp_hookCall(point);
|
||||
}
|
||||
|
||||
void BPView::MouseUp_hookCall(BPoint point)
|
||||
{
|
||||
View_MouseUp_hook(GetPasObject(), &point);
|
||||
}
|
||||
|
||||
void BPView::Pulse(void)
|
||||
{
|
||||
Pulse_hookCall();
|
||||
}
|
||||
|
||||
void BPView::Pulse_hookCall(void)
|
||||
{
|
||||
View_Pulse_hook(GetPasObject());
|
||||
}
|
||||
|
||||
//void BPView::TargetedByScrollView(BScrollView *scroller)
|
||||
//{
|
||||
// View_TargetedByScrollView(GetPasObject(), scroller);
|
||||
//}
|
||||
|
||||
void BPView::WindowActivated(bool active)
|
||||
{
|
||||
WindowActivated_hookCall(active);
|
||||
}
|
||||
|
||||
void BPView::WindowActivated_hookCall(bool active)
|
||||
{
|
||||
View_WindowActivated_hook(GetPasObject(), active);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
TCPlusObject BView_Create_1(TPasObject PasObject,
|
||||
BRect frame,
|
||||
const char *name,
|
||||
uint32 resizingMode,
|
||||
uint32 flags)
|
||||
{
|
||||
return new BPView(PasObject, frame, name, resizingMode, flags);
|
||||
}
|
||||
|
||||
void BView_Free(TCPlusObject View)
|
||||
{
|
||||
delete View;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::Instantiate
|
||||
* Params: BMessage *data
|
||||
* Returns: BArchivable *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
BArchivable *
|
||||
BView_Instantiate(BView *View, BMessage *data)
|
||||
{
|
||||
return View->Instantiate(data);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::Archive
|
||||
* Params: BMessage *data, bool deep
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BView_Archive(BView *View, BMessage *data,
|
||||
bool deep)
|
||||
{
|
||||
return View->Archive(data,
|
||||
deep);
|
||||
}
|
||||
|
||||
// TODO : implement hook functions
|
||||
/***********************************************************************
|
||||
* Method: BView::AttachedToWindow
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BView_AttachedToWindow(BView *View)
|
||||
{
|
||||
View->AttachedToWindow();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::AllAttached
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BView_AllAttached(BView *View)
|
||||
{
|
||||
View->AllAttached();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::DetachedFromWindow
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BView_DetachedFromWindow(BView *View)
|
||||
{
|
||||
View->DetachedFromWindow();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::AllDetached
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BView_AllDetached(BView *View)
|
||||
{
|
||||
View->AllDetached();
|
||||
}
|
||||
|
||||
// END TODO implement hook functions
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::AddChild
|
||||
* Params: BView *child, BView *before
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BView_AddChild(BView *View, BView *child,
|
||||
BView *before)
|
||||
{
|
||||
View->AddChild(child,
|
||||
before);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::RemoveChild
|
||||
* Params: BView *child
|
||||
* Returns: bool
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
bool
|
||||
BView_RemoveChild(BView *View, BView *child)
|
||||
{
|
||||
return View->RemoveChild(child);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::CountChildren
|
||||
* Params:
|
||||
* Returns: int32
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
int32
|
||||
BView_CountChildren(BView *View)
|
||||
{
|
||||
return View->CountChildren();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::ChildAt
|
||||
* Params: int32 index
|
||||
* Returns: BView *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
BView *
|
||||
BView_ChildAt(BView *View, int32 index)
|
||||
{
|
||||
return View->ChildAt(index);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::NextSibling
|
||||
* Params:
|
||||
* Returns: BView *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
BView *
|
||||
BView_NextSibling(BView *View)
|
||||
{
|
||||
return View->NextSibling();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::PreviousSibling
|
||||
* Params:
|
||||
* Returns: BView *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
BView *
|
||||
BView_PreviousSibling(BView *View)
|
||||
{
|
||||
return View->PreviousSibling();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::RemoveSelf
|
||||
* Params:
|
||||
* Returns: bool
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
bool
|
||||
BView_RemoveSelf(BView *View)
|
||||
{
|
||||
return View->RemoveSelf();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::Window
|
||||
* Params:
|
||||
* Returns: BWindow *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
BWindow *
|
||||
BView_Window(BView *View)
|
||||
{
|
||||
return View->Window();
|
||||
}
|
||||
|
||||
|
||||
// TODO : implement hook function
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::Draw
|
||||
* Params: BRect updateRect
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BView_Draw(BView *View, BRect updateRect)
|
||||
{
|
||||
View->Draw(updateRect);
|
||||
}
|
||||
|
||||
// END TODO implement hook function
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::SetViewColor
|
||||
* Params: rgb_color c
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BView_SetViewColor(BView *View, rgb_color c)
|
||||
{
|
||||
View->SetViewColor(c);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::ViewColor
|
||||
* Params:
|
||||
* Returns: rgb_color
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
rgb_color
|
||||
BView_ViewColor(BView *View)
|
||||
{
|
||||
return View->ViewColor();
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::Show
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BView_Show(BView *View)
|
||||
{
|
||||
View->Show();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::Hide
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BView_Hide(BView *View)
|
||||
{
|
||||
View->Hide();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::IsHidden
|
||||
* Params:
|
||||
* Returns: bool
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
bool
|
||||
BView_IsHidden(BView *View)
|
||||
{
|
||||
return View->IsHidden();
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _VIEW_CPP_ */
|
||||
2103
bepascal/source/bepascal/cpp/src/be/interface/Window.cpp
Normal file
2103
bepascal/source/bepascal/cpp/src/be/interface/Window.cpp
Normal file
File diff suppressed because it is too large
Load Diff
277
bepascal/source/bepascal/cpp/src/be/mail/E-mail.cpp
Normal file
277
bepascal/source/bepascal/cpp/src/be/mail/E-mail.cpp
Normal file
@@ -0,0 +1,277 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef _MAIL_CPP_
|
||||
#define _MAIL_CPP_
|
||||
|
||||
#include "E-mail.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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_ */
|
||||
|
||||
|
||||
435
bepascal/source/bepascal/cpp/src/be/storage/FilePanel.cpp
Normal file
435
bepascal/source/bepascal/cpp/src/be/storage/FilePanel.cpp
Normal file
@@ -0,0 +1,435 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _FILEPANEL_CPP_
|
||||
#define _FILEPANEL_CPP_
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: <baron>
|
||||
* FILE: FilePanel.cpp
|
||||
* DATE: Thu Feb 13 22:49:35 2003
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "FilePanel.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
class BPFilePanel : public BFilePanel, public virtual BPasObject
|
||||
{
|
||||
|
||||
public:
|
||||
BPFilePanel(TPasObject PasObject,
|
||||
file_panel_mode mode = B_OPEN_PANEL,
|
||||
BMessenger *target = 0,
|
||||
const entry_ref *start_directory = 0,
|
||||
uint32 node_flavors = 0,
|
||||
bool allow_multiple_selection = true,
|
||||
BMessage *message = 0,
|
||||
BRefFilter * = 0,
|
||||
bool modal = false,
|
||||
bool hide_when_done = true);
|
||||
|
||||
~BPFilePanel();
|
||||
};
|
||||
|
||||
BPFilePanel::BPFilePanel(TPasObject PasObject,
|
||||
file_panel_mode mode = B_OPEN_PANEL,
|
||||
BMessenger *target = 0,
|
||||
const entry_ref *start_directory = 0,
|
||||
uint32 node_flavors = 0,
|
||||
bool allow_multiple_selection = true,
|
||||
BMessage *message = 0,
|
||||
BRefFilter *reg = 0,
|
||||
bool modal = false,
|
||||
bool hide_when_done = true)
|
||||
:BFilePanel(mode,target,start_directory,node_flavors,allow_multiple_selection, message, reg,modal, hide_when_done ),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
BPFilePanel::~BPFilePanel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::BFilePanel
|
||||
* Params: file_panel_mode mode, BMessenger *target, const entry_ref *start_directory, uint32 node_flavors, bool allow_multiple_selection, BMessage *message, BRefFilter *, bool modal, bool hide_when_done
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
TCPlusObject BFilePanel_Create(TPasObject PasObject, file_panel_mode mode, BMessenger *target, const entry_ref *start_directory, uint32 node_flavors, bool allow_multiple_selection, BMessage *message, BRefFilter *reg, bool modal, bool hide_when_done)
|
||||
{
|
||||
// return new BPFilePanel(PasObject, mode, target, start_directory, node_flavors, allow_multiple_selection, message, reg, modal, hide_when_done);
|
||||
return new BPFilePanel(PasObject, mode, target, 0, 0, false, 0, 0, true, true);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::~BFilePanel
|
||||
* Params:
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void BFilePanel_Free(BFilePanel *FilePanel)
|
||||
{
|
||||
delete FilePanel;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::Show
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_Show(BFilePanel *FilePanel)
|
||||
{
|
||||
FilePanel->Show();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::Hide
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_Hide(BFilePanel *FilePanel)
|
||||
{
|
||||
FilePanel->Hide();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::IsShowing
|
||||
* Params:
|
||||
* Returns: bool
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
bool
|
||||
BFilePanel_IsShowing(BFilePanel *FilePanel)
|
||||
{
|
||||
return FilePanel->IsShowing();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::WasHidden
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_WasHidden(BFilePanel *FilePanel)
|
||||
{
|
||||
FilePanel->WasHidden();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SelectionChanged
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SelectionChanged(BFilePanel *FilePanel)
|
||||
{
|
||||
FilePanel->SelectionChanged();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SendMessage
|
||||
* Params: const BMessenger *, BMessage *
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SendMessage(BFilePanel *FilePanel, const BMessenger *messenger, BMessage *msg)
|
||||
{
|
||||
FilePanel->SendMessage(messenger, msg);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::Window
|
||||
* Params:
|
||||
* Returns: BWindow *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
BWindow *
|
||||
BFilePanel_Window(BFilePanel *FilePanel)
|
||||
{
|
||||
return FilePanel->Window();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::Messenger
|
||||
* Params:
|
||||
* Returns: BMessenger
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
/*BMessenger
|
||||
BFilePanel_Messenger(BFilePanel *FilePanel)
|
||||
{
|
||||
return FilePanel->Messenger();
|
||||
}*/
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::RefFilter
|
||||
* Params:
|
||||
* Returns: BRefFilter *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
BRefFilter *
|
||||
BFilePanel_RefFilter(BFilePanel *FilePanel)
|
||||
{
|
||||
return FilePanel->RefFilter();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::GetPanelDirectory
|
||||
* Params: entry_ref *
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_GetPanelDirectory(BFilePanel *FilePanel, entry_ref *ref)
|
||||
{
|
||||
FilePanel->GetPanelDirectory(ref);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::PanelMode
|
||||
* Params:
|
||||
* Returns: file_panel_mode
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
file_panel_mode
|
||||
BFilePanel_PanelMode(BFilePanel *FilePanel)
|
||||
{
|
||||
// return FilePanel->PanelMode();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SetTarget
|
||||
* Params: BMessenger
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
/*void
|
||||
BFilePanel_SetTarget(BFilePanel *FilePanel, BMessenger *mess)
|
||||
{
|
||||
FilePanel->SetTarget(mess);
|
||||
}*/
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SetMessage
|
||||
* Params: BMessage *msg
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SetMessage(BFilePanel *FilePanel, BMessage *msg)
|
||||
{
|
||||
FilePanel->SetMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SetRefFilter
|
||||
* Params: BRefFilter *filter
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SetRefFilter(BFilePanel *FilePanel, BRefFilter *filter)
|
||||
{
|
||||
FilePanel->SetRefFilter(filter);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SetSaveText
|
||||
* Params: const char *text
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SetSaveText(BFilePanel *FilePanel, const char *text)
|
||||
{
|
||||
FilePanel->SetSaveText(text);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SetButtonLabel
|
||||
* Params: file_panel_button, const char *label
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SetButtonLabel(BFilePanel *FilePanel, file_panel_button z, const char *label)
|
||||
{
|
||||
FilePanel->SetButtonLabel(z, label);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SetPanelDirectory
|
||||
* Params: const BEntry *new_directory
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SetPanelDirectory(BFilePanel *FilePanel, const BEntry *new_directory)
|
||||
{
|
||||
FilePanel->SetPanelDirectory(new_directory);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SetPanelDirectory
|
||||
* Params: const BDirectory *new_directory
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SetPanelDirectory_1
|
||||
(BFilePanel *FilePanel, const BDirectory *new_directory)
|
||||
{
|
||||
FilePanel->SetPanelDirectory(new_directory);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SetPanelDirectory
|
||||
* Params: const entry_ref *new_directory
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SetPanelDirectory_2
|
||||
(BFilePanel *FilePanel, const entry_ref *new_directory)
|
||||
{
|
||||
FilePanel->SetPanelDirectory(new_directory);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SetPanelDirectory
|
||||
* Params: const char *new_directory
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SetPanelDirectory_3
|
||||
(BFilePanel *FilePanel, const char *new_directory)
|
||||
{
|
||||
FilePanel->SetPanelDirectory(new_directory);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::SetHideWhenDone
|
||||
* Params: bool
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_SetHideWhenDone(BFilePanel *FilePanel, bool z)
|
||||
{
|
||||
FilePanel->SetHideWhenDone(z);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::HidesWhenDone
|
||||
* Params: void
|
||||
* Returns: bool
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
bool
|
||||
BFilePanel_HidesWhenDone(BFilePanel *FilePanel, void)
|
||||
{
|
||||
return FilePanel->HidesWhenDone();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::Refresh
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_Refresh(BFilePanel *FilePanel)
|
||||
{
|
||||
FilePanel->Refresh();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::Rewind
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BFilePanel_Rewind(BFilePanel *FilePanel)
|
||||
{
|
||||
FilePanel->Rewind();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BFilePanel::GetNextSelectedRef
|
||||
* Params: entry_ref *
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BFilePanel_GetNextSelectedRef(BFilePanel *FilePanel, entry_ref *ref)
|
||||
{
|
||||
return FilePanel->GetNextSelectedRef(ref);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _FILEPANEL_CPP_ */
|
||||
|
||||
|
||||
|
||||
392
bepascal/source/bepascal/cpp/src/be/storage/Path.cpp
Normal file
392
bepascal/source/bepascal/cpp/src/be/storage/Path.cpp
Normal file
@@ -0,0 +1,392 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _PATH_CPP_
|
||||
#define _PATH_CPP_
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: <baron>
|
||||
* FILE: Entry.cpp
|
||||
* DATE: Wed Jul 2 22:28:34 2003
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include <beobj.h>
|
||||
#include <storage/Path.h>
|
||||
#include <Directory.h>
|
||||
|
||||
class BPPath:public BPath , public virtual BPasObject {
|
||||
public:
|
||||
BPPath(TPasObject PasObject);
|
||||
BPPath(TPasObject PasObject,const char *dir, const char *leaf = NULL,bool normalize = false);
|
||||
// BPPath(const BDirectory *dir, const char *leaf, bool normalize = false);
|
||||
BPPath(TPasObject PasObject,const BPath &path);
|
||||
BPPath(TPasObject PasObject,const BEntry *entry);
|
||||
BPPath(TPasObject PasObject,const entry_ref *ref);
|
||||
|
||||
virtual ~BPPath();
|
||||
};
|
||||
|
||||
BPPath::BPPath(TPasObject PasObject)
|
||||
:BPath(),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
BPPath::BPPath(TPasObject PasObject,const char *dir, const char *leaf = NULL,
|
||||
bool normalize = false)
|
||||
:BPath(dir, leaf ,normalize),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
BPPath::BPPath(TPasObject PasObject, const BPath &path)
|
||||
:BPath(path),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
BPPath::BPPath(TPasObject PasObject,const BEntry *entry)
|
||||
:BPath(entry),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
BPPath::BPPath(TPasObject PasObject,const entry_ref *ref)
|
||||
:BPath(ref),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BPPath::~BPPath()
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::BPath
|
||||
* Params:
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
TCPlusObject BPath_Create(TPasObject PasObject)
|
||||
{
|
||||
return new BPPath(PasObject);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::BPath
|
||||
* Params: const char *dir, const char *leaf, bool normalize
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
TCPlusObject BPath_Create_1
|
||||
(TPasObject PasObject, const char *dir, const char *leaf, bool normalize)
|
||||
{
|
||||
return new BPPath(PasObject, dir, leaf, normalize);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::BPath
|
||||
* Params: const BDirectory *dir, const char *leaf, bool normalize
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
/*TCPlusObject BPath_Create_2
|
||||
(TPasObject PasObject, const BDirectory *dir, const char *leaf, bool normalize)
|
||||
{
|
||||
return new BPPath(PasObject, dir, leaf, normalize);
|
||||
}
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::BPath
|
||||
* Params: const BPath &path
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
TCPlusObject BPath_Create_3
|
||||
(TPasObject PasObject, const BPath &path)
|
||||
{
|
||||
return new BPPath(PasObject, path);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::BPath
|
||||
* Params: const BEntry *entry
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
TCPlusObject BPath_Create_4
|
||||
(TPasObject PasObject, const BEntry *entry)
|
||||
{
|
||||
return new BPPath(PasObject, entry);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::BPath
|
||||
* Params: const entry_ref *ref
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
TCPlusObject BPath_Create_5
|
||||
(TPasObject PasObject, const entry_ref *ref)
|
||||
{
|
||||
return new BPPath(PasObject, ref);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::~BPath
|
||||
* Params:
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void BPath_Free(BPath *Path)
|
||||
{
|
||||
delete Path;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::InitCheck
|
||||
* Params:
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BPath_InitCheck(BPath *Path)
|
||||
{
|
||||
return Path->InitCheck();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::SetTo
|
||||
* Params: const char *path, const char *leaf, bool normalize
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BPath_SetTo(BPath *Path, const char *path, const char *leaf, bool normalize)
|
||||
{
|
||||
return Path->SetTo(path, leaf, normalize);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::SetTo
|
||||
* Params: const BDirectory *dir, const char *path, bool normalize
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BPath_SetTo_1
|
||||
(BPath *Path, const BDirectory *dir, const char *path, bool normalize)
|
||||
{
|
||||
return Path->SetTo(dir, path, normalize);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::SetTo
|
||||
* Params: const BEntry *entry
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BPath_SetTo_2
|
||||
(BPath *Path, const BEntry *entry)
|
||||
{
|
||||
return Path->SetTo(entry);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::SetTo
|
||||
* Params: const entry_ref *ref
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BPath_SetTo_3
|
||||
(BPath *Path, const entry_ref *ref)
|
||||
{
|
||||
return Path->SetTo(ref);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::Append
|
||||
* Params: const char *path, bool normalize
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BPath_Append(BPath *Path, const char *path, bool normalize)
|
||||
{
|
||||
return Path->Append(path, normalize);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::Unset
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BPath_Unset(BPath *Path)
|
||||
{
|
||||
Path->Unset();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::Path
|
||||
* Params:
|
||||
* Returns: const char *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
const char *
|
||||
BPath_Path(BPath *Path)
|
||||
{
|
||||
const char * test;
|
||||
test=Path->Path();
|
||||
return Path->Path();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::Leaf
|
||||
* Params:
|
||||
* Returns: const char *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
const char *
|
||||
BPath_Leaf(BPath *Path)
|
||||
{
|
||||
return Path->Leaf();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::GetParent
|
||||
* Params: BPath *
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BPath_GetParent(BPath *Path)
|
||||
{
|
||||
return Path->GetParent(Path);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::IsFixedSize
|
||||
* Params:
|
||||
* Returns: bool
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
bool
|
||||
BPath_IsFixedSize(BPath *Path)
|
||||
{
|
||||
return Path->IsFixedSize();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::TypeCode
|
||||
* Params:
|
||||
* Returns: type_code
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
type_code
|
||||
BPath_TypeCode(BPath *Path)
|
||||
{
|
||||
return Path->TypeCode();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::FlattenedSize
|
||||
* Params:
|
||||
* Returns: ssize_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
ssize_t
|
||||
BPath_FlattenedSize(BPath *Path)
|
||||
{
|
||||
return Path->FlattenedSize();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::Flatten
|
||||
* Params: void *buffer, ssize_t size
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BPath_Flatten(BPath *Path, void *buffer, ssize_t size)
|
||||
{
|
||||
return Path->Flatten(buffer, size);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::AllowsTypeCode
|
||||
* Params: type_code code
|
||||
* Returns: bool
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
bool
|
||||
BPath_AllowsTypeCode(BPath *Path, type_code code)
|
||||
{
|
||||
return Path->AllowsTypeCode(code);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BPath::Unflatten
|
||||
* Params: type_code c, const void *buf, ssize_t size
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BPath_Unflatten(BPath *Path, type_code c, const void *buf, ssize_t size)
|
||||
{
|
||||
return Path->Unflatten(c, buf, size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _PATH_CPP_ */
|
||||
|
||||
|
||||
398
bepascal/source/bepascal/cpp/src/be/storage/Volume.cpp
Normal file
398
bepascal/source/bepascal/cpp/src/be/storage/Volume.cpp
Normal file
@@ -0,0 +1,398 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef _VOLUME_CPP_
|
||||
#define _VOLUME_CPP_
|
||||
|
||||
#include "Volume.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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_ */
|
||||
|
||||
|
||||
|
||||
121
bepascal/source/bepascal/cpp/src/be/storage/VolumeRoster.cpp
Normal file
121
bepascal/source/bepascal/cpp/src/be/storage/VolumeRoster.cpp
Normal file
@@ -0,0 +1,121 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef _VOLUMEROSTER_CPP_
|
||||
#define _VOLUMEROSTER_CPP_
|
||||
|
||||
#include "VolumeRoster.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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_ */
|
||||
|
||||
115
bepascal/source/bepascal/cpp/src/be/support/Archivable.cpp
Normal file
115
bepascal/source/bepascal/cpp/src/be/support/Archivable.cpp
Normal file
@@ -0,0 +1,115 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _ARCHIVABLE_CPP_
|
||||
#define _ARCHIVABLE_CPP_
|
||||
|
||||
#include <Archivable.h>
|
||||
|
||||
#include <message.h>
|
||||
#include <archivable.h>
|
||||
#include <beobj.h>
|
||||
|
||||
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(<pascal_func>, from);
|
||||
if (validate_instantiation(from, "BPArchivable"))
|
||||
return reinterpret_cast<BPArchivable*>(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<BMessage*>(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<BMessage*>(into)->AddString("class", "BPArchivable");
|
||||
return reinterpret_cast<BPArchivable*>(archivable)->ArchiveFromPascal(reinterpret_cast<BMessage*>(into), deep);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _ARCHIVABLE_CPP_ */
|
||||
385
bepascal/source/bepascal/cpp/src/be/support/DataIO.cpp
Normal file
385
bepascal/source/bepascal/cpp/src/be/support/DataIO.cpp
Normal file
@@ -0,0 +1,385 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <DataIO.h>
|
||||
#include <beobj.h>
|
||||
|
||||
#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
|
||||
|
||||
89
bepascal/source/bepascal/cpp/src/be/support/Flattenable.cpp
Normal file
89
bepascal/source/bepascal/cpp/src/be/support/Flattenable.cpp
Normal file
@@ -0,0 +1,89 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursière
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef _FLATTENABLE_CPP_
|
||||
#define _FLATTENABLE_CPP_
|
||||
|
||||
#include "Flattenable.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
/***********************************************************************
|
||||
* AUTHOR: <baron>
|
||||
* 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_ */
|
||||
346
bepascal/source/bepascal/cpp/src/be/support/List.cpp
Normal file
346
bepascal/source/bepascal/cpp/src/be/support/List.cpp
Normal file
@@ -0,0 +1,346 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef _LIST_CPP_
|
||||
#define _LIST_CPP_
|
||||
|
||||
#include "List.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#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_ */
|
||||
|
||||
|
||||
1751
bepascal/source/bepascal/cpp/src/be/support/String.cpp
Normal file
1751
bepascal/source/bepascal/cpp/src/be/support/String.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1340
bepascal/source/bepascal/cpp/src/hey/hey.cpp
Normal file
1340
bepascal/source/bepascal/cpp/src/hey/hey.cpp
Normal file
File diff suppressed because it is too large
Load Diff
374
bepascal/source/bepascal/pas/src/be/app/appdefs.pp
Normal file
374
bepascal/source/bepascal/pas/src/be/app/appdefs.pp
Normal file
@@ -0,0 +1,374 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit appdefs;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
// System Messages Codes
|
||||
_B_ABOUT_REQUESTED : array[0..3] of Char = ('_', 'A', 'B', 'R');
|
||||
_B_WINDOW_ACTIVATED : array[0..3] of Char = ('_', 'A', 'C', 'T');
|
||||
_B_APP_ACTIVATED : array[0..3] of Char = ('_', 'A', 'C', 'T'); //* Same as B_WINDOW_ACTIVATED */
|
||||
_B_ARGV_RECEIVED : array[0..3] of Char = ('_', 'A', 'R', 'G');
|
||||
_B_QUIT_REQUESTED : array[0..3] of Char = ('_', 'Q', 'R', 'Q');
|
||||
_B_CLOSE_REQUESTED : array[0..3] of Char = ('_', 'Q', 'R', 'Q'); //* Obsolete; use B_QUIT_REQUESTED */
|
||||
_B_CANCEL : array[0..3] of Char = ('_', 'C', 'N', 'C');
|
||||
_B_KEY_DOWN : array[0..3] of Char = ('_', 'K', 'Y', 'D');
|
||||
_B_KEY_UP : array[0..3] of Char = ('_', 'K', 'Y', 'U');
|
||||
_B_UNMAPPED_KEY_DOWN : array[0..3] of Char = ('_', 'U', 'K', 'D');
|
||||
_B_UNMAPPED_KEY_UP : array[0..3] of Char = ('_', 'U', 'K', 'U');
|
||||
_B_MODIFIERS_CHANGED : array[0..3] of Char = ('_', 'M', 'C', 'H');
|
||||
_B_MINIMIZE : array[0..3] of Char = ('_', 'W', 'M', 'N');
|
||||
_B_MOUSE_DOWN : array[0..3] of Char = ('_', 'M', 'D', 'N');
|
||||
_B_MOUSE_MOVED : array[0..3] of Char = ('_', 'M', 'M', 'V');
|
||||
_B_MOUSE_ENTER_EXIT : array[0..3] of Char = ('_', 'M', 'E', 'X');
|
||||
_B_MOUSE_UP : array[0..3] of Char = ('_', 'M', 'U', 'P');
|
||||
_B_MOUSE_WHEEL_CHANGED : array[0..3] of Char = ('_', 'M', 'W', 'C');
|
||||
_B_OPEN_IN_WORKSPACE : array[0..3] of Char = ('_', 'O', 'W', 'S');
|
||||
_B_PRINTER_CHANGED : array[0..3] of Char = ('_', 'P', 'C', 'H');
|
||||
_B_PULSE : array[0..3] of Char = ('_', 'P', 'U', 'L');
|
||||
_B_READY_TO_RUN : array[0..3] of Char = ('_', 'R', 'T', 'R');
|
||||
_B_REFS_RECEIVED : array[0..3] of Char = ('_', 'R', 'R', 'C');
|
||||
_B_RELEASE_OVERLAY_LOCK : array[0..3] of Char = ('_', 'R', 'O', 'V');
|
||||
_B_ACQUIRE_OVERLAY_LOCK : array[0..3] of Char = ('_', 'A', 'O', 'V');
|
||||
_B_SCREEN_CHANGED : array[0..3] of Char = ('_', 'S', 'C', 'H');
|
||||
_B_VALUE_CHANGED : array[0..3] of Char = ('_', 'V', 'C', 'H');
|
||||
_B_VIEW_MOVED : array[0..3] of Char = ('_', 'V', 'M', 'V');
|
||||
_B_VIEW_RESIZED : array[0..3] of Char = ('_', 'V', 'R', 'S');
|
||||
_B_WINDOW_MOVED : array[0..3] of Char = ('_', 'W', 'M', 'V');
|
||||
_B_WINDOW_RESIZED : array[0..3] of Char = ('_', 'W', 'R', 'S');
|
||||
_B_WORKSPACES_CHANGED : array[0..3] of Char = ('_', 'W', 'C', 'G');
|
||||
_B_WORKSPACE_ACTIVATED : array[0..3] of Char = ('_', 'W', 'A', 'C');
|
||||
_B_ZOOM : array[0..3] of Char = ('_', 'W', 'Z', 'M');
|
||||
__APP_MENU_ : array[0..3] of Char = ('_', 'A', 'M', 'N');
|
||||
__BROWSER_MENUS_ : array[0..3] of Char = ('_', 'B', 'R', 'M');
|
||||
__MENU_EVENT_ : array[0..3] of Char = ('_', 'M', 'E', 'V');
|
||||
__PING_ : array[0..3] of Char = ('_', 'P', 'B', 'L');
|
||||
__QUIT_ : array[0..3] of Char = ('_', 'Q', 'I', 'T');
|
||||
__VOLUME_MOUNTED_ : array[0..3] of Char = ('_', 'N', 'V', 'L');
|
||||
__VOLUME_UNMOUNTED_ : array[0..3] of Char = ('_', 'V', 'R', 'M');
|
||||
__MESSAGE_DROPPED_ : array[0..3] of Char = ('_', 'M', 'D', 'P');
|
||||
__DISPOSE_DRAG_ : array[0..3] of Char = ('_', 'D', 'P', 'D');
|
||||
__MENUS_DONE_ : array[0..3] of Char = ('_', 'M', 'N', 'D');
|
||||
__SHOW_DRAG_HANDLES_ : array[0..3] of Char = ('_', 'S', 'D', 'H');
|
||||
__EVENTS_PENDING_ : array[0..3] of Char = ('_', 'E', 'V', 'P');
|
||||
__UPDATE_ : array[0..3] of Char = ('_', 'U', 'P', 'D');
|
||||
__UPDATE_IF_NEEDED_ : array[0..3] of Char = ('_', 'U', 'P', 'N');
|
||||
__PRINTER_INFO_ : array[0..3] of Char = ('_', 'P', 'I', 'N');
|
||||
__SETUP_PRINTER_ : array[0..3] of Char = ('_', 'S', 'U', 'P');
|
||||
__SELECT_PRINTER_ : array[0..3] of Char = ('_', 'P', 'S', 'L');
|
||||
|
||||
// Other Commands
|
||||
_B_SET_PROPERTY : array[0..3] of Char = ('P', 'S', 'E', 'T');
|
||||
_B_GET_PROPERTY : array[0..3] of Char = ('P', 'G', 'E', 'T');
|
||||
_B_CREATE_PROPERTY : array[0..3] of Char = ('P', 'C', 'R', 'T');
|
||||
_B_DELETE_PROPERTY : array[0..3] of Char = ('P', 'D', 'E', 'L');
|
||||
_B_COUNT_PROPERTIES : array[0..3] of Char = ('P', 'C', 'N', 'T');
|
||||
_B_EXECUTE_PROPERTY : array[0..3] of Char = ('P', 'E', 'X', 'E');
|
||||
_B_GET_SUPPORTED_SUITES : array[0..3] of Char = ('S', 'U', 'I', 'T');
|
||||
_B_UNDO : array[0..3] of Char = ('U', 'N', 'D', 'O');
|
||||
_B_CUT : array[0..3] of Char = ('C', 'C', 'U', 'T');
|
||||
_B_COPY : array[0..3] of Char = ('C', 'O', 'P', 'Y');
|
||||
_B_PASTE : array[0..3] of Char = ('P', 'S', 'T', 'E');
|
||||
_B_SELECT_ALL : array[0..3] of Char = ('S', 'A', 'L', 'L');
|
||||
_B_SAVE_REQUESTED : array[0..3] of Char = ('S', 'A', 'V', 'E');
|
||||
_B_MESSAGE_NOT_UNDERSTOOD : array[0..3] of Char = ('M', 'N', 'O', 'T');
|
||||
_B_NO_REPLY : array[0..3] of Char = ('N', 'O', 'N', 'E');
|
||||
_B_REPLY : array[0..3] of Char = ('R', 'P', 'L', 'Y');
|
||||
_B_SIMPLE_DATA : array[0..3] of Char = ('D', 'A', 'T', 'A');
|
||||
_B_MIME_DATA : array[0..3] of Char = ('M', 'I', 'M', 'E');
|
||||
_B_ARCHIVED_OBJECT : array[0..3] of Char = ('A', 'R', 'C', 'V');
|
||||
_B_UPDATE_STATUS_BAR : array[0..3] of Char = ('S', 'B', 'U', 'P');
|
||||
_B_RESET_STATUS_BAR : array[0..3] of Char = ('S', 'B', 'R', 'S');
|
||||
_B_NODE_MONITOR : array[0..3] of Char = ('N', 'D', 'M', 'N');
|
||||
_B_QUERY_UPDATE : array[0..3] of Char = ('Q', 'U', 'P', 'D');
|
||||
_B_ENDORSABLE : array[0..3] of Char = ('E', 'N', 'D', 'O');
|
||||
_B_COPY_TARGET : array[0..3] of Char = ('D', 'D', 'C', 'P');
|
||||
_B_MOVE_TARGET : array[0..3] of Char = ('D', 'D', 'M', 'V');
|
||||
_B_TRASH_TARGET : array[0..3] of Char = ('D', 'D', 'R', 'M');
|
||||
_B_LINK_TARGET : array[0..3] of Char = ('D', 'D', 'L', 'N');
|
||||
_B_INPUT_DEVICES_CHANGED : array[0..3] of Char = ('I', 'D', 'C', 'H');
|
||||
_B_INPUT_METHOD_EVENT : array[0..3] of Char = ('I', 'M', 'E', 'V');
|
||||
_B_WINDOW_MOVE_TO : array[0..3] of Char = ('W', 'D', 'M', 'T');
|
||||
_B_WINDOW_MOVE_BY : array[0..3] of Char = ('W', 'D', 'M', 'B');
|
||||
_B_SILENT_RELAUNCH : array[0..3] of Char = ('A', 'R', 'E', 'L');
|
||||
_B_OBSERVER_NOTICE_CHANGE : array[0..3] of Char = ('N', 'T', 'C', 'H');
|
||||
_B_CONTROL_INVOKED : array[0..3] of Char = ('C', 'I', 'V', 'K');
|
||||
_B_CONTROL_MODIFIED : array[0..3] of Char = ('C', 'M', 'O', 'D');
|
||||
|
||||
//* Media Kit reserves all reserved codes starting in 'TRI' */
|
||||
|
||||
var
|
||||
B_ABOUT_REQUESTED : Cardinal;
|
||||
B_WINDOW_ACTIVATED : Cardinal;
|
||||
B_APP_ACTIVATED : Cardinal;
|
||||
B_ARGV_RECEIVED : Cardinal;
|
||||
B_QUIT_REQUESTED : Cardinal;
|
||||
B_CLOSE_REQUESTED : Cardinal;
|
||||
B_CANCEL : Cardinal;
|
||||
B_KEY_DOWN : Cardinal;
|
||||
B_KEY_UP : Cardinal;
|
||||
B_UNMAPPED_KEY_DOWN : Cardinal;
|
||||
B_UNMAPPED_KEY_UP : Cardinal;
|
||||
B_MODIFIERS_CHANGED : Cardinal;
|
||||
B_MINIMIZE : Cardinal;
|
||||
B_MOUSE_DOWN : Cardinal;
|
||||
B_MOUSE_MOVED : Cardinal;
|
||||
B_MOUSE_ENTER_EXIT : Cardinal;
|
||||
B_MOUSE_UP : Cardinal;
|
||||
B_MOUSE_WHEEL_CHANGED : Cardinal;
|
||||
B_OPEN_IN_WORKSPACE : Cardinal;
|
||||
B_PRINTER_CHANGED : Cardinal;
|
||||
B_PULSE : Cardinal;
|
||||
B_READY_TO_RUN : Cardinal;
|
||||
B_REFS_RECEIVED : Cardinal;
|
||||
B_RELEASE_OVERLAY_LOCK : Cardinal;
|
||||
B_ACQUIRE_OVERLAY_LOCK : Cardinal;
|
||||
B_SCREEN_CHANGED : Cardinal;
|
||||
B_VALUE_CHANGED : Cardinal;
|
||||
B_VIEW_MOVED : Cardinal;
|
||||
B_VIEW_RESIZED : Cardinal;
|
||||
B_WINDOW_MOVED : Cardinal;
|
||||
B_WINDOW_RESIZED : Cardinal;
|
||||
B_WORKSPACES_CHANGED : Cardinal;
|
||||
B_WORKSPACE_ACTIVATED : Cardinal;
|
||||
B_ZOOM : Cardinal;
|
||||
_APP_MENU_ : Cardinal;
|
||||
_BROWSER_MENUS_ : Cardinal;
|
||||
_MENU_EVENT_ : Cardinal;
|
||||
_PING_ : Cardinal;
|
||||
_QUIT_ : Cardinal;
|
||||
_VOLUME_MOUNTED_ : Cardinal;
|
||||
_VOLUME_UNMOUNTED_ : Cardinal;
|
||||
_MESSAGE_DROPPED_ : Cardinal;
|
||||
_DISPOSE_DRAG_ : Cardinal;
|
||||
_MENUS_DONE_ : Cardinal;
|
||||
_SHOW_DRAG_HANDLES_ : Cardinal;
|
||||
_EVENTS_PENDING_ : Cardinal;
|
||||
_UPDATE_ : Cardinal;
|
||||
_UPDATE_IF_NEEDED_ : Cardinal;
|
||||
_PRINTER_INFO_ : Cardinal;
|
||||
_SETUP_PRINTER_ : Cardinal;
|
||||
_SELECT_PRINTER_ : Cardinal;
|
||||
|
||||
// Other Commands
|
||||
B_SET_PROPERTY : Cardinal;
|
||||
B_GET_PROPERTY : Cardinal;
|
||||
B_CREATE_PROPERTY : Cardinal;
|
||||
B_DELETE_PROPERTY : Cardinal;
|
||||
B_COUNT_PROPERTIES : Cardinal;
|
||||
B_EXECUTE_PROPERTY : Cardinal;
|
||||
B_GET_SUPPORTED_SUITES : Cardinal;
|
||||
B_UNDO : Cardinal;
|
||||
B_CUT : Cardinal;
|
||||
B_COPY : Cardinal;
|
||||
B_PASTE : Cardinal;
|
||||
B_SELECT_ALL : Cardinal;
|
||||
B_SAVE_REQUESTED : Cardinal;
|
||||
B_MESSAGE_NOT_UNDERSTOOD : Cardinal;
|
||||
B_NO_REPLY : Cardinal;
|
||||
B_REPLY : Cardinal;
|
||||
B_SIMPLE_DATA : Cardinal;
|
||||
B_MIME_DATA : Cardinal;
|
||||
B_ARCHIVED_OBJECT : Cardinal;
|
||||
B_UPDATE_STATUS_BAR : Cardinal;
|
||||
B_RESET_STATUS_BAR : Cardinal;
|
||||
B_NODE_MONITOR : Cardinal;
|
||||
B_QUERY_UPDATE : Cardinal;
|
||||
B_ENDORSABLE : Cardinal;
|
||||
B_COPY_TARGET : Cardinal;
|
||||
B_MOVE_TARGET : Cardinal;
|
||||
B_TRASH_TARGET : Cardinal;
|
||||
B_LINK_TARGET : Cardinal;
|
||||
B_INPUT_DEVICES_CHANGED : Cardinal;
|
||||
B_INPUT_METHOD_EVENT : Cardinal;
|
||||
B_WINDOW_MOVE_TO : Cardinal;
|
||||
B_WINDOW_MOVE_BY : Cardinal;
|
||||
B_SILENT_RELAUNCH : Cardinal;
|
||||
B_OBSERVER_NOTICE_CHANGE : Cardinal;
|
||||
B_CONTROL_INVOKED : Cardinal;
|
||||
B_CONTROL_MODIFIED : Cardinal;
|
||||
|
||||
implementation
|
||||
|
||||
FUNCTION Power(X,Y:Word):LongInt;
|
||||
VAR Temp,Teller : LongInt;
|
||||
BEGIN
|
||||
TEMP:=1;
|
||||
FOR Teller:=1 TO Y DO TEMP:=TEMP*X;
|
||||
Power:=Temp;
|
||||
END; { Power }
|
||||
|
||||
|
||||
FUNCTION Hex2Dec(Hex:STRING):LongInt;
|
||||
VAR T1,T2,Dec : LongInt;
|
||||
Error : Boolean;
|
||||
|
||||
BEGIN
|
||||
Error:=False;
|
||||
T1:=0;T2:=0;DEC:=0;
|
||||
FOR T1:=1 TO LENGTH(Hex) DO
|
||||
BEGIN
|
||||
T2:=Length(Hex)-T1;
|
||||
CASE Hex[T1] OF
|
||||
'0' : DEC:=DEC+0;
|
||||
'1' : DEC:=DEC+Power(16,T2);
|
||||
'2' : DEC:=DEC+2*Power(16,T2);
|
||||
'3' : DEC:=DEC+3*Power(16,T2);
|
||||
'4' : DEC:=DEC+4*Power(16,T2);
|
||||
'5' : DEC:=DEC+5*Power(16,T2);
|
||||
'6' : DEC:=DEC+6*Power(16,T2);
|
||||
'7' : DEC:=DEC+7*Power(16,T2);
|
||||
'8' : DEC:=DEC+8*Power(16,T2);
|
||||
'9' : DEC:=DEC+9*Power(16,T2);
|
||||
'A','a' : DEC:=DEC+10*Power(16,T2);
|
||||
'B','b' : DEC:=DEC+11*Power(16,T2);
|
||||
'C','c' : DEC:=DEC+12*Power(16,T2);
|
||||
'D','d' : DEC:=DEC+13*Power(16,T2);
|
||||
'E','e' : DEC:=DEC+14*Power(16,T2);
|
||||
'F','f' : DEC:=DEC+15*Power(16,T2);
|
||||
ELSE Error:=True;
|
||||
END;
|
||||
END;
|
||||
Hex2Dec:=Dec;
|
||||
IF Error THEN Hex2Dec:=0;
|
||||
END;
|
||||
|
||||
FUNCTION Dec2Hex(DEC:LONGINT):STRING;
|
||||
|
||||
VAR H1:INTEGER;
|
||||
Hex,HexDigit:STRING;
|
||||
|
||||
BEGIN
|
||||
HexDigit:='0123456789ABCDEF';
|
||||
HEX:='';
|
||||
REPEAT
|
||||
H1:=DEC MOD 16;
|
||||
DEC:=DEC DIV 16;
|
||||
Hex:=CONCAT(Hexdigit[H1+1],Hex);
|
||||
UNTIL DEC<1;
|
||||
Dec2Hex:=Hex;
|
||||
END; { Dec2Hex }
|
||||
|
||||
function trans( S : Array of char): cardinal;
|
||||
var nd : array[0..3] of integer;
|
||||
Nh :array[0..3] of string;
|
||||
Hexa : string;
|
||||
i : Integer;
|
||||
begin
|
||||
for i:=0 to 3 do nd[i]:=ord(S[i]);
|
||||
for i:=0 to 3 do Nh[i]:=dec2hex(nd[i]);
|
||||
hexa:=nh[0]+nh[1]+nh[2]+nh[3];
|
||||
result:=hex2dec(hexa);
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
// System Messages Codes
|
||||
B_ABOUT_REQUESTED := trans(_B_ABOUT_REQUESTED);
|
||||
B_WINDOW_ACTIVATED := trans(_B_WINDOW_ACTIVATED);
|
||||
B_APP_ACTIVATED := trans(_B_APP_ACTIVATED);
|
||||
B_ARGV_RECEIVED := trans(_B_ARGV_RECEIVED);
|
||||
B_QUIT_REQUESTED := trans(_B_QUIT_REQUESTED);
|
||||
B_CLOSE_REQUESTED := trans(_B_CLOSE_REQUESTED);
|
||||
B_CANCEL := trans(_B_CANCEL);
|
||||
B_KEY_DOWN := trans(_B_KEY_DOWN);
|
||||
B_KEY_UP := trans(_B_KEY_UP);
|
||||
B_UNMAPPED_KEY_DOWN := trans(_B_UNMAPPED_KEY_DOWN);
|
||||
B_UNMAPPED_KEY_UP := trans(_B_UNMAPPED_KEY_UP);
|
||||
B_MODIFIERS_CHANGED := trans(_B_MODIFIERS_CHANGED);
|
||||
B_MINIMIZE := trans(_B_MINIMIZE);
|
||||
B_MOUSE_DOWN := trans(_B_MOUSE_DOWN);
|
||||
B_MOUSE_MOVED := trans(_B_MOUSE_MOVED);
|
||||
B_MOUSE_ENTER_EXIT := trans(_B_MOUSE_ENTER_EXIT);
|
||||
B_MOUSE_UP := trans(_B_MOUSE_UP);
|
||||
B_MOUSE_WHEEL_CHANGED := trans(_B_MOUSE_WHEEL_CHANGED);
|
||||
B_OPEN_IN_WORKSPACE := trans(_B_OPEN_IN_WORKSPACE);
|
||||
B_PRINTER_CHANGED := trans(_B_PRINTER_CHANGED);
|
||||
B_PULSE := trans(_B_PULSE);
|
||||
B_READY_TO_RUN := trans(_B_READY_TO_RUN);
|
||||
B_REFS_RECEIVED := trans(_B_REFS_RECEIVED);
|
||||
B_RELEASE_OVERLAY_LOCK := trans(_B_RELEASE_OVERLAY_LOCK);
|
||||
B_ACQUIRE_OVERLAY_LOCK := trans(_B_ACQUIRE_OVERLAY_LOCK);
|
||||
B_SCREEN_CHANGED := trans(_B_SCREEN_CHANGED);
|
||||
B_VALUE_CHANGED := trans(_B_VALUE_CHANGED);
|
||||
B_VIEW_MOVED := trans(_B_VIEW_MOVED);
|
||||
B_VIEW_RESIZED := trans(_B_VIEW_RESIZED);
|
||||
B_WINDOW_MOVED := trans(_B_WINDOW_MOVED);
|
||||
B_WINDOW_RESIZED := trans(_B_WINDOW_RESIZED);
|
||||
B_WORKSPACES_CHANGED := trans(_B_WORKSPACES_CHANGED);
|
||||
B_WORKSPACE_ACTIVATED := trans(_B_WORKSPACE_ACTIVATED);
|
||||
B_ZOOM := trans(_B_ZOOM);
|
||||
_APP_MENU_ := trans(__APP_MENU_);
|
||||
_BROWSER_MENUS_ := trans(__BROWSER_MENUS_);
|
||||
_MENU_EVENT_ := trans(__MENU_EVENT_);
|
||||
_PING_ := trans(__PING_);
|
||||
_QUIT_ := trans(__QUIT_);
|
||||
_VOLUME_MOUNTED_ := trans(__VOLUME_MOUNTED_);
|
||||
_VOLUME_UNMOUNTED_ := trans(__VOLUME_UNMOUNTED_);
|
||||
_MESSAGE_DROPPED_ := trans(__MESSAGE_DROPPED_);
|
||||
_DISPOSE_DRAG_ := trans(__DISPOSE_DRAG_);
|
||||
_MENUS_DONE_ := trans(__MENUS_DONE_);
|
||||
_SHOW_DRAG_HANDLES_ := trans(__SHOW_DRAG_HANDLES_);
|
||||
_EVENTS_PENDING_ := trans(__EVENTS_PENDING_);
|
||||
_UPDATE_ := trans(__UPDATE_);
|
||||
_UPDATE_IF_NEEDED_ := trans(__UPDATE_IF_NEEDED_);
|
||||
_PRINTER_INFO_ := trans(__PRINTER_INFO_);
|
||||
_SETUP_PRINTER_ := trans(__SETUP_PRINTER_);
|
||||
_SELECT_PRINTER_ := trans(__SELECT_PRINTER_);
|
||||
|
||||
// Other Commands
|
||||
B_SET_PROPERTY := trans(_B_SET_PROPERTY);
|
||||
B_GET_PROPERTY := trans(_B_GET_PROPERTY);
|
||||
B_CREATE_PROPERTY := trans(_B_CREATE_PROPERTY);
|
||||
B_DELETE_PROPERTY := trans(_B_DELETE_PROPERTY);
|
||||
B_COUNT_PROPERTIES := trans(_B_COUNT_PROPERTIES);
|
||||
B_EXECUTE_PROPERTY := trans(_B_EXECUTE_PROPERTY);
|
||||
B_GET_SUPPORTED_SUITES := trans(_B_GET_SUPPORTED_SUITES);
|
||||
B_UNDO := trans(_B_UNDO);
|
||||
B_CUT := trans(_B_CUT);
|
||||
B_COPY := trans(_B_COPY);
|
||||
B_PASTE := trans(_B_PASTE);
|
||||
B_SELECT_ALL := trans(_B_SELECT_ALL);
|
||||
B_SAVE_REQUESTED := trans(_B_SAVE_REQUESTED);
|
||||
B_MESSAGE_NOT_UNDERSTOOD := trans(_B_MESSAGE_NOT_UNDERSTOOD);
|
||||
B_NO_REPLY := trans(_B_NO_REPLY);
|
||||
B_REPLY := trans(_B_REPLY);
|
||||
B_SIMPLE_DATA := trans(_B_SIMPLE_DATA);
|
||||
B_MIME_DATA := trans(_B_MIME_DATA);
|
||||
B_ARCHIVED_OBJECT := trans(_B_ARCHIVED_OBJECT);
|
||||
B_UPDATE_STATUS_BAR := trans(_B_UPDATE_STATUS_BAR);
|
||||
B_RESET_STATUS_BAR := trans(_B_RESET_STATUS_BAR);
|
||||
B_NODE_MONITOR := trans(_B_NODE_MONITOR);
|
||||
B_QUERY_UPDATE := trans(_B_QUERY_UPDATE);
|
||||
B_ENDORSABLE := trans(_B_ENDORSABLE);
|
||||
B_COPY_TARGET := trans(_B_COPY_TARGET);
|
||||
B_MOVE_TARGET := trans(_B_MOVE_TARGET);
|
||||
B_TRASH_TARGET := trans(_B_TRASH_TARGET);
|
||||
B_LINK_TARGET := trans(_B_LINK_TARGET);
|
||||
B_INPUT_DEVICES_CHANGED := trans(_B_INPUT_DEVICES_CHANGED);
|
||||
B_INPUT_METHOD_EVENT := trans(_B_INPUT_METHOD_EVENT);
|
||||
B_WINDOW_MOVE_TO := trans(_B_WINDOW_MOVE_TO);
|
||||
B_WINDOW_MOVE_BY := trans(_B_WINDOW_MOVE_BY);
|
||||
B_SILENT_RELAUNCH := trans(_B_SILENT_RELAUNCH);
|
||||
B_OBSERVER_NOTICE_CHANGE := trans(_B_OBSERVER_NOTICE_CHANGE);
|
||||
B_CONTROL_INVOKED := trans(_B_CONTROL_INVOKED);
|
||||
B_CONTROL_MODIFIED := trans(_B_CONTROL_MODIFIED);
|
||||
|
||||
end.
|
||||
190
bepascal/source/bepascal/pas/src/be/app/application.pp
Normal file
190
bepascal/source/bepascal/pas/src/be/app/application.pp
Normal file
@@ -0,0 +1,190 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit Application;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, looper, appdefs, supportdefs, message, os, fdblib,roster;
|
||||
|
||||
type
|
||||
BApplication = class(BLooper)
|
||||
private
|
||||
public
|
||||
constructor Create; override;
|
||||
constructor Create(Signature : PChar); virtual;
|
||||
constructor Create(Signature : PChar; error : PStatus_t); virtual;
|
||||
destructor Destroy; override;
|
||||
procedure ShowCursor;
|
||||
procedure HideCursor;
|
||||
function Run : Thread_id;
|
||||
procedure Quit;
|
||||
function GeAppInfo(var info : AppInfo ): Status_t;
|
||||
// Hook functions
|
||||
procedure AppActivated(Active : boolean); virtual;
|
||||
procedure ReadyToRun; virtual;
|
||||
end;
|
||||
|
||||
function BApplication_Create(AObject : TObject) : TCPlusObject; cdecl; external BePascalLibName name 'BApplication_Create_1';
|
||||
function BApplication_Create(AObject : TObject; Signature : PChar) : TCPlusObject; cdecl; external BePascalLibName name 'BApplication_Create_2';
|
||||
function BApplication_Create(AObject : TObject; Signature : PChar; error : PStatus_t) : TCPlusObject; cdecl; external BePascalLibName name 'BApplication_Create_3';
|
||||
procedure BApplication_Free(Application : TCPlusObject); cdecl; external BePascalLibName;
|
||||
procedure BApplication_HideCursor(Application : TCPlusObject); cdecl; external BePascalLibName;
|
||||
procedure BApplication_ShowCursor(Application : TCPlusObject); cdecl; external BePascalLibName;
|
||||
function BApplication_Run(Application : TCPlusObject) : Thread_id; cdecl; external BePascalLibName;
|
||||
procedure BApplication_Quit(Application : TCPlusObject); cdecl; external BePascalLibName;
|
||||
function BApplication_GeAppInfo(Application : TCPlusObject; var info : AppInfo ) : Status_t; cdecl; external BePascalLibName name 'BApplication_GetAppInfo';
|
||||
function get_be_app_messenger : TCPlusObject; cdecl; external BePascalLibName name 'get_be_app_messenger';
|
||||
|
||||
var
|
||||
be_app : BApplication;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
Messenger;
|
||||
|
||||
var
|
||||
Application_AppActivated_hook : Pointer; cvar; external;
|
||||
Application_ReadyToRun_hook : Pointer; cvar; external;
|
||||
|
||||
// start BApplication
|
||||
constructor BApplication.Create;
|
||||
begin
|
||||
inherited;
|
||||
CPlusObject := BApplication_Create(Self, PChar('application/x-vnd.BePascal'));
|
||||
be_app := Self;
|
||||
be_app_BMessenger := BMessenger.Wrap(be_app_messengerCPlus);
|
||||
end;
|
||||
|
||||
constructor BApplication.Create(Signature : PChar);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BApplication_Create(Self, Signature);
|
||||
be_app := Self;
|
||||
be_app_BMessenger := BMessenger.Wrap(be_app_messengerCPlus);
|
||||
end;
|
||||
|
||||
constructor BApplication.Create(Signature : PChar; error : PStatus_t);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BApplication_Create(Self, Signature, error);
|
||||
be_app := Self;
|
||||
be_app_BMessenger := BMessenger.Wrap(be_app_messengerCPlus);
|
||||
end;
|
||||
|
||||
destructor BApplication.Destroy;
|
||||
begin
|
||||
if CPlusObject <> nil then
|
||||
BApplication_Free(CPlusObject);
|
||||
if Assigned(be_app_BMessenger) then
|
||||
be_app_BMessenger.UnWrap;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
// Hook functions
|
||||
|
||||
procedure Application_AppActivated_hook_func(Application : BApplication; Active : boolean); cdecl;
|
||||
begin
|
||||
if Application <> nil then
|
||||
Application.AppActivated(Active);
|
||||
end;
|
||||
|
||||
procedure BApplication.AppActivated(Active : boolean);
|
||||
begin
|
||||
{$IFDEF DEBUG}
|
||||
SendText(Active);
|
||||
if Active then
|
||||
SendText('Application activée !')
|
||||
else
|
||||
SendText('Application désactivée !');
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure Application_ReadyToRun_hook_func(Application : BApplication); cdecl;
|
||||
begin
|
||||
{$IFDEF DEBUG}
|
||||
SendText('Hook ReadyToRun !');
|
||||
{$ENDIF}
|
||||
if Application <> nil then
|
||||
Application.ReadyToRun;
|
||||
end;
|
||||
|
||||
procedure Application_MessageReceived_hook_func(Application : BApplication; aMessage : TCPlusObject); cdecl;
|
||||
var
|
||||
Message : BMessage;
|
||||
begin
|
||||
{$IFDEF DEBUG}
|
||||
SendText('Hook MessageReceived !');
|
||||
{$ENDIF}
|
||||
Message := BMessage.Wrap(aMessage);
|
||||
try
|
||||
if Application <> nil then
|
||||
Application.MessageReceived(Message);
|
||||
finally
|
||||
Message.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure BApplication.ReadyToRun;
|
||||
begin
|
||||
{$IFDEF DEBUG}
|
||||
SendText('Prêt à démarer !');
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure BApplication.ShowCursor;
|
||||
begin
|
||||
BApplication_ShowCursor(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BApplication.HideCursor;
|
||||
begin
|
||||
BApplication_HideCursor(CPlusObject);
|
||||
end;
|
||||
|
||||
function BApplication.Run : Thread_id;
|
||||
begin
|
||||
Result := BApplication_Run(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BApplication.Quit;
|
||||
begin
|
||||
BApplication_Quit(CPlusObject);
|
||||
end;
|
||||
|
||||
function BApplication.GeAppInfo(var info : AppInfo ): Status_t;
|
||||
begin
|
||||
Result:=BApplication_GeAppInfo(CPlusObject,info) ;
|
||||
end;
|
||||
|
||||
|
||||
// end BApplication
|
||||
|
||||
initialization
|
||||
be_app := nil;
|
||||
Application_AppActivated_hook := @Application_AppActivated_hook_func;
|
||||
Application_ReadyToRun_hook := @Application_ReadyToRun_hook_func;
|
||||
|
||||
finalization
|
||||
Application_AppActivated_hook := nil;
|
||||
Application_ReadyToRun_hook := nil;
|
||||
be_app := nil;
|
||||
|
||||
end.
|
||||
80
bepascal/source/bepascal/pas/src/be/app/handler.pp
Normal file
80
bepascal/source/bepascal/pas/src/be/app/handler.pp
Normal file
@@ -0,0 +1,80 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit handler;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, archivable, message, fdblib;
|
||||
|
||||
type
|
||||
BHandler = class(BArchivable)
|
||||
public
|
||||
procedure MessageReceived(aMessage : BMessage); virtual;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
SysUtils;
|
||||
|
||||
var
|
||||
Handler_MessageReceived_hook : Pointer; cvar; external;
|
||||
|
||||
procedure BHandler.MessageReceived(aMessage : BMessage);
|
||||
begin
|
||||
{$IFDEF DEBUG}
|
||||
SendText(ClassName + '.MessageReceived');
|
||||
SendText('Message reçue');
|
||||
aMessage.PrintToStream;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure Handler_MessageReceived_hook_func(Handler : BHandler; aMessage : TCPlusObject); cdecl;
|
||||
var
|
||||
Message : BMessage;
|
||||
begin
|
||||
try
|
||||
{$IFDEF DEBUG}
|
||||
SendText('Hook MessageReceived !');
|
||||
{$ENDIF}
|
||||
Message := BMessage.Wrap(aMessage);
|
||||
try
|
||||
if Handler <> nil then
|
||||
Handler.MessageReceived(Message);
|
||||
finally
|
||||
Message.UnWrap;
|
||||
end;
|
||||
except
|
||||
on e : exception do
|
||||
begin
|
||||
{$IFDEF DEBUG}
|
||||
SendText(e.Message + 'Handler_MessageReceived');
|
||||
{$ENDIF}
|
||||
end;
|
||||
end
|
||||
end;
|
||||
|
||||
initialization
|
||||
Handler_MessageReceived_hook := @Handler_MessageReceived_hook_func;
|
||||
|
||||
finalization
|
||||
Handler_MessageReceived_hook := nil;
|
||||
|
||||
end.
|
||||
271
bepascal/source/bepascal/pas/src/be/app/invoker.pp
Normal file
271
bepascal/source/bepascal/pas/src/be/app/invoker.pp
Normal file
@@ -0,0 +1,271 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit invoker;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, Message, Handler, Looper, SupportDefs, Messenger;
|
||||
|
||||
type
|
||||
BInvoker = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create; override;
|
||||
constructor Create(aMessage : BMessage; handler : BHandler; looper : BLooper);
|
||||
constructor Create(aMessage : BMessage; aTarget : BMessenger);
|
||||
destructor Destroy; override;
|
||||
function SeBMessage(aMessage : BMessage) : Status_t;
|
||||
function Message : BMessage;
|
||||
function Command : Cardinal;
|
||||
function SetTarget(h : BHandler; loop : BLooper) : Status_t;
|
||||
function SetTarget(aMessenger : BMessenger) : Status_t;
|
||||
function IsTargetLocal : boolean;
|
||||
function Target(looper : BLooper) : BHandler;
|
||||
function Messenger : BMessenger;
|
||||
function SeBHandlerForReply(handler : BHandler) : Status_t;
|
||||
function HandlerForReply : BHandler;
|
||||
function Invoke(msg : BMessage) : Status_t;
|
||||
// function InvokeNotify(msg : BMessage; kind : Cardinal) : Status_t;
|
||||
function SetTimeout(aTimeout : Bigtime_t) : Status_t;
|
||||
function Timeout : Bigtime_t;
|
||||
// function InvokeKind(notify : boolean) : Cardinal;
|
||||
// procedure BeginInvokeNotify(kind : Cardinal);
|
||||
// procedure EndInvokeNotify;
|
||||
// procedure _ReservedInvoker1;
|
||||
// procedure _ReservedInvoker2;
|
||||
// procedure _ReservedInvoker3;
|
||||
constructor Create(aInvoker : BInvoker);
|
||||
// function operator=( : BInvoker) : BInvoker;
|
||||
// procedure BMessage *fMessage;
|
||||
// procedure BMessenger fMessenger;
|
||||
// procedure BHandler *fReplyTo;
|
||||
// procedure uint32 fTimeout;
|
||||
// procedure uint32 fNotifyKind;
|
||||
// procedure uint32 _reserved[2];
|
||||
end;
|
||||
|
||||
function BInvoker_Create(AObject : TBeObject) : TCplusObject; cdecl; external BePascalLibName name 'BInvoker_Create';
|
||||
function BInvoker_Create(AObject : TBeObject; message : TCplusObject; handler : TCplusObject; looper : TCPlusObject) : TCplusObject; cdecl; external BePascalLibName name 'BInvoker_Create_1';
|
||||
function BInvoker_Create(AObject : TBeObject; message : TCplusObject; target : TCplusObject) : TCplusObject; cdecl; external BePascalLibName name 'BInvoker_Create_2';
|
||||
procedure BInvoker_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_Free';
|
||||
function BInvoker_SeBMessage(AObject : TCPlusObject; message : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BInvoker_SetMessage';
|
||||
function BInvoker_Message(AObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BInvoker_Message';
|
||||
function BInvoker_Command(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BInvoker_Command';
|
||||
function BInvoker_SetTarget(AObject : TCPlusObject; h : TCPlusObject; loop : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BInvoker_SetTarget';
|
||||
function BInvoker_SetTarget(AObject : TCPlusObject; messenger : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BInvoker_SetTarget_1';
|
||||
function BInvoker_IsTargetLocal(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BInvoker_IsTargetLocal';
|
||||
function BInvoker_Target(AObject : TCPlusObject; looper : TCplusObject) : BHandler; cdecl; external BePascalLibName name 'BInvoker_Target';
|
||||
function BInvoker_Messenger(AObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BInvoker_Messenger';
|
||||
function BInvoker_SeBHandlerForReply(AObject : TCPlusObject; handler : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BInvoker_SetHandlerForReply';
|
||||
function BInvoker_HandlerForReply(AObject : TCPlusObject) : BHandler; cdecl; external BePascalLibName name 'BInvoker_HandlerForReply';
|
||||
function BInvoker_Invoke(AObject : TCPlusObject; msg : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BInvoker_Invoke';
|
||||
//function BInvoker_InvokeNotify(AObject : TCPlusObject; msg : TCplusObject; kind : Cardinal) : Status_t; cdecl; external BePascalLibName name 'BInvoker_InvokeNotify';
|
||||
function BInvoker_SetTimeout(AObject : TCPlusObject; timeout : Bigtime_t) : Status_t; cdecl; external BePascalLibName name 'BInvoker_SetTimeout';
|
||||
function BInvoker_Timeout(AObject : TCPlusObject) : Bigtime_t; cdecl; external BePascalLibName name 'BInvoker_Timeout';
|
||||
//function BInvoker_InvokeKind(AObject : TCPlusObject; notify : boolean) : Cardinal; cdecl; external BePascalLibName name 'BInvoker_InvokeKind';
|
||||
//procedure BInvoker_BeginInvokeNotify(AObject : TCPlusObject; kind : Cardinal); cdecl; external BePascalLibName name 'BInvoker_BeginInvokeNotify';
|
||||
//procedure BInvoker_EndInvokeNotify(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_EndInvokeNotify';
|
||||
//procedure BInvoker__ReservedInvoker1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker__ReservedInvoker1';
|
||||
//procedure BInvoker__ReservedInvoker2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker__ReservedInvoker2';
|
||||
//procedure BInvoker__ReservedInvoker3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker__ReservedInvoker3';
|
||||
function BInvoker_Create(AObject : TBeObject; aInvoker : TCPlusObject) : TCplusObject; cdecl; external BePascalLibName name 'BInvoker_Create';
|
||||
//function BInvoker_operator=(AObject : TCPlusObject; : BInvoker) : BInvoker; cdecl; external BePascalLibName name 'BInvoker_operator=';
|
||||
//procedure BInvoker_BMessage *fMessage(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_BMessage *fMessage';
|
||||
//procedure BInvoker_BMessenger fMessenger(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_BMessenger fMessenger';
|
||||
//procedure BInvoker_BHandler *fReplyTo(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_BHandler *fReplyTo';
|
||||
//procedure BInvoker_uint32 fTimeout(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_uint32 fTimeout';
|
||||
//procedure BInvoker_uint32 fNotifyKind(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_uint32 fNotifyKind';
|
||||
//procedure BInvoker_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BInvoker_uint32 _reserved[2]';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BInvoker.Create;
|
||||
begin
|
||||
BInvoker_Create(Self);
|
||||
end;
|
||||
|
||||
constructor BInvoker.Create(aMessage : BMessage; handler : BHandler; looper : BLooper);
|
||||
begin
|
||||
CPlusObject := BInvoker_Create(Self, aMessage.CPlusObject, handler, looper);
|
||||
end;
|
||||
|
||||
constructor BInvoker.Create(aMessage : BMessage; aTarget : BMessenger);
|
||||
begin
|
||||
CPlusObject := BInvoker_Create(Self, aMessage.CPlusObject, aTarget.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BInvoker.Destroy;
|
||||
begin
|
||||
BInvoker_Free(CPlusObject);
|
||||
end;
|
||||
|
||||
function BInvoker.SeBMessage(aMessage : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BInvoker_SeBMessage(CPlusObject, aMessage.CPlusObject);
|
||||
end;
|
||||
|
||||
function BInvoker.Message : BMessage;
|
||||
begin
|
||||
Result := BMessage.Wrap(BInvoker_Message(CPlusObject));
|
||||
end;
|
||||
|
||||
function BInvoker.Command : Cardinal;
|
||||
begin
|
||||
Result := BInvoker_Command(CPlusObject);
|
||||
end;
|
||||
|
||||
function BInvoker.SetTarget(h : BHandler; loop : BLooper) : Status_t;
|
||||
begin
|
||||
if loop <> nil then
|
||||
begin
|
||||
Result := BInvoker_SetTarget(CPlusObject, h.CPlusObject, loop.CPlusObject);
|
||||
end
|
||||
else if h <> nil then
|
||||
begin
|
||||
// Result := BInvoker_SetTarget(CPlusObject, h.CPlusObject, nil);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Result := BInvoker_SetTarget(CPlusObject, nil, nil);
|
||||
end;
|
||||
end;
|
||||
|
||||
function BInvoker.SetTarget(aMessenger : BMessenger) : Status_t;
|
||||
begin
|
||||
Result := BInvoker_SetTarget(CPlusObject, aMessenger.CPlusObject);
|
||||
end;
|
||||
|
||||
function BInvoker.IsTargetLocal : boolean;
|
||||
begin
|
||||
Result := BInvoker_IsTargetLocal(CPlusObject);
|
||||
end;
|
||||
|
||||
function BInvoker.Target(looper : BLooper) : BHandler;
|
||||
begin
|
||||
Result := BInvoker_Target(CPlusObject, looper.CPlusObject);
|
||||
end;
|
||||
|
||||
function BInvoker.Messenger : BMessenger;
|
||||
begin
|
||||
Result := BMessenger.Wrap(BInvoker_Messenger(CPlusObject));
|
||||
end;
|
||||
|
||||
function BInvoker.SeBHandlerForReply(handler : BHandler) : Status_t;
|
||||
begin
|
||||
Result := BInvoker_SeBHandlerForReply(CPlusObject, handler.CPlusObject);
|
||||
end;
|
||||
|
||||
function BInvoker.HandlerForReply : BHandler;
|
||||
begin
|
||||
Result := BInvoker_HandlerForReply(CPlusObject);
|
||||
end;
|
||||
|
||||
function BInvoker.Invoke(msg : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BInvoker_Invoke(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
//function BInvoker.InvokeNotify(msg : BMessage; kind : Cardinal) : Status_t;
|
||||
//begin
|
||||
// BInvoker_InvokeNotify(CPlusObject, msg.CPlusObject, kind);
|
||||
//end;
|
||||
|
||||
function BInvoker.SetTimeout(aTimeout : Bigtime_t) : Status_t;
|
||||
begin
|
||||
Result := BInvoker_SetTimeout(CPlusObject, timeout);
|
||||
end;
|
||||
|
||||
function BInvoker.Timeout : Bigtime_t;
|
||||
begin
|
||||
Result := BInvoker_Timeout(CPlusObject);
|
||||
end;
|
||||
|
||||
//function BInvoker.InvokeKind(notify : boolean) : Cardinal;
|
||||
//begin
|
||||
// BInvoker_InvokeKind(CPlusObject, notify);
|
||||
//end;
|
||||
//
|
||||
//procedure BInvoker.BeginInvokeNotify(kind : Cardinal);
|
||||
//begin
|
||||
// BInvoker_BeginInvokeNotify(CPlusObject, kind);
|
||||
//end;
|
||||
//
|
||||
//procedure BInvoker.EndInvokeNotify;
|
||||
//begin
|
||||
// BInvoker_EndInvokeNotify(CPlusObject);
|
||||
//end;
|
||||
|
||||
//procedure BInvoker._ReservedInvoker1;
|
||||
//begin
|
||||
// BInvoker__ReservedInvoker1(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BInvoker._ReservedInvoker2;
|
||||
//begin
|
||||
// BInvoker__ReservedInvoker2(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BInvoker._ReservedInvoker3;
|
||||
//begin
|
||||
// BInvoker__ReservedInvoker3(CPlusObject);
|
||||
//end;
|
||||
|
||||
constructor BInvoker.Create(ainvoker : BInvoker);
|
||||
begin
|
||||
BInvoker_Create(Self, aInvoker);
|
||||
end;
|
||||
|
||||
//function BInvoker.operator=( : BInvoker) : BInvoker;
|
||||
//begin
|
||||
// BInvoker_operator=(CPlusObject, );
|
||||
//end;
|
||||
|
||||
//procedure BInvoker.BMessage *fMessage;
|
||||
//begin
|
||||
// BInvoker_BMessage *fMessage(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BInvoker.BMessenger fMessenger;
|
||||
//begin
|
||||
// BInvoker_BMessenger fMessenger(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BInvoker.BHandler *fReplyTo;
|
||||
//begin
|
||||
// BInvoker_BHandler *fReplyTo(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BInvoker.uint32 fTimeout;
|
||||
//begin
|
||||
// BInvoker_uint32 fTimeout(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BInvoker.uint32 fNotifyKind;
|
||||
//begin
|
||||
// BInvoker_uint32 fNotifyKind(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BInvoker.uint32 _reserved[2];
|
||||
//begin
|
||||
// BInvoker_uint32 _reserved[2](CPlusObject);
|
||||
//end;
|
||||
|
||||
|
||||
end.
|
||||
103
bepascal/source/bepascal/pas/src/be/app/looper.pp
Normal file
103
bepascal/source/bepascal/pas/src/be/app/looper.pp
Normal file
@@ -0,0 +1,103 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit looper;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, handler, message, os, SupportDefs;
|
||||
|
||||
const
|
||||
B_LOOPER_PORT_DEFAULT_CAPACITY = 100;
|
||||
|
||||
type
|
||||
BLooper = class(BHandler)
|
||||
private
|
||||
public
|
||||
procedure DispatchMessage(aMessage : BMessage; aTarget : BHandler); virtual;
|
||||
function QuitRequested() : boolean; virtual;
|
||||
function GetSupportedSuites(aMessage : BMessage) : Status_t;
|
||||
function PostMessage(command : Cardinal) : Status_t;
|
||||
end;
|
||||
|
||||
//function BLooper_Create(AObject : TObject);
|
||||
function BLooper_GetSupportedSuites(Looper : TCplusObject; aMessage : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BLooper_GetSupportedSuites';
|
||||
function BLooper_PostMessage(Looper : TCPlusObject; command : Cardinal) : Status_t; cdecl; external BePascalLibName name 'BLooper_PostMessage_2';
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
Looper_DispatchMessage_hook : Pointer; cvar; external;
|
||||
Looper_QuitRequested_hook : Pointer; cvar; external;
|
||||
|
||||
procedure BLooper.DispatchMessage(aMessage : BMessage; aTarget : BHandler);
|
||||
begin
|
||||
end;
|
||||
|
||||
function BLooper.QuitRequested() : boolean;
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
function BLooper.GetSupportedSuites(aMessage : BMessage) : Status_t;
|
||||
begin
|
||||
result := BLooper_GetSupportedSuites(CPlusObject, aMessage.CPlusObject);
|
||||
end;
|
||||
|
||||
function BLooper.PostMessage(command : Cardinal) : Status_t;
|
||||
begin
|
||||
result := BLooper_PostMessage(CPlusObject, command);
|
||||
end;
|
||||
|
||||
// hooks
|
||||
|
||||
procedure Looper_DispatchMessage_hook_func(Looper : BLooper;
|
||||
aMessage : TCPlusObject; aTarget : TCPlusObject); cdecl;
|
||||
var
|
||||
Message : BMessage;
|
||||
Target : BHandler;
|
||||
begin
|
||||
Message := BMessage.Wrap(aMessage);
|
||||
try
|
||||
Target := BHandler.Wrap(aTarget);
|
||||
try
|
||||
Looper.DispatchMessage(Message, Target);
|
||||
finally
|
||||
Target.UnWrap;
|
||||
end;
|
||||
finally
|
||||
Message.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
function Looper_QuitRequested_hook_func(Looper : BLooper) : boolean; cdecl;
|
||||
begin
|
||||
if Looper <> nil then
|
||||
Result := Looper.QuitRequested();
|
||||
end;
|
||||
|
||||
initialization
|
||||
Looper_DispatchMessage_hook := @Looper_DispatchMessage_hook_func;
|
||||
Looper_QuitRequested_hook := @Looper_QuitRequested_hook_func;
|
||||
|
||||
finalization
|
||||
Looper_DispatchMessage_hook := nil;
|
||||
Looper_QuitRequested_hook := nil;
|
||||
|
||||
end.
|
||||
281
bepascal/source/bepascal/pas/src/be/app/message.pp
Normal file
281
bepascal/source/bepascal/pas/src/be/app/message.pp
Normal file
@@ -0,0 +1,281 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit message;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, supportdefs, typeconstants;
|
||||
|
||||
const
|
||||
B_NO_SPECIFIER = 0;
|
||||
B_DIRECT_SPECIFIER = 1;
|
||||
B_INDEX_SPECIFIER = 2;
|
||||
B_REVERSE_INDEX_SPECIFIER = 3;
|
||||
B_RANGE_SPECIFIER = 4;
|
||||
B_REVERSE_RANGE_SPECIFIER = 5;
|
||||
B_NAME_SPECIFIER = 6;
|
||||
B_ID_SPECIFIER = 7;
|
||||
|
||||
B_SPECIFIERS_END = 128;
|
||||
|
||||
B_FIELD_NAME_LENGTH = 255;
|
||||
B_PROPERTY_NAME_LENGTH = 255;
|
||||
|
||||
type
|
||||
BMessage = class(TBeObject)
|
||||
private
|
||||
function GetWhat : Cardinal;
|
||||
procedure SetWhat(aWhat : Cardinal);
|
||||
public
|
||||
constructor Create; override;
|
||||
constructor Create(Command : Cardinal); virtual;
|
||||
constructor Create(var Message : BMessage); virtual;
|
||||
destructor Destroy; override;
|
||||
function AddData(const Name : PChar; aType : Type_Code; const Data : Pointer; FixedSize : Cardinal; NumItems : Integer) : Status_t;
|
||||
function AddBool(const Name : PChar; aBool : boolean) : Status_t;
|
||||
function AddInt8(const Name : PChar; anInt8 : Shortint) : Status_t;
|
||||
function FindInt8(const Name : PChar; var anInt8 : Shortint) : Status_t;
|
||||
function AddInt16(const Name : PChar; anInt16 : Smallint) : Status_t;
|
||||
function AddInt32(const Name : PChar; anInt32 : Integer) : Status_t;
|
||||
function AddInt64(const Name : PChar; anInt64 : int64) : Status_t;
|
||||
function AddFloat(const Name : PChar; aFloat : Single) : Status_t;
|
||||
function AddDouble(const Name : PChar; aDouble : Double) : Status_t;
|
||||
function AddString(const Name : PChar; aString : PChar) : Status_t;
|
||||
function FindString(const Name : PChar; var aString : PChar) : Status_t;
|
||||
function AddMessage(const Name : PChar; aMessage : TCPlusObject) : Status_t;
|
||||
function CountNames(aType : Type_Code) : Integer;
|
||||
function HasSpecifiers : boolean;
|
||||
function IsSystem : boolean;
|
||||
function MakeEmpty : Status_t;
|
||||
function IsEmpty : boolean;
|
||||
function RemoveName(const Name : PChar) : Status_t;
|
||||
procedure PrintToStream;
|
||||
function RemoveData(const name : PChar; index : Integer) : Status_t;
|
||||
function WasDelivered : boolean;
|
||||
function IsSourceRemote : boolean;
|
||||
function IsSourceWaiting : boolean;
|
||||
function IsReply : boolean;
|
||||
function Previous : BMessage;
|
||||
function WasDropped : boolean;
|
||||
property What : Cardinal read GetWhat write SetWhat;
|
||||
end;
|
||||
|
||||
function BMessage_Create(AObject : TObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMessage_Create_1';
|
||||
function BMessage_Create(AObject : TObject; command : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BMessage_Create_2';
|
||||
function BMessage_Create(AObject : TObject; var Message : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMessage_Create_3';
|
||||
procedure BMessage_Free(Message : TCPlusObject); cdecl; external BePascalLibName;
|
||||
function BMessage_GetWhat(Message : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BMessage_Getwhat';
|
||||
procedure BMessage_SetWhat(Message : TCPlusObject; What : Cardinal); cdecl; external BePascalLibName name 'BMessage_Setwhat';
|
||||
function BMessage_AddData(Message : TCPlusObject; const Name : PChar; aType : Type_Code; const Data : Pointer; FixedSize : Cardinal; NumItems : Integer) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_AddBool(Message : TCPlusObject; const Name : PChar; aBool : boolean) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_AddInt8(Message : TCPlusObject; const Name : PChar; anInt8 : Shortint) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_FindInt8(Message : TCPlusObject; const Name : PChar; var anInt8 : Shortint) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_AddInt16(Message : TCPlusObject; const Name : PChar; anInt16 : Smallint) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_AddInt32(Message : TCPlusObject; const Name : PChar; anInt32 : Integer) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_AddInt64(Message : TCPlusObject; const Name : PChar; anInt64 : int64) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_AddFloat(Message : TCPlusObject; const Name : PChar; aFloat : Single) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_AddDouble(Message : TCPlusObject; const Name : PChar; aDouble : Double) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_AddString(Message : TCPlusObject; const Name : PChar; aString : PChar) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_FindString(Message : TCPlusObject; const Name : PChar;var aString : PChar) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_AddMessage(Message : TCPlusObject; const Name : PChar; aMessage : TCPlusObject) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_CountNames(Message : TCPlusObject; aType : Type_Code) : Integer; cdecl; external BePascalLibName;
|
||||
function BMessage_HasSpecifiers(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName;
|
||||
function BMessage_IsSystem(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName;
|
||||
function BMessage_MakeEmpty(Message : TCPlusObject) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_IsEmpty(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName;
|
||||
function BMessage_RemoveName(Message : TCPlusObject; const Name : PChar) : Status_t; cdecl; external BePascalLibName;
|
||||
procedure BMessage_PrintToStream(Message : TCPlusObject); cdecl; external BePascalLibName;
|
||||
function BMessage_RemoveData(Message : TCPlusObject; const name : PChar; index : Integer) : Status_t; cdecl; external BePascalLibName;
|
||||
function BMessage_WasDelivered(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName;
|
||||
function BMessage_IsSourceRemote(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName;
|
||||
function BMessage_IsSourceWaiting(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName;
|
||||
function BMessage_IsReply(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName;
|
||||
function BMessage_Previous(Message : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName;
|
||||
function BMessage_WasDropped(Message : TCPlusObject) : boolean; cdecl; external BePascalLibName;
|
||||
|
||||
implementation
|
||||
|
||||
// start BMessage
|
||||
constructor BMessage.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BMessage_Create(Self);
|
||||
end;
|
||||
|
||||
constructor BMessage.Create(Command : Cardinal);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BMessage_Create(Self, Command);
|
||||
end;
|
||||
|
||||
constructor BMessage.Create(var Message : BMessage);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BMessage_Create(Self, Message.FCPlusObject);
|
||||
end;
|
||||
|
||||
destructor BMessage.Destroy;
|
||||
begin
|
||||
if CPlusObject <> nil then
|
||||
BMessage_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BMessage.GetWhat : Cardinal;
|
||||
begin
|
||||
Result := BMessage_GetWhat(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMessage.SetWhat(aWhat : Cardinal);
|
||||
begin
|
||||
BMessage_SetWhat(CPlusObject, aWhat);
|
||||
end;
|
||||
|
||||
function BMessage.AddData(const Name : PChar; aType : Type_Code; const Data : Pointer; FixedSize : Cardinal; NumItems : Integer) : Status_t;
|
||||
begin
|
||||
result := BMessage_AddData(CPlusObject, Name, aType, Data, FixedSize, NumItems);
|
||||
end;
|
||||
|
||||
function BMessage.AddBool(const Name : PChar; aBool : boolean) : Status_t;
|
||||
begin
|
||||
result := BMessage_AddBool(CPlusObject, Name, aBool);
|
||||
end;
|
||||
|
||||
function BMessage.AddInt8(const Name : PChar; anInt8 : Shortint) : Status_t;
|
||||
begin
|
||||
result := BMessage_AddInt8(CPlusObject, Name, anInt8);
|
||||
end;
|
||||
|
||||
function BMessage.FindInt8(const Name : PChar; var anInt8 : Shortint) : Status_t;
|
||||
begin
|
||||
result := BMessage_FindInt8(CPlusObject, Name, anInt8);
|
||||
end;
|
||||
|
||||
function BMessage.AddInt16(const Name : PChar; anInt16 : Smallint) : Status_t;
|
||||
begin
|
||||
result := BMessage_AddInt16(CPlusObject, Name, anInt16);
|
||||
end;
|
||||
|
||||
function BMessage.AddInt32(const Name : PChar; anInt32 : Integer) : Status_t;
|
||||
begin
|
||||
result := BMessage_AddInt32(CPlusObject, Name, anInt32);
|
||||
end;
|
||||
|
||||
function BMessage.AddInt64(const Name : PChar; anInt64 : int64) : Status_t;
|
||||
begin
|
||||
result := BMessage_AddInt64(CPlusObject, Name, anInt64);
|
||||
end;
|
||||
|
||||
function BMessage.AddFloat(const Name : PChar; aFloat : Single) : Status_t;
|
||||
begin
|
||||
result := BMessage_AddFloat(CPlusObject, Name, aFloat);
|
||||
end;
|
||||
|
||||
function BMessage.AddDouble(const Name : PChar; aDouble : Double) : Status_t;
|
||||
begin
|
||||
result := BMessage_AddDouble(CPlusObject, Name, aDouble);
|
||||
end;
|
||||
|
||||
function BMessage.AddString(const Name : PChar; aString : PChar) : Status_t;
|
||||
begin
|
||||
result := BMessage_AddString(CPlusObject, Name, aString);
|
||||
end;
|
||||
|
||||
function BMessage.FindString(const Name : PChar;var aString : PChar) : Status_t;
|
||||
begin
|
||||
result := BMessage_FindString(CPlusObject, Name, aString);
|
||||
end;
|
||||
|
||||
function BMessage.AddMessage(const Name : PChar; aMessage : TCPlusObject) : Status_t;
|
||||
begin
|
||||
result := BMessage_AddMessage(CPlusObject, Name, aMessage);
|
||||
end;
|
||||
|
||||
function BMessage.CountNames(aType : Type_Code) : Integer;
|
||||
begin
|
||||
result := BMessage_CountNames(CPlusObject, aType);
|
||||
end;
|
||||
|
||||
function BMessage.HasSpecifiers : boolean;
|
||||
begin
|
||||
result := BMessage_HasSpecifiers(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessage.IsSystem : boolean;
|
||||
begin
|
||||
result := BMessage_IsSystem(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessage.MakeEmpty : Status_t;
|
||||
begin
|
||||
result := BMessage_MakeEmpty(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessage.IsEmpty : boolean;
|
||||
begin
|
||||
result := BMessage_IsEmpty(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessage.RemoveName(const Name : PChar) : Status_t;
|
||||
begin
|
||||
result := BMessage_RemoveName(CPlusObject, Name);
|
||||
end;
|
||||
|
||||
procedure BMessage.PrintToStream;
|
||||
begin
|
||||
BMessage_PrintToStream(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessage.RemoveData(const name : PChar; index : Integer) : Status_t;
|
||||
begin
|
||||
result := BMessage_RemoveData(CPlusObject, name, index);
|
||||
end;
|
||||
|
||||
function BMessage.WasDelivered : boolean;
|
||||
begin
|
||||
result := BMessage_WasDelivered(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessage.IsSourceRemote : boolean;
|
||||
begin
|
||||
result := BMessage_IsSourceRemote(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessage.IsSourceWaiting : boolean;
|
||||
begin
|
||||
result := BMessage_IsSourceWaiting(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessage.IsReply : boolean;
|
||||
begin
|
||||
result := BMessage_IsReply(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessage.Previous : BMessage;
|
||||
begin
|
||||
result := BMessage.Wrap(BMessage_Previous(CPlusObject));
|
||||
end;
|
||||
|
||||
function BMessage.WasDropped : boolean;
|
||||
begin
|
||||
result := BMessage_WasDropped(CPlusObject);
|
||||
end;
|
||||
|
||||
end.
|
||||
249
bepascal/source/bepascal/pas/src/be/app/messenger.pp
Normal file
249
bepascal/source/bepascal/pas/src/be/app/messenger.pp
Normal file
@@ -0,0 +1,249 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit messenger;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, os, Handler, Looper, Message, SupportDefs;
|
||||
|
||||
type
|
||||
BMessenger = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create; override;
|
||||
constructor Create(mime_sig : PChar; aTeam : Team_id; perr : PStatus_t);
|
||||
constructor Create(handler : BHandler; looper : BLooper; perr : PStatus_t);
|
||||
constructor Create(from : BMessenger);
|
||||
destructor Destroy; override;
|
||||
function IsTargetLocal : boolean;
|
||||
function Target(looper : BLooper) : BHandler;
|
||||
function LockTarget : boolean;
|
||||
// function LockTargetWithTimeout(timeout : Bigtime_t) : Status_t;
|
||||
function SendMessage(command : Cardinal; reply_to : BHandler) : Status_t;
|
||||
function SendMessage(a_message : BMessage; reply_to : BHandler; timeout : Bigtime_t) : Status_t;
|
||||
function SendMessage(a_message : BMessage; reply_to : BMessenger; timeout : Bigtime_t) : Status_t;
|
||||
function SendMessage(command : Cardinal; reply : BMessage) : Status_t;
|
||||
function SendMessage(a_message : BMessage; reply : BMessage; send_timeout : Bigtime_t; reply_timeout : Bigtime_t) : Status_t;
|
||||
// function operator=(from : BMessenger) : BMessenger;
|
||||
// function operator==(other : BMessenger) : boolean;
|
||||
function IsValid : boolean;
|
||||
function Team : Team_id;
|
||||
// constructor Create(aTeam : Team_id; port : TPort_id; token : integer; preferred : boolean);
|
||||
// procedure InitData(mime_sig : PChar; aTeam : Team_id; perr : PStatus_t);
|
||||
// procedure port_id fPort;
|
||||
// procedure int32 fHandlerToken;
|
||||
// procedure team_id fTeam;
|
||||
// procedure int32 extra0;
|
||||
// procedure int32 extra1;
|
||||
// procedure bool fPreferredTarget;
|
||||
// procedure bool extra2;
|
||||
// procedure bool extra3;
|
||||
// procedure bool extra4;
|
||||
end;
|
||||
|
||||
function BMessenger_Create(AObject : TBeObject) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create';
|
||||
function BMessenger_Create(AObject : TBeObject; mime_sig : PChar; team : Team_id; perr : PStatus_t) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create_1';
|
||||
function BMessenger_Create(AObject : TBeObject; handler : BHandler; looper : BLooper; perr : PStatus_t) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create_2';
|
||||
function BMessenger_Create(AObject : TBeObject; from : BMessenger) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create_3';
|
||||
procedure BMessenger_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_Free';
|
||||
function BMessenger_IsTargetLocal(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMessenger_IsTargetLocal';
|
||||
function BMessenger_Target(AObject : TCPlusObject; looper : TCplusObject) : BHandler; cdecl; external BePascalLibName name 'BMessenger_Target';
|
||||
function BMessenger_LockTarget(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMessenger_LockTarget';
|
||||
//function BMessenger_LockTargetWithTimeout(AObject : TCPlusObject; timeout : Bigtime_t) : Status_t; cdecl; external BePascalLibName name 'BMessenger_LockTargetWithTimeout';
|
||||
function BMessenger_SendMessage(AObject : TCPlusObject; command : Cardinal; reply_to : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage';
|
||||
function BMessenger_SendMessage_1(AObject : TCPlusObject; a_message : TCplusObject; reply_to : TCplusObject; timeout : Bigtime_t) : Status_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_1';
|
||||
// How to handle this ? (remove the comment to see what to fix)
|
||||
function BMessenger_SendMessage_2(AObject : TCPlusObject; a_message : TCplusObject; reply_to : TCplusObject; timeout : Bigtime_t) : Status_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_2';
|
||||
function BMessenger_SendMessage_3(AObject : TCPlusObject; command : Cardinal; reply : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_3';
|
||||
function BMessenger_SendMessage_4(AObject : TCPlusObject; a_message : TCplusObject; reply : TCplusObject; send_timeout : Bigtime_t; reply_timeout : Bigtime_t) : Status_t; cdecl; external BePascalLibName name 'BMessenger_SendMessage_4';
|
||||
//function BMessenger_operator=(AObject : TCPlusObject; from : BMessenger) : BMessenger; cdecl; external BePascalLibName name 'BMessenger_operator=';
|
||||
//function BMessenger_operator==(AObject : TCPlusObject; other : BMessenger) : boolean; cdecl; external BePascalLibName name 'BMessenger_operator==';
|
||||
function BMessenger_IsValid(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BMessenger_IsValid';
|
||||
function BMessenger_Team(AObject : TCPlusObject) : Team_id; cdecl; external BePascalLibName name 'BMessenger_Team';
|
||||
//function BMessenger_Create(AObject : TBeObject; team : Team_id; port : TPort_id; token : integer; preferred : boolean) : TCplusObject; cdecl; external BePascalLibName name 'BMessenger_Create';
|
||||
//procedure BMessenger_InitData(AObject : TCPlusObject; mime_sig : PChar; team : Team_id; perr : PStatus_t); cdecl; external BePascalLibName name 'BMessenger_InitData';
|
||||
//procedure BMessenger_port_id fPort(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_port_id fPort';
|
||||
//procedure BMessenger_int32 fHandlerToken(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_int32 fHandlerToken';
|
||||
//procedure BMessenger_team_id fTeam(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_team_id fTeam';
|
||||
//procedure BMessenger_int32 extra0(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_int32 extra0';
|
||||
//procedure BMessenger_int32 extra1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_int32 extra1';
|
||||
//procedure BMessenger_bool fPreferredTarget(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_bool fPreferredTarget';
|
||||
//procedure BMessenger_bool extra2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_bool extra2';
|
||||
//procedure BMessenger_bool extra3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_bool extra3';
|
||||
//procedure BMessenger_bool extra4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMessenger_bool extra4';
|
||||
|
||||
var
|
||||
be_app_BMessenger : BMessenger;
|
||||
be_app_messengerCPlus : TCPlusObject; cvar; external;
|
||||
|
||||
implementation
|
||||
|
||||
constructor BMessenger.Create;
|
||||
begin
|
||||
BMessenger_Create(Self);
|
||||
end;
|
||||
|
||||
constructor BMessenger.Create(mime_sig : PChar; aTeam : Team_id; perr : PStatus_t);
|
||||
begin
|
||||
CPlusObject := BMessenger_Create(Self, mime_sig, aTeam, perr);
|
||||
end;
|
||||
|
||||
constructor BMessenger.Create(handler : BHandler; looper : BLooper; perr : PStatus_t);
|
||||
begin
|
||||
CPlusObject := BMessenger_Create(Self, handler, looper, perr);
|
||||
end;
|
||||
|
||||
constructor BMessenger.Create(from : BMessenger);
|
||||
begin
|
||||
CPlusObject := BMessenger_Create(Self, from);
|
||||
end;
|
||||
|
||||
destructor BMessenger.Destroy;
|
||||
begin
|
||||
BMessenger_Free(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessenger.IsTargetLocal : boolean;
|
||||
begin
|
||||
Result := BMessenger_IsTargetLocal(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessenger.Target(looper : BLooper) : BHandler;
|
||||
begin
|
||||
Result := BMessenger_Target(CPlusObject, looper.CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessenger.LockTarget : boolean;
|
||||
begin
|
||||
Result := BMessenger_LockTarget(CPlusObject);
|
||||
end;
|
||||
|
||||
//function BMessenger.LockTargetWithTimeout(timeout : Bigtime_t) : Status_t;
|
||||
//begin
|
||||
// BMessenger_LockTargetWithTimeout(CPlusObject, timeout);
|
||||
//end;
|
||||
|
||||
function BMessenger.SendMessage(command : Cardinal; reply_to : BHandler) : Status_t;
|
||||
begin
|
||||
Result := BMessenger_SendMessage(CPlusObject, command, reply_to.CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessenger.SendMessage(a_message : BMessage; reply_to : BHandler; timeout : Bigtime_t) : Status_t;
|
||||
begin
|
||||
Result := BMessenger_SendMessage_1(CPlusObject, a_message.CPlusObject, reply_to.CPlusObject, timeout);
|
||||
end;
|
||||
|
||||
function BMessenger.SendMessage(a_message : BMessage; reply_to : BMessenger; timeout : Bigtime_t) : Status_t;
|
||||
begin
|
||||
Result := BMessenger_SendMessage_2(CPlusObject, a_message.CPlusObject, reply_to.CPlusObject, timeout);
|
||||
end;
|
||||
|
||||
function BMessenger.SendMessage(command : Cardinal; reply : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BMessenger_SendMessage_3(CPlusObject, command, reply.CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessenger.SendMessage(a_message : BMessage; reply : BMessage; send_timeout : Bigtime_t; reply_timeout : Bigtime_t) : Status_t;
|
||||
begin
|
||||
Result := BMessenger_SendMessage_4(CPlusObject, a_message.CPlusObject, reply.CPlusObject, send_timeout, reply_timeout);
|
||||
end;
|
||||
|
||||
//function BMessenger.operator=(from : BMessenger) : BMessenger;
|
||||
//begin
|
||||
// BMessenger_operator=(CPlusObject, from);
|
||||
//end;
|
||||
//
|
||||
//function BMessenger.operator==(other : BMessenger) : boolean;
|
||||
//begin
|
||||
// BMessenger_operator==(CPlusObject, other);
|
||||
//end;
|
||||
|
||||
function BMessenger.IsValid : boolean;
|
||||
begin
|
||||
Result := BMessenger_IsValid(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMessenger.Team : Team_id;
|
||||
begin
|
||||
Result := BMessenger_Team(CPlusObject);
|
||||
end;
|
||||
|
||||
//constructor BMessenger.Create(aTeam : Team_id; port : TPort_id; token : integer; preferred : boolean);
|
||||
//begin
|
||||
// CPlusObject := BMessenger_Create(Self, aTeam, port, token, preferred);
|
||||
//end;
|
||||
|
||||
//procedure BMessenger.InitData(mime_sig : PChar; aTeam : Team_id; perr : PStatus_t);
|
||||
//begin
|
||||
// BMessenger_InitData(CPlusObject, mime_sig, aTeam, perr);
|
||||
//end;
|
||||
|
||||
//procedure BMessenger.port_id fPort;
|
||||
//begin
|
||||
// BMessenger_port_id fPort(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BMessenger.int32 fHandlerToken;
|
||||
//begin
|
||||
// BMessenger_int32 fHandlerToken(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BMessenger.team_id fTeam;
|
||||
//begin
|
||||
// BMessenger_team_id fTeam(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BMessenger.int32 extra0;
|
||||
//begin
|
||||
// BMessenger_int32 extra0(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BMessenger.int32 extra1;
|
||||
//begin
|
||||
// BMessenger_int32 extra1(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BMessenger.bool fPreferredTarget;
|
||||
//begin
|
||||
// BMessenger_bool fPreferredTarget(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BMessenger.bool extra2;
|
||||
//begin
|
||||
// BMessenger_bool extra2(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BMessenger.bool extra3;
|
||||
//begin
|
||||
// BMessenger_bool extra3(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BMessenger.bool extra4;
|
||||
//begin
|
||||
// BMessenger_bool extra4(CPlusObject);
|
||||
//end;
|
||||
|
||||
initialization
|
||||
be_app_BMessenger := nil;
|
||||
|
||||
finalization
|
||||
be_app_BMessenger := nil;
|
||||
|
||||
end.
|
||||
343
bepascal/source/bepascal/pas/src/be/app/roster.pp
Normal file
343
bepascal/source/bepascal/pas/src/be/app/roster.pp
Normal file
@@ -0,0 +1,343 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit Roster;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, appdefs, supportdefs, OS, Entry, StorageDefs, List, Messenger,
|
||||
message;
|
||||
|
||||
type
|
||||
PTEntryRef = ^EntryRef;
|
||||
|
||||
AppInfoProc = procedure;
|
||||
|
||||
AppInfo = record
|
||||
thread : Thread_id;
|
||||
team : Team_id;
|
||||
port : Port_id;
|
||||
flags : Cardinal;
|
||||
ref : EntryRef;
|
||||
signature : Array[0..B_MIME_TYPE_LENGTH] of Char;
|
||||
end;
|
||||
|
||||
BRoster = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
//*****************
|
||||
function IsRunning(mime_sig : PChar) : boolean;
|
||||
function IsRunning(var ref : EntryRef) : boolean;
|
||||
function TeamFor(mime_sig : PChar) : Team_id;
|
||||
function TeamFor(var ref : EntryRef) : Team_id;
|
||||
procedure GetAppList(team_id_list : BList);
|
||||
procedure GetAppList(sig : PChar; team_id_list : BList);
|
||||
function GeAppInfo(sig : PChar; var info : AppInfo) : Status_t;
|
||||
function GeAppInfo(var ref : EntryRef; var info : AppInfo) : Status_t;
|
||||
function GetRunningAppInfo(team : Team_id; var info : AppInfo) : Status_t;
|
||||
function GetActiveAppInfo(var info : AppInfo) : Status_t;
|
||||
function FindApp(mime_type : PChar; var app : EntryRef) : Status_t;
|
||||
function FindApp(var ref : EntryRef; var app : EntryRef) : Status_t;
|
||||
function Broadcast(msg : BMessage) : Status_t;
|
||||
function Broadcast(msg : BMessage; reply_to : BMessenger) : Status_t;
|
||||
function StopWatching(target : BMessenger) : Status_t;
|
||||
function ActivateApp(team : Team_id) : Status_t;
|
||||
function Launch(mime_type : PChar; initial_msgs : BMessage; var app_team : Team_id) : Status_t;
|
||||
function Launch(mime_type : PChar; message_list : BList; var app_team : Team_id) : Status_t;
|
||||
function Launch(mime_type : PChar; argc : integer; args : PChar; var app_team : Team_id) : Status_t;
|
||||
function Launch(var ref : EntryRef; initial_message : BMessage; var app_team : Team_id) : Status_t;
|
||||
function Launch(var ref : EntryRef; message_list : BList; var app_team : Team_id) : Status_t;
|
||||
function Launch(var ref : EntryRef; argc : integer; args : PChar; var app_team : Team_id) : Status_t;
|
||||
procedure GetRecentDocuments(refList : BMessage; maxCount : integer; ofType : PChar; openedByAppSig : PChar);
|
||||
procedure GetRecentDocuments(refList : BMessage; maxCount : integer; ofTypeList : PChar; ofTypeListCount : integer; openedByAppSig : PChar);
|
||||
procedure GetRecentFolders(refList : BMessage; maxCount : integer; openedByAppSig : PChar);
|
||||
procedure GetRecentApps(refList : BMessage; maxCount : integer);
|
||||
procedure AddToRecentDocuments(var doc : EntryRef; appSig : PChar);
|
||||
procedure AddToRecentFolders(var folder : EntryRef; appSig : PChar);
|
||||
// private
|
||||
// procedure enum mtarget { MAIN_MESSENGER, MIME_MESSENGER, USE_GIVEN };
|
||||
{ function _StartWatching(t : ; roster_mess : BMessenger; what : Cardinal; notify : BMessenger; event_mask : Cardinal) : Status_t;
|
||||
function _StopWatching(t : ; roster_mess : BMessenger; what : Cardinal; notify : BMessenger) : Status_t;
|
||||
function AddApplication(mime_sig : PChar; ref : ^EntryRef; flags : Cardinal; team : Team_id; thread : TThread_id; port : TPort_id; full_reg : boolean) : Cardinal;
|
||||
procedure SetSignature(team : Team_id; mime_sig : PChar);
|
||||
procedure SetThread(team : Team_id; tid : TThread_id);
|
||||
procedure SetThreadAndTeam(entry_token : Cardinal; tid : TThread_id; team : Team_id);
|
||||
procedure CompleteRegistration(team : Team_id; : TThread_id; port : TPort_id);
|
||||
function IsAppPreRegistered(ref : ^BEntryRef; team : Team_id; info : ^AppInfo) : boolean;
|
||||
procedure RemovePreRegApp(entry_token : Cardinal);
|
||||
procedure RemoveApp(team : Team_id);
|
||||
function xLaunchAppPrivate(mime_sig : PChar; ref : ^BEntryRef; msg_list : BList; cargs : integer; args : PChar; app_team : ^Team_id) : Status_t;
|
||||
function UpdateActiveApp(team : Team_id) : boolean;
|
||||
procedure SetAppFlags(team : Team_id; flags : Cardinal);
|
||||
procedure DumpRoster;
|
||||
function resolve_app(in_type : PChar; ref : ^BEntryRef; app_ref : ^BEntryRef; app_sig : PChar; app_flags : Cardinal; was_document : boolean) : Status_t;
|
||||
function translate_ref(ref : ^BEntryRef; app_meta : TBMimeType; app_ref : ^BEntryRef; app_file : TBFile; app_sig : PChar; was_document : boolean) : Status_t;
|
||||
function translate_type(mime_type : PChar; meta : TBMimeType; app_ref : ^BEntryRef; app_file : TBFile; app_sig : PChar) : Status_t;
|
||||
function sniff_file(file : ^BEntryRef; finfo : TBNodeInfo; mime_type : PChar) : Status_t;
|
||||
function is_wildcard(sig : PChar) : boolean;
|
||||
function get_unique_supporting_app(apps : BMessage; out_sig : PChar) : Status_t;
|
||||
function get_random_supporting_app(apps : BMessage; out_sig : PChar) : Status_t;
|
||||
function build_arg_vector(args : PChar; pargs : integer; app_ref : ^BEntryRef; doc_ref : ^BEntryRef) : PChar;
|
||||
function send_to_running(tema : Team_id; app_ref : ^BEntryRef; cargs : integer; args : PChar; msg_list : BList; ref : ^BEntryRef) : Status_t;
|
||||
procedure IniBMessengers;
|
||||
procedure BMessenger fMess;
|
||||
procedure BMessenger fMimeMess;
|
||||
procedure uint32 _fReserved[3];
|
||||
}
|
||||
end;
|
||||
|
||||
function Get_be_roster : TCPlusObject; cdecl; external BePascalLibName;
|
||||
function BRoster_Create(AObject : TObject) : TCPlusObject; cdecl; external BePascalLibName;
|
||||
procedure BRoster_Destroy(CPlusObject : TCPlusObject); cdecl; external BePascalLibName;
|
||||
|
||||
//function app_info_Create(AObject : TBeObject); cdecl; external BePascalLibName name 'app_info_Create';
|
||||
//procedure app_info_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_Free';
|
||||
//procedure app_info_thread_id thread(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_thread_id thread';
|
||||
//procedure app_info_team_id team(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_team_id team';
|
||||
//procedure app_info_port_id port(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_port_id port';
|
||||
//procedure app_info_uint32 flags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_uint32 flags';
|
||||
//procedure app_info_entry_ref ref(AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_entry_ref ref';
|
||||
//procedure app_info_char signature[B_MIME_TYPE_LENGTH](AObject : TCPlusObject); cdecl; external BePascalLibName name 'app_info_char signature[B_MIME_TYPE_LENGTH]';
|
||||
//function BRoster_Create(AObject : TBeObject); cdecl; external BePascalLibName name 'BRoster_Create';
|
||||
//procedure BRoster_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_Free';
|
||||
function BRoster_IsRunning(AObject : TCPlusObject; mime_sig : PChar) : boolean; cdecl; external BePascalLibName name 'BRoster_IsRunning';
|
||||
function BRoster_IsRunning(AObject : TCPlusObject; var ref : EntryRef) : boolean; cdecl; external BePascalLibName name 'BRoster_IsRunning';
|
||||
function BRoster_TeamFor(AObject : TCPlusObject; mime_sig : PChar) : Team_id; cdecl; external BePascalLibName name 'BRoster_TeamFor';
|
||||
function BRoster_TeamFor(AObject : TCPlusObject; var ref : EntryRef) : Team_id; cdecl; external BePascalLibName name 'BRoster_TeamFor';
|
||||
procedure BRoster_GetAppList(AObject : TCPlusObject; team_id_list : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_GetAppList';
|
||||
procedure BRoster_GetAppList(AObject : TCPlusObject; sig : PChar; team_id_list : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_GetAppList';
|
||||
function BRoster_GeAppInfo(AObject : TCPlusObject; sig : PChar; var info : AppInfo) : Status_t; cdecl; external BePascalLibName name 'BRoster_GetAppInfo';
|
||||
function BRoster_GeAppInfo(AObject : TCPlusObject; var ref : EntryRef; var info : AppInfo) : Status_t; cdecl; external BePascalLibName name 'BRoster_GetAppInfo';
|
||||
function BRoster_GetRunningAppInfo(AObject : TCPlusObject; team : Team_id; var info : AppInfo) : Status_t; cdecl; external BePascalLibName name 'BRoster_GetRunningAppInfo';
|
||||
function BRoster_GetActiveAppInfo(AObject : TCPlusObject; var info : AppInfo) : Status_t; cdecl; external BePascalLibName name 'BRoster_GetActiveAppInfo';
|
||||
function BRoster_FindApp(AObject : TCPlusObject; mime_type : PChar; var app : EntryRef) : Status_t; cdecl; external BePascalLibName name 'BRoster_FindApp';
|
||||
function BRoster_FindApp_1(AObject : TCPlusObject; var ref : EntryRef; var app : EntryRef) : Status_t; cdecl; external BePascalLibName name 'BRoster_FindApp';
|
||||
function BRoster_Broadcast(aRoster : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRoster_Broadcast';
|
||||
function BRoster_Broadcast_1(AObject : TCPlusObject; msg : TCPlusObject; reply_to : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRoster_Broadcast';
|
||||
function BRoster_StopWatching(AObject : TCPlusObject; target : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRoster_StopWatching';
|
||||
function BRoster_ActivateApp(AObject : TCPlusObject; team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_ActivateApp';
|
||||
function BRoster_Launch(AObject : TCPlusObject; mime_type : PChar; initial_msgs : TCPlusObject; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch';
|
||||
function BRoster_Launch_1(AObject : TCPlusObject; mime_type : PChar; message_list : TCPlusObject; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch';
|
||||
function BRoster_Launch_2(AObject : TCPlusObject; mime_type : PChar; argc : integer; args : PChar; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch';
|
||||
function BRoster_Launch_3(AObject : TCPlusObject; var ref : EntryRef; initial_message : BMessage; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch';
|
||||
function BRoster_Launch_4(AObject : TCPlusObject; var ref : EntryRef; message_list : BList; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch';
|
||||
function BRoster_Launch_5(AObject : TCPlusObject; var ref : EntryRef; argc : integer; args : PChar; var app_team : Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_Launch';
|
||||
procedure BRoster_GetRecentDocuments(AObject : TCPlusObject; refList : TCPlusObject; maxCount : integer; ofType : PChar; openedByAppSig : PChar); cdecl; external BePascalLibName name 'BRoster_GetRecentDocuments';
|
||||
procedure BRoster_GetRecentDocuments(AObject : TCPlusObject; refList : TCPlusObject; maxCount : integer; ofTypeList : PChar; ofTypeListCount : integer; openedByAppSig : PChar); cdecl; external BePascalLibName name 'BRoster_GetRecentDocuments';
|
||||
procedure BRoster_GetRecentFolders(AObject : TCPlusObject; refList : TCPlusObject; maxCount : integer; openedByAppSig : PChar); cdecl; external BePascalLibName name 'BRoster_GetRecentFolders';
|
||||
procedure BRoster_GetRecentApps(AObject : TCPlusObject; refList : TCPlusObject; maxCount : integer); cdecl; external BePascalLibName name 'BRoster_GetRecentApps';
|
||||
procedure BRoster_AddToRecentDocuments(AObject : TCPlusObject; var doc : EntryRef; appSig : PChar); cdecl; external BePascalLibName name 'BRoster_AddToRecentDocuments';
|
||||
procedure BRoster_AddToRecentFolders(AObject : TCPlusObject; var folder : EntryRef; appSig : PChar); cdecl; external BePascalLibName name 'BRoster_AddToRecentFolders';
|
||||
// procedure BRoster_enum mtarget { MAIN_MESSENGER, MIME_MESSENGER, USE_GIVEN }(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_enum mtarget { MAIN_MESSENGER, MIME_MESSENGER, USE_GIVEN }';
|
||||
{function BRoster__StartWatching(AObject : TCPlusObject; t : ; roster_mess : TCPlusObject; what : Cardinal; notify : TCPlusObject; event_mask : Cardinal) : Status_t; cdecl; external BePascalLibName name 'BRoster__StartWatching';
|
||||
function BRoster__StopWatching(AObject : TCPlusObject; t : ; roster_mess : TCPlusObject; what : Cardinal; notify : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRoster__StopWatching';
|
||||
function BRoster_AddApplication(AObject : TCPlusObject; mime_sig : PChar; ref : ^BEntryRef; flags : Cardinal; team : Team_id; thread : TThread_id; port : TPort_id; full_reg : boolean) : Cardinal; cdecl; external BePascalLibName name 'BRoster_AddApplication';
|
||||
procedure BRoster_SetSignature(AObject : TCPlusObject; team : Team_id; mime_sig : PChar); cdecl; external BePascalLibName name 'BRoster_SetSignature';
|
||||
procedure BRoster_SetThread(AObject : TCPlusObject; team : Team_id; tid : TThread_id); cdecl; external BePascalLibName name 'BRoster_SetThread';
|
||||
procedure BRoster_SetThreadAndTeam(AObject : TCPlusObject; entry_token : Cardinal; tid : TThread_id; team : Team_id); cdecl; external BePascalLibName name 'BRoster_SetThreadAndTeam';
|
||||
procedure BRoster_CompleteRegistration(AObject : TCPlusObject; team : Team_id; : TThread_id; port : TPort_id); cdecl; external BePascalLibName name 'BRoster_CompleteRegistration';
|
||||
function BRoster_IsAppPreRegistered(AObject : TCPlusObject; ref : ^BEntryRef; team : Team_id; info : ^AppInfo) : boolean; cdecl; external BePascalLibName name 'BRoster_IsAppPreRegistered';
|
||||
procedure BRoster_RemovePreRegApp(AObject : TCPlusObject; entry_token : Cardinal); cdecl; external BePascalLibName name 'BRoster_RemovePreRegApp';
|
||||
procedure BRoster_RemoveApp(AObject : TCPlusObject; team : Team_id); cdecl; external BePascalLibName name 'BRoster_RemoveApp';
|
||||
function BRoster_xLaunchAppPrivate(AObject : TCPlusObject; mime_sig : PChar; ref : ^BEntryRef; msg_list : TCPlusObject; cargs : integer; args : PChar; app_team : ^Team_id) : Status_t; cdecl; external BePascalLibName name 'BRoster_xLaunchAppPrivate';
|
||||
function BRoster_UpdateActiveApp(AObject : TCPlusObject; team : Team_id) : boolean; cdecl; external BePascalLibName name 'BRoster_UpdateActiveApp';
|
||||
procedure BRoster_SetAppFlags(AObject : TCPlusObject; team : Team_id; flags : Cardinal); cdecl; external BePascalLibName name 'BRoster_SetAppFlags';
|
||||
procedure BRoster_DumpRoster(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_DumpRoster';
|
||||
function BRoster_resolve_app(AObject : TCPlusObject; in_type : PChar; ref : ^BEntryRef; app_ref : ^BEntryRef; app_sig : PChar; app_flags : Cardinal; was_document : boolean) : Status_t; cdecl; external BePascalLibName name 'BRoster_resolve_app';
|
||||
function BRoster_translate_ref(AObject : TCPlusObject; ref : ^BEntryRef; app_meta : TCPlusObject; app_ref : ^BEntryRef; app_file : TCPlusObject; app_sig : PChar; was_document : boolean) : Status_t; cdecl; external BePascalLibName name 'BRoster_translate_ref';
|
||||
function BRoster_translate_type(AObject : TCPlusObject; mime_type : PChar; meta : TCPlusObject; app_ref : ^BEntryRef; app_file : TCPlusObject; app_sig : PChar) : Status_t; cdecl; external BePascalLibName name 'BRoster_translate_type';
|
||||
function BRoster_sniff_file(AObject : TCPlusObject; file : ^BEntryRef; finfo : TCPlusObject; mime_type : PChar) : Status_t; cdecl; external BePascalLibName name 'BRoster_sniff_file';
|
||||
function BRoster_is_wildcard(AObject : TCPlusObject; sig : PChar) : boolean; cdecl; external BePascalLibName name 'BRoster_is_wildcard';
|
||||
function BRoster_get_unique_supporting_app(AObject : TCPlusObject; apps : BMessage; out_sig : PChar) : Status_t; cdecl; external BePascalLibName name 'BRoster_get_unique_supporting_app';
|
||||
function BRoster_get_random_supporting_app(AObject : TCPlusObject; apps : BMessage; out_sig : PChar) : Status_t; cdecl; external BePascalLibName name 'BRoster_get_random_supporting_app';
|
||||
function BRoster_build_arg_vector(AObject : TCPlusObject; args : PChar; pargs : integer; app_ref : ^BEntryRef; doc_ref : ^BEntryRef) : PChar; cdecl; external BePascalLibName name 'BRoster_build_arg_vector';
|
||||
function BRoster_send_to_running(AObject : TCPlusObject; tema : Team_id; app_ref : ^BEntryRef; cargs : integer; args : PChar; msg_list : BList; ref : ^BEntryRef) : Status_t; cdecl; external BePascalLibName name 'BRoster_send_to_running';
|
||||
procedure BRoster_IniBMessengers(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_IniBMessengers';
|
||||
procedure BRoster_BMessenger fMess(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_BMessenger fMess';
|
||||
procedure BRoster_BMessenger fMimeMess(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_BMessenger fMimeMess';
|
||||
procedure BRoster_uint32 _fReserved[3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRoster_uint32 _fReserved[3]';
|
||||
}
|
||||
|
||||
var
|
||||
be_roster : BRoster;
|
||||
|
||||
implementation
|
||||
|
||||
constructor BRoster.Create;
|
||||
begin
|
||||
inherited;
|
||||
CPlusObject := BRoster_Create(Self);
|
||||
be_roster := Self;
|
||||
end;
|
||||
|
||||
destructor BRoster.Destroy;
|
||||
begin
|
||||
BRoster_Destroy(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BRoster.IsRunning(mime_sig : PChar) : boolean;
|
||||
begin
|
||||
Result := BRoster_IsRunning(CPlusObject, mime_sig);
|
||||
end;
|
||||
|
||||
function BRoster.IsRunning(var ref : EntryRef) : boolean;
|
||||
begin
|
||||
Result := BRoster_IsRunning(CPlusObject, ref);
|
||||
end;
|
||||
|
||||
function BRoster.TeamFor(mime_sig : PChar) : Team_id;
|
||||
begin
|
||||
Result := BRoster_TeamFor(CPlusObject, mime_sig);
|
||||
end;
|
||||
|
||||
function BRoster.TeamFor(var ref : EntryRef) : Team_id;
|
||||
begin
|
||||
Result := BRoster_TeamFor(CPlusObject, ref);
|
||||
end;
|
||||
|
||||
procedure BRoster.GetAppList(team_id_list : BList);
|
||||
begin
|
||||
BRoster_GetAppList(CPlusObject, team_id_list.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRoster.GetAppList(sig : PChar; team_id_list : BList);
|
||||
begin
|
||||
BRoster_GetAppList(CPlusObject, sig, team_id_list.CPlusObject);
|
||||
end;
|
||||
|
||||
function BRoster.GeAppInfo(sig : PChar; var info : AppInfo) : Status_t;
|
||||
begin
|
||||
Result := BRoster_GeAppInfo(CPlusObject, sig, info);
|
||||
end;
|
||||
|
||||
function BRoster.GeAppInfo(var ref : EntryRef; var info : AppInfo) : Status_t;
|
||||
begin
|
||||
Result := BRoster_GeAppInfo(CPlusObject, ref, info);
|
||||
end;
|
||||
|
||||
function BRoster.GetRunningAppInfo(team : Team_id; var info : AppInfo) : Status_t;
|
||||
begin
|
||||
Result := BRoster_GetRunningAppInfo(CPlusObject, team, info);
|
||||
end;
|
||||
|
||||
function BRoster.GetActiveAppInfo(var info : AppInfo) : Status_t;
|
||||
begin
|
||||
Result := BRoster_GetActiveAppInfo(CPlusObject, info);
|
||||
end;
|
||||
|
||||
function BRoster.FindApp(mime_type : PChar; var app : EntryRef) : Status_t;
|
||||
begin
|
||||
Result := BRoster_FindApp(CPlusObject, mime_type, app);
|
||||
end;
|
||||
|
||||
function BRoster.FindApp(var ref : EntryRef; var app : EntryRef) : Status_t;
|
||||
begin
|
||||
Result := BRoster_FindApp_1(CPlusObject, ref, app);
|
||||
end;
|
||||
|
||||
function BRoster.Broadcast(msg : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BRoster_Broadcast(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
function BRoster.Broadcast(msg : BMessage; reply_to : BMessenger) : Status_t;
|
||||
begin
|
||||
Result := BRoster_Broadcast_1(CPlusObject, msg.CPlusObject, reply_to.CPlusObject);
|
||||
end;
|
||||
|
||||
function BRoster.StopWatching(target : BMessenger) : Status_t;
|
||||
begin
|
||||
Result := BRoster_StopWatching(CPlusObject, target.CPlusObject);
|
||||
end;
|
||||
|
||||
function BRoster.ActivateApp(team : Team_id) : Status_t;
|
||||
begin
|
||||
Result := BRoster_ActivateApp(CPlusObject, team);
|
||||
end;
|
||||
|
||||
function BRoster.Launch(mime_type : PChar; initial_msgs : BMessage; var app_team : Team_id) : Status_t;
|
||||
begin
|
||||
Result := BRoster_Launch(CPlusObject, mime_type, initial_msgs.CPlusObject, app_team);
|
||||
end;
|
||||
|
||||
function BRoster.Launch(mime_type : PChar; message_list : BList; var app_team : Team_id) : Status_t;
|
||||
begin
|
||||
Result := BRoster_Launch_1(CPlusObject, mime_type, message_list.CPlusObject, app_team);
|
||||
end;
|
||||
|
||||
function BRoster.Launch(mime_type : PChar; argc : integer; args : PChar; var app_team : Team_id) : Status_t;
|
||||
begin
|
||||
Result := BRoster_Launch_2(CPlusObject, mime_type, argc, args, app_team);
|
||||
end;
|
||||
|
||||
function BRoster.Launch(var ref : EntryRef; initial_message : BMessage; var app_team : Team_id) : Status_t;
|
||||
begin
|
||||
Result := BRoster_Launch_3(CPlusObject, ref, initial_message, app_team);
|
||||
end;
|
||||
|
||||
function BRoster.Launch(var ref : EntryRef; message_list : BList; var app_team : Team_id) : Status_t;
|
||||
begin
|
||||
Result := BRoster_Launch_4(CPlusObject, ref, message_list, app_team);
|
||||
end;
|
||||
|
||||
function BRoster.Launch(var ref : EntryRef; argc : integer; args : PChar; var app_team : Team_id) : Status_t;
|
||||
begin
|
||||
Result := BRoster_Launch_5(CPlusObject, ref, argc, args, app_team);
|
||||
end;
|
||||
|
||||
procedure BRoster.GetRecentDocuments(refList : BMessage; maxCount : integer; ofType : PChar; openedByAppSig : PChar);
|
||||
begin
|
||||
BRoster_GetRecentDocuments(CPlusObject, refList.CPlusObject, maxCount, ofType, openedByAppSig);
|
||||
end;
|
||||
|
||||
procedure BRoster.GetRecentDocuments(refList : BMessage; maxCount : integer; ofTypeList : PChar; ofTypeListCount : integer; openedByAppSig : PChar);
|
||||
begin
|
||||
BRoster_GetRecentDocuments(CPlusObject, refList.CPlusObject, maxCount, ofTypeList, ofTypeListCount, openedByAppSig);
|
||||
end;
|
||||
|
||||
procedure BRoster.GetRecentFolders(refList : BMessage; maxCount : integer; openedByAppSig : PChar);
|
||||
begin
|
||||
BRoster_GetRecentFolders(CPlusObject, refList.CPlusObject, maxCount, openedByAppSig);
|
||||
end;
|
||||
|
||||
procedure BRoster.GetRecentApps(refList : BMessage; maxCount : integer);
|
||||
begin
|
||||
BRoster_GetRecentApps(CPlusObject, refList.CPlusObject, maxCount);
|
||||
end;
|
||||
|
||||
procedure BRoster.AddToRecentDocuments(var doc : EntryRef; appSig : PChar);
|
||||
begin
|
||||
BRoster_AddToRecentDocuments(CPlusObject, doc, appSig);
|
||||
end;
|
||||
|
||||
procedure BRoster.AddToRecentFolders(var folder : EntryRef; appSig : PChar);
|
||||
begin
|
||||
BRoster_AddToRecentFolders(CPlusObject, folder, appSig);
|
||||
end;
|
||||
|
||||
initialization
|
||||
be_roster := BRoster.Wrap(Get_be_roster);
|
||||
|
||||
finalization
|
||||
be_roster.UnWrap;
|
||||
be_roster := nil;
|
||||
end.
|
||||
126
bepascal/source/bepascal/pas/src/be/bepas_kernel/beobj.pp
Normal file
126
bepascal/source/bepascal/pas/src/be/bepas_kernel/beobj.pp
Normal file
@@ -0,0 +1,126 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit beobj;
|
||||
|
||||
interface
|
||||
|
||||
{$M+}
|
||||
|
||||
uses
|
||||
fdblib;
|
||||
|
||||
// FreePascal use ld on BeOS (like on LINUX) to link to libraries.
|
||||
// ld use the environment variable BELIBRARIES to find libraries.
|
||||
|
||||
const
|
||||
BePascalLibName = 'bepascal';
|
||||
|
||||
type
|
||||
// BePascal types
|
||||
TCPlusObject = Pointer;
|
||||
THandle = Pointer;
|
||||
|
||||
TBeObject = class(TObject)
|
||||
private
|
||||
procedure Debug;
|
||||
protected
|
||||
FCPlusObject : TCPlusObject;
|
||||
public
|
||||
constructor Create; virtual;
|
||||
constructor CreatePas; virtual;
|
||||
constructor Wrap(ACPlusObject : TCPlusObject); virtual;
|
||||
destructor UnWrap; virtual;
|
||||
property CPlusObject : TCPlusObject read FCPlusObject write FCPlusObject;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
SysUtils;
|
||||
|
||||
var
|
||||
PasObject_GetPasClassName_hook : Pointer; cvar; external;
|
||||
|
||||
function PasObject_GetPasClassName_hook_func(PasObject : TBeObject) : PChar;
|
||||
begin
|
||||
if PasObject <> nil then
|
||||
Result := StrPCopy(Result, PasObject.ClassName)
|
||||
else
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
// Not really a useful function. Un jour peut être...
|
||||
function BPasObject_GetPasObject(ACPlusObject : TCPlusObject) : TObject; cdecl; external BePascalLibName name 'BPasObject_GetPasObject';
|
||||
|
||||
// start TBeObject
|
||||
constructor TBeObject.Create;
|
||||
begin
|
||||
inherited;
|
||||
Debug;
|
||||
end;
|
||||
|
||||
// Constructeur utilisé pour créer une instance Pascal à partir d'un objet C++.
|
||||
// Nécessaire notamment pour encapsuler les objets C++ passé en paramètre des
|
||||
// fonctions de hook.
|
||||
constructor TBeObject.Wrap(ACPlusObject : TCPlusObject);
|
||||
begin
|
||||
Self.CPlusObject := ACPlusObject;
|
||||
Debug;
|
||||
end;
|
||||
|
||||
constructor TBeObject.CreatePas;
|
||||
begin
|
||||
Create;
|
||||
end;
|
||||
|
||||
procedure TBeObject.Debug;
|
||||
var
|
||||
size : cardinal;
|
||||
begin
|
||||
{$IFDEF DEBUG}
|
||||
size := 0;
|
||||
size := SizeOf(Self.ClassType);
|
||||
SendText('Instance de ' + Self.ClassName + '(' + HexStr(longint(pointer(Self)), 8) + ')' +
|
||||
'(' + IntToStr(size) + ')' +
|
||||
' ');
|
||||
{$ENDIF}
|
||||
end;
|
||||
// Destructeur utilisé pour libérer l'objet pascal sans
|
||||
// détruire l'objet C++ correspondant. Utile pour
|
||||
// libérer la mémoire coté pascal dans le cas d'objets
|
||||
// C++ qui ne sont pas propriété de l'application
|
||||
// (cas des messages passés aux fonctions de rappel)
|
||||
destructor TBeObject.UnWrap;
|
||||
begin
|
||||
{$IFDEF DEBUG}
|
||||
SendText('UnWrap');
|
||||
{$ENDIF}
|
||||
// On passe CPlusObject à nil pour éviter de libérer
|
||||
// l'objet C++ lors de l'appel de free
|
||||
Self.CPlusObject := nil;
|
||||
end;
|
||||
|
||||
// end TBeObject
|
||||
|
||||
initialization
|
||||
PasObject_GetPasClassName_hook := @PasObject_GetPasClassName_hook_func;
|
||||
|
||||
finalization
|
||||
PasObject_GetPasClassName_hook := nil;
|
||||
end.
|
||||
220
bepascal/source/bepascal/pas/src/be/device/joystick.pp
Normal file
220
bepascal/source/bepascal/pas/src/be/device/joystick.pp
Normal file
@@ -0,0 +1,220 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit joystick;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, SupportDefs, os;
|
||||
|
||||
type
|
||||
BJoystick = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
function Open(portName : PChar) : Status_t;
|
||||
procedure Close;
|
||||
function Open_1(portName : PChar; enter_enhanced : boolean):Status_t;
|
||||
|
||||
function Update: Status_t;
|
||||
function SetMaxLatency( max_latency:TBigtime_t): Status_t;
|
||||
function CountDevices : Cardinal;
|
||||
function GetDeviceName( n : Integer; name : PChar; bufSize: Tsize_t): Status_t;
|
||||
|
||||
function CountSticks: Cardinal;
|
||||
function CountAxes:Cardinal;
|
||||
function CountHats:Cardinal;
|
||||
function CountButtons:Cardinal;
|
||||
function GetAxisValues( out_values : Integer; for_stick : cardinal): Status_t;
|
||||
function ButtonValues(for_stick: cardinal):Cardinal;
|
||||
function IsCalibrationEnabled:boolean;
|
||||
function EnableCalibration (calibrates : boolean): Status_t;
|
||||
|
||||
//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean;
|
||||
// function GetAxisNameAt(index: cardinal; BString *out_name): Status_t;
|
||||
// function GetHatNameAt( index: cardinal,BString *out_name): Status_t;
|
||||
// function GetButtonNameAt( index: cardinal,BString *out_name): Status_t; c
|
||||
// function GetControllerModule( BString *out_name): Status_t;
|
||||
// function GetControllerName( BString *out_name): Status_t;
|
||||
// function GetHatValues( uint8 *out_hats;for_stick: cardinal): Status_t;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
|
||||
function BJoystick_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BJoystick_Create';
|
||||
procedure BJoystick_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BJoystick_Free';
|
||||
|
||||
function BJoystick_Open(AObject : TCPlusObject; portName : PChar):Status_t ; cdecl; external BePascalLibName name 'BJoystick_Open';
|
||||
function BJoystick_Open_1(AObject : TCPlusObject; portName : PChar; enter_enhanced : boolean):Status_t; cdecl; external BePascalLibName name 'BJoystick_Open_1';
|
||||
procedure BJoystick_Close(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BJoystick_Close';
|
||||
function BJoystick_Update(AObject : TCPlusObject): Status_t; cdecl; external BePascalLibName name 'BJoystick_Update';
|
||||
function BJoystick_SetMaxLatency(AObject : TCPlusObject; max_latency:TBigtime_t): Status_t; cdecl; external BePascalLibName name 'BJoystick_SetMaxLatency';
|
||||
function BJoystick_CountDevices(AObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountDevices';
|
||||
function BJoystick_GetDeviceName(AObject : TCPlusObject; n : Integer; name : PChar; bufSize: Tsize_t): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetDeviceName';
|
||||
|
||||
function BJoystick_CountSticks(BAObject : TCPlusObject): Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountSticks';
|
||||
function BJoystick_CountAxes(BAObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountAxes';
|
||||
function BJoystick_CountHats(BAObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountHats';
|
||||
function BJoystick_CountButtons(BAObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountButtons';
|
||||
function BJoystick_GetAxisValues(BAObject : TCPlusObject; out_values : Integer; for_stick : cardinal): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetAxisValues';
|
||||
function BJoystick_ButtonValues(BAObject : TCPlusObject;for_stick: cardinal):Cardinal; cdecl; external BePascalLibName name 'BJoystick_ButtonValues';
|
||||
function BJoystick_IsCalibrationEnabled(BAObject : TCPlusObject):boolean; cdecl; external BePascalLibName name 'BJoystick_IsCalibrationEnabled';
|
||||
function BJoystick_EnableCalibration(BAObject : TCPlusObject;calibrates : boolean): Status_t; cdecl; external BePascalLibName name 'BJoystick_EnableCalibration';
|
||||
|
||||
//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean; cdecl; external BePascalLibName name 'BJoystick_EnterEnhancedMode';
|
||||
//function BJoystick_GetHatValues(BAObject : TCPlusObject, uint8 *out_hats;for_stick: cardinal): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetHatValues';
|
||||
//function BJoystick_GetAxisNameAt(BAObject : TCPlusObject;index: cardinal; BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetAxisNameAt';
|
||||
//function BJoystick_GetHatNameAt(BAObject : TCPlusObject; index: cardinal, BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetHatNameAt';
|
||||
//function BJoystick_GetButtonNameAt(BAObject : TCPlusObject; index: cardinal,BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetButtonNameAt';
|
||||
//function BJoystick_GetControllerModule(BAObject : TCPlusObject, BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetControllerModule';
|
||||
//function BJoystick_GetControllerName(BAObject : TCPlusObject, BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetControllerName';
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
|
||||
constructor BJoystick.Create;
|
||||
begin
|
||||
inherited;
|
||||
CPlusObject := BJoystick_Create(Self);
|
||||
end;
|
||||
|
||||
destructor BJoystick.Destroy;
|
||||
begin
|
||||
if CPlusObject <> nil then
|
||||
BJoystick_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
function BJoystick.Open(portName : PChar) : Status_t;
|
||||
begin
|
||||
result := BJoystick_Open(CPlusObject, portName);
|
||||
end;
|
||||
|
||||
function BJoystick.Open_1( portName : PChar; enter_enhanced : boolean):Status_t;
|
||||
begin
|
||||
result := BJoystick_Open_1(CPlusObject, portName , enter_enhanced);
|
||||
end;
|
||||
|
||||
|
||||
procedure BJoystick.Close;
|
||||
begin
|
||||
BJoystick_Close(CPlusObject);
|
||||
end;
|
||||
|
||||
function BJoystick.Update: Status_t;
|
||||
begin
|
||||
result:=BJoystick_Update(CPlusObject);
|
||||
end;
|
||||
|
||||
function BJoystick.SetMaxLatency(max_latency:TBigtime_t): Status_t;
|
||||
begin
|
||||
result:=BJoystick_SetMaxLatency(CPlusObject, max_latency);
|
||||
end;
|
||||
|
||||
function BJoystick.CountDevices :Cardinal;
|
||||
begin
|
||||
result:=BJoystick_CountDevices(CPlusObject);
|
||||
end;
|
||||
|
||||
function BJoystick.GetDeviceName( n : Integer; name : PChar; bufSize: Tsize_t): Status_t;
|
||||
begin
|
||||
result:=BJoystick_GetDeviceName(CPlusObject, n, name, bufSize );
|
||||
end;
|
||||
|
||||
//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean;
|
||||
|
||||
function BJoystick.CountSticks: Cardinal;
|
||||
begin
|
||||
result:=BJoystick_CountSticks(CPlusObject);
|
||||
end;
|
||||
|
||||
function BJoystick.CountAxes:Cardinal;
|
||||
begin
|
||||
result:=BJoystick_CountAxes(CPlusObject);
|
||||
end;
|
||||
|
||||
function BJoystick.CountHats:Cardinal;
|
||||
begin
|
||||
result:=BJoystick_CountHats(CPlusObject);
|
||||
end;
|
||||
|
||||
function BJoystick.CountButtons:Cardinal;
|
||||
begin
|
||||
result:=BJoystick_CountButtons(CPlusObject);
|
||||
end;
|
||||
|
||||
function BJoystick.GetAxisValues( out_values : Integer; for_stick : cardinal): Status_t;
|
||||
begin
|
||||
result:=BJoystick_GetAxisValues(CPlusObject, out_values, for_stick);
|
||||
end;
|
||||
|
||||
//function BJoystick.GetHatValues( uint8 *out_hats ; for_stick: cardinal): Status_t;
|
||||
//begin
|
||||
// result:=BJoystick_GetHatValues( out_hats,for_stick);
|
||||
//end;
|
||||
|
||||
function BJoystick.ButtonValues(for_stick: cardinal):Cardinal;
|
||||
begin
|
||||
result:=BJoystick_ButtonValues(CPlusObject,for_stick);
|
||||
end;
|
||||
|
||||
//function BJoystick.GetAxisNameAt(index: cardinal; BString *out_name): Status_t;
|
||||
//begin
|
||||
// result:=BJoystick_GetAxisNameAt(CPlusObject,index,out_name);
|
||||
//end;
|
||||
|
||||
//function BJoystick.GetHatNameAt( index: cardinal,BString *out_name): Status_t;
|
||||
//begin
|
||||
// result:=BJoystick_GetHatNameAt(CPlusObject, index,out_name);
|
||||
//end;
|
||||
|
||||
//function BJoystick.GetButtonNameAt( index: cardinal,BString *out_name): Status_t;
|
||||
//begin
|
||||
// result:=BJoystick_GetButtonNameAt(CPlusObject, index,out_name);
|
||||
//end;
|
||||
|
||||
//function BJoystick.GetControllerModule( BString *out_name): Status_t;
|
||||
//begin
|
||||
// result:=BJoystick_GetControllerModule(CPlusObject, out_name);
|
||||
//end;
|
||||
|
||||
//function BJoystick.GetControllerName( BString: *out_name): Status_t;
|
||||
//begin
|
||||
// result:=BJoystick_GetControllerName(CPlusObject, out_name);
|
||||
//end;
|
||||
|
||||
function BJoystick.IsCalibrationEnabled:boolean;
|
||||
begin
|
||||
result:=BJoystick_IsCalibrationEnabled(CPlusObject);
|
||||
end;
|
||||
|
||||
function BJoystick.EnableCalibration( calibrates : boolean): Status_t;
|
||||
begin
|
||||
result:=BJoystick_EnableCalibration(CPlusObject, calibrates);
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
||||
277
bepascal/source/bepascal/pas/src/be/device/serialport.pp
Normal file
277
bepascal/source/bepascal/pas/src/be/device/serialport.pp
Normal file
@@ -0,0 +1,277 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit serialport;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, SupportDefs, os;
|
||||
|
||||
type
|
||||
// Pascal enum start at 0 (like in C++). We are lucky because we can't
|
||||
// initialize enum values yet (?) in FreePascal ;-)
|
||||
DataRate = (B_0_BPS, B_50_BPS, B_75_BPS, B_110_BPS, B_134_BPS,
|
||||
B_150_BPS, B_200_BPS, B_300_BPS, B_600_BPS, B_1200_BPS,
|
||||
B_1800_BPS, B_2400_BPS, B_4800_BPS, B_9600_BPS, B_19200_BPS,
|
||||
B_38400_BPS, B_57600_BPS, B_115200_BPS,
|
||||
B_230400_BPS, B_31250_BPS);
|
||||
|
||||
DataBits = (B_DATA_BITS_7, B_DATA_BITS_8);
|
||||
|
||||
StopBits = (B_STOP_BITS_1, B_STOP_BITS_2);
|
||||
|
||||
ParityMode = (B_NO_PARITY, B_ODD_PARITY, B_EVEN_PARITY);
|
||||
|
||||
const
|
||||
B_NOFLOW_CONTROL = 0;
|
||||
B_HARDWARE_CONTROL = 1;
|
||||
B_SOFTWARE_CONTROL = 2;
|
||||
|
||||
type
|
||||
BSerialPort = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
function Open(portName : PChar) : Status_t;
|
||||
procedure Close;
|
||||
|
||||
function Read(buf : PChar; count : Size_t) : TSSize_t;
|
||||
function Write(const buf : PChar; count : Size_t) : TSSize_t;
|
||||
|
||||
procedure SetBlocking(Blocking : boolean);
|
||||
function SetTimeout(microSeconds : TBigtime_t) : Status_t;
|
||||
function SeDataRate(bitsPerSecond : DataRate) : Status_t;
|
||||
function GeDataRate : DataRate;
|
||||
procedure SeDataBits(numBits : DataBits);
|
||||
function GeDataBits : DataBits;
|
||||
procedure SeStopBits(numBits : StopBits);
|
||||
function GeStopBits : StopBits;
|
||||
procedure SeParityMode(numBits : ParityMode);
|
||||
function GeParityMode : ParityMode;
|
||||
procedure ClearInput;
|
||||
procedure ClearOutput;
|
||||
|
||||
procedure SetFlowControl(method : Cardinal);
|
||||
function GetFlowControl : Cardinal;
|
||||
function SetDTR(asserted : boolean) : Status_t;
|
||||
function SetRTS(asserted : boolean) : Status_t;
|
||||
function NumCharsAvailable(var wait_until_this_many : integer) : Status_t;
|
||||
|
||||
function IsCTS : boolean;
|
||||
function IsDSR : boolean;
|
||||
function IsRI : boolean;
|
||||
function IsDCD : boolean;
|
||||
function WaitForInput : TSSize_t;
|
||||
|
||||
function CountDevices : integer;
|
||||
function GetDeviceName(n : integer; name : PChar; bufSize : Size_t) : Status_t;
|
||||
|
||||
property DataRate : DataRate read GeDataRate write SeDataRate;
|
||||
property DataBits : DataBits read GeDataBits write SeDataBits;
|
||||
property StopBits : StopBits read GeStopBits write SeStopBits;
|
||||
property ParityMode : ParityMode read GeParityMode write SeParityMode;
|
||||
end;
|
||||
|
||||
function BSerialPort_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BSerialPort_Create';
|
||||
procedure BSerialPort_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_Free';
|
||||
function BSerialPort_Open(AObject : TCPlusObject; portName : PChar) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_Open';
|
||||
procedure BSerialPort_Close(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_Close';
|
||||
function BSerialPort_Read(AObject : TCPlusObject; buf : PChar; count : Size_t) : TSSize_t; cdecl; external BePascalLibName name 'BSerialPort_Read';
|
||||
function BSerialPort_Write(AObject : TCPlusObject; const buf : PChar; count : Size_t) : TSSize_t; cdecl; external BePascalLibName name 'BSerialPort_Write';
|
||||
procedure BSerialPort_SetBlocking(AObject : TCPlusObject; Blocking : boolean); cdecl; external BePascalLibName name 'BSerialPort_SetBlocking';
|
||||
function BSerialPort_SetTimeout(AObject : TCPlusObject; microSeconds : TBigtime_t) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SetTimeout';
|
||||
function BSerialPort_SeDataRate(AObject : TCPlusObject; bitsPerSecond : DataRate) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SeDataRate';
|
||||
function BSerialPort_DataRate(AObject : TCPlusObject) : DataRate; cdecl; external BePascalLibName name 'BSerialPort_DataRate';
|
||||
procedure BSerialPort_SeDataBits(AObject : TCPlusObject; numBits : DataBits); cdecl; external BePascalLibName name 'BSerialPort_SeDataBits';
|
||||
function BSerialPort_DataBits(AObject : TCPlusObject) : DataBits; cdecl; external BePascalLibName name 'BSerialPort_DataBits';
|
||||
procedure BSerialPort_SeStopBits(AObject : TCPlusObject; numBits : StopBits); cdecl; external BePascalLibName name 'BSerialPort_SeStopBits';
|
||||
function BSerialPort_StopBits(AObject : TCPlusObject) : StopBits; cdecl; external BePascalLibName name 'BSerialPort_StopBits';
|
||||
procedure BSerialPort_SeParityMode(AObject : TCPlusObject; numBits : ParityMode); cdecl; external BePascalLibName name 'BSerialPort_SeParityMode';
|
||||
function BSerialPort_ParityMode(AObject : TCPlusObject) : ParityMode; cdecl; external BePascalLibName name 'BSerialPort_ParityMode';
|
||||
procedure BSerialPort_ClearInput(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_ClearInput';
|
||||
procedure BSerialPort_ClearOutput(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_ClearOutput';
|
||||
procedure BSerialPort_SetFlowControl(AObject : TCPlusObject; method : Cardinal); cdecl; external BePascalLibName name 'BSerialPort_SetFlowControl';
|
||||
function BSerialPort_FlowControl(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BSerialPort_FlowControl';
|
||||
function BSerialPort_SetDTR(AObject : TCPlusObject; asserted : boolean) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SetDTR';
|
||||
function BSerialPort_SetRTS(AObject : TCPlusObject; asserted : boolean) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SetRTS';
|
||||
function BSerialPort_NumCharsAvailable(AObject : TCPlusObject; var wait_until_this_many : integer) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_NumCharsAvailable';
|
||||
function BSerialPort_IsCTS(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsCTS';
|
||||
function BSerialPort_IsDSR(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsDSR';
|
||||
function BSerialPort_IsRI(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsRI';
|
||||
function BSerialPort_IsDCD(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsDCD';
|
||||
function BSerialPort_WaitForInput(AObject : TCPlusObject) : TSSize_t; cdecl; external BePascalLibName name 'BSerialPort_WaitForInput';
|
||||
function BSerialPort_CountDevices(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BSerialPort_CountDevices';
|
||||
function BSerialPort_GetDeviceName(AObject : TCPlusObject; n : integer; name : PChar; bufSize : Size_t): Status_t; cdecl; external BePascalLibName name 'BSerialPort_GetDeviceName';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BSerialPort.Create;
|
||||
begin
|
||||
inherited;
|
||||
CPlusObject := BSerialPort_Create(Self);
|
||||
end;
|
||||
|
||||
destructor BSerialPort.Destroy;
|
||||
begin
|
||||
if CPlusObject <> nil then
|
||||
BSerialPort_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BSerialPort.Open(portName : PChar) : Status_t;
|
||||
begin
|
||||
result := BSerialPort_Open(CPlusObject, portName);
|
||||
end;
|
||||
|
||||
procedure BSerialPort.Close;
|
||||
begin
|
||||
BSerialPort_Close(CPlusObject);
|
||||
end;
|
||||
|
||||
function BSerialPort.Read(buf : PChar; count : Size_t) : TSSize_t;
|
||||
begin
|
||||
Result := BSerialPort_Read(CPlusObject, buf, count);
|
||||
end;
|
||||
|
||||
function BSerialPort.Write(const buf : PChar; count : Size_t) : TSSize_t;
|
||||
begin
|
||||
Result := BSerialPort_Write(CPlusObject, buf, count);
|
||||
end;
|
||||
|
||||
procedure BSerialPort.SetBlocking(Blocking : boolean);
|
||||
begin
|
||||
BSerialPort_SetBlocking(CPlusObject, Blocking);
|
||||
end;
|
||||
|
||||
function BSerialPort.SetTimeout(microSeconds : TBigtime_t) : Status_t;
|
||||
begin
|
||||
Result := BSerialPort_SetTimeout(CPlusObject, microSeconds);
|
||||
end;
|
||||
|
||||
function BSerialPort.SeDataRate(bitsPerSecond : DataRate) : Status_t;
|
||||
begin
|
||||
Result := BSerialPort_SeDataRate(CPlusObject, bitsPerSecond);
|
||||
end;
|
||||
|
||||
function BSerialPort.GeDataRate : DataRate;
|
||||
begin
|
||||
Result := BSerialPort_DataRate(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BSerialPort.SeDataBits(numBits : DataBits);
|
||||
begin
|
||||
BSerialPort_SeDataBits(CPlusObject, numBits);
|
||||
end;
|
||||
|
||||
function BSerialPort.GeDataBits : DataBits;
|
||||
begin
|
||||
Result := BSerialPort_DataBits(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BSerialPort.SeStopBits(numBits : StopBits);
|
||||
begin
|
||||
BSerialPort_SeStopBits(CPlusObject, numBits);
|
||||
end;
|
||||
|
||||
function BSerialPort.GeStopBits : StopBits;
|
||||
begin
|
||||
Result := BSerialPort_StopBits(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BSerialPort.SeParityMode(numBits : ParityMode);
|
||||
begin
|
||||
BSerialPort_SeParityMode(CPlusObject, numBits);
|
||||
end;
|
||||
|
||||
function BSerialPort.GeParityMode : ParityMode;
|
||||
begin
|
||||
Result := BSerialPort_ParityMode(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BSerialPort.ClearInput;
|
||||
begin
|
||||
BSerialPort_ClearInput(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BSerialPort.ClearOutput;
|
||||
begin
|
||||
BSerialPort_ClearOutput(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BSerialPort.SetFlowControl(method : Cardinal);
|
||||
begin
|
||||
BSerialPort_SetFlowControl(CPlusobject, method);
|
||||
end;
|
||||
|
||||
function BSerialPort.GetFlowControl : Cardinal;
|
||||
begin
|
||||
Result := BSerialPort_FlowControl(CPlusObject);
|
||||
end;
|
||||
|
||||
function BSerialPort.SetDTR(asserted : boolean) : Status_t;
|
||||
begin
|
||||
Result := BSerialPort_SetDTR(CPlusObject, asserted);
|
||||
end;
|
||||
|
||||
function BSerialPort.SetRTS(asserted : boolean) : Status_t;
|
||||
begin
|
||||
Result := BSerialPort_SetRTS(CPlusObject, asserted);
|
||||
end;
|
||||
|
||||
function BSerialPort.NumCharsAvailable(var wait_until_this_many : integer) : Status_t;
|
||||
begin
|
||||
Result := BSerialPort_NumCharsAvailable(CPlusObject, wait_until_this_many);
|
||||
end;
|
||||
|
||||
function BSerialPort.IsCTS : boolean;
|
||||
begin
|
||||
Result := BSerialPort_IsCTS(CPlusObject);
|
||||
end;
|
||||
|
||||
function BSerialPort.IsDSR : boolean;
|
||||
begin
|
||||
Result := BSerialPort_IsDSR(CPlusObject);
|
||||
end;
|
||||
|
||||
function BSerialPort.IsRI : boolean;
|
||||
begin
|
||||
Result := BSerialPort_IsRI(CPlusObject);
|
||||
end;
|
||||
|
||||
function BSerialPort.IsDCD : boolean;
|
||||
begin
|
||||
Result := BSerialPort_IsDCD(CPlusObject);
|
||||
end;
|
||||
|
||||
function BSerialPort.WaitForInput : TSSize_t;
|
||||
begin
|
||||
Result := BSerialPort_WaitForInput(CPlusObject);
|
||||
end;
|
||||
|
||||
function BSerialPort.CountDevices : integer;
|
||||
begin
|
||||
Result := BSerialPort_CountDevices(CPlusObject);
|
||||
end;
|
||||
|
||||
function BSerialPort.GetDeviceName(n : integer; name : PChar; bufSize : Size_t) : Status_t;
|
||||
begin
|
||||
Result := BSerialPort_GetDeviceName(CPlusObject, n, name, bufSize);
|
||||
end;
|
||||
|
||||
end.
|
||||
199
bepascal/source/bepascal/pas/src/be/interface/alert.pp
Normal file
199
bepascal/source/bepascal/pas/src/be/interface/alert.pp
Normal file
@@ -0,0 +1,199 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2003 Olivier Coursiere
|
||||
Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit Alert;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
BeObj, Archivable, Button, InterfaceDefs, Invoker, Handler,
|
||||
Message, Rect, SupportDefs, TextView, Window;
|
||||
|
||||
type
|
||||
{ enum for flavors of alert }
|
||||
// enum alert_type
|
||||
Alert_Type = (B_EMPTY_ALERT, B_INFO_ALERT, B_IDEA_ALERT, B_WARNING_ALERT,
|
||||
B_STOP_ALERT);
|
||||
|
||||
//enum button_spacing
|
||||
Button_Spacing = (B_EVEN_SPACING, B_OFFSET_SPACING);
|
||||
|
||||
BAlert = class(BWindow)
|
||||
private
|
||||
public
|
||||
// Here we have this name colition: type --> kind
|
||||
constructor Create(title : PChar; text : PChar; button1 : PChar;
|
||||
button2 : PChar; button3 : PChar; width : Button_Width;
|
||||
kind{type} : Alert_Type);
|
||||
constructor Create(title : PChar; text : PChar; button1 : PChar;
|
||||
button2 : PChar; button3 : PChar; width : Button_Width;
|
||||
spacing : Button_Spacing; kind{type} : Alert_Type);
|
||||
constructor Create(data : BMessage);
|
||||
|
||||
destructor Destroy; override;
|
||||
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure SetShortcut(button_index : integer; key : Char);
|
||||
function Shortcut(button_index : integer) : Char;
|
||||
function Go : integer;
|
||||
function Go(invoker : BInvoker) : Status_t;
|
||||
procedure MessageReceived(an_event : BMessage); override;
|
||||
procedure FrameResized(new_width : double; new_height : double);
|
||||
function ButtonAt(index : integer) : BButton;
|
||||
function TextView : BTextView;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
procedure DispatchMessage(msg : BMessage; handler : BHandler); override;
|
||||
procedure Quit;
|
||||
function QuitRequested : boolean; override;
|
||||
function AlertPosition(width : double; height : double) : BPoint;
|
||||
end;
|
||||
|
||||
function BAlert_Create(AObject : TBeObject; title : PChar; text : PChar; button1 : PChar; button2 : PChar; button3 : PChar; width : Button_Width;kind{type} : Alert_Type) : TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create';
|
||||
function BAlert_Create_1(AObject : TBeObject; title : PChar; text : PChar;button1 : PChar; button2 : PChar; button3 : PChar; width : Button_Width; spacing : Button_Spacing; kind{type} : Alert_Type) : TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create_1';
|
||||
function BAlert_Create_2(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create_2';
|
||||
|
||||
procedure BAlert_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_Free';
|
||||
|
||||
function BAlert_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BAlert_Instantiate';
|
||||
function BAlert_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BAlert_Archive';
|
||||
procedure BAlert_SetShortcut(AObject : TCPlusObject; button_index : integer; key : Char); cdecl; external BePascalLibName name 'BAlert_SetShortcut';
|
||||
function BAlert_Shortcut(AObject : TCPlusObject; button_index : integer) : Char; cdecl; external BePascalLibName name 'BAlert_Shortcut';
|
||||
function BAlert_Go(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BAlert_Go';
|
||||
function BAlert_Go(AObject : TCPlusObject; invoker : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BAlert_Go';
|
||||
procedure BAlert_MessageReceived(AObject : TCPlusObject; an_event : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_MessageReceived';
|
||||
procedure BAlert_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BAlert_FrameResized';
|
||||
function BAlert_ButtonAt(AObject : TCPlusObject; index : integer) : BButton; cdecl; external BePascalLibName name 'BAlert_ButtonAt';
|
||||
function BAlert_TextView(AObject : TCPlusObject) : BTextView; cdecl; external BePascalLibName name 'BAlert_TextView';
|
||||
function BAlert_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BAlert_ResolveSpecifier';
|
||||
function BAlert_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BAlert_GetSupportedSuites';
|
||||
procedure BAlert_DispatchMessage(AObject : TCPlusObject; msg : TCPlusObject; handler : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_DispatchMessage';
|
||||
procedure BAlert_Quit(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_Quit';
|
||||
function BAlert_QuitRequested(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BAlert_QuitRequested';
|
||||
function BAlert_AlertPosition(AObject : TCPlusObject; width : double; height : double) : BPoint; cdecl; external BePascalLibName name 'BAlert_AlertPosition';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BAlert.Create(title : PChar; text : PChar; button1 : PChar;
|
||||
button2 : PChar; button3 : PChar; width : Button_Width;
|
||||
kind{type} : Alert_Type);
|
||||
begin
|
||||
CPlusObject := BAlert_Create(Self, title, text, button1, button2, button3,
|
||||
width, kind);
|
||||
end;
|
||||
|
||||
constructor BAlert.Create(title : PChar; text : PChar; button1 : PChar; button2 : PChar; button3 : PChar; width : Button_Width; spacing : Button_Spacing; kind{type} : Alert_Type);
|
||||
begin
|
||||
CPlusObject := BAlert_Create_1(Self, title, text, button1, button2, button3,
|
||||
width, spacing, kind{type});
|
||||
end;
|
||||
|
||||
constructor BAlert.Create(data : BMessage);
|
||||
begin
|
||||
CPlusObject := BAlert_Create_2(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BAlert.Destroy;
|
||||
begin
|
||||
BAlert_Free(CPlusObject);
|
||||
end;
|
||||
|
||||
function BAlert.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BAlert_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BAlert.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BAlert_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BAlert.SetShortcut(button_index : integer; key : Char);
|
||||
begin
|
||||
BAlert_SetShortcut(CPlusObject, button_index, key);
|
||||
end;
|
||||
|
||||
function BAlert.Shortcut(button_index : integer) : Char;
|
||||
begin
|
||||
Result := BAlert_Shortcut(CPlusObject, button_index);
|
||||
end;
|
||||
|
||||
function BAlert.Go : integer;
|
||||
begin
|
||||
Result := BAlert_Go(CPlusObject);
|
||||
end;
|
||||
|
||||
function BAlert.Go(invoker : BInvoker) : Status_t;
|
||||
begin
|
||||
Result := BAlert_Go(CPlusObject, invoker.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BAlert.MessageReceived(an_event : BMessage);
|
||||
begin
|
||||
BAlert_MessageReceived(CPlusObject, an_event.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BAlert.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
BAlert_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
function BAlert.ButtonAt(index : integer) : BButton;
|
||||
begin
|
||||
Result := BAlert_ButtonAt(CPlusObject, index);
|
||||
end;
|
||||
|
||||
function BAlert.TextView : BTextView;
|
||||
begin
|
||||
Result := BAlert_TextView(CPlusObject);
|
||||
end;
|
||||
|
||||
function BAlert.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BAlert_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
function BAlert.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BAlert_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BAlert.DispatchMessage(msg : BMessage; handler : BHandler);
|
||||
begin
|
||||
BAlert_DispatchMessage(CPlusObject, msg.CPlusObject, handler.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BAlert.Quit;
|
||||
begin
|
||||
BAlert_Quit(CPlusObject);
|
||||
end;
|
||||
|
||||
function BAlert.QuitRequested : boolean;
|
||||
begin
|
||||
Result := BAlert_QuitRequested(CPlusObject);
|
||||
end;
|
||||
|
||||
function BAlert.AlertPosition(width : double; height : double) : BPoint;
|
||||
begin
|
||||
Result := BAlert_AlertPosition(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
262
bepascal/source/bepascal/pas/src/be/interface/box.pp
Normal file
262
bepascal/source/bepascal/pas/src/be/interface/box.pp
Normal file
@@ -0,0 +1,262 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2003 Olivier Coursiere
|
||||
Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit box;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
BeObj, Archivable, Control, Handler, Message, Rect, SupportDefs,
|
||||
InterfaceDefs, View;
|
||||
|
||||
type
|
||||
|
||||
BBox = class(BView)
|
||||
private
|
||||
public
|
||||
constructor Create(Frame : BRect; Name : PChar; ResizingMode, Flags : Cardinal; BorderStyle : border_style);
|
||||
constructor Create(data : BMessage);
|
||||
destructor Destroy; override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure SetBorder(style : border_style);
|
||||
function Border : border_style;
|
||||
procedure SetLabel(aLabel : PChar);
|
||||
function SetLabel(view_label : BView) : Status_t;
|
||||
// Conflicting Name: Label is a reserved word in Pascal.
|
||||
// I will use: GetLabel
|
||||
function GetLabel : PChar;
|
||||
|
||||
function LabelView : BView;
|
||||
procedure Draw(bounds : BRect); override;
|
||||
procedure AttachedToWindow; override;
|
||||
procedure DetachedFromWindow; override;
|
||||
procedure AllAttached; override;
|
||||
procedure AllDetached; override;
|
||||
procedure FrameResized(new_width : double; new_height : double); override;
|
||||
procedure MessageReceived(msg : BMessage); override;
|
||||
procedure MouseDown(pt : BPoint); override;
|
||||
procedure MouseUp(pt : BPoint); override;
|
||||
procedure WindowActivated(state : boolean); override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); override;
|
||||
procedure FrameMoved(new_position : BPoint); override;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer;
|
||||
specifier : BMessage; form : integer;
|
||||
properti : PChar) : BHandler;
|
||||
procedure ResizeToPreferred; override;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure MakeFocus(state : boolean);
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
end;
|
||||
|
||||
function BBox_Create(AObject : TBeObject; Frame : TCPlusObject;Name : PChar; ResizingMode, Flags : Cardinal; BorderStyle : border_style) : TCPlusObject; cdecl; external BePascalLibName name 'BBox_Create';
|
||||
|
||||
function BBox_Create_1(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BBox_Create_1';
|
||||
procedure BBox_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_Free';
|
||||
function BBox_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BBox_Instantiate';
|
||||
function BBox_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BBox_Archive';
|
||||
procedure BBox_SetBorder(AObject : TCPlusObject; style : border_style); cdecl; external BePascalLibName name 'BBox_SetBorder';
|
||||
function BBox_Border(AObject : TCPlusObject) : border_style; cdecl; external BePascalLibName name 'BBox_Border';
|
||||
|
||||
// Conflicting name Label --> aLabel.
|
||||
procedure BBox_SetLabel(AObject : TCPlusObject; aLabel : PChar); cdecl; external BePascalLibName name 'BBox_SetLabel';
|
||||
|
||||
function BBox_SetLabel(AObject : TCPlusObject; view_label : BView) : Status_t; cdecl; external BePascalLibName name 'BBox_SetLabel';
|
||||
function BBox_Label(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BBox_Label';
|
||||
|
||||
function BBox_LabelView(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BBox_LabelView_1';
|
||||
|
||||
procedure BBox_Draw(AObject : TCPlusObject; bounds : BRect); cdecl; external BePascalLibName name 'BBox_Draw';
|
||||
procedure BBox_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_AttachedToWindow';
|
||||
procedure BBox_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_DetachedFromWindow';
|
||||
procedure BBox_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_AllAttached';
|
||||
procedure BBox_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_AllDetached';
|
||||
procedure BBox_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BBox_FrameResized';
|
||||
procedure BBox_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BBox_MessageReceived';
|
||||
procedure BBox_MouseDown(AObject : TCPlusObject; pt : BPoint); cdecl; external BePascalLibName name 'BBox_MouseDown';
|
||||
procedure BBox_MouseUp(AObject : TCPlusObject; pt : BPoint); cdecl; external BePascalLibName name 'BBox_MouseUp';
|
||||
procedure BBox_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BBox_WindowActivated';
|
||||
procedure BBox_MouseMoved(AObject : TCPlusObject; pt : BPoint; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BBox_MouseMoved';
|
||||
procedure BBox_FrameMoved(AObject : TCPlusObject; new_position : BPoint); cdecl; external BePascalLibName name 'BBox_FrameMoved';
|
||||
function BBox_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BBox_ResolveSpecifier';
|
||||
procedure BBox_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BBox_ResizeToPreferred';
|
||||
procedure BBox_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BBox_GetPreferredSize';
|
||||
procedure BBox_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BBox_MakeFocus';
|
||||
function BBox_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BBox_GetSupportedSuites';
|
||||
function BBox_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BBox_Perform';
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
constructor BBox.Create(Frame : BRect; Name : PChar; ResizingMode, Flags : Cardinal; BorderStyle : border_style);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BBox_Create(Self, Frame.CPlusObject, Name, ResizingMode, Flags, BorderStyle);
|
||||
end;
|
||||
|
||||
constructor BBox.Create(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BBox_Create_1(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BBox.Destroy;
|
||||
begin
|
||||
BBox_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BBox.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BBox_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BBox.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BBox_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BBox.SetBorder(style : border_style);
|
||||
begin
|
||||
BBox_SetBorder(CPlusObject, style);
|
||||
end;
|
||||
|
||||
function BBox.Border : border_style;
|
||||
begin
|
||||
Result := BBox_Border(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BBox.SetLabel(aLabel : PChar);
|
||||
begin
|
||||
BBox_SetLabel(CPlusObject, aLabel);
|
||||
end;
|
||||
|
||||
function BBox.SetLabel(view_label : BView) : Status_t;
|
||||
begin
|
||||
Result := BBox_SetLabel(CPlusObject, view_label{.CPlusObject});
|
||||
end;
|
||||
|
||||
// Conflicting Name: Label is a reserved word in Pascal.
|
||||
// I will use: GetLabel
|
||||
function BBox.GetLabel : PChar;
|
||||
begin
|
||||
Result := BBox_Label(CPlusObject);
|
||||
end;
|
||||
|
||||
|
||||
function BBox.LabelView : BView;
|
||||
begin
|
||||
Result := BBox_LabelView(CPlusObject);
|
||||
end;
|
||||
|
||||
|
||||
procedure BBox.Draw(bounds : BRect);
|
||||
begin
|
||||
BBox_Draw(CPlusObject, bounds{.CPlusObject});
|
||||
end;
|
||||
|
||||
procedure BBox.AttachedToWindow;
|
||||
begin
|
||||
BBox_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BBox.DetachedFromWindow;
|
||||
begin
|
||||
BBox_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BBox.AllAttached;
|
||||
begin
|
||||
BBox_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BBox.AllDetached;
|
||||
begin
|
||||
BBox_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BBox.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
BBox_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
procedure BBox.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
BBox_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BBox.MouseDown(pt : BPoint);
|
||||
begin
|
||||
BBox_MouseDown(CPlusObject, pt{.CPlusObject});
|
||||
end;
|
||||
|
||||
procedure BBox.MouseUp(pt : BPoint);
|
||||
begin
|
||||
BBox_MouseUp(CPlusObject, pt{.CPlusObject});
|
||||
end;
|
||||
|
||||
procedure BBox.WindowActivated(state : boolean);
|
||||
begin
|
||||
BBox_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BBox.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
BBox_MouseMoved(CPlusObject, pt{.CPlusObject}, code, msg);
|
||||
end;
|
||||
|
||||
procedure BBox.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
BBox_FrameMoved(CPlusObject, new_position{.CPlusObject});
|
||||
end;
|
||||
|
||||
function BBox.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BBox_ResolveSpecifier(CPlusObject, msg{.CPlusObject}, index, specifier{.CPlusObject}, form, properti);
|
||||
end;
|
||||
|
||||
procedure BBox.ResizeToPreferred;
|
||||
begin
|
||||
BBox_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BBox.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BBox_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BBox.MakeFocus(state : boolean);
|
||||
begin
|
||||
BBox_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
function BBox.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BBox_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BBox.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BBox_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
265
bepascal/source/bepascal/pas/src/be/interface/button.pp
Normal file
265
bepascal/source/bepascal/pas/src/be/interface/button.pp
Normal file
@@ -0,0 +1,265 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit button;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, Control, Message, Archivable, SupportDefs, Rect, Handler;
|
||||
|
||||
type
|
||||
BButton = class(BControl)
|
||||
private
|
||||
public
|
||||
destructor Destroy; override;
|
||||
constructor Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal); virtual;
|
||||
constructor Create(data : BMessage); override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure Draw(updateRect : BRect); override;
|
||||
procedure MouseDown(where : BPoint); override;
|
||||
procedure AttachedToWindow; override;
|
||||
procedure KeyDown(bytes : PChar; numBytes : integer); override;
|
||||
// Hook functions
|
||||
procedure MakeDefault(state : boolean); virtual;
|
||||
procedure SetLabel(text : PChar);
|
||||
function IsDefault : boolean;
|
||||
procedure MessageReceived(msg : BMessage); override;
|
||||
procedure WindowActivated(state : boolean); override;
|
||||
procedure MouseUp(pt : BPoint); override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); override;
|
||||
procedure DetachedFromWindow; override;
|
||||
procedure SetValue(aValue : integer);
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure ResizeToPreferred; override;
|
||||
function Invoke(msg : BMessage) : Status_t;
|
||||
procedure FrameMoved(new_position : BPoint); override;
|
||||
procedure FrameResized(new_width : double; new_height : double); override;
|
||||
procedure MakeFocus(state : boolean); override;
|
||||
procedure AllAttached; override;
|
||||
procedure AllDetached; override;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
// procedure _ReservedButton1;
|
||||
// procedure _ReservedButton2;
|
||||
// procedure _ReservedButton3;
|
||||
// function operator=( : BButton) : BButton;
|
||||
// function DrawDefault(bounds : BRect; enabled : boolean) : BRect;
|
||||
// function Execute : Status_t;
|
||||
// procedure float fCachedWidth;
|
||||
// procedure bool fDrawAsDefault;
|
||||
// procedure uint32 _reserved[3];
|
||||
// procedure MakeDefault(flag : boolean); virtual;
|
||||
end;
|
||||
|
||||
procedure BButton_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_Free';
|
||||
function BButton_Create(AObject : TBeObject; frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BButton_Create';
|
||||
function BButton_Create(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BButton_Create';
|
||||
function BButton_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BButton_Instantiate';
|
||||
function BButton_Archive(AObject : TCPlusObject; data : TCplusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BButton_Archive';
|
||||
procedure BButton_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BButton_Draw';
|
||||
procedure BButton_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BButton_MouseDown';
|
||||
procedure BButton_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_AttachedToWindow';
|
||||
procedure BButton_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BButton_KeyDown';
|
||||
procedure BButton_MakeDefault(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BButton_MakeDefault';
|
||||
procedure BButton_SetLabel(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BButton_SetLabel';
|
||||
function BButton_IsDefault(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BButton_IsDefault';
|
||||
procedure BButton_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BButton_MessageReceived';
|
||||
procedure BButton_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BButton_WindowActivated';
|
||||
procedure BButton_MouseUp(AObject : TCPlusObject; pt : TCplusObject); cdecl; external BePascalLibName name 'BButton_MouseUp';
|
||||
procedure BButton_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : BMessage); cdecl; external BePascalLibName name 'BButton_MouseMoved';
|
||||
procedure BButton_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_DetachedFromWindow';
|
||||
procedure BButton_SetValue(AObject : TCPlusObject; aValue : integer); cdecl; external BePascalLibName name 'BButton_SetValue';
|
||||
procedure BButton_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BButton_GetPreferredSize';
|
||||
procedure BButton_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_ResizeToPreferred';
|
||||
function BButton_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BButton_Invoke';
|
||||
procedure BButton_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BButton_FrameMoved';
|
||||
procedure BButton_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BButton_FrameResized';
|
||||
procedure BButton_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BButton_MakeFocus';
|
||||
procedure BButton_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_AllAttached';
|
||||
procedure BButton_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_AllDetached';
|
||||
function BButton_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BButton_ResolveSpecifier';
|
||||
function BButton_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BButton_GetSupportedSuites';
|
||||
function BButton_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BButton_Perform';
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
Button_MakeDefault_hook : Pointer; cvar; external;
|
||||
|
||||
destructor BButton.Destroy;
|
||||
begin
|
||||
BButton_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
constructor BButton.Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BButton_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags);
|
||||
end;
|
||||
|
||||
constructor BButton.Create(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BButton_Create(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BButton.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BButton_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BButton.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BButton_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BButton.Draw(updateRect : BRect);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure BButton.MouseDown(where : BPoint);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure BButton.AttachedToWindow;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure BButton.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure BButton.MakeDefault(state : boolean);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure BButton.SetLabel(text : PChar);
|
||||
begin
|
||||
BButton_SetLabel(CPlusObject, text);
|
||||
end;
|
||||
|
||||
function BButton.IsDefault : boolean;
|
||||
begin
|
||||
Result := BButton_IsDefault(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BButton.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
// BButton_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BButton.WindowActivated(state : boolean);
|
||||
begin
|
||||
// BButton_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BButton.MouseUp(pt : BPoint);
|
||||
begin
|
||||
// BButton_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BButton.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
// BButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BButton.DetachedFromWindow;
|
||||
begin
|
||||
// BButton_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BButton.SetValue(aValue : integer);
|
||||
begin
|
||||
// BButton_SetValue(CPlusObject, aValue);
|
||||
end;
|
||||
|
||||
procedure BButton.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
// BButton_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BButton.ResizeToPreferred;
|
||||
begin
|
||||
// BButton_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
function BButton.Invoke(msg : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BButton_Invoke(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BButton.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
// BButton_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BButton.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
// BButton_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
procedure BButton.MakeFocus(state : boolean);
|
||||
begin
|
||||
BButton_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BButton.AllAttached;
|
||||
begin
|
||||
// BButton_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BButton.AllDetached;
|
||||
begin
|
||||
// BButton_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
function BButton.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BButton_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
function BButton.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BButton_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BButton.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BButton_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
|
||||
procedure Button_MakeDefault_hook_func(Button : BButton; flag : boolean); cdecl;
|
||||
begin
|
||||
if Button <> nil then
|
||||
Button.MakeDefault(flag);
|
||||
end;
|
||||
|
||||
initialization
|
||||
Button_MakeDefault_hook := @Button_MakeDefault_hook_func;
|
||||
|
||||
end.
|
||||
250
bepascal/source/bepascal/pas/src/be/interface/checkbox.pp
Normal file
250
bepascal/source/bepascal/pas/src/be/interface/checkbox.pp
Normal file
@@ -0,0 +1,250 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit checkbox;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, Control, Message, Archivable, SupportDefs, Rect, Handler;
|
||||
|
||||
type BCheckBox = class(BControl)
|
||||
private
|
||||
public
|
||||
destructor Destroy;override;
|
||||
constructor Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal); virtual;
|
||||
constructor Create(data : BMessage) ;override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure Draw(updateRect : BRect);override;
|
||||
procedure AttachedToWindow;override;
|
||||
procedure MouseDown(where : BPoint);override;
|
||||
procedure MessageReceived(msg : BMessage);override;
|
||||
procedure WindowActivated(state : boolean);override;
|
||||
procedure KeyDown(bytes : PChar; numBytes : integer);override;
|
||||
procedure MouseUp(pt : BPoint);override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override;
|
||||
procedure DetachedFromWindow;override;
|
||||
procedure SetValue(avalue : integer);
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure ResizeToPreferred;override;
|
||||
function Invoke(msg : BMessage) : Status_t;
|
||||
procedure FrameMoved(new_position : BPoint);override;
|
||||
procedure FrameResized(new_width : double; new_height : double);override;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
procedure MakeFocus(state : boolean);override;
|
||||
procedure AllAttached;override;
|
||||
procedure AllDetached;override;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
end;
|
||||
|
||||
procedure BCheckBox_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_FREE';
|
||||
function BCheckBox_Create(AObject : TBeObject; frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BCheckBox_Create';
|
||||
function BCheckBox_Create_1(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BCheckBox_Create_1';
|
||||
function BCheckBox_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BCheckBox_Instantiate';
|
||||
function BCheckBox_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BCheckBox_Archive';
|
||||
procedure BCheckBox_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_Draw';
|
||||
procedure BCheckBox_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_AttachedToWindow';
|
||||
procedure BCheckBox_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_MouseDown';
|
||||
procedure BCheckBox_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_MessageReceived';
|
||||
procedure BCheckBox_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BCheckBox_WindowActivated';
|
||||
procedure BCheckBox_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BCheckBox_KeyDown';
|
||||
procedure BCheckBox_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_MouseUp';
|
||||
procedure BCheckBox_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : BMessage); cdecl; external BePascalLibName name 'BCheckBox_MouseMoved';
|
||||
procedure BCheckBox_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_DetachedFromWindow';
|
||||
procedure BCheckBox_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BCheckBox_SetValue';
|
||||
procedure BCheckBox_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BCheckBox_GetPreferredSize';
|
||||
procedure BCheckBox_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_ResizeToPreferred';
|
||||
function BCheckBox_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BCheckBox_Invoke';
|
||||
procedure BCheckBox_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_FrameMoved';
|
||||
procedure BCheckBox_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BCheckBox_FrameResized';
|
||||
function BCheckBox_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BCheckBox_ResolveSpecifier';
|
||||
function BCheckBox_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BCheckBox_GetSupportedSuites';
|
||||
procedure BCheckBox_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BCheckBox_MakeFocus';
|
||||
procedure BCheckBox_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_AllAttached';
|
||||
procedure BCheckBox_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCheckBox_AllDetached';
|
||||
function BCheckBox_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BCheckBox_Perform';
|
||||
|
||||
implementation
|
||||
|
||||
destructor BCheckBox.Destroy;
|
||||
begin
|
||||
BCheckBox_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
constructor BCheckBox.Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BCheckBox_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags);
|
||||
end;
|
||||
|
||||
constructor BCheckBox.Create(data : BMessage) ;
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BCheckBox_Create_1(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BCheckBox.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BCheckBox_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BCheckBox.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BCheckBox_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.Draw(updateRect : BRect);
|
||||
begin
|
||||
//BCheckBox_Draw(CPlusObject, updateRect.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.AttachedToWindow;
|
||||
begin
|
||||
//BCheckBox_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.MouseDown(where : BPoint);
|
||||
begin
|
||||
//BCheckBox_MouseDown(CPlusObject, where.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
//BCheckBox_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.WindowActivated(state : boolean);
|
||||
begin
|
||||
// BCheckBox_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
//BCheckBox_KeyDown(CPlusObject, bytes, numBytes);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.MouseUp(pt : BPoint);
|
||||
begin
|
||||
//BCheckBox_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
//BCheckBox_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.DetachedFromWindow;
|
||||
begin
|
||||
//BCheckBox_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.SetValue(avalue : integer);
|
||||
begin
|
||||
BCheckBox_SetValue(CPlusObject, avalue);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BCheckBox_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.ResizeToPreferred;
|
||||
begin
|
||||
BCheckBox_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
function BCheckBox.Invoke(msg : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BCheckBox_Invoke(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
BCheckBox_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
BCheckBox_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
function BCheckBox.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BCheckBox_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
function BCheckBox.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BCheckBox_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.MakeFocus(state : boolean);
|
||||
begin
|
||||
BCheckBox_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.AllAttached;
|
||||
begin
|
||||
BCheckBox_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BCheckBox.AllDetached;
|
||||
begin
|
||||
BCheckBox_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
function BCheckBox.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BCheckBox_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
{procedure ._ReservedCheckBox1;
|
||||
begin
|
||||
BCheckBox__ReservedCheckBox1(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure ._ReservedCheckBox2;
|
||||
begin
|
||||
BCheckBox__ReservedCheckBox2(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure ._ReservedCheckBox3;
|
||||
begin
|
||||
BCheckBox__ReservedCheckBox3(CPlusObject);
|
||||
end;
|
||||
|
||||
function .operator=( : ) : ;
|
||||
begin
|
||||
Result := BCheckBox_operator=(CPlusObject, );
|
||||
end;
|
||||
|
||||
procedure .bool fOutlined;
|
||||
begin
|
||||
BCheckBox_bool fOutlined(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure .uint32 _reserved[2];
|
||||
begin
|
||||
BCheckBox_uint32 _reserved[2](CPlusObject);
|
||||
end;
|
||||
|
||||
}
|
||||
end.
|
||||
333
bepascal/source/bepascal/pas/src/be/interface/control.pp
Normal file
333
bepascal/source/bepascal/pas/src/be/interface/control.pp
Normal file
@@ -0,0 +1,333 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit control;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, View, Message, Archivable, Rect, Handler, SupportDefs, Invoker;
|
||||
|
||||
type
|
||||
BControl = class(BView)
|
||||
private
|
||||
protected
|
||||
FInvoker : BInvoker;
|
||||
function GeBInvoker : BInvoker;
|
||||
public
|
||||
constructor Create(frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal); virtual;
|
||||
destructor Destroy; override;
|
||||
constructor Create(data : BMessage); virtual;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure WindowActivated(state : boolean); override;
|
||||
procedure AttachedToWindow; override;
|
||||
procedure MessageReceived(msg : BMessage); override;
|
||||
procedure MakeFocus(state : boolean); virtual;
|
||||
procedure KeyDown(bytes : PChar; numBytes : integer); override;
|
||||
procedure MouseDown(pt : BPoint); override;
|
||||
procedure MouseUp(pt : BPoint); override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); override;
|
||||
procedure DetachedFromWindow; override;
|
||||
procedure SetLabel(text : PChar);
|
||||
function Labl : PChar;
|
||||
procedure SetValue(aValue : integer);
|
||||
function Value : integer;
|
||||
procedure SetEnabled(aOn : boolean);
|
||||
function IsEnabled : boolean;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure ResizeToPreferred; override;
|
||||
function Invoke(msg : BMessage) : Status_t;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti{;-)} : PChar) : BHandler;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
procedure AllAttached; override;
|
||||
procedure AllDetached; override;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
property Invoker : BInvoker read GeBInvoker;
|
||||
end;
|
||||
|
||||
//function BControl_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BControl_Create';
|
||||
function BControl_Create(AObject : TBeObject; frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BControl_Create';
|
||||
procedure BControl_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_Free';
|
||||
function BControl_Create(AObject : TBeObject; data : TCplusObject) : TCplusObject; cdecl; external BePascalLibName name 'BControl_Create';
|
||||
function BControl_Instantiate(AObject : TCPlusObject; data : TCplusObject) : BArchivable; cdecl; external BePascalLibName name 'BControl_Instantiate';
|
||||
function BControl_Archive(AObject : TCPlusObject; data : TCplusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BControl_Archive';
|
||||
procedure BControl_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BControl_WindowActivated';
|
||||
procedure BControl_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_AttachedToWindow';
|
||||
procedure BControl_MessageReceived(AObject : TCPlusObject; msg : TCplusObject); cdecl; external BePascalLibName name 'BControl_MessageReceived';
|
||||
procedure BControl_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BControl_MakeFocus';
|
||||
procedure BControl_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BControl_KeyDown';
|
||||
procedure BControl_MouseDown(AObject : TCPlusObject; pt : TCplusObject); cdecl; external BePascalLibName name 'BControl_MouseDown';
|
||||
procedure BControl_MouseUp(AObject : TCPlusObject; pt : TCplusObject); cdecl; external BePascalLibName name 'BControl_MouseUp';
|
||||
procedure BControl_MouseMoved(AObject : TCPlusObject; pt : TCplusObject; code : Cardinal; msg : TCplusObject); cdecl; external BePascalLibName name 'BControl_MouseMoved';
|
||||
procedure BControl_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_DetachedFromWindow';
|
||||
procedure BControl_SetLabel(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BControl_SetLabel';
|
||||
function BControl_Labl(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BControl_Label';
|
||||
procedure BControl_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BControl_SetValue';
|
||||
function BControl_Value(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BControl_Value';
|
||||
procedure BControl_SetEnabled(AObject : TCPlusObject; aOn : boolean); cdecl; external BePascalLibName name 'BControl_SetEnabled';
|
||||
function BControl_IsEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BControl_IsEnabled';
|
||||
procedure BControl_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BControl_GetPreferredSize';
|
||||
procedure BControl_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_ResizeToPreferred';
|
||||
function BControl_Invoke(AObject : TCPlusObject; msg : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BControl_Invoke';
|
||||
function BControl_ResolveSpecifier(AObject : TCPlusObject; msg : TCplusObject; index : integer; specifier : TCplusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BControl_ResolveSpecifier';
|
||||
function BControl_GetSupportedSuites(AObject : TCPlusObject; data : TCplusObject) : Status_t; cdecl; external BePascalLibName name 'BControl_GetSupportedSuites';
|
||||
procedure BControl_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_AllAttached';
|
||||
procedure BControl_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_AllDetached';
|
||||
function BControl_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BControl_Perform';
|
||||
procedure BControl_InitData(AObject : TCPlusObject; data : TCplusObject); cdecl; external BePascalLibName name 'BControl_InitData';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BControl.Create(frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal);
|
||||
begin
|
||||
CPlusObject := BControl_Create(Self, frame, name, aLabel, message, resizingMode, flags);
|
||||
end;
|
||||
|
||||
destructor BControl.Destroy;
|
||||
begin
|
||||
if FInvoker <> nil then
|
||||
FInvoker.UnWrap;
|
||||
BControl_Free(CPlusObject);
|
||||
end;
|
||||
|
||||
constructor BControl.Create(data : BMessage);
|
||||
begin
|
||||
CPlusObject := BControl_Create(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BControl.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BControl_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BControl.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BControl_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BControl.WindowActivated(state : boolean);
|
||||
begin
|
||||
// BControl_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BControl.AttachedToWindow;
|
||||
begin
|
||||
// BControl_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BControl.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
// BControl_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BControl.MakeFocus(state : boolean);
|
||||
begin
|
||||
// BControl_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BControl.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
// BControl_KeyDown(CPlusObject, bytes, numBytes);
|
||||
end;
|
||||
|
||||
procedure BControl.MouseDown(pt : BPoint);
|
||||
begin
|
||||
// BControl_MouseDown(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BControl.MouseUp(pt : BPoint);
|
||||
begin
|
||||
// BControl_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BControl.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
// BControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BControl.DetachedFromWindow;
|
||||
begin
|
||||
// BControl_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BControl.SetLabel(text : PChar);
|
||||
begin
|
||||
BControl_SetLabel(CPlusObject, text);
|
||||
end;
|
||||
|
||||
function BControl.Labl : PChar;
|
||||
begin
|
||||
Result := BControl_Labl(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BControl.SetValue(aValue : integer);
|
||||
begin
|
||||
BControl_SetValue(CPlusObject, aValue);
|
||||
end;
|
||||
|
||||
function BControl.Value : integer;
|
||||
begin
|
||||
Result := BControl_Value(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BControl.SetEnabled(aOn : boolean);
|
||||
begin
|
||||
BControl_SetEnabled(CPlusObject, aOn);
|
||||
end;
|
||||
|
||||
function BControl.IsEnabled : boolean;
|
||||
begin
|
||||
Result := BControl_IsEnabled(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BControl.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
// BControl_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BControl.ResizeToPreferred;
|
||||
begin
|
||||
// BControl_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
function BControl.Invoke(msg : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BControl_Invoke(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
function BControl.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BControl_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
function BControl.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BControl_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BControl.AllAttached;
|
||||
begin
|
||||
// BControl_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BControl.AllDetached;
|
||||
begin
|
||||
// BControl_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
function BControl.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := bControl_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
//function BControl.IsFocusChanging : boolean;
|
||||
//begin
|
||||
// Result := BControl_IsFocusChanging(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//function BControl.IsTracking : boolean;
|
||||
//begin
|
||||
// Result := BControl_IsTracking(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl.SetTracking(state : boolean);
|
||||
//begin
|
||||
// BControl_SetTracking(CPlusObject, state);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl.SetValueNoUpdate(aValue : integer);
|
||||
//begin
|
||||
// BControl_SetValueNoUpdate(CPlusObject, aValue);
|
||||
//end;
|
||||
|
||||
//procedure BControl._ReservedControl1;
|
||||
//begin
|
||||
// BControl__ReservedControl1(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl._ReservedControl2;
|
||||
//begin
|
||||
// BControl__ReservedControl2(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl._ReservedControl3;
|
||||
//begin
|
||||
// BControl__ReservedControl3(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl._ReservedControl4;
|
||||
//begin
|
||||
// BControl__ReservedControl4(CPlusObject);
|
||||
//end;
|
||||
|
||||
//function BControl.operator=( : BControl) : BControl;
|
||||
//begin
|
||||
// Result := BControl_operator=(CPlusObject, );
|
||||
//end;
|
||||
|
||||
//procedure BControl.InitData(data : BMessage);
|
||||
//begin
|
||||
// BControl_InitData(CPlusObject, data.CPlusObject);
|
||||
//end;
|
||||
|
||||
//procedure BControl.char *fLabel;
|
||||
//begin
|
||||
// BControl_char *fLabel(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl.int32 fValue;
|
||||
//begin
|
||||
// BControl_int32 fValue(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl.bool fEnabled;
|
||||
//begin
|
||||
// BControl_bool fEnabled(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl.bool fFocusChanging;
|
||||
//begin
|
||||
// BControl_bool fFocusChanging(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl.bool fTracking;
|
||||
//begin
|
||||
// BControl_bool fTracking(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl.bool fWantsNav;
|
||||
//begin
|
||||
// BControl_bool fWantsNav(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure BControl.uint32 _reserved[4];
|
||||
//begin
|
||||
// BControl_uint32 _reserved[4](CPlusObject);
|
||||
//end;
|
||||
|
||||
function BControl.GeBInvoker : BInvoker;
|
||||
begin
|
||||
if FInvoker = nil then
|
||||
begin
|
||||
Result := BInvoker.Wrap(CPlusObject);
|
||||
end;
|
||||
Result := FInvoker;
|
||||
end;
|
||||
|
||||
end.
|
||||
493
bepascal/source/bepascal/pas/src/be/interface/font.pp
Normal file
493
bepascal/source/bepascal/pas/src/be/interface/font.pp
Normal file
@@ -0,0 +1,493 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit font;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj,flattenable,interfacedefs,supportdefs,rect,bstring;
|
||||
|
||||
type
|
||||
font_which= (
|
||||
font_which_nil,
|
||||
B_PLAIN_FONT,
|
||||
B_BOLD_FONT,
|
||||
B_FIXED_FONT,
|
||||
B_SYMBOL_FONT,
|
||||
B_SERIF_FONT
|
||||
);
|
||||
|
||||
const
|
||||
B__NUM_FONT = 5;
|
||||
// Attention this is hexadecimal; need conversion !!!!
|
||||
B_ITALIC_FACE = $0001;
|
||||
B_UNDERSCORE_FACE = $0002;
|
||||
B_NEGATIVE_FACE = $0004;
|
||||
B_OUTLINED_FACE = $0008;
|
||||
B_STRIKEOUT_FACE = $0010;
|
||||
B_BOLD_FACE = $0020;
|
||||
B_REGULAR_FACE = $0040;
|
||||
|
||||
type
|
||||
|
||||
font_metric_mode = (
|
||||
B_SCREEN_METRIC,
|
||||
B_PRINTING_METRIC);
|
||||
|
||||
font_file_format =(
|
||||
B_TRUETYPE_WINDOWS ,
|
||||
B_POSTSCRIPT_TYPE1_WINDOWS);
|
||||
|
||||
|
||||
const B_FONT_FAMILY_LENGTH= 63;
|
||||
|
||||
type FONT_FAMILY = array[0..B_FONT_FAMILY_LENGTH] of char;
|
||||
|
||||
const B_FONT_STYLE_LENGTH= 63;
|
||||
|
||||
type font_style = array[0..B_FONT_STYLE_LENGTH ] of char;
|
||||
|
||||
type
|
||||
escapement_delta = record
|
||||
nonspace : real;
|
||||
space: real;
|
||||
end;
|
||||
edge_info = record
|
||||
left: real;
|
||||
right: real;
|
||||
end;
|
||||
tuned_font_info = record
|
||||
size : real;
|
||||
shear: real ;
|
||||
rotation : real;
|
||||
flags: cardinal;
|
||||
face : integer;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
font_height = record
|
||||
ascent: real;
|
||||
descent: real;
|
||||
leading: real;
|
||||
end;
|
||||
|
||||
font_direction =(
|
||||
B_FONT_LEFT_TO_RIGHT ,
|
||||
B_FONT_RIGHT_TO_LEFT
|
||||
);
|
||||
|
||||
|
||||
|
||||
type
|
||||
BFont = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create;
|
||||
constructor Create(font : BFont);virtual;
|
||||
destructor Destroy;override;
|
||||
function SetFamilyAndStyle(family : Font_FAMILY; style : Font_style) : Status_t;
|
||||
procedure SetFamilyAndStyle(code : Cardinal);
|
||||
function SetFamilyAndFace(family : Font_FAMILY; aface : integer) : Status_t;
|
||||
procedure SetSize(asize : single);
|
||||
procedure SetShear(ashear : single);
|
||||
procedure SetRotation(arotation : single);
|
||||
procedure SetSpacing(aspacing : integer);
|
||||
procedure SetEncoding(aencoding : integer);
|
||||
procedure SetFace(aface :integer );
|
||||
procedure SetFlags(aflags : Cardinal);
|
||||
procedure GetFamilyAndStyle(family : Font_FAMILY; style : Font_style);
|
||||
function FamilyAndStyle : Cardinal;
|
||||
function Size : single;
|
||||
function Shear : single;
|
||||
function Rotation : single;
|
||||
function Spacing : integer;
|
||||
function Encoding : integer;
|
||||
function Face : integer;
|
||||
function Flags : Cardinal;
|
||||
function Direction : Font_direction;
|
||||
function IsFixed : boolean;
|
||||
function IsFullAndHalfFixed : boolean;
|
||||
function BoundingBox : BRect;
|
||||
// function Blocks : ;
|
||||
function FileFormat : Font_file_format;
|
||||
function CountTuned : integer;
|
||||
procedure GetTunedInfo(index : integer; info : tuned_font_info);
|
||||
procedure TruncateString(in_out : TString; mode : Cardinal; width : single);
|
||||
// procedure GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : Pchar);
|
||||
// procedure GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar);
|
||||
function StringWidth(astring : PChar) : single;
|
||||
function StringWidth(astring : PChar; length : integer) : single;
|
||||
// procedure GetStringWidths(stringArray : PChar; lengthArray : integer; numStrings : integer; widthArray : single);
|
||||
// procedure GetEscapements(charArray : ; numChars : integer; escapementArray : single);
|
||||
// procedure GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : single);
|
||||
// procedure GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint);
|
||||
// procedure GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint; offsetArray : TPoint);
|
||||
// procedure GetEdges(charArray : ; numBytes : integer; edgeArray : );
|
||||
procedure GetHeight(height : Font_height);
|
||||
// procedure GetBoundingBoxesAsGlyphs(charArray : ; numChars : integer; mode : ; boundingBoxArray : BRect);
|
||||
// procedure GetBoundingBoxesAsString(charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : BRect);
|
||||
// procedure GetBoundingBoxesForStrings(stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : BRect);
|
||||
// procedure GetGlyphShapes(charArray : ; numChars : integer; glyphShapeArray : );
|
||||
// procedure GetHasGlyphs(charArray : ; numChars : integer; hasArray : boolean);
|
||||
procedure PrintToStream;
|
||||
end;
|
||||
|
||||
{procedure edge_info_float left(AObject : TCPlusObject); cdecl; external BePascalLibName name 'edge_info_float left';
|
||||
procedure edge_info_float right(AObject : TCPlusObject); cdecl; external BePascalLibName name 'edge_info_float right';
|
||||
procedure font_height_float ascent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_height_float ascent';
|
||||
procedure font_height_float descent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_height_float descent';
|
||||
procedure font_height_float leading(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_height_float leading';
|
||||
procedure escapement_delta_float nonspace(AObject : TCPlusObject); cdecl; external BePascalLibName name 'escapement_delta_float nonspace';
|
||||
procedure escapement_delta_float space(AObject : TCPlusObject); cdecl; external BePascalLibName name 'escapement_delta_float space';
|
||||
procedure font_cache_info_int32 sheared_font_penalty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 sheared_font_penalty';
|
||||
procedure font_cache_info_int32 rotated_font_penalty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 rotated_font_penalty';
|
||||
procedure font_cache_info_float oversize_threshold(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_float oversize_threshold';
|
||||
procedure font_cache_info_int32 oversize_penalty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 oversize_penalty';
|
||||
procedure font_cache_info_int32 cache_size(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 cache_size';
|
||||
procedure font_cache_info_float spacing_size_threshold(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_float spacing_size_threshold';
|
||||
procedure tuned_font_info_float size(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_float size';
|
||||
procedure tuned_font_info_float shear(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_float shear';
|
||||
procedure tuned_font_info_float rotation(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_float rotation';
|
||||
procedure tuned_font_info_uint32 flags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_uint32 flags';
|
||||
procedure tuned_font_info_uint16 face(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_uint16 face';
|
||||
}
|
||||
|
||||
function BFont_Create(AObject : TBeObject): TCPlusObject; cdecl; external BePascalLibName name 'BFont_Create';
|
||||
function BFont_Create(AObject : TBeObject; font : BFont): TCPlusObject; cdecl; external BePascalLibName name 'BFont_Create_1';
|
||||
procedure BFont_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_Free';
|
||||
function BFont_SetFamilyAndStyle(AObject : TCPlusObject; family : Font_family; style : Font_style) : Status_t; cdecl; external BePascalLibName name 'BFont_SetFamilyAndStyle';
|
||||
procedure BFont_SetFamilyAndStyle(AObject : TCPlusObject; code : Cardinal); cdecl; external BePascalLibName name 'BFont_SetFamilyAndStyle';
|
||||
function BFont_SetFamilyAndFace(AObject : TCPlusObject; family : Font_family; face : integer) : Status_t; cdecl; external BePascalLibName name 'BFont_SetFamilyAndFace';
|
||||
procedure BFont_SetSize(AObject : TCPlusObject; size : single); cdecl; external BePascalLibName name 'BFont_SetSize';
|
||||
procedure BFont_SetShear(AObject : TCPlusObject; shear : single); cdecl; external BePascalLibName name 'BFont_SetShear';
|
||||
procedure BFont_SetRotation(AObject : TCPlusObject; rotation : single); cdecl; external BePascalLibName name 'BFont_SetRotation';
|
||||
procedure BFont_SetSpacing(AObject : TCPlusObject; spacing : integer); cdecl; external BePascalLibName name 'BFont_SetSpacing';
|
||||
procedure BFont_SetEncoding(AObject : TCPlusObject; encoding : integer); cdecl; external BePascalLibName name 'BFont_SetEncoding';
|
||||
procedure BFont_SetFace(AObject : TCPlusObject; face :integer ); cdecl; external BePascalLibName name 'BFont_SetFace';
|
||||
procedure BFont_SetFlags(AObject : TCPlusObject; flags : Cardinal); cdecl; external BePascalLibName name 'BFont_SetFlags';
|
||||
procedure BFont_GetFamilyAndStyle(AObject : TCPlusObject; family : Font_family; style : Font_style); cdecl; external BePascalLibName name 'BFont_GetFamilyAndStyle';
|
||||
function BFont_FamilyAndStyle(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BFont_FamilyAndStyle';
|
||||
function BFont_Size(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BFont_Size';
|
||||
function BFont_Shear(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BFont_Shear';
|
||||
function BFont_Rotation(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BFont_Rotation';
|
||||
function BFont_Spacing(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_Spacing';
|
||||
function BFont_Encoding(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_Encoding';
|
||||
function BFont_Face(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_Face';
|
||||
function BFont_Flags(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BFont_Flags';
|
||||
function BFont_Direction(AObject : TCPlusObject) : Font_direction; cdecl; external BePascalLibName name 'BFont_Direction';
|
||||
function BFont_IsFixed(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BFont_IsFixed';
|
||||
function BFont_IsFullAndHalfFixed(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BFont_IsFullAndHalfFixed';
|
||||
function BFont_BoundingBox(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BFont_BoundingBox';
|
||||
//function BFont_Blocks(AObject : TCPlusObject) : ; cdecl; external BePascalLibName name 'BFont_Blocks';
|
||||
function BFont_FileFormat(AObject : TCPlusObject) :Font_file_format ; cdecl; external BePascalLibName name 'BFont_FileFormat';
|
||||
function BFont_CountTuned(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_CountTuned';
|
||||
procedure BFont_GetTunedInfo(AObject : TCPlusObject; index : integer; info : tuned_font_info); cdecl; external BePascalLibName name 'BFont_GetTunedInfo';
|
||||
procedure BFont_TruncateString(AObject : TCPlusObject; in_out : TCPlusObject; mode : Cardinal; width : single); cdecl; external BePascalLibName name 'BFont_TruncateString';
|
||||
//procedure BFont_GetTruncatedStrings(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : ); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings';
|
||||
//procedure BFont_GetTruncatedStrings(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings';
|
||||
function BFont_StringWidth(AObject : TCPlusObject; astring : PChar) : single; cdecl; external BePascalLibName name 'BFont_StringWidth';
|
||||
function BFont_StringWidth(AObject : TCPlusObject; astring : PChar; length : integer) : single; cdecl; external BePascalLibName name 'BFont_StringWidth';
|
||||
//procedure BFont_GetStringWidths(AObject : TCPlusObject; stringArray : PChar; lengthArray : ; numStrings : integer; widthArray : single); cdecl; external BePascalLibName name 'BFont_GetStringWidths';
|
||||
//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; escapementArray : single); cdecl; external BePascalLibName name 'BFont_GetEscapements';
|
||||
//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; escapementArray : single); cdecl; external BePascalLibName name 'BFont_GetEscapements';
|
||||
//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; escapementArray : TPoint); cdecl; external BePascalLibName name 'BFont_GetEscapements';
|
||||
//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; escapementArray : TPoint; offsetArray : TPoint); cdecl; external BePascalLibName name 'BFont_GetEscapements';
|
||||
//procedure BFont_GetEdges(AObject : TCPlusObject; charArray : ; numBytes : integer; edgeArray : ); cdecl; external BePascalLibName name 'BFont_GetEdges';
|
||||
procedure BFont_GetHeight(AObject : TCPlusObject; height :Font_height ); cdecl; external BePascalLibName name 'BFont_GetHeight';
|
||||
|
||||
{procedure BFont_GetBoundingBoxesAsGlyphs(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; boundingBoxArray : BRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesAsGlyphs';
|
||||
procedure BFont_GetBoundingBoxesAsString(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : BRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesAsString';
|
||||
procedure BFont_GetBoundingBoxesForStrings(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : BRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesForStrings';
|
||||
procedure BFont_GetGlyphShapes(AObject : TCPlusObject; charArray : ; numChars : integer; glyphShapeArray : ); cdecl; external BePascalLibName name 'BFont_GetGlyphShapes';
|
||||
procedure BFont_GetHasGlyphs(AObject : TCPlusObject; charArray : ; numChars : integer; hasArray : boolean); cdecl; external BePascalLibName name 'BFont_GetHasGlyphs';
|
||||
function BFont_operator=(AObject : TCPlusObject; font : ) : ; cdecl; external BePascalLibName name 'BFont_operator=';
|
||||
function BFont_operator==(AObject : TCPlusObject; font : ) : boolean; cdecl; external BePascalLibName name 'BFont_operator==';
|
||||
function BFont_operator!=(AObject : TCPlusObject; font : ) : boolean; cdecl; external BePascalLibName name 'BFont_operator!=';
|
||||
}
|
||||
procedure BFont_PrintToStream(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_PrintToStream';
|
||||
{procedure BFont_uint16 fFamilyID(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint16 fFamilyID';
|
||||
procedure BFont_uint16 fStyleID(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint16 fStyleID';
|
||||
procedure BFont_float fSize(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_float fSize';
|
||||
procedure BFont_float fShear(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_float fShear';
|
||||
procedure BFont_float fRotation(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_float fRotation';
|
||||
procedure BFont_uint8 fSpacing(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint8 fSpacing';
|
||||
procedure BFont_uint8 fEncoding(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint8 fEncoding';
|
||||
procedure BFont_uint16 fFace(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint16 fFace';
|
||||
procedure BFont_uint32 fFlags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint32 fFlags';
|
||||
procedure BFont_font_height fHeight(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_font_height fHeight';
|
||||
procedure BFont_int32 fPrivateFlags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_int32 fPrivateFlags';
|
||||
procedure BFont_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint32 _reserved[2]';
|
||||
procedure BFont_SetPacket(AObject : TCPlusObject; packet : Pointer); cdecl; external BePascalLibName name 'BFont_SetPacket';
|
||||
procedure BFont_GetTruncatedStrings64(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings64';
|
||||
procedure BFont_GetTruncatedStrings64(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : ); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings64';
|
||||
procedure BFont__GetEscapements_(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; mode : ; escapements : single; offsets : single); cdecl; external BePascalLibName name 'BFont__GetEscapements_';
|
||||
procedure BFont__GetBoundingBoxes_(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; string_escapement : boolean; delta : ; boundingBoxArray : BRect); cdecl; external BePascalLibName name 'BFont__GetBoundingBoxes_';
|
||||
}
|
||||
implementation
|
||||
|
||||
|
||||
constructor BFont.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BFont_Create(Self);
|
||||
end;
|
||||
|
||||
constructor BFont.Create(font : BFont);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BFont_Create(Self, font);
|
||||
end;
|
||||
|
||||
destructor BFont.Destroy;
|
||||
begin
|
||||
if CPlusObject <> nil then
|
||||
BFont_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BFont.SetFamilyAndStyle(family : Font_family; style :Font_style ) : Status_t;
|
||||
begin
|
||||
Result := BFont_SetFamilyAndStyle(CPlusObject, family, style);
|
||||
end;
|
||||
|
||||
procedure BFont.SetFamilyAndStyle(code : Cardinal);
|
||||
begin
|
||||
BFont_SetFamilyAndStyle(CPlusObject, code);
|
||||
end;
|
||||
|
||||
function BFont.SetFamilyAndFace(family : Font_family; aface : integer) : Status_t;
|
||||
begin
|
||||
Result := BFont_SetFamilyAndFace(CPlusObject, family, aface);
|
||||
end;
|
||||
|
||||
procedure BFont.SetSize(asize : single);
|
||||
begin
|
||||
BFont_SetSize(CPlusObject, asize);
|
||||
end;
|
||||
|
||||
procedure BFont.SetShear(ashear : single);
|
||||
begin
|
||||
BFont_SetShear(CPlusObject, ashear);
|
||||
end;
|
||||
|
||||
procedure BFont.SetRotation(arotation : single);
|
||||
begin
|
||||
BFont_SetRotation(CPlusObject, arotation);
|
||||
end;
|
||||
|
||||
procedure BFont.SetSpacing(aspacing : integer);
|
||||
begin
|
||||
BFont_SetSpacing(CPlusObject, aspacing);
|
||||
end;
|
||||
|
||||
procedure BFont.SetEncoding(aencoding : integer);
|
||||
begin
|
||||
BFont_SetEncoding(CPlusObject, aencoding);
|
||||
end;
|
||||
|
||||
procedure BFont.SetFace(aface : integer);
|
||||
begin
|
||||
BFont_SetFace(CPlusObject, aface);
|
||||
end;
|
||||
|
||||
procedure BFont.SetFlags(aflags : Cardinal);
|
||||
begin
|
||||
BFont_SetFlags(CPlusObject, aflags);
|
||||
end;
|
||||
|
||||
procedure BFont.GetFamilyAndStyle(family : Font_family; style :Font_style );
|
||||
begin
|
||||
BFont_GetFamilyAndStyle(CPlusObject, family, style);
|
||||
end;
|
||||
|
||||
function BFont.FamilyAndStyle : Cardinal;
|
||||
begin
|
||||
Result := BFont_FamilyAndStyle(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.Size : single;
|
||||
begin
|
||||
Result := BFont_Size(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.Shear : single;
|
||||
begin
|
||||
Result := BFont_Shear(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.Rotation : single;
|
||||
begin
|
||||
Result := BFont_Rotation(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.Spacing : integer;
|
||||
begin
|
||||
Result := BFont_Spacing(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.Encoding : integer;
|
||||
begin
|
||||
Result := BFont_Encoding(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.Face : integer;
|
||||
begin
|
||||
Result := BFont_Face(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.Flags : Cardinal;
|
||||
begin
|
||||
Result := BFont_Flags(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.Direction : Font_direction;
|
||||
begin
|
||||
Result := BFont_Direction(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.IsFixed : boolean;
|
||||
begin
|
||||
Result := BFont_IsFixed(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.IsFullAndHalfFixed : boolean;
|
||||
begin
|
||||
Result := BFont_IsFullAndHalfFixed(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.BoundingBox : BRect;
|
||||
begin
|
||||
Result := BFont_BoundingBox(CPlusObject);
|
||||
end;
|
||||
|
||||
{function BFont.Blocks : ;
|
||||
begin
|
||||
Result := BFont_Blocks(CPlusObject);
|
||||
end;
|
||||
}
|
||||
function BFont.FileFormat : Font_file_format;
|
||||
begin
|
||||
Result := BFont_FileFormat(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFont.CountTuned : integer;
|
||||
begin
|
||||
Result := BFont_CountTuned(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BFont.GetTunedInfo(index : integer; info : tuned_font_info);
|
||||
begin
|
||||
BFont_GetTunedInfo(CPlusObject, index, info);
|
||||
end;
|
||||
|
||||
procedure BFont.TruncateString(in_out : TString; mode : Cardinal; width : single);
|
||||
begin
|
||||
BFont_TruncateString(CPlusObject, in_out.CPlusObject, mode, width);
|
||||
end;
|
||||
|
||||
{procedure BFont.GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : );
|
||||
begin
|
||||
BFont_GetTruncatedStrings(CPlusObject, stringArray, numStrings, mode, width, resultArray.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BFont.GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar);
|
||||
begin
|
||||
BFont_GetTruncatedStrings(CPlusObject, stringArray, numStrings, mode, width, resultArray);
|
||||
end;
|
||||
}
|
||||
|
||||
function BFont.StringWidth(astring : PChar) : single;
|
||||
begin
|
||||
Result := BFont_StringWidth(CPlusObject, astring);
|
||||
end;
|
||||
|
||||
function BFont.StringWidth(astring : PChar; length : integer) : single;
|
||||
begin
|
||||
Result := BFont_StringWidth(CPlusObject, astring, length);
|
||||
end;
|
||||
|
||||
{procedure BFont.GetStringWidths(stringArray : PChar; lengthArray : integer ; numStrings : integer; widthArray : single);
|
||||
begin
|
||||
BFont_GetStringWidths(CPlusObject, stringArray, lengthArray, numStrings, widthArray);
|
||||
end;
|
||||
|
||||
procedure BFont.GetEscapements(charArray : PChar; numChars : integer; escapementArray : single);
|
||||
begin
|
||||
BFont_GetEscapements(CPlusObject, charArray, numChars, escapementArray);
|
||||
end;
|
||||
|
||||
procedure BFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : single);
|
||||
begin
|
||||
BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray);
|
||||
end;
|
||||
|
||||
procedure BFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint);
|
||||
begin
|
||||
BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint; offsetArray : TPoint);
|
||||
begin
|
||||
BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray.CPlusObject, offsetArray.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BFont.GetEdges(charArray : ; numBytes : integer; edgeArray : );
|
||||
begin
|
||||
BFont_GetEdges(CPlusObject, charArray, numBytes, edgeArray);
|
||||
end;
|
||||
}
|
||||
procedure BFont.GetHeight(height :Font_height );
|
||||
begin
|
||||
BFont_GetHeight(CPlusObject, height);
|
||||
end;
|
||||
|
||||
{
|
||||
procedure BFont.GetBoundingBoxesAsGlyphs(charArray : ; numChars : integer; mode : ; boundingBoxArray : BRect);
|
||||
begin
|
||||
BFont_GetBoundingBoxesAsGlyphs(CPlusObject, charArray, numChars, mode, boundingBoxArray.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BFont.GetBoundingBoxesAsString(charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : BRect);
|
||||
begin
|
||||
BFont_GetBoundingBoxesAsString(CPlusObject, charArray, numChars, mode, delta, boundingBoxArray.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BFont.GetBoundingBoxesForStrings(stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : BRect);
|
||||
begin
|
||||
BFont_GetBoundingBoxesForStrings(CPlusObject, stringArray, numStrings, mode, deltas, boundingBoxArray.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BFont.GetGlyphShapes(charArray : ; numChars : integer; glyphShapeArray : );
|
||||
begin
|
||||
BFont_GetGlyphShapes(CPlusObject, charArray, numChars, glyphShapeArray.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BFont.GetHasGlyphs(charArray : ; numChars : integer; hasArray : boolean);
|
||||
begin
|
||||
BFont_GetHasGlyphs(CPlusObject, charArray, numChars, hasArray);
|
||||
end;
|
||||
}
|
||||
procedure BFont.PrintToStream;
|
||||
begin
|
||||
BFont_PrintToStream(CPlusObject);
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
20
bepascal/source/bepascal/pas/src/be/interface/graphicdefs.pp
Normal file
20
bepascal/source/bepascal/pas/src/be/interface/graphicdefs.pp
Normal file
@@ -0,0 +1,20 @@
|
||||
unit graphicdefs;
|
||||
|
||||
interface
|
||||
|
||||
{$PACKRECORDS C}
|
||||
|
||||
type
|
||||
RGB_color = record
|
||||
red : byte;
|
||||
green : byte;
|
||||
blue : byte;
|
||||
alpha : byte;
|
||||
end;
|
||||
Color_space = Cardinal;
|
||||
|
||||
implementation
|
||||
|
||||
initialization
|
||||
|
||||
end.
|
||||
@@ -0,0 +1,60 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNSS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit interfacedefs;
|
||||
|
||||
interface
|
||||
|
||||
uses graphicdefs,beobj;
|
||||
|
||||
type
|
||||
Alignment = (B_ALIGN_LEFT,
|
||||
B_ALIGN_RIGHT,
|
||||
B_ALIGN_CENTER);
|
||||
|
||||
|
||||
color_which =(Tcolor_nil,
|
||||
B_PANEL_BACKGROUND_COLOR ,
|
||||
B_MENU_BACKGROUND_COLOR ,
|
||||
B_MENU_SELECTION_BACKGROUND_COLOR ,
|
||||
B_MENU_ITEM_TEXT_COLOR ,
|
||||
B_MENU_SELECTED_ITEM_TEXT_COLOR ,
|
||||
B_WINDOW_TAB_COLOR ,
|
||||
B_KEYBOARD_NAVIGATION_COLOR ,
|
||||
B_DESKTOP_COLOR );
|
||||
|
||||
orientation =(
|
||||
B_HORIZONTAL,
|
||||
B_VERTICAL);
|
||||
|
||||
border_style =(
|
||||
B_PLAIN_BORDER,
|
||||
B_FANCY_BORDER,
|
||||
B_NO_BORDER);
|
||||
|
||||
Button_width = (
|
||||
B_WIDTH_AS_USUAL,
|
||||
B_WIDTH_FROM_WIDSET,
|
||||
B_WIDTH_FROM_LABEL);
|
||||
|
||||
function ui_color(which : color_which) : rgb_color; cdecl; external 'be' name 'ui_color__F11color_which';
|
||||
function Ttint_color(color : rgb_color; which :color_which) : rgb_color;cdecl; external 'be' name 'tint_color__FG9rgb_colorf';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
352
bepascal/source/bepascal/pas/src/be/interface/listitem.pp
Normal file
352
bepascal/source/bepascal/pas/src/be/interface/listitem.pp
Normal file
@@ -0,0 +1,352 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit listitem;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, interfacedefs,view,Message, Archivable, SupportDefs, Rect, Handler,font;
|
||||
|
||||
type
|
||||
BListItem = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create(aoutlineLevel : longint; expanded : boolean );virtual;
|
||||
constructor Create(data : BMessage);
|
||||
destructor Destroy;override;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
function Height : double;
|
||||
function Width : double;
|
||||
function IsSelected : boolean;
|
||||
procedure Select;
|
||||
procedure Deselect;
|
||||
procedure SetEnabled(aon : boolean);
|
||||
function IsEnabled : boolean;
|
||||
procedure SetHeight(aheight : double);
|
||||
procedure SetWidth(awidth : double);
|
||||
procedure DrawItem(owner : BView; bounds : BRect; complete : boolean);
|
||||
procedure Update(owner : BView; font : BFont);
|
||||
// function Perform(d : TPerform_code; var arg : Pointer) : Status_t;
|
||||
function IsExpanded : boolean;
|
||||
procedure SetExpanded(expanded : boolean);
|
||||
function OutlineLevel : Cardinal;
|
||||
function HasSubitems : boolean;
|
||||
end;
|
||||
|
||||
type
|
||||
BStringItem = class(BListItem)
|
||||
private
|
||||
public
|
||||
constructor Create( atext: pchar;aoutlineLevel : longint; expanded : boolean);virtual;
|
||||
destructor Destroy;override;
|
||||
constructor Create(data : BMessage);
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure DrawItem(owner : BView; frame : BRect; complete : boolean);
|
||||
procedure SetText( atext : PChar);
|
||||
function Text : PChar;
|
||||
procedure Update(owner : BView; font : BFont);
|
||||
// function Perform(d : TPerform_code; arg : Pointer) : Status_t;
|
||||
end;
|
||||
|
||||
function BListItem_Create(AObject : TBeObject;outlineLevel : longint; expanded : boolean): TCPlusObject; cdecl; external BePascalLibName name 'BListItem_Create';
|
||||
function BListItem_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BListItem_Create_1';
|
||||
procedure BListItem_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListItem_Free';
|
||||
function BListItem_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BListItem_Archive';
|
||||
function BListItem_Height(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BListItem_Height';
|
||||
function BListItem_Width(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BListItem_Width';
|
||||
function BListItem_IsSelected(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListItem_IsSelected';
|
||||
procedure BListItem_Select(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListItem_Select';
|
||||
procedure BListItem_Deselect(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListItem_Deselect';
|
||||
procedure BListItem_SetEnabled(AObject : TCPlusObject; aon : boolean); cdecl; external BePascalLibName name 'BListItem_SetEnabled';
|
||||
function BListItem_IsEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListItem_IsEnabled';
|
||||
procedure BListItem_SetHeight(AObject : TCPlusObject; aheight : double); cdecl; external BePascalLibName name 'BListItem_SetHeight';
|
||||
procedure BListItem_SetWidth(AObject : TCPlusObject; awidth : double); cdecl; external BePascalLibName name 'BListItem_SetWidth';
|
||||
procedure BListItem_Update(AObject : TCPlusObject; owner : TCPlusObject; font : TCPlusObject); cdecl; external BePascalLibName name 'BListItem_Update';
|
||||
function BListItem_Perform(AObject : TCPlusObject; d : TCPlusObject; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BListItem_Perform';
|
||||
function BListItem_IsExpanded(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListItem_IsExpanded';
|
||||
procedure BListItem_SetExpanded(AObject : TCPlusObject; expanded : boolean); cdecl; external BePascalLibName name 'BListItem_SetExpanded';
|
||||
function BListItem_OutlineLevel(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BListItem_OutlineLevel';
|
||||
|
||||
//function BListItem_HasSubitems(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListItem_HasSubitems';
|
||||
procedure BListItem_DrawItem(AObject : TCPlusObject; owner : TCPlusObject; bounds : TCPlusObject; complete : boolean); cdecl; external BePascalLibName name 'BListItem_DrawItem';
|
||||
|
||||
function BStringItem_Create(AObject : TBeObject ;text: pchar;lineLevel : longint; expanded : boolean): TCPlusObject; cdecl; external BePascalLibName name 'BStringItem_Create';
|
||||
procedure BStringItem_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringItem_Free';
|
||||
function BStringItem_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BStringItem_Create';
|
||||
function BStringItem_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BStringItem_Instantiate';
|
||||
function BStringItem_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BStringItem_Archive';
|
||||
procedure BStringItem_DrawItem(AObject : TCPlusObject; owner : TCPlusObject; frame : TCPlusObject; complete : boolean); cdecl; external BePascalLibName name 'BStringItem_DrawItem';
|
||||
procedure BStringItem_SetText(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BStringItem_SetText';
|
||||
function BStringItem_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStringItem_Text';
|
||||
procedure BStringItem_Update(AObject : TCPlusObject; owner : TCPlusObject; font : TCPlusObject); cdecl; external BePascalLibName name 'BStringItem_Update';
|
||||
function BStringItem_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BStringItem_Perform';
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
|
||||
ListItem_DrawItem_hook : Pointer; cvar; external;
|
||||
ListString_DrawItem_hook : Pointer; cvar; external;
|
||||
ListItem_Update_hook : Pointer; cvar; external;
|
||||
ListString_Update_hook : Pointer; cvar; external;
|
||||
|
||||
constructor BListItem.Create(aoutlineLevel : longint; expanded : boolean );
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BListItem_Create(Self,aoutlineLevel , expanded );
|
||||
end;
|
||||
|
||||
constructor BListItem.Create(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BListItem_Create(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BListItem.Destroy;
|
||||
begin
|
||||
BListItem_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BListItem.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BListItem_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
function BListItem.Height : double;
|
||||
begin
|
||||
Result := BListItem_Height(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListItem.Width : double;
|
||||
begin
|
||||
Result := BListItem_Width(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListItem.IsSelected : boolean;
|
||||
begin
|
||||
Result := BListItem_IsSelected(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListItem.Select;
|
||||
begin
|
||||
BListItem_Select(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListItem.Deselect;
|
||||
begin
|
||||
BListItem_Deselect(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListItem.SetEnabled(aon : boolean);
|
||||
begin
|
||||
BListItem_SetEnabled(CPlusObject, aon);
|
||||
end;
|
||||
|
||||
function BListItem.IsEnabled : boolean;
|
||||
begin
|
||||
Result := BListItem_IsEnabled(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListItem.SetHeight(aheight : double);
|
||||
begin
|
||||
BListItem_SetHeight(CPlusObject, aheight);
|
||||
end;
|
||||
|
||||
procedure BListItem.SetWidth(awidth : double);
|
||||
begin
|
||||
BListItem_SetWidth(CPlusObject, awidth);
|
||||
end;
|
||||
|
||||
procedure BListItem.DrawItem(owner : BView; bounds : BRect; complete : boolean);
|
||||
begin
|
||||
//BListItem_DrawItem(CPlusObject, owner.CPlusObject, bounds.CPlusObject, complete);
|
||||
end;
|
||||
|
||||
procedure BListItem.Update(owner : BView; font : BFont);
|
||||
begin
|
||||
// BListItem_Update(CPlusObject, owner.CPlusObject, font);
|
||||
end;
|
||||
|
||||
{function BListItem.Perform(d : TPerform_code; var arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BListItem_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
}
|
||||
function BListItem.IsExpanded : boolean;
|
||||
begin
|
||||
Result := BListItem_IsExpanded(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListItem.SetExpanded(expanded : boolean);
|
||||
begin
|
||||
BListItem_SetExpanded(CPlusObject, expanded);
|
||||
end;
|
||||
|
||||
function BListItem.OutlineLevel : Cardinal;
|
||||
begin
|
||||
Result := BListItem_OutlineLevel(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListItem.HasSubitems : boolean;
|
||||
begin
|
||||
// Result := BListItem_HasSubitems(CPlusObject);
|
||||
end;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BStringItem
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
constructor BStringItem.Create( atext: pchar;aoutlineLevel : longint; expanded : boolean);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BStringItem_Create(Self,atext,aoutlineLevel,expanded);
|
||||
end;
|
||||
|
||||
destructor BStringItem.Destroy;
|
||||
begin
|
||||
BStringItem_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
constructor BStringItem.Create(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BStringItem_Create(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BStringItem.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BStringItem_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BStringItem.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
//Result := BStringItem_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BStringItem.DrawItem(owner : BView; frame : BRect; complete : boolean);
|
||||
begin
|
||||
//BStringItem_DrawItem(CPlusObject, owner.CPlusObject, frame.CPlusObject, complete);
|
||||
end;
|
||||
|
||||
procedure BStringItem.SetText( atext : PChar);
|
||||
begin
|
||||
BStringItem_SetText(CPlusObject, atext);
|
||||
end;
|
||||
|
||||
function BStringItem.Text : PChar;
|
||||
begin
|
||||
Result := BStringItem_Text(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringItem.Update(owner : BView; font : BFont);
|
||||
begin
|
||||
//BStringItem_Update(CPlusObject, owner.CPlusObject, font);
|
||||
end;
|
||||
|
||||
{function BStringItem.Perform(d : TPerform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BStringItem_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
}
|
||||
|
||||
procedure ListItem_DrawItem_hook_func(Liste : BListItem;owner : TCPlusObject; bounds : TCPlusObject; complete : boolean); cdecl;
|
||||
var Rect : BRect;
|
||||
ow : BView;
|
||||
|
||||
begin
|
||||
Rect:=BRect.Wrap(bounds);
|
||||
ow:=BView.Wrap(owner);
|
||||
try
|
||||
if Liste <> nil then
|
||||
begin
|
||||
Liste.DrawItem(ow ,Rect, complete );
|
||||
end;
|
||||
finally
|
||||
Rect.UnWrap;
|
||||
ow.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure ListString_DrawItem_hook_func(Liste : BStringItem;owner : TCPlusObject; bounds : TCPlusObject; complete : boolean); cdecl;
|
||||
var Rect : BRect;
|
||||
ow : BView;
|
||||
begin
|
||||
Rect:=BRect.Wrap(bounds);
|
||||
ow:=BView.Wrap(owner);
|
||||
try
|
||||
if Liste <> nil then
|
||||
begin
|
||||
Liste.DrawItem(ow ,Rect, complete );
|
||||
end;
|
||||
finally
|
||||
Rect.UnWrap;
|
||||
ow.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure ListItem_Update_hook_func(Liste : BListItem;owner : TCPlusObject; font : TCPlusObject); cdecl;
|
||||
var afont: BFont;
|
||||
ow : BView;
|
||||
begin
|
||||
afont:=BFont.Wrap(font);
|
||||
ow:=BView.Wrap(owner);
|
||||
try
|
||||
if Liste <> nil then
|
||||
begin
|
||||
|
||||
Liste.Update(ow ,afont );
|
||||
end;
|
||||
finally
|
||||
afont.UnWrap;
|
||||
ow.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure ListString_Update_hook_func(Liste : BStringItem;owner : TCPlusObject; font : TCPlusObject); cdecl;
|
||||
var afont: BFont;
|
||||
ow : BView;
|
||||
begin
|
||||
afont:=BFont.Wrap(font);
|
||||
ow:=BView.Wrap(owner);
|
||||
try
|
||||
if Liste <> nil then
|
||||
begin
|
||||
Liste.Update(ow ,afont );
|
||||
end;
|
||||
finally
|
||||
afont.UnWrap;
|
||||
ow.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
|
||||
ListItem_DrawItem_hook := @ListItem_DrawItem_hook_func;
|
||||
ListString_DrawItem_hook := @ListString_DrawItem_hook_func;
|
||||
ListItem_Update_hook := @ListItem_Update_hook_func;
|
||||
ListString_Update_hook := @ListString_Update_hook_func;
|
||||
|
||||
|
||||
end.
|
||||
559
bepascal/source/bepascal/pas/src/be/interface/listview.pp
Normal file
559
bepascal/source/bepascal/pas/src/be/interface/listview.pp
Normal file
@@ -0,0 +1,559 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit listview;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, view, message, archivable, SupportDefs, rect, list,
|
||||
handler, messenger,interfacedefs,font,graphicdefs,scrollview,listitem;
|
||||
|
||||
type
|
||||
list_view_type =(
|
||||
B_SINGLE_SELECTION_LIST,
|
||||
B_MULTIPLE_SELECTION_LIST
|
||||
);
|
||||
|
||||
|
||||
type
|
||||
BListView = class(BView)
|
||||
private
|
||||
public
|
||||
constructor Create(frame : BRect; name : pchar; atype : list_view_type; resizeMask: longint; flags : longint); virtual;
|
||||
constructor Create(data : BMessage);
|
||||
destructor Destroy;override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure Draw(updateRect : BRect);override;
|
||||
procedure MessageReceived(msg : BMessage);override;
|
||||
procedure MouseDown(where : BPoint);override;
|
||||
procedure KeyDown(bytes : PChar; numBytes : integer);override;
|
||||
procedure MakeFocus(state : boolean);
|
||||
procedure FrameResized(newWidth : double; newHeight : double);override;
|
||||
procedure TargetedByScrollView(scroller : BScrollView);
|
||||
procedure ScrollTo(x : double; y : double);
|
||||
procedure ScrollTo(where : BPoint);
|
||||
function AddItem(item : BListItem) : boolean;
|
||||
function AddItem(item : BListItem; atIndex : integer) : boolean;
|
||||
function AddList(newItems : BList) : boolean;
|
||||
function AddList(newItems : BList; atIndex : integer) : boolean;
|
||||
function RemoveItem(item : BListItem) : boolean;
|
||||
function RemoveItem(index : integer) : BListItem;
|
||||
function RemoveItems(index : integer; count : integer) : boolean;
|
||||
procedure SetSelectionMessage(message : BMessage);
|
||||
procedure SetInvocationMessage(message : BMessage);
|
||||
function SelectionMessage : BMessage;
|
||||
function SelectionCommand : Cardinal;
|
||||
function InvocationMessage : BMessage;
|
||||
function InvocationCommand : Cardinal;
|
||||
procedure SetListType(atype : list_view_type);
|
||||
function ListType : list_view_type;
|
||||
function ItemAt(index : integer) : BListItem;
|
||||
function IndexOf(point : BPoint) : integer;
|
||||
function IndexOf(item : BListItem) : integer;
|
||||
function FirstItem : BListItem;
|
||||
function LastItem : BListItem;
|
||||
function HasItem(item : BListItem) : boolean;
|
||||
function CountItems : integer;
|
||||
procedure MakeEmpty;
|
||||
function IsEmpty : boolean;
|
||||
function Items : BListView;
|
||||
procedure InvalidateItem(index : integer);
|
||||
procedure ScrollToSelection;
|
||||
procedure Select(index : integer; extend : boolean);
|
||||
procedure Select(from : integer; ato : integer; extend : boolean);
|
||||
function IsItemSelected(index : integer) : boolean;
|
||||
function CurrentSelection(index : integer) : integer;
|
||||
function Invoke(msg : BMessage) : Status_t;
|
||||
procedure DeselectAll;
|
||||
procedure DeselectExcept(except_from : integer; except_to : integer);
|
||||
procedure Deselect(index : integer);
|
||||
procedure SelectionChanged; virtual;
|
||||
function SwapItems(a : integer; b : integer) : boolean;
|
||||
function MoveItem(from : integer; ato : integer) : boolean;
|
||||
function ReplaceItem(index : integer; item : BListItem) : boolean;
|
||||
procedure AttachedToWindow;override;
|
||||
procedure FrameMoved(new_position : BPoint);override;
|
||||
function ItemFrame(index : integer) : BRect;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
procedure WindowActivated(state : boolean);override;
|
||||
procedure MouseUp(pt : BPoint);override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override;
|
||||
procedure DetachedFromWindow;override;
|
||||
function InitiateDrag(pt : BPoint; itemIndex : integer; initialySelected : boolean) : boolean;
|
||||
procedure ResizeToPreferred;override;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure AllAttached;override;
|
||||
procedure AllDetached;override;
|
||||
// procedure enum MiscCode { B_NO_OP, B_REPLACE_OP, B_MOVE_OP, B_SWAP_OP };
|
||||
end;
|
||||
|
||||
|
||||
function BListView_Create(AObject : TBeObject;frame : TCPlusObject; name : pchar; atype : list_view_type; resizeMask: longint; flags : longint): TCPlusObject; cdecl; external BePascalLibName name 'BListView_Create';
|
||||
function BListView_Create(AObject : TBeObject;data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BListView_Create_1';
|
||||
procedure BListView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_Free';
|
||||
function BListView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BListView_Instantiate';
|
||||
function BListView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BListView_Archive';
|
||||
procedure BListView_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BListView_Draw';
|
||||
procedure BListView_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BListView_MessageReceived';
|
||||
procedure BListView_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BListView_MouseDown';
|
||||
procedure BListView_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BListView_KeyDown';
|
||||
procedure BListView_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BListView_MakeFocus';
|
||||
procedure BListView_FrameResized(AObject : TCPlusObject; newWidth : double; newHeight : double); cdecl; external BePascalLibName name 'BListView_FrameResized';
|
||||
procedure BListView_TargetedByScrollView(AObject : TCPlusObject; scroller : TCPlusObject); cdecl; external BePascalLibName name 'BListView_TargetedByScrollView';
|
||||
procedure BListView_ScrollTo(AObject : TCPlusObject; x : double; y : double); cdecl; external BePascalLibName name 'BListView_ScrollTo';
|
||||
procedure BListView_ScrollTo(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BListView_ScrollTo';
|
||||
function BListView_AddItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_AddItem';
|
||||
function BListView_AddItem(AObject : TCPlusObject; item : TCPlusObject; atIndex : integer) : boolean; cdecl; external BePascalLibName name 'BListView_AddItem';
|
||||
function BListView_AddList(AObject : TCPlusObject; newItems : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_AddList';
|
||||
function BListView_AddList(AObject : TCPlusObject; newItems : TCPlusObject; atIndex : integer) : boolean; cdecl; external BePascalLibName name 'BListView_AddList';
|
||||
function BListView_RemoveItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_RemoveItem';
|
||||
function BListView_RemoveItem(AObject : TCPlusObject; index : integer) : BListItem; cdecl; external BePascalLibName name 'BListView_RemoveItem_1';
|
||||
function BListView_RemoveItems(AObject : TCPlusObject; index : integer; count : integer) : boolean; cdecl; external BePascalLibName name 'BListView_RemoveItems_2';
|
||||
procedure BListView_SetSelectionMessage(AObject : TCPlusObject; message : TCPlusObject); cdecl; external BePascalLibName name 'BListView_SetSelectionMessage';
|
||||
procedure BListView_SetInvocationMessage(AObject : TCPlusObject; message : TCPlusObject); cdecl; external BePascalLibName name 'BListView_SetInvocationMessage';
|
||||
function BListView_SelectionMessage(AObject : TCPlusObject) : BMessage; cdecl; external BePascalLibName name 'BListView_SelectionMessage';
|
||||
function BListView_SelectionCommand(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BListView_SelectionCommand';
|
||||
function BListView_InvocationMessage(AObject : TCPlusObject) : BMessage; cdecl; external BePascalLibName name 'BListView_InvocationMessage';
|
||||
function BListView_InvocationCommand(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BListView_InvocationCommand';
|
||||
procedure BListView_SetListType(AObject : TCPlusObject; atype : list_view_type); cdecl; external BePascalLibName name 'BListView_SetListType';
|
||||
function BListView_ListType(AObject : TCPlusObject) : list_view_type; cdecl; external BePascalLibName name 'BListView_ListType';
|
||||
function BListView_ItemAt(AObject : TCPlusObject; index : integer) : BListItem; cdecl; external BePascalLibName name 'BListView_ItemAt';
|
||||
function BListView_IndexOf(AObject : TCPlusObject; point : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BListView_IndexOf';
|
||||
function BListView_IndexOf_1(AObject : TCPlusObject; item : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BListView_IndexOf';
|
||||
function BListView_FirstItem(AObject : TCPlusObject) : BListItem; cdecl; external BePascalLibName name 'BListView_FirstItem';
|
||||
function BListView_LastItem(AObject : TCPlusObject) : BListItem; cdecl; external BePascalLibName name 'BListView_LastItem';
|
||||
function BListView_HasItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_HasItem';
|
||||
function BListView_CountItems(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BListView_CountItems';
|
||||
procedure BListView_MakeEmpty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_MakeEmpty';
|
||||
function BListView_IsEmpty(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_IsEmpty';
|
||||
function BListView_Items(AObject : TCPlusObject) : BListView; cdecl; external BePascalLibName name 'BListView_Items';
|
||||
procedure BListView_InvalidateItem(AObject : TCPlusObject; index : integer); cdecl; external BePascalLibName name 'BListView_InvalidateItem';
|
||||
procedure BListView_ScrollToSelection(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_ScrollToSelection';
|
||||
procedure BListView_Select(AObject : TCPlusObject; index : integer; extend : boolean); cdecl; external BePascalLibName name 'BListView_Select';
|
||||
procedure BListView_Select(AObject : TCPlusObject; from : integer; ato : integer; extend : boolean); cdecl; external BePascalLibName name 'BListView_Select';
|
||||
function BListView_IsItemSelected(AObject : TCPlusObject; index : integer) : boolean; cdecl; external BePascalLibName name 'BListView_IsItemSelected';
|
||||
function BListView_CurrentSelection(AObject : TCPlusObject; index : integer) : integer; cdecl; external BePascalLibName name 'BListView_CurrentSelection';
|
||||
function BListView_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BListView_Invoke';
|
||||
procedure BListView_DeselectAll(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_DeselectAll';
|
||||
procedure BListView_DeselectExcept(AObject : TCPlusObject; except_from : integer; except_to : integer); cdecl; external BePascalLibName name 'BListView_DeselectExcept';
|
||||
procedure BListView_Deselect(AObject : TCPlusObject; index : integer); cdecl; external BePascalLibName name 'BListView_Deselect';
|
||||
procedure BListView_SelectionChanged(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_SelectionChanged';
|
||||
function BListView_SwapItems(AObject : TCPlusObject; a : integer; b : integer) : boolean; cdecl; external BePascalLibName name 'BListView_SwapItems';
|
||||
function BListView_MoveItem(AObject : TCPlusObject; from : integer; ato : integer) : boolean; cdecl; external BePascalLibName name 'BListView_MoveItem';
|
||||
function BListView_ReplaceItem(AObject : TCPlusObject; index : integer; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BListView_ReplaceItem';
|
||||
procedure BListView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_AttachedToWindow';
|
||||
procedure BListView_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BListView_FrameMoved';
|
||||
function BListView_ItemFrame(AObject : TCPlusObject; index : integer) : BRect; cdecl; external BePascalLibName name 'BListView_ItemFrame';
|
||||
function BListView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BListView_ResolveSpecifier';
|
||||
function BListView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BListView_GetSupportedSuites';
|
||||
function BListView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BListView_Perform';
|
||||
procedure BListView_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BListView_WindowActivated';
|
||||
procedure BListView_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BListView_MouseUp';
|
||||
procedure BListView_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BListView_MouseMoved';
|
||||
procedure BListView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_DetachedFromWindow';
|
||||
function BListView_InitiateDrag(AObject : TCPlusObject; pt : TCPlusObject; itemIndex : integer; initialySelected : boolean) : boolean; cdecl; external BePascalLibName name 'BListView_InitiateDrag';
|
||||
procedure BListView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_ResizeToPreferred';
|
||||
procedure BListView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BListView_GetPreferredSize';
|
||||
procedure BListView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_AllAttached';
|
||||
procedure BListView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_AllDetached';
|
||||
//procedure BListView_enum MiscCode { B_NO_OP, B_REPLACE_OP, B_MOVE_OP, B_SWAP_OP }(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BListView_enum MiscCode { B_NO_OP, B_REPLACE_OP, B_MOVE_OP, B_SWAP_OP }';
|
||||
//procedure Replace_int32 index(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Replace_int32 index';
|
||||
//procedure Replace_BListItem *item(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Replace_BListItem *item';
|
||||
//procedure Move_int32 from(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Move_int32 from';
|
||||
//procedure Move_int32 to(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Move_int32 to';
|
||||
//procedure Swap_int32 a(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Swap_int32 a';
|
||||
//procedure Swap_int32 b(AObject : TCPlusObject); cdecl; external BePascalLibName name 'Swap_int32 b';
|
||||
|
||||
implementation
|
||||
var
|
||||
ListItem_SelectionChanged_hook: Pointer; cvar; external;
|
||||
ListString_InitiateDrag_hook: Pointer; cvar; external;
|
||||
|
||||
constructor BListView.Create(frame : BRect; name : pchar; atype : list_view_type; resizeMask: longint; flags : longint);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BListView_Create(Self,frame.CPlusObject,name,atype,resizeMask,flags);
|
||||
end;
|
||||
|
||||
constructor BListView.Create(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BListView_Create(Self,data.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BListView.Destroy;
|
||||
begin
|
||||
BListView_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BListView.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BListView_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BListView_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BListView.Draw(updateRect : BRect);
|
||||
begin
|
||||
//BListView_Draw(CPlusObject, updateRect.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
//BListView_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.MouseDown(where : BPoint);
|
||||
begin
|
||||
//BListView_MouseDown(CPlusObject, where.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
//BListView_KeyDown(CPlusObject, bytes, numBytes);
|
||||
end;
|
||||
|
||||
procedure BListView.MakeFocus(state : boolean);
|
||||
begin
|
||||
//BListView_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BListView.FrameResized(newWidth : double; newHeight : double);
|
||||
begin
|
||||
//BListView_FrameResized(CPlusObject, newWidth, newHeight);
|
||||
end;
|
||||
|
||||
procedure BListView.TargetedByScrollView(scroller : BScrollView);
|
||||
begin
|
||||
BListView_TargetedByScrollView(CPlusObject, scroller.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.ScrollTo(x : double; y : double);
|
||||
begin
|
||||
BListView_ScrollTo(CPlusObject, x, y);
|
||||
end;
|
||||
|
||||
procedure BListView.ScrollTo(where : BPoint);
|
||||
begin
|
||||
BListView_ScrollTo(CPlusObject, where.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.AddItem(item : BListItem) : boolean;
|
||||
begin
|
||||
Result := BListView_AddItem(CPlusObject, item.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.AddItem(item : BListItem; atIndex : integer) : boolean;
|
||||
begin
|
||||
Result := BListView_AddItem(CPlusObject, item.CPlusObject, atIndex);
|
||||
end;
|
||||
|
||||
function BListView.AddList(newItems : BList) : boolean;
|
||||
begin
|
||||
Result := BListView_AddList(CPlusObject, newItems.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.AddList(newItems : BList; atIndex : integer) : boolean;
|
||||
begin
|
||||
Result := BListView_AddList(CPlusObject, newItems.CPlusObject, atIndex);
|
||||
end;
|
||||
|
||||
function BListView.RemoveItem(item : BListItem) : boolean;
|
||||
begin
|
||||
Result := BListView_RemoveItem(CPlusObject, item.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.RemoveItem(index : integer) : BListItem;
|
||||
begin
|
||||
Result := BListView_RemoveItem(CPlusObject, index);
|
||||
end;
|
||||
|
||||
function BListView.RemoveItems(index : integer; count : integer) : boolean;
|
||||
begin
|
||||
Result := BListView_RemoveItems(CPlusObject, index, count);
|
||||
end;
|
||||
|
||||
procedure BListView.SetSelectionMessage(message : BMessage);
|
||||
begin
|
||||
BListView_SetSelectionMessage(CPlusObject, message.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.SetInvocationMessage(message : BMessage);
|
||||
begin
|
||||
BListView_SetInvocationMessage(CPlusObject, message.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.SelectionMessage : BMessage;
|
||||
begin
|
||||
Result := BListView_SelectionMessage(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.SelectionCommand : Cardinal;
|
||||
begin
|
||||
Result := BListView_SelectionCommand(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.InvocationMessage : BMessage;
|
||||
begin
|
||||
Result := BListView_InvocationMessage(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.InvocationCommand : Cardinal;
|
||||
begin
|
||||
Result := BListView_InvocationCommand(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.SetListType(atype : list_view_type);
|
||||
begin
|
||||
BListView_SetListType(CPlusObject, atype);
|
||||
end;
|
||||
|
||||
function BListView.ListType : list_view_type;
|
||||
begin
|
||||
Result := BListView_ListType(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.ItemAt(index : integer) : BListItem;
|
||||
begin
|
||||
Result := BListView_ItemAt(CPlusObject, index);
|
||||
end;
|
||||
|
||||
function BListView.IndexOf(point : BPoint) : integer;
|
||||
begin
|
||||
Result := BListView_IndexOf(CPlusObject, point.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.IndexOf(item : BListItem) : integer;
|
||||
begin
|
||||
Result := BListView_IndexOf(CPlusObject, item.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.FirstItem : BListItem;
|
||||
begin
|
||||
Result := BListView_FirstItem(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.LastItem : BListItem;
|
||||
begin
|
||||
Result := BListView_LastItem(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.HasItem(item : BListItem) : boolean;
|
||||
begin
|
||||
Result := BListView_HasItem(CPlusObject, item.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.CountItems : integer;
|
||||
begin
|
||||
Result := BListView_CountItems(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.MakeEmpty;
|
||||
begin
|
||||
BListView_MakeEmpty(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.IsEmpty : boolean;
|
||||
begin
|
||||
Result := BListView_IsEmpty(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.Items : BListView;
|
||||
begin
|
||||
Result := BListView_Items(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.InvalidateItem(index : integer);
|
||||
begin
|
||||
BListView_InvalidateItem(CPlusObject, index);
|
||||
end;
|
||||
|
||||
procedure BListView.ScrollToSelection;
|
||||
begin
|
||||
BListView_ScrollToSelection(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.Select(index : integer; extend : boolean);
|
||||
begin
|
||||
BListView_Select(CPlusObject, index, extend);
|
||||
end;
|
||||
|
||||
procedure BListView.Select(from : integer; ato : integer; extend : boolean);
|
||||
begin
|
||||
BListView_Select(CPlusObject, from, ato, extend);
|
||||
end;
|
||||
|
||||
function BListView.IsItemSelected(index : integer) : boolean;
|
||||
begin
|
||||
Result := BListView_IsItemSelected(CPlusObject, index);
|
||||
end;
|
||||
|
||||
function BListView.CurrentSelection(index : integer) : integer;
|
||||
begin
|
||||
Result := BListView_CurrentSelection(CPlusObject, index);
|
||||
end;
|
||||
|
||||
function BListView.Invoke(msg : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BListView_Invoke(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.DeselectAll;
|
||||
begin
|
||||
BListView_DeselectAll(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.DeselectExcept(except_from : integer; except_to : integer);
|
||||
begin
|
||||
BListView_DeselectExcept(CPlusObject, except_from, except_to);
|
||||
end;
|
||||
|
||||
procedure BListView.Deselect(index : integer);
|
||||
begin
|
||||
BListView_Deselect(CPlusObject, index);
|
||||
end;
|
||||
|
||||
procedure BListView.SelectionChanged;
|
||||
begin
|
||||
//BListView_SelectionChanged(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.SwapItems(a : integer; b : integer) : boolean;
|
||||
begin
|
||||
Result := BListView_SwapItems(CPlusObject, a, b);
|
||||
end;
|
||||
|
||||
function BListView.MoveItem(from : integer; ato : integer) : boolean;
|
||||
begin
|
||||
Result := BListView_MoveItem(CPlusObject, from, ato);
|
||||
end;
|
||||
|
||||
function BListView.ReplaceItem(index : integer; item : BListItem) : boolean;
|
||||
begin
|
||||
Result := BListView_ReplaceItem(CPlusObject, index, item.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.AttachedToWindow;
|
||||
begin
|
||||
//BListView_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
//BListView_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.ItemFrame(index : integer) : BRect;
|
||||
begin
|
||||
Result := BListView_ItemFrame(CPlusObject, index);
|
||||
end;
|
||||
|
||||
function BListView.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BListView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
function BListView.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BListView_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BListView_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
procedure BListView.WindowActivated(state : boolean);
|
||||
begin
|
||||
//BListView_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BListView.MouseUp(pt : BPoint);
|
||||
begin
|
||||
//BListView_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
//BListView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BListView.DetachedFromWindow;
|
||||
begin
|
||||
//BListView_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
function BListView.InitiateDrag(pt : BPoint; itemIndex : integer; initialySelected : boolean) : boolean;
|
||||
begin
|
||||
Result := BListView_InitiateDrag(CPlusObject, pt.CPlusObject, itemIndex, initialySelected);
|
||||
end;
|
||||
|
||||
procedure BListView.ResizeToPreferred;
|
||||
begin
|
||||
//BListView_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
// BListView_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BListView.AllAttached;
|
||||
begin
|
||||
//BListView_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BListView.AllDetached;
|
||||
begin
|
||||
//BListView_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure ListItem_SelectionChanged_hook_func(Liste : BListView); cdecl;
|
||||
begin
|
||||
try
|
||||
if Liste <> nil then
|
||||
begin
|
||||
Liste.SelectionChanged;
|
||||
end;
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure ListString_InitiateDrag_hook_func(Liste : BListView); cdecl;
|
||||
begin
|
||||
try
|
||||
if Liste <> nil then
|
||||
begin
|
||||
Liste.SelectionChanged;
|
||||
end;
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
ListItem_SelectionChanged_hook:=@ListItem_SelectionChanged_hook_func;
|
||||
ListString_InitiateDrag_hook:=@ListString_InitiateDrag_hook_func;
|
||||
end.
|
||||
1945
bepascal/source/bepascal/pas/src/be/interface/menu.pp
Normal file
1945
bepascal/source/bepascal/pas/src/be/interface/menu.pp
Normal file
File diff suppressed because it is too large
Load Diff
310
bepascal/source/bepascal/pas/src/be/interface/menubar.pp
Normal file
310
bepascal/source/bepascal/pas/src/be/interface/menubar.pp
Normal file
@@ -0,0 +1,310 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit menubar;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, menu, SupportDefs, Message, Rect, archivable, handler;
|
||||
|
||||
type
|
||||
Menu_Bar_Border = (B_BORDER_FRAME,
|
||||
B_BORDER_CONTENTS,
|
||||
B_BORDER_EACH_ITEM);
|
||||
BMenuBar = class(BMenu)
|
||||
private
|
||||
public
|
||||
constructor Create(frame : BRect; viewName : PChar; resizingMode : Cardinal; layout : Menu_Layout; resizeToFit : boolean);
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure SetBorder(aBorder : Menu_Bar_Border);
|
||||
function Border : Menu_Bar_Border;
|
||||
procedure Draw(updateRect : BRect); override;
|
||||
procedure AttachedToWindow; override;
|
||||
procedure DetachedFromWindow; override;
|
||||
procedure MessageReceived(msg : BMessage); override;
|
||||
procedure MouseDown(where : BPoint); override;
|
||||
procedure WindowActivated(state : boolean); override;
|
||||
procedure MouseUp(where : BPoint); override;
|
||||
procedure FrameMoved(new_position : BPoint); override;
|
||||
procedure FrameResized(new_width : double; new_height : double); override;
|
||||
procedure Show;
|
||||
procedure Hide;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; aProperty : PChar) : BHandler;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
procedure ResizeToPreferred; override;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure MakeFocus(state : boolean);
|
||||
procedure AllAttached; override;
|
||||
procedure AllDetached; override;
|
||||
end;
|
||||
|
||||
function BMenuBar_Create(AObject : TBeObject; frame : TCPlusObject; viewName : PChar; resizingMode : Cardinal; layout : Integer; resizeToFit : boolean) : TCPlusObject; cdecl; external BePascalLibName name 'BMenuBar_Create';
|
||||
//function BMenuBar_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BMenuBar_Create';
|
||||
procedure BMenuBar_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_Free';
|
||||
function BMenuBar_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BMenuBar_Instantiate';
|
||||
function BMenuBar_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BMenuBar_Archive';
|
||||
procedure BMenuBar_SetBorder(AObject : TCPlusObject; aBorder : Menu_Bar_Border); cdecl; external BePascalLibName name 'BMenuBar_SetBorder';
|
||||
function BMenuBar_Border(AObject : TCPlusObject) : Menu_Bar_Border; cdecl; external BePascalLibName name 'BMenuBar_Border';
|
||||
procedure BMenuBar_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_Draw';
|
||||
procedure BMenuBar_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_AttachedToWindow';
|
||||
procedure BMenuBar_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_DetachedFromWindow';
|
||||
procedure BMenuBar_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_MessageReceived';
|
||||
procedure BMenuBar_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_MouseDown';
|
||||
procedure BMenuBar_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenuBar_WindowActivated';
|
||||
procedure BMenuBar_MouseUp(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_MouseUp';
|
||||
procedure BMenuBar_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_FrameMoved';
|
||||
procedure BMenuBar_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BMenuBar_FrameResized';
|
||||
procedure BMenuBar_Show(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_Show';
|
||||
procedure BMenuBar_Hide(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_Hide';
|
||||
function BMenuBar_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; aProperty : PChar) : BHandler; cdecl; external BePascalLibName name 'BMenuBar_ResolveSpecifier';
|
||||
function BMenuBar_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BMenuBar_GetSupportedSuites';
|
||||
procedure BMenuBar_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_ResizeToPreferred';
|
||||
procedure BMenuBar_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BMenuBar_GetPreferredSize';
|
||||
procedure BMenuBar_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BMenuBar_MakeFocus';
|
||||
procedure BMenuBar_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_AllAttached';
|
||||
procedure BMenuBar_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BMenuBar_AllDetached';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BMenuBar.Create(frame : BRect; viewName : PChar; resizingMode : Cardinal; layout : Menu_Layout; resizeToFit : boolean);
|
||||
begin
|
||||
CPlusObject := BMenuBar_Create(Self, frame.CPlusObject, viewName, resizingMode, 0, resizeToFit);
|
||||
end;
|
||||
|
||||
constructor BMenuBar.Create;
|
||||
begin
|
||||
CreatePas;
|
||||
// CPlusObject := BMenuBar_Create_1(Self);
|
||||
end;
|
||||
|
||||
destructor BMenuBar.Destroy;
|
||||
begin
|
||||
BMenuBar_Free(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMenuBar.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BMenuBar_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BMenuBar.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BMenuBar_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.SetBorder(aBorder : Menu_Bar_Border);
|
||||
begin
|
||||
BMenuBar_SetBorder(CPlusObject, aBorder);
|
||||
end;
|
||||
|
||||
function BMenuBar.Border : Menu_Bar_Border;
|
||||
begin
|
||||
Result := BMenuBar_Border(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.Draw(updateRect : BRect);
|
||||
begin
|
||||
// BMenuBar_Draw(CPlusObject, updateRect.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.AttachedToWindow;
|
||||
begin
|
||||
// BMenuBar_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.DetachedFromWindow;
|
||||
begin
|
||||
// BMenuBar_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
// BMenuBar_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.MouseDown(where : BPoint);
|
||||
begin
|
||||
// BMenuBar_MouseDown(CPlusObject, where.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.WindowActivated(state : boolean);
|
||||
begin
|
||||
// BMenuBar_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.MouseUp(where : BPoint);
|
||||
begin
|
||||
// BMenuBar_MouseUp(CPlusObject, where.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
// BMenuBar_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
// BMenuBar_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.Show;
|
||||
begin
|
||||
BMenuBar_Show(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.Hide;
|
||||
begin
|
||||
BMenuBar_Hide(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMenuBar.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; aProperty : PChar) : BHandler;
|
||||
begin
|
||||
Result := BMenuBar_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, aProperty);
|
||||
end;
|
||||
|
||||
function BMenuBar.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BMenuBar_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.ResizeToPreferred;
|
||||
begin
|
||||
// BMenuBar_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
// BMenuBar_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.MakeFocus(state : boolean);
|
||||
begin
|
||||
// BMenuBar_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.AllAttached;
|
||||
begin
|
||||
// BMenuBar_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.AllDetached;
|
||||
begin
|
||||
// BMenuBar_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
{function BMenuBar.Perform(d : TPerform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BMenuBar_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
procedure BMenuBar._ReservedMenuBar1;
|
||||
begin
|
||||
BMenuBar__ReservedMenuBar1(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar._ReservedMenuBar2;
|
||||
begin
|
||||
BMenuBar__ReservedMenuBar2(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar._ReservedMenuBar3;
|
||||
begin
|
||||
BMenuBar__ReservedMenuBar3(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar._ReservedMenuBar4;
|
||||
begin
|
||||
BMenuBar__ReservedMenuBar4(CPlusObject);
|
||||
end;
|
||||
|
||||
function BMenuBar.operator=( : BMenuBar) : BMenuBar;
|
||||
begin
|
||||
Result := BMenuBar_operator=(CPlusObject, );
|
||||
end;
|
||||
|
||||
procedure BMenuBar.StarBMenuBar(menuIndex : integer; sticky : boolean; show_menu : boolean; special_rect : BRect);
|
||||
begin
|
||||
BMenuBar_StarBMenuBar(CPlusObject, menuIndex, sticky, show_menu, special_rect.CPlusObject);
|
||||
end;
|
||||
|
||||
function BMenuBar.TrackTask(arg : Pointer) : integer;
|
||||
begin
|
||||
Result := BMenuBar_TrackTask(CPlusObject, arg);
|
||||
end;
|
||||
|
||||
function BMenuBar.Track(action : ^integer; startIndex : integer; showMenu : boolean) : TMenuItem;
|
||||
begin
|
||||
Result := BMenuBar_Track(CPlusObject, action, startIndex, showMenu);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.StealFocus;
|
||||
begin
|
||||
BMenuBar_StealFocus(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.RestoreFocus;
|
||||
begin
|
||||
BMenuBar_RestoreFocus(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.InitData(layout : BMenu_Layout);
|
||||
begin
|
||||
BMenuBar_InitData(CPlusObject, layout);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.menu_bar_border fBorder;
|
||||
begin
|
||||
BMenuBar_menu_bar_border fBorder(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.thread_id fTrackingPID;
|
||||
begin
|
||||
BMenuBar_thread_id fTrackingPID(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.int32 fPrevFocusToken;
|
||||
begin
|
||||
BMenuBar_int32 fPrevFocusToken(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.sem_id fMenuSem;
|
||||
begin
|
||||
BMenuBar_sem_id fMenuSem(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.BRect *fLastBounds;
|
||||
begin
|
||||
BMenuBar_BRect *fLastBounds(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.uint32 _reserved[2];
|
||||
begin
|
||||
BMenuBar_uint32 _reserved[2](CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BMenuBar.bool fTracking;
|
||||
begin
|
||||
BMenuBar_bool fTracking(CPlusObject);
|
||||
end;
|
||||
}
|
||||
|
||||
end.
|
||||
357
bepascal/source/bepascal/pas/src/be/interface/outlinelistview.pp
Normal file
357
bepascal/source/bepascal/pas/src/be/interface/outlinelistview.pp
Normal file
@@ -0,0 +1,357 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit outlinelistview;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, view, message, archivable, SupportDefs, rect, list,
|
||||
handler, messenger,interfacedefs,font,graphicdefs,scrollview,listitem,listview;
|
||||
|
||||
type
|
||||
BOutlineListView = class(BListView)
|
||||
private
|
||||
public
|
||||
constructor Create(frame : BRect; name : pchar; atype : List_view_type; resizeMask: longint; flags : longint); override;
|
||||
constructor Create(data : BMessage);
|
||||
destructor Destroy;override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure MouseDown(where : BPoint);override;
|
||||
procedure KeyDown(bytes : PChar; numBytes : integer);override;
|
||||
procedure FrameMoved(new_position : BPoint);override;
|
||||
procedure FrameResized(new_width : double; new_height : double);override;
|
||||
procedure MouseUp(where : BPoint);override;
|
||||
function AddUnder(item : BListItem; underItem : BListItem) : boolean;
|
||||
function AddItem(item : BListItem) : boolean;
|
||||
function AddItem(item : BListItem; fullListIndex : integer) : boolean;
|
||||
function AddList(newItems : BList) : boolean;
|
||||
function AddList(newItems : BList; fullListIndex : integer) : boolean;
|
||||
function RemoveItem(item : BListItem) : boolean;
|
||||
function RemoveItem(fullListIndex : integer) : BListItem;
|
||||
function RemoveItems(fullListIndex : integer; count : integer) : boolean;
|
||||
function FullListItemAt(fullListIndex : integer) : BListItem;
|
||||
function FullListIndexOf(point : BPoint) : integer;
|
||||
function FullListIndexOf(item : BListItem) : integer;
|
||||
function FullListFirstItem : BListItem;
|
||||
function FullListLastItem : BListItem;
|
||||
function FullListHasItem(item : BListItem) : boolean;
|
||||
function FullListCountItems : integer;
|
||||
function FullListCurrentSelection(index : integer) : integer;
|
||||
procedure MakeEmpty;
|
||||
function FullListIsEmpty : boolean;
|
||||
function Superitem(item : BListItem) : BListItem;
|
||||
procedure Expand(item : BListItem);
|
||||
procedure Collapse(item : BListItem);
|
||||
function IsExpanded(fullListIndex : integer) : boolean;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
procedure ResizeToPreferred;override;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure MakeFocus(state : boolean);
|
||||
procedure AllAttached;override;
|
||||
procedure AllDetached;override;
|
||||
procedure DetachedFromWindow;override;
|
||||
function CountItemsUnder(under : BListItem; oneLevelOnly : boolean) : integer;
|
||||
function ItemUnderAt(underItem : BListItem; oneLevelOnly : boolean; index : integer) : BListItem;
|
||||
// function DoMiscellaneous(code : ; data : ) : boolean;
|
||||
// procedure MessageReceived( : BMessage);
|
||||
end;
|
||||
|
||||
function BOutlineListView_Create(AObject : TBeObject; frame : TCPlusObject; name : pchar; atype : list_view_type; resizeMask: longint; flags : longint):TCPlusObject; cdecl; external BePascalLibName name 'BOutlineListView_Create';
|
||||
function BOutlineListView_Create_1(AObject : TBeObject;data : TCPlusObject):TCPlusObject; cdecl; external BePascalLibName name 'BOutlineListView_Create_1';
|
||||
procedure BOutlineListView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_Free';
|
||||
function BOutlineListView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BOutlineListView_Instantiate';
|
||||
function BOutlineListView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BOutlineListView_Archive';
|
||||
procedure BOutlineListView_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_MouseDown';
|
||||
procedure BOutlineListView_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BOutlineListView_KeyDown';
|
||||
procedure BOutlineListView_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_FrameMoved';
|
||||
procedure BOutlineListView_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BOutlineListView_FrameResized';
|
||||
procedure BOutlineListView_MouseUp(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_MouseUp';
|
||||
function BOutlineListView_AddUnder(AObject : TCPlusObject; item : TCPlusObject; underItem : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_AddUnder';
|
||||
function BOutlineListView_AddItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_AddItem';
|
||||
function BOutlineListView_AddItem(AObject : TCPlusObject; item : TCPlusObject; fullListIndex : integer) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_AddItem';
|
||||
function BOutlineListView_AddList(AObject : TCPlusObject; newItems : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_AddList';
|
||||
function BOutlineListView_AddList(AObject : TCPlusObject; newItems : TCPlusObject; fullListIndex : integer) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_AddList';
|
||||
function BOutlineListView_RemoveItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_RemoveItem';
|
||||
function BOutlineListView_RemoveItem_1(AObject : TCPlusObject; fullListIndex : integer) : TCPlusObject; cdecl; external BePascalLibName name 'BOutlineListView_RemoveItem_1';
|
||||
function BOutlineListView_RemoveItems(AObject : TCPlusObject; fullListIndex : integer; count : integer) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_RemoveItems';
|
||||
function BOutlineListView_FullListItemAt(AObject : TCPlusObject; fullListIndex : integer) : BListItem; cdecl; external BePascalLibName name 'BOutlineListView_FullListItemAt';
|
||||
function BOutlineListView_FullListIndexOf(AObject : TCPlusObject; point : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BOutlineListView_FullListIndexOf';
|
||||
function BOutlineListView_FullListIndexOf_1(AObject : TCPlusObject; item : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BOutlineListView_FullListIndexOf_1';
|
||||
function BOutlineListView_FullListFirstItem(AObject : TCPlusObject) : BListItem; cdecl; external BePascalLibName name 'BOutlineListView_FullListFirstItem';
|
||||
function BOutlineListView_FullListLastItem(AObject : TCPlusObject) : BListItem; cdecl; external BePascalLibName name 'BOutlineListView_FullListLastItem';
|
||||
function BOutlineListView_FullListHasItem(AObject : TCPlusObject; item : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_FullListHasItem';
|
||||
function BOutlineListView_FullListCountItems(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BOutlineListView_FullListCountItems';
|
||||
function BOutlineListView_FullListCurrentSelection(AObject : TCPlusObject; index : integer) : integer; cdecl; external BePascalLibName name 'BOutlineListView_FullListCurrentSelection';
|
||||
procedure BOutlineListView_MakeEmpty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_MakeEmpty';
|
||||
function BOutlineListView_FullListIsEmpty(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_FullListIsEmpty';
|
||||
function BOutlineListView_Superitem(AObject : TCPlusObject; item : TCPlusObject) : BListItem; cdecl; external BePascalLibName name 'BOutlineListView_Superitem';
|
||||
procedure BOutlineListView_Expand(AObject : TCPlusObject; item : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_Expand';
|
||||
procedure BOutlineListView_Collapse(AObject : TCPlusObject; item : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_Collapse';
|
||||
function BOutlineListView_IsExpanded(AObject : TCPlusObject; fullListIndex : integer) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_IsExpanded';
|
||||
function BOutlineListView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BOutlineListView_ResolveSpecifier';
|
||||
function BOutlineListView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BOutlineListView_GetSupportedSuites';
|
||||
function BOutlineListView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BOutlineListView_Perform';
|
||||
procedure BOutlineListView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_ResizeToPreferred';
|
||||
procedure BOutlineListView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BOutlineListView_GetPreferredSize';
|
||||
procedure BOutlineListView_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BOutlineListView_MakeFocus';
|
||||
procedure BOutlineListView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_AllAttached';
|
||||
procedure BOutlineListView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_AllDetached';
|
||||
procedure BOutlineListView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_DetachedFromWindow';
|
||||
function BOutlineListView_CountItemsUnder(AObject : TCPlusObject; under : TCPlusObject; oneLevelOnly : boolean) : integer; cdecl; external BePascalLibName name 'BOutlineListView_CountItemsUnder';
|
||||
function BOutlineListView_ItemUnderAt(AObject : TCPlusObject; underItem : TCPlusObject; oneLevelOnly : boolean; index : integer) : BListItem; cdecl; external BePascalLibName name 'BOutlineListView_ItemUnderAt';
|
||||
//function BOutlineListView_DoMiscellaneous(AObject : TCPlusObject; code : ; data : ) : boolean; cdecl; external BePascalLibName name 'BOutlineListView_DoMiscellaneous';
|
||||
//procedure BOutlineListView_MessageReceived(AObject : TCPlusObject; : TCPlusObject); cdecl; external BePascalLibName name 'BOutlineListView_MessageReceived';
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
constructor BOutlineListView.Create(frame : BRect; name : pchar; atype : list_view_type; resizeMask: longint; flags : longint);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BOutlineListView_Create(Self,frame.CPlusObject,name,atype,resizeMask,flags);
|
||||
end;
|
||||
|
||||
constructor BOutlineListView.Create(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BOutlineListView_Create_1(Self,data.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BOutlineListView.Destroy;
|
||||
begin
|
||||
BOutlineListView_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BOutlineListView.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BOutlineListView_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BOutlineListView_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.MouseDown(where : BPoint);
|
||||
begin
|
||||
// BOutlineListView_MouseDown(CPlusObject, where.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
// BOutlineListView_KeyDown(CPlusObject, bytes, numBytes);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
// BOutlineListView_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
// BOutlineListView_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.MouseUp(where : BPoint);
|
||||
begin
|
||||
// BOutlineListView_MouseUp(CPlusObject, where.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.AddUnder(item : BListItem; underItem : BListItem) : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_AddUnder(CPlusObject, item.CPlusObject, underItem.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.AddItem(item : BListItem) : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_AddItem(CPlusObject, item.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.AddItem(item : BListItem; fullListIndex : integer) : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_AddItem(CPlusObject, item.CPlusObject, fullListIndex);
|
||||
end;
|
||||
|
||||
function BOutlineListView.AddList(newItems : BList) : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_AddList(CPlusObject, newItems.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.AddList(newItems : BList; fullListIndex : integer) : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_AddList(CPlusObject, newItems.CPlusObject, fullListIndex);
|
||||
end;
|
||||
|
||||
function BOutlineListView.RemoveItem(item : BListItem) : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_RemoveItem(CPlusObject, item.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.RemoveItem(fullListIndex : integer) : BListItem;
|
||||
begin
|
||||
// Result := BOutlineListView_RemoveItem_1(CPlusObject, fullListIndex);
|
||||
end;
|
||||
|
||||
function BOutlineListView.RemoveItems(fullListIndex : integer; count : integer) : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_RemoveItems(CPlusObject, fullListIndex, count);
|
||||
end;
|
||||
|
||||
function BOutlineListView.FullListItemAt(fullListIndex : integer) : BListItem;
|
||||
begin
|
||||
Result := BOutlineListView_FullListItemAt(CPlusObject, fullListIndex);
|
||||
end;
|
||||
|
||||
function BOutlineListView.FullListIndexOf(point : BPoint) : integer;
|
||||
begin
|
||||
Result := BOutlineListView_FullListIndexOf(CPlusObject, point.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.FullListIndexOf(item : BListItem) : integer;
|
||||
begin
|
||||
Result := BOutlineListView_FullListIndexOf(CPlusObject, item.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.FullListFirstItem : BListItem;
|
||||
begin
|
||||
Result := BOutlineListView_FullListFirstItem(CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.FullListLastItem : BListItem;
|
||||
begin
|
||||
Result := BOutlineListView_FullListLastItem(CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.FullListHasItem(item : BListItem) : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_FullListHasItem(CPlusObject, item.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.FullListCountItems : integer;
|
||||
begin
|
||||
Result := BOutlineListView_FullListCountItems(CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.FullListCurrentSelection(index : integer) : integer;
|
||||
begin
|
||||
Result := BOutlineListView_FullListCurrentSelection(CPlusObject, index);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.MakeEmpty;
|
||||
begin
|
||||
BOutlineListView_MakeEmpty(CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.FullListIsEmpty : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_FullListIsEmpty(CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.Superitem(item : BListItem) : BListItem;
|
||||
begin
|
||||
Result := BOutlineListView_Superitem(CPlusObject, item);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.Expand(item : BListItem);
|
||||
begin
|
||||
BOutlineListView_Expand(CPlusObject, item.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.Collapse(item : BListItem);
|
||||
begin
|
||||
BOutlineListView_Collapse(CPlusObject, item.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.IsExpanded(fullListIndex : integer) : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_IsExpanded(CPlusObject, fullListIndex);
|
||||
end;
|
||||
|
||||
function BOutlineListView.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BOutlineListView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
function BOutlineListView.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BOutlineListView_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BOutlineListView_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.ResizeToPreferred;
|
||||
begin
|
||||
BOutlineListView_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BOutlineListView_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.MakeFocus(state : boolean);
|
||||
begin
|
||||
BOutlineListView_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.AllAttached;
|
||||
begin
|
||||
BOutlineListView_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.AllDetached;
|
||||
begin
|
||||
BOutlineListView_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.DetachedFromWindow;
|
||||
begin
|
||||
BOutlineListView_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
function BOutlineListView.CountItemsUnder(under : BListItem; oneLevelOnly : boolean) : integer;
|
||||
begin
|
||||
Result := BOutlineListView_CountItemsUnder(CPlusObject, under.CPlusObject, oneLevelOnly);
|
||||
end;
|
||||
|
||||
function BOutlineListView.ItemUnderAt(underItem : BListItem; oneLevelOnly : boolean; index : integer) : BListItem;
|
||||
begin
|
||||
Result := BOutlineListView_ItemUnderAt(CPlusObject, underItem.CPlusObject, oneLevelOnly, index);
|
||||
end;
|
||||
|
||||
{function BOutlineListView.DoMiscellaneous(code : ; data : ) : boolean;
|
||||
begin
|
||||
Result := BOutlineListView_DoMiscellaneous(CPlusObject, code, data);
|
||||
end;
|
||||
|
||||
procedure BOutlineListView.MessageReceived( : BMessage);
|
||||
begin
|
||||
BOutlineListView_MessageReceived(CPlusObject, .CPlusObject);
|
||||
end;
|
||||
}
|
||||
|
||||
|
||||
end.
|
||||
270
bepascal/source/bepascal/pas/src/be/interface/radiobutton.pp
Normal file
270
bepascal/source/bepascal/pas/src/be/interface/radiobutton.pp
Normal file
@@ -0,0 +1,270 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2003 Olivier Coursiere
|
||||
Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit radiobutton;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, Control, Message, Archivable, SupportDefs, Rect, Handler;
|
||||
|
||||
type
|
||||
BRadioButton = class(BControl)
|
||||
private
|
||||
public
|
||||
constructor Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal); virtual;
|
||||
constructor Create(data : BMessage); override;
|
||||
destructor Destroy; override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure Draw(updateRect : BRect); override;
|
||||
procedure MouseDown(where : BPoint); override;
|
||||
procedure AttachedToWindow; override;
|
||||
procedure KeyDown(bytes : PChar; numBytes : integer); override;
|
||||
procedure SetValue(aValue : integer);
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure ResizeToPreferred; override;
|
||||
function Invoke(msg : BMessage) : Status_t;
|
||||
procedure MessageReceived(msg : BMessage); override;
|
||||
procedure WindowActivated(state : boolean); override;
|
||||
procedure MouseUp(pt : BPoint); override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); override;
|
||||
procedure DetachedFromWindow; override;
|
||||
procedure FrameMoved(new_position : BPoint); override;
|
||||
procedure FrameResized(new_width : double; new_height : double); override;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
procedure MakeFocus(state : boolean); override;
|
||||
procedure AllAttached; override;
|
||||
procedure AllDetached; override;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
// procedure _ReservedRadioButton1;
|
||||
// procedure _ReservedRadioButton2;
|
||||
// function operator=( : BRadioButton) : BRadioButton;
|
||||
// procedure BBitmap *sBitmaps[2][3];
|
||||
// procedure bool fOutlined;
|
||||
// procedure uint32 _reserved[2];
|
||||
end;
|
||||
|
||||
function BRadioButton_Create(AObject : TBeObject; frame : TCPlusObject;
|
||||
name, aLabel : PChar; message : TCPlusObject;
|
||||
resizingMode, flags : Cardinal) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BRadioButton_Create';
|
||||
function BRadioButton_Create_1(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRadioButton_Create_1';
|
||||
|
||||
procedure BRadioButton_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_FREE';
|
||||
|
||||
function BRadioButton_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BRadioButton_Instantiate';
|
||||
function BRadioButton_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Archive';
|
||||
procedure BRadioButton_Draw(AObject : TCPlusObject; updateRect : BRect); cdecl; external BePascalLibName name 'BRadioButton_Draw';
|
||||
procedure BRadioButton_MouseDown(AObject : TCPlusObject; where : BPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseDown';
|
||||
procedure BRadioButton_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AttachedToWindow';
|
||||
procedure BRadioButton_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BRadioButton_KeyDown';
|
||||
procedure BRadioButton_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BRadioButton_SetValue';
|
||||
procedure BRadioButton_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BRadioButton_GetPreferredSize';
|
||||
procedure BRadioButton_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_ResizeToPreferred';
|
||||
function BRadioButton_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Invoke';
|
||||
procedure BRadioButton_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_MessageReceived';
|
||||
procedure BRadioButton_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BRadioButton_WindowActivated';
|
||||
procedure BRadioButton_MouseUp(AObject : TCPlusObject; pt : BPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseUp';
|
||||
procedure BRadioButton_MouseMoved(AObject : TCPlusObject; pt : BPoint; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_MouseMoved';
|
||||
procedure BRadioButton_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_DetachedFromWindow';
|
||||
procedure BRadioButton_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_FrameMoved';
|
||||
procedure BRadioButton_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BRadioButton_FrameResized';
|
||||
function BRadioButton_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BRadioButton_ResolveSpecifier';
|
||||
procedure BRadioButton_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BRadioButton_MakeFocus';
|
||||
procedure BRadioButton_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AllAttached';
|
||||
procedure BRadioButton_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AllDetached';
|
||||
function BRadioButton_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_GetSupportedSuites';
|
||||
function BRadioButton_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Perform';
|
||||
//procedure BRadioButton__ReservedRadioButton1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton__ReservedRadioButton1';
|
||||
//procedure BRadioButton__ReservedRadioButton2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton__ReservedRadioButton2';
|
||||
//function BRadioButton_operator=(AObject : TCPlusObject; : BRadioButton) : BRadioButton; cdecl; external BePascalLibName name 'BRadioButton_operator=';
|
||||
//procedure BRadioButton_BBitmap *sBitmaps[2][3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_BBitmap *sBitmaps[2][3]';
|
||||
//procedure BRadioButton_bool fOutlined(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_bool fOutlined';
|
||||
//procedure BRadioButton_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_uint32 _reserved[2]';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BRadioButton.Create(frame : BRect; name, aLabel : PChar; message : BMessage; resizingMode, flags : Cardinal);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BRadioButton_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags);
|
||||
end;
|
||||
|
||||
constructor BRadioButton.Create(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BRadioButton_Create_1(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BRadioButton.Destroy;
|
||||
begin
|
||||
BRadioButton_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BRadioButton.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BRadioButton_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BRadioButton.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BRadioButton_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.Draw(updateRect : BRect);
|
||||
begin
|
||||
// BRadioButton_Draw(CPlusObject, updateRect.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.MouseDown(where : BPoint);
|
||||
begin
|
||||
// BRadioButton_MouseDown(CPlusObject, where.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.AttachedToWindow;
|
||||
begin
|
||||
// BRadioButton_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
// BRadioButton_KeyDown(CPlusObject, bytes, numBytes);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.SetValue(aValue : integer);
|
||||
begin
|
||||
BRadioButton_SetValue(CPlusObject, aValue);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BRadioButton_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.ResizeToPreferred;
|
||||
begin
|
||||
BRadioButton_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
function BRadioButton.Invoke(msg : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BRadioButton_Invoke(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
// BRadioButton_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.WindowActivated(state : boolean);
|
||||
begin
|
||||
// BRadioButton_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.MouseUp(pt : BPoint);
|
||||
begin
|
||||
// BRadioButton_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
// BRadioButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.DetachedFromWindow;
|
||||
begin
|
||||
// BRadioButton_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
// BRadioButton_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
// BRadioButton_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
function BRadioButton.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BRadioButton_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.MakeFocus(state : boolean);
|
||||
begin
|
||||
BRadioButton_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.AllAttached;
|
||||
begin
|
||||
// BRadioButton_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.AllDetached;
|
||||
begin
|
||||
// BRadioButton_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
function BRadioButton.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BRadioButton_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BRadioButton.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BRadioButton_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
{
|
||||
procedure BRadioButton._ReservedRadioButton1;
|
||||
begin
|
||||
BRadioButton__ReservedRadioButton1(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton._ReservedRadioButton2;
|
||||
begin
|
||||
BRadioButton__ReservedRadioButton2(CPlusObject);
|
||||
end;
|
||||
|
||||
function BRadioButton.operator=( : BRadioButton) : BRadioButton;
|
||||
begin
|
||||
Result := BRadioButton_operator=(CPlusObject, );
|
||||
end;
|
||||
|
||||
procedure BRadioButton.BBitmap *sBitmaps[2][3];
|
||||
begin
|
||||
BRadioButton_BBitmap *sBitmaps[2][3](CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.bool fOutlined;
|
||||
begin
|
||||
BRadioButton_bool fOutlined(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BRadioButton.uint32 _reserved[2];
|
||||
begin
|
||||
BRadioButton_uint32 _reserved[2](CPlusObject);
|
||||
end;
|
||||
}
|
||||
|
||||
end.
|
||||
144
bepascal/source/bepascal/pas/src/be/interface/rect.pp
Normal file
144
bepascal/source/bepascal/pas/src/be/interface/rect.pp
Normal file
@@ -0,0 +1,144 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit rect;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj;
|
||||
|
||||
type
|
||||
// BPoint and BRect are defined in the same unit to avoid circular reference
|
||||
BPoint = class;
|
||||
BRect = class(TBeObject)
|
||||
public
|
||||
constructor Create; override;
|
||||
constructor Create(rect : BRect); virtual; // Problème de référence circulaire avec BPoint
|
||||
constructor Create(l, t, r, b : single); virtual;
|
||||
constructor Create(leftTop, rightBottom : BPoint); virtual;
|
||||
destructor Destroy; override;
|
||||
procedure PrintToStream;
|
||||
end;
|
||||
|
||||
function BRect_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_1';
|
||||
function BRect_Create(AObject : TBeObject; rect : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_2';
|
||||
function BRect_Create(AObject : TBeObject; l, t, r, b : single) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_3';
|
||||
function BRect_Create(AObject : TBeObject; leftTop, rightBottom : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_4';
|
||||
procedure BRect_Free(rect : TCPlusObject); cdecl; external BePascalLibName name 'BRect_Free';
|
||||
procedure BRect_PrintToStream(Rect : TCPlusObject); cdecl; external bePascalLibName name 'BRect_PrintToStream';
|
||||
|
||||
type
|
||||
BPoint = class(TBeObject)
|
||||
public
|
||||
constructor Create; override;
|
||||
constructor Create(x, y : single); virtual;
|
||||
constructor Create(point : BPoint); virtual;
|
||||
destructor Destroy; override;
|
||||
procedure ConstrainTo(Rect : BRect);
|
||||
procedure PrintToStream;
|
||||
procedure Sept(x, y : single);
|
||||
end;
|
||||
|
||||
function BPoint_Create(AObject : TBeObject; x, y : single) : TCPlusObject; cdecl; external BePascalLibName name 'BPoint_Create_1';
|
||||
function BPoint_Create(AObject : TBeObject; point : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BPoint_Create_2';
|
||||
function BPoint_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BPoint_Create_3';
|
||||
procedure BPoint_Free(Point : TCPlusObject); cdecl; external BePascalLibName name 'BPoint_Free';
|
||||
procedure BPoint_ConstrainTo(Point : TCPlusObject; Rect : TCPlusObject); cdecl; external BePascalLibName name 'BPoint_ConstrainTo';
|
||||
procedure BPoint_PrintToStream(Point : TCPlusObject); cdecl; external bePascalLibName name 'BPoint_PrintToStream';
|
||||
procedure BPoint_Set(Point : TCPlusObject; x, y : single); cdecl; external BePascalLibName name 'BPoint_Set';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BRect.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BRect_Create(Self);
|
||||
end;
|
||||
|
||||
constructor BRect.Create(rect : BRect);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BRect_Create(Self, rect.CPlusObject);
|
||||
end;
|
||||
|
||||
constructor BRect.Create(l, t, r, b : single);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BRect_Create(Self, l, t, r, b);
|
||||
end;
|
||||
|
||||
constructor BRect.Create(leftTop, rightBottom : BPoint);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BRect_Create(Self, leftTop.CPlusObject, rightBottom.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BRect.Destroy;
|
||||
begin
|
||||
BRect_Free(CPlusObject);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure BRect.PrintToStream;
|
||||
begin
|
||||
BRect_PrintToStream(CPlusObject);
|
||||
end;
|
||||
|
||||
constructor BPoint.Create(x, y : single);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BPoint_Create(Self, x, y);
|
||||
end;
|
||||
|
||||
constructor BPoint.Create(point : BPoint);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BPoint_Create(Self, point.CPlusObject)
|
||||
end;
|
||||
|
||||
constructor BPoint.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BPoint_Create(Self);
|
||||
end;
|
||||
|
||||
destructor BPoint.Destroy;
|
||||
begin
|
||||
BPoint_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure BPoint.ConstrainTo(Rect : BRect);
|
||||
begin
|
||||
BPoint_ConstrainTo(CPlusObject, Rect.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BPoint.PrintToStream;
|
||||
begin
|
||||
BPoint_PrintToStream(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BPoint.Sept(x, y : single);
|
||||
begin
|
||||
BPoint_Set(CPlusObject, x, y);
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
end.
|
||||
284
bepascal/source/bepascal/pas/src/be/interface/scrollbar.pp
Normal file
284
bepascal/source/bepascal/pas/src/be/interface/scrollbar.pp
Normal file
@@ -0,0 +1,284 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit scrollbar;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj,view,rect,interfacedefs,Message,Archivable,SupportDefs,Handler;
|
||||
|
||||
type
|
||||
BScrollBar = class(BView)
|
||||
private
|
||||
public
|
||||
constructor Create(frame : BRect; name : pchar; atarget : BView; min,max : real; direction : orientation);
|
||||
constructor Create_1(data : BMessage);
|
||||
destructor Destroy;override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure AttachedToWindow;override;
|
||||
procedure SetValue(avalue : double);
|
||||
function Value : double;
|
||||
procedure SetProportion( avalue: double);
|
||||
function Proportion : double;
|
||||
procedure ValueChanged(newValue : double);
|
||||
procedure SetRange(min : double; max : double);
|
||||
procedure GetRange(min : double; max : double);
|
||||
procedure SetSteps(smallStep : double; largeStep : double);
|
||||
procedure GetSteps(smallStep : double; largeStep : double);
|
||||
procedure SetTarget(atarget : BView);
|
||||
procedure SetTarget(targetName : PChar);
|
||||
function Target : BView;
|
||||
function GetOrientation : Orientation;
|
||||
procedure MessageReceived(msg : BMessage);override;
|
||||
procedure MouseDown(pt : BPoint);override;
|
||||
procedure MouseUp(pt : BPoint);override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override;
|
||||
procedure DetachedFromWindow;override;
|
||||
procedure Draw(updateRect : BRect);override;
|
||||
procedure FrameMoved(new_position : BPoint);override;
|
||||
procedure FrameResized(new_width : double; new_height : double);override;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
procedure ResizeToPreferred;override;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure MakeFocus(state : boolean);
|
||||
procedure AllAttached;override;
|
||||
procedure AllDetached;override;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
end;
|
||||
|
||||
function BScrollBar_Create(AObject : TBeObject;frame : TCPlusObject; name : pchar; target : TCPlusObject; min,max : real; direction : Orientation): TCPlusObject; cdecl; external BePascalLibName name 'BScrollBar_Create';
|
||||
function BScrollBar_Create_1(AObject : TBeObject; data : TCPlusObject):TCPlusObject; cdecl; external BePascalLibName name 'BScrollBar_Create_1';
|
||||
procedure BScrollBar_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_Free';
|
||||
function BScrollBar_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BScrollBar_Instantiate';
|
||||
function BScrollBar_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BScrollBar_Archive';
|
||||
procedure BScrollBar_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_AttachedToWindow';
|
||||
procedure BScrollBar_SetValue(AObject : TCPlusObject; value : double); cdecl; external BePascalLibName name 'BScrollBar_SetValue';
|
||||
function BScrollBar_Value(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BScrollBar_Value';
|
||||
procedure BScrollBar_SetProportion(AObject : TCPlusObject; avalue: double); cdecl; external BePascalLibName name 'BScrollBar_SetProportion';
|
||||
function BScrollBar_Proportion(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BScrollBar_Proportion';
|
||||
procedure BScrollBar_ValueChanged(AObject : TCPlusObject; newValue : double); cdecl; external BePascalLibName name 'BScrollBar_ValueChanged';
|
||||
procedure BScrollBar_SetRange(AObject : TCPlusObject; min : double; max : double); cdecl; external BePascalLibName name 'BScrollBar_SetRange';
|
||||
procedure BScrollBar_GetRange(AObject : TCPlusObject; min : double; max : double); cdecl; external BePascalLibName name 'BScrollBar_GetRange';
|
||||
procedure BScrollBar_SetSteps(AObject : TCPlusObject; smallStep : double; largeStep : double); cdecl; external BePascalLibName name 'BScrollBar_SetSteps';
|
||||
procedure BScrollBar_GetSteps(AObject : TCPlusObject; smallStep : double; largeStep : double); cdecl; external BePascalLibName name 'BScrollBar_GetSteps';
|
||||
procedure BScrollBar_SetTarget(AObject : TCPlusObject; target : BView); cdecl; external BePascalLibName name 'BScrollBar_SetTarget';
|
||||
procedure BScrollBar_SetTarget(AObject : TCPlusObject; targetName : PChar); cdecl; external BePascalLibName name 'BScrollBar_SetTarget';
|
||||
function BScrollBar_Target(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BScrollBar_Target';
|
||||
function BScrollBar_Orientation(AObject : TCPlusObject) : Orientation; cdecl; external BePascalLibName name 'BScrollBar_Orientation';
|
||||
procedure BScrollBar_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_MessageReceived';
|
||||
procedure BScrollBar_MouseDown(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_MouseDown';
|
||||
procedure BScrollBar_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_MouseUp';
|
||||
procedure BScrollBar_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : BMessage); cdecl; external BePascalLibName name 'BScrollBar_MouseMoved';
|
||||
procedure BScrollBar_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_DetachedFromWindow';
|
||||
procedure BScrollBar_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_Draw';
|
||||
procedure BScrollBar_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_FrameMoved';
|
||||
procedure BScrollBar_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BScrollBar_FrameResized';
|
||||
function BScrollBar_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BScrollBar_ResolveSpecifier';
|
||||
procedure BScrollBar_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_ResizeToPreferred';
|
||||
procedure BScrollBar_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BScrollBar_GetPreferredSize';
|
||||
procedure BScrollBar_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BScrollBar_MakeFocus';
|
||||
procedure BScrollBar_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_AllAttached';
|
||||
procedure BScrollBar_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_AllDetached';
|
||||
function BScrollBar_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BScrollBar_GetSupportedSuites';
|
||||
function BScrollBar_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BScrollBar_Perform';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BScrollBar.Create(frame : BRect; name : pchar; atarget : BView; min,max : real; direction : Orientation);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BScrollBar_Create(Self,frame.CPlusObject, name, target.CPlusObject,min,max, direction );
|
||||
end;
|
||||
|
||||
constructor BScrollBar.Create_1(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BScrollBar_Create_1(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BScrollBar.Destroy;
|
||||
begin
|
||||
BScrollBar_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BScrollBar.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BScrollBar_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BScrollBar.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BScrollBar_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.AttachedToWindow;
|
||||
begin
|
||||
// BScrollBar_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.SetValue(avalue : double);
|
||||
begin
|
||||
BScrollBar_SetValue(CPlusObject, avalue);
|
||||
end;
|
||||
|
||||
function BScrollBar.Value : double;
|
||||
begin
|
||||
Result := BScrollBar_Value(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.SetProportion( avalue: double);
|
||||
begin
|
||||
BScrollBar_SetProportion(CPlusObject, avalue);
|
||||
end;
|
||||
|
||||
function BScrollBar.Proportion : double;
|
||||
begin
|
||||
Result := BScrollBar_Proportion(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.ValueChanged(newValue : double);
|
||||
begin
|
||||
BScrollBar_ValueChanged(CPlusObject, newValue);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.SetRange(min : double; max : double);
|
||||
begin
|
||||
BScrollBar_SetRange(CPlusObject, min, max);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.GetRange(min : double; max : double);
|
||||
begin
|
||||
BScrollBar_GetRange(CPlusObject, min, max);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.SetSteps(smallStep : double; largeStep : double);
|
||||
begin
|
||||
BScrollBar_SetSteps(CPlusObject, smallStep, largeStep);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.GetSteps(smallStep : double; largeStep : double);
|
||||
begin
|
||||
BScrollBar_GetSteps(CPlusObject, smallStep, largeStep);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.SetTarget(atarget : BView);
|
||||
begin
|
||||
BScrollBar_SetTarget(CPlusObject, target.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.SetTarget(targetName : PChar);
|
||||
begin
|
||||
BScrollBar_SetTarget(CPlusObject, targetName);
|
||||
end;
|
||||
|
||||
function BScrollBar.Target : BView;
|
||||
begin
|
||||
Result := BScrollBar_Target(CPlusObject);
|
||||
end;
|
||||
|
||||
function BScrollBar.GetOrientation : Orientation;
|
||||
begin
|
||||
Result := BScrollBar_Orientation(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
// BScrollBar_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.MouseDown(pt : BPoint);
|
||||
begin
|
||||
// BScrollBar_MouseDown(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.MouseUp(pt : BPoint);
|
||||
begin
|
||||
// BScrollBar_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
// BScrollBar_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.DetachedFromWindow;
|
||||
begin
|
||||
// BScrollBar_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.Draw(updateRect : BRect);
|
||||
begin
|
||||
//BScrollBar_Draw(CPlusObject, updateRect.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
// BScrollBar_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
// BScrollBar_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
function BScrollBar.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BScrollBar_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.ResizeToPreferred;
|
||||
begin
|
||||
// BScrollBar_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BScrollBar_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.MakeFocus(state : boolean);
|
||||
begin
|
||||
BScrollBar_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.AllAttached;
|
||||
begin
|
||||
BScrollBar_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollBar.AllDetached;
|
||||
begin
|
||||
BScrollBar_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
function BScrollBar.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BScrollBar_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BScrollBar.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BScrollBar_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
259
bepascal/source/bepascal/pas/src/be/interface/scrollview.pp
Normal file
259
bepascal/source/bepascal/pas/src/be/interface/scrollview.pp
Normal file
@@ -0,0 +1,259 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit scrollview;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, view, message, archivable, SupportDefs, rect, list,
|
||||
handler, messenger,interfacedefs,font,graphicdefs,scrollbar;
|
||||
|
||||
type
|
||||
BScrollView = class(BView)
|
||||
private
|
||||
public
|
||||
constructor Create(name : pchar;
|
||||
atarget :BView;
|
||||
resizeMask : longint;
|
||||
flags : longint;
|
||||
horizontal,
|
||||
vertical : boolean;
|
||||
aborder :border_style ); virtual;
|
||||
destructor Destroy;override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure Draw(updateRect : BRect);override;
|
||||
procedure AttachedToWindow;override;
|
||||
function ScrollBar(flag : Orientation) : BScrollBar;
|
||||
procedure SetBorder(aborder : border_style);
|
||||
function Border : border_style;
|
||||
function SetBorderHighlighted(state : boolean) : Status_t;
|
||||
function IsBorderHighlighted : boolean;
|
||||
procedure SetTarget(new_target : BView);
|
||||
function Target : BView;
|
||||
procedure MessageReceived(msg : BMessage);override;
|
||||
procedure MouseDown(pt : BPoint);override;
|
||||
procedure WindowActivated(state : boolean);override;
|
||||
procedure MouseUp(pt : BPoint);override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override;
|
||||
procedure DetachedFromWindow;override;
|
||||
procedure AllAttached;override;
|
||||
procedure AllDetached;override;
|
||||
procedure FrameMoved(new_position : BPoint);override;
|
||||
procedure FrameResized(new_width : double; new_height : double);override;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
procedure ResizeToPreferred;override;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure MakeFocus(state : boolean);
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
end;
|
||||
|
||||
function BScrollView_Create(AObject : TBeObject;name : pchar;target :TCPlusObject; resizeMask : longint; flags : longint;horizontal,vertical : boolean;border :border_style ):TCPlusObject; cdecl; external BePascalLibName name 'BScrollView_Create';
|
||||
//function BScrollView_Create_1(AObject : TBeObject):TCPlusObject; cdecl; external BePascalLibName name 'BScrollView_Create_1';
|
||||
procedure BScrollView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_Free';
|
||||
function BScrollView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BScrollView_Instantiate';
|
||||
function BScrollView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BScrollView_Archive';
|
||||
procedure BScrollView_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_Draw';
|
||||
procedure BScrollView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_AttachedToWindow';
|
||||
function BScrollView_ScrollBar(AObject : TCPlusObject; flag : Orientation) : BScrollBar; cdecl; external BePascalLibName name 'BScrollView_ScrollBar';
|
||||
procedure BScrollView_SetBorder(AObject : TCPlusObject; border : border_style); cdecl; external BePascalLibName name 'BScrollView_SetBorder';
|
||||
function BScrollView_Border(AObject : TCPlusObject) : border_style; cdecl; external BePascalLibName name 'BScrollView_Border';
|
||||
function BScrollView_SetBorderHighlighted(AObject : TCPlusObject; state : boolean) : Status_t; cdecl; external BePascalLibName name 'BScrollView_SetBorderHighlighted';
|
||||
function BScrollView_IsBorderHighlighted(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BScrollView_IsBorderHighlighted';
|
||||
procedure BScrollView_SetTarget(AObject : TCPlusObject; new_target : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_SetTarget';
|
||||
function BScrollView_Target(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BScrollView_Target';
|
||||
procedure BScrollView_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MessageReceived';
|
||||
procedure BScrollView_MouseDown(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MouseDown';
|
||||
procedure BScrollView_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BScrollView_WindowActivated';
|
||||
procedure BScrollView_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MouseUp';
|
||||
procedure BScrollView_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MouseMoved';
|
||||
procedure BScrollView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_DetachedFromWindow';
|
||||
procedure BScrollView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_AllAttached';
|
||||
procedure BScrollView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_AllDetached';
|
||||
procedure BScrollView_FrameMoved(AObject : TCPlusObject; new_position : BPoint); cdecl; external BePascalLibName name 'BScrollView_FrameMoved';
|
||||
procedure BScrollView_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BScrollView_FrameResized';
|
||||
function BScrollView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BScrollView_ResolveSpecifier';
|
||||
procedure BScrollView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_ResizeToPreferred';
|
||||
procedure BScrollView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BScrollView_GetPreferredSize';
|
||||
procedure BScrollView_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BScrollView_MakeFocus';
|
||||
function BScrollView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BScrollView_GetSupportedSuites';
|
||||
function BScrollView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BScrollView_Perform';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BScrollView.Create(name : pchar;
|
||||
atarget :BView;
|
||||
resizeMask : longint;
|
||||
flags : longint;
|
||||
horizontal,
|
||||
vertical : boolean;
|
||||
aborder :border_style );
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BScrollView_Create(Self,name,atarget.CplusObject,resizeMask,flags,horizontal,vertical,aborder);
|
||||
|
||||
end;
|
||||
|
||||
|
||||
|
||||
destructor BScrollView.Destroy;
|
||||
begin
|
||||
BScrollView_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BScrollView.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BScrollView_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BScrollView.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BScrollView_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BScrollView.Draw(updateRect : BRect);
|
||||
begin
|
||||
// BScrollView_Draw(CPlusObject, updateRect.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.AttachedToWindow;
|
||||
begin
|
||||
//BScrollView_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
function BScrollView.ScrollBar(flag : Orientation) : BScrollBar;
|
||||
begin
|
||||
Result := BScrollView_ScrollBar(CPlusObject, flag);
|
||||
end;
|
||||
|
||||
procedure BScrollView.SetBorder(aborder : border_style);
|
||||
begin
|
||||
BScrollView_SetBorder(CPlusObject, aborder);
|
||||
end;
|
||||
|
||||
function BScrollView.Border : border_style;
|
||||
begin
|
||||
Result := BScrollView_Border(CPlusObject);
|
||||
end;
|
||||
|
||||
function BScrollView.SetBorderHighlighted(state : boolean) : Status_t;
|
||||
begin
|
||||
Result := BScrollView_SetBorderHighlighted(CPlusObject, state);
|
||||
end;
|
||||
|
||||
function BScrollView.IsBorderHighlighted : boolean;
|
||||
begin
|
||||
Result := BScrollView_IsBorderHighlighted(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.SetTarget(new_target : BView);
|
||||
begin
|
||||
BScrollView_SetTarget(CPlusObject, new_target.CPlusObject);
|
||||
end;
|
||||
|
||||
function BScrollView.Target : BView;
|
||||
begin
|
||||
Result := BScrollView_Target(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
inherited;
|
||||
//BScrollView_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.MouseDown(pt : BPoint);
|
||||
begin
|
||||
// BScrollView_MouseDown(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.WindowActivated(state : boolean);
|
||||
begin
|
||||
//BScrollView_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BScrollView.MouseUp(pt : BPoint);
|
||||
begin
|
||||
//BScrollView_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
//BScrollView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BScrollView.DetachedFromWindow;
|
||||
begin
|
||||
//BScrollView_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.AllAttached;
|
||||
begin
|
||||
//BScrollView_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.AllDetached;
|
||||
begin
|
||||
//BScrollView_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
// BScrollView_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
//BScrollView_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
function BScrollView.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BScrollView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
procedure BScrollView.ResizeToPreferred;
|
||||
begin
|
||||
BScrollView_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BScrollView.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BScrollView_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BScrollView.MakeFocus(state : boolean);
|
||||
begin
|
||||
BScrollView_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
function BScrollView.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BScrollView_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BScrollView.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BScrollView_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
303
bepascal/source/bepascal/pas/src/be/interface/statusbar.pp
Normal file
303
bepascal/source/bepascal/pas/src/be/interface/statusbar.pp
Normal file
@@ -0,0 +1,303 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit statusbar;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, view, message, archivable, SupportDefs, rect, list,
|
||||
handler, messenger,interfacedefs,font,graphicdefs;
|
||||
|
||||
type
|
||||
BStatusBar = class(BView)
|
||||
private
|
||||
public
|
||||
constructor Create( frame : BRect;
|
||||
name : pchar;
|
||||
alabel : Pchar;
|
||||
trailing_label : Pchar);virtual;
|
||||
constructor Create(data : BMessage);virtual;
|
||||
destructor Destroy;override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure AttachedToWindow;override;
|
||||
procedure MessageReceived(msg : BMessage);override;
|
||||
procedure Draw(updateRect : BRect);override;
|
||||
procedure SetBarColor(color : rgb_color);
|
||||
procedure SetBarHeight(height : double);
|
||||
procedure SetText(str : PChar);
|
||||
procedure SetTrailingText(str : PChar);
|
||||
procedure SetMaxValue(max : double);
|
||||
procedure Update(delta : single; main_text : PChar; trailing_text : PChar);
|
||||
procedure Reset(alabel : PChar; trailing_label : PChar);
|
||||
function CurrentValue : double;
|
||||
function MaxValue : double;
|
||||
function BarColor : rgb_color;
|
||||
function BarHeight : double;
|
||||
function Text : PChar;
|
||||
function TrailingText : PChar;
|
||||
function GetLabel : PChar;
|
||||
function TrailingLabel : PChar;
|
||||
procedure MouseDown(pt : BPoint);override;
|
||||
procedure MouseUp(pt : BPoint);override;
|
||||
procedure WindowActivated(state : boolean);override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override;
|
||||
procedure DetachedFromWindow;override;
|
||||
procedure FrameMoved(new_position : BPoint);override;
|
||||
procedure FrameResized(new_width : double; new_height : double);override;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
procedure ResizeToPreferred;override;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure MakeFocus(state : boolean);
|
||||
procedure AllAttached;override;
|
||||
procedure AllDetached;override;
|
||||
|
||||
end;
|
||||
|
||||
function BStatusBar_Create(AObject : TBeObject;frame : TCPlusObject;
|
||||
name : pchar;
|
||||
slabel : Pchar;
|
||||
trailing_label : Pchar): TCPlusObject; cdecl; external BePascalLibName name 'BStatusBar_Create';
|
||||
function BStatusBar_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BStatusBar_Create';
|
||||
procedure BStatusBar_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_Free';
|
||||
function BStatusBar_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BStatusBar_Instantiate';
|
||||
function BStatusBar_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BStatusBar_Archive';
|
||||
procedure BStatusBar_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_AttachedToWindow';
|
||||
procedure BStatusBar_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_MessageReceived';
|
||||
procedure BStatusBar_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_Draw';
|
||||
procedure BStatusBar_SetBarColor(AObject : TCPlusObject; color : rgb_color); cdecl; external BePascalLibName name 'BStatusBar_SetBarColor';
|
||||
procedure BStatusBar_SetBarHeight(AObject : TCPlusObject; height : double); cdecl; external BePascalLibName name 'BStatusBar_SetBarHeight';
|
||||
procedure BStatusBar_SetText(AObject : TCPlusObject; str : PChar); cdecl; external BePascalLibName name 'BStatusBar_SetText';
|
||||
procedure BStatusBar_SetTrailingText(AObject : TCPlusObject; str : PChar); cdecl; external BePascalLibName name 'BStatusBar_SetTrailingText';
|
||||
procedure BStatusBar_SetMaxValue(AObject : TCPlusObject; max : double); cdecl; external BePascalLibName name 'BStatusBar_SetMaxValue';
|
||||
procedure BStatusBar_Update(AObject : TCPlusObject; delta : single; main_text : PChar; trailing_text : PChar); cdecl; external BePascalLibName name 'BStatusBar_Update';
|
||||
procedure BStatusBar_Reset(AObject : TCPlusObject; alabel : PChar; trailing_label : PChar); cdecl; external BePascalLibName name 'BStatusBar_Reset';
|
||||
function BStatusBar_CurrentValue(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BStatusBar_CurrentValue';
|
||||
function BStatusBar_MaxValue(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BStatusBar_MaxValue';
|
||||
function BStatusBar_BarColor(AObject : TCPlusObject) : rgb_color; cdecl; external BePascalLibName name 'BStatusBar_BarColor';
|
||||
function BStatusBar_BarHeight(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BStatusBar_BarHeight';
|
||||
function BStatusBar_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStatusBar_Text';
|
||||
function BStatusBar_TrailingText(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStatusBar_TrailingText';
|
||||
function BStatusBar_Label(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStatusBar_Label';
|
||||
function BStatusBar_TrailingLabel(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStatusBar_TrailingLabel';
|
||||
procedure BStatusBar_MouseDown(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_MouseDown';
|
||||
procedure BStatusBar_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_MouseUp';
|
||||
procedure BStatusBar_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BStatusBar_WindowActivated';
|
||||
procedure BStatusBar_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : BMessage); cdecl; external BePascalLibName name 'BStatusBar_MouseMoved';
|
||||
procedure BStatusBar_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_DetachedFromWindow';
|
||||
procedure BStatusBar_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_FrameMoved';
|
||||
procedure BStatusBar_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BStatusBar_FrameResized';
|
||||
function BStatusBar_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BStatusBar_ResolveSpecifier';
|
||||
procedure BStatusBar_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_ResizeToPreferred';
|
||||
procedure BStatusBar_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BStatusBar_GetPreferredSize';
|
||||
procedure BStatusBar_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BStatusBar_MakeFocus';
|
||||
procedure BStatusBar_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_AllAttached';
|
||||
procedure BStatusBar_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStatusBar_AllDetached';
|
||||
function BStatusBar_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BStatusBar_GetSupportedSuites';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BStatusBar.Create(frame : BRect;
|
||||
name : pchar;
|
||||
alabel : Pchar;
|
||||
trailing_label : Pchar);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BStatusBar_Create(Self,frame.CPlusObject,name,alabel,trailing_label);
|
||||
end;
|
||||
|
||||
constructor BStatusBar.Create(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BStatusBar_Create(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BStatusBar.Destroy;
|
||||
begin
|
||||
BStatusBar_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BStatusBar.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BStatusBar_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BStatusBar.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BStatusBar_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.AttachedToWindow;
|
||||
begin
|
||||
//BStatusBar_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
//BStatusBar_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.Draw(updateRect : BRect);
|
||||
begin
|
||||
// BStatusBar_Draw(CPlusObject, updateRect.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.SetBarColor(color : rgb_color);
|
||||
begin
|
||||
BStatusBar_SetBarColor(CPlusObject, color);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.SetBarHeight(height : double);
|
||||
begin
|
||||
BStatusBar_SetBarHeight(CPlusObject, height);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.SetText(str : PChar);
|
||||
begin
|
||||
BStatusBar_SetText(CPlusObject, str);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.SetTrailingText(str : PChar);
|
||||
begin
|
||||
BStatusBar_SetTrailingText(CPlusObject, str);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.SetMaxValue(max : double);
|
||||
begin
|
||||
BStatusBar_SetMaxValue(CPlusObject, max);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.Update(delta : single; main_text : PChar; trailing_text : PChar);
|
||||
begin
|
||||
BStatusBar_Update(CPlusObject, delta, main_text, trailing_text);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.Reset(alabel : PChar; trailing_label : PChar);
|
||||
begin
|
||||
BStatusBar_Reset(CPlusObject, alabel, trailing_label);
|
||||
end;
|
||||
|
||||
function BStatusBar.CurrentValue : double;
|
||||
begin
|
||||
Result := BStatusBar_CurrentValue(CPlusObject);
|
||||
end;
|
||||
|
||||
function BStatusBar.MaxValue : double;
|
||||
begin
|
||||
Result := BStatusBar_MaxValue(CPlusObject);
|
||||
end;
|
||||
|
||||
function BStatusBar.BarColor : rgb_color;
|
||||
begin
|
||||
Result := BStatusBar_BarColor(CPlusObject);
|
||||
end;
|
||||
|
||||
function BStatusBar.BarHeight : double;
|
||||
begin
|
||||
Result := BStatusBar_BarHeight(CPlusObject);
|
||||
end;
|
||||
|
||||
function BStatusBar.Text : PChar;
|
||||
begin
|
||||
Result := BStatusBar_Text(CPlusObject);
|
||||
end;
|
||||
|
||||
function BStatusBar.TrailingText : PChar;
|
||||
begin
|
||||
Result := BStatusBar_TrailingText(CPlusObject);
|
||||
end;
|
||||
|
||||
function BStatusBar.GetLabel : PChar;
|
||||
begin
|
||||
Result := BStatusBar_Label(CPlusObject);
|
||||
end;
|
||||
|
||||
function BStatusBar.TrailingLabel : PChar;
|
||||
begin
|
||||
Result := BStatusBar_TrailingLabel(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.MouseDown(pt : BPoint);
|
||||
begin
|
||||
// BStatusBar_MouseDown(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.MouseUp(pt : BPoint);
|
||||
begin
|
||||
// BStatusBar_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.WindowActivated(state : boolean);
|
||||
begin
|
||||
// BStatusBar_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
// BStatusBar_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.DetachedFromWindow;
|
||||
begin
|
||||
// BStatusBar_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
// BStatusBar_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
// BStatusBar_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
function BStatusBar.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
// Result := BStatusBar_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.ResizeToPreferred;
|
||||
begin
|
||||
BStatusBar_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BStatusBar_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.MakeFocus(state : boolean);
|
||||
begin
|
||||
BStatusBar_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.AllAttached;
|
||||
begin
|
||||
BStatusBar_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStatusBar.AllDetached;
|
||||
begin
|
||||
BStatusBar_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
262
bepascal/source/bepascal/pas/src/be/interface/stringview.pp
Normal file
262
bepascal/source/bepascal/pas/src/be/interface/stringview.pp
Normal file
@@ -0,0 +1,262 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit stringview;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, interfacedefs,view,Message, Archivable, SupportDefs, Rect, Handler;
|
||||
|
||||
type
|
||||
BStringView = class(BView)
|
||||
private
|
||||
public
|
||||
constructor Create(bounds : BRect; name : pchar; texte : pchar; resizeflags, flags : cardinal); virtual;
|
||||
destructor Destroy; override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure SetText(texte : PChar);
|
||||
function Text : PChar;
|
||||
procedure SeAlignment(flag : Alignment);
|
||||
function GetAlignment : Alignment;
|
||||
procedure AttachedToWindow; override;
|
||||
procedure Draw(bounds : BRect); override;
|
||||
procedure MessageReceived(msg : BMessage);override;
|
||||
procedure MouseDown(pt : BPoint);override;
|
||||
procedure MouseUp(pt : BPoint);override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override;
|
||||
procedure DetachedFromWindow;override;
|
||||
procedure FrameMoved(new_position : BPoint);override;
|
||||
procedure FrameResized(new_width : double; new_height : double);override;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
procedure ResizeToPreferred;override;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure MakeFocus(state : boolean);
|
||||
procedure AllAttached;override;
|
||||
procedure AllDetached;override;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
// procedure _ReservedStringView1;
|
||||
// procedure _ReservedStringView2;
|
||||
// procedure _ReservedStringView3;
|
||||
// function operator=( : BStringView) : BStringView;
|
||||
// procedure char *fText;
|
||||
// procedure alignment fAlign;
|
||||
// procedure uint32 _reserved[3];
|
||||
end;
|
||||
|
||||
function BStringView_Create(AObject : TBeObject;bounds : TCPlusObject; name : pchar; texte : pchar; resizeflags, flags : cardinal): TCPlusObject; cdecl; external BePascalLibName name 'BStringView_Create';
|
||||
procedure BStringView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_Free';
|
||||
function BStringView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BStringView_Instantiate';
|
||||
function BStringView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BStringView_Archive';
|
||||
procedure BStringView_SetText(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BStringView_SetText';
|
||||
function BStringView_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BStringView_Text';
|
||||
procedure BStringView_SeAlignment(AObject : TCPlusObject; flag : Alignment); cdecl; external BePascalLibName name 'BStringView_SetAlignment';
|
||||
function BStringView_Alignment(AObject : TCPlusObject) : Alignment; cdecl; external BePascalLibName name 'BStringView_Alignment';
|
||||
procedure BStringView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_AttachedToWindow';
|
||||
procedure BStringView_Draw(AObject : TCPlusObject; bounds : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_Draw';
|
||||
procedure BStringView_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_MessageReceived';
|
||||
procedure BStringView_MouseDown(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_MouseDown';
|
||||
procedure BStringView_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_MouseUp';
|
||||
procedure BStringView_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_MouseMoved';
|
||||
procedure BStringView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_DetachedFromWindow';
|
||||
procedure BStringView_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_FrameMoved';
|
||||
procedure BStringView_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BStringView_FrameResized';
|
||||
function BStringView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BStringView_ResolveSpecifier';
|
||||
procedure BStringView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_ResizeToPreferred';
|
||||
procedure BStringView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BStringView_GetPreferredSize';
|
||||
procedure BStringView_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BStringView_MakeFocus';
|
||||
procedure BStringView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_AllAttached';
|
||||
procedure BStringView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_AllDetached';
|
||||
function BStringView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BStringView_GetSupportedSuites';
|
||||
function BStringView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BStringView_Perform';
|
||||
//procedure BStringView__ReservedStringView1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView__ReservedStringView1';
|
||||
//procedure BStringView__ReservedStringView2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView__ReservedStringView2';
|
||||
//procedure BStringView__ReservedStringView3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView__ReservedStringView3';
|
||||
//function BStringView_operator=(AObject : TCPlusObject; : BStringView) : BStringView; cdecl; external BePascalLibName name 'BStringView_operator=';
|
||||
//procedure BStringView_char *fText(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_char *fText';
|
||||
//procedure BStringView_alignment fAlign(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_alignment fAlign';
|
||||
//procedure BStringView_uint32 _reserved[3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BStringView_uint32 _reserved[3]';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BStringView.Create(bounds : BRect; name : pchar; texte : pchar; resizeflags, flags : cardinal);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BStringView_Create(Self,bounds.CPlusObject,name,texte,resizeflags, flags);
|
||||
end;
|
||||
|
||||
destructor BStringView.Destroy;
|
||||
begin
|
||||
BStringView_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BStringView.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BStringView_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BStringView.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BStringView_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BStringView.SetText(texte : PChar);
|
||||
begin
|
||||
BStringView_SetText(CPlusObject, texte);
|
||||
end;
|
||||
|
||||
function BStringView.Text : PChar;
|
||||
begin
|
||||
Result := BStringView_Text(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.SeAlignment(flag : Alignment);
|
||||
begin
|
||||
BStringView_SeAlignment(CPlusObject, flag);
|
||||
end;
|
||||
|
||||
function BStringView.getAlignment : Alignment;
|
||||
begin
|
||||
Result := BStringView_Alignment(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.AttachedToWindow;
|
||||
begin
|
||||
// BStringView_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.Draw(bounds : BRect);
|
||||
begin
|
||||
// BStringView_Draw(CPlusObject, bounds.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
//BStringView_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.MouseDown(pt : BPoint);
|
||||
begin
|
||||
//BStringView_MouseDown(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.MouseUp(pt : BPoint);
|
||||
begin
|
||||
//BStringView_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
//BStringView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BStringView.DetachedFromWindow;
|
||||
begin
|
||||
//BStringView_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
//BStringView_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
//BStringView_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
function BStringView.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
// Result := BStringView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
procedure BStringView.ResizeToPreferred;
|
||||
begin
|
||||
//BStringView_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BStringView_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BStringView.MakeFocus(state : boolean);
|
||||
begin
|
||||
BStringView_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BStringView.AllAttached;
|
||||
begin
|
||||
//BStringView_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.AllDetached;
|
||||
begin
|
||||
//BStringView_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
function BStringView.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BStringView_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BStringView.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
//Result := BStringView_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
{procedure BStringView._ReservedStringView1;
|
||||
begin
|
||||
BStringView__ReservedStringView1(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView._ReservedStringView2;
|
||||
begin
|
||||
BStringView__ReservedStringView2(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView._ReservedStringView3;
|
||||
begin
|
||||
BStringView__ReservedStringView3(CPlusObject);
|
||||
end;
|
||||
|
||||
function BStringView.operator=( : BStringView) : BStringView;
|
||||
begin
|
||||
Result := BStringView_operator=(CPlusObject, );
|
||||
end;
|
||||
|
||||
procedure BStringView.char *fText;
|
||||
begin
|
||||
BStringView_char *fText(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.alignment fAlign;
|
||||
begin
|
||||
BStringView_alignment fAlign(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BStringView.uint32 _reserved[3];
|
||||
begin
|
||||
BStringView_uint32 _reserved[3](CPlusObject);
|
||||
end;
|
||||
}
|
||||
|
||||
end.
|
||||
606
bepascal/source/bepascal/pas/src/be/interface/tabview.pp
Normal file
606
bepascal/source/bepascal/pas/src/be/interface/tabview.pp
Normal file
@@ -0,0 +1,606 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit tabview;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, interfacedefs,view,Message, Archivable, SupportDefs, Rect, Handler,font;
|
||||
|
||||
const
|
||||
B_TAB_FIRST = 999;
|
||||
B_TAB_FRONT=1;
|
||||
B_TAB_ANY=2;
|
||||
type
|
||||
BTab = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create(View : BView);virtual;
|
||||
constructor Create_1(data : BMessage);virtual;
|
||||
destructor Destroy;override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
function Perform(d : Cardinal; arg : Pointer) : Status_t;
|
||||
function GetLabel : PChar;
|
||||
procedure SetLabel(alabel : PChar);
|
||||
function IsSelected : boolean;
|
||||
procedure Select(owner : BView);
|
||||
procedure Deselect;
|
||||
procedure SetEnabled(aon : boolean);
|
||||
function IsEnabled : boolean;
|
||||
procedure MakeFocus(infocus : boolean);
|
||||
function IsFocus : boolean;
|
||||
procedure SeBView(contents : BView);
|
||||
function GeBView : BView;
|
||||
procedure DrawFocusMark(owner : BView; tabFrame : BRect);
|
||||
procedure DrawLabel(owner : BView; tabFrame : BRect);
|
||||
procedure DrawTab(owner : BView; tabFrame : BRect; position : byte; full : boolean);
|
||||
end;
|
||||
|
||||
|
||||
type
|
||||
BTabView = class(BView)
|
||||
private
|
||||
public
|
||||
destructor Destroy;override;
|
||||
constructor Create(frame : BRect; name : Pchar; width : button_width; resizingMode : cardinal; flags : cardinal);virtual;
|
||||
constructor Create(msg : BMessage);virtual;
|
||||
function Instantiate( msg: BMessage) : BArchivable;
|
||||
function Archive( msg : BMessage; deep : boolean) : Status_t;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
procedure WindowActivated(state : boolean);override;
|
||||
procedure AttachedToWindow;override;
|
||||
procedure AllAttached;override;
|
||||
procedure AllDetached;override;
|
||||
procedure DetachedFromWindow;override;
|
||||
procedure MessageReceived(msg : BMessage);override;
|
||||
procedure FrameMoved(new_position : BPoint);override;
|
||||
procedure FrameResized(w : double; h : double);override;
|
||||
procedure KeyDown(bytes : PChar; n : integer);override;
|
||||
procedure MouseDown( pt: BPoint);override;
|
||||
procedure MouseUp( pt: BPoint);override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override;
|
||||
procedure Pulse;override;
|
||||
procedure Select(tabIndex : integer);
|
||||
function Selection : integer;
|
||||
procedure MakeFocus(focusState : boolean);
|
||||
procedure SetFocusTab(tabIndex : integer; focusState : boolean);
|
||||
function FocusTab : integer;
|
||||
procedure Draw( rect: BRect);override;
|
||||
function DrawTabs : BRect;
|
||||
procedure DrawBox(selectedTabFrame : BRect);
|
||||
function TabFrame(tabIndex : integer) : BRect;
|
||||
procedure SetFlags(flags : Cardinal);
|
||||
procedure SetResizingMode(mode : Cardinal);
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure ResizeToPreferred;override;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
procedure AddTab(tabContents : BView; tab : BTab);
|
||||
function RemoveTab(tabIndex : integer) : BTab;
|
||||
function TabAt(tabIndex : integer) : BTab;
|
||||
procedure SetTabWidth(s : button_width);
|
||||
function TabWidth : button_width;
|
||||
procedure SetTabHeight(height : double);
|
||||
function TabHeight : double;
|
||||
function ContainerView : BView;
|
||||
function CountTabs : integer;
|
||||
function ViewForTab(tabIndex : integer) : BView;
|
||||
end;
|
||||
|
||||
function BTab_Create(AObject : TBeObject;View : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTab_Create';
|
||||
procedure BTab_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTab_Free';
|
||||
function BTab_Create_1(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTab_Create_1';
|
||||
function BTab_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BTab_Instantiate';
|
||||
function BTab_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BTab_Archive';
|
||||
function BTab_Perform(AObject : TCPlusObject; d : Cardinal; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BTab_Perform';
|
||||
function BTab_Label(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BTab_Label';
|
||||
procedure BTab_SetLabel(AObject : TCPlusObject; alabel : PChar); cdecl; external BePascalLibName name 'BTab_SetLabel';
|
||||
function BTab_IsSelected(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTab_IsSelected';
|
||||
procedure BTab_Select(AObject : TCPlusObject; owner : TCPlusObject); cdecl; external BePascalLibName name 'BTab_Select';
|
||||
procedure BTab_Deselect(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTab_Deselect';
|
||||
procedure BTab_SetEnabled(AObject : TCPlusObject; aon : boolean); cdecl; external BePascalLibName name 'BTab_SetEnabled';
|
||||
function BTab_IsEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTab_IsEnabled';
|
||||
procedure BTab_MakeFocus(AObject : TCPlusObject; infocus : boolean); cdecl; external BePascalLibName name 'BTab_MakeFocus';
|
||||
function BTab_IsFocus(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTab_IsFocus';
|
||||
procedure BTab_SeBView(AObject : TCPlusObject; contents : TCPlusObject); cdecl; external BePascalLibName name 'BTab_SetView';
|
||||
function BTab_View(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BTab_View';
|
||||
procedure BTab_DrawFocusMark(AObject : TCPlusObject; owner : TCPlusObject; tabFrame : TCPlusObject); cdecl; external BePascalLibName name 'BTab_DrawFocusMark';
|
||||
procedure BTab_DrawLabel(AObject : TCPlusObject; owner : TCPlusObject; tabFrame : TCPlusObject); cdecl; external BePascalLibName name 'BTab_DrawLabel';
|
||||
procedure BTab_DrawTab(AObject : TCPlusObject; owner : TCPlusObject; tabFrame : TCPlusObject; position : byte; full : boolean); cdecl; external BePascalLibName name 'BTab_DrawTab';
|
||||
|
||||
procedure BTabView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_Free';
|
||||
function BTabView_Create(AObject : TBeObject;frame : TCPlusObject; name : Pchar; width : Integer; resizingMode : cardinal; flags : cardinal): TCPlusObject; cdecl; external BePascalLibName name 'BTabView_Create';
|
||||
function BTabView_Create_1(AObject : TBeObject; msg : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTabView_Create_1';
|
||||
function BTabView_Instantiate(AObject : TCPlusObject; msg : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BTabView_Instantiate';
|
||||
function BTabView_Archive(AObject : TCPlusObject; msg : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BTabView_Archive';
|
||||
function BTabView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BTabView_Perform';
|
||||
procedure BTabView_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BTabView_WindowActivated';
|
||||
procedure BTabView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_AttachedToWindow';
|
||||
procedure BTabView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_AllAttached';
|
||||
procedure BTabView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_AllDetached';
|
||||
procedure BTabView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_DetachedFromWindow';
|
||||
procedure BTabView_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_MessageReceived';
|
||||
procedure BTabView_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_FrameMoved';
|
||||
procedure BTabView_FrameResized(AObject : TCPlusObject; w : double; h : double); cdecl; external BePascalLibName name 'BTabView_FrameResized';
|
||||
procedure BTabView_KeyDown(AObject : TCPlusObject; bytes : PChar; n : integer); cdecl; external BePascalLibName name 'BTabView_KeyDown';
|
||||
procedure BTabView_MouseDown(AObject : TCPlusObject; pt: TCPlusObject); cdecl; external BePascalLibName name 'BTabView_MouseDown';
|
||||
procedure BTabView_MouseUp(AObject : TCPlusObject; pt: TCPlusObject); cdecl; external BePascalLibName name 'BTabView_MouseUp';
|
||||
procedure BTabView_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_MouseMoved';
|
||||
procedure BTabView_Pulse(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_Pulse';
|
||||
procedure BTabView_Select(AObject : TCPlusObject; tabIndex : integer); cdecl; external BePascalLibName name 'BTabView_Select';
|
||||
//function BTabView_Selection(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTabView_Selection';
|
||||
procedure BTabView_MakeFocus(AObject : TCPlusObject; focusState : boolean); cdecl; external BePascalLibName name 'BTabView_MakeFocus';
|
||||
procedure BTabView_SetFocusTab(AObject : TCPlusObject; tabIndex : integer; focusState : boolean); cdecl; external BePascalLibName name 'BTabView_SetFocusTab';
|
||||
function BTabView_FocusTab(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTabView_FocusTab';
|
||||
procedure BTabView_Draw(AObject : TCPlusObject; rect : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_Draw';
|
||||
//function BTabView_DrawTabs(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BTabView_DrawTabs';
|
||||
procedure BTabView_DrawBox(AObject : TCPlusObject; selectedTabFrame : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_DrawBox';
|
||||
function BTabView_TabFrame(AObject : TCPlusObject; tabIndex : integer) : BRect; cdecl; external BePascalLibName name 'BTabView_TabFrame';
|
||||
procedure BTabView_SetFlags(AObject : TCPlusObject; flags : Cardinal); cdecl; external BePascalLibName name 'BTabView_SetFlags';
|
||||
procedure BTabView_SetResizingMode(AObject : TCPlusObject; mode : Cardinal); cdecl; external BePascalLibName name 'BTabView_SetResizingMode';
|
||||
procedure BTabView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BTabView_GetPreferredSize';
|
||||
procedure BTabView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_ResizeToPreferred';
|
||||
function BTabView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properto : PChar) : BHandler; cdecl; external BePascalLibName name 'BTabView_ResolveSpecifier';
|
||||
function BTabView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BTabView_GetSupportedSuites';
|
||||
procedure BTabView_AddTab(AObject : TCPlusObject; tabContents : TCPlusObject; tab : TCPlusObject); cdecl; external BePascalLibName name 'BTabView_AddTab';
|
||||
function BTabView_RemoveTab(AObject : TCPlusObject; tabIndex : integer) : BTab; cdecl; external BePascalLibName name 'BTabView_RemoveTab';
|
||||
function BTabView_TabAt(AObject : TCPlusObject; tabIndex : integer) : BTab; cdecl; external BePascalLibName name 'BTabView_TabAt';
|
||||
procedure BTabView_SetTabWidth(AObject : TCPlusObject; s : button_width); cdecl; external BePascalLibName name 'BTabView_SetTabWidth';
|
||||
function BTabView_TabWidth(AObject : TCPlusObject) : button_width; cdecl; external BePascalLibName name 'BTabView_TabWidth';
|
||||
procedure BTabView_SetTabHeight(AObject : TCPlusObject; height : double); cdecl; external BePascalLibName name 'BTabView_SetTabHeight';
|
||||
function BTabView_TabHeight(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BTabView_TabHeight';
|
||||
function BTabView_ContainerView(AObject : TCPlusObject) : BView; cdecl; external BePascalLibName name 'BTabView_ContainerView';
|
||||
function BTabView_CountTabs(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTabView_CountTabs';
|
||||
function BTabView_ViewForTab(AObject : TCPlusObject; tabIndex : integer) : BView; cdecl; external BePascalLibName name 'BTabView_ViewForTab';
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
TabView_AddTab_hook : Pointer; cvar; external;
|
||||
TabView_Draw_hook : Pointer; cvar; external;
|
||||
TabView_DrawBox_hook : Pointer; cvar; external;
|
||||
TabView_DrawTabs_hook : Pointer; cvar; external;
|
||||
TabView_MakeFocus_hook : Pointer; cvar; external;
|
||||
TabView_RemoveTab_hook : Pointer; cvar; external;
|
||||
TabView_Select_hook: Pointer; cvar; external;
|
||||
TabView_SetFocusTab_hook : Pointer; cvar; external;
|
||||
TabView_SetTabHeight_hook : Pointer; cvar; external;
|
||||
TabView_SetTabWidth_hook : Pointer; cvar; external;
|
||||
TabView_TabAt_hook : Pointer; cvar; external;
|
||||
TabView_TabFrame_hook : Pointer; cvar; external;
|
||||
|
||||
|
||||
constructor BTab.Create(View : BView);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BTab_Create(Self,View.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BTab.Destroy;
|
||||
begin
|
||||
BTab_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
constructor BTab.Create_1(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BTab_Create_1(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTab.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BTab_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTab.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BTab_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
function BTab.Perform(d : Cardinal; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BTab_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
function BTab.GetLabel : PChar;
|
||||
begin
|
||||
Result := BTab_Label(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTab.SetLabel(alabel : PChar);
|
||||
begin
|
||||
BTab_SetLabel(CPlusObject, alabel);
|
||||
end;
|
||||
|
||||
function BTab.IsSelected : boolean;
|
||||
begin
|
||||
Result := BTab_IsSelected(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTab.Select(owner : BView);
|
||||
begin
|
||||
BTab_Select(CPlusObject, owner.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTab.Deselect;
|
||||
begin
|
||||
BTab_Deselect(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTab.SetEnabled(aon : boolean);
|
||||
begin
|
||||
BTab_SetEnabled(CPlusObject, aon);
|
||||
end;
|
||||
|
||||
function BTab.IsEnabled : boolean;
|
||||
begin
|
||||
Result := BTab_IsEnabled(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTab.MakeFocus(infocus : boolean);
|
||||
begin
|
||||
BTab_MakeFocus(CPlusObject, infocus);
|
||||
end;
|
||||
|
||||
function BTab.IsFocus : boolean;
|
||||
begin
|
||||
Result := BTab_IsFocus(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTab.SeBView(contents : BView);
|
||||
begin
|
||||
BTab_SeBView(CPlusObject, contents.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTab.GeBView : BView;
|
||||
begin
|
||||
Result := BTab_View(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTab.DrawFocusMark(owner : BView; tabFrame : BRect);
|
||||
begin
|
||||
BTab_DrawFocusMark(CPlusObject, owner.CPlusObject, tabFrame.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTab.DrawLabel(owner : BView; tabFrame : BRect);
|
||||
begin
|
||||
BTab_DrawLabel(CPlusObject, owner.CPlusObject, tabFrame.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTab.DrawTab(owner : BView; tabFrame : BRect; position: byte; full : boolean);
|
||||
begin
|
||||
BTab_DrawTab(CPlusObject, owner.CPlusObject, tabFrame.CPlusObject, position, full);
|
||||
end;
|
||||
|
||||
|
||||
//--------------------BTabView
|
||||
|
||||
destructor BTabView.Destroy;
|
||||
begin
|
||||
BTabView_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
constructor BTabView.Create( frame : BRect; name : Pchar; width : button_width; resizingMode : cardinal; flags : cardinal);
|
||||
begin
|
||||
createPas;
|
||||
CPlusObject := BTabView_Create(Self, frame.CPlusObject, name, Integer(width),resizingMode,flags);
|
||||
end;
|
||||
|
||||
|
||||
constructor BTabView.Create( msg: BMessage);
|
||||
begin
|
||||
createPas;
|
||||
CPlusObject := BTabView_Create_1(Self, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTabView.Instantiate( msg : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BTabView_Instantiate(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTabView.Archive( msg : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BTabView_Archive(CPlusObject, msg.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
function BTabView.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
// Result := BTabView_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
procedure BTabView.WindowActivated(state : boolean);
|
||||
begin
|
||||
//BTabView_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BTabView.AttachedToWindow;
|
||||
begin
|
||||
//BTabView_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.AllAttached;
|
||||
begin
|
||||
//BTabView_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.AllDetached;
|
||||
begin
|
||||
//BTabView_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.DetachedFromWindow;
|
||||
begin
|
||||
// BTabView_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
// BTabView_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
//BTabView_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.FrameResized(w : double; h : double);
|
||||
begin
|
||||
// BTabView_FrameResized(CPlusObject, w, h);
|
||||
end;
|
||||
|
||||
procedure BTabView.KeyDown(bytes : PChar; n : integer);
|
||||
begin
|
||||
// BTabView_KeyDown(CPlusObject, bytes, n);
|
||||
end;
|
||||
|
||||
procedure BTabView.MouseDown( pt: BPoint);
|
||||
begin
|
||||
//BTabView_MouseDown(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.MouseUp( pt: BPoint);
|
||||
begin
|
||||
//BTabView_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
//BTabView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BTabView.Pulse;
|
||||
begin
|
||||
// BTabView_Pulse(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.Select(tabIndex : integer);
|
||||
begin
|
||||
BTabView_Select(CPlusObject, tabIndex);
|
||||
end;
|
||||
|
||||
function BTabView.Selection : integer;
|
||||
begin
|
||||
// Result := BTabView_Selection(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.MakeFocus(focusState : boolean);
|
||||
begin
|
||||
BTabView_MakeFocus(CPlusObject, focusState);
|
||||
end;
|
||||
|
||||
procedure BTabView.SetFocusTab(tabIndex : integer; focusState : boolean);
|
||||
begin
|
||||
BTabView_SetFocusTab(CPlusObject, tabIndex, focusState);
|
||||
end;
|
||||
|
||||
function BTabView.FocusTab : integer;
|
||||
begin
|
||||
Result := BTabView_FocusTab(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.Draw( rect: BRect);
|
||||
begin
|
||||
// BTabView_Draw(CPlusObject, rect.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTabView.DrawTabs : BRect;
|
||||
begin
|
||||
// Result := BTabView_DrawTabs(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.DrawBox(selectedTabFrame : BRect);
|
||||
begin
|
||||
//BTabView_DrawBox(CPlusObject, selectedTabFrame.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTabView.TabFrame(tabIndex : integer) : BRect;
|
||||
begin
|
||||
Result := BTabView_TabFrame(CPlusObject, tabIndex);
|
||||
end;
|
||||
|
||||
procedure BTabView.SetFlags(flags : Cardinal);
|
||||
begin
|
||||
BTabView_SetFlags(CPlusObject, flags);
|
||||
end;
|
||||
|
||||
procedure BTabView.SetResizingMode(mode : Cardinal);
|
||||
begin
|
||||
BTabView_SetResizingMode(CPlusObject, mode);
|
||||
end;
|
||||
|
||||
procedure BTabView.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
// BTabView_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BTabView.ResizeToPreferred;
|
||||
begin
|
||||
// BTabView_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
function BTabView.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
//Result := BTabView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
function BTabView.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
//Result := BTabView_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.AddTab(tabContents : BView; tab : BTab);
|
||||
begin
|
||||
BTabView_AddTab(CPlusObject, tabContents.CPlusObject, tab.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTabView.RemoveTab(tabIndex : integer) : BTab;
|
||||
begin
|
||||
Result := BTabView_RemoveTab(CPlusObject, tabIndex);
|
||||
end;
|
||||
|
||||
|
||||
function BTabView.TabAt(tabIndex : integer) : BTab;
|
||||
begin
|
||||
Result := BTabView_TabAt(CPlusObject, tabIndex);
|
||||
end;
|
||||
|
||||
procedure BTabView.SetTabWidth(s : button_width);
|
||||
begin
|
||||
BTabView_SetTabWidth(CPlusObject, s);
|
||||
end;
|
||||
|
||||
function BTabView.TabWidth : button_width;
|
||||
begin
|
||||
Result := BTabView_TabWidth(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTabView.SetTabHeight(height : double);
|
||||
begin
|
||||
BTabView_SetTabHeight(CPlusObject, height);
|
||||
end;
|
||||
|
||||
function BTabView.TabHeight : double;
|
||||
begin
|
||||
Result := BTabView_TabHeight(CPlusObject);
|
||||
end;
|
||||
|
||||
function BTabView.ContainerView : BView;
|
||||
begin
|
||||
Result := BTabView_ContainerView(CPlusObject);
|
||||
end;
|
||||
|
||||
function BTabView.CountTabs : integer;
|
||||
begin
|
||||
Result := BTabView_CountTabs(CPlusObject);
|
||||
end;
|
||||
|
||||
function BTabView.ViewForTab(tabIndex : integer) : BView;
|
||||
begin
|
||||
Result := BTabView_ViewForTab(CPlusObject, tabIndex);
|
||||
end;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Hook
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
procedure BTabView_AddTab_hook_func(tabw : BTabView; target : TCPlusObject; tab : TCPlusObject); cdecl;
|
||||
Var targetv : BView;
|
||||
tabtab : BTab;
|
||||
begin
|
||||
targetv:=BView.Wrap(target);
|
||||
tabtab:=BTab.Wrap(tab);
|
||||
if Tabw <> nil Then Tabw.AddTab(targetv,tabtab);
|
||||
targetv.UnWrap;
|
||||
tabtab.UNWrap;
|
||||
end;
|
||||
|
||||
procedure BTabView_Draw_hook_func(tabw : BTabView; updaterect : TCPlusObject);cdecl;
|
||||
var rect : BRect;
|
||||
begin
|
||||
rect:=BRect.Wrap(updaterect);
|
||||
if tabw <> nil then tabw.draw(rect);
|
||||
rect.UnWrap;
|
||||
end;
|
||||
|
||||
procedure BTabView_DrawBox_hook_func(tabw : BTabView; updaterect : TCPlusObject);cdecl;
|
||||
var rect : BRect;
|
||||
begin
|
||||
rect:=BRect.Wrap(updaterect);
|
||||
if tabw <> nil then tabw.drawBox(rect);
|
||||
rect.UnWrap;
|
||||
end;
|
||||
|
||||
procedure BTabView_DrawTabs_hook_func(tabw : BTabView);cdecl;
|
||||
begin
|
||||
if tabw <> nil then tabw.drawTabs;
|
||||
end;
|
||||
|
||||
procedure BTabView_MakeFocus_hook_func;cdecl;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTabView_RemoveTab_hook_func;cdecl;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTabView_Select_hook_func;cdecl;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTabView_SetFocusTab_hook_func;cdecl;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTabView_SetTabHeight_hook_func;cdecl;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTabView_SetTabWidth_hook_func;cdecl;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTabView_TabAt_hook_func;cdecl;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTabView_TabFrame_hook_func;cdecl;
|
||||
begin
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
|
||||
{TabView_AddTab_hook := @BTabView_AddTab_hook_func;
|
||||
TabView_Draw_hook :=@BTabView_Draw_hook_func;
|
||||
TabView_DrawBox_hook :=@BTabView_DrawBox_hook_func;
|
||||
TabView_DrawTabs_hook :=@BTabView_DrawTabs_hook_func;
|
||||
TabView_MakeFocus_hook :=@BTabView_MakeFocus_hook_func;
|
||||
TabView_RemoveTab_hook :=@BTabView_RemoveTab_hook_func;
|
||||
TabView_Select_hook:=@BTabView_Select_hook_func;
|
||||
TabView_SetFocusTab_hook :=@BTabView_SetFocusTab_hook_func;
|
||||
TabView_SetTabHeight_hook :=@BTabView_SetTabHeight_hook_func;
|
||||
TabView_SetTabWidth_hook :=@BTabView_SetTabWidth_hook_func;
|
||||
TabView_TabAt_hook :=@BTabView_TabAt_hook_func;
|
||||
TabView_TabFrame_hook :=@BTabView_TabFrame_hook_func;
|
||||
}
|
||||
end.
|
||||
434
bepascal/source/bepascal/pas/src/be/interface/textcontrol.pp
Normal file
434
bepascal/source/bepascal/pas/src/be/interface/textcontrol.pp
Normal file
@@ -0,0 +1,434 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit TextControl;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, Control, Message, Archivable, SupportDefs, Rect, Handler,interfacedefs;
|
||||
|
||||
type
|
||||
BTextControl = class(BControl)
|
||||
private
|
||||
public
|
||||
destructor Destroy;override;
|
||||
constructor Create(frame : BRect; name, aLabel,initial : PChar; message : BMessage; resizingMode, flags : Cardinal); virtual;
|
||||
constructor Create(data : BMessage);override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure SetText(texte : PChar);
|
||||
function Text : PChar;
|
||||
procedure SetValue(valu : integer);
|
||||
function Invoke(msg : BMessage) : Status_t;
|
||||
function TextView : BTextControl;
|
||||
procedure SetModificationMessage(message : BMessage);
|
||||
function ModificationMessage : BMessage;
|
||||
procedure SetAlignment(alabel : Alignment; texte : Alignment);
|
||||
procedure GeAlignment(alabel : Alignment; texte : Alignment);
|
||||
procedure SetDivider(dividing_line : single);
|
||||
function Divider : single;
|
||||
procedure Draw(updateRect : BRect);override;
|
||||
procedure MouseDown(where : BPoint);override;
|
||||
procedure AttachedToWindow;override;
|
||||
procedure MakeFocus(focusState : boolean);override;
|
||||
procedure SetEnabled(state : boolean);
|
||||
procedure FrameMoved(new_position : BPoint);override;
|
||||
procedure FrameResized(new_width : double; new_height : double);override;
|
||||
procedure WindowActivated(active : boolean);override;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure ResizeToPreferred;override;
|
||||
procedure MessageReceived(msg : BMessage);override;
|
||||
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
procedure MouseUp(pt : BPoint);override;
|
||||
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);override;
|
||||
procedure DetachedFromWindow;override;
|
||||
procedure AllAttached;override;
|
||||
procedure AllDetached;override;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
procedure SetFlags(flags : Cardinal);
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
{ procedure _ReservedTextControl1;
|
||||
procedure _ReservedTextControl2;
|
||||
procedure _ReservedTextControl3;
|
||||
procedure _ReservedTextControl4;
|
||||
function operator=( : BTextControl) : BTextControl;
|
||||
procedure CommitValue;
|
||||
procedure InitData(label : PChar; initial_text : PChar; data : BMessage);
|
||||
procedure _BTextInput_ *fText;
|
||||
procedure char *fLabel;
|
||||
procedure BMessage *fModificationMessage;
|
||||
procedure alignment fLabelAlign;
|
||||
procedure float fDivider;
|
||||
procedure uint16 fPrevWidth;
|
||||
procedure uint16 fPrevHeight;
|
||||
procedure uint32 _reserved[3];
|
||||
procedure uint32 _more_reserved[4];
|
||||
procedure bool fClean;
|
||||
procedure bool fSkipSetFlags;
|
||||
procedure bool fUnusedBool1;
|
||||
procedure bool fUnusedBool2;
|
||||
}
|
||||
end;
|
||||
|
||||
procedure BTextControl_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_Free';
|
||||
function BTextControl_Create(AObject : TBeObject; frame : TCPlusObject; name, aLabel ,initial: PChar; message : TCPlusObject; resizingMode, flags : Cardinal): TCPlusObject; cdecl; external BePascalLibName name 'BTextControl_Create';
|
||||
function BTextControl_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTextControl_Create_1';
|
||||
function BTextControl_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BTextControl_Instantiate';
|
||||
function BTextControl_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BTextControl_Archive';
|
||||
procedure BTextControl_SetText(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BTextControl_SetText';
|
||||
function BTextControl_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BTextControl_Text';
|
||||
procedure BTextControl_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BTextControl_SetValue';
|
||||
function BTextControl_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BTextControl_Invoke';
|
||||
function BTextControl_TextView(AObject : TCPlusObject) : BTextControl; cdecl; external BePascalLibName name 'BTextControl_TextView';
|
||||
procedure BTextControl_SetModificationMessage(AObject : TCPlusObject; message : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_SetModificationMessage';
|
||||
function BTextControl_ModificationMessage(AObject : TCPlusObject) : BMessage; cdecl; external BePascalLibName name 'BTextControl_ModificationMessage';
|
||||
procedure BTextControl_SeAlignment(AObject : TCPlusObject; alabel : Alignment; texte : Alignment); cdecl; external BePascalLibName name 'BTextControl_SetAlignment';
|
||||
procedure BTextControl_GeAlignment(AObject : TCPlusObject; alabel : Alignment; texte : Alignment); cdecl; external BePascalLibName name 'BTextControl_GetAlignment';
|
||||
procedure BTextControl_SetDivider(AObject : TCPlusObject; dividing_line : single); cdecl; external BePascalLibName name 'BTextControl_SetDivider';
|
||||
function BTextControl_Divider(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BTextControl_Divider';
|
||||
procedure BTextControl_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_Draw';
|
||||
procedure BTextControl_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_MouseDown';
|
||||
procedure BTextControl_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_AttachedToWindow';
|
||||
procedure BTextControl_MakeFocus(AObject : TCPlusObject; focusState : boolean); cdecl; external BePascalLibName name 'BTextControl_MakeFocus';
|
||||
procedure BTextControl_SetEnabled(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BTextControl_SetEnabled';
|
||||
procedure BTextControl_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_FrameMoved';
|
||||
procedure BTextControl_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BTextControl_FrameResized';
|
||||
procedure BTextControl_WindowActivated(AObject : TCPlusObject; active : boolean); cdecl; external BePascalLibName name 'BTextControl_WindowActivated';
|
||||
procedure BTextControl_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BTextControl_GetPreferredSize';
|
||||
procedure BTextControl_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_ResizeToPreferred';
|
||||
procedure BTextControl_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_MessageReceived';
|
||||
function BTextControl_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BTextControl_ResolveSpecifier';
|
||||
procedure BTextControl_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_MouseUp';
|
||||
procedure BTextControl_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_MouseMoved';
|
||||
procedure BTextControl_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_DetachedFromWindow';
|
||||
procedure BTextControl_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_AllAttached';
|
||||
procedure BTextControl_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_AllDetached';
|
||||
function BTextControl_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BTextControl_GetSupportedSuites';
|
||||
procedure BTextControl_SetFlags(AObject : TCPlusObject; flags : Cardinal); cdecl; external BePascalLibName name 'BTextControl_SetFlags';
|
||||
function BTextControl_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BTextControl_Perform';
|
||||
|
||||
|
||||
|
||||
{procedure BTextControl__ReservedTextControl1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl__ReservedTextControl1';
|
||||
procedure BTextControl__ReservedTextControl2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl__ReservedTextControl2';
|
||||
procedure BTextControl__ReservedTextControl3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl__ReservedTextControl3';
|
||||
procedure BTextControl__ReservedTextControl4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl__ReservedTextControl4';
|
||||
function BTextControl_operator=(AObject : TCPlusObject; : BTextControl) : BTextControl; cdecl; external BePascalLibName name 'BTextControl_operator=';
|
||||
procedure BTextControl_CommitValue(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_CommitValue';
|
||||
procedure BTextControl_InitData(AObject : TCPlusObject; label : PChar; initial_text : PChar; data : BMessage); cdecl; external BePascalLibName name 'BTextControl_InitData';
|
||||
procedure BTextControl__BTextInput_ *fText(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl__BTextInput_ *fText';
|
||||
procedure BTextControl_char *fLabel(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_char *fLabel';
|
||||
procedure BTextControl_BMessage *fModificationMessage(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_BMessage *fModificationMessage';
|
||||
procedure BTextControl_alignment fLabelAlign(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_alignment fLabelAlign';
|
||||
procedure BTextControl_float fDivider(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_float fDivider';
|
||||
procedure BTextControl_uint16 fPrevWidth(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_uint16 fPrevWidth';
|
||||
procedure BTextControl_uint16 fPrevHeight(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_uint16 fPrevHeight';
|
||||
procedure BTextControl_uint32 _reserved[3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_uint32 _reserved[3]';
|
||||
procedure BTextControl_uint32 _more_reserved[4](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_uint32 _more_reserved[4]';
|
||||
procedure BTextControl_bool fClean(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_bool fClean';
|
||||
procedure BTextControl_bool fSkipSetFlags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_bool fSkipSetFlags';
|
||||
procedure BTextControl_bool fUnusedBool1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_bool fUnusedBool1';
|
||||
procedure BTextControl_bool fUnusedBool2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextControl_bool fUnusedBool2';
|
||||
}
|
||||
implementation
|
||||
|
||||
destructor BTextControl.Destroy;
|
||||
begin
|
||||
BTextControl_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
constructor BTextControl.Create(frame : BRect; name, aLabel,initial : PChar; message : BMessage; resizingMode, flags : Cardinal);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BTextControl_Create(Self, frame.CPlusObject, name, aLabel,initial, message.CPlusObject, resizingMode, flags);
|
||||
end;
|
||||
|
||||
|
||||
constructor BTextControl.Create(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BTextControl_Create(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextControl.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BTextControl_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextControl.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BTextControl_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BTextControl.SetText(texte : PChar);
|
||||
begin
|
||||
BTextControl_SetText(CPlusObject, texte);
|
||||
end;
|
||||
|
||||
function BTextControl.Text : PChar;
|
||||
begin
|
||||
Result := BTextControl_Text(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.SetValue(valu : integer);
|
||||
begin
|
||||
BTextControl_SetValue(CPlusObject, valu);
|
||||
end;
|
||||
|
||||
function BTextControl.Invoke(msg : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BTextControl_Invoke(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextControl.TextView : BTextControl;
|
||||
begin
|
||||
Result := BTextControl_TextView(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.SetModificationMessage(message : BMessage);
|
||||
begin
|
||||
BTextControl_SetModificationMessage(CPlusObject, message.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextControl.ModificationMessage : BMessage;
|
||||
begin
|
||||
Result := BTextControl_ModificationMessage(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.SetAlignment(alabel : Alignment; texte : Alignment);
|
||||
begin
|
||||
BTextControl_SeAlignment(CPlusObject, alabel, texte);
|
||||
end;
|
||||
|
||||
procedure BTextControl.GeAlignment(alabel : Alignment; texte : Alignment);
|
||||
begin
|
||||
BTextControl_GeAlignment(CPlusObject, alabel, texte);
|
||||
end;
|
||||
|
||||
procedure BTextControl.SetDivider(dividing_line : single);
|
||||
begin
|
||||
BTextControl_SetDivider(CPlusObject, dividing_line);
|
||||
end;
|
||||
|
||||
function BTextControl.Divider : single;
|
||||
begin
|
||||
Result := BTextControl_Divider(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.Draw(updateRect : BRect);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTextControl.MouseDown(where : BPoint);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTextControl.AttachedToWindow;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTextControl.MakeFocus(focusState : boolean);
|
||||
begin
|
||||
BTextControl_MakeFocus(CPlusObject, focusState);
|
||||
end;
|
||||
|
||||
procedure BTextControl.SetEnabled(state : boolean);
|
||||
begin
|
||||
BTextControl_SetEnabled(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BTextControl.FrameMoved(new_position : BPoint);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BTextControl.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
// BTextControl_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
procedure BTextControl.WindowActivated(active : boolean);
|
||||
begin
|
||||
//BTextControl_WindowActivated(CPlusObject, active);
|
||||
end;
|
||||
|
||||
procedure BTextControl.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
//BTextControl_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BTextControl.ResizeToPreferred;
|
||||
begin
|
||||
//BTextControl_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.MessageReceived(msg : BMessage);
|
||||
begin
|
||||
//BTextControl_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextControl.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
Result := BTextControl_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
procedure BTextControl.MouseUp(pt : BPoint);
|
||||
begin
|
||||
//BTextControl_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage);
|
||||
begin
|
||||
//BTextControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure BTextControl.DetachedFromWindow;
|
||||
begin
|
||||
//BTextControl_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.AllAttached;
|
||||
begin
|
||||
//BTextControl_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.AllDetached;
|
||||
begin
|
||||
//BTextControl_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextControl.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
|
||||
Result := BTextControl_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.SetFlags(flags : Cardinal);
|
||||
begin
|
||||
BTextControl_SetFlags(CPlusObject, flags);
|
||||
end;
|
||||
|
||||
function BTextControl.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BTextControl_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
{procedure BTextControl._ReservedTextControl1;
|
||||
begin
|
||||
BTextControl__ReservedTextControl1(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl._ReservedTextControl2;
|
||||
begin
|
||||
BTextControl__ReservedTextControl2(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl._ReservedTextControl3;
|
||||
begin
|
||||
BTextControl__ReservedTextControl3(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl._ReservedTextControl4;
|
||||
begin
|
||||
BTextControl__ReservedTextControl4(CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextControl.operator=( : BTextControl) : BTextControl;
|
||||
begin
|
||||
Result := BTextControl_operator=(CPlusObject, );
|
||||
end;
|
||||
|
||||
procedure BTextControl.CommitValue;
|
||||
begin
|
||||
BTextControl_CommitValue(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.InitData(label : PChar; initial_text : PChar; data : BMessage);
|
||||
begin
|
||||
BTextControl_InitData(CPlusObject, label, initial_text, data.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl._BTextInput_ *fText;
|
||||
begin
|
||||
BTextControl__BTextInput_ *fText(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.char *fLabel;
|
||||
begin
|
||||
BTextControl_char *fLabel(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.BMessage *fModificationMessage;
|
||||
begin
|
||||
BTextControl_BMessage *fModificationMessage(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.alignment fLabelAlign;
|
||||
begin
|
||||
BTextControl_alignment fLabelAlign(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.float fDivider;
|
||||
begin
|
||||
BTextControl_float fDivider(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.uint16 fPrevWidth;
|
||||
begin
|
||||
BTextControl_uint16 fPrevWidth(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.uint16 fPrevHeight;
|
||||
begin
|
||||
BTextControl_uint16 fPrevHeight(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.uint32 _reserved[3];
|
||||
begin
|
||||
BTextControl_uint32 _reserved[3](CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.uint32 _more_reserved[4];
|
||||
begin
|
||||
BTextControl_uint32 _more_reserved[4](CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.bool fClean;
|
||||
begin
|
||||
BTextControl_bool fClean(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.bool fSkipSetFlags;
|
||||
begin
|
||||
BTextControl_bool fSkipSetFlags(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.bool fUnusedBool1;
|
||||
begin
|
||||
BTextControl_bool fUnusedBool1(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextControl.bool fUnusedBool2;
|
||||
begin
|
||||
BTextControl_bool fUnusedBool2(CPlusObject);
|
||||
end;
|
||||
}
|
||||
|
||||
end.
|
||||
850
bepascal/source/bepascal/pas/src/be/interface/textview.pp
Normal file
850
bepascal/source/bepascal/pas/src/be/interface/textview.pp
Normal file
@@ -0,0 +1,850 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit textview;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, view, message, archivable, SupportDefs, rect, list,
|
||||
handler, messenger,interfacedefs,font,graphicdefs;
|
||||
type
|
||||
text_run = Record
|
||||
offset : LongInt;
|
||||
font : BFont;
|
||||
color : RGB_color;
|
||||
end;
|
||||
|
||||
type
|
||||
text_run_array = Record
|
||||
count : LongInt;
|
||||
runs : Array[1..1] of text_run ;
|
||||
end;
|
||||
|
||||
type
|
||||
undo_state =(undo_state_nil,
|
||||
B_UNDO_UNAVAILABLE,
|
||||
B_UNDO_TYPING,
|
||||
B_UNDO_CUT,
|
||||
B_UNDO_PASTE,
|
||||
B_UNDO_CLEAR,
|
||||
B_UNDO_DROP);
|
||||
|
||||
type
|
||||
BTextView = class(BView)
|
||||
private
|
||||
public
|
||||
constructor Create(frame : BRect; name : pchar;atexBRect: BRect ; resizeMask, flags : cardinal); virtual;
|
||||
// constructor Create(bounds : BRect; name : pchar; texte : pchar; resizeflags, flags : cardinal); virtual;
|
||||
constructor Create(data : BMessage);virtual;
|
||||
destructor Destroy;override;
|
||||
function Instantiate(data : BMessage) : BArchivable;
|
||||
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
procedure AttachedToWindow;override;
|
||||
procedure DetachedFromWindow;override;
|
||||
procedure Draw(inRect : BRect);override;
|
||||
procedure MouseDown(where : BPoint);override;
|
||||
procedure MouseUp(where : BPoint);override;
|
||||
procedure MouseMoved(where : BPoint; code : Cardinal; message : BMessage);override;
|
||||
procedure WindowActivated(state : boolean);override;
|
||||
procedure KeyDown(bytes : PChar; numBytes : integer);override;
|
||||
procedure Pulse;override;
|
||||
procedure FrameResized(width : double; height : double);override;
|
||||
procedure MakeFocus(focusState : boolean);
|
||||
procedure MessageReceived(message : BMessage);override;
|
||||
function ResolveSpecifier(message : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
function GetSupportedSuites(data : BMessage) : Status_t;
|
||||
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
procedure SetText(inText : PChar; var inRuns : text_run_array);
|
||||
procedure SetText(inText : PChar; inLength : integer; var inRuns : text_run_array);
|
||||
// procedure SetText(inFile : TFile; startOffset : integer; inLength : integer; var inRuns : text_run_array);
|
||||
procedure Insert(inText : PChar; var inRuns : text_run_array);
|
||||
procedure Insert(inText : PChar; inLength : integer; var inRuns : text_run_array);
|
||||
procedure Insert(startOffset : integer; inText : PChar; inLength : integer;var inRuns : text_run_array);
|
||||
procedure Delete;
|
||||
procedure Delete(startOffset : integer; endOffset : integer);
|
||||
function aText : PChar;
|
||||
function TextLength : integer;
|
||||
procedure GetText(offset : integer; length : integer; buffer : PChar);
|
||||
function ByteAt(offset : integer) : PChar;
|
||||
function CountLines : integer;
|
||||
function CurrentLine : integer;
|
||||
procedure GoToLine(lineNum : integer);
|
||||
{ procedure Cut(clipboard : TClipboard);
|
||||
procedure Copy(clipboard : TClipboard);
|
||||
procedure Paste(clipboard : TClipboard);
|
||||
procedure Clear;
|
||||
function AcceptsPaste(clipboard : TClipboard) : boolean;
|
||||
} function AcceptsDrop(inMessage : BMessage) : boolean;
|
||||
procedure Select(startOffset : integer; endOffset : integer);
|
||||
procedure SelectAll;
|
||||
// procedure GetSelection(outStart : integer; outEnd : integer);
|
||||
procedure SetFontAndColor(inFont : BFont; inMode : Cardinal; var inColor : RGB_color);
|
||||
// procedure SeBFontAndColor(inFont : BFont; inMode : Cardinal);
|
||||
// procedure SeBFontAndColor(inFont : BFont);
|
||||
procedure SeTFontAndColor(startOffset : Cardinal; endOffset : Cardinal; inFont : BFont; inMode : Cardinal; var inColor : RGB_color);
|
||||
procedure GeTFontAndColor(inOffset : integer; ouBFont : BFont; outColor : RGB_color);
|
||||
procedure GeTFontAndColor(ouBFont : BFont; outMode : integer; outColor : RGB_color; outEqColor : boolean);
|
||||
{ procedure SetRunArray(startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array);
|
||||
function RunArray(startOffset : integer; endOffset : integer; outSize : ^integer) : text_run_array;
|
||||
} function LineAt(offset : integer) : integer;
|
||||
function LineAt(point : BPoint) : integer;
|
||||
function PointAt(inOffset : integer; outHeight : double) : BPoint;
|
||||
function OffsetAt(point : BPoint) : integer;
|
||||
function OffsetAt(line : integer) : integer;
|
||||
procedure FindWord(inOffset : integer; outFromOffset : integer; outToOffset : integer);
|
||||
function CanEndLine(offset : integer) : boolean;
|
||||
function LineWidth(lineNum : integer) : double;
|
||||
function LineHeight(lineNum : integer) : double;
|
||||
function TextHeight(startLine : integer; endLine : integer) : double;
|
||||
// procedure GetTextRegion(startOffset : integer; endOffset : integer; outRegion : TRegion);
|
||||
procedure ScrollToOffset(inOffset : integer);
|
||||
procedure ScrollToSelection;
|
||||
procedure Highlight(startOffset : integer; endOffset : integer);
|
||||
procedure SetTexBRect(rect : BRect);
|
||||
function TexBRect : BRect;
|
||||
procedure SetStylable(stylable : boolean);
|
||||
function IsStylable : boolean;
|
||||
procedure SetTabWidth(width : double);
|
||||
function TabWidth : double;
|
||||
procedure MakeSelectable(selectable : boolean);
|
||||
function IsSelectable : boolean;
|
||||
procedure MakeEditable(editable : boolean);
|
||||
function IsEditable : boolean;
|
||||
procedure SetWordWrap(awrap : boolean);
|
||||
function DoesWordWrap : boolean;
|
||||
procedure SetMaxBytes(max : integer);
|
||||
function MaxBytes : integer;
|
||||
procedure DisallowChar(aChar : Cardinal);
|
||||
procedure AllowChar(aChar : Cardinal);
|
||||
procedure Sealignment(flag : alignment);
|
||||
function GetAlignment : alignment;
|
||||
procedure SetAutoindent(state : boolean);
|
||||
function DoesAutoindent : boolean;
|
||||
{ procedure SetColorSpace(colors : TColor_Space);
|
||||
function ColorSpace : TColor_Space;
|
||||
} procedure MakeResizable(resize : boolean; resizeView : BView);
|
||||
function IsResizable : boolean;
|
||||
procedure SetDoesUndo(undo : boolean);
|
||||
function DoesUndo : boolean;
|
||||
procedure HideTyping(enabled : boolean);
|
||||
function IsTypingHidden : boolean;
|
||||
procedure ResizeToPreferred;override;
|
||||
procedure GetPreferredSize(width : double; height : double);virtual;
|
||||
procedure AllAttached;override;
|
||||
procedure AllDetached;override;
|
||||
{ function FlattenRunArray(inArray : Ttext_tun_array; outSize : ^integer) : Pointer;
|
||||
function UnflattenRunArray(data : Pointer; outSize : ^integer) : text_run_array;
|
||||
procedure InsertText(inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array);
|
||||
}
|
||||
// procedure Undo(clipboard : TClipboard);
|
||||
// procedure GetDragParameters(drag : BMessage; bitmap : TBitmap; point : BPoint; handler : BHandler);
|
||||
// procedure InitObject(atexBRect : BRect; initialFont : BFont; initialColor : RGB_color);
|
||||
end;
|
||||
|
||||
function BTextView_Create(AObject : TBeObject;frame : TCPlusObject; name : pchar; atexBRect: TCPlusObject ; resizeMask, flags : cardinal): TCPlusObject; cdecl; external BePascalLibName name 'BTextView_Create';
|
||||
|
||||
function BTextView_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTextView_Create_1';
|
||||
procedure BTextView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_FREE';
|
||||
function BTextView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BTextView_Instantiate';
|
||||
function BTextView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BTextView_Archive';
|
||||
procedure BTextView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_AttachedToWindow';
|
||||
procedure BTextView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_DetachedFromWindow';
|
||||
procedure BTextView_Draw(AObject : TCPlusObject; inRect : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Draw';
|
||||
procedure BTextView_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MouseDown';
|
||||
procedure BTextView_MouseUp(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MouseUp';
|
||||
procedure BTextView_MouseMoved(AObject : TCPlusObject; where : TCPlusObject; code : Cardinal; message : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MouseMoved';
|
||||
procedure BTextView_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BTextView_WindowActivated';
|
||||
procedure BTextView_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BTextView_KeyDown';
|
||||
procedure BTextView_Pulse(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Pulse';
|
||||
procedure BTextView_FrameResized(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BTextView_FrameResized';
|
||||
procedure BTextView_MakeFocus(AObject : TCPlusObject; focusState : boolean); cdecl; external BePascalLibName name 'BTextView_MakeFocus';
|
||||
procedure BTextView_MessageReceived(AObject : TCPlusObject; message : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MessageReceived';
|
||||
function BTextView_ResolveSpecifier(AObject : TCPlusObject; message : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BTextView_ResolveSpecifier';
|
||||
function BTextView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BTextView_GetSupportedSuites';
|
||||
function BTextView_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BTextView_Perform';
|
||||
procedure BTextView_SetText(AObject : TCPlusObject; inText : PChar;var inRuns : text_run_array); cdecl; external BePascalLibName name 'BTextView_SetText';
|
||||
procedure BTextView_SetText(AObject : TCPlusObject; inText : PChar; inLength : integer;var inRuns : text_run_array); cdecl; external BePascalLibName name 'BTextView_SetText_1';
|
||||
//procedure BTextView_SetText(AObject : TCPlusObject; inFile : TFile; startOffset : integer; inLength : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_SetText';
|
||||
procedure BTextView_Insert(AObject : TCPlusObject; inText : PChar;var inRuns : text_run_array); cdecl; external BePascalLibName name 'BTextView_Insert';
|
||||
procedure BTextView_Insert(AObject : TCPlusObject; inText : PChar; inLength : integer;var inRuns : text_run_array); cdecl; external BePascalLibName name 'BTextView_Insert_1';
|
||||
procedure BTextView_Insert(AObject : TCPlusObject; startOffset : integer; inText : PChar; inLength : integer;var inRuns : text_run_array); cdecl; external BePascalLibName name 'BTextView_Insert_2';
|
||||
procedure BTextView_Delete(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Delete';
|
||||
procedure BTextView_Delete(AObject : TCPlusObject; startOffset : integer; endOffset : integer); cdecl; external BePascalLibName name 'BTextView_Delete_1';
|
||||
function BTextView_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BTextView_Text';
|
||||
function BTextView_TextLength(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_TextLength';
|
||||
procedure BTextView_GetText(AObject : TCPlusObject; offset : integer; length : integer; buffer : PChar); cdecl; external BePascalLibName name 'BTextView_GetText';
|
||||
function BTextView_ByteAt(AObject : TCPlusObject; offset : integer) : PChar; cdecl; external BePascalLibName name 'BTextView_ByteAt';
|
||||
function BTextView_CountLines(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_CountLines';
|
||||
function BTextView_CurrentLine(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_CurrentLine';
|
||||
procedure BTextView_GoToLine(AObject : TCPlusObject; lineNum : integer); cdecl; external BePascalLibName name 'BTextView_GoToLine';
|
||||
//procedure BTextView_Cut(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Cut';
|
||||
//procedure BTextView_Copy(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Copy';
|
||||
//procedure BTextView_Paste(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Paste';
|
||||
procedure BTextView_Clear(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Clear';
|
||||
//function BTextView_AcceptsPaste(AObject : TCPlusObject; clipboard : TClipboard) : boolean; cdecl; external BePascalLibName name 'BTextView_AcceptsPaste';
|
||||
function BTextView_AcceptsDrop(AObject : TCPlusObject; inMessage : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_AcceptsDrop';
|
||||
procedure BTextView_Select(AObject : TCPlusObject; startOffset : integer; endOffset : integer); cdecl; external BePascalLibName name 'BTextView_Select';
|
||||
procedure BTextView_SelectAll(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_SelectAll';
|
||||
//procedure BTextView_GetSelection(AObject : TCPlusObject; outStart : ^integer; outEnd : ^integer); cdecl; external BePascalLibName name 'BTextView_GetSelection';
|
||||
procedure BTextView_SeBFontAndColor(AObject : TCPlusObject; inFont : TCPlusObject; inMode : Cardinal; var inColor : RGB_color); cdecl; external BePascalLibName name 'BTextView_SetFontAndColor';
|
||||
//procedure BTextView_SeBFontAndColor(AObject : TCPlusObject; inFont : TCPlusObject; inMode : Cardinal); cdecl; external BePascalLibName name 'BTextView_SeBFontAndColor_1';
|
||||
//procedure BTextView_SeBFontAndColor(AObject : TCPlusObject; inFont : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_SeBFontAndColor_1';
|
||||
procedure BTextView_SeBFontAndColor(AObject : TCPlusObject; startOffset : cardinal; endOffset : cardinal; inFont : TCPlusObject; inMode : Cardinal; var inColor : RGB_color); cdecl; external BePascalLibName name 'BTextView_SetFontAndColor_1';
|
||||
procedure BTextView_GeBFontAndColor(AObject : TCPlusObject; inOffset : cardinal; ouBFont : TCPlusObject; outColor : RGB_color); cdecl; external BePascalLibName name 'BTextView_GetFontAndColor';
|
||||
procedure BTextView_GeBFontAndColor(AObject : TCPlusObject; ouBFont : TCPlusObject; outMode : integer; outColor : RGB_color; outEqColor : boolean); cdecl; external BePascalLibName name 'BTextView_GetFontAndColor_1';
|
||||
//procedure BTextView_SetRunArray(AObject : TCPlusObject; startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_SetRunArray';
|
||||
//function BTextView_RunArray(AObject : TCPlusObject; startOffset : integer; endOffset : integer; outSize : ^integer) : text_run_array; cdecl; external BePascalLibName name 'BTextView_RunArray';
|
||||
function BTextView_LineAt(AObject : TCPlusObject; offset : integer) : integer; cdecl; external BePascalLibName name 'BTextView_LineAt';
|
||||
function BTextView_LineAt(AObject : TCPlusObject; point : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_LineAt_1';
|
||||
function BTextView_PointAt(AObject : TCPlusObject; inOffset : integer; outHeight : double) : BPoint; cdecl; external BePascalLibName name 'BTextView_PointAt';
|
||||
function BTextView_OffsetAt(AObject : TCPlusObject; point : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_OffsetAt';
|
||||
function BTextView_OffsetAt(AObject : TCPlusObject; line : integer) : integer; cdecl; external BePascalLibName name 'BTextView_OffsetAt_1';
|
||||
procedure BTextView_FindWord(AObject : TCPlusObject; inOffset : integer; outFromOffset : integer; outToOffset : integer); cdecl; external BePascalLibName name 'BTextView_FindWord';
|
||||
function BTextView_CanEndLine(AObject : TCPlusObject; offset : integer) : boolean; cdecl; external BePascalLibName name 'BTextView_CanEndLine';
|
||||
function BTextView_LineWidth(AObject : TCPlusObject; lineNum : integer) : double; cdecl; external BePascalLibName name 'BTextView_LineWidth';
|
||||
function BTextView_LineHeight(AObject : TCPlusObject; lineNum : integer) : double; cdecl; external BePascalLibName name 'BTextView_LineHeight';
|
||||
function BTextView_TextHeight(AObject : TCPlusObject; startLine : integer; endLine : integer) : double; cdecl; external BePascalLibName name 'BTextView_TextHeight';
|
||||
//procedure BTextView_GetTextRegion(AObject : TCPlusObject; startOffset : integer; endOffset : integer; outRegion : TRegion); cdecl; external BePascalLibName name 'BTextView_GetTextRegion';
|
||||
procedure BTextView_ScrollToOffset(AObject : TCPlusObject; inOffset : integer); cdecl; external BePascalLibName name 'BTextView_ScrollToOffset';
|
||||
procedure BTextView_ScrollToSelection(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_ScrollToSelection';
|
||||
procedure BTextView_Highlight(AObject : TCPlusObject; startOffset : integer; endOffset : integer); cdecl; external BePascalLibName name 'BTextView_Highlight';
|
||||
procedure BTextView_SetTexBRect(AObject : TCPlusObject; rect : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_SetTextRect';
|
||||
function BTextView_TexBRect(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BTextView_TextRect';
|
||||
procedure BTextView_SetStylable(AObject : TCPlusObject; stylable : boolean); cdecl; external BePascalLibName name 'BTextView_SetStylable';
|
||||
function BTextView_IsStylable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsStylable';
|
||||
procedure BTextView_SetTabWidth(AObject : TCPlusObject; width : double); cdecl; external BePascalLibName name 'BTextView_SetTabWidth';
|
||||
function BTextView_TabWidth(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BTextView_TabWidth';
|
||||
procedure BTextView_MakeSelectable(AObject : TCPlusObject; selectable : boolean); cdecl; external BePascalLibName name 'BTextView_MakeSelectable';
|
||||
function BTextView_IsSelectable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsSelectable';
|
||||
procedure BTextView_MakeEditable(AObject : TCPlusObject; editable : boolean); cdecl; external BePascalLibName name 'BTextView_MakeEditable';
|
||||
function BTextView_IsEditable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsEditable';
|
||||
procedure BTextView_SetWordWrap(AObject : TCPlusObject; wrap : boolean); cdecl; external BePascalLibName name 'BTextView_SetWordWrap';
|
||||
function BTextView_DoesWordWrap(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_DoesWordWrap';
|
||||
procedure BTextView_SetMaxBytes(AObject : TCPlusObject; max : integer); cdecl; external BePascalLibName name 'BTextView_SetMaxBytes';
|
||||
function BTextView_MaxBytes(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_MaxBytes';
|
||||
procedure BTextView_DisallowChar(AObject : TCPlusObject; aChar : Cardinal); cdecl; external BePascalLibName name 'BTextView_DisallowChar';
|
||||
procedure BTextView_AllowChar(AObject : TCPlusObject; aChar : Cardinal); cdecl; external BePascalLibName name 'BTextView_AllowChar';
|
||||
procedure BTextView_Sealignment(AObject : TCPlusObject; flag : alignment); cdecl; external BePascalLibName name 'BTextView_SetAlignment';
|
||||
function BTextView_Alignment(AObject : TCPlusObject) : alignment; cdecl; external BePascalLibName name 'BTextView_Alignment';
|
||||
procedure BTextView_SetAutoindent(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BTextView_SetAutoindent';
|
||||
function BTextView_DoesAutoindent(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_DoesAutoindent';
|
||||
//procedure BTextView_SetColorSpace(AObject : TCPlusObject; colors : TColor_Space); cdecl; external BePascalLibName name 'BTextView_SetColorSpace';
|
||||
//function BTextView_ColorSpace(AObject : TCPlusObject) : TColor_Space; cdecl; external BePascalLibName name 'BTextView_ColorSpace';
|
||||
procedure BTextView_MakeResizable(AObject : TCPlusObject; resize : boolean; resizeView : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MakeResizable';
|
||||
function BTextView_IsResizable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsResizable';
|
||||
procedure BTextView_SetDoesUndo(AObject : TCPlusObject; undo : boolean); cdecl; external BePascalLibName name 'BTextView_SetDoesUndo';
|
||||
function BTextView_DoesUndo(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_DoesUndo';
|
||||
procedure BTextView_HideTyping(AObject : TCPlusObject; enabled : boolean); cdecl; external BePascalLibName name 'BTextView_HideTyping';
|
||||
function BTextView_IsTypingHidden(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsTypingHidden';
|
||||
procedure BTextView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_ResizeToPreferred';
|
||||
procedure BTextView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BTextView_GetPreferredSize';
|
||||
procedure BTextView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_AllAttached';
|
||||
procedure BTextView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_AllDetached';
|
||||
//function BTextView_FlattenRunArray(AObject : TCPlusObject; inArray : Ttext_tun_array; outSize : ^integer) : Pointer; cdecl; external BePascalLibName name 'BTextView_FlattenRunArray';
|
||||
//function BTextView_UnflattenRunArray(AObject : TCPlusObject; data : Pointer; outSize : ^integer) : text_run_array; cdecl; external BePascalLibName name 'BTextView_UnflattenRunArray';
|
||||
//procedure BTextView_InsertText(AObject : TCPlusObject; inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_InsertText';
|
||||
//procedure BTextView_Undo(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Undo';
|
||||
//function BTextView_UndoState(AObject : TCPlusObject; isRedo : boolean) : Tunde_state; cdecl; external BePascalLibName name 'BTextView_UndoState';
|
||||
//procedure BTextView_GetDragParameters(AObject : TCPlusObject; drag : BMessage; bitmap : TBitmap; point : BPoint; handler : BHandler); cdecl; external BePascalLibName name 'BTextView_GetDragParameters';
|
||||
procedure BTextView__ReservedTextView3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView3';
|
||||
procedure BTextView__ReservedTextView4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView4';
|
||||
procedure BTextView__ReservedTextView5(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView5';
|
||||
procedure BTextView__ReservedTextView6(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView6';
|
||||
procedure BTextView__ReservedTextView7(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView7';
|
||||
procedure BTextView__ReservedTextView8(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView8';
|
||||
procedure BTextView__ReservedTextView9(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView9';
|
||||
procedure BTextView__ReservedTextView10(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView10';
|
||||
procedure BTextView__ReservedTextView11(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView11';
|
||||
procedure BTextView__ReservedTextView12(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView12';
|
||||
//procedure BTextView_InitObject(AObject : TCPlusObject; texBRect : BRect; initialFont : BFont; initialColor : RGB_color); cdecl; external BePascalLibName name 'BTextView_InitObject';
|
||||
procedure BTextView_HandleBackspace(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_HandleBackspace';
|
||||
procedure BTextView_HandleArrowKey(AObject : TCPlusObject; inArrowKey : Cardinal); cdecl; external BePascalLibName name 'BTextView_HandleArrowKey';
|
||||
procedure BTextView_HandleDelete(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_HandleDelete';
|
||||
procedure BTextView_HandlePageKey(AObject : TCPlusObject; inPageKey : Cardinal); cdecl; external BePascalLibName name 'BTextView_HandlePageKey';
|
||||
procedure BTextView_HandleAlphaKey(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BTextView_HandleAlphaKey';
|
||||
procedure BTextView_Refresh(AObject : TCPlusObject; fromOffset : integer; toOffset : integer; erase : boolean; scroll : boolean); cdecl; external BePascalLibName name 'BTextView_Refresh';
|
||||
//procedure BTextView_RecalLineBreaks(AObject : TCPlusObject; startLine : ^integer; endLine : ^integer); cdecl; external BePascalLibName name 'BTextView_RecalLineBreaks';
|
||||
function BTextView_FindLineBreak(AObject : TCPlusObject; fromOffset : integer; outAscent : double; outDescent : double; ioWidth : double) : integer; cdecl; external BePascalLibName name 'BTextView_FindLineBreak';
|
||||
function BTextView_StyledWidth(AObject : TCPlusObject; fromOffset : integer; length : integer; outAscent : double; outDescent : double) : double; cdecl; external BePascalLibName name 'BTextView_StyledWidth';
|
||||
function BTextView_ActualTabWidth(AObject : TCPlusObject; location : double) : double; cdecl; external BePascalLibName name 'BTextView_ActualTabWidth';
|
||||
//procedure BTextView_DoInsertText(AObject : TCPlusObject; inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array; outResult : ); cdecl; external BePascalLibName name 'BTextView_DoInsertText';
|
||||
//procedure BTextView_DoDeleteText(AObject : TCPlusObject; fromOffset : integer; toOffset : integer; outResult : ); cdecl; external BePascalLibName name 'BTextView_DoDeleteText';
|
||||
procedure BTextView_DrawLines(AObject : TCPlusObject; startLine : integer; endLine : integer; startOffset : integer; erase : boolean); cdecl; external BePascalLibName name 'BTextView_DrawLines';
|
||||
procedure BTextView_DrawCaret(AObject : TCPlusObject; offset : integer); cdecl; external BePascalLibName name 'BTextView_DrawCaret';
|
||||
procedure BTextView_InvertCaret(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_InvertCaret';
|
||||
procedure BTextView_DragCaret(AObject : TCPlusObject; offset : integer); cdecl; external BePascalLibName name 'BTextView_DragCaret';
|
||||
procedure BTextView_StopMouseTracking(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_StopMouseTracking';
|
||||
function BTextView_PerformMouseUp(AObject : TCPlusObject; where : BPoint) : boolean; cdecl; external BePascalLibName name 'BTextView_PerformMouseUp';
|
||||
function BTextView_PerformMouseMoved(AObject : TCPlusObject; where : BPoint; code : Cardinal) : boolean; cdecl; external BePascalLibName name 'BTextView_PerformMouseMoved';
|
||||
procedure BTextView_TrackMouse(AObject : TCPlusObject; where : BPoint; message : BMessage; force : boolean); cdecl; external BePascalLibName name 'BTextView_TrackMouse';
|
||||
procedure BTextView_TrackDrag(AObject : TCPlusObject; where : BPoint); cdecl; external BePascalLibName name 'BTextView_TrackDrag';
|
||||
procedure BTextView_InitiateDrag(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_InitiateDrag';
|
||||
function BTextView_MessageDropped(AObject : TCPlusObject; inMessage : BMessage; where : BPoint; offset : BPoint) : boolean; cdecl; external BePascalLibName name 'BTextView_MessageDropped';
|
||||
procedure BTextView_UpdateScrollbars(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_UpdateScrollbars';
|
||||
procedure BTextView_AutoResize(AObject : TCPlusObject; doredraw : boolean); cdecl; external BePascalLibName name 'BTextView_AutoResize';
|
||||
procedure BTextView_NewOffscreen(AObject : TCPlusObject; padding : double); cdecl; external BePascalLibName name 'BTextView_NewOffscreen';
|
||||
procedure BTextView_DeleteOffscreen(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_DeleteOffscreen';
|
||||
procedure BTextView_Activate(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Activate';
|
||||
procedure BTextView_Deactivate(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Deactivate';
|
||||
//procedure BTextView_NormalizeFont(AObject : TCPlusObject; font : BFont); cdecl; external BePascalLibName name 'BTextView_NormalizeFont';
|
||||
function BTextView_CharClassification(AObject : TCPlusObject; offset : integer) : Cardinal; cdecl; external BePascalLibName name 'BTextView_CharClassification';
|
||||
function BTextView_NextInitialByte(AObject : TCPlusObject; offset : integer) : integer; cdecl; external BePascalLibName name 'BTextView_NextInitialByte';
|
||||
function BTextView_PreviousInitialByte(AObject : TCPlusObject; offset : integer) : integer; cdecl; external BePascalLibName name 'BTextView_PreviousInitialByte';
|
||||
//function BTextView_GetProperty(AObject : TCPlusObject; specifier : BMessage; form : integer; property : PChar; reply : BMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_GetProperty';
|
||||
function BTextView_SetProperty(AObject : TCPlusObject; specifier : BMessage; form : integer; properti : PChar; reply : BMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_SetProperty';
|
||||
function BTextView_CountProperties(AObject : TCPlusObject; specifier : BMessage; form : integer; properti : PChar; reply : BMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_CountProperties';
|
||||
procedure BTextView_HandleInputMethodChanged(AObject : TCPlusObject; message : BMessage); cdecl; external BePascalLibName name 'BTextView_HandleInputMethodChanged';
|
||||
procedure BTextView_HandleInputMethodLocationRequest(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_HandleInputMethodLocationRequest';
|
||||
procedure BTextView_CancelInputMethod(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_CancelInputMethod';
|
||||
procedure BTextView_LockWidthBuffer(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_LockWidthBuffer';
|
||||
procedure BTextView_UnlockWidthBuffer(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_UnlockWidthBuffer';
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
constructor BTextView.Create(frame : BRect; name : pchar;atexBRect: BRect ; resizeMask, flags : cardinal);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BTextView_Create(Self, frame.CplusObject,name,atexBRect.CPlusObject,resizeMask,flags);
|
||||
end;
|
||||
|
||||
constructor BTextView.Create(data : BMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BTextView_Create(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
destructor BTextView.Destroy;
|
||||
begin
|
||||
BTextView_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BTextView.Instantiate(data : BMessage) : BArchivable;
|
||||
begin
|
||||
Result := BTextView_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||
begin
|
||||
Result := BTextView_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure BTextView.AttachedToWindow;
|
||||
begin
|
||||
// BTextView_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.DetachedFromWindow;
|
||||
begin
|
||||
// BTextView_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.Draw(inRect : BRect);
|
||||
begin
|
||||
// BTextView_Draw(CPlusObject, inRect.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.MouseDown(where : BPoint);
|
||||
begin
|
||||
// BTextView_MouseDown(CPlusObject, where.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.MouseUp(where : BPoint);
|
||||
begin
|
||||
//BTextView_MouseUp(CPlusObject, where.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.MouseMoved(where : BPoint; code : Cardinal; message : BMessage);
|
||||
begin
|
||||
//BTextView_MouseMoved(CPlusObject, where.CPlusObject, code, message);
|
||||
end;
|
||||
|
||||
procedure BTextView.WindowActivated(state : boolean);
|
||||
begin
|
||||
//BTextView_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure BTextView.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
//writeln('keydown textview');
|
||||
//BTextView_KeyDown(CPlusObject, bytes, numBytes);
|
||||
end;
|
||||
|
||||
procedure BTextView.Pulse;
|
||||
begin
|
||||
//BTextView_Pulse(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.FrameResized(width : double; height : double);
|
||||
begin
|
||||
// BTextView_FrameResized(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BTextView.MakeFocus(focusState : boolean);
|
||||
begin
|
||||
BTextView_MakeFocus(CPlusObject, focusState);
|
||||
end;
|
||||
|
||||
procedure BTextView.MessageReceived(message : BMessage);
|
||||
begin
|
||||
inherited;
|
||||
// BTextView_MessageReceived(CPlusObject, message.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.ResolveSpecifier(message : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
|
||||
begin
|
||||
//Result := BTextView_ResolveSpecifier(CPlusObject, message.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
function BTextView.GetSupportedSuites(data : BMessage) : Status_t;
|
||||
begin
|
||||
Result := BTextView_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||
begin
|
||||
Result := BTextView_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
procedure BTextView.SetText(inText : PChar; var inRuns : text_run_array);
|
||||
begin
|
||||
BTextView_SetText(CPlusObject, inText, inRuns);
|
||||
end;
|
||||
|
||||
procedure BTextView.SetText(inText : PChar; inLength : integer; var inRuns : text_run_array);
|
||||
begin
|
||||
BTextView_SetText(CPlusObject, inText, inLength, inRuns);
|
||||
end;
|
||||
|
||||
{procedure BTextView.SetText(inFile : TFile; startOffset : integer; inLength : integer; inRuns : text_run_array);
|
||||
begin
|
||||
BTextView_SetText(CPlusObject, inFile.CPlusObject, startOffset, inLength, inRuns);
|
||||
end;
|
||||
}
|
||||
procedure BTextView.Insert(inText : PChar;var inRuns : text_run_array);
|
||||
begin
|
||||
BTextView_Insert(CPlusObject, inText, inRuns);
|
||||
end;
|
||||
|
||||
procedure BTextView.Insert(inText : PChar; inLength : integer; var inRuns : text_run_array);
|
||||
begin
|
||||
BTextView_Insert(CPlusObject, inText, inLength, inRuns);
|
||||
end;
|
||||
|
||||
procedure BTextView.Insert(startOffset : integer; inText : PChar; inLength : integer; var inRuns : text_run_array);
|
||||
begin
|
||||
BTextView_Insert(CPlusObject, startOffset, inText, inLength, inRuns);
|
||||
end;
|
||||
|
||||
procedure BTextView.Delete;
|
||||
begin
|
||||
BTextView_Delete(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.Delete(startOffset : integer; endOffset : integer);
|
||||
begin
|
||||
BTextView_Delete(CPlusObject, startOffset, endOffset);
|
||||
end;
|
||||
|
||||
function BTextView.aText : PChar;
|
||||
begin
|
||||
Result := BTextView_Text(CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.TextLength : integer;
|
||||
begin
|
||||
Result := BTextView_TextLength(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.GetText(offset : integer; length : integer; buffer : PChar);
|
||||
begin
|
||||
BTextView_GetText(CPlusObject, offset, length, buffer);
|
||||
end;
|
||||
|
||||
function BTextView.ByteAt(offset : integer) : PChar;
|
||||
begin
|
||||
Result := BTextView_ByteAt(CPlusObject, offset);
|
||||
end;
|
||||
|
||||
function BTextView.CountLines : integer;
|
||||
begin
|
||||
Result := BTextView_CountLines(CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.CurrentLine : integer;
|
||||
begin
|
||||
Result := BTextView_CurrentLine(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.GoToLine(lineNum : integer);
|
||||
begin
|
||||
BTextView_GoToLine(CPlusObject, lineNum);
|
||||
end;
|
||||
|
||||
{procedure BTextView.Cut(clipboard : TClipboard);
|
||||
begin
|
||||
BTextView_Cut(CPlusObject, clipboard.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.Copy(clipboard : TClipboard);
|
||||
begin
|
||||
BTextView_Copy(CPlusObject, clipboard.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.Paste(clipboard : TClipboard);
|
||||
begin
|
||||
BTextView_Paste(CPlusObject, clipboard.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.Clear;
|
||||
begin
|
||||
BTextView_Clear(CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.AcceptsPaste(clipboard : TClipboard) : boolean;
|
||||
begin
|
||||
Result := BTextView_AcceptsPaste(CPlusObject, clipboard.CPlusObject);
|
||||
end;
|
||||
}
|
||||
function BTextView.AcceptsDrop(inMessage : BMessage) : boolean;
|
||||
begin
|
||||
Result := BTextView_AcceptsDrop(CPlusObject, inMessage);
|
||||
end;
|
||||
|
||||
procedure BTextView.Select(startOffset : integer; endOffset : integer);
|
||||
begin
|
||||
BTextView_Select(CPlusObject, startOffset, endOffset);
|
||||
end;
|
||||
|
||||
procedure BTextView.SelectAll;
|
||||
begin
|
||||
BTextView_SelectAll(CPlusObject);
|
||||
end;
|
||||
|
||||
{procedure BTextView.GetSelection(outStart : integer; outEnd : integer);
|
||||
begin
|
||||
BTextView_GetSelection(CPlusObject, outStart, outEnd);
|
||||
end;
|
||||
}
|
||||
procedure BTextView.SeTFontAndColor(inFont : BFont; inMode : Cardinal; var inColor : RGB_color);
|
||||
begin
|
||||
BTextView_SeBFontAndColor(CPlusObject, inFont.CPlusObject, inMode, inColor);
|
||||
end;
|
||||
|
||||
//procedure BTextView.SeBFontAndColor(inFont : BFont; inMode : Cardinal);
|
||||
//begin
|
||||
// BTextView_SeBFontAndColor(CPlusObject, inFont.CPlusObject, inMode);
|
||||
//end;
|
||||
|
||||
//procedure BTextView.SeBFontAndColor(inFont : BFont);
|
||||
//begin
|
||||
// BTextView_SeBFontAndColor(CPlusObject, inFont.CPlusObject);
|
||||
//end;
|
||||
|
||||
procedure BTextView.SetFontAndColor(startOffset : cardinal; endOffset : cardinal; inFont : BFont; inMode : Cardinal; var inColor : RGB_color);
|
||||
begin
|
||||
BTextView_SeBFontAndColor(CPlusObject, startOffset, endOffset, inFont.CPlusObject, inMode, inColor);
|
||||
end;
|
||||
|
||||
procedure BTextView.GetFontAndColor(inOffset : integer; ouBFont : BFont; outColor : RGB_color);
|
||||
begin
|
||||
BTextView_GeBFontAndColor(CPlusObject, inOffset, ouBFont.CPlusObject, outColor);
|
||||
end;
|
||||
|
||||
procedure BTextView.GetFontAndColor(ouBFont : BFont; outMode : integer; outColor : RGB_color; outEqColor : boolean);
|
||||
begin
|
||||
BTextView_GeBFontAndColor(CPlusObject, ouBFont.CPlusObject, outMode, outColor, outEqColor);
|
||||
end;
|
||||
{
|
||||
procedure BTextView.SetRunArray(startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array);
|
||||
begin
|
||||
BTextView_SetRunArray(CPlusObject, startOffset, endOffset, inRuns);
|
||||
end;
|
||||
|
||||
function BTextView.RunArray(startOffset : integer; endOffset : integer; outSize : ^integer) : text_run_array;
|
||||
begin
|
||||
Result := BTextView_RunArray(CPlusObject, startOffset, endOffset, outSize);
|
||||
end;
|
||||
}
|
||||
function BTextView.LineAt(offset : integer) : integer;
|
||||
begin
|
||||
Result := BTextView_LineAt(CPlusObject, offset);
|
||||
end;
|
||||
|
||||
function BTextView.LineAt(point : BPoint) : integer;
|
||||
begin
|
||||
Result := BTextView_LineAt(CPlusObject, point.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.PointAt(inOffset : integer; outHeight : double) : BPoint;
|
||||
begin
|
||||
Result := BTextView_PointAt(CPlusObject, inOffset, outHeight);
|
||||
end;
|
||||
|
||||
function BTextView.OffsetAt(point : BPoint) : integer;
|
||||
begin
|
||||
Result := BTextView_OffsetAt(CPlusObject, point.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.OffsetAt(line : integer) : integer;
|
||||
begin
|
||||
Result := BTextView_OffsetAt(CPlusObject, line);
|
||||
end;
|
||||
|
||||
procedure BTextView.FindWord(inOffset : integer; outFromOffset : integer; outToOffset : integer);
|
||||
begin
|
||||
BTextView_FindWord(CPlusObject, inOffset, outFromOffset, outToOffset);
|
||||
end;
|
||||
|
||||
function BTextView.CanEndLine(offset : integer) : boolean;
|
||||
begin
|
||||
Result := BTextView_CanEndLine(CPlusObject, offset);
|
||||
end;
|
||||
|
||||
function BTextView.LineWidth(lineNum : integer) : double;
|
||||
begin
|
||||
Result := BTextView_LineWidth(CPlusObject, lineNum);
|
||||
end;
|
||||
|
||||
function BTextView.LineHeight(lineNum : integer) : double;
|
||||
begin
|
||||
Result := BTextView_LineHeight(CPlusObject, lineNum);
|
||||
end;
|
||||
|
||||
function BTextView.TextHeight(startLine : integer; endLine : integer) : double;
|
||||
begin
|
||||
Result := BTextView_TextHeight(CPlusObject, startLine, endLine);
|
||||
end;
|
||||
|
||||
{procedure BTextView.GetTextRegion(startOffset : integer; endOffset : integer; outRegion : TRegion);
|
||||
begin
|
||||
BTextView_GetTextRegion(CPlusObject, startOffset, endOffset, outRegion.CPlusObject);
|
||||
end;
|
||||
}
|
||||
procedure BTextView.ScrollToOffset(inOffset : integer);
|
||||
begin
|
||||
BTextView_ScrollToOffset(CPlusObject, inOffset);
|
||||
end;
|
||||
|
||||
procedure BTextView.ScrollToSelection;
|
||||
begin
|
||||
BTextView_ScrollToSelection(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.Highlight(startOffset : integer; endOffset : integer);
|
||||
begin
|
||||
BTextView_Highlight(CPlusObject, startOffset, endOffset);
|
||||
end;
|
||||
|
||||
procedure BTextView.SetTexBRect(rect : BRect);
|
||||
begin
|
||||
BTextView_SetTexBRect(CPlusObject, rect.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.TexBRect : BRect;
|
||||
begin
|
||||
Result := BTextView_TexBRect(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.SetStylable(stylable : boolean);
|
||||
begin
|
||||
BTextView_SetStylable(CPlusObject, stylable);
|
||||
end;
|
||||
|
||||
function BTextView.IsStylable : boolean;
|
||||
begin
|
||||
Result := BTextView_IsStylable(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.SetTabWidth(width : double);
|
||||
begin
|
||||
BTextView_SetTabWidth(CPlusObject, width);
|
||||
end;
|
||||
|
||||
function BTextView.TabWidth : double;
|
||||
begin
|
||||
Result := BTextView_TabWidth(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.MakeSelectable(selectable : boolean);
|
||||
begin
|
||||
BTextView_MakeSelectable(CPlusObject, selectable);
|
||||
end;
|
||||
|
||||
function BTextView.IsSelectable : boolean;
|
||||
begin
|
||||
Result := BTextView_IsSelectable(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.MakeEditable(editable : boolean);
|
||||
begin
|
||||
BTextView_MakeEditable(CPlusObject, editable);
|
||||
end;
|
||||
|
||||
function BTextView.IsEditable : boolean;
|
||||
begin
|
||||
Result := BTextView_IsEditable(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.SetWordWrap(awrap : boolean);
|
||||
begin
|
||||
BTextView_SetWordWrap(CPlusObject, awrap);
|
||||
end;
|
||||
|
||||
function BTextView.DoesWordWrap : boolean;
|
||||
begin
|
||||
Result := BTextView_DoesWordWrap(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.SetMaxBytes(max : integer);
|
||||
begin
|
||||
BTextView_SetMaxBytes(CPlusObject, max);
|
||||
end;
|
||||
|
||||
function BTextView.MaxBytes : integer;
|
||||
begin
|
||||
Result := BTextView_MaxBytes(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.DisallowChar(aChar : Cardinal);
|
||||
begin
|
||||
BTextView_DisallowChar(CPlusObject, aChar);
|
||||
end;
|
||||
|
||||
procedure BTextView.AllowChar(aChar : Cardinal);
|
||||
begin
|
||||
BTextView_AllowChar(CPlusObject, aChar);
|
||||
end;
|
||||
|
||||
procedure BTextView.Sealignment(flag : alignment);
|
||||
begin
|
||||
BTextView_Sealignment(CPlusObject, flag);
|
||||
end;
|
||||
|
||||
function BTextView.getAlignment : alignment;
|
||||
begin
|
||||
Result := BTextView_Alignment(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.SetAutoindent(state : boolean);
|
||||
begin
|
||||
BTextView_SetAutoindent(CPlusObject, state);
|
||||
end;
|
||||
|
||||
function BTextView.DoesAutoindent : boolean;
|
||||
begin
|
||||
Result := BTextView_DoesAutoindent(CPlusObject);
|
||||
end;
|
||||
|
||||
{procedure BTextView.SetColorSpace(colors : TColor_Space);
|
||||
begin
|
||||
BTextView_SetColorSpace(CPlusObject, colors);
|
||||
end;
|
||||
|
||||
function BTextView.ColorSpace : TColor_Space;
|
||||
begin
|
||||
Result := BTextView_ColorSpace(CPlusObject);
|
||||
end;
|
||||
}
|
||||
procedure BTextView.MakeResizable(resize : boolean; resizeView : BView);
|
||||
begin
|
||||
BTextView_MakeResizable(CPlusObject, resize, resizeView.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.IsResizable : boolean;
|
||||
begin
|
||||
Result := BTextView_IsResizable(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.SetDoesUndo(undo : boolean);
|
||||
begin
|
||||
BTextView_SetDoesUndo(CPlusObject, undo);
|
||||
end;
|
||||
|
||||
function BTextView.DoesUndo : boolean;
|
||||
begin
|
||||
Result := BTextView_DoesUndo(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.HideTyping(enabled : boolean);
|
||||
begin
|
||||
BTextView_HideTyping(CPlusObject, enabled);
|
||||
end;
|
||||
|
||||
function BTextView.IsTypingHidden : boolean;
|
||||
begin
|
||||
Result := BTextView_IsTypingHidden(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.ResizeToPreferred;
|
||||
begin
|
||||
BTextView_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BTextView_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure BTextView.AllAttached;
|
||||
begin
|
||||
BTextView_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BTextView.AllDetached;
|
||||
begin
|
||||
BTextView_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
{function BTextView.FlattenRunArray(inArray : Ttext_tun_array; outSize : integer) : Pointer;
|
||||
begin
|
||||
Result := BTextView_FlattenRunArray(CPlusObject, inArray, outSize);
|
||||
end;
|
||||
|
||||
|
||||
function BTextView.UnflattenRunArray(data : Pointer; outSize : integer) : text_run_array;
|
||||
begin
|
||||
Result := BTextView_UnflattenRunArray(CPlusObject, data, outSize);
|
||||
end;
|
||||
|
||||
procedure BTextView.InsertText(inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array);
|
||||
begin
|
||||
BTextView_InsertText(CPlusObject, inText, inLength, inOffset, inRuns);
|
||||
end;
|
||||
}
|
||||
|
||||
{procedure BTextView.Undo(clipboard : TClipboard);
|
||||
begin
|
||||
BTextView_Undo(CPlusObject, clipboard.CPlusObject);
|
||||
end;
|
||||
|
||||
function BTextView.UndoState(isRedo : boolean) : undo_state;
|
||||
begin
|
||||
Result := BTextView_UndoState(CPlusObject, isRedo);
|
||||
end;
|
||||
|
||||
procedure BTextView.GetDragParameters(drag : BMessage; bitmap : TBitmap; point : BPoint; handler : BHandler);
|
||||
begin
|
||||
BTextView_GetDragParameters(CPlusObject, drag.CPlusObject, bitmap.CPlusObject, point.CPlusObject, handler.CPlusObject);
|
||||
end;
|
||||
}
|
||||
|
||||
|
||||
end.
|
||||
544
bepascal/source/bepascal/pas/src/be/interface/view.pp
Normal file
544
bepascal/source/bepascal/pas/src/be/interface/view.pp
Normal file
@@ -0,0 +1,544 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
24/5/2003 : Eric : Add Show,Hide,IsHidden
|
||||
}
|
||||
|
||||
unit View;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, handler, rect, os, application, appdefs, message,
|
||||
graphicdefs, fdblib;
|
||||
|
||||
type
|
||||
// TWindow = class(TBeObject);
|
||||
BView = class(BHandler)
|
||||
public
|
||||
constructor Create(frame : BRect; name : PChar; resizingMode, flags : Cardinal);
|
||||
destructor Destroy; override;
|
||||
// hook functions
|
||||
procedure AllAttached; virtual;
|
||||
procedure AllDetached; virtual;
|
||||
procedure AttachedToWindow; virtual;
|
||||
procedure DetachedFromWindow; virtual;
|
||||
procedure Draw(updateRect : BRect); virtual;
|
||||
procedure DrawAfterChildren(updateRect : BRect); virtual;
|
||||
procedure FrameMoved(parenBPoint : BPoint); virtual;
|
||||
procedure FrameResized(width, height : double); virtual;
|
||||
procedure GetPreferredSize(var width : double; var height : double); virtual;
|
||||
procedure ResizeToPreferred; virtual;
|
||||
procedure KeyDown(bytes : PChar; numBytes : integer); virtual;
|
||||
procedure KeyUp(bytes : PChar; numBytes : integer); virtual;
|
||||
procedure MouseDown(point : BPoint); virtual;
|
||||
procedure MouseMoved(point : BPoint; transit : Cardinal; message : BMessage); virtual;
|
||||
procedure MouseUp(point : BPoint); virtual;
|
||||
procedure Pulse; virtual;
|
||||
// procedure TargetedByScrollView(scroller : TScrollView); virtual; // Need BScrollView
|
||||
procedure WindowActivated(active : boolean); virtual;
|
||||
procedure MessageReceived(aMessage : BMessage); override;
|
||||
// End hook functions
|
||||
function RemoveSelf : boolean;
|
||||
procedure AddChild(aView, before : BView);
|
||||
function RemoveChild(aView : BView) : boolean;
|
||||
function CountChildren : integer;
|
||||
function ChildAt(index : integer) : BView;
|
||||
function NextSibling : BView;
|
||||
function PreviousSibling : BView;
|
||||
// function Window : TWindow;
|
||||
procedure SetViewColor(rgb_color : RGB_color);
|
||||
procedure Show;
|
||||
procedure Hide;
|
||||
function IsHidden : Boolean;
|
||||
end;
|
||||
|
||||
function BView_Create(AObject : TObject; frame : TCPlusObject; name : PChar;
|
||||
resizingMode, flags : cardinal) : TCplusObject; cdecl; external BePascalLibName name 'BView_Create_1';
|
||||
procedure BView_Free(CPlusObject : TCPlusObject); cdecl; external BePascalLibName name 'BView_Free';
|
||||
function BView_RemoveSelf(CPlusObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BView_RemoveSelf';
|
||||
procedure BView_AddChild(CPlusObject : TCPlusObject; aView : TCPlusObject; before : TCPlusObject); cdecl; external BePascalLibName name 'BView_AddChild';
|
||||
function BView_RemoveChild(CPlusObject : TCPlusObject; aView : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BView_RemoveChild';
|
||||
function BView_CountChildren(CPlusObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BView_CountChildren';
|
||||
function BView_NextSibling(CPlusObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BView_NextSibling';
|
||||
function BView_PreviousSibling(CPlusObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BView_NextSibling';
|
||||
function BView_ChildAt(CPlusObject : TCPlusObject; index : integer) : TCPlusObject; cdecl; external BePascalLibName name 'BView_ChildAt';
|
||||
function BView_Window(CPlusObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BView_Window';
|
||||
procedure BView_Draw(CPlusObject : TCPlusObject; aRect : TCPlusObject); cdecl; external BePascalLibName name 'BView_Draw';
|
||||
procedure BView_SeBViewColor(CPlusObject : TCPlusObject; c : RGB_color); cdecl; external BePascalLibName name 'BView_SetViewColor';
|
||||
procedure BView_Show(CPlusObject : TCPlusObject); cdecl; external BePascalLibName name 'BView_Show';
|
||||
procedure BView_Hide(CPlusObject : TCPlusObject); cdecl; external BePascalLibName name 'BView_Hide';
|
||||
function BView_IsHidden(CPlusObject : TCPlusObject) : Boolean; cdecl; external BePascalLibName name 'BView_IsHidden';
|
||||
|
||||
var
|
||||
// resizingMode mask
|
||||
B_FOLLOW_NONE : Cardinal;
|
||||
B_FOLLOW_ALL_SIDES : Cardinal;
|
||||
|
||||
B_FOLLOW_ALL : Cardinal;
|
||||
|
||||
B_FOLLOW_LEFT : Cardinal;
|
||||
B_FOLLOW_RIGHT : Cardinal;
|
||||
B_FOLLOW_LEFT_RIGHT : Cardinal;
|
||||
B_FOLLOW_H_CENTER : Cardinal;
|
||||
|
||||
B_FOLLOW_TOP : Cardinal;
|
||||
B_FOLLOW_BOTTOM : Cardinal;
|
||||
B_FOLLOW_TOP_BOTTOM : Cardinal;
|
||||
B_FOLLOW_V_CENTER : Cardinal;
|
||||
|
||||
const
|
||||
// flags
|
||||
B_FULL_UPDATE_ON_RESIZE : Cardinal = $80000000;//31;
|
||||
_B_RESERVED1_ : Cardinal = $40000000;//30;
|
||||
B_WILL_DRAW : Cardinal = $20000000;//29;
|
||||
B_PULSE_NEEDED : Cardinal = $10000000;//28;
|
||||
B_NAVIGABLE_JUMP : Cardinal = $08000000;//27;
|
||||
B_FRAME_EVENTS : Cardinal = $04000000;//26;
|
||||
B_NAVIGABLE : Cardinal = $02000000;//25;
|
||||
B_SUBPIXEL_PRECISE : Cardinal = $00800000;//24;
|
||||
B_DRAW_ON_CHILDREN : Cardinal = $00400000;//23;
|
||||
_B_RESERVED7_ : Cardinal = $00200000;//22;
|
||||
|
||||
B_FONT_FAMILY_AND_STYLE = 1;
|
||||
B_FONT_SIZE = 2;
|
||||
B_FONT_SHEAR = 4;
|
||||
B_FONT_ROTATION = 8;
|
||||
B_FONT_SPACING = 16;
|
||||
B_FONT_ENCODING = 32;
|
||||
B_FONT_FACE = 64;
|
||||
B_FONT_FLAGS = 128;
|
||||
B_FONT_ALL = 255;
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
View_AllAttached_hook : Pointer; cvar; external;
|
||||
View_AllDetached_hook : Pointer; cvar; external;
|
||||
View_AttachedToWindow_hook : Pointer; cvar; external;
|
||||
View_DetachedFromWindow_hook : Pointer; cvar; external;
|
||||
View_Draw_hook : Pointer; cvar; external;
|
||||
View_DrawAfterChildren_hook : Pointer; cvar; external;
|
||||
View_FrameMoved_hook : Pointer; cvar; external;
|
||||
View_FrameResized_hook : Pointer; cvar; external;
|
||||
View_GetPreferredSize_hook : Pointer; cvar; external;
|
||||
View_ResizeToPreferred_hook : Pointer; cvar; external;
|
||||
View_KeyDown_hook : Pointer; cvar; external;
|
||||
View_KeyUp_hook : Pointer; cvar; external;
|
||||
View_MouseDown_hook : Pointer; cvar; external;
|
||||
View_MouseMoved_hook : Pointer; cvar; external;
|
||||
View_MouseUp_hook : Pointer; cvar; external;
|
||||
View_Pulse_hook : Pointer; cvar; external;
|
||||
View_TargetedByScrollView_hook : Pointer; cvar; external;
|
||||
View_WindowActivated_hook : Pointer; cvar; external;
|
||||
|
||||
// View hook functions
|
||||
{
|
||||
View_AllAttached_hook
|
||||
View_AllDetached_hook
|
||||
View_AttachedToWindow_hook
|
||||
View_DetachedFromWindow_hook
|
||||
View_Draw_hook
|
||||
View_DrawAfterChildren_hook
|
||||
View_FrameMoved_hook
|
||||
View_FrameResized_hook
|
||||
View_GetPreferredSize_hook
|
||||
View_ResizeToPreferred_hook
|
||||
View_KeyDown_hook
|
||||
View_KeyUp_hook
|
||||
View_MouseDown_hook
|
||||
View_MouseMoved_hook
|
||||
View_MouseUp_hook
|
||||
View_Pulse_hook
|
||||
View_TargetedByScrollView_hook
|
||||
View_WindowActivated_hook}
|
||||
|
||||
|
||||
constructor BView.Create(frame : BRect; name : PChar; resizingMode, flags : Cardinal);
|
||||
begin
|
||||
inherited Create;
|
||||
CPlusObject := BView_Create(Self, frame.CPlusObject, name, resizingMode, flags);
|
||||
end;
|
||||
|
||||
destructor BView.Destroy;
|
||||
begin
|
||||
BView_Free(Self.CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
// Hook functions
|
||||
procedure BView.AllAttached;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.AllDetached;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.AttachedToWindow;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.DetachedFromWindow;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.Draw(updateRect : BRect);
|
||||
begin
|
||||
SendText('Drawing view');
|
||||
|
||||
end;
|
||||
|
||||
procedure BView.DrawAfterChildren(updateRect : BRect);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.FrameMoved(parenBPoint : BPoint);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.FrameResized(width, height : double);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.GetPreferredSize(var width : double; var height : double);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.ResizeToPreferred;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.KeyUp(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.MouseDown(point : BPoint);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.MouseMoved(point : BPoint; transit : Cardinal; message : BMessage);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.MouseUp(point : BPoint);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.Pulse;
|
||||
begin
|
||||
end;
|
||||
|
||||
// procedure BView.TargetedByScrollView(); // Need BScrollView
|
||||
//begin
|
||||
//end;
|
||||
|
||||
procedure BView.WindowActivated(active : boolean);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure BView.MessageReceived(aMessage : BMessage);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BView.RemoveSelf : boolean;
|
||||
begin
|
||||
Result := BView_RemoveSelf(Self.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BView.AddChild(aView, before : BView);
|
||||
begin
|
||||
if before <> nil then
|
||||
BView_AddChild(Self.CPlusObject, aView.CPlusObject, before.CPlusObject)
|
||||
else
|
||||
BView_AddChild(Self.CPlusObject, aView.CPlusObject, nil);
|
||||
end;
|
||||
|
||||
function BView.RemoveChild(aView : BView) : boolean;
|
||||
begin
|
||||
Result := BView_RemoveChild(Self.CPlusObject, aView);
|
||||
end;
|
||||
|
||||
function BView.CountChildren : integer;
|
||||
begin
|
||||
Result := BView_CountChildren(Self.CPlusObject);
|
||||
end;
|
||||
|
||||
function BView.ChildAt(index : integer) : BView;
|
||||
begin
|
||||
Result := BView.Wrap(BView_ChildAt(Self.CPlusObject, index));
|
||||
end;
|
||||
|
||||
function BView.NextSibling : BView;
|
||||
begin
|
||||
Result := BView.Wrap(BView_NextSibling(Self.CPlusObject));
|
||||
end;
|
||||
|
||||
function BView.PreviousSibling : BView;
|
||||
begin
|
||||
Result := BView.Wrap(BView_PreviousSibling(Self.CPlusObject));
|
||||
end;
|
||||
|
||||
{function BView.Window : TWindow;
|
||||
begin
|
||||
Result := TWindow.Wrap(BView_Window(Self.CPlusObject));
|
||||
end;}
|
||||
|
||||
procedure BView.SetViewColor(rgb_color : RGB_color);
|
||||
begin
|
||||
BView_SeBViewColor(Self.CPlusObject, rgb_color);
|
||||
end;
|
||||
|
||||
procedure BView.Show;
|
||||
begin
|
||||
BView_Show(Self.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BView.Hide;
|
||||
begin
|
||||
BView_Hide(Self.CPlusObject);
|
||||
end;
|
||||
|
||||
function BView.IsHidden : Boolean;
|
||||
begin
|
||||
Result:=BView_IsHidden(Self.CPlusObject);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Hook functions
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
procedure View_AllAttached_hook_func(View : BView); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.AllAttached;
|
||||
end;
|
||||
|
||||
procedure View_AllDetached_hook_func(View : BView); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.AllDetached;
|
||||
end;
|
||||
|
||||
procedure View_AttachedToWindow_hook_func(View : BView); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.AttachedToWindow;
|
||||
end;
|
||||
|
||||
procedure View_DetachedFromWindow_hook_func(View : BView); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.DetachedFromWindow;
|
||||
end;
|
||||
|
||||
procedure View_Draw_hook_func(View : BView; aRect : TCPlusObject); cdecl;
|
||||
var
|
||||
Rect : BRect;
|
||||
begin
|
||||
Rect := BRect.Wrap(aRect);
|
||||
try
|
||||
if View <> nil then
|
||||
View.Draw(Rect);
|
||||
finally
|
||||
Rect.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure View_DrawAfterChildren_hook_func(View : BView; aRect : TCPlusObject); cdecl;
|
||||
var
|
||||
Rect : BRect;
|
||||
begin
|
||||
Rect := BRect.Wrap(aRect);
|
||||
try
|
||||
if View <> nil then
|
||||
View.DrawAfterChildren(Rect);
|
||||
finally
|
||||
Rect.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure View_FrameMoved_hook_func(View : BView; aPoint : TCPlusObject); cdecl;
|
||||
var
|
||||
Point : BPoint;
|
||||
begin
|
||||
Point := BPoint.Wrap(aPoint);
|
||||
try
|
||||
if View <> nil then
|
||||
View.FrameMoved(Point);
|
||||
finally
|
||||
Point.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure View_FrameResized_hook_func(View : BView; width, height : double); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.FrameResized(width, height);
|
||||
end;
|
||||
|
||||
procedure View_GetPreferredSize_hook_func(View : BView; var width, height : double); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.GetPreferredSize(width, height);
|
||||
end;
|
||||
|
||||
procedure View_ResizeToPreferred_hook_func(View : BView); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.ResizeToPreferred;
|
||||
end;
|
||||
|
||||
procedure View_KeyDown_hook_func(View : BView; bytes : PChar; numBytes : integer); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.KeyDown(bytes, numBytes);
|
||||
end;
|
||||
|
||||
procedure View_KeyUp_hook_func(View : BView; bytes : PChar; numBytes : integer); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.KeyUp(bytes, numBytes);
|
||||
end;
|
||||
|
||||
procedure View_MouseDown_hook_func(View : BView; aPoint : TCPlusObject); cdecl;
|
||||
var
|
||||
Point : BPoint;
|
||||
begin
|
||||
Point := BPoint.Wrap(aPoint);
|
||||
try
|
||||
if View <> nil then
|
||||
View.MouseDown(Point);
|
||||
finally
|
||||
Point.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure View_MouseMoved_hook_func(View : BView; aPoint : TCPlusObject; transit : Cardinal; aMessage : TCPlusObject); cdecl;
|
||||
var
|
||||
Point : BPoint;
|
||||
Message : BMessage;
|
||||
begin
|
||||
Point := BPoint.Wrap(aPoint);
|
||||
try
|
||||
Message := BMessage.Wrap(aMessage);
|
||||
try
|
||||
if View <> nil then
|
||||
View.MouseMoved(Point, transit, Message);
|
||||
finally
|
||||
Message.UnWrap;
|
||||
end;
|
||||
finally
|
||||
Point.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure View_MouseUp_hook_func(View : BView; aPoint : TCPlusObject); cdecl;
|
||||
var
|
||||
Point : BPoint;
|
||||
begin
|
||||
Point := BPoint.Wrap(aPoint);
|
||||
try
|
||||
if View <> nil then
|
||||
View.MouseDown(Point);
|
||||
finally
|
||||
Point.UnWrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure View_Pulse_hook_func(View : BView); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.Pulse;
|
||||
end;
|
||||
|
||||
//procedure View_TargetedByScrollView_hook_func(View : BView; scroller : TScrollView); cdecl;
|
||||
//var
|
||||
// ScrollView : TScrollView;
|
||||
//begin
|
||||
// ScrollView := TScrollView.Wrap(scroller);
|
||||
// try
|
||||
// if View <> nil then
|
||||
// View.TargetedByScrollView(ScrollView);
|
||||
// finally
|
||||
// ScrollView.UnWrap;
|
||||
// end;
|
||||
//end;
|
||||
|
||||
procedure View_WindowActivated_hook_func(View : BView; active : boolean); cdecl;
|
||||
begin
|
||||
if View <> nil then
|
||||
View.WindowActivated(active);
|
||||
end;
|
||||
|
||||
var
|
||||
_B_FOLLOW_NONE : Cardinal; cvar; external;
|
||||
_B_FOLLOW_ALL_SIDES : Cardinal; cvar; external;
|
||||
|
||||
_B_FOLLOW_ALL : Cardinal; cvar; external;
|
||||
|
||||
_B_FOLLOW_LEFT : Cardinal; cvar; external;
|
||||
_B_FOLLOW_RIGHT : Cardinal; cvar; external;
|
||||
_B_FOLLOW_LEFT_RIGHT : Cardinal; cvar; external;
|
||||
_B_FOLLOW_H_CENTER : Cardinal; cvar; external;
|
||||
|
||||
_B_FOLLOW_TOP : Cardinal; cvar; external;
|
||||
_B_FOLLOW_BOTTOM : Cardinal; cvar; external;
|
||||
_B_FOLLOW_TOP_BOTTOM : Cardinal; cvar; external;
|
||||
_B_FOLLOW_V_CENTER : Cardinal; cvar; external;
|
||||
|
||||
initialization
|
||||
B_FOLLOW_NONE := _B_FOLLOW_NONE;
|
||||
B_FOLLOW_ALL_SIDES := _B_FOLLOW_ALL_SIDES;
|
||||
|
||||
B_FOLLOW_ALL := _B_FOLLOW_ALL;
|
||||
|
||||
B_FOLLOW_LEFT := _B_FOLLOW_LEFT;
|
||||
B_FOLLOW_RIGHT := _B_FOLLOW_RIGHT;
|
||||
B_FOLLOW_LEFT_RIGHT := _B_FOLLOW_LEFT_RIGHT;
|
||||
B_FOLLOW_H_CENTER := _B_FOLLOW_H_CENTER;
|
||||
|
||||
B_FOLLOW_TOP := _B_FOLLOW_TOP;
|
||||
B_FOLLOW_BOTTOM := _B_FOLLOW_BOTTOM;
|
||||
B_FOLLOW_TOP_BOTTOM := _B_FOLLOW_TOP_BOTTOM;
|
||||
B_FOLLOW_V_CENTER := _B_FOLLOW_V_CENTER;
|
||||
|
||||
// Connecting hook functions
|
||||
View_AllAttached_hook := @View_AllAttached_hook_func;
|
||||
View_AllDetached_hook := @View_AllDetached_hook_func;
|
||||
View_AttachedToWindow_hook := @View_AttachedToWindow_hook_func;
|
||||
View_DetachedFromWindow_hook := @View_DetachedFromWindow_hook_func;
|
||||
View_Draw_hook := @View_Draw_hook_func;
|
||||
View_DrawAfterChildren_hook := @View_DrawAfterChildren_hook_func;
|
||||
View_FrameMoved_hook := @View_FrameMoved_hook_func;
|
||||
View_FrameResized_hook := @View_FrameResized_hook_func;
|
||||
View_GetPreferredSize_hook := @View_GetPreferredSize_hook_func;
|
||||
View_ResizeToPreferred_hook := @View_ResizeToPreferred_hook_func;
|
||||
View_KeyDown_hook := @View_KeyDown_hook_func;
|
||||
View_KeyUp_hook := @View_KeyUp_hook_func;
|
||||
View_MouseDown_hook := @View_MouseDown_hook_func;
|
||||
View_MouseMoved_hook := @View_MouseMoved_hook_func;
|
||||
View_MouseUp_hook := @View_MouseUp_hook_func;
|
||||
View_Pulse_hook := @View_Pulse_hook_func;
|
||||
// View_TargetedByScrollView_hook := @View_TargetedByScrollView_hook_func;
|
||||
View_WindowActivated_hook := @View_WindowActivated_hook_func;
|
||||
|
||||
end.
|
||||
1367
bepascal/source/bepascal/pas/src/be/interface/window.pp
Normal file
1367
bepascal/source/bepascal/pas/src/be/interface/window.pp
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user