Minor update

This commit is contained in:
ocoursiere
2002-09-22 12:33:00 +00:00
parent 5aac0739ca
commit d6e0e93eed
9 changed files with 79 additions and 11 deletions

View File

@@ -23,7 +23,7 @@
#include <Archivable.h> #include <Archivable.h>
#include <Roster.cpp> #include <Roster.cpp>
#include <Message.cpp> #include <Message.h>
#include <Archivable.cpp> #include <Archivable.cpp>
#include <Handler.cpp> #include <Handler.cpp>
#include <Looper.cpp> #include <Looper.cpp>
@@ -31,6 +31,9 @@
#include <View.cpp> #include <View.cpp>
#include <Point.cpp> #include <Point.cpp>
#include <Rect.cpp> #include <Rect.cpp>
#include <SerialPort.cpp>
// #include <Control.cpp>
#include <beobj.cpp> #include <beobj.cpp>
@@ -53,7 +56,7 @@ BApplication_ReadyToRun_hook Application_ReadyToRun_hook;
} }
#endif #endif
class BPApplication : public BApplication, public BPLooper class BPApplication : public BApplication, public virtual BPLooper
{ {
public: public:
BPApplication(TPasObject PasObject, const char *signature); BPApplication(TPasObject PasObject, const char *signature);
@@ -67,13 +70,16 @@ class BPApplication : public BApplication, public BPLooper
}; };
BPApplication::BPApplication(TPasObject PasObject, const char *signature) 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, 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)
{ {
} }

View File

@@ -37,10 +37,11 @@ BHandler_MessageReceived_hook Handler_MessageReceived_hook;
} }
#endif #endif
class BPHandler : public BHandler, public BPasObject class BPHandler : public BHandler, public virtual BPasObject
{ {
public: public:
BPHandler(TPasObject PasObject, const char *name = NULL); BPHandler(TPasObject PasObject, const char *name = NULL);
BPHandler(TPasObject PasObject, BMessage *archive);
virtual ~BPHandler(void); virtual ~BPHandler(void);
virtual void MessageReceived(BMessage *message); virtual void MessageReceived(BMessage *message);
private: private:
@@ -50,6 +51,11 @@ BPHandler::BPHandler(TPasObject PasObject, const char *name)
: BHandler(name), BPasObject(PasObject) : BHandler(name), BPasObject(PasObject)
{ {
}
BPHandler::BPHandler(TPasObject PasObject, BMessage *archive)
: BHandler(archive), BPasObject(PasObject)
{
} }
BPHandler::~BPHandler() BPHandler::~BPHandler()

View File

@@ -44,7 +44,7 @@ BLooper_QuitRequested_hook Looper_QuitRequested_hook;
} }
#endif #endif
class BPLooper : public BLooper, public BPHandler class BPLooper : public BLooper, public virtual BPHandler
{ {
public: public:
BPLooper(TPasObject PasObject, const char *name = NULL, 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 priority = B_NORMAL_PRIORITY,
int32 portCapacity = B_LOOPER_PORT_DEFAULT_CAPACITY) int32 portCapacity = B_LOOPER_PORT_DEFAULT_CAPACITY)
: BLooper(name, priority, portCapacity), : BLooper(name, priority, portCapacity),
BPHandler(PasObject, name) BPHandler(PasObject, name),
BPasObject(PasObject)
{ {
} }

View File

@@ -31,6 +31,7 @@ const
type type
// BePascal types // BePascal types
TCPlusObject = Pointer; TCPlusObject = Pointer;
THandle = Pointer;
TBeObject = class(TObject) TBeObject = class(TObject)
private private

View File

@@ -86,7 +86,7 @@ BView_WindowActivated_hook View_WindowActivated_hook;
} }
#endif #endif
class BPView : public BView, public BPHandler class BPView : public BView, public virtual BPHandler
{ {
public: public:
BPView(TPasObject PasObject, BPView(TPasObject PasObject,
@@ -94,6 +94,7 @@ class BPView : public BView, public BPHandler
const char *name, const char *name,
uint32 resizingMode, uint32 resizingMode,
uint32 flags); uint32 flags);
BPView(TPasObject PasObject, BMessage *archive);
// virtual void DispatchMessage(BMessage *message, BHandler *target); // virtual void DispatchMessage(BMessage *message, BHandler *target);
// virtual bool QuitRequested(void); // virtual bool QuitRequested(void);
virtual void AllAttached(void); virtual void AllAttached(void);
@@ -123,7 +124,15 @@ BPView::BPView(TPasObject PasObject,
uint32 resizingMode, uint32 resizingMode,
uint32 flags) uint32 flags)
: BView(frame, name, resizingMode, 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 // TODO : implement hook function
/*********************************************************************** /***********************************************************************
* Method: BView::Draw * Method: BView::Draw
* Params: BRect updateRect * Params: BRect updateRect
@@ -437,6 +447,31 @@ BView_Draw(BView *View, BRect updateRect)
// END TODO implement hook function // 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) #if defined(__cplusplus)
} }
#endif #endif

View File

@@ -58,7 +58,9 @@ BPWindow::BPWindow(TPasObject PasObject,
uint32 flags, uint32 flags,
uint32 workspaces = B_CURRENT_WORKSPACE) uint32 workspaces = B_CURRENT_WORKSPACE)
: BWindow(frame, title, type, flags, workspaces), : BWindow(frame, title, type, flags, workspaces),
BPLooper(PasObject) BPLooper(PasObject),
BPHandler(PasObject, title),
BPasObject(PasObject)
{ {
} }

View File

@@ -21,7 +21,8 @@ unit View;
interface interface
uses uses
beobj, handler, rect, os, application, appdefs, message; beobj, handler, rect, os, application, appdefs, message,
graphicdefs;
type type
// TWindow = class(TBeObject); // TWindow = class(TBeObject);
@@ -57,6 +58,7 @@ type
function NextSibling : TView; function NextSibling : TView;
function PreviousSibling : TView; function PreviousSibling : TView;
// function Window : TWindow; // function Window : TWindow;
procedure SetViewColor(rgb_color : TRGB_color);
end; end;
function BView_Create(AObject : TObject; frame : TCPlusObject; name : PChar; 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_ChildAt(CPlusObject : TCPlusObject; index : integer) : TCPlusObject; cdecl; external BePascalLibName name 'BView_ChildAt';
function BView_Window(CPlusObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BView_Window'; 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_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 var
// resizingMode mask // resizingMode mask
@@ -273,6 +276,11 @@ begin
Result := TWindow.Wrap(BView_Window(Self.CPlusObject)); Result := TWindow.Wrap(BView_Window(Self.CPlusObject));
end;} end;}
procedure TView.SetViewColor(rgb_color : TRGB_color);
begin
BView_SetViewColor(Self.CPlusObject, rgb_color);
end;
// Hook functions // Hook functions
procedure View_AllAttached_hook_func(View : TView); cdecl; procedure View_AllAttached_hook_func(View : TView); cdecl;
begin begin

View File

@@ -29,6 +29,11 @@ const
B_REAL_TIME_DISPLAY_PRIORITY = 100; B_REAL_TIME_DISPLAY_PRIORITY = 100;
B_URGENT_PRIORITY = 110; B_URGENT_PRIORITY = 110;
B_REAL_TIME_PRIORITY = 120; B_REAL_TIME_PRIORITY = 120;
const
B_OS_NAME_LENGTH = 32;
B_PAGE_SIZE = 4096;
B_INFINITE_TIMEOUT = 9223372036854775807;
type type
TThread_id = Longint; TThread_id = Longint;

View File

@@ -32,6 +32,10 @@ type
// TODO : import other functions ! // TODO : import other functions !
// import from stddef.h
TSize_t = Cardinal;
TSSize_t = Longint;
implementation implementation