Minor update
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include <Archivable.h>
|
||||
|
||||
#include <Roster.cpp>
|
||||
#include <Message.cpp>
|
||||
#include <Message.h>
|
||||
#include <Archivable.cpp>
|
||||
#include <Handler.cpp>
|
||||
#include <Looper.cpp>
|
||||
@@ -31,6 +31,9 @@
|
||||
#include <View.cpp>
|
||||
#include <Point.cpp>
|
||||
#include <Rect.cpp>
|
||||
#include <SerialPort.cpp>
|
||||
|
||||
// #include <Control.cpp>
|
||||
|
||||
#include <beobj.cpp>
|
||||
|
||||
@@ -53,7 +56,7 @@ BApplication_ReadyToRun_hook Application_ReadyToRun_hook;
|
||||
}
|
||||
#endif
|
||||
|
||||
class BPApplication : public BApplication, public BPLooper
|
||||
class BPApplication : public BApplication, public virtual BPLooper
|
||||
{
|
||||
public:
|
||||
BPApplication(TPasObject PasObject, const char *signature);
|
||||
@@ -67,13 +70,16 @@ class BPApplication : public BApplication, public BPLooper
|
||||
};
|
||||
|
||||
BPApplication::BPApplication(TPasObject PasObject, const char *signature)
|
||||
: BApplication(signature), BPLooper(PasObject)
|
||||
: BApplication(signature), BPLooper(PasObject), BPHandler(PasObject),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BPApplication::BPApplication(TPasObject PasObject, const char *signature,
|
||||
status_t *error) : BApplication(signature, error), BPLooper(PasObject)
|
||||
status_t *error) : BApplication(signature, error), BPLooper(PasObject),
|
||||
BPHandler(PasObject),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -37,10 +37,11 @@ BHandler_MessageReceived_hook Handler_MessageReceived_hook;
|
||||
}
|
||||
#endif
|
||||
|
||||
class BPHandler : public BHandler, public BPasObject
|
||||
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);
|
||||
private:
|
||||
@@ -50,6 +51,11 @@ BPHandler::BPHandler(TPasObject PasObject, const char *name)
|
||||
: BHandler(name), BPasObject(PasObject)
|
||||
{
|
||||
|
||||
}
|
||||
BPHandler::BPHandler(TPasObject PasObject, BMessage *archive)
|
||||
: BHandler(archive), BPasObject(PasObject)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BPHandler::~BPHandler()
|
||||
|
||||
@@ -44,7 +44,7 @@ BLooper_QuitRequested_hook Looper_QuitRequested_hook;
|
||||
}
|
||||
#endif
|
||||
|
||||
class BPLooper : public BLooper, public BPHandler
|
||||
class BPLooper : public BLooper, public virtual BPHandler
|
||||
{
|
||||
public:
|
||||
BPLooper(TPasObject PasObject, const char *name = NULL,
|
||||
@@ -60,7 +60,8 @@ 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)
|
||||
BPHandler(PasObject, name),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ const
|
||||
type
|
||||
// BePascal types
|
||||
TCPlusObject = Pointer;
|
||||
THandle = Pointer;
|
||||
|
||||
TBeObject = class(TObject)
|
||||
private
|
||||
|
||||
@@ -86,7 +86,7 @@ BView_WindowActivated_hook View_WindowActivated_hook;
|
||||
}
|
||||
#endif
|
||||
|
||||
class BPView : public BView, public BPHandler
|
||||
class BPView : public BView, public virtual BPHandler
|
||||
{
|
||||
public:
|
||||
BPView(TPasObject PasObject,
|
||||
@@ -94,6 +94,7 @@ class BPView : public BView, public BPHandler
|
||||
const char *name,
|
||||
uint32 resizingMode,
|
||||
uint32 flags);
|
||||
BPView(TPasObject PasObject, BMessage *archive);
|
||||
// virtual void DispatchMessage(BMessage *message, BHandler *target);
|
||||
// virtual bool QuitRequested(void);
|
||||
virtual void AllAttached(void);
|
||||
@@ -123,7 +124,15 @@ BPView::BPView(TPasObject PasObject,
|
||||
uint32 resizingMode,
|
||||
uint32 flags)
|
||||
: BView(frame, name, resizingMode, flags),
|
||||
BPHandler(PasObject)
|
||||
BPHandler(PasObject),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
BPView::BPView(TPasObject PasObject, BMessage *archive)
|
||||
: BView(archive),
|
||||
BPHandler(PasObject),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -423,6 +432,7 @@ BView_Window(BView *View)
|
||||
|
||||
|
||||
// TODO : implement hook function
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::Draw
|
||||
* Params: BRect updateRect
|
||||
@@ -437,6 +447,31 @@ BView_Draw(BView *View, BRect updateRect)
|
||||
|
||||
// END TODO implement hook function
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::SetViewColor
|
||||
* Params: rgb_color c
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BView_SetViewColor(BView *View, rgb_color c)
|
||||
{
|
||||
View->SetViewColor(c);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BView::ViewColor
|
||||
* Params:
|
||||
* Returns: rgb_color
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
rgb_color
|
||||
BView_ViewColor(BView *View)
|
||||
{
|
||||
return View->ViewColor();
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -58,7 +58,9 @@ BPWindow::BPWindow(TPasObject PasObject,
|
||||
uint32 flags,
|
||||
uint32 workspaces = B_CURRENT_WORKSPACE)
|
||||
: BWindow(frame, title, type, flags, workspaces),
|
||||
BPLooper(PasObject)
|
||||
BPLooper(PasObject),
|
||||
BPHandler(PasObject, title),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ unit View;
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, handler, rect, os, application, appdefs, message;
|
||||
beobj, handler, rect, os, application, appdefs, message,
|
||||
graphicdefs;
|
||||
|
||||
type
|
||||
// TWindow = class(TBeObject);
|
||||
@@ -57,6 +58,7 @@ type
|
||||
function NextSibling : TView;
|
||||
function PreviousSibling : TView;
|
||||
// function Window : TWindow;
|
||||
procedure SetViewColor(rgb_color : TRGB_color);
|
||||
end;
|
||||
|
||||
function BView_Create(AObject : TObject; frame : TCPlusObject; name : PChar;
|
||||
@@ -71,6 +73,7 @@ function BView_PreviousSibling(CPlusObject : TCPlusObject) : TCPlusObject; cdecl
|
||||
function BView_ChildAt(CPlusObject : TCPlusObject; index : integer) : TCPlusObject; cdecl; external BePascalLibName name 'BView_ChildAt';
|
||||
function BView_Window(CPlusObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BView_Window';
|
||||
procedure BView_Draw(CPlusObject : TCPlusObject; aRect : TCPlusObject); cdecl; external BePascalLibName name 'BView_Draw';
|
||||
procedure BView_SetViewColor(CPlusObject : TCPlusObject; c : TRGB_color); cdecl; external BePascalLibName name 'BView_SetViewColor';
|
||||
|
||||
var
|
||||
// resizingMode mask
|
||||
@@ -273,6 +276,11 @@ begin
|
||||
Result := TWindow.Wrap(BView_Window(Self.CPlusObject));
|
||||
end;}
|
||||
|
||||
procedure TView.SetViewColor(rgb_color : TRGB_color);
|
||||
begin
|
||||
BView_SetViewColor(Self.CPlusObject, rgb_color);
|
||||
end;
|
||||
|
||||
// Hook functions
|
||||
procedure View_AllAttached_hook_func(View : TView); cdecl;
|
||||
begin
|
||||
|
||||
@@ -30,6 +30,11 @@ const
|
||||
B_URGENT_PRIORITY = 110;
|
||||
B_REAL_TIME_PRIORITY = 120;
|
||||
|
||||
const
|
||||
B_OS_NAME_LENGTH = 32;
|
||||
B_PAGE_SIZE = 4096;
|
||||
B_INFINITE_TIMEOUT = 9223372036854775807;
|
||||
|
||||
type
|
||||
TThread_id = Longint;
|
||||
|
||||
|
||||
@@ -32,6 +32,10 @@ type
|
||||
|
||||
// TODO : import other functions !
|
||||
|
||||
// import from stddef.h
|
||||
TSize_t = Cardinal;
|
||||
TSSize_t = Longint;
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user